diff --git a/.gitignore b/.gitignore index 6df3339926..0908c0fd17 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,5 @@ key-build* *# .emacs.desktop* TAGS*~ -git-src \ No newline at end of file +git-src +.git-credentials \ No newline at end of file diff --git a/4m.config b/4m.config new file mode 100644 index 0000000000..8ef31bc66d --- /dev/null +++ b/4m.config @@ -0,0 +1,5378 @@ +# +# Automatically generated file; DO NOT EDIT. +# OpenWrt Configuration +# +CONFIG_MODULES=y +CONFIG_HAVE_DOT_CONFIG=y +# CONFIG_TARGET_sunxi is not set +# CONFIG_TARGET_apm821xx is not set +# CONFIG_TARGET_ath25 is not set +CONFIG_TARGET_ar71xx=y +# CONFIG_TARGET_brcm2708 is not set +# CONFIG_TARGET_bcm53xx is not set +# CONFIG_TARGET_brcm47xx is not set +# CONFIG_TARGET_brcm63xx is not set +# CONFIG_TARGET_cns3xxx is not set +# CONFIG_TARGET_octeon is not set +# CONFIG_TARGET_gemini is not set +# CONFIG_TARGET_mpc85xx is not set +# CONFIG_TARGET_imx6 is not set +# CONFIG_TARGET_mxs is not set +# CONFIG_TARGET_adm8668 is not set +# CONFIG_TARGET_adm5120 is not set +# CONFIG_TARGET_xburst is not set +# CONFIG_TARGET_ixp4xx is not set +# CONFIG_TARGET_lantiq is not set +# CONFIG_TARGET_malta is not set +# CONFIG_TARGET_pistachio is not set +# CONFIG_TARGET_mvebu is not set +# CONFIG_TARGET_kirkwood is not set +# CONFIG_TARGET_mediatek is not set +# CONFIG_TARGET_ramips is not set +# CONFIG_TARGET_at91 is not set +# CONFIG_TARGET_rb532 is not set +# CONFIG_TARGET_mcs814x is not set +# CONFIG_TARGET_layerscape is not set +# CONFIG_TARGET_oxnas is not set +# CONFIG_TARGET_armvirt is not set +# CONFIG_TARGET_ipq806x is not set +# CONFIG_TARGET_au1000 is not set +# CONFIG_TARGET_arc770 is not set +# CONFIG_TARGET_archs38 is not set +# CONFIG_TARGET_ar7 is not set +# CONFIG_TARGET_omap is not set +# CONFIG_TARGET_uml is not set +# CONFIG_TARGET_zynq is not set +# CONFIG_TARGET_x86 is not set +# CONFIG_TARGET_ar71xx_generic is not set +CONFIG_TARGET_ar71xx_tiny=y +# CONFIG_TARGET_ar71xx_nand is not set +# CONFIG_TARGET_ar71xx_mikrotik is not set +# CONFIG_TARGET_MULTI_PROFILE is not set +# CONFIG_TARGET_ar71xx_tiny_Default is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_A02RBW300N is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WHRG301N is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WHRHPG300N is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WHRHPGN is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WLAEAG300N is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WP543_4M is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WPE72_4M is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_DIR600A1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_DIR601A1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_DIR601B1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_DIR615C1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_DIR615E1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_DIR615E4 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_DIR615I1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_DIR615I3 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_EBR2310C1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_FR54RTR is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_REALWNR1000V2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WNR1000V2_VC is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WNR2000 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WNR2000V3 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WNR2000V4 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_REALWNR612V2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WPN824N is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_N150R is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_rnx-n360rt is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr10u-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr11u-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr11u-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr12u-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr13u-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr3020-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr3040-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr3040-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr3220-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr3220-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr3420-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr3420-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa701nd-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa701nd-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa7210n-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa730re-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa750re-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa7510n-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa801nd-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa801nd-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa801nd-v3 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa830re-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa830re-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa850re-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa850re-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa855re-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa860re-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa901nd-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa901nd-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa901nd-v3 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa901nd-v4 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa901nd-v5 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wdr3320-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr1041n-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr2041n-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr2041n-v2 is not set +CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr703n-v1=y +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr710n-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr720n-v3 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr720n-v4 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr740n-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr740n-v3 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr740n-v4 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr740n-v5 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr740n-v6 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr741nd-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr741nd-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr741nd-v4 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr741nd-v5 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr743nd-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr743nd-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr802n-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr802n-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr840n-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr840n-v3 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr841-v1.5 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr841-v10 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr841-v11 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr841-v12 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr841-v3 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr841-v5 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr841-v7 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr841-v8 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr841-v9 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr843nd-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr847n-v8 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr940n-v4 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr941nd-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr941nd-v3 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr941nd-v4 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr941nd-v5 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr941nd-v6 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr941nd-v6-cn is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr941n-v7 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_TEW632BRP is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_TEW652BRP_FW is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_TEW652BRP_RECOVERY is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_TEW712BR is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_NBG_460N_550N_550NH is not set +CONFIG_HAS_SUBTARGETS=y +CONFIG_HAS_DEVICES=y +CONFIG_TARGET_BOARD="ar71xx" +CONFIG_TARGET_SUBTARGET="tiny" +CONFIG_TARGET_PROFILE="DEVICE_tl-wr703n-v1" +CONFIG_TARGET_ARCH_PACKAGES="mips_24kc" +CONFIG_DEFAULT_TARGET_OPTIMIZATION="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc" +CONFIG_CPU_TYPE="24kc" +CONFIG_LINUX_4_4=y +CONFIG_DEFAULT_base-files=y +CONFIG_DEFAULT_busybox=y +CONFIG_DEFAULT_dnsmasq-full=y +CONFIG_DEFAULT_dropbear=y +CONFIG_DEFAULT_firewall=y +CONFIG_DEFAULT_fstools=y +CONFIG_DEFAULT_ip6tables=y +CONFIG_DEFAULT_iptables=y +CONFIG_DEFAULT_iwinfo=y +CONFIG_DEFAULT_kmod-ath9k=y +CONFIG_DEFAULT_kmod-gpio-button-hotplug=y +CONFIG_DEFAULT_kmod-usb-core=y +CONFIG_DEFAULT_kmod-usb2=y +CONFIG_DEFAULT_libc=y +CONFIG_DEFAULT_libgcc=y +CONFIG_DEFAULT_logd=y +CONFIG_DEFAULT_mtd=y +CONFIG_DEFAULT_netifd=y +CONFIG_DEFAULT_opkg=y +CONFIG_DEFAULT_ppp=y +CONFIG_DEFAULT_ppp-mod-pppoe=y +CONFIG_DEFAULT_swconfig=y +CONFIG_DEFAULT_uboot-envtools=y +CONFIG_DEFAULT_uci=y +CONFIG_DEFAULT_uclient-fetch=y +CONFIG_DEFAULT_wpad-mini=y +CONFIG_AUDIO_SUPPORT=y +CONFIG_GPIO_SUPPORT=y +CONFIG_PCI_SUPPORT=y +CONFIG_USB_SUPPORT=y +CONFIG_USB_GADGET_SUPPORT=y +CONFIG_BIG_ENDIAN=y +CONFIG_USES_DEVICETREE=y +CONFIG_USES_SQUASHFS=y +CONFIG_SMALL_FLASH=y +CONFIG_HAS_MIPS16=y +CONFIG_mips=y +CONFIG_ARCH="mips" + +# +# Target Images +# +# CONFIG_TARGET_ROOTFS_INITRAMFS is not set +CONFIG_EXTERNAL_CPIO="" + +# +# Root filesystem archives +# +# CONFIG_TARGET_ROOTFS_CPIOGZ is not set +# CONFIG_TARGET_ROOTFS_TARGZ is not set + +# +# Root filesystem images +# +# CONFIG_TARGET_ROOTFS_EXT4FS is not set +CONFIG_TARGET_ROOTFS_SQUASHFS=y +CONFIG_TARGET_SQUASHFS_BLOCK_SIZE=256 +CONFIG_TARGET_UBIFS_FREE_SPACE_FIXUP=y +CONFIG_TARGET_UBIFS_JOURNAL_SIZE="" + +# +# Image Options +# + +# +# Global build settings +# +# CONFIG_ALL_NONSHARED is not set +# CONFIG_ALL_KMODS is not set +# CONFIG_ALL is not set +# CONFIG_BUILDBOT is not set +CONFIG_SIGNED_PACKAGES=y + +# +# General build options +# +# CONFIG_DISPLAY_SUPPORT is not set +CONFIG_BUILD_PATENTED=y +# CONFIG_BUILD_NLS is not set +CONFIG_SHADOW_PASSWORDS=y +# CONFIG_CLEAN_IPKG is not set +# CONFIG_INCLUDE_CONFIG is not set +# CONFIG_COLLECT_KERNEL_DEBUG is not set + +# +# Kernel build options +# +CONFIG_KERNEL_BUILD_USER="" +CONFIG_KERNEL_BUILD_DOMAIN="" +CONFIG_KERNEL_PRINTK=y +CONFIG_KERNEL_CRASHLOG=y +CONFIG_KERNEL_SWAP=y +CONFIG_KERNEL_DEBUG_FS=y +# CONFIG_KERNEL_PERF_EVENTS is not set +# CONFIG_KERNEL_PROFILING is not set +# CONFIG_KERNEL_KALLSYMS is not set +# CONFIG_KERNEL_FTRACE is not set +CONFIG_KERNEL_DEBUG_KERNEL=y +CONFIG_KERNEL_DEBUG_INFO=y +# CONFIG_KERNEL_DYNAMIC_DEBUG is not set +# CONFIG_KERNEL_KPROBES is not set +# CONFIG_KERNEL_AIO is not set +# CONFIG_KERNEL_FHANDLE is not set +# CONFIG_KERNEL_FANOTIFY is not set +# CONFIG_KERNEL_BLK_DEV_BSG is not set +CONFIG_KERNEL_MAGIC_SYSRQ=y +# CONFIG_KERNEL_DEBUG_PINCTRL is not set +# CONFIG_KERNEL_DEBUG_GPIO is not set +CONFIG_KERNEL_COREDUMP=y +CONFIG_KERNEL_ELF_CORE=y +# CONFIG_KERNEL_PROVE_LOCKING is not set +CONFIG_KERNEL_PRINTK_TIME=y +# CONFIG_KERNEL_SLABINFO is not set +# CONFIG_KERNEL_PROC_PAGE_MONITOR is not set +CONFIG_KERNEL_RELAY=y +# CONFIG_KERNEL_KEXEC is not set +# CONFIG_USE_RFKILL is not set +# CONFIG_USE_SPARSE is not set +# CONFIG_KERNEL_DEVTMPFS is not set +# CONFIG_KERNEL_KEYS is not set +# CONFIG_KERNEL_CGROUPS is not set +# CONFIG_KERNEL_NAMESPACES is not set +# CONFIG_KERNEL_LXC_MISC is not set +# CONFIG_KERNEL_SECCOMP_FILTER is not set +# CONFIG_KERNEL_SECCOMP is not set +CONFIG_KERNEL_IPV6=y +CONFIG_KERNEL_IPV6_MULTIPLE_TABLES=y +CONFIG_KERNEL_IPV6_SUBTREES=y +CONFIG_KERNEL_IPV6_MROUTE=y +# CONFIG_KERNEL_IPV6_PIMSM_V2 is not set +# CONFIG_KERNEL_IP_PNP is not set + +# +# Filesystem ACL and attr support options +# +# CONFIG_USE_FS_ACL_ATTR is not set +# CONFIG_KERNEL_FS_POSIX_ACL is not set +# CONFIG_KERNEL_BTRFS_FS_POSIX_ACL is not set +# CONFIG_KERNEL_EXT4_FS_POSIX_ACL is not set +# CONFIG_KERNEL_F2FS_FS_POSIX_ACL is not set +# CONFIG_KERNEL_JFFS2_FS_POSIX_ACL is not set +# CONFIG_KERNEL_TMPFS_POSIX_ACL is not set +# CONFIG_KERNEL_CIFS_ACL is not set +# CONFIG_KERNEL_HFS_FS_POSIX_ACL is not set +# CONFIG_KERNEL_HFSPLUG_FS_POSIX_ACL is not set +# CONFIG_KERNEL_NFS_ACL_SUPPORT is not set +# CONFIG_KERNEL_NFS_V3_ACL_SUPPORT is not set +# CONFIG_KERNEL_NFSD_V2_ACL_SUPPORT is not set +# CONFIG_KERNEL_NFSD_V3_ACL_SUPPORT is not set +# CONFIG_KERNEL_REISER_FS_POSIX_ACL is not set +# CONFIG_KERNEL_XFS_POSIX_ACL is not set +# CONFIG_KERNEL_JFS_POSIX_ACL is not set +# CONFIG_KERNEL_DEVMEM is not set +# CONFIG_KERNEL_DEVKMEM is not set + +# +# Package build options +# +# CONFIG_DEBUG is not set +CONFIG_IPV6=y + +# +# Stripping options +# +# CONFIG_NO_STRIP is not set +# CONFIG_USE_STRIP is not set +CONFIG_USE_SSTRIP=y +# CONFIG_STRIP_KERNEL_EXPORTS is not set +# CONFIG_USE_MKLIBS is not set +CONFIG_USE_UCLIBCXX=y +# CONFIG_USE_LIBSTDCXX is not set + +# +# Hardening build options +# +CONFIG_PKG_CHECK_FORMAT_SECURITY=y +# CONFIG_PKG_CC_STACKPROTECTOR_NONE is not set +CONFIG_PKG_CC_STACKPROTECTOR_REGULAR=y +# CONFIG_KERNEL_CC_STACKPROTECTOR_NONE is not set +CONFIG_KERNEL_CC_STACKPROTECTOR_REGULAR=y +# CONFIG_KERNEL_CC_STACKPROTECTOR_STRONG is not set +# CONFIG_PKG_FORTIFY_SOURCE_NONE is not set +CONFIG_PKG_FORTIFY_SOURCE_1=y +# CONFIG_PKG_FORTIFY_SOURCE_2 is not set +# CONFIG_PKG_RELRO_NONE is not set +# CONFIG_PKG_RELRO_PARTIAL is not set +CONFIG_PKG_RELRO_FULL=y +# CONFIG_DEVEL is not set +# CONFIG_BROKEN is not set +CONFIG_BINARY_FOLDER="" +CONFIG_DOWNLOAD_FOLDER="" +CONFIG_LOCALMIRROR="" +CONFIG_AUTOREBUILD=y +# CONFIG_AUTOREMOVE is not set +CONFIG_BUILD_SUFFIX="" +CONFIG_TARGET_ROOTFS_DIR="" +# CONFIG_CCACHE is not set +CONFIG_EXTERNAL_KERNEL_TREE="" +CONFIG_KERNEL_GIT_CLONE_URI="" +CONFIG_EXTRA_OPTIMIZATION="-fno-caller-saves -fno-plt" +CONFIG_TARGET_OPTIMIZATION="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc" +CONFIG_SOFT_FLOAT=y +CONFIG_USE_MIPS16=y +# CONFIG_EXTRA_TARGET_ARCH is not set +CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS="" +CONFIG_EXTRA_GCC_CONFIG_OPTIONS="" +# CONFIG_SJLJ_EXCEPTIONS is not set +# CONFIG_INSTALL_GFORTRAN is not set +CONFIG_GDB=y +CONFIG_USE_MUSL=y +CONFIG_BINUTILS_VERSION_2_28=y +CONFIG_BINUTILS_VERSION="2.28" +CONFIG_GCC_VERSION="5.5.0" +CONFIG_LIBC="musl" +CONFIG_TARGET_SUFFIX="musl" +# CONFIG_IB is not set +# CONFIG_SDK is not set +# CONFIG_MAKE_TOOLCHAIN is not set +# CONFIG_IMAGEOPT is not set +# CONFIG_PREINITOPT is not set +CONFIG_TARGET_PREINIT_SUPPRESS_STDERR=y +# CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE is not set +CONFIG_TARGET_PREINIT_TIMEOUT=2 +# CONFIG_TARGET_PREINIT_SHOW_NETMSG is not set +# CONFIG_TARGET_PREINIT_SUPPRESS_FAILSAFE_NETMSG is not set +CONFIG_TARGET_PREINIT_IFNAME="" +CONFIG_TARGET_PREINIT_IP="192.168.1.1" +CONFIG_TARGET_PREINIT_NETMASK="255.255.255.0" +CONFIG_TARGET_PREINIT_BROADCAST="192.168.1.255" +# CONFIG_INITOPT is not set +CONFIG_TARGET_INIT_PATH="/usr/sbin:/usr/bin:/sbin:/bin" +CONFIG_TARGET_INIT_ENV="" +CONFIG_TARGET_INIT_CMD="/sbin/init" +CONFIG_TARGET_INIT_SUPPRESS_STDERR=y +# CONFIG_VERSIONOPT is not set +CONFIG_PER_FEED_REPO=y +CONFIG_PER_FEED_REPO_ADD_DISABLED=y +CONFIG_PER_FEED_REPO_ADD_COMMENTED=y +CONFIG_FEED_packages=y +CONFIG_FEED_luci=y +CONFIG_FEED_routing=y +CONFIG_FEED_telephony=y + +# +# Base system +# +# CONFIG_PACKAGE_attendedsysupgrade-common is not set +# CONFIG_PACKAGE_auc is not set +CONFIG_PACKAGE_base-files=y +# CONFIG_PACKAGE_block-mount is not set +# CONFIG_PACKAGE_bridge is not set +CONFIG_PACKAGE_busybox=y +CONFIG_BUSYBOX_CUSTOM=y +CONFIG_BUSYBOX_DEFAULT_HAVE_DOT_CONFIG=y +# CONFIG_BUSYBOX_DEFAULT_DESKTOP is not set +# CONFIG_BUSYBOX_DEFAULT_EXTRA_COMPAT is not set +CONFIG_BUSYBOX_DEFAULT_INCLUDE_SUSv2=y +# CONFIG_BUSYBOX_DEFAULT_USE_PORTABLE_CODE is not set +CONFIG_BUSYBOX_DEFAULT_PLATFORM_LINUX=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_BUFFERS_USE_MALLOC is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_BUFFERS_GO_ON_STACK=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_BUFFERS_GO_IN_BSS is not set +CONFIG_BUSYBOX_DEFAULT_SHOW_USAGE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_VERBOSE_USAGE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_COMPRESS_USAGE=y +# CONFIG_BUSYBOX_DEFAULT_BUSYBOX is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INSTALLER is not set +# CONFIG_BUSYBOX_DEFAULT_INSTALL_NO_USR is not set +# CONFIG_BUSYBOX_DEFAULT_LOCALE_SUPPORT is not set +# CONFIG_BUSYBOX_DEFAULT_UNICODE_SUPPORT is not set +# CONFIG_BUSYBOX_DEFAULT_UNICODE_USING_LOCALE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHECK_UNICODE_IN_ENV is not set +CONFIG_BUSYBOX_DEFAULT_SUBST_WCHAR=0 +CONFIG_BUSYBOX_DEFAULT_LAST_SUPPORTED_WCHAR=0 +# CONFIG_BUSYBOX_DEFAULT_UNICODE_COMBINING_WCHARS is not set +# CONFIG_BUSYBOX_DEFAULT_UNICODE_WIDE_WCHARS is not set +# CONFIG_BUSYBOX_DEFAULT_UNICODE_BIDI_SUPPORT is not set +# CONFIG_BUSYBOX_DEFAULT_UNICODE_NEUTRAL_TABLE is not set +# CONFIG_BUSYBOX_DEFAULT_UNICODE_PRESERVE_BROKEN is not set +# CONFIG_BUSYBOX_DEFAULT_PAM is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_USE_SENDFILE is not set +CONFIG_BUSYBOX_DEFAULT_LONG_OPTS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_DEVPTS=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CLEAN_UP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_UTMP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_WTMP is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_PIDFILE=y +CONFIG_BUSYBOX_DEFAULT_PID_FILE_PATH="/var/run" +CONFIG_BUSYBOX_DEFAULT_FEATURE_SUID=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SUID_CONFIG is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SUID_CONFIG_QUIET is not set +# CONFIG_BUSYBOX_DEFAULT_SELINUX is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_PREFER_APPLETS=y +CONFIG_BUSYBOX_DEFAULT_BUSYBOX_EXEC_PATH="/proc/self/exe" +CONFIG_BUSYBOX_DEFAULT_FEATURE_SYSLOG=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HAVE_RPC is not set +# CONFIG_BUSYBOX_DEFAULT_STATIC is not set +# CONFIG_BUSYBOX_DEFAULT_PIE is not set +# CONFIG_BUSYBOX_DEFAULT_NOMMU is not set +# CONFIG_BUSYBOX_DEFAULT_BUILD_LIBBUSYBOX is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INDIVIDUAL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SHARED_BUSYBOX is not set +CONFIG_BUSYBOX_DEFAULT_LFS=y +CONFIG_BUSYBOX_DEFAULT_CROSS_COMPILER_PREFIX="" +CONFIG_BUSYBOX_DEFAULT_SYSROOT="" +CONFIG_BUSYBOX_DEFAULT_EXTRA_CFLAGS="" +CONFIG_BUSYBOX_DEFAULT_EXTRA_LDFLAGS="" +CONFIG_BUSYBOX_DEFAULT_EXTRA_LDLIBS="" +# CONFIG_BUSYBOX_DEFAULT_DEBUG is not set +# CONFIG_BUSYBOX_DEFAULT_DEBUG_PESSIMIZE is not set +# CONFIG_BUSYBOX_DEFAULT_DEBUG_SANITIZE is not set +# CONFIG_BUSYBOX_DEFAULT_UNIT_TEST is not set +# CONFIG_BUSYBOX_DEFAULT_WERROR is not set +CONFIG_BUSYBOX_DEFAULT_NO_DEBUG_LIB=y +# CONFIG_BUSYBOX_DEFAULT_DMALLOC is not set +# CONFIG_BUSYBOX_DEFAULT_EFENCE is not set +CONFIG_BUSYBOX_DEFAULT_INSTALL_APPLET_SYMLINKS=y +# CONFIG_BUSYBOX_DEFAULT_INSTALL_APPLET_HARDLINKS is not set +# CONFIG_BUSYBOX_DEFAULT_INSTALL_APPLET_SCRIPT_WRAPPERS is not set +# CONFIG_BUSYBOX_DEFAULT_INSTALL_APPLET_DONT is not set +# CONFIG_BUSYBOX_DEFAULT_INSTALL_SH_APPLET_SYMLINK is not set +# CONFIG_BUSYBOX_DEFAULT_INSTALL_SH_APPLET_HARDLINK is not set +# CONFIG_BUSYBOX_DEFAULT_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set +CONFIG_BUSYBOX_DEFAULT_PREFIX="./_install" +# CONFIG_BUSYBOX_DEFAULT_FEATURE_USE_BSS_TAIL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_RTMINMAX is not set +CONFIG_BUSYBOX_DEFAULT_PASSWORD_MINLEN=6 +CONFIG_BUSYBOX_DEFAULT_MD5_SMALL=1 +CONFIG_BUSYBOX_DEFAULT_SHA3_SMALL=1 +CONFIG_BUSYBOX_DEFAULT_FEATURE_FAST_TOP=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_ETC_NETWORKS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_USE_TERMIOS is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_EDITING=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_EDITING_MAX_LEN=512 +# CONFIG_BUSYBOX_DEFAULT_FEATURE_EDITING_VI is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_EDITING_HISTORY=256 +# CONFIG_BUSYBOX_DEFAULT_FEATURE_EDITING_SAVEHISTORY is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_EDITING_SAVE_ON_EXIT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_REVERSE_SEARCH is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_TAB_COMPLETION=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_USERNAME_COMPLETION is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_EDITING_FANCY_PROMPT=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_EDITING_ASK_TERMINAL is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_NON_POSIX_CP=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VERBOSE_CP_MESSAGE is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_COPYBUF_KB=4 +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SKIP_ROOTFS is not set +# CONFIG_BUSYBOX_DEFAULT_MONOTONIC_SYSCALL is not set +CONFIG_BUSYBOX_DEFAULT_IOCTL_HEX2STR_ERROR=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HWIB is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SEAMLESS_XZ is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SEAMLESS_LZMA is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SEAMLESS_BZ2 is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_SEAMLESS_GZ=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SEAMLESS_Z is not set +# CONFIG_BUSYBOX_DEFAULT_AR is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_AR_LONG_FILENAMES is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_AR_CREATE is not set +# CONFIG_BUSYBOX_DEFAULT_UNCOMPRESS is not set +CONFIG_BUSYBOX_DEFAULT_GUNZIP=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_GUNZIP_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_BUNZIP2=y +# CONFIG_BUSYBOX_DEFAULT_UNLZMA is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LZMA_FAST is not set +# CONFIG_BUSYBOX_DEFAULT_LZMA is not set +# CONFIG_BUSYBOX_DEFAULT_UNXZ is not set +# CONFIG_BUSYBOX_DEFAULT_XZ is not set +# CONFIG_BUSYBOX_DEFAULT_BZIP2 is not set +# CONFIG_BUSYBOX_DEFAULT_CPIO is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CPIO_O is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CPIO_P is not set +# CONFIG_BUSYBOX_DEFAULT_DPKG is not set +# CONFIG_BUSYBOX_DEFAULT_DPKG_DEB is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set +CONFIG_BUSYBOX_DEFAULT_GZIP=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_GZIP_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_GZIP_FAST=0 +# CONFIG_BUSYBOX_DEFAULT_FEATURE_GZIP_LEVELS is not set +# CONFIG_BUSYBOX_DEFAULT_LZOP is not set +# CONFIG_BUSYBOX_DEFAULT_LZOP_COMPR_HIGH is not set +# CONFIG_BUSYBOX_DEFAULT_RPM is not set +# CONFIG_BUSYBOX_DEFAULT_RPM2CPIO is not set +CONFIG_BUSYBOX_DEFAULT_TAR=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_CREATE=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_AUTODETECT is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_FROM=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_OLDGNU_COMPATIBILITY is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_GNU_EXTENSIONS=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_TO_COMMAND is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_UNAME_GNAME is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_NOPRESERVE_TIME is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_SELINUX is not set +# CONFIG_BUSYBOX_DEFAULT_UNZIP is not set +CONFIG_BUSYBOX_DEFAULT_BASENAME=y +CONFIG_BUSYBOX_DEFAULT_CAT=y +CONFIG_BUSYBOX_DEFAULT_DATE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_DATE_ISOFMT=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DATE_NANO is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DATE_COMPAT is not set +CONFIG_BUSYBOX_DEFAULT_DD=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_DD_SIGNAL_HANDLING=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DD_THIRD_STATUS_LINE is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_DD_IBS_OBS=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DD_STATUS is not set +# CONFIG_BUSYBOX_DEFAULT_HOSTID is not set +CONFIG_BUSYBOX_DEFAULT_ID=y +# CONFIG_BUSYBOX_DEFAULT_GROUPS is not set +# CONFIG_BUSYBOX_DEFAULT_SHUF is not set +# CONFIG_BUSYBOX_DEFAULT_STAT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_STAT_FORMAT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_STAT_FILESYSTEM is not set +CONFIG_BUSYBOX_DEFAULT_SYNC=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SYNC_FANCY is not set +CONFIG_BUSYBOX_DEFAULT_TEST=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_TEST_64=y +CONFIG_BUSYBOX_DEFAULT_TOUCH=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TOUCH_NODEREF is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_TOUCH_SUSV3=y +CONFIG_BUSYBOX_DEFAULT_TR=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TR_CLASSES is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TR_EQUIV is not set +# CONFIG_BUSYBOX_DEFAULT_TRUNCATE is not set +# CONFIG_BUSYBOX_DEFAULT_UNLINK is not set +# CONFIG_BUSYBOX_DEFAULT_BASE64 is not set +# CONFIG_BUSYBOX_DEFAULT_WHO is not set +# CONFIG_BUSYBOX_DEFAULT_USERS is not set +# CONFIG_BUSYBOX_DEFAULT_CAL is not set +# CONFIG_BUSYBOX_DEFAULT_CATV is not set +CONFIG_BUSYBOX_DEFAULT_CHGRP=y +CONFIG_BUSYBOX_DEFAULT_CHMOD=y +CONFIG_BUSYBOX_DEFAULT_CHOWN=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHOWN_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_CHROOT=y +# CONFIG_BUSYBOX_DEFAULT_CKSUM is not set +# CONFIG_BUSYBOX_DEFAULT_COMM is not set +CONFIG_BUSYBOX_DEFAULT_CP=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CP_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_CUT=y +CONFIG_BUSYBOX_DEFAULT_DF=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DF_FANCY is not set +CONFIG_BUSYBOX_DEFAULT_DIRNAME=y +# CONFIG_BUSYBOX_DEFAULT_DOS2UNIX is not set +# CONFIG_BUSYBOX_DEFAULT_UNIX2DOS is not set +CONFIG_BUSYBOX_DEFAULT_DU=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y +CONFIG_BUSYBOX_DEFAULT_ECHO=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FANCY_ECHO=y +CONFIG_BUSYBOX_DEFAULT_ENV=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_ENV_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_EXPAND is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_EXPAND_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_EXPR=y +CONFIG_BUSYBOX_DEFAULT_EXPR_MATH_SUPPORT_64=y +CONFIG_BUSYBOX_DEFAULT_FALSE=y +# CONFIG_BUSYBOX_DEFAULT_FOLD is not set +CONFIG_BUSYBOX_DEFAULT_FSYNC=y +CONFIG_BUSYBOX_DEFAULT_HEAD=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FANCY_HEAD=y +# CONFIG_BUSYBOX_DEFAULT_INSTALL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INSTALL_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_LN=y +# CONFIG_BUSYBOX_DEFAULT_LOGNAME is not set +CONFIG_BUSYBOX_DEFAULT_LS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_LS_FILETYPES=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_LS_FOLLOWLINKS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_LS_RECURSIVE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_LS_SORTFILES=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_LS_TIMESTAMPS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_LS_USERNAME=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_LS_COLOR=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_LS_COLOR_IS_DEFAULT=y +CONFIG_BUSYBOX_DEFAULT_MD5SUM=y +CONFIG_BUSYBOX_DEFAULT_MKDIR=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MKDIR_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_MKFIFO=y +CONFIG_BUSYBOX_DEFAULT_MKNOD=y +CONFIG_BUSYBOX_DEFAULT_MV=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MV_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_NICE=y +# CONFIG_BUSYBOX_DEFAULT_NOHUP is not set +# CONFIG_BUSYBOX_DEFAULT_OD is not set +# CONFIG_BUSYBOX_DEFAULT_PRINTENV is not set +CONFIG_BUSYBOX_DEFAULT_PRINTF=y +CONFIG_BUSYBOX_DEFAULT_PWD=y +CONFIG_BUSYBOX_DEFAULT_READLINK=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_READLINK_FOLLOW=y +# CONFIG_BUSYBOX_DEFAULT_REALPATH is not set +CONFIG_BUSYBOX_DEFAULT_RM=y +CONFIG_BUSYBOX_DEFAULT_RMDIR=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_RMDIR_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_SEQ=y +# CONFIG_BUSYBOX_DEFAULT_SHA1SUM is not set +CONFIG_BUSYBOX_DEFAULT_SHA256SUM=y +# CONFIG_BUSYBOX_DEFAULT_SHA512SUM is not set +# CONFIG_BUSYBOX_DEFAULT_SHA3SUM is not set +CONFIG_BUSYBOX_DEFAULT_SLEEP=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FANCY_SLEEP=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FLOAT_SLEEP is not set +CONFIG_BUSYBOX_DEFAULT_SORT=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SORT_BIG is not set +# CONFIG_BUSYBOX_DEFAULT_SPLIT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SPLIT_FANCY is not set +# CONFIG_BUSYBOX_DEFAULT_STTY is not set +# CONFIG_BUSYBOX_DEFAULT_SUM is not set +# CONFIG_BUSYBOX_DEFAULT_TAC is not set +CONFIG_BUSYBOX_DEFAULT_TAIL=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FANCY_TAIL=y +CONFIG_BUSYBOX_DEFAULT_TEE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_TEE_USE_BLOCK_IO=y +CONFIG_BUSYBOX_DEFAULT_TRUE=y +# CONFIG_BUSYBOX_DEFAULT_TTY is not set +CONFIG_BUSYBOX_DEFAULT_UNAME=y +CONFIG_BUSYBOX_DEFAULT_UNAME_OSNAME="GNU/Linux" +# CONFIG_BUSYBOX_DEFAULT_UNEXPAND is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_UNEXPAND_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_UNIQ=y +# CONFIG_BUSYBOX_DEFAULT_USLEEP is not set +# CONFIG_BUSYBOX_DEFAULT_UUDECODE is not set +# CONFIG_BUSYBOX_DEFAULT_UUENCODE is not set +CONFIG_BUSYBOX_DEFAULT_WC=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_WC_LARGE is not set +# CONFIG_BUSYBOX_DEFAULT_WHOAMI is not set +CONFIG_BUSYBOX_DEFAULT_YES=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VERBOSE is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_PRESERVE_HARDLINKS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_AUTOWIDTH=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_HUMAN_READABLE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_MD5_SHA1_SUM_CHECK=y +# CONFIG_BUSYBOX_DEFAULT_CHVT is not set +# CONFIG_BUSYBOX_DEFAULT_FGCONSOLE is not set +CONFIG_BUSYBOX_DEFAULT_CLEAR=y +# CONFIG_BUSYBOX_DEFAULT_DEALLOCVT is not set +# CONFIG_BUSYBOX_DEFAULT_DUMPKMAP is not set +# CONFIG_BUSYBOX_DEFAULT_KBD_MODE is not set +# CONFIG_BUSYBOX_DEFAULT_LOADFONT is not set +# CONFIG_BUSYBOX_DEFAULT_LOADKMAP is not set +# CONFIG_BUSYBOX_DEFAULT_OPENVT is not set +CONFIG_BUSYBOX_DEFAULT_RESET=y +# CONFIG_BUSYBOX_DEFAULT_RESIZE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_RESIZE_PRINT is not set +# CONFIG_BUSYBOX_DEFAULT_SETCONSOLE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SETCONSOLE_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_SETFONT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SETFONT_TEXTUAL_MAP is not set +CONFIG_BUSYBOX_DEFAULT_DEFAULT_SETFONT_DIR="" +# CONFIG_BUSYBOX_DEFAULT_SETKEYCODES is not set +# CONFIG_BUSYBOX_DEFAULT_SETLOGCONS is not set +# CONFIG_BUSYBOX_DEFAULT_SHOWKEY is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LOADFONT_PSF2 is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LOADFONT_RAW is not set +CONFIG_BUSYBOX_DEFAULT_MKTEMP=y +# CONFIG_BUSYBOX_DEFAULT_PIPE_PROGRESS is not set +# CONFIG_BUSYBOX_DEFAULT_RUN_PARTS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_RUN_PARTS_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_RUN_PARTS_FANCY is not set +CONFIG_BUSYBOX_DEFAULT_START_STOP_DAEMON=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_START_STOP_DAEMON_FANCY is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_START_STOP_DAEMON_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_WHICH=y +CONFIG_BUSYBOX_DEFAULT_AWK=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_AWK_LIBM=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_AWK_GNU_EXTENSIONS=y +CONFIG_BUSYBOX_DEFAULT_CMP=y +# CONFIG_BUSYBOX_DEFAULT_DIFF is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DIFF_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DIFF_DIR is not set +# CONFIG_BUSYBOX_DEFAULT_ED is not set +# CONFIG_BUSYBOX_DEFAULT_PATCH is not set +CONFIG_BUSYBOX_DEFAULT_SED=y +CONFIG_BUSYBOX_DEFAULT_VI=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_MAX_LEN=1024 +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_8BIT is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_COLON=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_YANKMARK=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_SEARCH=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_REGEX_SEARCH is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_USE_SIGNALS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_DOT_CMD=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_READONLY=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_SETOPTS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_SET=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_WIN_RESIZE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_ASK_TERMINAL=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_UNDO is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_UNDO_QUEUE is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_UNDO_QUEUE_MAX=0 +CONFIG_BUSYBOX_DEFAULT_FEATURE_ALLOW_EXEC=y +CONFIG_BUSYBOX_DEFAULT_FIND=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_PRINT0=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_MTIME=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_MMIN is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_PERM=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_TYPE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_XDEV=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_MAXDEPTH=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_NEWER is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_INUM is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_EXEC=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_EXEC_PLUS is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_USER=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_GROUP=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_NOT=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_DEPTH=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_PAREN=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_SIZE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_PRUNE=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_DELETE is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_PATH=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_REGEX=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_CONTEXT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_LINKS is not set +CONFIG_BUSYBOX_DEFAULT_GREP=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_GREP_EGREP_ALIAS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_GREP_FGREP_ALIAS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_GREP_CONTEXT=y +CONFIG_BUSYBOX_DEFAULT_XARGS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_XARGS_SUPPORT_CONFIRMATION=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_XARGS_SUPPORT_QUOTES=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_XARGS_SUPPORT_TERMOPT=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_XARGS_SUPPORT_ZERO_TERM=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_XARGS_SUPPORT_REPL_STR is not set +# CONFIG_BUSYBOX_DEFAULT_BOOTCHARTD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_BOOTCHARTD_CONFIG_FILE is not set +CONFIG_BUSYBOX_DEFAULT_HALT=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CALL_TELINIT is not set +CONFIG_BUSYBOX_DEFAULT_TELINIT_PATH="" +# CONFIG_BUSYBOX_DEFAULT_INIT is not set +# CONFIG_BUSYBOX_DEFAULT_LINUXRC is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_USE_INITTAB is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_KILL_REMOVED is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_KILL_DELAY=0 +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INIT_SCTTY is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INIT_SYSLOG is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_EXTRA_QUIET is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INIT_COREDUMPS is not set +CONFIG_BUSYBOX_DEFAULT_INIT_TERMINAL_TYPE="" +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INIT_MODIFY_CMDLINE is not set +# CONFIG_BUSYBOX_DEFAULT_MESG is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MESG_ENABLE_ONLY_GROUP is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_SHADOWPASSWDS=y +# CONFIG_BUSYBOX_DEFAULT_USE_BB_PWD_GRP is not set +# CONFIG_BUSYBOX_DEFAULT_USE_BB_SHADOW is not set +# CONFIG_BUSYBOX_DEFAULT_USE_BB_CRYPT is not set +# CONFIG_BUSYBOX_DEFAULT_USE_BB_CRYPT_SHA is not set +# CONFIG_BUSYBOX_DEFAULT_ADD_SHELL is not set +# CONFIG_BUSYBOX_DEFAULT_REMOVE_SHELL is not set +# CONFIG_BUSYBOX_DEFAULT_ADDGROUP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_ADDGROUP_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_ADDUSER_TO_GROUP is not set +# CONFIG_BUSYBOX_DEFAULT_ADDUSER is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_ADDUSER_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHECK_NAMES is not set +CONFIG_BUSYBOX_DEFAULT_LAST_ID=0 +CONFIG_BUSYBOX_DEFAULT_FIRST_SYSTEM_ID=0 +CONFIG_BUSYBOX_DEFAULT_LAST_SYSTEM_ID=0 +# CONFIG_BUSYBOX_DEFAULT_CHPASSWD is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_DEFAULT_PASSWD_ALGO="md5" +# CONFIG_BUSYBOX_DEFAULT_CRYPTPW is not set +# CONFIG_BUSYBOX_DEFAULT_MKPASSWD is not set +# CONFIG_BUSYBOX_DEFAULT_DELUSER is not set +# CONFIG_BUSYBOX_DEFAULT_DELGROUP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DEL_USER_FROM_GROUP is not set +# CONFIG_BUSYBOX_DEFAULT_GETTY is not set +CONFIG_BUSYBOX_DEFAULT_LOGIN=y +CONFIG_BUSYBOX_DEFAULT_LOGIN_SESSION_AS_CHILD=y +# CONFIG_BUSYBOX_DEFAULT_LOGIN_SCRIPTS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_NOLOGIN is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SECURETTY is not set +CONFIG_BUSYBOX_DEFAULT_PASSWD=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_PASSWD_WEAK_CHECK=y +# CONFIG_BUSYBOX_DEFAULT_SU is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SU_SYSLOG is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SU_CHECKS_SHELLS is not set +# CONFIG_BUSYBOX_DEFAULT_SULOGIN is not set +# CONFIG_BUSYBOX_DEFAULT_VLOCK is not set +# CONFIG_BUSYBOX_DEFAULT_CHATTR is not set +# CONFIG_BUSYBOX_DEFAULT_FSCK is not set +# CONFIG_BUSYBOX_DEFAULT_LSATTR is not set +# CONFIG_BUSYBOX_DEFAULT_TUNE2FS is not set +# CONFIG_BUSYBOX_DEFAULT_MODINFO is not set +# CONFIG_BUSYBOX_DEFAULT_MODPROBE_SMALL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set +# CONFIG_BUSYBOX_DEFAULT_INSMOD is not set +# CONFIG_BUSYBOX_DEFAULT_RMMOD is not set +# CONFIG_BUSYBOX_DEFAULT_LSMOD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set +# CONFIG_BUSYBOX_DEFAULT_MODPROBE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MODPROBE_BLACKLIST is not set +# CONFIG_BUSYBOX_DEFAULT_DEPMOD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_2_4_MODULES is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INSMOD_TRY_MMAP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INSMOD_VERSION_CHECKING is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INSMOD_LOADINKMEM is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INSMOD_LOAD_MAP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INSMOD_LOAD_MAP_FULL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHECK_TAINTED_MODULE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MODUTILS_ALIAS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MODUTILS_SYMBOLS is not set +CONFIG_BUSYBOX_DEFAULT_DEFAULT_MODULES_DIR="" +CONFIG_BUSYBOX_DEFAULT_DEFAULT_DEPMOD_FILE="" +# CONFIG_BUSYBOX_DEFAULT_BLKDISCARD is not set +# CONFIG_BUSYBOX_DEFAULT_BLOCKDEV is not set +# CONFIG_BUSYBOX_DEFAULT_FATATTR is not set +# CONFIG_BUSYBOX_DEFAULT_FSTRIM is not set +# CONFIG_BUSYBOX_DEFAULT_MDEV is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MDEV_CONF is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MDEV_RENAME is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MDEV_RENAME_REGEXP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MDEV_EXEC is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MDEV_LOAD_FIRMWARE is not set +CONFIG_BUSYBOX_DEFAULT_MOUNT=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_FAKE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_VERBOSE is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_HELPERS=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_LABEL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_NFS is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_CIFS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_FLAGS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_FSTAB=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_OTHERTAB is not set +# CONFIG_BUSYBOX_DEFAULT_NSENTER is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_NSENTER_LONG_OPTS is not set +# CONFIG_BUSYBOX_DEFAULT_REV is not set +# CONFIG_BUSYBOX_DEFAULT_SETARCH is not set +# CONFIG_BUSYBOX_DEFAULT_UEVENT is not set +# CONFIG_BUSYBOX_DEFAULT_UNSHARE is not set +# CONFIG_BUSYBOX_DEFAULT_ACPID is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_ACPID_COMPAT is not set +# CONFIG_BUSYBOX_DEFAULT_BLKID is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_BLKID_TYPE is not set +CONFIG_BUSYBOX_DEFAULT_DMESG=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_DMESG_PRETTY=y +# CONFIG_BUSYBOX_DEFAULT_FBSET is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FBSET_FANCY is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FBSET_READMODE is not set +# CONFIG_BUSYBOX_DEFAULT_FDFLUSH is not set +# CONFIG_BUSYBOX_DEFAULT_FDFORMAT is not set +# CONFIG_BUSYBOX_DEFAULT_FDISK is not set +# CONFIG_BUSYBOX_DEFAULT_FDISK_SUPPORT_LARGE_DISKS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FDISK_WRITABLE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_AIX_LABEL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SGI_LABEL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SUN_LABEL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_OSF_LABEL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_GPT_LABEL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FDISK_ADVANCED is not set +# CONFIG_BUSYBOX_DEFAULT_FINDFS is not set +# CONFIG_BUSYBOX_DEFAULT_FLOCK is not set +# CONFIG_BUSYBOX_DEFAULT_FREERAMDISK is not set +# CONFIG_BUSYBOX_DEFAULT_FSCK_MINIX is not set +# CONFIG_BUSYBOX_DEFAULT_MKFS_EXT2 is not set +# CONFIG_BUSYBOX_DEFAULT_MKFS_MINIX is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MINIX2 is not set +# CONFIG_BUSYBOX_DEFAULT_MKFS_REISER is not set +# CONFIG_BUSYBOX_DEFAULT_MKFS_VFAT is not set +# CONFIG_BUSYBOX_DEFAULT_GETOPT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_GETOPT_LONG is not set +CONFIG_BUSYBOX_DEFAULT_HEXDUMP=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HEXDUMP_REVERSE is not set +# CONFIG_BUSYBOX_DEFAULT_HD is not set +CONFIG_BUSYBOX_DEFAULT_HWCLOCK=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HWCLOCK_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HWCLOCK_ADJTIME_FHS is not set +# CONFIG_BUSYBOX_DEFAULT_IPCRM is not set +# CONFIG_BUSYBOX_DEFAULT_IPCS is not set +# CONFIG_BUSYBOX_DEFAULT_LOSETUP is not set +# CONFIG_BUSYBOX_DEFAULT_LSPCI is not set +# CONFIG_BUSYBOX_DEFAULT_LSUSB is not set +CONFIG_BUSYBOX_DEFAULT_MKSWAP=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MKSWAP_UUID is not set +# CONFIG_BUSYBOX_DEFAULT_MORE is not set +CONFIG_BUSYBOX_DEFAULT_PIVOT_ROOT=y +# CONFIG_BUSYBOX_DEFAULT_RDATE is not set +# CONFIG_BUSYBOX_DEFAULT_RDEV is not set +# CONFIG_BUSYBOX_DEFAULT_READPROFILE is not set +# CONFIG_BUSYBOX_DEFAULT_RTCWAKE is not set +# CONFIG_BUSYBOX_DEFAULT_SCRIPT is not set +# CONFIG_BUSYBOX_DEFAULT_SCRIPTREPLAY is not set +# CONFIG_BUSYBOX_DEFAULT_SWAPONOFF is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SWAPON_DISCARD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SWAPON_PRI is not set +CONFIG_BUSYBOX_DEFAULT_SWITCH_ROOT=y +CONFIG_BUSYBOX_DEFAULT_UMOUNT=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_UMOUNT_ALL=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_LOOP=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_LOOP_CREATE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MTAB_SUPPORT is not set +# CONFIG_BUSYBOX_DEFAULT_VOLUMEID is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_BCACHE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_BTRFS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_CRAMFS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_EXFAT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_EXT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_F2FS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_FAT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_HFS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_ISO9660 is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_JFS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_LINUXRAID is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_LINUXSWAP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_LUKS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_NILFS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_NTFS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_OCFS2 is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_REISERFS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_ROMFS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_SQUASHFS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_SYSV is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_UDF is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_XFS is not set +# CONFIG_BUSYBOX_DEFAULT_CONSPY is not set +CONFIG_BUSYBOX_DEFAULT_CROND=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CROND_D is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CROND_CALL_SENDMAIL is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_CROND_DIR="/etc" +# CONFIG_BUSYBOX_DEFAULT_I2CGET is not set +# CONFIG_BUSYBOX_DEFAULT_I2CSET is not set +# CONFIG_BUSYBOX_DEFAULT_I2CDUMP is not set +# CONFIG_BUSYBOX_DEFAULT_I2CDETECT is not set +CONFIG_BUSYBOX_DEFAULT_LESS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_LESS_MAXLINES=9999999 +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LESS_BRACKETS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LESS_FLAGS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LESS_TRUNCATE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LESS_MARKS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LESS_REGEXP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LESS_WINCH is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LESS_ASK_TERMINAL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LESS_DASHCMD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LESS_LINENUMS is not set +# CONFIG_BUSYBOX_DEFAULT_NANDWRITE is not set +# CONFIG_BUSYBOX_DEFAULT_NANDDUMP is not set +# CONFIG_BUSYBOX_DEFAULT_RFKILL is not set +# CONFIG_BUSYBOX_DEFAULT_SETSERIAL is not set +# CONFIG_BUSYBOX_DEFAULT_TASKSET is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TASKSET_FANCY is not set +# CONFIG_BUSYBOX_DEFAULT_UBIATTACH is not set +# CONFIG_BUSYBOX_DEFAULT_UBIDETACH is not set +# CONFIG_BUSYBOX_DEFAULT_UBIMKVOL is not set +# CONFIG_BUSYBOX_DEFAULT_UBIRMVOL is not set +# CONFIG_BUSYBOX_DEFAULT_UBIRSVOL is not set +# CONFIG_BUSYBOX_DEFAULT_UBIUPDATEVOL is not set +# CONFIG_BUSYBOX_DEFAULT_UBIRENAME is not set +# CONFIG_BUSYBOX_DEFAULT_WALL is not set +# CONFIG_BUSYBOX_DEFAULT_ADJTIMEX is not set +# CONFIG_BUSYBOX_DEFAULT_BBCONFIG is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_COMPRESS_BBCONFIG is not set +# CONFIG_BUSYBOX_DEFAULT_BEEP is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_BEEP_FREQ=0 +CONFIG_BUSYBOX_DEFAULT_FEATURE_BEEP_LENGTH_MS=0 +# CONFIG_BUSYBOX_DEFAULT_CHAT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHAT_NOFAIL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHAT_TTY_HIFI is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHAT_IMPLICIT_CR is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHAT_SWALLOW_OPTS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHAT_SEND_ESCAPES is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHAT_VAR_ABORT_LEN is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHAT_CLR_ABORT is not set +# CONFIG_BUSYBOX_DEFAULT_CHRT is not set +CONFIG_BUSYBOX_DEFAULT_CRONTAB=y +# CONFIG_BUSYBOX_DEFAULT_DC is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DC_LIBM is not set +# CONFIG_BUSYBOX_DEFAULT_DEVFSD is not set +# CONFIG_BUSYBOX_DEFAULT_DEVFSD_MODLOAD is not set +# CONFIG_BUSYBOX_DEFAULT_DEVFSD_FG_NP is not set +# CONFIG_BUSYBOX_DEFAULT_DEVFSD_VERBOSE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DEVFS is not set +# CONFIG_BUSYBOX_DEFAULT_DEVMEM is not set +# CONFIG_BUSYBOX_DEFAULT_EJECT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_EJECT_SCSI is not set +# CONFIG_BUSYBOX_DEFAULT_FBSPLASH is not set +# CONFIG_BUSYBOX_DEFAULT_FLASHCP is not set +# CONFIG_BUSYBOX_DEFAULT_FLASH_LOCK is not set +# CONFIG_BUSYBOX_DEFAULT_FLASH_UNLOCK is not set +# CONFIG_BUSYBOX_DEFAULT_FLASH_ERASEALL is not set +# CONFIG_BUSYBOX_DEFAULT_IONICE is not set +# CONFIG_BUSYBOX_DEFAULT_INOTIFYD is not set +# CONFIG_BUSYBOX_DEFAULT_LAST is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LAST_FANCY is not set +# CONFIG_BUSYBOX_DEFAULT_HDPARM is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HDPARM_GET_IDENTITY is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_GETSET_DMA is not set +CONFIG_BUSYBOX_DEFAULT_LOCK=y +# CONFIG_BUSYBOX_DEFAULT_MAKEDEVS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MAKEDEVS_LEAF is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MAKEDEVS_TABLE is not set +# CONFIG_BUSYBOX_DEFAULT_MAN is not set +# CONFIG_BUSYBOX_DEFAULT_MICROCOM is not set +# CONFIG_BUSYBOX_DEFAULT_MOUNTPOINT is not set +# CONFIG_BUSYBOX_DEFAULT_MT is not set +# CONFIG_BUSYBOX_DEFAULT_RAIDAUTORUN is not set +# CONFIG_BUSYBOX_DEFAULT_READAHEAD is not set +# CONFIG_BUSYBOX_DEFAULT_RUNLEVEL is not set +# CONFIG_BUSYBOX_DEFAULT_RX is not set +# CONFIG_BUSYBOX_DEFAULT_SETSID is not set +CONFIG_BUSYBOX_DEFAULT_STRINGS=y +CONFIG_BUSYBOX_DEFAULT_TIME=y +# CONFIG_BUSYBOX_DEFAULT_TIMEOUT is not set +# CONFIG_BUSYBOX_DEFAULT_TTYSIZE is not set +# CONFIG_BUSYBOX_DEFAULT_VOLNAME is not set +# CONFIG_BUSYBOX_DEFAULT_WATCHDOG is not set +# CONFIG_BUSYBOX_DEFAULT_NAMEIF is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_NAMEIF_EXTENDED is not set +# CONFIG_BUSYBOX_DEFAULT_NBDCLIENT is not set +CONFIG_BUSYBOX_DEFAULT_NC=y +# CONFIG_BUSYBOX_DEFAULT_NC_SERVER is not set +# CONFIG_BUSYBOX_DEFAULT_NC_EXTRA is not set +# CONFIG_BUSYBOX_DEFAULT_NC_110_COMPAT is not set +CONFIG_BUSYBOX_DEFAULT_PING=y +CONFIG_BUSYBOX_DEFAULT_PING6=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FANCY_PING=y +# CONFIG_BUSYBOX_DEFAULT_WGET is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_WGET_STATUSBAR is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_WGET_AUTHENTICATION is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_WGET_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_WGET_TIMEOUT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_WGET_OPENSSL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_WGET_SSL_HELPER is not set +# CONFIG_BUSYBOX_DEFAULT_WHOIS is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_IPV6=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_UNIX_LOCAL is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_PREFER_IPV4_ADDRESS=y +CONFIG_BUSYBOX_DEFAULT_VERBOSE_RESOLUTION_ERRORS=y +# CONFIG_BUSYBOX_DEFAULT_ARP is not set +# CONFIG_BUSYBOX_DEFAULT_ARPING is not set +CONFIG_BUSYBOX_DEFAULT_BRCTL=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_BRCTL_FANCY=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_BRCTL_SHOW=y +# CONFIG_BUSYBOX_DEFAULT_DNSD is not set +# CONFIG_BUSYBOX_DEFAULT_ETHER_WAKE is not set +# CONFIG_BUSYBOX_DEFAULT_FAKEIDENTD is not set +# CONFIG_BUSYBOX_DEFAULT_FTPD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FTP_WRITE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FTP_AUTHENTICATION is not set +# CONFIG_BUSYBOX_DEFAULT_FTPGET is not set +# CONFIG_BUSYBOX_DEFAULT_FTPPUT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FTPGETPUT_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_HOSTNAME is not set +# CONFIG_BUSYBOX_DEFAULT_HTTPD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_RANGES is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_SETUID is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_BASIC_AUTH is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_AUTH_MD5 is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_CGI is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_ENCODE_URL_STR is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_ERROR_PAGES is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_PROXY is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_GZIP is not set +CONFIG_BUSYBOX_DEFAULT_IFCONFIG=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_IFCONFIG_STATUS=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IFCONFIG_SLIP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_IFCONFIG_HW=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_IFCONFIG_BROADCAST_PLUS=y +# CONFIG_BUSYBOX_DEFAULT_IFENSLAVE is not set +# CONFIG_BUSYBOX_DEFAULT_IFPLUGD is not set +# CONFIG_BUSYBOX_DEFAULT_IFUPDOWN is not set +CONFIG_BUSYBOX_DEFAULT_IFUPDOWN_IFSTATE_PATH="" +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IP_BUILTIN is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IPV4 is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IPV6 is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_MAPPING is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set +# CONFIG_BUSYBOX_DEFAULT_INETD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INETD_RPC is not set +CONFIG_BUSYBOX_DEFAULT_IP=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_IP_ADDRESS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_IP_LINK=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_IP_ROUTE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_IP_ROUTE_DIR="/etc/iproute2" +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IP_TUNNEL is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_IP_RULE=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IP_NEIGH is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IP_SHORT_FORMS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IP_RARE_PROTOCOLS is not set +# CONFIG_BUSYBOX_DEFAULT_IPADDR is not set +# CONFIG_BUSYBOX_DEFAULT_IPLINK is not set +# CONFIG_BUSYBOX_DEFAULT_IPROUTE is not set +# CONFIG_BUSYBOX_DEFAULT_IPTUNNEL is not set +# CONFIG_BUSYBOX_DEFAULT_IPRULE is not set +# CONFIG_BUSYBOX_DEFAULT_IPNEIGH is not set +# CONFIG_BUSYBOX_DEFAULT_IPCALC is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IPCALC_FANCY is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IPCALC_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_NETMSG=y +CONFIG_BUSYBOX_DEFAULT_NETSTAT=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_NETSTAT_WIDE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_NETSTAT_PRG=y +# CONFIG_BUSYBOX_DEFAULT_NSLOOKUP is not set +CONFIG_BUSYBOX_DEFAULT_NSLOOKUP_LEDE=y +CONFIG_BUSYBOX_DEFAULT_NTPD=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_NTPD_SERVER=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_NTPD_CONF is not set +# CONFIG_BUSYBOX_DEFAULT_PSCAN is not set +CONFIG_BUSYBOX_DEFAULT_ROUTE=y +# CONFIG_BUSYBOX_DEFAULT_SLATTACH is not set +# CONFIG_BUSYBOX_DEFAULT_TCPSVD is not set +# CONFIG_BUSYBOX_DEFAULT_TELNET is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TELNET_TTYPE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TELNET_AUTOLOGIN is not set +# CONFIG_BUSYBOX_DEFAULT_TELNETD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TELNETD_STANDALONE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TELNETD_INETD_WAIT is not set +# CONFIG_BUSYBOX_DEFAULT_TFTP is not set +# CONFIG_BUSYBOX_DEFAULT_TFTPD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TFTP_GET is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TFTP_PUT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TFTP_BLOCKSIZE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TFTP_PROGRESS_BAR is not set +# CONFIG_BUSYBOX_DEFAULT_TFTP_DEBUG is not set +CONFIG_BUSYBOX_DEFAULT_TRACEROUTE=y +CONFIG_BUSYBOX_DEFAULT_TRACEROUTE6=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_VERBOSE=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_USE_ICMP is not set +# CONFIG_BUSYBOX_DEFAULT_TUNCTL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TUNCTL_UG is not set +# CONFIG_BUSYBOX_DEFAULT_UDHCPC6 is not set +# CONFIG_BUSYBOX_DEFAULT_UDHCPD is not set +# CONFIG_BUSYBOX_DEFAULT_DHCPRELAY is not set +# CONFIG_BUSYBOX_DEFAULT_DUMPLEASES is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set +CONFIG_BUSYBOX_DEFAULT_DHCPD_LEASES_FILE="" +CONFIG_BUSYBOX_DEFAULT_UDHCPC=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_UDHCPC_ARPING is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_UDHCPC_SANITIZEOPT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_UDHCP_PORT is not set +CONFIG_BUSYBOX_DEFAULT_UDHCP_DEBUG=0 +CONFIG_BUSYBOX_DEFAULT_FEATURE_UDHCP_RFC3397=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_UDHCP_8021Q is not set +CONFIG_BUSYBOX_DEFAULT_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script" +CONFIG_BUSYBOX_DEFAULT_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80 +CONFIG_BUSYBOX_DEFAULT_IFUPDOWN_UDHCPC_CMD_OPTIONS="" +# CONFIG_BUSYBOX_DEFAULT_UDPSVD is not set +# CONFIG_BUSYBOX_DEFAULT_VCONFIG is not set +# CONFIG_BUSYBOX_DEFAULT_ZCIP is not set +# CONFIG_BUSYBOX_DEFAULT_LPD is not set +# CONFIG_BUSYBOX_DEFAULT_LPR is not set +# CONFIG_BUSYBOX_DEFAULT_LPQ is not set +# CONFIG_BUSYBOX_DEFAULT_MAKEMIME is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_MIME_CHARSET="" +# CONFIG_BUSYBOX_DEFAULT_POPMAILDIR is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_POPMAILDIR_DELIVERY is not set +# CONFIG_BUSYBOX_DEFAULT_REFORMIME is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_REFORMIME_COMPAT is not set +# CONFIG_BUSYBOX_DEFAULT_SENDMAIL is not set +# CONFIG_BUSYBOX_DEFAULT_IOSTAT is not set +# CONFIG_BUSYBOX_DEFAULT_LSOF is not set +# CONFIG_BUSYBOX_DEFAULT_MPSTAT is not set +# CONFIG_BUSYBOX_DEFAULT_NMETER is not set +# CONFIG_BUSYBOX_DEFAULT_PMAP is not set +# CONFIG_BUSYBOX_DEFAULT_POWERTOP is not set +# CONFIG_BUSYBOX_DEFAULT_PSTREE is not set +# CONFIG_BUSYBOX_DEFAULT_PWDX is not set +# CONFIG_BUSYBOX_DEFAULT_SMEMCAP is not set +CONFIG_BUSYBOX_DEFAULT_TOP=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TOP_SMP_CPU is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TOP_DECIMALS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TOP_SMP_PROCESS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TOPMEM is not set +CONFIG_BUSYBOX_DEFAULT_UPTIME=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_UPTIME_UTMP_SUPPORT is not set +CONFIG_BUSYBOX_DEFAULT_FREE=y +# CONFIG_BUSYBOX_DEFAULT_FUSER is not set +CONFIG_BUSYBOX_DEFAULT_KILL=y +CONFIG_BUSYBOX_DEFAULT_KILLALL=y +# CONFIG_BUSYBOX_DEFAULT_KILLALL5 is not set +CONFIG_BUSYBOX_DEFAULT_PGREP=y +CONFIG_BUSYBOX_DEFAULT_PIDOF=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_PIDOF_SINGLE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_PIDOF_OMIT is not set +# CONFIG_BUSYBOX_DEFAULT_PKILL is not set +CONFIG_BUSYBOX_DEFAULT_PS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_PS_WIDE=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_PS_LONG is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_PS_TIME is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_PS_ADDITIONAL_COLUMNS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_PS_UNUSUAL_SYSTEMS is not set +# CONFIG_BUSYBOX_DEFAULT_RENICE is not set +CONFIG_BUSYBOX_DEFAULT_BB_SYSCTL=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SHOW_THREADS is not set +# CONFIG_BUSYBOX_DEFAULT_WATCH is not set +# CONFIG_BUSYBOX_DEFAULT_CHPST is not set +# CONFIG_BUSYBOX_DEFAULT_SETUIDGID is not set +# CONFIG_BUSYBOX_DEFAULT_ENVUIDGID is not set +# CONFIG_BUSYBOX_DEFAULT_ENVDIR is not set +# CONFIG_BUSYBOX_DEFAULT_SOFTLIMIT is not set +# CONFIG_BUSYBOX_DEFAULT_RUNSV is not set +# CONFIG_BUSYBOX_DEFAULT_RUNSVDIR is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_RUNSVDIR_LOG is not set +# CONFIG_BUSYBOX_DEFAULT_SV is not set +CONFIG_BUSYBOX_DEFAULT_SV_DEFAULT_SERVICE_DIR="" +# CONFIG_BUSYBOX_DEFAULT_SVLOGD is not set +# CONFIG_BUSYBOX_DEFAULT_CHCON is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHCON_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_GETENFORCE is not set +# CONFIG_BUSYBOX_DEFAULT_GETSEBOOL is not set +# CONFIG_BUSYBOX_DEFAULT_LOAD_POLICY is not set +# CONFIG_BUSYBOX_DEFAULT_MATCHPATHCON is not set +# CONFIG_BUSYBOX_DEFAULT_RESTORECON is not set +# CONFIG_BUSYBOX_DEFAULT_RUNCON is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_RUNCON_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_SELINUXENABLED is not set +# CONFIG_BUSYBOX_DEFAULT_SETENFORCE is not set +# CONFIG_BUSYBOX_DEFAULT_SETFILES is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SETFILES_CHECK_OPTION is not set +# CONFIG_BUSYBOX_DEFAULT_SETSEBOOL is not set +# CONFIG_BUSYBOX_DEFAULT_SESTATUS is not set +CONFIG_BUSYBOX_DEFAULT_ASH=y +CONFIG_BUSYBOX_DEFAULT_ASH_BASH_COMPAT=y +# CONFIG_BUSYBOX_DEFAULT_ASH_IDLE_TIMEOUT is not set +CONFIG_BUSYBOX_DEFAULT_ASH_JOB_CONTROL=y +CONFIG_BUSYBOX_DEFAULT_ASH_ALIAS=y +CONFIG_BUSYBOX_DEFAULT_ASH_GETOPTS=y +CONFIG_BUSYBOX_DEFAULT_ASH_BUILTIN_ECHO=y +CONFIG_BUSYBOX_DEFAULT_ASH_BUILTIN_PRINTF=y +CONFIG_BUSYBOX_DEFAULT_ASH_BUILTIN_TEST=y +# CONFIG_BUSYBOX_DEFAULT_ASH_HELP is not set +CONFIG_BUSYBOX_DEFAULT_ASH_CMDCMD=y +# CONFIG_BUSYBOX_DEFAULT_ASH_MAIL is not set +# CONFIG_BUSYBOX_DEFAULT_ASH_OPTIMIZE_FOR_SIZE is not set +# CONFIG_BUSYBOX_DEFAULT_ASH_RANDOM_SUPPORT is not set +CONFIG_BUSYBOX_DEFAULT_ASH_EXPAND_PRMT=y +# CONFIG_BUSYBOX_DEFAULT_CTTYHACK is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_BASH_COMPAT is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_BRACE_EXPANSION is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_HELP is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_INTERACTIVE is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_SAVEHISTORY is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_JOB is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_TICK is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_IF is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_LOOPS is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_CASE is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_FUNCTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_LOCAL is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_RANDOM_SUPPORT is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_EXPORT_N is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_MODE_X is not set +# CONFIG_BUSYBOX_DEFAULT_MSH is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_SH_IS_ASH=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SH_IS_HUSH is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SH_IS_NONE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_BASH_IS_ASH is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_BASH_IS_HUSH is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_BASH_IS_NONE=y +CONFIG_BUSYBOX_DEFAULT_SH_MATH_SUPPORT=y +CONFIG_BUSYBOX_DEFAULT_SH_MATH_SUPPORT_64=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SH_EXTRA_QUIET is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SH_STANDALONE is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_SH_NOFORK=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SH_HISTFILESIZE is not set +# CONFIG_BUSYBOX_DEFAULT_KLOGD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_KLOGD_KLOGCTL is not set +CONFIG_BUSYBOX_DEFAULT_LOGGER=y +# CONFIG_BUSYBOX_DEFAULT_LOGREAD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LOGREAD_REDUCED_LOCKING is not set +# CONFIG_BUSYBOX_DEFAULT_SYSLOGD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_ROTATE_LOGFILE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_REMOTE_LOG is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SYSLOGD_DUP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SYSLOGD_CFG is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_SYSLOGD_READ_BUFFER_SIZE=0 +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IPC_SYSLOG is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0 +# CONFIG_BUSYBOX_DEFAULT_FEATURE_KMSG_SYSLOG is not set +CONFIG_BUSYBOX_CONFIG_HAVE_DOT_CONFIG=y + +# +# Busybox Settings +# + +# +# General Configuration +# +# CONFIG_BUSYBOX_CONFIG_DESKTOP is not set +# CONFIG_BUSYBOX_CONFIG_EXTRA_COMPAT is not set +CONFIG_BUSYBOX_CONFIG_INCLUDE_SUSv2=y +# CONFIG_BUSYBOX_CONFIG_USE_PORTABLE_CODE is not set +CONFIG_BUSYBOX_CONFIG_PLATFORM_LINUX=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_BUFFERS_USE_MALLOC is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set +CONFIG_BUSYBOX_CONFIG_SHOW_USAGE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_VERBOSE_USAGE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_COMPRESS_USAGE=y +# CONFIG_BUSYBOX_CONFIG_BUSYBOX is not set +# CONFIG_BUSYBOX_CONFIG_INSTALL_NO_USR is not set +# CONFIG_BUSYBOX_CONFIG_LOCALE_SUPPORT is not set +# CONFIG_BUSYBOX_CONFIG_UNICODE_SUPPORT is not set +# CONFIG_BUSYBOX_CONFIG_PAM is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_USE_SENDFILE is not set +CONFIG_BUSYBOX_CONFIG_LONG_OPTS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_DEVPTS=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_CLEAN_UP is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_UTMP is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_PIDFILE=y +CONFIG_BUSYBOX_CONFIG_PID_FILE_PATH="/var/run" +CONFIG_BUSYBOX_CONFIG_FEATURE_SUID=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_SUID_CONFIG is not set +# CONFIG_BUSYBOX_CONFIG_SELINUX is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_PREFER_APPLETS=y +CONFIG_BUSYBOX_CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe" +CONFIG_BUSYBOX_CONFIG_FEATURE_SYSLOG=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_HAVE_RPC is not set + +# +# Build Options +# +# CONFIG_BUSYBOX_CONFIG_STATIC is not set +# CONFIG_BUSYBOX_CONFIG_PIE is not set +# CONFIG_BUSYBOX_CONFIG_NOMMU is not set +CONFIG_BUSYBOX_CONFIG_LFS=y +CONFIG_BUSYBOX_CONFIG_CROSS_COMPILER_PREFIX="" +CONFIG_BUSYBOX_CONFIG_SYSROOT="" +CONFIG_BUSYBOX_CONFIG_EXTRA_CFLAGS="" +CONFIG_BUSYBOX_CONFIG_EXTRA_LDFLAGS="" +CONFIG_BUSYBOX_CONFIG_EXTRA_LDLIBS="" + +# +# Debugging Options +# +# CONFIG_BUSYBOX_CONFIG_DEBUG is not set +# CONFIG_BUSYBOX_CONFIG_DEBUG_SANITIZE is not set +# CONFIG_BUSYBOX_CONFIG_UNIT_TEST is not set +# CONFIG_BUSYBOX_CONFIG_WERROR is not set +CONFIG_BUSYBOX_CONFIG_NO_DEBUG_LIB=y +# CONFIG_BUSYBOX_CONFIG_DMALLOC is not set +# CONFIG_BUSYBOX_CONFIG_EFENCE is not set + +# +# Installation Options ("make install" behavior) +# +CONFIG_BUSYBOX_CONFIG_INSTALL_APPLET_SYMLINKS=y +# CONFIG_BUSYBOX_CONFIG_INSTALL_APPLET_HARDLINKS is not set +# CONFIG_BUSYBOX_CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set +# CONFIG_BUSYBOX_CONFIG_INSTALL_APPLET_DONT is not set +CONFIG_BUSYBOX_CONFIG_PREFIX="./_install" + +# +# Busybox Library Tuning +# +# CONFIG_BUSYBOX_CONFIG_FEATURE_USE_BSS_TAIL is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_RTMINMAX is not set +CONFIG_BUSYBOX_CONFIG_PASSWORD_MINLEN=6 +CONFIG_BUSYBOX_CONFIG_MD5_SMALL=1 +CONFIG_BUSYBOX_CONFIG_SHA3_SMALL=1 +CONFIG_BUSYBOX_CONFIG_FEATURE_FAST_TOP=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_ETC_NETWORKS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_USE_TERMIOS is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING=y +CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_MAX_LEN=512 +# CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_VI is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_HISTORY=256 +# CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_REVERSE_SEARCH is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_TAB_COMPLETION=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_USERNAME_COMPLETION is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_FANCY_PROMPT=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_NON_POSIX_CP=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_COPYBUF_KB=4 +# CONFIG_BUSYBOX_CONFIG_FEATURE_SKIP_ROOTFS is not set +# CONFIG_BUSYBOX_CONFIG_MONOTONIC_SYSCALL is not set +CONFIG_BUSYBOX_CONFIG_IOCTL_HEX2STR_ERROR=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_HWIB is not set + +# +# Applets +# + +# +# Archival Utilities +# +# CONFIG_BUSYBOX_CONFIG_FEATURE_SEAMLESS_XZ is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_SEAMLESS_LZMA is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_SEAMLESS_BZ2 is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_SEAMLESS_GZ=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_SEAMLESS_Z is not set +# CONFIG_BUSYBOX_CONFIG_AR is not set +# CONFIG_BUSYBOX_CONFIG_UNCOMPRESS is not set +CONFIG_BUSYBOX_CONFIG_GUNZIP=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_GUNZIP_LONG_OPTIONS is not set +CONFIG_BUSYBOX_CONFIG_BUNZIP2=y +# CONFIG_BUSYBOX_CONFIG_UNLZMA is not set +# CONFIG_BUSYBOX_CONFIG_UNXZ is not set +# CONFIG_BUSYBOX_CONFIG_BZIP2 is not set +# CONFIG_BUSYBOX_CONFIG_CPIO is not set +# CONFIG_BUSYBOX_CONFIG_DPKG is not set +# CONFIG_BUSYBOX_CONFIG_DPKG_DEB is not set +CONFIG_BUSYBOX_CONFIG_GZIP=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set +CONFIG_BUSYBOX_CONFIG_GZIP_FAST=0 +# CONFIG_BUSYBOX_CONFIG_FEATURE_GZIP_LEVELS is not set +# CONFIG_BUSYBOX_CONFIG_LZOP is not set +# CONFIG_BUSYBOX_CONFIG_RPM is not set +# CONFIG_BUSYBOX_CONFIG_RPM2CPIO is not set +CONFIG_BUSYBOX_CONFIG_TAR=y +CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_CREATE=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_AUTODETECT is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_FROM=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_UNAME_GNAME is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_NOPRESERVE_TIME is not set +# CONFIG_BUSYBOX_CONFIG_UNZIP is not set + +# +# Coreutils +# +CONFIG_BUSYBOX_CONFIG_BASENAME=y +CONFIG_BUSYBOX_CONFIG_CAT=y +CONFIG_BUSYBOX_CONFIG_DATE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_DATE_ISOFMT=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_DATE_NANO is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_DATE_COMPAT is not set +CONFIG_BUSYBOX_CONFIG_DD=y +CONFIG_BUSYBOX_CONFIG_FEATURE_DD_SIGNAL_HANDLING=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_DD_IBS_OBS=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_DD_STATUS is not set +# CONFIG_BUSYBOX_CONFIG_HOSTID is not set +CONFIG_BUSYBOX_CONFIG_ID=y +# CONFIG_BUSYBOX_CONFIG_GROUPS is not set +# CONFIG_BUSYBOX_CONFIG_SHUF is not set +# CONFIG_BUSYBOX_CONFIG_STAT is not set +CONFIG_BUSYBOX_CONFIG_SYNC=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_SYNC_FANCY is not set +CONFIG_BUSYBOX_CONFIG_TEST=y +CONFIG_BUSYBOX_CONFIG_FEATURE_TEST_64=y +CONFIG_BUSYBOX_CONFIG_TOUCH=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_TOUCH_NODEREF is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_TOUCH_SUSV3=y +CONFIG_BUSYBOX_CONFIG_TR=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_TR_CLASSES is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_TR_EQUIV is not set +# CONFIG_BUSYBOX_CONFIG_TRUNCATE is not set +# CONFIG_BUSYBOX_CONFIG_UNLINK is not set +# CONFIG_BUSYBOX_CONFIG_BASE64 is not set +# CONFIG_BUSYBOX_CONFIG_CAL is not set +# CONFIG_BUSYBOX_CONFIG_CATV is not set +CONFIG_BUSYBOX_CONFIG_CHGRP=y +CONFIG_BUSYBOX_CONFIG_CHMOD=y +CONFIG_BUSYBOX_CONFIG_CHOWN=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set +CONFIG_BUSYBOX_CONFIG_CHROOT=y +# CONFIG_BUSYBOX_CONFIG_CKSUM is not set +# CONFIG_BUSYBOX_CONFIG_COMM is not set +CONFIG_BUSYBOX_CONFIG_CP=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_CP_LONG_OPTIONS is not set +CONFIG_BUSYBOX_CONFIG_CUT=y +CONFIG_BUSYBOX_CONFIG_DF=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_DF_FANCY is not set +CONFIG_BUSYBOX_CONFIG_DIRNAME=y +# CONFIG_BUSYBOX_CONFIG_DOS2UNIX is not set +CONFIG_BUSYBOX_CONFIG_DU=y +CONFIG_BUSYBOX_CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y +CONFIG_BUSYBOX_CONFIG_ECHO=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FANCY_ECHO=y +CONFIG_BUSYBOX_CONFIG_ENV=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_ENV_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_CONFIG_EXPAND is not set +CONFIG_BUSYBOX_CONFIG_EXPR=y +CONFIG_BUSYBOX_CONFIG_EXPR_MATH_SUPPORT_64=y +CONFIG_BUSYBOX_CONFIG_FALSE=y +# CONFIG_BUSYBOX_CONFIG_FOLD is not set +CONFIG_BUSYBOX_CONFIG_FSYNC=y +CONFIG_BUSYBOX_CONFIG_HEAD=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FANCY_HEAD=y +# CONFIG_BUSYBOX_CONFIG_INSTALL is not set +CONFIG_BUSYBOX_CONFIG_LN=y +# CONFIG_BUSYBOX_CONFIG_LOGNAME is not set +CONFIG_BUSYBOX_CONFIG_LS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_LS_FILETYPES=y +CONFIG_BUSYBOX_CONFIG_FEATURE_LS_FOLLOWLINKS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_LS_RECURSIVE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_LS_SORTFILES=y +CONFIG_BUSYBOX_CONFIG_FEATURE_LS_TIMESTAMPS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_LS_USERNAME=y +CONFIG_BUSYBOX_CONFIG_FEATURE_LS_COLOR=y +CONFIG_BUSYBOX_CONFIG_FEATURE_LS_COLOR_IS_DEFAULT=y +CONFIG_BUSYBOX_CONFIG_MD5SUM=y +CONFIG_BUSYBOX_CONFIG_MKDIR=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_MKDIR_LONG_OPTIONS is not set +CONFIG_BUSYBOX_CONFIG_MKFIFO=y +CONFIG_BUSYBOX_CONFIG_MKNOD=y +CONFIG_BUSYBOX_CONFIG_MV=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_MV_LONG_OPTIONS is not set +CONFIG_BUSYBOX_CONFIG_NICE=y +# CONFIG_BUSYBOX_CONFIG_NOHUP is not set +# CONFIG_BUSYBOX_CONFIG_OD is not set +# CONFIG_BUSYBOX_CONFIG_PRINTENV is not set +CONFIG_BUSYBOX_CONFIG_PRINTF=y +CONFIG_BUSYBOX_CONFIG_PWD=y +CONFIG_BUSYBOX_CONFIG_READLINK=y +CONFIG_BUSYBOX_CONFIG_FEATURE_READLINK_FOLLOW=y +# CONFIG_BUSYBOX_CONFIG_REALPATH is not set +CONFIG_BUSYBOX_CONFIG_RM=y +CONFIG_BUSYBOX_CONFIG_RMDIR=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_RMDIR_LONG_OPTIONS is not set +CONFIG_BUSYBOX_CONFIG_SEQ=y +# CONFIG_BUSYBOX_CONFIG_SHA1SUM is not set +CONFIG_BUSYBOX_CONFIG_SHA256SUM=y +# CONFIG_BUSYBOX_CONFIG_SHA512SUM is not set +# CONFIG_BUSYBOX_CONFIG_SHA3SUM is not set +CONFIG_BUSYBOX_CONFIG_SLEEP=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FANCY_SLEEP=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_FLOAT_SLEEP is not set +CONFIG_BUSYBOX_CONFIG_SORT=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_SORT_BIG is not set +# CONFIG_BUSYBOX_CONFIG_SPLIT is not set +# CONFIG_BUSYBOX_CONFIG_STTY is not set +# CONFIG_BUSYBOX_CONFIG_SUM is not set +# CONFIG_BUSYBOX_CONFIG_TAC is not set +CONFIG_BUSYBOX_CONFIG_TAIL=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FANCY_TAIL=y +CONFIG_BUSYBOX_CONFIG_TEE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_TEE_USE_BLOCK_IO=y +CONFIG_BUSYBOX_CONFIG_TRUE=y +# CONFIG_BUSYBOX_CONFIG_TTY is not set +CONFIG_BUSYBOX_CONFIG_UNAME=y +CONFIG_BUSYBOX_CONFIG_UNAME_OSNAME="GNU/Linux" +# CONFIG_BUSYBOX_CONFIG_UNEXPAND is not set +CONFIG_BUSYBOX_CONFIG_UNIQ=y +# CONFIG_BUSYBOX_CONFIG_USLEEP is not set +# CONFIG_BUSYBOX_CONFIG_UUDECODE is not set +# CONFIG_BUSYBOX_CONFIG_UUENCODE is not set +CONFIG_BUSYBOX_CONFIG_WC=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_WC_LARGE is not set +# CONFIG_BUSYBOX_CONFIG_WHOAMI is not set +CONFIG_BUSYBOX_CONFIG_YES=y + +# +# Common options +# +# CONFIG_BUSYBOX_CONFIG_FEATURE_VERBOSE is not set + +# +# Common options for cp and mv +# +CONFIG_BUSYBOX_CONFIG_FEATURE_PRESERVE_HARDLINKS=y + +# +# Common options for ls, more and telnet +# +CONFIG_BUSYBOX_CONFIG_FEATURE_AUTOWIDTH=y + +# +# Common options for df, du, ls +# +CONFIG_BUSYBOX_CONFIG_FEATURE_HUMAN_READABLE=y + +# +# Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum +# +CONFIG_BUSYBOX_CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y + +# +# Console Utilities +# +# CONFIG_BUSYBOX_CONFIG_CHVT is not set +# CONFIG_BUSYBOX_CONFIG_FGCONSOLE is not set +CONFIG_BUSYBOX_CONFIG_CLEAR=y +# CONFIG_BUSYBOX_CONFIG_DEALLOCVT is not set +# CONFIG_BUSYBOX_CONFIG_DUMPKMAP is not set +# CONFIG_BUSYBOX_CONFIG_KBD_MODE is not set +# CONFIG_BUSYBOX_CONFIG_LOADFONT is not set +# CONFIG_BUSYBOX_CONFIG_LOADKMAP is not set +# CONFIG_BUSYBOX_CONFIG_OPENVT is not set +CONFIG_BUSYBOX_CONFIG_RESET=y +# CONFIG_BUSYBOX_CONFIG_RESIZE is not set +# CONFIG_BUSYBOX_CONFIG_SETCONSOLE is not set +# CONFIG_BUSYBOX_CONFIG_SETFONT is not set +# CONFIG_BUSYBOX_CONFIG_SETKEYCODES is not set +# CONFIG_BUSYBOX_CONFIG_SETLOGCONS is not set +# CONFIG_BUSYBOX_CONFIG_SHOWKEY is not set + +# +# Debian Utilities +# +CONFIG_BUSYBOX_CONFIG_MKTEMP=y +# CONFIG_BUSYBOX_CONFIG_PIPE_PROGRESS is not set +# CONFIG_BUSYBOX_CONFIG_RUN_PARTS is not set +CONFIG_BUSYBOX_CONFIG_START_STOP_DAEMON=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_START_STOP_DAEMON_FANCY is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS is not set +CONFIG_BUSYBOX_CONFIG_WHICH=y + +# +# Editors +# +CONFIG_BUSYBOX_CONFIG_AWK=y +CONFIG_BUSYBOX_CONFIG_FEATURE_AWK_LIBM=y +CONFIG_BUSYBOX_CONFIG_FEATURE_AWK_GNU_EXTENSIONS=y +CONFIG_BUSYBOX_CONFIG_CMP=y +# CONFIG_BUSYBOX_CONFIG_DIFF is not set +# CONFIG_BUSYBOX_CONFIG_ED is not set +# CONFIG_BUSYBOX_CONFIG_PATCH is not set +CONFIG_BUSYBOX_CONFIG_SED=y +CONFIG_BUSYBOX_CONFIG_VI=y +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_MAX_LEN=1024 +# CONFIG_BUSYBOX_CONFIG_FEATURE_VI_8BIT is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_COLON=y +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_YANKMARK=y +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_SEARCH=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_VI_REGEX_SEARCH is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_USE_SIGNALS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_DOT_CMD=y +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_READONLY=y +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_SETOPTS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_SET=y +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_WIN_RESIZE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_ASK_TERMINAL=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_VI_UNDO is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_ALLOW_EXEC=y + +# +# Finding Utilities +# +CONFIG_BUSYBOX_CONFIG_FIND=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_PRINT0=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_MTIME=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_MMIN is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_PERM=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_TYPE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_XDEV=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_MAXDEPTH=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_NEWER is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_INUM is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_EXEC=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_EXEC_PLUS is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_USER=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_GROUP=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_NOT=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_DEPTH=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_PAREN=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_SIZE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_PRUNE=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_DELETE is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_PATH=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_REGEX=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_LINKS is not set +CONFIG_BUSYBOX_CONFIG_GREP=y +CONFIG_BUSYBOX_CONFIG_FEATURE_GREP_EGREP_ALIAS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_GREP_FGREP_ALIAS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_GREP_CONTEXT=y +CONFIG_BUSYBOX_CONFIG_XARGS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION=y +CONFIG_BUSYBOX_CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y +CONFIG_BUSYBOX_CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y +CONFIG_BUSYBOX_CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR is not set + +# +# Init Utilities +# +# CONFIG_BUSYBOX_CONFIG_BOOTCHARTD is not set +CONFIG_BUSYBOX_CONFIG_HALT=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_CALL_TELINIT is not set +# CONFIG_BUSYBOX_CONFIG_INIT is not set +# CONFIG_BUSYBOX_CONFIG_LINUXRC is not set +# CONFIG_BUSYBOX_CONFIG_MESG is not set + +# +# Login/Password Management Utilities +# +CONFIG_BUSYBOX_CONFIG_FEATURE_SHADOWPASSWDS=y +# CONFIG_BUSYBOX_CONFIG_USE_BB_PWD_GRP is not set +# CONFIG_BUSYBOX_CONFIG_USE_BB_CRYPT is not set +# CONFIG_BUSYBOX_CONFIG_ADD_SHELL is not set +# CONFIG_BUSYBOX_CONFIG_REMOVE_SHELL is not set +# CONFIG_BUSYBOX_CONFIG_ADDGROUP is not set +# CONFIG_BUSYBOX_CONFIG_ADDUSER is not set +# CONFIG_BUSYBOX_CONFIG_CHPASSWD is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="md5" +# CONFIG_BUSYBOX_CONFIG_CRYPTPW is not set +# CONFIG_BUSYBOX_CONFIG_MKPASSWD is not set +# CONFIG_BUSYBOX_CONFIG_DELUSER is not set +# CONFIG_BUSYBOX_CONFIG_DELGROUP is not set +# CONFIG_BUSYBOX_CONFIG_GETTY is not set +CONFIG_BUSYBOX_CONFIG_LOGIN=y +# CONFIG_BUSYBOX_CONFIG_LOGIN_SESSION_AS_CHILD is not set +# CONFIG_BUSYBOX_CONFIG_LOGIN_SCRIPTS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_NOLOGIN is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_SECURETTY is not set +CONFIG_BUSYBOX_CONFIG_PASSWD=y +CONFIG_BUSYBOX_CONFIG_FEATURE_PASSWD_WEAK_CHECK=y +# CONFIG_BUSYBOX_CONFIG_SU is not set +# CONFIG_BUSYBOX_CONFIG_SULOGIN is not set +# CONFIG_BUSYBOX_CONFIG_VLOCK is not set + +# +# Linux Ext2 FS Progs +# +# CONFIG_BUSYBOX_CONFIG_CHATTR is not set +# CONFIG_BUSYBOX_CONFIG_FSCK is not set +# CONFIG_BUSYBOX_CONFIG_LSATTR is not set +# CONFIG_BUSYBOX_CONFIG_TUNE2FS is not set + +# +# Linux Module Utilities +# +# CONFIG_BUSYBOX_CONFIG_MODINFO is not set +# CONFIG_BUSYBOX_CONFIG_MODPROBE_SMALL is not set +# CONFIG_BUSYBOX_CONFIG_INSMOD is not set +# CONFIG_BUSYBOX_CONFIG_RMMOD is not set +# CONFIG_BUSYBOX_CONFIG_LSMOD is not set +# CONFIG_BUSYBOX_CONFIG_MODPROBE is not set +# CONFIG_BUSYBOX_CONFIG_DEPMOD is not set + +# +# Options common to multiple modutils +# + +# +# Linux System Utilities +# +# CONFIG_BUSYBOX_CONFIG_BLKDISCARD is not set +# CONFIG_BUSYBOX_CONFIG_BLOCKDEV is not set +# CONFIG_BUSYBOX_CONFIG_FATATTR is not set +# CONFIG_BUSYBOX_CONFIG_FSTRIM is not set +# CONFIG_BUSYBOX_CONFIG_MDEV is not set +CONFIG_BUSYBOX_CONFIG_MOUNT=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_FAKE is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_VERBOSE is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_HELPERS=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_LABEL is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_NFS is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_CIFS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_FLAGS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_FSTAB=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_OTHERTAB is not set +# CONFIG_BUSYBOX_CONFIG_NSENTER is not set +# CONFIG_BUSYBOX_CONFIG_REV is not set +# CONFIG_BUSYBOX_CONFIG_SETARCH is not set +# CONFIG_BUSYBOX_CONFIG_UEVENT is not set +# CONFIG_BUSYBOX_CONFIG_UNSHARE is not set +# CONFIG_BUSYBOX_CONFIG_ACPID is not set +# CONFIG_BUSYBOX_CONFIG_BLKID is not set +CONFIG_BUSYBOX_CONFIG_DMESG=y +CONFIG_BUSYBOX_CONFIG_FEATURE_DMESG_PRETTY=y +# CONFIG_BUSYBOX_CONFIG_FBSET is not set +# CONFIG_BUSYBOX_CONFIG_FDFLUSH is not set +# CONFIG_BUSYBOX_CONFIG_FDFORMAT is not set +# CONFIG_BUSYBOX_CONFIG_FDISK is not set +# CONFIG_BUSYBOX_CONFIG_FINDFS is not set +# CONFIG_BUSYBOX_CONFIG_FLOCK is not set +# CONFIG_BUSYBOX_CONFIG_FREERAMDISK is not set +# CONFIG_BUSYBOX_CONFIG_FSCK_MINIX is not set +# CONFIG_BUSYBOX_CONFIG_MKFS_EXT2 is not set +# CONFIG_BUSYBOX_CONFIG_MKFS_MINIX is not set +# CONFIG_BUSYBOX_CONFIG_MKFS_REISER is not set +# CONFIG_BUSYBOX_CONFIG_MKFS_VFAT is not set +# CONFIG_BUSYBOX_CONFIG_GETOPT is not set +CONFIG_BUSYBOX_CONFIG_HEXDUMP=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_HEXDUMP_REVERSE is not set +# CONFIG_BUSYBOX_CONFIG_HD is not set +CONFIG_BUSYBOX_CONFIG_HWCLOCK=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set +# CONFIG_BUSYBOX_CONFIG_IPCRM is not set +# CONFIG_BUSYBOX_CONFIG_IPCS is not set +# CONFIG_BUSYBOX_CONFIG_LOSETUP is not set +# CONFIG_BUSYBOX_CONFIG_LSPCI is not set +# CONFIG_BUSYBOX_CONFIG_LSUSB is not set +CONFIG_BUSYBOX_CONFIG_MKSWAP=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_MKSWAP_UUID is not set +# CONFIG_BUSYBOX_CONFIG_MORE is not set +CONFIG_BUSYBOX_CONFIG_PIVOT_ROOT=y +# CONFIG_BUSYBOX_CONFIG_RDATE is not set +# CONFIG_BUSYBOX_CONFIG_RDEV is not set +# CONFIG_BUSYBOX_CONFIG_READPROFILE is not set +# CONFIG_BUSYBOX_CONFIG_RTCWAKE is not set +# CONFIG_BUSYBOX_CONFIG_SCRIPT is not set +# CONFIG_BUSYBOX_CONFIG_SCRIPTREPLAY is not set +# CONFIG_BUSYBOX_CONFIG_SWAPONOFF is not set +CONFIG_BUSYBOX_CONFIG_SWITCH_ROOT=y +CONFIG_BUSYBOX_CONFIG_UMOUNT=y +CONFIG_BUSYBOX_CONFIG_FEATURE_UMOUNT_ALL=y + +# +# Common options for mount/umount +# +CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_LOOP=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_LOOP_CREATE is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_MTAB_SUPPORT is not set +# CONFIG_BUSYBOX_CONFIG_VOLUMEID is not set + +# +# Miscellaneous Utilities +# +# CONFIG_BUSYBOX_CONFIG_CONSPY is not set +CONFIG_BUSYBOX_CONFIG_CROND=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_CROND_D is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_CROND_DIR="/etc" +# CONFIG_BUSYBOX_CONFIG_I2CGET is not set +# CONFIG_BUSYBOX_CONFIG_I2CSET is not set +# CONFIG_BUSYBOX_CONFIG_I2CDUMP is not set +# CONFIG_BUSYBOX_CONFIG_I2CDETECT is not set +CONFIG_BUSYBOX_CONFIG_LESS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_MAXLINES=9999999 +# CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_BRACKETS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_FLAGS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_TRUNCATE is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_MARKS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_REGEXP is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_WINCH is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_DASHCMD is not set +# CONFIG_BUSYBOX_CONFIG_NANDWRITE is not set +# CONFIG_BUSYBOX_CONFIG_NANDDUMP is not set +# CONFIG_BUSYBOX_CONFIG_RFKILL is not set +# CONFIG_BUSYBOX_CONFIG_SETSERIAL is not set +# CONFIG_BUSYBOX_CONFIG_TASKSET is not set +# CONFIG_BUSYBOX_CONFIG_UBIATTACH is not set +# CONFIG_BUSYBOX_CONFIG_UBIDETACH is not set +# CONFIG_BUSYBOX_CONFIG_UBIMKVOL is not set +# CONFIG_BUSYBOX_CONFIG_UBIRMVOL is not set +# CONFIG_BUSYBOX_CONFIG_UBIRSVOL is not set +# CONFIG_BUSYBOX_CONFIG_UBIUPDATEVOL is not set +# CONFIG_BUSYBOX_CONFIG_UBIRENAME is not set +# CONFIG_BUSYBOX_CONFIG_ADJTIMEX is not set +# CONFIG_BUSYBOX_CONFIG_BBCONFIG is not set +# CONFIG_BUSYBOX_CONFIG_BEEP is not set +# CONFIG_BUSYBOX_CONFIG_CHAT is not set +# CONFIG_BUSYBOX_CONFIG_CHRT is not set +CONFIG_BUSYBOX_CONFIG_CRONTAB=y +# CONFIG_BUSYBOX_CONFIG_DC is not set +# CONFIG_BUSYBOX_CONFIG_DEVFSD is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_DEVFS is not set +# CONFIG_BUSYBOX_CONFIG_DEVMEM is not set +# CONFIG_BUSYBOX_CONFIG_EJECT is not set +# CONFIG_BUSYBOX_CONFIG_FBSPLASH is not set +# CONFIG_BUSYBOX_CONFIG_FLASHCP is not set +# CONFIG_BUSYBOX_CONFIG_FLASH_LOCK is not set +# CONFIG_BUSYBOX_CONFIG_FLASH_UNLOCK is not set +# CONFIG_BUSYBOX_CONFIG_FLASH_ERASEALL is not set +# CONFIG_BUSYBOX_CONFIG_IONICE is not set +# CONFIG_BUSYBOX_CONFIG_INOTIFYD is not set +# CONFIG_BUSYBOX_CONFIG_HDPARM is not set +CONFIG_BUSYBOX_CONFIG_LOCK=y +# CONFIG_BUSYBOX_CONFIG_MAKEDEVS is not set +# CONFIG_BUSYBOX_CONFIG_MAN is not set +# CONFIG_BUSYBOX_CONFIG_MICROCOM is not set +# CONFIG_BUSYBOX_CONFIG_MOUNTPOINT is not set +# CONFIG_BUSYBOX_CONFIG_MT is not set +# CONFIG_BUSYBOX_CONFIG_RAIDAUTORUN is not set +# CONFIG_BUSYBOX_CONFIG_READAHEAD is not set +# CONFIG_BUSYBOX_CONFIG_RX is not set +# CONFIG_BUSYBOX_CONFIG_SETSID is not set +CONFIG_BUSYBOX_CONFIG_STRINGS=y +CONFIG_BUSYBOX_CONFIG_TIME=y +# CONFIG_BUSYBOX_CONFIG_TIMEOUT is not set +# CONFIG_BUSYBOX_CONFIG_TTYSIZE is not set +# CONFIG_BUSYBOX_CONFIG_VOLNAME is not set +# CONFIG_BUSYBOX_CONFIG_WATCHDOG is not set + +# +# Networking Utilities +# +# CONFIG_BUSYBOX_CONFIG_NAMEIF is not set +# CONFIG_BUSYBOX_CONFIG_NBDCLIENT is not set +CONFIG_BUSYBOX_CONFIG_NC=y +# CONFIG_BUSYBOX_CONFIG_NC_SERVER is not set +# CONFIG_BUSYBOX_CONFIG_NC_EXTRA is not set +# CONFIG_BUSYBOX_CONFIG_NC_110_COMPAT is not set +CONFIG_BUSYBOX_CONFIG_PING=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FANCY_PING=y +# CONFIG_BUSYBOX_CONFIG_WGET is not set +# CONFIG_BUSYBOX_CONFIG_WHOIS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_IPV6 is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_UNIX_LOCAL is not set +CONFIG_BUSYBOX_CONFIG_VERBOSE_RESOLUTION_ERRORS=y +# CONFIG_BUSYBOX_CONFIG_ARP is not set +# CONFIG_BUSYBOX_CONFIG_ARPING is not set +CONFIG_BUSYBOX_CONFIG_BRCTL=y +CONFIG_BUSYBOX_CONFIG_FEATURE_BRCTL_FANCY=y +CONFIG_BUSYBOX_CONFIG_FEATURE_BRCTL_SHOW=y +# CONFIG_BUSYBOX_CONFIG_DNSD is not set +# CONFIG_BUSYBOX_CONFIG_ETHER_WAKE is not set +# CONFIG_BUSYBOX_CONFIG_FAKEIDENTD is not set +# CONFIG_BUSYBOX_CONFIG_FTPD is not set +# CONFIG_BUSYBOX_CONFIG_FTPGET is not set +# CONFIG_BUSYBOX_CONFIG_FTPPUT is not set +# CONFIG_BUSYBOX_CONFIG_HOSTNAME is not set +# CONFIG_BUSYBOX_CONFIG_HTTPD is not set +CONFIG_BUSYBOX_CONFIG_IFCONFIG=y +CONFIG_BUSYBOX_CONFIG_FEATURE_IFCONFIG_STATUS=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_IFCONFIG_SLIP is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_IFCONFIG_HW=y +CONFIG_BUSYBOX_CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y +# CONFIG_BUSYBOX_CONFIG_IFENSLAVE is not set +# CONFIG_BUSYBOX_CONFIG_IFPLUGD is not set +# CONFIG_BUSYBOX_CONFIG_IFUPDOWN is not set +# CONFIG_BUSYBOX_CONFIG_INETD is not set +CONFIG_BUSYBOX_CONFIG_IP=y +CONFIG_BUSYBOX_CONFIG_FEATURE_IP_ADDRESS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_IP_LINK=y +CONFIG_BUSYBOX_CONFIG_FEATURE_IP_ROUTE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_IP_ROUTE_DIR="/etc/iproute2" +# CONFIG_BUSYBOX_CONFIG_FEATURE_IP_TUNNEL is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_IP_RULE=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_IP_NEIGH is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set +# CONFIG_BUSYBOX_CONFIG_IPCALC is not set +CONFIG_BUSYBOX_CONFIG_NETMSG=y +CONFIG_BUSYBOX_CONFIG_NETSTAT=y +CONFIG_BUSYBOX_CONFIG_FEATURE_NETSTAT_WIDE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_NETSTAT_PRG=y +# CONFIG_BUSYBOX_CONFIG_NSLOOKUP is not set +CONFIG_BUSYBOX_CONFIG_NSLOOKUP_LEDE=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS is not set +CONFIG_BUSYBOX_CONFIG_NTPD=y +CONFIG_BUSYBOX_CONFIG_FEATURE_NTPD_SERVER=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_NTPD_CONF is not set +# CONFIG_BUSYBOX_CONFIG_PSCAN is not set +CONFIG_BUSYBOX_CONFIG_ROUTE=y +# CONFIG_BUSYBOX_CONFIG_SLATTACH is not set +# CONFIG_BUSYBOX_CONFIG_TCPSVD is not set +# CONFIG_BUSYBOX_CONFIG_TELNET is not set +# CONFIG_BUSYBOX_CONFIG_TELNETD is not set +# CONFIG_BUSYBOX_CONFIG_TFTP is not set +# CONFIG_BUSYBOX_CONFIG_TFTPD is not set +CONFIG_BUSYBOX_CONFIG_TRACEROUTE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_TRACEROUTE_VERBOSE=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set +# CONFIG_BUSYBOX_CONFIG_TUNCTL is not set +# CONFIG_BUSYBOX_CONFIG_UDHCPD is not set +CONFIG_BUSYBOX_CONFIG_UDHCPC=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_UDHCPC_ARPING is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_UDHCPC_SANITIZEOPT is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_UDHCP_PORT is not set +CONFIG_BUSYBOX_CONFIG_UDHCP_DEBUG=0 +CONFIG_BUSYBOX_CONFIG_FEATURE_UDHCP_RFC3397=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_UDHCP_8021Q is not set +CONFIG_BUSYBOX_CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script" +CONFIG_BUSYBOX_CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80 +# CONFIG_BUSYBOX_CONFIG_UDPSVD is not set +# CONFIG_BUSYBOX_CONFIG_VCONFIG is not set +# CONFIG_BUSYBOX_CONFIG_ZCIP is not set + +# +# Print Utilities +# +# CONFIG_BUSYBOX_CONFIG_LPD is not set +# CONFIG_BUSYBOX_CONFIG_LPR is not set +# CONFIG_BUSYBOX_CONFIG_LPQ is not set + +# +# Mail Utilities +# +# CONFIG_BUSYBOX_CONFIG_MAKEMIME is not set +# CONFIG_BUSYBOX_CONFIG_POPMAILDIR is not set +# CONFIG_BUSYBOX_CONFIG_REFORMIME is not set +# CONFIG_BUSYBOX_CONFIG_SENDMAIL is not set + +# +# Process Utilities +# +# CONFIG_BUSYBOX_CONFIG_IOSTAT is not set +# CONFIG_BUSYBOX_CONFIG_LSOF is not set +# CONFIG_BUSYBOX_CONFIG_MPSTAT is not set +# CONFIG_BUSYBOX_CONFIG_NMETER is not set +# CONFIG_BUSYBOX_CONFIG_PMAP is not set +# CONFIG_BUSYBOX_CONFIG_POWERTOP is not set +# CONFIG_BUSYBOX_CONFIG_PSTREE is not set +# CONFIG_BUSYBOX_CONFIG_PWDX is not set +# CONFIG_BUSYBOX_CONFIG_SMEMCAP is not set +CONFIG_BUSYBOX_CONFIG_TOP=y +CONFIG_BUSYBOX_CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_TOP_SMP_CPU is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_TOP_DECIMALS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_TOP_SMP_PROCESS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_TOPMEM is not set +CONFIG_BUSYBOX_CONFIG_UPTIME=y +CONFIG_BUSYBOX_CONFIG_FREE=y +# CONFIG_BUSYBOX_CONFIG_FUSER is not set +CONFIG_BUSYBOX_CONFIG_KILL=y +CONFIG_BUSYBOX_CONFIG_KILLALL=y +# CONFIG_BUSYBOX_CONFIG_KILLALL5 is not set +CONFIG_BUSYBOX_CONFIG_PGREP=y +CONFIG_BUSYBOX_CONFIG_PIDOF=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_PIDOF_SINGLE is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_PIDOF_OMIT is not set +# CONFIG_BUSYBOX_CONFIG_PKILL is not set +CONFIG_BUSYBOX_CONFIG_PS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_PS_WIDE=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_PS_LONG is not set +# CONFIG_BUSYBOX_CONFIG_RENICE is not set +CONFIG_BUSYBOX_CONFIG_BB_SYSCTL=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_SHOW_THREADS is not set +# CONFIG_BUSYBOX_CONFIG_WATCH is not set + +# +# Runit Utilities +# +# CONFIG_BUSYBOX_CONFIG_CHPST is not set +# CONFIG_BUSYBOX_CONFIG_SETUIDGID is not set +# CONFIG_BUSYBOX_CONFIG_ENVUIDGID is not set +# CONFIG_BUSYBOX_CONFIG_ENVDIR is not set +# CONFIG_BUSYBOX_CONFIG_SOFTLIMIT is not set +# CONFIG_BUSYBOX_CONFIG_RUNSV is not set +# CONFIG_BUSYBOX_CONFIG_RUNSVDIR is not set +# CONFIG_BUSYBOX_CONFIG_SV is not set +# CONFIG_BUSYBOX_CONFIG_SVLOGD is not set + +# +# Shells +# +CONFIG_BUSYBOX_CONFIG_ASH=y +CONFIG_BUSYBOX_CONFIG_ASH_BASH_COMPAT=y +# CONFIG_BUSYBOX_CONFIG_ASH_IDLE_TIMEOUT is not set +CONFIG_BUSYBOX_CONFIG_ASH_JOB_CONTROL=y +CONFIG_BUSYBOX_CONFIG_ASH_ALIAS=y +CONFIG_BUSYBOX_CONFIG_ASH_GETOPTS=y +CONFIG_BUSYBOX_CONFIG_ASH_BUILTIN_ECHO=y +CONFIG_BUSYBOX_CONFIG_ASH_BUILTIN_PRINTF=y +CONFIG_BUSYBOX_CONFIG_ASH_BUILTIN_TEST=y +# CONFIG_BUSYBOX_CONFIG_ASH_HELP is not set +CONFIG_BUSYBOX_CONFIG_ASH_CMDCMD=y +# CONFIG_BUSYBOX_CONFIG_ASH_MAIL is not set +# CONFIG_BUSYBOX_CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set +# CONFIG_BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT is not set +CONFIG_BUSYBOX_CONFIG_ASH_EXPAND_PRMT=y +# CONFIG_BUSYBOX_CONFIG_CTTYHACK is not set +# CONFIG_BUSYBOX_CONFIG_HUSH is not set +# CONFIG_BUSYBOX_CONFIG_MSH is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_SH_IS_ASH=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_SH_IS_NONE is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_BASH_IS_ASH is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_BASH_IS_NONE=y +CONFIG_BUSYBOX_CONFIG_SH_MATH_SUPPORT=y +CONFIG_BUSYBOX_CONFIG_SH_MATH_SUPPORT_64=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_SH_EXTRA_QUIET is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_SH_STANDALONE is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_SH_NOFORK=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_SH_HISTFILESIZE is not set + +# +# System Logging Utilities +# +# CONFIG_BUSYBOX_CONFIG_KLOGD is not set +CONFIG_BUSYBOX_CONFIG_LOGGER=y +# CONFIG_BUSYBOX_CONFIG_SYSLOGD is not set +# CONFIG_PACKAGE_ca-bundle is not set +# CONFIG_PACKAGE_ca-certificates is not set +# CONFIG_PACKAGE_dnsmasq is not set +# CONFIG_PACKAGE_dnsmasq-dhcpv6 is not set +CONFIG_PACKAGE_dnsmasq-full=y +# CONFIG_PACKAGE_dnsmasq_full_dhcpv6 is not set +# CONFIG_PACKAGE_dnsmasq_full_dnssec is not set +# CONFIG_PACKAGE_dnsmasq_full_auth is not set +CONFIG_PACKAGE_dnsmasq_full_ipset=y +# CONFIG_PACKAGE_dnsmasq_full_conntrack is not set +# CONFIG_PACKAGE_dnsmasq_full_noid is not set +# CONFIG_PACKAGE_dnsmasq_full_broken_rtc is not set +CONFIG_PACKAGE_dropbear=y + +# +# Configuration +# +CONFIG_DROPBEAR_CURVE25519=y +# CONFIG_DROPBEAR_ECC is not set +# CONFIG_DROPBEAR_ZLIB is not set +# CONFIG_PACKAGE_ead is not set +CONFIG_PACKAGE_firewall=y +CONFIG_PACKAGE_fstools=y +CONFIG_PACKAGE_fwtool=y +CONFIG_PACKAGE_jsonfilter=y +CONFIG_PACKAGE_lede-keyring=y +# CONFIG_PACKAGE_libatomic is not set +CONFIG_PACKAGE_libc=y +CONFIG_PACKAGE_libgcc=y +CONFIG_PACKAGE_libpthread=y +# CONFIG_PACKAGE_librt is not set +# CONFIG_PACKAGE_libstdcpp is not set +CONFIG_PACKAGE_logd=y +# CONFIG_PACKAGE_mksh is not set +CONFIG_PACKAGE_mtd=y +CONFIG_PACKAGE_netifd=y +# CONFIG_PACKAGE_nvram is not set +# CONFIG_PACKAGE_om-watchdog is not set +CONFIG_PACKAGE_opkg=y +CONFIG_PACKAGE_procd=y + +# +# Configuration +# +# CONFIG_PROCD_SHOW_BOOT is not set +# CONFIG_PROCD_ZRAM_TMPFS is not set +# CONFIG_PACKAGE_qos-scripts is not set +# CONFIG_PACKAGE_resolveip is not set +# CONFIG_PACKAGE_rpcd is not set +# CONFIG_PACKAGE_snapshot-tool is not set +# CONFIG_PACKAGE_sqm-scripts is not set +# CONFIG_PACKAGE_sqm-scripts-extra is not set +CONFIG_PACKAGE_swconfig=y +CONFIG_PACKAGE_ubox=y +CONFIG_PACKAGE_ubus=y +CONFIG_PACKAGE_ubusd=y +CONFIG_PACKAGE_uci=y +CONFIG_PACKAGE_usign=y +# CONFIG_PACKAGE_wireless-tools is not set +# CONFIG_PACKAGE_zram-swap is not set + +# +# Administration +# + +# +# openwisp +# +# CONFIG_PACKAGE_openwisp-config-cyassl is not set +# CONFIG_PACKAGE_openwisp-config-mbedtls is not set +# CONFIG_PACKAGE_openwisp-config-nossl is not set +# CONFIG_PACKAGE_openwisp-config-openssl is not set + +# +# zabbix +# +# CONFIG_PACKAGE_zabbix-agentd is not set +# CONFIG_PACKAGE_zabbix-extra-mac80211 is not set +# CONFIG_PACKAGE_zabbix-extra-network is not set +# CONFIG_PACKAGE_zabbix-extra-wifi is not set +# CONFIG_PACKAGE_zabbix-get is not set +# CONFIG_PACKAGE_zabbix-proxy is not set +# CONFIG_PACKAGE_zabbix-sender is not set +# CONFIG_PACKAGE_zabbix-server is not set +# CONFIG_PACKAGE_htop is not set +# CONFIG_PACKAGE_ipmitool is not set +# CONFIG_PACKAGE_monit is not set +# CONFIG_PACKAGE_monit-nossl is not set +# CONFIG_PACKAGE_muninlite is not set +# CONFIG_PACKAGE_netdata is not set +# CONFIG_PACKAGE_sudo is not set +# CONFIG_PACKAGE_syslog-ng is not set + +# +# Boot Loaders +# + +# +# Development +# + +# +# Libraries +# +# CONFIG_PACKAGE_ar is not set +# CONFIG_PACKAGE_autoconf is not set +# CONFIG_PACKAGE_automake is not set +# CONFIG_PACKAGE_binutils is not set +# CONFIG_PACKAGE_diffutils is not set +# CONFIG_PACKAGE_gcc is not set +# CONFIG_PACKAGE_gdb is not set +# CONFIG_PACKAGE_gdbserver is not set +# CONFIG_PACKAGE_libtool-bin is not set +# CONFIG_PACKAGE_lpc21isp is not set +# CONFIG_PACKAGE_lttng-tools is not set +# CONFIG_PACKAGE_m4 is not set +# CONFIG_PACKAGE_make is not set +# CONFIG_PACKAGE_objdump is not set +# CONFIG_PACKAGE_patch is not set +# CONFIG_PACKAGE_perf is not set +# CONFIG_PACKAGE_pkg-config is not set +# CONFIG_PACKAGE_trace-cmd is not set +# CONFIG_PACKAGE_trace-cmd-extra is not set +# CONFIG_PACKAGE_valgrind is not set + +# +# Extra packages +# +# CONFIG_PACKAGE_autosamba is not set +# CONFIG_PACKAGE_he-6in4 is not set +# CONFIG_PACKAGE_k3wifi is not set + +# +# Firmware +# + +# +# ath10k IPQ4019 Boarddata +# +# CONFIG_PACKAGE_aircard-pcmcia-firmware is not set +# CONFIG_PACKAGE_ar3k-firmware is not set +# CONFIG_PACKAGE_ath10k-firmware-qca4019 is not set +# CONFIG_PACKAGE_ath10k-firmware-qca6174 is not set +# CONFIG_PACKAGE_ath10k-firmware-qca9887 is not set +# CONFIG_PACKAGE_ath10k-firmware-qca9887-ct is not set +# CONFIG_PACKAGE_ath10k-firmware-qca9888 is not set +# CONFIG_PACKAGE_ath10k-firmware-qca9888-ct is not set +# CONFIG_PACKAGE_ath10k-firmware-qca988x is not set +# CONFIG_PACKAGE_ath10k-firmware-qca988x-ct is not set +# CONFIG_PACKAGE_ath10k-firmware-qca9984 is not set +# CONFIG_PACKAGE_ath10k-firmware-qca9984-ct is not set +# CONFIG_PACKAGE_ath10k-firmware-qca99x0 is not set +# CONFIG_PACKAGE_ath10k-firmware-qca99x0-ct is not set +# CONFIG_PACKAGE_ath6k-firmware is not set +# CONFIG_PACKAGE_ath9k-htc-firmware is not set +# CONFIG_PACKAGE_b43legacy-firmware is not set +# CONFIG_PACKAGE_bnx2-firmware is not set +# CONFIG_PACKAGE_brcmfmac-firmware-4329-sdio is not set +# CONFIG_PACKAGE_brcmfmac-firmware-43362-sdio is not set +# CONFIG_PACKAGE_brcmfmac-firmware-43430-sdio is not set +# CONFIG_PACKAGE_brcmfmac-firmware-43602a1-pcie is not set +# CONFIG_PACKAGE_brcmfmac-firmware-4366b1-pcie is not set +# CONFIG_PACKAGE_brcmfmac-firmware-usb is not set +# CONFIG_PACKAGE_brcmsmac-firmware is not set +# CONFIG_PACKAGE_carl9170-firmware is not set +# CONFIG_PACKAGE_e100-firmware is not set +# CONFIG_PACKAGE_edgeport-firmware is not set +# CONFIG_PACKAGE_ibt-firmware is not set +# CONFIG_PACKAGE_iwl3945-firmware is not set +# CONFIG_PACKAGE_iwl4965-firmware is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl100 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl1000 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl105 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl135 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl2000 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl2030 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl3160 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl3168 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl5000 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl5150 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl6000g2 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl6000g2a is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl6000g2b is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl6050 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl7260 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl7265 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl7265d is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl8260c is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl8265 is not set +# CONFIG_PACKAGE_libertas-sdio-firmware is not set +# CONFIG_PACKAGE_libertas-spi-firmware is not set +# CONFIG_PACKAGE_libertas-usb-firmware is not set +# CONFIG_PACKAGE_mt7601u-firmware is not set +# CONFIG_PACKAGE_mwifiex-pcie-firmware is not set +# CONFIG_PACKAGE_mwifiex-sdio-firmware is not set +# CONFIG_PACKAGE_mwl8k-firmware is not set +# CONFIG_PACKAGE_p54-pci-firmware is not set +# CONFIG_PACKAGE_p54-spi-firmware is not set +# CONFIG_PACKAGE_p54-usb-firmware is not set +# CONFIG_PACKAGE_prism54-firmware is not set +# CONFIG_PACKAGE_r8169-firmware is not set +# CONFIG_PACKAGE_rt2800-pci-firmware is not set +# CONFIG_PACKAGE_rt2800-usb-firmware is not set +# CONFIG_PACKAGE_rt61-pci-firmware is not set +# CONFIG_PACKAGE_rt73-usb-firmware is not set +# CONFIG_PACKAGE_rtl8188eu-firmware is not set +# CONFIG_PACKAGE_rtl8192ce-firmware is not set +# CONFIG_PACKAGE_rtl8192cu-firmware is not set +# CONFIG_PACKAGE_rtl8192de-firmware is not set +# CONFIG_PACKAGE_rtl8192se-firmware is not set +# CONFIG_PACKAGE_rtl8192su-firmware is not set +# CONFIG_PACKAGE_rtl8821ae-firmware is not set +CONFIG_PACKAGE_wireless-regdb=y +# CONFIG_PACKAGE_wl12xx-firmware is not set +# CONFIG_PACKAGE_wl18xx-firmware is not set + +# +# Fonts +# + +# +# DejaVu +# +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuMathTeXGyre is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSans is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSans-Bold is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSans-BoldOblique is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSans-ExtraLight is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSans-Oblique is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSansCondensed is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSansCondensed-Bold is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSansCondensed-BoldOblique is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSansCondensed-Oblique is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSansMono is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSansMono-Bold is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSansMono-BoldOblique is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSansMono-Oblique is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSerif is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSerif-Bold is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSerif-BoldItalic is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSerif-Italic is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSerifCondensed is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSerifCondensed-Bold is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSerifCondensed-BoldItalic is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSerifCondensed-Italic is not set + +# +# Kernel modules +# + +# +# Block Devices +# +# CONFIG_PACKAGE_kmod-aoe is not set +# CONFIG_PACKAGE_kmod-ata-core is not set +# CONFIG_PACKAGE_kmod-block2mtd is not set +# CONFIG_PACKAGE_kmod-dm is not set +# CONFIG_PACKAGE_kmod-loop is not set +# CONFIG_PACKAGE_kmod-md-mod is not set +# CONFIG_PACKAGE_kmod-nbd is not set +# CONFIG_PACKAGE_kmod-scsi-cdrom is not set +# CONFIG_PACKAGE_kmod-scsi-core is not set +# CONFIG_PACKAGE_kmod-scsi-generic is not set +# CONFIG_PACKAGE_kmod-scsi-tape is not set + +# +# CAN Support +# +# CONFIG_PACKAGE_kmod-can is not set + +# +# Cryptographic API modules +# +# CONFIG_PACKAGE_kmod-crypto-aead is not set +# CONFIG_PACKAGE_kmod-crypto-authenc is not set +# CONFIG_PACKAGE_kmod-crypto-cbc is not set +# CONFIG_PACKAGE_kmod-crypto-ccm is not set +# CONFIG_PACKAGE_kmod-crypto-cmac is not set +# CONFIG_PACKAGE_kmod-crypto-crc32c is not set +# CONFIG_PACKAGE_kmod-crypto-ctr is not set +# CONFIG_PACKAGE_kmod-crypto-cts is not set +# CONFIG_PACKAGE_kmod-crypto-deflate is not set +# CONFIG_PACKAGE_kmod-crypto-des is not set +# CONFIG_PACKAGE_kmod-crypto-ecb is not set +# CONFIG_PACKAGE_kmod-crypto-echainiv is not set +# CONFIG_PACKAGE_kmod-crypto-fcrypt is not set +# CONFIG_PACKAGE_kmod-crypto-gcm is not set +# CONFIG_PACKAGE_kmod-crypto-gf128 is not set +# CONFIG_PACKAGE_kmod-crypto-ghash is not set +# CONFIG_PACKAGE_kmod-crypto-hash is not set +# CONFIG_PACKAGE_kmod-crypto-hmac is not set +# CONFIG_PACKAGE_kmod-crypto-hw-ccp is not set +# CONFIG_PACKAGE_kmod-crypto-hw-geode is not set +# CONFIG_PACKAGE_kmod-crypto-hw-hifn-795x is not set +# CONFIG_PACKAGE_kmod-crypto-hw-padlock is not set +# CONFIG_PACKAGE_kmod-crypto-hw-talitos is not set +# CONFIG_PACKAGE_kmod-crypto-manager is not set +# CONFIG_PACKAGE_kmod-crypto-md4 is not set +# CONFIG_PACKAGE_kmod-crypto-md5 is not set +# CONFIG_PACKAGE_kmod-crypto-michael-mic is not set +# CONFIG_PACKAGE_kmod-crypto-misc is not set +# CONFIG_PACKAGE_kmod-crypto-null is not set +# CONFIG_PACKAGE_kmod-crypto-pcbc is not set +# CONFIG_PACKAGE_kmod-crypto-pcompress is not set +# CONFIG_PACKAGE_kmod-crypto-rng is not set +# CONFIG_PACKAGE_kmod-crypto-seqiv is not set +# CONFIG_PACKAGE_kmod-crypto-sha1 is not set +# CONFIG_PACKAGE_kmod-crypto-sha256 is not set +# CONFIG_PACKAGE_kmod-crypto-sha512 is not set +# CONFIG_PACKAGE_kmod-crypto-test is not set +# CONFIG_PACKAGE_kmod-crypto-user is not set +# CONFIG_PACKAGE_kmod-crypto-wq is not set +# CONFIG_PACKAGE_kmod-crypto-xts is not set +# CONFIG_PACKAGE_kmod-cryptodev is not set + +# +# Filesystems +# +# CONFIG_PACKAGE_kmod-fs-afs is not set +# CONFIG_PACKAGE_kmod-fs-autofs4 is not set +# CONFIG_PACKAGE_kmod-fs-btrfs is not set +# CONFIG_PACKAGE_kmod-fs-cifs is not set +# CONFIG_PACKAGE_kmod-fs-configfs is not set +# CONFIG_PACKAGE_kmod-fs-cramfs is not set +# CONFIG_PACKAGE_kmod-fs-exfat is not set +# CONFIG_PACKAGE_kmod-fs-exportfs is not set +# CONFIG_PACKAGE_kmod-fs-ext4 is not set +# CONFIG_PACKAGE_kmod-fs-f2fs is not set +# CONFIG_PACKAGE_kmod-fs-fscache is not set +# CONFIG_PACKAGE_kmod-fs-hfs is not set +# CONFIG_PACKAGE_kmod-fs-hfsplus is not set +# CONFIG_PACKAGE_kmod-fs-isofs is not set +# CONFIG_PACKAGE_kmod-fs-jfs is not set +# CONFIG_PACKAGE_kmod-fs-minix is not set +# CONFIG_PACKAGE_kmod-fs-msdos is not set +# CONFIG_PACKAGE_kmod-fs-nfs is not set +# CONFIG_PACKAGE_kmod-fs-nfs-common is not set +# CONFIG_PACKAGE_kmod-fs-nfs-common-rpcsec is not set +# CONFIG_PACKAGE_kmod-fs-nfs-v3 is not set +# CONFIG_PACKAGE_kmod-fs-nfs-v4 is not set +# CONFIG_PACKAGE_kmod-fs-nfsd is not set +# CONFIG_PACKAGE_kmod-fs-ntfs is not set +# CONFIG_PACKAGE_kmod-fs-reiserfs is not set +# CONFIG_PACKAGE_kmod-fs-squashfs is not set +# CONFIG_PACKAGE_kmod-fs-udf is not set +# CONFIG_PACKAGE_kmod-fs-vfat is not set +# CONFIG_PACKAGE_kmod-fs-xfs is not set +# CONFIG_PACKAGE_kmod-fuse is not set + +# +# FireWire support +# +# CONFIG_PACKAGE_kmod-firewire is not set + +# +# Hardware Monitoring Support +# +# CONFIG_PACKAGE_kmod-hwmon-core is not set + +# +# I2C support +# +# CONFIG_PACKAGE_kmod-i2c-core is not set +# CONFIG_PACKAGE_kmod-i2c-gpio-custom is not set + +# +# Industrial I/O Modules +# +# CONFIG_PACKAGE_kmod-iio-ad799x is not set +# CONFIG_PACKAGE_kmod-iio-core is not set +# CONFIG_PACKAGE_kmod-iio-dht11 is not set + +# +# Input modules +# +# CONFIG_PACKAGE_kmod-hid is not set +# CONFIG_PACKAGE_kmod-hid-generic is not set +# CONFIG_PACKAGE_kmod-input-core is not set +# CONFIG_PACKAGE_kmod-input-evdev is not set +# CONFIG_PACKAGE_kmod-input-gpio-encoder is not set +# CONFIG_PACKAGE_kmod-input-gpio-keys is not set +# CONFIG_PACKAGE_kmod-input-gpio-keys-polled is not set +# CONFIG_PACKAGE_kmod-input-joydev is not set +# CONFIG_PACKAGE_kmod-input-matrixkmap is not set +# CONFIG_PACKAGE_kmod-input-polldev is not set +# CONFIG_PACKAGE_kmod-input-uinput is not set + +# +# LED modules +# +# CONFIG_PACKAGE_kmod-leds-gpio is not set +# CONFIG_PACKAGE_kmod-leds-nu801 is not set +# CONFIG_PACKAGE_kmod-leds-pca963x is not set +# CONFIG_PACKAGE_kmod-leds-rb750 is not set +# CONFIG_PACKAGE_kmod-leds-wndr3700-usb is not set +# CONFIG_PACKAGE_kmod-ledtrig-default-on is not set +# CONFIG_PACKAGE_kmod-ledtrig-gpio is not set +# CONFIG_PACKAGE_kmod-ledtrig-heartbeat is not set +# CONFIG_PACKAGE_kmod-ledtrig-netdev is not set +# CONFIG_PACKAGE_kmod-ledtrig-oneshot is not set +# CONFIG_PACKAGE_kmod-ledtrig-timer is not set +# CONFIG_PACKAGE_kmod-ledtrig-transient is not set + +# +# Libraries +# +# CONFIG_PACKAGE_kmod-lib-cordic is not set +CONFIG_PACKAGE_kmod-lib-crc-ccitt=y +# CONFIG_PACKAGE_kmod-lib-crc-itu-t is not set +# CONFIG_PACKAGE_kmod-lib-crc16 is not set +# CONFIG_PACKAGE_kmod-lib-crc32c is not set +# CONFIG_PACKAGE_kmod-lib-crc7 is not set +# CONFIG_PACKAGE_kmod-lib-crc8 is not set +# CONFIG_PACKAGE_kmod-lib-textsearch is not set + +# +# Native Language Support +# +CONFIG_PACKAGE_kmod-nls-base=y +# CONFIG_PACKAGE_kmod-nls-cp1250 is not set +# CONFIG_PACKAGE_kmod-nls-cp1251 is not set +# CONFIG_PACKAGE_kmod-nls-cp437 is not set +# CONFIG_PACKAGE_kmod-nls-cp775 is not set +# CONFIG_PACKAGE_kmod-nls-cp850 is not set +# CONFIG_PACKAGE_kmod-nls-cp852 is not set +# CONFIG_PACKAGE_kmod-nls-cp862 is not set +# CONFIG_PACKAGE_kmod-nls-cp864 is not set +# CONFIG_PACKAGE_kmod-nls-cp866 is not set +# CONFIG_PACKAGE_kmod-nls-cp932 is not set +# CONFIG_PACKAGE_kmod-nls-cp936 is not set +# CONFIG_PACKAGE_kmod-nls-cp950 is not set +# CONFIG_PACKAGE_kmod-nls-iso8859-1 is not set +# CONFIG_PACKAGE_kmod-nls-iso8859-13 is not set +# CONFIG_PACKAGE_kmod-nls-iso8859-15 is not set +# CONFIG_PACKAGE_kmod-nls-iso8859-2 is not set +# CONFIG_PACKAGE_kmod-nls-iso8859-6 is not set +# CONFIG_PACKAGE_kmod-nls-iso8859-8 is not set +# CONFIG_PACKAGE_kmod-nls-koi8r is not set +# CONFIG_PACKAGE_kmod-nls-utf8 is not set + +# +# Netfilter Extensions +# +# CONFIG_PACKAGE_kmod-arptables is not set +# CONFIG_PACKAGE_kmod-ebtables is not set +# CONFIG_PACKAGE_kmod-ip6tables is not set +# CONFIG_PACKAGE_kmod-ip6tables-extra is not set +# CONFIG_PACKAGE_kmod-ipt-account is not set +# CONFIG_PACKAGE_kmod-ipt-chaos is not set +# CONFIG_PACKAGE_kmod-ipt-checksum is not set +# CONFIG_PACKAGE_kmod-ipt-cluster is not set +# CONFIG_PACKAGE_kmod-ipt-clusterip is not set +# CONFIG_PACKAGE_kmod-ipt-compat-xtables is not set +# CONFIG_PACKAGE_kmod-ipt-condition is not set +CONFIG_PACKAGE_kmod-ipt-conntrack=y +# CONFIG_PACKAGE_kmod-ipt-conntrack-extra is not set +CONFIG_PACKAGE_kmod-ipt-core=y +# CONFIG_PACKAGE_kmod-ipt-debug is not set +# CONFIG_PACKAGE_kmod-ipt-delude is not set +# CONFIG_PACKAGE_kmod-ipt-dhcpmac is not set +# CONFIG_PACKAGE_kmod-ipt-dnetmap is not set +# CONFIG_PACKAGE_kmod-ipt-extra is not set +# CONFIG_PACKAGE_kmod-ipt-filter is not set +# CONFIG_PACKAGE_kmod-ipt-fuzzy is not set +# CONFIG_PACKAGE_kmod-ipt-geoip is not set +# CONFIG_PACKAGE_kmod-ipt-hashlimit is not set +# CONFIG_PACKAGE_kmod-ipt-iface is not set +# CONFIG_PACKAGE_kmod-ipt-ipmark is not set +# CONFIG_PACKAGE_kmod-ipt-ipopt is not set +# CONFIG_PACKAGE_kmod-ipt-ipp2p is not set +# CONFIG_PACKAGE_kmod-ipt-iprange is not set +# CONFIG_PACKAGE_kmod-ipt-ipsec is not set +CONFIG_PACKAGE_kmod-ipt-ipset=y +# CONFIG_PACKAGE_kmod-ipt-ipv4options is not set +# CONFIG_PACKAGE_kmod-ipt-led is not set +# CONFIG_PACKAGE_kmod-ipt-length2 is not set +# CONFIG_PACKAGE_kmod-ipt-logmark is not set +# CONFIG_PACKAGE_kmod-ipt-lscan is not set +# CONFIG_PACKAGE_kmod-ipt-lua is not set +CONFIG_PACKAGE_kmod-ipt-nat=y +# CONFIG_PACKAGE_kmod-ipt-nat-extra is not set +# CONFIG_PACKAGE_kmod-ipt-nat6 is not set +# CONFIG_PACKAGE_kmod-ipt-nathelper-rtsp is not set +# CONFIG_PACKAGE_kmod-ipt-nflog is not set +# CONFIG_PACKAGE_kmod-ipt-nfqueue is not set +# CONFIG_PACKAGE_kmod-ipt-psd is not set +# CONFIG_PACKAGE_kmod-ipt-quota2 is not set +# CONFIG_PACKAGE_kmod-ipt-raw is not set +# CONFIG_PACKAGE_kmod-ipt-raw6 is not set +# CONFIG_PACKAGE_kmod-ipt-rpfilter is not set +# CONFIG_PACKAGE_kmod-ipt-sysrq is not set +# CONFIG_PACKAGE_kmod-ipt-tarpit is not set +# CONFIG_PACKAGE_kmod-ipt-tee is not set +# CONFIG_PACKAGE_kmod-ipt-tproxy is not set +# CONFIG_PACKAGE_kmod-ipt-u32 is not set +# CONFIG_PACKAGE_kmod-ipt-ulog is not set +CONFIG_PACKAGE_kmod-nf-conntrack=y +# CONFIG_PACKAGE_kmod-nf-conntrack-netlink is not set +CONFIG_PACKAGE_kmod-nf-conntrack6=y +CONFIG_PACKAGE_kmod-nf-ipt=y +CONFIG_PACKAGE_kmod-nf-ipt6=y +CONFIG_PACKAGE_kmod-nf-nat=y +# CONFIG_PACKAGE_kmod-nf-nat6 is not set +# CONFIG_PACKAGE_kmod-nf-nathelper is not set +# CONFIG_PACKAGE_kmod-nf-nathelper-extra is not set +CONFIG_PACKAGE_kmod-nfnetlink=y +# CONFIG_PACKAGE_kmod-nfnetlink-log is not set +# CONFIG_PACKAGE_kmod-nfnetlink-queue is not set +# CONFIG_PACKAGE_kmod-nft-core is not set +# CONFIG_PACKAGE_kmod-nft-nat is not set +# CONFIG_PACKAGE_kmod-nft-nat6 is not set + +# +# Network Devices +# +# CONFIG_PACKAGE_kmod-3c59x is not set +# CONFIG_PACKAGE_kmod-8139cp is not set +# CONFIG_PACKAGE_kmod-8139too is not set +# CONFIG_PACKAGE_kmod-atl1 is not set +# CONFIG_PACKAGE_kmod-atl1c is not set +# CONFIG_PACKAGE_kmod-atl1e is not set +# CONFIG_PACKAGE_kmod-atl2 is not set +# CONFIG_PACKAGE_kmod-b44 is not set +# CONFIG_PACKAGE_kmod-bnx2 is not set +# CONFIG_PACKAGE_kmod-dm9000 is not set +# CONFIG_PACKAGE_kmod-dummy is not set +# CONFIG_PACKAGE_kmod-e100 is not set +# CONFIG_PACKAGE_kmod-e1000 is not set +# CONFIG_PACKAGE_kmod-et131x is not set +# CONFIG_PACKAGE_kmod-ethoc is not set +# CONFIG_PACKAGE_kmod-forcedeth is not set +# CONFIG_PACKAGE_kmod-gigaset is not set +# CONFIG_PACKAGE_kmod-hfcmulti is not set +# CONFIG_PACKAGE_kmod-hfcpci is not set +# CONFIG_PACKAGE_kmod-ifb is not set +# CONFIG_PACKAGE_kmod-igb is not set +# CONFIG_PACKAGE_kmod-ixgbe is not set +# CONFIG_PACKAGE_kmod-ixgbevf is not set +# CONFIG_PACKAGE_kmod-libphy is not set +# CONFIG_PACKAGE_kmod-macvlan is not set +# CONFIG_PACKAGE_kmod-mii is not set +# CONFIG_PACKAGE_kmod-natsemi is not set +# CONFIG_PACKAGE_kmod-ne2k-pci is not set +# CONFIG_PACKAGE_kmod-niu is not set +# CONFIG_PACKAGE_kmod-of-mdio is not set +# CONFIG_PACKAGE_kmod-pcnet32 is not set +# CONFIG_PACKAGE_kmod-phy-broadcom is not set +# CONFIG_PACKAGE_kmod-r6040 is not set +# CONFIG_PACKAGE_kmod-r8169 is not set +# CONFIG_PACKAGE_kmod-siit is not set +# CONFIG_PACKAGE_kmod-sis190 is not set +# CONFIG_PACKAGE_kmod-sis900 is not set +# CONFIG_PACKAGE_kmod-skge is not set +# CONFIG_PACKAGE_kmod-sky2 is not set +# CONFIG_PACKAGE_kmod-solos-pci is not set +# CONFIG_PACKAGE_kmod-spi-ks8995 is not set +# CONFIG_PACKAGE_kmod-swconfig is not set +# CONFIG_PACKAGE_kmod-switch-ip17xx is not set +# CONFIG_PACKAGE_kmod-switch-mvsw61xx is not set +# CONFIG_PACKAGE_kmod-switch-rtl8366-smi is not set +# CONFIG_PACKAGE_kmod-switch-rtl8366rb is not set +# CONFIG_PACKAGE_kmod-switch-rtl8366s is not set +# CONFIG_PACKAGE_kmod-switch-rtl8367b is not set +# CONFIG_PACKAGE_kmod-tg3 is not set +# CONFIG_PACKAGE_kmod-tulip is not set +# CONFIG_PACKAGE_kmod-via-rhine is not set +# CONFIG_PACKAGE_kmod-via-velocity is not set +# CONFIG_PACKAGE_kmod-vmxnet3 is not set + +# +# Network Support +# +# CONFIG_PACKAGE_kmod-appletalk is not set +# CONFIG_PACKAGE_kmod-atm is not set +# CONFIG_PACKAGE_kmod-ax25 is not set +# CONFIG_PACKAGE_kmod-batman-adv is not set +# CONFIG_PACKAGE_kmod-bonding is not set +# CONFIG_PACKAGE_kmod-capi is not set +# CONFIG_PACKAGE_kmod-dnsresolver is not set +# CONFIG_PACKAGE_kmod-fast-classifier is not set +# CONFIG_PACKAGE_kmod-gre is not set +# CONFIG_PACKAGE_kmod-gre6 is not set +# CONFIG_PACKAGE_kmod-ip6-tunnel is not set +# CONFIG_PACKAGE_kmod-ipip is not set +# CONFIG_PACKAGE_kmod-ipsec is not set +# CONFIG_PACKAGE_kmod-iptunnel6 is not set +# CONFIG_PACKAGE_kmod-isdn4linux is not set +# CONFIG_PACKAGE_kmod-jool is not set +# CONFIG_PACKAGE_kmod-l2tp is not set +# CONFIG_PACKAGE_kmod-l2tp-eth is not set +# CONFIG_PACKAGE_kmod-l2tp-ip is not set +# CONFIG_PACKAGE_kmod-misdn is not set +# CONFIG_PACKAGE_kmod-mpls is not set +CONFIG_PACKAGE_kmod-ppp=y +# CONFIG_PACKAGE_kmod-mppe is not set +# CONFIG_PACKAGE_kmod-nat46 is not set +# CONFIG_PACKAGE_kmod-netem is not set +# CONFIG_PACKAGE_kmod-nlmon is not set +# CONFIG_PACKAGE_kmod-openvswitch is not set +# CONFIG_PACKAGE_kmod-pktgen is not set +# CONFIG_PACKAGE_kmod-ppp-synctty is not set +# CONFIG_PACKAGE_kmod-pppoa is not set +CONFIG_PACKAGE_kmod-pppoe=y +# CONFIG_PACKAGE_kmod-pppol2tp is not set +CONFIG_PACKAGE_kmod-pppox=y +# CONFIG_PACKAGE_kmod-pptp is not set +# CONFIG_PACKAGE_kmod-sched is not set +# CONFIG_PACKAGE_kmod-sched-cake is not set +# CONFIG_PACKAGE_kmod-sched-connmark is not set +# CONFIG_PACKAGE_kmod-sched-core is not set +# CONFIG_PACKAGE_kmod-sctp is not set +# CONFIG_PACKAGE_kmod-shortcut-fe is not set +# CONFIG_PACKAGE_kmod-shortcut-fe-cm is not set +# CONFIG_PACKAGE_kmod-sit is not set +CONFIG_PACKAGE_kmod-slhc=y +# CONFIG_PACKAGE_kmod-slip is not set +# CONFIG_PACKAGE_kmod-trelay is not set +# CONFIG_PACKAGE_kmod-tun is not set +# CONFIG_PACKAGE_kmod-veth is not set +# CONFIG_PACKAGE_kmod-vxlan is not set +# CONFIG_PACKAGE_kmod-wireguard is not set + +# +# Other modules +# +# CONFIG_PACKAGE_kmod-6lowpan is not set +# CONFIG_PACKAGE_kmod-ath3k is not set +# CONFIG_PACKAGE_kmod-bcma is not set +# CONFIG_PACKAGE_kmod-bluetooth is not set +# CONFIG_PACKAGE_kmod-bluetooth_6lowpan is not set +# CONFIG_PACKAGE_kmod-bmp085 is not set +# CONFIG_PACKAGE_kmod-bmp085-i2c is not set +# CONFIG_PACKAGE_kmod-bmp085-spi is not set +# CONFIG_PACKAGE_kmod-btmrvl is not set +# CONFIG_PACKAGE_kmod-button-hotplug is not set +# CONFIG_PACKAGE_kmod-echo is not set +# CONFIG_PACKAGE_kmod-eeprom-93cx6 is not set +# CONFIG_PACKAGE_kmod-eeprom-at24 is not set +# CONFIG_PACKAGE_kmod-eeprom-at25 is not set +# CONFIG_PACKAGE_kmod-gpio-beeper is not set +CONFIG_PACKAGE_kmod-gpio-button-hotplug=y +# CONFIG_PACKAGE_kmod-gpio-dev is not set +# CONFIG_PACKAGE_kmod-gpio-mcp23s08 is not set +# CONFIG_PACKAGE_kmod-gpio-nxp-74hc164 is not set +# CONFIG_PACKAGE_kmod-gpio-pca953x is not set +# CONFIG_PACKAGE_kmod-gpio-pcf857x is not set +# CONFIG_PACKAGE_kmod-ikconfig is not set +# CONFIG_PACKAGE_kmod-it87-wdt is not set +# CONFIG_PACKAGE_kmod-itco-wdt is not set +# CONFIG_PACKAGE_kmod-lp is not set +# CONFIG_PACKAGE_kmod-mmc is not set +# CONFIG_PACKAGE_kmod-mtd-rw is not set +# CONFIG_PACKAGE_kmod-mtdoops is not set +# CONFIG_PACKAGE_kmod-mtdtests is not set +# CONFIG_PACKAGE_kmod-pps is not set +# CONFIG_PACKAGE_kmod-pps-gpio is not set +# CONFIG_PACKAGE_kmod-pps-ldisc is not set +# CONFIG_PACKAGE_kmod-ptp is not set +# CONFIG_PACKAGE_kmod-random-core is not set +# CONFIG_PACKAGE_kmod-regmap is not set +# CONFIG_PACKAGE_kmod-rotary-gpio-custom is not set +# CONFIG_PACKAGE_kmod-rtc-ds1307 is not set +# CONFIG_PACKAGE_kmod-rtc-ds1374 is not set +# CONFIG_PACKAGE_kmod-rtc-ds1672 is not set +# CONFIG_PACKAGE_kmod-rtc-isl1208 is not set +# CONFIG_PACKAGE_kmod-rtc-pcf2123 is not set +# CONFIG_PACKAGE_kmod-rtc-pcf8563 is not set +# CONFIG_PACKAGE_kmod-rtc-pt7c4338 is not set +# CONFIG_PACKAGE_kmod-rtc-rs5c372a is not set +# CONFIG_PACKAGE_kmod-sdhci is not set +# CONFIG_PACKAGE_kmod-serial-8250 is not set +# CONFIG_PACKAGE_kmod-softdog is not set +# CONFIG_PACKAGE_kmod-ssb is not set +# CONFIG_PACKAGE_kmod-tpm is not set +# CONFIG_PACKAGE_kmod-tpm-i2c-atmel is not set +# CONFIG_PACKAGE_kmod-tpm-i2c-infineon is not set +# CONFIG_PACKAGE_kmod-w83627hf-wdt is not set +# CONFIG_PACKAGE_kmod-zram is not set + +# +# PCMCIA support +# + +# +# SPI Support +# +# CONFIG_PACKAGE_kmod-mmc-spi is not set +# CONFIG_PACKAGE_kmod-spi-bitbang is not set +# CONFIG_PACKAGE_kmod-spi-dev is not set +# CONFIG_PACKAGE_kmod-spi-gpio is not set +# CONFIG_PACKAGE_kmod-spi-gpio-custom is not set +# CONFIG_PACKAGE_kmod-spi-gpio-old is not set +# CONFIG_PACKAGE_kmod-spi-vsc7385 is not set + +# +# Sound Support +# +# CONFIG_PACKAGE_kmod-sound-core is not set + +# +# USB Support +# +# CONFIG_PACKAGE_kmod-usb-acm is not set +# CONFIG_PACKAGE_kmod-usb-atm is not set +# CONFIG_PACKAGE_kmod-usb-chipidea is not set +# CONFIG_PACKAGE_kmod-usb-cm109 is not set +CONFIG_PACKAGE_kmod-usb-core=y +# CONFIG_PACKAGE_kmod-usb-dwc2 is not set +# CONFIG_PACKAGE_kmod-usb-dwc3 is not set +# CONFIG_PACKAGE_kmod-usb-dwc3-of-simple is not set +CONFIG_PACKAGE_kmod-usb-ehci=y +# CONFIG_PACKAGE_kmod-usb-gadget-ehci-debug is not set +# CONFIG_PACKAGE_kmod-usb-gadget-eth is not set +# CONFIG_PACKAGE_kmod-usb-gadget-mass-storage is not set +# CONFIG_PACKAGE_kmod-usb-gadget-serial is not set +# CONFIG_PACKAGE_kmod-usb-hid is not set +# CONFIG_PACKAGE_kmod-usb-ledtrig-usbport is not set +# CONFIG_PACKAGE_kmod-usb-net is not set +# CONFIG_PACKAGE_kmod-usb-net2280 is not set +# CONFIG_PACKAGE_kmod-usb-ohci is not set +# CONFIG_PACKAGE_kmod-usb-ohci-pci is not set +# CONFIG_PACKAGE_kmod-usb-phy-qcom-ipq4019 is not set +# CONFIG_PACKAGE_kmod-usb-printer is not set +# CONFIG_PACKAGE_kmod-usb-serial is not set +# CONFIG_PACKAGE_kmod-usb-storage is not set +# CONFIG_PACKAGE_kmod-usb-storage-extras is not set +# CONFIG_PACKAGE_kmod-usb-storage-uas is not set +# CONFIG_PACKAGE_kmod-usb-uhci is not set +# CONFIG_PACKAGE_kmod-usb-wdm is not set +# CONFIG_PACKAGE_kmod-usb-yealink is not set +CONFIG_PACKAGE_kmod-usb2=y +# CONFIG_PACKAGE_kmod-usb2-pci is not set +# CONFIG_PACKAGE_kmod-usb3 is not set +# CONFIG_PACKAGE_kmod-usbip is not set +# CONFIG_PACKAGE_kmod-usbip-client is not set +# CONFIG_PACKAGE_kmod-usbip-server is not set +# CONFIG_PACKAGE_kmod-usbmon is not set + +# +# Video Support +# +# CONFIG_PACKAGE_kmod-video-core is not set + +# +# Virtualization +# + +# +# Voice over IP +# +# CONFIG_PACKAGE_kmod-dahdi is not set + +# +# W1 support +# +# CONFIG_PACKAGE_kmod-w1 is not set + +# +# WPAN 802.15.4 Support +# +# CONFIG_PACKAGE_kmod-at86rf230 is not set +# CONFIG_PACKAGE_kmod-cc2520 is not set +# CONFIG_PACKAGE_kmod-fakelb is not set +# CONFIG_PACKAGE_kmod-ieee802154 is not set +# CONFIG_PACKAGE_kmod-ieee802154_6lowpan is not set +# CONFIG_PACKAGE_kmod-mac802154 is not set +# CONFIG_PACKAGE_kmod-mrf24j40 is not set + +# +# Wireless Drivers +# +# CONFIG_PACKAGE_kmod-adm8211 is not set +CONFIG_PACKAGE_kmod-ath=y +CONFIG_ATH_USER_REGD=y +# CONFIG_PACKAGE_ATH_DEBUG is not set +CONFIG_PACKAGE_ATH_DFS=y +# CONFIG_PACKAGE_kmod-ath10k is not set +# CONFIG_PACKAGE_kmod-ath10k-ct is not set +# CONFIG_PACKAGE_kmod-ath5k is not set +# CONFIG_PACKAGE_kmod-ath6kl-sdio is not set +# CONFIG_PACKAGE_kmod-ath6kl-usb is not set +CONFIG_PACKAGE_kmod-ath9k=y +# CONFIG_ATH9K_SUPPORT_PCOEM is not set +# CONFIG_ATH9K_TX99 is not set +CONFIG_PACKAGE_kmod-ath9k-common=y +# CONFIG_PACKAGE_kmod-ath9k-htc is not set +# CONFIG_PACKAGE_kmod-b43 is not set +# CONFIG_PACKAGE_kmod-b43legacy is not set +# CONFIG_PACKAGE_kmod-brcmfmac is not set +# CONFIG_PACKAGE_kmod-brcmsmac is not set +# CONFIG_PACKAGE_kmod-brcmutil is not set +# CONFIG_PACKAGE_kmod-carl9170 is not set +CONFIG_PACKAGE_kmod-cfg80211=y +# CONFIG_PACKAGE_kmod-hermes is not set +# CONFIG_PACKAGE_kmod-hermes-pci is not set +# CONFIG_PACKAGE_kmod-hermes-plx is not set +# CONFIG_PACKAGE_kmod-iwl-legacy is not set +# CONFIG_PACKAGE_kmod-iwl3945 is not set +# CONFIG_PACKAGE_kmod-iwl4965 is not set +# CONFIG_PACKAGE_kmod-iwlwifi is not set +# CONFIG_PACKAGE_kmod-lib80211 is not set +# CONFIG_PACKAGE_kmod-libertas-sdio is not set +# CONFIG_PACKAGE_kmod-libertas-spi is not set +# CONFIG_PACKAGE_kmod-libertas-usb is not set +CONFIG_PACKAGE_kmod-mac80211=y +CONFIG_PACKAGE_MAC80211_DEBUGFS=y +# CONFIG_PACKAGE_MAC80211_TRACING is not set +CONFIG_PACKAGE_MAC80211_MESH=y +# CONFIG_PACKAGE_kmod-mac80211-hwsim is not set +# CONFIG_PACKAGE_kmod-mt76 is not set +# CONFIG_PACKAGE_kmod-mt76-core is not set +# CONFIG_PACKAGE_kmod-mt7601u is not set +# CONFIG_PACKAGE_kmod-mt7603 is not set +# CONFIG_PACKAGE_kmod-mt76x2 is not set +# CONFIG_PACKAGE_kmod-mwifiex-pcie is not set +# CONFIG_PACKAGE_kmod-mwifiex-sdio is not set +# CONFIG_PACKAGE_kmod-mwl8k is not set +# CONFIG_PACKAGE_kmod-net-prism54 is not set +# CONFIG_PACKAGE_kmod-net-rtl8192su is not set +# CONFIG_PACKAGE_kmod-owl-loader is not set +# CONFIG_PACKAGE_kmod-p54-common is not set +# CONFIG_PACKAGE_kmod-p54-pci is not set +# CONFIG_PACKAGE_kmod-p54-usb is not set +# CONFIG_PACKAGE_kmod-rt2400-pci is not set +# CONFIG_PACKAGE_kmod-rt2500-pci is not set +# CONFIG_PACKAGE_kmod-rt2500-usb is not set +# CONFIG_PACKAGE_kmod-rt2800-pci is not set +# CONFIG_PACKAGE_kmod-rt2800-usb is not set +# CONFIG_PACKAGE_kmod-rt2x00-lib is not set +# CONFIG_PACKAGE_kmod-rt61-pci is not set +# CONFIG_PACKAGE_kmod-rt73-usb is not set +# CONFIG_PACKAGE_kmod-rtl8180 is not set +# CONFIG_PACKAGE_kmod-rtl8187 is not set +# CONFIG_PACKAGE_kmod-rtl8192ce is not set +# CONFIG_PACKAGE_kmod-rtl8192cu is not set +# CONFIG_PACKAGE_kmod-rtl8192de is not set +# CONFIG_PACKAGE_kmod-rtl8192se is not set +# CONFIG_PACKAGE_kmod-rtl8821ae is not set +# CONFIG_PACKAGE_kmod-rtl8xxxu is not set +# CONFIG_PACKAGE_kmod-wl12xx is not set +# CONFIG_PACKAGE_kmod-wl18xx is not set +# CONFIG_PACKAGE_kmod-wlcore is not set +# CONFIG_PACKAGE_kmod-zd1211rw is not set + +# +# Languages +# + +# +# Erlang +# +# CONFIG_PACKAGE_erlang is not set +# CONFIG_PACKAGE_erlang-asn1 is not set +# CONFIG_PACKAGE_erlang-compiler is not set +# CONFIG_PACKAGE_erlang-crypto is not set +# CONFIG_PACKAGE_erlang-hipe is not set +# CONFIG_PACKAGE_erlang-inets is not set +# CONFIG_PACKAGE_erlang-mnesia is not set +# CONFIG_PACKAGE_erlang-runtime-tools is not set +# CONFIG_PACKAGE_erlang-snmp is not set +# CONFIG_PACKAGE_erlang-ssh is not set +# CONFIG_PACKAGE_erlang-ssl is not set +# CONFIG_PACKAGE_erlang-syntax-tools is not set + +# +# Java +# +# CONFIG_PACKAGE_jamvm is not set + +# +# Lua +# +# CONFIG_PACKAGE_dkjson is not set +# CONFIG_PACKAGE_json4lua is not set +# CONFIG_PACKAGE_ldbus is not set +# CONFIG_PACKAGE_libiwinfo-lua is not set +# CONFIG_PACKAGE_lpeg is not set +# CONFIG_PACKAGE_lsqlite3 is not set +# CONFIG_PACKAGE_lua is not set +# CONFIG_PACKAGE_lua-bencode is not set +# CONFIG_PACKAGE_lua-cjson is not set +# CONFIG_PACKAGE_lua-copas is not set +# CONFIG_PACKAGE_lua-coxpcall is not set +# CONFIG_PACKAGE_lua-lzlib is not set +# CONFIG_PACKAGE_lua-md5 is not set +# CONFIG_PACKAGE_lua-mobdebug is not set +# CONFIG_PACKAGE_lua-mosquitto is not set +# CONFIG_PACKAGE_lua-openssl is not set +# CONFIG_PACKAGE_lua-penlight is not set +# CONFIG_PACKAGE_lua-rings is not set +# CONFIG_PACKAGE_lua-rs232 is not set +# CONFIG_PACKAGE_lua-sha2 is not set +# CONFIG_PACKAGE_lua-wsapi-base is not set +# CONFIG_PACKAGE_lua-wsapi-xavante is not set +# CONFIG_PACKAGE_lua-xavante is not set +# CONFIG_PACKAGE_luabitop is not set +# CONFIG_PACKAGE_luac is not set +# CONFIG_PACKAGE_luaexpat is not set +# CONFIG_PACKAGE_luafilesystem is not set +# CONFIG_PACKAGE_luai2c is not set +# CONFIG_PACKAGE_luajit is not set +# CONFIG_PACKAGE_lualanes is not set +# CONFIG_PACKAGE_luaposix is not set +# CONFIG_PACKAGE_luarocks is not set +# CONFIG_PACKAGE_luasec is not set +# CONFIG_PACKAGE_luasoap is not set +# CONFIG_PACKAGE_luasocket is not set +# CONFIG_PACKAGE_luasql-mysql is not set +# CONFIG_PACKAGE_luasql-pgsql is not set +# CONFIG_PACKAGE_luasql-sqlite3 is not set +# CONFIG_PACKAGE_luci-lib-fs is not set +# CONFIG_PACKAGE_luv is not set +# CONFIG_PACKAGE_lzmq is not set +# CONFIG_PACKAGE_uuid is not set + +# +# Node.js +# +# CONFIG_PACKAGE_node is not set + +# +# Module Selection +# +# CONFIG_NODEJS_ICU is not set +# CONFIG_PACKAGE_node-arduino-firmata is not set +# CONFIG_PACKAGE_node-cylon is not set +# CONFIG_PACKAGE_node-cylon-firmata is not set +# CONFIG_PACKAGE_node-cylon-gpio is not set +# CONFIG_PACKAGE_node-cylon-i2c is not set +# CONFIG_PACKAGE_node-hid is not set +# CONFIG_PACKAGE_node-npm is not set +# CONFIG_PACKAGE_node-serialport is not set + +# +# PHP +# +# CONFIG_PACKAGE_php7 is not set + +# +# Perl +# +# CONFIG_PACKAGE_perl is not set + +# +# Python +# +# CONFIG_PACKAGE_chardet is not set +# CONFIG_PACKAGE_django is not set +# CONFIG_PACKAGE_django-appconf is not set +# CONFIG_PACKAGE_django-compressor is not set +# CONFIG_PACKAGE_django-constance is not set +# CONFIG_PACKAGE_django-jsonfield is not set +# CONFIG_PACKAGE_django-picklefield is not set +# CONFIG_PACKAGE_django-postoffice is not set +# CONFIG_PACKAGE_django-restframework is not set +# CONFIG_PACKAGE_django-statici18n is not set +# CONFIG_PACKAGE_et_xmlfile is not set +# CONFIG_PACKAGE_flup is not set +# CONFIG_PACKAGE_gunicorn is not set +# CONFIG_PACKAGE_jdcal is not set +# CONFIG_PACKAGE_micropython is not set +# CONFIG_PACKAGE_micropython-lib is not set +# CONFIG_PACKAGE_openpyxl is not set +# CONFIG_PACKAGE_pillow is not set +# CONFIG_PACKAGE_python is not set +# CONFIG_PACKAGE_python-asn1crypto is not set +# CONFIG_PACKAGE_python-attrs is not set +# CONFIG_PACKAGE_python-base is not set +# CONFIG_PACKAGE_python-base-src is not set +# CONFIG_PACKAGE_python-cffi is not set +# CONFIG_PACKAGE_python-codecs is not set +# CONFIG_PACKAGE_python-codecs-src is not set +# CONFIG_PACKAGE_python-compiler is not set +# CONFIG_PACKAGE_python-compiler-src is not set +# CONFIG_PACKAGE_python-crcmod is not set +# CONFIG_PACKAGE_python-crypto is not set +# CONFIG_PACKAGE_python-cryptography is not set +# CONFIG_PACKAGE_python-ctypes is not set +# CONFIG_PACKAGE_python-ctypes-src is not set +# CONFIG_PACKAGE_python-curl is not set +# CONFIG_PACKAGE_python-dateutil is not set +# CONFIG_PACKAGE_python-db is not set +# CONFIG_PACKAGE_python-db-src is not set +# CONFIG_PACKAGE_python-decimal is not set +# CONFIG_PACKAGE_python-decimal-src is not set +# CONFIG_PACKAGE_python-dev is not set +# CONFIG_PACKAGE_python-dev-src is not set +# CONFIG_PACKAGE_python-distutils is not set +# CONFIG_PACKAGE_python-distutils-src is not set +# CONFIG_PACKAGE_python-dns is not set +# CONFIG_PACKAGE_python-dpkt is not set +# CONFIG_PACKAGE_python-egenix-mx-base is not set +# CONFIG_PACKAGE_python-email is not set +# CONFIG_PACKAGE_python-email-src is not set +# CONFIG_PACKAGE_python-enum34 is not set +# CONFIG_PACKAGE_python-evdev is not set +# CONFIG_PACKAGE_python-gdbm is not set +# CONFIG_PACKAGE_python-gdbm-src is not set +# CONFIG_PACKAGE_python-gmpy2 is not set +# CONFIG_PACKAGE_python-gnupg is not set +# CONFIG_PACKAGE_python-idna is not set +# CONFIG_PACKAGE_python-ipaddress is not set +# CONFIG_PACKAGE_python-ldap is not set +# CONFIG_PACKAGE_python-lib2to3 is not set +# CONFIG_PACKAGE_python-lib2to3-src is not set +# CONFIG_PACKAGE_python-light is not set + +# +# Configuration +# +# CONFIG_PYTHON_BLUETOOTH_SUPPORT is not set +# CONFIG_PACKAGE_python-light-src is not set +# CONFIG_PACKAGE_python-logging is not set +# CONFIG_PACKAGE_python-logging-src is not set +# CONFIG_PACKAGE_python-lxml is not set +# CONFIG_PACKAGE_python-multiprocessing is not set +# CONFIG_PACKAGE_python-multiprocessing-src is not set +# CONFIG_PACKAGE_python-mysql is not set +# CONFIG_PACKAGE_python-ncurses is not set +# CONFIG_PACKAGE_python-ncurses-src is not set +# CONFIG_PACKAGE_python-openssl is not set +# CONFIG_PACKAGE_python-openssl-src is not set +# CONFIG_PACKAGE_python-parsley is not set +# CONFIG_PACKAGE_python-pcapy is not set +# CONFIG_PACKAGE_python-pip is not set +# CONFIG_PACKAGE_python-pip-conf is not set +# CONFIG_PACKAGE_python-pip-src is not set +# CONFIG_PACKAGE_python-ply is not set +# CONFIG_PACKAGE_python-psycopg2 is not set +# CONFIG_PACKAGE_python-pyasn1 is not set +# CONFIG_PACKAGE_python-pyasn1-modules is not set +# CONFIG_PACKAGE_python-pycparser is not set +# CONFIG_PACKAGE_python-pydoc is not set +# CONFIG_PACKAGE_python-pydoc-src is not set +# CONFIG_PACKAGE_python-pyodbc is not set +# CONFIG_PACKAGE_python-pyopenssl is not set +# CONFIG_PACKAGE_python-pyptlib is not set +# CONFIG_PACKAGE_python-pyserial is not set +# CONFIG_PACKAGE_python-service-identity is not set +# CONFIG_PACKAGE_python-setuptools is not set +# CONFIG_PACKAGE_python-setuptools-src is not set +# CONFIG_PACKAGE_python-six is not set +# CONFIG_PACKAGE_python-smbus is not set +# CONFIG_PACKAGE_python-sqlite3 is not set +# CONFIG_PACKAGE_python-sqlite3-src is not set +# CONFIG_PACKAGE_python-src is not set +# CONFIG_PACKAGE_python-txsocksx is not set +# CONFIG_PACKAGE_python-unittest is not set +# CONFIG_PACKAGE_python-unittest-src is not set +# CONFIG_PACKAGE_python-urllib3 is not set +# CONFIG_PACKAGE_python-xml is not set +# CONFIG_PACKAGE_python-xml-src is not set +# CONFIG_PACKAGE_python-yaml is not set +# CONFIG_PACKAGE_python3 is not set +# CONFIG_PACKAGE_python3-asn1crypto is not set +# CONFIG_PACKAGE_python3-asyncio is not set +# CONFIG_PACKAGE_python3-asyncio-src is not set +# CONFIG_PACKAGE_python3-base is not set +# CONFIG_PACKAGE_python3-base-src is not set +# CONFIG_PACKAGE_python3-bottle is not set +# CONFIG_PACKAGE_python3-cffi is not set +# CONFIG_PACKAGE_python3-cgi is not set +# CONFIG_PACKAGE_python3-cgi-src is not set +# CONFIG_PACKAGE_python3-cgitb is not set +# CONFIG_PACKAGE_python3-cgitb-src is not set +# CONFIG_PACKAGE_python3-click is not set +# CONFIG_PACKAGE_python3-codecs is not set +# CONFIG_PACKAGE_python3-codecs-src is not set +# CONFIG_PACKAGE_python3-cryptography is not set +# CONFIG_PACKAGE_python3-ctypes is not set +# CONFIG_PACKAGE_python3-ctypes-src is not set +# CONFIG_PACKAGE_python3-dbm is not set +# CONFIG_PACKAGE_python3-dbm-src is not set +# CONFIG_PACKAGE_python3-decimal is not set +# CONFIG_PACKAGE_python3-decimal-src is not set +# CONFIG_PACKAGE_python3-dev is not set +# CONFIG_PACKAGE_python3-dev-src is not set +# CONFIG_PACKAGE_python3-distutils is not set +# CONFIG_PACKAGE_python3-distutils-src is not set +# CONFIG_PACKAGE_python3-email is not set +# CONFIG_PACKAGE_python3-email-src is not set +# CONFIG_PACKAGE_python3-evdev is not set +# CONFIG_PACKAGE_python3-flask is not set +# CONFIG_PACKAGE_python3-gdbm is not set +# CONFIG_PACKAGE_python3-gdbm-src is not set +# CONFIG_PACKAGE_python3-gnupg is not set +# CONFIG_PACKAGE_python3-idna is not set +# CONFIG_PACKAGE_python3-itsdangerous is not set +# CONFIG_PACKAGE_python3-jinja2 is not set +# CONFIG_PACKAGE_python3-lib2to3 is not set +# CONFIG_PACKAGE_python3-lib2to3-src is not set +# CONFIG_PACKAGE_python3-light is not set + +# +# Configuration +# +# CONFIG_PYTHON3_BLUETOOTH_SUPPORT is not set +# CONFIG_PACKAGE_python3-light-src is not set +# CONFIG_PACKAGE_python3-logging is not set +# CONFIG_PACKAGE_python3-logging-src is not set +# CONFIG_PACKAGE_python3-lxml is not set +# CONFIG_PACKAGE_python3-lzma is not set +# CONFIG_PACKAGE_python3-lzma-src is not set +# CONFIG_PACKAGE_python3-markupsafe is not set +# CONFIG_PACKAGE_python3-multiprocessing is not set +# CONFIG_PACKAGE_python3-multiprocessing-src is not set +# CONFIG_PACKAGE_python3-ncurses is not set +# CONFIG_PACKAGE_python3-ncurses-src is not set +# CONFIG_PACKAGE_python3-openssl is not set +# CONFIG_PACKAGE_python3-openssl-src is not set +# CONFIG_PACKAGE_python3-pip is not set +# CONFIG_PACKAGE_python3-pip-src is not set +# CONFIG_PACKAGE_python3-ply is not set +# CONFIG_PACKAGE_python3-pyasn1 is not set +# CONFIG_PACKAGE_python3-pyasn1-modules is not set +# CONFIG_PACKAGE_python3-pycparser is not set +# CONFIG_PACKAGE_python3-pydoc is not set +# CONFIG_PACKAGE_python3-pydoc-src is not set +# CONFIG_PACKAGE_python3-pyodbc is not set +# CONFIG_PACKAGE_python3-pyopenssl is not set +# CONFIG_PACKAGE_python3-setuptools is not set +# CONFIG_PACKAGE_python3-setuptools-src is not set +# CONFIG_PACKAGE_python3-six is not set +# CONFIG_PACKAGE_python3-smbus is not set +# CONFIG_PACKAGE_python3-sqlite3 is not set +# CONFIG_PACKAGE_python3-sqlite3-src is not set +# CONFIG_PACKAGE_python3-src is not set +# CONFIG_PACKAGE_python3-unittest is not set +# CONFIG_PACKAGE_python3-unittest-src is not set +# CONFIG_PACKAGE_python3-werkzeug is not set +# CONFIG_PACKAGE_python3-xml is not set +# CONFIG_PACKAGE_python3-xml-src is not set +# CONFIG_PACKAGE_python3-yaml is not set +# CONFIG_PACKAGE_pytz is not set +# CONFIG_PACKAGE_rcssmin is not set +# CONFIG_PACKAGE_simplejson is not set +# CONFIG_PACKAGE_twisted is not set +# CONFIG_PACKAGE_zope-interface is not set + +# +# Ruby +# +# CONFIG_PACKAGE_ruby is not set + +# +# Tcl +# +# CONFIG_PACKAGE_vala is not set + +# +# Libraries +# + +# +# Compression +# +# CONFIG_PACKAGE_libbz2 is not set +# CONFIG_PACKAGE_liblzma is not set +# CONFIG_PACKAGE_libunrar is not set + +# +# Filesystem +# +# CONFIG_PACKAGE_libacl is not set +# CONFIG_PACKAGE_libattr is not set +# CONFIG_PACKAGE_libext2fs is not set +# CONFIG_PACKAGE_libfuse is not set +# CONFIG_PACKAGE_libow is not set +# CONFIG_PACKAGE_libow-capi is not set +# CONFIG_PACKAGE_libsysfs is not set + +# +# Firewall +# +# CONFIG_PACKAGE_libfko is not set +CONFIG_PACKAGE_libip4tc=y +CONFIG_PACKAGE_libip6tc=y +# CONFIG_PACKAGE_libiptc is not set +CONFIG_PACKAGE_libxtables=y + +# +# Instant Messaging +# +# CONFIG_PACKAGE_quasselc is not set + +# +# IoT +# +# CONFIG_PACKAGE_libupm is not set +# CONFIG_PACKAGE_libupm-a110x is not set +# CONFIG_PACKAGE_libupm-ad8232 is not set +# CONFIG_PACKAGE_libupm-adafruitss is not set +# CONFIG_PACKAGE_libupm-adc121c021 is not set +# CONFIG_PACKAGE_libupm-adis16448 is not set +# CONFIG_PACKAGE_libupm-adxl335 is not set +# CONFIG_PACKAGE_libupm-adxl345 is not set +# CONFIG_PACKAGE_libupm-am2315 is not set +# CONFIG_PACKAGE_libupm-apds9002 is not set +# CONFIG_PACKAGE_libupm-at42qt1070 is not set +# CONFIG_PACKAGE_libupm-biss0001 is not set +# CONFIG_PACKAGE_libupm-bmpx8x is not set +# CONFIG_PACKAGE_libupm-buzzer is not set +# CONFIG_PACKAGE_libupm-cjq4435 is not set +# CONFIG_PACKAGE_libupm-ds1307 is not set +# CONFIG_PACKAGE_libupm-ecs1030 is not set +# CONFIG_PACKAGE_libupm-enc03r is not set +# CONFIG_PACKAGE_libupm-flex is not set +# CONFIG_PACKAGE_libupm-gas is not set +# CONFIG_PACKAGE_libupm-gp2y0a is not set +# CONFIG_PACKAGE_libupm-grove is not set +# CONFIG_PACKAGE_libupm-grovecircularled is not set +# CONFIG_PACKAGE_libupm-grovecollision is not set +# CONFIG_PACKAGE_libupm-groveehr is not set +# CONFIG_PACKAGE_libupm-groveeldriver is not set +# CONFIG_PACKAGE_libupm-groveelectromagnet is not set +# CONFIG_PACKAGE_libupm-groveemg is not set +# CONFIG_PACKAGE_libupm-grovegprs is not set +# CONFIG_PACKAGE_libupm-grovegsr is not set +# CONFIG_PACKAGE_libupm-grovelinefinder is not set +# CONFIG_PACKAGE_libupm-grovemd is not set +# CONFIG_PACKAGE_libupm-grovemoisture is not set +# CONFIG_PACKAGE_libupm-groveo2 is not set +# CONFIG_PACKAGE_libupm-grovescam is not set +# CONFIG_PACKAGE_libupm-grovespeaker is not set +# CONFIG_PACKAGE_libupm-grovevdiv is not set +# CONFIG_PACKAGE_libupm-grovewater is not set +# CONFIG_PACKAGE_libupm-grovewfs is not set +# CONFIG_PACKAGE_libupm-guvas12d is not set +# CONFIG_PACKAGE_libupm-h3lis331dl is not set +# CONFIG_PACKAGE_libupm-hcsr04 is not set +# CONFIG_PACKAGE_libupm-hm11 is not set +# CONFIG_PACKAGE_libupm-hmc5883l is not set +# CONFIG_PACKAGE_libupm-hmtrp is not set +# CONFIG_PACKAGE_libupm-hp20x is not set +# CONFIG_PACKAGE_libupm-ht9170 is not set +# CONFIG_PACKAGE_libupm-htu21d is not set +# CONFIG_PACKAGE_libupm-hx711 is not set +# CONFIG_PACKAGE_libupm-i2clcd is not set +# CONFIG_PACKAGE_libupm-ina132 is not set +# CONFIG_PACKAGE_libupm-isd1820 is not set +# CONFIG_PACKAGE_libupm-itg3200 is not set +# CONFIG_PACKAGE_libupm-joystick12 is not set +# CONFIG_PACKAGE_libupm-l298 is not set +# CONFIG_PACKAGE_libupm-ldt0028 is not set +# CONFIG_PACKAGE_libupm-lm35 is not set +# CONFIG_PACKAGE_libupm-lol is not set +# CONFIG_PACKAGE_libupm-loudness is not set +# CONFIG_PACKAGE_libupm-lpd8806 is not set +# CONFIG_PACKAGE_libupm-lsm303 is not set +# CONFIG_PACKAGE_libupm-lsm9ds0 is not set +# CONFIG_PACKAGE_libupm-m24lr64e is not set +# CONFIG_PACKAGE_libupm-max31723 is not set +# CONFIG_PACKAGE_libupm-max31855 is not set +# CONFIG_PACKAGE_libupm-max44000 is not set +# CONFIG_PACKAGE_libupm-max5487 is not set +# CONFIG_PACKAGE_libupm-maxds3231m is not set +# CONFIG_PACKAGE_libupm-maxsonarez is not set +# CONFIG_PACKAGE_libupm-mg811 is not set +# CONFIG_PACKAGE_libupm-mhz16 is not set +# CONFIG_PACKAGE_libupm-mic is not set +# CONFIG_PACKAGE_libupm-mlx90614 is not set +# CONFIG_PACKAGE_libupm-mma7455 is not set +# CONFIG_PACKAGE_libupm-mma7660 is not set +# CONFIG_PACKAGE_libupm-mpl3115a2 is not set +# CONFIG_PACKAGE_libupm-mpr121 is not set +# CONFIG_PACKAGE_libupm-mpu9150 is not set +# CONFIG_PACKAGE_libupm-mq303a is not set +# CONFIG_PACKAGE_libupm-my9221 is not set +# CONFIG_PACKAGE_libupm-nrf24l01 is not set +# CONFIG_PACKAGE_libupm-nrf8001 is not set +# CONFIG_PACKAGE_libupm-nunchuck is not set +# CONFIG_PACKAGE_libupm-otp538u is not set +# CONFIG_PACKAGE_libupm-pn532 is not set +# CONFIG_PACKAGE_libupm-ppd42ns is not set +# CONFIG_PACKAGE_libupm-pulsensor is not set +# CONFIG_PACKAGE_libupm-rfr359f is not set +# CONFIG_PACKAGE_libupm-rgbringcoder is not set +# CONFIG_PACKAGE_libupm-rotaryencoder is not set +# CONFIG_PACKAGE_libupm-rpr220 is not set +# CONFIG_PACKAGE_libupm-servo is not set +# CONFIG_PACKAGE_libupm-si114x is not set +# CONFIG_PACKAGE_libupm-sm130 is not set +# CONFIG_PACKAGE_libupm-st7735 is not set +# CONFIG_PACKAGE_libupm-stepmotor is not set +# CONFIG_PACKAGE_libupm-sx6119 is not set +# CONFIG_PACKAGE_libupm-ta12200 is not set +# CONFIG_PACKAGE_libupm-tcs3414cs is not set +# CONFIG_PACKAGE_libupm-th02 is not set +# CONFIG_PACKAGE_libupm-tm1637 is not set +# CONFIG_PACKAGE_libupm-tsl2561 is not set +# CONFIG_PACKAGE_libupm-ttp223 is not set +# CONFIG_PACKAGE_libupm-ublox6 is not set +# CONFIG_PACKAGE_libupm-uln200xa is not set +# CONFIG_PACKAGE_libupm-waterlevel is not set +# CONFIG_PACKAGE_libupm-wheelencoder is not set +# CONFIG_PACKAGE_libupm-wt5001 is not set +# CONFIG_PACKAGE_libupm-yg1006 is not set +# CONFIG_PACKAGE_libupm-zfm20 is not set + +# +# Languages +# +# CONFIG_PACKAGE_libyaml is not set + +# +# Networking +# +# CONFIG_PACKAGE_libsctp is not set + +# +# SSL +# +# CONFIG_PACKAGE_libcyassl is not set +# CONFIG_PACKAGE_libgnutls is not set +# CONFIG_PACKAGE_libmbedtls is not set +# CONFIG_PACKAGE_libopenssl is not set + +# +# Sound +# +# CONFIG_PACKAGE_liblo is not set + +# +# Telephony +# +# CONFIG_PACKAGE_bcg729 is not set +# CONFIG_PACKAGE_dahdi-tools-libtonezone is not set +# CONFIG_PACKAGE_gsmlib is not set +# CONFIG_PACKAGE_libctb is not set +# CONFIG_PACKAGE_libiksemel is not set +# CONFIG_PACKAGE_libosip2 is not set +# CONFIG_PACKAGE_libpj is not set +# CONFIG_PACKAGE_libpjlib-util is not set +# CONFIG_PACKAGE_libpjmedia is not set +# CONFIG_PACKAGE_libpjnath is not set +# CONFIG_PACKAGE_libpjsip is not set +# CONFIG_PACKAGE_libpjsip-simple is not set +# CONFIG_PACKAGE_libpjsip-ua is not set +# CONFIG_PACKAGE_libpjsua is not set +# CONFIG_PACKAGE_libpjsua2 is not set +# CONFIG_PACKAGE_libre is not set +# CONFIG_PACKAGE_librem is not set +# CONFIG_PACKAGE_libspandsp is not set +# CONFIG_PACKAGE_libsrtp is not set +# CONFIG_PACKAGE_libsrtp2 is not set + +# +# database +# +# CONFIG_PACKAGE_libpq is not set +# CONFIG_PACKAGE_libsqlite3 is not set +# CONFIG_PACKAGE_pgsqlodbc is not set +# CONFIG_PACKAGE_psqlodbca is not set +# CONFIG_PACKAGE_psqlodbcw is not set +# CONFIG_PACKAGE_tdb is not set +# CONFIG_PACKAGE_unixodbc is not set + +# +# libelektra +# +# CONFIG_PACKAGE_libelektra-boost is not set +# CONFIG_PACKAGE_libelektra-core is not set +# CONFIG_PACKAGE_libelektra-cpp is not set +# CONFIG_PACKAGE_libelektra-crypto is not set +# CONFIG_PACKAGE_libelektra-curlget is not set +# CONFIG_PACKAGE_libelektra-dbus is not set +# CONFIG_PACKAGE_libelektra-extra is not set +# CONFIG_PACKAGE_libelektra-lua is not set +# CONFIG_PACKAGE_libelektra-plugins is not set +# CONFIG_PACKAGE_libelektra-python2 is not set +# CONFIG_PACKAGE_libelektra-python3 is not set +# CONFIG_PACKAGE_libelektra-resolvers is not set +# CONFIG_PACKAGE_libelektra-xerces is not set +# CONFIG_PACKAGE_libelektra-xml is not set +# CONFIG_PACKAGE_libelektra-yajl is not set +# CONFIG_PACKAGE_libelektra-yamlcpp is not set +# CONFIG_PACKAGE_alsa-lib is not set +# CONFIG_PACKAGE_argp-standalone is not set +# CONFIG_PACKAGE_avro-c is not set +# CONFIG_PACKAGE_bind-libs is not set +# CONFIG_PACKAGE_bluez-libs is not set +# CONFIG_PACKAGE_boost is not set +# CONFIG_PACKAGE_ccid is not set +# CONFIG_PACKAGE_check is not set +# CONFIG_PACKAGE_classpath is not set +# CONFIG_PACKAGE_classpath-tools is not set +# CONFIG_PACKAGE_confuse is not set +# CONFIG_PACKAGE_dtndht is not set +# CONFIG_PACKAGE_fcgi is not set +# CONFIG_PACKAGE_fftw3 is not set +# CONFIG_PACKAGE_fftw3f is not set +# CONFIG_PACKAGE_giflib is not set +# CONFIG_PACKAGE_glib2 is not set +# CONFIG_PACKAGE_glog is not set +# CONFIG_PACKAGE_hidapi is not set +# CONFIG_PACKAGE_ibrcommon is not set +# CONFIG_PACKAGE_ibrdtn is not set +# CONFIG_PACKAGE_icu is not set +# CONFIG_PACKAGE_jansson is not set +# CONFIG_PACKAGE_knot-libs is not set +# CONFIG_PACKAGE_knot-libzscanner is not set +# CONFIG_PACKAGE_libaio is not set +# CONFIG_PACKAGE_libantlr3c is not set +# CONFIG_PACKAGE_libao is not set +# CONFIG_PACKAGE_libapr is not set +# CONFIG_PACKAGE_libaprutil is not set +# CONFIG_PACKAGE_libarchive is not set +# CONFIG_PACKAGE_libarchive-noopenssl is not set +# CONFIG_PACKAGE_libartnet is not set +# CONFIG_PACKAGE_libaudiofile is not set +# CONFIG_PACKAGE_libavahi-client is not set +# CONFIG_PACKAGE_libavahi-compat-libdnssd is not set +# CONFIG_PACKAGE_libavahi-dbus-support is not set +# CONFIG_PACKAGE_libavahi-nodbus-support is not set +# CONFIG_PACKAGE_libavl is not set +# CONFIG_PACKAGE_libbfd is not set +# CONFIG_PACKAGE_libblkid is not set +CONFIG_PACKAGE_libblobmsg-json=y +# CONFIG_PACKAGE_libcanfestival is not set +# CONFIG_PACKAGE_libcap is not set +# CONFIG_PACKAGE_libcares is not set +# CONFIG_PACKAGE_libcharset is not set +# CONFIG_PACKAGE_libcoap is not set +# CONFIG_PACKAGE_libconfig is not set +# CONFIG_PACKAGE_libcryptopp is not set +# CONFIG_PACKAGE_libcurl is not set +# CONFIG_PACKAGE_libdaemon is not set +# CONFIG_PACKAGE_libdaq is not set +# CONFIG_PACKAGE_libdb47 is not set +# CONFIG_PACKAGE_libdb47xx is not set +# CONFIG_PACKAGE_libdbi is not set +# CONFIG_PACKAGE_libdbus is not set +# CONFIG_PACKAGE_libdevmapper is not set +# CONFIG_PACKAGE_libdmapsharing is not set +# CONFIG_PACKAGE_libdnet is not set +# CONFIG_PACKAGE_libdouble-conversion is not set +# CONFIG_PACKAGE_libdrm is not set +# CONFIG_PACKAGE_libedit is not set +# CONFIG_PACKAGE_libelf1 is not set +# CONFIG_PACKAGE_libecdsautil is not set +# CONFIG_PACKAGE_libesmtp is not set +# CONFIG_PACKAGE_libestr is not set +# CONFIG_PACKAGE_libev is not set +# CONFIG_PACKAGE_libevdev is not set +# CONFIG_PACKAGE_libevent2 is not set +# CONFIG_PACKAGE_libevent2-core is not set +# CONFIG_PACKAGE_libevent2-extra is not set +# CONFIG_PACKAGE_libevent2-openssl is not set +# CONFIG_PACKAGE_libevent2-pthreads is not set +# CONFIG_PACKAGE_libeventlog is not set +# CONFIG_PACKAGE_libevhtp is not set +# CONFIG_PACKAGE_libexif is not set +# CONFIG_PACKAGE_libexpat is not set +# CONFIG_PACKAGE_libexslt is not set +# CONFIG_PACKAGE_libextractor is not set +# CONFIG_PACKAGE_libf2fs is not set +# CONFIG_PACKAGE_libfaad2 is not set +# CONFIG_PACKAGE_libfastjson is not set +# CONFIG_PACKAGE_libfdisk is not set +# CONFIG_PACKAGE_libfdt is not set +# CONFIG_PACKAGE_libffi is not set +# CONFIG_PACKAGE_libffmpeg-audio-dec is not set +# CONFIG_PACKAGE_libffmpeg-custom is not set +# CONFIG_PACKAGE_libffmpeg-full is not set +# CONFIG_PACKAGE_libffmpeg-mini is not set +# CONFIG_PACKAGE_libflac is not set +# CONFIG_PACKAGE_libfreetype is not set +# CONFIG_PACKAGE_libftdi is not set +# CONFIG_PACKAGE_libftdi1 is not set +# CONFIG_PACKAGE_libgcrypt is not set +# CONFIG_PACKAGE_libgd is not set +# CONFIG_PACKAGE_libgdbm is not set +# CONFIG_PACKAGE_libgee is not set +# CONFIG_PACKAGE_libglpk is not set +# CONFIG_PACKAGE_libgmp is not set +# CONFIG_PACKAGE_libgnurl is not set +# CONFIG_PACKAGE_libgpg-error is not set +# CONFIG_PACKAGE_libgphoto2 is not set +# CONFIG_PACKAGE_libgps is not set +# CONFIG_PACKAGE_libhamlib is not set +# CONFIG_PACKAGE_libhavege is not set +# CONFIG_PACKAGE_libhiredis is not set +# CONFIG_PACKAGE_libhttp-parser is not set +# CONFIG_PACKAGE_libical is not set +# CONFIG_PACKAGE_libiconv is not set +# CONFIG_PACKAGE_libiconv-full is not set +# CONFIG_PACKAGE_libid3tag is not set +# CONFIG_PACKAGE_libidn is not set +# CONFIG_PACKAGE_libiio is not set +# CONFIG_PACKAGE_libimobiledevice is not set +# CONFIG_PACKAGE_libinput is not set +# CONFIG_PACKAGE_libintl is not set +# CONFIG_PACKAGE_libintl-full is not set +# CONFIG_PACKAGE_libiw is not set +CONFIG_PACKAGE_libiwinfo=y +# CONFIG_PACKAGE_libjpeg is not set +CONFIG_PACKAGE_libjson-c=y +# CONFIG_PACKAGE_libkmod is not set +# CONFIG_PACKAGE_libldns is not set +# CONFIG_PACKAGE_libltdl is not set +# CONFIG_PACKAGE_liblua is not set +# CONFIG_PACKAGE_liblz4 is not set +# CONFIG_PACKAGE_liblzo is not set +# CONFIG_PACKAGE_libmad is not set +# CONFIG_PACKAGE_libmagic is not set +# CONFIG_PACKAGE_libmcrypt is not set +# CONFIG_PACKAGE_libmicrohttpd is not set +# CONFIG_PACKAGE_libmicrohttpd-no-ssl is not set +# CONFIG_PACKAGE_libminiupnpc is not set +# CONFIG_PACKAGE_libmms is not set +# CONFIG_PACKAGE_libmnl is not set +# CONFIG_PACKAGE_libmodbus is not set +# CONFIG_PACKAGE_libmosquitto-nossl is not set +# CONFIG_PACKAGE_libmosquitto-ssl is not set +# CONFIG_PACKAGE_libmount is not set +# CONFIG_PACKAGE_libmpdclient is not set +# CONFIG_PACKAGE_libmpeg2 is not set +# CONFIG_PACKAGE_libmpg123 is not set +# CONFIG_PACKAGE_libmraa is not set +# CONFIG_PACKAGE_libmysqlclient is not set +# CONFIG_PACKAGE_libmysqlclient-r is not set +# CONFIG_PACKAGE_libnatpmp is not set +# CONFIG_PACKAGE_libncurses is not set +# CONFIG_PACKAGE_libndpi is not set +# CONFIG_PACKAGE_libneon is not set +# CONFIG_PACKAGE_libnet-1.2.x is not set +# CONFIG_PACKAGE_libnetconf2 is not set +# CONFIG_PACKAGE_libnetfilter-acct is not set +# CONFIG_PACKAGE_libnetfilter-conntrack is not set +# CONFIG_PACKAGE_libnetfilter-cthelper is not set +# CONFIG_PACKAGE_libnetfilter-cttimeout is not set +# CONFIG_PACKAGE_libnetfilter-log is not set +# CONFIG_PACKAGE_libnetfilter-queue is not set +# CONFIG_PACKAGE_libnetsnmp is not set +# CONFIG_PACKAGE_libnettle is not set +# CONFIG_PACKAGE_libnfnetlink is not set +# CONFIG_PACKAGE_libnftnl is not set +# CONFIG_PACKAGE_libnl is not set +# CONFIG_PACKAGE_libnl-core is not set +# CONFIG_PACKAGE_libnl-genl is not set +# CONFIG_PACKAGE_libnl-nf is not set +# CONFIG_PACKAGE_libnl-route is not set +CONFIG_PACKAGE_libnl-tiny=y +# CONFIG_PACKAGE_libnopoll is not set +# CONFIG_PACKAGE_libogg is not set +# CONFIG_PACKAGE_liboil is not set +# CONFIG_PACKAGE_libopcodes is not set +# CONFIG_PACKAGE_libopenldap is not set +# CONFIG_PACKAGE_libopenobex is not set +# CONFIG_PACKAGE_libopensc is not set +# CONFIG_PACKAGE_libopenzwave is not set +# CONFIG_PACKAGE_liboping is not set +# CONFIG_PACKAGE_libopus is not set +# CONFIG_PACKAGE_libout123 is not set +# CONFIG_PACKAGE_libowfat is not set +# CONFIG_PACKAGE_libp11 is not set +# CONFIG_PACKAGE_libpam is not set +# CONFIG_PACKAGE_libpcap is not set +# CONFIG_PACKAGE_libpcre is not set +# CONFIG_PACKAGE_libpcre16 is not set +# CONFIG_PACKAGE_libpcre2 is not set +# CONFIG_PACKAGE_libpcre2-16 is not set +# CONFIG_PACKAGE_libpcre2-32 is not set +# CONFIG_PACKAGE_libpcrecpp is not set +# CONFIG_PACKAGE_libpcsclite is not set +# CONFIG_PACKAGE_libpkcs11-spy is not set +# CONFIG_PACKAGE_libplist is not set +# CONFIG_PACKAGE_libplistcxx is not set +# CONFIG_PACKAGE_libpng is not set +# CONFIG_PACKAGE_libpopt is not set +# CONFIG_PACKAGE_libpri is not set +# CONFIG_PACKAGE_libprotobuf-c is not set +# CONFIG_PACKAGE_libqrencode is not set +# CONFIG_PACKAGE_libradcli is not set +# CONFIG_PACKAGE_libreadline is not set +# CONFIG_PACKAGE_libredblack is not set +# CONFIG_PACKAGE_libroxml is not set +# CONFIG_PACKAGE_librpc is not set +# CONFIG_PACKAGE_librrd1 is not set +# CONFIG_PACKAGE_librtlsdr is not set +# CONFIG_PACKAGE_libruby is not set +# CONFIG_PACKAGE_libsamplerate is not set +# CONFIG_PACKAGE_libsane is not set +# CONFIG_PACKAGE_libsasl2 is not set +# CONFIG_PACKAGE_libsearpc is not set +# CONFIG_PACKAGE_libseccomp is not set +# CONFIG_PACKAGE_libsensors is not set +# CONFIG_PACKAGE_libshout is not set +# CONFIG_PACKAGE_libshout-full is not set +# CONFIG_PACKAGE_libshout-nossl is not set +# CONFIG_PACKAGE_libsigcxx is not set +# CONFIG_PACKAGE_libsmartcols is not set +# CONFIG_PACKAGE_libsndfile is not set +# CONFIG_PACKAGE_libsoc is not set +# CONFIG_PACKAGE_libsocks is not set +# CONFIG_PACKAGE_libsodium is not set +# CONFIG_PACKAGE_libsoup is not set +# CONFIG_PACKAGE_libsoxr is not set +# CONFIG_PACKAGE_libspeex is not set +# CONFIG_PACKAGE_libspeexdsp is not set +# CONFIG_PACKAGE_libssh is not set +# CONFIG_PACKAGE_libssh2 is not set +# CONFIG_PACKAGE_libstoken is not set +# CONFIG_PACKAGE_libstrophe is not set +# CONFIG_PACKAGE_libtalloc is not set +# CONFIG_PACKAGE_libtasn1 is not set +# CONFIG_PACKAGE_libtheora is not set +# CONFIG_PACKAGE_libtiff is not set +# CONFIG_PACKAGE_libtiffxx is not set +# CONFIG_PACKAGE_libtins is not set +# CONFIG_PACKAGE_libtorrent is not set +CONFIG_PACKAGE_libubox=y +# CONFIG_PACKAGE_libubox-lua is not set +CONFIG_PACKAGE_libubus=y +# CONFIG_PACKAGE_libubus-lua is not set +CONFIG_PACKAGE_libuci=y +# CONFIG_PACKAGE_libuci-lua is not set +CONFIG_PACKAGE_libuclient=y +# CONFIG_PACKAGE_libudev-fbsd is not set +# CONFIG_PACKAGE_libudns is not set +# CONFIG_PACKAGE_libuecc is not set +# CONFIG_PACKAGE_libugpio is not set +# CONFIG_PACKAGE_libunbound is not set +# CONFIG_PACKAGE_libunistring is not set +# CONFIG_PACKAGE_libunwind is not set +# CONFIG_PACKAGE_libupnp is not set +# CONFIG_PACKAGE_libupnpp is not set +# CONFIG_PACKAGE_liburcu is not set +# CONFIG_PACKAGE_libusb-1.0 is not set +# CONFIG_PACKAGE_libusb-compat is not set +# CONFIG_PACKAGE_libusbmuxd is not set +# CONFIG_PACKAGE_libustream-cyassl is not set +# CONFIG_PACKAGE_libustream-mbedtls is not set +# CONFIG_PACKAGE_libustream-openssl is not set +# CONFIG_PACKAGE_libuuid is not set +# CONFIG_PACKAGE_libuv is not set +# CONFIG_PACKAGE_libuvc is not set +# CONFIG_PACKAGE_libv4l is not set +# CONFIG_PACKAGE_libvorbis is not set +# CONFIG_PACKAGE_libvorbisidec is not set +# CONFIG_PACKAGE_libvpx is not set +# CONFIG_PACKAGE_libwebcam is not set +# CONFIG_PACKAGE_libwebsockets-full is not set +# CONFIG_PACKAGE_libwebsockets-mbedtls is not set +# CONFIG_PACKAGE_libwebsockets-openssl is not set +# CONFIG_PACKAGE_libwrap is not set +# CONFIG_PACKAGE_libwxbase is not set +# CONFIG_PACKAGE_libx264 is not set +# CONFIG_PACKAGE_libxerces-c is not set +# CONFIG_PACKAGE_libxerces-c-samples is not set +# CONFIG_PACKAGE_libxml2 is not set +# CONFIG_PACKAGE_libxslt is not set +# CONFIG_PACKAGE_libyaml-cpp is not set +# CONFIG_PACKAGE_libyang is not set +# CONFIG_PACKAGE_libzdb is not set +# CONFIG_PACKAGE_libzmq-curve is not set +# CONFIG_PACKAGE_libzmq-nc is not set +# CONFIG_PACKAGE_linux-atm is not set +# CONFIG_PACKAGE_loudmouth is not set +# CONFIG_PACKAGE_lttng-ust is not set +# CONFIG_PACKAGE_mtdev is not set +# CONFIG_PACKAGE_musl-fts is not set +# CONFIG_PACKAGE_mxml is not set +# CONFIG_PACKAGE_nacl is not set +# CONFIG_PACKAGE_opencv is not set +# CONFIG_PACKAGE_p11-kit is not set +# CONFIG_PACKAGE_poco is not set +# CONFIG_PACKAGE_protobuf is not set +# CONFIG_PACKAGE_pthsem is not set +# CONFIG_PACKAGE_rpcd-mod-rrdns is not set +# CONFIG_PACKAGE_rxtx is not set +# CONFIG_PACKAGE_sbc is not set +# CONFIG_PACKAGE_terminfo is not set +# CONFIG_PACKAGE_tinycdb is not set +# CONFIG_PACKAGE_uclibcxx is not set +# CONFIG_PACKAGE_uw-imap is not set +# CONFIG_PACKAGE_xmlrpc-c is not set +# CONFIG_PACKAGE_xmlrpc-c-client is not set +# CONFIG_PACKAGE_xmlrpc-c-server is not set +# CONFIG_PACKAGE_yajl is not set +# CONFIG_PACKAGE_zlib is not set + +# +# LuCI +# + +# +# 1. Collections +# +# CONFIG_PACKAGE_luci is not set +# CONFIG_PACKAGE_luci-ssl is not set +# CONFIG_PACKAGE_luci-ssl-openssl is not set + +# +# 2. Modules +# +# CONFIG_PACKAGE_luci-base is not set +# CONFIG_LUCI_SRCDIET is not set + +# +# Translations +# +# CONFIG_LUCI_LANG_ca is not set +# CONFIG_LUCI_LANG_cs is not set +# CONFIG_LUCI_LANG_de is not set +# CONFIG_LUCI_LANG_el is not set +# CONFIG_LUCI_LANG_en is not set +# CONFIG_LUCI_LANG_es is not set +# CONFIG_LUCI_LANG_fr is not set +# CONFIG_LUCI_LANG_he is not set +# CONFIG_LUCI_LANG_hu is not set +# CONFIG_LUCI_LANG_it is not set +# CONFIG_LUCI_LANG_ja is not set +# CONFIG_LUCI_LANG_ko is not set +# CONFIG_LUCI_LANG_ms is not set +# CONFIG_LUCI_LANG_no is not set +# CONFIG_LUCI_LANG_pl is not set +# CONFIG_LUCI_LANG_pt is not set +# CONFIG_LUCI_LANG_pt-br is not set +# CONFIG_LUCI_LANG_ro is not set +# CONFIG_LUCI_LANG_ru is not set +# CONFIG_LUCI_LANG_sk is not set +# CONFIG_LUCI_LANG_sv is not set +# CONFIG_LUCI_LANG_tr is not set +# CONFIG_LUCI_LANG_uk is not set +# CONFIG_LUCI_LANG_vi is not set +# CONFIG_LUCI_LANG_zh-cn is not set +# CONFIG_LUCI_LANG_zh-tw is not set +# CONFIG_PACKAGE_luci-mod-admin-full is not set +# CONFIG_PACKAGE_luci-mod-failsafe is not set +# CONFIG_PACKAGE_luci-mod-freifunk is not set +# CONFIG_PACKAGE_luci-mod-freifunk-community is not set +# CONFIG_PACKAGE_luci-mod-rpc is not set + +# +# 3. Applications +# +# CONFIG_PACKAGE_luci-app-adblock is not set +# CONFIG_PACKAGE_luci-app-adbyby-plus is not set +# CONFIG_PACKAGE_luci-app-advanced-reboot is not set +# CONFIG_PACKAGE_luci-app-ahcp is not set +# CONFIG_PACKAGE_luci-app-amule is not set +# CONFIG_PACKAGE_luci-app-aria2 is not set +# CONFIG_PACKAGE_luci-app-arpbind is not set +# CONFIG_PACKAGE_luci-app-asterisk is not set +# CONFIG_PACKAGE_luci-app-autoreboot is not set +# CONFIG_PACKAGE_luci-app-bcp38 is not set +# CONFIG_PACKAGE_luci-app-bird4 is not set +# CONFIG_PACKAGE_luci-app-bird6 is not set +# CONFIG_PACKAGE_luci-app-bmx6 is not set +# CONFIG_PACKAGE_luci-app-bmx7 is not set +# CONFIG_PACKAGE_luci-app-cjdns is not set +# CONFIG_PACKAGE_luci-app-clamav is not set +# CONFIG_PACKAGE_luci-app-commands is not set +# CONFIG_PACKAGE_luci-app-cshark is not set +# CONFIG_PACKAGE_luci-app-ddns is not set +# CONFIG_PACKAGE_luci-app-diag-core is not set +# CONFIG_PACKAGE_luci-app-dnscrypt-proxy is not set +# CONFIG_PACKAGE_luci-app-dogcom is not set +# CONFIG_PACKAGE_luci-app-dump1090 is not set +# CONFIG_PACKAGE_luci-app-dynapoint is not set +# CONFIG_PACKAGE_luci-app-e2guardian is not set +# CONFIG_PACKAGE_luci-app-filetransfer is not set +# CONFIG_PACKAGE_luci-app-firewall is not set +# CONFIG_PACKAGE_luci-app-freifunk-diagnostics is not set +# CONFIG_PACKAGE_luci-app-freifunk-policyrouting is not set +# CONFIG_PACKAGE_luci-app-freifunk-widgets is not set +# CONFIG_PACKAGE_luci-app-frpc is not set +# CONFIG_PACKAGE_luci-app-fwknopd is not set +# CONFIG_PACKAGE_luci-app-hd-idle is not set +# CONFIG_PACKAGE_luci-app-hnet is not set +# CONFIG_PACKAGE_luci-app-ipsec-vpnd is not set +# CONFIG_PACKAGE_luci-app-kcptun is not set +# CONFIG_PACKAGE_luci-app-meshwizard is not set +# CONFIG_PACKAGE_luci-app-minidlna is not set +# CONFIG_PACKAGE_luci-app-mjpg-streamer is not set +# CONFIG_PACKAGE_luci-app-mmc-over-gpio is not set +# CONFIG_PACKAGE_luci-app-mproxy is not set +# CONFIG_PACKAGE_luci-app-mwan3 is not set +# CONFIG_PACKAGE_luci-app-n2n_v2 is not set +# CONFIG_PACKAGE_luci-app-ngrokc is not set +# CONFIG_PACKAGE_luci-app-nlbwmon is not set +# CONFIG_PACKAGE_luci-app-noddos is not set +# CONFIG_PACKAGE_luci-app-ntpc is not set +# CONFIG_PACKAGE_luci-app-ocserv is not set +# CONFIG_PACKAGE_luci-app-olsr is not set +# CONFIG_PACKAGE_luci-app-olsr-services is not set +# CONFIG_PACKAGE_luci-app-olsr-viz is not set +# CONFIG_PACKAGE_luci-app-openvpn is not set +# CONFIG_PACKAGE_luci-app-openvpn-server is not set +# CONFIG_PACKAGE_luci-app-oscam is not set +# CONFIG_PACKAGE_luci-app-p910nd is not set +# CONFIG_PACKAGE_luci-app-polipo is not set +# CONFIG_PACKAGE_luci-app-pptp-server is not set +# CONFIG_PACKAGE_luci-app-privoxy is not set +# CONFIG_PACKAGE_luci-app-qos is not set +# CONFIG_PACKAGE_luci-app-radicale is not set +# CONFIG_PACKAGE_luci-app-rp-pppoe-server is not set +# CONFIG_PACKAGE_luci-app-samba is not set +# CONFIG_PACKAGE_luci-app-sfe is not set +# CONFIG_PACKAGE_luci-app-shadowsocks-libev is not set +# CONFIG_PACKAGE_luci-app-shadowsocksr-pro is not set +# CONFIG_PACKAGE_luci-app-shairplay is not set +# CONFIG_PACKAGE_luci-app-shairport is not set +# CONFIG_PACKAGE_luci-app-siitwizard is not set +# CONFIG_PACKAGE_luci-app-simple-adblock is not set +# CONFIG_PACKAGE_luci-app-splash is not set +# CONFIG_PACKAGE_luci-app-squid is not set +# CONFIG_PACKAGE_luci-app-ssrserver-python is not set +# CONFIG_PACKAGE_luci-app-statistics is not set +# CONFIG_PACKAGE_luci-app-syncdial is not set +# CONFIG_PACKAGE_luci-app-tinyproxy is not set +# CONFIG_PACKAGE_luci-app-transmission is not set +# CONFIG_PACKAGE_luci-app-transparent-proxy is not set +# CONFIG_PACKAGE_luci-app-travelmate is not set +# CONFIG_PACKAGE_luci-app-udp2raw is not set +# CONFIG_PACKAGE_luci-app-udpxy is not set +# CONFIG_PACKAGE_luci-app-uhttpd is not set +# CONFIG_PACKAGE_luci-app-unbound is not set +# CONFIG_PACKAGE_luci-app-upnp is not set +# CONFIG_PACKAGE_luci-app-usb-printer is not set +# CONFIG_PACKAGE_luci-app-vlmcsd is not set +# CONFIG_PACKAGE_luci-app-vnstat is not set +# CONFIG_PACKAGE_luci-app-vpnbypass is not set +# CONFIG_PACKAGE_luci-app-vsftpd is not set +# CONFIG_PACKAGE_luci-app-watchcat is not set +# CONFIG_PACKAGE_luci-app-wifischedule is not set +# CONFIG_PACKAGE_luci-app-wireguard is not set +# CONFIG_PACKAGE_luci-app-wol is not set +# CONFIG_PACKAGE_luci-app-xlnetacc is not set +# CONFIG_PACKAGE_luci-app-zerotier is not set + +# +# 4. Themes +# +# CONFIG_PACKAGE_luci-theme-atmaterial is not set +# CONFIG_PACKAGE_luci-theme-bootstrap is not set +# CONFIG_PACKAGE_luci-theme-freifunk-generic is not set +# CONFIG_PACKAGE_luci-theme-material is not set +# CONFIG_PACKAGE_luci-theme-openwrt is not set + +# +# 5. Protocols +# +# CONFIG_PACKAGE_luci-proto-3g is not set +# CONFIG_PACKAGE_luci-proto-ipip is not set +# CONFIG_PACKAGE_luci-proto-ipv6 is not set +# CONFIG_PACKAGE_luci-proto-ncm is not set +# CONFIG_PACKAGE_luci-proto-openconnect is not set +# CONFIG_PACKAGE_luci-proto-ppp is not set +# CONFIG_PACKAGE_luci-proto-qmi is not set +# CONFIG_PACKAGE_luci-proto-relay is not set +# CONFIG_PACKAGE_luci-proto-vpnc is not set +# CONFIG_PACKAGE_luci-proto-wireguard is not set + +# +# 6. Libraries +# +# CONFIG_PACKAGE_luci-lib-dracula is not set +# CONFIG_PACKAGE_luci-lib-httpclient is not set +# CONFIG_PACKAGE_luci-lib-ip is not set +# CONFIG_PACKAGE_luci-lib-jquery-1-4 is not set +# CONFIG_PACKAGE_luci-lib-json is not set +# CONFIG_PACKAGE_luci-lib-jsonc is not set +# CONFIG_PACKAGE_luci-lib-luaneightbl is not set +# CONFIG_PACKAGE_luci-lib-nixio is not set +# CONFIG_PACKAGE_luci-lib-px5g is not set + +# +# 9. Freifunk +# +# CONFIG_PACKAGE_freifunk-common is not set +# CONFIG_PACKAGE_freifunk-firewall is not set +# CONFIG_PACKAGE_freifunk-policyrouting is not set +# CONFIG_PACKAGE_freifunk-watchdog is not set +# CONFIG_PACKAGE_meshwizard is not set +# CONFIG_PACKAGE_default-settings is not set + +# +# Mail +# +# CONFIG_PACKAGE_alpine is not set +# CONFIG_PACKAGE_alpine-nossl is not set +# CONFIG_PACKAGE_bogofilter is not set +# CONFIG_PACKAGE_clamsmtp is not set +# CONFIG_PACKAGE_dovecot is not set +# CONFIG_PACKAGE_dovecot-pigeonhole is not set +# CONFIG_PACKAGE_dovecot-utils is not set +# CONFIG_PACKAGE_emailrelay is not set +# CONFIG_PACKAGE_fdm is not set +# CONFIG_PACKAGE_greyfix is not set +# CONFIG_PACKAGE_mailman is not set +# CONFIG_PACKAGE_mailsend is not set +# CONFIG_PACKAGE_mailsend-nossl is not set +# CONFIG_PACKAGE_msmtp is not set +# CONFIG_PACKAGE_msmtp-nossl is not set +# CONFIG_PACKAGE_mutt is not set +# CONFIG_PACKAGE_nail is not set +# CONFIG_PACKAGE_postfix is not set + +# +# Select postfix build options +# +CONFIG_POSTFIX_TLS=y +CONFIG_POSTFIX_SASL=y +CONFIG_POSTFIX_LDAP=y +# CONFIG_POSTFIX_DB is not set +CONFIG_POSTFIX_CDB=y +CONFIG_POSTFIX_SQLITE=y +# CONFIG_POSTFIX_PGSQL is not set +CONFIG_POSTFIX_PCRE=y +# CONFIG_POSTFIX_EAI is not set +# CONFIG_PACKAGE_ssmtp is not set + +# +# Multimedia +# + +# +# Streaming +# +# CONFIG_PACKAGE_oggfwd is not set +# CONFIG_PACKAGE_crtmpserver is not set +# CONFIG_PACKAGE_ffmpeg is not set +# CONFIG_PACKAGE_ffprobe is not set +# CONFIG_PACKAGE_ffserver is not set +# CONFIG_PACKAGE_fswebcam is not set +# CONFIG_PACKAGE_gphoto2 is not set +# CONFIG_PACKAGE_grilo is not set +# CONFIG_PACKAGE_grilo-plugins is not set +# CONFIG_PACKAGE_gst1-libav is not set +# CONFIG_PACKAGE_gstreamer1-libs is not set +# CONFIG_PACKAGE_gstreamer1-plugins-bad is not set +# CONFIG_PACKAGE_gstreamer1-plugins-base is not set +# CONFIG_PACKAGE_gstreamer1-plugins-good is not set +# CONFIG_PACKAGE_gstreamer1-plugins-ugly is not set +# CONFIG_PACKAGE_gstreamer1-utils is not set +# CONFIG_PACKAGE_icecast is not set +# CONFIG_PACKAGE_lcdgrilo is not set +# CONFIG_PACKAGE_minidlna is not set +# CONFIG_PACKAGE_mjpg-streamer is not set +# CONFIG_PACKAGE_motion is not set +# CONFIG_PACKAGE_tvheadend is not set +# CONFIG_PACKAGE_v4l2rtspserver is not set +# CONFIG_PACKAGE_vips is not set +# CONFIG_PACKAGE_xupnpd is not set +# CONFIG_PACKAGE_youtube-dl is not set + +# +# Network +# + +# +# BitTorrent +# +# CONFIG_PACKAGE_mktorrent is not set +# CONFIG_PACKAGE_opentracker is not set +# CONFIG_PACKAGE_opentracker6 is not set +# CONFIG_PACKAGE_rtorrent is not set +# CONFIG_PACKAGE_rtorrent-rpc is not set +# CONFIG_PACKAGE_transmission-cli-mbedtls is not set +# CONFIG_PACKAGE_transmission-cli-openssl is not set +# CONFIG_PACKAGE_transmission-daemon-mbedtls is not set +# CONFIG_PACKAGE_transmission-daemon-openssl is not set +# CONFIG_PACKAGE_transmission-remote-mbedtls is not set +# CONFIG_PACKAGE_transmission-remote-openssl is not set + +# +# Captive Portals +# +# CONFIG_PACKAGE_coova-chilli is not set +# CONFIG_PACKAGE_nodogsplash is not set +# CONFIG_PACKAGE_nodogsplash2 is not set +# CONFIG_PACKAGE_wifidog is not set +# CONFIG_PACKAGE_wifidog-tls is not set + +# +# Download Manager +# +# CONFIG_PACKAGE_webui-aria2 is not set +# CONFIG_PACKAGE_yaaw is not set + +# +# File Transfer +# +# CONFIG_PACKAGE_aria2 is not set +# CONFIG_PACKAGE_atftp is not set +# CONFIG_PACKAGE_atftpd is not set +# CONFIG_PACKAGE_curl is not set +# CONFIG_PACKAGE_gnurl is not set +# CONFIG_PACKAGE_lftp is not set +# CONFIG_PACKAGE_rsync is not set +# CONFIG_PACKAGE_rsyncd is not set +# CONFIG_PACKAGE_vsftpd is not set +# CONFIG_PACKAGE_vsftpd-alt is not set +# CONFIG_PACKAGE_vsftpd-tls is not set +# CONFIG_PACKAGE_wget is not set +# CONFIG_PACKAGE_wget-nossl is not set + +# +# Filesystem +# +# CONFIG_PACKAGE_davfs2 is not set +# CONFIG_PACKAGE_netatalk is not set +# CONFIG_PACKAGE_nfs-kernel-server is not set +# CONFIG_PACKAGE_owftpd is not set +# CONFIG_PACKAGE_owhttpd is not set +# CONFIG_PACKAGE_owserver is not set +# CONFIG_PACKAGE_sshfs is not set + +# +# Firewall +# +# CONFIG_PACKAGE_arptables is not set +# CONFIG_PACKAGE_conntrack is not set +# CONFIG_PACKAGE_conntrackd is not set +# CONFIG_PACKAGE_ebtables is not set +# CONFIG_PACKAGE_fwknop is not set +# CONFIG_PACKAGE_fwknopd is not set +# CONFIG_PACKAGE_ip6tables is not set +CONFIG_PACKAGE_iptables=y +# CONFIG_PACKAGE_iptables-mod-account is not set +# CONFIG_PACKAGE_iptables-mod-chaos is not set +# CONFIG_PACKAGE_iptables-mod-cluster is not set +# CONFIG_PACKAGE_iptables-mod-clusterip is not set +# CONFIG_PACKAGE_iptables-mod-condition is not set +# CONFIG_PACKAGE_iptables-mod-conntrack-extra is not set +# CONFIG_PACKAGE_iptables-mod-delude is not set +# CONFIG_PACKAGE_iptables-mod-dhcpmac is not set +# CONFIG_PACKAGE_iptables-mod-dnetmap is not set +# CONFIG_PACKAGE_iptables-mod-extra is not set +# CONFIG_PACKAGE_iptables-mod-filter is not set +# CONFIG_PACKAGE_iptables-mod-fuzzy is not set +# CONFIG_PACKAGE_iptables-mod-geoip is not set +# CONFIG_PACKAGE_iptables-mod-hashlimit is not set +# CONFIG_PACKAGE_iptables-mod-iface is not set +# CONFIG_PACKAGE_iptables-mod-ipmark is not set +# CONFIG_PACKAGE_iptables-mod-ipopt is not set +# CONFIG_PACKAGE_iptables-mod-ipp2p is not set +# CONFIG_PACKAGE_iptables-mod-iprange is not set +# CONFIG_PACKAGE_iptables-mod-ipsec is not set +# CONFIG_PACKAGE_iptables-mod-ipv4options is not set +# CONFIG_PACKAGE_iptables-mod-led is not set +# CONFIG_PACKAGE_iptables-mod-length2 is not set +# CONFIG_PACKAGE_iptables-mod-logmark is not set +# CONFIG_PACKAGE_iptables-mod-lscan is not set +# CONFIG_PACKAGE_iptables-mod-lua is not set +# CONFIG_PACKAGE_iptables-mod-nat-extra is not set +# CONFIG_PACKAGE_iptables-mod-nflog is not set +# CONFIG_PACKAGE_iptables-mod-nfqueue is not set +# CONFIG_PACKAGE_iptables-mod-psd is not set +# CONFIG_PACKAGE_iptables-mod-quota2 is not set +# CONFIG_PACKAGE_iptables-mod-rpfilter is not set +# CONFIG_PACKAGE_iptables-mod-sysrq is not set +# CONFIG_PACKAGE_iptables-mod-tarpit is not set +# CONFIG_PACKAGE_iptables-mod-tee is not set +# CONFIG_PACKAGE_iptables-mod-tproxy is not set +# CONFIG_PACKAGE_iptables-mod-u32 is not set +# CONFIG_PACKAGE_iptables-mod-ulog is not set +# CONFIG_PACKAGE_iptaccount is not set +# CONFIG_PACKAGE_miniupnpc is not set +# CONFIG_PACKAGE_miniupnpd is not set +# CONFIG_MINIUPNPD_IGDv2 is not set +# CONFIG_PACKAGE_natpmpc is not set +# CONFIG_PACKAGE_nftables is not set +# CONFIG_PACKAGE_shorewall is not set +# CONFIG_PACKAGE_shorewall-core is not set +# CONFIG_PACKAGE_shorewall-lite is not set +# CONFIG_PACKAGE_shorewall6 is not set +# CONFIG_PACKAGE_shorewall6-lite is not set +# CONFIG_PACKAGE_snort is not set + +# +# Firewall Tunnel +# +# CONFIG_PACKAGE_iodine is not set +# CONFIG_PACKAGE_iodined is not set + +# +# FreeRADIUS (version 3) +# +# CONFIG_PACKAGE_freeradius3 is not set +# CONFIG_PACKAGE_freeradius3-common is not set +# CONFIG_PACKAGE_freeradius3-utils is not set + +# +# IP Addresses and Names +# +# CONFIG_PACKAGE_aggregate is not set +# CONFIG_PACKAGE_announce is not set +# CONFIG_PACKAGE_avahi-autoipd is not set +# CONFIG_PACKAGE_avahi-daemon-service-http is not set +# CONFIG_PACKAGE_avahi-daemon-service-ssh is not set +# CONFIG_PACKAGE_avahi-dbus-daemon is not set +# CONFIG_PACKAGE_avahi-dnsconfd is not set +# CONFIG_PACKAGE_avahi-nodbus-daemon is not set +# CONFIG_PACKAGE_avahi-utils is not set +# CONFIG_PACKAGE_bind-check is not set +# CONFIG_PACKAGE_bind-client is not set +# CONFIG_PACKAGE_bind-dig is not set +# CONFIG_PACKAGE_bind-dnssec is not set +# CONFIG_PACKAGE_bind-host is not set +# CONFIG_PACKAGE_bind-rndc is not set +# CONFIG_PACKAGE_bind-server is not set +# CONFIG_PACKAGE_bind-tools is not set +# CONFIG_PACKAGE_danish is not set +# CONFIG_PACKAGE_ddns-scripts is not set +# CONFIG_PACKAGE_ddns-scripts_aliyun is not set +# CONFIG_PACKAGE_dhcp-forwarder is not set +# CONFIG_PACKAGE_dnscrypt-proxy is not set +# CONFIG_PACKAGE_dnscrypt-proxy-resolvers is not set +# CONFIG_PACKAGE_drill is not set +# CONFIG_PACKAGE_hostip is not set +# CONFIG_PACKAGE_idn is not set +# CONFIG_PACKAGE_inadyn is not set +# CONFIG_PACKAGE_isc-dhcp-client-ipv4 is not set +# CONFIG_PACKAGE_isc-dhcp-client-ipv6 is not set +# CONFIG_PACKAGE_isc-dhcp-omshell-ipv4 is not set +# CONFIG_PACKAGE_isc-dhcp-omshell-ipv6 is not set +# CONFIG_PACKAGE_isc-dhcp-relay-ipv4 is not set +# CONFIG_PACKAGE_isc-dhcp-relay-ipv6 is not set +# CONFIG_PACKAGE_isc-dhcp-server-ipv4 is not set +# CONFIG_PACKAGE_isc-dhcp-server-ipv6 is not set +# CONFIG_PACKAGE_knot is not set +# CONFIG_PACKAGE_knot-dig is not set +# CONFIG_PACKAGE_knot-host is not set +# CONFIG_PACKAGE_knot-keymgr is not set +# CONFIG_PACKAGE_knot-nsupdate is not set +# CONFIG_PACKAGE_knot-tests is not set +# CONFIG_PACKAGE_knot-zonecheck is not set +# CONFIG_PACKAGE_mdns-utils is not set +# CONFIG_PACKAGE_mdnsd is not set +# CONFIG_PACKAGE_mdnsresponder is not set +# CONFIG_PACKAGE_nsd is not set +# CONFIG_PACKAGE_nsd-control is not set +# CONFIG_PACKAGE_nsd-control-setup is not set +# CONFIG_PACKAGE_nsd-nossl is not set +# CONFIG_PACKAGE_ohybridproxy is not set +# CONFIG_PACKAGE_unbound is not set +# CONFIG_PACKAGE_unbound-anchor is not set +# CONFIG_PACKAGE_unbound-control is not set +# CONFIG_PACKAGE_unbound-control-setup is not set +# CONFIG_PACKAGE_unbound-host is not set +# CONFIG_PACKAGE_zonestitcher is not set + +# +# Instant Messaging +# +# CONFIG_PACKAGE_bitlbee is not set +# CONFIG_PACKAGE_irssi is not set +# CONFIG_PACKAGE_ngircd is not set +# CONFIG_PACKAGE_ngircd-nossl is not set +# CONFIG_PACKAGE_prosody is not set +# CONFIG_PACKAGE_quassel-irssi is not set +# CONFIG_PACKAGE_umurmur-mbedtls is not set +# CONFIG_PACKAGE_umurmur-openssl is not set +# CONFIG_PACKAGE_znc is not set + +# +# Linux ATM tools +# +# CONFIG_PACKAGE_atm-aread is not set +# CONFIG_PACKAGE_atm-atmaddr is not set +# CONFIG_PACKAGE_atm-atmdiag is not set +# CONFIG_PACKAGE_atm-atmdump is not set +# CONFIG_PACKAGE_atm-atmloop is not set +# CONFIG_PACKAGE_atm-atmsigd is not set +# CONFIG_PACKAGE_atm-atmswitch is not set +# CONFIG_PACKAGE_atm-atmtcp is not set +# CONFIG_PACKAGE_atm-awrite is not set +# CONFIG_PACKAGE_atm-bus is not set +# CONFIG_PACKAGE_atm-debug-tools is not set +# CONFIG_PACKAGE_atm-diagnostics is not set +# CONFIG_PACKAGE_atm-esi is not set +# CONFIG_PACKAGE_atm-ilmid is not set +# CONFIG_PACKAGE_atm-ilmidiag is not set +# CONFIG_PACKAGE_atm-lecs is not set +# CONFIG_PACKAGE_atm-les is not set +# CONFIG_PACKAGE_atm-mpcd is not set +# CONFIG_PACKAGE_atm-saaldump is not set +# CONFIG_PACKAGE_atm-sonetdiag is not set +# CONFIG_PACKAGE_atm-svc_recv is not set +# CONFIG_PACKAGE_atm-svc_send is not set +# CONFIG_PACKAGE_atm-tools is not set +# CONFIG_PACKAGE_atm-ttcp_atm is not set +# CONFIG_PACKAGE_atm-zeppelin is not set +# CONFIG_PACKAGE_br2684ctl is not set + +# +# NMAP Suite +# +# CONFIG_PACKAGE_ncat is not set +# CONFIG_PACKAGE_ncat-ssl is not set +# CONFIG_PACKAGE_ndiff is not set +# CONFIG_PACKAGE_nmap is not set +# CONFIG_PACKAGE_nmap-ssl is not set +# CONFIG_PACKAGE_nping is not set + +# +# NTRIP +# +# CONFIG_PACKAGE_ntripcaster is not set +# CONFIG_PACKAGE_ntripclient is not set +# CONFIG_PACKAGE_ntripserver is not set + +# +# OLSR.org network framework +# +# CONFIG_PACKAGE_oonf-dlep-proxy is not set +# CONFIG_PACKAGE_oonf-dlep-radio is not set +# CONFIG_PACKAGE_oonf-init-scripts is not set +# CONFIG_PACKAGE_oonf-olsrd2 is not set + +# +# Open vSwitch +# +# CONFIG_PACKAGE_openvswitch is not set +# CONFIG_PACKAGE_openvswitch-base is not set +# CONFIG_PACKAGE_openvswitch-ovn is not set +# CONFIG_PACKAGE_openvswitch-ovn-base is not set +# CONFIG_PACKAGE_openvswitch-ovn-controller is not set +# CONFIG_PACKAGE_openvswitch-ovn-controller-vtep is not set +# CONFIG_PACKAGE_openvswitch-ovn-detrace is not set +# CONFIG_PACKAGE_openvswitch-ovn-docker-overlay-driver is not set +# CONFIG_PACKAGE_openvswitch-ovn-docker-underlay-driver is not set +# CONFIG_PACKAGE_openvswitch-ovn-nbctl is not set +# CONFIG_PACKAGE_openvswitch-ovn-sbctl is not set +# CONFIG_PACKAGE_openvswitch-ovn-trace is not set +# CONFIG_PACKAGE_openvswitch-ovs-dpctl-top is not set +# CONFIG_PACKAGE_openvswitch-ovs-l3ping is not set +# CONFIG_PACKAGE_openvswitch-ovs-parse-backtrace is not set +# CONFIG_PACKAGE_openvswitch-ovs-pcap is not set +# CONFIG_PACKAGE_openvswitch-ovs-tcpdump is not set +# CONFIG_PACKAGE_openvswitch-ovs-tcpundump is not set +# CONFIG_PACKAGE_openvswitch-ovsdb-client is not set +# CONFIG_PACKAGE_openvswitch-python is not set +# CONFIG_PACKAGE_openvswitch-vtep is not set + +# +# P2P +# +# CONFIG_PACKAGE_amule is not set +CONFIG_AMULE_CRYPTOPP_STATIC_LINKING=y + +# +# Printing +# +# CONFIG_PACKAGE_p910nd is not set + +# +# Routing and Redirection +# +# CONFIG_PACKAGE_babel-pinger is not set +# CONFIG_PACKAGE_babeld is not set +# CONFIG_PACKAGE_batmand is not set +# CONFIG_PACKAGE_bcp38 is not set +# CONFIG_PACKAGE_bird4 is not set +# CONFIG_PACKAGE_bird4-uci is not set +# CONFIG_PACKAGE_bird6 is not set +# CONFIG_PACKAGE_bird6-uci is not set +# CONFIG_PACKAGE_birdc4 is not set +# CONFIG_PACKAGE_birdc6 is not set +# CONFIG_PACKAGE_birdcl4 is not set +# CONFIG_PACKAGE_birdcl6 is not set +# CONFIG_PACKAGE_bmx6 is not set +# CONFIG_PACKAGE_bmx7 is not set +# CONFIG_PACKAGE_cjdns is not set +# CONFIG_PACKAGE_cjdns-tests is not set +# CONFIG_PACKAGE_genl is not set +# CONFIG_PACKAGE_igmpproxy is not set +# CONFIG_PACKAGE_ip-bridge is not set +# CONFIG_PACKAGE_ip-full is not set +# CONFIG_PACKAGE_ip-tiny is not set +# CONFIG_PACKAGE_lldpd is not set +# CONFIG_PACKAGE_mcproxy is not set +# CONFIG_PACKAGE_mwan3 is not set +# CONFIG_PACKAGE_nstat is not set +# CONFIG_PACKAGE_olsrd is not set +# CONFIG_PACKAGE_prince is not set +# CONFIG_PACKAGE_quagga is not set +# CONFIG_PACKAGE_relayd is not set +# CONFIG_PACKAGE_smcroute is not set +# CONFIG_PACKAGE_ss is not set +# CONFIG_PACKAGE_sslh is not set +# CONFIG_PACKAGE_tc is not set +# CONFIG_PACKAGE_tcpproxy is not set +# CONFIG_PACKAGE_vis is not set + +# +# SSH +# +# CONFIG_PACKAGE_autossh is not set +# CONFIG_PACKAGE_openssh-client is not set +# CONFIG_PACKAGE_openssh-client-utils is not set +# CONFIG_PACKAGE_openssh-keygen is not set +# CONFIG_PACKAGE_openssh-moduli is not set +# CONFIG_PACKAGE_openssh-server is not set +# CONFIG_PACKAGE_openssh-server-pam is not set +# CONFIG_PACKAGE_openssh-sftp-avahi-service is not set +# CONFIG_PACKAGE_openssh-sftp-client is not set +# CONFIG_PACKAGE_openssh-sftp-server is not set +# CONFIG_PACKAGE_sshtunnel is not set + +# +# THC-IPv6 attack and analyzing toolkit +# +# CONFIG_PACKAGE_thc-ipv6-address6 is not set +# CONFIG_PACKAGE_thc-ipv6-alive6 is not set +# CONFIG_PACKAGE_thc-ipv6-covert-send6 is not set +# CONFIG_PACKAGE_thc-ipv6-covert-send6d is not set +# CONFIG_PACKAGE_thc-ipv6-denial6 is not set +# CONFIG_PACKAGE_thc-ipv6-detect-new-ip6 is not set +# CONFIG_PACKAGE_thc-ipv6-detect-sniffer6 is not set +# CONFIG_PACKAGE_thc-ipv6-dnsdict6 is not set +# CONFIG_PACKAGE_thc-ipv6-dnsrevenum6 is not set +# CONFIG_PACKAGE_thc-ipv6-dos-new-ip6 is not set +# CONFIG_PACKAGE_thc-ipv6-dump-router6 is not set +# CONFIG_PACKAGE_thc-ipv6-exploit6 is not set +# CONFIG_PACKAGE_thc-ipv6-fake-advertise6 is not set +# CONFIG_PACKAGE_thc-ipv6-fake-dhcps6 is not set +# CONFIG_PACKAGE_thc-ipv6-fake-dns6d is not set +# CONFIG_PACKAGE_thc-ipv6-fake-dnsupdate6 is not set +# CONFIG_PACKAGE_thc-ipv6-fake-mipv6 is not set +# CONFIG_PACKAGE_thc-ipv6-fake-mld26 is not set +# CONFIG_PACKAGE_thc-ipv6-fake-mld6 is not set +# CONFIG_PACKAGE_thc-ipv6-fake-mldrouter6 is not set +# CONFIG_PACKAGE_thc-ipv6-fake-router26 is not set +# CONFIG_PACKAGE_thc-ipv6-fake-router6 is not set +# CONFIG_PACKAGE_thc-ipv6-fake-solicitate6 is not set +# CONFIG_PACKAGE_thc-ipv6-flood-advertise6 is not set +# CONFIG_PACKAGE_thc-ipv6-flood-dhcpc6 is not set +# CONFIG_PACKAGE_thc-ipv6-flood-mld26 is not set +# CONFIG_PACKAGE_thc-ipv6-flood-mld6 is not set +# CONFIG_PACKAGE_thc-ipv6-flood-mldrouter6 is not set +# CONFIG_PACKAGE_thc-ipv6-flood-router26 is not set +# CONFIG_PACKAGE_thc-ipv6-flood-router6 is not set +# CONFIG_PACKAGE_thc-ipv6-flood-solicitate6 is not set +# CONFIG_PACKAGE_thc-ipv6-fragmentation6 is not set +# CONFIG_PACKAGE_thc-ipv6-fuzz-dhcpc6 is not set +# CONFIG_PACKAGE_thc-ipv6-fuzz-dhcps6 is not set +# CONFIG_PACKAGE_thc-ipv6-fuzz-ip6 is not set +# CONFIG_PACKAGE_thc-ipv6-implementation6 is not set +# CONFIG_PACKAGE_thc-ipv6-implementation6d is not set +# CONFIG_PACKAGE_thc-ipv6-inverse-lookup6 is not set +# CONFIG_PACKAGE_thc-ipv6-kill-router6 is not set +# CONFIG_PACKAGE_thc-ipv6-ndpexhaust6 is not set +# CONFIG_PACKAGE_thc-ipv6-node-query6 is not set +# CONFIG_PACKAGE_thc-ipv6-parasite6 is not set +# CONFIG_PACKAGE_thc-ipv6-passive-discovery6 is not set +# CONFIG_PACKAGE_thc-ipv6-randicmp6 is not set +# CONFIG_PACKAGE_thc-ipv6-redir6 is not set +# CONFIG_PACKAGE_thc-ipv6-rsmurf6 is not set +# CONFIG_PACKAGE_thc-ipv6-sendpees6 is not set +# CONFIG_PACKAGE_thc-ipv6-sendpeesmp6 is not set +# CONFIG_PACKAGE_thc-ipv6-smurf6 is not set +# CONFIG_PACKAGE_thc-ipv6-thcping6 is not set +# CONFIG_PACKAGE_thc-ipv6-toobig6 is not set +# CONFIG_PACKAGE_thc-ipv6-trace6 is not set + +# +# Telephony +# +# CONFIG_PACKAGE_asterisk13 is not set +# CONFIG_PACKAGE_asterisk15 is not set +# CONFIG_PACKAGE_baresip is not set +# CONFIG_PACKAGE_freeswitch is not set +# CONFIG_PACKAGE_freeswitch-stable is not set +# CONFIG_PACKAGE_kamailio5 is not set +# CONFIG_PACKAGE_miax is not set +# CONFIG_PACKAGE_pcapsipdump is not set +# CONFIG_PACKAGE_restund is not set +# CONFIG_PACKAGE_rtpproxy is not set +# CONFIG_PACKAGE_sipp is not set +# CONFIG_PACKAGE_siproxd is not set +# CONFIG_PACKAGE_yate is not set + +# +# Time Synchronization +# +# CONFIG_PACKAGE_chrony is not set +# CONFIG_PACKAGE_htpdate is not set +# CONFIG_PACKAGE_linuxptp is not set +# CONFIG_PACKAGE_ntp-keygen is not set +# CONFIG_PACKAGE_ntp-utils is not set +# CONFIG_PACKAGE_ntpclient is not set +# CONFIG_PACKAGE_ntpd is not set +# CONFIG_PACKAGE_ntpdate is not set + +# +# VPN +# +# CONFIG_PACKAGE_chaosvpn is not set +# CONFIG_PACKAGE_fastd is not set +# CONFIG_PACKAGE_ipsec-tools is not set +# CONFIG_PACKAGE_n2n_v2 is not set +# CONFIG_PACKAGE_ocserv is not set +# CONFIG_PACKAGE_openconnect is not set +# CONFIG_PACKAGE_opennhrp is not set +# CONFIG_PACKAGE_openvpn-easy-rsa is not set +# CONFIG_PACKAGE_openvpn-mbedtls is not set +# CONFIG_PACKAGE_openvpn-nossl is not set +# CONFIG_PACKAGE_openvpn-openssl is not set +# CONFIG_PACKAGE_pptpd is not set +# CONFIG_PACKAGE_softethervpn is not set +# CONFIG_PACKAGE_sstp-client is not set +# CONFIG_PACKAGE_strongswan is not set +# CONFIG_PACKAGE_strongswan-charon is not set +# CONFIG_PACKAGE_strongswan-charon-cmd is not set +# CONFIG_PACKAGE_strongswan-default is not set +# CONFIG_PACKAGE_strongswan-ipsec is not set +# CONFIG_PACKAGE_strongswan-isakmp is not set +# CONFIG_PACKAGE_strongswan-libtls is not set +# CONFIG_PACKAGE_strongswan-minimal is not set +# CONFIG_PACKAGE_strongswan-mod-addrblock is not set +# CONFIG_PACKAGE_strongswan-mod-aes is not set +# CONFIG_PACKAGE_strongswan-mod-af-alg is not set +# CONFIG_PACKAGE_strongswan-mod-agent is not set +# CONFIG_PACKAGE_strongswan-mod-attr is not set +# CONFIG_PACKAGE_strongswan-mod-attr-sql is not set +# CONFIG_PACKAGE_strongswan-mod-blowfish is not set +# CONFIG_PACKAGE_strongswan-mod-ccm is not set +# CONFIG_PACKAGE_strongswan-mod-cmac is not set +# CONFIG_PACKAGE_strongswan-mod-connmark is not set +# CONFIG_PACKAGE_strongswan-mod-constraints is not set +# CONFIG_PACKAGE_strongswan-mod-coupling is not set +# CONFIG_PACKAGE_strongswan-mod-ctr is not set +# CONFIG_PACKAGE_strongswan-mod-curl is not set +# CONFIG_PACKAGE_strongswan-mod-curve25519 is not set +# CONFIG_PACKAGE_strongswan-mod-des is not set +# CONFIG_PACKAGE_strongswan-mod-dhcp is not set +# CONFIG_PACKAGE_strongswan-mod-dnskey is not set +# CONFIG_PACKAGE_strongswan-mod-duplicheck is not set +# CONFIG_PACKAGE_strongswan-mod-eap-identity is not set +# CONFIG_PACKAGE_strongswan-mod-eap-md5 is not set +# CONFIG_PACKAGE_strongswan-mod-eap-mschapv2 is not set +# CONFIG_PACKAGE_strongswan-mod-eap-radius is not set +# CONFIG_PACKAGE_strongswan-mod-eap-tls is not set +# CONFIG_PACKAGE_strongswan-mod-farp is not set +# CONFIG_PACKAGE_strongswan-mod-fips-prf is not set +# CONFIG_PACKAGE_strongswan-mod-forecast is not set +# CONFIG_PACKAGE_strongswan-mod-gcm is not set +# CONFIG_PACKAGE_strongswan-mod-gcrypt is not set +# CONFIG_PACKAGE_strongswan-mod-gmp is not set +# CONFIG_PACKAGE_strongswan-mod-gmpdh is not set +# CONFIG_PACKAGE_strongswan-mod-ha is not set +# CONFIG_PACKAGE_strongswan-mod-hmac is not set +# CONFIG_PACKAGE_strongswan-mod-kernel-libipsec is not set +# CONFIG_PACKAGE_strongswan-mod-kernel-netlink is not set +# CONFIG_PACKAGE_strongswan-mod-ldap is not set +# CONFIG_PACKAGE_strongswan-mod-led is not set +# CONFIG_PACKAGE_strongswan-mod-load-tester is not set +# CONFIG_PACKAGE_strongswan-mod-md4 is not set +# CONFIG_PACKAGE_strongswan-mod-md5 is not set +# CONFIG_PACKAGE_strongswan-mod-mysql is not set +# CONFIG_PACKAGE_strongswan-mod-nonce is not set +# CONFIG_PACKAGE_strongswan-mod-openssl is not set +# CONFIG_PACKAGE_strongswan-mod-pem is not set +# CONFIG_PACKAGE_strongswan-mod-pgp is not set +# CONFIG_PACKAGE_strongswan-mod-pkcs1 is not set +# CONFIG_PACKAGE_strongswan-mod-pkcs11 is not set +# CONFIG_PACKAGE_strongswan-mod-pkcs12 is not set +# CONFIG_PACKAGE_strongswan-mod-pkcs7 is not set +# CONFIG_PACKAGE_strongswan-mod-pkcs8 is not set +# CONFIG_PACKAGE_strongswan-mod-pubkey is not set +# CONFIG_PACKAGE_strongswan-mod-random is not set +# CONFIG_PACKAGE_strongswan-mod-rc2 is not set +# CONFIG_PACKAGE_strongswan-mod-resolve is not set +# CONFIG_PACKAGE_strongswan-mod-revocation is not set +# CONFIG_PACKAGE_strongswan-mod-sha1 is not set +# CONFIG_PACKAGE_strongswan-mod-sha2 is not set +# CONFIG_PACKAGE_strongswan-mod-smp is not set +# CONFIG_PACKAGE_strongswan-mod-socket-default is not set +# CONFIG_PACKAGE_strongswan-mod-socket-dynamic is not set +# CONFIG_PACKAGE_strongswan-mod-sql is not set +# CONFIG_PACKAGE_strongswan-mod-sqlite is not set +# CONFIG_PACKAGE_strongswan-mod-sshkey is not set +# CONFIG_PACKAGE_strongswan-mod-stroke is not set +# CONFIG_PACKAGE_strongswan-mod-test-vectors is not set +# CONFIG_PACKAGE_strongswan-mod-uci is not set +# CONFIG_PACKAGE_strongswan-mod-unity is not set +# CONFIG_PACKAGE_strongswan-mod-updown is not set +# CONFIG_PACKAGE_strongswan-mod-vici is not set +# CONFIG_PACKAGE_strongswan-mod-whitelist is not set +# CONFIG_PACKAGE_strongswan-mod-x509 is not set +# CONFIG_PACKAGE_strongswan-mod-xauth-eap is not set +# CONFIG_PACKAGE_strongswan-mod-xauth-generic is not set +# CONFIG_PACKAGE_strongswan-mod-xcbc is not set +# CONFIG_PACKAGE_strongswan-pki is not set +# CONFIG_PACKAGE_strongswan-scepclient is not set +# CONFIG_PACKAGE_strongswan-swanctl is not set +# CONFIG_PACKAGE_tinc is not set +# CONFIG_PACKAGE_uanytun is not set +# CONFIG_PACKAGE_uanytun-nettle is not set +# CONFIG_PACKAGE_uanytun-nocrypt is not set +# CONFIG_PACKAGE_uanytun-sslcrypt is not set +# CONFIG_PACKAGE_vpnc is not set +# CONFIG_PACKAGE_vpnc-scripts is not set +# CONFIG_PACKAGE_wireguard is not set +# CONFIG_PACKAGE_wireguard-tools is not set +# CONFIG_PACKAGE_xl2tpd is not set +# CONFIG_PACKAGE_zerotier is not set + +# +# Version Control Systems +# +# CONFIG_PACKAGE_fossil is not set +# CONFIG_PACKAGE_git is not set +# CONFIG_PACKAGE_git-http is not set +# CONFIG_PACKAGE_subversion-client is not set +# CONFIG_PACKAGE_subversion-libs is not set +# CONFIG_PACKAGE_subversion-server is not set + +# +# WWAN +# +# CONFIG_PACKAGE_comgt is not set +# CONFIG_PACKAGE_comgt-directip is not set +# CONFIG_PACKAGE_comgt-ncm is not set +# CONFIG_PACKAGE_uqmi is not set + +# +# Web Servers/Proxies +# +# CONFIG_PACKAGE_apache is not set +# CONFIG_PACKAGE_cgi-io is not set +# CONFIG_PACKAGE_clamav is not set +# CONFIG_PACKAGE_e2guardian is not set +# CONFIG_PACKAGE_freshclam is not set +# CONFIG_PACKAGE_haproxy is not set +# CONFIG_PACKAGE_haproxy-nossl is not set +# CONFIG_PACKAGE_lighttpd is not set +# CONFIG_PACKAGE_nginx is not set +# CONFIG_PACKAGE_ngrokc is not set +# CONFIG_PACKAGE_pdnsd-alt is not set +# CONFIG_PACKAGE_polipo is not set +# CONFIG_PACKAGE_privoxy is not set +# CONFIG_PACKAGE_radicale-py2 is not set +# CONFIG_PACKAGE_radicale-py3 is not set +# CONFIG_PACKAGE_shadowsocks-client is not set +# CONFIG_PACKAGE_shadowsocks-libev-config is not set +# CONFIG_PACKAGE_shadowsocks-libev-ss-local is not set +# CONFIG_PACKAGE_shadowsocks-libev-ss-redir is not set +# CONFIG_PACKAGE_shadowsocks-libev-ss-rules is not set +# CONFIG_PACKAGE_shadowsocks-libev-ss-server is not set +# CONFIG_PACKAGE_shadowsocks-libev-ss-tunnel is not set +# CONFIG_PACKAGE_sockd is not set +# CONFIG_PACKAGE_socksify is not set +# CONFIG_PACKAGE_spawn-fcgi is not set +# CONFIG_PACKAGE_squid is not set +# CONFIG_PACKAGE_tinyproxy is not set +# CONFIG_PACKAGE_uhttpd is not set +# CONFIG_PACKAGE_uhttpd_debug is not set + +# +# dial-in/up +# +# CONFIG_PACKAGE_rp-pppoe-common is not set +# CONFIG_PACKAGE_rp-pppoe-relay is not set +# CONFIG_PACKAGE_rp-pppoe-server is not set + +# +# tcprelay +# +# CONFIG_PACKAGE_tcpbridge is not set +# CONFIG_PACKAGE_tcpcapinfo is not set +# CONFIG_PACKAGE_tcpliveplay is not set +# CONFIG_PACKAGE_tcpprep is not set +# CONFIG_PACKAGE_tcpreplay is not set +# CONFIG_PACKAGE_tcpreplay-all is not set +# CONFIG_PACKAGE_tcpreplay-edit is not set +# CONFIG_PACKAGE_tcprewrite is not set + +# +# wireless +# +# CONFIG_PACKAGE_aircrack-ng is not set +# CONFIG_PACKAGE_airmon-ng is not set +# CONFIG_PACKAGE_dynapoint is not set +# CONFIG_PACKAGE_horst is not set +# CONFIG_PACKAGE_kismet-client is not set +# CONFIG_PACKAGE_kismet-drone is not set +# CONFIG_PACKAGE_kismet-server is not set +# CONFIG_PACKAGE_pixiewps is not set +# CONFIG_PACKAGE_reaver is not set +# CONFIG_PACKAGE_wavemon is not set +# CONFIG_PACKAGE_wifischedule is not set +# CONFIG_PACKAGE_464xlat is not set +# CONFIG_PACKAGE_6in4 is not set +# CONFIG_PACKAGE_6rd is not set +# CONFIG_PACKAGE_6to4 is not set +# CONFIG_PACKAGE_acme is not set +# CONFIG_PACKAGE_adblock is not set +# CONFIG_PACKAGE_adbyby is not set +# CONFIG_PACKAGE_addrwatch is not set +# CONFIG_PACKAGE_ahcpd is not set +# CONFIG_PACKAGE_alfred is not set +# CONFIG_PACKAGE_apcupsd is not set +# CONFIG_PACKAGE_apcupsd-cgi is not set +# CONFIG_PACKAGE_apinger is not set +# CONFIG_PACKAGE_arp-scan is not set +# CONFIG_PACKAGE_authsae is not set +# CONFIG_PACKAGE_batctl is not set +# CONFIG_PACKAGE_beanstalkd is not set +# CONFIG_PACKAGE_bmon is not set +# CONFIG_PACKAGE_bwm-ng is not set +# CONFIG_PACKAGE_chat is not set +# CONFIG_PACKAGE_cifsmount is not set +# CONFIG_PACKAGE_coap-server is not set +# CONFIG_PACKAGE_conserver is not set +# CONFIG_PACKAGE_cshark is not set +# CONFIG_PACKAGE_daemonlogger is not set +# CONFIG_PACKAGE_darkstat is not set +# CONFIG_PACKAGE_dhcpcd is not set +# CONFIG_PACKAGE_dmapd is not set +# CONFIG_PACKAGE_dogcom is not set +# CONFIG_PACKAGE_ds-lite is not set +# CONFIG_PACKAGE_eapol-test is not set +# CONFIG_PACKAGE_esniper is not set +# CONFIG_PACKAGE_etherwake is not set +# CONFIG_PACKAGE_ethtool is not set +# CONFIG_PACKAGE_fakeidentd is not set +# CONFIG_PACKAGE_fping is not set +# CONFIG_PACKAGE_frpc is not set +# CONFIG_PACKAGE_gnunet is not set +# CONFIG_PACKAGE_gre is not set +# CONFIG_PACKAGE_hnet-full is not set +# CONFIG_PACKAGE_hnet-full-l2tp is not set +# CONFIG_PACKAGE_hnet-full-secure is not set +# CONFIG_PACKAGE_hnetd-nossl is not set +# CONFIG_PACKAGE_hnetd-openssl is not set +# CONFIG_PACKAGE_hostapd is not set +CONFIG_PACKAGE_hostapd-common=y +# CONFIG_PACKAGE_hostapd-mini is not set +# CONFIG_PACKAGE_hostapd-utils is not set +# CONFIG_PACKAGE_httping is not set +# CONFIG_PACKAGE_httping-nossl is not set +# CONFIG_PACKAGE_https_dns_proxy is not set +# CONFIG_PACKAGE_i2pd is not set +# CONFIG_PACKAGE_ibrdtn-tools is not set +# CONFIG_PACKAGE_ibrdtnd is not set +# CONFIG_PACKAGE_ifstat is not set +# CONFIG_PACKAGE_iftop is not set +# CONFIG_PACKAGE_iiod is not set +# CONFIG_PACKAGE_iotivity is not set +# CONFIG_PACKAGE_iotivity-cpp is not set +# CONFIG_PACKAGE_iotivity-example-garage is not set +# CONFIG_PACKAGE_iotivity-example-simple is not set +# CONFIG_PACKAGE_iotivity-oic-middle is not set +# CONFIG_PACKAGE_iotivity-resource-container-hue is not set +# CONFIG_PACKAGE_iotivity-resource-container-lib is not set +# CONFIG_PACKAGE_iotivity-resource-container-sample is not set +# CONFIG_PACKAGE_iotivity-resource-directory-lib is not set +# CONFIG_PACKAGE_iperf is not set +# CONFIG_PACKAGE_iperf3 is not set +# CONFIG_PACKAGE_ipip is not set +# CONFIG_PACKAGE_ipset is not set +# CONFIG_PACKAGE_ipset-dns is not set +# CONFIG_PACKAGE_ipset-lists is not set +# CONFIG_PACKAGE_iptraf-ng is not set +# CONFIG_PACKAGE_iputils-arping is not set +# CONFIG_PACKAGE_iputils-clockdiff is not set +# CONFIG_PACKAGE_iputils-ping is not set +# CONFIG_PACKAGE_iputils-ping6 is not set +# CONFIG_PACKAGE_iputils-tftpd is not set +# CONFIG_PACKAGE_iputils-tracepath is not set +# CONFIG_PACKAGE_iputils-tracepath6 is not set +# CONFIG_PACKAGE_iputils-traceroute6 is not set +CONFIG_PACKAGE_iw=y +# CONFIG_PACKAGE_jool is not set +# CONFIG_PACKAGE_jool-tools is not set +# CONFIG_PACKAGE_keepalived is not set +# CONFIG_PACKAGE_knxd is not set +# CONFIG_PACKAGE_kplex is not set +# CONFIG_PACKAGE_krb5-client is not set +# CONFIG_PACKAGE_krb5-libs is not set +# CONFIG_PACKAGE_krb5-server is not set +# CONFIG_PACKAGE_linknx is not set +# CONFIG_PACKAGE_lispd is not set +# CONFIG_PACKAGE_mac-telnet-client is not set +# CONFIG_PACKAGE_mac-telnet-discover is not set +# CONFIG_PACKAGE_mac-telnet-ping is not set +# CONFIG_PACKAGE_mac-telnet-server is not set +# CONFIG_PACKAGE_map is not set +# CONFIG_PACKAGE_map-t is not set +# CONFIG_PACKAGE_memcached is not set +# CONFIG_PACKAGE_mii-tool is not set +# CONFIG_PACKAGE_mikrotik-btest is not set +# CONFIG_PACKAGE_mini_snmpd is not set +# CONFIG_PACKAGE_minimalist-pcproxy is not set +# CONFIG_PACKAGE_mosquitto-client-nossl is not set +# CONFIG_PACKAGE_mosquitto-client-ssl is not set +# CONFIG_PACKAGE_mosquitto-nossl is not set +# CONFIG_PACKAGE_mosquitto-ssl is not set +# CONFIG_PACKAGE_mproxy is not set +# CONFIG_PACKAGE_mrd6 is not set +# CONFIG_PACKAGE_mtr is not set +# CONFIG_PACKAGE_nbd is not set +# CONFIG_PACKAGE_nbd-server is not set +# CONFIG_PACKAGE_ncp is not set +# CONFIG_PACKAGE_ndppd is not set +# CONFIG_PACKAGE_netcat is not set +# CONFIG_PACKAGE_netdiscover is not set +# CONFIG_PACKAGE_netperf is not set +# CONFIG_PACKAGE_nlbwmon is not set +# CONFIG_PACKAGE_noddos is not set +# CONFIG_PACKAGE_noping is not set +# CONFIG_PACKAGE_nut is not set +# CONFIG_PACKAGE_obfsproxy is not set +# CONFIG_PACKAGE_odhcp6c is not set +# CONFIG_PACKAGE_odhcpd is not set +# CONFIG_PACKAGE_ola is not set +# CONFIG_PACKAGE_omcproxy is not set +# CONFIG_PACKAGE_openldap-server is not set +# CONFIG_PACKAGE_oscam is not set +# CONFIG_PACKAGE_oping is not set +# CONFIG_PACKAGE_pen is not set +# CONFIG_PACKAGE_pimbd is not set +# CONFIG_PACKAGE_pingcheck is not set +# CONFIG_PACKAGE_port-mirroring is not set +# CONFIG_PACKAGE_portmap is not set +CONFIG_PACKAGE_ppp=y +# CONFIG_PACKAGE_ppp-mod-passwordfd is not set +# CONFIG_PACKAGE_ppp-mod-pppoa is not set +CONFIG_PACKAGE_ppp-mod-pppoe=y +# CONFIG_PACKAGE_ppp-mod-pppol2tp is not set +# CONFIG_PACKAGE_ppp-mod-pptp is not set +# CONFIG_PACKAGE_ppp-mod-radius is not set +# CONFIG_PACKAGE_ppp-multilink is not set +# CONFIG_PACKAGE_pppdump is not set +# CONFIG_PACKAGE_pppoe-discovery is not set +# CONFIG_PACKAGE_pppossh is not set +# CONFIG_PACKAGE_pppstats is not set +# CONFIG_PACKAGE_radsecproxy is not set +# CONFIG_PACKAGE_redsocks is not set +# CONFIG_PACKAGE_remserial is not set +# CONFIG_PACKAGE_rssileds is not set +# CONFIG_PACKAGE_rsyslog is not set +# CONFIG_PACKAGE_samba36-client is not set +# CONFIG_PACKAGE_samba36-server is not set +# CONFIG_PACKAGE_scapy is not set +# CONFIG_PACKAGE_sctp is not set +# CONFIG_PACKAGE_sctp-tools is not set +# CONFIG_PACKAGE_seafile-ccnet is not set +# CONFIG_PACKAGE_seafile-seahub is not set +# CONFIG_PACKAGE_seafile-server is not set +# CONFIG_PACKAGE_ser2net is not set +# CONFIG_PACKAGE_shadowsocksr-libev is not set +# CONFIG_PACKAGE_shadowsocksr-libev-alt is not set +# CONFIG_PACKAGE_shadowsocksr-libev-gfwlist is not set +# CONFIG_PACKAGE_shadowsocksr-libev-gfwlist-4M is not set +# CONFIG_PACKAGE_shadowsocksr-libev-gfwlist-polarssl is not set +# CONFIG_PACKAGE_shadowsocksr-libev-mini is not set +# CONFIG_PACKAGE_shadowsocksr-libev-polarssl is not set +# CONFIG_PACKAGE_simple-adblock is not set +# CONFIG_PACKAGE_sipgrep is not set +# CONFIG_PACKAGE_smartsnmpd is not set +# CONFIG_PACKAGE_sngrep is not set +# CONFIG_PACKAGE_snmp-mibs is not set +# CONFIG_PACKAGE_snmp-utils is not set +# CONFIG_PACKAGE_snmpd is not set +# CONFIG_PACKAGE_snmpd-static is not set +# CONFIG_PACKAGE_snmptrapd is not set +# CONFIG_PACKAGE_socat is not set +# CONFIG_PACKAGE_softflowd is not set +# CONFIG_PACKAGE_soloscli is not set +# CONFIG_PACKAGE_stunnel is not set +# CONFIG_PACKAGE_tayga is not set +# CONFIG_PACKAGE_tcpdump is not set +# CONFIG_PACKAGE_tcpdump-mini is not set +# CONFIG_PACKAGE_tor is not set +# CONFIG_PACKAGE_tor-gencert is not set +# CONFIG_PACKAGE_tor-geoip is not set +# CONFIG_PACKAGE_tor-resolve is not set +# CONFIG_PACKAGE_travelmate is not set +# CONFIG_PACKAGE_u2pnpd is not set +CONFIG_PACKAGE_uclient-fetch=y +# CONFIG_PACKAGE_udp2raw-tunnel is not set +# CONFIG_PACKAGE_udpxy is not set +# CONFIG_PACKAGE_ulogd is not set +# CONFIG_PACKAGE_umbim is not set +# CONFIG_PACKAGE_umdns is not set +# CONFIG_PACKAGE_usbip is not set +# CONFIG_PACKAGE_vallumd is not set +# CONFIG_PACKAGE_vlmcsd is not set +# CONFIG_PACKAGE_vncrepeater is not set +# CONFIG_PACKAGE_vnstat is not set +# CONFIG_PACKAGE_vpnbypass is not set +# CONFIG_PACKAGE_vsc7385-ucode-pb44 is not set +# CONFIG_PACKAGE_vsc7395-ucode-pb44 is not set +# CONFIG_PACKAGE_vti is not set +# CONFIG_PACKAGE_wakeonlan is not set +# CONFIG_PACKAGE_wpa-cli is not set +# CONFIG_PACKAGE_wpa-supplicant is not set +# CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK is not set +# CONFIG_WPA_RFKILL_SUPPORT is not set +CONFIG_WPA_MSG_MIN_PRIORITY=3 +# CONFIG_DRIVER_WEXT_SUPPORT is not set +CONFIG_DRIVER_11N_SUPPORT=y +# CONFIG_DRIVER_11AC_SUPPORT is not set +CONFIG_DRIVER_11W_SUPPORT=y +# CONFIG_PACKAGE_wpa-supplicant-mesh is not set +# CONFIG_PACKAGE_wpa-supplicant-mini is not set +# CONFIG_PACKAGE_wpa-supplicant-p2p is not set +# CONFIG_PACKAGE_wpad is not set +# CONFIG_PACKAGE_wpad-mesh is not set +CONFIG_PACKAGE_wpad-mini=y +# CONFIG_PACKAGE_wpan-tools is not set +# CONFIG_PACKAGE_wwan is not set +# CONFIG_PACKAGE_xinetd is not set + +# +# Sound +# +# CONFIG_PACKAGE_alsa-utils is not set +# CONFIG_PACKAGE_alsa-utils-seq is not set +# CONFIG_PACKAGE_alsa-utils-tests is not set +# CONFIG_PACKAGE_espeak is not set +# CONFIG_PACKAGE_faad2 is not set +# CONFIG_PACKAGE_fdk-aac is not set +# CONFIG_PACKAGE_forked-daapd is not set +# CONFIG_PACKAGE_ices is not set +# CONFIG_PACKAGE_lame is not set +# CONFIG_PACKAGE_lame-lib is not set +# CONFIG_PACKAGE_liblo-utils is not set +# CONFIG_PACKAGE_madplay is not set +# CONFIG_PACKAGE_madplay-alsa is not set +# CONFIG_PACKAGE_moc is not set +# CONFIG_PACKAGE_mpc is not set +# CONFIG_PACKAGE_mpd-avahi-service is not set +# CONFIG_PACKAGE_mpd-full is not set +# CONFIG_PACKAGE_mpd-mini is not set +# CONFIG_PACKAGE_mpg123 is not set +# CONFIG_PACKAGE_opus-tools is not set +# CONFIG_PACKAGE_pianod is not set +# CONFIG_PACKAGE_pianod-client is not set +# CONFIG_PACKAGE_portaudio is not set +# CONFIG_PACKAGE_pulseaudio-daemon is not set +# CONFIG_PACKAGE_pulseaudio-profiles is not set +# CONFIG_PACKAGE_pulseaudio-tools is not set +# CONFIG_PACKAGE_shairplay is not set +# CONFIG_PACKAGE_shairport-sync-mbedtls is not set +# CONFIG_PACKAGE_shairport-sync-mini is not set +# CONFIG_PACKAGE_shairport-sync-openssl is not set +# CONFIG_PACKAGE_shine is not set +# CONFIG_PACKAGE_sox is not set +# CONFIG_PACKAGE_squeezelite-full is not set +# CONFIG_PACKAGE_squeezelite-mini is not set +# CONFIG_PACKAGE_svox is not set +# CONFIG_PACKAGE_upmpdcli is not set + +# +# Utilities +# + +# +# Boot Loaders +# +# CONFIG_PACKAGE_fconfig is not set +# CONFIG_PACKAGE_rbcfg is not set +CONFIG_PACKAGE_uboot-envtools=y +# CONFIG_UBOOT_ENVTOOLS_UBI is not set + +# +# Compression +# +# CONFIG_PACKAGE_bsdtar is not set +# CONFIG_PACKAGE_bzip2 is not set +# CONFIG_PACKAGE_gzip is not set +# CONFIG_PACKAGE_unrar is not set +# CONFIG_PACKAGE_unzip is not set +# CONFIG_PACKAGE_xz-utils is not set +# CONFIG_PACKAGE_zip is not set + +# +# Disc +# +# CONFIG_PACKAGE_blkdiscard is not set +# CONFIG_PACKAGE_blkid is not set +# CONFIG_PACKAGE_cfdisk is not set +# CONFIG_PACKAGE_fdisk is not set +# CONFIG_PACKAGE_findfs is not set +# CONFIG_PACKAGE_hd-idle is not set +# CONFIG_PACKAGE_hdparm is not set +# CONFIG_PACKAGE_lsblk is not set +# CONFIG_PACKAGE_lvm2 is not set +# CONFIG_PACKAGE_mdadm is not set +# CONFIG_PACKAGE_partx-utils is not set +# CONFIG_PACKAGE_sfdisk is not set +# CONFIG_PACKAGE_wipefs is not set + +# +# Editors +# +# CONFIG_PACKAGE_joe is not set +# CONFIG_PACKAGE_nano is not set +# CONFIG_PACKAGE_vim is not set +# CONFIG_PACKAGE_vim-full is not set +# CONFIG_PACKAGE_vim-fuller is not set +# CONFIG_PACKAGE_vim-help is not set +# CONFIG_PACKAGE_vim-runtime is not set +# CONFIG_PACKAGE_zile is not set + +# +# Encryption +# +# CONFIG_PACKAGE_ccrypt is not set +# CONFIG_PACKAGE_certtool is not set +# CONFIG_PACKAGE_cryptsetup is not set +# CONFIG_PACKAGE_cryptsetup-openssl is not set +# CONFIG_PACKAGE_gnupg is not set +# CONFIG_PACKAGE_gnutls-utils is not set +# CONFIG_PACKAGE_gpgv is not set +# CONFIG_PACKAGE_px5g-mbedtls is not set +# CONFIG_PACKAGE_px5g-standalone is not set +# CONFIG_PACKAGE_stoken is not set + +# +# Filesystem +# +# CONFIG_PACKAGE_acl is not set +# CONFIG_PACKAGE_attr is not set +# CONFIG_PACKAGE_badblocks is not set +# CONFIG_PACKAGE_btrfs-progs is not set +# CONFIG_PACKAGE_chattr is not set +# CONFIG_PACKAGE_debugfs is not set +# CONFIG_PACKAGE_dosfstools is not set +# CONFIG_PACKAGE_dumpe2fs is not set +# CONFIG_PACKAGE_e2freefrag is not set +# CONFIG_PACKAGE_e2fsprogs is not set +# CONFIG_PACKAGE_f2fs-tools is not set +# CONFIG_PACKAGE_f2fsck is not set +# CONFIG_PACKAGE_filefrag is not set +# CONFIG_PACKAGE_fuse-utils is not set +# CONFIG_PACKAGE_hfsfsck is not set +# CONFIG_PACKAGE_lsattr is not set +# CONFIG_PACKAGE_mkf2fs is not set +# CONFIG_PACKAGE_mkhfs is not set +# CONFIG_PACKAGE_ncdu is not set +# CONFIG_PACKAGE_nfs-utils is not set +# CONFIG_PACKAGE_ntfs-3g is not set +# CONFIG_PACKAGE_ntfs-3g-low is not set +# CONFIG_PACKAGE_ntfs-3g-utils is not set +# CONFIG_PACKAGE_owfs is not set +# CONFIG_PACKAGE_owshell is not set +# CONFIG_PACKAGE_resize2fs is not set +# CONFIG_PACKAGE_squashfs-tools-mksquashfs is not set +# CONFIG_PACKAGE_squashfs-tools-unsquashfs is not set +# CONFIG_PACKAGE_swap-utils is not set +# CONFIG_PACKAGE_sysfsutils is not set +# CONFIG_PACKAGE_tune2fs is not set +# CONFIG_PACKAGE_xfs-fsck is not set +# CONFIG_PACKAGE_xfs-growfs is not set +# CONFIG_PACKAGE_xfs-mkfs is not set + +# +# Image Manipulation +# +# CONFIG_PACKAGE_jpeg-tools is not set +# CONFIG_PACKAGE_tiff-utils is not set + +# +# Luci +# +# CONFIG_PACKAGE_luci-app-haproxy-tcp is not set + +# +# Microcontroller programming +# +# CONFIG_PACKAGE_avrdude is not set +# CONFIG_PACKAGE_dfu-programmer is not set +# CONFIG_PACKAGE_stm32flash is not set + +# +# RTKLIB Suite +# +# CONFIG_PACKAGE_convbin is not set +# CONFIG_PACKAGE_pos2kml is not set +# CONFIG_PACKAGE_rnx2rtkp is not set +# CONFIG_PACKAGE_rtkrcv is not set +# CONFIG_PACKAGE_str2str is not set + +# +# Shells +# +# CONFIG_PACKAGE_bash is not set +# CONFIG_PACKAGE_klish is not set +# CONFIG_PACKAGE_tcsh is not set +# CONFIG_PACKAGE_zsh is not set + +# +# Telephony +# +# CONFIG_PACKAGE_dahdi-cfg is not set +# CONFIG_PACKAGE_dahdi-monitor is not set +# CONFIG_PACKAGE_gsm-utils is not set + +# +# Terminal +# +# CONFIG_PACKAGE_agetty is not set +# CONFIG_PACKAGE_dvtm is not set +# CONFIG_PACKAGE_minicom is not set +# CONFIG_PACKAGE_picocom is not set +# CONFIG_PACKAGE_screen is not set +# CONFIG_PACKAGE_script-utils is not set +# CONFIG_PACKAGE_serialconsole is not set +# CONFIG_PACKAGE_setterm is not set +# CONFIG_PACKAGE_tio is not set +# CONFIG_PACKAGE_tmux is not set +# CONFIG_PACKAGE_ttyd is not set +# CONFIG_PACKAGE_wall is not set + +# +# Virtualization +# + +# +# Zoneinfo +# +# CONFIG_PACKAGE_zoneinfo-africa is not set +# CONFIG_PACKAGE_zoneinfo-asia is not set +# CONFIG_PACKAGE_zoneinfo-atlantic is not set +# CONFIG_PACKAGE_zoneinfo-australia-nz is not set +# CONFIG_PACKAGE_zoneinfo-core is not set +# CONFIG_PACKAGE_zoneinfo-europe is not set +# CONFIG_PACKAGE_zoneinfo-india is not set +# CONFIG_PACKAGE_zoneinfo-northamerica is not set +# CONFIG_PACKAGE_zoneinfo-pacific is not set +# CONFIG_PACKAGE_zoneinfo-poles is not set +# CONFIG_PACKAGE_zoneinfo-simple is not set +# CONFIG_PACKAGE_zoneinfo-southamerica is not set + +# +# database +# +# CONFIG_PACKAGE_mysql-server is not set +# CONFIG_PACKAGE_pgsql-cli is not set +# CONFIG_PACKAGE_pgsql-cli-extra is not set +# CONFIG_PACKAGE_pgsql-server is not set +# CONFIG_PACKAGE_rrdcgi1 is not set +# CONFIG_PACKAGE_rrdtool1 is not set +# CONFIG_PACKAGE_sqlite3-cli is not set +# CONFIG_PACKAGE_unixodbc-tools is not set +# CONFIG_PACKAGE_adb is not set +# CONFIG_PACKAGE_ap51-flash is not set +# CONFIG_PACKAGE_at is not set +# CONFIG_PACKAGE_bandwidthd is not set +# CONFIG_PACKAGE_bandwidthd-pgsql is not set +# CONFIG_PACKAGE_bandwidthd-php is not set +# CONFIG_PACKAGE_bandwidthd-sqlite is not set +# CONFIG_PACKAGE_banhostlist is not set +# CONFIG_PACKAGE_bc is not set +# CONFIG_PACKAGE_bluelog is not set +# CONFIG_PACKAGE_bluez-daemon is not set +# CONFIG_PACKAGE_bluez-examples is not set +# CONFIG_PACKAGE_bluez-utils is not set +# CONFIG_PACKAGE_bonniexx is not set +# CONFIG_PACKAGE_bsdiff is not set +# CONFIG_PACKAGE_bspatch is not set +# CONFIG_PACKAGE_cal is not set +# CONFIG_PACKAGE_canutils is not set +# CONFIG_PACKAGE_cmdpad is not set +# CONFIG_PACKAGE_coap-client is not set +# CONFIG_PACKAGE_collectd is not set +# CONFIG_PACKAGE_coreutils is not set +# CONFIG_PACKAGE_crconf is not set +# CONFIG_PACKAGE_crelay is not set +# CONFIG_PACKAGE_ct-bugcheck is not set +# CONFIG_PACKAGE_dbus is not set +# CONFIG_PACKAGE_dfu-util is not set +# CONFIG_PACKAGE_digitemp is not set +# CONFIG_PACKAGE_digitemp-usb is not set +# CONFIG_PACKAGE_dmesg is not set +# CONFIG_PACKAGE_dropbearconvert is not set +# CONFIG_PACKAGE_dtc is not set +# CONFIG_PACKAGE_dump1090 is not set +# CONFIG_PACKAGE_ecdsautils is not set +# CONFIG_PACKAGE_elektra-kdb is not set +# CONFIG_PACKAGE_evtest is not set +# CONFIG_PACKAGE_extract is not set +# CONFIG_PACKAGE_file is not set +# CONFIG_PACKAGE_findutils-find is not set +# CONFIG_PACKAGE_findutils-locate is not set +# CONFIG_PACKAGE_findutils-xargs is not set +# CONFIG_PACKAGE_flashrom is not set +# CONFIG_PACKAGE_flashrom-pci is not set +# CONFIG_PACKAGE_flashrom-spi is not set +# CONFIG_PACKAGE_flashrom-usb is not set +# CONFIG_PACKAGE_flent-tools is not set +# CONFIG_PACKAGE_flock is not set +# CONFIG_PACKAGE_ftdi_eeprom is not set +# CONFIG_PACKAGE_gammu is not set +# CONFIG_PACKAGE_gawk is not set +# CONFIG_PACKAGE_getopt is not set +# CONFIG_PACKAGE_gkermit is not set +# CONFIG_PACKAGE_gpioctl-sysfs is not set +# CONFIG_PACKAGE_gpsd is not set +# CONFIG_PACKAGE_gpsd-clients is not set +# CONFIG_PACKAGE_grep is not set +# CONFIG_PACKAGE_hamlib is not set +# CONFIG_PACKAGE_haserl is not set +# CONFIG_PACKAGE_haveged is not set +# CONFIG_PACKAGE_hub-ctrl is not set +# CONFIG_PACKAGE_hwclock is not set +# CONFIG_PACKAGE_i2c-tools is not set +# CONFIG_PACKAGE_iconv is not set +# CONFIG_PACKAGE_iio-utils is not set +# CONFIG_PACKAGE_io is not set +# CONFIG_PACKAGE_irqbalance is not set +# CONFIG_PACKAGE_iwcap is not set +CONFIG_PACKAGE_iwinfo=y +# CONFIG_PACKAGE_jq is not set +CONFIG_PACKAGE_jshn=y +# CONFIG_PACKAGE_kexec-tools is not set +# CONFIG_PACKAGE_kmod is not set +# CONFIG_PACKAGE_lcd4linux-custom is not set +# CONFIG_PACKAGE_lcdproc-clients is not set +# CONFIG_PACKAGE_lcdproc-drivers is not set +# CONFIG_PACKAGE_lcdproc-server is not set +# CONFIG_PACKAGE_less is not set +# CONFIG_PACKAGE_less-wide is not set +# CONFIG_PACKAGE_libimobiledevice-utils is not set +CONFIG_PACKAGE_libjson-script=y +# CONFIG_PACKAGE_libplist-utils is not set +# CONFIG_PACKAGE_libsysrepo is not set +# CONFIG_PACKAGE_libusbmuxd-utils is not set +# CONFIG_PACKAGE_lm-sensors is not set +# CONFIG_PACKAGE_lm-sensors-detect is not set +# CONFIG_PACKAGE_logger is not set +# CONFIG_PACKAGE_logrotate is not set +# CONFIG_PACKAGE_look is not set +# CONFIG_PACKAGE_losetup is not set +# CONFIG_PACKAGE_lrzsz is not set +# CONFIG_PACKAGE_lsof is not set +# CONFIG_PACKAGE_lxc is not set +# CONFIG_PACKAGE_lxc-unprivileged is not set +# CONFIG_PACKAGE_maccalc is not set +# CONFIG_PACKAGE_macchanger is not set +# CONFIG_PACKAGE_mbtools is not set +# CONFIG_PACKAGE_mc is not set +# CONFIG_PACKAGE_mcookie is not set +# CONFIG_PACKAGE_mmc-utils is not set +# CONFIG_PACKAGE_moreutils is not set +# CONFIG_PACKAGE_mount-utils is not set +# CONFIG_PACKAGE_mountd is not set +# CONFIG_PACKAGE_mpack is not set +# CONFIG_PACKAGE_mt-st is not set +# CONFIG_PACKAGE_namei is not set +# CONFIG_PACKAGE_netopeer2-cli is not set +# CONFIG_PACKAGE_netopeer2-keystored is not set +# CONFIG_PACKAGE_netopeer2-server is not set +# CONFIG_PACKAGE_netwhere is not set +# CONFIG_PACKAGE_oath-toolkit is not set +# CONFIG_PACKAGE_open-plc-utils is not set +# CONFIG_PACKAGE_open2300 is not set +# CONFIG_PACKAGE_openldap-utils is not set +# CONFIG_PACKAGE_openobex is not set +# CONFIG_PACKAGE_openobex-apps is not set +# CONFIG_PACKAGE_openocd is not set +# CONFIG_PACKAGE_opensc-utils is not set +# CONFIG_PACKAGE_openssl-util is not set +# CONFIG_PACKAGE_openzwave is not set +# CONFIG_PACKAGE_openzwave-config is not set +# CONFIG_PACKAGE_owipcalc is not set +# CONFIG_PACKAGE_pciutils is not set +# CONFIG_PACKAGE_pcsc-tools is not set +# CONFIG_PACKAGE_pcscd is not set +# CONFIG_PACKAGE_pps-tools is not set +# CONFIG_PACKAGE_prlimit is not set +# CONFIG_PACKAGE_procps-ng is not set +# CONFIG_PACKAGE_progress is not set +# CONFIG_PACKAGE_prometheus-node-exporter-lua is not set +# CONFIG_PACKAGE_pv is not set +# CONFIG_PACKAGE_qrencode is not set +# CONFIG_PACKAGE_relayctl is not set +# CONFIG_PACKAGE_rename is not set +# CONFIG_PACKAGE_rng-tools is not set +# CONFIG_PACKAGE_rtl-ais is not set +# CONFIG_PACKAGE_rtl-sdr is not set +# CONFIG_PACKAGE_rtl_433 is not set +# CONFIG_PACKAGE_sane-backends is not set +# CONFIG_PACKAGE_sane-daemon is not set +# CONFIG_PACKAGE_sane-frontends is not set +# CONFIG_PACKAGE_setserial is not set +# CONFIG_PACKAGE_shadow-utils is not set +CONFIG_PACKAGE_shellsync=y +# CONFIG_PACKAGE_sispmctl is not set +# CONFIG_PACKAGE_slide-switch is not set +# CONFIG_PACKAGE_smartd is not set +# CONFIG_PACKAGE_smartmontools is not set +# CONFIG_PACKAGE_smstools3 is not set +# CONFIG_PACKAGE_sockread is not set +# CONFIG_PACKAGE_spi-tools is not set +# CONFIG_PACKAGE_spidev-test is not set +# CONFIG_PACKAGE_strace is not set +# CONFIG_PACKAGE_strace_libunwind is not set +# CONFIG_PACKAGE_stress is not set +# CONFIG_PACKAGE_sumo is not set +# CONFIG_PACKAGE_sysrepo is not set +# CONFIG_PACKAGE_sysrepocfg is not set +# CONFIG_PACKAGE_sysrepoctl is not set +# CONFIG_PACKAGE_sysstat is not set +# CONFIG_PACKAGE_tar is not set +# CONFIG_PACKAGE_taskwarrior is not set +# CONFIG_PACKAGE_tracertools is not set +# CONFIG_PACKAGE_tree is not set +# CONFIG_PACKAGE_triggerhappy is not set +# CONFIG_PACKAGE_udns-dnsget is not set +# CONFIG_PACKAGE_udns-ex-rdns is not set +# CONFIG_PACKAGE_udns-rblcheck is not set +# CONFIG_PACKAGE_ugps is not set +# CONFIG_PACKAGE_uledd is not set +# CONFIG_PACKAGE_usb-modeswitch is not set +# CONFIG_PACKAGE_usbmuxd is not set +# CONFIG_PACKAGE_usbreset is not set +# CONFIG_PACKAGE_usbutils is not set +# CONFIG_PACKAGE_uuidd is not set +# CONFIG_PACKAGE_uuidgen is not set +# CONFIG_PACKAGE_uvcdynctrl is not set +# CONFIG_PACKAGE_v4l-utils is not set +# CONFIG_PACKAGE_view1090 is not set +# CONFIG_PACKAGE_watchcat is not set +# CONFIG_PACKAGE_whereis is not set +# CONFIG_PACKAGE_wifitoggle is not set +# CONFIG_PACKAGE_xsltproc is not set +# CONFIG_PACKAGE_xxd is not set +# CONFIG_PACKAGE_yanglint is not set +# CONFIG_PACKAGE_yara is not set +# CONFIG_PACKAGE_yunbridge is not set + +# +# Xorg +# + +# +# font-utils +# +# CONFIG_PACKAGE_fontconfig is not set diff --git a/Config.in b/Config.in index ddbc4e2ea4..d30c04839e 100644 --- a/Config.in +++ b/Config.in @@ -4,7 +4,7 @@ # See /LICENSE for more information. # -mainmenu "LEDE Configuration" +mainmenu "OpenWrt Configuration" config MODULES option modules diff --git a/Makefile b/Makefile index 09db75c550..0a1f96a973 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ export TOPDIR LC_ALL LANG TZ empty:= space:= $(empty) $(empty) -$(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the LEDE directory must not include any spaces)) +$(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the OpenWrt directory must not include any spaces)) world: diff --git a/README b/README index 890204f61e..ca910714b1 100644 Binary files a/README and b/README differ diff --git a/config/Config-images.in b/config/Config-images.in index dcaf6fb0b9..b25761dced 100644 --- a/config/Config-images.in +++ b/config/Config-images.in @@ -17,6 +17,7 @@ menu "Target Images" default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ar71xx default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ramips default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_apm821xx + default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_mpc85xx default TARGET_INITRAMFS_COMPRESSION_NONE depends on TARGET_ROOTFS_INITRAMFS help @@ -61,7 +62,7 @@ menu "Target Images" config TARGET_ROOTFS_TARGZ bool "tar.gz" - default n if USES_TARGZ + default y if USES_TARGZ help Build a compressed tar archive of the root filesystem. @@ -69,7 +70,7 @@ menu "Target Images" menuconfig TARGET_ROOTFS_EXT4FS bool "ext4" - default n if USES_EXT4 + default y if USES_EXT4 help Build an ext4 root filesystem. @@ -114,7 +115,7 @@ menu "Target Images" config TARGET_ROOTFS_ISO bool "iso" default n - depends on TARGET_x86 + depends on TARGET_x86_generic help Create a bootable ISO image. @@ -184,31 +185,22 @@ menu "Target Images" depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_ISO || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS select PACKAGE_grub2 default y - - config EFI_IMAGES - bool "Build EFI GRUB images (Linux x86 or x86_64 host only)" - depends on TARGET_x86 - depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_ISO || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS - select PACKAGE_grub2 - select PACKAGE_grub2-efi - default n - config GRUB_CONSOLE bool "Use Console Terminal (in addition to Serial)" - depends on GRUB_IMAGES || EFI_IMAGES + depends on GRUB_IMAGES default n if (TARGET_x86_generic_Soekris45xx || TARGET_x86_generic_Soekris48xx || TARGET_x86_net5501 || TARGET_x86_geos || TARGET_x86_alix2) default y config GRUB_SERIAL string "Serial port device" - depends on GRUB_IMAGES || EFI_IMAGES + depends on GRUB_IMAGES default "hvc0" if TARGET_x86_xen_domu default "ttyS0" if ! TARGET_x86_xen_domu config GRUB_BAUDRATE int "Serial port baud rate" - depends on GRUB_IMAGES || EFI_IMAGES + depends on GRUB_IMAGES default 38400 if TARGET_x86_generic default 115200 @@ -219,14 +211,14 @@ menu "Target Images" config GRUB_BOOTOPTS string "Extra kernel boot options" - depends on GRUB_IMAGES || EFI_IMAGES + depends on GRUB_IMAGES default "xencons=hvc" if TARGET_x86_xen_domu help If you don't know, just leave it blank. config GRUB_TIMEOUT string "Seconds to wait before booting the default entry" - depends on GRUB_IMAGES || EFI_IMAGES + depends on GRUB_IMAGES default "0" help If you don't know, 5 seconds is a reasonable default. @@ -234,21 +226,21 @@ menu "Target Images" config VDI_IMAGES bool "Build VirtualBox image files (VDI)" depends on TARGET_x86 || TARGET_x86_64 - depends on GRUB_IMAGES || EFI_IMAGES + select GRUB_IMAGES select TARGET_IMAGES_PAD select PACKAGE_kmod-e1000 config VMDK_IMAGES bool "Build VMware image files (VMDK)" depends on TARGET_x86 || TARGET_x86_64 - depends on GRUB_IMAGES || EFI_IMAGES + default y + select GRUB_IMAGES select TARGET_IMAGES_PAD select PACKAGE_kmod-e1000 - default y config TARGET_IMAGES_PAD bool "Pad images to filesystem size (for JFFS2)" - depends on GRUB_IMAGES || EFI_IMAGES + depends on GRUB_IMAGES config TARGET_IMAGES_GZIP bool "GZip images" @@ -261,19 +253,19 @@ menu "Target Images" config TARGET_KERNEL_PARTSIZE int "Kernel partition size (in MB)" - depends on GRUB_IMAGES || EFI_IMAGES - default 8 + depends on GRUB_IMAGES + default 16 config TARGET_ROOTFS_PARTSIZE int "Root filesystem partition size (in MB)" - depends on GRUB_IMAGES || EFI_IMAGES || TARGET_ROOTFS_EXT4FS || TARGET_rb532 || TARGET_mvebu || TARGET_uml - default 96 + depends on GRUB_IMAGES || TARGET_ROOTFS_EXT4FS || TARGET_rb532 || TARGET_mvebu || TARGET_uml + default 90 help Select the root filesystem partition size. config TARGET_ROOTFS_PARTNAME string "Root partition on target device" - depends on GRUB_IMAGES || EFI_IMAGES + depends on GRUB_IMAGES help Override the root partition on the final device. If left empty, it will be mounted by PARTUUID which makes the kernel find the diff --git a/config/Config-kernel.in b/config/Config-kernel.in index d7cb2d9fcb..fa06b50442 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -62,7 +62,7 @@ config KERNEL_PROFILING config KERNEL_KALLSYMS bool "Compile the kernel with symbol table information" - default n + default y if !SMALL_FLASH help This will give you more information in stack traces from kernel oopses. @@ -254,7 +254,7 @@ config KERNEL_DEVTMPFS default n help devtmpfs is a simple, kernel-managed /dev filesystem. The kernel creates - devices nodes for all registered devices ti simplify boot, but leaves more + devices nodes for all registered devices to simplify boot, but leaves more complex tasks to userspace (e.g. udev). if KERNEL_DEVTMPFS @@ -607,6 +607,17 @@ config KERNEL_SECCOMP help Build kernel with support for seccomp. +# +# IPv4 configuration +# + +config KERNEL_IP_MROUTE + bool "Enable IPv4 multicast routing" + default y + help + Multicast routing requires a multicast routing daemon in + addition to kernel support. + # # IPv6 configuration # @@ -623,7 +634,11 @@ if KERNEL_IPV6 def_bool y config KERNEL_IPV6_MROUTE - def_bool y + bool "Enable IPv6 multicast routing" + default y + help + Multicast routing requires a multicast routing daemon in + addition to kernel support. config KERNEL_IPV6_PIMSM_V2 def_bool n diff --git a/include/autotools.mk b/include/autotools.mk index 7bd400ab36..aa044aa0b4 100644 --- a/include/autotools.mk +++ b/include/autotools.mk @@ -105,14 +105,14 @@ ifneq ($(filter patch-libtool,$(PKG_FIXUP)),) endif ifneq ($(filter libtool,$(PKG_FIXUP)),) - PKG_BUILD_DEPENDS += libtool libintl libiconv + PKG_BUILD_DEPENDS += libtool gettext libiconv ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),) Hooks/Configure/Pre += autoreconf_target endif endif ifneq ($(filter libtool-ucxx,$(PKG_FIXUP)),) - PKG_BUILD_DEPENDS += libtool libintl libiconv + PKG_BUILD_DEPENDS += libtool gettext libiconv ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),) Hooks/Configure/Pre += autoreconf_target endif diff --git a/include/download.mk b/include/download.mk index 82a3dd2f98..2ba8a7bdf4 100644 --- a/include/download.mk +++ b/include/download.mk @@ -6,8 +6,10 @@ # See /LICENSE for more information. # -OPENWRT_GIT = http://git.openwrt.org -LEDE_GIT = https://git.lede-project.org +PROJECT_GIT = https://git.openwrt.org + +OPENWRT_GIT = $(PROJECT_GIT) +LEDE_GIT = $(PROJECT_GIT) ifdef PKG_SOURCE_VERSION PKG_VERSION ?= $(if $(PKG_SOURCE_DATE),$(PKG_SOURCE_DATE)-)$(call version_abbrev,$(PKG_SOURCE_VERSION)) @@ -103,7 +105,7 @@ hash_var = $(if $(filter-out x,$(1)),MD5SUM,HASH) endif define DownloadMethod/unknown - @echo "ERROR: No download method available"; false + echo "ERROR: No download method available"; false endef define DownloadMethod/default diff --git a/include/feeds.mk b/include/feeds.mk index f89687a27e..b85438301c 100644 --- a/include/feeds.mk +++ b/include/feeds.mk @@ -41,10 +41,10 @@ endef # 1: destination file define FeedSourcesAppend ( \ - echo "src/gz %n_core %U/targets/%S/packages"; \ + echo "src/gz %d_core %U/targets/%S/packages"; \ $(strip $(if $(CONFIG_PER_FEED_REPO), \ - $(foreach feed,base $(FEEDS_ENABLED),echo "src/gz %n_$(feed) %U/packages/%A/$(feed)";) \ + $(foreach feed,base $(FEEDS_ENABLED),echo "src/gz %d_$(feed) %U/packages/%A/$(feed)";) \ $(if $(CONFIG_PER_FEED_REPO_ADD_DISABLED), \ - $(foreach feed,$(FEEDS_DISABLED),echo "$(if $(CONFIG_PER_FEED_REPO_ADD_COMMENTED),# )src/gz %n_$(feed) %U/packages/%A/$(feed)";)))) \ + $(foreach feed,$(FEEDS_DISABLED),echo "$(if $(CONFIG_PER_FEED_REPO_ADD_COMMENTED),# )src/gz %d_$(feed) %U/packages/%A/$(feed)";)))) \ ) >> $(1) endef diff --git a/include/host-build.mk b/include/host-build.mk index dc70373855..9120570c54 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -24,7 +24,7 @@ include $(INCLUDE_DIR)/depends.mk include $(INCLUDE_DIR)/quilt.mk BUILD_TYPES += host -HOST_STAMP_PREPARED:=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(HOST_PREPARED_DEPENDS))) +HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(HOST_PREPARED_DEPENDS))) HOST_STAMP_CONFIGURED:=$(HOST_BUILD_DIR)/.configured HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built HOST_BUILD_PREFIX?=$(if $(IS_PACKAGE_BUILD),$(STAGING_DIR_HOSTPKG),$(STAGING_DIR_HOST)) @@ -78,6 +78,10 @@ HOST_MAKE_FLAGS = HOST_CONFIGURE_CMD = $(BASH) ./configure +ifeq ($(HOST_OS),Darwin) + HOST_CONFIG_SITE:=$(INCLUDE_DIR)/site/darwin +endif + define Host/Configure/Default $(if $(HOST_CONFIGURE_PARALLEL),+)(cd $(HOST_BUILD_DIR)/$(3); \ if [ -x configure ]; then \ @@ -128,6 +132,7 @@ define Host/Exports/Default $(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig $(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig $(1) : export CCACHE_DIR:=$(STAGING_DIR_HOST)/ccache + $(if $(HOST_CONFIG_SITE),$(1) : export CONFIG_SITE:=$(HOST_CONFIG_SITE)) $(if $(IS_PACKAGE_BUILD),$(1) : export PATH=$$(TARGET_PATH_PKG)) endef Host/Exports=$(Host/Exports/Default) diff --git a/include/image-commands.mk b/include/image-commands.mk index 2aac8fb15d..bcc1256df8 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -7,7 +7,7 @@ define Build/uImage mkimage -A $(LINUX_KARCH) \ -O linux -T kernel \ -C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ - -n '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) LEDE Linux-$(LINUX_VERSION))' -d $@ $@.new + -n '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) OpenWrt Linux-$(LINUX_VERSION))' -d $@ $@.new mv $@.new $@ endef @@ -60,7 +60,7 @@ endef define Build/netgear-dni $(STAGING_DIR_HOST)/bin/mkdniimg \ - -B $(NETGEAR_BOARD_ID) -v LEDE.$(REVISION) \ + -B $(NETGEAR_BOARD_ID) -v OpenWrt.$(REVISION) \ $(if $(NETGEAR_HW_ID),-H $(NETGEAR_HW_ID)) \ -r "$(1)" \ -i $@ -o $@.new @@ -83,7 +83,7 @@ define Build/append-uImage-fakeroot-hdr rm -f $@.fakeroot $(STAGING_DIR_HOST)/bin/mkimage \ -A $(LINUX_KARCH) -O linux -T filesystem -C none \ - -n '$(call toupper,$(LINUX_KARCH)) LEDE fakeroot' \ + -n '$(call toupper,$(LINUX_KARCH)) OpenWrt fakeroot' \ -s \ $@.fakeroot cat $@.fakeroot >> $@ @@ -102,8 +102,7 @@ define Build/tplink-safeloader endef define Build/append-dtb - $(call Image/BuildDTB,$(if $(DEVICE_DTS_DIR),$(DEVICE_DTS_DIR),$(DTS_DIR))/$(DEVICE_DTS).dts,$@.dtb) - cat $@.dtb >> $@ + cat $(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb >> $@ endef define Build/install-dtb @@ -114,6 +113,11 @@ define Build/install-dtb ) endef +define Build/install-zImage + $(CP) $(KDIR)/zImage \ + $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-zImage +endef + define Build/fit $(TOPDIR)/scripts/mkits.sh \ -D $(DEVICE_NAME) -o $@.its -k $@ \ @@ -225,6 +229,19 @@ define Build/combined-image @mv $@.new $@ endef +define Build/openmesh-image + $(TOPDIR)/scripts/om-fwupgradecfg-gen.sh \ + "$(call param_get_default,ce_type,$(1),$(DEVICE_NAME))" \ + "$@-fwupgrade.cfg" \ + "$(call param_get_default,kernel,$(1),$(IMAGE_KERNEL))" \ + "$(call param_get_default,rootfs,$(1),$@)" + $(TOPDIR)/scripts/combined-ext-image.sh \ + "$(call param_get_default,ce_type,$(1),$(DEVICE_NAME))" "$@" \ + "$@-fwupgrade.cfg" "fwupgrade.cfg" \ + "$(call param_get_default,kernel,$(1),$(IMAGE_KERNEL))" "kernel" \ + "$(call param_get_default,rootfs,$(1),$@)" "rootfs" +endef + define Build/sysupgrade-tar sh $(TOPDIR)/scripts/sysupgrade-tar.sh \ --board $(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \ @@ -244,14 +261,20 @@ endef define Build/tplink-v2-header $(STAGING_DIR_HOST)/bin/mktplinkfw2 \ - -c -V "ver. 2.0" -B $(TPLINK_BOARD_ID) $(1) -k $@ -o $@.new + -c -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -L $(KERNEL_LOADADDR) \ + -E $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ + -w $(TPLINK_HWREVADD) -F "$(TPLINK_FLASHLAYOUT)" \ + -T $(TPLINK_HVERSION) -V "ver. 2.0" \ + -k $@ -o $@.new $(1) @mv $@.new $@ endef define Build/tplink-v2-image $(STAGING_DIR_HOST)/bin/mktplinkfw2 \ - -a 0x4 -j -V "ver. 2.0" -B $(TPLINK_BOARD_ID) $(1) \ - -k $(IMAGE_KERNEL) -r $(IMAGE_ROOTFS) -o $@.new + -H $(TPLINK_HWID) -W $(TPLINK_HWREV) \ + -w $(TPLINK_HWREVADD) -F "$(TPLINK_FLASHLAYOUT)" \ + -T $(TPLINK_HVERSION) -V "ver. 2.0" -a 0x4 -j \ + -k $(IMAGE_KERNEL) -r $(IMAGE_ROOTFS) -o $@.new $(1) cat $@.new >> $@ rm -rf $@.new endef @@ -271,7 +294,7 @@ metadata_json = \ }' define Build/append-metadata - $(if $(SUPPORTED_DEVICES),echo $(call metadata_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@) + $(if $(SUPPORTED_DEVICES),-echo $(call metadata_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@) endef define Build/kernel2minor diff --git a/include/image.mk b/include/image.mk index fc6bf06e96..af01951b49 100644 --- a/include/image.mk +++ b/include/image.mk @@ -136,7 +136,7 @@ endef define Image/BuildKernel/MkuImage mkimage -A $(ARCH) -O linux -T kernel -C $(1) -a $(2) -e $(3) \ - -n '$(call toupper,$(ARCH)) LEDE Linux-$(LINUX_VERSION)' -d $(4) $(5) + -n '$(call toupper,$(ARCH)) OpenWrt Linux-$(LINUX_VERSION)' -d $(4) $(5) endef define Image/BuildKernel/MkFIT @@ -303,9 +303,9 @@ target-dir-%: FORCE $(opkg_target) update && \ $(opkg_target) install \ $(call opkg_package_files,$(mkfs_packages_add))) + -$(CP) -T $(mkfs_cur_target_dir).opkg/ $(mkfs_cur_target_dir)/etc/opkg/ + rm -rf $(mkfs_cur_target_dir).opkg $(mkfs_cur_target_dir).conf $(call prepare_rootfs,$(mkfs_cur_target_dir)) - -mv $(mkfs_cur_target_dir).opkg $(mkfs_cur_target_dir)/etc/opkg - rm -f $(mkfs_cur_target_dir).conf $(KDIR)/root.%: kernel_prepare $(call Image/mkfs/$(word 1,$(target_params)),$(target_params)) @@ -435,7 +435,27 @@ define Device/Build/compile endef +ifndef IB +define Device/Build/dtb + ifndef BUILD_DTS_$(1) + BUILD_DTS_$(1) := 1 + $(KDIR)/image-$(1).dtb: FORCE + $(call Image/BuildDTB,$(strip $(2))/$(strip $(3)).dts,$$@) + + image_prepare: $(KDIR)/image-$(1).dtb + endif + +endef +endif + define Device/Build/kernel + $$(eval $$(foreach dts,$$(DEVICE_DTS), \ + $$(call Device/Build/dtb,$$(notdir $$(dts)), \ + $$(if $$(DEVICE_DTS_DIR),$$(DEVICE_DTS_DIR),$$(DTS_DIR)), \ + $$(dts) \ + ) \ + )) + $(KDIR)/$$(KERNEL_NAME):: image_prepare $$(_TARGET): $$(if $$(KERNEL_INSTALL),$(BIN_DIR)/$$(KERNEL_IMAGE)) $(call Device/Export,$$(KDIR_KERNEL_IMAGE),$(1)) diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk index f0618633b2..33f3a8210f 100644 --- a/include/kernel-defaults.mk +++ b/include/kernel-defaults.mk @@ -63,6 +63,8 @@ ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) $(call Kernel/SetInitramfs/PreConfigure) echo 'CONFIG_INITRAMFS_ROOT_UID=$(shell id -u)' >> $(LINUX_DIR)/.config echo 'CONFIG_INITRAMFS_ROOT_GID=$(shell id -g)' >> $(LINUX_DIR)/.config + echo 'CONFIG_INITRAMFS_FORCE=y' >> $(LINUX_DIR)/.config + echo "$(if $(CONFIG_TARGET_INITRAMFS_FORCE),CONFIG_INITRAMFS_FORCE=y,# CONFIG_INITRAMFS_FORCE is not set)" >> $(LINUX_DIR)/.config echo "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_NONE),CONFIG_INITRAMFS_COMPRESSION_NONE=y,# CONFIG_INITRAMFS_COMPRESSION_NONE is not set)" >> $(LINUX_DIR)/.config echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),CONFIG_INITRAMFS_COMPRESSION_GZIP=y\nCONFIG_RD_GZIP=y,# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set\n# CONFIG_RD_GZIP is not set)" >> $(LINUX_DIR)/.config echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),CONFIG_INITRAMFS_COMPRESSION_BZIP2=y\nCONFIG_RD_BZIP2=y,# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set\n# CONFIG_RD_BZIP2 is not set)" >> $(LINUX_DIR)/.config @@ -78,6 +80,7 @@ define Kernel/SetNoInitramfs mv $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config.old grep -v INITRAMFS $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config.set echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR)/.config.set + echo '# CONFIG_INITRAMFS_FORCE is not set' >> $(LINUX_DIR)/.config.set endef define Kernel/Configure/Default diff --git a/include/kernel-version.mk b/include/kernel-version.mk index fdf4ac7752..87d3ff172d 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,12 +3,14 @@ LINUX_RELEASE?=1 LINUX_VERSION-3.18 = .71 -LINUX_VERSION-4.4 = .93 -LINUX_VERSION-4.9 = .61 +LINUX_VERSION-4.4 = .111 +LINUX_VERSION-4.9 = .76 +LINUX_VERSION-4.14 = .13 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240 -LINUX_KERNEL_HASH-4.4.93 = ed349314f16e78a6571b5f8884f6452782aef6c26b81bcc7ccdac44ecd917c36 -LINUX_KERNEL_HASH-4.9.61 = e0239675728ef0c3697d4b651a1d1a1dd7b2920ed2c5f05a23a23d4aa726d19e +LINUX_KERNEL_HASH-4.4.111 = a201282e8eaf62b4f51edb2241e98ff805fe2d1b04a72a2328c5a6e2d77ec008 +LINUX_KERNEL_HASH-4.9.76 = b82b94332cffaaeade74495264c989dafb96d4748503f87a5b7c436f5de887de +LINUX_KERNEL_HASH-4.14.13 = 4ab46d1b5a0f8ef83b80760f89ae4f5c88431b19b3cf79ffa0c66d6b33e45772 ifdef KERNEL_PATCHVER LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER))) diff --git a/include/kernel.mk b/include/kernel.mk index 7674f0dadc..1b6006a62d 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -52,7 +52,7 @@ else LINUX_VERMAGIC:=$(strip $(shell cat $(LINUX_DIR)/.vermagic 2>/dev/null)) LINUX_VERMAGIC:=$(if $(LINUX_VERMAGIC),$(LINUX_VERMAGIC),unknown) - LINUX_UNAME_VERSION:=$(if $(word 3,$(subst ., ,$(KERNEL_BASE))),$(KERNEL_BASE),$(KERNEL_BASE).0) + LINUX_UNAME_VERSION:=$(KERNEL_BASE) ifneq ($(findstring -rc,$(LINUX_VERSION)),) LINUX_UNAME_VERSION:=$(LINUX_UNAME_VERSION)-$(strip $(lastword $(subst -, ,$(LINUX_VERSION)))) endif @@ -64,7 +64,7 @@ else ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),) LINUX_SITE:=@KERNEL/linux/kernel/v$(word 1,$(subst ., ,$(KERNEL_BASE))).x$(TESTING) else - LINUX_UNAME_VERSION:=$(strip $(shell cat $(LINUX_DIR)/include/config/kernel.release)) + LINUX_UNAME_VERSION:=$(strip $(shell cat $(LINUX_DIR)/include/config/kernel.release 2>/dev/null)) endif MODULES_SUBDIR:=lib/modules/$(LINUX_UNAME_VERSION) @@ -85,6 +85,8 @@ else ifneq (,$(findstring $(ARCH) , armeb )) LINUX_KARCH := arm else ifneq (,$(findstring $(ARCH) , mipsel mips64 mips64el )) LINUX_KARCH := mips +else ifneq (,$(findstring $(ARCH) , powerpc64 )) + LINUX_KARCH := powerpc else ifneq (,$(findstring $(ARCH) , sh2 sh3 sh4 )) LINUX_KARCH := sh else ifneq (,$(findstring $(ARCH) , i386 x86_64 )) @@ -121,61 +123,53 @@ ifdef CONFIG_USE_SPARSE KERNEL_MAKEOPTS += C=1 CHECK=$(STAGING_DIR_HOST)/bin/sparse endif +PKG_EXTMOD_SUBDIRS ?= . + +define populate_module_symvers + @mkdir -p $(PKG_INFO_DIR) + cat /dev/null > $(PKG_INFO_DIR)/$(PKG_NAME).symvers; \ + for subdir in $(PKG_EXTMOD_SUBDIRS); do \ + cat $(PKG_INFO_DIR)/*.symvers 2>/dev/null > $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers; \ + done +endef + +define collect_module_symvers + for subdir in $(PKG_EXTMOD_SUBDIRS); do \ + grep -F $$$$(readlink -f $(PKG_BUILD_DIR)) $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers >> $(PKG_BUILD_DIR)/Module.symvers.tmp; \ + done; \ + sort -u $(PKG_BUILD_DIR)/Module.symvers.tmp > $(PKG_BUILD_DIR)/Module.symvers; \ + mv $(PKG_BUILD_DIR)/Module.symvers $(PKG_INFO_DIR)/$(PKG_NAME).symvers +endef + +define KernelPackage/hooks + ifneq ($(PKG_NAME),kernel) + Hooks/Compile/Pre += populate_module_symvers + Hooks/Compile/Post += collect_module_symvers + endif + define KernelPackage/hooks + endef +endef + define KernelPackage/Defaults FILES:= AUTOLOAD:= + MODPARAMS:= PKGFLAGS+=nonshared endef +# 1: name +# 2: install prefix +# 3: module priority prefix +# 4: required for boot +# 5: module list define ModuleAutoLoad - $(SH_FUNC) \ - export modules=; \ - probe_module() { \ - local mods="$$$$$$$$1"; \ - local boot="$$$$$$$$2"; \ - local mod; \ - shift 2; \ - for mod in $$$$$$$$mods; do \ - mkdir -p $(2)/etc/modules.d; \ - echo "$$$$$$$$mod" >> $(2)/etc/modules.d/$(1); \ - done; \ - if [ -e $(2)/etc/modules.d/$(1) ]; then \ - if [ "$$$$$$$$boot" = "1" -a ! -e $(2)/etc/modules-boot.d/$(1) ]; then \ - mkdir -p $(2)/etc/modules-boot.d; \ - ln -s ../modules.d/$(1) $(2)/etc/modules-boot.d/; \ - fi; \ - modules="$$$$$$$${modules:+$$$$$$$$modules }$$$$$$$$mods"; \ - fi; \ - }; \ - add_module() { \ - local priority="$$$$$$$$1"; \ - local mods="$$$$$$$$2"; \ - local boot="$$$$$$$$3"; \ - local mod; \ - shift 3; \ - for mod in $$$$$$$$mods; do \ - mkdir -p $(2)/etc/modules.d; \ - echo "$$$$$$$$mod" >> $(2)/etc/modules.d/$$$$$$$$priority-$(1); \ - done; \ - if [ -e $(2)/etc/modules.d/$$$$$$$$priority-$(1) ]; then \ - if [ "$$$$$$$$boot" = "1" -a ! -e $(2)/etc/modules-boot.d/$$$$$$$$priority-$(1) ]; then \ - mkdir -p $(2)/etc/modules-boot.d; \ - ln -s ../modules.d/$$$$$$$$priority-$(1) $(2)/etc/modules-boot.d/; \ - fi; \ - modules="$$$$$$$${modules:+$$$$$$$$modules }$$$$$$$$priority-$(1)"; \ - fi; \ - }; \ - $(3) \ - if [ -n "$$$$$$$$modules" ]; then \ - modules="$$$$$$$$(echo "$$$$$$$$modules" | tr ' ' '\n' | sort | uniq | paste -s -d' ' -)"; \ - mkdir -p $(2)/etc/modules.d; \ - mkdir -p $(2)/CONTROL; \ - echo "#!/bin/sh" > $(2)/CONTROL/postinst-pkg; \ - echo "[ -z \"\$$$$$$$$IPKG_INSTROOT\" ] || exit 0" >> $(2)/CONTROL/postinst-pkg; \ - echo ". /lib/functions.sh" >> $(2)/CONTROL/postinst-pkg; \ - echo "insert_modules $$$$$$$$modules" >> $(2)/CONTROL/postinst-pkg; \ - chmod 0755 $(2)/CONTROL/postinst-pkg; \ - fi + $(if $(5), \ + mkdir -p $(2)/etc/modules.d; \ + ($(foreach mod,$(5), \ + echo "$(mod)$(if $(MODPARAMS.$(mod)), $(MODPARAMS.$(mod)),$(if $(MODPARAMS), $(MODPARAMS)))"; )) > $(2)/etc/modules.d/$(3)$(1); \ + $(if $(4), \ + mkdir -p $(2)/etc/modules-boot.d; \ + ln -sf ../modules.d/$(3)$(1) $(2)/etc/modules-boot.d/;)) endef ifeq ($(DUMP)$(TARGET_BUILD),) @@ -228,6 +222,7 @@ $(call KernelPackage/$(1)/config) endif $(call KernelPackage/depends) + $(call KernelPackage/hooks) ifneq ($(if $(filter-out %=y %=n %=m,$(KCONFIG)),$(filter m y,$(foreach c,$(filter-out %=y %=n %=m,$(KCONFIG)),$($(c)))),.),) ifneq ($(strip $(FILES)),) @@ -243,7 +238,7 @@ $(call KernelPackage/$(1)/config) exit 1; \ fi; \ done; - $(call ModuleAutoLoad,$(1),$$(1),$(AUTOLOAD)) + $(call ModuleAutoLoad,$(1),$$(1),$(filter-out 0-,$(word 1,$(AUTOLOAD))-),$(filter-out 0,$(word 2,$(AUTOLOAD))),$(wordlist 3,99,$(AUTOLOAD))) $(call KernelPackage/$(1)/install,$$(1)) endef endif @@ -265,12 +260,17 @@ endef version_filter=$(if $(findstring @,$(1)),$(shell $(SCRIPT_DIR)/package-metadata.pl version_filter $(KERNEL_PATCHVER) $(1)),$(1)) +# 1: priority (optional) +# 2: module list +# 3: boot flag define AutoLoad - add_module "$(1)" "$(call version_filter,$(2))" "$(3)"; + $(if $(1),$(1),0) $(if $(3),1,0) $(call version_filter,$(2)) endef +# 1: module list +# 2: boot flag define AutoProbe - probe_module "$(call version_filter,$(1))" "$(2)"; + $(call AutoLoad,,$(1),$(2)) endef version_field=$(if $(word $(1),$(2)),$(word $(1),$(2)),0) diff --git a/include/netfilter.mk b/include/netfilter.mk index 2d537583bd..616425cb08 100644 --- a/include/netfilter.mk +++ b/include/netfilter.mk @@ -262,6 +262,10 @@ $(eval $(if $(NF_KMOD),$(call nf_add,IPT_TEE,CONFIG_NF_DUP_IPV6, $(P_V6)nf_dup_i $(eval $(call nf_add,IPT_U32,CONFIG_NETFILTER_XT_MATCH_U32, $(P_XT)xt_u32)) +# checksum + +$(eval $(call nf_add,IPT_CHECKSUM,CONFIG_NETFILTER_XT_TARGET_CHECKSUM, $(P_XT)xt_CHECKSUM)) + # netlink @@ -366,7 +370,6 @@ IPT_BUILTIN += $(IPT_NAT_EXTRA-y) IPT_BUILTIN += $(NF_NATHELPER-y) IPT_BUILTIN += $(NF_NATHELPER_EXTRA-y) IPT_BUILTIN += $(IPT_ULOG-y) -IPT_BUILTIN += $(IPT_DEBUG-y) IPT_BUILTIN += $(IPT_TPROXY-y) IPT_BUILTIN += $(NFNETLINK-y) IPT_BUILTIN += $(NFNETLINK_LOG-y) diff --git a/include/nls.mk b/include/nls.mk index 51463b9f12..04838821b4 100644 --- a/include/nls.mk +++ b/include/nls.mk @@ -23,7 +23,7 @@ else endif PKG_CONFIG_DEPENDS += CONFIG_BUILD_NLS -PKG_BUILD_DEPENDS += !BUILD_NLS:libiconv !BUILD_NLS:libintl +PKG_BUILD_DEPENDS += !BUILD_NLS:libiconv !BUILD_NLS:gettext ICONV_DEPENDS:=+BUILD_NLS:libiconv-full ICONV_CFLAGS:=-I$(ICONV_PREFIX)/include diff --git a/include/package-defaults.mk b/include/package-defaults.mk index 0eecd6c4f8..0bca076e72 100644 --- a/include/package-defaults.mk +++ b/include/package-defaults.mk @@ -57,6 +57,8 @@ define Package/Default DEFAULT_VARIANT:= USERID:= ALTERNATIVES:= + LICENSE:=$(PKG_LICENSE) + LICENSE_FILES:=$(PKG_LICENSE_FILES) endef Build/Patch:=$(Build/Patch/Default) diff --git a/include/package-dumpinfo.mk b/include/package-dumpinfo.mk index b717c1b472..8a42be5bd1 100644 --- a/include/package-dumpinfo.mk +++ b/include/package-dumpinfo.mk @@ -7,23 +7,17 @@ ifneq ($(DUMP),) -dumpinfo: FORCE -define Config/template -Preconfig: $(1) -Preconfig-Type: $(2) -Preconfig-Default: $(3) -Preconfig-Label: $(4) +define SOURCE_INFO +$(if $(PKG_BUILD_DEPENDS),Build-Depends: $(PKG_BUILD_DEPENDS) +)$(if $(HOST_BUILD_DEPENDS),Build-Depends/host: $(HOST_BUILD_DEPENDS) +)$(if $(BUILD_TYPES),Build-Types: $(BUILD_TYPES) +) endef -define Config - Preconfig/$(1) = $$(call Config/template,$(1),$(2),$(3),$(4)) - preconfig_$$(1) += $(1) -endef - define Dumpinfo/Package -$(info Package: $(1) +$(info $(SOURCE_INFO)Package: $(1) $(if $(MENU),Menu: $(MENU) )$(if $(SUBMENU),Submenu: $(SUBMENU) )$(if $(SUBMENUDEP),Submenu-Depends: $(SUBMENUDEP) @@ -36,18 +30,15 @@ Menu-Depends: $(MDEPENDS) Provides: $(PROVIDES) $(if $(VARIANT),Build-Variant: $(VARIANT) $(if $(DEFAULT_VARIANT),Default-Variant: $(VARIANT) -))$(if $(PKG_BUILD_DEPENDS),Build-Depends: $(PKG_BUILD_DEPENDS) -)$(if $(HOST_BUILD_DEPENDS),Build-Depends/host: $(HOST_BUILD_DEPENDS) -)$(if $(BUILD_TYPES),Build-Types: $(BUILD_TYPES) -)Section: $(SECTION) +))Section: $(SECTION) Category: $(CATEGORY) $(if $(filter nonshared,$(PKGFLAGS)),,Repository: $(if $(FEED),$(FEED),base) )Title: $(TITLE) Maintainer: $(MAINTAINER) $(if $(USERID),Require-User: $(USERID) )Source: $(PKG_SOURCE) -$(if $(PKG_LICENSE),License: $(PKG_LICENSE) -)$(if $(PKG_LICENSE_FILES),LicenseFiles: $(PKG_LICENSE_FILES) +$(if $(LICENSE),License: $(LICENSE) +)$(if $(LICENSE_FILES),LicenseFiles: $(LICENSE_FILES) )Type: $(if $(Package/$(1)/targets),$(Package/$(1)/targets),$(if $(PKG_TARGETS),$(PKG_TARGETS),ipkg)) $(if $(KCONFIG),Kernel-Config: $(KCONFIG) )$(if $(BUILDONLY),Build-Only: $(BUILDONLY) @@ -59,33 +50,11 @@ $(if $(URL),$(URL) $(if $(Package/$(1)/config),Config: $(Package/$(1)/config) @@ -)$(foreach pc,$(preconfig_$(1)), -$(Preconfig/$(pc)))) +)) +SOURCE_INFO := endef -define Feature/Default - TARGET_NAME:= - TARGET_TITLE:= - PRIORITY:= - NAME:= -endef - -define Feature - $(eval $(Feature/Default)) - $(eval $(Feature/$(1))) - $(if $(DUMP),$(call Dumpinfo/Feature,$(1))) -endef - -define Dumpinfo/Feature -$(info Feature: $(TARGET_NAME)_$(1) -Target-Name: $(TARGET_NAME) -Target-Title: $(TARGET_TITLE) -Feature-Name: $(NAME) -$(if $(PRIORITY),Feature-Priority: $(PRIORITY) -)Feature-Description: -$(Feature/$(1)/description) -@@ -) -endef +dumpinfo: FORCE + $(if $(SOURCE_INFO),$(info $(SOURCE_INFO))) endif diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index bf508fb493..9e2717e788 100644 --- a/include/package-ipkg.mk +++ b/include/package-ipkg.mk @@ -161,8 +161,8 @@ $$(call addfield,Depends,$$(Package/$(1)/DEPENDS) )$$(call addfield,Provides,$$(call mergelist,$(PROVIDES)) )$$(call addfield,Alternatives,$$(call mergelist,$(ALTERNATIVES)) )$$(call addfield,Source,$(SOURCE) -)$$(call addfield,License,$$(PKG_LICENSE) -)$$(call addfield,LicenseFiles,$$(PKG_LICENSE_FILES) +)$$(call addfield,License,$(LICENSE) +)$$(call addfield,LicenseFiles,$(LICENSE_FILES) )$$(call addfield,Section,$(SECTION) )$$(call addfield,Require-User,$(USERID) )$(if $(filter hold,$(PKG_FLAGS)),Status: unknown hold not-installed diff --git a/include/package.mk b/include/package.mk index 5dc4aec70d..78ea5d0ef8 100644 --- a/include/package.mk +++ b/include/package.mk @@ -69,9 +69,9 @@ ifneq ($(PREV_STAMP_PREPARED),) STAMP_PREPARED:=$(PREV_STAMP_PREPARED) CONFIG_AUTOREBUILD:= else - STAMP_PREPARED:=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(PKG_PREPARED_DEPENDS))) + STAMP_PREPARED=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(PKG_PREPARED_DEPENDS))) endif -STAMP_CONFIGURED:=$(PKG_BUILD_DIR)/.configured$(if $(DUMP),,_$(call confvar,$(PKG_CONFIG_DEPENDS))) +STAMP_CONFIGURED=$(PKG_BUILD_DIR)/.configured$(if $(DUMP),,_$(call confvar,$(PKG_CONFIG_DEPENDS))) STAMP_CONFIGURED_WILDCARD=$(PKG_BUILD_DIR)/.configured_* STAMP_BUILT:=$(PKG_BUILD_DIR)/.built STAMP_INSTALLED:=$(STAGING_DIR)/stamp/.$(PKG_DIR_NAME)$(if $(BUILD_VARIANT),.$(BUILD_VARIANT),)_installed @@ -144,6 +144,9 @@ endef Build/Exports=$(Build/Exports/Default) define Build/CoreTargets + STAMP_PREPARED:=$$(STAMP_PREPARED) + STAMP_CONFIGURED:=$$(STAMP_CONFIGURED) + $(if $(QUILT),$(Build/Quilt)) $(call Build/Autoclean) $(call DefaultTargets) @@ -165,11 +168,11 @@ define Build/CoreTargets $(call Build/Exports,$(STAMP_CONFIGURED)) $(STAMP_CONFIGURED): $(STAMP_PREPARED) $(STAMP_CONFIGURED_DEPENDS) + rm -f $(STAMP_CONFIGURED_WILDCARD) $(CleanStaging) $(foreach hook,$(Hooks/Configure/Pre),$(call $(hook))$(sep)) $(Build/Configure) $(foreach hook,$(Hooks/Configure/Post),$(call $(hook))$(sep)) - rm -f $(STAMP_CONFIGURED_WILDCARD) touch $$@ $(call Build/Exports,$(STAMP_BUILT)) diff --git a/include/prereq-build.mk b/include/prereq-build.mk index 7d96921a9c..6a423d2c7d 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -18,7 +18,7 @@ $(eval $(call TestHostCommand,working-make, \ $(MAKE) -v | grep -E 'Make (3\.8[1-9]|3\.9[0-9]|[4-9]\.)')) $(eval $(call TestHostCommand,case-sensitive-fs, \ - LEDE can only be built on a case-sensitive filesystem, \ + OpenWrt can only be built on a case-sensitive filesystem, \ rm -f $(TMP_DIR)/test.*; touch $(TMP_DIR)/test.fs; \ test ! -f $(TMP_DIR)/test.FS)) @@ -27,32 +27,36 @@ $(eval $(call TestHostCommand,proper-umask, \ umask | grep -xE 00[012][012])) $(eval $(call SetupHostCommand,gcc, \ - Please install the GNU C Compiler (gcc), \ - $(CC) --version | grep gcc, \ - gcc --version | grep gcc, \ - gcc49 --version | grep gcc, \ + Please install the GNU C Compiler (gcc) 4.8 or later \ + $(CC) -dumpversion | grep -E '(4\.[8-9]|5\.?[0-9]?|6\.?[0-9]?|7\.?[0-9]?)', \ + gcc -dumpversion | grep -E '(4\.[8-9]|5\.?[0-9]?|6\.?[0-9]?|7\.?[0-9]?)', \ gcc48 --version | grep gcc, \ - gcc47 --version | grep gcc, \ - gcc46 --version | grep gcc, \ + gcc49 --version | grep gcc, \ + gcc5 --version | grep gcc, \ + gcc6 --version | grep gcc, \ + gcc7 --version | grep gcc, \ gcc --version | grep Apple.LLVM )) $(eval $(call TestHostCommand,working-gcc, \ - Please reinstall the GNU C Compiler - it appears to be broken, \ + \nPlease reinstall the GNU C Compiler (4.8 or later) - \ + it appears to be broken, \ echo 'int main(int argc, char **argv) { return 0; }' | \ gcc -x c -o $(TMP_DIR)/a.out -)) $(eval $(call SetupHostCommand,g++, \ - Please install the GNU C++ Compiler (g++), \ - $(CXX) --version | grep g++, \ - g++ --version | grep g++, \ - g++49 --version | grep g++, \ + Please install the GNU C++ Compiler (g++) 4.8 or later \ + $(CXX) -dumpversion | grep -E '(4\.[8-9]|5\.?[0-9]?|6\.?[0-9]?|7\.?[0-9]?)', \ + g++ -dumpversion | grep -E '(4\.[8-9]|5\.?[0-9]?|6\.?[0-9]?|7\.?[0-9]?)', \ g++48 --version | grep g++, \ - g++47 --version | grep g++, \ - g++46 --version | grep g++, \ + g++49 --version | grep g++, \ + g++5 --version | grep g++, \ + g++6 --version | grep g++, \ + g++7 --version | grep g++, \ g++ --version | grep Apple.LLVM )) $(eval $(call TestHostCommand,working-g++, \ - Please reinstall the GNU C++ Compiler - it appears to be broken, \ + \nPlease reinstall the GNU C++ Compiler (4.8 or later) - \ + it appears to be broken, \ echo 'int main(int argc, char **argv) { return 0; }' | \ g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \ $(TMP_DIR)/a.out)) diff --git a/include/site/darwin b/include/site/darwin new file mode 100644 index 0000000000..ec38f67be6 --- /dev/null +++ b/include/site/darwin @@ -0,0 +1,2 @@ +ac_cv_func_futimens=no +ac_cv_func_utimensat=no diff --git a/include/site/powerpc64 b/include/site/powerpc64 new file mode 100644 index 0000000000..6a66346b42 --- /dev/null +++ b/include/site/powerpc64 @@ -0,0 +1,26 @@ +#!/bin/sh +. $TOPDIR/include/site/linux +ac_cv_c_littleendian=${ac_cv_c_littleendian=no} +ac_cv_c_bigendian=${ac_cv_c_bigendian=yes} + +ac_cv_sizeof_char=1 +ac_cv_sizeof_char_p=8 +ac_cv_sizeof_double=8 +ac_cv_sizeof_float=4 +ac_cv_sizeof_int=4 +ac_cv_sizeof_long=8 +ac_cv_sizeof_long_double=16 +ac_cv_sizeof_long_int=8 +ac_cv_sizeof_long_long=8 +ac_cv_sizeof_long_long_int=8 +ac_cv_sizeof_short=2 +ac_cv_sizeof_short_int=2 +ac_cv_sizeof_signed_char=1 +ac_cv_sizeof_unsigned_char=1 +ac_cv_sizeof_unsigned_int=4 +ac_cv_sizeof_unsigned_long=8 +ac_cv_sizeof_unsigned_long_int=8 +ac_cv_sizeof_unsigned_long_long_int=8 +ac_cv_sizeof_unsigned_short=2 +ac_cv_sizeof_unsigned_short_int=2 +ac_cv_sizeof_void_p=8 diff --git a/include/target.mk b/include/target.mk index b18031f8d6..cefb19b243 100644 --- a/include/target.mk +++ b/include/target.mk @@ -13,11 +13,11 @@ __target_inc=1 DEVICE_TYPE?=router # Default packages - the really basic set -DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd \ +DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd ip-full \ iptables-mod-nat-extra kmod-nf-nathelper kmod-nf-nathelper-extra kmod-macvlan block-mount automount \ default-settings ipset-lists luci luci-app-ddns luci-app-sqm luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \ -luci-app-filetransfer luci-app-shadowsocksr-pro luci-app-usb-printer luci-app-vsftpd luci-app-sfe \ -luci-app-pptp-server luci-app-ipsec-vpnd luci-app-vlmcsd luci-app-wifischedule luci-app-wol luci-app-nlbwmon +luci-app-filetransfer luci-app-shadowsocksr-pro luci-app-usb-printer luci-app-vsftpd ddns-scripts_aliyun luci-app-xlnetacc \ +luci-app-pptp-server luci-app-ipsec-vpnd luci-app-vlmcsd luci-app-wifischedule luci-app-wol luci-app-sfe luci-app-nlbwmon # For nas targets DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm # For router targets @@ -190,7 +190,7 @@ ifeq ($(DUMP),1) CPU_CFLAGS_cortex-a7 = -mcpu=cortex-a7 CPU_CFLAGS_cortex-a8 = -mcpu=cortex-a8 CPU_CFLAGS_cortex-a9 = -mcpu=cortex-a9 - CPU_CFLAGS_cortex-a15 = -mcpu=cortex-a15 -mtune=cortex-a15 + CPU_CFLAGS_cortex-a15 = -mcpu=cortex-a15 CPU_CFLAGS_cortex-a53 = -mcpu=cortex-a53 CPU_CFLAGS_fa526 = -mcpu=fa526 CPU_CFLAGS_mpcore = -mcpu=mpcore @@ -209,6 +209,10 @@ ifeq ($(DUMP),1) CPU_CFLAGS_440:=-mcpu=440 CPU_CFLAGS_464fp:=-mcpu=464fp endif + ifeq ($(ARCH),powerpc64) + CPU_TYPE ?= powerpc64 + CPU_CFLAGS_powerpc64:=-mcpu=powerpc64 + endif ifeq ($(ARCH),sparc) CPU_TYPE = sparc CPU_CFLAGS_ultrasparc = -mcpu=ultrasparc diff --git a/include/toplevel.mk b/include/toplevel.mk index 658eb4ce47..3f5a750030 100644 --- a/include/toplevel.mk +++ b/include/toplevel.mk @@ -104,6 +104,9 @@ scripts/config/mconf: $(eval $(call rdep,scripts/config,scripts/config/mconf)) +scripts/config/qconf: + @$(_SINGLE)$(SUBMAKE) -s -C scripts/config qconf CC="$(HOSTCC_WRAPPER)" + scripts/config/conf: @$(_SINGLE)$(SUBMAKE) -s -C scripts/config conf CC="$(HOSTCC_WRAPPER)" @@ -136,6 +139,12 @@ menuconfig: scripts/config/mconf prepare-tmpinfo FORCE [ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; \ $< Config.in +xconfig: scripts/config/qconf prepare-tmpinfo FORCE + if [ \! -e .config -a -e $(HOME)/.openwrt/defconfig ]; then \ + cp $(HOME)/.openwrt/defconfig .config; \ + fi + $< Config.in + prepare_kernel_conf: .config FORCE ifeq ($(wildcard staging_dir/host/bin/quilt),) diff --git a/include/version.mk b/include/version.mk index 857bb23336..a869ed6f54 100644 --- a/include/version.mk +++ b/include/version.mk @@ -10,13 +10,10 @@ # REVISION:=x # SOURCE_DATE_EPOCH:=x -RELEASE:=Reboot - PKG_CONFIG_DEPENDS += \ CONFIG_VERSION_BUG_URL \ CONFIG_VERSION_NUMBER \ CONFIG_VERSION_CODE \ - CONFIG_VERSION_NICK \ CONFIG_VERSION_REPO \ CONFIG_VERSION_DIST \ CONFIG_VERSION_MANUFACTURER \ @@ -36,18 +33,15 @@ VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),SNAPSHOT) VERSION_CODE:=$(call qstrip_escape,$(CONFIG_VERSION_CODE)) VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION)) -VERSION_NICK:=$(call qstrip_escape,$(CONFIG_VERSION_NICK)) -VERSION_NICK:=$(if $(VERSION_NICK),$(VERSION_NICK),$(RELEASE)) - VERSION_REPO:=$(call qstrip_escape,$(CONFIG_VERSION_REPO)) -VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/releases/17.01.4) +VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/snapshots) VERSION_DIST:=$(call qstrip_escape,$(CONFIG_VERSION_DIST)) -VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),LEDE) +VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt) VERSION_DIST_SANITIZED:=$(call sanitize,$(VERSION_DIST)) VERSION_MANUFACTURER:=$(call qstrip_escape,$(CONFIG_VERSION_MANUFACTURER)) -VERSION_MANUFACTURER:=$(if $(VERSION_MANUFACTURER),$(VERSION_MANUFACTURER),LEDE) +VERSION_MANUFACTURER:=$(if $(VERSION_MANUFACTURER),$(VERSION_MANUFACTURER),OpenWrt) VERSION_MANUFACTURER_URL:=$(call qstrip_escape,$(CONFIG_VERSION_MANUFACTURER_URL)) VERSION_MANUFACTURER_URL:=$(if $(VERSION_MANUFACTURER_URL),$(VERSION_MANUFACTURER_URL),http://lede-project.org/) @@ -93,8 +87,6 @@ VERSION_SED:=$(SED) 's,%U,$(VERSION_REPO),g' \ -e 's,%v,\L$(subst $(space),_,$(VERSION_NUMBER)),g' \ -e 's,%C,$(VERSION_CODE),g' \ -e 's,%c,\L$(subst $(space),_,$(VERSION_CODE)),g' \ - -e 's,%N,$(VERSION_NICK),g' \ - -e 's,%n,\L$(subst $(space),_,$(VERSION_NICK)),g' \ -e 's,%D,$(VERSION_DIST),g' \ -e 's,%d,\L$(subst $(space),_,$(VERSION_DIST)),g' \ -e 's,%R,$(REVISION),g' \ diff --git a/package/Makefile b/package/Makefile index 4fdf415046..0aefbb8023 100644 --- a/package/Makefile +++ b/package/Makefile @@ -72,7 +72,6 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if $(CONFIG_TARGET_PER_DE $(call opkg,$(TARGET_DIR)) flag $$flag `cat $$file`; \ done; \ done || true - @-$(MAKE) package/preconfig $(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG) @@ -96,8 +95,6 @@ ifdef CONFIG_SIGNED_PACKAGES ); done endif -$(curdir)/preconfig: - $(curdir)/flags-install:= -j1 $(eval $(call stampfile,$(curdir),package,prereq,.config)) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index d92069ec76..0055474166 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -9,9 +9,10 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/version.mk +include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=base-files -PKG_RELEASE:=174 +PKG_RELEASE:=183 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ @@ -21,7 +22,12 @@ PKG_LICENSE:=GPL-2.0 # Extend depends from version.mk PKG_CONFIG_DEPENDS += \ CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE \ - CONFIG_NAND_SUPPORT + CONFIG_NAND_SUPPORT \ + CONFIG_CLEAN_IPKG \ + CONFIG_PER_FEED_REPO \ + CONFIG_PER_FEED_REPO_ADD_DISABLED \ + CONFIG_PER_FEED_REPO_ADD_COMMENTED \ + $(foreach feed,$(FEEDS_INSTALLED),CONFIG_FEED_$(feed)) include $(INCLUDE_DIR)/package.mk @@ -34,7 +40,7 @@ define Package/base-files SECTION:=base CATEGORY:=Base system DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:lede-keyring +NAND_SUPPORT:ubi-utils +fstools +fwtool - TITLE:=Base filesystem for Lede + TITLE:=Base filesystem for OpenWrt URL:=http://openwrt.org/ VERSION:=$(PKG_RELEASE)-$(REVISION) endef @@ -148,6 +154,7 @@ define Package/base-files/install mkdir -p $(1)/CONTROL mkdir -p $(1)/dev + mkdir -p $(1)/etc/config mkdir -p $(1)/etc/crontabs mkdir -p $(1)/etc/rc.d mkdir -p $(1)/overlay @@ -183,6 +190,11 @@ define Package/base-files/install $(if $(CONFIG_INCLUDE_CONFIG), \ echo -e "# Build configuration for board $(BOARD)/$(SUBTARGET)/$(PROFILE)\n" >$(1)/etc/build.config; \ cat $(BIN_DIR)/config.seed >>$(1)/etc/build.config) + + $(if $(CONFIG_CLEAN_IPKG),, \ + mkdir -p $(1)/etc/opkg; \ + $(call FeedSourcesAppend,$(1)/etc/opkg/distfeeds.conf); \ + $(VERSION_SED) $(1)/etc/opkg/distfeeds.conf) endef ifneq ($(DUMP),1) diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index 6230b0892f..fa148685cc 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -24,8 +24,8 @@ generate_static_network() { json_select dsl if json_is_a atmbridge object; then json_select atmbridge - local vpi vci encaps payload - json_get_vars vpi vci encaps payload + local vpi vci encaps payload nameprefix + json_get_vars vpi vci encaps payload nameprefix uci -q batch <<-EOF delete network.atm set network.atm='atm-bridge' @@ -33,6 +33,7 @@ generate_static_network() { set network.atm.vci='$vci' set network.atm.encaps='$encaps' set network.atm.payload='$payload' + set network.atm.nameprefix='$nameprefix' EOF json_select .. fi @@ -119,17 +120,14 @@ generate_network() { ;; pppoe) - # fixup IPv6 slave interface - ifname="pppoe-$1" - uci -q batch <<-EOF set network.$1.proto='pppoe' set network.$1.username='username' set network.$1.password='password' - set network.$1.ipv6='auto' + set network.$1.ipv6='1' delete network.${1}6 set network.${1}6='interface' - set network.${1}6.ifname='$ifname' + set network.${1}6.ifname='@${1}' set network.${1}6.proto='dhcpv6' EOF ;; @@ -226,7 +224,7 @@ generate_static_system() { uci -q batch <<-EOF delete system.@system[0] add system system - set system.@system[-1].hostname='LEDE' + set system.@system[-1].hostname='OpenWrt' set system.@system[-1].timezone='UTC' set system.@system[-1].ttylogin='0' set system.@system[-1].log_size='64' @@ -236,10 +234,10 @@ generate_static_system() { set system.ntp='timeserver' set system.ntp.enabled='1' set system.ntp.enable_server='0' - add_list system.ntp.server='0.lede.pool.ntp.org' - add_list system.ntp.server='1.lede.pool.ntp.org' - add_list system.ntp.server='2.lede.pool.ntp.org' - add_list system.ntp.server='3.lede.pool.ntp.org' + add_list system.ntp.server='0.openwrt.pool.ntp.org' + add_list system.ntp.server='1.openwrt.pool.ntp.org' + add_list system.ntp.server='2.openwrt.pool.ntp.org' + add_list system.ntp.server='3.openwrt.pool.ntp.org' EOF if json_is_a system object; then diff --git a/package/base-files/files/etc/banner b/package/base-files/files/etc/banner index 4ec646a933..f3af3c014f 100644 --- a/package/base-files/files/etc/banner +++ b/package/base-files/files/etc/banner @@ -1,10 +1,8 @@ - _________ - / /\ _ ___ ___ ___ - / LE / \ | | | __| \| __| - / DE / \ | |__| _|| |) | _| - /________/ LE \ |____|___|___/|___| lede-project.org - \ \ DE / - \ LE \ / ----------------------------------------------------------- - \ DE \ / %N (%V, %C) - \________\/ ----------------------------------------------------------- - + _______ ________ __ + | |.-----.-----.-----.| | | |.----.| |_ + | - || _ | -__| || | | || _|| _| + |_______|| __|_____|__|__||________||__| |____| + |__| W I R E L E S S F R E E D O M + ----------------------------------------------------- + %D %V, %C + ----------------------------------------------------- diff --git a/package/base-files/files/etc/config/fstab b/package/base-files/files/etc/config/fstab deleted file mode 100644 index fcc6c7bc19..0000000000 --- a/package/base-files/files/etc/config/fstab +++ /dev/null @@ -1,13 +0,0 @@ - -config global - option from_fstab '1' - option anon_swap '1' - option anon_mount '1' - option auto_swap '1' - option auto_mount '1' - option delay_root '5' - option check_fs '0' - - - - diff --git a/package/base-files/files/etc/init.d/gpio_switch b/package/base-files/files/etc/init.d/gpio_switch index 1f1b44b212..b67950a992 100755 --- a/package/base-files/files/etc/init.d/gpio_switch +++ b/package/base-files/files/etc/init.d/gpio_switch @@ -1,7 +1,7 @@ #!/bin/sh /etc/rc.common # Copyright (C) 2015 OpenWrt.org -START=98 +START=94 STOP=10 USE_PROCD=1 @@ -22,10 +22,9 @@ load_gpio_switch() echo "$gpio_pin" >/sys/class/gpio/export # we need to wait a bit until the GPIO appears [ -d "$gpio_path" ] || sleep 1 - echo out >"$gpio_path/direction" } - # write 0 or 1 to the "value" field - { [ "$value" = "0" ] && echo "0" || echo "1"; } >"$gpio_path/value" + # set the pin to output with high or low pin value + { [ "$value" = "0" ] && echo "high" || echo "low"; } >"$gpio_path/direction" } service_triggers() diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led index 7c2a185013..c790e3e181 100755 --- a/package/base-files/files/etc/init.d/led +++ b/package/base-files/files/etc/init.d/led @@ -72,6 +72,7 @@ load_led() { [ -n "$dev" ] && { echo $dev > /sys/class/leds/${sysfs}/device_name echo $mode > /sys/class/leds/${sysfs}/mode + echo $interval > /sys/class/leds/${sysfs}/interval } ;; diff --git a/package/base-files/files/etc/init.d/system b/package/base-files/files/etc/init.d/system index 8c5f677299..531aa8cbc5 100755 --- a/package/base-files/files/etc/init.d/system +++ b/package/base-files/files/etc/init.d/system @@ -7,7 +7,7 @@ USE_PROCD=1 validate_system_section() { uci_validate_section system system "${1}" \ - 'hostname:string:lede' \ + 'hostname:string:OpenWrt' \ 'conloglevel:uinteger' \ 'buffersize:uinteger' \ 'timezone:string:UTC' \ diff --git a/package/base-files/files/etc/openwrt_release b/package/base-files/files/etc/openwrt_release index da86208f7f..d03400ca05 100644 --- a/package/base-files/files/etc/openwrt_release +++ b/package/base-files/files/etc/openwrt_release @@ -1,8 +1,7 @@ DISTRIB_ID='%D' DISTRIB_RELEASE='%V' DISTRIB_REVISION='%R' -DISTRIB_CODENAME='%n' DISTRIB_TARGET='%S' DISTRIB_ARCH='%A' -DISTRIB_DESCRIPTION='%D %N %V %C' +DISTRIB_DESCRIPTION='%D %V %C' DISTRIB_TAINTS='%t' diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile index 3eda09b456..e9936fb36a 100644 --- a/package/base-files/files/etc/profile +++ b/package/base-files/files/etc/profile @@ -1,6 +1,9 @@ #!/bin/sh +[ -e /tmp/.failsafe ] && export FAILSAFE=1 + [ -f /etc/banner ] && cat /etc/banner -[ -e /tmp/.failsafe ] && cat /etc/banner.failsafe +[ -n "$FAILSAFE" ] && cat /etc/banner.failsafe + fgrep -sq '/ overlay ro,' /proc/mounts && { echo 'Your JFFS2-partition seems full and overlayfs is mounted read-only.' echo 'Please try to remove files from /overlay/upper/... and reboot!' diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common index e80af891e6..3e237170b4 100755 --- a/package/base-files/files/etc/rc.common +++ b/package/base-files/files/etc/rc.common @@ -41,14 +41,15 @@ disable() { } enable() { + err=1 name="$(basename "${initscript}")" - disable - [ -n "$START" -o -n "$STOP" ] || { - echo "/etc/init.d/$name does not have a START or STOP value" - return 1 - } - [ "$START" ] && ln -s "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}" - [ "$STOP" ] && ln -s "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/K${STOP}${name##K[0-9][0-9]}" + [ "$START" ] && \ + ln -sf "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}" && \ + err=0 + [ "$STOP" ] && \ + ln -sf "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/K${STOP}${name##K[0-9][0-9]}" && \ + err=0 + return $err } enabled() { @@ -88,6 +89,10 @@ service_triggers() { return 0 } +service_data() { + return 0 +} + service_running() { return 0 } @@ -122,12 +127,14 @@ ${INIT_TRACE:+set -x} } stop() { + procd_lock stop_service "$@" procd_kill "$(basename ${basescript:-$initscript})" "$1" } reload() { if eval "type reload_service" 2>/dev/null >/dev/null; then + procd_lock reload_service "$@" else start diff --git a/package/base-files/files/etc/sysctl.conf b/package/base-files/files/etc/sysctl.conf index 91a3ac9a02..ddc7a9bf69 100644 --- a/package/base-files/files/etc/sysctl.conf +++ b/package/base-files/files/etc/sysctl.conf @@ -1,5 +1,6 @@ kernel.panic=3 kernel.core_pattern=/tmp/%e.%t.%p.%s.core +fs.suid_dumpable=2 net.ipv4.conf.default.arp_ignore=1 net.ipv4.conf.all.arp_ignore=1 diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index 81ef84b8ef..dfadfdb2d9 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -202,7 +202,7 @@ add_group_and_user() { if [ -n "$gname" ] && [ -n "$gid" ]; then group_exists "$gname" || group_add "$gname" "$gid" elif [ -n "$gname" ]; then - group_add_next "$gname"; gid=$? + gid="$(group_add_next "$gname")" fi if [ -n "$uname" ]; then @@ -235,12 +235,16 @@ default_postinst() { rm -fR $root/rootfs-overlay/ fi + if [ -z "$root" ] && grep -q -s "^/etc/modules.d/" "/usr/lib/opkg/info/${pkgname}.list"; then + kmodloader + fi + if [ -z "$root" ] && grep -q -s "^/etc/uci-defaults/" "/usr/lib/opkg/info/${pkgname}.list"; then . /lib/functions/system.sh [ -d /tmp/.uci ] || mkdir -p /tmp/.uci for i in $(sed -ne 's!^/etc/uci-defaults/!!p' "/usr/lib/opkg/info/${pkgname}.list"); do ( cd /etc/uci-defaults - [ -f "$i" ] && . "$i" && rm -f "$i" + [ -f "$i" ] && . ./"$i" && rm -f "$i" ) done uci commit fi @@ -292,9 +296,7 @@ group_add() { [ -f "${IPKG_INSTROOT}/etc/group" ] || return 1 [ -n "$IPKG_INSTROOT" ] || lock /var/lock/group echo "${name}:x:${gid}:" >> ${IPKG_INSTROOT}/etc/group - rc=$? [ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/group - return $rc } group_exists() { @@ -304,14 +306,17 @@ group_exists() { group_add_next() { local gid gids gid=$(grep -s "^${1}:" ${IPKG_INSTROOT}/etc/group | cut -d: -f3) - [ -n "$gid" ] && return $gid + if [ -n "$gid" ]; then + echo $gid + return + fi gids=$(cat ${IPKG_INSTROOT}/etc/group | cut -d: -f3) gid=65536 while [ -n "$(echo "$gids" | grep "^$gid$")" ] ; do gid=$((gid + 1)) done group_add $1 $gid - return $gid + echo $gid } group_add_user() { @@ -344,9 +349,7 @@ user_add() { [ -n "$IPKG_INSTROOT" ] || lock /var/lock/passwd echo "${name}:x:${uid}:${gid}:${desc}:${home}:${shell}" >> ${IPKG_INSTROOT}/etc/passwd echo "${name}:x:0:0:99999:7:::" >> ${IPKG_INSTROOT}/etc/shadow - rc=$? [ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/passwd - return $rc } user_exists() { diff --git a/package/base-files/files/lib/functions/leds.sh b/package/base-files/files/lib/functions/leds.sh index 857e7e5392..83e775fada 100644 --- a/package/base-files/files/lib/functions/leds.sh +++ b/package/base-files/files/lib/functions/leds.sh @@ -1,6 +1,18 @@ #!/bin/sh # Copyright (C) 2013 OpenWrt.org +get_dt_led() { + local label + local ledpath + local basepath="/proc/device-tree" + local nodepath="$basepath/aliases/led-$1" + + [ -f "$nodepath" ] && ledpath=$(cat "$nodepath") + [ -n "$ledpath" ] && label=$(cat "$basepath$ledpath/label") + + echo "$label" +} + led_set_attr() { [ -f "/sys/class/leds/$1/$2" ] && echo "$3" > "/sys/class/leds/$1/$2" } diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh index 82ac1d2a4d..3126fe6510 100755 --- a/package/base-files/files/lib/functions/uci-defaults.sh +++ b/package/base-files/files/lib/functions/uci-defaults.sh @@ -319,6 +319,7 @@ ucidef_add_atm_bridge() { local vci="$2" local encaps="$3" local payload="$4" + local nameprefix="$5" json_select_object dsl json_select_object atmbridge @@ -326,6 +327,7 @@ ucidef_add_atm_bridge() { json_add_int vci "$vci" json_add_string encaps "$encaps" json_add_string payload "$payload" + json_add_string nameprefix "$nameprefix" json_select .. json_select .. } diff --git a/package/base-files/files/lib/preinit/10_indicate_preinit b/package/base-files/files/lib/preinit/10_indicate_preinit index 5442a749b1..c3ec7bfdf7 100644 --- a/package/base-files/files/lib/preinit/10_indicate_preinit +++ b/package/base-files/files/lib/preinit/10_indicate_preinit @@ -113,7 +113,7 @@ preinit_ip() { preinit_config_board fi - preinit_net_echo "Doing Lede Preinit\n" + preinit_net_echo "Doing OpenWrt Preinit\n" } preinit_ip_deconfig() { diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index e1f6ded689..71cffc8587 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -117,24 +117,6 @@ export_bootdevice() { esac case "$disk" in - PARTUUID=[A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9]-[A-F0-9][A-F0-9][A-F0-9][A-F0-9]-[A-F0-9][A-F0-9][A-F0-9][A-F0-9]-[A-F0-9][A-F0-9][A-F0-9][A-F0-9]-[A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9]0002) - uuid="${disk#PARTUUID=}" - uuid="${uuid%0002}0002" - for disk in $(find /dev -type b); do - set -- $(dd if=$disk bs=1 skip=$((2*512+256+128+16)) count=16 2>/dev/null | hexdump -v -e '4/1 "%02x"' | awk '{ \ - for(i=1;i<9;i=i+2) first=substr($0,i,1) substr($0,i+1,1) first; \ - for(i=9;i<13;i=i+2) second=substr($0,i,1) substr($0,i+1,1) second; \ - for(i=13;i<16;i=i+2) third=substr($0,i,1) substr($0,i+1,1) third; \ - fourth = substr($0,17,4); \ - five = substr($0,21,12); \ - } END { print toupper(first"-"second"-"third"-"fourth"-"five) }') - if [ "$1" = "$uuid" ]; then - uevent="/sys/class/block/${disk##*/}/uevent" - export SAVE_PARTITIONS=0 - break - fi - done -;; PARTUUID=[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]-02) uuid="${disk#PARTUUID=}" uuid="${uuid%-02}" @@ -178,6 +160,14 @@ export_partdevice() { return 1 } +hex_le32_to_cpu() { + [ "$(echo 01 | hexdump -v -n 2 -e '/2 "%x"')" == "3031" ] && { + echo "${1:0:2}${1:8:2}${1:6:2}${1:4:2}${1:2:2}" + return + } + echo "$@" +} + get_partitions() { # local disk="$1" local filename="$2" @@ -185,8 +175,8 @@ get_partitions() { # if [ -b "$disk" -o -f "$disk" ]; then v "Reading partition table from $filename..." - local magic="$(hexdump -v -n 2 -s 0x1FE -e '1/2 "0x%04X"' "$disk")" - if [ "$magic" != 0xAA55 ]; then + local magic=$(dd if="$disk" bs=2 count=1 skip=255 2>/dev/null) + if [ "$magic" != $'\x55\xAA' ]; then v "Invalid partition table on $disk" exit fi @@ -197,9 +187,9 @@ get_partitions() { # for part in 1 2 3 4; do set -- $(hexdump -v -n 12 -s "$((0x1B2 + $part * 16))" -e '3/4 "0x%08X "' "$disk") - local type="$(($1 % 256))" - local lba="$(($2))" - local num="$(($3))" + local type="$(( $(hex_le32_to_cpu $1) % 256))" + local lba="$(( $(hex_le32_to_cpu $2) ))" + local num="$(( $(hex_le32_to_cpu $3) ))" [ $type -gt 0 ] || continue diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh index 563db4c320..42f488c118 100644 --- a/package/base-files/files/lib/upgrade/nand.sh +++ b/package/base-files/files/lib/upgrade/nand.sh @@ -239,30 +239,23 @@ nand_upgrade_ubifs() { nand_do_upgrade_success } -nand_board_name() { - if type 'platform_nand_board_name' >/dev/null 2>/dev/null; then - platform_nand_board_name - return - fi - - cat /tmp/sysinfo/board_name -} - nand_upgrade_tar() { local tar_file="$1" - local board_name="$(nand_board_name)" local kernel_mtd="$(find_mtd_index $CI_KERNPART)" - local kernel_length=`(tar xf $tar_file sysupgrade-$board_name/kernel -O | wc -c) 2> /dev/null` - local rootfs_length=`(tar xf $tar_file sysupgrade-$board_name/root -O | wc -c) 2> /dev/null` + local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') + board_dir=${board_dir%/} - local rootfs_type="$(identify_tar "$tar_file" sysupgrade-$board_name/root)" + local kernel_length=`(tar xf $tar_file ${board_dir}/kernel -O | wc -c) 2> /dev/null` + local rootfs_length=`(tar xf $tar_file ${board_dir}/root -O | wc -c) 2> /dev/null` + + local rootfs_type="$(identify_tar "$tar_file" ${board_dir}/root)" local has_kernel=1 local has_env=0 [ "$kernel_length" != 0 -a -n "$kernel_mtd" ] && { - tar xf $tar_file sysupgrade-$board_name/kernel -O | mtd write - $CI_KERNPART + tar xf $tar_file ${board_dir}/kernel -O | mtd write - $CI_KERNPART } [ "$kernel_length" = 0 -o ! -z "$kernel_mtd" ] && has_kernel=0 @@ -271,12 +264,12 @@ nand_upgrade_tar() { local ubidev="$( nand_find_ubi "$CI_UBIPART" )" [ "$has_kernel" = "1" ] && { local kern_ubivol="$(nand_find_volume $ubidev $CI_KERNPART)" - tar xf $tar_file sysupgrade-$board_name/kernel -O | \ + tar xf $tar_file ${board_dir}/kernel -O | \ ubiupdatevol /dev/$kern_ubivol -s $kernel_length - } local root_ubivol="$(nand_find_volume $ubidev rootfs)" - tar xf $tar_file sysupgrade-$board_name/root -O | \ + tar xf $tar_file ${board_dir}/root -O | \ ubiupdatevol /dev/$root_ubivol -s $rootfs_length - nand_do_upgrade_success diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2 index d7f92a4f35..3985d8fd7e 100755 --- a/package/base-files/files/lib/upgrade/stage2 +++ b/package/base-files/files/lib/upgrade/stage2 @@ -84,6 +84,7 @@ kill_remaining() { # [ [ ] ] local loop="${2:-0}" local run=true local stat + local proc_ppid=$(cut -d' ' -f4 /proc/$$/stat) echo -n "Sending $sig to remaining processes ... " @@ -96,8 +97,8 @@ kill_remaining() { # [ [ ] ] read pid name state ppid rest < $stat name="${name#(}"; name="${name%)}" - # Skip PID1, ourself and our children - [ $pid -ne 1 -a $pid -ne $$ -a $ppid -ne $$ ] || continue + # Skip PID1, our parent, ourself and our children + [ $pid -ne 1 -a $pid -ne $proc_ppid -a $pid -ne $$ -a $ppid -ne $$ ] || continue local cmdline read cmdline < /proc/$pid/cmdline diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index 359f21f51c..c747c4eaad 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -55,7 +55,6 @@ Usage: $0 [...] $0 [-q] [-i] upgrade-option: - -d add a delay before rebooting -f restore configuration from .tar.gz (file or url) -i interactive mode -c attempt to preserve all changed files in /etc/ @@ -108,14 +107,8 @@ add_uci_conffiles() { add_overlayfiles() { local file="$1" - if [ -d /overlay/upper ]; then - local overlaydir="/overlay/upper" - else - local overlaydir="/overlay" - fi - find $overlaydir/etc/ -type f -o -type l | sed \ + find /overlay/upper/etc/ -type f -o -type l | sed \ -e 's,^/overlay\/upper/,/,' \ - -e 's,^/overlay/,/,' \ -e '\,/META_[a-zA-Z0-9]*$,d' \ -e '\,/functions.sh$,d' \ -e '\,/[^/]*-opkg$,d' \ @@ -126,9 +119,16 @@ add_overlayfiles() { # hooks sysupgrade_image_check="fwtool_check_image platform_check_image" sysupgrade_pre_upgrade="fwtool_pre_upgrade" -[ $SAVE_OVERLAY = 0 -o ! -d /overlay/etc ] && \ - sysupgrade_init_conffiles="add_uci_conffiles" || \ + +if [ $SAVE_OVERLAY = 1 ]; then + [ ! -d /overlay/upper/etc ] && { + echo "Cannot find '/overlay/upper/etc', required for '-c'" + exit 1 + } sysupgrade_init_conffiles="add_overlayfiles" +else + sysupgrade_init_conffiles="add_uci_conffiles" +fi include /lib/upgrade @@ -152,7 +152,7 @@ do_save_conffiles() { } if [ $CONF_BACKUP_LIST -eq 1 ]; then - add_uci_conffiles "$CONFFILES" + run_hooks "$CONFFILES" $sysupgrade_init_conffiles cat "$CONFFILES" rm -f "$CONFFILES" exit 0 diff --git a/package/base-files/files/usr/lib/os-release b/package/base-files/files/usr/lib/os-release index 21abf969e1..82ade59406 100644 --- a/package/base-files/files/usr/lib/os-release +++ b/package/base-files/files/usr/lib/os-release @@ -1,8 +1,8 @@ NAME="%D" -VERSION="%V, %N" +VERSION="%V" ID="%d" ID_LIKE="lede openwrt" -PRETTY_NAME="%D %N %V" +PRETTY_NAME="%D %V" VERSION_ID="%v" HOME_URL="%m" BUG_URL="%b" @@ -15,4 +15,4 @@ LEDE_DEVICE_MANUFACTURER="%M" LEDE_DEVICE_MANUFACTURER_URL="%m" LEDE_DEVICE_PRODUCT="%P" LEDE_DEVICE_REVISION="%h" -LEDE_RELEASE="%D %N %V %C" +LEDE_RELEASE="%D %V %C" diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index 87d2ac6c54..dbbd60b152 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -158,18 +158,11 @@ if VERSIONOPT config VERSION_DIST string prompt "Release distribution" - default "LEDE" + default "OpenWrt" help This is the name of the release distribution. If unspecified, it defaults to OpenWrt. - config VERSION_NICK - string - prompt "Release version nickname" - help - This is the release codename embedded in the image. - If unspecified, it defaults to the name of source branch. - config VERSION_NUMBER string prompt "Release version number" @@ -199,15 +192,13 @@ if VERSIONOPT %v .. Configured release version number or "snapshot", lowercase %C .. Configured release revision code or value of %R, uppercase %c .. Configured release revision code or value of %R, lowercase - %N .. Release name, uppercase - %n .. Release name, lowercase - %D .. Distribution name or "Lede", uppercase - %d .. Distribution name or "lede", lowercase + %D .. Distribution name or "OpenWrt", uppercase + %d .. Distribution name or "openwrt", lowercase %T .. Target name %S .. Target/Subtarget name %A .. Package architecture %t .. Build taint flags, e.g. "no-all busybox" - %M .. Manufacturer name or "Lede" + %M .. Manufacturer name or "OpenWrt" %P .. Product name or "Generic" %h .. Hardware revision or "v0" diff --git a/package/boot/arm-trusted-firmware-sunxi/Makefile b/package/boot/arm-trusted-firmware-sunxi/Makefile new file mode 100644 index 0000000000..88d4f6efaa --- /dev/null +++ b/package/boot/arm-trusted-firmware-sunxi/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2017 Hauke Mehrtens +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=arm-trusted-firmware-sunxi +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL=https://github.com/apritzel/arm-trusted-firmware +PKG_SOURCE_DATE:=2016-07-12 +PKG_SOURCE_VERSION:=87e8aedd80e6448a55b2328768d956fcb5f5d410 +PKG_MIRROR_HASH:=4e71a7d4bc0613533854c646b0fa574b18503c0ab28621aac67c70b9827562d8 + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=license.md + +PKG_MAINTAINER:=Hauke Mehrtens + +include $(INCLUDE_DIR)/package.mk + + +define Package/arm-trusted-firmware-sunxi + SECTION:=boot + CATEGORY:=Boot Loaders + TITLE:=ARM Trusted Firmware for Allwinner + DEPENDS:=@TARGET_sunxi_cortexa53 +endef + +export GCC_HONOUR_COPTS=s + +MAKE_VARS = \ + CROSS_COMPILE="$(TARGET_CROSS)" + +MAKE_FLAGS += \ + PLAT=sun50iw1p1 \ + DEBUG=1 \ + bl31 + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/build/sun50iw1p1/debug/bl31.bin $(STAGING_DIR_IMAGE)/bl31.bin +endef + +define Package/arm-trusted-firmware-sunxi/install +endef + +$(eval $(call BuildPackage,arm-trusted-firmware-sunxi)) diff --git a/package/boot/at91bootstrap/Makefile b/package/boot/at91bootstrap/Makefile new file mode 100644 index 0000000000..e704c357d1 --- /dev/null +++ b/package/boot/at91bootstrap/Makefile @@ -0,0 +1,87 @@ +# +# Copyright (C) 2016 Microchip Technology Inc. +# +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=at91bootstrap +PKG_VERSION:=v3.8.8 +PKG_RELEASE:= + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/linux4sam/at91bootstrap.git +PKG_SOURCE_VERSION:=3d33a4e0707c61007a5278f6620453502f7500db + +PKG_BUILD_DIR = \ + $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +include at91bootstrap.mk +include $(INCLUDE_DIR)/package.mk + +define AT91Bootstrap/Default + BUILD_TARGET:=at91 + BUILD_SUBTARGET:=sama5 + HIDDEN:=1 + AT91BOOTSTRAP_IMAGE:=at91bootstrap.bin +endef + +define AT91Bootstrap/sama5d2_xplaineddf_uboot + TITLE:=AT91Bootstrap for SAMA5D2 Xplained board (SPI Flash) + BUILD_DEVICES:=at91-sama5d2_xplained +endef + +define AT91Bootstrap/sama5d2_xplaineddf_qspi_uboot + TITLE:=AT91Bootstrap for SAMA5D2 Xplained board (QSPI Flash) + BUILD_DEVICES:=at91-sama5d2_xplained +endef + +define AT91Bootstrap/sama5d2_xplainedsd_uboot + TITLE:=AT91Bootstrap for SAMA5D2 Xplained board (SDcard/EMMC) + BUILD_DEVICES:=at91-sama5d2_xplained +endef + +define AT91Bootstrap/sama5d3_xplainednf_uboot + TITLE:=AT91Bootstrap for SAMA5D3 Xplained board (Nand Flash) + BUILD_DEVICES:=at91-sama5d3_xplained +endef + +define AT91Bootstrap/sama5d3_xplainedsd_uboot + TITLE:=AT91Bootstrap for SAMA5D3 Xplained board (SDcard) + BUILD_DEVICES:=at91-sama5d3_xplained +endef + +define AT91Bootstrap/sama5d4_xplainednf_uboot_secure + TITLE:=AT91Bootstrap for SAMA5D4 Xplained board (Nand Flash) + BUILD_DEVICES:=at91-sama5d4_xplained +endef + +define AT91Bootstrap/sama5d4_xplaineddf_uboot_secure + TITLE:=AT91Bootstrap for SAMA5D4 Xplained board (SPI Flash) + BUILD_DEVICES:=at91-sama5d4_xplained +endef + +define AT91Bootstrap/sama5d4_xplainedsd_uboot_secure + TITLE:=AT91Bootstrap for SAMA5D4 Xplained board (SDcard) + BUILD_DEVICES:=at91-sama5d4_xplained +endef + +AT91BOOTSTRAP_TARGETS := \ + sama5d2_xplaineddf_uboot \ + sama5d2_xplaineddf_qspi_uboot \ + sama5d2_xplainedsd_uboot \ + sama5d3_xplainednf_uboot \ + sama5d3_xplainedsd_uboot \ + sama5d4_xplainednf_uboot_secure \ + sama5d4_xplaineddf_uboot_secure \ + sama5d4_xplainedsd_uboot_secure + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + CROSS_COMPILE=$(TARGET_CROSS) +endef + +$(eval $(call BuildPackage/AT91Bootstrap)) diff --git a/package/boot/at91bootstrap/at91bootstrap.mk b/package/boot/at91bootstrap/at91bootstrap.mk new file mode 100644 index 0000000000..dda5fa4e9c --- /dev/null +++ b/package/boot/at91bootstrap/at91bootstrap.mk @@ -0,0 +1,88 @@ + +PKG_TARGETS := bin +PKG_FLAGS:=nonshared + +export GCC_HONOUR_COPTS=s + +define Package/at91bootstrap/install/default + $(CP) $(PKG_BUILD_DIR)/binaries/*uboot* $(1)/ +endef + +Package/at91bootstrap/install = $(Package/at91bootstrap/install/default) + +define AT91Bootstrap/Init + BUILD_TARGET:= + BUILD_SUBTARGET:= + BUILD_DEVICES:= + NAME:= + DEPENDS:= + HIDDEN:= + DEFAULT:= + VARIANT:=$(1) + AT91BOOTSTRAP_CONFIG:=$(1) +endef + +TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET)) + +AT91BOOTSTRAP_MAKE_FLAGS = \ + HOSTCC="$(HOSTCC)" \ + HOSTCFLAGS='$(HOST_CFLAGS) $$$$(HOSTCPPFLAGS)' \ + HOSTLDFLAGS="" + +define Build/AT91Bootstrap/Target + $(eval $(call AT91Bootstrap/Init,$(1))) + $(eval $(call AT91Bootstrap/Default,$(1))) + $(eval $(call AT91Bootstrap/$(1),$(1))) + + define Package/at91bootstrap-$(1) + SECTION:=boot + CATEGORY:=Boot Loaders + TITLE:= .$(NAME) + VARIANT:=$(VARIANT) + DEPENDS:=@!IN_SDK $(DEPENDS) + HIDDEN:=$(HIDDEN) + ifneq ($(BUILD_TARGET),) + DEPENDS += @$(TARGET_DEP) + ifneq ($(BUILD_DEVICES),) + DEFAULT := y if ($(TARGET_DEP)_Default \ + $(patsubst %,|| $(TARGET_DEP)_DEVICE_%,$(BUILD_DEVICES)) \ + $(patsubst %,|| $(patsubst TARGET_%,TARGET_DEVICE_%, \ + $(TARGET_DEP))_DEVICE_%,$(BUILD_DEVICES))) + endif + endif + $(if $(DEFAULT),DEFAULT:=$(DEFAULT)) + URL:=https://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap + endef + + define Package/at91bootstrap-$(1)/install + $$(Package/at91bootstrap/install) + endef +endef + +define Build/Configure/AT91Bootstrap + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + $(AT91BOOTSTRAP_CONFIG)_defconfig +endef + + +define Build/Compile/AT91Bootstrap + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + CROSS_COMPILE=$(TARGET_CROSS) \ + $(AT91BOOTSTRAP_MAKE_FLAGS) +endef + +define BuildPackage/AT91Bootstrap/Defaults + Build/Configure/Default = $$$$(Build/Configure/AT91Bootstrap) + Build/Compile/Default = $$$$(Build/Compile/AT91Bootstrap) +endef + +define BuildPackage/AT91Bootstrap + $(eval $(call BuildPackage/AT91Bootstrap/Defaults)) + $(foreach type,$(if $(DUMP),$(AT91BOOTSTRAP_TARGETS),$(BUILD_VARIANT)), \ + $(eval $(call Build/AT91Bootstrap/Target,$(type))) + ) + $(eval $(call Build/DefaultTargets)) + $(foreach type,$(if $(DUMP),$(AT91BOOTSTRAP_TARGETS),$(BUILD_VARIANT)), \ + $(call BuildPackage,at91bootstrap-$(type)) + ) +endef diff --git a/package/boot/grub2/common.mk b/package/boot/grub2/Makefile similarity index 57% rename from package/boot/grub2/common.mk rename to package/boot/grub2/Makefile index 0f528f0b60..8cfc0dcff9 100644 --- a/package/boot/grub2/common.mk +++ b/package/boot/grub2/Makefile @@ -1,24 +1,34 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=grub +PKG_CPE_ID:=cpe:/a:gnu:grub2 PKG_VERSION:=2.02 PKG_RELEASE:=1 -PKG_SOURCE:=grub-$(PKG_VERSION).tar.xz +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/grub PKG_HASH:=810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f PKG_FIXUP:=autoreconf HOST_BUILD_PARALLEL:=1 +PKG_BUILD_DEPENDS:=grub2/host PKG_SSP:=0 PKG_FLAGS:=nonshared -PATCH_DIR := ../patches -HOST_PATCH_DIR := ../patches - include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk -define Package/grub2/Default +define Package/grub2 CATEGORY:=Boot Loaders SECTION:=boot TITLE:=GRand Unified Bootloader @@ -26,6 +36,19 @@ define Package/grub2/Default DEPENDS:=@TARGET_x86||TARGET_x86_64 endef +define Package/grub2-editenv + CATEGORY:=Utilities + SECTION:=utils + SUBMENU:=Boot Loaders + TITLE:=Grub2 Environment editor + URL:=http://www.gnu.org/software/grub/ + DEPENDS:=@TARGET_x86||TARGET_x86_64 +endef + +define Package/grub2-editenv/description + Edit grub2 environment files. +endef + HOST_BUILD_PREFIX := $(STAGING_DIR_HOST) CONFIGURE_VARS += \ @@ -59,3 +82,11 @@ define Host/Configure $(Host/Configure/Default) endef +define Package/grub2-editenv/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-editenv $(1)/usr/sbin/ +endef + +$(eval $(call HostBuild)) +$(eval $(call BuildPackage,grub2)) +$(eval $(call BuildPackage,grub2-editenv)) diff --git a/package/boot/grub2/grub2-efi/Makefile b/package/boot/grub2/grub2-efi/Makefile deleted file mode 100644 index 37e0b353e7..0000000000 --- a/package/boot/grub2/grub2-efi/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=grub-efi - -include ../common.mk - -TAR_OPTIONS:= --transform 's/grub-${PKG_VERSION}/${PKG_NAME}-${PKG_VERSION}/' $(TAR_OPTIONS) - -PKG_BUILD_DEPENDS:=grub2-efi/host - -CONFIGURE_ARGS += --with-platform=efi -HOST_CONFIGURE_ARGS += --with-platform=efi --program-suffix=-efi - -define Package/grub2-efi -$(call Package/grub2/Default) -HIDDEN:=1 -TITLE += (with EFI support) -endef - -$(eval $(call HostBuild)) -$(eval $(call BuildPackage,grub2-efi)) diff --git a/package/boot/grub2/grub2/Makefile b/package/boot/grub2/grub2/Makefile deleted file mode 100644 index c00797662b..0000000000 --- a/package/boot/grub2/grub2/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=grub - -include ../common.mk - -PKG_BUILD_DEPENDS:=grub2/host - -define Package/grub2 -$(call Package/grub2/Default) -endef - -define Package/grub2-editenv - CATEGORY:=Utilities - SECTION:=utils - TITLE:=Grub2 Environment editor - URL:=http://www.gnu.org/software/grub/ - DEPENDS:=@TARGET_x86||TARGET_x86_64 -endef - -define Package/grub2-editenv/description - Edit grub2 environment files. -endef - -define Package/grub2-editenv/install - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-editenv $(1)/usr/sbin/ -endef - -$(eval $(call HostBuild)) -$(eval $(call BuildPackage,grub2)) -$(eval $(call BuildPackage,grub2-editenv)) diff --git a/package/boot/kobs-ng/patches/001-compile.patch b/package/boot/kobs-ng/patches/001-compile.patch index 67da93a324..8648dc8b94 100644 --- a/package/boot/kobs-ng/patches/001-compile.patch +++ b/package/boot/kobs-ng/patches/001-compile.patch @@ -10,13 +10,14 @@ #include --- a/src/mtd.h +++ b/src/mtd.h -@@ -25,8 +25,10 @@ +@@ -25,8 +25,11 @@ #ifndef MTD_H #define MTD_H +#define _GNU_SOURCE #include #include ++#include +#include #include "BootControlBlocks.h" diff --git a/package/boot/rbcfg/Makefile b/package/boot/rbcfg/Makefile index 412f7ab11a..9d9b97524a 100644 --- a/package/boot/rbcfg/Makefile +++ b/package/boot/rbcfg/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rbcfg -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) diff --git a/package/boot/rbcfg/src/main.c b/package/boot/rbcfg/src/main.c index 9aedcc55a8..2acbfbd8cb 100644 --- a/package/boot/rbcfg/src/main.c +++ b/package/boot/rbcfg/src/main.c @@ -2,6 +2,7 @@ * RouterBOOT configuration utility * * Copyright (C) 2010 Gabor Juhos + * Copyright (C) 2017 Thibaut VARENE * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published @@ -29,6 +30,7 @@ #define RB_ERR_INVALID 2 #define RB_ERR_NOMEM 3 #define RB_ERR_IO 4 +#define RB_ERR_NOTWANTED 5 #define ARRAY_SIZE(_a) (sizeof((_a)) / sizeof((_a)[0])) @@ -67,6 +69,11 @@ struct rbcfg_command { int (*exec)(int argc, const char *argv[]); }; +struct rbcfg_soc { + const char *needle; + const int type; +}; + static void usage(void); /* Globals */ @@ -135,12 +142,32 @@ static const struct rbcfg_value rbcfg_cpu_mode[] = { RB_CPU_MODE_REGULAR), }; +static const struct rbcfg_value rbcfg_cpu_freq_dummy[] = { +}; + +static const struct rbcfg_value rbcfg_cpu_freq_qca953x[] = { + CFG_U32("-2", "-100MHz", RB_CPU_FREQ_L2), + CFG_U32("-1", "- 50MHz", RB_CPU_FREQ_L1), + CFG_U32("0", "Factory", RB_CPU_FREQ_N0), + CFG_U32("+1", "+ 50MHz", RB_CPU_FREQ_H1), + CFG_U32("+2", "+100MHz", RB_CPU_FREQ_H2), +}; + +static const struct rbcfg_value rbcfg_cpu_freq_ar9344[] = { + CFG_U32("-2", "-100MHz", RB_CPU_FREQ_L2), + CFG_U32("-1", "- 50MHz", RB_CPU_FREQ_L1), + CFG_U32("0", "Factory", RB_CPU_FREQ_N0), + CFG_U32("+1", "+ 50MHz", RB_CPU_FREQ_H1), + CFG_U32("+2", "+100MHz", RB_CPU_FREQ_H2), + CFG_U32("+3", "+150MHz", RB_CPU_FREQ_H3), +}; + static const struct rbcfg_value rbcfg_booter[] = { CFG_U32("regular", "load regular booter", RB_BOOTER_REGULAR), CFG_U32("backup", "force backup-booter loading", RB_BOOTER_BACKUP), }; -static const struct rbcfg_env rbcfg_envs[] = { +static struct rbcfg_env rbcfg_envs[] = { { .name = "boot_delay", .id = RB_ID_BOOT_DELAY, @@ -177,6 +204,12 @@ static const struct rbcfg_env rbcfg_envs[] = { .type = RBCFG_ENV_TYPE_U32, .values = rbcfg_cpu_mode, .num_values = ARRAY_SIZE(rbcfg_cpu_mode), + }, { + .name = "cpu_freq", + .id = RB_ID_CPU_FREQ, + .type = RBCFG_ENV_TYPE_U32, + .values = rbcfg_cpu_freq_dummy, + .num_values = ARRAY_SIZE(rbcfg_cpu_freq_dummy), }, { .name = "uart_speed", .id = RB_ID_UART_SPEED, @@ -240,8 +273,10 @@ rbcfg_find_tag(struct rbcfg_ctx *ctx, uint16_t tag_id, uint16_t *tag_len, buf += 2; buflen -= 2; - if (id == RB_ID_TERMINATOR) + if (id == RB_ID_TERMINATOR) { + ret = RB_ERR_NOTWANTED; break; + } if (buflen < len) break; @@ -257,7 +292,7 @@ rbcfg_find_tag(struct rbcfg_ctx *ctx, uint16_t tag_id, uint16_t *tag_len, buflen -= len; } - if (ret) + if (RB_ERR_NOTFOUND == ret) fprintf(stderr, "no tag found with id=%u\n", tag_id); return ret; @@ -748,6 +783,96 @@ usage(void) fprintf(stderr, "\n"); } +#define RBCFG_SOC_UNKNOWN 0 +#define RBCFG_SOC_QCA953X 1 +#define RBCFG_SOC_AR9344 2 + +static const struct rbcfg_soc rbcfg_socs[] = { + { + .needle = "QCA953", + .type = RBCFG_SOC_QCA953X, + }, { + .needle = "AR9344", + .type = RBCFG_SOC_AR9344, + }, +}; + +#define CPUINFO_BUFSIZE 128 /* lines of interest are < 80 chars */ + +static int cpuinfo_find_soc(void) +{ + FILE *fp; + char temp[CPUINFO_BUFSIZE]; + char *haystack, *needle; + int i, found = 0, soc_type = RBCFG_SOC_UNKNOWN; + + fp = fopen("/proc/cpuinfo", "r"); + if (!fp) + goto end; + + /* first, extract the system type line */ + needle = "system type"; + while(fgets(temp, CPUINFO_BUFSIZE, fp)) { + if (!strncmp(temp, needle, strlen(needle))) { + found = 1; + break; + } + } + + fclose(fp); + + /* failsafe in case cpuinfo format changes */ + if (!found) + goto end; + + /* skip the field header */ + haystack = strchr(temp, ':'); + + /* then, try to identify known SoC, stop at first match */ + for (i = 0; i < ARRAY_SIZE(rbcfg_socs); i++) { + if ((strstr(haystack, rbcfg_socs[i].needle))) { + soc_type = rbcfg_socs[i].type; + break; + } + } + +end: + return soc_type; +} + +static void fixup_rbcfg_envs(void) +{ + int i, num_val, soc_type; + const struct rbcfg_value * env_value; + + /* detect SoC */ + soc_type = cpuinfo_find_soc(); + + /* update rbcfg_envs */ + switch (soc_type) { + case RBCFG_SOC_QCA953X: + env_value = rbcfg_cpu_freq_qca953x; + num_val = ARRAY_SIZE(rbcfg_cpu_freq_qca953x); + break; + case RBCFG_SOC_AR9344: + env_value = rbcfg_cpu_freq_ar9344; + num_val = ARRAY_SIZE(rbcfg_cpu_freq_ar9344); + break; + } + + for (i = 0; i < ARRAY_SIZE(rbcfg_envs); i++) { + if (RB_ID_CPU_FREQ == rbcfg_envs[i].id) { + if (RBCFG_SOC_UNKNOWN == soc_type) + rbcfg_envs[i].id = RB_ID_TERMINATOR; + else { + rbcfg_envs[i].values = env_value; + rbcfg_envs[i].num_values = num_val; + } + break; + } + } +} + int main(int argc, const char *argv[]) { const struct rbcfg_command *cmd = NULL; @@ -756,6 +881,8 @@ int main(int argc, const char *argv[]) rbcfg_name = (char *) argv[0]; + fixup_rbcfg_envs(); + if (argc < 2) { usage(); return EXIT_FAILURE; diff --git a/package/boot/rbcfg/src/rbcfg.h b/package/boot/rbcfg/src/rbcfg.h index 864bc82172..88acc13dc1 100644 --- a/package/boot/rbcfg/src/rbcfg.h +++ b/package/boot/rbcfg/src/rbcfg.h @@ -32,6 +32,7 @@ #define RB_ID_BOOT_PROTOCOL 9 #define RB_ID_SOFT_10 10 #define RB_ID_SOFT_11 11 +#define RB_ID_CPU_FREQ 12 #define RB_ID_BOOTER 13 #define RB_UART_SPEED_115200 0 @@ -71,6 +72,13 @@ #define RB_BOOT_PROTOCOL_BOOTP 0 #define RB_BOOT_PROTOCOL_DHCP 1 +#define RB_CPU_FREQ_L2 (0 << 3) +#define RB_CPU_FREQ_L1 (1 << 3) +#define RB_CPU_FREQ_N0 (2 << 3) +#define RB_CPU_FREQ_H1 (3 << 3) +#define RB_CPU_FREQ_H2 (4 << 3) +#define RB_CPU_FREQ_H3 (5 << 3) + #define RB_BOOTER_REGULAR 0 #define RB_BOOTER_BACKUP 1 diff --git a/package/boot/uboot-at91/Makefile b/package/boot/uboot-at91/Makefile index 6a806ff635..cad12ec2f8 100644 --- a/package/boot/uboot-at91/Makefile +++ b/package/boot/uboot-at91/Makefile @@ -17,26 +17,79 @@ include $(INCLUDE_DIR)/package.mk define U-Boot/Default BUILD_TARGET:=at91 - BUILD_SUBTARGET:=legacy + HIDDEN:=1 UBOOT_IMAGE:=u-boot.bin boot.bin endef define U-Boot/at91sam9m10g45ek_nandflash NAME:=AT91SAM9M10G45-EK board (NandFlash) + BUILD_SUBTARGET:=legacy + BUILD_DEVICES:=at91sam9m10g45ek endef define U-Boot/at91sam9x5ek_nandflash NAME:=AT91SAM9X5-EK board (NandFlash) + BUILD_SUBTARGET:=legacy + BUILD_DEVICES:=at91sam9g15ek at91sam9g25ek at91sam9g35ek at91sam9x25ek at91sam9x35ek +endef + +define U-Boot/sama5d3_xplained_nandflash + NAME:=SAMA5D3 Xplained board (NandFlash) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d3_xplained +endef + +define U-Boot/sama5d3_xplained_mmc + NAME:=SAMA5D3 Xplained board (SDcard) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d3_xplained +endef + +define U-Boot/sama5d2_xplained_spiflash + NAME:=SAMA5D2 Xplained board (SPI Flash) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d2_xplained +endef + +define U-Boot/sama5d2_xplained_mmc + NAME:=SAMA5D2 Xplained board (SDcard/EMMC) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d2_xplained +endef + +define U-Boot/sama5d4_xplained_spiflash + NAME:=SAMA5D4 Xplained board (SPI Flash) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d4_xplained +endef + +define U-Boot/sama5d4_xplained_mmc + NAME:=SAMA5D4 Xplained board (SDcard) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d4_xplained +endef + +define U-Boot/sama5d4_xplained_nandflash + NAME:=SAMA5D4 Xplained board (NandFlash) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d4_xplained endef UBOOT_TARGETS := \ at91sam9m10g45ek_nandflash \ - at91sam9x5ek_nandflash + at91sam9x5ek_nandflash \ + sama5d3_xplained_nandflash \ + sama5d3_xplained_mmc \ + sama5d2_xplained_mmc \ + sama5d2_xplained_spiflash \ + sama5d4_xplained_mmc \ + sama5d4_xplained_spiflash \ + sama5d4_xplained_nandflash define Build/Compile +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ CROSS_COMPILE=$(TARGET_CROSS) \ - KCFLAGS="$(filter-out -fstack-protector, $(TARGET_CFLAGS))" + KCFLAGS="$(filter-out -fstack-protector -mfloat-abi=hard, $(TARGET_CFLAGS)) -mfloat-abi=soft" endef $(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 10175b0f77..57a2ec5393 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -19,7 +19,7 @@ PKG_SOURCE_URL:=\ ftp://ftp.denx.de/pub/u-boot PKG_HASH:=bdc68d5f9455ad933b059c735d983f2c8b6b552dafb062e5ff1444f623021955 -PKG_BUILD_DEPENDS:=+fstools +PKG_BUILD_DEPENDS:=fstools PKG_LICENSE:=GPL-2.0 GPL-2.0+ PKG_LICENSE_FILES:=Licenses/README diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx index 0bdb6dea41..66eaeb0df7 100644 --- a/package/boot/uboot-envtools/files/ar71xx +++ b/package/boot/uboot-envtools/files/ar71xx @@ -19,6 +19,7 @@ alfa-ap120c|\ all0258n|\ ap121f|\ ap90q|\ +ap91-5g|\ arduino-yun|\ cap324|\ cap4200ag|\ @@ -30,6 +31,7 @@ cr5000|\ eap300v2|\ ens202ext|\ gl-ar300m|\ +gl-ar750|\ hornet-ub|\ hornet-ub-x2|\ jwap230|\ @@ -39,11 +41,13 @@ mr600|\ mr600v2|\ mr900|\ mr900v2|\ +n5q|\ nbg6716|\ om5p|\ om5p-ac|\ om5p-acv2|\ om5p-an|\ +r36a|\ sr3200|\ tube2h|\ wndr3700|\ @@ -66,6 +70,7 @@ dap-2695-a1|\ wzr-hp-ag300h) ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000" ;; +dr342|\ dr531) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0xf800" "0x10000" ;; @@ -76,6 +81,9 @@ rambutan) qihoo-c301) ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000" ;; +wi2a-ac200i) + ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x8000" "0x10000" + ;; esac config_load ubootenv diff --git a/package/boot/uboot-envtools/files/ipq b/package/boot/uboot-envtools/files/ipq index b7162807f8..441ba48372 100644 --- a/package/boot/uboot-envtools/files/ipq +++ b/package/boot/uboot-envtools/files/ipq @@ -31,13 +31,17 @@ ubootenv_mtdinfo () { } case "$board" in -ap148 | db149) - ubootenv_add_uci_config $(ubootenv_mtdinfo) - ;; -ea8500) +linksys,ea8500) ubootenv_add_uci_config "/dev/mtd10" "0x0" "0x20000" "0x20000" ;; -nbg6817) +openmesh,a42) + ubootenv_add_uci_config "/dev/mtd5" "0x0" "0x10000" "0x10000" + ;; +qcom,ipq8064-ap148 |\ +qcom,ipq8064-db149) + ubootenv_add_uci_config $(ubootenv_mtdinfo) + ;; +zyxel,nbg6817) ubootenv_add_uci_config "/dev/mtdblock9" "0x0" "0x10000" "0x10000" ;; esac diff --git a/package/boot/uboot-envtools/files/kirkwood b/package/boot/uboot-envtools/files/kirkwood index 3b770c12f4..16123846cc 100644 --- a/package/boot/uboot-envtools/files/kirkwood +++ b/package/boot/uboot-envtools/files/kirkwood @@ -13,18 +13,16 @@ touch /etc/config/ubootenv board=$(board_name) case "$board" in -dockstar|\ -guruplug-server-plus|\ -ib62x0|\ -linksys-viper|\ -nsa310b|\ -nsa325|\ -pogo_e02|\ -sheevaplug|\ -sheevaplug-esata) +cloudengines,pogoe02|\ +cloudengines,pogoplugv4|\ +linksys,viper|\ +raidsonic,ib-nas62x0|\ +seagate,dockstar|\ +zyxel,nsa310b|\ +zyxel,nsa325) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" ;; -linksys-audi) +linksys,audi) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x4000" ;; esac diff --git a/package/boot/uboot-envtools/files/lantiq b/package/boot/uboot-envtools/files/lantiq index d1a6668e84..f4541a559b 100644 --- a/package/boot/uboot-envtools/files/lantiq +++ b/package/boot/uboot-envtools/files/lantiq @@ -13,19 +13,19 @@ touch /etc/config/ubootenv board=$(board_name) case "$board" in -BTHOMEHUBV2B) +bt,homehub-v2b) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" "1" ;; -BTHOMEHUBV3A) +bt,homehub-v3a) ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x4000" "1" ;; -GIGASX76X) +siemens,gigaset-sx76x) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" "1" ;; -P2812HNUF1) +zyxel,p-2812hnu-f1) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x2000" "0x20000" "1" ;; -WBMR300) +buffalo,wbmr-300hpd) idx="$(find_mtd_index ubootconfig)" [ -n "$idx" ] && \ ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x2000" "0x1000" "2" diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 70ba6a23be..ce200a1fff 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -20,7 +20,6 @@ all5002) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" ;; linkits7688|\ -linkits7688d|\ miwifi-nano|\ sk-wb8|\ wsr-1166|\ @@ -28,6 +27,9 @@ wsr-600|\ zbt-wg2626) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000" ;; +mir3g) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" + ;; esac config_load ubootenv diff --git a/package/boot/uboot-kirkwood/Makefile b/package/boot/uboot-kirkwood/Makefile index c2d8eaa73c..f4bb87556c 100644 --- a/package/boot/uboot-kirkwood/Makefile +++ b/package/boot/uboot-kirkwood/Makefile @@ -7,65 +7,76 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=2017.03 +PKG_VERSION:=2017.09 PKG_RELEASE:=1 -PKG_HASH:=f54baf3f9325bf444c7905f3a5b6f83680edb1e6e1a4d5f8a5ad80abe885113f +PKG_HASH:=b2d15f2cf5f72e706025cde73d67247c6da8cd35f7e10891eefe7d9095089744 include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk define U-Boot/Default BUILD_TARGET:=kirkwood - BUILD_DEVICES:=$(patsubst %_second_stage,%,$(1)) endef define U-Boot/dockstar NAME:=Seagate DockStar + BUILD_DEVICES:=seagate_dockstar endef define U-Boot/dockstar_second_stage NAME:=Seagate DockStar (second stage) + BUILD_DEVICES:=seagate_dockstar endef define U-Boot/goflexhome NAME:=the Seagate GoFlexHome/GoFlexNet + BUILD_DEVICES:=seagate_goflexhome seagate_goflexnet endef define U-Boot/ib62x0 NAME:=RaidSonic ICY BOX NAS6210 and NAS6220 + BUILD_DEVICES:=raidsonic_ib-nas62x0 endef define U-Boot/ib62x0_second_stage NAME:=RaidSonic ICY BOX NAS6210 and NAS6220 (second stage) + BUILD_DEVICES:=raidsonic_ib-nas62x0 endef define U-Boot/iconnect NAME:=Iomega iConnect Wireless + BUILD_DEVICES:=iom_iconnect-1.1 endef define U-Boot/iconnect_second_stage NAME:=Iomega iConnect Wireless (second stage) + BUILD_DEVICES:=iom_iconnect-1.1 endef define U-Boot/nsa310 NAME:=Zyxel NSA310 + BUILD_DEVICES:=zyxel_nsa310b endef define U-Boot/nsa325 NAME:=Zyxel NSA325v1 and v2 + BUILD_DEVICES:=zyxel_nsa325 endef define U-Boot/pogo_e02 NAME:=Cloud Engines Pogoplug E02 + BUILD_DEVICES:=cloudengines_pogoe02 endef define U-Boot/pogo_e02_second_stage NAME:=Cloud Engines Pogoplug E02 (second stage) + BUILD_DEVICES:=cloudengines_pogoe02 endef -define U-Boot/sheevaplug - NAME:=SheevaPlug +define U-Boot/pogoplugv4 + NAME:=Cloud Engines Pogoplug V4 + BUILD_DEVICES:=cloudengines_pogoplugv4 endef UBOOT_TARGETS := \ @@ -76,7 +87,7 @@ UBOOT_TARGETS := \ nsa310 \ nsa325 \ pogo_e02 pogo_e02_second_stage \ - sheevaplug + pogoplugv4 define Build/Configure $(if $(findstring _second_stage,$(BUILD_VARIANT)), diff --git a/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch b/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch index 0831f1092a..10d8d4405c 100644 --- a/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch +++ b/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch @@ -27,23 +27,23 @@ diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index 9205b1e..819bd3b 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig -@@ -53,6 +53,9 @@ config TARGET_GOFLEXHOME +@@ -56,6 +56,9 @@ config TARGET_GOFLEXHOME config TARGET_NAS220 - bool "BlackArmor NAS220" - + bool "BlackArmor NAS220" + +config TARGET_NSA310 + bool "Zyxel NSA310 Board" + config TARGET_NSA310S - bool "Zyxel NSA310S" - -@@ -77,6 +80,7 @@ source "board/raidsonic/ib62x0/Kconfig" + bool "Zyxel NSA310S" + +@@ -80,6 +83,7 @@ source "board/raidsonic/ib62x0/Kconfig" source "board/Seagate/dockstar/Kconfig" source "board/Seagate/goflexhome/Kconfig" source "board/Seagate/nas220/Kconfig" +source "board/zyxel/nsa310/Kconfig" source "board/zyxel/nsa310s/Kconfig" - + endif diff --git a/board/zyxel/nsa310/Kconfig b/board/zyxel/nsa310/Kconfig new file mode 100644 @@ -528,7 +528,7 @@ new file mode 100644 index 0000000..d26ef35 --- /dev/null +++ b/configs/nsa310_defconfig -@@ -0,0 +1,22 @@ +@@ -0,0 +1,34 @@ +CONFIG_ARM=y +CONFIG_KIRKWOOD=y +CONFIG_TARGET_NSA310=y @@ -544,19 +544,31 @@ index 0000000..d26ef35 +CONFIG_CMD_DHCP=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_SNTP=y +CONFIG_CMD_USB=y ++CONFIG_CMD_DATE=y +CONFIG_CMD_EXT2=y ++CONFIG_CMD_EXT4=y +CONFIG_CMD_FAT=y ++CONFIG_CMD_JFFS2=y ++CONFIG_CMD_MTDPARTS=y ++CONFIG_CMD_ENV=y ++CONFIG_CMD_NAND=y +CONFIG_EFI_PARTITION=y ++CONFIG_ENV_IS_IN_NAND=y +CONFIG_CMD_UBI=y +CONFIG_USB=y ++CONFIG_USB_EHCI_HCD=y +CONFIG_USB_STORAGE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y diff --git a/include/configs/nsa310.h b/include/configs/nsa310.h new file mode 100644 index 0000000..86ef825 --- /dev/null +++ b/include/configs/nsa310.h -@@ -0,0 +1,144 @@ +@@ -0,0 +1,126 @@ +/* Copyright (C) 2015-2016 bodhi + * + * Based on @@ -594,7 +606,7 @@ index 0000000..86ef825 + */ +#define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */ +#define CONFIG_KW88F6281 /* SOC Name */ -+#define CONFIG_MACH_NSA310 /* Machine type */ ++ +#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ + +/* @@ -605,14 +617,8 @@ index 0000000..86ef825 +/* + * Commands configuration + */ -+#define CONFIG_CMD_ENV -+#define CONFIG_CMD_IDE -+#define CONFIG_CMD_NAND -+#define CONFIG_CMD_DATE +#define CONFIG_SYS_LONGHELP +#define CONFIG_PREBOOT -+#define CONFIG_SYS_HUSH_PARSER -+#define CONFIG_SYS_PROMPT_HUSH_PS2 "> " + +/* + * mv-common.h should be defined after CMD configs since it used them @@ -624,10 +630,7 @@ index 0000000..86ef825 + * Environment variables configurations + */ +#ifdef CONFIG_CMD_NAND -+#define CONFIG_ENV_IS_IN_NAND 1 +#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */ -+#else -+#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */ +#endif + +/* max 4k env size is enough, but in case of nand @@ -665,7 +668,6 @@ index 0000000..86ef825 +#define CONFIG_NET_MULTI +#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ +#define CONFIG_PHY_BASE_ADR 0x1 -+#define CONFIG_PHY_GIGE +#define CONFIG_RESET_PHY_R +#endif /* CONFIG_CMD_NET */ + @@ -680,24 +682,16 @@ index 0000000..86ef825 +/* + * File system + */ -+#define CONFIG_CMD_EXT4 -+#define CONFIG_CMD_JFFS2 +#define CONFIG_JFFS2_NAND +#define CONFIG_JFFS2_LZO -+#define CONFIG_CMD_UBIFS -+#define CONFIG_RBTREE +#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ +#define CONFIG_MTD_PARTITIONS -+#define CONFIG_CMD_MTDPARTS -+#define CONFIG_LZO + +/* + * Date Time + */ +#ifdef CONFIG_CMD_DATE +#define CONFIG_RTC_MV -+#define CONFIG_CMD_SNTP -+#define CONFIG_CMD_DNS +#endif /* CONFIG_CMD_DATE */ + +#endif /* _CONFIG_NSA310_H */ diff --git a/package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch b/package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch index 0bb79fa4e5..4b4356e5d5 100644 --- a/package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch +++ b/package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch @@ -2,22 +2,22 @@ diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index 819bd3b..6a2d578 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig -@@ -59,6 +59,9 @@ config TARGET_NSA310 +@@ -62,6 +62,9 @@ config TARGET_NSA310 config TARGET_NSA310S - bool "Zyxel NSA310S" - + bool "Zyxel NSA310S" + +config TARGET_NSA325 + bool "Zyxel NSA325 board" + endchoice - + config SYS_SOC -@@ -82,5 +85,6 @@ source "board/Seagate/goflexhome/Kconfig" +@@ -85,5 +88,6 @@ source "board/Seagate/goflexhome/Kconfig source "board/Seagate/nas220/Kconfig" source "board/zyxel/nsa310/Kconfig" source "board/zyxel/nsa310s/Kconfig" +source "board/zyxel/nsa325/Kconfig" - + endif diff --git a/board/zyxel/nsa325/Kconfig b/board/zyxel/nsa325/Kconfig new file mode 100644 @@ -511,7 +511,7 @@ new file mode 100644 index 0000000..48e09cc --- /dev/null +++ b/configs/nsa325_defconfig -@@ -0,0 +1,22 @@ +@@ -0,0 +1,34 @@ +CONFIG_ARM=y +CONFIG_KIRKWOOD=y +CONFIG_TARGET_NSA325=y @@ -527,19 +527,31 @@ index 0000000..48e09cc +CONFIG_CMD_DHCP=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_SNTP=y +CONFIG_CMD_USB=y +CONFIG_USB=y ++CONFIG_CMD_DATE=y +CONFIG_CMD_EXT2=y ++CONFIG_CMD_EXT4=y +CONFIG_CMD_FAT=y ++CONFIG_CMD_JFFS2=y ++CONFIG_CMD_MTDPARTS=y ++CONFIG_CMD_ENV=y ++CONFIG_CMD_NAND=y +CONFIG_EFI_PARTITION=y ++CONFIG_ENV_IS_IN_NAND=y +CONFIG_CMD_UBI=y ++CONFIG_USB_EHCI_HCD=y +CONFIG_USB_STORAGE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y diff --git a/include/configs/nsa325.h b/include/configs/nsa325.h new file mode 100644 index 0000000..e5a8e2a --- /dev/null +++ b/include/configs/nsa325.h -@@ -0,0 +1,148 @@ +@@ -0,0 +1,129 @@ +/* + * (C) Copyright 2016 bodhi + * @@ -579,7 +591,6 @@ index 0000000..e5a8e2a + * High Level Configuration Options (easy to change) + */ +#define CONFIG_FEROCEON_88FR131 1 /* CPU Core subversion */ -+#define CONFIG_KIRKWOOD 1 /* SOC Family Name */ +#define CONFIG_KW88F6281 1 /* SOC Name */ + +#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ @@ -592,14 +603,8 @@ index 0000000..e5a8e2a +/* + * Commands configuration + */ -+#define CONFIG_CMD_ENV -+#define CONFIG_CMD_IDE -+#define CONFIG_CMD_NAND -+#define CONFIG_CMD_DATE +#define CONFIG_SYS_LONGHELP +#define CONFIG_PREBOOT -+#define CONFIG_SYS_HUSH_PARSER -+#define CONFIG_SYS_PROMPT_HUSH_PS2 "> " + +/* + * mv-common.h should be defined after CMD configs since it used them @@ -611,10 +616,7 @@ index 0000000..e5a8e2a + * Environment variables configurations + */ +#ifdef CONFIG_CMD_NAND -+#define CONFIG_ENV_IS_IN_NAND 1 +#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */ -+#else -+#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */ +#endif +/* + * max 4k env size is enough, but in case of nand @@ -650,7 +652,6 @@ index 0000000..e5a8e2a +#ifdef CONFIG_CMD_NET +#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ +#define CONFIG_PHY_BASE_ADR 0x1 -+#define CONFIG_PHY_GIGE +#define CONFIG_NETCONSOLE +#endif /* CONFIG_CMD_NET */ + @@ -665,24 +666,16 @@ index 0000000..e5a8e2a +/* + * File system + */ -+#define CONFIG_CMD_EXT4 -+#define CONFIG_CMD_JFFS2 +#define CONFIG_JFFS2_NAND +#define CONFIG_JFFS2_LZO -+#define CONFIG_CMD_UBIFS -+#define CONFIG_RBTREE +#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ +#define CONFIG_MTD_PARTITIONS -+#define CONFIG_CMD_MTDPARTS -+#define CONFIG_LZO + +/* + * Date Time + */ +#ifdef CONFIG_CMD_DATE +#define CONFIG_RTC_MV -+#define CONFIG_CMD_SNTP -+#define CONFIG_CMD_DNS +#endif /* CONFIG_CMD_DATE */ + +#define CONFIG_KIRKWOOD_GPIO /* Enable GPIO Support */ diff --git a/package/boot/uboot-kirkwood/patches/010-pogoplug_v4.patch b/package/boot/uboot-kirkwood/patches/010-pogoplug_v4.patch new file mode 100644 index 0000000000..d2daf0b66f --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/010-pogoplug_v4.patch @@ -0,0 +1,1574 @@ +--- a/arch/arm/mach-kirkwood/Kconfig ++++ b/arch/arm/mach-kirkwood/Kconfig +@@ -25,6 +25,9 @@ config TARGET_LSXL + config TARGET_POGO_E02 + bool "pogo_e02 Board" + ++config TARGET_POGOPLUGV4 ++ bool "Pogoplug V4 Board" ++ + config TARGET_DNS325 + bool "dns325 Board" + +@@ -77,6 +80,7 @@ source "board/Marvell/guruplug/Kconfig" + source "board/Marvell/sheevaplug/Kconfig" + source "board/buffalo/lsxl/Kconfig" + source "board/cloudengines/pogo_e02/Kconfig" ++source "board/cloudengines/pogoplugv4/Kconfig" + source "board/d-link/dns325/Kconfig" + source "board/iomega/iconnect/Kconfig" + source "board/keymile/km_arm/Kconfig" +--- a/arch/arm/mach-kirkwood/include/mach/config.h ++++ b/arch/arm/mach-kirkwood/include/mach/config.h +@@ -77,6 +77,7 @@ + * Ethernet Driver configuration + */ + #ifdef CONFIG_CMD_NET ++#define CONFIG_FEATURE_COMMAND_EDITING + #define CONFIG_NETCONSOLE /* include NetConsole support */ + #define CONFIG_MII /* expose smi ove miiphy interface */ + #define CONFIG_MVGBE /* Enable Marvell Gbe Controller Driver */ +@@ -110,6 +111,7 @@ + #define CONFIG_SYS_ATA_STRIDE 4 + /* Controller supports 48-bits LBA addressing */ + #define CONFIG_LBA48 ++#define CONFIG_SYS_64BIT_LBA + /* CONFIG_IDE requires some #defines for ATA registers */ + #define CONFIG_SYS_IDE_MAXBUS 2 + #define CONFIG_SYS_IDE_MAXDEVICE 2 +@@ -134,4 +136,15 @@ + #define CONFIG_SYS_TIMER_COUNTER (MVEBU_TIMER_BASE + 0x14) + #define CONFIG_SYS_TIMER_RATE CONFIG_SYS_TCLK + ++/* ++ * Boot option ++ */ ++#define CONFIG_CMD_BOOTZ ++ ++/* ++ * GPIO ++ */ ++#define CONFIG_CMD_GPIO ++#define CONFIG_KIRKWOOD_GPIO ++ + #endif /* _KW_CONFIG_H */ +--- a/arch/arm/mach-kirkwood/include/mach/kw88f6192.h ++++ b/arch/arm/mach-kirkwood/include/mach/kw88f6192.h +@@ -16,6 +16,6 @@ + #define KW_REGS_PHY_BASE KW88F6192_REGS_PHYS_BASE + + /* TCLK Core Clock defination */ +-#define CONFIG_SYS_TCLK 166000000 /* 166MHz */ ++#define CONFIG_SYS_TCLK 166666667 /* 166MHz */ + + #endif /* _CONFIG_KW88F6192_H */ +--- a/arch/arm/mach-kirkwood/include/mach/mpp.h ++++ b/arch/arm/mach-kirkwood/include/mach/mpp.h +@@ -217,10 +217,12 @@ + #define MPP33_GPIO MPP( 33, 0x0, 1, 1, 0, 1, 1, 1 ) + #define MPP33_TDM_DTX MPP( 33, 0x2, 0, 1, 0, 0, 1, 1 ) + #define MPP33_GE1_13 MPP( 33, 0x3, 0, 0, 0, 1, 1, 1 ) ++#define MPP33_SATA1_ACTn MPP( 33, 0x5, 0, 1, 0, 1, 1, 1 ) + + #define MPP34_GPIO MPP( 34, 0x0, 1, 1, 0, 1, 1, 1 ) + #define MPP34_TDM_SPI_CS1 MPP( 34, 0x2, 0, 1, 0, 0, 1, 1 ) + #define MPP34_GE1_14 MPP( 34, 0x3, 0, 0, 0, 1, 1, 1 ) ++#define MPP34_SATA1_ACTn MPP( 34, 0x5, 0, 1, 0, 1, 1, 1 ) + + #define MPP35_GPIO MPP( 35, 0x0, 1, 1, 1, 1, 1, 1 ) + #define MPP35_TDM_CH0_TX_QL MPP( 35, 0x2, 0, 1, 0, 0, 1, 1 ) +--- a/arch/arm/mach-mvebu/include/mach/soc.h ++++ b/arch/arm/mach-mvebu/include/mach/soc.h +@@ -18,6 +18,8 @@ + #define SOC_88F6810_ID 0x6810 + #define SOC_88F6820_ID 0x6820 + #define SOC_88F6828_ID 0x6828 ++#define SOC_88F6192_ID 0x6192 ++#define SOC_88F6702_ID 0x6702 + + /* A375 revisions */ + #define MV_88F67XX_A0_ID 0x3 +--- /dev/null ++++ b/board/cloudengines/pogoplugv4/Kconfig +@@ -0,0 +1,12 @@ ++if TARGET_POGOPLUGV4 ++ ++config SYS_BOARD ++ default "pogoplugv4" ++ ++config SYS_VENDOR ++ default "cloudengines" ++ ++config SYS_CONFIG_NAME ++ default "pogoplugv4" ++ ++endif +--- /dev/null ++++ b/board/cloudengines/pogoplugv4/MAINTAINERS +@@ -0,0 +1,6 @@ ++POGOPLUGV4 BOARD ++M: Alberto Bursi ++S: Maintained ++F: board/cloudengines/pogoplugv4/ ++F: include/configs/pogoplugv4.h ++F: configs/pogoplugv4_defconfig +--- /dev/null ++++ b/board/cloudengines/pogoplugv4/Makefile +@@ -0,0 +1,11 @@ ++# ++# (C) Copyright 2009 bodhi ++# ++# Based on ++# Marvell Semiconductor ++# Written-by: Prafulla Wadaskar ++# ++# SPDX-License-Identifier: GPL-2.0+ ++# ++ ++obj-y := pogoplugv4.o +--- /dev/null ++++ b/board/cloudengines/pogoplugv4/kwbimage.cfg +@@ -0,0 +1,167 @@ ++# ++# Copyright (C) 2012 ++# David Purdy ++# ++# Based on Kirkwood support: ++# (C) Copyright 2009 ++# Marvell Semiconductor ++# Written-by: Prafulla Wadaskar marvell.com> ++# ++# See file CREDITS for list of people who contributed to this ++# project. ++# ++# This program is free software; you can redistribute it and/or ++# modify it under the terms of the GNU General Public License as ++# published by the Free Software Foundation; either version 2 of ++# the License, or (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, see . ++# ++# Refer docs/README.kwimage for more details about how-to configure ++# and create kirkwood boot image ++# ++ ++# Boot Media configurations (DONE) ++BOOT_FROM nand ++NAND_ECC_MODE default ++NAND_PAGE_SIZE 0x0800 ++ ++# SOC registers configuration using bootrom header extension ++# Maximum KWBIMAGE_MAX_CONFIG configurations allowed ++ ++# Configure RGMII-0 interface pad voltage to 1.8V (SHOULD BE SAME) ++DATA 0xffd100e0 0x1b1b1b9b ++ ++#Dram initalization for SINGLE x16 CL=3 @ 200MHz (need CL=3 @ 200MHz?) ++DATA 0xffd01400 0x43000618 # DDR Configuration register ++# bit13-0: 0x200 (200 DDR2 clks refresh rate) ++# bit23-14: zero ++# bit24: 1= enable exit self refresh mode on DDR access ++# bit25: 1 required ++# bit29-26: zero ++# bit31-30: 01 ++ ++DATA 0xffd01404 0x34143000 # DDR Controller Control Low ++# bit 4: 0=addr/cmd in smame cycle ++# bit 5: 0=clk is driven during self refresh, we don't care for APX ++# bit 6: 0=use recommended falling edge of clk for addr/cmd ++# bit14: 0=input buffer always powered up ++# bit18: 1=cpu lock transaction enabled ++# bit23-20: 3=recommended value for CL=3 and STARTBURST_DEL disabled bit31=0 ++# bit27-24: 6= CL+3, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM ++# bit30-28: 3 required ++# bit31: 0=no additional STARTBURST delay ++ ++DATA 0xffd01408 0x11012227 # DDR Timing (Low) (active cycles value +1) ++# bit3-0: TRAS lsbs ++# bit7-4: TRCD ++# bit11- 8: TRP ++# bit15-12: TWR ++# bit19-16: TWTR ++# bit20: TRAS msb ++# bit23-21: 0x0 ++# bit27-24: TRRD ++# bit31-28: TRTP ++ ++DATA 0xffd0140c 0x00000819 # DDR Timing (High) ++# bit6-0: TRFC ++# bit8-7: TR2R ++# bit10-9: TR2W ++# bit12-11: TW2W ++# bit31-13: zero required ++ ++DATA 0xffd01410 0x00000001 # DDR Address Control (changed to Dockstar vals) ++# bit1-0: 00, Cs0width=x16 ++# bit3-2: 10, Cs0size=512Mb ++# bit5-4: 00, Cs2width=nonexistent ++# bit7-6: 00, Cs1size =nonexistent ++# bit9-8: 00, Cs2width=nonexistent ++# bit11-10: 00, Cs2size =nonexistent ++# bit13-12: 00, Cs3width=nonexistent ++# bit15-14: 00, Cs3size =nonexistent ++# bit16: 0, Cs0AddrSel ++# bit17: 0, Cs1AddrSel ++# bit18: 0, Cs2AddrSel ++# bit19: 0, Cs3AddrSel ++# bit31-20: 0 required ++ ++DATA 0xffd01414 0x00000000 # DDR Open Pages Control ++# bit0: 0, OpenPage enabled ++# bit31-1: 0 required ++ ++DATA 0xffd01418 0x00000000 # DDR Operation ++# bit3-0: 0x0, DDR cmd ++# bit31-4: 0 required ++ ++DATA 0xffd0141c 0x00000632 # DDR Mode ++# bit2-0: 2, BurstLen=2 required ++# bit3: 0, BurstType=0 required ++# bit6-4: 4, CL=5 (<===== change to CL=3 ?) ++# bit7: 0, TestMode=0 normal ++# bit8: 0, DLL reset=0 normal ++# bit11-9: 6, auto-precharge write recovery ???????????? ++# bit12: 0, PD must be zero ++# bit31-13: 0 required ++ ++DATA 0xffd01420 0x00000040 # DDR Extended Mode ++# bit0: 0, DDR DLL enabled ++# bit1: 0, DDR drive strenght normal ++# bit2: 0, DDR ODT control lsd (disabled) ++# bit5-3: 000, required ++# bit6: 1, DDR ODT control msb, (disabled) ++# bit9-7: 000, required ++# bit10: 0, differential DQS enabled ++# bit11: 0, required ++# bit12: 0, DDR output buffer enabled ++# bit31-13: 0 required ++ ++DATA 0xffd01424 0x0000F07F # DDR Controller Control High ++# bit2-0: 111, required ++# bit3 : 1 , MBUS Burst Chop disabled ++# bit6-4: 111, required ++# bit7 : 0 ++# bit8 : 0 , no sample stage ++# bit9 : 0 , no half clock cycle addition to dataout ++# bit10 : 0 , 1/4 clock cycle skew enabled for addr/ctl signals ++# bit11 : 0 , 1/4 clock cycle skew disabled for write mesh ++# bit15-12: 1111 required ++# bit31-16: 0 required ++ ++DATA 0xffd01428 0x00085520 # DDR2 ODT Read Timing (default values) ++DATA 0xffd0147c 0x00008552 # DDR2 ODT Write Timing (default values) ++ ++DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 ++DATA 0xFFD01504 0x07FFFFF1 # CS[0]n Size ++# bit0: 1, Window enabled ++# bit1: 0, Write Protect disabled ++# bit3-2: 00, CS0 hit selected ++# bit23-4: ones, required ++# bit31-24: 0x07, Size (i.e. 128MB) ++ ++DATA 0xFFD0150C 0x00000000 # CS[1]n Size, window disabled ++DATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled ++DATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled ++ ++DATA 0xffd01494 0x00030000 # DDR ODT Control (Low) (DONE) ++# bit3-0: 2, ODT0Rd, MODT[0] asserted during read from DRAM CS1 ++# bit7-4: 1, ODT0Rd, MODT[0] asserted during read from DRAM CS0 ++# bit19-16:2, ODT0Wr, MODT[0] asserted during write to DRAM CS1 ++# bit23-20:1, ODT0Wr, MODT[0] asserted during write to DRAM CS0 ++ ++DATA 0xffd01498 0x00000000 # DDR ODT Control (High) (DONE) ++# bit1-0: 00, ODT0 controlled by ODT Control (low) register above ++# bit3-2: 01, ODT1 active NEVER! ++# bit31-4: zero, required ++ ++DATA 0xffd0149c 0x0000e803 # CPU ODT Control (DONE) ++DATA 0xffd01480 0x00000001 # DDR Initialization Control (DONE) ++#bit0=1, enable DDR init upon this register write ++ ++# End of Header extension ++DATA 0x0 0x0 +--- /dev/null ++++ b/board/cloudengines/pogoplugv4/pogoplugv4.c +@@ -0,0 +1,223 @@ ++/* ++ * Copyright (C) 2016 bodhi ++ * Copyright (C) 2014 bodhi ++ * ++ * Based on ++ * ++ * Copyright (C) 2014 ++ * ++ * Copyright (C) 2012 ++ * David Purdy ++ * ++ * Based on Kirkwood support: ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * Written-by: Prafulla Wadaskar ++ * ++ * See file CREDITS for list of people who contributed to this ++ * project. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of ++ * the License, or (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, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include "pogoplugv4.h" ++#include ++ ++#ifdef CONFIG_KIRKWOOD_MMC ++#include ++#endif /* CONFIG_KIRKWOOD_MMC */ ++ ++ ++DECLARE_GLOBAL_DATA_PTR; ++ ++int board_early_init_f(void) ++{ ++ /* ++ * default gpio configuration ++ * There are maximum 64 gpios controlled through 2 sets of registers ++ * the below configuration configures mainly initial LED status ++ */ ++ mvebu_config_gpio(POGOPLUGV4_OE_VAL_LOW, ++ POGOPLUGV4_OE_VAL_HIGH, ++ POGOPLUGV4_OE_LOW, POGOPLUGV4_OE_HIGH); ++ ++ /* Multi-Purpose Pins Functionality configuration */ ++ u32 kwmpp_config[] = { ++ MPP0_NF_IO2, ++ MPP1_NF_IO3, ++ MPP2_NF_IO4, ++ MPP3_NF_IO5, ++ MPP4_NF_IO6, ++ MPP5_NF_IO7, ++ MPP6_SYSRST_OUTn, ++ MPP7_GPO, ++ MPP8_TW_SDA, ++ MPP9_TW_SCK, ++ MPP10_UART0_TXD, ++ MPP11_UART0_RXD, ++ MPP12_SD_CLK, ++ MPP13_SD_CMD, ++ MPP14_SD_D0, ++ MPP15_SD_D1, ++ MPP16_SD_D2, ++ MPP17_SD_D3, ++ MPP18_NF_IO0, ++ MPP19_NF_IO1, ++ MPP20_SATA1_ACTn, ++ MPP21_SATA0_ACTn, ++ MPP22_GPIO, /* Green LED */ ++ MPP23_GPIO, ++ MPP24_GPIO, /* Red LED */ ++ MPP25_GPIO, ++ MPP26_GPIO, ++ MPP27_GPIO, ++ MPP28_GPIO, ++ MPP29_GPIO, /* Eject button */ ++ MPP30_GPIO, ++ MPP31_GPIO, ++ MPP32_GPIO, ++ MPP33_GPIO, ++ MPP34_GPIO, ++ MPP35_GPIO, /* FR6192 has only 36 GPIOs */ ++ 0 ++ }; ++ kirkwood_mpp_conf(kwmpp_config, NULL); ++ ++ return 0; ++} ++ ++int board_init(void) ++{ ++ /* Boot parameters address */ ++ gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100; ++ ++ kw_gpio_set_valid(20, 1); ++ kw_gpio_set_valid(21, 1); ++ kw_gpio_set_valid(22, 1); ++ kw_gpio_set_valid(24, 1); ++ ++ return 0; ++} ++ ++#ifdef CONFIG_RESET_PHY_R ++/* Configure and initialize PHY */ ++void reset_phy(void) ++{ ++ u16 reg; ++ u16 devadr; ++ char *name = "egiga0"; ++ ++ if (miiphy_set_current_dev(name)) ++ return; ++ ++ /* command to read PHY dev address */ ++ if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) { ++ printf("Err..(%s) could not read PHY dev address\n", __func__); ++ return; ++ } ++ ++ /* ++ * Enable RGMII delay on Tx and Rx for CPU port ++ * Ref: sec 4.7.2 of chip datasheet ++ */ ++ miiphy_write(name, devadr, MV88E1116_PGADR_REG, 2); ++ miiphy_read(name, devadr, MV88E1116_MAC_CTRL_REG, ®); ++ reg |= (MV88E1116_RGMII_RXTM_CTRL | MV88E1116_RGMII_TXTM_CTRL); ++ miiphy_write(name, devadr, MV88E1116_MAC_CTRL_REG, reg); ++ miiphy_write(name, devadr, MV88E1116_PGADR_REG, 0); ++ ++ /* reset the phy */ ++ miiphy_reset(name, devadr); ++ ++ debug("88E1116 Initialized on %s\n", name); ++} ++#endif /* CONFIG_RESET_PHY_R */ ++ ++#ifdef CONFIG_KIRKWOOD_MMC ++int board_mmc_init(bd_t *bis) ++{ ++ kw_mmc_initialize(bis); ++ return 0; ++} ++#endif /* CONFIG_KIRKWOOD_MMC */ ++ ++ ++#define GREEN_LED (1 << 22) ++#define RED_LED (1 << 24) ++#define BOTH_LEDS (GREEN_LED | RED_LED) ++#define NEITHER_LED 0 ++ ++static void set_leds(u32 leds, u32 blinking) ++{ ++ struct kwgpio_registers *r; ++ u32 oe; ++ u32 bl; ++ ++ r = (struct kwgpio_registers *)MVEBU_GPIO0_BASE; ++ oe = readl(&r->oe) | BOTH_LEDS; ++ writel(oe & ~leds, &r->oe); /* active low */ ++ bl = readl(&r->blink_en) & ~BOTH_LEDS; ++ writel(bl | blinking, &r->blink_en); ++} ++ ++void show_boot_progress(int val) ++{ ++ switch (val) { ++ case BOOTSTAGE_ID_RUN_OS: /* booting Linux */ ++ set_leds(BOTH_LEDS, NEITHER_LED); ++ break; ++ case BOOTSTAGE_ID_NET_ETH_START: /* Ethernet initialization */ ++ set_leds(GREEN_LED, GREEN_LED); ++ break; ++ default: ++ if (val < 0) /* error */ ++ set_leds(RED_LED, RED_LED); ++ break; ++ } ++} ++ ++#if defined(CONFIG_KIRKWOOD_GPIO) ++/* Return GPIO button status */ ++/* ++un-pressed: ++ gpio-29 (Eject Button ) in hi (act lo) - IRQ edge (clear ) ++pressed ++ gpio-29 (Eject Button ) in lo (act hi) - IRQ edge (clear ) ++*/ ++ ++static int ++do_read_button(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ++{ ++ if (strcmp(argv[1], "eject") == 0) { ++ kw_gpio_set_valid(BTN_EJECT, GPIO_INPUT_OK); ++ kw_gpio_direction_input(BTN_EJECT); ++ return kw_gpio_get_value(BTN_EJECT); ++ } ++ else ++ return -1; ++} ++ ++ ++U_BOOT_CMD(button, 2, 0, do_read_button, ++ "Return GPIO button status 0=off 1=on", ++ "- button eject: test buttons states\n" ++); ++ ++#endif +--- /dev/null ++++ b/board/cloudengines/pogoplugv4/pogoplugv4.h +@@ -0,0 +1,50 @@ ++/* ++ * Copyright (C) 2016 ++ * bodhi ++ * ++ * Copyright (C) 2012 ++ * David Purdy ++ * ++ * Based on Kirkwood support: ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * Written-by: Prafulla Wadaskar ++ * ++ * See file CREDITS for list of people who contributed to this ++ * project. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of ++ * the License, or (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, see . ++ */ ++ ++#ifndef __POGOPLUGV4_H ++#define __POGOPLUGV4_H ++ ++/* GPIO configuration */ ++#define POGOPLUGV4_OE_LOW (~(0)) ++#define POGOPLUGV4_OE_HIGH (~(0)) ++#define POGOPLUGV4_OE_VAL_LOW (1 << 29) ++#define POGOPLUGV4_OE_VAL_HIGH 0 ++ ++/* PHY related */ ++#define MV88E1116_LED_FCTRL_REG 10 ++#define MV88E1116_CPRSP_CR3_REG 21 ++#define MV88E1116_MAC_CTRL_REG 21 ++#define MV88E1116_PGADR_REG 22 ++#define MV88E1116_RGMII_TXTM_CTRL (1 << 4) ++#define MV88E1116_RGMII_RXTM_CTRL (1 << 5) ++ ++/* button */ ++#define BTN_EJECT 29 ++ ++#endif /* __POGOPLUGV4_H */ +--- /dev/null ++++ b/configs/pogoplugv4_defconfig +@@ -0,0 +1,35 @@ ++CONFIG_ARM=y ++CONFIG_KIRKWOOD=y ++CONFIG_TARGET_POGOPLUGV4=y ++CONFIG_SYS_PROMPT="pogoplugv4> " ++CONFIG_IDENT_STRING="\nPogoplug V4" ++CONFIG_BOOTDELAY=3 ++# CONFIG_CMD_IMLS is not set ++# CONFIG_CMD_FLASH is not set ++CONFIG_SYS_NS16550=y ++CONFIG_CMD_FDT=y ++CONFIG_OF_LIBFDT=y ++CONFIG_CMD_SETEXPR=y ++CONFIG_CMD_DHCP=y ++CONFIG_CMD_MII=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_SNTP=y ++CONFIG_CMD_USB=y ++CONFIG_CMD_DATE=y ++CONFIG_CMD_EXT2=y ++CONFIG_CMD_EXT4=y ++CONFIG_CMD_FAT=y ++CONFIG_CMD_JFFS2=y ++CONFIG_CMD_MTDPARTS=y ++CONFIG_CMD_ENV=y ++CONFIG_CMD_NAND=y ++CONFIG_CMD_MMC=y ++CONFIG_EFI_PARTITION=y ++CONFIG_ENV_IS_IN_NAND=y ++CONFIG_CMD_UBI=y ++CONFIG_USB=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_STORAGE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y +--- a/drivers/gpio/kw_gpio.c ++++ b/drivers/gpio/kw_gpio.c +@@ -148,3 +148,36 @@ void kw_gpio_set_blink(unsigned pin, int + /* Set blinking. */ + __set_blinking(pin, blink); + } ++ ++ ++/* ++ * Hooks to GENERIC_GPIO primitives ++ */ ++ ++int gpio_direction_input(unsigned pin) ++{ ++ return kw_gpio_direction_input(pin); ++} ++ ++int gpio_direction_output(unsigned pin, int value) ++{ ++ return kw_gpio_direction_output(pin, value); ++} ++ ++void gpio_set_value(unsigned pin, int value) { ++ kw_gpio_set_value(pin, value); ++} ++ ++int gpio_get_value(unsigned pin) { ++ return kw_gpio_get_value(pin); ++} ++ ++int gpio_request(unsigned gpio, const char *label) ++{ ++ return 0; ++} ++ ++int gpio_free(unsigned gpio) ++{ ++ return 0; ++} +--- a/drivers/mmc/Makefile ++++ b/drivers/mmc/Makefile +@@ -61,6 +61,7 @@ obj-$(CONFIG_MMC_SDHCI_TANGIER) += tang + obj-$(CONFIG_MMC_SDHCI_TEGRA) += tegra_mmc.o + obj-$(CONFIG_MMC_SDHCI_XENON) += xenon_sdhci.o + obj-$(CONFIG_MMC_SDHCI_ZYNQ) += zynq_sdhci.o ++obj-$(CONFIG_KIRKWOOD_MMC) += kirkwood_mmc.o + + obj-$(CONFIG_MMC_SUNXI) += sunxi_mmc.o + obj-$(CONFIG_MMC_UNIPHIER) += uniphier-sd.o +--- /dev/null ++++ b/drivers/mmc/kirkwood_mmc.c +@@ -0,0 +1,482 @@ ++/* ++ * (C) Copyright 2014 bodhi ++ * ++ * Based on ++ * ++ * (C) Copyright 2014 ++ * ++ * Based on ++ * ++ * Driver for Marvell SDIO/MMC controller ++ * ++ * (C) Copyright 2012 ++ * Marvell Semiconductor ++ * Written-by: Gérald Kerma ++ * See file CREDITS for list of people who contributed to this ++ * project. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of ++ * the License, or (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 ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#define DRIVER_NAME "kwsdio" ++ ++static int kw_mmc_setup_data(struct mmc_data *data) ++{ ++ u32 ctrl_reg; ++ ++#ifdef DEBUG ++ printf("%s, data %s : blocks=%d blksz=%d\n", DRIVER_NAME, ++ (data->flags & MMC_DATA_READ) ? "read" : "write", ++ data->blocks, data->blocksize); ++#endif ++ ++ /* default to maximum timeout */ ++ ctrl_reg = kwsd_read(SDIO_HOST_CTRL); ++ ctrl_reg |= SDIO_HOST_CTRL_TMOUT(SDIO_HOST_CTRL_TMOUT_MAX); ++ kwsd_write(SDIO_HOST_CTRL, ctrl_reg); ++ ++ if (data->flags & MMC_DATA_READ) { ++ kwsd_write(SDIO_SYS_ADDR_LOW,(u32)data->dest & 0xffff); ++ kwsd_write(SDIO_SYS_ADDR_HI,(u32)data->dest >> 16); ++ } else { ++ kwsd_write(SDIO_SYS_ADDR_LOW,(u32)data->src & 0xffff); ++ kwsd_write(SDIO_SYS_ADDR_HI,(u32)data->src >> 16); ++ } ++ ++ kwsd_write(SDIO_BLK_COUNT, data->blocks); ++ kwsd_write(SDIO_BLK_SIZE, data->blocksize); ++ ++ return 0; ++} ++ ++static int kw_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) ++{ ++ int timeout = 10; ++ int err; ++ ushort waittype = 0; ++ ushort resptype = 0; ++ ushort xfertype = 0; ++ ushort resp_indx = 0; ++ ++#ifdef CONFIG_MMC_DEBUG ++ printf("cmdidx [0x%x] resp_type[0x%x] cmdarg[0x%x]\n", cmd->cmdidx, cmd->resp_type, cmd->cmdarg); ++#endif ++ ++ udelay(10000); ++ ++#ifdef CONFIG_MMC_DEBUG ++ printf("%s: cmd %d (hw state 0x%04x)\n", DRIVER_NAME, cmd->cmdidx, kwsd_read(SDIO_HW_STATE)); ++#endif ++ ++ /* Checking if card is busy */ ++ while ((kwsd_read(SDIO_HW_STATE) & CARD_BUSY)) { ++ if (timeout == 0) { ++ printf("%s: card busy!\n", DRIVER_NAME); ++ return -1; ++ } ++ timeout--; ++ udelay(1000); ++ } ++ ++ /* Set up for a data transfer if we have one */ ++ if (data) { ++ if ((err = kw_mmc_setup_data(data))) ++ return err; ++ } ++ ++ resptype = SDIO_CMD_INDEX(cmd->cmdidx); ++ ++ /* Analyzing resptype/xfertype/waittype for the command */ ++ if (cmd->resp_type & MMC_RSP_BUSY) ++ resptype |= SDIO_CMD_RSP_48BUSY; ++ else if (cmd->resp_type & MMC_RSP_136) ++ resptype |= SDIO_CMD_RSP_136; ++ else if (cmd->resp_type & MMC_RSP_PRESENT) ++ resptype |= SDIO_CMD_RSP_48; ++ else ++ resptype |= SDIO_CMD_RSP_NONE; ++ ++ if (cmd->resp_type & MMC_RSP_CRC) ++ resptype |= SDIO_CMD_CHECK_CMDCRC; ++ ++ if (cmd->resp_type & MMC_RSP_OPCODE) ++ resptype |= SDIO_CMD_INDX_CHECK; ++ ++ if (cmd->resp_type & MMC_RSP_PRESENT) { ++ resptype |= SDIO_UNEXPECTED_RESP; ++ waittype |= SDIO_NOR_UNEXP_RSP; ++ } ++ ++ if (data) { ++ resptype |= SDIO_CMD_DATA_PRESENT | SDIO_CMD_CHECK_DATACRC16; ++ xfertype |= SDIO_XFER_MODE_HW_WR_DATA_EN; ++ if (data->flags & MMC_DATA_READ) { ++ xfertype |= SDIO_XFER_MODE_TO_HOST; ++ waittype = SDIO_NOR_DMA_INI; ++ } else ++ waittype |= SDIO_NOR_XFER_DONE; ++ } else ++ waittype |= SDIO_NOR_CMD_DONE; ++ ++ /* Setting cmd arguments */ ++ kwsd_write(SDIO_ARG_LOW, cmd->cmdarg & 0xffff); ++ kwsd_write(SDIO_ARG_HI, cmd->cmdarg >> 16); ++ ++ /* Setting Xfer mode */ ++ kwsd_write(SDIO_XFER_MODE, xfertype); ++ ++ kwsd_write(SDIO_NOR_INTR_STATUS, ~SDIO_NOR_CARD_INT); ++ kwsd_write(SDIO_ERR_INTR_STATUS, SDIO_POLL_MASK); ++ ++ /* Sending command */ ++ kwsd_write(SDIO_CMD, resptype); ++/* ++ kwsd_write(SDIO_CMD, KW_MMC_MAKE_CMD(cmd->cmdidx, resptype)); ++*/ ++ ++ kwsd_write(SDIO_NOR_INTR_EN, SDIO_POLL_MASK); ++ kwsd_write(SDIO_ERR_INTR_EN, SDIO_POLL_MASK); ++ ++ /* Waiting for completion */ ++ timeout = 1000000; ++ ++ while (!((kwsd_read(SDIO_NOR_INTR_STATUS)) & waittype)) { ++ if (kwsd_read(SDIO_NOR_INTR_STATUS) & SDIO_NOR_ERROR) { ++#ifdef DEBUG ++ printf("%s: kw_mmc_send_cmd: error! cmdidx : %d, err reg: %04x\n", DRIVER_NAME, cmd->cmdidx, ++wsd_read(SDIO_ERR_INTR_STATUS)); ++#endif ++ if (kwsd_read(SDIO_ERR_INTR_STATUS) & (SDIO_ERR_CMD_TIMEOUT | SDIO_ERR_DATA_TIMEOUT)) { ++ return -ETIMEDOUT; ++ } ++ return -ECOMM; ++ } ++ ++ timeout--; ++ udelay(1); ++ if (timeout <= 0) { ++ printf("%s: command timed out\n", DRIVER_NAME); ++ return -ETIMEDOUT; ++ } ++ } ++ ++ /* Handling response */ ++ if (cmd->resp_type & MMC_RSP_136) { ++ uint response[8]; ++ for (resp_indx = 0; resp_indx < 8; resp_indx++) ++ response[resp_indx] = kwsd_read(SDIO_RSP(resp_indx)); ++ ++ cmd->response[0] = ((response[0] & 0x03ff) << 22) | ++ ((response[1] & 0xffff) << 6) | ++ ((response[2] & 0xfc00) >> 10); ++ cmd->response[1] = ((response[2] & 0x03ff) << 22) | ++ ((response[3] & 0xffff) << 6) | ++ ((response[4] & 0xfc00) >> 10); ++ cmd->response[2] = ((response[4] & 0x03ff) << 22) | ++ ((response[5] & 0xffff) << 6) | ++ ((response[6] & 0xfc00) >> 10); ++ cmd->response[3] = ((response[6] & 0x03ff) << 22) | ++ ((response[7] & 0x3fff) << 8); ++ } else if (cmd->resp_type & MMC_RSP_PRESENT) { ++ uint response[3]; ++ for (resp_indx = 0; resp_indx < 3; resp_indx++) ++ response[resp_indx] = kwsd_read(SDIO_RSP(resp_indx)); ++ ++ cmd->response[0] = ((response[2] & 0x003f) << (8 - 8)) | ++ ((response[1] & 0xffff) << (14 - 8)) | ++ ((response[0] & 0x03ff) << (30 - 8)); ++ cmd->response[1] = ((response[0] & 0xfc00) >> 10); ++ cmd->response[2] = 0; ++ cmd->response[3] = 0; ++ } ++ ++#ifdef CONFIG_MMC_DEBUG ++ printf("%s: resp[0x%x] ", DRIVER_NAME, cmd->resp_type); ++ printf("[0x%x] ", cmd->response[0]); ++ printf("[0x%x] ", cmd->response[1]); ++ printf("[0x%x] ", cmd->response[2]); ++ printf("[0x%x] ", cmd->response[3]); ++ printf("\n"); ++#endif ++ ++ return 0; ++} ++ ++#if 0 ++/* Disable these three functions as they are not used anyway */ ++ ++static void kwsd_power_up(void) ++{ ++#ifdef DEBUG ++ printf("%s: power up\n", DRIVER_NAME); ++#endif ++ /* disable interrupts */ ++ kwsd_write(SDIO_NOR_INTR_EN, 0); ++ kwsd_write(SDIO_ERR_INTR_EN, 0); ++ ++ /* SW reset */ ++ kwsd_write(SDIO_SW_RESET, SDIO_SW_RESET_NOW); ++ ++ kwsd_write(SDIO_XFER_MODE, 0); ++ ++ /* enable status */ ++ kwsd_write(SDIO_NOR_STATUS_EN, SDIO_POLL_MASK); ++ kwsd_write(SDIO_ERR_STATUS_EN, SDIO_POLL_MASK); ++ ++ /* enable interrupts status */ ++ kwsd_write(SDIO_NOR_INTR_STATUS, SDIO_POLL_MASK); ++ kwsd_write(SDIO_ERR_INTR_STATUS, SDIO_POLL_MASK); ++} ++ ++static void kwsd_power_down(void) ++{ ++#ifdef DEBUG ++ printf("%s: power down\n", DRIVER_NAME); ++#endif ++ /* disable interrupts */ ++ kwsd_write(SDIO_NOR_INTR_EN, 0); ++ kwsd_write(SDIO_ERR_INTR_EN, 0); ++ ++ /* SW reset */ ++ kwsd_write(SDIO_SW_RESET, SDIO_SW_RESET_NOW); ++ ++ kwsd_write(SDIO_XFER_MODE, SDIO_XFER_MODE_STOP_CLK); ++ ++ /* disable status */ ++ kwsd_write(SDIO_NOR_STATUS_EN, 0); ++ kwsd_write(SDIO_ERR_STATUS_EN, 0); ++ ++ /* enable interrupts status */ ++ kwsd_write(SDIO_NOR_INTR_STATUS, SDIO_POLL_MASK); ++ kwsd_write(SDIO_ERR_INTR_STATUS, SDIO_POLL_MASK); ++} ++ ++static u32 kw_mmc_get_base_clock(void) ++{ ++ /* Original version did a check for board device id and revision id ++ * and assigned one of these clocks: ++ * KW_MMC_BASE_FAST_CLK_100 (revid == 0 && devid != MV88F6282_DEV_ID) ++ * KW_MMC_BASE_FAST_CLK_200 (revid != 0 || devid == MV88F6282_DEV_ID) ++ * However, this check was disabled and ++ * KW_MMC_BASE_FAST_CLOCK ++ * was returned in every case. ++ * Therefore, all of the dead logic was removed. */ ++ return KW_MMC_BASE_FAST_CLOCK; ++} ++#endif /* #if 0 */ ++ ++static inline u32 kw_mmc_get_base_clock(void) ++{ ++ /* get MMC base clock. If any logic other than just returning ++ * a fixed value is ever used, remove inline modifier. */ ++ ++ /* Possible values: ++ * - KW_MMC_BASE_FAST_CLOCK (166 MHz) ++ * - KW_MMC_BASE_FAST_CLK_100 (100 MHz) ++ * - KW_MMC_BASE_FAST_CLK_200 (200 MHz) ++ * ++ * Tests have shown that 200 MHz is more reliable than ++ * 166 MHz, so this value is used. */ ++ return KW_MMC_BASE_FAST_CLK_200; ++} ++ ++static void kw_mmc_set_clk(unsigned int clock) ++{ ++ unsigned int m; ++ ++ if (clock == 0) { ++#ifdef DEBUG ++ printf("%s: clock off\n", DRIVER_NAME); ++#endif ++ kwsd_write(SDIO_XFER_MODE, SDIO_XFER_MODE_STOP_CLK); ++ kwsd_write(SDIO_CLK_DIV, KW_MMC_BASE_DIV_MAX); ++ } else { ++ m = kw_mmc_get_base_clock() / (2 * clock) - 1; ++ if (m > KW_MMC_BASE_DIV_MAX) ++ m = KW_MMC_BASE_DIV_MAX; ++#ifdef DEBUG ++ printf("%s: kw_mmc_set_clk: base = %d dividor = 0x%x clock=%d\n", DRIVER_NAME, ++w_mmc_get_base_clock(), m, clock); ++#endif ++ kwsd_write(SDIO_CLK_DIV, m & KW_MMC_BASE_DIV_MAX); ++ } ++ udelay(10000); ++} ++ ++static void kw_mmc_set_bus(unsigned int bus) ++{ ++ u32 ctrl_reg = 0; ++ ++ ctrl_reg = kwsd_read(SDIO_HOST_CTRL); ++ ctrl_reg &= ~SDIO_HOST_CTRL_DATA_WIDTH_4_BITS; ++ ++ switch (bus) { ++ case 4: ++ ctrl_reg |= SDIO_HOST_CTRL_DATA_WIDTH_4_BITS; ++ break; ++ case 1: ++ default: ++ ctrl_reg |= SDIO_HOST_CTRL_DATA_WIDTH_1_BIT; ++ } ++ /* default transfer mode */ ++ ctrl_reg |= SDIO_HOST_CTRL_BIG_ENDIAN; ++ ctrl_reg &= ~SDIO_HOST_CTRL_LSB_FIRST; ++ ++ /* default to maximum timeout */ ++ ctrl_reg |= SDIO_HOST_CTRL_TMOUT(SDIO_HOST_CTRL_TMOUT_MAX); ++ ++ ctrl_reg |= SDIO_HOST_CTRL_PUSH_PULL_EN; ++ ++ ctrl_reg |= SDIO_HOST_CTRL_CARD_TYPE_MEM_ONLY; ++ ++ /* ++ * The HI_SPEED_EN bit is causing trouble with many (but not all) ++ * high speed SD, SDHC and SDIO cards. Not enabling that bit ++ * makes all cards work. So let's just ignore that bit for now ++ * and revisit this issue if problems for not enabling this bit ++ * are ever reported. ++ */ ++#if 0 ++ if (ios->timing == MMC_TIMING_MMC_HS || ++ ios->timing == MMC_TIMING_SD_HS) ++ ctrl_reg |= SDIO_HOST_CTRL_HI_SPEED_EN; ++#endif ++ ++#ifdef DEBUG ++ printf("%s: ctrl 0x%04x: %s %s %s\n", DRIVER_NAME, ctrl_reg, ++ (ctrl_reg & SDIO_HOST_CTRL_PUSH_PULL_EN) ? ++ "push-pull" : "open-drain", ++ (ctrl_reg & SDIO_HOST_CTRL_DATA_WIDTH_4_BITS) ? ++ "4bit-width" : "1bit-width", ++ (ctrl_reg & SDIO_HOST_CTRL_HI_SPEED_EN) ? ++ "high-speed" : ""); ++#endif ++ ++ kwsd_write(SDIO_HOST_CTRL, ctrl_reg); ++ udelay(10000); ++} ++ ++static void kw_mmc_set_ios(struct mmc *mmc) ++{ ++#ifdef DEBUG ++ printf("%s: bus[%d] clock[%d]\n", DRIVER_NAME, mmc->bus_width, mmc->clock); ++#endif ++ kw_mmc_set_bus(mmc->bus_width); ++ kw_mmc_set_clk(mmc->clock); ++} ++ ++static int kw_mmc_init(struct mmc *mmc) ++{ ++#ifdef DEBUG ++ printf("%s: kw_mmc_init\n", DRIVER_NAME); ++#endif ++ ++ /* ++ * Setting host parameters ++ * Initial Host Ctrl : Timeout : max , Normal Speed mode, 4-bit data mode ++ * Big Endian, SD memory Card, Push_pull CMD Line ++ */ ++ kwsd_write(SDIO_HOST_CTRL, ++ SDIO_HOST_CTRL_TMOUT(SDIO_HOST_CTRL_TMOUT_MAX) | ++ SDIO_HOST_CTRL_DATA_WIDTH_4_BITS | ++ SDIO_HOST_CTRL_BIG_ENDIAN | ++ SDIO_HOST_CTRL_PUSH_PULL_EN | ++ SDIO_HOST_CTRL_CARD_TYPE_MEM_ONLY); ++ ++ kwsd_write(SDIO_CLK_CTRL, 0); ++ ++ /* enable status */ ++ kwsd_write(SDIO_NOR_STATUS_EN, SDIO_POLL_MASK); ++ kwsd_write(SDIO_ERR_STATUS_EN, SDIO_POLL_MASK); ++ ++ /* disable interrupts */ ++ kwsd_write(SDIO_NOR_INTR_EN, 0); ++ kwsd_write(SDIO_ERR_INTR_EN, 0); ++ ++ /* SW reset */ ++ kwsd_write(SDIO_SW_RESET, SDIO_SW_RESET_NOW); ++ ++ udelay(10000); ++ return 0; ++} ++ ++int kw_mmc_initialize(bd_t *bis) ++{ ++ struct mmc *mmc = NULL; ++ struct mmc_config *cfg = NULL; ++ struct mmc_ops *ops = NULL; ++ char *name = NULL; ++ ++#ifdef DEBUG ++ printf("%s: %s base_clock = %d\n", DRIVER_NAME, kirkwood_id(), kw_mmc_get_base_clock()); ++#endif ++ mmc = malloc(sizeof(struct mmc)); ++ if (!mmc) ++ return -1; ++ memset(mmc, 0, sizeof(*mmc)); ++ ++ cfg = malloc(sizeof(*cfg)); ++ if (cfg == NULL) ++ return -1; ++ memset(cfg, 0, sizeof(*cfg)); ++ mmc->cfg = cfg; /* provided configuration */ ++ ++ ops = malloc(sizeof(*ops)); ++ if (ops == NULL) ++ return -1; ++ memset(ops, 0, sizeof(*ops)); ++ cfg->ops = ops; ++ ++ name = malloc(sizeof(DRIVER_NAME)+1); ++ if (name == NULL) ++ return -1; ++ cfg->name = name; ++ ++ sprintf(cfg->name, DRIVER_NAME); ++ ++ ops->send_cmd = kw_mmc_send_cmd; ++ ops->set_ios = kw_mmc_set_ios; ++ ops->init = kw_mmc_init; ++ ++ cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34; ++ cfg->host_caps = MMC_MODE_4BIT | MMC_MODE_HS; ++ ++ cfg->f_min = kw_mmc_get_base_clock()/KW_MMC_BASE_DIV_MAX; ++ cfg->f_max = KW_MMC_CLOCKRATE_MAX; ++ cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT; ++ ++ mmc = mmc_create (cfg, NULL); ++ ++ if (mmc == NULL) { ++ free(name); ++ free(ops); ++ free(cfg); ++ printf("\nFailed to Initialize MMC\n"); ++ return -1; ++ } ++ ++ return 0; ++} +--- a/include/configs/mv-common.h ++++ b/include/configs/mv-common.h +@@ -130,4 +130,16 @@ + #define CONFIG_MTD_PARTITIONS + #endif + ++/* ++ * Kirkwood MMC ++ */ ++#if defined(CONFIG_KIRKWOOD) && defined(CONFIG_CMD_MMC) ++#define CONFIG_SYS_MMC_BASE KW_SDIO_BASE ++#endif /* defined(CONFIG_KIRKWOOD) && defined(CONFIG_CMD_MMC) */ ++ ++/* ++ * GPIO command for all Kirkwood boxes ++ */ ++#define CONFIG_CMD_GPIO ++ + #endif /* _MV_COMMON_H */ +--- /dev/null ++++ b/include/configs/pogoplugv4.h +@@ -0,0 +1,132 @@ ++/* ++ * Copyright (C) 2014-2016 bodhi ++ * Based on ++ * ++ * Copyright (C) 2012 ++ * David Purdy ++ * ++ * Based on Kirkwood support: ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * Written-by: Prafulla Wadaskar ++ * ++ * See file CREDITS for list of people who contributed to this ++ * project. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of ++ * the License, or (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, see . ++ */ ++ ++#ifndef _CONFIG_POGOPLUGV4_H ++#define _CONFIG_POGOPLUGV4_H ++ ++/* ++ * Machine type definition and ID ++ */ ++#define MACH_TYPE_POGOPLUGV4 3960 ++#define CONFIG_MACH_TYPE MACH_TYPE_POGOPLUGV4 ++ ++/* ++ * High Level Configuration Options (easy to change) ++ */ ++#define CONFIG_FEROCEON_88FR131 /* #define CPU Core subversion */ ++#define CONFIG_KW88F6192 /* SOC Name */ ++#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ ++ ++/* ++ * Commands configuration ++ */ ++ ++#define CONFIG_SYS_LONGHELP ++#define CONFIG_PREBOOT ++ ++/* ++ * mv-common.h should be defined after CMD configs since it used them ++ * to enable certain macros ++ */ ++#include "mv-common.h" ++ ++/* ++ * Environment variables configurations ++ */ ++#ifdef CONFIG_CMD_NAND ++ ++#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */ ++ ++ ++#endif ++ ++#define CONFIG_ENV_SIZE 0x20000 /* 128k */ ++#define CONFIG_ENV_ADDR 0x1c0000 ++#define CONFIG_ENV_OFFSET 0x1c0000 /* env starts here */ ++ ++/* ++ * Default environment variables ++ */ ++#define CONFIG_BOOTCOMMAND \ ++ "usb reset ; " \ ++ "fatload usb 0:1 0x2000000 initramfs.bin ; "\ ++ "bootm 0x2000000 ; " \ ++ "ubi part ubi; " \ ++ "ubi read 0x800000 kernel; " \ ++ "bootm 0x800000" ++ ++#define CONFIG_MTDPARTS \ ++ "mtdparts=orion_nand:" \ ++ "0x1c0000(uboot)," \ ++ "0x40000(uboot_env)," \ ++ "0x7e00000(ubi)\0" ++ ++#define CONFIG_EXTRA_ENV_SETTINGS \ ++ "console=console=ttyS0,115200\0" \ ++ "mtdids=nand0=orion_nand\0" \ ++ "mtdparts="CONFIG_MTDPARTS \ ++ "bootargs_root=\0" ++ ++/* ++ * Ethernet Driver configuration ++ */ ++#ifdef CONFIG_CMD_NET ++#define CONFIG_NETCONSOLE ++#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ ++#define CONFIG_PHY_BASE_ADR 0 ++#endif /* CONFIG_CMD_NET */ ++ ++/* ++ * File system ++ */ ++#define CONFIG_JFFS2_NAND ++#define CONFIG_JFFS2_LZO ++#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ ++#define CONFIG_MTD_PARTITIONS ++ ++/* ++ * SATA ++ */ ++#ifdef CONFIG_MVSATA_IDE ++#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET ++#endif ++ ++/* ++ * Date Time ++ */ ++#ifdef CONFIG_CMD_DATE ++#define CONFIG_RTC_MV ++#endif /* CONFIG_CMD_DATE */ ++ ++/* ++ * Kirkwood GPIO ++ */ ++#define CONFIG_KIRKWOOD_GPIO ++ ++#endif /* _CONFIG_POGOPLUGV4_H */ +--- /dev/null ++++ b/include/kirkwood_mmc.h +@@ -0,0 +1,268 @@ ++/* ++ * (C) Copyright 2014 ++ * ++ * Based on ++ * ++ * (C) Copyright 2012 ++ * Marvell Semiconductor ++ * Written-by: Gérald Kerma ++ * See file CREDITS for list of people who contributed to this ++ * project. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of ++ * the License, or (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 ++ */ ++ ++#ifndef __KIRKWOOD_MMC_H__ ++#define __KIRKWOOD_MMC_H__ ++ ++/* ++ * Clock rates ++ */ ++ ++#define KW_MMC_CLOCKRATE_MAX 50000000 ++#define KW_MMC_BASE_DIV_MAX 0x7ff ++#define KW_MMC_BASE_FAST_CLOCK CONFIG_SYS_TCLK ++#define KW_MMC_BASE_FAST_CLK_100 100000000 ++#define KW_MMC_BASE_FAST_CLK_200 200000000 ++ ++/* ++ * Macros ++ */ ++#define kwsd_write(offs, val) writel(val, CONFIG_SYS_MMC_BASE + (offs)) ++#define kwsd_read(offs) readl(CONFIG_SYS_MMC_BASE + (offs)) ++ ++#define KW_MMC_MAKE_CMD(c, f) (((c & 0xff) << 8) | (f & 0xff)) ++ ++/* SDIO register */ ++#define SDIO_SYS_ADDR_LOW 0x000 ++#define SDIO_SYS_ADDR_HI 0x004 ++#define SDIO_BLK_SIZE 0x008 ++#define SDIO_BLK_COUNT 0x00c ++#define SDIO_ARG_LOW 0x010 ++#define SDIO_ARG_HI 0x014 ++#define SDIO_XFER_MODE 0x018 ++#define SDIO_CMD 0x01c ++#define SDIO_RSP(i) (0x020 + ((i)<<2)) ++#define SDIO_RSP0 0x020 ++#define SDIO_RSP1 0x024 ++#define SDIO_RSP2 0x028 ++#define SDIO_RSP3 0x02c ++#define SDIO_RSP4 0x030 ++#define SDIO_RSP5 0x034 ++#define SDIO_RSP6 0x038 ++#define SDIO_RSP7 0x03c ++#define SDIO_BUF_DATA_PORT 0x040 ++#define SDIO_RSVED 0x044 ++#define SDIO_HW_STATE 0x048 ++#define SDIO_PRESENT_STATE0 0x048 ++#define SDIO_PRESENT_STATE1 0x04c ++#define SDIO_HOST_CTRL 0x050 ++#define SDIO_BLK_GAP_CTRL 0x054 ++#define SDIO_CLK_CTRL 0x058 ++#define SDIO_SW_RESET 0x05c ++#define SDIO_NOR_INTR_STATUS 0x060 ++#define SDIO_ERR_INTR_STATUS 0x064 ++#define SDIO_NOR_STATUS_EN 0x068 ++#define SDIO_ERR_STATUS_EN 0x06c ++#define SDIO_NOR_INTR_EN 0x070 ++#define SDIO_ERR_INTR_EN 0x074 ++#define SDIO_AUTOCMD12_ERR_STATUS 0x078 ++#define SDIO_CURR_BYTE_LEFT 0x07c ++#define SDIO_CURR_BLK_LEFT 0x080 ++#define SDIO_AUTOCMD12_ARG_LOW 0x084 ++#define SDIO_AUTOCMD12_ARG_HI 0x088 ++#define SDIO_AUTOCMD12_INDEX 0x08c ++#define SDIO_AUTO_RSP(i) (0x090 + ((i)<<2)) ++#define SDIO_AUTO_RSP0 0x090 ++#define SDIO_AUTO_RSP1 0x094 ++#define SDIO_AUTO_RSP2 0x098 ++#define SDIO_CLK_DIV 0x128 ++ ++#define WINDOW_CTRL(i) (0x108 + ((i) << 3)) ++#define WINDOW_BASE(i) (0x10c + ((i) << 3)) ++ ++/* SDIO_PRESENT_STATE */ ++#define CARD_BUSY (1 << 1) ++#define CMD_INHIBIT (1 << 0) ++#define CMD_TXACTIVE (1 << 8) ++#define CMD_RXACTIVE (1 << 9) ++#define CMD_AUTOCMD12ACTIVE (1 << 14) ++#define CMD_BUS_BUSY (CMD_AUTOCMD12ACTIVE | \ ++ CMD_RXACTIVE | \ ++ CMD_TXACTIVE | \ ++ CMD_INHIBIT | \ ++ CARD_BUSY) ++ ++/* ++ * SDIO_CMD ++ */ ++ ++#define SDIO_CMD_RSP_NONE (0 << 0) ++#define SDIO_CMD_RSP_136 (1 << 0) ++#define SDIO_CMD_RSP_48 (2 << 0) ++#define SDIO_CMD_RSP_48BUSY (3 << 0) ++ ++#define SDIO_CMD_CHECK_DATACRC16 (1 << 2) ++#define SDIO_CMD_CHECK_CMDCRC (1 << 3) ++#define SDIO_CMD_INDX_CHECK (1 << 4) ++#define SDIO_CMD_DATA_PRESENT (1 << 5) ++#define SDIO_UNEXPECTED_RESP (1 << 7) ++ ++#define SDIO_CMD_INDEX(x) ((x) << 8) ++ ++/* ++ * SDIO_XFER_MODE ++ */ ++ ++#define SDIO_XFER_MODE_STOP_CLK (1 << 5) ++#define SDIO_XFER_MODE_HW_WR_DATA_EN (1 << 1) ++#define SDIO_XFER_MODE_AUTO_CMD12 (1 << 2) ++#define SDIO_XFER_MODE_INT_CHK_EN (1 << 3) ++#define SDIO_XFER_MODE_TO_HOST (1 << 4) ++#define SDIO_XFER_MODE_DMA (0 << 6) ++ ++/* ++ * SDIO_HOST_CTRL ++ */ ++ ++#define SDIO_HOST_CTRL_PUSH_PULL_EN (1 << 0) ++ ++#define SDIO_HOST_CTRL_CARD_TYPE_MEM_ONLY (0 << 1) ++#define SDIO_HOST_CTRL_CARD_TYPE_IO_ONLY (1 << 1) ++#define SDIO_HOST_CTRL_CARD_TYPE_IO_MEM_COMBO (2 << 1) ++#define SDIO_HOST_CTRL_CARD_TYPE_IO_MMC (3 << 1) ++#define SDIO_HOST_CTRL_CARD_TYPE_MASK (3 << 1) ++ ++#define SDIO_HOST_CTRL_BIG_ENDIAN (1 << 3) ++#define SDIO_HOST_CTRL_LSB_FIRST (1 << 4) ++#define SDIO_HOST_CTRL_DATA_WIDTH_1_BIT (0 << 9) ++#define SDIO_HOST_CTRL_DATA_WIDTH_4_BITS (1 << 9) ++#define SDIO_HOST_CTRL_HI_SPEED_EN (1 << 10) ++ ++#define SDIO_HOST_CTRL_TMOUT_MAX 0xf ++#define SDIO_HOST_CTRL_TMOUT_MASK (0xf << 11) ++#define SDIO_HOST_CTRL_TMOUT(x) ((x) << 11) ++#define SDIO_HOST_CTRL_TMOUT_EN (1 << 15) ++ ++/* ++ * SDIO_SW_RESET ++ */ ++ ++#define SDIO_SW_RESET_NOW (1 << 8) ++ ++/* ++ * Normal interrupt status bits ++ */ ++ ++#define SDIO_NOR_ERROR (1 << 15) ++#define SDIO_NOR_UNEXP_RSP (1 << 14) ++#define SDIO_NOR_AUTOCMD12_DONE (1 << 13) ++#define SDIO_NOR_SUSPEND_ON (1 << 12) ++#define SDIO_NOR_LMB_FF_8W_AVAIL (1 << 11) ++#define SDIO_NOR_LMB_FF_8W_FILLED (1 << 10) ++#define SDIO_NOR_READ_WAIT_ON (1 << 9) ++#define SDIO_NOR_CARD_INT (1 << 8) ++#define SDIO_NOR_READ_READY (1 << 5) ++#define SDIO_NOR_WRITE_READY (1 << 4) ++#define SDIO_NOR_DMA_INI (1 << 3) ++#define SDIO_NOR_BLK_GAP_EVT (1 << 2) ++#define SDIO_NOR_XFER_DONE (1 << 1) ++#define SDIO_NOR_CMD_DONE (1 << 0) ++ ++/* ++ * Error status bits ++ */ ++ ++#define SDIO_ERR_CRC_STATUS (1 << 14) ++#define SDIO_ERR_CRC_STARTBIT (1 << 13) ++#define SDIO_ERR_CRC_ENDBIT (1 << 12) ++#define SDIO_ERR_RESP_TBIT (1 << 11) ++#define SDIO_ERR_XFER_SIZE (1 << 10) ++#define SDIO_ERR_CMD_STARTBIT (1 << 9) ++#define SDIO_ERR_AUTOCMD12 (1 << 8) ++#define SDIO_ERR_DATA_ENDBIT (1 << 6) ++#define SDIO_ERR_DATA_CRC (1 << 5) ++#define SDIO_ERR_DATA_TIMEOUT (1 << 4) ++#define SDIO_ERR_CMD_INDEX (1 << 3) ++#define SDIO_ERR_CMD_ENDBIT (1 << 2) ++#define SDIO_ERR_CMD_CRC (1 << 1) ++#define SDIO_ERR_CMD_TIMEOUT (1 << 0) ++#define SDIO_POLL_MASK 0xffff /* enable all for polling */ ++ ++#define MMC_BLOCK_SIZE 512 ++ ++/* ++ * CMD12 error status bits ++ */ ++ ++#define SDIO_AUTOCMD12_ERR_NOTEXE (1 << 0) ++#define SDIO_AUTOCMD12_ERR_TIMEOUT (1 << 1) ++#define SDIO_AUTOCMD12_ERR_CRC (1 << 2) ++#define SDIO_AUTOCMD12_ERR_ENDBIT (1 << 3) ++#define SDIO_AUTOCMD12_ERR_INDEX (1 << 4) ++#define SDIO_AUTOCMD12_ERR_RESP_T_BIT (1 << 5) ++#define SDIO_AUTOCMD12_ERR_RESP_STARTBIT (1 << 6) ++ ++#define MMC_RSP_PRESENT (1 << 0) ++#define MMC_RSP_136 (1 << 1) /* 136 bit response */ ++#define MMC_RSP_CRC (1 << 2) /* expect valid crc */ ++#define MMC_RSP_BUSY (1 << 3) /* card may send busy */ ++#define MMC_RSP_OPCODE (1 << 4) /* response contains opcode */ ++ ++#define MMC_BUSMODE_OPENDRAIN 1 ++#define MMC_BUSMODE_PUSHPULL 2 ++ ++#define MMC_BUS_WIDTH_1 0 ++#define MMC_BUS_WIDTH_4 2 ++#define MMC_BUS_WIDTH_8 3 ++ ++#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ ++#define MMC_CAP_MMC_HIGHSPEED (1 << 1) /* Can do MMC high-speed timing */ ++#define MMC_CAP_SD_HIGHSPEED (1 << 2) /* Can do SD high-speed timing */ ++#define MMC_CAP_SDIO_IRQ (1 << 3) /* Can signal pending SDIO IRQs */ ++#define MMC_CAP_SPI (1 << 4) /* Talks only SPI protocols */ ++#define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */ ++#define MMC_CAP_8_BIT_DATA (1 << 6) /* Can the host do 8 bit transfers */ ++ ++#define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */ ++#define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */ ++#define MMC_CAP_ERASE (1 << 10) /* Allow erase/trim commands */ ++#define MMC_CAP_1_8V_DDR (1 << 11) /* can support */ ++ /* DDR mode at 1.8V */ ++#define MMC_CAP_1_2V_DDR (1 << 12) /* can support */ ++ /* DDR mode at 1.2V */ ++#define MMC_CAP_POWER_OFF_CARD (1 << 13) /* Can power off after boot */ ++#define MMC_CAP_BUS_WIDTH_TEST (1 << 14) /* CMD14/CMD19 bus width ok */ ++#define MMC_CAP_UHS_SDR12 (1 << 15) /* Host supports UHS SDR12 mode */ ++#define MMC_CAP_UHS_SDR25 (1 << 16) /* Host supports UHS SDR25 mode */ ++#define MMC_CAP_UHS_SDR50 (1 << 17) /* Host supports UHS SDR50 mode */ ++#define MMC_CAP_UHS_SDR104 (1 << 18) /* Host supports UHS SDR104 mode */ ++#define MMC_CAP_UHS_DDR50 (1 << 19) /* Host supports UHS DDR50 mode */ ++#define MMC_CAP_DRIVER_TYPE_A (1 << 23) /* Host supports Driver Type A */ ++#define MMC_CAP_DRIVER_TYPE_C (1 << 24) /* Host supports Driver Type C */ ++#define MMC_CAP_DRIVER_TYPE_D (1 << 25) /* Host supports Driver Type D */ ++#define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ ++#define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */ ++ ++/* ++ * Functions prototypes ++ * ++ * Original patch had static function declarations in this header file. ++ * Those should rather not be declared in the header as they only cause compiler warnings. ++ */ ++int kw_mmc_initialize(bd_t *bis); ++ ++#endif /* __KIRKWOOD_MMC_H__ */ diff --git a/package/boot/uboot-kirkwood/patches/110-dockstar.patch b/package/boot/uboot-kirkwood/patches/110-dockstar.patch index 46b838f30b..94d62cee82 100644 --- a/package/boot/uboot-kirkwood/patches/110-dockstar.patch +++ b/package/boot/uboot-kirkwood/patches/110-dockstar.patch @@ -7,8 +7,8 @@ +#define CONFIG_SYS_MVFS /* - * Commands configuration -@@ -45,29 +46,29 @@ + * mv-common.h should be defined after CMD configs since it used them +@@ -37,29 +38,29 @@ * it has to be rounded to sector size */ #define CONFIG_ENV_SIZE 0x20000 /* 128k */ diff --git a/package/boot/uboot-kirkwood/patches/120-iconnect.patch b/package/boot/uboot-kirkwood/patches/120-iconnect.patch index 1f1ce75f25..bd1dab818f 100644 --- a/package/boot/uboot-kirkwood/patches/120-iconnect.patch +++ b/package/boot/uboot-kirkwood/patches/120-iconnect.patch @@ -1,7 +1,7 @@ --- a/include/configs/iconnect.h +++ b/include/configs/iconnect.h -@@ -51,30 +51,29 @@ - #define CONFIG_ENV_IS_NOWHERE +@@ -44,30 +44,29 @@ + #define CONFIG_ENV_SECT_SIZE 0x20000 #endif #define CONFIG_ENV_SIZE 0x20000 -#define CONFIG_ENV_OFFSET 0x80000 @@ -42,8 +42,8 @@ * Ethernet driver configuration --- a/configs/iconnect_defconfig +++ b/configs/iconnect_defconfig -@@ -9,6 +9,7 @@ CONFIG_SYS_PROMPT="iconnect => " - # CONFIG_CMD_FLASH is not set +@@ -10,6 +10,7 @@ CONFIG_SYS_PROMPT="iconnect => " + CONFIG_CMD_NAND=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_DHCP=y diff --git a/package/boot/uboot-kirkwood/patches/130-ib62x0.patch b/package/boot/uboot-kirkwood/patches/130-ib62x0.patch index 1be0c62517..58db8c8c8d 100644 --- a/package/boot/uboot-kirkwood/patches/130-ib62x0.patch +++ b/package/boot/uboot-kirkwood/patches/130-ib62x0.patch @@ -1,6 +1,6 @@ --- a/include/configs/ib62x0.h +++ b/include/configs/ib62x0.h -@@ -54,27 +54,22 @@ +@@ -49,27 +49,22 @@ */ #define CONFIG_BOOTCOMMAND \ "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \ diff --git a/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch b/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch index 871affc1af..5c8ff35bee 100644 --- a/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch +++ b/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch @@ -1,6 +1,6 @@ --- a/include/configs/pogo_e02.h +++ b/include/configs/pogo_e02.h -@@ -49,23 +49,30 @@ +@@ -44,23 +44,30 @@ #endif #define CONFIG_ENV_SIZE 0x20000 /* 128k */ diff --git a/package/boot/uboot-kirkwood/patches/150-goflexhome.patch b/package/boot/uboot-kirkwood/patches/150-goflexhome.patch index a7fa8e6f93..88b833072f 100644 --- a/package/boot/uboot-kirkwood/patches/150-goflexhome.patch +++ b/package/boot/uboot-kirkwood/patches/150-goflexhome.patch @@ -1,16 +1,15 @@ --- a/include/configs/goflexhome.h +++ b/include/configs/goflexhome.h -@@ -77,20 +77,18 @@ +@@ -70,20 +70,18 @@ */ #define CONFIG_BOOTCOMMAND \ "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \ - "ubi part root; " \ - "ubifsmount ubi:root; " \ - "ubifsload 0x800000 ${kernel}; " \ -- "bootm 0x800000" + "ubi part ubi; " \ + "ubi read 0x800000 kernel; " \ -+ "bootm 0x800000" + "bootm 0x800000" #define CONFIG_MTDPARTS \ - "mtdparts=orion_nand:1m(uboot),6M(uImage),-(root)\0" diff --git a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch index 2784985928..04614f77cc 100644 --- a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch +++ b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch @@ -1,43 +1,43 @@ --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig -@@ -87,4 +87,7 @@ source "board/Seagate/nas220/Kconfig" +@@ -90,4 +90,7 @@ source "board/zyxel/nsa310/Kconfig" source "board/zyxel/nsa310s/Kconfig" source "board/zyxel/nsa325/Kconfig" - + +config SECOND_STAGE + bool "OpenWrt second stage hack" + endif --- a/include/configs/dockstar.h +++ b/include/configs/dockstar.h -@@ -89,4 +89,6 @@ - #define CONFIG_CMD_MTDPARTS - #define CONFIG_LZO - +@@ -76,4 +76,6 @@ + #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ + #define CONFIG_MTD_PARTITIONS + +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_DOCKSTAR_H */ --- a/include/configs/ib62x0.h +++ b/include/configs/ib62x0.h -@@ -99,4 +99,6 @@ +@@ -94,4 +94,6 @@ #define CONFIG_RTC_MV #endif /* CONFIG_CMD_DATE */ - + +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_IB62x0_H */ --- a/include/configs/iconnect.h +++ b/include/configs/iconnect.h -@@ -94,4 +94,6 @@ +@@ -83,4 +83,6 @@ + #define CONFIG_MTD_DEVICE #define CONFIG_MTD_PARTITIONS - #define CONFIG_CMD_MTDPARTS - + +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_ICONNECT_H */ --- /dev/null +++ b/include/configs/openwrt-kirkwood-common.h -@@ -0,0 +1,40 @@ +@@ -0,0 +1,31 @@ +/* + * Copyright (C) 2013 Luka Perkov + * @@ -47,9 +47,6 @@ +#ifndef __OPENWRT_KIRKWOOD_COMMON_H +#define __OPENWRT_KIRKWOOD_COMMON_H + -+/* Commands */ -+#define CONFIG_CMD_BOOTZ -+ +/* Ethernet */ +#if defined(CONFIG_CMD_NET) +#define CONFIG_SERVERIP 192.168.1.2 @@ -63,14 +60,8 @@ +#define CONFIG_ENV_IS_NOWHERE +#endif + -+/* Flattened uImage Tree */ -+#define CONFIG_FIT 1 -+#define CONFIG_FIT_VERBOSE 1 -+ +/* Various */ +#define CONFIG_BZIP2 -+#define CONFIG_LZMA -+#define CONFIG_LZO + +/* Unnecessary */ +#undef CONFIG_BOOTM_NETBSD @@ -80,37 +71,98 @@ +#endif /* __OPENWRT_KIRKWOOD_COMMON_H */ --- a/include/configs/pogo_e02.h +++ b/include/configs/pogo_e02.h -@@ -93,4 +93,6 @@ - #define CONFIG_CMD_MTDPARTS - #define CONFIG_LZO - +@@ -83,4 +83,6 @@ + #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ + #define CONFIG_MTD_PARTITIONS + +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_POGO_E02_H */ ---- a/include/configs/sheevaplug.h -+++ b/include/configs/sheevaplug.h -@@ -99,4 +99,6 @@ - #define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET - #endif /* CONFIG_CMD_IDE */ - -+#include "openwrt-kirkwood-common.h" -+ - #endif /* _CONFIG_SHEEVAPLUG_H */ --- a/include/configs/goflexhome.h +++ b/include/configs/goflexhome.h -@@ -112,4 +112,6 @@ +@@ -105,4 +105,6 @@ #define CONFIG_RTC_MV #endif /* CONFIG_CMD_DATE */ - + +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_GOFLEXHOME_H */ --- a/include/configs/nsa310.h +++ b/include/configs/nsa310.h -@@ -141,4 +141,6 @@ - #define CONFIG_CMD_DNS +@@ -123,4 +123,6 @@ + #define CONFIG_RTC_MV #endif /* CONFIG_CMD_DATE */ - + +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_NSA310_H */ +--- a/configs/dockstar_defconfig ++++ b/configs/dockstar_defconfig +@@ -25,3 +25,8 @@ CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y + CONFIG_OF_LIBFDT=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y +--- a/configs/goflexhome_defconfig ++++ b/configs/goflexhome_defconfig +@@ -29,3 +29,8 @@ CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y + CONFIG_OF_LIBFDT=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y +--- a/configs/ib62x0_defconfig ++++ b/configs/ib62x0_defconfig +@@ -27,5 +27,9 @@ CONFIG_SYS_NS16550=y + CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y +-CONFIG_LZMA=y + CONFIG_OF_LIBFDT=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y +--- a/configs/iconnect_defconfig ++++ b/configs/iconnect_defconfig +@@ -24,5 +24,9 @@ CONFIG_SYS_NS16550=y + CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y +-CONFIG_LZMA=y + CONFIG_OF_LIBFDT=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y +--- a/configs/nsa310_defconfig ++++ b/configs/nsa310_defconfig +@@ -30,5 +30,8 @@ CONFIG_CMD_UBI=y + CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y + CONFIG_LZMA=y + CONFIG_LZO=y +--- a/configs/pogo_e02_defconfig ++++ b/configs/pogo_e02_defconfig +@@ -25,3 +25,8 @@ CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y + CONFIG_OF_LIBFDT=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y diff --git a/package/boot/uboot-lantiq/Makefile b/package/boot/uboot-lantiq/Makefile index 94b604af34..5493737d3f 100644 --- a/package/boot/uboot-lantiq/Makefile +++ b/package/boot/uboot-lantiq/Makefile @@ -26,205 +26,205 @@ endef define U-Boot/arv4519pw_ram NAME:=Arcadyan arv4519pw (RAM) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV4519PW + BUILD_DEVICES:=arcadyan_arv4519pw DDR_SETTINGS:=board/arcadyan/arv4519pw/ddr_settings.h endef define U-Boot/arv4519pw_nor NAME:=Arcadyan arv4519pw (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV4519PW + BUILD_DEVICES:=arcadyan_arv4519pw endef define U-Boot/arv4519pw_brn NAME:=Arcadyan arv4519pw (BRN) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV4519PW + BUILD_DEVICES:=arcadyan_arv4519pw endef define U-Boot/arv7506pw11_ram NAME:=Arcadyan ARV7506PW11 (RAM) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV7506PW11 + BUILD_DEVICES:=arcadyan_arv7506pw11 DDR_SETTINGS:=board/arcadyan/arv7506pw11/ddr_settings.h endef define U-Boot/arv7506pw11_nor NAME:=Arcadyan ARV7506PW11 (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV7506PW11 + BUILD_DEVICES:=arcadyan_arv7506pw11 endef define U-Boot/arv7506pw11_brn NAME:=Arcadyan ARV7506PW11 (BRN) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV7506PW11 + BUILD_DEVICES:=arcadyan_arv7506pw11 endef define U-Boot/arv7510pw_ram NAME:=Arcadyan arv7510pw (RAM) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV4510PW + BUILD_DEVICES:=arcadyan_arv4510pw DDR_SETTINGS:=board/arcadyan/arv7510pw/ddr_settings.h endef define U-Boot/arv7510pw_nor NAME:=Arcadyan arv7510pw (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV4510PW + BUILD_DEVICES:=arcadyan_arv4510pw endef define U-Boot/arv7510pw_brn NAME:=Arcadyan arv7510pw (BRN) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV4510PW + BUILD_DEVICES:=arcadyan_arv4510pw endef define U-Boot/arv7510pw22_ram NAME:=Arcadyan arv7510pw22 (RAM) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV7510PW22 + BUILD_DEVICES:=arcadyan_arv7510pw22 DDR_SETTINGS:=board/arcadyan/arv7510pw22/ddr_settings.h endef define U-Boot/arv7510pw22_nor NAME:=Arcadyan arv7510pw22 (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV7510PW22 + BUILD_DEVICES:=arcadyan_arv7510pw22 endef define U-Boot/arv7510pw22_brn NAME:=Arcadyan arv7510pw22 (BRN) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV7510PW22 + BUILD_DEVICES:=arcadyan_arv7510pw22 endef define U-Boot/arv7518pw_ram NAME:=Arcadyan arv7518pw (RAM) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV7518PW + BUILD_DEVICES:=arcadyan_arv7518pw DDR_SETTINGS:=board/arcadyan/arv7518pw/ddr_settings.h endef define U-Boot/arv7518pw_nor NAME:=Arcadyan arv7518pw (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV7518PW + BUILD_DEVICES:=arcadyan_arv7518pw endef define U-Boot/arv7518pw_brn NAME:=Arcadyan arv7518pw (BRN) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV7518PW + BUILD_DEVICES:=arcadyan_arv7518pw endef define U-Boot/arv752dpw_ram NAME:=Arcadyan arv752dpw (RAM) BUILD_SUBTARGET:=xway DDR_SETTINGS:=board/arcadyan/arv752dpw/ddr_settings.h - BUILD_DEVICES:=ARV752DPW + BUILD_DEVICES:=arcadyan_arv752dpw endef define U-Boot/arv752dpw_nor NAME:=Arcadyan arv752dpw (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV752DPW + BUILD_DEVICES:=arcadyan_arv752dpw endef define U-Boot/arv752dpw_brn NAME:=Arcadyan arv752dpw (BRN) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV752DPW + BUILD_DEVICES:=arcadyan_arv752dpw endef define U-Boot/arv752dpw22_ram NAME:=Arcadyan arv752dpw22 (RAM) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV752DPW22 + BUILD_DEVICES:=arcadyan_arv752dpw22 DDR_SETTINGS:=board/arcadyan/arv752dpw22/ddr_settings.h endef define U-Boot/arv752dpw22_nor NAME:=Arcadyan arv752dpw22 (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV752DPW22 + BUILD_DEVICES:=arcadyan_arv752dpw22 endef define U-Boot/arv752dpw22_brn NAME:=Arcadyan arv752dpw22 (BRN) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV752DPW22 + BUILD_DEVICES:=arcadyan_arv752dpw22 endef define U-Boot/arv8539pw22_ram NAME:=Speedport W 504V Typ A (RAM) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV8539PW22 + BUILD_DEVICES:=arcadyan_arv8539pw22 DDR_SETTINGS:=board/arcadyan/arv8539pw22/ddr_settings.h endef define U-Boot/arv8539pw22_nor NAME:=Speedport W 504V Typ A (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV8539PW22 + BUILD_DEVICES:=arcadyan_arv8539pw22 endef define U-Boot/arv8539pw22_brn NAME:=Speedport W 504V Typ A (BRN) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV8539PW22 + BUILD_DEVICES:=arcadyan_arv8539pw22 endef define U-Boot/gigasx76x_ram NAME:=Siemens Gigaset sx76x (RAM) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=GIGASX76X + BUILD_DEVICES:=siemens_gigaset-sx76x DDR_SETTINGS:=board/gigaset/sx76x/ddr_settings.h endef define U-Boot/gigasx76x_nor NAME:=Siemens Gigaset sx76x (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=GIGASX76X + BUILD_DEVICES:=siemens_gigaset-sx76x endef define U-Boot/acmp252_ram NAME:=AudioCodes MP-252 (RAM) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ACMP252 + BUILD_DEVICES:=audiocodes_mp-252 DDR_SETTINGS:=board/audiocodes/acmp252/ddr_settings.h endef define U-Boot/acmp252_nor NAME:=AudioCodes MP-252 (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ACMP252 + BUILD_DEVICES:=audiocodes_mp-252 endef define U-Boot/bthomehubv5a_ram NAME:=BT Home Hub 5A (RAM) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=BTHOMEHUBV5A + BUILD_DEVICES:=bt_homehub-v5a DDR_SETTINGS:=board/bt/bthomehubv5a/ddr_settings.h endef define U-Boot/easy50712_ram NAME:=Lantiq EASY50712 (RAM) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=EASY50712 + BUILD_DEVICES:=lantiq_easy50712 DDR_SETTINGS:=board/lantiq/easy50712/ddr_settings.h endef define U-Boot/easy50712_nor NAME:=Lantiq EASY50712 (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=EASY50712 + BUILD_DEVICES:=lantiq_easy50712 endef define U-Boot/easy50712_norspl NAME:=Lantiq EASY50712 (NOR SPL) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=EASY50712 + BUILD_DEVICES:=lantiq_easy50712 UBOOT_IMAGE:=u-boot.ltq.lzo.norspl DEPENDS+=@BROKEN endef @@ -232,20 +232,20 @@ endef define U-Boot/easy80920_ram NAME:=Lantiq EASY80920 (RAM) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=EASY80920NOR EASY80920NAND + BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand DDR_SETTINGS:=board/lantiq/easy80920/ddr_settings.h endef define U-Boot/easy80920_nor NAME:=Lantiq EASY80920 (NOR) - BUILD_DEVICES:=EASY80920NOR EASY80920NAND + BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand BUILD_SUBTARGET:=xrx200 endef define U-Boot/easy80920_norspl NAME:=Lantiq EASY80920 (NOR SPL) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=EASY80920NOR EASY80920NAND + BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand UBOOT_IMAGE:=u-boot.ltq.lzo.norspl DEPENDS+=@BROKEN endef @@ -253,7 +253,7 @@ endef define U-Boot/easy80920_sfspl NAME:=Lantiq EASY80920 (SPI SPL) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=EASY80920NOR EASY80920NAND + BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand UBOOT_IMAGE:=u-boot.ltq.lzo.sfspl DEPENDS+=@BROKEN endef @@ -261,20 +261,20 @@ endef define U-Boot/fb3370_eva NAME:=AVM FRITZ3370 (EVA) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=FRITZ3370 + BUILD_DEVICES:=avm_fritz3370 endef define U-Boot/fb3370_ram NAME:=AVM FRITZ3370 (RAM) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=FRITZ3370 + BUILD_DEVICES:=avm_fritz3370 DDR_SETTINGS:=board/avm/fb3370/ddr_settings.h endef define U-Boot/fb3370_sfspl NAME:=AVM FRITZ3370 (SPI SPL) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=FRITZ3370 + BUILD_DEVICES:=avm_fritz3370 UBOOT_IMAGE:=u-boot.ltq.lzo.sfspl DEPENDS+=@BROKEN endef @@ -282,14 +282,14 @@ endef define U-Boot/p2812hnufx_ram NAME:=ZyXEL P-2812HNU-Fx (RAM) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=P2812HNUF1 + BUILD_DEVICES:=zyxel_p-2812hnu-f1 DDR_SETTINGS:=board/zyxel/p2812hnufx/ddr_settings.h endef define U-Boot/p2812hnufx_nandspl NAME:=ZyXEL P-2812HNU-Fx (NAND SPL) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=P2812HNUF1 + BUILD_DEVICES:=zyxel_p-2812hnu-f1 UBOOT_IMAGE:=u-boot.ltq.lzo.nandspl DEPENDS+=@BROKEN endef @@ -297,38 +297,38 @@ endef define U-Boot/vgv7510kw22_brn NAME:=Arcadyan VGV7510KW22 (BRN) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=VGV7510KW22NOR + BUILD_DEVICES:=arcadyan_vgv7510kw22-nor endef define U-Boot/vgv7510kw22_nor NAME:=Arcadyan VGV7510KW22 (NOR) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=VGV7510KW22NOR + BUILD_DEVICES:=arcadyan_vgv7510kw22-nor endef define U-Boot/vgv7510kw22_ram NAME:=Arcadyan VGV7510KW22 (RAM) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=VGV7510KW22NOR + BUILD_DEVICES:=arcadyan_vgv7510kw22-nor DDR_SETTINGS:=board/arcadyan/vgv7510kw22/ddr_settings.h endef define U-Boot/vgv7519_brn NAME:=Arcadyan VGV7519 (BRN) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=VGV7519NOR VGV7519BRN + BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn endef define U-Boot/vgv7519_nor NAME:=Arcadyan VGV7519 (NOR) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=VGV7519NOR VGV7519BRN + BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn endef define U-Boot/vgv7519_ram NAME:=Arcadyan VGV7519 (RAM) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=VGV7519NOR VGV7519BRN + BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn DDR_SETTINGS:=board/arcadyan/vgv7519/ddr_settings.h endef diff --git a/package/boot/uboot-layerscape-32b/Makefile b/package/boot/uboot-layerscape-32b/Makefile deleted file mode 100644 index 2ea03e5f4f..0000000000 --- a/package/boot/uboot-layerscape-32b/Makefile +++ /dev/null @@ -1,51 +0,0 @@ -# -# Copyright (C) 2016 Jiang Yutang -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=uboot-layerscape-32bit -PKG_VERSION:=v1.0 -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_MIRROR_HASH:=a29edbeddde4b3007ac349c2a5ee434719049ac4753e459dbb1bab21e1c585da -PKG_SOURCE_URL:=https://github.com/fsl-jyt/uboot-ls-32b.git -PKG_SOURCE_VERSION:=6476195551ea83193afd06d0c441483c04729c8d - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - -PKG_MAINTAINER:=Jiang Yutang - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/kernel.mk - -define Package/uboot-layerscape-32b - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_layerscape_32b - TITLE:=32-bit U-Boot for Layerscape boards - DEFAULT:=y - HIDDEN:=1 -endef - -define Build/Configure - -endef - -define Build/Compile - -endef - -define Build/InstallDev - $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(CP) $(PKG_BUILD_DIR)/ls1043ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1043ardb-32b-uboot.bin - $(CP) $(PKG_BUILD_DIR)/ls1046ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1046ardb-32b-uboot.bin - $(CP) $(PKG_BUILD_DIR)/ls1012ardb-uboot.bin.swap $(STAGING_DIR_IMAGE)/ls1012ardb-32b-uboot.bin -endef - -$(eval $(call BuildPackage,uboot-layerscape-32b)) diff --git a/package/boot/uboot-layerscape-armv8_32b/Makefile b/package/boot/uboot-layerscape-armv8_32b/Makefile new file mode 100644 index 0000000000..d1ca829173 --- /dev/null +++ b/package/boot/uboot-layerscape-armv8_32b/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2016 Jiang Yutang +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=uboot-layerscape-armv8_32b +PKG_SOURCE_DATE:=2017-10-24 +PKG_RELEASE:=1 + +# Layerscape ARMv8 platforms use 64-bit u-boot to support both 32-bit and 64-bit +# kernel/rootfs. Since OpenWrt could only provide 32-bit toolchain for 32-bit targets, +# 64-bit u-boot images git tree is provided here whose source code actually is +# uboot-layerscape's source code. +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/yangbolu1991/u-boot-lede.git +PKG_SOURCE_VERSION:=43cb4c0fcab237f8daa39c393cc1441b76b99fcf +PKG_MIRROR_HASH:=ff7d1fcb85dda2be6a9e3785821b5791c7189d2d412b160a9621bb2dcad24dea + +PKG_MAINTAINER:=Yangbo Lu + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/kernel.mk + +define Package/uboot-layerscape-armv8_32b + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_layerscape_armv8_32b + TITLE:=U-Boot for ARMv8 32-bit based Layerscape boards + DEFAULT:=y + HIDDEN:=1 +endef + +define Build/Configure + +endef + +define Build/Compile + +endef + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/ls1043ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1043ardb-armv8_32b-uboot.bin + $(CP) $(PKG_BUILD_DIR)/ls1046ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1046ardb-armv8_32b-uboot.bin + $(CP) $(PKG_BUILD_DIR)/ls1012ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1012ardb-armv8_32b-uboot.bin + $(CP) $(PKG_BUILD_DIR)/ls1012afrdm-uboot.bin $(STAGING_DIR_IMAGE)/ls1012afrdm-armv8_32b-uboot.bin +endef + +$(eval $(call BuildPackage,uboot-layerscape-armv8_32b)) diff --git a/package/boot/uboot-layerscape/Makefile b/package/boot/uboot-layerscape/Makefile index f98205335b..c37b335b49 100644 --- a/package/boot/uboot-layerscape/Makefile +++ b/package/boot/uboot-layerscape/Makefile @@ -9,20 +9,20 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=uboot-layerscape -PKG_VERSION:=v1.0 +PKG_SOURCE_DATE:=2017-08-24 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_MIRROR_HASH:=462fea9bdf03ec4bc23f2f1bb3917c2ec57017eca1e11b8a609bf60cd51a94e7 -PKG_SOURCE_URL:=https://github.com/fsl-jyt/u-boot.git -PKG_SOURCE_VERSION:=69b5ea576a2b0448391a910114d6c05859bf78d0 +PKG_SOURCE_URL:=https://github.com/qoriq-open-source/u-boot.git +PKG_SOURCE_VERSION:=fbedf04c1bad675eadbac86febdcf759441a02af +PKG_MIRROR_HASH:=29922f83ce3e8dde163eafcfd07f3595e2779b7a3e8eb43640f058f58248718d include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk define U-Boot/Default BUILD_TARGET:=layerscape - BUILD_SUBTARGET:=64b + BUILD_SUBTARGET:=armv8_64b BUILD_DEVICES:=$(1) UBOOT_IMAGE:=u-boot-dtb.bin HIDDEN:=y @@ -40,17 +40,34 @@ endef define U-Boot/ls1012ardb NAME:=NXP ls1012ardb 64b Dev Board UBOOT_CONFIG:=ls1012ardb_qspi - UBOOT_IMAGE:=u-boot-swap.bin +endef + +define U-Boot/ls1088ardb + NAME:=NXP ls1088ardb 64b Dev Board + UBOOT_CONFIG:=ls1088ardb_qspi +endef + +define U-Boot/ls2088ardb + NAME:=NXP ls2088ardb 64b Dev Board + UBOOT_CONFIG:=ls2080ardb +endef + +define U-Boot/ls1012afrdm + NAME:=NXP ls1012afrdm 64b Dev Board + UBOOT_CONFIG:=ls1012afrdm_qspi endef UBOOT_TARGETS := \ ls1043ardb \ ls1046ardb \ - ls1012ardb + ls1012ardb \ + ls1088ardb \ + ls2088ardb \ + ls1012afrdm define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-64b-uboot.bin + $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(BUILD_SUBTARGET)-uboot.bin endef define Package/u-boot/install/default diff --git a/package/boot/uboot-layerscape/patches/0001-armv8-ls1043a-add-LEDE-boot-support-in-environment.patch b/package/boot/uboot-layerscape/patches/0001-armv8-ls1043a-add-LEDE-boot-support-in-environment.patch new file mode 100644 index 0000000000..5973831665 --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0001-armv8-ls1043a-add-LEDE-boot-support-in-environment.patch @@ -0,0 +1,51 @@ +From 74be1b50f96b3ada0a4fc18f0283659739edbadf Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Fri, 22 Sep 2017 11:00:12 +0800 +Subject: [PATCH 1/3] armv8: ls1043a: add LEDE boot support in environment + +Signed-off-by: Yangbo Lu +--- + include/configs/ls1043a_common.h | 20 +++++++++++++++++++- + 1 file changed, 19 insertions(+), 1 deletion(-) + +diff --git a/include/configs/ls1043a_common.h b/include/configs/ls1043a_common.h +index 0b3fb4e..5c01111 100644 +--- a/include/configs/ls1043a_common.h ++++ b/include/configs/ls1043a_common.h +@@ -336,7 +336,19 @@ + "sd_bootcmd=echo Trying load from SD ..;" \ + "mmcinfo; mmc read $load_addr " \ + "$kernel_addr_sd $kernel_size_sd ;" \ +- " bootm $load_addr#$board\0" ++ " bootm $load_addr#$board\0" \ ++ "lede_setenv=setenv loadaddr 82000000 && " \ ++ "setenv fdtaddr 8f000000 && " \ ++ "setenv bootargs root=/dev/mtdblock8 " \ ++ "rootfstype=squashfs,jffs2 noinitrd " \ ++ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \ ++ "mtdparts=60000000.nor:1M(rcw),2M(u-boot),1M(u-boot-env)," \ ++ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \ ++ "16M(kernel),32M(rootfs),64M(otherbank)\0" \ ++ "lede_run=cp.b 60f00000 $fdtaddr 100000 && " \ ++ "cp.b 61000000 $loadaddr 1000000 && " \ ++ "bootm $loadaddr - $fdtaddr\0" \ ++ "lede_boot=run lede_setenv;run lede_run\0" + + + #undef CONFIG_BOOTCOMMAND +@@ -351,6 +363,12 @@ + "env exists secureboot && esbc_halt;" + #endif + ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND "run lede_boot" ++ ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ + #define CONFIG_BOOTARGS "console=ttyS0,115200 root=/dev/ram0 " \ + "earlycon=uart8250,mmio,0x21c0500 " \ + MTDPARTS_DEFAULT +-- +2.7.4 + diff --git a/package/boot/uboot-layerscape/patches/0002-armv8-ls1046ardb-add-LEDE-boot-support-in-environmen.patch b/package/boot/uboot-layerscape/patches/0002-armv8-ls1046ardb-add-LEDE-boot-support-in-environmen.patch new file mode 100644 index 0000000000..418f6287fb --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0002-armv8-ls1046ardb-add-LEDE-boot-support-in-environmen.patch @@ -0,0 +1,57 @@ +From dc0e8734ea1c679738377d13bdd9bf3fa644e6b3 Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Fri, 22 Sep 2017 11:36:43 +0800 +Subject: [PATCH 2/3] armv8: ls1046ardb: add LEDE boot support in environment + +Signed-off-by: Yangbo Lu +--- + include/configs/ls1046a_common.h | 15 ++++++++++++++- + include/configs/ls1046ardb.h | 6 ++++++ + 2 files changed, 20 insertions(+), 1 deletion(-) + +diff --git a/include/configs/ls1046a_common.h b/include/configs/ls1046a_common.h +index 4fc2f94..53bd41b 100644 +--- a/include/configs/ls1046a_common.h ++++ b/include/configs/ls1046a_common.h +@@ -276,7 +276,20 @@ + "sd_bootcmd=echo Trying load from SD ..;" \ + "mmcinfo; mmc read $load_addr " \ + "$kernel_addr_sd $kernel_size_sd ;" \ +- " bootm $load_addr#$board\0" ++ " bootm $load_addr#$board\0" \ ++ "lede_setenv=setenv loadaddr 82000000 && " \ ++ "setenv fdtaddr 8f000000 && " \ ++ "setenv bootargs root=/dev/mtdblock9 " \ ++ "rootfstype=ext4 noinitrd " \ ++ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \ ++ "mtdparts=1550000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \ ++ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \ ++ "16M(kernel),30M(ext4rfs),2M(user)\0" \ ++ "lede_run=sf probe 0:0 && " \ ++ "sf read $fdtaddr f00000 100000 && " \ ++ "sf read $loadaddr 1000000 1000000 && " \ ++ "bootm $loadaddr - $fdtaddr\0" \ ++ "lede_boot=run lede_setenv;run lede_run\0" + + + #define CONFIG_BOOTARGS "console=ttyS0,115200 root=/dev/ram0 " \ +diff --git a/include/configs/ls1046ardb.h b/include/configs/ls1046ardb.h +index f8c15a6..c3b50b1 100644 +--- a/include/configs/ls1046ardb.h ++++ b/include/configs/ls1046ardb.h +@@ -251,6 +251,12 @@ + "env exists secureboot && esbc_halt;" + #endif + ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND "run lede_boot" ++ ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ + #define MTDPARTS_DEFAULT "mtdparts=1550000.quadspi:1m(rcw)," \ + "15m(u-boot),48m(kernel.itb);" \ + "7e800000.flash:16m(nand_uboot)," \ +-- +2.7.4 + diff --git a/package/boot/uboot-layerscape/patches/0003-armv8-ls1012ardb-add-LEDE-boot-support-in-environmen.patch b/package/boot/uboot-layerscape/patches/0003-armv8-ls1012ardb-add-LEDE-boot-support-in-environmen.patch new file mode 100644 index 0000000000..e8bbe7faa3 --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0003-armv8-ls1012ardb-add-LEDE-boot-support-in-environmen.patch @@ -0,0 +1,51 @@ +From 8d6efca7eb2de012b98493206c87f31ee9b9e967 Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Thu, 28 Sep 2017 11:25:58 +0800 +Subject: [PATCH 3/3] armv8: ls1012ardb: add LEDE boot support in environment + +Signed-off-by: Yangbo Lu +--- + include/configs/ls1012ardb.h | 21 ++++++++++++++++++++- + 1 file changed, 20 insertions(+), 1 deletion(-) + +diff --git a/include/configs/ls1012ardb.h b/include/configs/ls1012ardb.h +index 5fe3218..242cdf0 100644 +--- a/include/configs/ls1012ardb.h ++++ b/include/configs/ls1012ardb.h +@@ -127,13 +127,32 @@ + "$kernel_addr $kernel_size; env exists secureboot " \ + "&& sf read $kernelheader_addr_r $kernelheader_addr " \ + "$kernelheader_size && esbc_validate ${kernelheader_addr_r}; " \ +- "bootm $load_addr#$board\0" ++ "bootm $load_addr#$board\0" \ ++ "lede_setenv=setenv loadaddr 82000000 && " \ ++ "setenv fdtaddr 8f000000 && " \ ++ "setenv bootargs root=/dev/mtdblock8 " \ ++ "rootfstype=ext4 noinitrd " \ ++ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \ ++ "mtdparts=1550000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \ ++ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \ ++ "16M(kernel),30M(ext4rfs),2M(user)\0" \ ++ "lede_run=pfe stop && sf probe 0:0 && " \ ++ "sf read $fdtaddr f00000 100000 && " \ ++ "sf read $loadaddr 1000000 1000000 && " \ ++ "bootm $loadaddr - $fdtaddr\0" \ ++ "lede_boot=run lede_setenv;run lede_run\0" + + #undef CONFIG_BOOTCOMMAND + #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI) + #define CONFIG_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; " \ + "env exists secureboot && esbc_halt;" + #endif ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND "run lede_boot" ++ ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ + + #include + +-- +2.7.4 + diff --git a/package/boot/uboot-layerscape/patches/0004-armv8-ls1088ardb-add-LEDE-boot-support-in-environmen.patch b/package/boot/uboot-layerscape/patches/0004-armv8-ls1088ardb-add-LEDE-boot-support-in-environmen.patch new file mode 100644 index 0000000000..eaf0da2833 --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0004-armv8-ls1088ardb-add-LEDE-boot-support-in-environmen.patch @@ -0,0 +1,58 @@ +From 479bf0c0bec2e99442214facf0f414c2c737ac7b Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Mon, 16 Oct 2017 11:57:36 +0800 +Subject: [PATCH] armv8: ls1088ardb: add LEDE boot support in environment + +Signed-off-by: Yangbo Lu +--- + include/configs/ls1088ardb.h | 27 ++++++++++++++++++++++++++- + 1 file changed, 26 insertions(+), 1 deletion(-) + +diff --git a/include/configs/ls1088ardb.h b/include/configs/ls1088ardb.h +index 7bd152d..4cefa40 100644 +--- a/include/configs/ls1088ardb.h ++++ b/include/configs/ls1088ardb.h +@@ -404,7 +404,20 @@ + "env exists secureboot && mmc read $kernelheader_addr_r " \ + "$kernelhdr_addr_sd $kernelhdr_size_sd " \ + " && esbc_validate ${kernelheader_addr_r};" \ +- "bootm $load_addr#$BOARD\0" ++ "bootm $load_addr#$BOARD\0" \ ++ "lede_setenv=setenv loadaddr 82000000 && " \ ++ "setenv fdtaddr 8f000000 && " \ ++ "setenv bootargs root=/dev/mtdblock10 " \ ++ "rootfstype=ext4 noinitrd " \ ++ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \ ++ "mtdparts=20c0000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \ ++ "6M(reserved-1),3M(mc),1M(dpl),1M(dpc),1M(dtb)," \ ++ "16M(kernel),30M(ext4rfs),2M(user)\0" \ ++ "lede_run=sf probe 0:0 && " \ ++ "sf read $fdtaddr f00000 100000 && " \ ++ "sf read $loadaddr 1000000 1000000 && " \ ++ "bootm $loadaddr - $fdtaddr\0" \ ++ "lede_boot=run lede_setenv;run lede_run\0" + + #undef CONFIG_BOOTCOMMAND + #if defined(CONFIG_QSPI_BOOT) +@@ -429,6 +442,18 @@ + "run distro_bootcmd;run sd_bootcmd;" \ + "env exists secureboot && esbc_halt;" + #endif ++ ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND \ ++ "sf probe 0:0;sf read 0x80000000 0xA00000 0x300000;" \ ++ "sf read 0x80300000 0xE00000 0x100000;" \ ++ "fsl_mc start mc 0x80000000 0x80300000;" \ ++ "sf read 0x80400000 0xd00000 0x100000;" \ ++ "fsl_mc apply dpl 0x80400000;" \ ++ "run lede_boot;" ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ + /* MAC/PHY configuration */ + #ifdef CONFIG_FSL_MC_ENET + #define CONFIG_PHYLIB_10G +-- +2.7.4 + diff --git a/package/boot/uboot-layerscape/patches/0005-armv8-ls2088ardb-add-LEDE-boot-support-in-environmen.patch b/package/boot/uboot-layerscape/patches/0005-armv8-ls2088ardb-add-LEDE-boot-support-in-environmen.patch new file mode 100644 index 0000000000..6da256ab06 --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0005-armv8-ls2088ardb-add-LEDE-boot-support-in-environmen.patch @@ -0,0 +1,54 @@ +From 20f270670d1d5e14f3fd128f359535300a955ac8 Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Mon, 16 Oct 2017 12:37:05 +0800 +Subject: [PATCH] armv8: ls2088ardb: add LEDE boot support in environment + +Signed-off-by: Yangbo Lu +--- + include/configs/ls2080ardb.h | 23 ++++++++++++++++++++++- + 1 file changed, 22 insertions(+), 1 deletion(-) + +diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h +index 8a34990..8ae3944 100644 +--- a/include/configs/ls2080ardb.h ++++ b/include/configs/ls2080ardb.h +@@ -432,7 +432,19 @@ unsigned long get_board_sys_clk(void); + "env exists secureboot && mmc read $kernelheader_addr_r " \ + "$kernelhdr_addr_sd $kernelhdr_size_sd " \ + " && esbc_validate ${kernelheader_addr_r};" \ +- "bootm $load_addr#$board\0" ++ "bootm $load_addr#$board\0" \ ++ "lede_setenv=setenv loadaddr 82000000 && " \ ++ "setenv fdtaddr 8f000000 && " \ ++ "setenv bootargs root=/dev/mtdblock9 " \ ++ "rootfstype=squashfs,jffs2 noinitrd " \ ++ "earlycon=uart8250,mmio,0x21c0500 console=ttyS1,115200 " \ ++ "mtdparts=580000000.nor:1M(rcw),2M(u-boot),1M(u-boot-env)," \ ++ "6M(reserved-1),3M(mc),1M(dpl),1M(dpc),1M(dtb)," \ ++ "16M(kernel),32M(rootfs),64M(otherbank)\0" \ ++ "lede_run=cp.b 580f00000 $fdtaddr 100000 && " \ ++ "cp.b 581000000 $loadaddr 1000000 && " \ ++ "bootm $loadaddr - $fdtaddr\0" \ ++ "lede_boot=run lede_setenv;run lede_run\0" + + #undef CONFIG_BOOTCOMMAND + #ifdef CONFIG_QSPI_BOOT +@@ -463,6 +475,15 @@ unsigned long get_board_sys_clk(void); + "env exists secureboot && esbc_halt;" + #endif + ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND \ ++ "fsl_mc start mc 0x580a00000 0x580e00000;" \ ++ "fsl_mc apply dpl 0x580d00000;" \ ++ "run lede_boot;" ++ ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ + #undef CONFIG_BOOTARGS + #define CONFIG_BOOTARGS "console=ttyS1,115200 root=/dev/ram0 " \ + "earlycon=uart8250,mmio,0x21c0600 " \ +-- +2.7.4 + diff --git a/package/boot/uboot-layerscape/patches/0006-armv8-ls1012afrdm-add-LEDE-boot-support-in-environme.patch b/package/boot/uboot-layerscape/patches/0006-armv8-ls1012afrdm-add-LEDE-boot-support-in-environme.patch new file mode 100644 index 0000000000..45010a2108 --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0006-armv8-ls1012afrdm-add-LEDE-boot-support-in-environme.patch @@ -0,0 +1,49 @@ +From a5e454a3bb33a456655f08592606e4df34e40110 Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Tue, 24 Oct 2017 17:48:08 +0800 +Subject: [PATCH] armv8: ls1012afrdm: add LEDE boot support in environment + +Signed-off-by: Yangbo Lu +--- + include/configs/ls1012afrdm.h | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/include/configs/ls1012afrdm.h b/include/configs/ls1012afrdm.h +index a3f8824d27..36dff19bdd 100644 +--- a/include/configs/ls1012afrdm.h ++++ b/include/configs/ls1012afrdm.h +@@ -73,12 +73,31 @@ + "qspi_bootcmd=echo Trying load from qspi..;" \ + "sf probe && sf read $load_addr " \ + "$kernel_addr $kernel_size && bootm $load_addr#$board\0" \ ++ "lede_setenv=setenv loadaddr 82000000 && " \ ++ "setenv fdtaddr 8f000000 && " \ ++ "setenv bootargs root=/dev/mtdblock8 " \ ++ "rootfstype=ext4 noinitrd " \ ++ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \ ++ "mtdparts=1550000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \ ++ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \ ++ "16M(kernel),30M(ext4rfs),2M(user)\0" \ ++ "lede_run=pfe stop && sf probe 0:0 && " \ ++ "sf read $fdtaddr f00000 100000 && " \ ++ "sf read $loadaddr 1000000 1000000 && " \ ++ "bootm $loadaddr - $fdtaddr\0" \ ++ "lede_boot=run lede_setenv;run lede_run\0" + + #undef CONFIG_BOOTCOMMAND + #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI) + #define CONFIG_BOOTCOMMAND "run distro_bootcmd;run qspi_bootcmd" + #endif + ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND "run lede_boot" ++ ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ + /* + * USB + */ +-- +2.14.1 + diff --git a/package/boot/uboot-mvebu/Makefile b/package/boot/uboot-mvebu/Makefile index 2c280faa21..b29039cd82 100644 --- a/package/boot/uboot-mvebu/Makefile +++ b/package/boot/uboot-mvebu/Makefile @@ -16,6 +16,8 @@ PKG_HASH:=f54baf3f9325bf444c7905f3a5b6f83680edb1e6e1a4d5f8a5ad80abe885113f include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk +UBOOT_MAKE_FLAGS:= + define U-Boot/Default BUILD_TARGET:=mvebu HIDDEN:=1 diff --git a/package/boot/uboot-mvebu/patches/0004-clearfog-enable-setexpr-command-by-default.patch b/package/boot/uboot-mvebu/patches/0004-clearfog-enable-setexpr-command-by-default.patch index 9a74c52c63..ca734660ef 100644 --- a/package/boot/uboot-mvebu/patches/0004-clearfog-enable-setexpr-command-by-default.patch +++ b/package/boot/uboot-mvebu/patches/0004-clearfog-enable-setexpr-command-by-default.patch @@ -11,18 +11,14 @@ Signed-off-by: Josua Mayer configs/clearfog_defconfig | 1 + 1 file changed, 1 insertion(+) -diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig -index 41e94e6daf..f3572971be 100644 --- a/configs/clearfog_defconfig +++ b/configs/clearfog_defconfig -@@ -34,6 +34,7 @@ CONFIG_CMD_EXT2=y - CONFIG_CMD_EXT4=y - CONFIG_CMD_FAT=y - CONFIG_CMD_FS_GENERIC=y +@@ -23,7 +23,7 @@ CONFIG_CMD_SF=y + CONFIG_CMD_SPI=y + CONFIG_CMD_I2C=y + CONFIG_CMD_USB=y +-# CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_SETEXPR=y - CONFIG_EFI_PARTITION=y - # CONFIG_PARTITION_UUIDS is not set - # CONFIG_SPL_PARTITION_UUIDS is not set --- -2.12.2 - + CONFIG_CMD_TFTPPUT=y + CONFIG_CMD_DHCP=y + CONFIG_CMD_MII=y diff --git a/package/boot/uboot-mvebu/patches/0011-rsa-Fix-build-with-OpenSSL-1.1.x.patch b/package/boot/uboot-mvebu/patches/0011-rsa-Fix-build-with-OpenSSL-1.1.x.patch new file mode 100644 index 0000000000..fbbfe462b7 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/0011-rsa-Fix-build-with-OpenSSL-1.1.x.patch @@ -0,0 +1,153 @@ +From 59be82ef7e7ec4be6e1597d8aef65dd3d8c3a0d9 Mon Sep 17 00:00:00 2001 +From: Jelle van der Waa +Date: Mon, 8 May 2017 21:31:19 +0200 +Subject: [PATCH 1/2] rsa: Fix build with OpenSSL 1.1.x + +The rsa_st struct has been made opaque in 1.1.x, add forward compatible +code to access the n, e, d members of rsa_struct. + +EVP_MD_CTX_cleanup has been removed in 1.1.x and EVP_MD_CTX_reset should be +called to reinitialise an already created structure. +--- + lib/rsa/rsa-sign.c | 44 ++++++++++++++++++++++++++++++++++++++------ + 1 file changed, 38 insertions(+), 6 deletions(-) + +--- a/lib/rsa/rsa-sign.c ++++ b/lib/rsa/rsa-sign.c +@@ -9,6 +9,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -20,6 +21,19 @@ + #define HAVE_ERR_REMOVE_THREAD_STATE + #endif + ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++static void RSA_get0_key(const RSA *r, ++ const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) ++{ ++ if (n != NULL) ++ *n = r->n; ++ if (e != NULL) ++ *e = r->e; ++ if (d != NULL) ++ *d = r->d; ++} ++#endif ++ + static int rsa_err(const char *msg) + { + unsigned long sslErr = ERR_get_error(); +@@ -286,16 +300,22 @@ static int rsa_init(void) + { + int ret; + ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + ret = SSL_library_init(); ++#else ++ ret = OPENSSL_init_ssl(0, NULL); ++#endif + if (!ret) { + fprintf(stderr, "Failure to init SSL library\n"); + return -1; + } ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + SSL_load_error_strings(); + + OpenSSL_add_all_algorithms(); + OpenSSL_add_all_digests(); + OpenSSL_add_all_ciphers(); ++#endif + + return 0; + } +@@ -335,12 +355,15 @@ err_set_rsa: + err_engine_init: + ENGINE_free(e); + err_engine_by_id: ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + ENGINE_cleanup(); ++#endif + return ret; + } + + static void rsa_remove(void) + { ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + CRYPTO_cleanup_all_ex_data(); + ERR_free_strings(); + #ifdef HAVE_ERR_REMOVE_THREAD_STATE +@@ -349,6 +372,7 @@ static void rsa_remove(void) + ERR_remove_state(0); + #endif + EVP_cleanup(); ++#endif + } + + static void rsa_engine_remove(ENGINE *e) +@@ -409,7 +433,11 @@ static int rsa_sign_with_key(RSA *rsa, s + ret = rsa_err("Could not obtain signature"); + goto err_sign; + } +- EVP_MD_CTX_cleanup(context); ++ #if OPENSSL_VERSION_NUMBER < 0x10100000L ++ EVP_MD_CTX_cleanup(context); ++ #else ++ EVP_MD_CTX_reset(context); ++ #endif + EVP_MD_CTX_destroy(context); + EVP_PKEY_free(key); + +@@ -479,6 +507,7 @@ static int rsa_get_exponent(RSA *key, ui + { + int ret; + BIGNUM *bn_te; ++ const BIGNUM *key_e; + uint64_t te; + + ret = -EINVAL; +@@ -487,17 +516,18 @@ static int rsa_get_exponent(RSA *key, ui + if (!e) + goto cleanup; + +- if (BN_num_bits(key->e) > 64) ++ RSA_get0_key(key, NULL, &key_e, NULL); ++ if (BN_num_bits(key_e) > 64) + goto cleanup; + +- *e = BN_get_word(key->e); ++ *e = BN_get_word(key_e); + +- if (BN_num_bits(key->e) < 33) { ++ if (BN_num_bits(key_e) < 33) { + ret = 0; + goto cleanup; + } + +- bn_te = BN_dup(key->e); ++ bn_te = BN_dup(key_e); + if (!bn_te) + goto cleanup; + +@@ -527,6 +557,7 @@ int rsa_get_params(RSA *key, uint64_t *e + { + BIGNUM *big1, *big2, *big32, *big2_32; + BIGNUM *n, *r, *r_squared, *tmp; ++ const BIGNUM *key_n; + BN_CTX *bn_ctx = BN_CTX_new(); + int ret = 0; + +@@ -548,7 +579,8 @@ int rsa_get_params(RSA *key, uint64_t *e + if (0 != rsa_get_exponent(key, exponent)) + ret = -1; + +- if (!BN_copy(n, key->n) || !BN_set_word(big1, 1L) || ++ RSA_get0_key(key, &key_n, NULL, NULL); ++ if (!BN_copy(n, key_n) || !BN_set_word(big1, 1L) || + !BN_set_word(big2, 2L) || !BN_set_word(big32, 32L)) + ret = -1; + diff --git a/package/boot/uboot-mvebu/patches/0012-tools-kwbimage-fix-build-with-OpenSSL-1.1.x.patch b/package/boot/uboot-mvebu/patches/0012-tools-kwbimage-fix-build-with-OpenSSL-1.1.x.patch new file mode 100644 index 0000000000..882969905c --- /dev/null +++ b/package/boot/uboot-mvebu/patches/0012-tools-kwbimage-fix-build-with-OpenSSL-1.1.x.patch @@ -0,0 +1,96 @@ +From 65030804dc57f3488e4ffe21e72fc65cd245cb98 Mon Sep 17 00:00:00 2001 +From: Jelle van der Waa +Date: Mon, 8 May 2017 21:31:20 +0200 +Subject: [PATCH 2/2] tools: kwbimage fix build with OpenSSL 1.1.x + +The rsa_st struct has been made opaque in 1.1.x, add forward compatible +code to access the n, e, d members of rsa_struct. + +EVP_MD_CTX_cleanup has been removed in 1.1.x and EVP_MD_CTX_reset should be +called to reinitialise an already created structure. + +Signed-off-by: Jelle van der Waa +--- + tools/kwbimage.c | 36 ++++++++++++++++++++++++++++++------ + 1 file changed, 30 insertions(+), 6 deletions(-) + +--- a/tools/kwbimage.c ++++ b/tools/kwbimage.c +@@ -18,10 +18,30 @@ + #include "kwbimage.h" + + #ifdef CONFIG_KWB_SECURE ++#include + #include + #include + #include + #include ++ ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++static void RSA_get0_key(const RSA *r, ++ const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) ++{ ++ if (n != NULL) ++ *n = r->n; ++ if (e != NULL) ++ *e = r->e; ++ if (d != NULL) ++ *d = r->d; ++} ++ ++#else ++void EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) ++{ ++ EVP_MD_CTX_reset(ctx); ++} ++#endif + #endif + + static struct image_cfg_element *image_cfg; +@@ -470,12 +490,16 @@ static int kwb_export_pubkey(RSA *key, s + char *keyname) + { + int size_exp, size_mod, size_seq; ++ const BIGNUM *key_e, *key_n; + uint8_t *cur; + char *errmsg = "Failed to encode %s\n"; + +- if (!key || !key->e || !key->n || !dst) { ++ RSA_get0_key(key, NULL, &key_e, NULL); ++ RSA_get0_key(key, &key_n, NULL, NULL); ++ ++ if (!key || !key_e || !key_n || !dst) { + fprintf(stderr, "export pk failed: (%p, %p, %p, %p)", +- key, key->e, key->n, dst); ++ key, key_e, key_n, dst); + fprintf(stderr, errmsg, keyname); + return -EINVAL; + } +@@ -490,8 +514,8 @@ static int kwb_export_pubkey(RSA *key, s + * do the encoding manually. + */ + +- size_exp = BN_num_bytes(key->e); +- size_mod = BN_num_bytes(key->n); ++ size_exp = BN_num_bytes(key_e); ++ size_mod = BN_num_bytes(key_n); + size_seq = 4 + size_mod + 4 + size_exp; + + if (size_mod > 256) { +@@ -520,14 +544,14 @@ static int kwb_export_pubkey(RSA *key, s + *cur++ = 0x82; + *cur++ = (size_mod >> 8) & 0xFF; + *cur++ = size_mod & 0xFF; +- BN_bn2bin(key->n, cur); ++ BN_bn2bin(key_n, cur); + cur += size_mod; + /* Exponent */ + *cur++ = 0x02; /* INTEGER */ + *cur++ = 0x82; + *cur++ = (size_exp >> 8) & 0xFF; + *cur++ = size_exp & 0xFF; +- BN_bn2bin(key->e, cur); ++ BN_bn2bin(key_e, cur); + + if (hashf) { + struct hash_v1 pk_hash; diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile index bb58104d06..056300e189 100644 --- a/package/boot/uboot-sunxi/Makefile +++ b/package/boot/uboot-sunxi/Makefile @@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_VERSION:=2016.03 +PKG_VERSION:=2017.07 -PKG_HASH:=e49337262ecac44dbdeac140f2c6ebd1eba345e0162b0464172e7f05583ed7bb +PKG_HASH:=5374bfdc8acb9a38c025371b1ff20f45e7533668e84e685d0df5d9e7c0e4feff PKG_MAINTAINER:=Zoltan HERPAI @@ -26,93 +26,162 @@ define U-Boot/Default endef define U-Boot/A10-OLinuXino-Lime + BUILD_SUBTARGET:=cortexa8 NAME:=A10 OLinuXino LIME BUILD_DEVICES:=sun4i-a10-olinuxino-lime endef define U-Boot/A13-OLinuXino + BUILD_SUBTARGET:=cortexa8 NAME:=A13 OlinuXino BUILD_DEVICES:=sun5i-a13-olinuxino endef define U-Boot/A20-OLinuXino-Lime + BUILD_SUBTARGET:=cortexa7 NAME:=A20 OLinuXino LIME BUILD_DEVICES:=sun7i-a20-olinuxino-lime endef +define U-Boot/A20-OLinuXino-Lime2 + BUILD_SUBTARGET:=cortexa7 + NAME:=A20 OLinuXino LIME2 + BUILD_DEVICES:=sun7i-a20-olinuxino-lime2 +endef + +define U-Boot/A20-OLinuXino-Lime2-eMMC + BUILD_SUBTARGET:=cortexa7 + NAME:=A20 OLinuXino LIME2 eMMC + BUILD_DEVICES:=sun7i-a20-olinuxino-lime2-emmc +endef + define U-Boot/A20-OLinuXino_MICRO + BUILD_SUBTARGET:=cortexa7 NAME:=A20 OLinuXino MICRO BUILD_DEVICES:=sun7i-a20-olinuxino-micro endef define U-Boot/Bananapi + BUILD_SUBTARGET:=cortexa7 NAME:=Bananapi BUILD_DEVICES:=sun7i-a20-bananapi endef define U-Boot/Bananapro + BUILD_SUBTARGET:=cortexa7 NAME:=Bananapro BUILD_DEVICES:=sun7i-a20-bananapro endef define U-Boot/Cubieboard + BUILD_SUBTARGET:=cortexa8 NAME:=Cubieboard BUILD_DEVICES:=sun4i-a10-cubieboard endef define U-Boot/Cubieboard2 + BUILD_SUBTARGET:=cortexa7 NAME:=Cubieboard2 BUILD_DEVICES:=sun7i-a20-cubieboard2 endef define U-Boot/Cubietruck + BUILD_SUBTARGET:=cortexa7 NAME:=Cubietruck BUILD_DEVICES:=sun7i-a20-cubietruck endef define U-Boot/Hummingbird_A31 + BUILD_SUBTARGET:=cortexa7 NAME:=Hummingbird A31 board endef +define U-Boot/Marsboard_A10 + BUILD_SUBTARGET:=cortexa8 + NAME:=Marsboard + BUILD_DEVICES:=sun4i-a10-marsboard +endef + define U-Boot/Mele_M9 + BUILD_SUBTARGET:=cortexa7 NAME:=Mele M9 (A31) BUILD_DEVICES:=sun6i-a31-m9 endef define U-Boot/OLIMEX_A13_SOM + BUILD_SUBTARGET:=cortexa8 NAME:=Olimex A13 SOM BUILD_DEVICES:=sun5i-a13-olimex-som endef define U-Boot/Linksprite_pcDuino + BUILD_SUBTARGET:=cortexa8 NAME:=Linksprite pcDuino BUILD_DEVICES:=sun4i-a10-pcduino endef define U-Boot/Linksprite_pcDuino3 + BUILD_SUBTARGET:=cortexa7 NAME:=Linksprite pcDuino3 BUILD_DEVICES:=sun7i-a20-pcduino3 endef define U-Boot/Lamobo_R1 + BUILD_SUBTARGET:=cortexa7 NAME:=Lamobo R1 BUILD_DEVICES:=sun7i-a20-lamobo-r1 endef +define U-Boot/nanopi_m1_plus + BUILD_SUBTARGET:=cortexa7 + NAME:=NanoPi M1 Plus (H3) + BUILD_DEVICES:=sun8i-h3-nanopi-m1-plus +endef + +define U-Boot/nanopi_neo + BUILD_SUBTARGET:=cortexa7 + NAME:=U-Boot for NanoPi NEO (H3) + BUILD_DEVICES:=sun8i-h3-nanopi-neo +endef + +define U-Boot/orangepi_r1 + BUILD_SUBTARGET:=cortexa7 + NAME:=Orange Pi R1 (H2+) + BUILD_DEVICES:=sun8i-h2-plus-orangepi-r1 +endef + define U-Boot/orangepi_plus + BUILD_SUBTARGET:=cortexa7 NAME:=Orange Pi Plus (H3) BUILD_DEVICES:=sun8i-h3-orangepi-plus endef +define U-Boot/orangepi_2 + BUILD_SUBTARGET:=cortexa7 + NAME:=Orange Pi 2 (H3) + BUILD_DEVICES:=sun8i-h3-orangepi-2 +endef + define U-Boot/pangolin + BUILD_SUBTARGET:=cortexa7 NAME:=Theobroma A31-yQ7 devboard UENV:=pangolin endef +define U-Boot/pine64_plus + BUILD_SUBTARGET:=cortexa53 + NAME:=Pine64 Plus A64 + BUILD_DEVICES:=sun50i-a64-pine64-plus + DEPENDS:=+PACKAGE_u-boot-pine64_plus:arm-trusted-firmware-sunxi + UENV:=a64 +endef + UBOOT_TARGETS := \ A10-OLinuXino-Lime \ A13-OLinuXino \ A20-OLinuXino-Lime \ + A20-OLinuXino-Lime2 \ + A20-OLinuXino-Lime2-eMMC \ A20-OLinuXino_MICRO \ Bananapi \ Bananapro \ @@ -120,19 +189,32 @@ UBOOT_TARGETS := \ Cubieboard2 \ Cubietruck \ Hummingbird_A31 \ + Marsboard_A10 \ Mele_M9 \ OLIMEX_A13_SOM \ Linksprite_pcDuino \ Linksprite_pcDuino3 \ Lamobo_R1 \ + nanopi_m1_plus \ + nanopi_neo \ + orangepi_r1 \ orangepi_plus \ - pangolin + orangepi_2 \ + pangolin \ + pine64_plus UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes +UBOOT_MAKE_FLAGS += \ + BL31=$(STAGING_DIR_IMAGE)/bl31.bin + define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) +ifeq ($(SUBTARGET),cortexa53) + cat $(PKG_BUILD_DIR)/spl/sunxi-spl.bin $(PKG_BUILD_DIR)/u-boot.itb > $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-u-boot-with-spl.bin +else $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-u-boot-with-spl.bin +endif mkimage -C none -A arm -T script -d uEnv-$(UENV).txt \ $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-boot.scr endef diff --git a/package/boot/uboot-sunxi/patches/002-add-olimex-a13-som.patch b/package/boot/uboot-sunxi/patches/002-add-olimex-a13-som.patch index f29ad12b75..c19f3781d1 100644 --- a/package/boot/uboot-sunxi/patches/002-add-olimex-a13-som.patch +++ b/package/boot/uboot-sunxi/patches/002-add-olimex-a13-som.patch @@ -1,8 +1,7 @@ --- /dev/null +++ b/configs/OLIMEX_A13_SOM_defconfig -@@ -0,0 +1,18 @@ +@@ -0,0 +1,17 @@ +CONFIG_SPL=y -+CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2" +CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-olinuxino" +CONFIG_ARM=y +CONFIG_ARCH_SUNXI=y diff --git a/package/boot/uboot-sunxi/patches/003-add-theobroma-a31-pangolin.patch b/package/boot/uboot-sunxi/patches/003-add-theobroma-a31-pangolin.patch index e5a66d7ebe..2fce04828c 100644 --- a/package/boot/uboot-sunxi/patches/003-add-theobroma-a31-pangolin.patch +++ b/package/boot/uboot-sunxi/patches/003-add-theobroma-a31-pangolin.patch @@ -1,16 +1,16 @@ --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile -@@ -152,6 +152,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \ +@@ -254,6 +254,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \ sun6i-a31-m9.dtb \ sun6i-a31-mele-a1000g-quad.dtb \ sun6i-a31-mixtile-loftq.dtb \ + sun6i-a31-pangolin.dtb \ + sun6i-a31s-colorfly-e708-q1.dtb \ sun6i-a31s-cs908.dtb \ - sun6i-a31s-primo81.dtb \ - sun6i-a31s-sinovoip-bpi-m2.dtb + sun6i-a31s-inet-q972.dtb \ --- a/arch/arm/dts/sun6i-a31.dtsi +++ b/arch/arm/dts/sun6i-a31.dtsi -@@ -643,6 +643,13 @@ +@@ -679,6 +679,13 @@ allwinner,pull = ; }; @@ -358,17 +358,9 @@ +CONFIG_DM_SPI=y +CONFIG_DM_SPI_FLASH=y +CONFIG_SUNXI_SPI=y ---- a/board/sunxi/Kconfig -+++ b/board/sunxi/Kconfig -@@ -15,7 +15,6 @@ config SUNXI_GEN_SUN6I - separate ahb reset control registers, custom pmic bus, new style - watchdog, etc. - -- - choice - prompt "Sunxi SoC Variant" - optional -@@ -533,6 +532,14 @@ config VIDEO_LCD_PANEL_I2C_SCL +--- a/arch/arm/mach-sunxi/Kconfig ++++ b/arch/arm/mach-sunxi/Kconfig +@@ -746,6 +746,14 @@ config VIDEO_LCD_PANEL_I2C_SCL Set the SCL pin for the LCD i2c interface. This takes a string in the format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H. diff --git a/package/boot/uboot-sunxi/patches/010-dt-sync-files-with-kernel.patch b/package/boot/uboot-sunxi/patches/010-dt-sync-files-with-kernel.patch deleted file mode 100644 index d8fa52c7e5..0000000000 --- a/package/boot/uboot-sunxi/patches/010-dt-sync-files-with-kernel.patch +++ /dev/null @@ -1,1403 +0,0 @@ -From 4bb656e9dde2019cb42ac4c27b3a114a801ad127 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Wed, 16 Mar 2016 13:41:23 +0100 -Subject: [PATCH] include/dt-bindings: Sync some files with the kernel - -This commit syncs the dt-bindings/input/* headers with the kernel (v4.5) -and adds dt-bindings/clock/sun4i-a10-pll2.h, both are necessary for newer -sunxi dts files to build. - -Signed-off-by: Hans de Goede -Reviewed-by: Tom Rini -Acked-by: Ian Campbell ---- - include/dt-bindings/clock/sun4i-a10-pll2.h | 53 ++ - include/dt-bindings/input/input.h | 510 +--------------- - include/dt-bindings/input/linux-event-codes.h | 805 ++++++++++++++++++++++++++ - 3 files changed, 859 insertions(+), 509 deletions(-) - create mode 100644 include/dt-bindings/clock/sun4i-a10-pll2.h - create mode 100644 include/dt-bindings/input/linux-event-codes.h - ---- /dev/null -+++ b/include/dt-bindings/clock/sun4i-a10-pll2.h -@@ -0,0 +1,53 @@ -+/* -+ * Copyright 2015 Maxime Ripard -+ * -+ * Maxime Ripard -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file 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. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#ifndef __DT_BINDINGS_CLOCK_SUN4I_A10_PLL2_H_ -+#define __DT_BINDINGS_CLOCK_SUN4I_A10_PLL2_H_ -+ -+#define SUN4I_A10_PLL2_1X 0 -+#define SUN4I_A10_PLL2_2X 1 -+#define SUN4I_A10_PLL2_4X 2 -+#define SUN4I_A10_PLL2_8X 3 -+ -+#endif /* __DT_BINDINGS_CLOCK_SUN4I_A10_PLL2_H_ */ ---- a/include/dt-bindings/input/input.h -+++ b/include/dt-bindings/input/input.h -@@ -9,515 +9,7 @@ - #ifndef _DT_BINDINGS_INPUT_INPUT_H - #define _DT_BINDINGS_INPUT_INPUT_H - --#define KEY_RESERVED 0 --#define KEY_ESC 1 --#define KEY_1 2 --#define KEY_2 3 --#define KEY_3 4 --#define KEY_4 5 --#define KEY_5 6 --#define KEY_6 7 --#define KEY_7 8 --#define KEY_8 9 --#define KEY_9 10 --#define KEY_0 11 --#define KEY_MINUS 12 --#define KEY_EQUAL 13 --#define KEY_BACKSPACE 14 --#define KEY_TAB 15 --#define KEY_Q 16 --#define KEY_W 17 --#define KEY_E 18 --#define KEY_R 19 --#define KEY_T 20 --#define KEY_Y 21 --#define KEY_U 22 --#define KEY_I 23 --#define KEY_O 24 --#define KEY_P 25 --#define KEY_LEFTBRACE 26 --#define KEY_RIGHTBRACE 27 --#define KEY_ENTER 28 --#define KEY_LEFTCTRL 29 --#define KEY_A 30 --#define KEY_S 31 --#define KEY_D 32 --#define KEY_F 33 --#define KEY_G 34 --#define KEY_H 35 --#define KEY_J 36 --#define KEY_K 37 --#define KEY_L 38 --#define KEY_SEMICOLON 39 --#define KEY_APOSTROPHE 40 --#define KEY_GRAVE 41 --#define KEY_LEFTSHIFT 42 --#define KEY_BACKSLASH 43 --#define KEY_Z 44 --#define KEY_X 45 --#define KEY_C 46 --#define KEY_V 47 --#define KEY_B 48 --#define KEY_N 49 --#define KEY_M 50 --#define KEY_COMMA 51 --#define KEY_DOT 52 --#define KEY_SLASH 53 --#define KEY_RIGHTSHIFT 54 --#define KEY_KPASTERISK 55 --#define KEY_LEFTALT 56 --#define KEY_SPACE 57 --#define KEY_CAPSLOCK 58 --#define KEY_F1 59 --#define KEY_F2 60 --#define KEY_F3 61 --#define KEY_F4 62 --#define KEY_F5 63 --#define KEY_F6 64 --#define KEY_F7 65 --#define KEY_F8 66 --#define KEY_F9 67 --#define KEY_F10 68 --#define KEY_NUMLOCK 69 --#define KEY_SCROLLLOCK 70 --#define KEY_KP7 71 --#define KEY_KP8 72 --#define KEY_KP9 73 --#define KEY_KPMINUS 74 --#define KEY_KP4 75 --#define KEY_KP5 76 --#define KEY_KP6 77 --#define KEY_KPPLUS 78 --#define KEY_KP1 79 --#define KEY_KP2 80 --#define KEY_KP3 81 --#define KEY_KP0 82 --#define KEY_KPDOT 83 -- --#define KEY_ZENKAKUHANKAKU 85 --#define KEY_102ND 86 --#define KEY_F11 87 --#define KEY_F12 88 --#define KEY_RO 89 --#define KEY_KATAKANA 90 --#define KEY_HIRAGANA 91 --#define KEY_HENKAN 92 --#define KEY_KATAKANAHIRAGANA 93 --#define KEY_MUHENKAN 94 --#define KEY_KPJPCOMMA 95 --#define KEY_KPENTER 96 --#define KEY_RIGHTCTRL 97 --#define KEY_KPSLASH 98 --#define KEY_SYSRQ 99 --#define KEY_RIGHTALT 100 --#define KEY_LINEFEED 101 --#define KEY_HOME 102 --#define KEY_UP 103 --#define KEY_PAGEUP 104 --#define KEY_LEFT 105 --#define KEY_RIGHT 106 --#define KEY_END 107 --#define KEY_DOWN 108 --#define KEY_PAGEDOWN 109 --#define KEY_INSERT 110 --#define KEY_DELETE 111 --#define KEY_MACRO 112 --#define KEY_MUTE 113 --#define KEY_VOLUMEDOWN 114 --#define KEY_VOLUMEUP 115 --#define KEY_POWER 116 /* SC System Power Down */ --#define KEY_KPEQUAL 117 --#define KEY_KPPLUSMINUS 118 --#define KEY_PAUSE 119 --#define KEY_SCALE 120 /* AL Compiz Scale (Expose) */ -- --#define KEY_KPCOMMA 121 --#define KEY_HANGEUL 122 --#define KEY_HANGUEL KEY_HANGEUL --#define KEY_HANJA 123 --#define KEY_YEN 124 --#define KEY_LEFTMETA 125 --#define KEY_RIGHTMETA 126 --#define KEY_COMPOSE 127 -- --#define KEY_STOP 128 /* AC Stop */ --#define KEY_AGAIN 129 --#define KEY_PROPS 130 /* AC Properties */ --#define KEY_UNDO 131 /* AC Undo */ --#define KEY_FRONT 132 --#define KEY_COPY 133 /* AC Copy */ --#define KEY_OPEN 134 /* AC Open */ --#define KEY_PASTE 135 /* AC Paste */ --#define KEY_FIND 136 /* AC Search */ --#define KEY_CUT 137 /* AC Cut */ --#define KEY_HELP 138 /* AL Integrated Help Center */ --#define KEY_MENU 139 /* Menu (show menu) */ --#define KEY_CALC 140 /* AL Calculator */ --#define KEY_SETUP 141 --#define KEY_SLEEP 142 /* SC System Sleep */ --#define KEY_WAKEUP 143 /* System Wake Up */ --#define KEY_FILE 144 /* AL Local Machine Browser */ --#define KEY_SENDFILE 145 --#define KEY_DELETEFILE 146 --#define KEY_XFER 147 --#define KEY_PROG1 148 --#define KEY_PROG2 149 --#define KEY_WWW 150 /* AL Internet Browser */ --#define KEY_MSDOS 151 --#define KEY_COFFEE 152 /* AL Terminal Lock/Screensaver */ --#define KEY_SCREENLOCK KEY_COFFEE --#define KEY_DIRECTION 153 --#define KEY_CYCLEWINDOWS 154 --#define KEY_MAIL 155 --#define KEY_BOOKMARKS 156 /* AC Bookmarks */ --#define KEY_COMPUTER 157 --#define KEY_BACK 158 /* AC Back */ --#define KEY_FORWARD 159 /* AC Forward */ --#define KEY_CLOSECD 160 --#define KEY_EJECTCD 161 --#define KEY_EJECTCLOSECD 162 --#define KEY_NEXTSONG 163 --#define KEY_PLAYPAUSE 164 --#define KEY_PREVIOUSSONG 165 --#define KEY_STOPCD 166 --#define KEY_RECORD 167 --#define KEY_REWIND 168 --#define KEY_PHONE 169 /* Media Select Telephone */ --#define KEY_ISO 170 --#define KEY_CONFIG 171 /* AL Consumer Control Configuration */ --#define KEY_HOMEPAGE 172 /* AC Home */ --#define KEY_REFRESH 173 /* AC Refresh */ --#define KEY_EXIT 174 /* AC Exit */ --#define KEY_MOVE 175 --#define KEY_EDIT 176 --#define KEY_SCROLLUP 177 --#define KEY_SCROLLDOWN 178 --#define KEY_KPLEFTPAREN 179 --#define KEY_KPRIGHTPAREN 180 --#define KEY_NEW 181 /* AC New */ --#define KEY_REDO 182 /* AC Redo/Repeat */ -- --#define KEY_F13 183 --#define KEY_F14 184 --#define KEY_F15 185 --#define KEY_F16 186 --#define KEY_F17 187 --#define KEY_F18 188 --#define KEY_F19 189 --#define KEY_F20 190 --#define KEY_F21 191 --#define KEY_F22 192 --#define KEY_F23 193 --#define KEY_F24 194 -- --#define KEY_PLAYCD 200 --#define KEY_PAUSECD 201 --#define KEY_PROG3 202 --#define KEY_PROG4 203 --#define KEY_DASHBOARD 204 /* AL Dashboard */ --#define KEY_SUSPEND 205 --#define KEY_CLOSE 206 /* AC Close */ --#define KEY_PLAY 207 --#define KEY_FASTFORWARD 208 --#define KEY_BASSBOOST 209 --#define KEY_PRINT 210 /* AC Print */ --#define KEY_HP 211 --#define KEY_CAMERA 212 --#define KEY_SOUND 213 --#define KEY_QUESTION 214 --#define KEY_EMAIL 215 --#define KEY_CHAT 216 --#define KEY_SEARCH 217 --#define KEY_CONNECT 218 --#define KEY_FINANCE 219 /* AL Checkbook/Finance */ --#define KEY_SPORT 220 --#define KEY_SHOP 221 --#define KEY_ALTERASE 222 --#define KEY_CANCEL 223 /* AC Cancel */ --#define KEY_BRIGHTNESSDOWN 224 --#define KEY_BRIGHTNESSUP 225 --#define KEY_MEDIA 226 -- --#define KEY_SWITCHVIDEOMODE 227 /* Cycle between available video -- outputs (Monitor/LCD/TV-out/etc) */ --#define KEY_KBDILLUMTOGGLE 228 --#define KEY_KBDILLUMDOWN 229 --#define KEY_KBDILLUMUP 230 -- --#define KEY_SEND 231 /* AC Send */ --#define KEY_REPLY 232 /* AC Reply */ --#define KEY_FORWARDMAIL 233 /* AC Forward Msg */ --#define KEY_SAVE 234 /* AC Save */ --#define KEY_DOCUMENTS 235 -- --#define KEY_BATTERY 236 -- --#define KEY_BLUETOOTH 237 --#define KEY_WLAN 238 --#define KEY_UWB 239 -- --#define KEY_UNKNOWN 240 -- --#define KEY_VIDEO_NEXT 241 /* drive next video source */ --#define KEY_VIDEO_PREV 242 /* drive previous video source */ --#define KEY_BRIGHTNESS_CYCLE 243 /* brightness up, after max is min */ --#define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */ --#define KEY_DISPLAY_OFF 245 /* display device to off state */ -- --#define KEY_WIMAX 246 --#define KEY_RFKILL 247 /* Key that controls all radios */ -- --#define KEY_MICMUTE 248 /* Mute / unmute the microphone */ -- --/* Code 255 is reserved for special needs of AT keyboard driver */ -- --#define BTN_MISC 0x100 --#define BTN_0 0x100 --#define BTN_1 0x101 --#define BTN_2 0x102 --#define BTN_3 0x103 --#define BTN_4 0x104 --#define BTN_5 0x105 --#define BTN_6 0x106 --#define BTN_7 0x107 --#define BTN_8 0x108 --#define BTN_9 0x109 -- --#define BTN_MOUSE 0x110 --#define BTN_LEFT 0x110 --#define BTN_RIGHT 0x111 --#define BTN_MIDDLE 0x112 --#define BTN_SIDE 0x113 --#define BTN_EXTRA 0x114 --#define BTN_FORWARD 0x115 --#define BTN_BACK 0x116 --#define BTN_TASK 0x117 -- --#define BTN_JOYSTICK 0x120 --#define BTN_TRIGGER 0x120 --#define BTN_THUMB 0x121 --#define BTN_THUMB2 0x122 --#define BTN_TOP 0x123 --#define BTN_TOP2 0x124 --#define BTN_PINKIE 0x125 --#define BTN_BASE 0x126 --#define BTN_BASE2 0x127 --#define BTN_BASE3 0x128 --#define BTN_BASE4 0x129 --#define BTN_BASE5 0x12a --#define BTN_BASE6 0x12b --#define BTN_DEAD 0x12f -- --#define BTN_GAMEPAD 0x130 --#define BTN_SOUTH 0x130 --#define BTN_A BTN_SOUTH --#define BTN_EAST 0x131 --#define BTN_B BTN_EAST --#define BTN_C 0x132 --#define BTN_NORTH 0x133 --#define BTN_X BTN_NORTH --#define BTN_WEST 0x134 --#define BTN_Y BTN_WEST --#define BTN_Z 0x135 --#define BTN_TL 0x136 --#define BTN_TR 0x137 --#define BTN_TL2 0x138 --#define BTN_TR2 0x139 --#define BTN_SELECT 0x13a --#define BTN_START 0x13b --#define BTN_MODE 0x13c --#define BTN_THUMBL 0x13d --#define BTN_THUMBR 0x13e -- --#define BTN_DIGI 0x140 --#define BTN_TOOL_PEN 0x140 --#define BTN_TOOL_RUBBER 0x141 --#define BTN_TOOL_BRUSH 0x142 --#define BTN_TOOL_PENCIL 0x143 --#define BTN_TOOL_AIRBRUSH 0x144 --#define BTN_TOOL_FINGER 0x145 --#define BTN_TOOL_MOUSE 0x146 --#define BTN_TOOL_LENS 0x147 --#define BTN_TOOL_QUINTTAP 0x148 /* Five fingers on trackpad */ --#define BTN_TOUCH 0x14a --#define BTN_STYLUS 0x14b --#define BTN_STYLUS2 0x14c --#define BTN_TOOL_DOUBLETAP 0x14d --#define BTN_TOOL_TRIPLETAP 0x14e --#define BTN_TOOL_QUADTAP 0x14f /* Four fingers on trackpad */ -- --#define BTN_WHEEL 0x150 --#define BTN_GEAR_DOWN 0x150 --#define BTN_GEAR_UP 0x151 -- --#define KEY_OK 0x160 --#define KEY_SELECT 0x161 --#define KEY_GOTO 0x162 --#define KEY_CLEAR 0x163 --#define KEY_POWER2 0x164 --#define KEY_OPTION 0x165 --#define KEY_INFO 0x166 /* AL OEM Features/Tips/Tutorial */ --#define KEY_TIME 0x167 --#define KEY_VENDOR 0x168 --#define KEY_ARCHIVE 0x169 --#define KEY_PROGRAM 0x16a /* Media Select Program Guide */ --#define KEY_CHANNEL 0x16b --#define KEY_FAVORITES 0x16c --#define KEY_EPG 0x16d --#define KEY_PVR 0x16e /* Media Select Home */ --#define KEY_MHP 0x16f --#define KEY_LANGUAGE 0x170 --#define KEY_TITLE 0x171 --#define KEY_SUBTITLE 0x172 --#define KEY_ANGLE 0x173 --#define KEY_ZOOM 0x174 --#define KEY_MODE 0x175 --#define KEY_KEYBOARD 0x176 --#define KEY_SCREEN 0x177 --#define KEY_PC 0x178 /* Media Select Computer */ --#define KEY_TV 0x179 /* Media Select TV */ --#define KEY_TV2 0x17a /* Media Select Cable */ --#define KEY_VCR 0x17b /* Media Select VCR */ --#define KEY_VCR2 0x17c /* VCR Plus */ --#define KEY_SAT 0x17d /* Media Select Satellite */ --#define KEY_SAT2 0x17e --#define KEY_CD 0x17f /* Media Select CD */ --#define KEY_TAPE 0x180 /* Media Select Tape */ --#define KEY_RADIO 0x181 --#define KEY_TUNER 0x182 /* Media Select Tuner */ --#define KEY_PLAYER 0x183 --#define KEY_TEXT 0x184 --#define KEY_DVD 0x185 /* Media Select DVD */ --#define KEY_AUX 0x186 --#define KEY_MP3 0x187 --#define KEY_AUDIO 0x188 /* AL Audio Browser */ --#define KEY_VIDEO 0x189 /* AL Movie Browser */ --#define KEY_DIRECTORY 0x18a --#define KEY_LIST 0x18b --#define KEY_MEMO 0x18c /* Media Select Messages */ --#define KEY_CALENDAR 0x18d --#define KEY_RED 0x18e --#define KEY_GREEN 0x18f --#define KEY_YELLOW 0x190 --#define KEY_BLUE 0x191 --#define KEY_CHANNELUP 0x192 /* Channel Increment */ --#define KEY_CHANNELDOWN 0x193 /* Channel Decrement */ --#define KEY_FIRST 0x194 --#define KEY_LAST 0x195 /* Recall Last */ --#define KEY_AB 0x196 --#define KEY_NEXT 0x197 --#define KEY_RESTART 0x198 --#define KEY_SLOW 0x199 --#define KEY_SHUFFLE 0x19a --#define KEY_BREAK 0x19b --#define KEY_PREVIOUS 0x19c --#define KEY_DIGITS 0x19d --#define KEY_TEEN 0x19e --#define KEY_TWEN 0x19f --#define KEY_VIDEOPHONE 0x1a0 /* Media Select Video Phone */ --#define KEY_GAMES 0x1a1 /* Media Select Games */ --#define KEY_ZOOMIN 0x1a2 /* AC Zoom In */ --#define KEY_ZOOMOUT 0x1a3 /* AC Zoom Out */ --#define KEY_ZOOMRESET 0x1a4 /* AC Zoom */ --#define KEY_WORDPROCESSOR 0x1a5 /* AL Word Processor */ --#define KEY_EDITOR 0x1a6 /* AL Text Editor */ --#define KEY_SPREADSHEET 0x1a7 /* AL Spreadsheet */ --#define KEY_GRAPHICSEDITOR 0x1a8 /* AL Graphics Editor */ --#define KEY_PRESENTATION 0x1a9 /* AL Presentation App */ --#define KEY_DATABASE 0x1aa /* AL Database App */ --#define KEY_NEWS 0x1ab /* AL Newsreader */ --#define KEY_VOICEMAIL 0x1ac /* AL Voicemail */ --#define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */ --#define KEY_MESSENGER 0x1ae /* AL Instant Messaging */ --#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */ --#define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */ --#define KEY_LOGOFF 0x1b1 /* AL Logoff */ -- --#define KEY_DOLLAR 0x1b2 --#define KEY_EURO 0x1b3 -- --#define KEY_FRAMEBACK 0x1b4 /* Consumer - transport controls */ --#define KEY_FRAMEFORWARD 0x1b5 --#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */ --#define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */ --#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */ --#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */ --#define KEY_IMAGES 0x1ba /* AL Image Browser */ -- --#define KEY_DEL_EOL 0x1c0 --#define KEY_DEL_EOS 0x1c1 --#define KEY_INS_LINE 0x1c2 --#define KEY_DEL_LINE 0x1c3 -- --#define KEY_FN 0x1d0 --#define KEY_FN_ESC 0x1d1 --#define KEY_FN_F1 0x1d2 --#define KEY_FN_F2 0x1d3 --#define KEY_FN_F3 0x1d4 --#define KEY_FN_F4 0x1d5 --#define KEY_FN_F5 0x1d6 --#define KEY_FN_F6 0x1d7 --#define KEY_FN_F7 0x1d8 --#define KEY_FN_F8 0x1d9 --#define KEY_FN_F9 0x1da --#define KEY_FN_F10 0x1db --#define KEY_FN_F11 0x1dc --#define KEY_FN_F12 0x1dd --#define KEY_FN_1 0x1de --#define KEY_FN_2 0x1df --#define KEY_FN_D 0x1e0 --#define KEY_FN_E 0x1e1 --#define KEY_FN_F 0x1e2 --#define KEY_FN_S 0x1e3 --#define KEY_FN_B 0x1e4 -- --#define KEY_BRL_DOT1 0x1f1 --#define KEY_BRL_DOT2 0x1f2 --#define KEY_BRL_DOT3 0x1f3 --#define KEY_BRL_DOT4 0x1f4 --#define KEY_BRL_DOT5 0x1f5 --#define KEY_BRL_DOT6 0x1f6 --#define KEY_BRL_DOT7 0x1f7 --#define KEY_BRL_DOT8 0x1f8 --#define KEY_BRL_DOT9 0x1f9 --#define KEY_BRL_DOT10 0x1fa -- --#define KEY_NUMERIC_0 0x200 /* used by phones, remote controls, */ --#define KEY_NUMERIC_1 0x201 /* and other keypads */ --#define KEY_NUMERIC_2 0x202 --#define KEY_NUMERIC_3 0x203 --#define KEY_NUMERIC_4 0x204 --#define KEY_NUMERIC_5 0x205 --#define KEY_NUMERIC_6 0x206 --#define KEY_NUMERIC_7 0x207 --#define KEY_NUMERIC_8 0x208 --#define KEY_NUMERIC_9 0x209 --#define KEY_NUMERIC_STAR 0x20a --#define KEY_NUMERIC_POUND 0x20b -- --#define KEY_CAMERA_FOCUS 0x210 --#define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */ -- --#define KEY_TOUCHPAD_TOGGLE 0x212 /* Request switch touchpad on or off */ --#define KEY_TOUCHPAD_ON 0x213 --#define KEY_TOUCHPAD_OFF 0x214 -- --#define KEY_CAMERA_ZOOMIN 0x215 --#define KEY_CAMERA_ZOOMOUT 0x216 --#define KEY_CAMERA_UP 0x217 --#define KEY_CAMERA_DOWN 0x218 --#define KEY_CAMERA_LEFT 0x219 --#define KEY_CAMERA_RIGHT 0x21a -- --#define KEY_ATTENDANT_ON 0x21b --#define KEY_ATTENDANT_OFF 0x21c --#define KEY_ATTENDANT_TOGGLE 0x21d /* Attendant call on or off */ --#define KEY_LIGHTS_TOGGLE 0x21e /* Reading light on or off */ -- --#define BTN_DPAD_UP 0x220 --#define BTN_DPAD_DOWN 0x221 --#define BTN_DPAD_LEFT 0x222 --#define BTN_DPAD_RIGHT 0x223 -+#include "linux-event-codes.h" - - #define MATRIX_KEY(row, col, code) \ - ((((row) & 0xFF) << 24) | (((col) & 0xFF) << 16) | ((code) & 0xFFFF)) ---- /dev/null -+++ b/include/dt-bindings/input/linux-event-codes.h -@@ -0,0 +1,805 @@ -+/* -+ * Input event codes -+ * -+ * *** IMPORTANT *** -+ * This file is not only included from C-code but also from devicetree source -+ * files. As such this file MUST only contain comments and defines. -+ * -+ * Copyright (c) 1999-2002 Vojtech Pavlik -+ * Copyright (c) 2015 Hans de Goede -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 as published by -+ * the Free Software Foundation. -+ */ -+#ifndef _UAPI_INPUT_EVENT_CODES_H -+#define _UAPI_INPUT_EVENT_CODES_H -+ -+/* -+ * Device properties and quirks -+ */ -+ -+#define INPUT_PROP_POINTER 0x00 /* needs a pointer */ -+#define INPUT_PROP_DIRECT 0x01 /* direct input devices */ -+#define INPUT_PROP_BUTTONPAD 0x02 /* has button(s) under pad */ -+#define INPUT_PROP_SEMI_MT 0x03 /* touch rectangle only */ -+#define INPUT_PROP_TOPBUTTONPAD 0x04 /* softbuttons at top of pad */ -+#define INPUT_PROP_POINTING_STICK 0x05 /* is a pointing stick */ -+#define INPUT_PROP_ACCELEROMETER 0x06 /* has accelerometer */ -+ -+#define INPUT_PROP_MAX 0x1f -+#define INPUT_PROP_CNT (INPUT_PROP_MAX + 1) -+ -+/* -+ * Event types -+ */ -+ -+#define EV_SYN 0x00 -+#define EV_KEY 0x01 -+#define EV_REL 0x02 -+#define EV_ABS 0x03 -+#define EV_MSC 0x04 -+#define EV_SW 0x05 -+#define EV_LED 0x11 -+#define EV_SND 0x12 -+#define EV_REP 0x14 -+#define EV_FF 0x15 -+#define EV_PWR 0x16 -+#define EV_FF_STATUS 0x17 -+#define EV_MAX 0x1f -+#define EV_CNT (EV_MAX+1) -+ -+/* -+ * Synchronization events. -+ */ -+ -+#define SYN_REPORT 0 -+#define SYN_CONFIG 1 -+#define SYN_MT_REPORT 2 -+#define SYN_DROPPED 3 -+#define SYN_MAX 0xf -+#define SYN_CNT (SYN_MAX+1) -+ -+/* -+ * Keys and buttons -+ * -+ * Most of the keys/buttons are modeled after USB HUT 1.12 -+ * (see http://www.usb.org/developers/hidpage). -+ * Abbreviations in the comments: -+ * AC - Application Control -+ * AL - Application Launch Button -+ * SC - System Control -+ */ -+ -+#define KEY_RESERVED 0 -+#define KEY_ESC 1 -+#define KEY_1 2 -+#define KEY_2 3 -+#define KEY_3 4 -+#define KEY_4 5 -+#define KEY_5 6 -+#define KEY_6 7 -+#define KEY_7 8 -+#define KEY_8 9 -+#define KEY_9 10 -+#define KEY_0 11 -+#define KEY_MINUS 12 -+#define KEY_EQUAL 13 -+#define KEY_BACKSPACE 14 -+#define KEY_TAB 15 -+#define KEY_Q 16 -+#define KEY_W 17 -+#define KEY_E 18 -+#define KEY_R 19 -+#define KEY_T 20 -+#define KEY_Y 21 -+#define KEY_U 22 -+#define KEY_I 23 -+#define KEY_O 24 -+#define KEY_P 25 -+#define KEY_LEFTBRACE 26 -+#define KEY_RIGHTBRACE 27 -+#define KEY_ENTER 28 -+#define KEY_LEFTCTRL 29 -+#define KEY_A 30 -+#define KEY_S 31 -+#define KEY_D 32 -+#define KEY_F 33 -+#define KEY_G 34 -+#define KEY_H 35 -+#define KEY_J 36 -+#define KEY_K 37 -+#define KEY_L 38 -+#define KEY_SEMICOLON 39 -+#define KEY_APOSTROPHE 40 -+#define KEY_GRAVE 41 -+#define KEY_LEFTSHIFT 42 -+#define KEY_BACKSLASH 43 -+#define KEY_Z 44 -+#define KEY_X 45 -+#define KEY_C 46 -+#define KEY_V 47 -+#define KEY_B 48 -+#define KEY_N 49 -+#define KEY_M 50 -+#define KEY_COMMA 51 -+#define KEY_DOT 52 -+#define KEY_SLASH 53 -+#define KEY_RIGHTSHIFT 54 -+#define KEY_KPASTERISK 55 -+#define KEY_LEFTALT 56 -+#define KEY_SPACE 57 -+#define KEY_CAPSLOCK 58 -+#define KEY_F1 59 -+#define KEY_F2 60 -+#define KEY_F3 61 -+#define KEY_F4 62 -+#define KEY_F5 63 -+#define KEY_F6 64 -+#define KEY_F7 65 -+#define KEY_F8 66 -+#define KEY_F9 67 -+#define KEY_F10 68 -+#define KEY_NUMLOCK 69 -+#define KEY_SCROLLLOCK 70 -+#define KEY_KP7 71 -+#define KEY_KP8 72 -+#define KEY_KP9 73 -+#define KEY_KPMINUS 74 -+#define KEY_KP4 75 -+#define KEY_KP5 76 -+#define KEY_KP6 77 -+#define KEY_KPPLUS 78 -+#define KEY_KP1 79 -+#define KEY_KP2 80 -+#define KEY_KP3 81 -+#define KEY_KP0 82 -+#define KEY_KPDOT 83 -+ -+#define KEY_ZENKAKUHANKAKU 85 -+#define KEY_102ND 86 -+#define KEY_F11 87 -+#define KEY_F12 88 -+#define KEY_RO 89 -+#define KEY_KATAKANA 90 -+#define KEY_HIRAGANA 91 -+#define KEY_HENKAN 92 -+#define KEY_KATAKANAHIRAGANA 93 -+#define KEY_MUHENKAN 94 -+#define KEY_KPJPCOMMA 95 -+#define KEY_KPENTER 96 -+#define KEY_RIGHTCTRL 97 -+#define KEY_KPSLASH 98 -+#define KEY_SYSRQ 99 -+#define KEY_RIGHTALT 100 -+#define KEY_LINEFEED 101 -+#define KEY_HOME 102 -+#define KEY_UP 103 -+#define KEY_PAGEUP 104 -+#define KEY_LEFT 105 -+#define KEY_RIGHT 106 -+#define KEY_END 107 -+#define KEY_DOWN 108 -+#define KEY_PAGEDOWN 109 -+#define KEY_INSERT 110 -+#define KEY_DELETE 111 -+#define KEY_MACRO 112 -+#define KEY_MUTE 113 -+#define KEY_VOLUMEDOWN 114 -+#define KEY_VOLUMEUP 115 -+#define KEY_POWER 116 /* SC System Power Down */ -+#define KEY_KPEQUAL 117 -+#define KEY_KPPLUSMINUS 118 -+#define KEY_PAUSE 119 -+#define KEY_SCALE 120 /* AL Compiz Scale (Expose) */ -+ -+#define KEY_KPCOMMA 121 -+#define KEY_HANGEUL 122 -+#define KEY_HANGUEL KEY_HANGEUL -+#define KEY_HANJA 123 -+#define KEY_YEN 124 -+#define KEY_LEFTMETA 125 -+#define KEY_RIGHTMETA 126 -+#define KEY_COMPOSE 127 -+ -+#define KEY_STOP 128 /* AC Stop */ -+#define KEY_AGAIN 129 -+#define KEY_PROPS 130 /* AC Properties */ -+#define KEY_UNDO 131 /* AC Undo */ -+#define KEY_FRONT 132 -+#define KEY_COPY 133 /* AC Copy */ -+#define KEY_OPEN 134 /* AC Open */ -+#define KEY_PASTE 135 /* AC Paste */ -+#define KEY_FIND 136 /* AC Search */ -+#define KEY_CUT 137 /* AC Cut */ -+#define KEY_HELP 138 /* AL Integrated Help Center */ -+#define KEY_MENU 139 /* Menu (show menu) */ -+#define KEY_CALC 140 /* AL Calculator */ -+#define KEY_SETUP 141 -+#define KEY_SLEEP 142 /* SC System Sleep */ -+#define KEY_WAKEUP 143 /* System Wake Up */ -+#define KEY_FILE 144 /* AL Local Machine Browser */ -+#define KEY_SENDFILE 145 -+#define KEY_DELETEFILE 146 -+#define KEY_XFER 147 -+#define KEY_PROG1 148 -+#define KEY_PROG2 149 -+#define KEY_WWW 150 /* AL Internet Browser */ -+#define KEY_MSDOS 151 -+#define KEY_COFFEE 152 /* AL Terminal Lock/Screensaver */ -+#define KEY_SCREENLOCK KEY_COFFEE -+#define KEY_ROTATE_DISPLAY 153 /* Display orientation for e.g. tablets */ -+#define KEY_DIRECTION KEY_ROTATE_DISPLAY -+#define KEY_CYCLEWINDOWS 154 -+#define KEY_MAIL 155 -+#define KEY_BOOKMARKS 156 /* AC Bookmarks */ -+#define KEY_COMPUTER 157 -+#define KEY_BACK 158 /* AC Back */ -+#define KEY_FORWARD 159 /* AC Forward */ -+#define KEY_CLOSECD 160 -+#define KEY_EJECTCD 161 -+#define KEY_EJECTCLOSECD 162 -+#define KEY_NEXTSONG 163 -+#define KEY_PLAYPAUSE 164 -+#define KEY_PREVIOUSSONG 165 -+#define KEY_STOPCD 166 -+#define KEY_RECORD 167 -+#define KEY_REWIND 168 -+#define KEY_PHONE 169 /* Media Select Telephone */ -+#define KEY_ISO 170 -+#define KEY_CONFIG 171 /* AL Consumer Control Configuration */ -+#define KEY_HOMEPAGE 172 /* AC Home */ -+#define KEY_REFRESH 173 /* AC Refresh */ -+#define KEY_EXIT 174 /* AC Exit */ -+#define KEY_MOVE 175 -+#define KEY_EDIT 176 -+#define KEY_SCROLLUP 177 -+#define KEY_SCROLLDOWN 178 -+#define KEY_KPLEFTPAREN 179 -+#define KEY_KPRIGHTPAREN 180 -+#define KEY_NEW 181 /* AC New */ -+#define KEY_REDO 182 /* AC Redo/Repeat */ -+ -+#define KEY_F13 183 -+#define KEY_F14 184 -+#define KEY_F15 185 -+#define KEY_F16 186 -+#define KEY_F17 187 -+#define KEY_F18 188 -+#define KEY_F19 189 -+#define KEY_F20 190 -+#define KEY_F21 191 -+#define KEY_F22 192 -+#define KEY_F23 193 -+#define KEY_F24 194 -+ -+#define KEY_PLAYCD 200 -+#define KEY_PAUSECD 201 -+#define KEY_PROG3 202 -+#define KEY_PROG4 203 -+#define KEY_DASHBOARD 204 /* AL Dashboard */ -+#define KEY_SUSPEND 205 -+#define KEY_CLOSE 206 /* AC Close */ -+#define KEY_PLAY 207 -+#define KEY_FASTFORWARD 208 -+#define KEY_BASSBOOST 209 -+#define KEY_PRINT 210 /* AC Print */ -+#define KEY_HP 211 -+#define KEY_CAMERA 212 -+#define KEY_SOUND 213 -+#define KEY_QUESTION 214 -+#define KEY_EMAIL 215 -+#define KEY_CHAT 216 -+#define KEY_SEARCH 217 -+#define KEY_CONNECT 218 -+#define KEY_FINANCE 219 /* AL Checkbook/Finance */ -+#define KEY_SPORT 220 -+#define KEY_SHOP 221 -+#define KEY_ALTERASE 222 -+#define KEY_CANCEL 223 /* AC Cancel */ -+#define KEY_BRIGHTNESSDOWN 224 -+#define KEY_BRIGHTNESSUP 225 -+#define KEY_MEDIA 226 -+ -+#define KEY_SWITCHVIDEOMODE 227 /* Cycle between available video -+ outputs (Monitor/LCD/TV-out/etc) */ -+#define KEY_KBDILLUMTOGGLE 228 -+#define KEY_KBDILLUMDOWN 229 -+#define KEY_KBDILLUMUP 230 -+ -+#define KEY_SEND 231 /* AC Send */ -+#define KEY_REPLY 232 /* AC Reply */ -+#define KEY_FORWARDMAIL 233 /* AC Forward Msg */ -+#define KEY_SAVE 234 /* AC Save */ -+#define KEY_DOCUMENTS 235 -+ -+#define KEY_BATTERY 236 -+ -+#define KEY_BLUETOOTH 237 -+#define KEY_WLAN 238 -+#define KEY_UWB 239 -+ -+#define KEY_UNKNOWN 240 -+ -+#define KEY_VIDEO_NEXT 241 /* drive next video source */ -+#define KEY_VIDEO_PREV 242 /* drive previous video source */ -+#define KEY_BRIGHTNESS_CYCLE 243 /* brightness up, after max is min */ -+#define KEY_BRIGHTNESS_AUTO 244 /* Set Auto Brightness: manual -+ brightness control is off, -+ rely on ambient */ -+#define KEY_BRIGHTNESS_ZERO KEY_BRIGHTNESS_AUTO -+#define KEY_DISPLAY_OFF 245 /* display device to off state */ -+ -+#define KEY_WWAN 246 /* Wireless WAN (LTE, UMTS, GSM, etc.) */ -+#define KEY_WIMAX KEY_WWAN -+#define KEY_RFKILL 247 /* Key that controls all radios */ -+ -+#define KEY_MICMUTE 248 /* Mute / unmute the microphone */ -+ -+/* Code 255 is reserved for special needs of AT keyboard driver */ -+ -+#define BTN_MISC 0x100 -+#define BTN_0 0x100 -+#define BTN_1 0x101 -+#define BTN_2 0x102 -+#define BTN_3 0x103 -+#define BTN_4 0x104 -+#define BTN_5 0x105 -+#define BTN_6 0x106 -+#define BTN_7 0x107 -+#define BTN_8 0x108 -+#define BTN_9 0x109 -+ -+#define BTN_MOUSE 0x110 -+#define BTN_LEFT 0x110 -+#define BTN_RIGHT 0x111 -+#define BTN_MIDDLE 0x112 -+#define BTN_SIDE 0x113 -+#define BTN_EXTRA 0x114 -+#define BTN_FORWARD 0x115 -+#define BTN_BACK 0x116 -+#define BTN_TASK 0x117 -+ -+#define BTN_JOYSTICK 0x120 -+#define BTN_TRIGGER 0x120 -+#define BTN_THUMB 0x121 -+#define BTN_THUMB2 0x122 -+#define BTN_TOP 0x123 -+#define BTN_TOP2 0x124 -+#define BTN_PINKIE 0x125 -+#define BTN_BASE 0x126 -+#define BTN_BASE2 0x127 -+#define BTN_BASE3 0x128 -+#define BTN_BASE4 0x129 -+#define BTN_BASE5 0x12a -+#define BTN_BASE6 0x12b -+#define BTN_DEAD 0x12f -+ -+#define BTN_GAMEPAD 0x130 -+#define BTN_SOUTH 0x130 -+#define BTN_A BTN_SOUTH -+#define BTN_EAST 0x131 -+#define BTN_B BTN_EAST -+#define BTN_C 0x132 -+#define BTN_NORTH 0x133 -+#define BTN_X BTN_NORTH -+#define BTN_WEST 0x134 -+#define BTN_Y BTN_WEST -+#define BTN_Z 0x135 -+#define BTN_TL 0x136 -+#define BTN_TR 0x137 -+#define BTN_TL2 0x138 -+#define BTN_TR2 0x139 -+#define BTN_SELECT 0x13a -+#define BTN_START 0x13b -+#define BTN_MODE 0x13c -+#define BTN_THUMBL 0x13d -+#define BTN_THUMBR 0x13e -+ -+#define BTN_DIGI 0x140 -+#define BTN_TOOL_PEN 0x140 -+#define BTN_TOOL_RUBBER 0x141 -+#define BTN_TOOL_BRUSH 0x142 -+#define BTN_TOOL_PENCIL 0x143 -+#define BTN_TOOL_AIRBRUSH 0x144 -+#define BTN_TOOL_FINGER 0x145 -+#define BTN_TOOL_MOUSE 0x146 -+#define BTN_TOOL_LENS 0x147 -+#define BTN_TOOL_QUINTTAP 0x148 /* Five fingers on trackpad */ -+#define BTN_TOUCH 0x14a -+#define BTN_STYLUS 0x14b -+#define BTN_STYLUS2 0x14c -+#define BTN_TOOL_DOUBLETAP 0x14d -+#define BTN_TOOL_TRIPLETAP 0x14e -+#define BTN_TOOL_QUADTAP 0x14f /* Four fingers on trackpad */ -+ -+#define BTN_WHEEL 0x150 -+#define BTN_GEAR_DOWN 0x150 -+#define BTN_GEAR_UP 0x151 -+ -+#define KEY_OK 0x160 -+#define KEY_SELECT 0x161 -+#define KEY_GOTO 0x162 -+#define KEY_CLEAR 0x163 -+#define KEY_POWER2 0x164 -+#define KEY_OPTION 0x165 -+#define KEY_INFO 0x166 /* AL OEM Features/Tips/Tutorial */ -+#define KEY_TIME 0x167 -+#define KEY_VENDOR 0x168 -+#define KEY_ARCHIVE 0x169 -+#define KEY_PROGRAM 0x16a /* Media Select Program Guide */ -+#define KEY_CHANNEL 0x16b -+#define KEY_FAVORITES 0x16c -+#define KEY_EPG 0x16d -+#define KEY_PVR 0x16e /* Media Select Home */ -+#define KEY_MHP 0x16f -+#define KEY_LANGUAGE 0x170 -+#define KEY_TITLE 0x171 -+#define KEY_SUBTITLE 0x172 -+#define KEY_ANGLE 0x173 -+#define KEY_ZOOM 0x174 -+#define KEY_MODE 0x175 -+#define KEY_KEYBOARD 0x176 -+#define KEY_SCREEN 0x177 -+#define KEY_PC 0x178 /* Media Select Computer */ -+#define KEY_TV 0x179 /* Media Select TV */ -+#define KEY_TV2 0x17a /* Media Select Cable */ -+#define KEY_VCR 0x17b /* Media Select VCR */ -+#define KEY_VCR2 0x17c /* VCR Plus */ -+#define KEY_SAT 0x17d /* Media Select Satellite */ -+#define KEY_SAT2 0x17e -+#define KEY_CD 0x17f /* Media Select CD */ -+#define KEY_TAPE 0x180 /* Media Select Tape */ -+#define KEY_RADIO 0x181 -+#define KEY_TUNER 0x182 /* Media Select Tuner */ -+#define KEY_PLAYER 0x183 -+#define KEY_TEXT 0x184 -+#define KEY_DVD 0x185 /* Media Select DVD */ -+#define KEY_AUX 0x186 -+#define KEY_MP3 0x187 -+#define KEY_AUDIO 0x188 /* AL Audio Browser */ -+#define KEY_VIDEO 0x189 /* AL Movie Browser */ -+#define KEY_DIRECTORY 0x18a -+#define KEY_LIST 0x18b -+#define KEY_MEMO 0x18c /* Media Select Messages */ -+#define KEY_CALENDAR 0x18d -+#define KEY_RED 0x18e -+#define KEY_GREEN 0x18f -+#define KEY_YELLOW 0x190 -+#define KEY_BLUE 0x191 -+#define KEY_CHANNELUP 0x192 /* Channel Increment */ -+#define KEY_CHANNELDOWN 0x193 /* Channel Decrement */ -+#define KEY_FIRST 0x194 -+#define KEY_LAST 0x195 /* Recall Last */ -+#define KEY_AB 0x196 -+#define KEY_NEXT 0x197 -+#define KEY_RESTART 0x198 -+#define KEY_SLOW 0x199 -+#define KEY_SHUFFLE 0x19a -+#define KEY_BREAK 0x19b -+#define KEY_PREVIOUS 0x19c -+#define KEY_DIGITS 0x19d -+#define KEY_TEEN 0x19e -+#define KEY_TWEN 0x19f -+#define KEY_VIDEOPHONE 0x1a0 /* Media Select Video Phone */ -+#define KEY_GAMES 0x1a1 /* Media Select Games */ -+#define KEY_ZOOMIN 0x1a2 /* AC Zoom In */ -+#define KEY_ZOOMOUT 0x1a3 /* AC Zoom Out */ -+#define KEY_ZOOMRESET 0x1a4 /* AC Zoom */ -+#define KEY_WORDPROCESSOR 0x1a5 /* AL Word Processor */ -+#define KEY_EDITOR 0x1a6 /* AL Text Editor */ -+#define KEY_SPREADSHEET 0x1a7 /* AL Spreadsheet */ -+#define KEY_GRAPHICSEDITOR 0x1a8 /* AL Graphics Editor */ -+#define KEY_PRESENTATION 0x1a9 /* AL Presentation App */ -+#define KEY_DATABASE 0x1aa /* AL Database App */ -+#define KEY_NEWS 0x1ab /* AL Newsreader */ -+#define KEY_VOICEMAIL 0x1ac /* AL Voicemail */ -+#define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */ -+#define KEY_MESSENGER 0x1ae /* AL Instant Messaging */ -+#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */ -+#define KEY_BRIGHTNESS_TOGGLE KEY_DISPLAYTOGGLE -+#define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */ -+#define KEY_LOGOFF 0x1b1 /* AL Logoff */ -+ -+#define KEY_DOLLAR 0x1b2 -+#define KEY_EURO 0x1b3 -+ -+#define KEY_FRAMEBACK 0x1b4 /* Consumer - transport controls */ -+#define KEY_FRAMEFORWARD 0x1b5 -+#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */ -+#define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */ -+#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */ -+#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */ -+#define KEY_IMAGES 0x1ba /* AL Image Browser */ -+ -+#define KEY_DEL_EOL 0x1c0 -+#define KEY_DEL_EOS 0x1c1 -+#define KEY_INS_LINE 0x1c2 -+#define KEY_DEL_LINE 0x1c3 -+ -+#define KEY_FN 0x1d0 -+#define KEY_FN_ESC 0x1d1 -+#define KEY_FN_F1 0x1d2 -+#define KEY_FN_F2 0x1d3 -+#define KEY_FN_F3 0x1d4 -+#define KEY_FN_F4 0x1d5 -+#define KEY_FN_F5 0x1d6 -+#define KEY_FN_F6 0x1d7 -+#define KEY_FN_F7 0x1d8 -+#define KEY_FN_F8 0x1d9 -+#define KEY_FN_F9 0x1da -+#define KEY_FN_F10 0x1db -+#define KEY_FN_F11 0x1dc -+#define KEY_FN_F12 0x1dd -+#define KEY_FN_1 0x1de -+#define KEY_FN_2 0x1df -+#define KEY_FN_D 0x1e0 -+#define KEY_FN_E 0x1e1 -+#define KEY_FN_F 0x1e2 -+#define KEY_FN_S 0x1e3 -+#define KEY_FN_B 0x1e4 -+ -+#define KEY_BRL_DOT1 0x1f1 -+#define KEY_BRL_DOT2 0x1f2 -+#define KEY_BRL_DOT3 0x1f3 -+#define KEY_BRL_DOT4 0x1f4 -+#define KEY_BRL_DOT5 0x1f5 -+#define KEY_BRL_DOT6 0x1f6 -+#define KEY_BRL_DOT7 0x1f7 -+#define KEY_BRL_DOT8 0x1f8 -+#define KEY_BRL_DOT9 0x1f9 -+#define KEY_BRL_DOT10 0x1fa -+ -+#define KEY_NUMERIC_0 0x200 /* used by phones, remote controls, */ -+#define KEY_NUMERIC_1 0x201 /* and other keypads */ -+#define KEY_NUMERIC_2 0x202 -+#define KEY_NUMERIC_3 0x203 -+#define KEY_NUMERIC_4 0x204 -+#define KEY_NUMERIC_5 0x205 -+#define KEY_NUMERIC_6 0x206 -+#define KEY_NUMERIC_7 0x207 -+#define KEY_NUMERIC_8 0x208 -+#define KEY_NUMERIC_9 0x209 -+#define KEY_NUMERIC_STAR 0x20a -+#define KEY_NUMERIC_POUND 0x20b -+#define KEY_NUMERIC_A 0x20c /* Phone key A - HUT Telephony 0xb9 */ -+#define KEY_NUMERIC_B 0x20d -+#define KEY_NUMERIC_C 0x20e -+#define KEY_NUMERIC_D 0x20f -+ -+#define KEY_CAMERA_FOCUS 0x210 -+#define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */ -+ -+#define KEY_TOUCHPAD_TOGGLE 0x212 /* Request switch touchpad on or off */ -+#define KEY_TOUCHPAD_ON 0x213 -+#define KEY_TOUCHPAD_OFF 0x214 -+ -+#define KEY_CAMERA_ZOOMIN 0x215 -+#define KEY_CAMERA_ZOOMOUT 0x216 -+#define KEY_CAMERA_UP 0x217 -+#define KEY_CAMERA_DOWN 0x218 -+#define KEY_CAMERA_LEFT 0x219 -+#define KEY_CAMERA_RIGHT 0x21a -+ -+#define KEY_ATTENDANT_ON 0x21b -+#define KEY_ATTENDANT_OFF 0x21c -+#define KEY_ATTENDANT_TOGGLE 0x21d /* Attendant call on or off */ -+#define KEY_LIGHTS_TOGGLE 0x21e /* Reading light on or off */ -+ -+#define BTN_DPAD_UP 0x220 -+#define BTN_DPAD_DOWN 0x221 -+#define BTN_DPAD_LEFT 0x222 -+#define BTN_DPAD_RIGHT 0x223 -+ -+#define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */ -+ -+#define KEY_BUTTONCONFIG 0x240 /* AL Button Configuration */ -+#define KEY_TASKMANAGER 0x241 /* AL Task/Project Manager */ -+#define KEY_JOURNAL 0x242 /* AL Log/Journal/Timecard */ -+#define KEY_CONTROLPANEL 0x243 /* AL Control Panel */ -+#define KEY_APPSELECT 0x244 /* AL Select Task/Application */ -+#define KEY_SCREENSAVER 0x245 /* AL Screen Saver */ -+#define KEY_VOICECOMMAND 0x246 /* Listening Voice Command */ -+ -+#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ -+#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */ -+ -+#define KEY_KBDINPUTASSIST_PREV 0x260 -+#define KEY_KBDINPUTASSIST_NEXT 0x261 -+#define KEY_KBDINPUTASSIST_PREVGROUP 0x262 -+#define KEY_KBDINPUTASSIST_NEXTGROUP 0x263 -+#define KEY_KBDINPUTASSIST_ACCEPT 0x264 -+#define KEY_KBDINPUTASSIST_CANCEL 0x265 -+ -+#define BTN_TRIGGER_HAPPY 0x2c0 -+#define BTN_TRIGGER_HAPPY1 0x2c0 -+#define BTN_TRIGGER_HAPPY2 0x2c1 -+#define BTN_TRIGGER_HAPPY3 0x2c2 -+#define BTN_TRIGGER_HAPPY4 0x2c3 -+#define BTN_TRIGGER_HAPPY5 0x2c4 -+#define BTN_TRIGGER_HAPPY6 0x2c5 -+#define BTN_TRIGGER_HAPPY7 0x2c6 -+#define BTN_TRIGGER_HAPPY8 0x2c7 -+#define BTN_TRIGGER_HAPPY9 0x2c8 -+#define BTN_TRIGGER_HAPPY10 0x2c9 -+#define BTN_TRIGGER_HAPPY11 0x2ca -+#define BTN_TRIGGER_HAPPY12 0x2cb -+#define BTN_TRIGGER_HAPPY13 0x2cc -+#define BTN_TRIGGER_HAPPY14 0x2cd -+#define BTN_TRIGGER_HAPPY15 0x2ce -+#define BTN_TRIGGER_HAPPY16 0x2cf -+#define BTN_TRIGGER_HAPPY17 0x2d0 -+#define BTN_TRIGGER_HAPPY18 0x2d1 -+#define BTN_TRIGGER_HAPPY19 0x2d2 -+#define BTN_TRIGGER_HAPPY20 0x2d3 -+#define BTN_TRIGGER_HAPPY21 0x2d4 -+#define BTN_TRIGGER_HAPPY22 0x2d5 -+#define BTN_TRIGGER_HAPPY23 0x2d6 -+#define BTN_TRIGGER_HAPPY24 0x2d7 -+#define BTN_TRIGGER_HAPPY25 0x2d8 -+#define BTN_TRIGGER_HAPPY26 0x2d9 -+#define BTN_TRIGGER_HAPPY27 0x2da -+#define BTN_TRIGGER_HAPPY28 0x2db -+#define BTN_TRIGGER_HAPPY29 0x2dc -+#define BTN_TRIGGER_HAPPY30 0x2dd -+#define BTN_TRIGGER_HAPPY31 0x2de -+#define BTN_TRIGGER_HAPPY32 0x2df -+#define BTN_TRIGGER_HAPPY33 0x2e0 -+#define BTN_TRIGGER_HAPPY34 0x2e1 -+#define BTN_TRIGGER_HAPPY35 0x2e2 -+#define BTN_TRIGGER_HAPPY36 0x2e3 -+#define BTN_TRIGGER_HAPPY37 0x2e4 -+#define BTN_TRIGGER_HAPPY38 0x2e5 -+#define BTN_TRIGGER_HAPPY39 0x2e6 -+#define BTN_TRIGGER_HAPPY40 0x2e7 -+ -+/* We avoid low common keys in module aliases so they don't get huge. */ -+#define KEY_MIN_INTERESTING KEY_MUTE -+#define KEY_MAX 0x2ff -+#define KEY_CNT (KEY_MAX+1) -+ -+/* -+ * Relative axes -+ */ -+ -+#define REL_X 0x00 -+#define REL_Y 0x01 -+#define REL_Z 0x02 -+#define REL_RX 0x03 -+#define REL_RY 0x04 -+#define REL_RZ 0x05 -+#define REL_HWHEEL 0x06 -+#define REL_DIAL 0x07 -+#define REL_WHEEL 0x08 -+#define REL_MISC 0x09 -+#define REL_MAX 0x0f -+#define REL_CNT (REL_MAX+1) -+ -+/* -+ * Absolute axes -+ */ -+ -+#define ABS_X 0x00 -+#define ABS_Y 0x01 -+#define ABS_Z 0x02 -+#define ABS_RX 0x03 -+#define ABS_RY 0x04 -+#define ABS_RZ 0x05 -+#define ABS_THROTTLE 0x06 -+#define ABS_RUDDER 0x07 -+#define ABS_WHEEL 0x08 -+#define ABS_GAS 0x09 -+#define ABS_BRAKE 0x0a -+#define ABS_HAT0X 0x10 -+#define ABS_HAT0Y 0x11 -+#define ABS_HAT1X 0x12 -+#define ABS_HAT1Y 0x13 -+#define ABS_HAT2X 0x14 -+#define ABS_HAT2Y 0x15 -+#define ABS_HAT3X 0x16 -+#define ABS_HAT3Y 0x17 -+#define ABS_PRESSURE 0x18 -+#define ABS_DISTANCE 0x19 -+#define ABS_TILT_X 0x1a -+#define ABS_TILT_Y 0x1b -+#define ABS_TOOL_WIDTH 0x1c -+ -+#define ABS_VOLUME 0x20 -+ -+#define ABS_MISC 0x28 -+ -+#define ABS_MT_SLOT 0x2f /* MT slot being modified */ -+#define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */ -+#define ABS_MT_TOUCH_MINOR 0x31 /* Minor axis (omit if circular) */ -+#define ABS_MT_WIDTH_MAJOR 0x32 /* Major axis of approaching ellipse */ -+#define ABS_MT_WIDTH_MINOR 0x33 /* Minor axis (omit if circular) */ -+#define ABS_MT_ORIENTATION 0x34 /* Ellipse orientation */ -+#define ABS_MT_POSITION_X 0x35 /* Center X touch position */ -+#define ABS_MT_POSITION_Y 0x36 /* Center Y touch position */ -+#define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */ -+#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ -+#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ -+#define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ -+#define ABS_MT_DISTANCE 0x3b /* Contact hover distance */ -+#define ABS_MT_TOOL_X 0x3c /* Center X tool position */ -+#define ABS_MT_TOOL_Y 0x3d /* Center Y tool position */ -+ -+ -+#define ABS_MAX 0x3f -+#define ABS_CNT (ABS_MAX+1) -+ -+/* -+ * Switch events -+ */ -+ -+#define SW_LID 0x00 /* set = lid shut */ -+#define SW_TABLET_MODE 0x01 /* set = tablet mode */ -+#define SW_HEADPHONE_INSERT 0x02 /* set = inserted */ -+#define SW_RFKILL_ALL 0x03 /* rfkill master switch, type "any" -+ set = radio enabled */ -+#define SW_RADIO SW_RFKILL_ALL /* deprecated */ -+#define SW_MICROPHONE_INSERT 0x04 /* set = inserted */ -+#define SW_DOCK 0x05 /* set = plugged into dock */ -+#define SW_LINEOUT_INSERT 0x06 /* set = inserted */ -+#define SW_JACK_PHYSICAL_INSERT 0x07 /* set = mechanical switch set */ -+#define SW_VIDEOOUT_INSERT 0x08 /* set = inserted */ -+#define SW_CAMERA_LENS_COVER 0x09 /* set = lens covered */ -+#define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */ -+#define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ -+#define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ -+#define SW_LINEIN_INSERT 0x0d /* set = inserted */ -+#define SW_MUTE_DEVICE 0x0e /* set = device disabled */ -+#define SW_MAX 0x0f -+#define SW_CNT (SW_MAX+1) -+ -+/* -+ * Misc events -+ */ -+ -+#define MSC_SERIAL 0x00 -+#define MSC_PULSELED 0x01 -+#define MSC_GESTURE 0x02 -+#define MSC_RAW 0x03 -+#define MSC_SCAN 0x04 -+#define MSC_TIMESTAMP 0x05 -+#define MSC_MAX 0x07 -+#define MSC_CNT (MSC_MAX+1) -+ -+/* -+ * LEDs -+ */ -+ -+#define LED_NUML 0x00 -+#define LED_CAPSL 0x01 -+#define LED_SCROLLL 0x02 -+#define LED_COMPOSE 0x03 -+#define LED_KANA 0x04 -+#define LED_SLEEP 0x05 -+#define LED_SUSPEND 0x06 -+#define LED_MUTE 0x07 -+#define LED_MISC 0x08 -+#define LED_MAIL 0x09 -+#define LED_CHARGING 0x0a -+#define LED_MAX 0x0f -+#define LED_CNT (LED_MAX+1) -+ -+/* -+ * Autorepeat values -+ */ -+ -+#define REP_DELAY 0x00 -+#define REP_PERIOD 0x01 -+#define REP_MAX 0x01 -+#define REP_CNT (REP_MAX+1) -+ -+/* -+ * Sounds -+ */ -+ -+#define SND_CLICK 0x00 -+#define SND_BELL 0x01 -+#define SND_TONE 0x02 -+#define SND_MAX 0x07 -+#define SND_CNT (SND_MAX+1) -+ -+#endif diff --git a/package/boot/uboot-sunxi/patches/011-dt-sync-dts-files-with-kernel.patch b/package/boot/uboot-sunxi/patches/011-dt-sync-dts-files-with-kernel.patch deleted file mode 100644 index e36f9e3c5a..0000000000 --- a/package/boot/uboot-sunxi/patches/011-dt-sync-dts-files-with-kernel.patch +++ /dev/null @@ -1,7211 +0,0 @@ -From 80e5f83c0fc4bf42110cc55ce671ad7ddc7b08a4 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 14 Mar 2016 17:37:09 +0100 -Subject: [PATCH] sunxi: Sync dts files with the upstream kernel - -Sync dts files with the upstream kernel including -changes queued for 4.6: - -https://git.kernel.org/cgit/linux/kernel/git/mripard/linux.git/commit/?h=sunxi/dt-for-4.6 - -Note this adds a number of new unused board dts files. I've asked the -authors of the kernel commits adding these to submit a matching defconfig -to u-boot. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell ---- - arch/arm/dts/Makefile | 8 +- - arch/arm/dts/axp22x.dtsi | 145 ++++++++++++ - arch/arm/dts/sun4i-a10-a1000.dts | 4 + - arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts | 22 ++ - arch/arm/dts/sun4i-a10-cubieboard.dts | 4 + - arch/arm/dts/sun4i-a10-gemei-g9.dts | 63 +++++- - arch/arm/dts/sun4i-a10-inet1.dts | 48 ++++ - arch/arm/dts/sun4i-a10-inet97fv2.dts | 127 ++++++++++- - arch/arm/dts/sun4i-a10-inet9f-rev03.dts | 181 +++++++++++++++ - arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts | 86 +------ - arch/arm/dts/sun4i-a10-jesurun-q5.dts | 15 ++ - arch/arm/dts/sun4i-a10-marsboard.dts | 23 ++ - arch/arm/dts/sun4i-a10-mk802.dts | 37 +++ - arch/arm/dts/sun4i-a10-olinuxino-lime.dts | 12 + - arch/arm/dts/sun4i-a10-pcduino.dts | 58 ++++- - arch/arm/dts/sun4i-a10-pcduino2.dts | 78 +++++++ - arch/arm/dts/sun4i-a10-pov-protab2-ips9.dts | 69 ++++++ - arch/arm/dts/sun4i-a10.dtsi | 153 +++++++++++-- - arch/arm/dts/sun5i-a10s-auxtek-t004.dts | 14 ++ - arch/arm/dts/sun5i-a10s-olinuxino-micro.dts | 2 +- - arch/arm/dts/sun5i-a13-empire-electronix-d709.dts | 19 +- - arch/arm/dts/sun5i-a13-inet-98v-rev2.dts | 26 +-- - arch/arm/dts/sun5i-a13-utoo-p66.dts | 30 +++ - arch/arm/dts/sun5i-q8-common.dtsi | 10 + - arch/arm/dts/sun5i-r8-chip.dts | 47 +++- - arch/arm/dts/sun5i.dtsi | 31 +++ - arch/arm/dts/sun6i-a31-colombus.dts | 24 ++ - arch/arm/dts/sun6i-a31-hummingbird.dts | 132 ++++++----- - arch/arm/dts/sun6i-a31.dtsi | 65 +++++- - arch/arm/dts/sun6i-a31s-primo81.dts | 247 ++++++++++++++++++++- - arch/arm/dts/sun6i-a31s-sina31s-core.dtsi | 142 ++++++++++++ - arch/arm/dts/sun6i-a31s-sina31s.dts | 153 +++++++++++++ - .../arm/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts | 205 +++++++++++++++++ - arch/arm/dts/sun7i-a20-bananapi.dts | 78 ++++++- - arch/arm/dts/sun7i-a20-cubieboard2.dts | 23 ++ - arch/arm/dts/sun7i-a20-cubietruck.dts | 4 + - arch/arm/dts/sun7i-a20-icnova-swac.dts | 169 ++++++++++++++ - arch/arm/dts/sun7i-a20-itead-ibox.dts | 125 +++++++++++ - arch/arm/dts/sun7i-a20-lamobo-r1.dts | 10 - - arch/arm/dts/sun7i-a20-mk808c.dts | 39 ++++ - arch/arm/dts/sun7i-a20-olimex-som-evb.dts | 95 ++++++-- - arch/arm/dts/sun7i-a20-olinuxino-lime.dts | 12 + - arch/arm/dts/sun7i-a20-olinuxino-lime2.dts | 47 ++++ - arch/arm/dts/sun7i-a20-olinuxino-micro.dts | 6 + - arch/arm/dts/sun7i-a20-orangepi-mini.dts | 33 +++ - arch/arm/dts/sun7i-a20-orangepi.dts | 29 +++ - arch/arm/dts/sun7i-a20-pcduino3-nano.dts | 69 +++++- - arch/arm/dts/sun7i-a20-pcduino3.dts | 58 ++++- - arch/arm/dts/sun7i-a20-wexler-tab7200.dts | 90 +++++++- - arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts | 187 +++++++++++++++- - arch/arm/dts/sun7i-a20.dtsi | 113 +++++++++- - arch/arm/dts/sun8i-a23-a33.dtsi | 71 ++++-- - arch/arm/dts/sun8i-a23-gt90h-v4.dts | 120 +++++++++- - arch/arm/dts/sun8i-a23.dtsi | 25 +++ - arch/arm/dts/sun8i-a33-sinlinx-sina33.dts | 83 ++++++- - arch/arm/dts/sun8i-a33.dtsi | 45 ++++ - arch/arm/dts/sun8i-a83t-cubietruck-plus.dts | 65 ++++++ - arch/arm/dts/sun8i-a83t.dtsi | 125 +++++------ - arch/arm/dts/sun8i-h3-orangepi-pc.dts | 69 ++++++ - arch/arm/dts/sun8i-h3-orangepi-plus.dts | 63 ++++++ - arch/arm/dts/sun8i-h3.dtsi | 189 +++++++++++----- - arch/arm/dts/sun8i-q8-common.dtsi | 96 +++++++- - arch/arm/dts/sun9i-a80-cubieboard4.dts | 36 +++ - arch/arm/dts/sun9i-a80-optimus.dts | 48 ++-- - arch/arm/dts/sun9i-a80.dtsi | 204 +++++++++++++++-- - arch/arm/dts/sunxi-itead-core-common.dtsi | 136 ++++++++++++ - arch/arm/dts/sunxi-q8-common.dtsi | 6 + - 67 files changed, 4351 insertions(+), 497 deletions(-) - create mode 100644 arch/arm/dts/axp22x.dtsi - create mode 100644 arch/arm/dts/sun4i-a10-pcduino2.dts - create mode 100644 arch/arm/dts/sun6i-a31s-sina31s-core.dtsi - create mode 100644 arch/arm/dts/sun6i-a31s-sina31s.dts - create mode 100644 arch/arm/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts - create mode 100644 arch/arm/dts/sun7i-a20-icnova-swac.dts - create mode 100644 arch/arm/dts/sun7i-a20-itead-ibox.dts - create mode 100644 arch/arm/dts/sun8i-a83t-cubietruck-plus.dts - create mode 100644 arch/arm/dts/sunxi-itead-core-common.dtsi - ---- a/arch/arm/dts/Makefile -+++ b/arch/arm/dts/Makefile -@@ -126,6 +126,7 @@ dtb-$(CONFIG_MACH_SUN4I) += \ - sun4i-a10-mk802ii.dtb \ - sun4i-a10-olinuxino-lime.dtb \ - sun4i-a10-pcduino.dtb \ -+ sun4i-a10-pcduino2.dtb \ - sun4i-a10-pov-protab2-ips9.dtb - dtb-$(CONFIG_MACH_SUN5I) += \ - sun5i-a10s-auxtek-t003.dtb \ -@@ -155,7 +156,9 @@ dtb-$(CONFIG_MACH_SUN6I) += \ - sun6i-a31-pangolin.dtb \ - sun6i-a31s-cs908.dtb \ - sun6i-a31s-primo81.dtb \ -- sun6i-a31s-sinovoip-bpi-m2.dtb -+ sun6i-a31s-sina31s.dtb \ -+ sun6i-a31s-sinovoip-bpi-m2.dtb \ -+ sun6i-a31s-yones-toptech-bs1078-v2.dtb - dtb-$(CONFIG_MACH_SUN7I) += \ - sun7i-a20-ainol-aw1.dtb \ - sun7i-a20-bananapi.dtb \ -@@ -164,6 +167,8 @@ dtb-$(CONFIG_MACH_SUN7I) += \ - sun7i-a20-cubietruck.dtb \ - sun7i-a20-hummingbird.dtb \ - sun7i-a20-i12-tvbox.dtb \ -+ sun7i-a20-icnova-swac.dtb \ -+ sun7i-a20-itead-ibox.dtb \ - sun7i-a20-lamobo-r1.dtb \ - sun7i-a20-m3.dtb \ - sun7i-a20-m5.dtb \ -@@ -190,6 +195,7 @@ dtb-$(CONFIG_MACH_SUN8I_A33) += \ - sun8i-a33-sinlinx-sina33.dtb - dtb-$(CONFIG_MACH_SUN8I_A83T) += \ - sun8i-a83t-allwinner-h8homlet-v2.dtb \ -+ sun8i-a83t-cubietruck-plus.dtb \ - sun8i-a83t-sinovoip-bpi-m3.dtb - dtb-$(CONFIG_MACH_SUN8I_H3) += \ - sun8i-h3-orangepi-pc.dtb \ ---- /dev/null -+++ b/arch/arm/dts/axp22x.dtsi -@@ -0,0 +1,145 @@ -+/* -+ * Copyright 2015 Chen-Yu Tsai -+ * -+ * Chen-Yu Tsai -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file 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. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/* -+ * AXP221/221s/223 Integrated Power Management Chip -+ * http://www.x-powers.com/product/AXP22X.php -+ * http://dl.linux-sunxi.org/AXP/AXP221%20Datasheet%20V1.2%2020130326%20.pdf -+ */ -+ -+&axp22x { -+ interrupt-controller; -+ #interrupt-cells = <1>; -+ -+ regulators { -+ /* Default work frequency for buck regulators */ -+ x-powers,dcdc-freq = <3000>; -+ -+ reg_dcdc1: dcdc1 { -+ regulator-name = "dcdc1"; -+ }; -+ -+ reg_dcdc2: dcdc2 { -+ regulator-name = "dcdc2"; -+ }; -+ -+ reg_dcdc3: dcdc3 { -+ regulator-name = "dcdc3"; -+ }; -+ -+ reg_dcdc4: dcdc4 { -+ regulator-name = "dcdc4"; -+ }; -+ -+ reg_dcdc5: dcdc5 { -+ regulator-name = "dcdc5"; -+ }; -+ -+ reg_dc1sw: dc1sw { -+ regulator-name = "dc1sw"; -+ }; -+ -+ reg_dc5ldo: dc5ldo { -+ regulator-name = "dc5ldo"; -+ }; -+ -+ reg_aldo1: aldo1 { -+ regulator-name = "aldo1"; -+ }; -+ -+ reg_aldo2: aldo2 { -+ regulator-name = "aldo2"; -+ }; -+ -+ reg_aldo3: aldo3 { -+ regulator-name = "aldo3"; -+ }; -+ -+ reg_dldo1: dldo1 { -+ regulator-name = "dldo1"; -+ }; -+ -+ reg_dldo2: dldo2 { -+ regulator-name = "dldo2"; -+ }; -+ -+ reg_dldo3: dldo3 { -+ regulator-name = "dldo3"; -+ }; -+ -+ reg_dldo4: dldo4 { -+ regulator-name = "dldo4"; -+ }; -+ -+ reg_eldo1: eldo1 { -+ regulator-name = "eldo1"; -+ }; -+ -+ reg_eldo2: eldo2 { -+ regulator-name = "eldo2"; -+ }; -+ -+ reg_eldo3: eldo3 { -+ regulator-name = "eldo3"; -+ }; -+ -+ reg_ldo_io0: ldo_io0 { -+ regulator-name = "ldo_io0"; -+ status = "disabled"; -+ }; -+ -+ reg_ldo_io1: ldo_io1 { -+ regulator-name = "ldo_io1"; -+ status = "disabled"; -+ }; -+ -+ reg_rtc_ldo: rtc_ldo { -+ /* RTC_LDO is a fixed, always-on regulator */ -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "rtc_ldo"; -+ }; -+ }; -+}; ---- a/arch/arm/dts/sun4i-a10-a1000.dts -+++ b/arch/arm/dts/sun4i-a10-a1000.dts -@@ -93,6 +93,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &ehci0 { - status = "okay"; - }; ---- a/arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts -+++ b/arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts -@@ -45,6 +45,7 @@ - #include "sunxi-common-regulators.dtsi" - #include - #include -+#include - - / { - model = "Chuwi V7 CW0825"; -@@ -78,6 +79,27 @@ - }; - }; - -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+}; -+ -+&i2c2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c2_pins_a>; -+ status = "okay"; -+ -+ ft5306de4: touchscreen@38 { -+ compatible = "edt,edt-ft5406"; -+ reg = <0x38>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; -+ touchscreen-size-x = <1024>; -+ touchscreen-size-y = <768>; -+ }; -+}; -+ - &lradc { - vref-supply = <®_vcc3v0>; - status = "okay"; ---- a/arch/arm/dts/sun4i-a10-cubieboard.dts -+++ b/arch/arm/dts/sun4i-a10-cubieboard.dts -@@ -83,6 +83,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; ---- a/arch/arm/dts/sun4i-a10-gemei-g9.dts -+++ b/arch/arm/dts/sun4i-a10-gemei-g9.dts -@@ -47,6 +47,7 @@ - #include "sunxi-common-regulators.dtsi" - #include - #include -+#include - - / { - model = "Gemei G9 Tablet"; -@@ -64,12 +65,22 @@ - /* - * TODO: - * 2x cameras via CSI -- * bma250 IRQs - * AXP battery management - * NAND - * OTG - * Touchscreen - gt801_2plus1 @ i2c adapter 2 @ 0x48 - */ -+&codec { -+ /* PH15 controls power to external amplifier (ft2012q) */ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&codec_pa_pin>; -+ allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+}; - - &ehci0 { - status = "okay"; -@@ -85,15 +96,13 @@ - status = "okay"; - - axp209: pmic@34 { -- compatible = "x-powers,axp209"; - reg = <0x34>; - interrupts = <0>; -- -- interrupt-controller; -- #interrupt-cells = <1>; - }; - }; - -+#include "axp209.dtsi" -+ - &i2c1 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins_a>; -@@ -103,17 +112,13 @@ - bma250@18 { - compatible = "bosch,bma250"; - reg = <0x18>; -- -- /* -- * TODO: interrupt pins: -- * int1 - PH00 -- * int2 - PI10 -- */ -+ interrupt-parent = <&pio>; -+ interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH00 / EINT0 */ - }; - }; - - &lradc { -- vref-supply = <®_vcc3v0>; -+ vref-supply = <®_ldo2>; - - status = "okay"; - -@@ -149,6 +154,40 @@ - status = "okay"; - }; - -+&pio { -+ codec_pa_pin: codec_pa_pin@0 { -+ allwinner,pins = "PH15"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1250000>; -+ regulator-max-microvolt = <1250000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; ---- a/arch/arm/dts/sun4i-a10-inet1.dts -+++ b/arch/arm/dts/sun4i-a10-inet1.dts -@@ -47,6 +47,7 @@ - #include - #include - #include -+#include - - / { - model = "iNet-1"; -@@ -56,11 +57,25 @@ - serial0 = &uart0; - }; - -+ backlight: backlight { -+ compatible = "pwm-backlight"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&bl_en_pin_inet>; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <8>; -+ enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ -+ }; -+ - chosen { - stdout-path = "serial0:115200n8"; - }; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; -@@ -104,6 +119,19 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c2_pins_a>; - status = "okay"; -+ -+ ft5x: touchscreen@38 { -+ compatible = "edt,edt-ft5406"; -+ reg = <0x38>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&touchscreen_wake_pin>; -+ wake-gpios = <&pio 1 13 GPIO_ACTIVE_HIGH>; /* PB13 */ -+ touchscreen-size-x = <600>; -+ touchscreen-size-y = <1024>; -+ touchscreen-swapped-x-y; -+ }; - }; - - &lradc { -@@ -151,6 +179,20 @@ - }; - - &pio { -+ bl_en_pin_inet: bl_en_pin@0 { -+ allwinner,pins = "PH7"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ touchscreen_wake_pin: touchscreen_wake_pin@0 { -+ allwinner,pins = "PB13"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - usb0_id_detect_pin: usb0_id_detect_pin@0 { - allwinner,pins = "PH4"; - allwinner,function = "gpio_in"; -@@ -166,6 +208,12 @@ - }; - }; - -+&pwm { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm0_pins_a>; -+ status = "okay"; -+}; -+ - ®_dcdc2 { - regulator-always-on; - regulator-min-microvolt = <1000000>; ---- a/arch/arm/dts/sun4i-a10-inet97fv2.dts -+++ b/arch/arm/dts/sun4i-a10-inet97fv2.dts -@@ -47,6 +47,8 @@ - #include "sunxi-common-regulators.dtsi" - - #include -+#include -+#include - - / { - model = "INet-97F Rev 02"; -@@ -61,8 +63,8 @@ - }; - }; - --&ehci0 { -- status = "okay"; -+&cpu0 { -+ cpu-supply = <®_dcdc2>; - }; - - &ehci1 { -@@ -75,12 +77,71 @@ - status = "okay"; - - axp209: pmic@34 { -- compatible = "x-powers,axp209"; - reg = <0x34>; - interrupts = <0>; -+ }; -+}; -+ -+#include "axp209.dtsi" -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+}; -+ -+&i2c2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c2_pins_a>; -+ status = "okay"; -+ -+ ft5406ee8: touchscreen@38 { -+ compatible = "edt,edt-ft5406"; -+ reg = <0x38>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; -+ touchscreen-size-x = <800>; -+ touchscreen-size-y = <480>; -+ }; -+}; -+ -+&lradc { -+ vref-supply = <®_ldo2>; -+ status = "okay"; -+ -+ button@200 { -+ label = "Menu"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <200000>; -+ }; -+ -+ button@600 { -+ label = "Volume Up"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <600000>; -+ }; - -- interrupt-controller; -- #interrupt-cells = <1>; -+ button@800 { -+ label = "Volume Down"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <800000>; -+ }; -+ -+ button@1000 { -+ label = "Home"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <1000000>; -+ }; -+ -+ button@1200 { -+ label = "Esc"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <1200000>; - }; - }; - -@@ -94,15 +155,52 @@ - status = "okay"; - }; - --&ohci0 { -+&otg_sram { - status = "okay"; - }; - --&ohci1 { -- status = "okay"; -+&pio { -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { -+ allwinner,pins = "PH5"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; - }; - --®_usb1_vbus { -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1250000>; -+ regulator-max-microvolt = <1250000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ -+®_usb0_vbus { - status = "okay"; - }; - -@@ -116,8 +214,17 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -- usb1_vbus-supply = <®_usb1_vbus>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ -+ usb0_vbus-supply = <®_usb0_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; - }; ---- a/arch/arm/dts/sun4i-a10-inet9f-rev03.dts -+++ b/arch/arm/dts/sun4i-a10-inet9f-rev03.dts -@@ -59,6 +59,159 @@ - chosen { - stdout-path = "serial0:115200n8"; - }; -+ -+ gpio_keys { -+ compatible = "gpio-keys-polled"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&key_pins_inet9f>; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ poll-interval = <20>; -+ -+ button@0 { -+ label = "Left Joystick Left"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <0xffffffff>; /* -1 */ -+ gpios = <&pio 0 6 GPIO_ACTIVE_LOW>; /* PA6 */ -+ }; -+ -+ button@1 { -+ label = "Left Joystick Right"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <1>; -+ gpios = <&pio 0 5 GPIO_ACTIVE_LOW>; /* PA5 */ -+ }; -+ -+ button@2 { -+ label = "Left Joystick Up"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <0xffffffff>; /* -1 */ -+ gpios = <&pio 0 8 GPIO_ACTIVE_LOW>; /* PA8 */ -+ }; -+ -+ button@3 { -+ label = "Left Joystick Down"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <1>; -+ gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */ -+ }; -+ -+ button@4 { -+ label = "Right Joystick Left"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <0xffffffff>; /* -1 */ -+ gpios = <&pio 0 1 GPIO_ACTIVE_LOW>; /* PA1 */ -+ }; -+ -+ button@5 { -+ label = "Right Joystick Right"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <1>; -+ gpios = <&pio 0 0 GPIO_ACTIVE_LOW>; /* PA0 */ -+ }; -+ -+ button@6 { -+ label = "Right Joystick Up"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <0xffffffff>; /* -1 */ -+ gpios = <&pio 0 3 GPIO_ACTIVE_LOW>; /* PA3 */ -+ }; -+ -+ button@7 { -+ label = "Right Joystick Down"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <1>; -+ gpios = <&pio 0 4 GPIO_ACTIVE_LOW>; /* PA4 */ -+ }; -+ -+ button@8 { -+ label = "DPad Left"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <0xffffffff>; /* -1 */ -+ gpios = <&pio 7 23 GPIO_ACTIVE_LOW>; /* PH23 */ -+ }; -+ -+ button@9 { -+ label = "DPad Right"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <1>; -+ gpios = <&pio 7 24 GPIO_ACTIVE_LOW>; /* PH24 */ -+ }; -+ -+ button@10 { -+ label = "DPad Up"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <0xffffffff>; /* -1 */ -+ gpios = <&pio 7 25 GPIO_ACTIVE_LOW>; /* PH25 */ -+ }; -+ -+ button@11 { -+ label = "DPad Down"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <1>; -+ gpios = <&pio 7 26 GPIO_ACTIVE_LOW>; /* PH26 */ -+ }; -+ -+ button@12 { -+ label = "Button X"; -+ linux,code = ; -+ gpios = <&pio 0 16 GPIO_ACTIVE_LOW>; /* PA16 */ -+ }; -+ -+ button@13 { -+ label = "Button Y"; -+ linux,code = ; -+ gpios = <&pio 0 14 GPIO_ACTIVE_LOW>; /* PA14 */ -+ }; -+ -+ button@14 { -+ label = "Button A"; -+ linux,code = ; -+ gpios = <&pio 0 17 GPIO_ACTIVE_LOW>; /* PA17 */ -+ }; -+ -+ button@15 { -+ label = "Button B"; -+ linux,code = ; -+ gpios = <&pio 0 15 GPIO_ACTIVE_LOW>; /* PA15 */ -+ }; -+ -+ button@16 { -+ label = "Select Button"; -+ linux,code = ; -+ gpios = <&pio 0 11 GPIO_ACTIVE_LOW>; /* PA11 */ -+ }; -+ -+ button@17 { -+ label = "Start Button"; -+ linux,code = ; -+ gpios = <&pio 0 12 GPIO_ACTIVE_LOW>; /* PA12 */ -+ }; -+ -+ button@18 { -+ label = "Top Left Button"; -+ linux,code = ; -+ gpios = <&pio 7 22 GPIO_ACTIVE_LOW>; /* PH22 */ -+ }; -+ -+ button@19 { -+ label = "Top Right Button"; -+ linux,code = ; -+ gpios = <&pio 0 13 GPIO_ACTIVE_LOW>; /* PA13 */ -+ }; -+ }; - }; - - &cpu0 { -@@ -86,12 +239,29 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins_a>; - status = "okay"; -+ -+ /* Accelerometer */ -+ bma250@18 { -+ compatible = "bosch,bma250"; -+ reg = <0x18>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */ -+ }; - }; - - &i2c2 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c2_pins_a>; - status = "okay"; -+ -+ ft5406ee8: touchscreen@38 { -+ compatible = "edt,edt-ft5406"; -+ reg = <0x38>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; -+ touchscreen-size-x = <800>; -+ touchscreen-size-y = <480>; -+ }; - }; - - &lradc { -@@ -149,6 +319,17 @@ - }; - - &pio { -+ key_pins_inet9f: key_pins@0 { -+ allwinner,pins = "PA0", "PA1", "PA3", "PA4", -+ "PA5", "PA6", "PA8", "PA9", -+ "PA11", "PA12", "PA13", -+ "PA14", "PA15", "PA16", "PA17", -+ "PH22", "PH23", "PH24", "PH25", "PH26"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - usb0_id_detect_pin: usb0_id_detect_pin@0 { - allwinner,pins = "PH4"; - allwinner,function = "gpio_in"; ---- a/arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts -+++ b/arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts -@@ -1,5 +1,6 @@ - /* - * Copyright 2015 Josef Gajdusek -+ * Copyright 2015 - Marcus Cooper - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual -@@ -42,22 +43,11 @@ - - /dts-v1/; - #include "sun4i-a10.dtsi" --#include "sunxi-common-regulators.dtsi" -- --#include --#include -+#include "sunxi-itead-core-common.dtsi" - - / { - model = "Iteaduino Plus A10"; - compatible = "itead,iteaduino-plus-a10", "allwinner,sun4i-a10"; -- -- aliases { -- serial0 = &uart0; -- }; -- -- chosen { -- stdout-path = "serial0:115200n8"; -- }; - }; - - &ahci { -@@ -65,18 +55,6 @@ - status = "okay"; - }; - --&cpu0 { -- cpu-supply = <®_dcdc2>; --}; -- --&ehci0 { -- status = "okay"; --}; -- --&ehci1 { -- status = "okay"; --}; -- - &emac { - pinctrl-names = "default"; - pinctrl-0 = <&emac_pins_a>; -@@ -89,12 +67,7 @@ - }; - - &i2c0 { -- pinctrl-names = "default"; -- pinctrl-0 = <&i2c0_pins_a>; -- status = "okay"; -- - axp209: pmic@34 { -- reg = <0x34>; - interrupts = <0>; - }; - }; -@@ -135,68 +108,13 @@ - status = "okay"; - }; - --&ohci0 { -- status = "okay"; --}; -- --&ohci1 { -- status = "okay"; --}; -- - ®_ahci_5v { - status = "okay"; - }; - --#include "axp209.dtsi" -- --®_dcdc2 { -- regulator-always-on; -- regulator-min-microvolt = <1000000>; -- regulator-max-microvolt = <1450000>; -- regulator-name = "vdd-cpu"; --}; -- --®_dcdc3 { -- regulator-always-on; -- regulator-min-microvolt = <1000000>; -- regulator-max-microvolt = <1400000>; -- regulator-name = "vdd-int-dll"; --}; -- --®_ldo1 { -- regulator-name = "vdd-rtc"; --}; -- --®_ldo2 { -- regulator-always-on; -- regulator-min-microvolt = <3000000>; -- regulator-max-microvolt = <3000000>; -- regulator-name = "avcc"; --}; -- --®_usb1_vbus { -- status = "okay"; --}; -- --®_usb2_vbus { -- status = "okay"; --}; -- - &spi0 { - pinctrl-names = "default"; - pinctrl-0 = <&spi0_pins_a>, - <&spi0_cs0_pins_a>; - status = "okay"; - }; -- --&uart0 { -- pinctrl-names = "default"; -- pinctrl-0 = <&uart0_pins_a>; -- status = "okay"; --}; -- --&usbphy { -- usb1_vbus-supply = <®_usb1_vbus>; -- usb2_vbus-supply = <®_usb2_vbus>; -- status = "okay"; --}; ---- a/arch/arm/dts/sun4i-a10-jesurun-q5.dts -+++ b/arch/arm/dts/sun4i-a10-jesurun-q5.dts -@@ -156,6 +156,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - emac_power_pin_q5: emac_power_pin@0 { - allwinner,pins = "PH19"; -@@ -172,6 +176,11 @@ - }; - }; - -+®_usb0_vbus { -+ regulator-boot-on; -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -186,7 +195,13 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "host"; -+ status = "okay"; -+}; -+ - &usbphy { -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun4i-a10-marsboard.dts -+++ b/arch/arm/dts/sun4i-a10-marsboard.dts -@@ -91,6 +91,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -154,6 +158,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - led_pins_marsboard: led_pins@0 { - allwinner,pins = "PB5", "PB6", "PB7", "PB8"; -@@ -161,6 +169,13 @@ - allwinner,drive = ; - allwinner,pull = ; - }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - - ®_usb1_vbus { -@@ -184,7 +199,15 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun4i-a10-mk802.dts -+++ b/arch/arm/dts/sun4i-a10-mk802.dts -@@ -44,6 +44,7 @@ - #include "sun4i-a10.dtsi" - #include "sunxi-common-regulators.dtsi" - #include -+#include - - / { - model = "MK802"; -@@ -58,6 +59,10 @@ - }; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -80,7 +85,25 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { -+ allwinner,pins = "PH5"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - usb2_vbus_pin_mk802: usb2_vbus_pin@0 { - allwinner,pins = "PH12"; - allwinner,function = "gpio_out"; -@@ -89,6 +112,10 @@ - }; - }; - -+®_usb0_vbus { -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -105,7 +132,17 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; -+ usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun4i-a10-olinuxino-lime.dts -+++ b/arch/arm/dts/sun4i-a10-olinuxino-lime.dts -@@ -124,6 +124,18 @@ - }; - }; - -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+ -+ eeprom: eeprom@50 { -+ compatible = "atmel,24c16"; -+ reg = <0x50>; -+ pagesize = <16>; -+ }; -+}; -+ - &mdio { - status = "okay"; - ---- a/arch/arm/dts/sun4i-a10-pcduino.dts -+++ b/arch/arm/dts/sun4i-a10-pcduino.dts -@@ -104,6 +104,10 @@ - }; - }; - -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -129,12 +133,8 @@ - status = "okay"; - - axp209: pmic@34 { -- compatible = "x-powers,axp209"; - reg = <0x34>; - interrupts = <0>; -- -- interrupt-controller; -- #interrupt-cells = <1>; - }; - }; - -@@ -164,6 +164,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - led_pins_pcduino: led_pins@0 { - allwinner,pins = "PH15", "PH16"; -@@ -178,14 +182,40 @@ - allwinner,drive = ; - allwinner,pull = ; - }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - --®_usb1_vbus { -- status = "okay"; -+#include "axp209.dtsi" -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; - }; - --®_usb2_vbus { -- status = "okay"; -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; - }; - - &uart0 { -@@ -194,8 +224,16 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -- usb1_vbus-supply = <®_usb1_vbus>; -- usb2_vbus-supply = <®_usb2_vbus>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb1_vbus-supply = <®_vcc5v0>; /* USB1 VBUS is always on */ -+ usb2_vbus-supply = <®_vcc5v0>; /* USB2 VBUS is always on */ - status = "okay"; - }; ---- /dev/null -+++ b/arch/arm/dts/sun4i-a10-pcduino2.dts -@@ -0,0 +1,78 @@ -+/* -+ * Copyright 2015 Siarhei Siamashka -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file 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. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/* -+ * The LinkSprite pcDuino2 board is almost identical to the older -+ * LinkSprite pcDuino1 board. The only software visible difference -+ * is that the pcDuino2 board got a USB VBUS voltage regulator, which -+ * is controlled by the PD2 pin (pulled-up by default). Also one of -+ * the USB host ports has been replaced with a USB WIFI chip. -+ */ -+ -+#include "sun4i-a10-pcduino.dts" -+ -+/ { -+ model = "LinkSprite pcDuino2"; -+ compatible = "linksprite,a10-pcduino2", "allwinner,sun4i-a10"; -+}; -+ -+&pio { -+ usb2_vbus_pin_pcduino2: usb2_vbus_pin@0 { -+ allwinner,pins = "PD2"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_usb2_vbus { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb2_vbus_pin_pcduino2>; -+ gpio = <&pio 3 2 GPIO_ACTIVE_HIGH>; -+ status = "okay"; -+}; -+ -+&usbphy { -+ usb1_vbus-supply = <®_vcc3v3>; /* USB WIFI is always on */ -+ usb2_vbus-supply = <®_usb2_vbus>; -+ status = "okay"; -+}; ---- a/arch/arm/dts/sun4i-a10-pov-protab2-ips9.dts -+++ b/arch/arm/dts/sun4i-a10-pov-protab2-ips9.dts -@@ -47,6 +47,7 @@ - #include - #include - #include -+#include - - / { - model = "Point of View Protab2-IPS9"; -@@ -56,11 +57,28 @@ - serial0 = &uart0; - }; - -+ backlight: backlight { -+ compatible = "pwm-backlight"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&bl_en_pin_protab>; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <8>; -+ enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ -+ }; -+ - chosen { - stdout-path = "serial0:115200n8"; - }; - }; - -+&codec { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&codec_pa_pin>; -+ allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */ -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; -@@ -86,12 +104,36 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins_a>; - status = "okay"; -+ -+ /* Accelerometer */ -+ bma250@18 { -+ compatible = "bosch,bma250"; -+ reg = <0x18>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */ -+ }; - }; - - &i2c2 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c2_pins_a>; - status = "okay"; -+ -+ pixcir_ts@5c { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&touchscreen_pins>; -+ compatible = "pixcir,pixcir_tangoc"; -+ reg = <0x5c>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; /* EINT21 (PH21) */ -+ attb-gpio = <&pio 7 21 GPIO_ACTIVE_HIGH>; /* PH21 */ -+ enable-gpios = <&pio 0 5 GPIO_ACTIVE_LOW>; -+ wake-gpios = <&pio 1 13 GPIO_ACTIVE_LOW>; -+ touchscreen-size-x = <1024>; -+ touchscreen-size-y = <768>; -+ touchscreen-inverted-x; -+ touchscreen-inverted-y; -+ }; - }; - - &lradc { -@@ -128,6 +170,27 @@ - }; - - &pio { -+ bl_en_pin_protab: bl_en_pin@0 { -+ allwinner,pins = "PH7"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ codec_pa_pin: codec_pa_pin@0 { -+ allwinner,pins = "PH15"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ touchscreen_pins: touchscreen_pins@0 { -+ allwinner,pins = "PA5", "PB13"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - usb0_id_detect_pin: usb0_id_detect_pin@0 { - allwinner,pins = "PH4"; - allwinner,function = "gpio_in"; -@@ -143,6 +206,12 @@ - }; - }; - -+&pwm { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm0_pins_a>; -+ status = "okay"; -+}; -+ - ®_dcdc2 { - regulator-always-on; - regulator-min-microvolt = <1000000>; ---- a/arch/arm/dts/sun4i-a10.dtsi -+++ b/arch/arm/dts/sun4i-a10.dtsi -@@ -45,6 +45,7 @@ - - #include - -+#include - #include - #include - -@@ -65,7 +66,7 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0-hdmi"; - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, -- <&ahb_gates 44>; -+ <&ahb_gates 44>, <&dram_gates 26>; - status = "disabled"; - }; - -@@ -74,7 +75,8 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_fe0-de_be0-lcd0-hdmi"; - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, -- <&ahb_gates 44>, <&ahb_gates 46>; -+ <&ahb_gates 44>, <&ahb_gates 46>, -+ <&dram_gates 25>, <&dram_gates 26>; - status = "disabled"; - }; - -@@ -83,7 +85,8 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_fe0-de_be0-lcd0"; - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>, -- <&ahb_gates 46>; -+ <&ahb_gates 46>, <&dram_gates 25>, -+ <&dram_gates 26>; - status = "disabled"; - }; - -@@ -92,7 +95,8 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_fe0-de_be0-lcd0-tve0"; - clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>, -- <&ahb_gates 44>, <&ahb_gates 46>; -+ <&ahb_gates 44>, <&ahb_gates 46>, -+ <&dram_gates 25>, <&dram_gates 26>; - status = "disabled"; - }; - }; -@@ -195,6 +199,15 @@ - clock-output-names = "pll1"; - }; - -+ pll2: clk@01c20008 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-pll2-clk"; -+ reg = <0x01c20008 0x8>; -+ clocks = <&osc24M>; -+ clock-output-names = "pll2-1x", "pll2-2x", -+ "pll2-4x", "pll2-8x"; -+ }; -+ - pll4: clk@01c20018 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-pll1-clk"; -@@ -241,6 +254,7 @@ - compatible = "allwinner,sun4i-a10-axi-gates-clk"; - reg = <0x01c2005c 0x4>; - clocks = <&axi>; -+ clock-indices = <0>; - clock-output-names = "axi_dram"; - }; - -@@ -257,17 +271,36 @@ - compatible = "allwinner,sun4i-a10-ahb-gates-clk"; - reg = <0x01c20060 0x8>; - clocks = <&ahb>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, -+ <4>, <5>, <6>, -+ <7>, <8>, <9>, -+ <10>, <11>, <12>, -+ <13>, <14>, <16>, -+ <17>, <18>, <20>, -+ <21>, <22>, <23>, -+ <24>, <25>, <26>, -+ <32>, <33>, <34>, -+ <35>, <36>, <37>, -+ <40>, <41>, <43>, -+ <44>, <45>, -+ <46>, <47>, -+ <50>, <52>; - clock-output-names = "ahb_usb0", "ahb_ehci0", -- "ahb_ohci0", "ahb_ehci1", "ahb_ohci1", "ahb_ss", -- "ahb_dma", "ahb_bist", "ahb_mmc0", "ahb_mmc1", -- "ahb_mmc2", "ahb_mmc3", "ahb_ms", "ahb_nand", -- "ahb_sdram", "ahb_ace", "ahb_emac", "ahb_ts", -- "ahb_spi0", "ahb_spi1", "ahb_spi2", "ahb_spi3", -- "ahb_pata", "ahb_sata", "ahb_gps", "ahb_ve", -- "ahb_tvd", "ahb_tve0", "ahb_tve1", "ahb_lcd0", -- "ahb_lcd1", "ahb_csi0", "ahb_csi1", "ahb_hdmi", -- "ahb_de_be0", "ahb_de_be1", "ahb_de_fe0", -- "ahb_de_fe1", "ahb_mp", "ahb_mali400"; -+ "ahb_ohci0", "ahb_ehci1", -+ "ahb_ohci1", "ahb_ss", "ahb_dma", -+ "ahb_bist", "ahb_mmc0", "ahb_mmc1", -+ "ahb_mmc2", "ahb_mmc3", "ahb_ms", -+ "ahb_nand", "ahb_sdram", "ahb_ace", -+ "ahb_emac", "ahb_ts", "ahb_spi0", -+ "ahb_spi1", "ahb_spi2", "ahb_spi3", -+ "ahb_pata", "ahb_sata", "ahb_gps", -+ "ahb_ve", "ahb_tvd", "ahb_tve0", -+ "ahb_tve1", "ahb_lcd0", "ahb_lcd1", -+ "ahb_csi0", "ahb_csi1", "ahb_hdmi", -+ "ahb_de_be0", "ahb_de_be1", -+ "ahb_de_fe0", "ahb_de_fe1", -+ "ahb_mp", "ahb_mali400"; - }; - - apb0: apb0@01c20054 { -@@ -283,9 +316,14 @@ - compatible = "allwinner,sun4i-a10-apb0-gates-clk"; - reg = <0x01c20068 0x4>; - clocks = <&apb0>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, -+ <5>, <6>, -+ <7>, <10>; - clock-output-names = "apb0_codec", "apb0_spdif", -- "apb0_ac97", "apb0_iis", "apb0_pio", "apb0_ir0", -- "apb0_ir1", "apb0_keypad"; -+ "apb0_ac97", "apb0_iis", -+ "apb0_pio", "apb0_ir0", -+ "apb0_ir1", "apb0_keypad"; - }; - - apb1: clk@01c20058 { -@@ -301,12 +339,22 @@ - compatible = "allwinner,sun4i-a10-apb1-gates-clk"; - reg = <0x01c2006c 0x4>; - clocks = <&apb1>; -+ clock-indices = <0>, <1>, -+ <2>, <4>, -+ <5>, <6>, -+ <7>, <16>, -+ <17>, <18>, -+ <19>, <20>, -+ <21>, <22>, -+ <23>; - clock-output-names = "apb1_i2c0", "apb1_i2c1", -- "apb1_i2c2", "apb1_can", "apb1_scr", -- "apb1_ps20", "apb1_ps21", "apb1_uart0", -- "apb1_uart1", "apb1_uart2", "apb1_uart3", -- "apb1_uart4", "apb1_uart5", "apb1_uart6", -- "apb1_uart7"; -+ "apb1_i2c2", "apb1_can", -+ "apb1_scr", "apb1_ps20", -+ "apb1_ps21", "apb1_uart0", -+ "apb1_uart1", "apb1_uart2", -+ "apb1_uart3", "apb1_uart4", -+ "apb1_uart5", "apb1_uart6", -+ "apb1_uart7"; - }; - - nand_clk: clk@01c20080 { -@@ -446,6 +494,48 @@ - clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; - clock-output-names = "spi3"; - }; -+ -+ dram_gates: clk@01c20100 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-dram-gates-clk"; -+ reg = <0x01c20100 0x4>; -+ clocks = <&pll5 0>; -+ clock-indices = <0>, -+ <1>, <2>, -+ <3>, -+ <4>, -+ <5>, <6>, -+ <15>, -+ <24>, <25>, -+ <26>, <27>, -+ <28>, <29>; -+ clock-output-names = "dram_ve", -+ "dram_csi0", "dram_csi1", -+ "dram_ts", -+ "dram_tvd", -+ "dram_tve0", "dram_tve1", -+ "dram_output", -+ "dram_de_fe1", "dram_de_fe0", -+ "dram_de_be0", "dram_de_be1", -+ "dram_de_mp", "dram_ace"; -+ }; -+ -+ ve_clk: clk@01c2013c { -+ #clock-cells = <0>; -+ #reset-cells = <0>; -+ compatible = "allwinner,sun4i-a10-ve-clk"; -+ reg = <0x01c2013c 0x4>; -+ clocks = <&pll4>; -+ clock-output-names = "ve"; -+ }; -+ -+ codec_clk: clk@01c20140 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-codec-clk"; -+ reg = <0x01c20140 0x4>; -+ clocks = <&pll2 SUN4I_A10_PLL2_1X>; -+ clock-output-names = "codec"; -+ }; - }; - - soc@01c00000 { -@@ -656,6 +746,14 @@ - status = "disabled"; - }; - -+ crypto: crypto-engine@01c15000 { -+ compatible = "allwinner,sun4i-a10-crypto"; -+ reg = <0x01c15000 0x1000>; -+ interrupts = <86>; -+ clocks = <&ahb_gates 5>, <&ss_clk>; -+ clock-names = "ahb", "mod"; -+ }; -+ - spi2: spi@01c17000 { - compatible = "allwinner,sun4i-a10-spi"; - reg = <0x01c17000 0x1000>; -@@ -961,6 +1059,19 @@ - status = "disabled"; - }; - -+ codec: codec@01c22c00 { -+ #sound-dai-cells = <0>; -+ compatible = "allwinner,sun4i-a10-codec"; -+ reg = <0x01c22c00 0x40>; -+ interrupts = <30>; -+ clocks = <&apb0_gates 0>, <&codec_clk>; -+ clock-names = "apb", "codec"; -+ dmas = <&dma SUN4I_DMA_NORMAL 19>, -+ <&dma SUN4I_DMA_NORMAL 19>; -+ dma-names = "rx", "tx"; -+ status = "disabled"; -+ }; -+ - sid: eeprom@01c23800 { - compatible = "allwinner,sun4i-a10-sid"; - reg = <0x01c23800 0x10>; ---- a/arch/arm/dts/sun5i-a10s-auxtek-t004.dts -+++ b/arch/arm/dts/sun5i-a10s-auxtek-t004.dts -@@ -86,6 +86,20 @@ - status = "okay"; - }; - -+&i2c0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c0_pins_a>; -+ status = "okay"; -+ -+ axp152: pmic@30 { -+ compatible = "x-powers,axp152"; -+ reg = <0x30>; -+ interrupts = <0>; -+ interrupt-controller; -+ #interrupt-cells = <1>; -+ }; -+}; -+ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_t004>; ---- a/arch/arm/dts/sun5i-a10s-olinuxino-micro.dts -+++ b/arch/arm/dts/sun5i-a10s-olinuxino-micro.dts -@@ -111,7 +111,7 @@ - status = "okay"; - - at24@50 { -- compatible = "at,24c16"; -+ compatible = "atmel,24c16"; - pagesize = <16>; - reg = <0x50>; - read-only; ---- a/arch/arm/dts/sun5i-a13-empire-electronix-d709.dts -+++ b/arch/arm/dts/sun5i-a13-empire-electronix-d709.dts -@@ -123,7 +123,7 @@ - - &mmc0 { - pinctrl-names = "default"; -- pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_inet98fv2>; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_d709>; - vmmc-supply = <®_vcc3v3>; - bus-width = <4>; - cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */ -@@ -131,27 +131,12 @@ - status = "okay"; - }; - --&mmc2 { -- pinctrl-names = "default"; -- pinctrl-0 = <&mmc2_pins_a>; -- vmmc-supply = <®_vcc3v3>; -- bus-width = <8>; -- non-removable; -- status = "okay"; -- -- mmccard: mmccard@0 { -- reg = <0>; -- compatible = "mmc-card"; -- broken-hpi; -- }; --}; -- - &otg_sram { - status = "okay"; - }; - - &pio { -- mmc0_cd_pin_inet98fv2: mmc0_cd_pin@0 { -+ mmc0_cd_pin_d709: mmc0_cd_pin@0 { - allwinner,pins = "PG0"; - allwinner,function = "gpio_in"; - allwinner,drive = ; ---- a/arch/arm/dts/sun5i-a13-inet-98v-rev2.dts -+++ b/arch/arm/dts/sun5i-a13-inet-98v-rev2.dts -@@ -123,21 +123,6 @@ - status = "okay"; - }; - --&mmc2 { -- pinctrl-names = "default"; -- pinctrl-0 = <&mmc2_pins_a>; -- vmmc-supply = <®_vcc3v3>; -- bus-width = <8>; -- non-removable; -- status = "okay"; -- -- mmccard: mmccard@0 { -- reg = <0>; -- compatible = "mmc-card"; -- broken-hpi; -- }; --}; -- - &otg_sram { - status = "okay"; - }; -@@ -201,11 +186,6 @@ - status = "okay"; - }; - --®_usb1_vbus { -- gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */ -- status = "okay"; --}; -- - &uart1 { - pinctrl-names = "default"; - pinctrl-0 = <&uart1_pins_b>; -@@ -221,16 +201,12 @@ - allwinner,pins = "PG12"; - }; - --&usb1_vbus_pin_a { -- allwinner,pins = "PG11"; --}; -- - &usbphy { - pinctrl-names = "default"; - pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; - usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */ - usb0_vbus_det-gpio = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */ - usb0_vbus-supply = <®_usb0_vbus>; -- usb1_vbus-supply = <®_usb1_vbus>; -+ usb1_vbus-supply = <®_ldo3>; - status = "okay"; - }; ---- a/arch/arm/dts/sun5i-a13-utoo-p66.dts -+++ b/arch/arm/dts/sun5i-a13-utoo-p66.dts -@@ -47,11 +47,21 @@ - #include - #include - #include -+#include - - / { - model = "Utoo P66"; - compatible = "utoo,p66", "allwinner,sun5i-a13"; - -+ backlight: backlight { -+ compatible = "pwm-backlight"; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ /* Note levels of 10 / 20% result in backlight off */ -+ brightness-levels = <0 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <6>; -+ /* TODO: backlight uses axp gpio1 as enable pin */ -+ }; -+ - i2c_lcd: i2c@0 { - /* The lcd panel i2c interface is hooked up via gpios */ - compatible = "i2c-gpio"; -@@ -63,6 +73,13 @@ - }; - }; - -+&codec { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&codec_pa_pin>; -+ allwinner,pa-gpios = <&pio 6 3 GPIO_ACTIVE_HIGH>; /* PG3 */ -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; -@@ -158,6 +175,13 @@ - }; - - &pio { -+ codec_pa_pin: codec_pa_pin@0 { -+ allwinner,pins = "PG3"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_p66: mmc0_cd_pin@0 { - allwinner,pins = "PG0"; - allwinner,function = "gpio_in"; -@@ -201,6 +225,12 @@ - }; - }; - -+&pwm { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm0_pins>; -+ status = "okay"; -+}; -+ - ®_dcdc2 { - regulator-always-on; - regulator-min-microvolt = <1000000>; ---- a/arch/arm/dts/sun5i-q8-common.dtsi -+++ b/arch/arm/dts/sun5i-q8-common.dtsi -@@ -41,11 +41,21 @@ - */ - #include "sunxi-q8-common.dtsi" - -+#include -+ - / { - aliases { - serial0 = &uart1; - }; - -+ backlight: backlight { -+ compatible = "pwm-backlight"; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <8>; -+ /* TODO: backlight uses axp gpio1 as enable pin */ -+ }; -+ - chosen { - stdout-path = "serial0:115200n8"; - }; ---- a/arch/arm/dts/sun5i-r8-chip.dts -+++ b/arch/arm/dts/sun5i-r8-chip.dts -@@ -64,6 +64,26 @@ - chosen { - stdout-path = "serial0:115200n8"; - }; -+ -+ wifi_reg_on: wifi_reg_on { -+ compatible = "regulator-fixed"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&chip_wifi_reg_on_pin>; -+ -+ regulator-name = "wifi-reg-on"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ gpio = <&pio 2 19 GPIO_ACTIVE_HIGH>; /* PC19 */ -+ enable-active-high; -+ }; -+}; -+ -+&codec { -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; - }; - - &ehci0 { -@@ -109,10 +129,14 @@ - }; - }; - -+&mmc0_pins_a { -+ allwinner,pull = ; -+}; -+ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>; -- vmmc-supply = <®_vcc3v3>; -+ vmmc-supply = <&wifi_reg_on>; - bus-width = <4>; - non-removable; - status = "okay"; -@@ -134,6 +158,13 @@ - allwinner,pull = ; - }; - -+ chip_wifi_reg_on_pin: chip_wifi_reg_on_pin@0 { -+ allwinner,pins = "PC19"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - chip_id_det_pin: chip_id_det_pin@0 { - allwinner,pins = "PG2"; - allwinner,function = "gpio_in"; -@@ -167,6 +198,20 @@ - regulator-always-on; - }; - -+®_ldo3 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vdd-wifi1"; -+ regulator-always-on; -+}; -+ -+®_ldo4 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vdd-wifi2"; -+ regulator-always-on; -+}; -+ - ®_ldo5 { - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; ---- a/arch/arm/dts/sun5i.dtsi -+++ b/arch/arm/dts/sun5i.dtsi -@@ -44,6 +44,7 @@ - - #include "skeleton.dtsi" - -+#include - #include - #include - -@@ -102,6 +103,15 @@ - clock-output-names = "pll1"; - }; - -+ pll2: clk@01c20008 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun5i-a13-pll2-clk"; -+ reg = <0x01c20008 0x8>; -+ clocks = <&osc24M>; -+ clock-output-names = "pll2-1x", "pll2-2x", -+ "pll2-4x", "pll2-8x"; -+ }; -+ - pll4: clk@01c20018 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-pll1-clk"; -@@ -285,6 +295,14 @@ - clock-output-names = "usb_ohci0", "usb_phy"; - }; - -+ codec_clk: clk@01c20140 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-codec-clk"; -+ reg = <0x01c20140 0x4>; -+ clocks = <&pll2 SUN4I_A10_PLL2_1X>; -+ clock-output-names = "codec"; -+ }; -+ - mbus_clk: clk@01c2015c { - #clock-cells = <0>; - compatible = "allwinner,sun5i-a13-mbus-clk"; -@@ -571,6 +589,19 @@ - status = "disabled"; - }; - -+ codec: codec@01c22c00 { -+ #sound-dai-cells = <0>; -+ compatible = "allwinner,sun4i-a10-codec"; -+ reg = <0x01c22c00 0x40>; -+ interrupts = <30>; -+ clocks = <&apb0_gates 0>, <&codec_clk>; -+ clock-names = "apb", "codec"; -+ dmas = <&dma SUN4I_DMA_NORMAL 19>, -+ <&dma SUN4I_DMA_NORMAL 19>; -+ dma-names = "rx", "tx"; -+ status = "disabled"; -+ }; -+ - sid: eeprom@01c23800 { - compatible = "allwinner,sun4i-a10-sid"; - reg = <0x01c23800 0x10>; ---- a/arch/arm/dts/sun6i-a31-colombus.dts -+++ b/arch/arm/dts/sun6i-a31-colombus.dts -@@ -60,6 +60,16 @@ - chosen { - stdout-path = "serial0:115200n8"; - }; -+ -+ i2c_lcd: i2c@0 { -+ /* The lcd panel i2c interface is hooked up via gpios */ -+ compatible = "i2c-gpio"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c_lcd_pins>; -+ gpios = <&pio 0 23 GPIO_ACTIVE_HIGH>, /* PA23, sda */ -+ <&pio 0 24 GPIO_ACTIVE_HIGH>; /* PA24, scl */ -+ i2c-gpio,delay-us = <5>; -+ }; - }; - - &ehci1 { -@@ -94,6 +104,13 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c2_pins_a>; - status = "okay"; -+ -+ mma8452: mma8452@1d { -+ compatible = "fsl,mma8452"; -+ reg = <0x1d>; -+ interrupt-parent = <&pio>; -+ interrupts = <0 9 IRQ_TYPE_LEVEL_LOW>; /* PA9 */ -+ }; - }; - - &mmc0 { -@@ -124,6 +141,13 @@ - allwinner,drive = ; - allwinner,pull = ; - }; -+ -+ i2c_lcd_pins: i2c_lcd_pin@0 { -+ allwinner,pins = "PA23", "PA24"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - - ®_usb2_vbus { ---- a/arch/arm/dts/sun6i-a31-hummingbird.dts -+++ b/arch/arm/dts/sun6i-a31-hummingbird.dts -@@ -54,6 +54,8 @@ - compatible = "merrii,a31-hummingbird", "allwinner,sun6i-a31"; - - aliases { -+ rtc0 = &pcf8563; -+ rtc1 = &rtc; - serial0 = &uart0; - }; - -@@ -67,13 +69,17 @@ - }; - }; - -+&cpu0 { -+ cpu-supply = <®_dcdc3>; -+}; -+ - &ehci0 { - status = "okay"; - }; - - &gmac { - pinctrl-names = "default"; -- pinctrl-0 = <&gmac_pins_rgmii_a>; -+ pinctrl-0 = <&gmac_pins_rgmii_a>, <&gmac_phy_reset_pin_hummingbird>; - phy = <&phy1>; - phy-mode = "rgmii"; - snps,reset-gpio = <&pio 0 21 GPIO_ACTIVE_HIGH>; -@@ -119,7 +125,7 @@ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_hummingbird>; -- vmmc-supply = <&vcc_3v0>; -+ vmmc-supply = <®_dcdc1>; - bus-width = <4>; - cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */ - cd-inverted; -@@ -134,7 +140,7 @@ - &mmc1 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc1_pins_a>, <&wifi_reset_pin_hummingbird>; -- vmmc-supply = <&vcc_wifi>; -+ vmmc-supply = <®_aldo1>; - mmc-pwrseq = <&wifi_pwrseq>; - bus-width = <4>; - non-removable; -@@ -146,6 +152,13 @@ - }; - - &pio { -+ gmac_phy_reset_pin_hummingbird: gmac_phy_reset_pin@0 { -+ allwinner,pins = "PA21"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_hummingbird: mmc0_cd_pin@0 { - allwinner,pins = "PA8"; - allwinner,function = "gpio_in"; -@@ -164,70 +177,69 @@ - &p2wi { - status = "okay"; - -- axp221: pmic@68 { -+ axp22x: pmic@68 { - compatible = "x-powers,axp221"; - reg = <0x68>; - interrupt-parent = <&nmi_intc>; - interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -- interrupt-controller; -- #interrupt-cells = <1>; -- dcdc1-supply = <&vcc_3v0>; -- dcdc5-supply = <&vcc_dram>; -- -- regulators { -- x-powers,dcdc-freq = <3000>; -- -- vcc_3v0: dcdc1 { -- regulator-always-on; -- regulator-min-microvolt = <3000000>; -- regulator-max-microvolt = <3000000>; -- regulator-name = "vcc-3v0"; -- }; -- -- vdd_cpu: dcdc2 { -- regulator-always-on; -- regulator-min-microvolt = <700000>; -- regulator-max-microvolt = <1320000>; -- regulator-name = "vdd-cpu"; -- }; -- -- vdd_gpu: dcdc3 { -- regulator-always-on; -- regulator-min-microvolt = <700000>; -- regulator-max-microvolt = <1320000>; -- regulator-name = "vdd-gpu"; -- }; -- -- vdd_sys_dll: dcdc4 { -- regulator-always-on; -- regulator-min-microvolt = <1100000>; -- regulator-max-microvolt = <1100000>; -- regulator-name = "vdd-sys-dll"; -- }; -- -- vcc_dram: dcdc5 { -- regulator-always-on; -- regulator-min-microvolt = <1500000>; -- regulator-max-microvolt = <1500000>; -- regulator-name = "vcc-dram"; -- }; -- -- vcc_wifi: aldo1 { -- regulator-min-microvolt = <3300000>; -- regulator-max-microvolt = <3300000>; -- regulator-name = "vcc_wifi"; -- }; -- -- avcc: aldo3 { -- regulator-always-on; -- regulator-min-microvolt = <3000000>; -- regulator-max-microvolt = <3000000>; -- regulator-name = "avcc"; -- }; -- }; - }; - }; - -+#include "axp22x.dtsi" -+ -+®_aldo1 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-wifi"; -+}; -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "avcc"; -+}; -+ -+®_dc5ldo { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-gpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc4 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-sys-dll"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ - ®_usb1_vbus { - gpio = <&pio 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */ - status = "okay"; ---- a/arch/arm/dts/sun6i-a31.dtsi -+++ b/arch/arm/dts/sun6i-a31.dtsi -@@ -61,7 +61,7 @@ - #size-cells = <1>; - ranges; - -- framebuffer@0 { -+ simplefb_hdmi: framebuffer@0 { - compatible = "allwinner,simple-framebuffer", - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0-hdmi"; -@@ -69,7 +69,7 @@ - status = "disabled"; - }; - -- framebuffer@1 { -+ simplefb_lcd: framebuffer@1 { - compatible = "allwinner,simple-framebuffer", - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0"; -@@ -252,6 +252,20 @@ - compatible = "allwinner,sun6i-a31-ahb1-gates-clk"; - reg = <0x01c20060 0x8>; - clocks = <&ahb1>; -+ clock-indices = <1>, <5>, -+ <6>, <8>, <9>, -+ <10>, <11>, <12>, -+ <13>, <14>, -+ <17>, <18>, <19>, -+ <20>, <21>, <22>, -+ <23>, <24>, <26>, -+ <27>, <29>, -+ <30>, <31>, <32>, -+ <36>, <37>, <40>, -+ <43>, <44>, <45>, -+ <46>, <47>, <50>, -+ <52>, <55>, <56>, -+ <57>, <58>; - clock-output-names = "ahb1_mipidsi", "ahb1_ss", - "ahb1_dma", "ahb1_mmc0", "ahb1_mmc1", - "ahb1_mmc2", "ahb1_mmc3", "ahb1_nand1", -@@ -281,6 +295,9 @@ - compatible = "allwinner,sun6i-a31-apb1-gates-clk"; - reg = <0x01c20068 0x4>; - clocks = <&apb1>; -+ clock-indices = <0>, <4>, -+ <5>, <12>, -+ <13>; - clock-output-names = "apb1_codec", "apb1_digital_mic", - "apb1_pio", "apb1_daudio0", - "apb1_daudio1"; -@@ -299,6 +316,10 @@ - compatible = "allwinner,sun6i-a31-apb2-gates-clk"; - reg = <0x01c2006c 0x4>; - clocks = <&apb2>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, <16>, -+ <17>, <18>, <19>, -+ <20>, <21>; - clock-output-names = "apb2_i2c0", "apb2_i2c1", - "apb2_i2c2", "apb2_i2c3", - "apb2_uart0", "apb2_uart1", -@@ -346,6 +367,14 @@ - "mmc3_sample"; - }; - -+ ss_clk: clk@01c2009c { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-mod0-clk"; -+ reg = <0x01c2009c 0x4>; -+ clocks = <&osc24M>, <&pll6 0>; -+ clock-output-names = "ss"; -+ }; -+ - spi0_clk: clk@01c200a0 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-mod0-clk"; -@@ -384,6 +413,9 @@ - compatible = "allwinner,sun6i-a31-usb-clk"; - reg = <0x01c200cc 0x4>; - clocks = <&osc24M>; -+ clock-indices = <8>, <9>, <10>, -+ <16>, <17>, -+ <18>; - clock-output-names = "usb_phy0", "usb_phy1", "usb_phy2", - "usb_ohci0", "usb_ohci1", - "usb_ohci2"; -@@ -684,6 +716,16 @@ - allwinner,pull = ; - }; - -+ mmc3_8bit_emmc_pins: mmc3@1 { -+ allwinner,pins = "PC6", "PC7", "PC8", "PC9", -+ "PC10", "PC11", "PC12", -+ "PC13", "PC14", "PC15", -+ "PC24"; -+ allwinner,function = "mmc3"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - gmac_pins_mii_a: gmac_mii@0 { - allwinner,pins = "PA0", "PA1", "PA2", "PA3", - "PA8", "PA9", "PA11", -@@ -761,6 +803,13 @@ - reg = <0x01c20ca0 0x20>; - }; - -+ lradc: lradc@01c22800 { -+ compatible = "allwinner,sun4i-a10-lradc-keys"; -+ reg = <0x01c22800 0x100>; -+ interrupts = ; -+ status = "disabled"; -+ }; -+ - rtp: rtp@01c25000 { - compatible = "allwinner,sun6i-a31-ts"; - reg = <0x01c25000 0x100>; -@@ -907,6 +956,16 @@ - #size-cells = <0>; - }; - -+ crypto: crypto-engine@01c15000 { -+ compatible = "allwinner,sun4i-a10-crypto"; -+ reg = <0x01c15000 0x1000>; -+ interrupts = ; -+ clocks = <&ahb1_gates 5>, <&ss_clk>; -+ clock-names = "ahb", "mod"; -+ resets = <&ahb1_rst 5>; -+ reset-names = "ahb"; -+ }; -+ - timer@01c60000 { - compatible = "allwinner,sun6i-a31-hstimer", - "allwinner,sun7i-a20-hstimer"; -@@ -1068,7 +1127,7 @@ - resets = <&apb0_rst 0>; - gpio-controller; - interrupt-controller; -- #interrupt-cells = <2>; -+ #interrupt-cells = <3>; - #size-cells = <0>; - #gpio-cells = <3>; - ---- a/arch/arm/dts/sun6i-a31s-primo81.dts -+++ b/arch/arm/dts/sun6i-a31s-primo81.dts -@@ -1,16 +1,57 @@ - /* -- * Copyright 2015 Hans de Goede -+ * Copyright 2014 Siarhei Siamashka -+ * Copyright 2015 Karsten Merker -+ * Copyright 2015 Chen-Yu Tsai - * -- * Minimal dts file for the MSI Primo81 for u-boot only -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. - * -- * SPDX-License-Identifier: GPL-2.0+ or X11 -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file 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. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. - */ - - /dts-v1/; - #include "sun6i-a31s.dtsi" -+#include "sunxi-common-regulators.dtsi" -+ -+#include -+#include -+#include - - / { -- model = "MSI Primo81"; -+ model = "MSI Primo81 tablet"; - compatible = "msi,primo81", "allwinner,sun6i-a31s"; - - aliases { -@@ -22,8 +63,202 @@ - }; - }; - --&uart0 { -+&cpu0 { -+ cpu-supply = <®_dcdc3>; -+}; -+ -+&ehci0 { -+ /* rtl8188etv wifi is connected here */ -+ status = "okay"; -+}; -+ -+&i2c0 { -+ /* pull-ups and device VDDIO use AXP221 DLDO3 */ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c0_pins_a>; -+ status = "failed"; -+}; -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+ -+ ctp@5d { -+ pinctrl-names = "default"; -+ pinctrl-0 = <>911_int_primo81>; -+ compatible = "goodix,gt911"; -+ reg = <0x5d>; -+ interrupt-parent = <&pio>; -+ interrupts = <0 3 IRQ_TYPE_LEVEL_HIGH>; /* PA3 */ -+ touchscreen-swapped-x-y; -+ }; -+}; -+ -+&i2c2 { - pinctrl-names = "default"; -- pinctrl-0 = <&uart0_pins_a>; -+ pinctrl-0 = <&i2c2_pins_a>; -+ status = "okay"; -+ -+ accelerometer@1c { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mma8452_int_primo81>; -+ compatible = "fsl,mma8452"; -+ reg = <0x1c>; -+ interrupt-parent = <&pio>; -+ interrupts = <0 9 IRQ_TYPE_LEVEL_HIGH>; /* PA9 */ -+ #io-channel-cells = <1>; -+ }; -+}; -+ -+&lradc { -+ vref-supply = <®_aldo3>; -+ status = "okay"; -+ -+ button@158 { -+ label = "Volume Up"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <158730>; -+ }; -+ -+ button@349 { -+ label = "Volume Down"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <349206>; -+ }; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_primo81>; -+ vmmc-supply = <®_dcdc1>; -+ bus-width = <4>; -+ cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&pio { -+ gt911_int_primo81: gt911_int_pin@0 { -+ allwinner,pins = "PA3"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ mma8452_int_primo81: mma8452_int_pin@0 { -+ allwinner,pins = "PA9"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ mmc0_cd_pin_primo81: mmc0_cd_pin@0 { -+ allwinner,pins = "PA8"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+&p2wi { -+ status = "okay"; -+ -+ axp22x: pmic@68 { -+ compatible = "x-powers,axp221"; -+ reg = <0x68>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+#include "axp22x.dtsi" -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "avcc"; -+}; -+ -+®_dc1sw { -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-lcd"; -+}; -+ -+®_dc5ldo { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpus"; /* This is an educated guess */ -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-gpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc4 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-sys-dll"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ -+®_dldo1 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-wifi"; -+}; -+ -+®_dldo3 { -+ regulator-min-microvolt = <2800000>; -+ regulator-max-microvolt = <2800000>; -+ regulator-name = "vddio-csi"; -+}; -+ -+®_eldo3 { -+ regulator-min-microvolt = <1080000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-mipi-bridge"; -+}; -+ -+&simplefb_lcd { -+ vcc-lcd-supply = <®_dc1sw>; -+ vdd-mipi-bridge-supply = <®_eldo3>; -+}; -+ -+&usb_otg { -+ /* otg support requires support for AXP221 usb-power-supply and GPIO */ -+ dr_mode = "host"; -+ status = "okay"; -+}; -+ -+&usbphy { -+ usb1_vbus-supply = <®_dldo1>; - status = "okay"; - }; ---- /dev/null -+++ b/arch/arm/dts/sun6i-a31s-sina31s-core.dtsi -@@ -0,0 +1,142 @@ -+/* -+ * Copyright 2015 Chen-Yu Tsai -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file 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. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun6i-a31s.dtsi" -+#include "sunxi-common-regulators.dtsi" -+ -+#include -+#include -+ -+/ { -+ model = "Sinlinx SinA31s Core Board"; -+ compatible = "sinlinx,sina31s", "allwinner,sun6i-a31s"; -+ -+ aliases { -+ serial0 = &uart0; -+ }; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc3>; -+}; -+ -+/* eMMC on core board */ -+&mmc3 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc3_8bit_emmc_pins>; -+ vmmc-supply = <®_dcdc1>; -+ vqmmc-supply = <®_dcdc1>; -+ bus-width = <8>; -+ non-removable; -+ cap-mmc-hw-reset; -+ status = "okay"; -+}; -+ -+/* AXP221s PMIC on core board */ -+&p2wi { -+ status = "okay"; -+ -+ axp22x: pmic@68 { -+ compatible = "x-powers,axp221"; -+ reg = <0x68>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+#include "axp22x.dtsi" -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "avcc"; -+}; -+ -+®_dc5ldo { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-gpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc4 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-sys-dll"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ -+/* UART0 pads available on core board */ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ ---- /dev/null -+++ b/arch/arm/dts/sun6i-a31s-sina31s.dts -@@ -0,0 +1,153 @@ -+/* -+ * Copyright 2015 Chen-Yu Tsai -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file 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. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/* The SinA31s development board has the SinA31s core board soldered on */ -+#include "sun6i-a31s-sina31s-core.dtsi" -+ -+#include -+ -+/ { -+ model = "Sinlinx SinA31s Development Board"; -+ compatible = "sinlinx,sina31s-sdk", "allwinner,sun6i-a31s"; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&led_pin_sina31s>; -+ -+ status { -+ label = "sina31s:status:usr"; -+ gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>; /* PH13 */ -+ }; -+ }; -+}; -+ -+&ehci0 { -+ /* USB 2.0 4 port hub IC */ -+ status = "okay"; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&gmac { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&gmac_pins_mii_a>; -+ phy = <&phy1>; -+ phy-mode = "mii"; -+ phy-supply = <®_dldo1>; -+ status = "okay"; -+ -+ phy1: ethernet-phy@1 { -+ reg = <1>; -+ }; -+}; -+ -+&ir { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&ir_pins_a>; -+ status = "okay"; -+}; -+ -+&lradc { -+ vref-supply = <®_aldo3>; -+ status = "okay"; -+ -+ button@158 { -+ label = "Volume Up"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <158730>; -+ }; -+ -+ button@349 { -+ label = "Volume Down"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <349206>; -+ }; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_sina31s>; -+ vmmc-supply = <®_dcdc1>; -+ bus-width = <4>; -+ cd-gpios = <&pio 0 4 GPIO_ACTIVE_HIGH>; /* PA4 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+&pio { -+ led_pin_sina31s: led_pin@0 { -+ allwinner,pins = "PH13"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ mmc0_cd_pin_sina31s: mmc0_cd_pin@0 { -+ allwinner,pins = "PA4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_dldo1 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-gmac-phy"; -+}; -+ -+&usbphy { -+ status = "okay"; -+}; ---- /dev/null -+++ b/arch/arm/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts -@@ -0,0 +1,205 @@ -+/* -+ * Copyright 2015 Lawrence Yu -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file 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. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun6i-a31s.dtsi" -+#include "sunxi-common-regulators.dtsi" -+ -+#include -+#include -+ -+/ { -+ model = "Yones TopTech BS1078 v2 Tablet"; -+ compatible = "yones-toptech,bs1078-v2", "allwinner,sun6i-a31s"; -+ -+ aliases { -+ serial0 = &uart0; -+ i2c1 = &i2c1; -+ i2c2 = &i2c2; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+}; -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+}; -+ -+&i2c2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c2_pins_a>; -+ status = "okay"; -+}; -+ -+&ehci0 { -+ status = "okay"; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&ohci0 { -+ status = "okay"; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+&pio { -+ mmc0_cd_pin_bs1078v2: mmc0_cd_pin@0 { -+ allwinner,pins = "PA8"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bs1078v2>; -+ vmmc-supply = <®_vcc3v0>; -+ bus-width = <4>; -+ cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&mmc0_pins_a { -+ allwinner,pull = ; -+}; -+ -+&p2wi { -+ status = "okay"; -+ -+ axp22x: pmic@68 { -+ compatible = "x-powers,axp221"; -+ reg = <0x68>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+#include "axp22x.dtsi" -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "avcc"; -+}; -+ -+®_dc1sw { -+ regulator-name = "vcc-lcd-usb2"; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+}; -+ -+®_dc5ldo { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-gpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc4 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-sys-dll"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ -+®_dldo1 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-wifi"; -+}; -+ -+/* Voltage source for I2C pullup resistors for I2C Bus 0 */ -+®_dldo3 { -+ regulator-min-microvolt = <2800000>; -+ regulator-max-microvolt = <2800000>; -+ regulator-name = "vddio-csi"; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ -+&usbphy { -+ usb1_vbus-supply = <®_dldo1>; -+ usb2_vbus-supply = <®_dc1sw>; -+ status = "okay"; -+}; ---- a/arch/arm/dts/sun7i-a20-bananapi.dts -+++ b/arch/arm/dts/sun7i-a20-bananapi.dts -@@ -92,6 +92,24 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+ operating-points = < -+ /* kHz uV */ -+ 960000 1400000 -+ 912000 1400000 -+ 864000 1350000 -+ 720000 1250000 -+ 528000 1150000 -+ 312000 1100000 -+ 144000 1050000 -+ >; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -119,13 +137,9 @@ - status = "okay"; - - axp209: pmic@34 { -- compatible = "x-powers,axp209"; - reg = <0x34>; - interrupt-parent = <&nmi_intc>; - interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -- -- interrupt-controller; -- #interrupt-cells = <1>; - }; - }; - -@@ -159,7 +173,18 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_bananapi: mmc0_cd_pin@0 { - allwinner,pins = "PH10"; - allwinner,function = "gpio_in"; -@@ -182,6 +207,37 @@ - }; - }; - -+#include "axp209.dtsi" -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ -+®_usb0_vbus { -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -216,7 +272,21 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ -+&usb_power_supply { -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_power-supply = <&usb_power_supply>; -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-cubieboard2.dts -+++ b/arch/arm/dts/sun7i-a20-cubieboard2.dts -@@ -84,6 +84,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; -@@ -150,6 +154,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - led_pins_cubieboard2: led_pins@0 { - allwinner,pins = "PH20", "PH21"; -@@ -157,12 +165,24 @@ - allwinner,drive = ; - allwinner,pull = ; - }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - - ®_ahci_5v { - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - #include "axp209.dtsi" - - ®_dcdc2 { -@@ -205,6 +225,9 @@ - }; - - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-cubietruck.dts -+++ b/arch/arm/dts/sun7i-a20-cubietruck.dts -@@ -101,6 +101,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; ---- /dev/null -+++ b/arch/arm/dts/sun7i-a20-icnova-swac.dts -@@ -0,0 +1,169 @@ -+/* -+ * Copyright 2015 Stefan Roese -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file 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. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun7i-a20.dtsi" -+#include "sunxi-common-regulators.dtsi" -+ -+#include -+#include -+#include -+ -+/ { -+ model = "ICnova-A20 SWAC"; -+ compatible = "swac,icnova-a20-swac", "incircuit,icnova-a20", "allwinner,sun7i-a20"; -+ -+ aliases { -+ serial0 = &uart0; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+}; -+ -+&ehci0 { -+ status = "okay"; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&gmac { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&gmac_pins_mii_a>; -+ phy = <&phy1>; -+ phy-mode = "mii"; -+ status = "okay"; -+ -+ phy1: ethernet-phy@1 { -+ reg = <1>; -+ }; -+}; -+ -+&i2c0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c0_pins_a>; -+ status = "okay"; -+ -+ axp209: pmic@34 { -+ reg = <0x34>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>; -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ cd-gpios = <&pio 8 5 GPIO_ACTIVE_HIGH>; /* PI5 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&ohci0 { -+ status = "okay"; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+#include "axp209.dtsi" -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ -+®_usb1_vbus { -+ status = "okay"; -+}; -+ -+®_usb2_vbus { -+ status = "okay"; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ -+&usbphy { -+ usb1_vbus-supply = <®_usb1_vbus>; -+ usb2_vbus-supply = <®_usb2_vbus>; -+ status = "okay"; -+}; ---- /dev/null -+++ b/arch/arm/dts/sun7i-a20-itead-ibox.dts -@@ -0,0 +1,125 @@ -+/* -+ * Copyright 2015 - Marcus Cooper -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file 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. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun7i-a20.dtsi" -+#include "sunxi-itead-core-common.dtsi" -+ -+/ { -+ model = "Itead Ibox A20"; -+ compatible = "itead,itead-ibox-a20", "allwinner,sun7i-a20"; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&led_pins_itead_core>; -+ -+ green { -+ label = "itead_core:green:usr"; -+ gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ }; -+ -+ blue { -+ label = "itead_core:blue:usr"; -+ gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ }; -+ }; -+}; -+ -+&ahci { -+ target-supply = <®_ahci_5v>; -+ status = "okay"; -+}; -+ -+&codec { -+ status = "okay"; -+}; -+ -+&gmac { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&gmac_pins_mii_a>; -+ phy = <&phy1>; -+ phy-mode = "mii"; -+ status = "okay"; -+ -+ phy1: ethernet-phy@1 { -+ reg = <1>; -+ }; -+}; -+ -+&i2c0 { -+ axp209: pmic@34 { -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+&ir0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&ir0_rx_pins_a>; -+ status = "okay"; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>; -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&pio { -+ led_pins_itead_core: led_pins@0 { -+ allwinner,pins = "PH20","PH21"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_ahci_5v { -+ status = "okay"; -+}; ---- a/arch/arm/dts/sun7i-a20-lamobo-r1.dts -+++ b/arch/arm/dts/sun7i-a20-lamobo-r1.dts -@@ -97,16 +97,6 @@ - - &cpu0 { - cpu-supply = <®_dcdc2>; -- operating-points = < -- /* kHz uV */ -- 960000 1400000 -- 912000 1400000 -- 864000 1350000 -- 720000 1250000 -- 528000 1150000 -- 312000 1100000 -- 144000 1050000 -- >; - }; - - &ehci0 { ---- a/arch/arm/dts/sun7i-a20-mk808c.dts -+++ b/arch/arm/dts/sun7i-a20-mk808c.dts -@@ -53,6 +53,7 @@ - - #include - #include -+#include - - / { - model = "mk808c"; -@@ -68,6 +69,10 @@ - }; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -121,6 +126,30 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ -+&pio { -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { -+ allwinner,pins = "PH5"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_usb0_vbus { -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -141,7 +170,17 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; -+ usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-olimex-som-evb.dts -+++ b/arch/arm/dts/sun7i-a20-olimex-som-evb.dts -@@ -1,5 +1,6 @@ - /* - * Copyright 2015 - Marcus Cooper -+ * Copyright 2015 - Karsten Merker - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual -@@ -45,6 +46,7 @@ - #include "sunxi-common-regulators.dtsi" - - #include -+#include - #include - #include - -@@ -71,14 +73,6 @@ - default-state = "on"; - }; - }; -- -- reg_axp_ipsout: axp_ipsout { -- compatible = "regulator-fixed"; -- regulator-name = "axp-ipsout"; -- regulator-min-microvolt = <5000000>; -- regulator-max-microvolt = <5000000>; -- regulator-always-on; -- }; - }; - - &ahci { -@@ -94,6 +88,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &gmac { - pinctrl-names = "default"; - pinctrl-0 = <&gmac_pins_rgmii_a>; -@@ -118,10 +116,58 @@ - }; - }; - --&i2c1 { -- pinctrl-names = "default"; -- pinctrl-0 = <&i2c1_pins_a>; -+&lradc { -+ vref-supply = <®_vcc3v0>; - status = "okay"; -+ -+ button@190 { -+ label = "Volume Up"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <190000>; -+ }; -+ -+ button@390 { -+ label = "Volume Down"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <390000>; -+ }; -+ -+ button@600 { -+ label = "Menu"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <600000>; -+ }; -+ -+ button@800 { -+ label = "Search"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <800000>; -+ }; -+ -+ button@980 { -+ label = "Home"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <980000>; -+ }; -+ -+ button@1180 { -+ label = "Esc"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <1180000>; -+ }; -+ -+ button@1400 { -+ label = "Enter"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <1400000>; -+ }; - }; - - &mmc0 { -@@ -134,6 +180,16 @@ - status = "okay"; - }; - -+&mmc3 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc3_pins_a>, <&mmc3_cd_pin_olimex_som_evb>; -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ cd-gpios = <&pio 7 0 GPIO_ACTIVE_HIGH>; /* PH0 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ - &ohci0 { - status = "okay"; - }; -@@ -161,15 +217,22 @@ - allwinner,pull = ; - }; - -+ mmc3_cd_pin_olimex_som_evb: mmc3_cd_pin@0 { -+ allwinner,pins = "PH0"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - usb0_id_detect_pin: usb0_id_detect_pin@0 { -- allwinner,pins = "PH04"; -+ allwinner,pins = "PH4"; - allwinner,function = "gpio_in"; - allwinner,drive = ; - allwinner,pull = ; - }; - - usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { -- allwinner,pins = "PH05"; -+ allwinner,pins = "PH5"; - allwinner,function = "gpio_in"; - allwinner,drive = ; - allwinner,pull = ; -@@ -187,7 +250,7 @@ - ®_dcdc2 { - regulator-always-on; - regulator-min-microvolt = <1000000>; -- regulator-max-microvolt = <1425000>; -+ regulator-max-microvolt = <1400000>; - regulator-name = "vdd-cpu"; - }; - -@@ -235,8 +298,8 @@ - &usbphy { - pinctrl-names = "default"; - pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; -- usb0_id_det-gpios = <&pio 7 04 GPIO_ACTIVE_HIGH>; /* PH04 */ -- usb0_vbus_det-gpios = <&pio 7 05 GPIO_ACTIVE_HIGH>; /* PH05 */ -+ usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH04 */ -+ usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH05 */ - usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; ---- a/arch/arm/dts/sun7i-a20-olinuxino-lime.dts -+++ b/arch/arm/dts/sun7i-a20-olinuxino-lime.dts -@@ -117,6 +117,18 @@ - }; - }; - -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+ -+ eeprom: eeprom@50 { -+ compatible = "atmel,24c16"; -+ reg = <0x50>; -+ pagesize = <16>; -+ }; -+}; -+ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>; ---- a/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts -+++ b/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts -@@ -170,6 +170,12 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins_a>; - status = "okay"; -+ -+ eeprom: eeprom@50 { -+ compatible = "atmel,24c16"; -+ reg = <0x50>; -+ pagesize = <16>; -+ }; - }; - - &mmc0 { -@@ -190,6 +196,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - ahci_pwr_pin_olinuxinolime: ahci_pwr_pin@1 { - allwinner,pins = "PC3"; -@@ -204,6 +214,27 @@ - allwinner,drive = ; - allwinner,pull = ; - }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { -+ allwinner,pins = "PH5"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_vbus_pin_lime2: usb0_vbus_pin@0 { -+ allwinner,pins = "PC17"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - - ®_ahci_5v { -@@ -212,6 +243,12 @@ - status = "okay"; - }; - -+®_usb0_vbus { -+ pinctrl-0 = <&usb0_vbus_pin_lime2>; -+ gpio = <&pio 2 17 GPIO_ACTIVE_HIGH>; -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -226,7 +263,17 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-olinuxino-micro.dts -+++ b/arch/arm/dts/sun7i-a20-olinuxino-micro.dts -@@ -125,6 +125,12 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins_a>; - status = "okay"; -+ -+ eeprom: eeprom@50 { -+ compatible = "atmel,24c16"; -+ reg = <0x50>; -+ pagesize = <16>; -+ }; - }; - - &i2c2 { ---- a/arch/arm/dts/sun7i-a20-orangepi-mini.dts -+++ b/arch/arm/dts/sun7i-a20-orangepi-mini.dts -@@ -95,6 +95,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -156,7 +160,18 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_orangepi: mmc0_cd_pin@0 { - allwinner,pins = "PH10"; - allwinner,function = "gpio_in"; -@@ -225,6 +240,10 @@ - regulator-name = "avcc"; - }; - -+®_usb0_vbus { -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - pinctrl-0 = <&usb1_vbus_pin_bananapro>; - gpio = <&pio 7 26 GPIO_ACTIVE_HIGH>; /* PH26 */ -@@ -243,7 +262,21 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ -+&usb_power_supply { -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_power-supply = <&usb_power_supply>; -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-orangepi.dts -+++ b/arch/arm/dts/sun7i-a20-orangepi.dts -@@ -141,7 +141,18 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_orangepi: mmc0_cd_pin@0 { - allwinner,pins = "PH10"; - allwinner,function = "gpio_in"; -@@ -203,6 +214,10 @@ - regulator-name = "avcc"; - }; - -+®_usb0_vbus { -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - pinctrl-0 = <&usb1_vbus_pin_bananapro>; - gpio = <&pio 7 26 GPIO_ACTIVE_HIGH>; /* PH26 */ -@@ -221,7 +236,21 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ -+&usb_power_supply { -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_power-supply = <&usb_power_supply>; -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-pcduino3-nano.dts -+++ b/arch/arm/dts/sun7i-a20-pcduino3-nano.dts -@@ -82,6 +82,14 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -108,13 +116,9 @@ - status = "okay"; - - axp209: pmic@34 { -- compatible = "x-powers,axp209"; - reg = <0x34>; - interrupt-parent = <&nmi_intc>; - interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -- -- interrupt-controller; -- #interrupt-cells = <1>; - }; - }; - -@@ -142,6 +146,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - ahci_pwr_pin_pcduino3_nano: ahci_pwr_pin@0 { - allwinner,pins = "PH2"; -@@ -157,8 +165,15 @@ - allwinner,pull = ; - }; - -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - usb1_vbus_pin_pcduino3_nano: usb1_vbus_pin@0 { -- allwinner,pins = "PH11"; -+ allwinner,pins = "PD2"; - allwinner,function = "gpio_out"; - allwinner,drive = ; - allwinner,pull = ; -@@ -171,13 +186,37 @@ - status = "okay"; - }; - --®_usb1_vbus { -- pinctrl-0 = <&usb1_vbus_pin_pcduino3_nano>; -- gpio = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */ -- status = "okay"; -+#include "axp209.dtsi" -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-pll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; - }; - --®_usb2_vbus { -+/* A single regulator (U24) powers both USB host ports. */ -+®_usb1_vbus { -+ pinctrl-0 = <&usb1_vbus_pin_pcduino3_nano>; -+ gpio = <&pio 3 2 GPIO_ACTIVE_HIGH>; /* PD2 */ - status = "okay"; - }; - -@@ -187,8 +226,16 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ - usb1_vbus-supply = <®_usb1_vbus>; -- usb2_vbus-supply = <®_usb2_vbus>; -+ usb2_vbus-supply = <®_usb1_vbus>; - status = "okay"; - }; ---- a/arch/arm/dts/sun7i-a20-pcduino3.dts -+++ b/arch/arm/dts/sun7i-a20-pcduino3.dts -@@ -111,6 +111,14 @@ - allwinner,pins = "PH2"; - }; - -+&codec { -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -137,16 +145,14 @@ - status = "okay"; - - axp209: pmic@34 { -- compatible = "x-powers,axp209"; - reg = <0x34>; - interrupt-parent = <&nmi_intc>; - interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -- -- interrupt-controller; -- #interrupt-cells = <1>; - }; - }; - -+#include "axp209.dtsi" -+ - &ir0 { - pinctrl-names = "default"; - pinctrl-0 = <&ir0_rx_pins_a>; -@@ -171,6 +177,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - led_pins_pcduino3: led_pins@0 { - allwinner,pins = "PH15", "PH16"; -@@ -185,6 +195,13 @@ - allwinner,drive = ; - allwinner,pull = ; - }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - - ®_ahci_5v { -@@ -192,6 +209,31 @@ - status = "okay"; - }; - -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-pll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -206,7 +248,15 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-wexler-tab7200.dts -+++ b/arch/arm/dts/sun7i-a20-wexler-tab7200.dts -@@ -48,6 +48,7 @@ - #include - #include - #include -+#include - - / { - model = "Wexler TAB7200"; -@@ -57,11 +58,28 @@ - serial0 = &uart0; - }; - -+ backlight { -+ compatible = "pwm-backlight"; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <8>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&bl_enable_pin>; -+ enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ -+ }; -+ - chosen { - stdout-path = "serial0:115200n8"; - }; - }; - -+&codec { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&codec_pa_pin>; -+ allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */ -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; -@@ -86,6 +104,8 @@ - }; - }; - -+#include "axp209.dtsi" -+ - &i2c1 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins_a>; -@@ -96,6 +116,18 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c2_pins_a>; - status = "okay"; -+ -+ gt911: touchscreen@5d { -+ compatible = "goodix,gt911"; -+ reg = <0x5d>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; /* EINT21 (PH21) */ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&ts_reset_pin>; -+ irq-gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; /* INT (PH21) */ -+ reset-gpios = <&pio 1 13 GPIO_ACTIVE_HIGH>; /* RST (PB13) */ -+ touchscreen-swapped-x-y; -+ }; - }; - - &lradc { -@@ -135,7 +167,45 @@ - status = "okay"; - }; - --#include "axp209.dtsi" -+&otg_sram { -+ status = "okay"; -+}; -+ -+&pio { -+ bl_enable_pin: bl_enable_pin@0 { -+ allwinner,pins = "PH7"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ codec_pa_pin: codec_pa_pin@0 { -+ allwinner,pins = "PH15"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ ts_reset_pin: ts_reset_pin@0 { -+ allwinner,pins = "PB13"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+&pwm { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm0_pins_a>; -+ status = "okay"; -+}; - - ®_dcdc2 { - regulator-always-on; -@@ -162,6 +232,10 @@ - regulator-name = "avcc"; - }; - -+®_usb0_vbus { -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -176,7 +250,21 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ -+&usb_power_supply { -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_power-supply = <&usb_power_supply>; -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts -+++ b/arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts -@@ -1,13 +1,52 @@ - /* -- * Copyright 2015 Hans de Goede -+ * Copyright 2015 Jelle de Jong - * -- * Minimal dts file for the Wits Pro A20 DKT for u-boot only -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. - * -- * SPDX-License-Identifier: GPL-2.0+ or X11 -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file 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. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. - */ - - /dts-v1/; - #include "sun7i-a20.dtsi" -+#include "sunxi-common-regulators.dtsi" -+ -+#include -+#include -+#include - - / { - model = "Wits Pro A20 DKT"; -@@ -20,6 +59,17 @@ - chosen { - stdout-path = "serial0:115200n8"; - }; -+ -+ mmc3_pwrseq: mmc3_pwrseq { -+ compatible = "mmc-pwrseq-simple"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&vmmc3_pin_ap6xxx_wl_regon>; -+ reset-gpios = <&pio 7 9 GPIO_ACTIVE_LOW>; /* PH9 WIFI_EN */ -+ }; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; - }; - - &ehci0 { -@@ -42,6 +92,60 @@ - }; - }; - -+&i2c0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c0_pins_a>; -+ status = "okay"; -+ -+ axp209: pmic@34 { -+ reg = <0x34>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+}; -+ -+&i2c2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c2_pins_a>; -+ status = "okay"; -+}; -+ -+#include "axp209.dtsi" -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>; -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&mmc3 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc3_pins_a>; -+ vmmc-supply = <®_vcc3v3>; -+ mmc-pwrseq = <&mmc3_pwrseq>; -+ bus-width = <4>; -+ non-removable; -+ status = "okay"; -+ -+ brcmf: bcrmf@1 { -+ reg = <1>; -+ compatible = "brcm,bcm4329-fmac"; -+ interrupt-parent = <&pio>; -+ interrupts = <7 10 IRQ_TYPE_LEVEL_LOW>; /* PH10 / EINT10 */ -+ interrupt-names = "host-wake"; -+ }; -+}; -+ - &ohci0 { - status = "okay"; - }; -@@ -50,8 +154,85 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ -+&pio { -+ vmmc3_pin_ap6xxx_wl_regon: vmmc3_pin@0 { -+ allwinner,pins = "PH9"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1450000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ -+®_usb0_vbus { -+ status = "okay"; -+}; -+ -+®_usb1_vbus { -+ status = "okay"; -+}; -+ -+®_usb2_vbus { -+ status = "okay"; -+}; -+ - &uart0 { - pinctrl-names = "default"; - pinctrl-0 = <&uart0_pins_a>; - status = "okay"; - }; -+ -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ -+&usb_power_supply { -+ status = "okay"; -+}; -+ -+&usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_power-supply = <&usb_power_supply>; -+ usb0_vbus-supply = <®_usb0_vbus>; -+ usb1_vbus-supply = <®_usb1_vbus>; -+ usb2_vbus-supply = <®_usb2_vbus>; -+ status = "okay"; -+}; ---- a/arch/arm/dts/sun7i-a20.dtsi -+++ b/arch/arm/dts/sun7i-a20.dtsi -@@ -47,6 +47,7 @@ - #include - #include - -+#include - #include - #include - -@@ -67,7 +68,7 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0-hdmi"; - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, -- <&ahb_gates 44>; -+ <&ahb_gates 44>, <&dram_gates 26>; - status = "disabled"; - }; - -@@ -75,7 +76,8 @@ - compatible = "allwinner,simple-framebuffer", - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0"; -- clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>; -+ clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>, -+ <&dram_gates 26>; - status = "disabled"; - }; - -@@ -84,7 +86,7 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0-tve0"; - clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>, -- <&ahb_gates 44>; -+ <&ahb_gates 44>, <&dram_gates 26>; - status = "disabled"; - }; - }; -@@ -107,7 +109,7 @@ - 720000 1200000 - 528000 1100000 - 312000 1000000 -- 144000 900000 -+ 144000 1000000 - >; - #cooling-cells = <2>; - cooling-min-level = <0>; -@@ -199,6 +201,15 @@ - clock-output-names = "pll1"; - }; - -+ pll2: clk@01c20008 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-pll2-clk"; -+ reg = <0x01c20008 0x8>; -+ clocks = <&osc24M>; -+ clock-output-names = "pll2-1x", "pll2-2x", -+ "pll2-4x", "pll2-8x"; -+ }; -+ - pll4: clk@01c20018 { - #clock-cells = <0>; - compatible = "allwinner,sun7i-a20-pll4-clk"; -@@ -267,6 +278,19 @@ - compatible = "allwinner,sun7i-a20-ahb-gates-clk"; - reg = <0x01c20060 0x8>; - clocks = <&ahb>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, <4>, -+ <5>, <6>, <7>, <8>, -+ <9>, <10>, <11>, <12>, -+ <13>, <14>, <16>, -+ <17>, <18>, <20>, <21>, -+ <22>, <23>, <25>, -+ <28>, <32>, <33>, <34>, -+ <35>, <36>, <37>, <40>, -+ <41>, <42>, <43>, -+ <44>, <45>, <46>, -+ <47>, <49>, <50>, -+ <52>; - clock-output-names = "ahb_usb0", "ahb_ehci0", - "ahb_ohci0", "ahb_ehci1", "ahb_ohci1", - "ahb_ss", "ahb_dma", "ahb_bist", "ahb_mmc0", -@@ -295,6 +319,10 @@ - compatible = "allwinner,sun7i-a20-apb0-gates-clk"; - reg = <0x01c20068 0x4>; - clocks = <&apb0>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, <4>, -+ <5>, <6>, <7>, -+ <8>, <10>; - clock-output-names = "apb0_codec", "apb0_spdif", - "apb0_ac97", "apb0_iis0", "apb0_iis1", - "apb0_pio", "apb0_ir0", "apb0_ir1", -@@ -314,6 +342,12 @@ - compatible = "allwinner,sun7i-a20-apb1-gates-clk"; - reg = <0x01c2006c 0x4>; - clocks = <&apb1>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, <4>, -+ <5>, <6>, <7>, -+ <15>, <16>, <17>, -+ <18>, <19>, <20>, -+ <21>, <22>, <23>; - clock-output-names = "apb1_i2c0", "apb1_i2c1", - "apb1_i2c2", "apb1_i2c3", "apb1_can", - "apb1_scr", "apb1_ps20", "apb1_ps21", -@@ -442,6 +476,14 @@ - clock-output-names = "ir1"; - }; - -+ keypad_clk: clk@01c200c4 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-mod0-clk"; -+ reg = <0x01c200c4 0x4>; -+ clocks = <&osc24M>; -+ clock-output-names = "keypad"; -+ }; -+ - usb_clk: clk@01c200cc { - #clock-cells = <1>; - #reset-cells = <1>; -@@ -460,6 +502,48 @@ - clock-output-names = "spi3"; - }; - -+ dram_gates: clk@01c20100 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-dram-gates-clk"; -+ reg = <0x01c20100 0x4>; -+ clocks = <&pll5 0>; -+ clock-indices = <0>, -+ <1>, <2>, -+ <3>, -+ <4>, -+ <5>, <6>, -+ <15>, -+ <24>, <25>, -+ <26>, <27>, -+ <28>, <29>; -+ clock-output-names = "dram_ve", -+ "dram_csi0", "dram_csi1", -+ "dram_ts", -+ "dram_tvd", -+ "dram_tve0", "dram_tve1", -+ "dram_output", -+ "dram_de_fe1", "dram_de_fe0", -+ "dram_de_be0", "dram_de_be1", -+ "dram_de_mp", "dram_ace"; -+ }; -+ -+ ve_clk: clk@01c2013c { -+ #clock-cells = <0>; -+ #reset-cells = <0>; -+ compatible = "allwinner,sun4i-a10-ve-clk"; -+ reg = <0x01c2013c 0x4>; -+ clocks = <&pll4>; -+ clock-output-names = "ve"; -+ }; -+ -+ codec_clk: clk@01c20140 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-codec-clk"; -+ reg = <0x01c20140 0x4>; -+ clocks = <&pll2 SUN4I_A10_PLL2_1X>; -+ clock-output-names = "codec"; -+ }; -+ - mbus_clk: clk@01c2015c { - #clock-cells = <0>; - compatible = "allwinner,sun5i-a13-mbus-clk"; -@@ -744,6 +828,14 @@ - status = "disabled"; - }; - -+ crypto: crypto-engine@01c15000 { -+ compatible = "allwinner,sun4i-a10-crypto"; -+ reg = <0x01c15000 0x1000>; -+ interrupts = ; -+ clocks = <&ahb_gates 5>, <&ss_clk>; -+ clock-names = "ahb", "mod"; -+ }; -+ - spi2: spi@01c17000 { - compatible = "allwinner,sun4i-a10-spi"; - reg = <0x01c17000 0x1000>; -@@ -1159,6 +1251,19 @@ - status = "disabled"; - }; - -+ codec: codec@01c22c00 { -+ #sound-dai-cells = <0>; -+ compatible = "allwinner,sun7i-a20-codec"; -+ reg = <0x01c22c00 0x40>; -+ interrupts = ; -+ clocks = <&apb0_gates 0>, <&codec_clk>; -+ clock-names = "apb", "codec"; -+ dmas = <&dma SUN4I_DMA_NORMAL 19>, -+ <&dma SUN4I_DMA_NORMAL 19>; -+ dma-names = "rx", "tx"; -+ status = "disabled"; -+ }; -+ - sid: eeprom@01c23800 { - compatible = "allwinner,sun7i-a20-sid"; - reg = <0x01c23800 0x200>; ---- a/arch/arm/dts/sun8i-a23-a33.dtsi -+++ b/arch/arm/dts/sun8i-a23-a33.dtsi -@@ -56,7 +56,7 @@ - #size-cells = <1>; - ranges; - -- framebuffer@0 { -+ simplefb_lcd: framebuffer@0 { - compatible = "allwinner,simple-framebuffer", - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0"; -@@ -175,27 +175,13 @@ - clock-output-names = "apb1"; - }; - -- ahb1_gates: clk@01c20060 { -- #clock-cells = <1>; -- compatible = "allwinner,sun8i-a23-ahb1-gates-clk"; -- reg = <0x01c20060 0x8>; -- clocks = <&ahb1>; -- clock-output-names = "ahb1_mipidsi", "ahb1_dma", -- "ahb1_mmc0", "ahb1_mmc1", "ahb1_mmc2", -- "ahb1_nand", "ahb1_sdram", -- "ahb1_hstimer", "ahb1_spi0", -- "ahb1_spi1", "ahb1_otg", "ahb1_ehci", -- "ahb1_ohci", "ahb1_ve", "ahb1_lcd", -- "ahb1_csi", "ahb1_be", "ahb1_fe", -- "ahb1_gpu", "ahb1_spinlock", -- "ahb1_drc"; -- }; -- - apb1_gates: clk@01c20068 { - #clock-cells = <1>; - compatible = "allwinner,sun8i-a23-apb1-gates-clk"; - reg = <0x01c20068 0x4>; - clocks = <&apb1>; -+ clock-indices = <0>, <5>, -+ <12>, <13>; - clock-output-names = "apb1_codec", "apb1_pio", - "apb1_daudio0", "apb1_daudio1"; - }; -@@ -213,6 +199,10 @@ - compatible = "allwinner,sun8i-a23-apb2-gates-clk"; - reg = <0x01c2006c 0x4>; - clocks = <&apb2>; -+ clock-indices = <0>, <1>, -+ <2>, <16>, -+ <17>, <18>, -+ <19>, <20>; - clock-output-names = "apb2_i2c0", "apb2_i2c1", - "apb2_i2c2", "apb2_uart0", - "apb2_uart1", "apb2_uart2", -@@ -391,12 +381,19 @@ - allwinner,pins = "PC5", "PC6", "PC8", - "PC9", "PC10", "PC11", - "PC12", "PC13", "PC14", -- "PC15"; -+ "PC15", "PC16"; - allwinner,function = "mmc2"; - allwinner,drive = ; - allwinner,pull = ; - }; - -+ pwm0_pins: pwm0 { -+ allwinner,pins = "PH0"; -+ allwinner,function = "pwm0"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - i2c0_pins_a: i2c0@0 { - allwinner,pins = "PH2", "PH3"; - allwinner,function = "i2c0"; -@@ -451,6 +448,14 @@ - interrupts = ; - }; - -+ pwm: pwm@01c21400 { -+ compatible = "allwinner,sun7i-a20-pwm"; -+ reg = <0x01c21400 0xc>; -+ clocks = <&osc24M>; -+ #pwm-cells = <3>; -+ status = "disabled"; -+ }; -+ - lradc: lradc@01c22800 { - compatible = "allwinner,sun4i-a10-lradc-keys"; - reg = <0x01c22800 0x100>; -@@ -574,6 +579,14 @@ - ; - }; - -+ nmi_intc: interrupt-controller@01f00c0c { -+ compatible = "allwinner,sun6i-a31-sc-nmi"; -+ interrupt-controller; -+ #interrupt-cells = <2>; -+ reg = <0x01f00c0c 0x38>; -+ interrupts = ; -+ }; -+ - prcm@01f01400 { - compatible = "allwinner,sun8i-a23-prcm"; - reg = <0x01f01400 0x200>; -@@ -642,10 +655,18 @@ - resets = <&apb0_rst 0>; - gpio-controller; - interrupt-controller; -+ #interrupt-cells = <3>; - #address-cells = <1>; - #size-cells = <0>; - #gpio-cells = <3>; - -+ r_rsb_pins: r_rsb { -+ allwinner,pins = "PL0", "PL1"; -+ allwinner,function = "s_rsb"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - r_uart_pins_a: r_uart@0 { - allwinner,pins = "PL2", "PL3"; - allwinner,function = "s_uart"; -@@ -653,5 +674,19 @@ - allwinner,pull = ; - }; - }; -+ -+ r_rsb: rsb@01f03400 { -+ compatible = "allwinner,sun8i-a23-rsb"; -+ reg = <0x01f03400 0x400>; -+ interrupts = ; -+ clocks = <&apb0_gates 3>; -+ clock-frequency = <3000000>; -+ resets = <&apb0_rst 3>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&r_rsb_pins>; -+ status = "disabled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; - }; - }; ---- a/arch/arm/dts/sun8i-a23-gt90h-v4.dts -+++ b/arch/arm/dts/sun8i-a23-gt90h-v4.dts -@@ -47,15 +47,26 @@ - #include - #include - #include -+#include - - / { -- model = "Allwinner GT90H Quad Core Tablet (v4)"; -- compatible = "allwinner,gt90h-v4", "allwinner,sun8i-a33"; -+ model = "Allwinner GT90H Dual Core Tablet (v4)"; -+ compatible = "allwinner,gt90h-v4", "allwinner,sun8i-a23"; - - aliases { - serial0 = &r_uart; - }; - -+ backlight: backlight { -+ compatible = "pwm-backlight"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&bl_en_pin_gt90h>; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <8>; -+ enable-gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ -+ }; -+ - chosen { - stdout-path = "serial0:115200n8"; - }; -@@ -106,8 +117,7 @@ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_gt90h>; -- /* FIXME this really is aldo1, correct once we've pmic support */ -- vmmc-supply = <®_vcc3v0>; -+ vmmc-supply = <®_aldo1>; - bus-width = <4>; - cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */ - cd-inverted; -@@ -115,6 +125,13 @@ - }; - - &pio { -+ bl_en_pin_gt90h: bl_en_pin@0 { -+ allwinner,pins = "PH6"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_gt90h: mmc0_cd_pin@0 { - allwinner,pins = "PB4"; - allwinner,function = "gpio_in"; -@@ -123,12 +140,106 @@ - }; - }; - -+&pwm { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm0_pins>; -+ status = "okay"; -+}; -+ -+&r_rsb { -+ status = "okay"; -+ -+ axp22x: pmic@3a3 { -+ compatible = "x-powers,axp223"; -+ reg = <0x3a3>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ eldoin-supply = <®_dcdc1>; -+ }; -+}; -+ - &r_uart { - pinctrl-names = "default"; - pinctrl-0 = <&r_uart_pins_a>; - status = "okay"; - }; - -+#include "axp22x.dtsi" -+ -+®_aldo1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-io"; -+}; -+ -+®_aldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <2350000>; -+ regulator-max-microvolt = <2650000>; -+ regulator-name = "vdd-dll"; -+}; -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-pll-avcc"; -+}; -+ -+®_dc1sw { -+ regulator-name = "vcc-lcd"; -+}; -+ -+®_dc5ldo { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-sys"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ -+®_dldo1 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-wifi"; -+}; -+ -+®_rtc_ldo { -+ regulator-name = "vcc-rtc"; -+}; -+ -+&simplefb_lcd { -+ vcc-lcd-supply = <®_dc1sw>; -+}; -+ - /* - * FIXME for now we only support host mode and rely on u-boot to have - * turned on Vbus which is controlled by the axp223 pmic on the board. -@@ -141,5 +252,6 @@ - }; - - &usbphy { -+ usb1_vbus-supply = <®_dldo1>; - status = "okay"; - }; ---- a/arch/arm/dts/sun8i-a23.dtsi -+++ b/arch/arm/dts/sun8i-a23.dtsi -@@ -50,6 +50,31 @@ - }; - - clocks { -+ ahb1_gates: clk@01c20060 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun8i-a23-ahb1-gates-clk"; -+ reg = <0x01c20060 0x8>; -+ clocks = <&ahb1>; -+ clock-indices = <1>, <6>, -+ <8>, <9>, <10>, -+ <13>, <14>, -+ <19>, <20>, -+ <21>, <24>, <26>, -+ <29>, <32>, <36>, -+ <40>, <44>, <46>, -+ <52>, <53>, -+ <54>, <57>; -+ clock-output-names = "ahb1_mipidsi", "ahb1_dma", -+ "ahb1_mmc0", "ahb1_mmc1", "ahb1_mmc2", -+ "ahb1_nand", "ahb1_sdram", -+ "ahb1_hstimer", "ahb1_spi0", -+ "ahb1_spi1", "ahb1_otg", "ahb1_ehci", -+ "ahb1_ohci", "ahb1_ve", "ahb1_lcd", -+ "ahb1_csi", "ahb1_be", "ahb1_fe", -+ "ahb1_gpu", "ahb1_msgbox", -+ "ahb1_spinlock", "ahb1_drc"; -+ }; -+ - mbus_clk: clk@01c2015c { - #clock-cells = <0>; - compatible = "allwinner,sun8i-a23-mbus-clk"; ---- a/arch/arm/dts/sun8i-a33-sinlinx-sina33.dts -+++ b/arch/arm/dts/sun8i-a33-sinlinx-sina33.dts -@@ -68,7 +68,7 @@ - }; - - &lradc { -- vref-supply = <®_vcc3v0>; -+ vref-supply = <®_dcdc1>; - status = "okay"; - - button@200 { -@@ -96,7 +96,7 @@ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_sina33>; -- vmmc-supply = <®_vcc3v0>; -+ vmmc-supply = <®_dcdc1>; - bus-width = <4>; - cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */ - cd-inverted; -@@ -106,13 +106,16 @@ - &mmc2 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc2_8bit_pins>; -- vmmc-supply = <®_vcc3v0>; -+ vmmc-supply = <®_dcdc1>; - bus-width = <8>; - non-removable; -+ cap-mmc-hw-reset; - status = "okay"; - }; - - &mmc2_8bit_pins { -+ /* Increase drive strength for DDR modes */ -+ allwinner,drive = ; - /* eMMC is missing pull-ups */ - allwinner,pull = ; - }; -@@ -130,6 +133,80 @@ - }; - }; - -+&r_rsb { -+ status = "okay"; -+ -+ axp22x: pmic@3a3 { -+ compatible = "x-powers,axp223"; -+ reg = <0x3a3>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ eldoin-supply = <®_dcdc1>; -+ }; -+}; -+ -+#include "axp22x.dtsi" -+ -+®_aldo1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-io"; -+}; -+ -+®_aldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <2350000>; -+ regulator-max-microvolt = <2650000>; -+ regulator-name = "vdd-dll"; -+}; -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-pll-avcc"; -+}; -+ -+®_dc5ldo { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-sys"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ -+®_rtc_ldo { -+ regulator-name = "vcc-rtc"; -+}; -+ - &uart0 { - pinctrl-names = "default"; - pinctrl-0 = <&uart0_pins_b>; ---- a/arch/arm/dts/sun8i-a33.dtsi -+++ b/arch/arm/dts/sun8i-a33.dtsi -@@ -72,6 +72,41 @@ - clock-output-names = "pll11"; - }; - -+ ahb1_gates: clk@01c20060 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun8i-a33-ahb1-gates-clk"; -+ reg = <0x01c20060 0x8>; -+ clocks = <&ahb1>; -+ clock-indices = <1>, <5>, -+ <6>, <8>, <9>, -+ <10>, <13>, <14>, -+ <19>, <20>, -+ <21>, <24>, <26>, -+ <29>, <32>, <36>, -+ <40>, <44>, <46>, -+ <52>, <53>, -+ <54>, <57>, -+ <58>; -+ clock-output-names = "ahb1_mipidsi", "ahb1_ss", -+ "ahb1_dma","ahb1_mmc0", "ahb1_mmc1", -+ "ahb1_mmc2", "ahb1_nand", "ahb1_sdram", -+ "ahb1_hstimer", "ahb1_spi0", -+ "ahb1_spi1", "ahb1_otg", "ahb1_ehci", -+ "ahb1_ohci", "ahb1_ve", "ahb1_lcd", -+ "ahb1_csi", "ahb1_be", "ahb1_fe", -+ "ahb1_gpu", "ahb1_msgbox", -+ "ahb1_spinlock", "ahb1_drc", -+ "ahb1_sat"; -+ }; -+ -+ ss_clk: clk@01c2009c { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-mod0-clk"; -+ reg = <0x01c2009c 0x4>; -+ clocks = <&osc24M>, <&pll6 0>; -+ clock-output-names = "ss"; -+ }; -+ - mbus_clk: clk@01c2015c { - #clock-cells = <0>; - compatible = "allwinner,sun8i-a23-mbus-clk"; -@@ -82,6 +117,16 @@ - }; - - soc@01c00000 { -+ crypto: crypto-engine@01c15000 { -+ compatible = "allwinner,sun4i-a10-crypto"; -+ reg = <0x01c15000 0x1000>; -+ interrupts = ; -+ clocks = <&ahb1_gates 5>, <&ss_clk>; -+ clock-names = "ahb", "mod"; -+ resets = <&ahb1_rst 5>; -+ reset-names = "ahb"; -+ }; -+ - usb_otg: usb@01c19000 { - compatible = "allwinner,sun8i-a33-musb"; - reg = <0x01c19000 0x0400>; ---- /dev/null -+++ b/arch/arm/dts/sun8i-a83t-cubietruck-plus.dts -@@ -0,0 +1,65 @@ -+/* -+ * Copyright 2015 Chen-Yu Tsai -+ * -+ * Chen-Yu Tsai -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file 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. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun8i-a83t.dtsi" -+ -+/ { -+ model = "Cubietech Cubietruck Plus"; -+ compatible = "cubietech,cubietruck-plus", "allwinner,sun8i-a83t"; -+ -+ aliases { -+ serial0 = &uart0; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_b>; -+ status = "okay"; -+}; ---- a/arch/arm/dts/sun8i-a83t.dtsi -+++ b/arch/arm/dts/sun8i-a83t.dtsi -@@ -52,12 +52,6 @@ - / { - interrupt-parent = <&gic>; - -- chosen { -- #address-cells = <1>; -- #size-cells = <1>; -- ranges; -- }; -- - cpus { - #address-cells = <1>; - #size-cells = <0>; -@@ -85,6 +79,7 @@ - device_type = "cpu"; - reg = <3>; - }; -+ - cpu@100 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; -@@ -96,6 +91,7 @@ - device_type = "cpu"; - reg = <0x101>; - }; -+ - cpu@102 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; -@@ -109,18 +105,12 @@ - }; - }; - -- memory { -- reg = <0x40000000 0x80000000>; -- }; -- - timer { - compatible = "arm,armv7-timer"; -- interrupts = , -- , -- , -- ; -- clock-frequency = <24000000>; -- arm,cpu-registers-not-fw-configured; -+ interrupts = , -+ , -+ , -+ ; - }; - - clocks { -@@ -128,6 +118,7 @@ - #size-cells = <1>; - ranges; - -+ /* TODO: PRCM block has a mux for this. */ - osc24M: osc24M_clk { - #clock-cells = <0>; - compatible = "fixed-clock"; -@@ -135,36 +126,39 @@ - clock-output-names = "osc24M"; - }; - -- osc32k: osc32k_clk { -+ /* -+ * This is called "internal OSC" in some places. -+ * It is an internal RC-based oscillator. -+ * TODO: Its controls are in the PRCM block. -+ */ -+ osc16M: osc16M_clk { - #clock-cells = <0>; - compatible = "fixed-clock"; -- clock-frequency = <32768>; -- clock-output-names = "osc32k"; -+ clock-frequency = <16000000>; -+ clock-output-names = "osc16M"; -+ }; -+ -+ osc16Md512: osc16Md512_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-factor-clock"; -+ clock-div = <512>; -+ clock-mult = <1>; -+ clocks = <&osc16M>; -+ clock-output-names = "osc16M-d512"; - }; - }; - -- soc@01c00000 { -+ soc { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges; - -- gic: interrupt-controller@01c81000 { -- compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic"; -- reg = <0x01c81000 0x1000>, -- <0x01c82000 0x1000>, -- <0x01c84000 0x2000>, -- <0x01c86000 0x2000>; -- interrupt-controller; -- #interrupt-cells = <3>; -- interrupts = ; -- }; -- - pio: pinctrl@01c20800 { - compatible = "allwinner,sun8i-a83t-pinctrl"; - interrupts = , -- , -- ; -+ , -+ ; - reg = <0x01c20800 0x400>; - clocks = <&osc24M>; - gpio-controller; -@@ -172,27 +166,6 @@ - #interrupt-cells = <3>; - #gpio-cells = <3>; - -- i2c0_pins_a: i2c0@0 { -- allwinner,pins = "PH0", "PH1"; -- allwinner,function = "i2c0"; -- allwinner,drive = ; -- allwinner,pull = ; -- }; -- -- i2c1_pins_a: i2c1@0 { -- allwinner,pins = "PH2", "PH3"; -- allwinner,function = "i2c1"; -- allwinner,drive = ; -- allwinner,pull = ; -- }; -- -- i2c2_pins_a: i2c2@0 { -- allwinner,pins = "PH4", "PH5"; -- allwinner,function = "i2c2"; -- allwinner,drive = ; -- allwinner,pull = ; -- }; -- - mmc0_pins_a: mmc0@0 { - allwinner,pins = "PF0", "PF1", "PF2", - "PF3", "PF4", "PF5"; -@@ -201,24 +174,6 @@ - allwinner,pull = ; - }; - -- mmc1_pins_a: mmc1@0 { -- allwinner,pins = "PG0", "PG1", "PG2", -- "PG3", "PG4", "PG5"; -- allwinner,function = "mmc1"; -- allwinner,drive = ; -- allwinner,pull = ; -- }; -- -- mmc2_8bit_pins: mmc2_8bit { -- allwinner,pins = "PC5", "PC6", "PC8", -- "PC9", "PC10", "PC11", -- "PC12", "PC13", "PC14", -- "PC15"; -- allwinner,function = "mmc2"; -- allwinner,drive = ; -- allwinner,pull = ; -- }; -- - uart0_pins_a: uart0@0 { - allwinner,pins = "PF2", "PF4"; - allwinner,function = "uart0"; -@@ -234,6 +189,21 @@ - }; - }; - -+ timer@01c20c00 { -+ compatible = "allwinner,sun4i-a10-timer"; -+ reg = <0x01c20c00 0xa0>; -+ interrupts = , -+ ; -+ clocks = <&osc24M>; -+ }; -+ -+ watchdog@01c20ca0 { -+ compatible = "allwinner,sun6i-a31-wdt"; -+ reg = <0x01c20ca0 0x20>; -+ interrupts = ; -+ clocks = <&osc24M>; -+ }; -+ - uart0: serial@01c28000 { - compatible = "snps,dw-apb-uart"; - reg = <0x01c28000 0x400>; -@@ -243,5 +213,16 @@ - clocks = <&osc24M>; - status = "disabled"; - }; -+ -+ gic: interrupt-controller@01c81000 { -+ compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic"; -+ reg = <0x01c81000 0x1000>, -+ <0x01c82000 0x1000>, -+ <0x01c84000 0x2000>, -+ <0x01c86000 0x2000>; -+ interrupt-controller; -+ #interrupt-cells = <3>; -+ interrupts = ; -+ }; - }; - }; ---- a/arch/arm/dts/sun8i-h3-orangepi-pc.dts -+++ b/arch/arm/dts/sun8i-h3-orangepi-pc.dts -@@ -45,6 +45,7 @@ - #include "sunxi-common-regulators.dtsi" - - #include -+#include - #include - - / { -@@ -58,6 +59,43 @@ - chosen { - stdout-path = "serial0:115200n8"; - }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&leds_opc>; -+ -+ status_led { -+ label = "status:red:user"; -+ gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+ -+ r_leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&leds_r_opc>; -+ -+ tx { -+ label = "pwr:green:user"; -+ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ }; -+ }; -+ -+ r_gpio_keys { -+ compatible = "gpio-keys"; -+ input-name = "sw4"; -+ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sw_r_opc>; -+ -+ sw4@0 { -+ label = "sw4"; -+ linux,code = ; -+ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; -+ }; -+ }; - }; - - &ehci1 { -@@ -72,6 +110,12 @@ - status = "okay"; - }; - -+&ir { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&ir_pins_a>; -+ status = "okay"; -+}; -+ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; -@@ -94,6 +138,31 @@ - status = "okay"; - }; - -+&pio { -+ leds_opc: led_pins@0 { -+ allwinner,pins = "PA15"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+&r_pio { -+ leds_r_opc: led_pins@0 { -+ allwinner,pins = "PL10"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ sw_r_opc: key_pins@0 { -+ allwinner,pins = "PL03"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ - &uart0 { - pinctrl-names = "default"; - pinctrl-0 = <&uart0_pins_a>; ---- a/arch/arm/dts/sun8i-h3-orangepi-plus.dts -+++ b/arch/arm/dts/sun8i-h3-orangepi-plus.dts -@@ -45,6 +45,7 @@ - #include "sunxi-common-regulators.dtsi" - - #include -+#include - #include - - / { -@@ -70,6 +71,68 @@ - enable-active-high; - gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>; - }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&leds_opc>; -+ -+ status_led { -+ label = "status:red:user"; -+ gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+ -+ r_leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&leds_r_opc>; -+ -+ tx { -+ label = "pwr:green:user"; -+ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ }; -+ }; -+ -+ r_gpio_keys { -+ compatible = "gpio-keys"; -+ input-name = "sw4"; -+ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sw_r_opc>; -+ -+ sw4@0 { -+ label = "sw4"; -+ linux,code = ; -+ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+}; -+ -+&pio { -+ leds_opc: led_pins@0 { -+ allwinner,pins = "PA15"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+&r_pio { -+ leds_r_opc: led_pins@0 { -+ allwinner,pins = "PL10"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ sw_r_opc: key_pins@0 { -+ allwinner,pins = "PL03"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - - &ehci1 { ---- a/arch/arm/dts/sun8i-h3.dtsi -+++ b/arch/arm/dts/sun8i-h3.dtsi -@@ -83,12 +83,6 @@ - , - , - ; -- clock-frequency = <24000000>; -- arm,cpu-registers-not-fw-configured; -- }; -- -- memory { -- reg = <0x40000000 0x80000000>; - }; - - clocks { -@@ -131,15 +125,24 @@ - compatible = "allwinner,sun6i-a31-pll6-clk"; - reg = <0x01c20028 0x4>; - clocks = <&osc24M>; -- clock-output-names = "pll6", "pll6x2", "pll6d2"; -+ clock-output-names = "pll6", "pll6x2"; - }; - -- pll8: clk@01c20044 { -- #clock-cells = <1>; -- compatible = "allwinner,sun6i-a31-pll6-clk"; -- reg = <0x01c20044 0x4>; -- clocks = <&osc24M>; -- clock-output-names = "pll8", "pll8x2"; -+ pll6d2: pll6d2_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-factor-clock"; -+ clock-div = <2>; -+ clock-mult = <1>; -+ clocks = <&pll6 0>; -+ clock-output-names = "pll6d2"; -+ }; -+ -+ /* dummy clock until pll6 can be reused */ -+ pll8: pll8_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-clock"; -+ clock-frequency = <1>; -+ clock-output-names = "pll8"; - }; - - cpu: cpu_clk@01c20050 { -@@ -170,7 +173,7 @@ - #clock-cells = <0>; - compatible = "allwinner,sun8i-h3-ahb2-clk"; - reg = <0x01c2005c 0x4>; -- clocks = <&ahb1>, <&pll6 2>; -+ clocks = <&ahb1>, <&pll6d2>; - clock-output-names = "ahb2"; - }; - -@@ -213,34 +216,34 @@ - <76>, <77>, <78>, - <96>, <97>, <98>, - <112>, <113>, -- <114>, <115>, <116>, -- <128>, <135>; -- clock-output-names = "ahb1_ce", "ahb1_dma", "ahb1_mmc0", -- "ahb1_mmc1", "ahb1_mmc2", "ahb1_nand", -- "ahb1_sdram", "ahb2_gmac", "ahb1_ts", -- "ahb1_hstimer", "ahb1_spi0", -- "ahb1_spi1", "ahb1_otg", -- "ahb1_otg_ehci0", "ahb1_ehic1", -- "ahb1_ehic2", "ahb1_ehic3", -- "ahb1_otg_ohci0", "ahb2_ohic1", -- "ahb2_ohic2", "ahb2_ohic3", "ahb1_ve", -- "ahb1_lcd0", "ahb1_lcd1", "ahb1_deint", -- "ahb1_csi", "ahb1_tve", "ahb1_hdmi", -- "ahb1_de", "ahb1_gpu", "ahb1_msgbox", -- "ahb1_spinlock", "apb1_codec", -- "apb1_spdif", "apb1_pio", "apb1_ths", -- "apb1_i2s0", "apb1_i2s1", "apb1_i2s2", -- "apb2_i2c0", "apb2_i2c1", "apb2_i2c2", -- "apb2_uart0", "apb2_uart1", -- "apb2_uart2", "apb2_uart3", "apb2_scr", -- "ahb1_ephy", "ahb1_dbg"; -+ <114>, <115>, -+ <116>, <128>, <135>; -+ clock-output-names = "bus_ce", "bus_dma", "bus_mmc0", -+ "bus_mmc1", "bus_mmc2", "bus_nand", -+ "bus_sdram", "bus_gmac", "bus_ts", -+ "bus_hstimer", "bus_spi0", -+ "bus_spi1", "bus_otg", -+ "bus_otg_ehci0", "bus_ehci1", -+ "bus_ehci2", "bus_ehci3", -+ "bus_otg_ohci0", "bus_ohci1", -+ "bus_ohci2", "bus_ohci3", "bus_ve", -+ "bus_lcd0", "bus_lcd1", "bus_deint", -+ "bus_csi", "bus_tve", "bus_hdmi", -+ "bus_de", "bus_gpu", "bus_msgbox", -+ "bus_spinlock", "bus_codec", -+ "bus_spdif", "bus_pio", "bus_ths", -+ "bus_i2s0", "bus_i2s1", "bus_i2s2", -+ "bus_i2c0", "bus_i2c1", "bus_i2c2", -+ "bus_uart0", "bus_uart1", -+ "bus_uart2", "bus_uart3", -+ "bus_scr", "bus_ephy", "bus_dbg"; - }; - - mmc0_clk: clk@01c20088 { - #clock-cells = <1>; - compatible = "allwinner,sun4i-a10-mmc-clk"; - reg = <0x01c20088 0x4>; -- clocks = <&osc24M>, <&pll6 0>, <&pll8 0>; -+ clocks = <&osc24M>, <&pll6 0>, <&pll8>; - clock-output-names = "mmc0", - "mmc0_output", - "mmc0_sample"; -@@ -250,7 +253,7 @@ - #clock-cells = <1>; - compatible = "allwinner,sun4i-a10-mmc-clk"; - reg = <0x01c2008c 0x4>; -- clocks = <&osc24M>, <&pll6 0>, <&pll8 0>; -+ clocks = <&osc24M>, <&pll6 0>, <&pll8>; - clock-output-names = "mmc1", - "mmc1_output", - "mmc1_sample"; -@@ -260,7 +263,7 @@ - #clock-cells = <1>; - compatible = "allwinner,sun4i-a10-mmc-clk"; - reg = <0x01c20090 0x4>; -- clocks = <&osc24M>, <&pll6 0>, <&pll8 0>; -+ clocks = <&osc24M>, <&pll6 0>, <&pll8>; - clock-output-names = "mmc2", - "mmc2_output", - "mmc2_sample"; -@@ -285,6 +288,33 @@ - clocks = <&osc24M>, <&pll6 1>, <&pll5>; - clock-output-names = "mbus"; - }; -+ -+ apb0: apb0_clk { -+ compatible = "fixed-factor-clock"; -+ #clock-cells = <0>; -+ clock-div = <1>; -+ clock-mult = <1>; -+ clocks = <&osc24M>; -+ clock-output-names = "apb0"; -+ }; -+ -+ apb0_gates: clk@01f01428 { -+ compatible = "allwinner,sun8i-h3-apb0-gates-clk", -+ "allwinner,sun4i-a10-gates-clk"; -+ reg = <0x01f01428 0x4>; -+ #clock-cells = <1>; -+ clocks = <&apb0>; -+ clock-indices = <0>, <1>; -+ clock-output-names = "apb0_pio", "apb0_ir"; -+ }; -+ -+ ir_clk: ir_clk@01f01454 { -+ compatible = "allwinner,sun4i-a10-mod0-clk"; -+ reg = <0x01f01454 0x4>; -+ #clock-cells = <0>; -+ clocks = <&osc32k>, <&osc24M>; -+ clock-output-names = "ir"; -+ }; - }; - - soc { -@@ -298,7 +328,7 @@ - reg = <0x01c02000 0x1000>; - interrupts = ; - clocks = <&bus_gates 6>; -- resets = <&bus_rst 6>; -+ resets = <&ahb_rst 6>; - #dma-cells = <1>; - }; - -@@ -313,7 +343,7 @@ - "mmc", - "output", - "sample"; -- resets = <&bus_rst 8>; -+ resets = <&ahb_rst 8>; - reset-names = "ahb"; - interrupts = ; - status = "disabled"; -@@ -332,7 +362,7 @@ - "mmc", - "output", - "sample"; -- resets = <&bus_rst 9>; -+ resets = <&ahb_rst 9>; - reset-names = "ahb"; - interrupts = ; - status = "disabled"; -@@ -351,7 +381,7 @@ - "mmc", - "output", - "sample"; -- resets = <&bus_rst 10>; -+ resets = <&ahb_rst 10>; - reset-names = "ahb"; - interrupts = ; - status = "disabled"; -@@ -396,7 +426,7 @@ - reg = <0x01c1b000 0x100>; - interrupts = ; - clocks = <&bus_gates 25>, <&bus_gates 29>; -- resets = <&bus_rst 25>, <&bus_rst 29>; -+ resets = <&ahb_rst 25>, <&ahb_rst 29>; - phys = <&usbphy 1>; - phy-names = "usb"; - status = "disabled"; -@@ -408,7 +438,7 @@ - interrupts = ; - clocks = <&bus_gates 29>, <&bus_gates 25>, - <&usb_clk 17>; -- resets = <&bus_rst 29>, <&bus_rst 25>; -+ resets = <&ahb_rst 29>, <&ahb_rst 25>; - phys = <&usbphy 1>; - phy-names = "usb"; - status = "disabled"; -@@ -419,7 +449,7 @@ - reg = <0x01c1c000 0x100>; - interrupts = ; - clocks = <&bus_gates 26>, <&bus_gates 30>; -- resets = <&bus_rst 26>, <&bus_rst 30>; -+ resets = <&ahb_rst 26>, <&ahb_rst 30>; - phys = <&usbphy 2>; - phy-names = "usb"; - status = "disabled"; -@@ -431,7 +461,7 @@ - interrupts = ; - clocks = <&bus_gates 30>, <&bus_gates 26>, - <&usb_clk 18>; -- resets = <&bus_rst 30>, <&bus_rst 26>; -+ resets = <&ahb_rst 30>, <&ahb_rst 26>; - phys = <&usbphy 2>; - phy-names = "usb"; - status = "disabled"; -@@ -442,7 +472,7 @@ - reg = <0x01c1d000 0x100>; - interrupts = ; - clocks = <&bus_gates 27>, <&bus_gates 31>; -- resets = <&bus_rst 27>, <&bus_rst 31>; -+ resets = <&ahb_rst 27>, <&ahb_rst 31>; - phys = <&usbphy 3>; - phy-names = "usb"; - status = "disabled"; -@@ -454,7 +484,7 @@ - interrupts = ; - clocks = <&bus_gates 31>, <&bus_gates 27>, - <&usb_clk 19>; -- resets = <&bus_rst 31>, <&bus_rst 27>; -+ resets = <&ahb_rst 31>, <&ahb_rst 27>; - phys = <&usbphy 3>; - phy-names = "usb"; - status = "disabled"; -@@ -469,7 +499,7 @@ - gpio-controller; - #gpio-cells = <3>; - interrupt-controller; -- #interrupt-cells = <2>; -+ #interrupt-cells = <3>; - - uart0_pins_a: uart0@0 { - allwinner,pins = "PA4", "PA5"; -@@ -502,10 +532,22 @@ - }; - }; - -- bus_rst: reset@01c202c0 { -+ ahb_rst: reset@01c202c0 { - #reset-cells = <1>; -- compatible = "allwinner,sun8i-h3-bus-reset"; -- reg = <0x01c202c0 0x1c>; -+ compatible = "allwinner,sun6i-a31-ahb1-reset"; -+ reg = <0x01c202c0 0xc>; -+ }; -+ -+ apb1_rst: reset@01c202d0 { -+ #reset-cells = <1>; -+ compatible = "allwinner,sun6i-a31-clock-reset"; -+ reg = <0x01c202d0 0x4>; -+ }; -+ -+ apb2_rst: reset@01c202d8 { -+ #reset-cells = <1>; -+ compatible = "allwinner,sun6i-a31-clock-reset"; -+ reg = <0x01c202d8 0x4>; - }; - - timer@01c20c00 { -@@ -529,7 +571,7 @@ - reg-shift = <2>; - reg-io-width = <4>; - clocks = <&bus_gates 112>; -- resets = <&bus_rst 144>; -+ resets = <&apb2_rst 16>; - dmas = <&dma 6>, <&dma 6>; - dma-names = "rx", "tx"; - status = "disabled"; -@@ -542,7 +584,7 @@ - reg-shift = <2>; - reg-io-width = <4>; - clocks = <&bus_gates 113>; -- resets = <&bus_rst 145>; -+ resets = <&apb2_rst 17>; - dmas = <&dma 7>, <&dma 7>; - dma-names = "rx", "tx"; - status = "disabled"; -@@ -555,7 +597,7 @@ - reg-shift = <2>; - reg-io-width = <4>; - clocks = <&bus_gates 114>; -- resets = <&bus_rst 146>; -+ resets = <&apb2_rst 18>; - dmas = <&dma 8>, <&dma 8>; - dma-names = "rx", "tx"; - status = "disabled"; -@@ -568,7 +610,7 @@ - reg-shift = <2>; - reg-io-width = <4>; - clocks = <&bus_gates 115>; -- resets = <&bus_rst 147>; -+ resets = <&apb2_rst 19>; - dmas = <&dma 9>, <&dma 9>; - dma-names = "rx", "tx"; - status = "disabled"; -@@ -591,5 +633,40 @@ - interrupts = , - ; - }; -+ -+ apb0_reset: reset@01f014b0 { -+ reg = <0x01f014b0 0x4>; -+ compatible = "allwinner,sun6i-a31-clock-reset"; -+ #reset-cells = <1>; -+ }; -+ -+ ir: ir@01f02000 { -+ compatible = "allwinner,sun5i-a13-ir"; -+ clocks = <&apb0_gates 1>, <&ir_clk>; -+ clock-names = "apb", "ir"; -+ resets = <&apb0_reset 1>; -+ interrupts = ; -+ reg = <0x01f02000 0x40>; -+ status = "disabled"; -+ }; -+ -+ r_pio: pinctrl@01f02c00 { -+ compatible = "allwinner,sun8i-h3-r-pinctrl"; -+ reg = <0x01f02c00 0x400>; -+ interrupts = ; -+ clocks = <&apb0_gates 0>; -+ resets = <&apb0_reset 0>; -+ gpio-controller; -+ #gpio-cells = <3>; -+ interrupt-controller; -+ #interrupt-cells = <3>; -+ -+ ir_pins_a: ir@0 { -+ allwinner,pins = "PL11"; -+ allwinner,function = "s_cir_rx"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ }; - }; - }; ---- a/arch/arm/dts/sun8i-q8-common.dtsi -+++ b/arch/arm/dts/sun8i-q8-common.dtsi -@@ -41,11 +41,23 @@ - */ - #include "sunxi-q8-common.dtsi" - -+#include -+ - / { - aliases { - serial0 = &r_uart; - }; - -+ backlight: backlight { -+ compatible = "pwm-backlight"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&bl_en_pin_q8>; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <8>; -+ enable-gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ -+ }; -+ - chosen { - stdout-path = "serial0:115200n8"; - }; -@@ -54,7 +66,7 @@ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_q8>; -- vmmc-supply = <®_vcc3v0>; -+ vmmc-supply = <®_dcdc1>; - bus-width = <4>; - cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */ - cd-inverted; -@@ -77,8 +89,90 @@ - }; - }; - -+&r_rsb { -+ status = "okay"; -+ -+ axp22x: pmic@3a3 { -+ compatible = "x-powers,axp223"; -+ reg = <0x3a3>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ eldoin-supply = <®_dcdc1>; -+ }; -+}; -+ -+#include "axp22x.dtsi" -+ -+®_aldo1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-io"; -+}; -+ -+®_aldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <2350000>; -+ regulator-max-microvolt = <2650000>; -+ regulator-name = "vdd-dll"; -+}; -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-pll-avcc"; -+}; -+ -+®_dc1sw { -+ regulator-name = "vcc-lcd"; -+}; -+ -+®_dc5ldo { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-sys"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ -+®_rtc_ldo { -+ regulator-name = "vcc-rtc"; -+}; -+ - &r_uart { - pinctrl-names = "default"; - pinctrl-0 = <&r_uart_pins_a>; - status = "okay"; - }; -+ -+&simplefb_lcd { -+ vcc-lcd-supply = <®_dc1sw>; -+}; ---- a/arch/arm/dts/sun9i-a80-cubieboard4.dts -+++ b/arch/arm/dts/sun9i-a80-cubieboard4.dts -@@ -62,9 +62,31 @@ - stdout-path = "serial0:115200n8"; - }; - -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&led_pins_cubieboard4>; -+ -+ green { -+ label = "cubieboard4:green:usr"; -+ gpios = <&pio 7 17 GPIO_ACTIVE_HIGH>; /* PH17 */ -+ }; -+ -+ red { -+ label = "cubieboard4:red:usr"; -+ gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ -+ }; -+ }; - }; - - &pio { -+ led_pins_cubieboard4: led-pins@0 { -+ allwinner,pins = "PH6", "PH17"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_cubieboard4: mmc0_cd_pin@0 { - allwinner,pins = "PH18"; - allwinner,function = "gpio_in"; -@@ -89,6 +111,20 @@ - vmmc-supply = <®_vcc3v0>; - bus-width = <8>; - non-removable; -+ cap-mmc-hw-reset; -+ status = "okay"; -+}; -+ -+&mmc2_8bit_pins { -+ /* Increase drive strength for DDR modes */ -+ allwinner,drive = ; -+}; -+ -+&r_ir { -+ status = "okay"; -+}; -+ -+&r_rsb { - status = "okay"; - }; - ---- a/arch/arm/dts/sun9i-a80-optimus.dts -+++ b/arch/arm/dts/sun9i-a80-optimus.dts -@@ -65,7 +65,7 @@ - leds { - compatible = "gpio-leds"; - pinctrl-names = "default"; -- pinctrl-0 = <&led_pins_optimus>; -+ pinctrl-0 = <&led_pins_optimus>, <&led_r_pins_optimus>; - - /* The LED names match those found on the board */ - -@@ -74,7 +74,10 @@ - gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; - }; - -- /* led3 is on PM15, in R_PIO */ -+ led3 { -+ label = "optimus:led3:usr"; -+ gpios = <&r_pio 1 15 GPIO_ACTIVE_HIGH>; /* PM15 */ -+ }; - - led4 { - label = "optimus:led4:usr"; -@@ -106,17 +109,6 @@ - status = "okay"; - }; - --&i2c3 { -- pinctrl-names = "default"; -- pinctrl-0 = <&i2c3_pins_a>; -- status = "okay"; --}; -- --&i2c3_pins_a { -- /* Enable internal pull-up */ -- allwinner,pull = ; --}; -- - &ohci0 { - status = "okay"; - }; -@@ -171,30 +163,42 @@ - vmmc-supply = <®_vcc3v0>; - bus-width = <8>; - non-removable; -+ cap-mmc-hw-reset; - status = "okay"; - }; - -+&mmc2_8bit_pins { -+ /* Increase drive strength for DDR modes */ -+ allwinner,drive = ; -+}; -+ - ®_usb1_vbus { - pinctrl-0 = <&usb1_vbus_pin_optimus>; - gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ - status = "okay"; - }; - --&uart0 { -- pinctrl-names = "default"; -- pinctrl-0 = <&uart0_pins_a>; -+&r_ir { - status = "okay"; - }; - --&uart4 { -- pinctrl-names = "default"; -- pinctrl-0 = <&uart4_pins_a>; -+&r_pio { -+ led_r_pins_optimus: led-pins@1 { -+ allwinner,pins = "PM15"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+&r_rsb { - status = "okay"; - }; - --&uart4_pins_a { -- /* Enable internal pull-up */ -- allwinner,pull = ; -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; - }; - - &usbphy1 { ---- a/arch/arm/dts/sun9i-a80.dtsi -+++ b/arch/arm/dts/sun9i-a80.dtsi -@@ -128,6 +128,17 @@ - */ - ranges = <0 0 0 0x20000000>; - -+ /* -+ * This clock is actually configurable from the PRCM address -+ * space. The external 24M oscillator can be turned off, and -+ * the clock switched to an internal 16M RC oscillator. Under -+ * normal operation there's no reason to do this, and the -+ * default is to use the external good one, so just model this -+ * as a fixed clock. Also it is not entirely clear if the -+ * osc24M mux in the PRCM affects the entire clock tree, which -+ * would also throw all the PLL clock rates off, or just the -+ * downstream clocks in the PRCM. -+ */ - osc24M: osc24M_clk { - #clock-cells = <0>; - compatible = "fixed-clock"; -@@ -135,6 +146,13 @@ - clock-output-names = "osc24M"; - }; - -+ /* -+ * The 32k clock is from an external source, normally the -+ * AC100 codec/RTC chip. This clock is by default enabled -+ * and clocked at 32768 Hz, from the oscillator connected -+ * to the AC100. It is configurable, but no such driver or -+ * bindings exist yet. -+ */ - osc32k: osc32k_clk { - #clock-cells = <0>; - compatible = "fixed-clock"; -@@ -164,6 +182,14 @@ - "usb_phy2", "usb_hsic_12M"; - }; - -+ pll3: clk@06000008 { -+ /* placeholder until implemented */ -+ #clock-cells = <0>; -+ compatible = "fixed-clock"; -+ clock-rate = <0>; -+ clock-output-names = "pll3"; -+ }; -+ - pll4: clk@0600000c { - #clock-cells = <0>; - compatible = "allwinner,sun9i-a80-pll4-clk"; -@@ -277,9 +303,12 @@ - compatible = "allwinner,sun9i-a80-ahb0-gates-clk"; - reg = <0x06000580 0x4>; - clocks = <&ahb0>; -- clock-indices = <0>, <1>, <3>, <5>, <8>, <12>, <13>, -- <14>, <15>, <16>, <18>, <20>, <21>, -- <22>, <23>; -+ clock-indices = <0>, <1>, <3>, -+ <5>, <8>, <12>, -+ <13>, <14>, -+ <15>, <16>, <18>, -+ <20>, <21>, <22>, -+ <23>; - clock-output-names = "ahb0_fd", "ahb0_ve", "ahb0_gpu", - "ahb0_ss", "ahb0_sd", "ahb0_nand1", - "ahb0_nand0", "ahb0_sdram", -@@ -293,7 +322,10 @@ - compatible = "allwinner,sun9i-a80-ahb1-gates-clk"; - reg = <0x06000584 0x4>; - clocks = <&ahb1>; -- clock-indices = <0>, <1>, <17>, <21>, <22>, <23>, <24>; -+ clock-indices = <0>, <1>, -+ <17>, <21>, -+ <22>, <23>, -+ <24>; - clock-output-names = "ahb1_usbotg", "ahb1_usbhci", - "ahb1_gmac", "ahb1_msgbox", - "ahb1_spinlock", "ahb1_hstimer", -@@ -305,8 +337,9 @@ - compatible = "allwinner,sun9i-a80-ahb2-gates-clk"; - reg = <0x06000588 0x4>; - clocks = <&ahb2>; -- clock-indices = <0>, <1>, <2>, <4>, <5>, <7>, <8>, -- <11>; -+ clock-indices = <0>, <1>, -+ <2>, <4>, <5>, -+ <7>, <8>, <11>; - clock-output-names = "ahb2_lcd0", "ahb2_lcd1", - "ahb2_edp", "ahb2_csi", "ahb2_hdmi", - "ahb2_de", "ahb2_mp", "ahb2_mipi_dsi"; -@@ -317,8 +350,10 @@ - compatible = "allwinner,sun9i-a80-apb0-gates-clk"; - reg = <0x06000590 0x4>; - clocks = <&apb0>; -- clock-indices = <1>, <5>, <11>, <12>, <13>, <15>, -- <17>, <18>, <19>; -+ clock-indices = <1>, <5>, -+ <11>, <12>, <13>, -+ <15>, <17>, <18>, -+ <19>; - clock-output-names = "apb0_spdif", "apb0_pio", - "apb0_ac97", "apb0_i2s0", "apb0_i2s1", - "apb0_lradc", "apb0_gpadc", "apb0_twd", -@@ -330,14 +365,79 @@ - compatible = "allwinner,sun9i-a80-apb1-gates-clk"; - reg = <0x06000594 0x4>; - clocks = <&apb1>; -- clock-indices = <0>, <1>, <2>, <3>, <4>, -- <16>, <17>, <18>, <19>, <20>, <21>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, <4>, -+ <16>, <17>, -+ <18>, <19>, -+ <20>, <21>; - clock-output-names = "apb1_i2c0", "apb1_i2c1", - "apb1_i2c2", "apb1_i2c3", "apb1_i2c4", - "apb1_uart0", "apb1_uart1", - "apb1_uart2", "apb1_uart3", - "apb1_uart4", "apb1_uart5"; - }; -+ -+ cpus_clk: clk@08001410 { -+ compatible = "allwinner,sun9i-a80-cpus-clk"; -+ reg = <0x08001410 0x4>; -+ #clock-cells = <0>; -+ clocks = <&osc32k>, <&osc24M>, <&pll4>, <&pll3>; -+ clock-output-names = "cpus"; -+ }; -+ -+ ahbs: ahbs_clk { -+ compatible = "fixed-factor-clock"; -+ #clock-cells = <0>; -+ clock-div = <1>; -+ clock-mult = <1>; -+ clocks = <&cpus_clk>; -+ clock-output-names = "ahbs"; -+ }; -+ -+ apbs: clk@0800141c { -+ compatible = "allwinner,sun8i-a23-apb0-clk"; -+ reg = <0x0800141c 0x4>; -+ #clock-cells = <0>; -+ clocks = <&ahbs>; -+ clock-output-names = "apbs"; -+ }; -+ -+ apbs_gates: clk@08001428 { -+ compatible = "allwinner,sun9i-a80-apbs-gates-clk"; -+ reg = <0x08001428 0x4>; -+ #clock-cells = <1>; -+ clocks = <&apbs>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, -+ <4>, <5>, -+ <6>, <7>, -+ <12>, <13>, -+ <16>, <17>, -+ <18>, <20>; -+ clock-output-names = "apbs_pio", "apbs_ir", -+ "apbs_timer", "apbs_rsb", -+ "apbs_uart", "apbs_1wire", -+ "apbs_i2c0", "apbs_i2c1", -+ "apbs_ps2_0", "apbs_ps2_1", -+ "apbs_dma", "apbs_i2s0", -+ "apbs_i2s1", "apbs_twd"; -+ }; -+ -+ r_1wire_clk: clk@08001450 { -+ reg = <0x08001450 0x4>; -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-mod0-clk"; -+ clocks = <&osc32k>, <&osc24M>; -+ clock-output-names = "r_1wire"; -+ }; -+ -+ r_ir_clk: clk@08001454 { -+ reg = <0x08001454 0x4>; -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-mod0-clk"; -+ clocks = <&osc32k>, <&osc24M>; -+ clock-output-names = "r_ir"; -+ }; - }; - - soc { -@@ -443,7 +543,7 @@ - }; - - mmc0: mmc@01c0f000 { -- compatible = "allwinner,sun5i-a13-mmc"; -+ compatible = "allwinner,sun9i-a80-mmc"; - reg = <0x01c0f000 0x1000>; - clocks = <&mmc_config_clk 0>, <&mmc0_clk 0>, - <&mmc0_clk 1>, <&mmc0_clk 2>; -@@ -457,7 +557,7 @@ - }; - - mmc1: mmc@01c10000 { -- compatible = "allwinner,sun5i-a13-mmc"; -+ compatible = "allwinner,sun9i-a80-mmc"; - reg = <0x01c10000 0x1000>; - clocks = <&mmc_config_clk 1>, <&mmc1_clk 0>, - <&mmc1_clk 1>, <&mmc1_clk 2>; -@@ -471,7 +571,7 @@ - }; - - mmc2: mmc@01c11000 { -- compatible = "allwinner,sun5i-a13-mmc"; -+ compatible = "allwinner,sun9i-a80-mmc"; - reg = <0x01c11000 0x1000>; - clocks = <&mmc_config_clk 2>, <&mmc2_clk 0>, - <&mmc2_clk 1>, <&mmc2_clk 2>; -@@ -485,7 +585,7 @@ - }; - - mmc3: mmc@01c12000 { -- compatible = "allwinner,sun5i-a13-mmc"; -+ compatible = "allwinner,sun9i-a80-mmc"; - reg = <0x01c12000 0x1000>; - clocks = <&mmc_config_clk 3>, <&mmc3_clk 0>, - <&mmc3_clk 1>, <&mmc3_clk 2>; -@@ -582,7 +682,7 @@ - clocks = <&apb0_gates 5>; - gpio-controller; - interrupt-controller; -- #interrupt-cells = <2>; -+ #interrupt-cells = <3>; - #size-cells = <0>; - #gpio-cells = <3>; - -@@ -604,7 +704,8 @@ - mmc2_8bit_pins: mmc2_8bit { - allwinner,pins = "PC6", "PC7", "PC8", "PC9", - "PC10", "PC11", "PC12", -- "PC13", "PC14", "PC15"; -+ "PC13", "PC14", "PC15", -+ "PC16"; - allwinner,function = "mmc2"; - allwinner,drive = ; - allwinner,pull = ; -@@ -752,14 +853,83 @@ - interrupts = ; - }; - -+ apbs_rst: reset@080014b0 { -+ reg = <0x080014b0 0x4>; -+ compatible = "allwinner,sun6i-a31-clock-reset"; -+ #reset-cells = <1>; -+ }; -+ -+ nmi_intc: interrupt-controller@080015a0 { -+ compatible = "allwinner,sun9i-a80-nmi"; -+ interrupt-controller; -+ #interrupt-cells = <2>; -+ reg = <0x080015a0 0xc>; -+ interrupts = ; -+ }; -+ -+ r_ir: ir@08002000 { -+ compatible = "allwinner,sun5i-a13-ir"; -+ interrupts = ; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&r_ir_pins>; -+ clocks = <&apbs_gates 1>, <&r_ir_clk>; -+ clock-names = "apb", "ir"; -+ resets = <&apbs_rst 1>; -+ reg = <0x08002000 0x40>; -+ status = "disabled"; -+ }; -+ - r_uart: serial@08002800 { - compatible = "snps,dw-apb-uart"; - reg = <0x08002800 0x400>; - interrupts = ; - reg-shift = <2>; - reg-io-width = <4>; -- clocks = <&osc24M>; -+ clocks = <&apbs_gates 4>; -+ resets = <&apbs_rst 4>; - status = "disabled"; - }; -+ -+ r_pio: pinctrl@08002c00 { -+ compatible = "allwinner,sun9i-a80-r-pinctrl"; -+ reg = <0x08002c00 0x400>; -+ interrupts = , -+ ; -+ clocks = <&apbs_gates 0>; -+ resets = <&apbs_rst 0>; -+ gpio-controller; -+ interrupt-controller; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ #gpio-cells = <3>; -+ -+ r_ir_pins: r_ir { -+ allwinner,pins = "PL6"; -+ allwinner,function = "s_cir_rx"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ r_rsb_pins: r_rsb { -+ allwinner,pins = "PN0", "PN1"; -+ allwinner,function = "s_rsb"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ }; -+ -+ r_rsb: i2c@08003400 { -+ compatible = "allwinner,sun8i-a23-rsb"; -+ reg = <0x08003400 0x400>; -+ interrupts = ; -+ clocks = <&apbs_gates 3>; -+ clock-frequency = <3000000>; -+ resets = <&apbs_rst 3>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&r_rsb_pins>; -+ status = "disabled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; - }; - }; ---- /dev/null -+++ b/arch/arm/dts/sunxi-itead-core-common.dtsi -@@ -0,0 +1,136 @@ -+/* -+ * Copyright 2015 - Marcus Cooper -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file 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. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#include "sunxi-common-regulators.dtsi" -+ -+/ { -+ aliases { -+ serial0 = &uart0; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+}; -+ -+&ehci0 { -+ status = "okay"; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&i2c0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c0_pins_a>; -+ status = "okay"; -+ -+ axp209: pmic@34 { -+ reg = <0x34>; -+ }; -+}; -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+}; -+ -+&ohci0 { -+ status = "okay"; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+#include "axp209.dtsi" -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ -+®_usb1_vbus { -+ status = "okay"; -+}; -+ -+®_usb2_vbus { -+ status = "okay"; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ -+&usbphy { -+ usb1_vbus-supply = <®_usb1_vbus>; -+ usb2_vbus-supply = <®_usb2_vbus>; -+ status = "okay"; -+}; ---- a/arch/arm/dts/sunxi-q8-common.dtsi -+++ b/arch/arm/dts/sunxi-q8-common.dtsi -@@ -75,3 +75,9 @@ - voltage = <400000>; - }; - }; -+ -+&pwm { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm0_pins>; -+ status = "okay"; -+}; diff --git a/package/boot/uboot-sunxi/patches/012-sun6i-fix-clock_twi_onoff.patch b/package/boot/uboot-sunxi/patches/012-sun6i-fix-clock_twi_onoff.patch deleted file mode 100644 index 45416703a4..0000000000 --- a/package/boot/uboot-sunxi/patches/012-sun6i-fix-clock_twi_onoff.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 730d2f3a41c5ccae71b5008fffdf697d143be68c Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Wed, 16 Mar 2016 20:44:51 +0100 -Subject: [PATCH] sunxi: Fix clock_twi_onoff for sun6i - -The clock_sun6i.c implementation was not deasserting the reset for -the regular i2c controllers, this commit fixes this. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell ---- - arch/arm/cpu/armv7/sunxi/clock_sun6i.c | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - ---- a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c -+++ b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c -@@ -100,13 +100,18 @@ int clock_twi_onoff(int port, int state) - return 0; - } - -- /* set the apb clock gate for twi */ -- if (state) -+ /* set the apb clock gate and reset for twi */ -+ if (state) { - setbits_le32(&ccm->apb2_gate, - CLK_GATE_OPEN << (APB2_GATE_TWI_SHIFT+port)); -- else -+ setbits_le32(&ccm->apb2_reset_cfg, -+ 1 << (APB2_RESET_TWI_SHIFT + port)); -+ } else { -+ clrbits_le32(&ccm->apb2_reset_cfg, -+ 1 << (APB2_RESET_TWI_SHIFT + port)); - clrbits_le32(&ccm->apb2_gate, - CLK_GATE_OPEN << (APB2_GATE_TWI_SHIFT+port)); -+ } - - return 0; - } diff --git a/package/boot/uboot-sunxi/patches/013-enable-realtek-phy.patch b/package/boot/uboot-sunxi/patches/013-enable-realtek-phy.patch deleted file mode 100644 index 47f825c570..0000000000 --- a/package/boot/uboot-sunxi/patches/013-enable-realtek-phy.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 1eae8f66ff749409eb96e2f3f3387c56232d0b8a Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Wed, 16 Mar 2016 13:46:22 +0100 -Subject: [PATCH] sunxi: Enable realtek phy support - -Enable building of drivers/net/phy/realtek.c so that realtek phys -get properly initialized. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell ---- - include/configs/sunxi-common.h | 1 + - 1 file changed, 1 insertion(+) - ---- a/include/configs/sunxi-common.h -+++ b/include/configs/sunxi-common.h -@@ -314,6 +314,7 @@ extern int soft_i2c_gpio_scl; - #define CONFIG_PHY_GIGE /* GMAC can use gigabit PHY */ - #define CONFIG_PHY_ADDR 1 - #define CONFIG_MII /* MII PHY management */ -+#define CONFIG_PHY_REALTEK - #endif - - #ifdef CONFIG_USB_EHCI_HCD diff --git a/package/boot/uboot-sunxi/patches/014-fix-gmac-init.patch b/package/boot/uboot-sunxi/patches/014-fix-gmac-init.patch deleted file mode 100644 index cf511ce773..0000000000 --- a/package/boot/uboot-sunxi/patches/014-fix-gmac-init.patch +++ /dev/null @@ -1,127 +0,0 @@ -From fc8991c61c393ce6a9d3dfc97cb56dbbd9e8cbba Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Thu, 17 Mar 2016 13:53:03 +0100 -Subject: [PATCH] sunxi: Fix gmac not working due to cpu_eth_init no longer - being called - -cpu_eth_init is no longer called for dm enabled eth drivers, this -was causing the sunxi gmac eth controller to no longer work in u-boot. - -This commit fixes this by calling the clock, reset and pinmux setup -function from s_init() and enabling the phy power pin (if any) from -board_init(). - -The enabling of phy power cannot be done from s_init because it uses dm -and dm is not ready yet at this point. - -Note that the mdelay is dropped as the phy gets enabled much earlier -now, so it is no longer needed. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell -Tested-by: Karsten Merker -Tested-by: Michael Haas ---- - arch/arm/cpu/armv7/sunxi/board.c | 28 +--------------------------- - arch/arm/include/asm/arch-sunxi/sys_proto.h | 6 +++++- - board/sunxi/board.c | 5 +++++ - board/sunxi/gmac.c | 14 +------------- - 4 files changed, 12 insertions(+), 41 deletions(-) - ---- a/arch/arm/cpu/armv7/sunxi/board.c -+++ b/arch/arm/cpu/armv7/sunxi/board.c -@@ -136,6 +136,7 @@ void s_init(void) - timer_init(); - gpio_init(); - i2c_init_board(); -+ eth_init_board(); - } - - #ifdef CONFIG_SPL_BUILD -@@ -243,30 +244,3 @@ void enable_caches(void) - dcache_enable(); - } - #endif -- --#ifdef CONFIG_CMD_NET --/* -- * Initializes on-chip ethernet controllers. -- * to override, implement board_eth_init() -- */ --int cpu_eth_init(bd_t *bis) --{ -- __maybe_unused int rc; -- --#ifdef CONFIG_MACPWR -- gpio_request(CONFIG_MACPWR, "macpwr"); -- gpio_direction_output(CONFIG_MACPWR, 1); -- mdelay(200); --#endif -- --#ifdef CONFIG_SUNXI_GMAC -- rc = sunxi_gmac_initialize(bis); -- if (rc < 0) { -- printf("sunxi: failed to initialize gmac\n"); -- return rc; -- } --#endif -- -- return 0; --} --#endif ---- a/arch/arm/include/asm/arch-sunxi/sys_proto.h -+++ b/arch/arm/include/asm/arch-sunxi/sys_proto.h -@@ -24,6 +24,10 @@ void sdelay(unsigned long); - void return_to_fel(uint32_t lr, uint32_t sp); - - /* Board / SoC level designware gmac init */ --int sunxi_gmac_initialize(bd_t *bis); -+#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUNXI_GMAC -+void eth_init_board(void); -+#else -+static inline void eth_init_board(void) {} -+#endif - - #endif ---- a/board/sunxi/board.c -+++ b/board/sunxi/board.c -@@ -90,6 +90,11 @@ int board_init(void) - if (ret) - return ret; - -+#ifdef CONFIG_MACPWR -+ gpio_request(CONFIG_MACPWR, "macpwr"); -+ gpio_direction_output(CONFIG_MACPWR, 1); -+#endif -+ - /* Uses dm gpio code so do this here and not in i2c_init_board() */ - return soft_i2c_board_init(); - } ---- a/board/sunxi/gmac.c -+++ b/board/sunxi/gmac.c -@@ -6,7 +6,7 @@ - #include - #include - --int sunxi_gmac_initialize(bd_t *bis) -+void eth_init_board(void) - { - int pin; - struct sunxi_ccm_reg *const ccm = -@@ -79,16 +79,4 @@ int sunxi_gmac_initialize(bd_t *bis) - for (pin = SUNXI_GPA(26); pin <= SUNXI_GPA(27); pin++) - sunxi_gpio_set_cfgpin(pin, SUN6I_GPA_GMAC); - #endif -- --#ifdef CONFIG_DM_ETH -- return 0; --#else --# ifdef CONFIG_RGMII -- return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_RGMII); --# elif defined CONFIG_GMII -- return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_GMII); --# else -- return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_MII); --# endif --#endif - } diff --git a/package/boot/uboot-sunxi/patches/015-fix-2nd-usb-ctrler-on-sun47i.patch b/package/boot/uboot-sunxi/patches/015-fix-2nd-usb-ctrler-on-sun47i.patch deleted file mode 100644 index 95a77c68d6..0000000000 --- a/package/boot/uboot-sunxi/patches/015-fix-2nd-usb-ctrler-on-sun47i.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 948603d4d637a0e04a3214253b911cfc4ed11220 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 21 Mar 2016 14:44:35 +0100 -Subject: [PATCH] sunxi: Fix 2nd usb controller on sun4i/sun7i no longer - working - -The 2nd usb controller on sun4i/sun7i has its base address 0x8000 -bytes from the 1st one, rather then 0x1000. Also the ahb clk gates -are interleaved with the ohci clk-gates introducing a hole between -the clks for usb1 and usb2. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell ---- - drivers/usb/host/ehci-sunxi.c | 13 +++++++++++-- - drivers/usb/host/ohci-sunxi.c | 15 ++++++++++++--- - 2 files changed, 23 insertions(+), 5 deletions(-) - ---- a/drivers/usb/host/ehci-sunxi.c -+++ b/drivers/usb/host/ehci-sunxi.c -@@ -17,6 +17,14 @@ - #include - #include "ehci.h" - -+#ifdef CONFIG_SUNXI_GEN_SUN4I -+#define BASE_DIST 0x8000 -+#define AHB_CLK_DIST 2 -+#else -+#define BASE_DIST 0x1000 -+#define AHB_CLK_DIST 1 -+#endif -+ - struct ehci_sunxi_priv { - struct ehci_ctrl ehci; - int ahb_gate_mask; /* Mask of ahb_gate0 clk gate bits for this hcd */ -@@ -39,8 +47,9 @@ static int ehci_usb_probe(struct udevice - #ifdef CONFIG_MACH_SUN8I_H3 - priv->ahb_gate_mask |= 1 << AHB_GATE_OFFSET_USB_OHCI0; - #endif -- priv->phy_index = ((u32)hccr - SUNXI_USB1_BASE) / 0x1000 + 1; -- priv->ahb_gate_mask <<= priv->phy_index - 1; -+ priv->phy_index = ((u32)hccr - SUNXI_USB1_BASE) / BASE_DIST; -+ priv->ahb_gate_mask <<= priv->phy_index * AHB_CLK_DIST; -+ priv->phy_index++; /* Non otg phys start at 1 */ - - setbits_le32(&ccm->ahb_gate0, priv->ahb_gate_mask); - #ifdef CONFIG_SUNXI_GEN_SUN6I ---- a/drivers/usb/host/ohci-sunxi.c -+++ b/drivers/usb/host/ohci-sunxi.c -@@ -17,6 +17,14 @@ - #include - #include "ohci.h" - -+#ifdef CONFIG_SUNXI_GEN_SUN4I -+#define BASE_DIST 0x8000 -+#define AHB_CLK_DIST 2 -+#else -+#define BASE_DIST 0x1000 -+#define AHB_CLK_DIST 1 -+#endif -+ - struct ohci_sunxi_priv { - ohci_t ohci; - int ahb_gate_mask; /* Mask of ahb_gate0 clk gate bits for this hcd */ -@@ -42,9 +50,10 @@ static int ohci_usb_probe(struct udevice - priv->ahb_gate_mask |= 1 << AHB_GATE_OFFSET_USB_EHCI0; - #endif - priv->usb_gate_mask = CCM_USB_CTRL_OHCI0_CLK; -- priv->phy_index = ((u32)regs - (SUNXI_USB1_BASE + 0x400)) / 0x1000 + 1; -- priv->ahb_gate_mask <<= priv->phy_index - 1; -- priv->usb_gate_mask <<= priv->phy_index - 1; -+ priv->phy_index = ((u32)regs - (SUNXI_USB1_BASE + 0x400)) / BASE_DIST; -+ priv->ahb_gate_mask <<= priv->phy_index * AHB_CLK_DIST; -+ priv->usb_gate_mask <<= priv->phy_index; -+ priv->phy_index++; /* Non otg phys start at 1 */ - - setbits_le32(&ccm->ahb_gate0, priv->ahb_gate_mask); - setbits_le32(&ccm->usb_clk_cfg, priv->usb_gate_mask); diff --git a/package/boot/uboot-sunxi/patches/016-spl-print-mmc-slot.patch b/package/boot/uboot-sunxi/patches/016-spl-print-mmc-slot.patch deleted file mode 100644 index 04a2af72ee..0000000000 --- a/package/boot/uboot-sunxi/patches/016-spl-print-mmc-slot.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 8f10b5c65611e6c15a113bf63289b6696452f90d Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Sun, 20 Mar 2016 14:17:10 +0100 -Subject: [PATCH] spl: Print from which mmc slot spl is trying to boot - -On some sunxi boards (and presumably also non sunxi boards) u-boot can -be either loaded from a sdcard in a micro-sd slot, or from eMMC. - -Print which MMC spl tries to boot from, to help debugging. - -Signed-off-by: Hans de Goede -Reviewed-by: Tom Rini ---- - common/spl/spl.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/common/spl/spl.c -+++ b/common/spl/spl.c -@@ -210,9 +210,9 @@ struct boot_device_name boot_name_table[ - { BOOT_DEVICE_RAM, "RAM" }, - #endif - #ifdef CONFIG_SPL_MMC_SUPPORT -- { BOOT_DEVICE_MMC1, "MMC" }, -- { BOOT_DEVICE_MMC2, "MMC" }, -- { BOOT_DEVICE_MMC2_2, "MMC" }, -+ { BOOT_DEVICE_MMC1, "MMC1" }, -+ { BOOT_DEVICE_MMC2, "MMC2" }, -+ { BOOT_DEVICE_MMC2_2, "MMC2_2" }, - #endif - #ifdef CONFIG_SPL_NAND_SUPPORT - { BOOT_DEVICE_NAND, "NAND" }, diff --git a/package/boot/uboot-sunxi/patches/017-usb-add-support-for-usb3-vbus-pin.patch b/package/boot/uboot-sunxi/patches/017-usb-add-support-for-usb3-vbus-pin.patch deleted file mode 100644 index 098fe72035..0000000000 --- a/package/boot/uboot-sunxi/patches/017-usb-add-support-for-usb3-vbus-pin.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 60fa63012fcdc3c4ec1497bf5e358f0a90b40949 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Fri, 18 Mar 2016 08:42:01 +0100 -Subject: [PATCH] sunxi: Add support for USB vbus pin for USB3 - -The H3 has USB0 - USB3, add support for having a USB vbus pin for USB3. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell ---- - arch/arm/cpu/armv7/sunxi/usb_phy.c | 1 + - board/sunxi/Kconfig | 6 ++++++ - 2 files changed, 7 insertions(+) - ---- a/arch/arm/cpu/armv7/sunxi/usb_phy.c -+++ b/arch/arm/cpu/armv7/sunxi/usb_phy.c -@@ -76,6 +76,7 @@ static int get_vbus_gpio(int index) - case 0: return sunxi_name_to_gpio(CONFIG_USB0_VBUS_PIN); - case 1: return sunxi_name_to_gpio(CONFIG_USB1_VBUS_PIN); - case 2: return sunxi_name_to_gpio(CONFIG_USB2_VBUS_PIN); -+ case 3: return sunxi_name_to_gpio(CONFIG_USB3_VBUS_PIN); - } - return -EINVAL; - } ---- a/board/sunxi/Kconfig -+++ b/board/sunxi/Kconfig -@@ -341,6 +341,12 @@ config USB2_VBUS_PIN - ---help--- - See USB1_VBUS_PIN help text. - -+config USB3_VBUS_PIN -+ string "Vbus enable pin for usb3 (ehci2)" -+ default "" -+ ---help--- -+ See USB1_VBUS_PIN help text. -+ - config I2C0_ENABLE - bool "Enable I2C/TWI controller 0" - default y if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I diff --git a/package/boot/uboot-sunxi/patches/018-usb-specify-vbus-pins-on-orangepis.patch b/package/boot/uboot-sunxi/patches/018-usb-specify-vbus-pins-on-orangepis.patch deleted file mode 100644 index a216bc9f11..0000000000 --- a/package/boot/uboot-sunxi/patches/018-usb-specify-vbus-pins-on-orangepis.patch +++ /dev/null @@ -1,31 +0,0 @@ -From ce0d0926758f631fdd655d438acd32d5935d43a4 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Fri, 18 Mar 2016 08:45:21 +0100 -Subject: [PATCH] sunxi: Specify USB vbus pins for orangepi boards - -This fixes the USB ports not working on the orangepi_plus and stops us -from messing with gpio-s which we should not touch on the orangepi_pc. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell ---- - configs/orangepi_pc_defconfig | 3 +++ - configs/orangepi_plus_defconfig | 1 + - 2 files changed, 4 insertions(+) - ---- a/configs/orangepi_pc_defconfig -+++ b/configs/orangepi_pc_defconfig -@@ -14,3 +14,6 @@ CONFIG_SPL=y - CONFIG_CMD_GPIO=y - CONFIG_SY8106A_POWER=y - CONFIG_USB_EHCI_HCD=y -+CONFIG_USB1_VBUS_PIN="" -+CONFIG_USB2_VBUS_PIN="" -+CONFIG_USB3_VBUS_PIN="" ---- a/configs/orangepi_plus_defconfig -+++ b/configs/orangepi_plus_defconfig -@@ -14,3 +14,4 @@ CONFIG_SPL=y - CONFIG_CMD_GPIO=y - CONFIG_SY8106A_POWER=y - CONFIG_USB_EHCI_HCD=y -+CONFIG_USB1_VBUS_PIN="PG13" diff --git a/package/boot/uboot-sunxi/patches/019-sid-add-efuse-support-for-h3-a83t.patch b/package/boot/uboot-sunxi/patches/019-sid-add-efuse-support-for-h3-a83t.patch deleted file mode 100644 index e7b8cd73df..0000000000 --- a/package/boot/uboot-sunxi/patches/019-sid-add-efuse-support-for-h3-a83t.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 70fe24ed93fa90eb407d18a5fc9d9ad85ac9184c Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Wed, 27 Jan 2016 16:34:43 +0800 -Subject: [PATCH] sunxi: Support SID e-fuses on A83T and H3 - -On the A83T and H3, the SID block is at a different address. -Furthurmore, the e-fuses are at an offset of 0x200 within the -hardware's address space. - -Signed-off-by: Chen-Yu Tsai -Acked-by: Hans de Goede -Signed-off-by: Hans de Goede ---- - arch/arm/include/asm/arch-sunxi/cpu_sun4i.h | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h -+++ b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h -@@ -82,7 +82,14 @@ - #define SUNXI_AD_DA_BASE 0x01c22c00 - #define SUNXI_KEYPAD_BASE 0x01c23000 - #define SUNXI_TZPC_BASE 0x01c23400 -+ -+#if defined(CONFIG_MACH_SUN8I_A83T) || defined(CONFIG_MACH_SUN8I_H3) -+/* SID address space starts at 0x01c1400, but e-fuse is at offset 0x200 */ -+#define SUNXI_SID_BASE 0x01c14200 -+#else - #define SUNXI_SID_BASE 0x01c23800 -+#endif -+ - #define SUNXI_SJTAG_BASE 0x01c23c00 - - #define SUNXI_TP_BASE 0x01c25000 diff --git a/package/boot/uboot-sunxi/patches/020-boot-display-board-model-on-startup.patch b/package/boot/uboot-sunxi/patches/020-boot-display-board-model-on-startup.patch deleted file mode 100644 index d49fc97373..0000000000 --- a/package/boot/uboot-sunxi/patches/020-boot-display-board-model-on-startup.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 2af25b747340c6c8f6a6b9e27632db577bf4da52 Mon Sep 17 00:00:00 2001 -From: Simon Glass -Date: Mon, 22 Feb 2016 22:55:46 -0700 -Subject: [PATCH] sunxi: Display the board model on start-up - -It is useful to know which sunxi board you are booting. Display this on -start-up to avoid confusion. - -Signed-off-by: Simon Glass ---- - include/configs/sunxi-common.h | 1 + - 1 file changed, 1 insertion(+) - ---- a/include/configs/sunxi-common.h -+++ b/include/configs/sunxi-common.h -@@ -174,6 +174,7 @@ - - #define CONFIG_SYS_MONITOR_LEN (768 << 10) /* 768 KiB */ - #define CONFIG_IDENT_STRING " Allwinner Technology" -+#define CONFIG_DISPLAY_BOARDINFO - - #define CONFIG_ENV_OFFSET (544 << 10) /* (8 + 24 + 512) KiB */ - #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */ diff --git a/package/boot/uboot-sunxi/patches/060-sun7i-Add-support-for-Olimex-A20-OLinuXino-LIME2-eMM.patch b/package/boot/uboot-sunxi/patches/060-sun7i-Add-support-for-Olimex-A20-OLinuXino-LIME2-eMM.patch new file mode 100644 index 0000000000..a7bfdd62d7 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/060-sun7i-Add-support-for-Olimex-A20-OLinuXino-LIME2-eMM.patch @@ -0,0 +1,76 @@ +From 335d30050b0d02444c9297f7a9b0cbf75dce847f Mon Sep 17 00:00:00 2001 +From: Olliver Schinagl +Date: Fri, 12 May 2017 11:38:54 +0200 +Subject: sun7i: Add support for Olimex A20-OLinuXino-LIME2-eMMC + +This patch adds support for the Olimex OLinuXino Lime2 with eMMC flash +storage. +https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXino-LIME2-eMMC/ + +It is a assembly variant of the regular Lime2 but featuring eMMC for +storage. + +Signed-off-by: Olliver Schinagl +Signed-off-by: Jagan Teki +Acked-by: Maxime Ripard +Reviewed-by: Jagan Teki +--- + board/sunxi/MAINTAINERS | 5 +++++ + configs/A20-OLinuXino-Lime2-eMMC_defconfig | 36 ++++++++++++++++++++++++++++++ + 2 files changed, 41 insertions(+) + create mode 100644 configs/A20-OLinuXino-Lime2-eMMC_defconfig + +--- a/board/sunxi/MAINTAINERS ++++ b/board/sunxi/MAINTAINERS +@@ -88,6 +88,11 @@ M: Iain Paton + S: Maintained + F: configs/A20-OLinuXino-Lime2_defconfig + ++A20-OLINUXINO-LIME2-EMMC BOARD ++M: Olliver Schinagl ++S: Maintained ++F: configs/A20-OLinuXino-Lime2-eMMC_defconfig ++ + A33-OLINUXINO BOARD + M: Stefan Mavrodiev + S: Maintained +--- /dev/null ++++ b/configs/A20-OLinuXino-Lime2-eMMC_defconfig +@@ -0,0 +1,37 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_SUNXI=y ++CONFIG_MACH_SUN7I=y ++CONFIG_DRAM_CLK=384 ++CONFIG_MMC0_CD_PIN="PH1" ++CONFIG_MMC_SUNXI_SLOT_EXTRA=2 ++CONFIG_USB0_VBUS_PIN="PC17" ++CONFIG_USB0_VBUS_DET="PH5" ++CONFIG_I2C1_ENABLE=y ++CONFIG_SATAPWR="PC3" ++CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime2-emmc" ++CONFIG_AHCI=y ++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set ++CONFIG_SPL=y ++CONFIG_SPL_I2C_SUPPORT=y ++# CONFIG_CMD_IMLS is not set ++# CONFIG_CMD_FLASH is not set ++CONFIG_CMD_DFU=y ++CONFIG_CMD_USB_MASS_STORAGE=y ++# CONFIG_CMD_FPGA is not set ++# CONFIG_SPL_DOS_PARTITION is not set ++# CONFIG_SPL_ISO_PARTITION is not set ++# CONFIG_SPL_PARTITION_UUIDS is not set ++CONFIG_DFU_RAM=y ++CONFIG_ETH_DESIGNWARE=y ++CONFIG_RGMII=y ++CONFIG_SUN7I_GMAC=y ++CONFIG_GMAC_TX_DELAY=1 ++CONFIG_AXP_ALDO3_VOLT=2800 ++CONFIG_AXP_ALDO4_VOLT=2800 ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_MUSB_GADGET=y ++CONFIG_USB_GADGET=y ++CONFIG_USB_GADGET_DOWNLOAD=y ++CONFIG_G_DNL_MANUFACTURER="Allwinner Technology" ++CONFIG_G_DNL_VENDOR_NUM=0x1f3a ++CONFIG_G_DNL_PRODUCT_NUM=0x1010 diff --git a/package/boot/uboot-sunxi/patches/061-ARM-dts-sunxi-Change-node-name-for-pwrseq-pin-on-Oli.patch b/package/boot/uboot-sunxi/patches/061-ARM-dts-sunxi-Change-node-name-for-pwrseq-pin-on-Oli.patch new file mode 100644 index 0000000000..8db3e67e58 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/061-ARM-dts-sunxi-Change-node-name-for-pwrseq-pin-on-Oli.patch @@ -0,0 +1,31 @@ +From fb7fe04da2187b9853d713cb643d01bd56813e3d Mon Sep 17 00:00:00 2001 +From: Emmanuel Vadot +Date: Fri, 12 May 2017 11:38:53 +0200 +Subject: ARM: dts: sunxi: Change node name for pwrseq pin on + Olinuxino-lime2-emmc + +The node name for the power seq pin is mmc2@0 like the mmc2_pins_a one. +This makes the original node (mmc2_pins_a) scrapped out of the dtb and +result in a unusable eMMC if U-Boot didn't configured the pins to the +correct functions. + +Signed-off-by: Emmanuel Vadot +Signed-off-by: Maxime Ripard +Signed-off-by: Olliver Schinagl +Acked-by: Maxime Ripard +Reviewed-by: Jagan Teki +--- + arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc.dts ++++ b/arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc.dts +@@ -56,7 +56,7 @@ + }; + + &pio { +- mmc2_pins_nrst: mmc2@0 { ++ mmc2_pins_nrst: mmc2-rst-pin { + allwinner,pins = "PC16"; + allwinner,function = "gpio_out"; + allwinner,drive = ; diff --git a/package/boot/uboot-sunxi/patches/062-A20-improve-gmac-upload.patch b/package/boot/uboot-sunxi/patches/062-A20-improve-gmac-upload.patch new file mode 100644 index 0000000000..df2300194c --- /dev/null +++ b/package/boot/uboot-sunxi/patches/062-A20-improve-gmac-upload.patch @@ -0,0 +1,12 @@ + GNU nano 2.7.4 File: 062-A20-improve-gmac-upload.patch + +--- a/configs/A20-OLinuXino-Lime2_defconfig ++++ b/configs/A20-OLinuXino-Lime2_defconfig +@@ -24,6 +24,7 @@ CONFIG_DFU_RAM=y + CONFIG_ETH_DESIGNWARE=y + CONFIG_RGMII=y + CONFIG_SUN7I_GMAC=y ++CONFIG_GMAC_TX_DELAY=1 + CONFIG_AXP_ALDO3_VOLT=2800 + CONFIG_AXP_ALDO4_VOLT=2800 + CONFIG_USB_EHCI_HCD=y diff --git a/package/boot/uboot-sunxi/patches/091-sun6i-sync-PLL1-multdiv-with-Boot1.patch b/package/boot/uboot-sunxi/patches/091-sun6i-sync-PLL1-multdiv-with-Boot1.patch index a402feb3cd..40d79878ad 100644 --- a/package/boot/uboot-sunxi/patches/091-sun6i-sync-PLL1-multdiv-with-Boot1.patch +++ b/package/boot/uboot-sunxi/patches/091-sun6i-sync-PLL1-multdiv-with-Boot1.patch @@ -12,9 +12,9 @@ More specifically, the following settings are now used: * up to 1152MHz: mul=3, div=2 (unchanged) * above 1152MHz: mul=4, div=2 (was: mul=2, div=1) ---- a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c -+++ b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c -@@ -122,11 +122,12 @@ void clock_set_pll1(unsigned int clk) +--- a/arch/arm/mach-sunxi/clock_sun6i.c ++++ b/arch/arm/mach-sunxi/clock_sun6i.c +@@ -107,11 +107,12 @@ void clock_set_pll1(unsigned int clk) struct sunxi_ccm_reg * const ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; const int p = 0; diff --git a/package/boot/uboot-sunxi/patches/093-sun6i-fix-PLL-LDO-voltselect.patch b/package/boot/uboot-sunxi/patches/093-sun6i-fix-PLL-LDO-voltselect.patch index d200633bc2..a8e03e2fb2 100644 --- a/package/boot/uboot-sunxi/patches/093-sun6i-fix-PLL-LDO-voltselect.patch +++ b/package/boot/uboot-sunxi/patches/093-sun6i-fix-PLL-LDO-voltselect.patch @@ -16,9 +16,9 @@ order of magnitude as Boot1. Furthermore, a bit of documentation is added to clarify that the required setting for the PLL LDO is 1.37v as per the A31 manual. ---- a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c -+++ b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c -@@ -24,14 +24,27 @@ void clock_init_safe(void) +--- a/arch/arm/mach-sunxi/clock_sun6i.c ++++ b/arch/arm/mach-sunxi/clock_sun6i.c +@@ -26,13 +26,26 @@ void clock_init_safe(void) struct sunxi_prcm_reg * const prcm = (struct sunxi_prcm_reg *)SUNXI_PRCM_BASE; @@ -34,9 +34,9 @@ required setting for the PLL LDO is 1.37v as per the A31 manual. clrsetbits_le32(&prcm->pll_ctrl1, ~PRCM_PLL_CTRL_LDO_KEY_MASK, PRCM_PLL_CTRL_LDO_DIGITAL_EN | PRCM_PLL_CTRL_LDO_ANALOG_EN | - PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1140)); -+ PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1370) ); ++ PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1370)); clrbits_le32(&prcm->pll_ctrl1, PRCM_PLL_CTRL_LDO_KEY_MASK); - ++ + /* Give the PLL LDO voltage setting some time to take hold. + * Notes: + * 1) We need to use sdelay() as the timers aren't set up yet. @@ -44,10 +44,9 @@ required setting for the PLL LDO is 1.37v as per the A31 manual. + * iterations through a loop. + */ + sdelay(100000); -+ - clock_set_pll1(408000000); + #endif - writel(PLL6_CFG_DEFAULT, &ccm->pll6_cfg); + #if defined(CONFIG_MACH_SUN8I_R40) || defined(CONFIG_MACH_SUN50I) --- a/arch/arm/include/asm/arch-sunxi/prcm.h +++ b/arch/arm/include/asm/arch-sunxi/prcm.h @@ -111,13 +111,13 @@ diff --git a/package/boot/uboot-sunxi/patches/100-sun6i-alternate-on-UART2.patch b/package/boot/uboot-sunxi/patches/100-sun6i-alternate-on-UART2.patch index bf5dc66e1a..8bab220518 100644 --- a/package/boot/uboot-sunxi/patches/100-sun6i-alternate-on-UART2.patch +++ b/package/boot/uboot-sunxi/patches/100-sun6i-alternate-on-UART2.patch @@ -6,11 +6,11 @@ Subject: sun6i: define alternate-function for UART2 on GPG --- a/arch/arm/include/asm/arch-sunxi/gpio.h +++ b/arch/arm/include/asm/arch-sunxi/gpio.h -@@ -180,6 +180,7 @@ enum sunxi_gpio_number { +@@ -186,6 +186,7 @@ enum sunxi_gpio_number { #define SUN6I_GPG_SDC1 2 #define SUN8I_GPG_SDC1 2 #define SUN6I_GPG_TWI3 2 +#define SUN6I_GPG_UART2 2 #define SUN5I_GPG_UART1 4 - #define SUN4I_GPH_SDC1 5 + #define SUN6I_GPH_PWM 2 diff --git a/package/boot/uboot-sunxi/patches/101-sun6i-support-console-on-UART2.patch b/package/boot/uboot-sunxi/patches/101-sun6i-support-console-on-UART2.patch index 087074d0c9..d140f2d538 100644 --- a/package/boot/uboot-sunxi/patches/101-sun6i-support-console-on-UART2.patch +++ b/package/boot/uboot-sunxi/patches/101-sun6i-support-console-on-UART2.patch @@ -4,9 +4,9 @@ Date: Tue, 16 Jun 2015 10:53:11 +0200 Subject: ARM: sun6i: Support console on UART2 (GPG6/GPG7) ---- a/arch/arm/cpu/armv7/sunxi/board.c -+++ b/arch/arm/cpu/armv7/sunxi/board.c -@@ -88,6 +88,10 @@ static int gpio_init(void) +--- a/arch/arm/mach-sunxi/board.c ++++ b/arch/arm/mach-sunxi/board.c +@@ -126,6 +126,10 @@ static int gpio_init(void) sunxi_gpio_set_cfgpin(SUNXI_GPG(3), SUN5I_GPG_UART1); sunxi_gpio_set_cfgpin(SUNXI_GPG(4), SUN5I_GPG_UART1); sunxi_gpio_set_pull(SUNXI_GPG(4), SUNXI_GPIO_PULL_UP); @@ -19,7 +19,7 @@ Subject: ARM: sun6i: Support console on UART2 (GPG6/GPG7) sunxi_gpio_set_cfgpin(SUNXI_GPB(1), SUN8I_GPB_UART2); --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h -@@ -260,6 +260,8 @@ extern int soft_i2c_gpio_scl; +@@ -259,6 +259,8 @@ extern int soft_i2c_gpio_scl; #endif #elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUN5I) #define OF_STDOUT_PATH "/soc@01c00000/serial@01c28400:115200" diff --git a/package/boot/uboot-sunxi/patches/102-sunxi-make_CONS_INDEX-configurable.patch b/package/boot/uboot-sunxi/patches/102-sunxi-make_CONS_INDEX-configurable.patch index ee1e3c9bfa..41039796a0 100644 --- a/package/boot/uboot-sunxi/patches/102-sunxi-make_CONS_INDEX-configurable.patch +++ b/package/boot/uboot-sunxi/patches/102-sunxi-make_CONS_INDEX-configurable.patch @@ -4,9 +4,9 @@ Date: Tue, 16 Jun 2015 10:59:38 +0200 Subject: ARM: sunxi: Make CONS_INDEX configurable ---- a/board/sunxi/Kconfig -+++ b/board/sunxi/Kconfig -@@ -229,6 +229,14 @@ config SYS_BOARD +--- a/arch/arm/mach-sunxi/Kconfig ++++ b/arch/arm/mach-sunxi/Kconfig +@@ -412,6 +412,14 @@ config SYS_BOARD config SYS_SOC default "sunxi" diff --git a/package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch b/package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch new file mode 100644 index 0000000000..d61895a3f9 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch @@ -0,0 +1,35 @@ +From 5b707cdadb35d896daafff52983416e1c617745b Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Wed, 19 Jul 2017 22:23:15 +0200 +Subject: [PATCH] mkimage: check environment for dtc binary location + +Currently mkimage assumes the dtc binary is in the path and fails +otherwise. This patch makes it check the DTC environment variable first +for the dtc binary and then fall back to the default path. This makes +it possible to call the u-boot build with make DTC=... and build a fit +image with the dtc binary not being the the default path. + +Signed-off-by: Hauke Mehrtens +Cc: Simon Glass +--- + tools/fit_image.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/tools/fit_image.c ++++ b/tools/fit_image.c +@@ -647,9 +647,14 @@ static int fit_handle_file(struct image_ + } + *cmd = '\0'; + } else if (params->datafile) { ++ const char* dtc = getenv("DTC"); ++ ++ if (!dtc) ++ dtc = MKIMAGE_DTC; ++ + /* dtc -I dts -O dtb -p 500 datafile > tmpfile */ + snprintf(cmd, sizeof(cmd), "%s %s %s > %s", +- MKIMAGE_DTC, params->dtc, params->datafile, tmpfile); ++ dtc, params->dtc, params->datafile, tmpfile); + debug("Trying to execute \"%s\"\n", cmd); + } else { + snprintf(cmd, sizeof(cmd), "cp %s %s", diff --git a/package/boot/uboot-sunxi/patches/210-Revert-fdt-Makefile-Build-python-libfdt-library-if-n.patch b/package/boot/uboot-sunxi/patches/210-Revert-fdt-Makefile-Build-python-libfdt-library-if-n.patch new file mode 100644 index 0000000000..25edf5104c --- /dev/null +++ b/package/boot/uboot-sunxi/patches/210-Revert-fdt-Makefile-Build-python-libfdt-library-if-n.patch @@ -0,0 +1,89 @@ +From eed65e5c25cbc4b6e893f140e9d7898f4624c114 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Wed, 19 Jul 2017 23:12:38 +0200 +Subject: [PATCH 210/213] Revert "fdt: Makefile: Build python libfdt library if + needed" + +This reverts commit e38ffc42674fedc750ca895046be0bd983b56dd5. +--- + Makefile | 17 ++--------------- + scripts/Makefile.spl | 17 ++++------------- + 2 files changed, 6 insertions(+), 28 deletions(-) + +--- a/Makefile ++++ b/Makefile +@@ -1116,7 +1116,7 @@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \ + + u-boot.rom: u-boot-x86-16bit.bin u-boot.bin \ + $(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \ +- $(if $(CONFIG_HAVE_REFCODE),refcode.bin) checkbinman FORCE ++ $(if $(CONFIG_HAVE_REFCODE),refcode.bin) FORCE + $(call if_changed,binman) + + OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec +@@ -1125,8 +1125,7 @@ u-boot-x86-16bit.bin: u-boot FORCE + endif + + ifneq ($(CONFIG_ARCH_SUNXI),) +-u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb \ +- checkbinman FORCE ++u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE + $(call if_changed,binman) + endif + +@@ -1355,18 +1354,6 @@ $(version_h): include/config/uboot.relea + $(timestamp_h): $(srctree)/Makefile FORCE + $(call filechk,timestamp.h) + +-checkbinman: tools +- @if ! ( echo 'import libfdt' | ( PYTHONPATH=tools python )); then \ +- echo >&2; \ +- echo >&2 '*** binman needs the Python libfdt library.'; \ +- echo >&2 '*** Either install it on your system, or try:'; \ +- echo >&2 '***'; \ +- echo >&2 '*** sudo apt-get install swig libpython-dev'; \ +- echo >&2 '***'; \ +- echo >&2 '*** to have U-Boot build its own version.'; \ +- false; \ +- fi +- + # --------------------------------------------------------------------------- + quiet_cmd_cpp_lds = LDS $@ + cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) \ +--- a/scripts/Makefile.spl ++++ b/scripts/Makefile.spl +@@ -257,12 +257,14 @@ PHONY += dts_dir + dts_dir: + $(shell [ -d $(obj)/dts ] || mkdir -p $(obj)/dts) + +-include/generated/dt-structs.h: $(obj)/$(SPL_BIN).dtb dts_dir checkdtoc ++include/generated/dt-structs.h: $(obj)/$(SPL_BIN).dtb dts_dir dtoc + $(call if_changed,dtoch) + +-$(obj)/dts/dt-platdata.c: $(obj)/$(SPL_BIN).dtb dts_dir checkdtoc ++$(obj)/dts/dt-platdata.c: $(obj)/$(SPL_BIN).dtb dts_dir dtoc + $(call if_changed,dtocc) + ++dtoc: #$(objtree)/tools/_libfdt.so ++ + ifdef CONFIG_SAMSUNG + ifdef CONFIG_VAR_SIZE_SPL + VAR_SIZE_PARAM = --vs +@@ -355,17 +357,6 @@ ifneq ($(cmd_files),) + include $(cmd_files) + endif + +-checkdtoc: tools +- @if ! ( echo 'import libfdt' | ( PYTHONPATH=tools python )); then \ +- echo '*** dtoc needs the Python libfdt library. Either '; \ +- echo '*** install it on your system, or try:'; \ +- echo '***'; \ +- echo '*** sudo apt-get install swig libpython-dev'; \ +- echo '***'; \ +- echo '*** to have U-Boot build its own version.'; \ +- false; \ +- fi +- + PHONY += FORCE + FORCE: + diff --git a/package/boot/uboot-sunxi/patches/211-Revert-scripts-Makefile.lib-Always-have-.-u-boot.dts.patch b/package/boot/uboot-sunxi/patches/211-Revert-scripts-Makefile.lib-Always-have-.-u-boot.dts.patch new file mode 100644 index 0000000000..d40238d3a4 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/211-Revert-scripts-Makefile.lib-Always-have-.-u-boot.dts.patch @@ -0,0 +1,26 @@ +From cdee74ad13e933631caf7f544c319d8e981c6063 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Thu, 20 Jul 2017 19:49:25 +0200 +Subject: [PATCH 211/213] Revert "scripts/Makefile.lib: Always have + ...-u-boot.dtsi be able to override" + +This reverts commit 7452946e7f3742b3ff1cb4a50603e7492aceea88. +--- + scripts/Makefile.lib | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/scripts/Makefile.lib ++++ b/scripts/Makefile.lib +@@ -306,10 +306,10 @@ $(obj)/%.dtb.S: $(obj)/%.dtb + + quiet_cmd_dtc = DTC $@ + # Modified for U-Boot +-# Bring in any U-Boot-specific include at the end of the file ++# Bring in any U-Boot-specific include after the '/dts-v1/;' header + cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ + cat $< $(if $(u_boot_dtsi),\ +- | sed "$$ a\#include \"$(u_boot_dtsi)\"") | \ ++ | sed '/^\/ {$$/{x;s%$$%\#include \"$(u_boot_dtsi)\"%;G;}') | \ + $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \ + $(DTC) -O dtb -o $@ -b 0 \ + -i $(dir $<) $(DTC_FLAGS) \ diff --git a/package/boot/uboot-sunxi/patches/212-Revert-Avoid-non-portable-sed-construct.patch b/package/boot/uboot-sunxi/patches/212-Revert-Avoid-non-portable-sed-construct.patch new file mode 100644 index 0000000000..1a5603417a --- /dev/null +++ b/package/boot/uboot-sunxi/patches/212-Revert-Avoid-non-portable-sed-construct.patch @@ -0,0 +1,21 @@ +From 53d123333fa0ddc64b2c55d48366f4582ac6922d Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Thu, 20 Jul 2017 19:50:52 +0200 +Subject: [PATCH 212/213] Revert "Avoid non-portable sed construct" + +This reverts commit 208db781cad4c24f538658a9cb17e24fa43ca3c9. +--- + scripts/Makefile.lib | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/scripts/Makefile.lib ++++ b/scripts/Makefile.lib +@@ -309,7 +309,7 @@ quiet_cmd_dtc = DTC $@ + # Bring in any U-Boot-specific include after the '/dts-v1/;' header + cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ + cat $< $(if $(u_boot_dtsi),\ +- | sed '/^\/ {$$/{x;s%$$%\#include \"$(u_boot_dtsi)\"%;G;}') | \ ++ | sed 's%^/ {$$%\#include \"$(u_boot_dtsi)\"\n&%') | \ + $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \ + $(DTC) -O dtb -o $@ -b 0 \ + -i $(dir $<) $(DTC_FLAGS) \ diff --git a/package/boot/uboot-sunxi/patches/213-Revert-sunxi-Use-binman-for-sunxi-boards.patch b/package/boot/uboot-sunxi/patches/213-Revert-sunxi-Use-binman-for-sunxi-boards.patch new file mode 100644 index 0000000000..6f75259a76 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/213-Revert-sunxi-Use-binman-for-sunxi-boards.patch @@ -0,0 +1,58 @@ +From cf1defd80b7594f6f2721ab2dacffe48522abfca Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Thu, 20 Jul 2017 19:51:01 +0200 +Subject: [PATCH 213/213] Revert "sunxi: Use binman for sunxi boards" + +This reverts commit 61b994a386eb6f631dc1c2194d4cce9b1a43542c. +--- + Makefile | 6 ++++-- + arch/arm/dts/sunxi-u-boot.dtsi | 14 -------------- + scripts/Makefile.lib | 4 ++-- + 3 files changed, 6 insertions(+), 18 deletions(-) + delete mode 100644 arch/arm/dts/sunxi-u-boot.dtsi + +--- a/Makefile ++++ b/Makefile +@@ -1125,8 +1125,10 @@ u-boot-x86-16bit.bin: u-boot FORCE + endif + + ifneq ($(CONFIG_ARCH_SUNXI),) +-u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE +- $(call if_changed,binman) ++OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \ ++ --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff ++u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img FORCE ++ $(call if_changed,pad_cat) + endif + + ifneq ($(CONFIG_TEGRA),) +--- a/arch/arm/dts/sunxi-u-boot.dtsi ++++ /dev/null +@@ -1,14 +0,0 @@ +-#include +- +-/ { +- binman { +- filename = "u-boot-sunxi-with-spl.bin"; +- pad-byte = <0xff>; +- blob { +- filename = "spl/sunxi-spl.bin"; +- }; +- u-boot-img { +- pos = ; +- }; +- }; +-}; +--- a/scripts/Makefile.lib ++++ b/scripts/Makefile.lib +@@ -308,8 +308,8 @@ quiet_cmd_dtc = DTC $@ + # Modified for U-Boot + # Bring in any U-Boot-specific include after the '/dts-v1/;' header + cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ +- cat $< $(if $(u_boot_dtsi),\ +- | sed 's%^/ {$$%\#include \"$(u_boot_dtsi)\"\n&%') | \ ++ cat $< $(if $(u-boot-dtsi),\ ++ | sed 's%^/ {$$%\#include \"$(u-boot-dtsi)\"\n&%') | \ + $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \ + $(DTC) -O dtb -o $@ -b 0 \ + -i $(dir $<) $(DTC_FLAGS) \ diff --git a/package/boot/uboot-sunxi/patches/300-sunxi-add-device-tree-for-Orange-Pi-R1-board.patch b/package/boot/uboot-sunxi/patches/300-sunxi-add-device-tree-for-Orange-Pi-R1-board.patch new file mode 100644 index 0000000000..65ae63c64d --- /dev/null +++ b/package/boot/uboot-sunxi/patches/300-sunxi-add-device-tree-for-Orange-Pi-R1-board.patch @@ -0,0 +1,182 @@ +From 1f92596cc520f760589289059a5aa739366dd19c Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Tue, 26 Sep 2017 22:16:59 +0200 +Subject: sunxi: add device tree for Orange Pi R1 board + +Signed-off-by: Hauke Mehrtens +--- + arch/arm/dts/Makefile | 1 + + arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts | 157 +++++++++++++++++++++++++++++ + 2 files changed, 158 insertions(+) + create mode 100644 arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts + +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -310,6 +310,7 @@ dtb-$(CONFIG_MACH_SUN8I_A83T) += \ + sun8i-a83t-cubietruck-plus.dtb \ + sun8i-a83t-sinovoip-bpi-m3.dtb + dtb-$(CONFIG_MACH_SUN8I_H3) += \ ++ sun8i-h2-plus-orangepi-r1.dtb \ + sun8i-h2-plus-orangepi-zero.dtb \ + sun8i-h3-bananapi-m2-plus.dtb \ + sun8i-h3-orangepi-2.dtb \ +--- /dev/null ++++ b/arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts +@@ -0,0 +1,157 @@ ++/* ++ * Copyright (C) 2017 Hauke Mehrtens ++ * ++ * Based on sun8i-h2-plus-orangepi-zero.dts, which is: ++ * Copyright (C) 2016 Icenowy Zheng ++ * ++ * Based on sun8i-h3-orangepi-one.dts, which is: ++ * Copyright (C) 2016 Hans de Goede ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file 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. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/dts-v1/; ++#include "sun8i-h3.dtsi" ++#include "sunxi-common-regulators.dtsi" ++ ++#include ++#include ++#include ++ ++/ { ++ model = "Xunlong Orange Pi R1"; ++ compatible = "xunlong,orangepi-r1", "allwinner,sun8i-h2-plus"; ++ ++ aliases { ++ serial0 = &uart0; ++ /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */ ++ ethernet1 = &xr819; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ pwr_led { ++ label = "orangepi:green:pwr"; ++ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; ++ default-state = "on"; ++ }; ++ ++ status_led { ++ label = "orangepi:red:status"; ++ gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ reg_vcc_wifi: reg_vcc_wifi { ++ compatible = "regulator-fixed"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-wifi"; ++ enable-active-high; ++ gpio = <&pio 0 20 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ wifi_pwrseq: wifi_pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; ++ }; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&emac { ++ phy = <&phy1>; ++ phy-mode = "mii"; ++ allwinner,use-internal-phy; ++ allwinner,leds-active-low; ++ status = "okay"; ++ phy1: ethernet-phy@1 { ++ reg = <1>; ++ }; ++}; ++ ++&mmc0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc0_pins_a>; ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ ++ cd-inverted; ++ status = "okay"; ++}; ++ ++&mmc1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc1_pins_a>; ++ vmmc-supply = <®_vcc_wifi>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++ ++ /* ++ * Explicitly define the sdio device, so that we can add an ethernet ++ * alias for it (which e.g. makes u-boot set a mac-address). ++ */ ++ xr819: sdio_wifi@1 { ++ reg = <1>; ++ }; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pins_a>; ++ status = "okay"; ++}; ++ ++&usbphy { ++ /* USB VBUS is always on */ ++ status = "okay"; ++}; diff --git a/package/boot/uboot-sunxi/patches/301-sunxi-add-orangepi-R1-defconfig.patch b/package/boot/uboot-sunxi/patches/301-sunxi-add-orangepi-R1-defconfig.patch new file mode 100644 index 0000000000..6240fe3f57 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/301-sunxi-add-orangepi-R1-defconfig.patch @@ -0,0 +1,48 @@ +From 231201c71b902b5999ed9b143f2a54674cfae88a Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Tue, 26 Sep 2017 22:17:33 +0200 +Subject: sunxi: add orangepi R1 defconfig + +Signed-off-by: Hauke Mehrtens +--- + board/sunxi/MAINTAINERS | 5 +++++ + configs/orangepi_r1_defconfig | 19 +++++++++++++++++++ + 2 files changed, 24 insertions(+) + create mode 100644 configs/orangepi_r1_defconfig + +--- a/board/sunxi/MAINTAINERS ++++ b/board/sunxi/MAINTAINERS +@@ -302,6 +302,11 @@ M: Jagan Teki ++S: Maintained ++F: configs/orangepi_r1_defconfig ++ + PINE64 BOARDS + M: Andre Przywara + S: Maintained +--- /dev/null ++++ b/configs/orangepi_r1_defconfig +@@ -0,0 +1,19 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_SUNXI=y ++CONFIG_SPL_SPI_FLASH_SUPPORT=y ++CONFIG_MACH_SUN8I_H3=y ++CONFIG_DRAM_CLK=624 ++CONFIG_DRAM_ZQ=3881979 ++CONFIG_DRAM_ODT_EN=y ++# CONFIG_VIDEO_DE2 is not set ++CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plus-orangepi-r1" ++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set ++CONFIG_CONSOLE_MUX=y ++CONFIG_SPL=y ++# CONFIG_CMD_IMLS is not set ++# CONFIG_CMD_FLASH is not set ++# CONFIG_CMD_FPGA is not set ++CONFIG_SPL_SPI_SUNXI=y ++CONFIG_SUN8I_EMAC=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y diff --git a/package/boot/uboot-sunxi/patches/302-sunxi-Fix-CONFIG_SUNXI_GMAC-references.patch b/package/boot/uboot-sunxi/patches/302-sunxi-Fix-CONFIG_SUNXI_GMAC-references.patch new file mode 100644 index 0000000000..d884173c45 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/302-sunxi-Fix-CONFIG_SUNXI_GMAC-references.patch @@ -0,0 +1,83 @@ +From 6ff005cf19363382fc867d7876a75fd8a386e894 Mon Sep 17 00:00:00 2001 +From: Dave Prue +Date: Thu, 31 Aug 2017 19:21:01 +0200 +Subject: [PATCH] sunxi: Fix CONFIG_SUNXI_GMAC references + +SUNXI_GMAC was still used to configure the code where as the +same has been renamed and moved to Kconfig in below commit +"sunxi: Move SUNXI_GMAC to Kconfig" +(sha1: 4d43d065db3262f9a9918ba72457bf36dfb8e0bb) + +Signed-off-by: Dave Prue +Reviewed-by: Simon Glass +Reviewed-by: Jagan Teki +Reviewed-by: Mark Kettenis +Tested-by: Mark Kettenis +[Tweek commit message, config_whitelist.txt, build-whitelist.sh] +Signed-off-by: Jagan Teki +--- + arch/arm/include/asm/arch-sunxi/sys_proto.h | 2 +- + board/sunxi/Makefile | 2 +- + include/configs/sunxi-common.h | 2 +- + scripts/build-whitelist.sh | 4 ++-- + scripts/config_whitelist.txt | 1 - + 5 files changed, 5 insertions(+), 6 deletions(-) + +--- a/arch/arm/include/asm/arch-sunxi/sys_proto.h ++++ b/arch/arm/include/asm/arch-sunxi/sys_proto.h +@@ -24,7 +24,7 @@ void sdelay(unsigned long); + void return_to_fel(uint32_t lr, uint32_t sp); + + /* Board / SoC level designware gmac init */ +-#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUNXI_GMAC ++#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUN7I_GMAC + void eth_init_board(void); + #else + static inline void eth_init_board(void) {} +--- a/board/sunxi/Makefile ++++ b/board/sunxi/Makefile +@@ -9,7 +9,7 @@ + # SPDX-License-Identifier: GPL-2.0+ + # + obj-y += board.o +-obj-$(CONFIG_SUNXI_GMAC) += gmac.o ++obj-$(CONFIG_SUN7I_GMAC) += gmac.o + obj-$(CONFIG_SUNXI_AHCI) += ahci.o + obj-$(CONFIG_MACH_SUN4I) += dram_sun4i_auto.o + obj-$(CONFIG_MACH_SUN5I) += dram_sun5i_auto.o +--- a/include/configs/sunxi-common.h ++++ b/include/configs/sunxi-common.h +@@ -302,7 +302,7 @@ extern int soft_i2c_gpio_scl; + #define CONFIG_PHYLIB + #endif + +-#ifdef CONFIG_SUNXI_GMAC ++#ifdef CONFIG_SUN7I_GMAC + #define CONFIG_PHY_GIGE /* GMAC can use gigabit PHY */ + #define CONFIG_PHY_ADDR 1 + #define CONFIG_MII /* MII PHY management */ +--- a/scripts/build-whitelist.sh ++++ b/scripts/build-whitelist.sh +@@ -13,10 +13,10 @@ export LC_ALL=C LC_COLLATE=C + # There are two independent greps. The first pulls out the component parts + # of CONFIG_SYS_EXTRA_OPTIONS. An example is: + # +-# SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPB(8) ++# SUN7I_GMAC,AHCI,SATAPWR=SUNXI_GPB(8) + # + # We want this to produce: +-# CONFIG_SUNXI_GMAC ++# CONFIG_SUN7I_GMAC + # CONFIG_AHCI + # CONFIG_SATAPWR + # +--- a/scripts/config_whitelist.txt ++++ b/scripts/config_whitelist.txt +@@ -2371,7 +2371,6 @@ CONFIG_STV0991_HZ_CLOCK + CONFIG_ST_SMI + CONFIG_SUNXI_AHCI + CONFIG_SUNXI_EMAC +-CONFIG_SUNXI_GMAC + CONFIG_SUNXI_GPIO + CONFIG_SUNXI_MAX_FB_SIZE + CONFIG_SUNXI_USB_PHYS diff --git a/package/boot/uboot-sunxi/uEnv-a64.txt b/package/boot/uboot-sunxi/uEnv-a64.txt new file mode 100644 index 0000000000..7a717fdc0f --- /dev/null +++ b/package/boot/uboot-sunxi/uEnv-a64.txt @@ -0,0 +1,5 @@ +setenv loadkernel fatload mmc 0 \$kernel_addr_r uImage +setenv loaddtb fatload mmc 0 \$fdt_addr_r dtb +setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait earlycon=uart,mmio32,0x01c28000 +setenv uenvcmd run loadkernel \&\& run loaddtb \&\& booti \$kernel_addr_r - \$fdt_addr_r +run uenvcmd diff --git a/package/devel/binutils/Makefile b/package/devel/binutils/Makefile index 222922df28..291f45205a 100644 --- a/package/devel/binutils/Makefile +++ b/package/devel/binutils/Makefile @@ -23,6 +23,7 @@ PKG_INSTALL:=1 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-3.0+ +PKG_CPE_ID:=cpe:/a:gnu:binutils PKG_BUILD_PARALLEL:=1 PKG_USE_MIPS16:=0 diff --git a/package/devel/gdb/Makefile b/package/devel/gdb/Makefile index 23039910ce..4cf2aaa87f 100644 --- a/package/devel/gdb/Makefile +++ b/package/devel/gdb/Makefile @@ -8,16 +8,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gdb -PKG_VERSION:=7.12.1 -PKG_RELEASE:=3 +PKG_VERSION:=8.0.1 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb -PKG_HASH:=4607680b973d3ec92c30ad029f1b7dbde3876869e6b3a117d8a7e90081113186 +PKG_HASH:=3dbd5f93e36ba2815ad0efab030dcd0c7b211d7b353a40a53f4c02d7d56295e3 PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 PKG_LICENSE:=GPL-3.0+ +PKG_CPE_ID:=cpe:/a:gnu:gdb include $(INCLUDE_DIR)/package.mk @@ -61,6 +62,10 @@ CONFIGURE_ARGS+= \ CONFIGURE_VARS+= \ ac_cv_search_tgetent="$(TARGET_LDFLAGS) -lncurses -lreadline" +TARGET_LDFLAGS+= \ + -static-libstdc++ \ + -Wl,--gc-sections + define Build/Install $(MAKE) -C $(PKG_BUILD_DIR) \ DESTDIR="$(PKG_INSTALL_DIR)" \ diff --git a/package/devel/gdb/patches/110-shared_libgcc.patch b/package/devel/gdb/patches/110-shared_libgcc.patch index e44616f4a2..929a5ae977 100644 --- a/package/devel/gdb/patches/110-shared_libgcc.patch +++ b/package/devel/gdb/patches/110-shared_libgcc.patch @@ -1,6 +1,6 @@ --- a/configure.ac +++ b/configure.ac -@@ -1406,13 +1406,13 @@ if test -z "$LD"; then +@@ -1300,13 +1300,13 @@ if test -z "$LD"; then fi fi @@ -17,7 +17,7 @@ AC_LANG_PUSH(C++) AC_LINK_IFELSE([ #if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) -@@ -1740,7 +1740,7 @@ AC_ARG_WITH(stage1-ldflags, +@@ -1632,7 +1632,7 @@ AC_ARG_WITH(stage1-ldflags, # if supported. But if the user explicitly specified the libraries to use, # trust that they are doing what they want. if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then @@ -26,7 +26,7 @@ fi]) AC_SUBST(stage1_ldflags) -@@ -1769,7 +1769,7 @@ AC_ARG_WITH(boot-ldflags, +@@ -1661,7 +1661,7 @@ AC_ARG_WITH(boot-ldflags, # statically. But if the user explicitly specified the libraries to # use, trust that they are doing what they want. if test "$poststage1_libs" = ""; then @@ -37,7 +37,7 @@ --- a/configure +++ b/configure -@@ -5109,14 +5109,14 @@ if test -z "$LD"; then +@@ -5005,14 +5005,14 @@ if test -z "$LD"; then fi fi @@ -56,7 +56,7 @@ ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -@@ -5902,7 +5902,7 @@ else +@@ -5795,7 +5795,7 @@ else # if supported. But if the user explicitly specified the libraries to use, # trust that they are doing what they want. if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then @@ -65,7 +65,7 @@ fi fi -@@ -5938,7 +5938,7 @@ else +@@ -5831,7 +5831,7 @@ else # statically. But if the user explicitly specified the libraries to # use, trust that they are doing what they want. if test "$poststage1_libs" = ""; then diff --git a/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch b/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch index 7090db170a..8afa8ccf81 100644 --- a/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch +++ b/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch @@ -25,8 +25,6 @@ gdb/ChangeLog: gdb/common/signals-state-save-restore.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) -diff --git a/gdb/common/signals-state-save-restore.c b/gdb/common/signals-state-save-restore.c -index d11a9ae..734335c 100644 --- a/gdb/common/signals-state-save-restore.c +++ b/gdb/common/signals-state-save-restore.c @@ -41,7 +41,7 @@ save_original_signals_state (void) @@ -38,6 +36,3 @@ index d11a9ae..734335c 100644 if (res == -1) perror_with_name (("sigprocmask")); --- -2.6.4 - diff --git a/package/devel/strace/Makefile b/package/devel/strace/Makefile index 5793e0e9c8..6209dc5a63 100644 --- a/package/devel/strace/Makefile +++ b/package/devel/strace/Makefile @@ -9,16 +9,16 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=strace - -PKG_VERSION:=4.19 +PKG_VERSION:=4.20 PKG_RELEASE:=1 -PKG_HASH:=7c93ebc6c29280f47c24a0eb86873a99ccb2cac6512c60a60ba4ef99ab807281 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_HASH:=5bf3148dd17306a42566f7da17368fdd781afa147db05ea63a4ca2b50f58c523 PKG_LICENSE:=BSD-3c PKG_LICENSE_FILES:=COPYRIGHT +PKG_CPE_ID:=cpe:/a:paul_kranenburg:strace PKG_MAINTAINER:=Felix Fietkau diff --git a/package/devel/valgrind/Makefile b/package/devel/valgrind/Makefile index 57ab75f969..6be2f9ec1a 100644 --- a/package/devel/valgrind/Makefile +++ b/package/devel/valgrind/Makefile @@ -17,6 +17,7 @@ PKG_HASH:=d76680ef03f00cd5e970bbdcd4e57fb1f6df7d2e2c071635ef2be74790190c3b PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0+ +PKG_CPE_ID:=cpe:/a:valgrind:valgrind PKG_FIXUP = autoreconf PKG_INSTALL := 1 diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile index 9a34ac3155..1c6f4dfb7f 100644 --- a/package/firmware/ath10k-firmware/Makefile +++ b/package/firmware/ath10k-firmware/Makefile @@ -8,9 +8,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ath10k-firmware -PKG_SOURCE_DATE:=2017-03-29 -PKG_SOURCE_VERSION:=956e2609b7e42c8c710bba10ef925a5be1be5137 -PKG_MIRROR_HASH:=25f724ff38c830281b3efba4a4ddffaae0c4bd8fea0f4c1061591229ff05535b +PKG_SOURCE_DATE:=2017-10-30 +PKG_SOURCE_VERSION:=476a2850b1e8582d51187799d7de209daf1a57b2 +PKG_MIRROR_HASH:=77ba59f75c5897c842c5c525945de019fd23f1e2d8bea6239924857e500bf73a PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git @@ -223,7 +223,7 @@ define Package/ath10k-firmware-qca4019/install $(PKG_BUILD_DIR)/QCA4019/hw1.0/board-2.bin \ $(1)/lib/firmware/ath10k/QCA4019/hw1.0/ $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/QCA4019/hw1.0/3.2.1/firmware-5.bin_10.4-3.2.1-00053 \ + $(PKG_BUILD_DIR)/QCA4019/hw1.0/3.2.1/firmware-5.bin_10.4-3.2.1-00058 \ $(1)/lib/firmware/ath10k/QCA4019/hw1.0/firmware-5.bin endef diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 2f1b280bec..4af3648250 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -1,6 +1,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/version.mk +PKG_NAME:=ipq-wifi PKG_RELEASE:=1 include $(INCLUDE_DIR)/package.mk @@ -12,7 +13,7 @@ endef define Build/Compile endef -ALLWIFIBOARDS:=rt-ac58u fritz4040 nbg6617 +ALLWIFIBOARDS:=fritz4040 openmesh_a42 ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD)) define Package/ipq-wifi-default @@ -46,8 +47,7 @@ Don't install it for any other device! PREV_BOARD+=ipq-wifi-$(1) endef -$(eval $(call generate-ipq-wifi-package,rt-ac58u,board-rt-ac58u.bin,ASUS RT-AC58U/RT-ACRH13)) $(eval $(call generate-ipq-wifi-package,fritz4040,board-fritz4040.bin,AVM FRITZBox 4040)) -$(eval $(call generate-ipq-wifi-package,nbg6617,board-nbg6617.bin,ZyXEL NBG6617)) +$(eval $(call generate-ipq-wifi-package,openmesh_a42,board-openmesh_a42.bin,OpenMesh A42)) $(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE)))) diff --git a/package/firmware/ipq-wifi/board-nbg6617.bin b/package/firmware/ipq-wifi/board-nbg6617.bin deleted file mode 100644 index ab4d43e8cb..0000000000 Binary files a/package/firmware/ipq-wifi/board-nbg6617.bin and /dev/null differ diff --git a/package/firmware/ipq-wifi/board-openmesh_a42.bin b/package/firmware/ipq-wifi/board-openmesh_a42.bin new file mode 100644 index 0000000000..9ac5921200 Binary files /dev/null and b/package/firmware/ipq-wifi/board-openmesh_a42.bin differ diff --git a/package/firmware/ipq-wifi/board-rt-ac58u.bin b/package/firmware/ipq-wifi/board-rt-ac58u.bin deleted file mode 100644 index 379bdc8ce2..0000000000 Binary files a/package/firmware/ipq-wifi/board-rt-ac58u.bin and /dev/null differ diff --git a/package/firmware/fman-ucode/Makefile b/package/firmware/layerscape/fman-ucode/Makefile similarity index 79% rename from package/firmware/fman-ucode/Makefile rename to package/firmware/layerscape/fman-ucode/Makefile index 396750f804..aa2601b260 100644 --- a/package/firmware/fman-ucode/Makefile +++ b/package/firmware/layerscape/fman-ucode/Makefile @@ -9,19 +9,16 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk PKG_NAME:=fman-ucode -PKG_VERSION:=fsl-sdk-v2.0 +PKG_SOURCE_DATE:=2017-02-13 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_MIRROR_HASH:=209c60e4efaa3ce9c9a954266a7210fa0047a2de47ce00a412aa0318d94d0d88 -PKG_SOURCE_URL:=https://github.com/fsl-jyt/fm-ucode.git -PKG_SOURCE_VERSION:=b19c645821941493fbef32e616b5a16404259976 +PKG_SOURCE_URL:=https://github.com/qoriq-open-source/fm-ucode.git +PKG_SOURCE_VERSION:=c275e91392e2adab1ed22f3867b8269ca3c54014 +PKG_MIRROR_HASH:=1a4611d528f67f3acfa88aefdec9a9a67d96a3139ac5fe1089f599272e6c4a52 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - PKG_FLAGS:=nonshared include $(INCLUDE_DIR)/package.mk @@ -33,12 +30,12 @@ endef define fman/ls1043ardb TITLE=FMAN UCODE $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 64b/32b Dev Board - CONFIG=fsl_fman_ucode_ls1043_r1.0_108_4_5.bin + CONFIG=fsl_fman_ucode_ls1043_r1.1_106_4_18.bin endef define fman/ls1046ardb TITLE=FMAN UCODE $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 64b/32b Dev Board - CONFIG=fsl_fman_ucode_t2080_r1.1_106_4_18.bin + CONFIG=fsl_fman_ucode_ls1046_r1.0_106_4_18.bin endef FMANS := \ @@ -51,7 +48,7 @@ define Package/fman-layerscape-$(1) CATEGORY:=Firmware DEPENDS:=@TARGET_layerscape TITLE:=$(2) - URL:=http://git.freescale.com/git/cgit.cgi/ppc/sdk/fm-ucode.git + URL:=https://github.com/qoriq-open-source/fm-ucode.git VARIANT:=$(1) MAINTAINER:=Jiang Yutang endef diff --git a/package/firmware/layerscape/ls-dpl/Makefile b/package/firmware/layerscape/ls-dpl/Makefile new file mode 100644 index 0000000000..86483cab89 --- /dev/null +++ b/package/firmware/layerscape/ls-dpl/Makefile @@ -0,0 +1,58 @@ +# +# Copyright 2017 NXP +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ls-dpl +PKG_SOURCE_DATE:=2017-09-07 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/qoriq-open-source/dpl-examples.git +PKG_SOURCE_VERSION:=a6c83759c0d9c02822eec89e86357a0998ef51d4 +PKG_MIRROR_HASH:=d0311591843fbf9faebc7e2f0d53cba47d42ef21c4407c5881f354df6c458ce5 + +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_FLAGS:=nonshared + +include $(INCLUDE_DIR)/package.mk + +define Package/layerscape-dpl-ls1088ardb + SECTION:=firmware + CATEGORY:=Firmware + DEPENDS:=@TARGET_layerscape + TITLE:=NXP LS1088ARDB DPL firmware + VARIANT:=ls1088ardb + DPC_CONFIG:=ls1088a/RDB/dpc.0x1D-0x0D.dtb + DPL_CONFIG:=ls1088a/RDB/dpl-eth.0x1D_0x0D.dtb +endef + +define Package/layerscape-dpl-ls2088ardb + SECTION:=firmware + CATEGORY:=Firmware + DEPENDS:=@TARGET_layerscape + TITLE:=NXP LS2088ARDB DPL firmware + VARIANT:=ls2088ardb + DPC_CONFIG:=ls2088a/RDB/dpc.0x2A_0x41.dtb + DPL_CONFIG:=ls2088a/RDB/dpl-eth.0x2A_0x41.dtb +endef + +define Package/layerscape-dpl-ls1088ardb/install + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/$(DPL_CONFIG) $(STAGING_DIR_IMAGE)/ls1088ardb-dpl.dtb + $(CP) $(PKG_BUILD_DIR)/$(DPC_CONFIG) $(STAGING_DIR_IMAGE)/ls1088ardb-dpc.dtb +endef + +define Package/layerscape-dpl-ls2088ardb/install + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/$(DPL_CONFIG) $(STAGING_DIR_IMAGE)/ls2088ardb-dpl.dtb + $(CP) $(PKG_BUILD_DIR)/$(DPC_CONFIG) $(STAGING_DIR_IMAGE)/ls2088ardb-dpc.dtb +endef + +$(eval $(call BuildPackage,layerscape-dpl-ls1088ardb)) +$(eval $(call BuildPackage,layerscape-dpl-ls2088ardb)) diff --git a/package/firmware/layerscape/ls-mc/Makefile b/package/firmware/layerscape/ls-mc/Makefile new file mode 100644 index 0000000000..a81e095638 --- /dev/null +++ b/package/firmware/layerscape/ls-mc/Makefile @@ -0,0 +1,57 @@ +# +# Copyright 2017 NXP +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ls-mc +PKG_SOURCE_DATE:=2014-07-04 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/qoriq-open-source/mc-binary.git +PKG_SOURCE_VERSION:=824745fe1580b281bebb808321c3f41353a3140a +PKG_MIRROR_HASH:=984c7905af3a4b87b72263de9220901c531fe064f0b89dd2882676354e09ed16 + +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_FLAGS:=nonshared + +include $(INCLUDE_DIR)/package.mk + +define Package/layerscape-mc-ls1088ardb + SECTION:=firmware + CATEGORY:=Firmware + DEPENDS:=@TARGET_layerscape + TITLE:=NXP LS1088ARDB MC firmware + VARIANT:=ls1088ardb + CONFIG:=ls1088a/mc_10.3.4_ls1088a_20170929.itb +endef + +define Package/layerscape-mc-ls2088ardb + SECTION:=firmware + CATEGORY:=Firmware + DEPENDS:=@TARGET_layerscape + TITLE:=NXP LS2088ARDB MC firmware + VARIANT:=ls2088ardb + CONFIG:=ls2088a/mc_10.3.4_ls2088a_20170929.itb +endef + +define Build/Compile +endef + +define Package/layerscape-mc-ls1088ardb/install + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/$(CONFIG) $(STAGING_DIR_IMAGE)/ls1088ardb-mc.itb +endef + +define Package/layerscape-mc-ls2088ardb/install + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/$(CONFIG) $(STAGING_DIR_IMAGE)/ls2088ardb-mc.itb +endef + +$(eval $(call BuildPackage,layerscape-mc-ls1088ardb)) +$(eval $(call BuildPackage,layerscape-mc-ls2088ardb)) diff --git a/package/firmware/layerscape/ls-ppa/Makefile b/package/firmware/layerscape/ls-ppa/Makefile new file mode 100644 index 0000000000..a354ad1a9b --- /dev/null +++ b/package/firmware/layerscape/ls-ppa/Makefile @@ -0,0 +1,111 @@ +# +# Copyright 2017 NXP +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/image.mk + +PKG_NAME:=ls-ppa +PKG_SOURCE_DATE:=2017-10-26 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/yangbolu1991/ppa-binary.git +PKG_SOURCE_VERSION:=76a80ca988affbee67bb17096aefb82ba6d91be7 +PKG_MIRROR_HASH:=55e6cfa0f03f2db667ed4270e5aaf43ab830343af3b9724f92e830a1e3a3a25f + +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_FLAGS:=nonshared + +include $(INCLUDE_DIR)/package.mk + +define ppa/Default + TITLE:= + CONFIG:= +endef + +define ppa/ls1043ardb + TITLE=PPA firmware $(PKG_VERSION) for NXP ls1043ardb 64b/32b Dev Board + CONFIG=ppa-ls1043a.itb +endef + +define ppa/ls1046ardb + TITLE=PPA firmware $(PKG_VERSION) for NXP ls1046ardb 64b/32b Dev Board + CONFIG=ppa-ls1046a.itb +endef + +define ppa/ls1012ardb + TITLE=PPA firmware $(PKG_VERSION) for NXP ls1012ardb 64b/32b Dev Board + CONFIG=ppa-ls1012a.itb +endef + +define ppa/ls1088ardb + TITLE=PPA firmware $(PKG_VERSION) for NXP ls1088ardb 64b/32b Dev Board + CONFIG=ppa-ls1088a.itb +endef + +define ppa/ls2088ardb + TITLE=PPA firmware $(PKG_VERSION) for NXP ls2088ardb 64b/32b Dev Board + CONFIG=ppa-ls2088a.itb +endef + +define ppa/ls1012afrdm + TITLE=PPA firmware $(PKG_VERSION) for NXP ls1012afrdm 64b/32b Dev Board + CONFIG=ppa-ls1012a.itb +endef + +PPAS := \ + ls1043ardb \ + ls1046ardb \ + ls1012ardb \ + ls1088ardb \ + ls2088ardb \ + ls1012afrdm + +define Package/ppa/template +define Package/layerscape-ppa-$(1) + SECTION:=firmware + CATEGORY:=Firmware + DEPENDS:= @TARGET_layerscape + TITLE:=$(2) + VARIANT:=$(1) +endef +endef + +define BuildPPAPackage + $(eval $(ppa/Default)) + $(eval $(ppa/$(1))) + $(call Package/ppa/template,$(1),$(TITLE)) +endef + +ifdef BUILD_VARIANT +$(eval $(call ppa/$(BUILD_VARIANT))) +PPA_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) +endif + +define Build/Compile +endef + +define Package/ppa/install/default + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/$(PPA_CONFIG) $(STAGING_DIR_IMAGE)/$(1)-ppa.itb +endef + +define Package/ppa/install/template +define Package/layerscape-ppa-$(1)/install + $(call Package/ppa/install/default,$(2)) +endef +endef + +$(foreach r,$(PPAS), \ + $(eval $(call Package/ppa/install/template,$(r),$(r))) \ +) + +$(foreach r,$(PPAS), \ + $(eval $(call BuildPPAPackage,$(r))) \ + $(eval $(call BuildPackage,layerscape-ppa-$(r))) \ +) diff --git a/package/firmware/rcw/Makefile b/package/firmware/layerscape/ls-rcw/Makefile similarity index 56% rename from package/firmware/rcw/Makefile rename to package/firmware/layerscape/ls-rcw/Makefile index bae9c95b6c..70791d47b6 100644 --- a/package/firmware/rcw/Makefile +++ b/package/firmware/layerscape/ls-rcw/Makefile @@ -8,19 +8,19 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -PKG_NAME:=rcw -PKG_VERSION:=v1.0 +PKG_NAME:=ls-rcw +PKG_SOURCE_DATE:=2017-09-26 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_MIRROR_HASH:=8082979dbdef57e36a3096986aa426ef678c152403eb1dbd132da28f01490b6d -PKG_SOURCE_URL:=https://github.com/fsl-jyt/rcw.git -PKG_SOURCE_VERSION:=17e09e19bd5cf94e5ebc84916b4607743c29723e +PKG_SOURCE_URL:=https://github.com/qoriq-open-source/rcw.git +PKG_SOURCE_VERSION:=6719b046ee87b04026fe163e6c8fbbebba2186aa +PKG_MIRROR_HASH:=9645ecf148640ec7d1029bce65950f2a0b0e6b351a25ef60c8a839c42c6ed56d PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE PKG_FLAGS:=nonshared @@ -32,24 +32,42 @@ define rcw/Default endef define rcw/ls1043ardb - TITLE=RCW binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 64b/32b Dev Board - CONFIG=ls1043ardb-rcw.bin + TITLE=RCW binary $(PKG_VERSION) for NXP ls1043ardb 64b/32b Dev Board + CONFIG=ls1043ardb/RR_FQPP_1455/rcw_1600.bin endef define rcw/ls1046ardb - TITLE=RCW binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 64b/32b Dev Board - CONFIG=ls1046ardb-rcw.bin + TITLE=RCW binary $(PKG_VERSION) for NXP ls1046ardb 64b/32b Dev Board + CONFIG=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_qspiboot.bin.swap endef define rcw/ls1012ardb - TITLE=RCW binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012ardb 64b/32b Dev Board - CONFIG=ls1012ardb-rcw.bin + TITLE=RCW binary $(PKG_VERSION) for NXP ls1012ardb 64b/32b Dev Board + CONFIG=ls1012ardb/R_SPNH_3508/PBL_0x35_0x08_1000_250_1000_default.bin +endef + +define rcw/ls1088ardb + TITLE=RCW binary $(PKG_VERSION) for NXP ls1088ardb 64b/32b Dev Board + CONFIG=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/PBL_QSPI_1600_700_2100_0x1d_0x0d.bin +endef + +define rcw/ls2088ardb + TITLE=RCW binary $(PKG_VERSION) for NXP ls2088ardb 64b/32b Dev Board + CONFIG=ls2088ardb/FFFFFFFF_PP_HH_0x2a_0x41/PBL_0x2a_0x41_1800_700_1866_1600.bin +endef + +define rcw/ls1012afrdm + TITLE=RCW binary $(PKG_VERSION) for NXP ls1012afrdm 64b/32b Dev Board + CONFIG=ls1012afrdm/N_SSNP_3305/PBL_0x33_0x05_800_250_1000_default.bin endef RCWS := \ ls1043ardb \ ls1046ardb \ - ls1012ardb + ls1012ardb \ + ls1088ardb \ + ls2088ardb \ + ls1012afrdm define Package/rcw/template define Package/rcw-layerscape-$(1) @@ -77,9 +95,6 @@ endif define Build/Configure endef -define Build/Compile -endef - define Package/rcw/install/default $(INSTALL_DIR) $(STAGING_DIR_IMAGE) $(CP) $(PKG_BUILD_DIR)/$(RCW_CONFIG) $(STAGING_DIR_IMAGE)/$(1)-rcw.bin diff --git a/package/firmware/layerscape/ls-rcw/patches/0001-rcw-add-a-python-script-for-byte-swapping.patch b/package/firmware/layerscape/ls-rcw/patches/0001-rcw-add-a-python-script-for-byte-swapping.patch new file mode 100644 index 0000000000..a2b7140654 --- /dev/null +++ b/package/firmware/layerscape/ls-rcw/patches/0001-rcw-add-a-python-script-for-byte-swapping.patch @@ -0,0 +1,66 @@ +From ebded197f9c12168d61973043fd9ebd5d49528a8 Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Mon, 25 Dec 2017 14:11:02 +0800 +Subject: [PATCH] rcw: add a python script for byte swapping + +Signed-off-by: Yangbo Lu +--- + Makefile | 2 ++ + byte_swap.py | 32 ++++++++++++++++++++++++++++++++ + 2 files changed, 34 insertions(+) + create mode 100755 byte_swap.py + +diff --git a/Makefile b/Makefile +index fb55c8b..27e3ba2 100644 +--- a/Makefile ++++ b/Makefile +@@ -11,6 +11,8 @@ all install clean: + @for board in $(BOARDS); do \ + $(MAKE) -C $$board $@ DESTDIR=$(DESTDIR)/$$board; \ + done ++ chmod 755 ./byte_swap.py; \ ++ ./byte_swap.py ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_qspiboot.bin 8 + + release: $(foreach board,$(BOARDS),rcw-$(board)-$(VER).tar.gz) + +diff --git a/byte_swap.py b/byte_swap.py +new file mode 100755 +index 0000000..7ee4129 +--- /dev/null ++++ b/byte_swap.py +@@ -0,0 +1,32 @@ ++#!/usr/bin/env python ++""" ++Swap the 4/8 bytes endian except for PBI CRC ++2016-10-9: Initial version ++ ++Usage: ++ ./byte_swap.py ++""" ++import sys ++ ++try: ++ file_name = sys.argv[1] ++ byte = int(sys.argv[2]) ++except: ++ print("Usage: ./byte_swap.py ") ++ print("E.g.: ./byte_swap.py rcw_1600.bin 8\n") ++ exit ++ ++with open(file_name,'rb') as file: ++ tmp = file.read() ++file.close() ++ ++with open(file_name + '.swap','wb') as file: ++ for i in range(0, len(tmp) - 1, byte): ++ if(tmp[i:i+4].encode('hex')) == "08610040": ++ #print("PBI CRC command") ++ file.write(tmp[i:i+8]) ++ break ++ file.write(tmp[i:i+byte][::-1]) ++file.close() ++ ++print("Swapped file: " + file_name + '.swap') +-- +2.7.4 + diff --git a/package/firmware/layerscape/ppfe-firmware/Makefile b/package/firmware/layerscape/ppfe-firmware/Makefile new file mode 100644 index 0000000000..419201e87e --- /dev/null +++ b/package/firmware/layerscape/ppfe-firmware/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2016 Jiang Yutang +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ppfe +PKG_SOURCE_DATE:=2017-10-13 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/qoriq-open-source/engine-pfe-bin.git +PKG_SOURCE_VERSION:=97cd13d3070d7199e62881bc495b332194b67edd +PKG_MIRROR_HASH:=3457bfe7201a8410443f34d4bb5fa67d4ff19e2d0f3957e84e3f20e2ae3fa34a + +PKG_FLAGS:=nonshared + +include $(INCLUDE_DIR)/package.mk + +RSTRIP:=: +STRIP:=: + +define Package/layerscape-ppfe + SECTION:=firmware + CATEGORY:=Firmware + DEPENDS:=@TARGET_layerscape + TITLE:=NXP Layerscape PPFE firmware + CONFIG_FW:=ls1012a/u-boot/pfe_fw_sbl.itb + CONFIG_BIN1:=ls1012a/slow_path/ppfe_class_ls1012a.elf + CONFIG_BIN2:=ls1012a/slow_path/ppfe_tmu_ls1012a.elf + CONFIG_LIC:=Freescale-Binary-EULA +endef + +define Build/Compile +endef + +define Package/layerscape-ppfe/install + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(CONFIG_FW) \ + $(STAGING_DIR_IMAGE)/pfe.itb + $(INSTALL_DIR) $(1)/lib/firmware/ + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/$(CONFIG_BIN1) \ + $(PKG_BUILD_DIR)/$(CONFIG_BIN2) \ + $(PKG_BUILD_DIR)/$(CONFIG_LIC) \ + $(1)/lib/firmware/ +endef + +$(eval $(call BuildPackage,layerscape-ppfe)) diff --git a/package/firmware/linux-firmware/edgeport.mk b/package/firmware/linux-firmware/edgeport.mk new file mode 100644 index 0000000000..d68c75a0dc --- /dev/null +++ b/package/firmware/linux-firmware/edgeport.mk @@ -0,0 +1,12 @@ +Package/edgeport-firmware = $(call Package/firmware-default,USB Inside Out Edgeport Serial Driver firmware) +define Package/edgeport-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/edgeport + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/edgeport/boot.fw \ + $(PKG_BUILD_DIR)/edgeport/boot2.fw \ + $(PKG_BUILD_DIR)/edgeport/down.fw \ + $(PKG_BUILD_DIR)/edgeport/down2.fw \ + $(1)/lib/firmware/edgeport +endef + +$(eval $(call BuildPackage,edgeport-firmware)) diff --git a/package/firmware/linux-firmware/intel.mk b/package/firmware/linux-firmware/intel.mk index 0330335bfb..8cdbb48245 100644 --- a/package/firmware/linux-firmware/intel.mk +++ b/package/firmware/linux-firmware/intel.mk @@ -153,3 +153,12 @@ define Package/iwlwifi-firmware-iwl8265/install $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-8265-27.ucode $(1)/lib/firmware endef $(eval $(call BuildPackage,iwlwifi-firmware-iwl8265)) + +Package/e100-firmware = $(call Package/firmware-default,Intel e100) +define Package/e100-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/e100 + $(INSTALL_DATA) $(PKG_BUILD_DIR)/e100/d101m_ucode.bin $(1)/lib/firmware/e100/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/e100/d101s_ucode.bin $(1)/lib/firmware/e100/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/e100/d102e_ucode.bin $(1)/lib/firmware/e100/ +endef +$(eval $(call BuildPackage,e100-firmware)) diff --git a/package/firmware/ppfe-firmware/Makefile b/package/firmware/ppfe-firmware/Makefile deleted file mode 100644 index 506046db4e..0000000000 --- a/package/firmware/ppfe-firmware/Makefile +++ /dev/null @@ -1,87 +0,0 @@ -# -# Copyright (C) 2016 Jiang Yutang -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=ppfe -PKG_VERSION:=v1.0 -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_MIRROR_HASH:=645d9aaaaa39ac1fa50cf805f1866feb5f717b34cb110c80e3f45303ea6d7259 -PKG_SOURCE_URL:=https://github.com/fsl-jyt/ppfe.git -PKG_SOURCE_VERSION:=b9bb5cc690c0aab2592eb9d443ef55cc9dff8557 -PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - -PKG_FLAGS:=nonshared - -include $(INCLUDE_DIR)/package.mk - -define ppfe/Default - TITLE:= - CONFIG:= -endef - -define ppfe/ls1012ardb - TITLE:=PPFE firmware $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012a Dev Board\ - (must enable CONFIG_NO_STRIP=y for avoid firmware be broke) - CONFIG:=ls1012a/Freescale-Binary-EULA ls1012a/ppfe_class_ls1012a.elf ls1012a/ppfe_tmu_ls1012a.elf -endef - -PPFES := \ - ls1012ardb - -define Package/ppfe/template -define Package/ppfe-$(1) - SECTION:=firmware - CATEGORY:=Firmware - DEPENDS:=@TARGET_layerscape - TITLE:=$(2) - URL:=https://github.com/fsl-jyt/ppfe.git - VARIANT:=$(1) - MAINTAINER:=Jiang Yutang -endef -endef - -define BuildPPFEPackage - $(eval $(ppfe/Default)) - $(eval $(ppfe/$(1))) - $(call Package/ppfe/template,$(1),$(TITLE)) -endef - -ifdef BUILD_VARIANT -$(eval $(call ppfe/$(BUILD_VARIANT))) -PPFE_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -endif - -define Build/Compile -endef - -define Package/ppfe/install/default - $(INSTALL_DIR) $(1)/lib/firmware - $(foreach i,$(PPFE_CONFIG), \ - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(i) $(1)/lib/firmware/ ;\ - ) -endef - -define Package/ppfe/install/template -define Package/ppfe-$(1)/install - $(call Package/ppfe/install/default,$$(1),$(2)) -endef -endef - -$(foreach p,$(PPFES), \ - $(eval $(call Package/ppfe/install/template,$(p),$(p))) \ -) - -$(foreach p,$(PPFES), \ - $(eval $(call BuildPPFEPackage,$(p))) \ - $(eval $(call BuildPackage,ppfe-$(p))) \ -) diff --git a/package/firmware/wireless-regdb/Makefile b/package/firmware/wireless-regdb/Makefile new file mode 100644 index 0000000000..d06da2c708 --- /dev/null +++ b/package/firmware/wireless-regdb/Makefile @@ -0,0 +1,31 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=wireless-regdb + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git +PKG_SOURCE_DATE:=2017-10-20 +PKG_SOURCE_VERSION:=4343d359ed5e7404de8803a74df186457b26ab79 +PKG_MIRROR_HASH:=5f5b669f32ae36cb65b1d99efbbbfd42c2983cda32f6448346e3e54ffaba3889 + +PKG_MAINTAINER:=Felix Fietkau + +include $(INCLUDE_DIR)/package.mk + +define Package/wireless-regdb + SECTION:=firmware + CATEGORY:=Firmware + URL:=$(patsubst pub/scm,cgit,$(PKG_SOURCE_URL)) + TITLE:=Wireless Regulatory Database +endef + +define Build/Compile + python $(PKG_BUILD_DIR)/db2fw.py $(PKG_BUILD_DIR)/regulatory.db $(PKG_BUILD_DIR)/db.txt +endef + +define Package/wireless-regdb/install + $(INSTALL_DIR) $(1)/lib/firmware + $(CP) $(PKG_BUILD_DIR)/regulatory.db $(1)/lib/firmware/ +endef + +$(eval $(call BuildPackage,wireless-regdb)) diff --git a/package/firmware/wireless-regdb/patches/100-regdb-write-firmware-file-format-version-code-20.patch b/package/firmware/wireless-regdb/patches/100-regdb-write-firmware-file-format-version-code-20.patch new file mode 100644 index 0000000000..0c5c63fc5f --- /dev/null +++ b/package/firmware/wireless-regdb/patches/100-regdb-write-firmware-file-format-version-code-20.patch @@ -0,0 +1,251 @@ +From: Johannes Berg +Date: Mon, 9 Oct 2017 11:50:57 +0200 +Subject: [PATCH] regdb: write firmware file format (version code 20) + +TODO: clean up the Makefile stuff ... + +Signed-off-by: Johannes Berg +--- + create mode 100755 db2fw.py + +--- a/Makefile ++++ b/Makefile +@@ -1,7 +1,5 @@ + # Install prefix + PREFIX ?= /usr +-CRDA_PATH ?= $(PREFIX)/lib/crda +-CRDA_KEY_PATH ?= $(CRDA_PATH)/pubkeys + + MANDIR ?= $(PREFIX)/share/man/ + +@@ -30,39 +28,47 @@ REGDB_AUTHOR ?= $(shell if [ -f $(DISTRO + fi) + + REGDB_PRIVKEY ?= ~/.wireless-regdb-$(REGDB_AUTHOR).key.priv.pem +-REGDB_PUBKEY ?= $(REGDB_AUTHOR).key.pub.pem +- +-REGDB_UPSTREAM_PUBKEY ?= sforshee.key.pub.pem ++REGDB_PUBCERT ?= $(REGDB_AUTHOR).x509.pem + + REGDB_CHANGED = $(shell $(SHA1SUM) -c --status sha1sum.txt >/dev/null 2>&1; \ + if [ $$? -ne 0 ]; then \ +- echo maintainer-clean $(REGDB_PUBKEY); \ ++ echo maintainer-clean $(REGDB_PUBCERT); \ + fi) + + .PHONY: all clean mrproper install maintainer-clean install-distro-key + +-all: $(REGDB_CHANGED) regulatory.bin sha1sum.txt ++all: $(REGDB_CHANGED) regulatory.db.p7s sha1sum.txt + + clean: + @rm -f *.pyc *.gz + + maintainer-clean: clean +- @rm -f regulatory.bin ++ @rm -f regulatory.db regulatory.db.p7s + + mrproper: clean maintainer-clean +- @echo Removed public key, regulatory.bin and compresed man pages +- @rm -f $(REGDB_PUBKEY) .custom ++ @echo Removed public key, regulatory.db* and compressed man pages ++ @rm -f $(REGDB_PUBCERT) .custom + +-regulatory.bin: db.txt $(REGDB_PRIVKEY) $(REGDB_PUBKEY) +- @echo Generating $@ digitally signed by $(REGDB_AUTHOR)... +- ./db2bin.py regulatory.bin db.txt $(REGDB_PRIVKEY) ++regulatory.db: db.txt db2fw.py ++ @echo "Generating $@" ++ ./db2fw.py regulatory.db db.txt ++ ++regulatory.db.p7s: regulatory.db $(REGDB_PRIVKEY) $(REGDB_PUBCERT) ++ @echo "Signing regulatory.db (by $(REGDB_AUTHOR))..." ++ @openssl smime -sign \ ++ -signer $(REGDB_PUBCERT) \ ++ -inkey $(REGDB_PRIVKEY) \ ++ -in $< -nosmimecap -binary \ ++ -outform DER -out $@ + + sha1sum.txt: db.txt + sha1sum $< > $@ + +-$(REGDB_PUBKEY): $(REGDB_PRIVKEY) +- @echo "Generating public key for $(REGDB_AUTHOR)..." +- openssl rsa -in $(REGDB_PRIVKEY) -out $(REGDB_PUBKEY) -pubout -outform PEM ++$(REGDB_PUBCERT): $(REGDB_PRIVKEY) ++ @echo "Generating certificate for $(REGDB_AUTHOR)..." ++ @openssl req -config regulatory.openssl.conf \ ++ -key $(REGDB_PRIVKEY) -days 36500 -utf8 -nodes -batch \ ++ -x509 -outform PEM -out $(REGDB_PUBCERT) + @echo $(REGDB_PUBKEY) > .custom + + +@@ -97,16 +103,7 @@ install-distro-key: maintainer-clean $(D + # make maintainer-clean + # make + # sudo make install +-install: regulatory.bin.5.gz +- install -m 755 -d $(DESTDIR)/$(CRDA_PATH) +- install -m 755 -d $(DESTDIR)/$(CRDA_KEY_PATH) +- if [ -f .custom ]; then \ +- install -m 644 -t $(DESTDIR)/$(CRDA_KEY_PATH)/ $(shell cat .custom); \ +- fi +- install -m 644 -t $(DESTDIR)/$(CRDA_KEY_PATH)/ $(REGDB_UPSTREAM_PUBKEY) +- install -m 644 -t $(DESTDIR)/$(CRDA_PATH)/ regulatory.bin ++install: regulatory.db.5.gz ++ install -m 644 -t $(DESTDIR)/$(CRDA_PATH)/ regulatory.db + install -m 755 -d $(DESTDIR)/$(MANDIR)/man5/ +- install -m 644 -t $(DESTDIR)/$(MANDIR)/man5/ regulatory.bin.5.gz +- +-uninstall: +- rm -rf $(DESTDIR)/$(CRDA_PATH)/ ++ install -m 644 -t $(DESTDIR)/$(MANDIR)/man5/ regulatory.db.5.gz +--- a/README ++++ b/README +@@ -18,8 +18,8 @@ python module is used by the web viewer + implemented as a MoinMoin macro (and used on http://wireless.kernel.org) + to allow viewing the database for verification. + +-The dbparse module is also used by db2bin.py, the `compiler', which +-compiles and signs the binary database. ++The dbparse module is also used by db2bin.py and db2fw.py, the `compilers' ++that compile the database to its binary formats. + + For more information, please see the CRDA git repository: + +--- /dev/null ++++ b/db2fw.py +@@ -0,0 +1,133 @@ ++#!/usr/bin/env python ++ ++from cStringIO import StringIO ++import struct ++import hashlib ++from dbparse import DBParser ++import sys ++ ++MAGIC = 0x52474442 ++VERSION = 20 ++ ++if len(sys.argv) < 3: ++ print 'Usage: %s output-file input-file' % sys.argv[0] ++ sys.exit(2) ++ ++def create_rules(countries): ++ result = {} ++ for c in countries.itervalues(): ++ for rule in c.permissions: ++ result[rule] = 1 ++ return result.keys() ++ ++def create_collections(countries): ++ result = {} ++ for c in countries.itervalues(): ++ result[(c.permissions, c.dfs_region)] = 1 ++ return result.keys() ++ ++ ++def be32(output, val): ++ output.write(struct.pack('>I', val)) ++def be16(output, val): ++ output.write(struct.pack('>H', val)) ++ ++class PTR(object): ++ def __init__(self, output): ++ self._output = output ++ self._pos = output.tell() ++ be16(output, 0) ++ self._written = False ++ ++ def set(self, val=None): ++ if val is None: ++ val = self._output.tell() ++ assert val & 3 == 0 ++ self._offset = val ++ pos = self._output.tell() ++ self._output.seek(self._pos) ++ be16(self._output, val >> 2) ++ self._output.seek(pos) ++ self._written = True ++ ++ def get(self): ++ return self._offset ++ ++ @property ++ def written(self): ++ return self._written ++ ++p = DBParser() ++countries = p.parse(file(sys.argv[2])) ++rules = create_rules(countries) ++rules.sort(cmp=lambda x, y: cmp(x.freqband, y.freqband)) ++collections = create_collections(countries) ++collections.sort(cmp=lambda x, y: cmp(x[0][0].freqband, y[0][0].freqband)) ++ ++output = StringIO() ++ ++# struct regdb_file_header ++be32(output, MAGIC) ++be32(output, VERSION) ++ ++country_ptrs = {} ++countrynames = countries.keys() ++countrynames.sort() ++for alpha2 in countrynames: ++ coll = countries[alpha2] ++ output.write(struct.pack('>cc', str(alpha2[0]), str(alpha2[1]))) ++ country_ptrs[alpha2] = PTR(output) ++output.write('\x00' * 4) ++ ++reg_rules = {} ++flags = 0 ++for reg_rule in rules: ++ freq_range, power_rule = reg_rule.freqband, reg_rule.power ++ reg_rules[reg_rule] = output.tell() ++ assert power_rule.max_ant_gain == 0 ++ flags = 0 ++ # convert to new rule flags ++ assert reg_rule.flags & ~0x899 == 0 ++ if reg_rule.flags & 1<<0: ++ flags |= 1<<0 ++ if reg_rule.flags & 1<<3: ++ flags |= 1<<1 ++ if reg_rule.flags & 1<<4: ++ flags |= 1<<2 ++ if reg_rule.flags & 1<<7: ++ flags |= 1<<3 ++ if reg_rule.flags & 1<<11: ++ flags |= 1<<4 ++ rule_len = 16 ++ cac_timeout = 0 # TODO ++ if not (flags & 1<<2): ++ cac_timeout = 0 ++ if cac_timeout: ++ rule_len += 2 ++ output.write(struct.pack('>BBHIII', rule_len, flags, power_rule.max_eirp * 100, ++ freq_range.start * 1000, freq_range.end * 1000, freq_range.maxbw * 1000, ++ )) ++ if cac_timeout: ++ output.write(struct.pack('>H', cac_timeout)) ++ while rule_len % 4: ++ output.write('\0') ++ rule_len += 1 ++ ++for coll in collections: ++ for alpha2 in countrynames: ++ if (countries[alpha2].permissions, countries[alpha2].dfs_region) == coll: ++ assert not country_ptrs[alpha2].written ++ country_ptrs[alpha2].set() ++ slen = 3 ++ output.write(struct.pack('>BBBx', slen, len(list(coll[0])), coll[1])) ++ coll = list(coll[0]) ++ for regrule in coll: ++ be16(output, reg_rules[regrule] >> 2) ++ if len(coll) % 2: ++ be16(output, 0) ++ ++for alpha2 in countrynames: ++ assert country_ptrs[alpha2].written ++ ++outfile = open(sys.argv[1], 'w') ++outfile.write(output.getvalue()) diff --git a/package/firmware/wireless-regdb/patches/500-world-regd-5GHz.patch b/package/firmware/wireless-regdb/patches/500-world-regd-5GHz.patch new file mode 100644 index 0000000000..9baba808bc --- /dev/null +++ b/package/firmware/wireless-regdb/patches/500-world-regd-5GHz.patch @@ -0,0 +1,16 @@ +Remove the NO-IR flag from channels 36-48 on the World domain, +to make it usable for AP mode. + +Signed-off-by: Felix Fietkau +--- +--- a/db.txt ++++ b/db.txt +@@ -6,7 +6,7 @@ country 00: + # Channel 14. Only JP enables this and for 802.11b only + (2474 - 2494 @ 20), (20), NO-IR, NO-OFDM + # Channel 36 - 48 +- (5170 - 5250 @ 80), (20), NO-IR, AUTO-BW ++ (5170 - 5250 @ 80), (20), AUTO-BW + # Channel 52 - 64 + (5250 - 5330 @ 80), (20), NO-IR, DFS, AUTO-BW + # Channel 100 - 144 diff --git a/package/kernel/acx-mac80211/Makefile b/package/kernel/acx-mac80211/Makefile index 5629b050b5..5927f174d4 100644 --- a/package/kernel/acx-mac80211/Makefile +++ b/package/kernel/acx-mac80211/Makefile @@ -16,7 +16,6 @@ PKG_SOURCE_PROTO:=git PKG_SOURCE_DATE:=2014-02-16 PKG_SOURCE_VERSION:=b6fc31491020cb01d2cd1acc170cfa03ced7e726 PKG_MIRROR_HASH:=58590245715f0e5fb4b57aab6d91071dfb6a97d3273f5aee0b97b1edee030ed0 -PKG_BUILD_DEPENDS:=mac80211 PKG_CONFIG_DEPENDS:= \ CONFIG_PACKAGE_MAC80211_DEBUGFS \ @@ -27,9 +26,9 @@ include $(INCLUDE_DIR)/package.mk define KernelPackage/acx-mac80211 SUBMENU:=Wireless Drivers TITLE:=ACX1xx mac80211 driver - DEPENDS:=@(PCI_SUPPORT||TARGET_ar7) @mipsel @LINUX_3_18||LINUX_4_4 +kmod-mac80211 + DEPENDS:=@(PCI_SUPPORT||TARGET_ar7) @mipsel +kmod-mac80211 FILES:=$(PKG_BUILD_DIR)/acx-mac80211.ko - AUTOLOAD:=$(call AutoLoad,50,mac80211 acx-mac80211) + AUTOLOAD:=$(call AutoProbe,acx-mac80211) MAINTAINER:=Florian Fainelli MENU:=1 endef @@ -183,8 +182,7 @@ PKG_EXTRA_CFLAGS:= \ define Build/Compile $(MAKE) -C "$(LINUX_DIR)" \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ $(PKG_EXTRA_KCONFIG) \ EXTRA_CFLAGS="$(PKG_EXTRA_CFLAGS) -DCONFIG_ACX_MAC80211_VERSION=\"KERNEL_VERSION(4,2,0)\"" \ diff --git a/package/kernel/acx-mac80211/patches/100-compat.patch b/package/kernel/acx-mac80211/patches/100-compat.patch new file mode 100644 index 0000000000..6fcab5ea43 --- /dev/null +++ b/package/kernel/acx-mac80211/patches/100-compat.patch @@ -0,0 +1,16 @@ +diff --git a/pci.c b/pci.c +index ae07f5a..72d542f 100644 +--- a/pci.c ++++ b/pci.c +@@ -1495,7 +1495,11 @@ static struct acxpci_device_info acxpci_info_tbl[] __devinitdata = { + #endif + + #ifdef CONFIG_PCI ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0) + static DEFINE_PCI_DEVICE_TABLE(acxpci_id_tbl) = { ++#else ++static const struct pci_device_id acxpci_id_tbl[] = { ++#endif + { PCI_VDEVICE(TI, PCI_DEVICE_ID_TI_TNETW1100A), + .driver_data = CHIPTYPE_ACX100, + }, diff --git a/package/kernel/ar7-atm/Makefile b/package/kernel/ar7-atm/Makefile index edec44f969..82d6f61a7d 100644 --- a/package/kernel/ar7-atm/Makefile +++ b/package/kernel/ar7-atm/Makefile @@ -80,8 +80,7 @@ endef define Build/Compile $(MAKE) -C "$(LINUX_DIR)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - ARCH="$(LINUX_KARCH)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ modules endef diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/170-bus_id_removal.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/170-bus_id_removal.patch index 9f1f0fdae4..a970574fe5 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/170-bus_id_removal.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/170-bus_id_removal.patch @@ -1,30 +1,19 @@ --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -109,6 +109,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -446,7 +447,9 @@ static void avsar_release(struct device +@@ -446,7 +446,6 @@ static void avsar_release(struct device } static struct device avsar = { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) - .bus_id = "vlynq", -+#endif +- .bus_id = "vlynq", .release = avsar_release, }; -@@ -455,6 +458,9 @@ int shim_osLoadFWImage(unsigned char *pt +@@ -455,6 +454,8 @@ int shim_osLoadFWImage(unsigned char *pt const struct firmware *fw_entry; size_t size; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) + dev_set_name(&avsar, "avsar"); -+#endif ++ printk("requesting firmware image \"ar0700xx.bin\"\n"); if(device_register(&avsar) < 0) { printk(KERN_ERR diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/180-git_headers_include.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/180-git_headers_include.patch index 6bd8f48760..6d72b00544 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/180-git_headers_include.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/180-git_headers_include.patch @@ -1,54 +1,39 @@ --- a/tn7atm.c +++ b/tn7atm.c -@@ -71,10 +71,16 @@ - #include - #include +@@ -73,8 +73,8 @@ #include -+#include #include -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) - #include - #include -+#else +-#include +-#include +#include +#include -+#endif #include "dsl_hal_api.h" #include "tn7atm.h" --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -112,8 +112,13 @@ - #include +@@ -111,8 +111,8 @@ + #include #include -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) - #include - #include -+#else +-#include +-#include +#include +#include -+#endif /* Modules specific header files */ #include "tn7atm.h" --- a/tn7sar.c +++ b/tn7sar.c -@@ -52,10 +52,16 @@ - #include - #include +@@ -54,8 +54,8 @@ #include -+#include #include -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) - #include - #include -+#else +-#include +-#include +#include +#include -+#endif #define _CPHAL_AAL5 #define _CPHAL_SAR diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/190-2.6.32_proc_fixes.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/190-2.6.32_proc_fixes.patch index 11487bf7a6..1223604b0e 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/190-2.6.32_proc_fixes.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/190-2.6.32_proc_fixes.patch @@ -1,53 +1,70 @@ --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -203,7 +203,11 @@ led_reg_t ledreg[2]; +@@ -197,7 +197,7 @@ led_reg_t ledreg[2]; static struct led_funcs ledreg[2]; #endif -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - #define DEV_DSLMOD CTL_UNNUMBERED -+#else +-#define DEV_DSLMOD CTL_UNNUMBERED +#define DEV_DSLMOD 0 -+#endif #define MAX_STR_SIZE 256 #define DSL_MOD_SIZE 256 -@@ -3431,9 +3435,16 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -333,8 +333,8 @@ static void tn7dsl_chng_modulation(void* + static unsigned int tn7dsl_set_modulation(void* data, int flag); + static void tn7dsl_ctrl_fineGain(int value); + static void tn7dsl_set_fineGainValue(int value); +-static int dslmod_sysctl (ctl_table * ctl, int write, struct file *filp, +- void *buffer, size_t * lenp); ++static int dslmod_sysctl (ctl_table * ctl, int write, void *buffer, ++ size_t * lenp, loff_t *ppos); + static void tn7dsl_register_dslss_led(void); + void tn7dsl_dslmod_sysctl_register(void); + void tn7dsl_dslmod_sysctl_unregister(void); +@@ -3398,8 +3398,8 @@ unsigned int tn7dsl_get_memory(unsigned + + + +-static int dslmod_sysctl(ctl_table *ctl, int write, struct file * filp, +- void *buffer, size_t *lenp) ++static int dslmod_sysctl(ctl_table *ctl, int write, void *buffer, ++ size_t *lenp, loff_t *ppos) + { + char *ptr; + int ret, len = 0; +@@ -3411,7 +3411,7 @@ static int dslmod_sysctl(ctl_table *ctl, + char mod_req[16] = { '\t' }; + char fst_byt; + +- if (!*lenp || (filp->f_pos && !write)) ++ if (!*lenp || (*ppos && !write)) + { + *lenp = 0; + return 0; +@@ -3421,9 +3421,9 @@ static int dslmod_sysctl(ctl_table *ctl, */ if(write) { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) - ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); -- -+#else -+ ret = proc_dostring(ctl, write, buffer, lenp, 0); -+#endif -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - switch (ctl->ctl_name) -+#else +- ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); ++ ret = proc_dostring(ctl, write, buffer, lenp, ppos); + +- switch (ctl->ctl_name) + switch ((long)ctl->extra2) -+#endif { case DEV_DSLMOD: ptr = strpbrk(info, " \t"); -@@ -3517,14 +3528,29 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -3507,14 +3507,21 @@ static int dslmod_sysctl(ctl_table *ctl, else { len += sprintf(info+len, mod_req); -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) - ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); -+#else -+ ret = proc_dostring(ctl, write, buffer, lenp, 0); -+#endif +- ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); ++ ret = proc_dostring(ctl, write, buffer, lenp, ppos); } return ret; } ctl_table dslmod_table[] = { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} -+#else +- {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} + { + .procname = "dslmod", + .data = info, @@ -56,24 +73,20 @@ + .proc_handler = &dslmod_sysctl, + .extra2 = (void *)DEV_DSLMOD, + } -+#endif , {0} }; -@@ -3532,7 +3558,16 @@ ctl_table dslmod_table[] = { +@@ -3522,7 +3529,12 @@ ctl_table dslmod_table[] = { /* Make sure that /proc/sys/dev is there */ ctl_table dslmod_root_table[] = { #ifdef CONFIG_PROC_FS -+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table} -+ #else +- {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table} + { + .procname = "dev", + .maxlen = 0, + .mode = 0555, + .child = dslmod_table, + } -+ #endif , #endif /* CONFIG_PROC_FS */ {0} diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/200-2.6.37_args.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/200-2.6.37_args.patch index e8668b6c5e..2007b497c2 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/200-2.6.37_args.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/200-2.6.37_args.patch @@ -1,28 +1,24 @@ --- a/tn7atm.c +++ b/tn7atm.c -@@ -1876,7 +1876,11 @@ static int __init tn7atm_register (Tn7At +@@ -1870,7 +1870,7 @@ static int __init tn7atm_register (Tn7At dgprintf (4, "device %s being registered\n", priv->name); -+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) - mydev = atm_dev_register (priv->proc_name, &tn7atm_ops, -1, NULL); -+ #else +- mydev = atm_dev_register (priv->proc_name, &tn7atm_ops, -1, NULL); + mydev = atm_dev_register (priv->proc_name, NULL, &tn7atm_ops, -1, NULL); -+ #endif if (mydev == NULL) { --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -466,14 +466,17 @@ int shim_osLoadFWImage(unsigned char *pt +@@ -453,13 +453,16 @@ int shim_osLoadFWImage(unsigned char *pt { const struct firmware *fw_entry; size_t size; + int ret; - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) dev_set_name(&avsar, "avsar"); - #endif + printk("requesting firmware image \"ar0700xx.bin\"\n"); - if(device_register(&avsar) < 0) { + dev_set_name(&avsar, "avsar"); diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/220-3.10-update_proc_code.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/220-3.10-update_proc_code.patch index be81ee1253..7a2bbe8089 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/220-3.10-update_proc_code.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/220-3.10-update_proc_code.patch @@ -116,7 +116,7 @@ Signed-off-by: Jonas Gorski #endif __SGAPI_H --- a/tn7atm.c +++ b/tn7atm.c -@@ -277,25 +277,15 @@ static int tn7atm_change_qos (struct atm +@@ -271,25 +271,15 @@ static int tn7atm_change_qos (struct atm static int tn7atm_detect (void); static int tn7atm_init (struct atm_dev *dev); static int tn7atm_irq_request (struct atm_dev *dev); @@ -147,15 +147,7 @@ Signed-off-by: Jonas Gorski //CT - Added function to return chipset Id void tn7atm_get_chipsetId (char *pVerId); -@@ -415,63 +405,67 @@ const char drv_proc_root_folder[] = "ava - static struct proc_dir_entry *root_proc_dir_entry = NULL; - #define DRV_PROC_MODE 0644 - static int proc_root_already_exists = TRUE; -+ -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) -+#define PDE_DATA(inode) PDE(inode)->data -+#endif -+ +@@ -412,60 +402,59 @@ static int proc_root_already_exists = TR static struct { const unsigned char name[32]; @@ -250,7 +242,7 @@ Signed-off-by: Jonas Gorski }; /* *INDENT-ON* */ -@@ -1709,75 +1703,81 @@ int tn7atm_receive (void *os_dev, int ch +@@ -1703,75 +1692,81 @@ int tn7atm_receive (void *os_dev, int ch return 0; } @@ -301,15 +293,15 @@ Signed-off-by: Jonas Gorski - return len; + return 0; -+} -+ -+static int tn7atm_proc_channels_open(struct inode *inode, struct file *file) -+{ -+ return single_open(file, tn7atm_proc_channels, PDE_DATA(inode)); } -static int tn7atm_proc_private (char *buf, char **start, off_t offset, - int count, int *eof, void *data) ++static int tn7atm_proc_channels_open(struct inode *inode, struct file *file) ++{ ++ return single_open(file, tn7atm_proc_channels, PDE_DATA(inode)); ++} ++ +static struct file_operations tn7atm_proc_channels_fops = { + .owner = THIS_MODULE, + .open = tn7atm_proc_channels_open, @@ -353,11 +345,11 @@ Signed-off-by: Jonas Gorski + + seq_printf (m, "tx_irq: %02d", priv->sar_irq); + seq_printf (m, "rx_irq: %02d", priv->dsl_irq); - -- return len; ++ + return 0; +} -+ + +- return len; +static int tn7atm_proc_private_open(struct inode *inode, struct file *file) +{ + return single_open(file, tn7atm_proc_private, PDE_DATA(inode)); @@ -374,7 +366,7 @@ Signed-off-by: Jonas Gorski void tn7atm_sarhal_isr_register (void *os_dev, void *hal_isr, int interrupt_num) { -@@ -1900,10 +1900,8 @@ static int __init tn7atm_register (Tn7At +@@ -1890,10 +1885,8 @@ static int __init tn7atm_register (Tn7At return ATM_REG_OK; } @@ -386,7 +378,7 @@ Signed-off-by: Jonas Gorski char dslVer[8]; char dspVer[10]; char chipsetID[32]; //CT CQ10076 - Added temporary buffer to store chipset Id -@@ -1914,56 +1912,64 @@ static int tn7atm_proc_version (char *bu +@@ -1904,56 +1897,64 @@ static int tn7atm_proc_version (char *bu priv = mydev->dev_data; @@ -472,7 +464,7 @@ Signed-off-by: Jonas Gorski int ctr; const char *residual; -@@ -2012,24 +2018,7 @@ static int __init tn7atm_detect (void) +@@ -2002,24 +2003,7 @@ static int __init tn7atm_detect (void) */ for (ctr = 0; ctr < (NUM_ELEMS (proc_if)); ctr++) { @@ -498,7 +490,7 @@ Signed-off-by: Jonas Gorski } tn7dsl_dslmod_sysctl_register (); -@@ -2501,63 +2490,10 @@ static int tn7atm_set_can_support_adsl2 +@@ -2491,63 +2475,10 @@ static int tn7atm_set_can_support_adsl2 return TRUE; } @@ -564,7 +556,7 @@ Signed-off-by: Jonas Gorski } static int tn7atm_proc_qos_write(struct file *fp, const char *buf, unsigned long count, void *data) -@@ -2591,5 +2527,19 @@ static int tn7atm_proc_qos_write(struct +@@ -2581,5 +2512,19 @@ static int tn7atm_proc_qos_write(struct return count; } @@ -586,17 +578,7 @@ Signed-off-by: Jonas Gorski module_exit (tn7atm_exit); --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -221,6 +221,9 @@ static struct led_funcs ledreg[2]; - - #define tn7dsl_kfree_skb(x) dev_kfree_skb(x) - -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) -+#define PDE_DATA(inode) PDE(inode)->data -+#endif - - //--------------------------------------------- - // Begin Clear EOC definitions -@@ -349,7 +352,7 @@ static void tn7dsl_register_dslss_led(vo +@@ -339,7 +339,7 @@ static void tn7dsl_register_dslss_led(vo void tn7dsl_dslmod_sysctl_register(void); void tn7dsl_dslmod_sysctl_unregister(void); static int tn7dsl_clear_eoc_receive(void); @@ -605,7 +587,7 @@ Signed-off-by: Jonas Gorski /* end of internal functions */ // UR8_MERGE_START CQ11054 Jack Zhang -@@ -649,11 +652,9 @@ void shim_osCriticalExit(void) +@@ -635,11 +635,9 @@ void shim_osCriticalExit(void) spin_unlock_irqrestore(&shimLock, flags); } @@ -618,7 +600,7 @@ Signed-off-by: Jonas Gorski int i, j; int bin = (int) data; unsigned short *rxSnrPerBin; -@@ -674,95 +675,128 @@ static int tn7dsl_proc_snr_print (char * +@@ -660,95 +658,128 @@ static int tn7dsl_proc_snr_print (char * break; default: @@ -791,7 +773,7 @@ Signed-off-by: Jonas Gorski #ifndef NO_ACT int tn7dsl_proc_ds_noise(char* buf, char **start, off_t offset, int count, int *eof, void *data) -@@ -825,59 +859,48 @@ static char *pUnknown= "Unknown"; +@@ -811,59 +842,48 @@ static char *pUnknown= "Unknown"; #ifdef ADV_DIAG_STATS //CQ10275, CQ10449 //UR8_MERGE_START CQ10449 Jack Zhang @@ -874,7 +856,7 @@ Signed-off-by: Jonas Gorski { int len = 0; int i = 0; -@@ -886,66 +909,53 @@ static int proc_adv_stats_header(char* b +@@ -872,66 +892,53 @@ static int proc_adv_stats_header(char* b */ dslhal_api_gatherStatistics(pIhw); @@ -963,7 +945,7 @@ Signed-off-by: Jonas Gorski } static int getDiagDisplayMode() -@@ -968,29 +978,24 @@ static int getDiagDisplayMode() +@@ -954,29 +961,24 @@ static int getDiagDisplayMode() ret = 2; return ret; } @@ -998,7 +980,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.BitAllocTblDstrm[i], (unsigned int)pIhw->AppData.marginTblDstrm[i], (int)pIhw->AppData.rxSnrPerBin0[i]); -@@ -1001,26 +1006,34 @@ int tn7dsl_proc_adv_stats1(char* buf, ch +@@ -987,26 +989,34 @@ int tn7dsl_proc_adv_stats1(char* buf, ch if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1)) { dgprintf(4, "dslhal_api_getSNRpsds failed!\n"); @@ -1041,7 +1023,7 @@ Signed-off-by: Jonas Gorski int i; int mode = 0; //mode = 0 => ADSL1 or ADSL2 & 2+ unsigned char SNRpsds[512]; -@@ -1030,12 +1043,10 @@ int tn7dsl_proc_adv_stats2(char* buf, ch +@@ -1016,12 +1026,10 @@ int tn7dsl_proc_adv_stats2(char* buf, ch if( mode==1) //ADSL1 { dslhal_api_gatherStatistics(pIhw); @@ -1056,7 +1038,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.BitAllocTblDstrm[i], (unsigned int)pIhw->AppData.marginTblDstrm[i], (int)pIhw->AppData.rxSnrPerBin0[i]); -@@ -1046,26 +1057,35 @@ int tn7dsl_proc_adv_stats2(char* buf, ch +@@ -1032,26 +1040,35 @@ int tn7dsl_proc_adv_stats2(char* buf, ch if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1)) { dgprintf(4, "dslhal_api_getSNRpsds failed!\n"); @@ -1100,7 +1082,7 @@ Signed-off-by: Jonas Gorski int i; int mode = 0; //mode = 0 => ADSL1 or ADSL2 & 2+ unsigned char SNRpsds[512]; -@@ -1075,12 +1095,10 @@ int tn7dsl_proc_adv_stats3(char* buf, ch +@@ -1061,12 +1078,10 @@ int tn7dsl_proc_adv_stats3(char* buf, ch if( mode==1) //ADSL1 { dslhal_api_gatherStatistics(pIhw); @@ -1115,7 +1097,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.BitAllocTblDstrm[i], (unsigned int)pIhw->AppData.marginTblDstrm[i], (int)pIhw->AppData.rxSnrPerBin0[i]); -@@ -1091,283 +1109,287 @@ int tn7dsl_proc_adv_stats3(char* buf, ch +@@ -1077,283 +1092,287 @@ int tn7dsl_proc_adv_stats3(char* buf, ch if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1)) { dgprintf(4, "dslhal_api_getSNRpsds failed!\n"); @@ -1256,7 +1238,9 @@ Signed-off-by: Jonas Gorski { + return single_open(file, tn7dsl_proc_dbg_cmsgs, PDE_DATA(inode)); +} -+ + +- int len = 0; +- int limit = count - 80; +struct file_operations tn7dsl_proc_dbg_cmsgs_fops = { + .owner = THIS_MODULE, + .open = tn7dsl_proc_dbg_cmsgs_open, @@ -1264,9 +1248,7 @@ Signed-off-by: Jonas Gorski + .llseek = seq_lseek, + .release = single_release, +}; - -- int len = 0; -- int limit = count - 80; ++ + +int tn7dsl_proc_dbg_rmsgs1(struct seq_file *m, void *data) +{ @@ -1544,7 +1526,7 @@ Signed-off-by: Jonas Gorski int F4count, F5count; unsigned int maxRate=0; unsigned int us_maxRate=0; -@@ -1375,80 +1397,58 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1361,80 +1380,58 @@ int tn7dsl_proc_stats(char* buf, char ** //UR8_MERGE_START CQ10700 Manjula K struct atm_dev *dev; Tn7AtmPrivate *priv; @@ -1648,7 +1630,7 @@ Signed-off-by: Jonas Gorski ((unsigned int) pIhw->AppData.usAtm_count[0] + (unsigned int) pIhw->AppData.usAtm_count[1]) * 48, ((unsigned int) pIhw->AppData.dsGood_count[0] + -@@ -1456,9 +1456,7 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1442,9 +1439,7 @@ int tn7dsl_proc_stats(char* buf, char ** /* * Superframe Count */ @@ -1659,7 +1641,7 @@ Signed-off-by: Jonas Gorski "\tUS Superframe Cnt :\t%u\tDS Superframe Cnt:\t%u\n", (unsigned int)pIhw->AppData.usSuperFrmCnt, (unsigned int)pIhw->AppData.dsSuperFrmCnt ); -@@ -1466,57 +1464,45 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1452,57 +1447,45 @@ int tn7dsl_proc_stats(char* buf, char ** /* * US and DS power */ @@ -1732,7 +1714,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.currentHybridNum, trellis); //@Added Maximum attainable bit rate information. 05-14-2004 -@@ -1528,12 +1514,12 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1514,12 +1497,12 @@ int tn7dsl_proc_stats(char* buf, char ** } else { @@ -1747,7 +1729,7 @@ Signed-off-by: Jonas Gorski (unsigned char *) &rMsgsRA[0], 12); maxRate = (unsigned int)pIhw->AppData.DSConRate; -@@ -1549,283 +1535,213 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1535,283 +1518,213 @@ int tn7dsl_proc_stats(char* buf, char ** } } @@ -2129,7 +2111,7 @@ Signed-off-by: Jonas Gorski char *state; int tag; -@@ -1859,16 +1775,26 @@ int tn7dsl_proc_modem(char* buf, char ** +@@ -1845,16 +1758,26 @@ int tn7dsl_proc_modem(char* buf, char ** if(pIhw->lConnected == 1) state = "SHOWTIME"; @@ -2163,7 +2145,7 @@ Signed-off-by: Jonas Gorski /********************************************************************** ** * ** tn7dsl_hdlc_update_crc() -- Calculate CRC * -@@ -2133,11 +2059,8 @@ static int tn7dsl_hdlc_rx_process(unsign +@@ -2119,11 +2042,8 @@ static int tn7dsl_hdlc_rx_process(unsign return(ret); } @@ -2176,7 +2158,7 @@ Signed-off-by: Jonas Gorski int offset[2] = {34, 0}; // point to buffer parameter data structure clearEocParm_t peoc; -@@ -2146,62 +2069,49 @@ int tn7dsl_proc_eoc (char *buf, char **s +@@ -2132,62 +2052,49 @@ int tn7dsl_proc_eoc (char *buf, char **s (unsigned char *) &peoc, sizeof (clearEocParm_t)); @@ -2279,7 +2261,7 @@ Signed-off-by: Jonas Gorski int tn7dsl_clear_eoc_setup(void) { int i; -@@ -4440,14 +4350,10 @@ int tn7dsl_proc_write_stats (struct file +@@ -4407,14 +4314,10 @@ int tn7dsl_proc_write_stats (struct file } @@ -2295,7 +2277,7 @@ Signed-off-by: Jonas Gorski typedef struct { -@@ -4528,197 +4434,185 @@ int tn7dsl_proc_train_mode_export (char +@@ -4495,197 +4398,185 @@ int tn7dsl_proc_train_mode_export (char } @@ -2574,7 +2556,7 @@ Signed-off-by: Jonas Gorski } start = (indx -1) * 128; -@@ -4727,39 +4621,89 @@ static int tn7dsl_proc_HLINpsdsIndx(char +@@ -4694,39 +4585,89 @@ static int tn7dsl_proc_HLINpsdsIndx(char { if (!(i%8)) { @@ -2679,7 +2661,7 @@ Signed-off-by: Jonas Gorski #endif #endif //TR69_HLIN_IN // UR8_MERGE_END CQ10979* -@@ -4767,64 +4711,48 @@ int tn7dsl_proc_HLINpsds4(char* buf, cha +@@ -4734,64 +4675,48 @@ int tn7dsl_proc_HLINpsds4(char* buf, cha // * UR8_MERGE_START CQ11057 Jack Zhang #ifdef TR69_PMD_IN #ifndef NO_ADV_STATS @@ -2760,7 +2742,7 @@ Signed-off-by: Jonas Gorski } -@@ -4832,19 +4760,28 @@ int tn7dsl_proc_PMDus(char* buf, char ** +@@ -4799,19 +4724,28 @@ int tn7dsl_proc_PMDus(char* buf, char ** for (i=0; iAppData.max_us_tones; i++) { if (!(i%16)) @@ -2800,15 +2782,11 @@ Signed-off-by: Jonas Gorski // * UR8_MERGE_END CQ11057 * --- a/tn7sar.c +++ b/tn7sar.c -@@ -1401,44 +1401,70 @@ int tn7sar_oam_generation(void *privCont +@@ -1395,44 +1395,66 @@ int tn7sar_oam_generation(void *privCont return 0; } -int tn7sar_proc_oam_ping(char* buf, char **start, off_t offset, int count,int *eof, void *data) -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) -+#define PDE_DATA(inode) PDE(inode)->data -+#endif -+ +static int tn7sar_proc_oam_ping(struct seq_file *m, void *data) { - int len = 0; @@ -2883,7 +2861,7 @@ Signed-off-by: Jonas Gorski struct atm_dev *dev; Tn7AtmPrivate *priv; int i, j, k; -@@ -1447,21 +1473,19 @@ int tn7sar_proc_sar_stat(char* buf, char +@@ -1441,21 +1463,19 @@ int tn7sar_proc_sar_stat(char* buf, char unsigned int *pStateBase, *pSarStat; HAL_FUNCTIONS *pHalFunc; HAL_DEVICE *pHalDev; @@ -2908,7 +2886,7 @@ Signed-off-by: Jonas Gorski k=0; for(j=0;j<4;j++) { -@@ -1474,26 +1498,16 @@ int tn7sar_proc_sar_stat(char* buf, char +@@ -1468,26 +1488,18 @@ int tn7sar_proc_sar_stat(char* buf, char { if((char *)*pSarStat == NULL) break; @@ -2919,7 +2897,8 @@ Signed-off-by: Jonas Gorski - k += dBytes; - } + -+ k += seq_printf(m, "%s: ",(char *) *pSarStat); ++ seq_printf(m, "%s: ",(char *) *pSarStat); ++ k += strlen((char *) *pSarStat) + strlen(": "); pSarStat++; - if(len<=limit) - { @@ -2927,7 +2906,8 @@ Signed-off-by: Jonas Gorski - len += dBytes; - k += dBytes; - } -+ k += seq_printf(m, "%s; \n",(char *) *pSarStat); ++ seq_printf(m, "%s; \n",(char *) *pSarStat); ++ k += strlen((char *) *pSarStat) + strlen("; \n"); pSarStat++; if(k > 60) @@ -2939,7 +2919,7 @@ Signed-off-by: Jonas Gorski } } -@@ -1502,9 +1516,22 @@ int tn7sar_proc_sar_stat(char* buf, char +@@ -1496,9 +1508,22 @@ int tn7sar_proc_sar_stat(char* buf, char } } diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/240-3.18_fixes.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/240-3.18_fixes.patch index e8bdab63da..2e69300147 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/240-3.18_fixes.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/240-3.18_fixes.patch @@ -1,38 +1,38 @@ --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -346,7 +346,7 @@ static void tn7dsl_chng_modulation(void* +@@ -333,7 +333,7 @@ static void tn7dsl_chng_modulation(void* static unsigned int tn7dsl_set_modulation(void* data, int flag); static void tn7dsl_ctrl_fineGain(int value); static void tn7dsl_set_fineGainValue(int value); --static int dslmod_sysctl (ctl_table * ctl, int write, struct file *filp, -+static int dslmod_sysctl (struct ctl_table * ctl, int write, struct file *filp, - void *buffer, size_t * lenp); +-static int dslmod_sysctl (ctl_table * ctl, int write, void *buffer, ++static int dslmod_sysctl (struct ctl_table * ctl, int write, void *buffer, + size_t * lenp, loff_t *ppos); static void tn7dsl_register_dslss_led(void); void tn7dsl_dslmod_sysctl_register(void); -@@ -3325,7 +3325,7 @@ unsigned int tn7dsl_get_memory(unsigned +@@ -3308,7 +3308,7 @@ unsigned int tn7dsl_get_memory(unsigned --static int dslmod_sysctl(ctl_table *ctl, int write, struct file * filp, -+static int dslmod_sysctl(struct ctl_table *ctl, int write, struct file * filp, - void *buffer, size_t *lenp) +-static int dslmod_sysctl(ctl_table *ctl, int write, void *buffer, ++static int dslmod_sysctl(struct ctl_table *ctl, int write, void *buffer, + size_t *lenp, loff_t *ppos) { char *ptr; -@@ -3451,7 +3451,7 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -3423,7 +3423,7 @@ static int dslmod_sysctl(ctl_table *ctl, } -ctl_table dslmod_table[] = { +struct ctl_table dslmod_table[] = { - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} - #else -@@ -3469,7 +3469,7 @@ ctl_table dslmod_table[] = { + { + .procname = "dslmod", + .data = info, +@@ -3437,7 +3437,7 @@ ctl_table dslmod_table[] = { }; /* Make sure that /proc/sys/dev is there */ -ctl_table dslmod_root_table[] = { +struct ctl_table dslmod_root_table[] = { #ifdef CONFIG_PROC_FS - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table} + { + .procname = "dev", diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/250-4.1_fixes.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/250-4.1_fixes.patch index 97a26cb417..f26b7e221c 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/250-4.1_fixes.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/250-4.1_fixes.patch @@ -1,6 +1,6 @@ --- a/tn7atm.c +++ b/tn7atm.c -@@ -788,7 +788,7 @@ static int __init tn7atm_irq_request (st +@@ -777,7 +777,7 @@ static int __init tn7atm_irq_request (st * Register SAR interrupt */ priv->sar_irq = LNXINTNUM (ATM_SAR_INT); /* Interrupt line # */ @@ -9,7 +9,7 @@ printk ("Could not register tn7atm_sar_irq\n"); /* -@@ -806,7 +806,7 @@ static int __init tn7atm_irq_request (st +@@ -795,7 +795,7 @@ static int __init tn7atm_irq_request (st * Reigster Receive interrupt A */ priv->dsl_irq = LNXINTNUM (ATM_DSL_INT); /* Interrupt line # */ diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/260-fix_function_signatures.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/260-fix_function_signatures.patch new file mode 100644 index 0000000000..fe13fc5476 --- /dev/null +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/260-fix_function_signatures.patch @@ -0,0 +1,63 @@ +--- a/cpswhal_cpsar.h ++++ b/cpswhal_cpsar.h +@@ -430,10 +430,10 @@ typedef struct + int (*DeviceFindInfo)(int Inst, const char *DeviceName, void *DeviceInfo); + int (*DeviceFindParmUint)(void *DeviceInfo, const char *Parm, bit32u *Value); + int (*DeviceFindParmValue)(void *DeviceInfo, const char *Parm, void *Value); +- void (*Free)(void *MemPtr); ++ void (*Free)(const void *MemPtr); + void (*FreeRxBuffer)(OS_RECEIVEINFO *OsReceiveInfo, void *MemPtr); +- void (*FreeDev)(void *MemPtr); +- void (*FreeDmaXfer)(void *MemPtr); ++ void (*FreeDev)(const void *MemPtr); ++ void (*FreeDmaXfer)(const void *MemPtr); + void (*IsrRegister)(OS_DEVICE *OsDev, int (*halISR)(HAL_DEVICE*, int*), int InterruptBit); + void (*IsrUnRegister)(OS_DEVICE *OsDev, int InterruptBit); + void* (*Malloc)(bit32u size); +--- a/cpswhal_cpaal5.h ++++ b/cpswhal_cpaal5.h +@@ -430,10 +430,10 @@ typedef struct + int (*DeviceFindInfo)(int Inst, const char *DeviceName, void *DeviceInfo); + int (*DeviceFindParmUint)(void *DeviceInfo, const char *Parm, bit32u *Value); + int (*DeviceFindParmValue)(void *DeviceInfo, const char *Parm, void *Value); +- void (*Free)(void *MemPtr); ++ void (*Free)(const void *MemPtr); + void (*FreeRxBuffer)(OS_RECEIVEINFO *OsReceiveInfo, void *MemPtr); +- void (*FreeDev)(void *MemPtr); +- void (*FreeDmaXfer)(void *MemPtr); ++ void (*FreeDev)(const void *MemPtr); ++ void (*FreeDmaXfer)(const void *MemPtr); + void (*IsrRegister)(OS_DEVICE *OsDev, int (*halISR)(HAL_DEVICE*, int*), int InterruptBit); + void (*IsrUnRegister)(OS_DEVICE *OsDev, int InterruptBit); + void* (*Malloc)(bit32u size); +--- a/tn7atm.c ++++ b/tn7atm.c +@@ -2481,7 +2481,7 @@ static int tn7atm_proc_qos_read(struct s + return 0; + + } +-static int tn7atm_proc_qos_write(struct file *fp, const char *buf, unsigned long count, void *data) ++static int tn7atm_proc_qos_write(struct file *fp, const char *buf, size_t count, loff_t *data) + { + char local_buf[32]; + +--- a/tn7dsl.c ++++ b/tn7dsl.c +@@ -1712,7 +1712,7 @@ static int tn7dsl_proc_stats_open(struct + return single_open(file, tn7dsl_proc_stats, PDE_DATA(inode)); + } + +-int tn7dsl_proc_write_stats (struct file *fp, const char *buf, unsigned long count, void *data); ++int tn7dsl_proc_write_stats (struct file *fp, const char *buf, size_t count, loff_t *data); + + struct file_operations tn7dsl_proc_stats_fops = { + .owner = THIS_MODULE, +@@ -4256,7 +4256,7 @@ int tn7dsl_generic_write( int offsetnum, + } + + int tn7dsl_proc_write_stats (struct file *fp, const char *buf, +- unsigned long count, void *data) ++ size_t count, loff_t *data) + { + char local_buf[31]; + int ret_val = 0; diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/170-bus_id_removal.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/170-bus_id_removal.patch index 6692f40f6a..53767e45be 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/170-bus_id_removal.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/170-bus_id_removal.patch @@ -1,30 +1,19 @@ --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -117,6 +117,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -492,7 +493,9 @@ static void avsar_release(struct device +@@ -492,7 +492,6 @@ static void avsar_release(struct device } static struct device avsar = { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) - .bus_id = "vlynq", -+#endif +- .bus_id = "vlynq", .release = avsar_release, }; -@@ -501,6 +504,9 @@ int shim_osLoadFWImage(unsigned char *pt +@@ -501,6 +500,8 @@ int shim_osLoadFWImage(unsigned char *pt const struct firmware *fw_entry; size_t size; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) + dev_set_name(&avsar, "avsar"); -+#endif ++ printk("requesting firmware image \"ar0700xx.bin\"\n"); if(device_register(&avsar) < 0) { printk(KERN_ERR diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/180-git_headers_include.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/180-git_headers_include.patch index feb6ea8605..69b433b2b9 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/180-git_headers_include.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/180-git_headers_include.patch @@ -1,54 +1,39 @@ --- a/tn7atm.c +++ b/tn7atm.c -@@ -76,10 +76,16 @@ - #include - #include +@@ -78,8 +78,8 @@ #include -+#include #include -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) - #include - #include -+#else +-#include +-#include +#include +#include -+#endif #include "dsl_hal_api.h" #ifdef AR7_EFM --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -120,8 +120,13 @@ - #include +@@ -119,8 +119,8 @@ + #include #include -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) - #include - #include -+#else +-#include +-#include +#include +#include -+#endif /* Modules specific header files */ #ifdef AR7_EFM --- a/tn7sar.c +++ b/tn7sar.c -@@ -53,10 +53,16 @@ - #include - #include +@@ -55,8 +55,8 @@ #include -+#include #include -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) - #include - #include -+#else +-#include +-#include +#include +#include -+#endif #define _CPHAL_AAL5 #define _CPHAL_SAR diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/190-2.6.32_proc_fixes.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/190-2.6.32_proc_fixes.patch index 52ebbc1529..10d32d2618 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/190-2.6.32_proc_fixes.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/190-2.6.32_proc_fixes.patch @@ -1,53 +1,70 @@ --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -215,7 +215,11 @@ led_reg_t ledreg[2]; +@@ -209,7 +209,7 @@ led_reg_t ledreg[2]; static struct led_funcs ledreg[2]; #endif -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - #define DEV_DSLMOD CTL_UNNUMBERED -+#else +-#define DEV_DSLMOD CTL_UNNUMBERED +#define DEV_DSLMOD 0 -+#endif #define MAX_STR_SIZE 256 #define DSL_MOD_SIZE 256 -@@ -3615,9 +3619,16 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -350,8 +350,8 @@ static void tn7dsl_chng_modulation(void* + static unsigned int tn7dsl_set_modulation(void* data, int flag); + static void tn7dsl_ctrl_fineGain(int value); + static void tn7dsl_set_fineGainValue(int value); +-static int dslmod_sysctl (ctl_table * ctl, int write, struct file *filp, +- void *buffer, size_t * lenp); ++static int dslmod_sysctl (ctl_table * ctl, int write, void *buffer, ++ size_t * lenp, loff_t *ppos); + static void tn7dsl_register_dslss_led(void); + void tn7dsl_dslmod_sysctl_register(void); + void tn7dsl_dslmod_sysctl_unregister(void); +@@ -3582,8 +3582,8 @@ unsigned int tn7dsl_get_memory(unsigned + + + +-static int dslmod_sysctl(ctl_table *ctl, int write, struct file * filp, +- void *buffer, size_t *lenp) ++static int dslmod_sysctl(ctl_table *ctl, int write, void *buffer, ++ size_t *lenp, loff_t *ppos) + { + char *ptr; + int ret, len = 0; +@@ -3595,7 +3595,7 @@ static int dslmod_sysctl(ctl_table *ctl, + char mod_req[16] = { '\t' }; + char fst_byt; + +- if (!*lenp || (filp->f_pos && !write)) ++ if (!*lenp || (*ppos && !write)) + { + *lenp = 0; + return 0; +@@ -3605,9 +3605,9 @@ static int dslmod_sysctl(ctl_table *ctl, */ if(write) { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) - ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); -- -+#else -+ ret = proc_dostring(ctl, write, buffer, lenp, 0); -+#endif -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - switch (ctl->ctl_name) -+#else +- ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); ++ ret = proc_dostring(ctl, write, buffer, lenp, ppos); + +- switch (ctl->ctl_name) + switch ((long)ctl->extra2) -+#endif { case DEV_DSLMOD: ptr = strpbrk(info, " \t"); -@@ -3701,14 +3712,29 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -3691,14 +3691,21 @@ static int dslmod_sysctl(ctl_table *ctl, else { len += sprintf(info+len, mod_req); -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) - ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); -+#else -+ ret = proc_dostring(ctl, write, buffer, lenp, 0); -+#endif +- ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); ++ ret = proc_dostring(ctl, write, buffer, lenp, ppos); } return ret; } ctl_table dslmod_table[] = { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} -+#else +- {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} + { + .procname = "dslmod", + .data = info, @@ -56,24 +73,20 @@ + .proc_handler = &dslmod_sysctl, + .extra2 = (void *)DEV_DSLMOD, + } -+#endif , {0} }; -@@ -3716,7 +3742,16 @@ ctl_table dslmod_table[] = { +@@ -3706,7 +3713,12 @@ ctl_table dslmod_table[] = { /* Make sure that /proc/sys/dev is there */ ctl_table dslmod_root_table[] = { #ifdef CONFIG_PROC_FS -+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table} -+ #else +- {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table} + { + .procname = "dev", + .maxlen = 0, + .mode = 0555, + .child = dslmod_table, + } -+ #endif , #endif /* CONFIG_PROC_FS */ {0} diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/200-2.6.37_args.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/200-2.6.37_args.patch index f6dba4be9f..75de5a33e7 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/200-2.6.37_args.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/200-2.6.37_args.patch @@ -1,28 +1,24 @@ --- a/tn7atm.c +++ b/tn7atm.c -@@ -2009,7 +2009,11 @@ static int __init tn7atm_register (Tn7At +@@ -2003,7 +2003,7 @@ static int __init tn7atm_register (Tn7At dgprintf (4, "device %s being registered\n", priv->name); -+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) - mydev = atm_dev_register (priv->proc_name, &tn7atm_ops, -1, NULL); -+ #else +- mydev = atm_dev_register (priv->proc_name, &tn7atm_ops, -1, NULL); + mydev = atm_dev_register (priv->proc_name, NULL, &tn7atm_ops, -1, NULL); -+ #endif if (mydev == NULL) { --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -512,14 +512,17 @@ int shim_osLoadFWImage(unsigned char *pt +@@ -499,13 +499,16 @@ int shim_osLoadFWImage(unsigned char *pt { const struct firmware *fw_entry; size_t size; + int ret; - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) dev_set_name(&avsar, "avsar"); - #endif + printk("requesting firmware image \"ar0700xx.bin\"\n"); - if(device_register(&avsar) < 0) { + dev_set_name(&avsar, "avsar"); diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/220-3.10-update_proc_code.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/220-3.10-update_proc_code.patch index 747869bf7c..ef1ddd833c 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/220-3.10-update_proc_code.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/220-3.10-update_proc_code.patch @@ -125,7 +125,7 @@ Signed-off-by: Jonas Gorski #endif __SGAPI_H --- a/tn7atm.c +++ b/tn7atm.c -@@ -265,11 +265,9 @@ MODULE_PARM_DESC(oam_lb_timeout, "OAM LB +@@ -259,11 +259,9 @@ MODULE_PARM_DESC(oam_lb_timeout, "OAM LB #ifdef AR7_EFM extern void tn7dsl_disable_alarm(void); @@ -140,7 +140,7 @@ Signed-off-by: Jonas Gorski extern unsigned int g_efm_proc_ctl; extern struct net_device *mydev_efm; extern Tn7AtmPrivate *mypriv; -@@ -305,31 +303,17 @@ extern int tn7efm_register (Tn7AtmPrivat +@@ -299,31 +297,17 @@ extern int tn7efm_register (Tn7AtmPrivat static int tn7atm_irq_request (struct atm_dev *dev); #endif @@ -177,15 +177,7 @@ Signed-off-by: Jonas Gorski //CT - Added function to return chipset Id void tn7atm_get_chipsetId (char *pVerId); -@@ -456,78 +440,83 @@ const char drv_proc_root_folder[] = "ava - static struct proc_dir_entry *root_proc_dir_entry = NULL; - #define DRV_PROC_MODE 0644 - static int proc_root_already_exists = TRUE; -+ -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) -+#define PDE_DATA(inode) PDE(inode)->data -+#endif -+ +@@ -453,75 +437,75 @@ static int proc_root_already_exists = TR static struct { const unsigned char name[32]; @@ -301,7 +293,7 @@ Signed-off-by: Jonas Gorski }; /* *INDENT-ON* */ -@@ -1811,76 +1800,81 @@ int tn7atm_receive (void *os_dev, int ch +@@ -1805,76 +1789,81 @@ int tn7atm_receive (void *os_dev, int ch return 0; } @@ -353,15 +345,15 @@ Signed-off-by: Jonas Gorski - return len; + return 0; -+} -+ -+static int tn7atm_proc_channels_open(struct inode *inode, struct file *file) -+{ -+ return single_open(file, tn7atm_proc_channels, PDE_DATA(inode)); } -static int tn7atm_proc_private (char *buf, char **start, off_t offset, - int count, int *eof, void *data) ++static int tn7atm_proc_channels_open(struct inode *inode, struct file *file) ++{ ++ return single_open(file, tn7atm_proc_channels, PDE_DATA(inode)); ++} ++ +static struct file_operations tn7atm_proc_channels_fops = { + .owner = THIS_MODULE, + .open = tn7atm_proc_channels_open, @@ -426,7 +418,7 @@ Signed-off-by: Jonas Gorski void tn7atm_sarhal_isr_register (void *os_dev, void *hal_isr, int interrupt_num) { -@@ -2033,10 +2027,8 @@ static int __init tn7atm_register (Tn7At +@@ -2023,10 +2012,8 @@ static int __init tn7atm_register (Tn7At return ATM_REG_OK; } @@ -438,7 +430,7 @@ Signed-off-by: Jonas Gorski char dslVer[8]; char dspVer[10]; char chipsetID[32]; //CT CQ10076 - Added temporary buffer to store chipset Id -@@ -2051,58 +2043,52 @@ static int tn7atm_proc_version (char *bu +@@ -2041,58 +2028,52 @@ static int tn7atm_proc_version (char *bu priv = mydev->dev_data; #ifdef AR7_EFM @@ -517,7 +509,7 @@ Signed-off-by: Jonas Gorski pdspV1, pdspV2, (priv->curr_TC_mode== TC_MODE_ATM) ? '*' : ' '); tn7sar_get_EFM_firmware_version (&pdspV1, &pdspV2); -@@ -2114,26 +2100,37 @@ static int tn7atm_proc_version (char *bu +@@ -2104,26 +2085,37 @@ static int tn7atm_proc_version (char *bu #endif str = "EFM"; @@ -531,16 +523,16 @@ Signed-off-by: Jonas Gorski tn7atm_get_chipsetId(chipsetID); - len += sprintf (buf + len, "Chipset ID: [%s]\n",chipsetID); + seq_printf (m, "Chipset ID: [%s]\n",chipsetID); -+ -+ return 0; -+} - return len; ++ return 0; + } + +static int tn7atm_proc_version_open(struct inode *inode, struct file *file) +{ + return single_open(file, tn7atm_proc_version, PDE_DATA(inode)); - } - ++} ++ +static struct file_operations tn7atm_proc_version_fops = { + .owner = THIS_MODULE, + .open = tn7atm_proc_version_open, @@ -560,7 +552,7 @@ Signed-off-by: Jonas Gorski int ctr; const char *residual; -@@ -2214,24 +2211,7 @@ static int __init tn7atm_detect (void) +@@ -2204,24 +2196,7 @@ static int __init tn7atm_detect (void) */ for (ctr = 0; ctr < (NUM_ELEMS (proc_if)); ctr++) { @@ -586,7 +578,7 @@ Signed-off-by: Jonas Gorski } tn7dsl_dslmod_sysctl_register (); -@@ -2711,73 +2691,18 @@ static int tn7atm_set_can_support_adsl2 +@@ -2701,73 +2676,18 @@ static int tn7atm_set_can_support_adsl2 return TRUE; } @@ -599,10 +591,10 @@ Signed-off-by: Jonas Gorski +static int tn7atm_proc_qos_read(struct seq_file *m, void *data) { - if (!de || !de->low_ino) +- return 0; +- if (de->namelen != len) + seq_printf (m, "\nEnableQoS = %d\n", EnableQoS); return 0; -- if (de->namelen != len) -- return 0; - return !strncmp (name, de->name, len); -} - @@ -665,7 +657,7 @@ Signed-off-by: Jonas Gorski } static int tn7atm_proc_qos_write(struct file *fp, const char *buf, unsigned long count, void *data) -@@ -2812,7 +2737,7 @@ static int tn7atm_proc_qos_write(struct +@@ -2802,7 +2722,7 @@ static int tn7atm_proc_qos_write(struct } // [KT] @@ -674,7 +666,7 @@ Signed-off-by: Jonas Gorski { char local_buf[10]; -@@ -2843,5 +2768,33 @@ int tn7atm_proc_turbodsl_write(struct fi +@@ -2833,5 +2753,33 @@ int tn7atm_proc_turbodsl_write(struct fi return count; } @@ -710,17 +702,7 @@ Signed-off-by: Jonas Gorski module_exit (tn7atm_exit); --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -233,6 +233,9 @@ static struct led_funcs ledreg[2]; - - #define tn7dsl_kfree_skb(x) dev_kfree_skb(x) - -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) -+#define PDE_DATA(inode) PDE(inode)->data -+#endif - - //--------------------------------------------- - // Begin Clear EOC definitions -@@ -366,7 +369,7 @@ static void tn7dsl_register_dslss_led(vo +@@ -356,7 +356,7 @@ static void tn7dsl_register_dslss_led(vo void tn7dsl_dslmod_sysctl_register(void); void tn7dsl_dslmod_sysctl_unregister(void); static int tn7dsl_clear_eoc_receive(void); @@ -729,7 +711,7 @@ Signed-off-by: Jonas Gorski /* end of internal functions */ // UR8_MERGE_START CQ11054 Jack Zhang -@@ -698,11 +701,9 @@ void shim_osCriticalExit(void) +@@ -684,11 +684,9 @@ void shim_osCriticalExit(void) spin_unlock_irqrestore(&shimLock, flags); } @@ -742,7 +724,7 @@ Signed-off-by: Jonas Gorski int i, j; int bin = (int) data; unsigned short *rxSnrPerBin; -@@ -723,95 +724,128 @@ static int tn7dsl_proc_snr_print (char * +@@ -709,95 +707,128 @@ static int tn7dsl_proc_snr_print (char * break; default: @@ -915,7 +897,7 @@ Signed-off-by: Jonas Gorski #ifndef NO_ACT int tn7dsl_proc_ds_noise(char* buf, char **start, off_t offset, int count, int *eof, void *data) -@@ -874,59 +908,48 @@ static char *pUnknown= "Unknown"; +@@ -860,59 +891,48 @@ static char *pUnknown= "Unknown"; #ifdef ADV_DIAG_STATS //CQ10275, CQ10449 //UR8_MERGE_START CQ10449 Jack Zhang @@ -975,15 +957,15 @@ Signed-off-by: Jonas Gorski printk("proc_adv_stats - return: ctr=%d, len=%d\n", ctr, len); - return len; + return 0; - } - --static int proc_adv_stats_header(char* buf, int limit) ++} ++ + +static int tn7dsl_proc_adv_stats_open(struct inode *inode, struct file *file) +{ + return single_open(file, tn7dsl_proc_adv_stats, PDE_DATA(inode)); -+} -+ + } + +-static int proc_adv_stats_header(char* buf, int limit) +struct file_operations tn7dsl_proc_adv_stats_fops = { + .owner = THIS_MODULE, + .open = tn7dsl_proc_adv_stats_open, @@ -996,7 +978,7 @@ Signed-off-by: Jonas Gorski { int len = 0; int i = 0; -@@ -935,66 +958,53 @@ static int proc_adv_stats_header(char* b +@@ -921,66 +941,53 @@ static int proc_adv_stats_header(char* b */ dslhal_api_gatherStatistics(pIhw); @@ -1084,7 +1066,7 @@ Signed-off-by: Jonas Gorski } static int getDiagDisplayMode() -@@ -1017,29 +1027,24 @@ static int getDiagDisplayMode() +@@ -1003,29 +1010,24 @@ static int getDiagDisplayMode() ret = 2; return ret; } @@ -1118,7 +1100,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.BitAllocTblDstrm[i], (unsigned int)pIhw->AppData.marginTblDstrm[i], (int)pIhw->AppData.rxSnrPerBin0[i]); -@@ -1050,26 +1055,34 @@ int tn7dsl_proc_adv_stats1(char* buf, ch +@@ -1036,26 +1038,34 @@ int tn7dsl_proc_adv_stats1(char* buf, ch if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1)) { dgprintf(4, "dslhal_api_getSNRpsds failed!\n"); @@ -1161,7 +1143,7 @@ Signed-off-by: Jonas Gorski int i; int mode = 0; //mode = 0 => ADSL1 or ADSL2 & 2+ unsigned char SNRpsds[512]; -@@ -1079,12 +1092,10 @@ int tn7dsl_proc_adv_stats2(char* buf, ch +@@ -1065,12 +1075,10 @@ int tn7dsl_proc_adv_stats2(char* buf, ch if( mode==1) //ADSL1 { dslhal_api_gatherStatistics(pIhw); @@ -1176,7 +1158,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.BitAllocTblDstrm[i], (unsigned int)pIhw->AppData.marginTblDstrm[i], (int)pIhw->AppData.rxSnrPerBin0[i]); -@@ -1095,26 +1106,35 @@ int tn7dsl_proc_adv_stats2(char* buf, ch +@@ -1081,26 +1089,35 @@ int tn7dsl_proc_adv_stats2(char* buf, ch if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1)) { dgprintf(4, "dslhal_api_getSNRpsds failed!\n"); @@ -1220,7 +1202,7 @@ Signed-off-by: Jonas Gorski int i; int mode = 0; //mode = 0 => ADSL1 or ADSL2 & 2+ unsigned char SNRpsds[512]; -@@ -1124,12 +1144,10 @@ int tn7dsl_proc_adv_stats3(char* buf, ch +@@ -1110,12 +1127,10 @@ int tn7dsl_proc_adv_stats3(char* buf, ch if( mode==1) //ADSL1 { dslhal_api_gatherStatistics(pIhw); @@ -1235,7 +1217,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.BitAllocTblDstrm[i], (unsigned int)pIhw->AppData.marginTblDstrm[i], (int)pIhw->AppData.rxSnrPerBin0[i]); -@@ -1140,283 +1158,287 @@ int tn7dsl_proc_adv_stats3(char* buf, ch +@@ -1126,283 +1141,287 @@ int tn7dsl_proc_adv_stats3(char* buf, ch if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1)) { dgprintf(4, "dslhal_api_getSNRpsds failed!\n"); @@ -1455,9 +1437,7 @@ Signed-off-by: Jonas Gorski { + return single_open(file, tn7dsl_proc_dbg_rmsgs1, PDE_DATA(inode)); +} - -- int len = 0; -- int limit = count - 80; ++ +struct file_operations tn7dsl_proc_dbg_rmsgs1_fops = { + .owner = THIS_MODULE, + .open = tn7dsl_proc_dbg_rmsgs1_open, @@ -1465,7 +1445,9 @@ Signed-off-by: Jonas Gorski + .llseek = seq_lseek, + .release = single_release, +}; -+ + +- int len = 0; +- int limit = count - 80; + +int tn7dsl_proc_dbg_rmsgs2(struct seq_file *m, void *data) +{ @@ -1636,12 +1618,12 @@ Signed-off-by: Jonas Gorski - return len; + return 0; - } ++} + +static int tn7dsl_proc_dbg_rmsgs4_open(struct inode *inode, struct file *file) +{ + return single_open(file, tn7dsl_proc_dbg_rmsgs4, PDE_DATA(inode)); -+} + } + +struct file_operations tn7dsl_proc_dbg_rmsgs4_fops = { + .owner = THIS_MODULE, @@ -1664,7 +1646,7 @@ Signed-off-by: Jonas Gorski int F4count, F5count; unsigned int maxRate=0; unsigned int us_maxRate=0; -@@ -1424,80 +1446,58 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1410,80 +1429,58 @@ int tn7dsl_proc_stats(char* buf, char ** //UR8_MERGE_START CQ10700 Manjula K struct atm_dev *dev; Tn7AtmPrivate *priv; @@ -1768,7 +1750,7 @@ Signed-off-by: Jonas Gorski ((unsigned int) pIhw->AppData.usAtm_count[0] + (unsigned int) pIhw->AppData.usAtm_count[1]) * 48, ((unsigned int) pIhw->AppData.dsGood_count[0] + -@@ -1505,9 +1505,7 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1491,9 +1488,7 @@ int tn7dsl_proc_stats(char* buf, char ** /* * Superframe Count */ @@ -1779,7 +1761,7 @@ Signed-off-by: Jonas Gorski "\tUS Superframe Cnt :\t%u\tDS Superframe Cnt:\t%u\n", (unsigned int)pIhw->AppData.usSuperFrmCnt, (unsigned int)pIhw->AppData.dsSuperFrmCnt ); -@@ -1515,59 +1513,45 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1501,59 +1496,45 @@ int tn7dsl_proc_stats(char* buf, char ** /* * US and DS power */ @@ -1851,7 +1833,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.currentHybridNum, trellis); //@Added Maximum attainable bit rate information. 05-14-2004 -@@ -1581,12 +1565,12 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1567,12 +1548,12 @@ int tn7dsl_proc_stats(char* buf, char ** } else { @@ -1866,7 +1848,7 @@ Signed-off-by: Jonas Gorski (unsigned char *) &rMsgsRA[0], 12); maxRate = (unsigned int)pIhw->AppData.DSConRate; -@@ -1602,294 +1586,223 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1588,294 +1569,223 @@ int tn7dsl_proc_stats(char* buf, char ** } } @@ -2259,7 +2241,7 @@ Signed-off-by: Jonas Gorski char *state; int tag; -@@ -1923,22 +1836,31 @@ extern int tn7efm_get_currTCmode(void); +@@ -1909,22 +1819,31 @@ extern int tn7efm_get_currTCmode(void); if(pIhw->lConnected == 1) state = "SHOWTIME"; @@ -2301,7 +2283,7 @@ Signed-off-by: Jonas Gorski /********************************************************************** ** * ** tn7dsl_hdlc_update_crc() -- Calculate CRC * -@@ -2203,11 +2125,8 @@ static int tn7dsl_hdlc_rx_process(unsign +@@ -2189,11 +2108,8 @@ static int tn7dsl_hdlc_rx_process(unsign return(ret); } @@ -2314,7 +2296,7 @@ Signed-off-by: Jonas Gorski int offset[2] = {34, 0}; // point to buffer parameter data structure clearEocParm_t peoc; -@@ -2216,62 +2135,49 @@ int tn7dsl_proc_eoc (char *buf, char **s +@@ -2202,62 +2118,49 @@ int tn7dsl_proc_eoc (char *buf, char **s (unsigned char *) &peoc, sizeof (clearEocParm_t)); @@ -2417,7 +2399,7 @@ Signed-off-by: Jonas Gorski int tn7dsl_clear_eoc_setup(void) { int i; -@@ -4624,14 +4530,10 @@ int tn7dsl_proc_write_stats (struct file +@@ -4591,14 +4494,10 @@ int tn7dsl_proc_write_stats (struct file } @@ -2433,13 +2415,12 @@ Signed-off-by: Jonas Gorski typedef struct { -@@ -4712,197 +4614,185 @@ int tn7dsl_proc_train_mode_export (char +@@ -4679,197 +4578,185 @@ int tn7dsl_proc_train_mode_export (char } - if(len <= count) -+ for (i = 0; (i < num_entries) ; i++) - { +- { - for (i = ctr; ((i < num_entries)&& (len <= count)) ; i++) - { - /* @@ -2453,21 +2434,22 @@ Signed-off-by: Jonas Gorski - else - break; - } -+ seq_printf(m, "%s\t\t\t%#x\n", -+ dsl_modes[i].mode_name, dsl_modes[i].mode_value); - } - +- } +- - /* - * Data was completely written - */ - if (i >= num_entries) -- { ++ for (i = 0; (i < num_entries) ; i++) + { - /* - * We are done with this - */ - *eof = 1; - ctr = 0; -- } ++ seq_printf(m, "%s\t\t\t%#x\n", ++ dsl_modes[i].mode_name, dsl_modes[i].mode_value); + } - else - { - /* @@ -2475,7 +2457,7 @@ Signed-off-by: Jonas Gorski - * terminate the buffer. - */ - *(cp + len) = '\0'; -- + - /* - * Save the value of the counter for the next read for the rest of the - * data. @@ -2712,7 +2694,7 @@ Signed-off-by: Jonas Gorski } start = (indx -1) * 128; -@@ -4911,39 +4801,89 @@ static int tn7dsl_proc_HLINpsdsIndx(char +@@ -4878,39 +4765,89 @@ static int tn7dsl_proc_HLINpsdsIndx(char { if (!(i%8)) { @@ -2817,7 +2799,7 @@ Signed-off-by: Jonas Gorski #endif #endif //TR69_HLIN_IN // UR8_MERGE_END CQ10979* -@@ -4951,64 +4891,48 @@ int tn7dsl_proc_HLINpsds4(char* buf, cha +@@ -4918,64 +4855,48 @@ int tn7dsl_proc_HLINpsds4(char* buf, cha // * UR8_MERGE_START CQ11057 Jack Zhang #ifdef TR69_PMD_IN #ifndef NO_ADV_STATS @@ -2897,7 +2879,7 @@ Signed-off-by: Jonas Gorski } -@@ -5016,19 +4940,28 @@ int tn7dsl_proc_PMDus(char* buf, char ** +@@ -4983,19 +4904,28 @@ int tn7dsl_proc_PMDus(char* buf, char ** for (i=0; iAppData.max_us_tones; i++) { if (!(i%16)) @@ -2937,15 +2919,11 @@ Signed-off-by: Jonas Gorski // * UR8_MERGE_END CQ11057 * --- a/tn7sar.c +++ b/tn7sar.c -@@ -1553,44 +1553,70 @@ int tn7sar_oam_generation(void *privCont +@@ -1547,44 +1547,66 @@ int tn7sar_oam_generation(void *privCont return 0; } -int tn7sar_proc_oam_ping(char* buf, char **start, off_t offset, int count,int *eof, void *data) -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) -+#define PDE_DATA(inode) PDE(inode)->data -+#endif -+ +static int tn7sar_proc_oam_ping(struct seq_file *m, void *data) { - int len = 0; @@ -3020,7 +2998,7 @@ Signed-off-by: Jonas Gorski struct atm_dev *dev; Tn7AtmPrivate *priv; int i, j, k; -@@ -1599,21 +1625,19 @@ int tn7sar_proc_sar_stat(char* buf, char +@@ -1593,21 +1615,19 @@ int tn7sar_proc_sar_stat(char* buf, char unsigned int *pStateBase, *pSarStat; HAL_FUNCTIONS *pHalFunc; HAL_DEVICE *pHalDev; @@ -3045,7 +3023,7 @@ Signed-off-by: Jonas Gorski k=0; for(j=0;j<4;j++) { -@@ -1626,26 +1650,16 @@ int tn7sar_proc_sar_stat(char* buf, char +@@ -1620,26 +1640,18 @@ int tn7sar_proc_sar_stat(char* buf, char { if((char *)*pSarStat == NULL) break; @@ -3056,7 +3034,8 @@ Signed-off-by: Jonas Gorski - k += dBytes; - } + -+ k += seq_printf(m, "%s: ",(char *) *pSarStat); ++ seq_printf(m, "%s: ",(char *) *pSarStat); ++ k += strlen((char *) *pSarStat) + strlen(": "); pSarStat++; - if(len<=limit) - { @@ -3064,7 +3043,8 @@ Signed-off-by: Jonas Gorski - len += dBytes; - k += dBytes; - } -+ k += seq_printf(m, "%s; \n",(char *) *pSarStat); ++ seq_printf(m, "%s; \n",(char *) *pSarStat); ++ k += strlen((char *) *pSarStat) + strlen("; \n"); pSarStat++; if(k > 60) @@ -3076,7 +3056,7 @@ Signed-off-by: Jonas Gorski } } -@@ -1654,9 +1668,22 @@ int tn7sar_proc_sar_stat(char* buf, char +@@ -1648,9 +1660,22 @@ int tn7sar_proc_sar_stat(char* buf, char } } diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/240-3.18_fixes.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/240-3.18_fixes.patch index a29bae80a4..c95c876c54 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/240-3.18_fixes.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/240-3.18_fixes.patch @@ -1,38 +1,38 @@ --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -363,7 +363,7 @@ static void tn7dsl_chng_modulation(void* +@@ -350,7 +350,7 @@ static void tn7dsl_chng_modulation(void* static unsigned int tn7dsl_set_modulation(void* data, int flag); static void tn7dsl_ctrl_fineGain(int value); static void tn7dsl_set_fineGainValue(int value); --static int dslmod_sysctl (ctl_table * ctl, int write, struct file *filp, -+static int dslmod_sysctl (struct ctl_table * ctl, int write, struct file *filp, - void *buffer, size_t * lenp); +-static int dslmod_sysctl (ctl_table * ctl, int write, void *buffer, ++static int dslmod_sysctl (struct ctl_table * ctl, int write, void *buffer, + size_t * lenp, loff_t *ppos); static void tn7dsl_register_dslss_led(void); void tn7dsl_dslmod_sysctl_register(void); -@@ -3505,7 +3505,7 @@ unsigned int tn7dsl_get_memory(unsigned +@@ -3488,7 +3488,7 @@ unsigned int tn7dsl_get_memory(unsigned --static int dslmod_sysctl(ctl_table *ctl, int write, struct file * filp, -+static int dslmod_sysctl(struct ctl_table *ctl, int write, struct file * filp, - void *buffer, size_t *lenp) +-static int dslmod_sysctl(ctl_table *ctl, int write, void *buffer, ++static int dslmod_sysctl(struct ctl_table *ctl, int write, void *buffer, + size_t *lenp, loff_t *ppos) { char *ptr; -@@ -3631,7 +3631,7 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -3603,7 +3603,7 @@ static int dslmod_sysctl(ctl_table *ctl, } -ctl_table dslmod_table[] = { +struct ctl_table dslmod_table[] = { - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} - #else -@@ -3649,7 +3649,7 @@ ctl_table dslmod_table[] = { + { + .procname = "dslmod", + .data = info, +@@ -3617,7 +3617,7 @@ ctl_table dslmod_table[] = { }; /* Make sure that /proc/sys/dev is there */ -ctl_table dslmod_root_table[] = { +struct ctl_table dslmod_root_table[] = { #ifdef CONFIG_PROC_FS - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table} + { + .procname = "dev", diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/250-4.1_fixes.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/250-4.1_fixes.patch index bc913a78a8..426d593191 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/250-4.1_fixes.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/250-4.1_fixes.patch @@ -1,6 +1,6 @@ --- a/tn7atm.c +++ b/tn7atm.c -@@ -856,7 +856,7 @@ static int __init tn7atm_irq_request (st +@@ -845,7 +845,7 @@ static int __init tn7atm_irq_request (st priv->sar_irq = LNXINTNUM (ATM_SAR_INT); /* Interrupt line # */ @@ -9,7 +9,7 @@ printk ("Could not register tn7atm_sar_irq\n"); /* -@@ -880,7 +880,7 @@ static int __init tn7atm_irq_request (st +@@ -869,7 +869,7 @@ static int __init tn7atm_irq_request (st * Reigster Receive interrupt A */ priv->dsl_irq = LNXINTNUM (ATM_DSL_INT); /* Interrupt line # */ diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/260-fix_function_signatures.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/260-fix_function_signatures.patch new file mode 100644 index 0000000000..61a1ff7c83 --- /dev/null +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/260-fix_function_signatures.patch @@ -0,0 +1,63 @@ +--- a/cpswhal_cpsar.h ++++ b/cpswhal_cpsar.h +@@ -437,10 +437,10 @@ typedef struct + int (*DeviceFindInfo)(int Inst, const char *DeviceName, void *DeviceInfo); + int (*DeviceFindParmUint)(void *DeviceInfo, const char *Parm, bit32u *Value); + int (*DeviceFindParmValue)(void *DeviceInfo, const char *Parm, void *Value); +- void (*Free)(void *MemPtr); ++ void (*Free)(const void *MemPtr); + void (*FreeRxBuffer)(OS_RECEIVEINFO *OsReceiveInfo, void *MemPtr); +- void (*FreeDev)(void *MemPtr); +- void (*FreeDmaXfer)(void *MemPtr); ++ void (*FreeDev)(const void *MemPtr); ++ void (*FreeDmaXfer)(const void *MemPtr); + void (*IsrRegister)(OS_DEVICE *OsDev, int (*halISR)(HAL_DEVICE*, int*), int InterruptBit); + void (*IsrUnRegister)(OS_DEVICE *OsDev, int InterruptBit); + void* (*Malloc)(bit32u size); +--- a/cpswhal_cpaal5.h ++++ b/cpswhal_cpaal5.h +@@ -436,10 +436,10 @@ typedef struct + int (*DeviceFindInfo)(int Inst, const char *DeviceName, void *DeviceInfo); + int (*DeviceFindParmUint)(void *DeviceInfo, const char *Parm, bit32u *Value); + int (*DeviceFindParmValue)(void *DeviceInfo, const char *Parm, void *Value); +- void (*Free)(void *MemPtr); ++ void (*Free)(const void *MemPtr); + void (*FreeRxBuffer)(OS_RECEIVEINFO *OsReceiveInfo, void *MemPtr); +- void (*FreeDev)(void *MemPtr); +- void (*FreeDmaXfer)(void *MemPtr); ++ void (*FreeDev)(const void *MemPtr); ++ void (*FreeDmaXfer)(const void *MemPtr); + void (*IsrRegister)(OS_DEVICE *OsDev, int (*halISR)(HAL_DEVICE*, int*), int InterruptBit); + void (*IsrUnRegister)(OS_DEVICE *OsDev, int InterruptBit); + void* (*Malloc)(bit32u size); +--- a/tn7atm.c ++++ b/tn7atm.c +@@ -2690,7 +2690,7 @@ static int tn7atm_proc_turbodsl_read(str + return 0; + } + +-static int tn7atm_proc_qos_write(struct file *fp, const char *buf, unsigned long count, void *data) ++static int tn7atm_proc_qos_write(struct file *fp, const char *buf, size_t count, loff_t *data) + { + char local_buf[32]; + +--- a/tn7dsl.c ++++ b/tn7dsl.c +@@ -1770,7 +1770,7 @@ static int tn7dsl_proc_stats_open(struct + return single_open(file, tn7dsl_proc_stats, PDE_DATA(inode)); + } + +-int tn7dsl_proc_write_stats(struct file *fp, const char * buf, unsigned long count, void * data); ++int tn7dsl_proc_write_stats(struct file *fp, const char * buf, size_t count, loff_t * data); + + struct file_operations tn7dsl_proc_stats_fops = { + .owner = THIS_MODULE, +@@ -4436,7 +4436,7 @@ int tn7dsl_generic_write( int offsetnum, + } + + int tn7dsl_proc_write_stats (struct file *fp, const char *buf, +- unsigned long count, void *data) ++ size_t count, loff_t *data) + { + char local_buf[31]; + int ret_val = 0; diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile index a894773b73..fe094e76a3 100644 --- a/package/kernel/ath10k-ct/Makefile +++ b/package/kernel/ath10k-ct/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ath10k-ct -PKG_RELEASE=1 +PKG_RELEASE=2 PKG_LICENSE:=GPLv2 PKG_LICENSE_FILES:= @@ -14,6 +14,7 @@ PKG_MIRROR_HASH:=616174650e12a82edb6b6bd18ac186e2c6a48fdad0082df9d2011ab20940814 PKG_MAINTAINER:=Ben Greear PKG_BUILD_PARALLEL:=1 +PKG_EXTMOD_SUBDIRS:=ath10k # Build the 4.13 ath10k-ct driver version. Other options are "-4.9", or # leave un-defined for 4.7 kernel. Probably this should match as closely as @@ -28,11 +29,11 @@ include $(INCLUDE_DIR)/package.mk define KernelPackage/ath10k-ct SUBMENU:=Wireless Drivers TITLE:=ath10k-ct driver optimized for CT ath10k firmware - DEPENDS:=+kmod-mac80211 +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT @PCI_SUPPORT +@KERNEL_RELAY +kmod-hwmon-core + DEPENDS:=+kmod-mac80211 +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT @PCI_SUPPORT +kmod-hwmon-core FILES:=\ $(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_pci.ko \ $(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko - AUTOLOAD:=$(call AutoLoad,50,mac80211 ath ath10k_core ath10k_pci) + AUTOLOAD:=$(call AutoProbe,ath10k_pci) endef NOSTDINC_FLAGS = \ @@ -68,6 +69,11 @@ ifdef CONFIG_PACKAGE_ATH_DFS NOSTDINC_FLAGS += -DCONFIG_ATH10K_DFS_CERTIFIED endif +ifdef CONFIG_PACKAGE_ATH_SPECTRAL + CT_MAKEDEFS += CONFIG_ATH10K_SPECTRAL=y + NOSTDINC_FLAGS += -DCONFIG_ATH10K_SPECTRAL +endif + define Build/Configure cp $(STAGING_DIR)/usr/include/mac80211/ath/*.h $(PKG_BUILD_DIR) endef @@ -78,8 +84,7 @@ endif define Build/Compile +$(MAKE) $(CT_MAKEDEFS) $(PKG_JOBS) -C "$(LINUX_DIR)" \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)/ath10k$(CT_KVER)" \ NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ modules diff --git a/package/kernel/ath10k-ct/patches/200-ath10k-move-spectral-scan-support-under-a-separate-c.patch b/package/kernel/ath10k-ct/patches/200-ath10k-move-spectral-scan-support-under-a-separate-c.patch new file mode 100644 index 0000000000..bdc82f0067 --- /dev/null +++ b/package/kernel/ath10k-ct/patches/200-ath10k-move-spectral-scan-support-under-a-separate-c.patch @@ -0,0 +1,81 @@ +From 42e01cb9cb109fb0bb4743f6c54d6aa67ac39b61 Mon Sep 17 00:00:00 2001 +Message-Id: <42e01cb9cb109fb0bb4743f6c54d6aa67ac39b61.1515610034.git.mschiffer@universe-factory.net> +In-Reply-To: <9df7ddc3ed25b7d3473f117a0680b9418adb5753.1515610034.git.mschiffer@universe-factory.net> +References: <9df7ddc3ed25b7d3473f117a0680b9418adb5753.1515610034.git.mschiffer@universe-factory.net> +From: Matthias Schiffer +Date: Mon, 27 Nov 2017 18:56:23 +0100 +Subject: [PATCH 2/2] ath10k: move spectral scan support under a separate + config symbol + +At the moment, spectral scan support, and with it RELAY, is always enabled +with ATH10K_DEBUGFS. Spectral scan support is currently the only user of +RELAY in ath10k, and it unconditionally reserves a relay channel. + +Having debugfs support in ath10k is often useful even on very small +embedded routers, where we'd rather like to avoid the code size and RAM +usage of the relay support. While ath10k-based devices usually have more +resources than ath9k-based ones, it makes sense to keep the configuration +symmetric to ath9k, so the same base kernel without RELAY can be used for +both ath9k and ath10k hardware. + +Signed-off-by: Matthias Schiffer +Signed-off-by: Kalle Valo +--- + ath10k-4.13/Kconfig | 9 ++++++++- + ath10k-4.13/Makefile | 2 +- + ath10k-4.13/spectral.h | 4 ++-- + 3 files changed, 11 insertions(+), 4 deletions(-) + +--- a/ath10k-4.13/Kconfig ++++ b/ath10k-4.13/Kconfig +@@ -40,12 +40,19 @@ config ATH10K_DEBUG + config ATH10K_DEBUGFS + bool "Atheros ath10k debugfs support" + depends on ATH10K && DEBUG_FS +- select RELAY + ---help--- + Enabled debugfs support + + If unsure, say Y to make it easier to debug problems. + ++config ATH10K_SPECTRAL ++ bool "Atheros ath10k spectral scan support" ++ depends on ATH10K_DEBUGFS ++ select RELAY ++ default n ++ ---help--- ++ Say Y to enable access to the FFT/spectral data via debugfs. ++ + config ATH10K_TRACING + bool "Atheros ath10k tracing support" + depends on ATH10K +--- a/ath10k-4.13/Makefile ++++ b/ath10k-4.13/Makefile +@@ -14,7 +14,7 @@ ath10k_core-y += mac.o \ + p2p.o \ + swap.o + +-ath10k_core-$(CONFIG_ATH10K_DEBUGFS) += spectral.o ++ath10k_core-$(CONFIG_ATH10K_SPECTRAL) += spectral.o + ath10k_core-$(CONFIG_NL80211_TESTMODE) += testmode.o + ath10k_core-$(CONFIG_ATH10K_TRACING) += trace.o + ath10k_core-$(CONFIG_THERMAL) += thermal.o +--- a/ath10k-4.13/spectral.h ++++ b/ath10k-4.13/spectral.h +@@ -44,7 +44,7 @@ enum ath10k_spectral_mode { + SPECTRAL_MANUAL, + }; + +-#ifdef CONFIG_ATH10K_DEBUGFS ++#ifdef CONFIG_ATH10K_SPECTRAL + + int ath10k_spectral_process_fft(struct ath10k *ar, + struct wmi_phyerr_ev_arg *phyerr, +@@ -85,6 +85,6 @@ static inline void ath10k_spectral_destr + { + } + +-#endif /* CONFIG_ATH10K_DEBUGFS */ ++#endif /* CONFIG_ATH10K_SPECTRAL */ + + #endif /* SPECTRAL_H */ diff --git a/package/kernel/avila-wdt/Makefile b/package/kernel/avila-wdt/Makefile index 94bda9b8d5..a91c93374c 100644 --- a/package/kernel/avila-wdt/Makefile +++ b/package/kernel/avila-wdt/Makefile @@ -22,8 +22,7 @@ define KernelPackage/avila-wdt endef MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" define Build/Compile diff --git a/package/kernel/broadcom-wl/Makefile b/package/kernel/broadcom-wl/Makefile index 2f3a0c5dc1..d1d0604519 100644 --- a/package/kernel/broadcom-wl/Makefile +++ b/package/kernel/broadcom-wl/Makefile @@ -22,6 +22,8 @@ ifeq ($(ARCH),mips) PKG_HASH:=ca6a86ca3e3e9c85b6dbb665b35bcbf338c37829c1b2f1994487d55664886045 endif +PKG_EXTMOD_SUBDIRS:=driver driver-mini glue + PKG_USE_MIPS16:=0 PKG_FLAGS:=nonshared @@ -41,7 +43,7 @@ define KernelPackage/brcm-wl/Default DEPENDS:=@TARGET_brcm47xx||TARGET_brcm63xx +wireless-tools TITLE:=Kernel driver for BCM43xx chipsets FILES:=$(PKG_BUILD_DIR)/driver$(1)/wl.ko $(PKG_BUILD_DIR)/glue/wl_glue.ko - AUTOLOAD:=$(call AutoLoad,30,wl_glue wl) + AUTOLOAD:=$(call AutoProbe,wl) endef define KernelPackage/brcm-wl/Default/description @@ -98,8 +100,7 @@ define Package/nas/description endef MAKE_KMOD := $(MAKE) -C "$(LINUX_DIR)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - ARCH="$(LINUX_KARCH)" \ + $(KERNEL_MAKE_FLAGS) \ PATH="$(TARGET_PATH)" \ SUBDIRS="$(PKG_BUILD_DIR)/kmod" \ @@ -110,23 +111,25 @@ define Build/Prepare endef define Build/Compile + # Compile glue driver + $(MAKE_KMOD) -C "$(LINUX_DIR)" \ + SUBDIRS="$(PKG_BUILD_DIR)/glue" \ + modules + # Compile the kernel part $(MAKE_KMOD) \ SUBDIRS="$(PKG_BUILD_DIR)/driver" \ MODFLAGS="-DMODULE -mlong-calls" \ + KBUILD_EXTRA_SYMBOLS="$(PKG_BUILD_DIR)/glue/Module.symvers" \ modules $(MAKE_KMOD) \ SUBDIRS="$(PKG_BUILD_DIR)/driver-mini" \ MODFLAGS="-DMODULE -mlong-calls" \ BUILD_TYPE="wl_apsta_mini" \ + KBUILD_EXTRA_SYMBOLS="$(PKG_BUILD_DIR)/glue/Module.symvers" \ modules - # Compile glue driver - $(MAKE_KMOD) -C "$(LINUX_DIR)" \ - SUBDIRS="$(PKG_BUILD_DIR)/glue" \ - modules - # Compile libshared $(MAKE) -C $(PKG_BUILD_DIR)/shared \ $(TARGET_CONFIGURE_OPTS) \ diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index 2780fa1679..3643f6b1c6 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -469,7 +469,7 @@ detect_broadcom() { set wireless.default_wl${i}.device=wl${i} set wireless.default_wl${i}.network=lan set wireless.default_wl${i}.mode=ap - set wireless.default_wl${i}.ssid=Lede${i#0} + set wireless.default_wl${i}.ssid=OpenWrt${i#0} set wireless.default_wl${i}.encryption=none EOF uci -q commit wireless diff --git a/package/kernel/button-hotplug/Makefile b/package/kernel/button-hotplug/Makefile index 7b6aacfbf9..2554ae61dd 100644 --- a/package/kernel/button-hotplug/Makefile +++ b/package/kernel/button-hotplug/Makefile @@ -36,8 +36,7 @@ EXTRA_CFLAGS:= \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \ MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ $(EXTRA_KCONFIG) diff --git a/package/kernel/dtc/patches/0001-scripts-dtc-Update-to-version-with-overlays.patch b/package/kernel/dtc/patches/0001-scripts-dtc-Update-to-version-with-overlays.patch new file mode 100644 index 0000000000..605d303c47 --- /dev/null +++ b/package/kernel/dtc/patches/0001-scripts-dtc-Update-to-version-with-overlays.patch @@ -0,0 +1,642 @@ +From 5f84cb93eef9f8a8ff7f49d593893f252744d0fe Mon Sep 17 00:00:00 2001 +From: Pantelis Antoniou +Date: Wed, 26 Aug 2015 18:28:08 +0300 +Subject: [PATCH] scripts/dtc: Update to version with overlays + +Update to mainline dtc with overlay support + +Signed-off-by: Pantelis Antoniou +--- + checks.c | 20 +++++- + dtc-lexer.l | 5 ++ + dtc-parser.y | 54 ++++++++++++++-- + dtc.c | 83 ++++++++++++++++++++++-- + dtc.h | 13 +++- + livetree.c | 202 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + treesource.c | 3 + + util.c | 2 +- + 8 files changed, 367 insertions(+), 15 deletions(-) + +diff --git a/checks.c b/checks.c +index 3bf0fa4..af25c2b 100644 +--- a/checks.c ++++ b/checks.c +@@ -465,8 +465,12 @@ static void fixup_phandle_references(struct check *c, struct node *dt, + + refnode = get_node_by_ref(dt, m->ref); + if (! refnode) { +- FAIL(c, "Reference to non-existent node or label \"%s\"\n", +- m->ref); ++ if (!source_is_plugin) ++ FAIL(c, "Reference to non-existent node or " ++ "label \"%s\"\n", m->ref); ++ else /* mark the entry as unresolved */ ++ *((cell_t *)(prop->val.val + m->offset)) = ++ cpu_to_fdt32(0xffffffff); + continue; + } + +@@ -559,7 +563,7 @@ static void check_reg_format(struct check *c, struct node *dt, + size_cells = node_size_cells(node->parent); + entrylen = (addr_cells + size_cells) * sizeof(cell_t); + +- if ((prop->val.len % entrylen) != 0) ++ if (!entrylen || (prop->val.len % entrylen) != 0) + FAIL(c, "\"reg\" property in %s has invalid length (%d bytes) " + "(#address-cells == %d, #size-cells == %d)", + node->fullpath, prop->val.len, addr_cells, size_cells); +@@ -651,6 +655,15 @@ static void check_obsolete_chosen_interrupt_controller(struct check *c, + } + TREE_WARNING(obsolete_chosen_interrupt_controller, NULL); + ++static void check_deprecated_plugin_syntax(struct check *c, ++ struct node *dt) ++{ ++ if (deprecated_plugin_syntax_warning) ++ FAIL(c, "Use '/dts-v1/ /plugin/'; syntax. /dts-v1/; /plugin/; " ++ "is going to be removed in next versions"); ++} ++TREE_WARNING(deprecated_plugin_syntax, NULL); ++ + static struct check *check_table[] = { + &duplicate_node_names, &duplicate_property_names, + &node_name_chars, &node_name_format, &property_name_chars, +@@ -668,6 +681,7 @@ static struct check *check_table[] = { + + &avoid_default_addr_size, + &obsolete_chosen_interrupt_controller, ++ &deprecated_plugin_syntax, + + &always_fail, + }; +diff --git a/dtc-lexer.l b/dtc-lexer.l +index 0ee1caf..dd44ba2 100644 +--- a/dtc-lexer.l ++++ b/dtc-lexer.l +@@ -113,6 +113,11 @@ static void lexical_error(const char *fmt, ...); + return DT_V1; + } + ++<*>"/plugin/" { ++ DPRINT("Keyword: /plugin/\n"); ++ return DT_PLUGIN; ++ } ++ + <*>"/memreserve/" { + DPRINT("Keyword: /memreserve/\n"); + BEGIN_DEFAULT(); +diff --git a/dtc-parser.y b/dtc-parser.y +index ea57e0a..7d9652d 100644 +--- a/dtc-parser.y ++++ b/dtc-parser.y +@@ -19,6 +19,7 @@ + */ + %{ + #include ++#include + + #include "dtc.h" + #include "srcpos.h" +@@ -52,9 +53,11 @@ extern bool treesource_error; + struct node *nodelist; + struct reserve_info *re; + uint64_t integer; ++ bool is_plugin; + } + + %token DT_V1 ++%token DT_PLUGIN + %token DT_MEMRESERVE + %token DT_LSHIFT DT_RSHIFT DT_LE DT_GE DT_EQ DT_NE DT_AND DT_OR + %token DT_BITS +@@ -71,6 +74,7 @@ extern bool treesource_error; + + %type propdata + %type propdataprefix ++%type plugindecl + %type memreserve + %type memreserves + %type arrayprefix +@@ -101,10 +105,39 @@ extern bool treesource_error; + %% + + sourcefile: +- DT_V1 ';' memreserves devicetree ++ basesource ++ | pluginsource ++ ; ++ ++basesource: ++ DT_V1 ';' plugindecl memreserves devicetree ++ { ++ source_is_plugin = $3; ++ if (source_is_plugin) ++ deprecated_plugin_syntax_warning = true; ++ the_boot_info = build_boot_info($4, $5, ++ guess_boot_cpuid($5)); ++ } ++ ; ++ ++plugindecl: ++ /* empty */ ++ { ++ $$ = false; ++ } ++ | DT_PLUGIN ';' ++ { ++ $$ = true; ++ } ++ ; ++ ++pluginsource: ++ DT_V1 DT_PLUGIN ';' memreserves devicetree + { +- the_boot_info = build_boot_info($3, $4, +- guess_boot_cpuid($4)); ++ source_is_plugin = true; ++ deprecated_plugin_syntax_warning = false; ++ the_boot_info = build_boot_info($4, $5, ++ guess_boot_cpuid($5)); + } + ; + +@@ -144,10 +177,14 @@ devicetree: + { + struct node *target = get_node_by_ref($1, $2); + +- if (target) ++ if (target) { + merge_nodes(target, $3); +- else +- ERROR(&@2, "Label or path %s not found", $2); ++ } else { ++ if (symbol_fixup_support) ++ add_orphan_node($1, $3, $2); ++ else ++ ERROR(&@2, "Label or path %s not found", $2); ++ } + $$ = $1; + } + | devicetree DT_DEL_NODE DT_REF ';' +@@ -162,6 +199,11 @@ devicetree: + + $$ = $1; + } ++ | /* empty */ ++ { ++ /* build empty node */ ++ $$ = name_node(build_node(NULL, NULL), ""); ++ } + ; + + nodedef: +diff --git a/dtc.c b/dtc.c +index 8c4add6..ee37be9 100644 +--- a/dtc.c ++++ b/dtc.c +@@ -18,6 +18,8 @@ + * USA + */ + ++#include ++ + #include "dtc.h" + #include "srcpos.h" + +@@ -29,6 +31,8 @@ int reservenum; /* Number of memory reservation slots */ + int minsize; /* Minimum blob size */ + int padsize; /* Additional padding to blob */ + int phandle_format = PHANDLE_BOTH; /* Use linux,phandle or phandle properties */ ++int symbol_fixup_support; ++int auto_label_aliases; + + static void fill_fullpaths(struct node *tree, const char *prefix) + { +@@ -51,7 +55,7 @@ static void fill_fullpaths(struct node *tree, const char *prefix) + #define FDT_VERSION(version) _FDT_VERSION(version) + #define _FDT_VERSION(version) #version + static const char usage_synopsis[] = "dtc [options] "; +-static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:fb:i:H:sW:E:hv"; ++static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:fb:i:H:sW:E:@Ahv"; + static struct option const usage_long_opts[] = { + {"quiet", no_argument, NULL, 'q'}, + {"in-format", a_argument, NULL, 'I'}, +@@ -69,6 +73,8 @@ static struct option const usage_long_opts[] = { + {"phandle", a_argument, NULL, 'H'}, + {"warning", a_argument, NULL, 'W'}, + {"error", a_argument, NULL, 'E'}, ++ {"symbols", no_argument, NULL, '@'}, ++ {"auto-alias", no_argument, NULL, 'A'}, + {"help", no_argument, NULL, 'h'}, + {"version", no_argument, NULL, 'v'}, + {NULL, no_argument, NULL, 0x0}, +@@ -99,16 +105,63 @@ static const char * const usage_opts_help[] = { + "\t\tboth - Both \"linux,phandle\" and \"phandle\" properties", + "\n\tEnable/disable warnings (prefix with \"no-\")", + "\n\tEnable/disable errors (prefix with \"no-\")", ++ "\n\tEnable symbols/fixup support", ++ "\n\tEnable auto-alias of labels", + "\n\tPrint this help and exit", + "\n\tPrint version and exit", + NULL, + }; + ++static const char *guess_type_by_name(const char *fname, const char *fallback) ++{ ++ const char *s; ++ ++ s = strrchr(fname, '.'); ++ if (s == NULL) ++ return fallback; ++ if (!strcasecmp(s, ".dts")) ++ return "dts"; ++ if (!strcasecmp(s, ".dtb")) ++ return "dtb"; ++ return fallback; ++} ++ ++static const char *guess_input_format(const char *fname, const char *fallback) ++{ ++ struct stat statbuf; ++ uint32_t magic; ++ FILE *f; ++ ++ if (stat(fname, &statbuf) != 0) ++ return fallback; ++ ++ if (S_ISDIR(statbuf.st_mode)) ++ return "fs"; ++ ++ if (!S_ISREG(statbuf.st_mode)) ++ return fallback; ++ ++ f = fopen(fname, "r"); ++ if (f == NULL) ++ return fallback; ++ if (fread(&magic, 4, 1, f) != 1) { ++ fclose(f); ++ return fallback; ++ } ++ fclose(f); ++ ++ magic = fdt32_to_cpu(magic); ++ if (magic == FDT_MAGIC) ++ return "dtb"; ++ ++ return guess_type_by_name(fname, fallback); ++} ++ + int main(int argc, char *argv[]) + { + struct boot_info *bi; +- const char *inform = "dts"; +- const char *outform = "dts"; ++ const char *inform = NULL; ++ const char *outform = NULL; + const char *outname = "-"; + const char *depname = NULL; + bool force = false, sort = false; +@@ -186,7 +239,12 @@ int main(int argc, char *argv[]) + case 'E': + parse_checks_option(false, true, optarg); + break; +- ++ case '@': ++ symbol_fixup_support = 1; ++ break; ++ case 'A': ++ auto_label_aliases = 1; ++ break; + case 'h': + usage(NULL); + default: +@@ -213,6 +271,17 @@ int main(int argc, char *argv[]) + fprintf(depfile, "%s:", outname); + } + ++ if (inform == NULL) ++ inform = guess_input_format(arg, "dts"); ++ if (outform == NULL) { ++ outform = guess_type_by_name(outname, NULL); ++ if (outform == NULL) { ++ if (streq(inform, "dts")) ++ outform = "dtb"; ++ else ++ outform = "dts"; ++ } ++ } + if (streq(inform, "dts")) + bi = dt_from_source(arg); + else if (streq(inform, "fs")) +@@ -236,6 +305,12 @@ int main(int argc, char *argv[]) + if (sort) + sort_tree(bi); + ++ if (symbol_fixup_support || auto_label_aliases) ++ generate_label_node(bi->dt, bi->dt); ++ ++ if (symbol_fixup_support) ++ generate_fixups_node(bi->dt, bi->dt); ++ + if (streq(outname, "-")) { + outf = stdout; + } else { +diff --git a/dtc.h b/dtc.h +index 56212c8..d025111 100644 +--- a/dtc.h ++++ b/dtc.h +@@ -20,7 +20,7 @@ + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ +- ++#define _GNU_SOURCE + #include + #include + #include +@@ -54,6 +54,14 @@ extern int reservenum; /* Number of memory reservation slots */ + extern int minsize; /* Minimum blob size */ + extern int padsize; /* Additional padding to blob */ + extern int phandle_format; /* Use linux,phandle or phandle properties */ ++extern int symbol_fixup_support;/* enable symbols & fixup support */ ++extern int auto_label_aliases; /* auto generate labels -> aliases */ ++ ++/* ++ * Tree source globals ++ */ ++extern bool source_is_plugin; ++extern bool deprecated_plugin_syntax_warning; + + #define PHANDLE_LEGACY 0x1 + #define PHANDLE_EPAPR 0x2 +@@ -194,6 +202,7 @@ struct node *build_node_delete(void); + struct node *name_node(struct node *node, char *name); + struct node *chain_node(struct node *first, struct node *list); + struct node *merge_nodes(struct node *old_node, struct node *new_node); ++void add_orphan_node(struct node *old_node, struct node *new_node, char *ref); + + void add_property(struct node *node, struct property *prop); + void delete_property_by_name(struct node *node, char *name); +@@ -244,6 +253,8 @@ struct boot_info { + struct boot_info *build_boot_info(struct reserve_info *reservelist, + struct node *tree, uint32_t boot_cpuid_phys); + void sort_tree(struct boot_info *bi); ++void generate_label_node(struct node *node, struct node *dt); ++void generate_fixups_node(struct node *node, struct node *dt); + + /* Checks */ + +diff --git a/livetree.c b/livetree.c +index e229b84..1ef9fc4 100644 +--- a/livetree.c ++++ b/livetree.c +@@ -216,6 +216,34 @@ struct node *merge_nodes(struct node *old_node, struct node *new_node) + return old_node; + } + ++void add_orphan_node(struct node *dt, struct node *new_node, char *ref) ++{ ++ static unsigned int next_orphan_fragment = 0; ++ struct node *ovl = xmalloc(sizeof(*ovl)); ++ struct property *p; ++ struct data d = empty_data; ++ char *name; ++ int ret; ++ ++ memset(ovl, 0, sizeof(*ovl)); ++ ++ d = data_add_marker(d, REF_PHANDLE, ref); ++ d = data_append_integer(d, 0xffffffff, 32); ++ ++ p = build_property("target", d); ++ add_property(ovl, p); ++ ++ ret = asprintf(&name, "fragment@%u", ++ next_orphan_fragment++); ++ if (ret == -1) ++ die("asprintf() failed\n"); ++ name_node(ovl, name); ++ name_node(new_node, "__overlay__"); ++ ++ add_child(dt, ovl); ++ add_child(ovl, new_node); ++} ++ + struct node *chain_node(struct node *first, struct node *list) + { + assert(first->next_sibling == NULL); +@@ -709,3 +737,177 @@ void sort_tree(struct boot_info *bi) + sort_reserve_entries(bi); + sort_node(bi->dt); + } ++ ++void generate_label_node(struct node *node, struct node *dt) ++{ ++ struct node *c, *an; ++ struct property *p; ++ struct label *l; ++ int has_label; ++ char *gen_node_name; ++ ++ if (auto_label_aliases) ++ gen_node_name = "aliases"; ++ else ++ gen_node_name = "__symbols__"; ++ ++ /* Make sure the label isn't already there */ ++ has_label = 0; ++ for_each_label(node->labels, l) { ++ has_label = 1; ++ break; ++ } ++ ++ if (has_label) { ++ ++ /* an is the aliases/__symbols__ node */ ++ an = get_subnode(dt, gen_node_name); ++ /* if no node exists, create it */ ++ if (!an) { ++ an = build_node(NULL, NULL); ++ name_node(an, gen_node_name); ++ add_child(dt, an); ++ } ++ ++ /* now add the label in the node */ ++ for_each_label(node->labels, l) { ++ /* check whether the label already exists */ ++ p = get_property(an, l->label); ++ if (p) { ++ fprintf(stderr, "WARNING: label %s already" ++ " exists in /%s", l->label, ++ gen_node_name); ++ continue; ++ } ++ ++ /* insert it */ ++ p = build_property(l->label, ++ data_copy_escape_string(node->fullpath, ++ strlen(node->fullpath))); ++ add_property(an, p); ++ } ++ ++ /* force allocation of a phandle for this node */ ++ if (symbol_fixup_support) ++ (void)get_node_phandle(dt, node); ++ } ++ ++ for_each_child(node, c) ++ generate_label_node(c, dt); ++} ++ ++static void add_fixup_entry(struct node *dt, struct node *node, ++ struct property *prop, struct marker *m) ++{ ++ struct node *fn; /* local fixup node */ ++ struct property *p; ++ char *fixups_name = "__fixups__"; ++ struct data d; ++ char *entry; ++ int ret; ++ ++ /* fn is the node we're putting entries in */ ++ fn = get_subnode(dt, fixups_name); ++ /* if no node exists, create it */ ++ if (!fn) { ++ fn = build_node(NULL, NULL); ++ name_node(fn, fixups_name); ++ add_child(dt, fn); ++ } ++ ++ ret = asprintf(&entry, "%s:%s:%u", ++ node->fullpath, prop->name, m->offset); ++ if (ret == -1) ++ die("asprintf() failed\n"); ++ ++ p = get_property(fn, m->ref); ++ d = data_append_data(p ? p->val : empty_data, entry, strlen(entry) + 1); ++ if (!p) ++ add_property(fn, build_property(m->ref, d)); ++ else ++ p->val = d; ++} ++ ++static void add_local_fixup_entry(struct node *dt, struct node *node, ++ struct property *prop, struct marker *m, ++ struct node *refnode) ++{ ++ struct node *lfn, *wn, *nwn; /* local fixup node, walk node, new */ ++ struct property *p; ++ struct data d; ++ char *local_fixups_name = "__local_fixups__"; ++ char *s, *e, *comp; ++ int len; ++ ++ /* fn is the node we're putting entries in */ ++ lfn = get_subnode(dt, local_fixups_name); ++ /* if no node exists, create it */ ++ if (!lfn) { ++ lfn = build_node(NULL, NULL); ++ name_node(lfn, local_fixups_name); ++ add_child(dt, lfn); ++ } ++ ++ /* walk the path components creating nodes if they don't exist */ ++ comp = NULL; ++ /* start skipping the first / */ ++ s = node->fullpath + 1; ++ wn = lfn; ++ while (*s) { ++ /* retrieve path component */ ++ e = strchr(s, '/'); ++ if (e == NULL) ++ e = s + strlen(s); ++ len = e - s; ++ comp = xrealloc(comp, len + 1); ++ memcpy(comp, s, len); ++ comp[len] = '\0'; ++ ++ /* if no node exists, create it */ ++ nwn = get_subnode(wn, comp); ++ if (!nwn) { ++ nwn = build_node(NULL, NULL); ++ name_node(nwn, strdup(comp)); ++ add_child(wn, nwn); ++ } ++ wn = nwn; ++ ++ /* last path component */ ++ if (!*e) ++ break; ++ ++ /* next path component */ ++ s = e + 1; ++ } ++ free(comp); ++ ++ p = get_property(wn, prop->name); ++ d = data_append_cell(p ? p->val : empty_data, (cell_t)m->offset); ++ if (!p) ++ add_property(wn, build_property(prop->name, d)); ++ else ++ p->val = d; ++} ++ ++void generate_fixups_node(struct node *node, struct node *dt) ++{ ++ struct node *c; ++ struct property *prop; ++ struct marker *m; ++ struct node *refnode; ++ ++ for_each_property(node, prop) { ++ m = prop->val.markers; ++ for_each_marker_of_type(m, REF_PHANDLE) { ++ refnode = get_node_by_ref(dt, m->ref); ++ if (!refnode) ++ add_fixup_entry(dt, node, prop, m); ++ else ++ add_local_fixup_entry(dt, node, prop, m, ++ refnode); ++ } ++ } ++ ++ for_each_child(node, c) ++ generate_fixups_node(c, dt); ++} +diff --git a/treesource.c b/treesource.c +index a55d1d1..e1d6657 100644 +--- a/treesource.c ++++ b/treesource.c +@@ -28,6 +28,9 @@ extern YYLTYPE yylloc; + struct boot_info *the_boot_info; + bool treesource_error; + ++bool source_is_plugin; ++bool deprecated_plugin_syntax_warning; ++ + struct boot_info *dt_from_source(const char *fname) + { + the_boot_info = NULL; +diff --git a/util.c b/util.c +index 9d65226..cbb945b 100644 +--- a/util.c ++++ b/util.c +@@ -349,7 +349,6 @@ int utilfdt_decode_type(const char *fmt, int *type, int *size) + void utilfdt_print_data(const char *data, int len) + { + int i; +- const char *p = data; + const char *s; + + /* no data, don't print */ +@@ -376,6 +375,7 @@ void utilfdt_print_data(const char *data, int len) + i < (len - 1) ? " " : ""); + printf(">"); + } else { ++ const unsigned char *p = (const unsigned char *)data; + printf(" = ["); + for (i = 0; i < len; i++) + printf("%02x%s", *p++, i < len - 1 ? " " : ""); +-- +2.7.0 + diff --git a/package/kernel/gpio-button-hotplug/Makefile b/package/kernel/gpio-button-hotplug/Makefile index 8f836a841a..216d23b76d 100644 --- a/package/kernel/gpio-button-hotplug/Makefile +++ b/package/kernel/gpio-button-hotplug/Makefile @@ -33,8 +33,7 @@ define KernelPackage/gpio-button-hotplug/description endef MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" define Build/Compile diff --git a/package/kernel/gpio-nct5104d/Makefile b/package/kernel/gpio-nct5104d/Makefile index b43291e5a4..33352388cf 100644 --- a/package/kernel/gpio-nct5104d/Makefile +++ b/package/kernel/gpio-nct5104d/Makefile @@ -37,8 +37,7 @@ EXTRA_CFLAGS:= \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \ MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ $(EXTRA_KCONFIG) diff --git a/package/kernel/hwmon-gsc/Makefile b/package/kernel/hwmon-gsc/Makefile index 1892e027ca..3888a2f17e 100644 --- a/package/kernel/hwmon-gsc/Makefile +++ b/package/kernel/hwmon-gsc/Makefile @@ -20,8 +20,7 @@ endef define Build/Compile $(MAKE) -C "$(LINUX_DIR)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - ARCH="$(LINUX_KARCH)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(BUILDFLAGS)" \ modules diff --git a/package/kernel/i2c-gpio-custom/Makefile b/package/kernel/i2c-gpio-custom/Makefile index fb3f3bf17e..d1123cc3fb 100644 --- a/package/kernel/i2c-gpio-custom/Makefile +++ b/package/kernel/i2c-gpio-custom/Makefile @@ -33,8 +33,7 @@ EXTRA_CFLAGS:= \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \ MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ $(EXTRA_KCONFIG) diff --git a/package/kernel/kmod-sched-cake/Makefile b/package/kernel/kmod-sched-cake/Makefile index f97967f246..f9bcd65f13 100644 --- a/package/kernel/kmod-sched-cake/Makefile +++ b/package/kernel/kmod-sched-cake/Makefile @@ -13,9 +13,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git -PKG_SOURCE_DATE:=2017-01-28 -PKG_SOURCE_VERSION:=9789742cfc596d48583ba4cdbc8f38d026121fa6 -PKG_MIRROR_HASH:=2a5afc45722c28ca8778eb50452eb305306e7898b32d7d6d73d3e77edf3cce99 +PKG_SOURCE_DATE:=2018-01-07 +PKG_SOURCE_VERSION:=568ed96467f41aad37556b0db11fc008e05941e9 +PKG_MIRROR_HASH:=8f3f962824826d07b1029379d91e01bf97fe0bfce1233af5cfa7a54cb1c3632c include $(INCLUDE_DIR)/package.mk diff --git a/package/kernel/lantiq/ltq-adsl-mei/Makefile b/package/kernel/lantiq/ltq-adsl-mei/Makefile index 91c798418d..08e5775771 100644 --- a/package/kernel/lantiq/ltq-adsl-mei/Makefile +++ b/package/kernel/lantiq/ltq-adsl-mei/Makefile @@ -23,8 +23,8 @@ define KernelPackage/ltq-adsl-mei-template URL:=http://www.lantiq.com/ VARIANT:=$(1) DEPENDS:=@$(2) - FILES:=$(PKG_BUILD_DIR)/ltq_mei_$(1).ko - AUTOLOAD:=$(call AutoLoad,50,ltq_mei_$(1)) + FILES:=$(PKG_BUILD_DIR)/drv_mei_cpe.ko + AUTOLOAD:=$(call AutoLoad,50,drv_mei_cpe) endef KernelPackage/ltq-adsl-danube-mei=$(call KernelPackage/ltq-adsl-mei-template,danube,(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy)) diff --git a/package/kernel/lantiq/ltq-adsl-mei/src/Makefile b/package/kernel/lantiq/ltq-adsl-mei/src/Makefile index 2d8645f8f2..9a3b89195c 100644 --- a/package/kernel/lantiq/ltq-adsl-mei/src/Makefile +++ b/package/kernel/lantiq/ltq-adsl-mei/src/Makefile @@ -1,17 +1,13 @@ ifeq ($(BUILD_VARIANT),danube) CFLAGS_MODULE = -DCONFIG_DANUBE -DCONFIG_IFXMIPS_DSL_CPE_MEI - obj-m = ltq_mei_danube.o - ltq_mei_danube-objs = lantiq_mei.o endif ifeq ($(BUILD_VARIANT),ase) CFLAGS_MODULE = -DCONFIG_AMAZON_SE -DCONFIG_IFXMIPS_DSL_CPE_MEI - obj-m = ltq_mei_ase.o - ltq_mei_ase-objs = lantiq_mei.o endif ifeq ($(BUILD_VARIANT),ar9) CFLAGS_MODULE = -DCONFIG_AR9 -DCONFIG_IFXMIPS_DSL_CPE_MEI - obj-m = ltq_mei_ar9.o - ltq_mei_ar9-objs = lantiq_mei.o endif + +obj-m = drv_mei_cpe.o diff --git a/package/kernel/lantiq/ltq-adsl-mei/src/lantiq_mei.c b/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c similarity index 100% rename from package/kernel/lantiq/ltq-adsl-mei/src/lantiq_mei.c rename to package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c diff --git a/package/kernel/lantiq/ltq-atm/Makefile b/package/kernel/lantiq/ltq-atm/Makefile index 7f4c197fe5..5d63983d2c 100644 --- a/package/kernel/lantiq/ltq-atm/Makefile +++ b/package/kernel/lantiq/ltq-atm/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ltq-atm -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-atm-$(BUILD_VARIANT) PKG_MAINTAINER:=John Crispin @@ -24,17 +24,12 @@ define KernelPackage/ltq-atm-template VARIANT:=$(1) DEPENDS:=@$(2) +kmod-atm +br2684ctl FILES:=$(PKG_BUILD_DIR)/ltq_atm_$(1).ko - AUTOLOAD:=$(call AutoProbe,ltq_atm_$(1)) endef -KernelPackage/ltq-atm-danube=$(call KernelPackage/ltq-atm-template,danube,(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy)) -KernelPackage/ltq-atm-ar9=$(call KernelPackage/ltq-atm-template,ar9,TARGET_lantiq_xway) -KernelPackage/ltq-atm-ase=$(call KernelPackage/ltq-atm-template,ase,TARGET_lantiq_ase) - -define KernelPackage/ltq-atm-vr9 - $(call KernelPackage/ltq-atm-template,vr9,TARGET_lantiq_xrx200) - AUTOLOAD:= -endef +KernelPackage/ltq-atm-danube=$(call KernelPackage/ltq-atm-template,danube,(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy) +kmod-ltq-adsl-danube-mei) +KernelPackage/ltq-atm-ar9=$(call KernelPackage/ltq-atm-template,ar9,TARGET_lantiq_xway +kmod-ltq-adsl-ar9-mei) +KernelPackage/ltq-atm-ase=$(call KernelPackage/ltq-atm-template,ase,TARGET_lantiq_ase +kmod-ltq-adsl-ase-mei) +KernelPackage/ltq-atm-vr9=$(call KernelPackage/ltq-atm-template,vr9,TARGET_lantiq_xrx200 +kmod-ltq-vdsl-vr9-mei) define Build/Configure endef diff --git a/package/kernel/lantiq/ltq-ifxos/Makefile b/package/kernel/lantiq/ltq-ifxos/Makefile index 05663de2c4..a0891be3e0 100644 --- a/package/kernel/lantiq/ltq-ifxos/Makefile +++ b/package/kernel/lantiq/ltq-ifxos/Makefile @@ -8,7 +8,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=lib_ifxos PKG_VERSION:=1.5.19 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_URL:=https://github.com/xdarklight/$(PKG_NAME)/archive/v$(PKG_VERSION) @@ -34,8 +34,6 @@ define KernelPackage/ltq-ifxos AUTOLOAD:=$(call AutoLoad,10,drv_ifxos) endef -MAKE_FLAGS+=-s - CONFIGURE_ARGS += \ ARCH=$(LINUX_KARCH) \ --enable-linux-26 \ diff --git a/package/kernel/lantiq/ltq-ifxos/patches/200-Fix-app-compilation-failure-from-inclusion-of-wrong-.patch b/package/kernel/lantiq/ltq-ifxos/patches/200-Fix-app-compilation-failure-from-inclusion-of-wrong-.patch new file mode 100644 index 0000000000..dee3482e4f --- /dev/null +++ b/package/kernel/lantiq/ltq-ifxos/patches/200-Fix-app-compilation-failure-from-inclusion-of-wrong-.patch @@ -0,0 +1,59 @@ +From 7d52945b0b261c54ec736ecc435936c5fb8b81a4 Mon Sep 17 00:00:00 2001 +From: Yousong Zhou +Date: Thu, 30 Nov 2017 11:07:12 +0800 +Subject: [PATCH] Fix app compilation failure from inclusion of wrong headers + +Compiling against glibc can fail with the following errors + + In file included from /home/stefan/Router/o26431-vmmc_v5/source/staging_dir/toolchain-mips_24kc_gcc-5.5.0_glibc/include/bits/fcntl-linux.h:321:0, + from /home/stefan/Router/o26431-vmmc_v5/source/staging_dir/toolchain-mips_24kc_gcc-5.5.0_glibc/include/bits/fcntl.h:104, + from /home/stefan/Router/o26431-vmmc_v5/source/staging_dir/toolchain-mips_24kc_gcc-5.5.0_glibc/include/fcntl.h:35, + from linux/ifxos_linux_device_access_appl.c:30: + /home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:12:2: error: unknown type name '__s16' + __s16 l_type; + ^ + /home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:13:2: error: unknown type name '__s16' + __s16 l_whence; + ^ + /home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:14:2: error: unknown type name '__s64' + __s64 l_start; + ^ + /home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:15:2: error: unknown type name '__s64' + __s64 l_len; /* len == 0 means until end of file */ + ^ + /home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:16:2: error: unknown type name '__s32' + __s32 l_sysid; + ^ + /home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:17:2: error: unknown type name '__u32' + __u32 l_pid; + ^ + /home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:18:2: error: unknown type name '__s32' + __s32 l_pad[4]; /* reserved area */ + ^ + Makefile:1945: recipe for target 'libifxos_a-ifxos_linux_device_access_appl.o' failed + +Ref: https://bugs.lede-project.org/index.php?do=details&task_id=1196 +--- + src/Makefile.am | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index f95668f..d232e7f 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -14,11 +14,7 @@ lib_LIBRARIES = libifxos.a + + AM_CPPFLAGS = \ + -I@srcdir@\ +- -I@srcdir@/include \ +- -I@KERNEL_INCL_PATH@ \ +- -I@KERNEL_BUILD_PATH@/include \ +- -I@KERNEL_BUILD_PATH@/include2 \ +- -I$(TARGET_INCL_PATH) ++ -I@srcdir@/include + + if HAVE_GCC + +-- +1.8.3.1 + diff --git a/package/kernel/lantiq/ltq-ptm/Makefile b/package/kernel/lantiq/ltq-ptm/Makefile index d0743cda35..13831a2b6f 100644 --- a/package/kernel/lantiq/ltq-ptm/Makefile +++ b/package/kernel/lantiq/ltq-ptm/Makefile @@ -24,6 +24,14 @@ define KernelPackage/ltq-ptm-template URL:=http://www.lantiq.com/ VARIANT:=$(1) DEPENDS:=@TARGET_lantiq_$(2) +ifeq ($(1),vr9) + DEPENDS+= +kmod-ltq-vdsl-vr9-mei +else + DEPENDS+= +kmod-ltq-adsl-$(1)-mei +endif +ifeq ($(1),ase) + DEPENDS+=@BROKEN +endif FILES:=$(PKG_BUILD_DIR)/ltq_ptm_$(1).ko endef diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c index b3803f90e6..f764eba1fc 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c @@ -254,7 +254,7 @@ static struct net_device_ops g_ptm_netdev_ops = { #endif static struct net_device *g_net_dev[2] = {0}; -static char *g_net_dev_name[2] = {"ptm0", "ptmfast0"}; +static char *g_net_dev_name[2] = {"dsl0", "dslfast0"}; #ifdef CONFIG_IFX_PTM_RX_TASKLET static struct tasklet_struct g_ptm_tasklet[] = { @@ -927,8 +927,8 @@ static int proc_read_wanmib(char *page, char **start, off_t off, int count, int int len = 0; int i; char *title[] = { - "ptm0\n", - "ptmfast0\n" + "dsl0\n", + "dslfast0\n" }; for ( i = 0; i < ARRAY_SIZE(title); i++ ) { diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c index 22f1e23c4a..4e10d72fe1 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c @@ -121,7 +121,7 @@ static struct net_device_ops g_ptm_netdev_ops = { }; static struct net_device *g_net_dev[1] = {0}; -static char *g_net_dev_name[1] = {"ptm0"}; +static char *g_net_dev_name[1] = {"dsl0"}; static int g_ptm_prio_queue_map[8]; diff --git a/package/kernel/lantiq/ltq-vdsl-mei/Makefile b/package/kernel/lantiq/ltq-vdsl-mei/Makefile index 76bf3e9570..96bbc98c70 100644 --- a/package/kernel/lantiq/ltq-vdsl-mei/Makefile +++ b/package/kernel/lantiq/ltq-vdsl-mei/Makefile @@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ltq-vdsl-vr9-mei PKG_VERSION:=1.5.17.6 -PKG_RELEASE:=1 +PKG_RELEASE:=3 PKG_BASE_NAME:=drv_mei_cpe PKG_SOURCE:=$(PKG_BASE_NAME)-$(PKG_VERSION).tar.gz diff --git a/package/kernel/lantiq/ltq-vdsl/Makefile b/package/kernel/lantiq/ltq-vdsl/Makefile index 042e6080b2..3b085ed8a7 100644 --- a/package/kernel/lantiq/ltq-vdsl/Makefile +++ b/package/kernel/lantiq/ltq-vdsl/Makefile @@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ltq-vdsl-vr9 PKG_VERSION:=4.17.18.6 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_BASE_NAME:=drv_dsl_cpe_api PKG_SOURCE:=$(PKG_BASE_NAME)_vrx-$(PKG_VERSION).tar.gz diff --git a/package/kernel/lantiq/ltq-vdsl/patches/110-semaphore-lock.patch b/package/kernel/lantiq/ltq-vdsl/patches/110-semaphore-lock.patch new file mode 100644 index 0000000000..12c00c33ec --- /dev/null +++ b/package/kernel/lantiq/ltq-vdsl/patches/110-semaphore-lock.patch @@ -0,0 +1,107 @@ +--- a/src/include/drv_dsl_cpe_pm_core.h ++++ b/src/include/drv_dsl_cpe_pm_core.h +@@ -1510,9 +1510,9 @@ typedef struct + /** Common PM module mutex*/ + DSL_DRV_Mutex_t pmMutex; + /** PM module direction Near-End mutex*/ +- DSL_DRV_Mutex_t pmNeMutex; ++ struct semaphore pmNeMutex; + /** PM module direction Far-End mutex*/ +- DSL_DRV_Mutex_t pmFeMutex; ++ struct semaphore pmFeMutex; + /** PM module Near-End access mutex*/ + DSL_DRV_Mutex_t pmNeAccessMutex; + /** PM module Far-End access mutex*/ +--- a/src/pm/drv_dsl_cpe_api_pm.c ++++ b/src/pm/drv_dsl_cpe_api_pm.c +@@ -220,9 +220,9 @@ DSL_Error_t DSL_DRV_PM_Start( + /* init PM module common mutex */ + DSL_DRV_MUTEX_INIT(DSL_DRV_PM_CONTEXT(pContext)->pmMutex); + /* init PM module direction Near-End mutex */ +- DSL_DRV_MUTEX_INIT(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex); ++ sema_init(&(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex),1); + /* init PM module direction Far-End mutex */ +- DSL_DRV_MUTEX_INIT(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex); ++ sema_init(&(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex),1); + /* init PM module Near-End access mutex */ + DSL_DRV_MUTEX_INIT(DSL_DRV_PM_CONTEXT(pContext)->pmNeAccessMutex); + /* init PM module Far-End access mutex */ +@@ -592,7 +592,7 @@ DSL_Error_t DSL_DRV_PM_Stop( + if( DSL_DRV_PM_CONTEXT(pContext)->pmThreadFe.bRun != DSL_TRUE ) + { + DSL_DEBUG(DSL_DBG_WRN, +- (pContext, SYS_DBG_WRN"DSL[%02d]: PM module Near-End thread already stopped" ++ (pContext, SYS_DBG_WRN"DSL[%02d]: PM module Far-End thread already stopped" + DSL_DRV_CRLF, DSL_DEV_NUM(pContext))); + } + else +--- a/src/pm/drv_dsl_cpe_pm_core.c ++++ b/src/pm/drv_dsl_cpe_pm_core.c +@@ -1022,7 +1022,7 @@ DSL_Error_t DSL_DRV_PM_DirectionMutexCon + { + if( bLock ) + { +- if( DSL_DRV_MUTEX_LOCK(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex) ) ++ if(down_interruptible(&(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex))) + { + DSL_DEBUG( DSL_DBG_ERR, + (pContext, SYS_DBG_ERR"DSL[%02d]: ERROR - Couldn't lock PM NE mutex!" +@@ -1034,14 +1034,14 @@ DSL_Error_t DSL_DRV_PM_DirectionMutexCon + else + { + /* Unlock PM module NE Mutex*/ +- DSL_DRV_MUTEX_UNLOCK(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex); ++ up(&(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex)); + } + } + else + { + if( bLock ) + { +- if( DSL_DRV_MUTEX_LOCK(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex) ) ++ if(down_interruptible(&(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex))) + { + DSL_DEBUG( DSL_DBG_ERR, + (pContext, SYS_DBG_ERR"DSL[%02d]: ERROR - Couldn't lock PM FE mutex!" +@@ -1053,7 +1053,7 @@ DSL_Error_t DSL_DRV_PM_DirectionMutexCon + else + { + /* Unlock PM module FE Mutex*/ +- DSL_DRV_MUTEX_UNLOCK(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex); ++ up(&(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex)); + } + } + +@@ -1139,7 +1139,7 @@ DSL_Error_t DSL_DRV_PM_Lock(DSL_Context_ + if( !(DSL_DRV_PM_CONTEXT(pContext)->bPmLock) ) + { + /* Lock PM module Near-End Mutex*/ +- if( DSL_DRV_MUTEX_LOCK(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex) ) ++ if(down_interruptible(&(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex))) + { + DSL_DEBUG( DSL_DBG_ERR, + (pContext, SYS_DBG_ERR"DSL[%02d]: ERROR - Couldn't lock PM NE mutex!" +@@ -1148,8 +1148,8 @@ DSL_Error_t DSL_DRV_PM_Lock(DSL_Context_ + return DSL_ERR_SEMAPHORE_GET; + } + +- /* Lock PM module Near-End Mutex*/ +- if( DSL_DRV_MUTEX_LOCK(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex) ) ++ /* Lock PM module Far-End Mutex*/ ++ if( down_interruptible(&(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex)) ) + { + DSL_DEBUG( DSL_DBG_ERR, + (pContext, SYS_DBG_ERR"DSL[%02d]: ERROR - Couldn't lock PM FE mutex!" +@@ -1193,10 +1193,10 @@ DSL_Error_t DSL_DRV_PM_UnLock(DSL_Contex + if( DSL_DRV_PM_CONTEXT(pContext)->bPmLock ) + { + /* Unlock PM module NE Mutex*/ +- DSL_DRV_MUTEX_UNLOCK(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex); ++ up(&(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex)); + + /* Unlock PM module FE Mutex*/ +- DSL_DRV_MUTEX_UNLOCK(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex); ++ up(&(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex)); + + /* Clear bPmLock flag*/ + DSL_DRV_PM_CONTEXT(pContext)->bPmLock = DSL_FALSE; diff --git a/package/kernel/lantiq/ltq-vmmc/Makefile b/package/kernel/lantiq/ltq-vmmc/Makefile index ab0ef727b3..e42d5c0719 100644 --- a/package/kernel/lantiq/ltq-vmmc/Makefile +++ b/package/kernel/lantiq/ltq-vmmc/Makefile @@ -27,7 +27,7 @@ define KernelPackage/ltq-vmmc SUBMENU:=Voice over IP TITLE:=TAPI LL driver for Voice Macro URL:=http://www.lantiq.com/ - DEPENDS:=@(TARGET_lantiq_falcon||TARGET_lantiq_xway||TARGET_lantiq_xrx200) +kmod-ltq-tapi + DEPENDS:=@(TARGET_lantiq_xway||TARGET_lantiq_xrx200) +kmod-ltq-tapi FILES:=$(PKG_BUILD_DIR)/src/drv_vmmc.ko AUTOLOAD:=$(call AutoProbe,drv_vmmc) endef diff --git a/package/kernel/leds-apu2/Makefile b/package/kernel/leds-apu2/Makefile index bab2315b07..08aca1750f 100644 --- a/package/kernel/leds-apu2/Makefile +++ b/package/kernel/leds-apu2/Makefile @@ -37,8 +37,7 @@ EXTRA_CFLAGS:= \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \ MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ $(EXTRA_KCONFIG) diff --git a/package/kernel/leds-apu2/src/leds-apu2.c b/package/kernel/leds-apu2/src/leds-apu2.c index 0a60df1bc3..4ea552cf5f 100644 --- a/package/kernel/leds-apu2/src/leds-apu2.c +++ b/package/kernel/leds-apu2/src/leds-apu2.c @@ -228,21 +228,21 @@ static struct platform_driver gpio_apu2_driver = { }; static struct gpio_led apu2_leds_gpio[] = { - { - .name = "apu2:green:power", - .gpio = 509, - .active_low = 1, - }, - { - .name = "apu2:green:led2", - .gpio = 510, - .active_low = 1, - }, - { - .name = "apu2:green:led3", - .gpio = 511, - .active_low = 1, - }, + { + .name = "apu2:green:power", + .gpio = 509, + .active_low = 1, + }, + { + .name = "apu2:green:led2", + .gpio = 510, + .active_low = 1, + }, + { + .name = "apu2:green:led3", + .gpio = 511, + .active_low = 1, + }, }; static struct gpio_keys_button apu2_gpio_keys[] = { @@ -332,7 +332,10 @@ static int __init gpio_apu2_init (void) const char *board_name = dmi_get_system_info(DMI_BOARD_NAME); /* Match the device name/model */ - if (!board_name || !board_vendor || strcasecmp(board_vendor, "PC Engines") || strcasecmp(board_name, "apu2")) { + if (!board_name \ + || !board_vendor \ + || strcasecmp(board_vendor, "PC Engines") \ + || (strcasecmp(board_name, "apu2") && strcasecmp(board_name, "apu3"))) { err = -ENODEV; goto exit; } diff --git a/package/kernel/linux/modules/block.mk b/package/kernel/linux/modules/block.mk index 62f08218c6..ab9d7af8ca 100644 --- a/package/kernel/linux/modules/block.mk +++ b/package/kernel/linux/modules/block.mk @@ -206,10 +206,21 @@ endef $(eval $(call KernelPackage,block2mtd)) +define KernelPackage/dax + SUBMENU:=$(BLOCK_MENU) + TITLE:=DAX: direct access to differentiated memory + DEPENDS:=@LINUX_4_14 + KCONFIG:=CONFIG_DAX + FILES:=$(LINUX_DIR)/drivers/dax/dax.ko +endef + +$(eval $(call KernelPackage,dax)) + + define KernelPackage/dm SUBMENU:=$(BLOCK_MENU) TITLE:=Device Mapper - DEPENDS:=+kmod-crypto-manager + DEPENDS:=+kmod-crypto-manager +LINUX_4_14:kmod-dax # All the "=n" are unnecessary, they're only there # to stop the config from asking the question. # MIRROR is M because I've needed it for pvmove. diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index efcdeafa99..bc56b3cc12 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -120,6 +120,36 @@ endef $(eval $(call KernelPackage,crypto-rng)) +define KernelPackage/crypto-rsa + TITLE:=RSA algorithm + DEPENDS:=@!LINUX_3_18 +kmod-crypto-manager + KCONFIG:= CONFIG_CRYPTO_RSA + HIDDEN:=1 + FILES:= \ + $(LINUX_DIR)/lib/asn1_decoder.ko \ + $(LINUX_DIR)/lib/mpi/mpi.ko \ + $(LINUX_DIR)/crypto/akcipher.ko \ + $(LINUX_DIR)/crypto/rsa_generic.ko + AUTOLOAD:=$(call AutoLoad,10,rsa_generic) + $(call AddDepends/crypto) +endef + +$(eval $(call KernelPackage,crypto-rsa)) + + +define KernelPackage/crypto-ecdh + TITLE:=ECDH algorithm + DEPENDS:=@!(LINUX_3_18||LINUX_4_4) +kmod-crypto-kpp + KCONFIG:= CONFIG_CRYPTO_ECDH + FILES:= \ + $(LINUX_DIR)/crypto/ecdh_generic.ko + AUTOLOAD:=$(call AutoLoad,10,ecdh_generic) + $(call AddDepends/crypto) +endef + +$(eval $(call KernelPackage,crypto-ecdh)) + + define KernelPackage/crypto-iv TITLE:=CryptoAPI initialization vectors DEPENDS:=+kmod-crypto-manager +kmod-crypto-rng +kmod-crypto-wq @@ -161,7 +191,7 @@ $(eval $(call KernelPackage,crypto-seqiv)) define KernelPackage/crypto-hw-talitos TITLE:=Freescale integrated security engine (SEC) driver - DEPENDS:=+kmod-crypto-manager +kmod-crypto-hash +kmod-random-core +kmod-crypto-authenc + DEPENDS:=+kmod-crypto-manager +kmod-crypto-hash +kmod-random-core +kmod-crypto-authenc +kmod-crypto-des KCONFIG:= \ CONFIG_CRYPTO_HW=y \ CONFIG_CRYPTO_DEV_TALITOS \ @@ -196,12 +226,13 @@ $(eval $(call KernelPackage,crypto-hw-padlock)) define KernelPackage/crypto-hw-ccp TITLE:=AMD Cryptographic Coprocessor - DEPENDS:=+kmod-crypto-authenc +kmod-crypto-hash +kmod-crypto-manager +kmod-random-core +kmod-crypto-sha1 +kmod-crypto-sha256 + DEPENDS:=+kmod-crypto-authenc +kmod-crypto-hash +kmod-crypto-manager +kmod-random-core +kmod-crypto-sha1 +kmod-crypto-sha256 +LINUX_4_14:kmod-crypto-rsa KCONFIG:= \ CONFIG_CRYPTO_HW=y \ CONFIG_CRYPTO_DEV_CCP=y \ CONFIG_CRYPTO_DEV_CCP_CRYPTO \ - CONFIG_CRYPTO_DEV_CCP_DD + CONFIG_CRYPTO_DEV_CCP_DD \ + CONFIG_CRYPTO_DEV_SP_CCP=y FILES:= \ $(LINUX_DIR)/drivers/crypto/ccp/ccp.ko \ $(LINUX_DIR)/drivers/crypto/ccp/ccp-crypto.ko @@ -330,9 +361,33 @@ endef $(eval $(call KernelPackage,crypto-des)) +define KernelPackage/crypto-kpp + TITLE:=Key-agreement Protocol Primitives + KCONFIG:=CONFIG_CRYPTO_KPP + HIDDEN:=1 + FILES:=$(LINUX_DIR)/crypto/kpp.ko + AUTOLOAD:=$(call AutoLoad,09,kpp) + $(call AddDepends/crypto) +endef + +$(eval $(call KernelPackage,crypto-kpp)) + + +define KernelPackage/crypto-acompress + TITLE:=Asynchronous Compression operations + HIDDEN:=1 + KCONFIG:=CONFIG_CRYPTO_ACOMP2 + FILES:=$(LINUX_DIR)/crypto/crypto_acompress.ko + AUTOLOAD:=$(call AutoLoad,09,crypto_acompress) + $(call AddDepends/crypto) +endef + +$(eval $(call KernelPackage,crypto-acompress)) + + define KernelPackage/crypto-deflate TITLE:=Deflate compression CryptoAPI module - DEPENDS:=+kmod-lib-zlib-inflate +kmod-lib-zlib-deflate + DEPENDS:=+kmod-lib-zlib-inflate +kmod-lib-zlib-deflate +LINUX_4_14:kmod-crypto-acompress KCONFIG:=CONFIG_CRYPTO_DEFLATE FILES:=$(LINUX_DIR)/crypto/deflate.ko AUTOLOAD:=$(call AutoLoad,09,deflate) @@ -363,6 +418,17 @@ endef $(eval $(call KernelPackage,crypto-ecb)) +define KernelPackage/crypto-cts + TITLE:=Cipher Text Stealing CryptoAPI module + DEPENDS:=+kmod-crypto-manager + KCONFIG:=CONFIG_CRYPTO_CTS + FILES:=$(LINUX_DIR)/crypto/cts.ko + AUTOLOAD:=$(call AutoLoad,09,cts) + $(call AddDepends/crypto) +endef + +$(eval $(call KernelPackage,crypto-cts)) + define KernelPackage/crypto-hmac TITLE:=HMAC digest CryptoAPI module diff --git a/package/kernel/linux/modules/fs.mk b/package/kernel/linux/modules/fs.mk index 610d1b58a1..f757585575 100644 --- a/package/kernel/linux/modules/fs.mk +++ b/package/kernel/linux/modules/fs.mk @@ -82,7 +82,7 @@ $(eval $(call KernelPackage,fs-autofs4)) define KernelPackage/fs-btrfs SUBMENU:=$(FS_MENU) TITLE:=BTRFS filesystem support - DEPENDS:=+kmod-lib-crc32c +kmod-lib-lzo +kmod-lib-zlib-inflate +kmod-lib-zlib-deflate +kmod-lib-raid6 +kmod-lib-xor + DEPENDS:=+kmod-lib-crc32c +kmod-lib-lzo +kmod-lib-zlib-inflate +kmod-lib-zlib-deflate +kmod-lib-raid6 +kmod-lib-xor +LINUX_4_14:kmod-lib-zstd KCONFIG:=\ CONFIG_BTRFS_FS \ CONFIG_BTRFS_FS_POSIX_ACL=n \ @@ -106,7 +106,8 @@ define KernelPackage/fs-cifs CONFIG_CIFS \ CONFIG_CIFS_XATTR=y \ CONFIG_CIFS_DFS_UPCALL=n \ - CONFIG_CIFS_UPCALL=n + CONFIG_CIFS_UPCALL=n \ + CONFIG_CIFS_SMB311=n FILES:=$(LINUX_DIR)/fs/cifs/cifs.ko AUTOLOAD:=$(call AutoLoad,30,cifs) $(call AddDepends/nls) @@ -317,24 +318,54 @@ $(eval $(call KernelPackage,fs-msdos)) define KernelPackage/fs-nfs SUBMENU:=$(FS_MENU) - TITLE:=NFS filesystem support + TITLE:=NFS filesystem client support DEPENDS:=+kmod-fs-nfs-common +kmod-dnsresolver KCONFIG:= \ CONFIG_NFS_FS \ CONFIG_NFS_USE_LEGACY_DNS=n \ CONFIG_NFS_USE_NEW_IDMAPPER=n FILES:= \ - $(LINUX_DIR)/fs/nfs/nfs.ko \ - $(LINUX_DIR)/fs/nfs/nfsv3.ko - AUTOLOAD:=$(call AutoLoad,40,nfs nfsv3) + $(LINUX_DIR)/fs/nfs/nfs.ko + AUTOLOAD:=$(call AutoLoad,40,nfs) endef define KernelPackage/fs-nfs/description - Kernel module for NFS support + Kernel module for NFS client support endef $(eval $(call KernelPackage,fs-nfs)) +define KernelPackage/fs-nfs-v3 + SUBMENU:=$(FS_MENU) + TITLE:=NFS3 filesystem client support + DEPENDS:=+kmod-fs-nfs + FILES:= \ + $(LINUX_DIR)/fs/nfs/nfsv3.ko + AUTOLOAD:=$(call AutoLoad,41,nfsv3) +endef + +define KernelPackage/fs-nfs-v3/description + Kernel module for NFS v3 client support +endef + +$(eval $(call KernelPackage,fs-nfs-v3)) + +define KernelPackage/fs-nfs-v4 + SUBMENU:=$(FS_MENU) + TITLE:=NFS4 filesystem client support + DEPENDS:=+kmod-fs-nfs + KCONFIG:= \ + CONFIG_NFS_V4=y + FILES:= \ + $(LINUX_DIR)/fs/nfs/nfsv4.ko + AUTOLOAD:=$(call AutoLoad,41,nfsv4) +endef + +define KernelPackage/fs-nfs-v4/description + Kernel module for NFS v4 support +endef + +$(eval $(call KernelPackage,fs-nfs-v4)) define KernelPackage/fs-nfs-common SUBMENU:=$(FS_MENU) @@ -353,23 +384,33 @@ endef $(eval $(call KernelPackage,fs-nfs-common)) -define KernelPackage/fs-nfs-common-v4 +define KernelPackage/fs-nfs-common-rpcsec SUBMENU:=$(FS_MENU) - TITLE:=Common NFS V4 filesystem modules - KCONFIG+=\ - CONFIG_SUNRPC_GSS\ - CONFIG_NFS_V4=y\ - CONFIG_NFSD_V4=y - DEPENDS:= @BROKEN - FILES+=$(LINUX_DIR)/net/sunrpc/auth_gss/auth_rpcgss.ko - AUTOLOAD=$(call AutoLoad,30,auth_rpcgss) + TITLE:=NFS Secure RPC + DEPENDS:= \ + +kmod-fs-nfs-common \ + +kmod-crypto-des \ + +kmod-crypto-cbc \ + +kmod-crypto-cts \ + +kmod-crypto-md5 \ + +kmod-crypto-sha1 \ + +kmod-crypto-hmac \ + +kmod-crypto-ecb + KCONFIG:= \ + CONFIG_SUNRPC_GSS \ + CONFIG_RPCSEC_GSS_KRB5 + FILES:= \ + $(LINUX_DIR)/lib/oid_registry.ko \ + $(LINUX_DIR)/net/sunrpc/auth_gss/auth_rpcgss.ko \ + $(LINUX_DIR)/net/sunrpc/auth_gss/rpcsec_gss_krb5.ko + AUTOLOAD:=$(call AutoLoad,31,oid_registry auth_rpcgss rpcsec_gss_krb5) endef -define KernelPackage/fs-nfs-common-v4/description - Kernel modules for NFS V4 & NFSD V4 kernel support +define KernelPackage/fs-nfs-common-rpcsec/description + Kernel modules for NFS Secure RPC endef -$(eval $(call KernelPackage,fs-nfs-common-v4)) +$(eval $(call KernelPackage,fs-nfs-common-rpcsec)) define KernelPackage/fs-nfsd diff --git a/package/kernel/linux/modules/i2c.mk b/package/kernel/linux/modules/i2c.mk index 7e85ef3d9d..14c5b6448e 100644 --- a/package/kernel/linux/modules/i2c.mk +++ b/package/kernel/linux/modules/i2c.mk @@ -127,7 +127,7 @@ I2C_PIIX4_MODULES:= \ define KernelPackage/i2c-piix4 $(call i2c_defaults,$(I2C_PIIX4_MODULES),59) TITLE:=Intel PIIX4 and compatible I2C interfaces - DEPENDS:=@PCI_SUPPORT @(x86||x86_64) kmod-i2c-core + DEPENDS:=@PCI_SUPPORT @TARGET_x86 kmod-i2c-core endef define KernelPackage/i2c-piix4/description @@ -142,6 +142,47 @@ endef $(eval $(call KernelPackage,i2c-piix4)) +I2C_I801_MODULES:= \ + CONFIG_I2C_I801:drivers/i2c/busses/i2c-i801 + +define KernelPackage/i2c-i801 + $(call i2c_defaults,$(I2C_I801_MODULES),59) + TITLE:=Intel I801 and compatible I2C interfaces + DEPENDS:=@PCI_SUPPORT @TARGET_x86 kmod-i2c-core +kmod-i2c-smbus +endef + +define KernelPackage/i2c-i801/description + Support for the Intel I801 family of mainboard I2C interfaces, + specifically 82801AA, 82801AB, 82801BA, 82801CA/CAM, 82801DB, + 82801EB/ER (ICH5/ICH5R), 6300ESB, ICH6, ICH7, ESB2, ICH8, ICH9, + EP80579 (Tolapai), ICH10, 5/3400 Series (PCH), 6 Series (PCH), + Patsburg (PCH), DH89xxCC (PCH), Panther Point (PCH), + Lynx Point (PCH), Lynx Point-LP (PCH), Avoton (SOC), + Wellsburg (PCH), Coleto Creek (PCH), Wildcat Point (PCH), + Wildcat Point-LP (PCH), BayTrail (SOC), Sunrise Point-H (PCH), + Sunrise Point-LP (PCH), DNV (SOC), Broxton (SOC), + Lewisburg (PCH). +endef + +$(eval $(call KernelPackage,i2c-i801)) + + +I2C_SMBUS_MODULES:= \ + CONFIG_I2C_SMBUS:drivers/i2c/i2c-smbus + +define KernelPackage/i2c-smbus + $(call i2c_defaults,$(I2C_SMBUS_MODULES),58) + TITLE:=SMBus-specific protocols helper + DEPENDS:=kmod-i2c-core +endef + +define KernelPackage/i2c-smbus/description + Support for the SMBus extensions to the I2C specification. +endef + +$(eval $(call KernelPackage,i2c-smbus)) + + I2C_MUX_MODULES:= \ CONFIG_I2C_MUX:drivers/i2c/i2c-mux diff --git a/package/kernel/linux/modules/iio.mk b/package/kernel/linux/modules/iio.mk new file mode 100644 index 0000000000..8990e54813 --- /dev/null +++ b/package/kernel/linux/modules/iio.mk @@ -0,0 +1,120 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +IIO_MENU:=Industrial I/O Modules + + +define KernelPackage/iio-core + SUBMENU:=$(IIO_MENU) + TITLE:=Industrial IO core + KCONFIG:= \ + CONFIG_IIO \ + CONFIG_IIO_BUFFER=y \ + CONFIG_IIO_KFIFO_BUF \ + CONFIG_IIO_TRIGGER=y \ + CONFIG_IIO_TRIGGERED_BUFFER + FILES:= \ + $(LINUX_DIR)/drivers/iio/industrialio.ko \ + $(if $(CONFIG_IIO_TRIGGERED_BUFFER),$(LINUX_DIR)/drivers/iio/industrialio-triggered-buffer.ko@lt4.4) \ + $(if $(CONFIG_IIO_TRIGGERED_BUFFER),$(LINUX_DIR)/drivers/iio/buffer/industrialio-triggered-buffer.ko@ge4.4) \ + $(LINUX_DIR)/drivers/iio/kfifo_buf.ko@lt4.4 \ + $(LINUX_DIR)/drivers/iio/buffer/kfifo_buf.ko@ge4.4 + AUTOLOAD:=$(call AutoLoad,55,industrialio kfifo_buf industrialio-triggered-buffer) +endef + +define KernelPackage/iio-core/description + The industrial I/O subsystem provides a unified framework for + drivers for many different types of embedded sensors using a + number of different physical interfaces (i2c, spi, etc) +endef + +$(eval $(call KernelPackage,iio-core)) + + +define KernelPackage/iio-ad799x + SUBMENU:=$(IIO_MENU) + DEPENDS:=+kmod-i2c-core +kmod-iio-core + TITLE:=Analog Devices AD799x ADC driver + KCONFIG:= \ + CONFIG_AD799X_RING_BUFFER=y \ + CONFIG_AD799X + FILES:=$(LINUX_DIR)/drivers/iio/adc/ad799x.ko + AUTOLOAD:=$(call AutoLoad,56,ad799x) +endef + +define KernelPackage/iio-ad799x/description + support for Analog Devices: + ad7991, ad7995, ad7999, ad7992, ad7993, ad7994, ad7997, ad7998 + i2c analog to digital converters (ADC). +endef + +$(eval $(call KernelPackage,iio-ad799x)) + + +define KernelPackage/iio-dht11 + SUBMENU:=$(IIO_MENU) + DEPENDS:=+kmod-iio-core @GPIO_SUPPORT @USES_DEVICETREE + TITLE:=DHT11 (and compatible) humidity and temperature sensors + KCONFIG:= \ + CONFIG_DHT11 + FILES:=$(LINUX_DIR)/drivers/iio/humidity/dht11.ko + AUTOLOAD:=$(call AutoLoad,56,dht11) +endef + +define KernelPackage/iio-dht11/description + support for DHT11 and DHT22 digitial humidity and temperature sensors + attached at GPIO lines. You will need a custom device tree file to + specify the GPIO line to use. +endef + +$(eval $(call KernelPackage,iio-dht11)) + +define KernelPackage/iio-bmp280 + SUBMENU:=$(IIO_MENU) + TITLE:=BMP180/BMP280/BME280 pressure/temperatur sensor + DEPENDS:=@(LINUX_4_9||LINUX_4_14) +kmod-iio-core +kmod-regmap + KCONFIG:=CONFIG_BMP280 + FILES:=$(LINUX_DIR)/drivers/iio/pressure/bmp280.ko +endef + +define KernelPackage/iio-bmp280/description + This driver adds support for Bosch Sensortec BMP180 and BMP280 pressure and + temperature sensors. Also supports the BME280 with an additional humidity + sensor channel. +endef + +$(eval $(call KernelPackage,iio-bmp280)) + + +define KernelPackage/iio-bmp280-i2c + SUBMENU:=$(IIO_MENU) + TITLE:=BMP180/BMP280/BME280 pressure/temperatur sensor (I2C) + DEPENDS:=+kmod-iio-bmp280 +kmod-i2c-core + KCONFIG:=CONFIG_BMP280_I2C + FILES:=$(LINUX_DIR)/drivers/iio/pressure/bmp280-i2c.ko + AUTOLOAD:=$(call AutoProbe,iio-bmp280-i2c) +endef +define KernelPackage/iio-bmp280-i2c/description + This driver adds support for Bosch Sensortec's digital pressure and + temperature sensor connected via I2C. +endef + +$(eval $(call KernelPackage,iio-bmp280-i2c)) + + +define KernelPackage/iio-bmp280-spi + SUBMENU:=$(IIO_MENU) + TITLE:=BMP180/BMP280/BME280 pressure/temperatur sensor (SPI) + DEPENDS:=+kmod-iio-bmp280 +kmod-spi-bitbang + KCONFIG:=CONFIG_BMP280_SPI + FILES:=$(LINUX_DIR)/drivers/iio/pressure/bmp280-spi.ko + AUTOLOAD:=$(call AutoProbe,iio-bmp280-spi) +endef +define KernelPackage/iio-bmp280-spi/description + This driver adds support for Bosch Sensortec's digital pressure and + temperature sensor connected via SPI. +endef + +$(eval $(call KernelPackage,iio-bmp280-spi)) diff --git a/package/kernel/linux/modules/lib.mk b/package/kernel/linux/modules/lib.mk index 72c5eff69c..6d7e0dc996 100644 --- a/package/kernel/linux/modules/lib.mk +++ b/package/kernel/linux/modules/lib.mk @@ -101,14 +101,17 @@ $(eval $(call KernelPackage,lib-crc32c)) define KernelPackage/lib-lzo SUBMENU:=$(LIB_MENU) TITLE:=LZO support + DEPENDS:=+LINUX_4_14:kmod-crypto-acompress KCONFIG:= \ + CONFIG_CRYPTO_LZO@ge4.9 \ CONFIG_LZO_COMPRESS \ CONFIG_LZO_DECOMPRESS HIDDEN:=1 FILES:= \ + $(LINUX_DIR)/crypto/lzo.ko@ge4.9 \ $(LINUX_DIR)/lib/lzo/lzo_compress.ko \ $(LINUX_DIR)/lib/lzo/lzo_decompress.ko - AUTOLOAD:=$(call AutoProbe,lzo_compress lzo_decompress) + AUTOLOAD:=$(call AutoProbe,lzo@ge4.9 lzo_compress lzo_decompress) endef define KernelPackage/lib-lzo/description @@ -118,17 +121,42 @@ endef $(eval $(call KernelPackage,lib-lzo)) +define KernelPackage/lib-zstd + SUBMENU:=$(LIB_MENU) + TITLE:=ZSTD support + KCONFIG:= \ + CONFIG_ZSTD_COMPRESS \ + CONFIG_ZSTD_DECOMPRESS \ + CONFIG_XXHASH + HIDDEN:=1 + FILES:= \ + $(LINUX_DIR)/lib/xxhash.ko \ + $(LINUX_DIR)/lib/zstd/zstd_compress.ko \ + $(LINUX_DIR)/lib/zstd/zstd_decompress.ko + AUTOLOAD:=$(call AutoProbe,xxhash zstd_compress zstd_decompress) +endef + +define KernelPackage/lib-zstd/description + Kernel module for ZSTD compression/decompression support +endef + +$(eval $(call KernelPackage,lib-zstd)) + + define KernelPackage/lib-lz4 SUBMENU:=$(LIB_MENU) TITLE:=LZ4 support + DEPENDS:=+LINUX_4_14:kmod-crypto-acompress HIDDEN:=1 KCONFIG:= \ + CONFIG_CRYPTO_LZ4@ge4.9 \ CONFIG_LZ4_COMPRESS \ CONFIG_LZ4_DECOMPRESS FILES:= \ + $(LINUX_DIR)/crypto/lz4.ko@ge4.9 \ $(LINUX_DIR)/lib/lz4/lz4_compress.ko \ $(LINUX_DIR)/lib/lz4/lz4_decompress.ko - AUTOLOAD:=$(call AutoProbe,lz4_compress lz4_decompress) + AUTOLOAD:=$(call AutoProbe,lz4@ge4.9 lz4_compress lz4_decompress) endef define KernelPackage/lib-lz4/description diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index 4af06c610d..a9740ef35a 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -304,6 +304,22 @@ endef $(eval $(call KernelPackage,r6040)) +define KernelPackage/niu + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=Sun Neptune 10Gbit Ethernet support + DEPENDS:=@PCI_SUPPORT + KCONFIG:=CONFIG_NIU + FILES:=$(LINUX_DIR)/drivers/net/ethernet/sun/niu.ko + AUTOLOAD:=$(call AutoProbe,niu) +endef + +define KernelPackage/niu/description + This enables support for cards based upon Sun's Neptune chipset. +endef + +$(eval $(call KernelPackage,niu)) + + define KernelPackage/sis900 SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=SiS 900 Ethernet support @@ -450,7 +466,7 @@ $(eval $(call KernelPackage,ne2k-pci)) define KernelPackage/e100 SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=Intel(R) PRO/100+ cards kernel support - DEPENDS:=@PCI_SUPPORT +kmod-mii + DEPENDS:=@PCI_SUPPORT +kmod-mii +e100-firmware KCONFIG:=CONFIG_E100 FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/e100.ko AUTOLOAD:=$(call AutoProbe,e100) @@ -460,13 +476,6 @@ define KernelPackage/e100/description Kernel modules for Intel(R) PRO/100+ Ethernet adapters endef -define KernelPackage/e100/install - $(INSTALL_DIR) $(1)/lib/firmware/e100 - $(INSTALL_DATA) $(LINUX_DIR)/firmware/e100/d101m_ucode.bin $(1)/lib/firmware/e100/ - $(INSTALL_DATA) $(LINUX_DIR)/firmware/e100/d101s_ucode.bin $(1)/lib/firmware/e100/ - $(INSTALL_DATA) $(LINUX_DIR)/firmware/e100/d102e_ucode.bin $(1)/lib/firmware/e100/ -endef - $(eval $(call KernelPackage,e100)) @@ -495,6 +504,9 @@ define KernelPackage/e1000e KCONFIG:=CONFIG_E1000E FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/e1000e/e1000e.ko AUTOLOAD:=$(call AutoProbe,e1000e) + MODPARAMS.e1000e:= \ + IntMode=1 \ + InterruptThrottleRate=4,4,4,4,4,4,4,4 endef define KernelPackage/e1000e/description @@ -559,6 +571,25 @@ endef $(eval $(call KernelPackage,ixgbe)) +define KernelPackage/ixgbevf + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=Intel(R) 82599 Virtual Function Ethernet support + DEPENDS:=@PCI_SUPPORT +kmod-ixgbe + KCONFIG:=CONFIG_IXGBEVF \ + CONFIG_IXGBE_VXLAN=n \ + CONFIG_IXGBE_HWMON=n \ + CONFIG_IXGBE_DCA=n + FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/ixgbevf/ixgbevf.ko + AUTOLOAD:=$(call AutoLoad,35,ixgbevf) +endef + +define KernelPackage/ixgbevf/description + Kernel modules for Intel(R) 82599 Virtual Function Ethernet adapters. +endef + +$(eval $(call KernelPackage,ixgbevf)) + + define KernelPackage/b44 TITLE:=Broadcom 44xx driver KCONFIG:=CONFIG_B44 @@ -615,8 +646,9 @@ $(eval $(call KernelPackage,pcnet32)) define KernelPackage/tg3 TITLE:=Broadcom Tigon3 Gigabit Ethernet - KCONFIG:=CONFIG_TIGON3 - DEPENDS:=+!TARGET_brcm47xx:kmod-libphy +kmod-hwmon-core +kmod-ptp + KCONFIG:=CONFIG_TIGON3 \ + CONFIG_TIGON3_HWMON=n + DEPENDS:=+!TARGET_brcm47xx:kmod-libphy +!LINUX_4_14:kmod-hwmon-core +kmod-ptp SUBMENU:=$(NETWORK_DEVICES_MENU) FILES:=$(LINUX_DIR)/drivers/net/ethernet/broadcom/tg3.ko AUTOLOAD:=$(call AutoLoad,19,tg3,1) diff --git a/package/kernel/linux/modules/netfilter.mk b/package/kernel/linux/modules/netfilter.mk index 0ad6987aa6..0d817ed7f4 100644 --- a/package/kernel/linux/modules/netfilter.mk +++ b/package/kernel/linux/modules/netfilter.mk @@ -529,6 +529,23 @@ endef $(eval $(call KernelPackage,ipt-u32)) +define KernelPackage/ipt-checksum + TITLE:=CHECKSUM support + KCONFIG:= \ + CONFIG_NETFILTER_XT_TARGET_CHECKSUM + FILES:= \ + $(LINUX_DIR)/net/netfilter/xt_CHECKSUM.ko \ + $(foreach mod,$(IPT_CHECKSUM-m),$(LINUX_DIR)/net/$(mod).ko) + AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_CHECKSUM-m))) + $(call AddDepends/ipt) +endef + +define KernelPackage/ipt-checksum/description + Kernel modules for CHECKSUM fillin target +endef + +$(eval $(call KernelPackage,ipt-checksum)) + define KernelPackage/ipt-iprange TITLE:=Module for matching ip ranges diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index 6c9b03be1d..836034ad12 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -271,7 +271,8 @@ define KernelPackage/ipsec4 CONFIG_INET_XFRM_MODE_BEET \ CONFIG_INET_XFRM_MODE_TRANSPORT \ CONFIG_INET_XFRM_MODE_TUNNEL \ - CONFIG_INET_XFRM_TUNNEL + CONFIG_INET_XFRM_TUNNEL \ + CONFIG_INET_ESP_OFFLOAD=n FILES:=$(foreach mod,$(IPSEC4-m),$(LINUX_DIR)/net/$(mod).ko) AUTOLOAD:=$(call AutoLoad,32,$(notdir $(IPSEC4-m))) endef @@ -311,7 +312,8 @@ define KernelPackage/ipsec6 CONFIG_INET6_XFRM_MODE_BEET \ CONFIG_INET6_XFRM_MODE_TRANSPORT \ CONFIG_INET6_XFRM_MODE_TUNNEL \ - CONFIG_INET6_XFRM_TUNNEL + CONFIG_INET6_XFRM_TUNNEL \ + CONFIG_INET6_ESP_OFFLOAD=n FILES:=$(foreach mod,$(IPSEC6-m),$(LINUX_DIR)/net/$(mod).ko) AUTOLOAD:=$(call AutoLoad,32,$(notdir $(IPSEC6-m))) endef @@ -923,9 +925,10 @@ define KernelPackage/rxrpc CONFIG_RXKAD=m \ CONFIG_AF_RXRPC_DEBUG=n FILES:= \ - $(LINUX_DIR)/net/rxrpc/af-rxrpc.ko \ + $(LINUX_DIR)/net/rxrpc/af-rxrpc.ko@lt4.11 \ + $(LINUX_DIR)/net/rxrpc/rxrpc.ko@ge4.11 \ $(LINUX_DIR)/net/rxrpc/rxkad.ko@lt4.7 - AUTOLOAD:=$(call AutoLoad,30,rxkad@lt4.7 af-rxrpc) + AUTOLOAD:=$(call AutoLoad,30,rxkad@lt4.7 af-rxrpc.ko@lt4.11 rxrpc.ko@ge4.11) DEPENDS:= +kmod-crypto-manager +kmod-crypto-pcbc +kmod-crypto-fcrypt endef @@ -942,6 +945,7 @@ define KernelPackage/mpls KCONFIG:= \ CONFIG_MPLS=y \ CONFIG_LWTUNNEL=y \ + CONFIG_LWTUNNEL_BPF=n \ CONFIG_NET_MPLS_GSO=m \ CONFIG_MPLS_ROUTING=m \ CONFIG_MPLS_IPTUNNEL=m @@ -965,6 +969,7 @@ define KernelPackage/9pnet KCONFIG:= \ CONFIG_NET_9P \ CONFIG_NET_9P_DEBUG=n \ + CONFIG_NET_9P_XEN=n \ CONFIG_NET_9P_VIRTIO FILES:= \ $(LINUX_DIR)/net/9p/9pnet.ko \ @@ -1009,3 +1014,18 @@ define KernelPackage/mdio/description endef $(eval $(call KernelPackage,mdio)) + +define KernelPackage/macsec + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=IEEE 802.1AE MAC-level encryption (MAC) + DEPENDS:=+kmod-crypto-gcm @!LINUX_3_18 @!LINUX_4_1 @!LINUX_4_4 + KCONFIG:=CONFIG_MACSEC + FILES:=$(LINUX_DIR)/drivers/net/macsec.ko + AUTOLOAD:=$(call AutoLoad,13,macsec) +endef + +define KernelPackage/macsec/description + MACsec is an encryption standard for Ethernet. +endef + +$(eval $(call KernelPackage,macsec)) diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index 1b31a861f0..973e4f3e26 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -30,7 +30,7 @@ $(eval $(call KernelPackage,6lowpan)) define KernelPackage/bluetooth SUBMENU:=$(OTHER_MENU) TITLE:=Bluetooth support - DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-crypto-hash +kmod-crypto-ecb +kmod-lib-crc16 +kmod-hid +!LINUX_3_18:kmod-crypto-cmac +!LINUX_3_18:kmod-regmap + DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-crypto-hash +kmod-crypto-ecb +kmod-lib-crc16 +kmod-hid +!LINUX_3_18:kmod-crypto-cmac +!LINUX_3_18:kmod-regmap +LINUX_4_14:kmod-crypto-ecdh KCONFIG:= \ CONFIG_BLUEZ \ CONFIG_BLUEZ_L2CAP \ @@ -114,6 +114,27 @@ endef $(eval $(call KernelPackage,bluetooth_6lowpan)) +define KernelPackage/btmrvl + SUBMENU:=$(OTHER_MENU) + TITLE:=Marvell Bluetooth Kernel Module support + DEPENDS:=+kmod-mmc +kmod-bluetooth +mwifiex-sdio-firmware + KCONFIG:= \ + CONFIG_BT_MRVL \ + CONFIG_BT_MRVL_SDIO + $(call AddDepends/bluetooth) + FILES:= \ + $(LINUX_DIR)/drivers/bluetooth/btmrvl.ko \ + $(LINUX_DIR)/drivers/bluetooth/btmrvl_sdio.ko + AUTOLOAD:=$(call AutoProbe,btmrvl btmrvl_sdio) +endef + +define KernelPackage/btmrvl/description + Kernel support for Marvell SDIO Bluetooth Module +endef + +$(eval $(call KernelPackage,btmrvl)) + + define KernelPackage/dma-buf SUBMENU:=$(OTHER_MENU) TITLE:=DMA shared buffer support @@ -221,9 +242,9 @@ $(eval $(call KernelPackage,gpio-mcp23s08)) define KernelPackage/gpio-nxp-74hc164 SUBMENU:=$(OTHER_MENU) TITLE:=NXP 74HC164 GPIO expander support - KCONFIG:=CONFIG_GPIO_NXP_74HC164 - FILES:=$(LINUX_DIR)/drivers/gpio/nxp_74hc164.ko - AUTOLOAD:=$(call AutoProbe,nxp_74hc164) + KCONFIG:=CONFIG_GPIO_74X164 + FILES:=$(LINUX_DIR)/drivers/gpio/gpio-74x164.ko + AUTOLOAD:=$(call AutoProbe,gpio-74x164) endef define KernelPackage/gpio-nxp-74hc164/description @@ -263,71 +284,6 @@ endef $(eval $(call KernelPackage,gpio-pcf857x)) -define KernelPackage/iio-core - SUBMENU:=$(OTHER_MENU) - TITLE:=Industrial IO core - KCONFIG:= \ - CONFIG_IIO \ - CONFIG_IIO_BUFFER=y \ - CONFIG_IIO_KFIFO_BUF \ - CONFIG_IIO_TRIGGER=y \ - CONFIG_IIO_TRIGGERED_BUFFER - FILES:= \ - $(LINUX_DIR)/drivers/iio/industrialio.ko \ - $(if $(CONFIG_IIO_TRIGGERED_BUFFER),$(LINUX_DIR)/drivers/iio/industrialio-triggered-buffer.ko@lt4.4) \ - $(if $(CONFIG_IIO_TRIGGERED_BUFFER),$(LINUX_DIR)/drivers/iio/buffer/industrialio-triggered-buffer.ko@ge4.4) \ - $(LINUX_DIR)/drivers/iio/kfifo_buf.ko@lt4.4 \ - $(LINUX_DIR)/drivers/iio/buffer/kfifo_buf.ko@ge4.4 - AUTOLOAD:=$(call AutoLoad,55,industrialio kfifo_buf industrialio-triggered-buffer) -endef - -define KernelPackage/iio-core/description - The industrial I/O subsystem provides a unified framework for - drivers for many different types of embedded sensors using a - number of different physical interfaces (i2c, spi, etc) -endef - -$(eval $(call KernelPackage,iio-core)) - - -define KernelPackage/iio-ad799x - SUBMENU:=$(OTHER_MENU) - DEPENDS:=kmod-i2c-core kmod-iio-core - TITLE:=Analog Devices AD799x ADC driver - KCONFIG:= \ - CONFIG_AD799X_RING_BUFFER=y \ - CONFIG_AD799X - FILES:=$(LINUX_DIR)/drivers/iio/adc/ad799x.ko - AUTOLOAD:=$(call AutoLoad,56,ad799x) -endef - -define KernelPackage/iio-ad799x/description - support for Analog Devices: - ad7991, ad7995, ad7999, ad7992, ad7993, ad7994, ad7997, ad7998 - i2c analog to digital converters (ADC). -endef - -$(eval $(call KernelPackage,iio-ad799x)) - - -define KernelPackage/iio-dht11 - SUBMENU:=$(OTHER_MENU) - DEPENDS:=kmod-iio-core @GPIO_SUPPORT @USES_DEVICETREE - TITLE:=DHT11 (and compatible) humidity and temperature sensors - KCONFIG:= \ - CONFIG_DHT11 - FILES:=$(LINUX_DIR)/drivers/iio/humidity/dht11.ko - AUTOLOAD:=$(call AutoLoad,56,dht11) -endef - -define KernelPackage/iio-dht11/description - support for DHT11 and DHT22 digitial humidity and temperature sensors - attached at GPIO lines. You will need a custom device tree file to - specify the GPIO line to use. -endef - -$(eval $(call KernelPackage,iio-dht11)) - define KernelPackage/lp SUBMENU:=$(OTHER_MENU) @@ -361,7 +317,8 @@ define KernelPackage/mmc CONFIG_SDIO_UART=n FILES:= \ $(LINUX_DIR)/drivers/mmc/core/mmc_core.ko \ - $(LINUX_DIR)/drivers/mmc/card/mmc_block.ko + $(LINUX_DIR)/drivers/mmc/card/mmc_block.ko@lt4.10 \ + $(LINUX_DIR)/drivers/mmc/core/mmc_block.ko@ge4.10 AUTOLOAD:=$(call AutoProbe,mmc_core mmc_block,1) endef @@ -486,7 +443,7 @@ define KernelPackage/rtc-ds1307 SUBMENU:=$(OTHER_MENU) TITLE:=Dallas/Maxim DS1307 (and compatible) RTC support DEFAULT:=m if ALL_KMODS && RTC_SUPPORT - DEPENDS:=+kmod-i2c-core + DEPENDS:=+kmod-i2c-core +LINUX_4_14:kmod-regmap KCONFIG:=CONFIG_RTC_DRV_DS1307 \ CONFIG_RTC_CLASS=y FILES:=$(LINUX_DIR)/drivers/rtc/rtc-ds1307.ko @@ -648,6 +605,20 @@ endef $(eval $(call KernelPackage,mtdtests)) +define KernelPackage/mtdoops + SUBMENU:=$(OTHER_MENU) + TITLE:=Log panic/oops to an MTD buffer + KCONFIG:=CONFIG_MTD_OOPS + FILES:=$(LINUX_DIR)/drivers/mtd/mtdoops.ko +endef + +define KernelPackage/mtdoops/description + Kernel modules for Log panic/oops to an MTD buffer +endef + +$(eval $(call KernelPackage,mtdoops)) + + define KernelPackage/serial-8250 SUBMENU:=$(OTHER_MENU) TITLE:=8250 UARTs @@ -722,6 +693,7 @@ define KernelPackage/zram CONFIG_ZRAM \ CONFIG_ZRAM_DEBUG=n \ CONFIG_PGTABLE_MAPPING=n \ + CONFIG_ZRAM_WRITEBACK=n \ CONFIG_ZSMALLOC_STAT=n \ CONFIG_ZRAM_LZ4_COMPRESS=y FILES:= \ @@ -1044,3 +1016,38 @@ define KernelPackage/w83627hf-wdt/description endef $(eval $(call KernelPackage,w83627hf-wdt)) + + +define KernelPackage/itco-wdt + SUBMENU:=$(OTHER_MENU) + TITLE:=Intel iTCO Watchdog Timer + KCONFIG:=CONFIG_ITCO_WDT \ + CONFIG_ITCO_VENDOR_SUPPORT=y + FILES:=$(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/iTCO_wdt.ko \ + $(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/iTCO_vendor_support.ko + AUTOLOAD:=$(call AutoLoad,50,iTCO_vendor_support iTCO_wdt,1) +endef + +define KernelPackage/itco-wdt/description + Kernel module for Intel iTCO Watchdog Timer +endef + +$(eval $(call KernelPackage,itco-wdt)) + + +define KernelPackage/it87-wdt + SUBMENU:=$(OTHER_MENU) + TITLE:=ITE IT87 Watchdog Timer + KCONFIG:=CONFIG_IT87_WDT + FILES:=$(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/it87_wdt.ko + AUTOLOAD:=$(call AutoLoad,50,it87-wdt,1) + MODPARAMS.it87-wdt:= \ + nogameport=1 \ + nocir=1 +endef + +define KernelPackage/it87-wdt/description + Kernel module for ITE IT87 Watchdog Timer +endef + +$(eval $(call KernelPackage,it87-wdt)) diff --git a/package/kernel/linux/modules/sound.mk b/package/kernel/linux/modules/sound.mk index 75aa3d3fc4..faee1f3674 100644 --- a/package/kernel/linux/modules/sound.mk +++ b/package/kernel/linux/modules/sound.mk @@ -24,7 +24,8 @@ SOUNDCORE_FILES ?= \ $(LINUX_DIR)/sound/soundcore.ko \ $(LINUX_DIR)/sound/core/snd.ko \ $(LINUX_DIR)/sound/core/snd-hwdep.ko \ - $(LINUX_DIR)/sound/core/seq/snd-seq-device.ko \ + $(LINUX_DIR)/sound/core/seq/snd-seq-device.ko@lt4.13 \ + $(LINUX_DIR)/sound/core/snd-seq-device.ko@ge4.13 \ $(LINUX_DIR)/sound/core/snd-rawmidi.ko \ $(LINUX_DIR)/sound/core/snd-timer.ko \ $(LINUX_DIR)/sound/core/snd-pcm.ko \ diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk index ee5b954381..08e3bf699e 100644 --- a/package/kernel/linux/modules/usb.mk +++ b/package/kernel/linux/modules/usb.mk @@ -509,6 +509,7 @@ define KernelPackage/usb-serial-edgeport FILES:=$(LINUX_DIR)/drivers/usb/serial/io_edgeport.ko AUTOLOAD:=$(call AutoProbe,io_edgeport) $(call AddDepends/usb-serial) + DEPENDS+=+edgeport-firmware endef define KernelPackage/usb-serial-edgeport/description @@ -531,14 +532,6 @@ define KernelPackage/usb-serial-edgeport/description Edgeport/16 Dual endef -define KernelPackage/usb-serial-edgeport/install - $(INSTALL_DIR) $(1)/lib/firmware/edgeport - $(INSTALL_DATA) $(LINUX_DIR)/firmware/edgeport/boot.fw $(1)/lib/firmware/edgeport/ - $(INSTALL_DATA) $(LINUX_DIR)/firmware/edgeport/boot2.fw $(1)/lib/firmware/edgeport/ - $(INSTALL_DATA) $(LINUX_DIR)/firmware/edgeport/down.fw $(1)/lib/firmware/edgeport/ - $(INSTALL_DATA) $(LINUX_DIR)/firmware/edgeport/down2.fw $(1)/lib/firmware/edgeport/ -endef - $(eval $(call KernelPackage,usb-serial-edgeport)) @@ -895,6 +888,25 @@ endef $(eval $(call KernelPackage,usb-storage-extras)) +define KernelPackage/usb-storage-uas + SUBMENU:=$(USB_MENU) + TITLE:=USB Attached SCSI (UASP) support + DEPENDS:=+kmod-usb-storage + KCONFIG:=CONFIG_USB_UAS + FILES:=$(LINUX_DIR)/drivers/usb/storage/uas.ko + AUTOLOAD:=$(call AutoProbe,uas,1) +endef + +define KernelPackage/usb-storage-uas/description + Say Y here if you want to include support for + USB Attached SCSI (UAS/UASP), a higher + performance protocol available on many + newer USB 3.0 storage devices +endef + +$(eval $(call KernelPackage,usb-storage-uas)) + + define KernelPackage/usb-atm TITLE:=Support for ATM on USB bus DEPENDS:=+kmod-atm diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk index ef6bd4bc0b..8f0f0dc9e3 100644 --- a/package/kernel/linux/modules/video.mk +++ b/package/kernel/linux/modules/video.mk @@ -81,7 +81,7 @@ $(eval $(call KernelPackage,fb)) define KernelPackage/fbcon SUBMENU:=$(VIDEO_MENU) TITLE:=Framebuffer Console support - DEPENDS:=+kmod-fb + DEPENDS:=+kmod-fb @!LINUX_4_14 KCONFIG:= \ CONFIG_FRAMEBUFFER_CONSOLE \ CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y \ diff --git a/package/kernel/linux/modules/w1.mk b/package/kernel/linux/modules/w1.mk index 15b39207eb..e936a28145 100644 --- a/package/kernel/linux/modules/w1.mk +++ b/package/kernel/linux/modules/w1.mk @@ -14,6 +14,7 @@ define KernelPackage/w1 TITLE:=Dallas's 1-wire support KCONFIG:=CONFIG_W1 FILES:=$(LINUX_DIR)/drivers/w1/wire.ko + DEPENDS:=+LINUX_4_14:kmod-hwmon-core endef define KernelPackage/w1/description diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 7e9b5ad618..cf17c9f4fe 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=2017-10-06 -PKG_RELEASE:=1 +PKG_VERSION:=2017-11-01 +PKG_RELEASE:=2 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources -PKG_HASH:=194786b7635f36b9ce280fd2319f6a4feeff209175e330ddbcbe789a3b4540a5 +PKG_HASH:=8437ab7886b988c8152e7a4db30b7f41009e49a3b2cb863edd05da1ecd7eb05a PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION) @@ -55,6 +55,7 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_PACKAGE_MAC80211_TRACING \ CONFIG_PACKAGE_ATH_DEBUG \ CONFIG_PACKAGE_ATH_DFS \ + CONFIG_PACKAGE_ATH_SPECTRAL \ CONFIG_PACKAGE_B43_DEBUG \ CONFIG_PACKAGE_B43_PIO \ CONFIG_PACKAGE_B43_PHY_G \ @@ -87,7 +88,7 @@ endef define KernelPackage/cfg80211 $(call KernelPackage/mac80211/Default) TITLE:=cfg80211 - wireless configuration API - DEPENDS+= +iw + DEPENDS+= +iw +wireless-regdb FILES:= \ $(PKG_BUILD_DIR)/compat/compat.ko \ $(PKG_BUILD_DIR)/net/wireless/cfg80211.ko @@ -188,6 +189,13 @@ define KernelPackage/ath/config Select this option if you want to use such channels. + config PACKAGE_ATH_SPECTRAL + bool "Atheros spectral scan support" + depends on PACKAGE_ATH_DEBUG + select KERNEL_RELAY + help + Say Y to enable access to the FFT/spectral data via debugfs. + endif endef @@ -222,7 +230,7 @@ define KernelPackage/ath6kl TITLE:=Atheros FullMAC wireless devices (common code for ath6kl_sdio and ath6kl_usb) URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath6kl HIDDEN:=1 - DEPENDS+= +kmod-ath +@DRIVER_11N_SUPPORT +@KERNEL_RELAY + DEPENDS+= +kmod-ath +@DRIVER_11N_SUPPORT FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath6kl/ath6kl_core.ko endef @@ -259,7 +267,7 @@ define KernelPackage/ath9k-common TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc) URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k HIDDEN:=1 - DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT +@KERNEL_RELAY + DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT FILES:= \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko @@ -316,11 +324,11 @@ define KernelPackage/ath10k $(call KernelPackage/mac80211/Default) TITLE:=Atheros 802.11ac wireless cards support URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath10k - DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT +@KERNEL_RELAY + DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT FILES:= \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_pci.ko - AUTOLOAD:=$(call AutoLoad,55,ath10k_core ath10k_pci) + AUTOLOAD:=$(call AutoProbe,ath10k_pci) endef define KernelPackage/ath10k/description @@ -742,6 +750,7 @@ define KernelPackage/brcmfmac/config config BRCMFMAC_SDIO bool "Enable SDIO bus interface support" default y if TARGET_brcm2708 + default y if TARGET_sunxi default n help Enable support for cards attached to an SDIO bus. @@ -1516,7 +1525,6 @@ config-y:= \ WLAN \ NL80211_TESTMODE \ CFG80211_WEXT \ - CFG80211_INTERNAL_REGDB \ CFG80211_CERTIFICATION_ONUS \ MAC80211_RC_MINSTREL \ MAC80211_RC_MINSTREL_HT \ @@ -1568,9 +1576,10 @@ config-$(call config_package,lib80211) += LIB80211 LIB80211_CRYPT_WEP LIB80211_C config-$(call config_package,airo) += AIRO -config-$(call config_package,ath) += ATH_CARDS ATH_COMMON +config-$(call config_package,ath) += ATH_CARDS ATH_COMMON ATH_REG_DYNAMIC_USER_REG_HINTS config-$(CONFIG_PACKAGE_ATH_DEBUG) += ATH_DEBUG ATH10K_DEBUG ATH9K_STATION_STATISTICS config-$(CONFIG_PACKAGE_ATH_DFS) += ATH9K_DFS_CERTIFIED ATH10K_DFS_CERTIFIED +config-$(CONFIG_PACKAGE_ATH_SPECTRAL) += ATH9K_COMMON_SPECTRAL ATH10K_SPECTRAL config-$(call config_package,ath9k) += ATH9K config-$(call config_package,ath9k-common) += ATH9K_COMMON @@ -1742,7 +1751,6 @@ define Build/Prepare $(PKG_BUILD_DIR)/backport-include/linux/bcm47xx_nvram.h echo 'compat-wireless-$(PKG_VERSION)-$(PKG_RELEASE)-$(REVISION)' > $(PKG_BUILD_DIR)/compat_version - $(CP) ./files/regdb.txt $(PKG_BUILD_DIR)/net/wireless/db.txt endef ifneq ($(CONFIG_PACKAGE_kmod-cfg80211)$(CONFIG_PACKAGE_kmod-lib80211),) diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index ebd24df0d3..cdc155405e 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -522,6 +522,12 @@ mac80211_setup_supplicant() { wpa_supplicant_run "$ifname" ${hostapd_ctrl:+-H $hostapd_ctrl} } +mac80211_setup_supplicant_noctl() { + wpa_supplicant_prepare_interface "$ifname" nl80211 || return 1 + wpa_supplicant_add_network "$ifname" "$freq" "$htmode" + wpa_supplicant_run "$ifname" +} + mac80211_setup_adhoc_htmode() { case "$htmode" in VHT20|HT20) ibss_htmode=HT20;; @@ -631,7 +637,8 @@ mac80211_setup_vif() { authsae_start_interface || failed=1 else wireless_vif_parse_encryption - mac80211_setup_supplicant || failed=1 + freq="$(get_freq "$phy" "$channel")" + mac80211_setup_supplicant_noctl || failed=1 fi else json_get_vars mesh_id mcast_rate @@ -688,7 +695,8 @@ mac80211_setup_vif() { wireless_vif_parse_encryption mac80211_setup_adhoc_htmode if [ "$wpa" -gt 0 -o "$auto_channel" -gt 0 ]; then - mac80211_setup_supplicant || failed=1 + freq="$(get_freq "$phy" "$channel")" + mac80211_setup_supplicant_noctl || failed=1 else mac80211_setup_adhoc fi diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh deleted file mode 100644 index 2d970a2b31..0000000000 --- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh +++ /dev/null @@ -1,141 +0,0 @@ -#!/bin/sh -append DRIVERS "mac80211" - -lookup_phy() { - [ -n "$phy" ] && { - [ -d /sys/class/ieee80211/$phy ] && return - } - - local devpath - config_get devpath "$device" path - [ -n "$devpath" ] && { - for phy in $(ls /sys/class/ieee80211 2>/dev/null); do - case "$(readlink -f /sys/class/ieee80211/$phy/device)" in - *$devpath) return;; - esac - done - } - - local macaddr="$(config_get "$device" macaddr | tr 'A-Z' 'a-z')" - [ -n "$macaddr" ] && { - for _phy in /sys/class/ieee80211/*; do - [ -e "$_phy" ] || continue - - [ "$macaddr" = "$(cat ${_phy}/macaddress)" ] || continue - phy="${_phy##*/}" - return - done - } - phy= - return -} - -find_mac80211_phy() { - local device="$1" - - config_get phy "$device" phy - lookup_phy - [ -n "$phy" -a -d "/sys/class/ieee80211/$phy" ] || { - echo "PHY for wifi device $1 not found" - return 1 - } - config_set "$device" phy "$phy" - - config_get macaddr "$device" macaddr - [ -z "$macaddr" ] && { - config_set "$device" macaddr "$(cat /sys/class/ieee80211/${phy}/macaddress)" - } - - return 0 -} - -check_mac80211_device() { - config_get phy "$1" phy - [ -z "$phy" ] && { - find_mac80211_phy "$1" >/dev/null || return 0 - config_get phy "$1" phy - } - [ "$phy" = "$dev" ] && found=1 -} - -detect_mac80211() { - devidx=0 - config_load wireless - while :; do - config_get type "radio$devidx" type - [ -n "$type" ] || break - devidx=$(($devidx + 1)) - done - - for _dev in /sys/class/ieee80211/*; do - [ -e "$_dev" ] || continue - - dev="${_dev##*/}" - - found=0 - config_foreach check_mac80211_device wifi-device - [ "$found" -gt 0 ] && continue - - mode_band="g" - channel="11" - htmode="" - ht_capab="" - - iw phy "$dev" info | grep -q 'Capabilities:' && htmode=HT20 - iw phy "$dev" info | grep -q '2412 MHz' || { mode_band="a"; channel="36"; } - - vht_cap=$(iw phy "$dev" info | grep -c 'VHT Capabilities') - cap_5ghz=$(iw phy "$dev" info | grep -c "Band 2") - [ "$vht_cap" -gt 0 -a "$cap_5ghz" -gt 0 ] && { - mode_band="a"; - channel="36" - htmode="VHT80" - } - - [ -n "$htmode" ] && ht_capab="set wireless.radio${devidx}.htmode=$htmode" - - if [ -x /usr/bin/readlink -a -h /sys/class/ieee80211/${dev} ]; then - path="$(readlink -f /sys/class/ieee80211/${dev}/device)" - else - path="" - fi - if [ -n "$path" ]; then - path="${path##/sys/devices/}" - case "$path" in - platform*/pci*) path="${path##platform/}";; - esac - dev_id="set wireless.radio${devidx}.path='$path'" - else - dev_id="set wireless.radio${devidx}.macaddr=$(cat /sys/class/ieee80211/${dev}/macaddress)" - fi - - if [ $mode_band == "a" ]; then - ssid_5g="_5G" - else - ssid_5g="_2.4G" - fi - [ -f /lib/03_set_wifi_mac ] && ./lib/03_set_wifi_mac - Mac=`cat /sys/class/ieee80211/${dev}/macaddress|awk -F ":" '{print $4""$5""$6 }'| tr a-z A-Z` - Wifi_name="LEDE${ssid_5g}_${Mac}" - - uci -q batch <<-EOF - set wireless.radio${devidx}=wifi-device - set wireless.radio${devidx}.type=mac80211 - set wireless.radio${devidx}.channel=${channel} - set wireless.radio${devidx}.hwmode=11${mode_band} - ${dev_id} - ${ht_capab} - set wireless.radio${devidx}.noscan=1 - set wireless.radio${devidx}.disabled=0 - set wireless.default_radio${devidx}=wifi-iface - set wireless.default_radio${devidx}.device=radio${devidx} - set wireless.default_radio${devidx}.network=lan - set wireless.default_radio${devidx}.mode=ap - set wireless.default_radio${devidx}.ssid=${Wifi_name} - set wireless.default_radio${devidx}.encryption=none -EOF - uci -q commit wireless - - devidx=$(($devidx + 1)) - done -} diff --git a/package/kernel/mac80211/files/regdb.txt b/package/kernel/mac80211/files/regdb.txt deleted file mode 100644 index d583887602..0000000000 --- a/package/kernel/mac80211/files/regdb.txt +++ /dev/null @@ -1,1314 +0,0 @@ -# This is the world regulatory domain -country 00: - (2402 - 2472 @ 40), (20) - # Channel 12 - 13. - (2457 - 2482 @ 20), (20), NO-IR, AUTO-BW - # Channel 14. Only JP enables this and for 802.11b only - (2474 - 2494 @ 20), (20), NO-IR, NO-OFDM - # Channel 36 - 48 - (5170 - 5250 @ 80), (20), AUTO-BW - # Channel 52 - 64 - (5250 - 5330 @ 80), (20), NO-IR, DFS, AUTO-BW - # Channel 100 - 144 - (5490 - 5730 @ 160), (20), NO-IR, DFS - # Channel 149 - 165 - (5735 - 5835 @ 80), (20), NO-IR - # IEEE 802.11ad (60GHz), channels 1..3 - (57240 - 63720 @ 2160), (0) - - -country AD: - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20) - (5250 - 5330 @ 80), (20), DFS - (5490 - 5710 @ 80), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country AE: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country AF: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -# Source: -# http://pucanguilla.org/Downloads/January2005-Anguilla%20Table%20of%20Allocations.pdf -country AI: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country AL: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20.00), AUTO-BW - (5250 - 5330 @ 80), (20.00), DFS, AUTO-BW - (5490 - 5710 @ 160), (27.00), DFS - -country AM: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 20), (18) - (5250 - 5330 @ 20), (18), DFS - -country AN: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country AR: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country AS: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country AT: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -# Source: -# https://www.legislation.gov.au/Details/F2016C00432 -# Both DFS-ETSI and DFS-FCC are acceptable per AS/NZS 4268 Appendix B. -# The EIRP for DFS bands can be increased by 3dB if TPC is implemented. -# In order to allow 80MHz operation between 5650-5730MHz the upper boundary -# of this more restrictive band has been shifted up by 5MHz from 5725MHz. -country AU: DFS-ETSI - (2400 - 2483.5 @ 40), (36) - (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW - (5250 - 5350 @ 80), (20), NO-OUTDOOR, AUTO-BW, DFS - (5470 - 5600 @ 80), (27), DFS - (5650 - 5730 @ 80), (27), DFS - (5730 - 5850 @ 80), (36) - (57000 - 66000 @ 2160), (43), NO-OUTDOOR - -country AW: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country AZ: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (18), AUTO-BW - (5250 - 5330 @ 80), (18), DFS, AUTO-BW - -country BA: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country BB: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (23), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5735 - 5835 @ 80), (30) - -country BD: DFS-JP - (2402 - 2482 @ 40), (20) - (5735 - 5835 @ 80), (30) - -country BE: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country BF: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -# Bulgarian rules as defined by the Communications Regulation Commission in the -# following documents: -# -# Rules for carrying out electronic communications through radio equipment using -# radio spectrum, which does not need to be individually assigned (the Rules): -# http://www.crc.bg/files/_bg/Pravila_09_06_2015.pdf -# -# List of radio equipment that uses harmonized within the European Union bands -# and electronic communications terminal equipment (the List): -# http://www.crc.bg/files/_bg/Spisak_2015.pdf -# -# Note: The transmit power limits in the 5250-5350 MHz and 5470-5725 MHz bands -# can be raised by 3 dBm if TPC is enabled. Refer to BDS EN 301 893 for details. -country BG: DFS-ETSI - # Wideband data transmission systems (WDTS) in the 2.4GHz ISM band, ref: - # I.22 of the List, BDS EN 300 328 - (2402 - 2482 @ 40), (20) - # 5 GHz Radio Local Area Networks (RLANs), ref: - # II.H01 of the List, BDS EN 301 893 - (5170 - 5250 @ 80), (23), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - # II.H01 of the List, I.54 from the List, BDS EN 301 893 - (5490 - 5710 @ 160), (27), DFS - # Short range devices (SRDs) in the 5725-5875 MHz frequency range, ref: - # I.43 of the List, BDS EN 300 440-2, BDS EN 300 440-1 - (5725 - 5875 @ 80), (14) - # 60 GHz Multiple-Gigabit RLAN Systems, ref: - # II.H03 of the List, BDS EN 302 567-2 - (57000 - 66000 @ 2160), (40), NO-OUTDOOR - -country BH: DFS-JP - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 20), (20) - (5250 - 5330 @ 20), (20), DFS - (5735 - 5835 @ 20), (20) - -country BL: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country BM: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country BN: DFS-JP - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5735 - 5835 @ 80), (20) - -country BO: DFS-JP - (2402 - 2482 @ 40), (20) - (5250 - 5330 @ 80), (30), DFS - (5735 - 5835 @ 80), (30) - -country BR: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country BS: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -# Source: -# http://www.bicma.gov.bt/paper/publication/nrrpart4.pdf -country BT: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country BY: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country BZ: DFS-JP - (2402 - 2482 @ 40), (30) - (5735 - 5835 @ 80), (30) - -country CA: DFS-FCC - (2402 - 2472 @ 40), (30) - (5150 - 5250 @ 80), (23), AUTO-BW - (5250 - 5350 @ 80), (24), DFS, AUTO-BW - (5470 - 5600 @ 80), (24), DFS - (5650 - 5730 @ 80), (24), DFS - (5735 - 5835 @ 80), (30) - -# Source: -# http://www.art-rca.org -country CF: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 40), (17) - (5250 - 5330 @ 40), (24), DFS - (5490 - 5730 @ 40), (24), DFS - (5735 - 5835 @ 40), (30) - -country CH: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country CI: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country CL: DFS-JP - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5735 - 5835 @ 80), (20) - -country CN: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (23), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5735 - 5835 @ 80), (30) - # 60 GHz band channels 1,4: 28dBm, channels 2,3: 44dBm - # ref: http://www.miit.gov.cn/n11293472/n11505629/n11506593/n11960250/n11960606/n11960700/n12330791.files/n12330790.pdf - (57240 - 59400 @ 2160), (28) - (59400 - 63720 @ 2160), (44) - (63720 - 65880 @ 2160), (28) - -country CO: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country CR: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 20), (17) - (5250 - 5330 @ 20), (24), DFS - (5490 - 5730 @ 20), (24), DFS - (5735 - 5835 @ 20), (30) - -# http://www.mincom.gob.cu/?q=marcoregulatorio -# - Redes Informáticas -# Resolución 127, 2011 - Reglamento Banda 2,4 GHz. -country CU: DFS-FCC - (2400 - 2483.5 @ 40), (200 mW) - -country CX: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country CY: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -# Data from http://www.ctu.eu/164/download/VOR/VOR-12-08-2005-34.pdf -# and http://www.ctu.eu/164/download/VOR/VOR-12-05-2007-6-AN.pdf -# Power at 5250 - 5350 MHz and 5470 - 5725 MHz can be doubled if TPC is -# implemented. -country CZ: DFS-ETSI - (2400 - 2483.5 @ 40), (100 mW) - (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW - (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW - (5470 - 5725 @ 160), (500 mW), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -# Allocation for the 2.4 GHz band (Vfg 10 / 2013, Allgemeinzuteilung von -# Frequenzen für die Nutzung in lokalen Netzwerken; Wireless Local Area -# Networks (WLAN-Funkanwendungen). -# https://www.bundesnetzagentur.de/SharedDocs/Downloads/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Frequenzen/Allgemeinzuteilungen/2013_10_WLAN_2,4GHz_pdf.pdf -# -# Allocation for the 5 GHz band (Vfg. 7 / 2010, Allgemeinzuteilung von -# Frequenzen in den Bereichen 5150 MHz - 5350 MHz und 5470 MHz - 5725 MHz für -# Funkanwendungen zur breitbandigen Datenübertragung, WAS/WLAN („Wireless -# Access Systems including Wireless Local Area Networks“). -# https://www.bundesnetzagentur.de/SharedDocs/Downloads/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Frequenzen/Allgemeinzuteilungen/2010_07_WLAN_5GHz_pdf.pdf -# The values for the 5 GHz have been reduced by a factor of 2 (3db) for non TPC -# devices (in other words: devices with TPC can use twice the tx power of this -# table). Note that the docs do not require TPC for 5150--5250; the reduction -# to 100mW thus is not strictly required -- however the conservative 100mW -# limit is used here as the non-interference with radar and satellite -# apps relies on the attenuation by the building walls only in the -# absence of DFS; the neighbour countries have 100mW limit here as well. -# -# The ETSI EN 300 440-1 standard for short range devices in the 5 GHz band has -# been implemented in Germany: -# https://www.bundesnetzagentur.de/SharedDocs/Downloads/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Frequenzen/Allgemeinzuteilungen/2014_69_SRD_pdf.pdf -# -# Allocation for the 60 GHz band (Allgemeinzuteilung von Frequenzen im -# Bereich 57 GHz - 66 GHz für Funkanwendungen für weitbandige -# Datenübertragungssysteme; „Multiple Gigabit WAS/RLAN Systems (MGWS)“). -# https://www.bundesnetzagentur.de/SharedDocs/Downloads/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Frequenzen/Allgemeinzuteilungen/2011_08_MGWS_pdf.pdf - -country DE: DFS-ETSI - (2400 - 2483.5 @ 40), (100 mW) - (5150 - 5250 @ 80), (100 mW), NO-OUTDOOR, AUTO-BW - (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW - (5470 - 5725 @ 160), (500 mW), DFS - # short range devices (ETSI EN 300 440-1) - (5725 - 5875 @ 80), (25 mW) - # 60 GHz band channels 1-4 (ETSI EN 302 567) - (57000 - 66000 @ 2160), (40) - -country DK: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -# Source: -# http://www.ntrcdom.org/index.php?option=com_content&view=category&layout=blog&id=10&Itemid=55 -country DM: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5735 - 5835 @ 80), (30) - -country DO: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5735 - 5835 @ 80), (30) - -country DZ: DFS-JP - (2402 - 2482 @ 40), (20) - (5170.000 - 5250.000 @ 80.000), (23.00), AUTO-BW - (5250.000 - 5330.000 @ 80.000), (23.00), DFS, AUTO-BW - (5490.000 - 5670.000 @ 160.000), (23.00), DFS - -country EC: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 20), (17) - (5250 - 5330 @ 20), (24), DFS - (5490 - 5730 @ 20), (24), DFS - (5735 - 5835 @ 20), (30) - -country EE: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country EG: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 40), (20) - (5250 - 5330 @ 40), (20), DFS - -# Orden IET/787/2013, de 25 de abril, por la que se aprueba -# el cuadro nacional de atribución de frecuencias. -# http://www.boe.es/diario_boe/txt.php?id=BOE-A-2013-4845 -# -# more info at "Cuadro nacional de atribución de frecuencias (CNAF)": -# http://www.minetur.gob.es/telecomunicaciones/espectro/paginas/cnaf.aspx - -country ES: DFS-ETSI - (2400 - 2483.5 @ 40), (100 mW) - (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW - (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW - (5470 - 5725 @ 160), (500 mW), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country ET: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country FI: DFS-ETSI - (2400 - 2483.5 @ 40), (20) - (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW - (5250 - 5350 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW - (5470 - 5725 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country FM: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country FR: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country GB: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country GD: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country GE: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (18), AUTO-BW - (5250 - 5330 @ 80), (18), DFS, AUTO-BW - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country GF: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country GH: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country GL: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country GP: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country GR: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country GT: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5735 - 5835 @ 80), (30) - -country GU: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 20), (17) - (5250 - 5330 @ 20), (24), DFS - (5490 - 5730 @ 20), (24), DFS - (5735 - 5835 @ 20), (30) - -country GY: - (2402 - 2482 @ 40), (30) - (5735 - 5835 @ 80), (30) - -country HK: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5710 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country HN: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country HR: DFS-ETSI - (2400 - 2483.5 @ 40), (20) - (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW - (5250 - 5350 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW - (5470 - 5725 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country HT: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country HU: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country ID: DFS-JP - # ref: http://www.postel.go.id/content/ID/regulasi/standardisasi/kepdir/bwa%205,8%20ghz.pdf - (2402 - 2482 @ 20), (20) - (5735 - 5815 @ 20), (23) - -country IE: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country IL: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW - (5250 - 5350 @ 80), (200 mW), NO-OUTDOOR, DFS, AUTO-BW - -country IN: - (2402 - 2482 @ 40), (20) - (5150 - 5350 @ 160), (23) - (5725 - 5875 @ 80), (23) - -country IR: DFS-JP - (2402 - 2482 @ 40), (20) - (5735 - 5835 @ 80), (30) - -country IS: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country IT: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country JM: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country JO: DFS-JP - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (23) - (5735 - 5835 @ 80), (23) - -country JP: DFS-JP - (2402 - 2482 @ 40), (20) - (2474 - 2494 @ 20), (20), NO-OFDM - (4910 - 4990 @ 40), (23) - (5030 - 5090 @ 40), (23) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (23), DFS - # 60 GHz band channels 2-4 at 10mW, - # ref: http://www.arib.or.jp/english/html/overview/doc/1-STD-T74v1_1.pdf - (59000 - 66000 @ 2160), (10 mW) - -country KE: DFS-JP - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (23) - (5490 - 5570 @ 80), (30), DFS - (5735 - 5775 @ 40), (23) - -country KH: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -# Source -# http://ntrc.kn/?page_id=7 -country KN: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (30), DFS - (5735 - 5815 @ 80), (30) - -country KP: DFS-JP - (2402 - 2482 @ 20), (20) - (5170 - 5250 @ 20), (20) - (5250 - 5330 @ 20), (20), DFS - (5490 - 5630 @ 20), (30), DFS - (5735 - 5815 @ 20), (30) - -country KR: DFS-JP - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (30), DFS - (5735 - 5835 @ 80), (30) - # 60 GHz band channels 1-4, - # ref: http://www.law.go.kr/%ED%96%89%EC%A0%95%EA%B7%9C%EC%B9%99/%EB%AC%B4%EC%84%A0%EC%84%A4%EB%B9%84%EA%B7%9C%EC%B9%99 - (57000 - 66000 @ 2160), (43) - -country KW: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - -country KY: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country KZ: - (2402 - 2482 @ 40), (20) - -country LB: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -# Source: -# http://www.ntrc.org.lc/operational_structures.htm -country LC: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (30), DFS - (5735 - 5815 @ 80), (30) - -country LI: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country LK: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 20), (17) - (5250 - 5330 @ 20), (24), DFS - (5490 - 5730 @ 20), (24), DFS - (5735 - 5835 @ 20), (30) - -# Source: -# http://lca.org.ls/images/documents/lesotho_national_frequency_allocation_plan.pdf -country LS: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country LT: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country LU: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country LV: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country MA: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - -country MC: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -# Source: -# http://www.cnfr.md/index.php?pag=sec&id=117&l=en -country MD: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -# Source: -# http://www.cept.org/files/1050/Tools%20and%20Services/EFIS%20-%20ECO%20Frequency%20Information%20System/National%20frequency%20tables/Montenegro%20NAFT%20-%202010.pdf -country ME: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country MF: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country MH: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country MK: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country MN: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country MO: DFS-FCC - (2402 - 2482 @ 40), (23) - (5170 - 5250 @ 80), (23), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5490 - 5730 @ 160), (30), DFS - (5735 - 5835 @ 80), (30) - -country MP: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country MQ: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -# Source: -# http://www.are.mr/pdfs/telec_freq_TNAbf_2010.pdf -country MR: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country MT: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country MU: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -# Source: -# http://www.cam.gov.mv/docs/tech_standards/TAM-TS-100-2004-WLAN.pdf -country MV: DFS-ETSI - (2400 - 2483.5 @ 40), (100 mW) - (5150 - 5250 @ 80), (200 mW), AUTO-BW - (5250 - 5350 @ 80), (100 mW), DFS, AUTO-BW - (5725 - 5850 @ 80), (100 mW) - -country MW: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country MX: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country MY: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5650 @ 160), (24), DFS - (5735 - 5835 @ 80), (24) - -country NG: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5250 - 5330 @ 80), (30), DFS - (5735 - 5835 @ 80), (30) - -country NI: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -# Regulation on the use of frequency space without a license and -# without notification 2015 -# -# http://wetten.overheid.nl/BWBR0036378/2015-03-05 - -country NL: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), NO-OUTDOOR, AUTO-BW - (5250 - 5330 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # short range devices (ETSI EN 300 440-1) - (5725 - 5875 @ 80), (25 mW) - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -# Data from http://www.lovdata.no/dokument/SF/forskrift/2012-01-19-77 -# Power at 5250 - 5350 MHz, 5470 - 5725 MHz and 5815 – 5850 MHz can -# be doubled if TPC is implemented. -# Up to 2W (or 4W with TPC) is allowed in the 5725 – 5795 MHz band -# which has been merged with 5470 - 5725 MHz to allow wide channels -country NO: DFS-ETSI - (2400 - 2483.5 @ 40), (100 mW) - (5150 - 5250 @ 80), (200 mW), AUTO-BW - (5250 - 5350 @ 80), (100 mW), DFS, AUTO-BW - (5470 - 5795 @ 160), (500 mW), DFS - (5815 - 5850 @ 35), (2000 mW), DFS - (17100 - 17300 @ 200), (100 mW) - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country NP: DFS-JP - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5735 - 5835 @ 80), (20) - -country NZ: DFS-ETSI - (2402 - 2482 @ 40), (30) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country OM: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country PA: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5735 - 5835 @ 80), (30) - -country PE: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country PF: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country PG: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country PH: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country PK: DFS-JP - (2402 - 2482 @ 40), (20) - (5735 - 5835 @ 80), (30) - -country PL: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country PM: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country PR: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country PT: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country PW: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country PY: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country QA: DFS-JP - (2402 - 2482 @ 40), (20) - (5735 - 5835 @ 80), (30) - -country RE: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country RO: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - -# Source: -# http://www.ratel.rs/upload/documents/Plan_namene/Plan_namene-sl_glasnik.pdf -country RS: DFS-ETSI - (2400 - 2483.5 @ 40), (100 mW) - (5150 - 5350 @ 40), (200 mW), NO-OUTDOOR - (5470 - 5725 @ 20), (1000 mW), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country RU: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5650 - 5730 @ 80), (30), DFS - (5735 - 5835 @ 80), (30) - # 60 GHz band channels 1-4, ref: Changes to NLA 124_Order №129_22042015.pdf - (57000 - 66000 @ 2160), (40) - -country RW: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country SA: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country SE: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country SG: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country SI: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country SK: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -# Source: -# Regulation N° 2004-005 ART/DG/DRC/D.Rég -country SN: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country SR: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country SV: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 20), (17) - (5250 - 5330 @ 20), (23), DFS - (5735 - 5835 @ 20), (30) - -country SY: - (2402 - 2482 @ 40), (20) - -# Source: -# http://www.telecommission.tc/Spectrum-plan20110324-101210.html -country TC: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country TD: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country TG: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 40), (20) - (5250 - 5330 @ 40), (20), DFS - (5490 - 5710 @ 40), (27), DFS - -country TH: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country TN: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - -country TR: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country TT: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -# Source: -# Table of Frequency Allocations of Republic of China (Taiwan) / Nov 2014: -# http://www.motc.gov.tw/websitedowndoc?file=post/201411171137330.doc& \ -# filedisplay=Table+of+radio+frequency+allocation.doc -# LP0002 Low-power Radio-frequency Devices Technical Regulations / 28 Jun 2011: -# http://www.ncc.gov.tw/english/show_file.aspx?table_name=news&file_sn=681 -# (section 3.10.1, 4.7) -country TW: DFS-FCC - (2400 - 2483.5 @ 40), (30) - # Follow US 5.15 ~ 5.25 GHz: 30 dBm for master mode, 23 dBm for clients - (5150 - 5250 @ 80), (23), AUTO-BW - (5250 - 5350 @ 80), (23), DFS, AUTO-BW - (5470 - 5725 @ 160), (23), DFS - (5725 - 5850 @ 80), (30) - -country TZ: - (2402 - 2482 @ 40), (20) - (5735 - 5835 @ 80), (30) - -# Source: -# #914 / 06 Sep 2007: http://www.ucrf.gov.ua/uk/doc/nkrz/1196068874 -# #1174 / 23 Oct 2008: http://www.nkrz.gov.ua/uk/activities/ruling/1225269361 -# (appendix 8) -# Listed 5GHz range is a lowest common denominator for all related -# rules in the referenced laws. Such a range is used because of -# disputable definitions there. -country UA: DFS-ETSI - (2400 - 2483.5 @ 40), (20), NO-OUTDOOR - (5150 - 5250 @ 80), (20), NO-OUTDOOR, AUTO-BW - (5250 - 5350 @ 80), (20), DFS, NO-OUTDOOR, AUTO-BW - (5490 - 5670 @ 160), (20), DFS - (5735 - 5835 @ 80), (20) - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country UG: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country US: DFS-FCC - (2402 - 2472 @ 40), (30) - # 5.15 ~ 5.25 GHz: 30 dBm for master mode, 23 dBm for clients - (5170 - 5250 @ 80), (23), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5490 - 5730 @ 160), (23), DFS - (5735 - 5835 @ 80), (30) - # 60g band - # reference: http://cfr.regstoday.com/47cfr15.aspx#47_CFR_15p255 - # channels 1,2,3, EIRP=40dBm(43dBm peak) - (57240 - 63720 @ 2160), (40) - -country UY: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (23), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5735 - 5835 @ 80), (30) - -# Source: -# http://cemc.uz/article/1976/ -country UZ: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - -# Source: -# http://www.ntrc.vc/regulations/Jun_2006_Spectrum_Managment_Regulations.pdf -country VC: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -# Source: -# Official Gazette (Gaceta Oficial) concerning Unlicensed transmitter use -# (10 June 2013) -# http://www.conatel.gob.ve/ -country VE: DFS-FCC - (2402 - 2482 @ 40), (30) - (5170 - 5250 @ 80), (23), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5735 - 5835 @ 80), (30) - -country VI: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country VN: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17) - (5250 - 5330 @ 80), (24), DFS - (5490 - 5730 @ 80), (24), DFS - (5735 - 5835 @ 80), (30) - -# Source: -# http://www.trr.vu/attachments/category/130/GURL_for_Short-range_Radiocommunication_Devices2.pdf -country VU: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country WF: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country WS: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 40), (20) - (5250 - 5330 @ 40), (20), DFS - (5490 - 5710 @ 40), (27), DFS - -country YE: - (2402 - 2482 @ 40), (20) - -country YT: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country ZA: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (30) - -country ZW: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - diff --git a/package/kernel/mac80211/patches/005-revert-devcoredump.patch b/package/kernel/mac80211/patches/005-revert-devcoredump.patch index 1216b99574..d485d95586 100644 --- a/package/kernel/mac80211/patches/005-revert-devcoredump.patch +++ b/package/kernel/mac80211/patches/005-revert-devcoredump.patch @@ -1,11 +1,11 @@ --- a/compat/Makefile +++ b/compat/Makefile -@@ -39,8 +39,6 @@ compat-$(CPTCFG_KERNEL_4_10) += backport - - compat-$(CPTCFG_BPAUTO_BUILD_CRYPTO_CCM) += crypto-ccm.o - compat-$(CPTCFG_BPAUTO_CRYPTO_SKCIPHER) += crypto-skcipher.o +@@ -70,8 +70,6 @@ quiet_cmd_build_OID_registry = GEN $ + cmd_build_OID_registry = perl $(src)/build_OID_registry $< $@ + compat-$(CPTCFG_BPAUTO_ASN1_DECODER) += lib-asn1_decoder.o + compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += lib-oid_registry.o -skcipher-objs += crypto-skcipher.o -obj-$(CPTCFG_BPAUTO_CRYPTO_SKCIPHER) += skcipher.o - compat-$(CPTCFG_BPAUTO_BUILD_WANT_DEV_COREDUMP) += drivers-base-devcoredump.o compat-$(CPTCFG_BPAUTO_RHASHTABLE) += lib-rhashtable.o cordic-objs += lib-cordic.o + obj-$(CPTCFG_BPAUTO_BUILD_CORDIC) += cordic.o diff --git a/package/kernel/mac80211/patches/006-fix-genl-multicast.patch b/package/kernel/mac80211/patches/006-fix-genl-multicast.patch new file mode 100644 index 0000000000..42fd3e8271 --- /dev/null +++ b/package/kernel/mac80211/patches/006-fix-genl-multicast.patch @@ -0,0 +1,10 @@ +--- a/compat/backport-4.12.c ++++ b/compat/backport-4.12.c +@@ -225,6 +225,7 @@ int bp_extack_genl_register_family(struc + + /* copy this since the family might access it directly */ + family->attrbuf = copy->family.attrbuf; ++ family->mcgrp_offset = copy->family.mcgrp_offset; + + mutex_lock(&copies_mutex); + list_add_tail(©->list, &copies_list); diff --git a/package/kernel/mac80211/patches/007-fix-linux-verification-h.patch b/package/kernel/mac80211/patches/007-fix-linux-verification-h.patch new file mode 100644 index 0000000000..4011f1d3ba --- /dev/null +++ b/package/kernel/mac80211/patches/007-fix-linux-verification-h.patch @@ -0,0 +1,11 @@ +--- a/backport-include/linux/verification.h ++++ b/backport-include/linux/verification.h +@@ -1,7 +1,7 @@ + #ifndef __BP_VERIFICATION_H + #define __BP_VERIFICATION_H + #include +-#ifndef CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION ++#if LINUX_VERSION_IS_GEQ(4,7,0) && !defined(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) + #include_next + #else + #include diff --git a/package/kernel/mac80211/patches/008-fix-genl-family-id.patch b/package/kernel/mac80211/patches/008-fix-genl-family-id.patch new file mode 100644 index 0000000000..ee8fa6c2bc --- /dev/null +++ b/package/kernel/mac80211/patches/008-fix-genl-family-id.patch @@ -0,0 +1,10 @@ +--- a/compat/backport-4.12.c ++++ b/compat/backport-4.12.c +@@ -224,6 +224,7 @@ int bp_extack_genl_register_family(struc + } + + /* copy this since the family might access it directly */ ++ family->id = copy->family.id; + family->attrbuf = copy->family.attrbuf; + family->mcgrp_offset = copy->family.mcgrp_offset; + diff --git a/package/kernel/mac80211/patches/050-lib80211_option.patch b/package/kernel/mac80211/patches/050-lib80211_option.patch index 3fc8c05207..28a0d905b7 100644 --- a/package/kernel/mac80211/patches/050-lib80211_option.patch +++ b/package/kernel/mac80211/patches/050-lib80211_option.patch @@ -1,6 +1,6 @@ --- a/net/wireless/Kconfig +++ b/net/wireless/Kconfig -@@ -171,7 +171,7 @@ config CFG80211_WEXT_EXPORT +@@ -181,7 +181,7 @@ config CFG80211_WEXT_EXPORT wext compatibility symbols to be exported. config LIB80211 @@ -9,7 +9,7 @@ depends on m default n help -@@ -181,15 +181,15 @@ config LIB80211 +@@ -191,15 +191,15 @@ config LIB80211 Drivers should select this themselves if needed. config LIB80211_CRYPT_WEP diff --git a/package/kernel/mac80211/patches/060-no_local_ssb_bcma.patch b/package/kernel/mac80211/patches/060-no_local_ssb_bcma.patch index 1fc52f9ab0..d897b2b40e 100644 --- a/package/kernel/mac80211/patches/060-no_local_ssb_bcma.patch +++ b/package/kernel/mac80211/patches/060-no_local_ssb_bcma.patch @@ -1,6 +1,6 @@ --- a/local-symbols +++ b/local-symbols -@@ -383,45 +383,6 @@ USB_IPHETH= +@@ -388,45 +388,6 @@ USB_IPHETH= USB_SIERRA_NET= USB_VL600= USB_NET_CH9200= @@ -121,7 +121,7 @@ #source "$BACKPORT_DIR/drivers/media/Kconfig" --- a/Makefile.kernel +++ b/Makefile.kernel -@@ -39,8 +39,6 @@ obj-$(CPTCFG_MAC80211) += net/mac80211/ +@@ -42,8 +42,6 @@ obj-$(CPTCFG_MAC80211) += net/mac80211/ obj-$(CPTCFG_WLAN) += drivers/net/wireless/ #obj-$(CPTCFG_BT) += net/bluetooth/ #obj-$(CPTCFG_BT) += drivers/bluetooth/ diff --git a/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch b/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch index 0febc57b3f..aa44149aed 100644 --- a/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch +++ b/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch @@ -1,270 +1,388 @@ ---- a/net/mac80211/Kconfig -+++ b/net/mac80211/Kconfig -@@ -5,8 +5,6 @@ config MAC80211 - depends on CRYPTO - depends on CRYPTO_ARC4 - depends on CRYPTO_AES -- select BPAUTO_CRYPTO_CCM -- depends on CRYPTO_GCM - depends on CRYPTO_CMAC - depends on CRC32 - ---help--- --- a/net/mac80211/Makefile +++ b/net/mac80211/Makefile -@@ -16,9 +16,7 @@ mac80211-y := \ +@@ -6,7 +6,6 @@ mac80211-y := \ + driver-ops.o \ + sta_info.o \ + wep.o \ +- aead_api.o \ + wpa.o \ + scan.o offchannel.o \ + ht.o agg-tx.o agg-rx.o \ +@@ -16,8 +15,8 @@ mac80211-y := \ + rate.o \ michael.o \ tkip.o \ - aes_ccm.o \ -- aes_gcm.o \ ++ aes_ccm.o \ aes_cmac.o \ - aes_gmac.o \ fils_aead.o \ cfg.o \ ethtool.o \ ---- a/net/mac80211/aes_ccm.c -+++ b/net/mac80211/aes_ccm.c -@@ -13,103 +13,132 @@ - #include - #include - #include -+#include - - #include - #include "key.h" - #include "aes_ccm.h" - --int ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, -- u8 *data, size_t data_len, u8 *mic, -- size_t mic_len) -+static void aes_ccm_prepare(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, u8 *s_0, -+ u8 *a, u8 *b) - { +--- a/net/mac80211/aead_api.c ++++ /dev/null +@@ -1,115 +0,0 @@ +-/* +- * Copyright 2003-2004, Instant802 Networks, Inc. +- * Copyright 2005-2006, Devicescape Software, Inc. +- * Copyright 2014-2015, Qualcomm Atheros, Inc. +- * +- * Rewrite: Copyright (C) 2013 Linaro Ltd +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License version 2 as +- * published by the Free Software Foundation. +- */ +- +-#include +-#include +-#include +-#include +-#include +- +-#include "aead_api.h" +- +-int aead_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, size_t aad_len, +- u8 *data, size_t data_len, u8 *mic) +-{ +- size_t mic_len = crypto_aead_authsize(tfm); - struct scatterlist sg[3]; - struct aead_request *aead_req; - int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm); - u8 *__aad; -+ int i; - -- aead_req = kzalloc(reqsize + CCM_AAD_LEN, GFP_ATOMIC); +- +- aead_req = kzalloc(reqsize + aad_len, GFP_ATOMIC); - if (!aead_req) - return -ENOMEM; -+ crypto_cipher_encrypt_one(tfm, b, b_0); - +- - __aad = (u8 *)aead_req + reqsize; -- memcpy(__aad, aad, CCM_AAD_LEN); -+ /* Extra Authenticate-only data (always two AES blocks) */ -+ for (i = 0; i < AES_BLOCK_SIZE; i++) -+ aad[i] ^= b[i]; -+ crypto_cipher_encrypt_one(tfm, b, aad); - +- memcpy(__aad, aad, aad_len); +- - sg_init_table(sg, 3); -- sg_set_buf(&sg[0], &__aad[2], be16_to_cpup((__be16 *)__aad)); +- sg_set_buf(&sg[0], __aad, aad_len); - sg_set_buf(&sg[1], data, data_len); - sg_set_buf(&sg[2], mic, mic_len); -+ aad += AES_BLOCK_SIZE; - +- - aead_request_set_tfm(aead_req, tfm); - aead_request_set_crypt(aead_req, sg, sg, data_len, b_0); - aead_request_set_ad(aead_req, sg[0].length); -+ for (i = 0; i < AES_BLOCK_SIZE; i++) -+ aad[i] ^= b[i]; -+ crypto_cipher_encrypt_one(tfm, a, aad); - +- - crypto_aead_encrypt(aead_req); - kzfree(aead_req); -+ /* Mask out bits from auth-only-b_0 */ -+ b_0[0] &= 0x07; - +- - return 0; -+ /* S_0 is used to encrypt T (= MIC) */ -+ b_0[14] = 0; -+ b_0[15] = 0; -+ crypto_cipher_encrypt_one(tfm, s_0, b_0); - } - --int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, -- u8 *data, size_t data_len, u8 *mic, -- size_t mic_len) -+ -+void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, -+ u8 *data, size_t data_len, u8 *mic, -+ size_t mic_len) - { +-} +- +-int aead_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, size_t aad_len, +- u8 *data, size_t data_len, u8 *mic) +-{ +- size_t mic_len = crypto_aead_authsize(tfm); - struct scatterlist sg[3]; - struct aead_request *aead_req; - int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm); - u8 *__aad; - int err; -+ int i, j, last_len, num_blocks; -+ u8 b[AES_BLOCK_SIZE]; -+ u8 s_0[AES_BLOCK_SIZE]; -+ u8 e[AES_BLOCK_SIZE]; -+ u8 *pos, *cpos; - +- - if (data_len == 0) - return -EINVAL; -+ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); -+ last_len = data_len % AES_BLOCK_SIZE; -+ aes_ccm_prepare(tfm, b_0, aad, s_0, b, b); - -- aead_req = kzalloc(reqsize + CCM_AAD_LEN, GFP_ATOMIC); +- +- aead_req = kzalloc(reqsize + aad_len, GFP_ATOMIC); - if (!aead_req) - return -ENOMEM; -+ /* Process payload blocks */ -+ pos = data; -+ cpos = data; -+ for (j = 1; j <= num_blocks; j++) { -+ int blen = (j == num_blocks && last_len) ? -+ last_len : AES_BLOCK_SIZE; - +- - __aad = (u8 *)aead_req + reqsize; -- memcpy(__aad, aad, CCM_AAD_LEN); -+ /* Authentication followed by encryption */ -+ for (i = 0; i < blen; i++) -+ b[i] ^= pos[i]; -+ crypto_cipher_encrypt_one(tfm, b, b); - +- memcpy(__aad, aad, aad_len); +- - sg_init_table(sg, 3); -- sg_set_buf(&sg[0], &__aad[2], be16_to_cpup((__be16 *)__aad)); +- sg_set_buf(&sg[0], __aad, aad_len); - sg_set_buf(&sg[1], data, data_len); - sg_set_buf(&sg[2], mic, mic_len); -+ b_0[14] = (j >> 8) & 0xff; -+ b_0[15] = j & 0xff; -+ crypto_cipher_encrypt_one(tfm, e, b_0); -+ for (i = 0; i < blen; i++) -+ *cpos++ = *pos++ ^ e[i]; -+ } - +- - aead_request_set_tfm(aead_req, tfm); - aead_request_set_crypt(aead_req, sg, sg, data_len + mic_len, b_0); - aead_request_set_ad(aead_req, sg[0].length); -+ for (i = 0; i < mic_len; i++) -+ mic[i] = b[i] ^ s_0[i]; -+} - +- - err = crypto_aead_decrypt(aead_req); - kzfree(aead_req); -+int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, -+ u8 *data, size_t data_len, u8 *mic, -+ size_t mic_len) -+{ -+ int i, j, last_len, num_blocks; -+ u8 *pos, *cpos; -+ u8 a[AES_BLOCK_SIZE]; -+ u8 b[AES_BLOCK_SIZE]; -+ u8 s_0[AES_BLOCK_SIZE]; - +- - return err; -+ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); -+ last_len = data_len % AES_BLOCK_SIZE; -+ aes_ccm_prepare(tfm, b_0, aad, s_0, a, b); -+ -+ /* Process payload blocks */ -+ cpos = data; -+ pos = data; -+ for (j = 1; j <= num_blocks; j++) { -+ int blen = (j == num_blocks && last_len) ? -+ last_len : AES_BLOCK_SIZE; -+ -+ /* Decryption followed by authentication */ -+ b_0[14] = (j >> 8) & 0xff; -+ b_0[15] = j & 0xff; -+ crypto_cipher_encrypt_one(tfm, b, b_0); -+ for (i = 0; i < blen; i++) { -+ *pos = *cpos++ ^ b[i]; -+ a[i] ^= *pos++; -+ } -+ crypto_cipher_encrypt_one(tfm, a, a); -+ } -+ -+ for (i = 0; i < mic_len; i++) { -+ if ((mic[i] ^ s_0[i]) != a[i]) -+ return -1; -+ } -+ -+ return 0; - } - --struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], -- size_t key_len, -- size_t mic_len) -+struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[], -+ size_t key_len, -+ size_t mic_len) - { +-} +- +-struct crypto_aead * +-aead_key_setup_encrypt(const char *alg, const u8 key[], +- size_t key_len, size_t mic_len) +-{ - struct crypto_aead *tfm; - int err; - -- tfm = crypto_alloc_aead("ccm(aes)", 0, CRYPTO_ALG_ASYNC); +- tfm = crypto_alloc_aead(alg, 0, CRYPTO_ALG_ASYNC); - if (IS_ERR(tfm)) - return tfm; -+ struct crypto_cipher *tfm; - +- - err = crypto_aead_setkey(tfm, key, key_len); - if (err) - goto free_aead; - err = crypto_aead_setauthsize(tfm, mic_len); - if (err) - goto free_aead; -+ tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); -+ if (!IS_ERR(tfm)) -+ crypto_cipher_setkey(tfm, key, key_len); - - return tfm; +- +- return tfm; - -free_aead: - crypto_free_aead(tfm); - return ERR_PTR(err); - } - --void ieee80211_aes_key_free(struct crypto_aead *tfm) -+ -+void ieee80211_aes_key_free(struct crypto_cipher *tfm) - { +-} +- +-void aead_key_free(struct crypto_aead *tfm) +-{ - crypto_free_aead(tfm); -+ crypto_free_cipher(tfm); - } ---- a/net/mac80211/aes_gmac.h -+++ b/net/mac80211/aes_gmac.h -@@ -15,10 +15,22 @@ - #define GMAC_MIC_LEN 16 - #define GMAC_NONCE_LEN 12 +-} +--- a/net/mac80211/aead_api.h ++++ /dev/null +@@ -1,27 +0,0 @@ +-/* +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License version 2 as +- * published by the Free Software Foundation. +- */ +- +-#ifndef _AEAD_API_H +-#define _AEAD_API_H +- +-#include +-#include +- +-struct crypto_aead * +-aead_key_setup_encrypt(const char *alg, const u8 key[], +- size_t key_len, size_t mic_len); +- +-int aead_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +- size_t aad_len, u8 *data, +- size_t data_len, u8 *mic); +- +-int aead_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +- size_t aad_len, u8 *data, +- size_t data_len, u8 *mic); +- +-void aead_key_free(struct crypto_aead *tfm); +- +-#endif /* _AEAD_API_H */ +--- a/net/mac80211/aes_ccm.h ++++ b/net/mac80211/aes_ccm.h +@@ -10,39 +10,17 @@ + #ifndef AES_CCM_H + #define AES_CCM_H --struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[], -- size_t key_len); --int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, -- const u8 *data, size_t data_len, u8 *mic); --void ieee80211_aes_gmac_key_free(struct crypto_aead *tfm); -+static inline struct crypto_aead * -+ieee80211_aes_gmac_key_setup(const u8 key[], size_t key_len) +-#include "aead_api.h" +- +-#define CCM_AAD_LEN 32 +- +-static inline struct crypto_aead * +-ieee80211_aes_key_setup_encrypt(const u8 key[], size_t key_len, size_t mic_len) +-{ +- return aead_key_setup_encrypt("ccm(aes)", key, key_len, mic_len); +-} +- +-static inline int +-ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, +- u8 *b_0, u8 *aad, u8 *data, +- size_t data_len, u8 *mic) +-{ +- return aead_encrypt(tfm, b_0, aad + 2, +- be16_to_cpup((__be16 *)aad), +- data, data_len, mic); +-} +- +-static inline int +-ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, +- u8 *b_0, u8 *aad, u8 *data, +- size_t data_len, u8 *mic) +-{ +- return aead_decrypt(tfm, b_0, aad + 2, +- be16_to_cpup((__be16 *)aad), +- data, data_len, mic); +-} ++#include + +-static inline void ieee80211_aes_key_free(struct crypto_aead *tfm) +-{ +- return aead_key_free(tfm); +-} ++struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[], ++ size_t key_len, ++ size_t mic_len); ++void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic, ++ size_t mic_len); ++int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic, ++ size_t mic_len); ++void ieee80211_aes_key_free(struct crypto_cipher *tfm); + + #endif /* AES_CCM_H */ +--- /dev/null ++++ b/net/mac80211/aes_gcm.c +@@ -0,0 +1,109 @@ ++/* ++ * Copyright 2014-2015, Qualcomm Atheros, Inc. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include "key.h" ++#include "aes_gcm.h" ++ ++int ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic) +{ -+ return NULL; ++ struct scatterlist sg[3]; ++ struct aead_request *aead_req; ++ int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm); ++ u8 *__aad; ++ ++ aead_req = kzalloc(reqsize + GCM_AAD_LEN, GFP_ATOMIC); ++ if (!aead_req) ++ return -ENOMEM; ++ ++ __aad = (u8 *)aead_req + reqsize; ++ memcpy(__aad, aad, GCM_AAD_LEN); ++ ++ sg_init_table(sg, 3); ++ sg_set_buf(&sg[0], &__aad[2], be16_to_cpup((__be16 *)__aad)); ++ sg_set_buf(&sg[1], data, data_len); ++ sg_set_buf(&sg[2], mic, IEEE80211_GCMP_MIC_LEN); ++ ++ aead_request_set_tfm(aead_req, tfm); ++ aead_request_set_crypt(aead_req, sg, sg, data_len, j_0); ++ aead_request_set_ad(aead_req, sg[0].length); ++ ++ crypto_aead_encrypt(aead_req); ++ kzfree(aead_req); ++ return 0; +} + -+static inline int -+ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, -+ const u8 *data, size_t data_len, u8 *mic) ++int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic) +{ -+ return -EOPNOTSUPP; ++ struct scatterlist sg[3]; ++ struct aead_request *aead_req; ++ int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm); ++ u8 *__aad; ++ int err; ++ ++ if (data_len == 0) ++ return -EINVAL; ++ ++ aead_req = kzalloc(reqsize + GCM_AAD_LEN, GFP_ATOMIC); ++ if (!aead_req) ++ return -ENOMEM; ++ ++ __aad = (u8 *)aead_req + reqsize; ++ memcpy(__aad, aad, GCM_AAD_LEN); ++ ++ sg_init_table(sg, 3); ++ sg_set_buf(&sg[0], &__aad[2], be16_to_cpup((__be16 *)__aad)); ++ sg_set_buf(&sg[1], data, data_len); ++ sg_set_buf(&sg[2], mic, IEEE80211_GCMP_MIC_LEN); ++ ++ aead_request_set_tfm(aead_req, tfm); ++ aead_request_set_crypt(aead_req, sg, sg, ++ data_len + IEEE80211_GCMP_MIC_LEN, j_0); ++ aead_request_set_ad(aead_req, sg[0].length); ++ ++ err = crypto_aead_decrypt(aead_req); ++ kzfree(aead_req); ++ ++ return err; +} + ++struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], ++ size_t key_len) ++{ ++ struct crypto_aead *tfm; ++ int err; ++ ++ tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC); ++ if (IS_ERR(tfm)) ++ return tfm; ++ ++ err = crypto_aead_setkey(tfm, key, key_len); ++ if (err) ++ goto free_aead; ++ err = crypto_aead_setauthsize(tfm, IEEE80211_GCMP_MIC_LEN); ++ if (err) ++ goto free_aead; ++ ++ return tfm; ++ ++free_aead: ++ crypto_free_aead(tfm); ++ return ERR_PTR(err); ++} ++ ++void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm) ++{ ++ crypto_free_aead(tfm); ++} +--- a/net/mac80211/aes_gcm.h ++++ b/net/mac80211/aes_gcm.h +@@ -9,38 +9,30 @@ + #ifndef AES_GCM_H + #define AES_GCM_H + +-#include "aead_api.h" +- +-#define GCM_AAD_LEN 32 ++#include + +-static inline int ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, +- u8 *j_0, u8 *aad, u8 *data, +- size_t data_len, u8 *mic) +static inline void -+ieee80211_aes_gmac_key_free(struct crypto_aead *tfm) -+{ -+} ++ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic) + { +- return aead_encrypt(tfm, j_0, aad + 2, +- be16_to_cpup((__be16 *)aad), +- data, data_len, mic); + } - #endif /* AES_GMAC_H */ ---- a/net/mac80211/key.h -+++ b/net/mac80211/key.h -@@ -88,7 +88,7 @@ struct ieee80211_key { - * Management frames. - */ - u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_CCMP_PN_LEN]; -- struct crypto_aead *tfm; -+ struct crypto_cipher *tfm; - u32 replays; /* dot11RSNAStatsCCMPReplays */ - } ccmp; - struct { +-static inline int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, +- u8 *j_0, u8 *aad, u8 *data, +- size_t data_len, u8 *mic) ++static inline int ++ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic) + { +- return aead_decrypt(tfm, j_0, aad + 2, +- be16_to_cpup((__be16 *)aad), +- data, data_len, mic); ++ return -EOPNOTSUPP; + } + + static inline struct crypto_aead * + ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], size_t key_len) + { +- return aead_key_setup_encrypt("gcm(aes)", key, +- key_len, IEEE80211_GCMP_MIC_LEN); ++ return NULL; + } + +-static inline void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm) ++static inline void ++ieee80211_aes_gcm_key_free(struct crypto_aead *tfm) + { +- return aead_key_free(tfm); + } + + #endif /* AES_GCM_H */ --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c @@ -306,7 +306,8 @@ ieee80211_crypto_tkip_decrypt(struct iee @@ -318,7 +436,7 @@ pos += IEEE80211_CCMP_HDR_LEN; - ccmp_special_blocks(skb, pn, b_0, aad); - return ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len, -- skb_put(skb, mic_len), mic_len); +- skb_put(skb, mic_len)); + ccmp_special_blocks(skb, pn, b_0, aad, len); + ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len, + skb_put(skb, mic_len), mic_len); @@ -327,7 +445,7 @@ } -@@ -537,7 +536,7 @@ ieee80211_crypto_ccmp_decrypt(struct iee +@@ -537,13 +536,13 @@ ieee80211_crypto_ccmp_decrypt(struct iee u8 aad[2 * AES_BLOCK_SIZE]; u8 b_0[AES_BLOCK_SIZE]; /* hardware didn't decrypt/verify MIC */ @@ -336,6 +454,13 @@ if (ieee80211_aes_ccm_decrypt( key->u.ccmp.tfm, b_0, aad, + skb->data + hdrlen + IEEE80211_CCMP_HDR_LEN, + data_len, +- skb->data + skb->len - mic_len)) ++ skb->data + skb->len - mic_len, mic_len)) + return RX_DROP_UNUSABLE; + } + @@ -639,7 +638,7 @@ static int gcmp_encrypt_skb(struct ieee8 u8 *pos; u8 pn[6]; @@ -379,70 +504,202 @@ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; if (!ieee80211_is_mgmt(hdr->frame_control)) ---- a/net/mac80211/aes_ccm.h -+++ b/net/mac80211/aes_ccm.h -@@ -12,17 +12,15 @@ - - #include - --#define CCM_AAD_LEN 32 -- --struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], -- size_t key_len, -- size_t mic_len); --int ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, -- u8 *data, size_t data_len, u8 *mic, -- size_t mic_len); --int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, -+struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[], -+ size_t key_len, -+ size_t mic_len); +--- /dev/null ++++ b/net/mac80211/aes_ccm.c +@@ -0,0 +1,144 @@ ++/* ++ * Copyright 2003-2004, Instant802 Networks, Inc. ++ * Copyright 2005-2006, Devicescape Software, Inc. ++ * ++ * Rewrite: Copyright (C) 2013 Linaro Ltd ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include "key.h" ++#include "aes_ccm.h" ++ ++static void aes_ccm_prepare(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, u8 *s_0, ++ u8 *a, u8 *b) ++{ ++ int i; ++ ++ crypto_cipher_encrypt_one(tfm, b, b_0); ++ ++ /* Extra Authenticate-only data (always two AES blocks) */ ++ for (i = 0; i < AES_BLOCK_SIZE; i++) ++ aad[i] ^= b[i]; ++ crypto_cipher_encrypt_one(tfm, b, aad); ++ ++ aad += AES_BLOCK_SIZE; ++ ++ for (i = 0; i < AES_BLOCK_SIZE; i++) ++ aad[i] ^= b[i]; ++ crypto_cipher_encrypt_one(tfm, a, aad); ++ ++ /* Mask out bits from auth-only-b_0 */ ++ b_0[0] &= 0x07; ++ ++ /* S_0 is used to encrypt T (= MIC) */ ++ b_0[14] = 0; ++ b_0[15] = 0; ++ crypto_cipher_encrypt_one(tfm, s_0, b_0); ++} ++ ++ +void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, + u8 *data, size_t data_len, u8 *mic, -+ size_t mic_len); ++ size_t mic_len) ++{ ++ int i, j, last_len, num_blocks; ++ u8 b[AES_BLOCK_SIZE]; ++ u8 s_0[AES_BLOCK_SIZE]; ++ u8 e[AES_BLOCK_SIZE]; ++ u8 *pos, *cpos; ++ ++ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); ++ last_len = data_len % AES_BLOCK_SIZE; ++ aes_ccm_prepare(tfm, b_0, aad, s_0, b, b); ++ ++ /* Process payload blocks */ ++ pos = data; ++ cpos = data; ++ for (j = 1; j <= num_blocks; j++) { ++ int blen = (j == num_blocks && last_len) ? ++ last_len : AES_BLOCK_SIZE; ++ ++ /* Authentication followed by encryption */ ++ for (i = 0; i < blen; i++) ++ b[i] ^= pos[i]; ++ crypto_cipher_encrypt_one(tfm, b, b); ++ ++ b_0[14] = (j >> 8) & 0xff; ++ b_0[15] = j & 0xff; ++ crypto_cipher_encrypt_one(tfm, e, b_0); ++ for (i = 0; i < blen; i++) ++ *cpos++ = *pos++ ^ e[i]; ++ } ++ ++ for (i = 0; i < mic_len; i++) ++ mic[i] = b[i] ^ s_0[i]; ++} ++ +int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, - u8 *data, size_t data_len, u8 *mic, - size_t mic_len); --void ieee80211_aes_key_free(struct crypto_aead *tfm); -+void ieee80211_aes_key_free(struct crypto_cipher *tfm); - - #endif /* AES_CCM_H */ ---- a/net/mac80211/aes_gcm.h -+++ b/net/mac80211/aes_gcm.h -@@ -11,14 +11,28 @@ - - #include - --#define GCM_AAD_LEN 32 -+static inline void -+ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, -+ u8 *data, size_t data_len, u8 *mic) ++ u8 *data, size_t data_len, u8 *mic, ++ size_t mic_len) +{ -+} - --int ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, -- u8 *data, size_t data_len, u8 *mic); --int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, -- u8 *data, size_t data_len, u8 *mic); --struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], -- size_t key_len); --void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm); -+static inline int -+ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, -+ u8 *data, size_t data_len, u8 *mic) -+{ -+ return -EOPNOTSUPP; ++ int i, j, last_len, num_blocks; ++ u8 *pos, *cpos; ++ u8 a[AES_BLOCK_SIZE]; ++ u8 b[AES_BLOCK_SIZE]; ++ u8 s_0[AES_BLOCK_SIZE]; ++ ++ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); ++ last_len = data_len % AES_BLOCK_SIZE; ++ aes_ccm_prepare(tfm, b_0, aad, s_0, a, b); ++ ++ /* Process payload blocks */ ++ cpos = data; ++ pos = data; ++ for (j = 1; j <= num_blocks; j++) { ++ int blen = (j == num_blocks && last_len) ? ++ last_len : AES_BLOCK_SIZE; ++ ++ /* Decryption followed by authentication */ ++ b_0[14] = (j >> 8) & 0xff; ++ b_0[15] = j & 0xff; ++ crypto_cipher_encrypt_one(tfm, b, b_0); ++ for (i = 0; i < blen; i++) { ++ *pos = *cpos++ ^ b[i]; ++ a[i] ^= *pos++; ++ } ++ crypto_cipher_encrypt_one(tfm, a, a); ++ } ++ ++ for (i = 0; i < mic_len; i++) { ++ if ((mic[i] ^ s_0[i]) != a[i]) ++ return -1; ++ } ++ ++ return 0; +} + ++struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[], ++ size_t key_len, ++ size_t mic_len) ++{ ++ struct crypto_cipher *tfm; ++ ++ tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); ++ if (!IS_ERR(tfm)) ++ crypto_cipher_setkey(tfm, key, key_len); ++ ++ return tfm; ++} ++ ++ ++void ieee80211_aes_key_free(struct crypto_cipher *tfm) ++{ ++ crypto_free_cipher(tfm); ++} +--- a/net/mac80211/Kconfig ++++ b/net/mac80211/Kconfig +@@ -5,8 +5,6 @@ config MAC80211 + depends on CRYPTO + depends on CRYPTO_ARC4 + depends on CRYPTO_AES +- depends on CRYPTO_CCM +- depends on CRYPTO_GCM + depends on CRYPTO_CMAC + depends on CRC32 + ---help--- +--- a/net/mac80211/aes_gmac.h ++++ b/net/mac80211/aes_gmac.h +@@ -15,10 +15,22 @@ + #define GMAC_MIC_LEN 16 + #define GMAC_NONCE_LEN 12 + +-struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[], +- size_t key_len); +-int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, +- const u8 *data, size_t data_len, u8 *mic); +-void ieee80211_aes_gmac_key_free(struct crypto_aead *tfm); +static inline struct crypto_aead * -+ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], size_t key_len) ++ieee80211_aes_gmac_key_setup(const u8 key[], size_t key_len) +{ -+ return NULL; ++ return NULL; ++} ++ ++static inline int ++ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, ++ const u8 *data, size_t data_len, u8 *mic) ++{ ++ return -EOPNOTSUPP; +} + +static inline void -+ieee80211_aes_gcm_key_free(struct crypto_aead *tfm) ++ieee80211_aes_gmac_key_free(struct crypto_aead *tfm) +{ +} - #endif /* AES_GCM_H */ + #endif /* AES_GMAC_H */ +--- a/net/mac80211/key.h ++++ b/net/mac80211/key.h +@@ -88,7 +88,7 @@ struct ieee80211_key { + * Management frames. + */ + u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_CCMP_PN_LEN]; +- struct crypto_aead *tfm; ++ struct crypto_cipher *tfm; + u32 replays; /* dot11RSNAStatsCCMPReplays */ + } ccmp; + struct { diff --git a/package/kernel/mac80211/patches/110-mac80211_keep_keys_on_stop_ap.patch b/package/kernel/mac80211/patches/110-mac80211_keep_keys_on_stop_ap.patch index 005e3e5d5d..3b1fcdf9c8 100644 --- a/package/kernel/mac80211/patches/110-mac80211_keep_keys_on_stop_ap.patch +++ b/package/kernel/mac80211/patches/110-mac80211_keep_keys_on_stop_ap.patch @@ -2,7 +2,7 @@ Used for AP+STA support in OpenWrt - preserve AP mode keys across STA reconnects --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -1056,7 +1056,6 @@ static int ieee80211_stop_ap(struct wiph +@@ -1058,7 +1058,6 @@ static int ieee80211_stop_ap(struct wiph sdata->u.ap.driver_smps_mode = IEEE80211_SMPS_OFF; __sta_info_flush(sdata, true); diff --git a/package/kernel/mac80211/patches/140-tweak-TSQ-setting.patch b/package/kernel/mac80211/patches/140-tweak-TSQ-setting.patch new file mode 100644 index 0000000000..6e9a07a927 --- /dev/null +++ b/package/kernel/mac80211/patches/140-tweak-TSQ-setting.patch @@ -0,0 +1,15 @@ +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -3750,6 +3750,12 @@ out: + netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, + struct net_device *dev) + { ++#if defined(sk_pacing_shift) || LINUX_VERSION_IS_GEQ(4,15,0) ++ if (skb->sk && sk_fullsock(skb->sk) && ++ skb->sk->sk_pacing_shift != 6) ++ skb->sk->sk_pacing_shift = 6; ++#endif ++ + if (unlikely(ieee80211_multicast_to_unicast(skb, dev))) { + struct sk_buff_head queue; + diff --git a/package/kernel/mac80211/patches/150-disable_addr_notifier.patch b/package/kernel/mac80211/patches/150-disable_addr_notifier.patch index 42a692a1fc..781dd3c1bc 100644 --- a/package/kernel/mac80211/patches/150-disable_addr_notifier.patch +++ b/package/kernel/mac80211/patches/150-disable_addr_notifier.patch @@ -18,7 +18,7 @@ static int ieee80211_ifa6_changed(struct notifier_block *nb, unsigned long data, void *arg) { -@@ -1115,14 +1115,14 @@ int ieee80211_register_hw(struct ieee802 +@@ -1114,14 +1114,14 @@ int ieee80211_register_hw(struct ieee802 if (result) goto fail_flows; @@ -35,7 +35,7 @@ local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed; result = register_inet6addr_notifier(&local->ifa6_notifier); if (result) -@@ -1131,13 +1131,13 @@ int ieee80211_register_hw(struct ieee802 +@@ -1130,13 +1130,13 @@ int ieee80211_register_hw(struct ieee802 return 0; @@ -52,7 +52,7 @@ fail_ifa: #endif ieee80211_txq_teardown_flows(local); -@@ -1167,10 +1167,10 @@ void ieee80211_unregister_hw(struct ieee +@@ -1166,10 +1166,10 @@ void ieee80211_unregister_hw(struct ieee tasklet_kill(&local->tx_pending_tasklet); tasklet_kill(&local->tasklet); diff --git a/package/kernel/mac80211/patches/210-ap_scan.patch b/package/kernel/mac80211/patches/210-ap_scan.patch index e9999e32b9..8ade963c9f 100644 --- a/package/kernel/mac80211/patches/210-ap_scan.patch +++ b/package/kernel/mac80211/patches/210-ap_scan.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -2212,7 +2212,7 @@ static int ieee80211_scan(struct wiphy * +@@ -2215,7 +2215,7 @@ static int ieee80211_scan(struct wiphy * * the frames sent while scanning on other channel will be * lost) */ diff --git a/package/kernel/mac80211/patches/307-mac80211-add-hdrlen-to-ieee80211_tx_data.patch b/package/kernel/mac80211/patches/307-mac80211-add-hdrlen-to-ieee80211_tx_data.patch index baaca173c7..83c613434d 100644 --- a/package/kernel/mac80211/patches/307-mac80211-add-hdrlen-to-ieee80211_tx_data.patch +++ b/package/kernel/mac80211/patches/307-mac80211-add-hdrlen-to-ieee80211_tx_data.patch @@ -48,7 +48,7 @@ Signed-off-by: Janusz Dziedzic if (likely(sta)) { if (!IS_ERR(sta)) tx->sta = sta; -@@ -3434,6 +3434,7 @@ begin: +@@ -3468,6 +3468,7 @@ begin: tx.local = local; tx.skb = skb; tx.sdata = vif_to_sdata(info->control.vif); @@ -56,7 +56,7 @@ Signed-off-by: Janusz Dziedzic if (txq->sta) tx.sta = container_of(txq->sta, struct sta_info, sta); -@@ -3756,6 +3757,7 @@ ieee80211_build_data_template(struct iee +@@ -3796,6 +3797,7 @@ ieee80211_build_data_template(struct iee hdr = (void *)skb->data; tx.sta = sta_info_get(sdata, hdr->addr1); tx.skb = skb; diff --git a/package/kernel/mac80211/patches/308-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch b/package/kernel/mac80211/patches/308-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch index 762458ba78..a9f01b368d 100644 --- a/package/kernel/mac80211/patches/308-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch +++ b/package/kernel/mac80211/patches/308-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch @@ -23,9 +23,9 @@ Signed-off-by: Janusz Dziedzic --- a/include/net/mac80211.h +++ b/include/net/mac80211.h -@@ -2056,6 +2056,9 @@ struct ieee80211_txq { - * The stack will not do fragmentation. - * The callback for @set_frag_threshold should be set as well. +@@ -2059,6 +2059,9 @@ struct ieee80211_txq { + * @IEEE80211_HW_SUPPORTS_TDLS_BUFFER_STA: Hardware supports buffer STA on + * TDLS links. * + * @IEEE80211_HW_NEEDS_ALIGNED4_SKBS: Driver need aligned skbs to four-byte. + * Padding will be added after ieee80211_hdr, before IV/LLC. @@ -33,27 +33,27 @@ Signed-off-by: Janusz Dziedzic * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays */ enum ieee80211_hw_flags { -@@ -2098,6 +2101,7 @@ enum ieee80211_hw_flags { - IEEE80211_HW_TX_FRAG_LIST, +@@ -2102,6 +2105,7 @@ enum ieee80211_hw_flags { IEEE80211_HW_REPORTS_LOW_ACK, IEEE80211_HW_SUPPORTS_TX_FRAG, + IEEE80211_HW_SUPPORTS_TDLS_BUFFER_STA, + IEEE80211_HW_NEEDS_ALIGNED4_SKBS, /* keep last, obviously */ NUM_IEEE80211_HW_FLAGS --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c -@@ -211,6 +211,7 @@ static const char *hw_flag_names[] = { - FLAG(TX_FRAG_LIST), +@@ -212,6 +212,7 @@ static const char *hw_flag_names[] = { FLAG(REPORTS_LOW_ACK), FLAG(SUPPORTS_TX_FRAG), + FLAG(SUPPORTS_TDLS_BUFFER_STA), + FLAG(NEEDS_ALIGNED4_SKBS), #undef FLAG }; --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -1547,6 +1547,29 @@ ieee80211_vif_get_num_mcast_if(struct ie +@@ -1548,6 +1548,29 @@ ieee80211_vif_get_num_mcast_if(struct ie return -1; } @@ -85,7 +85,7 @@ Signed-off-by: Janusz Dziedzic unsigned int mpdu_len, --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h -@@ -290,7 +290,7 @@ struct ieee80211_fast_tx { +@@ -300,7 +300,7 @@ struct ieee80211_fast_tx { u8 hdr_len; u8 sa_offs, da_offs, pn_offs; u8 band; @@ -147,7 +147,7 @@ Signed-off-by: Janusz Dziedzic if (likely(sta)) { if (!IS_ERR(sta)) -@@ -2150,7 +2149,7 @@ netdev_tx_t ieee80211_monitor_start_xmit +@@ -2184,7 +2183,7 @@ netdev_tx_t ieee80211_monitor_start_xmit goto fail; hdr = (struct ieee80211_hdr *)(skb->data + len_rthdr); @@ -156,7 +156,7 @@ Signed-off-by: Janusz Dziedzic if (skb->len < len_rthdr + hdrlen) goto fail; -@@ -2368,7 +2367,7 @@ static struct sk_buff *ieee80211_build_h +@@ -2402,7 +2401,7 @@ static struct sk_buff *ieee80211_build_h struct ieee80211_chanctx_conf *chanctx_conf; struct ieee80211_sub_if_data *ap_sdata; enum nl80211_band band; @@ -165,7 +165,7 @@ Signed-off-by: Janusz Dziedzic if (IS_ERR(sta)) sta = NULL; -@@ -2588,6 +2587,9 @@ static struct sk_buff *ieee80211_build_h +@@ -2622,6 +2621,9 @@ static struct sk_buff *ieee80211_build_h hdrlen += 2; } @@ -175,7 +175,7 @@ Signed-off-by: Janusz Dziedzic /* * Drop unicast frames to unauthorised stations unless they are * EAPOL frames from the local station. -@@ -2668,6 +2670,7 @@ static struct sk_buff *ieee80211_build_h +@@ -2702,6 +2704,7 @@ static struct sk_buff *ieee80211_build_h skb_pull(skb, skip_header_bytes); head_need = hdrlen + encaps_len + meshhdrlen - skb_headroom(skb); @@ -183,7 +183,7 @@ Signed-off-by: Janusz Dziedzic /* * So we need to modify the skb header and hence need a copy of -@@ -2700,6 +2703,9 @@ static struct sk_buff *ieee80211_build_h +@@ -2734,6 +2737,9 @@ static struct sk_buff *ieee80211_build_h memcpy(skb_push(skb, meshhdrlen), &mesh_hdr, meshhdrlen); #endif @@ -193,7 +193,7 @@ Signed-off-by: Janusz Dziedzic if (ieee80211_is_data_qos(fc)) { __le16 *qos_control; -@@ -2875,6 +2881,9 @@ void ieee80211_check_fast_xmit(struct st +@@ -2909,6 +2915,9 @@ void ieee80211_check_fast_xmit(struct st fc |= cpu_to_le16(IEEE80211_STYPE_QOS_DATA); } @@ -203,7 +203,7 @@ Signed-off-by: Janusz Dziedzic /* We store the key here so there's no point in using rcu_dereference() * but that's fine because the code that changes the pointers will call * this function after doing so. For a single CPU that would be enough, -@@ -3461,7 +3470,7 @@ begin: +@@ -3495,7 +3504,7 @@ begin: if (tx.key && (tx.key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)) diff --git a/package/kernel/mac80211/patches/317-Revert-ath10k-disable-wake_tx_queue-for-older-device.patch b/package/kernel/mac80211/patches/317-Revert-ath10k-disable-wake_tx_queue-for-older-device.patch index 5e18f285ab..56d86c1525 100644 --- a/package/kernel/mac80211/patches/317-Revert-ath10k-disable-wake_tx_queue-for-older-device.patch +++ b/package/kernel/mac80211/patches/317-Revert-ath10k-disable-wake_tx_queue-for-older-device.patch @@ -9,7 +9,7 @@ in the hope that we've fixed all the performance problems now. --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -8286,15 +8286,6 @@ int ath10k_mac_register(struct ath10k *a +@@ -8319,15 +8319,6 @@ int ath10k_mac_register(struct ath10k *a ath10k_warn(ar, "failed to initialise DFS pattern detector\n"); } diff --git a/package/kernel/mac80211/patches/318-ath10k-fix-build-errors-with-CONFIG_PM.patch b/package/kernel/mac80211/patches/318-ath10k-fix-build-errors-with-CONFIG_PM.patch new file mode 100644 index 0000000000..2aeb49dc16 --- /dev/null +++ b/package/kernel/mac80211/patches/318-ath10k-fix-build-errors-with-CONFIG_PM.patch @@ -0,0 +1,72 @@ +From: Brian Norris +Date: Thu, 19 Oct 2017 11:45:19 -0700 +Subject: [PATCH] ath10k: fix build errors with !CONFIG_PM + +Build errors have been reported with CONFIG_PM=n: + +drivers/net/wireless/ath/ath10k/pci.c:3416:8: error: implicit +declaration of function 'ath10k_pci_suspend' +[-Werror=implicit-function-declaration] + +drivers/net/wireless/ath/ath10k/pci.c:3428:8: error: implicit +declaration of function 'ath10k_pci_resume' +[-Werror=implicit-function-declaration] + +These are caused by the combination of the following two commits: + +6af1de2e4ec4 ("ath10k: mark PM functions as __maybe_unused") +96378bd2c6cd ("ath10k: fix core PCI suspend when WoWLAN is supported but +disabled") + +Both build fine on their own. + +But now that ath10k_pci_pm_{suspend,resume}() is compiled +unconditionally, we should also compile ath10k_pci_{suspend,resume}() +unconditionally. + +And drop the #ifdef around ath10k_pci_hif_{suspend,resume}() too; they +are trivial (empty), so we're not saving much space by compiling them +out. And the alternatives would be to sprinkle more __maybe_unused, or +spread the #ifdef's further. + +Build tested with the following combinations: +CONFIG_PM=y && CONFIG_PM_SLEEP=y +CONFIG_PM=y && CONFIG_PM_SLEEP=n +CONFIG_PM=n + +Fixes: 96378bd2c6cd ("ath10k: fix core PCI suspend when WoWLAN is supported but disabled") +Fixes: 096ad2a15fd8 ("Merge branch 'ath-next'") +Signed-off-by: Brian Norris +Signed-off-by: Kalle Valo +--- + +--- a/drivers/net/wireless/ath/ath10k/pci.c ++++ b/drivers/net/wireless/ath/ath10k/pci.c +@@ -2577,8 +2577,6 @@ void ath10k_pci_hif_power_down(struct at + */ + } + +-#ifdef CONFIG_PM +- + static int ath10k_pci_hif_suspend(struct ath10k *ar) + { + /* Nothing to do; the important stuff is in the driver suspend. */ +@@ -2627,7 +2625,6 @@ static int ath10k_pci_resume(struct ath1 + + return ret; + } +-#endif + + static bool ath10k_pci_validate_cal(void *data, size_t size) + { +@@ -2782,10 +2779,8 @@ static const struct ath10k_hif_ops ath10 + .power_down = ath10k_pci_hif_power_down, + .read32 = ath10k_pci_read32, + .write32 = ath10k_pci_write32, +-#ifdef CONFIG_PM + .suspend = ath10k_pci_hif_suspend, + .resume = ath10k_pci_hif_resume, +-#endif + .fetch_cal_eeprom = ath10k_pci_hif_fetch_cal_eeprom, + }; + diff --git a/package/kernel/mac80211/patches/319-ath10k-fix-recent-bandwidth-conversion-bug.patch b/package/kernel/mac80211/patches/319-ath10k-fix-recent-bandwidth-conversion-bug.patch new file mode 100644 index 0000000000..5d5329f27e --- /dev/null +++ b/package/kernel/mac80211/patches/319-ath10k-fix-recent-bandwidth-conversion-bug.patch @@ -0,0 +1,61 @@ +From: Christian Lamparter +Date: Wed, 1 Nov 2017 21:01:57 +0100 +Subject: [PATCH] ath10k: fix recent bandwidth conversion bug + +The commit "cfg80211: make RATE_INFO_BW_20 the default" changed +the index of RATE_INFO_BW_20, but the updates to ath10k missed +the special bandwidth calculation case in +ath10k_update_per_peer_tx_stats(). + +Fixes: 842be75c77cb ("cfg80211: make RATE_INFO_BW_20 the default") +Signed-off-by: Christian Lamparter +Patchwork-Id: 10037035 +Signed-off-by: Kalle Valo +--- + +--- a/drivers/net/wireless/ath/ath10k/htt_rx.c ++++ b/drivers/net/wireless/ath/ath10k/htt_rx.c +@@ -592,6 +592,9 @@ struct amsdu_subframe_hdr { + + #define GROUP_ID_IS_SU_MIMO(x) ((x) == 0 || (x) == 63) + ++static const u8 ath10k_bw_to_mac80211[] = { RATE_INFO_BW_20, RATE_INFO_BW_40, ++ RATE_INFO_BW_80, RATE_INFO_BW_160 }; ++ + static void ath10k_htt_rx_h_rates(struct ath10k *ar, + struct ieee80211_rx_status *status, + struct htt_rx_desc *rxd) +@@ -694,23 +697,7 @@ static void ath10k_htt_rx_h_rates(struct + if (sgi) + status->enc_flags |= RX_ENC_FLAG_SHORT_GI; + +- switch (bw) { +- /* 20MHZ */ +- case 0: +- break; +- /* 40MHZ */ +- case 1: +- status->bw = RATE_INFO_BW_40; +- break; +- /* 80MHZ */ +- case 2: +- status->bw = RATE_INFO_BW_80; +- break; +- case 3: +- status->bw = RATE_INFO_BW_160; +- break; +- } +- ++ status->bw = ath10k_bw_to_mac80211[bw]; + status->encoding = RX_ENC_VHT; + break; + default: +@@ -2297,7 +2284,7 @@ ath10k_update_per_peer_tx_stats(struct a + arsta->txrate.flags |= RATE_INFO_FLAGS_SHORT_GI; + + arsta->txrate.nss = txrate.nss; +- arsta->txrate.bw = txrate.bw + RATE_INFO_BW_20; ++ arsta->txrate.bw = ath10k_bw_to_mac80211[txrate.bw]; + } + + static void ath10k_htt_fetch_peer_stats(struct ath10k *ar, diff --git a/package/kernel/mac80211/patches/320-mac80211-properly-free-requested-but-not-started-TX-.patch b/package/kernel/mac80211/patches/320-mac80211-properly-free-requested-but-not-started-TX-.patch new file mode 100644 index 0000000000..ecc5e49120 --- /dev/null +++ b/package/kernel/mac80211/patches/320-mac80211-properly-free-requested-but-not-started-TX-.patch @@ -0,0 +1,37 @@ +From: Johannes Berg +Date: Mon, 20 Nov 2017 17:01:44 +0100 +Subject: [PATCH] mac80211: properly free requested-but-not-started TX agg + sessions + +When deleting a station or otherwise tearing down all aggregation +sessions, make sure to delete requested but not yet started ones, +to avoid the following scenario: + + * session is requested, added to tid_start_tx[] + * ieee80211_ba_session_work() runs, gets past BLOCK_BA check + * ieee80211_sta_tear_down_BA_sessions() runs, locks &sta->ampdu_mlme.mtx, + e.g. while deleting the station - deleting all active sessions + * ieee80211_ba_session_work() continues since tear down flushes it, and + calls ieee80211_tx_ba_session_handle_start() for the new session, arms + the timer for it + * station deletion continues to __cleanup_single_sta() and frees the + session struct, while the timer is armed + +Reported-by: Fengguang Wu +Signed-off-by: Johannes Berg +--- + +--- a/net/mac80211/agg-tx.c ++++ b/net/mac80211/agg-tx.c +@@ -330,6 +330,11 @@ int ___ieee80211_stop_tx_ba_session(stru + + spin_lock_bh(&sta->lock); + ++ /* free struct pending for start, if present */ ++ tid_tx = sta->ampdu_mlme.tid_start_tx[tid]; ++ kfree(tid_tx); ++ sta->ampdu_mlme.tid_start_tx[tid] = NULL; ++ + tid_tx = rcu_dereference_protected_tid_tx(sta, tid); + if (!tid_tx) { + spin_unlock_bh(&sta->lock); diff --git a/package/kernel/mac80211/patches/321-0001-ath9k-move-spectral-scan-support-under-a-separate-co.patch b/package/kernel/mac80211/patches/321-0001-ath9k-move-spectral-scan-support-under-a-separate-co.patch new file mode 100644 index 0000000000..703051fe19 --- /dev/null +++ b/package/kernel/mac80211/patches/321-0001-ath9k-move-spectral-scan-support-under-a-separate-co.patch @@ -0,0 +1,103 @@ +From 9df7ddc3ed25b7d3473f117a0680b9418adb5753 Mon Sep 17 00:00:00 2001 +Message-Id: <9df7ddc3ed25b7d3473f117a0680b9418adb5753.1515610034.git.mschiffer@universe-factory.net> +From: Matthias Schiffer +Date: Mon, 27 Nov 2017 18:56:22 +0100 +Subject: [PATCH 1/2] ath9k: move spectral scan support under a separate config + symbol + +At the moment, spectral scan support, and with it RELAY, is always enabled +with ATH9K[_HTC]_DEBUGFS. Spectral scan support is currently the only user +of RELAY in ath9k, and it unconditionally reserves a relay channel. + +Having debugfs support in ath9k is often useful even on very small embedded +routers, where we'd rather like to avoid the code size and RAM usage of the +relay support. + +Signed-off-by: Matthias Schiffer +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/ath/ath9k/Kconfig | 14 ++++++++++---- + drivers/net/wireless/ath/ath9k/Makefile | 4 ++-- + drivers/net/wireless/ath/ath9k/common-spectral.h | 4 ++-- + 3 files changed, 14 insertions(+), 8 deletions(-) + +--- a/drivers/net/wireless/ath/ath9k/Kconfig ++++ b/drivers/net/wireless/ath/ath9k/Kconfig +@@ -64,13 +64,12 @@ config ATH9K_DEBUGFS + depends on ATH9K && DEBUG_FS + select MAC80211_DEBUGFS + select ATH9K_COMMON_DEBUG +- depends on RELAY + ---help--- + Say Y, if you need access to ath9k's statistics for + interrupts, rate control, etc. + +- Also required for changing debug message flags at run time. +- As well as access to the FFT/spectral data and TX99. ++ Also required for changing debug message flags at run time and for ++ TX99. + + config ATH9K_STATION_STATISTICS + bool "Detailed station statistics" +@@ -181,7 +180,6 @@ config ATH9K_HTC_DEBUGFS + bool "Atheros ath9k_htc debugging" + depends on ATH9K_HTC && DEBUG_FS + select ATH9K_COMMON_DEBUG +- depends on RELAY + ---help--- + Say Y, if you need access to ath9k_htc's statistics. + As well as access to the FFT/spectral data. +@@ -197,3 +195,11 @@ config ATH9K_HWRNG + + Say Y, feeds the entropy directly from the WiFi driver to the input + pool. ++ ++config ATH9K_COMMON_SPECTRAL ++ bool "Atheros ath9k/ath9k_htc spectral scan support" ++ depends on ATH9K_DEBUGFS || ATH9K_HTC_DEBUGFS ++ depends on RELAY ++ default n ++ ---help--- ++ Say Y to enable access to the FFT/spectral data via debugfs. +--- a/drivers/net/wireless/ath/ath9k/Makefile ++++ b/drivers/net/wireless/ath/ath9k/Makefile +@@ -61,8 +61,8 @@ ath9k_common-y:= common.o \ + common-init.o \ + common-beacon.o \ + +-ath9k_common-$(CPTCFG_ATH9K_COMMON_DEBUG) += common-debug.o \ +- common-spectral.o ++ath9k_common-$(CPTCFG_ATH9K_COMMON_DEBUG) += common-debug.o ++ath9k_common-$(CPTCFG_ATH9K_COMMON_SPECTRAL) += common-spectral.o + + ath9k_htc-y += htc_hst.o \ + hif_usb.o \ +--- a/drivers/net/wireless/ath/ath9k/common-spectral.h ++++ b/drivers/net/wireless/ath/ath9k/common-spectral.h +@@ -151,7 +151,7 @@ static inline u8 spectral_bitmap_weight( + return bins[0] & 0x3f; + } + +-#ifdef CPTCFG_ATH9K_COMMON_DEBUG ++#ifdef CPTCFG_ATH9K_COMMON_SPECTRAL + void ath9k_cmn_spectral_init_debug(struct ath_spec_scan_priv *spec_priv, struct dentry *debugfs_phy); + void ath9k_cmn_spectral_deinit_debug(struct ath_spec_scan_priv *spec_priv); + +@@ -183,6 +183,6 @@ static inline int ath_cmn_process_fft(st + { + return 0; + } +-#endif /* CPTCFG_ATH9K_COMMON_DEBUG */ ++#endif /* CPTCFG_ATH9K_COMMON_SPECTRAL */ + + #endif /* SPECTRAL_H */ +--- a/local-symbols ++++ b/local-symbols +@@ -116,6 +116,7 @@ ATH9K_PCOEM= + ATH9K_HTC= + ATH9K_HTC_DEBUGFS= + ATH9K_HWRNG= ++ATH9K_COMMON_SPECTRAL= + CARL9170= + CARL9170_LEDS= + CARL9170_DEBUGFS= diff --git a/package/kernel/mac80211/patches/321-0002-ath10k-move-spectral-scan-support-under-a-separate-c.patch b/package/kernel/mac80211/patches/321-0002-ath10k-move-spectral-scan-support-under-a-separate-c.patch new file mode 100644 index 0000000000..604a6f1585 --- /dev/null +++ b/package/kernel/mac80211/patches/321-0002-ath10k-move-spectral-scan-support-under-a-separate-c.patch @@ -0,0 +1,91 @@ +From 42e01cb9cb109fb0bb4743f6c54d6aa67ac39b61 Mon Sep 17 00:00:00 2001 +Message-Id: <42e01cb9cb109fb0bb4743f6c54d6aa67ac39b61.1515610034.git.mschiffer@universe-factory.net> +In-Reply-To: <9df7ddc3ed25b7d3473f117a0680b9418adb5753.1515610034.git.mschiffer@universe-factory.net> +References: <9df7ddc3ed25b7d3473f117a0680b9418adb5753.1515610034.git.mschiffer@universe-factory.net> +From: Matthias Schiffer +Date: Mon, 27 Nov 2017 18:56:23 +0100 +Subject: [PATCH 2/2] ath10k: move spectral scan support under a separate + config symbol + +At the moment, spectral scan support, and with it RELAY, is always enabled +with ATH10K_DEBUGFS. Spectral scan support is currently the only user of +RELAY in ath10k, and it unconditionally reserves a relay channel. + +Having debugfs support in ath10k is often useful even on very small +embedded routers, where we'd rather like to avoid the code size and RAM +usage of the relay support. While ath10k-based devices usually have more +resources than ath9k-based ones, it makes sense to keep the configuration +symmetric to ath9k, so the same base kernel without RELAY can be used for +both ath9k and ath10k hardware. + +Signed-off-by: Matthias Schiffer +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/ath/ath10k/Kconfig | 9 ++++++++- + drivers/net/wireless/ath/ath10k/Makefile | 2 +- + drivers/net/wireless/ath/ath10k/spectral.h | 4 ++-- + 3 files changed, 11 insertions(+), 4 deletions(-) + +--- a/drivers/net/wireless/ath/ath10k/Kconfig ++++ b/drivers/net/wireless/ath/ath10k/Kconfig +@@ -51,12 +51,19 @@ config ATH10K_DEBUG + config ATH10K_DEBUGFS + bool "Atheros ath10k debugfs support" + depends on ATH10K && DEBUG_FS +- depends on RELAY + ---help--- + Enabled debugfs support + + If unsure, say Y to make it easier to debug problems. + ++config ATH10K_SPECTRAL ++ bool "Atheros ath10k spectral scan support" ++ depends on ATH10K_DEBUGFS ++ depends on RELAY ++ default n ++ ---help--- ++ Say Y to enable access to the FFT/spectral data via debugfs. ++ + config ATH10K_TRACING + depends on !KERNEL_3_4 + bool "Atheros ath10k tracing support" +--- a/drivers/net/wireless/ath/ath10k/Makefile ++++ b/drivers/net/wireless/ath/ath10k/Makefile +@@ -14,7 +14,7 @@ ath10k_core-y += mac.o \ + p2p.o \ + swap.o + +-ath10k_core-$(CPTCFG_ATH10K_DEBUGFS) += spectral.o ++ath10k_core-$(CPTCFG_ATH10K_SPECTRAL) += spectral.o + ath10k_core-$(CPTCFG_NL80211_TESTMODE) += testmode.o + ath10k_core-$(CPTCFG_ATH10K_TRACING) += trace.o + ath10k_core-$(CPTCFG_ATH10K_THERMAL) += thermal.o +--- a/drivers/net/wireless/ath/ath10k/spectral.h ++++ b/drivers/net/wireless/ath/ath10k/spectral.h +@@ -44,7 +44,7 @@ enum ath10k_spectral_mode { + SPECTRAL_MANUAL, + }; + +-#ifdef CPTCFG_ATH10K_DEBUGFS ++#ifdef CPTCFG_ATH10K_SPECTRAL + + int ath10k_spectral_process_fft(struct ath10k *ar, + struct wmi_phyerr_ev_arg *phyerr, +@@ -85,6 +85,6 @@ static inline void ath10k_spectral_destr + { + } + +-#endif /* CPTCFG_ATH10K_DEBUGFS */ ++#endif /* CPTCFG_ATH10K_SPECTRAL */ + + #endif /* SPECTRAL_H */ +--- a/local-symbols ++++ b/local-symbols +@@ -140,6 +140,7 @@ ATH10K_SDIO= + ATH10K_USB= + ATH10K_DEBUG= + ATH10K_DEBUGFS= ++ATH10K_SPECTRAL= + ATH10K_TRACING= + ATH10K_DFS_CERTIFIED= + WCN36XX= diff --git a/package/kernel/mac80211/patches/327-mac80211-accept-key-reinstall-without-changing-anyth.patch b/package/kernel/mac80211/patches/327-mac80211-accept-key-reinstall-without-changing-anyth.patch deleted file mode 100644 index 7d0be0395b..0000000000 --- a/package/kernel/mac80211/patches/327-mac80211-accept-key-reinstall-without-changing-anyth.patch +++ /dev/null @@ -1,81 +0,0 @@ -From fdf7cb4185b60c68e1a75e61691c4afdc15dea0e Mon Sep 17 00:00:00 2001 -From: Johannes Berg -Date: Tue, 5 Sep 2017 14:54:54 +0200 -Subject: [PATCH] mac80211: accept key reinstall without changing anything - -When a key is reinstalled we can reset the replay counters -etc. which can lead to nonce reuse and/or replay detection -being impossible, breaking security properties, as described -in the "KRACK attacks". - -In particular, CVE-2017-13080 applies to GTK rekeying that -happened in firmware while the host is in D3, with the second -part of the attack being done after the host wakes up. In -this case, the wpa_supplicant mitigation isn't sufficient -since wpa_supplicant doesn't know the GTK material. - -In case this happens, simply silently accept the new key -coming from userspace but don't take any action on it since -it's the same key; this keeps the PN replay counters intact. - -Signed-off-by: Johannes Berg ---- - net/mac80211/key.c | 21 +++++++++++++++++---- - 1 file changed, 17 insertions(+), 4 deletions(-) - -diff --git a/net/mac80211/key.c b/net/mac80211/key.c -index a98fc2b5e0dc..ae995c8480db 100644 ---- a/net/mac80211/key.c -+++ b/net/mac80211/key.c -@@ -4,7 +4,7 @@ - * Copyright 2006-2007 Jiri Benc - * Copyright 2007-2008 Johannes Berg - * Copyright 2013-2014 Intel Mobile Communications GmbH -- * Copyright 2015 Intel Deutschland GmbH -+ * Copyright 2015-2017 Intel Deutschland GmbH - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as -@@ -620,9 +620,6 @@ int ieee80211_key_link(struct ieee80211_key *key, - - pairwise = key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE; - idx = key->conf.keyidx; -- key->local = sdata->local; -- key->sdata = sdata; -- key->sta = sta; - - mutex_lock(&sdata->local->key_mtx); - -@@ -633,6 +630,21 @@ int ieee80211_key_link(struct ieee80211_key *key, - else - old_key = key_mtx_dereference(sdata->local, sdata->keys[idx]); - -+ /* -+ * Silently accept key re-installation without really installing the -+ * new version of the key to avoid nonce reuse or replay issues. -+ */ -+ if (old_key && key->conf.keylen == old_key->conf.keylen && -+ !memcmp(key->conf.key, old_key->conf.key, key->conf.keylen)) { -+ ieee80211_key_free_unused(key); -+ ret = 0; -+ goto out; -+ } -+ -+ key->local = sdata->local; -+ key->sdata = sdata; -+ key->sta = sta; -+ - increment_tailroom_need_count(sdata); - - ieee80211_key_replace(sdata, sta, pairwise, old_key, key); -@@ -648,6 +660,7 @@ int ieee80211_key_link(struct ieee80211_key *key, - ret = 0; - } - -+ out: - mutex_unlock(&sdata->local->key_mtx); - - return ret; --- -2.13.6 - diff --git a/package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch b/package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch deleted file mode 100644 index 03e8201902..0000000000 --- a/package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 2bdd713b92a9cade239d3c7d15205a09f556624d Mon Sep 17 00:00:00 2001 -From: "Jason A. Donenfeld" -Date: Tue, 17 Oct 2017 20:32:07 +0200 -Subject: [PATCH] mac80211: use constant time comparison with keys - -Otherwise we risk leaking information via timing side channel. - -Fixes: fdf7cb4185b6 ("mac80211: accept key reinstall without changing anything") -Signed-off-by: Jason A. Donenfeld -Signed-off-by: Johannes Berg ---- - net/mac80211/key.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/net/mac80211/key.c -+++ b/net/mac80211/key.c -@@ -19,6 +19,7 @@ - #include - #include - #include -+#include - #include - #include "ieee80211_i.h" - #include "driver-ops.h" -@@ -635,7 +636,7 @@ int ieee80211_key_link(struct ieee80211_ - * new version of the key to avoid nonce reuse or replay issues. - */ - if (old_key && key->conf.keylen == old_key->conf.keylen && -- !memcmp(key->conf.key, old_key->conf.key, key->conf.keylen)) { -+ !crypto_memneq(key->conf.key, old_key->conf.key, key->conf.keylen)) { - ieee80211_key_free_unused(key); - ret = 0; - goto out; diff --git a/package/kernel/mac80211/patches/329-mac80211-don-t-compare-TKIP-TX-MIC-key-in-reinstall.patch b/package/kernel/mac80211/patches/329-mac80211-don-t-compare-TKIP-TX-MIC-key-in-reinstall.patch deleted file mode 100644 index 1eaf51de72..0000000000 --- a/package/kernel/mac80211/patches/329-mac80211-don-t-compare-TKIP-TX-MIC-key-in-reinstall.patch +++ /dev/null @@ -1,73 +0,0 @@ -From cfbb0d90a7abb289edc91833d0905931f8805f12 Mon Sep 17 00:00:00 2001 -From: Johannes Berg -Date: Tue, 24 Oct 2017 21:12:13 +0200 -Subject: [PATCH] mac80211: don't compare TKIP TX MIC key in reinstall prevention - -For the reinstall prevention, the code I had added compares the -whole key. It turns out though that iwlwifi firmware doesn't -provide the TKIP TX MIC key as it's not needed in client mode, -and thus the comparison will always return false. - -For client mode, thus always zero out the TX MIC key part before -doing the comparison in order to avoid accepting the reinstall -of the key with identical encryption and RX MIC key, but not the -same TX MIC key (since the supplicant provides the real one.) - -Fixes: fdf7cb4185b6 ("mac80211: accept key reinstall without changing anything") -Signed-off-by: Johannes Berg ---- - net/mac80211/key.c | 36 ++++++++++++++++++++++++++++++++++-- - 1 file changed, 34 insertions(+), 2 deletions(-) - ---- a/net/mac80211/key.c -+++ b/net/mac80211/key.c -@@ -610,6 +610,39 @@ void ieee80211_key_free_unused(struct ie - ieee80211_key_free_common(key); - } - -+static bool ieee80211_key_identical(struct ieee80211_sub_if_data *sdata, -+ struct ieee80211_key *old, -+ struct ieee80211_key *new) -+{ -+ u8 tkip_old[WLAN_KEY_LEN_TKIP], tkip_new[WLAN_KEY_LEN_TKIP]; -+ u8 *tk_old, *tk_new; -+ -+ if (!old || new->conf.keylen != old->conf.keylen) -+ return false; -+ -+ tk_old = old->conf.key; -+ tk_new = new->conf.key; -+ -+ /* -+ * In station mode, don't compare the TX MIC key, as it's never used -+ * and offloaded rekeying may not care to send it to the host. This -+ * is the case in iwlwifi, for example. -+ */ -+ if (sdata->vif.type == NL80211_IFTYPE_STATION && -+ new->conf.cipher == WLAN_CIPHER_SUITE_TKIP && -+ new->conf.keylen == WLAN_KEY_LEN_TKIP && -+ !(new->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE)) { -+ memcpy(tkip_old, tk_old, WLAN_KEY_LEN_TKIP); -+ memcpy(tkip_new, tk_new, WLAN_KEY_LEN_TKIP); -+ memset(tkip_old + NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY, 0, 8); -+ memset(tkip_new + NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY, 0, 8); -+ tk_old = tkip_old; -+ tk_new = tkip_new; -+ } -+ -+ return !crypto_memneq(tk_old, tk_new, new->conf.keylen); -+} -+ - int ieee80211_key_link(struct ieee80211_key *key, - struct ieee80211_sub_if_data *sdata, - struct sta_info *sta) -@@ -635,8 +668,7 @@ int ieee80211_key_link(struct ieee80211_ - * Silently accept key re-installation without really installing the - * new version of the key to avoid nonce reuse or replay issues. - */ -- if (old_key && key->conf.keylen == old_key->conf.keylen && -- !crypto_memneq(key->conf.key, old_key->conf.key, key->conf.keylen)) { -+ if (ieee80211_key_identical(sdata, old_key, key)) { - ieee80211_key_free_unused(key); - ret = 0; - goto out; diff --git a/package/kernel/mac80211/patches/402-ath_regd_optional.patch b/package/kernel/mac80211/patches/402-ath_regd_optional.patch index fae9b55529..edd4ce26bf 100644 --- a/package/kernel/mac80211/patches/402-ath_regd_optional.patch +++ b/package/kernel/mac80211/patches/402-ath_regd_optional.patch @@ -106,7 +106,7 @@ ---help--- --- a/local-symbols +++ b/local-symbols -@@ -82,6 +82,7 @@ ADM8211= +@@ -87,6 +87,7 @@ ADM8211= ATH_COMMON= WLAN_VENDOR_ATH= ATH_DEBUG= diff --git a/package/kernel/mac80211/patches/404-regd_no_assoc_hints.patch b/package/kernel/mac80211/patches/404-regd_no_assoc_hints.patch index 457c0cb28c..00be2ef98d 100644 --- a/package/kernel/mac80211/patches/404-regd_no_assoc_hints.patch +++ b/package/kernel/mac80211/patches/404-regd_no_assoc_hints.patch @@ -1,6 +1,6 @@ --- a/net/wireless/reg.c +++ b/net/wireless/reg.c -@@ -2497,6 +2497,8 @@ void regulatory_hint_country_ie(struct w +@@ -2860,6 +2860,8 @@ void regulatory_hint_country_ie(struct w enum environment_cap env = ENVIRON_ANY; struct regulatory_request *request = NULL, *lr; @@ -9,7 +9,7 @@ /* IE len must be evenly divisible by 2 */ if (country_ie_len & 0x01) return; -@@ -2703,6 +2705,7 @@ static void restore_regulatory_settings( +@@ -3066,6 +3068,7 @@ static void restore_regulatory_settings( void regulatory_hint_disconnect(void) { diff --git a/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch index 72857a0dbf..2a2d2f3cde 100644 --- a/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch +++ b/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch @@ -36,7 +36,7 @@ u8 ps_dtim_period; --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h -@@ -2149,6 +2149,9 @@ enum nl80211_commands { +@@ -2153,6 +2153,9 @@ enum nl80211_commands { * @NL80211_ATTR_PMKR0_NAME: PMK-R0 Name for offloaded FT. * @NL80211_ATTR_PORT_AUTHORIZED: (reserved) * @@ -46,7 +46,7 @@ * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -2575,6 +2578,8 @@ enum nl80211_attrs { +@@ -2579,6 +2582,8 @@ enum nl80211_attrs { NL80211_ATTR_PMKR0_NAME, NL80211_ATTR_PORT_AUTHORIZED, @@ -57,7 +57,7 @@ __NL80211_ATTR_AFTER_LAST, --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -2444,6 +2444,19 @@ static int ieee80211_get_tx_power(struct +@@ -2447,6 +2447,19 @@ static int ieee80211_get_tx_power(struct return 0; } @@ -77,7 +77,7 @@ static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev, const u8 *addr) { -@@ -3717,6 +3730,7 @@ const struct cfg80211_ops mac80211_confi +@@ -3720,6 +3733,7 @@ const struct cfg80211_ops mac80211_confi .set_wiphy_params = ieee80211_set_wiphy_params, .set_tx_power = ieee80211_set_tx_power, .get_tx_power = ieee80211_get_tx_power, @@ -87,7 +87,7 @@ CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -1347,6 +1347,7 @@ struct ieee80211_local { +@@ -1348,6 +1348,7 @@ struct ieee80211_local { int dynamic_ps_forced_timeout; int user_power_level; /* in dBm, for all interfaces */ diff --git a/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch b/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch index 7cf589485e..6dd03fd28a 100644 --- a/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch +++ b/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch @@ -125,7 +125,7 @@ REG_SET_BIT(ah, AR_BTCOEX_WL_LNADIV, AR_BTCOEX_WL_LNADIV_FORCE_ON); --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -527,6 +527,11 @@ irqreturn_t ath_isr(int irq, void *dev) +@@ -528,6 +528,11 @@ irqreturn_t ath_isr(int irq, void *dev) if (test_bit(ATH_OP_HW_RESET, &common->op_flags)) return IRQ_HANDLED; diff --git a/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch b/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch index f3fead0a1a..e86e3e38bd 100644 --- a/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch +++ b/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch @@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau #ifdef CPTCFG_MAC80211_LEDS -@@ -129,6 +131,64 @@ static void ath9k_unregister_gpio_chip(s +@@ -129,6 +131,67 @@ static void ath9k_unregister_gpio_chip(s sc->gpiochip = NULL; } @@ -59,6 +59,9 @@ Signed-off-by: Felix Fietkau + return; + + for (i = 0; i < pdata->num_btns; i++) { ++ if (pdata->btns[i].gpio == sc->sc_ah->led_pin) ++ sc->sc_ah->led_pin = -1; ++ + ath9k_hw_gpio_request_in(sc->sc_ah, pdata->btns[i].gpio, + "ath9k-gpio"); + bt[i].gpio = sc->gpiochip->gchip.base + pdata->btns[i].gpio; @@ -94,7 +97,7 @@ Signed-off-by: Felix Fietkau #else /* CONFIG_GPIOLIB */ static inline void ath9k_register_gpio_chip(struct ath_softc *sc) -@@ -139,6 +199,14 @@ static inline void ath9k_unregister_gpio +@@ -139,6 +202,14 @@ static inline void ath9k_unregister_gpio { } @@ -109,7 +112,7 @@ Signed-off-by: Felix Fietkau #endif /* CONFIG_GPIOLIB */ /********************************/ -@@ -262,6 +330,7 @@ void ath_deinit_leds(struct ath_softc *s +@@ -262,6 +333,7 @@ void ath_deinit_leds(struct ath_softc *s { struct ath_led *led; @@ -117,7 +120,7 @@ Signed-off-by: Felix Fietkau while (!list_empty(&sc->leds)) { led = list_first_entry(&sc->leds, struct ath_led, list); #ifdef CONFIG_GPIOLIB -@@ -301,6 +370,7 @@ void ath_init_leds(struct ath_softc *sc) +@@ -301,6 +373,7 @@ void ath_init_leds(struct ath_softc *sc) } ath_fill_led_pin(sc); diff --git a/package/kernel/mac80211/patches/551-ath9k_ubnt_uap_plus_hsr.patch b/package/kernel/mac80211/patches/551-ath9k_ubnt_uap_plus_hsr.patch index 6d541d6a57..82b8109e06 100644 --- a/package/kernel/mac80211/patches/551-ath9k_ubnt_uap_plus_hsr.patch +++ b/package/kernel/mac80211/patches/551-ath9k_ubnt_uap_plus_hsr.patch @@ -17,7 +17,7 @@ struct ath_hw *ah = sc->sc_ah; struct ath_common *common = ath9k_hw_common(ah); struct ieee80211_hw *hw = sc->hw; -@@ -41,6 +44,11 @@ static int ath_set_channel(struct ath_so +@@ -42,6 +45,11 @@ static int ath_set_channel(struct ath_so ath_dbg(common, CONFIG, "Set channel: %d MHz width: %d\n", chan->center_freq, chandef->width); @@ -27,7 +27,7 @@ + } + /* update survey stats for the old channel before switching */ - spin_lock_bh(&common->cc_lock); + spin_lock_irqsave(&common->cc_lock, flags); ath_update_survey_stats(sc); --- /dev/null +++ b/drivers/net/wireless/ath/ath9k/hsr.c @@ -343,7 +343,7 @@ u8 ath9k_parse_mpdudensity(u8 mpdudensity) { -@@ -648,6 +650,7 @@ void ath_reset_work(struct work_struct * +@@ -649,6 +651,7 @@ void ath_reset_work(struct work_struct * static int ath9k_start(struct ieee80211_hw *hw) { struct ath_softc *sc = hw->priv; @@ -351,7 +351,7 @@ struct ath_hw *ah = sc->sc_ah; struct ath_common *common = ath9k_hw_common(ah); struct ieee80211_channel *curchan = sc->cur_chan->chandef.chan; -@@ -726,6 +729,11 @@ static int ath9k_start(struct ieee80211_ +@@ -727,6 +730,11 @@ static int ath9k_start(struct ieee80211_ AR_GPIO_OUTPUT_MUX_AS_OUTPUT); } @@ -386,7 +386,7 @@ #endif /* _LINUX_ATH9K_PLATFORM_H */ --- a/local-symbols +++ b/local-symbols -@@ -109,6 +109,7 @@ ATH9K_WOW= +@@ -114,6 +114,7 @@ ATH9K_WOW= ATH9K_RFKILL= ATH9K_CHANNEL_CONTEXT= ATH9K_PCOEM= diff --git a/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00eeprom.patch b/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00eeprom.patch index 5ad99995c2..b0c5d5ba37 100644 --- a/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00eeprom.patch +++ b/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00eeprom.patch @@ -1,6 +1,6 @@ --- a/local-symbols +++ b/local-symbols -@@ -291,6 +291,7 @@ RT2X00_LIB_FIRMWARE= +@@ -296,6 +296,7 @@ RT2X00_LIB_FIRMWARE= RT2X00_LIB_CRYPTO= RT2X00_LIB_LEDS= RT2X00_LIB_DEBUGFS= diff --git a/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch b/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch index cfde08d4ea..885bc246ba 100644 --- a/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch +++ b/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/marvell/libertas/cfg.c +++ b/drivers/net/wireless/marvell/libertas/cfg.c -@@ -2043,6 +2043,8 @@ struct wireless_dev *lbs_cfg_alloc(struc +@@ -2040,6 +2040,8 @@ struct wireless_dev *lbs_cfg_alloc(struc goto err_wiphy_new; } @@ -11,7 +11,7 @@ err_wiphy_new: --- a/drivers/net/wireless/marvell/libertas/main.c +++ b/drivers/net/wireless/marvell/libertas/main.c -@@ -933,6 +933,7 @@ struct lbs_private *lbs_add_card(void *c +@@ -930,6 +930,7 @@ struct lbs_private *lbs_add_card(void *c goto err_adapter; } diff --git a/package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch b/package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch index b26505de21..089ad2fe78 100644 --- a/package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch +++ b/package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/marvell/libertas/cfg.c +++ b/drivers/net/wireless/marvell/libertas/cfg.c -@@ -2119,6 +2119,8 @@ int lbs_cfg_register(struct lbs_private +@@ -2116,6 +2116,8 @@ int lbs_cfg_register(struct lbs_private wdev->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); wdev->wiphy->reg_notifier = lbs_reg_notifier; diff --git a/package/kernel/mac80211/patches/921-ath10k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/921-ath10k_init_devices_synchronously.patch index 94a25b680d..3b1e9673bb 100644 --- a/package/kernel/mac80211/patches/921-ath10k_init_devices_synchronously.patch +++ b/package/kernel/mac80211/patches/921-ath10k_init_devices_synchronously.patch @@ -14,7 +14,7 @@ Signed-off-by: Sven Eckelmann --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c -@@ -2445,6 +2445,16 @@ int ath10k_core_register(struct ath10k * +@@ -2458,6 +2458,16 @@ int ath10k_core_register(struct ath10k * ar->chip_id = chip_id; queue_work(ar->workqueue, &ar->register_work); diff --git a/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch b/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch index e0ab671760..21e7359bc9 100644 --- a/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch +++ b/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -8067,6 +8067,21 @@ static int ath10k_mac_init_rd(struct ath +@@ -8080,6 +8080,21 @@ static int ath10k_mac_init_rd(struct ath return 0; } @@ -22,7 +22,7 @@ int ath10k_mac_register(struct ath10k *ar) { static const u32 cipher_suites[] = { -@@ -8308,6 +8323,12 @@ int ath10k_mac_register(struct ath10k *a +@@ -8352,6 +8367,12 @@ int ath10k_mac_register(struct ath10k *a wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST); diff --git a/package/kernel/mac80211/patches/936-ath10k-fix-otp-failure-result.patch b/package/kernel/mac80211/patches/936-ath10k-fix-otp-failure-result.patch index 0af8025d96..ea30a9dfd6 100644 --- a/package/kernel/mac80211/patches/936-ath10k-fix-otp-failure-result.patch +++ b/package/kernel/mac80211/patches/936-ath10k-fix-otp-failure-result.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c -@@ -757,7 +757,7 @@ static int ath10k_core_get_board_id_from +@@ -770,7 +770,7 @@ static int ath10k_core_get_board_id_from if (ret) { ath10k_err(ar, "could not execute otp for board id check: %d\n", ret); diff --git a/package/kernel/mac80211/patches/937-ath10k-calibration-variant.patch b/package/kernel/mac80211/patches/937-ath10k-calibration-variant.patch new file mode 100644 index 0000000000..f9a830c7a6 --- /dev/null +++ b/package/kernel/mac80211/patches/937-ath10k-calibration-variant.patch @@ -0,0 +1,106 @@ +From: Sven Eckelmann +Date: Fri, 10 Mar 2017 09:06:15 +0100 +Subject: ath10k: search DT for qcom,ath10k-calibration-variant + +Board Data File (BDF) is loaded upon driver boot-up procedure. The right +board data file is identified on QCA4019 using bus, bmi-chip-id and +bmi-board-id. + +The problem, however, can occur when the (default) board data file cannot +fulfill the vendor requirements and it is necessary to use a different +board data file. + +This problem was solved for SMBIOS by adding a special SMBIOS type 0xF8. +Something similar has to be provided for systems without SMBIOS but with +device trees. No solution was specified by QCA and therefore a new one has +to be found for ath10k. + +The device tree requires addition strings to define the variant name + + wifi@a000000 { + status = "okay"; + qcom,ath10k-calibration-variant = "RT-AC58U"; + }; + + wifi@a800000 { + status = "okay"; + qcom,ath10k-calibration-variant = "RT-AC58U"; + }; + +This would create the boarddata identifiers for the board-2.bin search + + * bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=RT-AC58U + * bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=RT-AC58U + +Signed-off-by: Sven Eckelmann + +Origin: other, https://patchwork.kernel.org/patch/9615185/ +--- + +--- a/drivers/net/wireless/ath/ath10k/core.c ++++ b/drivers/net/wireless/ath/ath10k/core.c +@@ -860,6 +860,25 @@ static int ath10k_core_check_smbios(stru + return 0; + } + ++static int ath10k_core_check_dt(struct ath10k *ar) ++{ ++ struct device_node *node; ++ const char *variant = NULL; ++ ++ node = ar->dev->of_node; ++ if (!node) ++ return -ENOENT; ++ ++ of_property_read_string(node, "qcom,ath10k-calibration-variant", ++ &variant); ++ if (!variant) ++ return -ENODATA; ++ ++ strscpy(ar->id.bdf_ext, variant, sizeof(ar->id.bdf_ext)); ++ ++ return 0; ++} ++ + static int ath10k_download_and_run_otp(struct ath10k *ar) + { + u32 result, address = ar->hw_params.patch_load_addr; +@@ -1231,19 +1250,19 @@ static int ath10k_core_create_board_name + /* strlen(',variant=') + strlen(ar->id.bdf_ext) */ + char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH] = { 0 }; + ++ if (ar->id.bdf_ext[0] != '\0') ++ scnprintf(variant, sizeof(variant), ",variant=%s", ++ ar->id.bdf_ext); ++ + if (ar->id.bmi_ids_valid) { + scnprintf(name, name_len, +- "bus=%s,bmi-chip-id=%d,bmi-board-id=%d", ++ "bus=%s,bmi-chip-id=%d,bmi-board-id=%d%s", + ath10k_bus_str(ar->hif.bus), + ar->id.bmi_chip_id, +- ar->id.bmi_board_id); ++ ar->id.bmi_board_id, variant); + goto out; + } + +- if (ar->id.bdf_ext[0] != '\0') +- scnprintf(variant, sizeof(variant), ",variant=%s", +- ar->id.bdf_ext); +- + scnprintf(name, name_len, + "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x%s", + ath10k_bus_str(ar->hif.bus), +@@ -2343,7 +2362,11 @@ static int ath10k_core_probe_fw(struct a + + ret = ath10k_core_check_smbios(ar); + if (ret) +- ath10k_dbg(ar, ATH10K_DBG_BOOT, "bdf variant name not set.\n"); ++ ath10k_dbg(ar, ATH10K_DBG_BOOT, "SMBIOS bdf variant name not set.\n"); ++ ++ ret = ath10k_core_check_dt(ar); ++ if (ret) ++ ath10k_dbg(ar, ATH10K_DBG_BOOT, "DT bdf variant name not set.\n"); + + ret = ath10k_core_fetch_board_file(ar); + if (ret) { diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 3428ea1f78..441f59e43e 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2017-10-12 -PKG_SOURCE_VERSION:=37654d704772512065cd28b007342758c2a0f14a -PKG_MIRROR_HASH:=487ca40ed4e1ffe015dabc76c0a84782602d84f5b08c9c86cc6c892cb499623b +PKG_SOURCE_DATE:=2017-12-17 +PKG_SOURCE_VERSION:=68b0cf17efe32623efd2a46d33b0b551bb78cbbe +PKG_MIRROR_HASH:=855901e5e02249f53bb943d2d5da5bb3cb357f02e4c68c6291604867e250e9bd PKG_MAINTAINER:=Felix Fietkau PKG_BUILD_PARALLEL:=1 @@ -39,7 +39,6 @@ define KernelPackage/mt76-core TITLE:=MediaTek MT76xx wireless driver FILES:=\ $(PKG_BUILD_DIR)/mt76.ko - AUTOLOAD:=$(call AutoLoad,50,mac80211 mt76) endef define KernelPackage/mt76x2 @@ -48,7 +47,7 @@ define KernelPackage/mt76x2 DEPENDS+=+kmod-mt76-core FILES:=\ $(PKG_BUILD_DIR)/mt76x2e.ko - AUTOLOAD:=$(call AutoLoad,51,mt76x2e) + AUTOLOAD:=$(call AutoProbe,mt76x2e) endef define KernelPackage/mt7603 @@ -57,7 +56,7 @@ define KernelPackage/mt7603 DEPENDS+=+kmod-mt76-core FILES:=\ $(PKG_BUILD_DIR)/mt7603e.ko - AUTOLOAD:=$(call AutoLoad,51,mt7603e) + AUTOLOAD:=$(call AutoProbe,mt7603e) endef NOSTDINC_FLAGS = \ @@ -75,8 +74,7 @@ endif define Build/Compile +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ modules diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile index cdb0f4f649..f8e70e54a8 100644 --- a/package/kernel/mwlwifi/Makefile +++ b/package/kernel/mwlwifi/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mwlwifi -PKG_VERSION:=10.3.4.0-20170810 +PKG_VERSION:=10.3.4.0-20171214 PKG_RELEASE=1 PKG_LICENSE:=ISC @@ -16,8 +16,8 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=9a6db695f17c0c9ec5d4602afc9c36290c3bdea1 -PKG_MIRROR_HASH:=b04781a0b06385c7c316dc3b91203aa41e8fcb511a3c5e4e9cba5c40156a49bd +PKG_SOURCE_VERSION:=843d00cd9c134629b9dad7162831ec5f136399b3 +PKG_MIRROR_HASH:=080c491473f0dbe9a7cac0fa3c6d004bf2dc3bd953a9f9d074eb8876a86437c2 PKG_MAINTAINER:=Imre Kaloz PKG_BUILD_PARALLEL:=1 @@ -30,7 +30,7 @@ define KernelPackage/mwlwifi TITLE:=Marvell 88W8864 wireless driver DEPENDS:=+kmod-mac80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT @PCI_SUPPORT @TARGET_mvebu FILES:=$(PKG_BUILD_DIR)/mwlwifi.ko - AUTOLOAD:=$(call AutoLoad,50,mac80211 mwlwifi) + AUTOLOAD:=$(call AutoLoad,50,mwlwifi) endef NOSTDINC_FLAGS = \ @@ -43,8 +43,7 @@ NOSTDINC_FLAGS = \ define Build/Compile +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ modules diff --git a/package/kernel/rotary-gpio-custom/Makefile b/package/kernel/rotary-gpio-custom/Makefile index e1cf7ff1de..f758567365 100644 --- a/package/kernel/rotary-gpio-custom/Makefile +++ b/package/kernel/rotary-gpio-custom/Makefile @@ -33,8 +33,7 @@ EXTRA_CFLAGS:= \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \ MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ $(EXTRA_KCONFIG) diff --git a/package/kernel/rtc-rv5c386a/Makefile b/package/kernel/rtc-rv5c386a/Makefile index e970982070..a268ad508c 100644 --- a/package/kernel/rtc-rv5c386a/Makefile +++ b/package/kernel/rtc-rv5c386a/Makefile @@ -23,8 +23,7 @@ endef define Build/Compile $(MAKE) -C "$(LINUX_DIR)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - ARCH="$(LINUX_KARCH)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(BUILDFLAGS)" \ modules diff --git a/package/kernel/spi-gpio-custom/Makefile b/package/kernel/spi-gpio-custom/Makefile index e6d692db44..19aef20ed2 100644 --- a/package/kernel/spi-gpio-custom/Makefile +++ b/package/kernel/spi-gpio-custom/Makefile @@ -33,8 +33,7 @@ EXTRA_CFLAGS:= \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \ MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ $(EXTRA_KCONFIG) diff --git a/package/kernel/w1-gpio-custom/Makefile b/package/kernel/w1-gpio-custom/Makefile index 67fdc7d15e..1008cf9736 100644 --- a/package/kernel/w1-gpio-custom/Makefile +++ b/package/kernel/w1-gpio-custom/Makefile @@ -33,8 +33,7 @@ EXTRA_CFLAGS:= \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ $(EXTRA_KCONFIG) diff --git a/package/kernel/wrt55agv2-spidevs/Makefile b/package/kernel/wrt55agv2-spidevs/Makefile index 169f6b4da1..d80c1e570b 100644 --- a/package/kernel/wrt55agv2-spidevs/Makefile +++ b/package/kernel/wrt55agv2-spidevs/Makefile @@ -25,8 +25,7 @@ define KernelPackage/wrt55agv2-spidevs/description endef MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" define Build/Compile diff --git a/package/lean/adbyby-ram/Makefile b/package/lean/adbyby-ram/Makefile new file mode 100644 index 0000000000..6d67376159 --- /dev/null +++ b/package/lean/adbyby-ram/Makefile @@ -0,0 +1,105 @@ +# +# Copyright (C) 2017 adbyby-ram +# Copyright (C) 2017 yushi studio +# +# This is free software, licensed under the GNU General Public License v3. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=adbyby-ram +PKG_VERSION:=1.0 + + +PKG_LICENSE:=GPLv3 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=yushi studio + + + +include $(INCLUDE_DIR)/package.mk + +define Package/luci-app-adbyby-ram + SECTION:=luci + CATEGORY:=LuCI + SUBMENU:=3. Applications + TITLE:=adbyby-ram LuCI interface + URL:=https://github.com/ywb94/adbyby-ram + PKGARCH:=all +endef + +define Package/luci-app-adbyby-ram/description + LuCI Support for adbyby-ram. +endef + +define Build/Prepare + $(foreach po,$(wildcard ${CURDIR}/files/luci/i18n/*.po), \ + po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));) +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/luci-app-adbyby-ram/prerm +#!/bin/sh +# check if we are on real system +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/adbyby_ram disable + /etc/init.d/adbyby_ram stop +fi +exit 0 +endef + + + + + + +define Package/luci-app-adbyby-ram/postinst +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + chmod 755 /etc/init.d/adbyby_ram >/dev/null 2>&1 + /etc/init.d/adbyby_ram enable >/dev/null 2>&1 +fi +exit 0 +endef + +ifeq ($(ARCH),mips) +define Package/luci-app-adbyby-ram/install + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller + $(INSTALL_DATA) ./files/luci/controller/adbyby.lua $(1)/usr/lib/lua/luci/controller/adbyby.lua + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n + $(INSTALL_DATA) $(PKG_BUILD_DIR)/adbyby.*.lmo $(1)/usr/lib/lua/luci/i18n + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi + $(INSTALL_DATA) ./files/luci/model/cbi/*.lua $(1)/usr/lib/lua/luci/model/cbi/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) ./files/adbyby_ar71xx.sh $(1)/usr/bin/adbyby.sh + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/adbyby.config $(1)/etc/config/adbyby + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/adbyby.init $(1)/etc/init.d/adbyby_ram +endef +endif + +ifeq ($(ARCH),mipsel) +define Package/luci-app-adbyby-ram/install + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller + $(INSTALL_DATA) ./files/luci/controller/adbyby.lua $(1)/usr/lib/lua/luci/controller/adbyby.lua + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n + $(INSTALL_DATA) $(PKG_BUILD_DIR)/adbyby.*.lmo $(1)/usr/lib/lua/luci/i18n + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi + $(INSTALL_DATA) ./files/luci/model/cbi/*.lua $(1)/usr/lib/lua/luci/model/cbi/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) ./files/adbyby_ramips.sh $(1)/usr/bin/adbyby.sh + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/adbyby.config $(1)/etc/config/adbyby + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/adbyby.init $(1)/etc/init.d/adbyby_ram +endef +endif + +$(eval $(call BuildPackage,luci-app-adbyby-ram)) diff --git a/package/lean/adbyby-ram/files/adbyby.config b/package/lean/adbyby-ram/files/adbyby.config new file mode 100644 index 0000000000..a338dfa98f --- /dev/null +++ b/package/lean/adbyby-ram/files/adbyby.config @@ -0,0 +1,3 @@ + +config adbyby 'adbyby' + option enable '0' \ No newline at end of file diff --git a/package/lean/adbyby-ram/files/adbyby.init b/package/lean/adbyby-ram/files/adbyby.init new file mode 100644 index 0000000000..0de8f99b3f --- /dev/null +++ b/package/lean/adbyby-ram/files/adbyby.init @@ -0,0 +1,58 @@ +#!/bin/sh /etc/rc.common + +###################################################################### +# +# Function : Run adbyby in RAM +# +# Creater : ywb94@qq.com, 2017-02-16 +# +# Copyright : yushi studio +# +###################################################################### + +START=80 + + +start() { +/etc/init.d/adbyby_ram enabled +if [ $? == 1 ]; then + return +fi +#ظ +icount=`ps -w|grep adbyby.sh|grep -v grep|wc -l` +icount2=`netstat -nautp|grep adbyby|grep -v grep|wc -l` + +if [ $icount = 0 -a $icount2 = 0 ] ;then +/usr/bin/adbyby.sh & +fi + +} + +stop() { +#ȷǽ +i=0 +icount=`iptables -t nat -L|grep "ports 8118"|wc -l` +while [ $i -le 10 -a $icount -gt 1 ] +do +let i=i+1 +iptables -t nat -D PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8118 +icount=`iptables -t nat -L|grep "ports 8118"|wc -l` +done + + +if [ -f /tmp/adbyby/bin/stopadbb ] ;then +cd /tmp/adbyby/bin +./stopadbb 2>/dev/null +fi + +icount=`ps -w|grep adbyby.sh|grep -v grep|wc -l` +if [ $icount -gt 0 ] ;then +mid=`ps -w|grep adbyby.sh|grep -v grep|awk '{print $1}'` +kill -9 $mid +fi +} + +restart() { + stop + start +} diff --git a/package/lean/adbyby-ram/files/adbyby_ar71xx.sh b/package/lean/adbyby-ram/files/adbyby_ar71xx.sh new file mode 100644 index 0000000000..89a452d040 --- /dev/null +++ b/package/lean/adbyby-ram/files/adbyby_ar71xx.sh @@ -0,0 +1,49 @@ +#!/bin/sh +cd /tmp +#ȴӳɹ +wget_ok="0" +#rm -f 7620n.tar.gz +rm -f ar71xx.tar.gz + +while [ "$wget_ok" = "0" ] +do +#wget http://update.adbyby.com/download/7620n.tar.gz +wget http://update.adbyby.com/download/ar71xx.tar.gz +if [ "$?" == "0" ]; then +wget_ok="1" +else +sleep 30 +fi +done +#ѹadbyby +mkdir -p adbyby +#tar -zvxf 7620n.tar.gz -C ./adbyby +tar -zvxf ar71xx.tar.gz -C ./adbyby + +#һι +murl=`cat /tmp/adbyby/bin/update.info|grep lazy.txt|awk '{print $1}'` + +if [ ${#murl} -gt 5 ] ;then +murl2=`cat /tmp/adbyby/bin/update.info|grep lazy.txt|awk '{print $2}'` +mfile="/tmp/adbyby/bin"${murl2//\\//} +wget $murl -O $mfile +fi + +murl=`cat /tmp/adbyby/bin/update.info|grep video.txt|awk '{print $1}'` +if [ ${#murl} -gt 5 ] ;then +murl2=`cat /tmp/adbyby/bin/update.info|grep video.txt|awk '{print $2}'` +mfile="/tmp/adbyby/bin"${murl2//\\//} +wget $murl -O $mfile +fi + +murl=`cat /tmp/adbyby/bin/update.info|grep user.action|awk '{print $1}'` +if [ ${#murl} -gt 5 ] ;then +murl2=`cat /tmp/adbyby/bin/update.info|grep user.action|awk '{print $2}'` +mfile="/tmp/adbyby/bin"${murl2//\\//} +wget $murl -O $mfile +fi + + +cd ./adbyby/bin +./startadbb + diff --git a/package/lean/adbyby-ram/files/adbyby_ramips.sh b/package/lean/adbyby-ram/files/adbyby_ramips.sh new file mode 100644 index 0000000000..e1006dff70 --- /dev/null +++ b/package/lean/adbyby-ram/files/adbyby_ramips.sh @@ -0,0 +1,48 @@ +#!/bin/sh +cd /tmp +#ȴӳɹ +wget_ok="0" +rm -f 7620n.tar.gz +#rm -f ar71xx.tar.gz + +while [ "$wget_ok" = "0" ] +do +wget http://update.adbyby.com/download/7620n.tar.gz +#wget http://update.adbyby.com/download/ar71xx.tar.gz +if [ "$?" == "0" ]; then +wget_ok="1" +else +sleep 30 +fi +done +#ѹadbyby +mkdir -p adbyby +tar -zvxf 7620n.tar.gz -C ./adbyby +#tar -zvxf ar71xx.tar.gz -C ./adbyby + +#һι +murl=`cat /tmp/adbyby/bin/update.info|grep lazy.txt|awk '{print $1}'` + +if [ ${#murl} -gt 5 ] ;then +murl2=`cat /tmp/adbyby/bin/update.info|grep lazy.txt|awk '{print $2}'` +mfile="/tmp/adbyby/bin"${murl2//\\//} +wget $murl -O $mfile +fi + +murl=`cat /tmp/adbyby/bin/update.info|grep video.txt|awk '{print $1}'` +if [ ${#murl} -gt 5 ] ;then +murl2=`cat /tmp/adbyby/bin/update.info|grep video.txt|awk '{print $2}'` +mfile="/tmp/adbyby/bin"${murl2//\\//} +wget $murl -O $mfile +fi + +murl=`cat /tmp/adbyby/bin/update.info|grep user.action|awk '{print $1}'` +if [ ${#murl} -gt 5 ] ;then +murl2=`cat /tmp/adbyby/bin/update.info|grep user.action|awk '{print $2}'` +mfile="/tmp/adbyby/bin"${murl2//\\//} +wget $murl -O $mfile +fi + +cd ./adbyby/bin +./startadbb + diff --git a/package/lean/adbyby-ram/files/luci/controller/adbyby.lua b/package/lean/adbyby-ram/files/luci/controller/adbyby.lua new file mode 100644 index 0000000000..1347cfb33d --- /dev/null +++ b/package/lean/adbyby-ram/files/luci/controller/adbyby.lua @@ -0,0 +1,10 @@ + +module("luci.controller.adbyby", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/adbyby") then + return + end + + entry({"admin","services", "adbyby"}, cbi("adbyby"), _("Adbyby"), 20) +end diff --git a/package/lean/adbyby-ram/files/luci/i18n/adbyby.zh-cn.po b/package/lean/adbyby-ram/files/luci/i18n/adbyby.zh-cn.po new file mode 100644 index 0000000000..6677ff6463 --- /dev/null +++ b/package/lean/adbyby-ram/files/luci/i18n/adbyby.zh-cn.po @@ -0,0 +1,38 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + +msgid "Not exist" +msgstr "不存在" + +msgid "AD Block" +msgstr "广告屏蔽" + +msgid "Disable" +msgstr "停用" + +msgid "Enable" +msgstr "启用" + +msgid "Running Status" +msgstr "运行状态" + +msgid "Lazy rules time" +msgstr "Lazy规则日期" + +msgid "Video rules time" +msgstr "Video规则日期" + +msgid "Running" +msgstr "运行中" + +msgid "Not Running" +msgstr "未运行" + +msgid "Wait Connect.." +msgstr "等待联网" + +msgid "Enable Adbyby" +msgstr "是否启用Adbyby" + +msgid "Adbyby" +msgstr "广告屏蔽" diff --git a/package/lean/adbyby-ram/files/luci/model/cbi/adbyby.lua b/package/lean/adbyby-ram/files/luci/model/cbi/adbyby.lua new file mode 100644 index 0000000000..cf7e191850 --- /dev/null +++ b/package/lean/adbyby-ram/files/luci/model/cbi/adbyby.lua @@ -0,0 +1,72 @@ + +local m, s, o,oo +local Run_flag=0 +local lazy_time=translate("Not exist") +local video_time=translate("Not exist") +local sys = require "luci.sys" +icount=tonumber(sys.exec("ps -w | grep adbyby |grep -v grep| wc -l")) +if tonumber(icount)>0 then +icount=tonumber(sys.exec("netstat -nautp | grep adbyby |grep -v grep| wc -l")) +if tonumber(icount)>0 then +Run_flag=1 +else +Run_flag=2 +end +end + +if nixio.fs.access("/tmp/adbyby/bin/data/lazy.txt") then +time_cmd="awk 'NR==1{print $3\" \"$4}' /tmp/adbyby/bin/data/lazy.txt" +lazy_time=sys.exec(time_cmd) +end + +if nixio.fs.access("/tmp/adbyby/bin/data/video.txt") then +time_cmd="awk 'NR==1{print $3\" \"$4}' /tmp/adbyby/bin/data/video.txt" +video_time=sys.exec(time_cmd) +end +m = Map("adbyby", translate("AD Block")) + + +s = m:section(NamedSection, "adbyby","adbyby", "") +s.addremove = false + +oo = s:option(ListValue, "enable",translate("Enable Adbyby")) +oo:value("0", translate("Disable")) +oo:value("1", translate("Enable")) +oo.widget = "radio" +oo.advance_second_title = true +oo.orientation = "horizontal" + +o=s:option(DummyValue, "runstatus",translate("Running Status")) +o.rawhtml = true +if Run_flag==1 then +o.value="" .. translate("Running") .. "" +elseif Run_flag==0 then +o.value="" .. translate("Not Running") .. "" +else +o.value="" .. translate("Wait Connect..") .. "" +end + +o=s:option(DummyValue, "version1",translate("Lazy rules time")) +o.rawhtml = true +o.value="" .. lazy_time .. "" + +o=s:option(DummyValue, "version2",translate("Video rules time")) +o.rawhtml = true +o.value="" .. video_time .. "" + +local apply = luci.http.formvalue("cbi.apply") +if apply then +local m_enable=luci.http.formvalue("cbid.adbyby.adbyby.enable") + if m_enable=="0" then + luci.sys.call("/etc/init.d/adbyby_ram disable") + luci.sys.call("/etc/init.d/adbyby_ram stop") + else + luci.sys.call("/etc/init.d/adbyby_ram enable") + luci.sys.call("/etc/init.d/adbyby_ram start") + end + + +--luci.http.redirect(luci.dispatcher.build_url("admin/services/adbyby")) +end + +return m diff --git a/package/lean/automount/Makefile b/package/lean/automount/Makefile index 8881a060d0..3d8589c903 100644 --- a/package/lean/automount/Makefile +++ b/package/lean/automount/Makefile @@ -17,7 +17,7 @@ include $(INCLUDE_DIR)/package.mk define Package/automount TITLE:=Mount autoconfig hotplug script. MAINTAINER:=Lean - DEPENDS:=block-mount +kmod-usb-storage +kmod-usb-storage-extras +kmod-fs-ext4 +kmod-fs-vfat +kmod-fs-exfat +ntfs-3g + DEPENDS:=block-mount +kmod-usb-storage +kmod-usb-storage-extras +kmod-fs-ext4 +kmod-fs-vfat +ntfs-3g endef define Package/automount/description diff --git a/package/lean/ddns-scripts_aliyun/Makefile b/package/lean/ddns-scripts_aliyun/Makefile new file mode 100644 index 0000000000..e35cef5a4d --- /dev/null +++ b/package/lean/ddns-scripts_aliyun/Makefile @@ -0,0 +1,72 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=ddns-scripts_aliyun +PKG_VERSION:=1.0.0 +PKG_RELEASE:=1 + +PKG_LICENSE:=GPLv2 +PKG_MAINTAINER:=Sense + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/$(PKG_NAME) + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE:=DDNS extension for AliYun.com + PKGARCH:=all + DEPENDS:=+ddns-scripts +wget +openssl-util +endef + +define Package/$(PKG_NAME)/description + Dynamic DNS Client scripts extension for AliYun.com +endef + +define Build/Configure +endef + +define Build/Compile + $(CP) ./*.sh $(PKG_BUILD_DIR) +endef + +define Package/$(PKG_NAME)/preinst + #!/bin/sh + # if NOT run buildroot then stop service + [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 + exit 0 # suppress errors +endef + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/usr/lib/ddns + $(INSTALL_BIN) $(PKG_BUILD_DIR)/update_aliyun_com.sh $(1)/usr/lib/ddns +endef + +define Package/$(PKG_NAME)/postinst + #!/bin/sh + # remove old services file entries + /bin/sed -i '/aliyun\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1 + /bin/sed -i '/aliyun\.com/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1 + # and create new + printf "%s\\t\\t%s\\n" '"aliyun.com"' '"update_aliyun_com.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services + printf "%s\\t\\t%s\\n" '"aliyun.com"' '"update_aliyun_com.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6 + # on real system restart service if enabled + [ -z "$${IPKG_INSTROOT}" ] && { + /etc/init.d/ddns enabled && \ + /etc/init.d/ddns start >/dev/null 2>&1 + } + exit 0 # suppress errors +endef + +define Package/$(PKG_NAME)/prerm + #!/bin/sh + # if NOT run buildroot then stop service + [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 + # remove services file entries + /bin/sed -i '/aliyun\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1 + /bin/sed -i '/aliyun\.com/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1 + exit 0 # suppress errors +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/package/lean/ddns-scripts_aliyun/update_aliyun_com.sh b/package/lean/ddns-scripts_aliyun/update_aliyun_com.sh new file mode 100755 index 0000000000..89ee909ceb --- /dev/null +++ b/package/lean/ddns-scripts_aliyun/update_aliyun_com.sh @@ -0,0 +1,233 @@ +#!/bin/sh +# +# 用于阿里云解析的DNS更新脚本 +# 2017-2018 Sense +# 阿里云解析API文档 https://help.aliyun.com/document_detail/29739.html +# +# 本脚本由 dynamic_dns_functions.sh 内的函数 send_update() 调用 +# +# 需要在 /etc/config/ddns 中设置的选项 +# option username - 阿里云API访问账号 Access Key ID。可通过 aliyun.com 帐号管理的 accesskeys 获取, 或者访问 https://ak-console.aliyun.com +# option password - 阿里云API访问密钥 Access Key Secret +# option domain - 完整的域名。建议主机与域名之间使用 @符号 分隔,否则将以第一个 .符号 之前的内容作为主机名 +# + +# 检查传入参数 +[ -z "$username" ] && write_log 14 "配置错误!保存阿里云API访问账号的'用户名'不能为空" +[ -z "$password" ] && write_log 14 "配置错误!保存阿里云API访问密钥的'密码'不能为空" + +# 检查外部调用工具 +[ -n "$WGET_SSL" ] || write_log 13 "使用阿里云API需要 GNU Wget 支持,请先安装" +command -v sed >/dev/null 2>&1 || write_log 13 "使用阿里云API需要 sed 支持,请先安装" +command -v openssl >/dev/null 2>&1 || write_log 13 "使用阿里云API需要 openssl-util 支持,请先安装" + +# 包含用于解析 JSON 格式返回值的函数 +. /usr/share/libubox/jshn.sh + +# 变量声明 +local __HOST __DOMAIN __TYPE __URLBASE __CMDBASE __URLARGS __SEPARATOR __RECID +[ $use_https -eq 0 ] && __URLBASE="http://alidns.aliyuncs.com/" || __URLBASE="https://alidns.aliyuncs.com/" +__SEPARATOR="&" + +# 从 $domain 分离主机和域名 +[ "${domain:0:2}" == "@." ] && domain="${domain/./}" # 主域名处理 +[ "$domain" == "${domain/@/}" ] && domain="${domain/./@}" # 未找到分隔符,兼容常用域名格式 +__HOST="${domain%%@*}" +__DOMAIN="${domain#*@}" +[ -z "$__HOST" -o "$__HOST" == "$__DOMAIN" ] && __HOST="@" + +# 设置记录类型 +[ $use_ipv6 -eq 0 ] && __TYPE="A" || __TYPE="AAAA" + +# 构造基本通信命令 +build_command() { + __CMDBASE="$WGET_SSL -nv -t 1 -O $DATFILE -o $ERRFILE" + # 绑定用于通信的主机/IP + if [ -n "$bind_network" ]; then + local bind_ip run_prog + [ $use_ipv6 -eq 0 ] && run_prog="network_get_ipaddr" || run_prog="network_get_ipaddr6" + eval "$run_prog bind_ip $bind_network" || \ + write_log 13 "无法使用 '$run_prog $bind_network' 获取本地IP地址 - 错误代码: '$?'" + write_log 7 "强制使用IP '$bind_ip' 通信" + __CMDBASE="$__CMDBASE --bind-address=$bind_ip" + fi + # 强制设定IP版本 + if [ $force_ipversion -eq 1 ]; then + [ $use_ipv6 -eq 0 ] && __CMDBASE="$__CMDBASE -4" || __CMDBASE="$__CMDBASE -6" + fi + # 设置CA证书参数 + if [ $use_https -eq 1 ]; then + if [ "$cacert" = "IGNORE" ]; then + __CMDBASE="$__CMDBASE --no-check-certificate" + elif [ -f "$cacert" ]; then + __CMDBASE="$__CMDBASE --ca-certificate=${cacert}" + elif [ -d "$cacert" ]; then + __CMDBASE="$__CMDBASE --ca-directory=${cacert}" + elif [ -n "$cacert" ]; then + write_log 14 "在 '$cacert' 中未找到用于 HTTPS 通信的有效证书" + fi + fi + # 如果没有设置,禁用代理 (这可能是 .wgetrc 或环境设置错误) + [ -z "$proxy" ] && __CMDBASE="$__CMDBASE --no-proxy" +} + +# 用于阿里云API的通信函数 +aliyun_transfer() { + local __PARAM=$* + local __CNT=0 + local __RUNPROG __ERR PID_SLEEP + + [ $# -eq 0 ] && write_log 12 "'aliyun_transfer()' 出错 - 参数数量错误" + + while : ; do + build_Request $__PARAM + __RUNPROG="$__CMDBASE '${__URLBASE}?${__URLARGS}'" + + write_log 7 "#> $__RUNPROG" + eval $__RUNPROG + __ERR=$? + [ $__ERR -eq 0 ] && return 0 + + write_log 3 "wget 错误代码: '$__ERR'" + write_log 7 "$(cat $ERRFILE)" + + if [ $VERBOSE -gt 1 ]; then + write_log 4 "传输失败 - 详细模式: $VERBOSE - 出错后不再重试" + return 1 + fi + + __CNT=$(( $__CNT + 1 )) + [ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \ + write_log 14 "$retry_count 次重试后传输还是失败" + + write_log 4 "传输失败 - $__CNT/$retry_count 在 $RETRY_SECONDS 秒后重试" + sleep $RETRY_SECONDS & + PID_SLEEP=$! + wait $PID_SLEEP + PID_SLEEP=0 + done +} + +# 百分号编码 +percentEncode() { + if [ -z "${1//[A-Za-z0-9_.~-]/}" ]; then + echo -n "$1" + else + local string=$1; local i=0; local ret chr + while [ $i -lt ${#string} ]; do + chr=${string:$i:1} + [ -z "${chr#[^A-Za-z0-9_.~-]}" ] && chr=$(printf '%%%02X' "'$chr") + ret="$ret$chr" + i=$(( $i + 1 )) + done + echo -n "$ret" + fi +} + +# 构造阿里云解析请求参数 +build_Request() { + local args=$*; local string + local HTTP_METHOD="GET" + + # 添加请求参数 + __URLARGS= + for string in $args; do + case "${string%%=*}" in + Format|Version|AccessKeyId|SignatureMethod|Timestamp|SignatureVersion|SignatureNonce|Signature) ;; # 过滤公共参数 + *) __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}");; + esac + done + __URLARGS="${__URLARGS:1}" + + # 附加公共参数 + string="Format=JSON"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}") + string="Version=2015-01-09"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}") + string="AccessKeyId=$username"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}") + string="SignatureMethod=HMAC-SHA1"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}") + string="Timestamp="$(date -u '+%Y-%m-%dT%H:%M:%SZ'); __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}") + string="SignatureVersion=1.0"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}") + string="SignatureNonce="$(cat '/proc/sys/kernel/random/uuid'); __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}") + + # 对请求参数进行排序,用于生成签名 + string=$(echo -n "$__URLARGS" | sed 's/\'"${__SEPARATOR}"'/\n/g' | sort | sed ':label; N; s/\n/\'"${__SEPARATOR}"'/g; b label') + # 构造用于计算签名的字符串 + string="${HTTP_METHOD}${__SEPARATOR}"$(percentEncode "/")"${__SEPARATOR}"$(percentEncode "$string") + # 字符串计算签名HMAC值 + local signature=$(echo -n "$string" | openssl dgst -sha1 -hmac "${password}&" -binary) + # HMAC值编码成字符串,得到签名值 + signature=$(echo -n "$signature" | openssl base64) + + # 附加签名参数 + string="Signature=$signature"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}") +} + +# 添加解析记录 +add_domain() { + local value + aliyun_transfer "Action=AddDomainRecord" "DomainName=${__DOMAIN}" "RR=${__HOST}" "Type=${__TYPE}" "Value=${__IP}" || write_log 14 "服务器通信失败" + json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1 + json_get_var value "RecordId" + [ -z "$value" ] && write_log 14 "添加新解析记录失败" + write_log 7 "添加新解析记录成功" + return 0 +} + +# 修改解析记录 +update_domain() { + local value + aliyun_transfer "Action=UpdateDomainRecord" "RecordId=${__RECID}" "RR=${__HOST}" "Type=${__TYPE}" "Value=${__IP}" || write_log 14 "服务器通信失败" + json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1 + json_get_var value "RecordId" + [ -z "$value" ] && write_log 14 "修改解析记录失败" + write_log 7 "修改解析记录成功" + return 0 +} + +# 启用解析记录 +enable_domain() { + local value + aliyun_transfer "Action=SetDomainRecordStatus" "RecordId=${__RECID}" "Status=Enable" || write_log 14 "服务器通信失败" + json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1 + json_get_var value "Status" + [ "$value" != "Enable" ] && write_log 14 "启用解析记录失败" + write_log 7 "启用解析记录成功" + return 0 +} + +# 获取子域名解析记录列表 +describe_domain() { + local value type; local ret=0 + aliyun_transfer "Action=DescribeSubDomainRecords" "SubDomain=${__HOST}.${__DOMAIN}" || write_log 14 "服务器通信失败" + json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1 + json_get_var value "TotalCount" + if [ $value -eq 0 ]; then + write_log 7 "解析记录不存在" + ret=1 + else + json_select "DomainRecords" >/dev/null 2>&1 + json_select "Record" >/dev/null 2>&1 + json_select 1 >/dev/null 2>&1 + json_get_var value "Locked" + [ $value -ne 0 ] && write_log 14 "解析记录被锁定" + json_get_var __RECID "RecordId" + write_log 7 "获得解析记录ID: ${__RECID}" + json_get_var value "Status" + [ "$value" != "ENABLE" ] && ret=$(( $ret | 2 )) && write_log 7 "解析记录被禁用" + json_get_var type "Type" + json_get_var value "Value" + [ "$type" != "${__TYPE}" -o "$value" != "${__IP}" ] && ret=$(( $ret | 4 )) && write_log 7 "地址或类型需要修改" + fi + return $ret +} + +build_command +describe_domain +ret=$? +if [ $ret -eq 1 ]; then + sleep 3 && add_domain +else + [ $(( $ret & 2 )) -ne 0 ] && sleep 3 && enable_domain + [ $(( $ret & 4 )) -ne 0 ] && sleep 3 && update_domain +fi + +return 0 diff --git a/package/lean/default-settings/Makefile b/package/lean/default-settings/Makefile index 4cfd87bd34..d8170a2545 100644 --- a/package/lean/default-settings/Makefile +++ b/package/lean/default-settings/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=default-settings PKG_VERSION:=1.0 -PKG_RELEASE:=26 +PKG_RELEASE:=33 PKG_LICENSE:=GPLv3 PKG_LICENSE_FILES:=LICENSE diff --git a/package/lean/default-settings/files/zzz-default-settings b/package/lean/default-settings/files/zzz-default-settings index e9c1b06df3..4b11abb7e2 100755 --- a/package/lean/default-settings/files/zzz-default-settings +++ b/package/lean/default-settings/files/zzz-default-settings @@ -3,7 +3,7 @@ uci set luci.main.lang=zh_cn uci commit luci -uci set system.@system[0].hostname=LEDE +uci set system.@system[0].hostname=OpenWrt uci set system.@system[0].timezone=CST-8 uci set system.@system[0].zonename=Asia/Shanghai uci commit system @@ -27,8 +27,7 @@ sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/p910nd.lua sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/usb_printer.lua sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/xunlei.lua -[ ! -f /usr/bin/ip ] && ln -sf /sbin/ip /usr/bin/ip -(opkg list-installed | grep ip-full >/dev/null 2>&1) && ln -sf /usr/sbin/ip /usr/bin/ip +ln -sf /sbin/ip /usr/bin/ip rm -rf /tmp/luci-modulecache/ rm -f /tmp/luci-indexcache @@ -47,9 +46,9 @@ sed -i '/set wireless.radio${devidx}.disabled/d' /lib/wifi/mac80211.sh wifi up sed -i '/DISTRIB_REVISION/d' /etc/openwrt_release -echo "DISTRIB_REVISION='R7.4.4 By Lean'" >> /etc/openwrt_release +echo "DISTRIB_REVISION='R7.5.4 By Lean'" >> /etc/openwrt_release sed -i '/DISTRIB_DESCRIPTION/d' /etc/openwrt_release -echo "DISTRIB_DESCRIPTION='LEDE 17.01.4'" >> /etc/openwrt_release +echo "DISTRIB_DESCRIPTION='OpenWrt '" >> /etc/openwrt_release exit 0 diff --git a/package/lean/default-settings/i18n/more.zh-cn.po b/package/lean/default-settings/i18n/more.zh-cn.po index 1e0f34f088..6cfb4c4207 100644 --- a/package/lean/default-settings/i18n/more.zh-cn.po +++ b/package/lean/default-settings/i18n/more.zh-cn.po @@ -561,3 +561,368 @@ msgstr "" msgid "unreachable (reject)" msgstr "不可达(拒绝)" + +msgid "%d IPv4-only hosts" +msgstr "%d 个主机仅支持 IPv4" + +msgid "%d IPv6-only hosts" +msgstr "%d 个主机仅支持 IPv6" + +msgid "%d dual-stack hosts" +msgstr "%d 个双协议栈主机" + +msgid "%s and %s" +msgstr "%s 和 %s" + +msgid "%s, %s and %s" +msgstr "%s, %s 和 %s" + +msgid "-1 - Restart every last day of month" +msgstr "-1 - 每月的最后一天重新开始" + +msgid "-7 - Restart a week before end of month" +msgstr "-7 - 每月底前一周重新开始" + +msgid "1 - Restart every 1st of month" +msgstr "1 - 每月的第一天重新开始" + +msgid "10m - frequent commits at the expense of flash wear" +msgstr "10m - 频繁提交,闪存损耗的开销也增大" + +msgid "12h - compromise between risk of data loss and flash wear" +msgstr "12h - 平衡统计数据丢失的风险以及闪存使用寿命" + +msgid "24h - least flash wear at the expense of data loss risk" +msgstr "24h - 以数据丢失风险的代价换取最小的闪存损耗" + +msgid "30s - refresh twice per minute for reasonably current stats" +msgstr "30s - 每分钟刷新二次以获得较准确的当前统计值" + +msgid "5m - rarely refresh to avoid frequently clearing conntrack counters" +msgstr "5m - 较少刷新以避免频繁清除连接跟踪计数器" + +msgid "60s - commit minutely, useful for non-flash storage" +msgstr "60s - 每分钟提交,适用于非闪存类型存储" + +msgid "0 connections" +msgstr "连接:0" + +msgid "0 hosts" +msgstr "主机:0" + +msgid "0% IPv6 support rate among hosts" +msgstr "支持 IPv6 的主机比例:0%" + +msgid "0B total IPv6 download" +msgstr "IPv6 总下载量:0B" + +msgid "0% of the total traffic is IPv6" +msgstr "IPv6 流量比例:0%" + +msgid "0B total IPv6 upload" +msgstr "IPv6 总上传量:0B" + +msgid "0 cause the most connections" +msgstr "0 是连接数最多的协议" + +msgid "0 cause the most download" +msgstr "0 是下载量最大的协议" + +msgid "0 cause the most upload" +msgstr "0 是上传量最大的协议" + +msgid "0 different application protocols" +msgstr "0 种不同的应用层协议" + +msgid "0 download" +msgstr "下载:0" + +msgid "0 upload" +msgstr "上传:0" + +msgid "Accounting period" +msgstr "统计周期" + +msgid "Advanced Settings" +msgstr "高级设置" + +msgid "Application" +msgstr "应用层协议" + +msgid "Application Protocols" +msgstr "应用层协议" + +msgid "Backup" +msgstr "备份" + +msgid "Bandwidth Monitor" +msgstr "带宽监控" + +msgid "CSV, grouped by IP" +msgstr "CSV,按 IP 分组" + +msgid "CSV, grouped by MAC" +msgstr "CSV,按 MAC 分组" + +msgid "CSV, grouped by protocol" +msgstr "CSV,按协议分组" + +msgid "" +"Changing the accounting interval type will invalidate existing databases!" +"
Download backup." +msgstr "" +"更改统计周期类型会使现有数据库无效!
下载备份." + +msgid "" +"Choose \"Day of month\" to restart the accounting period monthly on a " +"specific date, e.g. every 3rd. Choose \"Fixed interval\" to restart the " +"accounting period exactly every N days, beginning at a given date." +msgstr "" +"选择“每月的某一天”来设置统计周期的重启时间,例如:每个月的第 3 天。选择“固定周" +"期”来设置从给定日期开始每 N 天重启统计周期。" + +msgid "Commit interval" +msgstr "提交间隔" + +msgid "Compress database" +msgstr "压缩数据库" + +msgid "Configuration" +msgstr "配置" + +msgid "Conn." +msgstr "连接" + +msgid "Connections" +msgstr "连接" + +msgid "Connections / Host" +msgstr "连接 / 主机" + +msgid "Database directory" +msgstr "数据库目录" + +msgid "" +"Database storage directory. One file per accounting period will be placed " +"into this directory." +msgstr "数据库存储目录。每个“统计周期”的文件将被放到这个目录中。" + +msgid "Day of month" +msgstr "每月的某一天" + +msgid "" +"Day of month to restart the accounting period. Use negative values to count " +"towards the end of month, e.g. \"-5\" to specify the 27th of July or the " +"24th of Februrary." +msgstr "" +"每个月重启统计周期的日期。使用负数表示从月底开始计算,例如:\"-5\" 可以表" +"示 7 月份的 27 号或者 2 月份的 24 号。" + +msgid "Display" +msgstr "显示" + +msgid "Down. (Bytes / Pkts.)" +msgstr "下载(字节 / 数据包)" + +msgid "Download (Bytes / Packets)" +msgstr "下载(字节 / 数据包)" + +msgid "Download / Application" +msgstr "下载 / 应用层协议" + +msgid "Download Database Backup" +msgstr "下载数据库备份" + +msgid "Dualstack enabled hosts" +msgstr "双协议栈主机" + +msgid "Due date" +msgstr "重置日期" + +msgid "Export" +msgstr "导出" + +msgid "Family" +msgstr "协议类型" + +msgid "Fixed interval" +msgstr "固定周期" + +msgid "Force reload…" +msgstr "强制重新加载..." + +msgid "General Settings" +msgstr "基本设置" + +msgid "Generate Backup" +msgstr "生成备份" + +msgid "Host" +msgstr "主机" + +msgid "Hostname: example.org" +msgstr "主机名:example.org" + +msgid "IPv4 vs. IPv6" +msgstr "IPv4 与 IPv6" + +msgid "IPv6" +msgstr "IPv6" + +msgid "Interval" +msgstr "周期" + +msgid "" +"Interval at which the temporary in-memory database is committed to the " +"persistent database directory." +msgstr "将内存中的临时数据库提交到持久性数据库目录的间隔时间。" + +msgid "" +"Interval at which traffic counters of still established connections are " +"refreshed from netlink information." +msgstr "从 netlink 信息中刷新“已建立连接”的流量计数器的间隔时间。" + +msgid "Invalid or empty backup archive" +msgstr "备份存档无效或为空" + +msgid "JSON dump" +msgstr "JSON 输出" + +msgid "Length of accounting interval in days." +msgstr "统计周期(天)。" + +msgid "Local interfaces" +msgstr "本地接口" + +msgid "Local subnets" +msgstr "本地子网" + +msgid "MAC" +msgstr "MAC" + +msgid "Maximum entries" +msgstr "最大条目" + +msgid "" +"Maximum number of accounting periods to keep, use zero to keep databases " +"forever." +msgstr "保留的统计周期数据库的最大数量,设置 0 表示不限制。" + +msgid "Netlink Bandwidth Monitor" +msgstr "网络带宽监视器" + +msgid "Netlink Bandwidth Monitor - Backup / Restore" +msgstr "网络带宽监视器 - 备份 / 恢复" + +msgid "Netlink Bandwidth Monitor - Configuration" +msgstr "网络带宽监视器 - 配置" + +msgid "No data recorded yet." +msgstr "暂无数据记录。" + +msgid "Only conntrack streams from or to any of these networks are counted." +msgstr "仅统计来自或目标为这些网络接口的连接流量。" + +msgid "Only conntrack streams from or to any of these subnets are counted." +msgstr "仅统计来自或目标为这些子网的连接流量。" + +msgid "Preallocate database" +msgstr "预分配数据库" + +msgid "Protocol" +msgstr "协议" + +msgid "Protocol Mapping" +msgstr "协议映射" + +msgid "" +"Protocol mappings to distinguish traffic types per host, one mapping per " +"line. The first value specifies the IP protocol, the second value the port " +"number and the third column is the name of the mapped protocol." +msgstr "" +"协议映射用于区分流量类型,每行一条。第一个值指定 IP 协议类型,第二个值是" +"端口号,第三个值是映射的协议名称。" + +msgid "Refresh interval" +msgstr "刷新间隔" + +msgid "Restore" +msgstr "恢复" + +msgid "Restore Database Backup" +msgstr "恢复数据库备份" + +msgid "Select accounting period:" +msgstr "选择统计周期:" + +msgid "Source IP" +msgstr "源 IP" + +msgid "Start date" +msgstr "起始日期" + +msgid "Start date of the first accounting period, e.g. begin of ISP contract." +msgstr "第一个统计周期的起始日期,例如:ISP 合约的起始日期。" + +msgid "Stored periods" +msgstr "储存周期" + +msgid "" +"The Netlink Bandwidth Monitor (nlbwmon) is a lightweight, efficient traffic " +"accounting program keeping track of bandwidth usage per host and protocol." +msgstr "" +"网络带宽监视器(nlbwmon)是一个轻量、高效的流量统计程序,可以统计每个主机和" +"协议的带宽使用情况。" + +msgid "The following database files have been restored: %s" +msgstr "以下数据库文件已恢复:%s" + +msgid "" +"The maximum amount of entries that should be put into the database, setting " +"the limit to 0 will allow databases to grow indefinitely." +msgstr "数据库中的最大条目数量, 设置为 0 将允许数据库无限增长。" + +msgid "Traffic / Host" +msgstr "流量 / 主机" + +msgid "Traffic Distribution" +msgstr "流量分布" + +msgid "Up. (Bytes / Pkts.)" +msgstr "上传(字节 / 数据包)" + +msgid "Upload (Bytes / Packets)" +msgstr "上传(字节 / 数据包)" + +msgid "Upload / Application" +msgstr "上传 / 应用层协议" + +msgid "Vendor: Example Corp." +msgstr "供应商: Example Corp." + +msgid "Warning" +msgstr "警告" + +msgid "" +"Whether to gzip compress archive databases. Compressing the database files " +"makes accessing old data slightly slower but helps to reduce storage " +"requirements." +msgstr "" +"是否使用 gzip 压缩数据库存档。压缩数据库文件会使访问旧数据稍微慢一些, 但有助" +"于减少存储占用空间。" + +msgid "" +"Whether to preallocate the maximum possible database size in memory. This is " +"mainly useful for memory constrained systems which might not be able to " +"satisfy memory allocation after longer uptime periods." +msgstr "" +"是否预先分配数据库最大可能占用的内存大小。这主要适用于内存较小系统,这些系统" +"在长时间运行之后可能无法满足数据库的内存需求。" + +msgid "no traffic" +msgstr "无流量数据" + +msgid "other" +msgstr "其他" + diff --git a/package/utils/k3screenctrl/Makefile b/package/lean/k3screenctrl/Makefile similarity index 100% rename from package/utils/k3screenctrl/Makefile rename to package/lean/k3screenctrl/Makefile diff --git a/package/utils/k3screenctrl/files/k3screenctrl.init b/package/lean/k3screenctrl/files/k3screenctrl.init similarity index 100% rename from package/utils/k3screenctrl/files/k3screenctrl.init rename to package/lean/k3screenctrl/files/k3screenctrl.init diff --git a/package/lean/luci-app-adbyby-plus/Makefile b/package/lean/luci-app-adbyby-plus/Makefile index 9670bf3078..3a60dd9abb 100644 --- a/package/lean/luci-app-adbyby-plus/Makefile +++ b/package/lean/luci-app-adbyby-plus/Makefile @@ -10,7 +10,7 @@ LUCI_DEPENDS:=+adbyby +wget +ipset +coreutils +coreutils-nohup +dnsmasq-full LUCI_PKGARCH:=all PKG_NAME:=luci-app-adbyby-plus PKG_VERSION:=2.0 -PKG_RELEASE:=25 +PKG_RELEASE:=27 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/lean/luci-app-adbyby-plus/root/etc/config/adbyby b/package/lean/luci-app-adbyby-plus/root/etc/config/adbyby index 7a11e0d770..384c018f6d 100644 --- a/package/lean/luci-app-adbyby-plus/root/etc/config/adbyby +++ b/package/lean/luci-app-adbyby-plus/root/etc/config/adbyby @@ -4,7 +4,7 @@ config adbyby option lan_mode '0' option cron_mode '1' option block_ios '1' - option enable '1' + option enable '0' option wan_mode '1' option mem_mode '1' option update_source '0' diff --git a/package/lean/luci-app-adbyby-plus/root/etc/uci-defaults/adbyby b/package/lean/luci-app-adbyby-plus/root/etc/uci-defaults/adbyby index cdf3be3d7b..fb4b36f39f 100755 --- a/package/lean/luci-app-adbyby-plus/root/etc/uci-defaults/adbyby +++ b/package/lean/luci-app-adbyby-plus/root/etc/uci-defaults/adbyby @@ -15,6 +15,7 @@ EOF mkdir -p /etc/dnsmasq.d +/etc/init.d/adbyby stop /etc/init.d/adbyby enable rm -f /tmp/luci-indexcache diff --git a/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adblack.conf b/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adblack.conf index 4a0b2b05cc..a532f5825b 100644 --- a/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adblack.conf +++ b/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adblack.conf @@ -1,8 +1,4 @@ gvod.aiseejapp.atianqi.com -home.xl9.xunlei.com -hub5btmain.sandai.net -hub5emu.sandai.net -upgrade.xl9.xunlei.com stat.pandora.xiaomi.com upgrade.mishop.pandora.xiaomi.com logonext.tv.kuyun.com diff --git a/package/lean/luci-app-aliddns/Makefile b/package/lean/luci-app-aliddns/Makefile deleted file mode 100644 index e3f10e5d2f..0000000000 --- a/package/lean/luci-app-aliddns/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (C) 2008-2014 The LuCI Team -# -# This is free software, licensed under the Apache License, Version 2.0 . -# - -include $(TOPDIR)/rules.mk - -LUCI_TITLE:=LuCI for Aliddns -LUCI_DEPENDS:=+wget +openssl-util -LUCI_PKGARCH:=all -PKG_VERSION:=1.0 -PKG_RELEASE:=1 - -include $(TOPDIR)/feeds/luci/luci.mk - -# call BuildPackage - OpenWrt buildroot signature - - diff --git a/package/lean/luci-app-aliddns/luasrc/controller/aliddns.lua b/package/lean/luci-app-aliddns/luasrc/controller/aliddns.lua deleted file mode 100644 index c62864560b..0000000000 --- a/package/lean/luci-app-aliddns/luasrc/controller/aliddns.lua +++ /dev/null @@ -1,4 +0,0 @@ -module("luci.controller.aliddns",package.seeall) -function index() -entry({"admin","services","aliddns"},cbi("aliddns"),_("Aliddns Client"),101) -end diff --git a/package/lean/luci-app-aliddns/luasrc/model/cbi/aliddns.lua b/package/lean/luci-app-aliddns/luasrc/model/cbi/aliddns.lua deleted file mode 100644 index 76b386ef81..0000000000 --- a/package/lean/luci-app-aliddns/luasrc/model/cbi/aliddns.lua +++ /dev/null @@ -1,52 +0,0 @@ -local a=require"luci.sys" -local e=luci.model.uci.cursor() -local e=require"nixio.fs" -require("luci.sys") -local t,e,o -local m,s -t=Map("aliddns",translate("阿里DDNS客户端"),translate("基于阿里云解析的私人DDNS解决方案")) - -e=t:section(TypedSection,"base") -e.anonymous=true - -e:tab("basic", translate("设置")) - -enable=e:taboption("basic",Flag,"enable",translate("开启"),translate("开启或关闭aliddns动态域名")) -enable.rmempty=false -token=e:taboption("basic",Value,"app_key",translate("APP KEY")) -email=e:taboption("basic",Value,"app_secret",translate("APP SECRET")) -iface=e:taboption("basic",ListValue,"interface",translate("选择外网接口"),translate("限定要动态aliddns的外网接口,如pppoe-wan")) -iface:value("",translate("选择要动态更新的外网接口")) -for t,e in ipairs(a.net.devices())do -if e~="lo"then iface:value(e)end -end -iface.rmempty=false -main=e:taboption("basic",Value,"main_domain",translate("主域名"),"想要解析的主域名,例如:baidu.com") -main.rmempty=false -sub=e:taboption("basic",Value,"sub_domain",translate("子域名"),"想要解析的子域名,例如:test hehe") -sub.rmempty=false -time=e:taboption("basic",Value,"time",translate("检查时间"),"域名检查时间,单位分钟,范围1-59") -time.rmempty=false - -e:tab("log", translate("更新记录")) ---e=t:section(TypedSection,"base",translate("更新记录")) -e.anonymous=true -local a="/var/log/aliddns.log" -tvlog=e:taboption("log",TextValue,"sylogtext") -tvlog.rows=14 -tvlog.readonly="readonly" -tvlog.wrap="off" -function tvlog.cfgvalue(e,e) -sylogtext="" -if a and nixio.fs.access(a)then -sylogtext=luci.sys.exec("tail -n 100 %s"%a) -end -return sylogtext -end -tvlog.write=function(e,e,e) -end -local e=luci.http.formvalue("cbi.apply") -if e then -io.popen("/etc/init.d/aliddns restart") -end -return t diff --git a/package/lean/luci-app-aliddns/po/zh-cn/aliddns.po b/package/lean/luci-app-aliddns/po/zh-cn/aliddns.po deleted file mode 100644 index 211e10d2c2..0000000000 --- a/package/lean/luci-app-aliddns/po/zh-cn/aliddns.po +++ /dev/null @@ -1,4 +0,0 @@ -msgid "Aliddns Client" -msgstr "阿里DDNS客户端" - - diff --git a/package/lean/luci-app-aliddns/root/etc/config/aliddns b/package/lean/luci-app-aliddns/root/etc/config/aliddns deleted file mode 100644 index 3dcd7e75af..0000000000 --- a/package/lean/luci-app-aliddns/root/etc/config/aliddns +++ /dev/null @@ -1,10 +0,0 @@ - -config base 'base' - option time '30' - option enable '0' - option app_key '1' - option app_secret '1' - option interface 'br-lan' - option main_domain '1.com' - option sub_domain '2' - diff --git a/package/lean/luci-app-aliddns/root/etc/init.d/aliddns b/package/lean/luci-app-aliddns/root/etc/init.d/aliddns deleted file mode 100755 index 93bb659e61..0000000000 --- a/package/lean/luci-app-aliddns/root/etc/init.d/aliddns +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=80 - -restart() -{ - /usr/sbin/aliddns -} - -start() -{ - /usr/sbin/aliddns -} - -stop() -{ - /usr/sbin/aliddns -} diff --git a/package/lean/luci-app-aliddns/root/etc/uci-defaults/luci-app-aliddns b/package/lean/luci-app-aliddns/root/etc/uci-defaults/luci-app-aliddns deleted file mode 100755 index c8dcb1e172..0000000000 --- a/package/lean/luci-app-aliddns/root/etc/uci-defaults/luci-app-aliddns +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - - -rm -f /tmp/luci-indexcache -exit 0 diff --git a/package/lean/luci-app-aliddns/root/usr/sbin/aliddns b/package/lean/luci-app-aliddns/root/usr/sbin/aliddns deleted file mode 100755 index 3c5c5a2583..0000000000 --- a/package/lean/luci-app-aliddns/root/usr/sbin/aliddns +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/sh - -aliddns_ak=`uci get aliddns.base.app_key 2>/dev/null` -aliddns_sk=`uci get aliddns.base.app_secret 2>/dev/null` -aliddns_record_id=`uci get aliddns.base.record_id 2>/dev/null` -time=`uci get aliddns.base.time 2>/dev/null` -aliddns_enable=`uci get aliddns.base.enable` -aliddns_domain=`uci get aliddns.base.main_domain 2>/dev/null` -aliddns_name=`uci get aliddns.base.sub_domain 2>/dev/null` -interface=`uci get aliddns.base.interface 2>/dev/null` -DATE=$(date +'%Y-%m-%d %H:%M:%S') -timestamp=`date -u "+%Y-%m-%dT%H%%3A%M%%3A%SZ"` -ip=$(ifconfig $interface 2> /dev/null | grep 'inet addr' | awk '{print $2}' | cut -d: -f2 2>/dev/null) - -check_aliddns() { -#ip=`wget -qO- http://whatismyip.akamai.com/ 2>/dev/null` -current_ip=`nslookup $aliddns_name.$aliddns_domain | grep "Address 1"|tail -n1|cut -d' ' -f3 2>/dev/null` -echo "$DATE 当前路由IP: ${ip}" >> /var/log/aliddns.log -echo "$DATE 远程解析IP: ${current_ip}" >> /var/log/aliddns.log -if [ "$ip" = "$current_ip" ] -then - echo "$DATE IP未改变,无需更新" >> /var/log/aliddns.log - exit 0 - else - echo "$DATE 更新中..." >> /var/log/aliddns.log -fi -} - -urlencode() { - # urlencode - - local length="${#1}" - i=0 - out="" - for i in $(awk "BEGIN { for ( i=0; i<$length; i++ ) { print i; } }") - do - local c="${1:$i:1}" - case $c in - [a-zA-Z0-9._-]) out="$out$c" ;; - *) out="$out`printf '%%%02X' "'$c"`" ;; - esac - i=$(($i + 1)) - done - echo -n $out -} - -send_request() { - local args="AccessKeyId=$aliddns_ak&Action=$1&Format=json&$2&Version=2015-01-09" - local hash=$(urlencode $(echo -n "GET&%2F&$(urlencode $args)" | openssl dgst -sha1 -hmac "$aliddns_sk&" -binary | openssl base64)) - wget -qO- "http://alidns.aliyuncs.com/?$args&Signature=$hash" 2> /dev/null -} - -get_recordid() { - grep -Eo '"RecordId":"[0-9]+"' | cut -d':' -f2 | tr -d '"' -} - -query_recordid() { - send_request "DescribeSubDomainRecords" "SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&SubDomain=$aliddns_name.$aliddns_domain&Timestamp=$timestamp" -} - -update_record() { - send_request "UpdateDomainRecord" "RR=$aliddns_name&RecordId=$1&SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&Timestamp=$timestamp&Type=A&Value=$ip" -} - -add_record() { - send_request "AddDomainRecord&DomainName=$aliddns_domain" "RR=$aliddns_name&SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&Timestamp=$timestamp&Type=A&Value=$ip" -} - -go_record() { -if [ "$aliddns_record_id" = "" ] -then - aliddns_record_id=`query_recordid | get_recordid` -fi -if [ "$aliddns_record_id" = "" ] -then - aliddns_record_id=`add_record | get_recordid` - echo "$DATE 添加 record $aliddns_record_id" >> /var/log/aliddns.log -else - update_record $aliddns_record_id - echo "$DATE 更新 record $aliddns_record_id" >> /var/log/aliddns.log -fi -# save to file -if [ "$aliddns_record_id" = "" ]; then - # failed - echo "$DATE : 更新出错,请检查设置!" >> /var/log/aliddns.log - exit 0 -else - uci set aliddns.base.record_id=$aliddns_record_id - uci commit - echo "$DATE : 更新成功!($ip)" >> /var/log/aliddns.log -fi -} -#将执行脚本写入crontab定时运行 -add_aliddns_cru(){ -wirtecron=$(cat /etc/crontabs/root | grep "$time * * * *" | grep aliddns) -if [ -z "$wirtecron" ];then - sed -i '/aliddns/d' /etc/crontabs/root >/dev/null 2>&1 - echo "*/$time * * * * /usr/sbin/aliddns" >> /etc/crontabs/root -fi -} - -#清除过多记录 -clean_log(){ -logrow=$(grep -c "" /var/log/aliddns.log) -if [ $logrow -ge 15 ];then - cat /dev/null > /var/log/aliddns.log - echo "$DATE Log条数超限,清空处理!" >> /var/log/aliddns.log -fi -} - -#停止服务 -stop_aliddns(){ - #停掉cru里的任务 - sed -i '/aliddns/d' /etc/crontabs/root >/dev/null 2>&1 -} - -if [ "$aliddns_enable" != "1" ]; then - stop_aliddns - echo "$DATE : aliddns没有开启!" >> /var/log/aliddns.log - else - clean_log - check_aliddns - go_record - add_aliddns_cru -fi - \ No newline at end of file diff --git a/package/lean/luci-app-ipsec-vpnd/Makefile b/package/lean/luci-app-ipsec-vpnd/Makefile index a145e33292..1bf6299b67 100644 --- a/package/lean/luci-app-ipsec-vpnd/Makefile +++ b/package/lean/luci-app-ipsec-vpnd/Makefile @@ -9,7 +9,7 @@ LUCI_TITLE:=LuCI support for IPSec VPN Server (IKEv1 with PSK and Xauth) LUCI_DEPENDS:=+strongswan-minimal +strongswan-mod-xauth-generic LUCI_PKGARCH:=all PKG_VERSION:=2.0 -PKG_RELEASE:=5 +PKG_RELEASE:=6 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/lean/luci-app-ipsec-vpnd/root/etc/ipsec.include b/package/lean/luci-app-ipsec-vpnd/root/etc/ipsec.include index 84129f6439..d887c623d0 100755 --- a/package/lean/luci-app-ipsec-vpnd/root/etc/ipsec.include +++ b/package/lean/luci-app-ipsec-vpnd/root/etc/ipsec.include @@ -1,3 +1,8 @@ +iptables -D FORWARD -m policy --dir in --pol ipsec --proto esp -j ACCEPT 2>/dev/null +iptables -D FORWARD -m policy --dir out --pol ipsec --proto esp -j ACCEPT 2>/dev/null +iptables -D INPUT -m policy --dir in --pol ipsec --proto esp -j ACCEPT 2>/dev/null +iptables -D OUTPUT -m policy --dir out --pol ipsec --proto esp -j ACCEPT 2>/dev/null + iptables -I FORWARD -m policy --dir in --pol ipsec --proto esp -j ACCEPT iptables -I FORWARD -m policy --dir out --pol ipsec --proto esp -j ACCEPT iptables -I INPUT -m policy --dir in --pol ipsec --proto esp -j ACCEPT diff --git a/package/lean/luci-app-kuainiao/Makefile b/package/lean/luci-app-kuainiao/Makefile deleted file mode 100644 index 6e8319b3f8..0000000000 --- a/package/lean/luci-app-kuainiao/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (C) 2016 Openwrt.org -# -# This is free software, licensed under the Apache License, Version 2.0 . -# - -include $(TOPDIR)/rules.mk - -LUCI_TITLE:=LuCI support for Kuainiao -LUCI_DEPENDS:=+kmod-ppp +openssl-util +wget +kmod-mppe -LUCI_PKGARCH:=all -PKG_VERSION:=1.0 -PKG_RELEASE:=3 - -include $(TOPDIR)/feeds/luci/luci.mk - -# call BuildPackage - OpenWrt buildroot signature - diff --git a/package/lean/luci-app-kuainiao/luasrc/controller/kuainiao.lua b/package/lean/luci-app-kuainiao/luasrc/controller/kuainiao.lua deleted file mode 100644 index 378517c42a..0000000000 --- a/package/lean/luci-app-kuainiao/luasrc/controller/kuainiao.lua +++ /dev/null @@ -1,34 +0,0 @@ -module("luci.controller.kuainiao", package.seeall) - -function index() - local fs = luci.fs or nixio.fs - if not fs.access("/etc/config/kuainiao") then - return - end - - local page = entry({"admin", "services", "kuainiao"}, cbi("kuainiao"), _("Kuai Niao"),201) - page.dependent = true - entry({"admin","services","kuainiao","status"},call("kuainiao_status")).leaf=true - entry({"admin","services","kuainiao","dwonstatus"},call("down_status")).leaf=true - entry({"admin","services","kuainiao","upstatus"},call("up_status")).leaf=true -end - -function kuainiao_status() -local e={} -e.running=luci.sys.exec("ps |grep -v grep |grep -w '/usr/bin/kuainiao' ") -luci.http.prepare_content("application/json") -luci.http.write_json(e) -end - -function up_status() -local e={} -e.upstatus=luci.sys.exec("cat /usr/share/kuainiao/kuainiao_up_state") -luci.http.prepare_content("application/json") -luci.http.write_json(e) -end -function down_status() -local e={} -e.dwonstatus=luci.sys.exec("cat /usr/share/kuainiao/kuainiao_down_state") -luci.http.prepare_content("application/json") -luci.http.write_json(e) -end diff --git a/package/lean/luci-app-kuainiao/luasrc/model/cbi/kuainiao.lua b/package/lean/luci-app-kuainiao/luasrc/model/cbi/kuainiao.lua deleted file mode 100644 index 3fec7cd005..0000000000 --- a/package/lean/luci-app-kuainiao/luasrc/model/cbi/kuainiao.lua +++ /dev/null @@ -1,59 +0,0 @@ -#fork from https://github.com/zz090923610/thunder-fastNiao,thanks to zz090923610 -require("luci.sys") -require("luci.sys.zoneinfo") -require("luci.config") -local fs = require "nixio.fs" -local ut = require "luci.util" -local o=require"luci.model.network".init() -local sys = require "luci.sys" -local m,t,e -m = Map("kuainiao", translate("迅雷快鸟"),translate("迅雷快鸟是迅雷联合宽带运营商推出的一款致力于帮助用户解决宽带低、网速慢、上网体验差的专业级宽带加速软件。")) -m:section(SimpleSection).template = "kuainiao/kuainiao_status" -s = m:section(NamedSection, "base", "kuainiao", translate("首次使用请填写完帐号密码保存提交一次,之后再启用。")) -s.addremove = false -s:tab("base",translate("Basic Settings")) -s:tab("log",translate("快鸟日志")) -enabled = s:taboption("base",Flag, "enabled", translate("Enable")) -enabled.default=0 -enabled.rmempty = false -enable_down = s:taboption("base",Flag, "enable_down", translate("开启下行加速")) -enable_down.default=1 -enabled.rmempty = false -enable_down:depends("enabled",1) - -enable_up = s:taboption("base",Flag, "enable_up", translate("开启上行加速")) -enable_up.default=0 -enabled.rmempty = false -enable_up:depends("enabled",1) -local a -speed_wan=s:taboption("base",ListValue,"speed_wan",translate("指定加速的接口")) -for a,s in ipairs(o:get_networks())do -if s:name()~="loopback" and s:name()~="lan" then speed_wan:value(s:name())end -end -username = s:taboption("base",Value, "kuainiao_name", translate("迅雷快鸟帐号")) -username.datatype = "minlength(1)" -username.rmempty = false -password = s:taboption("base",Value, "kuainiao_passwd", translate("迅雷快鸟密码")) -password.password = true -password.datatype = "minlength(1)" -password.rmempty = false -kuainiao_config_pwd = s:taboption("base",Value, "kuainiao_config_pwd", translate("加密后密码(自动生成,勿修改)")) -kuainiao_config_pwd.password = true -kuainiao_config_pwd.datatype = "minlength(1)" -kuainiao_config_pwd.rmempty = true ---kuainiao_config_pwd.readonly=true -log=s:taboption("log",TextValue,"log") -log.rows=26 -log.wrap="off" -log.readonly=true -log.cfgvalue=function(t,t) -return nixio.fs.readfile("/var/log/kuainiao.log")or"" -end -log.write=function(log,log,log) -end -m:section(SimpleSection).template = "kuainiao/kuainiao_rsa" -local apply = luci.http.formvalue("cbi.apply") -if apply then - io.popen("luci_kuainiao_apply") -end -return m diff --git a/package/lean/luci-app-kuainiao/luasrc/view/kuainiao/kuainiao_rsa.htm b/package/lean/luci-app-kuainiao/luasrc/view/kuainiao/kuainiao_rsa.htm deleted file mode 100644 index 9d8c458716..0000000000 --- a/package/lean/luci-app-kuainiao/luasrc/view/kuainiao/kuainiao_rsa.htm +++ /dev/null @@ -1,25 +0,0 @@ -<%# - Copyright (C) 2017 Jian Chang - Licensed to the public under the GNU General Public License v3. --%> - - - - -<% include("cbi/map") %> - - diff --git a/package/lean/luci-app-kuainiao/luasrc/view/kuainiao/kuainiao_status.htm b/package/lean/luci-app-kuainiao/luasrc/view/kuainiao/kuainiao_status.htm deleted file mode 100644 index 93c28e5790..0000000000 --- a/package/lean/luci-app-kuainiao/luasrc/view/kuainiao/kuainiao_status.htm +++ /dev/null @@ -1,38 +0,0 @@ -<%# - Copyright 2017 Lede by stones --%> - -<% include("cbi/map") %> - - -
- <%:快鸟运行状态:%><%:Collecting data...%> - - - <%:下行提速状态:%><%:Collecting data...%> - - <%:上行提速状态:%><%:Collecting data...%> -
\ No newline at end of file diff --git a/package/lean/luci-app-kuainiao/po/zh-cn/kuainiao.po b/package/lean/luci-app-kuainiao/po/zh-cn/kuainiao.po deleted file mode 100644 index fc29d88494..0000000000 --- a/package/lean/luci-app-kuainiao/po/zh-cn/kuainiao.po +++ /dev/null @@ -1,4 +0,0 @@ -msgid "Kuai Niao" -msgstr "迅雷快鸟" - - diff --git a/package/lean/luci-app-kuainiao/root/etc/config/kuainiao b/package/lean/luci-app-kuainiao/root/etc/config/kuainiao deleted file mode 100644 index 0c4db8d66a..0000000000 --- a/package/lean/luci-app-kuainiao/root/etc/config/kuainiao +++ /dev/null @@ -1,8 +0,0 @@ - -config kuainiao 'base' - option kuainiao_name '' - option kuainiao_passwd '' - option speed_wan 'wan' - option enabled '0' - option enable_down '1' - option enable_up '0' diff --git a/package/lean/luci-app-kuainiao/root/etc/hotplug.d/iface/99-kuainiao b/package/lean/luci-app-kuainiao/root/etc/hotplug.d/iface/99-kuainiao deleted file mode 100755 index 2f42f3093e..0000000000 --- a/package/lean/luci-app-kuainiao/root/etc/hotplug.d/iface/99-kuainiao +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -. /lib/functions.sh - -enabled=`uci -q get kuainiao.base.enabled` -[ "enabled" -eq 1 ] || exit 0 -[ "$ACTION" = ifup ] && { - logger -t Thunder kuainiao has reloaded due to Device: $DEVICE Action: $ACTION ; - /etc/init.d/kuainiao stop && sleep 2; - /etc/init.d/kuainiao start; -} - -[ "$ACTION" = ifdown ] && { - logger -t Thunder KuaiNiao has stoped due to Device: $DEVICE Action: $ACTION ; - /etc/init.d/kuainiao stop; -} \ No newline at end of file diff --git a/package/lean/luci-app-kuainiao/root/etc/init.d/kuainiao b/package/lean/luci-app-kuainiao/root/etc/init.d/kuainiao deleted file mode 100755 index 29f7c8adb5..0000000000 --- a/package/lean/luci-app-kuainiao/root/etc/init.d/kuainiao +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh /etc/rc.common - -USE_PROCD=1 -START=99 -STOP=15 -SERVICE_WRITE_PID=1 -SERVICE_DAEMONIZE=1 -LOGFILE=/var/log/kuainiao.log - -start_service() -{ - procd_open_instance - procd_set_param command /usr/bin/kuainiao - procd_set_param respawn ${respawn_threshold:-5} ${respawn_timeout:-300} ${respawn_retry:-10} - procd_close_instance -} - -stop_service(){ - clean_log - pid_kuainiao=`ps | grep -v grep | grep -w "/usr/bin/kuainiao" |awk '{print $1}' 2>/dev/null` - [ -n "$pid_kuainiao" ] && { - for pid in $pid_kuainiao - do - echo "Stop service kuainiao PID: $pid" - kill $pid 2>/dev/null - for spid in `pgrep sleep` - do - ppid=`cat /proc/$spid/status | grep -w "PPid" | awk '{print $2}'` - [ "$ppid" -eq "$pid" ] && kill $spid 2>/dev/null && echo "Stop service kuainiao SPID: $spid" - done - done - } - echo "暂无加速信息" > /usr/share/kuainiao/kuainiao_down_state - echo "暂无加速信息" > /usr/share/kuainiao/kuainiao_up_state -} - -clean_log() { - [ -f "$LOGFILE" ] && { - logsnum=$(cat $LOGFILE | grep -c .) - if [ $logsnum -gt 300 ];then - rm -f $LOGFILE >/dev/null 2>&1 & - echo "$(date): 日志文件过长,清空处理!" >> $LOGFILE - fi - } -} diff --git a/package/lean/luci-app-kuainiao/root/etc/uci-defaults/luci-kuainiao b/package/lean/luci-app-kuainiao/root/etc/uci-defaults/luci-kuainiao deleted file mode 100755 index b8b12cac82..0000000000 --- a/package/lean/luci-app-kuainiao/root/etc/uci-defaults/luci-kuainiao +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -uci -q batch <<-EOF >/dev/null - delete ucitrack.@kuainiao[-1] - add ucitrack kuainiao - set ucitrack.@kuainiao[-1].init=kuainiao - commit ucitrack -EOF -exit 0 \ No newline at end of file diff --git a/package/lean/luci-app-kuainiao/root/usr/bin/kuainiao b/package/lean/luci-app-kuainiao/root/usr/bin/kuainiao deleted file mode 100755 index f5e5205405..0000000000 --- a/package/lean/luci-app-kuainiao/root/usr/bin/kuainiao +++ /dev/null @@ -1,606 +0,0 @@ -#!/bin/sh -#2017/05/01 by kenney -#2017/07/19 update for lede by stones -. /lib/functions.sh - -LOGFILE=/var/log/kuainiao.log -down_state_file=/usr/share/kuainiao/kuainiao_down_state -up_state_file=/usr/share/kuainiao/kuainiao_up_state -version="0.4" -app_version="2.0.3.4" -protocolVersion=108 -sdkVersion=17550 -logmore=0 #打印更详细日志排查 - - -logmore(){ - data=$1 - [ "$logmore" -eq 1 ] && { - echo $(date): $data >> $LOGFILE - } -} - -log_down(){ - kuainiao_down_state=$1 - status=$2 - if [ "$status" -eq 1 ]; then - echo "$kuainiao_down_state" > $down_state_file - else - echo "$kuainiao_down_state" > $down_state_file - fi -} - -log_up(){ - kuainiao_up_state=$1 - status=$2 - if [ "$status" -eq 1 ]; then - echo "$kuainiao_up_state" > $up_state_file - else - echo "$kuainiao_up_state" > $up_state_file - fi -} - -#WAN接口IP判断 -get_bind_address(){ - ifname=$(uci -P /var/state get network.$kuainiao_config_wan.ifname 2>/dev/null) - [ $? -eq 1 ] && echo $(date): "获取网络 $kuainiao_config_wan 信息出错" >>$LOGFILE && echo >>$LOGFILE && return - logmore "ifname is $ifname" - ##wan_selected 所选接口IP - wan_selected=$(ifconfig $ifname 2>/dev/null | grep 'inet addr' | awk '{print $2}' | cut -d: -f2 2>/dev/null) - [ -z "$wan_selected" ] && echo $(date): "获取网络 $kuainiao_config_wan 接口 $ifname 信息出错" >>$LOGFILE && echo >>$LOGFILE && return - if [ "$wan_selected" != "0.0.0.0" ]; then - bind_address=$wan_selected - else - bind_address="" - fi -} - -#定义请求函数 -#bind_address='113.248.3.11' -get_http_req(){ - if [ -n "$bind_address" ]; then - HTTP_REQ="wget --bind-address=$bind_address --no-check-certificate -O - " - POST_ARG="--post-data=" - else - HTTP_REQ="wget --no-check-certificate -O - " - POST_ARG="--post-data=" - fi - kuainiao_HTTP_REQ=$HTTP_REQ - kuainiao_POST_ARG=$POST_ARG -} - -#数据mock - -generate_pwd_rsa_hex() -{ - # calculate passwd_md5 - logmore "Generating passwd md5" - passwd_md5=`echo -n "$kuainiao_config_pwd" | md5sum | tr -d " -"` - - if [ `echo -n "$passwd_md5" | wc -c` -ne 32 ]; then - logmore "md5sum should be 32 chars, exit." - exit 1 - fi - - logmore "Generating PWD RSA HEX" - #first, encoding passwd using rsa - a=`echo "$passwd_md5" | openssl rsautl -raw -pubin -inkey /etc/thunder.key -hexdump | tr [a-z] [A-Z]` - a=`echo $a | grep -o '00[0-9]0 \- \([A-Z0-9]\{2\}[- ]\)\{16\}' | sed 's/00[0-9]0 - //g' | tr -d " \-\n"` - echo -n "$a" - -} - -#pwd='702CFAF5824E4306516F488DEAFC2D24F76C82FA53BA3396F5615FDD32E4430E45B254E136056ED5F3C5B404A08E2178B51330999A4EC3C2D2989D554D7863BDE8F058F44808E6B65F4D071B5D5C7210210DA9ED8D729312CECA39E0F4516143E33C089F616ABE93E14D3224BEB311D3D6EF65A6CE265D3E4ABA285523F14320' - -get_device_sign(){ - ifname=$(uci get network.$kuainiao_config_wan.ifname 2>/dev/null) - wan_mac=$(ifconfig $ifname | grep 'HWaddr' | awk '{print $5}') - fake_device_id=$(echo -n "$wan_mac" | md5sum | cut -d ' ' -f1) - fake_device_id_tmp1=$(echo -n "$fake_device_id"com.xunlei.vip.swjsq68700d1872b772946a6940e4b51827e8af"" | openssl sha1 -hmac | awk '{print $2}') - devicesign="div100."${fake_device_id}$(echo -n "$fake_device_id_tmp1" | md5sum | cut -d ' ' -f1) -} - - -#verifyCode=$kuainiao_config_verifyCode -#verifyKey=$kuainiao_verifyKey - -#获取用户真实MAC地址 -get_mac_addr(){ - if [ -n "$bind_address" ]; then - ifname=$(uci get network.$kuainiao_config_wan.ifname 2>/dev/null) - peerid=$(ifconfig $ifname | grep 'HWaddr' | awk '{print $5}' | awk 'gsub(/:/, "")')004V - fi - #peerid='000C29212478004V' -} - - -#获取迅雷用户uid -get_xunlei_uid(){ - get_http_req - logmore "HTTP_REQ is $HTTP_REQ" - logmore "POST_ARG is $POST_ARG" - uname=$kuainiao_config_uname - #get_mac_addr - logmore "peerid is $peerid" - [ -z "$peerid" ] && exit 0 - #pwd=$generate_pwd_rsa_hex - pwd=$kuainiao_config_pwd - get_device_sign - logmore "devicesign is $devicesign" - ret=`$HTTP_REQ --header "User-Agent:android-async-http/xl-acc-sdk/version-1.6.1.177600" https://login.mobile.reg2t.sandai.net:443/ $POST_ARG"{\"userName\":\""$uname"\",\"businessType\":68,\"clientVersion\":\"$app_version\",\"appName\":\"ANDROID-com.xunlei.vip.swjsq\",\"isCompressed\":0,\"sequenceNo\":1000001,\"sessionID\":\"\",\"loginType\":0,\"rsaKey\":{\"e\":\"010001\",\"n\":\"AC69F5CCC8BDE47CD3D371603748378C9CFAD2938A6B021E0E191013975AD683F5CBF9ADE8BD7D46B4D2EC2D78AF146F1DD2D50DC51446BB8880B8CE88D476694DFC60594393BEEFAA16F5DBCEBE22F89D640F5336E42F587DC4AFEDEFEAC36CF007009CCCE5C1ACB4FF06FBA69802A8085C2C54BADD0597FC83E6870F1E36FD\"},\"cmdID\":1,\"verifyCode\":\"$verifyCode\",\"peerID\":\""$peerid"\",\"protocolVersion\":$protocolVersion,\"platformVersion\":1,\"passWord\":\""$pwd"\",\"extensionList\":\"\",\"verifyKey\":\"$verifyKey\",\"sdkVersion\":$sdkVersion,\"devicesign\":\""$devicesign"\"}"` - #判断是否登陆成功 - #echo $ret >>test.txt - logmore "........................" - logmore "ret is $ret" - logmore "........................" - session=`echo $ret|awk -F '"sessionID":' '{print $2}'|awk -F '[,}]' '{print $1}'|grep -oE "[A-F,0-9]{32}"` - logmore "session is $session" - #vcode=`echo $ret|awk -F '"errorDescUrl":' '{print $2}'|awk -F '}' '{print $1}'` - #vcode=`echo $vcode|sed 's/\\//g'` - errcode=`echo $ret|awk -F '"errorCode":' '{print $2}'|awk -F '[,}]' '{print $1}'` - logmore "errcode is $errcode" - if [ -z "$session" ]; then - if [ $errcode == 6 ];then - #kuainiao_vcodeimg_url="$vcode" - #kuainiao_verifyKey='F9F6FBE928911784D809EBF046ABE0A6A467583F3944507099EA54BC9B5DA7BD' - kuainiao_last_act="您的账号不安全,需要输入验证码! $(date "+%Y-%m-%d %H:%M:%S")" - - elif [ $errcode == 12 ];then - #kuainiao_vcodeimg_url="" - #kuainiao_verifyKey='' - kuainiao_last_act="登陆协议无效,请更新!$(date "+%Y-%m-%d %H:%M:%S")" - - elif [ $errcode == 3 ];then - #kuainiao_vcodeimg_url="" - #kuainiao_verifyKey='' - kuainiao_last_act="用户名密码错误,请检查!$(date "+%Y-%m-%d %H:%M:%S")" - - else - #kuainiao_vcodeimg_url="" - #kuainiao_verifyKey='' - kuainiao_last_act="迅雷账号登陆失败,请检查输入的用户名密码! $(date "+%Y-%m-%d %H:%M:%S")" - - fi - #echo "迅雷账号登陆失败,请检查输入的用户名密码!" - log_down "$kuainiao_last_act" 0 - - else - uid=`echo $ret|awk -F '"userID":' '{print $2}'|awk -F '[,}]' '{print $1}'` - kuainiao_config_uid=$uid - kuainiao_config_session=$session - kuainiao_last_act="迅雷快鸟已登陆成功!" - log_down "$kuainiao_last_act" 1 - fi - echo $(date): "$kuainiao_last_act" >> $LOGFILE -} - -#获取加速API -get_kuainiao_api(){ - portal=`$HTTP_REQ http://api.portal.swjsq.vip.xunlei.com:81/v2/queryportal` - portal_ip=`echo $portal|grep -oE '([0-9]{1,3}[\.]){3}[0-9]{1,3}'` - portal_port_temp=`echo $portal|grep -oE "port...[0-9]{1,5}"` - portal_port=`echo $portal_port_temp|grep -oE '[0-9]{1,5}'` - - logmore "portal is $portal" >> $LOGFILE - logmore "portal_ip is $portal_ip" >> $LOGFILE - logmore "portal_port_temp is $portal_port_temp" >> $LOGFILE - logmore "portal_port is $portal_port" >> $LOGFILE - - if [ -z "$portal_ip" ]; then - kuainiao_down_state="迅雷快鸟下行API获取失败,请检查网络环境,或稍后再试!" - echo $(date): "$kuainiao_down_state" >> $LOGFILE - log_down "$kuainiao_down_state" 0 - else - api_url="http://$portal_ip:$portal_port/v2" - kuainiao_config_api=$api_url - fi -} - -#获取上行加速API -get_kuainiao_upapi(){ - upportal=`$HTTP_REQ http://api.upportal.swjsq.vip.xunlei.com/v2/queryportal` - upportal_ip=`echo $upportal|grep -oE '([0-9]{1,3}[\.]){3}[0-9]{1,3}'` - upportal_port_temp=`echo $upportal|grep -oE "port...[0-9]{1,5}"` - upportal_port=`echo $upportal_port_temp|grep -oE '[0-9]{1,5}'` - - logmore "upportal is $upportal" - logmore "upportal_ip is $upportal_ip" - logmore "upportal_port_temp is $upportal_port_temp" - logmore "upportal_port is $upportal_port" - - if [ -z "$upportal_ip" ]; then - kuainiao_up_state="迅雷快鸟上行API获取失败,请检查网络环境,或稍后再试!" - #echo "迅雷快鸟服务API获取失败,请检查网络环境,或稍后再试!" - echo $(date): "$kuainiao_up_state" >> $LOGFILE - log_up "$kuainiao_up_state" 0 - else - upapi_url="http://$upportal_ip:$upportal_port/v2" - kuainiao_config_upapi=$upapi_url - fi - logmore "$(date): upapi_url is $upapi_url" -} - - -#检测快鸟加速信息 -get_bandwidth(){ - - logmore "api_url is $api_url" - logmore "peerid is $peerid" - if [ -n "$api_url" ]; then - [ -n "$portal_port_temp" ] && [ -n "$portal_port" ] && bandwidth - band=$width - logmore "band is $band" - can_upgrade=`echo $band|awk -F '"can_upgrade":' '{print $2}'|awk -F '[,}]' '{print $1}'` - logmore "can_upgrade is $can_upgrade" - kuainiao_can_upgrade=$can_upgrade - logmore "kuainiao_can_upgrade is $kuainiao_can_upgrade" - dial_account=`echo $band|awk -F '"dial_account":"' '{print $2}'|awk -F '[,}"]' '{print $1}'` - kuainiao_dial_account=$dial_account - logmore "kuainiao_dial_account is $kuainiao_dial_account" - #判断是否满足加速条件 - if [ "$can_upgrade" -eq 1 ]; then - #echo "迅雷快鸟可以加速~~~愉快的开始加速吧~~" - #获取加速详细信息 - old_downstream=`echo $band|awk -F '"bandwidth":' '{print $2}'|awk -F '"downstream":' '{print $2}'|awk -F '[,}]' '{print $1}'` - max_downstream=`echo $band|awk -F '"max_bandwidth":' '{print $2}'|awk -F '"downstream":' '{print $2}'|awk -F '[,}]' '{print $1}'` - down_state="下行可以加速" - kuainiao_old_downstream=$(expr $old_downstream / 1024) - kuainiao_max_downstream=$(expr $max_downstream / 1024) - logmore "kuainiao_old_downstream is $kuainiao_old_downstream" - logmore "kuainiao_max_downstream is $kuainiao_max_downstream" - else - down_state="下行不满足加速条件" - #echo "T_T 不能加速啊,不满足加速条件哦~~" - log_down "$down_state" 0 - fi - echo $(date): "$down_state" >> $LOGFILE - # kuainiao_down_state=$down_state - - fi -} - -#检测快鸟上行加速信息 -get_upbandwidth(){ - logmore "upapi_url is $upapi_url" - if [ -n "$upapi_url" ]; then - [ -n "$upportal_port_temp" ] && [ -n "$upportal_port" ] && upbandwidth - band=$upwidth - logmore "upwidth is $upwidth" - can_upgrade=`echo $band|awk -F '"can_upgrade":' '{print $2}'|awk -F '[,}]' '{print $1}'` - kuainiao_can_upupgrade=$can_upgrade - updial_account=`echo $band|awk -F '"dial_account":"' '{print $2}'|awk -F '[,}"]' '{print $1}'` - kuainiao_dial_upaccount=$updial_account - logmore "can_upgrade is $can_upgrade" - logmore "kuainiao_can_upupgrade is $kuainiao_can_upupgrade" - logmore "updial_account is $updial_account" - logmore "kuainiao_dial_upaccount is $kuainiao_dial_upaccount" - #判断是否满足加速条件 - if [ "$can_upgrade" -eq 1 ]; then - #echo "迅雷快鸟可以加速~~~愉快的开始加速吧~~" - #获取加速详细信息 - old_upstream=`echo $band|awk -F '"bandwidth":' '{print $2}'|awk -F '"upstream":' '{print $2}'|awk -F '[,}]' '{print $1}'` - max_upstream=`echo $band|awk -F '"max_bandwidth":' '{print $2}'|awk -F '"upstream":' '{print $2}'|awk -F '[,}]' '{print $1}'` - up_state="上行可以加速" - kuainiao_old_upstream=$(expr $old_upstream / 1024) - kuainiao_max_upstream=$(expr $max_upstream / 1024) - logmore "kuainiao_old_upstream is $kuainiao_old_upstream" - logmore "kuainiao_max_upstream is $kuainiao_max_upstream" - else - up_state="上行不满足加速条件" - log_up "$up_state" 0 - fi - echo "$(date): $up_state" >> $LOGFILE - kuainiao_up_state=$up_state - - fi -} - - -#检测试用加速信息 -query_try_info(){ - info=`$HTTP_REQ "$api_url/query_try_info?peerid=$peerid&userid=$uid&user_type=1&sessionid=$session"` - echo $info -} -##{"errno":0,"message":"","number_of_try":0,"richmessage":"","sequence":0,"timestamp":1455936922,"try_duration":10} - -query_try_upinfo(){ - info=`$HTTP_REQ "$upapi_url/query_try_info?peerid=$peerid&userid=$uid&client_type=android-uplink-2.3.3.9&client_version=andrioduplink-2.3.3.9&os=android-7.0.24DUK-AL20&sessionid=$session"` - echo $info -} -##{"errno":0,"exp_day_len":0,"is_exp_day":0,"message":"","number_of_try":1,"richmessage":"","sequence":268435461,"timestamp":1493469390,"try_duration":10} - -get_upgrade_down(){ - _ts=`date +%s`000 - ret=`$HTTP_REQ "$api_url/upgrade?peerid=$peerid&userid=$uid&user_type=1&sessionid=$kuainiao_config_session&dial_account=$dial_account&client_type=android-swjsq-$app_version&client_version=androidswjsq-$app_version&os=android-5.0.1.24SmallRice&time_and=$_ts"` - errcode=`echo $ret|awk -F '"errno":' '{print $2}'|awk -F '[,}"]' '{print $1}'` - if [ "$errcode" == "0" ]; then - down_state="$down_state (您的下行带宽已从$kuainiao_old_downstream M提升到$kuainiao_max_downstream M)" - log_down "$down_state" 1 - else - down_state="$down_state 下行带宽提升失败,请检查宽带账号是否绑定正确" - log_down "$down_state" 0 - fi - echo $(date): "$down_state" >> $LOGFILE - # kuainiao_down_state=$down_state -} - -get_upgrade_up(){ - _ts=`date +%s`000 - up_ret=`$HTTP_REQ --header "User-Agent:android-async-http/xl-acc-sdk/version-1.0.0.1" "$upapi_url/upgrade?peerid=$peerid&userid=$uid&client_type=android-uplink-2.3.3.9&client_version=andrioduplink-2.3.3.9&os=android-7.0.24DUK-AL20&sessionid=$session&user_type=1&dial_account=$updial_account"` - errcode=`echo $up_ret|awk -F '"errno":' '{print $2}'|awk -F '[,}"]' '{print $1}'` - if [ "$errcode" == "0" ] || [ "$errcode" == "812" ];then - up_state="$up_state (您的上行带宽已从$kuainiao_old_upstream M提升到$kuainiao_max_upstream M)" - log_up "$up_state" 1 - else - up_state="$up_state 上行带宽提升失败,请检查宽带账号是否绑定正确" - log_up "$up_state" 0 - fi - echo $(date): "$up_state" >> $LOGFILE - # kuainiao_up_state=$up_state - # echo "$kuainiao_up_state" > $up_state_file -} - -#迅雷快鸟上行加速心跳包 -keepalive_up(){ - _ts=`date +%s`000 - up_ret=`$HTTP_REQ --header "User-Agent:android-async-http/xl-acc-sdk/version-1.0.0.1" "$upapi_url/keepalive?peerid=$peerid&userid=$uid&client_type=android-uplink-2.3.3.9&client_version=andrioduplink-2.3.3.9&os=android-7.0.24DUK-AL20&sessionid=$session&user_type=1&dial_account=$kuainiao_dial_upaccount"` - errcode=`echo $up_ret|awk -F '"errno":' '{print $2}'|awk -F '[,}"]' '{print $1}'` - if [ "$errcode" != "0" ];then - #kuainiao_run_upid=0 - kuainiao_up_state="迅雷上行提速失效!$(date '+%Y-%m-%d %H:%M:%S')" - kuainiao_run_upstatus=0 - log_up "$kuainiao_up_state" 0 - else - #kuainiao_run_upid=$(expr $kuainiao_run_upid + 1) - kuainiao_up_state="您的上行带宽已从${kuainiao_old_upstream}M提升到${kuainiao_max_upstream}M $(date '+%Y-%m-%d %H:%M:%S')" - kuainiao_run_upstatus=1 - log_up "$kuainiao_up_state" 1 - fi -} - - -#检测提速带宽 -bandwidth(){ - [ "$logmore" -eq 1 ] && { - echo $(date): "bandwidth start" >> $LOGFILE - echo $(date): "peerid is $peerid" >> $LOGFILE - echo $(date): "uid is $uid" >> $LOGFILE - echo $(date): "session is $session" >> $LOGFILE - } - _ts=`date +%s`000 - width=`$HTTP_REQ "$api_url/bandwidth?peerid=$peerid&userid=$uid&user_type=1&sessionid=$session&dial_account=$dial_account&client_type=android-swjsq-$app_version&client_version=androidswjsq-$app_version&os=android-5.0.1.24SmallRice&time_and=$_ts"` - #echo $width -} -##{"bandwidth":{"downstream":51200,"upstream":0},"can_upgrade":1,"dial_account":"100001318645","errno":0,"max_bandwidth":{"downstream":102400,"upstream":0},"message":"","province":"bei_jing","province_name":"北京","richmessage":"","sequence":0,"sp":"cnc","sp_name":"联通","timestamp":1455936922} - -upbandwidth(){ - _ts=`date +%s`000 - upwidth=`$HTTP_REQ "$upapi_url/bandwidth?peerid=$peerid&userid=$uid&user_type=1&sessionid=$session&dial_account=$dial_account&client_type=android-swjsq-$app_version&client_version=androidswjsq-$app_version&os=android-5.0.1.24SmallRice&time_and=$_ts"` - #echo $upwidth -} - - -#迅雷快鸟下行加速心跳包 -keepalive_down(){ - _ts=`date +%s`000 - ret=`$HTTP_REQ "$api_url/keepalive?peerid=$peerid&userid=$uid&user_type=1&sessionid=$session&dial_account=$dial_account&client_type=android-swjsq-$app_version&client_version=androidswjsq-$app_version&os=android-5.0.1.24SmallRice&time_and=$_ts"` - errcode=`echo $ret|awk -F '"errno":' '{print $2}'|awk -F '[,}"]' '{print $1}'` - if [ "$errcode" != "0" ];then - #kuainiao_run_upid=0 - kuainiao_down_state="迅雷下行提速失效!"$(date "+%Y-%m-%d %H:%M:%S") - log_down "$kuainiao_down_state" 0 - kuainiao_run_status=0 - else - #kuainiao_run_upid=$(expr $kuainiao_run_upid + 1) - kuainiao_down_state="您的下行带宽已从${kuainiao_old_downstream}M提升到${kuainiao_max_downstream}M $(date '+%Y-%m-%d %H:%M:%S')" - log_down "$kuainiao_down_state" 1 - kuainiao_run_status=1 - - fi - echo $(date): "$kuainiao_down_state" >> $LOGFILE -} - -sigterm(){ - - [ "$kuainiao_can_upgrade" -eq 1 ] && kuainiao_recover - [ "$kuainiao_can_upupgrade" -eq 1 ] && kuainiao_uprecover - logmore "trap sigterm exit" - exit 0 - -} - -#快鸟加速注销 -kuainiao_recover(){ - _ts=`date +%s`000 - recover=`$HTTP_REQ "$api_url/recover?peerid=$peerid&userid=$uid&user_type=1&sessionid=$session&dial_account=$dial_account&client_type=android-swjsq-$app_version&client_version=androidswjsq-$app_version&os=android-5.0.1.24SmallRice&time_and=$_ts"` - #echo $recover - echo $(date): "快鸟下行带宽加速已注销" >> $LOGFILE -} - -kuainiao_uprecover(){ - _ts=`date +%s`000 - recover=`$HTTP_REQ "$upapi_url/recover?peerid=$peerid&userid=$uid&client_type=android-uplink-2.3.3.9&client_version=andrioduplink-2.3.3.9&os=android-7.0.24DUK-AL20&sessionid=$session&user_type=1&dial_account=$updial_account"` - #echo $recover - echo $(date): "快鸟上行带宽加速已注销" >> $LOGFILE -} - -#执行初始化 -kuainiao_init(){ - local kuainiao_last_act="" - local kuainiao_can_upgrade=0 - local kuainiao_can_upupgrade=0 - local kuainiao_down_state="" - local kuainiao_up_state="" -} - -##主逻辑 -trap 'sigterm' TERM -trap 'sigterm' INT - -kuainiao_init -config_load kuainiao -config_get_bool enabled base enabled 0 -config_get_bool kuainiao_downenable base enable_down 0 -config_get_bool kuainiao_upenable base enable_up 0 -config_get kuainiao_config_wan base speed_wan -config_get kuainiao_config_uname base kuainiao_name -config_get kuainiao_config_pwd base kuainiao_config_pwd - -[ "$enabled" -eq 0 ] || [ -z "$kuainiao_config_pwd" ] && exit 0 -[ "$kuainiao_downenable" -eq 0 ] && [ "$kuainiao_upenable" -eq 0 ] && exit 0 -[ -z "$kuainiao_config_uname" ] && exit 0 - -logmore "enabled is $enabled" -logmore "kuainiao_downenable is $kuainiao_downenable" -logmore "kuainiao_upenable is $kuainiao_upenable" -logmore "kuainiao_config_wan is $kuainiao_config_wan" -logmore "kuainiao_config_uname is $kuainiao_config_uname" -logmore "kuainiao_config_pwd is $kuainiao_config_pwd" - -if [ "$kuainiao_downenable" -eq 1 ] || [ "$kuainiao_upenable" -eq 1 ]; then - - logmore "启动延时 7s" - sleep 7s - - #登陆迅雷获取uid - logmore "get_bind_address start" - get_bind_address - logmore "bind_address is $bind_address" - logmore "get_mac_addr start" - get_mac_addr - logmore "peerid is $peerid" - logmore "get_xunlei_uid start" - get_xunlei_uid - logmore "get_xunlei_uid is done" - logmore "id is $uid" - #判断是否登陆成功 - if [ -n "$uid" ]; then - if [ "$kuainiao_downenable" -eq 1 ]; then - logmore "get_kuainiao_api is started......." - get_kuainiao_api - logmore "get_bandwidth is started......." - get_bandwidth - kuainiao_config_downstream=$(expr $old_downstream / 1024) - kuainiao_config_max_downstream=$(expr $max_downstream / 1024) - logmore "kuainiao_config_downstream is $kuainiao_config_downstream" - logmore "kuainiao_config_max_downstream is $kuainiao_config_max_downstream" - logmore "kuainiao_can_upgrade is $kuainiao_can_upgrade" - - if [ "$kuainiao_can_upgrade" -eq 1 ]; then - logmore "get_upgrade_down is started......." - get_upgrade_down - logmore "get_upgrade_down is done......." - sleep 1s - #keepalive_down - fi - fi - if [ "$kuainiao_upenable" -eq 1 ]; then - logmore "get_kuainiao_upapi start" - get_kuainiao_upapi - logmore "get_upbandwidth start" - get_upbandwidth - kuainiao_config_upstream=$(expr $old_upstream / 1024) - kuainiao_config_max_upstream=$(expr $max_upstream / 1024) - logmore "kuainiao_config_upstream is $kuainiao_config_upstream" - logmore "kuainiao_config_max_upstream is $kuainiao_config_max_upstream" - logmore "kuainiao_can_upupgrade is $kuainiao_can_upupgrade" - - if [ "$kuainiao_can_upupgrade" -eq 1 ]; then - logmore "get_upgrade_up start" - get_upgrade_up - sleep 1s - #keepalive_up - fi - fi - fi -fi - -# [ -z "$kuainiao_can_upgrade" ] && [ -z "$kuainiao_can_upupgrade" ] && { - # logmore "exit kuainiao...." - # sleep 7s - # echo "暂无加速信息" > $down_state_file - # echo "暂无加速信息" > $up_state_file - # exit 0 - -# } -while true; -do - sleep 295s - if [ "$kuainiao_downenable" -eq 1 ] && [ "$kuainiao_can_upgrade" -eq 1 ];then - keepalive_down - [ "$kuainiao_run_status" -eq 0 ] && restart_kuainiao - fi - if [ "$kuainiao_upenable" -eq 1 ] && [ "$kuainiao_can_upupgrade" -eq 1 ];then - keepalive_up - [ "$kuainiao_run_upstatus" -eq 0 ] && restart_kuainiao - fi -done - - -restart_kuainiao(){ - kuainiao_init - config_load kuainiao - config_get_bool enabled base enabled 0 - config_get_bool kuainiao_downenable base enable_down 0 - config_get_bool kuainiao_upenable base enable_up 0 - config_get kuainiao_config_wan base speed_wan - config_get kuainiao_config_uname base kuainiao_name - config_get kuainiao_config_pwd base kuainiao_config_pwd - - if [ "$kuainiao_downenable" -eq 1 ] || [ "$kuainiao_upenable" -eq 1 ]; then - logmore "启动延时 7s" - sleep 7s - - #登陆迅雷获取uid - logmore "get_bind_address start" - get_bind_address - logmore "bind_address is $bind_address" - logmore "get_mac_addr start" - get_mac_addr - logmore "peerid is $peerid" - logmore "get_xunlei_uid start" - get_xunlei_uid - logmore "get_xunlei_uid is done" - logmore "id is $uid" - #判断是否登陆成功 - if [ -n "$uid" ]; then - if [ "$kuainiao_downenable" -eq 1 ]; then - logmore "get_kuainiao_api is started......." - get_kuainiao_api - logmore "get_bandwidth is started......." - get_bandwidth - kuainiao_config_downstream=$(expr $old_downstream / 1024) - kuainiao_config_max_downstream=$(expr $max_downstream / 1024) - if [ "$kuainiao_can_upgrade" -eq 1 ]; then - [ "$logmore" -eq 1 ] && logmore "get_upgrade_down is started......." - get_upgrade_down - logmore "get_upgrade_down is done......." - sleep 1s - #keepalive_down - fi - fi - if [ "$kuainiao_upenable" -eq 1 ]; then - logmore "get_kuainiao_upapi start" - get_kuainiao_upapi - logmore "get_upbandwidth start" - get_upbandwidth - kuainiao_config_upstream=$(expr $old_upstream / 1024) - kuainiao_config_max_upstream=$(expr $max_upstream / 1024) - if [ "$kuainiao_can_upupgrade" -eq 1 ]; then - logmore "get_upgrade_up start" - get_upgrade_up - sleep 1s - #keepalive_up - fi - fi - fi - #add_kuainiao_cru - fi - [ -z "$kuainiao_can_upgrade" ] && [ -z "$kuainiao_can_upupgrade" ] && { - logmore "exit kuainiao...." - sleep 7s - echo "暂无加速信息" > $down_state_file - echo "暂无加速信息" > $up_state_file - exit 0 - } -} diff --git a/package/lean/luci-app-kuainiao/root/usr/bin/luci_kuainiao_apply b/package/lean/luci-app-kuainiao/root/usr/bin/luci_kuainiao_apply deleted file mode 100755 index ce48ef8932..0000000000 --- a/package/lean/luci-app-kuainiao/root/usr/bin/luci_kuainiao_apply +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -enabled=`uci get kuainiao.base.enabled` - -if [ "$enabled" -eq 0 ]; then - /etc/init.d/kuainiao stop - /etc/init.d/kuainiao disable -else - /etc/init.d/kuainiao stop - /etc/init.d/kuainiao start - /etc/init.d/kuainiao enable -fi \ No newline at end of file diff --git a/package/lean/luci-app-kuainiao/root/usr/share/kuainiao/kuainiao_down_state b/package/lean/luci-app-kuainiao/root/usr/share/kuainiao/kuainiao_down_state deleted file mode 100644 index f01ccd0f02..0000000000 --- a/package/lean/luci-app-kuainiao/root/usr/share/kuainiao/kuainiao_down_state +++ /dev/null @@ -1 +0,0 @@ -暂无加速信息 \ No newline at end of file diff --git a/package/lean/luci-app-kuainiao/root/usr/share/kuainiao/kuainiao_up_state b/package/lean/luci-app-kuainiao/root/usr/share/kuainiao/kuainiao_up_state deleted file mode 100644 index f01ccd0f02..0000000000 --- a/package/lean/luci-app-kuainiao/root/usr/share/kuainiao/kuainiao_up_state +++ /dev/null @@ -1 +0,0 @@ -暂无加速信息 \ No newline at end of file diff --git a/package/lean/luci-app-kuainiao/root/www/luci-static/resources/md5.js b/package/lean/luci-app-kuainiao/root/www/luci-static/resources/md5.js deleted file mode 100644 index c1d09a94dc..0000000000 --- a/package/lean/luci-app-kuainiao/root/www/luci-static/resources/md5.js +++ /dev/null @@ -1 +0,0 @@ -var md5; md5 || (md5 = function(){function i(a,b){a[b>>5]|=128<>>9<<4)+14]=b;for(var c=1732584193,d=-271733879,e=-1732584194,f=271733878,g=0;a.length>g;g+=16){var h=c,i=d,j=e,o=f;c=k(c,d,e,f,a[g+0],7,-680876936),f=k(f,c,d,e,a[g+1],12,-389564586),e=k(e,f,c,d,a[g+2],17,606105819),d=k(d,e,f,c,a[g+3],22,-1044525330),c=k(c,d,e,f,a[g+4],7,-176418897),f=k(f,c,d,e,a[g+5],12,1200080426),e=k(e,f,c,d,a[g+6],17,-1473231341),d=k(d,e,f,c,a[g+7],22,-45705983),c=k(c,d,e,f,a[g+8],7,1770035416),f=k(f,c,d,e,a[g+9],12,-1958414417),e=k(e,f,c,d,a[g+10],17,-42063),d=k(d,e,f,c,a[g+11],22,-1990404162),c=k(c,d,e,f,a[g+12],7,1804603682),f=k(f,c,d,e,a[g+13],12,-40341101),e=k(e,f,c,d,a[g+14],17,-1502002290),d=k(d,e,f,c,a[g+15],22,1236535329),c=l(c,d,e,f,a[g+1],5,-165796510),f=l(f,c,d,e,a[g+6],9,-1069501632),e=l(e,f,c,d,a[g+11],14,643717713),d=l(d,e,f,c,a[g+0],20,-373897302),c=l(c,d,e,f,a[g+5],5,-701558691),f=l(f,c,d,e,a[g+10],9,38016083),e=l(e,f,c,d,a[g+15],14,-660478335),d=l(d,e,f,c,a[g+4],20,-405537848),c=l(c,d,e,f,a[g+9],5,568446438),f=l(f,c,d,e,a[g+14],9,-1019803690),e=l(e,f,c,d,a[g+3],14,-187363961),d=l(d,e,f,c,a[g+8],20,1163531501),c=l(c,d,e,f,a[g+13],5,-1444681467),f=l(f,c,d,e,a[g+2],9,-51403784),e=l(e,f,c,d,a[g+7],14,1735328473),d=l(d,e,f,c,a[g+12],20,-1926607734),c=m(c,d,e,f,a[g+5],4,-378558),f=m(f,c,d,e,a[g+8],11,-2022574463),e=m(e,f,c,d,a[g+11],16,1839030562),d=m(d,e,f,c,a[g+14],23,-35309556),c=m(c,d,e,f,a[g+1],4,-1530992060),f=m(f,c,d,e,a[g+4],11,1272893353),e=m(e,f,c,d,a[g+7],16,-155497632),d=m(d,e,f,c,a[g+10],23,-1094730640),c=m(c,d,e,f,a[g+13],4,681279174),f=m(f,c,d,e,a[g+0],11,-358537222),e=m(e,f,c,d,a[g+3],16,-722521979),d=m(d,e,f,c,a[g+6],23,76029189),c=m(c,d,e,f,a[g+9],4,-640364487),f=m(f,c,d,e,a[g+12],11,-421815835),e=m(e,f,c,d,a[g+15],16,530742520),d=m(d,e,f,c,a[g+2],23,-995338651),c=n(c,d,e,f,a[g+0],6,-198630844),f=n(f,c,d,e,a[g+7],10,1126891415),e=n(e,f,c,d,a[g+14],15,-1416354905),d=n(d,e,f,c,a[g+5],21,-57434055),c=n(c,d,e,f,a[g+12],6,1700485571),f=n(f,c,d,e,a[g+3],10,-1894986606),e=n(e,f,c,d,a[g+10],15,-1051523),d=n(d,e,f,c,a[g+1],21,-2054922799),c=n(c,d,e,f,a[g+8],6,1873313359),f=n(f,c,d,e,a[g+15],10,-30611744),e=n(e,f,c,d,a[g+6],15,-1560198380),d=n(d,e,f,c,a[g+13],21,1309151649),c=n(c,d,e,f,a[g+4],6,-145523070),f=n(f,c,d,e,a[g+11],10,-1120210379),e=n(e,f,c,d,a[g+2],15,718787259),d=n(d,e,f,c,a[g+9],21,-343485551),c=p(c,h),d=p(d,i),e=p(e,j),f=p(f,o)}return[c,d,e,f]}function j(a,b,c,d,e,f){return p(q(p(p(b,a),p(d,f)),e),c)}function k(a,b,c,d,e,f,g){return j(b&c|~b&d,a,b,e,f,g)}function l(a,b,c,d,e,f,g){return j(b&d|c&~d,a,b,e,f,g)}function m(a,b,c,d,e,f,g){return j(b^c^d,a,b,e,f,g)}function n(a,b,c,d,e,f,g){return j(c^(b|~d),a,b,e,f,g)}function p(a,b){var c=(a&65535)+(b&65535),d=(a>>16)+(b>>16)+(c>>16);return d<<16|c&65535}function q(a,b){return a<>>32-b}function r(a){for(var b=[],d=(1<e;e+=c)b[e>>5]|=(a.charCodeAt(e/c)&d)<e;e++)d+=c.charAt(b[e>>2]>>e%4*8+4&15)+c.charAt(b[e>>2]>>e%4*8&15);return d}var a=0,c=8;return function(a){return t(i(r(a),a.length*c))}}()); \ No newline at end of file diff --git a/package/lean/luci-app-kuainiao/root/www/luci-static/resources/sha1.js b/package/lean/luci-app-kuainiao/root/www/luci-static/resources/sha1.js deleted file mode 100644 index 11014f81d2..0000000000 --- a/package/lean/luci-app-kuainiao/root/www/luci-static/resources/sha1.js +++ /dev/null @@ -1,202 +0,0 @@ -/* - * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined - * in FIPS PUB 180-1 - * Version 2.1a Copyright Paul Johnston 2000 - 2002. - * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet - * Distributed under the BSD License - * See http://pajhome.org.uk/crypt/md5 for details. - */ - -/* - * Configurable variables. You may need to tweak these to be compatible with - * the server-side, but the defaults work in most cases. - */ -var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */ -var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */ -var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */ - -/* - * These are the functions you'll usually want to call - * They take string arguments and return either hex or base-64 encoded strings - */ -function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));} -function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));} -function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));} -function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));} -function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));} -function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));} - -/* - * Perform a simple self-test to see if the VM is working - */ -function sha1_vm_test() -{ - return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d"; -} - -/* - * Calculate the SHA-1 of an array of big-endian words, and a bit length - */ -function core_sha1(x, len) -{ - /* append padding */ - x[len >> 5] |= 0x80 << (24 - len % 32); - x[((len + 64 >> 9) << 4) + 15] = len; - - var w = Array(80); - var a = 1732584193; - var b = -271733879; - var c = -1732584194; - var d = 271733878; - var e = -1009589776; - - for(var i = 0; i < x.length; i += 16) - { - var olda = a; - var oldb = b; - var oldc = c; - var oldd = d; - var olde = e; - - for(var j = 0; j < 80; j++) - { - if(j < 16) w[j] = x[i + j]; - else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1); - var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)), - safe_add(safe_add(e, w[j]), sha1_kt(j))); - e = d; - d = c; - c = rol(b, 30); - b = a; - a = t; - } - - a = safe_add(a, olda); - b = safe_add(b, oldb); - c = safe_add(c, oldc); - d = safe_add(d, oldd); - e = safe_add(e, olde); - } - return Array(a, b, c, d, e); - -} - -/* - * Perform the appropriate triplet combination function for the current - * iteration - */ -function sha1_ft(t, b, c, d) -{ - if(t < 20) return (b & c) | ((~b) & d); - if(t < 40) return b ^ c ^ d; - if(t < 60) return (b & c) | (b & d) | (c & d); - return b ^ c ^ d; -} - -/* - * Determine the appropriate additive constant for the current iteration - */ -function sha1_kt(t) -{ - return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : - (t < 60) ? -1894007588 : -899497514; -} - -/* - * Calculate the HMAC-SHA1 of a key and some data - */ -function core_hmac_sha1(key, data) -{ - var bkey = str2binb(key); - if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz); - - var ipad = Array(16), opad = Array(16); - for(var i = 0; i < 16; i++) - { - ipad[i] = bkey[i] ^ 0x36363636; - opad[i] = bkey[i] ^ 0x5C5C5C5C; - } - - var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz); - return core_sha1(opad.concat(hash), 512 + 160); -} - -/* - * Add integers, wrapping at 2^32. This uses 16-bit operations internally - * to work around bugs in some JS interpreters. - */ -function safe_add(x, y) -{ - var lsw = (x & 0xFFFF) + (y & 0xFFFF); - var msw = (x >> 16) + (y >> 16) + (lsw >> 16); - return (msw << 16) | (lsw & 0xFFFF); -} - -/* - * Bitwise rotate a 32-bit number to the left. - */ -function rol(num, cnt) -{ - return (num << cnt) | (num >>> (32 - cnt)); -} - -/* - * Convert an 8-bit or 16-bit string to an array of big-endian words - * In 8-bit function, characters >255 have their hi-byte silently ignored. - */ -function str2binb(str) -{ - var bin = Array(); - var mask = (1 << chrsz) - 1; - for(var i = 0; i < str.length * chrsz; i += chrsz) - bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32); - return bin; -} - -/* - * Convert an array of big-endian words to a string - */ -function binb2str(bin) -{ - var str = ""; - var mask = (1 << chrsz) - 1; - for(var i = 0; i < bin.length * 32; i += chrsz) - str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask); - return str; -} - -/* - * Convert an array of big-endian words to a hex string. - */ -function binb2hex(binarray) -{ - var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; - var str = ""; - for(var i = 0; i < binarray.length * 4; i++) - { - str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) + - hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF); - } - return str; -} - -/* - * Convert an array of big-endian words to a base-64 string - */ -function binb2b64(binarray) -{ - var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - var str = ""; - for(var i = 0; i < binarray.length * 4; i += 3) - { - var triplet = (((binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16) - | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 ) - | ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF); - for(var j = 0; j < 4; j++) - { - if(i * 8 + j * 6 > binarray.length * 32) str += b64pad; - else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F); - } - } - return str; -} diff --git a/package/lean/luci-app-shadowsocksr-pro/Makefile b/package/lean/luci-app-shadowsocksr-pro/Makefile index 747a2dd808..4d18872ca4 100644 --- a/package/lean/luci-app-shadowsocksr-pro/Makefile +++ b/package/lean/luci-app-shadowsocksr-pro/Makefile @@ -9,7 +9,7 @@ LUCI_TITLE:=LuCI support for Shadowsocksr LUCI_DEPENDS:=+iptables-mod-tproxy +kmod-ipt-tproxy +ip +ipset-lists +shadowsocksr-libev-alt +pdnsd-alt +coreutils +coreutils-base64 +coreutils-nohup +dnsmasq-full LUCI_PKGARCH:=all PKG_VERSION:=2.0 -PKG_RELEASE:=20 +PKG_RELEASE:=21 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/lean/luci-app-shadowsocksr-pro/root/etc/uci-defaults/shadowsocksr b/package/lean/luci-app-shadowsocksr-pro/root/etc/uci-defaults/shadowsocksr index d77c729c83..86b57ce08f 100755 --- a/package/lean/luci-app-shadowsocksr-pro/root/etc/uci-defaults/shadowsocksr +++ b/package/lean/luci-app-shadowsocksr-pro/root/etc/uci-defaults/shadowsocksr @@ -9,9 +9,6 @@ uci -q batch <<-EOF >/dev/null commit firewall EOF -[ ! -f /usr/bin/ip ] && ln -sf /sbin/ip /usr/bin/ip -(opkg list-installed | grep ip-full >/dev/null 2>&1) && ln -sf /usr/sbin/ip /usr/bin/ip - /etc/init.d/shadowsocksr stop /etc/init.d/shadowsocksr disable diff --git a/package/lean/luci-app-udp2raw/LICENSE b/package/lean/luci-app-udp2raw/LICENSE new file mode 100644 index 0000000000..e963df8294 --- /dev/null +++ b/package/lean/luci-app-udp2raw/LICENSE @@ -0,0 +1,622 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + diff --git a/package/lean/luci-app-udp2raw/Makefile b/package/lean/luci-app-udp2raw/Makefile new file mode 100644 index 0000000000..8ce589eed7 --- /dev/null +++ b/package/lean/luci-app-udp2raw/Makefile @@ -0,0 +1,76 @@ +# +# Copyright (C) 2016-2017 Jian Chang +# +# This is free software, licensed under the GNU General Public License v3. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=luci-app-udp2raw +PKG_VERSION:=1.0.0 +PKG_RELEASE:=1 + +PKG_LICENSE:=GPLv3 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jian Chang + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/luci-app-udp2raw + SECTION:=luci + CATEGORY:=LuCI + SUBMENU:=3. Applications + TITLE:=LuCI Support for udp2raw-tunnel + PKGARCH:=all + DEPENDS:=+udp2raw-tunnel +endef + +define Package/luci-app-udp2raw/description + LuCI Support for udp2raw-tunnel. +endef + +define Build/Prepare + $(foreach po,$(wildcard ${CURDIR}/files/luci/i18n/*.po), \ + po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));) +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/luci-app-udp2raw/postinst +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + ( . /etc/uci-defaults/luci-udp2raw ) && rm -f /etc/uci-defaults/luci-udp2raw + rm -rf /tmp/luci-indexcache /tmp/luci-modulecache +fi +exit 0 +endef + +define Package/luci-app-udp2raw/conffiles +/etc/config/udp2raw +endef + +define Package/luci-app-udp2raw/install + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n + $(INSTALL_DATA) $(PKG_BUILD_DIR)/udp2raw.*.lmo $(1)/usr/lib/lua/luci/i18n/ + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller + $(INSTALL_DATA) ./files/luci/controller/*.lua $(1)/usr/lib/lua/luci/controller/ + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/udp2raw + $(INSTALL_DATA) ./files/luci/model/cbi/udp2raw/*.lua $(1)/usr/lib/lua/luci/model/cbi/udp2raw/ + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/view + $(INSTALL_DATA) ./files/luci/view/*.htm $(1)/usr/lib/lua/luci/view/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/root/etc/config/udp2raw $(1)/etc/config/udp2raw + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/root/etc/init.d/udp2raw $(1)/etc/init.d/udp2raw + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_BIN) ./files/root/etc/uci-defaults/luci-udp2raw $(1)/etc/uci-defaults/luci-udp2raw +endef + +$(eval $(call BuildPackage,luci-app-udp2raw)) diff --git a/package/lean/luci-app-udp2raw/files/luci/controller/udp2raw.lua b/package/lean/luci-app-udp2raw/files/luci/controller/udp2raw.lua new file mode 100644 index 0000000000..81d1f01355 --- /dev/null +++ b/package/lean/luci-app-udp2raw/files/luci/controller/udp2raw.lua @@ -0,0 +1,30 @@ +module("luci.controller.udp2raw", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/udp2raw") then + return + end + + entry({"admin", "services", "udp2raw"}, + firstchild(), _("udp2raw-tunnel")).dependent = false + + entry({"admin", "services", "udp2raw", "general"}, + cbi("udp2raw/general"), _("Settings"), 1) + + entry({"admin", "services", "udp2raw", "servers"}, + arcombine(cbi("udp2raw/servers"), cbi("udp2raw/servers-details")), + _("Servers Manage"), 2).leaf = true + + entry({"admin", "services", "udp2raw", "status"}, call("action_status")) +end + +local function is_running(name) + return luci.sys.call("pidof %s >/dev/null" %{name}) == 0 +end + +function action_status() + luci.http.prepare_content("application/json") + luci.http.write_json({ + running = is_running("udp2raw") + }) +end diff --git a/package/lean/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.lmo b/package/lean/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.lmo new file mode 100644 index 0000000000..e25325de08 Binary files /dev/null and b/package/lean/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.lmo differ diff --git a/package/lean/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.po b/package/lean/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.po new file mode 100644 index 0000000000..fb20472f13 --- /dev/null +++ b/package/lean/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.po @@ -0,0 +1,120 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + +msgid "udp2raw-tunnel" +msgstr "udp2raw 隧道" + +msgid "Settings" +msgstr "设置" + +msgid "Servers Manage" +msgstr "服务器管理" + +msgid "Running Status" +msgstr "运行状态" + +msgid "Binary Version" +msgstr "文件版本" + +msgid "Build Time" +msgstr "编译时间" + +msgid "Invalid Binary File." +msgstr "可执行文件无效。" + +msgid "RUNNING" +msgstr "运行中" + +msgid "NOT RUNNING" +msgstr "未运行" + +msgid "General Settings" +msgstr "基本设置" + +msgid "Server" +msgstr "服务器" + +msgid "Disable" +msgstr "停用" + +msgid "Run Daemon as User" +msgstr "以该用户启动" + +msgid "Alias" +msgstr "别名" + +msgid "None" +msgstr "无" + +msgid "Server Address" +msgstr "服务器地址" + +msgid "Listen Address" +msgstr "监听地址" + +msgid "Edit Server" +msgstr "编辑服务器" + +msgid "Alias(optional)" +msgstr "别名(可选)" + +msgid "Server Port" +msgstr "服务器端口" + +msgid "Local Listen Host" +msgstr "本地监听地址" + +msgid "Local Listen Port" +msgstr "本地监听端口" + +msgid "Raw Mode" +msgstr "Raw 方式" + +msgid "Password" +msgstr "密码" + +msgid "Cipher Mode" +msgstr "加密方式" + +msgid "Auth Mode" +msgstr "认证方式" + +msgid "Auto Rule" +msgstr "自动规则" + +msgid "Auto add (and delete) iptables rule." +msgstr "自动添加/删除 iptables 规则。" + +msgid "Keep Rule" +msgstr "保持规则" + +msgid "Monitor iptables and auto re-add if necessary." +msgstr "监视 iptables 并在必要时重新添加规则。" + +msgid "seq Mode" +msgstr "seq 模式" + +msgid "seq increase mode for faketcp." +msgstr "用于 faketcp 的 seq 增加方式。" + +msgid "Lower Level" +msgstr "" + +msgid "Send packets at OSI level 2, format: \"eth0#00:11:22:33:44:55\", or \"auto\"." +msgstr "在 OSI 模型第二层发送数据包,格式:\"eth0#00:11:22:33:44:55\",或 \"auto\"。" + +msgid "Source-IP" +msgstr "源IP" + +msgid "Force source-ip for Raw Socket." +msgstr "在原始数据包中强制指定源IP。" + +msgid "Source-Port" +msgstr "源端口" + +msgid "Force source-port for Raw Socket, TCP/UDP only." +msgstr "在原始数据包中强制指定源端口,仅用于 TCP/UDP。" + +msgid "Log Level" +msgstr "日志级别" + diff --git a/package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/general.lua b/package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/general.lua new file mode 100644 index 0000000000..a4d3430914 --- /dev/null +++ b/package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/general.lua @@ -0,0 +1,38 @@ +local m, s, o +local uci = luci.model.uci.cursor() +local servers = {} + +local function has_bin(name) + return luci.sys.call("command -v %s >/dev/null" %{name}) == 0 +end + +if not has_bin("udp2raw") then + return Map("udp2raw", "%s - %s" %{translate("udp2raw-tunnel"), + translate("Settings")}, 'udp2raw-tunnel binary file not found.') +end + +uci:foreach("udp2raw", "servers", function(s) + if s.server_addr and s.server_port then + servers[#servers+1] = {name = s[".name"], alias = s.alias or "%s:%s" %{s.server_addr, s.server_port}} + end +end) + +m = Map("udp2raw", "%s - %s" %{translate("udp2raw-tunnel"), translate("Settings")}) +m:append(Template("udp2raw_status")) + +s = m:section(NamedSection, "general", "general", translate("General Settings")) +s.anonymous = true +s.addremove = false + +o = s:option(ListValue, "server", translate("Server")) +o:value("nil", translate("Disable")) +for _, s in ipairs(servers) do o:value(s.name, s.alias) end +o.default = "nil" +o.rmempty = false + +o = s:option(ListValue, "daemon_user", translate("Run Daemon as User")) +for u in luci.util.execi("cat /etc/passwd | cut -d ':' -f1") do o:value(u) end +o.default = "root" +o.rmempty = false + +return m diff --git a/package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/servers-details.lua b/package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/servers-details.lua new file mode 100644 index 0000000000..ba961d189a --- /dev/null +++ b/package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/servers-details.lua @@ -0,0 +1,96 @@ +local m, s, o +local sid = arg[1] + +local raw_modes = { + "faketcp", + "udp", + "icmp", +} + +local cipher_modes = { + "aes128cbc", + "xor", + "none", +} + +local auth_modes = { + "md5", + "crc32", + "simple", + "none", +} + +m = Map("udp2raw", "%s - %s" %{translate("udp2raw-tunnel"), translate("Edit Server")}) +m.redirect = luci.dispatcher.build_url("admin/services/udp2raw/servers") +m.sid = sid + +if m.uci:get("udp2raw", sid) ~= "servers" then + luci.http.redirect(m.redirect) + return +end + +s = m:section(NamedSection, sid, "servers") +s.anonymous = true +s.addremove = false + +o = s:option(Value, "alias", translate("Alias(optional)")) + +o = s:option(Value, "server_addr", translate("Server")) +o.datatype = "host" +o.rmempty = false + +o = s:option(Value, "server_port", translate("Server Port")) +o.datatype = "port" +o.placeholder = "8080" + +o = s:option(Value, "listen_addr", translate("Local Listen Host")) +o.datatype = "ipaddr" +o.placeholder = "127.0.0.1" + +o = s:option(Value, "listen_port", translate("Local Listen Port")) +o.datatype = "port" +o.placeholder = "2080" + +o = s:option(ListValue, "raw_mode", translate("Raw Mode")) +for _, v in ipairs(raw_modes) do o:value(v, v:lower()) end +o.default = "faketcp" +o.rmempty = false + +o = s:option(Value, "key", translate("Password")) +o.password = true + +o = s:option(ListValue, "cipher_mode", translate("Cipher Mode")) +for _, v in ipairs(cipher_modes) do o:value(v, v:lower()) end +o.default = "aes128cbc" + +o = s:option(ListValue, "auth_mode", translate("Auth Mode")) +for _, v in ipairs(auth_modes) do o:value(v, v:lower()) end +o.default = "md5" + +o = s:option(Flag, "auto_rule", translate("Auto Rule"), translate("Auto add (and delete) iptables rule.")) +o.enabled = "1" +o.disabled = "0" +o.default = "1" + +o = s:option(Flag, "keep_rule", translate("Keep Rule"), translate("Monitor iptables and auto re-add if necessary.")) +o.enabled = "1" +o.disabled = "0" +o:depends("auto_rule", "1") + +o = s:option(Value, "seq_mode", translate("seq Mode"), translate("seq increase mode for faketcp.")) +o.datatype = "range(0,4)" +o.placeholder = "3" + +o = s:option(Value, "lower_level", translate("Lower Level"), translate("Send packets at OSI level 2, format: \"eth0#00:11:22:33:44:55\", or \"auto\".")) + +o = s:option(Value, "source_ip", translate("Source-IP"), translate("Force source-ip for Raw Socket.")) +o.datatype = "ipaddr" + +o = s:option(Value, "source_port", translate("Source-Port"), translate("Force source-port for Raw Socket, TCP/UDP only.")) +o.datatype = "port" + +o = s:option(Value, "log_level", translate("Log Level")) +o.datatype = "range(0,6)" +o.placeholder = "4" + +return m diff --git a/package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/servers.lua b/package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/servers.lua new file mode 100644 index 0000000000..34be005222 --- /dev/null +++ b/package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/servers.lua @@ -0,0 +1,56 @@ +local m, s, o + +m = Map("udp2raw", "%s - %s" %{translate("udp2raw-tunnel"), translate("Servers Manage")}) + +s = m:section(TypedSection, "servers") +s.anonymous = true +s.addremove = true +s.sortable = true +s.template = "cbi/tblsection" +s.extedit = luci.dispatcher.build_url("admin/services/udp2raw/servers/%s") +function s.create(...) + local sid = TypedSection.create(...) + if sid then + luci.http.redirect(s.extedit % sid) + return + end +end + +o = s:option(DummyValue, "alias", translate("Alias")) +function o.cfgvalue(...) + return Value.cfgvalue(...) or translate("None") +end + +o = s:option(DummyValue, "_server_address", translate("Server Address")) +function o.cfgvalue(self, section) + local server_addr = m.uci:get("udp2raw", section, "server_addr") or "?" + local server_port = m.uci:get("udp2raw", section, "server_port") or "8080" + return "%s:%s" %{server_addr, server_port} +end + +o = s:option(DummyValue, "_listen_address", translate("Listen Address")) +function o.cfgvalue(self, section) + local listen_addr = m.uci:get("udp2raw", section, "listen_addr") or "127.0.0.1" + local listen_port = m.uci:get("udp2raw", section, "listen_port") or "2080" + return "%s:%s" %{listen_addr, listen_port} +end + +o = s:option(DummyValue, "raw_mode", translate("Raw Mode")) +function o.cfgvalue(...) + local v = Value.cfgvalue(...) + return v and v:lower() or "faketcp" +end + +o = s:option(DummyValue, "cipher_mode", translate("Cipher Mode")) +function o.cfgvalue(...) + local v = Value.cfgvalue(...) + return v and v:lower() or "aes128cbc" +end + +o = s:option(DummyValue, "auth_mode", translate("Auth Mode")) +function o.cfgvalue(...) + local v = Value.cfgvalue(...) + return v and v:lower() or "md5" +end + +return m diff --git a/package/lean/luci-app-udp2raw/files/luci/view/udp2raw_status.htm b/package/lean/luci-app-udp2raw/files/luci/view/udp2raw_status.htm new file mode 100644 index 0000000000..964b11786e --- /dev/null +++ b/package/lean/luci-app-udp2raw/files/luci/view/udp2raw_status.htm @@ -0,0 +1,39 @@ +<% +local function get_udp2raw_version(name) + local info = luci.util.split(luci.sys.exec("%s -h 2>/dev/null" %{name}), "\n") + local version = string.match(info[2], "git version:(%w+)") + local build = string.match(info[2], "build date:(.+)") + return info[1] == "udp2raw-tunnel" and version or "", info[1] == "udp2raw-tunnel" and build or "" +end + +local udp2raw_version, udp2raw_build = get_udp2raw_version("udp2raw") +-%> + +
+ <%:Running Status%> + + + + + + <% if udp2raw_build ~= "" then -%> + + <% end -%> + +
<%:Binary Version%> + <% if udp2raw_version == "" then -%> + <%:Invalid Binary File.%> + <% else -%> + <%=pcdata(udp2raw_version)%> + <%- end %> +
<%:Build Time%><%=pcdata(udp2raw_build)%>
<%:Running Status%><%:Collecting data...%>
+
+ + diff --git a/package/lean/luci-app-udp2raw/files/root/etc/config/udp2raw b/package/lean/luci-app-udp2raw/files/root/etc/config/udp2raw new file mode 100644 index 0000000000..8a27625ca6 --- /dev/null +++ b/package/lean/luci-app-udp2raw/files/root/etc/config/udp2raw @@ -0,0 +1,16 @@ + +config general 'general' + option server 'nil' + option daemon_user 'root' + +config servers 'default' + option server_addr '' + option server_port '8080' + option listen_addr '127.0.0.1' + option listen_port '2080' + option raw_mode 'faketcp' + option key '' + option cipher_mode 'aes128cbc' + option auth_mode 'md5' + option auto_rule '1' + diff --git a/package/lean/luci-app-udp2raw/files/root/etc/init.d/udp2raw b/package/lean/luci-app-udp2raw/files/root/etc/init.d/udp2raw new file mode 100755 index 0000000000..3733b66d63 --- /dev/null +++ b/package/lean/luci-app-udp2raw/files/root/etc/init.d/udp2raw @@ -0,0 +1,121 @@ +#!/bin/sh /etc/rc.common + +START=88 +USE_PROCD=1 + +UDP2RAW=udp2raw + +_log() { + local level="$1" + local msg="$2" + + logger -p "daemon.${level}" -t "$UDP2RAW" "$msg" +} + +gen_client_config_file() { + local config_file="$1" + echo "# auto-generated config file from /etc/config/udp2raw" > $config_file + + echo "-c" >> $config_file + echo "-l ${listen_addr}:${listen_port}" >> $config_file && _log "info" "listening on: ${listen_addr}:${listen_port}" + echo "-r ${server_addr}:${server_port}" >> $config_file && _log "info" "remote address: ${server_addr}:${server_port}" + + [ -n "$raw_mode" ] && echo "--raw-mode ${raw_mode}" >> $config_file && _log "info" "raw-mode: ${raw_mode}" + [ -n "$key" ] && echo "--key ${key}" >> $config_file + [ -n "$cipher_mode" ] && echo "--cipher-mode ${cipher_mode}" >> $config_file && _log "info" "cipher-mode: ${cipher_mode}" + [ -n "$auth_mode" ] && echo "--auth-mode ${auth_mode}" >> $config_file && _log "info" "auth-mode: ${auth_mode}" + + [ "$auto_rule" -ne 0 ] && echo "--auto-rule" >> $config_file && _log "info" "auto-rule: true" + [ "$auto_rule" -ne 0 -a "$keep_rule" -ne 0 ] && echo "--keep-rule" >> $config_file && _log "info" "keep-rule: true" + + [ -n "$seq_mode" ] && echo "--seq-mode ${seq_mode}" >> $config_file && _log "info" "seq-mode: ${seq_mode}" + [ -n "$lower_level" ] && echo "--lower-level ${lower_level}" >> $config_file && _log "info" "lower-level: ${lower_level}" + [ -n "$source_ip" ] && echo "--source-ip ${source_ip}" >> $config_file + [ -n "$source_port" ] && echo "--source-port ${source_port}" >> $config_file + + [ -n "$log_level" ] && echo "--log-level ${log_level}" >> $config_file + echo "--disable-color" >> $config_file + _log "info" "running from ${daemon_user} user" +} + +validate_config_section() { + uci_validate_section "$UDP2RAW" general "$1" \ + 'server:uciname' \ + 'daemon_user:string:root' +} + +validate_server_section() { + uci_validate_section "$UDP2RAW" servers "$1" \ + 'server_addr:host' \ + 'server_port:port:8080' \ + 'listen_addr:ipaddr:127.0.0.1' \ + 'listen_port:port:2080' \ + 'raw_mode:or("faketcp", "udp", "icmp"):faketcp' \ + 'key:string' \ + 'cipher_mode:or("aes128cbc", "xor", "none"):aes128cbc' \ + 'auth_mode:or("md5", "crc32", "simple", "none"):md5' \ + 'auto_rule:bool:1' \ + 'keep_rule:bool:0' \ + 'seq_mode:range(0,4)' \ + 'lower_level:string' \ + 'source_ip:ipaddr' \ + 'source_port:port' \ + 'log_level:range(0,6)' +} + +start_udp2raw_instance() { + local section="$1" + + if ! validate_config_section "$section" ; then + _log "err" "Config validate failed." + return 1 + fi + + if [ -z "$server" ] || [ "$server" = "nil" ]; then + return 0 + elif ! validate_server_section "$server"; then + _log "err" "Server config validation failed." + return 1 + elif [ -z "$server_addr" ]; then + _log "err" "Server address validation failed." + return 1 + fi + + is_ipv6_address() { + echo "$1" | grep -q ":" + } + + is_ipv6_address "$server_addr" && server_addr="[${server_addr}]" + is_ipv6_address "$listen_addr" && listen_addr="[${listen_addr}]" + + _log "notice" "udp2raw-tunnel start." + [ -d /var/etc ] || mkdir -p /var/etc + local config_file=/var/etc/${UDP2RAW}.${server}.conf + + if ! ( gen_client_config_file "$config_file" ); then + _log "err" "Can't create config file". + return 1 + fi + + procd_open_instance + procd_set_param command /usr/bin/udp2raw + procd_append_param command --conf-file "$config_file" + procd_set_param respawn + procd_set_param file "$config_file" + procd_set_param user "$daemon_user" + procd_set_param pidfile /var/run/${UDP2RAW}.${server}.pid + procd_close_instance +} + +service_triggers() { + procd_add_reload_trigger "$UDP2RAW" +} + +start_service() { + config_load "$UDP2RAW" + config_foreach start_udp2raw_instance "general" +} + +stop_service() { + _log "notice" "udp2raw-tunnel stop." +} diff --git a/package/lean/luci-app-udp2raw/files/root/etc/uci-defaults/luci-udp2raw b/package/lean/luci-app-udp2raw/files/root/etc/uci-defaults/luci-udp2raw new file mode 100755 index 0000000000..c04688e419 --- /dev/null +++ b/package/lean/luci-app-udp2raw/files/root/etc/uci-defaults/luci-udp2raw @@ -0,0 +1,25 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@udp2raw[-1] + add ucitrack udp2raw + set ucitrack.@udp2raw[-1].init=udp2raw + commit ucitrack +EOF + +general=$(uci -q get udp2raw.@general[-1]) + +if [ -z "$general" ]; then + uci -q add udp2raw general +fi + +if [ ."$general" != ."general" ]; then + uci -q batch <<-EOF >/dev/null + rename udp2raw.@general[-1]="general" + set udp2raw.general.server="nil" + commit udp2raw + EOF +fi + +rm -rf /tmp/luci-indexcache /tmp/luci-modulecache +exit 0 diff --git a/package/lean/luci-app-udp2raw/tools/po2lmo/Makefile b/package/lean/luci-app-udp2raw/tools/po2lmo/Makefile new file mode 100644 index 0000000000..ad2c133207 --- /dev/null +++ b/package/lean/luci-app-udp2raw/tools/po2lmo/Makefile @@ -0,0 +1,12 @@ + +INSTALL = install +PREFIX = /usr/bin + +po2lmo: src/po2lmo.o src/template_lmo.o + $(CC) $(LDFLAGS) -o src/po2lmo src/po2lmo.o src/template_lmo.o + +install: + $(INSTALL) -m 755 src/po2lmo $(PREFIX) + +clean: + $(RM) src/po2lmo src/*.o diff --git a/package/lean/luci-app-udp2raw/tools/po2lmo/src/po2lmo.c b/package/lean/luci-app-udp2raw/tools/po2lmo/src/po2lmo.c new file mode 100644 index 0000000000..0da792b680 --- /dev/null +++ b/package/lean/luci-app-udp2raw/tools/po2lmo/src/po2lmo.c @@ -0,0 +1,247 @@ +/* + * lmo - Lua Machine Objects - PO to LMO conversion tool + * + * Copyright (C) 2009-2012 Jo-Philipp Wich + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "template_lmo.h" + +static void die(const char *msg) +{ + fprintf(stderr, "Error: %s\n", msg); + exit(1); +} + +static void usage(const char *name) +{ + fprintf(stderr, "Usage: %s input.po output.lmo\n", name); + exit(1); +} + +static void print(const void *ptr, size_t size, size_t nmemb, FILE *stream) +{ + if( fwrite(ptr, size, nmemb, stream) == 0 ) + die("Failed to write stdout"); +} + +static int extract_string(const char *src, char *dest, int len) +{ + int pos = 0; + int esc = 0; + int off = -1; + + for( pos = 0; (pos < strlen(src)) && (pos < len); pos++ ) + { + if( (off == -1) && (src[pos] == '"') ) + { + off = pos + 1; + } + else if( off >= 0 ) + { + if( esc == 1 ) + { + switch (src[pos]) + { + case '"': + case '\\': + off++; + break; + } + dest[pos-off] = src[pos]; + esc = 0; + } + else if( src[pos] == '\\' ) + { + dest[pos-off] = src[pos]; + esc = 1; + } + else if( src[pos] != '"' ) + { + dest[pos-off] = src[pos]; + } + else + { + dest[pos-off] = '\0'; + break; + } + } + } + + return (off > -1) ? strlen(dest) : -1; +} + +static int cmp_index(const void *a, const void *b) +{ + uint32_t x = ((const lmo_entry_t *)a)->key_id; + uint32_t y = ((const lmo_entry_t *)b)->key_id; + + if (x < y) + return -1; + else if (x > y) + return 1; + + return 0; +} + +static void print_uint32(uint32_t x, FILE *out) +{ + uint32_t y = htonl(x); + print(&y, sizeof(uint32_t), 1, out); +} + +static void print_index(void *array, int n, FILE *out) +{ + lmo_entry_t *e; + + qsort(array, n, sizeof(*e), cmp_index); + + for (e = array; n > 0; n--, e++) + { + print_uint32(e->key_id, out); + print_uint32(e->val_id, out); + print_uint32(e->offset, out); + print_uint32(e->length, out); + } +} + +int main(int argc, char *argv[]) +{ + char line[4096]; + char key[4096]; + char val[4096]; + char tmp[4096]; + int state = 0; + int offset = 0; + int length = 0; + int n_entries = 0; + void *array = NULL; + lmo_entry_t *entry = NULL; + uint32_t key_id, val_id; + + FILE *in; + FILE *out; + + if( (argc != 3) || ((in = fopen(argv[1], "r")) == NULL) || ((out = fopen(argv[2], "w")) == NULL) ) + usage(argv[0]); + + memset(line, 0, sizeof(key)); + memset(key, 0, sizeof(val)); + memset(val, 0, sizeof(val)); + + while( (NULL != fgets(line, sizeof(line), in)) || (state >= 2 && feof(in)) ) + { + if( state == 0 && strstr(line, "msgid \"") == line ) + { + switch(extract_string(line, key, sizeof(key))) + { + case -1: + die("Syntax error in msgid"); + case 0: + state = 1; + break; + default: + state = 2; + } + } + else if( state == 1 || state == 2 ) + { + if( strstr(line, "msgstr \"") == line || state == 2 ) + { + switch(extract_string(line, val, sizeof(val))) + { + case -1: + state = 4; + break; + default: + state = 3; + } + } + else + { + switch(extract_string(line, tmp, sizeof(tmp))) + { + case -1: + state = 2; + break; + default: + strcat(key, tmp); + } + } + } + else if( state == 3 ) + { + switch(extract_string(line, tmp, sizeof(tmp))) + { + case -1: + state = 4; + break; + default: + strcat(val, tmp); + } + } + + if( state == 4 ) + { + if( strlen(key) > 0 && strlen(val) > 0 ) + { + key_id = sfh_hash(key, strlen(key)); + val_id = sfh_hash(val, strlen(val)); + + if( key_id != val_id ) + { + n_entries++; + array = realloc(array, n_entries * sizeof(lmo_entry_t)); + entry = (lmo_entry_t *)array + n_entries - 1; + + if (!array) + die("Out of memory"); + + entry->key_id = key_id; + entry->val_id = val_id; + entry->offset = offset; + entry->length = strlen(val); + + length = strlen(val) + ((4 - (strlen(val) % 4)) % 4); + + print(val, length, 1, out); + offset += length; + } + } + + state = 0; + memset(key, 0, sizeof(key)); + memset(val, 0, sizeof(val)); + } + + memset(line, 0, sizeof(line)); + } + + print_index(array, n_entries, out); + + if( offset > 0 ) + { + print_uint32(offset, out); + fsync(fileno(out)); + fclose(out); + } + else + { + fclose(out); + unlink(argv[2]); + } + + fclose(in); + return(0); +} diff --git a/package/lean/luci-app-udp2raw/tools/po2lmo/src/template_lmo.c b/package/lean/luci-app-udp2raw/tools/po2lmo/src/template_lmo.c new file mode 100644 index 0000000000..27205a7228 --- /dev/null +++ b/package/lean/luci-app-udp2raw/tools/po2lmo/src/template_lmo.c @@ -0,0 +1,328 @@ +/* + * lmo - Lua Machine Objects - Base functions + * + * Copyright (C) 2009-2010 Jo-Philipp Wich + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "template_lmo.h" + +/* + * Hash function from http://www.azillionmonkeys.com/qed/hash.html + * Copyright (C) 2004-2008 by Paul Hsieh + */ + +uint32_t sfh_hash(const char *data, int len) +{ + uint32_t hash = len, tmp; + int rem; + + if (len <= 0 || data == NULL) return 0; + + rem = len & 3; + len >>= 2; + + /* Main loop */ + for (;len > 0; len--) { + hash += sfh_get16(data); + tmp = (sfh_get16(data+2) << 11) ^ hash; + hash = (hash << 16) ^ tmp; + data += 2*sizeof(uint16_t); + hash += hash >> 11; + } + + /* Handle end cases */ + switch (rem) { + case 3: hash += sfh_get16(data); + hash ^= hash << 16; + hash ^= data[sizeof(uint16_t)] << 18; + hash += hash >> 11; + break; + case 2: hash += sfh_get16(data); + hash ^= hash << 11; + hash += hash >> 17; + break; + case 1: hash += *data; + hash ^= hash << 10; + hash += hash >> 1; + } + + /* Force "avalanching" of final 127 bits */ + hash ^= hash << 3; + hash += hash >> 5; + hash ^= hash << 4; + hash += hash >> 17; + hash ^= hash << 25; + hash += hash >> 6; + + return hash; +} + +uint32_t lmo_canon_hash(const char *str, int len) +{ + char res[4096]; + char *ptr, prev; + int off; + + if (!str || len >= sizeof(res)) + return 0; + + for (prev = ' ', ptr = res, off = 0; off < len; prev = *str, off++, str++) + { + if (isspace(*str)) + { + if (!isspace(prev)) + *ptr++ = ' '; + } + else + { + *ptr++ = *str; + } + } + + if ((ptr > res) && isspace(*(ptr-1))) + ptr--; + + return sfh_hash(res, ptr - res); +} + +lmo_archive_t * lmo_open(const char *file) +{ + int in = -1; + uint32_t idx_offset = 0; + struct stat s; + + lmo_archive_t *ar = NULL; + + if (stat(file, &s) == -1) + goto err; + + if ((in = open(file, O_RDONLY)) == -1) + goto err; + + if ((ar = (lmo_archive_t *)malloc(sizeof(*ar))) != NULL) + { + memset(ar, 0, sizeof(*ar)); + + ar->fd = in; + ar->size = s.st_size; + + fcntl(ar->fd, F_SETFD, fcntl(ar->fd, F_GETFD) | FD_CLOEXEC); + + if ((ar->mmap = mmap(NULL, ar->size, PROT_READ, MAP_SHARED, ar->fd, 0)) == MAP_FAILED) + goto err; + + idx_offset = ntohl(*((const uint32_t *) + (ar->mmap + ar->size - sizeof(uint32_t)))); + + if (idx_offset >= ar->size) + goto err; + + ar->index = (lmo_entry_t *)(ar->mmap + idx_offset); + ar->length = (ar->size - idx_offset - sizeof(uint32_t)) / sizeof(lmo_entry_t); + ar->end = ar->mmap + ar->size; + + return ar; + } + +err: + if (in > -1) + close(in); + + if (ar != NULL) + { + if ((ar->mmap != NULL) && (ar->mmap != MAP_FAILED)) + munmap(ar->mmap, ar->size); + + free(ar); + } + + return NULL; +} + +void lmo_close(lmo_archive_t *ar) +{ + if (ar != NULL) + { + if ((ar->mmap != NULL) && (ar->mmap != MAP_FAILED)) + munmap(ar->mmap, ar->size); + + close(ar->fd); + free(ar); + + ar = NULL; + } +} + + +lmo_catalog_t *_lmo_catalogs = NULL; +lmo_catalog_t *_lmo_active_catalog = NULL; + +int lmo_load_catalog(const char *lang, const char *dir) +{ + DIR *dh = NULL; + char pattern[16]; + char path[PATH_MAX]; + struct dirent *de = NULL; + + lmo_archive_t *ar = NULL; + lmo_catalog_t *cat = NULL; + + if (!lmo_change_catalog(lang)) + return 0; + + if (!dir || !(dh = opendir(dir))) + goto err; + + if (!(cat = malloc(sizeof(*cat)))) + goto err; + + memset(cat, 0, sizeof(*cat)); + + snprintf(cat->lang, sizeof(cat->lang), "%s", lang); + snprintf(pattern, sizeof(pattern), "*.%s.lmo", lang); + + while ((de = readdir(dh)) != NULL) + { + if (!fnmatch(pattern, de->d_name, 0)) + { + snprintf(path, sizeof(path), "%s/%s", dir, de->d_name); + ar = lmo_open(path); + + if (ar) + { + ar->next = cat->archives; + cat->archives = ar; + } + } + } + + closedir(dh); + + cat->next = _lmo_catalogs; + _lmo_catalogs = cat; + + if (!_lmo_active_catalog) + _lmo_active_catalog = cat; + + return 0; + +err: + if (dh) closedir(dh); + if (cat) free(cat); + + return -1; +} + +int lmo_change_catalog(const char *lang) +{ + lmo_catalog_t *cat; + + for (cat = _lmo_catalogs; cat; cat = cat->next) + { + if (!strncmp(cat->lang, lang, sizeof(cat->lang))) + { + _lmo_active_catalog = cat; + return 0; + } + } + + return -1; +} + +static lmo_entry_t * lmo_find_entry(lmo_archive_t *ar, uint32_t hash) +{ + unsigned int m, l, r; + uint32_t k; + + l = 0; + r = ar->length - 1; + + while (1) + { + m = l + ((r - l) / 2); + + if (r < l) + break; + + k = ntohl(ar->index[m].key_id); + + if (k == hash) + return &ar->index[m]; + + if (k > hash) + { + if (!m) + break; + + r = m - 1; + } + else + { + l = m + 1; + } + } + + return NULL; +} + +int lmo_translate(const char *key, int keylen, char **out, int *outlen) +{ + uint32_t hash; + lmo_entry_t *e; + lmo_archive_t *ar; + + if (!key || !_lmo_active_catalog) + return -2; + + hash = lmo_canon_hash(key, keylen); + + for (ar = _lmo_active_catalog->archives; ar; ar = ar->next) + { + if ((e = lmo_find_entry(ar, hash)) != NULL) + { + *out = ar->mmap + ntohl(e->offset); + *outlen = ntohl(e->length); + return 0; + } + } + + return -1; +} + +void lmo_close_catalog(const char *lang) +{ + lmo_archive_t *ar, *next; + lmo_catalog_t *cat, *prev; + + for (prev = NULL, cat = _lmo_catalogs; cat; prev = cat, cat = cat->next) + { + if (!strncmp(cat->lang, lang, sizeof(cat->lang))) + { + if (prev) + prev->next = cat->next; + else + _lmo_catalogs = cat->next; + + for (ar = cat->archives; ar; ar = next) + { + next = ar->next; + lmo_close(ar); + } + + free(cat); + break; + } + } +} diff --git a/package/lean/luci-app-udp2raw/tools/po2lmo/src/template_lmo.h b/package/lean/luci-app-udp2raw/tools/po2lmo/src/template_lmo.h new file mode 100644 index 0000000000..57f59aa56b --- /dev/null +++ b/package/lean/luci-app-udp2raw/tools/po2lmo/src/template_lmo.h @@ -0,0 +1,92 @@ +/* + * lmo - Lua Machine Objects - General header + * + * Copyright (C) 2009-2012 Jo-Philipp Wich + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _TEMPLATE_LMO_H_ +#define _TEMPLATE_LMO_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if (defined(__GNUC__) && defined(__i386__)) +#define sfh_get16(d) (*((const uint16_t *) (d))) +#else +#define sfh_get16(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\ + +(uint32_t)(((const uint8_t *)(d))[0]) ) +#endif + + +struct lmo_entry { + uint32_t key_id; + uint32_t val_id; + uint32_t offset; + uint32_t length; +} __attribute__((packed)); + +typedef struct lmo_entry lmo_entry_t; + + +struct lmo_archive { + int fd; + int length; + uint32_t size; + lmo_entry_t *index; + char *mmap; + char *end; + struct lmo_archive *next; +}; + +typedef struct lmo_archive lmo_archive_t; + + +struct lmo_catalog { + char lang[6]; + struct lmo_archive *archives; + struct lmo_catalog *next; +}; + +typedef struct lmo_catalog lmo_catalog_t; + + +uint32_t sfh_hash(const char *data, int len); +uint32_t lmo_canon_hash(const char *data, int len); + +lmo_archive_t * lmo_open(const char *file); +void lmo_close(lmo_archive_t *ar); + + +extern lmo_catalog_t *_lmo_catalogs; +extern lmo_catalog_t *_lmo_active_catalog; + +int lmo_load_catalog(const char *lang, const char *dir); +int lmo_change_catalog(const char *lang); +int lmo_translate(const char *key, int keylen, char **out, int *outlen); +void lmo_close_catalog(const char *lang); + +#endif diff --git a/package/lean/luci-app-xlnetacc/Makefile b/package/lean/luci-app-xlnetacc/Makefile new file mode 100644 index 0000000000..95626f9135 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/Makefile @@ -0,0 +1,71 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=luci-app-xlnetacc +PKG_VERSION:=1.0.0 +PKG_RELEASE:=3 + +PKG_LICENSE:=GPLv2 +PKG_MAINTAINER:=Sense + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/$(PKG_NAME) + SECTION:=luci + CATEGORY:=LuCI + SUBMENU:=3. Applications + TITLE:=LuCI Support for XLNetAcc + PKGARCH:=all + DEPENDS:=+wget +openssl-util +endef + +define Package/$(PKG_NAME)/description + LuCI Support for XLNetAcc. +endef + +define Build/Prepare + $(foreach po,$(wildcard ${CURDIR}/files/luci/i18n/*.po), \ + po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));) +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/$(PKG_NAME)/postinst +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + ( . /etc/uci-defaults/luci-xlnetacc ) && rm -f /etc/uci-defaults/luci-xlnetacc +fi +exit 0 +endef + +define Package/$(PKG_NAME)/conffiles + /etc/config/xlnetacc +endef + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n + $(INSTALL_DATA) $(PKG_BUILD_DIR)/xlnetacc.*.lmo $(1)/usr/lib/lua/luci/i18n/ + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller + $(INSTALL_DATA) ./files/luci/controller/*.lua $(1)/usr/lib/lua/luci/controller/ + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi + $(INSTALL_DATA) ./files/luci/model/cbi/*.lua $(1)/usr/lib/lua/luci/model/cbi/ + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/xlnetacc + $(INSTALL_DATA) ./files/luci/view/xlnetacc/*.htm $(1)/usr/lib/lua/luci/view/xlnetacc/ + $(INSTALL_DIR) $(1)/www/luci-static/resources/xlnetacc + $(INSTALL_DATA) ./files/luci/luci-static/resources/xlnetacc/*.js $(1)/www/luci-static/resources/xlnetacc/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/root/etc/config/xlnetacc $(1)/etc/config/xlnetacc + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/root/etc/init.d/xlnetacc $(1)/etc/init.d/xlnetacc + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_BIN) ./files/root/etc/uci-defaults/luci-xlnetacc $(1)/etc/uci-defaults/luci-xlnetacc + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) ./files/root/usr/bin/xlnetacc.sh $(1)/usr/bin/xlnetacc.sh +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/package/lean/luci-app-xlnetacc/files/luci/controller/xlnetacc.lua b/package/lean/luci-app-xlnetacc/files/luci/controller/xlnetacc.lua new file mode 100644 index 0000000000..65fbcb9214 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/luci/controller/xlnetacc.lua @@ -0,0 +1,47 @@ +module("luci.controller.xlnetacc", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/xlnetacc") then + return + end + + entry({"admin", "services", "xlnetacc"}, + firstchild(), _("XLNetAcc")).dependent = false + + entry({"admin", "services", "xlnetacc", "general"}, + cbi("xlnetacc"), _("Settings"), 1) + + entry({"admin", "services", "xlnetacc", "log"}, + template("xlnetacc/logview"), _("Log"), 2) + + entry({"admin", "services", "xlnetacc", "status"}, call("action_status")) + entry({"admin", "services", "xlnetacc", "logdata"}, call("action_log")) +end + +local function is_running(name) + return luci.sys.call("pidof %s >/dev/null" %{name}) == 0 +end + +function action_status() + luci.http.prepare_content("application/json") + luci.http.write_json({ + run_state = is_running("xlnetacc.sh"), + down_state = nixio.fs.readfile("/var/state/xlnetacc_down_state") or "", + up_state = nixio.fs.readfile("/var/state/xlnetacc_up_state") or "" + }) +end + +function action_log() + local uci = require "luci.model.uci".cursor() + local util = require "luci.util" + local log_data = { } + + log_data.syslog = util.trim(util.exec("logread | grep xlnetacc")) + if uci:get("xlnetacc", "general", "logging") ~= "0" then + log_data.client = nixio.fs.readfile("/var/log/xlnetacc.log") or "" + end + uci:unload("xlnetacc") + + luci.http.prepare_content("application/json") + luci.http.write_json(log_data) +end diff --git a/package/lean/luci-app-xlnetacc/files/luci/i18n/xlnetacc.zh-cn.lmo b/package/lean/luci-app-xlnetacc/files/luci/i18n/xlnetacc.zh-cn.lmo new file mode 100644 index 0000000000..b0598e9633 Binary files /dev/null and b/package/lean/luci-app-xlnetacc/files/luci/i18n/xlnetacc.zh-cn.lmo differ diff --git a/package/lean/luci-app-xlnetacc/files/luci/i18n/xlnetacc.zh-cn.po b/package/lean/luci-app-xlnetacc/files/luci/i18n/xlnetacc.zh-cn.po new file mode 100644 index 0000000000..a0bb64cea0 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/luci/i18n/xlnetacc.zh-cn.po @@ -0,0 +1,92 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + +msgid "XLNetAcc" +msgstr "迅雷快鸟" + +msgid "XLNetAcc is a Thunder joint broadband operators launched a commitment to help users solve the low broadband, slow Internet access, poor Internet experience of professional-grade broadband upgrade software." +msgstr "迅雷快鸟是迅雷联合宽带运营商推出的一款致力于帮助用户解决宽带低、网速慢、上网体验差的专业级宽带提速软件。" + +msgid "Settings" +msgstr "设置" + +msgid "Log" +msgstr "日志" + +msgid "Running Status" +msgstr "运行状态" + +msgid "XLNetAcc Running Status" +msgstr "快鸟运行状态" + +msgid "DownLink Upgrade Status" +msgstr "下行提速状态" + +msgid "UpLink Upgrade Status" +msgstr "上行提速状态" + +msgid "RUNNING" +msgstr "运行中" + +msgid "NOT RUNNING" +msgstr "未运行" + +msgid "No upgrade information" +msgstr "暂无提速信息" + +msgid "General Settings" +msgstr "基本设置" + +msgid "Enabled" +msgstr "启用" + +msgid "Enable DownLink Upgrade" +msgstr "开启下行提速" + +msgid "Enable UpLink Upgrade" +msgstr "开启上行提速" + +msgid "Enable Logging" +msgstr "启用日志记录" + +msgid "Enable verbose logging" +msgstr "启用详细日志" + +msgid "Upgrade interface" +msgstr "指定提速接口" + +msgid "XLNetAcc account" +msgstr "迅雷快鸟帐号" + +msgid "XLNetAcc password" +msgstr "迅雷快鸟密码" + +msgid "Does not store the plaintext password, automatically emptied after start." +msgstr "不存储明文密码,启动后自动清空。" + +msgid "Encrypted password" +msgstr "加密后的密码" + +msgid "Auto-generate in accordance with the plaintext password, do not modify it!" +msgstr "根据明文密码自动生成,请勿修改!" + +msgid "Log Data" +msgstr "日志数据" + +msgid "Loading..." +msgstr "正在加载..." + +msgid "Refresh every 5 seconds." +msgstr "每 5 秒刷新。" + +msgid "syslog:" +msgstr "系统日志:" + +msgid "log file:" +msgstr "日志文件:" + +msgid "No log data." +msgstr "无日志数据。" + +msgid "Error get log data." +msgstr "获取日志数据失败。" diff --git a/package/lean/luci-app-xlnetacc/files/luci/luci-static/resources/xlnetacc/md5-min.js b/package/lean/luci-app-xlnetacc/files/luci/luci-static/resources/xlnetacc/md5-min.js new file mode 100644 index 0000000000..4f08fe1f40 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/luci/luci-static/resources/xlnetacc/md5-min.js @@ -0,0 +1,9 @@ +/* + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for more info. + */ +var hexcase=0;function hex_md5(a){return rstr2hex(rstr_md5(str2rstr_utf8(a)))}function hex_hmac_md5(a,b){return rstr2hex(rstr_hmac_md5(str2rstr_utf8(a),str2rstr_utf8(b)))}function md5_vm_test(){return hex_md5("abc").toLowerCase()=="900150983cd24fb0d6963f7d28e17f72"}function rstr_md5(a){return binl2rstr(binl_md5(rstr2binl(a),a.length*8))}function rstr_hmac_md5(c,f){var e=rstr2binl(c);if(e.length>16){e=binl_md5(e,c.length*8)}var a=Array(16),d=Array(16);for(var b=0;b<16;b++){a[b]=e[b]^909522486;d[b]=e[b]^1549556828}var g=binl_md5(a.concat(rstr2binl(f)),512+f.length*8);return binl2rstr(binl_md5(d.concat(g),512+128))}function rstr2hex(c){try{hexcase}catch(g){hexcase=0}var f=hexcase?"0123456789ABCDEF":"0123456789abcdef";var b="";var a;for(var d=0;d>>4)&15)+f.charAt(a&15)}return b}function str2rstr_utf8(c){var b="";var d=-1;var a,e;while(++d>>6)&31),128|(a&63))}else{if(a<=65535){b+=String.fromCharCode(224|((a>>>12)&15),128|((a>>>6)&63),128|(a&63))}else{if(a<=2097151){b+=String.fromCharCode(240|((a>>>18)&7),128|((a>>>12)&63),128|((a>>>6)&63),128|(a&63))}}}}}return b}function rstr2binl(b){var a=Array(b.length>>2);for(var c=0;c>5]|=(b.charCodeAt(c/8)&255)<<(c%32)}return a}function binl2rstr(b){var a="";for(var c=0;c>5]>>>(c%32))&255)}return a}function binl_md5(p,k){p[k>>5]|=128<<((k)%32);p[(((k+64)>>>9)<<4)+14]=k;var o=1732584193;var n=-271733879;var m=-1732584194;var l=271733878;for(var g=0;g>16)+(d>>16)+(c>>16);return(b<<16)|(c&65535)}function bit_rol(a,b){return(a<>>(32-b))}; \ No newline at end of file diff --git a/package/lean/luci-app-kuainiao/root/www/luci-static/resources/rsa.js b/package/lean/luci-app-xlnetacc/files/luci/luci-static/resources/xlnetacc/rsa.js similarity index 100% rename from package/lean/luci-app-kuainiao/root/www/luci-static/resources/rsa.js rename to package/lean/luci-app-xlnetacc/files/luci/luci-static/resources/xlnetacc/rsa.js diff --git a/package/lean/luci-app-xlnetacc/files/luci/luci-static/resources/xlnetacc/sha1-min.js b/package/lean/luci-app-xlnetacc/files/luci/luci-static/resources/xlnetacc/sha1-min.js new file mode 100644 index 0000000000..cb5544618c --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/luci/luci-static/resources/xlnetacc/sha1-min.js @@ -0,0 +1,9 @@ +/* + * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined + * in FIPS 180-1 + * Version 2.2 Copyright Paul Johnston 2000 - 2009. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for details. + */ +var hexcase=0;var b64pad="";function hex_sha1(a){return rstr2hex(rstr_sha1(str2rstr_utf8(a)))}function hex_hmac_sha1(a,b){return rstr2hex(rstr_hmac_sha1(str2rstr_utf8(a),str2rstr_utf8(b)))}function sha1_vm_test(){return hex_sha1("abc").toLowerCase()=="a9993e364706816aba3e25717850c26c9cd0d89d"}function rstr_sha1(a){return binb2rstr(binb_sha1(rstr2binb(a),a.length*8))}function rstr_hmac_sha1(c,f){var e=rstr2binb(c);if(e.length>16){e=binb_sha1(e,c.length*8)}var a=Array(16),d=Array(16);for(var b=0;b<16;b++){a[b]=e[b]^909522486;d[b]=e[b]^1549556828}var g=binb_sha1(a.concat(rstr2binb(f)),512+f.length*8);return binb2rstr(binb_sha1(d.concat(g),512+160))}function rstr2hex(c){try{hexcase}catch(g){hexcase=0}var f=hexcase?"0123456789ABCDEF":"0123456789abcdef";var b="";var a;for(var d=0;d>>4)&15)+f.charAt(a&15)}return b}function str2rstr_utf8(c){var b="";var d=-1;var a,e;while(++d>>6)&31),128|(a&63))}else{if(a<=65535){b+=String.fromCharCode(224|((a>>>12)&15),128|((a>>>6)&63),128|(a&63))}else{if(a<=2097151){b+=String.fromCharCode(240|((a>>>18)&7),128|((a>>>12)&63),128|((a>>>6)&63),128|(a&63))}}}}}return b}function rstr2binb(b){var a=Array(b.length>>2);for(var c=0;c>5]|=(b.charCodeAt(c/8)&255)<<(24-c%32)}return a}function binb2rstr(b){var a="";for(var c=0;c>5]>>>(24-c%32))&255)}return a}function binb_sha1(v,o){v[o>>5]|=128<<(24-o%32);v[((o+64>>9)<<4)+15]=o;var y=Array(80);var u=1732584193;var s=-271733879;var r=-1732584194;var q=271733878;var p=-1009589776;for(var l=0;l>16)+(d>>16)+(c>>16);return(b<<16)|(c&65535)}function bit_rol(a,b){return(a<>>(32-b))}; \ No newline at end of file diff --git a/package/lean/luci-app-xlnetacc/files/luci/model/cbi/xlnetacc.lua b/package/lean/luci-app-xlnetacc/files/luci/model/cbi/xlnetacc.lua new file mode 100644 index 0000000000..3408a1ff9c --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/luci/model/cbi/xlnetacc.lua @@ -0,0 +1,40 @@ +local m, s, o +local uci = luci.model.uci.cursor() + +m = Map("xlnetacc", "%s - %s" %{translate("XLNetAcc"), translate("Settings")}, translate("XLNetAcc is a Thunder joint broadband operators launched a commitment to help users solve the low broadband, slow Internet access, poor Internet experience of professional-grade broadband upgrade software.")) +m:append(Template("xlnetacc/status")) + +s = m:section(NamedSection, "general", "general", translate("General Settings")) +s.anonymous = true +s.addremove = false + +o = s:option(Flag, "enabled", translate("Enabled")) +o.rmempty = false + +o = s:option(Flag, "down_acc", translate("Enable DownLink Upgrade")) + +o = s:option(Flag, "up_acc", translate("Enable UpLink Upgrade")) + +o = s:option(Flag, "logging", translate("Enable Logging")) +o.default = "1" + +o = s:option(Flag, "verbose", translate("Enable verbose logging")) +o:depends("logging", "1") + +o = s:option(ListValue, "network", translate("Upgrade interface")) +uci:foreach("network", "interface", function(section) + if section[".name"] ~= "loopback" and section[".name"] ~= "lan" then + o:value(section[".name"]) + end +end) + +o = s:option(Value, "account", translate("XLNetAcc account")) + +o = s:option(Value, "password", translate("XLNetAcc password"), translate("Does not store the plaintext password, automatically emptied after start.")) +o.password = true +o.template = "xlnetacc/rsa" + +o = s:option(Value, "encrypt", translate("Encrypted password"), translate("Auto-generate in accordance with the plaintext password, do not modify it!")) +--o.readonly = true + +return m diff --git a/package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/logview.htm b/package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/logview.htm new file mode 100644 index 0000000000..a07a27112f --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/logview.htm @@ -0,0 +1,49 @@ +<% css = [[ + #log_text { + padding: 10px; + text-align: left; + height: 500px; + overflow: auto; + } + #log_text pre { + word-break: break-all; + margin: 0; + } + .description { + color: #ffffff; + background-color: #0099ff; + } +]] +%> + +<%+header%> + +
+

<%:XLNetAcc%> - <%:Log Data%>

+
+
+
<%:Loading...%><%:Collecting data...%>
+
<%:Refresh every 5 seconds.%>
+
+
+
+ + + + +<%+footer%> diff --git a/package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/rsa.htm b/package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/rsa.htm new file mode 100644 index 0000000000..b79dbf11a8 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/rsa.htm @@ -0,0 +1,41 @@ + + + + + + +<%+cbi/valueheader%> + 0, "data-choices", { self.keylist, self.vallist }) + %> onchange="onchange_rsa(this.id)" /> + <% if self.password then %><% end %> +<%+cbi/valuefooter%> diff --git a/package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/status.htm b/package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/status.htm new file mode 100644 index 0000000000..4af0731d06 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/status.htm @@ -0,0 +1,21 @@ +
+ <%:Running Status%> + + + + +
<%:XLNetAcc Running Status%><%:Collecting data...%>
<%:DownLink Upgrade Status%><%:Collecting data...%>
<%:UpLink Upgrade Status%><%:Collecting data...%>
+
+ + diff --git a/package/lean/luci-app-xlnetacc/files/root/etc/config/xlnetacc b/package/lean/luci-app-xlnetacc/files/root/etc/config/xlnetacc new file mode 100644 index 0000000000..4345070c4c --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/root/etc/config/xlnetacc @@ -0,0 +1,5 @@ + +config general 'general' + option enabled '0' + option network 'wan' + diff --git a/package/lean/luci-app-xlnetacc/files/root/etc/init.d/xlnetacc b/package/lean/luci-app-xlnetacc/files/root/etc/init.d/xlnetacc new file mode 100755 index 0000000000..f4ffef0a2c --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/root/etc/init.d/xlnetacc @@ -0,0 +1,44 @@ +#!/bin/sh /etc/rc.common + +START=95 +STOP=10 +SERVICE_DAEMONIZE=1 + +NAME=xlnetacc + +start() { + pidof "${NAME}.sh" >/dev/null 2>&1 && return + + config_load "$NAME" + config_get_bool enabled "general" "enabled" 0 + config_get_bool down_acc "general" "down_acc" 0 + config_get_bool up_acc "general" "up_acc" 0 + config_get network "general" "network" + config_get account "general" "account" + config_get encrypt "general" "encrypt" + ( [ $enabled -eq 0 ] || [ $down_acc -eq 0 -a $up_acc -eq 0 ] || [ -z "$account" -o -z "$encrypt" -o -z "$network" ] ) && return + + logger -p "daemon.notice" -t "$NAME" "XLNetAcc is starting ..." + service_start /usr/bin/${NAME}.sh --start +} + +stop() { + pidof "${NAME}.sh" >/dev/null 2>&1 || return + + local pid spid + for pid in $(pidof "${NAME}.sh"); do + kill $pid >/dev/null 2>&1 + echo "Stop XLNetAcc process PID: $pid" + for spid in $(pgrep -P $pid "sleep"); do + kill $spid >/dev/null 2>&1 + echo "Stop XLNetAcc process SPID: $spid" + done + done + logger -p "daemon.notice" -t "$NAME" "XLNetAcc has stoped." +} + +restart() { + stop + sleep 1 + start +} diff --git a/package/lean/luci-app-xlnetacc/files/root/etc/uci-defaults/luci-xlnetacc b/package/lean/luci-app-xlnetacc/files/root/etc/uci-defaults/luci-xlnetacc new file mode 100755 index 0000000000..632c026789 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/root/etc/uci-defaults/luci-xlnetacc @@ -0,0 +1,22 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@xlnetacc[-1] + add ucitrack xlnetacc + set ucitrack.@xlnetacc[-1].init=xlnetacc + commit ucitrack +EOF + +general=$(uci -q get xlnetacc.@general[-1]) +if [ -z "$general" ]; then + uci -q add xlnetacc general +fi +if [ "$general"x != "general"x ]; then + uci -q batch <<-EOF >/dev/null + rename xlnetacc.@general[-1]="general" + commit xlnetacc + EOF +fi + +rm -rf /tmp/luci-indexcache /tmp/luci-modulecache +exit 0 diff --git a/package/lean/luci-app-xlnetacc/files/root/usr/bin/xlnetacc.sh b/package/lean/luci-app-xlnetacc/files/root/usr/bin/xlnetacc.sh new file mode 100644 index 0000000000..61e938e9fd --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/root/usr/bin/xlnetacc.sh @@ -0,0 +1,512 @@ +#!/bin/sh + +# 声明常量 +readonly appName='com.xunlei.vip.swjsq' +readonly protocolVersion=108 +readonly sdkVersion=17550 +readonly agentVersion='1.6.1.177600' +readonly client_type_down='android-swjsq' +readonly client_version_down='2.0.3.4' +readonly client_type_up='android-uplink' +readonly client_version_up='2.3.3.9' +readonly client_os='android-7.0.24DUK-AL20' + +# 声明全局变量 +_http_cmd= +_http_args= +_devicesign= +_peerid= +_userid= +_sessionid= +_api_url_down= +_api_url_up= +_dial_account_down= +_dial_account_up= +_cur_down= +_max_down= +_cur_up= +_max_up= +access_url= +msg_to_en= +msg_to_cn= + +# 包含用于解析 JSON 格式返回值的函数 +. /usr/share/libubox/jshn.sh + +# 读取 UCI 设置相关函数 +uci_get_by_name() { + local ret=$(uci get $NAME.$1.$2 2> /dev/null) + echo -n ${ret:=$3} +} +uci_get_by_type() { + local ret=$(uci get $NAME.@$1[-1].$2 2> /dev/null) + echo -n ${ret:=$3} +} +uci_get_by_bool() { + case $(uci_get_by_name "$1" "$2" "$3") in + 1|on|true|yes|enabled) echo -n 1;; + *) echo -n 0;; + esac +} + +# 日志和状态栏输出。1 日志文件, 2 系统日志, 4 详细模式, 8 下行状态栏, 16 上行状态栏, 32 失败状态 +_log() { + local msg=$1 + local flag=$2 + [ -z "$msg" ] && return + [ -z "$flag" ] && flag=1 + local timestamp=$(date +'%Y/%m/%d %H:%M:%S') + + [ $logging -eq 0 -a $(( $flag & 1 )) -ne 0 ] && flag=$(( $flag ^ 1 )) + if [ $verbose -eq 0 -a $(( $flag & 4 )) -ne 0 ]; then + [ $(( $flag & 1 )) -ne 0 ] && flag=$(( $flag ^ 1 )) + [ $(( $flag & 2 )) -ne 0 ] && flag=$(( $flag ^ 2 )) + fi + if [ $down_acc -eq 0 -a $(( $flag & 8 )) -ne 0 ]; then + flag=$(( $flag ^ 8 )) + [ $up_acc -ne 0 ] && flag=$(( $flag | 16 )) + fi + if [ $up_acc -eq 0 -a $(( $flag & 16 )) -ne 0 ]; then + flag=$(( $flag ^ 16 )) + [ $down_acc -ne 0 ] && flag=$(( $flag | 8 )) + fi + + [ $(( $flag & 1 )) -ne 0 ] && echo "$timestamp $msg" >> $LOGFILE 2> /dev/null + [ $(( $flag & 2 )) -ne 0 ] && logger -p "daemon.info" -t "$NAME" "$msg" + + [ $(( $flag & 32 )) -eq 0 ] && local color="green" || local color="red" + [ $(( $flag & 8 )) -ne 0 ] && echo -n "$timestamp $msg" > $down_state_file 2> /dev/null + [ $(( $flag & 16 )) -ne 0 ] && echo -n "$timestamp $msg" > $up_state_file 2> /dev/null +} + +# 清理日志 +clean_log() { + [ $logging -eq 1 -a -f "$LOGFILE" ] || return + if [ $(wc -l "$LOGFILE" | awk '{print $1}') -gt 500 ]; then + _log "清理日志文件" + local logdata=$(tail -n 300 "$LOGFILE") + echo "$logdata" > $LOGFILE 2> /dev/null + unset logdata + fi +} + +# 获取接口IP地址 +get_acc_ip() { + local acc_ipaddr + json_cleanup; json_load "$(ubus call network.interface.$network status 2> /dev/null)" >/dev/null 2>&1 + json_select "ipv4-address" >/dev/null 2>&1; json_select 1 >/dev/null 2>&1 + json_get_var acc_ipaddr "address" + [ -z "$acc_ipaddr" ] && { _log "获取网络 $network IP地址出错"; return; } + _log "acc_ipaddr is $acc_ipaddr" $(( 1 | 4 )) + + if [ "$acc_ipaddr" != "0.0.0.0" ]; then + _log "绑定IP地址: $acc_ipaddr" + echo -n "$acc_ipaddr" + fi +} + +# 定义基本 HTTP 命令和参数 +gen_http_cmd() { + _http_cmd="wget-ssl -nv -t 1 -O - --no-check-certificate" + _http_cmd="$_http_cmd --bind-address=$1" + _http_cmd="$_http_cmd --user-agent=android-async-http/xl-acc-sdk/version-$agentVersion" + _log "_http_cmd is $_http_cmd" $(( 1 | 4 )) +} + +# 生成设备签名 +gen_device_sign() { + local ifname macaddr + while : ; do + ifname=$(uci get "network.$network.ifname" 2> /dev/null) + [ "${ifname:0:1}" == "@" ] && network="${ifname:1}" || break + done + [ -z "$ifname" ] && { _log "获取网络 $network 信息出错"; return; } + json_cleanup; json_load "$(ubus call network.device status {\"name\":\"$ifname\"} 2> /dev/null)" >/dev/null 2>&1 + json_get_var macaddr "macaddr" + [ -z "$macaddr" ] && { _log "获取网络 $network MAC地址出错"; return; } + macaddr=$(echo -n "$macaddr" | awk '{print toupper($0)}') + + # 根据MAC地址生成peerid + readonly _peerid="${macaddr//:/}004V" + _log "_peerid is $_peerid" $(( 1 | 4 )) + + # 根据MAC地址生成devicesign + local xlnetacc_vip="${appName}68700d1872b772946a6940e4b51827e8af" + local fake_device_id_md5=$(echo -n "$macaddr" | md5sum | awk '{print $1}') + local fake_device_id_sha1=$(echo -n "$fake_device_id_md5$xlnetacc_vip" | openssl sha1 -hmac | awk '{print $2}') + readonly _devicesign="div100.$fake_device_id_md5"$(echo -n "$fake_device_id_sha1" | md5sum | awk '{print $1}') + _log "_devicesign is $_devicesign" $(( 1 | 4 )) +} + +# 帐号登录 +xlnetacc_login() { + # 生成POST数据 + json_init + json_add_string userName "$account" + json_add_int businessType 68 + json_add_string clientVersion "$client_version_down" + json_add_string appName "ANDROID-$appName" + json_add_int isCompressed 0 + json_add_int sequenceNo 1000001 + json_add_string sessionID + json_add_int loginType 0 + json_add_object rsaKey + json_add_string e '010001' + json_add_string n 'AC69F5CCC8BDE47CD3D371603748378C9CFAD2938A6B021E0E191013975AD683F5CBF9ADE8BD7D46B4D2EC2D78AF146F1DD2D50DC51446BB8880B8CE88D476694DFC60594393BEEFAA16F5DBCEBE22F89D640F5336E42F587DC4AFEDEFEAC36CF007009CCCE5C1ACB4FF06FBA69802A8085C2C54BADD0597FC83E6870F1E36FD' + json_close_object + json_add_int cmdID 1 + json_add_string verifyCode + json_add_string peerID "$_peerid" + json_add_int protocolVersion $protocolVersion + json_add_int platformVersion 1 + json_add_string passWord "$encrypt" + json_add_string extensionList + json_add_string verifyKey + json_add_int sdkVersion $sdkVersion + json_add_string devicesign "$_devicesign" + json_close_object + + local ret=$($_http_cmd 'https://login.mobile.reg2t.sandai.net:443/' --post-data="$(json_dump)") + _log "ret is $ret" $(( 1 | 4 )) + json_cleanup; json_load "$ret" >/dev/null 2>&1 + local errno + json_get_var errno "errorCode" + json_get_var _userid "userID" + _log "_userid is $_userid" $(( 1 | 4 )) + json_get_var _sessionid "sessionID" + _log "_sessionid is $_sessionid" $(( 1 | 4 )) + + if [ ${errno:=-1} -ne 0 ] || [ -z "$_userid" -o -z "$_sessionid" ]; then + local errorDesc + json_get_var errorDesc "errorDesc" + local outmsg="帐号登录失败。错误代码: ${errno}"; \ + [ -n "$errorDesc" ] && outmsg="${outmsg},原因: $errorDesc"; _log "$outmsg" $(( 1 | 8 | 16 | 32 )) + else + local outmsg="帐号登录成功"; _log "$outmsg" $(( 1 | 8 | 16 )) + fi + + return $errno +} + +# 获取提速API +xlnetacc_portal() { + xlnetacc_var $1 + + [ $1 -eq 1 ] && access_url='http://api.portal.swjsq.vip.xunlei.com:81/v2/queryportal' || \ + access_url='http://api.upportal.swjsq.vip.xunlei.com/v2/queryportal' + local ret=$($_http_cmd "$access_url") + _log "$msg_to_en portal is $ret" $(( 1 | 4 )) + json_cleanup; json_load "$ret" >/dev/null 2>&1 + local errno portal_ip portal_port + json_get_var errno "errno" + json_get_var portal_ip "interface_ip" + json_get_var portal_port "interface_port" + + if [ ${errno:=-1} -ne 0 ] || [ -z "$portal_ip" -o -z "$portal_port" ]; then + local message + json_get_var message "message" + local outmsg="获取${msg_to_cn}API失败。错误代码: ${errno}"; \ + [ -n "$message" ] && outmsg="${outmsg},原因: $message"; _log "$outmsg" $(( 1 | $1 * 8 | 32 )) + else + local outmsg="获取${msg_to_cn}API成功"; _log "$outmsg" $(( 1 | $1 * 8 )) + if [ $1 -eq 1 ]; then + _api_url_down="http://$portal_ip:$portal_port/v2" + _log "_api_url_down is $_api_url_down" $(( 1 | 4 )) + else + _api_url_up="http://$portal_ip:$portal_port/v2" + _log "_api_url_up is $_api_url_up" $(( 1 | 4 )) + fi + fi + + return $errno +} + +# 获取网络带宽信息 +xlnetacc_bandwidth() { + xlnetacc_var $1 + + local ret=$($_http_cmd "$access_url/bandwidth?${_http_args}&time_and=$(date +%s)000") + _log "$msg_to_en bandwidth is $ret" $(( 1 | 4 )) + json_cleanup; json_load "$ret" >/dev/null 2>&1 + local errno can_upgrade dial_account richmessage + json_get_var errno "errno" + json_get_var can_upgrade "can_upgrade" + json_get_var dial_account "dial_account" + json_get_var richmessage "richmessage" + + # 获取带宽数据 + local cur_bandwidth max_bandwidth flag + [ $1 -eq 1 ] && flag="downstream" || flag="upstream" + json_select "bandwidth" >/dev/null 2>&1 + json_get_var cur_bandwidth "$flag" + json_select; json_select "max_bandwidth" >/dev/null 2>&1 + json_get_var max_bandwidth "$flag" + cur_bandwidth=$(expr $cur_bandwidth / 1024 2> /dev/null) + max_bandwidth=$(expr $max_bandwidth / 1024 2> /dev/null) + + if [ ${errno:=-1} -ne 0 ]; then + local outmsg="获取${msg_to_cn}带宽信息失败。错误代码: ${errno}"; \ + [ -n "$richmessage" ] && outmsg="${outmsg},原因: $richmessage"; _log "$outmsg" $(( 1 | $1 * 8 | 32 )) + elif [ "$can_upgrade" -eq 0 ]; then + local outmsg="${msg_to_cn}无法提速"; \ + [ -n "$richmessage" ] && outmsg="${outmsg},原因: $richmessage"; _log "$outmsg" $(( 1 | $1 * 8 | 32 )) + [ $1 -eq 1 ] && down_acc=0 || up_acc=0 + errno=-2 + elif [ "$cur_bandwidth" -ge "$max_bandwidth" ]; then + local outmsg="${msg_to_cn}无需提速。当前带宽 ${cur_bandwidth}M,超过最大可提升带宽 ${max_bandwidth}M"; \ + _log "$outmsg" $(( 1 | $1 * 8 )) + [ $1 -eq 1 ] && down_acc=0 || up_acc=0 + errno=-3 + else + local outmsg="${msg_to_cn}可以提速。当前带宽 ${cur_bandwidth}M,可提升至 ${max_bandwidth}M"; _log "$outmsg" $(( 1 | $1 * 8 )) + if [ $1 -eq 1 ]; then + _dial_account_down=$dial_account + _log "_dial_account_down is $_dial_account_down" $(( 1 | 4 )) + _cur_down=$cur_bandwidth + _log "_cur_down is $_cur_down" $(( 1 | 4 )) + _max_down=$max_bandwidth + _log "_max_down is $_max_down" $(( 1 | 4 )) + else + _dial_account_up=$dial_account + _log "_dial_account_up is $_dial_account_up" $(( 1 | 4 )) + _cur_up=$cur_bandwidth + _log "_cur_up is $_cur_up" $(( 1 | 4 )) + _max_up=$max_bandwidth + _log "_max_up is $_max_up" $(( 1 | 4 )) + fi + fi + + return $errno +} + +# 发送带宽提速信号 +xlnetacc_upgrade() { + xlnetacc_var $1 + + local ret=$($_http_cmd "$access_url/upgrade?${_http_args}&time_and=$(date +%s)000") + _log "$msg_to_en upgrade is $ret" $(( 1 | 4 )) + json_cleanup; json_load "$ret" >/dev/null 2>&1 + local errno + json_get_var errno "errno" + + if [ ${errno:=-1} -ne 0 ]; then + local richmessage + json_get_var richmessage "richmessage" + local outmsg="${msg_to_cn}提速失败。错误代码: ${errno}"; \ + [ -n "$richmessage" ] && outmsg="${outmsg},原因: $richmessage"; _log "$outmsg" $(( 1 | $1 * 8 | 32 )) + [ $errno -ne -1 ] && { [ $1 -eq 1 ] && down_acc=0 || up_acc=0; } + else + [ $1 -eq 1 ] && local cur_bandwidth=$_cur_down || local cur_bandwidth=$_cur_up + [ $1 -eq 1 ] && local max_bandwidth=$_max_down || local max_bandwidth=$_max_up + local outmsg="${msg_to_cn}提速成功,带宽已从 ${cur_bandwidth}M 提升到 ${max_bandwidth}M"; _log "$outmsg" $(( 1 | $1 * 8 )) + [ $1 -eq 1 ] && down_acc=2 || up_acc=2 + fi + + return $errno +} + +# 发送提速心跳信号 +xlnetacc_keepalive() { + xlnetacc_var $1 + + local ret=$($_http_cmd "$access_url/keepalive?${_http_args}&time_and=$(date +%s)000") + _log "$msg_to_en keepalive is $ret" $(( 1 | 4 )) + json_cleanup; json_load "$ret" >/dev/null 2>&1 + local errno + json_get_var errno "errno" + + if [ ${errno:=-1} -ne 0 ]; then + local richmessage + json_get_var richmessage "richmessage" + local outmsg="${msg_to_cn}提速失效。错误代码: ${errno}"; \ + [ -n "$richmessage" ] && outmsg="${outmsg},原因: $richmessage"; _log "$outmsg" $(( 1 | $1 * 8 | 32 )) + [ $1 -eq 1 ] && down_acc=1 || up_acc=1 + else + _log "${msg_to_cn}心跳信号返回正常" + fi + + return $errno +} + +# 发送带宽恢复信号 +xlnetacc_recover() { + xlnetacc_var $1 + + local ret=$($_http_cmd "$access_url/recover?${_http_args}&time_and=$(date +%s)000") + _log "$msg_to_en recover is $ret" $(( 1 | 4 )) + json_cleanup; json_load "$ret" >/dev/null 2>&1 + local errno + json_get_var errno "errno" + + if [ ${errno:=-1} -ne 0 ]; then + local richmessage + json_get_var richmessage "richmessage" + local outmsg="${msg_to_cn}带宽恢复失败。错误代码: ${errno}"; \ + [ -n "$richmessage" ] && outmsg="${outmsg},原因: $richmessage"; _log "$outmsg" $(( 1 | $1 * 8 | 32 )) + else + _log "${msg_to_cn}带宽已恢复" + [ $1 -eq 1 ] && down_acc=1 || up_acc=1 + fi + + return $errno +} + +# 查询提速信息,未使用 +xlnetacc_query() { + xlnetacc_var $1 + + local ret=$($_http_cmd "$access_url/query_try_info?${_http_args}&time_and=$(date +%s)000") + _log "$msg_to_en query_try_info is $ret" $(( 1 | 4 )) + json_cleanup; json_load "$ret" >/dev/null 2>&1 + local errno + json_get_var errno "errno" + + return $errno +} + +# 带宽提速处理 +xlnetacc_acc() { + _api_url_down=; _api_url_up= + _dial_account_down=; _dial_account_up= + _cur_down=0; _max_down=0; _cur_up=0; _max_up=0 + + xlnetacc_portal $1 || return + xlnetacc_bandwidth $1 || return + xlnetacc_upgrade $1 +} + +# 设置参数变量 +xlnetacc_var() { + if [ $1 -eq 1 ]; then + access_url=$_api_url_down + _http_args="peerid=${_peerid}&userid=${_userid}&user_type=1&sessionid=${_sessionid}&dial_account=${_dial_account_down}&client_type=${client_type_down}-${client_version_down}&client_version=${client_type_down//-/}-${client_version_down}&os=${client_os}" + msg_to_en="DownLink" + msg_to_cn="下行" + else + access_url=$_api_url_up + _http_args="peerid=${_peerid}&userid=${_userid}&user_type=1&sessionid=${_sessionid}&dial_account=${_dial_account_up}&client_type=${client_type_up}-${client_version_up}&client_version=${client_type_up//-/}-${client_version_up}&os=${client_os}" + msg_to_en="UpLink" + msg_to_cn="上行" + fi +} + +# 中止信号处理 +sigterm() { + _log "trap sigterm, exit" $(( 1 | 4 )) + [ $down_acc -eq 2 ] && xlnetacc_recover 1 + [ $up_acc -eq 2 ] && xlnetacc_recover 2 + rm -f "$down_state_file" "$up_state_file" + exit 0 +} + +# 初始化 +xlnetacc_init() { + [ "$1" != "--start" ] && return 1 + + # 防止重复启动 + local pid + for pid in $(pidof "${0##*/}"); do + [ $pid -ne $$ ] && return 1 + done + + # 读取设置 + readonly NAME=xlnetacc + readonly LOGFILE=/var/log/${NAME}.log + readonly down_state_file=/var/state/${NAME}_down_state + readonly up_state_file=/var/state/${NAME}_up_state + down_acc=$(uci_get_by_bool "general" "down_acc" 0) + up_acc=$(uci_get_by_bool "general" "up_acc" 0) + readonly logging=$(uci_get_by_bool "general" "logging" 1) + readonly verbose=$(uci_get_by_bool "general" "verbose" 0) + readonly network=$(uci_get_by_name "general" "network" "wan") + readonly account=$(uci_get_by_name "general" "account") + readonly encrypt=$(uci_get_by_name "general" "encrypt") + local enabled=$(uci_get_by_bool "general" "enabled" 0) + local password=$(uci_get_by_name "general" "password") + ( [ $enabled -eq 0 ] || [ $down_acc -eq 0 -a $up_acc -eq 0 ] || [ -z "$account" -o -z "$encrypt" -o -z "$network" ] ) && return 2 + + [ $logging -eq 1 ] && [ ! -d /var/log ] && mkdir -p /var/log + _log "------------------------------" + _log "迅雷快鸟正在启动..." + _log "down_acc is $down_acc" $(( 1 | 4 )) + _log "up_acc is $up_acc" $(( 1 | 4 )) + _log "network is $network" $(( 1 | 4 )) + _log "account is $account" $(( 1 | 4 )) + _log "encrypt is $encrypt" $(( 1 | 4 )) + + # 检查外部调用工具 + command -v wget-ssl >/dev/null || { _log "GNU Wget 工具不存在"; return 3; } + command -v md5sum >/dev/null || { _log "md5sum 工具不存在"; return 3; } + command -v openssl >/dev/null || { _log "openssl 工具不存在"; return 3; } + + # 检查明文密码 + if [ -n "$password" ]; then + _log "移除已保存的明文密码" + uci delete "${NAME}.general.password" + uci commit "$NAME" + fi + + # 捕获中止信号 + trap "sigterm" INT + trap "sigterm" TERM + + # 生成设备签名 + gen_device_sign + [ -z "$_peerid" -o -z "$_devicesign" ] && return 4 + + clean_log + [ -d /var/state ] || mkdir -p /var/state + return 0 +} + +# 程序主体 +xlnetacc_main() { + while : ; do + # 获取外网IP地址 + while : ; do + local bind_ip=$(get_acc_ip) + if [ -z "$bind_ip" ]; then + sleep 5s # 获取失败 + else + gen_http_cmd "$bind_ip" + break + fi + done + + # 帐号登录 + while : ; do + xlnetacc_login + case $? in + 0) break;; # 登录成功 + 6) sleep 30m;; # 需要输入验证码,等待30分钟后重试 + -1) sleep 3m;; # 未返回有效数据,等待3分钟后重试 + *) return 5;; # 登录失败 + esac + done + + # 10秒检查提速状态,300秒发送心跳包 + local timer_begin=$(date +%s); local timer_count= + while : ; do + [ $down_acc -eq 0 -a $up_acc -eq 0 ] && break 2 + [ $down_acc -eq 1 ] && xlnetacc_acc 1 + [ $up_acc -eq 1 ] && xlnetacc_acc 2 + + sleep 10s + timer_count=$(( $(date +%s) - $timer_begin )) + [ $timer_count -lt 300 ] && continue + timer_begin=$(date +%s) + clean_log # 清理日志 + + [ $down_acc -eq 2 ] && { xlnetacc_keepalive 1; [ $? -eq -1 ] && break; } + [ $up_acc -eq 2 ] && { xlnetacc_keepalive 2; [ $? -eq -1 ] && break; } + done + [ $down_acc -eq 2 ] && { xlnetacc_recover 1; down_acc=1; } + [ $up_acc -eq 2 ] && { xlnetacc_recover 2; up_acc=1; } + done + _log "程序异常,迅雷快鸟已停止。" +} + +# 程序入口 +xlnetacc_init $* +[ $? -eq 0 ] && xlnetacc_main +exit $? diff --git a/package/lean/luci-app-xlnetacc/tools/po2lmo/Makefile b/package/lean/luci-app-xlnetacc/tools/po2lmo/Makefile new file mode 100644 index 0000000000..ad2c133207 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/tools/po2lmo/Makefile @@ -0,0 +1,12 @@ + +INSTALL = install +PREFIX = /usr/bin + +po2lmo: src/po2lmo.o src/template_lmo.o + $(CC) $(LDFLAGS) -o src/po2lmo src/po2lmo.o src/template_lmo.o + +install: + $(INSTALL) -m 755 src/po2lmo $(PREFIX) + +clean: + $(RM) src/po2lmo src/*.o diff --git a/package/lean/luci-app-xlnetacc/tools/po2lmo/src/po2lmo.c b/package/lean/luci-app-xlnetacc/tools/po2lmo/src/po2lmo.c new file mode 100644 index 0000000000..0da792b680 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/tools/po2lmo/src/po2lmo.c @@ -0,0 +1,247 @@ +/* + * lmo - Lua Machine Objects - PO to LMO conversion tool + * + * Copyright (C) 2009-2012 Jo-Philipp Wich + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "template_lmo.h" + +static void die(const char *msg) +{ + fprintf(stderr, "Error: %s\n", msg); + exit(1); +} + +static void usage(const char *name) +{ + fprintf(stderr, "Usage: %s input.po output.lmo\n", name); + exit(1); +} + +static void print(const void *ptr, size_t size, size_t nmemb, FILE *stream) +{ + if( fwrite(ptr, size, nmemb, stream) == 0 ) + die("Failed to write stdout"); +} + +static int extract_string(const char *src, char *dest, int len) +{ + int pos = 0; + int esc = 0; + int off = -1; + + for( pos = 0; (pos < strlen(src)) && (pos < len); pos++ ) + { + if( (off == -1) && (src[pos] == '"') ) + { + off = pos + 1; + } + else if( off >= 0 ) + { + if( esc == 1 ) + { + switch (src[pos]) + { + case '"': + case '\\': + off++; + break; + } + dest[pos-off] = src[pos]; + esc = 0; + } + else if( src[pos] == '\\' ) + { + dest[pos-off] = src[pos]; + esc = 1; + } + else if( src[pos] != '"' ) + { + dest[pos-off] = src[pos]; + } + else + { + dest[pos-off] = '\0'; + break; + } + } + } + + return (off > -1) ? strlen(dest) : -1; +} + +static int cmp_index(const void *a, const void *b) +{ + uint32_t x = ((const lmo_entry_t *)a)->key_id; + uint32_t y = ((const lmo_entry_t *)b)->key_id; + + if (x < y) + return -1; + else if (x > y) + return 1; + + return 0; +} + +static void print_uint32(uint32_t x, FILE *out) +{ + uint32_t y = htonl(x); + print(&y, sizeof(uint32_t), 1, out); +} + +static void print_index(void *array, int n, FILE *out) +{ + lmo_entry_t *e; + + qsort(array, n, sizeof(*e), cmp_index); + + for (e = array; n > 0; n--, e++) + { + print_uint32(e->key_id, out); + print_uint32(e->val_id, out); + print_uint32(e->offset, out); + print_uint32(e->length, out); + } +} + +int main(int argc, char *argv[]) +{ + char line[4096]; + char key[4096]; + char val[4096]; + char tmp[4096]; + int state = 0; + int offset = 0; + int length = 0; + int n_entries = 0; + void *array = NULL; + lmo_entry_t *entry = NULL; + uint32_t key_id, val_id; + + FILE *in; + FILE *out; + + if( (argc != 3) || ((in = fopen(argv[1], "r")) == NULL) || ((out = fopen(argv[2], "w")) == NULL) ) + usage(argv[0]); + + memset(line, 0, sizeof(key)); + memset(key, 0, sizeof(val)); + memset(val, 0, sizeof(val)); + + while( (NULL != fgets(line, sizeof(line), in)) || (state >= 2 && feof(in)) ) + { + if( state == 0 && strstr(line, "msgid \"") == line ) + { + switch(extract_string(line, key, sizeof(key))) + { + case -1: + die("Syntax error in msgid"); + case 0: + state = 1; + break; + default: + state = 2; + } + } + else if( state == 1 || state == 2 ) + { + if( strstr(line, "msgstr \"") == line || state == 2 ) + { + switch(extract_string(line, val, sizeof(val))) + { + case -1: + state = 4; + break; + default: + state = 3; + } + } + else + { + switch(extract_string(line, tmp, sizeof(tmp))) + { + case -1: + state = 2; + break; + default: + strcat(key, tmp); + } + } + } + else if( state == 3 ) + { + switch(extract_string(line, tmp, sizeof(tmp))) + { + case -1: + state = 4; + break; + default: + strcat(val, tmp); + } + } + + if( state == 4 ) + { + if( strlen(key) > 0 && strlen(val) > 0 ) + { + key_id = sfh_hash(key, strlen(key)); + val_id = sfh_hash(val, strlen(val)); + + if( key_id != val_id ) + { + n_entries++; + array = realloc(array, n_entries * sizeof(lmo_entry_t)); + entry = (lmo_entry_t *)array + n_entries - 1; + + if (!array) + die("Out of memory"); + + entry->key_id = key_id; + entry->val_id = val_id; + entry->offset = offset; + entry->length = strlen(val); + + length = strlen(val) + ((4 - (strlen(val) % 4)) % 4); + + print(val, length, 1, out); + offset += length; + } + } + + state = 0; + memset(key, 0, sizeof(key)); + memset(val, 0, sizeof(val)); + } + + memset(line, 0, sizeof(line)); + } + + print_index(array, n_entries, out); + + if( offset > 0 ) + { + print_uint32(offset, out); + fsync(fileno(out)); + fclose(out); + } + else + { + fclose(out); + unlink(argv[2]); + } + + fclose(in); + return(0); +} diff --git a/package/lean/luci-app-xlnetacc/tools/po2lmo/src/template_lmo.c b/package/lean/luci-app-xlnetacc/tools/po2lmo/src/template_lmo.c new file mode 100644 index 0000000000..27205a7228 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/tools/po2lmo/src/template_lmo.c @@ -0,0 +1,328 @@ +/* + * lmo - Lua Machine Objects - Base functions + * + * Copyright (C) 2009-2010 Jo-Philipp Wich + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "template_lmo.h" + +/* + * Hash function from http://www.azillionmonkeys.com/qed/hash.html + * Copyright (C) 2004-2008 by Paul Hsieh + */ + +uint32_t sfh_hash(const char *data, int len) +{ + uint32_t hash = len, tmp; + int rem; + + if (len <= 0 || data == NULL) return 0; + + rem = len & 3; + len >>= 2; + + /* Main loop */ + for (;len > 0; len--) { + hash += sfh_get16(data); + tmp = (sfh_get16(data+2) << 11) ^ hash; + hash = (hash << 16) ^ tmp; + data += 2*sizeof(uint16_t); + hash += hash >> 11; + } + + /* Handle end cases */ + switch (rem) { + case 3: hash += sfh_get16(data); + hash ^= hash << 16; + hash ^= data[sizeof(uint16_t)] << 18; + hash += hash >> 11; + break; + case 2: hash += sfh_get16(data); + hash ^= hash << 11; + hash += hash >> 17; + break; + case 1: hash += *data; + hash ^= hash << 10; + hash += hash >> 1; + } + + /* Force "avalanching" of final 127 bits */ + hash ^= hash << 3; + hash += hash >> 5; + hash ^= hash << 4; + hash += hash >> 17; + hash ^= hash << 25; + hash += hash >> 6; + + return hash; +} + +uint32_t lmo_canon_hash(const char *str, int len) +{ + char res[4096]; + char *ptr, prev; + int off; + + if (!str || len >= sizeof(res)) + return 0; + + for (prev = ' ', ptr = res, off = 0; off < len; prev = *str, off++, str++) + { + if (isspace(*str)) + { + if (!isspace(prev)) + *ptr++ = ' '; + } + else + { + *ptr++ = *str; + } + } + + if ((ptr > res) && isspace(*(ptr-1))) + ptr--; + + return sfh_hash(res, ptr - res); +} + +lmo_archive_t * lmo_open(const char *file) +{ + int in = -1; + uint32_t idx_offset = 0; + struct stat s; + + lmo_archive_t *ar = NULL; + + if (stat(file, &s) == -1) + goto err; + + if ((in = open(file, O_RDONLY)) == -1) + goto err; + + if ((ar = (lmo_archive_t *)malloc(sizeof(*ar))) != NULL) + { + memset(ar, 0, sizeof(*ar)); + + ar->fd = in; + ar->size = s.st_size; + + fcntl(ar->fd, F_SETFD, fcntl(ar->fd, F_GETFD) | FD_CLOEXEC); + + if ((ar->mmap = mmap(NULL, ar->size, PROT_READ, MAP_SHARED, ar->fd, 0)) == MAP_FAILED) + goto err; + + idx_offset = ntohl(*((const uint32_t *) + (ar->mmap + ar->size - sizeof(uint32_t)))); + + if (idx_offset >= ar->size) + goto err; + + ar->index = (lmo_entry_t *)(ar->mmap + idx_offset); + ar->length = (ar->size - idx_offset - sizeof(uint32_t)) / sizeof(lmo_entry_t); + ar->end = ar->mmap + ar->size; + + return ar; + } + +err: + if (in > -1) + close(in); + + if (ar != NULL) + { + if ((ar->mmap != NULL) && (ar->mmap != MAP_FAILED)) + munmap(ar->mmap, ar->size); + + free(ar); + } + + return NULL; +} + +void lmo_close(lmo_archive_t *ar) +{ + if (ar != NULL) + { + if ((ar->mmap != NULL) && (ar->mmap != MAP_FAILED)) + munmap(ar->mmap, ar->size); + + close(ar->fd); + free(ar); + + ar = NULL; + } +} + + +lmo_catalog_t *_lmo_catalogs = NULL; +lmo_catalog_t *_lmo_active_catalog = NULL; + +int lmo_load_catalog(const char *lang, const char *dir) +{ + DIR *dh = NULL; + char pattern[16]; + char path[PATH_MAX]; + struct dirent *de = NULL; + + lmo_archive_t *ar = NULL; + lmo_catalog_t *cat = NULL; + + if (!lmo_change_catalog(lang)) + return 0; + + if (!dir || !(dh = opendir(dir))) + goto err; + + if (!(cat = malloc(sizeof(*cat)))) + goto err; + + memset(cat, 0, sizeof(*cat)); + + snprintf(cat->lang, sizeof(cat->lang), "%s", lang); + snprintf(pattern, sizeof(pattern), "*.%s.lmo", lang); + + while ((de = readdir(dh)) != NULL) + { + if (!fnmatch(pattern, de->d_name, 0)) + { + snprintf(path, sizeof(path), "%s/%s", dir, de->d_name); + ar = lmo_open(path); + + if (ar) + { + ar->next = cat->archives; + cat->archives = ar; + } + } + } + + closedir(dh); + + cat->next = _lmo_catalogs; + _lmo_catalogs = cat; + + if (!_lmo_active_catalog) + _lmo_active_catalog = cat; + + return 0; + +err: + if (dh) closedir(dh); + if (cat) free(cat); + + return -1; +} + +int lmo_change_catalog(const char *lang) +{ + lmo_catalog_t *cat; + + for (cat = _lmo_catalogs; cat; cat = cat->next) + { + if (!strncmp(cat->lang, lang, sizeof(cat->lang))) + { + _lmo_active_catalog = cat; + return 0; + } + } + + return -1; +} + +static lmo_entry_t * lmo_find_entry(lmo_archive_t *ar, uint32_t hash) +{ + unsigned int m, l, r; + uint32_t k; + + l = 0; + r = ar->length - 1; + + while (1) + { + m = l + ((r - l) / 2); + + if (r < l) + break; + + k = ntohl(ar->index[m].key_id); + + if (k == hash) + return &ar->index[m]; + + if (k > hash) + { + if (!m) + break; + + r = m - 1; + } + else + { + l = m + 1; + } + } + + return NULL; +} + +int lmo_translate(const char *key, int keylen, char **out, int *outlen) +{ + uint32_t hash; + lmo_entry_t *e; + lmo_archive_t *ar; + + if (!key || !_lmo_active_catalog) + return -2; + + hash = lmo_canon_hash(key, keylen); + + for (ar = _lmo_active_catalog->archives; ar; ar = ar->next) + { + if ((e = lmo_find_entry(ar, hash)) != NULL) + { + *out = ar->mmap + ntohl(e->offset); + *outlen = ntohl(e->length); + return 0; + } + } + + return -1; +} + +void lmo_close_catalog(const char *lang) +{ + lmo_archive_t *ar, *next; + lmo_catalog_t *cat, *prev; + + for (prev = NULL, cat = _lmo_catalogs; cat; prev = cat, cat = cat->next) + { + if (!strncmp(cat->lang, lang, sizeof(cat->lang))) + { + if (prev) + prev->next = cat->next; + else + _lmo_catalogs = cat->next; + + for (ar = cat->archives; ar; ar = next) + { + next = ar->next; + lmo_close(ar); + } + + free(cat); + break; + } + } +} diff --git a/package/lean/luci-app-xlnetacc/tools/po2lmo/src/template_lmo.h b/package/lean/luci-app-xlnetacc/tools/po2lmo/src/template_lmo.h new file mode 100644 index 0000000000..57f59aa56b --- /dev/null +++ b/package/lean/luci-app-xlnetacc/tools/po2lmo/src/template_lmo.h @@ -0,0 +1,92 @@ +/* + * lmo - Lua Machine Objects - General header + * + * Copyright (C) 2009-2012 Jo-Philipp Wich + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _TEMPLATE_LMO_H_ +#define _TEMPLATE_LMO_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if (defined(__GNUC__) && defined(__i386__)) +#define sfh_get16(d) (*((const uint16_t *) (d))) +#else +#define sfh_get16(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\ + +(uint32_t)(((const uint8_t *)(d))[0]) ) +#endif + + +struct lmo_entry { + uint32_t key_id; + uint32_t val_id; + uint32_t offset; + uint32_t length; +} __attribute__((packed)); + +typedef struct lmo_entry lmo_entry_t; + + +struct lmo_archive { + int fd; + int length; + uint32_t size; + lmo_entry_t *index; + char *mmap; + char *end; + struct lmo_archive *next; +}; + +typedef struct lmo_archive lmo_archive_t; + + +struct lmo_catalog { + char lang[6]; + struct lmo_archive *archives; + struct lmo_catalog *next; +}; + +typedef struct lmo_catalog lmo_catalog_t; + + +uint32_t sfh_hash(const char *data, int len); +uint32_t lmo_canon_hash(const char *data, int len); + +lmo_archive_t * lmo_open(const char *file); +void lmo_close(lmo_archive_t *ar); + + +extern lmo_catalog_t *_lmo_catalogs; +extern lmo_catalog_t *_lmo_active_catalog; + +int lmo_load_catalog(const char *lang, const char *dir); +int lmo_change_catalog(const char *lang); +int lmo_translate(const char *key, int keylen, char **out, int *outlen); +void lmo_close_catalog(const char *lang); + +#endif diff --git a/package/lean/polarssl/Makefile b/package/lean/polarssl/Makefile new file mode 100644 index 0000000000..57fa81e91c --- /dev/null +++ b/package/lean/polarssl/Makefile @@ -0,0 +1,74 @@ +# +# Copyright (C) 2011-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=polarssl +SRC_PKG_NAME:=mbedtls +PKG_VERSION:=1.3.16 +PKG_RELEASE:=1 +PKG_USE_MIPS16:=0 + +PKG_SOURCE:=$(SRC_PKG_NAME)-$(PKG_VERSION)-gpl.tgz +PKG_SOURCE_URL:=https://polarssl.org/download/ +PKG_MD5SUM:=66ebbbf67e8a9463041846822b0a1692 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(SRC_PKG_NAME)-$(PKG_VERSION) + +PKG_BUILD_PARALLEL:=1 +PKG_LICENSE:=GPL-2.0+ + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/polarssl/Default + SUBMENU:=SSL + TITLE:=Embedded SSL + URL:=http://polarssl.org/ +endef + +define Package/polarssl/Default/description +The aim of the PolarSSL project is to provide a quality, open-source +cryptographic library written in C and targeted at embedded systems. +endef + +define Package/libpolarssl +$(call Package/polarssl/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= (library) + ABI_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE) +endef + +define Package/libpolarssl/description +$(call Package/polarssl/Default/description) +This package contains the PolarSSL library. +endef + +PKG_INSTALL:=1 + +CMAKE_OPTIONS += \ + -DCMAKE_BUILD_TYPE:String="Release" \ + -DUSE_SHARED_MBEDTLS_LIBRARY:Bool=ON \ + -DENABLE_TESTING:Bool=OFF \ + -DENABLE_PROGRAMS:Bool=OFF \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/polarssl $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmbedtls.so.* $(1)/usr/lib/ + $(LN) libmbedtls.so.$(PKG_VERSION) $(1)/usr/lib/libpolarssl.so +endef + +define Package/libpolarssl/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmbedtls.so.* $(1)/usr/lib/ + $(LN) libmbedtls.so.$(PKG_VERSION) $(1)/usr/lib/libpolarssl.so +endef + +$(eval $(call BuildPackage,libpolarssl)) diff --git a/package/lean/polarssl/patches/100-disable_sslv3.patch b/package/lean/polarssl/patches/100-disable_sslv3.patch new file mode 100644 index 0000000000..56c6c4d235 --- /dev/null +++ b/package/lean/polarssl/patches/100-disable_sslv3.patch @@ -0,0 +1,12 @@ +--- a/include/polarssl/config.h ++++ b/include/polarssl/config.h +@@ -1011,8 +1011,8 @@ + * POLARSSL_SHA1_C + * + * Comment this macro to disable support for SSL 3.0 +- */ + #define POLARSSL_SSL_PROTO_SSL3 ++ */ + + /** + * \def POLARSSL_SSL_PROTO_TLS1 diff --git a/package/lean/polarssl/patches/200-reduce_config.patch b/package/lean/polarssl/patches/200-reduce_config.patch new file mode 100644 index 0000000000..6fef1a6f5c --- /dev/null +++ b/package/lean/polarssl/patches/200-reduce_config.patch @@ -0,0 +1,252 @@ +--- a/include/polarssl/config.h ++++ b/include/polarssl/config.h +@@ -432,8 +432,8 @@ + * Requires: POLARSSL_HMAC_DRBG_C + * + * Comment this macro to disable deterministic ECDSA. +- */ + #define POLARSSL_ECDSA_DETERMINISTIC ++ */ + + /** + * \def POLARSSL_KEY_EXCHANGE_PSK_ENABLED +@@ -454,8 +454,8 @@ + * TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 + * TLS_PSK_WITH_3DES_EDE_CBC_SHA + * TLS_PSK_WITH_RC4_128_SHA +- */ + #define POLARSSL_KEY_EXCHANGE_PSK_ENABLED ++ */ + + /** + * \def POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED +@@ -478,8 +478,8 @@ + * TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 + * TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA + * TLS_DHE_PSK_WITH_RC4_128_SHA +- */ + #define POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED ++ */ + + /** + * \def POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED +@@ -498,8 +498,8 @@ + * TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 + * TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA + * TLS_ECDHE_PSK_WITH_RC4_128_SHA +- */ + #define POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED ++ */ + + /** + * \def POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED +@@ -523,8 +523,8 @@ + * TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 + * TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA + * TLS_RSA_PSK_WITH_RC4_128_SHA +- */ + #define POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED ++ */ + + /** + * \def POLARSSL_KEY_EXCHANGE_RSA_ENABLED +@@ -602,8 +602,8 @@ + * TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 + * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA + * TLS_ECDHE_RSA_WITH_RC4_128_SHA +- */ + #define POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED ++ */ + + /** + * \def POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED +@@ -626,8 +626,8 @@ + * TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 + * TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA + * TLS_ECDHE_ECDSA_WITH_RC4_128_SHA +- */ + #define POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED ++ */ + + /** + * \def POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED +@@ -650,8 +650,8 @@ + * TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 + * TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 + * TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 +- */ + #define POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED ++ */ + + /** + * \def POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED +@@ -674,8 +674,8 @@ + * TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 + * TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 + * TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 +- */ + #define POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED ++ */ + + /** + * \def POLARSSL_PK_PARSE_EC_EXTENDED +@@ -835,8 +835,8 @@ + * \def POLARSSL_SELF_TEST + * + * Enable the checkup functions (*_self_test). +- */ + #define POLARSSL_SELF_TEST ++ */ + + /** + * \def POLARSSL_SSL_AEAD_RANDOM_IV +@@ -1151,8 +1151,8 @@ + * Requires: POLARSSL_VERSION_C + * + * Comment this to disable run-time checking and save ROM space +- */ + #define POLARSSL_VERSION_FEATURES ++ */ + + /** + * \def POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3 +@@ -1470,8 +1470,8 @@ + * TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 + * TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 + * TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 +- */ + #define POLARSSL_CAMELLIA_C ++ */ + + /** + * \def POLARSSL_CCM_C +@@ -1498,8 +1498,8 @@ + * Requires: POLARSSL_PEM_PARSE_C + * + * This module is used for testing (ssl_client/server). +- */ + #define POLARSSL_CERTS_C ++ */ + + /** + * \def POLARSSL_CIPHER_C +@@ -1538,8 +1538,8 @@ + * library/ssl_tls.c + * + * This module provides debugging functions. +- */ + #define POLARSSL_DEBUG_C ++ */ + + /** + * \def POLARSSL_DES_C +@@ -1594,8 +1594,8 @@ + * ECDHE-ECDSA, ECDHE-RSA, DHE-PSK + * + * Requires: POLARSSL_ECP_C +- */ + #define POLARSSL_ECDH_C ++ */ + + /** + * \def POLARSSL_ECDSA_C +@@ -1609,8 +1609,8 @@ + * ECDHE-ECDSA + * + * Requires: POLARSSL_ECP_C, POLARSSL_ASN1_WRITE_C, POLARSSL_ASN1_PARSE_C +- */ + #define POLARSSL_ECDSA_C ++ */ + + /** + * \def POLARSSL_ECP_C +@@ -1622,8 +1622,8 @@ + * library/ecdsa.c + * + * Requires: POLARSSL_BIGNUM_C and at least one POLARSSL_ECP_DP_XXX_ENABLED +- */ + #define POLARSSL_ECP_C ++ */ + + /** + * \def POLARSSL_ENTROPY_C +@@ -1662,8 +1662,8 @@ + * + * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other + * requisites are enabled as well. +- */ + #define POLARSSL_GCM_C ++ */ + + /** + * \def POLARSSL_HAVEGE_C +@@ -1699,8 +1699,8 @@ + * Requires: POLARSSL_MD_C + * + * Uncomment to enable the HMAC_DRBG random number geerator. +- */ + #define POLARSSL_HMAC_DRBG_C ++ */ + + /** + * \def POLARSSL_MD_C +@@ -1826,8 +1826,8 @@ + * Requires: POLARSSL_HAVE_ASM + * + * This modules adds support for the VIA PadLock on x86. +- */ + #define POLARSSL_PADLOCK_C ++ */ + + /** + * \def POLARSSL_PBKDF2_C +@@ -1992,8 +1992,8 @@ + * Module: library/ripemd160.c + * Caller: library/md.c + * +- */ + #define POLARSSL_RIPEMD160_C ++ */ + + /** + * \def POLARSSL_RSA_C +@@ -2072,8 +2072,8 @@ + * Caller: + * + * Requires: POLARSSL_SSL_CACHE_C +- */ + #define POLARSSL_SSL_CACHE_C ++ */ + + /** + * \def POLARSSL_SSL_CLI_C +@@ -2149,8 +2149,8 @@ + * Caller: library/havege.c + * + * This module is used by the HAVEGE random number generator. +- */ + #define POLARSSL_TIMING_C ++ */ + + /** + * \def POLARSSL_VERSION_C +@@ -2160,8 +2160,8 @@ + * Module: library/version.c + * + * This module provides run-time version information. +- */ + #define POLARSSL_VERSION_C ++ */ + + /** + * \def POLARSSL_X509_USE_C +@@ -2270,8 +2270,8 @@ + * + * Module: library/xtea.c + * Caller: +- */ + #define POLARSSL_XTEA_C ++ */ + + /* \} name SECTION: mbed TLS modules */ + diff --git a/package/kernel/shortcut-fe/Makefile b/package/lean/shortcut-fe/Makefile similarity index 100% rename from package/kernel/shortcut-fe/Makefile rename to package/lean/shortcut-fe/Makefile diff --git a/package/kernel/shortcut-fe/src/Kconfig b/package/lean/shortcut-fe/src/Kconfig similarity index 100% rename from package/kernel/shortcut-fe/src/Kconfig rename to package/lean/shortcut-fe/src/Kconfig diff --git a/package/kernel/shortcut-fe/src/Makefile b/package/lean/shortcut-fe/src/Makefile similarity index 100% rename from package/kernel/shortcut-fe/src/Makefile rename to package/lean/shortcut-fe/src/Makefile diff --git a/package/kernel/shortcut-fe/src/README b/package/lean/shortcut-fe/src/README similarity index 100% rename from package/kernel/shortcut-fe/src/README rename to package/lean/shortcut-fe/src/README diff --git a/package/kernel/shortcut-fe/src/fast-classifier.c b/package/lean/shortcut-fe/src/fast-classifier.c similarity index 100% rename from package/kernel/shortcut-fe/src/fast-classifier.c rename to package/lean/shortcut-fe/src/fast-classifier.c diff --git a/package/kernel/shortcut-fe/src/fast-classifier.h b/package/lean/shortcut-fe/src/fast-classifier.h similarity index 100% rename from package/kernel/shortcut-fe/src/fast-classifier.h rename to package/lean/shortcut-fe/src/fast-classifier.h diff --git a/package/kernel/shortcut-fe/src/nl_classifier_test.c b/package/lean/shortcut-fe/src/nl_classifier_test.c similarity index 100% rename from package/kernel/shortcut-fe/src/nl_classifier_test.c rename to package/lean/shortcut-fe/src/nl_classifier_test.c diff --git a/package/kernel/shortcut-fe/src/sfe.h b/package/lean/shortcut-fe/src/sfe.h similarity index 100% rename from package/kernel/shortcut-fe/src/sfe.h rename to package/lean/shortcut-fe/src/sfe.h diff --git a/package/kernel/shortcut-fe/src/sfe_backport.h b/package/lean/shortcut-fe/src/sfe_backport.h similarity index 100% rename from package/kernel/shortcut-fe/src/sfe_backport.h rename to package/lean/shortcut-fe/src/sfe_backport.h diff --git a/package/kernel/shortcut-fe/src/sfe_cm.c b/package/lean/shortcut-fe/src/sfe_cm.c similarity index 100% rename from package/kernel/shortcut-fe/src/sfe_cm.c rename to package/lean/shortcut-fe/src/sfe_cm.c diff --git a/package/kernel/shortcut-fe/src/sfe_cm.h b/package/lean/shortcut-fe/src/sfe_cm.h similarity index 100% rename from package/kernel/shortcut-fe/src/sfe_cm.h rename to package/lean/shortcut-fe/src/sfe_cm.h diff --git a/package/kernel/shortcut-fe/src/sfe_ipv4.c b/package/lean/shortcut-fe/src/sfe_ipv4.c similarity index 100% rename from package/kernel/shortcut-fe/src/sfe_ipv4.c rename to package/lean/shortcut-fe/src/sfe_ipv4.c diff --git a/package/kernel/shortcut-fe/src/sfe_ipv6.c b/package/lean/shortcut-fe/src/sfe_ipv6.c similarity index 100% rename from package/kernel/shortcut-fe/src/sfe_ipv6.c rename to package/lean/shortcut-fe/src/sfe_ipv6.c diff --git a/package/kernel/shortcut-fe/src/userspace_example.c b/package/lean/shortcut-fe/src/userspace_example.c similarity index 100% rename from package/kernel/shortcut-fe/src/userspace_example.c rename to package/lean/shortcut-fe/src/userspace_example.c diff --git a/package/lean/udp2raw/LICENSE b/package/lean/udp2raw/LICENSE new file mode 100644 index 0000000000..6e53158db1 --- /dev/null +++ b/package/lean/udp2raw/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Yu Wang (wangyucn at gmail.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/package/lean/udp2raw/Makefile b/package/lean/udp2raw/Makefile new file mode 100644 index 0000000000..22f7673781 --- /dev/null +++ b/package/lean/udp2raw/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (c) 2017 Yu Wang +# +# This is free software, licensed under the MIT. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=udp2raw-tunnel +PKG_VERSION:=20171125.0 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/wangyu-/udp2raw-tunnel.git +PKG_SOURCE_VERSION:=b35edf74865275cdc970384681a1a076d3a8d0e1 +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Yu Wang + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/udp2raw-tunnel + SECTION:=net + CATEGORY:=Network + TITLE:=Tunnel which turns UDP Traffic into Encrypted FakeTCP/UDP/ICMP Traffic + URL:=https://github.com/wangyu-/udp2raw-tunnel +endef + +define Package/udp2raw-tunnel/description + udp2raw-tunnel is a tunnel which turns UDP Traffic into Encrypted FakeTCP/UDP/ICMP Traffic by using Raw Socket. +endef + +MAKE_FLAGS += cross2 + +define Build/Prepare + $(PKG_UNPACK) + sed -i 's/cc_cross=.*/cc_cross=$(TARGET_CXX)/g' $(PKG_BUILD_DIR)/makefile + sed -i '/\*gitversion/d' $(PKG_BUILD_DIR)/makefile + echo 'const char *gitversion = "$(PKG_SOURCE_VERSION)";' > $(PKG_BUILD_DIR)/git_version.h + $(Build/Patch) +endef + +define Package/udp2raw-tunnel/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/udp2raw_cross $(1)/usr/bin/udp2raw +endef + +$(eval $(call BuildPackage,udp2raw-tunnel)) diff --git a/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch b/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch index 4a90751e1e..2dcfe9c212 100644 --- a/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch +++ b/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch @@ -18,9 +18,9 @@ No __THROW in function implementation. --jsaw ---- argp-standalone-1.4-test2/argp.h.orig 2006-01-06 02:29:59.000000000 +0100 -+++ argp-standalone-1.4-test2/argp.h 2006-01-06 02:41:10.000000000 +0100 -@@ -560,17 +560,17 @@ +--- a/argp.h ++++ b/argp.h +@@ -560,17 +560,17 @@ __argp_short_program_name(const struct a # endif # ifndef ARGP_EI @@ -41,7 +41,7 @@ No __THROW in function implementation. { if (__opt->flags & OPTION_DOC) return 0; -@@ -582,7 +582,7 @@ +@@ -582,7 +582,7 @@ __option_is_short (__const struct argp_o } ARGP_EI int @@ -50,9 +50,9 @@ No __THROW in function implementation. { return !__opt->key && !__opt->name && !__opt->doc && !__opt->group; } ---- argp-standalone-1.4-test2/argp-parse.c.orig 2006-01-06 02:47:48.000000000 +0100 -+++ argp-standalone-1.4-test2/argp-parse.c 2006-01-06 02:48:16.000000000 +0100 -@@ -1290,13 +1290,13 @@ +--- a/argp-parse.c ++++ b/argp-parse.c +@@ -1277,13 +1277,13 @@ weak_alias (__argp_input, _argp_input) /* Defined here, in case a user is not inlining the definitions in * argp.h */ void @@ -68,7 +68,7 @@ No __THROW in function implementation. { if (__opt->flags & OPTION_DOC) return 0; -@@ -1310,7 +1310,7 @@ +@@ -1297,7 +1297,7 @@ __option_is_short (__const struct argp_o } int diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile index 869513f16f..07e1eb8157 100644 --- a/package/libs/elfutils/Makefile +++ b/package/libs/elfutils/Makefile @@ -17,6 +17,7 @@ PKG_HASH:=9412fac7b30872b738bc1ed1ebcaed54493c26ef9a67887913498c17b10f3bc2 PKG_MAINTAINER:=Luiz Angelo Daros de Luca PKG_LICENSE:=GPL-3.0+ PKG_LICENSE_FILES:=COPYING COPYING-GPLV2 COPYING-LGPLV3 +PKG_CPE_ID:=cpe:/a:elfutils_project:elfutils PKG_INSTALL:=1 PKG_USE_MIPS16:=0 @@ -68,7 +69,7 @@ endif CONFIGURE_ARGS += \ --without-lzma -TARGET_CFLAGS += -D_GNU_SOURCE -Wno-unused-result +TARGET_CFLAGS += -D_GNU_SOURCE -Wno-unused-result -Wno-format-nonliteral define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include diff --git a/package/libs/gettext-full/Makefile b/package/libs/gettext-full/Makefile index deb4840109..db6aee7508 100644 --- a/package/libs/gettext-full/Makefile +++ b/package/libs/gettext-full/Makefile @@ -19,6 +19,7 @@ HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/gettext-$(PKG_VERSION) PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-3.0+ +PKG_CPE_ID:=cpe:/a:gnu:gettext PKG_FIXUP:=autoreconf PKG_INSTALL:=1 diff --git a/package/libs/libevent2/Makefile b/package/libs/libevent2/Makefile index 2107870b98..ecab6fb9f1 100644 --- a/package/libs/libevent2/Makefile +++ b/package/libs/libevent2/Makefile @@ -18,6 +18,7 @@ PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE:=libevent-$(PKG_VERSION)-stable.tar.gz PKG_MAINTAINER:=Dengfeng Liu PKG_LICENSE:=BSD-3-Clause +PKG_CPE_ID:=cpe:/a:libevent_project:libevent PKG_FIXUP:=autoreconf PKG_INSTALL:=1 diff --git a/package/libs/libiconv-full/Makefile b/package/libs/libiconv-full/Makefile index 9776711a79..ac7bfddf56 100644 --- a/package/libs/libiconv-full/Makefile +++ b/package/libs/libiconv-full/Makefile @@ -51,7 +51,7 @@ define Package/iconv TITLE+= utility endef -TARGET_CFLAGS += $(FPIC) -DUSE_DOS +TARGET_CFLAGS += $(FPIC) -DUSE_DOS -std=gnu89 CONFIGURE_ARGS += \ --enable-shared \ diff --git a/package/libs/libjson-c/Makefile b/package/libs/libjson-c/Makefile index 359a688f11..eeb7870f07 100644 --- a/package/libs/libjson-c/Makefile +++ b/package/libs/libjson-c/Makefile @@ -19,6 +19,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:json-c_project:json-c PKG_FIXUP:=autoreconf PKG_INSTALL:=1 diff --git a/package/libs/libnetfilter-conntrack/Makefile b/package/libs/libnetfilter-conntrack/Makefile index 399aa6ce1d..be82285317 100644 --- a/package/libs/libnetfilter-conntrack/Makefile +++ b/package/libs/libnetfilter-conntrack/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnetfilter_conntrack -PKG_VERSION:=1.0.6 PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://www.netfilter.org/projects/libnetfilter_conntrack/files/ \ - ftp://ftp.netfilter.org/pub/libnetfilter_conntrack/ -PKG_HASH:=efcc08021284e75f4d96d3581c5155a11f08fd63316b1938cbcb269c87f37feb +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://git.netfilter.org/libnetfilter_conntrack +PKG_SOURCE_DATE:=2017-07-25 +PKG_SOURCE_VERSION:=e870432649955d377a73ee5a72cb23f0f6b5e4c5 +PKG_MIRROR_HASH:=6891e6bea956d5d3514524918f439dfe8b5806397d8d40d1afc69b9bfebc1d57 + PKG_MAINTAINER:=Jo-Philipp Wich PKG_FIXUP:=autoreconf diff --git a/package/libs/libnetfilter-queue/Makefile b/package/libs/libnetfilter-queue/Makefile index dd8fd9f09e..8a11d07988 100644 --- a/package/libs/libnetfilter-queue/Makefile +++ b/package/libs/libnetfilter-queue/Makefile @@ -11,10 +11,10 @@ PKG_NAME:=libnetfilter_queue PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=http://git.netfilter.org/libnetfilter_queue -PKG_SOURCE_DATE:=2016-07-03 -PKG_SOURCE_VERSION:=981025e103d887fb6a9c9bb49c74ec323108d098 -PKG_MIRROR_HASH:=85c124be0e19162e1ebd1aba6e7e86bb4106e9dab4267baaf66d3ccb48d56e3f +PKG_SOURCE_URL=https://git.netfilter.org/libnetfilter_queue +PKG_SOURCE_DATE:=2017-06-27 +PKG_SOURCE_VERSION:=601abd1c71ccdf90753cf294c120ad43fb25dc54 +PKG_MIRROR_HASH:=283b99cfe5856dc87fd6bab8f78c0c59b72462d6b4f2b13111f928cf33020eb3 PKG_FIXUP:=autoreconf PKG_LICENSE:=GPL-2.0+ diff --git a/package/libs/libnetfilter-queue/patches/100-checksum_computation.patch b/package/libs/libnetfilter-queue/patches/100-checksum_computation.patch index 81faffe82e..92e750d510 100644 --- a/package/libs/libnetfilter-queue/patches/100-checksum_computation.patch +++ b/package/libs/libnetfilter-queue/patches/100-checksum_computation.patch @@ -8,7 +8,7 @@ #include #include #include -@@ -26,8 +27,13 @@ uint16_t nfq_checksum(uint32_t sum, uint16_t *buf, int size) +@@ -26,8 +27,13 @@ uint16_t nfq_checksum(uint32_t sum, uint sum += *buf++; size -= sizeof(uint16_t); } @@ -24,7 +24,7 @@ sum = (sum >> 16) + (sum & 0xffff); sum += (sum >>16); -@@ -35,7 +41,7 @@ uint16_t nfq_checksum(uint32_t sum, uint16_t *buf, int size) +@@ -35,7 +41,7 @@ uint16_t nfq_checksum(uint32_t sum, uint return (uint16_t)(~sum); } @@ -33,7 +33,7 @@ { uint32_t sum = 0; uint32_t iph_len = iph->ihl*4; -@@ -46,13 +52,13 @@ uint16_t nfq_checksum_tcpudp_ipv4(struct iphdr *iph) +@@ -46,13 +52,13 @@ uint16_t nfq_checksum_tcpudp_ipv4(struct sum += (iph->saddr) & 0xFFFF; sum += (iph->daddr >> 16) & 0xFFFF; sum += (iph->daddr) & 0xFFFF; @@ -49,7 +49,7 @@ { uint32_t sum = 0; uint32_t hdr_len = (uint32_t *)transport_hdr - (uint32_t *)ip6h; -@@ -68,7 +74,7 @@ uint16_t nfq_checksum_tcpudp_ipv6(struct ip6_hdr *ip6h, void *transport_hdr) +@@ -68,7 +74,7 @@ uint16_t nfq_checksum_tcpudp_ipv6(struct sum += (ip6h->ip6_dst.s6_addr16[i] >> 16) & 0xFFFF; sum += (ip6h->ip6_dst.s6_addr16[i]) & 0xFFFF; } @@ -58,11 +58,9 @@ sum += htons(ip6h->ip6_plen); return nfq_checksum(sum, (uint16_t *)payload, len); -diff --git a/src/extra/tcp.c b/src/extra/tcp.c -index d1cd79d..a66f392 100644 --- a/src/extra/tcp.c +++ b/src/extra/tcp.c -@@ -96,7 +96,7 @@ nfq_tcp_compute_checksum_ipv4(struct tcphdr *tcph, struct iphdr *iph) +@@ -96,7 +96,7 @@ nfq_tcp_compute_checksum_ipv4(struct tcp { /* checksum field in header needs to be zero for calculation. */ tcph->check = 0; @@ -71,7 +69,7 @@ index d1cd79d..a66f392 100644 } EXPORT_SYMBOL(nfq_tcp_compute_checksum_ipv4); -@@ -110,7 +110,7 @@ nfq_tcp_compute_checksum_ipv6(struct tcphdr *tcph, struct ip6_hdr *ip6h) +@@ -110,7 +110,7 @@ nfq_tcp_compute_checksum_ipv6(struct tcp { /* checksum field in header needs to be zero for calculation. */ tcph->check = 0; @@ -82,7 +80,7 @@ index d1cd79d..a66f392 100644 --- a/src/extra/udp.c +++ b/src/extra/udp.c -@@ -96,7 +96,7 @@ nfq_udp_compute_checksum_ipv4(struct udphdr *udph, struct iphdr *iph) +@@ -96,7 +96,7 @@ nfq_udp_compute_checksum_ipv4(struct udp { /* checksum field in header needs to be zero for calculation. */ udph->check = 0; @@ -91,7 +89,7 @@ index d1cd79d..a66f392 100644 } EXPORT_SYMBOL(nfq_udp_compute_checksum_ipv4); -@@ -115,7 +115,7 @@ nfq_udp_compute_checksum_ipv6(struct udphdr *udph, struct ip6_hdr *ip6h) +@@ -115,7 +115,7 @@ nfq_udp_compute_checksum_ipv6(struct udp { /* checksum field in header needs to be zero for calculation. */ udph->check = 0; diff --git a/package/libs/libnftnl/Makefile b/package/libs/libnftnl/Makefile index f7d6875b60..f4a1bb132e 100644 --- a/package/libs/libnftnl/Makefile +++ b/package/libs/libnftnl/Makefile @@ -11,7 +11,7 @@ PKG_NAME:=libnftnl PKG_VERSION:=1.0.7 PKG_RELEASE:=1 -PKG_SOURCE_URL:=git://git.netfilter.org/libnftnl +PKG_SOURCE_URL:=https://git.netfilter.org/libnftnl PKG_SOURCE_PROTO:=git PKG_SOURCE_VERSION:=libnftnl-1.0.7 PKG_MIRROR_HASH:=d38a409d52074a5b20f5b7477b385506692a9a05ec6f4ac3d14a8a80aa4f81d9 diff --git a/package/libs/libnl-tiny/src/msg.c b/package/libs/libnl-tiny/src/msg.c index e84c281fc9..b502047c4c 100644 --- a/package/libs/libnl-tiny/src/msg.c +++ b/package/libs/libnl-tiny/src/msg.c @@ -166,12 +166,7 @@ #include #include -static size_t default_msg_size; - -static void __init init_msg_size(void) -{ - default_msg_size = getpagesize(); -} +static size_t default_msg_size = 4096; /** * @name Attribute Access diff --git a/package/libs/libnl/Makefile b/package/libs/libnl/Makefile index 7916556c00..67201cc7cc 100644 --- a/package/libs/libnl/Makefile +++ b/package/libs/libnl/Makefile @@ -8,14 +8,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnl -PKG_VERSION:=3.2.29 +PKG_VERSION:=3.3.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/thom311/libnl/releases/download/libnl3_2_29 -PKG_HASH:=0beb593dc6abfffa18a5c787b27884979c1b7e7f1fd468c801e3cc938a685922 +PKG_SOURCE_URL:=https://github.com/thom311/libnl/releases/download/libnl3_3_0 +PKG_HASH:=705468b5ae4cd1eb099d2d1c476d6a3abe519bc2810becf12fb1e32de1e074e4 PKG_LICENSE:=LGPL-2.1 +PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf + include $(INCLUDE_DIR)/package.mk define Package/libnl/default @@ -77,13 +80,6 @@ endef TARGET_CFLAGS += -ffunction-sections $(FPIC) -define Build/Compile - $(call Build/Compile/Default) - make -C $(PKG_BUILD_DIR) \ - DESTDIR="$(PKG_INSTALL_DIR)" \ - install -endef - define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include/libnl3 $(1)/usr/lib/pkgconfig $(CP) $(PKG_INSTALL_DIR)/usr/include/libnl3/* $(1)/usr/include/libnl3/ diff --git a/package/libs/libnl/patches/0001-lib-Escape-usage-of-strerror_l-if-it-doesn-t-exist-i.patch b/package/libs/libnl/patches/0001-lib-Escape-usage-of-strerror_l-if-it-doesn-t-exist-i.patch deleted file mode 100644 index a31ef47729..0000000000 --- a/package/libs/libnl/patches/0001-lib-Escape-usage-of-strerror_l-if-it-doesn-t-exist-i.patch +++ /dev/null @@ -1,105 +0,0 @@ -From 098a4cc35b0da4438b8b67a914edecebef5bb6a9 Mon Sep 17 00:00:00 2001 -From: Alexey Brodkin -Date: Fri, 10 Mar 2017 13:22:14 +0300 -Subject: [PATCH] lib: Escape usage of strerror_l() if it doesn't exist in libc - -uClibc doesn't implement strerror_l() and thus libnl starting from -3.2.29 couldn't be compiled with it any longer. - -To work-around that problem we'll just do a check on strerror_l() -availability during configuration and if it's not there just fall back -to locale-less strerror(). - -Signed-off-by: Alexey Brodkin -Cc: Andre Draszik -Cc: Thomas Haller ---- - -This patch is now accepted upstream and will be a part of the next libnl -release, see -https://github.com/thom311/libnl/commit/e15966ac7f3b43df2acf869f98089762807d0568 - - configure.ac | 2 ++ - lib/utils.c | 8 +++++++- - src/lib/utils.c | 6 ++++++ - 3 files changed, 15 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 68b285e5b15c..2739b997ee3a 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -121,6 +121,8 @@ fi - - AC_CONFIG_SUBDIRS([doc]) - -+AC_CHECK_FUNCS([strerror_l]) -+ - AC_CONFIG_FILES([ - Makefile - libnl-3.0.pc -diff --git a/lib/utils.c b/lib/utils.c -index fb350d13fd2f..06273c5b291e 100644 ---- a/lib/utils.c -+++ b/lib/utils.c -@@ -30,7 +30,9 @@ - #include - #include - #include /* exit() */ -+#ifdef HAVE_STRERROR_L - #include -+#endif - - /** - * Global variable indicating the desired level of debugging output. -@@ -123,9 +125,10 @@ int __nl_read_num_str_file(const char *path, int (*cb)(long, const char *)) - - const char *nl_strerror_l(int err) - { -+ const char *buf; -+#ifdef HAVE_STRERROR_L - int errno_save = errno; - locale_t loc = newlocale(LC_MESSAGES_MASK, "", (locale_t)0); -- const char *buf; - - if (loc == (locale_t)0) { - if (errno == ENOENT) -@@ -140,6 +143,9 @@ const char *nl_strerror_l(int err) - } - - errno = errno_save; -+#else -+ buf = strerror(err); -+#endif - return buf; - } - /** @endcond */ -diff --git a/src/lib/utils.c b/src/lib/utils.c -index 5878f279c364..feb1d4ef4056 100644 ---- a/src/lib/utils.c -+++ b/src/lib/utils.c -@@ -81,6 +81,7 @@ void nl_cli_fatal(int err, const char *fmt, ...) - fprintf(stderr, "\n"); - } else { - char *buf; -+#ifdef HAVE_STRERROR_L - locale_t loc = newlocale(LC_MESSAGES_MASK, "", (locale_t)0); - if (loc == (locale_t)0) { - if (errno == ENOENT) -@@ -91,9 +92,14 @@ void nl_cli_fatal(int err, const char *fmt, ...) - } - if (loc != (locale_t)0) - buf = strerror_l(err, loc); -+#else -+ buf = strerror(err); -+#endif - fprintf(stderr, "%s\n", buf); -+#ifdef HAVE_STRERROR_L - if (loc != (locale_t)0) - freelocale(loc); -+#endif - } - - exit(abs(err)); --- -2.7.4 - diff --git a/package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch b/package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch new file mode 100644 index 0000000000..845a593761 --- /dev/null +++ b/package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch @@ -0,0 +1,30 @@ +From db0d59cd06f3ffd350379847c0885e1bfb85af0f Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sat, 7 Mar 2015 11:34:42 +0100 +Subject: [PATCH 2/2] build: add Libs.private field in libnl pkg-config file + +In order to support static linking, the libnl pkg-config file should +indicate in its Libs.private field the libraries that libnl-3.0.a +requires. The LIBS variable contains the appropriate list of +libraries: -lm in all cases, and -lpthread when pthread support is +enabled. This allows to statically link applications against libnl +properly. + +Signed-off-by: Thomas Petazzoni +--- + libnl-3.0.pc.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libnl-3.0.pc.in b/libnl-3.0.pc.in +index b87e3dc..ddbc999 100644 +--- a/libnl-3.0.pc.in ++++ b/libnl-3.0.pc.in +@@ -7,4 +7,5 @@ Name: libnl + Description: Convenience library for netlink sockets + Version: @PACKAGE_VERSION@ + Libs: -L${libdir} -lnl-@MAJ_VERSION@ ++Libs.private: @LIBS@ + Cflags: -I${includedir}/libnl@MAJ_VERSION@ +-- +2.1.0 + diff --git a/package/libs/libnl/patches/101-add-musl-workaround-to-the-libc-compat.h-copy.patch b/package/libs/libnl/patches/101-add-musl-workaround-to-the-libc-compat.h-copy.patch new file mode 100644 index 0000000000..11dc75b898 --- /dev/null +++ b/package/libs/libnl/patches/101-add-musl-workaround-to-the-libc-compat.h-copy.patch @@ -0,0 +1,103 @@ +diff -Naur libnl-3.3.0_rc1.orig/include/linux-private/linux/if_ether.h libnl-3.3.0_rc1/include/linux-private/linux/if_ether.h +--- /include/linux-private/linux/if_ether.h 2017-03-08 19:56:31.824516933 -0800 ++++ /include/linux-private/linux/if_ether.h 2017-03-08 20:07:01.938237767 -0800 +@@ -22,6 +22,7 @@ + #define _LINUX_IF_ETHER_H + + #include ++#include + + /* + * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble +@@ -117,10 +118,12 @@ + * This is an Ethernet frame header. + */ + ++#if __UAPI_DEF_ETHHDR + struct ethhdr { + unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ + unsigned char h_source[ETH_ALEN]; /* source ether addr */ + __be16 h_proto; /* packet type ID field */ + } __attribute__((packed)); ++#endif + + #endif /* _LINUX_IF_ETHER_H */ +diff -Naur libnl-3.3.0_rc1.orig/include/linux-private/linux/libc-compat.h libnl-3.3.0_rc1/include/linux-private/linux/libc-compat.h +--- /include/linux-private/linux/libc-compat.h 2017-03-08 19:56:31.823516923 -0800 ++++ /include/linux-private/linux/libc-compat.h 2017-03-08 20:12:30.376843489 -0800 +@@ -48,10 +48,18 @@ + #ifndef _LIBC_COMPAT_H + #define _LIBC_COMPAT_H + +-/* We have included glibc headers... */ +-#if defined(__GLIBC__) ++/* We're used from userspace... */ ++#if !defined(__KERNEL__) + +-/* Coordinate with glibc netinet/in.h header. */ ++/* Coordinate with libc netinet/if_ether.h */ ++#ifdef _NETINET_IF_ETHER_H /* musl */ ++#define __UAPI_DEF_ETHHDR 0 ++#else ++/* glibc uses __NETINET_IF_ETHER_H, and uses the uapi header. */ ++#define __UAPI_DEF_ETHHDR 1 ++#endif ++ ++/* Coordinate with libc netinet/in.h header. */ + #if defined(_NETINET_IN_H) + + /* GLIBC headers included first so don't define anything +@@ -64,15 +72,7 @@ + #define __UAPI_DEF_IN_CLASS 0 + + #define __UAPI_DEF_IN6_ADDR 0 +-/* The exception is the in6_addr macros which must be defined +- * if the glibc code didn't define them. This guard matches +- * the guard in glibc/inet/netinet/in.h which defines the +- * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */ +-#if defined(__USE_MISC) || defined (__USE_GNU) + #define __UAPI_DEF_IN6_ADDR_ALT 0 +-#else +-#define __UAPI_DEF_IN6_ADDR_ALT 1 +-#endif + #define __UAPI_DEF_SOCKADDR_IN6 0 + #define __UAPI_DEF_IPV6_MREQ 0 + #define __UAPI_DEF_IPPROTO_V6 0 +@@ -83,7 +83,7 @@ + #else + + /* Linux headers included first, and we must define everything +- * we need. The expectation is that glibc will check the ++ * we need. The expectation is that libc will check the + * __UAPI_DEF_* defines and adjust appropriately. */ + #define __UAPI_DEF_IN_ADDR 1 + #define __UAPI_DEF_IN_IPPROTO 1 +@@ -93,7 +93,7 @@ + #define __UAPI_DEF_IN_CLASS 1 + + #define __UAPI_DEF_IN6_ADDR 1 +-/* We unconditionally define the in6_addr macros and glibc must ++/* We unconditionally define the in6_addr macros and libc must + * coordinate. */ + #define __UAPI_DEF_IN6_ADDR_ALT 1 + #define __UAPI_DEF_SOCKADDR_IN6 1 +@@ -115,7 +115,10 @@ + /* If we did not see any headers from any supported C libraries, + * or we are being included in the kernel, then define everything + * that we need. */ +-#else /* !defined(__GLIBC__) */ ++#else /* defined(__KERNEL__) */ ++ ++/* Definitions for if/ether.h */ ++#define __UAPI_DEF_ETHHDR 1 + + /* Definitions for in.h */ + #define __UAPI_DEF_IN_ADDR 1 +@@ -138,6 +141,6 @@ + /* Definitions for xattr.h */ + #define __UAPI_DEF_XATTR 1 + +-#endif /* __GLIBC__ */ ++#endif /* defined(__KERNEL__) */ + + #endif /* _LIBC_COMPAT_H */ diff --git a/package/libs/libnl/patches/102-revert-build-enable-building-cli-during-tests.patch b/package/libs/libnl/patches/102-revert-build-enable-building-cli-during-tests.patch new file mode 100644 index 0000000000..f715bb83f9 --- /dev/null +++ b/package/libs/libnl/patches/102-revert-build-enable-building-cli-during-tests.patch @@ -0,0 +1,115 @@ +From 68f8393bd356a3d0598cf77e1044b7e8b98aa4d8 Mon Sep 17 00:00:00 2001 +Message-Id: <68f8393bd356a3d0598cf77e1044b7e8b98aa4d8.1493920165.git.baruch@tkos.co.il> +From: Baruch Siach +Date: Thu, 4 May 2017 15:56:14 +0300 +Subject: [PATCH] Revert "build: enable building cli during tests" + +This reverts commit 3cb28534d34392ceec4adead0cfa97039796ccb7. + +Contrary to what 3cb28534d commit log claims, the cli programs depend on +dynamic libraries support of the toolchain. Enabling cli programs +unconditionally breaks static build as follows: + +In file included from lib/cli/cls/basic.c:12:0: +./include/netlink/cli/utils.h:25:19: fatal error: dlfcn.h: No such file or directory +compilation terminated. +Makefile:3666: recipe for target 'lib/cli/cls/lib_cli_cls_basic_la-basic.lo' failed +make[1]: *** [lib/cli/cls/lib_cli_cls_basic_la-basic.lo] Error 1 + +Revert that commit to restore the ability of static only build of libnl, and +its dependencies. + +Signed-off-by: Baruch Siach +--- +Upstream status: https://github.com/thom311/libnl/pull/141 + + Makefile.am | 21 ++++++--------------- + 1 file changed, 6 insertions(+), 15 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 1b95a559304f..279548394650 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -3,8 +3,6 @@ + ACLOCAL_AMFLAGS = -I m4 + + lib_LTLIBRARIES = +-noinst_LTLIBRARIES = +-check_LTLIBRARIES = + + check_PROGRAMS = + check_programs = +@@ -500,6 +498,8 @@ EXTRA_lib_libnl_xfrm_3_la_DEPENDENCIES = \ + lib_libnl_xfrm_3_la_LIBADD = \ + lib/libnl-3.la + ++if ENABLE_CLI ++ + lib_cli_ltlibraries_cls = \ + lib/cli/cls/basic.la \ + lib/cli/cls/cgroup.la +@@ -513,15 +513,11 @@ lib_cli_ltlibraries_qdisc = \ + lib/cli/qdisc/pfifo.la \ + lib/cli/qdisc/plug.la + +-if ENABLE_CLI + pkglib_clsdir = $(pkglibdir)/cli/cls + pkglib_qdiscdir = $(pkglibdir)/cli/qdisc + pkglib_cls_LTLIBRARIES = $(lib_cli_ltlibraries_cls) + pkglib_qdisc_LTLIBRARIES = $(lib_cli_ltlibraries_qdisc) +-else +-noinst_LTLIBRARIES += \ +- $(lib_cli_ltlibraries_cls) \ +- $(lib_cli_ltlibraries_qdisc) ++ + endif + + lib_cli_ldflags = \ +@@ -550,13 +546,8 @@ lib_cli_qdisc_plug_la_LDFLAGS = $(lib_cli_ldflags) + + ############################################################################### + +-src_lib_ldflags = +- + if ENABLE_CLI + lib_LTLIBRARIES += src/lib/libnl-cli-3.la +-src_lib_ldflags += -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) +-else +-check_LTLIBRARIES += src/lib/libnl-cli-3.la + endif + + src_lib_libnl_cli_3_la_SOURCES = \ +@@ -583,7 +574,7 @@ src_lib_libnl_cli_3_la_CPPFLAGS = \ + -I$(srcdir)/include \ + -I$(builddir)/include + src_lib_libnl_cli_3_la_LDFLAGS = \ +- $(src_lib_ldflags) \ ++ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ + -Wl,--version-script=$(srcdir)/libnl-cli-3.sym + src_lib_libnl_cli_3_la_LIBADD = \ + lib/libnl-3.la \ +@@ -668,8 +659,6 @@ else + noinst_PROGRAMS += $(cli_programs) + endif + endif +-else +-check_PROGRAMS += $(cli_programs) + endif + + src_genl_ctrl_list_CPPFLAGS = $(src_cppflags) +@@ -847,10 +836,12 @@ tests_test_complex_HTB_with_hash_filters_LDADD = $(tests_ldadd) + tests_test_u32_filter_with_actions_CPPFLAGS = $(tests_cppflags) + tests_test_u32_filter_with_actions_LDADD = $(tests_ldadd) + ++if ENABLE_CLI + check_PROGRAMS += \ + tests/test-cache-mngr \ + tests/test-genl \ + tests/test-nf-cache-mngr ++endif + + tests_cli_ldadd = \ + $(tests_ldadd) \ +-- +2.11.0 + diff --git a/package/libs/librpc/Makefile b/package/libs/librpc/Makefile index 0330614c31..e8f51a23f1 100644 --- a/package/libs/librpc/Makefile +++ b/package/libs/librpc/Makefile @@ -4,7 +4,7 @@ PKG_NAME:=librpc PKG_RELEASE=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/librpc-uclibc.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/librpc-uclibc.git PKG_SOURCE_DATE:=2015-11-04 PKG_SOURCE_VERSION:=a921e3ded051746f9f7cd5e5a312fb6771716aac PKG_MIRROR_HASH:=22c8dc55e1c4e8e31635a37708a3ce622a6ca33ebd918a4321b0be6ffce89b21 diff --git a/package/libs/libtool/Makefile b/package/libs/libtool/Makefile index 5eb521a72b..8cef09f78a 100644 --- a/package/libs/libtool/Makefile +++ b/package/libs/libtool/Makefile @@ -17,6 +17,7 @@ PKG_HASH:=afcce660d3dc54c63a0a5ba3cf05272239dc3c54bbeba20f6bad250f9dc007ae PKG_LICENSE:=GPL-2.0+ PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:gnu:libtool PKG_BUILD_PARALLEL:=0 diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile index 5fdf946412..9b7d867f6c 100644 --- a/package/libs/libubox/Makefile +++ b/package/libs/libubox/Makefile @@ -4,10 +4,10 @@ PKG_NAME:=libubox PKG_RELEASE=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/libubox.git -PKG_SOURCE_DATE:=2017-09-29 -PKG_SOURCE_VERSION:=632688e8d6cde32781e4ec685d59afb0938300ad -PKG_MIRROR_HASH:=84b5a0bc404e96a2965cadc1beb92664f4c22cc878a0a624eecd4b6884b56625 +PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git +PKG_SOURCE_DATE:=2018-01-07 +PKG_SOURCE_VERSION:=1c08e80313fd487112c48346889cc57badeef751 +PKG_MIRROR_HASH:=58cad98de55d44d7791e5d49b809ac5c32d3e6c481dc385b10e02386853f2263 CMAKE_INSTALL:=1 PKG_LICENSE:=ISC diff --git a/package/libs/libunwind/Makefile b/package/libs/libunwind/Makefile index 913d616234..2e655ed6f0 100644 --- a/package/libs/libunwind/Makefile +++ b/package/libs/libunwind/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libunwind PKG_VERSION:=1.2.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SAVANNAH/$(PKG_NAME) @@ -20,9 +20,11 @@ PKG_INSTALL:=1 PKG_LICENSE:=X11 PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:libunwind_project:libunwind PKG_MAINTAINER:=Yousong Zhou +PKG_SSP:=0 include $(INCLUDE_DIR)/package.mk define Package/libunwind diff --git a/package/libs/libusb-compat/Makefile b/package/libs/libusb-compat/Makefile index 59c5a80bd0..0dc93941a9 100644 --- a/package/libs/libusb-compat/Makefile +++ b/package/libs/libusb-compat/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libusb-compat -PKG_VERSION:=0.1.4 -PKG_RELEASE:=2 +PKG_VERSION:=0.1.5 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@SF/libusb -PKG_HASH:=ed5bdd160c7b01ef767fb931a81b454f46226d1e2cf58502ced758d3e5a9fdc4 +PKG_HASH:=404ef4b6b324be79ac1bfb3d839eac860fbc929e6acb1ef88793a6ea328bc55a PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index 0e3383150d..3a2b292285 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -18,6 +18,7 @@ PKG_HASH:=a99959d7360def22f9108d2d487c9de384fe76c349697176b1f22370080d5810 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0+ +PKG_CPE_ID:=cpe:/a:arm:mbed_tls include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk diff --git a/package/libs/nghttp2/Makefile b/package/libs/nghttp2/Makefile new file mode 100644 index 0000000000..3cc2a55430 --- /dev/null +++ b/package/libs/nghttp2/Makefile @@ -0,0 +1,45 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=nghttp2 +PKG_VERSION:=1.29.0 +PKG_RELEASE:=1 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz + +PKG_SOURCE_URL:=https://github.com/nghttp2/nghttp2/releases/download/v$(PKG_VERSION) +PKG_HASH:=a7a1b18be57be6a53a7739988ea27d6ec9209e7b0e8372b8483cd911d7838739 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=COPYING +CMAKE_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/libnghttp2 + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Library implementing the framing layer of HTTP/2 + MAINTAINER:=Hans Dedecker +endef + +define Package/libnghttp2/description + C library implementing the framing layer of the HTTP/2 protocol. It can be used to build a HTTP/2-capable HTTP client or server +endef + +CMAKE_OPTIONS += \ + -DENABLE_LIB_ONLY=ON + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/nghttp2 + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/nghttp2/*.h $(1)/usr/include/nghttp2/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libnghttp2.so* $(1)/usr/lib/ +endef + +define Package/libnghttp2/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libnghttp2.so* $(1)/usr/lib +endef + +$(eval $(call BuildPackage,libnghttp2)) diff --git a/package/libs/openssl/Config.in b/package/libs/openssl/Config.in index 40fc945eaa..96d3ba3e9d 100644 --- a/package/libs/openssl/Config.in +++ b/package/libs/openssl/Config.in @@ -49,20 +49,20 @@ config OPENSSL_ENGINE_DIGEST bool depends on OPENSSL_ENGINE_CRYPTO prompt "Digests acceleration support" - -config OPENSSL_THREADS - bool - prompt "Threading support" - default y - select PACKAGE_libpthread config OPENSSL_HARDWARE_SUPPORT bool default n prompt "Enable hardware support" +config OPENSSL_OPTIMIZE_SPEED + bool + default n + prompt "Enable optimization for speed instead of size" + endif config OPENSSL_ENGINE_CRYPTO bool + select OPENSSL_HARDWARE_SUPPORT prompt "Crypto acceleration support" if PACKAGE_libopenssl diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 37dae96fe5..b75aa45e84 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openssl PKG_BASE:=1.0.2 -PKG_BUGFIX:=l +PKG_BUGFIX:=n PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX) -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_USE_MIPS16:=0 PKG_BUILD_PARALLEL:=0 @@ -24,10 +24,11 @@ PKG_SOURCE_URL:= \ http://gd.tuwien.ac.at/infosys/security/openssl/source/ \ http://www.openssl.org/source/ \ http://www.openssl.org/source/old/$(PKG_BASE)/ -PKG_HASH:=ce07195b659e75f4e1db43552860070061f156a98bb37b672b101ba6e3ddf30c +PKG_HASH:=370babb75f278c39e0c50e8c4e7493bc0f18db6867478341a832a982fd15a8fe PKG_LICENSE:=OpenSSL PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:openssl:openssl PKG_CONFIG_DEPENDS:= \ CONFIG_OPENSSL_ENGINE_CRYPTO \ CONFIG_OPENSSL_ENGINE_DIGEST \ @@ -35,13 +36,13 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_OPENSSL_WITH_EC2M \ CONFIG_OPENSSL_WITH_SSL3 \ CONFIG_OPENSSL_HARDWARE_SUPPORT \ - CONFIG_OPENSSL_THREADS \ CONFIG_OPENSSL_WITH_DEPRECATED \ CONFIG_OPENSSL_WITH_DTLS \ CONFIG_OPENSSL_WITH_COMPRESSION \ CONFIG_OPENSSL_WITH_NPN \ CONFIG_OPENSSL_WITH_PSK \ - CONFIG_OPENSSL_WITH_SRP + CONFIG_OPENSSL_WITH_SRP \ + CONFIG_OPENSSL_OPTIMIZE_SPEED include $(INCLUDE_DIR)/package.mk @@ -129,12 +130,6 @@ ifndef CONFIG_OPENSSL_HARDWARE_SUPPORT OPENSSL_OPTIONS += no-hw endif -ifdef CONFIG_OPENSSL_THREADS - OPENSSL_OPTIONS += threads -else - OPENSSL_OPTIONS += no-threads -endif - ifndef CONFIG_OPENSSL_WITH_DEPRECATED OPENSSL_OPTIONS += no-deprecated endif @@ -161,6 +156,10 @@ ifndef CONFIG_OPENSSL_WITH_SRP OPENSSL_OPTIONS += no-srp endif +ifeq ($(CONFIG_OPENSSL_OPTIMIZE_SPEED),y) + TARGET_CFLAGS := $(filter-out -Os,$(TARGET_CFLAGS)) -O3 +endif + ifeq ($(CONFIG_x86_64),y) OPENSSL_TARGET:=linux-x86_64-openwrt OPENSSL_MAKEFLAGS += LIBDIR=lib @@ -191,7 +190,7 @@ define Build/Configure --openssldir=/etc/ssl \ $(TARGET_CPPFLAGS) \ $(TARGET_LDFLAGS) -ldl \ - -DOPENSSL_SMALL_FOOTPRINT \ + $(if $(CONFIG_OPENSSL_OPTIMIZE_SPEED),,-DOPENSSL_SMALL_FOOTPRINT) \ $(OPENSSL_NO_CIPHERS) \ $(OPENSSL_OPTIONS) \ ) diff --git a/package/libs/openssl/patches/150-no_engines.patch b/package/libs/openssl/patches/150-no_engines.patch index f8c5d6e6cd..1cb04bdabb 100644 --- a/package/libs/openssl/patches/150-no_engines.patch +++ b/package/libs/openssl/patches/150-no_engines.patch @@ -1,6 +1,6 @@ --- a/Configure +++ b/Configure -@@ -2129,6 +2129,11 @@ EOF +@@ -2130,6 +2130,11 @@ EOF close(OUT); } diff --git a/package/libs/readline/Makefile b/package/libs/readline/Makefile index ccd20a4b18..ca3a468637 100644 --- a/package/libs/readline/Makefile +++ b/package/libs/readline/Makefile @@ -17,6 +17,7 @@ PKG_HASH:=750d437185286f40a369e1e4f4764eda932b9459b5ec9a731628393dd3d32334 PKG_LICENSE:=GPL-3.0 PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:gnu:readline PKG_BUILD_PARALLEL:=1 PKG_FIXUP:=autoreconf diff --git a/package/libs/uclient/Makefile b/package/libs/uclient/Makefile index 2c4c626236..f0c08a3233 100644 --- a/package/libs/uclient/Makefile +++ b/package/libs/uclient/Makefile @@ -4,10 +4,10 @@ PKG_NAME:=uclient PKG_RELEASE=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/uclient.git -PKG_SOURCE_DATE:=2017-09-06 -PKG_SOURCE_VERSION:=24d6eded73dec427fc4a3a20cc73c94227f59c31 -PKG_MIRROR_HASH:=e884ae0c859baa20a5c7f3d924022f8e1f57d28474dbe5fed1efb8fb97790dd0 +PKG_SOURCE_URL=$(PROJECT_GIT)/project/uclient.git +PKG_SOURCE_DATE:=2017-11-02 +PKG_SOURCE_VERSION:=4b87d83160fec70d50b7fcd736a8c538c28a016c +PKG_MIRROR_HASH:=4bbb4d5f295ebdcd67fec87a6794168bea2176a42cb2907c47d8566fb33dafb3 CMAKE_INSTALL:=1 PKG_BUILD_DEPENDS:=ustream-ssl diff --git a/package/libs/ustream-ssl/Makefile b/package/libs/ustream-ssl/Makefile index ff6c4b7d01..b5e773ba7f 100644 --- a/package/libs/ustream-ssl/Makefile +++ b/package/libs/ustream-ssl/Makefile @@ -4,7 +4,7 @@ PKG_NAME:=ustream-ssl PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/ustream-ssl.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/ustream-ssl.git PKG_SOURCE_DATE:=2016-07-02 PKG_SOURCE_VERSION:=ec80adaa1b47f28d426fa19c692011ce60b992d6 PKG_MIRROR_HASH:=bfbad6b4e8c1e933f0bfaab43cbdd44a536c08128c3a779e6f2395a6a886aab7 @@ -35,11 +35,11 @@ define Package/libustream-openssl VARIANT:=openssl endef -define Package/libustream-cyassl +define Package/libustream-wolfssl $(Package/libustream/default) - TITLE += (cyassl) - DEPENDS += +PACKAGE_libustream-cyassl:libcyassl - VARIANT:=cyassl + TITLE += (wolfssl) + DEPENDS += +PACKAGE_libustream-wolfssl:libwolfssl + VARIANT:=wolfssl endef define Package/libustream-mbedtls @@ -50,7 +50,7 @@ define Package/libustream-mbedtls DEFAULT_VARIANT:=1 endef -ifeq ($(BUILD_VARIANT),cyassl) +ifeq ($(BUILD_VARIANT),wolfssl) TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/cyassl -DHAVE_SNI CMAKE_OPTIONS += -DCYASSL=on endif @@ -64,9 +64,9 @@ define Package/libustream/default/install endef Package/libustream-openssl/install = $(Package/libustream/default/install) -Package/libustream-cyassl/install = $(Package/libustream/default/install) +Package/libustream-wolfssl/install = $(Package/libustream/default/install) Package/libustream-mbedtls/install = $(Package/libustream/default/install) $(eval $(call BuildPackage,libustream-mbedtls)) -$(eval $(call BuildPackage,libustream-cyassl)) +$(eval $(call BuildPackage,libustream-wolfssl)) $(eval $(call BuildPackage,libustream-openssl)) diff --git a/package/libs/cyassl/Config.in b/package/libs/wolfssl/Config.in similarity index 63% rename from package/libs/cyassl/Config.in rename to package/libs/wolfssl/Config.in index 371bb564f8..7e8a4b6cee 100644 --- a/package/libs/cyassl/Config.in +++ b/package/libs/wolfssl/Config.in @@ -1,47 +1,47 @@ -if PACKAGE_libcyassl +if PACKAGE_libwolfssl -config CYASSL_HAS_AES_CCM +config WOLFSSL_HAS_AES_CCM bool "Include AES-CCM support" default n -config CYASSL_HAS_AES_GCM +config WOLFSSL_HAS_AES_GCM bool "Include AES-GCM support" default n -config CYASSL_HAS_CHACHA +config WOLFSSL_HAS_CHACHA bool "Include ChaCha cipher suite support" default n -config CYASSL_HAS_ECC +config WOLFSSL_HAS_ECC bool "Include ECC (Elliptic Curve Cryptography) support" default y -config CYASSL_HAS_DH +config WOLFSSL_HAS_DH bool "Include DH (Diffie-Hellman) support" default n -config CYASSL_HAS_ARC4 +config WOLFSSL_HAS_ARC4 bool "Include ARC4 support" default n -config CYASSL_HAS_DES3 +config WOLFSSL_HAS_DES3 bool "Include DES3 (Tripple-DES) support" default n -config CYASSL_HAS_PSK +config WOLFSSL_HAS_PSK bool "Include PKS (Pre Share Key) support" default n -config CYASSL_HAS_DTLS +config WOLFSSL_HAS_DTLS bool "Include DTLS support" default n -config CYASSL_HAS_ECC25519 +config WOLFSSL_HAS_ECC25519 bool "Include ECC Curve 22519 support" - depends on CYASSL_HAS_ECC + depends on WOLFSSL_HAS_ECC default n -config CYASSL_HAS_POLY_1305 +config WOLFSSL_HAS_POLY_1305 bool "Include Poly-1305 support" default n diff --git a/package/libs/cyassl/Makefile b/package/libs/wolfssl/Makefile similarity index 65% rename from package/libs/cyassl/Makefile rename to package/libs/wolfssl/Makefile index 68646d9b00..1d4b7f5579 100644 --- a/package/libs/cyassl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2016 OpenWrt.org +# Copyright (C) 2006-2017 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,36 +8,39 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl -PKG_VERSION:=3.10.0 +PKG_VERSION:=3.12.2 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip PKG_SOURCE_URL:=https://www.wolfssl.com/ -PKG_HASH:=66f7f2a8b8ee37d6b4beab3cb0dcb6a6980fd4674373bfd3bf1214b9d0d2c02e +PKG_HASH:=4993844c4b7919007c4511ec3f987fb06543536c3fc933cb53491bffe9150e49 PKG_FIXUP:=libtool PKG_INSTALL:=1 PKG_USE_MIPS16:=0 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0+ +PKG_CPE_ID:=cpe:/a:yassl:cyassl include $(INCLUDE_DIR)/package.mk -define Package/libcyassl +define Package/libwolfssl SECTION:=libs SUBMENU:=SSL CATEGORY:=Libraries - TITLE:=CyaSSL library + TITLE:=wolfSSL library URL:=http://www.wolfssl.com/ + MAINTAINER:=Alexandru Ardelean MENU:=1 + PROVIDES:=libcyassl endef -define Package/libcyassl/description -CyaSSL is an SSL library optimized for small footprint, both on disk and for -memory use. +define Package/libwolfssl/description +wolfSSL (formerly CyaSSL) is an SSL library optimized for small +footprint, both on disk and for memory use. endef -define Package/libcyassl/config +define Package/libwolfssl/config source "$(SOURCE)/Config.in" endef @@ -55,58 +58,58 @@ CONFIGURE_ARGS += \ --enable-ipv6 endif -ifeq ($(CONFIG_CYASSL_HAS_AES_CCM),y) +ifeq ($(CONFIG_WOLFSSL_HAS_AES_CCM),y) CONFIGURE_ARGS += \ --enable-aesccm endif -ifeq ($(CONFIG_CYASSL_HAS_AES_GCM),y) +ifneq ($(CONFIG_WOLFSSL_HAS_AES_GCM),y) CONFIGURE_ARGS += \ - --enable-aesgcm + --disable-aesgcm endif -ifeq ($(CONFIG_CYASSL_HAS_CHACHA),y) +ifneq ($(CONFIG_WOLFSSL_HAS_CHACHA),y) CONFIGURE_ARGS += \ - --enable-chacha + --disable-chacha endif -ifeq ($(CONFIG_CYASSL_HAS_ECC),y) +ifeq ($(CONFIG_WOLFSSL_HAS_ECC),y) CONFIGURE_ARGS += \ --enable-ecc \ --enable-supportedcurves endif -ifeq ($(CONFIG_CYASSL_HAS_DH),y) +ifneq ($(CONFIG_WOLFSSL_HAS_DH),y) CONFIGURE_ARGS += \ --enable-dh endif -ifeq ($(CONFIG_CYASSL_HAS_ARC4),n) +ifeq ($(CONFIG_WOLFSSL_HAS_ARC4),n) CONFIGURE_ARGS += \ --disable-arc4 endif -ifeq ($(CONFIG_CYASSL_HAS_DES3),y) +ifeq ($(CONFIG_WOLFSSL_HAS_DES3),y) CONFIGURE_ARGS += \ --disable-des3 endif -ifeq ($(CONFIG_CYASSL_HAS_PSK),y) +ifeq ($(CONFIG_WOLFSSL_HAS_PSK),y) CONFIGURE_ARGS += \ --enable-psk endif -ifeq ($(CONFIG_CYASSL_HAS_DTLS),y) +ifeq ($(CONFIG_WOLFSSL_HAS_DTLS),y) CONFIGURE_ARGS += \ --enable-dtls endif -ifeq ($(CONFIG_CYASSL_HAS_ECC25519),y) +ifeq ($(CONFIG_WOLFSSL_HAS_ECC25519),y) CONFIGURE_ARGS += \ - --enable-ecc25519 + --enable-curve25519 endif -ifeq ($(CONFIG_CYASSL_HAS_POLY1305),y) +ifneq ($(CONFIG_WOLFSSL_HAS_POLY1305),y) CONFIGURE_ARGS += \ --enable-poly1305 endif @@ -130,10 +133,10 @@ define Build/InstallDev $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig endef -define Package/libcyassl/install +define Package/libwolfssl/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwolfssl.so* $(1)/usr/lib/ ln -s libwolfssl.so $(1)/usr/lib/libcyassl.so endef -$(eval $(call BuildPackage,libcyassl)) +$(eval $(call BuildPackage,libwolfssl)) diff --git a/package/libs/wolfssl/patches/001-CVE-2017-13099.patch b/package/libs/wolfssl/patches/001-CVE-2017-13099.patch new file mode 100644 index 0000000000..e7b63cb8d4 --- /dev/null +++ b/package/libs/wolfssl/patches/001-CVE-2017-13099.patch @@ -0,0 +1,144 @@ +From fd455d5a5e9fef24c208e7ac7d3a4bc58834cbf1 Mon Sep 17 00:00:00 2001 +From: David Garske +Date: Tue, 14 Nov 2017 14:05:50 -0800 +Subject: [PATCH] Fix for handling of static RSA PKCS formatting failures so + they are indistinguishable from from correctly formatted RSA blocks (per + RFC5246 section 7.4.7.1). Adjusted the static RSA preMasterSecret RNG + creation for consistency in client case. Removed obsolete + `PMS_VERSION_ERROR`. + +--- + src/internal.c | 70 +++++++++++++++++++++++++++++++++++++++++++++-------- + wolfssl/error-ssl.h | 2 +- + 2 files changed, 61 insertions(+), 11 deletions(-) + +--- a/src/internal.c ++++ b/src/internal.c +@@ -14190,9 +14190,6 @@ const char* wolfSSL_ERR_reason_error_str + case NOT_READY_ERROR : + return "handshake layer not ready yet, complete first"; + +- case PMS_VERSION_ERROR : +- return "premaster secret version mismatch error"; +- + case VERSION_ERROR : + return "record layer version error"; + +@@ -18758,8 +18755,10 @@ int SendClientKeyExchange(WOLFSSL* ssl) + #ifndef NO_RSA + case rsa_kea: + { ++ /* build PreMasterSecret with RNG data */ + ret = wc_RNG_GenerateBlock(ssl->rng, +- ssl->arrays->preMasterSecret, SECRET_LEN); ++ &ssl->arrays->preMasterSecret[VERSION_SZ], ++ SECRET_LEN - VERSION_SZ); + if (ret != 0) { + goto exit_scke; + } +@@ -23545,6 +23544,9 @@ static int DoSessionTicket(WOLFSSL* ssl, + word32 idx; + word32 begin; + word32 sigSz; ++ #ifndef NO_RSA ++ int lastErr; ++ #endif + } DckeArgs; + + static void FreeDckeArgs(WOLFSSL* ssl, void* pArgs) +@@ -23770,6 +23772,14 @@ static int DoSessionTicket(WOLFSSL* ssl, + ERROR_OUT(BUFFER_ERROR, exit_dcke); + } + ++ /* pre-load PreMasterSecret with RNG data */ ++ ret = wc_RNG_GenerateBlock(ssl->rng, ++ &ssl->arrays->preMasterSecret[VERSION_SZ], ++ SECRET_LEN - VERSION_SZ); ++ if (ret != 0) { ++ goto exit_dcke; ++ } ++ + args->output = NULL; + break; + } /* rsa_kea */ +@@ -24234,6 +24244,20 @@ static int DoSessionTicket(WOLFSSL* ssl, + NULL, 0, NULL + #endif + ); ++ ++ /* Errors that can occur here that should be ++ * indistinguishable: ++ * RSA_BUFFER_E, RSA_PAD_E and RSA_PRIVATE_ERROR ++ */ ++ if (ret < 0 && ret != BAD_FUNC_ARG) { ++ #ifdef WOLFSSL_ASYNC_CRYPT ++ if (ret == WC_PENDING_E) ++ goto exit_dcke; ++ #endif ++ /* store error code for handling below */ ++ args->lastErr = ret; ++ ret = 0; ++ } + break; + } /* rsa_kea */ + #endif /* !NO_RSA */ +@@ -24380,16 +24404,42 @@ static int DoSessionTicket(WOLFSSL* ssl, + /* Add the signature length to idx */ + args->idx += args->length; + +- if (args->sigSz == SECRET_LEN && args->output != NULL) { +- XMEMCPY(ssl->arrays->preMasterSecret, args->output, SECRET_LEN); +- if (ssl->arrays->preMasterSecret[0] != ssl->chVersion.major || +- ssl->arrays->preMasterSecret[1] != ssl->chVersion.minor) { +- ERROR_OUT(PMS_VERSION_ERROR, exit_dcke); ++ #ifdef DEBUG_WOLFSSL ++ /* check version (debug warning message only) */ ++ if (args->output != NULL) { ++ if (args->output[0] != ssl->chVersion.major || ++ args->output[1] != ssl->chVersion.minor) { ++ WOLFSSL_MSG("preMasterSecret version mismatch"); + } + } ++ #endif ++ ++ /* RFC5246 7.4.7.1: ++ * Treat incorrectly formatted message blocks and/or ++ * mismatched version numbers in a manner ++ * indistinguishable from correctly formatted RSA blocks ++ */ ++ ++ ret = args->lastErr; ++ args->lastErr = 0; /* reset */ ++ ++ /* build PreMasterSecret */ ++ ssl->arrays->preMasterSecret[0] = ssl->chVersion.major; ++ ssl->arrays->preMasterSecret[1] = ssl->chVersion.minor; ++ if (ret == 0 && args->sigSz == SECRET_LEN && ++ args->output != NULL) { ++ XMEMCPY(&ssl->arrays->preMasterSecret[VERSION_SZ], ++ &args->output[VERSION_SZ], ++ SECRET_LEN - VERSION_SZ); ++ } + else { +- ERROR_OUT(RSA_PRIVATE_ERROR, exit_dcke); ++ /* preMasterSecret has RNG and version set */ ++ /* return proper length and ignore error */ ++ /* error will be caught as decryption error */ ++ args->sigSz = SECRET_LEN; ++ ret = 0; + } ++ + break; + } /* rsa_kea */ + #endif /* !NO_RSA */ +--- a/wolfssl/error-ssl.h ++++ b/wolfssl/error-ssl.h +@@ -57,7 +57,7 @@ enum wolfSSL_ErrorCodes { + DOMAIN_NAME_MISMATCH = -322, /* peer subject name mismatch */ + WANT_READ = -323, /* want read, call again */ + NOT_READY_ERROR = -324, /* handshake layer not ready */ +- PMS_VERSION_ERROR = -325, /* pre m secret version error */ ++ + VERSION_ERROR = -326, /* record layer version error */ + WANT_WRITE = -327, /* want write, call again */ + BUFFER_ERROR = -328, /* malformed buffer input */ diff --git a/package/libs/wolfssl/patches/100-disable-hardening-check.patch b/package/libs/wolfssl/patches/100-disable-hardening-check.patch new file mode 100644 index 0000000000..83d51b1d5c --- /dev/null +++ b/package/libs/wolfssl/patches/100-disable-hardening-check.patch @@ -0,0 +1,11 @@ +--- a/wolfssl/wolfcrypt/settings.h ++++ b/wolfssl/wolfcrypt/settings.h +@@ -1553,7 +1553,7 @@ extern void uITRON4_free(void *p) ; + #endif + + /* warning for not using harden build options (default with ./configure) */ +-#ifndef WC_NO_HARDEN ++#if 0 + #if (defined(USE_FAST_MATH) && !defined(TFM_TIMING_RESISTANT)) || \ + (defined(HAVE_ECC) && !defined(ECC_TIMING_RESISTANT)) || \ + (!defined(NO_RSA) && !defined(WC_RSA_BLINDING) && !defined(HAVE_FIPS)) diff --git a/package/libs/cyassl/patches/400-additional_compatibility.patch b/package/libs/wolfssl/patches/400-additional_compatibility.patch similarity index 100% rename from package/libs/cyassl/patches/400-additional_compatibility.patch rename to package/libs/wolfssl/patches/400-additional_compatibility.patch diff --git a/package/libs/zlib/Config.in b/package/libs/zlib/Config.in new file mode 100644 index 0000000000..64b835e77a --- /dev/null +++ b/package/libs/zlib/Config.in @@ -0,0 +1,11 @@ +menu "Configuration" + depends on PACKAGE_zlib + +config ZLIB_OPTIMIZE_SPEED + bool "Optimize for speed" + help + This enables additional optimization and + increases performance considerably at + the expense of binary size. + +endmenu diff --git a/package/libs/zlib/Makefile b/package/libs/zlib/Makefile index 7e3bd83195..a7c61f7dd0 100644 --- a/package/libs/zlib/Makefile +++ b/package/libs/zlib/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zlib PKG_VERSION:=1.2.11 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@SF/libpng http://www.zlib.net @@ -17,8 +17,13 @@ PKG_HASH:=4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066 PKG_LICENSE:=Zlib PKG_LICENSE_FILES:=README +PKG_CPE_ID:=cpe:/a:gnu:zlib +PKG_CONFIG_DEPENDS:= CONFIG_ZLIB_OPTIMIZE_SPEED + +include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk define Package/zlib SECTION:=libs @@ -45,27 +50,19 @@ define Package/zlib-dev/description This package includes the development support files. endef -CONFIGURE_VARS := \ - $(TARGET_CONFIGURE_OPTS) \ - LDSHARED="$(TARGET_CC) -shared -Wl,-soname,libz.so.1" \ - CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \ - -CONFIGURE_ARGS := \ - --prefix=/usr \ - --shared \ - --uname=Linux \ - -define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - $(TARGET_CONFIGURE_OPTS) \ - CFLAGS="$(TARGET_CFLAGS)" \ - libz.a libz.so.$(PKG_VERSION) - mkdir -p $(PKG_INSTALL_DIR) - $(MAKE) -C $(PKG_BUILD_DIR) \ - DESTDIR="$(PKG_INSTALL_DIR)" \ - install +define Package/zlib/config + source "$(SOURCE)/Config.in" endef +TARGET_CFLAGS += $(FPIC) + +ifeq ($(CONFIG_ZLIB_OPTIMIZE_SPEED),y) + TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS)) -O3 +endif + +CMAKE_OPTIONS += \ + -DARMv8=$$$$(echo -e '\#ifdef __ARM_NEON__\nON\n\#else\nOFF\n\#endif' | $$(TARGET_CC) $$(TARGET_CFLAGS) -x c -E - | grep -xE 'ON|OFF') + define Build/InstallDev mkdir -p $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/z{conf,lib}.h \ @@ -74,7 +71,7 @@ define Build/InstallDev $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.{a,so*} \ $(1)/usr/lib/ mkdir -p $(1)/usr/lib/pkgconfig - $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/zlib.pc \ + $(CP) $(PKG_INSTALL_DIR)/usr/share/pkgconfig/zlib.pc \ $(1)/usr/lib/pkgconfig/ endef @@ -94,9 +91,10 @@ define Package/zlib-dev/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.a $(1)/usr/lib/ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/zlib.pc \ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pkgconfig/zlib.pc \ $(1)/usr/lib/pkgconfig/ endef +$(eval $(call HostBuild)) $(eval $(call BuildPackage,zlib)) $(eval $(call BuildPackage,zlib-dev)) diff --git a/package/libs/zlib/patches/001-neon-implementation-of-adler32.patch b/package/libs/zlib/patches/001-neon-implementation-of-adler32.patch new file mode 100644 index 0000000000..843ef45c7d --- /dev/null +++ b/package/libs/zlib/patches/001-neon-implementation-of-adler32.patch @@ -0,0 +1,253 @@ +From d2f06cd65d7ac39c6dd6761eef162abc946b155b Mon Sep 17 00:00:00 2001 +From: Adenilson Cavalcanti +Date: Tue, 11 Apr 2017 17:13:02 -0700 +Subject: [PATCH] NEON implementation for Adler32 + +The checksum is calculated in the uncompressed PNG data +and can be made much faster by using SIMD. + +Tests in ARMv8 yielded an improvement of about 3x +(e.g. walltime was 350ms x 125ms for a 4096x4096 bytes +executed 30 times). That results in at least 18% improvement +in image decoding in Chromium. + +Further details at: +https://bugs.chromium.org/p/chromium/issues/detail?id=688601 +--- + CMakeLists.txt | 29 +++++++--- + adler32.c | 5 ++ + contrib/README.contrib | 3 + + contrib/arm/neon_adler32.c | 137 +++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 166 insertions(+), 8 deletions(-) + create mode 100644 contrib/arm/neon_adler32.c + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0fe939df..8e75f664 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,6 +7,7 @@ set(VERSION "1.2.11") + + option(ASM686 "Enable building i686 assembly implementation") + option(AMD64 "Enable building amd64 assembly implementation") ++option(ARMv8 "Enable building ARM NEON intrinsics implementation") + + set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables") + set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries") +@@ -132,14 +133,26 @@ endif() + if(CMAKE_COMPILER_IS_GNUCC) + if(ASM686) + set(ZLIB_ASMS contrib/asm686/match.S) +- elseif (AMD64) ++ elseif(AMD64) + set(ZLIB_ASMS contrib/amd64/amd64-match.S) +- endif () ++ elseif(ARMv8) ++ set(ZLIB_ARMv8 contrib/arm/neon_adler32.c) ++ endif() + +- if(ZLIB_ASMS) +- add_definitions(-DASMV) +- set_source_files_properties(${ZLIB_ASMS} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE) +- endif() ++ if(ZLIB_ASMS) ++ add_definitions(-DASMV) ++ set_source_files_properties(${ZLIB_ASMS} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE) ++ elseif(ZLIB_ARMv8) ++ add_definitions(-DARMv8) ++ set(COMPILER ${CMAKE_C_COMPILER}) ++ # NEON is mandatory in ARMv8. ++ if(${COMPILER} MATCHES "aarch64") ++ set_source_files_properties(${ZLIB_ARMv8} PROPERTIES LANGUAGE C COMPILE_FLAGS -march=armv8-a) ++ # But it was optional for ARMv7. ++ elseif(${COMPILER} MATCHES "arm") ++ set_source_files_properties(${ZLIB_ARMv8} PROPERTIES LANGUAGE C COMPILE_FLAGS -mfpu=neon) ++ endif() ++ endif() + endif() + + if(MSVC) +@@ -183,8 +196,8 @@ if(MINGW) + set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) + endif(MINGW) + +-add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) +-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) ++add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_ARMv8} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) ++add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_ARMv8} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) + set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) + set_target_properties(zlib PROPERTIES SOVERSION 1) + +diff --git a/adler32.c b/adler32.c +index d0be4380..45ebaa4b 100644 +--- a/adler32.c ++++ b/adler32.c +@@ -136,7 +136,12 @@ uLong ZEXPORT adler32(adler, buf, len) + const Bytef *buf; + uInt len; + { ++#ifdef ARMv8 ++# pragma message("Using NEON-ized Adler32.") ++ return NEON_adler32(adler, buf, len); ++#else + return adler32_z(adler, buf, len); ++#endif + } + + /* ========================================================================= */ +diff --git a/contrib/README.contrib b/contrib/README.contrib +index a411d5c3..3fd1d202 100644 +--- a/contrib/README.contrib ++++ b/contrib/README.contrib +@@ -12,6 +12,9 @@ amd64/ by Mikhail Teterin + asm code for AMD64 + See patch at http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/96393 + ++arm/ by Adenilson Cavalcanti ++ ARM optimizations (NEON and ARMv8 code). ++ + asm686/ by Brian Raiter + asm code for Pentium and PPro/PII, using the AT&T (GNU as) syntax + See http://www.muppetlabs.com/~breadbox/software/assembly.html +diff --git a/contrib/arm/neon_adler32.c b/contrib/arm/neon_adler32.c +new file mode 100644 +index 00000000..f173a74f +--- /dev/null ++++ b/contrib/arm/neon_adler32.c +@@ -0,0 +1,137 @@ ++/* Copyright (C) 1995-2011, 2016 Mark Adler ++ * Copyright (C) 2017 ARM Holdings Inc. ++ * Authors: Adenilson Cavalcanti ++ * Simon Hosie ++ * This software is provided 'as-is', without any express or implied ++ * warranty. In no event will the authors be held liable for any damages ++ * arising from the use of this software. ++ * Permission is granted to anyone to use this software for any purpose, ++ * including commercial applications, and to alter it and redistribute it ++ * freely, subject to the following restrictions: ++ * 1. The origin of this software must not be misrepresented; you must not ++ * claim that you wrote the original software. If you use this software ++ * in a product, an acknowledgment in the product documentation would be ++ * appreciated but is not required. ++ * 2. Altered source versions must be plainly marked as such, and must not be ++ * misrepresented as being the original software. ++ * 3. This notice may not be removed or altered from any source distribution. ++ */ ++ ++#if (defined(__ARM_NEON__) || defined(__ARM_NEON)) ++#include ++ ++static void NEON_accum32(uint32_t *s, const unsigned char *buf, ++ unsigned int len) ++{ ++ static const uint8_t taps[32] = { ++ 32, 31, 30, 29, 28, 27, 26, 25, ++ 24, 23, 22, 21, 20, 19, 18, 17, ++ 16, 15, 14, 13, 12, 11, 10, 9, ++ 8, 7, 6, 5, 4, 3, 2, 1 }; ++ ++ uint32x2_t adacc2, s2acc2, as; ++ uint8x16_t t0 = vld1q_u8(taps), t1 = vld1q_u8(taps + 16); ++ ++ uint32x4_t adacc = vdupq_n_u32(0), s2acc = vdupq_n_u32(0); ++ adacc = vsetq_lane_u32(s[0], adacc, 0); ++ s2acc = vsetq_lane_u32(s[1], s2acc, 0); ++ ++ while (len >= 2) { ++ uint8x16_t d0 = vld1q_u8(buf), d1 = vld1q_u8(buf + 16); ++ uint16x8_t adler, sum2; ++ s2acc = vaddq_u32(s2acc, vshlq_n_u32(adacc, 5)); ++ adler = vpaddlq_u8( d0); ++ adler = vpadalq_u8(adler, d1); ++ sum2 = vmull_u8( vget_low_u8(t0), vget_low_u8(d0)); ++ sum2 = vmlal_u8(sum2, vget_high_u8(t0), vget_high_u8(d0)); ++ sum2 = vmlal_u8(sum2, vget_low_u8(t1), vget_low_u8(d1)); ++ sum2 = vmlal_u8(sum2, vget_high_u8(t1), vget_high_u8(d1)); ++ adacc = vpadalq_u16(adacc, adler); ++ s2acc = vpadalq_u16(s2acc, sum2); ++ len -= 2; ++ buf += 32; ++ } ++ ++ while (len > 0) { ++ uint8x16_t d0 = vld1q_u8(buf); ++ uint16x8_t adler, sum2; ++ s2acc = vaddq_u32(s2acc, vshlq_n_u32(adacc, 4)); ++ adler = vpaddlq_u8(d0); ++ sum2 = vmull_u8( vget_low_u8(t1), vget_low_u8(d0)); ++ sum2 = vmlal_u8(sum2, vget_high_u8(t1), vget_high_u8(d0)); ++ adacc = vpadalq_u16(adacc, adler); ++ s2acc = vpadalq_u16(s2acc, sum2); ++ buf += 16; ++ len--; ++ } ++ ++ adacc2 = vpadd_u32(vget_low_u32(adacc), vget_high_u32(adacc)); ++ s2acc2 = vpadd_u32(vget_low_u32(s2acc), vget_high_u32(s2acc)); ++ as = vpadd_u32(adacc2, s2acc2); ++ s[0] = vget_lane_u32(as, 0); ++ s[1] = vget_lane_u32(as, 1); ++} ++ ++static void NEON_handle_tail(uint32_t *pair, const unsigned char *buf, ++ unsigned int len) ++{ ++ /* Oldie K&R code integration. */ ++ unsigned int i; ++ for (i = 0; i < len; ++i) { ++ pair[0] += buf[i]; ++ pair[1] += pair[0]; ++ } ++} ++ ++extern unsigned long NEON_adler32(unsigned long adler, const unsigned char *buf, ++ const unsigned int len) ++{ ++ /* initial Adler-32 value (deferred check for len == 1 speed) */ ++ if (!buf) ++ return 1L; ++ ++ /* The largest prime smaller than 65536. */ ++ const uint32_t M_BASE = 65521; ++ /* This is the threshold where doing accumulation may overflow. */ ++ const int M_NMAX = 5552; ++ ++ unsigned long sum2; ++ uint32_t pair[2]; ++ int n = M_NMAX; ++ unsigned int done = 0; ++ /* Oldie K&R code integration. */ ++ unsigned int i; ++ ++ /* Split Adler-32 into component sums, it can be supplied by ++ * the caller sites (e.g. in a PNG file). ++ */ ++ sum2 = (adler >> 16) & 0xffff; ++ adler &= 0xffff; ++ pair[0] = adler; ++ pair[1] = sum2; ++ ++ for (i = 0; i < len; i += n) { ++ if ((i + n) > len) ++ n = len - i; ++ ++ if (n < 16) ++ break; ++ ++ NEON_accum32(pair, buf + i, n / 16); ++ pair[0] %= M_BASE; ++ pair[1] %= M_BASE; ++ ++ done += (n / 16) * 16; ++ } ++ ++ /* Handle the tail elements. */ ++ if (done < len) { ++ NEON_handle_tail(pair, (buf + done), len - done); ++ pair[0] %= M_BASE; ++ pair[1] %= M_BASE; ++ } ++ ++ /* D = B * 65536 + A, see: https://en.wikipedia.org/wiki/Adler-32. */ ++ return (pair[1] << 16) | pair[0]; ++} ++#endif diff --git a/package/libs/zlib/patches/002-arm-specific-optimisations-for-inflate.patch b/package/libs/zlib/patches/002-arm-specific-optimisations-for-inflate.patch new file mode 100644 index 0000000000..475ed6f3e9 --- /dev/null +++ b/package/libs/zlib/patches/002-arm-specific-optimisations-for-inflate.patch @@ -0,0 +1,2411 @@ +From 6bac7a3e0ebcd3147294b73acb34606eba18ae7f Mon Sep 17 00:00:00 2001 +From: Simon Hosie +Date: Wed, 12 Apr 2017 12:52:33 -0700 +Subject: [PATCH 1/2] Prepare ARM-specific contrib directory. + +Change-Id: Id4cda552b39bfb39ab35ec499dbe122b43b6d1a1 +--- + contrib/arm/inffast.c | 323 ++++++++++ + contrib/arm/inflate.c | 1561 +++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 1884 insertions(+) + create mode 100644 contrib/arm/inffast.c + create mode 100644 contrib/arm/inflate.c + +diff --git a/contrib/arm/inffast.c b/contrib/arm/inffast.c +new file mode 100644 +index 00000000..0dbd1dbc +--- /dev/null ++++ b/contrib/arm/inffast.c +@@ -0,0 +1,323 @@ ++/* inffast.c -- fast decoding ++ * Copyright (C) 1995-2017 Mark Adler ++ * For conditions of distribution and use, see copyright notice in zlib.h ++ */ ++ ++#include "zutil.h" ++#include "inftrees.h" ++#include "inflate.h" ++#include "inffast.h" ++ ++#ifdef ASMINF ++# pragma message("Assembler code may have bugs -- use at your own risk") ++#else ++ ++/* ++ Decode literal, length, and distance codes and write out the resulting ++ literal and match bytes until either not enough input or output is ++ available, an end-of-block is encountered, or a data error is encountered. ++ When large enough input and output buffers are supplied to inflate(), for ++ example, a 16K input buffer and a 64K output buffer, more than 95% of the ++ inflate execution time is spent in this routine. ++ ++ Entry assumptions: ++ ++ state->mode == LEN ++ strm->avail_in >= 6 ++ strm->avail_out >= 258 ++ start >= strm->avail_out ++ state->bits < 8 ++ ++ On return, state->mode is one of: ++ ++ LEN -- ran out of enough output space or enough available input ++ TYPE -- reached end of block code, inflate() to interpret next block ++ BAD -- error in block data ++ ++ Notes: ++ ++ - The maximum input bits used by a length/distance pair is 15 bits for the ++ length code, 5 bits for the length extra, 15 bits for the distance code, ++ and 13 bits for the distance extra. This totals 48 bits, or six bytes. ++ Therefore if strm->avail_in >= 6, then there is enough input to avoid ++ checking for available input while decoding. ++ ++ - The maximum bytes that a single length/distance pair can output is 258 ++ bytes, which is the maximum length that can be coded. inflate_fast() ++ requires strm->avail_out >= 258 for each loop to avoid checking for ++ output space. ++ */ ++void ZLIB_INTERNAL inflate_fast(strm, start) ++z_streamp strm; ++unsigned start; /* inflate()'s starting value for strm->avail_out */ ++{ ++ struct inflate_state FAR *state; ++ z_const unsigned char FAR *in; /* local strm->next_in */ ++ z_const unsigned char FAR *last; /* have enough input while in < last */ ++ unsigned char FAR *out; /* local strm->next_out */ ++ unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ ++ unsigned char FAR *end; /* while out < end, enough space available */ ++#ifdef INFLATE_STRICT ++ unsigned dmax; /* maximum distance from zlib header */ ++#endif ++ unsigned wsize; /* window size or zero if not using window */ ++ unsigned whave; /* valid bytes in the window */ ++ unsigned wnext; /* window write index */ ++ unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */ ++ unsigned long hold; /* local strm->hold */ ++ unsigned bits; /* local strm->bits */ ++ code const FAR *lcode; /* local strm->lencode */ ++ code const FAR *dcode; /* local strm->distcode */ ++ unsigned lmask; /* mask for first level of length codes */ ++ unsigned dmask; /* mask for first level of distance codes */ ++ code here; /* retrieved table entry */ ++ unsigned op; /* code bits, operation, extra bits, or */ ++ /* window position, window bytes to copy */ ++ unsigned len; /* match length, unused bytes */ ++ unsigned dist; /* match distance */ ++ unsigned char FAR *from; /* where to copy match from */ ++ ++ /* copy state to local variables */ ++ state = (struct inflate_state FAR *)strm->state; ++ in = strm->next_in; ++ last = in + (strm->avail_in - 5); ++ out = strm->next_out; ++ beg = out - (start - strm->avail_out); ++ end = out + (strm->avail_out - 257); ++#ifdef INFLATE_STRICT ++ dmax = state->dmax; ++#endif ++ wsize = state->wsize; ++ whave = state->whave; ++ wnext = state->wnext; ++ window = state->window; ++ hold = state->hold; ++ bits = state->bits; ++ lcode = state->lencode; ++ dcode = state->distcode; ++ lmask = (1U << state->lenbits) - 1; ++ dmask = (1U << state->distbits) - 1; ++ ++ /* decode literals and length/distances until end-of-block or not enough ++ input data or output space */ ++ do { ++ if (bits < 15) { ++ hold += (unsigned long)(*in++) << bits; ++ bits += 8; ++ hold += (unsigned long)(*in++) << bits; ++ bits += 8; ++ } ++ here = lcode[hold & lmask]; ++ dolen: ++ op = (unsigned)(here.bits); ++ hold >>= op; ++ bits -= op; ++ op = (unsigned)(here.op); ++ if (op == 0) { /* literal */ ++ Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? ++ "inflate: literal '%c'\n" : ++ "inflate: literal 0x%02x\n", here.val)); ++ *out++ = (unsigned char)(here.val); ++ } ++ else if (op & 16) { /* length base */ ++ len = (unsigned)(here.val); ++ op &= 15; /* number of extra bits */ ++ if (op) { ++ if (bits < op) { ++ hold += (unsigned long)(*in++) << bits; ++ bits += 8; ++ } ++ len += (unsigned)hold & ((1U << op) - 1); ++ hold >>= op; ++ bits -= op; ++ } ++ Tracevv((stderr, "inflate: length %u\n", len)); ++ if (bits < 15) { ++ hold += (unsigned long)(*in++) << bits; ++ bits += 8; ++ hold += (unsigned long)(*in++) << bits; ++ bits += 8; ++ } ++ here = dcode[hold & dmask]; ++ dodist: ++ op = (unsigned)(here.bits); ++ hold >>= op; ++ bits -= op; ++ op = (unsigned)(here.op); ++ if (op & 16) { /* distance base */ ++ dist = (unsigned)(here.val); ++ op &= 15; /* number of extra bits */ ++ if (bits < op) { ++ hold += (unsigned long)(*in++) << bits; ++ bits += 8; ++ if (bits < op) { ++ hold += (unsigned long)(*in++) << bits; ++ bits += 8; ++ } ++ } ++ dist += (unsigned)hold & ((1U << op) - 1); ++#ifdef INFLATE_STRICT ++ if (dist > dmax) { ++ strm->msg = (char *)"invalid distance too far back"; ++ state->mode = BAD; ++ break; ++ } ++#endif ++ hold >>= op; ++ bits -= op; ++ Tracevv((stderr, "inflate: distance %u\n", dist)); ++ op = (unsigned)(out - beg); /* max distance in output */ ++ if (dist > op) { /* see if copy from window */ ++ op = dist - op; /* distance back in window */ ++ if (op > whave) { ++ if (state->sane) { ++ strm->msg = ++ (char *)"invalid distance too far back"; ++ state->mode = BAD; ++ break; ++ } ++#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR ++ if (len <= op - whave) { ++ do { ++ *out++ = 0; ++ } while (--len); ++ continue; ++ } ++ len -= op - whave; ++ do { ++ *out++ = 0; ++ } while (--op > whave); ++ if (op == 0) { ++ from = out - dist; ++ do { ++ *out++ = *from++; ++ } while (--len); ++ continue; ++ } ++#endif ++ } ++ from = window; ++ if (wnext == 0) { /* very common case */ ++ from += wsize - op; ++ if (op < len) { /* some from window */ ++ len -= op; ++ do { ++ *out++ = *from++; ++ } while (--op); ++ from = out - dist; /* rest from output */ ++ } ++ } ++ else if (wnext < op) { /* wrap around window */ ++ from += wsize + wnext - op; ++ op -= wnext; ++ if (op < len) { /* some from end of window */ ++ len -= op; ++ do { ++ *out++ = *from++; ++ } while (--op); ++ from = window; ++ if (wnext < len) { /* some from start of window */ ++ op = wnext; ++ len -= op; ++ do { ++ *out++ = *from++; ++ } while (--op); ++ from = out - dist; /* rest from output */ ++ } ++ } ++ } ++ else { /* contiguous in window */ ++ from += wnext - op; ++ if (op < len) { /* some from window */ ++ len -= op; ++ do { ++ *out++ = *from++; ++ } while (--op); ++ from = out - dist; /* rest from output */ ++ } ++ } ++ while (len > 2) { ++ *out++ = *from++; ++ *out++ = *from++; ++ *out++ = *from++; ++ len -= 3; ++ } ++ if (len) { ++ *out++ = *from++; ++ if (len > 1) ++ *out++ = *from++; ++ } ++ } ++ else { ++ from = out - dist; /* copy direct from output */ ++ do { /* minimum length is three */ ++ *out++ = *from++; ++ *out++ = *from++; ++ *out++ = *from++; ++ len -= 3; ++ } while (len > 2); ++ if (len) { ++ *out++ = *from++; ++ if (len > 1) ++ *out++ = *from++; ++ } ++ } ++ } ++ else if ((op & 64) == 0) { /* 2nd level distance code */ ++ here = dcode[here.val + (hold & ((1U << op) - 1))]; ++ goto dodist; ++ } ++ else { ++ strm->msg = (char *)"invalid distance code"; ++ state->mode = BAD; ++ break; ++ } ++ } ++ else if ((op & 64) == 0) { /* 2nd level length code */ ++ here = lcode[here.val + (hold & ((1U << op) - 1))]; ++ goto dolen; ++ } ++ else if (op & 32) { /* end-of-block */ ++ Tracevv((stderr, "inflate: end of block\n")); ++ state->mode = TYPE; ++ break; ++ } ++ else { ++ strm->msg = (char *)"invalid literal/length code"; ++ state->mode = BAD; ++ break; ++ } ++ } while (in < last && out < end); ++ ++ /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ ++ len = bits >> 3; ++ in -= len; ++ bits -= len << 3; ++ hold &= (1U << bits) - 1; ++ ++ /* update state and return */ ++ strm->next_in = in; ++ strm->next_out = out; ++ strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last)); ++ strm->avail_out = (unsigned)(out < end ? ++ 257 + (end - out) : 257 - (out - end)); ++ state->hold = hold; ++ state->bits = bits; ++ return; ++} ++ ++/* ++ inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe): ++ - Using bit fields for code structure ++ - Different op definition to avoid & for extra bits (do & for table bits) ++ - Three separate decoding do-loops for direct, window, and wnext == 0 ++ - Special case for distance > 1 copies to do overlapped load and store copy ++ - Explicit branch predictions (based on measured branch probabilities) ++ - Deferring match copy and interspersed it with decoding subsequent codes ++ - Swapping literal/length else ++ - Swapping window/direct else ++ - Larger unrolled copy loops (three is about right) ++ - Moving len -= 3 statement into middle of loop ++ */ ++ ++#endif /* !ASMINF */ +diff --git a/contrib/arm/inflate.c b/contrib/arm/inflate.c +new file mode 100644 +index 00000000..ac333e8c +--- /dev/null ++++ b/contrib/arm/inflate.c +@@ -0,0 +1,1561 @@ ++/* inflate.c -- zlib decompression ++ * Copyright (C) 1995-2016 Mark Adler ++ * For conditions of distribution and use, see copyright notice in zlib.h ++ */ ++ ++/* ++ * Change history: ++ * ++ * 1.2.beta0 24 Nov 2002 ++ * - First version -- complete rewrite of inflate to simplify code, avoid ++ * creation of window when not needed, minimize use of window when it is ++ * needed, make inffast.c even faster, implement gzip decoding, and to ++ * improve code readability and style over the previous zlib inflate code ++ * ++ * 1.2.beta1 25 Nov 2002 ++ * - Use pointers for available input and output checking in inffast.c ++ * - Remove input and output counters in inffast.c ++ * - Change inffast.c entry and loop from avail_in >= 7 to >= 6 ++ * - Remove unnecessary second byte pull from length extra in inffast.c ++ * - Unroll direct copy to three copies per loop in inffast.c ++ * ++ * 1.2.beta2 4 Dec 2002 ++ * - Change external routine names to reduce potential conflicts ++ * - Correct filename to inffixed.h for fixed tables in inflate.c ++ * - Make hbuf[] unsigned char to match parameter type in inflate.c ++ * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset) ++ * to avoid negation problem on Alphas (64 bit) in inflate.c ++ * ++ * 1.2.beta3 22 Dec 2002 ++ * - Add comments on state->bits assertion in inffast.c ++ * - Add comments on op field in inftrees.h ++ * - Fix bug in reuse of allocated window after inflateReset() ++ * - Remove bit fields--back to byte structure for speed ++ * - Remove distance extra == 0 check in inflate_fast()--only helps for lengths ++ * - Change post-increments to pre-increments in inflate_fast(), PPC biased? ++ * - Add compile time option, POSTINC, to use post-increments instead (Intel?) ++ * - Make MATCH copy in inflate() much faster for when inflate_fast() not used ++ * - Use local copies of stream next and avail values, as well as local bit ++ * buffer and bit count in inflate()--for speed when inflate_fast() not used ++ * ++ * 1.2.beta4 1 Jan 2003 ++ * - Split ptr - 257 statements in inflate_table() to avoid compiler warnings ++ * - Move a comment on output buffer sizes from inffast.c to inflate.c ++ * - Add comments in inffast.c to introduce the inflate_fast() routine ++ * - Rearrange window copies in inflate_fast() for speed and simplification ++ * - Unroll last copy for window match in inflate_fast() ++ * - Use local copies of window variables in inflate_fast() for speed ++ * - Pull out common wnext == 0 case for speed in inflate_fast() ++ * - Make op and len in inflate_fast() unsigned for consistency ++ * - Add FAR to lcode and dcode declarations in inflate_fast() ++ * - Simplified bad distance check in inflate_fast() ++ * - Added inflateBackInit(), inflateBack(), and inflateBackEnd() in new ++ * source file infback.c to provide a call-back interface to inflate for ++ * programs like gzip and unzip -- uses window as output buffer to avoid ++ * window copying ++ * ++ * 1.2.beta5 1 Jan 2003 ++ * - Improved inflateBack() interface to allow the caller to provide initial ++ * input in strm. ++ * - Fixed stored blocks bug in inflateBack() ++ * ++ * 1.2.beta6 4 Jan 2003 ++ * - Added comments in inffast.c on effectiveness of POSTINC ++ * - Typecasting all around to reduce compiler warnings ++ * - Changed loops from while (1) or do {} while (1) to for (;;), again to ++ * make compilers happy ++ * - Changed type of window in inflateBackInit() to unsigned char * ++ * ++ * 1.2.beta7 27 Jan 2003 ++ * - Changed many types to unsigned or unsigned short to avoid warnings ++ * - Added inflateCopy() function ++ * ++ * 1.2.0 9 Mar 2003 ++ * - Changed inflateBack() interface to provide separate opaque descriptors ++ * for the in() and out() functions ++ * - Changed inflateBack() argument and in_func typedef to swap the length ++ * and buffer address return values for the input function ++ * - Check next_in and next_out for Z_NULL on entry to inflate() ++ * ++ * The history for versions after 1.2.0 are in ChangeLog in zlib distribution. ++ */ ++ ++#include "zutil.h" ++#include "inftrees.h" ++#include "inflate.h" ++#include "inffast.h" ++ ++#ifdef MAKEFIXED ++# ifndef BUILDFIXED ++# define BUILDFIXED ++# endif ++#endif ++ ++/* function prototypes */ ++local int inflateStateCheck OF((z_streamp strm)); ++local void fixedtables OF((struct inflate_state FAR *state)); ++local int updatewindow OF((z_streamp strm, const unsigned char FAR *end, ++ unsigned copy)); ++#ifdef BUILDFIXED ++ void makefixed OF((void)); ++#endif ++local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf, ++ unsigned len)); ++ ++local int inflateStateCheck(strm) ++z_streamp strm; ++{ ++ struct inflate_state FAR *state; ++ if (strm == Z_NULL || ++ strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) ++ return 1; ++ state = (struct inflate_state FAR *)strm->state; ++ if (state == Z_NULL || state->strm != strm || ++ state->mode < HEAD || state->mode > SYNC) ++ return 1; ++ return 0; ++} ++ ++int ZEXPORT inflateResetKeep(strm) ++z_streamp strm; ++{ ++ struct inflate_state FAR *state; ++ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ strm->total_in = strm->total_out = state->total = 0; ++ strm->msg = Z_NULL; ++ if (state->wrap) /* to support ill-conceived Java test suite */ ++ strm->adler = state->wrap & 1; ++ state->mode = HEAD; ++ state->last = 0; ++ state->havedict = 0; ++ state->dmax = 32768U; ++ state->head = Z_NULL; ++ state->hold = 0; ++ state->bits = 0; ++ state->lencode = state->distcode = state->next = state->codes; ++ state->sane = 1; ++ state->back = -1; ++ Tracev((stderr, "inflate: reset\n")); ++ return Z_OK; ++} ++ ++int ZEXPORT inflateReset(strm) ++z_streamp strm; ++{ ++ struct inflate_state FAR *state; ++ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ state->wsize = 0; ++ state->whave = 0; ++ state->wnext = 0; ++ return inflateResetKeep(strm); ++} ++ ++int ZEXPORT inflateReset2(strm, windowBits) ++z_streamp strm; ++int windowBits; ++{ ++ int wrap; ++ struct inflate_state FAR *state; ++ ++ /* get the state */ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ ++ /* extract wrap request from windowBits parameter */ ++ if (windowBits < 0) { ++ wrap = 0; ++ windowBits = -windowBits; ++ } ++ else { ++ wrap = (windowBits >> 4) + 5; ++#ifdef GUNZIP ++ if (windowBits < 48) ++ windowBits &= 15; ++#endif ++ } ++ ++ /* set number of window bits, free window if different */ ++ if (windowBits && (windowBits < 8 || windowBits > 15)) ++ return Z_STREAM_ERROR; ++ if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) { ++ ZFREE(strm, state->window); ++ state->window = Z_NULL; ++ } ++ ++ /* update state and reset the rest of it */ ++ state->wrap = wrap; ++ state->wbits = (unsigned)windowBits; ++ return inflateReset(strm); ++} ++ ++int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) ++z_streamp strm; ++int windowBits; ++const char *version; ++int stream_size; ++{ ++ int ret; ++ struct inflate_state FAR *state; ++ ++ if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || ++ stream_size != (int)(sizeof(z_stream))) ++ return Z_VERSION_ERROR; ++ if (strm == Z_NULL) return Z_STREAM_ERROR; ++ strm->msg = Z_NULL; /* in case we return an error */ ++ if (strm->zalloc == (alloc_func)0) { ++#ifdef Z_SOLO ++ return Z_STREAM_ERROR; ++#else ++ strm->zalloc = zcalloc; ++ strm->opaque = (voidpf)0; ++#endif ++ } ++ if (strm->zfree == (free_func)0) ++#ifdef Z_SOLO ++ return Z_STREAM_ERROR; ++#else ++ strm->zfree = zcfree; ++#endif ++ state = (struct inflate_state FAR *) ++ ZALLOC(strm, 1, sizeof(struct inflate_state)); ++ if (state == Z_NULL) return Z_MEM_ERROR; ++ Tracev((stderr, "inflate: allocated\n")); ++ strm->state = (struct internal_state FAR *)state; ++ state->strm = strm; ++ state->window = Z_NULL; ++ state->mode = HEAD; /* to pass state test in inflateReset2() */ ++ ret = inflateReset2(strm, windowBits); ++ if (ret != Z_OK) { ++ ZFREE(strm, state); ++ strm->state = Z_NULL; ++ } ++ return ret; ++} ++ ++int ZEXPORT inflateInit_(strm, version, stream_size) ++z_streamp strm; ++const char *version; ++int stream_size; ++{ ++ return inflateInit2_(strm, DEF_WBITS, version, stream_size); ++} ++ ++int ZEXPORT inflatePrime(strm, bits, value) ++z_streamp strm; ++int bits; ++int value; ++{ ++ struct inflate_state FAR *state; ++ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ if (bits < 0) { ++ state->hold = 0; ++ state->bits = 0; ++ return Z_OK; ++ } ++ if (bits > 16 || state->bits + (uInt)bits > 32) return Z_STREAM_ERROR; ++ value &= (1L << bits) - 1; ++ state->hold += (unsigned)value << state->bits; ++ state->bits += (uInt)bits; ++ return Z_OK; ++} ++ ++/* ++ Return state with length and distance decoding tables and index sizes set to ++ fixed code decoding. Normally this returns fixed tables from inffixed.h. ++ If BUILDFIXED is defined, then instead this routine builds the tables the ++ first time it's called, and returns those tables the first time and ++ thereafter. This reduces the size of the code by about 2K bytes, in ++ exchange for a little execution time. However, BUILDFIXED should not be ++ used for threaded applications, since the rewriting of the tables and virgin ++ may not be thread-safe. ++ */ ++local void fixedtables(state) ++struct inflate_state FAR *state; ++{ ++#ifdef BUILDFIXED ++ static int virgin = 1; ++ static code *lenfix, *distfix; ++ static code fixed[544]; ++ ++ /* build fixed huffman tables if first call (may not be thread safe) */ ++ if (virgin) { ++ unsigned sym, bits; ++ static code *next; ++ ++ /* literal/length table */ ++ sym = 0; ++ while (sym < 144) state->lens[sym++] = 8; ++ while (sym < 256) state->lens[sym++] = 9; ++ while (sym < 280) state->lens[sym++] = 7; ++ while (sym < 288) state->lens[sym++] = 8; ++ next = fixed; ++ lenfix = next; ++ bits = 9; ++ inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work); ++ ++ /* distance table */ ++ sym = 0; ++ while (sym < 32) state->lens[sym++] = 5; ++ distfix = next; ++ bits = 5; ++ inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work); ++ ++ /* do this just once */ ++ virgin = 0; ++ } ++#else /* !BUILDFIXED */ ++# include "inffixed.h" ++#endif /* BUILDFIXED */ ++ state->lencode = lenfix; ++ state->lenbits = 9; ++ state->distcode = distfix; ++ state->distbits = 5; ++} ++ ++#ifdef MAKEFIXED ++#include ++ ++/* ++ Write out the inffixed.h that is #include'd above. Defining MAKEFIXED also ++ defines BUILDFIXED, so the tables are built on the fly. makefixed() writes ++ those tables to stdout, which would be piped to inffixed.h. A small program ++ can simply call makefixed to do this: ++ ++ void makefixed(void); ++ ++ int main(void) ++ { ++ makefixed(); ++ return 0; ++ } ++ ++ Then that can be linked with zlib built with MAKEFIXED defined and run: ++ ++ a.out > inffixed.h ++ */ ++void makefixed() ++{ ++ unsigned low, size; ++ struct inflate_state state; ++ ++ fixedtables(&state); ++ puts(" /* inffixed.h -- table for decoding fixed codes"); ++ puts(" * Generated automatically by makefixed()."); ++ puts(" */"); ++ puts(""); ++ puts(" /* WARNING: this file should *not* be used by applications."); ++ puts(" It is part of the implementation of this library and is"); ++ puts(" subject to change. Applications should only use zlib.h."); ++ puts(" */"); ++ puts(""); ++ size = 1U << 9; ++ printf(" static const code lenfix[%u] = {", size); ++ low = 0; ++ for (;;) { ++ if ((low % 7) == 0) printf("\n "); ++ printf("{%u,%u,%d}", (low & 127) == 99 ? 64 : state.lencode[low].op, ++ state.lencode[low].bits, state.lencode[low].val); ++ if (++low == size) break; ++ putchar(','); ++ } ++ puts("\n };"); ++ size = 1U << 5; ++ printf("\n static const code distfix[%u] = {", size); ++ low = 0; ++ for (;;) { ++ if ((low % 6) == 0) printf("\n "); ++ printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits, ++ state.distcode[low].val); ++ if (++low == size) break; ++ putchar(','); ++ } ++ puts("\n };"); ++} ++#endif /* MAKEFIXED */ ++ ++/* ++ Update the window with the last wsize (normally 32K) bytes written before ++ returning. If window does not exist yet, create it. This is only called ++ when a window is already in use, or when output has been written during this ++ inflate call, but the end of the deflate stream has not been reached yet. ++ It is also called to create a window for dictionary data when a dictionary ++ is loaded. ++ ++ Providing output buffers larger than 32K to inflate() should provide a speed ++ advantage, since only the last 32K of output is copied to the sliding window ++ upon return from inflate(), and since all distances after the first 32K of ++ output will fall in the output data, making match copies simpler and faster. ++ The advantage may be dependent on the size of the processor's data caches. ++ */ ++local int updatewindow(strm, end, copy) ++z_streamp strm; ++const Bytef *end; ++unsigned copy; ++{ ++ struct inflate_state FAR *state; ++ unsigned dist; ++ ++ state = (struct inflate_state FAR *)strm->state; ++ ++ /* if it hasn't been done already, allocate space for the window */ ++ if (state->window == Z_NULL) { ++ state->window = (unsigned char FAR *) ++ ZALLOC(strm, 1U << state->wbits, ++ sizeof(unsigned char)); ++ if (state->window == Z_NULL) return 1; ++ } ++ ++ /* if window not in use yet, initialize */ ++ if (state->wsize == 0) { ++ state->wsize = 1U << state->wbits; ++ state->wnext = 0; ++ state->whave = 0; ++ } ++ ++ /* copy state->wsize or less output bytes into the circular window */ ++ if (copy >= state->wsize) { ++ zmemcpy(state->window, end - state->wsize, state->wsize); ++ state->wnext = 0; ++ state->whave = state->wsize; ++ } ++ else { ++ dist = state->wsize - state->wnext; ++ if (dist > copy) dist = copy; ++ zmemcpy(state->window + state->wnext, end - copy, dist); ++ copy -= dist; ++ if (copy) { ++ zmemcpy(state->window, end - copy, copy); ++ state->wnext = copy; ++ state->whave = state->wsize; ++ } ++ else { ++ state->wnext += dist; ++ if (state->wnext == state->wsize) state->wnext = 0; ++ if (state->whave < state->wsize) state->whave += dist; ++ } ++ } ++ return 0; ++} ++ ++/* Macros for inflate(): */ ++ ++/* check function to use adler32() for zlib or crc32() for gzip */ ++#ifdef GUNZIP ++# define UPDATE(check, buf, len) \ ++ (state->flags ? crc32(check, buf, len) : adler32(check, buf, len)) ++#else ++# define UPDATE(check, buf, len) adler32(check, buf, len) ++#endif ++ ++/* check macros for header crc */ ++#ifdef GUNZIP ++# define CRC2(check, word) \ ++ do { \ ++ hbuf[0] = (unsigned char)(word); \ ++ hbuf[1] = (unsigned char)((word) >> 8); \ ++ check = crc32(check, hbuf, 2); \ ++ } while (0) ++ ++# define CRC4(check, word) \ ++ do { \ ++ hbuf[0] = (unsigned char)(word); \ ++ hbuf[1] = (unsigned char)((word) >> 8); \ ++ hbuf[2] = (unsigned char)((word) >> 16); \ ++ hbuf[3] = (unsigned char)((word) >> 24); \ ++ check = crc32(check, hbuf, 4); \ ++ } while (0) ++#endif ++ ++/* Load registers with state in inflate() for speed */ ++#define LOAD() \ ++ do { \ ++ put = strm->next_out; \ ++ left = strm->avail_out; \ ++ next = strm->next_in; \ ++ have = strm->avail_in; \ ++ hold = state->hold; \ ++ bits = state->bits; \ ++ } while (0) ++ ++/* Restore state from registers in inflate() */ ++#define RESTORE() \ ++ do { \ ++ strm->next_out = put; \ ++ strm->avail_out = left; \ ++ strm->next_in = next; \ ++ strm->avail_in = have; \ ++ state->hold = hold; \ ++ state->bits = bits; \ ++ } while (0) ++ ++/* Clear the input bit accumulator */ ++#define INITBITS() \ ++ do { \ ++ hold = 0; \ ++ bits = 0; \ ++ } while (0) ++ ++/* Get a byte of input into the bit accumulator, or return from inflate() ++ if there is no input available. */ ++#define PULLBYTE() \ ++ do { \ ++ if (have == 0) goto inf_leave; \ ++ have--; \ ++ hold += (unsigned long)(*next++) << bits; \ ++ bits += 8; \ ++ } while (0) ++ ++/* Assure that there are at least n bits in the bit accumulator. If there is ++ not enough available input to do that, then return from inflate(). */ ++#define NEEDBITS(n) \ ++ do { \ ++ while (bits < (unsigned)(n)) \ ++ PULLBYTE(); \ ++ } while (0) ++ ++/* Return the low n bits of the bit accumulator (n < 16) */ ++#define BITS(n) \ ++ ((unsigned)hold & ((1U << (n)) - 1)) ++ ++/* Remove n bits from the bit accumulator */ ++#define DROPBITS(n) \ ++ do { \ ++ hold >>= (n); \ ++ bits -= (unsigned)(n); \ ++ } while (0) ++ ++/* Remove zero to seven bits as needed to go to a byte boundary */ ++#define BYTEBITS() \ ++ do { \ ++ hold >>= bits & 7; \ ++ bits -= bits & 7; \ ++ } while (0) ++ ++/* ++ inflate() uses a state machine to process as much input data and generate as ++ much output data as possible before returning. The state machine is ++ structured roughly as follows: ++ ++ for (;;) switch (state) { ++ ... ++ case STATEn: ++ if (not enough input data or output space to make progress) ++ return; ++ ... make progress ... ++ state = STATEm; ++ break; ++ ... ++ } ++ ++ so when inflate() is called again, the same case is attempted again, and ++ if the appropriate resources are provided, the machine proceeds to the ++ next state. The NEEDBITS() macro is usually the way the state evaluates ++ whether it can proceed or should return. NEEDBITS() does the return if ++ the requested bits are not available. The typical use of the BITS macros ++ is: ++ ++ NEEDBITS(n); ++ ... do something with BITS(n) ... ++ DROPBITS(n); ++ ++ where NEEDBITS(n) either returns from inflate() if there isn't enough ++ input left to load n bits into the accumulator, or it continues. BITS(n) ++ gives the low n bits in the accumulator. When done, DROPBITS(n) drops ++ the low n bits off the accumulator. INITBITS() clears the accumulator ++ and sets the number of available bits to zero. BYTEBITS() discards just ++ enough bits to put the accumulator on a byte boundary. After BYTEBITS() ++ and a NEEDBITS(8), then BITS(8) would return the next byte in the stream. ++ ++ NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return ++ if there is no input available. The decoding of variable length codes uses ++ PULLBYTE() directly in order to pull just enough bytes to decode the next ++ code, and no more. ++ ++ Some states loop until they get enough input, making sure that enough ++ state information is maintained to continue the loop where it left off ++ if NEEDBITS() returns in the loop. For example, want, need, and keep ++ would all have to actually be part of the saved state in case NEEDBITS() ++ returns: ++ ++ case STATEw: ++ while (want < need) { ++ NEEDBITS(n); ++ keep[want++] = BITS(n); ++ DROPBITS(n); ++ } ++ state = STATEx; ++ case STATEx: ++ ++ As shown above, if the next state is also the next case, then the break ++ is omitted. ++ ++ A state may also return if there is not enough output space available to ++ complete that state. Those states are copying stored data, writing a ++ literal byte, and copying a matching string. ++ ++ When returning, a "goto inf_leave" is used to update the total counters, ++ update the check value, and determine whether any progress has been made ++ during that inflate() call in order to return the proper return code. ++ Progress is defined as a change in either strm->avail_in or strm->avail_out. ++ When there is a window, goto inf_leave will update the window with the last ++ output written. If a goto inf_leave occurs in the middle of decompression ++ and there is no window currently, goto inf_leave will create one and copy ++ output to the window for the next call of inflate(). ++ ++ In this implementation, the flush parameter of inflate() only affects the ++ return code (per zlib.h). inflate() always writes as much as possible to ++ strm->next_out, given the space available and the provided input--the effect ++ documented in zlib.h of Z_SYNC_FLUSH. Furthermore, inflate() always defers ++ the allocation of and copying into a sliding window until necessary, which ++ provides the effect documented in zlib.h for Z_FINISH when the entire input ++ stream available. So the only thing the flush parameter actually does is: ++ when flush is set to Z_FINISH, inflate() cannot return Z_OK. Instead it ++ will return Z_BUF_ERROR if it has not reached the end of the stream. ++ */ ++ ++int ZEXPORT inflate(strm, flush) ++z_streamp strm; ++int flush; ++{ ++ struct inflate_state FAR *state; ++ z_const unsigned char FAR *next; /* next input */ ++ unsigned char FAR *put; /* next output */ ++ unsigned have, left; /* available input and output */ ++ unsigned long hold; /* bit buffer */ ++ unsigned bits; /* bits in bit buffer */ ++ unsigned in, out; /* save starting available input and output */ ++ unsigned copy; /* number of stored or match bytes to copy */ ++ unsigned char FAR *from; /* where to copy match bytes from */ ++ code here; /* current decoding table entry */ ++ code last; /* parent table entry */ ++ unsigned len; /* length to copy for repeats, bits to drop */ ++ int ret; /* return code */ ++#ifdef GUNZIP ++ unsigned char hbuf[4]; /* buffer for gzip header crc calculation */ ++#endif ++ static const unsigned short order[19] = /* permutation of code lengths */ ++ {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; ++ ++ if (inflateStateCheck(strm) || strm->next_out == Z_NULL || ++ (strm->next_in == Z_NULL && strm->avail_in != 0)) ++ return Z_STREAM_ERROR; ++ ++ state = (struct inflate_state FAR *)strm->state; ++ if (state->mode == TYPE) state->mode = TYPEDO; /* skip check */ ++ LOAD(); ++ in = have; ++ out = left; ++ ret = Z_OK; ++ for (;;) ++ switch (state->mode) { ++ case HEAD: ++ if (state->wrap == 0) { ++ state->mode = TYPEDO; ++ break; ++ } ++ NEEDBITS(16); ++#ifdef GUNZIP ++ if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */ ++ if (state->wbits == 0) ++ state->wbits = 15; ++ state->check = crc32(0L, Z_NULL, 0); ++ CRC2(state->check, hold); ++ INITBITS(); ++ state->mode = FLAGS; ++ break; ++ } ++ state->flags = 0; /* expect zlib header */ ++ if (state->head != Z_NULL) ++ state->head->done = -1; ++ if (!(state->wrap & 1) || /* check if zlib header allowed */ ++#else ++ if ( ++#endif ++ ((BITS(8) << 8) + (hold >> 8)) % 31) { ++ strm->msg = (char *)"incorrect header check"; ++ state->mode = BAD; ++ break; ++ } ++ if (BITS(4) != Z_DEFLATED) { ++ strm->msg = (char *)"unknown compression method"; ++ state->mode = BAD; ++ break; ++ } ++ DROPBITS(4); ++ len = BITS(4) + 8; ++ if (state->wbits == 0) ++ state->wbits = len; ++ if (len > 15 || len > state->wbits) { ++ strm->msg = (char *)"invalid window size"; ++ state->mode = BAD; ++ break; ++ } ++ state->dmax = 1U << len; ++ Tracev((stderr, "inflate: zlib header ok\n")); ++ strm->adler = state->check = adler32(0L, Z_NULL, 0); ++ state->mode = hold & 0x200 ? DICTID : TYPE; ++ INITBITS(); ++ break; ++#ifdef GUNZIP ++ case FLAGS: ++ NEEDBITS(16); ++ state->flags = (int)(hold); ++ if ((state->flags & 0xff) != Z_DEFLATED) { ++ strm->msg = (char *)"unknown compression method"; ++ state->mode = BAD; ++ break; ++ } ++ if (state->flags & 0xe000) { ++ strm->msg = (char *)"unknown header flags set"; ++ state->mode = BAD; ++ break; ++ } ++ if (state->head != Z_NULL) ++ state->head->text = (int)((hold >> 8) & 1); ++ if ((state->flags & 0x0200) && (state->wrap & 4)) ++ CRC2(state->check, hold); ++ INITBITS(); ++ state->mode = TIME; ++ case TIME: ++ NEEDBITS(32); ++ if (state->head != Z_NULL) ++ state->head->time = hold; ++ if ((state->flags & 0x0200) && (state->wrap & 4)) ++ CRC4(state->check, hold); ++ INITBITS(); ++ state->mode = OS; ++ case OS: ++ NEEDBITS(16); ++ if (state->head != Z_NULL) { ++ state->head->xflags = (int)(hold & 0xff); ++ state->head->os = (int)(hold >> 8); ++ } ++ if ((state->flags & 0x0200) && (state->wrap & 4)) ++ CRC2(state->check, hold); ++ INITBITS(); ++ state->mode = EXLEN; ++ case EXLEN: ++ if (state->flags & 0x0400) { ++ NEEDBITS(16); ++ state->length = (unsigned)(hold); ++ if (state->head != Z_NULL) ++ state->head->extra_len = (unsigned)hold; ++ if ((state->flags & 0x0200) && (state->wrap & 4)) ++ CRC2(state->check, hold); ++ INITBITS(); ++ } ++ else if (state->head != Z_NULL) ++ state->head->extra = Z_NULL; ++ state->mode = EXTRA; ++ case EXTRA: ++ if (state->flags & 0x0400) { ++ copy = state->length; ++ if (copy > have) copy = have; ++ if (copy) { ++ if (state->head != Z_NULL && ++ state->head->extra != Z_NULL) { ++ len = state->head->extra_len - state->length; ++ zmemcpy(state->head->extra + len, next, ++ len + copy > state->head->extra_max ? ++ state->head->extra_max - len : copy); ++ } ++ if ((state->flags & 0x0200) && (state->wrap & 4)) ++ state->check = crc32(state->check, next, copy); ++ have -= copy; ++ next += copy; ++ state->length -= copy; ++ } ++ if (state->length) goto inf_leave; ++ } ++ state->length = 0; ++ state->mode = NAME; ++ case NAME: ++ if (state->flags & 0x0800) { ++ if (have == 0) goto inf_leave; ++ copy = 0; ++ do { ++ len = (unsigned)(next[copy++]); ++ if (state->head != Z_NULL && ++ state->head->name != Z_NULL && ++ state->length < state->head->name_max) ++ state->head->name[state->length++] = (Bytef)len; ++ } while (len && copy < have); ++ if ((state->flags & 0x0200) && (state->wrap & 4)) ++ state->check = crc32(state->check, next, copy); ++ have -= copy; ++ next += copy; ++ if (len) goto inf_leave; ++ } ++ else if (state->head != Z_NULL) ++ state->head->name = Z_NULL; ++ state->length = 0; ++ state->mode = COMMENT; ++ case COMMENT: ++ if (state->flags & 0x1000) { ++ if (have == 0) goto inf_leave; ++ copy = 0; ++ do { ++ len = (unsigned)(next[copy++]); ++ if (state->head != Z_NULL && ++ state->head->comment != Z_NULL && ++ state->length < state->head->comm_max) ++ state->head->comment[state->length++] = (Bytef)len; ++ } while (len && copy < have); ++ if ((state->flags & 0x0200) && (state->wrap & 4)) ++ state->check = crc32(state->check, next, copy); ++ have -= copy; ++ next += copy; ++ if (len) goto inf_leave; ++ } ++ else if (state->head != Z_NULL) ++ state->head->comment = Z_NULL; ++ state->mode = HCRC; ++ case HCRC: ++ if (state->flags & 0x0200) { ++ NEEDBITS(16); ++ if ((state->wrap & 4) && hold != (state->check & 0xffff)) { ++ strm->msg = (char *)"header crc mismatch"; ++ state->mode = BAD; ++ break; ++ } ++ INITBITS(); ++ } ++ if (state->head != Z_NULL) { ++ state->head->hcrc = (int)((state->flags >> 9) & 1); ++ state->head->done = 1; ++ } ++ strm->adler = state->check = crc32(0L, Z_NULL, 0); ++ state->mode = TYPE; ++ break; ++#endif ++ case DICTID: ++ NEEDBITS(32); ++ strm->adler = state->check = ZSWAP32(hold); ++ INITBITS(); ++ state->mode = DICT; ++ case DICT: ++ if (state->havedict == 0) { ++ RESTORE(); ++ return Z_NEED_DICT; ++ } ++ strm->adler = state->check = adler32(0L, Z_NULL, 0); ++ state->mode = TYPE; ++ case TYPE: ++ if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave; ++ case TYPEDO: ++ if (state->last) { ++ BYTEBITS(); ++ state->mode = CHECK; ++ break; ++ } ++ NEEDBITS(3); ++ state->last = BITS(1); ++ DROPBITS(1); ++ switch (BITS(2)) { ++ case 0: /* stored block */ ++ Tracev((stderr, "inflate: stored block%s\n", ++ state->last ? " (last)" : "")); ++ state->mode = STORED; ++ break; ++ case 1: /* fixed block */ ++ fixedtables(state); ++ Tracev((stderr, "inflate: fixed codes block%s\n", ++ state->last ? " (last)" : "")); ++ state->mode = LEN_; /* decode codes */ ++ if (flush == Z_TREES) { ++ DROPBITS(2); ++ goto inf_leave; ++ } ++ break; ++ case 2: /* dynamic block */ ++ Tracev((stderr, "inflate: dynamic codes block%s\n", ++ state->last ? " (last)" : "")); ++ state->mode = TABLE; ++ break; ++ case 3: ++ strm->msg = (char *)"invalid block type"; ++ state->mode = BAD; ++ } ++ DROPBITS(2); ++ break; ++ case STORED: ++ BYTEBITS(); /* go to byte boundary */ ++ NEEDBITS(32); ++ if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { ++ strm->msg = (char *)"invalid stored block lengths"; ++ state->mode = BAD; ++ break; ++ } ++ state->length = (unsigned)hold & 0xffff; ++ Tracev((stderr, "inflate: stored length %u\n", ++ state->length)); ++ INITBITS(); ++ state->mode = COPY_; ++ if (flush == Z_TREES) goto inf_leave; ++ case COPY_: ++ state->mode = COPY; ++ case COPY: ++ copy = state->length; ++ if (copy) { ++ if (copy > have) copy = have; ++ if (copy > left) copy = left; ++ if (copy == 0) goto inf_leave; ++ zmemcpy(put, next, copy); ++ have -= copy; ++ next += copy; ++ left -= copy; ++ put += copy; ++ state->length -= copy; ++ break; ++ } ++ Tracev((stderr, "inflate: stored end\n")); ++ state->mode = TYPE; ++ break; ++ case TABLE: ++ NEEDBITS(14); ++ state->nlen = BITS(5) + 257; ++ DROPBITS(5); ++ state->ndist = BITS(5) + 1; ++ DROPBITS(5); ++ state->ncode = BITS(4) + 4; ++ DROPBITS(4); ++#ifndef PKZIP_BUG_WORKAROUND ++ if (state->nlen > 286 || state->ndist > 30) { ++ strm->msg = (char *)"too many length or distance symbols"; ++ state->mode = BAD; ++ break; ++ } ++#endif ++ Tracev((stderr, "inflate: table sizes ok\n")); ++ state->have = 0; ++ state->mode = LENLENS; ++ case LENLENS: ++ while (state->have < state->ncode) { ++ NEEDBITS(3); ++ state->lens[order[state->have++]] = (unsigned short)BITS(3); ++ DROPBITS(3); ++ } ++ while (state->have < 19) ++ state->lens[order[state->have++]] = 0; ++ state->next = state->codes; ++ state->lencode = (const code FAR *)(state->next); ++ state->lenbits = 7; ++ ret = inflate_table(CODES, state->lens, 19, &(state->next), ++ &(state->lenbits), state->work); ++ if (ret) { ++ strm->msg = (char *)"invalid code lengths set"; ++ state->mode = BAD; ++ break; ++ } ++ Tracev((stderr, "inflate: code lengths ok\n")); ++ state->have = 0; ++ state->mode = CODELENS; ++ case CODELENS: ++ while (state->have < state->nlen + state->ndist) { ++ for (;;) { ++ here = state->lencode[BITS(state->lenbits)]; ++ if ((unsigned)(here.bits) <= bits) break; ++ PULLBYTE(); ++ } ++ if (here.val < 16) { ++ DROPBITS(here.bits); ++ state->lens[state->have++] = here.val; ++ } ++ else { ++ if (here.val == 16) { ++ NEEDBITS(here.bits + 2); ++ DROPBITS(here.bits); ++ if (state->have == 0) { ++ strm->msg = (char *)"invalid bit length repeat"; ++ state->mode = BAD; ++ break; ++ } ++ len = state->lens[state->have - 1]; ++ copy = 3 + BITS(2); ++ DROPBITS(2); ++ } ++ else if (here.val == 17) { ++ NEEDBITS(here.bits + 3); ++ DROPBITS(here.bits); ++ len = 0; ++ copy = 3 + BITS(3); ++ DROPBITS(3); ++ } ++ else { ++ NEEDBITS(here.bits + 7); ++ DROPBITS(here.bits); ++ len = 0; ++ copy = 11 + BITS(7); ++ DROPBITS(7); ++ } ++ if (state->have + copy > state->nlen + state->ndist) { ++ strm->msg = (char *)"invalid bit length repeat"; ++ state->mode = BAD; ++ break; ++ } ++ while (copy--) ++ state->lens[state->have++] = (unsigned short)len; ++ } ++ } ++ ++ /* handle error breaks in while */ ++ if (state->mode == BAD) break; ++ ++ /* check for end-of-block code (better have one) */ ++ if (state->lens[256] == 0) { ++ strm->msg = (char *)"invalid code -- missing end-of-block"; ++ state->mode = BAD; ++ break; ++ } ++ ++ /* build code tables -- note: do not change the lenbits or distbits ++ values here (9 and 6) without reading the comments in inftrees.h ++ concerning the ENOUGH constants, which depend on those values */ ++ state->next = state->codes; ++ state->lencode = (const code FAR *)(state->next); ++ state->lenbits = 9; ++ ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), ++ &(state->lenbits), state->work); ++ if (ret) { ++ strm->msg = (char *)"invalid literal/lengths set"; ++ state->mode = BAD; ++ break; ++ } ++ state->distcode = (const code FAR *)(state->next); ++ state->distbits = 6; ++ ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, ++ &(state->next), &(state->distbits), state->work); ++ if (ret) { ++ strm->msg = (char *)"invalid distances set"; ++ state->mode = BAD; ++ break; ++ } ++ Tracev((stderr, "inflate: codes ok\n")); ++ state->mode = LEN_; ++ if (flush == Z_TREES) goto inf_leave; ++ case LEN_: ++ state->mode = LEN; ++ case LEN: ++ if (have >= 6 && left >= 258) { ++ RESTORE(); ++ inflate_fast(strm, out); ++ LOAD(); ++ if (state->mode == TYPE) ++ state->back = -1; ++ break; ++ } ++ state->back = 0; ++ for (;;) { ++ here = state->lencode[BITS(state->lenbits)]; ++ if ((unsigned)(here.bits) <= bits) break; ++ PULLBYTE(); ++ } ++ if (here.op && (here.op & 0xf0) == 0) { ++ last = here; ++ for (;;) { ++ here = state->lencode[last.val + ++ (BITS(last.bits + last.op) >> last.bits)]; ++ if ((unsigned)(last.bits + here.bits) <= bits) break; ++ PULLBYTE(); ++ } ++ DROPBITS(last.bits); ++ state->back += last.bits; ++ } ++ DROPBITS(here.bits); ++ state->back += here.bits; ++ state->length = (unsigned)here.val; ++ if ((int)(here.op) == 0) { ++ Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? ++ "inflate: literal '%c'\n" : ++ "inflate: literal 0x%02x\n", here.val)); ++ state->mode = LIT; ++ break; ++ } ++ if (here.op & 32) { ++ Tracevv((stderr, "inflate: end of block\n")); ++ state->back = -1; ++ state->mode = TYPE; ++ break; ++ } ++ if (here.op & 64) { ++ strm->msg = (char *)"invalid literal/length code"; ++ state->mode = BAD; ++ break; ++ } ++ state->extra = (unsigned)(here.op) & 15; ++ state->mode = LENEXT; ++ case LENEXT: ++ if (state->extra) { ++ NEEDBITS(state->extra); ++ state->length += BITS(state->extra); ++ DROPBITS(state->extra); ++ state->back += state->extra; ++ } ++ Tracevv((stderr, "inflate: length %u\n", state->length)); ++ state->was = state->length; ++ state->mode = DIST; ++ case DIST: ++ for (;;) { ++ here = state->distcode[BITS(state->distbits)]; ++ if ((unsigned)(here.bits) <= bits) break; ++ PULLBYTE(); ++ } ++ if ((here.op & 0xf0) == 0) { ++ last = here; ++ for (;;) { ++ here = state->distcode[last.val + ++ (BITS(last.bits + last.op) >> last.bits)]; ++ if ((unsigned)(last.bits + here.bits) <= bits) break; ++ PULLBYTE(); ++ } ++ DROPBITS(last.bits); ++ state->back += last.bits; ++ } ++ DROPBITS(here.bits); ++ state->back += here.bits; ++ if (here.op & 64) { ++ strm->msg = (char *)"invalid distance code"; ++ state->mode = BAD; ++ break; ++ } ++ state->offset = (unsigned)here.val; ++ state->extra = (unsigned)(here.op) & 15; ++ state->mode = DISTEXT; ++ case DISTEXT: ++ if (state->extra) { ++ NEEDBITS(state->extra); ++ state->offset += BITS(state->extra); ++ DROPBITS(state->extra); ++ state->back += state->extra; ++ } ++#ifdef INFLATE_STRICT ++ if (state->offset > state->dmax) { ++ strm->msg = (char *)"invalid distance too far back"; ++ state->mode = BAD; ++ break; ++ } ++#endif ++ Tracevv((stderr, "inflate: distance %u\n", state->offset)); ++ state->mode = MATCH; ++ case MATCH: ++ if (left == 0) goto inf_leave; ++ copy = out - left; ++ if (state->offset > copy) { /* copy from window */ ++ copy = state->offset - copy; ++ if (copy > state->whave) { ++ if (state->sane) { ++ strm->msg = (char *)"invalid distance too far back"; ++ state->mode = BAD; ++ break; ++ } ++#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR ++ Trace((stderr, "inflate.c too far\n")); ++ copy -= state->whave; ++ if (copy > state->length) copy = state->length; ++ if (copy > left) copy = left; ++ left -= copy; ++ state->length -= copy; ++ do { ++ *put++ = 0; ++ } while (--copy); ++ if (state->length == 0) state->mode = LEN; ++ break; ++#endif ++ } ++ if (copy > state->wnext) { ++ copy -= state->wnext; ++ from = state->window + (state->wsize - copy); ++ } ++ else ++ from = state->window + (state->wnext - copy); ++ if (copy > state->length) copy = state->length; ++ } ++ else { /* copy from output */ ++ from = put - state->offset; ++ copy = state->length; ++ } ++ if (copy > left) copy = left; ++ left -= copy; ++ state->length -= copy; ++ do { ++ *put++ = *from++; ++ } while (--copy); ++ if (state->length == 0) state->mode = LEN; ++ break; ++ case LIT: ++ if (left == 0) goto inf_leave; ++ *put++ = (unsigned char)(state->length); ++ left--; ++ state->mode = LEN; ++ break; ++ case CHECK: ++ if (state->wrap) { ++ NEEDBITS(32); ++ out -= left; ++ strm->total_out += out; ++ state->total += out; ++ if ((state->wrap & 4) && out) ++ strm->adler = state->check = ++ UPDATE(state->check, put - out, out); ++ out = left; ++ if ((state->wrap & 4) && ( ++#ifdef GUNZIP ++ state->flags ? hold : ++#endif ++ ZSWAP32(hold)) != state->check) { ++ strm->msg = (char *)"incorrect data check"; ++ state->mode = BAD; ++ break; ++ } ++ INITBITS(); ++ Tracev((stderr, "inflate: check matches trailer\n")); ++ } ++#ifdef GUNZIP ++ state->mode = LENGTH; ++ case LENGTH: ++ if (state->wrap && state->flags) { ++ NEEDBITS(32); ++ if (hold != (state->total & 0xffffffffUL)) { ++ strm->msg = (char *)"incorrect length check"; ++ state->mode = BAD; ++ break; ++ } ++ INITBITS(); ++ Tracev((stderr, "inflate: length matches trailer\n")); ++ } ++#endif ++ state->mode = DONE; ++ case DONE: ++ ret = Z_STREAM_END; ++ goto inf_leave; ++ case BAD: ++ ret = Z_DATA_ERROR; ++ goto inf_leave; ++ case MEM: ++ return Z_MEM_ERROR; ++ case SYNC: ++ default: ++ return Z_STREAM_ERROR; ++ } ++ ++ /* ++ Return from inflate(), updating the total counts and the check value. ++ If there was no progress during the inflate() call, return a buffer ++ error. Call updatewindow() to create and/or update the window state. ++ Note: a memory error from inflate() is non-recoverable. ++ */ ++ inf_leave: ++ RESTORE(); ++ if (state->wsize || (out != strm->avail_out && state->mode < BAD && ++ (state->mode < CHECK || flush != Z_FINISH))) ++ if (updatewindow(strm, strm->next_out, out - strm->avail_out)) { ++ state->mode = MEM; ++ return Z_MEM_ERROR; ++ } ++ in -= strm->avail_in; ++ out -= strm->avail_out; ++ strm->total_in += in; ++ strm->total_out += out; ++ state->total += out; ++ if ((state->wrap & 4) && out) ++ strm->adler = state->check = ++ UPDATE(state->check, strm->next_out - out, out); ++ strm->data_type = (int)state->bits + (state->last ? 64 : 0) + ++ (state->mode == TYPE ? 128 : 0) + ++ (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0); ++ if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) ++ ret = Z_BUF_ERROR; ++ return ret; ++} ++ ++int ZEXPORT inflateEnd(strm) ++z_streamp strm; ++{ ++ struct inflate_state FAR *state; ++ if (inflateStateCheck(strm)) ++ return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ if (state->window != Z_NULL) ZFREE(strm, state->window); ++ ZFREE(strm, strm->state); ++ strm->state = Z_NULL; ++ Tracev((stderr, "inflate: end\n")); ++ return Z_OK; ++} ++ ++int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength) ++z_streamp strm; ++Bytef *dictionary; ++uInt *dictLength; ++{ ++ struct inflate_state FAR *state; ++ ++ /* check state */ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ ++ /* copy dictionary */ ++ if (state->whave && dictionary != Z_NULL) { ++ zmemcpy(dictionary, state->window + state->wnext, ++ state->whave - state->wnext); ++ zmemcpy(dictionary + state->whave - state->wnext, ++ state->window, state->wnext); ++ } ++ if (dictLength != Z_NULL) ++ *dictLength = state->whave; ++ return Z_OK; ++} ++ ++int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) ++z_streamp strm; ++const Bytef *dictionary; ++uInt dictLength; ++{ ++ struct inflate_state FAR *state; ++ unsigned long dictid; ++ int ret; ++ ++ /* check state */ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ if (state->wrap != 0 && state->mode != DICT) ++ return Z_STREAM_ERROR; ++ ++ /* check for correct dictionary identifier */ ++ if (state->mode == DICT) { ++ dictid = adler32(0L, Z_NULL, 0); ++ dictid = adler32(dictid, dictionary, dictLength); ++ if (dictid != state->check) ++ return Z_DATA_ERROR; ++ } ++ ++ /* copy dictionary to window using updatewindow(), which will amend the ++ existing dictionary if appropriate */ ++ ret = updatewindow(strm, dictionary + dictLength, dictLength); ++ if (ret) { ++ state->mode = MEM; ++ return Z_MEM_ERROR; ++ } ++ state->havedict = 1; ++ Tracev((stderr, "inflate: dictionary set\n")); ++ return Z_OK; ++} ++ ++int ZEXPORT inflateGetHeader(strm, head) ++z_streamp strm; ++gz_headerp head; ++{ ++ struct inflate_state FAR *state; ++ ++ /* check state */ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ if ((state->wrap & 2) == 0) return Z_STREAM_ERROR; ++ ++ /* save header structure */ ++ state->head = head; ++ head->done = 0; ++ return Z_OK; ++} ++ ++/* ++ Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff. Return when found ++ or when out of input. When called, *have is the number of pattern bytes ++ found in order so far, in 0..3. On return *have is updated to the new ++ state. If on return *have equals four, then the pattern was found and the ++ return value is how many bytes were read including the last byte of the ++ pattern. If *have is less than four, then the pattern has not been found ++ yet and the return value is len. In the latter case, syncsearch() can be ++ called again with more data and the *have state. *have is initialized to ++ zero for the first call. ++ */ ++local unsigned syncsearch(have, buf, len) ++unsigned FAR *have; ++const unsigned char FAR *buf; ++unsigned len; ++{ ++ unsigned got; ++ unsigned next; ++ ++ got = *have; ++ next = 0; ++ while (next < len && got < 4) { ++ if ((int)(buf[next]) == (got < 2 ? 0 : 0xff)) ++ got++; ++ else if (buf[next]) ++ got = 0; ++ else ++ got = 4 - got; ++ next++; ++ } ++ *have = got; ++ return next; ++} ++ ++int ZEXPORT inflateSync(strm) ++z_streamp strm; ++{ ++ unsigned len; /* number of bytes to look at or looked at */ ++ unsigned long in, out; /* temporary to save total_in and total_out */ ++ unsigned char buf[4]; /* to restore bit buffer to byte string */ ++ struct inflate_state FAR *state; ++ ++ /* check parameters */ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR; ++ ++ /* if first time, start search in bit buffer */ ++ if (state->mode != SYNC) { ++ state->mode = SYNC; ++ state->hold <<= state->bits & 7; ++ state->bits -= state->bits & 7; ++ len = 0; ++ while (state->bits >= 8) { ++ buf[len++] = (unsigned char)(state->hold); ++ state->hold >>= 8; ++ state->bits -= 8; ++ } ++ state->have = 0; ++ syncsearch(&(state->have), buf, len); ++ } ++ ++ /* search available input */ ++ len = syncsearch(&(state->have), strm->next_in, strm->avail_in); ++ strm->avail_in -= len; ++ strm->next_in += len; ++ strm->total_in += len; ++ ++ /* return no joy or set up to restart inflate() on a new block */ ++ if (state->have != 4) return Z_DATA_ERROR; ++ in = strm->total_in; out = strm->total_out; ++ inflateReset(strm); ++ strm->total_in = in; strm->total_out = out; ++ state->mode = TYPE; ++ return Z_OK; ++} ++ ++/* ++ Returns true if inflate is currently at the end of a block generated by ++ Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP ++ implementation to provide an additional safety check. PPP uses ++ Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored ++ block. When decompressing, PPP checks that at the end of input packet, ++ inflate is waiting for these length bytes. ++ */ ++int ZEXPORT inflateSyncPoint(strm) ++z_streamp strm; ++{ ++ struct inflate_state FAR *state; ++ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ return state->mode == STORED && state->bits == 0; ++} ++ ++int ZEXPORT inflateCopy(dest, source) ++z_streamp dest; ++z_streamp source; ++{ ++ struct inflate_state FAR *state; ++ struct inflate_state FAR *copy; ++ unsigned char FAR *window; ++ unsigned wsize; ++ ++ /* check input */ ++ if (inflateStateCheck(source) || dest == Z_NULL) ++ return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)source->state; ++ ++ /* allocate space */ ++ copy = (struct inflate_state FAR *) ++ ZALLOC(source, 1, sizeof(struct inflate_state)); ++ if (copy == Z_NULL) return Z_MEM_ERROR; ++ window = Z_NULL; ++ if (state->window != Z_NULL) { ++ window = (unsigned char FAR *) ++ ZALLOC(source, 1U << state->wbits, sizeof(unsigned char)); ++ if (window == Z_NULL) { ++ ZFREE(source, copy); ++ return Z_MEM_ERROR; ++ } ++ } ++ ++ /* copy state */ ++ zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream)); ++ zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state)); ++ copy->strm = dest; ++ if (state->lencode >= state->codes && ++ state->lencode <= state->codes + ENOUGH - 1) { ++ copy->lencode = copy->codes + (state->lencode - state->codes); ++ copy->distcode = copy->codes + (state->distcode - state->codes); ++ } ++ copy->next = copy->codes + (state->next - state->codes); ++ if (window != Z_NULL) { ++ wsize = 1U << state->wbits; ++ zmemcpy(window, state->window, wsize); ++ } ++ copy->window = window; ++ dest->state = (struct internal_state FAR *)copy; ++ return Z_OK; ++} ++ ++int ZEXPORT inflateUndermine(strm, subvert) ++z_streamp strm; ++int subvert; ++{ ++ struct inflate_state FAR *state; ++ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR ++ state->sane = !subvert; ++ return Z_OK; ++#else ++ (void)subvert; ++ state->sane = 1; ++ return Z_DATA_ERROR; ++#endif ++} ++ ++int ZEXPORT inflateValidate(strm, check) ++z_streamp strm; ++int check; ++{ ++ struct inflate_state FAR *state; ++ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ if (check) ++ state->wrap |= 4; ++ else ++ state->wrap &= ~4; ++ return Z_OK; ++} ++ ++long ZEXPORT inflateMark(strm) ++z_streamp strm; ++{ ++ struct inflate_state FAR *state; ++ ++ if (inflateStateCheck(strm)) ++ return -(1L << 16); ++ state = (struct inflate_state FAR *)strm->state; ++ return (long)(((unsigned long)((long)state->back)) << 16) + ++ (state->mode == COPY ? state->length : ++ (state->mode == MATCH ? state->was - state->length : 0)); ++} ++ ++unsigned long ZEXPORT inflateCodesUsed(strm) ++z_streamp strm; ++{ ++ struct inflate_state FAR *state; ++ if (inflateStateCheck(strm)) return (unsigned long)-1; ++ state = (struct inflate_state FAR *)strm->state; ++ return (unsigned long)(state->next - state->codes); ++} + +From 247147654fe5cd11cf15d8dff91440405ea57040 Mon Sep 17 00:00:00 2001 +From: Simon Hosie +Date: Wed, 12 Apr 2017 15:44:21 -0700 +Subject: [PATCH 2/2] Inflate using wider loads and stores + +In inflate_fast() the output pointer always has plenty of room to write. This +means that so long as the target is capable, wide un-aligned loads and stores +can be used to transfer several bytes at once. When the reference distance is +too short simply unroll the data a little to increase the distance. + +Change-Id: I59854eb25d2b1e43561c8a2afaf9175bf10cf674 +--- + contrib/arm/chunkcopy.h | 279 ++++++++++++++++++++++++++++++++++++++++++++++++ + contrib/arm/inffast.c | 96 +++++++---------- + contrib/arm/inflate.c | 22 ++-- + 3 files changed, 335 insertions(+), 62 deletions(-) + create mode 100644 contrib/arm/chunkcopy.h + +diff --git a/contrib/arm/chunkcopy.h b/contrib/arm/chunkcopy.h +new file mode 100644 +index 00000000..2d6fd6f9 +--- /dev/null ++++ b/contrib/arm/chunkcopy.h +@@ -0,0 +1,279 @@ ++/* chunkcopy.h -- fast copies and sets ++ * Copyright (C) 2017 ARM, Inc. ++ * For conditions of distribution and use, see copyright notice in zlib.h ++ */ ++ ++#ifndef CHUNKCOPY_H ++#define CHUNKCOPY_H ++ ++#include "zutil.h" ++#include ++ ++#if __STDC_VERSION__ >= 199901L ++#define Z_RESTRICT restrict ++#else ++#define Z_RESTRICT ++#endif ++ ++typedef uint8x16_t chunkcopy_chunk_t; ++#define CHUNKCOPY_CHUNK_SIZE sizeof(chunkcopy_chunk_t) ++ ++/* ++ Ask the compiler to perform a wide, unaligned load with an machine ++ instruction appropriate for the chunkcopy_chunk_t type. ++ */ ++static inline chunkcopy_chunk_t loadchunk(const unsigned char FAR *s) { ++ chunkcopy_chunk_t c; ++ __builtin_memcpy(&c, s, sizeof(c)); ++ return c; ++} ++ ++/* ++ Ask the compiler to perform a wide, unaligned store with an machine ++ instruction appropriate for the chunkcopy_chunk_t type. ++ */ ++static inline void storechunk(unsigned char FAR *d, chunkcopy_chunk_t c) { ++ __builtin_memcpy(d, &c, sizeof(c)); ++} ++ ++/* ++ Perform a memcpy-like operation, but assume that length is non-zero and that ++ it's OK to overwrite at least CHUNKCOPY_CHUNK_SIZE bytes of output even if ++ the length is shorter than this. ++ ++ It also guarantees that it will properly unroll the data if the distance ++ between `out` and `from` is at least CHUNKCOPY_CHUNK_SIZE, which we rely on ++ in chunkcopy_relaxed(). ++ ++ Aside from better memory bus utilisation, this means that short copies ++ (CHUNKCOPY_CHUNK_SIZE bytes or fewer) will fall straight through the loop ++ without iteration, which will hopefully make the branch prediction more ++ reliable. ++ */ ++static inline unsigned char FAR *chunkcopy_core(unsigned char FAR *out, ++ const unsigned char FAR *from, ++ unsigned len) { ++ int bump = (--len % CHUNKCOPY_CHUNK_SIZE) + 1; ++ storechunk(out, loadchunk(from)); ++ out += bump; ++ from += bump; ++ len /= CHUNKCOPY_CHUNK_SIZE; ++ while (len-- > 0) { ++ storechunk(out, loadchunk(from)); ++ out += CHUNKCOPY_CHUNK_SIZE; ++ from += CHUNKCOPY_CHUNK_SIZE; ++ } ++ return out; ++} ++ ++/* ++ Like chunkcopy_core, but avoid writing beyond of legal output. ++ ++ Accepts an additional pointer to the end of safe output. A generic safe ++ copy would use (out + len), but it's normally the case that the end of the ++ output buffer is beyond the end of the current copy, and this can still be ++ exploited. ++ */ ++static inline unsigned char FAR *chunkcopy_core_safe(unsigned char FAR *out, ++ const unsigned char FAR * from, ++ unsigned len, ++ unsigned char FAR *limit) { ++ Assert(out + len <= limit, "chunk copy exceeds safety limit"); ++ if (limit - out < CHUNKCOPY_CHUNK_SIZE) { ++ const unsigned char FAR * Z_RESTRICT rfrom = from; ++ if (len & 8) { __builtin_memcpy(out, rfrom, 8); out += 8; rfrom += 8; } ++ if (len & 4) { __builtin_memcpy(out, rfrom, 4); out += 4; rfrom += 4; } ++ if (len & 2) { __builtin_memcpy(out, rfrom, 2); out += 2; rfrom += 2; } ++ if (len & 1) { *out++ = *rfrom++; } ++ return out; ++ } ++ return chunkcopy_core(out, from, len); ++} ++ ++/* ++ Perform short copies until distance can be rewritten as being at least ++ CHUNKCOPY_CHUNK_SIZE. ++ ++ This assumes that it's OK to overwrite at least the first ++ 2*CHUNKCOPY_CHUNK_SIZE bytes of output even if the copy is shorter than ++ this. This assumption holds within inflate_fast() which starts every ++ iteration with at least 258 bytes of output space available (258 being the ++ maximum length output from a single token; see inffast.c). ++ */ ++static inline unsigned char FAR *chunkunroll_relaxed(unsigned char FAR *out, ++ unsigned FAR *dist, ++ unsigned FAR *len) { ++ const unsigned char FAR *from = out - *dist; ++ while (*dist < *len && *dist < CHUNKCOPY_CHUNK_SIZE) { ++ storechunk(out, loadchunk(from)); ++ out += *dist; ++ *len -= *dist; ++ *dist += *dist; ++ } ++ return out; ++} ++ ++ ++static inline uint8x16_t chunkset_vld1q_dup_u8x8(const unsigned char FAR * Z_RESTRICT from) { ++#if defined(__clang__) || defined(__aarch64__) ++ return vreinterpretq_u8_u64(vld1q_dup_u64((void *)from)); ++#else ++ /* 32-bit GCC uses an alignment hint for vld1q_dup_u64, even when given a ++ * void pointer, so here's an alternate implementation. ++ */ ++ uint8x8_t h = vld1_u8(from); ++ return vcombine_u8(h, h); ++#endif ++} ++ ++/* ++ Perform an overlapping copy which behaves as a memset() operation, but ++ supporting periods other than one, and assume that length is non-zero and ++ that it's OK to overwrite at least CHUNKCOPY_CHUNK_SIZE*3 bytes of output ++ even if the length is shorter than this. ++ */ ++static inline unsigned char FAR *chunkset_core(unsigned char FAR *out, ++ unsigned period, ++ unsigned len) { ++ uint8x16_t f; ++ int bump = ((len - 1) % sizeof(f)) + 1; ++ ++ switch (period) { ++ case 1: ++ f = vld1q_dup_u8(out - 1); ++ vst1q_u8(out, f); ++ out += bump; ++ len -= bump; ++ while (len > 0) { ++ vst1q_u8(out, f); ++ out += sizeof(f); ++ len -= sizeof(f); ++ } ++ return out; ++ case 2: ++ f = vreinterpretq_u8_u16(vld1q_dup_u16((void *)(out - 2))); ++ vst1q_u8(out, f); ++ out += bump; ++ len -= bump; ++ if (len > 0) { ++ f = vreinterpretq_u8_u16(vld1q_dup_u16((void *)(out - 2))); ++ do { ++ vst1q_u8(out, f); ++ out += sizeof(f); ++ len -= sizeof(f); ++ } while (len > 0); ++ } ++ return out; ++ case 4: ++ f = vreinterpretq_u8_u32(vld1q_dup_u32((void *)(out - 4))); ++ vst1q_u8(out, f); ++ out += bump; ++ len -= bump; ++ if (len > 0) { ++ f = vreinterpretq_u8_u32(vld1q_dup_u32((void *)(out - 4))); ++ do { ++ vst1q_u8(out, f); ++ out += sizeof(f); ++ len -= sizeof(f); ++ } while (len > 0); ++ } ++ return out; ++ case 8: ++ f = chunkset_vld1q_dup_u8x8(out - 8); ++ vst1q_u8(out, f); ++ out += bump; ++ len -= bump; ++ if (len > 0) { ++ f = chunkset_vld1q_dup_u8x8(out - 8); ++ do { ++ vst1q_u8(out, f); ++ out += sizeof(f); ++ len -= sizeof(f); ++ } while (len > 0); ++ } ++ return out; ++ } ++ out = chunkunroll_relaxed(out, &period, &len); ++ return chunkcopy_core(out, out - period, len); ++} ++ ++/* ++ Perform a memcpy-like operation, but assume that length is non-zero and that ++ it's OK to overwrite at least CHUNKCOPY_CHUNK_SIZE bytes of output even if ++ the length is shorter than this. ++ ++ Unlike chunkcopy_core() above, no guarantee is made regarding the behaviour ++ of overlapping buffers, regardless of the distance between the pointers. ++ This is reflected in the `restrict`-qualified pointers, allowing the ++ compiler to reorder loads and stores. ++ */ ++static inline unsigned char FAR *chunkcopy_relaxed(unsigned char FAR * Z_RESTRICT out, ++ const unsigned char FAR * Z_RESTRICT from, ++ unsigned len) { ++ return chunkcopy_core(out, from, len); ++} ++ ++/* ++ Like chunkcopy_relaxed, but avoid writing beyond of legal output. ++ ++ Unlike chunkcopy_core_safe() above, no guarantee is made regarding the ++ behaviour of overlapping buffers, regardless of the distance between the ++ pointers. This is reflected in the `restrict`-qualified pointers, allowing ++ the compiler to reorder loads and stores. ++ ++ Accepts an additional pointer to the end of safe output. A generic safe ++ copy would use (out + len), but it's normally the case that the end of the ++ output buffer is beyond the end of the current copy, and this can still be ++ exploited. ++ */ ++static inline unsigned char FAR *chunkcopy_safe(unsigned char FAR *out, ++ const unsigned char FAR * Z_RESTRICT from, ++ unsigned len, ++ unsigned char FAR *limit) { ++ Assert(out + len <= limit, "chunk copy exceeds safety limit"); ++ return chunkcopy_core_safe(out, from, len, limit); ++} ++ ++/* ++ Perform chunky copy within the same buffer, where the source and destination ++ may potentially overlap. ++ ++ Assumes that len > 0 on entry, and that it's safe to write at least ++ CHUNKCOPY_CHUNK_SIZE*3 bytes to the output. ++ */ ++static inline unsigned char FAR *chunkcopy_lapped_relaxed(unsigned char FAR *out, ++ unsigned dist, ++ unsigned len) { ++ if (dist < len && dist < CHUNKCOPY_CHUNK_SIZE) { ++ return chunkset_core(out, dist, len); ++ } ++ return chunkcopy_core(out, out - dist, len); ++} ++ ++/* ++ Behave like chunkcopy_lapped_relaxed, but avoid writing beyond of legal output. ++ ++ Accepts an additional pointer to the end of safe output. A generic safe ++ copy would use (out + len), but it's normally the case that the end of the ++ output buffer is beyond the end of the current copy, and this can still be ++ exploited. ++ */ ++static inline unsigned char FAR *chunkcopy_lapped_safe(unsigned char FAR *out, ++ unsigned dist, ++ unsigned len, ++ unsigned char FAR *limit) { ++ Assert(out + len <= limit, "chunk copy exceeds safety limit"); ++ if (limit - out < CHUNKCOPY_CHUNK_SIZE * 3) { ++ /* TODO: try harder to optimise this */ ++ while (len-- > 0) { ++ *out = *(out - dist); ++ out++; ++ } ++ return out; ++ } ++ return chunkcopy_lapped_relaxed(out, dist, len); ++} ++ ++#undef Z_RESTRICT ++ ++#endif /* CHUNKCOPY_H */ +diff --git a/contrib/arm/inffast.c b/contrib/arm/inffast.c +index 0dbd1dbc..f7f50071 100644 +--- a/contrib/arm/inffast.c ++++ b/contrib/arm/inffast.c +@@ -7,6 +7,7 @@ + #include "inftrees.h" + #include "inflate.h" + #include "inffast.h" ++#include "chunkcopy.h" + + #ifdef ASMINF + # pragma message("Assembler code may have bugs -- use at your own risk") +@@ -57,6 +58,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ + unsigned char FAR *out; /* local strm->next_out */ + unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ + unsigned char FAR *end; /* while out < end, enough space available */ ++ unsigned char FAR *limit; /* safety limit for chunky copies */ + #ifdef INFLATE_STRICT + unsigned dmax; /* maximum distance from zlib header */ + #endif +@@ -84,12 +86,13 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ + out = strm->next_out; + beg = out - (start - strm->avail_out); + end = out + (strm->avail_out - 257); ++ limit = out + strm->avail_out; + #ifdef INFLATE_STRICT + dmax = state->dmax; + #endif + wsize = state->wsize; + whave = state->whave; +- wnext = state->wnext; ++ wnext = (state->wnext == 0 && whave >= wsize) ? wsize : state->wnext; + window = state->window; + hold = state->hold; + bits = state->bits; +@@ -197,70 +200,51 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ + #endif + } + from = window; +- if (wnext == 0) { /* very common case */ +- from += wsize - op; +- if (op < len) { /* some from window */ +- len -= op; +- do { +- *out++ = *from++; +- } while (--op); +- from = out - dist; /* rest from output */ +- } ++ if (wnext >= op) { /* contiguous in window */ ++ from += wnext - op; + } +- else if (wnext < op) { /* wrap around window */ +- from += wsize + wnext - op; ++ else { /* wrap around window */ + op -= wnext; ++ from += wsize - op; + if (op < len) { /* some from end of window */ + len -= op; +- do { +- *out++ = *from++; +- } while (--op); +- from = window; +- if (wnext < len) { /* some from start of window */ +- op = wnext; +- len -= op; +- do { +- *out++ = *from++; +- } while (--op); +- from = out - dist; /* rest from output */ +- } ++ out = chunkcopy_safe(out, from, op, limit); ++ from = window; /* more from start of window */ ++ op = wnext; ++ /* This (rare) case can create a situation where ++ the first chunkcopy below must be checked. ++ */ + } + } +- else { /* contiguous in window */ +- from += wnext - op; +- if (op < len) { /* some from window */ +- len -= op; +- do { +- *out++ = *from++; +- } while (--op); +- from = out - dist; /* rest from output */ +- } +- } +- while (len > 2) { +- *out++ = *from++; +- *out++ = *from++; +- *out++ = *from++; +- len -= 3; +- } +- if (len) { +- *out++ = *from++; +- if (len > 1) +- *out++ = *from++; ++ if (op < len) { /* still need some from output */ ++ out = chunkcopy_safe(out, from, op, limit); ++ len -= op; ++ /* When dist is small the amount of data that can be ++ copied from the window is also small, and progress ++ towards the dangerous end of the output buffer is ++ also small. This means that for trivial memsets and ++ for chunkunroll_relaxed() a safety check is ++ unnecessary. However, these conditions may not be ++ entered at all, and in that case it's possible that ++ the main copy is near the end. ++ */ ++ out = chunkunroll_relaxed(out, &dist, &len); ++ out = chunkcopy_safe(out, out - dist, len, limit); ++ } else { ++ /* from points to window, so there is no risk of ++ overlapping pointers requiring memset-like behaviour ++ */ ++ out = chunkcopy_safe(out, from, len, limit); + } + } + else { +- from = out - dist; /* copy direct from output */ +- do { /* minimum length is three */ +- *out++ = *from++; +- *out++ = *from++; +- *out++ = *from++; +- len -= 3; +- } while (len > 2); +- if (len) { +- *out++ = *from++; +- if (len > 1) +- *out++ = *from++; +- } ++ /* Whole reference is in range of current output. No ++ range checks are necessary because we start with room ++ for at least 258 bytes of output, so unroll and roundoff ++ operations can write beyond `out+len` so long as they ++ stay within 258 bytes of `out`. ++ */ ++ out = chunkcopy_lapped_relaxed(out, dist, len); + } + } + else if ((op & 64) == 0) { /* 2nd level distance code */ +diff --git a/contrib/arm/inflate.c b/contrib/arm/inflate.c +index ac333e8c..e40322c3 100644 +--- a/contrib/arm/inflate.c ++++ b/contrib/arm/inflate.c +@@ -84,6 +84,7 @@ + #include "inftrees.h" + #include "inflate.h" + #include "inffast.h" ++#include "contrib/arm/chunkcopy.h" + + #ifdef MAKEFIXED + # ifndef BUILDFIXED +@@ -405,10 +406,20 @@ unsigned copy; + + /* if it hasn't been done already, allocate space for the window */ + if (state->window == Z_NULL) { ++ unsigned wsize = 1U << state->wbits; + state->window = (unsigned char FAR *) +- ZALLOC(strm, 1U << state->wbits, ++ ZALLOC(strm, wsize + CHUNKCOPY_CHUNK_SIZE, + sizeof(unsigned char)); + if (state->window == Z_NULL) return 1; ++#ifdef INFLATE_CLEAR_UNUSED_UNDEFINED ++ /* Copies from the overflow portion of this buffer are undefined and ++ may cause analysis tools to raise a warning if we don't initialize ++ it. However, this undefined data overwrites other undefined data ++ and is subsequently either overwritten or left deliberately ++ undefined at the end of decode; so there's really no point. ++ */ ++ memset(state->window + wsize, 0, CHUNKCOPY_CHUNK_SIZE); ++#endif + } + + /* if window not in use yet, initialize */ +@@ -1175,17 +1186,16 @@ int flush; + else + from = state->window + (state->wnext - copy); + if (copy > state->length) copy = state->length; ++ if (copy > left) copy = left; ++ put = chunkcopy_safe(put, from, copy, put + left); + } + else { /* copy from output */ +- from = put - state->offset; + copy = state->length; ++ if (copy > left) copy = left; ++ put = chunkcopy_lapped_safe(put, state->offset, copy, put + left); + } +- if (copy > left) copy = left; + left -= copy; + state->length -= copy; +- do { +- *put++ = *from++; +- } while (--copy); + if (state->length == 0) state->mode = LEN; + break; + case LIT: diff --git a/package/libs/zlib/patches/003-attach-sourcefiles-in-patch-002-to-buildsystem.patch b/package/libs/zlib/patches/003-attach-sourcefiles-in-patch-002-to-buildsystem.patch new file mode 100644 index 0000000000..68f317b24b --- /dev/null +++ b/package/libs/zlib/patches/003-attach-sourcefiles-in-patch-002-to-buildsystem.patch @@ -0,0 +1,100 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8e75f66..24d7329 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -95,34 +95,67 @@ set(ZLIB_PUBLIC_HDRS + ${CMAKE_CURRENT_BINARY_DIR}/zconf.h + zlib.h + ) +-set(ZLIB_PRIVATE_HDRS +- crc32.h +- deflate.h +- gzguts.h +- inffast.h +- inffixed.h +- inflate.h +- inftrees.h +- trees.h +- zutil.h +-) +-set(ZLIB_SRCS +- adler32.c +- compress.c +- crc32.c +- deflate.c +- gzclose.c +- gzlib.c +- gzread.c +- gzwrite.c +- inflate.c +- infback.c +- inftrees.c +- inffast.c +- trees.c +- uncompr.c +- zutil.c +-) ++ ++if(ARMv8) ++ set(ZLIB_PRIVATE_HDRS ++ crc32.h ++ deflate.h ++ gzguts.h ++ inffast.h ++ inffixed.h ++ inflate.h ++ inftrees.h ++ trees.h ++ zutil.h ++ contrib/arm/chunkcopy.h ++ ) ++ set(ZLIB_SRCS ++ adler32.c ++ compress.c ++ crc32.c ++ deflate.c ++ gzclose.c ++ gzlib.c ++ gzread.c ++ gzwrite.c ++ infback.c ++ inftrees.c ++ contrib/arm/inflate.c ++ contrib/arm/inffast.c ++ trees.c ++ uncompr.c ++ zutil.c ++ ) ++ else() ++ set(ZLIB_PRIVATE_HDRS ++ crc32.h ++ deflate.h ++ gzguts.h ++ inffast.h ++ inffixed.h ++ inflate.h ++ inftrees.h ++ trees.h ++ zutil.h ++ ) ++ set(ZLIB_SRCS ++ adler32.c ++ compress.c ++ crc32.c ++ deflate.c ++ gzclose.c ++ gzlib.c ++ gzread.c ++ gzwrite.c ++ inflate.c ++ infback.c ++ inftrees.c ++ inffast.c ++ trees.c ++ uncompr.c ++ zutil.c ++ ) ++endif() + + if(NOT MINGW) + set(ZLIB_DLL_SRCS diff --git a/package/network/config/firewall/Makefile b/package/network/config/firewall/Makefile index e5fcb8c916..1bc2c4d1fa 100644 --- a/package/network/config/firewall/Makefile +++ b/package/network/config/firewall/Makefile @@ -12,10 +12,10 @@ PKG_NAME:=firewall PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/firewall3.git -PKG_SOURCE_DATE:=2017-05-27 -PKG_SOURCE_VERSION:=a4d98aea373e04f3fdc3c492c1688ba52ce490a9 -PKG_MIRROR_HASH:=55402b1e6bb471f6aed599c61c1c63b58212f5789f094d78247646fc0a7cf435 +PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall3.git +PKG_SOURCE_DATE:=2017-11-07 +PKG_SOURCE_VERSION:=c4309372acc7e1bef8aa230269f7da1dec790e68 +PKG_MIRROR_HASH:=1699884d8499d01e433959185f79ff9eb69704de47885b996123374b8015b422 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=ISC diff --git a/package/network/config/gre/Makefile b/package/network/config/gre/Makefile index 9193f5c9fb..b191327f87 100644 --- a/package/network/config/gre/Makefile +++ b/package/network/config/gre/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gre PKG_VERSION:=1 -PKG_RELEASE:=7 +PKG_RELEASE:=8 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/config/gre/files/gre.sh b/package/network/config/gre/files/gre.sh index a6b4ba85f6..e604bfb259 100755 --- a/package/network/config/gre/files/gre.sh +++ b/package/network/config/gre/files/gre.sh @@ -25,7 +25,7 @@ gre_generic_setup() { json_add_string mode "$mode" json_add_int mtu "${mtu:-1280}" [ -n "$df" ] && json_add_boolean df "$df" - [ -n "ttl" ] && json_add_int ttl "$ttl" + [ -n "$ttl" ] && json_add_int ttl "$ttl" [ -n "$tos" ] && json_add_string tos "$tos" json_add_boolean multicast "$multicast" json_add_string local "$local" diff --git a/package/network/config/ltq-adsl-app/Makefile b/package/network/config/ltq-adsl-app/Makefile index 6e0b47f87c..3fa9f67d32 100644 --- a/package/network/config/ltq-adsl-app/Makefile +++ b/package/network/config/ltq-adsl-app/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=dsl_cpe_control_danube PKG_VERSION:=3.24.4.4 -PKG_RELEASE:=2 +PKG_RELEASE:=6 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_BUILD_DIR:=$(BUILD_DIR)/dsl_cpe_control-$(PKG_VERSION) PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/ @@ -24,7 +24,7 @@ PKG_CONFIG_DEPENDS:=\ CONFIG_LTQ_DSL_ENABLE_SOAP \ CONFIG_LTQ_DSL_ENABLE_DSL_EVENT_POLLING -PKG_BUILD_DEPENDS:=TARGET_lantiq_xway:kmod-ltq-adsl-danube TARGET_lantiq_xway_legacy:kmod-ltq-adsl-danube TARGET_lantiq_ase:kmod-ltq-adsl-ase +PKG_BUILD_DEPENDS:=ltq-adsl PKG_FLAGS:=nonshared @@ -76,10 +76,10 @@ CONFIGURE_ARGS += \ TARGET_CFLAGS += -I$(LINUX_DIR)/include define Package/ltq-adsl-app/install - $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DIR) $(1)/etc/init.d $(1)/sbin $(1)/etc/hotplug.d/dsl $(INSTALL_BIN) ./files/dsl_control $(1)/etc/init.d/ - - $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) ./files/10_atm.sh $(1)/etc/hotplug.d/dsl + $(INSTALL_BIN) ./files/10_ptm.sh $(1)/etc/hotplug.d/dsl $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dsl_cpe_control $(1)/sbin endef diff --git a/package/network/config/ltq-adsl-app/files/10_atm.sh b/package/network/config/ltq-adsl-app/files/10_atm.sh new file mode 100755 index 0000000000..7bc72a63fd --- /dev/null +++ b/package/network/config/ltq-adsl-app/files/10_atm.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +[ "$DSL_NOTIFICATION_TYPE" = "DSL_STATUS" ] && \ +[ "$DSL_TC_LAYER_STATUS" = "ATM" ] && \ +! grep -q "ltq_atm_ar9\|ltq_atm_ase\|ltq_atm_danube" /proc/modules || exit 0 + +logger -p daemon.notice -t "dsl-notify" "Switching to TC-Layer ATM" + +if grep -q "ltq_ptm_ar9\|ltq_ptm_ase\|ltq_ptm_danube" /proc/modules ; then + logger -p daemon.notice -t "dsl-notify" "Loading ATM driver while EFM/PTM driver is loaded is not possible. Reboot is needed." + exit +fi + +case "$(strings /proc/device-tree/compatible)" in +*lantiq,ar9*) + soc="ar9" + ;; +*lantiq,ase*) + soc="ase" + ;; +*lantiq,danube*) + soc="danube" + ;; +*) + logger -p daemon.notice -t "dsl-notify" "Unsupported SoC" + exit +esac + +modprobe ltq_atm_${soc} diff --git a/package/network/config/ltq-adsl-app/files/10_ptm.sh b/package/network/config/ltq-adsl-app/files/10_ptm.sh new file mode 100755 index 0000000000..8a76b926f7 --- /dev/null +++ b/package/network/config/ltq-adsl-app/files/10_ptm.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +[ "$DSL_NOTIFICATION_TYPE" = "DSL_STATUS" ] && \ +[ "$DSL_TC_LAYER_STATUS" = "EFM" ] && \ +! grep -q "ltq_ptm_ar9\|ltq_ptm_ase\|ltq_ptm_danube" /proc/modules || exit 0 + +logger -p daemon.notice -t "dsl-notify" "Switching to TC-Layer EFM/PTM" + +if grep -q "ltq_atm_ar9\|ltq_atm_ase\|ltq_atm_danube" /proc/modules ; then + logger -p daemon.notice -t "dsl-notify" "Loading EFM/PTM driver while ATM driver is loaded is not possible. Reboot is needed." + exit +fi + +case "$(strings /proc/device-tree/compatible)" in +*lantiq,ar9*) + soc="ar9" + ;; +*lantiq,ase*) + soc="ase" + ;; +*lantiq,danube*) + soc="danube" + ;; +*) + logger -p daemon.notice -t "dsl-notify" "Unsupported SoC" + exit +esac + +modprobe ltq_ptm_${soc} diff --git a/package/network/config/ltq-adsl-app/files/dsl_control b/package/network/config/ltq-adsl-app/files/dsl_control index 8218186ef8..d93d47808b 100644 --- a/package/network/config/ltq-adsl-app/files/dsl_control +++ b/package/network/config/ltq-adsl-app/files/dsl_control @@ -2,14 +2,12 @@ # Copyright (C) 2012 OpenWrt.org START=49 +USE_PROCD=1 EXTRA_COMMANDS="status lucistat" EXTRA_HELP=" status Get DSL status information lucistat Get status information if lua friendly format" -SERVICE_DAEMONIZE=1 -SERVICE_WRITE_PID=1 - [ -f /lib/functions/lantiq_dsl.sh ] && . /lib/functions/lantiq_dsl.sh annex_b=10_00_10_00_00_04_00_00 @@ -28,7 +26,11 @@ annex_m2=00_00_00_00_40_00_00_00 annex_m2p=00_00_00_00_00_00_04_00 annex_j=10_00_10_40_00_04_01_00 -start() { +service_triggers() { + procd_add_reload_trigger network +} + +start_service() { local annex local firmware local xtu @@ -45,12 +47,15 @@ start() { return 1 } - service_start /sbin/dsl_cpe_control -i${xtu} \ + procd_open_instance + procd_set_param command /sbin/dsl_cpe_control \ + -i${xtu} \ -n /sbin/dsl_notify.sh \ -f ${firmware} + procd_close_instance } -stop() { +stop_service() { DSL_NOTIFICATION_TYPE="DSL_INTERFACE_STATUS" \ DSL_INTERFACE_STATUS="DOWN" \ /sbin/dsl_notify.sh diff --git a/package/network/config/ltq-adsl-app/patches/100-add-more-script-notifications.patch b/package/network/config/ltq-adsl-app/patches/100-add-more-script-notifications.patch new file mode 100644 index 0000000000..9d611c1caf --- /dev/null +++ b/package/network/config/ltq-adsl-app/patches/100-add-more-script-notifications.patch @@ -0,0 +1,42 @@ +From 9d4f86ba2cf10304303011f4f5628fa68dc77624 Mon Sep 17 00:00:00 2001 +From: Mathias Kresin +Date: Mon, 16 Oct 2017 21:08:26 +0200 +Subject: ltq-adsl-app: add more script notifications + +Backport HANDSHAKE and TRAINING notification from ltq-vdsl-app. It +unifies the dsl led blinking pattern accross all subtargets and allows +to get the current line status from the dsl led. + +Signed-off-by: Mathias Kresin +--- + .../100-add-more-script-notifications.patch | 27 ++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + create mode 100644 package/network/config/ltq-adsl-app/patches/100-add-more-script-notifications.patch + +--- a/src/dsl_cpe_control.c ++++ b/src/dsl_cpe_control.c +@@ -3273,7 +3273,23 @@ DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_S + #ifdef INCLUDE_SCRIPT_NOTIFICATION + if (g_sRcScript != DSL_NULL) + { +- if ( (nLineState == DSL_LINESTATE_SHOWTIME_TC_SYNC) && ++ if ( (nLineState == DSL_LINESTATE_HANDSHAKE) && ++ (g_nPrevLineState[nDevice] != DSL_LINESTATE_HANDSHAKE) ) ++ { ++ if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "HANDSHAKE") == DSL_SUCCESS) ++ { ++ bExec = DSL_TRUE; ++ } ++ } ++ else if ( (nLineState == DSL_LINESTATE_FULL_INIT) && ++ (g_nPrevLineState[nDevice] != DSL_LINESTATE_FULL_INIT) ) ++ { ++ if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "TRAINING") == DSL_SUCCESS) ++ { ++ bExec = DSL_TRUE; ++ } ++ } ++ else if ( (nLineState == DSL_LINESTATE_SHOWTIME_TC_SYNC) && + (g_nPrevLineState[nDevice] != DSL_LINESTATE_SHOWTIME_TC_SYNC) ) + { + if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "UP") == DSL_SUCCESS) diff --git a/package/network/config/ltq-vdsl-app/Makefile b/package/network/config/ltq-vdsl-app/Makefile index 20b506c48e..fd50149573 100644 --- a/package/network/config/ltq-vdsl-app/Makefile +++ b/package/network/config/ltq-vdsl-app/Makefile @@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ltq-vdsl-app PKG_VERSION:=4.17.18.6 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_BASE_NAME:=dsl_cpe_control PKG_SOURCE:=$(PKG_BASE_NAME)_vrx-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources @@ -17,7 +17,7 @@ PKG_HASH:=da8bb929526a61aea0e153ef524331fcd472a1ebbc6d88ca017735a4f82ece02 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_BASE_NAME)-$(PKG_VERSION) PKG_LICENSE:=BSD-2-Clause -PKG_BUILD_DEPENDS:=kmod-ltq-vdsl-vr9 +PKG_BUILD_DEPENDS:=ltq-vdsl PKG_FLAGS:=nonshared diff --git a/package/network/config/ltq-vdsl-app/files/10_atm.sh b/package/network/config/ltq-vdsl-app/files/10_atm.sh index abfb735923..e104a14b2e 100755 --- a/package/network/config/ltq-vdsl-app/files/10_atm.sh +++ b/package/network/config/ltq-vdsl-app/files/10_atm.sh @@ -12,5 +12,3 @@ if grep -q "ltq_ptm_vr9" /proc/modules ; then fi modprobe ltq_atm_vr9 - -/etc/init.d/br2684ctl reload diff --git a/package/network/config/ltq-vdsl-app/files/dsl_control b/package/network/config/ltq-vdsl-app/files/dsl_control index 425208a0d0..818990e574 100644 --- a/package/network/config/ltq-vdsl-app/files/dsl_control +++ b/package/network/config/ltq-vdsl-app/files/dsl_control @@ -109,7 +109,7 @@ locs 0 $1 } [Common]={ -}" > /tmp/adsl.scr +}" > /tmp/dsl.scr } lowlevel_cfg() { @@ -291,7 +291,7 @@ start_service() { [ -z "${snr}" ] || { # for SNR offset setting autoboot_script "$snr" - autoboot="-a /tmp/adsl.scr" + autoboot="-a /tmp/dsl.scr -A /tmp/dsl.scr" } procd_open_instance diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index 2efbaf83e6..90cce91553 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -1,13 +1,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=netifd -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2017-08-27 -PKG_SOURCE_VERSION:=7d94ede3c38dd7b8e08c8a2fd8ae5ede71a2059b -PKG_MIRROR_HASH:=967e993cdb49ddc6d6add23fa8ccbf2af798fdca6708e7937496baa4c2653957 +PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git +PKG_SOURCE_DATE:=2018-01-04 +PKG_SOURCE_VERSION:=fd5c399c01ceb1bbede3ae8b0e1daaa7652a6fa1 +PKG_MIRROR_HASH:=0040f94d11d0039505328a90b2ff48968db873e9e7967307631bf40ef5679275 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script b/package/network/config/netifd/files/lib/netifd/dhcp.script index e841f91855..00604f40e7 100755 --- a/package/network/config/netifd/files/lib/netifd/dhcp.script +++ b/package/network/config/netifd/files/lib/netifd/dhcp.script @@ -18,10 +18,18 @@ setup_interface () { proto_add_ipv4_address "$ip" "${subnet:-255.255.255.0}" # TODO: apply $broadcast + local ip_net + eval "$(ipcalc.sh "$ip/$mask")";ip_net="$NETWORK" + + local i for i in $router; do - proto_add_ipv4_route "$i" 32 "" "$ip" + local gw_net + eval "$(ipcalc.sh "$i/$mask")";gw_net="$NETWORK" + + [ "$ip_net" != "$gw_net" ] && proto_add_ipv4_route "$i" 32 "" "$ip" proto_add_ipv4_route 0.0.0.0 0 "$i" "$ip" + local r for r in $CUSTOMROUTES; do proto_add_ipv4_route "${r%%/*}" "${r##*/}" "$i" "$ip" done @@ -31,11 +39,11 @@ setup_interface () { [ -n "$staticroutes" ] && set_classless_routes $staticroutes [ -n "$msstaticroutes" ] && set_classless_routes $msstaticroutes - for dns in $dns; do - proto_add_dns_server "$dns" + for i in $dns; do + proto_add_dns_server "$i" done - for domain in $domain; do - proto_add_dns_search "$domain" + for i in $domain; do + proto_add_dns_search "$i" done proto_add_data diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh index ea02d68bb4..143e4451b6 100755 --- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh +++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh @@ -40,6 +40,7 @@ proto_dhcp_setup() { append dhcpopts "-x $opt" done + [ -z "$hostname" ] && hostname="$(cat /proc/sys/kernel/hostname)" [ "$broadcast" = 1 ] && broadcast="-B" || broadcast= [ "$release" = 1 ] && release="-R" || release= [ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C" diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile index 457a871efb..24cbe0b2cb 100644 --- a/package/network/ipv6/odhcp6c/Makefile +++ b/package/network/ipv6/odhcp6c/Makefile @@ -11,7 +11,7 @@ PKG_NAME:=odhcp6c PKG_RELEASE:=4 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/odhcp6c.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git PKG_SOURCE_DATE:=2017-09-05 PKG_SOURCE_VERSION:=51733a6d3bfe0fb9e8c53aea22231e5b8a1f64c3 PKG_MIRROR_HASH:=fdccfb9a6cb00d6dbf1a3160bd36622ee8e188a9d58bcd282c71a9368972e184 diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index dd9df245ac..79c228affd 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_VERSION:=2.78 -PKG_RELEASE:=2 +PKG_RELEASE:=7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/ @@ -17,12 +17,14 @@ PKG_HASH:=89949f438c74b0c7543f06689c319484bd126cc4b1f8c745c742ab397681252b PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:thekelleys:dnsmasq PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 -PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6 \ +PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcp \ + CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6 \ CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dnssec \ CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_auth \ CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_ipset \ @@ -75,8 +77,8 @@ endef define Package/dnsmasq-full/description $(call Package/dnsmasq/description) -This is a fully configurable variant with DHCPv6, DNSSEC, Authoritative DNS and -IPset, Conntrack support & NO_ID enabled by default. +This is a fully configurable variant with DHCPv4, DHCPv6, DNSSEC, Authoritative DNS +and IPset, Conntrack support & NO_ID enabled by default. endef define Package/dnsmasq/conffiles @@ -86,9 +88,12 @@ endef define Package/dnsmasq-full/config if PACKAGE_dnsmasq-full + config PACKAGE_dnsmasq_full_dhcp + bool "Build with DHCP support." + default y config PACKAGE_dnsmasq_full_dhcpv6 bool "Build with DHCPv6 support." - depends on IPV6 + depends on IPV6 && PACKAGE_dnsmasq_full_dhcp default n config PACKAGE_dnsmasq_full_dnssec bool "Build with DNSSEC support." @@ -124,7 +129,8 @@ ifeq ($(BUILD_VARIANT),nodhcpv6) endif ifeq ($(BUILD_VARIANT),full) - COPTS += $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6),,-DNO_DHCP6) \ + COPTS += $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcp),,-DNO_DHCP) \ + $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6),,-DNO_DHCP6) \ $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dnssec),-DHAVE_DNSSEC) \ $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_auth),,-DNO_AUTH) \ $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_ipset),,-DNO_IPSET) \ diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 3d3d83334e..dcc18e34d7 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -13,7 +13,6 @@ ADD_LOCAL_FQDN="" BASECONFIGFILE="/var/etc/dnsmasq.conf" BASEHOSTFILE="/tmp/hosts/dhcp" -BASETIMESTAMPFILE="/etc/dnsmasq.time" TRUSTANCHORSFILE="/usr/share/dnsmasq/trust-anchors.conf" TIMEVALIDFILE="/var/state/dnsmasqsec" BASEDHCPSTAMPFILE="/var/run/dnsmasq" @@ -277,7 +276,7 @@ dhcp_match_add() { dhcp_host_add() { local cfg="$1" - local hosttag nametime addrs duids + local hosttag nametime addrs duids macs tags config_get_bool force "$cfg" force 0 @@ -295,7 +294,7 @@ dhcp_host_add() { config_get_bool dns "$cfg" dns 0 [ "$dns" = "1" -a -n "$ip" -a -n "$name" ] && { - echo "$ip $name${DOMAIN:+.$DOMAIN}" >> $HOSTFILE + echo "$ip $name${DOMAIN:+.$DOMAIN}" >> $HOSTFILE_TMP } config_get mac "$cfg" mac @@ -305,7 +304,6 @@ dhcp_host_add() { if [ -n "$mac" ]; then # --dhcp-host=00:20:e0:3b:13:af,192.168.0.199,lap # many MAC are possible to track a laptop ON/OFF dock - macs="" for m in $mac; do append macs "$m" ","; done fi @@ -326,7 +324,6 @@ dhcp_host_add() { hex_to_hostid hostid "$hostid" fi - tags="" if [ -n "$tag" ]; then for t in $tag; do append tags "$t" ",set:"; done fi @@ -638,7 +635,7 @@ dhcp_domain_add() { record="${record:+$record }$name" done - echo "$ip $record" >> $HOSTFILE + echo "$ip $record" >> $HOSTFILE_TMP } dhcp_srv_add() { @@ -744,7 +741,7 @@ dnsmasq_start() CONFIGFILE="${BASECONFIGFILE}.${cfg}" CONFIGFILE_TMP="${CONFIGFILE}.$$" HOSTFILE="${BASEHOSTFILE}.${cfg}" - TIMESTAMPFILE="${BASETIMESTAMPFILE}.${cfg}" + HOSTFILE_TMP="${HOSTFILE}.$$" BASEDHCPSTAMPFILE_CFG="${BASEDHCPSTAMPFILE}.${cfg}" # before we can call xappend @@ -754,14 +751,17 @@ dnsmasq_start() mkdir -p /var/lib/misc chown dnsmasq:dnsmasq /var/run/dnsmasq - [ -f "$TIMESTAMPFILE" ] && rm -f "$TIMESTAMPFILE" - echo "# auto-generated config file from /etc/config/dhcp" > $CONFIGFILE_TMP - echo "# auto-generated config file from /etc/config/dhcp" > $HOSTFILE + echo "# auto-generated config file from /etc/config/dhcp" > $HOSTFILE_TMP + + local dnsmasqconffile="/etc/dnsmasq.${cfg}.conf" + if [ ! -r "$dnsmasqconffile" ]; then + dnsmasqconffile=/etc/dnsmasq.conf + fi # if we did this last, we could override auto-generated config - [ -f /etc/dnsmasq.conf ] && { - xappend "--conf-file=/etc/dnsmasq.conf" + [ -f "${dnsmasqconffile}" ] && { + xappend "--conf-file=${dnsmasqconffile}" } $PROG --version | grep -osqE "^Compile time options:.* DHCPv6( |$)" && DHCPv6CAPABLE=1 || DHCPv6CAPABLE=0 @@ -999,6 +999,7 @@ dnsmasq_start() echo >> $CONFIGFILE_TMP mv -f $CONFIGFILE_TMP $CONFIGFILE + mv -f $HOSTFILE_TMP $HOSTFILE [ "$resolvfile" = "/tmp/resolv.conf.auto" ] && { rm -f /tmp/resolv.conf @@ -1017,11 +1018,6 @@ dnsmasq_start() [ -n "$user_dhcpscript" ] && procd_set_param env USER_DHCPSCRIPT="$user_dhcpscript" procd_set_param respawn - local dnsmasqconffile="/etc/dnsmasq.${cfg}.conf" - if [ ! -r "$dnsmasqconffile" ]; then - dnsmasqconffile=/etc/dnsmasq.conf - fi - procd_add_jail dnsmasq ubus log procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE $RFC6761FILE /etc/passwd /etc/group /etc/TZ /dev/null /dev/urandom $dnsmasqconffile $dnsmasqconfdir $resolvfile $user_dhcpscript /etc/hosts /etc/ethers /sbin/hotplug-call $EXTRA_MOUNT $DHCPSCRIPT procd_add_jail_mount_rw /var/run/dnsmasq/ $leasefile @@ -1048,7 +1044,7 @@ dnsmasq_stop() service_triggers() { - procd_add_reload_trigger "dhcp" + procd_add_reload_trigger "dhcp" "system" procd_add_raw_trigger "interface.*" 2000 /etc/init.d/dnsmasq reload } @@ -1088,7 +1084,7 @@ start_service() { reload_service() { rc_procd start_service "$@" - return 0 + procd_send_signal dnsmasq "$@" } stop_service() { diff --git a/package/network/services/dnsmasq/patches/240-ubus.patch b/package/network/services/dnsmasq/patches/240-ubus.patch index 2d37b5d2fd..d21ca0dbaa 100644 --- a/package/network/services/dnsmasq/patches/240-ubus.patch +++ b/package/network/services/dnsmasq/patches/240-ubus.patch @@ -9,7 +9,7 @@ struct daemon *daemon; static volatile pid_t pid = 0; -@@ -32,6 +34,62 @@ static void fatal_event(struct event_des +@@ -32,6 +34,64 @@ static void fatal_event(struct event_des static int read_event(int fd, struct event_desc *evp, char **msg); static void poll_resolv(int force, int do_reload, time_t now); @@ -25,7 +25,7 @@ + .type = &ubus_object_type, +}; + -+void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name) ++void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name, const char *interface) +{ + if (!ubus || !ubus_object.has_subscribers) + return; @@ -37,6 +37,8 @@ + blobmsg_add_string(&b, "ip", ip); + if (name) + blobmsg_add_string(&b, "name", name); ++ if (interface) ++ blobmsg_add_string(&b, "interface", interface); + ubus_notify(ubus, &ubus_object, type, b.head, -1); +} + @@ -72,7 +74,7 @@ int main (int argc, char **argv) { int bind_fallback = 0; -@@ -911,6 +969,7 @@ int main (int argc, char **argv) +@@ -911,6 +971,7 @@ int main (int argc, char **argv) set_dbus_listeners(); #endif @@ -80,7 +82,7 @@ #ifdef HAVE_DHCP if (daemon->dhcp || daemon->relay4) { -@@ -1041,6 +1100,8 @@ int main (int argc, char **argv) +@@ -1041,6 +1102,8 @@ int main (int argc, char **argv) check_dbus_listeners(); #endif @@ -106,7 +108,7 @@ # endif #endif -+void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name); ++void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name, const char *interface); + /* ipset.c */ #ifdef HAVE_IPSET @@ -118,9 +120,9 @@ string ? string : "", err ? err : ""); + if (!strcmp(type, "DHCPACK")) -+ ubus_event_bcast("dhcp.ack", addr ? inet_ntoa(a) : NULL, daemon->namebuff, string ? string : NULL); ++ ubus_event_bcast("dhcp.ack", daemon->namebuff, addr ? inet_ntoa(a) : NULL, string ? string : NULL, interface); + else if (!strcmp(type, "DHCPRELEASE")) -+ ubus_event_bcast("dhcp.release", addr ? inet_ntoa(a) : NULL, daemon->namebuff, string ? string : NULL); ++ ubus_event_bcast("dhcp.release", daemon->namebuff, addr ? inet_ntoa(a) : NULL, string ? string : NULL, interface); } static void log_options(unsigned char *start, u32 xid) diff --git a/package/network/services/dnsmasq/patches/250-Fix-infinite-retries-in-strict-order-mode.patch b/package/network/services/dnsmasq/patches/250-Fix-infinite-retries-in-strict-order-mode.patch new file mode 100644 index 0000000000..faff680e03 --- /dev/null +++ b/package/network/services/dnsmasq/patches/250-Fix-infinite-retries-in-strict-order-mode.patch @@ -0,0 +1,45 @@ +From ef3d137a646fa8309e1ff5184e3e145eef40cc4d Mon Sep 17 00:00:00 2001 +From: Simon Kelley +Date: Tue, 5 Dec 2017 22:37:29 +0000 +Subject: [PATCH] Fix infinite retries in strict-order mode. + + If all configured dns servers return refused in + response to a query; dnsmasq will end up in an infinite loop + retransmitting the dns query resulting into high CPU load. + Problem is caused by the dns refuse retransmission logic which does + not check for the end of a dns server list iteration in strict mode. + Having one configured dns server returning a refused reply easily + triggers this problem in strict order mode. This was introduced in + 9396752c115b3ab733fa476b30da73237e12e7ba + + Thanks to Hans Dedecker for spotting this + and the initial patch. +--- + src/forward.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +--- a/src/forward.c ++++ b/src/forward.c +@@ -797,10 +797,20 @@ void reply_query(int fd, int family, tim + unsigned char *pheader; + size_t plen; + int is_sign; +- ++ ++ /* In strict order mode, there must be a server later in the chain ++ left to send to, otherwise without the forwardall mechanism, ++ code further on will cycle around the list forwever if they ++ all return REFUSED. Note that server is always non-NULL before ++ this executes. */ ++ if (option_bool(OPT_ORDER)) ++ for (server = forward->sentto->next; server; server = server->next) ++ if (!(server->flags & (SERV_LITERAL_ADDRESS | SERV_HAS_DOMAIN | SERV_FOR_NODOTS | SERV_NO_ADDR | SERV_LOOP))) ++ break; ++ + /* recreate query from reply */ + pheader = find_pseudoheader(header, (size_t)n, &plen, NULL, &is_sign, NULL); +- if (!is_sign) ++ if (!is_sign && server) + { + header->ancount = htons(0); + header->nscount = htons(0); diff --git a/package/network/services/dropbear/Config.in b/package/network/services/dropbear/Config.in index 7c2edd79f2..ca0af9d5e0 100644 --- a/package/network/services/dropbear/Config.in +++ b/package/network/services/dropbear/Config.in @@ -32,6 +32,15 @@ config DROPBEAR_ECC Increases binary size by about 23 kB (MIPS). +config DROPBEAR_ZLIB + bool "Enable compression" + default n + help + Enables compression using shared zlib library. + + Increases binary size by about 0.1 kB (MIPS) and requires additional 62 kB (MIPS) + for a shared zlib library. + config DROPBEAR_UTMP bool "Utmp support" default n diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index 7302db273c..21ac09f724 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dropbear PKG_VERSION:=2017.75 -PKG_RELEASE:=3 +PKG_RELEASE:=5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ @@ -19,11 +19,15 @@ PKG_HASH:=6cbc1dcb1c9709d226dff669e5604172a18cf5dbf9a201474d5618ae4465098c PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE libtomcrypt/LICENSE libtommath/LICENSE +PKG_CPE_ID:=cpe:/a:matt_johnston:dropbear_ssh_server PKG_BUILD_PARALLEL:=1 PKG_USE_MIPS16:=0 -PKG_CONFIG_DEPENDS:=CONFIG_TARGET_INIT_PATH CONFIG_DROPBEAR_ECC CONFIG_DROPBEAR_CURVE25519 +PKG_CONFIG_DEPENDS:= \ + CONFIG_TARGET_INIT_PATH CONFIG_DROPBEAR_ECC \ + CONFIG_DROPBEAR_CURVE25519 CONFIG_DROPBEAR_ZLIB \ + CONFIG_DROPBEAR_UTMP CONFIG_DROPBEAR_PUTUTLINE include $(INCLUDE_DIR)/package.mk @@ -44,6 +48,7 @@ define Package/dropbear SECTION:=net CATEGORY:=Base system TITLE:=Small SSH2 client/server + DEPENDS:= +DROPBEAR_ZLIB:zlib endef define Package/dropbear/description @@ -74,7 +79,7 @@ CONFIGURE_ARGS += \ --disable-loginfunc \ $(if $(CONFIG_DROPBEAR_PUTUTLINE),,--disable-pututline) \ --disable-pututxline \ - --disable-zlib \ + $(if $(CONFIG_DROPBEAR_ZLIB),,--disable-zlib) \ --enable-bundled-libtom TARGET_CFLAGS += -DARGTYPE=3 -ffunction-sections -fdata-sections diff --git a/package/network/services/dropbear/patches/120-openwrt_options.patch b/package/network/services/dropbear/patches/120-openwrt_options.patch index b49a95ce93..7f47a74304 100644 --- a/package/network/services/dropbear/patches/120-openwrt_options.patch +++ b/package/network/services/dropbear/patches/120-openwrt_options.patch @@ -39,7 +39,7 @@ /* Enable "Counter Mode" for ciphers. This is more secure than normal * CBC mode against certain attacks. It is recommended for security -@@ -131,9 +131,9 @@ If you test it please contact the Dropbe +@@ -131,10 +131,10 @@ If you test it please contact the Dropbe * If you disable MD5, Dropbear will fall back to SHA1 fingerprints, * which are not the standard form. */ #define DROPBEAR_SHA1_HMAC @@ -47,10 +47,12 @@ +/*#define DROPBEAR_SHA1_96_HMAC*/ #define DROPBEAR_SHA2_256_HMAC -#define DROPBEAR_SHA2_512_HMAC +-#define DROPBEAR_MD5_HMAC +/*#define DROPBEAR_SHA2_512_HMAC*/ - #define DROPBEAR_MD5_HMAC ++/*#define DROPBEAR_MD5_HMAC*/ /* You can also disable integrity. Don't bother disabling this if you're + * still using a cipher, it's relatively cheap. If you disable this it's dead @@ -146,7 +146,7 @@ If you test it please contact the Dropbe * Removing either of these won't save very much space. * SSH2 RFC Draft requires dss, recommends rsa */ diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 5a353e67ed..51f1692933 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=3 +PKG_RELEASE:=6 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git @@ -17,6 +17,7 @@ PKG_MIRROR_HASH:=c6ad9a73fc1ae0ba8bc48f71cf14394b274bc9c2c1d1b53c2775f08312597e7 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause +PKG_CPE_ID:=cpe:/a:w1.fi:hostapd PKG_BUILD_PARALLEL:=1 diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 16925d58a2..36aee85f17 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -151,6 +151,8 @@ hostapd_common_add_bss_config() { wpa_group_rekey wpa_pair_rekey wpa_master_rekey config_add_boolean wpa_disable_eapol_key_retries + config_add_boolean tdls_prohibit + config_add_boolean rsn_preauth auth_cache config_add_int ieee80211w config_add_int eapol_version @@ -172,6 +174,7 @@ hostapd_common_add_bss_config() { config_add_string ownip config_add_string iapp_interface config_add_string eap_type ca_cert client_cert identity anonymous_identity auth priv_key priv_key_pwd + config_add_string ieee80211w_mgmt_cipher config_add_int dynamic_vlan vlan_naming config_add_string vlan_tagged_interface vlan_bridge @@ -215,7 +218,7 @@ hostapd_set_bss_options() { json_get_vars \ wep_rekey wpa_group_rekey wpa_pair_rekey wpa_master_rekey \ - wpa_disable_eapol_key_retries \ + wpa_disable_eapol_key_retries tdls_prohibit \ maxassoc max_inactivity disassoc_low_ack isolate auth_cache \ wps_pushbutton wps_label ext_registrar wps_pbc_in_m1 wps_ap_setup_locked \ wps_independent wps_device_type wps_device_name wps_manufacturer wps_pin \ @@ -232,6 +235,7 @@ hostapd_set_bss_options() { set_default wmm 1 set_default uapsd 1 set_default wpa_disable_eapol_key_retries 0 + set_default tdls_prohibit 0 set_default eapol_version 0 set_default acct_port 1813 @@ -252,6 +256,8 @@ hostapd_set_bss_options() { append bss_conf "ignore_broadcast_ssid=$hidden" "$N" append bss_conf "uapsd_advertisement_enabled=$uapsd" "$N" + [ "$tdls_prohibit" -gt 0 ] && append bss_conf "tdls_prohibit=$tdls_prohibit" "$N" + [ "$wpa" -gt 0 ] && { [ -n "$wpa_group_rekey" ] && append bss_conf "wpa_group_rekey=$wpa_group_rekey" "$N" [ -n "$wpa_pair_rekey" ] && append bss_conf "wpa_ptk_rekey=$wpa_pair_rekey" "$N" @@ -356,8 +362,8 @@ hostapd_set_bss_options() { [ -n "$wps_possible" -a -n "$config_methods" ] && { set_default ext_registrar 0 set_default wps_device_type "6-0050F204-1" - set_default wps_device_name "Lede AP" - set_default wps_manufacturer "www.lede-project.org" + set_default wps_device_name "OpenWrt AP" + set_default wps_manufacturer "www.openwrt.org" set_default wps_independent 1 wps_state=2 @@ -397,7 +403,6 @@ hostapd_set_bss_options() { set_default mobility_domain "4f57" set_default r0_key_lifetime 10000 - set_default r1_key_holder "00004f577274" set_default reassociation_deadline 1000 set_default pmk_r1_push 0 set_default ft_psk_generate_local 0 @@ -405,7 +410,7 @@ hostapd_set_bss_options() { append bss_conf "mobility_domain=$mobility_domain" "$N" append bss_conf "r0_key_lifetime=$r0_key_lifetime" "$N" - append bss_conf "r1_key_holder=$r1_key_holder" "$N" + [ -n "$r1_key_holder" ] && append bss_conf "r1_key_holder=$r1_key_holder" "$N" append bss_conf "reassociation_deadline=$reassociation_deadline" "$N" append bss_conf "pmk_r1_push=$pmk_r1_push" "$N" append bss_conf "ft_psk_generate_local=$ft_psk_generate_local" "$N" @@ -440,9 +445,10 @@ hostapd_set_bss_options() { # RSN -> allow management frame protection case "$ieee80211w" in [012]) - json_get_vars ieee80211w_max_timeout ieee80211w_retry_timeout + json_get_vars ieee80211w_mgmt_cipher ieee80211w_max_timeout ieee80211w_retry_timeout append bss_conf "ieee80211w=$ieee80211w" "$N" [ "$ieee80211w" -gt "0" ] && { + append bss_conf "group_mgmt_cipher=${ieee80211w_mgmt_cipher:-AES-128-CMAC}" "$N" [ -n "$ieee80211w_max_timeout" ] && \ append bss_conf "assoc_sa_query_max_timeout=$ieee80211w_max_timeout" "$N" [ -n "$ieee80211w_retry_timeout" ] && \ @@ -595,8 +601,31 @@ EOF return 0 } +wpa_supplicant_set_fixed_freq() { + local freq="$1" + local htmode="$2" + + append network_data "fixed_freq=1" "$N$T" + append network_data "frequency=$freq" "$N$T" + case "$htmode" in + NOHT) append network_data "disable_ht=1" "$N$T";; + HT20|VHT20) append network_data "disable_ht40=1" "$N$T";; + HT40*|VHT40*|VHT80*|VHT160*) append network_data "ht40=1" "$N$T";; + esac + case "$htmode" in + VHT*) append network_data "vht=1" "$N$T";; + esac + case "$htmode" in + VHT80) append network_data "max_oper_chwidth=1" "$N$T";; + VHT160) append network_data "max_oper_chwidth=2" "$N$T";; + *) append network_data "max_oper_chwidth=0" "$N$T";; + esac +} + wpa_supplicant_add_network() { local ifname="$1" + local freq="$2" + local htmode="$3" _wpa_supplicant_common "$1" wireless_vif_parse_encryption @@ -618,11 +647,7 @@ wpa_supplicant_add_network() { [[ "$_w_mode" = "adhoc" ]] && { append network_data "mode=1" "$N$T" - [ -n "$channel" ] && { - freq="$(get_freq "$phy" "$channel")" - append network_data "fixed_freq=1" "$N$T" - append network_data "frequency=$freq" "$N$T" - } + [ -n "$channel" ] && wpa_supplicant_set_fixed_freq "$freq" "$htmode" scan_ssid="scan_ssid=0" @@ -634,10 +659,7 @@ wpa_supplicant_add_network() { ssid="${mesh_id}" append network_data "mode=5" "$N$T" - [ -n "$channel" ] && { - freq="$(get_freq "$phy" "$channel")" - append network_data "frequency=$freq" "$N$T" - } + [ -n "$channel" ] && wpa_supplicant_set_fixed_freq "$freq" "$htmode" append wpa_key_mgmt "SAE" scan_ssid="" } @@ -731,6 +753,7 @@ wpa_supplicant_add_network() { esac } [ -n "$bssid" ] && append network_data "bssid=$bssid" "$N$T" + [ -n "$beacon_int" ] && append network_data "beacon_int=$beacon_int" "$N$T" local bssid_blacklist bssid_whitelist json_get_values bssid_blacklist bssid_blacklist @@ -753,10 +776,6 @@ wpa_supplicant_add_network() { append network_data "mcast_rate=$mc_rate" "$N$T" } - local ht_str - [[ "$_w_mode" = adhoc ]] || ibss_htmode= - [ -n "$ibss_htmode" ] && append network_data "htmode=$ibss_htmode" "$N$T" - cat >> "$_config" < +Date: Fri, 20 Oct 2017 17:39:42 +0300 +Subject: [PATCH] WNM: Ignore WNM-Sleep Mode Request in wnm_sleep_mode=0 case + +The hostapd wnm_sleep_mode parameter was previously used to control +advertisement of WNM-Sleep Mode support, but it was not used when +processing a request to use WNM-Sleep Mode. Add an explicit check during +request processing as well so that any misbehaving station is ignored. + +Signed-off-by: Jouni Malinen +--- + src/ap/wnm_ap.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/src/ap/wnm_ap.c b/src/ap/wnm_ap.c +index 7c4fde0..973e4d3 100644 +--- a/src/ap/wnm_ap.c ++++ b/src/ap/wnm_ap.c +@@ -200,6 +200,13 @@ static void ieee802_11_rx_wnmsleep_req(struct hostapd_data *hapd, + u8 *tfsreq_ie_end = NULL; + u16 tfsreq_ie_len = 0; + ++ if (!hapd->conf->wnm_sleep_mode) { ++ wpa_printf(MSG_DEBUG, "Ignore WNM-Sleep Mode Request from " ++ MACSTR " since WNM-Sleep Mode is disabled", ++ MAC2STR(addr)); ++ return; ++ } ++ + dialog_token = *pos++; + while (pos + 1 < frm + len) { + u8 ie_len = pos[1]; +-- +2.1.4 diff --git a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch index 88698524e2..213ee6d726 100644 --- a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch +++ b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch @@ -140,11 +140,10 @@ Signed-hostap: Antonio Quartulli /* Helper macros for network block parser */ #ifdef OFFSET -@@ -2224,6 +2316,9 @@ static const struct parse_data ssid_fiel +@@ -2224,6 +2316,8 @@ static const struct parse_data ssid_fiel { INT(ap_max_inactivity) }, { INT(dtim_period) }, { INT(beacon_int) }, -+ { INT_RANGE(fixed_freq, 0, 1) }, + { FUNC(rates) }, + { FUNC(mcast_rate) }, #ifdef CONFIG_MACSEC @@ -175,11 +174,10 @@ Signed-hostap: Antonio Quartulli * macsec_policy - Determines the policy for MACsec secure session --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2781,6 +2781,13 @@ static void wpas_start_assoc_cb(struct w +@@ -2781,6 +2781,12 @@ static void wpas_start_assoc_cb(struct w params.beacon_int = ssid->beacon_int; else params.beacon_int = wpa_s->conf->beacon_int; -+ params.fixed_freq = ssid->fixed_freq; + i = 0; + while (i < WLAN_SUPP_RATES_MAX) { + params.rates[i] = ssid->rates[i]; diff --git a/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch b/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch deleted file mode 100644 index d2e5eab993..0000000000 --- a/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch +++ /dev/null @@ -1,156 +0,0 @@ -From b9329c5dfeed7d5c55d2117d8dfe326fc40c8fb1 Mon Sep 17 00:00:00 2001 -From: Antonio Quartulli -Date: Tue, 3 Jul 2012 00:36:24 +0200 -Subject: [PATCH] wpa_s: support htmode param - -possible values are HT20, HT40-, HT40+ and NOHT - -Signed-off-by: Antonio Quartulli ---- - src/drivers/driver.h | 2 ++ - src/drivers/driver_nl80211.c | 16 ++++++++++ - wpa_supplicant/config.c | 66 +++++++++++++++++++++++++++++++++++++++ - wpa_supplicant/config_ssid.h | 2 ++ - wpa_supplicant/wpa_supplicant.c | 2 ++ - 5 files changed, 88 insertions(+) - ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -765,6 +765,8 @@ struct wpa_driver_associate_params { - - unsigned char rates[WLAN_SUPP_RATES_MAX]; - int mcast_rate; -+ int ht_set; -+ unsigned int htmode; - - /** - * bssid_hint - BSSID of a proposed AP ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -5070,6 +5070,22 @@ retry: - nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate); - } - -+ if (params->ht_set) { -+ switch(params->htmode) { -+ case NL80211_CHAN_HT20: -+ wpa_printf(MSG_DEBUG, " * ht=HT20"); -+ break; -+ case NL80211_CHAN_HT40PLUS: -+ wpa_printf(MSG_DEBUG, " * ht=HT40+"); -+ break; -+ case NL80211_CHAN_HT40MINUS: -+ wpa_printf(MSG_DEBUG, " * ht=HT40-"); -+ break; -+ } -+ nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, -+ params->htmode); -+ } -+ - ret = nl80211_set_conn_keys(params, msg); - if (ret) - goto fail; ---- a/wpa_supplicant/config.c -+++ b/wpa_supplicant/config.c -@@ -2017,6 +2017,71 @@ static char * wpa_config_write_mcast_rat - } - #endif /* NO_CONFIG_WRITE */ - -+static int wpa_config_parse_htmode(const struct parse_data *data, -+ struct wpa_ssid *ssid, int line, -+ const char *value) -+{ -+ int i; -+ static const struct { -+ const char *name; -+ unsigned int val; -+ } htmap[] = { -+ { .name = "HT20", .val = NL80211_CHAN_HT20, }, -+ { .name = "HT40+", .val = NL80211_CHAN_HT40PLUS, }, -+ { .name = "HT40-", .val = NL80211_CHAN_HT40MINUS, }, -+ { .name = "NOHT", .val = NL80211_CHAN_NO_HT, }, -+ }; -+ ssid->ht_set = 0;; -+ for (i = 0; i < 4; i++) { -+ if (strcasecmp(htmap[i].name, value) == 0) { -+ ssid->htmode = htmap[i].val; -+ ssid->ht_set = 1; -+ break; -+ } -+ } -+ -+ return 0; -+} -+ -+#ifndef NO_CONFIG_WRITE -+static char * wpa_config_write_htmode(const struct parse_data *data, -+ struct wpa_ssid *ssid) -+{ -+ char *value; -+ int res; -+ -+ value = os_malloc(6); /* longest: HT40+ */ -+ if (value == NULL) -+ return NULL; -+ -+ switch(ssid->htmode) { -+ case NL80211_CHAN_HT20: -+ res = os_snprintf(value, 4, "HT20"); -+ break; -+ case NL80211_CHAN_HT40PLUS: -+ res = os_snprintf(value, 5, "HT40+"); -+ break; -+ case NL80211_CHAN_HT40MINUS: -+ res = os_snprintf(value, 5, "HT40-"); -+ break; -+ case NL80211_CHAN_NO_HT: -+ res = os_snprintf(value, 4, "NOHT"); -+ break; -+ default: -+ os_free(value); -+ return NULL; -+ } -+ -+ if (res < 0) { -+ os_free(value); -+ return NULL; -+ } -+ -+ return value; -+} -+#endif /* NO_CONFIG_WRITE */ -+ -+ - static int wpa_config_parse_rates(const struct parse_data *data, - struct wpa_ssid *ssid, int line, - const char *value) -@@ -2319,6 +2384,7 @@ static const struct parse_data ssid_fiel - { INT_RANGE(fixed_freq, 0, 1) }, - { FUNC(rates) }, - { FUNC(mcast_rate) }, -+ { FUNC(htmode) }, - #ifdef CONFIG_MACSEC - { INT_RANGE(macsec_policy, 0, 1) }, - { INT_RANGE(macsec_integ_only, 0, 1) }, ---- a/wpa_supplicant/config_ssid.h -+++ b/wpa_supplicant/config_ssid.h -@@ -739,6 +739,8 @@ struct wpa_ssid { - - unsigned char rates[WLAN_SUPP_RATES_MAX]; - double mcast_rate; -+ int ht_set; -+ unsigned int htmode; - - #ifdef CONFIG_MACSEC - /** ---- a/wpa_supplicant/wpa_supplicant.c -+++ b/wpa_supplicant/wpa_supplicant.c -@@ -2788,6 +2788,8 @@ static void wpas_start_assoc_cb(struct w - i++; - } - params.mcast_rate = ssid->mcast_rate; -+ params.ht_set = ssid->ht_set; -+ params.htmode = ssid->htmode; - } - - params.wpa_ie = wpa_ie; diff --git a/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch new file mode 100644 index 0000000000..9b5ee4bbb3 --- /dev/null +++ b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch @@ -0,0 +1,68 @@ +From: Sven Eckelmann +Date: Thu, 11 May 2017 08:21:45 +0200 +Subject: [PATCH] set mcast_rate in mesh mode + +The wpa_supplicant code for IBSS allows to set the mcast rate. It is +recommended to increase this value from 1 or 6 Mbit/s to something higher +when using a mesh protocol on top which uses the multicast packet loss as +indicator for the link quality. + +This setting was unfortunately not applied for mesh mode. But it would be +beneficial when wpa_supplicant would behave similar to IBSS mode and set +this argument during mesh join like authsae already does. At least it is +helpful for companies/projects which are currently switching to 802.11s +(without mesh_fwding and with mesh_ttl set to 1) as replacement for IBSS +because newer drivers seem to support 802.11s but not IBSS anymore. + +Signed-off-by: Sven Eckelmann +Tested-by: Simon Wunderlich + +--- a/src/drivers/driver.h ++++ b/src/drivers/driver.h +@@ -1424,6 +1424,7 @@ struct wpa_driver_mesh_join_params { + #define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004 + #define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008 + unsigned int flags; ++ int mcast_rate; + }; + + /** +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -8981,6 +8981,18 @@ static int nl80211_put_mesh_id(struct nl + } + + ++static int nl80211_put_mcast_rate(struct nl_msg *msg, int mcast_rate) ++{ ++ if (mcast_rate > 0) { ++ wpa_printf(MSG_DEBUG, " * mcast_rate=%.1f", ++ (double)mcast_rate / 10); ++ return nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, mcast_rate); ++ } ++ ++ return 0; ++} ++ ++ + static int nl80211_put_mesh_config(struct nl_msg *msg, + struct wpa_driver_mesh_bss_params *params) + { +@@ -9039,6 +9051,7 @@ static int nl80211_join_mesh(struct i802 + nl80211_put_basic_rates(msg, params->basic_rates) || + nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) || + nl80211_put_beacon_int(msg, params->beacon_int) || ++ nl80211_put_mcast_rate(msg, params->mcast_rate) || + nl80211_put_dtim_period(msg, params->dtim_period)) + goto fail; + +--- a/wpa_supplicant/mesh.c ++++ b/wpa_supplicant/mesh.c +@@ -379,6 +379,7 @@ int wpa_supplicant_join_mesh(struct wpa_ + os_memset(¶ms, 0, sizeof(params)); + params.meshid = ssid->ssid; + params.meshid_len = ssid->ssid_len; ++ params.mcast_rate = ssid->mcast_rate; + ibss_mesh_setup_freq(wpa_s, ssid, ¶ms.freq); + wpa_s->mesh_ht_enabled = !!params.freq.ht_enabled; + wpa_s->mesh_vht_enabled = !!params.freq.vht_enabled; diff --git a/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch b/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch new file mode 100644 index 0000000000..3833539489 --- /dev/null +++ b/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch @@ -0,0 +1,19 @@ +--- a/wpa_supplicant/wpa_supplicant.c ++++ b/wpa_supplicant/wpa_supplicant.c +@@ -2010,11 +2010,13 @@ void ibss_mesh_setup_freq(struct wpa_sup + for (j = 0; j < wpa_s->last_scan_res_used; j++) { + struct wpa_bss *bss = wpa_s->last_scan_res[j]; + +- if (ssid->mode != WPAS_MODE_IBSS) ++ /* Don't adjust control freq in case of fixed_freq */ ++ if (ssid->fixed_freq) { ++ obss_scan = 0; + break; ++ } + +- /* Don't adjust control freq in case of fixed_freq */ +- if (ssid->fixed_freq) ++ if (ssid->mode != WPAS_MODE_IBSS) + break; + + if (!bss_is_ibss(bss)) diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index b63d99a57d..8f14f125d5 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -1,7 +1,5 @@ -Index: hostapd-2017-08-24-c2d4f2eb/hostapd/Makefile -=================================================================== ---- hostapd-2017-08-24-c2d4f2eb.orig/hostapd/Makefile -+++ hostapd-2017-08-24-c2d4f2eb/hostapd/Makefile +--- a/hostapd/Makefile ++++ b/hostapd/Makefile @@ -165,6 +165,11 @@ OBJS += ../src/common/hw_features_common OBJS += ../src/eapol_auth/eapol_auth_sm.o @@ -14,10 +12,8 @@ Index: hostapd-2017-08-24-c2d4f2eb/hostapd/Makefile ifdef CONFIG_CODE_COVERAGE CFLAGS += -O0 -fprofile-arcs -ftest-coverage -Index: hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.h -=================================================================== ---- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/hostapd.h -+++ hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.h +--- a/src/ap/hostapd.h ++++ b/src/ap/hostapd.h @@ -13,6 +13,7 @@ #include "utils/list.h" #include "ap_config.h" @@ -43,10 +39,8 @@ Index: hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.h enum hostapd_iface_state { HAPD_IFACE_UNINITIALIZED, HAPD_IFACE_DISABLED, -Index: hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.c -=================================================================== ---- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/hostapd.c -+++ hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.c +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c @@ -309,6 +309,7 @@ static void hostapd_free_hapd_data(struc hapd->started = 0; @@ -88,10 +82,8 @@ Index: hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.c hostapd_interface_deinit(iface); wpa_printf(MSG_DEBUG, "%s: driver=%p drv_priv=%p -> hapd_deinit", __func__, driver, drv_priv); -Index: hostapd-2017-08-24-c2d4f2eb/src/ap/ieee802_11.c -=================================================================== ---- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/ieee802_11.c -+++ hostapd-2017-08-24-c2d4f2eb/src/ap/ieee802_11.c +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c @@ -1587,7 +1587,8 @@ ieee802_11_set_radius_info(struct hostap @@ -209,10 +201,8 @@ Index: hostapd-2017-08-24-c2d4f2eb/src/ap/ieee802_11.c ret = 1; break; case WLAN_FC_STYPE_DISASSOC: -Index: hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.c -=================================================================== ---- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/beacon.c -+++ hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.c +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c @@ -716,7 +716,7 @@ void sta_track_claim_taxonomy_info(struc void handle_probe_req(struct hostapd_data *hapd, @@ -251,10 +241,8 @@ Index: hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.c /* TODO: verify that supp_rates contains at least one matching rate * with AP configuration */ -Index: hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.h -=================================================================== ---- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/beacon.h -+++ hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.h +--- a/src/ap/beacon.h ++++ b/src/ap/beacon.h @@ -14,7 +14,7 @@ struct ieee80211_mgmt; void handle_probe_req(struct hostapd_data *hapd, @@ -264,10 +252,8 @@ Index: hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.h int ieee802_11_set_beacon(struct hostapd_data *hapd); int ieee802_11_set_beacons(struct hostapd_iface *iface); int ieee802_11_update_beacons(struct hostapd_iface *iface); -Index: hostapd-2017-08-24-c2d4f2eb/src/ap/drv_callbacks.c -=================================================================== ---- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/drv_callbacks.c -+++ hostapd-2017-08-24-c2d4f2eb/src/ap/drv_callbacks.c +--- a/src/ap/drv_callbacks.c ++++ b/src/ap/drv_callbacks.c @@ -116,6 +116,10 @@ int hostapd_notif_assoc(struct hostapd_d u16 reason = WLAN_REASON_UNSPECIFIED; u16 status = WLAN_STATUS_SUCCESS; @@ -292,10 +278,8 @@ Index: hostapd-2017-08-24-c2d4f2eb/src/ap/drv_callbacks.c #ifdef CONFIG_P2P if (elems.p2p) { wpabuf_free(sta->p2p_ie); -Index: hostapd-2017-08-24-c2d4f2eb/src/ap/sta_info.c -=================================================================== ---- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/sta_info.c -+++ hostapd-2017-08-24-c2d4f2eb/src/ap/sta_info.c +--- a/src/ap/sta_info.c ++++ b/src/ap/sta_info.c @@ -404,6 +404,7 @@ void ap_handle_timer(void *eloop_ctx, vo HOSTAPD_LEVEL_INFO, "deauthenticated due to " "local deauth request"); @@ -320,10 +304,8 @@ Index: hostapd-2017-08-24-c2d4f2eb/src/ap/sta_info.c if (hapd->msg_ctx_parent && hapd->msg_ctx_parent != hapd->msg_ctx) -Index: hostapd-2017-08-24-c2d4f2eb/src/ap/wpa_auth_glue.c -=================================================================== ---- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/wpa_auth_glue.c -+++ hostapd-2017-08-24-c2d4f2eb/src/ap/wpa_auth_glue.c +--- a/src/ap/wpa_auth_glue.c ++++ b/src/ap/wpa_auth_glue.c @@ -175,6 +175,7 @@ static void hostapd_wpa_auth_psk_failure struct hostapd_data *hapd = ctx; wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR, diff --git a/package/network/services/igmpproxy/Makefile b/package/network/services/igmpproxy/Makefile index d07fe66998..38efabe1cb 100644 --- a/package/network/services/igmpproxy/Makefile +++ b/package/network/services/igmpproxy/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=igmpproxy PKG_VERSION:=0.1 -PKG_RELEASE:=9 +PKG_RELEASE:=10 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SF/igmpproxy diff --git a/package/network/services/igmpproxy/files/igmpproxy.init b/package/network/services/igmpproxy/files/igmpproxy.init index 9f4e51ada4..403854546f 100644 --- a/package/network/services/igmpproxy/files/igmpproxy.init +++ b/package/network/services/igmpproxy/files/igmpproxy.init @@ -132,3 +132,7 @@ start_service() { service_started() { procd_set_config_changed firewall } + +stop_service() { + procd_set_config_changed firewall +} diff --git a/package/network/services/ipset-dns/Makefile b/package/network/services/ipset-dns/Makefile index 2adc9fe031..3f21d04c47 100644 --- a/package/network/services/ipset-dns/Makefile +++ b/package/network/services/ipset-dns/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=http://git.zx2c4.com/ipset-dns -PKG_SOURCE_DATE:=2013-05-03 -PKG_SOURCE_VERSION:=6be3afd819a86136b51c5ae722ab48266187155b -PKG_MIRROR_HASH:=4e34943b547babe705c2fad295ee24a5ee0c93ca03e2a9cdeaf323150f97e60b +PKG_SOURCE_DATE:=2017-10-08 +PKG_SOURCE_VERSION:=ade2cf88e933f4f90451e0a6171f0aa4a523f989 +PKG_MIRROR_HASH:=34ad1f5c7d2eab90b795f2a512102891428216e3d439d918a8992846550e9697 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 diff --git a/package/network/services/ipset-dns/patches/100-simultaneous-ipv4-ipv6.patch b/package/network/services/ipset-dns/patches/100-simultaneous-ipv4-ipv6.patch deleted file mode 100644 index 19669a05b5..0000000000 --- a/package/network/services/ipset-dns/patches/100-simultaneous-ipv4-ipv6.patch +++ /dev/null @@ -1,57 +0,0 @@ ---- a/ipset-dns.c -+++ b/ipset-dns.c -@@ -307,19 +307,20 @@ int main(int argc, char *argv[]) - struct timeval tv; - char msg[512]; - char ip[INET6_ADDRSTRLEN]; -- char *ipset; -+ char *ipset, *ipset6; - int listen_sock, upstream_sock; - int pos, i, size, af; - socklen_t len; - size_t received; - pid_t child; - -- if (argc != 4) { -- fprintf(stderr, "Usage: %s ipset port upstream\n", argv[0]); -+ if (argc != 5) { -+ fprintf(stderr, "Usage: %s ipv4-ipset ipv6-ipset port upstream\n", argv[0]); - return 1; - } - - ipset = argv[1]; -+ ipset6 = argv[2]; - - listen_sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - if (listen_sock < 0) { -@@ -329,7 +330,7 @@ int main(int argc, char *argv[]) - - memset(&listen_addr, 0, sizeof(listen_addr)); - listen_addr.sin_family = AF_INET; -- listen_addr.sin_port = htons(atoi(argv[2])); -+ listen_addr.sin_port = htons(atoi(argv[3])); - listen_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - i = 1; - setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR, &i, sizeof(i)); -@@ -341,7 +342,7 @@ int main(int argc, char *argv[]) - memset(&upstream_addr, 0, sizeof(upstream_addr)); - upstream_addr.sin_family = AF_INET; - upstream_addr.sin_port = htons(53); -- inet_aton(argv[3], &upstream_addr.sin_addr); -+ inet_aton(argv[4], &upstream_addr.sin_addr); - - /* TODO: Put all of the below code in several forks all listening on the same sock. */ - -@@ -434,8 +435,11 @@ int main(int argc, char *argv[]) - continue; - } - -+ if ((af == AF_INET && !*ipset) || (af == AF_INET6 && !*ipset6)) -+ continue; -+ - printf("%s: %s\n", answer.dotted, ip); -- if (add_to_ipset(ipset, answer.rdata, af) < 0) -+ if (add_to_ipset((af == AF_INET) ? ipset : ipset6, answer.rdata, af) < 0) - perror("add_to_ipset"); - } - diff --git a/package/network/services/lldpd/Makefile b/package/network/services/lldpd/Makefile index 8b1e4e96d8..cdd8f99d5e 100644 --- a/package/network/services/lldpd/Makefile +++ b/package/network/services/lldpd/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lldpd -PKG_VERSION:=0.9.8 +PKG_VERSION:=0.9.9 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://media.luffy.cx/files/lldpd -PKG_HASH:=9ee494e91bc33938575b2c09b26188c486ef8eac6e2155d250c189cc4e988c4f +PKG_HASH:=5e9e08f500d21376631cbc9f8e19a4b167cd38eb2d8fd9e660b8e80507f802db PKG_MAINTAINER:=Stijn Tintel PKG_LICENSE:=ISC diff --git a/package/network/services/lldpd/files/lldpd.config b/package/network/services/lldpd/files/lldpd.config index d2b3d15450..36b43c89da 100644 --- a/package/network/services/lldpd/files/lldpd.config +++ b/package/network/services/lldpd/files/lldpd.config @@ -10,7 +10,7 @@ config lldpd config option lldp_location "2:FR:6:Commercial Rd:3:Roseville:19:4" # if empty, the distribution description is sent - #option lldp_description "Lede System" + #option lldp_description "OpenWrt System" # interfaces to listen on list interface "loopback" diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init index 39bce989be..c3d9ba0506 100644 --- a/package/network/services/lldpd/files/lldpd.init +++ b/package/network/services/lldpd/files/lldpd.init @@ -16,7 +16,7 @@ find_release_info() [ -z "$PRETTY_NAME" ] && [ -s /etc/openwrt_version ] && \ PRETTY_NAME="$(cat /etc/openwrt_version)" - echo "${PRETTY_NAME:-Unknown Lede release} @ $(cat /proc/sys/kernel/hostname)" + echo "${PRETTY_NAME:-Unknown OpenWrt release} @ $(cat /proc/sys/kernel/hostname)" } write_lldpd_conf() diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index 9c59fb648a..16c903db36 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -9,53 +9,94 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcpd PKG_RELEASE:=1 +PKG_VERSION:=1.3 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/odhcpd.git -PKG_SOURCE_DATE:=2017-08-16 -PKG_SOURCE_VERSION:=94e65ee0aecf0749e64fb29b4532c614e7be86a8 -PKG_MIRROR_HASH:=cb3d1e42f87bfd1eb78e27ae6a59e34302db11a6e6c119962c1c02b2f51ddaef +PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git +PKG_SOURCE_DATE:=2017-12-22 +PKG_SOURCE_VERSION:=7aa2594c5a127d92fa8f04328ac7b43e595bcaa7 +PKG_MIRROR_HASH:=67ce9303ce2f7a47ca9c54e1ebd984f108066ab0fa4e0d81f39a9cfc2431f90b PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_INSTALL:=1 +PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_odhcpd_$(BUILD_VARIANT)_ext_cer_id + include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk -CMAKE_OPTIONS += -DUBUS=1 - -ifneq ($(CONFIG_PACKAGE_odhcpd_ext_cer_id),0) - CMAKE_OPTIONS += -DEXT_CER_ID=$(CONFIG_PACKAGE_odhcpd_ext_cer_id) -endif - - -define Package/odhcpd +define Package/odhcpd/default SECTION:=net CATEGORY:=Network - TITLE:=OpenWrt DHCP/DHCPv6(-PD)/RA Server & Relay + TITLE:=OpenWrt DHCPv6(-PD)/RA Server & Relay DEPENDS:=+libubox +libuci +libubus +libnl-tiny endef -define Package/odhcpd/config - config PACKAGE_odhcpd_ext_cer_id - int "CER-ID Extension ID (0 = disabled)" - depends on PACKAGE_odhcpd - default 0 -endef - -define Package/odhcpd/description +define Package/odhcpd/default/description odhcpd is a daemon for serving and relaying IP management protocols to configure clients and downstream routers. It tries to follow the RFC 6204 requirements for IPv6 home routers. - - odhcpd provides server services for DHCP, RA, stateless and stateful DHCPv6, - prefix delegation and can be used to relay RA, DHCPv6 and NDP between routed - (non-bridged) interfaces in case no delegated prefixes are available. endef +define Package/odhcpd/default/config +menu "Configuration" + depends on PACKAGE_$(1) + +config PACKAGE_odhcpd_$(2)_ext_cer_id + int + default 0 + prompt "CER-ID Extension ID (0 = disabled)" +endmenu +endef + +define Package/odhcpd + $(call Package/odhcpd/default) + TITLE += and DHCPv4 server + VARIANT:=full +endef + +Package/odhcpd/config=$(call Package/odhcpd/default/config,odhcpd,full) + +define Package/odhcpd/description + $(call Package/odhcpd/default/description) + + This is a variant providing server services for DHCPv4, RA, stateless and + stateful DHCPv6, prefix delegation and can be used to relay RA, DHCPv6 and + NDP between routed (non-bridged) interfaces in case no delegated prefixes + are available. +endef + +define Package/odhcpd-ipv6only + $(call Package/odhcpd/default) + VARIANT:=ipv6only +endef + +Package/odhcpd-ipv6only/config=$(call Package/odhcpd/default/config,odhcpd-ipv6only,ipv6only) + +define Package/odhcpd-ipv6only/description + $(call Package/odhcpd/default/description) + + This is a variant providing server services for RA, stateless and stateful + DHCPv6, prefix delegation and can be used to relay RA, DHCPv6 and NDP between + routed (non-bridged) interfaces in case no delegated prefixes are available. +endef + +CMAKE_OPTIONS += -DUBUS=1 + +ifeq ($(BUILD_VARIANT),full) + CMAKE_OPTIONS += -DDHCPV4_SUPPORT=1 +endif + +ifneq ($(CONFIG_PACKAGE_odhcpd_$(BUILD_VARIANT)_ext_cer_id),0) + CMAKE_OPTIONS += -DEXT_CER_ID=$(CONFIG_PACKAGE_odhcpd_$(BUILD_VARIANT)_ext_cer_id) +endif + define Package/odhcpd/install $(INSTALL_DIR) $(1)/usr/sbin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/odhcpd $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/odhcpd $(1)/usr/sbin/ $(INSTALL_BIN) ./files/odhcpd-update $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/odhcpd.init $(1)/etc/init.d/odhcpd @@ -63,4 +104,7 @@ define Package/odhcpd/install $(INSTALL_BIN) ./files/odhcpd.defaults $(1)/etc/uci-defaults endef +Package/odhcpd-ipv6only/install = $(Package/odhcpd/install) + $(eval $(call BuildPackage,odhcpd)) +$(eval $(call BuildPackage,odhcpd-ipv6only)) diff --git a/package/network/services/odhcpd/files/odhcpd.defaults b/package/network/services/odhcpd/files/odhcpd.defaults index e184da90ac..cecbdd4a8d 100644 --- a/package/network/services/odhcpd/files/odhcpd.defaults +++ b/package/network/services/odhcpd/files/odhcpd.defaults @@ -2,13 +2,28 @@ uci -q get dhcp.odhcpd && exit 0 touch /etc/config/dhcp +. /usr/share/libubox/jshn.sh + +json_load "$(cat /etc/board.json)" +json_select network +json_select lan +json_get_vars protocol +json_select .. +json_select .. + +case "$protocol" in +# only enable server mode on statically addressed lan ports +"static") MODE=server ;; +*) MODE=disabled ;; +esac + uci batch </dev/null) [ -n "$upzone" ] || return 0 json_add_object "" @@ -77,7 +77,7 @@ omcproxy_add_firewall() { json_close_object for network in $downlink; do - downzone=$(fw3 network $network) + downzone=$(fw3 -q network $network 2>/dev/null) [ -n "$downzone" ] || continue json_add_object "" diff --git a/package/network/services/openvpn/Makefile b/package/network/services/openvpn/Makefile index 537a1bfe2d..ec48e734ff 100644 --- a/package/network/services/openvpn/Makefile +++ b/package/network/services/openvpn/Makefile @@ -9,15 +9,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openvpn -PKG_VERSION:=2.4.3 -PKG_RELEASE:=1 +PKG_VERSION:=2.4.4 +PKG_RELEASE:=2 PKG_SOURCE_URL:=\ https://build.openvpn.net/downloads/releases/ \ - https://swupdate.openvpn.net/community/releases/ \ - http://www.eurephia.net/openvpn/ + https://swupdate.openvpn.net/community/releases/ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_HASH:=7aa86167a5b8923e54e8795b814ed77288c793671f59fd830d9ab76d4b480571 +PKG_HASH:=96cd1b8fe1e8cb2920f07c3fd3985faea756e16fdeebd11d3e146d5bd2b04a80 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) PKG_MAINTAINER:=Felix Fietkau @@ -26,6 +25,7 @@ PKG_INSTALL:=1 PKG_FIXUP:=autoreconf PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0 +PKG_CPE_ID:=cpe:/a:openvpn:openvpn include $(INCLUDE_DIR)/package.mk diff --git a/package/network/services/openvpn/files/openvpn.init b/package/network/services/openvpn/files/openvpn.init index 98c1710f03..ab4f7dba0d 100644 --- a/package/network/services/openvpn/files/openvpn.init +++ b/package/network/services/openvpn/files/openvpn.init @@ -60,7 +60,7 @@ openvpn_add_instance() { local dir="$2" local conf="$3" - procd_open_instance + procd_open_instance "$name" procd_set_param command "$PROG" \ --syslog "openvpn($name)" \ --status "/var/run/openvpn.$name.status" \ @@ -103,28 +103,47 @@ start_instance() { } start_service() { + local instance="$1" + local instance_found=0 + + config_cb() { + local type="$1" + local name="$2" + if [ "$type" = "openvpn" ]; then + if [ -n "$instance" -a "$instance" = "$name" ]; then + instance_found=1 + fi + fi + } + . /usr/share/openvpn/openvpn.options config_load 'openvpn' - config_foreach start_instance 'openvpn' - local path name - for path in /etc/openvpn/*.conf; do - if [ -f "$path" ]; then - name="${path##*/}"; name="${name%.conf}" + if [ -n "$instance" ]; then + [ "$instance_found" -gt 0 ] || return + start_instance "$instance" + else + config_foreach start_instance 'openvpn' - # don't start configs again that are already started by uci - if echo "$UCI_STARTED" | grep -qxF "$path"; then - continue + local path name + for path in /etc/openvpn/*.conf; do + if [ -f "$path" ]; then + name="${path##*/}"; name="${name%.conf}" - # don't start configs which are set to disabled in uci - elif echo "$UCI_DISABLED" | grep -qxF "$path"; then - logger -t openvpn "$name.conf is disabled in /etc/config/openvpn" - continue + # don't start configs again that are already started by uci + if echo "$UCI_STARTED" | grep -qxF "$path"; then + continue + + # don't start configs which are set to disabled in uci + elif echo "$UCI_DISABLED" | grep -qxF "$path"; then + logger -t openvpn "$name.conf is disabled in /etc/config/openvpn" + continue + fi + + openvpn_add_instance "$name" "${path%/*}" "$path" fi - - openvpn_add_instance "$name" "${path%/*}" "$path" - fi - done + done + fi } service_triggers() { diff --git a/package/network/services/openvpn/files/openvpn.options b/package/network/services/openvpn/files/openvpn.options index 022f530a03..a6a3ded061 100644 --- a/package/network/services/openvpn/files/openvpn.options +++ b/package/network/services/openvpn/files/openvpn.options @@ -30,6 +30,7 @@ ecdh_curve echo engine explicit_exit_notify +extra_certs fragment group hand_window diff --git a/package/network/services/openvpn/patches/210-build_always_use_internal_lz4.patch b/package/network/services/openvpn/patches/210-build_always_use_internal_lz4.patch index b0fe00df9b..d49e0bf9ec 100644 --- a/package/network/services/openvpn/patches/210-build_always_use_internal_lz4.patch +++ b/package/network/services/openvpn/patches/210-build_always_use_internal_lz4.patch @@ -1,43 +1,68 @@ --- a/configure.ac +++ b/configure.ac -@@ -1076,37 +1076,14 @@ dnl +@@ -1068,62 +1068,15 @@ dnl AC_ARG_VAR([LZ4_CFLAGS], [C compiler flags for lz4]) AC_ARG_VAR([LZ4_LIBS], [linker flags for lz4]) if test "$enable_lz4" = "yes" && test "$enable_comp_stub" = "no"; then -- AC_CHECKING([for LZ4 Library and Header files]) -- havelz4lib=1 - +- if test -z "${LZ4_CFLAGS}" -a -z "${LZ4_LIBS}"; then +- # if the user did not explicitly specify flags, try to autodetect +- PKG_CHECK_MODULES([LZ4], +- [liblz4 >= 1.7.1], +- [have_lz4="yes"], +- [] # If this fails, we will do another test next +- ) +- fi + + saved_CFLAGS="${CFLAGS}" + saved_LIBS="${LIBS}" + CFLAGS="${CFLAGS} ${LZ4_CFLAGS}" + LIBS="${LIBS} ${LZ4_LIBS}" + +- # If pkgconfig check failed or LZ4_CFLAGS/LZ4_LIBS env vars +- # are used, check the version directly in the LZ4 include file +- if test "${have_lz4}" != "yes"; then +- AC_CHECK_HEADERS([lz4.h], +- [have_lz4h="yes"], +- []) +- +- if test "${have_lz4h}" = "yes" ; then +- AC_MSG_CHECKING([additionally if system LZ4 version >= 1.7.1]) +- AC_COMPILE_IFELSE( +- [AC_LANG_PROGRAM([[ +-#include +- ]], +- [[ +-/* Version encoding: MMNNPP (Major miNor Patch) - see lz4.h for details */ +-#if LZ4_VERSION_NUMBER < 10701L +-#error LZ4 is too old +-#endif +- ]] +- )], +- [ +- AC_MSG_RESULT([ok]) +- have_lz4="yes" +- ], +- [AC_MSG_RESULT([system LZ4 library is too old])] +- ) +- fi +- fi +- - # if LZ4_LIBS is set, we assume it will work, otherwise test - if test -z "${LZ4_LIBS}"; then -- AC_CHECK_LIB(lz4, LZ4_compress, -- [ LZ4_LIBS="-llz4" ], -- [ -- AC_MSG_RESULT([LZ4 library not found.]) -- havelz4lib=0 -- ]) +- AC_CHECK_LIB([lz4], +- [LZ4_compress], +- [LZ4_LIBS="-llz4"], +- [have_lz4="no"]) - fi -+ AC_MSG_RESULT([Using LZ4 library in src/compat/compat-lz4.*]) -+ AC_DEFINE([NEED_COMPAT_LZ4], [1], [use copy of LZ4 source in compat/]) -+ LZ4_LIBS="" - -- saved_CFLAGS="${CFLAGS}" -- CFLAGS="${CFLAGS} ${LZ4_CFLAGS}" -- AC_CHECK_HEADERS(lz4.h, -- , -- [ -- AC_MSG_RESULT([LZ4 headers not found.]) -- havelz4lib=0 -- ]) - -- if test $havelz4lib = 0 ; then -- AC_MSG_RESULT([LZ4 library or header not found, using version in src/compat/compat-lz4.*]) +- if test "${have_lz4}" != "yes" ; then +- AC_MSG_RESULT([ usuable LZ4 library or header not found, using version in src/compat/compat-lz4.*]) - AC_DEFINE([NEED_COMPAT_LZ4], [1], [use copy of LZ4 source in compat/]) - LZ4_LIBS="" - fi ++ AC_MSG_RESULT([ usuable LZ4 library or header not found, using version in src/compat/compat-lz4.*]) ++ AC_DEFINE([NEED_COMPAT_LZ4], [1], [use copy of LZ4 source in compat/]) ++ LZ4_LIBS="" OPTIONAL_LZ4_CFLAGS="${LZ4_CFLAGS}" OPTIONAL_LZ4_LIBS="${LZ4_LIBS}" - AC_DEFINE(ENABLE_LZ4, 1, [Enable LZ4 compression library]) -- CFLAGS="${saved_CFLAGS}" - fi - - + AC_DEFINE(ENABLE_LZ4, [1], [Enable LZ4 compression library]) diff --git a/package/network/services/relayd/Makefile b/package/network/services/relayd/Makefile index dcb69a11b5..7f1c1f9415 100644 --- a/package/network/services/relayd/Makefile +++ b/package/network/services/relayd/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=relayd PKG_RELEASE:=2 -PKG_SOURCE_URL=$(LEDE_GIT)/project/relayd.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/relayd.git PKG_SOURCE_PROTO:=git PKG_SOURCE_DATE:=2016-02-07 PKG_SOURCE_VERSION:=ad0b25ad74345d367c62311e14b279f5ccb8ef13 diff --git a/package/network/services/samba36/Makefile b/package/network/services/samba36/Makefile index 81bad871aa..42c23b4e8e 100644 --- a/package/network/services/samba36/Makefile +++ b/package/network/services/samba36/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=samba PKG_VERSION:=3.6.25 -PKG_RELEASE:=8 +PKG_RELEASE:=9 PKG_SOURCE_URL:=https://download.samba.org/pub/samba \ https://download.samba.org/pub/samba/stable @@ -18,8 +18,7 @@ PKG_HASH:=8f2c8a7f2bd89b0dfd228ed917815852f7c625b2bc0936304ac3ed63aaf83751 PKG_LICENSE:=GPL-3.0 PKG_LICENSE_FILES:=COPYING - -PKG_MAINTAINER:=Felix Fietkau +PKG_CPE_ID:=cpe:/a:samba:samba PKG_BUILD_PARALLEL:=1 @@ -30,27 +29,29 @@ CONFIGURE_PATH:=source3 PKG_BUILD_BIN:=$(PKG_BUILD_DIR)/$(MAKE_PATH)/bin -define Package/samba36-server +define Package/samba/Default SECTION:=net CATEGORY:=Network - TITLE:=Samba 3.6 SMB/CIFS server + TITLE:=Samba 3.6 SMB/CIFS URL:=https://www.samba.org/ + MAINTAINER:=Felix Fietkau +endef + +define Package/samba36-server + $(call Package/samba/Default) + TITLE+= server DEPENDS:=+USE_GLIBC:librt $(ICONV_DEPENDS) endef define Package/samba36-client - SECTION:=net - CATEGORY:=Network - TITLE:=Samba 3.6 SMB/CIFS client - URL:=https://www.samba.org/ + $(call Package/samba/Default) + TITLE+= client DEPENDS:=+libreadline +libncurses endef define Package/samba36-net - SECTION:=net - CATEGORY:=Network - TITLE:=Samba 3.6 SMB/CIFS net commands - URL:=https://www.samba.org/ + $(call Package/samba/Default) + TITLE+= net commands DEPENDS:=+libreadline +libncurses endef diff --git a/package/network/services/samba36/files/samba.config b/package/network/services/samba36/files/samba.config index b34a8dcaac..c79db0d322 100644 --- a/package/network/services/samba36/files/samba.config +++ b/package/network/services/samba36/files/samba.config @@ -1,6 +1,6 @@ config samba - option 'name' 'Lede' + option 'name' 'OpenWrt' option 'workgroup' 'WORKGROUP' - option 'description' 'Lede' + option 'description' 'OpenWrt' option 'homes' '1' diff --git a/package/network/services/samba36/files/samba.init b/package/network/services/samba36/files/samba.init index 28b0064df9..ae0e0e230d 100755 --- a/package/network/services/samba36/files/samba.init +++ b/package/network/services/samba36/files/samba.init @@ -23,9 +23,9 @@ smb_header() { local name workgroup description charset local hostname="$(uci_get system.@system[0].hostname)" - config_get name $1 name "${hostname:-Lede}" - config_get workgroup $1 workgroup "${hostname:-Lede}" - config_get description $1 description "Samba on ${hostname:-Lede}" + config_get name $1 name "${hostname:-OpenWrt}" + config_get workgroup $1 workgroup "${hostname:-OpenWrt}" + config_get description $1 description "Samba on ${hostname:-OpenWrt}" config_get charset $1 charset "UTF-8" mkdir -p /var/etc diff --git a/package/network/services/samba36/patches/029-CVE-2017-15275.patch b/package/network/services/samba36/patches/029-CVE-2017-15275.patch new file mode 100644 index 0000000000..055a15e87e --- /dev/null +++ b/package/network/services/samba36/patches/029-CVE-2017-15275.patch @@ -0,0 +1,40 @@ +From c1a22e59f87783d88dfbaeeb132b89be166b2754 Mon Sep 17 00:00:00 2001 +From: Jeremy Allison +Date: Wed, 20 Sep 2017 11:04:50 -0700 +Subject: [PATCH 2/2] s3: smbd: Chain code can return uninitialized memory when + talloc buffer is grown. + +Ensure we zero out unused grown area. + +CVE-2017-15275 + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13077 + +Signed-off-by: Jeremy Allison +--- + source3/smbd/srvstr.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/source3/smbd/srvstr.c ++++ b/source3/smbd/srvstr.c +@@ -70,6 +70,20 @@ ssize_t message_push_string(uint8 **outb + DEBUG(0, ("srvstr_push failed\n")); + return -1; + } ++ ++ /* ++ * Ensure we clear out the extra data we have ++ * grown the buffer by, but not written to. ++ */ ++ if (buf_size + result < buf_size) { ++ return -1; ++ } ++ if (grow_size < result) { ++ return -1; ++ } ++ ++ memset(tmp + buf_size + result, '\0', grow_size - result); ++ + set_message_bcc((char *)tmp, smb_buflen(tmp) + result); + + *outbuf = tmp; diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile index 3d483b692d..648916385c 100644 --- a/package/network/services/uhttpd/Makefile +++ b/package/network/services/uhttpd/Makefile @@ -8,17 +8,18 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uhttpd -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/uhttpd.git -PKG_SOURCE_DATE:=2016-10-25 -PKG_SOURCE_VERSION:=1628fa4b34aa143187353f81e8001b9a15286bda -PKG_MIRROR_HASH:=2ac4ba8dc0b349d72174aac9ff693a73a214295a9890fe3d2a8eedcad54d06e3 +PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git +PKG_SOURCE_DATE:=2017-11-04 +PKG_SOURCE_VERSION:=a235636a2687fafb9c474e4b134a59ff66425c92 +PKG_MIRROR_HASH:=626392a485e8ab8085bb55d9424b176be9143529db59a820a7de71061a93a007 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=ISC PKG_BUILD_DEPENDS = ustream-ssl +PKG_CONFIG_DEPENDS:= CONFIG_uhttpd_lua include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -43,9 +44,6 @@ define Package/uhttpd/description endef define Package/uhttpd/config - config PACKAGE_uhttpd_debug - bool "Build with debug messages" - default n config uhttpd_lua depends on PACKAGE_uhttpd-mod-lua bool "Enable Integrated Lua interpreter" diff --git a/package/network/services/uhttpd/files/uhttpd.config b/package/network/services/uhttpd/files/uhttpd.config index 563c079a1a..a7d769e188 100644 --- a/package/network/services/uhttpd/files/uhttpd.config +++ b/package/network/services/uhttpd/files/uhttpd.config @@ -83,7 +83,7 @@ config uhttpd main option tcp_keepalive 1 # Basic auth realm, defaults to local hostname -# option realm Lede +# option realm OpenWrt # Configuration file in busybox httpd format # option config /etc/httpd.conf diff --git a/package/network/services/uhttpd/files/uhttpd.init b/package/network/services/uhttpd/files/uhttpd.init index 6b8be1c7e4..47270bcc15 100755 --- a/package/network/services/uhttpd/files/uhttpd.init +++ b/package/network/services/uhttpd/files/uhttpd.init @@ -52,7 +52,7 @@ generate_keys() { [ -n "$GENKEY_CMD" ] && { $GENKEY_CMD \ -days ${days:-730} -newkey rsa:${bits:-2048} -keyout "${UHTTPD_KEY}.new" -out "${UHTTPD_CERT}.new" \ - -subj /C="${country:-DE}"/ST="${state:-Saxony}"/L="${location:-Leipzig}"/O="${commonname:-Lede}$UNIQUEID"/CN="${commonname:-Lede}" + -subj /C="${country:-ZZ}"/ST="${state:-Somewhere}"/L="${location:-Unknown}"/O="${commonname:-OpenWrt}$UNIQUEID"/CN="${commonname:-OpenWrt}" sync mv "${UHTTPD_KEY}.new" "${UHTTPD_KEY}" mv "${UHTTPD_CERT}.new" "${UHTTPD_CERT}" diff --git a/package/network/services/umdns/Makefile b/package/network/services/umdns/Makefile index cdafa5be1c..ffbc3fed35 100644 --- a/package/network/services/umdns/Makefile +++ b/package/network/services/umdns/Makefile @@ -10,11 +10,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=umdns PKG_RELEASE:=1 -PKG_SOURCE_URL=$(LEDE_GIT)/project/mdnsd.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/mdnsd.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2017-05-22 -PKG_SOURCE_VERSION:=0e8b948ff8dd1cb1763180c99b522390529c7841 -PKG_MIRROR_HASH:=1cdd25464e1be69bef56092bc8547ba254ffc2d7c32f13cf02a80c8742876f1b +PKG_SOURCE_DATE:=2018-01-02 +PKG_SOURCE_VERSION:=78974417e182a3de8f78b7d73366ec0c98396b6c +PKG_MIRROR_HASH:=a60f9eb9428ac3256cd7c3c6d4207c116cedf4d212b82e2f86c1bf7c7898fcbb PKG_MAINTAINER:=John Crispin PKG_LICENSE:=LGPL-2.1 diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile new file mode 100644 index 0000000000..0cb17e9cc1 --- /dev/null +++ b/package/network/services/wireguard/Makefile @@ -0,0 +1,115 @@ +# +# Copyright (C) 2016-2017 Jason A. Donenfeld +# Copyright (C) 2016 Baptiste Jonglez +# Copyright (C) 2016-2017 Dan Luedtke +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=wireguard + +PKG_VERSION:=0.0.20171221 +PKG_RELEASE:=1 + +PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/ +PKG_HASH:=2b97697e9b271ba8836a04120a287b824648124f21d5309170ec51c1f86ac5ed + +PKG_LICENSE:=GPL-2.0 Apache-2.0 +PKG_LICENSE_FILES:=COPYING + +PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/WireGuard-$(PKG_VERSION) +PKG_BUILD_PARALLEL:=1 +PKG_USE_MIPS16:=0 + +# WireGuard's makefile needs this to know where to build the kernel module +export KERNELDIR:=$(LINUX_DIR) + +include $(INCLUDE_DIR)/package.mk + +define Package/wireguard/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=VPN + URL:=https://www.wireguard.com + MAINTAINER:=Baptiste Jonglez , \ + Dan Luedtke , \ + Jason A. Donenfeld +endef + +define Package/wireguard/Default/description + WireGuard is a novel VPN that runs inside the Linux Kernel and utilizes + state-of-the-art cryptography. It aims to be faster, simpler, leaner, and + more useful than IPSec, while avoiding the massive headache. It intends to + be considerably more performant than OpenVPN. WireGuard is designed as a + general purpose VPN for running on embedded interfaces and super computers + alike, fit for many different circumstances. It uses UDP. +endef + +define Package/wireguard + $(call Package/wireguard/Default) + TITLE:=WireGuard meta-package + DEPENDS:=+wireguard-tools +kmod-wireguard +endef + +include $(INCLUDE_DIR)/kernel-defaults.mk +include $(INCLUDE_DIR)/package-defaults.mk + +# Used by Build/Compile/Default +MAKE_PATH:=src/tools + +define Build/Compile + $(MAKE) $(KERNEL_MAKEOPTS) M="$(PKG_BUILD_DIR)/src" modules + $(call Build/Compile/Default) +endef + +define Package/wireguard/install + true +endef + +define Package/wireguard/description + $(call Package/wireguard/Default/description) +endef + +define Package/wireguard-tools + $(call Package/wireguard/Default) + TITLE:=WireGuard userspace control program (wg) + DEPENDS:=+libmnl +ip +endef + +define Package/wireguard-tools/description + $(call Package/wireguard/Default/description) + + This package provides the userspace control program for WireGuard, + `wg(8)`, and a netifd protocol helper. +endef + +define Package/wireguard-tools/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/tools/wg $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/lib/netifd/proto/ + $(INSTALL_BIN) ./files/wireguard.sh $(1)/lib/netifd/proto/ +endef + +define KernelPackage/wireguard + SECTION:=kernel + CATEGORY:=Kernel modules + SUBMENU:=Network Support + TITLE:=WireGuard kernel module + DEPENDS:=+IPV6:kmod-udptunnel6 +kmod-udptunnel4 + FILES:= $(PKG_BUILD_DIR)/src/wireguard.$(LINUX_KMOD_SUFFIX) + AUTOLOAD:=$(call AutoProbe,wireguard) +endef + +define KernelPackage/wireguard/description + $(call Package/wireguard/Default/description) + + This package provides the kernel module for WireGuard. +endef + +$(eval $(call BuildPackage,wireguard)) +$(eval $(call BuildPackage,wireguard-tools)) +$(eval $(call KernelPackage,wireguard)) diff --git a/package/network/services/wireguard/files/wireguard.sh b/package/network/services/wireguard/files/wireguard.sh new file mode 100644 index 0000000000..7b18a2e0ec --- /dev/null +++ b/package/network/services/wireguard/files/wireguard.sh @@ -0,0 +1,192 @@ +#!/bin/sh +# Copyright 2016-2017 Dan Luedtke +# Licensed to the public under the Apache License 2.0. + + +WG=/usr/bin/wg +if [ ! -x $WG ]; then + logger -t "wireguard" "error: missing wireguard-tools (${WG})" + exit 0 +fi + + +[ -n "$INCLUDE_ONLY" ] || { + . /lib/functions.sh + . ../netifd-proto.sh + init_proto "$@" +} + + +proto_wireguard_init_config() { + proto_config_add_string "private_key" + proto_config_add_int "listen_port" + proto_config_add_int "mtu" + proto_config_add_string "fwmark" + available=1 + no_proto_task=1 +} + + +proto_wireguard_setup_peer() { + local peer_config="$1" + + local public_key + local preshared_key + local allowed_ips + local route_allowed_ips + local endpoint_host + local endpoint_port + local persistent_keepalive + + config_get public_key "${peer_config}" "public_key" + config_get preshared_key "${peer_config}" "preshared_key" + config_get allowed_ips "${peer_config}" "allowed_ips" + config_get_bool route_allowed_ips "${peer_config}" "route_allowed_ips" 0 + config_get endpoint_host "${peer_config}" "endpoint_host" + config_get endpoint_port "${peer_config}" "endpoint_port" + config_get persistent_keepalive "${peer_config}" "persistent_keepalive" + + # peer configuration + echo "[Peer]" >> "${wg_cfg}" + echo "PublicKey=${public_key}" >> "${wg_cfg}" + if [ "${preshared_key}" ]; then + echo "PresharedKey=${preshared_key}" >> "${wg_cfg}" + fi + for allowed_ip in $allowed_ips; do + echo "AllowedIPs=${allowed_ip}" >> "${wg_cfg}" + done + if [ "${endpoint_host}" ]; then + case "${endpoint_host}" in + *:*) + endpoint="[${endpoint_host}]" + ;; + *) + endpoint="${endpoint_host}" + ;; + esac + if [ "${endpoint_port}" ]; then + endpoint="${endpoint}:${endpoint_port}" + else + endpoint="${endpoint}:51820" + fi + echo "Endpoint=${endpoint}" >> "${wg_cfg}" + fi + if [ "${persistent_keepalive}" ]; then + echo "PersistentKeepalive=${persistent_keepalive}" >> "${wg_cfg}" + fi + + # add routes for allowed ips + if [ ${route_allowed_ips} -ne 0 ]; then + for allowed_ip in ${allowed_ips}; do + case "${allowed_ip}" in + *:*/*) + proto_add_ipv6_route "${allowed_ip%%/*}" "${allowed_ip##*/}" + ;; + *.*/*) + proto_add_ipv4_route "${allowed_ip%%/*}" "${allowed_ip##*/}" + ;; + *:*) + proto_add_ipv6_route "${allowed_ip%%/*}" "128" + ;; + *.*) + proto_add_ipv4_route "${allowed_ip%%/*}" "32" + ;; + esac + done + fi +} + + +proto_wireguard_setup() { + local config="$1" + local wg_dir="/tmp/wireguard" + local wg_cfg="${wg_dir}/${config}" + + local private_key + local listen_port + local mtu + + # load configuration + config_load network + config_get private_key "${config}" "private_key" + config_get listen_port "${config}" "listen_port" + config_get addresses "${config}" "addresses" + config_get mtu "${config}" "mtu" + config_get fwmark "${config}" "fwmark" + + # create interface + ip link del dev "${config}" 2>/dev/null + ip link add dev "${config}" type wireguard + + if [ "${mtu}" ]; then + ip link set mtu "${mtu}" dev "${config}" + fi + + proto_init_update "${config}" 1 + + # generate configuration file + umask 077 + mkdir -p "${wg_dir}" + echo "[Interface]" > "${wg_cfg}" + echo "PrivateKey=${private_key}" >> "${wg_cfg}" + if [ "${listen_port}" ]; then + echo "ListenPort=${listen_port}" >> "${wg_cfg}" + fi + if [ "${fwmark}" ]; then + echo "FwMark=${fwmark}" >> "${wg_cfg}" + fi + config_foreach proto_wireguard_setup_peer "wireguard_${config}" + + # apply configuration file + ${WG} setconf ${config} "${wg_cfg}" + WG_RETURN=$? + + # delete configuration file + rm -f "${wg_cfg}" + + # check status + if [ ${WG_RETURN} -ne 0 ]; then + sleep 5 + proto_setup_failed "${config}" + exit 1 + fi + + # add ip addresses + for address in ${addresses}; do + case "${address}" in + *:*/*) + proto_add_ipv6_address "${address%%/*}" "${address##*/}" + ;; + *.*/*) + proto_add_ipv4_address "${address%%/*}" "${address##*/}" + ;; + *:*) + proto_add_ipv6_address "${address%%/*}" "128" + ;; + *.*) + proto_add_ipv4_address "${address%%/*}" "32" + ;; + esac + done + + # endpoint dependency + wg show "${config}" endpoints | \ + sed -E 's/\[?([0-9.:a-f]+)\]?:([0-9]+)/\1 \2/' | \ + while IFS=$'\t ' read -r key address port; do + [ -n "${port}" ] || continue + proto_add_host_dependency "${config}" "${address}" + done + + proto_send_update "${config}" +} + + +proto_wireguard_teardown() { + local config="$1" + ip link del dev "${config}" >/dev/null 2>&1 +} + + +[ -n "$INCLUDE_ONLY" ] || { + add_protocol wireguard +} diff --git a/package/network/services/wireguard/patches/100-portability.patch b/package/network/services/wireguard/patches/100-portability.patch new file mode 100644 index 0000000000..b26d51ebd8 --- /dev/null +++ b/package/network/services/wireguard/patches/100-portability.patch @@ -0,0 +1,18 @@ +tools: fix portability issue + +Check if the compiler defines __linux__, instead of assuming that the +host OS is the same as the target OS. + +Signed-off-by: Felix Fietkau +--- +--- a/src/tools/Makefile ++++ b/src/tools/Makefile +@@ -43,7 +43,7 @@ CFLAGS += -DRUNSTATEDIR="\"$(RUNSTATEDIR + ifeq ($(DEBUG_TOOLS),y) + CFLAGS += -g + endif +-ifeq ($(shell uname -s),Linux) ++ifeq ($(strip $(shell echo __linux__ | $(CC) -E - | grep -v '^\#')),1) + LIBMNL_CFLAGS := $(shell $(PKG_CONFIG) --cflags libmnl 2>/dev/null) + LIBMNL_LDLIBS := $(shell $(PKG_CONFIG) --libs libmnl 2>/dev/null || echo -lmnl) + CFLAGS += $(LIBMNL_CFLAGS) diff --git a/package/network/utils/arptables/Makefile b/package/network/utils/arptables/Makefile index d2fd2593a6..d1168ae68f 100644 --- a/package/network/utils/arptables/Makefile +++ b/package/network/utils/arptables/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=arptables PKG_RELEASE:=1 -PKG_SOURCE_URL:=git://git.netfilter.org/arptables +PKG_SOURCE_URL:=https://git.netfilter.org/arptables PKG_SOURCE_PROTO:=git PKG_SOURCE_DATE:=2015-05-20 PKG_SOURCE_VERSION:=f4ab8f63f11a72f14687a6646d04ae1bae3fa45f diff --git a/package/network/utils/comgt/Makefile b/package/network/utils/comgt/Makefile index ce99a2a688..3b7f4b9022 100644 --- a/package/network/utils/comgt/Makefile +++ b/package/network/utils/comgt/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=comgt PKG_VERSION:=0.32 -PKG_RELEASE:=29 +PKG_RELEASE:=30 PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz PKG_SOURCE_URL:=@SF/comgt diff --git a/package/network/utils/comgt/files/3g.sh b/package/network/utils/comgt/files/3g.sh index d438cb7a6d..0d02d4c4b9 100644 --- a/package/network/utils/comgt/files/3g.sh +++ b/package/network/utils/comgt/files/3g.sh @@ -109,4 +109,4 @@ proto_3g_teardown() { proto_kill_command "$interface" } -[ -z "NOT_INCLUDED" ] || add_protocol 3g +[ -z "$NOT_INCLUDED" ] || add_protocol 3g diff --git a/package/network/utils/comgt/files/directip.sh b/package/network/utils/comgt/files/directip.sh index 381bfb0000..3452fa5db7 100644 --- a/package/network/utils/comgt/files/directip.sh +++ b/package/network/utils/comgt/files/directip.sh @@ -44,8 +44,7 @@ proto_directip_setup() { return 1 } - cardinfo=$(gcom -d "$device" -s /etc/gcom/getcardinfo.gcom) - [ -n $(echo "$cardinfo" | grep -q "Sierra Wireless") ] || { + gcom -d "$device" -s /etc/gcom/getcardinfo.gcom | grep -q "Sierra Wireless" || { proto_notify_error "$interface" BAD_DEVICE proto_block_restart "$interface" return 1 diff --git a/package/network/utils/conntrack-tools/Makefile b/package/network/utils/conntrack-tools/Makefile index 128fa9e6f3..f04ac69d2e 100644 --- a/package/network/utils/conntrack-tools/Makefile +++ b/package/network/utils/conntrack-tools/Makefile @@ -8,18 +8,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=conntrack-tools -PKG_VERSION:=1.4.4 PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://www.netfilter.org/projects/conntrack-tools/files \ - ftp://ftp.netfilter.org/pub/conntrack-tools \ - http://mirrors.evolva.ro/netfilter.org/conntrack-tools -PKG_HASH:=b7caf4fcc4c03575df57d25e5216584d597fd916c891f191dac616ce68bdba6c +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://git.netfilter.org/conntrack-tools +PKG_SOURCE_DATE:=2017-09-27 +PKG_SOURCE_VERSION:=eefe649ca51ed0cbb995454cdc366f5072f6443c +PKG_MIRROR_HASH:=1c207c3e423d741fbb31e3c29486a811e6dad493f26ec47a2df75b6262a1b4bd PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 +PKG_CPE_ID:=cpe:/a:conntrack-tools_project:conntrack-tools PKG_FIXUP:=autoreconf PKG_INSTALL:=1 diff --git a/package/network/utils/curl/Config.in b/package/network/utils/curl/Config.in index 6fa10b6781..973da3d964 100644 --- a/package/network/utils/curl/Config.in +++ b/package/network/utils/curl/Config.in @@ -9,8 +9,8 @@ choice config LIBCURL_MBEDTLS bool "mbed TLS" - config LIBCURL_CYASSL - bool "CyaSSL" + config LIBCURL_WOLFSSL + bool "wolfSSL" config LIBCURL_OPENSSL bool "OpenSSL" @@ -101,6 +101,10 @@ config LIBCURL_TFTP bool "TFTP protocol" default n +config LIBCURL_NGHTTP2 + bool "HTTP2 protocol" + default n + comment "Miscellaneous" config LIBCURL_PROXY diff --git a/package/network/utils/curl/Makefile b/package/network/utils/curl/Makefile index 5d510a4d39..17fcf704de 100644 --- a/package/network/utils/curl/Makefile +++ b/package/network/utils/curl/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=curl -PKG_VERSION:=7.54.1 +PKG_VERSION:=7.57.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 @@ -16,10 +16,11 @@ PKG_SOURCE_URL:=https://dl.uxnr.de/mirror/curl/ \ http://curl.mirror.anstey.ca/ \ http://curl.askapache.com/download/ \ https://curl.haxx.se/download/ -PKG_HASH:=fdfc4df2d001ee0c44ec071186e770046249263c491fcae48df0e1a3ca8f25a0 +PKG_HASH:=c92fe31a348eae079121b73884065e600c533493eb50f1f6cee9c48a3f454826 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:haxx:libcurl PKG_FIXUP:=autoreconf PKG_BUILD_PARALLEL:=1 @@ -27,7 +28,7 @@ PKG_BUILD_PARALLEL:=1 PKG_CONFIG_DEPENDS:= \ CONFIG_IPV6 \ \ - CONFIG_LIBCURL_CYASSL \ + CONFIG_LIBCURL_WOLFSSL \ CONFIG_LIBCURL_GNUTLS \ CONFIG_LIBCURL_OPENSSL \ CONFIG_LIBCURL_MBEDTLS \ @@ -53,6 +54,7 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_LIBCURL_SMTP \ CONFIG_LIBCURL_TELNET \ CONFIG_LIBCURL_TFTP \ + CONFIG_LIBCURL_NGHTTP2 \ \ CONFIG_LIBCURL_COOKIES \ CONFIG_LIBCURL_CRYPTO_AUTH \ @@ -84,8 +86,9 @@ define Package/libcurl $(call Package/curl/Default) SECTION:=libs CATEGORY:=Libraries - DEPENDS:= +LIBCURL_CYASSL:libcyassl +LIBCURL_OPENSSL:libopenssl +LIBCURL_GNUTLS:libgnutls +LIBCURL_MBEDTLS:libmbedtls - DEPENDS += +LIBCURL_ZLIB:zlib +LIBCURL_THREADED_RESOLVER:libpthread +LIBCURL_LDAP:libopenldap +LIBCURL_LIBIDN:libidn +LIBCURL_SSH2:libssh2 + DEPENDS:= +LIBCURL_WOLFSSL:libwolfssl +LIBCURL_OPENSSL:libopenssl +LIBCURL_GNUTLS:libgnutls +LIBCURL_MBEDTLS:libmbedtls + DEPENDS += +LIBCURL_ZLIB:zlib +LIBCURL_THREADED_RESOLVER:libpthread +LIBCURL_LDAP:libopenldap +LIBCURL_LIBIDN:libidn + DEPENDS += +LIBCURL_SSH2:libssh2 +LIBCURL_NGHTTP2:libnghttp2 TITLE:=A client-side URL transfer library MENU:=1 endef @@ -111,7 +114,7 @@ CONFIGURE_ARGS += \ \ $(call autoconf_bool,CONFIG_IPV6,ipv6) \ \ - $(if $(CONFIG_LIBCURL_CYASSL),--with-cyassl="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-cyassl) \ + $(if $(CONFIG_LIBCURL_WOLFSSL),--with-cyassl="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-cyassl) \ $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-gnutls) \ $(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-ssl) \ $(if $(CONFIG_LIBCURL_MBEDTLS),--with-mbedtls="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-mbedtls) \ @@ -119,6 +122,7 @@ CONFIGURE_ARGS += \ $(if $(CONFIG_LIBCURL_LIBIDN),--with-libidn="$(STAGING_DIR)/usr",--without-libidn) \ $(if $(CONFIG_LIBCURL_SSH2),--with-libssh2="$(STAGING_DIR)/usr",--without-libssh2) \ $(if $(CONFIG_LIBCURL_ZLIB),--with-zlib="$(STAGING_DIR)/usr",--without-zlib) \ + $(if $(CONFIG_LIBCURL_NGHTTP2),--with-nghttp2="$(STAGING_DIR)/usr",--without-nghttp2) \ \ $(call autoconf_bool,CONFIG_LIBCURL_DICT,dict) \ $(call autoconf_bool,CONFIG_LIBCURL_FILE,file) \ diff --git a/package/network/utils/curl/patches/200-no_docs_tests.patch b/package/network/utils/curl/patches/200-no_docs_tests.patch index f5a158bf9c..a2a6851252 100644 --- a/package/network/utils/curl/patches/200-no_docs_tests.patch +++ b/package/network/utils/curl/patches/200-no_docs_tests.patch @@ -1,22 +1,22 @@ --- a/Makefile.am +++ b/Makefile.am -@@ -154,8 +154,8 @@ - +@@ -156,7 +156,7 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) bin_SCRIPTS = curl-config --SUBDIRS = lib docs src include --DIST_SUBDIRS = $(SUBDIRS) tests packages scripts -+SUBDIRS = lib src include -+DIST_SUBDIRS = $(SUBDIRS) packages + SUBDIRS = lib src +-DIST_SUBDIRS = $(SUBDIRS) tests packages scripts include docs ++DIST_SUBDIRS = $(SUBDIRS) packages include pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libcurl.pc -@@ -275,7 +275,7 @@ +@@ -267,8 +267,8 @@ cygwinbin: # We extend the standard install with a custom hook: install-data-hook: cd include && $(MAKE) install - cd docs && $(MAKE) install -+# cd docs && $(MAKE) install +- cd docs/libcurl && $(MAKE) install ++ #cd docs && $(MAKE) install ++ #cd docs/libcurl && $(MAKE) install # We extend the standard uninstall with a custom hook: uninstall-hook: diff --git a/package/network/utils/curl/patches/310-mbedtls-disable-runtime-version-check.patch b/package/network/utils/curl/patches/310-mbedtls-disable-runtime-version-check.patch index ef9c4b8070..aabf274ac8 100644 --- a/package/network/utils/curl/patches/310-mbedtls-disable-runtime-version-check.patch +++ b/package/network/utils/curl/patches/310-mbedtls-disable-runtime-version-check.patch @@ -1,8 +1,8 @@ --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c -@@ -796,7 +796,7 @@ +@@ -814,7 +814,7 @@ static void Curl_mbedtls_session_free(vo - size_t Curl_mbedtls_version(char *buffer, size_t size) + static size_t Curl_mbedtls_version(char *buffer, size_t size) { - unsigned int version = mbedtls_version_get_number(); + unsigned int version = MBEDTLS_VERSION_NUMBER; diff --git a/package/network/utils/ebtables/Makefile b/package/network/utils/ebtables/Makefile index da7b7416af..693b4d8f0c 100644 --- a/package/network/utils/ebtables/Makefile +++ b/package/network/utils/ebtables/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ebtables -PKG_SOURCE_DATE:=2015-10-28 +PKG_SOURCE_DATE:=2017-10-24 PKG_RELEASE:=1 -PKG_SOURCE_URL:=git://git.netfilter.org/ebtables +PKG_SOURCE_URL:=https://git.netfilter.org/ebtables PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=4c3e5cd3dbae3ea773e9dcca7cf019b2713af70d -PKG_MIRROR_HASH:=997a877da02d6e2141e6d31c5d4dd005737facecfdbea07308c0e1286db8591c +PKG_SOURCE_VERSION:=6a826591878db3fa9e2a94b87a3d5edd8e0fc442 +PKG_MIRROR_HASH:=7100f34f8d9373c88a788e8161f8158b364b4d6c87f766fc353382b6111196bd PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/iperf/Makefile b/package/network/utils/iperf/Makefile index ea8f026315..2f420a2e26 100644 --- a/package/network/utils/iperf/Makefile +++ b/package/network/utils/iperf/Makefile @@ -8,17 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iperf -PKG_VERSION:=2.0.9 -PKG_VERSION_SUFFIX:=a +PKG_VERSION:=2.0.10 PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)$(PKG_VERSION_SUFFIX).tar.gz -# Temporary URL change - iperf upstream altered the already released target -# without bumping the version number. The new tarball is renamed to avoid -# conflicts with existing mirrored files. -# PKG_SOURCE_URL:=@SF/iperf2 -PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources -PKG_HASH:=db02911f35686e808ed247160dfa766e08ae3f59d1e7dcedef0ffb2a6643f0bf +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_HASH:=7fe4348dcca313b74e0aa9c34a8ccd713b84a5615b8578f4aa94cedce9891ef2 +PKG_SOURCE_URL:=@SF/iperf2 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause diff --git a/package/network/utils/iperf3/Makefile b/package/network/utils/iperf3/Makefile index 1b94ce70fa..a64d7396a2 100644 --- a/package/network/utils/iperf3/Makefile +++ b/package/network/utils/iperf3/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iperf -PKG_VERSION:=3.2 +PKG_VERSION:=3.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://downloads.es.net/pub/iperf -PKG_HASH:=f207b36f861485845dbdf09f909c62f3d2222a3cf3d2682095aede8213cd9c1d +PKG_HASH:=6f596271251056bffc11bbb8f17d4244ad9a7d4a317c2459fdbb853ae51284d8 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause diff --git a/package/network/utils/iperf3/patches/010-fix-openssl-ac-macro.patch b/package/network/utils/iperf3/patches/010-fix-openssl-ac-macro.patch deleted file mode 100644 index d49e421ae2..0000000000 --- a/package/network/utils/iperf3/patches/010-fix-openssl-ac-macro.patch +++ /dev/null @@ -1,41 +0,0 @@ -commit 3fd1a2ae907bff2d7593c0bb9944aa05eca7b58d -Author: ralcini -Date: Mon Aug 14 22:43:38 2017 +0200 - - fix for issue #624 - force build without openssl (#631) - - * fix: now --without-openssl configure flags works - enh: if openssl support is required and no valid installation is found, now it raise an error - - * enh: added warning if building without openssl (iperf_auth disabled) - -diff --git a/configure.ac b/configure.ac -index 3c56cb3..79f3869 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -101,13 +101,18 @@ AC_CHECK_HEADERS([netinet/sctp.h], - #endif - ]) - --# Check for OPENSSL support --AX_CHECK_OPENSSL( -- AC_DEFINE([HAVE_SSL], [1], [OpenSSL Is Available]) --) --LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS" --LIBS="$OPENSSL_LIBS $LIBS" --CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS" -+if test "x$with_openssl" = "xno"; then -+ AC_MSG_WARN( [Building without OpenSSL; disabling iperf_auth functionality.] ) -+else -+ # Check for OPENSSL support -+ AX_CHECK_OPENSSL( -+ [ AC_DEFINE([HAVE_SSL], [1], [OpenSSL Is Available]) ], -+ [ AC_MSG_FAILURE([--with-openssl was given, but test for openssl failed]) ] -+ ) -+ LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS" -+ LIBS="$OPENSSL_LIBS $LIBS" -+ CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS" -+fi - - # Check for TCP_CONGESTION sockopt (believed to be Linux and FreeBSD only) - AC_CACHE_CHECK([TCP_CONGESTION socket option], diff --git a/package/network/utils/iperf3/patches/010-iperf-3.3-fix-build-warnings.patch b/package/network/utils/iperf3/patches/010-iperf-3.3-fix-build-warnings.patch new file mode 100644 index 0000000000..d617ba9f40 --- /dev/null +++ b/package/network/utils/iperf3/patches/010-iperf-3.3-fix-build-warnings.patch @@ -0,0 +1,300 @@ +The following patches are taken directly from: + +https://github.com/esnet/iperf/pull/664 + +as an upstream submission. + +commit b63d41b25f49a76d0be66edfb61bd4cb68921d55 +Author: Philip Prindeville +Date: Tue Oct 31 13:41:08 2017 -0600 + + Fix warnings about _GNU_SOURCE being redefined. + + Signed-off-by: Philip Prindeville + +diff --git a/src/iperf.h b/src/iperf.h +index bb951dc..b656784 100755 +--- a/src/iperf.h ++++ b/src/iperf.h +@@ -36,7 +36,9 @@ + #endif + #include + #include +-#define _GNU_SOURCE ++#ifndef _GNU_SOURCE ++# define _GNU_SOURCE ++#endif + #include + + #if defined(HAVE_CPUSET_SETAFFINITY) +diff --git a/src/iperf_api.c b/src/iperf_api.c +index ab30b93..9e41238 100755 +--- a/src/iperf_api.c ++++ b/src/iperf_api.c +@@ -24,7 +24,9 @@ + * This code is distributed under a BSD style license, see the LICENSE file + * for complete information. + */ +-#define _GNU_SOURCE ++#ifndef _GNU_SOURCE ++# define _GNU_SOURCE ++#endif + #define __USE_GNU + + #include "iperf_config.h" + +commit 315254cfc5f5682627f4a46ade3100bc3c64cfcc +Author: Philip Prindeville +Date: Tue Oct 31 13:42:58 2017 -0600 + + Fix warnings of format-specified mismatching type + + Signed-off-by: Philip Prindeville + +diff --git a/src/iperf_tcp.c b/src/iperf_tcp.c +index 91cf032..6f86d5d 100644 +--- a/src/iperf_tcp.c ++++ b/src/iperf_tcp.c +@@ -24,8 +24,6 @@ + * This code is distributed under a BSD style license, see the LICENSE + * file for complete information. + */ +-#include "iperf_config.h" +- + #include + #include + #include +@@ -44,6 +42,12 @@ + #include "net.h" + #include "cjson.h" + ++#if defined(HAVE_INTTYPES_H) ++# include ++#else ++# define PRIu64 "llu" ++#endif ++ + #if defined(HAVE_FLOWLABEL) + #include "flowlabel.h" + #endif /* HAVE_FLOWLABEL */ +@@ -90,7 +94,7 @@ iperf_tcp_send(struct iperf_stream *sp) + sp->result->bytes_sent_this_interval += r; + + if (sp->test->debug) +- printf("sent %d bytes of %d, total %llu\n", r, sp->settings->blksize, sp->result->bytes_sent); ++ printf("sent %d bytes of %d, total %" PRIu64 "\n", r, sp->settings->blksize, sp->result->bytes_sent); + + return r; + } +diff --git a/src/iperf_udp.c b/src/iperf_udp.c +index a2ea6d0..d04ae44 100644 +--- a/src/iperf_udp.c ++++ b/src/iperf_udp.c +@@ -48,6 +48,12 @@ + #include "cjson.h" + #include "portable_endian.h" + ++#if defined(HAVE_INTTYPES_H) ++# include ++#else ++# define PRIu64 "llu" ++#endif ++ + /* iperf_udp_recv + * + * receives the data for UDP +@@ -98,7 +104,7 @@ iperf_udp_recv(struct iperf_stream *sp) + } + + if (sp->test->debug) +- fprintf(stderr, "pcount %llu packet_count %d\n", pcount, sp->packet_count); ++ fprintf(stderr, "pcount %" PRIu64 " packet_count %d\n", pcount, sp->packet_count); + + /* + * Try to handle out of order packets. The way we do this +@@ -141,7 +147,7 @@ iperf_udp_recv(struct iperf_stream *sp) + + /* Log the out-of-order packet */ + if (sp->test->debug) +- fprintf(stderr, "OUT OF ORDER - incoming packet sequence %llu but expected sequence %d on stream %d", pcount, sp->packet_count, sp->socket); ++ fprintf(stderr, "OUT OF ORDER - incoming packet sequence %" PRIu64 " but expected sequence %d on stream %d", pcount, sp->packet_count, sp->socket); + } + + /* +@@ -220,7 +226,7 @@ iperf_udp_send(struct iperf_stream *sp) + sp->result->bytes_sent_this_interval += r; + + if (sp->test->debug) +- printf("sent %d bytes of %d, total %llu\n", r, sp->settings->blksize, sp->result->bytes_sent); ++ printf("sent %d bytes of %d, total %" PRIu64 "\n", r, sp->settings->blksize, sp->result->bytes_sent); + + return r; + } + +commit 9a66b3b0349e0a158bb4940b668a5cbc7c245762 +Author: Philip Prindeville +Date: Tue Oct 31 13:44:34 2017 -0600 + + Simplify endianness checks + + Linux can be built with too many types of C run-time library and it's + not reasonable to have to enumerate all of them, especially since at + least one of them (MUSL) goes out of its way to not be easily + detectable. + + Instead, leverage autoconf better for Linux/BSD to detect either + or directly. + + Signed-off-by: Philip Prindeville + +diff --git a/configure.ac b/configure.ac +index f57e83f..cfb42ac 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -101,6 +101,14 @@ AC_CHECK_HEADERS([netinet/sctp.h], + #endif + ]) + ++AC_CHECK_HEADER([endian.h], ++ AC_DEFINE([HAVE_ENDIAN_H], [1], [Define to 1 if you have the header file.]), ++ AC_CHECK_HEADER([sys/endian.h], ++ AC_DEFINE([HAVE_SYS_ENDIAN_H], [1], [Define to 1 if you have the header file.]), ++ AC_MSG_WARN([Couldn't find endian.h or sys/endian.h files: doing compile-time tests.]) ++ ) ++ ) ++ + if test "x$with_openssl" = "xno"; then + AC_MSG_WARN( [Building without OpenSSL; disabling iperf_auth functionality.] ) + else +diff --git a/src/iperf_config.h.in b/src/iperf_config.h.in +index bd03935..a9e51ec 100644 +--- a/src/iperf_config.h.in ++++ b/src/iperf_config.h.in +@@ -9,6 +9,9 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_DLFCN_H + ++/* Define to 1 if you have the header file. */ ++#undef HAVE_ENDIAN_H ++ + /* Have IPv6 flowlabel support. */ + #undef HAVE_FLOWLABEL + +@@ -54,6 +57,9 @@ + /* Define to 1 if the system has the type `struct sctp_assoc_value'. */ + #undef HAVE_STRUCT_SCTP_ASSOC_VALUE + ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_ENDIAN_H ++ + /* Define to 1 if you have the header file. */ + #undef HAVE_SYS_SOCKET_H + +diff --git a/src/portable_endian.h b/src/portable_endian.h +index b86d37a..5dbc6e5 100644 +--- a/src/portable_endian.h ++++ b/src/portable_endian.h +@@ -10,14 +10,33 @@ + + #endif + +-// GLIBC / Linux with endian(3) support, which was added in glibc 2.9. +-// Intended to support CentOS 6 and newer. +-#if defined(__linux__) && \ +- ((__GLIBC__ > 3) || \ +- (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9)) +- ++#if defined(HAVE_ENDIAN_H) + # include + ++#elif defined(HAVE_SYS_ENDIAN_H) ++# include ++ ++# if defined(__OpenBSD__) ++ ++# define be16toh(x) betoh16(x) ++# define le16toh(x) letoh16(x) ++ ++# define be32toh(x) betoh32(x) ++# define le32toh(x) letoh32(x) ++ ++# define be64toh(x) betoh64(x) ++# define le64toh(x) letoh64(x) ++ ++# elif defined(__sgi) ++ ++# include ++# include ++ ++# define be64toh(x) (x) ++# define htobe64(x) (x) ++ ++# endif ++ + #elif defined(__CYGWIN__) + + # include +@@ -46,32 +65,6 @@ + # define __LITTLE_ENDIAN LITTLE_ENDIAN + # define __PDP_ENDIAN PDP_ENDIAN + +-#elif defined(__OpenBSD__) +- +-# include +- +-# define be16toh(x) betoh16(x) +-# define le16toh(x) letoh16(x) +- +-# define be32toh(x) betoh32(x) +-# define le32toh(x) letoh32(x) +- +-# define be64toh(x) betoh64(x) +-# define le64toh(x) letoh64(x) +- +-#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) +- +-# include +- +-#elif defined(__sgi) +- +-# include +-# include +-# include +- +-# define be64toh(x) (x) +-# define htobe64(x) (x) +- + #elif defined(__sun) && defined(__SVR4) + + # include + +commit 7e7285d0daf92ef7beda8f78a6f63cc647a77f38 +Author: Philip Prindeville +Date: Tue Oct 31 13:48:06 2017 -0600 + + Sys headers should not be included directly + + There's usually a top-level header which then includes the sys/ + descendent. + + Signed-off-by: Philip Prindeville + +diff --git a/src/net.c b/src/net.c +index af456cb..afd0022 100644 +--- a/src/net.c ++++ b/src/net.c +@@ -31,13 +31,12 @@ + #include + #include + #include +-#include + #include + #include + #include + #include + #include +-#include ++#include + + #ifdef HAVE_SENDFILE + #ifdef linux diff --git a/package/network/utils/iperf3/patches/100-iperf_auth-rsa-header.patch b/package/network/utils/iperf3/patches/100-iperf_auth-rsa-header.patch deleted file mode 100644 index fa78d91b17..0000000000 --- a/package/network/utils/iperf3/patches/100-iperf_auth-rsa-header.patch +++ /dev/null @@ -1,17 +0,0 @@ -commit 31d5b6b580a356c5149dbc4f53118b7f83c60822 -Author: Philip Prindeville -Date: Sun Jul 30 18:54:46 2017 -0600 -Subject: Add required RSA header for OpenSSL - -Signed-off-by: Philip Prindeville - ---- a/src/iperf_auth.c 2017-06-26 11:42:56.000000000 -0600 -+++ b/src/iperf_auth.c 2017-07-30 17:42:43.070447875 -0600 -@@ -40,6 +40,7 @@ - #include - #include - #include -+#include - - void sha256(const char *string, char outputBuffer[65]) - { diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile index 364c1b22a1..5f718748db 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -8,18 +8,20 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iproute2 -PKG_VERSION:=4.11.0 -PKG_RELEASE:=1 +PKG_VERSION:=4.14.1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2 -PKG_HASH:=72671028bda696d0cb8f48ec8e702581c3a501caeed33eec3a81d7041cbc8026 +PKG_HASH:=d43ac068afcc350a448f4581b6e292331ef7e4e7aa746e34981582d5fdb10067 PKG_BUILD_PARALLEL:=1 PKG_BUILD_DEPENDS:=iptables PKG_LICENSE:=GPL-2.0 +PKG_CPE_ID:=cpe:/a:iproute2_project:iproute2 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/package.mk define Package/iproute2/Default @@ -28,7 +30,6 @@ define Package/iproute2/Default URL:=http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2 SUBMENU:=Routing and Redirection MAINTAINER:=Russell Senior - DEPENDS:= +libnl-tiny endef define Package/ip-tiny @@ -37,6 +38,7 @@ $(call Package/iproute2/Default) VARIANT:=tiny PROVIDES:=ip ALTERNATIVES:=200:/sbin/ip:/sbin/ip-tiny + DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/ip-full @@ -45,32 +47,37 @@ $(call Package/iproute2/Default) VARIANT:=full PROVIDES:=ip ALTERNATIVES:=300:/sbin/ip:/sbin/ip-full + DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/tc $(call Package/iproute2/Default) TITLE:=Traffic control utility - DEPENDS:=+kmod-sched-core + DEPENDS:=+kmod-sched-core +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/genl $(call Package/iproute2/Default) TITLE:=General netlink utility frontend + DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/ip-bridge $(call Package/iproute2/Default) TITLE:=Bridge configuration utility from iproute2 + DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/ss $(call Package/iproute2/Default) TITLE:=Socket statistics utility + DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/nstat $(call Package/iproute2/Default) TITLE:=Network statistics utility + DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/devlink @@ -79,17 +86,31 @@ $(call Package/iproute2/Default) DEPENDS:=+libmnl endef +define Package/rdma +$(call Package/iproute2/Default) + TITLE:=Network rdma utility + DEPENDS:=+libmnl +endef + ifeq ($(BUILD_VARIANT),tiny) IP_CONFIG_TINY:=y endif +ifdef CONFIG_PACKAGE_devlink + HAVE_MNL:=y +endif + +ifdef CONFIG_PACKAGE_rdma + HAVE_MNL:=y +endif + define Build/Configure $(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile $(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \ $(PKG_BUILD_DIR)/Makefile $(SED) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \ $(PKG_BUILD_DIR)/Makefile - echo "static const char SNAPSHOT[] = \"$(PKG_VERSION)-$(PKG_RELEASE)-lede\";" \ + echo "static const char SNAPSHOT[] = \"$(PKG_VERSION)-$(PKG_RELEASE)-openwrt\";" \ > $(PKG_BUILD_DIR)/include/SNAPSHOT.h endef @@ -101,6 +122,7 @@ MAKE_FLAGS += \ SHARED_LIBS="" \ LDFLAGS="$(TARGET_LDFLAGS) -Wl,--gc-sections" \ IP_CONFIG_TINY=$(IP_CONFIG_TINY) \ + HAVE_MNL=$(HAVE_MNL) \ IPT_LIB_DIR=/usr/lib/iptables \ FPIC="$(FPIC)" @@ -157,6 +179,11 @@ define Package/devlink/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/devlink/devlink $(1)/usr/sbin/ endef +define Package/rdma/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/rdma/rdma $(1)/usr/sbin/ +endef + $(eval $(call BuildPackage,ip-tiny)) $(eval $(call BuildPackage,ip-full)) $(eval $(call BuildPackage,tc)) @@ -165,3 +192,4 @@ $(eval $(call BuildPackage,ip-bridge)) $(eval $(call BuildPackage,ss)) $(eval $(call BuildPackage,nstat)) $(eval $(call BuildPackage,devlink)) +$(eval $(call BuildPackage,rdma)) diff --git a/package/network/utils/iproute2/patches/001-config.patch b/package/network/utils/iproute2/patches/001-config.patch index b3208e063e..7f23cfc35e 100644 --- a/package/network/utils/iproute2/patches/001-config.patch +++ b/package/network/utils/iproute2/patches/001-config.patch @@ -1,8 +1,7 @@ --- /dev/null +++ b/Config -@@ -0,0 +1,5 @@ +@@ -0,0 +1,4 @@ +# Fixed config to disable ATM support even if present on host system +IP_CONFIG_SETNS:=y +TC_CONFIG_ATM:=n +TC_CONFIG_XT:=y -+HAVE_MNL:=y diff --git a/package/network/utils/iproute2/patches/004-darwin_fixes.patch b/package/network/utils/iproute2/patches/004-darwin_fixes.patch index e1a5e97568..1f3eb101ea 100644 --- a/package/network/utils/iproute2/patches/004-darwin_fixes.patch +++ b/package/network/utils/iproute2/patches/004-darwin_fixes.patch @@ -42,7 +42,7 @@ #define TABLESIZE 16384 --- a/netem/paretonormal.c +++ b/netem/paretonormal.c -@@ -15,10 +15,13 @@ +@@ -14,10 +14,13 @@ #include #include #include diff --git a/package/network/utils/iproute2/patches/006-no_sctp.patch b/package/network/utils/iproute2/patches/006-no_sctp.patch index 0f6f269d40..e23fbcd77d 100644 --- a/package/network/utils/iproute2/patches/006-no_sctp.patch +++ b/package/network/utils/iproute2/patches/006-no_sctp.patch @@ -1,6 +1,6 @@ --- a/ip/ipxfrm.c +++ b/ip/ipxfrm.c -@@ -465,7 +465,6 @@ void xfrm_selector_print(struct xfrm_sel +@@ -454,7 +454,6 @@ void xfrm_selector_print(struct xfrm_sel switch (sel->proto) { case IPPROTO_TCP: case IPPROTO_UDP: @@ -8,7 +8,7 @@ case IPPROTO_DCCP: default: /* XXX */ if (sel->sport_mask) -@@ -1321,7 +1320,6 @@ static int xfrm_selector_upspec_parse(st +@@ -1329,7 +1328,6 @@ static int xfrm_selector_upspec_parse(st switch (sel->proto) { case IPPROTO_TCP: case IPPROTO_UDP: diff --git a/package/network/utils/iproute2/patches/007-no_arpd.patch b/package/network/utils/iproute2/patches/007-no_arpd.patch index 94fb197a45..ac216ba825 100644 --- a/package/network/utils/iproute2/patches/007-no_arpd.patch +++ b/package/network/utils/iproute2/patches/007-no_arpd.patch @@ -2,7 +2,7 @@ +++ b/misc/Makefile @@ -5,9 +5,9 @@ TARGETS=ss nstat ifstat rtacct lnstat - include ../Config + include ../config.mk -ifeq ($(HAVE_BERKELEY_DB),y) - TARGETS += arpd @@ -11,5 +11,5 @@ +# TARGETS += arpd +#endif - ifeq ($(HAVE_SELINUX),y) - LDLIBS += $(shell $(PKG_CONFIG) --libs libselinux) + all: $(TARGETS) + diff --git a/package/network/utils/iproute2/patches/008-no_netem.patch b/package/network/utils/iproute2/patches/008-no_netem.patch index 47ffd9946d..2e088f1993 100644 --- a/package/network/utils/iproute2/patches/008-no_netem.patch +++ b/package/network/utils/iproute2/patches/008-no_netem.patch @@ -1,11 +1,11 @@ --- a/Makefile +++ b/Makefile -@@ -52,7 +52,7 @@ WFLAGS += -Wmissing-declarations -Wold-s - CFLAGS := $(WFLAGS) $(CCOPTS) -I../include $(DEFINES) $(CFLAGS) +@@ -49,7 +49,7 @@ WFLAGS += -Wmissing-declarations -Wold-s + CFLAGS := $(WFLAGS) $(CCOPTS) -I../include -I../include/uapi $(DEFINES) $(CFLAGS) YACCFLAGS = -d -t -v --SUBDIRS=lib ip tc bridge misc netem genl tipc devlink man -+SUBDIRS=lib ip tc bridge misc genl tipc devlink man +-SUBDIRS=lib ip tc bridge misc netem genl tipc devlink rdma man ++SUBDIRS=lib ip tc bridge misc genl tipc devlink rdma man LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a LDLIBS += $(LIBNETLINK) diff --git a/package/network/utils/iproute2/patches/009-keep_libmnl_optional.patch b/package/network/utils/iproute2/patches/009-keep_libmnl_optional.patch new file mode 100644 index 0000000000..7a5a702237 --- /dev/null +++ b/package/network/utils/iproute2/patches/009-keep_libmnl_optional.patch @@ -0,0 +1,11 @@ +--- a/configure ++++ b/configure +@@ -292,7 +292,7 @@ check_selinux() + + check_mnl() + { +- if ${PKG_CONFIG} libmnl --exists ++ if [ "${HAVE_MNL}" = "y" ] && ${PKG_CONFIG} libmnl --exists + then + echo "HAVE_MNL:=y" >>$CONFIG + echo "yes" diff --git a/package/network/utils/iproute2/patches/110-extra-ccopts.patch b/package/network/utils/iproute2/patches/110-extra-ccopts.patch index b28e19de57..e779934d72 100644 --- a/package/network/utils/iproute2/patches/110-extra-ccopts.patch +++ b/package/network/utils/iproute2/patches/110-extra-ccopts.patch @@ -1,6 +1,6 @@ --- a/Makefile +++ b/Makefile -@@ -45,7 +45,7 @@ HOSTCC ?= $(CC) +@@ -42,7 +42,7 @@ HOSTCC ?= $(CC) DEFINES += -D_GNU_SOURCE # Turn on transparent support for LFS DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE diff --git a/package/network/utils/iproute2/patches/120-libnetlink-pic.patch b/package/network/utils/iproute2/patches/120-libnetlink-pic.patch index 1f397f71b2..83ce66d976 100644 --- a/package/network/utils/iproute2/patches/120-libnetlink-pic.patch +++ b/package/network/utils/iproute2/patches/120-libnetlink-pic.patch @@ -1,11 +1,10 @@ --- a/lib/Makefile +++ b/lib/Makefile -@@ -4,7 +4,7 @@ ifeq ($(IP_CONFIG_SETNS),y) - CFLAGS += -DHAVE_SETNS - endif +@@ -1,6 +1,6 @@ + include ../config.mk -CFLAGS += -fPIC +CFLAGS += $(FPIC) UTILOBJ = utils.o rt_names.o ll_types.o ll_proto.o ll_addr.o \ - inet_proto.o namespace.o json_writer.o \ + inet_proto.o namespace.o json_writer.o json_print.o \ diff --git a/package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch b/package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch index b0ed599196..e3364ad059 100644 --- a/package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch +++ b/package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch @@ -15,9 +15,9 @@ Signed-off-by: Jonas Gorski include/uapi/linux/libc-compat.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) ---- a/include/linux/libc-compat.h -+++ b/include/linux/libc-compat.h -@@ -48,13 +48,13 @@ +--- a/include/uapi/linux/libc-compat.h ++++ b/include/uapi/linux/libc-compat.h +@@ -49,13 +49,13 @@ #ifndef _LIBC_COMPAT_H #define _LIBC_COMPAT_H @@ -36,7 +36,7 @@ Signed-off-by: Jonas Gorski * that would already be defined. */ #define __UAPI_DEF_IF_IFCONF 0 -@@ -65,7 +65,11 @@ +@@ -66,7 +66,11 @@ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0 /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */ #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO @@ -48,7 +48,7 @@ Signed-off-by: Jonas Gorski #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */ #else /* _NET_IF_H */ -@@ -85,10 +89,10 @@ +@@ -86,10 +90,10 @@ #endif /* _NET_IF_H */ @@ -61,7 +61,7 @@ Signed-off-by: Jonas Gorski * that would already be defined. */ #define __UAPI_DEF_IN_ADDR 0 #define __UAPI_DEF_IN_IPPROTO 0 -@@ -102,7 +106,7 @@ +@@ -103,7 +107,7 @@ * if the glibc code didn't define them. This guard matches * the guard in glibc/inet/netinet/in.h which defines the * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */ @@ -70,7 +70,7 @@ Signed-off-by: Jonas Gorski #define __UAPI_DEF_IN6_ADDR_ALT 0 #else #define __UAPI_DEF_IN6_ADDR_ALT 1 -@@ -117,7 +121,7 @@ +@@ -118,7 +122,7 @@ #else /* Linux headers included first, and we must define everything @@ -79,7 +79,7 @@ Signed-off-by: Jonas Gorski * __UAPI_DEF_* defines and adjust appropriately. */ #define __UAPI_DEF_IN_ADDR 1 #define __UAPI_DEF_IN_IPPROTO 1 -@@ -127,7 +131,7 @@ +@@ -128,7 +132,7 @@ #define __UAPI_DEF_IN_CLASS 1 #define __UAPI_DEF_IN6_ADDR 1 @@ -88,7 +88,7 @@ Signed-off-by: Jonas Gorski * coordinate. */ #define __UAPI_DEF_IN6_ADDR_ALT 1 #define __UAPI_DEF_SOCKADDR_IN6 1 -@@ -168,7 +172,7 @@ +@@ -169,7 +173,7 @@ /* If we did not see any headers from any supported C libraries, * or we are being included in the kernel, then define everything * that we need. */ @@ -97,7 +97,7 @@ Signed-off-by: Jonas Gorski /* Definitions for if.h */ #define __UAPI_DEF_IF_IFCONF 1 -@@ -208,6 +212,6 @@ +@@ -209,6 +213,6 @@ /* Definitions for xattr.h */ #define __UAPI_DEF_XATTR 1 diff --git a/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch b/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch index 42e29326b9..abd1f7eaca 100644 --- a/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch +++ b/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch @@ -14,9 +14,9 @@ Signed-off-by: Jonas Gorski include/uapi/linux/libc-compat.h | 11 +++++++++++ 2 files changed, 14 insertions(+) ---- a/include/linux/if_ether.h -+++ b/include/linux/if_ether.h -@@ -22,6 +22,7 @@ +--- a/include/uapi/linux/if_ether.h ++++ b/include/uapi/linux/if_ether.h +@@ -23,6 +23,7 @@ #define _LINUX_IF_ETHER_H #include @@ -24,7 +24,7 @@ Signed-off-by: Jonas Gorski /* * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble -@@ -142,11 +143,13 @@ +@@ -149,11 +150,13 @@ * This is an Ethernet frame header. */ @@ -38,9 +38,9 @@ Signed-off-by: Jonas Gorski #endif /* _LINUX_IF_ETHER_H */ ---- a/include/linux/libc-compat.h -+++ b/include/linux/libc-compat.h -@@ -89,6 +89,14 @@ +--- a/include/uapi/linux/libc-compat.h ++++ b/include/uapi/linux/libc-compat.h +@@ -90,6 +90,14 @@ #endif /* _NET_IF_H */ @@ -55,7 +55,7 @@ Signed-off-by: Jonas Gorski /* Coordinate with libc netinet/in.h header. */ #if defined(_NETINET_IN_H) -@@ -184,6 +192,9 @@ +@@ -185,6 +193,9 @@ /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1 @@ -65,15 +65,3 @@ Signed-off-by: Jonas Gorski /* Definitions for in.h */ #define __UAPI_DEF_IN_ADDR 1 #define __UAPI_DEF_IN_IPPROTO 1 ---- a/ip/iplink_bridge.c -+++ b/ip/iplink_bridge.c -@@ -14,8 +14,8 @@ - #include - #include - #include --#include - #include -+#include - #include - - #include "rt_names.h" diff --git a/package/network/utils/iproute2/patches/300-ip_tiny.patch b/package/network/utils/iproute2/patches/300-ip_tiny.patch index e1b1da4d20..35b588f7ef 100644 --- a/package/network/utils/iproute2/patches/300-ip_tiny.patch +++ b/package/network/utils/iproute2/patches/300-ip_tiny.patch @@ -1,8 +1,8 @@ --- a/ip/Makefile +++ b/ip/Makefile -@@ -19,6 +19,13 @@ ifeq ($(IP_CONFIG_SETNS),y) - CFLAGS += -DHAVE_SETNS - endif +@@ -15,6 +15,13 @@ RTMONOBJ=rtmon.o + + include ../config.mk +STATIC_SYM_FILTER:= +ifeq ($(IP_CONFIG_TINY),y) @@ -14,7 +14,7 @@ ALLOBJ=$(IPOBJ) $(RTMONOBJ) SCRIPTS=ifcfg rtpr routel routef TARGETS=ip rtmon -@@ -48,7 +55,7 @@ else +@@ -44,7 +51,7 @@ else ip: static-syms.o static-syms.o: static-syms.h @@ -25,7 +25,24 @@ sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \ --- a/ip/ip.c +++ b/ip/ip.c -@@ -74,32 +74,44 @@ static const struct cmd { +@@ -49,10 +49,16 @@ static void usage(void) + fprintf(stderr, + "Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n" + " ip [ -force ] -batch filename\n" ++#ifndef IPROUTE2_TINY + "where OBJECT := { link | address | addrlabel | route | rule | neigh | ntable |\n" + " tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm |\n" + " netns | l2tp | fou | macsec | tcp_metrics | token | netconf | ila |\n" + " vrf | sr }\n" ++#else ++"where OBJECT := { link | address | route | rule | neigh | tunnel | maddress |\n" ++" mroute | mrule | monitor | netns | macsec | token | ila |\n" ++" vrf | sr }\n" ++#endif + " OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n" + " -h[uman-readable] | -iec |\n" + " -f[amily] { inet | inet6 | ipx | dnet | mpls | bridge | link } |\n" +@@ -74,32 +80,44 @@ static const struct cmd { int (*func)(int argc, char **argv); } cmds[] = { { "address", do_ipaddr }, @@ -68,11 +85,11 @@ { "netconf", do_ipnetconf }, +#endif { "vrf", do_ipvrf}, + { "sr", do_seg6 }, { "help", do_help }, - { 0 } --- a/lib/utils.c +++ b/lib/utils.c -@@ -777,6 +777,7 @@ const char *rt_addr_n2a_r(int af, int le +@@ -817,6 +817,7 @@ const char *rt_addr_n2a_r(int af, int le return inet_ntop(af, addr, buf, buflen); case AF_MPLS: return mpls_ntop(af, addr, buf, buflen); @@ -80,7 +97,7 @@ case AF_IPX: return ipx_ntop(af, addr, buf, buflen); case AF_DECnet: -@@ -786,6 +787,7 @@ const char *rt_addr_n2a_r(int af, int le +@@ -826,6 +827,7 @@ const char *rt_addr_n2a_r(int af, int le memcpy(dna.a_addr, addr, 2); return dnet_ntop(af, &dna, buf, buflen); } @@ -90,14 +107,14 @@ default: --- a/lib/Makefile +++ b/lib/Makefile -@@ -4,6 +4,10 @@ ifeq ($(IP_CONFIG_SETNS),y) - CFLAGS += -DHAVE_SETNS - endif +@@ -2,6 +2,10 @@ include ../config.mk + + CFLAGS += $(FPIC) +ifeq ($(IP_CONFIG_TINY),y) + CFLAGS += -DIPROUTE2_TINY +endif + - CFLAGS += $(FPIC) - UTILOBJ = utils.o rt_names.o ll_types.o ll_proto.o ll_addr.o \ + inet_proto.o namespace.o json_writer.o json_print.o \ + names.o color.o bpf.o exec.o fs.o diff --git a/package/network/utils/iproute2/patches/900-drop_FAILED_POLICY.patch b/package/network/utils/iproute2/patches/900-drop_FAILED_POLICY.patch index 44f198f1bf..1980f87107 100644 --- a/package/network/utils/iproute2/patches/900-drop_FAILED_POLICY.patch +++ b/package/network/utils/iproute2/patches/900-drop_FAILED_POLICY.patch @@ -9,29 +9,6 @@ Subject: [PATCH] add support for dropping with FAILED_POLICY ip/rtm_map.c | 4 ++++ 3 files changed, 9 insertions(+) ---- a/include/linux/fib_rules.h -+++ b/include/linux/fib_rules.h -@@ -72,6 +72,10 @@ enum { - FR_ACT_BLACKHOLE, /* Drop without notification */ - FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */ - FR_ACT_PROHIBIT, /* Drop with EACCES */ -+ FR_ACT_RES8, -+ FR_ACT_RES9, -+ FR_ACT_RES10, -+ FR_ACT_FAILED_POLICY, /* Drop with EPERM */ - __FR_ACT_MAX, - }; - ---- a/include/linux/rtnetlink.h -+++ b/include/linux/rtnetlink.h -@@ -215,6 +215,7 @@ enum { - RTN_THROW, /* Not in this table */ - RTN_NAT, /* Translate this address */ - RTN_XRESOLVE, /* Use external resolver */ -+ RTN_FAILED_POLICY, /* Source address failed policy */ - __RTN_MAX - }; - --- a/ip/rtm_map.c +++ b/ip/rtm_map.c @@ -49,6 +49,8 @@ char *rtnl_rtntype_n2a(int id, char *buf @@ -52,3 +29,13 @@ Subject: [PATCH] add support for dropping with FAILED_POLICY else { res = strtoul(arg, &end, 0); if (!end || end == arg || *end || res > 255) +--- a/include/uapi/linux/rtnetlink.h ++++ b/include/uapi/linux/rtnetlink.h +@@ -221,6 +221,7 @@ enum { + RTN_THROW, /* Not in this table */ + RTN_NAT, /* Translate this address */ + RTN_XRESOLVE, /* Use external resolver */ ++ RTN_FAILED_POLICY, /* Source address failed policy */ + __RTN_MAX + }; + diff --git a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch index 0705eb12c5..5e91cd7ed1 100644 --- a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch +++ b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch @@ -1,6 +1,6 @@ ---- a/include/linux/pkt_sched.h -+++ b/include/linux/pkt_sched.h -@@ -863,4 +863,60 @@ struct tc_pie_xstats { +--- a/include/uapi/linux/pkt_sched.h ++++ b/include/uapi/linux/pkt_sched.h +@@ -872,4 +872,63 @@ struct tc_pie_xstats { __u32 maxq; /* maximum queue size */ __u32 ecn_mark; /* packets marked with ecn*/ }; @@ -21,6 +21,8 @@ + TCA_CAKE_ETHERNET, + TCA_CAKE_WASH, + TCA_CAKE_MPU, ++ TCA_CAKE_INGRESS, ++ TCA_CAKE_ACK_FILTER, + __TCA_CAKE_MAX +}; +#define TCA_CAKE_MAX (__TCA_CAKE_MAX - 1) @@ -33,12 +35,12 @@ + +#define TC_CAKE_MAX_TINS (8) +struct tc_cake_xstats { -+ __u16 version; /* == 4, increments when struct extended */ ++ __u16 version; /* == 5, increments when struct extended */ + __u8 max_tins; /* == TC_CAKE_MAX_TINS */ + __u8 tin_cnt; /* <= TC_CAKE_MAX_TINS */ + + __u32 threshold_rate [TC_CAKE_MAX_TINS]; -+ __u32 target_us [TC_CAKE_MAX_TINS]; ++ __u32 target_us [TC_CAKE_MAX_TINS]; + struct tc_cake_traffic_stats sent [TC_CAKE_MAX_TINS]; + struct tc_cake_traffic_stats dropped [TC_CAKE_MAX_TINS]; + struct tc_cake_traffic_stats ecn_marked[TC_CAKE_MAX_TINS]; @@ -47,23 +49,24 @@ + __u32 way_indirect_hits[TC_CAKE_MAX_TINS]; + __u32 way_misses [TC_CAKE_MAX_TINS]; + __u32 way_collisions [TC_CAKE_MAX_TINS]; -+ __u32 peak_delay_us [TC_CAKE_MAX_TINS]; /* ~= delay to bulk flows */ ++ __u32 peak_delay_us [TC_CAKE_MAX_TINS]; /* ~= bulk flow delay */ + __u32 avge_delay_us [TC_CAKE_MAX_TINS]; -+ __u32 base_delay_us [TC_CAKE_MAX_TINS]; /* ~= delay to sparse flows */ ++ __u32 base_delay_us [TC_CAKE_MAX_TINS]; /* ~= sparse flows delay */ + __u16 sparse_flows [TC_CAKE_MAX_TINS]; + __u16 bulk_flows [TC_CAKE_MAX_TINS]; -+ __u16 unresponse_flows [TC_CAKE_MAX_TINS]; /* v4 - was u32 last_len */ -+ __u16 spare [TC_CAKE_MAX_TINS]; /* v4 - split last_len */ ++ __u16 unresponse_flows [TC_CAKE_MAX_TINS]; /* v4 - was u32 last_len */ ++ __u16 spare [TC_CAKE_MAX_TINS]; /* v4 - split last_len */ + __u32 max_skblen [TC_CAKE_MAX_TINS]; + __u32 capacity_estimate; /* version 2 */ + __u32 memory_limit; /* version 3 */ -+ __u32 memory_used; /* version 3 */ ++ __u32 memory_used; /* version 3 */ ++ struct tc_cake_traffic_stats ack_drops [TC_CAKE_MAX_TINS]; /* v5 */ +}; + #endif --- a/tc/Makefile +++ b/tc/Makefile -@@ -67,6 +67,7 @@ TCMODULES += q_codel.o +@@ -65,6 +65,7 @@ TCMODULES += q_codel.o TCMODULES += q_fq_codel.o TCMODULES += q_fq.o TCMODULES += q_pie.o @@ -73,7 +76,7 @@ TCMODULES += e_bpf.o --- /dev/null +++ b/tc/q_cake.c -@@ -0,0 +1,692 @@ +@@ -0,0 +1,771 @@ +/* + * Common Applications Kept Enhanced -- CAKE + * @@ -137,9 +140,10 @@ +" dual-srchost | dual-dsthost | triple-isolate* ]\n" +" [ nat | nonat* ]\n" +" [ wash | nowash * ]\n" ++" [ ack-filter | ack-filter-aggressive | no-ack-filter * ]\n" +" [ memlimit LIMIT ]\n" +" [ ptm | atm | noatm* ] [ overhead N | conservative | raw* ]\n" -+" [ mpu N ]\n" ++" [ mpu N ] [ ingress | egress* ]\n" +" (* marks defaults)\n"); +} + @@ -155,12 +159,14 @@ + int overhead = 0; + bool overhead_set = false; + bool overhead_override = false; -+ int wash = -1; + int mpu = 0; + int flowmode = -1; + int nat = -1; + int atm = -1; + int autorate = -1; ++ int wash = -1; ++ int ingress = -1; ++ int ack_filter = -1; + struct rtattr *tail; + + while (argc > 0) { @@ -314,12 +320,22 @@ + /* Typical VDSL2 framing schemes, both over PTM */ + /* PTM has 64b/65b coding which absorbs some bandwidth */ + } else if (strcmp(*argv, "pppoe-ptm") == 0) { ++ /* 2B PPP + 6B PPPoE + 6B dest MAC + 6B src MAC ++ * + 2B ethertype + 4B Frame Check Sequence ++ * + 1B Start of Frame (S) + 1B End of Frame (Ck) ++ * + 2B TC-CRC (PTM-FCS) = 30B ++ */ + atm = 2; -+ overhead += 27; ++ overhead += 30; + overhead_set = true; + } else if (strcmp(*argv, "bridged-ptm") == 0) { ++ /* 6B dest MAC + 6B src MAC + 2B ethertype ++ * + 4B Frame Check Sequence ++ * + 1B Start of Frame (S) + 1B End of Frame (Ck) ++ * + 2B TC-CRC (PTM-FCS) = 22B ++ */ + atm = 2; -+ overhead += 19; ++ overhead += 22; + overhead_set = true; + + } else if (strcmp(*argv, "via-ethernet") == 0) { @@ -332,9 +348,27 @@ + * that automatically, and is thus ignored. + * + * It would be deleted entirely, but it appears in the -+ * stats output when the automatic compensation is active. ++ * stats output when the automatic compensation is ++ * active. + */ + ++ } else if (strcmp(*argv, "total_overhead") == 0) { ++ /* ++ * This is the overhead cake accounts for; added here so ++ * that cake's "tc -s qdisc" output can be directly ++ * pasted into the tc command to instantate a new cake.. ++ */ ++ NEXT_ARG(); ++ ++ } else if (strcmp(*argv, "hard_header_len") == 0) { ++ /* ++ * This is the overhead the kernel automatically ++ * accounted for; added here so that cake's "tc -s ++ * qdisc" output can be directly pasted into the tc ++ * command to instantiate a new cake.. ++ */ ++ NEXT_ARG(); ++ + } else if (strcmp(*argv, "ethernet") == 0) { + /* ethernet pre-amble & interframe gap & FCS + * you may need to add vlan tag */ @@ -350,7 +384,7 @@ + + /* + * DOCSIS cable shapers account for Ethernet frame with FCS, -+ * but not interframe gap nor preamble. ++ * but not interframe gap or preamble. + */ + } else if (strcmp(*argv, "docsis") == 0) { + atm = 0; @@ -377,6 +411,18 @@ + return -1; + } + ++ } else if (strcmp(*argv, "ingress") == 0) { ++ ingress = 1; ++ } else if (strcmp(*argv, "egress") == 0) { ++ ingress = 0; ++ ++ } else if (strcmp(*argv, "no-ack-filter") == 0) { ++ ack_filter = 0; ++ } else if (strcmp(*argv, "ack-filter") == 0) { ++ ack_filter = 0x0200; ++ } else if (strcmp(*argv, "ack-filter-aggressive") == 0) { ++ ack_filter = 0x0600; ++ + } else if (strcmp(*argv, "memlimit") == 0) { + NEXT_ARG(); + if(get_size(&memlimit, *argv)) { @@ -425,6 +471,10 @@ + addattr_l(n, 1024, TCA_CAKE_NAT, &nat, sizeof(nat)); + if (wash != -1) + addattr_l(n, 1024, TCA_CAKE_WASH, &wash, sizeof(wash)); ++ if (ingress != -1) ++ addattr_l(n, 1024, TCA_CAKE_INGRESS, &ingress, sizeof(ingress)); ++ if (ack_filter != -1) ++ addattr_l(n, 1024, TCA_CAKE_ACK_FILTER, &ack_filter, sizeof(ack_filter)); + + tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail; + return 0; @@ -446,6 +496,8 @@ + int nat = 0; + int autorate = 0; + int wash = 0; ++ int ingress = 0; ++ int ack_filter = 0; + SPRINT_BUF(b1); + SPRINT_BUF(b2); + @@ -551,6 +603,14 @@ + RTA_PAYLOAD(tb[TCA_CAKE_MPU]) >= sizeof(__u32)) { + mpu = rta_getattr_u32(tb[TCA_CAKE_MPU]); + } ++ if (tb[TCA_CAKE_INGRESS] && ++ RTA_PAYLOAD(tb[TCA_CAKE_INGRESS]) >= sizeof(__u32)) { ++ ingress = rta_getattr_u32(tb[TCA_CAKE_INGRESS]); ++ } ++ if (tb[TCA_CAKE_ACK_FILTER] && ++ RTA_PAYLOAD(tb[TCA_CAKE_ACK_FILTER]) >= sizeof(__u32)) { ++ ack_filter = rta_getattr_u32(tb[TCA_CAKE_ACK_FILTER]); ++ } + if (tb[TCA_CAKE_ETHERNET] && + RTA_PAYLOAD(tb[TCA_CAKE_ETHERNET]) >= sizeof(__u32)) { + ethernet = rta_getattr_u32(tb[TCA_CAKE_ETHERNET]); @@ -563,6 +623,14 @@ + if (wash) + fprintf(f,"wash "); + ++ if (ingress) ++ fprintf(f,"ingress "); ++ ++ if (ack_filter == 0x0600) ++ fprintf(f,"ack-filter-aggressive "); ++ else if (ack_filter) ++ fprintf(f,"ack-filter "); ++ + if (interval) + fprintf(f, "rtt %s ", sprint_time(interval, b2)); + @@ -578,12 +646,19 @@ + + fprintf(f, "overhead %d ", overhead); + -+ // This is actually the *amount* of automatic compensation, but we only report -+ // its presence as a boolean for now. ++ /* This is actually the *amount* of automatic compensation, but ++ * we only report its presence as a boolean for now. ++ */ + if (ethernet) + fprintf(f, "via-ethernet "); + } + ++ /* unconditionally report the overhead and hard_header_len overhead the ++ * kernel added automatically ++ */ ++ fprintf(f, "total_overhead %d ", overhead); ++ fprintf(f, "hard_header_len %d ", ethernet); ++ + if (mpu) { + fprintf(f, "mpu %d ", mpu); + } @@ -595,7 +670,7 @@ +} + +static int cake_print_xstats(struct qdisc_util *qu, FILE *f, -+ struct rtattr *xstats) ++ struct rtattr *xstats) +{ + /* fq_codel stats format borrowed */ + struct tc_fq_codel_xstats *st; @@ -650,109 +725,116 @@ + + switch(stnc->tin_cnt) { + case 3: -+ fprintf(f, " Bulk Best Effort Voice\n"); ++ fprintf(f, " Bulk Best Effort Voice\n"); + break; + + case 4: -+ fprintf(f, " Bulk Best Effort Video Voice\n"); ++ fprintf(f, " Bulk Best Effort Video Voice\n"); + break; + + case 5: -+ fprintf(f, " Low Loss Best Effort Low Delay Bulk Net Control\n"); ++ fprintf(f, " Low Loss Best Effort Low Delay Bulk Net Control\n"); + break; + + default: + fprintf(f, " "); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, " Tin %u", i); ++ fprintf(f, " Tin %u", i); + fprintf(f, "\n"); + }; + + fprintf(f, " thresh "); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12s", sprint_rate(stnc->threshold_rate[i], b1)); ++ fprintf(f, " %12s", sprint_rate(stnc->threshold_rate[i], b1)); + fprintf(f, "\n"); + + fprintf(f, " target "); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12s", sprint_time(stnc->target_us[i], b1)); ++ fprintf(f, " %12s", sprint_time(stnc->target_us[i], b1)); + fprintf(f, "\n"); + + fprintf(f, " interval"); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12s", sprint_time(stnc->interval_us[i], b1)); ++ fprintf(f, " %12s", sprint_time(stnc->interval_us[i], b1)); + fprintf(f, "\n"); + + fprintf(f, " pk_delay"); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12s", sprint_time(stnc->peak_delay_us[i], b1)); ++ fprintf(f, " %12s", sprint_time(stnc->peak_delay_us[i], b1)); + fprintf(f, "\n"); + + fprintf(f, " av_delay"); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12s", sprint_time(stnc->avge_delay_us[i], b1)); ++ fprintf(f, " %12s", sprint_time(stnc->avge_delay_us[i], b1)); + fprintf(f, "\n"); + + fprintf(f, " sp_delay"); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12s", sprint_time(stnc->base_delay_us[i], b1)); ++ fprintf(f, " %12s", sprint_time(stnc->base_delay_us[i], b1)); + fprintf(f, "\n"); + + fprintf(f, " pkts "); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12u", stnc->sent[i].packets); ++ fprintf(f, " %12u", stnc->sent[i].packets); + fprintf(f, "\n"); + + fprintf(f, " bytes "); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12llu", stnc->sent[i].bytes); ++ fprintf(f, " %12llu", stnc->sent[i].bytes); + fprintf(f, "\n"); + + fprintf(f, " way_inds"); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12u", stnc->way_indirect_hits[i]); ++ fprintf(f, " %12u", stnc->way_indirect_hits[i]); + fprintf(f, "\n"); + + fprintf(f, " way_miss"); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12u", stnc->way_misses[i]); ++ fprintf(f, " %12u", stnc->way_misses[i]); + fprintf(f, "\n"); + + fprintf(f, " way_cols"); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12u", stnc->way_collisions[i]); ++ fprintf(f, " %12u", stnc->way_collisions[i]); + fprintf(f, "\n"); + + fprintf(f, " drops "); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12u", stnc->dropped[i].packets); ++ fprintf(f, " %12u", stnc->dropped[i].packets); + fprintf(f, "\n"); + + fprintf(f, " marks "); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12u", stnc->ecn_marked[i].packets); ++ fprintf(f, " %12u", stnc->ecn_marked[i].packets); + fprintf(f, "\n"); + ++ if(stnc->version >= 5) { ++ fprintf(f, " ack_drop"); ++ for(i=0; i < stnc->tin_cnt; i++) ++ fprintf(f, " %12u", stnc->ack_drops[i].packets); ++ fprintf(f, "\n"); ++ } ++ + fprintf(f, " sp_flows"); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12u", stnc->sparse_flows[i]); ++ fprintf(f, " %12u", stnc->sparse_flows[i]); + fprintf(f, "\n"); + + fprintf(f, " bk_flows"); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12u", stnc->bulk_flows[i]); ++ fprintf(f, " %12u", stnc->bulk_flows[i]); + fprintf(f, "\n"); + + if(stnc->version >= 4) { + fprintf(f, " un_flows"); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12u", stnc->unresponse_flows[i]); ++ fprintf(f, " %12u", stnc->unresponse_flows[i]); + fprintf(f, "\n"); + } + + fprintf(f, " max_len "); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12u", stnc->max_skblen[i]); ++ fprintf(f, " %12u", stnc->max_skblen[i]); + fprintf(f, "\n"); + } else { + return -1; diff --git a/package/network/utils/ipset/Makefile b/package/network/utils/ipset/Makefile index 66a9874055..55b7c493de 100644 --- a/package/network/utils/ipset/Makefile +++ b/package/network/utils/ipset/Makefile @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ipset -PKG_VERSION:=6.32 -PKG_RELEASE:=2 +PKG_VERSION:=6.34 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://ipset.netfilter.org -PKG_HASH:=d9cbb49a4ae9e32d7808a604f1a37f359f9fc9064c210c4c5f35d629d49fb9fe +PKG_HASH:=d70e831b670b7aa25dde81fd994d3a7ce0c0e801559a557105576df66cd8d680 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/ipset/patches/001-Replace-the-last-reference-to-u_int8_t-with-uint8_t.patch b/package/network/utils/ipset/patches/001-Replace-the-last-reference-to-u_int8_t-with-uint8_t.patch new file mode 100644 index 0000000000..745e9fa3b3 --- /dev/null +++ b/package/network/utils/ipset/patches/001-Replace-the-last-reference-to-u_int8_t-with-uint8_t.patch @@ -0,0 +1,25 @@ +From a4212bf911026740afc7fce98d9100e2ef5dcea0 Mon Sep 17 00:00:00 2001 +From: Jozsef Kadlecsik +Date: Tue, 26 Sep 2017 07:00:13 +0200 +Subject: [PATCH] Replace the last reference to u_int8_t with uint8_t. + +--- + src/ipset.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/ipset.c b/src/ipset.c +index 79f56b8..df0778a 100644 +--- a/src/ipset.c ++++ b/src/ipset.c +@@ -282,7 +282,7 @@ call_parser(int *argc, char *argv[], const struct ipset_type *type, + const struct ipset_arg *arg; + const char *optstr; + const struct ipset_type *t = type; +- u_int8_t revision = type->revision; ++ uint8_t revision = type->revision; + int ret = 0, i = 1; + + /* Currently CREATE and ADT may have got additional arguments */ +-- +2.13.5 + diff --git a/package/network/utils/iptables/Makefile b/package/network/utils/iptables/Makefile index 89f4354d07..e09c35c696 100644 --- a/package/network/utils/iptables/Makefile +++ b/package/network/utils/iptables/Makefile @@ -22,6 +22,7 @@ PKG_FIXUP:=autoreconf PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0 +PKG_CPE_ID:=cpe:/a:netfilter_core_team:iptables include $(INCLUDE_DIR)/package.mk ifeq ($(DUMP),) @@ -216,6 +217,20 @@ define Package/iptables-mod-nflog/description endef +define Package/iptables-mod-trace +$(call Package/iptables/Module, +kmod-ipt-debug +kmod-ipt-raw) + TITLE:=Netfilter TRACE target +endef + +define Package/iptables-mod-trace/description + iptables extension for TRACE target + + Includes: + - libxt_TRACE + +endef + + define Package/iptables-mod-nfqueue $(call Package/iptables/Module, +kmod-nfnetlink-queue +kmod-ipt-nfqueue) TITLE:=Netfilter NFQUEUE target @@ -381,6 +396,15 @@ U32 iptables extensions. endef +define Package/iptables-mod-checksum +$(call Package/iptables/Module, +kmod-ipt-checksum) + TITLE:=IP CHECKSUM target extension +endef + +define Package/iptables-mod-checksum/description +iptables extension for the CHECKSUM calculation target +endef + define Package/ip6tables $(call Package/iptables/Default) DEPENDS:=@IPV6 +kmod-ip6tables +iptables @@ -584,7 +608,9 @@ $(eval $(call BuildPlugin,iptables-mod-tproxy,$(IPT_TPROXY-m))) $(eval $(call BuildPlugin,iptables-mod-tee,$(IPT_TEE-m))) $(eval $(call BuildPlugin,iptables-mod-u32,$(IPT_U32-m))) $(eval $(call BuildPlugin,iptables-mod-nflog,$(IPT_NFLOG-m))) +$(eval $(call BuildPlugin,iptables-mod-trace,$(IPT_DEBUG-m))) $(eval $(call BuildPlugin,iptables-mod-nfqueue,$(IPT_NFQUEUE-m))) +$(eval $(call BuildPlugin,iptables-mod-checksum,$(IPT_CHECKSUM-m))) $(eval $(call BuildPackage,ip6tables)) $(eval $(call BuildPlugin,ip6tables-extra,$(IPT_IPV6_EXTRA-m))) $(eval $(call BuildPlugin,ip6tables-mod-nat,$(IPT_NAT6-m))) diff --git a/package/network/utils/iptables/patches/600-shared-libext.patch b/package/network/utils/iptables/patches/600-shared-libext.patch index 6704af5010..a906d40609 100644 --- a/package/network/utils/iptables/patches/600-shared-libext.patch +++ b/package/network/utils/iptables/patches/600-shared-libext.patch @@ -82,3 +82,23 @@ endif xtables_multi_SOURCES += xshared.c xtables_multi_LDADD += ../libxtables/libxtables.la -lm +@@ -32,7 +35,8 @@ if ENABLE_NFTABLES + BUILT_SOURCES += xtables-config-parser.h + xtables_compat_multi_SOURCES = xtables-compat-multi.c iptables-xml.c + xtables_compat_multi_CFLAGS = ${AM_CFLAGS} +-xtables_compat_multi_LDADD = ../extensions/libext.a ../extensions/libext_ebt.a ++xtables_compat_multi_LDADD = ++xtables_compat_multi_LDFLAGS = -L../extensions/ -liptext -liptext_ebt + if ENABLE_STATIC + xtables_compat_multi_CFLAGS += -DALL_INCLUSIVE + endif +@@ -45,7 +49,8 @@ xtables_compat_multi_SOURCES += xtables- + getethertype.c nft-bridge.c \ + xtables-eb-standalone.c xtables-eb.c \ + xtables-translate.c +-xtables_compat_multi_LDADD += ${libmnl_LIBS} ${libnftnl_LIBS} ${libnetfilter_conntrack_LIBS} ../extensions/libext4.a ../extensions/libext6.a ../extensions/libext_ebt.a ../extensions/libext_arpt.a ++xtables_compat_multi_LDADD += ${libmnl_LIBS} ${libnftnl_LIBS} ${libnetfilter_conntrack_LIBS} ++xtables_compat_multi_LDFLAGS += -liptext4 -liptext6 -liptext_arpt + # yacc and lex generate dirty code + xtables_compat_multi-xtables-config-parser.o xtables_compat_multi-xtables-config-syntax.o: AM_CFLAGS += -Wno-missing-prototypes -Wno-missing-declarations -Wno-implicit-function-declaration -Wno-nested-externs -Wno-undef -Wno-redundant-decls + xtables_compat_multi_SOURCES += xshared.c diff --git a/package/network/utils/iputils/Makefile b/package/network/utils/iputils/Makefile index b6799e68b5..344af07afd 100644 --- a/package/network/utils/iputils/Makefile +++ b/package/network/utils/iputils/Makefile @@ -17,6 +17,7 @@ PKG_HASH:=fd3af46c80ebb99607c2ca1f2a3608b6fe828e25bbec6e54f2afd25f6ddb6ee7 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0+ +PKG_CPE_ID:=cpe:/a:skbuff:iputils PKG_BUILD_DEPENDS:=sysfsutils PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-s$(PKG_VERSION) diff --git a/package/network/utils/iw/Makefile b/package/network/utils/iw/Makefile index a578ddc98c..9b3c12beca 100644 --- a/package/network/utils/iw/Makefile +++ b/package/network/utils/iw/Makefile @@ -30,8 +30,7 @@ endef define Build/Configure echo "const char iw_version[] = \"$(PKG_VERSION)\";" > $(PKG_BUILD_DIR)/version.c - rm -f $(PKG_BUILD_DIR)/version.sh - touch $(PKG_BUILD_DIR)/version.sh + echo "#!/bin/sh" > $(PKG_BUILD_DIR)/version.sh chmod +x $(PKG_BUILD_DIR)/version.sh endef diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile index a42aa13ee0..453978eb92 100644 --- a/package/network/utils/iwinfo/Makefile +++ b/package/network/utils/iwinfo/Makefile @@ -10,9 +10,10 @@ PKG_NAME:=libiwinfo PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/iwinfo.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git PKG_SOURCE_DATE:=2017-08-23 PKG_SOURCE_VERSION:=c1a03e8231a5d8b348b70a182d256725c98a3b0b +PKG_MIRROR_HASH:=7bd294f50f8ec8c0497c5fbe5527f3ae098814cdfeecf4ccf78a2a8937611664 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/layerscape/restool/Makefile b/package/network/utils/layerscape/restool/Makefile new file mode 100644 index 0000000000..988bc8075c --- /dev/null +++ b/package/network/utils/layerscape/restool/Makefile @@ -0,0 +1,38 @@ +# +# Copyright 2017 NXP +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=restool +PKG_SOURCE_DATE:=2017-10-23 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/qoriq-open-source/restool.git +PKG_SOURCE_VERSION:=8f08b9d499e84f9057784c2036f0ddf75ae3fc70 +PKG_MIRROR_HASH:=29f70ad27c7ab20bc018f0d0b11c680fcf8b829d10e5af5c30af4a3f9228a2fc + +include $(INCLUDE_DIR)/package.mk + +define Package/restool + SECTION:=net + CATEGORY:=Network + DEPENDS:=@TARGET_layerscape + TITLE:=Layerscape DPAA2 dynamical management tool +endef + +MAKE_FLAGS += \ + DESTDIR="$(PKG_BUILD_DIR)"/output/ \ + install + +define Package/restool/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/output/usr/local/bin/* $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,restool)) diff --git a/package/network/utils/layerscape/restool/patches/0001-scripts-move-shebang-on-the-first-line.patch b/package/network/utils/layerscape/restool/patches/0001-scripts-move-shebang-on-the-first-line.patch new file mode 100644 index 0000000000..691e3bba51 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0001-scripts-move-shebang-on-the-first-line.patch @@ -0,0 +1,35 @@ +From 978f00c0a9f17de9cf17b205a741222084261d3a Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:17 +0000 +Subject: [PATCH 01/12] scripts: move shebang on the first line + +If the shebang is not placed on the first line of the shell script +it will be accounted only as a comment. + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index 588c736..09bef5a 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -1,3 +1,5 @@ ++#!/bin/bash ++ + # Copyright 2013-2016 Freescale Semiconductor Inc. + # Copyright 2017 NXP + +@@ -30,8 +32,6 @@ + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + # POSSIBILITY OF SUCH DAMAGE. + +-#!/bin/bash +- + ## Restool wrapper script + # + # Prerequisites: +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0002-dprc-add-full-path-option-to-dprc-list-command.patch b/package/network/utils/layerscape/restool/patches/0002-dprc-add-full-path-option-to-dprc-list-command.patch new file mode 100644 index 0000000000..0e39ef7245 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0002-dprc-add-full-path-option-to-dprc-list-command.patch @@ -0,0 +1,151 @@ +From 6039bd1b7e5e71a0a171406cf980d2d61a6e79d4 Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:37 +0000 +Subject: [PATCH 02/12] dprc: add --full-path option to dprc list command + +Instead of printing an indented dprc list, activating +the --full-path option restool will print the entire path +of the dprc. +Example: + +root@rodos:~# restool dprc list --full-path +dprc.1 +dprc.1/dprc.3 +dprc.1/dprc.2 +dprc.1/dprc.2/dprc.4 + +Signed-off-by: Ioana Ciornei +--- + dprc_commands.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 50 insertions(+), 11 deletions(-) + +diff --git a/dprc_commands.c b/dprc_commands.c +index e1a8f16..8de2f0e 100644 +--- a/dprc_commands.c ++++ b/dprc_commands.c +@@ -76,13 +76,16 @@ C_ASSERT(ARRAY_SIZE(dprc_sync_options) <= MAX_NUM_CMD_LINE_OPTIONS + 1); + */ + enum dprc_list_options { + LIST_OPT_HELP = 0, ++ LIST_OPT_FULL_PATH, + }; + + static struct option dprc_list_options[] = { + [LIST_OPT_HELP] = { + .name = "help", + }, +- ++ [LIST_OPT_FULL_PATH] = { ++ .name = "full-path", ++ }, + { 0 }, + }; + +@@ -421,17 +424,33 @@ static int cmd_dprc_sync(void) + * Lists nested DPRCs inside a given DPRC, recursively + */ + static int list_dprc(uint32_t dprc_id, uint16_t dprc_handle, +- int nesting_level, bool show_non_dprc_objects) ++ int nesting_level, bool show_non_dprc_objects, ++ char *full_path) + { ++ char *updated_full_path = NULL; + int num_child_devices; + int error = 0; ++ int full_path_len; + + assert(nesting_level <= MAX_DPRC_NESTING); + +- for (int i = 0; i < nesting_level; i++) +- printf(" "); +- +- printf("dprc.%u\n", dprc_id); ++ if (full_path) { ++ full_path_len = strlen(full_path); ++ updated_full_path = malloc(full_path_len + 10); ++ if (!updated_full_path) { ++ ERROR_PRINTF("Could not alloc memory for full-path!\n"); ++ return -ENOMEM; ++ } ++ if (full_path_len != 0) ++ sprintf(updated_full_path, "%s/dprc.%d", full_path, dprc_id); ++ else ++ sprintf(updated_full_path, "dprc.%d", dprc_id); ++ printf("%s\n", updated_full_path); ++ } else { ++ for (int i = 0; i < nesting_level; i++) ++ printf(" "); ++ printf("dprc.%u\n", dprc_id); ++ } + + error = dprc_get_obj_count(&restool.mc_io, 0, + dprc_handle, +@@ -475,8 +494,11 @@ static int list_dprc(uint32_t dprc_id, uint16_t dprc_handle, + if (error < 0) + goto out; + +- error = list_dprc(obj_desc.id, child_dprc_handle, +- nesting_level + 1, show_non_dprc_objects); ++ error = list_dprc(obj_desc.id, ++ child_dprc_handle, ++ nesting_level + 1, ++ show_non_dprc_objects, ++ updated_full_path); + + error2 = dprc_close(&restool.mc_io, 0, child_dprc_handle); + if (error2 < 0) { +@@ -491,6 +513,9 @@ static int list_dprc(uint32_t dprc_id, uint16_t dprc_handle, + } + + out: ++ if (full_path) ++ free(updated_full_path); ++ + return error; + } + +@@ -498,8 +523,14 @@ static int cmd_dprc_list(void) + { + static const char usage_msg[] = + "\n" +- "Usage: restool dprc list\n" ++ "Usage: restool dprc list [OPTIONS]\n" ++ "\n" ++ "OPTIONS:\n" ++ "--full-path\n" ++ " prints the dprc list in a full-path\n" ++ " format like: dprc.1/dprc.2\n" + "\n"; ++ bool full_path = false; + + if (restool.cmd_option_mask & ONE_BIT_MASK(LIST_OPT_HELP)) { + puts(usage_msg); +@@ -507,6 +538,12 @@ static int cmd_dprc_list(void) + return 0; + } + ++ ++ if (restool.cmd_option_mask & ONE_BIT_MASK(LIST_OPT_FULL_PATH)) { ++ restool.cmd_option_mask &= ~ONE_BIT_MASK(LIST_OPT_FULL_PATH); ++ full_path = true; ++ } ++ + if (restool.obj_name != NULL) { + ERROR_PRINTF( + "Unexpected argument: \'%s\'\n\n", restool.obj_name); +@@ -514,8 +551,10 @@ static int cmd_dprc_list(void) + return -EINVAL; + } + +- return list_dprc( +- restool.root_dprc_id, restool.root_dprc_handle, 0, false); ++ return list_dprc(restool.root_dprc_id, ++ restool.root_dprc_handle, ++ 0, false, ++ full_path ? "" : NULL); + } + + static int show_one_resource_type(uint16_t dprc_handle, +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0003-scripts-remove-unnecessary-arrays.patch b/package/network/utils/layerscape/restool/patches/0003-scripts-remove-unnecessary-arrays.patch new file mode 100644 index 0000000000..c846fbab5b --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0003-scripts-remove-unnecessary-arrays.patch @@ -0,0 +1,62 @@ +From e316b4c7d421afa6ca5f6b6ae86d0a8219a9bd56 Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:42 +0000 +Subject: [PATCH 03/12] scripts: remove unnecessary arrays + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 22 ++-------------------- + 1 file changed, 2 insertions(+), 20 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index 09bef5a..ea0df92 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -87,8 +87,6 @@ root_c= + # Type of endpoint object + toe= + +-dpnis=() +-dpmacs=() + containers=() + # Full path containers + fpc=() +@@ -944,16 +942,8 @@ process_listni() { + fi + fi + +- dpnis+=("$dpni $details") ++ echo "${i}/${dpni} ${details}" + done +- +- if [ -n "$dpnis" ]; then +- for j in "${dpnis[@]}"; do +- echo "$i/$j" +- done +- +- dpnis=() +- fi + done + } + +@@ -984,16 +974,8 @@ process_listmac() { + fi + fi + +- dpmacs+=("$dpmac $details") ++ echo "${i}/${dpmac} ${details}" + done +- +- if [ -n "$dpmacs" ]; then +- for j in "${dpmacs[@]}"; do +- echo "$i/$j" +- done +- +- dpmacs=() +- fi + done + } + +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0004-scripts-use-restool-full-path-option.patch b/package/network/utils/layerscape/restool/patches/0004-scripts-use-restool-full-path-option.patch new file mode 100644 index 0000000000..e1cc38f481 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0004-scripts-use-restool-full-path-option.patch @@ -0,0 +1,111 @@ +From 09f840049d155fa4b681ece749feeff9a269ecde Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:45 +0000 +Subject: [PATCH 04/12] scripts: use restool --full-path option + +Instead of constructing the the full path container list by +hand use the restool option newly added. + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 54 +++++++----------------------------------------------- + 1 file changed, 7 insertions(+), 47 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index ea0df92..72f6c77 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -73,7 +73,6 @@ + ## + + shopt -s extglob +-shopt -s lastpipe + + # Intercept the Ctrl+C command but do not interrupt execution + trap ' ' INT +@@ -87,11 +86,6 @@ root_c= + # Type of endpoint object + toe= + +-containers=() +-# Full path containers +-fpc=() +-idx=0 +- + SYS_DPRC="/sys/bus/fsl-mc/drivers/fsl_mc_dprc" + + set -e +@@ -220,42 +214,6 @@ get_container() { + echo $(echo "$i" | sed "s/\(dprc.[0-9]*\/\)*//g") + } + +-build_fpc_list() { +- $restool dprc list | +- while IFS= read -r line +- do +- containers+=("$line") +- done +- +- for i in "${containers[@]}" +- do +- cnt=$(count_spaces "$i") +- +- if [ "$cnt" -gt 0 ]; then +- # Get index of the upper level container +- idx2=$((idx-1)) +- crt_ct="$i" +- +- while [ "$idx2" -ge 0 ] +- do +- cntp=$(count_spaces "${containers[idx2]}") +- +- if [ "$cntp" -lt "$cnt" ]; then +- upc=$(echo "${containers[idx2]}" | sed "s/ *$//") +- crt_ct=$upc"/""$(echo $crt_ct | sed 's/ *$//')" +- fi +- idx2=$((idx2-1)) +- done +- +- fpc+=($crt_ct) +- else +- fpc+=("$i") +- fi +- +- idx=$((idx+1)) +- done +-} +- + get_label() { + # Retrieve the type of the object + too=$(echo "$1" | sed "s/\(\.[0-9]*\)\(\.[0-9]*\)*$//g") +@@ -897,9 +855,9 @@ process_addni() { + } + + process_listni() { +- build_fpc_list +- +- for i in "${fpc[@]}" ++ dprc_list="$($restool dprc list --full-path)" ++ echo "${dprc_list}" | ++ while read -r i + do + crt_c=$(get_container "$i") + $restool dprc show "$crt_c" | grep dpni | +@@ -948,10 +906,12 @@ process_listni() { + } + + process_listmac() { +- build_fpc_list ++ dprc_list="$($restool dprc list --full-path)" + +- for i in "${fpc[@]}" ++ echo "${dprc_list}" | ++ while read -r i + do ++ + crt_c=$(get_container "$i") + $restool dprc show "$crt_c" | grep dpmac | + while IFS= read -r line +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0005-scripts-use-proper-arithmetic-operation-syntax.patch b/package/network/utils/layerscape/restool/patches/0005-scripts-use-proper-arithmetic-operation-syntax.patch new file mode 100644 index 0000000000..b34c6a31ad --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0005-scripts-use-proper-arithmetic-operation-syntax.patch @@ -0,0 +1,26 @@ +From 899d6c74286cbc672e1bad1abd7eff15b1b7298d Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:49 +0000 +Subject: [PATCH 05/12] scripts: use proper arithmetic operation syntax + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index 72f6c77..a39df2c 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -966,7 +966,7 @@ fi + + # Check compatibility with MC version + mc_major=$($restool --mc-version | cut -f2 -d':' | cut -f1 -d'.' | tr -d ' ') +-if (( $mc_major != 10 )); then ++if [ $mc_major != 10 ]; then + echo "Restool wrapper scripts only support the latest major MC version\n" + echo "that currently is MC10.x. Use with caution." + fi +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0006-scripts-use-strings-instead-of-arrays.patch b/package/network/utils/layerscape/restool/patches/0006-scripts-use-strings-instead-of-arrays.patch new file mode 100644 index 0000000000..a1217668f5 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0006-scripts-use-strings-instead-of-arrays.patch @@ -0,0 +1,79 @@ +From 2127850302de2bd8dccff0e31415ce0218750773 Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:53 +0000 +Subject: [PATCH 06/12] scripts: use strings instead of arrays + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 21 ++++++++++++++------- + 1 file changed, 14 insertions(+), 7 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index a39df2c..b0c742e 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -485,7 +485,9 @@ create_dpsw() { + + # Make a link in case there is an end point specified + index=0 +- for i in "${endpoint[@]}"; do ++ echo "${endpoint}" | ++ while read -r i ++ do + connect $root_c "$dpsw.$index" "$i" + index=$((index + 1)) + done +@@ -519,8 +521,8 @@ process_addsw() { + max_fdb_mc_groups=32 + # dpsw object label + label= +- #Endpoint objects provided as argument +- endpoint=() ++ # Endpoint objects provided as argument ++ endpoint= + ifcnt=0 + container=$root_c + +@@ -559,7 +561,7 @@ process_addsw() { + container="${i#*=}" + ;; + @(dpni|dpmac).+([0-9])) +- endpoint[$ifcnt]="$(echo ${i#*=} | tr -d ,)" ++ endpoint="${endpoint}"$'\n'"${i}" + ifcnt=$((ifcnt + 1)) + ;; + *) +@@ -571,14 +573,19 @@ process_addsw() { + done + + # Check if there are more endpoints provided than the number of the interfaces +- if [ $num_ifs -lt ${#endpoint[@]} ]; then ++ if [ $num_ifs -lt $ifcnt ]; then + echo "Error: there are more endpoints provided than the number of the interfaces" + usage_addsw + exit 1 + fi + ++ # Delete first empty line from the endpoint string ++ endpoint="$(echo "${endpoint}" | tail -n +2)" ++ + # Check if the endpoints are valid +- for i in "${endpoint[@]}"; do ++ echo "${endpoint}" | ++ while read -r i ++ do + type_of_endpoint "$i" + check_endpoint "$i" + has_endpoint "$i" +@@ -592,7 +599,7 @@ process_addsw() { + if (( $object_exists_status == 1 )); then + echo "Created ETHSW object $dpsw with ${num_ifs} ports" + +- if [ $num_ifs -gt ${#endpoint[@]} ]; then ++ if [ $num_ifs -gt $ifcnt ]; then + echo "Do not forget to connect devices to interface(s)." + fi + fi +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0007-scripts-use-Bourne-shell-s-pattern-matching.patch b/package/network/utils/layerscape/restool/patches/0007-scripts-use-Bourne-shell-s-pattern-matching.patch new file mode 100644 index 0000000000..ed9d76d454 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0007-scripts-use-Bourne-shell-s-pattern-matching.patch @@ -0,0 +1,126 @@ +From e1036011baf9204d5fe6dd74e5a65f95b9681ebd Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:56 +0000 +Subject: [PATCH 07/12] scripts: use Bourne shell's pattern matching + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 71 ++++++++++++++++++++++++++++----------------------------- + 1 file changed, 35 insertions(+), 36 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index b0c742e..a8b9573 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -72,8 +72,6 @@ + # + ## + +-shopt -s extglob +- + # Intercept the Ctrl+C command but do not interrupt execution + trap ' ' INT + +@@ -370,15 +368,16 @@ process_addmux() { + -c=* | --container=*) + container="${i#*=}" + ;; +- *(dprc.+([0-9])/)dpmac.+([0-9])) +- endpoint="${i#*=}" +- ;; +- *(dprc.+([0-9])/)dpni.+([0-9])) +- endpoint="${i#*=}" +- ;; + *) +- usage_addmux +- exit 1 ++ arg_dpmac="$(echo $i | grep -x -E "(dprc.[0-9]+/)*dpmac.[0-9]+" || true )" ++ arg_dpni="$(echo $i | grep -x -E "(dprc.+[0-9]+/)*dpni.[0-9]+" || true )" ++ if [ "$i" = "$arg_dpmac" ] || ++ [ "$i" = "$arg_dpni" ]; then ++ endpoint="$i" ++ else ++ usage_addmux ++ exit 1 ++ fi + ;; + esac + done +@@ -560,14 +559,17 @@ process_addsw() { + -c=* | --container=*) + container="${i#*=}" + ;; +- @(dpni|dpmac).+([0-9])) +- endpoint="${endpoint}"$'\n'"${i}" +- ifcnt=$((ifcnt + 1)) +- ;; + *) +- echo "Error: $i argument is invalid" +- usage_addsw +- exit 1 ++ arg_dpmac="$(echo $i | grep -x -E "dpmac.[0-9]+" || true )" ++ arg_dpni="$(echo $i | grep -x -E "dpni.[0-9]+" || true )" ++ if [ "$i" = "$arg_dpmac" ] || ++ [ "$i" = "$arg_dpni" ]; then ++ endpoint="$i" ++ else ++ echo "Error: $i argument is invalid" ++ usage_addsw ++ exit 1 ++ fi + ;; + esac + done +@@ -704,7 +706,8 @@ process_addni() { + ;; + --mac-addr=*) + mac_addr="${i#*=}" +- if [[ ! "$mac_addr" =~ ^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$ ]]; then ++ mac_addr_valid="$(echo $mac_addr | grep -x -E "^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$" || true )" ++ if [ "$mac_addr" != "$mac_addr_valid" ]; then + echo "Invalid MAC address: $mac_addr" + exit 1 + fi +@@ -776,25 +779,21 @@ process_addni() { + -o=* | --options=*) + options="${i#*=}" + ;; +- *(dprc.+([0-9])/)dpmac.+([0-9])) +- no_link=0 +- endpoint="${i#*=}" +- ;; +- *(dprc.+([0-9])/)dpni.+([0-9])) +- no_link=0 +- endpoint="${i#*=}" +- ;; +- *(dprc.+([0-9])/)dpdmux.+([0-9]).+([0-9])) +- no_link=0 +- endpoint="${i#*=}" +- ;; +- *(dprc.+([0-9])/)dpsw.+([0-9]).+([0-9])) +- no_link=0 +- endpoint="${i#*=}" +- ;; + *) +- usage_addni +- exit 1 ++ arg_dpmac="$(echo $i | grep -x -E "(dprc.[0-9]+/)*dpmac.[0-9]+" || true )" ++ arg_dpni="$(echo $i | grep -x -E "(dprc.+[0-9]+/)*dpni.[0-9]+" || true )" ++ arg_dpdmux="$(echo $i | grep -x -E "(dprc.[0-9]+/)*dpdmux.[0-9]+.[0-9]+" || true )" ++ arg_dpsw="$(echo $i | grep -x -E "(dprc.[0-9]+/)*dpsw.[0-9]+.[0-9]+" || true )" ++ if [ "$i" = "$arg_dpmac" ] || ++ [ "$i" = "$arg_dpni" ] || ++ [ "$i" = "$arg_dpdmux" ] || ++ [ "$i" = "$arg_dpsw" ]; then ++ no_link=0 ++ endpoint="$i" ++ else ++ usage_addni ++ exit 1 ++ fi + ;; + esac + done +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0008-scripts-use-Bourne-shell-instead-of-bash.patch b/package/network/utils/layerscape/restool/patches/0008-scripts-use-Bourne-shell-instead-of-bash.patch new file mode 100644 index 0000000000..4921f63c9e --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0008-scripts-use-Bourne-shell-instead-of-bash.patch @@ -0,0 +1,32 @@ +From 4a1df345edc59a7407b955529955d6799d974b70 Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:30:00 +0000 +Subject: [PATCH 08/12] scripts: use Bourne shell instead of bash + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index a8b9573..bd79295 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + # Copyright 2013-2016 Freescale Semiconductor Inc. + # Copyright 2017 NXP +@@ -37,7 +37,7 @@ + # Prerequisites: + # - Management Complex version 10.x + # - restool version 1.4 or newer +-# - bash shell ++# - Bourne Shell (sh) + # + # + # The purpose of this script is to offer a user friendly way to create +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0009-scripts-workaround-for-a-improper-sed-substitution-T.patch b/package/network/utils/layerscape/restool/patches/0009-scripts-workaround-for-a-improper-sed-substitution-T.patch new file mode 100644 index 0000000000..c642afcafa --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0009-scripts-workaround-for-a-improper-sed-substitution-T.patch @@ -0,0 +1,36 @@ +From ac387de9688099bca1fbdb587d078b369aaf2dab Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Wed, 25 Oct 2017 11:23:42 +0000 +Subject: [PATCH 09/12] scripts: workaround for a improper sed substitution + (TODO) + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index bd79295..7ce73f0 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -197,7 +197,7 @@ has_endpoint() { + ep=$($restool "$toe" info "$1" | grep "endpoint:" | sed "s/endpoint: \([^ ]*\)\,.*/\1/") + fi + +- if [[ "$ep" != *"No object associated"* && "$ep" != *"none"* ]]; then ++ if [[ "$ep" != "endpoint: No object associated" && "$ep" != *"none"* ]]; then + echo "$1 is already linked to $ep" + exit 1 + fi +@@ -230,7 +230,7 @@ get_endpoint() { + end_point=$($restool "$too" info "$1" | grep "endpoint:" | sed "s/endpoint: \([^ ]*\)\,.*/\1/") + fi + +- if [[ "$end_point" != *"No object associated"* && "$end_point" != *"none"* ]]; then ++ if [[ "$end_point" != "endpoint: No object associated" && "$end_point" != *"none"* ]]; then + echo "$end_point" + fi + } +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0010-scripts-use-proper-arithmetic-operations.patch b/package/network/utils/layerscape/restool/patches/0010-scripts-use-proper-arithmetic-operations.patch new file mode 100644 index 0000000000..9945cd438a --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0010-scripts-use-proper-arithmetic-operations.patch @@ -0,0 +1,44 @@ +From 66ae6e5313da8be5742a502c0d7027689e84a17d Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Wed, 25 Oct 2017 11:30:08 +0000 +Subject: [PATCH 10/12] scripts: use proper arithmetic operations + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index 7ce73f0..0dcd2fa 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -409,7 +409,7 @@ process_addmux() { + + # check the status + object_exists $container $dpdmux +- if (( $object_exists_status == 1 )); then ++ if [ $object_exists_status == 1 ]; then + + if [ "$root_c" == "$container" ]; then + evb=$(ls $SYS_DPRC/"$root_c"/"$dpdmux"/net/ | grep -v "p") +@@ -598,7 +598,7 @@ process_addsw() { + + # check the status + object_exists $container $dpsw +- if (( $object_exists_status == 1 )); then ++ if [ $object_exists_status == 1 ]; then + echo "Created ETHSW object $dpsw with ${num_ifs} ports" + + if [ $num_ifs -gt $ifcnt ]; then +@@ -850,7 +850,7 @@ process_addni() { + + # check the status + object_exists $container $dpni +- if (( $object_exists_status == 1 )); then ++ if [ $object_exists_status == 1 ]; then + if [ "$root_c" == "$container" ]; then + ni=$(ls $SYS_DPRC/"$root_c"/"$dpni"/net/) + fi +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0011-scripts-do-not-compare-strings-with-regexp-expressio.patch b/package/network/utils/layerscape/restool/patches/0011-scripts-do-not-compare-strings-with-regexp-expressio.patch new file mode 100644 index 0000000000..1b6cc46a38 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0011-scripts-do-not-compare-strings-with-regexp-expressio.patch @@ -0,0 +1,27 @@ +From 6af86a65f2dcfd42f572e04207eef45da3573b92 Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Wed, 25 Oct 2017 11:30:33 +0000 +Subject: [PATCH 11/12] scripts: do not compare strings with regexp expressions + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index 0dcd2fa..526c052 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -805,7 +805,8 @@ process_addni() { + fi + + # if no --num-queues is specified then set it to number of cores +- if [[ $dpni_args != *"--num-queues"* ]]; then ++ num_queues_present=$(echo "$dpni_args" | grep -o "\-\-num-queues" || true) ++ if [[ -z "$num_queues_present" ]]; then + dpni_args=$dpni_args" --num-queues="$(nproc) + fi + +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0012-scripts-replace-nproc-with-cross-platform-implementa.patch b/package/network/utils/layerscape/restool/patches/0012-scripts-replace-nproc-with-cross-platform-implementa.patch new file mode 100644 index 0000000000..3acb3b5d83 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0012-scripts-replace-nproc-with-cross-platform-implementa.patch @@ -0,0 +1,27 @@ +From 0e5f9f0a7f0ef1947984cd82ade9dbc14ba2c80d Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Wed, 25 Oct 2017 12:48:04 +0000 +Subject: [PATCH 12/12] scripts: replace 'nproc' with cross-platform + implementation + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index 526c052..7d127f6 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -807,7 +807,7 @@ process_addni() { + # if no --num-queues is specified then set it to number of cores + num_queues_present=$(echo "$dpni_args" | grep -o "\-\-num-queues" || true) + if [[ -z "$num_queues_present" ]]; then +- dpni_args=$dpni_args" --num-queues="$(nproc) ++ dpni_args=$dpni_args" --num-queues="$(grep -c ^processor /proc/cpuinfo) + fi + + # Check if --no-link the endpoint have been provided otherwise display the usage +-- +2.14.1 + diff --git a/package/network/utils/linux-atm/Makefile b/package/network/utils/linux-atm/Makefile index 3d36622647..532a028218 100644 --- a/package/network/utils/linux-atm/Makefile +++ b/package/network/utils/linux-atm/Makefile @@ -19,6 +19,7 @@ PKG_HASH:=9645481a2b16476b59220aa2d6bc5bc41043f291326c9b37581018fbd16dd53a PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0+ +PKG_CPE_ID:=cpe:/a:linux-atm:linux-atm PKG_FIXUP:=autoreconf include $(INCLUDE_DIR)/package.mk diff --git a/package/network/utils/linux-atm/files/br2684ctl b/package/network/utils/linux-atm/files/br2684ctl index 0fa86bdefd..6513dd38ad 100755 --- a/package/network/utils/linux-atm/files/br2684ctl +++ b/package/network/utils/linux-atm/files/br2684ctl @@ -13,6 +13,9 @@ start_daemon() { config_get atmdev "$cfg" atmdev 0 + local nameprefix + config_get nameprefix "$cfg" nameprefix "nas" + local unit config_get unit "$cfg" unit 0 @@ -58,8 +61,8 @@ start_daemon() { procd_open_instance procd_set_param command \ - /usr/sbin/br2684ctl_wrap "nas$unit" \ - -c "$unit" -e "$encaps" -p "$payload" \ + /usr/sbin/br2684ctl_wrap "${nameprefix}${unit}" \ + -n "$nameprefix" -c "$unit" -e "$encaps" -p "$payload" \ -a "$circuit" ${qos:+-q "$qos"} ${sendsize:+-s "$sendsize"} \ -S /lib/netifd/br2684-up procd_close_instance diff --git a/package/network/utils/linux-atm/patches/501-br2684ctl_itfname.patch b/package/network/utils/linux-atm/patches/501-br2684ctl_itfname.patch new file mode 100644 index 0000000000..839b395fe4 --- /dev/null +++ b/package/network/utils/linux-atm/patches/501-br2684ctl_itfname.patch @@ -0,0 +1,74 @@ +--- a/src/br2684/br2684ctl.c ++++ b/src/br2684/br2684ctl.c +@@ -45,6 +45,7 @@ struct br2684_params { + + int lastsock, lastitf; + static char *up_script; ++const char *itfname = "nas"; + + + void fatal(const char *str, int err) +@@ -73,7 +74,7 @@ int create_pidfile(int num) + + if (num < 0) return -1; + +- snprintf(name, 32, "/var/run/br2684ctl-nas%d.pid", num); ++ snprintf(name, 32, "/var/run/br2684ctl-%s%d.pid", itfname, num); + pidfile = fopen(name, "w"); + if (pidfile == NULL) return -1; + fprintf(pidfile, "%d", getpid()); +@@ -102,7 +103,7 @@ int create_br(int itfnum, int payload) + ni.media |= BR2684_FLAG_ROUTED; + #endif + ni.mtu = 1500; +- sprintf(ni.ifname, "nas%d", itfnum); ++ sprintf(ni.ifname, "%s%d", itfname, itfnum); + err=ioctl (lastsock, ATM_NEWBACKENDIF, &ni); + + if (err == 0) +@@ -167,7 +168,7 @@ int assign_vcc(char *astr, int encap, in + + be.backend_num = ATM_BACKEND_BR2684; + be.ifspec.method = BR2684_FIND_BYIFNAME; +- sprintf(be.ifspec.spec.ifname, "nas%d", lastitf); ++ sprintf(be.ifspec.spec.ifname, "%s%d", itfname, lastitf); + be.fcs_in = BR2684_FCSIN_NO; + be.fcs_out = BR2684_FCSOUT_NO; + be.fcs_auto = 0; +@@ -198,7 +199,7 @@ void start_interface(struct br2684_param + assign_vcc(params->astr, params->encap, params->payload, params->sndbuf, + params->reqqos); + if (up_script) { +- asprintf(&cmd, "%s nas%d", up_script, lastitf); ++ asprintf(&cmd, "%s %s%d", up_script, itfname, lastitf); + system(cmd); + free(cmd); + } +@@ -207,7 +208,7 @@ void start_interface(struct br2684_param + + void usage(char *s) + { +- printf("usage: %s [-b] [[-c number] [-e 0|1] [-s sndbuf] [-q qos] [-p 0|1] " ++ printf("usage: %s [-b] [-n name] [[-c number] [-e 0|1] [-s sndbuf] [-q qos] [-p 0|1] " + "[-a [itf.]vpi.vci]*]* [-S script]\n", s); + printf(" encapsulations: 0=llc, 1=vcmux\n payloads: 0=routed, 1=bridged\n"); + exit(1); +@@ -234,7 +235,7 @@ int main (int argc, char **argv) + + openlog (LOG_NAME,LOG_OPTION,LOG_FACILITY); + if (argc>1) +- while ((c = getopt(argc, argv,"q:a:bc:e:s:S:p:?h")) !=EOF) ++ while ((c = getopt(argc, argv,"q:a:bn:c:e:s:S:p:?h")) !=EOF) + switch (c) { + case 'q': + printf ("optarg : %s",optarg); +@@ -247,6 +248,9 @@ int main (int argc, char **argv) + case 'b': + background=1; + break; ++ case 'n': ++ itfname = optarg; ++ break; + case 'c': + /* temporary, to make it work with multiple interfaces: */ + if (params.itfnum>=0) start_interface(¶ms); diff --git a/package/network/utils/nftables/Makefile b/package/network/utils/nftables/Makefile index b45440367d..5aaa1cbf4a 100644 --- a/package/network/utils/nftables/Makefile +++ b/package/network/utils/nftables/Makefile @@ -10,10 +10,10 @@ PKG_NAME:=nftables PKG_VERSION:=0.7 PKG_RELEASE:=1 -PKG_SOURCE_URL:=git://git.netfilter.org/nftables +PKG_SOURCE_URL:=https://git.netfilter.org/nftables PKG_SOURCE_PROTO:=git PKG_SOURCE_VERSION:=79cbd19e7437680561b26109bbf4f48cb2e8e0a7 -PKG_MIRROR_HASH:=6b06a114c5a1b397b0ae616d5d292859611b0eb05b647182b3c00421909338b8 +PKG_MIRROR_HASH:=2c0af691948519556952097673ad1b57f888c8314b8eb15e83066951de01fc82 PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/tcpdump/Makefile b/package/network/utils/tcpdump/Makefile index 92e08d58ce..50919819b6 100644 --- a/package/network/utils/tcpdump/Makefile +++ b/package/network/utils/tcpdump/Makefile @@ -21,6 +21,7 @@ PKG_BUILD_PARALLEL:=1 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause +PKG_CPE_ID:=cpe:/a:tcpdump:tcpdump PKG_INSTALL:=1 @@ -76,7 +77,6 @@ endif MAKE_FLAGS += \ CCOPT="$(TARGET_CFLAGS)" INCLS="-I. $(TARGET_CPPFLAGS)" - define Package/tcpdump/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tcpdump $(1)/usr/sbin/ diff --git a/package/network/utils/umbim/Makefile b/package/network/utils/umbim/Makefile index 616a02367c..4faa5acf90 100644 --- a/package/network/utils/umbim/Makefile +++ b/package/network/utils/umbim/Makefile @@ -4,7 +4,7 @@ PKG_NAME:=umbim PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/umbim.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/umbim.git PKG_SOURCE_DATE:=2015-07-04 PKG_SOURCE_VERSION:=29aaf43b097ee57f7aa1bb24341db6cc4148cbf3 PKG_MIRROR_HASH:=56e612d9da1ac26de96c4929fbabd047862d725a13ceb904807a9d3d7db43a30 diff --git a/package/network/utils/uqmi/Makefile b/package/network/utils/uqmi/Makefile index 2102490f68..9c8dadabec 100644 --- a/package/network/utils/uqmi/Makefile +++ b/package/network/utils/uqmi/Makefile @@ -4,7 +4,7 @@ PKG_NAME:=uqmi PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/uqmi.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/uqmi.git PKG_SOURCE_DATE:=2016-12-19 PKG_SOURCE_VERSION:=8ceeab690d8c6f1e3afbd4bcaee7bc2ba3fbe165 PKG_MIRROR_HASH:=b3637ff04e51769137af1c5e173e73311e11c3c2dcc49eeaca6aa3520f61d247 diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh index 35de6c5ad5..9c953ea697 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -65,11 +65,12 @@ proto_qmi_setup() { [ -n "$delay" ] && sleep "$delay" while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do + [ -e "$device" ] || return 1 sleep 1; done [ -n "$pincode" ] && { - uqmi -s -d "$device" --verify-pin1 "$pincode" || { + uqmi -s -d "$device" --verify-pin1 "$pincode" || uqmi -s -d "$device" --uim-verify-pin1 "$pincode" || { echo "Unable to verify PIN" proto_notify_error "$interface" PIN_FAILED proto_block_restart "$interface" @@ -102,6 +103,7 @@ proto_qmi_setup() { echo "Waiting for network registration" while uqmi -s -d "$device" --get-serving-system | grep '"searching"' > /dev/null; do + [ -e "$device" ] || return 1 sleep 5; done @@ -109,7 +111,7 @@ proto_qmi_setup() { echo "Starting network $interface" - pdptype=`echo "$pdptype" | awk '{print tolower($0)}'` + pdptype=$(echo "$pdptype" | awk '{print tolower($0)}') [ "$pdptype" = "ip" -o "$pdptype" = "ipv6" -o "$pdptype" = "ipv4v6" ] || pdptype="ip" if [ "$pdptype" = "ip" ]; then @@ -120,7 +122,7 @@ proto_qmi_setup() { fi [ "$pdptype" = "ip" -o "$pdptype" = "ipv4v6" ] && { - cid_4=`uqmi -s -d "$device" --get-client-id wds` + cid_4=$(uqmi -s -d "$device" --get-client-id wds) [ $? -ne 0 ] && { echo "Unable to obtain client ID" proto_notify_error "$interface" NO_CID @@ -134,14 +136,14 @@ proto_qmi_setup() { --stop-network 0xffffffff \ --autoconnect > /dev/null - pdh_4=`uqmi -s -d "$device" --set-client-id wds,"$cid_4" \ + pdh_4=$(uqmi -s -d "$device" --set-client-id wds,"$cid_4" \ --start-network \ ${apn:+--apn $apn} \ ${profile:+--profile $profile} \ ${auth:+--auth-type $auth} \ ${username:+--username $username} \ ${password:+--password $password} \ - ${autoconnect:+--autoconnect}` + ${autoconnect:+--autoconnect}) [ $? -ne 0 ] && { echo "Unable to connect IPv4" uqmi -s -d "$device" --set-client-id wds,"$cid_4" --release-client-id wds @@ -151,7 +153,7 @@ proto_qmi_setup() { } [ "$pdptype" = "ipv6" -o "$pdptype" = "ipv4v6" ] && { - cid_6=`uqmi -s -d "$device" --get-client-id wds` + cid_6=$(uqmi -s -d "$device" --get-client-id wds) [ $? -ne 0 ] && { echo "Unable to obtain client ID" proto_notify_error "$interface" NO_CID @@ -165,14 +167,14 @@ proto_qmi_setup() { --stop-network 0xffffffff \ --autoconnect > /dev/null - pdh_6=`uqmi -s -d "$device" --set-client-id wds,"$cid_6" \ + pdh_6=$(uqmi -s -d "$device" --set-client-id wds,"$cid_6" \ --start-network \ ${apn:+--apn $apn} \ ${profile:+--profile $profile} \ ${auth:+--auth-type $auth} \ ${username:+--username $username} \ ${password:+--password $password} \ - ${autoconnect:+--autoconnect}` + ${autoconnect:+--autoconnect}) [ $? -ne 0 ] && { echo "Unable to connect IPv6" uqmi -s -d "$device" --set-client-id wds,"$cid_6" --release-client-id wds diff --git a/package/network/utils/wpan-tools/Makefile b/package/network/utils/wpan-tools/Makefile index ff65375724..e57223dee4 100644 --- a/package/network/utils/wpan-tools/Makefile +++ b/package/network/utils/wpan-tools/Makefile @@ -31,6 +31,7 @@ endef define Package/wpan-tools/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/iwpan $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/wpan-ping/wpan-ping $(1)/usr/sbin/ endef $(eval $(call BuildPackage,wpan-tools)) diff --git a/package/network/utils/wpan-tools/patches/001-src-nl_extras.h-fix-compatibility-with-libnl-3.3.0.patch b/package/network/utils/wpan-tools/patches/001-src-nl_extras.h-fix-compatibility-with-libnl-3.3.0.patch new file mode 100644 index 0000000000..1370854b6b --- /dev/null +++ b/package/network/utils/wpan-tools/patches/001-src-nl_extras.h-fix-compatibility-with-libnl-3.3.0.patch @@ -0,0 +1,44 @@ +From bb522bd584f05e6658d5dba97f48ca018f46394c Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sat, 6 May 2017 14:36:08 +0200 +Subject: [PATCH] src/nl_extras.h: fix compatibility with libnl 3.3.0 + +nl_extras.h defines a set of nla_set_s*() functions if not provided by +libnl. They are provided by libnl since version 3.2.26. The test +(LIBNL_VER_MIC <= 26) was working fine while libnl was in the 3.2.x +series, but now that they have incremented the minor version, the +micro version was reset to 0, with the latest libnl version being +3.3.0. + +Due to this, the condition (LIBNL_VER_MIC <= 26) is true, and we get +redefinition errors because nl_extras.h redefines functions already +provided by libnl. + +This commit improves the condition so that nl_extras.h provides the +missing functions only if the minor version is < 2, or if minor is 2 +and micro is < 26. + +Signed-off-by: Thomas Petazzoni +--- + src/nl_extras.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/src/nl_extras.h ++++ b/src/nl_extras.h +@@ -1,7 +1,7 @@ + #ifndef __NL_EXTRAS_H + #define __NL_EXTRAS_H + +-#if LIBNL_VER_MIC <= 26 ++#if (LIBNL_VER_MIN < 2) || (LIBNL_VER_MIN == 2) && (LIBNL_VER_MIC <= 26) + + #ifndef NLA_S8 + +@@ -45,6 +45,6 @@ static inline int32_t nla_get_s32(struct + + #endif /* NLA_S64 */ + +-#endif /* LIBNL_VER_MIC */ ++#endif /* LIBNL_VER_* */ + + #endif /* __NL_EXTRAS_H */ diff --git a/package/network/utils/wwan/files/data/0421-03a7 b/package/network/utils/wwan/files/data/0421-03a7 index 1313401353..c2ce008244 100644 --- a/package/network/utils/wwan/files/data/0421-03a7 +++ b/package/network/utils/wwan/files/data/0421-03a7 @@ -1,6 +1,6 @@ { "desc": "Nokia C5-00 Mobile phone", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0421-060d b/package/network/utils/wwan/files/data/0421-060d index a9ad650d6b..3ef6df4cc2 100644 --- a/package/network/utils/wwan/files/data/0421-060d +++ b/package/network/utils/wwan/files/data/0421-060d @@ -1,6 +1,6 @@ { "desc": "Nokia CS-10", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0421-060e b/package/network/utils/wwan/files/data/0421-060e index a9ad650d6b..3ef6df4cc2 100644 --- a/package/network/utils/wwan/files/data/0421-060e +++ b/package/network/utils/wwan/files/data/0421-060e @@ -1,6 +1,6 @@ { "desc": "Nokia CS-10", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0421-0612 b/package/network/utils/wwan/files/data/0421-0612 index bc3e780ba9..d219e7a656 100644 --- a/package/network/utils/wwan/files/data/0421-0612 +++ b/package/network/utils/wwan/files/data/0421-0612 @@ -1,6 +1,6 @@ { "desc": "Nokia CS-15/CS-18", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0421-0619 b/package/network/utils/wwan/files/data/0421-0619 index 52fbf58416..e61bb093b1 100644 --- a/package/network/utils/wwan/files/data/0421-0619 +++ b/package/network/utils/wwan/files/data/0421-0619 @@ -1,6 +1,6 @@ { "desc": "Nokia CS-12", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0421-061e b/package/network/utils/wwan/files/data/0421-061e index c1cb9f44d4..41c8afae43 100644 --- a/package/network/utils/wwan/files/data/0421-061e +++ b/package/network/utils/wwan/files/data/0421-061e @@ -1,6 +1,6 @@ { "desc": "Nokia CS-11", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0421-0623 b/package/network/utils/wwan/files/data/0421-0623 index f6674bac6a..14c2530f30 100644 --- a/package/network/utils/wwan/files/data/0421-0623 +++ b/package/network/utils/wwan/files/data/0421-0623 @@ -1,6 +1,6 @@ { "desc": "Nokia CS-17", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0421-0629 b/package/network/utils/wwan/files/data/0421-0629 index b637c344b4..0feb718baf 100644 --- a/package/network/utils/wwan/files/data/0421-0629 +++ b/package/network/utils/wwan/files/data/0421-0629 @@ -1,6 +1,6 @@ { "desc": "Nokia CS-18", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0421-062d b/package/network/utils/wwan/files/data/0421-062d index a95192b8e5..e901589904 100644 --- a/package/network/utils/wwan/files/data/0421-062d +++ b/package/network/utils/wwan/files/data/0421-062d @@ -1,6 +1,6 @@ { "desc": "Nokia CS-19", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0421-062f b/package/network/utils/wwan/files/data/0421-062f index a95192b8e5..e901589904 100644 --- a/package/network/utils/wwan/files/data/0421-062f +++ b/package/network/utils/wwan/files/data/0421-062f @@ -1,6 +1,6 @@ { "desc": "Nokia CS-19", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0421-0638 b/package/network/utils/wwan/files/data/0421-0638 index 5fa7d4983e..42ec6fe6a8 100644 --- a/package/network/utils/wwan/files/data/0421-0638 +++ b/package/network/utils/wwan/files/data/0421-0638 @@ -1,6 +1,6 @@ { "desc": "Nokia 21M-02", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/05c6-0016 b/package/network/utils/wwan/files/data/05c6-0016 index 1a4a796b7c..b623ebff6b 100644 --- a/package/network/utils/wwan/files/data/05c6-0016 +++ b/package/network/utils/wwan/files/data/05c6-0016 @@ -1,6 +1,6 @@ { "desc": "iBall 3.5G Connect", "control": 2, - "data": 2 -} "generic": 1 + "data": 2, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/05c6-0023 b/package/network/utils/wwan/files/data/05c6-0023 index ce288ed48f..a01dea80de 100644 --- a/package/network/utils/wwan/files/data/05c6-0023 +++ b/package/network/utils/wwan/files/data/05c6-0023 @@ -2,4 +2,4 @@ "desc": "Leoxsys LN-72V", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/05c6-00a0 b/package/network/utils/wwan/files/data/05c6-00a0 index 0b9616025e..33972528a5 100644 --- a/package/network/utils/wwan/files/data/05c6-00a0 +++ b/package/network/utils/wwan/files/data/05c6-00a0 @@ -1,6 +1,6 @@ { "desc": "Axesstel MV241", "control": 2, - "data": 0 -} "generic": 1 + "data": 0, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/05c6-6000 b/package/network/utils/wwan/files/data/05c6-6000 index e8863b9e15..217038fe82 100644 --- a/package/network/utils/wwan/files/data/05c6-6000 +++ b/package/network/utils/wwan/files/data/05c6-6000 @@ -2,4 +2,4 @@ "desc": "Siemens SG75", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/05c6-9000 b/package/network/utils/wwan/files/data/05c6-9000 index 6a72f4ff9c..17cc41d4ff 100644 --- a/package/network/utils/wwan/files/data/05c6-9000 +++ b/package/network/utils/wwan/files/data/05c6-9000 @@ -2,4 +2,4 @@ "desc": "Generic Qualcomm", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/07d1-3e01 b/package/network/utils/wwan/files/data/07d1-3e01 index b1da177003..89447058d2 100644 --- a/package/network/utils/wwan/files/data/07d1-3e01 +++ b/package/network/utils/wwan/files/data/07d1-3e01 @@ -2,4 +2,4 @@ "desc": "D-Link DWM-152", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/07d1-3e02 b/package/network/utils/wwan/files/data/07d1-3e02 index cd1eceed9e..be0a89333c 100644 --- a/package/network/utils/wwan/files/data/07d1-3e02 +++ b/package/network/utils/wwan/files/data/07d1-3e02 @@ -2,4 +2,4 @@ "desc": "D-Link DWM-156", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/07d1-7e11 b/package/network/utils/wwan/files/data/07d1-7e11 index 84705b7519..3da9895e56 100644 --- a/package/network/utils/wwan/files/data/07d1-7e11 +++ b/package/network/utils/wwan/files/data/07d1-7e11 @@ -1,6 +1,6 @@ { "desc": "D-Link DWM-156", "control": 1, - "data": 2 -} "generic": 1 + "data": 2, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/0af0-6901 b/package/network/utils/wwan/files/data/0af0-6901 index 06b26643de..a88c36dda1 100644 --- a/package/network/utils/wwan/files/data/0af0-6901 +++ b/package/network/utils/wwan/files/data/0af0-6901 @@ -2,4 +2,4 @@ "desc": "Option GI0201", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/0af0-7201 b/package/network/utils/wwan/files/data/0af0-7201 index 20b18b76cc..fc84354c4b 100644 --- a/package/network/utils/wwan/files/data/0af0-7201 +++ b/package/network/utils/wwan/files/data/0af0-7201 @@ -2,4 +2,4 @@ "desc": "Option GTM380", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/0af0-9200 b/package/network/utils/wwan/files/data/0af0-9200 index 7e55a3661d..8230dd025b 100644 --- a/package/network/utils/wwan/files/data/0af0-9200 +++ b/package/network/utils/wwan/files/data/0af0-9200 @@ -2,4 +2,4 @@ "desc": "Option GTM671WFS", "control": 2, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/0b3c-c003 b/package/network/utils/wwan/files/data/0b3c-c003 index 5b4ea480e3..77528b5be3 100644 --- a/package/network/utils/wwan/files/data/0b3c-c003 +++ b/package/network/utils/wwan/files/data/0b3c-c003 @@ -2,4 +2,4 @@ "desc": "Olivetti Olicard 145", "control": 0, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/0bdb-1900 b/package/network/utils/wwan/files/data/0bdb-1900 index 84a9a9b7b0..e7d72f1212 100644 --- a/package/network/utils/wwan/files/data/0bdb-1900 +++ b/package/network/utils/wwan/files/data/0bdb-1900 @@ -1,6 +1,6 @@ { "desc": "Ericsson F3507g", "control": 4, - "data": 1 -} "acm": 1 + "data": 1, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0bdb-1902 b/package/network/utils/wwan/files/data/0bdb-1902 index 84a9a9b7b0..e7d72f1212 100644 --- a/package/network/utils/wwan/files/data/0bdb-1902 +++ b/package/network/utils/wwan/files/data/0bdb-1902 @@ -1,6 +1,6 @@ { "desc": "Ericsson F3507g", "control": 4, - "data": 1 -} "acm": 1 + "data": 1, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0bdb-190a b/package/network/utils/wwan/files/data/0bdb-190a index 2e826130b1..e5b16e34a3 100644 --- a/package/network/utils/wwan/files/data/0bdb-190a +++ b/package/network/utils/wwan/files/data/0bdb-190a @@ -1,6 +1,6 @@ { "desc": "Ericsson F3307", "control": 4, - "data": 1 -} "acm": 1 + "data": 1, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0bdb-190d b/package/network/utils/wwan/files/data/0bdb-190d index 2f725eb720..126c09f1e1 100644 --- a/package/network/utils/wwan/files/data/0bdb-190d +++ b/package/network/utils/wwan/files/data/0bdb-190d @@ -1,6 +1,6 @@ { "desc": "Ericsson F5521gw", "control": 4, - "data": 1 -} "acm": 1 + "data": 1, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0bdb-1910 b/package/network/utils/wwan/files/data/0bdb-1910 index 2f725eb720..126c09f1e1 100644 --- a/package/network/utils/wwan/files/data/0bdb-1910 +++ b/package/network/utils/wwan/files/data/0bdb-1910 @@ -1,6 +1,6 @@ { "desc": "Ericsson F5521gw", "control": 4, - "data": 1 -} "acm": 1 + "data": 1, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0c88-17da b/package/network/utils/wwan/files/data/0c88-17da index d5ca787a66..fcdf611cba 100644 --- a/package/network/utils/wwan/files/data/0c88-17da +++ b/package/network/utils/wwan/files/data/0c88-17da @@ -2,4 +2,4 @@ "desc": "Kyocera KPC650", "control": 0, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/0c88-180a b/package/network/utils/wwan/files/data/0c88-180a index a2bee34e56..e0426423c4 100644 --- a/package/network/utils/wwan/files/data/0c88-180a +++ b/package/network/utils/wwan/files/data/0c88-180a @@ -2,4 +2,4 @@ "desc": "Kyocera KPC680", "control": 0, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/0f3d-68aa b/package/network/utils/wwan/files/data/0f3d-68aa index 3a68c20648..dab35fa74b 100644 --- a/package/network/utils/wwan/files/data/0f3d-68aa +++ b/package/network/utils/wwan/files/data/0f3d-68aa @@ -2,4 +2,4 @@ "desc": "Sierra Wireless AC313U/320U/330U Direct IP", "control": 3, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/1004-6124 b/package/network/utils/wwan/files/data/1004-6124 index 471d8a5cf0..b6da8c49bf 100644 --- a/package/network/utils/wwan/files/data/1004-6124 +++ b/package/network/utils/wwan/files/data/1004-6124 @@ -1,6 +1,6 @@ { "desc": "LG L-05A", "control": 0, - "data": 2 -} "acm": 1 + "data": 2, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/1004-6141 b/package/network/utils/wwan/files/data/1004-6141 index 840dc64cf2..142d70fd46 100644 --- a/package/network/utils/wwan/files/data/1004-6141 +++ b/package/network/utils/wwan/files/data/1004-6141 @@ -1,6 +1,6 @@ { "desc": "LG LUU-2100TI", "control": 0, - "data": 2 -} "acm": 1 + "data": 2, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/1004-6157 b/package/network/utils/wwan/files/data/1004-6157 index ec94956626..842c0b4bda 100644 --- a/package/network/utils/wwan/files/data/1004-6157 +++ b/package/network/utils/wwan/files/data/1004-6157 @@ -1,6 +1,6 @@ { "desc": "LG LUU-2110TI", "control": 0, - "data": 2 -} "acm": 1 + "data": 2, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/1004-618f b/package/network/utils/wwan/files/data/1004-618f index df98b66be0..bb4b534129 100644 --- a/package/network/utils/wwan/files/data/1004-618f +++ b/package/network/utils/wwan/files/data/1004-618f @@ -2,4 +2,4 @@ "desc": "LG L-02C", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/106c-3711 b/package/network/utils/wwan/files/data/106c-3711 index 4d22d4daa8..0198c33ff4 100644 --- a/package/network/utils/wwan/files/data/106c-3711 +++ b/package/network/utils/wwan/files/data/106c-3711 @@ -1,6 +1,6 @@ { "desc": "PANTECH UM-150", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/106c-3714 b/package/network/utils/wwan/files/data/106c-3714 index 5fa2a3a69c..a735680ba9 100644 --- a/package/network/utils/wwan/files/data/106c-3714 +++ b/package/network/utils/wwan/files/data/106c-3714 @@ -1,6 +1,6 @@ { "desc": "PANTECH UM-175", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/106c-3715 b/package/network/utils/wwan/files/data/106c-3715 index 8cbe23dad0..5a5194d550 100644 --- a/package/network/utils/wwan/files/data/106c-3715 +++ b/package/network/utils/wwan/files/data/106c-3715 @@ -1,6 +1,6 @@ { "desc": "PANTECH UM-175AL", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/106c-3716 b/package/network/utils/wwan/files/data/106c-3716 index 18bd074f9d..aa50f5d545 100644 --- a/package/network/utils/wwan/files/data/106c-3716 +++ b/package/network/utils/wwan/files/data/106c-3716 @@ -1,6 +1,6 @@ { "desc": "PANTECH UM-190", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/106c-3717 b/package/network/utils/wwan/files/data/106c-3717 index e028a4b410..fd80949d8c 100644 --- a/package/network/utils/wwan/files/data/106c-3717 +++ b/package/network/utils/wwan/files/data/106c-3717 @@ -1,6 +1,6 @@ { "desc": "PANTECH UM-185C/UM185E", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/1199-0017 b/package/network/utils/wwan/files/data/1199-0017 index a50654d7fe..532aaddc1c 100644 --- a/package/network/utils/wwan/files/data/1199-0017 +++ b/package/network/utils/wwan/files/data/1199-0017 @@ -2,4 +2,4 @@ "desc": "Sierra EM5625", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0018 b/package/network/utils/wwan/files/data/1199-0018 index 02d7494aec..71447d1b63 100644 --- a/package/network/utils/wwan/files/data/1199-0018 +++ b/package/network/utils/wwan/files/data/1199-0018 @@ -2,4 +2,4 @@ "desc": "Sierra MC5720", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0019 b/package/network/utils/wwan/files/data/1199-0019 index 4d6d4a9db6..43ccfd09ca 100644 --- a/package/network/utils/wwan/files/data/1199-0019 +++ b/package/network/utils/wwan/files/data/1199-0019 @@ -2,4 +2,4 @@ "desc": "Sierra AC595U", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0020 b/package/network/utils/wwan/files/data/1199-0020 index 3482db4d66..d92732c668 100644 --- a/package/network/utils/wwan/files/data/1199-0020 +++ b/package/network/utils/wwan/files/data/1199-0020 @@ -2,4 +2,4 @@ "desc": "Sierra MC5725", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0021 b/package/network/utils/wwan/files/data/1199-0021 index 226c1b44dd..d879a34dd7 100644 --- a/package/network/utils/wwan/files/data/1199-0021 +++ b/package/network/utils/wwan/files/data/1199-0021 @@ -2,4 +2,4 @@ "desc": "Sierra AC597E", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0022 b/package/network/utils/wwan/files/data/1199-0022 index dd089a37e4..b4780db9d7 100644 --- a/package/network/utils/wwan/files/data/1199-0022 +++ b/package/network/utils/wwan/files/data/1199-0022 @@ -2,4 +2,4 @@ "desc": "Sierra EM5725", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0023 b/package/network/utils/wwan/files/data/1199-0023 index 9c7e72b9b1..447f681a15 100644 --- a/package/network/utils/wwan/files/data/1199-0023 +++ b/package/network/utils/wwan/files/data/1199-0023 @@ -2,4 +2,4 @@ "desc": "Sierra AC597", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0024 b/package/network/utils/wwan/files/data/1199-0024 index 425d4cccd2..9617b69fd6 100644 --- a/package/network/utils/wwan/files/data/1199-0024 +++ b/package/network/utils/wwan/files/data/1199-0024 @@ -2,4 +2,4 @@ "desc": "Sierra MC5727 CDMA", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0025 b/package/network/utils/wwan/files/data/1199-0025 index 002d6fb18f..f0792c8ed7 100644 --- a/package/network/utils/wwan/files/data/1199-0025 +++ b/package/network/utils/wwan/files/data/1199-0025 @@ -2,4 +2,4 @@ "desc": "Sierra AC598", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0026 b/package/network/utils/wwan/files/data/1199-0026 index 13998dee99..ba1ea2a08e 100644 --- a/package/network/utils/wwan/files/data/1199-0026 +++ b/package/network/utils/wwan/files/data/1199-0026 @@ -2,4 +2,4 @@ "desc": "Sierra T11", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0027 b/package/network/utils/wwan/files/data/1199-0027 index af4824c9c5..b959eca4b8 100644 --- a/package/network/utils/wwan/files/data/1199-0027 +++ b/package/network/utils/wwan/files/data/1199-0027 @@ -2,4 +2,4 @@ "desc": "Sierra AC402", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0028 b/package/network/utils/wwan/files/data/1199-0028 index 34c896e41d..02967db89d 100644 --- a/package/network/utils/wwan/files/data/1199-0028 +++ b/package/network/utils/wwan/files/data/1199-0028 @@ -2,4 +2,4 @@ "desc": "Sierra MC5728", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0112 b/package/network/utils/wwan/files/data/1199-0112 index 083baeea5f..900923c7b1 100644 --- a/package/network/utils/wwan/files/data/1199-0112 +++ b/package/network/utils/wwan/files/data/1199-0112 @@ -2,4 +2,4 @@ "desc": "Sierra CDMA 1xEVDO PC Card, AC580", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0120 b/package/network/utils/wwan/files/data/1199-0120 index 4d6d4a9db6..43ccfd09ca 100644 --- a/package/network/utils/wwan/files/data/1199-0120 +++ b/package/network/utils/wwan/files/data/1199-0120 @@ -2,4 +2,4 @@ "desc": "Sierra AC595U", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0218 b/package/network/utils/wwan/files/data/1199-0218 index 02d7494aec..71447d1b63 100644 --- a/package/network/utils/wwan/files/data/1199-0218 +++ b/package/network/utils/wwan/files/data/1199-0218 @@ -2,4 +2,4 @@ "desc": "Sierra MC5720", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0220 b/package/network/utils/wwan/files/data/1199-0220 index 3482db4d66..d92732c668 100644 --- a/package/network/utils/wwan/files/data/1199-0220 +++ b/package/network/utils/wwan/files/data/1199-0220 @@ -2,4 +2,4 @@ "desc": "Sierra MC5725", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0224 b/package/network/utils/wwan/files/data/1199-0224 index a57e54a647..b5b13cc4bf 100644 --- a/package/network/utils/wwan/files/data/1199-0224 +++ b/package/network/utils/wwan/files/data/1199-0224 @@ -2,4 +2,4 @@ "desc": "Sierra MC5727", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0301 b/package/network/utils/wwan/files/data/1199-0301 index 13fd7da9f2..2f3a6d00ff 100644 --- a/package/network/utils/wwan/files/data/1199-0301 +++ b/package/network/utils/wwan/files/data/1199-0301 @@ -2,4 +2,4 @@ "desc": "Sierra AC250U", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6802 b/package/network/utils/wwan/files/data/1199-6802 index d9bd29f956..497aff248d 100644 --- a/package/network/utils/wwan/files/data/1199-6802 +++ b/package/network/utils/wwan/files/data/1199-6802 @@ -2,4 +2,4 @@ "desc": "Sierra MC8755", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6803 b/package/network/utils/wwan/files/data/1199-6803 index c694fa3e12..0e3ebbb206 100644 --- a/package/network/utils/wwan/files/data/1199-6803 +++ b/package/network/utils/wwan/files/data/1199-6803 @@ -2,4 +2,4 @@ "desc": "Sierra MC8765", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6804 b/package/network/utils/wwan/files/data/1199-6804 index d9bd29f956..497aff248d 100644 --- a/package/network/utils/wwan/files/data/1199-6804 +++ b/package/network/utils/wwan/files/data/1199-6804 @@ -2,4 +2,4 @@ "desc": "Sierra MC8755", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6805 b/package/network/utils/wwan/files/data/1199-6805 index c694fa3e12..0e3ebbb206 100644 --- a/package/network/utils/wwan/files/data/1199-6805 +++ b/package/network/utils/wwan/files/data/1199-6805 @@ -2,4 +2,4 @@ "desc": "Sierra MC8765", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6808 b/package/network/utils/wwan/files/data/1199-6808 index d9bd29f956..497aff248d 100644 --- a/package/network/utils/wwan/files/data/1199-6808 +++ b/package/network/utils/wwan/files/data/1199-6808 @@ -2,4 +2,4 @@ "desc": "Sierra MC8755", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6809 b/package/network/utils/wwan/files/data/1199-6809 index d9bd29f956..497aff248d 100644 --- a/package/network/utils/wwan/files/data/1199-6809 +++ b/package/network/utils/wwan/files/data/1199-6809 @@ -2,4 +2,4 @@ "desc": "Sierra MC8755", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6813 b/package/network/utils/wwan/files/data/1199-6813 index f10c10449a..4e667e76a3 100644 --- a/package/network/utils/wwan/files/data/1199-6813 +++ b/package/network/utils/wwan/files/data/1199-6813 @@ -2,4 +2,4 @@ "desc": "Sierra MC8775", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6815 b/package/network/utils/wwan/files/data/1199-6815 index f10c10449a..4e667e76a3 100644 --- a/package/network/utils/wwan/files/data/1199-6815 +++ b/package/network/utils/wwan/files/data/1199-6815 @@ -2,4 +2,4 @@ "desc": "Sierra MC8775", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6816 b/package/network/utils/wwan/files/data/1199-6816 index f10c10449a..4e667e76a3 100644 --- a/package/network/utils/wwan/files/data/1199-6816 +++ b/package/network/utils/wwan/files/data/1199-6816 @@ -2,4 +2,4 @@ "desc": "Sierra MC8775", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6820 b/package/network/utils/wwan/files/data/1199-6820 index ce52c8f2ae..be1a6596e6 100644 --- a/package/network/utils/wwan/files/data/1199-6820 +++ b/package/network/utils/wwan/files/data/1199-6820 @@ -2,4 +2,4 @@ "desc": "Sierra AC875", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6821 b/package/network/utils/wwan/files/data/1199-6821 index 3ebd0be113..a912288511 100644 --- a/package/network/utils/wwan/files/data/1199-6821 +++ b/package/network/utils/wwan/files/data/1199-6821 @@ -2,4 +2,4 @@ "desc": "Sierra AC875U", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6822 b/package/network/utils/wwan/files/data/1199-6822 index 35ee919cc7..90fe42bd8f 100644 --- a/package/network/utils/wwan/files/data/1199-6822 +++ b/package/network/utils/wwan/files/data/1199-6822 @@ -2,4 +2,4 @@ "desc": "Sierra AC875E", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6833 b/package/network/utils/wwan/files/data/1199-6833 index 0fcd10e93a..11859acd4e 100644 --- a/package/network/utils/wwan/files/data/1199-6833 +++ b/package/network/utils/wwan/files/data/1199-6833 @@ -2,4 +2,4 @@ "desc": "Sierra MC8781", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6834 b/package/network/utils/wwan/files/data/1199-6834 index 0b9eadf708..e23f53e07a 100644 --- a/package/network/utils/wwan/files/data/1199-6834 +++ b/package/network/utils/wwan/files/data/1199-6834 @@ -2,4 +2,4 @@ "desc": "Sierra MC8780", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6835 b/package/network/utils/wwan/files/data/1199-6835 index 0fcd10e93a..11859acd4e 100644 --- a/package/network/utils/wwan/files/data/1199-6835 +++ b/package/network/utils/wwan/files/data/1199-6835 @@ -2,4 +2,4 @@ "desc": "Sierra MC8781", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6838 b/package/network/utils/wwan/files/data/1199-6838 index 0b9eadf708..e23f53e07a 100644 --- a/package/network/utils/wwan/files/data/1199-6838 +++ b/package/network/utils/wwan/files/data/1199-6838 @@ -2,4 +2,4 @@ "desc": "Sierra MC8780", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6839 b/package/network/utils/wwan/files/data/1199-6839 index 0fcd10e93a..11859acd4e 100644 --- a/package/network/utils/wwan/files/data/1199-6839 +++ b/package/network/utils/wwan/files/data/1199-6839 @@ -2,4 +2,4 @@ "desc": "Sierra MC8781", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-683a b/package/network/utils/wwan/files/data/1199-683a index 02da610cf2..aca144df27 100644 --- a/package/network/utils/wwan/files/data/1199-683a +++ b/package/network/utils/wwan/files/data/1199-683a @@ -2,4 +2,4 @@ "desc": "Sierra MC8785", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-683b b/package/network/utils/wwan/files/data/1199-683b index 0f2a133cf2..8df7e72d6a 100644 --- a/package/network/utils/wwan/files/data/1199-683b +++ b/package/network/utils/wwan/files/data/1199-683b @@ -2,4 +2,4 @@ "desc": "Sierra MC8785 Composite", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6850 b/package/network/utils/wwan/files/data/1199-6850 index 1989d0abc3..c8788251f1 100644 --- a/package/network/utils/wwan/files/data/1199-6850 +++ b/package/network/utils/wwan/files/data/1199-6850 @@ -2,4 +2,4 @@ "desc": "Sierra AC880", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6851 b/package/network/utils/wwan/files/data/1199-6851 index 16d8ab4654..339f39a5e5 100644 --- a/package/network/utils/wwan/files/data/1199-6851 +++ b/package/network/utils/wwan/files/data/1199-6851 @@ -2,4 +2,4 @@ "desc": "Sierra AC 881", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6852 b/package/network/utils/wwan/files/data/1199-6852 index 65be37b7a1..6dcb045c5a 100644 --- a/package/network/utils/wwan/files/data/1199-6852 +++ b/package/network/utils/wwan/files/data/1199-6852 @@ -2,4 +2,4 @@ "desc": "Sierra AC880E", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6853 b/package/network/utils/wwan/files/data/1199-6853 index a8aee6d9c4..09b482cf79 100644 --- a/package/network/utils/wwan/files/data/1199-6853 +++ b/package/network/utils/wwan/files/data/1199-6853 @@ -2,4 +2,4 @@ "desc": "Sierra AC881E", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6855 b/package/network/utils/wwan/files/data/1199-6855 index 24eddc6f1e..ad5f0491d8 100644 --- a/package/network/utils/wwan/files/data/1199-6855 +++ b/package/network/utils/wwan/files/data/1199-6855 @@ -2,4 +2,4 @@ "desc": "Sierra AC880U", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6856 b/package/network/utils/wwan/files/data/1199-6856 index 415a80a153..9bc68721c3 100644 --- a/package/network/utils/wwan/files/data/1199-6856 +++ b/package/network/utils/wwan/files/data/1199-6856 @@ -2,4 +2,4 @@ "desc": "Sierra ATT USB Connect 881", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6859 b/package/network/utils/wwan/files/data/1199-6859 index 075cc6bcd1..9383e6c0d4 100644 --- a/package/network/utils/wwan/files/data/1199-6859 +++ b/package/network/utils/wwan/files/data/1199-6859 @@ -2,4 +2,4 @@ "desc": "Sierra AC885E", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-685a b/package/network/utils/wwan/files/data/1199-685a index 075cc6bcd1..9383e6c0d4 100644 --- a/package/network/utils/wwan/files/data/1199-685a +++ b/package/network/utils/wwan/files/data/1199-685a @@ -2,4 +2,4 @@ "desc": "Sierra AC885E", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6880 b/package/network/utils/wwan/files/data/1199-6880 index e188c03774..bae654f5e8 100644 --- a/package/network/utils/wwan/files/data/1199-6880 +++ b/package/network/utils/wwan/files/data/1199-6880 @@ -2,4 +2,4 @@ "desc": "Sierra C885", "control": 3, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6890 b/package/network/utils/wwan/files/data/1199-6890 index 6d2f892a37..7154b0ceb7 100644 --- a/package/network/utils/wwan/files/data/1199-6890 +++ b/package/network/utils/wwan/files/data/1199-6890 @@ -2,4 +2,4 @@ "desc": "Sierra C888", "control": 3, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6891 b/package/network/utils/wwan/files/data/1199-6891 index fa866e2918..1e1c89c1e3 100644 --- a/package/network/utils/wwan/files/data/1199-6891 +++ b/package/network/utils/wwan/files/data/1199-6891 @@ -2,4 +2,4 @@ "desc": "Sierra C22 and C33", "control": 3, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6892 b/package/network/utils/wwan/files/data/1199-6892 index 99a2bd2d6d..923302a4f1 100644 --- a/package/network/utils/wwan/files/data/1199-6892 +++ b/package/network/utils/wwan/files/data/1199-6892 @@ -2,4 +2,4 @@ "desc": "Sierra Compass HSPA", "control": 3, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6893 b/package/network/utils/wwan/files/data/1199-6893 index 16f4dfda4e..9cd3ad09e5 100644 --- a/package/network/utils/wwan/files/data/1199-6893 +++ b/package/network/utils/wwan/files/data/1199-6893 @@ -2,4 +2,4 @@ "desc": "Sierra C889", "control": 3, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-68aa b/package/network/utils/wwan/files/data/1199-68aa index 7c5a9f2bae..062c200f4e 100644 --- a/package/network/utils/wwan/files/data/1199-68aa +++ b/package/network/utils/wwan/files/data/1199-68aa @@ -2,4 +2,4 @@ "desc": "Sierra AC320U/AC330U Direct IP", "control": 3, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1035 b/package/network/utils/wwan/files/data/12d1-1035 index ad7025a1d3..1b595cd58e 100644 --- a/package/network/utils/wwan/files/data/12d1-1035 +++ b/package/network/utils/wwan/files/data/12d1-1035 @@ -2,4 +2,4 @@ "desc": "HUAWEI U8110", "control": 0, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1406 b/package/network/utils/wwan/files/data/12d1-1406 index b1aa31783e..7961908070 100644 --- a/package/network/utils/wwan/files/data/12d1-1406 +++ b/package/network/utils/wwan/files/data/12d1-1406 @@ -2,4 +2,4 @@ "desc": "HUAWEI/Option newer modems", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-140b b/package/network/utils/wwan/files/data/12d1-140b index cc99898ae8..cd8cbdd514 100644 --- a/package/network/utils/wwan/files/data/12d1-140b +++ b/package/network/utils/wwan/files/data/12d1-140b @@ -2,4 +2,4 @@ "desc": "HUAWEI/Option EC1260 Wireless Data Modem HSD USB Card", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1412 b/package/network/utils/wwan/files/data/12d1-1412 index e6fb6cc7e0..342672a1d1 100644 --- a/package/network/utils/wwan/files/data/12d1-1412 +++ b/package/network/utils/wwan/files/data/12d1-1412 @@ -2,4 +2,4 @@ "desc": "HUAWEI/Option EC168", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-141b b/package/network/utils/wwan/files/data/12d1-141b index b1aa31783e..7961908070 100644 --- a/package/network/utils/wwan/files/data/12d1-141b +++ b/package/network/utils/wwan/files/data/12d1-141b @@ -2,4 +2,4 @@ "desc": "HUAWEI/Option newer modems", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1433 b/package/network/utils/wwan/files/data/12d1-1433 index c5d86cb152..3159714747 100644 --- a/package/network/utils/wwan/files/data/12d1-1433 +++ b/package/network/utils/wwan/files/data/12d1-1433 @@ -2,4 +2,4 @@ "desc": "HUAWEI/Option E1756C", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1436 b/package/network/utils/wwan/files/data/12d1-1436 index 7db8644b15..a73fdc4c37 100644 --- a/package/network/utils/wwan/files/data/12d1-1436 +++ b/package/network/utils/wwan/files/data/12d1-1436 @@ -2,4 +2,4 @@ "desc": "HUAWEI/Option E1800", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1444 b/package/network/utils/wwan/files/data/12d1-1444 index 500d775127..cbbf9d28f7 100644 --- a/package/network/utils/wwan/files/data/12d1-1444 +++ b/package/network/utils/wwan/files/data/12d1-1444 @@ -2,4 +2,4 @@ "desc": "HUAWEI/Option E352-R1", "control": 0, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-144e b/package/network/utils/wwan/files/data/12d1-144e index a704946aa0..c80d2e9b50 100644 --- a/package/network/utils/wwan/files/data/12d1-144e +++ b/package/network/utils/wwan/files/data/12d1-144e @@ -2,4 +2,4 @@ "desc": "Huawei K3806", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1464 b/package/network/utils/wwan/files/data/12d1-1464 index 1b5397cd66..ffa690d8aa 100644 --- a/package/network/utils/wwan/files/data/12d1-1464 +++ b/package/network/utils/wwan/files/data/12d1-1464 @@ -2,4 +2,4 @@ "desc": "Huawei K4505", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1465 b/package/network/utils/wwan/files/data/12d1-1465 index dbb20f7cc8..55696ffa41 100644 --- a/package/network/utils/wwan/files/data/12d1-1465 +++ b/package/network/utils/wwan/files/data/12d1-1465 @@ -2,4 +2,4 @@ "desc": "Huawei K3765", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1491 b/package/network/utils/wwan/files/data/12d1-1491 index c1ae9a5684..2228a909f8 100644 --- a/package/network/utils/wwan/files/data/12d1-1491 +++ b/package/network/utils/wwan/files/data/12d1-1491 @@ -2,4 +2,4 @@ "desc": "Huawei R201", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-14a5 b/package/network/utils/wwan/files/data/12d1-14a5 index 50ea079579..6eac38b53d 100644 --- a/package/network/utils/wwan/files/data/12d1-14a5 +++ b/package/network/utils/wwan/files/data/12d1-14a5 @@ -2,4 +2,4 @@ "desc": "Huawei E173", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-14a8 b/package/network/utils/wwan/files/data/12d1-14a8 index 50ea079579..6eac38b53d 100644 --- a/package/network/utils/wwan/files/data/12d1-14a8 +++ b/package/network/utils/wwan/files/data/12d1-14a8 @@ -2,4 +2,4 @@ "desc": "Huawei E173", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-14ae b/package/network/utils/wwan/files/data/12d1-14ae index e27a798ff8..92f9b6a1c3 100644 --- a/package/network/utils/wwan/files/data/12d1-14ae +++ b/package/network/utils/wwan/files/data/12d1-14ae @@ -2,4 +2,4 @@ "desc": "Huawei K3806", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-14cb b/package/network/utils/wwan/files/data/12d1-14cb index b496a60bc9..8419b69379 100644 --- a/package/network/utils/wwan/files/data/12d1-14cb +++ b/package/network/utils/wwan/files/data/12d1-14cb @@ -2,4 +2,4 @@ "desc": "Huawei K4510", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-14cf b/package/network/utils/wwan/files/data/12d1-14cf index 18e1e1e3a7..88a0f92dea 100644 --- a/package/network/utils/wwan/files/data/12d1-14cf +++ b/package/network/utils/wwan/files/data/12d1-14cf @@ -2,4 +2,4 @@ "desc": "Huawei K3772", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1506 b/package/network/utils/wwan/files/data/12d1-1506 index 65760e8f9a..9e575afd9f 100644 --- a/package/network/utils/wwan/files/data/12d1-1506 +++ b/package/network/utils/wwan/files/data/12d1-1506 @@ -2,4 +2,4 @@ "desc": "Huawei E367/E398", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-151d b/package/network/utils/wwan/files/data/12d1-151d index e5eae2a88b..b5a3f104d2 100644 --- a/package/network/utils/wwan/files/data/12d1-151d +++ b/package/network/utils/wwan/files/data/12d1-151d @@ -2,4 +2,4 @@ "desc": "Huawei E3131", "control": 3, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-156c b/package/network/utils/wwan/files/data/12d1-156c index 3fc6b1b13c..9a0a2927c9 100644 --- a/package/network/utils/wwan/files/data/12d1-156c +++ b/package/network/utils/wwan/files/data/12d1-156c @@ -2,4 +2,4 @@ "desc": "Huawei E3276", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1c05 b/package/network/utils/wwan/files/data/12d1-1c05 index c5612241bb..6345f537d8 100644 --- a/package/network/utils/wwan/files/data/12d1-1c05 +++ b/package/network/utils/wwan/files/data/12d1-1c05 @@ -2,4 +2,4 @@ "desc": "Huawei E173s", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1c07 b/package/network/utils/wwan/files/data/12d1-1c07 index cee727686b..e8681e6230 100644 --- a/package/network/utils/wwan/files/data/12d1-1c07 +++ b/package/network/utils/wwan/files/data/12d1-1c07 @@ -2,4 +2,4 @@ "desc": "Huawei E188", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1c08 b/package/network/utils/wwan/files/data/12d1-1c08 index 4f6fb21fa6..52df7e2a30 100644 --- a/package/network/utils/wwan/files/data/12d1-1c08 +++ b/package/network/utils/wwan/files/data/12d1-1c08 @@ -2,4 +2,4 @@ "desc": "Huawei E173s", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1c10 b/package/network/utils/wwan/files/data/12d1-1c10 index 50ea079579..6eac38b53d 100644 --- a/package/network/utils/wwan/files/data/12d1-1c10 +++ b/package/network/utils/wwan/files/data/12d1-1c10 @@ -2,4 +2,4 @@ "desc": "Huawei E173", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1c12 b/package/network/utils/wwan/files/data/12d1-1c12 index 50ea079579..6eac38b53d 100644 --- a/package/network/utils/wwan/files/data/12d1-1c12 +++ b/package/network/utils/wwan/files/data/12d1-1c12 @@ -2,4 +2,4 @@ "desc": "Huawei E173", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1c23 b/package/network/utils/wwan/files/data/12d1-1c23 index d1043471be..41aef76b20 100644 --- a/package/network/utils/wwan/files/data/12d1-1c23 +++ b/package/network/utils/wwan/files/data/12d1-1c23 @@ -2,4 +2,4 @@ "desc": "Huawei E173", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-1400 b/package/network/utils/wwan/files/data/1410-1400 index e2bda9674f..a36e1aa599 100644 --- a/package/network/utils/wwan/files/data/1410-1400 +++ b/package/network/utils/wwan/files/data/1410-1400 @@ -2,4 +2,4 @@ "desc": "Novatel U730", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-1410 b/package/network/utils/wwan/files/data/1410-1410 index ba48aea923..0702468e51 100644 --- a/package/network/utils/wwan/files/data/1410-1410 +++ b/package/network/utils/wwan/files/data/1410-1410 @@ -2,4 +2,4 @@ "desc": "Novatel U740", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-1420 b/package/network/utils/wwan/files/data/1410-1420 index 5cc96b695a..f29b08faeb 100644 --- a/package/network/utils/wwan/files/data/1410-1420 +++ b/package/network/utils/wwan/files/data/1410-1420 @@ -2,4 +2,4 @@ "desc": "Novatel U870", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-1430 b/package/network/utils/wwan/files/data/1410-1430 index 012f3ad9f9..275d3a70cb 100644 --- a/package/network/utils/wwan/files/data/1410-1430 +++ b/package/network/utils/wwan/files/data/1410-1430 @@ -2,4 +2,4 @@ "desc": "Novatel XU870", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-1450 b/package/network/utils/wwan/files/data/1410-1450 index d1016773df..a28901f004 100644 --- a/package/network/utils/wwan/files/data/1410-1450 +++ b/package/network/utils/wwan/files/data/1410-1450 @@ -2,4 +2,4 @@ "desc": "Novatel X950D", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-2100 b/package/network/utils/wwan/files/data/1410-2100 index a0328cf92b..4c8f576933 100644 --- a/package/network/utils/wwan/files/data/1410-2100 +++ b/package/network/utils/wwan/files/data/1410-2100 @@ -2,4 +2,4 @@ "desc": "Novatel EV620", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-2110 b/package/network/utils/wwan/files/data/1410-2110 index 701bf42455..14012df7a6 100644 --- a/package/network/utils/wwan/files/data/1410-2110 +++ b/package/network/utils/wwan/files/data/1410-2110 @@ -2,4 +2,4 @@ "desc": "Novatel ES720", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-2120 b/package/network/utils/wwan/files/data/1410-2120 index 7ab3c9d782..d1c7615c50 100644 --- a/package/network/utils/wwan/files/data/1410-2120 +++ b/package/network/utils/wwan/files/data/1410-2120 @@ -2,4 +2,4 @@ "desc": "Novatel E725", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-2130 b/package/network/utils/wwan/files/data/1410-2130 index 98006e20ec..fc8404f3d2 100644 --- a/package/network/utils/wwan/files/data/1410-2130 +++ b/package/network/utils/wwan/files/data/1410-2130 @@ -2,4 +2,4 @@ "desc": "Novatel ES620", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-2400 b/package/network/utils/wwan/files/data/1410-2400 index cd9f290691..1f18712543 100644 --- a/package/network/utils/wwan/files/data/1410-2400 +++ b/package/network/utils/wwan/files/data/1410-2400 @@ -2,4 +2,4 @@ "desc": "Novatel EU730", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-2410 b/package/network/utils/wwan/files/data/1410-2410 index 4635063b24..fe656f56c3 100644 --- a/package/network/utils/wwan/files/data/1410-2410 +++ b/package/network/utils/wwan/files/data/1410-2410 @@ -2,4 +2,4 @@ "desc": "Novatel EU740", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-2420 b/package/network/utils/wwan/files/data/1410-2420 index 340666c7ca..db1c68fd58 100644 --- a/package/network/utils/wwan/files/data/1410-2420 +++ b/package/network/utils/wwan/files/data/1410-2420 @@ -2,4 +2,4 @@ "desc": "Novatel EU870D", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-4100 b/package/network/utils/wwan/files/data/1410-4100 index 260a2891ad..6ec573596a 100644 --- a/package/network/utils/wwan/files/data/1410-4100 +++ b/package/network/utils/wwan/files/data/1410-4100 @@ -2,4 +2,4 @@ "desc": "Novatel MC727/U727", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-4400 b/package/network/utils/wwan/files/data/1410-4400 index 838a7fbf9a..0ecddcf112 100644 --- a/package/network/utils/wwan/files/data/1410-4400 +++ b/package/network/utils/wwan/files/data/1410-4400 @@ -2,4 +2,4 @@ "desc": "Novatel Ovation MC930D/MC950D", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-6000 b/package/network/utils/wwan/files/data/1410-6000 index a12716e4b7..861c992e01 100644 --- a/package/network/utils/wwan/files/data/1410-6000 +++ b/package/network/utils/wwan/files/data/1410-6000 @@ -2,4 +2,4 @@ "desc": "Novatel USB760", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-6001 b/package/network/utils/wwan/files/data/1410-6001 index a12716e4b7..861c992e01 100644 --- a/package/network/utils/wwan/files/data/1410-6001 +++ b/package/network/utils/wwan/files/data/1410-6001 @@ -2,4 +2,4 @@ "desc": "Novatel USB760", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-6002 b/package/network/utils/wwan/files/data/1410-6002 index fce8e9bfd6..1c97f16dea 100644 --- a/package/network/utils/wwan/files/data/1410-6002 +++ b/package/network/utils/wwan/files/data/1410-6002 @@ -2,4 +2,4 @@ "desc": "Novatel USB760 3G", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-6010 b/package/network/utils/wwan/files/data/1410-6010 index d08c399a16..0b9b226d27 100644 --- a/package/network/utils/wwan/files/data/1410-6010 +++ b/package/network/utils/wwan/files/data/1410-6010 @@ -2,4 +2,4 @@ "desc": "Novatel MC780", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-7001 b/package/network/utils/wwan/files/data/1410-7001 index 079c7d52c8..ac03ddc691 100644 --- a/package/network/utils/wwan/files/data/1410-7001 +++ b/package/network/utils/wwan/files/data/1410-7001 @@ -2,4 +2,4 @@ "desc": "Novatel MiFi 2372", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-7003 b/package/network/utils/wwan/files/data/1410-7003 index 079c7d52c8..ac03ddc691 100644 --- a/package/network/utils/wwan/files/data/1410-7003 +++ b/package/network/utils/wwan/files/data/1410-7003 @@ -2,4 +2,4 @@ "desc": "Novatel MiFi 2372", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-7030 b/package/network/utils/wwan/files/data/1410-7030 index 0fc402905d..1ea46ea5d5 100644 --- a/package/network/utils/wwan/files/data/1410-7030 +++ b/package/network/utils/wwan/files/data/1410-7030 @@ -2,4 +2,4 @@ "desc": "Novatel USB998", "control": 0, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-7031 b/package/network/utils/wwan/files/data/1410-7031 index e1ba049c13..86d03cee04 100644 --- a/package/network/utils/wwan/files/data/1410-7031 +++ b/package/network/utils/wwan/files/data/1410-7031 @@ -1,6 +1,6 @@ { "desc": "Novatel USB679", "control": 0, - "data": 0 -} "generic": 1 + "data": 0, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/1410-7041 b/package/network/utils/wwan/files/data/1410-7041 index 03e8fcd509..203597dd7b 100644 --- a/package/network/utils/wwan/files/data/1410-7041 +++ b/package/network/utils/wwan/files/data/1410-7041 @@ -2,4 +2,4 @@ "desc": "Novatel MF3470", "control": 0, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-7042 b/package/network/utils/wwan/files/data/1410-7042 index 0bb9cdbd2b..ea6d71fa23 100644 --- a/package/network/utils/wwan/files/data/1410-7042 +++ b/package/network/utils/wwan/files/data/1410-7042 @@ -2,4 +2,4 @@ "desc": "Novatel Ovation MC545/MC547", "control": 0, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1529-3100 b/package/network/utils/wwan/files/data/1529-3100 index 5e4fe34b5a..afeb681a2c 100644 --- a/package/network/utils/wwan/files/data/1529-3100 +++ b/package/network/utils/wwan/files/data/1529-3100 @@ -1,6 +1,6 @@ { "desc": "UBIQUAM U-100/105/200/300/520", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d5-6202 b/package/network/utils/wwan/files/data/16d5-6202 index 1ba8a502b6..6225785211 100644 --- a/package/network/utils/wwan/files/data/16d5-6202 +++ b/package/network/utils/wwan/files/data/16d5-6202 @@ -2,4 +2,4 @@ "desc": "AnyData ADU-620UW", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/16d5-6501 b/package/network/utils/wwan/files/data/16d5-6501 index 09207df3b3..96574f365c 100644 --- a/package/network/utils/wwan/files/data/16d5-6501 +++ b/package/network/utils/wwan/files/data/16d5-6501 @@ -2,4 +2,4 @@ "desc": "AnyData ADU-300A", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/16d5-6502 b/package/network/utils/wwan/files/data/16d5-6502 index 4bdbf899ac..8607d41870 100644 --- a/package/network/utils/wwan/files/data/16d5-6502 +++ b/package/network/utils/wwan/files/data/16d5-6502 @@ -2,4 +2,4 @@ "desc": "AnyData ADU-500A", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/16d5-6603 b/package/network/utils/wwan/files/data/16d5-6603 index 5c108a2d38..8f0ff3b0b0 100644 --- a/package/network/utils/wwan/files/data/16d5-6603 +++ b/package/network/utils/wwan/files/data/16d5-6603 @@ -1,6 +1,6 @@ { "desc": "AnyData ADU-890WH", "control": 0, - "data": 0 -} "generic": 1 + "data": 0, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/16d5-900d b/package/network/utils/wwan/files/data/16d5-900d index b1c486988b..4ac52bba62 100644 --- a/package/network/utils/wwan/files/data/16d5-900d +++ b/package/network/utils/wwan/files/data/16d5-900d @@ -1,6 +1,6 @@ { "desc": "AnyData ADU-890WH", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d8-5141 b/package/network/utils/wwan/files/data/16d8-5141 index bda356fda0..eeb3ea4f3b 100644 --- a/package/network/utils/wwan/files/data/16d8-5141 +++ b/package/network/utils/wwan/files/data/16d8-5141 @@ -1,6 +1,6 @@ { "desc": "Cmotech CNU-510", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d8-5533 b/package/network/utils/wwan/files/data/16d8-5533 index 185d257d4e..9fd23cdcd3 100644 --- a/package/network/utils/wwan/files/data/16d8-5533 +++ b/package/network/utils/wwan/files/data/16d8-5533 @@ -1,6 +1,6 @@ { "desc": "Cmotech CNU-550", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d8-5543 b/package/network/utils/wwan/files/data/16d8-5543 index 185d257d4e..9fd23cdcd3 100644 --- a/package/network/utils/wwan/files/data/16d8-5543 +++ b/package/network/utils/wwan/files/data/16d8-5543 @@ -1,6 +1,6 @@ { "desc": "Cmotech CNU-550", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d8-5553 b/package/network/utils/wwan/files/data/16d8-5553 index 2403381d1a..323ec28f82 100644 --- a/package/network/utils/wwan/files/data/16d8-5553 +++ b/package/network/utils/wwan/files/data/16d8-5553 @@ -1,6 +1,6 @@ { "desc": "Cmotech CDU-550", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d8-6002 b/package/network/utils/wwan/files/data/16d8-6002 index 715878c45c..d779cdf8a9 100644 --- a/package/network/utils/wwan/files/data/16d8-6002 +++ b/package/network/utils/wwan/files/data/16d8-6002 @@ -2,4 +2,4 @@ "desc": "Franklin U300", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/16d8-6006 b/package/network/utils/wwan/files/data/16d8-6006 index bb8f87e0ce..92c5f0d8d0 100644 --- a/package/network/utils/wwan/files/data/16d8-6006 +++ b/package/network/utils/wwan/files/data/16d8-6006 @@ -2,4 +2,4 @@ "desc": "Cmotech CGU-628", "control": 0, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/16d8-6522 b/package/network/utils/wwan/files/data/16d8-6522 index 44343d002e..8301da1815 100644 --- a/package/network/utils/wwan/files/data/16d8-6522 +++ b/package/network/utils/wwan/files/data/16d8-6522 @@ -1,6 +1,6 @@ { "desc": "Cmotech CDU-650", "control": 2, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d8-6523 b/package/network/utils/wwan/files/data/16d8-6523 index 406566b9a0..40ee5cbd67 100644 --- a/package/network/utils/wwan/files/data/16d8-6523 +++ b/package/network/utils/wwan/files/data/16d8-6523 @@ -1,6 +1,6 @@ { "desc": "Cmotech CCU-650U", "control": 2, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d8-6532 b/package/network/utils/wwan/files/data/16d8-6532 index 5b6a147ffc..e0cbfe2cb9 100644 --- a/package/network/utils/wwan/files/data/16d8-6532 +++ b/package/network/utils/wwan/files/data/16d8-6532 @@ -1,6 +1,6 @@ { "desc": "Cmotech CCU-650", "control": 2, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d8-6533 b/package/network/utils/wwan/files/data/16d8-6533 index 07175f3180..f3866bbc32 100644 --- a/package/network/utils/wwan/files/data/16d8-6533 +++ b/package/network/utils/wwan/files/data/16d8-6533 @@ -1,6 +1,6 @@ { "desc": "Cmotech CNM-650", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d8-6543 b/package/network/utils/wwan/files/data/16d8-6543 index c518ca723d..99fcedd652 100644 --- a/package/network/utils/wwan/files/data/16d8-6543 +++ b/package/network/utils/wwan/files/data/16d8-6543 @@ -1,6 +1,6 @@ { "desc": "Cmotech CNU-650", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d8-680a b/package/network/utils/wwan/files/data/16d8-680a index 9b1c85fe86..836092149e 100644 --- a/package/network/utils/wwan/files/data/16d8-680a +++ b/package/network/utils/wwan/files/data/16d8-680a @@ -1,6 +1,6 @@ { "desc": "Cmotech CDU-680", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-0001 b/package/network/utils/wwan/files/data/19d2-0001 index 31ee3fd329..5b0d9622de 100644 --- a/package/network/utils/wwan/files/data/19d2-0001 +++ b/package/network/utils/wwan/files/data/19d2-0001 @@ -2,4 +2,4 @@ "desc": "ONDA MT505UP/ZTE", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0015 b/package/network/utils/wwan/files/data/19d2-0015 index 31ee3fd329..5b0d9622de 100644 --- a/package/network/utils/wwan/files/data/19d2-0015 +++ b/package/network/utils/wwan/files/data/19d2-0015 @@ -2,4 +2,4 @@ "desc": "ONDA MT505UP/ZTE", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0016 b/package/network/utils/wwan/files/data/19d2-0016 index 48c5fefd3a..31c7421e0b 100644 --- a/package/network/utils/wwan/files/data/19d2-0016 +++ b/package/network/utils/wwan/files/data/19d2-0016 @@ -2,4 +2,4 @@ "desc": "ONDA MF110/ZTE", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0018 b/package/network/utils/wwan/files/data/19d2-0018 index 76120d480e..35dc57ef9c 100644 --- a/package/network/utils/wwan/files/data/19d2-0018 +++ b/package/network/utils/wwan/files/data/19d2-0018 @@ -2,4 +2,4 @@ "desc": "ONDA MSA110UP/ZTE", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0022 b/package/network/utils/wwan/files/data/19d2-0022 index 7ed8ed1ca1..0d7b8264bc 100644 --- a/package/network/utils/wwan/files/data/19d2-0022 +++ b/package/network/utils/wwan/files/data/19d2-0022 @@ -2,4 +2,4 @@ "desc": "ZTE K2525", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0024 b/package/network/utils/wwan/files/data/19d2-0024 index 5ae34af23e..128bd72ef4 100644 --- a/package/network/utils/wwan/files/data/19d2-0024 +++ b/package/network/utils/wwan/files/data/19d2-0024 @@ -2,4 +2,4 @@ "desc": "ONDA MT503HSA", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0033 b/package/network/utils/wwan/files/data/19d2-0033 index e99314e34d..bcca7ffaa2 100644 --- a/package/network/utils/wwan/files/data/19d2-0033 +++ b/package/network/utils/wwan/files/data/19d2-0033 @@ -2,4 +2,4 @@ "desc": "ZTE MF636", "control": 1, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0037 b/package/network/utils/wwan/files/data/19d2-0037 index 8ee565d427..0bc992ece3 100644 --- a/package/network/utils/wwan/files/data/19d2-0037 +++ b/package/network/utils/wwan/files/data/19d2-0037 @@ -2,4 +2,4 @@ "desc": "ONDA MT505UP/ZTE", "control": 2, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0039 b/package/network/utils/wwan/files/data/19d2-0039 index c80a51aefa..3a6e72e406 100644 --- a/package/network/utils/wwan/files/data/19d2-0039 +++ b/package/network/utils/wwan/files/data/19d2-0039 @@ -2,4 +2,4 @@ "desc": "ZTE MF100", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0057 b/package/network/utils/wwan/files/data/19d2-0057 index 7800746132..1d0f0a1590 100644 --- a/package/network/utils/wwan/files/data/19d2-0057 +++ b/package/network/utils/wwan/files/data/19d2-0057 @@ -2,4 +2,4 @@ "desc": "AIKO 83D", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0064 b/package/network/utils/wwan/files/data/19d2-0064 index edb0efef05..2b4784134a 100644 --- a/package/network/utils/wwan/files/data/19d2-0064 +++ b/package/network/utils/wwan/files/data/19d2-0064 @@ -2,4 +2,4 @@ "desc": "ZTE MF627", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0066 b/package/network/utils/wwan/files/data/19d2-0066 index c57d7aec18..f8bbdaef76 100644 --- a/package/network/utils/wwan/files/data/19d2-0066 +++ b/package/network/utils/wwan/files/data/19d2-0066 @@ -2,4 +2,4 @@ "desc": "ZTE MF626", "control": 1, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0073 b/package/network/utils/wwan/files/data/19d2-0073 index 0f9502f122..acd581c2af 100644 --- a/package/network/utils/wwan/files/data/19d2-0073 +++ b/package/network/utils/wwan/files/data/19d2-0073 @@ -2,4 +2,4 @@ "desc": "ZTE A580", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0079 b/package/network/utils/wwan/files/data/19d2-0079 index 569a9996cc..c2d52de5f0 100644 --- a/package/network/utils/wwan/files/data/19d2-0079 +++ b/package/network/utils/wwan/files/data/19d2-0079 @@ -2,4 +2,4 @@ "desc": "ZTE A353", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0082 b/package/network/utils/wwan/files/data/19d2-0082 index ea4fcd9459..2dbd3b51aa 100644 --- a/package/network/utils/wwan/files/data/19d2-0082 +++ b/package/network/utils/wwan/files/data/19d2-0082 @@ -2,4 +2,4 @@ "desc": "ZTE MF668/MF190", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0086 b/package/network/utils/wwan/files/data/19d2-0086 index f25d77a60e..0527f6fed7 100644 --- a/package/network/utils/wwan/files/data/19d2-0086 +++ b/package/network/utils/wwan/files/data/19d2-0086 @@ -2,4 +2,4 @@ "desc": "ZTE MF645", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0091 b/package/network/utils/wwan/files/data/19d2-0091 index 4e429a6329..be9cb55bd6 100644 --- a/package/network/utils/wwan/files/data/19d2-0091 +++ b/package/network/utils/wwan/files/data/19d2-0091 @@ -2,4 +2,4 @@ "desc": "ZTE MF636", "control": 1, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0094 b/package/network/utils/wwan/files/data/19d2-0094 index 34a976ebae..ed2fd2637f 100644 --- a/package/network/utils/wwan/files/data/19d2-0094 +++ b/package/network/utils/wwan/files/data/19d2-0094 @@ -2,4 +2,4 @@ "desc": "ZTE AC581", "control": 3, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0108 b/package/network/utils/wwan/files/data/19d2-0108 index 369d70f09d..aac3158c37 100644 --- a/package/network/utils/wwan/files/data/19d2-0108 +++ b/package/network/utils/wwan/files/data/19d2-0108 @@ -2,4 +2,4 @@ "desc": "ONDA MT505UP/ZTE", "control": 1, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0116 b/package/network/utils/wwan/files/data/19d2-0116 index bfe9b5d44a..974edf4e34 100644 --- a/package/network/utils/wwan/files/data/19d2-0116 +++ b/package/network/utils/wwan/files/data/19d2-0116 @@ -1,6 +1,6 @@ { "desc": "ZTE MF651", "control": 1, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-0117 b/package/network/utils/wwan/files/data/19d2-0117 index 8610bbf419..0cb57d9b22 100644 --- a/package/network/utils/wwan/files/data/19d2-0117 +++ b/package/network/utils/wwan/files/data/19d2-0117 @@ -2,4 +2,4 @@ "desc": "ZTE MF112", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0128 b/package/network/utils/wwan/files/data/19d2-0128 index 620eb90f05..078932e7b6 100644 --- a/package/network/utils/wwan/files/data/19d2-0128 +++ b/package/network/utils/wwan/files/data/19d2-0128 @@ -2,4 +2,4 @@ "desc": "ZTE MF651", "control": 1, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0142 b/package/network/utils/wwan/files/data/19d2-0142 index 6d19e3e8dd..db865819b5 100644 --- a/package/network/utils/wwan/files/data/19d2-0142 +++ b/package/network/utils/wwan/files/data/19d2-0142 @@ -1,6 +1,6 @@ { "desc": "ZTE MF665C", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-0143 b/package/network/utils/wwan/files/data/19d2-0143 index 6885a9b2e1..4208016e07 100644 --- a/package/network/utils/wwan/files/data/19d2-0143 +++ b/package/network/utils/wwan/files/data/19d2-0143 @@ -1,6 +1,6 @@ { "desc": "ZTE MF190B", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-0152 b/package/network/utils/wwan/files/data/19d2-0152 index 20047be7a9..f5b84eb3a9 100644 --- a/package/network/utils/wwan/files/data/19d2-0152 +++ b/package/network/utils/wwan/files/data/19d2-0152 @@ -2,4 +2,4 @@ "desc": "ZTE AC583", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0170 b/package/network/utils/wwan/files/data/19d2-0170 index d7d6f97a5b..e7eb5aa433 100644 --- a/package/network/utils/wwan/files/data/19d2-0170 +++ b/package/network/utils/wwan/files/data/19d2-0170 @@ -1,6 +1,6 @@ { "desc": "ZTE A371", "control": 0, - "data": 1 -} "generic": 1 + "data": 1, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1003 b/package/network/utils/wwan/files/data/19d2-1003 index a7d0eb5aa1..d91f388cdd 100644 --- a/package/network/utils/wwan/files/data/19d2-1003 +++ b/package/network/utils/wwan/files/data/19d2-1003 @@ -1,6 +1,6 @@ { "desc": "ZTE K3805-Z", "control": 1, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1015 b/package/network/utils/wwan/files/data/19d2-1015 index a5eab00e93..5d3e5a6c23 100644 --- a/package/network/utils/wwan/files/data/19d2-1015 +++ b/package/network/utils/wwan/files/data/19d2-1015 @@ -1,6 +1,6 @@ { "desc": "ZTE K3806-Z", "control": 1, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1172 b/package/network/utils/wwan/files/data/19d2-1172 index 1b4c728f96..7f6805b4b1 100644 --- a/package/network/utils/wwan/files/data/19d2-1172 +++ b/package/network/utils/wwan/files/data/19d2-1172 @@ -1,6 +1,6 @@ { "desc": "ZTE K4510-Z", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1173 b/package/network/utils/wwan/files/data/19d2-1173 index 1b4c728f96..7f6805b4b1 100644 --- a/package/network/utils/wwan/files/data/19d2-1173 +++ b/package/network/utils/wwan/files/data/19d2-1173 @@ -1,6 +1,6 @@ { "desc": "ZTE K4510-Z", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1177 b/package/network/utils/wwan/files/data/19d2-1177 index 3d196af449..b5113e9830 100644 --- a/package/network/utils/wwan/files/data/19d2-1177 +++ b/package/network/utils/wwan/files/data/19d2-1177 @@ -1,6 +1,6 @@ { "desc": "ZTE K3770-Z", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1181 b/package/network/utils/wwan/files/data/19d2-1181 index 5ee7b2f208..bad2bd84a2 100644 --- a/package/network/utils/wwan/files/data/19d2-1181 +++ b/package/network/utils/wwan/files/data/19d2-1181 @@ -1,6 +1,6 @@ { "desc": "ZTE K3772-Z", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1203 b/package/network/utils/wwan/files/data/19d2-1203 index 4502531243..7155ac70bf 100644 --- a/package/network/utils/wwan/files/data/19d2-1203 +++ b/package/network/utils/wwan/files/data/19d2-1203 @@ -1,6 +1,6 @@ { "desc": "ZTE MF691", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1208 b/package/network/utils/wwan/files/data/19d2-1208 index d8bc573a1f..9884b7d48e 100644 --- a/package/network/utils/wwan/files/data/19d2-1208 +++ b/package/network/utils/wwan/files/data/19d2-1208 @@ -1,6 +1,6 @@ { "desc": "ZTE MF192", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1211 b/package/network/utils/wwan/files/data/19d2-1211 index 0df58f0aed..807068fa00 100644 --- a/package/network/utils/wwan/files/data/19d2-1211 +++ b/package/network/utils/wwan/files/data/19d2-1211 @@ -1,6 +1,6 @@ { "desc": "ZTE MF195", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1212 b/package/network/utils/wwan/files/data/19d2-1212 index 0df58f0aed..807068fa00 100644 --- a/package/network/utils/wwan/files/data/19d2-1212 +++ b/package/network/utils/wwan/files/data/19d2-1212 @@ -1,6 +1,6 @@ { "desc": "ZTE MF195", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1217 b/package/network/utils/wwan/files/data/19d2-1217 index d8bc573a1f..9884b7d48e 100644 --- a/package/network/utils/wwan/files/data/19d2-1217 +++ b/package/network/utils/wwan/files/data/19d2-1217 @@ -1,6 +1,6 @@ { "desc": "ZTE MF192", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1218 b/package/network/utils/wwan/files/data/19d2-1218 index d8bc573a1f..9884b7d48e 100644 --- a/package/network/utils/wwan/files/data/19d2-1218 +++ b/package/network/utils/wwan/files/data/19d2-1218 @@ -1,6 +1,6 @@ { "desc": "ZTE MF192", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1220 b/package/network/utils/wwan/files/data/19d2-1220 index d8bc573a1f..9884b7d48e 100644 --- a/package/network/utils/wwan/files/data/19d2-1220 +++ b/package/network/utils/wwan/files/data/19d2-1220 @@ -1,6 +1,6 @@ { "desc": "ZTE MF192", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1222 b/package/network/utils/wwan/files/data/19d2-1222 index d8bc573a1f..9884b7d48e 100644 --- a/package/network/utils/wwan/files/data/19d2-1222 +++ b/package/network/utils/wwan/files/data/19d2-1222 @@ -1,6 +1,6 @@ { "desc": "ZTE MF192", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1512 b/package/network/utils/wwan/files/data/19d2-1512 index 7e4bbf7503..fa2c87dbbc 100644 --- a/package/network/utils/wwan/files/data/19d2-1512 +++ b/package/network/utils/wwan/files/data/19d2-1512 @@ -1,6 +1,6 @@ { "desc": "ZTE MFxxx", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1515 b/package/network/utils/wwan/files/data/19d2-1515 index d8bc573a1f..9884b7d48e 100644 --- a/package/network/utils/wwan/files/data/19d2-1515 +++ b/package/network/utils/wwan/files/data/19d2-1515 @@ -1,6 +1,6 @@ { "desc": "ZTE MF192", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1518 b/package/network/utils/wwan/files/data/19d2-1518 index d8bc573a1f..9884b7d48e 100644 --- a/package/network/utils/wwan/files/data/19d2-1518 +++ b/package/network/utils/wwan/files/data/19d2-1518 @@ -1,6 +1,6 @@ { "desc": "ZTE MF192", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1519 b/package/network/utils/wwan/files/data/19d2-1519 index d8bc573a1f..9884b7d48e 100644 --- a/package/network/utils/wwan/files/data/19d2-1519 +++ b/package/network/utils/wwan/files/data/19d2-1519 @@ -1,6 +1,6 @@ { "desc": "ZTE MF192", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1522 b/package/network/utils/wwan/files/data/19d2-1522 index 4c926f0186..1e19b2c539 100644 --- a/package/network/utils/wwan/files/data/19d2-1522 +++ b/package/network/utils/wwan/files/data/19d2-1522 @@ -1,6 +1,6 @@ { "desc": "ZTE MF652", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1525 b/package/network/utils/wwan/files/data/19d2-1525 index 7a37c432c8..58e392c79f 100644 --- a/package/network/utils/wwan/files/data/19d2-1525 +++ b/package/network/utils/wwan/files/data/19d2-1525 @@ -1,6 +1,6 @@ { "desc": "ZTE MF591", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1527 b/package/network/utils/wwan/files/data/19d2-1527 index 6b46c73d76..c622100106 100644 --- a/package/network/utils/wwan/files/data/19d2-1527 +++ b/package/network/utils/wwan/files/data/19d2-1527 @@ -1,6 +1,6 @@ { "desc": "ZTE MF196", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1537 b/package/network/utils/wwan/files/data/19d2-1537 index a62516407d..b58df7056b 100644 --- a/package/network/utils/wwan/files/data/19d2-1537 +++ b/package/network/utils/wwan/files/data/19d2-1537 @@ -1,6 +1,6 @@ { "desc": "ZTE MF190J", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1538 b/package/network/utils/wwan/files/data/19d2-1538 index a62516407d..b58df7056b 100644 --- a/package/network/utils/wwan/files/data/19d2-1538 +++ b/package/network/utils/wwan/files/data/19d2-1538 @@ -1,6 +1,6 @@ { "desc": "ZTE MF190J", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1544 b/package/network/utils/wwan/files/data/19d2-1544 index a62516407d..b58df7056b 100644 --- a/package/network/utils/wwan/files/data/19d2-1544 +++ b/package/network/utils/wwan/files/data/19d2-1544 @@ -1,6 +1,6 @@ { "desc": "ZTE MF190J", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-2003 b/package/network/utils/wwan/files/data/19d2-2003 index a2a0880862..ae1da49ef7 100644 --- a/package/network/utils/wwan/files/data/19d2-2003 +++ b/package/network/utils/wwan/files/data/19d2-2003 @@ -2,4 +2,4 @@ "desc": "ZTE MF180", "control": 1, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-ffdd b/package/network/utils/wwan/files/data/19d2-ffdd index 71d1050a93..e1220283a5 100644 --- a/package/network/utils/wwan/files/data/19d2-ffdd +++ b/package/network/utils/wwan/files/data/19d2-ffdd @@ -2,4 +2,4 @@ "desc": "ZTE AC682", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-ffe4 b/package/network/utils/wwan/files/data/19d2-ffe4 index 03a16bff54..d561593b74 100644 --- a/package/network/utils/wwan/files/data/19d2-ffe4 +++ b/package/network/utils/wwan/files/data/19d2-ffe4 @@ -1,6 +1,6 @@ { "desc": "ZTE AC3781", "control": 1, - "data": 0 -} "generic": 1 + "data": 0, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-ffe9 b/package/network/utils/wwan/files/data/19d2-ffe9 index 57531e26e7..3fe5f4b882 100644 --- a/package/network/utils/wwan/files/data/19d2-ffe9 +++ b/package/network/utils/wwan/files/data/19d2-ffe9 @@ -2,4 +2,4 @@ "desc": "ZTE AC2738", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-fff1 b/package/network/utils/wwan/files/data/19d2-fff1 index 4347f288a2..adf579ccdf 100644 --- a/package/network/utils/wwan/files/data/19d2-fff1 +++ b/package/network/utils/wwan/files/data/19d2-fff1 @@ -2,4 +2,4 @@ "desc": "ZTE generic", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-fffb b/package/network/utils/wwan/files/data/19d2-fffb index 4ff616a0c0..fb3d59780b 100644 --- a/package/network/utils/wwan/files/data/19d2-fffb +++ b/package/network/utils/wwan/files/data/19d2-fffb @@ -2,4 +2,4 @@ "desc": "ZTE MG880", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-fffc b/package/network/utils/wwan/files/data/19d2-fffc index 4ff616a0c0..fb3d59780b 100644 --- a/package/network/utils/wwan/files/data/19d2-fffc +++ b/package/network/utils/wwan/files/data/19d2-fffc @@ -2,4 +2,4 @@ "desc": "ZTE MG880", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-fffd b/package/network/utils/wwan/files/data/19d2-fffd index 4ff616a0c0..fb3d59780b 100644 --- a/package/network/utils/wwan/files/data/19d2-fffd +++ b/package/network/utils/wwan/files/data/19d2-fffd @@ -2,4 +2,4 @@ "desc": "ZTE MG880", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-fffe b/package/network/utils/wwan/files/data/19d2-fffe index 4e6004981a..faf983243d 100644 --- a/package/network/utils/wwan/files/data/19d2-fffe +++ b/package/network/utils/wwan/files/data/19d2-fffe @@ -2,4 +2,4 @@ "desc": "ZTE AC8700", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-ffff b/package/network/utils/wwan/files/data/19d2-ffff index 747fa238d1..517dbb88a9 100644 --- a/package/network/utils/wwan/files/data/19d2-ffff +++ b/package/network/utils/wwan/files/data/19d2-ffff @@ -2,4 +2,4 @@ "desc": "ZTE AC8710", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1a8d-1002 b/package/network/utils/wwan/files/data/1a8d-1002 index 93388be2fd..bf67e6571b 100644 --- a/package/network/utils/wwan/files/data/1a8d-1002 +++ b/package/network/utils/wwan/files/data/1a8d-1002 @@ -2,4 +2,4 @@ "desc": "Bandrich C-100/C-120", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1a8d-1003 b/package/network/utils/wwan/files/data/1a8d-1003 index 93388be2fd..bf67e6571b 100644 --- a/package/network/utils/wwan/files/data/1a8d-1003 +++ b/package/network/utils/wwan/files/data/1a8d-1003 @@ -2,4 +2,4 @@ "desc": "Bandrich C-100/C-120", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1a8d-1007 b/package/network/utils/wwan/files/data/1a8d-1007 index f013968f94..9e482b133f 100644 --- a/package/network/utils/wwan/files/data/1a8d-1007 +++ b/package/network/utils/wwan/files/data/1a8d-1007 @@ -2,4 +2,4 @@ "desc": "Bandrich C-270", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1a8d-1009 b/package/network/utils/wwan/files/data/1a8d-1009 index 82e4bf03ab..b1838340d6 100644 --- a/package/network/utils/wwan/files/data/1a8d-1009 +++ b/package/network/utils/wwan/files/data/1a8d-1009 @@ -2,4 +2,4 @@ "desc": "Bandrich C-170/C-180", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1a8d-100c b/package/network/utils/wwan/files/data/1a8d-100c index 1acb9eec5f..6f19f1fb3a 100644 --- a/package/network/utils/wwan/files/data/1a8d-100c +++ b/package/network/utils/wwan/files/data/1a8d-100c @@ -2,4 +2,4 @@ "desc": "Bandrich C-320", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1a8d-100d b/package/network/utils/wwan/files/data/1a8d-100d index 67db2b46cc..e96c51a881 100644 --- a/package/network/utils/wwan/files/data/1a8d-100d +++ b/package/network/utils/wwan/files/data/1a8d-100d @@ -2,4 +2,4 @@ "desc": "Bandrich C-508", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1a8d-2006 b/package/network/utils/wwan/files/data/1a8d-2006 index 78f36cef18..8164eed0b3 100644 --- a/package/network/utils/wwan/files/data/1a8d-2006 +++ b/package/network/utils/wwan/files/data/1a8d-2006 @@ -1,6 +1,6 @@ { "desc": "Bandrich C-33x", "control": 0, - "data": 1 -} "acm": 1 + "data": 1, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/1bbb-0000 b/package/network/utils/wwan/files/data/1bbb-0000 index 0be73afa18..5b445a35f6 100644 --- a/package/network/utils/wwan/files/data/1bbb-0000 +++ b/package/network/utils/wwan/files/data/1bbb-0000 @@ -2,4 +2,4 @@ "desc": "Alcatel X060S/X070S/X080S/X200", "control": 2, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1bbb-0012 b/package/network/utils/wwan/files/data/1bbb-0012 index 3eecac0e52..9ba190f2ee 100644 --- a/package/network/utils/wwan/files/data/1bbb-0012 +++ b/package/network/utils/wwan/files/data/1bbb-0012 @@ -1,6 +1,6 @@ { "desc": "Alcatel X085C", "control": 2, - "data": 2 -} "generic": 1 + "data": 2, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/1bbb-0017 b/package/network/utils/wwan/files/data/1bbb-0017 index 853c05c0b1..ad488dde9d 100644 --- a/package/network/utils/wwan/files/data/1bbb-0017 +++ b/package/network/utils/wwan/files/data/1bbb-0017 @@ -2,4 +2,4 @@ "desc": "Alcatel X220L", "control": 4, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1bbb-0052 b/package/network/utils/wwan/files/data/1bbb-0052 index 853c05c0b1..ad488dde9d 100644 --- a/package/network/utils/wwan/files/data/1bbb-0052 +++ b/package/network/utils/wwan/files/data/1bbb-0052 @@ -2,4 +2,4 @@ "desc": "Alcatel X220L", "control": 4, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1bbb-00b7 b/package/network/utils/wwan/files/data/1bbb-00b7 index 9eaffe6609..0fbf6de1af 100644 --- a/package/network/utils/wwan/files/data/1bbb-00b7 +++ b/package/network/utils/wwan/files/data/1bbb-00b7 @@ -2,4 +2,4 @@ "desc": "Alcatel X600", "control": 0, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1bbb-00ca b/package/network/utils/wwan/files/data/1bbb-00ca index 80d71fad54..e40cc863df 100644 --- a/package/network/utils/wwan/files/data/1bbb-00ca +++ b/package/network/utils/wwan/files/data/1bbb-00ca @@ -1,6 +1,6 @@ { "desc": "Alcatel X080C", "control": 0, - "data": 0 -} "generic": 1 + "data": 0, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/1c9e-6060 b/package/network/utils/wwan/files/data/1c9e-6060 index 6f77bb4b97..8786375330 100644 --- a/package/network/utils/wwan/files/data/1c9e-6060 +++ b/package/network/utils/wwan/files/data/1c9e-6060 @@ -1,6 +1,6 @@ { "desc": "Alcatel X020 & X030", "control": 2, - "data": 0 -} "generic": 1 + "data": 0, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/1c9e-6061 b/package/network/utils/wwan/files/data/1c9e-6061 index 6f77bb4b97..8786375330 100644 --- a/package/network/utils/wwan/files/data/1c9e-6061 +++ b/package/network/utils/wwan/files/data/1c9e-6061 @@ -1,6 +1,6 @@ { "desc": "Alcatel X020 & X030", "control": 2, - "data": 0 -} "generic": 1 + "data": 0, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/1c9e-9000 b/package/network/utils/wwan/files/data/1c9e-9000 index 39dcd776ea..28566b3118 100644 --- a/package/network/utils/wwan/files/data/1c9e-9000 +++ b/package/network/utils/wwan/files/data/1c9e-9000 @@ -1,6 +1,6 @@ { "desc": "4G Systems XS Stick W14", "control": 0, - "data": 0 -} "generic": 1 + "data": 0, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/1c9e-9603 b/package/network/utils/wwan/files/data/1c9e-9603 index fd3f099d1b..44f62eb1ab 100644 --- a/package/network/utils/wwan/files/data/1c9e-9603 +++ b/package/network/utils/wwan/files/data/1c9e-9603 @@ -2,4 +2,4 @@ "desc": "4G Systems XS Stick W14", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1c9e-9605 b/package/network/utils/wwan/files/data/1c9e-9605 index c2992c16ea..fafcefdfa2 100644 --- a/package/network/utils/wwan/files/data/1c9e-9605 +++ b/package/network/utils/wwan/files/data/1c9e-9605 @@ -2,4 +2,4 @@ "desc": "4G Systems XS Stick W14", "control": 1, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/1c9e-9607 b/package/network/utils/wwan/files/data/1c9e-9607 index c2992c16ea..fafcefdfa2 100644 --- a/package/network/utils/wwan/files/data/1c9e-9607 +++ b/package/network/utils/wwan/files/data/1c9e-9607 @@ -2,4 +2,4 @@ "desc": "4G Systems XS Stick W14", "control": 1, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/1c9e-9801 b/package/network/utils/wwan/files/data/1c9e-9801 index 40dcc76055..dced60d9d4 100644 --- a/package/network/utils/wwan/files/data/1c9e-9801 +++ b/package/network/utils/wwan/files/data/1c9e-9801 @@ -1,6 +1,6 @@ { "desc": "4G Systems XS Stick W21", "control": 2, - "data": 1 -} "generic": 1 + "data": 1, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/1c9e-9900 b/package/network/utils/wwan/files/data/1c9e-9900 index 42da3abaf1..efbb056f23 100644 --- a/package/network/utils/wwan/files/data/1c9e-9900 +++ b/package/network/utils/wwan/files/data/1c9e-9900 @@ -1,6 +1,6 @@ { "desc": "Softbank C02LC", "control": 1, - "data": 2 -} "generic": 1 + "data": 2, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/1e0e-9000 b/package/network/utils/wwan/files/data/1e0e-9000 index bdb159da1d..5b83213802 100644 --- a/package/network/utils/wwan/files/data/1e0e-9000 +++ b/package/network/utils/wwan/files/data/1e0e-9000 @@ -2,4 +2,4 @@ "desc": "PROLink PHS100, Hyundai MB-810, A-Link 3GU", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1e0e-9100 b/package/network/utils/wwan/files/data/1e0e-9100 index d1b2dda7be..b89257f527 100644 --- a/package/network/utils/wwan/files/data/1e0e-9100 +++ b/package/network/utils/wwan/files/data/1e0e-9100 @@ -2,4 +2,4 @@ "desc": "PROLink PHS300, A-Link 3GU", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1e0e-9200 b/package/network/utils/wwan/files/data/1e0e-9200 index bdb159da1d..5b83213802 100644 --- a/package/network/utils/wwan/files/data/1e0e-9200 +++ b/package/network/utils/wwan/files/data/1e0e-9200 @@ -2,4 +2,4 @@ "desc": "PROLink PHS100, Hyundai MB-810, A-Link 3GU", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1e0e-ce16 b/package/network/utils/wwan/files/data/1e0e-ce16 index 93e0c3fa13..d9088e97c9 100644 --- a/package/network/utils/wwan/files/data/1e0e-ce16 +++ b/package/network/utils/wwan/files/data/1e0e-ce16 @@ -2,4 +2,4 @@ "desc": "D-Link DWM-162-U5, Micromax MMX 300c", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1e0e-cefe b/package/network/utils/wwan/files/data/1e0e-cefe index ebc941dfb1..78d6148597 100644 --- a/package/network/utils/wwan/files/data/1e0e-cefe +++ b/package/network/utils/wwan/files/data/1e0e-cefe @@ -1,6 +1,6 @@ { "desc": "D-Link DWM-162-U5, Micromax MMX 300c", "control": 1, - "data": 2 -} "generic": 1 + "data": 2, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/2001-7d00 b/package/network/utils/wwan/files/data/2001-7d00 index b0cc479125..3b5a3a2e53 100644 --- a/package/network/utils/wwan/files/data/2001-7d00 +++ b/package/network/utils/wwan/files/data/2001-7d00 @@ -1,6 +1,6 @@ { "desc": "D-Link DWM-156 A6", "control": 1, - "data": 0 -} "generic": 1 + "data": 0, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/2001-7d01 b/package/network/utils/wwan/files/data/2001-7d01 index ab8fd9ded7..9f039b12c0 100644 --- a/package/network/utils/wwan/files/data/2001-7d01 +++ b/package/network/utils/wwan/files/data/2001-7d01 @@ -2,4 +2,4 @@ "desc": "D-Link DWM-156 A7", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/2001-7d02 b/package/network/utils/wwan/files/data/2001-7d02 index ab8fd9ded7..9f039b12c0 100644 --- a/package/network/utils/wwan/files/data/2001-7d02 +++ b/package/network/utils/wwan/files/data/2001-7d02 @@ -2,4 +2,4 @@ "desc": "D-Link DWM-156 A7", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/2001-7d03 b/package/network/utils/wwan/files/data/2001-7d03 index ab8fd9ded7..9f039b12c0 100644 --- a/package/network/utils/wwan/files/data/2001-7d03 +++ b/package/network/utils/wwan/files/data/2001-7d03 @@ -2,4 +2,4 @@ "desc": "D-Link DWM-156 A7", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/211f-6801 b/package/network/utils/wwan/files/data/211f-6801 index 06cdddca9e..07f114847d 100644 --- a/package/network/utils/wwan/files/data/211f-6801 +++ b/package/network/utils/wwan/files/data/211f-6801 @@ -2,4 +2,4 @@ "desc": "Celot K-3000/CT-650/CT-680", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8114 b/package/network/utils/wwan/files/data/413c-8114 index a3cb2cd743..c0b7678404 100644 --- a/package/network/utils/wwan/files/data/413c-8114 +++ b/package/network/utils/wwan/files/data/413c-8114 @@ -2,4 +2,4 @@ "desc": "Dell 5700", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8115 b/package/network/utils/wwan/files/data/413c-8115 index af27cbe079..3f99a0bd8e 100644 --- a/package/network/utils/wwan/files/data/413c-8115 +++ b/package/network/utils/wwan/files/data/413c-8115 @@ -2,4 +2,4 @@ "desc": "Dell 5500", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8116 b/package/network/utils/wwan/files/data/413c-8116 index 31b79bf98f..ff18d6a46b 100644 --- a/package/network/utils/wwan/files/data/413c-8116 +++ b/package/network/utils/wwan/files/data/413c-8116 @@ -2,4 +2,4 @@ "desc": "Dell 5505", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8117 b/package/network/utils/wwan/files/data/413c-8117 index a3cb2cd743..c0b7678404 100644 --- a/package/network/utils/wwan/files/data/413c-8117 +++ b/package/network/utils/wwan/files/data/413c-8117 @@ -2,4 +2,4 @@ "desc": "Dell 5700", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8118 b/package/network/utils/wwan/files/data/413c-8118 index b92d415141..0404557c60 100644 --- a/package/network/utils/wwan/files/data/413c-8118 +++ b/package/network/utils/wwan/files/data/413c-8118 @@ -2,4 +2,4 @@ "desc": "Dell 5510", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8128 b/package/network/utils/wwan/files/data/413c-8128 index a3cb2cd743..c0b7678404 100644 --- a/package/network/utils/wwan/files/data/413c-8128 +++ b/package/network/utils/wwan/files/data/413c-8128 @@ -2,4 +2,4 @@ "desc": "Dell 5700", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8129 b/package/network/utils/wwan/files/data/413c-8129 index a3cb2cd743..c0b7678404 100644 --- a/package/network/utils/wwan/files/data/413c-8129 +++ b/package/network/utils/wwan/files/data/413c-8129 @@ -2,4 +2,4 @@ "desc": "Dell 5700", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8133 b/package/network/utils/wwan/files/data/413c-8133 index 4ae84020fe..7940b3399f 100644 --- a/package/network/utils/wwan/files/data/413c-8133 +++ b/package/network/utils/wwan/files/data/413c-8133 @@ -2,4 +2,4 @@ "desc": "Dell 5720", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8134 b/package/network/utils/wwan/files/data/413c-8134 index 4ae84020fe..7940b3399f 100644 --- a/package/network/utils/wwan/files/data/413c-8134 +++ b/package/network/utils/wwan/files/data/413c-8134 @@ -2,4 +2,4 @@ "desc": "Dell 5720", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8135 b/package/network/utils/wwan/files/data/413c-8135 index 4ae84020fe..7940b3399f 100644 --- a/package/network/utils/wwan/files/data/413c-8135 +++ b/package/network/utils/wwan/files/data/413c-8135 @@ -2,4 +2,4 @@ "desc": "Dell 5720", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8136 b/package/network/utils/wwan/files/data/413c-8136 index d2bf508fe9..fffa1e8582 100644 --- a/package/network/utils/wwan/files/data/413c-8136 +++ b/package/network/utils/wwan/files/data/413c-8136 @@ -2,4 +2,4 @@ "desc": "Dell 5520", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8137 b/package/network/utils/wwan/files/data/413c-8137 index d2bf508fe9..fffa1e8582 100644 --- a/package/network/utils/wwan/files/data/413c-8137 +++ b/package/network/utils/wwan/files/data/413c-8137 @@ -2,4 +2,4 @@ "desc": "Dell 5520", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8138 b/package/network/utils/wwan/files/data/413c-8138 index d2bf508fe9..fffa1e8582 100644 --- a/package/network/utils/wwan/files/data/413c-8138 +++ b/package/network/utils/wwan/files/data/413c-8138 @@ -2,4 +2,4 @@ "desc": "Dell 5520", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8147 b/package/network/utils/wwan/files/data/413c-8147 index f0b0638fd5..e9aff093a0 100644 --- a/package/network/utils/wwan/files/data/413c-8147 +++ b/package/network/utils/wwan/files/data/413c-8147 @@ -1,6 +1,6 @@ { "desc": "Dell 5530", "control": 0, - "data": 1 -} "acm": 1 + "data": 1, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/413c-8180 b/package/network/utils/wwan/files/data/413c-8180 index 1ae44053c8..d3ac0d8cd6 100644 --- a/package/network/utils/wwan/files/data/413c-8180 +++ b/package/network/utils/wwan/files/data/413c-8180 @@ -2,4 +2,4 @@ "desc": "Dell 5730", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8181 b/package/network/utils/wwan/files/data/413c-8181 index 1ae44053c8..d3ac0d8cd6 100644 --- a/package/network/utils/wwan/files/data/413c-8181 +++ b/package/network/utils/wwan/files/data/413c-8181 @@ -2,4 +2,4 @@ "desc": "Dell 5730", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8182 b/package/network/utils/wwan/files/data/413c-8182 index 1ae44053c8..d3ac0d8cd6 100644 --- a/package/network/utils/wwan/files/data/413c-8182 +++ b/package/network/utils/wwan/files/data/413c-8182 @@ -2,4 +2,4 @@ "desc": "Dell 5730", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-819b b/package/network/utils/wwan/files/data/413c-819b index e66c3fc4c2..575410bdf4 100644 --- a/package/network/utils/wwan/files/data/413c-819b +++ b/package/network/utils/wwan/files/data/413c-819b @@ -2,4 +2,4 @@ "desc": "Dell 5804", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/xtables-addons/Makefile b/package/network/utils/xtables-addons/Makefile index a1415fc18b..0c12d74643 100644 --- a/package/network/utils/xtables-addons/Makefile +++ b/package/network/utils/xtables-addons/Makefile @@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=xtables-addons -PKG_VERSION:=2.13 +PKG_VERSION:=2.14 PKG_RELEASE:=1 -PKG_HASH:=d141879d438424764e953b97fbb16edafdf8ef6baa57f6e36e07b894a7775dfc +PKG_HASH:=d215a9a8b8e66aae04b982fa2e1228e8a71e7dfe42320df99e34e5000cbdf152 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@SF/xtables-addons @@ -43,8 +43,7 @@ CONFIGURE_ARGS+= \ define Build/Compile +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ DESTDIR="$(PKG_INSTALL_DIR)" \ DEPMOD="/bin/true" \ all @@ -52,8 +51,7 @@ endef define Build/Install $(MAKE) -C $(PKG_BUILD_DIR) \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ DESTDIR="$(PKG_INSTALL_DIR)" \ DEPMOD="/bin/true" \ install diff --git a/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch b/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch index 7599684bdb..a9fb796d09 100644 --- a/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch +++ b/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch @@ -1,5 +1,14 @@ --- a/extensions/LUA/xt_LUA_target.c +++ b/extensions/LUA/xt_LUA_target.c +@@ -19,7 +19,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include "xt_LUA.h" @@ -64,10 +64,10 @@ uint32_t lua_state_refs[LUA_STATE_ARRAY * XT_CONTINUE inside the *register_lua_packet_lib* function. */ diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile index dd54d6b197..e26e39b545 100644 --- a/package/system/fstools/Makefile +++ b/package/system/fstools/Makefile @@ -11,10 +11,10 @@ PKG_NAME:=fstools PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/fstools.git -PKG_SOURCE_DATE:=2017-07-31 -PKG_SOURCE_VERSION:=8ab4fda66a136f5b0f1e5dff9d3649961ffc9158 -PKG_MIRROR_HASH:=f04712fbefbcc2af1da9364310ac6dd771322c3ce2d920d2c003aaea97dbe4b4 +PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git +PKG_SOURCE_DATE:=2018-01-13 +PKG_SOURCE_VERSION:=18090d97b61cc091ed3f49c3ec8ba42c761f1d15 +PKG_MIRROR_HASH:=165c1b19778138910905528ead080413fb741c5dfc191da72979c00d49df6e0d CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 diff --git a/package/system/lede-keyring/Makefile b/package/system/lede-keyring/Makefile index fb5752a54e..d0961b1626 100644 --- a/package/system/lede-keyring/Makefile +++ b/package/system/lede-keyring/Makefile @@ -6,7 +6,7 @@ PKG_NAME:=lede-keyring PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/keyring.git +PKG_SOURCE_URL=$(PROJECT_GIT)/keyring.git PKG_SOURCE_DATE:=2017-01-20 PKG_SOURCE_VERSION:=a50b7529880988ca96e72dede0279ff139a8ab1a PKG_MIRROR_HASH:=811ba79ba71925e949d2c690db7d7b031ac1dd965aa831ca9b6d9d70f5657254 diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile index 499de217cc..f00e574de0 100644 --- a/package/system/opkg/Makefile +++ b/package/system/opkg/Makefile @@ -7,33 +7,26 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -include $(INCLUDE_DIR)/version.mk -include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=opkg -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_FLAGS:=essential PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://git.lede-project.org/project/opkg-lede.git -PKG_SOURCE_DATE:=2017-07-28 -PKG_SOURCE_VERSION:=4bd8601ebd95c130e504cc724b0c5eb163050982 -PKG_MIRROR_HASH:=adb2d610185a83fb630ccd3f0c80cb8acfd89260e0a5e598aadb8c8f0d903cf5 +PKG_SOURCE_URL:=https://git.openwrt.org/project/opkg-lede.git +PKG_SOURCE_DATE:=2017-12-07 +PKG_SOURCE_VERSION:=3b417b9f41b4ceb5912d82f867dd5534e5675b5c +PKG_MIRROR_HASH:=1c9c21e56186345d0034d15051c1d9c5ebb5aa6658d6ae8886d8403207a914a3 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING PKG_MAINTAINER:=Jo-Philipp Wich -PKG_FLAGS := nonshared - -PKG_CONFIG_DEPENDS := \ +# Extend depends from version.mk +PKG_CONFIG_DEPENDS += \ CONFIG_SIGNED_PACKAGES \ - CONFIG_TARGET_INIT_PATH \ - CONFIG_PER_FEED_REPO \ - CONFIG_PER_FEED_REPO_ADD_DISABLED \ - CONFIG_PER_FEED_REPO_ADD_COMMENTED \ - $(foreach feed,$(FEEDS_INSTALLED),CONFIG_FEED_$(feed)) + CONFIG_TARGET_INIT_PATH PKG_BUILD_PARALLEL:=1 HOST_BUILD_PARALLEL:=1 @@ -50,7 +43,7 @@ define Package/opkg CATEGORY:=Base system TITLE:=opkg package manager DEPENDS:=+uclient-fetch +libpthread +libubox - URL:=https://git.lede-project.org/?p=project/opkg-lede.git + URL:=$(PKG_SOURCE_URL) MENU:=1 endef @@ -93,8 +86,6 @@ define Package/opkg/install $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_DATA) ./files/customfeeds.conf $(1)/etc/opkg/customfeeds.conf $(INSTALL_DATA) ./files/opkg$(2).conf $(1)/etc/opkg.conf - $(call FeedSourcesAppend,$(1)/etc/opkg/distfeeds.conf) - $(VERSION_SED) $(1)/etc/opkg/distfeeds.conf $(INSTALL_BIN) ./files/20_migrate-feeds $(1)/etc/uci-defaults/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg ifneq ($(CONFIG_SIGNED_PACKAGES),) diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index 5f2d21c102..d615dd01d1 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=procd -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/procd.git -PKG_SOURCE_DATE:=2017-08-22 -PKG_SOURCE_VERSION:=54b46a351fab736a92221a6f9c750b5f9da499a1 -PKG_MIRROR_HASH:=dcbeea89910bbdf7d6cf20c38892d6c51de375c8b35c372a7106ae17090694f3 +PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git +PKG_SOURCE_DATE:=2018-12-02 +PKG_SOURCE_VERSION:=a5954cf302fe46d8e29770c818336763112b9a6e +PKG_MIRROR_HASH:=1afa1f0160dd8ffac310e75519601c1f9a6107d818f405bb3fe9ef3e7143c2e3 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 @@ -87,9 +87,8 @@ ifdef CONFIG_PACKAGE_procd-ujail CMAKE_OPTIONS += -DJAIL_SUPPORT=1 endif -ifdef CONFIG_PACKAGE_procd-seccomp - CMAKE_OPTIONS += -DSECCOMP_SUPPORT=1 -DUTRACE_SUPPORT=1 -endif +SECCOMP=$(if $(CONFIG_PACKAGE_procd-seccomp),1,0) +CMAKE_OPTIONS += -DSECCOMP_SUPPORT=$(SECCOMP) -DUTRACE_SUPPORT=$(SECCOMP) define Package/procd/install $(INSTALL_DIR) $(1)/sbin $(1)/etc $(1)/lib/functions @@ -110,6 +109,7 @@ define Package/procd-seccomp/install $(INSTALL_DIR) $(1)/sbin $(1)/lib $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-seccomp.so $(1)/lib $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/utrace $(1)/sbin/ + $(LN) utrace $(1)/sbin/seccomp-trace $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-trace.so $(1)/lib endef diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh index c23c37b83f..3c81928bba 100644 --- a/package/system/procd/files/procd.sh +++ b/package/system/procd/files/procd.sh @@ -38,6 +38,12 @@ PROCD_RELOAD_DELAY=1000 _PROCD_SERVICE= +procd_lock() { + local basescript=$(readlink "$initscript") + local service_name="$(basename ${basescript:-$initscript})" + +} + _procd_call() { local old_cb @@ -47,6 +53,7 @@ _procd_call() { } _procd_wrapper() { + procd_lock while [ -n "$1" ]; do eval "$1() { _procd_call _$1 \"\$@\"; }" shift @@ -79,6 +86,9 @@ _procd_close_service() { _procd_open_trigger service_triggers _procd_close_trigger + _procd_open_data + service_data + _procd_close_data _procd_ubus_call ${1:-set} } @@ -134,6 +144,18 @@ _procd_close_trigger() { json_close_array } +_procd_open_data() { + let '_procd_data_open = _procd_data_open + 1' + [ "$_procd_data_open" -gt 1 ] && return + json_add_object "data" +} + +_procd_close_data() { + let '_procd_data_open = _procd_data_open - 1' + [ "$_procd_data_open" -lt 1 ] || return + json_close_object +} + _procd_open_validate() { json_select .. json_add_array "validate" @@ -383,6 +405,10 @@ _procd_send_signal() { local instance="$2" local signal="$3" + case "$signal" in + [A-Z]*) signal="$(kill -l "$signal" 2>/dev/null)" || return 1;; + esac + json_init json_add_string name "$service" [ -n "$instance" -a "$instance" != "*" ] && json_add_string instance "$instance" diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile index d13f20eab4..2dc960e48d 100644 --- a/package/system/rpcd/Makefile +++ b/package/system/rpcd/Makefile @@ -11,11 +11,11 @@ PKG_NAME:=rpcd PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/rpcd.git -PKG_SOURCE_DATE:=2016-12-03 -PKG_SOURCE_VERSION:=0577cfc1acdbaf30c31090e75045ba58d6dd8a78 +PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git +PKG_SOURCE_DATE:=2017-12-07 +PKG_SOURCE_VERSION:=cfe1e75c91bc1bac82e6caab3e652b0ebee59524 PKG_MAINTAINER:=Jo-Philipp Wich -PKG_MIRROR_HASH:=bbcd750df4867a57604e3b922e28f7a019cf940c3586d813d88001dc314e2a1c +PKG_MIRROR_HASH:=4857497c88115defbf6add68a37975ed79e8f992e65d7d0df56cd29288dea379 PKG_LICENSE:=ISC PKG_LICENSE_FILES:= diff --git a/package/system/ubox/Makefile b/package/system/ubox/Makefile index d19f7551ae..299872ed44 100644 --- a/package/system/ubox/Makefile +++ b/package/system/ubox/Makefile @@ -4,10 +4,10 @@ PKG_NAME:=ubox PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/ubox.git -PKG_SOURCE_DATE:=2017-09-01 -PKG_SOURCE_VERSION:=b1bc8d5fb874cdd22701a08d0fb0de4330f86814 -PKG_MIRROR_HASH:=b07e750d941d691e2745aa3a058e504966b15d1db5636162dc686bad275eb296 +PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubox.git +PKG_SOURCE_DATE:=2017-11-06 +PKG_SOURCE_VERSION:=2c0d9cfe05e9712d44622c6bb4558e97359bfb76 +PKG_MIRROR_HASH:=e545a29959a310fd7243ee2e799bf9f759894ea4e872010a781c3a65290377b6 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile index 4f3d4e8309..39854f48f8 100644 --- a/package/system/ubus/Makefile +++ b/package/system/ubus/Makefile @@ -4,10 +4,10 @@ PKG_NAME:=ubus PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/ubus.git -PKG_SOURCE_DATE:=2017-02-18 -PKG_SOURCE_VERSION:=34c6e818e431cc53478a0f7c7c1eca07d194d692 -PKG_MIRROR_HASH:=fc4f1121faa4f5b8fa52ee25460b98b2e60e7d245aefa70e7f76c56ce5628fd5 +PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git +PKG_SOURCE_DATE:=2017-11-13 +PKG_SOURCE_VERSION:=5f87f5480ebf004d735dbf44259d08cf8affd305 +PKG_MIRROR_HASH:=a490348da86c6cdf0cbc8cc01b77fa6f708d86b94674fd312e0c822ca3d7eba0 CMAKE_INSTALL:=1 PKG_LICENSE:=LGPL-2.1 diff --git a/package/system/uci/Makefile b/package/system/uci/Makefile index 4d11ee1b98..d5b4eac4aa 100644 --- a/package/system/uci/Makefile +++ b/package/system/uci/Makefile @@ -11,11 +11,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uci PKG_RELEASE:=1 -PKG_SOURCE_URL=$(LEDE_GIT)/project/uci.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/uci.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE=2017-09-29 -PKG_SOURCE_VERSION:=5ad59ad412a784c5c478e31d1701ce39568ffd58 -PKG_MIRROR_HASH:=0c1c40e8c7e08163a4c8d306ab4b676a9c545028e14aa57b5cf2d6f7bfe726cb +PKG_SOURCE_DATE=2018-01-01 +PKG_SOURCE_VERSION:=5beb95da3dbec6db11a6bdfaab7807ee2daf41e6 +PKG_MIRROR_HASH:=123c5d3ed8f86db76ab52584e952c8e870891bca4dab682b753ca384d7d067bf PKG_LICENSE:=LGPL-2.1 PKG_LICENSE_FILES:= diff --git a/package/system/uci/files/lib/config/uci.sh b/package/system/uci/files/lib/config/uci.sh index 50891a64e4..78ec277669 100644 --- a/package/system/uci/files/lib/config/uci.sh +++ b/package/system/uci/files/lib/config/uci.sh @@ -118,9 +118,10 @@ uci_add() { uci_rename() { local PACKAGE="$1" local CONFIG="$2" - local VALUE="$3" + local OPTION="$3" + local VALUE="$4" - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} rename "$PACKAGE.$CONFIG=$VALUE" + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} rename "$PACKAGE.$CONFIG${VALUE:+.$OPTION}=${VALUE:-$OPTION}" } uci_remove() { diff --git a/package/system/usign/Makefile b/package/system/usign/Makefile index 84adccb4a3..63f9f09953 100644 --- a/package/system/usign/Makefile +++ b/package/system/usign/Makefile @@ -4,7 +4,7 @@ PKG_NAME:=usign PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/usign.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/usign.git PKG_SOURCE_DATE:=2015-07-04 PKG_SOURCE_VERSION:=ef6419142a3b0fbcddcccf536e3c1880302c6f89 PKG_MIRROR_HASH:=9499ed7e40889b364e446a428e185c40986b75087888bd7e1496542457a6dbaa diff --git a/package/utils/adb/Makefile b/package/utils/adb/Makefile index 0861696527..c42c94d3a3 100644 --- a/package/utils/adb/Makefile +++ b/package/utils/adb/Makefile @@ -28,7 +28,7 @@ define Package/adb DEPENDS:=+zlib +libopenssl +libpthread endef -define Package/bridge/description +define Package/adb/description Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device. endef diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in index 79059e5069..afb7d48f8c 100644 --- a/package/utils/busybox/Config-defaults.in +++ b/package/utils/busybox/Config-defaults.in @@ -1089,7 +1089,7 @@ config BUSYBOX_DEFAULT_FEATURE_FIND_MAXDEPTH default y config BUSYBOX_DEFAULT_FEATURE_FIND_NEWER bool - default n + default y config BUSYBOX_DEFAULT_FEATURE_FIND_INUM bool default n @@ -2332,10 +2332,10 @@ config BUSYBOX_DEFAULT_FEATURE_NETSTAT_PRG config BUSYBOX_DEFAULT_NSLOOKUP bool default n -config BUSYBOX_DEFAULT_NSLOOKUP_LEDE +config BUSYBOX_DEFAULT_NSLOOKUP_OPENWRT bool default y -config BUSYBOX_DEFAULT_FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS +config BUSYBOX_DEFAULT_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS bool default n config BUSYBOX_DEFAULT_NTPD diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index 941e828354..8866756aea 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=busybox PKG_VERSION:=1.27.2 -PKG_RELEASE:=1 +PKG_RELEASE:=3 PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 @@ -20,9 +20,11 @@ PKG_HASH:=9d4be516b61e6480f156b11eb42577a13529f75d3383850bb75c50c285de63df PKG_BUILD_DEPENDS:=BUSYBOX_USE_LIBRPC:librpc BUSYBOX_CONFIG_PAM:libpam PKG_BUILD_PARALLEL:=1 PKG_CHECK_FORMAT_SECURITY:=0 +PKG_INSTALL:=1 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=LICENSE archival/libarchive/bz/LICENSE +PKG_CPE_ID:=cpe:/a:busybox:busybox include $(INCLUDE_DIR)/package.mk @@ -30,12 +32,6 @@ ifeq ($(DUMP),) STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell grep '^CONFIG_BUSYBOX_' $(TOPDIR)/.config | mkhash md5) endif -ifneq ($(findstring c,$(OPENWRT_VERBOSE)),) - BB_MAKE_VERBOSE := V=1 -else - BB_MAKE_VERBOSE := -endif - BUSYBOX_SYM=$(if $(CONFIG_BUSYBOX_CUSTOM),CONFIG,DEFAULT) BUSYBOX_IF_ENABLED=$(if $(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_$(1)),$(2)) @@ -47,6 +43,7 @@ define Package/busybox URL:=http://busybox.net/ DEPENDS:=+BUSYBOX_USE_LIBRPC:librpc +BUSYBOX_CONFIG_PAM:libpam +BUSYBOX_CONFIG_NTPD:jsonfilter MENU:=1 + PROVIDES:=ip ALTERNATIVES:=\ $(call BUSYBOX_IF_ENABLED,KILL, 100:/bin/kill:/bin/busybox) \ $(call BUSYBOX_IF_ENABLED,PS, 100:/bin/ps:/bin/busybox) \ @@ -74,59 +71,32 @@ endef # don't create a version string containing the actual timestamp export KCONFIG_NOTIMESTAMP=1 -define Build/Configure - rm -f $(PKG_BUILD_DIR)/.configured* - grep 'CONFIG_BUSYBOX_$(BUSYBOX_SYM)' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_$(BUSYBOX_SYM)_\\(.*\\),\\1CONFIG_\\2,g" > $(PKG_BUILD_DIR)/.config - yes 'n' | $(MAKE) -C $(PKG_BUILD_DIR) \ - CC="$(TARGET_CC)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - KBUILD_HAVE_NLS=no \ - ARCH="$(ARCH)" \ - $(BB_MAKE_VERBOSE) \ - oldconfig -endef LDLIBS:=m crypt +LDLIBS += $(call BUSYBOX_IF_ENABLED,PAM,pam pam_misc pthread) ifdef CONFIG_BUSYBOX_USE_LIBRPC - TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include - export LDFLAGS=$(TARGET_LDFLAGS) LDLIBS += rpc endif - -ifdef CONFIG_BUSYBOX_CONFIG_PAM - TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include - export LDFLAGS=$(TARGET_LDFLAGS) - LDLIBS += pam pam_misc pthread +ifeq ($(CONFIG_USE_GLIBC),y) + LDLIBS += $(call BUSYBOX_IF_ENABLED,NSLOOKUP_OPENWRT,resolv) endif -ifdef CONFIG_BUSYBOX_DEFAULT_NSLOOKUP_LEDE - ifeq ($(CONFIG_USE_GLIBC),y) - LDLIBS += resolv - endif +MAKE_VARS := +MAKE_FLAGS += \ + EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \ + LDLIBS="$(LDLIBS)" \ + SKIP_STRIP=y +ifneq ($(findstring c,$(OPENWRT_VERBOSE)),) + MAKE_FLAGS += V=1 endif -define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - CC="$(TARGET_CC)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - KBUILD_HAVE_NLS=no \ - EXTRA_CFLAGS="$(TARGET_CFLAGS)" \ - ARCH="$(ARCH)" \ - SKIP_STRIP=y \ - LDLIBS="$(LDLIBS)" \ - $(BB_MAKE_VERBOSE) \ - all - rm -rf $(PKG_INSTALL_DIR) - $(FIND) $(PKG_BUILD_DIR) -lname "*busybox" -exec rm \{\} \; - $(MAKE) -C $(PKG_BUILD_DIR) \ - CC="$(TARGET_CC)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - EXTRA_CFLAGS="$(TARGET_CFLAGS)" \ - ARCH="$(ARCH)" \ - CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \ - LDLIBS="$(LDLIBS)" \ - $(BB_MAKE_VERBOSE) \ - install +MAKE_INSTALL_FLAGS += CONFIG_PREFIX="$(PKG_INSTALL_DIR)" + + +define Build/Configure + grep 'CONFIG_BUSYBOX_$(BUSYBOX_SYM)' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_$(BUSYBOX_SYM)_\\(.*\\),\\1CONFIG_\\2,g" > $(PKG_BUILD_DIR)/.config + yes 'n' | $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) oldconfig endef define Package/busybox/install diff --git a/package/utils/busybox/config/networking/Config.in b/package/utils/busybox/config/networking/Config.in index 14875d5e68..2d2a1c4a9e 100644 --- a/package/utils/busybox/config/networking/Config.in +++ b/package/utils/busybox/config/networking/Config.in @@ -700,17 +700,17 @@ config BUSYBOX_CONFIG_NSLOOKUP default BUSYBOX_DEFAULT_NSLOOKUP help nslookup is a tool to query Internet name servers. -config BUSYBOX_CONFIG_NSLOOKUP_LEDE +config BUSYBOX_CONFIG_NSLOOKUP_OPENWRT bool "nslookup_lede" depends on !BUSYBOX_CONFIG_NSLOOKUP - default BUSYBOX_DEFAULT_NSLOOKUP_LEDE + default BUSYBOX_DEFAULT_NSLOOKUP_OPENWRT help - nslookup is a tool to query Internet name servers (LEDE flavor). + nslookup is a tool to query Internet name servers (OpenWrt flavor). -config BUSYBOX_CONFIG_FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS +config BUSYBOX_CONFIG_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS - depends on BUSYBOX_CONFIG_NSLOOKUP_LEDE && BUSYBOX_CONFIG_LONG_OPTS + default BUSYBOX_DEFAULT_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS + depends on BUSYBOX_CONFIG_NSLOOKUP_OPENWRT && BUSYBOX_CONFIG_LONG_OPTS help Support long options for the nslookup applet. config BUSYBOX_CONFIG_NTPD diff --git a/package/utils/busybox/patches/230-add_nslookup_lede.patch b/package/utils/busybox/patches/230-add_nslookup_lede.patch index e394dfb9b9..14c0e87b33 100644 --- a/package/utils/busybox/patches/230-add_nslookup_lede.patch +++ b/package/utils/busybox/patches/230-add_nslookup_lede.patch @@ -53,23 +53,23 @@ Signed-off-by: Jo-Philipp Wich + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + -+//config:config NSLOOKUP_LEDE -+//config: bool "nslookup_lede" ++//config:config NSLOOKUP_OPENWRT ++//config: bool "nslookup_openwrt" +//config: depends on !NSLOOKUP +//config: default y +//config: help +//config: nslookup is a tool to query Internet name servers (LEDE flavor). +//config: -+//config:config FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS ++//config:config FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS +//config: bool "Enable long options" +//config: default y -+//config: depends on NSLOOKUP_LEDE && LONG_OPTS ++//config: depends on NSLOOKUP_OPENWRT && LONG_OPTS +//config: help +//config: Support long options for the nslookup applet. + -+//applet:IF_NSLOOKUP_LEDE(APPLET(nslookup, BB_DIR_USR_BIN, BB_SUID_DROP)) ++//applet:IF_NSLOOKUP_OPENWRT(APPLET(nslookup, BB_DIR_USR_BIN, BB_SUID_DROP)) + -+//kbuild:lib-$(CONFIG_NSLOOKUP_LEDE) += nslookup_lede.o ++//kbuild:lib-$(CONFIG_NSLOOKUP_OPENWRT) += nslookup_lede.o + +//usage:#define nslookup_lede_trivial_usage +//usage: "[HOST] [SERVER]" @@ -753,7 +753,7 @@ Signed-off-by: Jo-Philipp Wich +} + + -+#if ENABLE_FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS ++#if ENABLE_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS +static const char nslookup_longopts[] ALIGN1 = + "type\0" Required_argument "q" + "querytype\0" Required_argument "q" @@ -778,7 +778,7 @@ Signed-off-by: Jo-Philipp Wich + unsigned int types = 0; + HEADER *header; + -+#if ENABLE_FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS ++#if ENABLE_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS + applet_long_options = nslookup_longopts; +#endif + diff --git a/package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch b/package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch index 7fa06a68c7..3741e25c3f 100644 --- a/package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch +++ b/package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch @@ -1,7 +1,7 @@ --- a/networking/traceroute.c +++ b/networking/traceroute.c -@@ -239,8 +239,8 @@ - //config: Add option -I to use ICMP ECHO instead of UDP datagrams. +@@ -237,8 +237,8 @@ + //config: depends on TRACEROUTE || TRACEROUTE6 /* Needs socket(AF_INET, SOCK_RAW, IPPROTO_ICMP), therefore BB_SUID_MAYBE: */ -//applet:IF_TRACEROUTE(APPLET(traceroute, BB_DIR_USR_BIN, BB_SUID_MAYBE)) diff --git a/package/utils/busybox/patches/600-cve-2017-16544.patch b/package/utils/busybox/patches/600-cve-2017-16544.patch new file mode 100644 index 0000000000..3b142bdd64 --- /dev/null +++ b/package/utils/busybox/patches/600-cve-2017-16544.patch @@ -0,0 +1,35 @@ +From c3797d40a1c57352192c6106cc0f435e7d9c11e8 Mon Sep 17 00:00:00 2001 +From: Denys Vlasenko +Date: Tue, 7 Nov 2017 18:09:29 +0100 +Subject: lineedit: do not tab-complete any strings which have control + characters + +function old new delta +add_match 41 68 +27 + +Signed-off-by: Denys Vlasenko +--- + libbb/lineedit.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/libbb/lineedit.c ++++ b/libbb/lineedit.c +@@ -633,6 +633,18 @@ static void free_tab_completion_data(voi + + static void add_match(char *matched) + { ++ unsigned char *p = (unsigned char*)matched; ++ while (*p) { ++ /* ESC attack fix: drop any string with control chars */ ++ if (*p < ' ' ++ || (!ENABLE_UNICODE_SUPPORT && *p >= 0x7f) ++ || (ENABLE_UNICODE_SUPPORT && *p == 0x7f) ++ ) { ++ free(matched); ++ return; ++ } ++ p++; ++ } + matches = xrealloc_vector(matches, 4, num_matches); + matches[num_matches] = matched; + num_matches++; diff --git a/package/utils/bzip2/Makefile b/package/utils/bzip2/Makefile index 62c255a907..4c8b360de8 100644 --- a/package/utils/bzip2/Makefile +++ b/package/utils/bzip2/Makefile @@ -18,6 +18,7 @@ PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=BZIP2 PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:bzip:bzip2 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk diff --git a/package/utils/ct-bugcheck/src/bugcheck.sh b/package/utils/ct-bugcheck/src/bugcheck.sh index 85f70c5e79..389e10ccf4 100755 --- a/package/utils/ct-bugcheck/src/bugcheck.sh +++ b/package/utils/ct-bugcheck/src/bugcheck.sh @@ -11,7 +11,7 @@ FOUND_BUG=0 bugcheck_generic() { - echo "LEDE crashlog report" > $CRASHDIR/info.txt + echo "OpenWrt crashlog report" > $CRASHDIR/info.txt date >> $CRASHDIR/info.txt echo >> $CRASHDIR/info.txt echo "uname" >> $CRASHDIR/info.txt diff --git a/package/utils/e2fsprogs/Makefile b/package/utils/e2fsprogs/Makefile index b10ba8a862..068ce3edec 100644 --- a/package/utils/e2fsprogs/Makefile +++ b/package/utils/e2fsprogs/Makefile @@ -8,13 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=e2fsprogs -PKG_VERSION:=1.43.5 -PKG_HASH:=261f3d9ade383fbf032a19140c9c25e998cc0f71a1ae686614fb3ae0eb955a17 +PKG_VERSION:=1.43.7 +PKG_HASH:=2a6367289047d68d9ba6a46cf89ab9a1efd0556cde02a51ebaf414ff51edded9 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/ PKG_LICENSE:=GPL-2.0 +PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs PKG_BUILD_DEPENDS:=util-linux PKG_INSTALL:=1 @@ -45,7 +46,7 @@ define Package/libext2fs $(call Package/e2fsprogs/Default) SECTION:=libs CATEGORY:=Libraries - DEPENDS:=+libuuid + DEPENDS:=+libuuid +libblkid TITLE:=ext2/3/4 filesystem library endef @@ -109,18 +110,17 @@ endef TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections -CONFIGURE_VARS += \ - ac_cv_lib_pthread_sem_init=no - CONFIGURE_ARGS += \ --disable-testio-debug \ --enable-elf-shlibs \ --disable-libuuid \ - --enable-libblkid \ + --disable-libblkid \ --disable-uuidd \ --disable-tls \ --disable-nls \ - --disable-rpath + --disable-rpath \ + --disable-threads \ + --disable-fuse2fs define Build/Prepare $(call Build/Prepare/Default) @@ -139,7 +139,6 @@ define Build/Compile LDFLAGS=-Wl,--gc-sections \ BUILDCC="$(HOSTCC)" \ DESTDIR="$(PKG_INSTALL_DIR)" \ - LIBBLKID="$(PKG_BUILD_DIR)/lib/libblkid.a -luuid" \ ELF_OTHER_LIBS="$(TARGET_LDFLAGS) -luuid" \ SYSLIBS="$(TARGET_LDFLAGS) -ldl -L$(PKG_BUILD_DIR)/lib/ -l:libcom_err.so.0.0" \ V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1,) \ diff --git a/package/utils/f2fs-tools/Makefile b/package/utils/f2fs-tools/Makefile index 8a27c47adf..3e8bf63f08 100644 --- a/package/utils/f2fs-tools/Makefile +++ b/package/utils/f2fs-tools/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=f2fs-tools -PKG_VERSION:=1.8.0 -PKG_RELEASE:=3 +PKG_VERSION:=1.9.0 +PKG_RELEASE:=1 PKG_LICENSE:=GPLv2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/ -PKG_HASH:=d4dbecf55560c548bf0758c9f641d1beec1e960b38cbbc19951195d5144d39ae +PKG_HASH:=77217562ae7011a6d81b7b3c43c42623db1796a57596408d6c8037def70d6cc7 PKG_FIXUP:=autoreconf PKG_BUILD_PARALLEL:=1 @@ -57,7 +57,8 @@ define Package/libf2fs endef CONFIGURE_ARGS += \ - --without-selinux + --without-selinux \ + --without-blkid CONFIGURE_VARS += \ ac_cv_file__git=no diff --git a/package/utils/f2fs-tools/patches/100-f2fs-WARNING-at-fs-f2fs-segment.c-718-update_sit_ent.patch b/package/utils/f2fs-tools/patches/100-f2fs-WARNING-at-fs-f2fs-segment.c-718-update_sit_ent.patch deleted file mode 100644 index d4e25397a3..0000000000 --- a/package/utils/f2fs-tools/patches/100-f2fs-WARNING-at-fs-f2fs-segment.c-718-update_sit_ent.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 31873d5cdf8a97d5f7921451c54f6d293293c6cc Mon Sep 17 00:00:00 2001 -From: Jaegeuk Kim -Date: Wed, 23 Aug 2017 13:33:00 -0700 -Subject: [PATCH] mkfs.f2fs: fix missing cpu_to_le64 for checkpoint version - -The error on mips was reported by Stijn as follow. - -Commit 8399a29df92d6867d226df362edbf2e0efa527c1 in f2fs-tools -("mkfs.f2fs: give random checkpoint version") causes a bug when mounting -a filesystem created with it on a MIPS64 device running a 4.4(.83) -kernel. The following kernel warning appears several times per second, -for 30 seconds: - -[ 23.837262] ------------[ cut here ]------------ -[ 23.842039] WARNING: CPU: 0 PID: 935 at fs/f2fs/segment.c:718 -update_sit_entry+0x1c0/0x2b0() -[ 23.850507] Modules linked in: pppoe ppp_async l2tp_ppp iptable_nat -[ 24.174064] Call Trace: -[ 24.176527] [] show_stack+0x68/0xb4 -[ 24.181595] [] dump_stack+0x8c/0xc4 -[ 24.186660] [] warn_slowpath_common+0xa0/0xd0 -[ 24.192597] [] update_sit_entry+0x1c0/0x2b0 -[ 24.198353] [] refresh_sit_entry+0x70/0xf8 -[ 24.204022] [] allocate_data_block+0x1f0/0x310 -[ 24.210038] [] do_write_page+0x29c/0x2bc -[ 24.215532] [] write_data_page+0xa0/0xd8 -[ 24.221028] [] do_write_data_page+0xe4/0x384 -[ 24.226870] [] f2fs_write_data_page+0x208/0x464 -[ 24.232972] [] __f2fs_writepage+0x1c/0x74 -[ 24.238553] [] -f2fs_write_cache_pages.constprop.7+0x250/0x394 -[ 24.245869] [] f2fs_write_data_pages+0x130/0x1b0 -[ 24.252066] [] __filemap_fdatawrite_range+0xa0/0xd4 -[ 24.258515] [] sync_dirty_dir_inodes+0x94/0xd8 -[ 24.264530] [] write_checkpoint+0x108/0xb9c -[ 24.270283] [] f2fs_sync_fs+0x68/0xb0 -[ 24.275526] [] f2fs_sync_file+0x2e8/0x518 -[ 24.281107] [] do_fsync+0x38/0x70 -[ 24.285992] [] SyS_fsync+0x14/0x20 -[ 24.290972] [] syscall_common+0x34/0x58 -[ 24.296372] -[ 24.298096] ---[ end trace fd3ac44449b218ab ]--- - -Fix: 8399a29df92d68 ("mkfs.f2fs: give random checkpoint version") -Reported-And-Tested-by: Stijn Tintel -Signed-off-by: Jaegeuk Kim ---- - mkfs/f2fs_format.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c -index 92876b8..b379e80 100644 ---- a/mkfs/f2fs_format.c -+++ b/mkfs/f2fs_format.c -@@ -546,7 +546,7 @@ static int f2fs_write_check_point_pack(void) - } - - /* 1. cp page 1 of checkpoint pack 1 */ -- cp->checkpoint_ver = rand() | 0x1; -+ cp->checkpoint_ver = cpu_to_le64(rand() | 0x1); - set_cp(cur_node_segno[0], c.cur_seg[CURSEG_HOT_NODE]); - set_cp(cur_node_segno[1], c.cur_seg[CURSEG_WARM_NODE]); - set_cp(cur_node_segno[2], c.cur_seg[CURSEG_COLD_NODE]); --- -2.13.5 - diff --git a/package/utils/fuse/Makefile b/package/utils/fuse/Makefile index d0cefff1ad..e853a8e041 100644 --- a/package/utils/fuse/Makefile +++ b/package/utils/fuse/Makefile @@ -18,6 +18,7 @@ PKG_HASH:=832432d1ad4f833c20e13b57cf40ce5277a9d33e483205fc63c78111b3358874 PKG_LICENSE:=LGPLv2.1 GPLv2 PKG_LICENSE_FILES:=COPYING.LIB COPYING +PKG_CPE_ID:=cpe:/a:fuse_project:fuse PKG_INSTALL:=1 diff --git a/package/utils/jsonfilter/Makefile b/package/utils/jsonfilter/Makefile index b70928ba53..32be1adb94 100644 --- a/package/utils/jsonfilter/Makefile +++ b/package/utils/jsonfilter/Makefile @@ -4,7 +4,7 @@ PKG_NAME:=jsonfilter PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/jsonpath.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/jsonpath.git PKG_SOURCE_DATE:=2016-07-02 PKG_SOURCE_VERSION:=dea067ad67d977c247c300c06676a06adf21e0c7 PKG_MIRROR_HASH:=6c0e30da3f0c82527f9b5285d7c6ae61406732f2b0543b93131fe115ffc2987a diff --git a/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch b/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch index 74b8c6f8f0..ac0722c707 100644 --- a/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch +++ b/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch @@ -62,7 +62,7 @@ return (t == LUA_TNONE) ? "no value" : luaT_typenames[t]; } -@@ -264,6 +265,14 @@ LUA_API int lua_isnumber (lua_State *L, +@@ -264,6 +265,14 @@ LUA_API int lua_isnumber (lua_State *L, } @@ -77,7 +77,7 @@ LUA_API int lua_isstring (lua_State *L, int idx) { int t = lua_type(L, idx); return (t == LUA_TSTRING || t == LUA_TNUMBER); -@@ -309,31 +318,66 @@ LUA_API int lua_lessthan (lua_State *L, +@@ -309,31 +318,66 @@ LUA_API int lua_lessthan (lua_State *L, } @@ -162,7 +162,7 @@ case LUA_TNUMBER: { size_t l; lua_lock(L); /* `luaV_tostring' may create a new string */ -@@ -426,6 +471,8 @@ LUA_API void lua_pushnil (lua_State *L) +@@ -426,6 +471,8 @@ LUA_API void lua_pushnil (lua_State *L) } @@ -196,7 +196,7 @@ LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len) { -@@ -569,7 +626,7 @@ LUA_API void lua_rawgeti (lua_State *L, +@@ -569,7 +626,7 @@ LUA_API void lua_rawgeti (lua_State *L, lua_lock(L); o = index2adr(L, idx); api_check(L, ttistable(o)); @@ -205,7 +205,7 @@ api_incr_top(L); lua_unlock(L); } -@@ -597,6 +654,9 @@ LUA_API int lua_getmetatable (lua_State +@@ -597,6 +654,9 @@ LUA_API int lua_getmetatable (lua_State case LUA_TUSERDATA: mt = uvalue(obj)->metatable; break; @@ -215,7 +215,7 @@ default: mt = G(L)->mt[ttype(obj)]; break; -@@ -687,7 +747,7 @@ LUA_API void lua_rawseti (lua_State *L, +@@ -687,7 +747,7 @@ LUA_API void lua_rawseti (lua_State *L, api_checknelems(L, 1); o = index2adr(L, idx); api_check(L, ttistable(o)); @@ -224,7 +224,7 @@ luaC_barriert(L, hvalue(o), L->top-1); L->top--; lua_unlock(L); -@@ -721,7 +781,7 @@ LUA_API int lua_setmetatable (lua_State +@@ -721,7 +781,7 @@ LUA_API int lua_setmetatable (lua_State break; } default: { @@ -286,7 +286,7 @@ #define FREELIST_REF 0 /* free list of references */ -@@ -66,7 +66,7 @@ LUALIB_API int luaL_typerror (lua_State +@@ -66,7 +66,7 @@ LUALIB_API int luaL_typerror (lua_State static void tag_error (lua_State *L, int narg, int tag) { @@ -351,7 +351,7 @@ -@@ -54,20 +56,25 @@ static int luaB_tonumber (lua_State *L) +@@ -54,20 +56,25 @@ static int luaB_tonumber (lua_State *L) int base = luaL_optint(L, 2, 10); if (base == 10) { /* standard conversion */ luaL_checkany(L, 1); @@ -503,7 +503,7 @@ case VKNUM: case VTRUE: case VFALSE: -@@ -451,6 +489,10 @@ int luaK_exp2RK (FuncState *fs, expdesc +@@ -451,6 +489,10 @@ int luaK_exp2RK (FuncState *fs, expdesc if (fs->nk <= MAXINDEXRK) { /* constant fit in RK operand? */ e->u.s.info = (e->k == VNIL) ? nilK(fs) : (e->k == VKNUM) ? luaK_numberK(fs, e->u.nval) : @@ -896,7 +896,7 @@ lua_assert(isdigit(ls->current)); do { save_and_next(ls); -@@ -202,8 +215,9 @@ static void read_numeral (LexState *ls, +@@ -202,8 +215,9 @@ static void read_numeral (LexState *ls, save_and_next(ls); save(ls, '\0'); buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */ @@ -1009,6 +1009,7 @@ -#define PI (3.14159265358979323846) -#define RADIANS_PER_DEGREE (PI/180.0) - +- +#ifdef LNUM_FLOAT +# define PI (3.14159265358979323846F) +#elif defined(M_PI) @@ -1017,7 +1018,7 @@ +# define PI (3.14159265358979323846264338327950288) +#endif +#define RADIANS_PER_DEGREE (PI/180) - ++ +#undef HUGE +#ifdef LNUM_FLOAT +# define HUGE HUGE_VALF @@ -2103,7 +2104,7 @@ case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2); /* boolean true must be 1 !! */ case LUA_TLIGHTUSERDATA: -@@ -86,21 +106,6 @@ int luaO_rawequalObj (const TValue *t1, +@@ -86,21 +106,6 @@ int luaO_rawequalObj (const TValue *t1, } } @@ -2606,7 +2607,7 @@ nums[ceillog2(k)]++; /* count as such */ return 1; } -@@ -308,7 +322,7 @@ static void resize (lua_State *L, Table +@@ -308,7 +322,7 @@ static void resize (lua_State *L, Table /* re-insert elements from vanishing slice */ for (i=nasize; iarray[i])) @@ -2650,7 +2651,7 @@ } while (n); return luaO_nilobject; } -@@ -470,14 +487,12 @@ const TValue *luaH_get (Table *t, const +@@ -470,14 +487,12 @@ const TValue *luaH_get (Table *t, const switch (ttype(key)) { case LUA_TNIL: return luaO_nilobject; case LUA_TSTRING: return luaH_getstr(t, rawtsvalue(key)); @@ -3061,7 +3062,7 @@ /* @@ LUAI_USER_ALIGNMENT_T is a type that requires maximum alignment. ** CHANGE it if your system requires alignments larger than double. (For -@@ -728,28 +652,6 @@ union luai_Cast { double l_d; long l_l; +@@ -728,28 +652,6 @@ union luai_Cast { double l_d; long l_l; #define luai_userstateyield(L,n) ((void)L) @@ -3092,7 +3093,7 @@ /* --- a/src/lundump.c +++ b/src/lundump.c -@@ -73,6 +73,13 @@ static lua_Number LoadNumber(LoadState* +@@ -73,6 +73,13 @@ static lua_Number LoadNumber(LoadState* return x; } @@ -3106,7 +3107,7 @@ static TString* LoadString(LoadState* S) { size_t size; -@@ -119,6 +126,9 @@ static void LoadConstants(LoadState* S, +@@ -119,6 +126,9 @@ static void LoadConstants(LoadState* S, case LUA_TNUMBER: setnvalue(o,LoadNumber(S)); break; @@ -3198,7 +3199,7 @@ setsvalue2s(L, obj, luaS_new(L, s)); return 1; } -@@ -222,59 +234,127 @@ static int l_strcmp (const TString *ls, +@@ -222,59 +234,127 @@ static int l_strcmp (const TString *ls, } @@ -3421,10 +3422,10 @@ + case TM_POW: if (try_powint( ri, ib, ic)) return; break; + case TM_UNM: if (try_unmint( ri, ib)) return; break; + default: lua_assert(0); -+ } + } + } + /* Fallback to floating point, when leaving range. */ -+ + +#ifdef LNUM_COMPLEX + if ((nvalue_img(b)!=0) || (nvalue_img(c)!=0)) { + lua_Complex r; @@ -3444,7 +3445,7 @@ + default: lua_assert(0); r=0; + } + setnvalue_complex( ra, r ); - } ++ } + return; + } +#endif @@ -3465,7 +3466,7 @@ + if (!call_binTM(L, rb, rc, ra, op)) + luaG_aritherror(L, rb, rc); +} - ++ +/* Helper macro to sort arithmetic operations into four categories: + * TK_INT: integer - integer operands + * TK_NUMBER: number - number (non complex, either may be integer) diff --git a/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch b/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch index 937fc137e8..3d3d6850e2 100644 --- a/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch +++ b/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch @@ -1,6 +1,6 @@ --- a/src/lvm.c +++ b/src/lvm.c -@@ -284,7 +284,8 @@ int luaV_lessthan (lua_State *L, const T +@@ -281,7 +281,8 @@ int luaV_lessthan (lua_State *L, const T else return luai_numlt( nvalue_fast(l), cast_num(ivalue(r)) ); @@ -10,7 +10,7 @@ return res; return luaG_ordererror(L, l, r); -@@ -322,7 +323,8 @@ static int lessequal (lua_State *L, cons +@@ -319,7 +320,8 @@ static int lessequal (lua_State *L, cons else return luai_numle( nvalue_fast(l), cast_num(ivalue(r)) ); diff --git a/package/utils/lua/patches/020-shared_liblua.patch b/package/utils/lua/patches/020-shared_liblua.patch index bcd410f690..64f683ddbe 100644 --- a/package/utils/lua/patches/020-shared_liblua.patch +++ b/package/utils/lua/patches/020-shared_liblua.patch @@ -21,7 +21,7 @@ ranlib: --- a/src/ldo.h +++ b/src/ldo.h -@@ -46,7 +46,7 @@ LUAI_FUNC int luaD_pcall (lua_State *L, +@@ -46,7 +46,7 @@ LUAI_FUNC int luaD_pcall (lua_State *L, LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult); LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize); LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize); diff --git a/package/utils/lua/patches/050-honor-cflags.patch b/package/utils/lua/patches/050-honor-cflags.patch index dd65791482..d221c4ee9e 100644 --- a/package/utils/lua/patches/050-honor-cflags.patch +++ b/package/utils/lua/patches/050-honor-cflags.patch @@ -8,4 +8,4 @@ + $(CC) -o $@.$(PKG_VERSION) -Wl,-Bsymbolic-functions $(MYLDFLAGS) -shared -Wl,-soname="$@.$(PKG_VERSION)" $? ln -fs $@.$(PKG_VERSION) $@ - + $(LUA_T): $(LUA_O) $(LUA_SO) diff --git a/package/utils/lua/patches/300-opcode_performance.patch b/package/utils/lua/patches/300-opcode_performance.patch index 5fbb87388a..b971e0975c 100644 --- a/package/utils/lua/patches/300-opcode_performance.patch +++ b/package/utils/lua/patches/300-opcode_performance.patch @@ -10,7 +10,7 @@ /* * If 'obj' is a string, it is tried to be interpreted as a number. -@@ -566,12 +569,63 @@ static inline int arith_mode( const TVal +@@ -568,12 +571,63 @@ static inline int arith_mode( const TVal ARITH_OP1_END #endif @@ -74,7 +74,7 @@ reentry: /* entry point */ lua_assert(isLua(L->ci)); pc = L->savedpc; -@@ -596,33 +650,33 @@ void luaV_execute (lua_State *L, int nex +@@ -598,33 +652,33 @@ void luaV_execute (lua_State *L, int nex lua_assert(base == L->base && L->base == L->ci->base); lua_assert(base <= L->top && L->top <= L->stack + L->stacksize); lua_assert(L->top == L->ci->top || luaG_checkopenop(i)); @@ -115,7 +115,7 @@ TValue g; TValue *rb = KBx(i); sethvalue(L, &g, cl->env); -@@ -630,88 +684,88 @@ void luaV_execute (lua_State *L, int nex +@@ -632,88 +686,88 @@ void luaV_execute (lua_State *L, int nex Protect(luaV_gettable(L, &g, rb, ra)); continue; } @@ -219,7 +219,7 @@ const TValue *rb = RB(i); switch (ttype(rb)) { case LUA_TTABLE: { -@@ -731,18 +785,18 @@ void luaV_execute (lua_State *L, int nex +@@ -733,18 +787,18 @@ void luaV_execute (lua_State *L, int nex } continue; } @@ -241,7 +241,7 @@ TValue *rb = RKB(i); TValue *rc = RKC(i); Protect( -@@ -752,7 +806,7 @@ void luaV_execute (lua_State *L, int nex +@@ -754,7 +808,7 @@ void luaV_execute (lua_State *L, int nex pc++; continue; } @@ -250,7 +250,7 @@ Protect( if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i)) dojump(L, pc, GETARG_sBx(*pc)); -@@ -760,7 +814,7 @@ void luaV_execute (lua_State *L, int nex +@@ -762,7 +816,7 @@ void luaV_execute (lua_State *L, int nex pc++; continue; } @@ -259,7 +259,7 @@ Protect( if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i)) dojump(L, pc, GETARG_sBx(*pc)); -@@ -768,13 +822,13 @@ void luaV_execute (lua_State *L, int nex +@@ -770,13 +824,13 @@ void luaV_execute (lua_State *L, int nex pc++; continue; } @@ -275,7 +275,7 @@ TValue *rb = RB(i); if (l_isfalse(rb) != GETARG_C(i)) { setobjs2s(L, ra, rb); -@@ -783,7 +837,7 @@ void luaV_execute (lua_State *L, int nex +@@ -785,7 +839,7 @@ void luaV_execute (lua_State *L, int nex pc++; continue; } @@ -284,7 +284,7 @@ int b = GETARG_B(i); int nresults = GETARG_C(i) - 1; if (b != 0) L->top = ra+b; /* else previous instruction set top */ -@@ -804,7 +858,7 @@ void luaV_execute (lua_State *L, int nex +@@ -806,7 +860,7 @@ void luaV_execute (lua_State *L, int nex } } } @@ -293,7 +293,7 @@ int b = GETARG_B(i); if (b != 0) L->top = ra+b; /* else previous instruction set top */ L->savedpc = pc; -@@ -836,7 +890,7 @@ void luaV_execute (lua_State *L, int nex +@@ -838,7 +892,7 @@ void luaV_execute (lua_State *L, int nex } } } @@ -302,7 +302,7 @@ int b = GETARG_B(i); if (b != 0) L->top = ra+b-1; if (L->openupval) luaF_close(L, base); -@@ -851,7 +905,7 @@ void luaV_execute (lua_State *L, int nex +@@ -853,7 +907,7 @@ void luaV_execute (lua_State *L, int nex goto reentry; } } @@ -311,7 +311,7 @@ /* If start,step and limit are all integers, we don't need to check * against overflow in the looping. */ -@@ -879,7 +933,7 @@ void luaV_execute (lua_State *L, int nex +@@ -881,7 +935,7 @@ void luaV_execute (lua_State *L, int nex } continue; } @@ -320,7 +320,7 @@ const TValue *init = ra; const TValue *plimit = ra+1; const TValue *pstep = ra+2; -@@ -902,7 +956,7 @@ void luaV_execute (lua_State *L, int nex +@@ -904,7 +958,7 @@ void luaV_execute (lua_State *L, int nex dojump(L, pc, GETARG_sBx(i)); continue; } @@ -329,7 +329,7 @@ StkId cb = ra + 3; /* call base */ setobjs2s(L, cb+2, ra+2); setobjs2s(L, cb+1, ra+1); -@@ -918,7 +972,7 @@ void luaV_execute (lua_State *L, int nex +@@ -920,7 +974,7 @@ void luaV_execute (lua_State *L, int nex pc++; continue; } @@ -338,7 +338,7 @@ int n = GETARG_B(i); int c = GETARG_C(i); int last; -@@ -940,11 +994,11 @@ void luaV_execute (lua_State *L, int nex +@@ -942,11 +996,11 @@ void luaV_execute (lua_State *L, int nex } continue; } @@ -352,7 +352,7 @@ Proto *p; Closure *ncl; int nup, j; -@@ -964,7 +1018,7 @@ void luaV_execute (lua_State *L, int nex +@@ -966,7 +1020,7 @@ void luaV_execute (lua_State *L, int nex Protect(luaC_checkGC(L)); continue; } diff --git a/package/utils/mdadm/Makefile b/package/utils/mdadm/Makefile index 1ed62d8174..2b44db284f 100644 --- a/package/utils/mdadm/Makefile +++ b/package/utils/mdadm/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mdadm PKG_VERSION:=4.0 -PKG_RELEASE:=2 +PKG_RELEASE:=4 PKG_SOURCE_URL:=@KERNEL/linux/utils/raid/mdadm PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz @@ -32,26 +32,29 @@ endef define Package/mdadm/description A tool for managing Linux Software RAID arrays. - RAID 0, 1 and 10 support included. - If you need RAID 4,5 or 6 functionality please + RAID 0, 1 and 10 support included. + If you need RAID 4,5 or 6 functionality please install kmod-md-raid456 . endef define Package/mdadm/conffiles -/etc/mdadm.conf /etc/config/mdadm endef -TARGET_CFLAGS += -ffunction-sections -fdata-sections -DNO_COROSYNC -DNO_DLM -DUSE_PTHREADS +TARGET_CFLAGS += \ + -ffunction-sections -fdata-sections \ + -DHAVE_STDINT_H -DNO_COROSYNC -DNO_DLM -DUSE_PTHREADS \ + -DCONFFILE='\"/var/etc/mdadm.conf\"' \ + -DMAP_DIR='\"/var/run/mdadm\"' \ + -DMDMON_DIR='\"/var/run/mdadm\"' \ + -DFAILED_SLOTS_DIR='\"/var/run/mdadm/failed-slots\"' + TARGET_LDFLAGS += -Wl,--gc-sections +MAKE_VARS += CHECK_RUN_DIR=0 + define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - CC="$(TARGET_CC)" \ - CFLAGS="$(TARGET_CFLAGS) -DHAVE_STDINT_H" \ - LDFLAGS="$(TARGET_LDFLAGS)" \ - CHECK_RUN_DIR=0 \ - mdadm + $(call Build/Compile/Default,mdadm) endef define Package/mdadm/install diff --git a/package/utils/mdadm/files/mdadm.init b/package/utils/mdadm/files/mdadm.init index e6624a776e..64a50b35de 100644 --- a/package/utils/mdadm/files/mdadm.init +++ b/package/utils/mdadm/files/mdadm.init @@ -34,14 +34,13 @@ mdadm_common() { local cfg="$1" local email devices - if [ -x /sbin/sendmail ]; then - append_option email "$cfg" email "MAILADDR" - + if [ -x /usr/sbin/sendmail ]; then + config_get email "$cfg" email + [ -n "$email" ] && printf "MAILADDR %s\n" "$email" >> $CONF fi - append_option devices "$cfg" devices DEVICE " " - - printf "%s\n%s\n" "$email" "$devices" >> $CONF + config_list_foreach "$cfg" devices append_list_item devices " " + [ -n "$devices" ] && printf "DEVICE %s\n" "$devices" >> $CONF } mdadm_array() { diff --git a/package/utils/nvram/src/nvram.c b/package/utils/nvram/src/nvram.c index ca89392107..d5e12ee69a 100644 --- a/package/utils/nvram/src/nvram.c +++ b/package/utils/nvram/src/nvram.c @@ -47,6 +47,8 @@ static void _nvram_free(nvram_handle_t *h) for (i = 0; i < NVRAM_ARRAYSIZE(h->nvram_hash); i++) { for (t = h->nvram_hash[i]; t; t = next) { next = t->next; + if (t->value) + free(t->value); free(t); } h->nvram_hash[i] = NULL; @@ -55,6 +57,8 @@ static void _nvram_free(nvram_handle_t *h) /* Free dead table */ for (t = h->nvram_dead; t; t = next) { next = t->next; + if (t->value) + free(t->value); free(t); } diff --git a/package/utils/otrx/src/otrx.c b/package/utils/otrx/src/otrx.c index 101a31004d..223e032f2b 100644 --- a/package/utils/otrx/src/otrx.c +++ b/package/utils/otrx/src/otrx.c @@ -1,7 +1,7 @@ /* * otrx * - * Copyright (C) 2015 Rafał Miłecki + * Copyright (C) 2015-2017 Rafał Miłecki * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -124,9 +124,7 @@ static const uint32_t crc32_tbl[] = { 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, }; -uint32_t otrx_crc32(uint8_t *buf, size_t len) { - uint32_t crc = 0xffffffff; - +uint32_t otrx_crc32(uint32_t crc, uint8_t *buf, size_t len) { while (len) { crc = crc32_tbl[(crc ^ *buf) & 0xff] ^ (crc >> 8); buf++; @@ -158,7 +156,6 @@ static int otrx_check(int argc, char **argv) { size_t bytes, length; uint8_t buf[1024]; uint32_t crc32; - int i; int err = 0; if (argc < 3) { @@ -203,8 +200,7 @@ static int otrx_check(int argc, char **argv) { fseek(trx, trx_offset + TRX_FLAGS_OFFSET, SEEK_SET); length -= TRX_FLAGS_OFFSET; while ((bytes = fread(buf, 1, otrx_min(sizeof(buf), length), trx)) > 0) { - for (i = 0; i < bytes; i++) - crc32 = crc32_tbl[(crc32 ^ buf[i]) & 0xff] ^ (crc32 >> 8); + crc32 = otrx_crc32(crc32, buf, bytes); length -= bytes; } @@ -232,14 +228,11 @@ out: * Create **************************************************/ -static void otrx_create_parse_options(int argc, char **argv) { -} - static ssize_t otrx_create_append_file(FILE *trx, const char *in_path) { FILE *in; size_t bytes; ssize_t length = 0; - uint8_t buf[128]; + uint8_t buf[1024]; in = fopen(in_path, "r"); if (!in) { @@ -271,9 +264,12 @@ static ssize_t otrx_create_append_zeros(FILE *trx, size_t length) { if (fwrite(buf, 1, length, trx) != length) { fprintf(stderr, "Couldn't write %zu B to %s\n", length, trx_path); + free(buf); return -EIO; } + free(buf); + return length; } @@ -288,7 +284,7 @@ static ssize_t otrx_create_align(FILE *trx, size_t curr_offset, size_t alignment static int otrx_create_write_hdr(FILE *trx, struct trx_header *hdr) { size_t bytes, length; - uint8_t *buf; + uint8_t buf[1024]; uint32_t crc32; hdr->magic = cpu_to_le32(TRX_MAGIC); @@ -303,20 +299,13 @@ static int otrx_create_write_hdr(FILE *trx, struct trx_header *hdr) { length = le32_to_cpu(hdr->length); - buf = malloc(length); - if (!buf) { - fprintf(stderr, "Couldn't alloc %zu B buffer\n", length); - return -ENOMEM; + crc32 = 0xffffffff; + fseek(trx, TRX_FLAGS_OFFSET, SEEK_SET); + length -= TRX_FLAGS_OFFSET; + while ((bytes = fread(buf, 1, otrx_min(sizeof(buf), length), trx)) > 0) { + crc32 = otrx_crc32(crc32, buf, bytes); + length -= bytes; } - - fseek(trx, 0, SEEK_SET); - bytes = fread(buf, 1, length, trx); - if (bytes != length) { - fprintf(stderr, "Couldn't read %zu B of data from %s\n", length, trx_path); - return -ENOMEM; - } - - crc32 = otrx_crc32(buf + TRX_FLAGS_OFFSET, length - TRX_FLAGS_OFFSET); hdr->crc32 = cpu_to_le32(crc32); fseek(trx, 0, SEEK_SET); @@ -345,9 +334,6 @@ static int otrx_create(int argc, char **argv) { } trx_path = argv[2]; - optind = 3; - otrx_create_parse_options(argc, argv); - trx = fopen(trx_path, "w+"); if (!trx) { fprintf(stderr, "Couldn't open %s\n", trx_path); @@ -357,7 +343,7 @@ static int otrx_create(int argc, char **argv) { fseek(trx, curr_offset, SEEK_SET); optind = 3; - while ((c = getopt(argc, argv, "f:b:")) != -1) { + while ((c = getopt(argc, argv, "f:A:a:b:")) != -1) { switch (c) { case 'f': if (curr_idx >= TRX_MAX_PARTS) { @@ -381,6 +367,27 @@ static int otrx_create(int argc, char **argv) { curr_offset += sbytes; break; + case 'A': + sbytes = otrx_create_append_file(trx, optarg); + if (sbytes < 0) { + fprintf(stderr, "Failed to append file %s\n", optarg); + } else { + curr_offset += sbytes; + } + + sbytes = otrx_create_align(trx, curr_offset, 4); + if (sbytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + curr_offset += sbytes; + break; + case 'a': + sbytes = otrx_create_align(trx, curr_offset, strtol(optarg, NULL, 0)); + if (sbytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + curr_offset += sbytes; + break; case 'b': sbytes = strtol(optarg, NULL, 0) - curr_offset; if (sbytes < 0) { @@ -398,6 +405,12 @@ static int otrx_create(int argc, char **argv) { break; } + sbytes = otrx_create_align(trx, curr_offset, 0x1000); + if (sbytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + curr_offset += sbytes; + hdr.length = curr_offset; otrx_create_write_hdr(trx, &hdr); err_close: @@ -552,6 +565,8 @@ static void usage() { printf("Creating new TRX file:\n"); printf("\totrx create [options] [partitions]\n"); printf("\t-f file\t\t\t\t[partition] start new partition with content copied from file\n"); + printf("\t-A file\t\t\t\t[partition] append current partition with content copied from file\n"); + printf("\t-a alignment\t\t\t[partition] align current partition\n"); printf("\t-b offset\t\t\t[partition] append zeros to partition till reaching absolute offset\n"); printf("\n"); printf("Extracting from TRX file:\n"); diff --git a/package/utils/ugps/Makefile b/package/utils/ugps/Makefile index 1dad863fd8..3a972f54df 100644 --- a/package/utils/ugps/Makefile +++ b/package/utils/ugps/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ugps PKG_RELEASE:=3 -PKG_SOURCE_URL=$(LEDE_GIT)/project/ugps.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/ugps.git PKG_SOURCE_PROTO:=git PKG_SOURCE_DATE:=2017-02-11 PKG_SOURCE_VERSION:=c30055a685bca1e81ccc8f4bd3bb08d780a7d762 diff --git a/package/utils/usbmode/Makefile b/package/utils/usbmode/Makefile index 1b1ef147b6..e229c791c0 100644 --- a/package/utils/usbmode/Makefile +++ b/package/utils/usbmode/Makefile @@ -4,10 +4,10 @@ PKG_NAME:=usbmode PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/usbmode.git -PKG_SOURCE_DATE:=2017-05-24 -PKG_SOURCE_VERSION:=453da8e540b1c53d357b897d6c70372cd4633390 -PKG_MIRROR_HASH:=b4a7132b940192f2e9a74bd890bd7008ede701e1d52284c3ade0cdc7d663929f +PKG_SOURCE_URL=$(PROJECT_GIT)/project/usbmode.git +PKG_SOURCE_DATE:=2017-12-19 +PKG_SOURCE_VERSION:=f40f84c27534159066c94dadc0c08e0b255c3e26 +PKG_MIRROR_HASH:=840c7ee2843102b09d8943a20820025251cc259385e2b0bde6b7c8cce8190f83 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 diff --git a/package/utils/usbutils/Makefile b/package/utils/usbutils/Makefile index 29b1f85e14..7f798954ae 100644 --- a/package/utils/usbutils/Makefile +++ b/package/utils/usbutils/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=usbutils PKG_VERSION:=007 -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/usb/usbutils @@ -32,13 +32,13 @@ define Package/usbutils URL:=http://www.linux-usb.org/ endef -USB_IDS_REV:=ae25707c751fff79148328229a76fc44232abeae +USB_IDS_REV:=0a6be488b4c1485d30c9efee1cc895af5d4a1383 USB_IDS_FILE:=usb.ids.$(USB_IDS_REV) define Download/usb_ids FILE:=$(USB_IDS_FILE) URL_FILE:=usb.ids - URL:=@GITHUB/gentoo/hwids/ae25707c751fff79148328229a76fc44232abeae - HASH:=eca5d4b4b2c72e61d5d6d67b5dc6f75e92b4ac9cf9cdf1344f06622e0f57d82f + URL:=@GITHUB/gentoo/hwids/$(USB_IDS_REV) + HASH:=2d0403ffccc0ff7150e32c0bf8e2878816b76ba08d2c3bb1059f33627a3da30f endef $(eval $(call Download,usb_ids)) diff --git a/package/utils/util-linux/Makefile b/package/utils/util-linux/Makefile index 9ab5bfa6f8..88cb314776 100644 --- a/package/utils/util-linux/Makefile +++ b/package/utils/util-linux/Makefile @@ -8,12 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=util-linux -PKG_VERSION:=2.30.1 -PKG_RELEASE:=2 +PKG_VERSION:=2.30.2 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.30 -PKG_HASH:=1be4363a91ac428c9e43fc04dc6d2c66a19ec1e36f1105bd4b481540be13b841 +PKG_HASH:=7b5be5489e9b5b7177832836467aba1c87bf0e9bcbcb5a6f35d76cd4782589dc +PKG_CPE_ID:=cpe:/a:kernel:util-linux PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:= COPYING \ diff --git a/package/utils/util-linux/patches/100-use_urandom.patch b/package/utils/util-linux/patches/100-use_urandom.patch new file mode 100644 index 0000000000..848f2f40c2 --- /dev/null +++ b/package/utils/util-linux/patches/100-use_urandom.patch @@ -0,0 +1,14 @@ +--- a/lib/randutils.c ++++ b/lib/randutils.c +@@ -25,6 +25,11 @@ + #define THREAD_LOCAL static + #endif + ++/* force /dev/urandom to avoid hanging on early boot */ ++#undef HAVE_GETRANDOM ++#undef SYS_getrandom ++#undef __NR_getrandom ++ + #ifdef HAVE_GETRANDOM + # include + #elif defined (__linux__) diff --git a/package/utils/xfsprogs/Makefile b/package/utils/xfsprogs/Makefile index 486ded72d5..5cf1da240f 100644 --- a/package/utils/xfsprogs/Makefile +++ b/package/utils/xfsprogs/Makefile @@ -8,6 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xfsprogs +PKG_CPE_ID:=cpe:/a:sgi:xfsprogs PKG_RELEASE:=1 PKG_VERSION:=4.11.0 PKG_SOURCE_URL:=@KERNEL/linux/utils/fs/xfs/xfsprogs diff --git a/rules.mk b/rules.mk index ed796a5402..3558f2f028 100644 --- a/rules.mk +++ b/rules.mk @@ -21,6 +21,7 @@ DUMP:=1 endif export TMP_DIR:=$(TOPDIR)/tmp +export TMPDIR:=$(TMP_DIR) qstrip=$(strip $(subst ",,$(1))) #")) diff --git a/scripts/brcmImage.pl b/scripts/brcmImage.pl index aab86d6d91..60a59f2bf5 100755 --- a/scripts/brcmImage.pl +++ b/scripts/brcmImage.pl @@ -33,7 +33,7 @@ use Compress::Zlib; my $version = "0.1"; my %arg = ( o => 'bcm963xx_fs_kernel', - b => 'LEDE', + b => 'OpenWrt', c => '6348', s => 64, f => 0xbfc00000, diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 05fd772c91..5224ea49c3 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -174,7 +174,7 @@ if ($tree) { } if (!defined $root) { - print "Must be run from the top-level dir. of a LEDE tree\n"; + print "Must be run from the top-level dir. of a OpenWrt tree\n"; exit(2); } } diff --git a/scripts/combined-ext-image.sh b/scripts/combined-ext-image.sh index 0c7b1d993d..7ff287bde7 100755 --- a/scripts/combined-ext-image.sh +++ b/scripts/combined-ext-image.sh @@ -22,6 +22,8 @@ ## version history # * version 1: initial file format with num files / name / length / md5 checksum +set -e + ME="${0##*/}" usage() { @@ -38,7 +40,21 @@ IMG_OUT=$1; shift FILE_NUM=$(($# / 2)) FILES="" -printf "CE%02x%-32s%02x" $CE_VERSION "$IMG_TYPE" $FILE_NUM > $IMG_OUT +tmpdir="$( mktemp -d 2> /dev/null )" +if [ -z "$tmpdir" ]; then + # try OSX signature + tmpdir="$( mktemp -t 'ubitmp' -d )" +fi + +if [ -z "$tmpdir" ]; then + exit 1 +fi + +trap "rm -rf $tmpdir" EXIT + +IMG_TMP_OUT="${tmpdir}/out" + +printf "CE%02x%-32s%02x" $CE_VERSION "$IMG_TYPE" $FILE_NUM > "${IMG_TMP_OUT}" while [ "$#" -gt 1 ] do @@ -48,14 +64,15 @@ while [ "$#" -gt 1 ] [ ! -f "$file" ] && echo "$ME: Not a valid file: $file" && usage FILES="$FILES $file" md5=$(mkhash md5 "$file") - printf "%-32s%08x%32s" "$filename" $(stat -c "%s" "$file") "${md5%% *}" >> $IMG_OUT + printf "%-32s%08x%32s" "$filename" $(stat -c "%s" "$file") "${md5%% *}" >> "${IMG_TMP_OUT}" shift 2 done [ "$#" -eq 1 ] && echo "$ME: Filename not specified: $1" && usage -mv $IMG_OUT $IMG_OUT.tmp -dd if="$IMG_OUT.tmp" of="$IMG_OUT" bs=65536 conv=sync 2>/dev/null -rm $IMG_OUT.tmp +mv "${IMG_TMP_OUT}" "${IMG_TMP_OUT}".tmp +dd if="${IMG_TMP_OUT}.tmp" of="${IMG_TMP_OUT}" bs=65536 conv=sync 2>/dev/null +rm "${IMG_TMP_OUT}".tmp -cat $FILES >> $IMG_OUT +cat $FILES >> "${IMG_TMP_OUT}" +cp "${IMG_TMP_OUT}" "${IMG_OUT}" diff --git a/scripts/config/.gitignore b/scripts/config/.gitignore index 0326e060bb..1206e50229 100644 --- a/scripts/config/.gitignore +++ b/scripts/config/.gitignore @@ -7,3 +7,9 @@ mconf* !mconf*.h mconf_check *.*.c +qconf* +qconf*.moc +!qconf*.cc +!qconf*.h +!images*.c +.tmp_qtcheck diff --git a/scripts/config/Makefile b/scripts/config/Makefile index 3de98082b5..9620273202 100644 --- a/scripts/config/Makefile +++ b/scripts/config/Makefile @@ -7,6 +7,8 @@ # conf: Used for defconfig, oldconfig and related targets # mconf: Used for the mconfig target. # Utilizes the lxdialog package +# qconf: Used for the xconfig target +# Based on Qt which needs to be installed to compile it # object files used by all kconfig flavours @@ -16,20 +18,35 @@ check_lxdialog = $(shell $(SHELL) $(CURDIR)/lxdialog/check-lxdialog.sh -$(1)) export CFLAGS += -DKBUILD_NO_NLS -I. $(call check_lxdialog,ccflags) +export CXXFLAGS += -DKBUILD_NO_NLS + +DISTRO-PKG-CONFIG := $(shell which -a pkg-config | grep -E '\/usr' | head -n 1) conf-objs := conf.o zconf.tab.o mconf-objs := mconf.o zconf.tab.o +qconf-cxxobjs := qconf.o +qconf-objs := zconf.tab.o + lxdialog-objs := \ lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o \ lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o clean-files := zconf.tab.c lex.zconf.c zconf.hash.c +# Remove qconf junk files +clean-files += $(qconf-cxxobjs) qconf.moc .tmp_qtcheck all: conf mconf conf: $(conf-objs) mconf: $(mconf-objs) $(lxdialog-objs) $(CC) -o $@ $^ $(call check_lxdialog,ldflags $(CC)) +qconf: $(qconf-cxxobjs) $(qconf-objs) +ifneq ($(DISTRO-PKG-CONFIG),) + $(CXX) $(HOSTLOADLIBES_qconf) -o $@ $^ +else + echo "You don't have 'pkg-config' installed. Cannot continue" + echo "For now, you may use 'make menuconfig' instead of 'make xconfig'" +endif clean: rm -f *.o lxdialog/*.o $(clean-files) conf mconf @@ -50,3 +67,43 @@ zconf.hash.c: zconf.gperf %.hash.c: %.gperf cp $@_shipped $@ || gperf < $< > $@ + +ifeq ($(MAKECMDGOALS),qconf) +qconf.o: .tmp_qtcheck +.tmp_qtcheck: Makefile +-include .tmp_qtcheck + +# Qt needs some extra effort... +.tmp_qtcheck: + @set -e; echo " CHECK qt"; \ + if $(DISTRO-PKG-CONFIG) --exists Qt5Core; then \ + cflags="-std=c++11 -fPIC `$(DISTRO-PKG-CONFIG) --cflags Qt5Core Qt5Gui Qt5Widgets`"; \ + libs=`$(DISTRO-PKG-CONFIG) --libs Qt5Core Qt5Gui Qt5Widgets`; \ + moc=`$(DISTRO-PKG-CONFIG) --variable=host_bins Qt5Core`/moc; \ + elif $(DISTRO-PKG-CONFIG) --exists QtCore; then \ + cflags=`$(DISTRO-PKG-CONFIG) --cflags QtCore QtGui`; \ + libs=`$(DISTRO-PKG-CONFIG) --libs QtCore QtGui`; \ + moc=`$(DISTRO-PKG-CONFIG) --variable=moc_location QtCore`; \ + else \ + echo >&2 "*"; \ + echo >&2 "* Could not find Qt via $(DISTRO-PKG-CONFIG)."; \ + echo >&2 "* Please install either Qt 4.8 or 5.x. and make sure it's in PKG_CONFIG_PATH"; \ + echo >&2 "*"; \ + exit 1; \ + fi; \ + echo "KC_QT_CFLAGS=$$cflags" > $@; \ + echo "KC_QT_LIBS=$$libs" >> $@; \ + echo "KC_QT_MOC=$$moc" >> $@ +endif + +#Define compiler flags to build qconf +HOSTLOADLIBES_qconf = $(KC_QT_LIBS) +HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) + +qconf.o: qconf.moc +qconf.o: CXXFLAGS+=$(HOSTCXXFLAGS_qconf.o) + +moc = $(KC_QT_MOC) -i $< -o $@ + +%.moc: %.h .tmp_qtcheck + $(call moc) diff --git a/scripts/config/images.c b/scripts/config/images.c new file mode 100644 index 0000000000..d4f84bd4a9 --- /dev/null +++ b/scripts/config/images.c @@ -0,0 +1,326 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +static const char *xpm_load[] = { +"22 22 5 1", +". c None", +"# c #000000", +"c c #838100", +"a c #ffff00", +"b c #ffffff", +"......................", +"......................", +"......................", +"............####....#.", +"...........#....##.##.", +"..................###.", +".................####.", +".####...........#####.", +"#abab##########.......", +"#babababababab#.......", +"#ababababababa#.......", +"#babababababab#.......", +"#ababab###############", +"#babab##cccccccccccc##", +"#abab##cccccccccccc##.", +"#bab##cccccccccccc##..", +"#ab##cccccccccccc##...", +"#b##cccccccccccc##....", +"###cccccccccccc##.....", +"##cccccccccccc##......", +"###############.......", +"......................"}; + +static const char *xpm_save[] = { +"22 22 5 1", +". c None", +"# c #000000", +"a c #838100", +"b c #c5c2c5", +"c c #cdb6d5", +"......................", +".####################.", +".#aa#bbbbbbbbbbbb#bb#.", +".#aa#bbbbbbbbbbbb#bb#.", +".#aa#bbbbbbbbbcbb####.", +".#aa#bbbccbbbbbbb#aa#.", +".#aa#bbbccbbbbbbb#aa#.", +".#aa#bbbbbbbbbbbb#aa#.", +".#aa#bbbbbbbbbbbb#aa#.", +".#aa#bbbbbbbbbbbb#aa#.", +".#aa#bbbbbbbbbbbb#aa#.", +".#aaa############aaa#.", +".#aaaaaaaaaaaaaaaaaa#.", +".#aaaaaaaaaaaaaaaaaa#.", +".#aaa#############aa#.", +".#aaa#########bbb#aa#.", +".#aaa#########bbb#aa#.", +".#aaa#########bbb#aa#.", +".#aaa#########bbb#aa#.", +".#aaa#########bbb#aa#.", +"..##################..", +"......................"}; + +static const char *xpm_back[] = { +"22 22 3 1", +". c None", +"# c #000083", +"a c #838183", +"......................", +"......................", +"......................", +"......................", +"......................", +"...........######a....", +"..#......##########...", +"..##...####......##a..", +"..###.###.........##..", +"..######..........##..", +"..#####...........##..", +"..######..........##..", +"..#######.........##..", +"..########.......##a..", +"...............a###...", +"...............###....", +"......................", +"......................", +"......................", +"......................", +"......................", +"......................"}; + +static const char *xpm_tree_view[] = { +"22 22 2 1", +". c None", +"# c #000000", +"......................", +"......................", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......########........", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......########........", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......########........", +"......................", +"......................"}; + +static const char *xpm_single_view[] = { +"22 22 2 1", +". c None", +"# c #000000", +"......................", +"......................", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"......................", +"......................"}; + +static const char *xpm_split_view[] = { +"22 22 2 1", +". c None", +"# c #000000", +"......................", +"......................", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......................", +"......................"}; + +static const char *xpm_symbol_no[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" .......... ", +" "}; + +static const char *xpm_symbol_mod[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . . ", +" . .. . ", +" . .... . ", +" . .... . ", +" . .. . ", +" . . ", +" . . ", +" .......... ", +" "}; + +static const char *xpm_symbol_yes[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . . ", +" . . . ", +" . .. . ", +" . . .. . ", +" . .... . ", +" . .. . ", +" . . ", +" .......... ", +" "}; + +static const char *xpm_choice_no[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .... ", +" .. .. ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" .. .. ", +" .... ", +" "}; + +static const char *xpm_choice_yes[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .... ", +" .. .. ", +" . . ", +" . .. . ", +" . .... . ", +" . .... . ", +" . .. . ", +" . . ", +" .. .. ", +" .... ", +" "}; + +static const char *xpm_menu[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . .. . ", +" . .... . ", +" . ...... . ", +" . ...... . ", +" . .... . ", +" . .. . ", +" . . ", +" .......... ", +" "}; + +static const char *xpm_menu_inv[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" .......... ", +" .. ...... ", +" .. .... ", +" .. .. ", +" .. .. ", +" .. .... ", +" .. ...... ", +" .......... ", +" .......... ", +" "}; + +static const char *xpm_menuback[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . .. . ", +" . .... . ", +" . ...... . ", +" . ...... . ", +" . .... . ", +" . .. . ", +" . . ", +" .......... ", +" "}; + +static const char *xpm_void[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/scripts/config/mconf.c b/scripts/config/mconf.c index c366e21fba..540fa911e1 100644 --- a/scripts/config/mconf.c +++ b/scripts/config/mconf.c @@ -25,7 +25,7 @@ static const char mconf_readme[] = N_( "Overview\n" "--------\n" -"Some LEDE features may be built directly into the image.\n" +"Some OpenWrt features may be built directly into the image.\n" "Some may be made into installable ipkg packages. Some features\n" "may be completely removed altogether.\n" "\n" diff --git a/scripts/config/qconf.cc b/scripts/config/qconf.cc new file mode 100644 index 0000000000..fc55559922 --- /dev/null +++ b/scripts/config/qconf.cc @@ -0,0 +1,1870 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Copyright (C) 2015 Boris Barbulovski + * Released under the terms of the GNU GPL v2.0. + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "lkc.h" +#include "qconf.h" + +#include "qconf.moc" +#include "images.c" + +#ifdef _ +# undef _ +# define _ qgettext +#endif + +static QApplication *configApp; +static ConfigSettings *configSettings; + +QAction *ConfigMainWindow::saveAction; + +static inline QString qgettext(const char* str) +{ + return QString::fromLocal8Bit(gettext(str)); +} + +static inline QString qgettext(const QString& str) +{ + return QString::fromLocal8Bit(gettext(str.toLatin1())); +} + +ConfigSettings::ConfigSettings() + : QSettings("kernel.org", "qconf") +{ +} + +/** + * Reads a list of integer values from the application settings. + */ +QList ConfigSettings::readSizes(const QString& key, bool *ok) +{ + QList result; + QStringList entryList = value(key).toStringList(); + QStringList::Iterator it; + + for (it = entryList.begin(); it != entryList.end(); ++it) + result.push_back((*it).toInt()); + + return result; +} + +/** + * Writes a list of integer values to the application settings. + */ +bool ConfigSettings::writeSizes(const QString& key, const QList& value) +{ + QStringList stringList; + QList::ConstIterator it; + + for (it = value.begin(); it != value.end(); ++it) + stringList.push_back(QString::number(*it)); + setValue(key, stringList); + + return true; +} + + +/* + * set the new data + * TODO check the value + */ +void ConfigItem::okRename(int col) +{ +} + +/* + * update the displayed of a menu entry + */ +void ConfigItem::updateMenu(void) +{ + ConfigList* list; + struct symbol* sym; + struct property *prop; + QString prompt; + int type; + tristate expr; + + list = listView(); + if (goParent) { + setPixmap(promptColIdx, list->menuBackPix); + prompt = ".."; + goto set_prompt; + } + + sym = menu->sym; + prop = menu->prompt; + prompt = _(menu_get_prompt(menu)); + + if (prop) switch (prop->type) { + case P_MENU: + if (list->mode == singleMode || list->mode == symbolMode) { + /* a menuconfig entry is displayed differently + * depending whether it's at the view root or a child. + */ + if (sym && list->rootEntry == menu) + break; + setPixmap(promptColIdx, list->menuPix); + } else { + if (sym) + break; + setPixmap(promptColIdx, QIcon()); + } + goto set_prompt; + case P_COMMENT: + setPixmap(promptColIdx, QIcon()); + goto set_prompt; + default: + ; + } + if (!sym) + goto set_prompt; + + setText(nameColIdx, QString::fromLocal8Bit(sym->name)); + + type = sym_get_type(sym); + switch (type) { + case S_BOOLEAN: + case S_TRISTATE: + char ch; + + if (!sym_is_changable(sym) && list->optMode == normalOpt) { + setPixmap(promptColIdx, QIcon()); + setText(noColIdx, QString::null); + setText(modColIdx, QString::null); + setText(yesColIdx, QString::null); + break; + } + expr = sym_get_tristate_value(sym); + switch (expr) { + case yes: + if (sym_is_choice_value(sym) && type == S_BOOLEAN) + setPixmap(promptColIdx, list->choiceYesPix); + else + setPixmap(promptColIdx, list->symbolYesPix); + setText(yesColIdx, "Y"); + ch = 'Y'; + break; + case mod: + setPixmap(promptColIdx, list->symbolModPix); + setText(modColIdx, "M"); + ch = 'M'; + break; + default: + if (sym_is_choice_value(sym) && type == S_BOOLEAN) + setPixmap(promptColIdx, list->choiceNoPix); + else + setPixmap(promptColIdx, list->symbolNoPix); + setText(noColIdx, "N"); + ch = 'N'; + break; + } + if (expr != no) + setText(noColIdx, sym_tristate_within_range(sym, no) ? "_" : 0); + if (expr != mod) + setText(modColIdx, sym_tristate_within_range(sym, mod) ? "_" : 0); + if (expr != yes) + setText(yesColIdx, sym_tristate_within_range(sym, yes) ? "_" : 0); + + setText(dataColIdx, QChar(ch)); + break; + case S_INT: + case S_HEX: + case S_STRING: + const char* data; + + data = sym_get_string_value(sym); + + setText(dataColIdx, data); + if (type == S_STRING) + prompt = QString("%1: %2").arg(prompt).arg(data); + else + prompt = QString("(%2) %1").arg(prompt).arg(data); + break; + } + if (!sym_has_value(sym) && visible) + prompt += _(" (NEW)"); +set_prompt: + setText(promptColIdx, prompt); +} + +void ConfigItem::testUpdateMenu(bool v) +{ + ConfigItem* i; + + visible = v; + if (!menu) + return; + + sym_calc_value(menu->sym); + if (menu->flags & MENU_CHANGED) { + /* the menu entry changed, so update all list items */ + menu->flags &= ~MENU_CHANGED; + for (i = (ConfigItem*)menu->data; i; i = i->nextItem) + i->updateMenu(); + } else if (listView()->updateAll) + updateMenu(); +} + + +/* + * construct a menu entry + */ +void ConfigItem::init(void) +{ + if (menu) { + ConfigList* list = listView(); + nextItem = (ConfigItem*)menu->data; + menu->data = this; + + if (list->mode != fullMode) + setExpanded(true); + sym_calc_value(menu->sym); + } + updateMenu(); +} + +/* + * destruct a menu entry + */ +ConfigItem::~ConfigItem(void) +{ + if (menu) { + ConfigItem** ip = (ConfigItem**)&menu->data; + for (; *ip; ip = &(*ip)->nextItem) { + if (*ip == this) { + *ip = nextItem; + break; + } + } + } +} + +ConfigLineEdit::ConfigLineEdit(ConfigView* parent) + : Parent(parent) +{ + connect(this, SIGNAL(editingFinished()), SLOT(hide())); +} + +void ConfigLineEdit::show(ConfigItem* i) +{ + item = i; + if (sym_get_string_value(item->menu->sym)) + setText(QString::fromLocal8Bit(sym_get_string_value(item->menu->sym))); + else + setText(QString::null); + Parent::show(); + setFocus(); +} + +void ConfigLineEdit::keyPressEvent(QKeyEvent* e) +{ + switch (e->key()) { + case Qt::Key_Escape: + break; + case Qt::Key_Return: + case Qt::Key_Enter: + sym_set_string_value(item->menu->sym, text().toLatin1()); + parent()->updateList(item); + break; + default: + Parent::keyPressEvent(e); + return; + } + e->accept(); + parent()->list->setFocus(); + hide(); +} + +ConfigList::ConfigList(ConfigView* p, const char *name) + : Parent(p), + updateAll(false), + symbolYesPix(xpm_symbol_yes), symbolModPix(xpm_symbol_mod), symbolNoPix(xpm_symbol_no), + choiceYesPix(xpm_choice_yes), choiceNoPix(xpm_choice_no), + menuPix(xpm_menu), menuInvPix(xpm_menu_inv), menuBackPix(xpm_menuback), voidPix(xpm_void), + showName(false), showRange(false), showData(false), mode(singleMode), optMode(normalOpt), + rootEntry(0), headerPopup(0) +{ + int i; + + setObjectName(name); + setSortingEnabled(false); + setRootIsDecorated(true); + + setVerticalScrollMode(ScrollPerPixel); + setHorizontalScrollMode(ScrollPerPixel); + + setHeaderLabels(QStringList() << _("Option") << _("Name") << "N" << "M" << "Y" << _("Value")); + + connect(this, SIGNAL(itemSelectionChanged(void)), + SLOT(updateSelection(void))); + + if (name) { + configSettings->beginGroup(name); + showName = configSettings->value("/showName", false).toBool(); + showRange = configSettings->value("/showRange", false).toBool(); + showData = configSettings->value("/showData", false).toBool(); + optMode = (enum optionMode)configSettings->value("/optionMode", 0).toInt(); + configSettings->endGroup(); + connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings())); + } + + addColumn(promptColIdx); + + reinit(); +} + +bool ConfigList::menuSkip(struct menu *menu) +{ + if (optMode == normalOpt && menu_is_visible(menu)) + return false; + if (optMode == promptOpt && menu_has_prompt(menu)) + return false; + if (optMode == allOpt) + return false; + return true; +} + +void ConfigList::reinit(void) +{ + removeColumn(dataColIdx); + removeColumn(yesColIdx); + removeColumn(modColIdx); + removeColumn(noColIdx); + removeColumn(nameColIdx); + + if (showName) + addColumn(nameColIdx); + if (showRange) { + addColumn(noColIdx); + addColumn(modColIdx); + addColumn(yesColIdx); + } + if (showData) + addColumn(dataColIdx); + + updateListAll(); +} + +void ConfigList::saveSettings(void) +{ + if (!objectName().isEmpty()) { + configSettings->beginGroup(objectName()); + configSettings->setValue("/showName", showName); + configSettings->setValue("/showRange", showRange); + configSettings->setValue("/showData", showData); + configSettings->setValue("/optionMode", (int)optMode); + configSettings->endGroup(); + } +} + +ConfigItem* ConfigList::findConfigItem(struct menu *menu) +{ + ConfigItem* item = (ConfigItem*)menu->data; + + for (; item; item = item->nextItem) { + if (this == item->listView()) + break; + } + + return item; +} + +void ConfigList::updateSelection(void) +{ + struct menu *menu; + enum prop_type type; + + if (selectedItems().count() == 0) + return; + + ConfigItem* item = (ConfigItem*)selectedItems().first(); + if (!item) + return; + + menu = item->menu; + emit menuChanged(menu); + if (!menu) + return; + type = menu->prompt ? menu->prompt->type : P_UNKNOWN; + if (mode == menuMode && type == P_MENU) + emit menuSelected(menu); +} + +void ConfigList::updateList(ConfigItem* item) +{ + ConfigItem* last = 0; + + if (!rootEntry) { + if (mode != listMode) + goto update; + QTreeWidgetItemIterator it(this); + ConfigItem* item; + + while (*it) { + item = (ConfigItem*)(*it); + if (!item->menu) + continue; + item->testUpdateMenu(menu_is_visible(item->menu)); + + ++it; + } + return; + } + + if (rootEntry != &rootmenu && (mode == singleMode || + (mode == symbolMode && rootEntry->parent != &rootmenu))) { + item = (ConfigItem *)topLevelItem(0); + if (!item) + item = new ConfigItem(this, 0, true); + last = item; + } + if ((mode == singleMode || (mode == symbolMode && !(rootEntry->flags & MENU_ROOT))) && + rootEntry->sym && rootEntry->prompt) { + item = last ? last->nextSibling() : firstChild(); + if (!item) + item = new ConfigItem(this, last, rootEntry, true); + else + item->testUpdateMenu(true); + + updateMenuList(item, rootEntry); + update(); + resizeColumnToContents(0); + return; + } +update: + updateMenuList(this, rootEntry); + update(); + resizeColumnToContents(0); +} + +void ConfigList::setValue(ConfigItem* item, tristate val) +{ + struct symbol* sym; + int type; + tristate oldval; + + sym = item->menu ? item->menu->sym : 0; + if (!sym) + return; + + type = sym_get_type(sym); + switch (type) { + case S_BOOLEAN: + case S_TRISTATE: + oldval = sym_get_tristate_value(sym); + + if (!sym_set_tristate_value(sym, val)) + return; + if (oldval == no && item->menu->list) + item->setExpanded(true); + parent()->updateList(item); + break; + } +} + +void ConfigList::changeValue(ConfigItem* item) +{ + struct symbol* sym; + struct menu* menu; + int type, oldexpr, newexpr; + + menu = item->menu; + if (!menu) + return; + sym = menu->sym; + if (!sym) { + if (item->menu->list) + item->setExpanded(!item->isExpanded()); + return; + } + + type = sym_get_type(sym); + switch (type) { + case S_BOOLEAN: + case S_TRISTATE: + oldexpr = sym_get_tristate_value(sym); + newexpr = sym_toggle_tristate_value(sym); + if (item->menu->list) { + if (oldexpr == newexpr) + item->setExpanded(!item->isExpanded()); + else if (oldexpr == no) + item->setExpanded(true); + } + if (oldexpr != newexpr) + parent()->updateList(item); + break; + case S_INT: + case S_HEX: + case S_STRING: + parent()->lineEdit->show(item); + break; + } +} + +void ConfigList::setRootMenu(struct menu *menu) +{ + enum prop_type type; + + if (rootEntry == menu) + return; + type = menu && menu->prompt ? menu->prompt->type : P_UNKNOWN; + if (type != P_MENU) + return; + updateMenuList(this, 0); + rootEntry = menu; + updateListAll(); + if (currentItem()) { + currentItem()->setSelected(hasFocus()); + scrollToItem(currentItem()); + } +} + +void ConfigList::setParentMenu(void) +{ + ConfigItem* item; + struct menu *oldroot; + + oldroot = rootEntry; + if (rootEntry == &rootmenu) + return; + setRootMenu(menu_get_parent_menu(rootEntry->parent)); + + QTreeWidgetItemIterator it(this); + while (*it) { + item = (ConfigItem *)(*it); + if (item->menu == oldroot) { + setCurrentItem(item); + scrollToItem(item); + break; + } + + ++it; + } +} + +/* + * update all the children of a menu entry + * removes/adds the entries from the parent widget as necessary + * + * parent: either the menu list widget or a menu entry widget + * menu: entry to be updated + */ +void ConfigList::updateMenuList(ConfigItem *parent, struct menu* menu) +{ + struct menu* child; + ConfigItem* item; + ConfigItem* last; + bool visible; + enum prop_type type; + + if (!menu) { + while (parent->childCount() > 0) + { + delete parent->takeChild(0); + } + + return; + } + + last = parent->firstChild(); + if (last && !last->goParent) + last = 0; + for (child = menu->list; child; child = child->next) { + item = last ? last->nextSibling() : parent->firstChild(); + type = child->prompt ? child->prompt->type : P_UNKNOWN; + + switch (mode) { + case menuMode: + if (!(child->flags & MENU_ROOT)) + goto hide; + break; + case symbolMode: + if (child->flags & MENU_ROOT) + goto hide; + break; + default: + break; + } + + visible = menu_is_visible(child); + if (!menuSkip(child)) { + if (!child->sym && !child->list && !child->prompt) + continue; + if (!item || item->menu != child) + item = new ConfigItem(parent, last, child, visible); + else + item->testUpdateMenu(visible); + + if (mode == fullMode || mode == menuMode || type != P_MENU) + updateMenuList(item, child); + else + updateMenuList(item, 0); + last = item; + continue; + } + hide: + if (item && item->menu == child) { + last = parent->firstChild(); + if (last == item) + last = 0; + else while (last->nextSibling() != item) + last = last->nextSibling(); + delete item; + } + } +} + +void ConfigList::updateMenuList(ConfigList *parent, struct menu* menu) +{ + struct menu* child; + ConfigItem* item; + ConfigItem* last; + bool visible; + enum prop_type type; + + if (!menu) { + while (parent->topLevelItemCount() > 0) + { + delete parent->takeTopLevelItem(0); + } + + return; + } + + last = (ConfigItem*)parent->topLevelItem(0); + if (last && !last->goParent) + last = 0; + for (child = menu->list; child; child = child->next) { + item = last ? last->nextSibling() : (ConfigItem*)parent->topLevelItem(0); + type = child->prompt ? child->prompt->type : P_UNKNOWN; + + switch (mode) { + case menuMode: + if (!(child->flags & MENU_ROOT)) + goto hide; + break; + case symbolMode: + if (child->flags & MENU_ROOT) + goto hide; + break; + default: + break; + } + + visible = menu_is_visible(child); + if (!menuSkip(child)) { + if (!child->sym && !child->list && !child->prompt) + continue; + if (!item || item->menu != child) + item = new ConfigItem(parent, last, child, visible); + else + item->testUpdateMenu(visible); + + if (mode == fullMode || mode == menuMode || type != P_MENU) + updateMenuList(item, child); + else + updateMenuList(item, 0); + last = item; + continue; + } + hide: + if (item && item->menu == child) { + last = (ConfigItem*)parent->topLevelItem(0); + if (last == item) + last = 0; + else while (last->nextSibling() != item) + last = last->nextSibling(); + delete item; + } + } +} + +void ConfigList::keyPressEvent(QKeyEvent* ev) +{ + QTreeWidgetItem* i = currentItem(); + ConfigItem* item; + struct menu *menu; + enum prop_type type; + + if (ev->key() == Qt::Key_Escape && mode != fullMode && mode != listMode) { + emit parentSelected(); + ev->accept(); + return; + } + + if (!i) { + Parent::keyPressEvent(ev); + return; + } + item = (ConfigItem*)i; + + switch (ev->key()) { + case Qt::Key_Return: + case Qt::Key_Enter: + if (item->goParent) { + emit parentSelected(); + break; + } + menu = item->menu; + if (!menu) + break; + type = menu->prompt ? menu->prompt->type : P_UNKNOWN; + if (type == P_MENU && rootEntry != menu && + mode != fullMode && mode != menuMode) { + emit menuSelected(menu); + break; + } + case Qt::Key_Space: + changeValue(item); + break; + case Qt::Key_N: + setValue(item, no); + break; + case Qt::Key_M: + setValue(item, mod); + break; + case Qt::Key_Y: + setValue(item, yes); + break; + default: + Parent::keyPressEvent(ev); + return; + } + ev->accept(); +} + +void ConfigList::mousePressEvent(QMouseEvent* e) +{ + //QPoint p(contentsToViewport(e->pos())); + //printf("contentsMousePressEvent: %d,%d\n", p.x(), p.y()); + Parent::mousePressEvent(e); +} + +void ConfigList::mouseReleaseEvent(QMouseEvent* e) +{ + QPoint p = e->pos(); + ConfigItem* item = (ConfigItem*)itemAt(p); + struct menu *menu; + enum prop_type ptype; + QIcon icon; + int idx, x; + + if (!item) + goto skip; + + menu = item->menu; + x = header()->offset() + p.x(); + idx = header()->logicalIndexAt(x); + switch (idx) { + case promptColIdx: + icon = item->pixmap(promptColIdx); + if (!icon.isNull()) { + int off = header()->sectionPosition(0) + visualRect(indexAt(p)).x() + 4; // 4 is Hardcoded image offset. There might be a way to do it properly. + if (x >= off && x < off + icon.availableSizes().first().width()) { + if (item->goParent) { + emit parentSelected(); + break; + } else if (!menu) + break; + ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; + if (ptype == P_MENU && rootEntry != menu && + mode != fullMode && mode != menuMode) + emit menuSelected(menu); + else + changeValue(item); + } + } + break; + case noColIdx: + setValue(item, no); + break; + case modColIdx: + setValue(item, mod); + break; + case yesColIdx: + setValue(item, yes); + break; + case dataColIdx: + changeValue(item); + break; + } + +skip: + //printf("contentsMouseReleaseEvent: %d,%d\n", p.x(), p.y()); + Parent::mouseReleaseEvent(e); +} + +void ConfigList::mouseMoveEvent(QMouseEvent* e) +{ + //QPoint p(contentsToViewport(e->pos())); + //printf("contentsMouseMoveEvent: %d,%d\n", p.x(), p.y()); + Parent::mouseMoveEvent(e); +} + +void ConfigList::mouseDoubleClickEvent(QMouseEvent* e) +{ + QPoint p = e->pos(); // TODO: Check if this works(was contentsToViewport). + ConfigItem* item = (ConfigItem*)itemAt(p); + struct menu *menu; + enum prop_type ptype; + + if (!item) + goto skip; + if (item->goParent) { + emit parentSelected(); + goto skip; + } + menu = item->menu; + if (!menu) + goto skip; + ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; + if (ptype == P_MENU && (mode == singleMode || mode == symbolMode)) + emit menuSelected(menu); + else if (menu->sym) + changeValue(item); + +skip: + //printf("contentsMouseDoubleClickEvent: %d,%d\n", p.x(), p.y()); + Parent::mouseDoubleClickEvent(e); +} + +void ConfigList::focusInEvent(QFocusEvent *e) +{ + struct menu *menu = NULL; + + Parent::focusInEvent(e); + + ConfigItem* item = (ConfigItem *)currentItem(); + if (item) { + item->setSelected(true); + menu = item->menu; + } + emit gotFocus(menu); +} + +void ConfigList::contextMenuEvent(QContextMenuEvent *e) +{ + if (e->y() <= header()->geometry().bottom()) { + if (!headerPopup) { + QAction *action; + + headerPopup = new QMenu(this); + action = new QAction(_("Show Name"), this); + action->setCheckable(true); + connect(action, SIGNAL(toggled(bool)), + parent(), SLOT(setShowName(bool))); + connect(parent(), SIGNAL(showNameChanged(bool)), + action, SLOT(setOn(bool))); + action->setChecked(showName); + headerPopup->addAction(action); + action = new QAction(_("Show Range"), this); + action->setCheckable(true); + connect(action, SIGNAL(toggled(bool)), + parent(), SLOT(setShowRange(bool))); + connect(parent(), SIGNAL(showRangeChanged(bool)), + action, SLOT(setOn(bool))); + action->setChecked(showRange); + headerPopup->addAction(action); + action = new QAction(_("Show Data"), this); + action->setCheckable(true); + connect(action, SIGNAL(toggled(bool)), + parent(), SLOT(setShowData(bool))); + connect(parent(), SIGNAL(showDataChanged(bool)), + action, SLOT(setOn(bool))); + action->setChecked(showData); + headerPopup->addAction(action); + } + headerPopup->exec(e->globalPos()); + e->accept(); + } else + e->ignore(); +} + +ConfigView*ConfigView::viewList; +QAction *ConfigView::showNormalAction; +QAction *ConfigView::showAllAction; +QAction *ConfigView::showPromptAction; + +ConfigView::ConfigView(QWidget* parent, const char *name) + : Parent(parent) +{ + setObjectName(name); + QVBoxLayout *verticalLayout = new QVBoxLayout(this); + verticalLayout->setContentsMargins(0, 0, 0, 0); + + list = new ConfigList(this); + verticalLayout->addWidget(list); + lineEdit = new ConfigLineEdit(this); + lineEdit->hide(); + verticalLayout->addWidget(lineEdit); + + this->nextView = viewList; + viewList = this; +} + +ConfigView::~ConfigView(void) +{ + ConfigView** vp; + + for (vp = &viewList; *vp; vp = &(*vp)->nextView) { + if (*vp == this) { + *vp = nextView; + break; + } + } +} + +void ConfigView::setOptionMode(QAction *act) +{ + if (act == showNormalAction) + list->optMode = normalOpt; + else if (act == showAllAction) + list->optMode = allOpt; + else + list->optMode = promptOpt; + + list->updateListAll(); +} + +void ConfigView::setShowName(bool b) +{ + if (list->showName != b) { + list->showName = b; + list->reinit(); + emit showNameChanged(b); + } +} + +void ConfigView::setShowRange(bool b) +{ + if (list->showRange != b) { + list->showRange = b; + list->reinit(); + emit showRangeChanged(b); + } +} + +void ConfigView::setShowData(bool b) +{ + if (list->showData != b) { + list->showData = b; + list->reinit(); + emit showDataChanged(b); + } +} + +void ConfigList::setAllOpen(bool open) +{ + QTreeWidgetItemIterator it(this); + + while (*it) { + (*it)->setExpanded(open); + + ++it; + } +} + +void ConfigView::updateList(ConfigItem* item) +{ + ConfigView* v; + + for (v = viewList; v; v = v->nextView) + v->list->updateList(item); +} + +void ConfigView::updateListAll(void) +{ + ConfigView* v; + + for (v = viewList; v; v = v->nextView) + v->list->updateListAll(); +} + +ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name) + : Parent(parent), sym(0), _menu(0) +{ + setObjectName(name); + + + if (!objectName().isEmpty()) { + configSettings->beginGroup(objectName()); + _showDebug = configSettings->value("/showDebug", false).toBool(); + configSettings->endGroup(); + connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings())); + } +} + +void ConfigInfoView::saveSettings(void) +{ + if (!objectName().isEmpty()) { + configSettings->beginGroup(objectName()); + configSettings->setValue("/showDebug", showDebug()); + configSettings->endGroup(); + } +} + +void ConfigInfoView::setShowDebug(bool b) +{ + if (_showDebug != b) { + _showDebug = b; + if (_menu) + menuInfo(); + else if (sym) + symbolInfo(); + emit showDebugChanged(b); + } +} + +void ConfigInfoView::setInfo(struct menu *m) +{ + if (_menu == m) + return; + _menu = m; + sym = NULL; + if (!_menu) + clear(); + else + menuInfo(); +} + +void ConfigInfoView::symbolInfo(void) +{ + QString str; + + str += "Symbol: "; + str += print_filter(sym->name); + str += "

value: "; + str += print_filter(sym_get_string_value(sym)); + str += "
visibility: "; + str += sym->visible == yes ? "y" : sym->visible == mod ? "m" : "n"; + str += "
"; + str += debug_info(sym); + + setText(str); +} + +void ConfigInfoView::menuInfo(void) +{ + struct symbol* sym; + QString head, debug, help; + + sym = _menu->sym; + if (sym) { + if (_menu->prompt) { + head += ""; + head += print_filter(_(_menu->prompt->text)); + head += ""; + if (sym->name) { + head += " ("; + if (showDebug()) + head += QString().sprintf("
", sym); + head += print_filter(sym->name); + if (showDebug()) + head += ""; + head += ")"; + } + } else if (sym->name) { + head += ""; + if (showDebug()) + head += QString().sprintf("", sym); + head += print_filter(sym->name); + if (showDebug()) + head += ""; + head += ""; + } + head += "

"; + + if (showDebug()) + debug = debug_info(sym); + + struct gstr help_gstr = str_new(); + menu_get_ext_help(_menu, &help_gstr); + help = print_filter(str_get(&help_gstr)); + str_free(&help_gstr); + } else if (_menu->prompt) { + head += ""; + head += print_filter(_(_menu->prompt->text)); + head += "

"; + if (showDebug()) { + if (_menu->prompt->visible.expr) { + debug += "  dep: "; + expr_print(_menu->prompt->visible.expr, expr_print_help, &debug, E_NONE); + debug += "

"; + } + } + } + if (showDebug()) + debug += QString().sprintf("defined at %s:%d

", _menu->file->name, _menu->lineno); + + setText(head + debug + help); +} + +QString ConfigInfoView::debug_info(struct symbol *sym) +{ + QString debug; + + debug += "type: "; + debug += print_filter(sym_type_name(sym->type)); + if (sym_is_choice(sym)) + debug += " (choice)"; + debug += "
"; + if (sym->rev_dep.expr) { + debug += "reverse dep: "; + expr_print(sym->rev_dep.expr, expr_print_help, &debug, E_NONE); + debug += "
"; + } + for (struct property *prop = sym->prop; prop; prop = prop->next) { + switch (prop->type) { + case P_PROMPT: + case P_MENU: + debug += QString().sprintf("prompt: ", prop->menu); + debug += print_filter(_(prop->text)); + debug += "
"; + break; + case P_DEFAULT: + case P_SELECT: + case P_RANGE: + case P_ENV: + debug += prop_get_type_name(prop->type); + debug += ": "; + expr_print(prop->expr, expr_print_help, &debug, E_NONE); + debug += "
"; + break; + case P_CHOICE: + if (sym_is_choice(sym)) { + debug += "choice: "; + expr_print(prop->expr, expr_print_help, &debug, E_NONE); + debug += "
"; + } + break; + default: + debug += "unknown property: "; + debug += prop_get_type_name(prop->type); + debug += "
"; + } + if (prop->visible.expr) { + debug += "    dep: "; + expr_print(prop->visible.expr, expr_print_help, &debug, E_NONE); + debug += "
"; + } + } + debug += "
"; + + return debug; +} + +QString ConfigInfoView::print_filter(const QString &str) +{ + QRegExp re("[<>&\"\\n]"); + QString res = str; + for (int i = 0; (i = res.indexOf(re, i)) >= 0;) { + switch (res[i].toLatin1()) { + case '<': + res.replace(i, 1, "<"); + i += 4; + break; + case '>': + res.replace(i, 1, ">"); + i += 4; + break; + case '&': + res.replace(i, 1, "&"); + i += 5; + break; + case '"': + res.replace(i, 1, """); + i += 6; + break; + case '\n': + res.replace(i, 1, "
"); + i += 4; + break; + } + } + return res; +} + +void ConfigInfoView::expr_print_help(void *data, struct symbol *sym, const char *str) +{ + QString* text = reinterpret_cast(data); + QString str2 = print_filter(str); + + if (sym && sym->name && !(sym->flags & SYMBOL_CONST)) { + *text += QString().sprintf("", sym); + *text += str2; + *text += ""; + } else + *text += str2; +} + +QMenu* ConfigInfoView::createStandardContextMenu(const QPoint & pos) +{ + QMenu* popup = Parent::createStandardContextMenu(pos); + QAction* action = new QAction(_("Show Debug Info"), popup); + action->setCheckable(true); + connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool))); + connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool))); + action->setChecked(showDebug()); + popup->addSeparator(); + popup->addAction(action); + return popup; +} + +void ConfigInfoView::contextMenuEvent(QContextMenuEvent *e) +{ + Parent::contextMenuEvent(e); +} + +ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *name) + : Parent(parent), result(NULL) +{ + setObjectName(name); + setWindowTitle("Search Config"); + + QVBoxLayout* layout1 = new QVBoxLayout(this); + layout1->setContentsMargins(11, 11, 11, 11); + layout1->setSpacing(6); + QHBoxLayout* layout2 = new QHBoxLayout(0); + layout2->setContentsMargins(0, 0, 0, 0); + layout2->setSpacing(6); + layout2->addWidget(new QLabel(_("Find:"), this)); + editField = new QLineEdit(this); + connect(editField, SIGNAL(returnPressed()), SLOT(search())); + layout2->addWidget(editField); + searchButton = new QPushButton(_("Search"), this); + searchButton->setAutoDefault(false); + connect(searchButton, SIGNAL(clicked()), SLOT(search())); + layout2->addWidget(searchButton); + layout1->addLayout(layout2); + + split = new QSplitter(this); + split->setOrientation(Qt::Vertical); + list = new ConfigView(split, name); + list->list->mode = listMode; + info = new ConfigInfoView(split, name); + connect(list->list, SIGNAL(menuChanged(struct menu *)), + info, SLOT(setInfo(struct menu *))); + connect(list->list, SIGNAL(menuChanged(struct menu *)), + parent, SLOT(setMenuLink(struct menu *))); + + layout1->addWidget(split); + + if (name) { + QVariant x, y; + int width, height; + bool ok; + + configSettings->beginGroup(name); + width = configSettings->value("/window width", parent->width() / 2).toInt(); + height = configSettings->value("/window height", parent->height() / 2).toInt(); + resize(width, height); + x = configSettings->value("/window x"); + y = configSettings->value("/window y"); + if ((x.isValid())&&(y.isValid())) + move(x.toInt(), y.toInt()); + QList sizes = configSettings->readSizes("/split", &ok); + if (ok) + split->setSizes(sizes); + configSettings->endGroup(); + connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings())); + } +} + +void ConfigSearchWindow::saveSettings(void) +{ + if (!objectName().isEmpty()) { + configSettings->beginGroup(objectName()); + configSettings->setValue("/window x", pos().x()); + configSettings->setValue("/window y", pos().y()); + configSettings->setValue("/window width", size().width()); + configSettings->setValue("/window height", size().height()); + configSettings->writeSizes("/split", split->sizes()); + configSettings->endGroup(); + } +} + +void ConfigSearchWindow::search(void) +{ + struct symbol **p; + struct property *prop; + ConfigItem *lastItem = NULL; + + free(result); + list->list->clear(); + info->clear(); + + result = sym_re_search(editField->text().toLatin1()); + if (!result) + return; + for (p = result; *p; p++) { + for_all_prompts((*p), prop) + lastItem = new ConfigItem(list->list, lastItem, prop->menu, + menu_is_visible(prop->menu)); + } +} + +/* + * Construct the complete config widget + */ +ConfigMainWindow::ConfigMainWindow(void) + : searchWindow(0) +{ + QMenuBar* menu; + bool ok = true; + QVariant x, y; + int width, height; + char title[256]; + + QDesktopWidget *d = configApp->desktop(); + snprintf(title, sizeof(title), "%s%s", + rootmenu.prompt->text, + "" + ); + setWindowTitle(title); + + width = configSettings->value("/window width", d->width() - 64).toInt(); + height = configSettings->value("/window height", d->height() - 64).toInt(); + resize(width, height); + x = configSettings->value("/window x"); + y = configSettings->value("/window y"); + if ((x.isValid())&&(y.isValid())) + move(x.toInt(), y.toInt()); + + split1 = new QSplitter(this); + split1->setOrientation(Qt::Horizontal); + setCentralWidget(split1); + + menuView = new ConfigView(split1, "menu"); + menuList = menuView->list; + + split2 = new QSplitter(split1); + split2->setOrientation(Qt::Vertical); + + // create config tree + configView = new ConfigView(split2, "config"); + configList = configView->list; + + helpText = new ConfigInfoView(split2, "help"); + + setTabOrder(configList, helpText); + configList->setFocus(); + + menu = menuBar(); + toolBar = new QToolBar("Tools", this); + addToolBar(toolBar); + + backAction = new QAction(QPixmap(xpm_back), _("Back"), this); + connect(backAction, SIGNAL(triggered(bool)), SLOT(goBack())); + backAction->setEnabled(false); + QAction *quitAction = new QAction(_("&Quit"), this); + quitAction->setShortcut(Qt::CTRL + Qt::Key_Q); + connect(quitAction, SIGNAL(triggered(bool)), SLOT(close())); + QAction *loadAction = new QAction(QPixmap(xpm_load), _("&Load"), this); + loadAction->setShortcut(Qt::CTRL + Qt::Key_L); + connect(loadAction, SIGNAL(triggered(bool)), SLOT(loadConfig())); + saveAction = new QAction(QPixmap(xpm_save), _("&Save"), this); + saveAction->setShortcut(Qt::CTRL + Qt::Key_S); + connect(saveAction, SIGNAL(triggered(bool)), SLOT(saveConfig())); + conf_set_changed_callback(conf_changed); + // Set saveAction's initial state + conf_changed(); + QAction *saveAsAction = new QAction(_("Save &As..."), this); + connect(saveAsAction, SIGNAL(triggered(bool)), SLOT(saveConfigAs())); + QAction *searchAction = new QAction(_("&Find"), this); + searchAction->setShortcut(Qt::CTRL + Qt::Key_F); + connect(searchAction, SIGNAL(triggered(bool)), SLOT(searchConfig())); + singleViewAction = new QAction(QPixmap(xpm_single_view), _("Single View"), this); + singleViewAction->setCheckable(true); + connect(singleViewAction, SIGNAL(triggered(bool)), SLOT(showSingleView())); + splitViewAction = new QAction(QPixmap(xpm_split_view), _("Split View"), this); + splitViewAction->setCheckable(true); + connect(splitViewAction, SIGNAL(triggered(bool)), SLOT(showSplitView())); + fullViewAction = new QAction(QPixmap(xpm_tree_view), _("Full View"), this); + fullViewAction->setCheckable(true); + connect(fullViewAction, SIGNAL(triggered(bool)), SLOT(showFullView())); + + QAction *showNameAction = new QAction(_("Show Name"), this); + showNameAction->setCheckable(true); + connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool))); + showNameAction->setChecked(configView->showName()); + QAction *showRangeAction = new QAction(_("Show Range"), this); + showRangeAction->setCheckable(true); + connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool))); + QAction *showDataAction = new QAction(_("Show Data"), this); + showDataAction->setCheckable(true); + connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool))); + + QActionGroup *optGroup = new QActionGroup(this); + optGroup->setExclusive(true); + connect(optGroup, SIGNAL(triggered(QAction*)), configView, + SLOT(setOptionMode(QAction *))); + connect(optGroup, SIGNAL(triggered(QAction *)), menuView, + SLOT(setOptionMode(QAction *))); + + configView->showNormalAction = new QAction(_("Show Normal Options"), optGroup); + configView->showAllAction = new QAction(_("Show All Options"), optGroup); + configView->showPromptAction = new QAction(_("Show Prompt Options"), optGroup); + configView->showNormalAction->setCheckable(true); + configView->showAllAction->setCheckable(true); + configView->showPromptAction->setCheckable(true); + + QAction *showDebugAction = new QAction( _("Show Debug Info"), this); + showDebugAction->setCheckable(true); + connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool))); + showDebugAction->setChecked(helpText->showDebug()); + + QAction *showIntroAction = new QAction( _("Introduction"), this); + connect(showIntroAction, SIGNAL(triggered(bool)), SLOT(showIntro())); + QAction *showAboutAction = new QAction( _("About"), this); + connect(showAboutAction, SIGNAL(triggered(bool)), SLOT(showAbout())); + + // init tool bar + toolBar->addAction(backAction); + toolBar->addSeparator(); + toolBar->addAction(loadAction); + toolBar->addAction(saveAction); + toolBar->addSeparator(); + toolBar->addAction(singleViewAction); + toolBar->addAction(splitViewAction); + toolBar->addAction(fullViewAction); + + // create config menu + QMenu* config = menu->addMenu(_("&File")); + config->addAction(loadAction); + config->addAction(saveAction); + config->addAction(saveAsAction); + config->addSeparator(); + config->addAction(quitAction); + + // create edit menu + QMenu* editMenu = menu->addMenu(_("&Edit")); + editMenu->addAction(searchAction); + + // create options menu + QMenu* optionMenu = menu->addMenu(_("&Option")); + optionMenu->addAction(showNameAction); + optionMenu->addAction(showRangeAction); + optionMenu->addAction(showDataAction); + optionMenu->addSeparator(); + optionMenu->addActions(optGroup->actions()); + optionMenu->addSeparator(); + + // create help menu + menu->addSeparator(); + QMenu* helpMenu = menu->addMenu(_("&Help")); + helpMenu->addAction(showIntroAction); + helpMenu->addAction(showAboutAction); + + connect(configList, SIGNAL(menuChanged(struct menu *)), + helpText, SLOT(setInfo(struct menu *))); + connect(configList, SIGNAL(menuSelected(struct menu *)), + SLOT(changeMenu(struct menu *))); + connect(configList, SIGNAL(parentSelected()), + SLOT(goBack())); + connect(menuList, SIGNAL(menuChanged(struct menu *)), + helpText, SLOT(setInfo(struct menu *))); + connect(menuList, SIGNAL(menuSelected(struct menu *)), + SLOT(changeMenu(struct menu *))); + + connect(configList, SIGNAL(gotFocus(struct menu *)), + helpText, SLOT(setInfo(struct menu *))); + connect(menuList, SIGNAL(gotFocus(struct menu *)), + helpText, SLOT(setInfo(struct menu *))); + connect(menuList, SIGNAL(gotFocus(struct menu *)), + SLOT(listFocusChanged(void))); + connect(helpText, SIGNAL(menuSelected(struct menu *)), + SLOT(setMenuLink(struct menu *))); + + QString listMode = configSettings->value("/listMode", "symbol").toString(); + if (listMode == "single") + showSingleView(); + else if (listMode == "full") + showFullView(); + else /*if (listMode == "split")*/ + showSplitView(); + + // UI setup done, restore splitter positions + QList sizes = configSettings->readSizes("/split1", &ok); + if (ok) + split1->setSizes(sizes); + + sizes = configSettings->readSizes("/split2", &ok); + if (ok) + split2->setSizes(sizes); +} + +void ConfigMainWindow::loadConfig(void) +{ + QString s = QFileDialog::getOpenFileName(this, "", conf_get_configname()); + if (s.isNull()) + return; + if (conf_read(QFile::encodeName(s))) + QMessageBox::information(this, "qconf", _("Unable to load configuration!")); + ConfigView::updateListAll(); +} + +bool ConfigMainWindow::saveConfig(void) +{ + if (conf_write(NULL)) { + QMessageBox::information(this, "qconf", _("Unable to save configuration!")); + return false; + } + return true; +} + +void ConfigMainWindow::saveConfigAs(void) +{ + QString s = QFileDialog::getSaveFileName(this, "", conf_get_configname()); + if (s.isNull()) + return; + saveConfig(); +} + +void ConfigMainWindow::searchConfig(void) +{ + if (!searchWindow) + searchWindow = new ConfigSearchWindow(this, "search"); + searchWindow->show(); +} + +void ConfigMainWindow::changeMenu(struct menu *menu) +{ + configList->setRootMenu(menu); + if (configList->rootEntry->parent == &rootmenu) + backAction->setEnabled(false); + else + backAction->setEnabled(true); +} + +void ConfigMainWindow::setMenuLink(struct menu *menu) +{ + struct menu *parent; + ConfigList* list = NULL; + ConfigItem* item; + + if (configList->menuSkip(menu)) + return; + + switch (configList->mode) { + case singleMode: + list = configList; + parent = menu_get_parent_menu(menu); + if (!parent) + return; + list->setRootMenu(parent); + break; + case symbolMode: + if (menu->flags & MENU_ROOT) { + configList->setRootMenu(menu); + configList->clearSelection(); + list = menuList; + } else { + list = configList; + parent = menu_get_parent_menu(menu->parent); + if (!parent) + return; + item = menuList->findConfigItem(parent); + if (item) { + item->setSelected(true); + menuList->scrollToItem(item); + } + list->setRootMenu(parent); + } + break; + case fullMode: + list = configList; + break; + default: + break; + } + + if (list) { + item = list->findConfigItem(menu); + if (item) { + item->setSelected(true); + list->scrollToItem(item); + list->setFocus(); + } + } +} + +void ConfigMainWindow::listFocusChanged(void) +{ + if (menuList->mode == menuMode) + configList->clearSelection(); +} + +void ConfigMainWindow::goBack(void) +{ + ConfigItem* item, *oldSelection; + + configList->setParentMenu(); + if (configList->rootEntry == &rootmenu) + backAction->setEnabled(false); + + if (menuList->selectedItems().count() == 0) + return; + + item = (ConfigItem*)menuList->selectedItems().first(); + oldSelection = item; + while (item) { + if (item->menu == configList->rootEntry) { + oldSelection->setSelected(false); + item->setSelected(true); + break; + } + item = (ConfigItem*)item->parent(); + } +} + +void ConfigMainWindow::showSingleView(void) +{ + singleViewAction->setEnabled(false); + singleViewAction->setChecked(true); + splitViewAction->setEnabled(true); + splitViewAction->setChecked(false); + fullViewAction->setEnabled(true); + fullViewAction->setChecked(false); + + menuView->hide(); + menuList->setRootMenu(0); + configList->mode = singleMode; + if (configList->rootEntry == &rootmenu) + configList->updateListAll(); + else + configList->setRootMenu(&rootmenu); + configList->setFocus(); +} + +void ConfigMainWindow::showSplitView(void) +{ + singleViewAction->setEnabled(true); + singleViewAction->setChecked(false); + splitViewAction->setEnabled(false); + splitViewAction->setChecked(true); + fullViewAction->setEnabled(true); + fullViewAction->setChecked(false); + + configList->mode = symbolMode; + if (configList->rootEntry == &rootmenu) + configList->updateListAll(); + else + configList->setRootMenu(&rootmenu); + configList->setAllOpen(true); + configApp->processEvents(); + menuList->mode = menuMode; + menuList->setRootMenu(&rootmenu); + menuList->setAllOpen(true); + menuView->show(); + menuList->setFocus(); +} + +void ConfigMainWindow::showFullView(void) +{ + singleViewAction->setEnabled(true); + singleViewAction->setChecked(false); + splitViewAction->setEnabled(true); + splitViewAction->setChecked(false); + fullViewAction->setEnabled(false); + fullViewAction->setChecked(true); + + menuView->hide(); + menuList->setRootMenu(0); + configList->mode = fullMode; + if (configList->rootEntry == &rootmenu) + configList->updateListAll(); + else + configList->setRootMenu(&rootmenu); + configList->setFocus(); +} + +/* + * ask for saving configuration before quitting + * TODO ask only when something changed + */ +void ConfigMainWindow::closeEvent(QCloseEvent* e) +{ + if (!conf_get_changed()) { + e->accept(); + return; + } + QMessageBox mb("qconf", _("Save configuration?"), QMessageBox::Warning, + QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Cancel | QMessageBox::Escape); + mb.setButtonText(QMessageBox::Yes, _("&Save Changes")); + mb.setButtonText(QMessageBox::No, _("&Discard Changes")); + mb.setButtonText(QMessageBox::Cancel, _("Cancel Exit")); + switch (mb.exec()) { + case QMessageBox::Yes: + if (saveConfig()) + e->accept(); + else + e->ignore(); + break; + case QMessageBox::No: + e->accept(); + break; + case QMessageBox::Cancel: + e->ignore(); + break; + } +} + +void ConfigMainWindow::showIntro(void) +{ + static const QString str = _("Welcome to the qconf graphical configuration tool.\n\n" + "For each option, a blank box indicates the feature is disabled, a check\n" + "indicates it is enabled, and a dot indicates that it is to be compiled\n" + "as a module. Clicking on the box will cycle through the three states.\n\n" + "If you do not see an option (e.g., a device driver) that you believe\n" + "should be present, try turning on Show All Options under the Options menu.\n" + "Although there is no cross reference yet to help you figure out what other\n" + "options must be enabled to support the option you are interested in, you can\n" + "still view the help of a grayed-out option.\n\n" + "Toggling Show Debug Info under the Options menu will show the dependencies,\n" + "which you can then match by examining other options.\n\n"); + + QMessageBox::information(this, "qconf", str); +} + +void ConfigMainWindow::showAbout(void) +{ + static const QString str = _("qconf is Copyright (C) 2002 Roman Zippel .\n" + "Copyright (C) 2015 Boris Barbulovski .\n\n" + "Bug reports and feature request can also be entered at http://bugzilla.kernel.org/\n"); + + QMessageBox::information(this, "qconf", str); +} + +void ConfigMainWindow::saveSettings(void) +{ + configSettings->setValue("/window x", pos().x()); + configSettings->setValue("/window y", pos().y()); + configSettings->setValue("/window width", size().width()); + configSettings->setValue("/window height", size().height()); + + QString entry; + switch(configList->mode) { + case singleMode : + entry = "single"; + break; + + case symbolMode : + entry = "split"; + break; + + case fullMode : + entry = "full"; + break; + + default: + break; + } + configSettings->setValue("/listMode", entry); + + configSettings->writeSizes("/split1", split1->sizes()); + configSettings->writeSizes("/split2", split2->sizes()); +} + +void ConfigMainWindow::conf_changed(void) +{ + if (saveAction) + saveAction->setEnabled(conf_get_changed()); +} + +void fixup_rootmenu(struct menu *menu) +{ + struct menu *child; + static int menu_cnt = 0; + + menu->flags |= MENU_ROOT; + for (child = menu->list; child; child = child->next) { + if (child->prompt && child->prompt->type == P_MENU) { + menu_cnt++; + fixup_rootmenu(child); + menu_cnt--; + } else if (!menu_cnt) + fixup_rootmenu(child); + } +} + +static const char *progname; + +static void usage(void) +{ + printf(_("%s [-s] \n").toLatin1().constData(), progname); + exit(0); +} + +int main(int ac, char** av) +{ + ConfigMainWindow* v; + const char *name; + + bindtextdomain(PACKAGE, LOCALEDIR); + textdomain(PACKAGE); + + progname = av[0]; + configApp = new QApplication(ac, av); + if (ac > 1 && av[1][0] == '-') { + switch (av[1][1]) { + case 's': + conf_set_message_callback(NULL); + break; + case 'h': + case '?': + usage(); + } + name = av[2]; + } else + name = av[1]; + if (!name) + usage(); + + conf_parse(name); + fixup_rootmenu(&rootmenu); + conf_read(NULL); + //zconfdump(stdout); + + configSettings = new ConfigSettings(); + configSettings->beginGroup("/kconfig/qconf"); + v = new ConfigMainWindow(); + + //zconfdump(stdout); + configApp->connect(configApp, SIGNAL(lastWindowClosed()), SLOT(quit())); + configApp->connect(configApp, SIGNAL(aboutToQuit()), v, SLOT(saveSettings())); + v->show(); + configApp->exec(); + + configSettings->endGroup(); + delete configSettings; + delete v; + delete configApp; + + return 0; +} diff --git a/scripts/config/qconf.h b/scripts/config/qconf.h new file mode 100644 index 0000000000..a40036d1b0 --- /dev/null +++ b/scripts/config/qconf.h @@ -0,0 +1,330 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "expr.h" + +class ConfigView; +class ConfigList; +class ConfigItem; +class ConfigLineEdit; +class ConfigMainWindow; + +class ConfigSettings : public QSettings { +public: + ConfigSettings(); + QList readSizes(const QString& key, bool *ok); + bool writeSizes(const QString& key, const QList& value); +}; + +enum colIdx { + promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx, colNr +}; +enum listMode { + singleMode, menuMode, symbolMode, fullMode, listMode +}; +enum optionMode { + normalOpt = 0, allOpt, promptOpt +}; + +class ConfigList : public QTreeWidget { + Q_OBJECT + typedef class QTreeWidget Parent; +public: + ConfigList(ConfigView* p, const char *name = 0); + void reinit(void); + ConfigView* parent(void) const + { + return (ConfigView*)Parent::parent(); + } + ConfigItem* findConfigItem(struct menu *); + +protected: + void keyPressEvent(QKeyEvent *e); + void mousePressEvent(QMouseEvent *e); + void mouseReleaseEvent(QMouseEvent *e); + void mouseMoveEvent(QMouseEvent *e); + void mouseDoubleClickEvent(QMouseEvent *e); + void focusInEvent(QFocusEvent *e); + void contextMenuEvent(QContextMenuEvent *e); + +public slots: + void setRootMenu(struct menu *menu); + + void updateList(ConfigItem *item); + void setValue(ConfigItem* item, tristate val); + void changeValue(ConfigItem* item); + void updateSelection(void); + void saveSettings(void); +signals: + void menuChanged(struct menu *menu); + void menuSelected(struct menu *menu); + void parentSelected(void); + void gotFocus(struct menu *); + +public: + void updateListAll(void) + { + updateAll = true; + updateList(NULL); + updateAll = false; + } + ConfigList* listView() + { + return this; + } + ConfigItem* firstChild() const + { + return (ConfigItem *)children().first(); + } + void addColumn(colIdx idx) + { + showColumn(idx); + } + void removeColumn(colIdx idx) + { + hideColumn(idx); + } + void setAllOpen(bool open); + void setParentMenu(void); + + bool menuSkip(struct menu *); + + void updateMenuList(ConfigItem *parent, struct menu*); + void updateMenuList(ConfigList *parent, struct menu*); + + bool updateAll; + + QPixmap symbolYesPix, symbolModPix, symbolNoPix; + QPixmap choiceYesPix, choiceNoPix; + QPixmap menuPix, menuInvPix, menuBackPix, voidPix; + + bool showName, showRange, showData; + enum listMode mode; + enum optionMode optMode; + struct menu *rootEntry; + QPalette disabledColorGroup; + QPalette inactivedColorGroup; + QMenu* headerPopup; +}; + +class ConfigItem : public QTreeWidgetItem { + typedef class QTreeWidgetItem Parent; +public: + ConfigItem(ConfigList *parent, ConfigItem *after, struct menu *m, bool v) + : Parent(parent, after), nextItem(0), menu(m), visible(v), goParent(false) + { + init(); + } + ConfigItem(ConfigItem *parent, ConfigItem *after, struct menu *m, bool v) + : Parent(parent, after), nextItem(0), menu(m), visible(v), goParent(false) + { + init(); + } + ConfigItem(ConfigList *parent, ConfigItem *after, bool v) + : Parent(parent, after), nextItem(0), menu(0), visible(v), goParent(true) + { + init(); + } + ~ConfigItem(void); + void init(void); + void okRename(int col); + void updateMenu(void); + void testUpdateMenu(bool v); + ConfigList* listView() const + { + return (ConfigList*)Parent::treeWidget(); + } + ConfigItem* firstChild() const + { + return (ConfigItem *)Parent::child(0); + } + ConfigItem* nextSibling() + { + ConfigItem *ret = NULL; + ConfigItem *_parent = (ConfigItem *)parent(); + + if(_parent) { + ret = (ConfigItem *)_parent->child(_parent->indexOfChild(this)+1); + } else { + QTreeWidget *_treeWidget = treeWidget(); + ret = (ConfigItem *)_treeWidget->topLevelItem(_treeWidget->indexOfTopLevelItem(this)+1); + } + + return ret; + } + void setText(colIdx idx, const QString& text) + { + Parent::setText(idx, text); + } + QString text(colIdx idx) const + { + return Parent::text(idx); + } + void setPixmap(colIdx idx, const QIcon &icon) + { + Parent::setIcon(idx, icon); + } + const QIcon pixmap(colIdx idx) const + { + return icon(idx); + } + // TODO: Implement paintCell + + ConfigItem* nextItem; + struct menu *menu; + bool visible; + bool goParent; +}; + +class ConfigLineEdit : public QLineEdit { + Q_OBJECT + typedef class QLineEdit Parent; +public: + ConfigLineEdit(ConfigView* parent); + ConfigView* parent(void) const + { + return (ConfigView*)Parent::parent(); + } + void show(ConfigItem *i); + void keyPressEvent(QKeyEvent *e); + +public: + ConfigItem *item; +}; + +class ConfigView : public QWidget { + Q_OBJECT + typedef class QWidget Parent; +public: + ConfigView(QWidget* parent, const char *name = 0); + ~ConfigView(void); + static void updateList(ConfigItem* item); + static void updateListAll(void); + + bool showName(void) const { return list->showName; } + bool showRange(void) const { return list->showRange; } + bool showData(void) const { return list->showData; } +public slots: + void setShowName(bool); + void setShowRange(bool); + void setShowData(bool); + void setOptionMode(QAction *); +signals: + void showNameChanged(bool); + void showRangeChanged(bool); + void showDataChanged(bool); +public: + ConfigList* list; + ConfigLineEdit* lineEdit; + + static ConfigView* viewList; + ConfigView* nextView; + + static QAction *showNormalAction; + static QAction *showAllAction; + static QAction *showPromptAction; +}; + +class ConfigInfoView : public QTextBrowser { + Q_OBJECT + typedef class QTextBrowser Parent; +public: + ConfigInfoView(QWidget* parent, const char *name = 0); + bool showDebug(void) const { return _showDebug; } + +public slots: + void setInfo(struct menu *menu); + void saveSettings(void); + void setShowDebug(bool); + +signals: + void showDebugChanged(bool); + void menuSelected(struct menu *); + +protected: + void symbolInfo(void); + void menuInfo(void); + QString debug_info(struct symbol *sym); + static QString print_filter(const QString &str); + static void expr_print_help(void *data, struct symbol *sym, const char *str); + QMenu *createStandardContextMenu(const QPoint & pos); + void contextMenuEvent(QContextMenuEvent *e); + + struct symbol *sym; + struct menu *_menu; + bool _showDebug; +}; + +class ConfigSearchWindow : public QDialog { + Q_OBJECT + typedef class QDialog Parent; +public: + ConfigSearchWindow(ConfigMainWindow* parent, const char *name = 0); + +public slots: + void saveSettings(void); + void search(void); + +protected: + QLineEdit* editField; + QPushButton* searchButton; + QSplitter* split; + ConfigView* list; + ConfigInfoView* info; + + struct symbol **result; +}; + +class ConfigMainWindow : public QMainWindow { + Q_OBJECT + + static QAction *saveAction; + static void conf_changed(void); +public: + ConfigMainWindow(void); +public slots: + void changeMenu(struct menu *); + void setMenuLink(struct menu *); + void listFocusChanged(void); + void goBack(void); + void loadConfig(void); + bool saveConfig(void); + void saveConfigAs(void); + void searchConfig(void); + void showSingleView(void); + void showSplitView(void); + void showFullView(void); + void showIntro(void); + void showAbout(void); + void saveSettings(void); + +protected: + void closeEvent(QCloseEvent *e); + + ConfigSearchWindow *searchWindow; + ConfigView *menuView; + ConfigList *menuList; + ConfigView *configView; + ConfigList *configList; + ConfigInfoView *helpText; + QToolBar *toolBar; + QAction *backAction; + QAction *singleViewAction; + QAction *splitViewAction; + QAction *fullViewAction; + QSplitter *split1; + QSplitter *split2; +}; diff --git a/scripts/download.pl b/scripts/download.pl index 936bd0bddb..64e29392ab 100755 --- a/scripts/download.pl +++ b/scripts/download.pl @@ -88,6 +88,7 @@ sub download_cmd($) { } my $hash_cmd = hash_cmd(); +$hash_cmd or ($file_hash eq "skip") or die "Cannot find appropriate hash command, ensure the provided hash is either a MD5 or SHA256 checksum.\n"; sub download { diff --git a/scripts/feeds b/scripts/feeds index 55c294ad0a..f49cdb3e45 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -32,12 +32,14 @@ $valid_mk or die "Unsupported version of make found: $mk\n"; my @feeds; my %build_packages; my %installed; +my %installed_pkg; my %installed_targets; my %feed_cache; my $feed_package = {}; my $feed_src = {}; my $feed_target = {}; +my $feed_vpackage = {}; sub parse_config() { my $line = 0; @@ -223,20 +225,21 @@ sub get_feed($) { parse_package_metadata($file) or return; my %target = get_targets("./feeds/$feed.targetindex"); - $feed_cache{$feed} = [ { %package }, { %srcpackage }, { %target } ]; + $feed_cache{$feed} = [ { %package }, { %srcpackage }, { %target }, { %vpackage } ]; } $feed_package = $feed_cache{$feed}->[0]; $feed_src = $feed_cache{$feed}->[1]; $feed_target = $feed_cache{$feed}->[2]; - return $feed_cache{$feed}->[0]; + $feed_vpackage = $feed_cache{$feed}->[3]; } sub get_installed() { system("$mk -s prepare-tmpinfo OPENWRT_BUILD="); clear_packages(); parse_package_metadata("./tmp/.packageinfo"); - %installed = %package; + %installed_pkg = %vpackage; + %installed = %srcpackage; %installed_targets = get_targets("./tmp/.targetinfo"); } @@ -252,7 +255,6 @@ sub search_feed { my $substr; my $pkgmatch = 1; - next if $pkg->{vdepends}; foreach my $substr (@substr) { my $match; foreach my $key (qw(name title description src)) { @@ -306,7 +308,6 @@ sub list_feed { get_feed($feed); foreach my $name (sort { lc($a) cmp lc($b) } keys %$feed_package) { my $pkg = $feed_package->{$name}; - next if $pkg->{vdepends}; if($pkg->{name}) { printf "\%-32s\t\%s\n", $pkg->{name}, $pkg->{title}; } @@ -373,12 +374,12 @@ sub list { return 0; } -sub do_install_package($$) { +sub do_install_src($$) { my $feed = shift; - my $pkg = shift; - my $path = $pkg->{makefile}; + my $src = shift; - if($path) { + my $path = $src->{makefile}; + if ($path) { $path =~ s/\/Makefile$//; -d "./package/feeds" or mkdir "./package/feeds"; @@ -416,6 +417,18 @@ sub do_install_target($) { return 0; } +sub lookup_src($$) { + my $feed = shift; + my $src = shift; + + foreach my $feed ($feed, @feeds) { + next unless $feed->[1]; + next unless $feed_cache{$feed->[1]}; + $feed_cache{$feed->[1]}->[1]->{$src} and return $feed; + } + return; +} + sub lookup_package($$) { my $feed = shift; my $package = shift; @@ -423,7 +436,7 @@ sub lookup_package($$) { foreach my $feed ($feed, @feeds) { next unless $feed->[1]; next unless $feed_cache{$feed->[1]}; - $feed_cache{$feed->[1]}->[0]->{$package} and return $feed; + $feed_cache{$feed->[1]}->[3]->{$package} and return $feed; } return; } @@ -440,9 +453,9 @@ sub lookup_target($$) { return; } -sub is_core_package($) { - my $package = shift; - foreach my $file ("tmp/info/.packageinfo-$package", glob("tmp/info/.packageinfo-*_$package")) { +sub is_core_src($) { + my $src = shift; + foreach my $file ("tmp/info/.packageinfo-$src", glob("tmp/info/.packageinfo-*_$src")) { next unless index($file, "tmp/info/.packageinfo-feeds_"); return 1 if -s $file; } @@ -453,6 +466,8 @@ sub install_target { my $feed = shift; my $name = shift; + $installed_targets{$name} and return 0; + $feed = $feed_cache{$feed->[1]}->[2]; $feed or return 0; @@ -463,74 +478,71 @@ sub install_target { return do_install_target($target); } -sub install_package { +sub install_src { my $feed = shift; my $name = shift; my $force = shift; my $ret = 0; - my $this_feed_target = lookup_target($feed, $name); - $this_feed_target and do { - $installed_targets{$name} and return 0; - install_target($this_feed_target, $name); - return 0; - }; - - $feed = lookup_package($feed, $name); - $feed or do { + $feed = lookup_src($feed, $name); + unless ($feed) { $installed{$name} and return 0; - # TODO: check if it's already installed within ./package directory - $feed_src->{$name} or is_core_package($name) or warn "WARNING: No feed for package '$name' found, maybe it's already part of the standard packages?\n"; + $feed_src->{$name} or warn "WARNING: No feed for source package '$name' found\n"; return 0; - }; + } # switch to the metadata for the selected feed - my $cur = get_feed($feed->[1]); - - my $pkg = $cur->{$name} or return 1; - $pkg->{name} or do { - $installed{$name} and return 0; - # TODO: check if this is an alias package, maybe it's known by another name - warn "WARNING: Package '$name' is not available in feed $feed->[1].\n"; - return 0; - }; - my $src = $pkg->{src}; - my $type = $feed->[0]; - $src or $src = $name; + get_feed($feed->[1]); + my $src = $feed_src->{$name} or return 1; # If it's a core package and we don't want to override, just return - !$force and is_core_package($src) and return 0; + my $override = 0; + if (is_core_src($name)) { + return 0 unless $force; + $override = 1; + } - # previously installed packages set the runtime package - # newly installed packages set the source package to 1 - $installed{$src} and $installed{$src} == 1 and return 0; + if ($installed{$name}) { + # newly installed packages set the source package to 1 + return 0 if ($installed{$name} == 1); + return 0 unless ($override); + } - # we'll trigger the override only with the 3 conditions below: - # - override is allowed by command line (-f) - # - a package with the same src exists in the core packages list - # - the package previously installed is not from a feed - my $override = 1 if ($force and is_core_package($src) and !$installed{$name}->{feed}); + $installed{$name} = 1; + foreach my $pkg (@{$src->{packages}}) { + foreach my $vpkg (@{$pkg->{provides}}) { + $installed_pkg{$vpkg} = 1; + } + } - # check previously installed packages - $installed{$name} and !$override and return 0; - $installed{$src} = 1; + if ($override) { + warn "Overriding core package '$name' with version from $feed->[1]\n"; + } else { + warn "Installing package '$name' from $feed->[1]\n"; + } - defined($override) and $override == 1 - and warn "Overriding core package '$src' with version from $feed->[1]\n" - or warn "Installing package '$src' from $feed->[1]\n"; - - do_install_package($feed, $pkg) == 0 or do { + do_install_src($feed, $src) == 0 or do { warn "failed.\n"; return 1; }; # install all dependencies referenced from the source package - foreach my $vpkg (@{$feed_src->{$src}}) { - foreach my $dep (@{$vpkg->{depends}}, @{$vpkg->{builddepends}}, @{$vpkg->{"builddepends/host"}}) { + foreach my $dep ( + @{$src->{builddepends}}, + @{$src->{'builddepends/host'}}, + ) { + next if $dep =~ /@/; + $dep =~ s/^.+://; + $dep =~ s/\/.+$//; + next unless $dep; + install_src($feed, $dep, 0) == 0 or $ret = 1; + } + + foreach my $pkg (@{$src->{packages}}) { + foreach my $dep (@{$pkg->{depends}}) { next if $dep =~ /@/; $dep =~ s/^\+//; $dep =~ s/^.+://; - $dep =~ s/\/.+$//; next unless $dep; install_package($feed, $dep, 0) == 0 or $ret = 1; } @@ -539,6 +551,42 @@ sub install_package { return $ret; } +sub install_package { + my $feed = shift; + my $name = shift; + my $force = shift; + + $feed = lookup_package($feed, $name); + unless ($feed) { + $installed_pkg{$name} and return 0; + $feed_vpackage->{$name} or warn "WARNING: No feed for package '$name' found\n"; + return 0; + } + + # switch to the metadata for the selected feed + get_feed($feed->[1]); + my $pkg = $feed_vpackage->{$name} or return 1; + return install_src($feed, $pkg->[0]{src}{name}, $force); +} + +sub install_target_or_package { + my $feed = shift; + my $name = shift; + my $force = shift; + + my $this_feed_target = lookup_target($feed, $name); + $this_feed_target and do { + return install_target($this_feed_target, $name); + }; + + my $this_feed_src = lookup_src($feed, $name); + $this_feed_src and do { + return install_src($this_feed_src, $name, $force); + }; + + return install_package($feed, $name, $force); +} + sub refresh_config { my $default = shift; @@ -586,19 +634,15 @@ sub install { if (!defined($opts{p}) or $opts{p} eq $f->[1]) { printf "Installing all packages from feed %s.\n", $f->[1]; get_feed($f->[1]); - foreach my $name (sort { lc($a) cmp lc($b) } keys %$feed_package) { - my $p = $feed_package->{$name}; - next if $p->{vdepends}; - if( $p->{name} ) { - install_package($feed, $p->{name}, exists($opts{f})) == 0 or $ret = 1; - get_feed($f->[1]); - } + foreach my $name (sort { lc($a) cmp lc($b) } keys %$feed_src) { + install_src($feed, $name, exists($opts{f})) == 0 or $ret = 1; + get_feed($f->[1]); } } } } else { while ($name = shift @ARGV) { - install_package($feed, $name, exists($opts{f})) == 0 or $ret = 1; + install_target_or_package($feed, $name, exists($opts{f})) == 0 or $ret = 1; } } @@ -661,7 +705,7 @@ sub uninstall { warn "WARNING: $name not installed\n"; next; }; - $pkg->{src} and $name = $pkg->{src}; + $pkg->{src} and $name = $pkg->{src}{name}; warn "Uninstalling package '$name'\n"; system("rm -f ./package/feeds/*/$name"); $uninstall = 1; diff --git a/scripts/metadata.pm b/scripts/metadata.pm index d446892e2b..ea38735389 100644 --- a/scripts/metadata.pm +++ b/scripts/metadata.pm @@ -2,14 +2,12 @@ package metadata; use base 'Exporter'; use strict; use warnings; -our @EXPORT = qw(%package %srcpackage %category %subdir %preconfig %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames); +our @EXPORT = qw(%package %vpackage %srcpackage %category %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames); our %package; -our %preconfig; +our %vpackage; our %srcpackage; our %category; -our %subdir; -our %features; our %overrides; our @ignore; @@ -178,12 +176,10 @@ sub parse_target_metadata($) { } sub clear_packages() { - %subdir = (); - %preconfig = (); %package = (); + %vpackage = (); %srcpackage = (); %category = (); - %features = (); %overrides = (); %usernames = (); %groupnames = (); @@ -192,10 +188,6 @@ sub clear_packages() { sub parse_package_metadata($) { my $file = shift; my $pkg; - my $feature; - my $makefile; - my $preconfig; - my $subdir; my $src; my $override; my %ignore = map { $_ => 1 } @ignore; @@ -206,56 +198,44 @@ sub parse_package_metadata($) { }; while () { chomp; - /^Source-Makefile: \s*((.+\/)([^\/]+)\/Makefile)\s*$/ and do { - $makefile = $1; - $subdir = $2; - $src = $3; - $subdir =~ s/^package\///; - $subdir{$src} = $subdir; - $srcpackage{$src} = []; + /^Source-Makefile: \s*((?:package\/)?((?:.+\/)?([^\/]+))\/Makefile)\s*$/ and do { + $src = { + makefile => $1, + path => $2, + name => $3, + ignore => $ignore{$3}, + packages => [], + buildtypes => [], + builddepends => [], + }; + $srcpackage{$3} = $src; $override = ""; undef $pkg; }; /^Override: \s*(.+?)\s*$/ and do { $override = $1; - $overrides{$src} = 1; + $overrides{$src->{name}} = 1; }; next unless $src; /^Package:\s*(.+?)\s*$/ and do { - undef $feature; $pkg = {}; - $pkg->{ignore} = $ignore{$src}; $pkg->{src} = $src; - $pkg->{makefile} = $makefile; $pkg->{name} = $1; $pkg->{title} = ""; $pkg->{depends} = []; $pkg->{mdepends} = []; - $pkg->{builddepends} = []; - $pkg->{buildtypes} = []; - $pkg->{subdir} = $subdir; + $pkg->{provides} = [$1]; $pkg->{tristate} = 1; $pkg->{override} = $override; $package{$1} = $pkg; - push @{$srcpackage{$src}}, $pkg; - }; - /^Feature:\s*(.+?)\s*$/ and do { - undef $pkg; - $feature = {}; - $feature->{name} = $1; - $feature->{priority} = 0; - }; - $feature and do { - /^Target-Name:\s*(.+?)\s*$/ and do { - $features{$1} or $features{$1} = []; - push @{$features{$1}}, $feature unless $ignore{$src}; - }; - /^Target-Title:\s*(.+?)\s*$/ and $feature->{target_title} = $1; - /^Feature-Priority:\s*(\d+)\s*$/ and $feature->{priority} = $1; - /^Feature-Name:\s*(.+?)\s*$/ and $feature->{title} = $1; - /^Feature-Description:/ and $feature->{description} = get_multiline(\*FILE, "\t\t\t"); - next; + push @{$src->{packages}}, $pkg; + + $vpackage{$1} or $vpackage{$1} = []; + unshift @{$vpackage{$1}}, $pkg; }; + /^Build-Depends: \s*(.+)\s*$/ and $src->{builddepends} = [ split /\s+/, $1 ]; + /^Build-Depends\/(\w+): \s*(.+)\s*$/ and $src->{"builddepends/$1"} = [ split /\s+/, $2 ]; + /^Build-Types:\s*(.+)\s*$/ and $src->{buildtypes} = [ split /\s+/, $1 ]; next unless $pkg; /^Version: \s*(.+)\s*$/ and $pkg->{version} = $1; /^Title: \s*(.+)\s*$/ and $pkg->{title} = $1; @@ -268,15 +248,10 @@ sub parse_package_metadata($) { /^Default: \s*(.+)\s*$/ and $pkg->{default} = $1; /^Provides: \s*(.+)\s*$/ and do { my @vpkg = split /\s+/, $1; + @{$pkg->{provides}} = ($pkg->{name}, @vpkg); foreach my $vpkg (@vpkg) { - $package{$vpkg} or $package{$vpkg} = { - name => $vpkg, - vdepends => [], - src => $src, - subdir => $subdir, - makefile => $makefile - }; - push @{$package{$vpkg}->{vdepends}}, $pkg->{name}; + $vpackage{$vpkg} or $vpackage{$vpkg} = []; + push @{$vpackage{$vpkg}}, $pkg; } }; /^Menu-Depends: \s*(.+)\s*$/ and $pkg->{mdepends} = [ split /\s+/, $1 ]; @@ -286,15 +261,12 @@ sub parse_package_metadata($) { /^Build-Variant: \s*([\w\-]+)\s*/ and $pkg->{variant} = $1; /^Default-Variant: .*/ and $pkg->{variant_default} = 1; /^Build-Only: \s*(.+)\s*$/ and $pkg->{buildonly} = 1; - /^Build-Depends: \s*(.+)\s*$/ and $pkg->{builddepends} = [ split /\s+/, $1 ]; - /^Build-Depends\/(\w+): \s*(.+)\s*$/ and $pkg->{"builddepends/$1"} = [ split /\s+/, $2 ]; - /^Build-Types:\s*(.+)\s*$/ and $pkg->{buildtypes} = [ split /\s+/, $1 ]; /^Repository:\s*(.+?)\s*$/ and $pkg->{repository} = $1; /^Category: \s*(.+)\s*$/ and do { $pkg->{category} = $1; defined $category{$1} or $category{$1} = {}; - defined $category{$1}->{$src} or $category{$1}->{$src} = []; - push @{$category{$1}->{$src}}, $pkg; + defined $category{$1}{$src->{name}} or $category{$1}{$src->{name}} = []; + push @{$category{$1}{$src->{name}}}, $pkg; }; /^Description: \s*(.*)\s*$/ and $pkg->{description} = "\t\t $1\n". get_multiline(*FILE, "\t\t "); /^Type: \s*(.+)\s*$/ and do { @@ -306,29 +278,14 @@ sub parse_package_metadata($) { }; /^Config:\s*(.*)\s*$/ and $pkg->{config} = "$1\n".get_multiline(*FILE, "\t"); /^Prereq-Check:/ and $pkg->{prereq} = 1; - /^Preconfig:\s*(.+)\s*$/ and do { - my $pkgname = $pkg->{name}; - $preconfig{$pkgname} or $preconfig{$pkgname} = {}; - if (exists $preconfig{$pkgname}->{$1}) { - $preconfig = $preconfig{$pkgname}->{$1}; - } else { - $preconfig = { - id => $1 - }; - $preconfig{$pkgname}->{$1} = $preconfig unless $ignore{$src}; - } - }; - /^Preconfig-Type:\s*(.*?)\s*$/ and $preconfig->{type} = $1; - /^Preconfig-Label:\s*(.*?)\s*$/ and $preconfig->{label} = $1; - /^Preconfig-Default:\s*(.*?)\s*$/ and $preconfig->{default} = $1; /^Require-User:\s*(.*?)\s*$/ and do { my @ugspecs = split /\s+/, $1; for my $ugspec (@ugspecs) { my @ugspec = split /:/, $ugspec, 2; - parse_package_metadata_usergroup($makefile, "user", \%usernames, \%userids, $ugspec[0]) or return 0; + parse_package_metadata_usergroup($src->{makefile}, "user", \%usernames, \%userids, $ugspec[0]) or return 0; if (@ugspec > 1) { - parse_package_metadata_usergroup($makefile, "group", \%groupnames, \%groupids, $ugspec[1]) or return 0; + parse_package_metadata_usergroup($src->{makefile}, "group", \%groupnames, \%groupids, $ugspec[1]) or return 0; } } }; diff --git a/scripts/om-fwupgradecfg-gen.sh b/scripts/om-fwupgradecfg-gen.sh index a96adf9bc8..38e8e3ff3f 100755 --- a/scripts/om-fwupgradecfg-gen.sh +++ b/scripts/om-fwupgradecfg-gen.sh @@ -1,4 +1,4 @@ -#/bin/sh +#!/bin/sh # # Copyright (C) 2011 OpenWrt.org # @@ -7,7 +7,7 @@ # usage() { - echo "Usage: $0 " + echo "Usage: $0 " rm -f $CFG_OUT exit 1 } @@ -25,12 +25,24 @@ case $CE_TYPE in KERNEL_FLASH_ADDR=0x1c0000 FLASH_BS=262144 MD5_SKIP_BLOCKS=1 + SIZE_FACTOR=1 + SIZE_FORMAT="%d" ;; OM5P|OM5PAC|MR600|MR900|MR1750|A60) MAX_PART_SIZE=7808 KERNEL_FLASH_ADDR=0xb0000 FLASH_BS=65536 MD5_SKIP_BLOCKS=4 + SIZE_FACTOR=1 + SIZE_FORMAT="%d" + ;; + A42) + MAX_PART_SIZE=15616 + KERNEL_FLASH_ADDR=0x180000 + FLASH_BS=65536 + MD5_SKIP_BLOCKS=4 + SIZE_FACTOR=1024 + SIZE_FORMAT="0x%08x" ;; *) echo "Error - unsupported ce type: $CE_TYPE" @@ -43,16 +55,18 @@ CHECK_BS=65536 KERNEL_SIZE=$(stat -c%s "$KERNEL_PATH") KERNEL_MD5=$(mkhash md5 $KERNEL_PATH) KERNEL_SHA256=$(mkhash sha256 $KERNEL_PATH) -KERNEL_PART_SIZE=$(size=$(($KERNEL_SIZE / $FLASH_BS)); [ $(($size * $FLASH_BS)) -lt $KERNEL_SIZE ] && size=$(($size + 1)); echo $(($size * $FLASH_BS / 1024))) +KERNEL_PART_SIZE_KB=$(size=$(($KERNEL_SIZE / $FLASH_BS)); [ $(($size * $FLASH_BS)) -lt $KERNEL_SIZE ] && size=$(($size + 1)); echo $(($size * $FLASH_BS / 1024))) +KERNEL_PART_SIZE=$(printf $SIZE_FORMAT $(($KERNEL_PART_SIZE_KB * $SIZE_FACTOR))) -ROOTFS_FLASH_ADDR=$(addr=$(($KERNEL_FLASH_ADDR + ($KERNEL_PART_SIZE * 1024))); printf "0x%x" $addr) +ROOTFS_FLASH_ADDR=$(addr=$(($KERNEL_FLASH_ADDR + ($KERNEL_PART_SIZE_KB * 1024))); printf "0x%x" $addr) ROOTFS_SIZE=$(stat -c%s "$ROOTFS_PATH") ROOTFS_CHECK_BLOCKS=$((($ROOTFS_SIZE / $CHECK_BS) - $MD5_SKIP_BLOCKS)) ROOTFS_MD5=$(dd if=$ROOTFS_PATH bs=$CHECK_BS count=$ROOTFS_CHECK_BLOCKS 2>&- | mkhash md5) ROOTFS_MD5_FULL=$(mkhash md5 $ROOTFS_PATH) ROOTFS_SHA256_FULL=$(mkhash sha256 $ROOTFS_PATH) ROOTFS_CHECK_SIZE=$(printf '0x%x' $(($ROOTFS_CHECK_BLOCKS * $CHECK_BS))) -ROOTFS_PART_SIZE=$(($MAX_PART_SIZE - $KERNEL_PART_SIZE)) +ROOTFS_PART_SIZE_KB=$(($MAX_PART_SIZE - $KERNEL_PART_SIZE_KB)) +ROOTFS_PART_SIZE=$(printf $SIZE_FORMAT $(($ROOTFS_PART_SIZE_KB * $SIZE_FACTOR))) cat << EOF > $CFG_OUT [vmlinux] diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl index 261490b868..53bb45a62c 100755 --- a/scripts/package-metadata.pl +++ b/scripts/package-metadata.pl @@ -101,14 +101,16 @@ my %dep_check; sub __find_package_dep($$) { my $pkg = shift; my $name = shift; - my $deps = ($pkg->{vdepends} or $pkg->{depends}); + my $deps = $pkg->{depends}; return 0 unless defined $deps; - foreach my $dep (@{$deps}) { - next if $dep_check{$dep}; - $dep_check{$dep} = 1; - return 1 if $dep eq $name; - return 1 if ($package{$dep} and (__find_package_dep($package{$dep},$name) == 1)); + foreach my $vpkg (@{$deps}) { + foreach my $dep (@{$vpackage{$vpkg}}) { + next if $dep_check{$dep->{name}}; + $dep_check{$dep->{name}} = 1; + return 1 if $dep->{name} eq $name; + return 1 if (__find_package_dep($dep, $name) == 1); + } } return 0; } @@ -156,7 +158,6 @@ sub mconf_depends { my $m = "depends on"; my $flags = ""; $depend =~ s/^([@\+]+)// and $flags = $1; - my $vdep; my $condition = $parent_condition; next if $condition eq $depend; @@ -173,23 +174,21 @@ sub mconf_depends { } $depend = $2; } - next if $package{$depend} and $package{$depend}->{buildonly}; if ($flags =~ /\+/) { - if ($vdep = $package{$depend}->{vdepends}) { + my $vdep = $vpackage{$depend}; + if ($vdep) { my @vdeps; - $depend = undef; foreach my $v (@$vdep) { - if ($package{$v} && $package{$v}->{variant_default}) { - $depend = $v; + next if $v->{buildonly}; + if ($v->{variant_default}) { + unshift @vdeps, $v->{name}; } else { - push @vdeps, $v; + push @vdeps, $v->{name}; } } - if (!$depend) { - $depend = shift @vdeps; - } + $depend = shift @vdeps; if (@vdeps > 1) { $condition = ($condition ? "$condition && " : '') . '!('.join("||", map { "PACKAGE_".$_ } @vdeps).')'; @@ -209,8 +208,9 @@ sub mconf_depends { $flags =~ /@/ or $depend = "PACKAGE_$depend"; } else { - if ($vdep = $package{$depend}->{vdepends}) { - $depend = join("||", map { "PACKAGE_".$_ } @$vdep); + my $vdep = $vpackage{$depend}; + if ($vdep && @$vdep > 0) { + $depend = join("||", map { "PACKAGE_".$_->{name} } @$vdep); } else { $flags =~ /@/ or $depend = "PACKAGE_$depend"; } @@ -290,7 +290,7 @@ sub print_package_config_category($) { print "menu \"$menu\"\n"; } foreach my $pkg (@pkgs) { - next if $pkg->{ignore}; + next if $pkg->{src}{ignore}; my $title = $pkg->{name}; my $c = (72 - length($pkg->{name}) - length($pkg->{title})); if ($c > 0) { @@ -337,31 +337,6 @@ sub print_package_config_category($) { undef $category{$cat}; } -sub print_package_features() { - keys %features > 0 or return; - print "menu \"Package features\"\n"; - foreach my $n (keys %features) { - my @features = sort { $b->{priority} <=> $a->{priority} or $a->{title} cmp $b->{title} } @{$features{$n}}; - print <{target_title}" - default FEATURE_$features[0]->{name} -EOF - - foreach my $feature (@features) { - print <{name} - bool "$feature->{title}" -EOF - $feature->{description} =~ /\w/ and do { - print "\t\thelp\n".$feature->{description}."\n"; - }; - } - print "endchoice\n" - } - print "endmenu\n\n"; -} - sub print_package_overrides() { keys %overrides > 0 or return; print "\tconfig OVERRIDE_PKGS\n"; @@ -372,24 +347,10 @@ sub print_package_overrides() { sub gen_package_config() { parse_package_metadata($ARGV[0]) or exit 1; print "menuconfig IMAGEOPT\n\tbool \"Image configuration\"\n\tdefault n\n"; - foreach my $preconfig (keys %preconfig) { - foreach my $cfg (keys %{$preconfig{$preconfig}}) { - my $conf = $preconfig{$preconfig}->{$cfg}->{id}; - $conf =~ tr/\.-/__/; - print <{$cfg}->{label}" if IMAGEOPT - depends on PACKAGE_$preconfig - default "$preconfig{$preconfig}->{$cfg}->{default}" - -EOF - } - } print "source \"package/*/image-config.in\"\n"; if (scalar glob "package/feeds/*/*/image-config.in") { print "source \"package/feeds/*/*/image-config.in\"\n"; } - print_package_features(); print_package_config_category 'Base system'; foreach my $cat (sort {uc($a) cmp uc($b)} keys %category) { print_package_config_category $cat; @@ -412,54 +373,88 @@ sub get_conditional_dep($$) { } sub gen_package_mk() { - my %conf; - my %dep; - my %done; my $line; parse_package_metadata($ARGV[0]) or exit 1; - foreach my $name (sort {uc($a) cmp uc($b)} keys %package) { - my $config; - my $pkg = $package{$name}; - my @srcdeps; + foreach my $srcname (sort {uc($a) cmp uc($b)} keys %srcpackage) { + my $src = $srcpackage{$srcname}; + my $variant_default; + my %deplines = ('' => {}); - next if defined $pkg->{vdepends}; + foreach my $pkg (@{$src->{packages}}) { + foreach my $dep (@{$pkg->{depends}}) { + next if ($dep =~ /@/); - $config = "\$(CONFIG_PACKAGE_$name)"; - if ($config) { - $pkg->{buildonly} and $config = ""; - print "package-$config += $pkg->{subdir}$pkg->{src}\n"; - if ($pkg->{variant}) { - if (!defined($done{$pkg->{src}}) or $pkg->{variant_default}) { - print "\$(curdir)/$pkg->{subdir}$pkg->{src}/default-variant := $pkg->{variant}\n"; + my $condition; + + $dep =~ s/\+//g; + if ($dep =~ /^(.+):(.+)/) { + $condition = $1; + $dep = $2; + } + + my $vpkg_dep = $vpackage{$dep}; + unless (defined $vpkg_dep) { + warn sprintf "WARNING: Makefile '%s' has a dependency on '%s', which does not exist\n", + $src->{makefile}, $dep; + next; + } + + # Filter out self-depends + my @vdeps = grep { $srcname ne $_->{src}{name} } @{$vpkg_dep}; + + foreach my $vdep (@vdeps) { + my $depstr = sprintf '$(curdir)/%s/compile', $vdep->{src}{path}; + if (@vdeps > 1) { + $depstr = sprintf '$(if $(CONFIG_PACKAGE_%s),%s)', $vdep->{name}, $depstr; + } + my $depline = get_conditional_dep($condition, $depstr); + if ($depline) { + $deplines{''}{$depline}++; + } } - print "\$(curdir)/$pkg->{subdir}$pkg->{src}/variants += \$(if $config,$pkg->{variant})\n" } - $pkg->{prereq} and print "prereq-$config += $pkg->{subdir}$pkg->{src}\n"; - } - next if $done{$pkg->{src}}; - $done{$pkg->{src}} = 1; + my $config = ''; + $config = sprintf '$(CONFIG_PACKAGE_%s)', $pkg->{name} unless $pkg->{buildonly}; - if (@{$pkg->{buildtypes}} > 0) { - print "buildtypes-$pkg->{subdir}$pkg->{src} = ".join(' ', @{$pkg->{buildtypes}})."\n"; - } + $pkg->{prereq} and printf "prereq-%s += %s\n", $config, $src->{path}; - foreach my $spkg (@{$srcpackage{$pkg->{src}}}) { - foreach my $dep (@{$spkg->{depends}}, @{$spkg->{builddepends}}) { - $dep =~ /@/ or do { - $dep =~ s/\+//g; - push @srcdeps, $dep; - }; + next if $pkg->{buildonly}; + + printf "package-%s += %s\n", $config, $src->{path}; + + if ($pkg->{variant}) { + if (!defined($variant_default) or $pkg->{variant_default}) { + $variant_default = $pkg->{variant}; + } + printf "\$(curdir)/%s/variants += \$(if %s,%s)\n", $src->{path}, $config, $pkg->{variant}; } } - foreach my $type (@{$pkg->{buildtypes}}) { - my @extra_deps; - my %deplines; - next unless $pkg->{"builddepends/$type"}; - foreach my $dep (@{$pkg->{"builddepends/$type"}}) { - my $suffix = ""; + if (defined($variant_default)) { + printf "\$(curdir)/%s/default-variant := %s\n", $src->{path}, $variant_default; + } + + unless (grep {!$_->{buildonly}} @{$src->{packages}}) { + printf "package- += %s\n", $src->{path}; + } + + if (@{$src->{buildtypes}} > 0) { + printf "buildtypes-%s = %s\n", $src->{path}, join(' ', @{$src->{buildtypes}}); + } + + foreach my $type ('', @{$src->{buildtypes}}) { + my $suffix = ''; + + $suffix = "/$type" if $type; + + next unless $src->{"builddepends$suffix"}; + + defined $deplines{$suffix} or $deplines{$suffix} = {}; + + foreach my $dep (@{$src->{"builddepends$suffix"}}) { + my $depsuffix = ""; my $deptype = ""; my $condition; @@ -470,136 +465,37 @@ sub gen_package_mk() { if ($dep =~ /^(.+)\/(.+)/) { $dep = $1; $deptype = $2; - $suffix = "/$2"; + $depsuffix = "/$2"; } - my $idx = ""; - my $pkg_dep = $package{$dep}; - if (defined($pkg_dep) && defined($pkg_dep->{src})) { - unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{buildtypes}}) { - warn sprintf "WARNING: Makefile '%s' has a %s build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n", - $pkg->{makefile}, $type, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype; - next; - } - $idx = $pkg_dep->{subdir}.$pkg_dep->{src}; - } elsif (defined($srcpackage{$dep})) { - $idx = $subdir{$dep}.$dep; - } else { + next if $srcname.$suffix eq $dep.$depsuffix; + + my $src_dep = $srcpackage{$dep}; + unless (defined($src_dep) && (!$deptype || grep { $_ eq $deptype } @{$src_dep->{buildtypes}})) { + warn sprintf "WARNING: Makefile '%s' has a build dependency on '%s', which does not exist\n", + $src->{makefile}, $dep.$depsuffix; next; } - my $depstr = "\$(curdir)/$idx$suffix/compile"; + + my $depstr = sprintf '$(curdir)/%s/compile', $src_dep->{path}.$depsuffix; my $depline = get_conditional_dep($condition, $depstr); if ($depline) { - $deplines{$depline}++; + $deplines{$suffix}{$depline}++; } } - my $depline = join(" ", sort keys %deplines); + } + + foreach my $suffix (sort keys %deplines) { + my $depline = join(" ", sort keys %{$deplines{$suffix}}); if ($depline) { - $line .= "\$(curdir)/".$pkg->{subdir}."$pkg->{src}/$type/compile += $depline\n"; + $line .= sprintf "\$(curdir)/%s/compile += %s\n", $src->{path}.$suffix, $depline; } } - - my $hasdeps = 0; - my %deplines; - foreach my $deps (@srcdeps) { - my $idx; - my $condition; - my $prefix = ""; - my $suffix = ""; - my $deptype = ""; - - if ($deps =~ /^(.+):(.+)/) { - $condition = $1; - $deps = $2; - } - if ($deps =~ /^(.+)\/(.+)/) { - $deps = $1; - $deptype = $2; - $suffix = "/$2"; - } - - my $pkg_dep = $package{$deps}; - my @deps; - - if ($pkg_dep->{vdepends}) { - @deps = @{$pkg_dep->{vdepends}}; - } else { - @deps = ($deps); - } - - foreach my $dep (@deps) { - $pkg_dep = $package{$deps}; - if (defined $pkg_dep->{src}) { - unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{buildtypes}}) { - warn sprintf "WARNING: Makefile '%s' has a build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n", - $pkg->{makefile}, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype; - next; - } - unless ($pkg->{src} ne $pkg_dep->{sec}.$suffix) { - warn sprintf "WARNING: Makefile '%s' has a build dependency on itself\n", - $pkg->{makefile}; - next; - } - $idx = $pkg_dep->{subdir}.$pkg_dep->{src}; - } elsif (defined($srcpackage{$dep})) { - $idx = $subdir{$dep}.$dep; - } - undef $idx if $idx eq 'base-files'; - if ($idx) { - $idx .= $suffix; - - my $depline; - next if $pkg->{src} eq $pkg_dep->{src}.$suffix; - next if $dep{$condition.":".$pkg->{src}."->".$idx}; - next if $dep{$pkg->{src}."->($dep)".$idx} and $pkg_dep->{vdepends}; - my $depstr; - - if ($pkg_dep->{vdepends}) { - $depstr = "\$(if \$(CONFIG_PACKAGE_$dep),\$(curdir)/$idx/compile)"; - $dep{$pkg->{src}."->($dep)".$idx} = 1; - } else { - $depstr = "\$(curdir)/$idx/compile"; - $dep{$pkg->{src}."->".$idx} = 1; - } - $depline = get_conditional_dep($condition, $depstr); - if ($depline) { - $deplines{$depline}++; - } - } - } - } - my $depline = join(" ", sort keys %deplines); - if ($depline) { - $line .= "\$(curdir)/".$pkg->{subdir}."$pkg->{src}/compile += $depline\n"; - } } if ($line ne "") { print "\n$line"; } - foreach my $preconfig (keys %preconfig) { - my $cmds; - foreach my $cfg (keys %{$preconfig{$preconfig}}) { - my $conf = $preconfig{$preconfig}->{$cfg}->{id}; - $conf =~ tr/\.-/__/; - $cmds .= "\techo \"uci set '$preconfig{$preconfig}->{$cfg}->{id}=\$(subst \",,\$(CONFIG_UCI_PRECONFIG_$conf))'\"; \\\n"; - } - next unless $cmds; - print < \$@ - -ifneq (\$(IMAGEOPT)\$(CONFIG_IMAGEOPT),) - package/preconfig: \$(TARGET_DIR)/etc/uci-defaults/$preconfig -endif -endif - -EOF - } } sub gen_package_source() { @@ -638,7 +534,7 @@ sub gen_package_license($) { } else { if ($level == 1) { print "$pkg->{name}: Missing license! "; - print "Please fix $pkg->{makefile}\n"; + print "Please fix $pkg->{src}{makefile}\n"; } } } diff --git a/scripts/qemustart b/scripts/qemustart index 5cadd7d6a8..6c2254e3af 100755 --- a/scripts/qemustart +++ b/scripts/qemustart @@ -107,8 +107,8 @@ Examples $SELF malta le64 $SELF malta be-glibc $SELF armvirt 32 \\ - --kernel bin/targets/armvirt/32/lede-armvirt-32-zImage \\ - --rootfs bin/targets/armvirt/32/lede-armvirt-32-root.ext4 + --kernel bin/targets/armvirt/32/openwrt-armvirt-32-zImage \\ + --rootfs bin/targets/armvirt/32/openwrt-armvirt-32-root.ext4 EOF } @@ -158,12 +158,12 @@ start_qemu_armvirt() { 32) qemu_exe="qemu-system-arm" cpu="cortex-a15" - [ -n "$kernel" ] || kernel="$o_bindir/lede-$o_target-${o_subtarget%-*}-zImage-initramfs" + [ -n "$kernel" ] || kernel="$o_bindir/openwrt-$o_target-${o_subtarget%-*}-zImage-initramfs" ;; 64) qemu_exe="qemu-system-aarch64" cpu="cortex-a57" - [ -n "$kernel" ] || kernel="$o_bindir/lede-$o_target-${o_subtarget%-*}-Image-initramfs" + [ -n "$kernel" ] || kernel="$o_bindir/openwrt-$o_target-${o_subtarget%-*}-Image-initramfs" ;; *) __errmsg "target $o_target: unknown subtarget $o_subtarget" @@ -199,7 +199,7 @@ start_qemu_malta() { [ "$(echo "$o_subtarget" | grep -o '^..')" = "le" ] && isel="el" qemu_exe="qemu-system-mips$is64$isel" - [ -n "$kernel" ] || kernel="$o_bindir/lede-malta-${o_subtarget%-*}-vmlinux-initramfs.elf" + [ -n "$kernel" ] || kernel="$o_bindir/openwrt-malta-${o_subtarget%-*}-vmlinux-initramfs.elf" # NOTE: order of wan, lan -device arguments matters as it will affect which # one will be actually used as the wan, lan network interface inside the @@ -216,7 +216,7 @@ start_qemu_x86() { local qemu_exe [ -n "$rootfs" ] || { - rootfs="$o_bindir/lede-$o_target-${o_subtarget%-*}-combined-ext4.img" + rootfs="$o_bindir/openwrt-$o_target-${o_subtarget%-*}-combined-ext4.img" if [ ! -f "$rootfs" -a -s "$rootfs.gz" ]; then gunzip "$rootfs.gz" fi diff --git a/target/Config.in b/target/Config.in index cb876c6af2..3aef76890d 100644 --- a/target/Config.in +++ b/target/Config.in @@ -199,6 +199,7 @@ config ARCH default "mips64" if mips64 default "mips64el" if mips64el default "powerpc" if powerpc + default "powerpc64" if powerpc64 default "sh3" if sh3 default "sh3eb" if sh3eb default "sh4" if sh4 diff --git a/target/imagebuilder/Config.in b/target/imagebuilder/Config.in index 49bb741f73..c1a5212f6d 100644 --- a/target/imagebuilder/Config.in +++ b/target/imagebuilder/Config.in @@ -1,5 +1,5 @@ config IB - bool "Build the LEDE Image Builder" + bool "Build the OpenWrt Image Builder" depends on !EXTERNAL_TOOLCHAIN default BUILDBOT help diff --git a/target/imagebuilder/files/repositories.conf b/target/imagebuilder/files/repositories.conf index 93ed97b290..8f1f27fe50 100644 --- a/target/imagebuilder/files/repositories.conf +++ b/target/imagebuilder/files/repositories.conf @@ -1,4 +1,4 @@ ## Place your custom repositories here, they must match the architecture and version. # src/gz %n %U -# src custom file:///usr/src/lede/bin/%T/packages +# src custom file:///usr/src/openwrt/bin/%T/packages diff --git a/target/linux/apm821xx/Makefile b/target/linux/apm821xx/Makefile index 6d711543c4..c3253322f2 100644 --- a/target/linux/apm821xx/Makefile +++ b/target/linux/apm821xx/Makefile @@ -13,7 +13,7 @@ MAINTAINER:=Chris Blake , \ Christian Lamparter SUBTARGETS:=nand sata -KERNEL_PATCHVER:=4.9 +KERNEL_PATCHVER:=4.14 define Target/Description Build images for AppliedMicro APM821xx based boards. diff --git a/target/linux/apm821xx/base-files/etc/board.d/01_leds b/target/linux/apm821xx/base-files/etc/board.d/01_leds index 3b5fb721ae..c218efa49b 100755 --- a/target/linux/apm821xx/base-files/etc/board.d/01_leds +++ b/target/linux/apm821xx/base-files/etc/board.d/01_leds @@ -7,7 +7,7 @@ board_config_update board=$(board_name) case "$board" in -mr24) +meraki,mr24) ucidef_set_led_netdev "wan" "WAN" "mr24:green:wan" "eth0" ucidef_set_led_wlan "wlan1" "WLAN1" "mr24:green:wifi1" "phy0assoc" ucidef_set_led_wlan "wlan2" "WLAN2" "mr24:green:wifi2" "phy0assoc" @@ -15,7 +15,7 @@ mr24) ucidef_set_led_wlan "wlan4" "WLAN4" "mr24:green:wifi4" "phy0tpt" ;; -mx60) +meraki,mx60) ucidef_set_led_switch "wan" "WAN" "mx60:green:wan" "switch0" "0x20" ucidef_set_led_switch "lan1" "LAN1" "mx60:green:lan1" "switch0" "0x10" ucidef_set_led_switch "lan2" "LAN2" "mx60:green:lan2" "switch0" "0x08" @@ -23,11 +23,12 @@ mx60) ucidef_set_led_switch "lan4" "LAN4" "mx60:green:lan4" "switch0" "0x02" ;; -mbl) +wd,mybooklive|\ +wd,mybooklive-duo) ucidef_set_led_ide "sata" "SATA" "mbl:blue:power" ;; -wndr4700) +netgear,wndr4700) ucidef_set_led_ide "sata" "SATA" "wndr4700:green:hd" ucidef_set_led_switch "wan_green" "WAN (green)" "wndr4700:green:wan" "switch0" "0x20" ucidef_set_led_netdev "wan_yellow" "WAN (yellow)" "wndr4700:yellow:wan" "eth0.2" "tx rx" diff --git a/target/linux/apm821xx/base-files/etc/board.d/02_network b/target/linux/apm821xx/base-files/etc/board.d/02_network index 03df7cb49f..6f4456e8a1 100755 --- a/target/linux/apm821xx/base-files/etc/board.d/02_network +++ b/target/linux/apm821xx/base-files/etc/board.d/02_network @@ -8,13 +8,14 @@ board_config_update board=$(board_name) case "$board" in -mbl|\ -mr24) +meraki,mr24|\ +wd,mybooklive|\ +wd,mybooklive-duo) ucidef_set_interface_lan "eth0" ;; -mx60|\ -wndr4700) +meraki,mx60|\ +netgear,wndr4700) ucidef_add_switch "switch0" \ "0@eth0" "4:lan" "3:lan" "2:lan" "1:lan" "5:wan" ;; diff --git a/target/linux/apm821xx/base-files/etc/diag.sh b/target/linux/apm821xx/base-files/etc/diag.sh index eb9b04b525..26c035c6f3 100755 --- a/target/linux/apm821xx/base-files/etc/diag.sh +++ b/target/linux/apm821xx/base-files/etc/diag.sh @@ -3,40 +3,42 @@ . /lib/functions.sh . /lib/functions/leds.sh -get_status_led() { - local board=$(board_name) - - case $board in - mbl|\ - mr24|\ - mx60|\ - wndr4700) - status_led="$board:green:power" - ;; - - *) - ;; - esac -} +boot="$(get_dt_led boot)" +failsafe="$(get_dt_led failsafe)" +running="$(get_dt_led running)" +upgrade="$(get_dt_led upgrade)" set_state() { - get_status_led + status_led="$boot" case "$1" in - preinit) - status_led_blink_preinit - ;; - - failsafe) - status_led_blink_failsafe - ;; - preinit_regular) status_led_blink_preinit_regular ;; - + preinit) + status_led_blink_preinit + ;; + failsafe) + status_led_off + [ -n "$running" ] && { + status_led="$running" + status_led_off + } + status_led="$failsafe" + status_led_blink_failsafe + ;; + upgrade) + [ -n "$running" ] && { + status_led="$upgrade" + status_led_blink_preinit_regular + } + ;; done) - status_led_on + status_led_off + [ -n "$running" ] && { + status_led="$running" + status_led_on + } ;; esac } diff --git a/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 4a7e1c0b19..7a13a0afa8 100644 --- a/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -52,7 +52,7 @@ board=$(board_name) case "$FIRMWARE" in "pci_wmac0.eeprom") case $board in - wndr4700) + netgear,wndr4700) . /lib/upgrade/nand.sh if [ -n "$(nand_find_volume ubi0 caldata)" ]; then @@ -70,7 +70,7 @@ case "$FIRMWARE" in "pci_wmac1.eeprom") case $board in - wndr4700) + netgear,wndr4700) . /lib/upgrade/nand.sh if [ -n "$(nand_find_volume ubi0 caldata)" ]; then diff --git a/target/linux/apm821xx/base-files/lib/apm821xx.sh b/target/linux/apm821xx/base-files/lib/apm821xx.sh deleted file mode 100755 index 8f0814b296..0000000000 --- a/target/linux/apm821xx/base-files/lib/apm821xx.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - -APM821XX_BOARD_NAME= -APM821XX_MODEL= - -apm821xx_board_detect() { - local model - local name - - model=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /model/ {print $2}' /proc/cpuinfo) - - case "$model" in - *"Meraki MR24 Access Point") - name="mr24" - ;; - - *"Meraki MX60/MX60W Security Appliance") - name="mx60" - ;; - - *"MyBook Live"*) - name="mbl" - ;; - - *"Netgear WNDR4700/WNDR4720 Series") - name="wndr4700" - ;; - - *) - name="unknown" - ;; - esac - - [ -z "$name" ] && name="unknown" - - [ -z "$APM821XX_BOARD_NAME" ] && APM821XX_BOARD_NAME="$name" - [ -z "$APM821XX_MODEL" ] && APM821XX_MODEL="$model" - - [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" - - echo "$APM821XX_BOARD_NAME" > /tmp/sysinfo/board_name - echo "$APM821XX_MODEL" > /tmp/sysinfo/model -} diff --git a/target/linux/apm821xx/base-files/lib/preinit/01_preinit_do_apm821xx.sh b/target/linux/apm821xx/base-files/lib/preinit/01_preinit_do_apm821xx.sh deleted file mode 100644 index 5675357533..0000000000 --- a/target/linux/apm821xx/base-files/lib/preinit/01_preinit_do_apm821xx.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -do_apm821xx() { - . /lib/apm821xx.sh - - apm821xx_board_detect -} - -boot_hook_add preinit_main do_apm821xx diff --git a/target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx b/target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx index ec540feb84..1a27930d24 100644 --- a/target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx +++ b/target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx @@ -4,8 +4,8 @@ preinit_set_mac_address() { . /lib/functions.sh case $(board_name) in - mr24|\ - mx60) + meraki,mr24|\ + meraki,mx60) mac_lan=$(mtd_get_mac_binary_ubi board-config 102) [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan" ;; diff --git a/target/linux/apm821xx/base-files/lib/preinit/05_set_preinit_iface_apm821xx b/target/linux/apm821xx/base-files/lib/preinit/05_set_preinit_iface_apm821xx index 97ef6dc68f..a15a055a25 100644 --- a/target/linux/apm821xx/base-files/lib/preinit/05_set_preinit_iface_apm821xx +++ b/target/linux/apm821xx/base-files/lib/preinit/05_set_preinit_iface_apm821xx @@ -1,7 +1,5 @@ #!/bin/sh -. /lib/apm821xx.sh - apm821xx_set_preinit_iface() { ifname=eth0 } diff --git a/target/linux/apm821xx/base-files/lib/preinit/79_move_config b/target/linux/apm821xx/base-files/lib/preinit/79_move_config index 3ca8b0a71c..5d33feb916 100644 --- a/target/linux/apm821xx/base-files/lib/preinit/79_move_config +++ b/target/linux/apm821xx/base-files/lib/preinit/79_move_config @@ -5,12 +5,18 @@ BOOTPART=/dev/sda1 move_config() { . /lib/functions.sh - [ "$(board_name)" = "mbl" ] || return - if [ -b $BOOTPART ]; then - mkdir -p /boot - mount -t ext4 -o rw,noatime $BOOTPART /boot - [ -f /boot/sysupgrade.tgz ] && mv -f /boot/sysupgrade.tgz / - fi + case "$(board_name)" in + wd,mybooklive|\ + wd,mybooklive-duo) + if [ -b $BOOTPART ]; then + mkdir -p /boot + mount -t ext4 -o rw,noatime $BOOTPART /boot + [ -f /boot/sysupgrade.tgz ] && mv -f /boot/sysupgrade.tgz / + fi + ;; + *) + ;; + esac } boot_hook_add preinit_mount_root move_config diff --git a/target/linux/apm821xx/base-files/lib/upgrade/merakinand.sh b/target/linux/apm821xx/base-files/lib/upgrade/merakinand.sh deleted file mode 100755 index fb961b8945..0000000000 --- a/target/linux/apm821xx/base-files/lib/upgrade/merakinand.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2016 Chris Blake -# -# Custom upgrade script for Meraki NAND devices (ex. MR24) -# Based on merakinand.sh from the ar71xx target -# -. /lib/apm821xx.sh -. /lib/functions.sh - -merakinand_do_kernel_check() { - local board_name="$1" - local tar_file="$2" - local image_magic_word=`(tar xf $tar_file sysupgrade-$board_name/kernel -O 2>/dev/null | dd bs=1 count=4 skip=0 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"')` - - # What is our kernel magic string? - case "$board_name" in - "mr24"|\ - "mx60") - [ "$image_magic_word" == "8e73ed8a" ] && { - echo "pass" && return 0 - } - ;; - esac - - exit 1 -} - -merakinand_do_platform_check() { - local board_name="$1" - local tar_file="$2" - local control_length=`(tar xf $tar_file sysupgrade-$board_name/CONTROL -O | wc -c) 2> /dev/null` - local file_type="$(identify_tar $2 sysupgrade-$board_name/root)" - local kernel_magic="$(merakinand_do_kernel_check $1 $2)" - - case "$board_name" in - "mr24"|\ - "mx60") - [ "$control_length" = 0 -o "$file_type" != "squashfs" -o "$kernel_magic" != "pass" ] && { - echo "Invalid sysupgrade file for $board_name" - return 1 - } - ;; - *) - echo "Unsupported device $board_name"; - return 1 - ;; - esac - - return 0 -} - -merakinand_do_upgrade() { - local tar_file="$1" - local board_name="$(board_name)" - - # Do we need to do any platform tweaks? - case "$board_name" in - "mr24"|\ - "mx60") - nand_do_upgrade $1 - ;; - *) - echo "Unsupported device $board_name"; - exit 1 - ;; - esac -} diff --git a/target/linux/apm821xx/base-files/lib/upgrade/platform.sh b/target/linux/apm821xx/base-files/lib/upgrade/platform.sh index 55f8ffa75d..5d2eee4ca3 100755 --- a/target/linux/apm821xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/apm821xx/base-files/lib/upgrade/platform.sh @@ -1,47 +1,30 @@ #!/bin/sh PART_NAME=firmware +REQUIRE_IMAGE_METADATA=1 platform_check_image() { local board=$(board_name) - [ "$#" -gt 1 ] && return 1 - case "$board" in - mbl) - mbl_do_platform_check $board "$1" + wd,mybooklive|\ + wd,mybooklive-duo) + mbl_do_platform_check "$1" return $?; ;; - - mr24|\ - mx60) - merakinand_do_platform_check $board "$1" - return $?; - ;; - - wndr4700) - nand_do_platform_check $board "$1" - return $?; - ;; - *) + return 0 ;; esac - - echo "Sysupgrade is not yet supported on $board." - return 1 } platform_pre_upgrade() { local board=$(board_name) case "$board" in - mr24|\ - mx60) - merakinand_do_upgrade "$1" - ;; - - wndr4700) + meraki,mr24|\ + meraki,mx60|\ + netgear,wndr4700) nand_do_upgrade "$1" ;; @@ -54,7 +37,8 @@ platform_do_upgrade() { local board=$(board_name) case "$board" in - mbl) + wd,mybooklive|\ + wd,mybooklive-duo) mbl_do_upgrade "$ARGV" ;; @@ -68,7 +52,8 @@ platform_copy_config() { local board=$(board_name) case "$board" in - mbl) + wd,mybooklive|\ + wd,mybooklive-duo) mbl_copy_config ;; diff --git a/target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh b/target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh index d7347516cb..2287e0619d 100644 --- a/target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh +++ b/target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh @@ -1,36 +1,99 @@ . /lib/functions.sh -get_magic_at() { - local file="$1" - local pos="$2" - get_image "$file" | dd bs=1 count=2 skip="$pos" 2>/dev/null | hexdump -v -n 2 -e '1/1 "%02x"' -} +# copied from x86's platform.sh mbl_do_platform_check() { - local board="$1" - local file="$2" - local magic + local diskdev partdev diff - magic=$(get_magic_at "$file" 510) + [ "$#" -gt 1 ] && return 1 - [ "$magic" != "55aa" ] && { - echo "Failed to verify MBR boot signature." + export_bootdevice && export_partdevice diskdev -2 || { + echo "Unable to determine upgrade device" return 1 } + get_partitions "/dev/$diskdev" bootdisk + + #extract the boot sector from the image + get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b 2>/dev/null + + get_partitions /tmp/image.bs image + + #compare tables + diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)" + + rm -f /tmp/image.bs /tmp/partmap.bootdisk /tmp/partmap.image + + if [ -n "$diff" ]; then + echo "Partition layout has changed. Full image will be written." + ask_bool 0 "Abort" && exit 1 + return 0 + fi + return 0; } mbl_do_upgrade() { + local diskdev partdev diff + + export_bootdevice && export_partdevice diskdev -2 || { + echo "Unable to determine upgrade device" + return 1 + } + sync - get_image "$1" | dd of=/dev/sda bs=2M conv=fsync - sleep 1 + + if [ "$SAVE_PARTITIONS" = "1" ]; then + get_partitions "/dev/$diskdev" bootdisk + + #extract the boot sector from the image + get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b + + get_partitions /tmp/image.bs image + + #compare tables + diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)" + else + diff=1 + fi + + if [ -n "$diff" ]; then + get_image "$@" | dd of="/dev/$diskdev" bs=4096 conv=fsync + + # Separate removal and addtion is necessary; otherwise, partition 1 + # will be missing if it overlaps with the old partition 2 + partx -d - "/dev/$diskdev" + partx -a - "/dev/$diskdev" + + return 0 + fi + + #iterate over each partition from the image and write it to the boot disk + while read part start size; do + # root is /dev/sd[a|b]2 and not /dev/sd[a|b] this causes some problem + # one of which is this offset, I'm not sure what's the best fix, so + # here's a WA. + let part=$((part - 2)) + if export_partdevice partdev $part; then + echo "Writing image to /dev/$partdev..." + get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync + else + echo "Unable to find partition $part device, skipped." + fi + done < /tmp/partmap.image + + #copy partition uuid + echo "Writing new UUID to /dev/$diskdev..." + get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync } mbl_copy_config() { - mkdir -p /boot - [ -f /boot/uImage ] || mount -t ext4 -o rw,noatime /dev/sda1 /boot - cp -af "$CONF_TAR" /boot/ - sync - umount /boot + local partdev + + # Same as above /dev/sd[a|b]2 is root, so /boot is -1 + if export_partdevice partdev -1; then + mount -t ext4 -o rw,noatime "/dev/$partdev" /mnt + cp -af "$CONF_TAR" /mnt/ + umount /mnt + fi } diff --git a/target/linux/apm821xx/config-4.9 b/target/linux/apm821xx/config-4.14 similarity index 84% rename from target/linux/apm821xx/config-4.9 rename to target/linux/apm821xx/config-4.14 index c1c47a7bdd..feaba21eb4 100644 --- a/target/linux/apm821xx/config-4.9 +++ b/target/linux/apm821xx/config-4.14 @@ -12,15 +12,24 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y CONFIG_ARCH_HAS_DMA_SET_COHERENT_MASK=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_ARCH_HAS_FORTIFY_SOURCE=y CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y -CONFIG_ARCH_HAS_ILOG2_U32=y CONFIG_ARCH_HAS_SG_CHAIN=y +CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y +# CONFIG_ARCH_HAS_STRICT_MODULE_RWX is not set CONFIG_ARCH_HAS_WALK_MEMORY=y CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y +CONFIG_ARCH_MMAP_RND_BITS=11 +CONFIG_ARCH_MMAP_RND_BITS_MAX=17 +CONFIG_ARCH_MMAP_RND_BITS_MIN=11 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=17 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 +CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y +# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set CONFIG_ARCH_PHYS_ADDR_T_64BIT=y # CONFIG_ARCH_RANDOM is not set CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y @@ -29,7 +38,9 @@ CONFIG_ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT=y CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_USE_BUILTIN_BSWAP=y +# CONFIG_ARCH_WANTS_THP_SWAP is not set CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ARCH_WEAK_RELEASE_ACQUIRE=y CONFIG_AUDIT_ARCH=y # CONFIG_BAMBOO is not set CONFIG_BCH=y @@ -44,20 +55,45 @@ CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE="rootfstype=squashfs noinitrd" CONFIG_CMDLINE_BOOL=y CONFIG_CONSISTENT_SIZE=0x00200000 +CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7 CONFIG_CPU_BIG_ENDIAN=y CONFIG_CRC16=y +CONFIG_CRYPTO_ACOMP2=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_CCM=y +CONFIG_CRYPTO_CTR=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_DEV_PPC4XX=y +CONFIG_CRYPTO_DRBG=y +CONFIG_CRYPTO_DRBG_HMAC=y +CONFIG_CRYPTO_DRBG_MENU=y +CONFIG_CRYPTO_GCM=y +CONFIG_CRYPTO_GF128MUL=y +CONFIG_CRYPTO_GHASH=y CONFIG_CRYPTO_HASH=y CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_JITTERENTROPY=y CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y CONFIG_CRYPTO_MD5_PPC=y +CONFIG_CRYPTO_NULL=y +CONFIG_CRYPTO_NULL2=y +CONFIG_CRYPTO_RNG=y CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_RNG_DEFAULT=y +CONFIG_CRYPTO_SEQIV=y CONFIG_CRYPTO_SHA1_PPC=y +CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_WORKQUEUE=y CONFIG_DECOMPRESS_GZIP=y # CONFIG_DEFAULT_UIMAGE is not set +# CONFIG_DMA_NOOP_OPS is not set +# CONFIG_DMA_VIRT_OPS is not set +# CONFIG_DRM_LIB_RANDOM is not set CONFIG_DTC=y # CONFIG_E200 is not set CONFIG_EARLY_PRINTK=y @@ -66,11 +102,14 @@ CONFIG_EDAC_ATOMIC_SCRUB=y CONFIG_EDAC_SUPPORT=y # CONFIG_EIGER is not set # CONFIG_EPAPR_BOOT is not set +CONFIG_EXPORTFS=y CONFIG_EXTRA_TARGETS="uImage" CONFIG_FIXED_PHY=y +# CONFIG_FORCE_SMP is not set CONFIG_FREEZER=y # CONFIG_FSL_LBC is not set # CONFIG_FSL_ULI1575 is not set +CONFIG_FUTEX_PI=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_CLOCKEVENTS=y @@ -88,7 +127,7 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_GENERIC_STRNCPY_FROM_USER=y CONFIG_GENERIC_STRNLEN_USER=y # CONFIG_GENERIC_TBSYNC is not set -CONFIG_GENERIC_TIME_VSYSCALL_OLD=y +CONFIG_GENERIC_TIME_VSYSCALL=y # CONFIG_GEN_RTC is not set # CONFIG_GE_FPGA is not set # CONFIG_GLACIER is not set @@ -96,6 +135,7 @@ CONFIG_GPIOLIB=y CONFIG_GPIO_GENERIC=y CONFIG_GPIO_GENERIC_PLATFORM=y CONFIG_GPIO_SYSFS=y +# CONFIG_GRO_CELLS is not set CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y @@ -118,10 +158,12 @@ CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y CONFIG_HAVE_FUNCTION_TRACER=y # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set -CONFIG_HAVE_GENERIC_RCU_GUP=y +CONFIG_HAVE_GENERIC_GUP=y CONFIG_HAVE_IDE=y CONFIG_HAVE_IOREMAP_PROT=y CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_KPROBES_ON_FTRACE=y CONFIG_HAVE_MEMBLOCK=y CONFIG_HAVE_MEMBLOCK_NODE_MAP=y CONFIG_HAVE_MOD_ARCH_SPECIFIC=y @@ -155,6 +197,7 @@ CONFIG_IBM_EMAC_TAH=y CONFIG_IBM_EMAC_TXB=128 # CONFIG_ICON is not set CONFIG_IKAREM=y +CONFIG_ILLEGAL_POINTER_VALUE=0 CONFIG_INITRAMFS_SOURCE="" # CONFIG_IOMMU_HELPER is not set # CONFIG_IPIC is not set @@ -173,10 +216,8 @@ CONFIG_LOWMEM_SIZE=0x30000000 CONFIG_LZO_COMPRESS=y CONFIG_LZO_DECOMPRESS=y # CONFIG_MATH_EMULATION is not set -CONFIG_MDIO_BOARDINFO=y -# CONFIG_MDIO_HISI_FEMAC is not set -# CONFIG_MFD_ACT8945A is not set -# CONFIG_MFD_MAX77620 is not set +CONFIG_MDIO_BUS=y +CONFIG_MDIO_DEVICE=y # CONFIG_MMIO_NVRAM is not set CONFIG_MODULES_USE_ELF_RELA=y # CONFIG_MPIC is not set @@ -278,23 +319,25 @@ CONFIG_PPC_MMU_NOHASH=y CONFIG_PPC_MSI_BITMAP=y # CONFIG_PPC_P7_NAP is not set CONFIG_PPC_PCI_CHOICE=y +# CONFIG_PPC_PTDUMP is not set # CONFIG_PPC_RTAS is not set CONFIG_PPC_UDBG_16550=y CONFIG_PPC_WERROR=y # CONFIG_PPC_XICS is not set +# CONFIG_PPC_XIVE is not set +# CONFIG_PPC_XIVE_SPAPR is not set # CONFIG_PQ2ADS is not set +CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 CONFIG_PTE_64BIT=y -# CONFIG_QORIQ_THERMAL is not set # CONFIG_RAINIER is not set CONFIG_RAS=y +# CONFIG_RCU_NEED_SEGCBLIST is not set # CONFIG_RCU_STALL_COMMON is not set CONFIG_RD_GZIP=y -# CONFIG_RELOCATABLE is not set CONFIG_RWSEM_XCHGADD_ALGORITHM=y # CONFIG_SAM440EP is not set # CONFIG_SCHED_INFO is not set # CONFIG_SCSI_DMA is not set -# CONFIG_SENSORS_TC654 is not set # CONFIG_SEQUOIA is not set CONFIG_SERIAL_8250_EXTENDED=y CONFIG_SERIAL_8250_FSL=y @@ -310,7 +353,10 @@ CONFIG_SWPHY=y CONFIG_SYSCTL_EXCEPTION_TRACE=y # CONFIG_TAISHAN is not set CONFIG_TASK_SIZE=0xc0000000 +CONFIG_THIN_ARCHIVES=y +CONFIG_THREAD_SHIFT=13 CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TINY_SRCU=y CONFIG_USB_SUPPORT=y CONFIG_VDSO32=y # CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set diff --git a/target/linux/apm821xx/dts/apollo3g.dtsi b/target/linux/apm821xx/dts/apollo3g.dtsi index 783348a678..e88973f8d2 100644 --- a/target/linux/apm821xx/dts/apollo3g.dtsi +++ b/target/linux/apm821xx/dts/apollo3g.dtsi @@ -14,6 +14,10 @@ aliases { serial0 = &UART0; + led-boot = &status; + led-failsafe = &status; + led-running = &status; + led-upgrade = &status; }; }; @@ -113,13 +117,13 @@ gpio-leds { compatible = "gpio-leds"; - power-red { + failsafe: power-red { label = "mbl:red:power"; gpios = <&GPIO1 4 GPIO_ACTIVE_HIGH>; linux,default-trigger = "panic"; }; - power-green { + status: power-green { label = "mbl:green:power"; gpios = <&GPIO1 5 GPIO_ACTIVE_HIGH>; }; @@ -167,6 +171,17 @@ &EMAC0 { status = "okay"; + + phy-map = <0x2>; + phy-address = <0x1>; + phy-handle = <&phy>; + + mdio { + phy: phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; + }; }; &SATA1 { diff --git a/target/linux/apm821xx/dts/MR24.dts b/target/linux/apm821xx/dts/meraki-mr24.dts similarity index 85% rename from target/linux/apm821xx/dts/MR24.dts rename to target/linux/apm821xx/dts/meraki-mr24.dts index 8d20872c3f..e06d37cbbd 100644 --- a/target/linux/apm821xx/dts/MR24.dts +++ b/target/linux/apm821xx/dts/meraki-mr24.dts @@ -16,10 +16,14 @@ / { model = "Meraki MR24 Access Point"; - compatible = "meraki,ikarem"; + compatible = "meraki,mr24", "meraki,ikarem", "apm,bluestone"; aliases { serial0 = &UART1; + led-boot = &status; + led-failsafe = &failsafe; + led-running = &status; + led-upgrade = &status; }; chosen { @@ -85,18 +89,30 @@ &EMAC0 { status = "okay"; + + phy-mode = "rgmii-id"; + phy-map = <0x2>; + phy-address = <0x1>; + phy-handle = <&phy>; + + mdio { + phy: phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; + }; }; &POB0 { gpio-leds { compatible = "gpio-leds"; - power-green { + status: power-green { label = "mr24:green:power"; gpios = <&GPIO0 18 GPIO_ACTIVE_LOW>; }; - power-orange { + failsafe: power-orange { label = "mr24:orange:power"; gpios = <&GPIO0 19 GPIO_ACTIVE_LOW>; }; diff --git a/target/linux/apm821xx/dts/MX60.dts b/target/linux/apm821xx/dts/meraki-mx60.dts similarity index 93% rename from target/linux/apm821xx/dts/MX60.dts rename to target/linux/apm821xx/dts/meraki-mx60.dts index 4ec0043f32..32e5c859e8 100644 --- a/target/linux/apm821xx/dts/MX60.dts +++ b/target/linux/apm821xx/dts/meraki-mx60.dts @@ -16,10 +16,14 @@ / { model = "Meraki MX60/MX60W Security Appliance"; - compatible = "meraki,buckminster"; + compatible = "meraki,mx60", "meraki,buckminster", "apm,bluestone"; aliases { serial0 = &UART1; + led-boot = &status; + led-failsafe = &failsafe; + led-running = &status; + led-upgrade = &status; }; chosen { @@ -120,12 +124,12 @@ gpio-leds { compatible = "gpio-leds"; - power-green { + status: power-green { label = "mx60:green:power"; gpios = <&GPIO0 18 GPIO_ACTIVE_LOW>; }; - power-orange { + failsafe: power-orange { label = "mx60:orange:power"; gpios = <&GPIO0 19 GPIO_ACTIVE_LOW>; }; diff --git a/target/linux/apm821xx/dts/wndr4700.dts b/target/linux/apm821xx/dts/netgear-wndr4700.dts similarity index 96% rename from target/linux/apm821xx/dts/wndr4700.dts rename to target/linux/apm821xx/dts/netgear-wndr4700.dts index d1a65f3e62..96cf97c45c 100644 --- a/target/linux/apm821xx/dts/wndr4700.dts +++ b/target/linux/apm821xx/dts/netgear-wndr4700.dts @@ -19,6 +19,10 @@ aliases { serial0 = &UART0; + led-boot = &status; + led-failsafe = &failsafe; + led-running = &status; + led-upgrade = &status; }; chosen { @@ -95,17 +99,17 @@ map1 { trip = <&cpu_alert1>; - cooling-device = <&fan0 1 87>; + cooling-device = <&fan0 1 76>; }; map2 { trip = <&cpu_alert2>; - cooling-device = <&fan0 88 100>; + cooling-device = <&fan0 77 101>; }; map3 { trip = <&cpu_alert3>; - cooling-device = <&fan0 101 147>; + cooling-device = <&fan0 102 147>; }; map4 { @@ -348,12 +352,12 @@ gpio-leds { compatible = "gpio-leds"; - power-green { + status: power-green { label = "wndr4700:green:power"; gpios = <&GPIO0 8 GPIO_ACTIVE_HIGH>; }; - power-orange { + failsafe: power-orange { label = "wndr4700:orange:power"; gpios = <&GPIO0 9 GPIO_ACTIVE_LOW>; linux,default-trigger = "panic"; diff --git a/target/linux/apm821xx/dts/apollo3g-duo.dts b/target/linux/apm821xx/dts/wd-mybooklive-duo.dts similarity index 92% rename from target/linux/apm821xx/dts/apollo3g-duo.dts rename to target/linux/apm821xx/dts/wd-mybooklive-duo.dts index 53459b0cc0..4f6cc506f5 100644 --- a/target/linux/apm821xx/dts/apollo3g-duo.dts +++ b/target/linux/apm821xx/dts/wd-mybooklive-duo.dts @@ -14,6 +14,7 @@ #include "apollo3g.dtsi" / { + compatible = "wd,mybooklive-duo", "amcc,apollo3g"; model = "MyBook Live Duo"; }; diff --git a/target/linux/apm821xx/dts/apollo3g.dts b/target/linux/apm821xx/dts/wd-mybooklive.dts similarity index 89% rename from target/linux/apm821xx/dts/apollo3g.dts rename to target/linux/apm821xx/dts/wd-mybooklive.dts index 4d31edae4a..d841352292 100644 --- a/target/linux/apm821xx/dts/apollo3g.dts +++ b/target/linux/apm821xx/dts/wd-mybooklive.dts @@ -12,5 +12,6 @@ #include "apollo3g.dtsi" / { + compatible = "wd,mybooklive", "amcc,apollo3g"; model = "MyBook Live"; }; diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile index 6ed183c376..c012906eaf 100644 --- a/target/linux/apm821xx/image/Makefile +++ b/target/linux/apm821xx/image/Makefile @@ -5,16 +5,16 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -DEVICE_VARS += DEVICE_PROFILE IMAGE_SIZE DTB_SIZE +DEVICE_VARS += IMAGE_SIZE DTB_SIZE define Device/Default PROFILES := Default KERNEL_DEPENDS = $$(wildcard ../dts/$$(DEVICE_DTS).dts) - DEVICE_PROFILE := DEVICE_DTS := KERNEL_ENTRY := 0x00000000 KERNEL_LOADADDR := 0x00000000 DEVICE_DTS_DIR := ../dts + SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) endef define Build/dtb @@ -61,17 +61,17 @@ endef define Build/MerakiNAND -$(STAGING_DIR_HOST)/bin/mkmerakifw \ - -B $(DEVICE_PROFILE) -s \ + -B $(BOARD_NAME) -s \ -i $@ \ -o $@.new @cp $@.new $@ endef -define Device/mr24 +define Device/meraki_mr24 DEVICE_TITLE := Cisco Meraki MR24 DEVICE_PACKAGES := kmod-spi-gpio - DEVICE_PROFILE := MR24 - DEVICE_DTS := MR24 + BOARD_NAME := mr24 + DEVICE_DTS := meraki-mr24 BLOCKSIZE := 63k IMAGES := sysupgrade.tar DTB_SIZE := 64512 @@ -82,17 +82,18 @@ define Device/mr24 check-size $$(KERNEL_SIZE) | \ MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | \ MerakiNAND - IMAGE/sysupgrade.tar := sysupgrade-tar + IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata UBINIZE_OPTS := -E 5 + SUPPORTED_DEVICES += mr24 endef -TARGET_DEVICES += mr24 +TARGET_DEVICES += meraki_mr24 -define Device/mx60 +define Device/meraki_mx60 DEVICE_TITLE := Cisco Meraki MX60/MX60W DEVICE_PACKAGES := kmod-spi-gpio kmod-usb-ledtrig-usbport kmod-usb-dwc2 \ kmod-usb-storage block-mount - DEVICE_PROFILE := MX60 - DEVICE_DTS := MX60 + BOARD_NAME := mx60 + DEVICE_DTS := meraki-mx60 BLOCKSIZE := 63k IMAGES := sysupgrade.tar DTB_SIZE := 64512 @@ -107,16 +108,17 @@ define Device/mx60 check-size $$(KERNEL_SIZE) | \ MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | \ MerakiNAND - IMAGE/sysupgrade.tar := sysupgrade-tar + IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata UBINIZE_OPTS := -E 5 + SUPPORTED_DEVICES += mx60 endef -TARGET_DEVICES += mx60 +TARGET_DEVICES += meraki_mx60 define Build/create-uImage-dtb # flat_dt target expect FIT image - which WNDR4700's uboot doesn't support -$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) \ -O linux -T kernel -C none \ - -n '$(call toupper,$(LINUX_KARCH)) LEDE Linux-$(LINUX_VERSION)' \ + -n '$(call toupper,$(LINUX_KARCH)) OpenWrt Linux-$(LINUX_VERSION)' \ -d $(IMAGE_KERNEL).dtb $@.new @mv $@.new $@ endef @@ -145,21 +147,20 @@ define Build/wndr4700-specialImage -$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) -O linux -T multi \ -C $(1) -a $(KERNEL_LOADADDR) -e $(KERNEL_ENTRY) \ - -n '$(DEVICE_PROFILE) initramfs' -d $@:$@.fakerd:$@.dtb $@.new + -n '$(BOARD_NAME) initramfs' -d $@:$@.fakerd:$@.dtb $@.new mv $@.new $@ rm -rf $@.fakerd endef -define Device/WNDR4700 +define Device/netgear_wndr4700 DEVICE_TITLE := Netgear Centria N900 WNDR4700/WNDR4720 DEVICE_PACKAGES := badblocks block-mount e2fsprogs \ kmod-dm kmod-fs-ext4 kmod-fs-vfat kmod-usb-ledtrig-usbport \ kmod-md-mod kmod-nls-cp437 kmod-nls-iso8859-1 kmod-nls-iso8859-15 \ kmod-nls-utf8 kmod-usb3 kmod-usb-dwc2 kmod-usb-storage \ partx-utils - DEVICE_NAME := wndr4700 - DEVICE_PROFILE := wndr4700 - DEVICE_DTS := wndr4700 + BOARD_NAME := wndr4700 + DEVICE_DTS := netgear-wndr4700 PAGESIZE := 2048 SUBPAGESIZE := 512 BLOCKSIZE := 128k @@ -172,13 +173,14 @@ define Device/WNDR4700 KERNEL_INITRAMFS := kernel-bin | gzip | dtb | wndr4700-specialImage gzip IMAGE/factory.img := create-uImage-dtb | append-kernel | pad-to 2M | append-ubi | \ netgear-dni | check-size $$$$(IMAGE_SIZE) - IMAGE/sysupgrade.tar := sysupgrade-tar + IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata IMAGE/kernel.dtb := export-dtb | uImage none NETGEAR_BOARD_ID := WNDR4700 NETGEAR_HW_ID := 29763875+128+256 UBINIZE_OPTS := -E 5 + SUPPORTED_DEVICES += wndr4700 endef -TARGET_DEVICES += WNDR4700 +TARGET_DEVICES += netgear_wndr4700 endif @@ -217,31 +219,31 @@ define Device/MyBookLiveDefault KERNEL := kernel-bin | dtb | gzip | uImage gzip KERNEL_INITRAMFS := kernel-bin | dtb | gzip | uImage gzip BOOT_SIZE := 8 - IMAGES := rootfs.img kernel.dtb + IMAGES := rootfs.img.gz kernel.dtb DEVICE_DTB := apollo3g.dtb FILESYSTEMS := ext4 IMAGE/kernel.dtb := export-dtb - IMAGE/rootfs.img := boot-script | boot-img | hdd-img + IMAGE/rootfs.img.gz := boot-script | boot-img | hdd-img | gzip | append-metadata endef -define Device/MyBookLiveSingle +define Device/wd_mybooklive $(Device/MyBookLiveDefault) DEVICE_TITLE := Western Digital My Book Live - DEVICE_DTS := apollo3g - DEVICE_PROFILE := apollo3g + DEVICE_DTS := wd-mybooklive + SUPPORTED_DEVICES += mbl endef -TARGET_DEVICES += MyBookLiveSingle +TARGET_DEVICES += wd_mybooklive -define Device/MyBookLiveDuo +define Device/wd_mybooklive-duo $(Device/MyBookLiveDefault) DEVICE_TITLE := Western Digital My Book Live Duo DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-mini - DEVICE_DTS := apollo3g-duo - DEVICE_PROFILE := ap2nc + DEVICE_DTS := wd-mybooklive-duo + SUPPORTED_DEVICES += mbl endef -TARGET_DEVICES += MyBookLiveDuo +TARGET_DEVICES += wd_mybooklive-duo endif diff --git a/target/linux/apm821xx/nand/config-default b/target/linux/apm821xx/nand/config-default index d6bdbd74e2..ca6af461c7 100644 --- a/target/linux/apm821xx/nand/config-default +++ b/target/linux/apm821xx/nand/config-default @@ -1,3 +1,4 @@ +CONFIG_AT803X_PHY=y CONFIG_AR8216_PHY=y CONFIG_DMADEVICES=y CONFIG_DMA_ENGINE=y @@ -9,6 +10,7 @@ CONFIG_IKAREM=y CONFIG_ATA=y CONFIG_ATA_SFF=y CONFIG_ATA_BMDMA=y +# CONFIG_PCI_DISABLE_COMMON_QUIRKS is not set CONFIG_SATA_PMP=y CONFIG_GENERIC_PHY=y CONFIG_SATA_DWC=y @@ -22,6 +24,7 @@ CONFIG_LEDS_TRIGGER_DISK=y CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_M48T86=y CONFIG_THERMAL=y +CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 CONFIG_THERMAL_OF=y CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y CONFIG_THERMAL_HWMON=y @@ -36,6 +39,7 @@ CONFIG_MTD_UBI_BLOCK=y CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_UBIFS_FS=y # CONFIG_UBIFS_FS_ADVANCED_COMPR is not set +CONFIG_USB_PCI=y CONFIG_SENSORS_LM90=y CONFIG_SENSORS_TC654=y CONFIG_SWCONFIG=y diff --git a/target/linux/apm821xx/patches-4.14/010-crypto-gcm-add-GCM-IV-size-constant.patch b/target/linux/apm821xx/patches-4.14/010-crypto-gcm-add-GCM-IV-size-constant.patch new file mode 100644 index 0000000000..6f0cc6015c --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/010-crypto-gcm-add-GCM-IV-size-constant.patch @@ -0,0 +1,27 @@ +From ef780324592dd639e4bfbc5b9bf8934b234b7c99 Mon Sep 17 00:00:00 2001 +From: Corentin LABBE +Date: Tue, 22 Aug 2017 10:08:08 +0200 +Subject: [PATCH] crypto: gcm - add GCM IV size constant + +Many GCM users use directly GCM IV size instead of using some constant. + +This patch add all IV size constant used by GCM. + +Signed-off-by: Corentin Labbe +Signed-off-by: Herbert Xu +--- + include/crypto/gcm.h | 8 ++++++++ + 1 file changed, 8 insertions(+) + create mode 100644 include/crypto/gcm.h + +--- /dev/null ++++ b/include/crypto/gcm.h +@@ -0,0 +1,8 @@ ++#ifndef _CRYPTO_GCM_H ++#define _CRYPTO_GCM_H ++ ++#define GCM_AES_IV_SIZE 12 ++#define GCM_RFC4106_IV_SIZE 8 ++#define GCM_RFC4543_IV_SIZE 8 ++ ++#endif diff --git a/target/linux/apm821xx/patches-4.14/020-0001-crypto-crypto4xx-remove-bad-list_del.patch b/target/linux/apm821xx/patches-4.14/020-0001-crypto-crypto4xx-remove-bad-list_del.patch new file mode 100644 index 0000000000..8df0937e4d --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0001-crypto-crypto4xx-remove-bad-list_del.patch @@ -0,0 +1,32 @@ +From a728a196d253530f17da5c86dc7dfbe58c5f7094 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:14 +0200 +Subject: [PATCH 01/25] crypto: crypto4xx - remove bad list_del + +alg entries are only added to the list, after the registration +was successful. If the registration failed, it was never added +to the list in the first place. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1033,12 +1033,10 @@ int crypto4xx_register_alg(struct crypto + break; + } + +- if (rc) { +- list_del(&alg->entry); ++ if (rc) + kfree(alg); +- } else { ++ else + list_add_tail(&alg->entry, &sec_dev->alg_list); +- } + } + + return 0; diff --git a/target/linux/apm821xx/patches-4.14/020-0002-crypto-crypto4xx-remove-unused-definitions-and-write.patch b/target/linux/apm821xx/patches-4.14/020-0002-crypto-crypto4xx-remove-unused-definitions-and-write.patch new file mode 100644 index 0000000000..5983246344 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0002-crypto-crypto4xx-remove-unused-definitions-and-write.patch @@ -0,0 +1,120 @@ +From 81065f66dd99b3af58626a914b8c0fcff6b8b0ba Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:15 +0200 +Subject: [PATCH 02/25] crypto: crypto4xx - remove unused definitions and + write-only variables + +This patch removes several unused code and definitons +(structs, variables, ...). + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 6 ------ + drivers/crypto/amcc/crypto4xx_core.c | 2 +- + drivers/crypto/amcc/crypto4xx_core.h | 16 ---------------- + 3 files changed, 1 insertion(+), 23 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -75,7 +75,6 @@ int crypto4xx_encrypt(struct ablkcipher_ + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); + + ctx->direction = DIR_OUTBOUND; +- ctx->hash_final = 0; + ctx->is_hash = 0; + ctx->pd_ctl = 0x1; + +@@ -89,7 +88,6 @@ int crypto4xx_decrypt(struct ablkcipher_ + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); + + ctx->direction = DIR_INBOUND; +- ctx->hash_final = 0; + ctx->is_hash = 0; + ctx->pd_ctl = 1; + +@@ -136,7 +134,6 @@ static int crypto4xx_setkey_aes(struct c + } + /* Setup SA */ + sa = (struct dynamic_sa_ctl *) ctx->sa_in; +- ctx->hash_final = 0; + + set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, SA_NOT_SAVE_IV, + SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE, +@@ -191,7 +188,6 @@ static int crypto4xx_hash_alg_init(struc + + ctx->dev = my_alg->dev; + ctx->is_hash = 1; +- ctx->hash_final = 0; + + /* Create SA */ + if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr) +@@ -256,7 +252,6 @@ int crypto4xx_hash_update(struct ahash_r + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); + + ctx->is_hash = 1; +- ctx->hash_final = 0; + ctx->pd_ctl = 0x11; + ctx->direction = DIR_INBOUND; + +@@ -274,7 +269,6 @@ int crypto4xx_hash_digest(struct ahash_r + { + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); + +- ctx->hash_final = 1; + ctx->pd_ctl = 0x11; + ctx->direction = DIR_INBOUND; + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -962,7 +962,7 @@ u32 crypto4xx_build_pd(struct crypto_asy + + sa->sa_command_1.bf.hash_crypto_offset = 0; + pd->pd_ctl.w = ctx->pd_ctl; +- pd->pd_ctl_len.w = 0x00400000 | (ctx->bypass << 24) | datalen; ++ pd->pd_ctl_len.w = 0x00400000 | datalen; + pd_uinfo->state = PD_ENTRY_INUSE; + wmb(); + /* write any value to push engine to read a pd */ +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -72,7 +72,6 @@ struct pd_uinfo { + struct crypto4xx_device { + struct crypto4xx_core_device *core_dev; + char *name; +- u64 ce_phy_address; + void __iomem *ce_base; + void __iomem *trng_base; + +@@ -127,21 +126,9 @@ struct crypto4xx_ctx { + u32 sa_len; + u32 offset_to_sr_ptr; /* offset to state ptr, in dynamic sa */ + u32 direction; +- u32 next_hdr; + u32 save_iv; +- u32 pd_ctl_len; + u32 pd_ctl; +- u32 bypass; + u32 is_hash; +- u32 hash_final; +-}; +- +-struct crypto4xx_req_ctx { +- struct crypto4xx_device *dev; /* Device in which +- operation to send to */ +- void *sa; +- u32 sa_dma_addr; +- u16 sa_len; + }; + + struct crypto4xx_alg_common { +@@ -172,9 +159,6 @@ static inline struct crypto4xx_alg *cryp + + extern int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size); + extern void crypto4xx_free_sa(struct crypto4xx_ctx *ctx); +-extern u32 crypto4xx_alloc_sa_rctx(struct crypto4xx_ctx *ctx, +- struct crypto4xx_ctx *rctx); +-extern void crypto4xx_free_sa_rctx(struct crypto4xx_ctx *rctx); + extern void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx); + extern u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx); + extern u32 get_dynamic_sa_offset_state_ptr_field(struct crypto4xx_ctx *ctx); diff --git a/target/linux/apm821xx/patches-4.14/020-0003-crypto-crypto4xx-set-CRYPTO_ALG_KERN_DRIVER_ONLY-fla.patch b/target/linux/apm821xx/patches-4.14/020-0003-crypto-crypto4xx-set-CRYPTO_ALG_KERN_DRIVER_ONLY-fla.patch new file mode 100644 index 0000000000..e50a418284 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0003-crypto-crypto4xx-set-CRYPTO_ALG_KERN_DRIVER_ONLY-fla.patch @@ -0,0 +1,31 @@ +From 1ef52a95ea53c3c54b061e3f1af85976356c7132 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:16 +0200 +Subject: [PATCH 03/25] crypto: crypto4xx - set CRYPTO_ALG_KERN_DRIVER_ONLY + flag + +The security offload function is performed by a cryptographic +engine core attached to the 128-bit PLB (processor local bus) +with builtin DMA and interrupt controllers. This, I think, +satisfies the requirement for the CRYPTO_ALG_KERN_DRIVER_ONLY +flag. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1114,7 +1114,9 @@ struct crypto4xx_alg_common crypto4xx_al + .cra_name = "cbc(aes)", + .cra_driver_name = "cbc-aes-ppc4xx", + .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, +- .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, ++ .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | ++ CRYPTO_ALG_ASYNC | ++ CRYPTO_ALG_KERN_DRIVER_ONLY, + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), + .cra_type = &crypto_ablkcipher_type, diff --git a/target/linux/apm821xx/patches-4.14/020-0004-crypto-crypto4xx-remove-extern-statement-before-func.patch b/target/linux/apm821xx/patches-4.14/020-0004-crypto-crypto4xx-remove-extern-statement-before-func.patch new file mode 100644 index 0000000000..cd61ac719b --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0004-crypto-crypto4xx-remove-extern-statement-before-func.patch @@ -0,0 +1,76 @@ +From 886c251fd4ca40a27697afec7bc44c115e803d78 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:17 +0200 +Subject: [PATCH 04/25] crypto: crypto4xx - remove extern statement before + function declaration + +All function declarations are "extern" by default, there is no need to +specify it explicitly. + +For C99 states in 6.2.2.5: +"If the declaration of an identifier for a function has no +storage-class specifier, its linkage is determined exactly +as if it were declared with the storage-class specifier +extern." + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.h | 48 ++++++++++++++++++------------------ + 1 file changed, 24 insertions(+), 24 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -157,28 +157,28 @@ static inline struct crypto4xx_alg *cryp + return container_of(x, struct crypto4xx_alg, alg.u.cipher); + } + +-extern int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size); +-extern void crypto4xx_free_sa(struct crypto4xx_ctx *ctx); +-extern void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx); +-extern u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx); +-extern u32 get_dynamic_sa_offset_state_ptr_field(struct crypto4xx_ctx *ctx); +-extern u32 get_dynamic_sa_offset_key_field(struct crypto4xx_ctx *ctx); +-extern u32 get_dynamic_sa_iv_size(struct crypto4xx_ctx *ctx); +-extern void crypto4xx_memcpy_le(unsigned int *dst, +- const unsigned char *buf, int len); +-extern u32 crypto4xx_build_pd(struct crypto_async_request *req, +- struct crypto4xx_ctx *ctx, +- struct scatterlist *src, +- struct scatterlist *dst, +- unsigned int datalen, +- void *iv, u32 iv_len); +-extern int crypto4xx_setkey_aes_cbc(struct crypto_ablkcipher *cipher, +- const u8 *key, unsigned int keylen); +-extern int crypto4xx_encrypt(struct ablkcipher_request *req); +-extern int crypto4xx_decrypt(struct ablkcipher_request *req); +-extern int crypto4xx_sha1_alg_init(struct crypto_tfm *tfm); +-extern int crypto4xx_hash_digest(struct ahash_request *req); +-extern int crypto4xx_hash_final(struct ahash_request *req); +-extern int crypto4xx_hash_update(struct ahash_request *req); +-extern int crypto4xx_hash_init(struct ahash_request *req); ++int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size); ++void crypto4xx_free_sa(struct crypto4xx_ctx *ctx); ++void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx); ++u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx); ++u32 get_dynamic_sa_offset_state_ptr_field(struct crypto4xx_ctx *ctx); ++u32 get_dynamic_sa_offset_key_field(struct crypto4xx_ctx *ctx); ++u32 get_dynamic_sa_iv_size(struct crypto4xx_ctx *ctx); ++void crypto4xx_memcpy_le(unsigned int *dst, ++ const unsigned char *buf, int len); ++u32 crypto4xx_build_pd(struct crypto_async_request *req, ++ struct crypto4xx_ctx *ctx, ++ struct scatterlist *src, ++ struct scatterlist *dst, ++ unsigned int datalen, ++ void *iv, u32 iv_len); ++int crypto4xx_setkey_aes_cbc(struct crypto_ablkcipher *cipher, ++ const u8 *key, unsigned int keylen); ++int crypto4xx_encrypt(struct ablkcipher_request *req); ++int crypto4xx_decrypt(struct ablkcipher_request *req); ++int crypto4xx_sha1_alg_init(struct crypto_tfm *tfm); ++int crypto4xx_hash_digest(struct ahash_request *req); ++int crypto4xx_hash_final(struct ahash_request *req); ++int crypto4xx_hash_update(struct ahash_request *req); ++int crypto4xx_hash_init(struct ahash_request *req); + #endif diff --git a/target/linux/apm821xx/patches-4.14/020-0005-crypto-crypto4xx-remove-double-assignment-of-pd_uinf.patch b/target/linux/apm821xx/patches-4.14/020-0005-crypto-crypto4xx-remove-double-assignment-of-pd_uinf.patch new file mode 100644 index 0000000000..4fc3617576 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0005-crypto-crypto4xx-remove-double-assignment-of-pd_uinf.patch @@ -0,0 +1,24 @@ +From c587e65deacf8c86de2d7c51f1e81d0a4a9147a8 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:18 +0200 +Subject: [PATCH 05/25] crypto: crypto4xx - remove double assignment of + pd_uinfo->state + +crypto4xx_put_pd_to_pdr() already clears the flag. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1079,7 +1079,6 @@ static void crypto4xx_bh_tasklet_cb(unsi + pd->pd_ctl.bf.pe_done = 0; + crypto4xx_pd_done(core_dev->dev, tail); + crypto4xx_put_pd_to_pdr(core_dev->dev, tail); +- pd_uinfo->state = PD_ENTRY_FREE; + } else { + /* if tail not done, break */ + break; diff --git a/target/linux/apm821xx/patches-4.14/020-0006-crypto-crypto4xx-fix-dynamic_sa_ctl-s-sa_contents-de.patch b/target/linux/apm821xx/patches-4.14/020-0006-crypto-crypto4xx-fix-dynamic_sa_ctl-s-sa_contents-de.patch new file mode 100644 index 0000000000..84063d3036 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0006-crypto-crypto4xx-fix-dynamic_sa_ctl-s-sa_contents-de.patch @@ -0,0 +1,87 @@ +From 453e3090b9c3f5da70b21648c2244e9821f0916d Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:19 +0200 +Subject: [PATCH 06/25] crypto: crypto4xx - fix dynamic_sa_ctl's sa_contents + declaration + +The driver had a union dynamic_sa_contents in place that +described the meaning of the bits in the sa_contents +variable. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 4 ++-- + drivers/crypto/amcc/crypto4xx_sa.c | 12 ++++++------ + drivers/crypto/amcc/crypto4xx_sa.h | 2 +- + 3 files changed, 9 insertions(+), 9 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -149,7 +149,7 @@ static int crypto4xx_setkey_aes(struct c + SA_NOT_COPY_HDR); + crypto4xx_memcpy_le(ctx->sa_in + get_dynamic_sa_offset_key_field(ctx), + key, keylen); +- sa->sa_contents = SA_AES_CONTENTS | (keylen << 2); ++ sa->sa_contents.w = SA_AES_CONTENTS | (keylen << 2); + sa->sa_command_1.bf.key_len = keylen >> 3; + ctx->is_hash = 0; + ctx->direction = DIR_INBOUND; +@@ -219,7 +219,7 @@ static int crypto4xx_hash_alg_init(struc + SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD, + SA_NOT_COPY_HDR); + ctx->direction = DIR_INBOUND; +- sa->sa_contents = SA_HASH160_CONTENTS; ++ sa->sa_contents.w = SA_HASH160_CONTENTS; + sa_in = (struct dynamic_sa_hash160 *) ctx->sa_in; + /* Need to zero hash digest in SA */ + memset(sa_in->inner_digest, 0, sizeof(sa_in->inner_digest)); +--- a/drivers/crypto/amcc/crypto4xx_sa.c ++++ b/drivers/crypto/amcc/crypto4xx_sa.c +@@ -40,9 +40,9 @@ u32 get_dynamic_sa_offset_state_ptr_fiel + union dynamic_sa_contents cts; + + if (ctx->direction == DIR_INBOUND) +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents; ++ cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w; + else +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents; ++ cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w; + offset = cts.bf.key_size + + cts.bf.inner_size + + cts.bf.outer_size +@@ -66,9 +66,9 @@ u32 get_dynamic_sa_iv_size(struct crypto + union dynamic_sa_contents cts; + + if (ctx->direction == DIR_INBOUND) +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents; ++ cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w; + else +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents; ++ cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w; + return (cts.bf.iv0 + cts.bf.iv1 + cts.bf.iv2 + cts.bf.iv3) * 4; + } + +@@ -77,9 +77,9 @@ u32 get_dynamic_sa_offset_key_field(stru + union dynamic_sa_contents cts; + + if (ctx->direction == DIR_INBOUND) +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents; ++ cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w; + else +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents; ++ cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w; + + return sizeof(struct dynamic_sa_ctl); + } +--- a/drivers/crypto/amcc/crypto4xx_sa.h ++++ b/drivers/crypto/amcc/crypto4xx_sa.h +@@ -169,7 +169,7 @@ union sa_command_1 { + } __attribute__((packed)); + + struct dynamic_sa_ctl { +- u32 sa_contents; ++ union dynamic_sa_contents sa_contents; + union sa_command_0 sa_command_0; + union sa_command_1 sa_command_1; + } __attribute__((packed)); diff --git a/target/linux/apm821xx/patches-4.14/020-0007-crypto-crypto4xx-move-and-refactor-dynamic_contents-.patch b/target/linux/apm821xx/patches-4.14/020-0007-crypto-crypto4xx-move-and-refactor-dynamic_contents-.patch new file mode 100644 index 0000000000..c7c32e5d36 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0007-crypto-crypto4xx-move-and-refactor-dynamic_contents-.patch @@ -0,0 +1,234 @@ +From 249c8d98ea339325dca481d5dae93686cd494059 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:20 +0200 +Subject: [PATCH 07/25] crypto: crypto4xx - move and refactor dynamic_contents + helpers + +This patch refactors and moves the dynamic_contents helper +functions into the crypto4xx_sa.h header file. + + * get_dynamic_sa_iv_size is no longer needed, as the cryptoapi + provides the required IV size information as well. + + * refactor the function declarations to use the a pointer to the + dynamic_sa_contents union, instead of the crypto4xx_ctx. + + * rename get_dynamic_sa_offset_key_field to get_dynamic_sa_key_field. + It returns the pointer to the key directly. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/Makefile | 2 +- + drivers/crypto/amcc/crypto4xx_alg.c | 20 ++++----- + drivers/crypto/amcc/crypto4xx_core.h | 3 -- + drivers/crypto/amcc/crypto4xx_sa.c | 85 ------------------------------------ + drivers/crypto/amcc/crypto4xx_sa.h | 28 ++++++++++++ + 5 files changed, 39 insertions(+), 99 deletions(-) + delete mode 100644 drivers/crypto/amcc/crypto4xx_sa.c + +--- a/drivers/crypto/amcc/Makefile ++++ b/drivers/crypto/amcc/Makefile +@@ -1,3 +1,3 @@ + obj-$(CONFIG_CRYPTO_DEV_PPC4XX) += crypto4xx.o +-crypto4xx-y := crypto4xx_core.o crypto4xx_alg.o crypto4xx_sa.o ++crypto4xx-y := crypto4xx_core.o crypto4xx_alg.o + crypto4xx-$(CONFIG_HW_RANDOM_PPC4XX) += crypto4xx_trng.o +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -29,8 +29,8 @@ + #include + #include + #include "crypto4xx_reg_def.h" +-#include "crypto4xx_sa.h" + #include "crypto4xx_core.h" ++#include "crypto4xx_sa.h" + + static void set_dynamic_sa_command_0(struct dynamic_sa_ctl *sa, u32 save_h, + u32 save_iv, u32 ld_h, u32 ld_iv, +@@ -79,8 +79,8 @@ int crypto4xx_encrypt(struct ablkcipher_ + ctx->pd_ctl = 0x1; + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, +- req->nbytes, req->info, +- get_dynamic_sa_iv_size(ctx)); ++ req->nbytes, req->info, ++ crypto_ablkcipher_ivsize(crypto_ablkcipher_reqtfm(req))); + } + + int crypto4xx_decrypt(struct ablkcipher_request *req) +@@ -92,8 +92,8 @@ int crypto4xx_decrypt(struct ablkcipher_ + ctx->pd_ctl = 1; + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, +- req->nbytes, req->info, +- get_dynamic_sa_iv_size(ctx)); ++ req->nbytes, req->info, ++ crypto_ablkcipher_ivsize(crypto_ablkcipher_reqtfm(req))); + } + + /** +@@ -147,15 +147,15 @@ static int crypto4xx_setkey_aes(struct c + SA_SEQ_MASK_OFF, SA_MC_ENABLE, + SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD, + SA_NOT_COPY_HDR); +- crypto4xx_memcpy_le(ctx->sa_in + get_dynamic_sa_offset_key_field(ctx), ++ crypto4xx_memcpy_le(get_dynamic_sa_key_field(sa), + key, keylen); + sa->sa_contents.w = SA_AES_CONTENTS | (keylen << 2); + sa->sa_command_1.bf.key_len = keylen >> 3; + ctx->is_hash = 0; + ctx->direction = DIR_INBOUND; +- memcpy(ctx->sa_in + get_dynamic_sa_offset_state_ptr_field(ctx), +- (void *)&ctx->state_record_dma_addr, 4); +- ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(ctx); ++ memcpy(sa + get_dynamic_sa_offset_state_ptr_field(sa), ++ (void *)&ctx->state_record_dma_addr, 4); ++ ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa); + + memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4); + sa = (struct dynamic_sa_ctl *) ctx->sa_out; +@@ -225,7 +225,7 @@ static int crypto4xx_hash_alg_init(struc + memset(sa_in->inner_digest, 0, sizeof(sa_in->inner_digest)); + memset(sa_in->outer_digest, 0, sizeof(sa_in->outer_digest)); + sa_in->state_ptr = ctx->state_record_dma_addr; +- ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(ctx); ++ ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa); + + return 0; + } +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -161,9 +161,6 @@ int crypto4xx_alloc_sa(struct crypto4xx_ + void crypto4xx_free_sa(struct crypto4xx_ctx *ctx); + void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx); + u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx); +-u32 get_dynamic_sa_offset_state_ptr_field(struct crypto4xx_ctx *ctx); +-u32 get_dynamic_sa_offset_key_field(struct crypto4xx_ctx *ctx); +-u32 get_dynamic_sa_iv_size(struct crypto4xx_ctx *ctx); + void crypto4xx_memcpy_le(unsigned int *dst, + const unsigned char *buf, int len); + u32 crypto4xx_build_pd(struct crypto_async_request *req, +--- a/drivers/crypto/amcc/crypto4xx_sa.c ++++ /dev/null +@@ -1,85 +0,0 @@ +-/** +- * AMCC SoC PPC4xx Crypto Driver +- * +- * Copyright (c) 2008 Applied Micro Circuits Corporation. +- * All rights reserved. James Hsiao +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (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. +- * +- * @file crypto4xx_sa.c +- * +- * This file implements the security context +- * associate format. +- */ +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include "crypto4xx_reg_def.h" +-#include "crypto4xx_sa.h" +-#include "crypto4xx_core.h" +- +-u32 get_dynamic_sa_offset_state_ptr_field(struct crypto4xx_ctx *ctx) +-{ +- u32 offset; +- union dynamic_sa_contents cts; +- +- if (ctx->direction == DIR_INBOUND) +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w; +- else +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w; +- offset = cts.bf.key_size +- + cts.bf.inner_size +- + cts.bf.outer_size +- + cts.bf.spi +- + cts.bf.seq_num0 +- + cts.bf.seq_num1 +- + cts.bf.seq_num_mask0 +- + cts.bf.seq_num_mask1 +- + cts.bf.seq_num_mask2 +- + cts.bf.seq_num_mask3 +- + cts.bf.iv0 +- + cts.bf.iv1 +- + cts.bf.iv2 +- + cts.bf.iv3; +- +- return sizeof(struct dynamic_sa_ctl) + offset * 4; +-} +- +-u32 get_dynamic_sa_iv_size(struct crypto4xx_ctx *ctx) +-{ +- union dynamic_sa_contents cts; +- +- if (ctx->direction == DIR_INBOUND) +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w; +- else +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w; +- return (cts.bf.iv0 + cts.bf.iv1 + cts.bf.iv2 + cts.bf.iv3) * 4; +-} +- +-u32 get_dynamic_sa_offset_key_field(struct crypto4xx_ctx *ctx) +-{ +- union dynamic_sa_contents cts; +- +- if (ctx->direction == DIR_INBOUND) +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w; +- else +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w; +- +- return sizeof(struct dynamic_sa_ctl); +-} +--- a/drivers/crypto/amcc/crypto4xx_sa.h ++++ b/drivers/crypto/amcc/crypto4xx_sa.h +@@ -240,4 +240,32 @@ struct dynamic_sa_hash160 { + #define SA_HASH160_LEN (sizeof(struct dynamic_sa_hash160)/4) + #define SA_HASH160_CONTENTS 0x2000a502 + ++static inline u32 ++get_dynamic_sa_offset_state_ptr_field(struct dynamic_sa_ctl *cts) ++{ ++ u32 offset; ++ ++ offset = cts->sa_contents.bf.key_size ++ + cts->sa_contents.bf.inner_size ++ + cts->sa_contents.bf.outer_size ++ + cts->sa_contents.bf.spi ++ + cts->sa_contents.bf.seq_num0 ++ + cts->sa_contents.bf.seq_num1 ++ + cts->sa_contents.bf.seq_num_mask0 ++ + cts->sa_contents.bf.seq_num_mask1 ++ + cts->sa_contents.bf.seq_num_mask2 ++ + cts->sa_contents.bf.seq_num_mask3 ++ + cts->sa_contents.bf.iv0 ++ + cts->sa_contents.bf.iv1 ++ + cts->sa_contents.bf.iv2 ++ + cts->sa_contents.bf.iv3; ++ ++ return sizeof(struct dynamic_sa_ctl) + offset * 4; ++} ++ ++static inline u8 *get_dynamic_sa_key_field(struct dynamic_sa_ctl *cts) ++{ ++ return (u8 *) ((unsigned long)cts + sizeof(struct dynamic_sa_ctl)); ++} ++ + #endif diff --git a/target/linux/apm821xx/patches-4.14/020-0008-crypto-crypto4xx-enable-AES-RFC3686-ECB-CFB-and-OFB-.patch b/target/linux/apm821xx/patches-4.14/020-0008-crypto-crypto4xx-enable-AES-RFC3686-ECB-CFB-and-OFB-.patch new file mode 100644 index 0000000000..9977c60d26 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0008-crypto-crypto4xx-enable-AES-RFC3686-ECB-CFB-and-OFB-.patch @@ -0,0 +1,248 @@ +From f2a13e7cba9e2b16f4888fbd9cf2bc25b95945be Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:21 +0200 +Subject: [PATCH 08/25] crypto: crypto4xx - enable AES RFC3686, ECB, CFB and + OFB offloads + +The crypto engine supports more than just aes-cbc. This patch +enables the remaining AES block cipher modes that pass the +testmanager's test vectors. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 66 ++++++++++++++++++++++++ + drivers/crypto/amcc/crypto4xx_core.c | 98 ++++++++++++++++++++++++++++++++++++ + drivers/crypto/amcc/crypto4xx_core.h | 10 ++++ + drivers/crypto/amcc/crypto4xx_sa.h | 3 ++ + 4 files changed, 177 insertions(+) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + #include "crypto4xx_reg_def.h" + #include "crypto4xx_core.h" + #include "crypto4xx_sa.h" +@@ -171,6 +172,71 @@ int crypto4xx_setkey_aes_cbc(struct cryp + CRYPTO_FEEDBACK_MODE_NO_FB); + } + ++int crypto4xx_setkey_aes_cfb(struct crypto_ablkcipher *cipher, ++ const u8 *key, unsigned int keylen) ++{ ++ return crypto4xx_setkey_aes(cipher, key, keylen, CRYPTO_MODE_CFB, ++ CRYPTO_FEEDBACK_MODE_128BIT_CFB); ++} ++ ++int crypto4xx_setkey_aes_ecb(struct crypto_ablkcipher *cipher, ++ const u8 *key, unsigned int keylen) ++{ ++ return crypto4xx_setkey_aes(cipher, key, keylen, CRYPTO_MODE_ECB, ++ CRYPTO_FEEDBACK_MODE_NO_FB); ++} ++ ++int crypto4xx_setkey_aes_ofb(struct crypto_ablkcipher *cipher, ++ const u8 *key, unsigned int keylen) ++{ ++ return crypto4xx_setkey_aes(cipher, key, keylen, CRYPTO_MODE_OFB, ++ CRYPTO_FEEDBACK_MODE_64BIT_OFB); ++} ++ ++int crypto4xx_setkey_rfc3686(struct crypto_ablkcipher *cipher, ++ const u8 *key, unsigned int keylen) ++{ ++ struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher); ++ struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); ++ int rc; ++ ++ rc = crypto4xx_setkey_aes(cipher, key, keylen - CTR_RFC3686_NONCE_SIZE, ++ CRYPTO_MODE_CTR, CRYPTO_FEEDBACK_MODE_NO_FB); ++ if (rc) ++ return rc; ++ ++ memcpy(ctx->state_record, ++ key + keylen - CTR_RFC3686_NONCE_SIZE, CTR_RFC3686_NONCE_SIZE); ++ ++ return 0; ++} ++ ++int crypto4xx_rfc3686_encrypt(struct ablkcipher_request *req) ++{ ++ struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); ++ __be32 iv[AES_IV_SIZE / 4] = { *(u32 *)ctx->state_record, ++ *(u32 *) req->info, *(u32 *) (req->info + 4), cpu_to_be32(1) }; ++ ++ ctx->direction = DIR_OUTBOUND; ++ ctx->pd_ctl = 1; ++ ++ return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, ++ req->nbytes, iv, AES_IV_SIZE); ++} ++ ++int crypto4xx_rfc3686_decrypt(struct ablkcipher_request *req) ++{ ++ struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); ++ __be32 iv[AES_IV_SIZE / 4] = { *(u32 *)ctx->state_record, ++ *(u32 *) req->info, *(u32 *) (req->info + 4), cpu_to_be32(1) }; ++ ++ ctx->direction = DIR_INBOUND; ++ ctx->pd_ctl = 1; ++ ++ return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, ++ req->nbytes, iv, AES_IV_SIZE); ++} ++ + /** + * HASH SHA1 Functions + */ +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + #include + #include "crypto4xx_reg_def.h" + #include "crypto4xx_core.h" +@@ -1133,6 +1134,103 @@ struct crypto4xx_alg_common crypto4xx_al + } + } + }}, ++ { .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = { ++ .cra_name = "cfb(aes)", ++ .cra_driver_name = "cfb-aes-ppc4xx", ++ .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, ++ .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | ++ CRYPTO_ALG_ASYNC | ++ CRYPTO_ALG_KERN_DRIVER_ONLY, ++ .cra_blocksize = AES_BLOCK_SIZE, ++ .cra_ctxsize = sizeof(struct crypto4xx_ctx), ++ .cra_type = &crypto_ablkcipher_type, ++ .cra_init = crypto4xx_alg_init, ++ .cra_exit = crypto4xx_alg_exit, ++ .cra_module = THIS_MODULE, ++ .cra_u = { ++ .ablkcipher = { ++ .min_keysize = AES_MIN_KEY_SIZE, ++ .max_keysize = AES_MAX_KEY_SIZE, ++ .ivsize = AES_IV_SIZE, ++ .setkey = crypto4xx_setkey_aes_cfb, ++ .encrypt = crypto4xx_encrypt, ++ .decrypt = crypto4xx_decrypt, ++ } ++ } ++ } }, ++ { .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = { ++ .cra_name = "rfc3686(ctr(aes))", ++ .cra_driver_name = "rfc3686-ctr-aes-ppc4xx", ++ .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, ++ .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | ++ CRYPTO_ALG_ASYNC | ++ CRYPTO_ALG_KERN_DRIVER_ONLY, ++ .cra_blocksize = AES_BLOCK_SIZE, ++ .cra_ctxsize = sizeof(struct crypto4xx_ctx), ++ .cra_type = &crypto_ablkcipher_type, ++ .cra_init = crypto4xx_alg_init, ++ .cra_exit = crypto4xx_alg_exit, ++ .cra_module = THIS_MODULE, ++ .cra_u = { ++ .ablkcipher = { ++ .min_keysize = AES_MIN_KEY_SIZE + ++ CTR_RFC3686_NONCE_SIZE, ++ .max_keysize = AES_MAX_KEY_SIZE + ++ CTR_RFC3686_NONCE_SIZE, ++ .ivsize = CTR_RFC3686_IV_SIZE, ++ .setkey = crypto4xx_setkey_rfc3686, ++ .encrypt = crypto4xx_rfc3686_encrypt, ++ .decrypt = crypto4xx_rfc3686_decrypt, ++ } ++ } ++ } }, ++ { .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = { ++ .cra_name = "ecb(aes)", ++ .cra_driver_name = "ecb-aes-ppc4xx", ++ .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, ++ .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | ++ CRYPTO_ALG_ASYNC | ++ CRYPTO_ALG_KERN_DRIVER_ONLY, ++ .cra_blocksize = AES_BLOCK_SIZE, ++ .cra_ctxsize = sizeof(struct crypto4xx_ctx), ++ .cra_type = &crypto_ablkcipher_type, ++ .cra_init = crypto4xx_alg_init, ++ .cra_exit = crypto4xx_alg_exit, ++ .cra_module = THIS_MODULE, ++ .cra_u = { ++ .ablkcipher = { ++ .min_keysize = AES_MIN_KEY_SIZE, ++ .max_keysize = AES_MAX_KEY_SIZE, ++ .setkey = crypto4xx_setkey_aes_ecb, ++ .encrypt = crypto4xx_encrypt, ++ .decrypt = crypto4xx_decrypt, ++ } ++ } ++ } }, ++ { .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = { ++ .cra_name = "ofb(aes)", ++ .cra_driver_name = "ofb-aes-ppc4xx", ++ .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, ++ .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | ++ CRYPTO_ALG_ASYNC | ++ CRYPTO_ALG_KERN_DRIVER_ONLY, ++ .cra_blocksize = AES_BLOCK_SIZE, ++ .cra_ctxsize = sizeof(struct crypto4xx_ctx), ++ .cra_type = &crypto_ablkcipher_type, ++ .cra_init = crypto4xx_alg_init, ++ .cra_exit = crypto4xx_alg_exit, ++ .cra_module = THIS_MODULE, ++ .cra_u = { ++ .ablkcipher = { ++ .min_keysize = AES_MIN_KEY_SIZE, ++ .max_keysize = AES_MAX_KEY_SIZE, ++ .ivsize = AES_IV_SIZE, ++ .setkey = crypto4xx_setkey_aes_cbc, ++ .encrypt = crypto4xx_encrypt, ++ .decrypt = crypto4xx_decrypt, ++ } ++ } ++ } }, + }; + + /** +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -171,8 +171,18 @@ u32 crypto4xx_build_pd(struct crypto_asy + void *iv, u32 iv_len); + int crypto4xx_setkey_aes_cbc(struct crypto_ablkcipher *cipher, + const u8 *key, unsigned int keylen); ++int crypto4xx_setkey_aes_cfb(struct crypto_ablkcipher *cipher, ++ const u8 *key, unsigned int keylen); ++int crypto4xx_setkey_aes_ecb(struct crypto_ablkcipher *cipher, ++ const u8 *key, unsigned int keylen); ++int crypto4xx_setkey_aes_ofb(struct crypto_ablkcipher *cipher, ++ const u8 *key, unsigned int keylen); ++int crypto4xx_setkey_rfc3686(struct crypto_ablkcipher *cipher, ++ const u8 *key, unsigned int keylen); + int crypto4xx_encrypt(struct ablkcipher_request *req); + int crypto4xx_decrypt(struct ablkcipher_request *req); ++int crypto4xx_rfc3686_encrypt(struct ablkcipher_request *req); ++int crypto4xx_rfc3686_decrypt(struct ablkcipher_request *req); + int crypto4xx_sha1_alg_init(struct crypto_tfm *tfm); + int crypto4xx_hash_digest(struct ahash_request *req); + int crypto4xx_hash_final(struct ahash_request *req); +--- a/drivers/crypto/amcc/crypto4xx_sa.h ++++ b/drivers/crypto/amcc/crypto4xx_sa.h +@@ -112,6 +112,9 @@ union sa_command_0 { + + #define CRYPTO_MODE_ECB 0 + #define CRYPTO_MODE_CBC 1 ++#define CRYPTO_MODE_OFB 2 ++#define CRYPTO_MODE_CFB 3 ++#define CRYPTO_MODE_CTR 4 + + #define CRYPTO_FEEDBACK_MODE_NO_FB 0 + #define CRYPTO_FEEDBACK_MODE_64BIT_OFB 0 diff --git a/target/linux/apm821xx/patches-4.14/020-0009-crypto-crypto4xx-refactor-crypto4xx_copy_pkt_to_dst.patch b/target/linux/apm821xx/patches-4.14/020-0009-crypto-crypto4xx-refactor-crypto4xx_copy_pkt_to_dst.patch new file mode 100644 index 0000000000..c6ccade8c1 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0009-crypto-crypto4xx-refactor-crypto4xx_copy_pkt_to_dst.patch @@ -0,0 +1,171 @@ +From 5c727f92ea5e019fd216f73009eee2b6e0867726 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:22 +0200 +Subject: [PATCH 09/25] crypto: crypto4xx - refactor + crypto4xx_copy_pkt_to_dst() + +This patch refactors the crypto4xx_copy_pkt_to_dst() to use +scatterwalk_map_and_copy() to copy the processed data between +the crypto engine's scatter ring buffer and the destination +specified by the ablkcipher_request. + +This also makes the crypto4xx_fill_one_page() function redundant. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 126 +++++++++-------------------------- + 1 file changed, 30 insertions(+), 96 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + #include "crypto4xx_reg_def.h" + #include "crypto4xx_core.h" + #include "crypto4xx_sa.h" +@@ -481,111 +482,44 @@ static inline struct ce_sd *crypto4xx_ge + return (struct ce_sd *)(dev->sdr + sizeof(struct ce_sd) * idx); + } + +-static u32 crypto4xx_fill_one_page(struct crypto4xx_device *dev, +- dma_addr_t *addr, u32 *length, +- u32 *idx, u32 *offset, u32 *nbytes) +-{ +- u32 len; +- +- if (*length > dev->scatter_buffer_size) { +- memcpy(phys_to_virt(*addr), +- dev->scatter_buffer_va + +- *idx * dev->scatter_buffer_size + *offset, +- dev->scatter_buffer_size); +- *offset = 0; +- *length -= dev->scatter_buffer_size; +- *nbytes -= dev->scatter_buffer_size; +- if (*idx == PPC4XX_LAST_SD) +- *idx = 0; +- else +- (*idx)++; +- *addr = *addr + dev->scatter_buffer_size; +- return 1; +- } else if (*length < dev->scatter_buffer_size) { +- memcpy(phys_to_virt(*addr), +- dev->scatter_buffer_va + +- *idx * dev->scatter_buffer_size + *offset, *length); +- if ((*offset + *length) == dev->scatter_buffer_size) { +- if (*idx == PPC4XX_LAST_SD) +- *idx = 0; +- else +- (*idx)++; +- *nbytes -= *length; +- *offset = 0; +- } else { +- *nbytes -= *length; +- *offset += *length; +- } +- +- return 0; +- } else { +- len = (*nbytes <= dev->scatter_buffer_size) ? +- (*nbytes) : dev->scatter_buffer_size; +- memcpy(phys_to_virt(*addr), +- dev->scatter_buffer_va + +- *idx * dev->scatter_buffer_size + *offset, +- len); +- *offset = 0; +- *nbytes -= len; +- +- if (*idx == PPC4XX_LAST_SD) +- *idx = 0; +- else +- (*idx)++; +- +- return 0; +- } +-} +- + static void crypto4xx_copy_pkt_to_dst(struct crypto4xx_device *dev, + struct ce_pd *pd, + struct pd_uinfo *pd_uinfo, + u32 nbytes, + struct scatterlist *dst) + { +- dma_addr_t addr; +- u32 this_sd; +- u32 offset; +- u32 len; +- u32 i; +- u32 sg_len; +- struct scatterlist *sg; +- +- this_sd = pd_uinfo->first_sd; +- offset = 0; +- i = 0; ++ unsigned int first_sd = pd_uinfo->first_sd; ++ unsigned int last_sd; ++ unsigned int overflow = 0; ++ unsigned int to_copy; ++ unsigned int dst_start = 0; ++ ++ /* ++ * Because the scatter buffers are all neatly organized in one ++ * big continuous ringbuffer; scatterwalk_map_and_copy() can ++ * be instructed to copy a range of buffers in one go. ++ */ ++ ++ last_sd = (first_sd + pd_uinfo->num_sd); ++ if (last_sd > PPC4XX_LAST_SD) { ++ last_sd = PPC4XX_LAST_SD; ++ overflow = last_sd % PPC4XX_NUM_SD; ++ } + + while (nbytes) { +- sg = &dst[i]; +- sg_len = sg->length; +- addr = dma_map_page(dev->core_dev->device, sg_page(sg), +- sg->offset, sg->length, DMA_TO_DEVICE); +- +- if (offset == 0) { +- len = (nbytes <= sg->length) ? nbytes : sg->length; +- while (crypto4xx_fill_one_page(dev, &addr, &len, +- &this_sd, &offset, &nbytes)) +- ; +- if (!nbytes) +- return; +- i++; +- } else { +- len = (nbytes <= (dev->scatter_buffer_size - offset)) ? +- nbytes : (dev->scatter_buffer_size - offset); +- len = (sg->length < len) ? sg->length : len; +- while (crypto4xx_fill_one_page(dev, &addr, &len, +- &this_sd, &offset, &nbytes)) +- ; +- if (!nbytes) +- return; +- sg_len -= len; +- if (sg_len) { +- addr += len; +- while (crypto4xx_fill_one_page(dev, &addr, +- &sg_len, &this_sd, &offset, &nbytes)) +- ; +- } +- i++; ++ void *buf = dev->scatter_buffer_va + ++ first_sd * PPC4XX_SD_BUFFER_SIZE; ++ ++ to_copy = min(nbytes, PPC4XX_SD_BUFFER_SIZE * ++ (1 + last_sd - first_sd)); ++ scatterwalk_map_and_copy(buf, dst, dst_start, to_copy, 1); ++ nbytes -= to_copy; ++ ++ if (overflow) { ++ first_sd = 0; ++ last_sd = overflow; ++ dst_start += to_copy; ++ overflow = 0; + } + } + } diff --git a/target/linux/apm821xx/patches-4.14/020-0010-crypto-crypto4xx-replace-crypto4xx_dev-s-scatter_buf.patch b/target/linux/apm821xx/patches-4.14/020-0010-crypto-crypto4xx-replace-crypto4xx_dev-s-scatter_buf.patch new file mode 100644 index 0000000000..90a6dab2d7 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0010-crypto-crypto4xx-replace-crypto4xx_dev-s-scatter_buf.patch @@ -0,0 +1,59 @@ +From 40e3b847bff70edc28c5290d209e531da6f9e534 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:23 +0200 +Subject: [PATCH 10/25] crypto: crypto4xx - replace crypto4xx_dev's + scatter_buffer_size with constant + +scatter_buffer_size is always set to PPC4XX_SD_BUFFER_SIZE. +I don't think there's any point in keeping the variable +around. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 7 +++---- + drivers/crypto/amcc/crypto4xx_core.h | 1 - + 2 files changed, 3 insertions(+), 5 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -394,10 +394,9 @@ static u32 crypto4xx_build_sdr(struct cr + if (!dev->sdr) + return -ENOMEM; + +- dev->scatter_buffer_size = PPC4XX_SD_BUFFER_SIZE; + dev->scatter_buffer_va = + dma_alloc_coherent(dev->core_dev->device, +- dev->scatter_buffer_size * PPC4XX_NUM_SD, ++ PPC4XX_SD_BUFFER_SIZE * PPC4XX_NUM_SD, + &dev->scatter_buffer_pa, GFP_ATOMIC); + if (!dev->scatter_buffer_va) { + dma_free_coherent(dev->core_dev->device, +@@ -410,7 +409,7 @@ static u32 crypto4xx_build_sdr(struct cr + + for (i = 0; i < PPC4XX_NUM_SD; i++) { + sd_array[i].ptr = dev->scatter_buffer_pa + +- dev->scatter_buffer_size * i; ++ PPC4XX_SD_BUFFER_SIZE * i; + } + + return 0; +@@ -425,7 +424,7 @@ static void crypto4xx_destroy_sdr(struct + + if (dev->scatter_buffer_va != NULL) + dma_free_coherent(dev->core_dev->device, +- dev->scatter_buffer_size * PPC4XX_NUM_SD, ++ PPC4XX_SD_BUFFER_SIZE * PPC4XX_NUM_SD, + dev->scatter_buffer_va, + dev->scatter_buffer_pa); + } +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -87,7 +87,6 @@ struct crypto4xx_device { + program ce sdr_base_register */ + void *scatter_buffer_va; + dma_addr_t scatter_buffer_pa; +- u32 scatter_buffer_size; + + void *shadow_sa_pool; /* pool of memory for sa in pd_uinfo */ + dma_addr_t shadow_sa_pool_pa; diff --git a/target/linux/apm821xx/patches-4.14/020-0011-crypto-crypto4xx-fix-crypto4xx_build_pdr-crypto4xx_b.patch b/target/linux/apm821xx/patches-4.14/020-0011-crypto-crypto4xx-fix-crypto4xx_build_pdr-crypto4xx_b.patch new file mode 100644 index 0000000000..837fbdc547 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0011-crypto-crypto4xx-fix-crypto4xx_build_pdr-crypto4xx_b.patch @@ -0,0 +1,84 @@ +From 5d59ad6eea82ef8df92b4109615a0dde9d8093e9 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:24 +0200 +Subject: [PATCH 11/25] crypto: crypto4xx - fix crypto4xx_build_pdr, + crypto4xx_build_sdr leak + +If one of the later memory allocations in rypto4xx_build_pdr() +fails: dev->pdr (and/or) dev->pdr_uinfo wouldn't be freed. + +crypto4xx_build_sdr() has the same issue with dev->sdr. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -209,7 +209,7 @@ static u32 crypto4xx_build_pdr(struct cr + dev->pdr_pa); + return -ENOMEM; + } +- memset(dev->pdr, 0, sizeof(struct ce_pd) * PPC4XX_NUM_PD); ++ memset(dev->pdr, 0, sizeof(struct ce_pd) * PPC4XX_NUM_PD); + dev->shadow_sa_pool = dma_alloc_coherent(dev->core_dev->device, + 256 * PPC4XX_NUM_PD, + &dev->shadow_sa_pool_pa, +@@ -242,13 +242,15 @@ static u32 crypto4xx_build_pdr(struct cr + + static void crypto4xx_destroy_pdr(struct crypto4xx_device *dev) + { +- if (dev->pdr != NULL) ++ if (dev->pdr) + dma_free_coherent(dev->core_dev->device, + sizeof(struct ce_pd) * PPC4XX_NUM_PD, + dev->pdr, dev->pdr_pa); ++ + if (dev->shadow_sa_pool) + dma_free_coherent(dev->core_dev->device, 256 * PPC4XX_NUM_PD, + dev->shadow_sa_pool, dev->shadow_sa_pool_pa); ++ + if (dev->shadow_sr_pool) + dma_free_coherent(dev->core_dev->device, + sizeof(struct sa_state_record) * PPC4XX_NUM_PD, +@@ -417,12 +419,12 @@ static u32 crypto4xx_build_sdr(struct cr + + static void crypto4xx_destroy_sdr(struct crypto4xx_device *dev) + { +- if (dev->sdr != NULL) ++ if (dev->sdr) + dma_free_coherent(dev->core_dev->device, + sizeof(struct ce_sd) * PPC4XX_NUM_SD, + dev->sdr, dev->sdr_pa); + +- if (dev->scatter_buffer_va != NULL) ++ if (dev->scatter_buffer_va) + dma_free_coherent(dev->core_dev->device, + PPC4XX_SD_BUFFER_SIZE * PPC4XX_NUM_SD, + dev->scatter_buffer_va, +@@ -1223,7 +1225,7 @@ static int crypto4xx_probe(struct platfo + + rc = crypto4xx_build_gdr(core_dev->dev); + if (rc) +- goto err_build_gdr; ++ goto err_build_pdr; + + rc = crypto4xx_build_sdr(core_dev->dev); + if (rc) +@@ -1266,12 +1268,11 @@ err_iomap: + err_request_irq: + irq_dispose_mapping(core_dev->irq); + tasklet_kill(&core_dev->tasklet); +- crypto4xx_destroy_sdr(core_dev->dev); + err_build_sdr: ++ crypto4xx_destroy_sdr(core_dev->dev); + crypto4xx_destroy_gdr(core_dev->dev); +-err_build_gdr: +- crypto4xx_destroy_pdr(core_dev->dev); + err_build_pdr: ++ crypto4xx_destroy_pdr(core_dev->dev); + kfree(core_dev->dev); + err_alloc_dev: + kfree(core_dev); diff --git a/target/linux/apm821xx/patches-4.14/020-0012-crypto-crypto4xx-pointer-arithmetic-overhaul.patch b/target/linux/apm821xx/patches-4.14/020-0012-crypto-crypto4xx-pointer-arithmetic-overhaul.patch new file mode 100644 index 0000000000..ee7ee1191e --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0012-crypto-crypto4xx-pointer-arithmetic-overhaul.patch @@ -0,0 +1,373 @@ +From 9e0a0b3a192af20193f074ed2ad9dd85a2e48d00 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:25 +0200 +Subject: [PATCH 12/25] crypto: crypto4xx - pointer arithmetic overhaul + +This patch improves the readability of various functions, +by replacing various void* pointers declarations with +their respective structs *. This makes it possible to go +for the eye-friendly array-indexing methods. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 26 ++++++++-------- + drivers/crypto/amcc/crypto4xx_core.c | 60 +++++++++++++++--------------------- + drivers/crypto/amcc/crypto4xx_core.h | 41 +++++++++++++----------- + 3 files changed, 59 insertions(+), 68 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -134,7 +134,7 @@ static int crypto4xx_setkey_aes(struct c + } + } + /* Setup SA */ +- sa = (struct dynamic_sa_ctl *) ctx->sa_in; ++ sa = ctx->sa_in; + + set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, SA_NOT_SAVE_IV, + SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE, +@@ -159,7 +159,7 @@ static int crypto4xx_setkey_aes(struct c + ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa); + + memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4); +- sa = (struct dynamic_sa_ctl *) ctx->sa_out; ++ sa = ctx->sa_out; + sa->sa_command_0.bf.dir = DIR_OUTBOUND; + + return 0; +@@ -248,8 +248,7 @@ static int crypto4xx_hash_alg_init(struc + struct crypto_alg *alg = tfm->__crt_alg; + struct crypto4xx_alg *my_alg = crypto_alg_to_crypto4xx_alg(alg); + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); +- struct dynamic_sa_ctl *sa; +- struct dynamic_sa_hash160 *sa_in; ++ struct dynamic_sa_hash160 *sa; + int rc; + + ctx->dev = my_alg->dev; +@@ -273,25 +272,24 @@ static int crypto4xx_hash_alg_init(struc + + crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), + sizeof(struct crypto4xx_ctx)); +- sa = (struct dynamic_sa_ctl *) ctx->sa_in; +- set_dynamic_sa_command_0(sa, SA_SAVE_HASH, SA_NOT_SAVE_IV, ++ sa = (struct dynamic_sa_hash160 *)ctx->sa_in; ++ set_dynamic_sa_command_0(&sa->ctrl, SA_SAVE_HASH, SA_NOT_SAVE_IV, + SA_NOT_LOAD_HASH, SA_LOAD_IV_FROM_SA, + SA_NO_HEADER_PROC, ha, SA_CIPHER_ALG_NULL, + SA_PAD_TYPE_ZERO, SA_OP_GROUP_BASIC, + SA_OPCODE_HASH, DIR_INBOUND); +- set_dynamic_sa_command_1(sa, 0, SA_HASH_MODE_HASH, ++ set_dynamic_sa_command_1(&sa->ctrl, 0, SA_HASH_MODE_HASH, + CRYPTO_FEEDBACK_MODE_NO_FB, SA_EXTENDED_SN_OFF, + SA_SEQ_MASK_OFF, SA_MC_ENABLE, + SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD, + SA_NOT_COPY_HDR); + ctx->direction = DIR_INBOUND; +- sa->sa_contents.w = SA_HASH160_CONTENTS; +- sa_in = (struct dynamic_sa_hash160 *) ctx->sa_in; + /* Need to zero hash digest in SA */ +- memset(sa_in->inner_digest, 0, sizeof(sa_in->inner_digest)); +- memset(sa_in->outer_digest, 0, sizeof(sa_in->outer_digest)); +- sa_in->state_ptr = ctx->state_record_dma_addr; +- ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa); ++ memset(sa->inner_digest, 0, sizeof(sa->inner_digest)); ++ memset(sa->outer_digest, 0, sizeof(sa->outer_digest)); ++ sa->state_ptr = ctx->state_record_dma_addr; ++ ctx->offset_to_sr_ptr = ++ get_dynamic_sa_offset_state_ptr_field(&sa->ctrl); + + return 0; + } +@@ -302,7 +300,7 @@ int crypto4xx_hash_init(struct ahash_req + int ds; + struct dynamic_sa_ctl *sa; + +- sa = (struct dynamic_sa_ctl *) ctx->sa_in; ++ sa = ctx->sa_in; + ds = crypto_ahash_digestsize( + __crypto_ahash_cast(req->base.tfm)); + sa->sa_command_0.bf.digest_len = ds >> 2; +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -211,7 +211,7 @@ static u32 crypto4xx_build_pdr(struct cr + } + memset(dev->pdr, 0, sizeof(struct ce_pd) * PPC4XX_NUM_PD); + dev->shadow_sa_pool = dma_alloc_coherent(dev->core_dev->device, +- 256 * PPC4XX_NUM_PD, ++ sizeof(union shadow_sa_buf) * PPC4XX_NUM_PD, + &dev->shadow_sa_pool_pa, + GFP_ATOMIC); + if (!dev->shadow_sa_pool) +@@ -223,16 +223,14 @@ static u32 crypto4xx_build_pdr(struct cr + if (!dev->shadow_sr_pool) + return -ENOMEM; + for (i = 0; i < PPC4XX_NUM_PD; i++) { +- pd_uinfo = (struct pd_uinfo *) (dev->pdr_uinfo + +- sizeof(struct pd_uinfo) * i); ++ pd_uinfo = &dev->pdr_uinfo[i]; + + /* alloc 256 bytes which is enough for any kind of dynamic sa */ +- pd_uinfo->sa_va = dev->shadow_sa_pool + 256 * i; ++ pd_uinfo->sa_va = &dev->shadow_sa_pool[i].sa; + pd_uinfo->sa_pa = dev->shadow_sa_pool_pa + 256 * i; + + /* alloc state record */ +- pd_uinfo->sr_va = dev->shadow_sr_pool + +- sizeof(struct sa_state_record) * i; ++ pd_uinfo->sr_va = &dev->shadow_sr_pool[i]; + pd_uinfo->sr_pa = dev->shadow_sr_pool_pa + + sizeof(struct sa_state_record) * i; + } +@@ -248,8 +246,9 @@ static void crypto4xx_destroy_pdr(struct + dev->pdr, dev->pdr_pa); + + if (dev->shadow_sa_pool) +- dma_free_coherent(dev->core_dev->device, 256 * PPC4XX_NUM_PD, +- dev->shadow_sa_pool, dev->shadow_sa_pool_pa); ++ dma_free_coherent(dev->core_dev->device, ++ sizeof(union shadow_sa_buf) * PPC4XX_NUM_PD, ++ dev->shadow_sa_pool, dev->shadow_sa_pool_pa); + + if (dev->shadow_sr_pool) + dma_free_coherent(dev->core_dev->device, +@@ -277,11 +276,9 @@ static u32 crypto4xx_get_pd_from_pdr_nol + + static u32 crypto4xx_put_pd_to_pdr(struct crypto4xx_device *dev, u32 idx) + { +- struct pd_uinfo *pd_uinfo; ++ struct pd_uinfo *pd_uinfo = &dev->pdr_uinfo[idx]; + unsigned long flags; + +- pd_uinfo = (struct pd_uinfo *)(dev->pdr_uinfo + +- sizeof(struct pd_uinfo) * idx); + spin_lock_irqsave(&dev->core_dev->lock, flags); + if (dev->pdr_tail != PPC4XX_LAST_PD) + dev->pdr_tail++; +@@ -298,7 +295,7 @@ static struct ce_pd *crypto4xx_get_pdp(s + { + *pd_dma = dev->pdr_pa + sizeof(struct ce_pd) * idx; + +- return dev->pdr + sizeof(struct ce_pd) * idx; ++ return &dev->pdr[idx]; + } + + /** +@@ -376,7 +373,7 @@ static inline struct ce_gd *crypto4xx_ge + { + *gd_dma = dev->gdr_pa + sizeof(struct ce_gd) * idx; + +- return (struct ce_gd *) (dev->gdr + sizeof(struct ce_gd) * idx); ++ return &dev->gdr[idx]; + } + + /** +@@ -387,7 +384,6 @@ static inline struct ce_gd *crypto4xx_ge + static u32 crypto4xx_build_sdr(struct crypto4xx_device *dev) + { + int i; +- struct ce_sd *sd_array; + + /* alloc memory for scatter descriptor ring */ + dev->sdr = dma_alloc_coherent(dev->core_dev->device, +@@ -407,10 +403,8 @@ static u32 crypto4xx_build_sdr(struct cr + return -ENOMEM; + } + +- sd_array = dev->sdr; +- + for (i = 0; i < PPC4XX_NUM_SD; i++) { +- sd_array[i].ptr = dev->scatter_buffer_pa + ++ dev->sdr[i].ptr = dev->scatter_buffer_pa + + PPC4XX_SD_BUFFER_SIZE * i; + } + +@@ -480,7 +474,7 @@ static inline struct ce_sd *crypto4xx_ge + { + *sd_dma = dev->sdr_pa + sizeof(struct ce_sd) * idx; + +- return (struct ce_sd *)(dev->sdr + sizeof(struct ce_sd) * idx); ++ return &dev->sdr[idx]; + } + + static void crypto4xx_copy_pkt_to_dst(struct crypto4xx_device *dev, +@@ -529,11 +523,10 @@ static u32 crypto4xx_copy_digest_to_dst( + struct crypto4xx_ctx *ctx) + { + struct dynamic_sa_ctl *sa = (struct dynamic_sa_ctl *) ctx->sa_in; +- struct sa_state_record *state_record = +- (struct sa_state_record *) pd_uinfo->sr_va; + + if (sa->sa_command_0.bf.hash_alg == SA_HASH_ALG_SHA1) { +- memcpy((void *) pd_uinfo->dest_va, state_record->save_digest, ++ memcpy((void *) pd_uinfo->dest_va, ++ pd_uinfo->sr_va->save_digest, + SA_HASH_ALG_SHA1_DIGEST_SIZE); + } + +@@ -607,11 +600,9 @@ static u32 crypto4xx_ahash_done(struct c + + static u32 crypto4xx_pd_done(struct crypto4xx_device *dev, u32 idx) + { +- struct ce_pd *pd; +- struct pd_uinfo *pd_uinfo; ++ struct ce_pd *pd = &dev->pdr[idx]; ++ struct pd_uinfo *pd_uinfo = &dev->pdr_uinfo[idx]; + +- pd = dev->pdr + sizeof(struct ce_pd)*idx; +- pd_uinfo = dev->pdr_uinfo + sizeof(struct pd_uinfo)*idx; + if (crypto_tfm_alg_type(pd_uinfo->async_req->tfm) == + CRYPTO_ALG_TYPE_ABLKCIPHER) + return crypto4xx_ablkcipher_done(dev, pd_uinfo, pd); +@@ -712,7 +703,6 @@ u32 crypto4xx_build_pd(struct crypto_asy + unsigned long flags; + struct pd_uinfo *pd_uinfo = NULL; + unsigned int nbytes = datalen, idx; +- unsigned int ivlen = 0; + u32 gd_idx = 0; + + /* figure how many gd is needed */ +@@ -771,17 +761,15 @@ u32 crypto4xx_build_pd(struct crypto_asy + } + spin_unlock_irqrestore(&dev->core_dev->lock, flags); + +- pd_uinfo = (struct pd_uinfo *)(dev->pdr_uinfo + +- sizeof(struct pd_uinfo) * pd_entry); ++ pd_uinfo = &dev->pdr_uinfo[pd_entry]; + pd = crypto4xx_get_pdp(dev, &pd_dma, pd_entry); + pd_uinfo->async_req = req; + pd_uinfo->num_gd = num_gd; + pd_uinfo->num_sd = num_sd; + + if (iv_len || ctx->is_hash) { +- ivlen = iv_len; + pd->sa = pd_uinfo->sa_pa; +- sa = (struct dynamic_sa_ctl *) pd_uinfo->sa_va; ++ sa = pd_uinfo->sa_va; + if (ctx->direction == DIR_INBOUND) + memcpy(sa, ctx->sa_in, ctx->sa_len * 4); + else +@@ -791,14 +779,15 @@ u32 crypto4xx_build_pd(struct crypto_asy + &pd_uinfo->sr_pa, 4); + + if (iv_len) +- crypto4xx_memcpy_le(pd_uinfo->sr_va, iv, iv_len); ++ crypto4xx_memcpy_le(pd_uinfo->sr_va->save_iv, ++ iv, iv_len); + } else { + if (ctx->direction == DIR_INBOUND) { + pd->sa = ctx->sa_in_dma_addr; +- sa = (struct dynamic_sa_ctl *) ctx->sa_in; ++ sa = ctx->sa_in; + } else { + pd->sa = ctx->sa_out_dma_addr; +- sa = (struct dynamic_sa_ctl *) ctx->sa_out; ++ sa = ctx->sa_out; + } + } + pd->sa_len = ctx->sa_len; +@@ -1006,9 +995,8 @@ static void crypto4xx_bh_tasklet_cb(unsi + + while (core_dev->dev->pdr_head != core_dev->dev->pdr_tail) { + tail = core_dev->dev->pdr_tail; +- pd_uinfo = core_dev->dev->pdr_uinfo + +- sizeof(struct pd_uinfo)*tail; +- pd = core_dev->dev->pdr + sizeof(struct ce_pd) * tail; ++ pd_uinfo = &core_dev->dev->pdr_uinfo[tail]; ++ pd = &core_dev->dev->pdr[tail]; + if ((pd_uinfo->state == PD_ENTRY_INUSE) && + pd->pd_ctl.bf.pe_done && + !pd->pd_ctl.bf.host_ready) { +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -23,6 +23,8 @@ + #define __CRYPTO4XX_CORE_H__ + + #include ++#include "crypto4xx_reg_def.h" ++#include "crypto4xx_sa.h" + + #define MODULE_NAME "crypto4xx" + +@@ -48,6 +50,13 @@ + + struct crypto4xx_device; + ++union shadow_sa_buf { ++ struct dynamic_sa_ctl sa; ++ ++ /* alloc 256 bytes which is enough for any kind of dynamic sa */ ++ u8 buf[256]; ++} __packed; ++ + struct pd_uinfo { + struct crypto4xx_device *dev; + u32 state; +@@ -60,9 +69,9 @@ struct pd_uinfo { + used by this packet */ + u32 num_sd; /* number of scatter discriptors + used by this packet */ +- void *sa_va; /* shadow sa, when using cp from ctx->sa */ ++ struct dynamic_sa_ctl *sa_va; /* shadow sa */ + u32 sa_pa; +- void *sr_va; /* state record for shadow sa */ ++ struct sa_state_record *sr_va; /* state record for shadow sa */ + u32 sr_pa; + struct scatterlist *dest_va; + struct crypto_async_request *async_req; /* base crypto request +@@ -75,22 +84,18 @@ struct crypto4xx_device { + void __iomem *ce_base; + void __iomem *trng_base; + +- void *pdr; /* base address of packet +- descriptor ring */ +- dma_addr_t pdr_pa; /* physical address used to +- program ce pdr_base_register */ +- void *gdr; /* gather descriptor ring */ +- dma_addr_t gdr_pa; /* physical address used to +- program ce gdr_base_register */ +- void *sdr; /* scatter descriptor ring */ +- dma_addr_t sdr_pa; /* physical address used to +- program ce sdr_base_register */ ++ struct ce_pd *pdr; /* base address of packet descriptor ring */ ++ dma_addr_t pdr_pa; /* physical address of pdr_base_register */ ++ struct ce_gd *gdr; /* gather descriptor ring */ ++ dma_addr_t gdr_pa; /* physical address of gdr_base_register */ ++ struct ce_sd *sdr; /* scatter descriptor ring */ ++ dma_addr_t sdr_pa; /* physical address of sdr_base_register */ + void *scatter_buffer_va; + dma_addr_t scatter_buffer_pa; + +- void *shadow_sa_pool; /* pool of memory for sa in pd_uinfo */ ++ union shadow_sa_buf *shadow_sa_pool; + dma_addr_t shadow_sa_pool_pa; +- void *shadow_sr_pool; /* pool of memory for sr in pd_uinfo */ ++ struct sa_state_record *shadow_sr_pool; + dma_addr_t shadow_sr_pool_pa; + u32 pdr_tail; + u32 pdr_head; +@@ -98,7 +103,7 @@ struct crypto4xx_device { + u32 gdr_head; + u32 sdr_tail; + u32 sdr_head; +- void *pdr_uinfo; ++ struct pd_uinfo *pdr_uinfo; + struct list_head alg_list; /* List of algorithm supported + by this device */ + }; +@@ -116,11 +121,11 @@ struct crypto4xx_core_device { + + struct crypto4xx_ctx { + struct crypto4xx_device *dev; +- void *sa_in; ++ struct dynamic_sa_ctl *sa_in; + dma_addr_t sa_in_dma_addr; +- void *sa_out; ++ struct dynamic_sa_ctl *sa_out; + dma_addr_t sa_out_dma_addr; +- void *state_record; ++ struct sa_state_record *state_record; + dma_addr_t state_record_dma_addr; + u32 sa_len; + u32 offset_to_sr_ptr; /* offset to state ptr, in dynamic sa */ diff --git a/target/linux/apm821xx/patches-4.14/020-0013-crypto-crypto4xx-wire-up-hmac_mc-to-hmac_muting.patch b/target/linux/apm821xx/patches-4.14/020-0013-crypto-crypto4xx-wire-up-hmac_mc-to-hmac_muting.patch new file mode 100644 index 0000000000..9ddfcb95f1 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0013-crypto-crypto4xx-wire-up-hmac_mc-to-hmac_muting.patch @@ -0,0 +1,25 @@ +From 5a4326d3a03f03c2518a2c255be33a7114af3230 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:05 +0200 +Subject: [PATCH 13/25] crypto: crypto4xx - wire up hmac_mc to hmac_muting + +The hmac_mc parameter of set_dynamic_sa_command_1() +was defined but not used. On closer inspection it +turns out, it was never wired up. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -63,6 +63,7 @@ static void set_dynamic_sa_command_1(str + sa->sa_command_1.bf.crypto_mode9_8 = cm & 3; + sa->sa_command_1.bf.feedback_mode = cfb, + sa->sa_command_1.bf.sa_rev = 1; ++ sa->sa_command_1.bf.hmac_muting = hmac_mc; + sa->sa_command_1.bf.extended_seq_num = esn; + sa->sa_command_1.bf.seq_num_mask = sn_mask; + sa->sa_command_1.bf.mutable_bit_proc = mute; diff --git a/target/linux/apm821xx/patches-4.14/020-0014-crypto-crypto4xx-fix-off-by-one-AES-OFB.patch b/target/linux/apm821xx/patches-4.14/020-0014-crypto-crypto4xx-fix-off-by-one-AES-OFB.patch new file mode 100644 index 0000000000..acded24bbb --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0014-crypto-crypto4xx-fix-off-by-one-AES-OFB.patch @@ -0,0 +1,49 @@ +From e9b8e4e1129d0886094cfe013cdbaafc4ce0de76 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:06 +0200 +Subject: [PATCH 14/25] crypto: crypto4xx - fix off-by-one AES-OFB + +I used aes-cbc as a template for ofb. But sadly I forgot +to update set_key method to crypto4xx_setkey_aes_ofb(). + +this was caught by the testmgr: +alg: skcipher: Test 1 failed (invalid result) on encr. for ofb-aes-ppc4xx +00000000: 76 49 ab ac 81 19 b2 46 ce e9 8e 9b 12 e9 19 7d +00000010: 50 86 cb 9b 50 72 19 ee 95 db 11 3a 91 76 78 b2 +00000020: 73 be d6 b8 e3 c1 74 3b 71 16 e6 9e 22 22 95 16 +00000030: 3f f1 ca a1 68 1f ac 09 12 0e ca 30 75 86 e1 a7 + +With the correct set_key method, the aes-ofb cipher passes the test. + +name : ofb(aes) +driver : ofb-aes-ppc4xx +module : crypto4xx +priority : 300 +refcnt : 1 +selftest : passed +internal : no +type : ablkcipher +async : yes +blocksize : 16 +min keysize : 16 +max keysize : 32 +ivsize : 16 +geniv : + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1148,7 +1148,7 @@ struct crypto4xx_alg_common crypto4xx_al + .min_keysize = AES_MIN_KEY_SIZE, + .max_keysize = AES_MAX_KEY_SIZE, + .ivsize = AES_IV_SIZE, +- .setkey = crypto4xx_setkey_aes_cbc, ++ .setkey = crypto4xx_setkey_aes_ofb, + .encrypt = crypto4xx_encrypt, + .decrypt = crypto4xx_decrypt, + } diff --git a/target/linux/apm821xx/patches-4.14/020-0015-crypto-crypto4xx-fix-type-mismatch-compiler-error.patch b/target/linux/apm821xx/patches-4.14/020-0015-crypto-crypto4xx-fix-type-mismatch-compiler-error.patch new file mode 100644 index 0000000000..f0f1d0ea5a --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0015-crypto-crypto4xx-fix-type-mismatch-compiler-error.patch @@ -0,0 +1,29 @@ +From 333eb3edda3842f3e5dbd723cb18bbe47eb0508b Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:07 +0200 +Subject: [PATCH 15/25] crypto: crypto4xx - fix type mismatch compiler error + +This patch fixes a type mismatch error that I accidentally +introduced when I moved and refactored the dynamic_contents +helpers. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_sa.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_sa.h ++++ b/drivers/crypto/amcc/crypto4xx_sa.h +@@ -266,9 +266,9 @@ get_dynamic_sa_offset_state_ptr_field(st + return sizeof(struct dynamic_sa_ctl) + offset * 4; + } + +-static inline u8 *get_dynamic_sa_key_field(struct dynamic_sa_ctl *cts) ++static inline u32 *get_dynamic_sa_key_field(struct dynamic_sa_ctl *cts) + { +- return (u8 *) ((unsigned long)cts + sizeof(struct dynamic_sa_ctl)); ++ return (u32 *) ((unsigned long)cts + sizeof(struct dynamic_sa_ctl)); + } + + #endif diff --git a/target/linux/apm821xx/patches-4.14/020-0017-crypto-crypto4xx-add-backlog-queue-support.patch b/target/linux/apm821xx/patches-4.14/020-0017-crypto-crypto4xx-add-backlog-queue-support.patch new file mode 100644 index 0000000000..046dd9c257 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0017-crypto-crypto4xx-add-backlog-queue-support.patch @@ -0,0 +1,161 @@ +From 8ef8d195430ca3542d0434cf25e5115484b9fa32 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:09 +0200 +Subject: [PATCH 17/25] crypto: crypto4xx - add backlog queue support + +Previously, If the crypto4xx driver used all available +security contexts, it would simply refuse new requests +with -EAGAIN. CRYPTO_TFM_REQ_MAY_BACKLOG was ignored. + +in case of dm-crypt.c's crypt_convert() function this was +causing the following errors to manifest, if the system was +pushed hard enough: + +| EXT4-fs warning (dm-1): ext4_end_bio:314: I/O error -5 writing to ino .. +| EXT4-fs warning (dm-1): ext4_end_bio:314: I/O error -5 writing to ino .. +| EXT4-fs warning (dm-1): ext4_end_bio:314: I/O error -5 writing to ino .. +| JBD2: Detected IO errors while flushing file data on dm-1-8 +| Aborting journal on device dm-1-8. +| EXT4-fs error : ext4_journal_check_start:56: Detected aborted journal +| EXT4-fs (dm-1): Remounting filesystem read-only +| EXT4-fs : ext4_writepages: jbd2_start: 2048 pages, inode 498...; err -30 + +(This did cause corruptions due to failed writes) + +To fix this mess, the crypto4xx driver needs to notifiy the +user to slow down. This can be achieved by returning -EBUSY +on requests, once the crypto hardware was falling behind. + +Note: -EBUSY has two different meanings. Setting the flag +CRYPTO_TFM_REQ_MAY_BACKLOG implies that the request was +successfully queued, by the crypto driver. To achieve this +requirement, the implementation introduces a threshold check and +adds logic to the completion routines in much the same way as +AMD's Cryptographic Coprocessor (CCP) driver do. + +Note2: Tests showed that dm-crypt starved ipsec traffic. +Under load, ipsec links dropped to 0 Kbits/s. This is because +dm-crypt's callback would instantly queue the next request. +In order to not starve ipsec, the driver reserves a small +portion of the available crypto contexts for this purpose. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 47 ++++++++++++++++++++++++++++++------ + drivers/crypto/amcc/crypto4xx_core.h | 3 ++- + 2 files changed, 41 insertions(+), 9 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -39,6 +39,7 @@ + #include + #include + #include ++#include + #include "crypto4xx_reg_def.h" + #include "crypto4xx_core.h" + #include "crypto4xx_sa.h" +@@ -573,8 +574,10 @@ static u32 crypto4xx_ablkcipher_done(str + dst->offset, dst->length, DMA_FROM_DEVICE); + } + crypto4xx_ret_sg_desc(dev, pd_uinfo); +- if (ablk_req->base.complete != NULL) +- ablk_req->base.complete(&ablk_req->base, 0); ++ ++ if (pd_uinfo->state & PD_ENTRY_BUSY) ++ ablkcipher_request_complete(ablk_req, -EINPROGRESS); ++ ablkcipher_request_complete(ablk_req, 0); + + return 0; + } +@@ -591,9 +594,10 @@ static u32 crypto4xx_ahash_done(struct c + crypto4xx_copy_digest_to_dst(pd_uinfo, + crypto_tfm_ctx(ahash_req->base.tfm)); + crypto4xx_ret_sg_desc(dev, pd_uinfo); +- /* call user provided callback function x */ +- if (ahash_req->base.complete != NULL) +- ahash_req->base.complete(&ahash_req->base, 0); ++ ++ if (pd_uinfo->state & PD_ENTRY_BUSY) ++ ahash_request_complete(ahash_req, -EINPROGRESS); ++ ahash_request_complete(ahash_req, 0); + + return 0; + } +@@ -704,6 +708,7 @@ u32 crypto4xx_build_pd(struct crypto_asy + struct pd_uinfo *pd_uinfo = NULL; + unsigned int nbytes = datalen, idx; + u32 gd_idx = 0; ++ bool is_busy; + + /* figure how many gd is needed */ + num_gd = sg_nents_for_len(src, datalen); +@@ -734,6 +739,31 @@ u32 crypto4xx_build_pd(struct crypto_asy + * already got must be return the original place. + */ + spin_lock_irqsave(&dev->core_dev->lock, flags); ++ /* ++ * Let the caller know to slow down, once more than 13/16ths = 81% ++ * of the available data contexts are being used simultaneously. ++ * ++ * With PPC4XX_NUM_PD = 256, this will leave a "backlog queue" for ++ * 31 more contexts. Before new requests have to be rejected. ++ */ ++ if (req->flags & CRYPTO_TFM_REQ_MAY_BACKLOG) { ++ is_busy = ((dev->pdr_head - dev->pdr_tail) % PPC4XX_NUM_PD) >= ++ ((PPC4XX_NUM_PD * 13) / 16); ++ } else { ++ /* ++ * To fix contention issues between ipsec (no blacklog) and ++ * dm-crypto (backlog) reserve 32 entries for "no backlog" ++ * data contexts. ++ */ ++ is_busy = ((dev->pdr_head - dev->pdr_tail) % PPC4XX_NUM_PD) >= ++ ((PPC4XX_NUM_PD * 15) / 16); ++ ++ if (is_busy) { ++ spin_unlock_irqrestore(&dev->core_dev->lock, flags); ++ return -EBUSY; ++ } ++ } ++ + if (num_gd) { + fst_gd = crypto4xx_get_n_gd(dev, num_gd); + if (fst_gd == ERING_WAS_FULL) { +@@ -888,11 +918,12 @@ u32 crypto4xx_build_pd(struct crypto_asy + sa->sa_command_1.bf.hash_crypto_offset = 0; + pd->pd_ctl.w = ctx->pd_ctl; + pd->pd_ctl_len.w = 0x00400000 | datalen; +- pd_uinfo->state = PD_ENTRY_INUSE; ++ pd_uinfo->state = PD_ENTRY_INUSE | (is_busy ? PD_ENTRY_BUSY : 0); ++ + wmb(); + /* write any value to push engine to read a pd */ + writel(1, dev->ce_base + CRYPTO4XX_INT_DESCR_RD); +- return -EINPROGRESS; ++ return is_busy ? -EBUSY : -EINPROGRESS; + } + + /** +@@ -997,7 +1028,7 @@ static void crypto4xx_bh_tasklet_cb(unsi + tail = core_dev->dev->pdr_tail; + pd_uinfo = &core_dev->dev->pdr_uinfo[tail]; + pd = &core_dev->dev->pdr[tail]; +- if ((pd_uinfo->state == PD_ENTRY_INUSE) && ++ if ((pd_uinfo->state & PD_ENTRY_INUSE) && + pd->pd_ctl.bf.pe_done && + !pd->pd_ctl.bf.host_ready) { + pd->pd_ctl.bf.pe_done = 0; +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -44,7 +44,8 @@ + #define PPC4XX_LAST_SD (PPC4XX_NUM_SD - 1) + #define PPC4XX_SD_BUFFER_SIZE 2048 + +-#define PD_ENTRY_INUSE 1 ++#define PD_ENTRY_BUSY BIT(1) ++#define PD_ENTRY_INUSE BIT(0) + #define PD_ENTRY_FREE 0 + #define ERING_WAS_FULL 0xffffffff + diff --git a/target/linux/apm821xx/patches-4.14/020-0018-crypto-crypto4xx-use-the-correct-LE32-format-for-IV-.patch b/target/linux/apm821xx/patches-4.14/020-0018-crypto-crypto4xx-use-the-correct-LE32-format-for-IV-.patch new file mode 100644 index 0000000000..22d2a317f5 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0018-crypto-crypto4xx-use-the-correct-LE32-format-for-IV-.patch @@ -0,0 +1,236 @@ +From 4865b122d4aff5151c88d2f7442d5a87f7e795ae Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:10 +0200 +Subject: [PATCH 18/25] crypto: crypto4xx - use the correct LE32 format for IV + and key defs + +The hardware expects that the keys, IVs (and inner/outer hashes) +are in the le32 format. + +This patch changes all hardware interface declarations to use +the correct LE32 data format for each field. + +In order to pass __CHECK_ENDIAN__ checks, crypto4xx_memcpy_le +has to be honest about the endianness of its parameters. +The function was split and moved to the common crypto4xx_core.h +header. This allows the compiler to generate better code if the +sizes/len is a constant (various *_IV_LEN). + +Please note that the hardware isn't consistent with the endiannes +of the save_digest field in the state record struct though. +The hashes produced by GHASH and CBC (for CCM) will be in LE32. +Whereas md5 and sha{1/,256,...} do not need any conversion. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 4 +-- + drivers/crypto/amcc/crypto4xx_core.c | 40 ++---------------------------- + drivers/crypto/amcc/crypto4xx_core.h | 47 +++++++++++++++++++++++++++++++++--- + drivers/crypto/amcc/crypto4xx_sa.h | 29 ++++++++++++---------- + 4 files changed, 64 insertions(+), 56 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -149,8 +149,8 @@ static int crypto4xx_setkey_aes(struct c + SA_SEQ_MASK_OFF, SA_MC_ENABLE, + SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD, + SA_NOT_COPY_HDR); +- crypto4xx_memcpy_le(get_dynamic_sa_key_field(sa), +- key, keylen); ++ crypto4xx_memcpy_to_le32(get_dynamic_sa_key_field(sa), ++ key, keylen); + sa->sa_contents.w = SA_AES_CONTENTS | (keylen << 2); + sa->sa_command_1.bf.key_len = keylen >> 3; + ctx->is_hash = 0; +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -614,42 +614,6 @@ static u32 crypto4xx_pd_done(struct cryp + return crypto4xx_ahash_done(dev, pd_uinfo); + } + +-/** +- * Note: Only use this function to copy items that is word aligned. +- */ +-void crypto4xx_memcpy_le(unsigned int *dst, +- const unsigned char *buf, +- int len) +-{ +- u8 *tmp; +- for (; len >= 4; buf += 4, len -= 4) +- *dst++ = cpu_to_le32(*(unsigned int *) buf); +- +- tmp = (u8 *)dst; +- switch (len) { +- case 3: +- *tmp++ = 0; +- *tmp++ = *(buf+2); +- *tmp++ = *(buf+1); +- *tmp++ = *buf; +- break; +- case 2: +- *tmp++ = 0; +- *tmp++ = 0; +- *tmp++ = *(buf+1); +- *tmp++ = *buf; +- break; +- case 1: +- *tmp++ = 0; +- *tmp++ = 0; +- *tmp++ = 0; +- *tmp++ = *buf; +- break; +- default: +- break; +- } +-} +- + static void crypto4xx_stop_all(struct crypto4xx_core_device *core_dev) + { + crypto4xx_destroy_pdr(core_dev->dev); +@@ -809,8 +773,8 @@ u32 crypto4xx_build_pd(struct crypto_asy + &pd_uinfo->sr_pa, 4); + + if (iv_len) +- crypto4xx_memcpy_le(pd_uinfo->sr_va->save_iv, +- iv, iv_len); ++ crypto4xx_memcpy_to_le32(pd_uinfo->sr_va->save_iv, ++ iv, iv_len); + } else { + if (ctx->direction == DIR_INBOUND) { + pd->sa = ctx->sa_in_dma_addr; +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -166,9 +166,7 @@ int crypto4xx_alloc_sa(struct crypto4xx_ + void crypto4xx_free_sa(struct crypto4xx_ctx *ctx); + void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx); + u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx); +-void crypto4xx_memcpy_le(unsigned int *dst, +- const unsigned char *buf, int len); +-u32 crypto4xx_build_pd(struct crypto_async_request *req, ++int crypto4xx_build_pd(struct crypto_async_request *req, + struct crypto4xx_ctx *ctx, + struct scatterlist *src, + struct scatterlist *dst, +@@ -193,4 +191,47 @@ int crypto4xx_hash_digest(struct ahash_r + int crypto4xx_hash_final(struct ahash_request *req); + int crypto4xx_hash_update(struct ahash_request *req); + int crypto4xx_hash_init(struct ahash_request *req); ++ ++/** ++ * Note: Only use this function to copy items that is word aligned. ++ */ ++static inline void crypto4xx_memcpy_swab32(u32 *dst, const void *buf, ++ size_t len) ++{ ++ for (; len >= 4; buf += 4, len -= 4) ++ *dst++ = __swab32p((u32 *) buf); ++ ++ if (len) { ++ const u8 *tmp = (u8 *)buf; ++ ++ switch (len) { ++ case 3: ++ *dst = (tmp[2] << 16) | ++ (tmp[1] << 8) | ++ tmp[0]; ++ break; ++ case 2: ++ *dst = (tmp[1] << 8) | ++ tmp[0]; ++ break; ++ case 1: ++ *dst = tmp[0]; ++ break; ++ default: ++ break; ++ } ++ } ++} ++ ++static inline void crypto4xx_memcpy_from_le32(u32 *dst, const void *buf, ++ size_t len) ++{ ++ crypto4xx_memcpy_swab32(dst, buf, len); ++} ++ ++static inline void crypto4xx_memcpy_to_le32(__le32 *dst, const void *buf, ++ size_t len) ++{ ++ crypto4xx_memcpy_swab32((u32 *)dst, buf, len); ++} + #endif +--- a/drivers/crypto/amcc/crypto4xx_sa.h ++++ b/drivers/crypto/amcc/crypto4xx_sa.h +@@ -181,9 +181,12 @@ struct dynamic_sa_ctl { + * State Record for Security Association (SA) + */ + struct sa_state_record { +- u32 save_iv[4]; +- u32 save_hash_byte_cnt[2]; +- u32 save_digest[16]; ++ __le32 save_iv[4]; ++ __le32 save_hash_byte_cnt[2]; ++ union { ++ u32 save_digest[16]; /* for MD5/SHA */ ++ __le32 save_digest_le32[16]; /* GHASH / CBC */ ++ }; + } __attribute__((packed)); + + /** +@@ -192,8 +195,8 @@ struct sa_state_record { + */ + struct dynamic_sa_aes128 { + struct dynamic_sa_ctl ctrl; +- u32 key[4]; +- u32 iv[4]; /* for CBC, OFC, and CFB mode */ ++ __le32 key[4]; ++ __le32 iv[4]; /* for CBC, OFC, and CFB mode */ + u32 state_ptr; + u32 reserved; + } __attribute__((packed)); +@@ -206,8 +209,8 @@ struct dynamic_sa_aes128 { + */ + struct dynamic_sa_aes192 { + struct dynamic_sa_ctl ctrl; +- u32 key[6]; +- u32 iv[4]; /* for CBC, OFC, and CFB mode */ ++ __le32 key[6]; ++ __le32 iv[4]; /* for CBC, OFC, and CFB mode */ + u32 state_ptr; + u32 reserved; + } __attribute__((packed)); +@@ -220,8 +223,8 @@ struct dynamic_sa_aes192 { + */ + struct dynamic_sa_aes256 { + struct dynamic_sa_ctl ctrl; +- u32 key[8]; +- u32 iv[4]; /* for CBC, OFC, and CFB mode */ ++ __le32 key[8]; ++ __le32 iv[4]; /* for CBC, OFC, and CFB mode */ + u32 state_ptr; + u32 reserved; + } __attribute__((packed)); +@@ -235,8 +238,8 @@ struct dynamic_sa_aes256 { + */ + struct dynamic_sa_hash160 { + struct dynamic_sa_ctl ctrl; +- u32 inner_digest[5]; +- u32 outer_digest[5]; ++ __le32 inner_digest[5]; ++ __le32 outer_digest[5]; + u32 state_ptr; + u32 reserved; + } __attribute__((packed)); +@@ -266,9 +269,9 @@ get_dynamic_sa_offset_state_ptr_field(st + return sizeof(struct dynamic_sa_ctl) + offset * 4; + } + +-static inline u32 *get_dynamic_sa_key_field(struct dynamic_sa_ctl *cts) ++static inline __le32 *get_dynamic_sa_key_field(struct dynamic_sa_ctl *cts) + { +- return (u32 *) ((unsigned long)cts + sizeof(struct dynamic_sa_ctl)); ++ return (__le32 *) ((unsigned long)cts + sizeof(struct dynamic_sa_ctl)); + } + + #endif diff --git a/target/linux/apm821xx/patches-4.14/020-0019-crypto-crypto4xx-overhaul-crypto4xx_build_pd.patch b/target/linux/apm821xx/patches-4.14/020-0019-crypto-crypto4xx-overhaul-crypto4xx_build_pd.patch new file mode 100644 index 0000000000..7b739c68cd --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0019-crypto-crypto4xx-overhaul-crypto4xx_build_pd.patch @@ -0,0 +1,535 @@ +From cd4dcd6da7a2610e0562a6e130bb68cc544a8fb1 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:11 +0200 +Subject: [PATCH 19/25] crypto: crypto4xx - overhaul crypto4xx_build_pd() + +This patch overhauls and fixes code related to crypto4xx_build_pd() + + * crypto4xx_build_pd() did not handle chained source scatterlist. + This is fixed by replacing the buggy indexed-access of &src[idx] + with sg_next() in the gather array setup loop. + + * The redundant is_hash, direction, save_iv and pd_ctl members + in the crypto4xx_ctx struct have been removed. + - is_hash can be derived from the crypto_async_request parameter. + - direction is already part of the security association's + bf.dir bitfield. + - save_iv is unused. + - pd_ctl always had the host_ready bit enabled anyway. + (the hash_final case is rather pointless, since the ahash + code has been deactivated). + + * make crypto4xx_build_pd()'s caller responsible for converting + the IV to the LE32 format. + + * change crypto4xx_ahash_update() and crypto4xx_ahash_digest() to + initialize a temporary destination scatterlist. This allows the + removal of an ugly cast of req->result (which is a pointer to an + u8-array) to a scatterlist pointer. + + * change crypto4xx_build_pd() return type to int. After all + it returns -EINPROGRESS/-EBUSY. + + * fix crypto4xx_build_pd() thread-unsafe sa handling. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 87 +++++++++++------------- + drivers/crypto/amcc/crypto4xx_core.c | 128 ++++++++++++++++------------------- + drivers/crypto/amcc/crypto4xx_core.h | 12 ++-- + 3 files changed, 103 insertions(+), 124 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -75,27 +75,29 @@ static void set_dynamic_sa_command_1(str + int crypto4xx_encrypt(struct ablkcipher_request *req) + { + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); ++ unsigned int ivlen = crypto_ablkcipher_ivsize( ++ crypto_ablkcipher_reqtfm(req)); ++ __le32 iv[ivlen]; + +- ctx->direction = DIR_OUTBOUND; +- ctx->is_hash = 0; +- ctx->pd_ctl = 0x1; ++ if (ivlen) ++ crypto4xx_memcpy_to_le32(iv, req->info, ivlen); + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, +- req->nbytes, req->info, +- crypto_ablkcipher_ivsize(crypto_ablkcipher_reqtfm(req))); ++ req->nbytes, iv, ivlen, ctx->sa_out, ctx->sa_len); + } + + int crypto4xx_decrypt(struct ablkcipher_request *req) + { + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); ++ unsigned int ivlen = crypto_ablkcipher_ivsize( ++ crypto_ablkcipher_reqtfm(req)); ++ __le32 iv[ivlen]; + +- ctx->direction = DIR_INBOUND; +- ctx->is_hash = 0; +- ctx->pd_ctl = 1; ++ if (ivlen) ++ crypto4xx_memcpy_to_le32(iv, req->info, ivlen); + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, +- req->nbytes, req->info, +- crypto_ablkcipher_ivsize(crypto_ablkcipher_reqtfm(req))); ++ req->nbytes, iv, ivlen, ctx->sa_in, ctx->sa_len); + } + + /** +@@ -153,11 +155,6 @@ static int crypto4xx_setkey_aes(struct c + key, keylen); + sa->sa_contents.w = SA_AES_CONTENTS | (keylen << 2); + sa->sa_command_1.bf.key_len = keylen >> 3; +- ctx->is_hash = 0; +- ctx->direction = DIR_INBOUND; +- memcpy(sa + get_dynamic_sa_offset_state_ptr_field(sa), +- (void *)&ctx->state_record_dma_addr, 4); +- ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa); + + memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4); + sa = ctx->sa_out; +@@ -206,7 +203,7 @@ int crypto4xx_setkey_rfc3686(struct cryp + if (rc) + return rc; + +- memcpy(ctx->state_record, ++ crypto4xx_memcpy_to_le32(ctx->state_record->save_iv, + key + keylen - CTR_RFC3686_NONCE_SIZE, CTR_RFC3686_NONCE_SIZE); + + return 0; +@@ -215,27 +212,29 @@ int crypto4xx_setkey_rfc3686(struct cryp + int crypto4xx_rfc3686_encrypt(struct ablkcipher_request *req) + { + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); +- __be32 iv[AES_IV_SIZE / 4] = { *(u32 *)ctx->state_record, +- *(u32 *) req->info, *(u32 *) (req->info + 4), cpu_to_be32(1) }; +- +- ctx->direction = DIR_OUTBOUND; +- ctx->pd_ctl = 1; ++ __le32 iv[AES_IV_SIZE / 4] = { ++ ctx->state_record->save_iv[0], ++ cpu_to_le32p((u32 *) req->info), ++ cpu_to_le32p((u32 *) (req->info + 4)), ++ cpu_to_le32(1) }; + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, +- req->nbytes, iv, AES_IV_SIZE); ++ req->nbytes, iv, AES_IV_SIZE, ++ ctx->sa_out, ctx->sa_len); + } + + int crypto4xx_rfc3686_decrypt(struct ablkcipher_request *req) + { + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); +- __be32 iv[AES_IV_SIZE / 4] = { *(u32 *)ctx->state_record, +- *(u32 *) req->info, *(u32 *) (req->info + 4), cpu_to_be32(1) }; +- +- ctx->direction = DIR_INBOUND; +- ctx->pd_ctl = 1; ++ __le32 iv[AES_IV_SIZE / 4] = { ++ ctx->state_record->save_iv[0], ++ cpu_to_le32p((u32 *) req->info), ++ cpu_to_le32p((u32 *) (req->info + 4)), ++ cpu_to_le32(1) }; + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, +- req->nbytes, iv, AES_IV_SIZE); ++ req->nbytes, iv, AES_IV_SIZE, ++ ctx->sa_out, ctx->sa_len); + } + + /** +@@ -253,7 +252,6 @@ static int crypto4xx_hash_alg_init(struc + int rc; + + ctx->dev = my_alg->dev; +- ctx->is_hash = 1; + + /* Create SA */ + if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr) +@@ -284,13 +282,9 @@ static int crypto4xx_hash_alg_init(struc + SA_SEQ_MASK_OFF, SA_MC_ENABLE, + SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD, + SA_NOT_COPY_HDR); +- ctx->direction = DIR_INBOUND; + /* Need to zero hash digest in SA */ + memset(sa->inner_digest, 0, sizeof(sa->inner_digest)); + memset(sa->outer_digest, 0, sizeof(sa->outer_digest)); +- sa->state_ptr = ctx->state_record_dma_addr; +- ctx->offset_to_sr_ptr = +- get_dynamic_sa_offset_state_ptr_field(&sa->ctrl); + + return 0; + } +@@ -306,23 +300,22 @@ int crypto4xx_hash_init(struct ahash_req + __crypto_ahash_cast(req->base.tfm)); + sa->sa_command_0.bf.digest_len = ds >> 2; + sa->sa_command_0.bf.load_hash_state = SA_LOAD_HASH_FROM_SA; +- ctx->is_hash = 1; +- ctx->direction = DIR_INBOUND; + + return 0; + } + + int crypto4xx_hash_update(struct ahash_request *req) + { ++ struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); ++ struct scatterlist dst; ++ unsigned int ds = crypto_ahash_digestsize(ahash); ++ ++ sg_init_one(&dst, req->result, ds); + +- ctx->is_hash = 1; +- ctx->pd_ctl = 0x11; +- ctx->direction = DIR_INBOUND; +- +- return crypto4xx_build_pd(&req->base, ctx, req->src, +- (struct scatterlist *) req->result, +- req->nbytes, NULL, 0); ++ return crypto4xx_build_pd(&req->base, ctx, req->src, &dst, ++ req->nbytes, NULL, 0, ctx->sa_in, ++ ctx->sa_len); + } + + int crypto4xx_hash_final(struct ahash_request *req) +@@ -332,14 +325,16 @@ int crypto4xx_hash_final(struct ahash_re + + int crypto4xx_hash_digest(struct ahash_request *req) + { ++ struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); ++ struct scatterlist dst; ++ unsigned int ds = crypto_ahash_digestsize(ahash); + +- ctx->pd_ctl = 0x11; +- ctx->direction = DIR_INBOUND; ++ sg_init_one(&dst, req->result, ds); + +- return crypto4xx_build_pd(&req->base, ctx, req->src, +- (struct scatterlist *) req->result, +- req->nbytes, NULL, 0); ++ return crypto4xx_build_pd(&req->base, ctx, req->src, &dst, ++ req->nbytes, NULL, 0, ctx->sa_in, ++ ctx->sa_len); + } + + /** +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -194,7 +194,6 @@ void crypto4xx_free_state_record(struct + static u32 crypto4xx_build_pdr(struct crypto4xx_device *dev) + { + int i; +- struct pd_uinfo *pd_uinfo; + dev->pdr = dma_alloc_coherent(dev->core_dev->device, + sizeof(struct ce_pd) * PPC4XX_NUM_PD, + &dev->pdr_pa, GFP_ATOMIC); +@@ -224,11 +223,14 @@ static u32 crypto4xx_build_pdr(struct cr + if (!dev->shadow_sr_pool) + return -ENOMEM; + for (i = 0; i < PPC4XX_NUM_PD; i++) { +- pd_uinfo = &dev->pdr_uinfo[i]; ++ struct ce_pd *pd = &dev->pdr[i]; ++ struct pd_uinfo *pd_uinfo = &dev->pdr_uinfo[i]; ++ ++ pd->sa = dev->shadow_sa_pool_pa + ++ sizeof(union shadow_sa_buf) * i; + + /* alloc 256 bytes which is enough for any kind of dynamic sa */ + pd_uinfo->sa_va = &dev->shadow_sa_pool[i].sa; +- pd_uinfo->sa_pa = dev->shadow_sa_pool_pa + 256 * i; + + /* alloc state record */ + pd_uinfo->sr_va = &dev->shadow_sr_pool[i]; +@@ -291,14 +293,6 @@ static u32 crypto4xx_put_pd_to_pdr(struc + return 0; + } + +-static struct ce_pd *crypto4xx_get_pdp(struct crypto4xx_device *dev, +- dma_addr_t *pd_dma, u32 idx) +-{ +- *pd_dma = dev->pdr_pa + sizeof(struct ce_pd) * idx; +- +- return &dev->pdr[idx]; +-} +- + /** + * alloc memory for the gather ring + * no need to alloc buf for the ring +@@ -520,18 +514,16 @@ static void crypto4xx_copy_pkt_to_dst(st + } + } + +-static u32 crypto4xx_copy_digest_to_dst(struct pd_uinfo *pd_uinfo, ++static void crypto4xx_copy_digest_to_dst(void *dst, ++ struct pd_uinfo *pd_uinfo, + struct crypto4xx_ctx *ctx) + { + struct dynamic_sa_ctl *sa = (struct dynamic_sa_ctl *) ctx->sa_in; + + if (sa->sa_command_0.bf.hash_alg == SA_HASH_ALG_SHA1) { +- memcpy((void *) pd_uinfo->dest_va, +- pd_uinfo->sr_va->save_digest, ++ memcpy(dst, pd_uinfo->sr_va->save_digest, + SA_HASH_ALG_SHA1_DIGEST_SIZE); + } +- +- return 0; + } + + static void crypto4xx_ret_sg_desc(struct crypto4xx_device *dev, +@@ -591,7 +583,7 @@ static u32 crypto4xx_ahash_done(struct c + ahash_req = ahash_request_cast(pd_uinfo->async_req); + ctx = crypto_tfm_ctx(ahash_req->base.tfm); + +- crypto4xx_copy_digest_to_dst(pd_uinfo, ++ crypto4xx_copy_digest_to_dst(ahash_req->result, pd_uinfo, + crypto_tfm_ctx(ahash_req->base.tfm)); + crypto4xx_ret_sg_desc(dev, pd_uinfo); + +@@ -651,17 +643,17 @@ static u32 get_next_sd(u32 current) + return 0; + } + +-u32 crypto4xx_build_pd(struct crypto_async_request *req, ++int crypto4xx_build_pd(struct crypto_async_request *req, + struct crypto4xx_ctx *ctx, + struct scatterlist *src, + struct scatterlist *dst, +- unsigned int datalen, +- void *iv, u32 iv_len) ++ const unsigned int datalen, ++ const __le32 *iv, const u32 iv_len, ++ const struct dynamic_sa_ctl *req_sa, ++ const unsigned int sa_len) + { + struct crypto4xx_device *dev = ctx->dev; +- dma_addr_t addr, pd_dma, sd_dma, gd_dma; + struct dynamic_sa_ctl *sa; +- struct scatterlist *sg; + struct ce_gd *gd; + struct ce_pd *pd; + u32 num_gd, num_sd; +@@ -669,8 +661,9 @@ u32 crypto4xx_build_pd(struct crypto_asy + u32 fst_sd = 0xffffffff; + u32 pd_entry; + unsigned long flags; +- struct pd_uinfo *pd_uinfo = NULL; +- unsigned int nbytes = datalen, idx; ++ struct pd_uinfo *pd_uinfo; ++ unsigned int nbytes = datalen; ++ size_t offset_to_sr_ptr; + u32 gd_idx = 0; + bool is_busy; + +@@ -684,7 +677,7 @@ u32 crypto4xx_build_pd(struct crypto_asy + num_gd = 0; + + /* figure how many sd is needed */ +- if (sg_is_last(dst) || ctx->is_hash) { ++ if (sg_is_last(dst)) { + num_sd = 0; + } else { + if (datalen > PPC4XX_SD_BUFFER_SIZE) { +@@ -755,37 +748,27 @@ u32 crypto4xx_build_pd(struct crypto_asy + } + spin_unlock_irqrestore(&dev->core_dev->lock, flags); + ++ pd = &dev->pdr[pd_entry]; ++ pd->sa_len = sa_len; ++ + pd_uinfo = &dev->pdr_uinfo[pd_entry]; +- pd = crypto4xx_get_pdp(dev, &pd_dma, pd_entry); + pd_uinfo->async_req = req; + pd_uinfo->num_gd = num_gd; + pd_uinfo->num_sd = num_sd; + +- if (iv_len || ctx->is_hash) { +- pd->sa = pd_uinfo->sa_pa; +- sa = pd_uinfo->sa_va; +- if (ctx->direction == DIR_INBOUND) +- memcpy(sa, ctx->sa_in, ctx->sa_len * 4); +- else +- memcpy(sa, ctx->sa_out, ctx->sa_len * 4); ++ if (iv_len) ++ memcpy(pd_uinfo->sr_va->save_iv, iv, iv_len); + +- memcpy((void *) sa + ctx->offset_to_sr_ptr, +- &pd_uinfo->sr_pa, 4); ++ sa = pd_uinfo->sa_va; ++ memcpy(sa, req_sa, sa_len * 4); ++ ++ offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa); ++ *(u32 *)((unsigned long)sa + offset_to_sr_ptr) = pd_uinfo->sr_pa; + +- if (iv_len) +- crypto4xx_memcpy_to_le32(pd_uinfo->sr_va->save_iv, +- iv, iv_len); +- } else { +- if (ctx->direction == DIR_INBOUND) { +- pd->sa = ctx->sa_in_dma_addr; +- sa = ctx->sa_in; +- } else { +- pd->sa = ctx->sa_out_dma_addr; +- sa = ctx->sa_out; +- } +- } +- pd->sa_len = ctx->sa_len; + if (num_gd) { ++ dma_addr_t gd_dma; ++ struct scatterlist *sg; ++ + /* get first gd we are going to use */ + gd_idx = fst_gd; + pd_uinfo->first_gd = fst_gd; +@@ -794,27 +777,30 @@ u32 crypto4xx_build_pd(struct crypto_asy + pd->src = gd_dma; + /* enable gather */ + sa->sa_command_0.bf.gather = 1; +- idx = 0; +- src = &src[0]; + /* walk the sg, and setup gather array */ ++ ++ sg = src; + while (nbytes) { +- sg = &src[idx]; +- addr = dma_map_page(dev->core_dev->device, sg_page(sg), +- sg->offset, sg->length, DMA_TO_DEVICE); +- gd->ptr = addr; +- gd->ctl_len.len = sg->length; ++ size_t len; ++ ++ len = min(sg->length, nbytes); ++ gd->ptr = dma_map_page(dev->core_dev->device, ++ sg_page(sg), sg->offset, len, DMA_TO_DEVICE); ++ gd->ctl_len.len = len; + gd->ctl_len.done = 0; + gd->ctl_len.ready = 1; +- if (sg->length >= nbytes) ++ if (len >= nbytes) + break; ++ + nbytes -= sg->length; + gd_idx = get_next_gd(gd_idx); + gd = crypto4xx_get_gdp(dev, &gd_dma, gd_idx); +- idx++; ++ sg = sg_next(sg); + } + } else { + pd->src = (u32)dma_map_page(dev->core_dev->device, sg_page(src), +- src->offset, src->length, DMA_TO_DEVICE); ++ src->offset, min(nbytes, src->length), ++ DMA_TO_DEVICE); + /* + * Disable gather in sa command + */ +@@ -825,25 +811,24 @@ u32 crypto4xx_build_pd(struct crypto_asy + pd_uinfo->first_gd = 0xffffffff; + pd_uinfo->num_gd = 0; + } +- if (ctx->is_hash || sg_is_last(dst)) { ++ if (sg_is_last(dst)) { + /* + * we know application give us dst a whole piece of memory + * no need to use scatter ring. +- * In case of is_hash, the icv is always at end of src data. + */ + pd_uinfo->using_sd = 0; + pd_uinfo->first_sd = 0xffffffff; + pd_uinfo->num_sd = 0; + pd_uinfo->dest_va = dst; + sa->sa_command_0.bf.scatter = 0; +- if (ctx->is_hash) +- pd->dest = virt_to_phys((void *)dst); +- else +- pd->dest = (u32)dma_map_page(dev->core_dev->device, +- sg_page(dst), dst->offset, +- dst->length, DMA_TO_DEVICE); ++ pd->dest = (u32)dma_map_page(dev->core_dev->device, ++ sg_page(dst), dst->offset, ++ min(datalen, dst->length), ++ DMA_TO_DEVICE); + } else { ++ dma_addr_t sd_dma; + struct ce_sd *sd = NULL; ++ + u32 sd_idx = fst_sd; + nbytes = datalen; + sa->sa_command_0.bf.scatter = 1; +@@ -857,7 +842,6 @@ u32 crypto4xx_build_pd(struct crypto_asy + sd->ctl.done = 0; + sd->ctl.rdy = 1; + /* sd->ptr should be setup by sd_init routine*/ +- idx = 0; + if (nbytes >= PPC4XX_SD_BUFFER_SIZE) + nbytes -= PPC4XX_SD_BUFFER_SIZE; + else +@@ -868,19 +852,23 @@ u32 crypto4xx_build_pd(struct crypto_asy + /* setup scatter descriptor */ + sd->ctl.done = 0; + sd->ctl.rdy = 1; +- if (nbytes >= PPC4XX_SD_BUFFER_SIZE) ++ if (nbytes >= PPC4XX_SD_BUFFER_SIZE) { + nbytes -= PPC4XX_SD_BUFFER_SIZE; +- else ++ } else { + /* + * SD entry can hold PPC4XX_SD_BUFFER_SIZE, + * which is more than nbytes, so done. + */ + nbytes = 0; ++ } + } + } + + sa->sa_command_1.bf.hash_crypto_offset = 0; +- pd->pd_ctl.w = ctx->pd_ctl; ++ pd->pd_ctl.w = 0; ++ pd->pd_ctl.bf.hash_final = ++ (crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH); ++ pd->pd_ctl.bf.host_ready = 1; + pd->pd_ctl_len.w = 0x00400000 | datalen; + pd_uinfo->state = PD_ENTRY_INUSE | (is_busy ? PD_ENTRY_BUSY : 0); + +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -71,7 +71,6 @@ struct pd_uinfo { + u32 num_sd; /* number of scatter discriptors + used by this packet */ + struct dynamic_sa_ctl *sa_va; /* shadow sa */ +- u32 sa_pa; + struct sa_state_record *sr_va; /* state record for shadow sa */ + u32 sr_pa; + struct scatterlist *dest_va; +@@ -129,11 +128,6 @@ struct crypto4xx_ctx { + struct sa_state_record *state_record; + dma_addr_t state_record_dma_addr; + u32 sa_len; +- u32 offset_to_sr_ptr; /* offset to state ptr, in dynamic sa */ +- u32 direction; +- u32 save_iv; +- u32 pd_ctl; +- u32 is_hash; + }; + + struct crypto4xx_alg_common { +@@ -170,8 +164,10 @@ int crypto4xx_build_pd(struct crypto_asy + struct crypto4xx_ctx *ctx, + struct scatterlist *src, + struct scatterlist *dst, +- unsigned int datalen, +- void *iv, u32 iv_len); ++ const unsigned int datalen, ++ const __le32 *iv, const u32 iv_len, ++ const struct dynamic_sa_ctl *sa, ++ const unsigned int sa_len); + int crypto4xx_setkey_aes_cbc(struct crypto_ablkcipher *cipher, + const u8 *key, unsigned int keylen); + int crypto4xx_setkey_aes_cfb(struct crypto_ablkcipher *cipher, diff --git a/target/linux/apm821xx/patches-4.14/020-0020-crypto-crypto4xx-fix-various-warnings.patch b/target/linux/apm821xx/patches-4.14/020-0020-crypto-crypto4xx-fix-various-warnings.patch new file mode 100644 index 0000000000..8847d1fcc1 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0020-crypto-crypto4xx-fix-various-warnings.patch @@ -0,0 +1,62 @@ +From 64e1062b2371cb8d6126d4e970832365a1a84562 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:12 +0200 +Subject: [PATCH 20/25] crypto: crypto4xx - fix various warnings + +crypto4xx_core.c:179:6: warning: symbol 'crypto4xx_free_state_record' + was not declared. Should it be static? +crypto4xx_core.c:331:5: warning: symbol 'crypto4xx_get_n_gd' + was not declared. Should it be static? +crypto4xx_core.c:652:6: warning: symbol 'crypto4xx_return_pd' + was not declared. Should it be static? + +crypto4xx_return_pd() is not used by anything. Therefore it is removed. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 16 +++------------- + 1 file changed, 3 insertions(+), 13 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -176,7 +176,7 @@ u32 crypto4xx_alloc_state_record(struct + return 0; + } + +-void crypto4xx_free_state_record(struct crypto4xx_ctx *ctx) ++static void crypto4xx_free_state_record(struct crypto4xx_ctx *ctx) + { + if (ctx->state_record != NULL) + dma_free_coherent(ctx->dev->core_dev->device, +@@ -322,10 +322,11 @@ static inline void crypto4xx_destroy_gdr + * when this function is called. + * preemption or interrupt must be disabled + */ +-u32 crypto4xx_get_n_gd(struct crypto4xx_device *dev, int n) ++static u32 crypto4xx_get_n_gd(struct crypto4xx_device *dev, int n) + { + u32 retval; + u32 tmp; ++ + if (n >= PPC4XX_NUM_GD) + return ERING_WAS_FULL; + +@@ -616,17 +617,6 @@ static void crypto4xx_stop_all(struct cr + kfree(core_dev); + } + +-void crypto4xx_return_pd(struct crypto4xx_device *dev, +- u32 pd_entry, struct ce_pd *pd, +- struct pd_uinfo *pd_uinfo) +-{ +- /* irq should be already disabled */ +- dev->pdr_head = pd_entry; +- pd->pd_ctl.w = 0; +- pd->pd_ctl_len.w = 0; +- pd_uinfo->state = PD_ENTRY_FREE; +-} +- + static u32 get_next_gd(u32 current) + { + if (current != PPC4XX_LAST_GD) diff --git a/target/linux/apm821xx/patches-4.14/020-0021-crypto-crypto4xx-fix-stalls-under-heavy-load.patch b/target/linux/apm821xx/patches-4.14/020-0021-crypto-crypto4xx-fix-stalls-under-heavy-load.patch new file mode 100644 index 0000000000..aa621c52ce --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0021-crypto-crypto4xx-fix-stalls-under-heavy-load.patch @@ -0,0 +1,112 @@ +From 4b5b79998af61db8b0506fba6c0f33b57ea457bd Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:13 +0200 +Subject: [PATCH 21/25] crypto: crypto4xx - fix stalls under heavy load + +If the crypto4xx device is continuously loaded by dm-crypt +and ipsec work, it will start to work intermittent after a +few (between 20-30) seconds, hurting throughput and latency. + +This patch contains various stability improvements in order +to fix this issue. So far, the hardware has survived more +than a day without suffering any stalls under the continuous +load. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 33 ++++++++++++++++++--------------- + drivers/crypto/amcc/crypto4xx_reg_def.h | 3 +++ + 2 files changed, 21 insertions(+), 15 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -280,17 +280,20 @@ static u32 crypto4xx_get_pd_from_pdr_nol + static u32 crypto4xx_put_pd_to_pdr(struct crypto4xx_device *dev, u32 idx) + { + struct pd_uinfo *pd_uinfo = &dev->pdr_uinfo[idx]; ++ u32 tail; + unsigned long flags; + + spin_lock_irqsave(&dev->core_dev->lock, flags); ++ pd_uinfo->state = PD_ENTRY_FREE; ++ + if (dev->pdr_tail != PPC4XX_LAST_PD) + dev->pdr_tail++; + else + dev->pdr_tail = 0; +- pd_uinfo->state = PD_ENTRY_FREE; ++ tail = dev->pdr_tail; + spin_unlock_irqrestore(&dev->core_dev->lock, flags); + +- return 0; ++ return tail; + } + + /** +@@ -854,16 +857,16 @@ int crypto4xx_build_pd(struct crypto_asy + } + } + +- sa->sa_command_1.bf.hash_crypto_offset = 0; +- pd->pd_ctl.w = 0; +- pd->pd_ctl.bf.hash_final = +- (crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH); +- pd->pd_ctl.bf.host_ready = 1; ++ pd->pd_ctl.w = PD_CTL_HOST_READY | ++ ((crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH) | ++ (crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AEAD) ? ++ PD_CTL_HASH_FINAL : 0); + pd->pd_ctl_len.w = 0x00400000 | datalen; + pd_uinfo->state = PD_ENTRY_INUSE | (is_busy ? PD_ENTRY_BUSY : 0); + + wmb(); + /* write any value to push engine to read a pd */ ++ writel(0, dev->ce_base + CRYPTO4XX_INT_DESCR_RD); + writel(1, dev->ce_base + CRYPTO4XX_INT_DESCR_RD); + return is_busy ? -EBUSY : -EINPROGRESS; + } +@@ -964,23 +967,23 @@ static void crypto4xx_bh_tasklet_cb(unsi + struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev); + struct pd_uinfo *pd_uinfo; + struct ce_pd *pd; +- u32 tail; ++ u32 tail = core_dev->dev->pdr_tail; ++ u32 head = core_dev->dev->pdr_head; + +- while (core_dev->dev->pdr_head != core_dev->dev->pdr_tail) { +- tail = core_dev->dev->pdr_tail; ++ do { + pd_uinfo = &core_dev->dev->pdr_uinfo[tail]; + pd = &core_dev->dev->pdr[tail]; + if ((pd_uinfo->state & PD_ENTRY_INUSE) && +- pd->pd_ctl.bf.pe_done && +- !pd->pd_ctl.bf.host_ready) { +- pd->pd_ctl.bf.pe_done = 0; ++ ((READ_ONCE(pd->pd_ctl.w) & ++ (PD_CTL_PE_DONE | PD_CTL_HOST_READY)) == ++ PD_CTL_PE_DONE)) { + crypto4xx_pd_done(core_dev->dev, tail); +- crypto4xx_put_pd_to_pdr(core_dev->dev, tail); ++ tail = crypto4xx_put_pd_to_pdr(core_dev->dev, tail); + } else { + /* if tail not done, break */ + break; + } +- } ++ } while (head != tail); + } + + /** +--- a/drivers/crypto/amcc/crypto4xx_reg_def.h ++++ b/drivers/crypto/amcc/crypto4xx_reg_def.h +@@ -261,6 +261,9 @@ union ce_pd_ctl { + } bf; + u32 w; + } __attribute__((packed)); ++#define PD_CTL_HASH_FINAL BIT(4) ++#define PD_CTL_PE_DONE BIT(1) ++#define PD_CTL_HOST_READY BIT(0) + + union ce_pd_ctl_len { + struct { diff --git a/target/linux/apm821xx/patches-4.14/020-0022-crypto-crypto4xx-simplify-sa-and-state-context-acqui.patch b/target/linux/apm821xx/patches-4.14/020-0022-crypto-crypto4xx-simplify-sa-and-state-context-acqui.patch new file mode 100644 index 0000000000..06ab798f5b --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0022-crypto-crypto4xx-simplify-sa-and-state-context-acqui.patch @@ -0,0 +1,209 @@ +From 2f77690dcb96e525bc6b57bce4a0eaecaa2878d1 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:14 +0200 +Subject: [PATCH 22/25] crypto: crypto4xx - simplify sa and state context + acquisition + +Thanks to the big overhaul of crypto4xx_build_pd(), the request-local +sa_in, sa_out and state_record allocation can be simplified. + +There's no need to setup any dma coherent memory anymore and +much of the support code can be removed. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 27 +++++-------------- + drivers/crypto/amcc/crypto4xx_core.c | 50 ++++++------------------------------ + drivers/crypto/amcc/crypto4xx_core.h | 6 +---- + 3 files changed, 15 insertions(+), 68 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -122,20 +122,13 @@ static int crypto4xx_setkey_aes(struct c + } + + /* Create SA */ +- if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr) ++ if (ctx->sa_in || ctx->sa_out) + crypto4xx_free_sa(ctx); + + rc = crypto4xx_alloc_sa(ctx, SA_AES128_LEN + (keylen-16) / 4); + if (rc) + return rc; + +- if (ctx->state_record_dma_addr == 0) { +- rc = crypto4xx_alloc_state_record(ctx); +- if (rc) { +- crypto4xx_free_sa(ctx); +- return rc; +- } +- } + /* Setup SA */ + sa = ctx->sa_in; + +@@ -203,8 +196,8 @@ int crypto4xx_setkey_rfc3686(struct cryp + if (rc) + return rc; + +- crypto4xx_memcpy_to_le32(ctx->state_record->save_iv, +- key + keylen - CTR_RFC3686_NONCE_SIZE, CTR_RFC3686_NONCE_SIZE); ++ ctx->iv_nonce = cpu_to_le32p((u32 *)&key[keylen - ++ CTR_RFC3686_NONCE_SIZE]); + + return 0; + } +@@ -213,7 +206,7 @@ int crypto4xx_rfc3686_encrypt(struct abl + { + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); + __le32 iv[AES_IV_SIZE / 4] = { +- ctx->state_record->save_iv[0], ++ ctx->iv_nonce, + cpu_to_le32p((u32 *) req->info), + cpu_to_le32p((u32 *) (req->info + 4)), + cpu_to_le32(1) }; +@@ -227,7 +220,7 @@ int crypto4xx_rfc3686_decrypt(struct abl + { + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); + __le32 iv[AES_IV_SIZE / 4] = { +- ctx->state_record->save_iv[0], ++ ctx->iv_nonce, + cpu_to_le32p((u32 *) req->info), + cpu_to_le32p((u32 *) (req->info + 4)), + cpu_to_le32(1) }; +@@ -254,21 +247,13 @@ static int crypto4xx_hash_alg_init(struc + ctx->dev = my_alg->dev; + + /* Create SA */ +- if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr) ++ if (ctx->sa_in || ctx->sa_out) + crypto4xx_free_sa(ctx); + + rc = crypto4xx_alloc_sa(ctx, sa_len); + if (rc) + return rc; + +- if (ctx->state_record_dma_addr == 0) { +- crypto4xx_alloc_state_record(ctx); +- if (!ctx->state_record_dma_addr) { +- crypto4xx_free_sa(ctx); +- return -ENOMEM; +- } +- } +- + crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), + sizeof(struct crypto4xx_ctx)); + sa = (struct dynamic_sa_hash160 *)ctx->sa_in; +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -130,21 +130,17 @@ static void crypto4xx_hw_init(struct cry + + int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size) + { +- ctx->sa_in = dma_alloc_coherent(ctx->dev->core_dev->device, size * 4, +- &ctx->sa_in_dma_addr, GFP_ATOMIC); ++ ctx->sa_in = kzalloc(size * 4, GFP_ATOMIC); + if (ctx->sa_in == NULL) + return -ENOMEM; + +- ctx->sa_out = dma_alloc_coherent(ctx->dev->core_dev->device, size * 4, +- &ctx->sa_out_dma_addr, GFP_ATOMIC); ++ ctx->sa_out = kzalloc(size * 4, GFP_ATOMIC); + if (ctx->sa_out == NULL) { +- dma_free_coherent(ctx->dev->core_dev->device, size * 4, +- ctx->sa_in, ctx->sa_in_dma_addr); ++ kfree(ctx->sa_in); ++ ctx->sa_in = NULL; + return -ENOMEM; + } + +- memset(ctx->sa_in, 0, size * 4); +- memset(ctx->sa_out, 0, size * 4); + ctx->sa_len = size; + + return 0; +@@ -152,40 +148,13 @@ int crypto4xx_alloc_sa(struct crypto4xx_ + + void crypto4xx_free_sa(struct crypto4xx_ctx *ctx) + { +- if (ctx->sa_in != NULL) +- dma_free_coherent(ctx->dev->core_dev->device, ctx->sa_len * 4, +- ctx->sa_in, ctx->sa_in_dma_addr); +- if (ctx->sa_out != NULL) +- dma_free_coherent(ctx->dev->core_dev->device, ctx->sa_len * 4, +- ctx->sa_out, ctx->sa_out_dma_addr); +- +- ctx->sa_in_dma_addr = 0; +- ctx->sa_out_dma_addr = 0; ++ kfree(ctx->sa_in); ++ ctx->sa_in = NULL; ++ kfree(ctx->sa_out); ++ ctx->sa_out = NULL; + ctx->sa_len = 0; + } + +-u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx) +-{ +- ctx->state_record = dma_alloc_coherent(ctx->dev->core_dev->device, +- sizeof(struct sa_state_record), +- &ctx->state_record_dma_addr, GFP_ATOMIC); +- if (!ctx->state_record_dma_addr) +- return -ENOMEM; +- memset(ctx->state_record, 0, sizeof(struct sa_state_record)); +- +- return 0; +-} +- +-static void crypto4xx_free_state_record(struct crypto4xx_ctx *ctx) +-{ +- if (ctx->state_record != NULL) +- dma_free_coherent(ctx->dev->core_dev->device, +- sizeof(struct sa_state_record), +- ctx->state_record, +- ctx->state_record_dma_addr); +- ctx->state_record_dma_addr = 0; +-} +- + /** + * alloc memory for the gather ring + * no need to alloc buf for the ring +@@ -883,8 +852,6 @@ static int crypto4xx_alg_init(struct cry + ctx->dev = amcc_alg->dev; + ctx->sa_in = NULL; + ctx->sa_out = NULL; +- ctx->sa_in_dma_addr = 0; +- ctx->sa_out_dma_addr = 0; + ctx->sa_len = 0; + + switch (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) { +@@ -905,7 +872,6 @@ static void crypto4xx_alg_exit(struct cr + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); + + crypto4xx_free_sa(ctx); +- crypto4xx_free_state_record(ctx); + } + + int crypto4xx_register_alg(struct crypto4xx_device *sec_dev, +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -122,11 +122,8 @@ struct crypto4xx_core_device { + struct crypto4xx_ctx { + struct crypto4xx_device *dev; + struct dynamic_sa_ctl *sa_in; +- dma_addr_t sa_in_dma_addr; + struct dynamic_sa_ctl *sa_out; +- dma_addr_t sa_out_dma_addr; +- struct sa_state_record *state_record; +- dma_addr_t state_record_dma_addr; ++ __le32 iv_nonce; + u32 sa_len; + }; + +@@ -159,7 +156,6 @@ static inline struct crypto4xx_alg *cryp + int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size); + void crypto4xx_free_sa(struct crypto4xx_ctx *ctx); + void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx); +-u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx); + int crypto4xx_build_pd(struct crypto_async_request *req, + struct crypto4xx_ctx *ctx, + struct scatterlist *src, diff --git a/target/linux/apm821xx/patches-4.14/020-0023-crypto-crypto4xx-prepare-for-AEAD-support.patch b/target/linux/apm821xx/patches-4.14/020-0023-crypto-crypto4xx-prepare-for-AEAD-support.patch new file mode 100644 index 0000000000..ff19c4f54e --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0023-crypto-crypto4xx-prepare-for-AEAD-support.patch @@ -0,0 +1,617 @@ +From a0aae821ba3d35a49d4d0143dfb0c07eee22130e Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:15 +0200 +Subject: [PATCH 23/25] crypto: crypto4xx - prepare for AEAD support + +This patch enhances existing interfaces and +functions to support AEAD ciphers in the next +patches. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 19 +-- + drivers/crypto/amcc/crypto4xx_core.c | 217 +++++++++++++++++++++++++++-------- + drivers/crypto/amcc/crypto4xx_core.h | 22 ++-- + drivers/crypto/amcc/crypto4xx_sa.h | 41 +++++++ + 4 files changed, 226 insertions(+), 73 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -83,7 +84,7 @@ int crypto4xx_encrypt(struct ablkcipher_ + crypto4xx_memcpy_to_le32(iv, req->info, ivlen); + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, +- req->nbytes, iv, ivlen, ctx->sa_out, ctx->sa_len); ++ req->nbytes, iv, ivlen, ctx->sa_out, ctx->sa_len, 0); + } + + int crypto4xx_decrypt(struct ablkcipher_request *req) +@@ -97,7 +98,7 @@ int crypto4xx_decrypt(struct ablkcipher_ + crypto4xx_memcpy_to_le32(iv, req->info, ivlen); + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, +- req->nbytes, iv, ivlen, ctx->sa_in, ctx->sa_len); ++ req->nbytes, iv, ivlen, ctx->sa_in, ctx->sa_len, 0); + } + + /** +@@ -213,7 +214,7 @@ int crypto4xx_rfc3686_encrypt(struct abl + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, + req->nbytes, iv, AES_IV_SIZE, +- ctx->sa_out, ctx->sa_len); ++ ctx->sa_out, ctx->sa_len, 0); + } + + int crypto4xx_rfc3686_decrypt(struct ablkcipher_request *req) +@@ -227,7 +228,7 @@ int crypto4xx_rfc3686_decrypt(struct abl + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, + req->nbytes, iv, AES_IV_SIZE, +- ctx->sa_out, ctx->sa_len); ++ ctx->sa_out, ctx->sa_len, 0); + } + + /** +@@ -239,11 +240,13 @@ static int crypto4xx_hash_alg_init(struc + unsigned char hm) + { + struct crypto_alg *alg = tfm->__crt_alg; +- struct crypto4xx_alg *my_alg = crypto_alg_to_crypto4xx_alg(alg); ++ struct crypto4xx_alg *my_alg; + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); + struct dynamic_sa_hash160 *sa; + int rc; + ++ my_alg = container_of(__crypto_ahash_alg(alg), struct crypto4xx_alg, ++ alg.u.hash); + ctx->dev = my_alg->dev; + + /* Create SA */ +@@ -300,7 +303,7 @@ int crypto4xx_hash_update(struct ahash_r + + return crypto4xx_build_pd(&req->base, ctx, req->src, &dst, + req->nbytes, NULL, 0, ctx->sa_in, +- ctx->sa_len); ++ ctx->sa_len, 0); + } + + int crypto4xx_hash_final(struct ahash_request *req) +@@ -319,7 +322,7 @@ int crypto4xx_hash_digest(struct ahash_r + + return crypto4xx_build_pd(&req->base, ctx, req->src, &dst, + req->nbytes, NULL, 0, ctx->sa_in, +- ctx->sa_len); ++ ctx->sa_len, 0); + } + + /** +@@ -330,5 +333,3 @@ int crypto4xx_sha1_alg_init(struct crypt + return crypto4xx_hash_alg_init(tfm, SA_HASH160_LEN, SA_HASH_ALG_SHA1, + SA_HASH_MODE_HASH); + } +- +- +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -35,10 +35,12 @@ + #include + #include + #include ++#include + #include + #include + #include + #include ++#include + #include + #include "crypto4xx_reg_def.h" + #include "crypto4xx_core.h" +@@ -518,7 +520,7 @@ static void crypto4xx_ret_sg_desc(struct + } + } + +-static u32 crypto4xx_ablkcipher_done(struct crypto4xx_device *dev, ++static void crypto4xx_ablkcipher_done(struct crypto4xx_device *dev, + struct pd_uinfo *pd_uinfo, + struct ce_pd *pd) + { +@@ -543,11 +545,9 @@ static u32 crypto4xx_ablkcipher_done(str + if (pd_uinfo->state & PD_ENTRY_BUSY) + ablkcipher_request_complete(ablk_req, -EINPROGRESS); + ablkcipher_request_complete(ablk_req, 0); +- +- return 0; + } + +-static u32 crypto4xx_ahash_done(struct crypto4xx_device *dev, ++static void crypto4xx_ahash_done(struct crypto4xx_device *dev, + struct pd_uinfo *pd_uinfo) + { + struct crypto4xx_ctx *ctx; +@@ -563,20 +563,88 @@ static u32 crypto4xx_ahash_done(struct c + if (pd_uinfo->state & PD_ENTRY_BUSY) + ahash_request_complete(ahash_req, -EINPROGRESS); + ahash_request_complete(ahash_req, 0); ++} + +- return 0; ++static void crypto4xx_aead_done(struct crypto4xx_device *dev, ++ struct pd_uinfo *pd_uinfo, ++ struct ce_pd *pd) ++{ ++ struct aead_request *aead_req; ++ struct crypto4xx_ctx *ctx; ++ struct scatterlist *dst = pd_uinfo->dest_va; ++ int err = 0; ++ ++ aead_req = container_of(pd_uinfo->async_req, struct aead_request, ++ base); ++ ctx = crypto_tfm_ctx(aead_req->base.tfm); ++ ++ if (pd_uinfo->using_sd) { ++ crypto4xx_copy_pkt_to_dst(dev, pd, pd_uinfo, ++ pd->pd_ctl_len.bf.pkt_len, ++ dst); ++ } else { ++ __dma_sync_page(sg_page(dst), dst->offset, dst->length, ++ DMA_FROM_DEVICE); ++ } ++ ++ if (pd_uinfo->sa_va->sa_command_0.bf.dir == DIR_OUTBOUND) { ++ /* append icv at the end */ ++ size_t cp_len = crypto_aead_authsize( ++ crypto_aead_reqtfm(aead_req)); ++ u32 icv[cp_len]; ++ ++ crypto4xx_memcpy_from_le32(icv, pd_uinfo->sr_va->save_digest, ++ cp_len); ++ ++ scatterwalk_map_and_copy(icv, dst, aead_req->cryptlen, ++ cp_len, 1); ++ } ++ ++ crypto4xx_ret_sg_desc(dev, pd_uinfo); ++ ++ if (pd->pd_ctl.bf.status & 0xff) { ++ if (pd->pd_ctl.bf.status & 0x1) { ++ /* authentication error */ ++ err = -EBADMSG; ++ } else { ++ if (!__ratelimit(&dev->aead_ratelimit)) { ++ if (pd->pd_ctl.bf.status & 2) ++ pr_err("pad fail error\n"); ++ if (pd->pd_ctl.bf.status & 4) ++ pr_err("seqnum fail\n"); ++ if (pd->pd_ctl.bf.status & 8) ++ pr_err("error _notify\n"); ++ pr_err("aead return err status = 0x%02x\n", ++ pd->pd_ctl.bf.status & 0xff); ++ pr_err("pd pad_ctl = 0x%08x\n", ++ pd->pd_ctl.bf.pd_pad_ctl); ++ } ++ err = -EINVAL; ++ } ++ } ++ ++ if (pd_uinfo->state & PD_ENTRY_BUSY) ++ aead_request_complete(aead_req, -EINPROGRESS); ++ ++ aead_request_complete(aead_req, err); + } + +-static u32 crypto4xx_pd_done(struct crypto4xx_device *dev, u32 idx) ++static void crypto4xx_pd_done(struct crypto4xx_device *dev, u32 idx) + { + struct ce_pd *pd = &dev->pdr[idx]; + struct pd_uinfo *pd_uinfo = &dev->pdr_uinfo[idx]; + +- if (crypto_tfm_alg_type(pd_uinfo->async_req->tfm) == +- CRYPTO_ALG_TYPE_ABLKCIPHER) +- return crypto4xx_ablkcipher_done(dev, pd_uinfo, pd); +- else +- return crypto4xx_ahash_done(dev, pd_uinfo); ++ switch (crypto_tfm_alg_type(pd_uinfo->async_req->tfm)) { ++ case CRYPTO_ALG_TYPE_ABLKCIPHER: ++ crypto4xx_ablkcipher_done(dev, pd_uinfo, pd); ++ break; ++ case CRYPTO_ALG_TYPE_AEAD: ++ crypto4xx_aead_done(dev, pd_uinfo, pd); ++ break; ++ case CRYPTO_ALG_TYPE_AHASH: ++ crypto4xx_ahash_done(dev, pd_uinfo); ++ break; ++ } + } + + static void crypto4xx_stop_all(struct crypto4xx_core_device *core_dev) +@@ -612,8 +680,10 @@ int crypto4xx_build_pd(struct crypto_asy + const unsigned int datalen, + const __le32 *iv, const u32 iv_len, + const struct dynamic_sa_ctl *req_sa, +- const unsigned int sa_len) ++ const unsigned int sa_len, ++ const unsigned int assoclen) + { ++ struct scatterlist _dst[2]; + struct crypto4xx_device *dev = ctx->dev; + struct dynamic_sa_ctl *sa; + struct ce_gd *gd; +@@ -627,18 +697,25 @@ int crypto4xx_build_pd(struct crypto_asy + unsigned int nbytes = datalen; + size_t offset_to_sr_ptr; + u32 gd_idx = 0; ++ int tmp; + bool is_busy; + +- /* figure how many gd is needed */ +- num_gd = sg_nents_for_len(src, datalen); +- if ((int)num_gd < 0) { ++ /* figure how many gd are needed */ ++ tmp = sg_nents_for_len(src, assoclen + datalen); ++ if (tmp < 0) { + dev_err(dev->core_dev->device, "Invalid number of src SG.\n"); +- return -EINVAL; ++ return tmp; + } +- if (num_gd == 1) +- num_gd = 0; ++ if (tmp == 1) ++ tmp = 0; ++ num_gd = tmp; + +- /* figure how many sd is needed */ ++ if (assoclen) { ++ nbytes += assoclen; ++ dst = scatterwalk_ffwd(_dst, dst, assoclen); ++ } ++ ++ /* figure how many sd are needed */ + if (sg_is_last(dst)) { + num_sd = 0; + } else { +@@ -724,6 +801,7 @@ int crypto4xx_build_pd(struct crypto_asy + sa = pd_uinfo->sa_va; + memcpy(sa, req_sa, sa_len * 4); + ++ sa->sa_command_1.bf.hash_crypto_offset = (assoclen >> 2); + offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa); + *(u32 *)((unsigned long)sa + offset_to_sr_ptr) = pd_uinfo->sr_pa; + +@@ -830,7 +908,7 @@ int crypto4xx_build_pd(struct crypto_asy + ((crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH) | + (crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AEAD) ? + PD_CTL_HASH_FINAL : 0); +- pd->pd_ctl_len.w = 0x00400000 | datalen; ++ pd->pd_ctl_len.w = 0x00400000 | (assoclen + datalen); + pd_uinfo->state = PD_ENTRY_INUSE | (is_busy ? PD_ENTRY_BUSY : 0); + + wmb(); +@@ -843,40 +921,68 @@ int crypto4xx_build_pd(struct crypto_asy + /** + * Algorithm Registration Functions + */ +-static int crypto4xx_alg_init(struct crypto_tfm *tfm) ++static void crypto4xx_ctx_init(struct crypto4xx_alg *amcc_alg, ++ struct crypto4xx_ctx *ctx) + { +- struct crypto_alg *alg = tfm->__crt_alg; +- struct crypto4xx_alg *amcc_alg = crypto_alg_to_crypto4xx_alg(alg); +- struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); +- + ctx->dev = amcc_alg->dev; + ctx->sa_in = NULL; + ctx->sa_out = NULL; + ctx->sa_len = 0; ++} + +- switch (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) { +- default: +- tfm->crt_ablkcipher.reqsize = sizeof(struct crypto4xx_ctx); +- break; +- case CRYPTO_ALG_TYPE_AHASH: +- crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), +- sizeof(struct crypto4xx_ctx)); +- break; +- } ++static int crypto4xx_ablk_init(struct crypto_tfm *tfm) ++{ ++ struct crypto_alg *alg = tfm->__crt_alg; ++ struct crypto4xx_alg *amcc_alg; ++ struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); + ++ amcc_alg = container_of(alg, struct crypto4xx_alg, alg.u.cipher); ++ crypto4xx_ctx_init(amcc_alg, ctx); ++ tfm->crt_ablkcipher.reqsize = sizeof(struct crypto4xx_ctx); + return 0; + } + +-static void crypto4xx_alg_exit(struct crypto_tfm *tfm) ++static void crypto4xx_common_exit(struct crypto4xx_ctx *ctx) + { +- struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); +- + crypto4xx_free_sa(ctx); + } + +-int crypto4xx_register_alg(struct crypto4xx_device *sec_dev, +- struct crypto4xx_alg_common *crypto_alg, +- int array_size) ++static void crypto4xx_ablk_exit(struct crypto_tfm *tfm) ++{ ++ crypto4xx_common_exit(crypto_tfm_ctx(tfm)); ++} ++ ++static int crypto4xx_aead_init(struct crypto_aead *tfm) ++{ ++ struct aead_alg *alg = crypto_aead_alg(tfm); ++ struct crypto4xx_ctx *ctx = crypto_aead_ctx(tfm); ++ struct crypto4xx_alg *amcc_alg; ++ ++ ctx->sw_cipher.aead = crypto_alloc_aead(alg->base.cra_name, 0, ++ CRYPTO_ALG_NEED_FALLBACK | ++ CRYPTO_ALG_ASYNC); ++ if (IS_ERR(ctx->sw_cipher.aead)) ++ return PTR_ERR(ctx->sw_cipher.aead); ++ ++ amcc_alg = container_of(alg, struct crypto4xx_alg, alg.u.aead); ++ crypto4xx_ctx_init(amcc_alg, ctx); ++ crypto_aead_set_reqsize(tfm, sizeof(struct aead_request) + ++ max(sizeof(struct crypto4xx_ctx), 32 + ++ crypto_aead_reqsize(ctx->sw_cipher.aead))); ++ return 0; ++} ++ ++static void crypto4xx_aead_exit(struct crypto_aead *tfm) ++{ ++ struct crypto4xx_ctx *ctx = crypto_aead_ctx(tfm); ++ ++ crypto4xx_common_exit(ctx); ++ crypto_free_aead(ctx->sw_cipher.aead); ++} ++ ++static int crypto4xx_register_alg(struct crypto4xx_device *sec_dev, ++ struct crypto4xx_alg_common *crypto_alg, ++ int array_size) + { + struct crypto4xx_alg *alg; + int i; +@@ -891,6 +997,10 @@ int crypto4xx_register_alg(struct crypto + alg->dev = sec_dev; + + switch (alg->alg.type) { ++ case CRYPTO_ALG_TYPE_AEAD: ++ rc = crypto_register_aead(&alg->alg.u.aead); ++ break; ++ + case CRYPTO_ALG_TYPE_AHASH: + rc = crypto_register_ahash(&alg->alg.u.hash); + break; +@@ -920,6 +1030,10 @@ static void crypto4xx_unregister_alg(str + crypto_unregister_ahash(&alg->alg.u.hash); + break; + ++ case CRYPTO_ALG_TYPE_AEAD: ++ crypto_unregister_aead(&alg->alg.u.aead); ++ break; ++ + default: + crypto_unregister_alg(&alg->alg.u.cipher); + } +@@ -973,7 +1087,7 @@ static irqreturn_t crypto4xx_ce_interrup + /** + * Supported Crypto Algorithms + */ +-struct crypto4xx_alg_common crypto4xx_alg[] = { ++static struct crypto4xx_alg_common crypto4xx_alg[] = { + /* Crypto AES modes */ + { .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = { + .cra_name = "cbc(aes)", +@@ -985,8 +1099,8 @@ struct crypto4xx_alg_common crypto4xx_al + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), + .cra_type = &crypto_ablkcipher_type, +- .cra_init = crypto4xx_alg_init, +- .cra_exit = crypto4xx_alg_exit, ++ .cra_init = crypto4xx_ablk_init, ++ .cra_exit = crypto4xx_ablk_exit, + .cra_module = THIS_MODULE, + .cra_u = { + .ablkcipher = { +@@ -1009,8 +1123,8 @@ struct crypto4xx_alg_common crypto4xx_al + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), + .cra_type = &crypto_ablkcipher_type, +- .cra_init = crypto4xx_alg_init, +- .cra_exit = crypto4xx_alg_exit, ++ .cra_init = crypto4xx_ablk_init, ++ .cra_exit = crypto4xx_ablk_exit, + .cra_module = THIS_MODULE, + .cra_u = { + .ablkcipher = { +@@ -1033,8 +1147,8 @@ struct crypto4xx_alg_common crypto4xx_al + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), + .cra_type = &crypto_ablkcipher_type, +- .cra_init = crypto4xx_alg_init, +- .cra_exit = crypto4xx_alg_exit, ++ .cra_init = crypto4xx_ablk_init, ++ .cra_exit = crypto4xx_ablk_exit, + .cra_module = THIS_MODULE, + .cra_u = { + .ablkcipher = { +@@ -1059,8 +1173,8 @@ struct crypto4xx_alg_common crypto4xx_al + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), + .cra_type = &crypto_ablkcipher_type, +- .cra_init = crypto4xx_alg_init, +- .cra_exit = crypto4xx_alg_exit, ++ .cra_init = crypto4xx_ablk_init, ++ .cra_exit = crypto4xx_ablk_exit, + .cra_module = THIS_MODULE, + .cra_u = { + .ablkcipher = { +@@ -1082,8 +1196,8 @@ struct crypto4xx_alg_common crypto4xx_al + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), + .cra_type = &crypto_ablkcipher_type, +- .cra_init = crypto4xx_alg_init, +- .cra_exit = crypto4xx_alg_exit, ++ .cra_init = crypto4xx_ablk_init, ++ .cra_exit = crypto4xx_ablk_exit, + .cra_module = THIS_MODULE, + .cra_u = { + .ablkcipher = { +@@ -1149,6 +1263,7 @@ static int crypto4xx_probe(struct platfo + core_dev->device = dev; + spin_lock_init(&core_dev->lock); + INIT_LIST_HEAD(&core_dev->dev->alg_list); ++ ratelimit_default_init(&core_dev->dev->aead_ratelimit); + rc = crypto4xx_build_pdr(core_dev->dev); + if (rc) + goto err_build_pdr; +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -22,7 +22,9 @@ + #ifndef __CRYPTO4XX_CORE_H__ + #define __CRYPTO4XX_CORE_H__ + ++#include + #include ++#include + #include "crypto4xx_reg_def.h" + #include "crypto4xx_sa.h" + +@@ -106,6 +108,7 @@ struct crypto4xx_device { + struct pd_uinfo *pdr_uinfo; + struct list_head alg_list; /* List of algorithm supported + by this device */ ++ struct ratelimit_state aead_ratelimit; + }; + + struct crypto4xx_core_device { +@@ -125,6 +128,9 @@ struct crypto4xx_ctx { + struct dynamic_sa_ctl *sa_out; + __le32 iv_nonce; + u32 sa_len; ++ union { ++ struct crypto_aead *aead; ++ } sw_cipher; + }; + + struct crypto4xx_alg_common { +@@ -132,6 +138,7 @@ struct crypto4xx_alg_common { + union { + struct crypto_alg cipher; + struct ahash_alg hash; ++ struct aead_alg aead; + } u; + }; + +@@ -141,18 +148,6 @@ struct crypto4xx_alg { + struct crypto4xx_device *dev; + }; + +-static inline struct crypto4xx_alg *crypto_alg_to_crypto4xx_alg( +- struct crypto_alg *x) +-{ +- switch (x->cra_flags & CRYPTO_ALG_TYPE_MASK) { +- case CRYPTO_ALG_TYPE_AHASH: +- return container_of(__crypto_ahash_alg(x), +- struct crypto4xx_alg, alg.u.hash); +- } +- +- return container_of(x, struct crypto4xx_alg, alg.u.cipher); +-} +- + int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size); + void crypto4xx_free_sa(struct crypto4xx_ctx *ctx); + void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx); +@@ -163,7 +158,8 @@ int crypto4xx_build_pd(struct crypto_asy + const unsigned int datalen, + const __le32 *iv, const u32 iv_len, + const struct dynamic_sa_ctl *sa, +- const unsigned int sa_len); ++ const unsigned int sa_len, ++ const unsigned int assoclen); + int crypto4xx_setkey_aes_cbc(struct crypto_ablkcipher *cipher, + const u8 *key, unsigned int keylen); + int crypto4xx_setkey_aes_cfb(struct crypto_ablkcipher *cipher, +--- a/drivers/crypto/amcc/crypto4xx_sa.h ++++ b/drivers/crypto/amcc/crypto4xx_sa.h +@@ -55,6 +55,8 @@ union dynamic_sa_contents { + #define SA_OP_GROUP_BASIC 0 + #define SA_OPCODE_ENCRYPT 0 + #define SA_OPCODE_DECRYPT 0 ++#define SA_OPCODE_ENCRYPT_HASH 1 ++#define SA_OPCODE_HASH_DECRYPT 1 + #define SA_OPCODE_HASH 3 + #define SA_CIPHER_ALG_DES 0 + #define SA_CIPHER_ALG_3DES 1 +@@ -65,6 +67,8 @@ union dynamic_sa_contents { + + #define SA_HASH_ALG_MD5 0 + #define SA_HASH_ALG_SHA1 1 ++#define SA_HASH_ALG_GHASH 12 ++#define SA_HASH_ALG_CBC_MAC 14 + #define SA_HASH_ALG_NULL 15 + #define SA_HASH_ALG_SHA1_DIGEST_SIZE 20 + +@@ -234,6 +238,36 @@ struct dynamic_sa_aes256 { + #define SA_AES_CONTENTS 0x3e000002 + + /** ++ * Security Association (SA) for AES128 CCM ++ */ ++struct dynamic_sa_aes128_ccm { ++ struct dynamic_sa_ctl ctrl; ++ __le32 key[4]; ++ __le32 iv[4]; ++ u32 state_ptr; ++ u32 reserved; ++} __packed; ++#define SA_AES128_CCM_LEN (sizeof(struct dynamic_sa_aes128_ccm)/4) ++#define SA_AES128_CCM_CONTENTS 0x3e000042 ++#define SA_AES_CCM_CONTENTS 0x3e000002 ++ ++/** ++ * Security Association (SA) for AES128_GCM ++ */ ++struct dynamic_sa_aes128_gcm { ++ struct dynamic_sa_ctl ctrl; ++ __le32 key[4]; ++ __le32 inner_digest[4]; ++ __le32 iv[4]; ++ u32 state_ptr; ++ u32 reserved; ++} __packed; ++ ++#define SA_AES128_GCM_LEN (sizeof(struct dynamic_sa_aes128_gcm)/4) ++#define SA_AES128_GCM_CONTENTS 0x3e000442 ++#define SA_AES_GCM_CONTENTS 0x3e000402 ++ ++/** + * Security Association (SA) for HASH160: HMAC-SHA1 + */ + struct dynamic_sa_hash160 { +@@ -274,4 +308,11 @@ static inline __le32 *get_dynamic_sa_key + return (__le32 *) ((unsigned long)cts + sizeof(struct dynamic_sa_ctl)); + } + ++static inline __le32 *get_dynamic_sa_inner_digest(struct dynamic_sa_ctl *cts) ++{ ++ return (__le32 *) ((unsigned long)cts + ++ sizeof(struct dynamic_sa_ctl) + ++ cts->sa_contents.bf.key_size * 4); ++} ++ + #endif diff --git a/target/linux/apm821xx/patches-4.14/020-0024-crypto-crypto4xx-add-aes-ccm-support.patch b/target/linux/apm821xx/patches-4.14/020-0024-crypto-crypto4xx-add-aes-ccm-support.patch new file mode 100644 index 0000000000..73283f650c --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0024-crypto-crypto4xx-add-aes-ccm-support.patch @@ -0,0 +1,256 @@ +From 65ea8b678fcf385ac18864743bae66c0643e6842 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:16 +0200 +Subject: [PATCH 24/25] crypto: crypto4xx - add aes-ccm support + +This patch adds aes-ccm support. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 185 +++++++++++++++++++++++++++++++++++ + drivers/crypto/amcc/crypto4xx_core.c | 23 +++++ + drivers/crypto/amcc/crypto4xx_core.h | 8 ++ + 3 files changed, 216 insertions(+) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -231,6 +231,191 @@ int crypto4xx_rfc3686_decrypt(struct abl + ctx->sa_out, ctx->sa_len, 0); + } + ++static inline bool crypto4xx_aead_need_fallback(struct aead_request *req, ++ bool is_ccm, bool decrypt) ++{ ++ struct crypto_aead *aead = crypto_aead_reqtfm(req); ++ ++ /* authsize has to be a multiple of 4 */ ++ if (aead->authsize & 3) ++ return true; ++ ++ /* ++ * hardware does not handle cases where cryptlen ++ * is less than a block ++ */ ++ if (req->cryptlen < AES_BLOCK_SIZE) ++ return true; ++ ++ /* assoc len needs to be a multiple of 4 */ ++ if (req->assoclen & 0x3) ++ return true; ++ ++ /* CCM supports only counter field length of 2 and 4 bytes */ ++ if (is_ccm && !(req->iv[0] == 1 || req->iv[0] == 3)) ++ return true; ++ ++ /* CCM - fix CBC MAC mismatch in special case */ ++ if (is_ccm && decrypt && !req->assoclen) ++ return true; ++ ++ return false; ++} ++ ++static int crypto4xx_aead_fallback(struct aead_request *req, ++ struct crypto4xx_ctx *ctx, bool do_decrypt) ++{ ++ char aead_req_data[sizeof(struct aead_request) + ++ crypto_aead_reqsize(ctx->sw_cipher.aead)] ++ __aligned(__alignof__(struct aead_request)); ++ ++ struct aead_request *subreq = (void *) aead_req_data; ++ ++ memset(subreq, 0, sizeof(aead_req_data)); ++ ++ aead_request_set_tfm(subreq, ctx->sw_cipher.aead); ++ aead_request_set_callback(subreq, req->base.flags, ++ req->base.complete, req->base.data); ++ aead_request_set_crypt(subreq, req->src, req->dst, req->cryptlen, ++ req->iv); ++ aead_request_set_ad(subreq, req->assoclen); ++ return do_decrypt ? crypto_aead_decrypt(subreq) : ++ crypto_aead_encrypt(subreq); ++} ++ ++static int crypto4xx_setup_fallback(struct crypto4xx_ctx *ctx, ++ struct crypto_aead *cipher, ++ const u8 *key, ++ unsigned int keylen) ++{ ++ int rc; ++ ++ crypto_aead_clear_flags(ctx->sw_cipher.aead, CRYPTO_TFM_REQ_MASK); ++ crypto_aead_set_flags(ctx->sw_cipher.aead, ++ crypto_aead_get_flags(cipher) & CRYPTO_TFM_REQ_MASK); ++ rc = crypto_aead_setkey(ctx->sw_cipher.aead, key, keylen); ++ crypto_aead_clear_flags(cipher, CRYPTO_TFM_RES_MASK); ++ crypto_aead_set_flags(cipher, ++ crypto_aead_get_flags(ctx->sw_cipher.aead) & ++ CRYPTO_TFM_RES_MASK); ++ ++ return rc; ++} ++ ++/** ++ * AES-CCM Functions ++ */ ++ ++int crypto4xx_setkey_aes_ccm(struct crypto_aead *cipher, const u8 *key, ++ unsigned int keylen) ++{ ++ struct crypto_tfm *tfm = crypto_aead_tfm(cipher); ++ struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); ++ struct dynamic_sa_ctl *sa; ++ int rc = 0; ++ ++ rc = crypto4xx_setup_fallback(ctx, cipher, key, keylen); ++ if (rc) ++ return rc; ++ ++ if (ctx->sa_in || ctx->sa_out) ++ crypto4xx_free_sa(ctx); ++ ++ rc = crypto4xx_alloc_sa(ctx, SA_AES128_CCM_LEN + (keylen - 16) / 4); ++ if (rc) ++ return rc; ++ ++ /* Setup SA */ ++ sa = (struct dynamic_sa_ctl *) ctx->sa_in; ++ sa->sa_contents.w = SA_AES_CCM_CONTENTS | (keylen << 2); ++ ++ set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, SA_NOT_SAVE_IV, ++ SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE, ++ SA_NO_HEADER_PROC, SA_HASH_ALG_CBC_MAC, ++ SA_CIPHER_ALG_AES, ++ SA_PAD_TYPE_ZERO, SA_OP_GROUP_BASIC, ++ SA_OPCODE_HASH_DECRYPT, DIR_INBOUND); ++ ++ set_dynamic_sa_command_1(sa, CRYPTO_MODE_CTR, SA_HASH_MODE_HASH, ++ CRYPTO_FEEDBACK_MODE_NO_FB, SA_EXTENDED_SN_OFF, ++ SA_SEQ_MASK_OFF, SA_MC_ENABLE, ++ SA_NOT_COPY_PAD, SA_COPY_PAYLOAD, ++ SA_NOT_COPY_HDR); ++ ++ sa->sa_command_1.bf.key_len = keylen >> 3; ++ ++ crypto4xx_memcpy_to_le32(get_dynamic_sa_key_field(sa), key, keylen); ++ ++ memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4); ++ sa = (struct dynamic_sa_ctl *) ctx->sa_out; ++ ++ set_dynamic_sa_command_0(sa, SA_SAVE_HASH, SA_NOT_SAVE_IV, ++ SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE, ++ SA_NO_HEADER_PROC, SA_HASH_ALG_CBC_MAC, ++ SA_CIPHER_ALG_AES, ++ SA_PAD_TYPE_ZERO, SA_OP_GROUP_BASIC, ++ SA_OPCODE_ENCRYPT_HASH, DIR_OUTBOUND); ++ ++ set_dynamic_sa_command_1(sa, CRYPTO_MODE_CTR, SA_HASH_MODE_HASH, ++ CRYPTO_FEEDBACK_MODE_NO_FB, SA_EXTENDED_SN_OFF, ++ SA_SEQ_MASK_OFF, SA_MC_ENABLE, ++ SA_COPY_PAD, SA_COPY_PAYLOAD, ++ SA_NOT_COPY_HDR); ++ ++ sa->sa_command_1.bf.key_len = keylen >> 3; ++ return 0; ++} ++ ++static int crypto4xx_crypt_aes_ccm(struct aead_request *req, bool decrypt) ++{ ++ struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); ++ struct crypto_aead *aead = crypto_aead_reqtfm(req); ++ unsigned int len = req->cryptlen; ++ __le32 iv[16]; ++ u32 tmp_sa[ctx->sa_len * 4]; ++ struct dynamic_sa_ctl *sa = (struct dynamic_sa_ctl *)tmp_sa; ++ ++ if (crypto4xx_aead_need_fallback(req, true, decrypt)) ++ return crypto4xx_aead_fallback(req, ctx, decrypt); ++ ++ if (decrypt) ++ len -= crypto_aead_authsize(aead); ++ ++ memcpy(tmp_sa, decrypt ? ctx->sa_in : ctx->sa_out, sizeof(tmp_sa)); ++ sa->sa_command_0.bf.digest_len = crypto_aead_authsize(aead) >> 2; ++ ++ if (req->iv[0] == 1) { ++ /* CRYPTO_MODE_AES_ICM */ ++ sa->sa_command_1.bf.crypto_mode9_8 = 1; ++ } ++ ++ iv[3] = cpu_to_le32(0); ++ crypto4xx_memcpy_to_le32(iv, req->iv, 16 - (req->iv[0] + 1)); ++ ++ return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, ++ len, iv, sizeof(iv), ++ sa, ctx->sa_len, req->assoclen); ++} ++ ++int crypto4xx_encrypt_aes_ccm(struct aead_request *req) ++{ ++ return crypto4xx_crypt_aes_ccm(req, false); ++} ++ ++int crypto4xx_decrypt_aes_ccm(struct aead_request *req) ++{ ++ return crypto4xx_crypt_aes_ccm(req, true); ++} ++ ++int crypto4xx_setauthsize_aead(struct crypto_aead *cipher, ++ unsigned int authsize) ++{ ++ struct crypto_tfm *tfm = crypto_aead_tfm(cipher); ++ struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); ++ ++ return crypto_aead_setauthsize(ctx->sw_cipher.aead, authsize); ++} ++ + /** + * HASH SHA1 Functions + */ +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1210,6 +1210,29 @@ static struct crypto4xx_alg_common crypt + } + } + } }, ++ ++ /* AEAD */ ++ { .type = CRYPTO_ALG_TYPE_AEAD, .u.aead = { ++ .setkey = crypto4xx_setkey_aes_ccm, ++ .setauthsize = crypto4xx_setauthsize_aead, ++ .encrypt = crypto4xx_encrypt_aes_ccm, ++ .decrypt = crypto4xx_decrypt_aes_ccm, ++ .init = crypto4xx_aead_init, ++ .exit = crypto4xx_aead_exit, ++ .ivsize = AES_BLOCK_SIZE, ++ .maxauthsize = 16, ++ .base = { ++ .cra_name = "ccm(aes)", ++ .cra_driver_name = "ccm-aes-ppc4xx", ++ .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, ++ .cra_flags = CRYPTO_ALG_ASYNC | ++ CRYPTO_ALG_NEED_FALLBACK | ++ CRYPTO_ALG_KERN_DRIVER_ONLY, ++ .cra_blocksize = 1, ++ .cra_ctxsize = sizeof(struct crypto4xx_ctx), ++ .cra_module = THIS_MODULE, ++ }, ++ } }, + }; + + /** +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -222,4 +222,12 @@ static inline void crypto4xx_memcpy_to_l + { + crypto4xx_memcpy_swab32((u32 *)dst, buf, len); + } ++ ++int crypto4xx_setauthsize_aead(struct crypto_aead *ciper, ++ unsigned int authsize); ++int crypto4xx_setkey_aes_ccm(struct crypto_aead *cipher, ++ const u8 *key, unsigned int keylen); ++int crypto4xx_encrypt_aes_ccm(struct aead_request *req); ++int crypto4xx_decrypt_aes_ccm(struct aead_request *req); ++ + #endif diff --git a/target/linux/apm821xx/patches-4.14/020-0025-crypto-crypto4xx-add-aes-gcm-support.patch b/target/linux/apm821xx/patches-4.14/020-0025-crypto-crypto4xx-add-aes-gcm-support.patch new file mode 100644 index 0000000000..3a2ed310b3 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0025-crypto-crypto4xx-add-aes-gcm-support.patch @@ -0,0 +1,220 @@ +From 59231368d3a959fc30c5142c406a045f49130daa Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:17 +0200 +Subject: [PATCH 25/25] crypto: crypto4xx - add aes-gcm support + +This patch adds aes-gcm support to crypto4xx. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 139 +++++++++++++++++++++++++++++++++++ + drivers/crypto/amcc/crypto4xx_core.c | 22 ++++++ + drivers/crypto/amcc/crypto4xx_core.h | 4 + + 3 files changed, 165 insertions(+) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + #include + #include + #include "crypto4xx_reg_def.h" +@@ -417,6 +418,144 @@ int crypto4xx_setauthsize_aead(struct cr + } + + /** ++ * AES-GCM Functions ++ */ ++ ++static int crypto4xx_aes_gcm_validate_keylen(unsigned int keylen) ++{ ++ switch (keylen) { ++ case 16: ++ case 24: ++ case 32: ++ return 0; ++ default: ++ return -EINVAL; ++ } ++} ++ ++static int crypto4xx_compute_gcm_hash_key_sw(__le32 *hash_start, const u8 *key, ++ unsigned int keylen) ++{ ++ struct crypto_cipher *aes_tfm = NULL; ++ uint8_t src[16] = { 0 }; ++ int rc = 0; ++ ++ aes_tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC | ++ CRYPTO_ALG_NEED_FALLBACK); ++ if (IS_ERR(aes_tfm)) { ++ rc = PTR_ERR(aes_tfm); ++ pr_warn("could not load aes cipher driver: %d\n", rc); ++ return rc; ++ } ++ ++ rc = crypto_cipher_setkey(aes_tfm, key, keylen); ++ if (rc) { ++ pr_err("setkey() failed: %d\n", rc); ++ goto out; ++ } ++ ++ crypto_cipher_encrypt_one(aes_tfm, src, src); ++ crypto4xx_memcpy_to_le32(hash_start, src, 16); ++out: ++ crypto_free_cipher(aes_tfm); ++ return rc; ++} ++ ++int crypto4xx_setkey_aes_gcm(struct crypto_aead *cipher, ++ const u8 *key, unsigned int keylen) ++{ ++ struct crypto_tfm *tfm = crypto_aead_tfm(cipher); ++ struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); ++ struct dynamic_sa_ctl *sa; ++ int rc = 0; ++ ++ if (crypto4xx_aes_gcm_validate_keylen(keylen) != 0) { ++ crypto_aead_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN); ++ return -EINVAL; ++ } ++ ++ rc = crypto4xx_setup_fallback(ctx, cipher, key, keylen); ++ if (rc) ++ return rc; ++ ++ if (ctx->sa_in || ctx->sa_out) ++ crypto4xx_free_sa(ctx); ++ ++ rc = crypto4xx_alloc_sa(ctx, SA_AES128_GCM_LEN + (keylen - 16) / 4); ++ if (rc) ++ return rc; ++ ++ sa = (struct dynamic_sa_ctl *) ctx->sa_in; ++ ++ sa->sa_contents.w = SA_AES_GCM_CONTENTS | (keylen << 2); ++ set_dynamic_sa_command_0(sa, SA_SAVE_HASH, SA_NOT_SAVE_IV, ++ SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE, ++ SA_NO_HEADER_PROC, SA_HASH_ALG_GHASH, ++ SA_CIPHER_ALG_AES, SA_PAD_TYPE_ZERO, ++ SA_OP_GROUP_BASIC, SA_OPCODE_HASH_DECRYPT, ++ DIR_INBOUND); ++ set_dynamic_sa_command_1(sa, CRYPTO_MODE_CTR, SA_HASH_MODE_HASH, ++ CRYPTO_FEEDBACK_MODE_NO_FB, SA_EXTENDED_SN_OFF, ++ SA_SEQ_MASK_ON, SA_MC_DISABLE, ++ SA_NOT_COPY_PAD, SA_COPY_PAYLOAD, ++ SA_NOT_COPY_HDR); ++ ++ sa->sa_command_1.bf.key_len = keylen >> 3; ++ ++ crypto4xx_memcpy_to_le32(get_dynamic_sa_key_field(sa), ++ key, keylen); ++ ++ rc = crypto4xx_compute_gcm_hash_key_sw(get_dynamic_sa_inner_digest(sa), ++ key, keylen); ++ if (rc) { ++ pr_err("GCM hash key setting failed = %d\n", rc); ++ goto err; ++ } ++ ++ memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4); ++ sa = (struct dynamic_sa_ctl *) ctx->sa_out; ++ sa->sa_command_0.bf.dir = DIR_OUTBOUND; ++ sa->sa_command_0.bf.opcode = SA_OPCODE_ENCRYPT_HASH; ++ ++ return 0; ++err: ++ crypto4xx_free_sa(ctx); ++ return rc; ++} ++ ++static inline int crypto4xx_crypt_aes_gcm(struct aead_request *req, ++ bool decrypt) ++{ ++ struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); ++ unsigned int len = req->cryptlen; ++ __le32 iv[4]; ++ ++ if (crypto4xx_aead_need_fallback(req, false, decrypt)) ++ return crypto4xx_aead_fallback(req, ctx, decrypt); ++ ++ crypto4xx_memcpy_to_le32(iv, req->iv, GCM_AES_IV_SIZE); ++ iv[3] = cpu_to_le32(1); ++ ++ if (decrypt) ++ len -= crypto_aead_authsize(crypto_aead_reqtfm(req)); ++ ++ return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, ++ len, iv, sizeof(iv), ++ decrypt ? ctx->sa_in : ctx->sa_out, ++ ctx->sa_len, req->assoclen); ++} ++ ++int crypto4xx_encrypt_aes_gcm(struct aead_request *req) ++{ ++ return crypto4xx_crypt_aes_gcm(req, false); ++} ++ ++int crypto4xx_decrypt_aes_gcm(struct aead_request *req) ++{ ++ return crypto4xx_crypt_aes_gcm(req, true); ++} ++ ++/** + * HASH SHA1 Functions + */ + static int crypto4xx_hash_alg_init(struct crypto_tfm *tfm, +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -1227,6 +1228,27 @@ static struct crypto4xx_alg_common crypt + .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, + .cra_flags = CRYPTO_ALG_ASYNC | + CRYPTO_ALG_NEED_FALLBACK | ++ CRYPTO_ALG_KERN_DRIVER_ONLY, ++ .cra_blocksize = 1, ++ .cra_ctxsize = sizeof(struct crypto4xx_ctx), ++ .cra_module = THIS_MODULE, ++ }, ++ } }, ++ { .type = CRYPTO_ALG_TYPE_AEAD, .u.aead = { ++ .setkey = crypto4xx_setkey_aes_gcm, ++ .setauthsize = crypto4xx_setauthsize_aead, ++ .encrypt = crypto4xx_encrypt_aes_gcm, ++ .decrypt = crypto4xx_decrypt_aes_gcm, ++ .init = crypto4xx_aead_init, ++ .exit = crypto4xx_aead_exit, ++ .ivsize = GCM_AES_IV_SIZE, ++ .maxauthsize = 16, ++ .base = { ++ .cra_name = "gcm(aes)", ++ .cra_driver_name = "gcm-aes-ppc4xx", ++ .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, ++ .cra_flags = CRYPTO_ALG_ASYNC | ++ CRYPTO_ALG_NEED_FALLBACK | + CRYPTO_ALG_KERN_DRIVER_ONLY, + .cra_blocksize = 1, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -229,5 +229,9 @@ int crypto4xx_setkey_aes_ccm(struct cryp + const u8 *key, unsigned int keylen); + int crypto4xx_encrypt_aes_ccm(struct aead_request *req); + int crypto4xx_decrypt_aes_ccm(struct aead_request *req); ++int crypto4xx_setkey_aes_gcm(struct crypto_aead *cipher, ++ const u8 *key, unsigned int keylen); ++int crypto4xx_encrypt_aes_gcm(struct aead_request *req); ++int crypto4xx_decrypt_aes_gcm(struct aead_request *req); + + #endif diff --git a/target/linux/apm821xx/patches-4.14/030-0001-net-ibm-emac-replace-custom-rgmii_mode_name-with-phy.patch b/target/linux/apm821xx/patches-4.14/030-0001-net-ibm-emac-replace-custom-rgmii_mode_name-with-phy.patch new file mode 100644 index 0000000000..28969a7b4a --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/030-0001-net-ibm-emac-replace-custom-rgmii_mode_name-with-phy.patch @@ -0,0 +1,51 @@ +From 54e1b3004eb85f9317f6c4ceff2e097231c7f52a Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 20 Dec 2017 22:11:22 +0100 +Subject: [PATCH 1/3] net: ibm: emac: replace custom rgmii_mode_name with + phy_modes + +The common phylib defines the same names (in lower-case). +Since rgmii_mode_name() is used only in one place and +for a "notice-level" printk, I think it can be replaced. + +Signed-off-by: Christian Lamparter +--- + drivers/net/ethernet/ibm/emac/rgmii.c | 20 +------------------- + 1 file changed, 1 insertion(+), 19 deletions(-) + +--- a/drivers/net/ethernet/ibm/emac/rgmii.c ++++ b/drivers/net/ethernet/ibm/emac/rgmii.c +@@ -59,24 +59,6 @@ static inline int rgmii_valid_mode(int p + phy_mode == PHY_MODE_RTBI; + } + +-static inline const char *rgmii_mode_name(int mode) +-{ +- switch (mode) { +- case PHY_MODE_RGMII: +- return "RGMII"; +- case PHY_MODE_TBI: +- return "TBI"; +- case PHY_MODE_GMII: +- return "GMII"; +- case PHY_MODE_MII: +- return "MII"; +- case PHY_MODE_RTBI: +- return "RTBI"; +- default: +- BUG(); +- } +-} +- + static inline u32 rgmii_mode_mask(int mode, int input) + { + switch (mode) { +@@ -115,7 +97,7 @@ int rgmii_attach(struct platform_device + out_be32(&p->fer, in_be32(&p->fer) | rgmii_mode_mask(mode, input)); + + printk(KERN_NOTICE "%pOF: input %d in %s mode\n", +- ofdev->dev.of_node, input, rgmii_mode_name(mode)); ++ ofdev->dev.of_node, input, phy_modes(mode)); + + ++dev->users; + diff --git a/target/linux/apm821xx/patches-4.14/030-0002-net-ibm-emac-replace-custom-PHY_MODE_-macros.patch b/target/linux/apm821xx/patches-4.14/030-0002-net-ibm-emac-replace-custom-PHY_MODE_-macros.patch new file mode 100644 index 0000000000..e4a722646e --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/030-0002-net-ibm-emac-replace-custom-PHY_MODE_-macros.patch @@ -0,0 +1,246 @@ +From 1477bea9e6931f6be96f45b9d277690a26d0cd97 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 20 Dec 2017 22:19:24 +0100 +Subject: [PATCH 2/3] net: ibm: emac: replace custom PHY_MODE_* macros + +The ibm_emac driver predates the shared PHY_INTERFACE_MODE_ +enums provided by include/linux/phy.h by a few years. + +And while the driver has been retrofitted to use the PHYLIB, +the old definitions have stuck around to this day. + +Signed-off-by: Christian Lamparter +--- + drivers/net/ethernet/ibm/emac/core.c | 20 ++++++++++---------- + drivers/net/ethernet/ibm/emac/emac.h | 13 ------------- + drivers/net/ethernet/ibm/emac/phy.c | 10 +++++----- + drivers/net/ethernet/ibm/emac/rgmii.c | 20 ++++++++++---------- + drivers/net/ethernet/ibm/emac/zmii.c | 34 +++++++++++++++++----------------- + 5 files changed, 42 insertions(+), 55 deletions(-) + +--- a/drivers/net/ethernet/ibm/emac/core.c ++++ b/drivers/net/ethernet/ibm/emac/core.c +@@ -199,18 +199,18 @@ static void __emac_set_multicast_list(st + + static inline int emac_phy_supports_gige(int phy_mode) + { +- return phy_mode == PHY_MODE_GMII || +- phy_mode == PHY_MODE_RGMII || +- phy_mode == PHY_MODE_SGMII || +- phy_mode == PHY_MODE_TBI || +- phy_mode == PHY_MODE_RTBI; ++ return phy_mode == PHY_INTERFACE_MODE_GMII || ++ phy_mode == PHY_INTERFACE_MODE_RGMII || ++ phy_mode == PHY_INTERFACE_MODE_SGMII || ++ phy_mode == PHY_INTERFACE_MODE_TBI || ++ phy_mode == PHY_INTERFACE_MODE_RTBI; + } + + static inline int emac_phy_gpcs(int phy_mode) + { +- return phy_mode == PHY_MODE_SGMII || +- phy_mode == PHY_MODE_TBI || +- phy_mode == PHY_MODE_RTBI; ++ return phy_mode == PHY_INTERFACE_MODE_SGMII || ++ phy_mode == PHY_INTERFACE_MODE_TBI || ++ phy_mode == PHY_INTERFACE_MODE_RTBI; + } + + static inline void emac_tx_enable(struct emac_instance *dev) +@@ -2865,7 +2865,7 @@ static int emac_init_config(struct emac_ + /* PHY mode needs some decoding */ + dev->phy_mode = of_get_phy_mode(np); + if (dev->phy_mode < 0) +- dev->phy_mode = PHY_MODE_NA; ++ dev->phy_mode = PHY_INTERFACE_MODE_NA; + + /* Check EMAC version */ + if (of_device_is_compatible(np, "ibm,emac4sync")) { +@@ -3168,7 +3168,7 @@ static int emac_probe(struct platform_de + printk(KERN_INFO "%s: EMAC-%d %pOF, MAC %pM\n", + ndev->name, dev->cell_index, np, ndev->dev_addr); + +- if (dev->phy_mode == PHY_MODE_SGMII) ++ if (dev->phy_mode == PHY_INTERFACE_MODE_SGMII) + printk(KERN_NOTICE "%s: in SGMII mode\n", ndev->name); + + if (dev->phy.address >= 0) +--- a/drivers/net/ethernet/ibm/emac/emac.h ++++ b/drivers/net/ethernet/ibm/emac/emac.h +@@ -104,19 +104,6 @@ struct emac_regs { + } u1; + }; + +-/* +- * PHY mode settings (EMAC <-> ZMII/RGMII bridge <-> PHY) +- */ +-#define PHY_MODE_NA PHY_INTERFACE_MODE_NA +-#define PHY_MODE_MII PHY_INTERFACE_MODE_MII +-#define PHY_MODE_RMII PHY_INTERFACE_MODE_RMII +-#define PHY_MODE_SMII PHY_INTERFACE_MODE_SMII +-#define PHY_MODE_RGMII PHY_INTERFACE_MODE_RGMII +-#define PHY_MODE_TBI PHY_INTERFACE_MODE_TBI +-#define PHY_MODE_GMII PHY_INTERFACE_MODE_GMII +-#define PHY_MODE_RTBI PHY_INTERFACE_MODE_RTBI +-#define PHY_MODE_SGMII PHY_INTERFACE_MODE_SGMII +- + /* EMACx_MR0 */ + #define EMAC_MR0_RXI 0x80000000 + #define EMAC_MR0_TXI 0x40000000 +--- a/drivers/net/ethernet/ibm/emac/phy.c ++++ b/drivers/net/ethernet/ibm/emac/phy.c +@@ -96,7 +96,7 @@ int emac_mii_reset_gpcs(struct mii_phy * + if ((val & BMCR_ISOLATE) && limit > 0) + gpcs_phy_write(phy, MII_BMCR, val & ~BMCR_ISOLATE); + +- if (limit > 0 && phy->mode == PHY_MODE_SGMII) { ++ if (limit > 0 && phy->mode == PHY_INTERFACE_MODE_SGMII) { + /* Configure GPCS interface to recommended setting for SGMII */ + gpcs_phy_write(phy, 0x04, 0x8120); /* AsymPause, FDX */ + gpcs_phy_write(phy, 0x07, 0x2801); /* msg_pg, toggle */ +@@ -313,16 +313,16 @@ static int cis8201_init(struct mii_phy * + epcr &= ~EPCR_MODE_MASK; + + switch (phy->mode) { +- case PHY_MODE_TBI: ++ case PHY_INTERFACE_MODE_TBI: + epcr |= EPCR_TBI_MODE; + break; +- case PHY_MODE_RTBI: ++ case PHY_INTERFACE_MODE_RTBI: + epcr |= EPCR_RTBI_MODE; + break; +- case PHY_MODE_GMII: ++ case PHY_INTERFACE_MODE_GMII: + epcr |= EPCR_GMII_MODE; + break; +- case PHY_MODE_RGMII: ++ case PHY_INTERFACE_MODE_RGMII: + default: + epcr |= EPCR_RGMII_MODE; + } +--- a/drivers/net/ethernet/ibm/emac/rgmii.c ++++ b/drivers/net/ethernet/ibm/emac/rgmii.c +@@ -52,25 +52,25 @@ + /* RGMII bridge supports only GMII/TBI and RGMII/RTBI PHYs */ + static inline int rgmii_valid_mode(int phy_mode) + { +- return phy_mode == PHY_MODE_GMII || +- phy_mode == PHY_MODE_MII || +- phy_mode == PHY_MODE_RGMII || +- phy_mode == PHY_MODE_TBI || +- phy_mode == PHY_MODE_RTBI; ++ return phy_mode == PHY_INTERFACE_MODE_GMII || ++ phy_mode == PHY_INTERFACE_MODE_MII || ++ phy_mode == PHY_INTERFACE_MODE_RGMII || ++ phy_mode == PHY_INTERFACE_MODE_TBI || ++ phy_mode == PHY_INTERFACE_MODE_RTBI; + } + + static inline u32 rgmii_mode_mask(int mode, int input) + { + switch (mode) { +- case PHY_MODE_RGMII: ++ case PHY_INTERFACE_MODE_RGMII: + return RGMII_FER_RGMII(input); +- case PHY_MODE_TBI: ++ case PHY_INTERFACE_MODE_TBI: + return RGMII_FER_TBI(input); +- case PHY_MODE_GMII: ++ case PHY_INTERFACE_MODE_GMII: + return RGMII_FER_GMII(input); +- case PHY_MODE_MII: ++ case PHY_INTERFACE_MODE_MII: + return RGMII_FER_MII(input); +- case PHY_MODE_RTBI: ++ case PHY_INTERFACE_MODE_RTBI: + return RGMII_FER_RTBI(input); + default: + BUG(); +--- a/drivers/net/ethernet/ibm/emac/zmii.c ++++ b/drivers/net/ethernet/ibm/emac/zmii.c +@@ -49,20 +49,20 @@ + */ + static inline int zmii_valid_mode(int mode) + { +- return mode == PHY_MODE_MII || +- mode == PHY_MODE_RMII || +- mode == PHY_MODE_SMII || +- mode == PHY_MODE_NA; ++ return mode == PHY_INTERFACE_MODE_MII || ++ mode == PHY_INTERFACE_MODE_RMII || ++ mode == PHY_INTERFACE_MODE_SMII || ++ mode == PHY_INTERFACE_MODE_NA; + } + + static inline const char *zmii_mode_name(int mode) + { + switch (mode) { +- case PHY_MODE_MII: ++ case PHY_INTERFACE_MODE_MII: + return "MII"; +- case PHY_MODE_RMII: ++ case PHY_INTERFACE_MODE_RMII: + return "RMII"; +- case PHY_MODE_SMII: ++ case PHY_INTERFACE_MODE_SMII: + return "SMII"; + default: + BUG(); +@@ -72,11 +72,11 @@ static inline const char *zmii_mode_name + static inline u32 zmii_mode_mask(int mode, int input) + { + switch (mode) { +- case PHY_MODE_MII: ++ case PHY_INTERFACE_MODE_MII: + return ZMII_FER_MII(input); +- case PHY_MODE_RMII: ++ case PHY_INTERFACE_MODE_RMII: + return ZMII_FER_RMII(input); +- case PHY_MODE_SMII: ++ case PHY_INTERFACE_MODE_SMII: + return ZMII_FER_SMII(input); + default: + return 0; +@@ -106,18 +106,18 @@ int zmii_attach(struct platform_device * + * Please, always specify PHY mode in your board port to avoid + * any surprises. + */ +- if (dev->mode == PHY_MODE_NA) { +- if (*mode == PHY_MODE_NA) { ++ if (dev->mode == PHY_INTERFACE_MODE_NA) { ++ if (*mode == PHY_INTERFACE_MODE_NA) { + u32 r = dev->fer_save; + + ZMII_DBG(dev, "autodetecting mode, FER = 0x%08x" NL, r); + + if (r & (ZMII_FER_MII(0) | ZMII_FER_MII(1))) +- dev->mode = PHY_MODE_MII; ++ dev->mode = PHY_INTERFACE_MODE_MII; + else if (r & (ZMII_FER_RMII(0) | ZMII_FER_RMII(1))) +- dev->mode = PHY_MODE_RMII; ++ dev->mode = PHY_INTERFACE_MODE_RMII; + else +- dev->mode = PHY_MODE_SMII; ++ dev->mode = PHY_INTERFACE_MODE_SMII; + } else + dev->mode = *mode; + +@@ -126,7 +126,7 @@ int zmii_attach(struct platform_device * + zmii_mode_name(dev->mode)); + } else { + /* All inputs must use the same mode */ +- if (*mode != PHY_MODE_NA && *mode != dev->mode) { ++ if (*mode != PHY_INTERFACE_MODE_NA && *mode != dev->mode) { + printk(KERN_ERR + "%pOF: invalid mode %d specified for input %d\n", + ofdev->dev.of_node, *mode, input); +@@ -246,7 +246,7 @@ static int zmii_probe(struct platform_de + + mutex_init(&dev->lock); + dev->ofdev = ofdev; +- dev->mode = PHY_MODE_NA; ++ dev->mode = PHY_INTERFACE_MODE_NA; + + rc = -ENXIO; + if (of_address_to_resource(np, 0, ®s)) { diff --git a/target/linux/apm821xx/patches-4.14/030-0003-net-ibm-emac-support-RGMII-RX-TX-ID-phymode.patch b/target/linux/apm821xx/patches-4.14/030-0003-net-ibm-emac-support-RGMII-RX-TX-ID-phymode.patch new file mode 100644 index 0000000000..16074c7ee6 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/030-0003-net-ibm-emac-support-RGMII-RX-TX-ID-phymode.patch @@ -0,0 +1,59 @@ +From 0a49f0d1958440f7928047433c983eece05a3723 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Thu, 14 Dec 2017 19:51:50 +0100 +Subject: [PATCH 3/3] net: ibm: emac: support RGMII-[RX|TX]ID phymode + +The RGMII spec allows compliance for devices that implement an internal +delay on TXC and/or RXC inside the transmitter. This patch adds the +necessary RGMII_[RX|TX]ID mode code to handle such PHYs with the +emac driver. + +Signed-off-by: Christian Lamparter + +--- +v3: - replace PHY_MODE_* with PHY_INTERFACE_MODE_* + - replace rgmii_mode_name() with phy_modes[] + +v2: - utilize phy_interface_mode_is_rgmii() +--- + drivers/net/ethernet/ibm/emac/core.c | 4 ++-- + drivers/net/ethernet/ibm/emac/rgmii.c | 7 +++++-- + 2 files changed, 7 insertions(+), 4 deletions(-) + +--- a/drivers/net/ethernet/ibm/emac/core.c ++++ b/drivers/net/ethernet/ibm/emac/core.c +@@ -199,8 +199,8 @@ static void __emac_set_multicast_list(st + + static inline int emac_phy_supports_gige(int phy_mode) + { +- return phy_mode == PHY_INTERFACE_MODE_GMII || +- phy_mode == PHY_INTERFACE_MODE_RGMII || ++ return phy_interface_mode_is_rgmii(phy_mode) || ++ phy_mode == PHY_INTERFACE_MODE_GMII || + phy_mode == PHY_INTERFACE_MODE_SGMII || + phy_mode == PHY_INTERFACE_MODE_TBI || + phy_mode == PHY_INTERFACE_MODE_RTBI; +--- a/drivers/net/ethernet/ibm/emac/rgmii.c ++++ b/drivers/net/ethernet/ibm/emac/rgmii.c +@@ -52,9 +52,9 @@ + /* RGMII bridge supports only GMII/TBI and RGMII/RTBI PHYs */ + static inline int rgmii_valid_mode(int phy_mode) + { +- return phy_mode == PHY_INTERFACE_MODE_GMII || ++ return phy_interface_mode_is_rgmii(phy_mode) || ++ phy_mode == PHY_INTERFACE_MODE_GMII || + phy_mode == PHY_INTERFACE_MODE_MII || +- phy_mode == PHY_INTERFACE_MODE_RGMII || + phy_mode == PHY_INTERFACE_MODE_TBI || + phy_mode == PHY_INTERFACE_MODE_RTBI; + } +@@ -63,6 +63,9 @@ static inline u32 rgmii_mode_mask(int mo + { + switch (mode) { + case PHY_INTERFACE_MODE_RGMII: ++ case PHY_INTERFACE_MODE_RGMII_ID: ++ case PHY_INTERFACE_MODE_RGMII_RXID: ++ case PHY_INTERFACE_MODE_RGMII_TXID: + return RGMII_FER_RGMII(input); + case PHY_INTERFACE_MODE_TBI: + return RGMII_FER_TBI(input); diff --git a/target/linux/apm821xx/patches-4.14/120-0001-crypto-crypto4xx-shuffle-iomap-in-front-of-request_i.patch b/target/linux/apm821xx/patches-4.14/120-0001-crypto-crypto4xx-shuffle-iomap-in-front-of-request_i.patch new file mode 100644 index 0000000000..fc8df38867 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/120-0001-crypto-crypto4xx-shuffle-iomap-in-front-of-request_i.patch @@ -0,0 +1,71 @@ +From 4baa099377d73ea99c7802a9685815b32e8bf119 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Thu, 21 Dec 2017 15:08:18 +0100 +Subject: [PATCH 1/6] crypto: crypto4xx - shuffle iomap in front of request_irq + +It is possible to avoid the ce_base null pointer check in the +drivers' interrupt handler routine "crypto4xx_ce_interrupt_handler()" +by simply doing the iomap in front of the IRQ registration. + +This way, the ce_base will always be valid in the handler and +a branch in an critical path can be avoided. + +Signed-off-by: Christian Lamparter +--- + drivers/crypto/amcc/crypto4xx_core.c | 21 +++++++++------------ + 1 file changed, 9 insertions(+), 12 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1075,9 +1075,6 @@ static irqreturn_t crypto4xx_ce_interrup + struct device *dev = (struct device *)data; + struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev); + +- if (!core_dev->dev->ce_base) +- return 0; +- + writel(PPC4XX_INTERRUPT_CLR, + core_dev->dev->ce_base + CRYPTO4XX_INT_CLR); + tasklet_schedule(&core_dev->tasklet); +@@ -1325,13 +1322,6 @@ static int crypto4xx_probe(struct platfo + tasklet_init(&core_dev->tasklet, crypto4xx_bh_tasklet_cb, + (unsigned long) dev); + +- /* Register for Crypto isr, Crypto Engine IRQ */ +- core_dev->irq = irq_of_parse_and_map(ofdev->dev.of_node, 0); +- rc = request_irq(core_dev->irq, crypto4xx_ce_interrupt_handler, 0, +- core_dev->dev->name, dev); +- if (rc) +- goto err_request_irq; +- + core_dev->dev->ce_base = of_iomap(ofdev->dev.of_node, 0); + if (!core_dev->dev->ce_base) { + dev_err(dev, "failed to of_iomap\n"); +@@ -1339,6 +1329,13 @@ static int crypto4xx_probe(struct platfo + goto err_iomap; + } + ++ /* Register for Crypto isr, Crypto Engine IRQ */ ++ core_dev->irq = irq_of_parse_and_map(ofdev->dev.of_node, 0); ++ rc = request_irq(core_dev->irq, crypto4xx_ce_interrupt_handler, 0, ++ core_dev->dev->name, dev); ++ if (rc) ++ goto err_request_irq; ++ + /* need to setup pdr, rdr, gdr and sdr before this */ + crypto4xx_hw_init(core_dev->dev); + +@@ -1352,11 +1349,11 @@ static int crypto4xx_probe(struct platfo + return 0; + + err_start_dev: +- iounmap(core_dev->dev->ce_base); +-err_iomap: + free_irq(core_dev->irq, dev); + err_request_irq: + irq_dispose_mapping(core_dev->irq); ++ iounmap(core_dev->dev->ce_base); ++err_iomap: + tasklet_kill(&core_dev->tasklet); + err_build_sdr: + crypto4xx_destroy_sdr(core_dev->dev); diff --git a/target/linux/apm821xx/patches-4.14/120-0002-crypto-crypto4xx-support-Revision-B-parts.patch b/target/linux/apm821xx/patches-4.14/120-0002-crypto-crypto4xx-support-Revision-B-parts.patch new file mode 100644 index 0000000000..1adad96fe1 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/120-0002-crypto-crypto4xx-support-Revision-B-parts.patch @@ -0,0 +1,150 @@ +From 1e932b627e79aa2c70e2c7278e4ac930303faa3f Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Thu, 21 Dec 2017 15:09:18 +0100 +Subject: [PATCH 2/6] crypto: crypto4xx - support Revision B parts + +This patch adds support for the crypto4xx RevB cores +found in the 460EX, 460SX and later cores (like the APM821xx). + +Without this patch, the crypto4xx driver will not be +able to process any offloaded requests and simply hang +indefinitely. + +Signed-off-by: Christian Lamparter +--- + drivers/crypto/amcc/crypto4xx_core.c | 48 +++++++++++++++++++++++++++++---- + drivers/crypto/amcc/crypto4xx_core.h | 1 + + drivers/crypto/amcc/crypto4xx_reg_def.h | 4 ++- + 3 files changed, 47 insertions(+), 6 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -128,7 +128,14 @@ static void crypto4xx_hw_init(struct cry + writel(PPC4XX_INT_DESCR_CNT, dev->ce_base + CRYPTO4XX_INT_DESCR_CNT); + writel(PPC4XX_INT_DESCR_CNT, dev->ce_base + CRYPTO4XX_INT_DESCR_CNT); + writel(PPC4XX_INT_CFG, dev->ce_base + CRYPTO4XX_INT_CFG); +- writel(PPC4XX_PD_DONE_INT, dev->ce_base + CRYPTO4XX_INT_EN); ++ if (dev->is_revb) { ++ writel(PPC4XX_INT_TIMEOUT_CNT_REVB << 10, ++ dev->ce_base + CRYPTO4XX_INT_TIMEOUT_CNT); ++ writel(PPC4XX_PD_DONE_INT | PPC4XX_TMO_ERR_INT, ++ dev->ce_base + CRYPTO4XX_INT_EN); ++ } else { ++ writel(PPC4XX_PD_DONE_INT, dev->ce_base + CRYPTO4XX_INT_EN); ++ } + } + + int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size) +@@ -1070,18 +1077,29 @@ static void crypto4xx_bh_tasklet_cb(unsi + /** + * Top Half of isr. + */ +-static irqreturn_t crypto4xx_ce_interrupt_handler(int irq, void *data) ++static inline irqreturn_t crypto4xx_interrupt_handler(int irq, void *data, ++ u32 clr_val) + { + struct device *dev = (struct device *)data; + struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev); + +- writel(PPC4XX_INTERRUPT_CLR, +- core_dev->dev->ce_base + CRYPTO4XX_INT_CLR); ++ writel(clr_val, core_dev->dev->ce_base + CRYPTO4XX_INT_CLR); + tasklet_schedule(&core_dev->tasklet); + + return IRQ_HANDLED; + } + ++static irqreturn_t crypto4xx_ce_interrupt_handler(int irq, void *data) ++{ ++ return crypto4xx_interrupt_handler(irq, data, PPC4XX_INTERRUPT_CLR); ++} ++ ++static irqreturn_t crypto4xx_ce_interrupt_handler_revb(int irq, void *data) ++{ ++ return crypto4xx_interrupt_handler(irq, data, PPC4XX_INTERRUPT_CLR | ++ PPC4XX_TMO_ERR_INT); ++} ++ + /** + * Supported Crypto Algorithms + */ +@@ -1263,6 +1281,8 @@ static int crypto4xx_probe(struct platfo + struct resource res; + struct device *dev = &ofdev->dev; + struct crypto4xx_core_device *core_dev; ++ u32 pvr; ++ bool is_revb = true; + + rc = of_address_to_resource(ofdev->dev.of_node, 0, &res); + if (rc) +@@ -1279,6 +1299,7 @@ static int crypto4xx_probe(struct platfo + mfdcri(SDR0, PPC405EX_SDR0_SRST) | PPC405EX_CE_RESET); + mtdcri(SDR0, PPC405EX_SDR0_SRST, + mfdcri(SDR0, PPC405EX_SDR0_SRST) & ~PPC405EX_CE_RESET); ++ is_revb = false; + } else if (of_find_compatible_node(NULL, NULL, + "amcc,ppc460sx-crypto")) { + mtdcri(SDR0, PPC460SX_SDR0_SRST, +@@ -1301,7 +1322,22 @@ static int crypto4xx_probe(struct platfo + if (!core_dev->dev) + goto err_alloc_dev; + ++ /* ++ * Older version of 460EX/GT have a hardware bug. ++ * Hence they do not support H/W based security intr coalescing ++ */ ++ pvr = mfspr(SPRN_PVR); ++ if (is_revb && ((pvr >> 4) == 0x130218A)) { ++ u32 min = PVR_MIN(pvr); ++ ++ if (min < 4) { ++ dev_info(dev, "RevA detected - disable interrupt coalescing\n"); ++ is_revb = false; ++ } ++ } ++ + core_dev->dev->core_dev = core_dev; ++ core_dev->dev->is_revb = is_revb; + core_dev->device = dev; + spin_lock_init(&core_dev->lock); + INIT_LIST_HEAD(&core_dev->dev->alg_list); +@@ -1331,7 +1367,9 @@ static int crypto4xx_probe(struct platfo + + /* Register for Crypto isr, Crypto Engine IRQ */ + core_dev->irq = irq_of_parse_and_map(ofdev->dev.of_node, 0); +- rc = request_irq(core_dev->irq, crypto4xx_ce_interrupt_handler, 0, ++ rc = request_irq(core_dev->irq, is_revb ? ++ crypto4xx_ce_interrupt_handler_revb : ++ crypto4xx_ce_interrupt_handler, 0, + core_dev->dev->name, dev); + if (rc) + goto err_request_irq; +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -109,6 +109,7 @@ struct crypto4xx_device { + struct list_head alg_list; /* List of algorithm supported + by this device */ + struct ratelimit_state aead_ratelimit; ++ bool is_revb; + }; + + struct crypto4xx_core_device { +--- a/drivers/crypto/amcc/crypto4xx_reg_def.h ++++ b/drivers/crypto/amcc/crypto4xx_reg_def.h +@@ -121,13 +121,15 @@ + #define PPC4XX_PD_SIZE 6 + #define PPC4XX_CTX_DONE_INT 0x2000 + #define PPC4XX_PD_DONE_INT 0x8000 ++#define PPC4XX_TMO_ERR_INT 0x40000 + #define PPC4XX_BYTE_ORDER 0x22222 + #define PPC4XX_INTERRUPT_CLR 0x3ffff + #define PPC4XX_PRNG_CTRL_AUTO_EN 0x3 + #define PPC4XX_DC_3DES_EN 1 + #define PPC4XX_TRNG_EN 0x00020000 +-#define PPC4XX_INT_DESCR_CNT 4 ++#define PPC4XX_INT_DESCR_CNT 7 + #define PPC4XX_INT_TIMEOUT_CNT 0 ++#define PPC4XX_INT_TIMEOUT_CNT_REVB 0x3FF + #define PPC4XX_INT_CFG 1 + /** + * all follow define are ad hoc diff --git a/target/linux/apm821xx/patches-4.14/120-0003-crypto-crypto4xx-fix-missing-irq-devname.patch b/target/linux/apm821xx/patches-4.14/120-0003-crypto-crypto4xx-fix-missing-irq-devname.patch new file mode 100644 index 0000000000..a295fa4616 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/120-0003-crypto-crypto4xx-fix-missing-irq-devname.patch @@ -0,0 +1,37 @@ +From 00179ef6e3c4e5db6258cd6e273e4063b8437d18 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Thu, 21 Dec 2017 15:10:18 +0100 +Subject: [PATCH 3/6] crypto: crypto4xx - fix missing irq devname + +crypto4xx_device's name variable is not set to anything. +The common devname for request_irq seems to be the module +name. This will fix the seemingly anonymous interrupt +entry in /proc/interrupts for crypto4xx. + +Signed-off-by: Christian Lamparter +--- + drivers/crypto/amcc/crypto4xx_core.c | 2 +- + drivers/crypto/amcc/crypto4xx_core.h | 1 - + 2 files changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1370,7 +1370,7 @@ static int crypto4xx_probe(struct platfo + rc = request_irq(core_dev->irq, is_revb ? + crypto4xx_ce_interrupt_handler_revb : + crypto4xx_ce_interrupt_handler, 0, +- core_dev->dev->name, dev); ++ KBUILD_MODNAME, dev); + if (rc) + goto err_request_irq; + +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -82,7 +82,6 @@ struct pd_uinfo { + + struct crypto4xx_device { + struct crypto4xx_core_device *core_dev; +- char *name; + void __iomem *ce_base; + void __iomem *trng_base; + diff --git a/target/linux/apm821xx/patches-4.14/120-0004-crypto-crypto4xx-kill-MODULE_NAME.patch b/target/linux/apm821xx/patches-4.14/120-0004-crypto-crypto4xx-kill-MODULE_NAME.patch new file mode 100644 index 0000000000..4ee99f44cf --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/120-0004-crypto-crypto4xx-kill-MODULE_NAME.patch @@ -0,0 +1,47 @@ +From c3621f23fed7d6fff33083ae538004ea59c01d8f Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Thu, 21 Dec 2017 15:11:18 +0100 +Subject: [PATCH 4/6] crypto: crypto4xx - kill MODULE_NAME + +KBUILD_MODNAME provides the same value. + +Signed-off-by: Christian Lamparter +--- + drivers/crypto/amcc/crypto4xx_core.c | 2 +- + drivers/crypto/amcc/crypto4xx_core.h | 2 -- + drivers/crypto/amcc/crypto4xx_trng.c | 2 +- + 3 files changed, 2 insertions(+), 4 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1432,7 +1432,7 @@ MODULE_DEVICE_TABLE(of, crypto4xx_match) + + static struct platform_driver crypto4xx_driver = { + .driver = { +- .name = MODULE_NAME, ++ .name = KBUILD_MODNAME, + .of_match_table = crypto4xx_match, + }, + .probe = crypto4xx_probe, +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -28,8 +28,6 @@ + #include "crypto4xx_reg_def.h" + #include "crypto4xx_sa.h" + +-#define MODULE_NAME "crypto4xx" +- + #define PPC460SX_SDR0_SRST 0x201 + #define PPC405EX_SDR0_SRST 0x200 + #define PPC460EX_SDR0_SRST 0x201 +--- a/drivers/crypto/amcc/crypto4xx_trng.c ++++ b/drivers/crypto/amcc/crypto4xx_trng.c +@@ -92,7 +92,7 @@ void ppc4xx_trng_probe(struct crypto4xx_ + if (!rng) + goto err_out; + +- rng->name = MODULE_NAME; ++ rng->name = KBUILD_MODNAME; + rng->data_present = ppc4xx_trng_data_present; + rng->data_read = ppc4xx_trng_data_read; + rng->priv = (unsigned long) dev; diff --git a/target/linux/apm821xx/patches-4.14/120-0005-crypto-crypto4xx-perform-aead-icv-check-in-the-drive.patch b/target/linux/apm821xx/patches-4.14/120-0005-crypto-crypto4xx-perform-aead-icv-check-in-the-drive.patch new file mode 100644 index 0000000000..0dbd924e3c --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/120-0005-crypto-crypto4xx-perform-aead-icv-check-in-the-drive.patch @@ -0,0 +1,146 @@ +From 5b3856d1d98e6f6a58b70c1c0d7da3fb5f042e9c Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Thu, 21 Dec 2017 16:00:01 +0100 +Subject: [PATCH 5/6] crypto: crypto4xx - perform aead icv check in the driver + +The ccm-aes-ppc4xx now fails one of testmgr's expected +failure test cases as such: + +alg: aead: decryption failed on test 10 for ccm-aes-ppc4xx: ret was 0, expected -EBADMSG + +Upon closer inspection, it turned out that the hardware's +crypto flags that would indicate an authentification failure +are not set by the hardware. The original vendor source from +which this was ported does not have any special code or notes +about why this would happen or if there are any WAs. + +Hence, this patch converts the aead_done callback handler to +perform the icv check in the driver. And this fixes the false +negative and the ccm-aes-ppc4xx passes the selftests once again. + +|name : ccm(aes) +|driver : ccm-aes-ppc4xx +|module : crypto4xx +|priority : 300 +|refcnt : 1 +|selftest : passed +|internal : no +|type : aead +|async : yes +|blocksize : 1 +|ivsize : 16 +|maxauthsize : 16 +|geniv : + +Signed-off-by: Christian Lamparter +--- + drivers/crypto/amcc/crypto4xx_alg.c | 6 +--- + drivers/crypto/amcc/crypto4xx_core.c | 54 ++++++++++++++++++------------------ + 2 files changed, 28 insertions(+), 32 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -256,10 +256,6 @@ static inline bool crypto4xx_aead_need_f + if (is_ccm && !(req->iv[0] == 1 || req->iv[0] == 3)) + return true; + +- /* CCM - fix CBC MAC mismatch in special case */ +- if (is_ccm && decrypt && !req->assoclen) +- return true; +- + return false; + } + +@@ -330,7 +326,7 @@ int crypto4xx_setkey_aes_ccm(struct cryp + sa = (struct dynamic_sa_ctl *) ctx->sa_in; + sa->sa_contents.w = SA_AES_CCM_CONTENTS | (keylen << 2); + +- set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, SA_NOT_SAVE_IV, ++ set_dynamic_sa_command_0(sa, SA_SAVE_HASH, SA_NOT_SAVE_IV, + SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE, + SA_NO_HEADER_PROC, SA_HASH_ALG_CBC_MAC, + SA_CIPHER_ALG_AES, +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -577,15 +577,14 @@ static void crypto4xx_aead_done(struct c + struct pd_uinfo *pd_uinfo, + struct ce_pd *pd) + { +- struct aead_request *aead_req; +- struct crypto4xx_ctx *ctx; ++ struct aead_request *aead_req = container_of(pd_uinfo->async_req, ++ struct aead_request, base); + struct scatterlist *dst = pd_uinfo->dest_va; ++ size_t cp_len = crypto_aead_authsize( ++ crypto_aead_reqtfm(aead_req)); ++ u32 icv[cp_len]; + int err = 0; + +- aead_req = container_of(pd_uinfo->async_req, struct aead_request, +- base); +- ctx = crypto_tfm_ctx(aead_req->base.tfm); +- + if (pd_uinfo->using_sd) { + crypto4xx_copy_pkt_to_dst(dev, pd, pd_uinfo, + pd->pd_ctl_len.bf.pkt_len, +@@ -597,38 +596,39 @@ static void crypto4xx_aead_done(struct c + + if (pd_uinfo->sa_va->sa_command_0.bf.dir == DIR_OUTBOUND) { + /* append icv at the end */ +- size_t cp_len = crypto_aead_authsize( +- crypto_aead_reqtfm(aead_req)); +- u32 icv[cp_len]; +- + crypto4xx_memcpy_from_le32(icv, pd_uinfo->sr_va->save_digest, + cp_len); + + scatterwalk_map_and_copy(icv, dst, aead_req->cryptlen, + cp_len, 1); ++ } else { ++ /* check icv at the end */ ++ scatterwalk_map_and_copy(icv, aead_req->src, ++ aead_req->assoclen + aead_req->cryptlen - ++ cp_len, cp_len, 0); ++ ++ crypto4xx_memcpy_from_le32(icv, icv, cp_len); ++ ++ if (crypto_memneq(icv, pd_uinfo->sr_va->save_digest, cp_len)) ++ err = -EBADMSG; + } + + crypto4xx_ret_sg_desc(dev, pd_uinfo); + + if (pd->pd_ctl.bf.status & 0xff) { +- if (pd->pd_ctl.bf.status & 0x1) { +- /* authentication error */ +- err = -EBADMSG; +- } else { +- if (!__ratelimit(&dev->aead_ratelimit)) { +- if (pd->pd_ctl.bf.status & 2) +- pr_err("pad fail error\n"); +- if (pd->pd_ctl.bf.status & 4) +- pr_err("seqnum fail\n"); +- if (pd->pd_ctl.bf.status & 8) +- pr_err("error _notify\n"); +- pr_err("aead return err status = 0x%02x\n", +- pd->pd_ctl.bf.status & 0xff); +- pr_err("pd pad_ctl = 0x%08x\n", +- pd->pd_ctl.bf.pd_pad_ctl); +- } +- err = -EINVAL; ++ if (!__ratelimit(&dev->aead_ratelimit)) { ++ if (pd->pd_ctl.bf.status & 2) ++ pr_err("pad fail error\n"); ++ if (pd->pd_ctl.bf.status & 4) ++ pr_err("seqnum fail\n"); ++ if (pd->pd_ctl.bf.status & 8) ++ pr_err("error _notify\n"); ++ pr_err("aead return err status = 0x%02x\n", ++ pd->pd_ctl.bf.status & 0xff); ++ pr_err("pd pad_ctl = 0x%08x\n", ++ pd->pd_ctl.bf.pd_pad_ctl); + } ++ err = -EINVAL; + } + + if (pd_uinfo->state & PD_ENTRY_BUSY) diff --git a/target/linux/apm821xx/patches-4.14/120-0006-crypto-crypto4xx-performance-optimizations.patch b/target/linux/apm821xx/patches-4.14/120-0006-crypto-crypto4xx-performance-optimizations.patch new file mode 100644 index 0000000000..0475fdaf8f --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/120-0006-crypto-crypto4xx-performance-optimizations.patch @@ -0,0 +1,158 @@ +From 30afcbb01a750a1ef0cee8a0861a347912c2e4fb Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Thu, 21 Dec 2017 16:00:01 +0100 +Subject: [PATCH 6/6] crypto: crypto4xx - performance optimizations + +This patch provides a cheap 2MiB/s+ (~ 6%) performance +improvement over the current code. This is because the +compiler can now optimize several endian swap memcpy. + +Signed-off-by: Christian Lamparter +--- + drivers/crypto/amcc/crypto4xx_alg.c | 32 +++++++++++++++++++------------- + drivers/crypto/amcc/crypto4xx_core.c | 22 +++++++++++----------- + drivers/crypto/amcc/crypto4xx_core.h | 6 ++++-- + 3 files changed, 34 insertions(+), 26 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -74,32 +74,38 @@ static void set_dynamic_sa_command_1(str + sa->sa_command_1.bf.copy_hdr = cp_hdr; + } + +-int crypto4xx_encrypt(struct ablkcipher_request *req) ++static inline int crypto4xx_crypt(struct ablkcipher_request *req, ++ const unsigned int ivlen, bool decrypt) + { + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); +- unsigned int ivlen = crypto_ablkcipher_ivsize( +- crypto_ablkcipher_reqtfm(req)); + __le32 iv[ivlen]; + + if (ivlen) + crypto4xx_memcpy_to_le32(iv, req->info, ivlen); + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, +- req->nbytes, iv, ivlen, ctx->sa_out, ctx->sa_len, 0); ++ req->nbytes, iv, ivlen, decrypt ? ctx->sa_in : ctx->sa_out, ++ ctx->sa_len, 0); + } + +-int crypto4xx_decrypt(struct ablkcipher_request *req) ++int crypto4xx_encrypt_noiv(struct ablkcipher_request *req) + { +- struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); +- unsigned int ivlen = crypto_ablkcipher_ivsize( +- crypto_ablkcipher_reqtfm(req)); +- __le32 iv[ivlen]; ++ return crypto4xx_crypt(req, 0, false); ++} + +- if (ivlen) +- crypto4xx_memcpy_to_le32(iv, req->info, ivlen); ++int crypto4xx_encrypt_iv(struct ablkcipher_request *req) ++{ ++ return crypto4xx_crypt(req, AES_IV_SIZE, false); ++} + +- return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, +- req->nbytes, iv, ivlen, ctx->sa_in, ctx->sa_len, 0); ++int crypto4xx_decrypt_noiv(struct ablkcipher_request *req) ++{ ++ return crypto4xx_crypt(req, 0, true); ++} ++ ++int crypto4xx_decrypt_iv(struct ablkcipher_request *req) ++{ ++ return crypto4xx_crypt(req, AES_IV_SIZE, true); + } + + /** +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -582,7 +582,7 @@ static void crypto4xx_aead_done(struct c + struct scatterlist *dst = pd_uinfo->dest_va; + size_t cp_len = crypto_aead_authsize( + crypto_aead_reqtfm(aead_req)); +- u32 icv[cp_len]; ++ u32 icv[AES_BLOCK_SIZE]; + int err = 0; + + if (pd_uinfo->using_sd) { +@@ -597,7 +597,7 @@ static void crypto4xx_aead_done(struct c + if (pd_uinfo->sa_va->sa_command_0.bf.dir == DIR_OUTBOUND) { + /* append icv at the end */ + crypto4xx_memcpy_from_le32(icv, pd_uinfo->sr_va->save_digest, +- cp_len); ++ sizeof(icv)); + + scatterwalk_map_and_copy(icv, dst, aead_req->cryptlen, + cp_len, 1); +@@ -607,7 +607,7 @@ static void crypto4xx_aead_done(struct c + aead_req->assoclen + aead_req->cryptlen - + cp_len, cp_len, 0); + +- crypto4xx_memcpy_from_le32(icv, icv, cp_len); ++ crypto4xx_memcpy_from_le32(icv, icv, sizeof(icv)); + + if (crypto_memneq(icv, pd_uinfo->sr_va->save_digest, cp_len)) + err = -EBADMSG; +@@ -1124,8 +1124,8 @@ static struct crypto4xx_alg_common crypt + .max_keysize = AES_MAX_KEY_SIZE, + .ivsize = AES_IV_SIZE, + .setkey = crypto4xx_setkey_aes_cbc, +- .encrypt = crypto4xx_encrypt, +- .decrypt = crypto4xx_decrypt, ++ .encrypt = crypto4xx_encrypt_iv, ++ .decrypt = crypto4xx_decrypt_iv, + } + } + }}, +@@ -1148,8 +1148,8 @@ static struct crypto4xx_alg_common crypt + .max_keysize = AES_MAX_KEY_SIZE, + .ivsize = AES_IV_SIZE, + .setkey = crypto4xx_setkey_aes_cfb, +- .encrypt = crypto4xx_encrypt, +- .decrypt = crypto4xx_decrypt, ++ .encrypt = crypto4xx_encrypt_iv, ++ .decrypt = crypto4xx_decrypt_iv, + } + } + } }, +@@ -1197,8 +1197,8 @@ static struct crypto4xx_alg_common crypt + .min_keysize = AES_MIN_KEY_SIZE, + .max_keysize = AES_MAX_KEY_SIZE, + .setkey = crypto4xx_setkey_aes_ecb, +- .encrypt = crypto4xx_encrypt, +- .decrypt = crypto4xx_decrypt, ++ .encrypt = crypto4xx_encrypt_noiv, ++ .decrypt = crypto4xx_decrypt_noiv, + } + } + } }, +@@ -1221,8 +1221,8 @@ static struct crypto4xx_alg_common crypt + .max_keysize = AES_MAX_KEY_SIZE, + .ivsize = AES_IV_SIZE, + .setkey = crypto4xx_setkey_aes_ofb, +- .encrypt = crypto4xx_encrypt, +- .decrypt = crypto4xx_decrypt, ++ .encrypt = crypto4xx_encrypt_iv, ++ .decrypt = crypto4xx_decrypt_iv, + } + } + } }, +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -168,8 +168,10 @@ int crypto4xx_setkey_aes_ofb(struct cryp + const u8 *key, unsigned int keylen); + int crypto4xx_setkey_rfc3686(struct crypto_ablkcipher *cipher, + const u8 *key, unsigned int keylen); +-int crypto4xx_encrypt(struct ablkcipher_request *req); +-int crypto4xx_decrypt(struct ablkcipher_request *req); ++int crypto4xx_encrypt_iv(struct ablkcipher_request *req); ++int crypto4xx_decrypt_iv(struct ablkcipher_request *req); ++int crypto4xx_encrypt_noiv(struct ablkcipher_request *req); ++int crypto4xx_decrypt_noiv(struct ablkcipher_request *req); + int crypto4xx_rfc3686_encrypt(struct ablkcipher_request *req); + int crypto4xx_rfc3686_decrypt(struct ablkcipher_request *req); + int crypto4xx_sha1_alg_init(struct crypto_tfm *tfm); diff --git a/target/linux/apm821xx/patches-4.9/200-add-meraki-mr24-ikarem-support.patch b/target/linux/apm821xx/patches-4.14/200-add-meraki-mr24-ikarem-support.patch similarity index 95% rename from target/linux/apm821xx/patches-4.9/200-add-meraki-mr24-ikarem-support.patch rename to target/linux/apm821xx/patches-4.14/200-add-meraki-mr24-ikarem-support.patch index 018bcf21a0..e9f6c5cfc5 100644 --- a/target/linux/apm821xx/patches-4.9/200-add-meraki-mr24-ikarem-support.patch +++ b/target/linux/apm821xx/patches-4.14/200-add-meraki-mr24-ikarem-support.patch @@ -1,6 +1,6 @@ --- a/arch/powerpc/platforms/44x/Kconfig +++ b/arch/powerpc/platforms/44x/Kconfig -@@ -40,6 +40,19 @@ config EBONY +@@ -41,6 +41,19 @@ config EBONY help This option enables support for the IBM PPC440GP evaluation board. diff --git a/target/linux/apm821xx/patches-4.9/201-add-amcc-apollo3g-support.patch b/target/linux/apm821xx/patches-4.14/201-add-amcc-apollo3g-support.patch similarity index 94% rename from target/linux/apm821xx/patches-4.9/201-add-amcc-apollo3g-support.patch rename to target/linux/apm821xx/patches-4.14/201-add-amcc-apollo3g-support.patch index 0581a43e33..18982392d4 100644 --- a/target/linux/apm821xx/patches-4.9/201-add-amcc-apollo3g-support.patch +++ b/target/linux/apm821xx/patches-4.14/201-add-amcc-apollo3g-support.patch @@ -1,6 +1,6 @@ --- a/arch/powerpc/platforms/44x/Kconfig +++ b/arch/powerpc/platforms/44x/Kconfig -@@ -143,6 +143,17 @@ config CANYONLANDS +@@ -144,6 +144,17 @@ config CANYONLANDS help This option enables support for the AMCC PPC460EX evaluation board. diff --git a/target/linux/apm821xx/patches-4.9/202-add-netgear-wndr4700-support.patch b/target/linux/apm821xx/patches-4.14/202-add-netgear-wndr4700-support.patch similarity index 88% rename from target/linux/apm821xx/patches-4.9/202-add-netgear-wndr4700-support.patch rename to target/linux/apm821xx/patches-4.14/202-add-netgear-wndr4700-support.patch index 6b6db1dddb..77294a8cbd 100644 --- a/target/linux/apm821xx/patches-4.9/202-add-netgear-wndr4700-support.patch +++ b/target/linux/apm821xx/patches-4.14/202-add-netgear-wndr4700-support.patch @@ -1,7 +1,7 @@ --- a/arch/powerpc/platforms/44x/Makefile +++ b/arch/powerpc/platforms/44x/Makefile -@@ -3,6 +3,7 @@ ifneq ($(CONFIG_PPC4xx_CPM),y) - obj-$(CONFIG_44x) += idle.o +@@ -4,6 +4,7 @@ ifneq ($(CONFIG_PPC4xx_CPM),y) + obj-y += idle.o endif obj-$(CONFIG_PPC44x_SIMPLE) += ppc44x_simple.o +obj-$(CONFIG_WNDR4700) += wndr4700.o @@ -10,7 +10,7 @@ obj-$(CONFIG_WARP) += warp.o --- a/arch/powerpc/platforms/44x/Kconfig +++ b/arch/powerpc/platforms/44x/Kconfig -@@ -260,6 +260,19 @@ config ICON +@@ -273,6 +273,19 @@ config ICON help This option enables support for the AMCC PPC440SPe evaluation board. diff --git a/target/linux/apm821xx/patches-4.9/203-add-meraki-mx60-buckminster-support.patch b/target/linux/apm821xx/patches-4.14/203-add-meraki-mx60-buckminster-support.patch similarity index 95% rename from target/linux/apm821xx/patches-4.9/203-add-meraki-mx60-buckminster-support.patch rename to target/linux/apm821xx/patches-4.14/203-add-meraki-mx60-buckminster-support.patch index 8c072387d4..c3931c9809 100644 --- a/target/linux/apm821xx/patches-4.9/203-add-meraki-mx60-buckminster-support.patch +++ b/target/linux/apm821xx/patches-4.14/203-add-meraki-mx60-buckminster-support.patch @@ -1,6 +1,6 @@ --- a/arch/powerpc/platforms/44x/Kconfig +++ b/arch/powerpc/platforms/44x/Kconfig -@@ -30,6 +30,19 @@ config BLUESTONE +@@ -31,6 +31,19 @@ config BLUESTONE help This option enables support for the APM APM821xx Evaluation board. diff --git a/target/linux/apm821xx/patches-4.9/300-fix-atheros-nics-on-apm82181.patch b/target/linux/apm821xx/patches-4.14/300-fix-atheros-nics-on-apm82181.patch similarity index 88% rename from target/linux/apm821xx/patches-4.9/300-fix-atheros-nics-on-apm82181.patch rename to target/linux/apm821xx/patches-4.14/300-fix-atheros-nics-on-apm82181.patch index 0b1affcfe7..110726d258 100644 --- a/target/linux/apm821xx/patches-4.9/300-fix-atheros-nics-on-apm82181.patch +++ b/target/linux/apm821xx/patches-4.14/300-fix-atheros-nics-on-apm82181.patch @@ -1,6 +1,6 @@ ---- a/arch/powerpc/sysdev/ppc4xx_pci.c -+++ b/arch/powerpc/sysdev/ppc4xx_pci.c -@@ -1066,15 +1066,24 @@ static int __init apm821xx_pciex_init_po +--- a/arch/powerpc/platforms/4xx/pci.c ++++ b/arch/powerpc/platforms/4xx/pci.c +@@ -1060,15 +1060,24 @@ static int __init apm821xx_pciex_init_po u32 val; /* @@ -33,7 +33,7 @@ if (port->endpoint) val = PTYPE_LEGACY_ENDPOINT << 20; -@@ -1091,9 +1100,12 @@ static int __init apm821xx_pciex_init_po +@@ -1085,9 +1094,12 @@ static int __init apm821xx_pciex_init_po mtdcri(SDR0, PESDR0_460EX_L0DRV, 0x00000130); mtdcri(SDR0, PESDR0_460EX_L0CLK, 0x00000006); diff --git a/target/linux/apm821xx/patches-4.9/301-fix-memory-map-wndr4700.patch b/target/linux/apm821xx/patches-4.14/301-fix-memory-map-wndr4700.patch similarity index 74% rename from target/linux/apm821xx/patches-4.9/301-fix-memory-map-wndr4700.patch rename to target/linux/apm821xx/patches-4.14/301-fix-memory-map-wndr4700.patch index d6a1006177..6eb04b2c25 100644 --- a/target/linux/apm821xx/patches-4.9/301-fix-memory-map-wndr4700.patch +++ b/target/linux/apm821xx/patches-4.14/301-fix-memory-map-wndr4700.patch @@ -1,6 +1,6 @@ ---- a/arch/powerpc/sysdev/ppc4xx_pci.c -+++ b/arch/powerpc/sysdev/ppc4xx_pci.c -@@ -1913,9 +1913,9 @@ static void __init ppc4xx_configure_pcie +--- a/arch/powerpc/platforms/4xx/pci.c ++++ b/arch/powerpc/platforms/4xx/pci.c +@@ -1905,9 +1905,9 @@ static void __init ppc4xx_configure_pcie * if it works */ out_le32(mbase + PECFG_PIM0LAL, 0x00000000); diff --git a/target/linux/apm821xx/patches-4.9/701-powerpc_ibm_apm82181_phyclk_fix.patch b/target/linux/apm821xx/patches-4.14/701-powerpc_ibm_apm82181_phyclk_fix.patch similarity index 91% rename from target/linux/apm821xx/patches-4.9/701-powerpc_ibm_apm82181_phyclk_fix.patch rename to target/linux/apm821xx/patches-4.14/701-powerpc_ibm_apm82181_phyclk_fix.patch index 457c5e3780..7f630a3c2a 100644 --- a/target/linux/apm821xx/patches-4.9/701-powerpc_ibm_apm82181_phyclk_fix.patch +++ b/target/linux/apm821xx/patches-4.14/701-powerpc_ibm_apm82181_phyclk_fix.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/ibm/emac/core.c +++ b/drivers/net/ethernet/ibm/emac/core.c -@@ -129,6 +129,7 @@ static inline void emac_report_timeout_e +@@ -130,6 +130,7 @@ static inline void emac_report_timeout_e { if (emac_has_feature(dev, EMAC_FTR_440GX_PHY_CLK_FIX | EMAC_FTR_460EX_PHY_CLK_FIX | @@ -30,7 +30,7 @@ #endif } -@@ -2617,6 +2626,7 @@ static int emac_init_config(struct emac_ +@@ -2879,6 +2888,7 @@ static int emac_init_config(struct emac_ if (of_device_is_compatible(np, "ibm,emac-apm821xx")) { dev->features |= (EMAC_APM821XX_REQ_JUMBO_FRAME_SIZE | EMAC_FTR_APM821XX_NO_HALF_DUPLEX | @@ -40,7 +40,7 @@ } else if (of_device_is_compatible(np, "ibm,emac4")) { --- a/drivers/net/ethernet/ibm/emac/core.h +++ b/drivers/net/ethernet/ibm/emac/core.h -@@ -333,6 +333,8 @@ struct emac_instance { +@@ -335,6 +335,8 @@ struct emac_instance { */ #define EMAC_FTR_APM821XX_NO_HALF_DUPLEX 0x00001000 diff --git a/target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch similarity index 98% rename from target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch rename to target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch index 96a5940e79..144a06970f 100644 --- a/target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch +++ b/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch @@ -44,7 +44,7 @@ Signed-off-by: Christian Lamparter #include "xhci.h" #include "xhci-trace.h" -@@ -236,6 +238,458 @@ static void xhci_pme_acpi_rtd3_enable(st +@@ -238,6 +240,458 @@ static void xhci_pme_acpi_rtd3_enable(st static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { } #endif /* CONFIG_ACPI */ @@ -503,7 +503,7 @@ Signed-off-by: Christian Lamparter /* called during probe() after chip reset completes */ static int xhci_pci_setup(struct usb_hcd *hcd) { -@@ -275,6 +729,22 @@ static int xhci_pci_probe(struct pci_dev +@@ -273,6 +727,22 @@ static int xhci_pci_probe(struct pci_dev struct hc_driver *driver; struct usb_hcd *hcd; @@ -525,8 +525,8 @@ Signed-off-by: Christian Lamparter + driver = (struct hc_driver *)id->driver_data; - /* Prevent runtime suspending between USB-2 and USB-3 initialization */ -@@ -332,6 +802,16 @@ static void xhci_pci_remove(struct pci_d + /* For some HW implementation, a XHCI reset is just not enough... */ +@@ -337,6 +807,16 @@ static void xhci_pci_remove(struct pci_d { struct xhci_hcd *xhci; diff --git a/target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch similarity index 85% rename from target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch rename to target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch index 4d7c686618..ec97f16e27 100644 --- a/target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch +++ b/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch @@ -13,8 +13,8 @@ produce a noisy warning. --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -193,7 +193,7 @@ static void xhci_pci_quirks(struct devic - } +@@ -196,7 +196,7 @@ static void xhci_pci_quirks(struct devic + xhci->quirks |= XHCI_TRUST_TX_LENGTH; if (pdev->vendor == PCI_VENDOR_ID_RENESAS && pdev->device == 0x0015) - xhci->quirks |= XHCI_RESET_ON_RESUME; @@ -24,7 +24,7 @@ produce a noisy warning. --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -390,10 +390,14 @@ static int xhci_try_enable_msi(struct us +@@ -357,10 +357,14 @@ static int xhci_try_enable_msi(struct us free_irq(hcd->irq, hcd); hcd->irq = 0; @@ -40,11 +40,11 @@ produce a noisy warning. + ret = xhci_setup_msi(xhci); + } - if (!ret) - /* hcd->irq is 0, we have MSI */ + if (!ret) { + hcd->msi_enabled = 1; --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1680,6 +1680,7 @@ struct xhci_hcd { +@@ -1848,6 +1848,7 @@ struct xhci_hcd { /* support xHCI 0.96 spec USB2 software LPM */ unsigned sw_lpm_support:1; /* support xHCI 1.0 spec USB2 hardware LPM */ diff --git a/target/linux/apm821xx/patches-4.14/803-hwmon-tc654-add-detection-routine.patch b/target/linux/apm821xx/patches-4.14/803-hwmon-tc654-add-detection-routine.patch new file mode 100644 index 0000000000..f8b30ae1b3 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/803-hwmon-tc654-add-detection-routine.patch @@ -0,0 +1,65 @@ +From 694f9bfb8efaef8a33e8992015ff9d0866faf4a2 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Sun, 17 Dec 2017 17:27:15 +0100 +Subject: [PATCH 1/2] hwmon: tc654 add detection routine + +This patch adds a detection routine for the TC654/TC655 +chips. Both IDs are listed in the Datasheet. + +Signed-off-by: Christian Lamparter +--- + drivers/hwmon/tc654.c | 29 +++++++++++++++++++++++++++++ + 1 file changed, 29 insertions(+) + +--- a/drivers/hwmon/tc654.c ++++ b/drivers/hwmon/tc654.c +@@ -64,6 +64,11 @@ enum tc654_regs { + /* Register data is read (and cached) at most once per second. */ + #define TC654_UPDATE_INTERVAL HZ + ++/* Manufacturer and Version Identification Register Values */ ++#define TC654_MFR_ID_MICROCHIP 0x84 ++#define TC654_VER_ID 0x00 ++#define TC655_VER_ID 0x01 ++ + struct tc654_data { + struct i2c_client *client; + +@@ -497,6 +502,29 @@ static const struct i2c_device_id tc654_ + {} + }; + ++static int ++tc654_detect(struct i2c_client *new_client, struct i2c_board_info *info) ++{ ++ struct i2c_adapter *adapter = new_client->adapter; ++ int manufacturer, product; ++ ++ if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) ++ return -ENODEV; ++ ++ manufacturer = i2c_smbus_read_byte_data(new_client, TC654_REG_MFR_ID); ++ if (manufacturer != TC654_MFR_ID_MICROCHIP) ++ return -ENODEV; ++ ++ product = i2c_smbus_read_byte_data(new_client, TC654_REG_VER_ID); ++ if (!((product == TC654_VER_ID) || (product == TC655_VER_ID))) ++ return -ENODEV; ++ ++ strlcpy(info->type, product == TC654_VER_ID ? "tc654" : "tc655", ++ I2C_NAME_SIZE); ++ return 0; ++} ++ ++ + MODULE_DEVICE_TABLE(i2c, tc654_id); + + static struct i2c_driver tc654_driver = { +@@ -505,6 +533,7 @@ static struct i2c_driver tc654_driver = + }, + .probe = tc654_probe, + .id_table = tc654_id, ++ .detect = tc654_detect, + }; + + module_i2c_driver(tc654_driver); diff --git a/target/linux/apm821xx/patches-4.14/804-hwmon-tc654-add-thermal_cooling-device.patch b/target/linux/apm821xx/patches-4.14/804-hwmon-tc654-add-thermal_cooling-device.patch new file mode 100644 index 0000000000..18ed8aecce --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/804-hwmon-tc654-add-thermal_cooling-device.patch @@ -0,0 +1,174 @@ +From 15ae701189744d321d3a1264ff46f8871e8765ee Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Sun, 17 Dec 2017 17:29:13 +0100 +Subject: [PATCH] hwmon: tc654: add thermal_cooling device + +This patch adds a thermaL_cooling device to the tc654 driver. +This allows the chip to be used for DT-based cooling. + +Signed-off-by: Christian Lamparter +--- + drivers/hwmon/tc654.c | 103 +++++++++++++++++++++++++++++++++++++++++--------- + 1 file changed, 86 insertions(+), 17 deletions(-) + +--- a/drivers/hwmon/tc654.c ++++ b/drivers/hwmon/tc654.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + #include + + enum tc654_regs { +@@ -141,6 +142,9 @@ struct tc654_data { + * writable register used to control the duty + * cycle of the V OUT output. + */ ++ ++ /* optional cooling device */ ++ struct thermal_cooling_device *cdev; + }; + + /* helper to grab and cache data, at most one time per second */ +@@ -376,36 +380,30 @@ static ssize_t set_pwm_mode(struct devic + static const int tc654_pwm_map[16] = { 77, 88, 102, 112, 124, 136, 148, 160, + 172, 184, 196, 207, 219, 231, 243, 255}; + ++static int get_pwm(struct tc654_data *data) ++{ ++ if (data->config & TC654_REG_CONFIG_SDM) ++ return 0; ++ else ++ return tc654_pwm_map[data->duty_cycle]; ++} ++ + static ssize_t show_pwm(struct device *dev, struct device_attribute *da, + char *buf) + { + struct tc654_data *data = tc654_update_client(dev); +- int pwm; + + if (IS_ERR(data)) + return PTR_ERR(data); + +- if (data->config & TC654_REG_CONFIG_SDM) +- pwm = 0; +- else +- pwm = tc654_pwm_map[data->duty_cycle]; +- +- return sprintf(buf, "%d\n", pwm); ++ return sprintf(buf, "%d\n", get_pwm(data)); + } + +-static ssize_t set_pwm(struct device *dev, struct device_attribute *da, +- const char *buf, size_t count) ++static int _set_pwm(struct tc654_data *data, unsigned long val) + { +- struct tc654_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->client; +- unsigned long val; + int ret; + +- if (kstrtoul(buf, 10, &val)) +- return -EINVAL; +- if (val > 255) +- return -EINVAL; +- + mutex_lock(&data->update_lock); + + if (val == 0) +@@ -425,6 +423,22 @@ static ssize_t set_pwm(struct device *de + + out: + mutex_unlock(&data->update_lock); ++ return ret; ++} ++ ++static ssize_t set_pwm(struct device *dev, struct device_attribute *da, ++ const char *buf, size_t count) ++{ ++ struct tc654_data *data = dev_get_drvdata(dev); ++ unsigned long val; ++ int ret; ++ ++ if (kstrtoul(buf, 10, &val)) ++ return -EINVAL; ++ if (val > 255) ++ return -EINVAL; ++ ++ ret = _set_pwm(data, val); + return ret < 0 ? ret : count; + } + +@@ -462,6 +476,47 @@ static struct attribute *tc654_attrs[] = + + ATTRIBUTE_GROUPS(tc654); + ++/* cooling device */ ++ ++static int tc654_get_max_state(struct thermal_cooling_device *cdev, ++ unsigned long *state) ++{ ++ *state = 255; ++ return 0; ++} ++ ++static int tc654_get_cur_state(struct thermal_cooling_device *cdev, ++ unsigned long *state) ++{ ++ struct tc654_data *data = tc654_update_client(cdev->devdata); ++ ++ if (IS_ERR(data)) ++ return PTR_ERR(data); ++ ++ *state = get_pwm(data); ++ return 0; ++} ++ ++static int tc654_set_cur_state(struct thermal_cooling_device *cdev, ++ unsigned long state) ++{ ++ struct tc654_data *data = tc654_update_client(cdev->devdata); ++ ++ if (IS_ERR(data)) ++ return PTR_ERR(data); ++ ++ if (state > 255) ++ return -EINVAL; ++ ++ return _set_pwm(data, state); ++} ++ ++static const struct thermal_cooling_device_ops tc654_fan_cool_ops = { ++ .get_max_state = tc654_get_max_state, ++ .get_cur_state = tc654_get_cur_state, ++ .set_cur_state = tc654_set_cur_state, ++}; ++ + /* + * device probe and removal + */ +@@ -493,7 +548,21 @@ static int tc654_probe(struct i2c_client + hwmon_dev = + devm_hwmon_device_register_with_groups(dev, client->name, data, + tc654_groups); +- return PTR_ERR_OR_ZERO(hwmon_dev); ++ if (IS_ERR(hwmon_dev)) ++ return PTR_ERR(hwmon_dev); ++ ++#if IS_ENABLED(CONFIG_OF) ++ /* Optional cooling device register for Device tree platforms */ ++ data->cdev = thermal_of_cooling_device_register(client->dev.of_node, ++ "tc654", hwmon_dev, ++ &tc654_fan_cool_ops); ++#else /* CONFIG_OF */ ++ /* Optional cooling device register for non Device tree platforms */ ++ data->cdev = thermal_cooling_device_register("tc654", hwmon_dev, ++ &tc654_fan_cool_ops); ++#endif /* CONFIG_OF */ ++ ++ return PTR_ERR_OR_ZERO(data->cdev); + } + + static const struct i2c_device_id tc654_id[] = { diff --git a/target/linux/apm821xx/patches-4.9/702-powerpc_ibm_phy_add_dt_parser.patch b/target/linux/apm821xx/patches-4.9/702-powerpc_ibm_phy_add_dt_parser.patch deleted file mode 100644 index 4e53fdfa21..0000000000 --- a/target/linux/apm821xx/patches-4.9/702-powerpc_ibm_phy_add_dt_parser.patch +++ /dev/null @@ -1,328 +0,0 @@ -From b1c54da602ae9215cfbde1c3ed3b6296b76f07fc Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: <246bd6614529d28dc48b11981ab5dae7a7364fc2.1486337989.git.chunkeey@googlemail.com> -References: <246bd6614529d28dc48b11981ab5dae7a7364fc2.1486337989.git.chunkeey@googlemail.com> -From: Christian Lamparter -Date: Mon, 13 Jun 2016 15:42:21 +0200 -Subject: [RFC 2/2] net: emac: add support for device-tree based PHY discovery - and setup -To: netdev@vger.kernel.org, - devicetree@vger.kernel.org -Cc: David S. Miller , - Ivan Mikhaylov , - Mark Rutland , - Rob Herring - -This patch adds glue-code that allows the EMAC driver to interface -with the existing dt-supported PHYs in drivers/net/phy. - -Because currently, the emac driver maintains a small library of -supported phys for in a private phy.c file located in the drivers -directory. - -The support is limited to mostly single ethernet transceiver like the: -CIS8201, BCM5248, ET1011C, Marvell 88E1111 and 88E1112, AR8035. -However, routers like the Netgear WNDR4700 and Cisco Meraki MX60(W) -have a 5-port switch (QCA8327N) attached to the MDIO of the EMAC. -The switch chip has already a proper phy-driver (ar8216) that uses -the generic phy library. - -Signed-off-by: Christian Lamparter ---- ---- a/drivers/net/ethernet/ibm/emac/core.c -+++ b/drivers/net/ethernet/ibm/emac/core.c -@@ -42,6 +42,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -2422,6 +2423,229 @@ static int emac_read_uint_prop(struct de - return 0; - } - -+static void emac_adjust_link(struct net_device *ndev) -+{ -+ struct emac_instance *dev = netdev_priv(ndev); -+ struct phy_device *phy = dev->phy_dev; -+ -+ dev->phy.autoneg = phy->autoneg; -+ dev->phy.speed = phy->speed; -+ dev->phy.duplex = phy->duplex; -+ dev->phy.pause = phy->pause; -+ dev->phy.asym_pause = phy->asym_pause; -+ dev->phy.advertising = phy->advertising; -+} -+ -+static int emac_mii_bus_read(struct mii_bus *bus, int addr, int regnum) -+{ -+ return emac_mdio_read(bus->priv, addr, regnum); -+} -+ -+static int emac_mii_bus_write(struct mii_bus *bus, int addr, int regnum, u16 val) -+{ -+ emac_mdio_write(bus->priv, addr, regnum, val); -+ return 0; -+} -+ -+static int emac_mii_bus_reset(struct mii_bus *bus) -+{ -+ struct emac_instance *dev = netdev_priv(bus->priv); -+ int err; -+ -+ err = emac_reset(dev); -+ if (err) -+ return err; -+ /* Meraki MX60(W)'s uboot will disable the switch and -+ * a bus reset won't do anything. */ -+ emac_mii_reset_phy(&dev->phy); -+ return 0; -+} -+ -+static int emac_mdio_setup_aneg(struct mii_phy *phy, u32 advertise) -+{ -+ struct net_device *ndev = phy->dev; -+ struct emac_instance *dev = netdev_priv(ndev); -+ -+ dev->phy.autoneg = AUTONEG_ENABLE; -+ dev->phy.speed = SPEED_1000; -+ dev->phy.duplex = DUPLEX_FULL; -+ dev->phy.advertising = advertise; -+ phy->autoneg = AUTONEG_ENABLE; -+ phy->speed = dev->phy.speed; -+ phy->duplex = dev->phy.duplex; -+ phy->advertising = advertise; -+ return phy_start_aneg(dev->phy_dev); -+} -+ -+static int emac_mdio_setup_forced(struct mii_phy *phy, int speed, int fd) -+{ -+ struct net_device *ndev = phy->dev; -+ struct emac_instance *dev = netdev_priv(ndev); -+ -+ dev->phy.autoneg = AUTONEG_DISABLE; -+ dev->phy.speed = speed; -+ dev->phy.duplex = fd; -+ phy->autoneg = AUTONEG_DISABLE; -+ phy->speed = speed; -+ phy->duplex = fd; -+ return phy_start_aneg(dev->phy_dev); -+} -+ -+static int emac_mdio_poll_link(struct mii_phy *phy) -+{ -+ struct net_device *ndev = phy->dev; -+ struct emac_instance *dev = netdev_priv(ndev); -+ int res; -+ -+ res = phy_read_status(dev->phy_dev); -+ if (res) { -+ dev_err(&dev->ofdev->dev, "link update failed (%d).", res); -+ return ethtool_op_get_link(ndev); -+ } -+ -+ return dev->phy_dev->link; -+} -+ -+static int emac_mdio_read_link(struct mii_phy *phy) -+{ -+ struct net_device *ndev = phy->dev; -+ struct emac_instance *dev = netdev_priv(ndev); -+ int res; -+ -+ res = phy_read_status(dev->phy_dev); -+ if (res) -+ return res; -+ -+ dev->phy.speed = phy->speed; -+ dev->phy.duplex = phy->duplex; -+ dev->phy.pause = phy->pause; -+ dev->phy.asym_pause = phy->asym_pause; -+ return 0; -+} -+ -+static int emac_mdio_init_phy(struct mii_phy *phy) -+{ -+ struct net_device *ndev = phy->dev; -+ struct emac_instance *dev = netdev_priv(ndev); -+ -+ phy_start(dev->phy_dev); -+ dev->phy.autoneg = phy->autoneg; -+ dev->phy.speed = phy->speed; -+ dev->phy.duplex = phy->duplex; -+ dev->phy.advertising = phy->advertising; -+ dev->phy.pause = phy->pause; -+ dev->phy.asym_pause = phy->asym_pause; -+ -+ return phy_init_hw(dev->phy_dev); -+} -+ -+static const struct mii_phy_ops emac_dt_mdio_phy_ops = { -+ .init = emac_mdio_init_phy, -+ .setup_aneg = emac_mdio_setup_aneg, -+ .setup_forced = emac_mdio_setup_forced, -+ .poll_link = emac_mdio_poll_link, -+ .read_link = emac_mdio_read_link, -+}; -+ -+static int emac_dt_mdio_probe(struct emac_instance *dev) -+{ -+ struct device_node *mii_np; -+ int res; -+ -+ mii_np = of_get_child_by_name(dev->ofdev->dev.of_node, "mdio"); -+ if (!mii_np) { -+ dev_err(&dev->ofdev->dev, "no mdio definition found."); -+ return -ENODEV; -+ } -+ -+ if (!of_device_is_available(mii_np)) { -+ res = 1; -+ goto put_node; -+ } -+ -+ dev->mii_bus = devm_mdiobus_alloc(&dev->ofdev->dev); -+ if (!dev->mii_bus) { -+ res = -ENOMEM; -+ goto put_node; -+ } -+ -+ dev->mii_bus->priv = dev->ndev; -+ dev->mii_bus->parent = dev->ndev->dev.parent; -+ dev->mii_bus->name = "emac_mdio"; -+ dev->mii_bus->read = &emac_mii_bus_read; -+ dev->mii_bus->write = &emac_mii_bus_write; -+ dev->mii_bus->reset = &emac_mii_bus_reset; -+ snprintf(dev->mii_bus->id, MII_BUS_ID_SIZE, "%s", dev->ofdev->name); -+ res = of_mdiobus_register(dev->mii_bus, mii_np); -+ if (res) { -+ dev_err(&dev->ofdev->dev, "cannot register MDIO bus %s (%d)", -+ dev->mii_bus->name, res); -+ } -+ -+ put_node: -+ of_node_put(mii_np); -+ return res; -+} -+ -+static int emac_dt_phy_probe(struct emac_instance *dev, -+ struct device_node *phy_handle) -+{ -+ u32 phy_flags = 0; -+ int res; -+ -+ res = of_property_read_u32(phy_handle, "phy-flags", &phy_flags); -+ if (res < 0 && res != -EINVAL) -+ return res; -+ -+ dev->phy.def = devm_kzalloc(&dev->ofdev->dev, sizeof(*dev->phy.def), -+ GFP_KERNEL); -+ if (!dev->phy.def) -+ return -ENOMEM; -+ -+ dev->phy_dev = of_phy_connect(dev->ndev, phy_handle, -+ &emac_adjust_link, phy_flags, -+ PHY_INTERFACE_MODE_RGMII); -+ if (!dev->phy_dev) { -+ dev_err(&dev->ofdev->dev, "failed to connect to PHY.\n"); -+ return -ENODEV; -+ } -+ -+ dev->phy.def->phy_id = dev->phy_dev->drv->phy_id; -+ dev->phy.def->phy_id_mask = dev->phy_dev->drv->phy_id_mask; -+ dev->phy.def->name = dev->phy_dev->drv->name; -+ dev->phy.def->ops = &emac_dt_mdio_phy_ops; -+ dev->phy.features = dev->phy_dev->supported; -+ dev->phy.address = dev->phy_dev->mdio.addr; -+ dev->phy.mode = dev->phy_dev->interface; -+ return 0; -+} -+ -+static int emac_probe_dt_phy(struct emac_instance *dev) -+{ -+ struct device_node *np = dev->ofdev->dev.of_node; -+ struct device_node *phy_handle; -+ int res = 0; -+ -+ phy_handle = of_parse_phandle(np, "phy-handle", 0); -+ -+ if (phy_handle) { -+ res = emac_dt_mdio_probe(dev); -+ if (!res) { -+ res = emac_dt_phy_probe(dev, phy_handle); -+ if (!res) -+ res = 1; -+ else -+ mdiobus_unregister(dev->mii_bus); -+ } -+ } -+ -+ of_node_put(phy_handle); -+ /* if no phy device was specified in the device tree, then we fallback -+ * to the old emac_phy.c probe code for compatibility reasons. -+ */ -+ return res; -+} -+ - static int emac_init_phy(struct emac_instance *dev) - { - struct device_node *np = dev->ofdev->dev.of_node; -@@ -2492,6 +2716,22 @@ static int emac_init_phy(struct emac_ins - - emac_configure(dev); - -+ if (emac_has_feature(dev, EMAC_FTR_HAS_RGMII)) { -+ int res = emac_probe_dt_phy(dev); -+ -+ if (res == 1) { -+ mutex_unlock(&emac_phy_map_lock); -+ goto init_phy; -+ } else if (res < 0) { -+ mutex_unlock(&emac_phy_map_lock); -+ dev_err(&dev->ofdev->dev, "failed to attach dt phy (%d).\n", -+ res); -+ return res; -+ } -+ -+ /* continue with old code */ -+ } -+ - if (dev->phy_address != 0xffffffff) - phy_map = ~(1 << dev->phy_address); - -@@ -2519,6 +2759,7 @@ static int emac_init_phy(struct emac_ins - return -ENXIO; - } - -+ init_phy: - /* Init PHY */ - if (dev->phy.def->ops->init) - dev->phy.def->ops->init(&dev->phy); -@@ -2988,6 +3229,12 @@ static int emac_remove(struct platform_d - if (emac_has_feature(dev, EMAC_FTR_HAS_ZMII)) - zmii_detach(dev->zmii_dev, dev->zmii_port); - -+ if (dev->phy_dev) -+ phy_disconnect(dev->phy_dev); -+ -+ if (dev->mii_bus) -+ mdiobus_unregister(dev->mii_bus); -+ - busy_phy_map &= ~(1 << dev->phy.address); - DBG(dev, "busy_phy_map now %#x" NL, busy_phy_map); - ---- a/drivers/net/ethernet/ibm/emac/core.h -+++ b/drivers/net/ethernet/ibm/emac/core.h -@@ -199,6 +199,10 @@ struct emac_instance { - struct emac_instance *mdio_instance; - struct mutex mdio_lock; - -+ /* Device-tree based phy configuration */ -+ struct mii_bus *mii_bus; -+ struct phy_device *phy_dev; -+ - /* ZMII infos if any */ - u32 zmii_ph; - u32 zmii_port; diff --git a/target/linux/apm821xx/patches-4.9/703-net-emac-fix-reset-timeout-with-AR8035-phy.patch b/target/linux/apm821xx/patches-4.9/703-net-emac-fix-reset-timeout-with-AR8035-phy.patch deleted file mode 100644 index 8acde84ec0..0000000000 --- a/target/linux/apm821xx/patches-4.9/703-net-emac-fix-reset-timeout-with-AR8035-phy.patch +++ /dev/null @@ -1,112 +0,0 @@ -From b2e79053e7456a961249c8865214a1e95b49c863 Mon Sep 17 00:00:00 2001 -From: Christian Lamparter -Date: Sat, 3 Jun 2017 18:16:19 +0200 -Subject: [PATCH] net: emac: fix reset timeout with AR8035 phy - -This patch fixes a problem where the AR8035 PHY can't be -detected on an Cisco Meraki MR24, if the ethernet cable is -not connected on boot. - -Russell Senior provided steps to reproduce the issue: -|Disconnect ethernet cable, apply power, wait until device has booted, -|plug in ethernet, check for interfaces, no eth0 is listed. -| -|This appears to be a problem during probing of the AR8035 Phy chip. -|When ethernet has no link, the phy detection fails, and eth0 is not -|created. Plugging ethernet later has no effect, because there is no -|interface as far as the kernel is concerned. The relevant part of -|the boot log looks like this: -|this is the failing case: -| -|[ 0.876611] /plb/opb/emac-rgmii@ef601500: input 0 in RGMII mode -|[ 0.882532] /plb/opb/ethernet@ef600c00: reset timeout -|[ 0.888546] /plb/opb/ethernet@ef600c00: can't find PHY! -|and the succeeding case: -| -|[ 0.876672] /plb/opb/emac-rgmii@ef601500: input 0 in RGMII mode -|[ 0.883952] eth0: EMAC-0 /plb/opb/ethernet@ef600c00, MAC 00:01:.. -|[ 0.890822] eth0: found Atheros 8035 Gigabit Ethernet PHY (0x01) - -Based on the comment and the commit message of -commit 23fbb5a87c56 ("emac: Fix EMAC soft reset on 460EX/GT"). -This is because the AR8035 PHY doesn't provide the TX Clock, -if the ethernet cable is not attached. This causes the reset -to timeout and the PHY detection code in emac_init_phy() is -unable to detect the AR8035 PHY. As a result, the emac driver -bails out early and the user left with no ethernet. - -In order to stay compatible with existing configurations, the driver -tries the current reset approach at first. Only if the first attempt -timed out, it does perform one more retry with the clock input -temporarily switched to the internal clock source for just the -duration of the reset. - -LEDE-Bug: #687 - -Cc: Chris Blake -Reported-by: Russell Senior -Fixes: 23fbb5a87c56e98 ("emac: Fix EMAC soft reset on 460EX/GT") -Reviewed-by: Andrew Lunn -Signed-off-by: Christian Lamparter ---- - drivers/net/ethernet/ibm/emac/core.c | 26 ++++++++++++++++++++++---- - 1 file changed, 22 insertions(+), 4 deletions(-) - ---- a/drivers/net/ethernet/ibm/emac/core.c -+++ b/drivers/net/ethernet/ibm/emac/core.c -@@ -352,6 +352,7 @@ static int emac_reset(struct emac_instan - { - struct emac_regs __iomem *p = dev->emacp; - int n = 20; -+ bool __maybe_unused try_internal_clock = false; - - DBG(dev, "reset" NL); - -@@ -364,6 +365,7 @@ static int emac_reset(struct emac_instan - } - - #ifdef CONFIG_PPC_DCR_NATIVE -+do_retry: - /* - * PPC460EX/GT Embedded Processor Advanced User's Manual - * section 28.10.1 Mode Register 0 (EMACx_MR0) states: -@@ -371,10 +373,19 @@ static int emac_reset(struct emac_instan - * of the EMAC. If none is present, select the internal clock - * (SDR0_ETH_CFG[EMACx_PHY_CLK] = 1). - * After a soft reset, select the external clock. -+ * -+ * The AR8035-A PHY Meraki MR24 does not provide a TX Clk if the -+ * ethernet cable is not attached. This causes the reset to timeout -+ * and the PHY detection code in emac_init_phy() is unable to -+ * communicate and detect the AR8035-A PHY. As a result, the emac -+ * driver bails out early and the user has no ethernet. -+ * In order to stay compatible with existing configurations, the -+ * driver will temporarily switch to the internal clock, after -+ * the first reset fails. - */ - if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) { -- if (dev->phy_address == 0xffffffff && -- dev->phy_map == 0xffffffff) { -+ if (try_internal_clock || (dev->phy_address == 0xffffffff && -+ dev->phy_map == 0xffffffff)) { - /* No PHY: select internal loop clock before reset */ - dcri_clrset(SDR0, SDR0_ETH_CFG, - 0, SDR0_ETH_CFG_ECS << dev->cell_index); -@@ -392,8 +403,15 @@ static int emac_reset(struct emac_instan - - #ifdef CONFIG_PPC_DCR_NATIVE - if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) { -- if (dev->phy_address == 0xffffffff && -- dev->phy_map == 0xffffffff) { -+ if (!n && !try_internal_clock) { -+ /* first attempt has timed out. */ -+ n = 20; -+ try_internal_clock = true; -+ goto do_retry; -+ } -+ -+ if (try_internal_clock || (dev->phy_address == 0xffffffff && -+ dev->phy_map == 0xffffffff)) { - /* No PHY: restore external clock source after reset */ - dcri_clrset(SDR0, SDR0_ETH_CFG, - SDR0_ETH_CFG_ECS << dev->cell_index, 0); diff --git a/target/linux/apm821xx/patches-4.9/804-usb-dwc2-add-amcc-usb-otg-405ex.patch b/target/linux/apm821xx/patches-4.9/804-usb-dwc2-add-amcc-usb-otg-405ex.patch deleted file mode 100644 index 3dd2ed5734..0000000000 --- a/target/linux/apm821xx/patches-4.9/804-usb-dwc2-add-amcc-usb-otg-405ex.patch +++ /dev/null @@ -1,48 +0,0 @@ ---- a/drivers/usb/dwc2/platform.c -+++ b/drivers/usb/dwc2/platform.c -@@ -279,6 +279,37 @@ static int dwc2_get_dr_mode(struct dwc2_ - return 0; - } - -+static const struct dwc2_core_params params_amcc_dwc_otg = { -+ .otg_cap = DWC2_CAP_PARAM_HNP_SRP_CAPABLE, -+ .otg_ver = -1, -+ .dma_enable = -1, -+ .dma_desc_enable = -1, -+ .speed = -1, -+ .enable_dynamic_fifo = -1, -+ .en_multiple_tx_fifo = -1, -+ .host_rx_fifo_size = -1, -+ .host_nperio_tx_fifo_size = -1, -+ .host_perio_tx_fifo_size = -1, -+ .max_transfer_size = -1, -+ .max_packet_count = -1, -+ .host_channels = -1, -+ .phy_type = -1, -+ .phy_utmi_width = -1, -+ .phy_ulpi_ddr = -1, -+ .phy_ulpi_ext_vbus = -1, -+ .i2c_enable = -1, -+ .ulpi_fs_ls = -1, -+ .host_support_fs_ls_low_power = -1, -+ .host_ls_low_power_phy_clk = -1, -+ .ts_dline = -1, -+ .reload_ctl = -1, -+ .ahbcfg = GAHBCFG_HBSTLEN_INCR16 << -+ GAHBCFG_HBSTLEN_SHIFT, -+ .uframe_sched = -1, -+ .external_id_pin_ctl = -1, -+ .hibernation = -1, -+}; -+ - static int __dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg) - { - struct platform_device *pdev = to_platform_device(hsotg->dev); -@@ -511,6 +542,7 @@ static void dwc2_driver_shutdown(struct - } - - static const struct of_device_id dwc2_of_match_table[] = { -+ { .compatible = "amcc,usb-otg-405ex", .data = ¶ms_amcc_dwc_otg }, - { .compatible = "brcm,bcm2835-usb", .data = ¶ms_bcm2835 }, - { .compatible = "hisilicon,hi6220-usb", .data = ¶ms_hi6220 }, - { .compatible = "rockchip,rk3066-usb", .data = ¶ms_rk3066 }, diff --git a/target/linux/apm821xx/patches-4.9/901-hwmon-add-driver-for-Microchip-TC654-TC655-PWM-fan-c.patch b/target/linux/apm821xx/patches-4.9/901-hwmon-add-driver-for-Microchip-TC654-TC655-PWM-fan-c.patch deleted file mode 100644 index ceacde9dda..0000000000 --- a/target/linux/apm821xx/patches-4.9/901-hwmon-add-driver-for-Microchip-TC654-TC655-PWM-fan-c.patch +++ /dev/null @@ -1,1027 +0,0 @@ -From 5ea2e152d846bf60901107fefd81a58f792f3bc2 Mon Sep 17 00:00:00 2001 -From: Christian Lamparter -Date: Fri, 10 Jun 2016 03:00:46 +0200 -Subject: [PATCH] hwmon: add driver for Microchip TC654/TC655 PWM fan - controllers - -This patch adds a hwmon driver for the Microchip TC654 and TC655 -Dual SMBus PWM Fan Speed Controllers with Fan Fault detection. - -The chip is described in the DS2001734C Spec Document from Microchip. -It supports: - - Shared PWM Fan Drive for two fans - - Provides RPM - - automatic PWM controller (needs additional - NTC/PTC Thermistors.) - - Overtemperature alarm (when using NTC/PTC - Thermistors) - -Signed-off-by: Christian Lamparter ---- - drivers/hwmon/Kconfig | 10 + - drivers/hwmon/Makefile | 1 + - drivers/hwmon/tc654.c | 969 +++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 980 insertions(+) - create mode 100644 drivers/hwmon/tc654.c - ---- a/drivers/hwmon/Kconfig -+++ b/drivers/hwmon/Kconfig -@@ -1549,6 +1549,16 @@ config SENSORS_INA3221 - This driver can also be built as a module. If so, the module - will be called ina3221. - -+config SENSORS_TC654 -+ tristate "Microchip TC654 and TC655" -+ depends on I2C -+ help -+ If you say yes here you get support for Microchip TC655 and TC654 -+ Dual PWM Fan Speed Controllers and sensor chips. -+ -+ This driver can also be built as a module. If so, the module -+ will be called tc654. -+ - config SENSORS_TC74 - tristate "Microchip TC74" - depends on I2C ---- a/drivers/hwmon/Makefile -+++ b/drivers/hwmon/Makefile -@@ -148,6 +148,7 @@ obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc4 - obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o - obj-$(CONFIG_SENSORS_SMSC47M192)+= smsc47m192.o - obj-$(CONFIG_SENSORS_AMC6821) += amc6821.o -+obj-$(CONFIG_SENSORS_TC654) += tc654.o - obj-$(CONFIG_SENSORS_TC74) += tc74.o - obj-$(CONFIG_SENSORS_THMC50) += thmc50.o - obj-$(CONFIG_SENSORS_TMP102) += tmp102.o ---- /dev/null -+++ b/drivers/hwmon/tc654.c -@@ -0,0 +1,969 @@ -+/* -+ * tc654.c - Support for Microchip TC654/TC655 -+ * "A Dual SMBus PWM FAN Speed Controllers with Fan Fault Detection" -+ * -+ * Copyright (c) 2016 Christian Lamparter -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation version 2 of the License. -+ * -+ * 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. -+ * -+ * The chip is described in the DS2001734C Spec Document from Microchip. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* Hardware definitions */ -+/* 5.1.4 Address Byte stats that TC654/TC655 are fixed at 0x1b */ -+static const unsigned short normal_i2c[] = { 0x1b, I2C_CLIENT_END }; -+ -+enum TC654_REGS { -+ TC654_REG_RPM1 = 0x00, -+ TC654_REG_RPM2, -+ TC654_REG_FAN1_FAULT_THRESH, -+ TC654_REG_FAN2_FAULT_THRESH, -+ TC654_REG_CONFIG, -+ TC654_REG_STATUS, -+ TC654_REG_DUTY_CYCLE, -+ TC654_REG_MFR_ID, -+ TC654_REG_VER_ID, -+ -+ /* keep last */ -+ __TC654_REG_NUM, -+}; -+ -+#define TC654_MFR_ID_MICROCHIP 0x84 -+#define TC654_VER_ID 0x00 -+#define TC655_VER_ID 0x01 -+ -+enum TC654_CONTROL_BITS { -+ TC654_CTRL_SDM = BIT(0), -+ TC654_CTRL_F1PPR_S = 1, -+ TC654_CTRL_F1PPR_M = (BIT(1) | BIT(2)), -+ TC654_CTRL_F2PPR_S = 3, -+ TC654_CTRL_F2PPR_M = (BIT(3) | BIT(4)), -+ TC654_CTRL_DUTYC = BIT(5), -+ TC654_CTRL_RES = BIT(6), -+ TC654_CTRL_FFCLR = BIT(7), -+}; -+ -+enum TC654_STATUS_BITS { -+ TC654_STATUS_F1F = BIT(0), -+ TC654_STATUS_F2F = BIT(1), -+ TC654_STATUS_VSTAT = BIT(2), -+ TC654_STATUS_R1CO = BIT(3), -+ TC654_STATUS_R2CO = BIT(4), -+ TC654_STATUS_OTF = BIT(5), -+}; -+ -+enum TC654_FAN { -+ TC654_FAN1 = 0, -+ TC654_FAN2, -+ -+ /* keep last */ -+ __NUM_TC654_FAN, -+}; -+ -+enum TC654_FAN_MODE { -+ TC654_PWM_OFF, /* Shutdown Mode - switch of both fans */ -+ TC654_PWM_VIN, /* Fans will be controlled via V_in analog input pin */ -+ TC654_PWM_3000, /* sets fans to 30% duty cycle */ -+ TC654_PWM_3467, -+ TC654_PWM_3933, /* default case - if V_in pin is open */ -+ TC654_PWM_4400, -+ TC654_PWM_4867, -+ TC654_PWM_5333, -+ TC654_PWM_5800, -+ TC654_PWM_6267, -+ TC654_PWM_6733, -+ TC654_PWM_7200, -+ TC654_PWM_7667, -+ TC654_PWM_8133, -+ TC654_PWM_8600, -+ TC654_PWM_9067, -+ TC654_PWM_9533, -+ TC654_PWM_10000, /* sets fans to 100% duty cycle */ -+}; -+ -+enum TC654_ALARMS { -+ TC654_ALARM_FAN1_FAULT, -+ TC654_ALARM_FAN2_FAULT, -+ TC654_ALARM_FAN1_COUNTER_OVERFLOW, -+ TC654_ALARM_FAN2_COUNTER_OVERFLOW, -+ TC654_ALARM_OVER_TEMPERATURE, -+ -+ /* KEEP LAST */ -+ __NUM_TC654_ALARMS, -+}; -+ -+static const struct pwm_table_entry { -+ u8 min; -+ enum TC654_FAN_MODE mode; -+} pwm_table[] = { -+ { 0, TC654_PWM_OFF }, -+ { 1, TC654_PWM_3000 }, -+ { 88, TC654_PWM_3467 }, -+ {101, TC654_PWM_3933 }, -+ {113, TC654_PWM_4400 }, -+ {125, TC654_PWM_4867 }, -+ {137, TC654_PWM_5333 }, -+ {148, TC654_PWM_5800 }, -+ {160, TC654_PWM_6267 }, -+ {172, TC654_PWM_6733 }, -+ {184, TC654_PWM_7200 }, -+ {196, TC654_PWM_7667 }, -+ {208, TC654_PWM_8133 }, -+ {220, TC654_PWM_8600 }, -+ {232, TC654_PWM_9067 }, -+ {244, TC654_PWM_9533 }, -+ {255, TC654_PWM_10000 }, -+}; -+ -+/* driver context */ -+struct tc654 { -+ struct i2c_client *client; -+ -+ struct mutex update_lock; -+ -+ unsigned long last_updated; /* in jiffies */ -+ u8 cached_regs[__TC654_REG_NUM]; -+ -+ bool valid; /* monitored registers are valid */ -+ u16 fan_input[__NUM_TC654_FAN]; -+ bool alarms[__NUM_TC654_ALARMS]; -+ bool vin_status; -+ bool pwm_manual; -+ -+ /* optional cooling device */ -+ struct thermal_cooling_device *cdev; -+}; -+ -+/* hardware accessors and functions */ -+static int read_tc(struct tc654 *tc, u8 reg) -+{ -+ s32 status; -+ -+ if (reg <= TC654_REG_VER_ID) { -+ /* Table 6.1 states that all registers are readable */ -+ status = i2c_smbus_read_byte_data(tc->client, reg); -+ } else -+ status = -EINVAL; -+ -+ if (status < 0) { -+ dev_warn(&tc->client->dev, "can't read register 0x%02x due to error (%d)", -+ reg, status); -+ } else { -+ tc->cached_regs[reg] = status; -+ } -+ -+ return status; -+} -+ -+static int write_tc(struct tc654 *tc, u8 i2c_reg, u8 val) -+{ -+ s32 status; -+ -+ /* -+ * Table 6.1 states that both fan threshold registers, -+ * the Config and Duty Cycle are writeable. -+ */ -+ switch (i2c_reg) { -+ case TC654_REG_FAN1_FAULT_THRESH: -+ case TC654_REG_FAN2_FAULT_THRESH: -+ case TC654_REG_DUTY_CYCLE: -+ case TC654_REG_CONFIG: -+ status = i2c_smbus_write_byte_data(tc->client, i2c_reg, val); -+ break; -+ -+ default: -+ return -EINVAL; -+ } -+ -+ if (status < 0) { -+ dev_warn(&tc->client->dev, "can't write register 0x%02x with value 0x%02x due to error (%d)", -+ i2c_reg, val, status); -+ } else { -+ tc->cached_regs[i2c_reg] = val; -+ } -+ -+ return status; -+} -+ -+static int mod_config(struct tc654 *tc, u8 set, u8 clear) -+{ -+ u8 val = 0; -+ -+ /* a bit can't be set and cleared on the same time. */ -+ if (set & clear) -+ return -EINVAL; -+ -+ /* invalidate data to force re-read from hardware */ -+ tc->valid = false; -+ val = (tc->cached_regs[TC654_REG_CONFIG] | set) & (~clear); -+ return write_tc(tc, TC654_REG_CONFIG, val); -+} -+ -+static int read_fan_rpm(struct tc654 *tc, enum TC654_FAN fan) -+{ -+ int ret; -+ -+ /* 6.1 RPM-OUTPUT1 and RPM-OUTPUT2 registers */ -+ ret = read_tc(tc, fan == TC654_FAN1 ? TC654_REG_RPM1 : TC654_REG_RPM2); -+ if (ret < 0) -+ return ret; -+ -+ /* -+ * The Resolution Selection Bit in 6.3 CONFIGURATION REGISTER -+ * is needed to convert the raw value to the RPM. -+ * 0 = RPM1 and RPM2 use (8-Bit) resolution => * 50 RPM -+ * 1 = RPM1 and RPM2 use (9-Bit) resolution => * 25 RPM -+ */ -+ return ret * (25 << -+ !(tc->cached_regs[TC654_REG_CONFIG] & TC654_CTRL_RES)); -+} -+ -+static int write_fan_fault_thresh(struct tc654 *tc, enum TC654_FAN fan, -+ u16 rpm) -+{ -+ u8 converted_rpm; -+ -+ if (rpm > 12750) -+ return -EINVAL; -+ -+ /* -+ * 6.2 FAN_FAULT1 and FAN_FAULT2 Threshold registers -+ * -+ * Both registers operate in 50 RPM mode exclusively. -+ */ -+ converted_rpm = rpm / 50; -+ -+ /* invalidate data to force re-read from hardware */ -+ tc->valid = false; -+ return write_tc(tc, fan == TC654_FAN1 ? TC654_REG_FAN1_FAULT_THRESH : -+ TC654_REG_FAN2_FAULT_THRESH, converted_rpm); -+} -+ -+ -+static int read_fan_fault_thresh(struct tc654 *tc, enum TC654_FAN fan) -+{ -+ /* -+ * 6.2 FAN_FAULT1 and FAN_FAULT2 Threshold registers -+ * -+ * Both registers operate in 50 RPM mode exclusively. -+ */ -+ return read_tc(tc, fan == TC654_FAN1 ? TC654_REG_FAN1_FAULT_THRESH : -+ TC654_REG_FAN2_FAULT_THRESH) * 50; -+} -+ -+static enum TC654_FAN_MODE get_fan_mode(struct tc654 *tc) -+{ -+ if (tc->cached_regs[TC654_REG_CONFIG] & TC654_CTRL_SDM) { -+ return TC654_PWM_OFF; -+ } else if (tc->cached_regs[TC654_REG_CONFIG] & TC654_CTRL_DUTYC) { -+ return TC654_PWM_3000 + tc->cached_regs[TC654_REG_DUTY_CYCLE]; -+ } else if (tc->vin_status == 0) -+ return TC654_PWM_VIN; -+ -+ return -EINVAL; -+} -+ -+static int write_fan_mode(struct tc654 *tc, enum TC654_FAN_MODE mode) -+{ -+ int err; -+ u8 pwm_mode; -+ bool in_sdm; -+ -+ in_sdm = !!(tc->cached_regs[TC654_REG_CONFIG] & -+ TC654_CTRL_SDM); -+ -+ switch (mode) { -+ case TC654_PWM_OFF: -+ if (in_sdm) -+ return 0; -+ -+ /* Enter Shutdown Mode - Switches off all fans */ -+ err = mod_config(tc, TC654_CTRL_SDM, TC654_CTRL_DUTYC); -+ if (err) -+ return err; -+ -+ return 0; -+ -+ case TC654_PWM_VIN: -+ if (tc->vin_status) { -+ dev_err(&tc->client->dev, -+ "V_in pin is open, can't enable automatic mode."); -+ return -EINVAL; -+ } -+ -+ err = mod_config(tc, 0, TC654_CTRL_SDM | TC654_CTRL_DUTYC); -+ if (err) -+ return err; -+ -+ tc->pwm_manual = false; -+ return 0; -+ -+ case TC654_PWM_3000: -+ case TC654_PWM_3467: -+ case TC654_PWM_3933: -+ case TC654_PWM_4400: -+ case TC654_PWM_4867: -+ case TC654_PWM_5333: -+ case TC654_PWM_5800: -+ case TC654_PWM_6267: -+ case TC654_PWM_6733: -+ case TC654_PWM_7200: -+ case TC654_PWM_7667: -+ case TC654_PWM_8133: -+ case TC654_PWM_8600: -+ case TC654_PWM_9067: -+ case TC654_PWM_9533: -+ case TC654_PWM_10000: -+ pwm_mode = mode - TC654_PWM_3000; -+ if (!in_sdm) { -+ err = write_tc(tc, TC654_REG_DUTY_CYCLE, pwm_mode); -+ if (err) -+ return err; -+ } -+ -+ err = mod_config(tc, TC654_CTRL_DUTYC, TC654_CTRL_SDM); -+ if (err) -+ return err; -+ -+ tc->pwm_manual = true; -+ -+ if (in_sdm) { -+ /* -+ * In case the TC654/TC655 was in SDM mode, the write -+ * above into the TC654_REG_DUTY_CYCLE register will -+ * have no effect because the chip was switched off. -+ * -+ * Note: The TC654/TC655 have a special "power-on" -+ * feature where the PWM will be forced to 100% for -+ * one full second in order to spin-up a resting fan. -+ */ -+ err = write_tc(tc, TC654_REG_DUTY_CYCLE, pwm_mode); -+ if (err) -+ return err; -+ } -+ -+ return 0; -+ -+ default: -+ return -EINVAL; -+ } -+} -+ -+static struct tc654 *tc654_update_device(struct device *dev) -+{ -+ struct tc654 *tc = dev_get_drvdata(dev); -+ -+ mutex_lock(&tc->update_lock); -+ -+ /* -+ * In Chapter "1.0 Electrical Characteristics", -+ * the "Fault Output Response Time" is specified as 2.4 seconds. -+ */ -+ if (time_after(jiffies, tc->last_updated + 2 * HZ + (HZ * 2) / 5) -+ || !tc->valid) { -+ size_t i; -+ int ret; -+ bool alarm_triggered; -+ -+ tc->valid = false; -+ -+ for (i = 0; i < __NUM_TC654_FAN; i++) { -+ ret = read_fan_rpm(tc, i); -+ if (ret < 0) -+ goto out; -+ -+ tc->fan_input[i] = ret; -+ } -+ -+ ret = read_tc(tc, TC654_REG_STATUS); -+ if (ret < 0) -+ goto out; -+ -+ alarm_triggered = !!(ret & (TC654_STATUS_F1F | -+ TC654_STATUS_F2F | TC654_STATUS_R1CO | -+ TC654_STATUS_R2CO | TC654_STATUS_OTF)); -+ -+ tc->alarms[TC654_ALARM_FAN1_FAULT] = !!(ret & TC654_STATUS_F1F); -+ tc->alarms[TC654_ALARM_FAN2_FAULT] = !!(ret & TC654_STATUS_F2F); -+ tc->alarms[TC654_ALARM_FAN1_COUNTER_OVERFLOW] = -+ !!(ret & TC654_STATUS_R1CO); -+ tc->alarms[TC654_ALARM_FAN2_COUNTER_OVERFLOW] = -+ !!(ret & TC654_STATUS_R2CO); -+ tc->alarms[TC654_ALARM_OVER_TEMPERATURE] = -+ !!(ret & TC654_STATUS_OTF); -+ tc->vin_status = !!(ret & TC654_STATUS_VSTAT); -+ -+ /* -+ * From 4.5 and 6.3 -+ * -+ * ... "If the V_in pin is open when TC654_CTRL_DUTYC is not -+ * selected, then V_out duty cycle will default to 39.33%.". -+ * -+ * and most importantly 6.5: -+ * ... "V_in pin is open, the duty cycle will go to the default -+ * setting of this register, which is 0010 (39.33%)." -+ */ -+ tc->pwm_manual |= tc->vin_status && -+ (tc->cached_regs[TC654_REG_CONFIG] & -+ TC654_CTRL_DUTYC); -+ -+ if (alarm_triggered) { -+ /* -+ * as the name implies, this FLAG needs to be -+ * set in order to clear the FAN Fault error. -+ */ -+ ret = mod_config(tc, TC654_CTRL_FFCLR, 0); -+ if (ret < 0) -+ goto out; -+ } -+ -+ tc->last_updated = jiffies; -+ tc->valid = true; -+ } -+ -+out: -+ mutex_unlock(&tc->update_lock); -+ return tc; -+} -+ -+static u8 get_fan_pulse(struct tc654 *tc, enum TC654_FAN fan) -+{ -+ u8 fan_pulse_mask = fan == TC654_FAN1 ? -+ TC654_CTRL_F1PPR_M : TC654_CTRL_F2PPR_M; -+ u8 fan_pulse_shift = fan == TC654_FAN1 ? -+ TC654_CTRL_F1PPR_S : TC654_CTRL_F2PPR_S; -+ -+ return 1 << ((tc->cached_regs[TC654_REG_CONFIG] & fan_pulse_mask) >> -+ fan_pulse_shift); -+} -+ -+static int -+set_fan_pulse(struct tc654 *tc, enum TC654_FAN fan, int pulses) -+{ -+ int old_pulses; -+ int err; -+ u8 new_pulse_per_rotation; -+ u8 fan_pulse_mask = fan == TC654_FAN1 ? -+ TC654_CTRL_F1PPR_M : TC654_CTRL_F2PPR_M; -+ u8 fan_pulse_shift = fan == TC654_FAN1 ? -+ TC654_CTRL_F1PPR_S : TC654_CTRL_F2PPR_S; -+ -+ switch (pulses) { -+ case 1: -+ new_pulse_per_rotation = 0; -+ break; -+ case 2: -+ new_pulse_per_rotation = 1; -+ break; -+ case 4: -+ new_pulse_per_rotation = 2; -+ break; -+ case 8: -+ new_pulse_per_rotation = 3; -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+ new_pulse_per_rotation <<= fan_pulse_shift; -+ new_pulse_per_rotation &= fan_pulse_mask; -+ -+ old_pulses = tc->cached_regs[TC654_REG_CONFIG]; -+ old_pulses &= fan_pulse_mask; -+ -+ if (new_pulse_per_rotation == old_pulses) -+ return 0; -+ -+ mutex_lock(&tc->update_lock); -+ err = mod_config(tc, new_pulse_per_rotation, -+ old_pulses & (~new_pulse_per_rotation)); -+ mutex_unlock(&tc->update_lock); -+ -+ /* invalidate RPM data to force re-read from hardware */ -+ tc->valid = false; -+ -+ return err; -+} -+ -+static int get_fan_speed(struct tc654 *tc) -+{ -+ enum TC654_FAN_MODE mode; -+ size_t i; -+ -+ mode = get_fan_mode(tc); -+ for (i = 0; i < ARRAY_SIZE(pwm_table); i++) { -+ if (mode == pwm_table[i].mode) -+ return pwm_table[i].min; -+ } -+ -+ return -EINVAL; -+} -+ -+static int set_fan_speed(struct tc654 *tc, int new_value) -+{ -+ int result; -+ size_t i; -+ -+ if (new_value > pwm_table[ARRAY_SIZE(pwm_table) - 1].min || -+ new_value < pwm_table[0].min) -+ return -EINVAL; -+ -+ for (i = 0; i < ARRAY_SIZE(pwm_table); i++) { -+ /* exact match */ -+ if (pwm_table[i].min == new_value) -+ break; -+ -+ /* a little bit too big - go with the previous entry */ -+ if (pwm_table[i].min > new_value) { -+ --i; -+ break; -+ } -+ } -+ -+ mutex_lock(&tc->update_lock); -+ result = write_fan_mode(tc, pwm_table[i].mode); -+ mutex_unlock(&tc->update_lock); -+ if (result < 0) -+ return result; -+ -+ return 0; -+} -+ -+/* sysfs */ -+ -+static ssize_t -+show_fan_input(struct device *dev, struct device_attribute *da, char *buf) -+{ -+ struct tc654 *tc = tc654_update_device(dev); -+ int nr = to_sensor_dev_attr(da)->index; -+ -+ return sprintf(buf, "%d\n", tc->fan_input[nr]); -+} -+ -+static ssize_t -+show_fan_min(struct device *dev, struct device_attribute *da, char *buf) -+{ -+ struct tc654 *tc = dev_get_drvdata(dev); -+ int nr = to_sensor_dev_attr(da)->index; -+ -+ return sprintf(buf, "%d\n", read_fan_fault_thresh(tc, nr)); -+} -+ -+static ssize_t -+show_fan_min_alarm(struct device *dev, struct device_attribute *da, char *buf) -+{ -+ struct tc654 *tc = tc654_update_device(dev); -+ int nr = to_sensor_dev_attr(da)->index; -+ -+ return sprintf(buf, "%d\n", nr == TC654_FAN1 ? -+ tc->alarms[TC654_ALARM_FAN1_FAULT] : -+ tc->alarms[TC654_ALARM_FAN2_FAULT]); -+} -+ -+static ssize_t -+show_fan_max_alarm(struct device *dev, struct device_attribute *da, char *buf) -+{ -+ struct tc654 *tc = tc654_update_device(dev); -+ int nr = to_sensor_dev_attr(da)->index; -+ -+ return sprintf(buf, "%d\n", nr == TC654_FAN1 ? -+ tc->alarms[TC654_ALARM_FAN1_COUNTER_OVERFLOW] : -+ tc->alarms[TC654_ALARM_FAN2_COUNTER_OVERFLOW]); -+} -+ -+static ssize_t -+set_fan_min(struct device *dev, struct device_attribute *da, -+ const char *buf, size_t count) -+{ -+ struct tc654 *tc = dev_get_drvdata(dev); -+ long new_min; -+ int nr = to_sensor_dev_attr(da)->index; -+ int old_min = read_fan_fault_thresh(tc, nr); -+ int status = kstrtol(buf, 10, &new_min); -+ -+ if (status < 0) -+ return status; -+ -+ new_min = (new_min / 50) * 50; -+ if (new_min == old_min) /* No change */ -+ return count; -+ -+ if (new_min < 0 || new_min > 12750) -+ return -EINVAL; -+ -+ mutex_lock(&tc->update_lock); -+ status = write_fan_fault_thresh(tc, nr, new_min); -+ mutex_unlock(&tc->update_lock); -+ return count; -+} -+ -+static ssize_t -+show_fan_max(struct device *dev, struct device_attribute *da, char *buf) -+{ -+ struct tc654 *tc = dev_get_drvdata(dev); -+ int max_rpm = tc->cached_regs[TC654_REG_CONFIG] & TC654_CTRL_RES ? -+ (((1 << 9) - 1) * 25) /* ((2**9) - 1) * 25 RPM */: -+ (((1 << 8) - 1) * 50) /* ((2**8) - 1) * 50 RPM */; -+ -+ return sprintf(buf, "%d\n", max_rpm); -+} -+ -+static ssize_t -+show_fan_fault(struct device *dev, struct device_attribute *da, char *buf) -+{ -+ struct tc654 *tc = tc654_update_device(dev); -+ int nr = to_sensor_dev_attr(da)->index; -+ u8 fan_fault_mask = nr == TC654_FAN1 ? -+ TC654_STATUS_F1F : TC654_STATUS_F2F; -+ -+ return sprintf(buf, "%d\n", -+ !!(tc->cached_regs[TC654_REG_STATUS] & fan_fault_mask)); -+} -+ -+static ssize_t -+show_fan_pulses(struct device *dev, struct device_attribute *da, char *buf) -+{ -+ struct tc654 *tc = dev_get_drvdata(dev); -+ int nr = to_sensor_dev_attr(da)->index; -+ -+ return sprintf(buf, "%d\n", get_fan_pulse(tc, nr)); -+} -+ -+static ssize_t -+set_fan_pulses(struct device *dev, struct device_attribute *da, -+ const char *buf, size_t count) -+{ -+ struct tc654 *tc = dev_get_drvdata(dev); -+ long new_pulse; -+ int nr = to_sensor_dev_attr(da)->index; -+ int status = kstrtol(buf, 10, &new_pulse); -+ -+ if (status < 0) -+ return status; -+ -+ status = set_fan_pulse(tc, nr, new_pulse); -+ if (status < 0) -+ return status; -+ -+ return count; -+} -+ -+static ssize_t -+show_pwm_enable(struct device *dev, struct device_attribute *da, char *buf) -+{ -+ struct tc654 *tc = tc654_update_device(dev); -+ int pwm_enabled; -+ -+ if ((tc->cached_regs[TC654_REG_CONFIG] & TC654_CTRL_SDM) && -+ !tc->pwm_manual) { -+ pwm_enabled = 0; /* full off */ -+ } else { -+ if (tc->valid && tc->vin_status == 0) -+ pwm_enabled = 2; /* automatic fan speed control */ -+ -+ pwm_enabled = 1; /* PWM Mode */ -+ } -+ -+ return sprintf(buf, "%d\n", pwm_enabled); -+} -+ -+static ssize_t -+set_pwm_enable(struct device *dev, struct device_attribute *da, -+ const char *buf, size_t count) -+{ -+ struct tc654 *tc = dev_get_drvdata(dev); -+ long new_value; -+ -+ int result = kstrtol(buf, 10, &new_value); -+ -+ if (result < 0) -+ return result; -+ -+ mutex_lock(&tc->update_lock); -+ switch (new_value) { -+ case 0: /* no fan control (i.e. is OFF) */ -+ result = write_fan_mode(tc, TC654_PWM_OFF); -+ tc->pwm_manual = false; -+ break; -+ -+ case 1: /* manual fan control enabled (using pwm) */ -+ result = write_fan_mode(tc, TC654_PWM_10000); -+ break; -+ -+ case 2: /* automatic fan speed control enabled */ -+ result = write_fan_mode(tc, TC654_PWM_VIN); -+ break; -+ -+ default: -+ result = -EINVAL; -+ } -+ -+ mutex_unlock(&tc->update_lock); -+ return result < 0 ? result : count; -+} -+ -+static ssize_t -+show_pwm(struct device *dev, struct device_attribute *da, char *buf) -+{ -+ struct tc654 *tc = tc654_update_device(dev); -+ int ret; -+ -+ ret = get_fan_speed(tc); -+ if (ret < 0) -+ return ret; -+ -+ return sprintf(buf, "%d\n", ret); -+} -+ -+static ssize_t -+set_pwm(struct device *dev, struct device_attribute *da, -+ const char *buf, size_t count) -+{ -+ struct tc654 *tc = dev_get_drvdata(dev); -+ long new_value = -1; -+ int result = kstrtol(buf, 10, &new_value); -+ -+ if (result < 0) -+ return result; -+ -+ if (new_value < 0 || new_value > INT_MAX) -+ return -EINVAL; -+ -+ if (!tc->pwm_manual) -+ return -EINVAL; -+ -+ result = set_fan_speed(tc, new_value); -+ if (result < 0) -+ return result; -+ -+ return count; -+} -+ -+static ssize_t -+show_temp_alarm_otf(struct device *dev, struct device_attribute *da, char *buf) -+{ -+ struct tc654 *tc = tc654_update_device(dev); -+ -+ return sprintf(buf, "%d\n", tc->alarms[TC654_ALARM_OVER_TEMPERATURE]); -+} -+ -+static SENSOR_DEVICE_ATTR(fan1_input, S_IRUGO, show_fan_input, -+ NULL, TC654_FAN1); -+static SENSOR_DEVICE_ATTR(fan1_min, S_IRUGO | S_IWUSR, show_fan_min, -+ set_fan_min, TC654_FAN1); -+static SENSOR_DEVICE_ATTR(fan1_min_alarm, S_IRUGO, show_fan_min_alarm, -+ NULL, TC654_FAN1); -+static SENSOR_DEVICE_ATTR(fan1_max_alarm, S_IRUGO, show_fan_max_alarm, -+ NULL, TC654_FAN1); -+static SENSOR_DEVICE_ATTR(fan1_max, S_IRUGO, show_fan_max, NULL, TC654_FAN1); -+static SENSOR_DEVICE_ATTR(fan1_fault, S_IRUGO, show_fan_fault, -+ NULL, TC654_FAN1); -+static SENSOR_DEVICE_ATTR(fan1_pulses, S_IRUGO | S_IWUSR, show_fan_pulses, -+ set_fan_pulses, TC654_FAN1); -+static SENSOR_DEVICE_ATTR(fan2_input, S_IRUGO, show_fan_input, -+ NULL, TC654_FAN2); -+static SENSOR_DEVICE_ATTR(fan2_min, S_IRUGO | S_IWUSR, show_fan_min, -+ set_fan_min, TC654_FAN2); -+static SENSOR_DEVICE_ATTR(fan2_max, S_IRUGO, show_fan_max, -+ NULL, TC654_FAN2); -+static SENSOR_DEVICE_ATTR(fan2_min_alarm, S_IRUGO, show_fan_min_alarm, -+ NULL, TC654_FAN2); -+static SENSOR_DEVICE_ATTR(fan2_max_alarm, S_IRUGO, show_fan_max_alarm, -+ NULL, TC654_FAN2); -+static SENSOR_DEVICE_ATTR(fan2_fault, S_IRUGO, show_fan_fault, -+ NULL, TC654_FAN2); -+static SENSOR_DEVICE_ATTR(fan2_pulses, S_IRUGO | S_IWUSR, show_fan_pulses, -+ set_fan_pulses, TC654_FAN2); -+ -+static DEVICE_ATTR(pwm1_enable, S_IRUGO | S_IWUSR, show_pwm_enable, -+ set_pwm_enable); -+static DEVICE_ATTR(pwm1, S_IRUGO | S_IWUSR, show_pwm, set_pwm); -+ -+static DEVICE_ATTR(temp1_emergency_alarm, S_IRUGO, show_temp_alarm_otf, NULL); -+ -+/* sensors present on all models */ -+static struct attribute *tc654_attrs[] = { -+ &sensor_dev_attr_fan1_input.dev_attr.attr, -+ &sensor_dev_attr_fan1_min.dev_attr.attr, -+ &sensor_dev_attr_fan1_max.dev_attr.attr, -+ &sensor_dev_attr_fan1_min_alarm.dev_attr.attr, -+ &sensor_dev_attr_fan1_max_alarm.dev_attr.attr, -+ &sensor_dev_attr_fan1_fault.dev_attr.attr, -+ &sensor_dev_attr_fan1_pulses.dev_attr.attr, -+ &sensor_dev_attr_fan2_input.dev_attr.attr, -+ &sensor_dev_attr_fan2_min.dev_attr.attr, -+ &sensor_dev_attr_fan2_max.dev_attr.attr, -+ &sensor_dev_attr_fan2_min_alarm.dev_attr.attr, -+ &sensor_dev_attr_fan2_max_alarm.dev_attr.attr, -+ &sensor_dev_attr_fan2_fault.dev_attr.attr, -+ &sensor_dev_attr_fan2_pulses.dev_attr.attr, -+ -+ &dev_attr_pwm1_enable.attr, -+ &dev_attr_pwm1.attr, -+ -+ &dev_attr_temp1_emergency_alarm.attr, -+ NULL -+}; -+ -+ATTRIBUTE_GROUPS(tc654); -+ -+/* cooling device */ -+ -+static int tc654_get_max_state(struct thermal_cooling_device *cdev, -+ unsigned long *state) -+{ -+ *state = 255; -+ return 0; -+} -+ -+static int tc654_get_cur_state(struct thermal_cooling_device *cdev, -+ unsigned long *state) -+{ -+ struct tc654 *tc = cdev->devdata; -+ int ret; -+ -+ if (!tc) -+ return -EINVAL; -+ -+ ret = get_fan_speed(tc); -+ if (ret < 0) -+ return ret; -+ -+ *state = ret; -+ return 0; -+} -+ -+static int tc654_set_cur_state(struct thermal_cooling_device *cdev, -+ unsigned long state) -+{ -+ struct tc654 *tc = cdev->devdata; -+ -+ if (!tc) -+ return -EINVAL; -+ -+ if (state > INT_MAX) -+ return -EINVAL; -+ -+ return set_fan_speed(tc, state); -+} -+ -+static const struct thermal_cooling_device_ops tc654_fan_cool_ops = { -+ .get_max_state = tc654_get_max_state, -+ .get_cur_state = tc654_get_cur_state, -+ .set_cur_state = tc654_set_cur_state, -+}; -+ -+ -+/* hardware probe and detection */ -+ -+static int -+tc654_probe(struct i2c_client *client, const struct i2c_device_id *id) -+{ -+ struct tc654 *tc; -+ struct device *hwmon_dev; -+ int ret, i; -+ -+ if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) -+ return -EIO; -+ -+ tc = devm_kzalloc(&client->dev, sizeof(*tc), GFP_KERNEL); -+ if (!tc) -+ return -ENOMEM; -+ -+ i2c_set_clientdata(client, tc); -+ tc->client = client; -+ mutex_init(&tc->update_lock); -+ -+ /* cache all 8 registers */ -+ for (i = 0; i < __TC654_REG_NUM; i++) { -+ ret = read_tc(tc, i); -+ if (ret < 0) -+ return ret; -+ } -+ -+ /* sysfs hooks */ -+ hwmon_dev = devm_hwmon_device_register_with_groups(&client->dev, -+ client->name, tc, -+ tc654_groups); -+ if (IS_ERR(hwmon_dev)) -+ return PTR_ERR(hwmon_dev); -+ -+#if IS_ENABLED(CONFIG_OF) -+ /* Optional cooling device register for Device tree platforms */ -+ tc->cdev = thermal_of_cooling_device_register(client->dev.of_node, -+ "tc654", tc, -+ &tc654_fan_cool_ops); -+#else /* CONFIG_OF */ -+ /* Optional cooling device register for non Device tree platforms */ -+ tc->cdev = thermal_cooling_device_register("tc654", tc, -+ &tc654_fan_cool_ops); -+#endif /* CONFIG_OF */ -+ -+ dev_info(&client->dev, "%s: sensor '%s'\n", -+ dev_name(hwmon_dev), client->name); -+ -+ return 0; -+} -+ -+static const struct i2c_device_id tc654_ids[] = { -+ { "tc654", 0, }, -+ { } -+}; -+MODULE_DEVICE_TABLE(i2c, tc654_ids); -+ -+/* Return 0 if detection is successful, -ENODEV otherwise */ -+static int -+tc654_detect(struct i2c_client *new_client, struct i2c_board_info *info) -+{ -+ struct i2c_adapter *adapter = new_client->adapter; -+ int manufacturer, product; -+ -+ if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) -+ return -ENODEV; -+ -+ manufacturer = i2c_smbus_read_byte_data(new_client, TC654_REG_MFR_ID); -+ if (manufacturer != TC654_MFR_ID_MICROCHIP) -+ return -ENODEV; -+ -+ product = i2c_smbus_read_byte_data(new_client, TC654_REG_VER_ID); -+ if (!((product == TC654_VER_ID) || (product == TC655_VER_ID))) -+ return -ENODEV; -+ -+ strlcpy(info->type, "tc654", I2C_NAME_SIZE); -+ return 0; -+} -+ -+static struct i2c_driver tc654_driver = { -+ .class = I2C_CLASS_HWMON, -+ .driver = { -+ .name = "tc654", -+ }, -+ .probe = tc654_probe, -+ .id_table = tc654_ids, -+ .detect = tc654_detect, -+ .address_list = normal_i2c, -+}; -+ -+module_i2c_driver(tc654_driver); -+ -+MODULE_AUTHOR("Christian Lamparter "); -+MODULE_DESCRIPTION("Microchip TC654/TC655 hwmon driver"); -+MODULE_LICENSE("GPL"); diff --git a/target/linux/apm821xx/sata/config-default b/target/linux/apm821xx/sata/config-default index b8342de049..7ca6bd4d3d 100644 --- a/target/linux/apm821xx/sata/config-default +++ b/target/linux/apm821xx/sata/config-default @@ -1,5 +1,6 @@ # CONFIG_IKAREM is not set CONFIG_APOLLO3G=y +CONFIG_BROADCOM_PHY=y CONFIG_EXT4_FS=y CONFIG_DMADEVICES=y CONFIG_DMA_ENGINE=y diff --git a/target/linux/ar7/config-3.18 b/target/linux/ar7/config-3.18 index 21c86db65f..a91d45e8d7 100644 --- a/target/linux/ar7/config-3.18 +++ b/target/linux/ar7/config-3.18 @@ -1,6 +1,5 @@ CONFIG_ADM6996_PHY=y CONFIG_AR7=y -CONFIG_AR7_GPIO=y CONFIG_AR7_TI=y # CONFIG_AR7_TYPE_AC49X is not set CONFIG_AR7_TYPE_TI=y diff --git a/target/linux/ar7/config-4.1 b/target/linux/ar7/config-4.9 similarity index 83% rename from target/linux/ar7/config-4.1 rename to target/linux/ar7/config-4.9 index 7463d5b751..95a5375bae 100644 --- a/target/linux/ar7/config-4.1 +++ b/target/linux/ar7/config-4.9 @@ -1,22 +1,21 @@ CONFIG_ADM6996_PHY=y CONFIG_AR7=y -CONFIG_AR7_GPIO=y CONFIG_AR7_TI=y # CONFIG_AR7_TYPE_AC49X is not set CONFIG_AR7_TYPE_TI=y CONFIG_AR7_WDT=y CONFIG_ARCH_BINFMT_ELF_STATE=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_ARCH_DISCARD_MEMBLOCK=y -CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y # CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set # CONFIG_ARCH_HAS_SG_CHAIN is not set -CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y -CONFIG_ARCH_REQUIRE_GPIOLIB=y +CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y CONFIG_BOOT_ELF32=y CONFIG_CEVT_R4K=y @@ -37,6 +36,8 @@ CONFIG_CPU_R4K_CACHE_TLB=y CONFIG_CPU_R4K_FPU=y CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_WORKQUEUE=y CONFIG_CSRC_R4K=y CONFIG_DMA_NONCOHERENT=y CONFIG_EARLY_PRINTK=y @@ -46,12 +47,14 @@ CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_CHIP=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_PCI_IOMAP=y CONFIG_GENERIC_SCHED_CLOCK=y CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GPIOLIB=y -CONFIG_GPIO_DEVRES=y +CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDWARE_WATCHPOINTS=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y @@ -63,7 +66,7 @@ CONFIG_HAVE_ARCH_KGDB=y CONFIG_HAVE_ARCH_SECCOMP_FILTER=y CONFIG_HAVE_ARCH_TRACEHOOK=y # CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_HAVE_BPF_JIT=y +CONFIG_HAVE_CBPF_JIT=y CONFIG_HAVE_CC_STACKPROTECTOR=y CONFIG_HAVE_CLK=y CONFIG_HAVE_CONTEXT_TRACKING=y @@ -71,7 +74,6 @@ CONFIG_HAVE_C_RECORDMCOUNT=y CONFIG_HAVE_DEBUG_KMEMLEAK=y CONFIG_HAVE_DEBUG_STACKOVERFLOW=y CONFIG_HAVE_DMA_API_DEBUG=y -CONFIG_HAVE_DMA_ATTRS=y CONFIG_HAVE_DMA_CONTIGUOUS=y CONFIG_HAVE_DYNAMIC_FTRACE=y CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y @@ -79,36 +81,36 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y CONFIG_HAVE_FUNCTION_TRACER=y CONFIG_HAVE_GENERIC_DMA_COHERENT=y CONFIG_HAVE_IDE=y +CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_KERNEL_BZIP2=y -CONFIG_HAVE_KERNEL_GZIP=y -CONFIG_HAVE_KERNEL_LZ4=y -CONFIG_HAVE_KERNEL_LZMA=y -CONFIG_HAVE_KERNEL_LZO=y -CONFIG_HAVE_KERNEL_XZ=y +CONFIG_HAVE_LATENCYTOP_SUPPORT=y CONFIG_HAVE_MEMBLOCK=y CONFIG_HAVE_MEMBLOCK_NODE_MAP=y CONFIG_HAVE_MOD_ARCH_SPECIFIC=y CONFIG_HAVE_NET_DSA=y CONFIG_HAVE_OPROFILE=y CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y CONFIG_HW_RANDOM=y CONFIG_HZ_PERIODIC=y CONFIG_INITRAMFS_SOURCE="" CONFIG_IP17XX_PHY=y -CONFIG_IRQ_CPU=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_MIPS_CPU=y CONFIG_IRQ_WORK=y CONFIG_KALLSYMS=y CONFIG_LEDS_GPIO=y CONFIG_LEDS_TRIGGER_HEARTBEAT=y -# CONFIG_LZ4_COMPRESS is not set -# CONFIG_LZ4_DECOMPRESS is not set CONFIG_MDIO_BOARDINFO=y CONFIG_MIPS=y +CONFIG_MIPS_ASID_BITS=8 +CONFIG_MIPS_ASID_SHIFT=0 +CONFIG_MIPS_CLOCK_VSYSCALL=y +# CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set +CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 # CONFIG_MIPS_MACHINE is not set @@ -120,18 +122,21 @@ CONFIG_MVSWITCH_PHY=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_PER_CPU_KM=y CONFIG_NO_EXCEPT_FILL=y +CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y # CONFIG_NO_IOPORT_MAP is not set -CONFIG_PAGEFLAGS_EXTENDED=y +# CONFIG_OF is not set +CONFIG_PCI_DRIVERS_LEGACY=y CONFIG_PERF_USE_VMALLOC=y CONFIG_PGTABLE_LEVELS=2 CONFIG_PHYLIB=y -# CONFIG_RCU_EXPEDITE_BOOT is not set # CONFIG_RCU_STALL_COMMON is not set -CONFIG_SCHED_HRTICK=y +# CONFIG_SCHED_INFO is not set # CONFIG_SCSI_DMA is not set +# CONFIG_SERIAL_8250_FSL is not set CONFIG_SRCU=y CONFIG_SWAP_IO_SPACE=y CONFIG_SWCONFIG=y +CONFIG_SWPHY=y CONFIG_SYSCTL_EXCEPTION_TRACE=y CONFIG_SYS_HAS_CPU_MIPS32_R1=y CONFIG_SYS_HAS_EARLY_PRINTK=y @@ -144,4 +149,3 @@ CONFIG_SYS_SUPPORTS_ZBOOT_UART16550=y CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_VLYNQ=y # CONFIG_VLYNQ_DEBUG is not set -CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/ar7/files/drivers/char/ar7_gpio.c b/target/linux/ar7/files/drivers/char/ar7_gpio.c deleted file mode 100644 index 71310fa751..0000000000 --- a/target/linux/ar7/files/drivers/char/ar7_gpio.c +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (C) 2007 Nicolas Thill - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define DRVNAME "ar7_gpio" -#define LONGNAME "TI AR7 GPIOs Driver" - -MODULE_AUTHOR("Nicolas Thill "); -MODULE_DESCRIPTION(LONGNAME); -MODULE_LICENSE("GPL"); - -static int ar7_gpio_major; - -static ssize_t ar7_gpio_write(struct file *file, const char __user *buf, - size_t len, loff_t *ppos) -{ - int pin = iminor(file->f_path.dentry->d_inode); - size_t i; - - for (i = 0; i < len; ++i) { - char c; - if (get_user(c, buf + i)) - return -EFAULT; - switch (c) { - case '0': - gpio_set_value(pin, 0); - break; - case '1': - gpio_set_value(pin, 1); - break; - case 'd': - case 'D': - ar7_gpio_disable(pin); - break; - case 'e': - case 'E': - ar7_gpio_enable(pin); - break; - case 'i': - case 'I': - case '<': - gpio_direction_input(pin); - break; - case 'o': - case 'O': - case '>': - gpio_direction_output(pin, 0); - break; - default: - return -EINVAL; - } - } - - return len; -} - -static ssize_t ar7_gpio_read(struct file *file, char __user *buf, - size_t len, loff_t *ppos) -{ - int pin = iminor(file->f_path.dentry->d_inode); - int value; - - value = gpio_get_value(pin); - if (put_user(value ? '1' : '0', buf)) - return -EFAULT; - - return 1; -} - -static int ar7_gpio_open(struct inode *inode, struct file *file) -{ - int m = iminor(inode); - - if (m >= (ar7_is_titan() ? TITAN_GPIO_MAX : AR7_GPIO_MAX)) - return -EINVAL; - - return nonseekable_open(inode, file); -} - -static int ar7_gpio_release(struct inode *inode, struct file *file) -{ - return 0; -} - -static const struct file_operations ar7_gpio_fops = { - .owner = THIS_MODULE, - .write = ar7_gpio_write, - .read = ar7_gpio_read, - .open = ar7_gpio_open, - .release = ar7_gpio_release, - .llseek = no_llseek, -}; - -static struct platform_device *ar7_gpio_device; - -static int __init ar7_gpio_char_init(void) -{ - int rc; - - ar7_gpio_device = platform_device_alloc(DRVNAME, -1); - if (!ar7_gpio_device) - return -ENOMEM; - - rc = platform_device_add(ar7_gpio_device); - if (rc < 0) - goto out_put; - - rc = register_chrdev(ar7_gpio_major, DRVNAME, &ar7_gpio_fops); - if (rc < 0) - goto out_put; - - ar7_gpio_major = rc; - - rc = 0; - - goto out; - -out_put: - platform_device_put(ar7_gpio_device); -out: - return rc; -} - -static void __exit ar7_gpio_char_exit(void) -{ - unregister_chrdev(ar7_gpio_major, DRVNAME); - platform_device_unregister(ar7_gpio_device); -} - -module_init(ar7_gpio_char_init); -module_exit(ar7_gpio_char_exit); diff --git a/target/linux/ar7/patches-3.18/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch b/target/linux/ar7/patches-3.18/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch new file mode 100644 index 0000000000..f6a8754864 --- /dev/null +++ b/target/linux/ar7/patches-3.18/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch @@ -0,0 +1,48 @@ +From ee6c9d41de084b2cefd90e5e0c9f30a35f6d3967 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 29 Oct 2017 15:50:42 +0100 +Subject: [PATCH RFC 3/3] MIPS: AR7: ensure the port type's FCR value is used + +Since commit aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt +trigger I/F of FIFO buffers"), the port's default FCR value isn't used +in serial8250_do_set_termios anymore, but copied over once in +serial8250_config_port and then modified as needed. + +Unfortunately, serial8250_config_port will never be called if the port +is shared between kernel and userspace, and the port's flag doesn't have +UPF_BOOT_AUTOCONF, which would trigger a serial8250_config_port as well. + +This causes garbled output from userspace: + +[ 5.220000] random: procd urandom read with 49 bits of entropy available +ers + [kee + +Fix this by forcing it to be configured on boot, resulting in the +expected output: + +[ 5.250000] random: procd urandom read with 50 bits of entropy available +Press the [f] key and hit [enter] to enter failsafe mode +Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level + +Fixes: aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt trigger I/F of FIFO buffers") +Signed-off-by: Jonas Gorski +--- +I'm not sure if this is just AR7's issue, or if this points to a general +issue for UARTs used as kernel console and login console with the "fixed" +commit. + + arch/mips/ar7/platform.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/ar7/platform.c ++++ b/arch/mips/ar7/platform.c +@@ -581,7 +581,7 @@ static int __init ar7_register_uarts(voi + uart_port.type = PORT_AR7; + uart_port.uartclk = clk_get_rate(bus_clk) / 2; + uart_port.iotype = UPIO_MEM32; +- uart_port.flags = UPF_FIXED_TYPE; ++ uart_port.flags = UPF_FIXED_TYPE | UPF_BOOT_AUTOCONF; + uart_port.regshift = 2; + + uart_port.line = 0; diff --git a/target/linux/ar7/patches-3.18/120-gpio_chrdev.patch b/target/linux/ar7/patches-3.18/120-gpio_chrdev.patch deleted file mode 100644 index beb0052ca1..0000000000 --- a/target/linux/ar7/patches-3.18/120-gpio_chrdev.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/drivers/char/Kconfig -+++ b/drivers/char/Kconfig -@@ -452,6 +452,15 @@ config MWAVE - To compile this driver as a module, choose M here: the - module will be called mwave. - -+config AR7_GPIO -+ tristate "TI AR7 GPIO Support" -+ depends on AR7 -+ help -+ Give userspace access to the GPIO pins on the Texas Instruments AR7 -+ processors. -+ -+ If compiled as a module, it will be called ar7_gpio. -+ - config SCx200_GPIO - tristate "NatSemi SCx200 GPIO Support" - depends on SCx200 ---- a/drivers/char/Makefile -+++ b/drivers/char/Makefile -@@ -42,6 +42,7 @@ obj-$(CONFIG_HW_RANDOM) += hw_random/ - obj-$(CONFIG_PPDEV) += ppdev.o - obj-$(CONFIG_NWBUTTON) += nwbutton.o - obj-$(CONFIG_NWFLASH) += nwflash.o -+obj-$(CONFIG_AR7_GPIO) += ar7_gpio.o - obj-$(CONFIG_SCx200_GPIO) += scx200_gpio.o - obj-$(CONFIG_PC8736x_GPIO) += pc8736x_gpio.o - obj-$(CONFIG_NSC_GPIO) += nsc_gpio.o diff --git a/target/linux/ar7/patches-3.18/500-serial_kludge.patch b/target/linux/ar7/patches-3.18/500-serial_kludge.patch deleted file mode 100644 index fc725309a8..0000000000 --- a/target/linux/ar7/patches-3.18/500-serial_kludge.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/drivers/tty/serial/8250/8250_core.c -+++ b/drivers/tty/serial/8250/8250_core.c -@@ -329,6 +329,13 @@ static const struct serial8250_config ua - .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, - .flags = UART_CAP_FIFO | UART_CAP_AFE, - }, -+ [PORT_AR7] = { -+ .name = "TI-AR7", -+ .fifo_size = 16, -+ .tx_loadsz = 16, -+ .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00, -+ .flags = UART_CAP_FIFO | UART_CAP_AFE, -+ }, - }; - - /* Uart divisor latch read */ -@@ -3168,7 +3175,11 @@ static void serial8250_console_putchar(s - { - struct uart_8250_port *up = up_to_u8250p(port); - -+#ifdef CONFIG_AR7 -+ wait_for_xmitr(up, BOTH_EMPTY); -+#else - wait_for_xmitr(up, UART_LSR_THRE); -+#endif - serial_port_out(port, UART_TX, ch); - } - diff --git a/target/linux/ar7/patches-3.18/950-cpmac_titan.patch b/target/linux/ar7/patches-3.18/950-cpmac_titan.patch index f1d432cc4c..3cabae067a 100644 --- a/target/linux/ar7/patches-3.18/950-cpmac_titan.patch +++ b/target/linux/ar7/patches-3.18/950-cpmac_titan.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/ti/cpmac.c +++ b/drivers/net/ethernet/ti/cpmac.c -@@ -1146,6 +1146,8 @@ static int cpmac_probe(struct platform_d +@@ -1147,6 +1147,8 @@ static int cpmac_probe(struct platform_d goto out; } @@ -9,7 +9,7 @@ dev->irq = platform_get_irq_byname(pdev, "irq"); dev->netdev_ops = &cpmac_netdev_ops; -@@ -1227,7 +1229,7 @@ int cpmac_init(void) +@@ -1228,7 +1230,7 @@ int cpmac_init(void) cpmac_mii->reset = cpmac_mdio_reset; cpmac_mii->irq = mii_irqs; @@ -18,8 +18,8 @@ if (!cpmac_mii->priv) { pr_err("Can't ioremap mdio registers\n"); -@@ -1238,10 +1240,16 @@ int cpmac_init(void) - #warning FIXME: unhardcode gpio&reset bits +@@ -1239,10 +1241,16 @@ int cpmac_init(void) + /* FIXME: unhardcode gpio&reset bits */ ar7_gpio_disable(26); ar7_gpio_disable(27); - ar7_device_reset(AR7_RESET_BIT_CPMAC_LO); @@ -37,7 +37,7 @@ cpmac_mii->reset(cpmac_mii); for (i = 0; i < 300; i++) { -@@ -1258,7 +1266,11 @@ int cpmac_init(void) +@@ -1259,7 +1267,11 @@ int cpmac_init(void) mask = 0; } diff --git a/target/linux/ar7/patches-4.1/001-mips-ar7-fix-serial.patch b/target/linux/ar7/patches-4.1/001-mips-ar7-fix-serial.patch deleted file mode 100644 index 1aded9246c..0000000000 --- a/target/linux/ar7/patches-4.1/001-mips-ar7-fix-serial.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 443ab715a40881d6c9ba11b027ba154bac904cb0 Mon Sep 17 00:00:00 2001 -From: Oswald Buddenhagen -Date: Sat, 10 May 2014 23:19:08 +0200 -Subject: [PATCH] MIPS/AR7: ensure that serial ports are properly set up - -without UPF_FIXED_TYPE, the data from the PORT_AR7 uart_config entry is -never copied, resulting in a dead port. - -Signed-off-by: Oswald Buddenhagen ---- - arch/mips/ar7/platform.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/arch/mips/ar7/platform.c -+++ b/arch/mips/ar7/platform.c -@@ -577,6 +577,7 @@ static int __init ar7_register_uarts(voi - uart_port.type = PORT_AR7; - uart_port.uartclk = clk_get_rate(bus_clk) / 2; - uart_port.iotype = UPIO_MEM32; -+ uart_port.flags = UPF_FIXED_TYPE; - uart_port.regshift = 2; - - uart_port.line = 0; diff --git a/target/linux/ar7/patches-4.1/120-gpio_chrdev.patch b/target/linux/ar7/patches-4.1/120-gpio_chrdev.patch deleted file mode 100644 index 1468ca3212..0000000000 --- a/target/linux/ar7/patches-4.1/120-gpio_chrdev.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/drivers/char/Kconfig -+++ b/drivers/char/Kconfig -@@ -461,6 +461,15 @@ config MWAVE - To compile this driver as a module, choose M here: the - module will be called mwave. - -+config AR7_GPIO -+ tristate "TI AR7 GPIO Support" -+ depends on AR7 -+ help -+ Give userspace access to the GPIO pins on the Texas Instruments AR7 -+ processors. -+ -+ If compiled as a module, it will be called ar7_gpio. -+ - config SCx200_GPIO - tristate "NatSemi SCx200 GPIO Support" - depends on SCx200 ---- a/drivers/char/Makefile -+++ b/drivers/char/Makefile -@@ -42,6 +42,7 @@ obj-$(CONFIG_HW_RANDOM) += hw_random/ - obj-$(CONFIG_PPDEV) += ppdev.o - obj-$(CONFIG_NWBUTTON) += nwbutton.o - obj-$(CONFIG_NWFLASH) += nwflash.o -+obj-$(CONFIG_AR7_GPIO) += ar7_gpio.o - obj-$(CONFIG_SCx200_GPIO) += scx200_gpio.o - obj-$(CONFIG_PC8736x_GPIO) += pc8736x_gpio.o - obj-$(CONFIG_NSC_GPIO) += nsc_gpio.o diff --git a/target/linux/ar7/patches-4.1/500-serial_kludge.patch b/target/linux/ar7/patches-4.1/500-serial_kludge.patch deleted file mode 100644 index c7bb29707a..0000000000 --- a/target/linux/ar7/patches-4.1/500-serial_kludge.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/drivers/tty/serial/8250/8250_core.c -+++ b/drivers/tty/serial/8250/8250_core.c -@@ -347,6 +347,13 @@ configured less than Maximum supported f - .rxtrig_bytes = {1, 4, 8, 14}, - .flags = UART_CAP_FIFO, - }, -+ [PORT_AR7] = { -+ .name = "TI-AR7", -+ .fifo_size = 16, -+ .tx_loadsz = 16, -+ .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00, -+ .flags = UART_CAP_FIFO | UART_CAP_AFE, -+ }, - }; - - /* Uart divisor latch read */ -@@ -3342,7 +3349,11 @@ static void serial8250_console_putchar(s - { - struct uart_8250_port *up = up_to_u8250p(port); - -+#ifdef CONFIG_AR7 -+ wait_for_xmitr(up, BOTH_EMPTY); -+#else - wait_for_xmitr(up, UART_LSR_THRE); -+#endif - serial_port_out(port, UART_TX, ch); - } - diff --git a/target/linux/ar7/patches-4.9/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch b/target/linux/ar7/patches-4.9/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch new file mode 100644 index 0000000000..cc1a541a3e --- /dev/null +++ b/target/linux/ar7/patches-4.9/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch @@ -0,0 +1,48 @@ +From ee6c9d41de084b2cefd90e5e0c9f30a35f6d3967 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 29 Oct 2017 15:50:42 +0100 +Subject: [PATCH RFC 3/3] MIPS: AR7: ensure the port type's FCR value is used + +Since commit aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt +trigger I/F of FIFO buffers"), the port's default FCR value isn't used +in serial8250_do_set_termios anymore, but copied over once in +serial8250_config_port and then modified as needed. + +Unfortunately, serial8250_config_port will never be called if the port +is shared between kernel and userspace, and the port's flag doesn't have +UPF_BOOT_AUTOCONF, which would trigger a serial8250_config_port as well. + +This causes garbled output from userspace: + +[ 5.220000] random: procd urandom read with 49 bits of entropy available +ers + [kee + +Fix this by forcing it to be configured on boot, resulting in the +expected output: + +[ 5.250000] random: procd urandom read with 50 bits of entropy available +Press the [f] key and hit [enter] to enter failsafe mode +Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level + +Fixes: aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt trigger I/F of FIFO buffers") +Signed-off-by: Jonas Gorski +--- +I'm not sure if this is just AR7's issue, or if this points to a general +issue for UARTs used as kernel console and login console with the "fixed" +commit. + + arch/mips/ar7/platform.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/ar7/platform.c ++++ b/arch/mips/ar7/platform.c +@@ -576,7 +576,7 @@ static int __init ar7_register_uarts(voi + uart_port.type = PORT_AR7; + uart_port.uartclk = clk_get_rate(bus_clk) / 2; + uart_port.iotype = UPIO_MEM32; +- uart_port.flags = UPF_FIXED_TYPE; ++ uart_port.flags = UPF_FIXED_TYPE | UPF_BOOT_AUTOCONF; + uart_port.regshift = 2; + + uart_port.line = 0; diff --git a/target/linux/ar7/patches-4.1/100-fix-highmem-offset.patch b/target/linux/ar7/patches-4.9/100-fix-highmem-offset.patch similarity index 100% rename from target/linux/ar7/patches-4.1/100-fix-highmem-offset.patch rename to target/linux/ar7/patches-4.9/100-fix-highmem-offset.patch diff --git a/target/linux/ar7/patches-4.1/101-MIPS-AR7-allow-NULL-clock-for-clk_get_rate.patch b/target/linux/ar7/patches-4.9/101-MIPS-AR7-allow-NULL-clock-for-clk_get_rate.patch similarity index 100% rename from target/linux/ar7/patches-4.1/101-MIPS-AR7-allow-NULL-clock-for-clk_get_rate.patch rename to target/linux/ar7/patches-4.9/101-MIPS-AR7-allow-NULL-clock-for-clk_get_rate.patch diff --git a/target/linux/ar7/patches-4.1/110-flash.patch b/target/linux/ar7/patches-4.9/110-flash.patch similarity index 92% rename from target/linux/ar7/patches-4.1/110-flash.patch rename to target/linux/ar7/patches-4.9/110-flash.patch index e4aeffd3e2..f5713bd033 100644 --- a/target/linux/ar7/patches-4.1/110-flash.patch +++ b/target/linux/ar7/patches-4.9/110-flash.patch @@ -11,7 +11,7 @@ obj-$(CONFIG_MTD_MYLOADER_PARTS) += myloader.o --- a/arch/mips/ar7/platform.c +++ b/arch/mips/ar7/platform.c -@@ -199,7 +199,7 @@ static struct resource physmap_flash_res +@@ -198,7 +198,7 @@ static struct resource physmap_flash_res .name = "mem", .flags = IORESOURCE_MEM, .start = 0x10000000, diff --git a/target/linux/ar7/patches-4.1/160-vlynq_try_remote_first.patch b/target/linux/ar7/patches-4.9/160-vlynq_try_remote_first.patch similarity index 100% rename from target/linux/ar7/patches-4.1/160-vlynq_try_remote_first.patch rename to target/linux/ar7/patches-4.9/160-vlynq_try_remote_first.patch diff --git a/target/linux/ar7/patches-4.1/200-free-mem-below-kernel-offset.patch b/target/linux/ar7/patches-4.9/200-free-mem-below-kernel-offset.patch similarity index 100% rename from target/linux/ar7/patches-4.1/200-free-mem-below-kernel-offset.patch rename to target/linux/ar7/patches-4.9/200-free-mem-below-kernel-offset.patch diff --git a/target/linux/ar7/patches-4.1/300-add-ac49x-platform.patch b/target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch similarity index 93% rename from target/linux/ar7/patches-4.1/300-add-ac49x-platform.patch rename to target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch index 2e5528e72c..67ed3e494a 100644 --- a/target/linux/ar7/patches-4.1/300-add-ac49x-platform.patch +++ b/target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch @@ -13,7 +13,7 @@ +load-$(CONFIG_AR7_AC49X) += 0xffffffff945ca000 --- a/arch/mips/ar7/setup.c +++ b/arch/mips/ar7/setup.c -@@ -69,6 +69,10 @@ const char *get_system_type(void) +@@ -68,6 +68,10 @@ const char *get_system_type(void) return "TI AR7 (TNETV1056)"; case TITAN_CHIP_1060: return "TI AR7 (TNETV1060)"; @@ -37,7 +37,7 @@ #define AR7_IRQ_UART0 15 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -99,7 +99,7 @@ config AR7 +@@ -160,7 +160,7 @@ config AR7 select HAVE_CLK help Support for the Texas Instruments AR7 System-on-a-Chip @@ -46,7 +46,7 @@ config ATH25 bool "Atheros AR231x/AR531x SoC support" -@@ -925,6 +925,7 @@ config MIPS_PARAVIRT +@@ -1004,6 +1004,7 @@ config MIPS_PARAVIRT endchoice source "arch/mips/alchemy/Kconfig" diff --git a/target/linux/ar7/patches-4.1/310-ac49x-prom-support.patch b/target/linux/ar7/patches-4.9/310-ac49x-prom-support.patch similarity index 100% rename from target/linux/ar7/patches-4.1/310-ac49x-prom-support.patch rename to target/linux/ar7/patches-4.9/310-ac49x-prom-support.patch diff --git a/target/linux/ar7/patches-4.1/320-ac49x-mtd-partitions.patch b/target/linux/ar7/patches-4.9/320-ac49x-mtd-partitions.patch similarity index 91% rename from target/linux/ar7/patches-4.1/320-ac49x-mtd-partitions.patch rename to target/linux/ar7/patches-4.9/320-ac49x-mtd-partitions.patch index 23304931e8..fafa8c77eb 100644 --- a/target/linux/ar7/patches-4.1/320-ac49x-mtd-partitions.patch +++ b/target/linux/ar7/patches-4.9/320-ac49x-mtd-partitions.patch @@ -1,6 +1,6 @@ --- a/drivers/mtd/Kconfig +++ b/drivers/mtd/Kconfig -@@ -159,6 +159,11 @@ config MTD_OF_PARTS +@@ -154,6 +154,11 @@ config MTD_OF_PARTS the partition map from the children of the flash node, as described in Documentation/devicetree/bindings/mtd/partition.txt. @@ -24,7 +24,7 @@ obj-$(CONFIG_MTD_BCM63XX_PARTS) += bcm63xxpart.o --- a/arch/mips/ar7/platform.c +++ b/arch/mips/ar7/platform.c -@@ -202,7 +202,7 @@ static struct resource physmap_flash_res +@@ -201,7 +201,7 @@ static struct resource physmap_flash_res .end = 0x11ffffff, }; diff --git a/target/linux/ar7/patches-4.1/920-ar7part.patch b/target/linux/ar7/patches-4.9/920-ar7part.patch similarity index 93% rename from target/linux/ar7/patches-4.1/920-ar7part.patch rename to target/linux/ar7/patches-4.9/920-ar7part.patch index 9948858d05..e520af2083 100644 --- a/target/linux/ar7/patches-4.1/920-ar7part.patch +++ b/target/linux/ar7/patches-4.9/920-ar7part.patch @@ -20,11 +20,11 @@ }; +int create_titan_partitions(struct mtd_info *master, -+ struct mtd_partition **pparts, ++ const struct mtd_partition **pparts, + struct mtd_part_parser_data *data); + static int create_mtd_partitions(struct mtd_info *master, - struct mtd_partition **pparts, + const struct mtd_partition **pparts, struct mtd_part_parser_data *data) { struct ar7_bin_rec header; @@ -107,11 +107,13 @@ root_offset += master->erasesize - 1; --- a/drivers/mtd/titanpart.c +++ b/drivers/mtd/titanpart.c -@@ -149,7 +149,7 @@ static void titan_add_partition(char * e +@@ -148,8 +148,8 @@ static void titan_add_partition(char * e + } int create_titan_partitions(struct mtd_info *master, - struct mtd_partition **pparts, +- struct mtd_partition **pparts, - unsigned long origin) ++ const struct mtd_partition **pparts, + struct mtd_part_parser_data *data) { struct nsp_img_hdr_head hdr; diff --git a/target/linux/ar7/patches-4.1/925-actiontec_leds.patch b/target/linux/ar7/patches-4.9/925-actiontec_leds.patch similarity index 90% rename from target/linux/ar7/patches-4.1/925-actiontec_leds.patch rename to target/linux/ar7/patches-4.9/925-actiontec_leds.patch index 1346a210f9..804dbf5c3c 100644 --- a/target/linux/ar7/patches-4.1/925-actiontec_leds.patch +++ b/target/linux/ar7/patches-4.9/925-actiontec_leds.patch @@ -1,6 +1,6 @@ --- a/arch/mips/ar7/platform.c +++ b/arch/mips/ar7/platform.c -@@ -461,31 +461,22 @@ static struct gpio_led fb_fon_leds[] = { +@@ -460,31 +460,22 @@ static struct gpio_led fb_fon_leds[] = { }, }; @@ -35,7 +35,7 @@ .default_trigger = "default-on", }, { -@@ -493,6 +484,44 @@ static struct gpio_led gt701_leds[] = { +@@ -492,6 +483,44 @@ static struct gpio_led gt701_leds[] = { .gpio = 10, .active_low = 1, }, @@ -80,7 +80,7 @@ }; static struct gpio_led_platform_data ar7_led_data; -@@ -536,9 +565,9 @@ static void __init detect_leds(void) +@@ -535,9 +564,9 @@ static void __init detect_leds(void) } else if (strstr(prid, "CYWM") || strstr(prid, "CYWL")) { ar7_led_data.num_leds = ARRAY_SIZE(titan_leds); ar7_led_data.leds = titan_leds; diff --git a/target/linux/ar7/patches-4.1/950-cpmac_titan.patch b/target/linux/ar7/patches-4.9/950-cpmac_titan.patch similarity index 80% rename from target/linux/ar7/patches-4.1/950-cpmac_titan.patch rename to target/linux/ar7/patches-4.9/950-cpmac_titan.patch index f1d432cc4c..158b689c98 100644 --- a/target/linux/ar7/patches-4.1/950-cpmac_titan.patch +++ b/target/linux/ar7/patches-4.9/950-cpmac_titan.patch @@ -1,7 +1,7 @@ --- a/drivers/net/ethernet/ti/cpmac.c +++ b/drivers/net/ethernet/ti/cpmac.c -@@ -1146,6 +1146,8 @@ static int cpmac_probe(struct platform_d - goto out; +@@ -1124,6 +1124,8 @@ static int cpmac_probe(struct platform_d + goto fail; } + ar7_device_reset(pdata->reset_bit); @@ -9,17 +9,17 @@ dev->irq = platform_get_irq_byname(pdev, "irq"); dev->netdev_ops = &cpmac_netdev_ops; -@@ -1227,7 +1229,7 @@ int cpmac_init(void) +@@ -1203,7 +1205,7 @@ int cpmac_init(void) + cpmac_mii->write = cpmac_mdio_write; cpmac_mii->reset = cpmac_mdio_reset; - cpmac_mii->irq = mii_irqs; - cpmac_mii->priv = ioremap(AR7_REGS_MDIO, 256); + cpmac_mii->priv = ioremap(ar7_is_titan() ? TITAN_REGS_MDIO : AR7_REGS_MDIO, 256); if (!cpmac_mii->priv) { pr_err("Can't ioremap mdio registers\n"); -@@ -1238,10 +1240,16 @@ int cpmac_init(void) - #warning FIXME: unhardcode gpio&reset bits +@@ -1214,10 +1216,16 @@ int cpmac_init(void) + /* FIXME: unhardcode gpio&reset bits */ ar7_gpio_disable(26); ar7_gpio_disable(27); - ar7_device_reset(AR7_RESET_BIT_CPMAC_LO); @@ -37,7 +37,7 @@ cpmac_mii->reset(cpmac_mii); for (i = 0; i < 300; i++) { -@@ -1258,7 +1266,11 @@ int cpmac_init(void) +@@ -1234,7 +1242,11 @@ int cpmac_init(void) mask = 0; } diff --git a/target/linux/ar71xx/Makefile b/target/linux/ar71xx/Makefile index 6d5b4c52b3..104961929f 100644 --- a/target/linux/ar71xx/Makefile +++ b/target/linux/ar71xx/Makefile @@ -11,7 +11,7 @@ BOARD:=ar71xx BOARDNAME:=Atheros AR7xxx/AR9xxx FEATURES:=usbgadget CPU_TYPE:=24kc -SUBTARGETS:=generic nand mikrotik +SUBTARGETS:=generic tiny nand mikrotik KERNEL_PATCHVER:=4.9 diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds index 27e6c8a033..fac9dfa7ab 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds @@ -129,6 +129,22 @@ dr531) ;; esac ;; +ap91-5g|\ +n5q) + ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth0" + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "signal1" "SIGNAL1" "$board:red:signal1" "wlan0" "1" "100" + ucidef_set_led_rssi "signal2" "SIGNAL2" "$board:orange:signal2" "wlan0" "25" "100" + ucidef_set_led_rssi "signal3" "SIGNAL3" "$board:green:signal3" "wlan0" "50" "100" + ucidef_set_led_rssi "signal4" "SIGNAL4" "$board:green:signal4" "wlan0" "75" "100" + + case "$board" in + n5q) + ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth1" + ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt" + ;; + esac + ;; bhr-4grv2) ucidef_set_led_default "power" "POWER" "buffalo:green:power" "1" ucidef_set_led_default "diag" "DIAG" "buffalo:red:diag" "0" @@ -137,11 +153,11 @@ bsb) ucidef_set_led_default "sys" "SYS" "$board:red:sys" "1" ;; bullet-m|\ +loco-m-xw|\ nanostation-m|\ -rocket-m|\ -rocket-m-xw|\ nanostation-m-xw|\ -loco-m-xw) +rocket-m|\ +rocket-m-xw) ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:red:link1" "wlan0" "1" "100" "0" "13" ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:orange:link2" "wlan0" "26" "100" "-25" "13" ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:green:link3" "wlan0" "51" "100" "-50" "13" @@ -302,8 +318,8 @@ rb-962uigs-5hact2hnt) rb-2011il|\ rb-2011l|\ rb-2011uas|\ -rb-2011uias|\ rb-2011uas-2hnd|\ +rb-2011uias|\ rb-2011uias-2hnd) ucidef_set_led_switch "eth6" "ETH6" "rb:green:eth6" "switch1" "0x20" ucidef_set_led_switch "eth7" "ETH7" "rb:green:eth7" "switch1" "0x10" @@ -320,11 +336,21 @@ rb-lhg-5nd) ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "rb:green:rssi3" "wlan0" "60" "100" "-59" "13" ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "rb:green:rssi4" "wlan0" "80" "100" "-79" "13" ;; +rb-map-2nd) + ucidef_set_led_switch "eth1" "WAN" "rb:green:eth1" "switch0" "0x02" + ucidef_set_led_switch "eth2" "LAN" "rb:green:eth2" "switch0" "0x04" + ucidef_set_led_gpio "poe" "POE" "rb:red:poe_out" "14" "0" + ucidef_set_led_wlan "wlan" "WLAN" "rb:green:wlan" "phy0tpt" + ;; rb-mapl-2nd) ucidef_set_led_default "power" "POWER" "rb:green:power" "1" ucidef_set_led_netdev "lan" "LAN" "rb:green:eth" "eth0" ucidef_set_led_wlan "wlan" "WLAN" "rb:green:wlan" "phy0tpt" ;; +rb-wap-2nd) + ucidef_set_led_timer "user" "USER" "rb:green:user" "1000" "1000" + ucidef_set_led_wlan "wlan" "WLAN" "rb:green:wlan" "phy0tpt" + ;; dap-2695-a1) ucidef_set_led_default "power" "POWER" "d-link:green:power" "1" ucidef_set_led_default "diag" "DIAG" "d-link:red:power" "0" @@ -381,13 +407,21 @@ dlan-pro-1200-ac) gl-ar300m) ucidef_set_led_wlan "wlan" "WLAN" "$board:red:wlan" "phy0tpt" ;; +gl-ar750) + ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:white:wlan2g" "phy1tpt" + ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:white:wlan5g" "phy0tpt" + ;; gl-mifi) ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt" ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0" ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth1" ucidef_set_led_netdev "3gnet" "3GNET" "$board:green:net" "3g-wan" ;; -gl-ar150|\ +gl-ar150) + ucidef_set_led_wlan "wlan" "WLAN" "$board:orange:wlan" "phy0tpt" + ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0" + ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth1" + ;; gl-ar300) ucidef_set_led_wlan "wlan" "WLAN" "$board:wlan" "phy0tpt" ;; @@ -501,13 +535,13 @@ nbg6716) ucidef_set_led_usbdev "usb2" "USB2" "$board:white:usb2" "2-1" ;; om2p|\ -om2pv2|\ -om2pv4|\ om2p-hs|\ om2p-hsv2|\ om2p-hsv3|\ om2p-hsv4|\ -om2p-lc) +om2p-lc|\ +om2pv2|\ +om2pv4) ucidef_set_led_netdev "port1" "port1" "om2p:blue:wan" "eth0" ucidef_set_led_netdev "port2" "port2" "om2p:blue:lan" "eth1" ucidef_set_led_default "wlan-red" "WLAN (red)" "om2p:red:wifi" "0" @@ -550,6 +584,12 @@ pqi-air-pen) qihoo-c301) ucidef_set_led_wlan "wlan2g" "WLAN2G" "qihoo:red:status" "phy1tpt" ;; +r36a) + ucidef_set_led_netdev "lan" "LAN" "$board:blue:lan" "eth0" + ucidef_set_led_usbdev "usb" "USB" "$board:blue:usb" "1-1" + ucidef_set_led_netdev "wan" "WAN" "$board:blue:wan" "eth1" + ucidef_set_led_wlan "wlan" "WLAN" "$board:blue:wlan" "phy0tpt" + ;; r602n|\ zbt-we1526) ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth1" @@ -565,6 +605,12 @@ re450) ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "$board:blue:wlan2g" "phy1tpt" ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "$board:blue:wlan5g" "phy0tpt" ;; +rut900) + ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth1" + ucidef_set_led_switch "lan1" "LAN1" "$board:green:lan1" "switch0" "0x10" + ucidef_set_led_switch "lan2" "LAN2" "$board:green:lan2" "switch0" "0x08" + ucidef_set_led_switch "lan3" "LAN3" "$board:green:lan3" "switch0" "0x04" + ;; smart-300) ucidef_set_led_netdev "wan" "WAN" "nc-link:green:wan" "eth0" ucidef_set_led_switch "lan1" "LAN1" "nc-link:green:lan1" "switch0" "0x04" @@ -640,8 +686,8 @@ tl-wr941nd-v5) ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" case "$board" in - tl-wr842n-v2|\ - tl-mr3420-v2) + tl-mr3420-v2|\ + tl-wr842n-v2) ucidef_set_led_usbdev "usb" "USB" "tp-link:green:3g" "1-1" ;; esac @@ -686,11 +732,12 @@ tl-wa850re-v2) ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:blue:signal5" "wlan0" "80" "100" "-79" "13" ;; tl-wa701nd-v2|\ -tl-wa860re|\ -tl-wa830re-v2|\ tl-wa801nd-v2|\ +tl-wa830re-v2|\ +tl-wa860re|\ tl-wa901nd-v3|\ -tl-wa901nd-v4) +tl-wa901nd-v4|\ +tl-wa901nd-v5) ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0" ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" ;; @@ -798,14 +845,20 @@ tl-wr1043nd-v2) ucidef_set_led_usbdev "usb" "USB" "tp-link:green:usb" "1-1" ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" ;; +tl-wr1043n-v5|\ tl-wr1043nd-v4) - ucidef_set_led_usbdev "usb" "USB" "tp-link:green:usb" "1-1" ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" ucidef_set_led_switch "wan" "WAN" "tp-link:green:wan" "switch0" "0x20" ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10" ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08" ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04" ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02" + + case "$board" in + tl-wr1043nd-v4) + ucidef_set_led_usbdev "usb" "USB" "tp-link:green:usb" "1-1" + ;; + esac ;; tl-wr2543n) ucidef_set_led_wlan "wlan2g" "WLAN2G" "tp-link:green:wlan2g" "phy0tpt" diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network index a75f5fe29f..5a10a9f486 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -64,12 +64,14 @@ ar71xx_setup_interfaces() antminer-s3|\ antrouter-r1|\ ap121f|\ + ap91-5g|\ aw-nr580|\ bullet-m|\ c-55|\ cap4200ag|\ cf-e380ac-v1|\ cf-e380ac-v2|\ + dr342|\ eap120|\ eap300v2|\ eap7660d|\ @@ -96,10 +98,13 @@ ar71xx_setup_interfaces() rb-911g-5hpnd|\ rb-912uag-2hpnd|\ rb-912uag-5hpnd|\ + rb-921gs-5hpacd-r2|\ rb-lhg-5nd|\ rb-mapl-2nd|\ rb-sxt2n|\ rb-sxt5n|\ + rb-wap-2nd|\ + rb-wapg-5hact2hnd|\ re450|\ rocket-m-xw|\ sc300m |\ @@ -122,11 +127,13 @@ ar71xx_setup_interfaces() tl-wa901nd-v2|\ tl-wa901nd-v3|\ tl-wa901nd-v4|\ + tl-wa901nd-v5|\ tl-wr703n|\ tl-wr802n-v1|\ tl-wr802n-v2|\ tl-wr902ac-v1|\ tube2h|\ + unifi|\ unifiac-lite|\ wi2a-ac200i|\ wndap360|\ @@ -145,24 +152,25 @@ ar71xx_setup_interfaces() gl-inet|\ gl-mifi|\ jwap003|\ - om2pv4|\ om2p-hsv4|\ + om2pv4|\ pb42|\ pb44|\ rb-951ui-2hnd|\ - rb-951ui-2nd|\ rb-952ui-5ac2nd|\ routerstation|\ tl-wr710n|\ tl-wr720n-v3|\ tl-wr810n|\ + tl-wr810n-v2|\ wpe72|\ wrtnode2q) ucidef_set_interfaces_lan_wan "eth1" "eth0" ;; rb-750-r2|\ rb-750p-pbr2|\ - rb-750up-r2) + rb-750up-r2|\ + rb-951ui-2nd) ucidef_set_interfaces_lan_wan "eth1.1" "eth0" ucidef_add_switch "switch0" \ "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" @@ -171,6 +179,7 @@ ar71xx_setup_interfaces() all0315n|\ dlan-hotspot|\ dlan-pro-500-wp|\ + ens202ext|\ ja76pf2|\ rocket-m-ti|\ ubnt-unifi-outdoor) @@ -272,7 +281,8 @@ ar71xx_setup_interfaces() dir-835-a1|\ esr900|\ mynet-n750|\ - sr3200) + sr3200|\ + tl-wr1043n-v5) ucidef_add_switch "switch0" \ "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" ;; @@ -381,6 +391,12 @@ ar71xx_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" ;; + gl-ar750|\ + rb-435g) + ucidef_set_interfaces_lan_wan "eth1.1" "eth0" + ucidef_add_switch "switch0" \ + "0@eth1" "1:lan" "2:lan" + ;; jwap230) ucidef_set_interfaces_lan_wan "eth0.1" "eth1.2" ucidef_add_switch "switch0" \ @@ -393,11 +409,6 @@ ar71xx_setup_interfaces() onion-omega) ucidef_set_interface_lan "wlan0" ;; - rb-435g) - ucidef_set_interfaces_lan_wan "eth1.1" "eth0" - ucidef_add_switch "switch0" \ - "0@eth1" "1:lan" "2:lan" - ;; rb-450) ucidef_set_interfaces_lan_wan "eth1.1" "eth0" ucidef_add_switch "switch0" \ @@ -411,9 +422,18 @@ ar71xx_setup_interfaces() rb-493g) ucidef_set_interfaces_lan_wan "eth0.1 eth1.1" "eth1.2" ucidef_add_switch "switch0" \ - "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" + "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3" ucidef_add_switch "switch1" \ - "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" + "0@eth1" "1:lan:4" "2:lan:1" "3:lan:3" "4:lan:2" "5:wan" + ;; + rb-map-2nd) + ucidef_add_switch "switch0" \ + "0@eth0" "1:wan" "2:lan" + ;; + rut900) + ucidef_set_interfaces_lan_wan "eth0.1" "eth1" + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" ;; tellstick-znet-lite) ucidef_set_interface_wan "eth0" @@ -533,6 +553,7 @@ ar71xx_setup_macs() fritz300e) lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)")) ;; + tl-wr1043n-v5|\ tl-wr1043nd-v4) lan_mac=$(mtd_get_mac_binary product-info 8) wan_mac=$(macaddr_add "$lan_mac" 1) @@ -544,6 +565,10 @@ ar71xx_setup_macs() mynet-n750) wan_mac=$(mtd_get_mac_ascii devdata "wanmac") ;; + wlr8100) + lan_mac=$(mtd_get_mac_ascii u-boot-env "ethaddr") + wan_mac=$(mtd_get_mac_ascii u-boot-env "wanaddr") + ;; wpj344|\ wpj558) wan_mac=$(mtd_get_mac_binary u-boot 0x2e018) diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index f4ad435ea7..2720288e3d 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -23,6 +23,7 @@ get_status_led() { antminer-s1|\ antminer-s3|\ antminer-r1|\ + eap120|\ minibox-v1|\ som9331|\ sr3200|\ @@ -37,7 +38,9 @@ get_status_led() { ap531b0|\ cpe505n|\ db120|\ + dr342|\ dr344|\ + rut900|\ tew-632brp|\ tl-wr942n-v1|\ wpj344|\ @@ -73,11 +76,15 @@ get_status_led() { ap90q|\ cpe830|\ cpe870|\ + gl-ar300m|\ gl-inet|\ - gl-mifi|\ - gl-ar300m) + gl-mifi) status_led="$board:green:lan" ;; + ap91-5g|\ + n5q) + status_led="$board:green:signal4" + ;; ap96) status_led="$board:green:led2" ;; @@ -93,12 +100,12 @@ get_status_led() { status_led="$board:red:sys" ;; bullet-m|\ - rocket-m|\ - rocket-m-xw|\ + loco-m-xw|\ nano-m|\ nanostation-m|\ nanostation-m-xw|\ - loco-m-xw) + rocket-m|\ + rocket-m-xw) status_led="ubnt:green:link4" ;; rocket-m-ti) @@ -132,9 +139,7 @@ get_status_led() { cpe510) status_led="tp-link:green:link4" ;; - cr3000) - status_led="pcs:amber:power" - ;; + cr3000|\ cr5000) status_led="pcs:amber:power" ;; @@ -176,23 +181,22 @@ get_status_led() { oolite) status_led="$board:red:system" ;; - dw33d) + dw33d|\ + r36a) status_led="$board:blue:status" ;; - eap120) - status_led="$board:green:system" - ;; eap300v2) status_led="engenius:blue:power" ;; - ens202ext) + ens202ext|\ + esr900) status_led="engenius:amber:power" ;; eap7660d) status_led="$board:green:ds4" ;; - el-mini|\ - el-m150) + el-m150|\ + el-mini) status_led="easylink:green:system" ;; ew-dorin|\ @@ -206,9 +210,7 @@ get_status_led() { esr1750) status_led="$board:amber:power" ;; - esr900) - status_led="engenius:amber:power" - ;; + gl-ar750|\ hiveap-121|\ nbg6716) status_led="$board:white:power" @@ -252,9 +254,7 @@ get_status_led() { status_led="mr900:blue:power" ;; mynet-n600|\ - mynet-n750) - status_led="wd:blue:power" - ;; + mynet-n750|\ mynet-rext) status_led="wd:blue:power" ;; @@ -266,13 +266,13 @@ get_status_led() { status_led="nbg460n:green:power" ;; om2p|\ - om2pv2|\ - om2pv4|\ om2p-hs|\ om2p-hsv2|\ om2p-hsv3|\ om2p-hsv4|\ - om2p-lc) + om2p-lc|\ + om2pv2|\ + om2pv4) status_led="om2p:blue:power" ;; om5p|\ @@ -327,6 +327,7 @@ get_status_led() { rb-952ui-5ac2nd|\ rb-962uigs-5hact2hnt|\ rb-lhg-5nd|\ + rb-map-2nd|\ rb-mapl-2nd) status_led="rb:green:user" ;; @@ -367,7 +368,8 @@ get_status_led() { tew-823dru) status_led="trendnet:green:power" ;; - tl-mr3020) + tl-mr3020|\ + tl-wr2543n) status_led="tp-link:green:wps" ;; tl-wa750re) @@ -390,27 +392,29 @@ get_status_led() { tl-mr3420-v2|\ tl-wa701nd-v2|\ tl-wa801nd-v2|\ + tl-wa801nd-v3|\ + tl-wa830re-v2|\ tl-wa901nd|\ tl-wa901nd-v2|\ tl-wa901nd-v3|\ tl-wa901nd-v4|\ + tl-wa901nd-v5|\ tl-wdr3320-v2|\ tl-wdr3500|\ tl-wr1041n-v2|\ + tl-wr1043n-v5|\ tl-wr1043nd|\ tl-wr1043nd-v2|\ tl-wr1043nd-v4|\ tl-wr740n-v6|\ tl-wr741nd|\ tl-wr741nd-v4|\ - tl-wa801nd-v3|\ tl-wr840n-v2|\ tl-wr840n-v3|\ tl-wr841n-v1|\ tl-wr841n-v7|\ tl-wr841n-v8|\ tl-wr841n-v11|\ - tl-wa830re-v2|\ tl-wr842n-v2|\ tl-wr842n-v3|\ tl-wr941nd|\ @@ -419,16 +423,17 @@ get_status_led() { ;; archer-c5|\ archer-c7|\ - tl-wdr4900-v2|\ tl-mr10u|\ tl-mr12u|\ tl-mr13u|\ tl-wdr4300|\ + tl-wdr4900-v2|\ tl-wr703n|\ tl-wr710n|\ tl-wr720n-v3|\ tl-wr802n-v1|\ tl-wr810n|\ + tl-wr810n-v2|\ tl-wr940n-v4|\ tl-wr941nd-v6) status_led="tp-link:blue:system" @@ -436,9 +441,6 @@ get_status_led() { tl-wr841n-v9) status_led="tp-link:green:qss" ;; - tl-wr2543n) - status_led="tp-link:green:wps" - ;; tl-wdr6500-v2) status_led="tp-link:white:system" ;; @@ -496,8 +498,8 @@ get_status_led() { wpj563) status_led="$board:green:sig1" ;; - wrt400n|\ - wrt160nl) + wrt160nl|\ + wrt400n) status_led="$board:blue:wps" ;; zcn-1523h-2|\ @@ -526,7 +528,8 @@ set_state() { done) status_led_on case $(board_name) in - gl-ar300m) + gl-ar300m|\ + gl-ar750) fw_printenv lc >/dev/null 2>&1 && fw_setenv "bootcount" 0 ;; qihoo-c301) diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index f9520b302b..41ab43f7cb 100644 --- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -94,6 +94,10 @@ case "$FIRMWARE" in rambutan) ath9k_eeprom_extract "art" 4096 2048 ;; + wlr8100) + ath9k_eeprom_extract "art" 4096 2048 + ath9k_patch_firmware_mac $(mtd_get_mac_ascii u-boot-env "ethaddr") + ;; z1) . /lib/upgrade/nand.sh diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 66796593c0..ccb041028a 100644 --- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -54,14 +54,15 @@ case "$FIRMWARE" in ath10kcal_extract "ART" 20480 2116 ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) ;; - archer-c7-v4|\ archer-c25-v1|\ - archer-c59-v1|\ - archer-c60-v1|\ tl-wdr6500-v2) ath10kcal_extract "art" 20480 2116 ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -2) ;; + archer-c7-v4) + ath10kcal_extract "art" 20480 2116 + ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -1) + ;; cf-e355ac|\ cf-e380ac-v1|\ cf-e380ac-v2|\ @@ -88,6 +89,11 @@ case "$FIRMWARE" in ath10kcal_extract "caldata" 20480 2116 ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1) ;; + gl-ar750|\ + tl-wpa8630) + ath10kcal_extract "art" 20480 2116 + ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1) + ;; mc-mac1200r) ath10kcal_extract "art" 20480 2116 ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -1) @@ -96,7 +102,8 @@ case "$FIRMWARE" in ath10kcal_extract "caldata" 20480 2116 ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) +2) ;; - rb-952ui-5ac2nd) + rb-952ui-5ac2nd|\ + rb-wapg-5hact2hnd) ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 2116 ;; re450|\ @@ -104,10 +111,6 @@ case "$FIRMWARE" in ath10kcal_extract "art" 20480 2116 ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -2) ;; - tl-wpa8630) - ath10kcal_extract "art" 20480 2116 - ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1) - ;; unifiac-lite|\ unifiac-pro) ath10kcal_extract "EEPROM" 20480 2116 @@ -134,15 +137,24 @@ case "$FIRMWARE" in ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) ;; rb-911g-5hpacd|\ + rb-921gs-5hpacd-r2|\ rb-962uigs-5hact2hnt) ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 2116 ;; + wlr8100) + ath10kcal_extract "art" 20480 2116 + ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1) + ;; esac ;; "ath10k/pre-cal-pci-0000:00:00.0.bin") case $board in - archer-c58-v1) + archer-c58-v1|\ + archer-c59-v1|\ + archer-c60-v1) ath10kcal_extract "art" 20480 12064 + ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ + /lib/firmware/ath10k/QCA9888/hw2.0/board.bin ;; esac ;; diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 77c835f2fd..0530d595a7 100644 --- a/target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -12,7 +12,9 @@ PHYNBR=${DEVPATH##*/phy} board=$(board_name) case "$board" in - archer-c58-v1) + archer-c58-v1|\ + archer-c59-v1|\ + archer-c60-v1) echo $(macaddr_add $(mtd_get_mac_binary mac 8) $(($PHYNBR - 1)) ) > /sys${DEVPATH}/macaddress ;; *) diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration index 338a22297b..29fdde40a0 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration @@ -43,20 +43,18 @@ migrate_switch_name() { board=$(board_name) case "$board" in -dir-825-c1|\ -wzr-hp-g300nh2|\ -tl-wdr4300|\ -tl-wr1041n-v2|\ -wrt160nl|\ +airrouter|\ ap121|\ ap121-mini|\ ap96|\ -airrouter|\ dir-600-a1|\ dir-615-c1|\ dir-615-e1|\ dir-615-e4|\ +dir-825-c1|\ ebr-2310-c1|\ +ew-dorin|\ +ew-dorin-router|\ ja76pf|\ rb-750|\ rb-751|\ @@ -65,17 +63,19 @@ tew-712br|\ tl-mr3220|\ tl-mr3220-v2 |\ tl-mr3420|\ +tl-wdr4300|\ tl-wr741nd|\ tl-wr741nd-v4|\ tl-wr841n-v7|\ +tl-wr1041n-v2|\ whr-g301n|\ whr-hp-g300n|\ whr-hp-gn|\ +wrt160nl|\ wzr-hp-ag300h|\ +wzr-hp-g300nh2|\ wzr-hp-g450h|\ -z1|\ -ew-dorin|\ -ew-dorin-router) +z1) migrate_switch_name "eth0" "switch0" ;; @@ -93,8 +93,8 @@ rb-2011uas-2hnd) ;; dir-825-b1|\ -tew-673gru|\ -nbg460n_550n_550nh) +nbg460n_550n_550nh|\ +tew-673gru) migrate_switch_name "rtl8366s" "switch0" ;; diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/04_led_migration b/target/linux/ar71xx/base-files/etc/uci-defaults/04_led_migration index d6f7077093..05d806051a 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/04_led_migration +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/04_led_migration @@ -54,6 +54,10 @@ dr344) migrate_leds ":red:=:green:" ":yellow:=:green:" ;; +gl-ar150) + migrate_leds "gl-ar150:wlan=gl-ar150:orange:wlan" "gl-ar150:lan=gl-ar150:green:lan" "gl-ar150:wan=gl-ar150:green:wan" + ;; + wndap360) migrate_leds "wndap360:=netgear:" ;; diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index f89c0098e4..b6642495de 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -446,6 +446,9 @@ ar71xx_board_detect() { *"AP90Q") name="ap90q" ;; + *"AP91-5G") + name="ap91-5g" + ;; *"Archer C25 v1") name="archer-c25-v1" ;; @@ -603,6 +606,9 @@ ar71xx_board_detect() { *"Domino Pi") name="gl-domino" ;; + *"DR342") + name="dr342" + ;; *"DR344") name="dr344" ;; @@ -667,6 +673,9 @@ ar71xx_board_detect() { *"GL-AR300M") name="gl-ar300m" ;; + *"GL-AR750") + name="gl-ar750" + ;; *"GL-CONNECT INET v1") name="gl-inet" @@ -762,6 +771,9 @@ ar71xx_board_detect() { *"MZK-W300NH") name="mzk-w300nh" ;; + *"N5Q") + name="n5q" + ;; *"Nanostation M") name="nanostation-m" ubnt_xm_board_detect @@ -838,6 +850,9 @@ ar71xx_board_detect() { *"Qihoo 360 C301") name="qihoo-c301" ;; + *"R36A") + name="r36a" + ;; *"R602N") name="r602n" ;; @@ -941,6 +956,9 @@ ar71xx_board_detect() { *"RouterBOARD 912UAG-5HPnD") name="rb-912uag-5hpnd" ;; + *"RouterBOARD 921GS-5HPacD r2") + name="rb-921gs-5hpacd-r2" + ;; *"RouterBOARD 941-2nD") name="rb-941-2nd" ;; @@ -962,6 +980,9 @@ ar71xx_board_detect() { *"RouterBOARD LHG 5nD") name="rb-lhg-5nd" ;; + *"RouterBOARD mAP 2nD") + name="rb-map-2nd" + ;; *"RouterBOARD mAP L-2nD") name="rb-mapl-2nd" ;; @@ -971,12 +992,21 @@ ar71xx_board_detect() { *"RouterBOARD SXT Lite5") name="rb-sxt5n" ;; + *"RouterBOARD wAP 2nD r2") + name="rb-wap-2nd" + ;; + *"RouterBOARD wAP G-5HacT2HnD") + name="rb-wapg-5hact2hnd" + ;; *"RouterStation") name="routerstation" ;; *"RouterStation Pro") name="routerstation-pro" ;; + *"RUT900") + name="rut900" + ;; *"RW2458N") name="rw2458n" ;; @@ -1049,7 +1079,7 @@ ar71xx_board_detect() { *"TL-MR3420 v2") name="tl-mr3420-v2" ;; - *TL-MR6400) + *"TL-MR6400") name="tl-mr6400" ;; *"TL-WA701ND v2") @@ -1097,6 +1127,9 @@ ar71xx_board_detect() { *"TL-WA901ND v4") name="tl-wa901nd-v4" ;; + *"TL-WA901ND v5") + name="tl-wa901nd-v5" + ;; *"TL-WDR3320 v2") name="tl-wdr3320-v2" ;; @@ -1118,6 +1151,9 @@ ar71xx_board_detect() { *"TL-WR1041N v2") name="tl-wr1041n-v2" ;; + *"TL-WR1043N v5") + name="tl-wr1043n-v5" + ;; *"TL-WR1043ND") name="tl-wr1043nd" ;; @@ -1157,6 +1193,9 @@ ar71xx_board_detect() { *"TL-WR810N") name="tl-wr810n" ;; + *"TL-WR810N v2") + name="tl-wr810n-v2" + ;; *"TL-WR840N v2") name="tl-wr840n-v2" ;; diff --git a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx index df653f2e48..7d3e82813d 100644 --- a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx +++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx @@ -22,44 +22,38 @@ preinit_set_mac_address() { . /lib/functions.sh case $(board_name) in - c-55|\ - c-60) - mac_lan=$(mtd_get_mac_binary art 0) - [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan" - ;; - dir-615-c1) - fetch_mac_from_mtd config lan_mac wan_mac - echo 1 > /sys/class/leds/dir-615-c1:green:wancpu/brightness - ;; - dir-615-i1) - fetch_mac_from_mtd nvram sys_lan_mac sys_wan_mac - ;; - mr18) - mac_lan=$(mtd_get_mac_binary_ubi board-config 102) - [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan" - ;; - r6100) - mac_lan=$(mtd_get_mac_binary caldata 0) - [ -n "$mac_lan" ] && ifconfig eth1 hw ether "$mac_lan" - mac_wan=$(mtd_get_mac_binary caldata 6) - [ -n "$mac_wan" ] && ifconfig eth0 hw ether "$mac_wan" - ;; - rambutan) - mac_lan=$(mtd_get_mac_binary art 0) - [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan" - mac_wan=$(mtd_get_mac_binary art 6) - [ -n "$mac_wan" ] && ifconfig eth1 hw ether "$mac_wan" - ;; - tew-632brp) - fetch_mac_from_mtd config lan_mac wan_mac - ;; - wrt160nl) - fetch_mac_from_mtd nvram lan_hwaddr wan_hwaddr - ;; - z1) - mac_lan=$(mtd_get_mac_binary_ubi board-config 102) - [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan" - ;; + c-55|\ + c-60) + mac_lan=$(mtd_get_mac_binary art 0) + [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan" + ;; + dir-615-c1|\ + tew-632brp) + fetch_mac_from_mtd config lan_mac wan_mac + ;; + dir-615-i1) + fetch_mac_from_mtd nvram sys_lan_mac sys_wan_mac + ;; + mr18|\ + z1) + mac_lan=$(mtd_get_mac_binary_ubi board-config 102) + [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan" + ;; + r6100) + mac_lan=$(mtd_get_mac_binary caldata 0) + [ -n "$mac_lan" ] && ifconfig eth1 hw ether "$mac_lan" + mac_wan=$(mtd_get_mac_binary caldata 6) + [ -n "$mac_wan" ] && ifconfig eth0 hw ether "$mac_wan" + ;; + rambutan) + mac_lan=$(mtd_get_mac_binary art 0) + [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan" + mac_wan=$(mtd_get_mac_binary art 6) + [ -n "$mac_wan" ] && ifconfig eth1 hw ether "$mac_wan" + ;; + wrt160nl) + fetch_mac_from_mtd nvram lan_hwaddr wan_hwaddr + ;; esac } diff --git a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx index 3a98cdccf1..909e615092 100644 --- a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx +++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx @@ -8,42 +8,43 @@ set_preinit_iface() { . /lib/functions.sh case $(board_name) in - alfa-ap96 |\ - alfa-nx |\ - ap135-020 |\ - ap136-020 |\ - ap147-010 |\ - archer-c5 |\ - archer-c7 |\ - bhr-4grv2 |\ - dir-505-a1 |\ - gl-inet |\ - jwap003 |\ - pb42 |\ - pb44 |\ - rb-433 |\ - rb-433u |\ - rb-435g |\ - rb-450 |\ - rb-450g |\ - routerstation |\ - routerstation-pro |\ - smart-300 |\ - tl-mr3420-v2 |\ - tl-wdr4900-v2 |\ - tl-wr1043nd-v2 |\ - tl-wr710n |\ - tl-wr720n-v3 |\ - tl-wr841n-v8 |\ - tl-wr842n-v2 |\ - tl-wr941nd-v6 |\ - tl-wr940n-v4 |\ - wnr2000-v3 |\ - wnr2200 |\ - wnr612-v2 |\ - wnr1000-v2 |\ - wpn824n |\ - wpe72) + alfa-ap96|\ + alfa-nx|\ + ap135-020|\ + ap136-020|\ + ap147-010|\ + archer-c5|\ + archer-c7|\ + bhr-4grv2|\ + dir-505-a1|\ + gl-ar750|\ + gl-inet|\ + jwap003|\ + pb42|\ + pb44|\ + rb-433|\ + rb-433u|\ + rb-435g|\ + rb-450|\ + rb-450g|\ + routerstation|\ + routerstation-pro|\ + smart-300|\ + tl-mr3420-v2|\ + tl-wdr4900-v2|\ + tl-wr1043nd-v2|\ + tl-wr710n|\ + tl-wr720n-v3|\ + tl-wr841n-v8|\ + tl-wr842n-v2|\ + tl-wr940n-v4|\ + tl-wr941nd-v6|\ + wnr1000-v2|\ + wnr2000-v3|\ + wnr2200|\ + wnr612-v2|\ + wpe72|\ + wpn824n) ifname=eth1 ;; *) @@ -53,6 +54,3 @@ set_preinit_iface() { } boot_hook_add preinit_main set_preinit_iface - - - diff --git a/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k b/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k index c9aa4b1eb5..cc3dc42c9c 100644 --- a/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k +++ b/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k @@ -7,9 +7,7 @@ do_patch_ath10k_firmware() { local firmware_file="/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin" # bail out if firmware does not exist - [ -f "$firmware_file" ] || { - return - } + [ -f "$firmware_file" ] || return local mac_offset=276 local mac_length=6 @@ -17,35 +15,34 @@ do_patch_ath10k_firmware() { local current_mac="$(hexdump -v -n $mac_length -s $mac_offset -e '5/1 "%02x:" 1/1 "%02x"' $firmware_file 2>/dev/null)" # check if mac address was already patched - [ "$default_mac" = "$current_mac" ] || { - return - } + [ "$default_mac" = "$current_mac" ] || return # some boards have bogus mac in otp (= directly in the PCIe card's EEPROM). # we have to patch the default mac in the firmware because we cannot change # the otp. case $(board_name) in - dgl-5500-a1 | tew-823dru) - local mac - mac=$(mtd_get_mac_ascii nvram wlan1_mac) - - cp $firmware_file /tmp/ath10k-firmware.bin - macaddr_2bin $mac | dd of=/tmp/ath10k-firmware.bin \ - conv=notrunc bs=1 seek=$mac_offset count=$mac_length + dgl-5500-a1|\ + tew-823dru) + local mac + mac=$(mtd_get_mac_ascii nvram wlan1_mac) + cp $firmware_file /tmp/ath10k-firmware.bin + macaddr_2bin $mac | dd of=/tmp/ath10k-firmware.bin \ + conv=notrunc bs=1 seek=$mac_offset count=$mac_length ;; esac - [ -f /tmp/ath10k-firmware.bin ] || { - return - } + + [ -f /tmp/ath10k-firmware.bin ] || return + cp /tmp/ath10k-firmware.bin $firmware_file rm /tmp/ath10k-firmware.bin } check_patch_ath10k_firmware() { case $(board_name) in - dgl-5500-a1 | tew-823dru) - do_patch_ath10k_firmware + dgl-5500-a1|\ + tew-823dru) + do_patch_ath10k_firmware ;; esac } diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index 3d6d9ed57f..3d7b1593e1 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -183,15 +183,6 @@ alfa_check_image() { return 0 } -platform_nand_board_name() { - local board=$(board_name) - - case "$board" in - rb*) echo "routerboard";; - *) echo "$board";; - esac -} - platform_check_image() { local board=$(board_name) local magic="$(get_magic_word "$1")" @@ -200,8 +191,8 @@ platform_check_image() { [ "$#" -gt 1 ] && return 1 case "$board" in - airgatewaypro|\ airgateway|\ + airgatewaypro|\ airrouter|\ ap121f|\ ap132|\ @@ -238,6 +229,7 @@ platform_check_image() { dlan-hotspot|\ dlan-pro-1200-ac|\ dlan-pro-500-wp|\ + dr342|\ dr531|\ dragino2|\ ebr-2310-c1|\ @@ -245,11 +237,12 @@ platform_check_image() { epg5000|\ esr1750|\ esr900|\ - ew-dorin-router|\ ew-dorin|\ + ew-dorin-router|\ gl-ar150|\ gl-ar300m|\ gl-ar300|\ + gl-ar750|\ gl-domino|\ gl-mifi|\ gl-usb150|\ @@ -260,14 +253,16 @@ platform_check_image() { loco-m-xw|\ mzk-w04nu|\ mzk-w300nh|\ - nanostation-m-xw|\ + n5q|\ nanostation-m|\ + nanostation-m-xw|\ nbg460n_550n_550nh|\ pqi-air-pen|\ + r36a|\ r602n|\ + rocket-m|\ rocket-m-ti|\ rocket-m-xw|\ - rocket-m|\ rw2458n|\ sc1750|\ sc300m|\ @@ -277,11 +272,12 @@ platform_check_image() { tew-712br|\ tew-732br|\ tew-823dru|\ + tl-wr1043n-v5|\ tl-wr942n-v1|\ + unifi|\ unifi-outdoor|\ unifiac-lite|\ unifiac-pro|\ - unifi|\ weio|\ whr-g301n|\ whr-hp-g300n|\ @@ -297,8 +293,8 @@ platform_check_image() { wrtnode2q|\ wzr-450hp2|\ wzr-hp-ag300h|\ - wzr-hp-g300nh2|\ wzr-hp-g300nh|\ + wzr-hp-g300nh2|\ wzr-hp-g450h|\ xd3200) [ "$magic" != "2705" ] && { @@ -310,13 +306,14 @@ platform_check_image() { ;; alfa-ap96|\ alfa-nx|\ - ap121-mini|\ ap121|\ + ap121-mini|\ ap135-020|\ ap136-010|\ ap136-020|\ ap147-010|\ ap152|\ + ap91-5g|\ ap96|\ arduino-yun|\ bhr-4grv2|\ @@ -350,14 +347,14 @@ platform_check_image() { all0305|\ eap300v2|\ eap7660d|\ - ja76pf2|\ ja76pf|\ + ja76pf2|\ jwap003|\ ls-sr71|\ pb42|\ pb44|\ - routerstation-pro|\ routerstation|\ + routerstation-pro|\ wp543|\ wpe72) [ "$magic" != "4349" ] && { @@ -392,6 +389,7 @@ platform_check_image() { onion-omega|\ oolite|\ re450|\ + rut900|\ smart-300|\ som9331|\ tellstick-znet-lite|\ @@ -400,12 +398,12 @@ platform_check_image() { tl-mr12u|\ tl-mr13u|\ tl-mr3020|\ - tl-mr3040-v2|\ tl-mr3040|\ - tl-mr3220-v2|\ + tl-mr3040-v2|\ tl-mr3220|\ - tl-mr3420-v2|\ + tl-mr3220-v2|\ tl-mr3420|\ + tl-mr3420-v2|\ tl-mr6400|\ tl-wa701nd-v2|\ tl-wa7210n-v2|\ @@ -418,10 +416,11 @@ platform_check_image() { tl-wa850re-v2|\ tl-wa855re-v1|\ tl-wa860re|\ + tl-wa901nd|\ tl-wa901nd-v2|\ tl-wa901nd-v3|\ tl-wa901nd-v4|\ - tl-wa901nd|\ + tl-wa901nd-v5|\ tl-wdr3320-v2|\ tl-wdr3500|\ tl-wdr4300|\ @@ -429,33 +428,34 @@ platform_check_image() { tl-wdr6500-v2|\ tl-wpa8630|\ tl-wr1041n-v2|\ + tl-wr1043nd|\ tl-wr1043nd-v2|\ tl-wr1043nd-v4|\ - tl-wr1043nd|\ tl-wr2543n|\ tl-wr703n|\ tl-wr710n|\ tl-wr720n-v3|\ tl-wr740n-v6|\ - tl-wr741nd-v4|\ tl-wr741nd|\ + tl-wr741nd-v4|\ tl-wr802n-v1|\ tl-wr802n-v2|\ tl-wr810n|\ + tl-wr810n-v2|\ tl-wr840n-v2|\ tl-wr840n-v3|\ - tl-wr841n-v11|\ tl-wr841n-v1|\ tl-wr841n-v7|\ tl-wr841n-v8|\ tl-wr841n-v9|\ + tl-wr841n-v11|\ tl-wr842n-v2|\ tl-wr842n-v3|\ tl-wr902ac-v1|\ - tl-wr941nd-v5|\ - tl-wr941nd-v6|\ tl-wr940n-v4|\ - tl-wr941nd) + tl-wr941nd|\ + tl-wr941nd-v5|\ + tl-wr941nd-v6) local magic_ver="0100" case "$board" in @@ -517,13 +517,14 @@ platform_check_image() { rb-911g-5hpacd|\ rb-912uag-2hpnd|\ rb-912uag-5hpnd|\ + rb-921gs-5hpacd-r2|\ rb-951g-2hnd|\ rb-951ui-2hnd|\ rb-2011l|\ rb-2011il|\ rb-2011uas|\ - rb-2011uias|\ rb-2011uas-2hnd|\ + rb-2011uias|\ rb-2011uias-2hnd|\ rb-sxt2n|\ rb-sxt5n) @@ -551,24 +552,24 @@ platform_check_image() { ;; a40|\ a60|\ - mr1750v2|\ mr1750|\ - mr600v2|\ + mr1750v2|\ mr600|\ - mr900v2|\ + mr600v2|\ mr900|\ + mr900v2|\ + om2p|\ + om2p-hs|\ om2p-hsv2|\ om2p-hsv3|\ om2p-hsv4|\ - om2p-hs|\ om2p-lc|\ om2pv2|\ om2pv4|\ - om2p|\ - om5p-acv2|\ + om5p|\ om5p-ac|\ - om5p-an|\ - om5p) + om5p-acv2|\ + om5p-an) platform_check_image_openmesh "$magic_long" "$1" && return 0 return 1 ;; @@ -664,7 +665,10 @@ platform_check_image() { rb-952ui-5ac2nd|\ rb-962uigs-5hact2hnt|\ rb-lhg-5nd|\ - rb-mapl-2nd) + rb-map-2nd|\ + rb-mapl-2nd|\ + rb-wap-2nd|\ + rb-wapg-5hact2hnd) return 0 ;; esac @@ -696,17 +700,18 @@ platform_pre_upgrade() { rb-751|\ rb-751g|\ rb-911g-2hpnd|\ - rb-911g-5hpnd|\ rb-911g-5hpacd|\ + rb-911g-5hpnd|\ rb-912uag-2hpnd|\ rb-912uag-5hpnd|\ + rb-921gs-5hpacd-r2|\ rb-951g-2hnd|\ rb-951ui-2hnd|\ rb-2011il|\ rb-2011l|\ rb-2011uas|\ - rb-2011uias|\ rb-2011uas-2hnd|\ + rb-2011uias|\ rb-2011uias-2hnd|\ rb-sxt2n|\ rb-sxt5n|\ @@ -723,7 +728,10 @@ platform_pre_upgrade() { rb-952ui-5ac2nd|\ rb-962uigs-5hact2hnt|\ rb-lhg-5nd|\ - rb-mapl-2nd) + rb-map-2nd|\ + rb-mapl-2nd|\ + rb-wap-2nd|\ + rb-wapg-5hact2hnd) # erase firmware if booted from initramfs [ -z "$(rootfs_type)" ] && mtd erase firmware ;; @@ -775,14 +783,14 @@ platform_do_upgrade() { ;; all0305|\ eap7660d|\ - ja76pf2|\ ja76pf|\ + ja76pf2|\ jwap003|\ ls-sr71|\ pb42|\ pb44|\ - routerstation-pro|\ - routerstation) + routerstation|\ + routerstation-pro) platform_do_upgrade_combined "$ARGV" ;; all0315n) @@ -799,24 +807,24 @@ platform_do_upgrade() { ;; a40|\ a60|\ - mr1750v2|\ mr1750|\ - mr600v2|\ + mr1750v2|\ mr600|\ - mr900v2|\ + mr600v2|\ mr900|\ + mr900v2|\ + om2p|\ + om2p-hs|\ om2p-hsv2|\ om2p-hsv3|\ om2p-hsv4|\ - om2p-hs|\ om2p-lc|\ om2pv2|\ om2pv4|\ - om2p|\ - om5p-acv2|\ + om5p|\ om5p-ac|\ - om5p-an|\ - om5p) + om5p-acv2|\ + om5p-an) platform_do_upgrade_openmesh "$ARGV" ;; uap-pro|\ diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index abfb127ff6..8ecf7e1355 100644 --- a/target/linux/ar71xx/config-4.4 +++ b/target/linux/ar71xx/config-4.4 @@ -22,137 +22,140 @@ CONFIG_ARCH_USE_BUILTIN_BSWAP=y CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y CONFIG_AT803X_PHY=y CONFIG_ATH79=y -CONFIG_ATH79_DEV_AP9X_PCI=y -CONFIG_ATH79_DEV_DSA=y -CONFIG_ATH79_DEV_ETH=y -CONFIG_ATH79_DEV_GPIO_BUTTONS=y -CONFIG_ATH79_DEV_LEDS_GPIO=y -CONFIG_ATH79_DEV_M25P80=y -CONFIG_ATH79_DEV_NFC=y -CONFIG_ATH79_DEV_SPI=y -CONFIG_ATH79_DEV_USB=y -CONFIG_ATH79_DEV_WMAC=y -CONFIG_ATH79_MACH_A60=y -CONFIG_ATH79_MACH_ALFA_AP120C=y -CONFIG_ATH79_MACH_ALFA_AP96=y -CONFIG_ATH79_MACH_ALFA_NX=y -CONFIG_ATH79_MACH_ALL0258N=y -CONFIG_ATH79_MACH_ALL0315N=y -CONFIG_ATH79_MACH_ANTMINER_S1=y -CONFIG_ATH79_MACH_ANTMINER_S3=y -CONFIG_ATH79_MACH_ANTROUTER_R1=y -CONFIG_ATH79_MACH_AP121=y -CONFIG_ATH79_MACH_AP121F=y -CONFIG_ATH79_MACH_AP132=y -CONFIG_ATH79_MACH_AP136=y -CONFIG_ATH79_MACH_AP143=y -CONFIG_ATH79_MACH_AP147=y -CONFIG_ATH79_MACH_AP152=y -CONFIG_ATH79_MACH_AP531B0=y +# CONFIG_ATH79_DEV_AP9X_PCI is not set +# CONFIG_ATH79_DEV_DSA is not set +# CONFIG_ATH79_DEV_ETH is not set +# CONFIG_ATH79_DEV_GPIO_BUTTONS is not set +# CONFIG_ATH79_DEV_LEDS_GPIO is not set +# CONFIG_ATH79_DEV_M25P80 is not set +# CONFIG_ATH79_DEV_SPI is not set +# CONFIG_ATH79_DEV_USB is not set +# CONFIG_ATH79_MACH_A60 is not set +# CONFIG_ATH79_MACH_ALFA_AP120C is not set +# CONFIG_ATH79_MACH_ALFA_AP96 is not set +# CONFIG_ATH79_MACH_ALFA_NX is not set +# CONFIG_ATH79_MACH_ALL0258N is not set +# CONFIG_ATH79_MACH_ALL0315N is not set +# CONFIG_ATH79_MACH_ANTMINER_S1 is not set +# CONFIG_ATH79_MACH_ANTMINER_S3 is not set +# CONFIG_ATH79_MACH_ANTROUTER_R1 is not set +# CONFIG_ATH79_MACH_AP121 is not set +# CONFIG_ATH79_MACH_AP121F is not set +# CONFIG_ATH79_MACH_AP132 is not set +# CONFIG_ATH79_MACH_AP136 is not set +# CONFIG_ATH79_MACH_AP143 is not set +# CONFIG_ATH79_MACH_AP147 is not set +# CONFIG_ATH79_MACH_AP152 is not set +# CONFIG_ATH79_MACH_AP531B0 is not set # CONFIG_ATH79_MACH_AP81 is not set -CONFIG_ATH79_MACH_AP90Q=y -CONFIG_ATH79_MACH_AP96=y -CONFIG_ATH79_MACH_ARCHER_C25_V1=y -CONFIG_ATH79_MACH_ARCHER_C58_V1=y -CONFIG_ATH79_MACH_ARCHER_C59_V1=y -CONFIG_ATH79_MACH_ARCHER_C60_V1=y -CONFIG_ATH79_MACH_ARCHER_C7=y -CONFIG_ATH79_MACH_ARDUINO_YUN=y -CONFIG_ATH79_MACH_AW_NR580=y -CONFIG_ATH79_MACH_BHR_4GRV2=y -CONFIG_ATH79_MACH_BHU_BXU2000N2_A=y -CONFIG_ATH79_MACH_BSB=y -CONFIG_ATH79_MACH_C55=y +# CONFIG_ATH79_MACH_AP90Q is not set +# CONFIG_ATH79_MACH_AP91_5G is not set +# CONFIG_ATH79_MACH_AP96 is not set +# CONFIG_ATH79_MACH_ARCHER_C25_V1 is not set +# CONFIG_ATH79_MACH_ARCHER_C58_V1 is not set +# CONFIG_ATH79_MACH_ARCHER_C59_V1 is not set +# CONFIG_ATH79_MACH_ARCHER_C60_V1 is not set +# CONFIG_ATH79_MACH_ARCHER_C7 is not set +# CONFIG_ATH79_MACH_ARDUINO_YUN is not set +# CONFIG_ATH79_MACH_AW_NR580 is not set +# CONFIG_ATH79_MACH_BHR_4GRV2 is not set +# CONFIG_ATH79_MACH_BHU_BXU2000N2_A is not set +# CONFIG_ATH79_MACH_BSB is not set +# CONFIG_ATH79_MACH_C55 is not set # CONFIG_ATH79_MACH_C60 is not set -CONFIG_ATH79_MACH_CAP324=y -CONFIG_ATH79_MACH_CAP4200AG=y -CONFIG_ATH79_MACH_CARAMBOLA2=y -CONFIG_ATH79_MACH_CF_E316N_V2=y -CONFIG_ATH79_MACH_CF_E320N_V2=y -CONFIG_ATH79_MACH_CF_E355AC=y -CONFIG_ATH79_MACH_CF_E380AC_V1=y -CONFIG_ATH79_MACH_CF_E380AC_V2=y -CONFIG_ATH79_MACH_CF_E520N=y -CONFIG_ATH79_MACH_CF_E530N=y -CONFIG_ATH79_MACH_CPE505N=y -CONFIG_ATH79_MACH_CPE510=y -CONFIG_ATH79_MACH_CPE830=y -CONFIG_ATH79_MACH_CPE870=y -CONFIG_ATH79_MACH_CR3000=y -CONFIG_ATH79_MACH_CR5000=y -CONFIG_ATH79_MACH_DAP_2695_A1=y -CONFIG_ATH79_MACH_DB120=y -CONFIG_ATH79_MACH_DGL_5500_A1=y -CONFIG_ATH79_MACH_DHP_1565_A1=y -CONFIG_ATH79_MACH_DIR_505_A1=y -CONFIG_ATH79_MACH_DIR_600_A1=y -CONFIG_ATH79_MACH_DIR_615_C1=y -CONFIG_ATH79_MACH_DIR_615_I1=y -CONFIG_ATH79_MACH_DIR_825_B1=y -CONFIG_ATH79_MACH_DIR_825_C1=y -CONFIG_ATH79_MACH_DIR_869_A1=y -CONFIG_ATH79_MACH_DLAN_HOTSPOT=y -CONFIG_ATH79_MACH_DLAN_PRO_1200_AC=y -CONFIG_ATH79_MACH_DLAN_PRO_500_WP=y +# CONFIG_ATH79_MACH_CAP324 is not set +# CONFIG_ATH79_MACH_CAP4200AG is not set +# CONFIG_ATH79_MACH_CARAMBOLA2 is not set +# CONFIG_ATH79_MACH_CF_E316N_V2 is not set +# CONFIG_ATH79_MACH_CF_E320N_V2 is not set +# CONFIG_ATH79_MACH_CF_E355AC is not set +# CONFIG_ATH79_MACH_CF_E380AC_V1 is not set +# CONFIG_ATH79_MACH_CF_E380AC_V2 is not set +# CONFIG_ATH79_MACH_CF_E520N is not set +# CONFIG_ATH79_MACH_CF_E530N is not set +# CONFIG_ATH79_MACH_CPE505N is not set +# CONFIG_ATH79_MACH_CPE510 is not set +# CONFIG_ATH79_MACH_CPE830 is not set +# CONFIG_ATH79_MACH_CPE870 is not set +# CONFIG_ATH79_MACH_CR3000 is not set +# CONFIG_ATH79_MACH_CR5000 is not set +# CONFIG_ATH79_MACH_DAP_2695_A1 is not set +# CONFIG_ATH79_MACH_DB120 is not set +# CONFIG_ATH79_MACH_DGL_5500_A1 is not set +# CONFIG_ATH79_MACH_DHP_1565_A1 is not set +# CONFIG_ATH79_MACH_DIR_505_A1 is not set +# CONFIG_ATH79_MACH_DIR_600_A1 is not set +# CONFIG_ATH79_MACH_DIR_615_C1 is not set +# CONFIG_ATH79_MACH_DIR_615_I1 is not set +# CONFIG_ATH79_MACH_DIR_825_B1 is not set +# CONFIG_ATH79_MACH_DIR_825_C1 is not set +# CONFIG_ATH79_MACH_DIR_869_A1 is not set +# CONFIG_ATH79_MACH_DLAN_HOTSPOT is not set +# CONFIG_ATH79_MACH_DLAN_PRO_1200_AC is not set +# CONFIG_ATH79_MACH_DLAN_PRO_500_WP is not set # CONFIG_ATH79_MACH_DOMYWIFI_DW33D is not set -CONFIG_ATH79_MACH_DR344=y -CONFIG_ATH79_MACH_DR531=y -CONFIG_ATH79_MACH_DRAGINO2=y -CONFIG_ATH79_MACH_E2100L=y -CONFIG_ATH79_MACH_EAP120=y -CONFIG_ATH79_MACH_EAP300V2=y -CONFIG_ATH79_MACH_EAP7660D=y -CONFIG_ATH79_MACH_EL_M150=y -CONFIG_ATH79_MACH_EL_MINI=y -CONFIG_ATH79_MACH_ENS202EXT=y -CONFIG_ATH79_MACH_EPG5000=y -CONFIG_ATH79_MACH_ESR1750=y -CONFIG_ATH79_MACH_ESR900=y -CONFIG_ATH79_MACH_EW_DORIN=y -CONFIG_ATH79_MACH_F9K1115V2=y -CONFIG_ATH79_MACH_FRITZ300E=y -CONFIG_ATH79_MACH_GL_AR150=y -CONFIG_ATH79_MACH_GL_AR300=y -CONFIG_ATH79_MACH_GL_AR300M=y -CONFIG_ATH79_MACH_GL_DOMINO=y -CONFIG_ATH79_MACH_GL_INET=y -CONFIG_ATH79_MACH_GL_MIFI=y -CONFIG_ATH79_MACH_GL_USB150=y -CONFIG_ATH79_MACH_GS_MINIBOX_V1=y -CONFIG_ATH79_MACH_GS_OOLITE=y +# CONFIG_ATH79_MACH_DR342 is not set +# CONFIG_ATH79_MACH_DR344 is not set +# CONFIG_ATH79_MACH_DR531 is not set +# CONFIG_ATH79_MACH_DRAGINO2 is not set +# CONFIG_ATH79_MACH_E2100L is not set +# CONFIG_ATH79_MACH_EAP120 is not set +# CONFIG_ATH79_MACH_EAP300V2 is not set +# CONFIG_ATH79_MACH_EAP7660D is not set +# CONFIG_ATH79_MACH_EL_M150 is not set +# CONFIG_ATH79_MACH_EL_MINI is not set +# CONFIG_ATH79_MACH_ENS202EXT is not set +# CONFIG_ATH79_MACH_EPG5000 is not set +# CONFIG_ATH79_MACH_ESR1750 is not set +# CONFIG_ATH79_MACH_ESR900 is not set +# CONFIG_ATH79_MACH_EW_DORIN is not set +# CONFIG_ATH79_MACH_F9K1115V2 is not set +# CONFIG_ATH79_MACH_FRITZ300E is not set +# CONFIG_ATH79_MACH_GL_AR150 is not set +# CONFIG_ATH79_MACH_GL_AR300 is not set +# CONFIG_ATH79_MACH_GL_AR300M is not set +# CONFIG_ATH79_MACH_GL_AR750 is not set +# CONFIG_ATH79_MACH_GL_DOMINO is not set +# CONFIG_ATH79_MACH_GL_INET is not set +# CONFIG_ATH79_MACH_GL_MIFI is not set +# CONFIG_ATH79_MACH_GL_USB150 is not set +# CONFIG_ATH79_MACH_GS_MINIBOX_V1 is not set +# CONFIG_ATH79_MACH_GS_OOLITE is not set # CONFIG_ATH79_MACH_HIVEAP_121 is not set -CONFIG_ATH79_MACH_HIWIFI_HC6361=y -CONFIG_ATH79_MACH_HORNET_UB=y -CONFIG_ATH79_MACH_JA76PF=y -CONFIG_ATH79_MACH_JWAP003=y -CONFIG_ATH79_MACH_JWAP230=y -CONFIG_ATH79_MACH_LIMA=y -CONFIG_ATH79_MACH_MC_MAC1200R=y -CONFIG_ATH79_MACH_MR12=y -CONFIG_ATH79_MACH_MR16=y -CONFIG_ATH79_MACH_MR1750=y +# CONFIG_ATH79_MACH_HIWIFI_HC6361 is not set +# CONFIG_ATH79_MACH_HORNET_UB is not set +# CONFIG_ATH79_MACH_JA76PF is not set +# CONFIG_ATH79_MACH_JWAP003 is not set +# CONFIG_ATH79_MACH_JWAP230 is not set +# CONFIG_ATH79_MACH_LIMA is not set +# CONFIG_ATH79_MACH_MC_MAC1200R is not set +# CONFIG_ATH79_MACH_MR12 is not set +# CONFIG_ATH79_MACH_MR16 is not set +# CONFIG_ATH79_MACH_MR1750 is not set # CONFIG_ATH79_MACH_MR18 is not set -CONFIG_ATH79_MACH_MR600=y -CONFIG_ATH79_MACH_MR900=y -CONFIG_ATH79_MACH_MYNET_N600=y -CONFIG_ATH79_MACH_MYNET_N750=y -CONFIG_ATH79_MACH_MYNET_REXT=y -CONFIG_ATH79_MACH_MZK_W04NU=y -CONFIG_ATH79_MACH_MZK_W300NH=y -CONFIG_ATH79_MACH_NBG460N=y -CONFIG_ATH79_MACH_NBG6716=y -CONFIG_ATH79_MACH_OM2P=y -CONFIG_ATH79_MACH_OM5P=y -CONFIG_ATH79_MACH_OM5P_AC=y -CONFIG_ATH79_MACH_OM5P_ACv2=y -CONFIG_ATH79_MACH_OMY_G1=y -CONFIG_ATH79_MACH_OMY_X1=y -CONFIG_ATH79_MACH_ONION_OMEGA=y -CONFIG_ATH79_MACH_PB42=y -CONFIG_ATH79_MACH_PB44=y -CONFIG_ATH79_MACH_PQI_AIR_PEN=y -CONFIG_ATH79_MACH_QIHOO_C301=y -CONFIG_ATH79_MACH_R602N=y +# CONFIG_ATH79_MACH_MR600 is not set +# CONFIG_ATH79_MACH_MR900 is not set +# CONFIG_ATH79_MACH_MYNET_N600 is not set +# CONFIG_ATH79_MACH_MYNET_N750 is not set +# CONFIG_ATH79_MACH_MYNET_REXT is not set +# CONFIG_ATH79_MACH_MZK_W04NU is not set +# CONFIG_ATH79_MACH_MZK_W300NH is not set +# CONFIG_ATH79_MACH_N5Q is not set +# CONFIG_ATH79_MACH_NBG460N is not set +# CONFIG_ATH79_MACH_NBG6716 is not set +# CONFIG_ATH79_MACH_OM2P is not set +# CONFIG_ATH79_MACH_OM5P is not set +# CONFIG_ATH79_MACH_OM5P_AC is not set +# CONFIG_ATH79_MACH_OM5P_ACv2 is not set +# CONFIG_ATH79_MACH_OMY_G1 is not set +# CONFIG_ATH79_MACH_OMY_X1 is not set +# CONFIG_ATH79_MACH_ONION_OMEGA is not set +# CONFIG_ATH79_MACH_PB42 is not set +# CONFIG_ATH79_MACH_PB44 is not set +# CONFIG_ATH79_MACH_PQI_AIR_PEN is not set +# CONFIG_ATH79_MACH_QIHOO_C301 is not set +# CONFIG_ATH79_MACH_R36A is not set +# CONFIG_ATH79_MACH_R602N is not set # CONFIG_ATH79_MACH_R6100 is not set # CONFIG_ATH79_MACH_RAMBUTAN is not set # CONFIG_ATH79_MACH_RB2011 is not set @@ -163,98 +166,101 @@ CONFIG_ATH79_MACH_R602N=y # CONFIG_ATH79_MACH_RB95X is not set # CONFIG_ATH79_MACH_RBSPI is not set # CONFIG_ATH79_MACH_RBSXTLITE is not set -CONFIG_ATH79_MACH_RE450=y -CONFIG_ATH79_MACH_RW2458N=y -CONFIG_ATH79_MACH_SC1750=y -CONFIG_ATH79_MACH_SC300M=y -CONFIG_ATH79_MACH_SC450=y -CONFIG_ATH79_MACH_SMART_300=y -CONFIG_ATH79_MACH_SOM9331=y -CONFIG_ATH79_MACH_SR3200=y -CONFIG_ATH79_MACH_TELLSTICK_ZNET_LITE=y -CONFIG_ATH79_MACH_TEW_632BRP=y -CONFIG_ATH79_MACH_TEW_673GRU=y -CONFIG_ATH79_MACH_TEW_712BR=y -CONFIG_ATH79_MACH_TEW_732BR=y -CONFIG_ATH79_MACH_TEW_823DRU=y -CONFIG_ATH79_MACH_TL_MR11U=y -CONFIG_ATH79_MACH_TL_MR13U=y -CONFIG_ATH79_MACH_TL_MR3020=y -CONFIG_ATH79_MACH_TL_MR3X20=y -CONFIG_ATH79_MACH_TL_MR6400=y -CONFIG_ATH79_MACH_TL_WA701ND_V2=y -CONFIG_ATH79_MACH_TL_WA7210N_V2=y -CONFIG_ATH79_MACH_TL_WA801ND_V3=y -CONFIG_ATH79_MACH_TL_WA830RE_V2=y -CONFIG_ATH79_MACH_TL_WA850RE_V2=y -CONFIG_ATH79_MACH_TL_WA855RE_V1=y -CONFIG_ATH79_MACH_TL_WA901ND=y -CONFIG_ATH79_MACH_TL_WA901ND_V2=y -CONFIG_ATH79_MACH_TL_WA901ND_V4=y -CONFIG_ATH79_MACH_TL_WAX50RE=y -CONFIG_ATH79_MACH_TL_WDR3320_V2=y -CONFIG_ATH79_MACH_TL_WDR3500=y -CONFIG_ATH79_MACH_TL_WDR4300=y -CONFIG_ATH79_MACH_TL_WDR6500_V2=y -CONFIG_ATH79_MACH_TL_WPA8630=y -CONFIG_ATH79_MACH_TL_WR1041N_V2=y -CONFIG_ATH79_MACH_TL_WR1043ND=y -CONFIG_ATH79_MACH_TL_WR1043ND_V2=y -CONFIG_ATH79_MACH_TL_WR1043ND_V4=y -CONFIG_ATH79_MACH_TL_WR2543N=y -CONFIG_ATH79_MACH_TL_WR703N=y -CONFIG_ATH79_MACH_TL_WR720N_V3=y -CONFIG_ATH79_MACH_TL_WR741ND=y -CONFIG_ATH79_MACH_TL_WR741ND_V4=y -CONFIG_ATH79_MACH_TL_WR802N_V1=y -CONFIG_ATH79_MACH_TL_WR802N_V2=y -CONFIG_ATH79_MACH_TL_WR810N=y -CONFIG_ATH79_MACH_TL_WR840N_V2=y -CONFIG_ATH79_MACH_TL_WR841N_V1=y -CONFIG_ATH79_MACH_TL_WR841N_V8=y -CONFIG_ATH79_MACH_TL_WR841N_V9=y -CONFIG_ATH79_MACH_TL_WR902AC_V1=y -CONFIG_ATH79_MACH_TL_WR940N_V4=y -CONFIG_ATH79_MACH_TL_WR941ND=y -CONFIG_ATH79_MACH_TL_WR941ND_V6=y -CONFIG_ATH79_MACH_TL_WR942N_V1=y -CONFIG_ATH79_MACH_TUBE2H=y -CONFIG_ATH79_MACH_UBNT=y -CONFIG_ATH79_MACH_UBNT_UNIFIAC=y -CONFIG_ATH79_MACH_UBNT_XM=y -CONFIG_ATH79_MACH_WEIO=y +# CONFIG_ATH79_MACH_RE450 is not set +# CONFIG_ATH79_MACH_RUT9XX is not set +# CONFIG_ATH79_MACH_RW2458N is not set +# CONFIG_ATH79_MACH_SC1750 is not set +# CONFIG_ATH79_MACH_SC300M is not set +# CONFIG_ATH79_MACH_SC450 is not set +# CONFIG_ATH79_MACH_SMART_300 is not set +# CONFIG_ATH79_MACH_SOM9331 is not set +# CONFIG_ATH79_MACH_SR3200 is not set +# CONFIG_ATH79_MACH_TELLSTICK_ZNET_LITE is not set +# CONFIG_ATH79_MACH_TEW_632BRP is not set +# CONFIG_ATH79_MACH_TEW_673GRU is not set +# CONFIG_ATH79_MACH_TEW_712BR is not set +# CONFIG_ATH79_MACH_TEW_732BR is not set +# CONFIG_ATH79_MACH_TEW_823DRU is not set +# CONFIG_ATH79_MACH_TL_MR11U is not set +# CONFIG_ATH79_MACH_TL_MR13U is not set +# CONFIG_ATH79_MACH_TL_MR3020 is not set +# CONFIG_ATH79_MACH_TL_MR3X20 is not set +# CONFIG_ATH79_MACH_TL_MR6400 is not set +# CONFIG_ATH79_MACH_TL_WA701ND_V2 is not set +# CONFIG_ATH79_MACH_TL_WA7210N_V2 is not set +# CONFIG_ATH79_MACH_TL_WA801ND_V3 is not set +# CONFIG_ATH79_MACH_TL_WA830RE_V2 is not set +# CONFIG_ATH79_MACH_TL_WA850RE_V2 is not set +# CONFIG_ATH79_MACH_TL_WA855RE_V1 is not set +# CONFIG_ATH79_MACH_TL_WA901ND is not set +# CONFIG_ATH79_MACH_TL_WA901ND_V2 is not set +# CONFIG_ATH79_MACH_TL_WA901ND_V4 is not set +# CONFIG_ATH79_MACH_TL_WAX50RE is not set +# CONFIG_ATH79_MACH_TL_WDR3320_V2 is not set +# CONFIG_ATH79_MACH_TL_WDR3500 is not set +# CONFIG_ATH79_MACH_TL_WDR4300 is not set +# CONFIG_ATH79_MACH_TL_WDR6500_V2 is not set +# CONFIG_ATH79_MACH_TL_WPA8630 is not set +# CONFIG_ATH79_MACH_TL_WR1041N_V2 is not set +# CONFIG_ATH79_MACH_TL_WR1043ND is not set +# CONFIG_ATH79_MACH_TL_WR1043ND_V2 is not set +# CONFIG_ATH79_MACH_TL_WR1043ND_V4 is not set +# CONFIG_ATH79_MACH_TL_WR1043N_V5 is not set +# CONFIG_ATH79_MACH_TL_WR2543N is not set +# CONFIG_ATH79_MACH_TL_WR703N is not set +# CONFIG_ATH79_MACH_TL_WR720N_V3 is not set +# CONFIG_ATH79_MACH_TL_WR741ND is not set +# CONFIG_ATH79_MACH_TL_WR741ND_V4 is not set +# CONFIG_ATH79_MACH_TL_WR802N_V1 is not set +# CONFIG_ATH79_MACH_TL_WR802N_V2 is not set +# CONFIG_ATH79_MACH_TL_WR810N is not set +# CONFIG_ATH79_MACH_TL_WR810N_V2 is not set +# CONFIG_ATH79_MACH_TL_WR840N_V2 is not set +# CONFIG_ATH79_MACH_TL_WR841N_V1 is not set +# CONFIG_ATH79_MACH_TL_WR841N_V8 is not set +# CONFIG_ATH79_MACH_TL_WR841N_V9 is not set +# CONFIG_ATH79_MACH_TL_WR902AC_V1 is not set +# CONFIG_ATH79_MACH_TL_WR940N_V4 is not set +# CONFIG_ATH79_MACH_TL_WR941ND is not set +# CONFIG_ATH79_MACH_TL_WR941ND_V6 is not set +# CONFIG_ATH79_MACH_TL_WR942N_V1 is not set +# CONFIG_ATH79_MACH_TUBE2H is not set +# CONFIG_ATH79_MACH_UBNT is not set +# CONFIG_ATH79_MACH_UBNT_UNIFIAC is not set +# CONFIG_ATH79_MACH_UBNT_XM is not set +# CONFIG_ATH79_MACH_WEIO is not set +# CONFIG_ATH79_MACH_WHR_HP_G300N is not set # CONFIG_ATH79_MACH_WI2A_AC200I is not set -CONFIG_ATH79_MACH_WHR_HP_G300N=y -CONFIG_ATH79_MACH_WLAE_AG300N=y -CONFIG_ATH79_MACH_WLR8100=y -CONFIG_ATH79_MACH_WNDAP360=y -CONFIG_ATH79_MACH_WNDR3700=y +# CONFIG_ATH79_MACH_WLAE_AG300N is not set +# CONFIG_ATH79_MACH_WLR8100 is not set +# CONFIG_ATH79_MACH_WNDAP360 is not set +# CONFIG_ATH79_MACH_WNDR3700 is not set # CONFIG_ATH79_MACH_WNDR4300 is not set -CONFIG_ATH79_MACH_WNR2000=y -CONFIG_ATH79_MACH_WNR2000_V3=y -CONFIG_ATH79_MACH_WNR2000_V4=y -CONFIG_ATH79_MACH_WNR2200=y -CONFIG_ATH79_MACH_WP543=y -CONFIG_ATH79_MACH_WPE72=y -CONFIG_ATH79_MACH_WPJ342=y -CONFIG_ATH79_MACH_WPJ344=y -CONFIG_ATH79_MACH_WPJ531=y -CONFIG_ATH79_MACH_WPJ558=y -CONFIG_ATH79_MACH_WPJ563=y -CONFIG_ATH79_MACH_WRT160NL=y -CONFIG_ATH79_MACH_WRT400N=y -CONFIG_ATH79_MACH_WRTNODE2Q=y -CONFIG_ATH79_MACH_WZR_450HP2=y -CONFIG_ATH79_MACH_WZR_HP_AG300H=y -CONFIG_ATH79_MACH_WZR_HP_G300NH=y -CONFIG_ATH79_MACH_WZR_HP_G300NH2=y -CONFIG_ATH79_MACH_WZR_HP_G450H=y -CONFIG_ATH79_MACH_XD3200=y +# CONFIG_ATH79_MACH_WNR2000 is not set +# CONFIG_ATH79_MACH_WNR2000_V3 is not set +# CONFIG_ATH79_MACH_WNR2000_V4 is not set +# CONFIG_ATH79_MACH_WNR2200 is not set +# CONFIG_ATH79_MACH_WP543 is not set +# CONFIG_ATH79_MACH_WPE72 is not set +# CONFIG_ATH79_MACH_WPJ342 is not set +# CONFIG_ATH79_MACH_WPJ344 is not set +# CONFIG_ATH79_MACH_WPJ531 is not set +# CONFIG_ATH79_MACH_WPJ558 is not set +# CONFIG_ATH79_MACH_WPJ563 is not set +# CONFIG_ATH79_MACH_WRT160NL is not set +# CONFIG_ATH79_MACH_WRT400N is not set +# CONFIG_ATH79_MACH_WRTNODE2Q is not set +# CONFIG_ATH79_MACH_WZR_450HP2 is not set +# CONFIG_ATH79_MACH_WZR_HP_AG300H is not set +# CONFIG_ATH79_MACH_WZR_HP_G300NH is not set +# CONFIG_ATH79_MACH_WZR_HP_G300NH2 is not set +# CONFIG_ATH79_MACH_WZR_HP_G450H is not set +# CONFIG_ATH79_MACH_XD3200 is not set # CONFIG_ATH79_MACH_Z1 is not set -CONFIG_ATH79_MACH_ZBT_WE1526=y -CONFIG_ATH79_MACH_ZCN_1523H=y -CONFIG_ATH79_NVRAM=y -CONFIG_ATH79_PCI_ATH9K_FIXUP=y +# CONFIG_ATH79_MACH_ZBT_WE1526 is not set +# CONFIG_ATH79_MACH_ZCN_1523H is not set +# CONFIG_ATH79_NVRAM is not set +# CONFIG_ATH79_PCI_ATH9K_FIXUP is not set # CONFIG_ATH79_ROUTERBOOT is not set CONFIG_ATH79_WDT=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y @@ -343,7 +349,6 @@ CONFIG_HAVE_OPROFILE=y CONFIG_HAVE_PERF_EVENTS=y CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y -CONFIG_HW_HAS_PCI=y CONFIG_HZ_PERIODIC=y CONFIG_I2C=y CONFIG_I2C_ALGOBIT=y @@ -361,7 +366,6 @@ CONFIG_IRQ_MIPS_CPU=y CONFIG_IRQ_WORK=y CONFIG_LANTIQ_PHY=y CONFIG_LEDS_GPIO=y -# CONFIG_LEDS_WNDR3700_USB is not set CONFIG_LIBFDT=y CONFIG_MARVELL_PHY=y CONFIG_MDIO_BITBANG=y @@ -404,7 +408,6 @@ CONFIG_MTD_SPLIT_TPLINK_FW=y CONFIG_MTD_SPLIT_UIMAGE_FW=y CONFIG_MTD_SPLIT_WRGG_FW=y CONFIG_MTD_TPLINK_PARTS=y -CONFIG_MYLOADER=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_PER_CPU_KM=y CONFIG_NET_DSA=y @@ -412,11 +415,9 @@ CONFIG_NET_DSA_MV88E6060=y CONFIG_NET_DSA_MV88E6063=y CONFIG_NET_DSA_TAG_TRAILER=y CONFIG_NET_SWITCHDEV=y -CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y # CONFIG_NO_IOPORT_MAP is not set CONFIG_OF=y CONFIG_OF_ADDRESS=y -CONFIG_OF_ADDRESS_PCI=y CONFIG_OF_EARLY_FLATTREE=y CONFIG_OF_FLATTREE=y CONFIG_OF_GPIO=y @@ -424,12 +425,7 @@ CONFIG_OF_IRQ=y CONFIG_OF_MDIO=y CONFIG_OF_MTD=y CONFIG_OF_NET=y -CONFIG_OF_PCI=y -CONFIG_OF_PCI_IRQ=y -CONFIG_PCI=y -CONFIG_PCI_AR724X=y -CONFIG_PCI_DISABLE_COMMON_QUIRKS=y -CONFIG_PCI_DOMAINS=y +# CONFIG_PCI_AR724X is not set CONFIG_PERF_USE_VMALLOC=y CONFIG_PGTABLE_LEVELS=2 CONFIG_PHYLIB=y @@ -445,17 +441,14 @@ CONFIG_RTL8367_PHY=y # CONFIG_SERIAL_8250_FSL is not set CONFIG_SERIAL_8250_NR_UARTS=1 CONFIG_SERIAL_8250_RUNTIME_UARTS=1 -CONFIG_SERIAL_AR933X=y -CONFIG_SERIAL_AR933X_CONSOLE=y -CONFIG_SERIAL_AR933X_NR_UARTS=2 -CONFIG_SOC_AR71XX=y -CONFIG_SOC_AR724X=y -CONFIG_SOC_AR913X=y -CONFIG_SOC_AR933X=y -CONFIG_SOC_AR934X=y -CONFIG_SOC_QCA953X=y -CONFIG_SOC_QCA955X=y -CONFIG_SOC_QCA956X=y +# CONFIG_SOC_AR71XX is not set +# CONFIG_SOC_AR724X is not set +# CONFIG_SOC_AR913X is not set +# CONFIG_SOC_AR933X is not set +# CONFIG_SOC_AR934X is not set +# CONFIG_SOC_QCA953X is not set +# CONFIG_SOC_QCA955X is not set +# CONFIG_SOC_QCA956X is not set CONFIG_SPI=y CONFIG_SPI_ATH79=y CONFIG_SPI_BITBANG=y @@ -478,4 +471,3 @@ CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y CONFIG_ZONE_DMA_FLAG=0 -CONFIG_MIPS_FPU_EMULATOR=y diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9 index 6359b3ca2c..0e224ae1c4 100644 --- a/target/linux/ar71xx/config-4.9 +++ b/target/linux/ar71xx/config-4.9 @@ -20,137 +20,140 @@ CONFIG_ARCH_USE_BUILTIN_BSWAP=y CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y CONFIG_AT803X_PHY=y CONFIG_ATH79=y -CONFIG_ATH79_DEV_AP9X_PCI=y -CONFIG_ATH79_DEV_DSA=y -CONFIG_ATH79_DEV_ETH=y -CONFIG_ATH79_DEV_GPIO_BUTTONS=y -CONFIG_ATH79_DEV_LEDS_GPIO=y -CONFIG_ATH79_DEV_M25P80=y -CONFIG_ATH79_DEV_NFC=y -CONFIG_ATH79_DEV_SPI=y -CONFIG_ATH79_DEV_USB=y -CONFIG_ATH79_DEV_WMAC=y -CONFIG_ATH79_MACH_A60=y -CONFIG_ATH79_MACH_ALFA_AP120C=y -CONFIG_ATH79_MACH_ALFA_AP96=y -CONFIG_ATH79_MACH_ALFA_NX=y -CONFIG_ATH79_MACH_ALL0258N=y -CONFIG_ATH79_MACH_ALL0315N=y -CONFIG_ATH79_MACH_ANTMINER_S1=y -CONFIG_ATH79_MACH_ANTMINER_S3=y -CONFIG_ATH79_MACH_ANTROUTER_R1=y -CONFIG_ATH79_MACH_AP121=y -CONFIG_ATH79_MACH_AP121F=y -CONFIG_ATH79_MACH_AP132=y -CONFIG_ATH79_MACH_AP136=y -CONFIG_ATH79_MACH_AP143=y -CONFIG_ATH79_MACH_AP147=y -CONFIG_ATH79_MACH_AP152=y -CONFIG_ATH79_MACH_AP531B0=y +# CONFIG_ATH79_DEV_AP9X_PCI is not set +# CONFIG_ATH79_DEV_DSA is not set +# CONFIG_ATH79_DEV_ETH is not set +# CONFIG_ATH79_DEV_GPIO_BUTTONS is not set +# CONFIG_ATH79_DEV_LEDS_GPIO is not set +# CONFIG_ATH79_DEV_M25P80 is not set +# CONFIG_ATH79_DEV_SPI is not set +# CONFIG_ATH79_DEV_USB is not set +# CONFIG_ATH79_MACH_A60 is not set +# CONFIG_ATH79_MACH_ALFA_AP120C is not set +# CONFIG_ATH79_MACH_ALFA_AP96 is not set +# CONFIG_ATH79_MACH_ALFA_NX is not set +# CONFIG_ATH79_MACH_ALL0258N is not set +# CONFIG_ATH79_MACH_ALL0315N is not set +# CONFIG_ATH79_MACH_ANTMINER_S1 is not set +# CONFIG_ATH79_MACH_ANTMINER_S3 is not set +# CONFIG_ATH79_MACH_ANTROUTER_R1 is not set +# CONFIG_ATH79_MACH_AP121 is not set +# CONFIG_ATH79_MACH_AP121F is not set +# CONFIG_ATH79_MACH_AP132 is not set +# CONFIG_ATH79_MACH_AP136 is not set +# CONFIG_ATH79_MACH_AP143 is not set +# CONFIG_ATH79_MACH_AP147 is not set +# CONFIG_ATH79_MACH_AP152 is not set +# CONFIG_ATH79_MACH_AP531B0 is not set # CONFIG_ATH79_MACH_AP81 is not set -CONFIG_ATH79_MACH_AP90Q=y -CONFIG_ATH79_MACH_AP96=y -CONFIG_ATH79_MACH_ARCHER_C25_V1=y -CONFIG_ATH79_MACH_ARCHER_C58_V1=y -CONFIG_ATH79_MACH_ARCHER_C59_V1=y -CONFIG_ATH79_MACH_ARCHER_C60_V1=y -CONFIG_ATH79_MACH_ARCHER_C7=y -CONFIG_ATH79_MACH_ARDUINO_YUN=y -CONFIG_ATH79_MACH_AW_NR580=y -CONFIG_ATH79_MACH_BHR_4GRV2=y -CONFIG_ATH79_MACH_BHU_BXU2000N2_A=y -CONFIG_ATH79_MACH_BSB=y -CONFIG_ATH79_MACH_C55=y +# CONFIG_ATH79_MACH_AP90Q is not set +# CONFIG_ATH79_MACH_AP91_5G is not set +# CONFIG_ATH79_MACH_AP96 is not set +# CONFIG_ATH79_MACH_ARCHER_C25_V1 is not set +# CONFIG_ATH79_MACH_ARCHER_C58_V1 is not set +# CONFIG_ATH79_MACH_ARCHER_C59_V1 is not set +# CONFIG_ATH79_MACH_ARCHER_C60_V1 is not set +# CONFIG_ATH79_MACH_ARCHER_C7 is not set +# CONFIG_ATH79_MACH_ARDUINO_YUN is not set +# CONFIG_ATH79_MACH_AW_NR580 is not set +# CONFIG_ATH79_MACH_BHR_4GRV2 is not set +# CONFIG_ATH79_MACH_BHU_BXU2000N2_A is not set +# CONFIG_ATH79_MACH_BSB is not set +# CONFIG_ATH79_MACH_C55 is not set # CONFIG_ATH79_MACH_C60 is not set -CONFIG_ATH79_MACH_CAP324=y -CONFIG_ATH79_MACH_CAP4200AG=y -CONFIG_ATH79_MACH_CARAMBOLA2=y -CONFIG_ATH79_MACH_CF_E316N_V2=y -CONFIG_ATH79_MACH_CF_E320N_V2=y -CONFIG_ATH79_MACH_CF_E355AC=y -CONFIG_ATH79_MACH_CF_E380AC_V1=y -CONFIG_ATH79_MACH_CF_E380AC_V2=y -CONFIG_ATH79_MACH_CF_E520N=y -CONFIG_ATH79_MACH_CF_E530N=y -CONFIG_ATH79_MACH_CPE505N=y -CONFIG_ATH79_MACH_CPE510=y -CONFIG_ATH79_MACH_CPE830=y -CONFIG_ATH79_MACH_CPE870=y -CONFIG_ATH79_MACH_CR3000=y -CONFIG_ATH79_MACH_CR5000=y -CONFIG_ATH79_MACH_DAP_2695_A1=y -CONFIG_ATH79_MACH_DB120=y -CONFIG_ATH79_MACH_DGL_5500_A1=y -CONFIG_ATH79_MACH_DHP_1565_A1=y -CONFIG_ATH79_MACH_DIR_505_A1=y -CONFIG_ATH79_MACH_DIR_600_A1=y -CONFIG_ATH79_MACH_DIR_615_C1=y -CONFIG_ATH79_MACH_DIR_615_I1=y -CONFIG_ATH79_MACH_DIR_825_B1=y -CONFIG_ATH79_MACH_DIR_825_C1=y -CONFIG_ATH79_MACH_DIR_869_A1=y -CONFIG_ATH79_MACH_DLAN_HOTSPOT=y -CONFIG_ATH79_MACH_DLAN_PRO_1200_AC=y -CONFIG_ATH79_MACH_DLAN_PRO_500_WP=y +# CONFIG_ATH79_MACH_CAP324 is not set +# CONFIG_ATH79_MACH_CAP4200AG is not set +# CONFIG_ATH79_MACH_CARAMBOLA2 is not set +# CONFIG_ATH79_MACH_CF_E316N_V2 is not set +# CONFIG_ATH79_MACH_CF_E320N_V2 is not set +# CONFIG_ATH79_MACH_CF_E355AC is not set +# CONFIG_ATH79_MACH_CF_E380AC_V1 is not set +# CONFIG_ATH79_MACH_CF_E380AC_V2 is not set +# CONFIG_ATH79_MACH_CF_E520N is not set +# CONFIG_ATH79_MACH_CF_E530N is not set +# CONFIG_ATH79_MACH_CPE505N is not set +# CONFIG_ATH79_MACH_CPE510 is not set +# CONFIG_ATH79_MACH_CPE830 is not set +# CONFIG_ATH79_MACH_CPE870 is not set +# CONFIG_ATH79_MACH_CR3000 is not set +# CONFIG_ATH79_MACH_CR5000 is not set +# CONFIG_ATH79_MACH_DAP_2695_A1 is not set +# CONFIG_ATH79_MACH_DB120 is not set +# CONFIG_ATH79_MACH_DGL_5500_A1 is not set +# CONFIG_ATH79_MACH_DHP_1565_A1 is not set +# CONFIG_ATH79_MACH_DIR_505_A1 is not set +# CONFIG_ATH79_MACH_DIR_600_A1 is not set +# CONFIG_ATH79_MACH_DIR_615_C1 is not set +# CONFIG_ATH79_MACH_DIR_615_I1 is not set +# CONFIG_ATH79_MACH_DIR_825_B1 is not set +# CONFIG_ATH79_MACH_DIR_825_C1 is not set +# CONFIG_ATH79_MACH_DIR_869_A1 is not set +# CONFIG_ATH79_MACH_DLAN_HOTSPOT is not set +# CONFIG_ATH79_MACH_DLAN_PRO_1200_AC is not set +# CONFIG_ATH79_MACH_DLAN_PRO_500_WP is not set # CONFIG_ATH79_MACH_DOMYWIFI_DW33D is not set -CONFIG_ATH79_MACH_DR344=y -CONFIG_ATH79_MACH_DR531=y -CONFIG_ATH79_MACH_DRAGINO2=y -CONFIG_ATH79_MACH_E2100L=y -CONFIG_ATH79_MACH_EAP120=y -CONFIG_ATH79_MACH_EAP300V2=y -CONFIG_ATH79_MACH_EAP7660D=y -CONFIG_ATH79_MACH_EL_M150=y -CONFIG_ATH79_MACH_EL_MINI=y -CONFIG_ATH79_MACH_ENS202EXT=y -CONFIG_ATH79_MACH_EPG5000=y -CONFIG_ATH79_MACH_ESR1750=y -CONFIG_ATH79_MACH_ESR900=y -CONFIG_ATH79_MACH_EW_DORIN=y -CONFIG_ATH79_MACH_F9K1115V2=y -CONFIG_ATH79_MACH_FRITZ300E=y -CONFIG_ATH79_MACH_GL_AR150=y -CONFIG_ATH79_MACH_GL_AR300=y -CONFIG_ATH79_MACH_GL_AR300M=y -CONFIG_ATH79_MACH_GL_DOMINO=y -CONFIG_ATH79_MACH_GL_INET=y -CONFIG_ATH79_MACH_GL_MIFI=y -CONFIG_ATH79_MACH_GL_USB150=y -CONFIG_ATH79_MACH_GS_MINIBOX_V1=y -CONFIG_ATH79_MACH_GS_OOLITE=y +# CONFIG_ATH79_MACH_DR342 is not set +# CONFIG_ATH79_MACH_DR344 is not set +# CONFIG_ATH79_MACH_DR531 is not set +# CONFIG_ATH79_MACH_DRAGINO2 is not set +# CONFIG_ATH79_MACH_E2100L is not set +# CONFIG_ATH79_MACH_EAP120 is not set +# CONFIG_ATH79_MACH_EAP300V2 is not set +# CONFIG_ATH79_MACH_EAP7660D is not set +# CONFIG_ATH79_MACH_EL_M150 is not set +# CONFIG_ATH79_MACH_EL_MINI is not set +# CONFIG_ATH79_MACH_ENS202EXT is not set +# CONFIG_ATH79_MACH_EPG5000 is not set +# CONFIG_ATH79_MACH_ESR1750 is not set +# CONFIG_ATH79_MACH_ESR900 is not set +# CONFIG_ATH79_MACH_EW_DORIN is not set +# CONFIG_ATH79_MACH_F9K1115V2 is not set +# CONFIG_ATH79_MACH_FRITZ300E is not set +# CONFIG_ATH79_MACH_GL_AR150 is not set +# CONFIG_ATH79_MACH_GL_AR300 is not set +# CONFIG_ATH79_MACH_GL_AR300M is not set +# CONFIG_ATH79_MACH_GL_AR750 is not set +# CONFIG_ATH79_MACH_GL_DOMINO is not set +# CONFIG_ATH79_MACH_GL_INET is not set +# CONFIG_ATH79_MACH_GL_MIFI is not set +# CONFIG_ATH79_MACH_GL_USB150 is not set +# CONFIG_ATH79_MACH_GS_MINIBOX_V1 is not set +# CONFIG_ATH79_MACH_GS_OOLITE is not set # CONFIG_ATH79_MACH_HIVEAP_121 is not set -CONFIG_ATH79_MACH_HIWIFI_HC6361=y -CONFIG_ATH79_MACH_HORNET_UB=y -CONFIG_ATH79_MACH_JA76PF=y -CONFIG_ATH79_MACH_JWAP003=y -CONFIG_ATH79_MACH_JWAP230=y -CONFIG_ATH79_MACH_LIMA=y -CONFIG_ATH79_MACH_MC_MAC1200R=y -CONFIG_ATH79_MACH_MR12=y -CONFIG_ATH79_MACH_MR16=y -CONFIG_ATH79_MACH_MR1750=y +# CONFIG_ATH79_MACH_HIWIFI_HC6361 is not set +# CONFIG_ATH79_MACH_HORNET_UB is not set +# CONFIG_ATH79_MACH_JA76PF is not set +# CONFIG_ATH79_MACH_JWAP003 is not set +# CONFIG_ATH79_MACH_JWAP230 is not set +# CONFIG_ATH79_MACH_LIMA is not set +# CONFIG_ATH79_MACH_MC_MAC1200R is not set +# CONFIG_ATH79_MACH_MR12 is not set +# CONFIG_ATH79_MACH_MR16 is not set +# CONFIG_ATH79_MACH_MR1750 is not set # CONFIG_ATH79_MACH_MR18 is not set -CONFIG_ATH79_MACH_MR600=y -CONFIG_ATH79_MACH_MR900=y -CONFIG_ATH79_MACH_MYNET_N600=y -CONFIG_ATH79_MACH_MYNET_N750=y -CONFIG_ATH79_MACH_MYNET_REXT=y -CONFIG_ATH79_MACH_MZK_W04NU=y -CONFIG_ATH79_MACH_MZK_W300NH=y -CONFIG_ATH79_MACH_NBG460N=y -CONFIG_ATH79_MACH_NBG6716=y -CONFIG_ATH79_MACH_OM2P=y -CONFIG_ATH79_MACH_OM5P=y -CONFIG_ATH79_MACH_OM5P_AC=y -CONFIG_ATH79_MACH_OM5P_ACv2=y -CONFIG_ATH79_MACH_OMY_G1=y -CONFIG_ATH79_MACH_OMY_X1=y -CONFIG_ATH79_MACH_ONION_OMEGA=y -CONFIG_ATH79_MACH_PB42=y -CONFIG_ATH79_MACH_PB44=y -CONFIG_ATH79_MACH_PQI_AIR_PEN=y -CONFIG_ATH79_MACH_QIHOO_C301=y -CONFIG_ATH79_MACH_R602N=y +# CONFIG_ATH79_MACH_MR600 is not set +# CONFIG_ATH79_MACH_MR900 is not set +# CONFIG_ATH79_MACH_MYNET_N600 is not set +# CONFIG_ATH79_MACH_MYNET_N750 is not set +# CONFIG_ATH79_MACH_MYNET_REXT is not set +# CONFIG_ATH79_MACH_MZK_W04NU is not set +# CONFIG_ATH79_MACH_MZK_W300NH is not set +# CONFIG_ATH79_MACH_N5Q is not set +# CONFIG_ATH79_MACH_NBG460N is not set +# CONFIG_ATH79_MACH_NBG6716 is not set +# CONFIG_ATH79_MACH_OM2P is not set +# CONFIG_ATH79_MACH_OM5P is not set +# CONFIG_ATH79_MACH_OM5P_AC is not set +# CONFIG_ATH79_MACH_OM5P_ACv2 is not set +# CONFIG_ATH79_MACH_OMY_G1 is not set +# CONFIG_ATH79_MACH_OMY_X1 is not set +# CONFIG_ATH79_MACH_ONION_OMEGA is not set +# CONFIG_ATH79_MACH_PB42 is not set +# CONFIG_ATH79_MACH_PB44 is not set +# CONFIG_ATH79_MACH_PQI_AIR_PEN is not set +# CONFIG_ATH79_MACH_QIHOO_C301 is not set +# CONFIG_ATH79_MACH_R36A is not set +# CONFIG_ATH79_MACH_R602N is not set # CONFIG_ATH79_MACH_R6100 is not set # CONFIG_ATH79_MACH_RAMBUTAN is not set # CONFIG_ATH79_MACH_RB2011 is not set @@ -161,101 +164,103 @@ CONFIG_ATH79_MACH_R602N=y # CONFIG_ATH79_MACH_RB95X is not set # CONFIG_ATH79_MACH_RBSPI is not set # CONFIG_ATH79_MACH_RBSXTLITE is not set -CONFIG_ATH79_MACH_RE450=y -CONFIG_ATH79_MACH_RW2458N=y -CONFIG_ATH79_MACH_SC1750=y -CONFIG_ATH79_MACH_SC300M=y -CONFIG_ATH79_MACH_SC450=y -CONFIG_ATH79_MACH_SMART_300=y -CONFIG_ATH79_MACH_SOM9331=y -CONFIG_ATH79_MACH_SR3200=y -CONFIG_ATH79_MACH_TELLSTICK_ZNET_LITE=y -CONFIG_ATH79_MACH_TEW_632BRP=y -CONFIG_ATH79_MACH_TEW_673GRU=y -CONFIG_ATH79_MACH_TEW_712BR=y -CONFIG_ATH79_MACH_TEW_732BR=y -CONFIG_ATH79_MACH_TEW_823DRU=y -CONFIG_ATH79_MACH_TL_MR11U=y -CONFIG_ATH79_MACH_TL_MR13U=y -CONFIG_ATH79_MACH_TL_MR3020=y -CONFIG_ATH79_MACH_TL_MR3X20=y -CONFIG_ATH79_MACH_TL_MR6400=y -CONFIG_ATH79_MACH_TL_WA701ND_V2=y -CONFIG_ATH79_MACH_TL_WA7210N_V2=y -CONFIG_ATH79_MACH_TL_WA801ND_V3=y -CONFIG_ATH79_MACH_TL_WA830RE_V2=y -CONFIG_ATH79_MACH_TL_WA850RE_V2=y -CONFIG_ATH79_MACH_TL_WA855RE_V1=y -CONFIG_ATH79_MACH_TL_WA901ND=y -CONFIG_ATH79_MACH_TL_WA901ND_V2=y -CONFIG_ATH79_MACH_TL_WA901ND_V4=y -CONFIG_ATH79_MACH_TL_WAX50RE=y -CONFIG_ATH79_MACH_TL_WDR3320_V2=y -CONFIG_ATH79_MACH_TL_WDR3500=y -CONFIG_ATH79_MACH_TL_WDR4300=y -CONFIG_ATH79_MACH_TL_WDR6500_V2=y -CONFIG_ATH79_MACH_TL_WPA8630=y -CONFIG_ATH79_MACH_TL_WR1041N_V2=y -CONFIG_ATH79_MACH_TL_WR1043ND=y -CONFIG_ATH79_MACH_TL_WR1043ND_V2=y -CONFIG_ATH79_MACH_TL_WR1043ND_V4=y -CONFIG_ATH79_MACH_TL_WR2543N=y -CONFIG_ATH79_MACH_TL_WR703N=y -CONFIG_ATH79_MACH_TL_WR720N_V3=y -CONFIG_ATH79_MACH_TL_WR741ND=y -CONFIG_ATH79_MACH_TL_WR741ND_V4=y -CONFIG_ATH79_MACH_TL_WR802N_V1=y -CONFIG_ATH79_MACH_TL_WR802N_V2=y -CONFIG_ATH79_MACH_TL_WR810N=y -CONFIG_ATH79_MACH_TL_WR840N_V2=y -CONFIG_ATH79_MACH_TL_WR841N_V1=y -CONFIG_ATH79_MACH_TL_WR841N_V8=y -CONFIG_ATH79_MACH_TL_WR841N_V9=y -CONFIG_ATH79_MACH_TL_WR902AC_V1=y -CONFIG_ATH79_MACH_TL_WR940N_V4=y -CONFIG_ATH79_MACH_TL_WR941ND=y -CONFIG_ATH79_MACH_TL_WR941ND_V6=y -CONFIG_ATH79_MACH_TL_WR942N_V1=y -CONFIG_ATH79_MACH_TUBE2H=y -CONFIG_ATH79_MACH_UBNT=y -CONFIG_ATH79_MACH_UBNT_UNIFIAC=y -CONFIG_ATH79_MACH_UBNT_XM=y -CONFIG_ATH79_MACH_WEIO=y -CONFIG_ATH79_MACH_WHR_HP_G300N=y +# CONFIG_ATH79_MACH_RE450 is not set +# CONFIG_ATH79_MACH_RUT9XX is not set +# CONFIG_ATH79_MACH_RW2458N is not set +# CONFIG_ATH79_MACH_SC1750 is not set +# CONFIG_ATH79_MACH_SC300M is not set +# CONFIG_ATH79_MACH_SC450 is not set +# CONFIG_ATH79_MACH_SMART_300 is not set +# CONFIG_ATH79_MACH_SOM9331 is not set +# CONFIG_ATH79_MACH_SR3200 is not set +# CONFIG_ATH79_MACH_TELLSTICK_ZNET_LITE is not set +# CONFIG_ATH79_MACH_TEW_632BRP is not set +# CONFIG_ATH79_MACH_TEW_673GRU is not set +# CONFIG_ATH79_MACH_TEW_712BR is not set +# CONFIG_ATH79_MACH_TEW_732BR is not set +# CONFIG_ATH79_MACH_TEW_823DRU is not set +# CONFIG_ATH79_MACH_TL_MR11U is not set +# CONFIG_ATH79_MACH_TL_MR13U is not set +# CONFIG_ATH79_MACH_TL_MR3020 is not set +# CONFIG_ATH79_MACH_TL_MR3X20 is not set +# CONFIG_ATH79_MACH_TL_MR6400 is not set +# CONFIG_ATH79_MACH_TL_WA701ND_V2 is not set +# CONFIG_ATH79_MACH_TL_WA7210N_V2 is not set +# CONFIG_ATH79_MACH_TL_WA801ND_V3 is not set +# CONFIG_ATH79_MACH_TL_WA830RE_V2 is not set +# CONFIG_ATH79_MACH_TL_WA850RE_V2 is not set +# CONFIG_ATH79_MACH_TL_WA855RE_V1 is not set +# CONFIG_ATH79_MACH_TL_WA901ND is not set +# CONFIG_ATH79_MACH_TL_WA901ND_V2 is not set +# CONFIG_ATH79_MACH_TL_WA901ND_V4 is not set +# CONFIG_ATH79_MACH_TL_WAX50RE is not set +# CONFIG_ATH79_MACH_TL_WDR3320_V2 is not set +# CONFIG_ATH79_MACH_TL_WDR3500 is not set +# CONFIG_ATH79_MACH_TL_WDR4300 is not set +# CONFIG_ATH79_MACH_TL_WDR6500_V2 is not set +# CONFIG_ATH79_MACH_TL_WPA8630 is not set +# CONFIG_ATH79_MACH_TL_WR1041N_V2 is not set +# CONFIG_ATH79_MACH_TL_WR1043ND is not set +# CONFIG_ATH79_MACH_TL_WR1043ND_V2 is not set +# CONFIG_ATH79_MACH_TL_WR1043ND_V4 is not set +# CONFIG_ATH79_MACH_TL_WR1043N_V5 is not set +# CONFIG_ATH79_MACH_TL_WR2543N is not set +# CONFIG_ATH79_MACH_TL_WR703N is not set +# CONFIG_ATH79_MACH_TL_WR720N_V3 is not set +# CONFIG_ATH79_MACH_TL_WR741ND is not set +# CONFIG_ATH79_MACH_TL_WR741ND_V4 is not set +# CONFIG_ATH79_MACH_TL_WR802N_V1 is not set +# CONFIG_ATH79_MACH_TL_WR802N_V2 is not set +# CONFIG_ATH79_MACH_TL_WR810N is not set +# CONFIG_ATH79_MACH_TL_WR810N_V2 is not set +# CONFIG_ATH79_MACH_TL_WR840N_V2 is not set +# CONFIG_ATH79_MACH_TL_WR841N_V1 is not set +# CONFIG_ATH79_MACH_TL_WR841N_V8 is not set +# CONFIG_ATH79_MACH_TL_WR841N_V9 is not set +# CONFIG_ATH79_MACH_TL_WR902AC_V1 is not set +# CONFIG_ATH79_MACH_TL_WR940N_V4 is not set +# CONFIG_ATH79_MACH_TL_WR941ND is not set +# CONFIG_ATH79_MACH_TL_WR941ND_V6 is not set +# CONFIG_ATH79_MACH_TL_WR942N_V1 is not set +# CONFIG_ATH79_MACH_TUBE2H is not set +# CONFIG_ATH79_MACH_UBNT is not set +# CONFIG_ATH79_MACH_UBNT_UNIFIAC is not set +# CONFIG_ATH79_MACH_UBNT_XM is not set +# CONFIG_ATH79_MACH_WEIO is not set +# CONFIG_ATH79_MACH_WHR_HP_G300N is not set # CONFIG_ATH79_MACH_WI2A_AC200I is not set -CONFIG_ATH79_MACH_WLAE_AG300N=y -CONFIG_ATH79_MACH_WLR8100=y -CONFIG_ATH79_MACH_WNDAP360=y -CONFIG_ATH79_MACH_WNDR3700=y +# CONFIG_ATH79_MACH_WLAE_AG300N is not set +# CONFIG_ATH79_MACH_WLR8100 is not set +# CONFIG_ATH79_MACH_WNDAP360 is not set +# CONFIG_ATH79_MACH_WNDR3700 is not set # CONFIG_ATH79_MACH_WNDR4300 is not set -CONFIG_ATH79_MACH_WNR2000=y -CONFIG_ATH79_MACH_WNR2000_V3=y -CONFIG_ATH79_MACH_WNR2000_V4=y -CONFIG_ATH79_MACH_WNR2200=y -CONFIG_ATH79_MACH_WP543=y -CONFIG_ATH79_MACH_WPE72=y -CONFIG_ATH79_MACH_WPJ342=y -CONFIG_ATH79_MACH_WPJ344=y -CONFIG_ATH79_MACH_WPJ531=y -CONFIG_ATH79_MACH_WPJ558=y -CONFIG_ATH79_MACH_WPJ563=y -CONFIG_ATH79_MACH_WRT160NL=y -CONFIG_ATH79_MACH_WRT400N=y -CONFIG_ATH79_MACH_WRTNODE2Q=y -CONFIG_ATH79_MACH_WZR_450HP2=y -CONFIG_ATH79_MACH_WZR_HP_AG300H=y -CONFIG_ATH79_MACH_WZR_HP_G300NH=y -CONFIG_ATH79_MACH_WZR_HP_G300NH2=y -CONFIG_ATH79_MACH_WZR_HP_G450H=y -CONFIG_ATH79_MACH_XD3200=y +# CONFIG_ATH79_MACH_WNR2000 is not set +# CONFIG_ATH79_MACH_WNR2000_V3 is not set +# CONFIG_ATH79_MACH_WNR2000_V4 is not set +# CONFIG_ATH79_MACH_WNR2200 is not set +# CONFIG_ATH79_MACH_WP543 is not set +# CONFIG_ATH79_MACH_WPE72 is not set +# CONFIG_ATH79_MACH_WPJ342 is not set +# CONFIG_ATH79_MACH_WPJ344 is not set +# CONFIG_ATH79_MACH_WPJ531 is not set +# CONFIG_ATH79_MACH_WPJ558 is not set +# CONFIG_ATH79_MACH_WPJ563 is not set +# CONFIG_ATH79_MACH_WRT160NL is not set +# CONFIG_ATH79_MACH_WRT400N is not set +# CONFIG_ATH79_MACH_WRTNODE2Q is not set +# CONFIG_ATH79_MACH_WZR_450HP2 is not set +# CONFIG_ATH79_MACH_WZR_HP_AG300H is not set +# CONFIG_ATH79_MACH_WZR_HP_G300NH is not set +# CONFIG_ATH79_MACH_WZR_HP_G300NH2 is not set +# CONFIG_ATH79_MACH_WZR_HP_G450H is not set +# CONFIG_ATH79_MACH_XD3200 is not set # CONFIG_ATH79_MACH_Z1 is not set -CONFIG_ATH79_MACH_ZBT_WE1526=y -CONFIG_ATH79_MACH_ZCN_1523H=y -CONFIG_ATH79_NVRAM=y -CONFIG_ATH79_PCI_ATH9K_FIXUP=y +# CONFIG_ATH79_MACH_ZBT_WE1526 is not set +# CONFIG_ATH79_MACH_ZCN_1523H is not set +# CONFIG_ATH79_NVRAM is not set +# CONFIG_ATH79_PCI_ATH9K_FIXUP is not set # CONFIG_ATH79_ROUTERBOOT is not set CONFIG_ATH79_WDT=y -CONFIG_BLK_MQ_PCI=y CONFIG_CEVT_R4K=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLONE_BACKWARDS=y @@ -281,7 +286,6 @@ CONFIG_CRYPTO_RNG2=y CONFIG_CRYPTO_WORKQUEUE=y CONFIG_CSRC_R4K=y CONFIG_DMA_NONCOHERENT=y -CONFIG_DTC=y CONFIG_EARLY_PRINTK=y CONFIG_ETHERNET_PACKET_MANGLE=y CONFIG_FIXED_PHY=y @@ -345,7 +349,6 @@ CONFIG_HAVE_PERF_EVENTS=y CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y -CONFIG_HW_HAS_PCI=y CONFIG_HZ_PERIODIC=y CONFIG_I2C=y CONFIG_I2C_ALGOBIT=y @@ -357,15 +360,11 @@ CONFIG_INITRAMFS_ROOT_UID=0 CONFIG_INITRAMFS_SOURCE="../../root" CONFIG_INTEL_XWAY_PHY=y CONFIG_IP17XX_PHY=y -CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_MIPS_CPU=y CONFIG_IRQ_WORK=y -# CONFIG_KERNEL_KALLSYMS is not set CONFIG_LEDS_GPIO=y -# CONFIG_LEDS_WNDR3700_USB is not set -CONFIG_LIBFDT=y CONFIG_MARVELL_PHY=y CONFIG_MDIO_BITBANG=y CONFIG_MDIO_BOARDINFO=y @@ -376,16 +375,10 @@ CONFIG_MIPS_ASID_BITS=8 CONFIG_MIPS_ASID_SHIFT=0 CONFIG_MIPS_CLOCK_VSYSCALL=y # CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set -# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y -# CONFIG_MIPS_CMDLINE_FROM_DTB is not set -# CONFIG_MIPS_ELF_APPENDED_DTB is not set -CONFIG_MIPS_FPU_EMULATOR=y # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 CONFIG_MIPS_MACHINE=y -CONFIG_MIPS_NO_APPENDED_DTB=y -# CONFIG_MIPS_RAW_APPENDED_DTB is not set CONFIG_MIPS_SPRAM=y CONFIG_MODULES_USE_ELF_REL=y CONFIG_MTD_CFI_ADV_OPTIONS=y @@ -411,7 +404,6 @@ CONFIG_MTD_SPLIT_TPLINK_FW=y CONFIG_MTD_SPLIT_UIMAGE_FW=y CONFIG_MTD_SPLIT_WRGG_FW=y CONFIG_MTD_TPLINK_PARTS=y -CONFIG_MYLOADER=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_PER_CPU_KM=y CONFIG_NET_DSA=y @@ -421,21 +413,8 @@ CONFIG_NET_DSA_TAG_TRAILER=y CONFIG_NET_SWITCHDEV=y CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y # CONFIG_NO_IOPORT_MAP is not set -CONFIG_OF=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_ADDRESS_PCI=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_FLATTREE=y -CONFIG_OF_GPIO=y -CONFIG_OF_IRQ=y -CONFIG_OF_MDIO=y -CONFIG_OF_NET=y -CONFIG_OF_PCI=y -CONFIG_OF_PCI_IRQ=y -CONFIG_PCI=y -CONFIG_PCI_AR724X=y -CONFIG_PCI_DISABLE_COMMON_QUIRKS=y -CONFIG_PCI_DOMAINS=y +# CONFIG_OF is not set +# CONFIG_PCI_AR724X is not set CONFIG_PCI_DRIVERS_LEGACY=y CONFIG_PERF_USE_VMALLOC=y CONFIG_PGTABLE_LEVELS=2 @@ -452,17 +431,14 @@ CONFIG_RTL8367_PHY=y # CONFIG_SERIAL_8250_FSL is not set CONFIG_SERIAL_8250_NR_UARTS=1 CONFIG_SERIAL_8250_RUNTIME_UARTS=1 -CONFIG_SERIAL_AR933X=y -CONFIG_SERIAL_AR933X_CONSOLE=y -CONFIG_SERIAL_AR933X_NR_UARTS=2 -CONFIG_SOC_AR71XX=y -CONFIG_SOC_AR724X=y -CONFIG_SOC_AR913X=y -CONFIG_SOC_AR933X=y -CONFIG_SOC_AR934X=y -CONFIG_SOC_QCA953X=y -CONFIG_SOC_QCA955X=y -CONFIG_SOC_QCA956X=y +# CONFIG_SOC_AR71XX is not set +# CONFIG_SOC_AR724X is not set +# CONFIG_SOC_AR913X is not set +# CONFIG_SOC_AR933X is not set +# CONFIG_SOC_AR934X is not set +# CONFIG_SOC_QCA953X is not set +# CONFIG_SOC_QCA955X is not set +# CONFIG_SOC_QCA956X is not set CONFIG_SPI=y CONFIG_SPI_ATH79=y CONFIG_SPI_BITBANG=y @@ -485,4 +461,3 @@ CONFIG_SYS_SUPPORTS_ZBOOT=y CONFIG_SYS_SUPPORTS_ZBOOT_UART_PROM=y CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_USB_SUPPORT=y -CONFIG_USE_OF=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt index 5cb4f7ed3e..3ca77550bc 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt @@ -225,6 +225,15 @@ config ATH79_MACH_AP90Q select ATH79_DEV_M25P80 select ATH79_DEV_WMAC +config ATH79_MACH_AP91_5G + bool "ALFA Network AP91-5G support" + select SOC_AR724X + select ATH79_DEV_AP9X_PCI if PCI + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + config ATH79_MACH_AP96 bool "Atheros AP96 board support" select SOC_AR71XX @@ -638,9 +647,21 @@ config ATH79_MACH_DOMYWIFI_DW33D select ATH79_DEV_WMAC select ATH79_DEV_USB +config ATH79_MACH_DR342 + bool "Wallys DR342 board support" + select SOC_AR934X + select ATH79_DEV_AP9X_PCI if PCI + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_USB + select ATH79_DEV_WMAC + config ATH79_MACH_DR344 bool "Wallys DR344 board support" - select SOC_AS934X + select SOC_AR934X + select ATH79_DEV_AP9X_PCI if PCI select ATH79_DEV_ETH select ATH79_DEV_GPIO_BUTTONS select ATH79_DEV_LEDS_GPIO @@ -749,6 +770,17 @@ config ATH79_MACH_GL_AR300M select ATH79_DEV_USB select ATH79_DEV_WMAC +config ATH79_MACH_GL_AR750 + bool "GL.iNet GL-AR750 support" + select SOC_QCA953X + select ATH79_DEV_AP9X_PCI if PCI + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_USB + select ATH79_DEV_WMAC + config ATH79_MACH_GL_DOMINO bool "DOMINO support" select SOC_AR933X @@ -913,6 +945,16 @@ config ATH79_MACH_WRTNODE2Q select ATH79_DEV_M25P80 select ATH79_DEV_WMAC +config ATH79_MACH_R36A + bool "ALFA Network R36A support" + select SOC_QCA953X + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_USB + select ATH79_DEV_WMAC + config ATH79_MACH_R602N bool "P&W R602N support" select SOC_QCA953X @@ -1012,6 +1054,7 @@ config ATH79_MACH_RBSPI select ATH79_ROUTERBOOT help Say 'Y' here if you want your kernel to support the + MikroTik RouterBOARD mAP MikroTik RouterBOARD mAP lite MikroTik RouterBOARD hAP lite MikroTik RouterBOARD hAP @@ -1022,8 +1065,7 @@ config ATH79_MACH_RBSPI MikroTik RouterBOARD Powerbox MikroTik RouterBOARD LHG 5 MikroTik RouterBOARD cAP (EXPERIMENTAL) - MikroTik RouterBOARD mAP (EXPERIMENTAL) - MikroTik RouterBOARD wAP (EXPERIMENTAL) + MikroTik RouterBOARD wAP config ATH79_MACH_RBSXTLITE bool "MikroTik RouterBOARD SXT Lite" @@ -1260,6 +1302,17 @@ config ATH79_MACH_RE450 select ATH79_DEV_M25P80 select ATH79_DEV_WMAC +config ATH79_MACH_RUT9XX + bool "Teltonika RUT900 series support" + select SOC_AR934X + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_USB + select ATH79_DEV_WMAC + select GPIO_PCA953X + config ATH79_MACH_RW2458N bool "Redwave RW2458N board support" select SOC_AR724X @@ -1690,6 +1743,15 @@ config ATH79_MACH_TL_WR810N select ATH79_DEV_USB select ATH79_DEV_WMAC +config ATH79_MACH_TL_WR810N_V2 + bool "TP-LINK TL-WR810N v2 support" + select SOC_QCA953X + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_WMAC + config ATH79_MACH_TL_WR840N_V2 bool "TP-LINK TL-WR840N v2/v3 support" select SOC_QCA953X @@ -1789,6 +1851,15 @@ config ATH79_MACH_TL_WR1041N_V2 select ATH79_DEV_USB select ATH79_DEV_WMAC +config ATH79_MACH_TL_WR1043N_V5 + bool "TP-LINK TL-WR1043N v5 support" + select SOC_QCA956X + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_WMAC + config ATH79_MACH_TL_WR1043ND bool "TP-LINK TL-WR1043ND support" select SOC_AR913X @@ -1969,6 +2040,14 @@ config ATH79_MACH_ZCN_1523H select ATH79_DEV_LEDS_GPIO select ATH79_DEV_M25P80 +config ATH79_MACH_N5Q + bool "ALFA Network N5Q support" + select SOC_AR934X + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_WMAC + config ATH79_MACH_NBG460N bool "Zyxel NBG460N/550N/550NH board support" select SOC_AR913X diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile index 7d12282baa..e9f4d9852b 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile @@ -57,6 +57,7 @@ obj-$(CONFIG_ATH79_MACH_AP147) += mach-ap147.o obj-$(CONFIG_ATH79_MACH_AP152) += mach-ap152.o obj-$(CONFIG_ATH79_MACH_AP531B0) += mach-ap531b0.o obj-$(CONFIG_ATH79_MACH_AP90Q) += mach-ap90q.o +obj-$(CONFIG_ATH79_MACH_AP91_5G) += mach-ap91-5g.o obj-$(CONFIG_ATH79_MACH_AP96) += mach-ap96.o obj-$(CONFIG_ATH79_MACH_ARCHER_C25_V1) += mach-archer-c25-v1.o obj-$(CONFIG_ATH79_MACH_ARCHER_C58_V1) += mach-archer-c59-v1.o @@ -102,6 +103,7 @@ obj-$(CONFIG_ATH79_MACH_DLAN_HOTSPOT) += mach-dlan-hotspot.o obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC) += mach-dlan-pro-1200-ac.o obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP) += mach-dlan-pro-500-wp.o obj-$(CONFIG_ATH79_MACH_DOMYWIFI_DW33D) += mach-domywifi-dw33d.o +obj-$(CONFIG_ATH79_MACH_DR342) += mach-dr344.o obj-$(CONFIG_ATH79_MACH_DR344) += mach-dr344.o obj-$(CONFIG_ATH79_MACH_DR531) += mach-dr531.o obj-$(CONFIG_ATH79_MACH_DRAGINO2) += mach-dragino2.o @@ -120,6 +122,7 @@ obj-$(CONFIG_ATH79_MACH_FRITZ300E) += mach-fritz300e.o obj-$(CONFIG_ATH79_MACH_GL_AR150) += mach-gl-ar150.o obj-$(CONFIG_ATH79_MACH_GL_AR300) += mach-gl-ar300.o obj-$(CONFIG_ATH79_MACH_GL_AR300M) += mach-gl-ar300m.o +obj-$(CONFIG_ATH79_MACH_GL_AR750) += mach-gl-ar750.o obj-$(CONFIG_ATH79_MACH_GL_DOMINO) += mach-gl-domino.o obj-$(CONFIG_ATH79_MACH_GL_INET) += mach-gl-inet.o obj-$(CONFIG_ATH79_MACH_GL_MIFI) += mach-gl-mifi.o @@ -145,6 +148,7 @@ obj-$(CONFIG_ATH79_MACH_MYNET_N750) += mach-mynet-n750.o obj-$(CONFIG_ATH79_MACH_MYNET_REXT) += mach-mynet-rext.o obj-$(CONFIG_ATH79_MACH_MZK_W04NU) += mach-mzk-w04nu.o obj-$(CONFIG_ATH79_MACH_MZK_W300NH) += mach-mzk-w300nh.o +obj-$(CONFIG_ATH79_MACH_N5Q) += mach-n5q.o obj-$(CONFIG_ATH79_MACH_NBG460N) += mach-nbg460n.o obj-$(CONFIG_ATH79_MACH_NBG6716) += mach-nbg6716.o obj-$(CONFIG_ATH79_MACH_RAMBUTAN) += mach-rambutan.o @@ -159,6 +163,7 @@ obj-$(CONFIG_ATH79_MACH_PB42) += mach-pb42.o obj-$(CONFIG_ATH79_MACH_PB44) += mach-pb44.o obj-$(CONFIG_ATH79_MACH_PQI_AIR_PEN) += mach-pqi-air-pen.o obj-$(CONFIG_ATH79_MACH_QIHOO_C301) += mach-qihoo-c301.o +obj-$(CONFIG_ATH79_MACH_R36A) += mach-r36a.o obj-$(CONFIG_ATH79_MACH_R602N) += mach-r602n.o obj-$(CONFIG_ATH79_MACH_R6100) += mach-r6100.o obj-$(CONFIG_ATH79_MACH_RB2011) += mach-rb2011.o @@ -171,6 +176,7 @@ obj-$(CONFIG_ATH79_MACH_RB95X) += mach-rb95x.o obj-$(CONFIG_ATH79_MACH_RBSPI) += mach-rbspi.o obj-$(CONFIG_ATH79_MACH_RBSXTLITE) += mach-rbsxtlite.o obj-$(CONFIG_ATH79_MACH_RE450) += mach-re450.o +obj-$(CONFIG_ATH79_MACH_RUT9XX) += mach-rut9xx.o obj-$(CONFIG_ATH79_MACH_RW2458N) += mach-rw2458n.o obj-$(CONFIG_ATH79_MACH_SC1750) += mach-sc1750.o obj-$(CONFIG_ATH79_MACH_SC300M) += mach-sc300m.o @@ -214,8 +220,9 @@ obj-$(CONFIG_ATH79_MACH_TL_WR720N_V3) += mach-tl-wr720n-v3.o obj-$(CONFIG_ATH79_MACH_TL_WR741ND) += mach-tl-wr741nd.o obj-$(CONFIG_ATH79_MACH_TL_WR741ND_V4) += mach-tl-wr741nd-v4.o obj-$(CONFIG_ATH79_MACH_TL_WR802N_V1) += mach-tl-wr802n.o -obj-$(CONFIG_ATH79_MACH_TL_WR802N_V2) += mach-tl-wr802n-v2.o +obj-$(CONFIG_ATH79_MACH_TL_WR802N_V2) += mach-tl-wr802n.o obj-$(CONFIG_ATH79_MACH_TL_WR810N) += mach-tl-wr810n.o +obj-$(CONFIG_ATH79_MACH_TL_WR810N_V2) += mach-tl-wr810n.o obj-$(CONFIG_ATH79_MACH_TL_WR840N_V2) += mach-tl-wr841n-v9.o obj-$(CONFIG_ATH79_MACH_TL_WR841N_V1) += mach-tl-wr841n.o obj-$(CONFIG_ATH79_MACH_TL_WR841N_V8) += mach-tl-wr841n-v8.o diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-dsa.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-dsa.c index a9bb334a20..4ade218f7e 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/dev-dsa.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-dsa.c @@ -10,7 +10,6 @@ */ #include -#include #include #include @@ -30,11 +29,7 @@ void __init ath79_register_dsa(struct device *netdev, d->netdev = netdev; for (i = 0; i < d->nr_chips; i++) -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) - d->chip[i].mii_bus = miidev; -#else d->chip[i].host_dev = miidev; -#endif ar71xx_dsa_switch_device.dev.platform_data = d; platform_device_register(&ar71xx_dsa_switch_device); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c index a8b19b68b2..427de6a50d 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c @@ -996,6 +996,9 @@ void __init ath79_register_eth(unsigned int id) pdata->reset_bit = AR934X_RESET_GE0_MAC | AR934X_RESET_GE0_MDIO; pdata->set_speed = ar934x_set_speed_ge0; + + if (ath79_soc == ATH79_SOC_QCA9533) + pdata->disable_inline_checksum_engine = 1; } else { pdata->reset_bit = AR934X_RESET_GE1_MAC | AR934X_RESET_GE1_MDIO; @@ -1097,6 +1100,8 @@ void __init ath79_register_eth(unsigned int id) pdata->set_speed = qca956x_set_speed_sgmii; else pdata->set_speed = ar934x_set_speed_ge0; + + pdata->disable_inline_checksum_engine = 1; } else { pdata->reset_bit = QCA955X_RESET_GE1_MAC | QCA955X_RESET_GE1_MDIO; diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ap91-5g.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ap91-5g.c new file mode 100644 index 0000000000..64b9430381 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ap91-5g.c @@ -0,0 +1,118 @@ +/* + * ALFA Network AP91-5G board support + * + * Copyright (C) 2018 Piotr Dymacz + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include +#include + +#include +#include + +#include "common.h" +#include "dev-ap9x-pci.h" +#include "dev-eth.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-m25p80.h" +#include "machtypes.h" + +#define AP91_5G_GPIO_LED_LAN 17 +#define AP91_5G_GPIO_LED_SIGNAL1 12 +#define AP91_5G_GPIO_LED_SIGNAL2 8 +#define AP91_5G_GPIO_LED_SIGNAL3 6 +#define AP91_5G_GPIO_LED_SIGNAL4 7 + +#define AP91_5G_GPIO_WDT_EN 1 +#define AP91_5G_GPIO_WDT_IN 0 + +#define AP91_5G_GPIO_BTN_RESET 11 + +#define AP91_5G_KEYS_POLL_INTERVAL 20 +#define AP91_5G_KEYS_DEBOUNCE_INTERVAL (3 * AP91_5G_KEYS_POLL_INTERVAL) + +#define AP91_5G_WMAC_CALDATA_OFFSET 0x1000 + +static struct gpio_led ap91_5g_leds_gpio[] __initdata = { + { + .name = "ap91-5g:green:lan", + .gpio = AP91_5G_GPIO_LED_LAN, + .active_low = 1, + }, { + .name = "ap91-5g:red:signal1", + .gpio = AP91_5G_GPIO_LED_SIGNAL1, + .active_low = 1, + }, { + .name = "ap91-5g:orange:signal2", + .gpio = AP91_5G_GPIO_LED_SIGNAL2, + .active_low = 1, + }, { + .name = "ap91-5g:green:signal3", + .gpio = AP91_5G_GPIO_LED_SIGNAL3, + .active_low = 1, + }, { + .name = "ap91-5g:green:signal4", + .gpio = AP91_5G_GPIO_LED_SIGNAL4, + .active_low = 1, + }, +}; + +static struct gpio_keys_button ap91_5g_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = AP91_5G_KEYS_DEBOUNCE_INTERVAL, + .gpio = AP91_5G_GPIO_BTN_RESET, + .active_low = 1, + }, +}; + +static void __init ap91_5g_setup(void) +{ + u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); + + ath79_gpio_function_setup(AR724X_GPIO_FUNC_JTAG_DISABLE, + AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN); + + gpio_set_value(AP91_5G_GPIO_LED_LAN, 1); + gpio_set_value(AP91_5G_GPIO_LED_SIGNAL3, 1); + gpio_set_value(AP91_5G_GPIO_LED_SIGNAL4, 1); + + ath79_register_m25p80(NULL); + + ath79_register_mdio(0, 0x0); + + /* LAN */ + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.phy_mask = BIT(4); + ath79_eth0_data.speed = SPEED_100; + ath79_init_mac(ath79_eth0_data.mac_addr, art, 0); + ath79_register_eth(0); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(ap91_5g_leds_gpio), + ap91_5g_leds_gpio); + + ath79_register_gpio_keys_polled(-1, AP91_5G_KEYS_POLL_INTERVAL, + ARRAY_SIZE(ap91_5g_gpio_keys), + ap91_5g_gpio_keys); + + gpio_request_one(AP91_5G_GPIO_WDT_IN, + GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, + "WDT input"); + + gpio_request_one(AP91_5G_GPIO_WDT_EN, + GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, + "WDT enable"); + + ap91_pci_init(art + AP91_5G_WMAC_CALDATA_OFFSET, NULL); +} + +MIPS_MACHINE(ATH79_MACH_AP91_5G, "AP91-5G", "ALFA Network AP91-5G", + ap91_5g_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c index 3c85a20550..c500c91a1a 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c @@ -249,7 +249,7 @@ static void __init archer_c5x_v1_setup(void) ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; ath79_eth1_data.speed = SPEED_1000; ath79_eth1_data.duplex = DUPLEX_FULL; - ath79_switch_data.phy_poll_mask |= BIT(4); + ath79_switch_data.phy_poll_mask |= BIT(0); ath79_switch_data.phy4_mii_en = 1; ath79_register_eth(1); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c index 21b8e8cf8b..bfd2b2e6b8 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c @@ -83,7 +83,7 @@ static struct spi_gpio_platform_data archer_c7_v4_spi_data = { .num_chipselect = 1, }; -static u8 archer_c7_v4_ssr_initdata __initdata = 0xff; +static u8 archer_c7_v4_ssr_initdata = 0xff; static struct gen_74x164_chip_platform_data archer_c7_v4_ssr_data = { .base = ARCHER_C7_74HC_GPIO_BASE, diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-c60.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-c60.c index 7b01af515b..144f5db740 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-c60.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-c60.c @@ -180,7 +180,11 @@ static const struct mtd_ooblayout_ops c60_nand_ecclayout_ops = { static int c60_nand_scan_fixup(struct mtd_info *mtd) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) struct nand_chip *chip = mtd->priv; +#else + struct nand_chip *chip = mtd_to_nand(mtd); +#endif chip->ecc.size = 512; chip->ecc.strength = 4; diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-869-a1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-869-a1.c index 5847423891..b0894e37cc 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-869-a1.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-869-a1.c @@ -42,8 +42,8 @@ #define DIR869A1_GPIO_ENABLE_SWITCH 11 -#define DIR869A1_GPIO_LED_POWER 15 -#define DIR869A1_GPIO_LED_ORANGE 16 +#define DIR869A1_GPIO_LED_ORANGE 15 +#define DIR869A1_GPIO_LED_WHITE 16 #define DIR869A1_KEYS_POLL_INTERVAL 20 /* msecs */ #define DIR869A1_KEYS_DEBOUNCE_INTERVAL (3 * DIR869A1_KEYS_POLL_INTERVAL) @@ -59,17 +59,14 @@ static struct gpio_led dir869a1_leds_gpio[] __initdata = { { - /* Actually, this GPIO controls the LED power, - * while d-link:orange:status switches it between - * orange and white */ .name = "d-link:white:status", - .gpio = DIR869A1_GPIO_LED_POWER, + .gpio = DIR869A1_GPIO_LED_WHITE, .active_low = 1, }, { .name = "d-link:orange:status", .gpio = DIR869A1_GPIO_LED_ORANGE, - .active_low = 0, + .active_low = 1, }, }; diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-dr344.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-dr344.c index 42839271d9..870adbe083 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-dr344.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-dr344.c @@ -1,9 +1,10 @@ /* - * Wallys DR344 board support + * Wallys DR342/DR344 boards support * * Copyright (c) 2011 Qualcomm Atheros * Copyright (c) 2011-2012 Gabor Juhos * Copyright (c) 2015 Philippe Duchein + * Copyright (c) 2017 Piotr Dymacz * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -39,24 +40,51 @@ #include "dev-wmac.h" #include "machtypes.h" -#define DR344_GPIO_LED_SIG1 12 -#define DR344_GPIO_LED_SIG2 13 -#define DR344_GPIO_LED_SIG3 14 -#define DR344_GPIO_LED_SIG4 15 -#define DR344_GPIO_LED_STATUS 11 +#define DR34X_GPIO_LED_SIG1 12 +#define DR34X_GPIO_LED_SIG2 13 +#define DR34X_GPIO_LED_SIG3 14 +#define DR34X_GPIO_LED_SIG4 15 +#define DR34X_GPIO_LED_STATUS 11 #define DR344_GPIO_LED_LAN 17 #define DR344_GPIO_EXTERNAL_LNA0 18 #define DR344_GPIO_EXTERNAL_LNA1 19 -#define DR344_GPIO_BTN_RESET 16 +#define DR34X_GPIO_BTN_RESET 16 #define DR344_KEYS_POLL_INTERVAL 20 /* msecs */ #define DR344_KEYS_DEBOUNCE_INTERVAL (3 * DR344_KEYS_POLL_INTERVAL) -#define DR344_MAC0_OFFSET 0 -#define DR344_MAC1_OFFSET 8 -#define DR344_WMAC_CALDATA_OFFSET 0x1000 -#define DR344_PCIE_CALDATA_OFFSET 0x5000 +#define DR34X_MAC0_OFFSET 0 +#define DR34X_MAC1_OFFSET 8 +#define DR34X_WMAC_CALDATA_OFFSET 0x1000 + +static struct gpio_led dr342_leds_gpio[] __initdata = { + { + .name = "dr342:green:status", + .gpio = DR34X_GPIO_LED_STATUS, + .active_low = 1, + }, + { + .name = "dr342:green:sig1", + .gpio = DR34X_GPIO_LED_SIG1, + .active_low = 1, + }, + { + .name = "dr342:green:sig2", + .gpio = DR34X_GPIO_LED_SIG2, + .active_low = 1, + }, + { + .name = "dr342:green:sig3", + .gpio = DR34X_GPIO_LED_SIG3, + .active_low = 1, + }, + { + .name = "dr342:green:sig4", + .gpio = DR34X_GPIO_LED_SIG4, + .active_low = 1, + } +}; static struct gpio_led dr344_leds_gpio[] __initdata = { { @@ -66,96 +94,82 @@ static struct gpio_led dr344_leds_gpio[] __initdata = { }, { .name = "dr344:green:status", - .gpio = DR344_GPIO_LED_STATUS, + .gpio = DR34X_GPIO_LED_STATUS, .active_low = 1, }, { .name = "dr344:green:sig1", - .gpio = DR344_GPIO_LED_SIG1, + .gpio = DR34X_GPIO_LED_SIG1, .active_low = 1, }, { .name = "dr344:green:sig2", - .gpio = DR344_GPIO_LED_SIG2, + .gpio = DR34X_GPIO_LED_SIG2, .active_low = 1, }, { .name = "dr344:green:sig3", - .gpio = DR344_GPIO_LED_SIG3, + .gpio = DR34X_GPIO_LED_SIG3, .active_low = 1, }, { .name = "dr344:green:sig4", - .gpio = DR344_GPIO_LED_SIG4, + .gpio = DR34X_GPIO_LED_SIG4, .active_low = 1, } }; -static struct gpio_keys_button dr344_gpio_keys[] __initdata = { +static struct gpio_keys_button dr34x_gpio_keys[] __initdata = { { .desc = "reset", .type = EV_KEY, .code = KEY_RESTART, .debounce_interval = DR344_KEYS_DEBOUNCE_INTERVAL, - .gpio = DR344_GPIO_BTN_RESET, + .gpio = DR34X_GPIO_BTN_RESET, .active_low = 1, }, }; -static struct at803x_platform_data dr344_at803x_data = { +static struct at803x_platform_data dr34x_at803x_data = { .disable_smarteee = 1, .enable_rgmii_rx_delay = 1, .enable_rgmii_tx_delay = 1, }; -static struct mdio_board_info dr344_mdio0_info[] = { +static struct mdio_board_info dr34x_mdio0_info[] = { { .bus_id = "ag71xx-mdio.0", .phy_addr = 0, - .platform_data = &dr344_at803x_data, + .platform_data = &dr34x_at803x_data, }, }; -static void __init dr344_setup(void) +static void __init dr34x_setup(void) { u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); u8 *mac = (u8 *) KSEG1ADDR(0x1f03f810); ath79_register_m25p80(NULL); - ath79_gpio_direction_select(DR344_GPIO_LED_STATUS, true); - gpio_set_value(DR344_GPIO_LED_STATUS, 1); - ath79_gpio_output_select(DR344_GPIO_LED_STATUS, 0); + ath79_gpio_direction_select(DR34X_GPIO_LED_STATUS, true); + gpio_set_value(DR34X_GPIO_LED_STATUS, 1); + ath79_gpio_output_select(DR34X_GPIO_LED_STATUS, 0); - ath79_gpio_direction_select(DR344_GPIO_LED_LAN, true); - gpio_set_value(DR344_GPIO_LED_LAN, 1); - ath79_gpio_output_select(DR344_GPIO_LED_LAN, 0); - - ath79_register_leds_gpio(-1, ARRAY_SIZE(dr344_leds_gpio), - dr344_leds_gpio); ath79_register_gpio_keys_polled(-1, DR344_KEYS_POLL_INTERVAL, - ARRAY_SIZE(dr344_gpio_keys), - dr344_gpio_keys); + ARRAY_SIZE(dr34x_gpio_keys), + dr34x_gpio_keys); ath79_register_usb(); - ath79_wmac_set_ext_lna_gpio(0, DR344_GPIO_EXTERNAL_LNA0); - - ath79_wmac_set_ext_lna_gpio(1, DR344_GPIO_EXTERNAL_LNA1); - - ath79_register_wmac(art + DR344_WMAC_CALDATA_OFFSET, NULL); + ath79_register_wmac(art + DR34X_WMAC_CALDATA_OFFSET, NULL); ath79_register_pci(); - mdiobus_register_board_info(dr344_mdio0_info, - ARRAY_SIZE(dr344_mdio0_info)); + mdiobus_register_board_info(dr34x_mdio0_info, + ARRAY_SIZE(dr34x_mdio0_info)); - ath79_register_mdio(1, 0x0); ath79_register_mdio(0, 0x0); - ath79_init_mac(ath79_eth0_data.mac_addr, mac + DR344_MAC0_OFFSET, 0); - ath79_init_mac(ath79_eth1_data.mac_addr, mac + DR344_MAC1_OFFSET, 0); - ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 | AR934X_ETH_CFG_SW_ONLY_MODE); @@ -167,13 +181,44 @@ static void __init dr344_setup(void) ath79_eth0_pll_data.pll_100 = 0x0101; ath79_eth0_pll_data.pll_10 = 0x1313; + ath79_init_mac(ath79_eth0_data.mac_addr, mac + DR34X_MAC0_OFFSET, 0); + ath79_register_eth(0); +} + +static void __init dr342_setup(void) +{ + dr34x_setup(); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(dr342_leds_gpio), + dr342_leds_gpio); +} + +static void __init dr344_setup(void) +{ + u8 *mac = (u8 *) KSEG1ADDR(0x1f03f810); + + dr34x_setup(); + + ath79_gpio_direction_select(DR344_GPIO_LED_LAN, true); + gpio_set_value(DR344_GPIO_LED_LAN, 1); + ath79_gpio_output_select(DR344_GPIO_LED_LAN, 0); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(dr344_leds_gpio), + dr344_leds_gpio); + + ath79_wmac_set_ext_lna_gpio(0, DR344_GPIO_EXTERNAL_LNA0); + ath79_wmac_set_ext_lna_gpio(1, DR344_GPIO_EXTERNAL_LNA1); + + ath79_register_mdio(1, 0x0); + /* GMAC1 is connected to the internal switch */ ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; ath79_eth1_data.speed = SPEED_1000; ath79_eth1_data.duplex = DUPLEX_FULL; - ath79_register_eth(0); + ath79_init_mac(ath79_eth1_data.mac_addr, mac + DR34X_MAC1_OFFSET, 0); ath79_register_eth(1); } +MIPS_MACHINE(ATH79_MACH_DR342, "DR342", "Wallys DR342", dr342_setup); MIPS_MACHINE(ATH79_MACH_DR344, "DR344", "Wallys DR344", dr344_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c index e0d1ea4381..df52784919 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c @@ -42,17 +42,17 @@ static struct gpio_led gl_ar150_leds_gpio[] __initdata = { { - .name = "gl-ar150:wlan", + .name = "gl-ar150:orange:wlan", .gpio = GL_AR150_GPIO_LED_WLAN, .active_low = 0, }, { - .name = "gl-ar150:lan", + .name = "gl-ar150:green:lan", .gpio = GL_AR150_GPIO_LED_LAN, .active_low = 0, }, { - .name = "gl-ar150:wan", + .name = "gl-ar150:green:wan", .gpio = GL_AR150_GPIO_LED_WAN, .active_low = 0, .default_state = 1, diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c index ca44b364c5..c4e537f861 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c @@ -58,7 +58,7 @@ static struct gpio_led gl_ar300m_leds_gpio[] __initdata = { .active_low = 1, }, { - .name = "gl-ar300m::green:lan", + .name = "gl-ar300m:green:lan", .gpio = GL_AR300M_GPIO_LED_LAN, .active_low = 1, }, diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750.c new file mode 100644 index 0000000000..9ee6e29c02 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750.c @@ -0,0 +1,146 @@ +/* + * GL.iNet GL-AR750 board support + * + * Copyright (C) 2018 Piotr Dymacz + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include +#include +#include +#include + +#include +#include + +#include "common.h" +#include "dev-ap9x-pci.h" +#include "dev-eth.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-m25p80.h" +#include "dev-usb.h" +#include "dev-wmac.h" +#include "machtypes.h" + +#define GL_AR750_GPIO_LED_POWER 12 +#define GL_AR750_GPIO_LED_WLAN2G 14 +#define GL_AR750_GPIO_LED_WLAN5G 13 + +#define GL_AR750_GPIO_BTN_RESET 3 +#define GL_AR750_GPIO_BTN_SW1 0 + +#define GL_AR750_GPIO_I2C_SCL 16 +#define GL_AR750_GPIO_I2C_SDA 17 + +#define GL_AR750_GPIO_USB_POWER 2 + +#define GL_AR750_KEYS_POLL_INTERVAL 20 +#define GL_AR750_KEYS_DEBOUNCE_INTERVAL (3 * GL_AR750_KEYS_POLL_INTERVAL) + +#define GL_AR750_MAC0_OFFSET 0 +#define GL_AR750_WMAC2G_CALDATA_OFFSET 0x1000 +#define GL_AR750_WMAC5G_CALDATA_OFFSET 0x5000 + +static struct gpio_led gl_ar750_leds_gpio[] __initdata = { + { + .name = "gl-ar750:white:power", + .gpio = GL_AR750_GPIO_LED_POWER, + .default_state = LEDS_GPIO_DEFSTATE_KEEP, + .active_low = 1, + }, { + .name = "gl-ar750:white:wlan2g", + .gpio = GL_AR750_GPIO_LED_WLAN2G, + .active_low = 1, + }, { + .name = "gl-ar750:white:wlan5g", + .gpio = GL_AR750_GPIO_LED_WLAN5G, + .active_low = 1, + }, +}; + +static struct gpio_keys_button gl_ar750_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = GL_AR750_KEYS_DEBOUNCE_INTERVAL, + .gpio = GL_AR750_GPIO_BTN_RESET, + .active_low = 1, + }, { + .desc = "sw1", + .type = EV_KEY, + .code = BTN_0, + .debounce_interval = GL_AR750_KEYS_DEBOUNCE_INTERVAL, + .gpio = GL_AR750_GPIO_BTN_SW1, + .active_low = 1, + }, +}; + +static struct i2c_gpio_platform_data gl_ar750_i2c_gpio_data = { + .sda_pin = GL_AR750_GPIO_I2C_SDA, + .scl_pin = GL_AR750_GPIO_I2C_SCL, +}; + +static struct platform_device gl_ar750_i2c_gpio = { + .name = "i2c-gpio", + .id = 0, + .dev = { + .platform_data = &gl_ar750_i2c_gpio_data, + }, +}; + +static void __init gl_ar750_setup(void) +{ + u8 *art = (u8 *) KSEG1ADDR(0x1f050000); + + ath79_register_m25p80(NULL); + + ath79_setup_ar933x_phy4_switch(false, false); + ath79_register_mdio(0, 0x0); + + ath79_switch_data.phy4_mii_en = 1; + ath79_switch_data.phy_poll_mask = 0xfc; + + /* WAN */ + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.phy_mask = BIT(4); + ath79_eth0_data.speed = SPEED_100; + ath79_init_mac(ath79_eth0_data.mac_addr, art + GL_AR750_MAC0_OFFSET, 0); + ath79_register_eth(0); + + /* LAN */ + ath79_eth1_data.duplex = DUPLEX_FULL; + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_init_mac(ath79_eth1_data.mac_addr, art + GL_AR750_MAC0_OFFSET, 1); + ath79_register_eth(1); + + /* Disable JTAG (enables GPIO0-3) */ + ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(gl_ar750_leds_gpio), + gl_ar750_leds_gpio); + + ath79_register_gpio_keys_polled(-1, GL_AR750_KEYS_POLL_INTERVAL, + ARRAY_SIZE(gl_ar750_gpio_keys), + gl_ar750_gpio_keys); + + gpio_request_one(GL_AR750_GPIO_USB_POWER, + GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED, + "USB power"); + + platform_device_register(&gl_ar750_i2c_gpio); + + ath79_register_usb(); + + ath79_register_wmac(art + GL_AR750_WMAC2G_CALDATA_OFFSET, NULL); + + ap91_pci_init(art + GL_AR750_WMAC5G_CALDATA_OFFSET, NULL); +} + +MIPS_MACHINE(ATH79_MACH_GL_AR750, "GL-AR750", "GL.iNet GL-AR750", + gl_ar750_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-n5q.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-n5q.c new file mode 100644 index 0000000000..895fc32933 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-n5q.c @@ -0,0 +1,132 @@ +/* + * ALFA Network N5Q board support + * + * Copyright (C) 2018 Piotr Dymacz + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include +#include + +#include +#include + +#include "common.h" +#include "dev-eth.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-m25p80.h" +#include "dev-wmac.h" +#include "machtypes.h" + +#define N5Q_GPIO_LED_LAN 19 +#define N5Q_GPIO_LED_SIGNAL1 0 +#define N5Q_GPIO_LED_SIGNAL2 1 +#define N5Q_GPIO_LED_SIGNAL3 2 +#define N5Q_GPIO_LED_SIGNAL4 3 +#define N5Q_GPIO_LED_WAN 18 +#define N5Q_GPIO_LED_WLAN 12 + +#define N5Q_GPIO_WDT_EN 16 +#define N5Q_GPIO_WDT_IN 17 + +#define N5Q_GPIO_BTN_RESET 11 + +#define N5Q_MAC0_OFFSET 0 +#define N5Q_MAC1_OFFSET 6 +#define N5Q_WMAC_CALDATA_OFFSET 0x1000 + +#define N5Q_KEYS_POLL_INTERVAL 20 +#define N5Q_KEYS_DEBOUNCE_INTERVAL (3 * N5Q_KEYS_POLL_INTERVAL) + +static struct gpio_led n5q_leds_gpio[] __initdata = { + { + .name = "n5q:green:lan", + .gpio = N5Q_GPIO_LED_LAN, + .active_low = 1, + }, { + .name = "n5q:red:signal1", + .gpio = N5Q_GPIO_LED_SIGNAL1, + .active_low = 1, + }, { + .name = "n5q:orange:signal2", + .gpio = N5Q_GPIO_LED_SIGNAL2, + .active_low = 1, + }, { + .name = "n5q:green:signal3", + .gpio = N5Q_GPIO_LED_SIGNAL3, + .active_low = 1, + }, { + .name = "n5q:green:signal4", + .gpio = N5Q_GPIO_LED_SIGNAL4, + .active_low = 1, + }, { + .name = "n5q:green:wan", + .gpio = N5Q_GPIO_LED_WAN, + .active_low = 1, + }, { + .name = "n5q:green:wlan", + .gpio = N5Q_GPIO_LED_WLAN, + .active_low = 1, + }, +}; + +static struct gpio_keys_button n5q_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = N5Q_KEYS_DEBOUNCE_INTERVAL, + .gpio = N5Q_GPIO_BTN_RESET, + .active_low = 1, + }, +}; + +static void __init n5q_setup(void) +{ + u8 *art = (u8 *) KSEG1ADDR(0x1f070000); + + ath79_register_m25p80(NULL); + + ath79_register_mdio(1, 0x0); + + ath79_switch_data.phy4_mii_en = 1; + ath79_switch_data.phy_poll_mask = 0xf7; + + /* LAN */ + ath79_eth1_data.duplex = DUPLEX_FULL; + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_init_mac(ath79_eth1_data.mac_addr, art + N5Q_MAC1_OFFSET, 0); + ath79_register_eth(1); + + /* WAN */ + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev; + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.phy_mask = BIT(4); + ath79_eth0_data.speed = SPEED_100; + ath79_init_mac(ath79_eth0_data.mac_addr, art + N5Q_MAC0_OFFSET, 0); + ath79_register_eth(0); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(n5q_leds_gpio), + n5q_leds_gpio); + + ath79_register_gpio_keys_polled(-1, N5Q_KEYS_POLL_INTERVAL, + ARRAY_SIZE(n5q_gpio_keys), + n5q_gpio_keys); + + gpio_request_one(N5Q_GPIO_WDT_IN, + GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, + "WDT input"); + + gpio_request_one(N5Q_GPIO_WDT_EN, + GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, + "WDT enable"); + + ath79_register_wmac(art + N5Q_WMAC_CALDATA_OFFSET, NULL); +} + +MIPS_MACHINE(ATH79_MACH_N5Q, "N5Q", "ALFA Network N5Q", n5q_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-r36a.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-r36a.c new file mode 100644 index 0000000000..b3493e2c42 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-r36a.c @@ -0,0 +1,140 @@ +/* + * ALFA Network R36A board support + * + * Copyright (C) 2018 Piotr Dymacz + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include +#include + +#include +#include + +#include "common.h" +#include "dev-eth.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-m25p80.h" +#include "dev-usb.h" +#include "dev-wmac.h" +#include "machtypes.h" + +#define R36A_GPIO_LED_LAN 4 +#define R36A_GPIO_LED_STATUS 14 +#define R36A_GPIO_LED_USB 12 +#define R36A_GPIO_LED_WAN 16 +#define R36A_GPIO_LED_WLAN 15 + +#define R36A_GPIO_WDT_EN 1 +#define R36A_GPIO_WDT_IN 0 +#define R36A_GPIO_USB_PWR 3 + +#define R36A_GPIO_BTN_RESET 2 +#define R36A_GPIO_BTN_RFKILL 17 + +#define R36A_KEYS_POLL_INTERVAL 20 +#define R36A_KEYS_DEBOUNCE_INTERVAL (3 * R36A_KEYS_POLL_INTERVAL) + +#define R36A_WMAC_CALDATA_OFFSET 0x1000 + +static struct gpio_led r36a_leds_gpio[] __initdata = { + { + .name = "r36a:blue:lan", + .gpio = R36A_GPIO_LED_LAN, + .active_low = 1, + }, { + .name = "r36a:blue:status", + .gpio = R36A_GPIO_LED_STATUS, + .active_low = 1, + }, { + .name = "r36a:blue:usb", + .gpio = R36A_GPIO_LED_USB, + .active_low = 1, + }, { + .name = "r36a:blue:wan", + .gpio = R36A_GPIO_LED_WAN, + .active_low = 1, + }, { + .name = "r36a:blue:wlan", + .gpio = R36A_GPIO_LED_WLAN, + .active_low = 1, + }, +}; + +static struct gpio_keys_button r36a_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = R36A_KEYS_DEBOUNCE_INTERVAL, + .gpio = R36A_GPIO_BTN_RESET, + .active_low = 1, + }, { + .desc = "rfkill", + .type = EV_KEY, + .code = KEY_RFKILL, + .debounce_interval = R36A_KEYS_DEBOUNCE_INTERVAL, + .gpio = R36A_GPIO_BTN_RFKILL, + .active_low = 1, + }, +}; + +static void __init r36a_setup(void) +{ + u8 *art = (u8 *) KSEG1ADDR(0x1f070000); + + ath79_register_m25p80(NULL); + + ath79_setup_ar933x_phy4_switch(false, false); + + ath79_register_mdio(0, 0x0); + + ath79_switch_data.phy4_mii_en = 1; + ath79_switch_data.phy_poll_mask = 0xf7; + + /* LAN */ + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.phy_mask = BIT(4); + ath79_eth0_data.speed = SPEED_100; + ath79_init_mac(ath79_eth0_data.mac_addr, art, 0); + ath79_register_eth(0); + + /* WAN */ + ath79_eth1_data.duplex = DUPLEX_FULL; + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_init_mac(ath79_eth1_data.mac_addr, art, 1); + ath79_register_eth(1); + + /* Disable JTAG (enables GPIO0-3) */ + ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(r36a_leds_gpio), + r36a_leds_gpio); + + ath79_register_gpio_keys_polled(-1, R36A_KEYS_POLL_INTERVAL, + ARRAY_SIZE(r36a_gpio_keys), + r36a_gpio_keys); + + gpio_request_one(R36A_GPIO_WDT_IN, + GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, + "WDT input"); + + gpio_request_one(R36A_GPIO_WDT_EN, + GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, + "WDT enable"); + + gpio_request_one(R36A_GPIO_USB_PWR, + GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED, + "USB power"); + + ath79_register_wmac(art + R36A_WMAC_CALDATA_OFFSET, NULL); + + ath79_register_usb(); +} + +MIPS_MACHINE(ATH79_MACH_R36A, "R36A", "ALFA Network R36A", r36a_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb4xx.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb4xx.c index ae0a772d5b..722993ff9b 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb4xx.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb4xx.c @@ -11,12 +11,7 @@ #include #include -#include -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) -#include -#else #include -#endif #include #include #include diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb922.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb922.c index 577fb0eee0..2f54d029f6 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb922.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb922.c @@ -195,7 +195,9 @@ static int rb922gs_nand_scan_fixup(struct mtd_info *mtd) { #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) struct nand_chip *chip = mtd->priv; -#endif +#else + struct nand_chip *chip = mtd_to_nand(mtd); +#endif /* < 4.6.0 */ if (mtd->writesize == 512) { /* @@ -209,6 +211,8 @@ static int rb922gs_nand_scan_fixup(struct mtd_info *mtd) #endif } + chip->options = NAND_NO_SUBPAGE_WRITE; + return 0; } @@ -252,7 +256,7 @@ static void __init rb922gs_setup(void) if (!info) return; - scnprintf(buf, sizeof(buf), "Mikrotik RouterBOARD %s", + scnprintf(buf, sizeof(buf), "MikroTik RouterBOARD %s", (info->board_name) ? info->board_name : ""); mips_set_machine_name(buf); @@ -272,9 +276,16 @@ static void __init rb922gs_setup(void) ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; ath79_eth0_data.phy_mask = BIT(RB922_PHY_ADDR); - ath79_eth0_pll_data.pll_10 = 0x81001313; - ath79_eth0_pll_data.pll_100 = 0x81000101; - ath79_eth0_pll_data.pll_1000 = 0x8f000000; + if (strcmp(info->board_name, "921GS-5HPacD r2") == 0) { + ath79_eth0_pll_data.pll_10 = 0xa0001313; + ath79_eth0_pll_data.pll_100 = 0xa0000101; + ath79_eth0_pll_data.pll_1000 = 0x8f000000; + } + else { + ath79_eth0_pll_data.pll_10 = 0x81001313; + ath79_eth0_pll_data.pll_100 = 0x81000101; + ath79_eth0_pll_data.pll_1000 = 0x8f000000; + } ath79_register_eth(0); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c index 9eaeaa7f9d..5e24694d5c 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c @@ -207,7 +207,11 @@ static const struct mtd_ooblayout_ops rb95x_nand_ecclayout_ops = { static int rb95x_nand_scan_fixup(struct mtd_info *mtd) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) struct nand_chip *chip = mtd->priv; +#else + struct nand_chip *chip = mtd_to_nand(mtd); +#endif /* < 4.6.0 */ if (mtd->writesize == 512) { /* diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c index 4cdc171de1..8d8dd40e8a 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c @@ -1,6 +1,7 @@ /* * MikroTik SPI-NOR RouterBOARDs support * + * - MikroTik RouterBOARD mAP 2nD * - MikroTik RouterBOARD mAP L-2nD * - MikroTik RouterBOARD 941L-2nD * - MikroTik RouterBOARD 951Ui-2nD @@ -10,11 +11,11 @@ * - MikroTik RouterBOARD 750P-PBr2 * - MikroTik RouterBOARD 750 r2 * - MikroTik RouterBOARD LHG 5nD + * - MikroTik RouterBOARD wAP2nD + * - MikroTik RouterBOARD wAP G-5HacT2HnDwAP (wAP AC) * * Preliminary support for the following hardware - * - MikroTik RouterBOARD wAP2nD * - MikroTik RouterBOARD cAP2nD - * - MikroTik RouterBOARD mAP2nD * Furthermore, the cAP lite (cAPL2nD) appears to feature the exact same * hardware as the mAP L-2nD. It is unknown if they share the same board * identifier. @@ -41,6 +42,8 @@ #include #include +#include +#include #include #include @@ -134,10 +137,22 @@ static struct flash_platform_data rbspi_spi_flash_data = { .nr_parts = ARRAY_SIZE(rbspi_spi_partitions), }; -/* Several boards only have a single reset button wired to GPIO 16 */ +/* Several boards only have a single reset button, wired to GPIO 1, 16 or 20 */ +#define RBSPI_GPIO_BTN_RESET01 1 #define RBSPI_GPIO_BTN_RESET16 16 #define RBSPI_GPIO_BTN_RESET20 20 +static struct gpio_keys_button rbspi_gpio_keys_reset01[] __initdata = { + { + .desc = "Reset button", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = RBSPI_KEYS_DEBOUNCE_INTERVAL, + .gpio = RBSPI_GPIO_BTN_RESET01, + .active_low = 1, + }, +}; + static struct gpio_keys_button rbspi_gpio_keys_reset16[] __initdata = { { .desc = "Reset button", @@ -405,7 +420,7 @@ static struct gpio_led rbmap_leds[] __initdata = { .active_low = 1, }, { .name = "rb:green:eth2", - .gpio = RBMAP_GPIO_LED_WLAN, + .gpio = RBMAP_GPIO_LED_LAN2, .active_low = 1, }, { .name = "rb:red:poe_out", @@ -485,9 +500,44 @@ static struct gpio_keys_button rblhg_gpio_keys[] __initdata = { }, }; +/* RB w APG-5HacT2HnD (wAP AC) gpios*/ +#define RBWAPGSC_LED1 1 +#define RBWAPGSC_LED2 8 +#define RBWAPGSC_LED3 9 +#define RBWAPGSC_POWERLED 16 +#define RBWAPGSC_GPIO_MDIO_MDC 12 +#define RBWAPGSC_GPIO_MDIO_DATA 11 +#define RBWAPGSC_MDIO_PHYADDR 0 + +static struct gpio_led rbwapgsc_leds[] __initdata = { + { + .name = "rb:green:led1", + .gpio = RBWAPGSC_LED1, + .active_low = 1, + },{ + .name = "rb:blue:power", + .gpio = RBWAPGSC_POWERLED, + .active_low = 1, + }, +}; + +static struct mdio_gpio_platform_data rbwapgsc_mdio_data = { + .mdc = RBWAPGSC_GPIO_MDIO_MDC, + .mdio = RBWAPGSC_GPIO_MDIO_DATA, + .phy_mask = ~BIT(RBWAPGSC_MDIO_PHYADDR), +}; + +static struct platform_device rbwapgsc_phy_device = { + .name = "mdio-gpio", + .id = 1, + .dev = { + .platform_data = &rbwapgsc_mdio_data + }, +}; static struct gen_74x164_chip_platform_data rbspi_ssr_data = { .base = RBSPI_SSR_GPIO_BASE, + .num_registers = 1, }; /* the spi-ath79 driver can only natively handle CS0. Other CS are bit-banged */ @@ -537,7 +587,7 @@ void __init rbspi_wlan_init(u16 id, int wmac_offset) } #define RBSPI_MACH_BUFLEN 64 -/* +/* * Common platform init routine for all SPI NOR devices. */ static int __init rbspi_platform_setup(void) @@ -640,7 +690,7 @@ static void __init rbspi_network_setup(u32 flags, int gmac1_offset, rbspi_wlan_init(1, wmac1_offset); } -/* +/* * Init the mAP lite hardware (QCA953x). * The mAP L-2nD (mAP lite) has a single ethernet port, connected to PHY0. * Trying to use GMAC0 in direct mode was unsucessful, so we're @@ -872,7 +922,7 @@ static void __init rblhg_setup(void) } /* - * Init the wAP hardware (EXPERIMENTAL). + * Init the wAP hardware. * The wAP 2nD has a single ethernet port. */ static void __init rbwap_setup(void) @@ -888,6 +938,11 @@ static void __init rbwap_setup(void) rbspi_network_setup(flags, 0, 1, 0); ath79_register_leds_gpio(-1, ARRAY_SIZE(rbwap_leds), rbwap_leds); + + /* wAP has a single reset button as GPIO 16 */ + ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL, + ARRAY_SIZE(rbspi_gpio_keys_reset16), + rbspi_gpio_keys_reset16); } /* @@ -914,13 +969,14 @@ static void __init rbcap_setup(void) } /* - * Init the mAP hardware (EXPERIMENTAL). - * The mAP 2nD has two ethernet ports, PoE output and an SSR for LED - * multiplexing. + * Init the mAP hardware. + * The mAP 2nD has two ethernet ports, PoE output, SSR for LED + * multiplexing and USB port. */ static void __init rbmap_setup(void) { - u32 flags = RBSPI_HAS_WLAN0 | RBSPI_HAS_SSR | RBSPI_HAS_POE; + u32 flags = RBSPI_HAS_USB | RBSPI_HAS_WLAN0 | + RBSPI_HAS_SSR | RBSPI_HAS_POE; if (rbspi_platform_setup()) return; @@ -933,12 +989,65 @@ static void __init rbmap_setup(void) if (flags & RBSPI_HAS_POE) gpio_request_one(RBMAP_GPIO_POE_POWER, - GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED, + GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, "POE power"); + /* USB power GPIO is inverted, set GPIOF_ACTIVE_LOW for consistency */ + if (flags & RBSPI_HAS_USB) + gpio_request_one(RBMAP_GPIO_USB_POWER, + GPIOF_OUT_INIT_HIGH | GPIOF_ACTIVE_LOW | + GPIOF_EXPORT_DIR_FIXED, + "USB power"); + ath79_register_leds_gpio(-1, ARRAY_SIZE(rbmap_leds), rbmap_leds); + + /* mAP 2nD has a single reset button as gpio 16 */ + ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL, + ARRAY_SIZE(rbspi_gpio_keys_reset16), + rbspi_gpio_keys_reset16); } +/* + * Init the wAPGSC (RB wAPG-5HacT2HnD // wAP AC) hardware. + * The wAPGSC has one Ethernet port via AR8033 with PoE input, dual radio (SoC + * 2.4 GHz and external QCA9880) and a ZT2046Q temperature and voltage sensor + * (currently not supported). + */ +static void __init rbwapgsc_setup(void) +{ + u32 flags = RBSPI_HAS_PCI; + + if (rbspi_platform_setup()) + return; + + rbspi_peripherals_setup(flags); + + platform_device_register(&rbwapgsc_phy_device); + + ath79_init_mac(ath79_eth1_data.mac_addr, ath79_mac_base, 0); + ath79_eth1_data.mii_bus_dev = &rbwapgsc_phy_device.dev; + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII; + ath79_eth1_data.phy_mask = BIT(RBWAPGSC_MDIO_PHYADDR); + ath79_eth1_pll_data.pll_1000 = 0x03000101; + ath79_eth1_pll_data.pll_100 = 0x80000101; + ath79_eth1_pll_data.pll_10 = 0x80001313; + ath79_eth1_data.speed = SPEED_1000; + ath79_eth1_data.duplex = DUPLEX_FULL; + ath79_register_eth(1); + + rbspi_wlan_init(1, 2); + + ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL, + ARRAY_SIZE(rbspi_gpio_keys_reset01), + rbspi_gpio_keys_reset01); + + ath79_gpio_function_enable(QCA955X_GPIO_FUNC_JTAG_DISABLE| + QCA955X_GPIO_REG_OUT_FUNC4| + QCA955X_GPIO_REG_OUT_FUNC3); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(rbwapgsc_leds), + rbwapgsc_leds); +} MIPS_MACHINE_NONAME(ATH79_MACH_RB_MAPL, "map-hb", rbmapl_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_941, "H951L", rbhapl_setup); @@ -949,3 +1058,4 @@ MIPS_MACHINE_NONAME(ATH79_MACH_RB_LHG5, "lhg", rblhg_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_WAP, "wap-hb", rbwap_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_CAP, "cap-hb", rbcap_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_MAP, "map2-hb", rbmap_setup); +MIPS_MACHINE_NONAME(ATH79_MACH_RB_WAPAC, "wapg-sc", rbwapgsc_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rut9xx.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rut9xx.c new file mode 100644 index 0000000000..43a2a78c67 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rut9xx.c @@ -0,0 +1,191 @@ +/* + * Teltonika RUT900 series boards support + * + * Copyright (C) 2018 Piotr Dymacz + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "common.h" +#include "dev-eth.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-m25p80.h" +#include "dev-usb.h" +#include "dev-wmac.h" +#include "machtypes.h" + +#define RUT9XX_GPIO_LED_LAN1 14 +#define RUT9XX_GPIO_LED_LAN2 13 +#define RUT9XX_GPIO_LED_LAN3 22 +#define RUT9XX_GPIO_LED_WAN 1 + +#define RUT9XX_PCA9539_GPIO_BASE 32 +#define RUT9XX_PCA9539_GPIO_SIGNAL1 (0 + RUT9XX_PCA9539_GPIO_BASE) +#define RUT9XX_PCA9539_GPIO_SIGNAL2 (1 + RUT9XX_PCA9539_GPIO_BASE) +#define RUT9XX_PCA9539_GPIO_SIGNAL3 (2 + RUT9XX_PCA9539_GPIO_BASE) +#define RUT9XX_PCA9539_GPIO_SIGNAL4 (3 + RUT9XX_PCA9539_GPIO_BASE) +#define RUT9XX_PCA9539_GPIO_SIGNAL5 (4 + RUT9XX_PCA9539_GPIO_BASE) +#define RUT9XX_PCA9539_GPIO_STATUS_R (5 + RUT9XX_PCA9539_GPIO_BASE) +#define RUT9XX_PCA9539_GPIO_STATUS_G (6 + RUT9XX_PCA9539_GPIO_BASE) + +#define RUT9XX_GPIO_BTN_RESET 15 + +#define RUT9XX_GPIO_I2C_SCK 16 +#define RUT9XX_GPIO_I2C_SDA 17 + +#define RUT9XX_GPIO_EXT_LNA0 2 + +#define RUT9XX_WMAC_CALDATA_OFFSET 0x1000 + +#define RUT9XX_KEYS_POLL_INTERVAL 20 +#define RUT9XX_KEYS_DEBOUNCE_INTERVAL (3 * RUT9XX_KEYS_POLL_INTERVAL) + +static struct gpio_led rut900_leds_gpio[] __initdata = { + { + .name = "rut900:green:lan1", + .gpio = RUT9XX_GPIO_LED_LAN1, + .active_low = 1, + }, { + .name = "rut900:green:lan2", + .gpio = RUT9XX_GPIO_LED_LAN2, + .active_low = 1, + }, { + .name = "rut900:green:lan3", + .gpio = RUT9XX_GPIO_LED_LAN3, + .active_low = 1, + }, { + .name = "rut900:green:signal1", + .gpio = RUT9XX_PCA9539_GPIO_SIGNAL1, + .active_low = 0, + }, { + .name = "rut900:green:signal2", + .gpio = RUT9XX_PCA9539_GPIO_SIGNAL2, + .active_low = 0, + }, { + .name = "rut900:green:signal3", + .gpio = RUT9XX_PCA9539_GPIO_SIGNAL3, + .active_low = 0, + }, { + .name = "rut900:green:signal4", + .gpio = RUT9XX_PCA9539_GPIO_SIGNAL4, + .active_low = 0, + }, { + .name = "rut900:green:signal5", + .gpio = RUT9XX_PCA9539_GPIO_SIGNAL5, + .active_low = 0, + }, { + .name = "rut900:green:status", + .gpio = RUT9XX_PCA9539_GPIO_STATUS_G, + .active_low = 0, + }, { + .name = "rut900:green:wan", + .gpio = RUT9XX_GPIO_LED_WAN, + .active_low = 1, + }, { + .name = "rut900:red:status", + .gpio = RUT9XX_PCA9539_GPIO_STATUS_R, + .active_low = 0, + }, +}; + +static struct gpio_keys_button rut900_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = RUT9XX_KEYS_DEBOUNCE_INTERVAL, + .gpio = RUT9XX_GPIO_BTN_RESET, + .active_low = 1, + }, +}; + +static struct i2c_gpio_platform_data rut900_i2c_gpio_data = { + .sda_pin = RUT9XX_GPIO_I2C_SDA, + .scl_pin = RUT9XX_GPIO_I2C_SCK, + .udelay = 10, +}; + +static struct platform_device rut900_i2c_device = { + .name = "i2c-gpio", + .id = 0, + .dev = { + .platform_data = &rut900_i2c_gpio_data, + }, +}; + +static struct pca953x_platform_data rut9xx_pca9539_data = { + .gpio_base = RUT9XX_PCA9539_GPIO_BASE, + .irq_base = -1, +}; + +static struct i2c_board_info rut900_i2c_devs[] __initdata = { + { + I2C_BOARD_INFO("pca9539", 0x74), + .platform_data = &rut9xx_pca9539_data, + }, +}; + +static void __init rut900_setup(void) +{ + u8 *art = (u8 *) KSEG1ADDR(0x1f030000); + u8 *mac = (u8 *) KSEG1ADDR(0x1f020000); + u8 wlan_mac[ETH_ALEN]; + + ath79_register_m25p80(NULL); + + ath79_register_mdio(1, 0x0); + + ath79_switch_data.phy4_mii_en = 1; + ath79_switch_data.phy_poll_mask = 0xf1; + + /* LAN */ + ath79_eth1_data.duplex = DUPLEX_FULL; + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0); + ath79_register_eth(1); + + /* WAN */ + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev; + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.phy_mask = BIT(4); + ath79_eth0_data.speed = SPEED_100; + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); + ath79_register_eth(0); + + platform_device_register(&rut900_i2c_device); + i2c_register_board_info(0, rut900_i2c_devs, + ARRAY_SIZE(rut900_i2c_devs)); + + /* Disable JTAG (enables GPIO0-3) */ + ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(rut900_leds_gpio), + rut900_leds_gpio); + + ath79_register_gpio_keys_polled(-1, RUT9XX_KEYS_POLL_INTERVAL, + ARRAY_SIZE(rut900_gpio_keys), + rut900_gpio_keys); + + ath79_wmac_set_ext_lna_gpio(0, RUT9XX_GPIO_EXT_LNA0); + + ath79_init_mac(wlan_mac, mac, 2); + ath79_register_wmac(art + RUT9XX_WMAC_CALDATA_OFFSET, wlan_mac); + + ath79_register_usb(); +} + +MIPS_MACHINE(ATH79_MACH_RUT9XX, "RUT900", "Teltonika RUT900", rut900_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa901nd-v4.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa901nd-v4.c index 9c651bb1d2..ffbcd6fe42 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa901nd-v4.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa901nd-v4.c @@ -1,5 +1,5 @@ /* - * TP-LINK TL-WA901ND v4 board + * TP-LINK TL-WA901ND v4, v5 board * * Copyright (C) 2015 Matthias Schiffer * Copyright (C) 2016 Tiziano Bacocco @@ -110,3 +110,6 @@ static void __init TL_WA901ND_V4_setup(void) MIPS_MACHINE(ATH79_MACH_TL_WA901ND_V4, "TL-WA901ND-v4", "TP-LINK TL-WA901ND v4", TL_WA901ND_V4_setup); + +MIPS_MACHINE(ATH79_MACH_TL_WA901ND_V5, "TL-WA901ND-v5", "TP-LINK TL-WA901ND v5", + TL_WA901ND_V4_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1043nd-v4.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1043nd-v4.c index b1539c5d71..450819a9e6 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1043nd-v4.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1043nd-v4.c @@ -5,6 +5,7 @@ * Copyright (C) 2016 Matthias Schiffer * Copyright (C) 2016 Andreas Ziegler * Copyright (C) 2016 Ludwig Thomeczek + * Copyright (C) 2017 Tim Thorpe * * Derived from: mach-dir-869-a1.c * @@ -62,6 +63,8 @@ #define TL_WR1043_V4_EEPROM_ADDR 0x1fff0000 #define TL_WR1043_V4_WMAC_CALDATA_OFFSET 0x1000 +#define TL_WR1043N_V5_MAC_LOCATION 0x1ff00008 + static struct gpio_led tl_wr1043nd_v4_leds_gpio[] __initdata = { { .name = "tp-link:green:wps", @@ -188,3 +191,82 @@ static void __init tl_wr1043nd_v4_setup(void) MIPS_MACHINE(ATH79_MACH_TL_WR1043ND_V4, "TL-WR1043ND-v4", "TP-LINK TL-WR1043ND v4", tl_wr1043nd_v4_setup); + +static struct gpio_led tl_wr1043n_v5_leds_gpio[] __initdata = { + { + .name = "tp-link:green:wps", + .gpio = TL_WR1043_V4_GPIO_LED_WPS, + .active_low = 1, + }, + { + .name = "tp-link:green:system", + .gpio = TL_WR1043_V4_GPIO_LED_SYSTEM, + .active_low = 1, + }, + { + .name = "tp-link:green:wlan", + .gpio = TL_WR1043_V4_GPIO_LED_WLAN, + .active_low = 1, + }, + { + .name = "tp-link:green:wan", + .gpio = TL_WR1043_V4_GPIO_LED_WAN, + .active_low = 1, + }, + { + .name = "tp-link:green:lan1", + .gpio = TL_WR1043_V4_GPIO_LED_LAN1, + .active_low = 1, + }, + { + .name = "tp-link:green:lan2", + .gpio = TL_WR1043_V4_GPIO_LED_LAN2, + .active_low = 1, + }, + { + .name = "tp-link:green:lan3", + .gpio = TL_WR1043_V4_GPIO_LED_LAN3, + .active_low = 1, + }, + { + .name = "tp-link:green:lan4", + .gpio = TL_WR1043_V4_GPIO_LED_LAN4, + .active_low = 1, + }, +}; + +/* The 1043Nv5 is identical to the 1043NDv4, + * only missing the usb and small firmware layout changes */ +static void __init tl_wr1043nv5_setup(void) +{ + u8 *art = (u8 *) KSEG1ADDR(TL_WR1043_V4_EEPROM_ADDR); + u8 *mac = (u8 *) KSEG1ADDR(TL_WR1043N_V5_MAC_LOCATION); + + ath79_register_m25p80(NULL); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr1043n_v5_leds_gpio), + tl_wr1043n_v5_leds_gpio); + ath79_register_gpio_keys_polled(-1, TL_WR1043_V4_KEYS_POLL_INTERVAL, + ARRAY_SIZE(tl_wr1043nd_v4_gpio_keys), + tl_wr1043nd_v4_gpio_keys); + + platform_device_register(&ath79_mdio0_device); + + mdiobus_register_board_info(tl_wr1043nd_v4_mdio0_info, + ARRAY_SIZE(tl_wr1043nd_v4_mdio0_info)); + + ath79_register_wmac(art + TL_WR1043_V4_WMAC_CALDATA_OFFSET, mac); + + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); + + /* GMAC0 is connected to an AR8337 switch */ + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII; + ath79_eth0_data.speed = SPEED_1000; + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.phy_mask = BIT(0); + ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; + ath79_register_eth(0); +} + +MIPS_MACHINE(ATH79_MACH_TL_WR1043N_V5, "TL-WR1043N-v5", "TP-LINK TL-WR1043N v5", + tl_wr1043nv5_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr802n-v2.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr802n-v2.c deleted file mode 100644 index 10e0c595a6..0000000000 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr802n-v2.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * TP-LINK TL-WR802N v2 - * - * Copyright (C) 2016 Thomas Roberts > - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - */ - -#include -#include - -#include -#include - -#include "common.h" -#include "dev-eth.h" -#include "dev-gpio-buttons.h" -#include "dev-leds-gpio.h" -#include "dev-m25p80.h" -#include "dev-wmac.h" -#include "machtypes.h" - -#define TL_WR802N_V2_GPIO_LED_SYSTEM 13 -#define TL_WR802N_V2_GPIO_BTN_RESET 11 - -#define TL_WR802N_V2_KEYS_POLL_INTERVAL 20 /* msecs */ -#define TL_WR802N_V2_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR802N_V2_KEYS_POLL_INTERVAL) - -static const char *tl_wr802n_v2_part_probes[] = { - "tp-link", - NULL, -}; - -static struct flash_platform_data tl_wr802n_v2_flash_data = { - .part_probes = tl_wr802n_v2_part_probes, -}; - -static struct gpio_led tl_wr802n_v2_leds_gpio[] __initdata = { - { - .name = "tl-wr802n-v2:green:system", - .gpio = TL_WR802N_V2_GPIO_LED_SYSTEM, - .active_low = 1, - }, -}; - -static struct gpio_keys_button tl_wr802n_v2_gpio_keys[] __initdata = { - { - .desc = "reset", - .type = EV_KEY, - .code = KEY_RESTART, - .debounce_interval = TL_WR802N_V2_KEYS_DEBOUNCE_INTERVAL, - .gpio = TL_WR802N_V2_GPIO_BTN_RESET, - .active_low = 0, - } -}; - -static void __init tl_ap143_setup(void) -{ - u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); - u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); - u8 tmpmac[ETH_ALEN]; - - ath79_register_m25p80(&tl_wr802n_v2_flash_data); - - ath79_setup_ar933x_phy4_switch(false, false); - - ath79_register_mdio(0, 0x0); - - /* LAN */ - ath79_switch_data.phy4_mii_en = 1; - ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; - ath79_eth0_data.duplex = DUPLEX_FULL; - ath79_eth0_data.speed = SPEED_100; - ath79_eth0_data.phy_mask = BIT(4); - ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); - ath79_register_eth(0); - - ath79_init_mac(tmpmac, mac, 0); - ath79_register_wmac(ee, tmpmac); -}; - -static void __init tl_wr802n_v2_setup(void) -{ - tl_ap143_setup(); - - ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr802n_v2_leds_gpio), - tl_wr802n_v2_leds_gpio); - - ath79_register_gpio_keys_polled(1, TL_WR802N_V2_KEYS_POLL_INTERVAL, - ARRAY_SIZE(tl_wr802n_v2_gpio_keys), - tl_wr802n_v2_gpio_keys); -} - -MIPS_MACHINE(ATH79_MACH_TL_WR802N_V2, "TL-WR802N-v2", "TP-LINK TL-WR802N v2", - tl_wr802n_v2_setup); \ No newline at end of file diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr802n.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr802n.c index 21c628e0a3..ece38f900f 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr802n.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr802n.c @@ -1,7 +1,8 @@ /* - * TP-LINK TL-WR802N v1 + * TP-LINK TL-WR802N v1, v2 * * Copyright (C) 2015 Rick Pannen > + * Copyright (C) 2016 Thomas Roberts > * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published @@ -22,77 +23,95 @@ #include "dev-wmac.h" #include "machtypes.h" -#define TL_WR802N_V1_GPIO_LED_SYSTEM 13 -#define TL_WR802N_V1_GPIO_BTN_RESET 11 +#define TL_WR802N_GPIO_LED_SYSTEM 13 +#define TL_WR802N_GPIO_BTN_RESET 11 -#define TL_WR802N_V1_KEYS_POLL_INTERVAL 20 /* msecs */ -#define TL_WR802N_V1_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR802N_V1_KEYS_POLL_INTERVAL) +#define TL_WR802N_KEYS_POLL_INTERVAL 20 /* msecs */ +#define TL_WR802N_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR802N_KEYS_POLL_INTERVAL) -static const char *tl_wr802n_v1_part_probes[] = { +static const char *tl_wr802n_part_probes[] = { "tp-link", NULL, }; -static struct flash_platform_data tl_wr802n_v1_flash_data = { - .part_probes = tl_wr802n_v1_part_probes, +static struct flash_platform_data tl_wr802n_flash_data = { + .part_probes = tl_wr802n_part_probes, }; static struct gpio_led tl_wr802n_v1_leds_gpio[] __initdata = { { .name = "tp-link:blue:system", - .gpio = TL_WR802N_V1_GPIO_LED_SYSTEM, + .gpio = TL_WR802N_GPIO_LED_SYSTEM, .active_low = 1, }, }; -static struct gpio_keys_button tl_wr802n_v1_gpio_keys[] __initdata = { +static struct gpio_led tl_wr802n_v2_leds_gpio[] __initdata = { + { + .name = "tl-wr802n-v2:green:system", + .gpio = TL_WR802N_GPIO_LED_SYSTEM, + .active_low = 1, + }, +}; + +static struct gpio_keys_button tl_wr802n_gpio_keys[] __initdata = { { .desc = "reset", .type = EV_KEY, .code = KEY_RESTART, - .debounce_interval = TL_WR802N_V1_KEYS_DEBOUNCE_INTERVAL, - .gpio = TL_WR802N_V1_GPIO_BTN_RESET, + .debounce_interval = TL_WR802N_KEYS_DEBOUNCE_INTERVAL, + .gpio = TL_WR802N_GPIO_BTN_RESET, .active_low = 0, } }; static void __init tl_ap143_setup(void) { - u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); - u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); - u8 tmpmac[ETH_ALEN]; + u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); + u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); + u8 tmpmac[ETH_ALEN]; - ath79_register_m25p80(&tl_wr802n_v1_flash_data); + ath79_register_m25p80(&tl_wr802n_flash_data); - ath79_setup_ar933x_phy4_switch(false, false); + ath79_setup_ar933x_phy4_switch(false, false); - ath79_register_mdio(0, 0x0); + ath79_register_mdio(0, 0x0); - /* LAN */ - ath79_switch_data.phy4_mii_en = 1; - ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; - ath79_eth0_data.duplex = DUPLEX_FULL; - ath79_eth0_data.speed = SPEED_100; - ath79_eth0_data.phy_mask = BIT(4); - ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); - ath79_register_eth(0); + /* LAN */ + ath79_switch_data.phy4_mii_en = 1; + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.speed = SPEED_100; + ath79_eth0_data.phy_mask = BIT(4); + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); + ath79_register_eth(0); - ath79_init_mac(tmpmac, mac, 0); - ath79_register_wmac(ee, tmpmac); -}; + ath79_init_mac(tmpmac, mac, 0); + ath79_register_wmac(ee, tmpmac); + + ath79_register_gpio_keys_polled(1, TL_WR802N_KEYS_POLL_INTERVAL, + ARRAY_SIZE(tl_wr802n_gpio_keys), + tl_wr802n_gpio_keys); +} static void __init tl_wr802n_v1_setup(void) { tl_ap143_setup(); ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr802n_v1_leds_gpio), - tl_wr802n_v1_leds_gpio); + tl_wr802n_v1_leds_gpio); +} - ath79_register_gpio_keys_polled(1, TL_WR802N_V1_KEYS_POLL_INTERVAL, - ARRAY_SIZE(tl_wr802n_v1_gpio_keys), - tl_wr802n_v1_gpio_keys); +static void __init tl_wr802n_v2_setup(void) +{ + tl_ap143_setup(); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr802n_v2_leds_gpio), + tl_wr802n_v2_leds_gpio); } MIPS_MACHINE(ATH79_MACH_TL_WR802N_V1, "TL-WR802N-v1", "TP-LINK TL-WR802N v1", tl_wr802n_v1_setup); +MIPS_MACHINE(ATH79_MACH_TL_WR802N_V2, "TL-WR802N-v2", "TP-LINK TL-WR802N v2", + tl_wr802n_v2_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr810n.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr810n.c index 906c5f8d4d..588bb9d861 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr810n.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr810n.c @@ -88,27 +88,20 @@ static struct gpio_keys_button tl_wr810n_gpio_keys[] __initdata = { }, }; -static void __init tl_wr810n_setup(void) +static void __init tl_ap143_setup(int lan_mac_offset) { u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); - ath79_setup_ar933x_phy4_switch(false, false); - ath79_register_m25p80(&tl_wr810n_flash_data); - ath79_register_leds_gpio(-1, - ARRAY_SIZE(tl_wr810n_leds_gpio), - tl_wr810n_leds_gpio); - ath79_register_gpio_keys_polled(-1, - TL_WR810N_KEYS_POLL_INTERVAL, - ARRAY_SIZE(tl_wr810n_gpio_keys), - tl_wr810n_gpio_keys); + + ath79_setup_ar933x_phy4_switch(false, false); ath79_register_mdio(0, 0x0); /* WAN */ - ath79_eth0_data.duplex = DUPLEX_FULL; ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.duplex = DUPLEX_FULL; ath79_eth0_data.speed = SPEED_100; ath79_eth0_data.phy_mask = BIT(4); ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); @@ -116,20 +109,41 @@ static void __init tl_wr810n_setup(void) /* LAN */ ath79_switch_data.phy4_mii_en = 1; - ath79_eth1_data.duplex = DUPLEX_FULL; ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_eth1_data.duplex = DUPLEX_FULL; ath79_eth1_data.speed = SPEED_1000; ath79_switch_data.phy_poll_mask |= BIT(4); - ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1); + ath79_init_mac(ath79_eth1_data.mac_addr, mac, lan_mac_offset); ath79_register_eth(1); ath79_register_wmac(art + TL_WR810N_WMAC_CALDATA_OFFSET, mac); + ath79_register_leds_gpio(-1, + ARRAY_SIZE(tl_wr810n_leds_gpio), + tl_wr810n_leds_gpio); + ath79_register_gpio_keys_polled(-1, + TL_WR810N_KEYS_POLL_INTERVAL, + ARRAY_SIZE(tl_wr810n_gpio_keys), + tl_wr810n_gpio_keys); +} + +static void __init tl_wr810n_setup(void) +{ + tl_ap143_setup(-1); + gpio_request_one(TL_WR810N_GPIO_USB_POWER, GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED, "USB power"); ath79_register_usb(); } +static void __init tl_wr810n_v2_setup(void) +{ + tl_ap143_setup(0); +} + MIPS_MACHINE(ATH79_MACH_TL_WR810N, "TL-WR810N", "TP-LINK TL-WR810N", tl_wr810n_setup); + +MIPS_MACHINE(ATH79_MACH_TL_WR810N_V2, "TL-WR810N-v2", "TP-LINK TL-WR810N v2", + tl_wr810n_v2_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wlr8100.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wlr8100.c index 88022e7533..2374c4539f 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wlr8100.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wlr8100.c @@ -49,11 +49,6 @@ #define WLR8100_KEYS_POLL_INTERVAL 20 /* msecs */ #define WLR8100_KEYS_DEBOUNCE_INTERVAL (3 * WLR8100_KEYS_POLL_INTERVAL) -#define WLR8100_MAC0_OFFSET 0 -#define WLR8100_MAC1_OFFSET 6 -#define WLR8100_WMAC_CALDATA_OFFSET 0x1000 -#define WLR8100_PCIE_CALDATA_OFFSET 0x5000 - static struct gpio_led wlr8100_leds_gpio[] __initdata = { { .name = "wlr8100:amber:status", @@ -138,7 +133,6 @@ static struct mdio_board_info wlr8100_mdio0_info[] = { static void __init wlr8100_common_setup(void) { - u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); ath79_register_m25p80(NULL); @@ -150,14 +144,12 @@ static void __init wlr8100_common_setup(void) ath79_register_usb(); - ath79_register_wmac(art + WLR8100_WMAC_CALDATA_OFFSET, NULL); + ath79_register_wmac_simple(); ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN); ath79_register_mdio(0, 0x0); - ath79_init_mac(ath79_eth0_data.mac_addr, art + WLR8100_MAC0_OFFSET, 0); - mdiobus_register_board_info(wlr8100_mdio0_info, ARRAY_SIZE(wlr8100_mdio0_info)); @@ -178,8 +170,6 @@ static void __init wlr8100_common_setup(void) static void __init wlr8100_010_setup(void) { - u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); - /* GMAC0 of the AR8337 switch is connected to GMAC0 via RGMII */ wlr8100_ar8327_pad0_cfg.mode = AR8327_PAD_MAC_RGMII; wlr8100_ar8327_pad0_cfg.txclk_delay_en = true; @@ -196,7 +186,7 @@ static void __init wlr8100_010_setup(void) ath79_eth1_pll_data.pll_1000 = 0x03000101; wlr8100_common_setup(); - ap91_pci_init(art + WLR8100_PCIE_CALDATA_OFFSET, NULL); + ap91_pci_init_simple(); } MIPS_MACHINE(ATH79_MACH_WLR8100, "WLR8100", diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wzr-hp-ag300h.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wzr-hp-ag300h.c index ec3f1ff845..a9ed3fdd46 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wzr-hp-ag300h.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wzr-hp-ag300h.c @@ -192,9 +192,6 @@ static void __init wzrhpag300h_setup(void) ap94_pci_init(eeprom1, mac1, eeprom2, mac2); - ap9x_pci_setup_wmac_led_pin(0, 1); - ap9x_pci_setup_wmac_led_pin(1, 5); - ap9x_pci_setup_wmac_leds(0, wzrhpag300h_wmac0_leds_gpio, ARRAY_SIZE(wzrhpag300h_wmac0_leds_gpio)); ap9x_pci_setup_wmac_leds(1, wzrhpag300h_wmac1_leds_gpio, diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index 01472b679f..a621fe2c90 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -41,6 +41,7 @@ enum ath79_mach_type { ATH79_MACH_AP152, /* Atheros AP152 reference board */ ATH79_MACH_AP531B0, /* Rockeetech AP531B0 */ ATH79_MACH_AP90Q, /* YunCore AP90Q */ + ATH79_MACH_AP91_5G, /* ALFA Network AP91-5G */ ATH79_MACH_AP96, /* Atheros AP96 */ ATH79_MACH_ARCHER_C25_V1, /* TP-LINK Archer C25 V1 board */ ATH79_MACH_ARCHER_C5, /* TP-LINK Archer C5 board */ @@ -92,6 +93,7 @@ enum ath79_mach_type { ATH79_MACH_DLAN_PRO_1200_AC, /* devolo dLAN pro 1200+ WiFi ac*/ ATH79_MACH_DLAN_PRO_500_WP, /* devolo dLAN pro 500 Wireless+ */ ATH79_MACH_DOMYWIFI_DW33D, /* DomyWifi DW33D */ + ATH79_MACH_DR342, /* Wallys DR342 */ ATH79_MACH_DR344, /* Wallys DR344 */ ATH79_MACH_DR531, /* Wallys DR531 */ ATH79_MACH_DRAGINO2, /* Dragino Version 2 */ @@ -112,6 +114,7 @@ enum ath79_mach_type { ATH79_MACH_GL_AR150, /* GL-AR150 support */ ATH79_MACH_GL_AR300, /* GL-AR300 */ ATH79_MACH_GL_AR300M, /* GL-AR300M */ + ATH79_MACH_GL_AR750, /* GL.iNet GL-AR750 */ ATH79_MACH_GL_DOMINO, /* Domino */ ATH79_MACH_GL_INET, /* GL-CONNECT GL-INET */ ATH79_MACH_GL_MIFI, /* GL-MIFI support */ @@ -141,6 +144,7 @@ enum ath79_mach_type { ATH79_MACH_MYNET_REXT, /* WD My Net Wi-Fi Range Extender */ ATH79_MACH_MZK_W04NU, /* Planex MZK-W04NU */ ATH79_MACH_MZK_W300NH, /* Planex MZK-W300NH */ + ATH79_MACH_N5Q, /* ALFA Network N5Q */ ATH79_MACH_NBG460N, /* Zyxel NBG460N/550N/550NH */ ATH79_MACH_NBG6616, /* Zyxel NBG6616 */ ATH79_MACH_NBG6716, /* Zyxel NBG6716 */ @@ -163,6 +167,7 @@ enum ath79_mach_type { ATH79_MACH_PB44, /* Atheros PB44 reference board */ ATH79_MACH_PQI_AIR_PEN, /* PQI Air Pen */ ATH79_MACH_QIHOO_C301, /* Qihoo 360 C301 */ + ATH79_MACH_R36A, /* ALFA Network R36A */ ATH79_MACH_R602N, /* P&W R602N */ ATH79_MACH_R6100, /* NETGEAR R6100 */ ATH79_MACH_RAMBUTAN, /* 8devices Rambutan */ @@ -196,9 +201,11 @@ enum ath79_mach_type { ATH79_MACH_RB_MAP, /* Mikrotik RouterBOARD mAP2nD */ ATH79_MACH_RB_MAPL, /* Mikrotik RouterBOARD mAP L-2nD */ ATH79_MACH_RB_WAP, /* Mikrotik RouterBOARD wAP2nD */ + ATH79_MACH_RB_WAPAC, /* Mikrotik RouterBOARD wAPG-5HacT2HnD */ ATH79_MACH_RB_SXTLITE2ND, /* Mikrotik RouterBOARD SXT Lite 2nD */ ATH79_MACH_RB_SXTLITE5ND, /* Mikrotik RouterBOARD SXT Lite 5nD */ ATH79_MACH_RE450, /* TP-LINK RE450 */ + ATH79_MACH_RUT9XX, /* Teltonika RUT900 series */ ATH79_MACH_RW2458N, /* Redwave RW2458N */ ATH79_MACH_SC1750, /* Abicom SC1750 */ ATH79_MACH_SC300M, /* Abicom SC300M */ @@ -238,6 +245,7 @@ enum ath79_mach_type { ATH79_MACH_TL_WA901ND_V2, /* TP-LINK TL-WA901ND v2 */ ATH79_MACH_TL_WA901ND_V3, /* TP-LINK TL-WA901ND v3 */ ATH79_MACH_TL_WA901ND_V4, /* TP-LINK TL-WA901ND v4 */ + ATH79_MACH_TL_WA901ND_V5, /* TP-LINK TL-WA901ND v5 */ ATH79_MACH_TL_WDR3320_V2, /* TP-LINK TL-WDR3320 v2 */ ATH79_MACH_TL_WDR3500, /* TP-LINK TL-WDR3500 */ ATH79_MACH_TL_WDR4300, /* TP-LINK TL-WDR4300 */ @@ -245,6 +253,7 @@ enum ath79_mach_type { ATH79_MACH_TL_WDR6500_V2, /* TP-LINK TL-WDR6500 v2 */ ATH79_MACH_TL_WPA8630, /* TP-Link TL-WPA8630 */ ATH79_MACH_TL_WR1041N_V2, /* TP-LINK TL-WR1041N v2 */ + ATH79_MACH_TL_WR1043N_V5, /* TP-LINK TL-WR1043N v5 */ ATH79_MACH_TL_WR1043ND, /* TP-LINK TL-WR1043ND */ ATH79_MACH_TL_WR1043ND_V2, /* TP-LINK TL-WR1043ND v2 */ ATH79_MACH_TL_WR1043ND_V4, /* TP-LINK TL-WR1043ND v4 */ @@ -258,6 +267,7 @@ enum ath79_mach_type { ATH79_MACH_TL_WR802N_V1, /* TP-LINK TL-WR802N v1 */ ATH79_MACH_TL_WR802N_V2, /* TP-LINK TL-WR802N v2 */ ATH79_MACH_TL_WR810N, /* TP-LINK TL-WR810N */ + ATH79_MACH_TL_WR810N_V2, /* TP-LINK TL-WR810N v2 */ ATH79_MACH_TL_WR840N_V2, /* TP-LINK TL-WR840N v2 */ ATH79_MACH_TL_WR840N_V3, /* TP-LINK TL-WR840N v3 */ ATH79_MACH_TL_WR841N_V1, /* TP-LINK TL-WR841N v1 */ diff --git a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h index 078fa157f2..5fdc59c7b7 100644 --- a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h +++ b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h @@ -37,7 +37,7 @@ struct ag71xx_platform_data { u8 is_ar724x:1; u8 has_ar8216:1; u8 use_flow_control:1; - u8 is_qca956x:1; + u8 disable_inline_checksum_engine:1; struct ag71xx_switch_platform_data *switch_data; diff --git a/target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c b/target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c index 1355e3ff6e..82e6e943ff 100644 --- a/target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c +++ b/target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c @@ -203,19 +203,7 @@ static int nxp_74hc153_remove(struct platform_device *pdev) struct nxp_74hc153_platform_data *pdata = pdev->dev.platform_data; if (nxp) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) - int err; - - err = gpiochip_remove(&nxp->gpio_chip); - if (err) { - dev_err(&pdev->dev, - "unable to remove gpio chip, err=%d\n", - err); - return err; - } -#else gpiochip_remove(&nxp->gpio_chip); -#endif gpio_free(pdata->gpio_pin_2y); gpio_free(pdata->gpio_pin_1y); gpio_free(pdata->gpio_pin_s1); diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h index 898bde1d25..a712812916 100644 --- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h +++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h @@ -40,7 +40,12 @@ #define AG71XX_DRV_NAME "ag71xx" #define AG71XX_DRV_VERSION "0.5.35" -#define AG71XX_NAPI_WEIGHT 64 +/* + * For our NAPI weight bigger does *NOT* mean better - it means more + * D-cache misses and lots more wasted cycles than we'll ever + * possibly gain from saving instructions. + */ +#define AG71XX_NAPI_WEIGHT 32 #define AG71XX_OOM_REFILL (1 + HZ/10) #define AG71XX_INT_ERR (AG71XX_INT_RX_BE | AG71XX_INT_TX_BE) diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c index 566e9513d8..93f8c5305d 100644 --- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c +++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c @@ -13,13 +13,6 @@ #include "ag71xx.h" -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) -static inline void skb_free_frag(void *data) -{ - put_page(virt_to_head_page(data)); -} -#endif - #define AG71XX_DEFAULT_MSG_ENABLE \ (NETIF_MSG_DRV \ | NETIF_MSG_PROBE \ @@ -629,6 +622,22 @@ __ag71xx_link_adjust(struct ag71xx *ag, bool update) ag71xx_wr(ag, AG71XX_REG_MAC_CFG2, cfg2); ag71xx_wr(ag, AG71XX_REG_FIFO_CFG5, fifo5); ag71xx_wr(ag, AG71XX_REG_MAC_IFCTL, ifctl); + + if (pdata->disable_inline_checksum_engine) { + /* + * The rx ring buffer can stall on small packets on QCA953x and + * QCA956x. Disabling the inline checksum engine fixes the stall. + * The wr, rr functions cannot be used since this hidden register + * is outside of the normal ag71xx register block. + */ + void __iomem *dam = ioremap_nocache(0xb90001bc, 0x4); + if (dam) { + __raw_writel(__raw_readl(dam) & ~BIT(27), dam); + (void)__raw_readl(dam); + iounmap(dam); + } + } + ag71xx_hw_start(ag); netif_carrier_on(ag->dev); diff --git a/target/linux/ar71xx/files/drivers/spi/spi-rb4xx.c b/target/linux/ar71xx/files/drivers/spi/spi-rb4xx.c index 9175fc7ae3..2d95e80495 100644 --- a/target/linux/ar71xx/files/drivers/spi/spi-rb4xx.c +++ b/target/linux/ar71xx/files/drivers/spi/spi-rb4xx.c @@ -379,7 +379,7 @@ static int rb4xx_spi_probe(struct platform_device *pdev) err_iounmap: iounmap(rbspi->base); err_clk_disable: - clk_disable(rbspi->ahb_clk); + clk_disable_unprepare(rbspi->ahb_clk); err_clk_put: clk_put(rbspi->ahb_clk); err_put_master: @@ -394,7 +394,7 @@ static int rb4xx_spi_remove(struct platform_device *pdev) struct rb4xx_spi *rbspi = platform_get_drvdata(pdev); iounmap(rbspi->base); - clk_disable(rbspi->ahb_clk); + clk_disable_unprepare(rbspi->ahb_clk); clk_put(rbspi->ahb_clk); platform_set_drvdata(pdev, NULL); spi_master_put(rbspi->master); diff --git a/target/linux/ar71xx/generic/config-default b/target/linux/ar71xx/generic/config-default index e69de29bb2..cac1a27c3b 100644 --- a/target/linux/ar71xx/generic/config-default +++ b/target/linux/ar71xx/generic/config-default @@ -0,0 +1,208 @@ +CONFIG_ATH79_DEV_AP9X_PCI=y +CONFIG_ATH79_DEV_ETH=y +CONFIG_ATH79_DEV_GPIO_BUTTONS=y +CONFIG_ATH79_DEV_LEDS_GPIO=y +CONFIG_ATH79_DEV_M25P80=y +CONFIG_ATH79_DEV_NFC=y +CONFIG_ATH79_DEV_SPI=y +CONFIG_ATH79_DEV_USB=y +CONFIG_ATH79_DEV_WMAC=y +CONFIG_ATH79_MACH_A60=y +CONFIG_ATH79_MACH_ALFA_AP120C=y +CONFIG_ATH79_MACH_ALFA_AP96=y +CONFIG_ATH79_MACH_ALFA_NX=y +CONFIG_ATH79_MACH_ALL0258N=y +CONFIG_ATH79_MACH_ALL0315N=y +CONFIG_ATH79_MACH_ANTMINER_S1=y +CONFIG_ATH79_MACH_ANTMINER_S3=y +CONFIG_ATH79_MACH_ANTROUTER_R1=y +CONFIG_ATH79_MACH_AP121=y +CONFIG_ATH79_MACH_AP121F=y +CONFIG_ATH79_MACH_AP132=y +CONFIG_ATH79_MACH_AP136=y +CONFIG_ATH79_MACH_AP143=y +CONFIG_ATH79_MACH_AP147=y +CONFIG_ATH79_MACH_AP152=y +CONFIG_ATH79_MACH_AP531B0=y +CONFIG_ATH79_MACH_AP90Q=y +CONFIG_ATH79_MACH_AP91_5G=y +CONFIG_ATH79_MACH_AP96=y +CONFIG_ATH79_MACH_ARCHER_C25_V1=y +CONFIG_ATH79_MACH_ARCHER_C58_V1=y +CONFIG_ATH79_MACH_ARCHER_C59_V1=y +CONFIG_ATH79_MACH_ARCHER_C60_V1=y +CONFIG_ATH79_MACH_ARCHER_C7=y +CONFIG_ATH79_MACH_ARDUINO_YUN=y +CONFIG_ATH79_MACH_AW_NR580=y +CONFIG_ATH79_MACH_BHR_4GRV2=y +CONFIG_ATH79_MACH_BHU_BXU2000N2_A=y +CONFIG_ATH79_MACH_BSB=y +CONFIG_ATH79_MACH_C55=y +CONFIG_ATH79_MACH_CAP324=y +CONFIG_ATH79_MACH_CAP4200AG=y +CONFIG_ATH79_MACH_CARAMBOLA2=y +CONFIG_ATH79_MACH_CF_E316N_V2=y +CONFIG_ATH79_MACH_CF_E320N_V2=y +CONFIG_ATH79_MACH_CF_E355AC=y +CONFIG_ATH79_MACH_CF_E380AC_V1=y +CONFIG_ATH79_MACH_CF_E380AC_V2=y +CONFIG_ATH79_MACH_CF_E520N=y +CONFIG_ATH79_MACH_CF_E530N=y +CONFIG_ATH79_MACH_CPE505N=y +CONFIG_ATH79_MACH_CPE510=y +CONFIG_ATH79_MACH_CPE830=y +CONFIG_ATH79_MACH_CPE870=y +CONFIG_ATH79_MACH_CR3000=y +CONFIG_ATH79_MACH_CR5000=y +CONFIG_ATH79_MACH_DAP_2695_A1=y +CONFIG_ATH79_MACH_DB120=y +CONFIG_ATH79_MACH_DGL_5500_A1=y +CONFIG_ATH79_MACH_DHP_1565_A1=y +CONFIG_ATH79_MACH_DIR_505_A1=y +CONFIG_ATH79_MACH_DIR_825_B1=y +CONFIG_ATH79_MACH_DIR_825_C1=y +CONFIG_ATH79_MACH_DIR_869_A1=y +CONFIG_ATH79_MACH_DLAN_HOTSPOT=y +CONFIG_ATH79_MACH_DLAN_PRO_1200_AC=y +CONFIG_ATH79_MACH_DLAN_PRO_500_WP=y +CONFIG_ATH79_MACH_DR342=y +CONFIG_ATH79_MACH_DR344=y +CONFIG_ATH79_MACH_DR531=y +CONFIG_ATH79_MACH_DRAGINO2=y +CONFIG_ATH79_MACH_E2100L=y +CONFIG_ATH79_MACH_EAP120=y +CONFIG_ATH79_MACH_EAP300V2=y +CONFIG_ATH79_MACH_EAP7660D=y +CONFIG_ATH79_MACH_EL_M150=y +CONFIG_ATH79_MACH_EL_MINI=y +CONFIG_ATH79_MACH_ENS202EXT=y +CONFIG_ATH79_MACH_EPG5000=y +CONFIG_ATH79_MACH_ESR1750=y +CONFIG_ATH79_MACH_ESR900=y +CONFIG_ATH79_MACH_EW_DORIN=y +CONFIG_ATH79_MACH_F9K1115V2=y +CONFIG_ATH79_MACH_FRITZ300E=y +CONFIG_ATH79_MACH_GL_AR150=y +CONFIG_ATH79_MACH_GL_AR300=y +CONFIG_ATH79_MACH_GL_AR300M=y +CONFIG_ATH79_MACH_GL_AR750=y +CONFIG_ATH79_MACH_GL_DOMINO=y +CONFIG_ATH79_MACH_GL_INET=y +CONFIG_ATH79_MACH_GL_MIFI=y +CONFIG_ATH79_MACH_GL_USB150=y +CONFIG_ATH79_MACH_GS_MINIBOX_V1=y +CONFIG_ATH79_MACH_GS_OOLITE=y +CONFIG_ATH79_MACH_HIWIFI_HC6361=y +CONFIG_ATH79_MACH_HORNET_UB=y +CONFIG_ATH79_MACH_JA76PF=y +CONFIG_ATH79_MACH_JWAP003=y +CONFIG_ATH79_MACH_JWAP230=y +CONFIG_ATH79_MACH_LIMA=y +CONFIG_ATH79_MACH_MC_MAC1200R=y +CONFIG_ATH79_MACH_MR12=y +CONFIG_ATH79_MACH_MR16=y +CONFIG_ATH79_MACH_MR1750=y +CONFIG_ATH79_MACH_MR600=y +CONFIG_ATH79_MACH_MR900=y +CONFIG_ATH79_MACH_MYNET_N600=y +CONFIG_ATH79_MACH_MYNET_N750=y +CONFIG_ATH79_MACH_MYNET_REXT=y +CONFIG_ATH79_MACH_MZK_W04NU=y +CONFIG_ATH79_MACH_MZK_W300NH=y +CONFIG_ATH79_MACH_N5Q=y +CONFIG_ATH79_MACH_OM2P=y +CONFIG_ATH79_MACH_OM5P=y +CONFIG_ATH79_MACH_OM5P_AC=y +CONFIG_ATH79_MACH_OM5P_ACv2=y +CONFIG_ATH79_MACH_OMY_G1=y +CONFIG_ATH79_MACH_OMY_X1=y +CONFIG_ATH79_MACH_ONION_OMEGA=y +CONFIG_ATH79_MACH_PB42=y +CONFIG_ATH79_MACH_PB44=y +CONFIG_ATH79_MACH_PQI_AIR_PEN=y +CONFIG_ATH79_MACH_QIHOO_C301=y +CONFIG_ATH79_MACH_R36A=y +CONFIG_ATH79_MACH_R602N=y +CONFIG_ATH79_MACH_RE450=y +CONFIG_ATH79_MACH_RUT9XX=y +CONFIG_ATH79_MACH_RW2458N=y +CONFIG_ATH79_MACH_SC1750=y +CONFIG_ATH79_MACH_SC300M=y +CONFIG_ATH79_MACH_SC450=y +CONFIG_ATH79_MACH_SMART_300=y +CONFIG_ATH79_MACH_SOM9331=y +CONFIG_ATH79_MACH_SR3200=y +CONFIG_ATH79_MACH_TELLSTICK_ZNET_LITE=y +CONFIG_ATH79_MACH_TEW_673GRU=y +CONFIG_ATH79_MACH_TEW_732BR=y +CONFIG_ATH79_MACH_TEW_823DRU=y +CONFIG_ATH79_MACH_TL_MR3X20=y +CONFIG_ATH79_MACH_TL_MR6400=y +CONFIG_ATH79_MACH_TL_WDR3500=y +CONFIG_ATH79_MACH_TL_WDR4300=y +CONFIG_ATH79_MACH_TL_WDR6500_V2=y +CONFIG_ATH79_MACH_TL_WPA8630=y +CONFIG_ATH79_MACH_TL_WR1043ND=y +CONFIG_ATH79_MACH_TL_WR1043ND_V2=y +CONFIG_ATH79_MACH_TL_WR1043ND_V4=y +CONFIG_ATH79_MACH_TL_WR1043N_V5=y +CONFIG_ATH79_MACH_TL_WR2543N=y +CONFIG_ATH79_MACH_TL_WR703N=y +CONFIG_ATH79_MACH_TL_WR720N_V3=y +CONFIG_ATH79_MACH_TL_WR810N=y +CONFIG_ATH79_MACH_TL_WR810N_V2=y +CONFIG_ATH79_MACH_TL_WR841N_V9=y +CONFIG_ATH79_MACH_TL_WR902AC_V1=y +CONFIG_ATH79_MACH_TL_WR942N_V1=y +CONFIG_ATH79_MACH_TUBE2H=y +CONFIG_ATH79_MACH_UBNT=y +CONFIG_ATH79_MACH_UBNT_UNIFIAC=y +CONFIG_ATH79_MACH_UBNT_XM=y +CONFIG_ATH79_MACH_WEIO=y +CONFIG_ATH79_MACH_WHR_HP_G300N=y +CONFIG_ATH79_MACH_WLAE_AG300N=y +CONFIG_ATH79_MACH_WLR8100=y +CONFIG_ATH79_MACH_WNDAP360=y +CONFIG_ATH79_MACH_WNDR3700=y +CONFIG_ATH79_MACH_WNR2200=y +CONFIG_ATH79_MACH_WP543=y +CONFIG_ATH79_MACH_WPE72=y +CONFIG_ATH79_MACH_WPJ342=y +CONFIG_ATH79_MACH_WPJ344=y +CONFIG_ATH79_MACH_WPJ531=y +CONFIG_ATH79_MACH_WPJ558=y +CONFIG_ATH79_MACH_WPJ563=y +CONFIG_ATH79_MACH_WRT160NL=y +CONFIG_ATH79_MACH_WRT400N=y +CONFIG_ATH79_MACH_WRTNODE2Q=y +CONFIG_ATH79_MACH_WZR_450HP2=y +CONFIG_ATH79_MACH_WZR_HP_AG300H=y +CONFIG_ATH79_MACH_WZR_HP_G300NH=y +CONFIG_ATH79_MACH_WZR_HP_G300NH2=y +CONFIG_ATH79_MACH_WZR_HP_G450H=y +CONFIG_ATH79_MACH_XD3200=y +CONFIG_ATH79_MACH_ZBT_WE1526=y +CONFIG_ATH79_MACH_ZCN_1523H=y +CONFIG_ATH79_NVRAM=y +CONFIG_ATH79_PCI_ATH9K_FIXUP=y +CONFIG_BLK_MQ_PCI=y +CONFIG_GPIO_PCA953X=y +# CONFIG_GPIO_PCA953X_IRQ is not set +CONFIG_HW_HAS_PCI=y +# CONFIG_LEDS_WNDR3700_USB is not set +CONFIG_MYLOADER=y +CONFIG_PCI=y +CONFIG_PCI_AR724X=y +CONFIG_PCI_DISABLE_COMMON_QUIRKS=y +CONFIG_PCI_DOMAINS=y +CONFIG_SERIAL_AR933X=y +CONFIG_SERIAL_AR933X_CONSOLE=y +CONFIG_SERIAL_AR933X_NR_UARTS=2 +CONFIG_SOC_AR71XX=y +CONFIG_SOC_AR724X=y +CONFIG_SOC_AR913X=y +CONFIG_SOC_AR933X=y +CONFIG_SOC_AR934X=y +CONFIG_SOC_QCA953X=y +CONFIG_SOC_QCA955X=y +CONFIG_SOC_QCA956X=y diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile index 6c70babc56..1eaf1e457c 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -13,11 +13,15 @@ KERNEL_LOADADDR = 0x80060000 DEVICE_VARS += BOARDNAME CMDLINE CONSOLE IMAGE_SIZE LOADER_TYPE ifeq ($(SUBTARGET),generic) -include ./tp-link.mk -include ./ubnt.mk include ./generic.mk -include ./legacy-devices.mk -include ./senao.mk +include ./generic-legacy-devices.mk +include ./generic-senao.mk +include ./generic-tp-link.mk +include ./generic-ubnt.mk +endif +ifeq ($(SUBTARGET),tiny) +include ./tiny-tp-link.mk +include ./tiny-legacy-devices.mk endif ifeq ($(SUBTARGET),nand) include ./nand.mk diff --git a/target/linux/ar71xx/image/common-tp-link.mk b/target/linux/ar71xx/image/common-tp-link.mk new file mode 100644 index 0000000000..c448c97209 --- /dev/null +++ b/target/linux/ar71xx/image/common-tp-link.mk @@ -0,0 +1,95 @@ +DEVICE_VARS += LOADER_FLASH_OFFS TPLINK_BOARD_ID TPLINK_FLASHLAYOUT TPLINK_HEADER_VERSION TPLINK_HWID TPLINK_HWREV + +define Build/copy-file + cat "$(1)" > "$@" +endef + +define Build/loader-okli + dd if=$(KDIR)/loader-$(1).gz bs=7680 conv=sync of="$@.new" + cat "$@" >> "$@.new" + mv "$@.new" "$@" +endef + +define Build/loader-okli-compile + $(call Build/loader-common,FLASH_OFFS=$(LOADER_FLASH_OFFS) FLASH_MAX=0 KERNEL_CMDLINE="$(CMDLINE)") +endef + +# combine kernel and rootfs into one image +# mktplinkfw +# is "sysupgrade" or "factory" +# +# -a align the rootfs start on an bytes boundary +# -j add jffs2 end-of-filesystem markers +# -s strip padding from end of the image +# -X reserve bytes in the firmware image (hexval prefixed with 0x) +define Build/mktplinkfw + -$(STAGING_DIR_HOST)/bin/mktplinkfw \ + -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) -N OpenWrt -V $(REVISION) \ + -m $(TPLINK_HEADER_VERSION) \ + -k $(IMAGE_KERNEL) \ + -r $@ \ + -o $@.new \ + -j -X 0x40000 \ + -a $(call rootfs_align,$(FILESYSTEM)) \ + $(wordlist 2,$(words $(1)),$(1)) \ + $(if $(findstring sysupgrade,$(word 1,$(1))),-s) && mv $@.new $@ || rm -f $@ +endef + +define Build/uImageArcher + mkimage -A $(LINUX_KARCH) \ + -O linux -T kernel \ + -C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ + -n '$(call toupper,$(LINUX_KARCH)) OpenWrt Linux-$(LINUX_VERSION)' -d $@ $@.new + @mv $@.new $@ +endef + + +define Device/tplink + TPLINK_HWREV := 0x1 + TPLINK_HEADER_VERSION := 1 + LOADER_TYPE := gz + KERNEL := kernel-bin | patch-cmdline | lzma + KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | tplink-v1-header + IMAGES := sysupgrade.bin factory.bin + IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade + IMAGE/factory.bin := append-rootfs | mktplinkfw factory +endef + +define Device/tplink-nolzma + $(Device/tplink) + LOADER_FLASH_OFFS := 0x22000 + COMPILE := loader-$(1).gz + COMPILE/loader-$(1).gz := loader-okli-compile + KERNEL := copy-file $(KDIR)/vmlinux.bin.lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) + KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux-initramfs.bin.lzma | loader-kernel-cmdline | tplink-v1-header +endef + +define Device/tplink-4m + $(Device/tplink-nolzma) + TPLINK_FLASHLAYOUT := 4M + IMAGE_SIZE := 3904k +endef + +define Device/tplink-8m + $(Device/tplink-nolzma) + TPLINK_FLASHLAYOUT := 8M + IMAGE_SIZE := 7936k +endef + +define Device/tplink-4mlzma + $(Device/tplink) + TPLINK_FLASHLAYOUT := 4Mlzma + IMAGE_SIZE := 3904k +endef + +define Device/tplink-8mlzma + $(Device/tplink) + TPLINK_FLASHLAYOUT := 8Mlzma + IMAGE_SIZE := 7936k +endef + +define Device/tplink-16mlzma + $(Device/tplink) + TPLINK_FLASHLAYOUT := 16Mlzma + IMAGE_SIZE := 15872k +endef diff --git a/target/linux/ar71xx/image/legacy-devices.mk b/target/linux/ar71xx/image/generic-legacy-devices.mk similarity index 76% rename from target/linux/ar71xx/image/legacy-devices.mk rename to target/linux/ar71xx/image/generic-legacy-devices.mk index e418282dd0..7692e802d7 100644 --- a/target/linux/ar71xx/image/legacy-devices.mk +++ b/target/linux/ar71xx/image/generic-legacy-devices.mk @@ -143,12 +143,6 @@ define LegacyDevice/TUBE2H16M endef LEGACY_DEVICES += TUBE2H16M -define LegacyDevice/WLR8100 - DEVICE_TITLE := Sitecom WLR-8100 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-usb3 -endef -LEGACY_DEVICES += WLR8100 - define LegacyDevice/F9K1115V2 DEVICE_TITLE := Belkin AC1750DB (F9K1115V2) DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb3 kmod-usb-ledtrig-usbport \ @@ -156,81 +150,6 @@ define LegacyDevice/F9K1115V2 endef LEGACY_DEVICES += F9K1115V2 -define LegacyDevice/DIR600A1 - DEVICE_TITLE := D-Link DIR-600 rev. A1 -endef -LEGACY_DEVICES += DIR600A1 - -define LegacyDevice/DIR601A1 - DEVICE_TITLE := D-Link DIR-601 rev. A1 -endef -LEGACY_DEVICES += DIR601A1 - -define LegacyDevice/FR54RTR - DEVICE_TITLE := Frys FR-54RTR -endef -LEGACY_DEVICES += FR54RTR - -define LegacyDevice/EBR2310C1 - DEVICE_TITLE := D-Link EBR-2310 rev. C1 -endef -LEGACY_DEVICES += EBR2310C1 - -define LegacyDevice/DIR615E1 - DEVICE_TITLE := D-Link DIR-615 rev. E1 -endef -LEGACY_DEVICES += DIR615E1 - -define LegacyDevice/DIR615E4 - DEVICE_TITLE := D-Link DIR-615 rev. E4 -endef -LEGACY_DEVICES += DIR615E4 - -define LegacyDevice/DIR615I1 - DEVICE_TITLE := D-Link DIR-615 rev. I1 -endef -LEGACY_DEVICES += DIR615I1 - -define LegacyDevice/DIR615I3 - DEVICE_TITLE := D-Link DIR-615 rev. I3 -endef -LEGACY_DEVICES += DIR615I3 - -define LegacyDevice/A02RBW300N - DEVICE_TITLE := Atlantis-Land A02-RB-W300N -endef -LEGACY_DEVICES += A02RBW300N - -define LegacyDevice/DIR615C1 - DEVICE_TITLE := D-Link DIR-615 rev. C1 -endef -LEGACY_DEVICES += DIR615C1 - -define LegacyDevice/TEW632BRP - DEVICE_TITLE := TRENDNet TEW-632BRP -endef -LEGACY_DEVICES += TEW632BRP - -define LegacyDevice/TEW652BRP_FW - DEVICE_TITLE := TRENDNet TEW-652BRP -endef -LEGACY_DEVICES += TEW652BRP_FW - -define LegacyDevice/TEW652BRP_RECOVERY - DEVICE_TITLE := TRENDNet TEW-652BRP (recovery) -endef -LEGACY_DEVICES += TEW652BRP_RECOVERY - -define LegacyDevice/TEW712BR - DEVICE_TITLE := TRENDNet TEW-712BR -endef -LEGACY_DEVICES += TEW712BR - -define LegacyDevice/DIR601B1 - DEVICE_TITLE := D-Link DIR-601 rev. B1 -endef -LEGACY_DEVICES += DIR601B1 - define LegacyDevice/DIR505A1 DEVICE_TITLE := D-Link DIR-505 rev. A1 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport @@ -336,12 +255,6 @@ define LegacyDevice/EPG5000 endef LEGACY_DEVICES += EPG5000 -define LegacyDevice/WP543_4M - DEVICE_TITLE := Compex WP543/WPJ543 (4MB flash) - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 -endef -LEGACY_DEVICES += WP543_4M - define LegacyDevice/WP543_8M DEVICE_TITLE := Compex WP543/WPJ543 (8MB flash) DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 @@ -354,12 +267,6 @@ define LegacyDevice/WP543_16M endef LEGACY_DEVICES += WP543_16M -define LegacyDevice/WPE72_4M - DEVICE_TITLE := Compex WPE72/WPE72NX (4MB flash) - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 -endef -LEGACY_DEVICES += WPE72_4M - define LegacyDevice/WPE72_8M DEVICE_TITLE := Compex WPE72/WPE72NX (8MB flash) DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 @@ -372,53 +279,12 @@ define LegacyDevice/WPE72_16M endef LEGACY_DEVICES += WPE72_16M -define LegacyDevice/WNR2000 - DEVICE_TITLE := NETGEAR WNR2000V1 -endef -LEGACY_DEVICES += WNR2000 - -define LegacyDevice/WNR2000V3 - DEVICE_TITLE := NETGEAR WNR2000V3 -endef -LEGACY_DEVICES += WNR2000V3 - -define LegacyDevice/WNR2000V4 - DEVICE_TITLE := NETGEAR WNR2000V4 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport -endef -LEGACY_DEVICES += WNR2000V4 - define LegacyDevice/WNR2200 DEVICE_TITLE := NETGEAR WNR2200 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport endef LEGACY_DEVICES += WNR2200 -define LegacyDevice/REALWNR612V2 - DEVICE_TITLE := NETGEAR WNR612V2 -endef -LEGACY_DEVICES += REALWNR612V2 - -define LegacyDevice/N150R - DEVICE_TITLE := On Networks N150 -endef -LEGACY_DEVICES += N150R - -define LegacyDevice/REALWNR1000V2 - DEVICE_TITLE := NETGEAR WNR1000V2 -endef -LEGACY_DEVICES += REALWNR1000V2 - -define LegacyDevice/WNR1000V2_VC - DEVICE_TITLE := NETGEAR WNR1000V2-VC -endef -LEGACY_DEVICES += WNR1000V2_VC - -define LegacyDevice/WPN824N - DEVICE_TITLE := NETGEAR WPN824N -endef -LEGACY_DEVICES += WPN824N - define LegacyDevice/OM2P DEVICE_TITLE := OpenMesh OM2P/OM2P-HS/OM2P-LC DEVICE_PACKAGES := om-watchdog @@ -512,27 +378,6 @@ define LegacyDevice/EAP300V2 endef LEGACY_DEVICES += EAP300V2 -define LegacyDevice/WHRG301N - DEVICE_TITLE := Buffalo WHR-G301N -endef -LEGACY_DEVICES += WHRG301N - -define LegacyDevice/WHRHPG300N - DEVICE_TITLE := Buffalo WHR-HP-G300N -endef -LEGACY_DEVICES += WHRHPG300N - -define LegacyDevice/WHRHPGN - DEVICE_TITLE := Buffalo WHR-HP-GN -endef -LEGACY_DEVICES += WHRHPGN - -define LegacyDevice/WLAEAG300N - DEVICE_TITLE := Buffalo WLAE-AG300N - DEVICE_PACKAGES := kmod-ledtrig-netdev -endef -LEGACY_DEVICES += WLAEAG300N - define LegacyDevice/WRT400N DEVICE_TITLE := Linksys WRT400N endef @@ -583,9 +428,3 @@ define LegacyDevice/ZCN1523H516 DEVICE_TITLE := Zcomax ZCN-1523H-5-16 endef LEGACY_DEVICES += ZCN1523H516 - -define LegacyDevice/NBG_460N_550N_550NH - DEVICE_TITLE := ZyXEL NBG 460N/550N/550NH - DEVICE_PACKAGES := kmod-rtc-pcf8563 -endef -LEGACY_DEVICES += NBG_460N_550N_550NH diff --git a/target/linux/ar71xx/image/senao.mk b/target/linux/ar71xx/image/generic-senao.mk similarity index 100% rename from target/linux/ar71xx/image/senao.mk rename to target/linux/ar71xx/image/generic-senao.mk diff --git a/target/linux/ar71xx/image/generic-tp-link.mk b/target/linux/ar71xx/image/generic-tp-link.mk new file mode 100644 index 0000000000..b0d99e2599 --- /dev/null +++ b/target/linux/ar71xx/image/generic-tp-link.mk @@ -0,0 +1,470 @@ +include ./common-tp-link.mk + + +define Device/archer-cxx + KERNEL := kernel-bin | patch-cmdline | lzma | uImageArcher lzma + IMAGES := sysupgrade.bin factory.bin + IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \ + append-metadata | check-size $$$$(IMAGE_SIZE) + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory +endef + +define Device/archer-c25-v1 + $(Device/archer-cxx) + DEVICE_TITLE := TP-LINK Archer C25 v1 + DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9887 + BOARDNAME := ARCHER-C25-V1 + TPLINK_BOARD_ID := ARCHER-C25-V1 + DEVICE_PROFILE := ARCHERC25V1 + IMAGE_SIZE := 7808k + LOADER_TYPE := elf + MTDPARTS := spi0.0:128k(factory-uboot)ro,64k(u-boot)ro,1536k(kernel),6272k(rootfs),128k(config)ro,64k(art)ro,7808k@0x30000(firmware) + SUPPORTED_DEVICES := archer-c25-v1 +endef +TARGET_DEVICES += archer-c25-v1 + +define Device/archer-c58-v1 + $(Device/archer-cxx) + DEVICE_TITLE := TP-LINK Archer C58 v1 + DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9888 + BOARDNAME := ARCHER-C58-V1 + TPLINK_BOARD_ID := ARCHER-C58-V1 + DEVICE_PROFILE := ARCHERC58V1 + IMAGE_SIZE := 7936k + MTDPARTS := spi0.0:64k(u-boot)ro,64k(mac)ro,7936k(firmware),64k(tplink)ro,64k(art)ro + SUPPORTED_DEVICES := archer-c58-v1 +endef +TARGET_DEVICES += archer-c58-v1 + +define Device/archer-c59-v1 + $(Device/archer-cxx) + DEVICE_TITLE := TP-LINK Archer C59 v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca9888 + BOARDNAME := ARCHER-C59-V1 + TPLINK_BOARD_ID := ARCHER-C59-V1 + DEVICE_PROFILE := ARCHERC59V1 + IMAGE_SIZE := 14528k + MTDPARTS := spi0.0:64k(u-boot)ro,64k(mac)ro,1536k(kernel),12992k(rootfs),1664k(tplink)ro,64k(art)ro,14528k@0x20000(firmware) + SUPPORTED_DEVICES := archer-c59-v1 +endef +TARGET_DEVICES += archer-c59-v1 + +define Device/archer-c60-v1 + $(Device/archer-cxx) + DEVICE_TITLE := TP-LINK Archer C60 v1 + DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9888 + BOARDNAME := ARCHER-C60-V1 + TPLINK_BOARD_ID := ARCHER-C60-V1 + DEVICE_PROFILE := ARCHERC60V1 + IMAGE_SIZE := 7936k + MTDPARTS := spi0.0:64k(u-boot)ro,64k(mac)ro,7936k(firmware),64k(tplink)ro,64k(art)ro + SUPPORTED_DEVICES := archer-c60-v1 +endef +TARGET_DEVICES += archer-c60-v1 + +define Device/archer-c5-v1 + $(Device/tplink-16mlzma) + DEVICE_TITLE := TP-LINK Archer C5 v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x + BOARDNAME := ARCHER-C5 + DEVICE_PROFILE := ARCHERC7 + TPLINK_HWID := 0xc5000001 +endef +TARGET_DEVICES += archer-c5-v1 + +define Device/archer-c7-v1 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK Archer C7 v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x + BOARDNAME := ARCHER-C7 + DEVICE_PROFILE := ARCHERC7 + TPLINK_HWID := 0x75000001 +endef +TARGET_DEVICES += archer-c7-v1 + +define Device/archer-c7-v2 + $(Device/tplink-16mlzma) + DEVICE_TITLE := TP-LINK Archer C7 v2 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x + BOARDNAME := ARCHER-C7-V2 + DEVICE_PROFILE := ARCHERC7 + TPLINK_HWID := 0xc7000002 + IMAGES := sysupgrade.bin factory.bin factory-us.bin factory-eu.bin + IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US + IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU +endef +TARGET_DEVICES += archer-c7-v2 + +define Device/archer-c7-v2-il + $(Device/tplink-16mlzma) + DEVICE_TITLE := TP-LINK Archer C7 v2 (IL) + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x + BOARDNAME := ARCHER-C7-V2 + DEVICE_PROFILE := ARCHERC7 + TPLINK_HWID := 0xc7000002 + TPLINK_HWREV := 0x494c0001 +endef +TARGET_DEVICES += archer-c7-v2-il + +define Device/tl-wdr7500-v3 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK Archer C7 v3 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x + BOARDNAME := ARCHER-C7 + DEVICE_PROFILE := ARCHERC7 + TPLINK_HWID := 0x75000003 +endef +TARGET_DEVICES += tl-wdr7500-v3 + +define Device/archer-c7-v4 + $(Device/archer-cxx) + DEVICE_TITLE := TP-LINK Archer C7 v4 + DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x + BOARDNAME := ARCHER-C7-V4 + TPLINK_BOARD_ID := ARCHER-C7-V4 + IMAGE_SIZE := 15104k + LOADER_TYPE := elf + MTDPARTS := spi0.0:128k(factory-uboot)ro,128k(u-boot)ro,1536k(kernel),13568k(rootfs),960k(config)ro,64k(art)ro,15104k@0x40000(firmware) + SUPPORTED_DEVICES := archer-c7-v4 +endef +TARGET_DEVICES += archer-c7-v4 + +define Device/cpe510-520-v1 + DEVICE_TITLE := TP-LINK CPE510/520 v1 + DEVICE_PACKAGES := rssileds + MTDPARTS := spi0.0:128k(u-boot)ro,64k(partition-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k@0x40000(firmware) + IMAGE_SIZE := 7680k + BOARDNAME := CPE510 + TPLINK_BOARD_ID := CPE510 + DEVICE_PROFILE := CPE510 + LOADER_TYPE := elf + KERNEL := kernel-bin | patch-cmdline | lzma | loader-kernel + IMAGES := sysupgrade.bin factory.bin + IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory +endef +TARGET_DEVICES += cpe510-520-v1 + +define Device/cpe210-220-v1 + $(Device/cpe510-520-v1) + DEVICE_TITLE := TP-LINK CPE210/220 v1 + BOARDNAME := CPE210 + TPLINK_BOARD_ID := CPE210 +endef +TARGET_DEVICES += cpe210-220-v1 + +define Device/wbs210-v1 + $(Device/cpe510-520-v1) + DEVICE_TITLE := TP-LINK WBS210 v1 + BOARDNAME := WBS210 + TPLINK_BOARD_ID := WBS210 +endef +TARGET_DEVICES += wbs210-v1 + +define Device/wbs510-v1 + $(Device/cpe510-520-v1) + DEVICE_TITLE := TP-LINK WBS510 v1 + BOARDNAME := WBS510 + TPLINK_BOARD_ID := WBS510 +endef +TARGET_DEVICES += wbs510-v1 + +define Device/eap120-v1 + DEVICE_TITLE := TP-LINK EAP120 v1 + MTDPARTS := spi0.0:128k(u-boot)ro,64k(partition-table)ro,64k(product-info)ro,1536k(kernel),14336k(rootfs),192k(config)ro,64k(ART)ro,15872k@0x40000(firmware) + IMAGE_SIZE := 15872k + BOARDNAME := EAP120 + TPLINK_BOARD_ID := EAP120 + DEVICE_PROFILE := EAP120 + LOADER_TYPE := elf + KERNEL := kernel-bin | patch-cmdline | lzma | loader-kernel + IMAGES := sysupgrade.bin factory.bin + IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory +endef +TARGET_DEVICES += eap120-v1 + +define Device/re450-v1 + DEVICE_TITLE := TP-LINK RE450 v1 + DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x + MTDPARTS := spi0.0:128k(u-boot)ro,6016k(firmware),64k(partition-table)ro,64k(product-info)ro,1856k(config)ro,64k(art)ro + IMAGE_SIZE := 7936k + BOARDNAME := RE450 + TPLINK_BOARD_ID := RE450 + DEVICE_PROFILE := RE450 + LOADER_TYPE := elf + TPLINK_HWID := 0x0 + TPLINK_HWREV := 0 + TPLINK_HEADER_VERSION := 1 + KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header + IMAGES := sysupgrade.bin factory.bin + IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory +endef +TARGET_DEVICES += re450-v1 + +define Device/tl-mr6400-v1 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-MR6400 v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-net kmod-usb-net-rndis kmod-usb-serial kmod-usb-serial-option adb-enablemodem + BOARDNAME := TL-MR6400 + DEVICE_PROFILE := TLMR6400 + TPLINK_HWID := 0x64000001 +endef +TARGET_DEVICES += tl-mr6400-v1 + +define Device/tl-wdr3500-v1 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WDR3500 v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WDR3500 + DEVICE_PROFILE := TLWDR4300 + TPLINK_HWID := 0x35000001 +endef +TARGET_DEVICES += tl-wdr3500-v1 + +define Device/tl-wdr3600-v1 + $(Device/tl-wdr3500-v1) + DEVICE_TITLE := TP-LINK TL-WDR3600 v1 + BOARDNAME := TL-WDR4300 + TPLINK_HWID := 0x36000001 + IMAGE/factory.bin := append-rootfs | mktplinkfw factory -C US +endef +TARGET_DEVICES += tl-wdr3600-v1 + +define Device/tl-wdr4300-v1 + $(Device/tl-wdr3600-v1) + DEVICE_TITLE := TP-LINK TL-WDR4300 v1 + TPLINK_HWID := 0x43000001 +endef +TARGET_DEVICES += tl-wdr4300-v1 + +define Device/tl-wdr4300-v1-il + $(Device/tl-wdr3500-v1) + DEVICE_TITLE := TP-LINK TL-WDR4300 v1 (IL) + BOARDNAME := TL-WDR4300 + TPLINK_HWID := 0x43008001 +endef +TARGET_DEVICES += tl-wdr4300-v1-il + +define Device/tl-wdr4310-v1 + $(Device/tl-wdr4300-v1-il) + DEVICE_TITLE := TP-LINK TL-WDR4310 v1 + TPLINK_HWID := 0x43100001 +endef +TARGET_DEVICES += tl-wdr4310-v1 + +define Device/tl-wdr4900-v2 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WDR4900 v2 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WDR4900-v2 + DEVICE_PROFILE := TLWDR4900V2 + TPLINK_HWID := 0x49000002 +endef +TARGET_DEVICES += tl-wdr4900-v2 + +define Device/tl-wdr6500-v2 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WDR6500 v2 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x + KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma + KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | uImage lzma | tplink-v1-header + BOARDNAME := TL-WDR6500-v2 + DEVICE_PROFILE := TLWDR6500V2 + TPLINK_HWID := 0x65000002 + TPLINK_HEADER_VERSION := 2 +endef +TARGET_DEVICES += tl-wdr6500-v2 + +define Device/mw4530r-v1 + $(Device/tl-wdr4300-v1) + DEVICE_TITLE := Mercury MW4530R v1 + TPLINK_HWID := 0x45300001 +endef +TARGET_DEVICES += mw4530r-v1 + +define Device/tl-wpa8630-v1 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WPA8630 v1 + DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x + BOARDNAME := TL-WPA8630 + DEVICE_PROFILE := TL-WPA8630 + TPLINK_HWID := 0x86300001 +endef +TARGET_DEVICES += tl-wpa8630-v1 + +define Device/tl-wr1043n-v5 + $(Device/archer-cxx) + DEVICE_TITLE := TP-LINK TL-WR1043N v5 + BOARDNAME := TL-WR1043N-v5 + SUPPORTED_DEVICES := tl-wr1043n-v5 + DEVICE_PROFILE := TLWR1043 + MTDPARTS := spi0.0:128k(factory-uboot)ro,128k(u-boot)ro,15104k(firmware),128k(product-info)ro,640k(config)ro,64k(partition-table)ro,128k(logs)ro,64k(art)ro + IMAGE_SIZE := 15104k + TPLINK_BOARD_ID := TLWR1043NV5 +endef +TARGET_DEVICES += tl-wr1043n-v5 + +define Device/tl-wr1043nd-v1 + $(Device/tplink-8m) + DEVICE_TITLE := TP-LINK TL-WR1043N/ND v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WR1043ND + DEVICE_PROFILE := TLWR1043 + TPLINK_HWID := 0x10430001 +endef +TARGET_DEVICES += tl-wr1043nd-v1 + +define Device/tl-wr1043nd-v2 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WR1043N/ND v2 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WR1043ND-v2 + DEVICE_PROFILE := TLWR1043 + TPLINK_HWID := 0x10430002 +endef +TARGET_DEVICES += tl-wr1043nd-v2 + +define Device/tl-wr1043nd-v3 + $(Device/tl-wr1043nd-v2) + DEVICE_TITLE := TP-LINK TL-WR1043N/ND v3 + TPLINK_HWID := 0x10430003 +endef +TARGET_DEVICES += tl-wr1043nd-v3 + +define Device/tl-wr1043nd-v4 + $(Device/tplink) + DEVICE_TITLE := TP-LINK TL-WR1043N/ND v4 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WR1043ND-v4 + DEVICE_PROFILE := TLWR1043 + TPLINK_HWID := 0x10430004 + MTDPARTS := spi0.0:128k(u-boot)ro,1536k(kernel),14016k(rootfs),128k(product-info)ro,320k(config)ro,64k(partition-table)ro,128k(logs)ro,64k(ART)ro,15552k@0x20000(firmware) + IMAGE_SIZE := 15552k + TPLINK_BOARD_ID := TLWR1043NDV4 + KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header + IMAGES := sysupgrade.bin factory.bin + IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory +endef +TARGET_DEVICES += tl-wr1043nd-v4 + +define Device/tl-wr2543-v1 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WR2543N/ND v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WR2543N + DEVICE_PROFILE := TLWR2543 + TPLINK_HWID := 0x25430001 + IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade -v 3.13.99 + IMAGE/factory.bin := append-rootfs | mktplinkfw factory -v 3.13.99 +endef +TARGET_DEVICES += tl-wr2543-v1 + +define Device/tl-wr710n-v1 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WR710N v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 + BOARDNAME := TL-WR710N + DEVICE_PROFILE := TLWR710 + TPLINK_HWID := 0x07100001 + CONSOLE := ttyATH0,115200 + IMAGE/factory.bin := append-rootfs | mktplinkfw factory -C US +endef +TARGET_DEVICES += tl-wr710n-v1 + +define Device/tl-wr710n-v2.1 + $(Device/tl-wr710n-v1) + DEVICE_TITLE := TP-LINK TL-WR710N v2.1 + TPLINK_HWID := 0x07100002 + TPLINK_HWREV := 0x00000002 +endef +TARGET_DEVICES += tl-wr710n-v2.1 + +define Device/tl-wr810n-v1 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WR810N v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 + BOARDNAME := TL-WR810N + DEVICE_PROFILE := TLWR810 + TPLINK_HWID := 0x08100001 +endef +TARGET_DEVICES += tl-wr810n-v1 + +define Device/tl-wr810n-v2 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WR810N v2 + BOARDNAME := TL-WR810N-v2 + DEVICE_PROFILE := TLWR810 + TPLINK_HWID := 0x08100002 +endef +TARGET_DEVICES += tl-wr810n-v2 + +define Device/tl-wr842n-v1 + $(Device/tplink-8m) + DEVICE_TITLE := TP-LINK TL-WR842N/ND v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-MR3420 + DEVICE_PROFILE := TLWR842 + TPLINK_HWID := 0x08420001 +endef +TARGET_DEVICES += tl-wr842n-v1 + +define Device/tl-wr842n-v2 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WR842N/ND v2 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WR842N-v2 + DEVICE_PROFILE := TLWR842 + TPLINK_HWID := 0x8420002 +endef +TARGET_DEVICES += tl-wr842n-v2 + +define Device/tl-wr842n-v3 + $(Device/tplink-16mlzma) + DEVICE_TITLE := TP-LINK TL-WR842N/ND v3 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WR842N-v3 + DEVICE_PROFILE := TLWR842 + TPLINK_HWID := 0x08420003 +endef +TARGET_DEVICES += tl-wr842n-v3 + +define Device/tl-wr902ac-v1 + DEVICE_TITLE := TP-LINK TL-WR902AC v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport \ + kmod-ath10k ath10k-firmware-qca9887 -swconfig -uboot-envtools + BOARDNAME := TL-WR902AC-V1 + DEVICE_PROFILE := TLWR902 + TPLINK_BOARD_ID := TL-WR902AC-V1 + TPLINK_HWID := 0x0 + TPLINK_HWREV := 0 + TPLINK_HEADER_VERSION := 1 + SUPPORTED_DEVICES := tl-wr902ac-v1 + IMAGE_SIZE := 7360k + KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header + IMAGES += factory.bin + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory + IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \ + append-metadata | check-size $$$$(IMAGE_SIZE) + MTDPARTS := spi0.0:128k(u-boot)ro,7360k(firmware),640k(tplink)ro,64k(art)ro +endef +TARGET_DEVICES += tl-wr902ac-v1 + +define Device/tl-wr942n-v1 + DEVICE_TITLE := TP-LINK TL-WR942N v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WR942N-V1 + TPLINK_BOARD_ID := TLWR942NV1 + DEVICE_PROFILE := TLWR942 + IMAGE_SIZE := 14464k + KERNEL := kernel-bin | patch-cmdline | lzma | uImageArcher lzma + IMAGES := sysupgrade.bin factory.bin + IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \ + append-metadata | check-size $$$$(IMAGE_SIZE) + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory + MTDPARTS := spi0.0:128k(u-boot)ro,14464k(firmware),64k(product-info)ro,64k(partition-table)ro,256k(oem-config)ro,1344k(oem-vars)ro,64k(ART)ro + SUPPORTED_DEVICES := tl-wr942n-v1 +endef +TARGET_DEVICES += tl-wr942n-v1 diff --git a/target/linux/ar71xx/image/ubnt.mk b/target/linux/ar71xx/image/generic-ubnt.mk similarity index 91% rename from target/linux/ar71xx/image/ubnt.mk rename to target/linux/ar71xx/image/generic-ubnt.mk index dfc795bb21..2735c7491d 100644 --- a/target/linux/ar71xx/image/ubnt.mk +++ b/target/linux/ar71xx/image/generic-ubnt.mk @@ -71,31 +71,35 @@ define Device/rw2458n DEVICE_TITLE := Ubiquiti RW2458N BOARDNAME := RW2458N endef +TARGET_DEVICES += rw2458n define Device/ubnt-airrouter $(Device/ubnt-xm) DEVICE_TITLE := Ubiquiti AirRouter BOARDNAME := UBNT-AR endef +TARGET_DEVICES += ubnt-airrouter define Device/ubnt-bullet-m $(Device/ubnt-xm) DEVICE_TITLE := Ubiquiti Bullet-M BOARDNAME := UBNT-BM endef +TARGET_DEVICES += ubnt-bullet-m define Device/ubnt-rocket-m $(Device/ubnt-xm) DEVICE_TITLE := Ubiquiti Rocket-M BOARDNAME := UBNT-RM endef +TARGET_DEVICES += ubnt-rocket-m define Device/ubnt-nano-m $(Device/ubnt-xm) DEVICE_TITLE := Ubiquiti Nano-M BOARDNAME := UBNT-NM endef -TARGET_DEVICES += rw2458n ubnt-airrouter ubnt-bullet-m ubnt-rocket-m ubnt-nano-m +TARGET_DEVICES += ubnt-nano-m define Device/ubnt-unifi $(Device/ubnt-bz) @@ -103,6 +107,7 @@ define Device/ubnt-unifi BOARDNAME := UBNT-UF DEVICE_PROFILE += UBNTUNIFI endef +TARGET_DEVICES += ubnt-unifi define Device/ubnt-unifiac DEVICE_PACKAGES := kmod-usb-core kmod-usb2 @@ -120,11 +125,13 @@ define Device/ubnt-unifiac-lite DEVICE_PROFILE += UBNTUNIFIACLITE BOARDNAME := UBNT-UF-AC-LITE endef +TARGET_DEVICES += ubnt-unifiac-lite define Device/ubnt-unifiac-mesh $(Device/ubnt-unifiac-lite) DEVICE_TITLE := Ubiquiti UniFi AC-Mesh endef +TARGET_DEVICES += ubnt-unifiac-mesh define Device/ubnt-unifiac-pro $(Device/ubnt-unifiac) @@ -133,6 +140,7 @@ define Device/ubnt-unifiac-pro DEVICE_PROFILE += UBNTUNIFIACPRO BOARDNAME := UBNT-UF-AC-PRO endef +TARGET_DEVICES += ubnt-unifiac-pro define Device/ubnt-unifi-outdoor $(Device/ubnt-bz) @@ -140,25 +148,28 @@ define Device/ubnt-unifi-outdoor BOARDNAME := UBNT-U20 DEVICE_PROFILE += UBNTUNIFIOUTDOOR endef -TARGET_DEVICES += ubnt-unifi ubnt-unifiac-lite ubnt-unifiac-mesh ubnt-unifiac-pro ubnt-unifi-outdoor +TARGET_DEVICES += ubnt-unifi-outdoor define Device/ubnt-nano-m-xw $(Device/ubnt-xw) DEVICE_TITLE := Ubiquiti Nano M XW BOARDNAME := UBNT-NM-XW endef +TARGET_DEVICES += ubnt-nano-m-xw define Device/ubnt-loco-m-xw $(Device/ubnt-xw) DEVICE_TITLE := Ubiquiti Loco XW BOARDNAME := UBNT-LOCO-XW endef +TARGET_DEVICES += ubnt-loco-m-xw define Device/ubnt-rocket-m-xw $(Device/ubnt-xw) DEVICE_TITLE := Ubiquiti Rocket M XW BOARDNAME := UBNT-RM-XW endef +TARGET_DEVICES += ubnt-rocket-m-xw define Device/ubnt-rocket-m-ti $(Device/ubnt-xw) @@ -166,7 +177,7 @@ define Device/ubnt-rocket-m-ti BOARDNAME := UBNT-RM-TI UBNT_TYPE := TI endef -TARGET_DEVICES += ubnt-nano-m-xw ubnt-loco-m-xw ubnt-rocket-m-xw ubnt-rocket-m-ti +TARGET_DEVICES += ubnt-rocket-m-ti define Device/ubnt-air-gateway $(Device/ubnt-xm) @@ -176,6 +187,7 @@ define Device/ubnt-air-gateway UBNT_CHIP := ar933x CONSOLE := ttyATH0,115200 endef +TARGET_DEVICES += ubnt-air-gateway define Device/ubnt-air-gateway-pro $(Device/ubnt-xm) @@ -184,6 +196,7 @@ define Device/ubnt-air-gateway-pro UBNT_TYPE := AirGWP UBNT_CHIP := ar934x endef +TARGET_DEVICES += ubnt-air-gateway-pro define Device/ubdev01 $(Device/ubnt-xm) @@ -192,7 +205,7 @@ define Device/ubdev01 BOARDNAME := UBNT-UF UBNT_BOARD := UBDEV01 endef -TARGET_DEVICES += ubnt-air-gateway ubnt-air-gateway-pro ubdev01 +TARGET_DEVICES += ubdev01 define Device/ubnt-routerstation DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 @@ -213,6 +226,7 @@ define Device/ubnt-rs UBNT_TYPE := RSx UBNT_CHIP := ar7100 endef +TARGET_DEVICES += ubnt-rs define Device/ubnt-rspro $(Device/ubnt-routerstation) @@ -223,6 +237,7 @@ define Device/ubnt-rspro UBNT_TYPE := RSPRO UBNT_CHIP := ar7100pro endef +TARGET_DEVICES += ubnt-rspro define Device/ubnt-ls-sr71 $(Device/ubnt-routerstation) @@ -232,7 +247,7 @@ define Device/ubnt-ls-sr71 UBNT_TYPE := LS-SR71 UBNT_CHIP := ar7100 endef -TARGET_DEVICES += ubnt-rs ubnt-rspro ubnt-ls-sr71 +TARGET_DEVICES += ubnt-ls-sr71 define Device/ubnt-uap-pro DEVICE_TITLE := Ubiquiti UAP Pro diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk index 3c5fcc3f3c..88b9f930b6 100644 --- a/target/linux/ar71xx/image/generic.mk +++ b/target/linux/ar71xx/image/generic.mk @@ -1,5 +1,21 @@ DEVICE_VARS += DAP_SIGNATURE NETGEAR_BOARD_ID NETGEAR_HW_ID NETGEAR_KERNEL_MAGIC ROOTFS_SIZE SEAMA_SIGNATURE +define Build/alfa-network-rootfs-header + mkimage \ + -A mips -O linux -T filesystem -C lzma -a 0 -e 0 \ + -n 'RootfsImage' -d $@ $@.new + @mv $@.new $@ +endef + +define Build/append-md5sum-bin + $(STAGING_DIR_HOST)/bin/mkhash md5 $@ | sed 's/../\\\\x&/g' |\ + xargs echo -ne >> $@ +endef + +define Build/append-string + echo -n $(1) >> $@ +endef + define Build/mkbuffaloimg $(STAGING_DIR_HOST)/bin/mkbuffaloimg -B $(BOARDNAME) \ -R $$(($(subst k, * 1024,$(ROOTFS_SIZE)))) \ @@ -12,7 +28,7 @@ define Build/mkwrggimg $(STAGING_DIR_HOST)/bin/mkwrggimg -b \ -i $@ -o $@.imghdr -d /dev/mtdblock/1 \ -m $(BOARDNAME) -s $(DAP_SIGNATURE) \ - -v LEDE -B $(REVISION) + -v OpenWrt -B $(REVISION) mv $@.imghdr $@ endef @@ -61,12 +77,23 @@ define Build/seama-seal $(call Build/seama,-s $@.seama $(1)) endef +define Build/teltonika-fw-fake-checksum + # Teltonika U-Boot web based firmware upgrade/recovery routine compares + # 16 bytes from md5sum1[16] field in TP-Link v1 header (offset: 76 bytes + # from begin of the firmware file) with 16 bytes stored just before + # 0xdeadc0de marker. Values are only compared, MD5 sum is not verified. + let \ + offs="$$(stat -c%s $@) - 20"; \ + dd if=$@ bs=1 count=16 skip=76 |\ + dd of=$@ bs=1 count=16 seek=$$offs conv=notrunc +endef + define Build/uImageHiWiFi # Field ih_name needs to start with "tw150v1" mkimage -A $(LINUX_KARCH) \ -O linux -T kernel \ -C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ - -n 'tw150v1 $(call toupper,$(LINUX_KARCH)) LEDE Linux-$(LINUX_VERSION)' -d $@ $@.new + -n 'tw150v1 $(call toupper,$(LINUX_KARCH)) OpenWrt Linux-$(LINUX_VERSION)' -d $@ $@.new @mv $@.new $@ endef @@ -105,6 +132,22 @@ define Device/ap90q endef TARGET_DEVICES += ap90q +define Device/ap91-5g + DEVICE_TITLE := ALFA Network AP91-5G + DEVICE_PACKAGES := rssileds -swconfig + BOARDNAME := AP91-5G + IMAGE_SIZE := 7744k + KERNEL_SIZE := 1600k + ROOTFS_SIZE := 6144k + MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env),6144k(rootfs),1600k(kernel),64k(config)ro,64k(art)ro,7744k@0x50000(firmware) + IMAGES := sysupgrade.bin factory.bin + IMAGE/factory.bin := append-rootfs | pad-rootfs |\ + alfa-network-rootfs-header | append-kernel | check-size $$$$(IMAGE_SIZE) + IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs |\ + pad-to $$$$(ROOTFS_SIZE) | append-kernel | check-size $$$$(IMAGE_SIZE) +endef +TARGET_DEVICES += ap91-5g + define Device/arduino-yun DEVICE_TITLE := Arduino Yun DEVICE_PACKAGES := kmod-usb-core kmod-usb2 @@ -231,7 +274,7 @@ TARGET_DEVICES += dragino2 define Device/ew-dorin DEVICE_TITLE := Embedded Wireless Dorin Platform - DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea + DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea BOARDNAME = EW-DORIN CONSOLE := ttyATH0,115200 IMAGE_SIZE = 16000k @@ -241,7 +284,7 @@ TARGET_DEVICES += ew-dorin define Device/ew-dorin-router DEVICE_TITLE := Embedded Wireless Dorin Router Platform - DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea + DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea BOARDNAME = EW-DORIN-ROUTER CONSOLE := ttyATH0,115200 IMAGE_SIZE = 16000k @@ -287,6 +330,19 @@ define Device/gl-ar300m endef TARGET_DEVICES += gl-ar300m +define Device/gl-ar750 + DEVICE_TITLE := GL.iNet GL-AR750 + DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9887 kmod-usb-core \ + kmod-usb2 kmod-usb-storage + BOARDNAME := GL-AR750 + SUPPORTED_DEVICES := gl-ar750 + IMAGE_SIZE := 16000k + MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env),64k(art)ro,-(firmware) + IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) +endef +TARGET_DEVICES += gl-ar750 + define Device/gl-domino DEVICE_TITLE := GL.iNet Domino Pi DEVICE_PACKAGES := kmod-usb-core kmod-usb2 @@ -341,13 +397,23 @@ define Device/mr12 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to $$$$(ROOTFS_SIZE) | append-kernel | check-size $$$$(IMAGE_SIZE) IMAGES := kernel.bin rootfs.bin sysupgrade.bin endef +TARGET_DEVICES += mr12 define Device/mr16 $(Device/mr12) DEVICE_TITLE := Meraki MR16 BOARDNAME := MR16 endef -TARGET_DEVICES += mr12 mr16 +TARGET_DEVICES += mr16 + +define Device/dr342 + DEVICE_TITLE := Wallys DR342 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 -swconfig + BOARDNAME := DR342 + IMAGE_SIZE := 16000k + MTDPARTS := spi0.0:192k(u-boot)ro,64k(u-boot-env),64k(partition-table)ro,16000k(firmware),64k(art)ro +endef +TARGET_DEVICES += dr342 define Device/dr344 DEVICE_TITLE := Wallys DR344 @@ -383,6 +449,7 @@ define Device/wndr3700 IMAGE/factory.img := $$(IMAGE/default) | netgear-dni | check-size $$$$(IMAGE_SIZE) IMAGE/factory-NA.img := $$(IMAGE/default) | netgear-dni NA | check-size $$$$(IMAGE_SIZE) endef +TARGET_DEVICES += wndr3700 define Device/wndr3700v2 $(Device/wndr3700) @@ -394,6 +461,7 @@ define Device/wndr3700v2 MTDPARTS := spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,15872k(firmware),64k(art)ro IMAGES := sysupgrade.bin factory.img endef +TARGET_DEVICES += wndr3700v2 define Device/wndr3800 $(Device/wndr3700v2) @@ -401,25 +469,28 @@ define Device/wndr3800 NETGEAR_BOARD_ID := WNDR3800 NETGEAR_HW_ID := 29763654+16+128 endef +TARGET_DEVICES += wndr3800 define Device/wndr3800ch $(Device/wndr3800) DEVICE_TITLE := NETGEAR WNDR3800 (Ch) NETGEAR_BOARD_ID := WNDR3800CH endef +TARGET_DEVICES += wndr3800ch define Device/wndrmac $(Device/wndr3700v2) DEVICE_TITLE := NETGEAR WNDRMAC NETGEAR_BOARD_ID := WNDRMAC endef +TARGET_DEVICES += wndrmac define Device/wndrmacv2 $(Device/wndr3800) DEVICE_TITLE := NETGEAR WNDRMAC v2 NETGEAR_BOARD_ID := WNDRMACv2 endef -TARGET_DEVICES += wndr3700 wndr3700v2 wndr3800 wndr3800ch wndrmac wndrmacv2 +TARGET_DEVICES += wndrmacv2 define Device/cap324 DEVICE_TITLE := PowerCloud CAP324 Cloud AP @@ -496,6 +567,7 @@ define Device/antminer-s1 TPLINK_HWID := 0x04440101 CONSOLE := ttyATH0,115200 endef +TARGET_DEVICES += antminer-s1 define Device/antminer-s3 $(Device/tplink-8mlzma) @@ -506,6 +578,7 @@ define Device/antminer-s3 TPLINK_HWID := 0x04440301 CONSOLE := ttyATH0,115200 endef +TARGET_DEVICES += antminer-s3 define Device/antrouter-r1 $(Device/tplink-8mlzma) @@ -516,6 +589,7 @@ define Device/antrouter-r1 TPLINK_HWID := 0x44440101 CONSOLE := ttyATH0,115200 endef +TARGET_DEVICES += antrouter-r1 define Device/el-m150 $(Device/tplink-8mlzma) @@ -526,6 +600,7 @@ define Device/el-m150 TPLINK_HWID := 0x01500101 CONSOLE := ttyATH0,115200 endef +TARGET_DEVICES += el-m150 define Device/el-mini $(Device/tplink-8mlzma) @@ -536,7 +611,7 @@ define Device/el-mini TPLINK_HWID := 0x01530001 CONSOLE := ttyATH0,115200 endef -TARGET_DEVICES += antminer-s1 antminer-s3 antrouter-r1 el-m150 el-mini +TARGET_DEVICES += el-mini define Device/gl-inet-6408A-v1 $(Device/tplink-8mlzma) @@ -547,6 +622,7 @@ define Device/gl-inet-6408A-v1 TPLINK_HWID := 0x08000001 CONSOLE := ttyATH0,115200 endef +TARGET_DEVICES += gl-inet-6408A-v1 define Device/gl-inet-6416A-v1 $(Device/tplink-16mlzma) @@ -557,7 +633,7 @@ define Device/gl-inet-6416A-v1 TPLINK_HWID := 0x08000001 CONSOLE := ttyATH0,115200 endef -TARGET_DEVICES += gl-inet-6408A-v1 gl-inet-6416A-v1 +TARGET_DEVICES += gl-inet-6416A-v1 define Device/jwap230 DEVICE_TITLE := jjPlus JWAP230 @@ -568,6 +644,18 @@ define Device/jwap230 endef TARGET_DEVICES += jwap230 +define Device/r36a + DEVICE_TITLE := ALFA Network R36A + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport -swconfig + BOARDNAME := R36A + SUPPORTED_DEVICES := r36a + IMAGE_SIZE := 15872k + MTDPARTS := spi0.0:384k(u-boot)ro,64k(u-boot-env),64k(art)ro,-(firmware) + IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) +endef +TARGET_DEVICES += r36a + define Device/r602n DEVICE_TITLE := P&W R602N DEVICE_PACKAGES := kmod-usb-core kmod-usb2 @@ -577,15 +665,27 @@ define Device/r602n endef TARGET_DEVICES += r602n -define Device/rnx-n360rt - $(Device/tplink-4m) - DEVICE_TITLE := Rosewill RNX-N360RT - BOARDNAME := TL-WR941ND - DEVICE_PROFILE := RNXN360RT - TPLINK_HWID := 0x09410002 - TPLINK_HWREV := 0x00420001 +define Device/rut900 + DEVICE_TITLE := Teltonika RUT900 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 -uboot-envtools + BOARDNAME := RUT900 + SUPPORTED_DEVICES := rut900 + IMAGE_SIZE := 15552k + MTDPARTS := spi0.0:128k(u-boot)ro,64k(config)ro,64k(art)ro,15552k(firmware),576k(event-log)ro + TPLINK_HWID := 0x35000001 + TPLINK_HWREV := 0x1 + TPLINK_HEADER_VERSION := 1 + KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header + KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | uImage lzma + IMAGES := sysupgrade.bin factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs |\ + pad-rootfs | teltonika-fw-fake-checksum | append-string master |\ + append-md5sum-bin | check-size $$$$(IMAGE_SIZE) + IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) |\ + append-rootfs | pad-rootfs | append-metadata |\ + check-size $$$$(IMAGE_SIZE) endef -TARGET_DEVICES += rnx-n360rt +TARGET_DEVICES += rut900 define Device/mc-mac1200r $(Device/tplink-8mlzma) @@ -616,6 +716,7 @@ define Device/omy-g1 DEVICE_PROFILE := OMYG1 TPLINK_HWID := 0x06660101 endef +TARGET_DEVICES += omy-g1 define Device/omy-x1 $(Device/tplink-8mlzma) @@ -624,7 +725,7 @@ define Device/omy-x1 DEVICE_PROFILE := OMYX1 TPLINK_HWID := 0x06660201 endef -TARGET_DEVICES += omy-g1 omy-x1 +TARGET_DEVICES += omy-x1 define Device/onion-omega $(Device/tplink-16mlzma) @@ -723,6 +824,18 @@ define Device/oolite endef TARGET_DEVICES += oolite +define Device/n5q + DEVICE_TITLE := ALFA Network N5Q + DEVICE_PACKAGES := rssileds -swconfig + BOARDNAME := N5Q + SUPPORTED_DEVICES := n5q + IMAGE_SIZE := 15872k + MTDPARTS := spi0.0:384k(u-boot)ro,64k(u-boot-env),64k(art)ro,-(firmware) + IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) +endef +TARGET_DEVICES += n5q + define Device/NBG6616 DEVICE_TITLE := ZyXEL NBG6616 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-rtc-pcf8563 kmod-ath10k ath10k-firmware-qca988x @@ -817,6 +930,7 @@ define Device/dir-869-a1 seama | seama-seal -m "signature=$$$$(SEAMA_SIGNATURE)" | \ check-size $$$$(IMAGE_SIZE) endef +TARGET_DEVICES += dir-869-a1 define Device/mynet-n600 $(Device/seama) @@ -827,6 +941,7 @@ define Device/mynet-n600 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(devdata)ro,64k(devconf)ro,15872k(firmware),64k(radiocfg)ro SEAMA_SIGNATURE := wrgnd16_wd_db600 endef +TARGET_DEVICES += mynet-n600 define Device/mynet-n750 $(Device/seama) @@ -837,6 +952,7 @@ define Device/mynet-n750 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(devdata)ro,64k(devconf)ro,15872k(firmware),64k(radiocfg)ro SEAMA_SIGNATURE := wrgnd13_wd_av endef +TARGET_DEVICES += mynet-n750 define Device/qihoo-c301 $(Device/seama) @@ -847,7 +963,7 @@ define Device/qihoo-c301 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env),64k(devdata),64k(devconf),15744k(firmware),64k(warm_start),64k(action_image_config),64k(radiocfg)ro;spi0.1:15360k(upgrade2),1024k(privatedata) SEAMA_SIGNATURE := wrgac26_qihoo360_360rg endef -TARGET_DEVICES += dir-869-a1 mynet-n600 mynet-n750 qihoo-c301 +TARGET_DEVICES += qihoo-c301 define Device/dap-2695-a1 DEVICE_TITLE := D-Link DAP-2695 rev. A1 @@ -877,6 +993,16 @@ define Device/bhr-4grv2 endef TARGET_DEVICES += bhr-4grv2 +define Device/wlr8100 + DEVICE_TITLE := Sitecom WLR-8100 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-usb3 \ + kmod-ath10k ath10k-firmware-qca988x + BOARDNAME := WLR8100 + IMAGE_SIZE := 15424k + MTDPARTS := spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,15424k(firmware),256k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(art)ro +endef +TARGET_DEVICES += wlr8100 + define Device/wpj-16m DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport MTDPARTS := spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro @@ -888,6 +1014,7 @@ define Device/wpj342 DEVICE_TITLE := Compex WPJ342 (16MB flash) BOARDNAME := WPJ342 endef +TARGET_DEVICES += wpj342 define Device/wpj344 $(Device/wpj-16m) @@ -897,12 +1024,14 @@ define Device/wpj344 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) endef +TARGET_DEVICES += wpj344 define Device/wpj531 $(Device/wpj-16m) DEVICE_TITLE := Compex WPJ531 (16MB flash) BOARDNAME := WPJ531 endef +TARGET_DEVICES += wpj531 define Device/wpj558 $(Device/wpj-16m) @@ -912,13 +1041,14 @@ define Device/wpj558 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) endef +TARGET_DEVICES += wpj558 define Device/wpj563 $(Device/wpj-16m) DEVICE_TITLE := Compex WPJ563 (16MB flash) BOARDNAME := WPJ563 endef -TARGET_DEVICES += wpj342 wpj344 wpj531 wpj558 wpj563 +TARGET_DEVICES += wpj563 define Device/wrtnode2q DEVICE_TITLE := WRTnode2Q diff --git a/target/linux/ar71xx/image/legacy.mk b/target/linux/ar71xx/image/legacy.mk index 701116be43..bd8ca2cefe 100644 --- a/target/linux/ar71xx/image/legacy.mk +++ b/target/linux/ar71xx/image/legacy.mk @@ -263,7 +263,6 @@ dlrtdev_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64 dlrtdev_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7168k(firmware),640k(certs),64k(caldata)ro,64k@0x660000(caldata_orig),6208k@0x50000(firmware_orig) planex_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),128k(art)ro whrhpg300n_mtdlayout=mtdparts=spi0.0:248k(u-boot)ro,8k(u-boot-env)ro,3712k(firmware),64k(art)ro -wlr8100_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),14080k(rootfs),192k(unknown)ro,64k(art)ro,384k(unknown2)ro,15488k@0x40000(firmware) wndap360_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),64k(nvram)ro,64k(art)ro wnr2200_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7808k(firmware),64k(art)ro wnr2000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,3712k(firmware),64k(art)ro @@ -485,11 +484,11 @@ define Image/Build/Belkin $(eval rootsize=$(call mtdpartsize,rootfs,$(4))) $(call Sysupgrade/RKuImage,$(1),$(2),$(kernsize),$(rootsize)) if [ -e "$(call sysupname,$(1),$(2))" ]; then \ - edimax_fw_header -m $(5) -v "$(shell echo -n LEDE$(REVISION) | cut -c -13)" \ + edimax_fw_header -m $(5) -v "$(shell echo -n OpenWrt$(REVISION) | cut -c -13)" \ -n "uImage" \ -i $(KDIR_TMP)/vmlinux-$(2).uImage \ -o $(KDIR_TMP)/$(2)-uImage; \ - edimax_fw_header -m $(5) -v "$(shell echo -n LEDE$(REVISION) | cut -c -13)" \ + edimax_fw_header -m $(5) -v "$(shell echo -n OpenWrt$(REVISION) | cut -c -13)" \ -n "rootfs" \ -i $(KDIR)/root.$(1) \ -o $(KDIR_TMP)/$(2)-rootfs; \ @@ -897,29 +896,9 @@ $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,1152 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage)) $(eval $(call SingleProfile,AthLzma,64k,HORNETUBx2,hornet-ub-x2,HORNET-UB,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536)) $(eval $(call SingleProfile,AthLzma,64k,TUBE2H16M,tube2h-16M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536)) -$(eval $(call SingleProfile,AthLzma,64k,WLR8100,wlr8100,WLR8100,ttyS0,115200,$$(wlr8100_mtdlayout),KRuImage)) $(eval $(call SingleProfile,Belkin,64k,F9K1115V2,f9k1115v2,F9K1115V2,ttyS0,115200,$$(f9k1115v2_mtdlayout),BR-6679BAC)) -$(eval $(call SingleProfile,CameoAP91,64kraw,DIR600A1,dir-600-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-00")) -$(eval $(call SingleProfile,CameoAP91,64kraw,DIR601A1,dir-601-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-02")) -$(eval $(call SingleProfile,CameoAP91,64kraw,FR54RTR,fr-54rtr,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-01")) - -$(eval $(call SingleProfile,CameoAP99,64kraw,EBR2310C1,ebr-2310-c1,EBR-2310-C1,ttyS0,115200,"AP91-AR7240-RT-090223-03")) -$(eval $(call SingleProfile,CameoAP99,64kraw,DIR615E1,dir-615-e1,DIR-615-E1,ttyS0,115200,"AP93-AR7240-RT-081028-00")) -$(eval $(call SingleProfile,CameoAP99,64kraw,DIR615E4,dir-615-e4,DIR-615-E4,ttyS0,115200,"AP99-AR7240-RT-091105-05")) - -$(eval $(call SingleProfile,CameoAP123_4M,64kraw,DIR615I1,dir-615-i1,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-1012I1-00")) -$(eval $(call SingleProfile,CameoAP123_4M,64kraw,DIR615I3,dir-615-i3,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-101214-00")) - -$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,A02RBW300N,a02-rb-w300n,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-03")) -$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,DIR615C1,dir-615-c1,DIR-615-C1,ttyS0,115200,"AP81-AR9130-RT-070614-02")) -$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW632BRP,tew-632brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-00")) -$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW652BRP_FW,tew-652brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-080609-05")) -$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW652BRP_RECOVERY,tew-652brp-recovery,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-02")) - -$(eval $(call SingleProfile,CameoAP121,64kraw-nojffs,TEW712BR,tew-712br,TEW-712BR,ttyATH0,115200,"HORNET-RT-TEW712BR-3",1.99,"")) -$(eval $(call SingleProfile,CameoAP121,64kraw-nojffs,DIR601B1,dir-601-b1,TEW-712BR,ttyATH0,115200,"HORNET-RT-DIR601B1-3",2.99.99,"" "NA")) $(eval $(call SingleProfile,CameoAP121_8M,64kraw-nojffs,DIR505A1,dir-505-a1,DIR-505-A1,ttyATH0,115200,"HORNET-PACKET-DIR505A1-3",1.99.99,"")) $(eval $(call SingleProfile,CameoAP135,64kraw,DGL5500A1,dgl-5500-a1,DGL-5500-A1,ttyS0,115200,$$(dgl_5500_mtdlayout),"00AP135AR9558-RT-130508-00")) @@ -948,22 +927,12 @@ $(eval $(call SingleProfile,EnGenius,64k,ESR900,esr900,ESR900,ttyS0,115200,$$(es $(eval $(call SingleProfile,EnGenius,64k,ESR1750,esr1750,ESR1750,ttyS0,115200,$$(esr1750_mtdlayout),KRuImage,,0x61)) $(eval $(call SingleProfile,EnGenius,64k,EPG5000,epg5000,EPG5000,ttyS0,115200,$$(epg5000_mtdlayout),KRuImage,,0x71)) -$(eval $(call SingleProfile,MyLoader,64k,WP543_4M,wp543,,ttyS0,115200,0x400000,4M)) $(eval $(call SingleProfile,MyLoader,64k,WP543_8M,wp543,,ttyS0,115200,0x800000,8M)) $(eval $(call SingleProfile,MyLoader,64k,WP543_16M,wp543,,ttyS0,115200,0x1000000,16M)) -$(eval $(call SingleProfile,MyLoader,64k,WPE72_4M,wpe72,,ttyS0,115200,0x400000,4M)) $(eval $(call SingleProfile,MyLoader,64k,WPE72_8M,wpe72,,ttyS0,115200,0x800000,8M)) $(eval $(call SingleProfile,MyLoader,64k,WPE72_16M,wpe72,,ttyS0,115200,0x1000000,16M)) -$(eval $(call SingleProfile,Netgear,64kraw,WNR2000V3,wnr2000v3,WNR2000V3,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303033,WNR2000V3,"" NA,-H 29763551+04+32)) -$(eval $(call SingleProfile,NetgearLzma,64kraw,WNR2000V4,wnr2000v4,WNR2000V4,ttyS0,115200,$$(wnr2000v4_mtdlayout),0x32303034,WNR2000V4,"" NA,)) -$(eval $(call SingleProfile,Netgear,64kraw,WNR2000,wnr2000,WNR2000,ttyS0,115200,$$(wnr2000_mtdlayout),0x32303031,WNR2000,"" NA,)) $(eval $(call SingleProfile,Netgear,64kraw,WNR2200,wnr2200,WNR2200,ttyS0,115200,$$(wnr2200_mtdlayout),0x32323030,wnr2200,"" NA,)) -$(eval $(call SingleProfile,Netgear,64kraw,REALWNR612V2,wnr612v2,WNR612V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303631,WNR612V2,"",)) -$(eval $(call SingleProfile,Netgear,64kraw,N150R,n150r,WNR612V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303631,N150R,"",)) -$(eval $(call SingleProfile,Netgear,64kraw,REALWNR1000V2,wnr1000v2,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303031,WNR1000V2,"",)) -$(eval $(call SingleProfile,Netgear,64kraw,WNR1000V2_VC,wnr1000v2-vc,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303030,WNR1000V2-VC,"",)) -$(eval $(call SingleProfile,Netgear,64kraw,WPN824N,wpn824n,WPN824N,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31313030,WPN824N,"" NA,)) $(eval $(call SingleProfile,OpenMesh,squashfs-only,A60,a60,,,,A60)) $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM2P,om2p,,,,OM2P)) @@ -986,11 +955,6 @@ $(eval $(call SingleProfile,Planex,64kraw,MZKW300NH,mzk-w300nh,MZK-W300NH,ttyS0, $(eval $(call SingleProfile,Senao,squashfs-only,EAP300V2,eap300v2,EAP300V2,ttyS0,115200,$$(eap300v2_mtdlayout))) -$(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRG301N,whr-g301n,WHR-G301N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-G301N)) -$(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRHPG300N,whr-hp-g300n,WHR-HP-G300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-G300N)) -$(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRHPGN,whr-hp-gn,WHR-HP-GN,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-GN)) -$(eval $(call SingleProfile,WHRHPG300N,64kraw,WLAEAG300N,wlae-ag300n,WLAE-AG300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WLAE-AG300N)) - $(eval $(call SingleProfile,WRT400N,64k,WRT400N,wrt400n,WRT400N,ttyS0,115200)) $(eval $(call SingleProfile,WZRHP128K,128kraw,WZRHPG300NH,wzr-hp-g300nh,WZR-HP-G300NH,ttyS0,115200,WZR-HP-G300NH)) @@ -1003,9 +967,52 @@ $(eval $(call SingleProfile,WZRHP64K,64kraw,WZR450HP2,wzr-450hp2,WZR-450HP2,ttyS $(eval $(call SingleProfile,Zcomax,64k,ZCN1523H28,zcn-1523h-2-8,ZCN-1523H-2,ttyS0,115200,$$(zcn1523h_mtdlayout))) $(eval $(call SingleProfile,Zcomax,64k,ZCN1523H516,zcn-1523h-5-16,ZCN-1523H-5,ttyS0,115200,$$(zcn1523h_mtdlayout))) +endif # ifeq ($(SUBTARGET),generic) + + +ifeq ($(SUBTARGET),tiny) + +$(eval $(call SingleProfile,CameoAP91,64kraw,DIR600A1,dir-600-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-00")) +$(eval $(call SingleProfile,CameoAP91,64kraw,DIR601A1,dir-601-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-02")) +$(eval $(call SingleProfile,CameoAP91,64kraw,FR54RTR,fr-54rtr,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-01")) + +$(eval $(call SingleProfile,CameoAP99,64kraw,EBR2310C1,ebr-2310-c1,EBR-2310-C1,ttyS0,115200,"AP91-AR7240-RT-090223-03")) +$(eval $(call SingleProfile,CameoAP99,64kraw,DIR615E1,dir-615-e1,DIR-615-E1,ttyS0,115200,"AP93-AR7240-RT-081028-00")) +$(eval $(call SingleProfile,CameoAP99,64kraw,DIR615E4,dir-615-e4,DIR-615-E4,ttyS0,115200,"AP99-AR7240-RT-091105-05")) + +$(eval $(call SingleProfile,CameoAP123_4M,64kraw,DIR615I1,dir-615-i1,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-1012I1-00")) +$(eval $(call SingleProfile,CameoAP123_4M,64kraw,DIR615I3,dir-615-i3,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-101214-00")) + +$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,A02RBW300N,a02-rb-w300n,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-03")) +$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,DIR615C1,dir-615-c1,DIR-615-C1,ttyS0,115200,"AP81-AR9130-RT-070614-02")) +$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW632BRP,tew-632brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-00")) +$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW652BRP_FW,tew-652brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-080609-05")) +$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW652BRP_RECOVERY,tew-652brp-recovery,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-02")) + +$(eval $(call SingleProfile,CameoAP121,64kraw-nojffs,TEW712BR,tew-712br,TEW-712BR,ttyATH0,115200,"HORNET-RT-TEW712BR-3",1.99,"")) +$(eval $(call SingleProfile,CameoAP121,64kraw-nojffs,DIR601B1,dir-601-b1,TEW-712BR,ttyATH0,115200,"HORNET-RT-DIR601B1-3",2.99.99,"" "NA")) + +$(eval $(call SingleProfile,MyLoader,64k,WP543_4M,wp543,,ttyS0,115200,0x400000,4M)) +$(eval $(call SingleProfile,MyLoader,64k,WPE72_4M,wpe72,,ttyS0,115200,0x400000,4M)) + +$(eval $(call SingleProfile,Netgear,64kraw,WNR2000V3,wnr2000v3,WNR2000V3,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303033,WNR2000V3,"" NA,-H 29763551+04+32)) +$(eval $(call SingleProfile,NetgearLzma,64kraw,WNR2000V4,wnr2000v4,WNR2000V4,ttyS0,115200,$$(wnr2000v4_mtdlayout),0x32303034,WNR2000V4,"" NA,)) +$(eval $(call SingleProfile,Netgear,64kraw,WNR2000,wnr2000,WNR2000,ttyS0,115200,$$(wnr2000_mtdlayout),0x32303031,WNR2000,"" NA,)) +$(eval $(call SingleProfile,Netgear,64kraw,REALWNR612V2,wnr612v2,WNR612V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303631,WNR612V2,"",)) +$(eval $(call SingleProfile,Netgear,64kraw,N150R,n150r,WNR612V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303631,N150R,"",)) +$(eval $(call SingleProfile,Netgear,64kraw,REALWNR1000V2,wnr1000v2,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303031,WNR1000V2,"",)) +$(eval $(call SingleProfile,Netgear,64kraw,WNR1000V2_VC,wnr1000v2-vc,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303030,WNR1000V2-VC,"",)) +$(eval $(call SingleProfile,Netgear,64kraw,WPN824N,wpn824n,WPN824N,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31313030,WPN824N,"" NA,)) + +$(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRG301N,whr-g301n,WHR-G301N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-G301N)) +$(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRHPG300N,whr-hp-g300n,WHR-HP-G300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-G300N)) +$(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRHPGN,whr-hp-gn,WHR-HP-GN,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-GN)) +$(eval $(call SingleProfile,WHRHPG300N,64kraw,WLAEAG300N,wlae-ag300n,WLAE-AG300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WLAE-AG300N)) + $(eval $(call SingleProfile,ZyXEL,64k,NBG_460N_550N_550NH,nbg460n_550n_550nh,NBG460N,ttyS0,115200,NBG-460N)) -endif # ifeq ($(SUBTARGET),generic) +endif # ifeq ($(SUBTARGET),tiny) + ifeq ($(SUBTARGET),nand) diff --git a/target/linux/ar71xx/image/lzma-loader/src/Makefile b/target/linux/ar71xx/image/lzma-loader/src/Makefile index 682b31fe8c..c54f64a550 100644 --- a/target/linux/ar71xx/image/lzma-loader/src/Makefile +++ b/target/linux/ar71xx/image/lzma-loader/src/Makefile @@ -33,7 +33,7 @@ BIN_FLAGS := -O binary -R .reginfo -R .note -R .comment -R .mdebug \ CFLAGS = -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -Os \ -fno-strict-aliasing -fno-common -fomit-frame-pointer -G 0 \ -mno-abicalls -fno-pic -ffunction-sections -pipe -mlong-calls \ - -fno-common -ffreestanding -fhonour-copts \ + -fno-common -ffreestanding -fhonour-copts -nostartfiles \ -mabi=32 -march=mips32r2 \ -Wa,-32 -Wa,-march=mips32r2 -Wa,-mips32r2 -Wa,--trap CFLAGS += -D_LZMA_PROB32 diff --git a/target/linux/ar71xx/image/mikrotik.mk b/target/linux/ar71xx/image/mikrotik.mk index 8f7d7cce98..403bcb08b5 100644 --- a/target/linux/ar71xx/image/mikrotik.mk +++ b/target/linux/ar71xx/image/mikrotik.mk @@ -15,29 +15,41 @@ define Device/nand-64m DEVICE_TITLE := MikroTik RouterBoard (64 MB NAND) KERNEL := kernel-bin | kernel2minor -s 512 -e -c endef +TARGET_DEVICES += nand-64m define Device/nand-large $(Device/mikrotik) DEVICE_TITLE := MikroTik RouterBoard (>= 128 MB NAND) KERNEL := kernel-bin | kernel2minor -s 2048 -e -c endef -TARGET_DEVICES += nand-64m nand-large +TARGET_DEVICES += nand-large + +define Device/nand-large-ac + $(Device/mikrotik) + DEVICE_TITLE := MikroTik RouterBoard (>= 128 MB NAND, 802.11ac) + DEVICE_PACKAGES += kmod-ath10k ath10k-firmware-qca988x + KERNEL := kernel-bin | kernel2minor -s 2048 -e -c + SUPPORTED_DEVICES := rb-921gs-5hpacd-r2 +endef +TARGET_DEVICES += nand-large-ac define Device/rb-nor-flash-16M DEVICE_TITLE := MikroTik RouterBoard (16 MB SPI NOR) - DEVICE_PACKAGES := rbcfg rssileds -nand-utils + DEVICE_PACKAGES := rbcfg rssileds -nand-utils kmod-ledtrig-gpio IMAGE_SIZE := 16000k LOADER_TYPE := elf KERNEL_INSTALL := 1 KERNEL := kernel-bin | lzma | loader-kernel - SUPPORTED_DEVICES := rb-750-r2 rb-750up-r2 rb-750p-pbr2 rb-941-2nd rb-951ui-2nd rb-952ui-5ac2nd rb-962uigs-5hact2hnt rb-lhg-5nd rb-mapl-2nd + SUPPORTED_DEVICES := rb-750-r2 rb-750up-r2 rb-750p-pbr2 rb-941-2nd rb-951ui-2nd rb-952ui-5ac2nd rb-962uigs-5hact2hnt rb-lhg-5nd rb-map-2nd rb-mapl-2nd rb-wap-2nd IMAGE/sysupgrade.bin := append-kernel | kernel2minor -s 1024 -e | pad-to $$$$(BLOCKSIZE) | \ append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) endef +TARGET_DEVICES += rb-nor-flash-16M define Device/rb-nor-flash-16M-ac $(Device/rb-nor-flash-16M) DEVICE_TITLE := MikroTik RouterBoard (16 MB SPI NOR, 802.11ac) DEVICE_PACKAGES += kmod-ath10k ath10k-firmware-qca988x ath10k-firmware-qca9887 + SUPPORTED_DEVICES := rb-wapg-5hact2hnd endef -TARGET_DEVICES += rb-nor-flash-16M rb-nor-flash-16M-ac +TARGET_DEVICES += rb-nor-flash-16M-ac diff --git a/target/linux/ar71xx/image/tiny-legacy-devices.mk b/target/linux/ar71xx/image/tiny-legacy-devices.mk new file mode 100644 index 0000000000..3445c4c8c3 --- /dev/null +++ b/target/linux/ar71xx/image/tiny-legacy-devices.mk @@ -0,0 +1,154 @@ +define LegacyDevice/DIR600A1 + DEVICE_TITLE := D-Link DIR-600 rev. A1 +endef +LEGACY_DEVICES += DIR600A1 + +define LegacyDevice/DIR601A1 + DEVICE_TITLE := D-Link DIR-601 rev. A1 +endef +LEGACY_DEVICES += DIR601A1 + +define LegacyDevice/FR54RTR + DEVICE_TITLE := Frys FR-54RTR +endef +LEGACY_DEVICES += FR54RTR + +define LegacyDevice/EBR2310C1 + DEVICE_TITLE := D-Link EBR-2310 rev. C1 +endef +LEGACY_DEVICES += EBR2310C1 + +define LegacyDevice/DIR615E1 + DEVICE_TITLE := D-Link DIR-615 rev. E1 +endef +LEGACY_DEVICES += DIR615E1 + +define LegacyDevice/DIR615E4 + DEVICE_TITLE := D-Link DIR-615 rev. E4 +endef +LEGACY_DEVICES += DIR615E4 + +define LegacyDevice/DIR615I1 + DEVICE_TITLE := D-Link DIR-615 rev. I1 +endef +LEGACY_DEVICES += DIR615I1 + +define LegacyDevice/DIR615I3 + DEVICE_TITLE := D-Link DIR-615 rev. I3 +endef +LEGACY_DEVICES += DIR615I3 + +define LegacyDevice/A02RBW300N + DEVICE_TITLE := Atlantis-Land A02-RB-W300N +endef +LEGACY_DEVICES += A02RBW300N + +define LegacyDevice/DIR615C1 + DEVICE_TITLE := D-Link DIR-615 rev. C1 +endef +LEGACY_DEVICES += DIR615C1 + +define LegacyDevice/TEW632BRP + DEVICE_TITLE := TRENDNet TEW-632BRP +endef +LEGACY_DEVICES += TEW632BRP + +define LegacyDevice/TEW652BRP_FW + DEVICE_TITLE := TRENDNet TEW-652BRP +endef +LEGACY_DEVICES += TEW652BRP_FW + +define LegacyDevice/TEW652BRP_RECOVERY + DEVICE_TITLE := TRENDNet TEW-652BRP (recovery) +endef +LEGACY_DEVICES += TEW652BRP_RECOVERY + +define LegacyDevice/TEW712BR + DEVICE_TITLE := TRENDNet TEW-712BR +endef +LEGACY_DEVICES += TEW712BR + +define LegacyDevice/DIR601B1 + DEVICE_TITLE := D-Link DIR-601 rev. B1 +endef +LEGACY_DEVICES += DIR601B1 + +define LegacyDevice/WP543_4M + DEVICE_TITLE := Compex WP543/WPJ543 (4MB flash) + DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 +endef +LEGACY_DEVICES += WP543_4M + +define LegacyDevice/WPE72_4M + DEVICE_TITLE := Compex WPE72/WPE72NX (4MB flash) + DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 +endef +LEGACY_DEVICES += WPE72_4M + +define LegacyDevice/WNR2000 + DEVICE_TITLE := NETGEAR WNR2000V1 +endef +LEGACY_DEVICES += WNR2000 + +define LegacyDevice/WNR2000V3 + DEVICE_TITLE := NETGEAR WNR2000V3 +endef +LEGACY_DEVICES += WNR2000V3 + +define LegacyDevice/WNR2000V4 + DEVICE_TITLE := NETGEAR WNR2000V4 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport +endef +LEGACY_DEVICES += WNR2000V4 + +define LegacyDevice/REALWNR612V2 + DEVICE_TITLE := NETGEAR WNR612V2 +endef +LEGACY_DEVICES += REALWNR612V2 + +define LegacyDevice/N150R + DEVICE_TITLE := On Networks N150 +endef +LEGACY_DEVICES += N150R + +define LegacyDevice/REALWNR1000V2 + DEVICE_TITLE := NETGEAR WNR1000V2 +endef +LEGACY_DEVICES += REALWNR1000V2 + +define LegacyDevice/WNR1000V2_VC + DEVICE_TITLE := NETGEAR WNR1000V2-VC +endef +LEGACY_DEVICES += WNR1000V2_VC + +define LegacyDevice/WPN824N + DEVICE_TITLE := NETGEAR WPN824N +endef +LEGACY_DEVICES += WPN824N + +define LegacyDevice/WHRG301N + DEVICE_TITLE := Buffalo WHR-G301N +endef +LEGACY_DEVICES += WHRG301N + +define LegacyDevice/WHRHPG300N + DEVICE_TITLE := Buffalo WHR-HP-G300N +endef +LEGACY_DEVICES += WHRHPG300N + +define LegacyDevice/WHRHPGN + DEVICE_TITLE := Buffalo WHR-HP-GN +endef +LEGACY_DEVICES += WHRHPGN + +define LegacyDevice/WLAEAG300N + DEVICE_TITLE := Buffalo WLAE-AG300N + DEVICE_PACKAGES := kmod-ledtrig-netdev +endef +LEGACY_DEVICES += WLAEAG300N + +define LegacyDevice/NBG_460N_550N_550NH + DEVICE_TITLE := ZyXEL NBG 460N/550N/550NH + DEVICE_PACKAGES := kmod-rtc-pcf8563 +endef +LEGACY_DEVICES += NBG_460N_550N_550NH diff --git a/target/linux/ar71xx/image/tiny-tp-link.mk b/target/linux/ar71xx/image/tiny-tp-link.mk new file mode 100644 index 0000000000..092d8aa114 --- /dev/null +++ b/target/linux/ar71xx/image/tiny-tp-link.mk @@ -0,0 +1,684 @@ +include ./common-tp-link.mk + + +define Device/tl-mr10u-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-MR10U v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 + BOARDNAME := TL-MR10U + DEVICE_PROFILE := TLMR10U + TPLINK_HWID := 0x00100101 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-mr10u-v1 + +define Device/tl-mr11u-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-MR11U v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-MR11U + DEVICE_PROFILE := TLMR11U + TPLINK_HWID := 0x00110101 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-mr11u-v1 + +define Device/tl-mr11u-v2 + $(Device/tl-mr11u-v1) + DEVICE_TITLE := TP-LINK TL-MR11U v2 + TPLINK_HWID := 0x00110102 +endef +TARGET_DEVICES += tl-mr11u-v2 + +define Device/tl-mr12u-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-MR12U v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-MR13U + DEVICE_PROFILE := TLMR12U + TPLINK_HWID := 0x00120101 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-mr12u-v1 + +define Device/tl-mr13u-v1 + $(Device/tl-mr12u-v1) + DEVICE_TITLE := TP-LINK TL-MR13U v1 + DEVICE_PROFILE := TLMR13U + TPLINK_HWID := 0x00130101 +endef +TARGET_DEVICES += tl-mr13u-v1 + +define Device/tl-mr3020-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-MR3020 v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-MR3020 + DEVICE_PROFILE := TLMR3020 + TPLINK_HWID := 0x30200001 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-mr3020-v1 + +define Device/tl-mr3040-v1 + $(Device/tl-mr3020-v1) + DEVICE_TITLE := TP-LINK TL-MR3040 v1 + BOARDNAME := TL-MR3040 + DEVICE_PROFILE := TLMR3040 + TPLINK_HWID := 0x30400001 +endef +TARGET_DEVICES += tl-mr3040-v1 + +define Device/tl-mr3040-v2 + $(Device/tl-mr3040-v1) + DEVICE_TITLE := TP-LINK TL-MR3040 v2 + BOARDNAME := TL-MR3040-v2 + TPLINK_HWID := 0x30400002 +endef +TARGET_DEVICES += tl-mr3040-v2 + +define Device/tl-mr3220-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-MR3220 v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-MR3220 + DEVICE_PROFILE := TLMR3220 + TPLINK_HWID := 0x32200001 +endef +TARGET_DEVICES += tl-mr3220-v1 + +define Device/tl-mr3220-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-MR3220 v2 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-MR3220-v2 + DEVICE_PROFILE := TLMR3220 + TPLINK_HWID := 0x32200002 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-mr3220-v2 + +define Device/tl-mr3420-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-MR3420 v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-MR3420 + DEVICE_PROFILE := TLMR3420 + TPLINK_HWID := 0x34200001 +endef +TARGET_DEVICES += tl-mr3420-v1 + +define Device/tl-mr3420-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-MR3420 v2 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-MR3420-v2 + DEVICE_PROFILE := TLMR3420 + TPLINK_HWID := 0x34200002 +endef +TARGET_DEVICES += tl-mr3420-v2 + +define Device/tl-wa701nd-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WA701N/ND v1 + BOARDNAME := TL-WA901ND + DEVICE_PROFILE := TLWA701 + TPLINK_HWID := 0x07010001 +endef +TARGET_DEVICES += tl-wa701nd-v1 + +define Device/tl-wa701nd-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WA701N/ND v2 + BOARDNAME := TL-WA701ND-v2 + DEVICE_PROFILE := TLWA701 + TPLINK_HWID := 0x07010002 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-wa701nd-v2 + +define Device/tl-wa7210n-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WA7210N v2 + DEVICE_PACKAGES := rssileds kmod-ledtrig-netdev + BOARDNAME := TL-WA7210N-v2 + DEVICE_PROFILE := TLWA7210 + TPLINK_HWID := 0x72100002 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-wa7210n-v2 + +define Device/tl-wa730re-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WA730RE v1 + BOARDNAME := TL-WA901ND + DEVICE_PROFILE := TLWA730RE + TPLINK_HWID := 0x07300001 +endef +TARGET_DEVICES += tl-wa730re-v1 + +define Device/tl-wa750re-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WA750RE v1 + DEVICE_PACKAGES := rssileds + BOARDNAME := TL-WA750RE + DEVICE_PROFILE := TLWA750 + TPLINK_HWID := 0x07500001 +endef +TARGET_DEVICES += tl-wa750re-v1 + +define Device/tl-wa7510n-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WA7510N v1 + BOARDNAME := TL-WA7510N + DEVICE_PROFILE := TLWA7510 + TPLINK_HWID := 0x75100001 +endef +TARGET_DEVICES += tl-wa7510n-v1 + +define Device/tl-wa801nd-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WA801N/ND v1 + BOARDNAME := TL-WA901ND + DEVICE_PROFILE := TLWA801 + TPLINK_HWID := 0x08010001 +endef +TARGET_DEVICES += tl-wa801nd-v1 + +define Device/tl-wa801nd-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WA801N/ND v2 + BOARDNAME := TL-WA801ND-v2 + DEVICE_PROFILE := TLWA801 + TPLINK_HWID := 0x08010002 +endef +TARGET_DEVICES += tl-wa801nd-v2 + +define Device/tl-wa801nd-v3 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WA801N/ND v3 + BOARDNAME := TL-WA801ND-v3 + DEVICE_PROFILE := TLWA801 + TPLINK_HWID := 0x08010003 +endef +TARGET_DEVICES += tl-wa801nd-v3 + +define Device/tl-wa830re-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WA830RE v1 + BOARDNAME := TL-WA901ND + DEVICE_PROFILE := TLWA830 + TPLINK_HWID := 0x08300010 +endef +TARGET_DEVICES += tl-wa830re-v1 + +define Device/tl-wa830re-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WA830RE v2 + BOARDNAME := TL-WA830RE-v2 + DEVICE_PROFILE := TLWA830 + TPLINK_HWID := 0x08300002 +endef +TARGET_DEVICES += tl-wa830re-v2 + +define Device/tl-wa850re-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WA850RE v1 + DEVICE_PACKAGES := rssileds + BOARDNAME := TL-WA850RE + DEVICE_PROFILE := TLWA850 + TPLINK_HWID := 0x08500001 +endef +TARGET_DEVICES += tl-wa850re-v1 + +define Device/tl-wa85xre + $(Device/tplink) + TPLINK_HWREV := 0 + KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header + IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory + MTDPARTS := spi0.0:128k(u-boot)ro,1344k(kernel),2304k(rootfs),256k(config)ro,64k(art)ro,3648k@0x20000(firmware) +endef + +define Device/tl-wa850re-v2 + $(Device/tl-wa85xre) + DEVICE_TITLE := TP-LINK TL-WA850RE v2 + DEVICE_PACKAGES := rssileds + BOARDNAME := TL-WA850RE-V2 + DEVICE_PROFILE := TLWA850 + TPLINK_BOARD_ID := TLWA850REV2 + TPLINK_HWID := 0x08500002 +endef +TARGET_DEVICES += tl-wa850re-v2 + +define Device/tl-wa855re-v1 + $(Device/tl-wa85xre) + DEVICE_TITLE := TP-LINK TL-WA855RE v1 + BOARDNAME := TL-WA855RE-v1 + DEVICE_PROFILE := TLWA855RE + TPLINK_HWID := 0x08550001 + TPLINK_BOARD_ID := TLWA855REV1 +endef +TARGET_DEVICES += tl-wa855re-v1 + + +define Device/tl-wa860re-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WA860RE v1 + BOARDNAME := TL-WA860RE + DEVICE_PROFILE := TLWA860 + TPLINK_HWID := 0x08600001 +endef +TARGET_DEVICES += tl-wa860re-v1 + +define Device/tl-wa901nd-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WA901N/ND v1 + BOARDNAME := TL-WA901ND + DEVICE_PROFILE := TLWA901 + TPLINK_HWID := 0x09010001 +endef +TARGET_DEVICES += tl-wa901nd-v1 + +define Device/tl-wa901nd-v2 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WA901N/ND v2 + BOARDNAME := TL-WA901ND-v2 + DEVICE_PROFILE := TLWA901 + TPLINK_HWID := 0x09010002 +endef +TARGET_DEVICES += tl-wa901nd-v2 + +define Device/tl-wa901nd-v3 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WA901N/ND v3 + BOARDNAME := TL-WA901ND-v3 + DEVICE_PROFILE := TLWA901 + TPLINK_HWID := 0x09010003 +endef +TARGET_DEVICES += tl-wa901nd-v3 + +define Device/tl-wa901nd-v4 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WA901N/ND v4 + BOARDNAME := TL-WA901ND-v4 + DEVICE_PROFILE := TLWA901 + TPLINK_HWID := 0x09010004 + IMAGE/factory.bin := append-rootfs | mktplinkfw factory -C EU +endef +TARGET_DEVICES += tl-wa901nd-v4 + +define Device/tl-wa901nd-v5 + $(Device/tl-wa901nd-v4) + DEVICE_TITLE := TP-LINK TL-WA901N/ND v5 + BOARDNAME := TL-WA901ND-v5 + TPLINK_HWID := 0x09010005 +endef +TARGET_DEVICES += tl-wa901nd-v5 + +define Device/tl-wdr3320-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WDR3320 v2 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WDR3320-v2 + DEVICE_PROFILE := TLWDR3320V2 + TPLINK_HWID := 0x33200002 + TPLINK_HEADER_VERSION := 2 +endef +TARGET_DEVICES += tl-wdr3320-v2 + +define Device/tl-wr1041n-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR1041N v2 + BOARDNAME := TL-WR1041N-v2 + DEVICE_PROFILE := TLWR1041 + TPLINK_HWID := 0x10410002 +endef +TARGET_DEVICES += tl-wr1041n-v2 + +define Device/tl-wr703n-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR703N v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 + BOARDNAME := TL-WR703N + DEVICE_PROFILE := TLWR703 + TPLINK_HWID := 0x07030101 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-wr703n-v1 + +define Device/tl-wr710n-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR710N v2 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 + BOARDNAME := TL-WR710N + DEVICE_PROFILE := TLWR710 + TPLINK_HWID := 0x07100002 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-wr710n-v2 + +define Device/tl-wr720n-v3 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR720N v3 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 + BOARDNAME := TL-WR720N-v3 + DEVICE_PROFILE := TLWR720 + TPLINK_HWID := 0x07200103 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-wr720n-v3 + +define Device/tl-wr720n-v4 + $(Device/tl-wr720n-v3) + DEVICE_TITLE := TP-LINK TL-WR720N v4 + TPLINK_HWID := 0x07200104 +endef +TARGET_DEVICES += tl-wr720n-v4 + +define Device/tl-wr740n-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WR740N/ND v1 + BOARDNAME := TL-WR741ND + DEVICE_PROFILE := TLWR740 + TPLINK_HWID := 0x07400001 +endef +TARGET_DEVICES += tl-wr740n-v1 + +define Device/tl-wr740n-v3 + $(Device/tl-wr740n-v1) + DEVICE_TITLE := TP-LINK TL-WR740N/ND v3 + TPLINK_HWID := 0x07400003 +endef +TARGET_DEVICES += tl-wr740n-v3 + +define Device/tl-wr740n-v4 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR740N/ND v4 + BOARDNAME := TL-WR741ND-v4 + DEVICE_PROFILE := TLWR740 + TPLINK_HWID := 0x07400004 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-wr740n-v4 + +define Device/tl-wr740n-v5 + $(Device/tl-wr740n-v4) + DEVICE_TITLE := TP-LINK TL-WR740N/ND v5 + TPLINK_HWID := 0x07400005 +endef +TARGET_DEVICES += tl-wr740n-v5 + +define Device/tl-wr740n-v6 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR740N/ND v6 + BOARDNAME := TL-WR740N-v6 + DEVICE_PROFILE := TLWR740 + TPLINK_HWID := 0x07400006 +endef +TARGET_DEVICES += tl-wr740n-v6 + +define Device/tl-wr741nd-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WR741N/ND v1 + BOARDNAME := TL-WR741ND + DEVICE_PROFILE := TLWR741 + TPLINK_HWID := 0x07410001 +endef +TARGET_DEVICES += tl-wr741nd-v1 + +define Device/tl-wr741nd-v2 + $(Device/tl-wr741nd-v1) + DEVICE_TITLE := TP-LINK TL-WR741N/ND v2 +endef +TARGET_DEVICES += tl-wr741nd-v2 + +define Device/tl-wr741nd-v4 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR741N/ND v4 + BOARDNAME := TL-WR741ND-v4 + DEVICE_PROFILE := TLWR741 + TPLINK_HWID := 0x07410004 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-wr741nd-v4 + +define Device/tl-wr741nd-v5 + $(Device/tl-wr741nd-v4) + DEVICE_TITLE := TP-LINK TL-WR741N/ND v5 + TPLINK_HWID := 0x07400005 +endef +TARGET_DEVICES += tl-wr741nd-v5 + +define Device/tl-wr743nd-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WR743N/ND v1 + BOARDNAME := TL-WR741ND + DEVICE_PROFILE := TLWR743 + TPLINK_HWID := 0x07430001 +endef +TARGET_DEVICES += tl-wr743nd-v1 + +define Device/tl-wr743nd-v2 + $(Device/tl-wr741nd-v4) + DEVICE_TITLE := TP-LINK TL-WR743N/ND v2 + DEVICE_PROFILE := TLWR743 + TPLINK_HWID := 0x07430002 +endef +TARGET_DEVICES += tl-wr743nd-v2 + +define Device/tl-wr802n-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR802N v1 + BOARDNAME := TL-WR802N-v1 + DEVICE_PROFILE := TLWR802 + TPLINK_HWID := 0x08020001 + TPLINK_HWREV := 1 +endef +TARGET_DEVICES += tl-wr802n-v1 + +define Device/tl-wr802n-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR802N v2 + BOARDNAME := TL-WR802N-v2 + DEVICE_PROFILE := TLWR802 + TPLINK_HWID := 0x08020002 + TPLINK_HWREV := 2 + IMAGES += factory-us.bin factory-eu.bin + IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US + IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU +endef +TARGET_DEVICES += tl-wr802n-v2 + +define Device/tl-wr840n-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR840N v2 + BOARDNAME := TL-WR840N-v2 + DEVICE_PROFILE := TLWR840 + TPLINK_HWID := 0x08400002 + IMAGES += factory-eu.bin + IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU +endef +TARGET_DEVICES += tl-wr840n-v2 + +define Device/tl-wr840n-v3 + $(Device/tl-wr840n-v2) + DEVICE_TITLE := TP-LINK TL-WR840N v3 + BOARDNAME := TL-WR840N-v3 + TPLINK_HWID := 0x08400003 +endef +TARGET_DEVICES += tl-wr840n-v3 + +define Device/tl-wr841-v1.5 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WR841N/ND v1.5 + BOARDNAME := TL-WR841N-v1.5 + DEVICE_PROFILE := TLWR841 + TPLINK_HWID := 0x08410002 + TPLINK_HWREV := 2 +endef +TARGET_DEVICES += tl-wr841-v1.5 + +define Device/tl-wr841-v3 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WR841N/ND v3 + BOARDNAME := TL-WR941ND + DEVICE_PROFILE := TLWR841 + TPLINK_HWID := 0x08410003 + TPLINK_HWREV := 3 +endef +TARGET_DEVICES += tl-wr841-v3 + +define Device/tl-wr841-v5 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WR841N/ND v5 + BOARDNAME := TL-WR741ND + DEVICE_PROFILE := TLWR841 + TPLINK_HWID := 0x08410005 +endef +TARGET_DEVICES += tl-wr841-v5 + +define Device/tl-wr841-v7 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WR841N/ND v7 + BOARDNAME := TL-WR841N-v7 + DEVICE_PROFILE := TLWR841 + TPLINK_HWID := 0x08410007 +endef +TARGET_DEVICES += tl-wr841-v7 + +define Device/tl-wr841-v8 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR841N/ND v8 + BOARDNAME := TL-WR841N-v8 + DEVICE_PROFILE := TLWR841 + TPLINK_HWID := 0x08410008 +endef +TARGET_DEVICES += tl-wr841-v8 + +define Device/tl-wr841-v9 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR841N/ND v9 + BOARDNAME := TL-WR841N-v9 + DEVICE_PROFILE := TLWR841 + TPLINK_HWID := 0x08410009 +endef +TARGET_DEVICES += tl-wr841-v9 + +define Device/tl-wr841-v10 + $(Device/tl-wr841-v9) + DEVICE_TITLE := TP-LINK TL-WR841N/ND v10 + TPLINK_HWID := 0x08410010 +endef +TARGET_DEVICES += tl-wr841-v10 + +define Device/tl-wr841-v11 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR841N/ND v11 + BOARDNAME := TL-WR841N-v11 + DEVICE_PROFILE := TLWR841 + TPLINK_HWID := 0x08410011 + IMAGES += factory-us.bin factory-eu.bin + IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US + IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU +endef +TARGET_DEVICES += tl-wr841-v11 + +define Device/tl-wr841-v12 + $(Device/tl-wr841-v11) + DEVICE_TITLE := TP-LINK TL-WR841N/ND v12 + TPLINK_HWID := 0x08410012 +endef +TARGET_DEVICES += tl-wr841-v12 + +define Device/tl-wr843nd-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR843N/ND v1 + BOARDNAME := TL-WR841N-v8 + DEVICE_PROFILE := TLWR843 + TPLINK_HWID := 0x08430001 +endef +TARGET_DEVICES += tl-wr843nd-v1 + +define Device/tl-wr847n-v8 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR847N/ND v8 + BOARDNAME := TL-WR841N-v8 + DEVICE_PROFILE := TLWR841 + TPLINK_HWID := 0x08470008 +endef +TARGET_DEVICES += tl-wr847n-v8 + +define Device/tl-wr940n-v4 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR940N v4 + BOARDNAME := TL-WR940N-v4 + DEVICE_PROFILE := TLWR941 + TPLINK_HWID := 0x09400004 + IMAGES += factory-us.bin factory-eu.bin factory-br.bin + IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US + IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU + IMAGE/factory-br.bin := append-rootfs | mktplinkfw factory -C BR +endef +TARGET_DEVICES += tl-wr940n-v4 + +define Device/tl-wr941nd-v2 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WR941N/ND v2 + BOARDNAME := TL-WR941ND + DEVICE_PROFILE := TLWR941 + TPLINK_HWID := 0x09410002 + TPLINK_HWREV := 2 +endef +TARGET_DEVICES += tl-wr941nd-v2 + +define Device/tl-wr941nd-v3 + $(Device/tl-wr941nd-v2) + DEVICE_TITLE := TP-LINK TL-WR941N/ND v3 +endef +TARGET_DEVICES += tl-wr941nd-v3 + +define Device/rnx-n360rt + $(Device/tl-wr941nd-v2) + DEVICE_TITLE := Rosewill RNX-N360RT + DEVICE_PROFILE := RNXN360RT + TPLINK_HWREV := 0x00420001 +endef +TARGET_DEVICES += rnx-n360rt + +define Device/tl-wr941nd-v4 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WR941N/ND v4 + BOARDNAME := TL-WR741ND + DEVICE_PROFILE := TLWR941 + TPLINK_HWID := 0x09410004 +endef +TARGET_DEVICES += tl-wr941nd-v4 + +define Device/tl-wr941nd-v5 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR941N/ND v5 + BOARDNAME := TL-WR941ND-v5 + DEVICE_PROFILE := TLWR941 + TPLINK_HWID := 0x09410005 +endef +TARGET_DEVICES += tl-wr941nd-v5 + +define Device/tl-wr941nd-v6 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR941N/ND v6 + BOARDNAME := TL-WR941ND-v6 + DEVICE_PROFILE := TLWR941 + TPLINK_HWID := 0x09410006 +endef +TARGET_DEVICES += tl-wr941nd-v6 + +# Chinese version (unlike European) is similar to the TL-WDR3500 +define Device/tl-wr941nd-v6-cn + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR941N/ND v6 (CN) + BOARDNAME := TL-WDR3500 + DEVICE_PROFILE := TLWR941 + TPLINK_HWID := 0x09410006 +endef +TARGET_DEVICES += tl-wr941nd-v6-cn diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk deleted file mode 100644 index 574438c1d0..0000000000 --- a/target/linux/ar71xx/image/tp-link.mk +++ /dev/null @@ -1,1120 +0,0 @@ -DEVICE_VARS += LOADER_FLASH_OFFS TPLINK_BOARD_ID TPLINK_FLASHLAYOUT TPLINK_HEADER_VERSION TPLINK_HWID TPLINK_HWREV - -define Build/copy-file - cat "$(1)" > "$@" -endef - -define Build/loader-okli - dd if=$(KDIR)/loader-$(1).gz bs=7680 conv=sync of="$@.new" - cat "$@" >> "$@.new" - mv "$@.new" "$@" -endef - -define Build/loader-okli-compile - $(call Build/loader-common,FLASH_OFFS=$(LOADER_FLASH_OFFS) FLASH_MAX=0 KERNEL_CMDLINE="$(CMDLINE)") -endef - -# combine kernel and rootfs into one image -# mktplinkfw -# is "sysupgrade" or "factory" -# -# -a align the rootfs start on an bytes boundary -# -j add jffs2 end-of-filesystem markers -# -s strip padding from end of the image -# -X reserve bytes in the firmware image (hexval prefixed with 0x) -define Build/mktplinkfw - -$(STAGING_DIR_HOST)/bin/mktplinkfw \ - -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) -N OpenWrt -V $(REVISION) \ - -m $(TPLINK_HEADER_VERSION) \ - -k $(IMAGE_KERNEL) \ - -r $@ \ - -o $@.new \ - -j -X 0x40000 \ - -a $(call rootfs_align,$(FILESYSTEM)) \ - $(wordlist 2,$(words $(1)),$(1)) \ - $(if $(findstring sysupgrade,$(word 1,$(1))),-s) && mv $@.new $@ || rm -f $@ -endef - -define Build/uImageArcher - mkimage -A $(LINUX_KARCH) \ - -O linux -T kernel \ - -C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ - -n '$(call toupper,$(LINUX_KARCH)) LEDE Linux-$(LINUX_VERSION)' -d $@ $@.new - @mv $@.new $@ -endef - - -define Device/tplink - TPLINK_HWREV := 0x1 - TPLINK_HEADER_VERSION := 1 - LOADER_TYPE := gz - KERNEL := kernel-bin | patch-cmdline | lzma - KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | tplink-v1-header - IMAGES := sysupgrade.bin factory.bin - IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade - IMAGE/factory.bin := append-rootfs | mktplinkfw factory -endef - -define Device/tplink-nolzma - $(Device/tplink) - LOADER_FLASH_OFFS := 0x22000 - COMPILE := loader-$(1).gz - COMPILE/loader-$(1).gz := loader-okli-compile - KERNEL := copy-file $(KDIR)/vmlinux.bin.lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) - KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux-initramfs.bin.lzma | loader-kernel-cmdline | tplink-v1-header -endef - -define Device/tplink-4m - $(Device/tplink-nolzma) - TPLINK_FLASHLAYOUT := 4M - IMAGE_SIZE := 3904k -endef - -define Device/tplink-8m - $(Device/tplink-nolzma) - TPLINK_FLASHLAYOUT := 8M - IMAGE_SIZE := 7936k -endef - -define Device/tplink-4mlzma - $(Device/tplink) - TPLINK_FLASHLAYOUT := 4Mlzma - IMAGE_SIZE := 3904k -endef - -define Device/tplink-8mlzma - $(Device/tplink) - TPLINK_FLASHLAYOUT := 8Mlzma - IMAGE_SIZE := 7936k -endef - -define Device/tplink-16mlzma - $(Device/tplink) - TPLINK_FLASHLAYOUT := 16Mlzma - IMAGE_SIZE := 15872k -endef - -define Device/archer-cxx - KERNEL := kernel-bin | patch-cmdline | lzma | uImageArcher lzma - IMAGES := sysupgrade.bin factory.bin - IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \ - append-metadata | check-size $$$$(IMAGE_SIZE) - IMAGE/factory.bin := append-rootfs | tplink-safeloader factory -endef - -define Device/archer-c25-v1 - $(Device/archer-cxx) - DEVICE_TITLE := TP-LINK Archer C25 v1 - DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9887 - BOARDNAME := ARCHER-C25-V1 - TPLINK_BOARD_ID := ARCHER-C25-V1 - DEVICE_PROFILE := ARCHERC25V1 - IMAGE_SIZE := 7808k - LOADER_TYPE := elf - MTDPARTS := spi0.0:128k(factory-uboot)ro,64k(u-boot)ro,1536k(kernel),6272k(rootfs),128k(config)ro,64k(art)ro,7808k@0x30000(firmware) - SUPPORTED_DEVICES := archer-c25-v1 -endef - -define Device/archer-c58-v1 - $(Device/archer-cxx) - DEVICE_TITLE := TP-LINK Archer C58 v1 - DEVICE_PACKAGES := kmod-ath10k - BOARDNAME := ARCHER-C58-V1 - TPLINK_BOARD_ID := ARCHER-C58-V1 - DEVICE_PROFILE := ARCHERC58V1 - IMAGE_SIZE := 7936k - MTDPARTS := spi0.0:64k(u-boot)ro,64k(mac)ro,1344k(kernel),6592k(rootfs),64k(tplink)ro,64k(art)ro,7936k@0x20000(firmware) - SUPPORTED_DEVICES := archer-c58-v1 -endef - -define Device/archer-c59-v1 - $(Device/archer-cxx) - DEVICE_TITLE := TP-LINK Archer C59 v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x - BOARDNAME := ARCHER-C59-V1 - TPLINK_BOARD_ID := ARCHER-C59-V1 - DEVICE_PROFILE := ARCHERC59V1 - IMAGE_SIZE := 14528k - MTDPARTS := spi0.0:64k(u-boot)ro,64k(mac)ro,1536k(kernel),12992k(rootfs),1664k(tplink)ro,64k(art)ro,14528k@0x20000(firmware) - SUPPORTED_DEVICES := archer-c59-v1 -endef - -define Device/archer-c60-v1 - $(Device/archer-cxx) - DEVICE_TITLE := TP-LINK Archer C60 v1 - DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x - BOARDNAME := ARCHER-C60-V1 - TPLINK_BOARD_ID := ARCHER-C60-V1 - DEVICE_PROFILE := ARCHERC60V1 - IMAGE_SIZE := 7936k - MTDPARTS := spi0.0:64k(u-boot)ro,64k(mac)ro,1344k(kernel),6592k(rootfs),64k(tplink)ro,64k(art)ro,7936k@0x20000(firmware) - SUPPORTED_DEVICES := archer-c60-v1 -endef -TARGET_DEVICES += archer-c25-v1 archer-c59-v1 - -define Device/archer-c5-v1 - $(Device/tplink-16mlzma) - DEVICE_TITLE := TP-LINK Archer C5 v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x - BOARDNAME := ARCHER-C5 - DEVICE_PROFILE := ARCHERC7 - TPLINK_HWID := 0xc5000001 -endef - -define Device/archer-c7-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK Archer C7 v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x - BOARDNAME := ARCHER-C7 - DEVICE_PROFILE := ARCHERC7 - TPLINK_HWID := 0x75000001 -endef - -define Device/archer-c7-v2 - $(Device/tplink-16mlzma) - DEVICE_TITLE := TP-LINK Archer C7 v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x - BOARDNAME := ARCHER-C7-V2 - DEVICE_PROFILE := ARCHERC7 - TPLINK_HWID := 0xc7000002 - IMAGES := sysupgrade.bin factory.bin factory-us.bin factory-eu.bin - IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US - IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU -endef - -define Device/archer-c7-v2-il - $(Device/tplink-16mlzma) - DEVICE_TITLE := TP-LINK Archer C7 v2 (IL) - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x - BOARDNAME := ARCHER-C7-V2 - DEVICE_PROFILE := ARCHERC7 - TPLINK_HWID := 0xc7000002 - TPLINK_HWREV := 0x494c0001 -endef - -define Device/tl-wdr7500-v3 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK Archer C7 v3 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x - BOARDNAME := ARCHER-C7 - DEVICE_PROFILE := ARCHERC7 - TPLINK_HWID := 0x75000003 -endef - -define Device/archer-c7-v4 - $(Device/archer-cxx) - DEVICE_TITLE := TP-LINK Archer C7 v4 - DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x - BOARDNAME := ARCHER-C7-V4 - TPLINK_BOARD_ID := ARCHER-C7-V4 - IMAGE_SIZE := 15104k - LOADER_TYPE := elf - MTDPARTS := spi0.0:128k(factory-uboot)ro,128k(u-boot)ro,1536k(kernel),13568k(rootfs),960k(config)ro,64k(art)ro,15104k@0x40000(firmware) - SUPPORTED_DEVICES := archer-c7-v4 -endef - -TARGET_DEVICES += archer-c5-v1 archer-c7-v1 archer-c7-v2 archer-c7-v2-il tl-wdr7500-v3 archer-c7-v4 - -define Device/cpe510-520-v1 - DEVICE_TITLE := TP-LINK CPE510/520 v1 - DEVICE_PACKAGES := rssileds - MTDPARTS := spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k@0x40000(firmware) - IMAGE_SIZE := 7680k - BOARDNAME := CPE510 - TPLINK_BOARD_ID := CPE510 - DEVICE_PROFILE := CPE510 - LOADER_TYPE := elf - KERNEL := kernel-bin | patch-cmdline | lzma | loader-kernel - IMAGES := sysupgrade.bin factory.bin - IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade - IMAGE/factory.bin := append-rootfs | tplink-safeloader factory -endef - -define Device/cpe210-220-v1 - $(Device/cpe510-520-v1) - DEVICE_TITLE := TP-LINK CPE210/220 v1 - BOARDNAME := CPE210 - TPLINK_BOARD_ID := CPE210 -endef - -define Device/wbs210-v1 - $(Device/cpe510-520-v1) - DEVICE_TITLE := TP-LINK WBS210 v1 - BOARDNAME := WBS210 - TPLINK_BOARD_ID := WBS210 -endef - -define Device/wbs510-v1 - $(Device/cpe510-520-v1) - DEVICE_TITLE := TP-LINK WBS510 v1 - BOARDNAME := WBS510 - TPLINK_BOARD_ID := WBS510 -endef -TARGET_DEVICES += cpe210-220-v1 cpe510-520-v1 wbs210-v1 wbs510-v1 - -define Device/eap120-v1 - DEVICE_TITLE := TP-LINK EAP120 v1 - MTDPARTS := spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),14336k(rootfs),192k(config)ro,64k(ART)ro,15872k@0x40000(firmware) - IMAGE_SIZE := 15872k - BOARDNAME := EAP120 - TPLINK_BOARD_ID := EAP120 - DEVICE_PROFILE := EAP120 - LOADER_TYPE := elf - KERNEL := kernel-bin | patch-cmdline | lzma | loader-kernel - IMAGES := sysupgrade.bin factory.bin - IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade - IMAGE/factory.bin := append-rootfs | tplink-safeloader factory -endef -TARGET_DEVICES += eap120-v1 - -define Device/re450-v1 - DEVICE_TITLE := TP-LINK RE450 v1 - DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x - MTDPARTS := spi0.0:128k(u-boot)ro,1344k(kernel),4672k(rootfs),64k(pation-table)ro,64k(product-info)ro,1856k(config)ro,64k(art)ro,6016k@0x20000(firmware) - IMAGE_SIZE := 7936k - BOARDNAME := RE450 - TPLINK_BOARD_ID := RE450 - DEVICE_PROFILE := RE450 - LOADER_TYPE := elf - TPLINK_HWID := 0x0 - TPLINK_HWREV := 0 - TPLINK_HEADER_VERSION := 1 - KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header - IMAGES := sysupgrade.bin factory.bin - IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade - IMAGE/factory.bin := append-rootfs | tplink-safeloader factory -endef -TARGET_DEVICES += re450-v1 - -define Device/tl-mr10u-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-MR10U v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 - BOARDNAME := TL-MR10U - DEVICE_PROFILE := TLMR10U - TPLINK_HWID := 0x00100101 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-mr11u-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-MR11U v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-MR11U - DEVICE_PROFILE := TLMR11U - TPLINK_HWID := 0x00110101 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-mr11u-v2 - $(Device/tl-mr11u-v1) - DEVICE_TITLE := TP-LINK TL-MR11U v2 - TPLINK_HWID := 0x00110102 -endef - -define Device/tl-mr12u-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-MR12U v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-MR13U - DEVICE_PROFILE := TLMR12U - TPLINK_HWID := 0x00120101 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-mr13u-v1 - $(Device/tl-mr12u-v1) - DEVICE_TITLE := TP-LINK TL-MR13U v1 - DEVICE_PROFILE := TLMR13U - TPLINK_HWID := 0x00130101 -endef -TARGET_DEVICES += tl-mr10u-v1 tl-mr11u-v1 tl-mr11u-v2 tl-mr12u-v1 tl-mr13u-v1 - -define Device/tl-mr3020-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-MR3020 v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-MR3020 - DEVICE_PROFILE := TLMR3020 - TPLINK_HWID := 0x30200001 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-mr3040-v1 - $(Device/tl-mr3020-v1) - DEVICE_TITLE := TP-LINK TL-MR3040 v1 - BOARDNAME := TL-MR3040 - DEVICE_PROFILE := TLMR3040 - TPLINK_HWID := 0x30400001 -endef - -define Device/tl-mr3040-v2 - $(Device/tl-mr3040-v1) - DEVICE_TITLE := TP-LINK TL-MR3040 v2 - BOARDNAME := TL-MR3040-v2 - TPLINK_HWID := 0x30400002 -endef - -define Device/tl-mr3220-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-MR3220 v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-MR3220 - DEVICE_PROFILE := TLMR3220 - TPLINK_HWID := 0x32200001 -endef - -define Device/tl-mr3220-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-MR3220 v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-MR3220-v2 - DEVICE_PROFILE := TLMR3220 - TPLINK_HWID := 0x32200002 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-mr3420-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-MR3420 v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-MR3420 - DEVICE_PROFILE := TLMR3420 - TPLINK_HWID := 0x34200001 -endef - -define Device/tl-mr3420-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-MR3420 v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-MR3420-v2 - DEVICE_PROFILE := TLMR3420 - TPLINK_HWID := 0x34200002 -endef -TARGET_DEVICES += tl-mr3020-v1 tl-mr3040-v1 tl-mr3040-v2 tl-mr3220-v1 tl-mr3220-v2 tl-mr3420-v1 tl-mr3420-v2 - -define Device/tl-mr6400-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-MR6400 v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-net kmod-usb-net-rndis kmod-usb-serial kmod-usb-serial-option adb-enablemodem - BOARDNAME := TL-MR6400 - DEVICE_PROFILE := TLMR6400 - TPLINK_HWID := 0x64000001 -endef -TARGET_DEVICES += tl-mr6400-v1 - -define Device/tl-wa701nd-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WA701N/ND v1 - BOARDNAME := TL-WA901ND - DEVICE_PROFILE := TLWA701 - TPLINK_HWID := 0x07010001 -endef - -define Device/tl-wa701nd-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WA701N/ND v2 - BOARDNAME := TL-WA701ND-v2 - DEVICE_PROFILE := TLWA701 - TPLINK_HWID := 0x07010002 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-wa7210n-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WA7210N v2 - DEVICE_PACKAGES := rssileds kmod-ledtrig-netdev - BOARDNAME := TL-WA7210N-v2 - DEVICE_PROFILE := TLWA7210 - TPLINK_HWID := 0x72100002 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-wa730re-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WA730RE v1 - BOARDNAME := TL-WA901ND - DEVICE_PROFILE := TLWA730RE - TPLINK_HWID := 0x07300001 -endef - -define Device/tl-wa750re-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WA750RE v1 - DEVICE_PACKAGES := rssileds - BOARDNAME := TL-WA750RE - DEVICE_PROFILE := TLWA750 - TPLINK_HWID := 0x07500001 -endef - -define Device/tl-wa7510n-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WA7510N v1 - BOARDNAME := TL-WA7510N - DEVICE_PROFILE := TLWA7510 - TPLINK_HWID := 0x75100001 -endef -TARGET_DEVICES += tl-wa701nd-v1 tl-wa701nd-v2 tl-wa7210n-v2 tl-wa730re-v1 tl-wa750re-v1 tl-wa7510n-v1 - -define Device/tl-wa801nd-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WA801N/ND v1 - BOARDNAME := TL-WA901ND - DEVICE_PROFILE := TLWA801 - TPLINK_HWID := 0x08010001 -endef - -define Device/tl-wa801nd-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WA801N/ND v2 - BOARDNAME := TL-WA801ND-v2 - DEVICE_PROFILE := TLWA801 - TPLINK_HWID := 0x08010002 -endef - -define Device/tl-wa801nd-v3 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WA801N/ND v3 - BOARDNAME := TL-WA801ND-v3 - DEVICE_PROFILE := TLWA801 - TPLINK_HWID := 0x08010003 -endef - -define Device/tl-wa830re-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WA830RE v1 - BOARDNAME := TL-WA901ND - DEVICE_PROFILE := TLWA830 - TPLINK_HWID := 0x08300010 -endef - -define Device/tl-wa830re-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WA830RE v2 - BOARDNAME := TL-WA830RE-v2 - DEVICE_PROFILE := TLWA830 - TPLINK_HWID := 0x08300002 -endef - -define Device/tl-wa850re-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WA850RE v1 - DEVICE_PACKAGES := rssileds - BOARDNAME := TL-WA850RE - DEVICE_PROFILE := TLWA850 - TPLINK_HWID := 0x08500001 -endef - -define Device/tl-wa85xre - $(Device/tplink) - TPLINK_HWREV := 0 - KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header - IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade - IMAGE/factory.bin := append-rootfs | tplink-safeloader factory - MTDPARTS := spi0.0:128k(u-boot)ro,1344k(kernel),2304k(rootfs),256k(config)ro,64k(art)ro,3648k@0x20000(firmware) -endef - -define Device/tl-wa850re-v2 - $(Device/tl-wa85xre) - DEVICE_TITLE := TP-LINK TL-WA850RE v2 - DEVICE_PACKAGES := rssileds - BOARDNAME := TL-WA850RE-V2 - DEVICE_PROFILE := TLWA850 - TPLINK_BOARD_ID := TLWA850REV2 - TPLINK_HWID := 0x08500002 -endef - -define Device/tl-wa855re-v1 - $(Device/tl-wa85xre) - DEVICE_TITLE := TP-LINK TL-WA855RE v1 - BOARDNAME := TL-WA855RE-v1 - DEVICE_PROFILE := TLWA855RE - TPLINK_HWID := 0x08550001 - TPLINK_BOARD_ID := TLWA855REV1 -endef - -define Device/tl-wa860re-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WA860RE v1 - BOARDNAME := TL-WA860RE - DEVICE_PROFILE := TLWA860 - TPLINK_HWID := 0x08600001 -endef -TARGET_DEVICES += tl-wa801nd-v1 tl-wa801nd-v2 tl-wa801nd-v3 tl-wa830re-v1 tl-wa830re-v2 tl-wa850re-v1 tl-wa850re-v2 tl-wa855re-v1 tl-wa860re-v1 - -define Device/tl-wa901nd-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WA901N/ND v1 - BOARDNAME := TL-WA901ND - DEVICE_PROFILE := TLWA901 - TPLINK_HWID := 0x09010001 -endef - -define Device/tl-wa901nd-v2 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WA901N/ND v2 - BOARDNAME := TL-WA901ND-v2 - DEVICE_PROFILE := TLWA901 - TPLINK_HWID := 0x09010002 -endef - -define Device/tl-wa901nd-v3 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WA901N/ND v3 - BOARDNAME := TL-WA901ND-v3 - DEVICE_PROFILE := TLWA901 - TPLINK_HWID := 0x09010003 -endef - -define Device/tl-wa901nd-v4 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WA901N/ND v4 - BOARDNAME := TL-WA901ND-v4 - DEVICE_PROFILE := TLWA901 - TPLINK_HWID := 0x09010004 - IMAGE/factory.bin := append-rootfs | mktplinkfw factory -C EU -endef -TARGET_DEVICES += tl-wa901nd-v1 tl-wa901nd-v2 tl-wa901nd-v3 tl-wa901nd-v4 - -define Device/tl-wdr3320-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WDR3320 v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WDR3320-v2 - DEVICE_PROFILE := TLWDR3320V2 - TPLINK_HWID := 0x33200002 - TPLINK_HEADER_VERSION := 2 -endef - -define Device/tl-wdr3500-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WDR3500 v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WDR3500 - DEVICE_PROFILE := TLWDR4300 - TPLINK_HWID := 0x35000001 -endef - -define Device/tl-wdr3600-v1 - $(Device/tl-wdr3500-v1) - DEVICE_TITLE := TP-LINK TL-WDR3600 v1 - BOARDNAME := TL-WDR4300 - TPLINK_HWID := 0x36000001 - IMAGE/factory.bin := append-rootfs | mktplinkfw factory -C US -endef - -define Device/tl-wdr4300-v1 - $(Device/tl-wdr3600-v1) - DEVICE_TITLE := TP-LINK TL-WDR4300 v1 - TPLINK_HWID := 0x43000001 -endef - -define Device/tl-wdr4300-v1-il - $(Device/tl-wdr3500-v1) - DEVICE_TITLE := TP-LINK TL-WDR4300 v1 (IL) - BOARDNAME := TL-WDR4300 - TPLINK_HWID := 0x43008001 -endef - -define Device/tl-wdr4310-v1 - $(Device/tl-wdr4300-v1-il) - DEVICE_TITLE := TP-LINK TL-WDR4310 v1 - TPLINK_HWID := 0x43100001 -endef - -define Device/tl-wdr4900-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WDR4900 v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WDR4900-v2 - DEVICE_PROFILE := TLWDR4900V2 - TPLINK_HWID := 0x49000002 -endef - -define Device/tl-wdr6500-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WDR6500 v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x - KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma - KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | uImage lzma | tplink-v1-header - BOARDNAME := TL-WDR6500-v2 - DEVICE_PROFILE := TLWDR6500V2 - TPLINK_HWID := 0x65000002 - TPLINK_HEADER_VERSION := 2 -endef - -define Device/mw4530r-v1 - $(Device/tl-wdr4300-v1) - DEVICE_TITLE := Mercury MW4530R v1 - TPLINK_HWID := 0x45300001 -endef -TARGET_DEVICES += tl-wdr3320-v2 tl-wdr3500-v1 tl-wdr3600-v1 tl-wdr4300-v1 tl-wdr4300-v1-il tl-wdr4310-v1 tl-wdr4900-v2 tl-wdr6500-v2 mw4530r-v1 - -define Device/tl-wpa8630-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WPA8630 v1 - DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x - BOARDNAME := TL-WPA8630 - DEVICE_PROFILE := TL-WPA8630 - TPLINK_HWID := 0x86300001 -endef -TARGET_DEVICES += tl-wpa8630-v1 - -define Device/tl-wr1041n-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR1041N v2 - BOARDNAME := TL-WR1041N-v2 - DEVICE_PROFILE := TLWR1041 - TPLINK_HWID := 0x10410002 -endef -TARGET_DEVICES += tl-wr1041n-v2 - -define Device/tl-wr1043nd-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR1043N/ND v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WR1043ND - DEVICE_PROFILE := TLWR1043 - TPLINK_HWID := 0x10430001 -endef - -define Device/tl-wr1043nd-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR1043N/ND v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WR1043ND-v2 - DEVICE_PROFILE := TLWR1043 - TPLINK_HWID := 0x10430002 -endef - -define Device/tl-wr1043nd-v3 - $(Device/tl-wr1043nd-v2) - DEVICE_TITLE := TP-LINK TL-WR1043N/ND v3 - TPLINK_HWID := 0x10430003 -endef - -define Device/tl-wr1043nd-v4 - $(Device/tplink) - DEVICE_TITLE := TP-LINK TL-WR1043N/ND v4 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WR1043ND-v4 - DEVICE_PROFILE := TLWR1043 - TPLINK_HWID := 0x10430004 - MTDPARTS := spi0.0:128k(u-boot)ro,1536k(kernel),14016k(rootfs),128k(product-info)ro,320k(config)ro,64k(partition-table)ro,128k(logs)ro,64k(ART)ro,15552k@0x20000(firmware) - IMAGE_SIZE := 15552k - TPLINK_BOARD_ID := TLWR1043NDV4 - KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header - IMAGES := sysupgrade.bin factory.bin - IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade - IMAGE/factory.bin := append-rootfs | tplink-safeloader factory -endef - -define Device/tl-wr2543-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR2543N/ND v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WR2543N - DEVICE_PROFILE := TLWR2543 - TPLINK_HWID := 0x25430001 - IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade -v 3.13.99 - IMAGE/factory.bin := append-rootfs | mktplinkfw factory -v 3.13.99 -endef -TARGET_DEVICES += tl-wr1043nd-v1 tl-wr1043nd-v2 tl-wr1043nd-v3 tl-wr1043nd-v4 tl-wr2543-v1 - -define Device/tl-wr703n-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR703N v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 - BOARDNAME := TL-WR703N - DEVICE_PROFILE := TLWR703 - TPLINK_HWID := 0x07030101 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-wr710n-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR710N v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 - BOARDNAME := TL-WR710N - DEVICE_PROFILE := TLWR710 - TPLINK_HWID := 0x07100001 - CONSOLE := ttyATH0,115200 - IMAGE/factory.bin := append-rootfs | mktplinkfw factory -C US -endef - -define Device/tl-wr710n-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR710N v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 - BOARDNAME := TL-WR710N - DEVICE_PROFILE := TLWR710 - TPLINK_HWID := 0x07100002 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-wr710n-v2.1 - $(Device/tl-wr710n-v1) - DEVICE_TITLE := TP-LINK TL-WR710N v2.1 - TPLINK_HWID := 0x07100002 - TPLINK_HWREV := 0x00000002 -endef - -define Device/tl-wr720n-v3 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR720N v3 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 - BOARDNAME := TL-WR720N-v3 - DEVICE_PROFILE := TLWR720 - TPLINK_HWID := 0x07200103 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-wr720n-v4 - $(Device/tl-wr720n-v3) - DEVICE_TITLE := TP-LINK TL-WR720N v4 - TPLINK_HWID := 0x07200104 -endef -TARGET_DEVICES += tl-wr703n-v1 tl-wr710n-v1 tl-wr710n-v2 tl-wr710n-v2.1 tl-wr720n-v3 tl-wr720n-v4 - -define Device/tl-wr740n-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR740N/ND v1 - BOARDNAME := TL-WR741ND - DEVICE_PROFILE := TLWR740 - TPLINK_HWID := 0x07400001 -endef - -define Device/tl-wr740n-v3 - $(Device/tl-wr740n-v1) - DEVICE_TITLE := TP-LINK TL-WR740N/ND v3 - TPLINK_HWID := 0x07400003 -endef - -define Device/tl-wr740n-v4 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR740N/ND v4 - BOARDNAME := TL-WR741ND-v4 - DEVICE_PROFILE := TLWR740 - TPLINK_HWID := 0x07400004 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-wr740n-v5 - $(Device/tl-wr740n-v4) - DEVICE_TITLE := TP-LINK TL-WR740N/ND v5 - TPLINK_HWID := 0x07400005 -endef - -define Device/tl-wr740n-v6 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR740N/ND v6 - BOARDNAME := TL-WR740N-v6 - DEVICE_PROFILE := TLWR740 - TPLINK_HWID := 0x07400006 -endef -TARGET_DEVICES += tl-wr740n-v1 tl-wr740n-v3 tl-wr740n-v4 tl-wr740n-v5 tl-wr740n-v6 - -define Device/tl-wr741nd-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR741N/ND v1 - BOARDNAME := TL-WR741ND - DEVICE_PROFILE := TLWR741 - TPLINK_HWID := 0x07410001 -endef - -define Device/tl-wr741nd-v2 - $(Device/tl-wr741nd-v1) - DEVICE_TITLE := TP-LINK TL-WR741N/ND v2 -endef - -define Device/tl-wr741nd-v4 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR741N/ND v4 - BOARDNAME := TL-WR741ND-v4 - DEVICE_PROFILE := TLWR741 - TPLINK_HWID := 0x07410004 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-wr741nd-v5 - $(Device/tl-wr741nd-v4) - DEVICE_TITLE := TP-LINK TL-WR741N/ND v5 - TPLINK_HWID := 0x07400005 -endef - -define Device/tl-wr743nd-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR743N/ND v1 - BOARDNAME := TL-WR741ND - DEVICE_PROFILE := TLWR743 - TPLINK_HWID := 0x07430001 -endef - -define Device/tl-wr743nd-v2 - $(Device/tl-wr741nd-v4) - DEVICE_TITLE := TP-LINK TL-WR743N/ND v2 - DEVICE_PROFILE := TLWR743 - TPLINK_HWID := 0x07430002 -endef -TARGET_DEVICES += tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr741nd-v5 tl-wr743nd-v1 tl-wr743nd-v2 - -define Device/tl-wr802n-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR802N v1 - BOARDNAME := TL-WR802N-v1 - DEVICE_PROFILE := TLWR802 - TPLINK_HWID := 0x08020001 - TPLINK_HWREV := 1 -endef - -define Device/tl-wr802n-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR802N v2 - BOARDNAME := TL-WR802N-v2 - DEVICE_PROFILE := TLWR802 - TPLINK_HWID := 0x08020002 - TPLINK_HWREV := 2 - IMAGES += factory-us.bin factory-eu.bin - IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US - IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU -endef - -define Device/tl-wr810n-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR810N v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 - BOARDNAME := TL-WR810N - DEVICE_PROFILE := TLWR810 - TPLINK_HWID := 0x08100001 -endef - -define Device/tl-wr840n-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR840N v2 - BOARDNAME := TL-WR840N-v2 - DEVICE_PROFILE := TLWR840 - TPLINK_HWID := 0x08400002 - IMAGES += factory-eu.bin - IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU -endef - -define Device/tl-wr840n-v3 - $(Device/tl-wr840n-v2) - DEVICE_TITLE := TP-LINK TL-WR840N v3 - BOARDNAME := TL-WR840N-v3 - TPLINK_HWID := 0x08400003 -endef -TARGET_DEVICES += tl-wr802n-v1 tl-wr802n-v2 tl-wr810n-v1 tl-wr840n-v2 tl-wr840n-v3 - -define Device/tl-wr841-v1.5 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR841N/ND v1.5 - BOARDNAME := TL-WR841N-v1.5 - DEVICE_PROFILE := TLWR841 - TPLINK_HWID := 0x08410002 - TPLINK_HWREV := 2 -endef - -define Device/tl-wr841-v3 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR841N/ND v3 - BOARDNAME := TL-WR941ND - DEVICE_PROFILE := TLWR841 - TPLINK_HWID := 0x08410003 - TPLINK_HWREV := 3 -endef - -define Device/tl-wr841-v5 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR841N/ND v5 - BOARDNAME := TL-WR741ND - DEVICE_PROFILE := TLWR841 - TPLINK_HWID := 0x08410005 -endef - -define Device/tl-wr841-v7 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR841N/ND v7 - BOARDNAME := TL-WR841N-v7 - DEVICE_PROFILE := TLWR841 - TPLINK_HWID := 0x08410007 -endef - -define Device/tl-wr841-v8 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR841N/ND v8 - BOARDNAME := TL-WR841N-v8 - DEVICE_PROFILE := TLWR841 - TPLINK_HWID := 0x08410008 -endef - -define Device/tl-wr841-v9 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR841N/ND v9 - BOARDNAME := TL-WR841N-v9 - DEVICE_PROFILE := TLWR841 - TPLINK_HWID := 0x08410009 -endef - -define Device/tl-wr841-v10 - $(Device/tl-wr841-v9) - DEVICE_TITLE := TP-LINK TL-WR841N/ND v10 - TPLINK_HWID := 0x08410010 -endef - -define Device/tl-wr841-v11 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR841N/ND v11 - BOARDNAME := TL-WR841N-v11 - DEVICE_PROFILE := TLWR841 - TPLINK_HWID := 0x08410011 - IMAGES += factory-us.bin factory-eu.bin - IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US - IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU -endef - -define Device/tl-wr841-v12 - $(Device/tl-wr841-v11) - DEVICE_TITLE := TP-LINK TL-WR841N/ND v12 - TPLINK_HWID := 0x08410012 -endef -TARGET_DEVICES += tl-wr841-v1.5 tl-wr841-v3 tl-wr841-v5 tl-wr841-v7 tl-wr841-v8 tl-wr841-v9 tl-wr841-v10 tl-wr841-v11 tl-wr841-v12 - -define Device/tl-wr842n-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR842N/ND v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-MR3420 - DEVICE_PROFILE := TLWR842 - TPLINK_HWID := 0x08420001 -endef - -define Device/tl-wr842n-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR842N/ND v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WR842N-v2 - DEVICE_PROFILE := TLWR842 - TPLINK_HWID := 0x8420002 -endef - -define Device/tl-wr842n-v3 - $(Device/tplink-16mlzma) - DEVICE_TITLE := TP-LINK TL-WR842N/ND v3 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WR842N-v3 - DEVICE_PROFILE := TLWR842 - TPLINK_HWID := 0x08420003 -endef - -define Device/tl-wr843nd-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR843N/ND v1 - BOARDNAME := TL-WR841N-v8 - DEVICE_PROFILE := TLWR843 - TPLINK_HWID := 0x08430001 -endef - -define Device/tl-wr847n-v8 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR847N/ND v8 - BOARDNAME := TL-WR841N-v8 - DEVICE_PROFILE := TLWR841 - TPLINK_HWID := 0x08470008 -endef -TARGET_DEVICES += tl-wr842n-v1 tl-wr842n-v2 tl-wr842n-v3 tl-wr843nd-v1 tl-wr847n-v8 - -define Device/tl-wr902ac-v1 - DEVICE_TITLE := TP-LINK TL-WR902AC v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport \ - kmod-ath10k ath10k-firmware-qca9887 -swconfig -uboot-envtools - BOARDNAME := TL-WR902AC-V1 - DEVICE_PROFILE := TLWR902 - TPLINK_BOARD_ID := TL-WR902AC-V1 - TPLINK_HWID := 0x0 - TPLINK_HWREV := 0 - TPLINK_HEADER_VERSION := 1 - SUPPORTED_DEVICES := tl-wr902ac-v1 - IMAGE_SIZE := 7360k - KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header - IMAGES += factory.bin - IMAGE/factory.bin := append-rootfs | tplink-safeloader factory - IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \ - append-metadata | check-size $$$$(IMAGE_SIZE) - MTDPARTS := spi0.0:128k(u-boot)ro,7360k(firmware),640k(tplink)ro,64k(art)ro -endef - -define Device/tl-wr940n-v4 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR940N v4 - BOARDNAME := TL-WR940N-v4 - DEVICE_PROFILE := TLWR941 - TPLINK_HWID := 0x09400004 - IMAGES += factory-us.bin factory-eu.bin - IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US - IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU -endef - -define Device/tl-wr941nd-v2 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR941N/ND v2 - BOARDNAME := TL-WR941ND - DEVICE_PROFILE := TLWR941 - TPLINK_HWID := 0x09410002 - TPLINK_HWREV := 2 -endef - -define Device/tl-wr941nd-v3 - $(Device/tl-wr941nd-v2) - DEVICE_TITLE := TP-LINK TL-WR941N/ND v3 -endef - -define Device/tl-wr941nd-v4 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR941N/ND v4 - BOARDNAME := TL-WR741ND - DEVICE_PROFILE := TLWR941 - TPLINK_HWID := 0x09410004 -endef - -define Device/tl-wr941nd-v5 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR941N/ND v5 - BOARDNAME := TL-WR941ND-v5 - DEVICE_PROFILE := TLWR941 - TPLINK_HWID := 0x09410005 -endef - -define Device/tl-wr941nd-v6 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR941N/ND v6 - BOARDNAME := TL-WR941ND-v6 - DEVICE_PROFILE := TLWR941 - TPLINK_HWID := 0x09410006 -endef - -# Chinese version (unlike European) is similar to the TL-WDR3500 -define Device/tl-wr941nd-v6-cn - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR941N/ND v6 (CN) - BOARDNAME := TL-WDR3500 - DEVICE_PROFILE := TLWR941 - TPLINK_HWID := 0x09410006 -endef - -define Device/tl-wr942n-v1 - DEVICE_TITLE := TP-LINK TL-WR942N v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WR942N-V1 - TPLINK_BOARD_ID := TLWR942NV1 - DEVICE_PROFILE := TLWR942 - IMAGE_SIZE := 14464k - KERNEL := kernel-bin | patch-cmdline | lzma | uImageArcher lzma - IMAGES := sysupgrade.bin factory.bin - IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \ - append-metadata | check-size $$$$(IMAGE_SIZE) - IMAGE/factory.bin := append-rootfs | tplink-safeloader factory - MTDPARTS := spi0.0:128k(u-boot)ro,1344k(kernel),13120k(rootfs),64k(product-info)ro,64k(partition-table)ro,256k(oem-config)ro,1344k(oem-vars)ro,64k(ART)ro,14464k@0x20000(firmware) - SUPPORTED_DEVICES := tl-wr942n-v1 -endef -TARGET_DEVICES += tl-wr940n-v4 tl-wr941nd-v2 tl-wr941nd-v3 tl-wr941nd-v4 tl-wr941nd-v5 tl-wr941nd-v6 tl-wr941nd-v6-cn \ No newline at end of file diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default index 42f9882bb2..e324e4c252 100644 --- a/target/linux/ar71xx/mikrotik/config-default +++ b/target/linux/ar71xx/mikrotik/config-default @@ -1,120 +1,12 @@ -# CONFIG_ATH79_DEV_DSA is not set -# CONFIG_ATH79_MACH_A60 is not set -# CONFIG_ATH79_MACH_ALFA_AP120C is not set -# CONFIG_ATH79_MACH_ALFA_AP96 is not set -# CONFIG_ATH79_MACH_ALFA_NX is not set -# CONFIG_ATH79_MACH_ALL0258N is not set -# CONFIG_ATH79_MACH_ALL0315N is not set -# CONFIG_ATH79_MACH_ANTMINER_S1 is not set -# CONFIG_ATH79_MACH_ANTMINER_S3 is not set -# CONFIG_ATH79_MACH_ANTROUTER_R1 is not set -# CONFIG_ATH79_MACH_AP121 is not set -# CONFIG_ATH79_MACH_AP121F is not set -# CONFIG_ATH79_MACH_AP132 is not set -# CONFIG_ATH79_MACH_AP136 is not set -# CONFIG_ATH79_MACH_AP143 is not set -# CONFIG_ATH79_MACH_AP147 is not set -# CONFIG_ATH79_MACH_AP152 is not set -# CONFIG_ATH79_MACH_AP531B0 is not set -# CONFIG_ATH79_MACH_AP90Q is not set -# CONFIG_ATH79_MACH_AP96 is not set -# CONFIG_ATH79_MACH_ARCHER_C25_V1 is not set -# CONFIG_ATH79_MACH_ARCHER_C58_V1 is not set -# CONFIG_ATH79_MACH_ARCHER_C59_V1 is not set -# CONFIG_ATH79_MACH_ARCHER_C60_V1 is not set -# CONFIG_ATH79_MACH_ARCHER_C7 is not set -# CONFIG_ATH79_MACH_ARDUINO_YUN is not set -# CONFIG_ATH79_MACH_AW_NR580 is not set -# CONFIG_ATH79_MACH_BHR_4GRV2 is not set -# CONFIG_ATH79_MACH_BHU_BXU2000N2_A is not set -# CONFIG_ATH79_MACH_BSB is not set -# CONFIG_ATH79_MACH_C55 is not set -# CONFIG_ATH79_MACH_CAP324 is not set -# CONFIG_ATH79_MACH_CAP4200AG is not set -# CONFIG_ATH79_MACH_CARAMBOLA2 is not set -# CONFIG_ATH79_MACH_CF_E316N_V2 is not set -# CONFIG_ATH79_MACH_CF_E320N_V2 is not set -# CONFIG_ATH79_MACH_CF_E355AC is not set -# CONFIG_ATH79_MACH_CF_E380AC_V1 is not set -# CONFIG_ATH79_MACH_CF_E380AC_V2 is not set -# CONFIG_ATH79_MACH_CF_E520N is not set -# CONFIG_ATH79_MACH_CF_E530N is not set -# CONFIG_ATH79_MACH_CPE505N is not set -# CONFIG_ATH79_MACH_CPE510 is not set -# CONFIG_ATH79_MACH_CPE830 is not set -# CONFIG_ATH79_MACH_CPE870 is not set -# CONFIG_ATH79_MACH_CR3000 is not set -# CONFIG_ATH79_MACH_CR5000 is not set -# CONFIG_ATH79_MACH_DAP_2695_A1 is not set -# CONFIG_ATH79_MACH_DB120 is not set -# CONFIG_ATH79_MACH_DGL_5500_A1 is not set -# CONFIG_ATH79_MACH_DHP_1565_A1 is not set -# CONFIG_ATH79_MACH_DIR_505_A1 is not set -# CONFIG_ATH79_MACH_DIR_600_A1 is not set -# CONFIG_ATH79_MACH_DIR_615_C1 is not set -# CONFIG_ATH79_MACH_DIR_615_I1 is not set -# CONFIG_ATH79_MACH_DIR_825_B1 is not set -# CONFIG_ATH79_MACH_DIR_825_C1 is not set -# CONFIG_ATH79_MACH_DIR_869_A1 is not set -# CONFIG_ATH79_MACH_DLAN_HOTSPOT is not set -# CONFIG_ATH79_MACH_DLAN_PRO_1200_AC is not set -# CONFIG_ATH79_MACH_DLAN_PRO_500_WP is not set -# CONFIG_ATH79_MACH_DR344 is not set -# CONFIG_ATH79_MACH_DR531 is not set -# CONFIG_ATH79_MACH_DRAGINO2 is not set -# CONFIG_ATH79_MACH_E2100L is not set -# CONFIG_ATH79_MACH_EAP120 is not set -# CONFIG_ATH79_MACH_EAP300V2 is not set -# CONFIG_ATH79_MACH_EAP7660D is not set -# CONFIG_ATH79_MACH_EL_M150 is not set -# CONFIG_ATH79_MACH_EL_MINI is not set -# CONFIG_ATH79_MACH_ENS202EXT is not set -# CONFIG_ATH79_MACH_EPG5000 is not set -# CONFIG_ATH79_MACH_ESR1750 is not set -# CONFIG_ATH79_MACH_ESR900 is not set -# CONFIG_ATH79_MACH_EW_DORIN is not set -# CONFIG_ATH79_MACH_F9K1115V2 is not set -# CONFIG_ATH79_MACH_FRITZ300E is not set -# CONFIG_ATH79_MACH_GL_AR150 is not set -# CONFIG_ATH79_MACH_GL_AR300 is not set -# CONFIG_ATH79_MACH_GL_AR300M is not set -# CONFIG_ATH79_MACH_GL_DOMINO is not set -# CONFIG_ATH79_MACH_GL_INET is not set -# CONFIG_ATH79_MACH_GL_MIFI is not set -# CONFIG_ATH79_MACH_GL_USB150 is not set -# CONFIG_ATH79_MACH_GS_MINIBOX_V1 is not set -# CONFIG_ATH79_MACH_GS_OOLITE is not set -# CONFIG_ATH79_MACH_HIWIFI_HC6361 is not set -# CONFIG_ATH79_MACH_HORNET_UB is not set -# CONFIG_ATH79_MACH_JA76PF is not set -# CONFIG_ATH79_MACH_JWAP003 is not set -# CONFIG_ATH79_MACH_JWAP230 is not set -# CONFIG_ATH79_MACH_LIMA is not set -# CONFIG_ATH79_MACH_MC_MAC1200R is not set -# CONFIG_ATH79_MACH_MR12 is not set -# CONFIG_ATH79_MACH_MR16 is not set -# CONFIG_ATH79_MACH_MR1750 is not set -# CONFIG_ATH79_MACH_MR600 is not set -# CONFIG_ATH79_MACH_MR900 is not set -# CONFIG_ATH79_MACH_MYNET_N600 is not set -# CONFIG_ATH79_MACH_MYNET_N750 is not set -# CONFIG_ATH79_MACH_MYNET_REXT is not set -# CONFIG_ATH79_MACH_MZK_W04NU is not set -# CONFIG_ATH79_MACH_MZK_W300NH is not set -# CONFIG_ATH79_MACH_NBG460N is not set -# CONFIG_ATH79_MACH_NBG6716 is not set -# CONFIG_ATH79_MACH_OM2P is not set -# CONFIG_ATH79_MACH_OM5P is not set -# CONFIG_ATH79_MACH_OM5P_AC is not set -# CONFIG_ATH79_MACH_OM5P_ACv2 is not set -# CONFIG_ATH79_MACH_OMY_G1 is not set -# CONFIG_ATH79_MACH_OMY_X1 is not set -# CONFIG_ATH79_MACH_ONION_OMEGA is not set -# CONFIG_ATH79_MACH_PB42 is not set -# CONFIG_ATH79_MACH_PB44 is not set -# CONFIG_ATH79_MACH_PQI_AIR_PEN is not set -# CONFIG_ATH79_MACH_QIHOO_C301 is not set -# CONFIG_ATH79_MACH_R602N is not set +CONFIG_ATH79_DEV_AP9X_PCI=y +CONFIG_ATH79_DEV_ETH=y +CONFIG_ATH79_DEV_GPIO_BUTTONS=y +CONFIG_ATH79_DEV_LEDS_GPIO=y +CONFIG_ATH79_DEV_M25P80=y +CONFIG_ATH79_DEV_NFC=y +CONFIG_ATH79_DEV_SPI=y +CONFIG_ATH79_DEV_USB=y +CONFIG_ATH79_DEV_WMAC=y CONFIG_ATH79_MACH_RB2011=y CONFIG_ATH79_MACH_RB4XX=y CONFIG_ATH79_MACH_RB750=y @@ -123,103 +15,20 @@ CONFIG_ATH79_MACH_RB922=y CONFIG_ATH79_MACH_RB95X=y CONFIG_ATH79_MACH_RBSPI=y CONFIG_ATH79_MACH_RBSXTLITE=y -# CONFIG_ATH79_MACH_RE450 is not set -# CONFIG_ATH79_MACH_RW2458N is not set -# CONFIG_ATH79_MACH_SC1750 is not set -# CONFIG_ATH79_MACH_SC300M is not set -# CONFIG_ATH79_MACH_SC450 is not set -# CONFIG_ATH79_MACH_SMART_300 is not set -# CONFIG_ATH79_MACH_SOM9331 is not set -# CONFIG_ATH79_MACH_SR3200 is not set -# CONFIG_ATH79_MACH_TELLSTICK_ZNET_LITE is not set -# CONFIG_ATH79_MACH_TEW_632BRP is not set -# CONFIG_ATH79_MACH_TEW_673GRU is not set -# CONFIG_ATH79_MACH_TEW_712BR is not set -# CONFIG_ATH79_MACH_TEW_732BR is not set -# CONFIG_ATH79_MACH_TEW_823DRU is not set -# CONFIG_ATH79_MACH_TL_MR11U is not set -# CONFIG_ATH79_MACH_TL_MR13U is not set -# CONFIG_ATH79_MACH_TL_MR3020 is not set -# CONFIG_ATH79_MACH_TL_MR3X20 is not set -# CONFIG_ATH79_MACH_TL_MR6400 is not set -# CONFIG_ATH79_MACH_TL_WA701ND_V2 is not set -# CONFIG_ATH79_MACH_TL_WA7210N_V2 is not set -# CONFIG_ATH79_MACH_TL_WA801ND_V3 is not set -# CONFIG_ATH79_MACH_TL_WA830RE_V2 is not set -# CONFIG_ATH79_MACH_TL_WA850RE_V2 is not set -# CONFIG_ATH79_MACH_TL_WA855RE_V1 is not set -# CONFIG_ATH79_MACH_TL_WA901ND is not set -# CONFIG_ATH79_MACH_TL_WA901ND_V2 is not set -# CONFIG_ATH79_MACH_TL_WA901ND_V4 is not set -# CONFIG_ATH79_MACH_TL_WAX50RE is not set -# CONFIG_ATH79_MACH_TL_WDR3320_V2 is not set -# CONFIG_ATH79_MACH_TL_WDR3500 is not set -# CONFIG_ATH79_MACH_TL_WDR4300 is not set -# CONFIG_ATH79_MACH_TL_WDR6500_V2 is not set -# CONFIG_ATH79_MACH_TL_WPA8630 is not set -# CONFIG_ATH79_MACH_TL_WR1041N_V2 is not set -# CONFIG_ATH79_MACH_TL_WR1043ND is not set -# CONFIG_ATH79_MACH_TL_WR1043ND_V2 is not set -# CONFIG_ATH79_MACH_TL_WR1043ND_V4 is not set -# CONFIG_ATH79_MACH_TL_WR2543N is not set -# CONFIG_ATH79_MACH_TL_WR703N is not set -# CONFIG_ATH79_MACH_TL_WR720N_V3 is not set -# CONFIG_ATH79_MACH_TL_WR741ND is not set -# CONFIG_ATH79_MACH_TL_WR741ND_V4 is not set -# CONFIG_ATH79_MACH_TL_WR802N_V1 is not set -# CONFIG_ATH79_MACH_TL_WR802N_V2 is not set -# CONFIG_ATH79_MACH_TL_WR810N is not set -# CONFIG_ATH79_MACH_TL_WR840N_V2 is not set -# CONFIG_ATH79_MACH_TL_WR841N_V1 is not set -# CONFIG_ATH79_MACH_TL_WR841N_V8 is not set -# CONFIG_ATH79_MACH_TL_WR841N_V9 is not set -# CONFIG_ATH79_MACH_TL_WR902AC_V1 is not set -# CONFIG_ATH79_MACH_TL_WR940N_V4 is not set -# CONFIG_ATH79_MACH_TL_WR941ND is not set -# CONFIG_ATH79_MACH_TL_WR941ND_V6 is not set -# CONFIG_ATH79_MACH_TL_WR942N_V1 is not set -# CONFIG_ATH79_MACH_TUBE2H is not set -# CONFIG_ATH79_MACH_UBNT is not set -# CONFIG_ATH79_MACH_UBNT_UNIFIAC is not set -# CONFIG_ATH79_MACH_UBNT_XM is not set -# CONFIG_ATH79_MACH_WEIO is not set -# CONFIG_ATH79_MACH_WHR_HP_G300N is not set -# CONFIG_ATH79_MACH_WLAE_AG300N is not set -# CONFIG_ATH79_MACH_WLR8100 is not set -# CONFIG_ATH79_MACH_WNDAP360 is not set -# CONFIG_ATH79_MACH_WNDR3700 is not set -# CONFIG_ATH79_MACH_WNR2000 is not set -# CONFIG_ATH79_MACH_WNR2000_V3 is not set -# CONFIG_ATH79_MACH_WNR2000_V4 is not set -# CONFIG_ATH79_MACH_WNR2200 is not set -# CONFIG_ATH79_MACH_WP543 is not set -# CONFIG_ATH79_MACH_WPE72 is not set -# CONFIG_ATH79_MACH_WPJ342 is not set -# CONFIG_ATH79_MACH_WPJ344 is not set -# CONFIG_ATH79_MACH_WPJ531 is not set -# CONFIG_ATH79_MACH_WPJ558 is not set -# CONFIG_ATH79_MACH_WPJ563 is not set -# CONFIG_ATH79_MACH_WRT160NL is not set -# CONFIG_ATH79_MACH_WRT400N is not set -# CONFIG_ATH79_MACH_WRTNODE2Q is not set -# CONFIG_ATH79_MACH_WZR_450HP2 is not set -# CONFIG_ATH79_MACH_WZR_HP_AG300H is not set -# CONFIG_ATH79_MACH_WZR_HP_G300NH is not set -# CONFIG_ATH79_MACH_WZR_HP_G300NH2 is not set -# CONFIG_ATH79_MACH_WZR_HP_G450H is not set -# CONFIG_ATH79_MACH_XD3200 is not set -# CONFIG_ATH79_MACH_ZBT_WE1526 is not set -# CONFIG_ATH79_MACH_ZCN_1523H is not set -# CONFIG_ATH79_NVRAM is not set +CONFIG_ATH79_PCI_ATH9K_FIXUP=y CONFIG_ATH79_ROUTERBOOT=y +CONFIG_BLK_MQ_PCI=y CONFIG_CRC16=y CONFIG_CRYPTO_DEFLATE=y CONFIG_GPIO_LATCH=y +CONFIG_HW_HAS_PCI=y # CONFIG_INTEL_XWAY_PHY is not set CONFIG_LEDS_RB750=y CONFIG_LZO_DECOMPRESS=y +# CONFIG_MARVELL_PHY is not set # CONFIG_MTD_CFI is not set CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CMDLINE_PARTS is not set # CONFIG_MTD_CYBERTAN_PARTS is not set CONFIG_MTD_MAP_BANK_WIDTH_1=y CONFIG_MTD_MAP_BANK_WIDTH_4=y @@ -233,7 +42,11 @@ CONFIG_MTD_NAND_RB91X=y # CONFIG_MTD_REDBOOT_PARTS is not set CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y # CONFIG_MTD_SPLIT_EVA_FW is not set +# CONFIG_MTD_SPLIT_LZMA_FW is not set +# CONFIG_MTD_SPLIT_SEAMA_FW is not set # CONFIG_MTD_SPLIT_TPLINK_FW is not set +# CONFIG_MTD_SPLIT_UIMAGE_FW is not set +# CONFIG_MTD_SPLIT_WRGG_FW is not set # CONFIG_MTD_TPLINK_PARTS is not set CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 @@ -241,10 +54,19 @@ CONFIG_MTD_UBI_BLOCK=y # CONFIG_MTD_UBI_FASTMAP is not set # CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 +# CONFIG_NET_DSA is not set +CONFIG_PCI=y +CONFIG_PCI_AR724X=y +CONFIG_PCI_DISABLE_COMMON_QUIRKS=y +CONFIG_PCI_DOMAINS=y CONFIG_RLE_DECOMPRESS=y -# CONFIG_SOC_AR913X is not set -# CONFIG_SOC_AR933X is not set -# CONFIG_SOC_QCA956X is not set +# CONFIG_RTL8306_PHY is not set +# CONFIG_RTL8366_SMI is not set +CONFIG_SOC_AR71XX=y +CONFIG_SOC_AR724X=y +CONFIG_SOC_AR934X=y +CONFIG_SOC_QCA953X=y +CONFIG_SOC_QCA955X=y CONFIG_SPI_RB4XX=y CONFIG_SPI_RB4XX_CPLD=y CONFIG_UBIFS_FS=y diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default index 340d64cab9..39b1ca4995 100644 --- a/target/linux/ar71xx/nand/config-default +++ b/target/linux/ar71xx/nand/config-default @@ -1,218 +1,30 @@ -# CONFIG_ATH79_DEV_DSA is not set -# CONFIG_ATH79_MACH_ALFA_AP120C is not set -# CONFIG_ATH79_MACH_ALFA_AP96 is not set -# CONFIG_ATH79_MACH_ALFA_NX is not set -# CONFIG_ATH79_MACH_ALL0258N is not set -# CONFIG_ATH79_MACH_ALL0315N is not set -# CONFIG_ATH79_MACH_ANTMINER_S1 is not set -# CONFIG_ATH79_MACH_ANTMINER_S3 is not set -# CONFIG_ATH79_MACH_ANTROUTER_R1 is not set -# CONFIG_ATH79_MACH_AP121 is not set -# CONFIG_ATH79_MACH_AP121F is not set -# CONFIG_ATH79_MACH_AP132 is not set -# CONFIG_ATH79_MACH_AP136 is not set -# CONFIG_ATH79_MACH_AP143 is not set -# CONFIG_ATH79_MACH_AP147 is not set -# CONFIG_ATH79_MACH_AP152 is not set -# CONFIG_ATH79_MACH_AP531B0 is not set -# CONFIG_ATH79_MACH_AP90Q is not set -# CONFIG_ATH79_MACH_AP96 is not set -# CONFIG_ATH79_MACH_ARCHER_C25_V1 is not set -# CONFIG_ATH79_MACH_ARCHER_C58_V1 is not set -# CONFIG_ATH79_MACH_ARCHER_C59_V1 is not set -# CONFIG_ATH79_MACH_ARCHER_C60_V1 is not set -# CONFIG_ATH79_MACH_ARCHER_C7 is not set -# CONFIG_ATH79_MACH_ARDUINO_YUN is not set -# CONFIG_ATH79_MACH_AW_NR580 is not set -# CONFIG_ATH79_MACH_BHR_4GRV2 is not set -# CONFIG_ATH79_MACH_BHU_BXU2000N2_A is not set -# CONFIG_ATH79_MACH_BSB is not set -# CONFIG_ATH79_MACH_C55 is not set +CONFIG_ATH79_DEV_AP9X_PCI=y +CONFIG_ATH79_DEV_ETH=y +CONFIG_ATH79_DEV_GPIO_BUTTONS=y +CONFIG_ATH79_DEV_LEDS_GPIO=y +CONFIG_ATH79_DEV_M25P80=y +CONFIG_ATH79_DEV_NFC=y +CONFIG_ATH79_DEV_SPI=y +CONFIG_ATH79_DEV_USB=y +CONFIG_ATH79_DEV_WMAC=y CONFIG_ATH79_MACH_C60=y -# CONFIG_ATH79_MACH_CAP324 is not set -# CONFIG_ATH79_MACH_CAP4200AG is not set -# CONFIG_ATH79_MACH_CARAMBOLA2 is not set -# CONFIG_ATH79_MACH_CF_E316N_V2 is not set -# CONFIG_ATH79_MACH_CF_E320N_V2 is not set -# CONFIG_ATH79_MACH_CF_E355AC is not set -# CONFIG_ATH79_MACH_CF_E380AC_V1 is not set -# CONFIG_ATH79_MACH_CF_E380AC_V2 is not set -# CONFIG_ATH79_MACH_CF_E520N is not set -# CONFIG_ATH79_MACH_CF_E530N is not set -# CONFIG_ATH79_MACH_CPE505N is not set -# CONFIG_ATH79_MACH_CPE510 is not set -# CONFIG_ATH79_MACH_CPE830 is not set -# CONFIG_ATH79_MACH_CPE870 is not set -# CONFIG_ATH79_MACH_CR3000 is not set -# CONFIG_ATH79_MACH_CR5000 is not set -# CONFIG_ATH79_MACH_DAP_2695_A1 is not set -# CONFIG_ATH79_MACH_DB120 is not set -# CONFIG_ATH79_MACH_DGL_5500_A1 is not set -# CONFIG_ATH79_MACH_DHP_1565_A1 is not set -# CONFIG_ATH79_MACH_DIR_505_A1 is not set -# CONFIG_ATH79_MACH_DIR_600_A1 is not set -# CONFIG_ATH79_MACH_DIR_615_C1 is not set -# CONFIG_ATH79_MACH_DIR_615_I1 is not set -# CONFIG_ATH79_MACH_DIR_825_B1 is not set -# CONFIG_ATH79_MACH_DIR_825_C1 is not set -# CONFIG_ATH79_MACH_DIR_869_A1 is not set -# CONFIG_ATH79_MACH_DLAN_HOTSPOT is not set -# CONFIG_ATH79_MACH_DLAN_PRO_1200_AC is not set -# CONFIG_ATH79_MACH_DLAN_PRO_500_WP is not set CONFIG_ATH79_MACH_DOMYWIFI_DW33D=y -# CONFIG_ATH79_MACH_DR344 is not set -# CONFIG_ATH79_MACH_DR531 is not set -# CONFIG_ATH79_MACH_DRAGINO2 is not set -# CONFIG_ATH79_MACH_E2100L is not set -# CONFIG_ATH79_MACH_EAP120 is not set -# CONFIG_ATH79_MACH_EAP300V2 is not set -# CONFIG_ATH79_MACH_EAP7660D is not set -# CONFIG_ATH79_MACH_EL_M150 is not set -# CONFIG_ATH79_MACH_EL_MINI is not set -# CONFIG_ATH79_MACH_ENS202EXT is not set -# CONFIG_ATH79_MACH_EPG5000 is not set -# CONFIG_ATH79_MACH_ESR1750 is not set -# CONFIG_ATH79_MACH_ESR900 is not set -# CONFIG_ATH79_MACH_EW_DORIN is not set -# CONFIG_ATH79_MACH_F9K1115V2 is not set -# CONFIG_ATH79_MACH_FRITZ300E is not set -# CONFIG_ATH79_MACH_GL_AR150 is not set -# CONFIG_ATH79_MACH_GL_AR300 is not set -# CONFIG_ATH79_MACH_GL_AR300M is not set -# CONFIG_ATH79_MACH_GL_DOMINO is not set -# CONFIG_ATH79_MACH_GL_INET is not set -# CONFIG_ATH79_MACH_GL_MIFI is not set -# CONFIG_ATH79_MACH_GL_USB150 is not set -# CONFIG_ATH79_MACH_GS_MINIBOX_V1 is not set -# CONFIG_ATH79_MACH_GS_OOLITE is not set CONFIG_ATH79_MACH_HIVEAP_121=y -# CONFIG_ATH79_MACH_HIWIFI_HC6361 is not set -# CONFIG_ATH79_MACH_HORNET_UB is not set -# CONFIG_ATH79_MACH_JA76PF is not set -# CONFIG_ATH79_MACH_JWAP003 is not set -# CONFIG_ATH79_MACH_JWAP230 is not set -# CONFIG_ATH79_MACH_LIMA is not set -# CONFIG_ATH79_MACH_MC_MAC1200R is not set -# CONFIG_ATH79_MACH_MR12 is not set -# CONFIG_ATH79_MACH_MR16 is not set -# CONFIG_ATH79_MACH_MR1750 is not set CONFIG_ATH79_MACH_MR18=y -# CONFIG_ATH79_MACH_MR600 is not set -# CONFIG_ATH79_MACH_MR900 is not set -# CONFIG_ATH79_MACH_MYNET_N600 is not set -# CONFIG_ATH79_MACH_MYNET_N750 is not set -# CONFIG_ATH79_MACH_MYNET_REXT is not set -# CONFIG_ATH79_MACH_MZK_W04NU is not set -# CONFIG_ATH79_MACH_MZK_W300NH is not set -# CONFIG_ATH79_MACH_NBG460N is not set -# CONFIG_ATH79_MACH_OM2P is not set -# CONFIG_ATH79_MACH_OM5P is not set -# CONFIG_ATH79_MACH_OM5P_AC is not set -# CONFIG_ATH79_MACH_OM5P_ACv2 is not set -# CONFIG_ATH79_MACH_OMY_G1 is not set -# CONFIG_ATH79_MACH_OMY_X1 is not set -# CONFIG_ATH79_MACH_ONION_OMEGA is not set -# CONFIG_ATH79_MACH_PB42 is not set -# CONFIG_ATH79_MACH_PB44 is not set -# CONFIG_ATH79_MACH_PQI_AIR_PEN is not set -# CONFIG_ATH79_MACH_QIHOO_C301 is not set -# CONFIG_ATH79_MACH_R602N is not set +CONFIG_ATH79_MACH_NBG6716=y CONFIG_ATH79_MACH_R6100=y CONFIG_ATH79_MACH_RAMBUTAN=y -# CONFIG_ATH79_MACH_RE450 is not set -# CONFIG_ATH79_MACH_RW2458N is not set -# CONFIG_ATH79_MACH_SC1750 is not set -# CONFIG_ATH79_MACH_SC300M is not set -# CONFIG_ATH79_MACH_SC450 is not set -# CONFIG_ATH79_MACH_SMART_300 is not set -# CONFIG_ATH79_MACH_SOM9331 is not set -# CONFIG_ATH79_MACH_SR3200 is not set -# CONFIG_ATH79_MACH_TELLSTICK_ZNET_LITE is not set -# CONFIG_ATH79_MACH_TEW_632BRP is not set -# CONFIG_ATH79_MACH_TEW_673GRU is not set -# CONFIG_ATH79_MACH_TEW_712BR is not set -# CONFIG_ATH79_MACH_TEW_732BR is not set -# CONFIG_ATH79_MACH_TEW_823DRU is not set -# CONFIG_ATH79_MACH_TL_MR11U is not set -# CONFIG_ATH79_MACH_TL_MR13U is not set -# CONFIG_ATH79_MACH_TL_MR3020 is not set -# CONFIG_ATH79_MACH_TL_MR3X20 is not set -# CONFIG_ATH79_MACH_TL_MR6400 is not set -# CONFIG_ATH79_MACH_TL_WA701ND_V2 is not set -# CONFIG_ATH79_MACH_TL_WA7210N_V2 is not set -# CONFIG_ATH79_MACH_TL_WA801ND_V3 is not set -# CONFIG_ATH79_MACH_TL_WA830RE_V2 is not set -# CONFIG_ATH79_MACH_TL_WA850RE_V2 is not set -# CONFIG_ATH79_MACH_TL_WA855RE_V1 is not set -# CONFIG_ATH79_MACH_TL_WA901ND is not set -# CONFIG_ATH79_MACH_TL_WA901ND_V2 is not set -# CONFIG_ATH79_MACH_TL_WA901ND_V4 is not set -# CONFIG_ATH79_MACH_TL_WAX50RE is not set -# CONFIG_ATH79_MACH_TL_WDR3320_V2 is not set -# CONFIG_ATH79_MACH_TL_WDR3500 is not set -# CONFIG_ATH79_MACH_TL_WDR4300 is not set -# CONFIG_ATH79_MACH_TL_WDR6500_V2 is not set -# CONFIG_ATH79_MACH_TL_WPA8630 is not set -# CONFIG_ATH79_MACH_TL_WR1041N_V2 is not set -# CONFIG_ATH79_MACH_TL_WR1043ND is not set -# CONFIG_ATH79_MACH_TL_WR1043ND_V2 is not set -# CONFIG_ATH79_MACH_TL_WR1043ND_V4 is not set -# CONFIG_ATH79_MACH_TL_WR2543N is not set -# CONFIG_ATH79_MACH_TL_WR703N is not set -# CONFIG_ATH79_MACH_TL_WR720N_V3 is not set -# CONFIG_ATH79_MACH_TL_WR741ND is not set -# CONFIG_ATH79_MACH_TL_WR741ND_V4 is not set -# CONFIG_ATH79_MACH_TL_WR802N_V1 is not set -# CONFIG_ATH79_MACH_TL_WR802N_V2 is not set -# CONFIG_ATH79_MACH_TL_WR810N is not set -# CONFIG_ATH79_MACH_TL_WR840N_V2 is not set -# CONFIG_ATH79_MACH_TL_WR841N_V1 is not set -# CONFIG_ATH79_MACH_TL_WR841N_V8 is not set -# CONFIG_ATH79_MACH_TL_WR841N_V9 is not set -# CONFIG_ATH79_MACH_TL_WR902AC_V1 is not set -# CONFIG_ATH79_MACH_TL_WR940N_V4 is not set -# CONFIG_ATH79_MACH_TL_WR941ND is not set -# CONFIG_ATH79_MACH_TL_WR941ND_V6 is not set -# CONFIG_ATH79_MACH_TL_WR942N_V1 is not set -# CONFIG_ATH79_MACH_TUBE2H is not set -# CONFIG_ATH79_MACH_UBNT is not set -# CONFIG_ATH79_MACH_UBNT_UNIFIAC is not set -# CONFIG_ATH79_MACH_UBNT_XM is not set -# CONFIG_ATH79_MACH_WEIO is not set -# CONFIG_ATH79_MACH_WHR_HP_G300N is not set CONFIG_ATH79_MACH_WI2A_AC200I=y -# CONFIG_ATH79_MACH_WLAE_AG300N is not set -# CONFIG_ATH79_MACH_WLR8100 is not set -# CONFIG_ATH79_MACH_WNDAP360 is not set -# CONFIG_ATH79_MACH_WNDR3700 is not set CONFIG_ATH79_MACH_WNDR4300=y -# CONFIG_ATH79_MACH_WNR2000 is not set -# CONFIG_ATH79_MACH_WNR2000_V3 is not set -# CONFIG_ATH79_MACH_WNR2000_V4 is not set -# CONFIG_ATH79_MACH_WNR2200 is not set -# CONFIG_ATH79_MACH_WP543 is not set -# CONFIG_ATH79_MACH_WPE72 is not set -# CONFIG_ATH79_MACH_WPJ342 is not set -# CONFIG_ATH79_MACH_WPJ344 is not set -# CONFIG_ATH79_MACH_WPJ531 is not set -# CONFIG_ATH79_MACH_WPJ558 is not set -# CONFIG_ATH79_MACH_WPJ563 is not set -# CONFIG_ATH79_MACH_WRT160NL is not set -# CONFIG_ATH79_MACH_WRT400N is not set -# CONFIG_ATH79_MACH_WRTNODE2Q is not set -# CONFIG_ATH79_MACH_WZR_450HP2 is not set -# CONFIG_ATH79_MACH_WZR_HP_AG300H is not set -# CONFIG_ATH79_MACH_WZR_HP_G300NH is not set -# CONFIG_ATH79_MACH_WZR_HP_G300NH2 is not set -# CONFIG_ATH79_MACH_WZR_HP_G450H is not set -# CONFIG_ATH79_MACH_XD3200 is not set CONFIG_ATH79_MACH_Z1=y -# CONFIG_ATH79_MACH_ZBT_WE1526 is not set -# CONFIG_ATH79_MACH_ZCN_1523H is not set +CONFIG_ATH79_NVRAM=y +CONFIG_ATH79_PCI_ATH9K_FIXUP=y CONFIG_BCH=y +CONFIG_BLK_MQ_PCI=y CONFIG_CRC16=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_LZO=y +CONFIG_HW_HAS_PCI=y # CONFIG_INTEL_XWAY_PHY is not set # CONFIG_IP17XX_PHY is not set CONFIG_LEDS_NU801=y @@ -242,14 +54,14 @@ CONFIG_MTD_UBI_BLOCK=y # CONFIG_MTD_UBI_FASTMAP is not set # CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_PCI=y +CONFIG_PCI_AR724X=y +CONFIG_PCI_DISABLE_COMMON_QUIRKS=y +CONFIG_PCI_DOMAINS=y # CONFIG_RTL8306_PHY is not set # CONFIG_RTL8366_SMI is not set -# CONFIG_SOC_AR71XX is not set -# CONFIG_SOC_AR724X is not set -# CONFIG_SOC_AR913X is not set -# CONFIG_SOC_AR933X is not set -# CONFIG_SOC_QCA953X is not set -# CONFIG_SOC_QCA956X is not set +CONFIG_SOC_AR934X=y +CONFIG_SOC_QCA955X=y CONFIG_UBIFS_FS=y # CONFIG_UBIFS_FS_ADVANCED_COMPR is not set CONFIG_UBIFS_FS_LZO=y diff --git a/target/linux/ar71xx/patches-4.4/423-dsa-add-88e6063-driver.patch b/target/linux/ar71xx/patches-4.4/423-dsa-add-88e6063-driver.patch index 1348cd9b04..c6b9cafade 100644 --- a/target/linux/ar71xx/patches-4.4/423-dsa-add-88e6063-driver.patch +++ b/target/linux/ar71xx/patches-4.4/423-dsa-add-88e6063-driver.patch @@ -1,11 +1,12 @@ --- a/drivers/net/dsa/Kconfig +++ b/drivers/net/dsa/Kconfig -@@ -13,6 +13,13 @@ config NET_DSA_MV88E6060 +@@ -13,6 +13,14 @@ config NET_DSA_MV88E6060 This enables support for the Marvell 88E6060 ethernet switch chip. +config NET_DSA_MV88E6063 + bool "Marvell 88E6063 ethernet switch chip support" ++ depends on NET_DSA + select NET_DSA_TAG_TRAILER + ---help--- + This enables support for the Marvell 88E6063 ethernet switch diff --git a/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch b/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch index cd91ac3c02..1d9d761d71 100644 --- a/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch +++ b/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch @@ -1,6 +1,6 @@ --- a/arch/mips/ath79/prom.c +++ b/arch/mips/ath79/prom.c -@@ -136,6 +136,27 @@ void __init prom_init(void) +@@ -136,6 +136,30 @@ void __init prom_init(void) initrd_end = initrd_start + fw_getenvl("initrd_size"); } #endif @@ -20,11 +20,14 @@ + strstr(arcs_cmdline, "board=962") || + strstr(arcs_cmdline, "board=lhg") || + strstr(arcs_cmdline, "board=map-hb") || ++ strstr(arcs_cmdline, "board=map2-hb") || ++ strstr(arcs_cmdline, "board=wap-hb") || ++ strstr(arcs_cmdline, "board=wapg-sc") || + strstr(arcs_cmdline, "board=2011L") || + strstr(arcs_cmdline, "board=2011r") || + strstr(arcs_cmdline, "board=711Gr100") || + strstr(arcs_cmdline, "board=922gs")) + ath79_prom_append_cmdline("console", "ttyS0,115200"); } - + void __init prom_free_prom_memory(void) diff --git a/target/linux/ar71xx/patches-4.4/702-MIPS-ath79-fixup-routerboot-board-parameter.patch b/target/linux/ar71xx/patches-4.4/702-MIPS-ath79-fixup-routerboot-board-parameter.patch new file mode 100644 index 0000000000..b8715bba9e --- /dev/null +++ b/target/linux/ar71xx/patches-4.4/702-MIPS-ath79-fixup-routerboot-board-parameter.patch @@ -0,0 +1,43 @@ +From: Gabor Juhos +Date: Sat, 2 Dec 2017 19:15:29 +0100 +Subject: [PATCH] MIPS: ath79: fix board detection with newer RouterBOOT versions + +Recent RouterBOOT version (at least version 3.41 on RB911G-5HPacD) +use "Board=" kernel parameter instead of "board=" to pass the board +name to the kernel. Due to this change the board detection code is +not working on the devices shipped with the new RouterBOOT version. +Because the kernel is unable to identify these boards they become +unusable despite that they are supported by the current code. + +Update the prom_init code to convert the 'Board' kernel parameter to +'board'. After this change, the board detection works also with the +new RouterBOOT versions. + +Signed-off-by: Gabor Juhos +--- +--- a/arch/mips/ath79/prom.c ++++ b/arch/mips/ath79/prom.c +@@ -104,6 +104,7 @@ static int __init ath79_prom_init_myload + void __init prom_init(void) + { + const char *env; ++ char *c; + + if (ath79_prom_init_myloader()) + return; +@@ -137,6 +138,15 @@ void __init prom_init(void) + } + #endif + ++ /* ++ * RouterBOOT uses "Board" kernel parameter instead of "board" since ++ * version 3.41 (or so). Replace the first character of the parameter ++ * to keep board detection working. ++ */ ++ c = strstr(arcs_cmdline, "Board="); ++ if (c) ++ c[0] = 'b'; ++ + if (strstr(arcs_cmdline, "board=750Gr3") || + strstr(arcs_cmdline, "board=750i") || + strstr(arcs_cmdline, "board=750-hb") || diff --git a/target/linux/ar71xx/patches-4.4/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch b/target/linux/ar71xx/patches-4.4/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch new file mode 100644 index 0000000000..3a6438ee89 --- /dev/null +++ b/target/linux/ar71xx/patches-4.4/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch @@ -0,0 +1,12 @@ +--- a/arch/mips/ath79/pci.c ++++ b/arch/mips/ath79/pci.c +@@ -324,7 +324,8 @@ int __init ath79_register_pci(void) + QCA953X_PCI_MEM_SIZE, + 0, + ATH79_IP2_IRQ(0)); +- } else if (soc_is_qca9558()) { ++ } else if (soc_is_qca9558() || ++ soc_is_qca9556()) { + pdev = ath79_register_pci_ar724x(0, + QCA955X_PCI_CFG_BASE0, + QCA955X_PCI_CTRL_BASE0, diff --git a/target/linux/ar71xx/patches-4.4/900-mdio_bitbang_ignore_ta_value.patch b/target/linux/ar71xx/patches-4.4/900-mdio_bitbang_ignore_ta_value.patch index 4536d519f8..8f8f349a66 100644 --- a/target/linux/ar71xx/patches-4.4/900-mdio_bitbang_ignore_ta_value.patch +++ b/target/linux/ar71xx/patches-4.4/900-mdio_bitbang_ignore_ta_value.patch @@ -1,5 +1,14 @@ --- a/drivers/net/phy/mdio-bitbang.c +++ b/drivers/net/phy/mdio-bitbang.c +@@ -155,7 +155,7 @@ static int mdiobb_cmd_addr(struct mdiobb + static int mdiobb_read(struct mii_bus *bus, int phy, int reg) + { + struct mdiobb_ctrl *ctrl = bus->priv; +- int ret, i; ++ int ret; + + if (reg & MII_ADDR_C45) { + reg = mdiobb_cmd_addr(ctrl, phy, reg); @@ -165,19 +165,7 @@ static int mdiobb_read(struct mii_bus *b ctrl->ops->set_mdio_dir(ctrl, 0); diff --git a/target/linux/ar71xx/patches-4.4/901-phy-mdio-bitbang-prevent-rescheduling-during-command.patch b/target/linux/ar71xx/patches-4.4/901-phy-mdio-bitbang-prevent-rescheduling-during-command.patch index 68f86e0e09..a830346a31 100644 --- a/target/linux/ar71xx/patches-4.4/901-phy-mdio-bitbang-prevent-rescheduling-during-command.patch +++ b/target/linux/ar71xx/patches-4.4/901-phy-mdio-bitbang-prevent-rescheduling-during-command.patch @@ -25,8 +25,8 @@ Signed-off-by: Jonas Gorski @@ -156,7 +157,9 @@ static int mdiobb_read(struct mii_bus *b { struct mdiobb_ctrl *ctrl = bus->priv; - int ret, i; -+ long flags; + int ret; ++ unsigned long flags; + local_irq_save(flags); if (reg & MII_ADDR_C45) { @@ -44,7 +44,7 @@ Signed-off-by: Jonas Gorski static int mdiobb_write(struct mii_bus *bus, int phy, int reg, u16 val) { struct mdiobb_ctrl *ctrl = bus->priv; -+ long flags; ++ unsigned long flags; + local_irq_save(flags); if (reg & MII_ADDR_C45) { diff --git a/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch index 5bedf5dc9e..8882b1758f 100644 --- a/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch +++ b/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch @@ -276,7 +276,7 @@ t = ip6gre_tunnel_lookup(skb->dev, &ipv6h->daddr, &ipv6h->saddr, key, greh->protocol); -@@ -479,11 +479,11 @@ static int ip6gre_rcv(struct sk_buff *sk +@@ -482,11 +482,11 @@ static int ip6gre_rcv(struct sk_buff *sk offset += 4; } if (flags&GRE_KEY) { @@ -290,7 +290,7 @@ offset += 4; } } -@@ -745,7 +745,7 @@ static netdev_tx_t ip6gre_xmit2(struct s +@@ -748,7 +748,7 @@ static netdev_tx_t ip6gre_xmit2(struct s if (tunnel->parms.o_flags&GRE_SEQ) { ++tunnel->o_seqno; @@ -299,7 +299,7 @@ ptr--; } if (tunnel->parms.o_flags&GRE_KEY) { -@@ -841,7 +841,7 @@ static inline int ip6gre_xmit_ipv6(struc +@@ -844,7 +844,7 @@ static inline int ip6gre_xmit_ipv6(struc dsfield = ipv6_get_dsfield(ipv6h); if (t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS) @@ -491,7 +491,7 @@ memcpy(p, foc->val, foc->len); --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c -@@ -505,7 +505,7 @@ static struct sk_buff *add_grec(struct s +@@ -529,7 +529,7 @@ static struct sk_buff *add_grec(struct s if (!skb) return NULL; psrc = (__be32 *)skb_put(skb, sizeof(__be32)); diff --git a/target/linux/ar71xx/patches-4.9/423-dsa-add-88e6063-driver.patch b/target/linux/ar71xx/patches-4.9/423-dsa-add-88e6063-driver.patch index 1df93e9965..dbf892b434 100644 --- a/target/linux/ar71xx/patches-4.9/423-dsa-add-88e6063-driver.patch +++ b/target/linux/ar71xx/patches-4.9/423-dsa-add-88e6063-driver.patch @@ -1,11 +1,12 @@ --- a/drivers/net/dsa/Kconfig +++ b/drivers/net/dsa/Kconfig -@@ -9,6 +9,13 @@ config NET_DSA_MV88E6060 +@@ -9,6 +9,14 @@ config NET_DSA_MV88E6060 This enables support for the Marvell 88E6060 ethernet switch chip. +config NET_DSA_MV88E6063 + bool "Marvell 88E6063 ethernet switch chip support" ++ depends on NET_DSA + select NET_DSA_TAG_TRAILER + ---help--- + This enables support for the Marvell 88E6063 ethernet switch diff --git a/target/linux/ar71xx/patches-4.9/450-gpio-nxp-74hc153-gpio-chip-driver.patch b/target/linux/ar71xx/patches-4.9/450-gpio-nxp-74hc153-gpio-chip-driver.patch index 41cf75a558..7ffdc769e3 100644 --- a/target/linux/ar71xx/patches-4.9/450-gpio-nxp-74hc153-gpio-chip-driver.patch +++ b/target/linux/ar71xx/patches-4.9/450-gpio-nxp-74hc153-gpio-chip-driver.patch @@ -1,6 +1,6 @@ --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig -@@ -1211,4 +1211,12 @@ config GPIO_VIPERBOARD +@@ -1213,4 +1213,12 @@ config GPIO_VIPERBOARD endmenu diff --git a/target/linux/ar71xx/patches-4.9/451-gpio-74x164-improve-platform-device-support.patch b/target/linux/ar71xx/patches-4.9/451-gpio-74x164-improve-platform-device-support.patch index d9cfa888fb..a3d752e9a4 100644 --- a/target/linux/ar71xx/patches-4.9/451-gpio-74x164-improve-platform-device-support.patch +++ b/target/linux/ar71xx/patches-4.9/451-gpio-74x164-improve-platform-device-support.patch @@ -25,7 +25,7 @@ /* * bits_per_word cannot be configured in platform data */ -@@ -115,17 +123,23 @@ static int gen_74x164_probe(struct spi_d +@@ -115,12 +123,15 @@ static int gen_74x164_probe(struct spi_d if (ret < 0) return ret; @@ -47,15 +47,7 @@ chip = devm_kzalloc(&spi->dev, sizeof(*chip) + nregs, GFP_KERNEL); if (!chip) - return -ENOMEM; - -+ if (pdata && pdata->init_data) -+ memcpy(chip->buffer, pdata->init_data, chip->registers); -+ - spi_set_drvdata(spi, chip); - - chip->gpio_chip.label = spi->modalias; -@@ -133,7 +147,11 @@ static int gen_74x164_probe(struct spi_d +@@ -133,7 +144,11 @@ static int gen_74x164_probe(struct spi_d chip->gpio_chip.get = gen_74x164_get_value; chip->gpio_chip.set = gen_74x164_set_value; chip->gpio_chip.set_multiple = gen_74x164_set_multiple; @@ -68,6 +60,16 @@ chip->registers = nregs; chip->gpio_chip.ngpio = GEN_74X164_NUMBER_GPIOS * chip->registers; +@@ -142,6 +157,9 @@ static int gen_74x164_probe(struct spi_d + chip->gpio_chip.parent = &spi->dev; + chip->gpio_chip.owner = THIS_MODULE; + ++ if (pdata && pdata->init_data) ++ memcpy(chip->buffer, pdata->init_data, chip->registers); ++ + mutex_init(&chip->lock); + + ret = __gen_74x164_write_config(chip); @@ -170,17 +188,19 @@ static int gen_74x164_remove(struct spi_ return 0; } diff --git a/target/linux/ar71xx/patches-4.9/452-gpio-add-gpio-latch-driver.patch b/target/linux/ar71xx/patches-4.9/452-gpio-add-gpio-latch-driver.patch index 5ddf6de928..a56226f095 100644 --- a/target/linux/ar71xx/patches-4.9/452-gpio-add-gpio-latch-driver.patch +++ b/target/linux/ar71xx/patches-4.9/452-gpio-add-gpio-latch-driver.patch @@ -1,6 +1,6 @@ --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig -@@ -1218,4 +1218,9 @@ config GPIO_NXP_74HC153 +@@ -1220,4 +1220,9 @@ config GPIO_NXP_74HC153 Platform driver for NXP 74HC153 Dual 4-input Multiplexer. This provides a GPIO interface supporting input mode only. diff --git a/target/linux/ar71xx/patches-4.9/461-spi-ath79-add-fast-flash-read.patch b/target/linux/ar71xx/patches-4.9/461-spi-ath79-add-fast-flash-read.patch index 0dc73a8b5b..5c3583f758 100644 --- a/target/linux/ar71xx/patches-4.9/461-spi-ath79-add-fast-flash-read.patch +++ b/target/linux/ar71xx/patches-4.9/461-spi-ath79-add-fast-flash-read.patch @@ -10,10 +10,18 @@ } static void ath79_spi_disable(struct ath79_spi *sp) -@@ -205,6 +202,33 @@ static u32 ath79_spi_txrx_mode0(struct s +@@ -205,6 +202,38 @@ static u32 ath79_spi_txrx_mode0(struct s return ath79_spi_rr(sp, AR71XX_SPI_REG_RDS); } ++static bool ath79_spi_flash_read_supported(struct spi_device *spi) ++{ ++ if (spi->chip_select || gpio_is_valid(spi->cs_gpio)) ++ return false; ++ ++ return true; ++} ++ +static int ath79_spi_read_flash_data(struct spi_device *spi, + struct spi_flash_read_message *msg) +{ @@ -22,9 +30,6 @@ + if (msg->addr_width > 3) + return -EOPNOTSUPP; + -+ if (spi->chip_select || gpio_is_valid(spi->cs_gpio)) -+ return -EOPNOTSUPP; -+ + /* disable GPIO mode */ + ath79_spi_wr(sp, AR71XX_SPI_REG_FS, 0); + @@ -44,11 +49,12 @@ static int ath79_spi_probe(struct platform_device *pdev) { struct spi_master *master; -@@ -234,6 +258,7 @@ static int ath79_spi_probe(struct platfo +@@ -234,6 +263,8 @@ static int ath79_spi_probe(struct platfo master->num_chipselect = pdata->num_chipselect; master->cs_gpios = pdata->cs_gpios; } + master->spi_flash_read = ath79_spi_read_flash_data; ++ master->flash_read_supported = ath79_spi_flash_read_supported; sp->bitbang.master = master; sp->bitbang.chipselect = ath79_spi_chipselect; diff --git a/target/linux/ar71xx/patches-4.9/500-MIPS-fw-myloader.patch b/target/linux/ar71xx/patches-4.9/500-MIPS-fw-myloader.patch index bcb19372ef..d6a9276c32 100644 --- a/target/linux/ar71xx/patches-4.9/500-MIPS-fw-myloader.patch +++ b/target/linux/ar71xx/patches-4.9/500-MIPS-fw-myloader.patch @@ -10,7 +10,7 @@ --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -1144,6 +1144,9 @@ config MIPS_MSC +@@ -1149,6 +1149,9 @@ config MIPS_MSC config MIPS_NILE4 bool diff --git a/target/linux/ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch b/target/linux/ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch new file mode 100644 index 0000000000..c0b5459e45 --- /dev/null +++ b/target/linux/ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch @@ -0,0 +1,70 @@ +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -195,7 +195,6 @@ config ATH79 + select SYS_SUPPORTS_BIG_ENDIAN + select SYS_SUPPORTS_MIPS16 + select SYS_SUPPORTS_ZBOOT_UART_PROM +- select USE_OF + help + Support for the Atheros AR71XX/AR724X/AR913X SoCs. + +--- a/arch/mips/ath79/setup.c ++++ b/arch/mips/ath79/setup.c +@@ -196,16 +196,20 @@ unsigned int get_c0_compare_int(void) + + void __init plat_mem_setup(void) + { ++#ifdef CONFIG_OF + unsigned long fdt_start; ++#endif + + set_io_port_base(KSEG1); + ++#ifdef CONFIG_OF + /* Get the position of the FDT passed by the bootloader */ + fdt_start = fw_getenvl("fdt_start"); + if (fdt_start) + __dt_setup_arch((void *)KSEG0ADDR(fdt_start)); + else if (fw_passed_dtb) + __dt_setup_arch((void *)KSEG0ADDR(fw_passed_dtb)); ++#endif + + if (mips_machtype != ATH79_MACH_GENERIC_OF) { + ath79_reset_base = ioremap_nocache(AR71XX_RESET_BASE, +@@ -301,17 +305,21 @@ static int __init ath79_setup(void) + + arch_initcall(ath79_setup); + ++#ifdef CONFIG_OF + void __init device_tree_init(void) + { + unflatten_and_copy_device_tree(); + } ++#endif + + MIPS_MACHINE(ATH79_MACH_GENERIC, + "Generic", + "Generic AR71XX/AR724X/AR913X based board", + NULL); + ++#ifdef CONFIG_OF + MIPS_MACHINE(ATH79_MACH_GENERIC_OF, + "DTB", + "Generic AR71XX/AR724X/AR913X based board (DT)", + NULL); ++#endif +--- a/arch/mips/ath79/clock.c ++++ b/arch/mips/ath79/clock.c +@@ -33,10 +33,12 @@ + #define AR724X_BASE_FREQ 40000000 + + static struct clk *clks[ATH79_CLK_END]; ++#ifdef CONFIG_OF + static struct clk_onecell_data clk_data = { + .clks = clks, + .clk_num = ARRAY_SIZE(clks), + }; ++#endif + + static struct clk *__init ath79_add_sys_clkdev( + const char *id, unsigned long rate) diff --git a/target/linux/ar71xx/patches-4.9/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch b/target/linux/ar71xx/patches-4.9/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch index 869fdd6dd0..03ff6c6aac 100644 --- a/target/linux/ar71xx/patches-4.9/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch +++ b/target/linux/ar71xx/patches-4.9/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch @@ -44,7 +44,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. config ATH79_NVRAM --- a/arch/mips/ath79/clock.c +++ b/arch/mips/ath79/clock.c -@@ -356,6 +356,91 @@ static void __init ar934x_clocks_init(vo +@@ -358,6 +358,91 @@ static void __init ar934x_clocks_init(vo iounmap(dpll_base); } @@ -136,7 +136,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. static void __init qca955x_clocks_init(void) { unsigned long ref_rate; -@@ -451,6 +536,8 @@ void __init ath79_clocks_init(void) +@@ -453,6 +538,8 @@ void __init ath79_clocks_init(void) ar933x_clocks_init(); else if (soc_is_ar934x()) ar934x_clocks_init(); diff --git a/target/linux/ar71xx/patches-4.9/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch b/target/linux/ar71xx/patches-4.9/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch index dafac99190..e6eaa7123a 100644 --- a/target/linux/ar71xx/patches-4.9/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch +++ b/target/linux/ar71xx/patches-4.9/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch @@ -24,7 +24,7 @@ config ATH79_NVRAM --- a/arch/mips/ath79/clock.c +++ b/arch/mips/ath79/clock.c -@@ -526,6 +526,100 @@ static void __init qca955x_clocks_init(v +@@ -528,6 +528,100 @@ static void __init qca955x_clocks_init(v clk_add_alias("uart", NULL, "ref", NULL); } @@ -125,7 +125,7 @@ void __init ath79_clocks_init(void) { if (soc_is_ar71xx()) -@@ -540,6 +634,8 @@ void __init ath79_clocks_init(void) +@@ -542,6 +636,8 @@ void __init ath79_clocks_init(void) qca953x_clocks_init(); else if (soc_is_qca955x()) qca955x_clocks_init(); diff --git a/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch b/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch index cd91ac3c02..1d9d761d71 100644 --- a/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch +++ b/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch @@ -1,6 +1,6 @@ --- a/arch/mips/ath79/prom.c +++ b/arch/mips/ath79/prom.c -@@ -136,6 +136,27 @@ void __init prom_init(void) +@@ -136,6 +136,30 @@ void __init prom_init(void) initrd_end = initrd_start + fw_getenvl("initrd_size"); } #endif @@ -20,11 +20,14 @@ + strstr(arcs_cmdline, "board=962") || + strstr(arcs_cmdline, "board=lhg") || + strstr(arcs_cmdline, "board=map-hb") || ++ strstr(arcs_cmdline, "board=map2-hb") || ++ strstr(arcs_cmdline, "board=wap-hb") || ++ strstr(arcs_cmdline, "board=wapg-sc") || + strstr(arcs_cmdline, "board=2011L") || + strstr(arcs_cmdline, "board=2011r") || + strstr(arcs_cmdline, "board=711Gr100") || + strstr(arcs_cmdline, "board=922gs")) + ath79_prom_append_cmdline("console", "ttyS0,115200"); } - + void __init prom_free_prom_memory(void) diff --git a/target/linux/ar71xx/patches-4.9/702-MIPS-ath79-fixup-routerboot-board-parameter.patch b/target/linux/ar71xx/patches-4.9/702-MIPS-ath79-fixup-routerboot-board-parameter.patch new file mode 100644 index 0000000000..b8715bba9e --- /dev/null +++ b/target/linux/ar71xx/patches-4.9/702-MIPS-ath79-fixup-routerboot-board-parameter.patch @@ -0,0 +1,43 @@ +From: Gabor Juhos +Date: Sat, 2 Dec 2017 19:15:29 +0100 +Subject: [PATCH] MIPS: ath79: fix board detection with newer RouterBOOT versions + +Recent RouterBOOT version (at least version 3.41 on RB911G-5HPacD) +use "Board=" kernel parameter instead of "board=" to pass the board +name to the kernel. Due to this change the board detection code is +not working on the devices shipped with the new RouterBOOT version. +Because the kernel is unable to identify these boards they become +unusable despite that they are supported by the current code. + +Update the prom_init code to convert the 'Board' kernel parameter to +'board'. After this change, the board detection works also with the +new RouterBOOT versions. + +Signed-off-by: Gabor Juhos +--- +--- a/arch/mips/ath79/prom.c ++++ b/arch/mips/ath79/prom.c +@@ -104,6 +104,7 @@ static int __init ath79_prom_init_myload + void __init prom_init(void) + { + const char *env; ++ char *c; + + if (ath79_prom_init_myloader()) + return; +@@ -137,6 +138,15 @@ void __init prom_init(void) + } + #endif + ++ /* ++ * RouterBOOT uses "Board" kernel parameter instead of "board" since ++ * version 3.41 (or so). Replace the first character of the parameter ++ * to keep board detection working. ++ */ ++ c = strstr(arcs_cmdline, "Board="); ++ if (c) ++ c[0] = 'b'; ++ + if (strstr(arcs_cmdline, "board=750Gr3") || + strstr(arcs_cmdline, "board=750i") || + strstr(arcs_cmdline, "board=750-hb") || diff --git a/target/linux/ar71xx/patches-4.9/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch b/target/linux/ar71xx/patches-4.9/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch new file mode 100644 index 0000000000..3a6438ee89 --- /dev/null +++ b/target/linux/ar71xx/patches-4.9/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch @@ -0,0 +1,12 @@ +--- a/arch/mips/ath79/pci.c ++++ b/arch/mips/ath79/pci.c +@@ -324,7 +324,8 @@ int __init ath79_register_pci(void) + QCA953X_PCI_MEM_SIZE, + 0, + ATH79_IP2_IRQ(0)); +- } else if (soc_is_qca9558()) { ++ } else if (soc_is_qca9558() || ++ soc_is_qca9556()) { + pdev = ath79_register_pci_ar724x(0, + QCA955X_PCI_CFG_BASE0, + QCA955X_PCI_CTRL_BASE0, diff --git a/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch index 21ceca156f..92f0a67658 100644 --- a/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch +++ b/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch @@ -448,7 +448,7 @@ memcpy(p, foc->val, foc->len); --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c -@@ -509,7 +509,7 @@ static struct sk_buff *add_grec(struct s +@@ -533,7 +533,7 @@ static struct sk_buff *add_grec(struct s if (!skb) return NULL; psrc = (__be32 *)skb_put(skb, sizeof(__be32)); @@ -795,7 +795,7 @@ --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -3886,14 +3886,16 @@ static bool tcp_parse_aligned_timestamp( +@@ -3892,14 +3892,16 @@ static bool tcp_parse_aligned_timestamp( { const __be32 *ptr = (const __be32 *)(th + 1); diff --git a/target/linux/ar71xx/tiny/config-default b/target/linux/ar71xx/tiny/config-default new file mode 100644 index 0000000000..2e9031a24c --- /dev/null +++ b/target/linux/ar71xx/tiny/config-default @@ -0,0 +1,72 @@ +CONFIG_ATH79_DEV_AP9X_PCI=y +CONFIG_ATH79_DEV_DSA=y +CONFIG_ATH79_DEV_ETH=y +CONFIG_ATH79_DEV_GPIO_BUTTONS=y +CONFIG_ATH79_DEV_LEDS_GPIO=y +CONFIG_ATH79_DEV_M25P80=y +# CONFIG_ATH79_DEV_NFC is not set +CONFIG_ATH79_DEV_SPI=y +CONFIG_ATH79_DEV_USB=y +CONFIG_ATH79_DEV_WMAC=y +CONFIG_ATH79_MACH_DIR_600_A1=y +CONFIG_ATH79_MACH_DIR_615_C1=y +CONFIG_ATH79_MACH_DIR_615_I1=y +CONFIG_ATH79_MACH_NBG460N=y +CONFIG_ATH79_MACH_TEW_632BRP=y +CONFIG_ATH79_MACH_TEW_712BR=y +CONFIG_ATH79_MACH_TL_MR11U=y +CONFIG_ATH79_MACH_TL_MR13U=y +CONFIG_ATH79_MACH_TL_MR3020=y +CONFIG_ATH79_MACH_TL_MR3X20=y +CONFIG_ATH79_MACH_TL_WA701ND_V2=y +CONFIG_ATH79_MACH_TL_WA7210N_V2=y +CONFIG_ATH79_MACH_TL_WA801ND_V3=y +CONFIG_ATH79_MACH_TL_WA830RE_V2=y +CONFIG_ATH79_MACH_TL_WA850RE_V2=y +CONFIG_ATH79_MACH_TL_WA855RE_V1=y +CONFIG_ATH79_MACH_TL_WA901ND=y +CONFIG_ATH79_MACH_TL_WA901ND_V2=y +CONFIG_ATH79_MACH_TL_WA901ND_V4=y +CONFIG_ATH79_MACH_TL_WAX50RE=y +CONFIG_ATH79_MACH_TL_WDR3320_V2=y +CONFIG_ATH79_MACH_TL_WDR3500=y +CONFIG_ATH79_MACH_TL_WR1041N_V2=y +CONFIG_ATH79_MACH_TL_WR703N=y +CONFIG_ATH79_MACH_TL_WR720N_V3=y +CONFIG_ATH79_MACH_TL_WR741ND=y +CONFIG_ATH79_MACH_TL_WR741ND_V4=y +CONFIG_ATH79_MACH_TL_WR802N_V1=y +CONFIG_ATH79_MACH_TL_WR802N_V2=y +CONFIG_ATH79_MACH_TL_WR840N_V2=y +CONFIG_ATH79_MACH_TL_WR841N_V1=y +CONFIG_ATH79_MACH_TL_WR841N_V8=y +CONFIG_ATH79_MACH_TL_WR841N_V9=y +CONFIG_ATH79_MACH_TL_WR940N_V4=y +CONFIG_ATH79_MACH_TL_WR941ND=y +CONFIG_ATH79_MACH_TL_WR941ND_V6=y +CONFIG_ATH79_MACH_WHR_HP_G300N=y +CONFIG_ATH79_MACH_WLAE_AG300N=y +CONFIG_ATH79_MACH_WNR2000=y +CONFIG_ATH79_MACH_WNR2000_V3=y +CONFIG_ATH79_MACH_WNR2000_V4=y +CONFIG_ATH79_MACH_WP543=y +CONFIG_ATH79_MACH_WPE72=y +CONFIG_ATH79_NVRAM=y +CONFIG_ATH79_PCI_ATH9K_FIXUP=y +CONFIG_BLK_MQ_PCI=y +CONFIG_HW_HAS_PCI=y +CONFIG_MYLOADER=y +CONFIG_PCI=y +CONFIG_PCI_AR724X=y +CONFIG_PCI_DISABLE_COMMON_QUIRKS=y +CONFIG_PCI_DOMAINS=y +CONFIG_SERIAL_AR933X=y +CONFIG_SERIAL_AR933X_CONSOLE=y +CONFIG_SERIAL_AR933X_NR_UARTS=2 +CONFIG_SOC_AR71XX=y +CONFIG_SOC_AR724X=y +CONFIG_SOC_AR913X=y +CONFIG_SOC_AR933X=y +CONFIG_SOC_AR934X=y +CONFIG_SOC_QCA953X=y +CONFIG_SOC_QCA956X=y diff --git a/target/linux/ar71xx/tiny/profiles/00-default.mk b/target/linux/ar71xx/tiny/profiles/00-default.mk new file mode 100644 index 0000000000..d6d76086fd --- /dev/null +++ b/target/linux/ar71xx/tiny/profiles/00-default.mk @@ -0,0 +1,11 @@ +define Profile/Default + NAME:=Default Profile (all drivers) + PACKAGES:= \ + kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport + PRIORITY := 1 +endef + +define Profile/Default/Description + Default package set compatible with most boards. +endef +$(eval $(call Profile,Default)) diff --git a/target/linux/ar71xx/tiny/target.mk b/target/linux/ar71xx/tiny/target.mk new file mode 100644 index 0000000000..1742eb508f --- /dev/null +++ b/target/linux/ar71xx/tiny/target.mk @@ -0,0 +1,8 @@ +BOARDNAME:=Devices with small flash +FEATURES += squashfs small_flash + +define Target/Description + Build firmware images for Atheros AR71xx/AR913x/AR934x based boards with small NOR flash. +endef + + diff --git a/target/linux/arc770/generic/target.mk b/target/linux/arc770/generic/target.mk index 15f598ee16..2ca59b579b 100644 --- a/target/linux/arc770/generic/target.mk +++ b/target/linux/arc770/generic/target.mk @@ -1,5 +1,5 @@ BOARDNAME:=Generic -FEATURES += ramdisk usb ext4 +FEATURES += ramdisk usb ext4 source-only define Target/Description Build firmware images for generic ARC 770D based boards. diff --git a/target/linux/armvirt/64/config-default b/target/linux/armvirt/64/config-default index 8a8c50bc27..4e63668f5f 100644 --- a/target/linux/armvirt/64/config-default +++ b/target/linux/armvirt/64/config-default @@ -38,8 +38,11 @@ CONFIG_ARM64_HW_AFDBM=y CONFIG_ARM64_MODULE_CMODEL_LARGE=y CONFIG_ARM64_PAGE_SHIFT=12 CONFIG_ARM64_PAN=y +# CONFIG_ARM64_PMEM is not set # CONFIG_ARM64_PTDUMP is not set +# CONFIG_ARM64_PTDUMP_DEBUGFS is not set # CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET is not set +# CONFIG_ARM64_SW_TTBR0_PAN is not set CONFIG_ARM64_UAO=y CONFIG_ARM64_VA_BITS=39 CONFIG_ARM64_VA_BITS_39=y @@ -47,6 +50,7 @@ CONFIG_ARM64_VA_BITS_39=y CONFIG_ARM64_VHE=y # CONFIG_ARMV8_DEPRECATED is not set CONFIG_ARM_GIC_V3_ITS=y +CONFIG_ARM_PMU=y # CONFIG_ARM_SBSA_WATCHDOG is not set CONFIG_ATOMIC64_SELFTEST=y CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y @@ -70,15 +74,20 @@ CONFIG_CPU_IDLE=y CONFIG_CPU_IDLE_GOV_MENU=y CONFIG_CPU_PM=y CONFIG_CRYPTO_ABLK_HELPER=y +CONFIG_CRYPTO_AES_ARM64_BS=y CONFIG_CRYPTO_AES_ARM64_CE=y CONFIG_CRYPTO_AES_ARM64_CE_BLK=y CONFIG_CRYPTO_AES_ARM64_CE_CCM=y CONFIG_CRYPTO_AES_ARM64_NEON_BLK=y +CONFIG_CRYPTO_CHACHA20_NEON=y CONFIG_CRYPTO_CRC32_ARM64=y +CONFIG_CRYPTO_CRC32_ARM64_CE=y CONFIG_CRYPTO_CRYPTD=y +# CONFIG_CRYPTO_DEV_CAVIUM_ZIP is not set CONFIG_CRYPTO_GHASH_ARM64_CE=y CONFIG_CRYPTO_SHA1_ARM64_CE=y CONFIG_CRYPTO_SHA2_ARM64_CE=y +CONFIG_CRYPTO_SHA512_ARM64=y # CONFIG_DEBUG_ALIGN_RODATA is not set CONFIG_DEBUG_BUGVERBOSE=y CONFIG_DEBUG_RODATA=y @@ -115,7 +124,6 @@ CONFIG_HW_RANDOM=y # CONFIG_HW_RANDOM_CAVIUM is not set CONFIG_HW_RANDOM_VIRTIO=y CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 -# CONFIG_KASAN is not set CONFIG_LCD_CLASS_DEVICE=m # CONFIG_LCD_PLATFORM is not set # CONFIG_LIQUIDIO is not set @@ -126,6 +134,7 @@ CONFIG_MFD_SYSCON=y CONFIG_MFD_VEXPRESS_SYSREG=y CONFIG_MMC=y CONFIG_MMC_ARMMMCI=y +# CONFIG_MMC_CAVIUM_THUNDERX is not set # CONFIG_MMC_TIFM_SD is not set CONFIG_MODULES_USE_ELF_RELA=y # CONFIG_MTD_PHYSMAP_OF is not set @@ -133,11 +142,14 @@ CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_NO_HZ=y CONFIG_NO_HZ_COMMON=y CONFIG_NO_HZ_IDLE=y +CONFIG_NR_CPUS=64 # CONFIG_NUMA is not set +# CONFIG_PCIE_KIRIN is not set CONFIG_PCI_BUS_ADDR_T_64BIT=y # CONFIG_PCI_HISI is not set # CONFIG_PCI_HOST_THUNDER_ECAM is not set # CONFIG_PCI_HOST_THUNDER_PEM is not set +# CONFIG_PCI_XGENE is not set CONFIG_PGTABLE_LEVELS=3 CONFIG_PHYS_ADDR_T_64BIT=y # CONFIG_PHY_XGENE is not set @@ -168,3 +180,4 @@ CONFIG_SYS_SUPPORTS_HUGETLBFS=y CONFIG_VEXPRESS_CONFIG=y CONFIG_VEXPRESS_SYSCFG=y CONFIG_VIDEOMODE_HELPERS=y +CONFIG_VMAP_STACK=y diff --git a/target/linux/armvirt/Makefile b/target/linux/armvirt/Makefile index 2cf3820630..107f8607c3 100644 --- a/target/linux/armvirt/Makefile +++ b/target/linux/armvirt/Makefile @@ -13,7 +13,7 @@ FEATURES+=cpiogz ext4 ramdisk squashfs targz MAINTAINER:=Florian Fainelli , \ Yousong Zhou -KERNEL_PATCHVER:=4.9 +KERNEL_PATCHVER:=4.14 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/armvirt/README b/target/linux/armvirt/README index fba71a62f2..ae0d2ada62 100644 --- a/target/linux/armvirt/README +++ b/target/linux/armvirt/README @@ -4,18 +4,18 @@ QEMU ARM virt machine. Run with qemu-system-arm # boot with initramfs embedded in - qemu-system-arm -nographic -M virt -m 64 -kernel lede-armvirt-32-zImage-initramfs + qemu-system-arm -nographic -M virt -m 64 -kernel openwrt-armvirt-32-zImage-initramfs # boot with accel=kvm qemu-system-arm -nographic -M virt,accel=kvm -cpu host -m 64 -kernel - lede-armvirt-32-zImage-initramfs + openwrt-armvirt-32-zImage-initramfs # boot with a separate rootfs - qemu-system-arm -nographic -M virt -m 64 -kernel lede-armvirt-32-zImage \ - -drive file=lede-armvirt-32-root.ext4,format=raw,if=virtio -append 'root=/dev/vda rootwait' + qemu-system-arm -nographic -M virt -m 64 -kernel openwrt-armvirt-32-zImage \ + -drive file=openwrt-armvirt-32-root.ext4,format=raw,if=virtio -append 'root=/dev/vda rootwait' # boot with local dir as rootfs - qemu-system-arm -nographic -M virt -m 64 -kernel lede-armvirt-32-zImage \ + qemu-system-arm -nographic -M virt -m 64 -kernel openwrt-armvirt-32-zImage \ -fsdev local,id=rootdev,path=root-armvirt/,security_model=none \ -device virtio-9p-pci,fsdev=rootdev,mount_tag=/dev/root \ -append 'rootflags=trans=virtio,version=9p2000.L,cache=loose rootfstype=9p' @@ -23,10 +23,10 @@ Run with qemu-system-arm Run with kvmtool # start a named machine - lkvm run -k lede-armvirt-32-zImage -i lede-armvirt-32-rootfs.cpio --name armvirt0 + lkvm run -k openwrt-armvirt-32-zImage -i openwrt-armvirt-32-rootfs.cpio --name armvirt0 # start with virtio-9p rootfs - lkvm run -k lede-armvirt-32-zImage -d root-armvirt/ + lkvm run -k openwrt-armvirt-32-zImage -d root-armvirt/ # stop "armvirt0" lkvm stop --name armvirt0 @@ -37,4 +37,4 @@ Run with kvmtool The multi-platform ARMv8 target can be used with QEMU: qemu-system-aarch64 -machine virt -cpu cortex-a57 -nographic \ - -kernel lede-armvirt-64-Image-initramfs \ + -kernel openwrt-armvirt-64-Image-initramfs \ diff --git a/target/linux/armvirt/config-4.14 b/target/linux/armvirt/config-4.14 new file mode 100644 index 0000000000..64444d72fd --- /dev/null +++ b/target/linux/armvirt/config-4.14 @@ -0,0 +1,180 @@ +CONFIG_9P_FS=y +# CONFIG_9P_FS_POSIX_ACL is not set +# CONFIG_9P_FS_SECURITY is not set +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +CONFIG_ARCH_HAS_SG_CHAIN=y +CONFIG_ARCH_HAS_TICK_BROADCAST=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARM_AMBA=y +CONFIG_ARM_ARCH_TIMER=y +CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y +CONFIG_ARM_GIC=y +CONFIG_ARM_GIC_V2M=y +CONFIG_ARM_GIC_V3=y +CONFIG_ARM_PSCI_FW=y +# CONFIG_ARM_SP805_WATCHDOG is not set +CONFIG_BLK_MQ_PCI=y +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLKSRC_OF=y +CONFIG_CLKSRC_PROBE=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_COMMON_CLK=y +# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set +CONFIG_CPU_RMAP=y +CONFIG_CRC16=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_NULL2=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_DCACHE_WORD_ACCESS=y +CONFIG_DTC=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EXT4_FS=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FRAME_POINTER=y +CONFIG_FS_MBCACHE=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_MIGRATION=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_MSI_IRQ=y +CONFIG_GENERIC_MSI_IRQ_DOMAIN=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GPIOLIB=y +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_PL061=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set +CONFIG_HAVE_ARCH_AUDITSYSCALL=y +CONFIG_HAVE_ARCH_BITREVERSE=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_PFN_VALID=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +CONFIG_HAVE_ARM_SMCCC=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_CC_STACKPROTECTOR=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_UID16=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HOTPLUG_CPU=y +CONFIG_HVC_DRIVER=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IOMMU_HELPER=y +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +CONFIG_JBD2=y +CONFIG_LIBFDT=y +CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_MEMORY_BALLOON=y +CONFIG_MUTEX_SPIN_ON_OWNER=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NET_9P=y +# CONFIG_NET_9P_DEBUG is not set +CONFIG_NET_9P_VIRTIO=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NO_BOOTMEM=y +CONFIG_NR_CPUS=4 +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_ADDRESS_PCI=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_NET=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_OF_RESERVED_MEM=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_PADATA=y +CONFIG_PARTITION_PERCPU=y +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DOMAINS_GENERIC=y +CONFIG_PCI_ECAM=y +CONFIG_PCI_HOST_COMMON=y +CONFIG_PCI_HOST_GENERIC=y +CONFIG_PCI_MSI=y +CONFIG_PCI_MSI_IRQ_DOMAIN=y +CONFIG_RATIONAL=y +CONFIG_RCU_STALL_COMMON=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_PL031=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +# CONFIG_SCHED_INFO is not set +CONFIG_SCSI=y +CONFIG_SCSI_VIRTIO=y +CONFIG_SERIAL_8250_FSL=y +# CONFIG_SERIAL_AMBA_PL010 is not set +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_SMP=y +CONFIG_SPARSE_IRQ=y +CONFIG_SRCU=y +CONFIG_SWIOTLB=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TREE_RCU=y +CONFIG_USB_SUPPORT=y +CONFIG_VIRTIO=y +CONFIG_VIRTIO_BALLOON=y +CONFIG_VIRTIO_BLK=y +CONFIG_VIRTIO_CONSOLE=y +CONFIG_VIRTIO_MMIO=y +# CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES is not set +CONFIG_VIRTIO_NET=y +CONFIG_VIRTIO_PCI=y +CONFIG_VIRTIO_PCI_LEGACY=y +CONFIG_XPS=y diff --git a/target/linux/at91/Makefile b/target/linux/at91/Makefile index a3e0be7c8a..cae3c6278b 100644 --- a/target/linux/at91/Makefile +++ b/target/linux/at91/Makefile @@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk ARCH:=arm BOARD:=at91 MAINTAINER:=Claudio Mignanti -BOARDNAME:=Atmel AT91 -FEATURES:=squashfs targz ext2 usb usbgadget ubifs -SUBTARGETS:=legacy sama5d3 +BOARDNAME:=Microchip (Atmel AT91) +FEATURES:=ext4 squashfs targz usb usbgadget ubifs +SUBTARGETS:=sama5 legacy -KERNEL_PATCHVER:=4.4 +KERNEL_PATCHVER:=4.9 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/at91/base-files/lib/at91.sh b/target/linux/at91/base-files/lib/at91.sh index 0fa2ee3251..61921edd14 100755 --- a/target/linux/at91/base-files/lib/at91.sh +++ b/target/linux/at91/base-files/lib/at91.sh @@ -43,6 +43,12 @@ at91_board_detect() { *"SAMA5D3 Xplained") name="sama5d3_xplained" ;; + *"SAMA5D2 Xplained") + name="sama5d2_xplained" + ;; + *"SAMA5D4 Xplained") + name="sama5d4_xplained" + ;; *"CalAmp LMU5000") name="lmu5000" ;; diff --git a/target/linux/at91/config-4.4 b/target/linux/at91/config-4.9 similarity index 93% rename from target/linux/at91/config-4.4 rename to target/linux/at91/config-4.9 index 4e3b036110..c0151a5916 100644 --- a/target/linux/at91/config-4.4 +++ b/target/linux/at91/config-4.9 @@ -1,6 +1,6 @@ CONFIG_ALIGNMENT_TRAP=y CONFIG_ARCH_AT91=y -CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y CONFIG_ARCH_HAS_SG_CHAIN=y @@ -14,7 +14,6 @@ CONFIG_ARCH_MULTI_CPU_AUTO=y CONFIG_ARCH_MULTI_V4_V5=y CONFIG_ARCH_MULTI_V5=y CONFIG_ARCH_NR_GPIO=0 -CONFIG_ARCH_REQUIRE_GPIOLIB=y # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y @@ -24,7 +23,6 @@ CONFIG_ARCH_USE_BUILTIN_BSWAP=y CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y CONFIG_ARCH_WANT_GENERAL_HUGETLB=y CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y -CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y CONFIG_ARM=y CONFIG_ARM_APPENDED_DTB=y # CONFIG_ARM_ATAG_DTB_COMPAT is not set @@ -36,13 +34,15 @@ CONFIG_ARM_THUMB=y CONFIG_AT91SAM9X_WATCHDOG=y CONFIG_ATAGS=y CONFIG_ATMEL_AIC_IRQ=y +CONFIG_ATMEL_EBI=y CONFIG_ATMEL_PIT=y CONFIG_ATMEL_SDRAMC=y # CONFIG_ATMEL_TCLIB is not set +CONFIG_AT_HDMAC=y +# CONFIG_AT_XDMAC is not set CONFIG_AUTO_ZRELADDR=y # CONFIG_BLK_DEV_INITRD is not set # CONFIG_CACHE_L2X0 is not set -CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_OF=y CONFIG_CLKSRC_PROBE=y @@ -75,11 +75,14 @@ CONFIG_DEBUG_BUGVERBOSE=y CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" # CONFIG_DEBUG_UART_8250 is not set # CONFIG_DEBUG_USER is not set -CONFIG_DEVPTS_MULTIPLE_INSTANCES=y +CONFIG_DMADEVICES=y +CONFIG_DMA_ENGINE=y +CONFIG_DMA_OF=y CONFIG_DTC=y CONFIG_EDAC_ATOMIC_SCRUB=y CONFIG_EDAC_SUPPORT=y CONFIG_EXT4_FS=y +CONFIG_FIXED_PHY=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_FRAME_POINTER=y CONFIG_FS_MBCACHE=y @@ -87,6 +90,7 @@ CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_EARLY_IOREMAP=y CONFIG_GENERIC_IDLE_POLL_SETUP=y CONFIG_GENERIC_IO=y CONFIG_GENERIC_IRQ_CHIP=y @@ -99,7 +103,6 @@ CONFIG_GENERIC_STRNCPY_FROM_USER=y CONFIG_GENERIC_STRNLEN_USER=y CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y -CONFIG_GPIO_DEVRES=y CONFIG_GPIO_SYSFS=y CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDIRQS_SW_RESEND=y @@ -118,7 +121,7 @@ CONFIG_HAVE_AT91_SMD=y CONFIG_HAVE_AT91_USB_CLK=y CONFIG_HAVE_AT91_UTMI=y # CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_HAVE_BPF_JIT=y +CONFIG_HAVE_CBPF_JIT=y CONFIG_HAVE_CC_STACKPROTECTOR=y CONFIG_HAVE_CLK=y CONFIG_HAVE_CLK_PREPARE=y @@ -126,7 +129,6 @@ CONFIG_HAVE_CONTEXT_TRACKING=y CONFIG_HAVE_C_RECORDMCOUNT=y CONFIG_HAVE_DEBUG_KMEMLEAK=y CONFIG_HAVE_DMA_API_DEBUG=y -CONFIG_HAVE_DMA_ATTRS=y CONFIG_HAVE_DMA_CONTIGUOUS=y CONFIG_HAVE_DYNAMIC_FTRACE=y CONFIG_HAVE_FB_ATMEL=y @@ -135,12 +137,6 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y CONFIG_HAVE_FUNCTION_TRACER=y CONFIG_HAVE_GENERIC_DMA_COHERENT=y CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_KERNEL_GZIP=y -CONFIG_HAVE_KERNEL_LZ4=y -CONFIG_HAVE_KERNEL_LZMA=y -CONFIG_HAVE_KERNEL_LZO=y -CONFIG_HAVE_KERNEL_XZ=y -CONFIG_HAVE_LATENCYTOP_SUPPORT=y CONFIG_HAVE_MEMBLOCK=y CONFIG_HAVE_MOD_ARCH_SPECIFIC=y CONFIG_HAVE_NET_DSA=y @@ -171,6 +167,7 @@ CONFIG_LZO_DECOMPRESS=y CONFIG_MACB=y CONFIG_MDIO_BOARDINFO=y CONFIG_MEMORY=y +CONFIG_MFD_SYSCON=y CONFIG_MICREL_PHY=y CONFIG_MIGHT_HAVE_PCI=y CONFIG_MMC=y @@ -186,7 +183,7 @@ CONFIG_MTD_NAND_ECC=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 -# CONFIG_MTD_UBI_BLOCK is not set +CONFIG_MTD_UBI_BLOCK=y # CONFIG_MTD_UBI_FASTMAP is not set # CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 @@ -203,13 +200,11 @@ CONFIG_OF_FLATTREE=y CONFIG_OF_GPIO=y CONFIG_OF_IRQ=y CONFIG_OF_MDIO=y -CONFIG_OF_MTD=y CONFIG_OF_NET=y CONFIG_OF_RESERVED_MEM=y CONFIG_OLD_SIGACTION=y CONFIG_OLD_SIGSUSPEND3=y CONFIG_PAGE_OFFSET=0xC0000000 -# CONFIG_PCI is not set # CONFIG_PCI_DOMAINS_GENERIC is not set # CONFIG_PCI_SYSCALL is not set CONFIG_PERF_USE_VMALLOC=y @@ -222,13 +217,18 @@ CONFIG_PINCTRL_AT91=y CONFIG_POWER_RESET=y CONFIG_POWER_RESET_AT91_POWEROFF=y CONFIG_POWER_RESET_AT91_RESET=y +# CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC is not set CONFIG_POWER_SUPPLY=y CONFIG_RATIONAL=y # CONFIG_RCU_STALL_COMMON is not set +CONFIG_REGMAP=y +CONFIG_REGMAP_MMIO=y +CONFIG_REGMAP_SPI=y CONFIG_RTC_CLASS=y # CONFIG_RTC_DRV_AT91RM9200 is not set # CONFIG_RTC_DRV_AT91SAM9 is not set # CONFIG_RTC_DRV_CMOS is not set +CONFIG_RTC_I2C_AND_SPI=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y # CONFIG_SAMA5D4_WATCHDOG is not set # CONFIG_SCHED_INFO is not set @@ -251,6 +251,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=999999 CONFIG_SRCU=y # CONFIG_STAGING is not set CONFIG_SWIOTLB=y +CONFIG_SWPHY=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_UBIFS_FS=y @@ -270,4 +271,3 @@ CONFIG_ZBOOT_ROM_BSS=0 CONFIG_ZBOOT_ROM_TEXT=0 CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y -CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/at91/files/arch/arm/boot/dts/at91-q5xr5.dts b/target/linux/at91/files/arch/arm/boot/dts/at91-q5xr5.dts index 2aa04ca6f6..728553bce0 100644 --- a/target/linux/at91/files/arch/arm/boot/dts/at91-q5xr5.dts +++ b/target/linux/at91/files/arch/arm/boot/dts/at91-q5xr5.dts @@ -168,7 +168,7 @@ }; }; - usb0: ohci@00500000 { + usb0: ohci@500000 { num-ports = <2>; status = "okay"; }; diff --git a/target/linux/at91/files/arch/arm/boot/dts/lmu5000.dts b/target/linux/at91/files/arch/arm/boot/dts/lmu5000.dts index 921d44beec..fb3dd565a3 100644 --- a/target/linux/at91/files/arch/arm/boot/dts/lmu5000.dts +++ b/target/linux/at91/files/arch/arm/boot/dts/lmu5000.dts @@ -117,7 +117,7 @@ }; }; - usb0: ohci@00500000 { + usb0: ohci@500000 { num-ports = <2>; status = "okay"; }; diff --git a/target/linux/at91/files/arch/arm/boot/dts/wb45n.dts b/target/linux/at91/files/arch/arm/boot/dts/wb45n.dts new file mode 100644 index 0000000000..2d1fe0c083 --- /dev/null +++ b/target/linux/at91/files/arch/arm/boot/dts/wb45n.dts @@ -0,0 +1,220 @@ +/* + * wb45n.dts - Device Tree file for WB45NBT board + * + * Copyright (C) 2015 Laird + * + * Licensed under GPLv2 or later. + */ +/dts-v1/; +#include "at91sam9g25.dtsi" + +/ { + model = "Laird Workgroup Bridge 45N - Atmel AT91SAM (dt)"; + compatible = "laird,wb45n", "laird,wbxx", "atmel,at91sam9x5", "atmel,at91sam9"; + + chosen { + bootargs = "console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=ubifs ubi.mtd=1 root=ubi0:rootfs"; + }; + + memory { + reg = <0x20000000 0x4000000>; + }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + main_clock: clock@0 { + compatible = "atmel,osc", "fixed-clock"; + clock-frequency = <12000000>; + }; + + slow_xtal { + clock-frequency = <32768>; + }; + + main_xtal { + clock-frequency = <12000000>; + }; + }; + + ahb { + apb { + + rstc@fffffe00 { + compatible = "atmel,sama5d3-rstc"; + }; + + pinctrl@fffff400 { + nand { + pinctrl_nand: nand-0 { + atmel,pins = + ; /* PD5 gpio RDY/BUSY pin pull_up */ + }; + }; + + usb2 { + pinctrl_board_usb2: usb2-board { + atmel,pins = + ; /* PB11 gpio vbus sense, deglitch */ + }; + }; + }; + + dbgu: serial@fffff200 { + status = "okay"; + }; + + usart0: serial@f801c000 { + status = "okay"; + }; + + usart3: serial@f8028000 { + status = "okay"; + }; + + spi0: spi@f0000000 { + status = "okay"; + cs-gpios = <&pioA 14 0>, <&pioA 7 0>, <0>, <0>; + }; + + mmc0: mmc@f0008000 { + pinctrl-0 = < + &pinctrl_mmc0_slot0_clk_cmd_dat0 + &pinctrl_mmc0_slot0_dat1_3>; + status = "okay"; + /delete-property/dmas; + /delete-property/dma-names; + slot@0 { + reg = <0>; + bus-width = <4>; + }; + }; + + macb0: ethernet@f802c000 { + phy-mode = "rmii"; + status = "okay"; + }; + + usb2: gadget@f803c000 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_board_usb2>; + atmel,vbus-gpio = <&pioB 11 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + i2c1: i2c@f8014000 { + status = "okay"; + }; + + watchdog@fffffe40 { + status = "okay"; + }; + + shdwc@fffffe10 { + atmel,wakeup-mode = "low"; + }; + + rtc@fffffeb0 { + status = "okay"; + }; + }; + + usb0: ohci@00600000 { + status = "okay"; + num-ports = <2>; + atmel,vbus-gpio = < + &pioB 12 GPIO_ACTIVE_HIGH + &pioA 31 GPIO_ACTIVE_HIGH + >; + atmel,oc-gpio = <&pioB 13 GPIO_ACTIVE_LOW>; + }; + + usb1: ehci@00700000 { + status = "okay"; + }; + + nand0: nand@40000000 { + nand-bus-width = <8>; + nand-ecc-mode = "hw"; + atmel,has-pmecc; /* Enable PMECC */ + atmel,pmecc-cap = <4>; + atmel,pmecc-sector-size = <512>; + nand-on-flash-bbt; + status = "okay"; + + at91bootstrap@0 { + label = "at91bs"; + reg = <0x0 0x20000>; + }; + + uboot@20000 { + label = "u-boot"; + reg = <0x20000 0x80000>; + }; + + ubootenv@a0000 { + label = "u-boot-env"; + reg = <0xa0000 0x20000>; + }; + + ubootenv@c0000 { + label = "redund-env"; + reg = <0xc0000 0x20000>; + }; + + kernel-a@e0000 { + label = "kernel-a"; + reg = <0xe0000 0x280000>; + }; + + kernel-b@360000 { + label = "kernel-b"; + reg = <0x360000 0x280000>; + }; + + rootfs-a@5e0000 { + label = "rootfs-a"; + reg = <0x5e0000 0x2600000>; + }; + + rootfs-b@2be0000 { + label = "rootfs-b"; + reg = <0x2be0000 0x2600000>; + }; + + user@51e0000 { + label = "user"; + reg = <0x51e0000 0x2dc0000>; + }; + + logs@7fa0000 { + label = "logs"; + reg = <0x7fa0000 0x60000>; + }; + }; + }; + + atheros { + compatible = "atheros,ath6kl"; + atheros,board-id = "SD32"; + }; + + gpio_keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + irqbtn@pb18 { + label = "IRQBTN"; + linux,code = <99>; + gpios = <&pioB 18 GPIO_ACTIVE_LOW>; + gpio-key,wakeup = <1>; + }; + }; +}; diff --git a/target/linux/at91/files/arch/arm/boot/dts/wb50n.dts b/target/linux/at91/files/arch/arm/boot/dts/wb50n.dts new file mode 100644 index 0000000000..9c28a2197c --- /dev/null +++ b/target/linux/at91/files/arch/arm/boot/dts/wb50n.dts @@ -0,0 +1,117 @@ +/* + * wb50n.dts - Device Tree file for wb50n board + * + * Copyright (C) 2015 Laird + * + * Licensed under GPLv2 or later. + */ +/dts-v1/; +#include "wb50n.dtsi" + +/ { + model = "Laird Workgroup Bridge 50N - Atmel SAMA5D"; + compatible = "laird,wb50n", "atmel,sama5d31ek", "atmel,sama5d3xmb", "atmel,sama5d3xcm", "atmel,sama5d31", "atmel,sama5d3", "atmel,sama5"; + + chosen { + bootargs = "console=ttyS0,115200 earlyprintk loglevel=4 mem=64M"; + }; + + ahb { + + apb { + mmc0: mmc@f0000000 { + status = "okay"; + }; + + macb1: ethernet@f802c000 { + status = "okay"; + }; + + dbgu: serial@ffffee00 { + status = "okay"; + }; + + /* On BB40 this port is labeled UART1 */ + usart0: serial@f001c000 { + status = "okay"; + }; + + /* On BB40 this port is labeled UART0 */ + usart1: serial@f0020000 { + status = "okay"; + }; + + i2c0: i2c@f0014000 { + status = "okay"; + }; + + spi1: spi@f8008000 { + status = "okay"; + + spidev@0 { + compatible = "spidev"; + reg = <0>; + spi-max-frequency = <8000000>; + }; + }; + + watchdog@fffffe40 { + status = "okay"; + }; + }; + + usb0: gadget@00500000 { + status = "okay"; + }; + + usb1: ohci@00600000 { + status = "okay"; + }; + + usb2: ehci@00700000 { + status = "okay"; + }; + + }; + + gpio_keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + btn0@pa10 { + label = "BTNESC"; + linux,code = <1>; /* ESC button */ + gpios = <&pioA 10 GPIO_ACTIVE_LOW>; + gpio-key,wakeup = <1>; + }; + + irqbtn@pe31 { + label = "IRQBTN"; + linux,code = <99>; /* SysReq button */ + gpios = <&pioE 31 GPIO_ACTIVE_LOW>; + gpio-key,wakeup = <1>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led0 { + label = "wb50n:blue:led0"; + gpios = <&pioA 12 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + led1 { + label = "wb50n:green:led1"; + gpios = <&pioA 24 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + led2 { + label = "wb50n:red:led2"; + gpios = <&pioA 26 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + }; +}; diff --git a/target/linux/at91/files/arch/arm/boot/dts/wb50n.dtsi b/target/linux/at91/files/arch/arm/boot/dts/wb50n.dtsi new file mode 100644 index 0000000000..8d30424442 --- /dev/null +++ b/target/linux/at91/files/arch/arm/boot/dts/wb50n.dtsi @@ -0,0 +1,205 @@ +/* + * wb50n.dts - Device Tree file for wb50n board + * + * Copyright (C) 2015 Laird + * + * Licensed under GPLv2 or later. + */ +#include "sama5d31.dtsi" + +/ { + model = "Laird Workgroup Bridge 50N - Atmel SAMA5D"; + compatible = "laird,wb50n", "atmel,sama5d31ek", "atmel,sama5d3xmb", "atmel,sama5d3xcm", "atmel,sama5d31", "atmel,sama5d3", "atmel,sama5"; + + chosen { + bootargs = "console=ttyS0,115200 earlyprintk loglevel=4 mem=64M"; + }; + + memory { + reg = <0x20000000 0x4000000>; + }; + + clocks { + slow_xtal { + clock-frequency = <32768>; + }; + + main_xtal { + clock-frequency = <12000000>; + }; + }; + + ahb { + + apb { + pmc: pmc@fffffc00 { + main: mainck { + clock-frequency = <12000000>; + }; + + periphck { + usart1_clk: usart1_clk { + #clock-cells = <0>; + reg = <13>; + atmel,clk-output-range = <0 132000000>; + }; + }; + }; + + pinctrl@fffff200 { + board { + pinctrl_mmc0_cd: mmc0_cd { + atmel,pins = + ; /* PC26 GPIO with pullup deglitch */ + }; + + pinctrl_usba_vbus: usba_vbus { + atmel,pins = + ; /* PB13 GPIO with deglitch */ + }; + }; + }; + + mmc0: mmc@f0000000 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3 &pinctrl_mmc0_cd>; + cd-gpios = <&pioC 26 GPIO_ACTIVE_LOW>; + slot@0 { + reg = <0>; + bus-width = <4>; + }; + }; + + mmc1: mmc@f8000000 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3>; + status = "okay"; + slot@0 { + reg = <0>; + bus-width = <4>; + }; + }; + + macb1: ethernet@f802c000 { + phy-mode = "rmii"; + }; + + + dbgu: serial@ffffee00 { + dmas = <0>, <0>; /* Do not use DMA for dbgu */ + }; + + /* On BB40 this port is labeled UART1 */ + usart0: serial@f001c000 { + atmel,use-dma-rx; + atmel,use-dma-tx; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usart0 &pinctrl_usart0_rts_cts>; + }; + + /* On BB40 this port is labeled UART0 */ + usart1: serial@f0020000 { + atmel,use-dma-rx; + atmel,use-dma-tx; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usart1 &pinctrl_usart1_rts_cts>; + dtr-gpios = <&pioD 13 GPIO_ACTIVE_LOW>; + dsr-gpios = <&pioD 11 GPIO_ACTIVE_LOW>; + dcd-gpios = <&pioD 7 GPIO_ACTIVE_LOW>; + rng-gpios = <&pioD 8 GPIO_ACTIVE_LOW>; + }; + + /* USART3 is direct-connect to the Bluetooth UART on the radio SIP */ + usart3: serial@f8024000 { + atmel,use-dma-rx; + atmel,use-dma-tx; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usart3 &pinctrl_usart3_rts_cts>; + status = "okay"; + }; + + spi1: spi@f8008000 { + cs-gpios = <&pioC 25 0>, <0>, <0>, <0>; + }; + + sckc@fffffe50 { + slow_osc: slow_osc { + atmel,osc-bypass; + }; + }; + }; + + nand0: nand@60000000 { + nand-bus-width = <8>; + nand-ecc-mode = "hw"; + atmel,has-pmecc; + atmel,pmecc-cap = <8>; + atmel,pmecc-sector-size = <512>; + nand-on-flash-bbt; + status = "okay"; + + at91bootstrap@0 { + label = "at91bs"; + reg = <0x0 0x20000>; + }; + + uboot@20000 { + label = "u-boot"; + reg = <0x20000 0x80000>; + }; + + ubootenv@a0000 { + label = "u-boot-env"; + reg = <0xa0000 0x20000>; + }; + + ubootenv@c0000 { + label = "u-boot-env"; + reg = <0xc0000 0x20000>; + }; + + kernel-a@e0000 { + label = "kernel-a"; + reg = <0xe0000 0x500000>; + }; + + kernel-b@5e0000 { + label = "kernel-b"; + reg = <0x5e0000 0x500000>; + }; + + rootfs-a@ae0000 { + label = "rootfs-a"; + reg = <0xae0000 0x3000000>; + }; + + rootfs-b@3ae0000 { + label = "rootfs-b"; + reg = <0x3ae0000 0x3000000>; + }; + + user@6ae0000 { + label = "user"; + reg = <0x6ae0000 0x14e0000>; + }; + + }; + + usb0: gadget@00500000 { + atmel,vbus-gpio = <&pioB 13 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usba_vbus>; + }; + + usb1: ohci@00600000 { + num-ports = <3>; + atmel,vbus-gpio = <&pioA 2 GPIO_ACTIVE_LOW>; + atmel,oc-gpio = <&pioA 4 GPIO_ACTIVE_LOW>; + }; + }; + + atheros { + compatible = "atheros,ath6kl"; + atheros,board-id = "SD32"; + }; +}; diff --git a/target/linux/at91/files/drivers/mtd/at91part.c b/target/linux/at91/files/drivers/mtd/at91part.c deleted file mode 100644 index 31f3bbd69d..0000000000 --- a/target/linux/at91/files/drivers/mtd/at91part.c +++ /dev/null @@ -1,122 +0,0 @@ -/* - * - * Copyright (C) 2007 OpenWrt.org - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Atmel AT91 flash partition table. (Modified by Hamish Guthrie). - * Based on ar7 map by Felix Fietkau. - * - */ - -#include -#include - -#include -#include -#include -#include - -static struct mtd_partition at91_parts[6]; - -static int create_mtd_partitions(struct mtd_info *master, - struct mtd_partition **pparts, - unsigned long origin) -{ - unsigned int offset, len; - unsigned int pre_size = 0x42000, root_max = 0x362400; - unsigned char buf[512]; - struct squashfs_super_block *sb = (struct squashfs_super_block *) buf; - - printk("Parsing AT91 partition map...\n"); - - at91_parts[0].name = "loaders"; - at91_parts[0].offset = 0; - at91_parts[0].size = 0x21000; - at91_parts[0].mask_flags = MTD_WRITEABLE; - - at91_parts[1].name = "ubparams"; - at91_parts[1].offset = 0x21000; - at91_parts[1].size = 0x8400; - at91_parts[1].mask_flags = 0; - - at91_parts[2].name = "kernel"; - at91_parts[2].offset = pre_size; - at91_parts[2].size = 0; - at91_parts[2].mask_flags = 0; - - at91_parts[3].name = "rootfs"; - at91_parts[3].offset = 0; - at91_parts[3].size = 0; - at91_parts[3].mask_flags = 0; - - for(offset = pre_size; offset < root_max; offset += master->erasesize) { - - memset(&buf, 0xe5, sizeof(buf)); - - if (master->read(master, offset, sizeof(buf), &len, buf) || len != sizeof(buf)) - break; - - if (*((__u32 *) buf) == SQUASHFS_MAGIC) { - printk(KERN_INFO "%s: Filesystem type: squashfs, size=0x%x\n", - master->name, (u32) sb->bytes_used); - - at91_parts[3].size = sb->bytes_used; - at91_parts[3].offset = offset; - len = at91_parts[3].offset + at91_parts[3].size; - len = ((len / (master->erasesize * 8)) + 1) * master->erasesize * 8; - at91_parts[3].size = len - at91_parts[3].offset; - at91_parts[2].size = offset - at91_parts[2].offset; - break; - } - } - - if (at91_parts[3].size == 0) { - printk(KERN_NOTICE "%s: Couldn't find root filesystem\n", master->name); - return -1; - } - - at91_parts[4].name = "rootfs_data"; - at91_parts[4].offset = root_max; - at91_parts[4].size = master->size - root_max; - at91_parts[4].mask_flags = 0; - - at91_parts[5].name = "complete"; - at91_parts[5].offset = 0; - at91_parts[5].size = master->size; - at91_parts[5].mask_flags = 0; - - *pparts = at91_parts; - return 6; -} - -static struct mtd_part_parser at91_parser = { - .owner = THIS_MODULE, - .parse_fn = create_mtd_partitions, - .name = "at91part", -}; - -static int __init at91_parser_init(void) -{ - register_mtd_parser(&at91_parser); - - return 0; -} - -module_init(at91_parser_init); - -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Felix Fietkau, Eugene Konev, Hamish Guthrie"); -MODULE_DESCRIPTION("MTD partitioning for Atmel at91"); diff --git a/target/linux/at91/image/Makefile b/target/linux/at91/image/Makefile index d1ae61484a..12607073e4 100644 --- a/target/linux/at91/image/Makefile +++ b/target/linux/at91/image/Makefile @@ -11,24 +11,20 @@ KERNEL_LOADADDR := 0x20008000 ifeq ($(SUBTARGET),legacy) include ./legacy.mk -UBIFS_OPTS := -m 2048 -e 126KiB -c 2048 endif -ifeq ($(SUBTARGET),sama5d3) -include ./sama5d3.mk -UBIFS_OPTS := -m 2048 -e 124KiB -c 2048 +ifeq ($(SUBTARGET),sama5) +include ./sama5.mk endif define Device/Default + $(Device/default-nand) PROFILES := Default FILESYSTEMS := squashfs ubifs DEVICE_DTS := $(1) KERNEL_NAME := zImage KERNEL_SIZE := 4096k KERNEL := kernel-bin | append-dtb | lzma | uImage lzma - BLOCKSIZE := 128k - PAGESIZE := 2048 - SUBPAGESIZE := 512 - DTB_SIZE := + DTB_SIZE := 128k endef define Device/dtb @@ -42,13 +38,25 @@ define Device/evaluation IMAGE/root.ubi := append-ubi endef +define Device/evaluation-zImage + IMAGES += zImage + IMAGE/zImage := install-zImage +endef + define Device/evaluation-dtb $(Device/evaluation) $(Device/dtb) + $(Device/evaluation-zImage) IMAGES += dtb IMAGE/dtb := install-dtb endef +define Device/evaluation-fit + $(Device/evaluation) + KERNEL_SUFFIX := -fit-uImage.itb + KERNEL := kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb +endef + define Device/production UBINIZE_OPTS := -E 5 IMAGES := factory.bin @@ -58,7 +66,6 @@ endef define Device/production-dtb $(Device/production) $(Device/dtb) - DTB_SIZE := 128k IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) \ | append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi endef diff --git a/target/linux/at91/image/gen_at91_sdcard_img.sh b/target/linux/at91/image/gen_at91_sdcard_img.sh new file mode 100755 index 0000000000..316ecea2e4 --- /dev/null +++ b/target/linux/at91/image/gen_at91_sdcard_img.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +# +# Copyright (C) 2017 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +set -x +[ $# -eq 5 ] || { + echo "SYNTAX: $0 " + exit 1 +} + +OUTPUT="$1" +BOOTFS="$2" +ROOTFS="$3" +BOOTFSSIZE="$4" +ROOTFSSIZE="$5" + +head=4 +sect=2048 + +set `ptgen -o $OUTPUT -h $head -s $sect -l 1024 -t c -p ${BOOTFSSIZE}M -t 83 -p ${ROOTFSSIZE}M` + +BOOTOFFSET="$(($1 / 512))" +BOOTSIZE="$(($2 / 512))" +ROOTFSOFFSET="$(($3 / 512))" +ROOTFSSIZE="$(($4 / 512))" + +dd bs=512 if="$BOOTFS" of="$OUTPUT" seek="$BOOTOFFSET" conv=notrunc +dd bs=512 if="$ROOTFS" of="$OUTPUT" seek="$ROOTFSOFFSET" conv=notrunc diff --git a/target/linux/at91/image/legacy.mk b/target/linux/at91/image/legacy.mk index 7fe388135d..c6d9ed8108 100644 --- a/target/linux/at91/image/legacy.mk +++ b/target/linux/at91/image/legacy.mk @@ -1,3 +1,10 @@ +define Device/default-nand + BLOCKSIZE := 128k + PAGESIZE := 2048 + SUBPAGESIZE := 512 + MKUBIFS_OPTS := -m $$(PAGESIZE) -e 126KiB -c 2048 +endef + define Device/at91sam9263ek $(Device/evaluation-dtb) DEVICE_TITLE := Atmel AT91SAM9263-EK @@ -109,3 +116,18 @@ define Device/at91-q5xr5 KERNEL_SIZE := 2048k endef TARGET_DEVICES += at91-q5xr5 + +define Device/wb45n + $(Device/evaluation-fit) + DEVICE_TITLE := Laird WB45N + DEVICE_PACKAGES := \ + kmod-mmc-at91 kmod-ath6kl-sdio ath6k-firmware \ + kmod-usb-storage kmod-fs-vfat kmod-fs-msdos \ + kmod-leds-gpio + BLOCKSIZE := 128k + PAGESIZE := 2048 + SUBPAGESIZE := 2048 + MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 955 +endef +TARGET_DEVICES += wb45n + diff --git a/target/linux/at91/image/sama5.mk b/target/linux/at91/image/sama5.mk new file mode 100644 index 0000000000..b251d714dc --- /dev/null +++ b/target/linux/at91/image/sama5.mk @@ -0,0 +1,91 @@ +AT91_SD_BOOT_PARTSIZE:=64 +FAT32_BLOCK_SIZE:=1024 +FAT32_BLOCKS:=$(shell echo \ + $$(($(AT91_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE)))) + +define Build/at91-sdcard + rm -f $@.boot + mkfs.fat -C $@.boot $(FAT32_BLOCKS) + + mcopy -i $@.boot $(KDIR)/zImage ::zImage + + $(foreach dts,$(DEVICE_DTS), \ + mcopy -i $@.boot $(DTS_DIR)/$(dts).dtb \ + ::$(dts).dtb; \ + mcopy -i $@.boot \ + $(BIN_DIR)/u-boot-$(dts:at91-%=%)_mmc/u-boot.bin \ + ::u-boot.bin; \ + $(CP) $(BIN_DIR)/at91bootstrap-$(dts:at91-%=%)sd_uboot*/*.bin \ + $(BIN_DIR)/BOOT.bin; \ + mcopy -i $@.boot $(BIN_DIR)/BOOT.bin ::BOOT.bin;) + + ./gen_at91_sdcard_img.sh \ + $(dir $@)$(IMG_PREFIX)-$(DEVICE_NAME)-sdcard.img \ + $@.boot \ + $(KDIR)/root.ext4 \ + $(AT91_SD_BOOT_PARTSIZE) \ + $(CONFIG_TARGET_ROOTFS_PARTSIZE) + + gzip -nc9 $(dir $@)$(IMG_PREFIX)-$(DEVICE_NAME)-sdcard.img \ + > $(dir $@)$(IMG_PREFIX)-$(DEVICE_NAME)-sdcard.img.gz + + $(CP) $(dir $@)$(IMG_PREFIX)-$(DEVICE_NAME)-sdcard.img.gz \ + $(BIN_DIR)/ + + rm -f $(BIN_DIR)/BOOT.bin + rm -f $@.boot +endef + +define Device/evaluation-sdimage + IMAGES += sdcard.img.gz + IMAGE/sdcard.img.gz := at91-sdcard +endef + +define Device/default-nand + BLOCKSIZE := 128k + PAGESIZE := 2048 + SUBPAGESIZE := 2048 + MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 2048 +endef + +define Device/at91-sama5d3_xplained + $(Device/evaluation-dtb) + DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D3 Xplained + KERNEL_SIZE := 6144k + $(Device/evaluation-sdimage) +endef +TARGET_DEVICES += at91-sama5d3_xplained + +define Device/at91-sama5d2_xplained + $(Device/evaluation-dtb) + DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D2 Xplained + KERNEL_SIZE := 6144k + $(Device/evaluation-sdimage) +endef +TARGET_DEVICES += at91-sama5d2_xplained + +define Device/at91-sama5d4_xplained + $(Device/evaluation-dtb) + DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D4 Xplained + KERNEL_SIZE := 6144k + BLOCKSIZE := 256k + PAGESIZE := 4096 + SUBPAGESIZE := 2048 + MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB -c 2082 -x lzo + $(Device/evaluation-sdimage) +endef +TARGET_DEVICES += at91-sama5d4_xplained + +define Device/wb50n + $(Device/evaluation-fit) + DEVICE_TITLE := Laird WB50N + DEVICE_PACKAGES := \ + kmod-mmc-at91 kmod-ath6kl-sdio ath6k-firmware \ + kmod-usb-storage kmod-fs-vfat kmod-fs-msdos \ + kmod-leds-gpio + BLOCKSIZE := 128k + PAGESIZE := 2048 + SUBPAGESIZE := 2048 + MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 955 +endef +TARGET_DEVICES += wb50n diff --git a/target/linux/at91/image/sama5d3.mk b/target/linux/at91/image/sama5d3.mk deleted file mode 100644 index fb02ee1bc0..0000000000 --- a/target/linux/at91/image/sama5d3.mk +++ /dev/null @@ -1,8 +0,0 @@ -define Device/at91-sama5d3_xplained - $(Device/evaluation-dtb) - DEVICE_TITLE := Atmel AT91SAMA5D3XPLAINED - KERNEL_SIZE := 6144k - SUBPAGESIZE := 2048 -endef -TARGET_DEVICES += at91-sama5d3_xplained - diff --git a/target/linux/at91/legacy/config-default b/target/linux/at91/legacy/config-default index 12beb46f6a..e69de29bb2 100644 --- a/target/linux/at91/legacy/config-default +++ b/target/linux/at91/legacy/config-default @@ -1,33 +0,0 @@ -# CONFIG_ARCH_AT91RM9200 is not set -# CONFIG_ARCH_AT91SAM9260 is not set -# CONFIG_ARCH_AT91SAM9261 is not set -# CONFIG_ARCH_AT91SAM9263 is not set -# CONFIG_ARCH_AT91SAM9G10 is not set -# CONFIG_ARCH_AT91SAM9G20 is not set -# CONFIG_ARCH_AT91SAM9G45 is not set -# CONFIG_ARCH_AT91SAM9RL is not set -CONFIG_ARCH_AT91_NONE=y -CONFIG_ARM_L1_CACHE_SHIFT=5 -CONFIG_CPU_32v5=y -CONFIG_CPU_ABRT_EV5TJ=y -CONFIG_CPU_ARM926T=y -# CONFIG_CPU_CACHE_ROUND_ROBIN is not set -CONFIG_CPU_CACHE_VIVT=y -CONFIG_CPU_COPY_V4WB=y -CONFIG_CPU_CP15=y -CONFIG_CPU_CP15_MMU=y -# CONFIG_CPU_DCACHE_WRITETHROUGH is not set -# CONFIG_CPU_ICACHE_DISABLE is not set -CONFIG_CPU_PABRT_LEGACY=y -CONFIG_CPU_TLB_V4WBI=y -# CONFIG_SOC_AT91RM9200 is not set -CONFIG_SOC_AT91SAM9=y -CONFIG_SOC_AT91SAM9260=y -CONFIG_SOC_AT91SAM9261=y -CONFIG_SOC_AT91SAM9263=y -CONFIG_SOC_AT91SAM9G45=y -CONFIG_SOC_AT91SAM9N12=y -CONFIG_SOC_AT91SAM9RL=y -CONFIG_SOC_AT91SAM9X5=y -CONFIG_SOC_SAM_V4_V5=y -# CONFIG_SOC_SAM_V7 is not set diff --git a/target/linux/at91/patches-4.4/100-ARM-at91-build-dtb-for-LMU5000.patch b/target/linux/at91/patches-4.9/100-ARM-at91-build-dtb-for-LMU5000.patch similarity index 80% rename from target/linux/at91/patches-4.4/100-ARM-at91-build-dtb-for-LMU5000.patch rename to target/linux/at91/patches-4.9/100-ARM-at91-build-dtb-for-LMU5000.patch index aac5b3de53..2a64fb8a5c 100644 --- a/target/linux/at91/patches-4.4/100-ARM-at91-build-dtb-for-LMU5000.patch +++ b/target/linux/at91/patches-4.9/100-ARM-at91-build-dtb-for-LMU5000.patch @@ -1,6 +1,6 @@ --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -27,6 +27,7 @@ dtb-$(CONFIG_SOC_SAM_V4_V5) += \ +@@ -32,6 +32,7 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ usb_a9g20.dtb \ usb_a9g20_lpw.dtb \ at91sam9m10g45ek.dtb \ diff --git a/target/linux/at91/patches-4.4/101-ARM-at91-build-dtb-for-q5xr5.patch b/target/linux/at91/patches-4.9/101-ARM-at91-build-dtb-for-q5xr5.patch similarity index 81% rename from target/linux/at91/patches-4.4/101-ARM-at91-build-dtb-for-q5xr5.patch rename to target/linux/at91/patches-4.9/101-ARM-at91-build-dtb-for-q5xr5.patch index d6bf7ae41f..1cee5588a0 100644 --- a/target/linux/at91/patches-4.4/101-ARM-at91-build-dtb-for-q5xr5.patch +++ b/target/linux/at91/patches-4.9/101-ARM-at91-build-dtb-for-q5xr5.patch @@ -1,6 +1,6 @@ --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -35,6 +35,7 @@ dtb-$(CONFIG_SOC_SAM_V4_V5) += \ +@@ -40,6 +40,7 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ at91-ariettag25.dtb \ at91-cosino_mega2560.dtb \ at91-kizboxmini.dtb \ diff --git a/target/linux/at91/patches-4.9/102-ARM-at91-build-dtb-for-wb45n.patch b/target/linux/at91/patches-4.9/102-ARM-at91-build-dtb-for-wb45n.patch new file mode 100644 index 0000000000..aeb523a5b9 --- /dev/null +++ b/target/linux/at91/patches-4.9/102-ARM-at91-build-dtb-for-wb45n.patch @@ -0,0 +1,12 @@ +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -45,7 +45,8 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ + at91sam9g25ek.dtb \ + at91sam9g35ek.dtb \ + at91sam9x25ek.dtb \ +- at91sam9x35ek.dtb ++ at91sam9x35ek.dtb \ ++ wb45n.dtb + dtb-$(CONFIG_SOC_SAM_V7) += \ + at91-kizbox2.dtb \ + at91-sama5d2_xplained.dtb \ diff --git a/target/linux/at91/patches-4.9/103-ARM-at91-build-dtb-for-wb50n.patch b/target/linux/at91/patches-4.9/103-ARM-at91-build-dtb-for-wb50n.patch new file mode 100644 index 0000000000..a30a803c98 --- /dev/null +++ b/target/linux/at91/patches-4.9/103-ARM-at91-build-dtb-for-wb50n.patch @@ -0,0 +1,12 @@ +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -59,7 +59,8 @@ dtb-$(CONFIG_SOC_SAM_V7) += \ + at91-sama5d4_ma5d4evk.dtb \ + at91-sama5d4_xplained.dtb \ + at91-sama5d4ek.dtb \ +- at91-vinco.dtb ++ at91-vinco.dtb \ ++ wb50n.dtb + dtb-$(CONFIG_ARCH_ATLAS6) += \ + atlas6-evb.dtb + dtb-$(CONFIG_ARCH_ATLAS7) += \ diff --git a/target/linux/at91/sama5/config-default b/target/linux/at91/sama5/config-default new file mode 100644 index 0000000000..00d4cf930c --- /dev/null +++ b/target/linux/at91/sama5/config-default @@ -0,0 +1,52 @@ +# CONFIG_ARCH_MULTI_CPU_AUTO is not set +CONFIG_ARCH_MULTI_V6_V7=y +CONFIG_ARCH_MULTI_V7=y +CONFIG_ARM_HEAVY_MB=y +CONFIG_ARM_L1_CACHE_SHIFT=6 +CONFIG_ARM_L1_CACHE_SHIFT_6=y +# CONFIG_ARM_LPAE is not set +CONFIG_ARM_PATCH_IDIV=y +# CONFIG_ARM_THUMBEE is not set +CONFIG_ARM_VIRT_EXT=y +CONFIG_ATMEL_AIC5_IRQ=y +CONFIG_CACHE_L2X0=y +CONFIG_CPU_32v6K=y +CONFIG_CPU_32v7=y +CONFIG_CPU_ABRT_EV7=y +# CONFIG_CPU_BPREDICT_DISABLE is not set +CONFIG_CPU_CACHE_V7=y +CONFIG_CPU_CACHE_VIPT=y +CONFIG_CPU_COPY_V6=y +CONFIG_CPU_HAS_ASID=y +CONFIG_CPU_PABRT_V7=y +CONFIG_CPU_TLB_V7=y +CONFIG_CPU_V7=y +CONFIG_DCACHE_WORD_ACCESS=y +CONFIG_GENERIC_PINCONF=y +CONFIG_HAVE_ARCH_BITREVERSE=y +CONFIG_HAVE_ARM_SMCCC=y +CONFIG_HAVE_AT91_GENERATED_CLK=y +CONFIG_HAVE_AT91_H32MX=y +CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_HAVE_SMP=y +CONFIG_MIGHT_HAVE_CACHE_L2X0=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_IO_ACCESSORS=y +CONFIG_MMC_SDHCI_OF_AT91=y +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_OUTER_CACHE=y +CONFIG_OUTER_CACHE_SYNC=y +CONFIG_PINCTRL_AT91PIO4=y +CONFIG_PL310_ERRATA_588369=y +CONFIG_PL310_ERRATA_727915=y +CONFIG_PL310_ERRATA_753970=y +CONFIG_PL310_ERRATA_769419=y +CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC=y +CONFIG_SOC_SAMA5=y +CONFIG_SOC_SAMA5D2=y +CONFIG_SOC_SAMA5D3=y +CONFIG_SOC_SAMA5D4=y +CONFIG_SOC_SAM_V7=y +CONFIG_SPLIT_PTLOCK_CPUS=4 +# CONFIG_SWP_EMULATE is not set +# CONFIG_THUMB2_KERNEL is not set diff --git a/target/linux/at91/sama5/target.mk b/target/linux/at91/sama5/target.mk new file mode 100644 index 0000000000..8ff6c761a9 --- /dev/null +++ b/target/linux/at91/sama5/target.mk @@ -0,0 +1,11 @@ +BOARDNAME:=SAMA5 Xplained boards(Cortex-A5) +CPU_TYPE:=cortex-a5 +CPU_SUBTYPE:=neon-vfpv4 + +FEATURES+=fpu +DEFAULT_PACKAGES += kmod-usb2 + +define Target/Description + Build generic firmware for Microchip(Atmel AT91) SAMA5 MPU's + using the ARMv7 instruction set. +endef diff --git a/target/linux/at91/sama5d3/config-default b/target/linux/at91/sama5d3/config-default deleted file mode 100644 index 660e27e8aa..0000000000 --- a/target/linux/at91/sama5d3/config-default +++ /dev/null @@ -1,20 +0,0 @@ -# CONFIG_ARCH_MULTI_V4_V5 is not set -# CONFIG_ARCH_MULTI_V5 is not set -CONFIG_ARCH_MULTI_V7=y -# CONFIG_ARM_LPAE is not set -# CONFIG_ARM_THUMBEE is not set -# CONFIG_CPU_ICACHE_DISABLE is not set -# CONFIG_CPU_BPREDICT_DISABLE is not set -CONFIG_SOC_SAMA5=y -# CONFIG_SOC_SAM_V4_V5 is not set -CONFIG_SOC_SAM_V7=y -CONFIG_SOC_SAMA5D2=y -CONFIG_SOC_SAMA5D3=y -CONFIG_SOC_SAMA5D4=y -CONFIG_MACH_SAMA5_DT=y -CONFIG_PL310_ERRATA_588369=y -CONFIG_PL310_ERRATA_727915=y -CONFIG_PL310_ERRATA_753970=y -CONFIG_PL310_ERRATA_769419=y -# CONFIG_SWP_EMULATE is not set -# CONFIG_THUMB2_KERNEL is not set diff --git a/target/linux/at91/sama5d3/target.mk b/target/linux/at91/sama5d3/target.mk deleted file mode 100644 index 0319f4bf0d..0000000000 --- a/target/linux/at91/sama5d3/target.mk +++ /dev/null @@ -1,9 +0,0 @@ -BOARDNAME:=SAMA5D3 (Cortex-A5) -CPU_TYPE:=cortex-a5 - -DEFAULT_PACKAGES += kmod-usb2 - -define Target/Description - Build generic firmware for SAMA5D3 AT91 platforms - using the ARMv7 instruction set. -endef diff --git a/target/linux/bcm53xx/patches-4.4/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch b/target/linux/bcm53xx/patches-4.4/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch index 244a4a6586..91bb4fae11 100644 --- a/target/linux/bcm53xx/patches-4.4/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch +++ b/target/linux/bcm53xx/patches-4.4/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch @@ -13,7 +13,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/net/phy/b53/b53_common.c +++ b/drivers/net/phy/b53/b53_common.c -@@ -27,6 +27,7 @@ +@@ -28,6 +28,7 @@ #include #include #include @@ -21,7 +21,7 @@ Signed-off-by: Rafał Miłecki #include "b53_regs.h" #include "b53_priv.h" -@@ -1578,6 +1579,28 @@ static int b53_switch_init(struct b53_de +@@ -1579,6 +1580,28 @@ static int b53_switch_init(struct b53_de return ret; } diff --git a/target/linux/bcm53xx/patches-4.9/700-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch b/target/linux/bcm53xx/patches-4.9/700-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch index 244a4a6586..91bb4fae11 100644 --- a/target/linux/bcm53xx/patches-4.9/700-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch +++ b/target/linux/bcm53xx/patches-4.9/700-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch @@ -13,7 +13,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/net/phy/b53/b53_common.c +++ b/drivers/net/phy/b53/b53_common.c -@@ -27,6 +27,7 @@ +@@ -28,6 +28,7 @@ #include #include #include @@ -21,7 +21,7 @@ Signed-off-by: Rafał Miłecki #include "b53_regs.h" #include "b53_priv.h" -@@ -1578,6 +1579,28 @@ static int b53_switch_init(struct b53_de +@@ -1579,6 +1580,28 @@ static int b53_switch_init(struct b53_de return ret; } diff --git a/target/linux/brcm2708/base-files/etc/board.d/02_network b/target/linux/brcm2708/base-files/etc/board.d/02_network index 29bcf33e33..a9c947b65a 100755 --- a/target/linux/brcm2708/base-files/etc/board.d/02_network +++ b/target/linux/brcm2708/base-files/etc/board.d/02_network @@ -11,13 +11,15 @@ board_config_update board=$(board_name) case "$board" in -rpi-2-b |\ -rpi-3-b |\ -rpi-b |\ -rpi-b-plus) +raspberrypi,model-b |\ +raspberrypi,model-b-plus |\ +raspberrypi,model-b-rev2 |\ +raspberrypi,2-model-b |\ +raspberrypi,3-model-b) ucidef_set_interface_lan "eth0" ;; -rpi-zero-w) + +raspberrypi,model-zero-w) ucidef_set_interface_lan "wlan0" ;; esac diff --git a/target/linux/brcm2708/base-files/etc/diag.sh b/target/linux/brcm2708/base-files/etc/diag.sh index 6f5810ed58..ce0f591517 100644 --- a/target/linux/brcm2708/base-files/etc/diag.sh +++ b/target/linux/brcm2708/base-files/etc/diag.sh @@ -7,14 +7,13 @@ set_state() { case "$(board_name)" in - rpi-2-b |\ - rpi-b-plus) + raspberrypi,2-model-b |\ + raspberrypi,model-b-plus) status_led="led1" ;; - rpi-b |\ - rpi-cm |\ - rpi-zero |\ - rpi-zero-w) + raspberrypi,model-b |\ + raspberrypi,model-zero |\ + raspberrypi,model-zero-w) status_led="led0" ;; esac diff --git a/target/linux/brcm2708/base-files/lib/brcm2708.sh b/target/linux/brcm2708/base-files/lib/brcm2708.sh deleted file mode 100644 index 76e678ff97..0000000000 --- a/target/linux/brcm2708/base-files/lib/brcm2708.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -# Copyright (C) 2015-2016 OpenWrt.org -# Copyright (C) 2017 LEDE project - -ifname="" - -brcm2708_detect() { - local board_name model - - model=$(cat /proc/device-tree/model) - case "$model" in - "Raspberry Pi 2 Model B Rev"*) - board_name="rpi-2-b" - ;; - "Raspberry Pi 3 Model B Rev"*) - board_name="rpi-3-b" - ;; - "Raspberry Pi Compute Module Rev"*) - board_name="rpi-cm" - ;; - "Raspberry Pi Model B Plus Rev"* |\ - "Raspberry Pi Model B+ Rev"*) - board_name="rpi-b-plus" - ;; - "Raspberry Pi Model B Rev"*) - board_name="rpi-b" - ;; - "Raspberry Pi Zero Rev"*) - board_name="rpi-zero" - ;; - "Raspberry Pi Zero W Rev"*) - board_name="rpi-zero-w" - ;; - *) - board_name="unknown" - ;; - esac - - [ -e "/tmp/sysinfo" ] || mkdir -p "/tmp/sysinfo" - - echo "$board_name" > /tmp/sysinfo/board_name - echo "$model" > /tmp/sysinfo/model -} diff --git a/target/linux/brcm2708/base-files/lib/preinit/01_preinit_do_brcm2708.sh b/target/linux/brcm2708/base-files/lib/preinit/01_preinit_do_brcm2708.sh deleted file mode 100644 index 294364848d..0000000000 --- a/target/linux/brcm2708/base-files/lib/preinit/01_preinit_do_brcm2708.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# Copyright (C) 2015 OpenWrt.org - -do_brcm2708() { - . /lib/brcm2708.sh - - brcm2708_detect -} - -boot_hook_add preinit_main do_brcm2708 diff --git a/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708 b/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708 index 95497cc586..76eb5905e8 100644 --- a/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708 +++ b/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708 @@ -6,10 +6,11 @@ set_preinit_iface() { . /lib/functions.sh case "$(board_name)" in - rpi-2-b |\ - rpi-3-b |\ - rpi-b |\ - rpi-b-plus) + raspberrypi,2-model-b |\ + raspberrypi,3-model-b |\ + raspberrypi,model-b |\ + raspberrypi,model-b-plus |\ + raspberrypi,model-b-rev2) ifname=eth0 ;; esac diff --git a/target/linux/brcm2708/base-files/lib/upgrade/keep.d/platform b/target/linux/brcm2708/base-files/lib/upgrade/keep.d/platform new file mode 100644 index 0000000000..786796577d --- /dev/null +++ b/target/linux/brcm2708/base-files/lib/upgrade/keep.d/platform @@ -0,0 +1 @@ +/boot/config.txt diff --git a/target/linux/brcm2708/base-files/lib/upgrade/platform.sh b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh index 2f2aeb098e..b9cd8d282f 100644 --- a/target/linux/brcm2708/base-files/lib/upgrade/platform.sh +++ b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh @@ -1,32 +1,104 @@ -get_magic_at() { - local file="$1" - local pos="$2" - get_image "$file" | dd bs=1 count=2 skip="$pos" 2>/dev/null | hexdump -v -n 2 -e '1/1 "%02x"' -} +. /lib/functions.sh + +REQUIRE_IMAGE_METADATA=1 + +# copied from x86's platform.sh platform_check_image() { - local file="$1" - local magic + local diskdev partdev diff - magic=$(get_magic_at "$file" 510) - [ "$magic" != "55aa" ] && { - echo "Failed to verify MBR boot signature." + [ "$#" -gt 1 ] && return 1 + + export_bootdevice && export_partdevice diskdev -2 || { + echo "Unable to determine upgrade device" return 1 } + get_partitions "/dev/$diskdev" bootdisk + + #extract the boot sector from the image + get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b 2>/dev/null + + get_partitions /tmp/image.bs image + + #compare tables + diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)" + + rm -f /tmp/image.bs /tmp/partmap.bootdisk /tmp/partmap.image + + if [ -n "$diff" ]; then + echo "Partition layout has changed. Full image will be written." + ask_bool 0 "Abort" && exit 1 + return 0 + fi + return 0; } platform_do_upgrade() { + local diskdev partdev diff + + export_bootdevice && export_partdevice diskdev -2 || { + echo "Unable to determine upgrade device" + return 1 + } + sync - get_image "$1" | dd of=/dev/mmcblk0 bs=2M conv=fsync - sleep 1 + + if [ "$SAVE_PARTITIONS" = "1" ]; then + get_partitions "/dev/$diskdev" bootdisk + + #extract the boot sector from the image + get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b + + get_partitions /tmp/image.bs image + + #compare tables + diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)" + else + diff=1 + fi + + if [ -n "$diff" ]; then + get_image "$@" | dd of="/dev/$diskdev" bs=2M conv=fsync + + # Separate removal and addtion is necessary; otherwise, partition 1 + # will be missing if it overlaps with the old partition 2 + partx -d - "/dev/$diskdev" + partx -a - "/dev/$diskdev" + + return 0 + fi + + #iterate over each partition from the image and write it to the boot disk + while read part start size; do + # root is /dev/sd[a|b]2 and not /dev/sd[a|b] this causes some problem + # one of which is this offset, I'm not sure what's the best fix, so + # here's a WA. + let part=$((part - 2)) + if export_partdevice partdev $part; then + echo "Writing image to /dev/$partdev..." + get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync + else + echo "Unable to find partition $part device, skipped." + fi + done < /tmp/partmap.image + + #copy partition uuid + echo "Writing new UUID to /dev/$diskdev..." + get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync } platform_copy_config() { - mkdir -p /boot - [ -f /boot/kernel.img ] || mount -t vfat -o rw,noatime /dev/mmcblk0p1 /boot - cp -af "$CONF_TAR" /boot/ - sync - umount /boot + local partdev + + # Same as above /dev/sd[a|b]2 is root, so /boot is -1 + if export_partdevice partdev -1; then + mkdir -p /boot + [ -f /boot/kernel.img ] || mount -t vfat -o rw,noatime "/dev/$partdev" /boot + cp -af "$CONF_TAR" /boot/ + tar --directory / -xvf "$CONF_TAR" boot/config.txt + sync + unmount /boot + fi } diff --git a/target/linux/brcm2708/bcm2708/config-4.9 b/target/linux/brcm2708/bcm2708/config-4.9 index 0ab238c91c..dccf85fac3 100644 --- a/target/linux/brcm2708/bcm2708/config-4.9 +++ b/target/linux/brcm2708/bcm2708/config-4.9 @@ -312,7 +312,6 @@ CONFIG_PM_GENERIC_DOMAINS_SLEEP=y CONFIG_PM_SLEEP=y CONFIG_POWER_SUPPLY=y CONFIG_PRINTK_TIME=y -CONFIG_PROC_PAGE_MONITOR=y CONFIG_PWM=y CONFIG_PWM_BCM2835=y CONFIG_PWM_SYSFS=y diff --git a/target/linux/brcm2708/bcm2709/config-4.9 b/target/linux/brcm2708/bcm2709/config-4.9 index 5c0ab7ea7d..71884a5fa1 100644 --- a/target/linux/brcm2708/bcm2709/config-4.9 +++ b/target/linux/brcm2708/bcm2709/config-4.9 @@ -337,7 +337,6 @@ CONFIG_PM_SLEEP=y CONFIG_PM_SLEEP_SMP=y CONFIG_POWER_SUPPLY=y CONFIG_PRINTK_TIME=y -CONFIG_PROC_PAGE_MONITOR=y CONFIG_PWM=y CONFIG_PWM_BCM2835=y CONFIG_PWM_SYSFS=y diff --git a/target/linux/brcm2708/bcm2710/config-4.9 b/target/linux/brcm2708/bcm2710/config-4.9 index ae4a2c7bfc..d402f4b573 100644 --- a/target/linux/brcm2708/bcm2710/config-4.9 +++ b/target/linux/brcm2708/bcm2710/config-4.9 @@ -276,7 +276,6 @@ CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_WORK=y CONFIG_JBD2=y -# CONFIG_KASAN is not set # CONFIG_LCD_CLASS_DEVICE is not set CONFIG_LEDS_GPIO=y CONFIG_LEDS_TRIGGER_INPUT=y @@ -354,7 +353,6 @@ CONFIG_PM_SLEEP_SMP=y CONFIG_POWER_RESET=y CONFIG_POWER_SUPPLY=y CONFIG_PRINTK_TIME=y -CONFIG_PROC_PAGE_MONITOR=y CONFIG_PWM=y CONFIG_PWM_BCM2835=y CONFIG_PWM_SYSFS=y diff --git a/target/linux/brcm2708/image/Makefile b/target/linux/brcm2708/image/Makefile index 7909c6d814..9ea9a07a9d 100644 --- a/target/linux/brcm2708/image/Makefile +++ b/target/linux/brcm2708/image/Makefile @@ -50,13 +50,14 @@ define Device/Default FILESYSTEMS := ext4 KERNEL := kernel-bin | kernel-img KERNEL_IMG := kernel.img - IMAGES := sdcard.img - IMAGE/sdcard.img := boot-img | sdcard-img + IMAGES := sdcard.img.gz + IMAGE/sdcard.img.gz := boot-img | sdcard-img | gzip | append-metadata endef define Device/rpi DEVICE_TITLE := Raspberry Pi B/B+/CM/Zero/ZeroW DEVICE_DTS := bcm2708-rpi-b bcm2708-rpi-b-plus bcm2708-rpi-cm bcm2708-rpi-0-w + SUPPORTED_DEVICES := rpi-b rpi-b-plus rpi-cm rpi-zero rpi-zero-w raspberrypi,model-b raspberrypi,model-b-plus raspberrypi,compute-module-1 raspberrypi,model-b-rev2 raspberrypi,model-zero raspberrypi,model-zero-w endef ifeq ($(SUBTARGET),bcm2708) TARGET_DEVICES += rpi @@ -65,6 +66,7 @@ endif define Device/rpi-2 DEVICE_TITLE := Raspberry Pi 2B/3B/3CM DEVICE_DTS := bcm2709-rpi-2-b bcm2710-rpi-3-b bcm2710-rpi-cm3 + SUPPORTED_DEVICES := rpi-2-b rpi-3-b rpi-cm raspberrypi,2-model-b raspberrypi,3-model-b raspberrypi,compute-module-3 endef ifeq ($(SUBTARGET),bcm2709) TARGET_DEVICES += rpi-2 @@ -74,6 +76,7 @@ define Device/rpi-3 KERNEL_IMG := kernel8.img DEVICE_TITLE := Raspberry Pi 3B (64 bit) DEVICE_DTS := broadcom/bcm2710-rpi-3-b + SUPPORTED_DEVICES := rpi-3-b raspberrypi,3-model-b endef ifeq ($(SUBTARGET),bcm2710) TARGET_DEVICES += rpi-3 diff --git a/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch b/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch index 1932e3024d..8569e4a83d 100644 --- a/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch +++ b/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch @@ -696,7 +696,7 @@ Signed-off-by: Noralf Trønnes } --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -5042,7 +5042,7 @@ static void port_event(struct usb_hub *h +@@ -5054,7 +5054,7 @@ static void port_event(struct usb_hub *h if (portchange & USB_PORT_STAT_C_OVERCURRENT) { u16 status = 0, unused; diff --git a/target/linux/brcm2708/patches-4.9/950-0063-Improve-__copy_to_user-and-__copy_from_user-performa.patch b/target/linux/brcm2708/patches-4.9/950-0063-Improve-__copy_to_user-and-__copy_from_user-performa.patch index a7ce64ba38..016d48dd2c 100644 --- a/target/linux/brcm2708/patches-4.9/950-0063-Improve-__copy_to_user-and-__copy_from_user-performa.patch +++ b/target/linux/brcm2708/patches-4.9/950-0063-Improve-__copy_to_user-and-__copy_from_user-performa.patch @@ -65,7 +65,7 @@ Signed-off-by: Phil Elwell +__copy_from_user_std(void *to, const void __user *from, unsigned long n); + static inline unsigned long __must_check - __copy_from_user(void *to, const void __user *from, unsigned long n) + __arch_copy_from_user(void *to, const void __user *from, unsigned long n) { --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile diff --git a/target/linux/brcm2708/patches-4.9/960-add-rasbperrypi-compatible.patch b/target/linux/brcm2708/patches-4.9/960-add-rasbperrypi-compatible.patch new file mode 100644 index 0000000000..0be65916a3 --- /dev/null +++ b/target/linux/brcm2708/patches-4.9/960-add-rasbperrypi-compatible.patch @@ -0,0 +1,70 @@ +--- a/arch/arm/boot/dts/bcm2708-rpi-0-w.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-0-w.dts +@@ -3,6 +3,7 @@ + #include "bcm2708.dtsi" + + / { ++ compatible = "raspberrypi,model-zero-w", "brcm,bcm2835"; + model = "Raspberry Pi Zero W"; + }; + +--- a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts ++++ b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts +@@ -8,6 +8,7 @@ + #include "bcm283x-rpi-smsc9514.dtsi" + + / { ++ compatible = "raspberrypi,3-model-b", "brcm,bcm2837", "brcm,bcm2836"; + model = "Raspberry Pi 3 Model B"; + }; + +--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts ++++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +@@ -4,6 +4,7 @@ + #include "bcm283x-rpi-smsc9514.dtsi" + + / { ++ compatible = "raspberrypi,2-model-b", "brcm,bcm2836"; + model = "Raspberry Pi 2 Model B"; + }; + +--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts +@@ -4,6 +4,7 @@ + #include "bcm283x-rpi-smsc9512.dtsi" + + / { ++ compatible = "raspberrypi,model-b", "brcm,bcm2835"; + model = "Raspberry Pi Model B"; + }; + +--- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +@@ -4,6 +4,7 @@ + #include "bcm283x-rpi-smsc9514.dtsi" + + / { ++ compatible = "raspberrypi,model-b-plus", "brcm,bcm2835"; + model = "Raspberry Pi Model B+"; + }; + +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +@@ -3,6 +3,7 @@ + #include "bcm2708-rpi-cm.dtsi" + + / { ++ compatible = "raspberrypi,compute-module-1", "brcm,bcm2835"; + model = "Raspberry Pi Compute Module"; + }; + +--- a/arch/arm/boot/dts/bcm2710-rpi-cm3.dts ++++ b/arch/arm/boot/dts/bcm2710-rpi-cm3.dts +@@ -3,6 +3,7 @@ + #include "bcm2710.dtsi" + + / { ++ compatible = "raspberrypi,compute-module-3", "brcm,bcm2837", "brcm,bcm2836"; + model = "Raspberry Pi Compute Module 3"; + }; + diff --git a/target/linux/brcm47xx/base-files/etc/board.d/01_detect b/target/linux/brcm47xx/base-files/etc/board.d/01_detect index 04d13950a7..18604072f3 100755 --- a/target/linux/brcm47xx/base-files/etc/board.d/01_detect +++ b/target/linux/brcm47xx/base-files/etc/board.d/01_detect @@ -145,9 +145,9 @@ detect_by_model() { ;; "Asus RT-N12"* | \ - "Asus RT-N16"* | \ "Asus WL500GP V2" | \ "Buffalo WHR-G125" | \ + "D-Link DIR-330" | \ "Motorola WR850G" | \ "Siemens SE505 V2") ucidef_add_switch "switch0" \ @@ -165,6 +165,7 @@ detect_by_model() { "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0" ;; + "Asus RT-N16"* | \ "Linksys E3000 V1") ucidef_add_switch "switch0" \ "0:wan" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "8@eth0" diff --git a/target/linux/brcm47xx/image/Makefile b/target/linux/brcm47xx/image/Makefile index 8c681ac345..47f031b8b4 100644 --- a/target/linux/brcm47xx/image/Makefile +++ b/target/linux/brcm47xx/image/Makefile @@ -282,6 +282,14 @@ define Device/asus-wl-330ge endef TARGET_DEVICES += asus-wl-330ge +define Device/asus-wl-500gd + DEVICE_TITLE := Asus WL-500g Deluxe + DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) + $(Device/asus) + PRODUCTID := "WL500gx " +endef +TARGET_DEVICES += asus-wl-500gd + define Device/asus-wl-500gp-v1 DEVICE_TITLE := Asus WL-500gP v1 DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) @@ -701,14 +709,14 @@ define Device/linksys-e900-v1 endef TARGET_DEVICES += linksys-e900-v1 -define Device/linksys-e1000-v1-v2-v2.1 +define Device/linksys-e1000 DEVICE_TITLE := Linksys E1000 v1 v2 v2.1 DEVICE_PACKAGES := kmod-b43 $(Device/linksys) DEVICE_ID := E100 VERSION := 1.1.3 endef -TARGET_DEVICES += linksys-e1000-v1-v2-v2.1 +TARGET_DEVICES += linksys-e1000 define Device/linksys-e1200-v1 DEVICE_TITLE := Linksys E1200 v1 @@ -806,21 +814,21 @@ define Device/linksys-e4200-v1 endef TARGET_DEVICES += linksys-e4200-v1 -define Device/netgear-wgr614-v10_north-america +define Device/netgear-wgr614-v10-na DEVICE_TITLE := Netgear WGR614 v10 North America $(Device/netgear) NETGEAR_BOARD_ID := U12H139T01_NETGEAR NETGEAR_REGION := 2 endef -TARGET_DEVICES += netgear-wgr614-v10_north-america +TARGET_DEVICES += netgear-wgr614-v10-na -define Device/netgear-wgr614-v10_other-regions - DEVICE_TITLE := Netgear WGR614 v10 Other Regions +define Device/netgear-wgr614-v10 + DEVICE_TITLE := Netgear WGR614 v10 $(Device/netgear) NETGEAR_BOARD_ID := U12H139T01_NETGEAR NETGEAR_REGION := 1 endef -TARGET_DEVICES += netgear-wgr614-v10_other-regions +TARGET_DEVICES += netgear-wgr614-v10 define Device/netgear-wn2500rp-v1 DEVICE_TITLE := Netgear WN2500RP v1 @@ -910,23 +918,23 @@ define Device/netgear-wnr2000v2 endef TARGET_DEVICES += netgear-wnr2000v2 -define Device/netgear-wnr3500l-v1-north-america +define Device/netgear-wnr3500l-v1-na DEVICE_TITLE := Netgear WNR3500L v1 North America DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) $(Device/netgear) NETGEAR_BOARD_ID := U12H136T99_NETGEAR NETGEAR_REGION := 2 endef -TARGET_DEVICES += netgear-wnr3500l-v1-north-america +TARGET_DEVICES += netgear-wnr3500l-v1-na -define Device/netgear-wnr3500l-v1-other-regions +define Device/netgear-wnr3500l-v1 DEVICE_TITLE := Netgear WNR3500L v1 Other Regions DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) $(Device/netgear) NETGEAR_BOARD_ID := U12H136T99_NETGEAR NETGEAR_REGION := 1 endef -TARGET_DEVICES += netgear-wnr3500l-v1-other-regions +TARGET_DEVICES += netgear-wnr3500l-v1 define Device/netgear-wnr3500l-v2 DEVICE_TITLE := Netgear WNR3500L v2 diff --git a/target/linux/brcm47xx/image/lzma-loader/src/Makefile b/target/linux/brcm47xx/image/lzma-loader/src/Makefile index 3320e565d0..a08fc05b9f 100644 --- a/target/linux/brcm47xx/image/lzma-loader/src/Makefile +++ b/target/linux/brcm47xx/image/lzma-loader/src/Makefile @@ -18,7 +18,8 @@ # TEXT_START := 0x80001000 -BZ_TEXT_START := 0x80400000 +BZ_TEXT_START := 0x80600000 +BZ_STACK_START := 0x80700000 OBJCOPY := $(CROSS_COMPILE)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S @@ -28,9 +29,9 @@ CFLAGS = -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -Os \ -mabi=32 -march=mips32 -Wa,-32 -Wa,-march=mips32 -Wa,-mips32 -Wa,--trap CFLAGS += -DLOADADDR=$(TEXT_START) -D_LZMA_IN_CB -ASFLAGS = $(CFLAGS) -D__ASSEMBLY__ -DBZ_TEXT_START=$(BZ_TEXT_START) +ASFLAGS = $(CFLAGS) -D__ASSEMBLY__ -DBZ_TEXT_START=$(BZ_TEXT_START) -DBZ_STACK_START=$(BZ_STACK_START) -SEDFLAGS := s/BZ_TEXT_START/$(BZ_TEXT_START)/;s/TEXT_START/$(TEXT_START)/ +SEDFLAGS := s/BZ_TEXT_START/$(BZ_TEXT_START)/;s/BZ_STACK_START/$(BZ_STACK_START)/;s/TEXT_START/$(TEXT_START)/ OBJECTS := head.o data.o diff --git a/target/linux/brcm47xx/image/lzma-loader/src/head.S b/target/linux/brcm47xx/image/lzma-loader/src/head.S index 930c9ba277..50c159ce57 100644 --- a/target/linux/brcm47xx/image/lzma-loader/src/head.S +++ b/target/linux/brcm47xx/image/lzma-loader/src/head.S @@ -38,6 +38,7 @@ .text LEAF(startup) .set noreorder + li sp, BZ_STACK_START addi sp, -48 sw a0, 16(sp) sw a1, 20(sp) diff --git a/target/linux/brcm63xx/base-files/etc/board.d/01_leds b/target/linux/brcm63xx/base-files/etc/board.d/01_leds index ef70cde791..d25d37e847 100755 --- a/target/linux/brcm63xx/base-files/etc/board.d/01_leds +++ b/target/linux/brcm63xx/base-files/etc/board.d/01_leds @@ -15,6 +15,9 @@ a4001n1) a4001n) ucidef_set_led_usbdev "usb" "USB" "A4001N:green:usb" "1-1" ;; +ad1018-nor) + ucidef_set_led_netdev "wlan0" "WLAN" "AD1018:green:wifi" "wlan0" + ;; ar-5315u) ucidef_set_led_usbdev "usb" "USB" "AR-5315u:green:usb" "1-1" ;; diff --git a/target/linux/brcm63xx/base-files/etc/board.d/02_network b/target/linux/brcm63xx/base-files/etc/board.d/02_network index 9addba654a..06b4b6eced 100755 --- a/target/linux/brcm63xx/base-files/etc/board.d/02_network +++ b/target/linux/brcm63xx/base-files/etc/board.d/02_network @@ -98,6 +98,7 @@ vr-3026e) "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "8t@eth0" ;; +ad1018-nor|\ ar-5315u |\ vh4032n) ucidef_add_switch "switch0" \ diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh b/target/linux/brcm63xx/base-files/etc/diag.sh index 700c9ea85a..acb1795214 100644 --- a/target/linux/brcm63xx/base-files/etc/diag.sh +++ b/target/linux/brcm63xx/base-files/etc/diag.sh @@ -12,6 +12,9 @@ set_state() { a4001n) status_led="A4001N:green:power" ;; + ad1018-nor) + status_led="AD1018:green:power" + ;; ar-5315u) status_led="AR-5315u:green:power" ;; diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh index 3f46633fad..82abd737ce 100755 --- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh +++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh @@ -228,6 +228,9 @@ brcm63xx_dt_detect() { "Sagem F@ST2704V2") board_name="fast2704v2" ;; + "Sercomm AD1018 (SPI flash mod)") + board_name="ad1018-nor" + ;; "SFR Neuf Box 4"*) board_name="neufbox4" ;; diff --git a/target/linux/brcm63xx/config-4.4 b/target/linux/brcm63xx/config-4.4 index f74459be33..755590f537 100644 --- a/target/linux/brcm63xx/config-4.4 +++ b/target/linux/brcm63xx/config-4.4 @@ -47,6 +47,7 @@ CONFIG_BOARD_BCM963XX=y CONFIG_BOARD_LIVEBOX=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_CEVT_R4K=y +CONFIG_CLKDEV_LOOKUP=y CONFIG_CLONE_BACKWARDS=y CONFIG_CPU_BIG_ENDIAN=y CONFIG_CPU_BMIPS=y diff --git a/target/linux/brcm63xx/dts/a226g.dts b/target/linux/brcm63xx/dts/a226g.dts index f7a0b72b74..921e46c796 100644 --- a/target/linux/brcm63xx/dts/a226g.dts +++ b/target/linux/brcm63xx/dts/a226g.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -111,3 +112,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/a226m-fwb.dts b/target/linux/brcm63xx/dts/a226m-fwb.dts index 43a82bbe18..c21d06ec5b 100644 --- a/target/linux/brcm63xx/dts/a226m-fwb.dts +++ b/target/linux/brcm63xx/dts/a226m-fwb.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -111,3 +112,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/a226m.dts b/target/linux/brcm63xx/dts/a226m.dts index 269c4edea6..7c8bdabf71 100644 --- a/target/linux/brcm63xx/dts/a226m.dts +++ b/target/linux/brcm63xx/dts/a226m.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -111,3 +112,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/a4001n.dts b/target/linux/brcm63xx/dts/a4001n.dts index d29b834a3a..db835434d8 100644 --- a/target/linux/brcm63xx/dts/a4001n.dts +++ b/target/linux/brcm63xx/dts/a4001n.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -90,3 +91,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/a4001n1.dts b/target/linux/brcm63xx/dts/a4001n1.dts index 3254897302..ad1590d7a0 100644 --- a/target/linux/brcm63xx/dts/a4001n1.dts +++ b/target/linux/brcm63xx/dts/a4001n1.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -118,3 +119,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ad1018-nor.dts b/target/linux/brcm63xx/dts/ad1018-nor.dts new file mode 100644 index 0000000000..7a630a1856 --- /dev/null +++ b/target/linux/brcm63xx/dts/ad1018-nor.dts @@ -0,0 +1,141 @@ +/dts-v1/; + +#include "bcm6328.dtsi" + +#include + +/ { + model = "Sercomm AD1018 (SPI flash mod)"; + compatible = "sercomm,ad1018-nor", "brcm,bcm6328"; + + chosen { + bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + debounce-interval = <60>; + + wps { + label = "wps"; + gpios = <&pinctrl 24 1>; + linux,code = ; + }; + wifi { + label = "wifi"; + gpios = <&pinctrl 25 1>; + linux,code = ; + }; + reset { + label = "reset"; + gpios = <&pinctrl 31 1>; + linux,code = ; + }; + }; + +}; + +&pinctrl { + pinctrl_leds: leds { + function = "led"; + pins = "gpio0", "gpio1"; + }; +}; + +&leds { + status = "ok"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_leds &pinctrl_serial_led + &pinctrl_ephy0_spd_led &pinctrl_ephy1_act_led + &pinctrl_ephy2_act_led &pinctrl_ephy3_act_led>; + + brcm,serial-leds; + brcm,serial-shift-inv; + brcm,serial-dat-low; + + inet_red@0 { + reg = <0>; + active-low; + label = "AD1018:red:internet"; + }; + + inet_green@1 { + reg = <1>; + active-low; + label = "AD1018:green:internet"; + }; + + power_green@8 { + reg = <8>; + active-low; + label = "AD1018:green:power"; + default-state = "on"; + }; + + adsl_green@10 { + reg = <10>; + active-low; + label = "AD1018:green:adsl"; + }; + + adsl_red@11 { + reg = <11>; + active-low; + label = "AD1018:red:adsl"; + }; + + phone_green@12 { + reg = <12>; + active-low; + label = "AD1018:green:phone"; + }; + + wps_green@13 { + reg = <13>; + active-low; + label = "AD1018:green:wps"; + }; + + wifi_green@14 { + reg = <14>; + active-low; + label = "AD1018:green:wifi"; + }; + + usb_green@15 { + reg = <15>; + active-low; + label = "AD1018:green:usb"; + }; + + ephy0_spd@17 { + reg = <17>; + brcm,hardware-controlled; + }; +}; + +&hsspi { + status = "ok"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <16666667>; + spi-tx-bus-width = <2>; + spi-rx-bus-width = <2>; + reg = <0>; + + #address-cells = <1>; + #size-cells = <1>; + + linux,part-probe = "bcm63xxpart"; + }; +}; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/agpf-s0.dts b/target/linux/brcm63xx/dts/agpf-s0.dts index be1f9fb4f3..6ac3801c38 100644 --- a/target/linux/brcm63xx/dts/agpf-s0.dts +++ b/target/linux/brcm63xx/dts/agpf-s0.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -115,3 +116,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ar-5315u.dts b/target/linux/brcm63xx/dts/ar-5315u.dts index 63883f048b..e359fe4ebb 100644 --- a/target/linux/brcm63xx/dts/ar-5315u.dts +++ b/target/linux/brcm63xx/dts/ar-5315u.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -104,3 +105,7 @@ pinctrl-0 = <&pinctrl_ephy0_act_led &pinctrl_ephy1_act_led &pinctrl_ephy2_act_led &pinctrl_ephy3_act_led>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ar-5381u.dts b/target/linux/brcm63xx/dts/ar-5381u.dts index 883198c6b0..9da5b7e3cd 100644 --- a/target/linux/brcm63xx/dts/ar-5381u.dts +++ b/target/linux/brcm63xx/dts/ar-5381u.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -77,3 +78,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ar-5387un.dts b/target/linux/brcm63xx/dts/ar-5387un.dts index a0e07fb4fe..4dd71459fc 100644 --- a/target/linux/brcm63xx/dts/ar-5387un.dts +++ b/target/linux/brcm63xx/dts/ar-5387un.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -85,3 +86,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ar1004g.dts b/target/linux/brcm63xx/dts/ar1004g.dts index eb6d9a2b20..e7265f4d4b 100644 --- a/target/linux/brcm63xx/dts/ar1004g.dts +++ b/target/linux/brcm63xx/dts/ar1004g.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -71,3 +72,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ext_mii &pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/av4202n.dts b/target/linux/brcm63xx/dts/av4202n.dts index 4babd3b12e..ef61607882 100644 --- a/target/linux/brcm63xx/dts/av4202n.dts +++ b/target/linux/brcm63xx/dts/av4202n.dts @@ -11,6 +11,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -88,3 +89,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm3368.dtsi b/target/linux/brcm63xx/dts/bcm3368.dtsi index 29dae01d79..66cb6ab8a8 100644 --- a/target/linux/brcm63xx/dts/bcm3368.dtsi +++ b/target/linux/brcm63xx/dts/bcm3368.dtsi @@ -7,6 +7,8 @@ pflash = &pflash; gpio0 = &gpio0; gpio1 = &gpio1; + serial0 = &uart0; + serial1 = &uart1; spi0 = &lsspi; }; @@ -93,6 +95,32 @@ #gpio-cells = <2>; }; + uart0: serial@fff8c100 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfff8c100 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <2>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + + uart1: serial@fff8c120 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfff8c120 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <3>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@fff8c800 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6318.dtsi b/target/linux/brcm63xx/dts/bcm6318.dtsi index 7c4505157e..a902c1bd57 100644 --- a/target/linux/brcm63xx/dts/bcm6318.dtsi +++ b/target/linux/brcm63xx/dts/bcm6318.dtsi @@ -5,6 +5,7 @@ aliases { pinctrl = &pinctrl; + serial0 = &uart0; spi1 = &hsspi; }; @@ -166,6 +167,19 @@ }; }; + uart0: serial@10000100 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000100 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <28>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + leds: led-controller@10000200 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm63268.dtsi b/target/linux/brcm63xx/dts/bcm63268.dtsi index 94c7dd0138..1b4b3e6178 100644 --- a/target/linux/brcm63xx/dts/bcm63268.dtsi +++ b/target/linux/brcm63xx/dts/bcm63268.dtsi @@ -5,6 +5,8 @@ aliases { pinctrl = &pinctrl; + serial0 = &uart0; + serial1 = &uart1; spi0 = &lsspi; spi1 = &hsspi; }; @@ -193,6 +195,32 @@ }; }; + uart0: serial@10000180 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000180 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <5>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + + uart1: serial@100001a0 { + compatible = "brcm,bcm6345-uart"; + reg = <0x100001a0 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <34>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@10000800 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6328.dtsi b/target/linux/brcm63xx/dts/bcm6328.dtsi index 7a79aed26c..d08b6bab7a 100644 --- a/target/linux/brcm63xx/dts/bcm6328.dtsi +++ b/target/linux/brcm63xx/dts/bcm6328.dtsi @@ -5,6 +5,8 @@ aliases { pinctrl = &pinctrl; + serial0 = &uart0; + serial1 = &uart1; spi1 = &hsspi; }; @@ -151,6 +153,32 @@ }; }; + uart0: serial@10000100 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000100 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <28>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + + uart1: serial@10000120 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000120 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <39>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + leds: led-controller@10000800 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6338.dtsi b/target/linux/brcm63xx/dts/bcm6338.dtsi index 1811acfed8..3d1c068351 100644 --- a/target/linux/brcm63xx/dts/bcm6338.dtsi +++ b/target/linux/brcm63xx/dts/bcm6338.dtsi @@ -6,6 +6,7 @@ aliases { pflash = &pflash; gpio0 = &gpio0; + serial0 = &uart0; spi0 = &lsspi; }; @@ -79,6 +80,19 @@ ngpios = <8>; }; + uart0: serial@fffe0300 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfffe0300 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <2>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@fffe0c00 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6345.dtsi b/target/linux/brcm63xx/dts/bcm6345.dtsi index b16c132cea..7d5f79be35 100644 --- a/target/linux/brcm63xx/dts/bcm6345.dtsi +++ b/target/linux/brcm63xx/dts/bcm6345.dtsi @@ -5,6 +5,7 @@ aliases { pflash = &pflash; + serial0 = &uart0; gpio0 = &gpio0; }; @@ -67,6 +68,19 @@ interrupts = <3>, <4>, <5>, <6>; }; + uart0: serial@fffe0300 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfffe0300 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <2>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + gpio0: gpio-controller@fffe0404 { compatible = "brcm,bcm6345-gpio"; reg = <0xfffe0404 4>, <0xfffe0408 4>; diff --git a/target/linux/brcm63xx/dts/bcm6348.dtsi b/target/linux/brcm63xx/dts/bcm6348.dtsi index b6dafeeae3..f3e17be533 100644 --- a/target/linux/brcm63xx/dts/bcm6348.dtsi +++ b/target/linux/brcm63xx/dts/bcm6348.dtsi @@ -6,6 +6,7 @@ aliases { pflash = &pflash; pinctrl = &pinctrl; + serial0 = &uart0; spi0 = &lsspi; }; @@ -126,6 +127,19 @@ }; }; + uart0: serial@fffe0300 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfffe0300 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <2>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@fffe0c00 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6358.dtsi b/target/linux/brcm63xx/dts/bcm6358.dtsi index 8feb3dd61e..a78cdef373 100644 --- a/target/linux/brcm63xx/dts/bcm6358.dtsi +++ b/target/linux/brcm63xx/dts/bcm6358.dtsi @@ -6,6 +6,8 @@ aliases { pflash = &pflash; pinctrl = &pinctrl; + serial0 = &uart0; + serial1 = &uart1; spi0 = &lsspi; }; @@ -163,6 +165,32 @@ status = "disabled"; }; + uart0: serial@fffe0100 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfffe0100 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <2>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + + uart1: serial@fffe0120 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfffe0120 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <3>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@fffe0800 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6362.dtsi b/target/linux/brcm63xx/dts/bcm6362.dtsi index 076fc6a3ad..2ff5c52ad7 100644 --- a/target/linux/brcm63xx/dts/bcm6362.dtsi +++ b/target/linux/brcm63xx/dts/bcm6362.dtsi @@ -5,6 +5,8 @@ aliases { pinctrl = &pinctrl; + serial0 = &uart0; + serial1 = &uart1; spi0 = &lsspi; spi1 = &hsspi; }; @@ -237,6 +239,32 @@ }; }; + uart0: serial@10000100 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000100 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <3>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + + uart1: serial@10000120 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000120 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <4>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@10000800 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6368.dtsi b/target/linux/brcm63xx/dts/bcm6368.dtsi index 3efe76c6c7..b834f9ef0f 100644 --- a/target/linux/brcm63xx/dts/bcm6368.dtsi +++ b/target/linux/brcm63xx/dts/bcm6368.dtsi @@ -6,6 +6,8 @@ aliases { pflash = &pflash; pinctrl = &pinctrl; + serial0 = &uart0; + serial1 = &uart1; spi0 = &lsspi; }; @@ -270,6 +272,32 @@ status = "disabled"; }; + uart0: serial@10000100 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000100 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <2>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + + uart1: serial@10000120 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000120 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <3>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@10000800 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm96318ref.dts b/target/linux/brcm63xx/dts/bcm96318ref.dts index 5780ccba47..e48c0bf46e 100644 --- a/target/linux/brcm63xx/dts/bcm96318ref.dts +++ b/target/linux/brcm63xx/dts/bcm96318ref.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -73,3 +74,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb_pwron>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96318ref_p300.dts b/target/linux/brcm63xx/dts/bcm96318ref_p300.dts index 8fae7fa78a..db9d5eccd6 100644 --- a/target/linux/brcm63xx/dts/bcm96318ref_p300.dts +++ b/target/linux/brcm63xx/dts/bcm96318ref_p300.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -79,3 +80,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb_pwron>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm963268bu_p300.dts b/target/linux/brcm63xx/dts/bcm963268bu_p300.dts index a96bed7612..2bccb57a98 100644 --- a/target/linux/brcm63xx/dts/bcm963268bu_p300.dts +++ b/target/linux/brcm63xx/dts/bcm963268bu_p300.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -49,3 +50,7 @@ linux,part-probe = "bcm63xxpart"; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm963269bhr.dts b/target/linux/brcm63xx/dts/bcm963269bhr.dts index 4984f8fe76..d3c709877b 100644 --- a/target/linux/brcm63xx/dts/bcm963269bhr.dts +++ b/target/linux/brcm63xx/dts/bcm963269bhr.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -57,3 +58,7 @@ linux,part-probe = "bcm63xxpart"; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm963281TAN.dts b/target/linux/brcm63xx/dts/bcm963281TAN.dts index a1c5d7ad7f..d0d19a3550 100644 --- a/target/linux/brcm63xx/dts/bcm963281TAN.dts +++ b/target/linux/brcm63xx/dts/bcm963281TAN.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -59,3 +60,7 @@ linux,part-probe = "bcm63xxpart"; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96328avng.dts b/target/linux/brcm63xx/dts/bcm96328avng.dts index e74a60a1fc..d0d67880e4 100644 --- a/target/linux/brcm63xx/dts/bcm96328avng.dts +++ b/target/linux/brcm63xx/dts/bcm96328avng.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -64,3 +65,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb_port1_device>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96338GW.dts b/target/linux/brcm63xx/dts/bcm96338GW.dts index 7815962cd8..d6ff449d31 100644 --- a/target/linux/brcm63xx/dts/bcm96338GW.dts +++ b/target/linux/brcm63xx/dts/bcm96338GW.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -44,3 +45,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96338W.dts b/target/linux/brcm63xx/dts/bcm96338W.dts index 21190706e6..f91ca9a399 100644 --- a/target/linux/brcm63xx/dts/bcm96338W.dts +++ b/target/linux/brcm63xx/dts/bcm96338W.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -44,3 +45,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96345GW2.dts b/target/linux/brcm63xx/dts/bcm96345GW2.dts index 521f1b38a0..a7b3fad136 100644 --- a/target/linux/brcm63xx/dts/bcm96345GW2.dts +++ b/target/linux/brcm63xx/dts/bcm96345GW2.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; }; @@ -18,3 +19,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96348GW-10.dts b/target/linux/brcm63xx/dts/bcm96348GW-10.dts index d788057875..59850b5a10 100644 --- a/target/linux/brcm63xx/dts/bcm96348GW-10.dts +++ b/target/linux/brcm63xx/dts/bcm96348GW-10.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -63,3 +64,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96348GW-11.dts b/target/linux/brcm63xx/dts/bcm96348GW-11.dts index 9ef82e62a1..3caca09707 100644 --- a/target/linux/brcm63xx/dts/bcm96348GW-11.dts +++ b/target/linux/brcm63xx/dts/bcm96348GW-11.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -63,3 +64,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96348GW.dts b/target/linux/brcm63xx/dts/bcm96348GW.dts index d7511b0528..c213ac7a1f 100644 --- a/target/linux/brcm63xx/dts/bcm96348GW.dts +++ b/target/linux/brcm63xx/dts/bcm96348GW.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -63,3 +64,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96348R.dts b/target/linux/brcm63xx/dts/bcm96348R.dts index 3042693b06..b56869b3e4 100644 --- a/target/linux/brcm63xx/dts/bcm96348R.dts +++ b/target/linux/brcm63xx/dts/bcm96348R.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -49,3 +50,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96358VW.dts b/target/linux/brcm63xx/dts/bcm96358VW.dts index c2fe5b01b3..e097c0518e 100644 --- a/target/linux/brcm63xx/dts/bcm96358VW.dts +++ b/target/linux/brcm63xx/dts/bcm96358VW.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -44,3 +45,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96358VW2.dts b/target/linux/brcm63xx/dts/bcm96358VW2.dts index cc4a8b5812..5c242c2157 100644 --- a/target/linux/brcm63xx/dts/bcm96358VW2.dts +++ b/target/linux/brcm63xx/dts/bcm96358VW2.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -40,3 +41,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96368MVNgr.dts b/target/linux/brcm63xx/dts/bcm96368MVNgr.dts index 1078be713e..6c4ef091ac 100644 --- a/target/linux/brcm63xx/dts/bcm96368MVNgr.dts +++ b/target/linux/brcm63xx/dts/bcm96368MVNgr.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -49,3 +50,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96368MVWG.dts b/target/linux/brcm63xx/dts/bcm96368MVWG.dts index 0f7c42b3cb..ed1dd90160 100644 --- a/target/linux/brcm63xx/dts/bcm96368MVWG.dts +++ b/target/linux/brcm63xx/dts/bcm96368MVWG.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -49,3 +50,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/cpva502plus.dts b/target/linux/brcm63xx/dts/cpva502plus.dts index dbe7aae97c..6d8455e91c 100644 --- a/target/linux/brcm63xx/dts/cpva502plus.dts +++ b/target/linux/brcm63xx/dts/cpva502plus.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -67,3 +68,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/cpva642.dts b/target/linux/brcm63xx/dts/cpva642.dts index 108997df78..212bf6c32a 100644 --- a/target/linux/brcm63xx/dts/cpva642.dts +++ b/target/linux/brcm63xx/dts/cpva642.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -99,3 +100,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ct-5365.dts b/target/linux/brcm63xx/dts/ct-5365.dts index f0676497d7..ac3b80954f 100644 --- a/target/linux/brcm63xx/dts/ct-5365.dts +++ b/target/linux/brcm63xx/dts/ct-5365.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -81,3 +82,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ct-6373.dts b/target/linux/brcm63xx/dts/ct-6373.dts index 8ddcacb4d3..579b514f93 100644 --- a/target/linux/brcm63xx/dts/ct-6373.dts +++ b/target/linux/brcm63xx/dts/ct-6373.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -97,3 +98,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ct536plus.dts b/target/linux/brcm63xx/dts/ct536plus.dts index 8aa47575be..f9bc7e136c 100644 --- a/target/linux/brcm63xx/dts/ct536plus.dts +++ b/target/linux/brcm63xx/dts/ct536plus.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -67,3 +68,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/cvg834g.dts b/target/linux/brcm63xx/dts/cvg834g.dts index 519f1f53af..fa14c8bbd9 100644 --- a/target/linux/brcm63xx/dts/cvg834g.dts +++ b/target/linux/brcm63xx/dts/cvg834g.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -44,3 +45,11 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; + +&uart1 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dg834g_v4.dts b/target/linux/brcm63xx/dts/dg834g_v4.dts index 0af695d902..369a67c222 100644 --- a/target/linux/brcm63xx/dts/dg834g_v4.dts +++ b/target/linux/brcm63xx/dts/dg834g_v4.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -75,3 +76,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dg834gtpn.dts b/target/linux/brcm63xx/dts/dg834gtpn.dts index 84ef9b2c04..794c701dad 100644 --- a/target/linux/brcm63xx/dts/dg834gtpn.dts +++ b/target/linux/brcm63xx/dts/dg834gtpn.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -79,3 +80,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dgnd3700v1.dts b/target/linux/brcm63xx/dts/dgnd3700v1.dts index ea917e8f37..2d23f19b7a 100644 --- a/target/linux/brcm63xx/dts/dgnd3700v1.dts +++ b/target/linux/brcm63xx/dts/dgnd3700v1.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -169,3 +170,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dsl-2640b-b.dts b/target/linux/brcm63xx/dts/dsl-2640b-b.dts index fce774d321..df7f4adc07 100644 --- a/target/linux/brcm63xx/dts/dsl-2640b-b.dts +++ b/target/linux/brcm63xx/dts/dsl-2640b-b.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -75,3 +76,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dsl-2640u.dts b/target/linux/brcm63xx/dts/dsl-2640u.dts index 3b94a4abcb..8fea2acb25 100644 --- a/target/linux/brcm63xx/dts/dsl-2640u.dts +++ b/target/linux/brcm63xx/dts/dsl-2640u.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -54,3 +55,7 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dsl-2650u.dts b/target/linux/brcm63xx/dts/dsl-2650u.dts index 4b45151031..c9b189b8b0 100644 --- a/target/linux/brcm63xx/dts/dsl-2650u.dts +++ b/target/linux/brcm63xx/dts/dsl-2650u.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -56,3 +57,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dsl-274xb-c.dts b/target/linux/brcm63xx/dts/dsl-274xb-c.dts index fb67fc9851..3468dea8b3 100644 --- a/target/linux/brcm63xx/dts/dsl-274xb-c.dts +++ b/target/linux/brcm63xx/dts/dsl-274xb-c.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -74,3 +75,7 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dsl-274xb-f.dts b/target/linux/brcm63xx/dts/dsl-274xb-f.dts index be1d16b36d..00a5a9e99a 100644 --- a/target/linux/brcm63xx/dts/dsl-274xb-f.dts +++ b/target/linux/brcm63xx/dts/dsl-274xb-f.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -105,3 +106,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dsl-275xb-d.dts b/target/linux/brcm63xx/dts/dsl-275xb-d.dts index 9ac4ea1c26..d8f8c08e1e 100644 --- a/target/linux/brcm63xx/dts/dsl-275xb-d.dts +++ b/target/linux/brcm63xx/dts/dsl-275xb-d.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -119,3 +120,7 @@ pinctrl-0 = <&pinctrl_ephy0_act_led &pinctrl_ephy1_act_led &pinctrl_ephy2_act_led &pinctrl_ephy3_act_led>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dv-201amr.dts b/target/linux/brcm63xx/dts/dv-201amr.dts index e6955190f6..42a825f923 100644 --- a/target/linux/brcm63xx/dts/dv-201amr.dts +++ b/target/linux/brcm63xx/dts/dv-201amr.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; }; @@ -39,3 +40,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dva-g3810bn_tl.dts b/target/linux/brcm63xx/dts/dva-g3810bn_tl.dts index 4ebb25d01e..2945165ce1 100644 --- a/target/linux/brcm63xx/dts/dva-g3810bn_tl.dts +++ b/target/linux/brcm63xx/dts/dva-g3810bn_tl.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -74,3 +75,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/evg2000.dts b/target/linux/brcm63xx/dts/evg2000.dts index 07c98f11a0..10e0ddcc93 100644 --- a/target/linux/brcm63xx/dts/evg2000.dts +++ b/target/linux/brcm63xx/dts/evg2000.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -110,3 +111,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/f5d7633.dts b/target/linux/brcm63xx/dts/f5d7633.dts index 27e81a3e58..89c646b923 100644 --- a/target/linux/brcm63xx/dts/f5d7633.dts +++ b/target/linux/brcm63xx/dts/f5d7633.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -79,3 +80,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/fast2404.dts b/target/linux/brcm63xx/dts/fast2404.dts index ce52af6d42..c0a30a08ea 100644 --- a/target/linux/brcm63xx/dts/fast2404.dts +++ b/target/linux/brcm63xx/dts/fast2404.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; }; @@ -39,3 +40,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/fast2504n.dts b/target/linux/brcm63xx/dts/fast2504n.dts index 296bc0993d..8b644fb8f1 100644 --- a/target/linux/brcm63xx/dts/fast2504n.dts +++ b/target/linux/brcm63xx/dts/fast2504n.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -94,3 +95,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/fast2604.dts b/target/linux/brcm63xx/dts/fast2604.dts index 952b668118..14339408bc 100644 --- a/target/linux/brcm63xx/dts/fast2604.dts +++ b/target/linux/brcm63xx/dts/fast2604.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -75,3 +76,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/fast2704n.dts b/target/linux/brcm63xx/dts/fast2704n.dts index ee343a6334..217ef12d7c 100644 --- a/target/linux/brcm63xx/dts/fast2704n.dts +++ b/target/linux/brcm63xx/dts/fast2704n.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -119,3 +120,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/fast2704v2.dts b/target/linux/brcm63xx/dts/fast2704v2.dts index bbd23da361..eeed6b1dae 100644 --- a/target/linux/brcm63xx/dts/fast2704v2.dts +++ b/target/linux/brcm63xx/dts/fast2704v2.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -103,3 +104,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/gw6000.dts b/target/linux/brcm63xx/dts/gw6000.dts index 5645ae0a8c..31555b3ad2 100644 --- a/target/linux/brcm63xx/dts/gw6000.dts +++ b/target/linux/brcm63xx/dts/gw6000.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -53,3 +54,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/gw6200.dts b/target/linux/brcm63xx/dts/gw6200.dts index 3e0037a868..acc100c747 100644 --- a/target/linux/brcm63xx/dts/gw6200.dts +++ b/target/linux/brcm63xx/dts/gw6200.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -74,3 +75,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg520v.dts b/target/linux/brcm63xx/dts/hg520v.dts index f0eefc0c0f..bfd30693c0 100644 --- a/target/linux/brcm63xx/dts/hg520v.dts +++ b/target/linux/brcm63xx/dts/hg520v.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -57,3 +58,7 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg553.dts b/target/linux/brcm63xx/dts/hg553.dts index a00821fb15..a459976c4d 100644 --- a/target/linux/brcm63xx/dts/hg553.dts +++ b/target/linux/brcm63xx/dts/hg553.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -96,3 +97,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg556a-a.dts b/target/linux/brcm63xx/dts/hg556a-a.dts index de17500ceb..906ee611b9 100644 --- a/target/linux/brcm63xx/dts/hg556a-a.dts +++ b/target/linux/brcm63xx/dts/hg556a-a.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -128,3 +129,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg556a-b.dts b/target/linux/brcm63xx/dts/hg556a-b.dts index 782beda982..4285e17bcb 100644 --- a/target/linux/brcm63xx/dts/hg556a-b.dts +++ b/target/linux/brcm63xx/dts/hg556a-b.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -128,3 +129,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg556a-c.dts b/target/linux/brcm63xx/dts/hg556a-c.dts index 36f298be64..48c601e128 100644 --- a/target/linux/brcm63xx/dts/hg556a-c.dts +++ b/target/linux/brcm63xx/dts/hg556a-c.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -123,3 +124,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg622.dts b/target/linux/brcm63xx/dts/hg622.dts index f96af2bf26..419439d027 100644 --- a/target/linux/brcm63xx/dts/hg622.dts +++ b/target/linux/brcm63xx/dts/hg622.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; @@ -84,3 +85,7 @@ &pinctrl_pci_intb &pinctrl_pci_gnt1 &pinctrl_pci_req1>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg655b.dts b/target/linux/brcm63xx/dts/hg655b.dts index 63e13090ce..0336a633e4 100644 --- a/target/linux/brcm63xx/dts/hg655b.dts +++ b/target/linux/brcm63xx/dts/hg655b.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -105,3 +106,7 @@ pinctrl-0 = <&pinctrl_pci &pinctrl_ephy0_led &pinctrl_ephy1_led &pinctrl_ephy2_led &pinctrl_ephy3_led>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/homehub2a.dts b/target/linux/brcm63xx/dts/homehub2a.dts index 6192687d1b..1f55265bcc 100644 --- a/target/linux/brcm63xx/dts/homehub2a.dts +++ b/target/linux/brcm63xx/dts/homehub2a.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -155,3 +156,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/livebox-blue-5g.dts b/target/linux/brcm63xx/dts/livebox-blue-5g.dts index 8a060736c9..10a88669bd 100644 --- a/target/linux/brcm63xx/dts/livebox-blue-5g.dts +++ b/target/linux/brcm63xx/dts/livebox-blue-5g.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -75,3 +76,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/magic.dts b/target/linux/brcm63xx/dts/magic.dts index 9053c26e65..c78b836dff 100644 --- a/target/linux/brcm63xx/dts/magic.dts +++ b/target/linux/brcm63xx/dts/magic.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -79,3 +80,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/nb4-fxc-r1.dts b/target/linux/brcm63xx/dts/nb4-fxc-r1.dts index e11ec4678d..9d341ec1a2 100644 --- a/target/linux/brcm63xx/dts/nb4-fxc-r1.dts +++ b/target/linux/brcm63xx/dts/nb4-fxc-r1.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -103,3 +104,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/nb4-ser-r0.dts b/target/linux/brcm63xx/dts/nb4-ser-r0.dts index 8a33c66015..e97d9f219d 100644 --- a/target/linux/brcm63xx/dts/nb4-ser-r0.dts +++ b/target/linux/brcm63xx/dts/nb4-ser-r0.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -103,3 +104,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/nb6-ser-r0.dts b/target/linux/brcm63xx/dts/nb6-ser-r0.dts index 8fb434f344..70d719e1e3 100644 --- a/target/linux/brcm63xx/dts/nb6-ser-r0.dts +++ b/target/linux/brcm63xx/dts/nb6-ser-r0.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -82,3 +83,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/p870hw-51a-v2.dts b/target/linux/brcm63xx/dts/p870hw-51a-v2.dts index eea30219e0..d7e5d3e3f6 100644 --- a/target/linux/brcm63xx/dts/p870hw-51a-v2.dts +++ b/target/linux/brcm63xx/dts/p870hw-51a-v2.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -84,3 +85,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/r1000h.dts b/target/linux/brcm63xx/dts/r1000h.dts index 37cfa15dad..299b520a67 100644 --- a/target/linux/brcm63xx/dts/r1000h.dts +++ b/target/linux/brcm63xx/dts/r1000h.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -91,3 +92,11 @@ reg = <0x1fe0000 0x20000>; }; }; + +&uart0 { + status = "ok"; +}; + +&uart1 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/r5010unv2.dts b/target/linux/brcm63xx/dts/r5010unv2.dts index 0bd88b2e44..c0b0a85c47 100644 --- a/target/linux/brcm63xx/dts/r5010unv2.dts +++ b/target/linux/brcm63xx/dts/r5010unv2.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; @@ -99,3 +100,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/rg100a.dts b/target/linux/brcm63xx/dts/rg100a.dts index e96e310fd3..871aada252 100644 --- a/target/linux/brcm63xx/dts/rg100a.dts +++ b/target/linux/brcm63xx/dts/rg100a.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -56,3 +57,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/rta1025w.dts b/target/linux/brcm63xx/dts/rta1025w.dts index 16c3abf854..e4de95dbe4 100644 --- a/target/linux/brcm63xx/dts/rta1025w.dts +++ b/target/linux/brcm63xx/dts/rta1025w.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; }; @@ -39,3 +40,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/rta1320.dts b/target/linux/brcm63xx/dts/rta1320.dts index 6dbf0a5a91..aedc9d30f6 100644 --- a/target/linux/brcm63xx/dts/rta1320.dts +++ b/target/linux/brcm63xx/dts/rta1320.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -56,3 +57,7 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/rta770bw.dts b/target/linux/brcm63xx/dts/rta770bw.dts index bb92d1ec0b..0f71467589 100644 --- a/target/linux/brcm63xx/dts/rta770bw.dts +++ b/target/linux/brcm63xx/dts/rta770bw.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -72,3 +73,7 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/rta770w.dts b/target/linux/brcm63xx/dts/rta770w.dts index 7cefa5008d..ce9f0be377 100644 --- a/target/linux/brcm63xx/dts/rta770w.dts +++ b/target/linux/brcm63xx/dts/rta770w.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -72,3 +73,7 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/spw303v.dts b/target/linux/brcm63xx/dts/spw303v.dts index 0040540a49..7a0002023f 100644 --- a/target/linux/brcm63xx/dts/spw303v.dts +++ b/target/linux/brcm63xx/dts/spw303v.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -83,3 +84,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/spw500v.dts b/target/linux/brcm63xx/dts/spw500v.dts index a9603b3889..c7a4c7dfd2 100644 --- a/target/linux/brcm63xx/dts/spw500v.dts +++ b/target/linux/brcm63xx/dts/spw500v.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -79,3 +80,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/td-w8900gb.dts b/target/linux/brcm63xx/dts/td-w8900gb.dts index b52670b9bb..e5c02e63ae 100644 --- a/target/linux/brcm63xx/dts/td-w8900gb.dts +++ b/target/linux/brcm63xx/dts/td-w8900gb.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -79,3 +80,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/usr9108.dts b/target/linux/brcm63xx/dts/usr9108.dts index 81af20bcd1..4852d65ad3 100644 --- a/target/linux/brcm63xx/dts/usr9108.dts +++ b/target/linux/brcm63xx/dts/usr9108.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -52,3 +53,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/v2110.dts b/target/linux/brcm63xx/dts/v2110.dts index 23378a4721..93a5d94436 100644 --- a/target/linux/brcm63xx/dts/v2110.dts +++ b/target/linux/brcm63xx/dts/v2110.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -78,3 +79,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/v2500v-bb.dts b/target/linux/brcm63xx/dts/v2500v-bb.dts index b6370ee1c6..d6b5964f8c 100644 --- a/target/linux/brcm63xx/dts/v2500v-bb.dts +++ b/target/linux/brcm63xx/dts/v2500v-bb.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -78,3 +79,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/vg50.dts b/target/linux/brcm63xx/dts/vg50.dts index 2180802db3..f1d48ea3c1 100644 --- a/target/linux/brcm63xx/dts/vg50.dts +++ b/target/linux/brcm63xx/dts/vg50.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -49,3 +50,7 @@ linux,part-probe = "bcm63xxpart"; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/vh4032n.dts b/target/linux/brcm63xx/dts/vh4032n.dts index 1b646ce5c5..78a708ac06 100644 --- a/target/linux/brcm63xx/dts/vh4032n.dts +++ b/target/linux/brcm63xx/dts/vh4032n.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -100,3 +101,7 @@ reg = <0x1fe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/vr-3025u.dts b/target/linux/brcm63xx/dts/vr-3025u.dts index 2c53f516b7..fd2a567693 100644 --- a/target/linux/brcm63xx/dts/vr-3025u.dts +++ b/target/linux/brcm63xx/dts/vr-3025u.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -80,3 +81,7 @@ pinctrl-0 = <&pinctrl_pci &pinctrl_ephy0_led &pinctrl_ephy1_led &pinctrl_ephy2_led &pinctrl_ephy3_led>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/vr-3025un.dts b/target/linux/brcm63xx/dts/vr-3025un.dts index f9aed51755..61e1972519 100644 --- a/target/linux/brcm63xx/dts/vr-3025un.dts +++ b/target/linux/brcm63xx/dts/vr-3025un.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -80,3 +81,7 @@ pinctrl-0 = <&pinctrl_pci &pinctrl_ephy0_led &pinctrl_ephy1_led &pinctrl_ephy2_led &pinctrl_ephy3_led>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/vr-3026e.dts b/target/linux/brcm63xx/dts/vr-3026e.dts index da75df8a1e..01cb98817a 100644 --- a/target/linux/brcm63xx/dts/vr-3026e.dts +++ b/target/linux/brcm63xx/dts/vr-3026e.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -80,3 +81,7 @@ pinctrl-0 = <&pinctrl_pci &pinctrl_ephy0_led &pinctrl_ephy1_led &pinctrl_ephy2_led &pinctrl_ephy3_led>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/wap-5813n.dts b/target/linux/brcm63xx/dts/wap-5813n.dts index 8b47b200bd..1a71426caf 100644 --- a/target/linux/brcm63xx/dts/wap-5813n.dts +++ b/target/linux/brcm63xx/dts/wap-5813n.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -141,3 +142,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/image/bcm63xx.mk b/target/linux/brcm63xx/image/bcm63xx.mk index 6ad15a25e7..918dfc7981 100644 --- a/target/linux/brcm63xx/image/bcm63xx.mk +++ b/target/linux/brcm63xx/image/bcm63xx.mk @@ -971,6 +971,18 @@ define Device/FAST2704V2 endef TARGET_DEVICES += FAST2704V2 +### Sercomm ### +define Device/AD1018-SPI_flash + $(Device/bcm63xx) + DEVICE_TITLE := Sercomm AD1018 (SPI flash mod) + DEVICE_DTS := ad1018-nor + CFE_BOARD_ID := 96328avngr + CFE_CHIP_ID := 6328 + DEVICE_PACKAGES := \ + $(B43_PACKAGES) $(USB2_PACKAGES) +endef +TARGET_DEVICES += AD1018-SPI_flash + ### SFR ### define Device/NEUFBOX4-SER $(Device/bcm63xx) @@ -978,7 +990,7 @@ define Device/NEUFBOX4-SER DEVICE_DTS := nb4-ser-r0 CFE_BOARD_ID := 96358VW CFE_CHIP_ID := 6358 - CFE_EXTRAS += --rsa-signature "LEDE-$(firstword $(subst -,$(space),$(REVISION)))" + CFE_EXTRAS += --rsa-signature "OpenWrt-$(firstword $(subst -,$(space),$(REVISION)))" DEVICE_PACKAGES := \ $(B43_PACKAGES) $(USB2_PACKAGES) endef @@ -990,7 +1002,7 @@ define Device/NEUFBOX4-FXC DEVICE_DTS := nb4-fxc-r1 CFE_BOARD_ID := 96358VW CFE_CHIP_ID := 6358 - CFE_EXTRAS += --rsa-signature "LEDE-$(firstword $(subst -,$(space),$(REVISION)))" + CFE_EXTRAS += --rsa-signature "OpenWrt-$(firstword $(subst -,$(space),$(REVISION)))" DEVICE_PACKAGES := \ $(B43_PACKAGES) $(USB2_PACKAGES) endef @@ -1002,7 +1014,7 @@ define Device/NEUFBOX6 DEVICE_DTS := nb6-ser-r0 CFE_BOARD_ID := NB6-SER-r0 CFE_CHIP_ID := 6362 - CFE_EXTRAS += --rsa-signature "LEDE-$(firstword $(subst -,$(space),$(REVISION)))" + CFE_EXTRAS += --rsa-signature "OpenWrt-$(firstword $(subst -,$(space),$(REVISION)))" DEVICE_PACKAGES := \ $(B43_PACKAGES) $(USB2_PACKAGES) endef diff --git a/target/linux/brcm63xx/patches-4.4/000-4.5-03-mtd-nand-spi-nor-assign-MTD-of_node.patch b/target/linux/brcm63xx/patches-4.4/000-4.5-03-mtd-nand-spi-nor-assign-MTD-of_node.patch index 14eaca3546..6b0a12132e 100644 --- a/target/linux/brcm63xx/patches-4.4/000-4.5-03-mtd-nand-spi-nor-assign-MTD-of_node.patch +++ b/target/linux/brcm63xx/patches-4.4/000-4.5-03-mtd-nand-spi-nor-assign-MTD-of_node.patch @@ -15,7 +15,7 @@ Reviewed-by: Boris Brezillon --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c -@@ -3989,6 +3989,9 @@ int nand_scan_ident(struct mtd_info *mtd +@@ -3992,6 +3992,9 @@ int nand_scan_ident(struct mtd_info *mtd int ret; if (chip->flash_node) { diff --git a/target/linux/brcm63xx/patches-4.4/000-4.8-11-serial-bcm63xx_uart-use-correct-alias-naming.patch b/target/linux/brcm63xx/patches-4.4/000-4.8-11-serial-bcm63xx_uart-use-correct-alias-naming.patch new file mode 100644 index 0000000000..9f4e21aab5 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/000-4.8-11-serial-bcm63xx_uart-use-correct-alias-naming.patch @@ -0,0 +1,37 @@ +From a59388668d0ce19dadea909e09f4eb905a27b1ce Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Wed, 8 Jun 2016 12:08:43 +0200 +Subject: [PATCH] serial/bcm63xx_uart: use correct alias naming + +The bcm63xx_uart driver uses the of alias for determing its id. Recent +changes in dts files changed the expected 'uartX' to the recommended +'serialX', breaking serial output. Fix this by checking for a 'serialX' +alias as well. + +Fixes: e3b992d028f8 ("MIPS: BMIPS: Improve BCM6328 device tree") +Fixes: 2d52ee82b475 ("MIPS: BMIPS: Improve BCM6368 device tree") +Fixes: 7537d273e2f3 ("MIPS: BMIPS: Add device tree example for BCM6358") +Signed-off-by: Jonas Gorski +Acked-by: Florian Fainelli +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/bcm63xx_uart.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/drivers/tty/serial/bcm63xx_uart.c ++++ b/drivers/tty/serial/bcm63xx_uart.c +@@ -813,8 +813,12 @@ static int bcm_uart_probe(struct platfor + struct clk *clk; + int ret; + +- if (pdev->dev.of_node) +- pdev->id = of_alias_get_id(pdev->dev.of_node, "uart"); ++ if (pdev->dev.of_node) { ++ pdev->id = of_alias_get_id(pdev->dev.of_node, "serial"); ++ ++ if (pdev->id < 0) ++ pdev->id = of_alias_get_id(pdev->dev.of_node, "uart"); ++ } + + if (pdev->id < 0 || pdev->id >= BCM63XX_NR_UARTS) + return -EINVAL; diff --git a/target/linux/brcm63xx/patches-4.4/001-4.12-07-mdio_bus-Issue-GPIO-RESET-to-PHYs.patch b/target/linux/brcm63xx/patches-4.4/001-4.12-07-mdio_bus-Issue-GPIO-RESET-to-PHYs.patch new file mode 100644 index 0000000000..aa813f3d98 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.12-07-mdio_bus-Issue-GPIO-RESET-to-PHYs.patch @@ -0,0 +1,192 @@ +From 69226896ad636b94f6d2e55d75ff21a29c4de83b Mon Sep 17 00:00:00 2001 +From: Roger Quadros +Date: Fri, 21 Apr 2017 16:15:38 +0300 +Subject: [PATCH] mdio_bus: Issue GPIO RESET to PHYs. + +Some boards [1] leave the PHYs at an invalid state +during system power-up or reset thus causing unreliability +issues with the PHY which manifests as PHY not being detected +or link not functional. To fix this, these PHYs need to be RESET +via a GPIO connected to the PHY's RESET pin. + +Some boards have a single GPIO controlling the PHY RESET pin of all +PHYs on the bus whereas some others have separate GPIOs controlling +individual PHY RESETs. + +In both cases, the RESET de-assertion cannot be done in the PHY driver +as the PHY will not probe till its reset is de-asserted. +So do the RESET de-assertion in the MDIO bus driver. + +[1] - am572x-idk, am571x-idk, a437x-idk + +Signed-off-by: Roger Quadros +Signed-off-by: David S. Miller +--- + Documentation/devicetree/bindings/net/mdio.txt | 33 ++++++++++++++++++ + drivers/net/phy/mdio_bus.c | 47 ++++++++++++++++++++++++++ + drivers/of/of_mdio.c | 7 ++++ + include/linux/phy.h | 7 ++++ + 4 files changed, 94 insertions(+) + create mode 100644 Documentation/devicetree/bindings/net/mdio.txt + +--- /dev/null ++++ b/Documentation/devicetree/bindings/net/mdio.txt +@@ -0,0 +1,33 @@ ++Common MDIO bus properties. ++ ++These are generic properties that can apply to any MDIO bus. ++ ++Optional properties: ++- reset-gpios: List of one or more GPIOs that control the RESET lines ++ of the PHYs on that MDIO bus. ++- reset-delay-us: RESET pulse width in microseconds as per PHY datasheet. ++ ++A list of child nodes, one per device on the bus is expected. These ++should follow the generic phy.txt, or a device specific binding document. ++ ++Example : ++This example shows these optional properties, plus other properties ++required for the TI Davinci MDIO driver. ++ ++ davinci_mdio: ethernet@0x5c030000 { ++ compatible = "ti,davinci_mdio"; ++ reg = <0x5c030000 0x1000>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ reset-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; ++ reset-delay-us = <2>; /* PHY datasheet states 1us min */ ++ ++ ethphy0: ethernet-phy@1 { ++ reg = <1>; ++ }; ++ ++ ethphy1: ethernet-phy@3 { ++ reg = <3>; ++ }; ++ }; +--- a/drivers/net/phy/mdio_bus.c ++++ b/drivers/net/phy/mdio_bus.c +@@ -22,8 +22,11 @@ + #include + #include + #include ++#include ++#include + #include + #include ++#include + #include + #include + #include +@@ -252,6 +255,7 @@ static inline void of_mdiobus_link_phyde + int __mdiobus_register(struct mii_bus *bus, struct module *owner) + { + int i, err; ++ struct gpio_desc *gpiod; + + if (NULL == bus || NULL == bus->name || + NULL == bus->read || NULL == bus->write) +@@ -278,6 +282,35 @@ int __mdiobus_register(struct mii_bus *b + if (bus->reset) + bus->reset(bus); + ++ /* de-assert bus level PHY GPIO resets */ ++ if (bus->num_reset_gpios > 0) { ++ bus->reset_gpiod = devm_kcalloc(&bus->dev, ++ bus->num_reset_gpios, ++ sizeof(struct gpio_desc *), ++ GFP_KERNEL); ++ if (!bus->reset_gpiod) ++ return -ENOMEM; ++ } ++ ++ for (i = 0; i < bus->num_reset_gpios; i++) { ++ gpiod = devm_gpiod_get_index(&bus->dev, "reset", i, ++ GPIOD_OUT_LOW); ++ if (IS_ERR(gpiod)) { ++ err = PTR_ERR(gpiod); ++ if (err != -ENOENT) { ++ dev_err(&bus->dev, ++ "mii_bus %s couldn't get reset GPIO\n", ++ bus->id); ++ return err; ++ } ++ } else { ++ bus->reset_gpiod[i] = gpiod; ++ gpiod_set_value_cansleep(gpiod, 1); ++ udelay(bus->reset_delay_us); ++ gpiod_set_value_cansleep(gpiod, 0); ++ } ++ } ++ + for (i = 0; i < PHY_MAX_ADDR; i++) { + if ((bus->phy_mask & (1 << i)) == 0) { + struct phy_device *phydev; +@@ -302,6 +335,13 @@ error: + phy_device_free(phydev); + } + } ++ ++ /* Put PHYs in RESET to save power */ ++ for (i = 0; i < bus->num_reset_gpios; i++) { ++ if (bus->reset_gpiod[i]) ++ gpiod_set_value_cansleep(bus->reset_gpiod[i], 1); ++ } ++ + device_del(&bus->dev); + return err; + } +@@ -321,6 +361,13 @@ void mdiobus_unregister(struct mii_bus * + phy_device_free(phydev); + } + } ++ ++ /* Put PHYs in RESET to save power */ ++ for (i = 0; i < bus->num_reset_gpios; i++) { ++ if (bus->reset_gpiod[i]) ++ gpiod_set_value_cansleep(bus->reset_gpiod[i], 1); ++ } ++ + device_del(&bus->dev); + } + EXPORT_SYMBOL(mdiobus_unregister); +--- a/drivers/of/of_mdio.c ++++ b/drivers/of/of_mdio.c +@@ -21,6 +21,8 @@ + #include + #include + ++#define DEFAULT_GPIO_RESET_DELAY 10 /* in microseconds */ ++ + MODULE_AUTHOR("Grant Likely "); + MODULE_LICENSE("GPL"); + +@@ -140,6 +142,11 @@ int of_mdiobus_register(struct mii_bus * + + mdio->dev.of_node = np; + ++ /* Get bus level PHY reset GPIO details */ ++ mdio->reset_delay_us = DEFAULT_GPIO_RESET_DELAY; ++ of_property_read_u32(np, "reset-delay-us", &mdio->reset_delay_us); ++ mdio->num_reset_gpios = of_gpio_named_count(np, "reset-gpios"); ++ + /* Register the MDIO bus */ + rc = mdiobus_register(mdio); + if (rc) +--- a/include/linux/phy.h ++++ b/include/linux/phy.h +@@ -187,6 +187,13 @@ struct mii_bus { + * interrupt at the index matching its address + */ + int *irq; ++ ++ /* GPIO reset pulse width in microseconds */ ++ int reset_delay_us; ++ /* Number of reset GPIOs */ ++ int num_reset_gpios; ++ /* Array of RESET GPIO descriptors */ ++ struct gpio_desc **reset_gpiod; + }; + #define to_mii_bus(d) container_of(d, struct mii_bus, dev) + diff --git a/target/linux/brcm63xx/patches-4.4/001-4.12-08-net-phy-Call-bus-reset-after-releasing-PHYs-from-res.patch b/target/linux/brcm63xx/patches-4.4/001-4.12-08-net-phy-Call-bus-reset-after-releasing-PHYs-from-res.patch new file mode 100644 index 0000000000..5788a37de6 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.12-08-net-phy-Call-bus-reset-after-releasing-PHYs-from-res.patch @@ -0,0 +1,43 @@ +From df0c8d911abf6ba97b2c2fc3c5a12769e0b081a3 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Thu, 11 May 2017 11:24:16 -0700 +Subject: [PATCH] net: phy: Call bus->reset() after releasing PHYs from reset + +The API convention makes it that a given MDIO bus reset should be able +to access PHY devices in its reset() callback and perform additional +MDIO accesses in order to bring the bus and PHYs in a working state. + +Commit 69226896ad63 ("mdio_bus: Issue GPIO RESET to PHYs.") broke that +contract by first calling bus->reset() and then release all PHYs from +reset using their shared GPIO line, so restore the expected +functionality here. + +Fixes: 69226896ad63 ("mdio_bus: Issue GPIO RESET to PHYs.") +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/phy/mdio_bus.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/net/phy/mdio_bus.c ++++ b/drivers/net/phy/mdio_bus.c +@@ -279,9 +279,6 @@ int __mdiobus_register(struct mii_bus *b + + mutex_init(&bus->mdio_lock); + +- if (bus->reset) +- bus->reset(bus); +- + /* de-assert bus level PHY GPIO resets */ + if (bus->num_reset_gpios > 0) { + bus->reset_gpiod = devm_kcalloc(&bus->dev, +@@ -311,6 +308,9 @@ int __mdiobus_register(struct mii_bus *b + } + } + ++ if (bus->reset) ++ bus->reset(bus); ++ + for (i = 0; i < PHY_MAX_ADDR; i++) { + if ((bus->phy_mask & (1 << i)) == 0) { + struct phy_device *phydev; diff --git a/target/linux/brcm63xx/patches-4.4/001-4.13-02-mdio_bus-handle-only-single-PHY-reset-GPIO.patch b/target/linux/brcm63xx/patches-4.4/001-4.13-02-mdio_bus-handle-only-single-PHY-reset-GPIO.patch new file mode 100644 index 0000000000..7ce5eb59cf --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.13-02-mdio_bus-handle-only-single-PHY-reset-GPIO.patch @@ -0,0 +1,120 @@ +From d396e84c56047b303cac378dde4b2e5cc430b336 Mon Sep 17 00:00:00 2001 +From: Sergei Shtylyov +Date: Mon, 12 Jun 2017 23:55:38 +0300 +Subject: [PATCH] mdio_bus: handle only single PHY reset GPIO + +Commit 4c5e7a2c0501 ("dt-bindings: mdio: Clarify binding document") +declared that a MDIO reset GPIO property should have only a single GPIO +reference/specifier, however the supporting code was left intact, still +burdening the kernel with now apparently useless loops -- get rid of them. + +Signed-off-by: Sergei Shtylyov +Signed-off-by: David S. Miller +--- + drivers/net/phy/mdio_bus.c | 53 +++++++++++++++++----------------------------- + drivers/of/of_mdio.c | 1 - + include/linux/phy.h | 6 ++---- + 3 files changed, 21 insertions(+), 39 deletions(-) + +--- a/drivers/net/phy/mdio_bus.c ++++ b/drivers/net/phy/mdio_bus.c +@@ -279,33 +279,22 @@ int __mdiobus_register(struct mii_bus *b + + mutex_init(&bus->mdio_lock); + +- /* de-assert bus level PHY GPIO resets */ +- if (bus->num_reset_gpios > 0) { +- bus->reset_gpiod = devm_kcalloc(&bus->dev, +- bus->num_reset_gpios, +- sizeof(struct gpio_desc *), +- GFP_KERNEL); +- if (!bus->reset_gpiod) +- return -ENOMEM; +- } +- +- for (i = 0; i < bus->num_reset_gpios; i++) { +- gpiod = devm_gpiod_get_index(&bus->dev, "reset", i, +- GPIOD_OUT_LOW); +- if (IS_ERR(gpiod)) { +- err = PTR_ERR(gpiod); +- if (err != -ENOENT) { +- dev_err(&bus->dev, +- "mii_bus %s couldn't get reset GPIO\n", +- bus->id); +- return err; +- } +- } else { +- bus->reset_gpiod[i] = gpiod; +- gpiod_set_value_cansleep(gpiod, 1); +- udelay(bus->reset_delay_us); +- gpiod_set_value_cansleep(gpiod, 0); ++ /* de-assert bus level PHY GPIO reset */ ++ gpiod = devm_gpiod_get(&bus->dev, "reset", GPIOD_OUT_LOW); ++ if (IS_ERR(gpiod)) { ++ err = PTR_ERR(gpiod); ++ if (err != -ENOENT) { ++ dev_err(&bus->dev, ++ "mii_bus %s couldn't get reset GPIO\n", ++ bus->id); ++ return err; + } ++ } else { ++ bus->reset_gpiod = gpiod; ++ ++ gpiod_set_value_cansleep(gpiod, 1); ++ udelay(bus->reset_delay_us); ++ gpiod_set_value_cansleep(gpiod, 0); + } + + if (bus->reset) +@@ -337,10 +326,8 @@ error: + } + + /* Put PHYs in RESET to save power */ +- for (i = 0; i < bus->num_reset_gpios; i++) { +- if (bus->reset_gpiod[i]) +- gpiod_set_value_cansleep(bus->reset_gpiod[i], 1); +- } ++ if (bus->reset_gpiod) ++ gpiod_set_value_cansleep(bus->reset_gpiod, 1); + + device_del(&bus->dev); + return err; +@@ -363,10 +350,8 @@ void mdiobus_unregister(struct mii_bus * + } + + /* Put PHYs in RESET to save power */ +- for (i = 0; i < bus->num_reset_gpios; i++) { +- if (bus->reset_gpiod[i]) +- gpiod_set_value_cansleep(bus->reset_gpiod[i], 1); +- } ++ if (bus->reset_gpiod) ++ gpiod_set_value_cansleep(bus->reset_gpiod, 1); + + device_del(&bus->dev); + } +--- a/drivers/of/of_mdio.c ++++ b/drivers/of/of_mdio.c +@@ -145,7 +145,6 @@ int of_mdiobus_register(struct mii_bus * + /* Get bus level PHY reset GPIO details */ + mdio->reset_delay_us = DEFAULT_GPIO_RESET_DELAY; + of_property_read_u32(np, "reset-delay-us", &mdio->reset_delay_us); +- mdio->num_reset_gpios = of_gpio_named_count(np, "reset-gpios"); + + /* Register the MDIO bus */ + rc = mdiobus_register(mdio); +--- a/include/linux/phy.h ++++ b/include/linux/phy.h +@@ -190,10 +190,8 @@ struct mii_bus { + + /* GPIO reset pulse width in microseconds */ + int reset_delay_us; +- /* Number of reset GPIOs */ +- int num_reset_gpios; +- /* Array of RESET GPIO descriptors */ +- struct gpio_desc **reset_gpiod; ++ /* RESET GPIO descriptor pointer */ ++ struct gpio_desc *reset_gpiod; + }; + #define to_mii_bus(d) container_of(d, struct mii_bus, dev) + diff --git a/target/linux/brcm63xx/patches-4.4/001-4.13-03-mdio_bus-use-devm_gpiod_get_optional.patch b/target/linux/brcm63xx/patches-4.4/001-4.13-03-mdio_bus-use-devm_gpiod_get_optional.patch new file mode 100644 index 0000000000..d7ac6234cf --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.13-03-mdio_bus-use-devm_gpiod_get_optional.patch @@ -0,0 +1,39 @@ +From fe0e4052fb11d5c713961ab7e136520be40052a3 Mon Sep 17 00:00:00 2001 +From: Sergei Shtylyov +Date: Mon, 12 Jun 2017 23:55:39 +0300 +Subject: [PATCH] mdio_bus: use devm_gpiod_get_optional() + +The MDIO reset GPIO is really a classical optional GPIO property case, +so devm_gpiod_get_optional() should have been used, not devm_gpiod_get(). +Doing this saves several LoCs... + +Signed-off-by: Sergei Shtylyov +Signed-off-by: David S. Miller +--- + drivers/net/phy/mdio_bus.c | 14 +++++--------- + 1 file changed, 5 insertions(+), 9 deletions(-) + +--- a/drivers/net/phy/mdio_bus.c ++++ b/drivers/net/phy/mdio_bus.c +@@ -280,16 +280,12 @@ int __mdiobus_register(struct mii_bus *b + mutex_init(&bus->mdio_lock); + + /* de-assert bus level PHY GPIO reset */ +- gpiod = devm_gpiod_get(&bus->dev, "reset", GPIOD_OUT_LOW); ++ gpiod = devm_gpiod_get_optional(&bus->dev, "reset", GPIOD_OUT_LOW); + if (IS_ERR(gpiod)) { +- err = PTR_ERR(gpiod); +- if (err != -ENOENT) { +- dev_err(&bus->dev, +- "mii_bus %s couldn't get reset GPIO\n", +- bus->id); +- return err; +- } +- } else { ++ dev_err(&bus->dev, "mii_bus %s couldn't get reset GPIO\n", ++ bus->id); ++ return PTR_ERR(gpiod); ++ } else if (gpiod) { + bus->reset_gpiod = gpiod; + + gpiod_set_value_cansleep(gpiod, 1); diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch new file mode 100644 index 0000000000..08511d69f9 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch @@ -0,0 +1,210 @@ +From e74caf41aec5338b8cbbd0a1483650848f16f532 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 16 Jul 2017 12:23:47 +0200 +Subject: [PATCH V2 1/8] MIPS: BCM63XX: add clkdev lookup support + +Enable clkdev lookup support to allow us providing clocks under +different names to devices more easily, so we don't need to care +about clock name clashes anymore. + +Reviewed-by: Florian Fainelli +Signed-off-by: Jonas Gorski +--- + arch/mips/Kconfig | 1 + + arch/mips/bcm63xx/clk.c | 150 +++++++++++++++++++++++++++++++++++++----------- + 2 files changed, 116 insertions(+), 35 deletions(-) + +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -214,6 +214,7 @@ config BCM63XX + select ARCH_REQUIRE_GPIOLIB + select HAVE_CLK + select MIPS_L1_CACHE_SHIFT_4 ++ select CLKDEV_LOOKUP + help + Support for BCM63XX based boards + +--- a/arch/mips/bcm63xx/clk.c ++++ b/arch/mips/bcm63xx/clk.c +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -352,44 +353,103 @@ long clk_round_rate(struct clk *clk, uns + } + EXPORT_SYMBOL_GPL(clk_round_rate); + +-struct clk *clk_get(struct device *dev, const char *id) +-{ +- if (!strcmp(id, "enet0")) +- return &clk_enet0; +- if (!strcmp(id, "enet1")) +- return &clk_enet1; +- if (!strcmp(id, "enetsw")) +- return &clk_enetsw; +- if (!strcmp(id, "ephy")) +- return &clk_ephy; +- if (!strcmp(id, "usbh")) +- return &clk_usbh; +- if (!strcmp(id, "usbd")) +- return &clk_usbd; +- if (!strcmp(id, "spi")) +- return &clk_spi; +- if (!strcmp(id, "hsspi")) +- return &clk_hsspi; +- if (!strcmp(id, "xtm")) +- return &clk_xtm; +- if (!strcmp(id, "periph")) +- return &clk_periph; +- if ((BCMCPU_IS_3368() || BCMCPU_IS_6358()) && !strcmp(id, "pcm")) +- return &clk_pcm; +- if ((BCMCPU_IS_6362() || BCMCPU_IS_6368()) && !strcmp(id, "ipsec")) +- return &clk_ipsec; +- if ((BCMCPU_IS_6328() || BCMCPU_IS_6362()) && !strcmp(id, "pcie")) +- return &clk_pcie; +- return ERR_PTR(-ENOENT); +-} +- +-EXPORT_SYMBOL(clk_get); +- +-void clk_put(struct clk *clk) +-{ +-} +- +-EXPORT_SYMBOL(clk_put); ++static struct clk_lookup bcm3368_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ /* gated clocks */ ++ CLKDEV_INIT(NULL, "enet0", &clk_enet0), ++ CLKDEV_INIT(NULL, "enet1", &clk_enet1), ++ CLKDEV_INIT(NULL, "ephy", &clk_ephy), ++ CLKDEV_INIT(NULL, "usbh", &clk_usbh), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbd), ++ CLKDEV_INIT(NULL, "spi", &clk_spi), ++ CLKDEV_INIT(NULL, "pcm", &clk_pcm), ++}; ++ ++static struct clk_lookup bcm6328_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ /* gated clocks */ ++ CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), ++ CLKDEV_INIT(NULL, "usbh", &clk_usbh), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbd), ++ CLKDEV_INIT(NULL, "hsspi", &clk_hsspi), ++ CLKDEV_INIT(NULL, "pcie", &clk_pcie), ++}; ++ ++static struct clk_lookup bcm6338_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ /* gated clocks */ ++ CLKDEV_INIT(NULL, "enet0", &clk_enet0), ++ CLKDEV_INIT(NULL, "enet1", &clk_enet1), ++ CLKDEV_INIT(NULL, "ephy", &clk_ephy), ++ CLKDEV_INIT(NULL, "usbh", &clk_usbh), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbd), ++ CLKDEV_INIT(NULL, "spi", &clk_spi), ++}; ++ ++static struct clk_lookup bcm6345_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ /* gated clocks */ ++ CLKDEV_INIT(NULL, "enet0", &clk_enet0), ++ CLKDEV_INIT(NULL, "enet1", &clk_enet1), ++ CLKDEV_INIT(NULL, "ephy", &clk_ephy), ++ CLKDEV_INIT(NULL, "usbh", &clk_usbh), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbd), ++ CLKDEV_INIT(NULL, "spi", &clk_spi), ++}; ++ ++static struct clk_lookup bcm6348_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ /* gated clocks */ ++ CLKDEV_INIT(NULL, "enet0", &clk_enet0), ++ CLKDEV_INIT(NULL, "enet1", &clk_enet1), ++ CLKDEV_INIT(NULL, "ephy", &clk_ephy), ++ CLKDEV_INIT(NULL, "usbh", &clk_usbh), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbd), ++ CLKDEV_INIT(NULL, "spi", &clk_spi), ++}; ++ ++static struct clk_lookup bcm6358_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ /* gated clocks */ ++ CLKDEV_INIT(NULL, "enet0", &clk_enet0), ++ CLKDEV_INIT(NULL, "enet1", &clk_enet1), ++ CLKDEV_INIT(NULL, "ephy", &clk_ephy), ++ CLKDEV_INIT(NULL, "usbh", &clk_usbh), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbd), ++ CLKDEV_INIT(NULL, "spi", &clk_spi), ++ CLKDEV_INIT(NULL, "pcm", &clk_pcm), ++}; ++ ++static struct clk_lookup bcm6362_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ /* gated clocks */ ++ CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), ++ CLKDEV_INIT(NULL, "usbh", &clk_usbh), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbd), ++ CLKDEV_INIT(NULL, "spi", &clk_spi), ++ CLKDEV_INIT(NULL, "hsspi", &clk_hsspi), ++ CLKDEV_INIT(NULL, "pcie", &clk_pcie), ++ CLKDEV_INIT(NULL, "ipsec", &clk_ipsec), ++}; ++ ++static struct clk_lookup bcm6368_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ /* gated clocks */ ++ CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), ++ CLKDEV_INIT(NULL, "usbh", &clk_usbh), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbd), ++ CLKDEV_INIT(NULL, "spi", &clk_spi), ++ CLKDEV_INIT(NULL, "xtm", &clk_xtm), ++ CLKDEV_INIT(NULL, "ipsec", &clk_ipsec), ++}; + + #define HSSPI_PLL_HZ_6328 133333333 + #define HSSPI_PLL_HZ_6362 400000000 +@@ -397,11 +457,31 @@ EXPORT_SYMBOL(clk_put); + static int __init bcm63xx_clk_init(void) + { + switch (bcm63xx_get_cpu_id()) { ++ case BCM3368_CPU_ID: ++ clkdev_add_table(bcm3368_clks, ARRAY_SIZE(bcm3368_clks)); ++ break; + case BCM6328_CPU_ID: + clk_hsspi.rate = HSSPI_PLL_HZ_6328; ++ clkdev_add_table(bcm6328_clks, ARRAY_SIZE(bcm6328_clks)); ++ break; ++ case BCM6338_CPU_ID: ++ clkdev_add_table(bcm6338_clks, ARRAY_SIZE(bcm6338_clks)); ++ break; ++ case BCM6345_CPU_ID: ++ clkdev_add_table(bcm6345_clks, ARRAY_SIZE(bcm6345_clks)); ++ break; ++ case BCM6348_CPU_ID: ++ clkdev_add_table(bcm6348_clks, ARRAY_SIZE(bcm6348_clks)); ++ break; ++ case BCM6358_CPU_ID: ++ clkdev_add_table(bcm6358_clks, ARRAY_SIZE(bcm6358_clks)); + break; + case BCM6362_CPU_ID: + clk_hsspi.rate = HSSPI_PLL_HZ_6362; ++ clkdev_add_table(bcm6362_clks, ARRAY_SIZE(bcm6362_clks)); ++ break; ++ case BCM6368_CPU_ID: ++ clkdev_add_table(bcm6368_clks, ARRAY_SIZE(bcm6368_clks)); + break; + } + diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-02-MIPS-BCM63XX-provide-periph-clock-as-refclk-for-uart.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-02-MIPS-BCM63XX-provide-periph-clock-as-refclk-for-uart.patch new file mode 100644 index 0000000000..2b3ca16de7 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-02-MIPS-BCM63XX-provide-periph-clock-as-refclk-for-uart.patch @@ -0,0 +1,84 @@ +From d0322bf7bebe87012b4f95c85be6b5ba0cb6f344 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 16 Jul 2017 12:31:44 +0200 +Subject: [PATCH V2 2/8] MIPS: BCM63XX: provide periph clock as refclk for uart + +Add a lookup as "refclk" to describe its function for the uarts. + +Reviewed-by: Florian Fainelli +Signed-off-by: Jonas Gorski +--- + arch/mips/bcm63xx/clk.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +--- a/arch/mips/bcm63xx/clk.c ++++ b/arch/mips/bcm63xx/clk.c +@@ -356,6 +356,8 @@ EXPORT_SYMBOL_GPL(clk_round_rate); + static struct clk_lookup bcm3368_clks[] = { + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -369,6 +371,8 @@ static struct clk_lookup bcm3368_clks[] + static struct clk_lookup bcm6328_clks[] = { + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), +@@ -380,6 +384,7 @@ static struct clk_lookup bcm6328_clks[] + static struct clk_lookup bcm6338_clks[] = { + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -392,6 +397,7 @@ static struct clk_lookup bcm6338_clks[] + static struct clk_lookup bcm6345_clks[] = { + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -404,6 +410,7 @@ static struct clk_lookup bcm6345_clks[] + static struct clk_lookup bcm6348_clks[] = { + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -416,6 +423,8 @@ static struct clk_lookup bcm6348_clks[] + static struct clk_lookup bcm6358_clks[] = { + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -429,6 +438,8 @@ static struct clk_lookup bcm6358_clks[] + static struct clk_lookup bcm6362_clks[] = { + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), +@@ -442,6 +453,8 @@ static struct clk_lookup bcm6362_clks[] + static struct clk_lookup bcm6368_clks[] = { + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-03-tty-bcm63xx_uart-use-refclk-for-the-expected-clock-n.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-03-tty-bcm63xx_uart-use-refclk-for-the-expected-clock-n.patch new file mode 100644 index 0000000000..5152fbe24e --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-03-tty-bcm63xx_uart-use-refclk-for-the-expected-clock-n.patch @@ -0,0 +1,26 @@ +From 8124706e6040b1cf0d2dd3a05759df6cec4bddfb Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 16 Jul 2017 12:32:37 +0200 +Subject: [PATCH V2 3/8] tty/bcm63xx_uart: use refclk for the expected clock + name + +We now have the clock available under refclk, so use that. + +Acked-by: Greg Kroah-Hartman +Reviewed-by: Florian Fainelli +Signed-off-by: Jonas Gorski +--- + drivers/tty/serial/bcm63xx_uart.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/tty/serial/bcm63xx_uart.c ++++ b/drivers/tty/serial/bcm63xx_uart.c +@@ -842,7 +842,7 @@ static int bcm_uart_probe(struct platfor + return -ENODEV; + + clk = pdev->dev.of_node ? of_clk_get(pdev->dev.of_node, 0) : +- clk_get(&pdev->dev, "periph"); ++ clk_get(&pdev->dev, "refclk"); + if (IS_ERR(clk)) + return -ENODEV; + diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-04-tty-bcm63xx_uart-allow-naming-clock-in-device-tree.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-04-tty-bcm63xx_uart-allow-naming-clock-in-device-tree.patch new file mode 100644 index 0000000000..a8fd5afcb6 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-04-tty-bcm63xx_uart-allow-naming-clock-in-device-tree.patch @@ -0,0 +1,55 @@ +From 317f8659bba01b307cbe4e9902d4e3d333fd7164 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 16 Jul 2017 12:39:17 +0200 +Subject: [PATCH V2 4/8] tty/bcm63xx_uart: allow naming clock in device tree + +Codify using a named clock for the refclk of the uart. This makes it +easier if we might need to add a gating clock (like present on the +BCM6345). + +Acked-by: Rob Herring +Acked-by: Greg Kroah-Hartman +Reviewed-by: Florian Fainelli +Signed-off-by: Jonas Gorski +--- + Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt | 6 ++++++ + drivers/tty/serial/bcm63xx_uart.c | 6 ++++-- + 2 files changed, 10 insertions(+), 2 deletions(-) + +--- a/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt ++++ b/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt +@@ -11,6 +11,11 @@ Required properties: + - clocks: Clock driving the hardware; used to figure out the baud rate + divisor. + ++ ++Optional properties: ++ ++- clock-names: Should be "refclk". ++ + Example: + + uart0: serial@14e00520 { +@@ -19,6 +24,7 @@ Example: + interrupt-parent = <&periph_intc>; + interrupts = <2>; + clocks = <&periph_clk>; ++ clock-names = "refclk"; + }; + + clocks { +--- a/drivers/tty/serial/bcm63xx_uart.c ++++ b/drivers/tty/serial/bcm63xx_uart.c +@@ -841,8 +841,10 @@ static int bcm_uart_probe(struct platfor + if (!res_irq) + return -ENODEV; + +- clk = pdev->dev.of_node ? of_clk_get(pdev->dev.of_node, 0) : +- clk_get(&pdev->dev, "refclk"); ++ clk = clk_get(&pdev->dev, "refclk"); ++ if (IS_ERR(clk) && pdev->dev.of_node) ++ clk = of_clk_get(pdev->dev.of_node, 0); ++ + if (IS_ERR(clk)) + return -ENODEV; + diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-05-MIPS-BCM63XX-move-the-HSSPI-PLL-HZ-into-its-own-cloc.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-05-MIPS-BCM63XX-move-the-HSSPI-PLL-HZ-into-its-own-cloc.patch new file mode 100644 index 0000000000..3d9deee796 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-05-MIPS-BCM63XX-move-the-HSSPI-PLL-HZ-into-its-own-cloc.patch @@ -0,0 +1,62 @@ +From cb86630379c8f3432c916d62045b5176f17f4123 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 16 Jul 2017 12:57:21 +0200 +Subject: [PATCH V2 6/8] MIPS: BCM63XX: move the HSSPI PLL HZ into its own + clock + +Split up the HSSPL clock into rate and a gate clock, to more closely +match the actual hardware. + +Reviewed-by: Florian Fainelli +Signed-off-by: Jonas Gorski +--- + arch/mips/bcm63xx/clk.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +--- a/arch/mips/bcm63xx/clk.c ++++ b/arch/mips/bcm63xx/clk.c +@@ -247,6 +247,10 @@ static struct clk clk_hsspi = { + .set = hsspi_set, + }; + ++/* ++ * HSSPI PLL ++ */ ++static struct clk clk_hsspi_pll; + + /* + * XTM clock +@@ -373,6 +377,7 @@ static struct clk_lookup bcm6328_clks[] + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), ++ CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), +@@ -440,6 +445,7 @@ static struct clk_lookup bcm6362_clks[] + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), ++ CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), +@@ -474,7 +480,7 @@ static int __init bcm63xx_clk_init(void) + clkdev_add_table(bcm3368_clks, ARRAY_SIZE(bcm3368_clks)); + break; + case BCM6328_CPU_ID: +- clk_hsspi.rate = HSSPI_PLL_HZ_6328; ++ clk_hsspi_pll.rate = HSSPI_PLL_HZ_6328; + clkdev_add_table(bcm6328_clks, ARRAY_SIZE(bcm6328_clks)); + break; + case BCM6338_CPU_ID: +@@ -490,7 +496,7 @@ static int __init bcm63xx_clk_init(void) + clkdev_add_table(bcm6358_clks, ARRAY_SIZE(bcm6358_clks)); + break; + case BCM6362_CPU_ID: +- clk_hsspi.rate = HSSPI_PLL_HZ_6362; ++ clk_hsspi_pll.rate = HSSPI_PLL_HZ_6362; + clkdev_add_table(bcm6362_clks, ARRAY_SIZE(bcm6362_clks)); + break; + case BCM6368_CPU_ID: diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-06-MIPS-BCM63XX-provide-enet-clocks-as-enet-to-the-ethe.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-06-MIPS-BCM63XX-provide-enet-clocks-as-enet-to-the-ethe.patch new file mode 100644 index 0000000000..0eafe5f724 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-06-MIPS-BCM63XX-provide-enet-clocks-as-enet-to-the-ethe.patch @@ -0,0 +1,60 @@ +From 6d43970a2eb1c7ee88caf7328d201f9c001262e9 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 16 Jul 2017 12:48:41 +0200 +Subject: [PATCH V2 7/8] MIPS: BCM63XX: provide enet clocks as "enet" to the + ethernet devices + +Add lookups to provide the appropriate enetX clocks as just "enet" to +the ethernet devices. + +Reviewed-by: Florian Fainelli +Signed-off-by: Jonas Gorski +--- + arch/mips/bcm63xx/clk.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/arch/mips/bcm63xx/clk.c ++++ b/arch/mips/bcm63xx/clk.c +@@ -370,6 +370,8 @@ static struct clk_lookup bcm3368_clks[] + CLKDEV_INIT(NULL, "usbd", &clk_usbd), + CLKDEV_INIT(NULL, "spi", &clk_spi), + CLKDEV_INIT(NULL, "pcm", &clk_pcm), ++ CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet0), ++ CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet1), + }; + + static struct clk_lookup bcm6328_clks[] = { +@@ -397,6 +399,7 @@ static struct clk_lookup bcm6338_clks[] + CLKDEV_INIT(NULL, "usbh", &clk_usbh), + CLKDEV_INIT(NULL, "usbd", &clk_usbd), + CLKDEV_INIT(NULL, "spi", &clk_spi), ++ CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet_misc), + }; + + static struct clk_lookup bcm6345_clks[] = { +@@ -410,6 +413,7 @@ static struct clk_lookup bcm6345_clks[] + CLKDEV_INIT(NULL, "usbh", &clk_usbh), + CLKDEV_INIT(NULL, "usbd", &clk_usbd), + CLKDEV_INIT(NULL, "spi", &clk_spi), ++ CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet_misc), + }; + + static struct clk_lookup bcm6348_clks[] = { +@@ -423,6 +427,8 @@ static struct clk_lookup bcm6348_clks[] + CLKDEV_INIT(NULL, "usbh", &clk_usbh), + CLKDEV_INIT(NULL, "usbd", &clk_usbd), + CLKDEV_INIT(NULL, "spi", &clk_spi), ++ CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet_misc), ++ CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet_misc), + }; + + static struct clk_lookup bcm6358_clks[] = { +@@ -438,6 +444,8 @@ static struct clk_lookup bcm6358_clks[] + CLKDEV_INIT(NULL, "usbd", &clk_usbd), + CLKDEV_INIT(NULL, "spi", &clk_spi), + CLKDEV_INIT(NULL, "pcm", &clk_pcm), ++ CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet0), ++ CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet1), + }; + + static struct clk_lookup bcm6362_clks[] = { diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-07-MIPS-BCM63XX-split-out-swpkt_sar-usb-clocks.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-07-MIPS-BCM63XX-split-out-swpkt_sar-usb-clocks.patch new file mode 100644 index 0000000000..b536601822 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-07-MIPS-BCM63XX-split-out-swpkt_sar-usb-clocks.patch @@ -0,0 +1,105 @@ +From b98027285bd1fa95da0645a4234a5fc1f1a83f92 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 26 Feb 2017 11:59:52 +0100 +Subject: [PATCH V2 8/8] MIPS: BCM63XX: split out swpkt_sar/usb clocks + +Make the secondary switch clocks their own clocks. This allows proper +enable reference counting between SAR/XTM and the main switch clocks, +and controlling them individually from drivers. + +Signed-off-by: Jonas Gorski +--- + arch/mips/bcm63xx/clk.c | 61 +++++++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 51 insertions(+), 10 deletions(-) + +--- a/arch/mips/bcm63xx/clk.c ++++ b/arch/mips/bcm63xx/clk.c +@@ -121,21 +121,56 @@ static struct clk clk_ephy = { + }; + + /* ++ * Ethernet switch SAR clock ++ */ ++static void swpkt_sar_set(struct clk *clk, int enable) ++{ ++ if (BCMCPU_IS_6368()) ++ bcm_hwclock_set(CKCTL_6368_SWPKT_SAR_EN, enable); ++ else ++ return; ++} ++ ++static struct clk clk_swpkt_sar = { ++ .set = swpkt_sar_set, ++}; ++ ++/* ++ * Ethernet switch USB clock ++ */ ++static void swpkt_usb_set(struct clk *clk, int enable) ++{ ++ if (BCMCPU_IS_6368()) ++ bcm_hwclock_set(CKCTL_6368_SWPKT_USB_EN, enable); ++ else ++ return; ++} ++ ++static struct clk clk_swpkt_usb = { ++ .set = swpkt_usb_set, ++}; ++ ++/* + * Ethernet switch clock + */ + static void enetsw_set(struct clk *clk, int enable) + { +- if (BCMCPU_IS_6328()) ++ if (BCMCPU_IS_6328()) { + bcm_hwclock_set(CKCTL_6328_ROBOSW_EN, enable); +- else if (BCMCPU_IS_6362()) ++ } else if (BCMCPU_IS_6362()) { + bcm_hwclock_set(CKCTL_6362_ROBOSW_EN, enable); +- else if (BCMCPU_IS_6368()) +- bcm_hwclock_set(CKCTL_6368_ROBOSW_EN | +- CKCTL_6368_SWPKT_USB_EN | +- CKCTL_6368_SWPKT_SAR_EN, +- enable); +- else ++ } else if (BCMCPU_IS_6368()) { ++ if (enable) { ++ clk_enable_unlocked(&clk_swpkt_sar); ++ clk_enable_unlocked(&clk_swpkt_usb); ++ } else { ++ clk_disable_unlocked(&clk_swpkt_usb); ++ clk_disable_unlocked(&clk_swpkt_sar); ++ } ++ bcm_hwclock_set(CKCTL_6368_ROBOSW_EN, enable); ++ } else { + return; ++ } + + if (enable) { + /* reset switch core afer clock change */ +@@ -260,8 +295,12 @@ static void xtm_set(struct clk *clk, int + if (!BCMCPU_IS_6368()) + return; + +- bcm_hwclock_set(CKCTL_6368_SAR_EN | +- CKCTL_6368_SWPKT_SAR_EN, enable); ++ if (enable) ++ clk_enable_unlocked(&clk_swpkt_sar); ++ else ++ clk_disable_unlocked(&clk_swpkt_sar); ++ ++ bcm_hwclock_set(CKCTL_6368_SAR_EN, enable); + + if (enable) { + /* reset sar core afer clock change */ +@@ -444,6 +483,8 @@ static struct clk_lookup bcm6358_clks[] + CLKDEV_INIT(NULL, "usbd", &clk_usbd), + CLKDEV_INIT(NULL, "spi", &clk_spi), + CLKDEV_INIT(NULL, "pcm", &clk_pcm), ++ CLKDEV_INIT(NULL, "swpkt_sar", &clk_swpkt_sar), ++ CLKDEV_INIT(NULL, "swpkt_usb", &clk_swpkt_usb), + CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet0), + CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet1), + }; diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-08-bcm63xx_enet-correct-clock-usage.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-08-bcm63xx_enet-correct-clock-usage.patch new file mode 100644 index 0000000000..b85f38b59d --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-08-bcm63xx_enet-correct-clock-usage.patch @@ -0,0 +1,101 @@ +From d0423d3e4fa7ae305729cb50369427f075ccb279 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sat, 25 Feb 2017 12:41:28 +0100 +Subject: [PATCH 1/6] bcm63xx_enet: correct clock usage + +Check the return code of prepare_enable and change one last instance of +enable only to prepare_enable. Also properly disable and release the +clock in error paths and on remove for enetsw. + +Signed-off-by: Jonas Gorski +--- + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 31 +++++++++++++++++++++------- + 1 file changed, 23 insertions(+), 8 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -1787,7 +1787,9 @@ static int bcm_enet_probe(struct platfor + ret = PTR_ERR(priv->mac_clk); + goto out; + } +- clk_prepare_enable(priv->mac_clk); ++ ret = clk_prepare_enable(priv->mac_clk); ++ if (ret) ++ goto out_put_clk_mac; + + /* initialize default and fetch platform data */ + priv->rx_ring_size = BCMENET_DEF_RX_DESC; +@@ -1819,9 +1821,11 @@ static int bcm_enet_probe(struct platfor + if (IS_ERR(priv->phy_clk)) { + ret = PTR_ERR(priv->phy_clk); + priv->phy_clk = NULL; +- goto out_put_clk_mac; ++ goto out_disable_clk_mac; + } +- clk_prepare_enable(priv->phy_clk); ++ ret = clk_prepare_enable(priv->phy_clk); ++ if (ret) ++ goto out_put_clk_phy; + } + + /* do minimal hardware init to be able to probe mii bus */ +@@ -1921,13 +1925,16 @@ out_free_mdio: + out_uninit_hw: + /* turn off mdc clock */ + enet_writel(priv, 0, ENET_MIISC_REG); +- if (priv->phy_clk) { ++ if (priv->phy_clk) + clk_disable_unprepare(priv->phy_clk); ++ ++out_put_clk_phy: ++ if (priv->phy_clk) + clk_put(priv->phy_clk); +- } + +-out_put_clk_mac: ++out_disable_clk_mac: + clk_disable_unprepare(priv->mac_clk); ++out_put_clk_mac: + clk_put(priv->mac_clk); + out: + free_netdev(dev); +@@ -2772,7 +2779,9 @@ static int bcm_enetsw_probe(struct platf + ret = PTR_ERR(priv->mac_clk); + goto out_unmap; + } +- clk_enable(priv->mac_clk); ++ ret = clk_prepare_enable(priv->mac_clk); ++ if (ret) ++ goto out_put_clk; + + priv->rx_chan = 0; + priv->tx_chan = 1; +@@ -2793,7 +2802,7 @@ static int bcm_enetsw_probe(struct platf + + ret = register_netdev(dev); + if (ret) +- goto out_put_clk; ++ goto out_disable_clk; + + netif_carrier_off(dev); + platform_set_drvdata(pdev, dev); +@@ -2802,6 +2811,9 @@ static int bcm_enetsw_probe(struct platf + + return 0; + ++out_disable_clk: ++ clk_disable_unprepare(priv->mac_clk); ++ + out_put_clk: + clk_put(priv->mac_clk); + +@@ -2833,6 +2845,9 @@ static int bcm_enetsw_remove(struct plat + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + release_mem_region(res->start, resource_size(res)); + ++ clk_disable_unprepare(priv->mac_clk); ++ clk_put(priv->mac_clk); ++ + free_netdev(dev); + return 0; + } diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-09-bcm63xx_enet-do-not-write-to-random-DMA-channel-on-B.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-09-bcm63xx_enet-do-not-write-to-random-DMA-channel-on-B.patch new file mode 100644 index 0000000000..22c6d01873 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-09-bcm63xx_enet-do-not-write-to-random-DMA-channel-on-B.patch @@ -0,0 +1,29 @@ +From 23d94cb855b6f4f0ee1c01679224472104ac6440 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sat, 30 Sep 2017 14:10:18 +0200 +Subject: [PATCH 2/6] bcm63xx_enet: do not write to random DMA channel on + BCM6345 + +The DMA controller regs actually point to DMA channel 0, so the write to +ENETDMA_CFG_REG will actually modify a random DMA channel. + +Since DMA controller registers do not exist on BCM6345, guard the write +with the usual check for dma_has_sram. + +Signed-off-by: Jonas Gorski +--- + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -1063,7 +1063,8 @@ static int bcm_enet_open(struct net_devi + val = enet_readl(priv, ENET_CTL_REG); + val |= ENET_CTL_ENABLE_MASK; + enet_writel(priv, val, ENET_CTL_REG); +- enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG); ++ if (priv->dma_has_sram) ++ enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG); + enet_dmac_writel(priv, priv->dma_chan_en_mask, + ENETDMAC_CHANCFG, priv->rx_chan); + diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-10-bcm63xx_enet-do-not-rely-on-probe-order.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-10-bcm63xx_enet-do-not-rely-on-probe-order.patch new file mode 100644 index 0000000000..b14dedcd76 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-10-bcm63xx_enet-do-not-rely-on-probe-order.patch @@ -0,0 +1,41 @@ +From 71710bb6cbc82f411a4e5faafa0c3178e48e7137 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Tue, 30 May 2017 13:31:45 +0200 +Subject: [PATCH 3/6] bcm63xx_enet: do not rely on probe order + +Do not rely on the shared device being probed before the enet(sw) +devices. This makes it easier to eventually move out the shared +device as a dma controller driver (what it should be). + +Signed-off-by: Jonas Gorski +--- + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 9 ++------- + 1 file changed, 2 insertions(+), 7 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -1736,10 +1736,8 @@ static int bcm_enet_probe(struct platfor + const char *clk_name; + int i, ret; + +- /* stop if shared driver failed, assume driver->probe will be +- * called in the same order we register devices (correct ?) */ + if (!bcm_enet_shared_base[0]) +- return -ENODEV; ++ return -EPROBE_DEFER; + + res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); + res_irq_rx = platform_get_resource(pdev, IORESOURCE_IRQ, 1); +@@ -2720,11 +2718,8 @@ static int bcm_enetsw_probe(struct platf + struct resource *res_mem; + int ret, irq_rx, irq_tx; + +- /* stop if shared driver failed, assume driver->probe will be +- * called in the same order we register devices (correct ?) +- */ + if (!bcm_enet_shared_base[0]) +- return -ENODEV; ++ return -EPROBE_DEFER; + + res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); + irq_rx = platform_get_irq(pdev, 0); diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-11-bcm63xx_enet-use-managed-functions-for-clock-ioremap.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-11-bcm63xx_enet-use-managed-functions-for-clock-ioremap.patch new file mode 100644 index 0000000000..ae009064bf --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-11-bcm63xx_enet-use-managed-functions-for-clock-ioremap.patch @@ -0,0 +1,150 @@ +From 179a445ae4ef36ec44f4aea18e5f42d21334d186 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sat, 25 Feb 2017 12:39:25 +0100 +Subject: [PATCH 4/6] bcm63xx_enet: use managed functions for clock/ioremap + +Use managed functions where possible to reduce the amount of resource +handling on error and remove paths. + +Signed-off-by: Jonas Gorski +--- + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 54 +++++++--------------------- + 1 file changed, 12 insertions(+), 42 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -1781,14 +1781,14 @@ static int bcm_enet_probe(struct platfor + clk_name = "enet1"; + } + +- priv->mac_clk = clk_get(&pdev->dev, clk_name); ++ priv->mac_clk = devm_clk_get(&pdev->dev, clk_name); + if (IS_ERR(priv->mac_clk)) { + ret = PTR_ERR(priv->mac_clk); + goto out; + } + ret = clk_prepare_enable(priv->mac_clk); + if (ret) +- goto out_put_clk_mac; ++ goto out; + + /* initialize default and fetch platform data */ + priv->rx_ring_size = BCMENET_DEF_RX_DESC; +@@ -1816,7 +1816,7 @@ static int bcm_enet_probe(struct platfor + + if (priv->mac_id == 0 && priv->has_phy && !priv->use_external_mii) { + /* using internal PHY, enable clock */ +- priv->phy_clk = clk_get(&pdev->dev, "ephy"); ++ priv->phy_clk = devm_clk_get(&pdev->dev, "ephy"); + if (IS_ERR(priv->phy_clk)) { + ret = PTR_ERR(priv->phy_clk); + priv->phy_clk = NULL; +@@ -1824,7 +1824,7 @@ static int bcm_enet_probe(struct platfor + } + ret = clk_prepare_enable(priv->phy_clk); + if (ret) +- goto out_put_clk_phy; ++ goto out_disable_clk_mac; + } + + /* do minimal hardware init to be able to probe mii bus */ +@@ -1927,14 +1927,8 @@ out_uninit_hw: + if (priv->phy_clk) + clk_disable_unprepare(priv->phy_clk); + +-out_put_clk_phy: +- if (priv->phy_clk) +- clk_put(priv->phy_clk); +- + out_disable_clk_mac: + clk_disable_unprepare(priv->mac_clk); +-out_put_clk_mac: +- clk_put(priv->mac_clk); + out: + free_netdev(dev); + return ret; +@@ -1970,12 +1964,10 @@ static int bcm_enet_remove(struct platfo + } + + /* disable hw block clocks */ +- if (priv->phy_clk) { ++ if (priv->phy_clk) + clk_disable_unprepare(priv->phy_clk); +- clk_put(priv->phy_clk); +- } ++ + clk_disable_unprepare(priv->mac_clk); +- clk_put(priv->mac_clk); + + free_netdev(dev); + return 0; +@@ -2758,26 +2750,20 @@ static int bcm_enetsw_probe(struct platf + if (ret) + goto out; + +- if (!request_mem_region(res_mem->start, resource_size(res_mem), +- "bcm63xx_enetsw")) { +- ret = -EBUSY; ++ priv->base = devm_ioremap_resource(&pdev->dev, res_mem); ++ if (IS_ERR(priv->base)) { ++ ret = PTR_ERR(priv->base); + goto out; + } + +- priv->base = ioremap(res_mem->start, resource_size(res_mem)); +- if (priv->base == NULL) { +- ret = -ENOMEM; +- goto out_release_mem; +- } +- +- priv->mac_clk = clk_get(&pdev->dev, "enetsw"); ++ priv->mac_clk = devm_clk_get(&pdev->dev, "enetsw"); + if (IS_ERR(priv->mac_clk)) { + ret = PTR_ERR(priv->mac_clk); +- goto out_unmap; ++ goto out; + } + ret = clk_prepare_enable(priv->mac_clk); + if (ret) +- goto out_put_clk; ++ goto out; + + priv->rx_chan = 0; + priv->tx_chan = 1; +@@ -2809,15 +2795,6 @@ static int bcm_enetsw_probe(struct platf + + out_disable_clk: + clk_disable_unprepare(priv->mac_clk); +- +-out_put_clk: +- clk_put(priv->mac_clk); +- +-out_unmap: +- iounmap(priv->base); +- +-out_release_mem: +- release_mem_region(res_mem->start, resource_size(res_mem)); + out: + free_netdev(dev); + return ret; +@@ -2829,20 +2806,13 @@ static int bcm_enetsw_remove(struct plat + { + struct bcm_enet_priv *priv; + struct net_device *dev; +- struct resource *res; + + /* stop netdevice */ + dev = platform_get_drvdata(pdev); + priv = netdev_priv(dev); + unregister_netdev(dev); + +- /* release device resources */ +- iounmap(priv->base); +- res = platform_get_resource(pdev, IORESOURCE_MEM, 0); +- release_mem_region(res->start, resource_size(res)); +- + clk_disable_unprepare(priv->mac_clk); +- clk_put(priv->mac_clk); + + free_netdev(dev); + return 0; diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-12-bcm63xx_enet-drop-unneeded-NULL-phy_clk-check.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-12-bcm63xx_enet-drop-unneeded-NULL-phy_clk-check.patch new file mode 100644 index 0000000000..957c0f3725 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-12-bcm63xx_enet-drop-unneeded-NULL-phy_clk-check.patch @@ -0,0 +1,36 @@ +From 555baec974ede81e616ca88ac6d3fca09239368f Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Tue, 18 Jul 2017 13:18:01 +0200 +Subject: [PATCH 5/6] bcm63xx_enet: drop unneeded NULL phy_clk check + +clk_disable and clk_unprepare are NULL-safe, so need to duplicate the +NULL check of the functions. + +Signed-off-by: Jonas Gorski +--- + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -1924,8 +1924,7 @@ out_free_mdio: + out_uninit_hw: + /* turn off mdc clock */ + enet_writel(priv, 0, ENET_MIISC_REG); +- if (priv->phy_clk) +- clk_disable_unprepare(priv->phy_clk); ++ clk_disable_unprepare(priv->phy_clk); + + out_disable_clk_mac: + clk_disable_unprepare(priv->mac_clk); +@@ -1964,9 +1963,7 @@ static int bcm_enet_remove(struct platfo + } + + /* disable hw block clocks */ +- if (priv->phy_clk) +- clk_disable_unprepare(priv->phy_clk); +- ++ clk_disable_unprepare(priv->phy_clk); + clk_disable_unprepare(priv->mac_clk); + + free_netdev(dev); diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-13-bcm63xx_enet-remove-unneeded-include.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-13-bcm63xx_enet-remove-unneeded-include.patch new file mode 100644 index 0000000000..482bd58929 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-13-bcm63xx_enet-remove-unneeded-include.patch @@ -0,0 +1,22 @@ +From 77364ce98037972fb1c57d0ee0418eb1c2b26521 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Mon, 29 May 2017 13:11:14 +0200 +Subject: [PATCH 6/6] bcm63xx_enet: remove unneeded include + +We don't use anyhing from that file, so drop it. + +Signed-off-by: Jonas Gorski +--- + drivers/net/ethernet/broadcom/bcm63xx_enet.h | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.h ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.h +@@ -8,7 +8,6 @@ + #include + + #include +-#include + #include + #include + diff --git a/target/linux/brcm63xx/patches-4.4/100-MIPS-BCM63XX-add-USB-host-clock-enable-delay.patch b/target/linux/brcm63xx/patches-4.4/100-MIPS-BCM63XX-add-USB-host-clock-enable-delay.patch index 63d385be4e..67c5ef4504 100644 --- a/target/linux/brcm63xx/patches-4.4/100-MIPS-BCM63XX-add-USB-host-clock-enable-delay.patch +++ b/target/linux/brcm63xx/patches-4.4/100-MIPS-BCM63XX-add-USB-host-clock-enable-delay.patch @@ -14,7 +14,7 @@ Signed-off-by: Florian Fainelli --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -177,6 +177,11 @@ static void usbh_set(struct clk *clk, in +@@ -213,6 +213,11 @@ static void usbh_set(struct clk *clk, in bcm_hwclock_set(CKCTL_6362_USBH_EN, enable); else if (BCMCPU_IS_6368()) bcm_hwclock_set(CKCTL_6368_USBH_EN, enable); diff --git a/target/linux/brcm63xx/patches-4.4/101-MIPS-BCM63XX-add-USB-device-clock-enable-delay-to-cl.patch b/target/linux/brcm63xx/patches-4.4/101-MIPS-BCM63XX-add-USB-device-clock-enable-delay-to-cl.patch index 43bbcd10e9..1001df375b 100644 --- a/target/linux/brcm63xx/patches-4.4/101-MIPS-BCM63XX-add-USB-device-clock-enable-delay-to-cl.patch +++ b/target/linux/brcm63xx/patches-4.4/101-MIPS-BCM63XX-add-USB-device-clock-enable-delay-to-cl.patch @@ -17,7 +17,7 @@ Signed-off-by: Florian Fainelli --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -199,6 +199,11 @@ static void usbd_set(struct clk *clk, in +@@ -235,6 +235,11 @@ static void usbd_set(struct clk *clk, in bcm_hwclock_set(CKCTL_6362_USBD_EN, enable); else if (BCMCPU_IS_6368()) bcm_hwclock_set(CKCTL_6368_USBD_EN, enable); diff --git a/target/linux/brcm63xx/patches-4.4/111-MIPS-BCM63XX-allow-NULL-clock-for-clk_get_rate.patch b/target/linux/brcm63xx/patches-4.4/111-MIPS-BCM63XX-allow-NULL-clock-for-clk_get_rate.patch index 75a3a23a9f..0a96e1bbb4 100644 --- a/target/linux/brcm63xx/patches-4.4/111-MIPS-BCM63XX-allow-NULL-clock-for-clk_get_rate.patch +++ b/target/linux/brcm63xx/patches-4.4/111-MIPS-BCM63XX-allow-NULL-clock-for-clk_get_rate.patch @@ -36,7 +36,7 @@ Reviewed-by: Florian Fainelli --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -345,6 +345,9 @@ EXPORT_SYMBOL(clk_disable); +@@ -389,6 +389,9 @@ EXPORT_SYMBOL(clk_disable); unsigned long clk_get_rate(struct clk *clk) { diff --git a/target/linux/brcm63xx/patches-4.4/130-pinctrl-add-bcm63xx-base-code.patch b/target/linux/brcm63xx/patches-4.4/130-pinctrl-add-bcm63xx-base-code.patch index 57614c2707..27c2d09083 100644 --- a/target/linux/brcm63xx/patches-4.4/130-pinctrl-add-bcm63xx-base-code.patch +++ b/target/linux/brcm63xx/patches-4.4/130-pinctrl-add-bcm63xx-base-code.patch @@ -21,7 +21,7 @@ Signed-off-by: Jonas Gorski --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig -@@ -247,6 +247,7 @@ config PINCTRL_ZYNQ +@@ -248,6 +248,7 @@ config PINCTRL_ZYNQ This selectes the pinctrl driver for Xilinx Zynq. source "drivers/pinctrl/bcm/Kconfig" diff --git a/target/linux/brcm63xx/patches-4.4/140-pinctrl-add-a-pincontrol-driver-for-BCM6368.patch b/target/linux/brcm63xx/patches-4.4/140-pinctrl-add-a-pincontrol-driver-for-BCM6368.patch index 9d086a65f2..6a9b9e0807 100644 --- a/target/linux/brcm63xx/patches-4.4/140-pinctrl-add-a-pincontrol-driver-for-BCM6368.patch +++ b/target/linux/brcm63xx/patches-4.4/140-pinctrl-add-a-pincontrol-driver-for-BCM6368.patch @@ -575,7 +575,7 @@ Signed-off-by: Jonas Gorski + if (!pctl) + return -ENOMEM; + -+ pctl->overlay = devm_regmap_field_alloc(&pdev->dev, mode, overlay); ++ pctl->overlay = devm_regmap_field_alloc(&pdev->dev, basemode, overlay); + if (IS_ERR(pctl->overlay)) + return PTR_ERR(pctl->overlay); + diff --git a/target/linux/brcm63xx/patches-4.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch b/target/linux/brcm63xx/patches-4.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch index 25b0df5dc2..85abad4d30 100644 --- a/target/linux/brcm63xx/patches-4.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch +++ b/target/linux/brcm63xx/patches-4.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch @@ -46,16 +46,16 @@ Signed-off-by: Jonas Gorski val = bcm_mpi_readl(MPI_CSBASE_REG(0)); --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -133,6 +133,8 @@ static void enetsw_set(struct clk *clk, - CKCTL_6368_SWPKT_USB_EN | - CKCTL_6368_SWPKT_SAR_EN, - enable); -+ else if (BCMCPU_IS_63268()) +@@ -168,6 +168,8 @@ static void enetsw_set(struct clk *clk, + clk_disable_unlocked(&clk_swpkt_sar); + } + bcm_hwclock_set(CKCTL_6368_ROBOSW_EN, enable); ++ } else if (BCMCPU_IS_63268()) { + bcm_hwclock_set(CKCTL_63268_ROBOSW_EN, enable); - else + } else { return; - -@@ -177,6 +179,8 @@ static void usbh_set(struct clk *clk, in + } +@@ -213,6 +215,8 @@ static void usbh_set(struct clk *clk, in bcm_hwclock_set(CKCTL_6362_USBH_EN, enable); else if (BCMCPU_IS_6368()) bcm_hwclock_set(CKCTL_6368_USBH_EN, enable); @@ -64,7 +64,7 @@ Signed-off-by: Jonas Gorski else return; -@@ -199,6 +203,8 @@ static void usbd_set(struct clk *clk, in +@@ -235,6 +239,8 @@ static void usbd_set(struct clk *clk, in bcm_hwclock_set(CKCTL_6362_USBD_EN, enable); else if (BCMCPU_IS_6368()) bcm_hwclock_set(CKCTL_6368_USBD_EN, enable); @@ -73,7 +73,7 @@ Signed-off-by: Jonas Gorski else return; -@@ -225,9 +231,13 @@ static void spi_set(struct clk *clk, int +@@ -261,9 +267,13 @@ static void spi_set(struct clk *clk, int mask = CKCTL_6358_SPI_EN; else if (BCMCPU_IS_6362()) mask = CKCTL_6362_SPI_EN; @@ -89,7 +89,7 @@ Signed-off-by: Jonas Gorski bcm_hwclock_set(mask, enable); } -@@ -246,6 +256,8 @@ static void hsspi_set(struct clk *clk, i +@@ -282,6 +292,8 @@ static void hsspi_set(struct clk *clk, i mask = CKCTL_6328_HSSPI_EN; else if (BCMCPU_IS_6362()) mask = CKCTL_6362_HSSPI_EN; @@ -98,7 +98,7 @@ Signed-off-by: Jonas Gorski else return; -@@ -307,6 +319,8 @@ static void pcie_set(struct clk *clk, in +@@ -351,6 +363,8 @@ static void pcie_set(struct clk *clk, in bcm_hwclock_set(CKCTL_6328_PCIE_EN, enable); else if (BCMCPU_IS_6362()) bcm_hwclock_set(CKCTL_6362_PCIE_EN, enable); @@ -107,28 +107,39 @@ Signed-off-by: Jonas Gorski } static struct clk clk_pcie = { -@@ -389,9 +403,11 @@ struct clk *clk_get(struct device *dev, - return &clk_periph; - if ((BCMCPU_IS_3368() || BCMCPU_IS_6358()) && !strcmp(id, "pcm")) - return &clk_pcm; -- if ((BCMCPU_IS_6362() || BCMCPU_IS_6368()) && !strcmp(id, "ipsec")) -+ if ((BCMCPU_IS_6362() || BCMCPU_IS_6368() || BCMCPU_IS_63268()) && -+ !strcmp(id, "ipsec")) - return &clk_ipsec; -- if ((BCMCPU_IS_6328() || BCMCPU_IS_6362()) && !strcmp(id, "pcie")) -+ if ((BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_63268()) && -+ !strcmp(id, "pcie")) - return &clk_pcie; - return ERR_PTR(-ENOENT); - } -@@ -414,6 +430,7 @@ static int __init bcm63xx_clk_init(void) - clk_hsspi.rate = HSSPI_PLL_HZ_6328; +@@ -532,6 +546,21 @@ static struct clk_lookup bcm6368_clks[] + CLKDEV_INIT(NULL, "ipsec", &clk_ipsec), + }; + ++static struct clk_lookup bcm63268_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), ++ CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), ++ /* gated clocks */ ++ CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), ++ CLKDEV_INIT(NULL, "usbh", &clk_usbh), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbd), ++ CLKDEV_INIT(NULL, "spi", &clk_spi), ++ CLKDEV_INIT(NULL, "hsspi", &clk_hsspi), ++ CLKDEV_INIT(NULL, "pcie", &clk_pcie), ++}; ++ + #define HSSPI_PLL_HZ_6328 133333333 + #define HSSPI_PLL_HZ_6362 400000000 + +@@ -564,6 +593,10 @@ static int __init bcm63xx_clk_init(void) + case BCM6368_CPU_ID: + clkdev_add_table(bcm6368_clks, ARRAY_SIZE(bcm6368_clks)); break; - case BCM6362_CPU_ID: + case BCM63268_CPU_ID: - clk_hsspi.rate = HSSPI_PLL_HZ_6362; - break; ++ clk_hsspi_pll.rate = HSSPI_PLL_HZ_6362; ++ clkdev_add_table(bcm63268_clks, ARRAY_SIZE(bcm63268_clks)); ++ break; } + + return 0; --- a/arch/mips/bcm63xx/cpu.c +++ b/arch/mips/bcm63xx/cpu.c @@ -101,6 +101,15 @@ static const int bcm6368_irqs[] = { diff --git a/target/linux/brcm63xx/patches-4.4/341-MIPS-BCM63XX-add-support-for-BCM6318.patch b/target/linux/brcm63xx/patches-4.4/341-MIPS-BCM63XX-add-support-for-BCM6318.patch index 3b0995afcd..3b5da024b4 100644 --- a/target/linux/brcm63xx/patches-4.4/341-MIPS-BCM63XX-add-support-for-BCM6318.patch +++ b/target/linux/brcm63xx/patches-4.4/341-MIPS-BCM63XX-add-support-for-BCM6318.patch @@ -46,7 +46,7 @@ Subject: [PATCH 51/53] MIPS: BCM63XX: add support for BCM6318 val = bcm_mpi_readl(MPI_CSBASE_REG(0)); --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -252,7 +252,9 @@ static void hsspi_set(struct clk *clk, i +@@ -288,7 +288,9 @@ static void hsspi_set(struct clk *clk, i { u32 mask; @@ -57,23 +57,45 @@ Subject: [PATCH 51/53] MIPS: BCM63XX: add support for BCM6318 mask = CKCTL_6328_HSSPI_EN; else if (BCMCPU_IS_6362()) mask = CKCTL_6362_HSSPI_EN; -@@ -420,12 +422,16 @@ void clk_put(struct clk *clk) +@@ -440,6 +442,19 @@ static struct clk_lookup bcm3368_clks[] + CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet1), + }; - EXPORT_SYMBOL(clk_put); ++static struct clk_lookup bcm6318_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), ++ /* gated clocks */ ++ CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), ++ CLKDEV_INIT(NULL, "usbh", &clk_usbh), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbh), ++ CLKDEV_INIT(NULL, "hsspi", &clk_hsspi), ++ CLKDEV_INIT(NULL, "pcie", &clk_pcie), ++}; ++ + static struct clk_lookup bcm6328_clks[] = { + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), +@@ -561,6 +576,7 @@ static struct clk_lookup bcm63268_clks[] + CLKDEV_INIT(NULL, "pcie", &clk_pcie), + }; +#define HSSPI_PLL_HZ_6318 250000000 #define HSSPI_PLL_HZ_6328 133333333 #define HSSPI_PLL_HZ_6362 400000000 - static int __init bcm63xx_clk_init(void) - { - switch (bcm63xx_get_cpu_id()) { +@@ -570,6 +586,10 @@ static int __init bcm63xx_clk_init(void) + case BCM3368_CPU_ID: + clkdev_add_table(bcm3368_clks, ARRAY_SIZE(bcm3368_clks)); + break; + case BCM6318_CPU_ID: -+ clk_hsspi.rate = HSSPI_PLL_HZ_6318; ++ clk_hsspi_pll.rate = HSSPI_PLL_HZ_6318; ++ clkdev_add_table(bcm6318_clks, ARRAY_SIZE(bcm6318_clks)); + break; case BCM6328_CPU_ID: - clk_hsspi.rate = HSSPI_PLL_HZ_6328; - break; + clk_hsspi_pll.rate = HSSPI_PLL_HZ_6328; + clkdev_add_table(bcm6328_clks, ARRAY_SIZE(bcm6328_clks)); --- a/arch/mips/bcm63xx/cpu.c +++ b/arch/mips/bcm63xx/cpu.c @@ -41,6 +41,14 @@ static const int bcm3368_irqs[] = { diff --git a/target/linux/brcm63xx/patches-4.4/343-MIPS-BCM63XX-add-PCIe-support-for-BCM6318.patch b/target/linux/brcm63xx/patches-4.4/343-MIPS-BCM63XX-add-PCIe-support-for-BCM6318.patch index 3e28a38e02..cc2937c576 100644 --- a/target/linux/brcm63xx/patches-4.4/343-MIPS-BCM63XX-add-PCIe-support-for-BCM6318.patch +++ b/target/linux/brcm63xx/patches-4.4/343-MIPS-BCM63XX-add-PCIe-support-for-BCM6318.patch @@ -13,7 +13,7 @@ Subject: [PATCH 53/53] MIPS: BCM63XX: add PCIe support for BCM6318 --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -50,6 +50,18 @@ static void bcm_hwclock_set(u32 mask, in +@@ -51,6 +51,18 @@ static void bcm_hwclock_set(u32 mask, in bcm_perf_writel(reg, PERF_CKCTL_REG); } @@ -32,7 +32,7 @@ Subject: [PATCH 53/53] MIPS: BCM63XX: add PCIe support for BCM6318 /* * Ethernet MAC "misc" clock: dma clocks and main clock on 6348 */ -@@ -317,12 +329,17 @@ static struct clk clk_ipsec = { +@@ -361,12 +373,17 @@ static struct clk clk_ipsec = { static void pcie_set(struct clk *clk, int enable) { @@ -53,15 +53,6 @@ Subject: [PATCH 53/53] MIPS: BCM63XX: add PCIe support for BCM6318 } static struct clk clk_pcie = { -@@ -408,7 +425,7 @@ struct clk *clk_get(struct device *dev, - if ((BCMCPU_IS_6362() || BCMCPU_IS_6368() || BCMCPU_IS_63268()) && - !strcmp(id, "ipsec")) - return &clk_ipsec; -- if ((BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_63268()) && -+ if ((BCMCPU_IS_6318() || BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_63268()) && - !strcmp(id, "pcie")) - return &clk_pcie; - return ERR_PTR(-ENOENT); --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h @@ -40,6 +40,12 @@ diff --git a/target/linux/brcm63xx/patches-4.4/346-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch b/target/linux/brcm63xx/patches-4.4/346-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch index 947f7223fb..8e4efeb8db 100644 --- a/target/linux/brcm63xx/patches-4.4/346-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch +++ b/target/linux/brcm63xx/patches-4.4/346-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch @@ -1,19 +1,19 @@ --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -136,7 +136,11 @@ static struct clk clk_ephy = { +@@ -167,7 +167,11 @@ static struct clk clk_swpkt_usb = { */ static void enetsw_set(struct clk *clk, int enable) { -- if (BCMCPU_IS_6328()) +- if (BCMCPU_IS_6328()) { + if (BCMCPU_IS_6318()) { + bcm_hwclock_set(CKCTL_6318_ROBOSW250_EN | + CKCTL_6318_ROBOSW025_EN, enable); + bcm_ub_hwclock_set(UB_CKCTL_6318_ROBOSW_EN, enable); -+ } else if (BCMCPU_IS_6328()) ++ } else if (BCMCPU_IS_6328()) { bcm_hwclock_set(CKCTL_6328_ROBOSW_EN, enable); - else if (BCMCPU_IS_6362()) + } else if (BCMCPU_IS_6362()) { bcm_hwclock_set(CKCTL_6362_ROBOSW_EN, enable); -@@ -183,18 +187,22 @@ static struct clk clk_pcm = { +@@ -219,18 +223,22 @@ static struct clk clk_pcm = { */ static void usbh_set(struct clk *clk, int enable) { @@ -42,15 +42,3 @@ if (enable) msleep(100); -@@ -408,9 +416,9 @@ struct clk *clk_get(struct device *dev, - return &clk_enetsw; - if (!strcmp(id, "ephy")) - return &clk_ephy; -- if (!strcmp(id, "usbh")) -+ if (!strcmp(id, "usbh") || (BCMCPU_IS_6318() && !strcmp(id, "usbd"))) - return &clk_usbh; -- if (!strcmp(id, "usbd")) -+ if (!strcmp(id, "usbd") && !BCMCPU_IS_6318()) - return &clk_usbd; - if (!strcmp(id, "spi")) - return &clk_spi; diff --git a/target/linux/brcm63xx/patches-4.4/348-MIPS-BCM63XX-fix-BCM63268-USB-clock.patch b/target/linux/brcm63xx/patches-4.4/348-MIPS-BCM63XX-fix-BCM63268-USB-clock.patch index 10edbc4dda..0b8a5a1706 100644 --- a/target/linux/brcm63xx/patches-4.4/348-MIPS-BCM63XX-fix-BCM63268-USB-clock.patch +++ b/target/linux/brcm63xx/patches-4.4/348-MIPS-BCM63XX-fix-BCM63268-USB-clock.patch @@ -24,7 +24,7 @@ #define STRAPBUS_6328_FCVO_MASK (0x1f << STRAPBUS_6328_FCVO_SHIFT) --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -62,6 +62,26 @@ static void bcm_ub_hwclock_set(u32 mask, +@@ -63,6 +63,26 @@ static void bcm_ub_hwclock_set(u32 mask, bcm_perf_writel(reg, PERF_UB_CKCTL_REG); } @@ -51,7 +51,7 @@ /* * Ethernet MAC "misc" clock: dma clocks and main clock on 6348 */ -@@ -199,7 +219,17 @@ static void usbh_set(struct clk *clk, in +@@ -235,7 +255,17 @@ static void usbh_set(struct clk *clk, in } else if (BCMCPU_IS_6368()) { bcm_hwclock_set(CKCTL_6368_USBH_EN, enable); } else if (BCMCPU_IS_63268()) { diff --git a/target/linux/brcm63xx/patches-4.4/376-net-bcm63xx_enet-use-named-gpio-for-ephy-reset-gpio.patch b/target/linux/brcm63xx/patches-4.4/376-net-bcm63xx_enet-use-named-gpio-for-ephy-reset-gpio.patch deleted file mode 100644 index db3fc5bc3a..0000000000 --- a/target/linux/brcm63xx/patches-4.4/376-net-bcm63xx_enet-use-named-gpio-for-ephy-reset-gpio.patch +++ /dev/null @@ -1,46 +0,0 @@ -From ec905f2ea78ec40602a685ede31c5e4f9893d196 Mon Sep 17 00:00:00 2001 -From: Jonas Gorski -Date: Sat, 21 Feb 2015 16:35:07 +0100 -Subject: [PATCH 3/6] net: bcm63xx_enet: use named gpio for ephy reset gpio - -Allow using a named optional gpio for ephy reset gpio registration. ---- - drivers/net/ethernet/broadcom/bcm63xx_enet.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - ---- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c -+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - - #include - #include "bcm63xx_enet.h" -@@ -2851,10 +2852,15 @@ static int bcm_enet_shared_probe(struct - { - struct resource *res; - void __iomem *p[3]; -+ struct gpio_desc *ephy_reset; - unsigned int i; - - memset(bcm_enet_shared_base, 0, sizeof(bcm_enet_shared_base)); - -+ ephy_reset = devm_gpiod_get_optional(&pdev->dev, "ephy-reset", GPIOD_ASIS); -+ if (IS_ERR(ephy_reset)) -+ return PTR_ERR(ephy_reset); -+ - for (i = 0; i < 3; i++) { - res = platform_get_resource(pdev, IORESOURCE_MEM, i); - p[i] = devm_ioremap_resource(&pdev->dev, res); -@@ -2864,6 +2870,9 @@ static int bcm_enet_shared_probe(struct - - memcpy(bcm_enet_shared_base, p, sizeof(bcm_enet_shared_base)); - -+ if (ephy_reset) -+ gpiod_direction_output(ephy_reset, 0); -+ - return 0; - } - diff --git a/target/linux/brcm63xx/patches-4.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch b/target/linux/brcm63xx/patches-4.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch index e71791fc66..2259b024ab 100644 --- a/target/linux/brcm63xx/patches-4.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch +++ b/target/linux/brcm63xx/patches-4.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch @@ -72,7 +72,7 @@ Signed-off-by: Jonas Gorski } + +static struct gpiod_lookup_table ephy_reset = { -+ .dev_id = "bcm63xx_enet_shared.0", ++ .dev_id = "bcm63xx_enet-0", + .table = { + { /* filled at runtime */ }, + { }, diff --git a/target/linux/brcm63xx/patches-4.4/381-net-bcm63xx_enet-fully-reset-ephy.patch b/target/linux/brcm63xx/patches-4.4/381-net-bcm63xx_enet-fully-reset-ephy.patch deleted file mode 100644 index dc9e3c1344..0000000000 --- a/target/linux/brcm63xx/patches-4.4/381-net-bcm63xx_enet-fully-reset-ephy.patch +++ /dev/null @@ -1,28 +0,0 @@ -From: Jonas Gorski -Subject: [PATCH] net: bcm63xx_enet: fully reset ephy - -Signed-off-by: Jonas Gorski ---- - drivers/net/ethernet/broadcom/bcm63xx_enet.c | 4 ++-- - 1 file changed, 2 insertions(+), , 1 deletions(-) - ---- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c -+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -2857,7 +2857,7 @@ static int bcm_enet_shared_probe(struct - - memset(bcm_enet_shared_base, 0, sizeof(bcm_enet_shared_base)); - -- ephy_reset = devm_gpiod_get_optional(&pdev->dev, "ephy-reset", GPIOD_ASIS); -+ ephy_reset = devm_gpiod_get_optional(&pdev->dev, "ephy-reset", GPIOD_OUT_HIGH); - if (IS_ERR(ephy_reset)) - return PTR_ERR(ephy_reset); - -@@ -2871,7 +2871,7 @@ static int bcm_enet_shared_probe(struct - memcpy(bcm_enet_shared_base, p, sizeof(bcm_enet_shared_base)); - - if (ephy_reset) -- gpiod_direction_output(ephy_reset, 0); -+ gpiod_set_value(ephy_reset, 0); - - return 0; - } diff --git a/target/linux/brcm63xx/patches-4.4/389-MIPS-BCM63XX-add-clkdev-lookups-for-device-tree.patch b/target/linux/brcm63xx/patches-4.4/389-MIPS-BCM63XX-add-clkdev-lookups-for-device-tree.patch new file mode 100644 index 0000000000..3b2dda1218 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/389-MIPS-BCM63XX-add-clkdev-lookups-for-device-tree.patch @@ -0,0 +1,105 @@ +From cad8f63047c0691e8185d3c9c6a2705b83310c9c Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Mon, 31 Jul 2017 20:10:36 +0200 +Subject: [PATCH] MIPS: BCM63XX: add clkdev lookups for device tree + +--- + arch/mips/bcm63xx/clk.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +--- a/arch/mips/bcm63xx/clk.c ++++ b/arch/mips/bcm63xx/clk.c +@@ -485,6 +485,8 @@ static struct clk_lookup bcm3368_clks[] + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), ++ CLKDEV_INIT("fff8c100.serial", "refclk", &clk_periph), ++ CLKDEV_INIT("fff8c120.serial", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -501,7 +503,9 @@ static struct clk_lookup bcm6318_clks[] + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("10000100.serial", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), ++ CLKDEV_INIT("10003000.spi", "pll", &clk_hsspi_pll), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), +@@ -515,7 +519,10 @@ static struct clk_lookup bcm6328_clks[] + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), ++ CLKDEV_INIT("10000100.serial", "refclk", &clk_periph), ++ CLKDEV_INIT("10000120.serial", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), ++ CLKDEV_INIT("10001000.spi", "pll", &clk_hsspi_pll), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), +@@ -528,6 +535,7 @@ static struct clk_lookup bcm6338_clks[] + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("fffe0300.serial", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -542,6 +550,7 @@ static struct clk_lookup bcm6345_clks[] + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("fffe0300.serial", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -556,6 +565,7 @@ static struct clk_lookup bcm6348_clks[] + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("fffe0300.serial", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -572,6 +582,8 @@ static struct clk_lookup bcm6358_clks[] + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), ++ CLKDEV_INIT("fffe0100.serial", "refclk", &clk_periph), ++ CLKDEV_INIT("fffe0120.serial", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -591,7 +603,10 @@ static struct clk_lookup bcm6362_clks[] + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), ++ CLKDEV_INIT("10000100.serial", "refclk", &clk_periph), ++ CLKDEV_INIT("10000120.serial", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), ++ CLKDEV_INIT("10001000.spi", "pll", &clk_hsspi_pll), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), +@@ -607,6 +622,8 @@ static struct clk_lookup bcm6368_clks[] + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), ++ CLKDEV_INIT("10000100.serial", "refclk", &clk_periph), ++ CLKDEV_INIT("10000120.serial", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), +@@ -621,7 +638,10 @@ static struct clk_lookup bcm63268_clks[] + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), ++ CLKDEV_INIT("10000180.serial", "refclk", &clk_periph), ++ CLKDEV_INIT("100001a0.serial", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), ++ CLKDEV_INIT("10001000.spi", "pll", &clk_hsspi_pll), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), diff --git a/target/linux/brcm63xx/patches-4.4/390-MIPS-BCM63XX-do-not-register-SPI-controllers.patch b/target/linux/brcm63xx/patches-4.4/390-MIPS-BCM63XX-do-not-register-SPI-controllers.patch index 10db690b5e..084ef9ee89 100644 --- a/target/linux/brcm63xx/patches-4.4/390-MIPS-BCM63XX-do-not-register-SPI-controllers.patch +++ b/target/linux/brcm63xx/patches-4.4/390-MIPS-BCM63XX-do-not-register-SPI-controllers.patch @@ -33,3 +33,138 @@ Signed-off-by: Jonas Gorski bcm63xx_flash_register(); bcm63xx_led_data.num_leds = ARRAY_SIZE(board.leds); +--- a/arch/mips/bcm63xx/Makefile ++++ b/arch/mips/bcm63xx/Makefile +@@ -1,6 +1,6 @@ + obj-y += clk.o cpu.o cs.o gpio.o irq.o nvram.o prom.o reset.o \ + setup.o timer.o dev-dsp.o dev-enet.o dev-flash.o \ +- dev-pcmcia.o dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o \ ++ dev-pcmcia.o dev-rng.o dev-uart.o \ + dev-wdt.o dev-usb-ehci.o dev-usb-ohci.o dev-usb-usbd.o \ + usb-common.o sprom.o + obj-$(CONFIG_EARLY_PRINTK) += early_printk.o +--- a/arch/mips/bcm63xx/dev-hsspi.c ++++ /dev/null +@@ -1,48 +0,0 @@ +-/* +- * This file is subject to the terms and conditions of the GNU General Public +- * License. See the file "COPYING" in the main directory of this archive +- * for more details. +- * +- * Copyright (C) 2012 Jonas Gorski +- */ +- +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-static struct resource spi_resources[] = { +- { +- .start = -1, /* filled at runtime */ +- .end = -1, /* filled at runtime */ +- .flags = IORESOURCE_MEM, +- }, +- { +- .start = -1, /* filled at runtime */ +- .flags = IORESOURCE_IRQ, +- }, +-}; +- +-static struct platform_device bcm63xx_hsspi_device = { +- .name = "bcm63xx-hsspi", +- .id = 0, +- .num_resources = ARRAY_SIZE(spi_resources), +- .resource = spi_resources, +-}; +- +-int __init bcm63xx_hsspi_register(void) +-{ +- if (!BCMCPU_IS_6318() && !BCMCPU_IS_6328() && !BCMCPU_IS_6362() && +- !BCMCPU_IS_63268()) +- return -ENODEV; +- +- spi_resources[0].start = bcm63xx_regset_address(RSET_HSSPI); +- spi_resources[0].end = spi_resources[0].start; +- spi_resources[0].end += RSET_HSSPI_SIZE - 1; +- spi_resources[1].start = bcm63xx_get_irq_number(IRQ_HSSPI); +- +- return platform_device_register(&bcm63xx_hsspi_device); +-} +--- a/arch/mips/bcm63xx/dev-spi.c ++++ /dev/null +@@ -1,60 +0,0 @@ +-/* +- * This file is subject to the terms and conditions of the GNU General Public +- * License. See the file "COPYING" in the main directory of this archive +- * for more details. +- * +- * Copyright (C) 2009-2011 Florian Fainelli +- * Copyright (C) 2010 Tanguy Bouzeloc +- */ +- +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-static struct resource spi_resources[] = { +- { +- .start = -1, /* filled at runtime */ +- .end = -1, /* filled at runtime */ +- .flags = IORESOURCE_MEM, +- }, +- { +- .start = -1, /* filled at runtime */ +- .flags = IORESOURCE_IRQ, +- }, +-}; +- +-static struct platform_device bcm63xx_spi_device = { +- .id = -1, +- .num_resources = ARRAY_SIZE(spi_resources), +- .resource = spi_resources, +-}; +- +-int __init bcm63xx_spi_register(void) +-{ +- if (BCMCPU_IS_6318() || BCMCPU_IS_6328() || BCMCPU_IS_6345()) +- return -ENODEV; +- +- spi_resources[0].start = bcm63xx_regset_address(RSET_SPI); +- spi_resources[0].end = spi_resources[0].start; +- spi_resources[1].start = bcm63xx_get_irq_number(IRQ_SPI); +- +- if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) { +- bcm63xx_spi_device.name = "bcm6348-spi", +- spi_resources[0].end += BCM_6348_RSET_SPI_SIZE - 1; +- } +- +- if (BCMCPU_IS_3368() || BCMCPU_IS_6358() || BCMCPU_IS_6362() || +- BCMCPU_IS_6368() || BCMCPU_IS_63268()) { +- bcm63xx_spi_device.name = "bcm6358-spi", +- spi_resources[0].end += BCM_6358_RSET_SPI_SIZE - 1; +- } +- +- return platform_device_register(&bcm63xx_spi_device); +-} +--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_hsspi.h ++++ /dev/null +@@ -1,8 +0,0 @@ +-#ifndef BCM63XX_DEV_HSSPI_H +-#define BCM63XX_DEV_HSSPI_H +- +-#include +- +-int bcm63xx_hsspi_register(void); +- +-#endif /* BCM63XX_DEV_HSSPI_H */ diff --git a/target/linux/brcm63xx/patches-4.4/391-MIPS-BCM63XX-do-not-register-uart.patch b/target/linux/brcm63xx/patches-4.4/391-MIPS-BCM63XX-do-not-register-uart.patch new file mode 100644 index 0000000000..e033ea3a4b --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/391-MIPS-BCM63XX-do-not-register-uart.patch @@ -0,0 +1,257 @@ +--- a/arch/mips/bcm63xx/Makefile ++++ b/arch/mips/bcm63xx/Makefile +@@ -1,6 +1,6 @@ + obj-y += clk.o cpu.o cs.o gpio.o irq.o nvram.o prom.o reset.o \ + setup.o timer.o dev-dsp.o dev-enet.o dev-flash.o \ +- dev-pcmcia.o dev-rng.o dev-uart.o \ ++ dev-pcmcia.o dev-rng.o \ + dev-wdt.o dev-usb-ehci.o dev-usb-ohci.o dev-usb-usbd.o \ + usb-common.o sprom.o + obj-$(CONFIG_EARLY_PRINTK) += early_printk.o +--- a/arch/mips/bcm63xx/dev-uart.c ++++ /dev/null +@@ -1,76 +0,0 @@ +-/* +- * This file is subject to the terms and conditions of the GNU General Public +- * License. See the file "COPYING" in the main directory of this archive +- * for more details. +- * +- * Copyright (C) 2008 Maxime Bizon +- */ +- +-#include +-#include +-#include +-#include +- +-static struct resource uart0_resources[] = { +- { +- /* start & end filled at runtime */ +- .flags = IORESOURCE_MEM, +- }, +- { +- /* start filled at runtime */ +- .flags = IORESOURCE_IRQ, +- }, +-}; +- +-static struct resource uart1_resources[] = { +- { +- /* start & end filled at runtime */ +- .flags = IORESOURCE_MEM, +- }, +- { +- /* start filled at runtime */ +- .flags = IORESOURCE_IRQ, +- }, +-}; +- +-static struct platform_device bcm63xx_uart_devices[] = { +- { +- .name = "bcm63xx_uart", +- .id = 0, +- .num_resources = ARRAY_SIZE(uart0_resources), +- .resource = uart0_resources, +- }, +- +- { +- .name = "bcm63xx_uart", +- .id = 1, +- .num_resources = ARRAY_SIZE(uart1_resources), +- .resource = uart1_resources, +- } +-}; +- +-int __init bcm63xx_uart_register(unsigned int id) +-{ +- if (id >= ARRAY_SIZE(bcm63xx_uart_devices)) +- return -ENODEV; +- +- if (id == 1 && (!BCMCPU_IS_3368() && !BCMCPU_IS_6358() && +- !BCMCPU_IS_6368())) +- return -ENODEV; +- +- if (id == 0) { +- uart0_resources[0].start = bcm63xx_regset_address(RSET_UART0); +- uart0_resources[0].end = uart0_resources[0].start + +- RSET_UART_SIZE - 1; +- uart0_resources[1].start = bcm63xx_get_irq_number(IRQ_UART0); +- } +- +- if (id == 1) { +- uart1_resources[0].start = bcm63xx_regset_address(RSET_UART1); +- uart1_resources[0].end = uart1_resources[0].start + +- RSET_UART_SIZE - 1; +- uart1_resources[1].start = bcm63xx_get_irq_number(IRQ_UART1); +- } +- +- return platform_device_register(&bcm63xx_uart_devices[id]); +-} +--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_uart.h ++++ /dev/null +@@ -1,6 +0,0 @@ +-#ifndef BCM63XX_DEV_UART_H_ +-#define BCM63XX_DEV_UART_H_ +- +-int bcm63xx_uart_register(unsigned int id); +- +-#endif /* BCM63XX_DEV_UART_H_ */ +--- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h ++++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h +@@ -33,8 +33,6 @@ struct board_info { + unsigned int has_ehci0:1; + unsigned int has_usbd:1; + unsigned int has_dsp:1; +- unsigned int has_uart0:1; +- unsigned int has_uart1:1; + unsigned int use_fallback_sprom:1; + + /* ethernet config */ +--- a/arch/mips/bcm63xx/boards/board_common.c ++++ b/arch/mips/bcm63xx/boards/board_common.c +@@ -20,7 +20,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -189,12 +188,6 @@ int __init board_register_devices(void) + + bcm63xx_gpio_init(); + +- if (board.has_uart0) +- bcm63xx_uart_register(0); +- +- if (board.has_uart1) +- bcm63xx_uart_register(1); +- + if (board.has_pccard) + bcm63xx_pcmcia_register(); + +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -35,9 +35,6 @@ static struct board_info __initdata boar + .name = "CVG834G_E15R3921", + .expected_cpu_id = 0x3368, + +- .has_uart0 = 1, +- .has_uart1 = 1, +- + .has_enet0 = 1, + .has_pci = 1, + +@@ -67,7 +64,6 @@ static struct board_info __initdata boar + .name = "96328avng", + .expected_cpu_id = 0x6328, + +- .has_uart0 = 1, + .has_pci = 1, + .has_usbd = 0, + .use_fallback_sprom = 1, +@@ -116,7 +112,6 @@ static struct board_info __initdata boar + .name = "96338GW", + .expected_cpu_id = 0x6338, + +- .has_uart0 = 1, + .has_enet0 = 1, + .enet0 = { + .force_speed_100 = 1, +@@ -159,7 +154,6 @@ static struct board_info __initdata boar + .name = "96338W", + .expected_cpu_id = 0x6338, + +- .has_uart0 = 1, + .has_enet0 = 1, + .enet0 = { + .force_speed_100 = 1, +@@ -204,8 +198,6 @@ static struct board_info __initdata boar + static struct board_info __initdata board_96345gw2 = { + .name = "96345GW2", + .expected_cpu_id = 0x6345, +- +- .has_uart0 = 1, + }; + #endif + +@@ -217,7 +209,6 @@ static struct board_info __initdata boar + .name = "96348R", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, +@@ -262,7 +253,6 @@ static struct board_info __initdata boar + .name = "96348GW-10", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -323,7 +313,6 @@ static struct board_info __initdata boar + .name = "96348GW-11", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -378,7 +367,6 @@ static struct board_info __initdata boar + .name = "96348GW", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -437,7 +425,6 @@ static struct board_info __initdata boar + .name = "F@ST2404", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -482,7 +469,6 @@ static struct board_info __initdata boar + .name = "DV201AMR", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, +@@ -503,7 +489,6 @@ static struct board_info __initdata boar + .name = "96348GW-A", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -530,7 +515,6 @@ static struct board_info __initdata boar + .name = "96358VW", + .expected_cpu_id = 0x6358, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -583,7 +567,6 @@ static struct board_info __initdata boar + .name = "96358VW2", + .expected_cpu_id = 0x6358, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -633,7 +616,6 @@ static struct board_info __initdata boar + .name = "AGPF-S0", + .expected_cpu_id = 0x6358, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, diff --git a/target/linux/brcm63xx/patches-4.4/550-MIPS-BCM63XX-remove-leds-and-buttons.patch b/target/linux/brcm63xx/patches-4.4/392-MIPS-BCM63XX-remove-leds-and-buttons.patch similarity index 85% rename from target/linux/brcm63xx/patches-4.4/550-MIPS-BCM63XX-remove-leds-and-buttons.patch rename to target/linux/brcm63xx/patches-4.4/392-MIPS-BCM63XX-remove-leds-and-buttons.patch index 2ae8107acd..1bbbf91441 100644 --- a/target/linux/brcm63xx/patches-4.4/550-MIPS-BCM63XX-remove-leds-and-buttons.patch +++ b/target/linux/brcm63xx/patches-4.4/392-MIPS-BCM63XX-remove-leds-and-buttons.patch @@ -9,7 +9,7 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -47,14 +47,6 @@ static struct board_info __initdata boar +@@ -43,14 +43,6 @@ static struct board_info __initdata boar .use_internal_phy = 1, }, @@ -24,10 +24,11 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons .ephy_reset_gpio = 36, .ephy_reset_gpio_flags = GPIO_ACTIVE_LOW, }; -@@ -78,35 +70,6 @@ static struct board_info __initdata boar +@@ -72,35 +64,6 @@ static struct board_info __initdata boar + .use_fullspeed = 0, .port_no = 0, }, - +- - .leds = { - { - .name = "96328avng::ppp-fail", @@ -56,11 +57,10 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons - .active_low = 1, - }, - }, -- - .has_enetsw = 1, + }; + #endif - .enetsw = { -@@ -445,35 +408,6 @@ static struct board_info __initdata boar +@@ -119,35 +82,6 @@ static struct board_info __initdata boar }, .has_ohci0 = 1, @@ -96,7 +96,7 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons }; static struct board_info __initdata board_96338w = { -@@ -488,35 +422,6 @@ static struct board_info __initdata boar +@@ -159,35 +93,6 @@ static struct board_info __initdata boar .force_speed_100 = 1, .force_duplex_full = 1, }, @@ -130,9 +130,9 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons - }, - }, }; + #endif - static struct board_info __initdata board_96338w2_e7t = { -@@ -615,36 +520,6 @@ static struct board_info __initdata boar +@@ -217,36 +122,6 @@ static struct board_info __initdata boar .has_phy = 1, .use_internal_phy = 1, }, @@ -169,7 +169,7 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons }; static struct board_info __initdata board_96348gw_10 = { -@@ -679,35 +554,6 @@ static struct board_info __initdata boar +@@ -278,35 +153,6 @@ static struct board_info __initdata boar .cs = 2, .ext_irq = 2, }, @@ -205,7 +205,7 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons }; static struct board_info __initdata board_96348gw_11 = { -@@ -736,35 +582,6 @@ static struct board_info __initdata boar +@@ -332,35 +178,6 @@ static struct board_info __initdata boar .has_ohci0 = 1, .has_pccard = 1, .has_ehci0 = 1, @@ -240,8 +240,8 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons - }, }; - -@@ -897,35 +714,6 @@ static struct board_info __initdata boar + static struct board_info __initdata board_96348gw = { +@@ -390,35 +207,6 @@ static struct board_info __initdata boar .ext_irq = 2, .cs = 2, }, @@ -276,8 +276,8 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons - }, }; - static struct board_info __initdata board_gw6200 = { -@@ -1262,33 +1050,6 @@ static struct board_info __initdata boar + static struct board_info __initdata board_FAST2404 = { +@@ -534,33 +322,6 @@ static struct board_info __initdata boar .has_ohci0 = 1, .has_pccard = 1, .has_ehci0 = 1, @@ -311,7 +311,7 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons }; static struct board_info __initdata board_96358vw2 = { -@@ -1318,29 +1079,6 @@ static struct board_info __initdata boar +@@ -587,29 +348,6 @@ static struct board_info __initdata boar .has_pccard = 1, .has_ehci0 = 1, .num_usbh_ports = 2, @@ -340,4 +340,4 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons - }, }; - static struct board_info __initdata board_CPVA642 = { + static struct board_info __initdata board_AGPFS0 = { diff --git a/target/linux/brcm63xx/patches-4.4/403-6358-enet1-external-mii-clk.patch b/target/linux/brcm63xx/patches-4.4/403-6358-enet1-external-mii-clk.patch index 334a934222..9227eb28a8 100644 --- a/target/linux/brcm63xx/patches-4.4/403-6358-enet1-external-mii-clk.patch +++ b/target/linux/brcm63xx/patches-4.4/403-6358-enet1-external-mii-clk.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -99,6 +99,8 @@ void __init board_early_setup(const stru +@@ -98,6 +98,8 @@ void __init board_early_setup(const stru if (BCMCPU_IS_6348()) val |= GPIO_MODE_6348_G3_EXT_MII | GPIO_MODE_6348_G0_EXT_MII; diff --git a/target/linux/brcm63xx/patches-4.4/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch b/target/linux/brcm63xx/patches-4.4/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch index a1acd614af..7c2b686a98 100644 --- a/target/linux/brcm63xx/patches-4.4/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch +++ b/target/linux/brcm63xx/patches-4.4/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch @@ -15,7 +15,7 @@ Signed-off-by: Jonas Gorski --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -871,10 +871,8 @@ static int bcm_enet_open(struct net_devi +@@ -870,10 +870,8 @@ static int bcm_enet_open(struct net_devi struct bcm_enet_priv *priv; struct sockaddr addr; struct device *kdev; @@ -26,7 +26,7 @@ Signed-off-by: Jonas Gorski void *p; u32 val; -@@ -882,40 +880,10 @@ static int bcm_enet_open(struct net_devi +@@ -881,40 +879,10 @@ static int bcm_enet_open(struct net_devi kdev = &priv->pdev->dev; if (priv->has_phy) { @@ -68,7 +68,7 @@ Signed-off-by: Jonas Gorski } /* mask all interrupts and request them */ -@@ -925,7 +893,7 @@ static int bcm_enet_open(struct net_devi +@@ -924,7 +892,7 @@ static int bcm_enet_open(struct net_devi ret = request_irq(dev->irq, bcm_enet_isr_mac, 0, dev->name, dev); if (ret) @@ -100,7 +100,7 @@ Signed-off-by: Jonas Gorski return 0; } -@@ -1830,6 +1789,8 @@ static int bcm_enet_probe(struct platfor +@@ -1832,6 +1791,8 @@ static int bcm_enet_probe(struct platfor /* MII bus registration */ if (priv->has_phy) { @@ -109,7 +109,7 @@ Signed-off-by: Jonas Gorski priv->mii_bus = mdiobus_alloc(); if (!priv->mii_bus) { -@@ -1867,6 +1828,38 @@ static int bcm_enet_probe(struct platfor +@@ -1869,6 +1830,38 @@ static int bcm_enet_probe(struct platfor dev_err(&pdev->dev, "unable to register mdio bus\n"); goto out_free_mdio; } @@ -148,7 +148,7 @@ Signed-off-by: Jonas Gorski } else { /* run platform code to initialize PHY device */ -@@ -1912,6 +1905,9 @@ static int bcm_enet_probe(struct platfor +@@ -1914,6 +1907,9 @@ static int bcm_enet_probe(struct platfor return 0; out_unregister_mdio: @@ -158,7 +158,7 @@ Signed-off-by: Jonas Gorski if (priv->mii_bus) mdiobus_unregister(priv->mii_bus); -@@ -1953,6 +1949,8 @@ static int bcm_enet_remove(struct platfo +@@ -1951,6 +1947,8 @@ static int bcm_enet_remove(struct platfo enet_writel(priv, 0, ENET_MIISC_REG); if (priv->has_phy) { diff --git a/target/linux/brcm63xx/patches-4.4/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch b/target/linux/brcm63xx/patches-4.4/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch index 1cff9c1ff9..cf3715e4fe 100644 --- a/target/linux/brcm63xx/patches-4.4/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch +++ b/target/linux/brcm63xx/patches-4.4/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch @@ -32,7 +32,7 @@ Subject: [PATCH 54/81] bcm63xx_enet: enable rgmii clock on external ports #define ENETSW_MDIOC_EXT_MASK (1 << 16) --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -2229,6 +2229,18 @@ static int bcm_enetsw_open(struct net_de +@@ -2223,6 +2223,18 @@ static int bcm_enetsw_open(struct net_de priv->sw_port_link[i] = 0; } diff --git a/target/linux/brcm63xx/patches-4.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch b/target/linux/brcm63xx/patches-4.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch index 6dab40d7e1..608ad8e39a 100644 --- a/target/linux/brcm63xx/patches-4.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch +++ b/target/linux/brcm63xx/patches-4.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch @@ -11,7 +11,7 @@ Signed-off-by: Jonas Gorski --- a/arch/mips/bcm63xx/dev-flash.c +++ b/arch/mips/bcm63xx/dev-flash.c -@@ -17,9 +17,13 @@ +@@ -17,6 +17,9 @@ #include #include #include @@ -21,11 +21,7 @@ Signed-off-by: Jonas Gorski #include #include -+#include - #include - #include - -@@ -66,6 +70,41 @@ void __init bcm63xx_flash_force_phys_bas +@@ -66,6 +69,41 @@ void __init bcm63xx_flash_force_phys_bas mtd_resources[0].end = end; } @@ -67,7 +63,7 @@ Signed-off-by: Jonas Gorski static int __init bcm63xx_detect_flash_type(void) { u32 val; -@@ -73,9 +112,15 @@ static int __init bcm63xx_detect_flash_t +@@ -73,9 +111,15 @@ static int __init bcm63xx_detect_flash_t switch (bcm63xx_get_cpu_id()) { case BCM6318_CPU_ID: /* only support serial flash */ @@ -83,7 +79,7 @@ Signed-off-by: Jonas Gorski if (val & STRAPBUS_6328_BOOT_SEL_SERIAL) return BCM63XX_FLASH_TYPE_SERIAL; else -@@ -94,12 +139,20 @@ static int __init bcm63xx_detect_flash_t +@@ -94,12 +138,20 @@ static int __init bcm63xx_detect_flash_t return BCM63XX_FLASH_TYPE_SERIAL; case BCM6362_CPU_ID: val = bcm_misc_readl(MISC_STRAPBUS_6362_REG); @@ -104,7 +100,7 @@ Signed-off-by: Jonas Gorski switch (val & STRAPBUS_6368_BOOT_SEL_MASK) { case STRAPBUS_6368_BOOT_SEL_NAND: return BCM63XX_FLASH_TYPE_NAND; -@@ -110,6 +163,11 @@ static int __init bcm63xx_detect_flash_t +@@ -110,6 +162,11 @@ static int __init bcm63xx_detect_flash_t } case BCM63268_CPU_ID: val = bcm_misc_readl(MISC_STRAPBUS_63268_REG); @@ -116,7 +112,7 @@ Signed-off-by: Jonas Gorski if (val & STRAPBUS_63268_BOOT_SEL_SERIAL) return BCM63XX_FLASH_TYPE_SERIAL; else -@@ -176,6 +234,7 @@ void __init bcm63xx_flash_detect(void) +@@ -176,6 +233,7 @@ void __init bcm63xx_flash_detect(void) int __init bcm63xx_flash_register(void) { @@ -124,7 +120,7 @@ Signed-off-by: Jonas Gorski u32 val; switch (flash_type) { -@@ -195,8 +254,14 @@ int __init bcm63xx_flash_register(void) +@@ -195,8 +253,14 @@ int __init bcm63xx_flash_register(void) return platform_device_register(&mtd_dev); case BCM63XX_FLASH_TYPE_SERIAL: diff --git a/target/linux/brcm63xx/patches-4.4/413-BCM63XX-allow-providing-fixup-data-in-board-data.patch b/target/linux/brcm63xx/patches-4.4/413-BCM63XX-allow-providing-fixup-data-in-board-data.patch index d86e6a05fa..a0ad6e6ce5 100644 --- a/target/linux/brcm63xx/patches-4.4/413-BCM63XX-allow-providing-fixup-data-in-board-data.patch +++ b/target/linux/brcm63xx/patches-4.4/413-BCM63XX-allow-providing-fixup-data-in-board-data.patch @@ -10,7 +10,7 @@ Subject: [PATCH 58/72] BCM63XX: allow providing fixup data in board data --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -33,6 +33,7 @@ +@@ -32,6 +32,7 @@ #include #include #include @@ -18,7 +18,7 @@ Subject: [PATCH 58/72] BCM63XX: allow providing fixup data in board data #include "board_common.h" -@@ -179,6 +180,7 @@ static struct of_device_id of_ids[] = { +@@ -178,6 +179,7 @@ static struct of_device_id of_ids[] = { int __init board_register_devices(void) { int usbh_ports = 0; @@ -26,7 +26,7 @@ Subject: [PATCH 58/72] BCM63XX: allow providing fixup data in board data #if CONFIG_OF if (of_have_populated_dt()) { -@@ -252,6 +254,10 @@ int __init board_register_devices(void) +@@ -245,6 +247,10 @@ int __init board_register_devices(void) board.ephy_reset_gpio_flags); } @@ -59,9 +59,9 @@ Subject: [PATCH 58/72] BCM63XX: allow providing fixup data in board data /* * board definition */ -@@ -36,6 +42,10 @@ struct board_info { - unsigned int has_uart0:1; - unsigned int has_uart1:1; +@@ -34,6 +40,10 @@ struct board_info { + unsigned int has_usbd:1; + unsigned int has_dsp:1; unsigned int use_fallback_sprom:1; + unsigned int has_caldata:2; + diff --git a/target/linux/brcm63xx/patches-4.4/415-MIPS-BCM63XX-export-the-attached-flash-type.patch b/target/linux/brcm63xx/patches-4.4/415-MIPS-BCM63XX-export-the-attached-flash-type.patch index 9eb4e5e09d..94c63c5e80 100644 --- a/target/linux/brcm63xx/patches-4.4/415-MIPS-BCM63XX-export-the-attached-flash-type.patch +++ b/target/linux/brcm63xx/patches-4.4/415-MIPS-BCM63XX-export-the-attached-flash-type.patch @@ -11,7 +11,7 @@ Signed-off-by: Jonas Gorski --- a/arch/mips/bcm63xx/dev-flash.c +++ b/arch/mips/bcm63xx/dev-flash.c -@@ -271,3 +271,8 @@ int __init bcm63xx_flash_register(void) +@@ -270,3 +270,8 @@ int __init bcm63xx_flash_register(void) return -ENODEV; } } diff --git a/target/linux/brcm63xx/patches-4.4/416-BCM63XX-add-a-fixup-for-ath9k-devices.patch b/target/linux/brcm63xx/patches-4.4/416-BCM63XX-add-a-fixup-for-ath9k-devices.patch index 7d012167c2..0f6706a6b2 100644 --- a/target/linux/brcm63xx/patches-4.4/416-BCM63XX-add-a-fixup-for-ath9k-devices.patch +++ b/target/linux/brcm63xx/patches-4.4/416-BCM63XX-add-a-fixup-for-ath9k-devices.patch @@ -15,7 +15,7 @@ Subject: [PATCH 61/72] BCM63XX: add a fixup for ath9k devices +++ b/arch/mips/bcm63xx/Makefile @@ -2,7 +2,7 @@ obj-y += clk.o cpu.o cs.o gpio.o irq.o setup.o timer.o dev-dsp.o dev-enet.o dev-flash.o \ - dev-pcmcia.o dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o \ + dev-pcmcia.o dev-rng.o \ dev-wdt.o dev-usb-ehci.o dev-usb-ohci.o dev-usb-usbd.o \ - usb-common.o sprom.o + pci-ath9k-fixup.o usb-common.o sprom.o @@ -24,7 +24,7 @@ Subject: [PATCH 61/72] BCM63XX: add a fixup for ath9k devices obj-y += boards/ --- /dev/null +++ b/arch/mips/bcm63xx/pci-ath9k-fixup.c -@@ -0,0 +1,201 @@ +@@ -0,0 +1,200 @@ +/* + * Broadcom BCM63XX Ath9k EEPROM fixup helper. + * @@ -52,7 +52,6 @@ Subject: [PATCH 61/72] BCM63XX: add a fixup for ath9k devices +#include +#include +#include -+#include +#include + +#define bcm_hsspi_writel(v, o) bcm_rset_writel(RSET_HSSPI, (v), (o)) diff --git a/target/linux/brcm63xx/patches-4.4/420-BCM63XX-add-endian-check-for-ath9k.patch b/target/linux/brcm63xx/patches-4.4/420-BCM63XX-add-endian-check-for-ath9k.patch index f314e018f4..8921f2d9b8 100644 --- a/target/linux/brcm63xx/patches-4.4/420-BCM63XX-add-endian-check-for-ath9k.patch +++ b/target/linux/brcm63xx/patches-4.4/420-BCM63XX-add-endian-check-for-ath9k.patch @@ -21,7 +21,7 @@ /* --- a/arch/mips/bcm63xx/pci-ath9k-fixup.c +++ b/arch/mips/bcm63xx/pci-ath9k-fixup.c -@@ -183,12 +183,14 @@ static void ath9k_pci_fixup(struct pci_d +@@ -182,12 +182,14 @@ static void ath9k_pci_fixup(struct pci_d } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATHEROS, PCI_ANY_ID, ath9k_pci_fixup); @@ -39,7 +39,7 @@ return; --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -256,7 +256,8 @@ int __init board_register_devices(void) +@@ -249,7 +249,8 @@ int __init board_register_devices(void) /* register any fixups */ for (i = 0; i < board.has_caldata; i++) diff --git a/target/linux/brcm63xx/patches-4.4/421-BCM63XX-add-led-pin-for-ath9k.patch b/target/linux/brcm63xx/patches-4.4/421-BCM63XX-add-led-pin-for-ath9k.patch index ccd3160a3b..3ccf6dcdf0 100644 --- a/target/linux/brcm63xx/patches-4.4/421-BCM63XX-add-led-pin-for-ath9k.patch +++ b/target/linux/brcm63xx/patches-4.4/421-BCM63XX-add-led-pin-for-ath9k.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -257,7 +257,7 @@ int __init board_register_devices(void) +@@ -250,7 +250,7 @@ int __init board_register_devices(void) /* register any fixups */ for (i = 0; i < board.has_caldata; i++) pci_enable_ath9k_fixup(board.caldata[i].slot, board.caldata[i].caldata_offset, @@ -11,7 +11,7 @@ } --- a/arch/mips/bcm63xx/pci-ath9k-fixup.c +++ b/arch/mips/bcm63xx/pci-ath9k-fixup.c -@@ -184,13 +184,15 @@ static void ath9k_pci_fixup(struct pci_d +@@ -183,13 +183,15 @@ static void ath9k_pci_fixup(struct pci_d DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATHEROS, PCI_ANY_ID, ath9k_pci_fixup); void __init pci_enable_ath9k_fixup(unsigned slot, u32 offset, diff --git a/target/linux/brcm63xx/patches-4.4/422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch b/target/linux/brcm63xx/patches-4.4/422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch index 5731cb34aa..d021b36904 100644 --- a/target/linux/brcm63xx/patches-4.4/422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch +++ b/target/linux/brcm63xx/patches-4.4/422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch @@ -19,7 +19,7 @@ Subject: [PATCH 72/72] 446-BCM63XX-add-a-fixup-for-rt2x00-devices +++ b/arch/mips/bcm63xx/Makefile @@ -2,7 +2,7 @@ obj-y += clk.o cpu.o cs.o gpio.o irq.o setup.o timer.o dev-dsp.o dev-enet.o dev-flash.o \ - dev-pcmcia.o dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o \ + dev-pcmcia.o dev-rng.o \ dev-wdt.o dev-usb-ehci.o dev-usb-ohci.o dev-usb-usbd.o \ - pci-ath9k-fixup.o usb-common.o sprom.o + pci-ath9k-fixup.o pci-rt2x00-fixup.o usb-common.o sprom.o @@ -28,7 +28,7 @@ Subject: [PATCH 72/72] 446-BCM63XX-add-a-fixup-for-rt2x00-devices obj-y += boards/ --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -34,6 +34,7 @@ +@@ -33,6 +33,7 @@ #include #include #include @@ -36,7 +36,7 @@ Subject: [PATCH 72/72] 446-BCM63XX-add-a-fixup-for-rt2x00-devices #include "board_common.h" -@@ -255,9 +256,19 @@ int __init board_register_devices(void) +@@ -248,9 +249,19 @@ int __init board_register_devices(void) } /* register any fixups */ @@ -162,7 +162,7 @@ Subject: [PATCH 72/72] 446-BCM63XX-add-a-fixup-for-rt2x00-devices }; /* -@@ -48,7 +53,7 @@ struct board_info { +@@ -46,7 +51,7 @@ struct board_info { unsigned int has_caldata:2; /* wifi calibration data config */ diff --git a/target/linux/brcm63xx/patches-4.4/423-bcm63xx_enet_add_b53_support.patch b/target/linux/brcm63xx/patches-4.4/423-bcm63xx_enet_add_b53_support.patch index 19d7905114..c905cb2d44 100644 --- a/target/linux/brcm63xx/patches-4.4/423-bcm63xx_enet_add_b53_support.patch +++ b/target/linux/brcm63xx/patches-4.4/423-bcm63xx_enet_add_b53_support.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.h +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.h -@@ -336,6 +336,9 @@ struct bcm_enet_priv { +@@ -335,6 +335,9 @@ struct bcm_enet_priv { struct bcm63xx_enetsw_port used_ports[ENETSW_MAX_PORT]; int sw_port_link[ENETSW_MAX_PORT]; @@ -12,15 +12,15 @@ spinlock_t enetsw_mdio_lock; --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -31,6 +31,7 @@ +@@ -30,6 +30,7 @@ + #include #include #include - #include +#include #include #include "bcm63xx_enet.h" -@@ -1974,7 +1975,8 @@ static int bcm_enet_remove(struct platfo +@@ -1968,7 +1969,8 @@ static int bcm_enet_remove(struct platfo return 0; } @@ -30,7 +30,7 @@ .probe = bcm_enet_probe, .remove = bcm_enet_remove, .driver = { -@@ -1983,6 +1985,42 @@ struct platform_driver bcm63xx_enet_driv +@@ -1977,6 +1979,42 @@ struct platform_driver bcm63xx_enet_driv }, }; @@ -73,7 +73,7 @@ /* * switch mii access callbacks */ -@@ -2241,29 +2279,6 @@ static int bcm_enetsw_open(struct net_de +@@ -2235,29 +2273,6 @@ static int bcm_enetsw_open(struct net_de enetsw_writeb(priv, rgmii_ctrl, ENETSW_RGMII_CTRL_REG(i)); } @@ -103,7 +103,7 @@ /* initialize flow control buffer allocation */ enet_dma_writel(priv, ENETDMA_BUFALLOC_FORCE_MASK | 0, ENETDMA_BUFALLOC_REG(priv->rx_chan)); -@@ -2722,6 +2737,9 @@ static int bcm_enetsw_probe(struct platf +@@ -2716,6 +2731,9 @@ static int bcm_enetsw_probe(struct platf struct bcm63xx_enetsw_platform_data *pd; struct resource *res_mem; int ret, irq_rx, irq_tx; @@ -111,9 +111,9 @@ + u16 port_mask = BIT(8); + u8 val; - /* stop if shared driver failed, assume driver->probe will be - * called in the same order we register devices (correct ?) -@@ -2811,6 +2829,43 @@ static int bcm_enetsw_probe(struct platf + if (!bcm_enet_shared_base[0]) + return -EPROBE_DEFER; +@@ -2798,6 +2816,43 @@ static int bcm_enetsw_probe(struct platf priv->pdev = pdev; priv->net_dev = dev; @@ -156,14 +156,14 @@ + return 0; - out_put_clk: -@@ -2839,6 +2894,9 @@ static int bcm_enetsw_remove(struct plat + out_disable_clk: +@@ -2819,6 +2874,9 @@ static int bcm_enetsw_remove(struct plat priv = netdev_priv(dev); unregister_netdev(dev); + /* remove switch */ + bcmenet_switch_unregister(priv); + - /* release device resources */ - iounmap(priv->base); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + clk_disable_unprepare(priv->mac_clk); + + free_netdev(dev); diff --git a/target/linux/brcm63xx/patches-4.4/424-bcm63xx_enet_no_request_mem_region.patch b/target/linux/brcm63xx/patches-4.4/424-bcm63xx_enet_no_request_mem_region.patch index 24dd27a292..f1c7589c4f 100644 --- a/target/linux/brcm63xx/patches-4.4/424-bcm63xx_enet_no_request_mem_region.patch +++ b/target/linux/brcm63xx/patches-4.4/424-bcm63xx_enet_no_request_mem_region.patch @@ -1,15 +1,15 @@ --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -2784,12 +2784,6 @@ static int bcm_enetsw_probe(struct platf +@@ -2775,9 +2775,9 @@ static int bcm_enetsw_probe(struct platf if (ret) goto out; -- if (!request_mem_region(res_mem->start, resource_size(res_mem), -- "bcm63xx_enetsw")) { -- ret = -EBUSY; -- goto out; -- } -- - priv->base = ioremap(res_mem->start, resource_size(res_mem)); - if (priv->base == NULL) { - ret = -ENOMEM; +- priv->base = devm_ioremap_resource(&pdev->dev, res_mem); +- if (IS_ERR(priv->base)) { +- ret = PTR_ERR(priv->base); ++ priv->base = devm_ioremap(&pdev->dev, res_mem->start, resource_size(res_mem)); ++ if (priv->base == NULL) { ++ ret = -ENOMEM; + goto out; + } + diff --git a/target/linux/brcm63xx/patches-4.4/427-boards_probe_switch.patch b/target/linux/brcm63xx/patches-4.4/427-boards_probe_switch.patch index 4c4eb7d67b..ec03e4cee3 100644 --- a/target/linux/brcm63xx/patches-4.4/427-boards_probe_switch.patch +++ b/target/linux/brcm63xx/patches-4.4/427-boards_probe_switch.patch @@ -1,7 +1,7 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -119,6 +119,8 @@ static struct board_info __initdata boar - .has_uart0 = 1, +@@ -77,6 +77,8 @@ static struct board_info __initdata boar + .has_enet0 = 1, .enet0 = { + .has_phy = 1, @@ -9,8 +9,8 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -162,6 +164,8 @@ static struct board_info __initdata boar - .has_uart0 = 1, +@@ -90,6 +92,8 @@ static struct board_info __initdata boar + .has_enet0 = 1, .enet0 = { + .has_phy = 1, @@ -18,7 +18,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -273,6 +277,8 @@ static struct board_info __initdata boar +@@ -138,6 +142,8 @@ static struct board_info __initdata boar .use_internal_phy = 1, }, .enet1 = { @@ -27,7 +27,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -335,6 +341,8 @@ static struct board_info __initdata boar +@@ -170,6 +176,8 @@ static struct board_info __initdata boar }, .enet1 = { @@ -36,7 +36,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -389,6 +397,8 @@ static struct board_info __initdata boar +@@ -194,6 +202,8 @@ static struct board_info __initdata boar .use_internal_phy = 1, }, .enet1 = { @@ -45,7 +45,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -449,6 +459,8 @@ static struct board_info __initdata boar +@@ -224,6 +234,8 @@ static struct board_info __initdata boar }, .enet1 = { @@ -54,7 +54,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -472,6 +484,8 @@ static struct board_info __initdata boar +@@ -247,6 +259,8 @@ static struct board_info __initdata boar .use_internal_phy = 1, }, .enet1 = { @@ -63,16 +63,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -491,6 +505,8 @@ static struct board_info __initdata boar - .has_enet1 = 1, - .enet0 = { - .has_phy = 1, -+ .phy_id = 0, -+ .has_phy = 1, - .use_internal_phy = 1, - }, - .enet1 = { -@@ -514,6 +530,8 @@ static struct board_info __initdata boar +@@ -268,6 +282,8 @@ static struct board_info __initdata boar .use_internal_phy = 1, }, .enet1 = { @@ -81,7 +72,16 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -542,6 +560,8 @@ static struct board_info __initdata boar +@@ -287,6 +303,8 @@ static struct board_info __initdata boar + .use_internal_phy = 1, + }, + .enet1 = { ++ .has_phy = 1, ++ .phy_id = 0, + .force_speed_100 = 1, + .force_duplex_full = 1, + }, +@@ -314,6 +332,8 @@ static struct board_info __initdata boar }, .enet1 = { @@ -90,7 +90,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -595,6 +615,8 @@ static struct board_info __initdata boar +@@ -339,6 +359,8 @@ static struct board_info __initdata boar }, .enet1 = { @@ -99,7 +99,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -644,6 +666,8 @@ static struct board_info __initdata boar +@@ -364,6 +386,8 @@ static struct board_info __initdata boar }, .enet1 = { @@ -108,7 +108,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -667,6 +691,8 @@ static struct board_info __initdata boar +@@ -387,6 +411,8 @@ static struct board_info __initdata boar }, .enet1 = { diff --git a/target/linux/brcm63xx/patches-4.4/499-allow_better_context_for_board_patches.patch b/target/linux/brcm63xx/patches-4.4/499-allow_better_context_for_board_patches.patch index 98292d5395..ad9c5b30e4 100644 --- a/target/linux/brcm63xx/patches-4.4/499-allow_better_context_for_board_patches.patch +++ b/target/linux/brcm63xx/patches-4.4/499-allow_better_context_for_board_patches.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -57,7 +57,7 @@ static struct board_info __initdata boar +@@ -46,7 +46,7 @@ static struct board_info __initdata boar .ephy_reset_gpio = 36, .ephy_reset_gpio_flags = GPIO_ACTIVE_LOW, }; @@ -9,8 +9,8 @@ /* * known 6328 boards -@@ -106,7 +106,7 @@ static struct board_info __initdata boar - }, +@@ -65,7 +65,7 @@ static struct board_info __initdata boar + .port_no = 0, }, }; -#endif @@ -18,8 +18,8 @@ /* * known 6338 boards -@@ -199,7 +199,7 @@ static struct board_info __initdata boar - }, +@@ -98,7 +98,7 @@ static struct board_info __initdata boar + .force_duplex_full = 1, }, }; -#endif @@ -27,16 +27,16 @@ /* * known 6345 boards -@@ -211,7 +211,7 @@ static struct board_info __initdata boar - - .has_uart0 = 1, +@@ -108,7 +108,7 @@ static struct board_info __initdata boar + .name = "96345GW2", + .expected_cpu_id = 0x6345, }; -#endif +#endif /* CONFIG_BCM63XX_CPU_6345 */ /* * known 6348 boards -@@ -538,7 +538,7 @@ static struct board_info __initdata boar +@@ -311,7 +311,7 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; @@ -45,7 +45,7 @@ /* * known 6358 boards -@@ -699,7 +699,7 @@ static struct board_info __initdata boar +@@ -419,7 +419,7 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; diff --git a/target/linux/brcm63xx/patches-4.4/500-board-D4PW.patch b/target/linux/brcm63xx/patches-4.4/500-board-D4PW.patch index c2b2d330ad..31757c4648 100644 --- a/target/linux/brcm63xx/patches-4.4/500-board-D4PW.patch +++ b/target/linux/brcm63xx/patches-4.4/500-board-D4PW.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -538,6 +538,22 @@ static struct board_info __initdata boar +@@ -311,6 +311,21 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; @@ -11,7 +11,6 @@ + + .has_enet1 = 1, + .has_pci = 1, -+ .has_uart0 = 1, + + .enet1 = { + .has_phy = 1, @@ -23,7 +22,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -727,6 +743,7 @@ static const struct board_info __initcon +@@ -447,6 +462,7 @@ static const struct board_info __initcon &board_DV201AMR, &board_96348gw_a, &board_rta1025w_16, @@ -31,7 +30,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -758,6 +775,7 @@ static struct of_device_id const bcm963x +@@ -478,6 +494,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96348gw-10", .data = &board_96348gw_10, }, { .compatible = "brcm,bcm96348gw-11", .data = &board_96348gw_11, }, { .compatible = "brcm,bcm96348gw-a", .data = &board_96348gw_a, }, diff --git a/target/linux/brcm63xx/patches-4.4/501-board-NB4.patch b/target/linux/brcm63xx/patches-4.4/501-board-NB4.patch index c55221cf92..fe228c6b0e 100644 --- a/target/linux/brcm63xx/patches-4.4/501-board-NB4.patch +++ b/target/linux/brcm63xx/patches-4.4/501-board-NB4.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -715,6 +715,62 @@ static struct board_info __initdata boar +@@ -434,6 +434,60 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; @@ -9,7 +9,6 @@ + .name = "NB4-SER-r0", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -37,7 +36,6 @@ + .name = "NB4-FXC-r1", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -63,7 +61,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -751,6 +807,8 @@ static const struct board_info __initcon +@@ -470,6 +524,8 @@ static const struct board_info __initcon &board_96358vw2, &board_AGPFS0, &board_DWVS0, @@ -72,7 +70,7 @@ #endif }; -@@ -792,6 +850,8 @@ static struct of_device_id const bcm963x +@@ -511,6 +567,8 @@ static struct of_device_id const bcm963x { .compatible = "pirelli,a226m", .data = &board_DWVS0, }, { .compatible = "pirelli,a226m-fwb", .data = &board_DWVS0, }, { .compatible = "pirelli,agpf-s0", .data = &board_AGPFS0, }, diff --git a/target/linux/brcm63xx/patches-4.4/502-board-96338W2_E7T.patch b/target/linux/brcm63xx/patches-4.4/502-board-96338W2_E7T.patch index e4036b25c0..64edf76e56 100644 --- a/target/linux/brcm63xx/patches-4.4/502-board-96338W2_E7T.patch +++ b/target/linux/brcm63xx/patches-4.4/502-board-96338W2_E7T.patch @@ -1,7 +1,7 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -199,6 +199,20 @@ static struct board_info __initdata boar - }, +@@ -98,6 +98,20 @@ static struct board_info __initdata boar + .force_duplex_full = 1, }, }; + @@ -21,7 +21,7 @@ #endif /* CONFIG_BCM63XX_CPU_6338 */ /* -@@ -786,6 +800,7 @@ static const struct board_info __initcon +@@ -503,6 +517,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, &board_96338w, @@ -29,7 +29,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, -@@ -823,6 +838,7 @@ static struct of_device_id const bcm963x +@@ -540,6 +555,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6338 { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, { .compatible = "brcm,bcm96338w", .data = &board_96338w, }, diff --git a/target/linux/brcm63xx/patches-4.4/503-board-CPVA642.patch b/target/linux/brcm63xx/patches-4.4/503-board-CPVA642.patch index d38aa34056..2639aa6fd6 100644 --- a/target/linux/brcm63xx/patches-4.4/503-board-CPVA642.patch +++ b/target/linux/brcm63xx/patches-4.4/503-board-CPVA642.patch @@ -1,14 +1,13 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -681,6 +681,26 @@ static struct board_info __initdata boar - }, +@@ -401,6 +401,25 @@ static struct board_info __initdata boar + .num_usbh_ports = 2, }; +static struct board_info __initdata board_CPVA642 = { + .name = "CPVA642", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_enet1 = 1, + .has_pci = 1, + @@ -27,7 +26,7 @@ static struct board_info __initdata board_AGPFS0 = { .name = "AGPF-S0", .expected_cpu_id = 0x6358, -@@ -821,6 +841,7 @@ static const struct board_info __initcon +@@ -538,6 +557,7 @@ static const struct board_info __initcon &board_96358vw, &board_96358vw2, &board_AGPFS0, @@ -35,7 +34,7 @@ &board_DWVS0, &board_nb4_ser_r0, &board_nb4_fxc_r1, -@@ -868,6 +889,7 @@ static struct of_device_id const bcm963x +@@ -585,6 +605,7 @@ static struct of_device_id const bcm963x { .compatible = "pirelli,agpf-s0", .data = &board_AGPFS0, }, { .compatible = "sfr,nb4-ser-r0", .data = &board_nb4_ser_r0, }, { .compatible = "sfr,nb4-fxc-r1", .data = &board_nb4_fxc_r1, }, diff --git a/target/linux/brcm63xx/patches-4.4/504-board_dsl_274xb_rev_c.patch b/target/linux/brcm63xx/patches-4.4/504-board_dsl_274xb_rev_c.patch index 032085fde7..c125b3e0ae 100644 --- a/target/linux/brcm63xx/patches-4.4/504-board_dsl_274xb_rev_c.patch +++ b/target/linux/brcm63xx/patches-4.4/504-board_dsl_274xb_rev_c.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -750,6 +750,23 @@ static struct board_info __initdata boar +@@ -468,6 +468,22 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; @@ -9,7 +9,6 @@ + .name = "AW4139", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_enet1 = 1, + .has_pci = 1, + @@ -24,7 +23,7 @@ static struct board_info __initdata board_nb4_ser_r0 = { .name = "NB4-SER-r0", .expected_cpu_id = 0x6358, -@@ -843,6 +860,7 @@ static const struct board_info __initcon +@@ -559,6 +575,7 @@ static const struct board_info __initcon &board_AGPFS0, &board_CPVA642, &board_DWVS0, @@ -32,7 +31,7 @@ &board_nb4_ser_r0, &board_nb4_fxc_r1, #endif -@@ -882,6 +900,7 @@ static struct of_device_id const bcm963x +@@ -598,6 +615,7 @@ static struct of_device_id const bcm963x { .compatible = "alcatel,rg100a", .data = &board_96358vw2, }, { .compatible = "brcm,bcm96358vw", .data = &board_96358vw, }, { .compatible = "brcm,bcm96358vw2", .data = &board_96358vw2, }, diff --git a/target/linux/brcm63xx/patches-4.4/505-board_spw500v.patch b/target/linux/brcm63xx/patches-4.4/505-board_spw500v.patch index a9847c1b7b..c6bc4ec2de 100644 --- a/target/linux/brcm63xx/patches-4.4/505-board_spw500v.patch +++ b/target/linux/brcm63xx/patches-4.4/505-board_spw500v.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -568,6 +568,45 @@ static struct board_info __initdata boar +@@ -340,6 +340,44 @@ static struct board_info __initdata boar .force_duplex_full = 1, }, }; @@ -17,7 +17,6 @@ + .name = "SPW500V", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, @@ -46,7 +45,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -852,6 +891,7 @@ static const struct board_info __initcon +@@ -567,6 +605,7 @@ static const struct board_info __initcon &board_96348gw_a, &board_rta1025w_16, &board_96348_D4PW, @@ -54,7 +53,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -893,6 +933,7 @@ static struct of_device_id const bcm963x +@@ -608,6 +647,7 @@ static struct of_device_id const bcm963x { .compatible = "dynalink,rta1025w", .data = &board_rta1025w_16, }, { .compatible = "netgear,dg834gtpn", .data = &board_96348gw_10, }, { .compatible = "sagem,f@st2404", .data = &board_FAST2404, }, diff --git a/target/linux/brcm63xx/patches-4.4/506-board_gw6200_gw6000.patch b/target/linux/brcm63xx/patches-4.4/506-board_gw6200_gw6000.patch index 3bb22ba346..fb28302eb6 100644 --- a/target/linux/brcm63xx/patches-4.4/506-board_gw6200_gw6000.patch +++ b/target/linux/brcm63xx/patches-4.4/506-board_gw6200_gw6000.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -457,6 +457,66 @@ static struct board_info __initdata boar +@@ -233,6 +233,64 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "GW6200", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -37,7 +36,6 @@ + .name = "GW6000", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -67,7 +65,7 @@ static struct board_info __initdata board_FAST2404 = { .name = "F@ST2404", .expected_cpu_id = 0x6348, -@@ -884,6 +944,8 @@ static const struct board_info __initcon +@@ -598,6 +656,8 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6348 &board_96348r, &board_96348gw, @@ -76,7 +74,7 @@ &board_96348gw_10, &board_96348gw_11, &board_FAST2404, -@@ -934,6 +996,8 @@ static struct of_device_id const bcm963x +@@ -648,6 +708,8 @@ static struct of_device_id const bcm963x { .compatible = "netgear,dg834gtpn", .data = &board_96348gw_10, }, { .compatible = "sagem,f@st2404", .data = &board_FAST2404, }, { .compatible = "t-com,spw500v", .data = &board_spw500v, }, diff --git a/target/linux/brcm63xx/patches-4.4/507-board-MAGIC.patch b/target/linux/brcm63xx/patches-4.4/507-board-MAGIC.patch index 198045b91d..9ba7d8c23a 100644 --- a/target/linux/brcm63xx/patches-4.4/507-board-MAGIC.patch +++ b/target/linux/brcm63xx/patches-4.4/507-board-MAGIC.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -667,6 +667,40 @@ static struct board_info __initdata boar +@@ -436,6 +436,39 @@ static struct board_info __initdata boar .num_board_fixups = ARRAY_SIZE(spw500v_fixups), }, }; @@ -9,7 +9,6 @@ + .name = "MAGIC", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -41,7 +40,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -954,6 +988,7 @@ static const struct board_info __initcon +@@ -666,6 +699,7 @@ static const struct board_info __initcon &board_rta1025w_16, &board_96348_D4PW, &board_spw500v, @@ -49,7 +48,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -998,6 +1033,7 @@ static struct of_device_id const bcm963x +@@ -710,6 +744,7 @@ static struct of_device_id const bcm963x { .compatible = "t-com,spw500v", .data = &board_spw500v, }, { .compatible = "tecom,gw6000", .data = &board_gw6000, }, { .compatible = "tecom,gw6200", .data = &board_gw6200, }, diff --git a/target/linux/brcm63xx/patches-4.4/508-board_hw553.patch b/target/linux/brcm63xx/patches-4.4/508-board_hw553.patch index 50a0dc7b64..34800672c5 100644 --- a/target/linux/brcm63xx/patches-4.4/508-board_hw553.patch +++ b/target/linux/brcm63xx/patches-4.4/508-board_hw553.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -955,6 +955,34 @@ static struct board_info __initdata boar +@@ -666,6 +666,32 @@ static struct board_info __initdata boar .has_ehci0 = 1, .num_usbh_ports = 2, }; @@ -9,8 +9,6 @@ + .name = "HW553", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, -+ + .has_enet1 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, @@ -35,7 +33,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -1000,6 +1028,7 @@ static const struct board_info __initcon +@@ -711,6 +737,7 @@ static const struct board_info __initcon &board_dsl_274xb_rev_c, &board_nb4_ser_r0, &board_nb4_fxc_r1, @@ -43,7 +41,7 @@ #endif }; -@@ -1043,6 +1072,7 @@ static struct of_device_id const bcm963x +@@ -754,6 +781,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96358vw2", .data = &board_96358vw2, }, { .compatible = "d-link,dsl-274xb-c2", .data = &board_dsl_274xb_rev_c, }, { .compatible = "d-link,dsl-2650u", .data = &board_96358vw2, }, diff --git a/target/linux/brcm63xx/patches-4.4/509-board_rta1320_16m.patch b/target/linux/brcm63xx/patches-4.4/509-board_rta1320_16m.patch index b744c31389..f30dfbee1a 100644 --- a/target/linux/brcm63xx/patches-4.4/509-board_rta1320_16m.patch +++ b/target/linux/brcm63xx/patches-4.4/509-board_rta1320_16m.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -213,6 +213,21 @@ static struct board_info __initdata boar +@@ -112,6 +112,20 @@ static struct board_info __initdata boar .force_duplex_full = 1, }, }; @@ -9,7 +9,6 @@ + .name = "RTA1320_16M", + .expected_cpu_id = 0x6338, + -+ .has_uart0 = 1, + .has_enet0 = 1, + + .enet0 = { @@ -22,7 +21,7 @@ #endif /* CONFIG_BCM63XX_CPU_6338 */ /* -@@ -999,6 +1014,7 @@ static const struct board_info __initcon +@@ -708,6 +722,7 @@ static const struct board_info __initcon &board_96338gw, &board_96338w, &board_96338w2_e7t, @@ -30,7 +29,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, -@@ -1043,6 +1059,7 @@ static struct of_device_id const bcm963x +@@ -752,6 +767,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6338 { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, { .compatible = "brcm,bcm96338w", .data = &board_96338w, }, diff --git a/target/linux/brcm63xx/patches-4.4/510-board_spw303v.patch b/target/linux/brcm63xx/patches-4.4/510-board_spw303v.patch index 37dec2ce78..30ef4e0510 100644 --- a/target/linux/brcm63xx/patches-4.4/510-board_spw303v.patch +++ b/target/linux/brcm63xx/patches-4.4/510-board_spw303v.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -998,6 +998,21 @@ static struct board_info __initdata boar +@@ -706,6 +706,20 @@ static struct board_info __initdata boar .pci_dev = 1, }, }; @@ -10,7 +10,6 @@ + .name = "96358-502V", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_pci = 1, + @@ -22,7 +21,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -1045,6 +1060,7 @@ static const struct board_info __initcon +@@ -753,6 +767,7 @@ static const struct board_info __initcon &board_nb4_ser_r0, &board_nb4_fxc_r1, &board_HW553, @@ -30,7 +29,7 @@ #endif }; -@@ -1096,6 +1112,7 @@ static struct of_device_id const bcm963x +@@ -804,6 +819,7 @@ static struct of_device_id const bcm963x { .compatible = "pirelli,agpf-s0", .data = &board_AGPFS0, }, { .compatible = "sfr,nb4-ser-r0", .data = &board_nb4_ser_r0, }, { .compatible = "sfr,nb4-fxc-r1", .data = &board_nb4_fxc_r1, }, diff --git a/target/linux/brcm63xx/patches-4.4/511-board_V2500V.patch b/target/linux/brcm63xx/patches-4.4/511-board_V2500V.patch index 3ac6c18003..46909b0737 100644 --- a/target/linux/brcm63xx/patches-4.4/511-board_V2500V.patch +++ b/target/linux/brcm63xx/patches-4.4/511-board_V2500V.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -716,6 +716,27 @@ static struct board_info __initdata boar +@@ -483,6 +483,26 @@ static struct board_info __initdata boar .ext_irq = 2, }, }; @@ -9,7 +9,6 @@ + .name = "V2500V_BB", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -28,7 +27,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -1048,6 +1069,7 @@ static const struct board_info __initcon +@@ -755,6 +775,7 @@ static const struct board_info __initcon &board_96348_D4PW, &board_spw500v, &board_96348sv, @@ -36,7 +35,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1087,6 +1109,7 @@ static struct of_device_id const bcm963x +@@ -794,6 +815,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96348gw-10", .data = &board_96348gw_10, }, { .compatible = "brcm,bcm96348gw-11", .data = &board_96348gw_11, }, { .compatible = "brcm,bcm96348gw-a", .data = &board_96348gw_a, }, @@ -44,7 +43,7 @@ { .compatible = "d-link,dsl-2640b-b", .data = &board_96348_D4PW, }, { .compatible = "davolink,dv-201amr", .data = &board_DV201AMR, }, { .compatible = "dynalink,rta1025w", .data = &board_rta1025w_16, }, -@@ -1146,6 +1169,22 @@ void __init board_bcm963xx_init(void) +@@ -853,6 +875,22 @@ void __init board_bcm963xx_init(void) val &= MPI_CSBASE_BASE_MASK; } boot_addr = (u8 *)KSEG1ADDR(val); @@ -76,8 +75,8 @@ +#include #include #include - #include -@@ -248,6 +249,13 @@ int __init bcm63xx_flash_register(void) + #include +@@ -247,6 +248,13 @@ int __init bcm63xx_flash_register(void) val = bcm_mpi_readl(MPI_CSBASE_REG(0)); val &= MPI_CSBASE_BASE_MASK; diff --git a/target/linux/brcm63xx/patches-4.4/512-board_BTV2110.patch b/target/linux/brcm63xx/patches-4.4/512-board_BTV2110.patch index a3e24049b2..f58e294ebc 100644 --- a/target/linux/brcm63xx/patches-4.4/512-board_BTV2110.patch +++ b/target/linux/brcm63xx/patches-4.4/512-board_BTV2110.patch @@ -1,7 +1,7 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -411,6 +411,25 @@ static struct board_info __initdata boar - }, +@@ -216,6 +216,24 @@ static struct board_info __initdata boar + .has_ehci0 = 1, }; + @@ -10,7 +10,6 @@ + .name = "V2110", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet1 = 1, + .has_pci = 1, + @@ -26,7 +25,7 @@ static struct board_info __initdata board_96348gw = { .name = "96348GW", .expected_cpu_id = 0x6348, -@@ -1070,6 +1089,7 @@ static const struct board_info __initcon +@@ -776,6 +794,7 @@ static const struct board_info __initcon &board_spw500v, &board_96348sv, &board_V2500V_BB, @@ -34,7 +33,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1109,6 +1129,7 @@ static struct of_device_id const bcm963x +@@ -815,6 +834,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96348gw-10", .data = &board_96348gw_10, }, { .compatible = "brcm,bcm96348gw-11", .data = &board_96348gw_11, }, { .compatible = "brcm,bcm96348gw-a", .data = &board_96348gw_a, }, diff --git a/target/linux/brcm63xx/patches-4.4/513-MIPS-BCM63XX-add-inventel-Livebox-support.patch b/target/linux/brcm63xx/patches-4.4/513-MIPS-BCM63XX-add-inventel-Livebox-support.patch index 28462e0592..769be5a173 100644 --- a/target/linux/brcm63xx/patches-4.4/513-MIPS-BCM63XX-add-inventel-Livebox-support.patch +++ b/target/linux/brcm63xx/patches-4.4/513-MIPS-BCM63XX-add-inventel-Livebox-support.patch @@ -33,7 +33,7 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support +obj-$(CONFIG_BOARD_LIVEBOX) += board_livebox.o --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -56,7 +56,7 @@ void __init board_prom_init(void) +@@ -55,7 +55,7 @@ void __init board_prom_init(void) if (fw_arg3 == CFE_EPTSEAL) board_bcm963xx_init(); else @@ -57,7 +57,7 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support #endif /* __BOARD_COMMON_H */ --- /dev/null +++ b/arch/mips/bcm63xx/boards/board_livebox.c -@@ -0,0 +1,164 @@ +@@ -0,0 +1,163 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive @@ -92,7 +92,6 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support + .name = "Livebox-blue-5g", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, diff --git a/target/linux/brcm63xx/patches-4.4/514-board_ct536_ct5621.patch b/target/linux/brcm63xx/patches-4.4/514-board_ct536_ct5621.patch index b3b9125a9a..d111d97d63 100644 --- a/target/linux/brcm63xx/patches-4.4/514-board_ct536_ct5621.patch +++ b/target/linux/brcm63xx/patches-4.4/514-board_ct536_ct5621.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -430,6 +430,34 @@ static struct board_info __initdata boar +@@ -234,6 +234,33 @@ static struct board_info __initdata boar }; @@ -8,7 +8,6 @@ + .name = "CT536_CT5621", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 0, + .has_enet1 = 1, + .has_pci = 1, @@ -35,7 +34,7 @@ static struct board_info __initdata board_96348gw = { .name = "96348GW", .expected_cpu_id = 0x6348, -@@ -1090,6 +1118,7 @@ static const struct board_info __initcon +@@ -795,6 +822,7 @@ static const struct board_info __initcon &board_96348sv, &board_V2500V_BB, &board_V2110, @@ -43,7 +42,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1131,6 +1160,8 @@ static struct of_device_id const bcm963x +@@ -836,6 +864,8 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96348gw-a", .data = &board_96348gw_a, }, { .compatible = "bt,v2110", .data = &board_V2110, }, { .compatible = "bt,v2500v-bb", .data = &board_V2500V_BB, }, diff --git a/target/linux/brcm63xx/patches-4.4/515-board_DWV-S0_fixes.patch b/target/linux/brcm63xx/patches-4.4/515-board_DWV-S0_fixes.patch index c2cef899f0..8e053b293d 100644 --- a/target/linux/brcm63xx/patches-4.4/515-board_DWV-S0_fixes.patch +++ b/target/linux/brcm63xx/patches-4.4/515-board_DWV-S0_fixes.patch @@ -1,15 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -946,6 +946,8 @@ static struct board_info __initdata boar - .name = "DWV-S0", - .expected_cpu_id = 0x6358, - -+ .has_uart0 = 1, -+ - .has_enet0 = 1, - .has_enet1 = 1, - .has_pci = 1, -@@ -964,6 +966,7 @@ static struct board_info __initdata boar +@@ -674,6 +674,7 @@ static struct board_info __initdata boar }, .has_ohci0 = 1, diff --git a/target/linux/brcm63xx/patches-4.4/516-board_96348A-122.patch b/target/linux/brcm63xx/patches-4.4/516-board_96348A-122.patch index 5eea5369a7..29dc2620d9 100644 --- a/target/linux/brcm63xx/patches-4.4/516-board_96348A-122.patch +++ b/target/linux/brcm63xx/patches-4.4/516-board_96348A-122.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -458,6 +458,31 @@ static struct board_info __initdata boar +@@ -261,6 +261,30 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "96348A-122", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet1 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, @@ -32,7 +31,7 @@ static struct board_info __initdata board_96348gw = { .name = "96348GW", .expected_cpu_id = 0x6348, -@@ -1122,6 +1147,7 @@ static const struct board_info __initcon +@@ -824,6 +848,7 @@ static const struct board_info __initcon &board_V2500V_BB, &board_V2110, &board_ct536_ct5621, @@ -40,7 +39,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1164,6 +1190,7 @@ static struct of_device_id const bcm963x +@@ -866,6 +891,7 @@ static struct of_device_id const bcm963x { .compatible = "bt,v2110", .data = &board_V2110, }, { .compatible = "bt,v2500v-bb", .data = &board_V2500V_BB, }, { .compatible = "comtrend,ct-536+", .data = &board_ct536_ct5621, }, diff --git a/target/linux/brcm63xx/patches-4.4/517-RTA1205W_16_uart_fixes.patch b/target/linux/brcm63xx/patches-4.4/517-RTA1205W_16_uart_fixes.patch deleted file mode 100644 index 9b637fcca8..0000000000 --- a/target/linux/brcm63xx/patches-4.4/517-RTA1205W_16_uart_fixes.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c -+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -635,6 +635,7 @@ static struct board_info __initdata boar - .name = "RTA1025W_16", - .expected_cpu_id = 0x6348, - -+ .has_uart0 = 1, - .has_enet0 = 1, - .has_enet1 = 1, - .has_pci = 1, diff --git a/target/linux/brcm63xx/patches-4.4/519_board_CPVA502plus.patch b/target/linux/brcm63xx/patches-4.4/519_board_CPVA502plus.patch index 5dc69e4680..5af1060df0 100644 --- a/target/linux/brcm63xx/patches-4.4/519_board_CPVA502plus.patch +++ b/target/linux/brcm63xx/patches-4.4/519_board_CPVA502plus.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -429,6 +429,34 @@ static struct board_info __initdata boar +@@ -233,6 +233,33 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "CPVA502+", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -35,7 +34,7 @@ static struct board_info __initdata board_ct536_ct5621 = { .name = "CT536_CT5621", -@@ -1149,6 +1177,7 @@ static const struct board_info __initcon +@@ -849,6 +876,7 @@ static const struct board_info __initcon &board_V2110, &board_ct536_ct5621, &board_96348A_122, @@ -43,7 +42,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1201,6 +1230,7 @@ static struct of_device_id const bcm963x +@@ -901,6 +929,7 @@ static struct of_device_id const bcm963x { .compatible = "t-com,spw500v", .data = &board_spw500v, }, { .compatible = "tecom,gw6000", .data = &board_gw6000, }, { .compatible = "tecom,gw6200", .data = &board_gw6200, }, diff --git a/target/linux/brcm63xx/patches-4.4/520-bcm63xx-add-support-for-96368MVWG-board.patch b/target/linux/brcm63xx/patches-4.4/520-bcm63xx-add-support-for-96368MVWG-board.patch index 0175104d33..31002842f1 100644 --- a/target/linux/brcm63xx/patches-4.4/520-bcm63xx-add-support-for-96368MVWG-board.patch +++ b/target/linux/brcm63xx/patches-4.4/520-bcm63xx-add-support-for-96368MVWG-board.patch @@ -10,7 +10,7 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1141,6 +1141,59 @@ static struct board_info __initdata boar +@@ -840,6 +840,58 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_6358 */ /* @@ -21,7 +21,6 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. + .name = "96368MVWG", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + + .has_usbd = 1, @@ -70,7 +69,7 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. * all boards */ static const struct board_info __initconst *bcm963xx_boards[] = { -@@ -1192,6 +1245,10 @@ static const struct board_info __initcon +@@ -891,6 +943,10 @@ static const struct board_info __initcon &board_HW553, &board_spw303v, #endif @@ -81,7 +80,7 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -1252,6 +1309,7 @@ static struct of_device_id const bcm963x +@@ -951,6 +1007,7 @@ static struct of_device_id const bcm963x { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, #endif #ifdef CONFIG_BCM63XX_CPU_6368 @@ -91,7 +90,7 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. #endif --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -83,12 +83,25 @@ void __init board_early_setup(const stru +@@ -82,12 +82,25 @@ void __init board_early_setup(const stru bcm63xx_pci_enabled = 1; if (BCMCPU_IS_6348()) val |= GPIO_MODE_6348_G2_PCI; diff --git a/target/linux/brcm63xx/patches-4.4/521-bcm63xx-add-support-for-96368MVNgr-board.patch b/target/linux/brcm63xx/patches-4.4/521-bcm63xx-add-support-for-96368MVNgr-board.patch index 0a5cd6c5b4..f719c24284 100644 --- a/target/linux/brcm63xx/patches-4.4/521-bcm63xx-add-support-for-96368MVNgr-board.patch +++ b/target/linux/brcm63xx/patches-4.4/521-bcm63xx-add-support-for-96368MVNgr-board.patch @@ -9,7 +9,7 @@ Subject: [PATCH 33/63] bcm63xx: add support for 96368MVNgr board. --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1191,6 +1191,46 @@ static struct board_info __initdata boar +@@ -889,6 +889,45 @@ static struct board_info __initdata boar .has_ohci0 = 1, .has_ehci0 = 1, }; @@ -18,7 +18,6 @@ Subject: [PATCH 33/63] bcm63xx: add support for 96368MVNgr board. + .name = "96368MVNgr", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_enetsw = 1, + @@ -56,7 +55,7 @@ Subject: [PATCH 33/63] bcm63xx: add support for 96368MVNgr board. #endif /* CONFIG_BCM63XX_CPU_6368 */ /* -@@ -1248,6 +1288,7 @@ static const struct board_info __initcon +@@ -946,6 +985,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, @@ -64,7 +63,7 @@ Subject: [PATCH 33/63] bcm63xx: add support for 96368MVNgr board. #endif }; -@@ -1309,6 +1350,7 @@ static struct of_device_id const bcm963x +@@ -1007,6 +1047,7 @@ static struct of_device_id const bcm963x { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, #endif #ifdef CONFIG_BCM63XX_CPU_6368 diff --git a/target/linux/brcm63xx/patches-4.4/522-MIPS-BCM63XX-add-96328avng-reference-board.patch b/target/linux/brcm63xx/patches-4.4/522-MIPS-BCM63XX-add-96328avng-reference-board.patch index 030382bb8d..e482b20931 100644 --- a/target/linux/brcm63xx/patches-4.4/522-MIPS-BCM63XX-add-96328avng-reference-board.patch +++ b/target/linux/brcm63xx/patches-4.4/522-MIPS-BCM63XX-add-96328avng-reference-board.patch @@ -9,9 +9,9 @@ Subject: [PATCH] MIPS: BCM63XX: add 96328avng reference board --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -105,6 +105,33 @@ static struct board_info __initdata boar - .active_low = 1, - }, +@@ -64,6 +64,33 @@ static struct board_info __initdata boar + .use_fullspeed = 0, + .port_no = 0, }, + + .has_enetsw = 1, diff --git a/target/linux/brcm63xx/patches-4.4/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch b/target/linux/brcm63xx/patches-4.4/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch index d6f732a88e..c0f235beeb 100644 --- a/target/linux/brcm63xx/patches-4.4/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch +++ b/target/linux/brcm63xx/patches-4.4/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch @@ -9,7 +9,7 @@ Subject: [PATCH] MIPS: BCM63XX: add 963281TAN reference board --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -133,6 +133,41 @@ static struct board_info __initdata boar +@@ -92,6 +92,40 @@ static struct board_info __initdata boar }, }, }; @@ -18,7 +18,6 @@ Subject: [PATCH] MIPS: BCM63XX: add 963281TAN reference board + .name = "963281TAN", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + + .has_enetsw = 1, @@ -51,7 +50,7 @@ Subject: [PATCH] MIPS: BCM63XX: add 963281TAN reference board #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -1269,6 +1304,7 @@ static const struct board_info __initcon +@@ -966,6 +1000,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, @@ -59,7 +58,7 @@ Subject: [PATCH] MIPS: BCM63XX: add 963281TAN reference board #endif #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -1325,6 +1361,7 @@ static struct of_device_id const bcm963x +@@ -1022,6 +1057,7 @@ static struct of_device_id const bcm963x { .compatible = "netgear,cvg834g", .data = &board_cvg834g, }, #endif #ifdef CONFIG_BCM63XX_CPU_6328 diff --git a/target/linux/brcm63xx/patches-4.4/524-board_dsl_274xb_rev_f.patch b/target/linux/brcm63xx/patches-4.4/524-board_dsl_274xb_rev_f.patch index f89f01f99f..e3be8926d7 100644 --- a/target/linux/brcm63xx/patches-4.4/524-board_dsl_274xb_rev_f.patch +++ b/target/linux/brcm63xx/patches-4.4/524-board_dsl_274xb_rev_f.patch @@ -10,7 +10,7 @@ Subject: [PATCH 70/79] MIPS: BCM63XX: Add board definition for D-Link --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -168,6 +168,52 @@ static struct board_info __initdata boar +@@ -126,6 +126,51 @@ static struct board_info __initdata boar }, }, }; @@ -19,7 +19,6 @@ Subject: [PATCH 70/79] MIPS: BCM63XX: Add board definition for D-Link + .name = "AW4339U", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + + .has_caldata = 1, @@ -63,7 +62,7 @@ Subject: [PATCH 70/79] MIPS: BCM63XX: Add board definition for D-Link #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -1305,6 +1351,7 @@ static const struct board_info __initcon +@@ -1001,6 +1046,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, &board_963281TAN, @@ -71,7 +70,7 @@ Subject: [PATCH 70/79] MIPS: BCM63XX: Add board definition for D-Link #endif #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -1363,6 +1410,7 @@ static struct of_device_id const bcm963x +@@ -1059,6 +1105,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6328 { .compatible = "brcm,bcm963281TAN", .data = &board_963281TAN, }, { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, diff --git a/target/linux/brcm63xx/patches-4.4/525-board_96348w3.patch b/target/linux/brcm63xx/patches-4.4/525-board_96348w3.patch index 7f9b3caa4b..8fd0e85b69 100644 --- a/target/linux/brcm63xx/patches-4.4/525-board_96348w3.patch +++ b/target/linux/brcm63xx/patches-4.4/525-board_96348w3.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -837,6 +837,25 @@ static struct board_info __initdata boar +@@ -600,6 +600,24 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; @@ -9,7 +9,6 @@ + .name = "96348W3", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet1 = 1, + .has_pci = 1, + @@ -26,7 +25,7 @@ static struct board_info __initdata board_96348_D4PW = { .name = "D-4P-W", .expected_cpu_id = 0x6348, -@@ -1381,6 +1400,7 @@ static const struct board_info __initcon +@@ -1076,6 +1094,7 @@ static const struct board_info __initcon &board_ct536_ct5621, &board_96348A_122, &board_CPVA502plus, @@ -34,7 +33,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1436,6 +1456,7 @@ static struct of_device_id const bcm963x +@@ -1131,6 +1150,7 @@ static struct of_device_id const bcm963x { .compatible = "davolink,dv-201amr", .data = &board_DV201AMR, }, { .compatible = "dynalink,rta1025w", .data = &board_rta1025w_16, }, { .compatible = "netgear,dg834gtpn", .data = &board_96348gw_10, }, diff --git a/target/linux/brcm63xx/patches-4.4/526-board_CT6373-1.patch b/target/linux/brcm63xx/patches-4.4/526-board_CT6373-1.patch index 52839a34a9..f9257d29d4 100644 --- a/target/linux/brcm63xx/patches-4.4/526-board_CT6373-1.patch +++ b/target/linux/brcm63xx/patches-4.4/526-board_CT6373-1.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1223,6 +1223,31 @@ static struct board_info __initdata boar +@@ -922,6 +922,30 @@ static struct board_info __initdata boar .num_usbh_ports = 2, }; @@ -8,7 +8,6 @@ + .name = "CT6373-1", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -32,7 +31,7 @@ static struct board_info __initdata board_HW553 = { .name = "HW553", .expected_cpu_id = 0x6358, -@@ -1412,6 +1437,7 @@ static const struct board_info __initcon +@@ -1106,6 +1130,7 @@ static const struct board_info __initcon &board_dsl_274xb_rev_c, &board_nb4_ser_r0, &board_nb4_fxc_r1, @@ -40,7 +39,7 @@ &board_HW553, &board_spw303v, #endif -@@ -1470,6 +1496,7 @@ static struct of_device_id const bcm963x +@@ -1164,6 +1189,7 @@ static struct of_device_id const bcm963x { .compatible = "alcatel,rg100a", .data = &board_96358vw2, }, { .compatible = "brcm,bcm96358vw", .data = &board_96358vw, }, { .compatible = "brcm,bcm96358vw2", .data = &board_96358vw2, }, diff --git a/target/linux/brcm63xx/patches-4.4/527-board_dva-g3810bn-tl-1.patch b/target/linux/brcm63xx/patches-4.4/527-board_dva-g3810bn-tl-1.patch index 7d211f973f..6936fa4d5d 100644 --- a/target/linux/brcm63xx/patches-4.4/527-board_dva-g3810bn-tl-1.patch +++ b/target/linux/brcm63xx/patches-4.4/527-board_dva-g3810bn-tl-1.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1290,6 +1290,36 @@ static struct board_info __initdata boar +@@ -985,6 +985,35 @@ static struct board_info __initdata boar .use_internal_phy = 1, }, }; @@ -10,7 +10,6 @@ + .name = "DVAG3810BN", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -37,7 +36,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -1440,6 +1470,7 @@ static const struct board_info __initcon +@@ -1133,6 +1162,7 @@ static const struct board_info __initcon &board_ct6373_1, &board_HW553, &board_spw303v, @@ -45,7 +44,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6368 -@@ -1499,6 +1530,7 @@ static struct of_device_id const bcm963x +@@ -1192,6 +1222,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,ct-6373", .data = &board_ct6373_1, }, { .compatible = "d-link,dsl-274xb-c2", .data = &board_dsl_274xb_rev_c, }, { .compatible = "d-link,dsl-2650u", .data = &board_96358vw2, }, diff --git a/target/linux/brcm63xx/patches-4.4/528-board_nb6.patch b/target/linux/brcm63xx/patches-4.4/528-board_nb6.patch index 915d48dea9..55cc9ab86c 100644 --- a/target/linux/brcm63xx/patches-4.4/528-board_nb6.patch +++ b/target/linux/brcm63xx/patches-4.4/528-board_nb6.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1322,6 +1322,34 @@ static struct board_info __initdata boar +@@ -1016,6 +1016,32 @@ static struct board_info __initdata boar }; #endif /* CONFIG_BCM63XX_CPU_6358 */ @@ -9,8 +9,6 @@ + .name = "NB6", + .expected_cpu_id = 0x6362, + -+ .has_uart0 = 1, -+ + .has_ohci0 = 1, + .has_ehci0 = 1, + .num_usbh_ports = 2, @@ -35,7 +33,7 @@ /* * known 6368 boards */ -@@ -1473,6 +1501,10 @@ static const struct board_info __initcon +@@ -1165,6 +1191,10 @@ static const struct board_info __initcon &board_DVAG3810BN, #endif @@ -46,7 +44,7 @@ #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, &board_96368mvngr, -@@ -1541,6 +1573,9 @@ static struct of_device_id const bcm963x +@@ -1233,6 +1263,9 @@ static struct of_device_id const bcm963x { .compatible = "t-com,spw303v", .data = &board_spw303v, }, { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, #endif diff --git a/target/linux/brcm63xx/patches-4.4/529-board_fast2604.patch b/target/linux/brcm63xx/patches-4.4/529-board_fast2604.patch index 09cf1b7a94..2bca04aa86 100644 --- a/target/linux/brcm63xx/patches-4.4/529-board_fast2604.patch +++ b/target/linux/brcm63xx/patches-4.4/529-board_fast2604.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -767,6 +767,23 @@ static struct board_info __initdata boar +@@ -533,6 +533,22 @@ static struct board_info __initdata boar .has_ehci0 = 1, }; @@ -8,7 +8,6 @@ + .name = "F@ST2604", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + @@ -24,7 +23,7 @@ static struct board_info __initdata board_rta1025w_16 = { .name = "RTA1025W_16", .expected_cpu_id = 0x6348, -@@ -1472,6 +1489,7 @@ static const struct board_info __initcon +@@ -1162,6 +1178,7 @@ static const struct board_info __initcon &board_96348gw_10, &board_96348gw_11, &board_FAST2404, @@ -32,7 +31,7 @@ &board_DV201AMR, &board_96348gw_a, &board_rta1025w_16, -@@ -1547,6 +1565,7 @@ static struct of_device_id const bcm963x +@@ -1237,6 +1254,7 @@ static struct of_device_id const bcm963x { .compatible = "netgear,dg834gtpn", .data = &board_96348gw_10, }, { .compatible = "netgear,dg834g-v4", .data = &board_96348W3, }, { .compatible = "sagem,f@st2404", .data = &board_FAST2404, }, diff --git a/target/linux/brcm63xx/patches-4.4/530-board_A4001N1.patch b/target/linux/brcm63xx/patches-4.4/530-board_A4001N1.patch index 8094c36520..ec0695cc0f 100644 --- a/target/linux/brcm63xx/patches-4.4/530-board_A4001N1.patch +++ b/target/linux/brcm63xx/patches-4.4/530-board_A4001N1.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -169,6 +169,50 @@ static struct board_info __initdata boar +@@ -127,6 +127,49 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "963281T_TEF", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -51,7 +50,7 @@ static struct board_info __initdata board_dsl_274xb_f1 = { .name = "AW4339U", .expected_cpu_id = 0x6328, -@@ -1470,6 +1514,7 @@ static const struct board_info __initcon +@@ -1159,6 +1202,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, &board_963281TAN, @@ -59,7 +58,7 @@ &board_dsl_274xb_f1, #endif #ifdef CONFIG_BCM63XX_CPU_6338 -@@ -1535,6 +1580,7 @@ static struct of_device_id const bcm963x +@@ -1224,6 +1268,7 @@ static struct of_device_id const bcm963x { .compatible = "netgear,cvg834g", .data = &board_cvg834g, }, #endif #ifdef CONFIG_BCM63XX_CPU_6328 diff --git a/target/linux/brcm63xx/patches-4.4/531-board_AR-5387un.patch b/target/linux/brcm63xx/patches-4.4/531-board_AR-5387un.patch index 5cac3be43a..d38cb3bb1a 100644 --- a/target/linux/brcm63xx/patches-4.4/531-board_AR-5387un.patch +++ b/target/linux/brcm63xx/patches-4.4/531-board_AR-5387un.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -134,6 +134,79 @@ static struct board_info __initdata boar +@@ -93,6 +93,78 @@ static struct board_info __initdata boar }, }; @@ -35,7 +35,6 @@ + .name = "96328A-1441N1", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -80,7 +79,7 @@ static struct board_info __initdata board_963281TAN = { .name = "963281TAN", .expected_cpu_id = 0x6328, -@@ -1513,6 +1586,7 @@ static const struct board_info __initcon +@@ -1201,6 +1273,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, @@ -88,7 +87,7 @@ &board_963281TAN, &board_A4001N1, &board_dsl_274xb_f1, -@@ -1583,6 +1657,7 @@ static struct of_device_id const bcm963x +@@ -1271,6 +1344,7 @@ static struct of_device_id const bcm963x { .compatible = "adb,a4001n1", .data = &board_A4001N1, }, { .compatible = "brcm,bcm963281TAN", .data = &board_963281TAN, }, { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, diff --git a/target/linux/brcm63xx/patches-4.4/532-board_AR-5381u.patch b/target/linux/brcm63xx/patches-4.4/532-board_AR-5381u.patch index ef8b2200ce..07015caaaa 100644 --- a/target/linux/brcm63xx/patches-4.4/532-board_AR-5381u.patch +++ b/target/linux/brcm63xx/patches-4.4/532-board_AR-5381u.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -134,6 +134,61 @@ static struct board_info __initdata boar +@@ -93,6 +93,60 @@ static struct board_info __initdata boar }, }; @@ -17,7 +17,6 @@ + .name = "96328A-1241N", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -62,7 +61,7 @@ static struct sprom_fixup __initdata ar5387un_fixups[] = { { .offset = 2, .value = 0x05bb }, { .offset = 65, .value = 0x1204 }, -@@ -1586,6 +1641,7 @@ static const struct board_info __initcon +@@ -1273,6 +1327,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, @@ -70,7 +69,7 @@ &board_AR5387un, &board_963281TAN, &board_A4001N1, -@@ -1657,6 +1713,7 @@ static struct of_device_id const bcm963x +@@ -1344,6 +1399,7 @@ static struct of_device_id const bcm963x { .compatible = "adb,a4001n1", .data = &board_A4001N1, }, { .compatible = "brcm,bcm963281TAN", .data = &board_963281TAN, }, { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, diff --git a/target/linux/brcm63xx/patches-4.4/533-board_rta770bw.patch b/target/linux/brcm63xx/patches-4.4/533-board_rta770bw.patch index 61f3ee23a0..3ac6161bc2 100644 --- a/target/linux/brcm63xx/patches-4.4/533-board_rta770bw.patch +++ b/target/linux/brcm63xx/patches-4.4/533-board_rta770bw.patch @@ -1,16 +1,14 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -520,6 +520,22 @@ static struct board_info __initdata boar - - .has_uart0 = 1, +@@ -411,6 +411,20 @@ static struct board_info __initdata boar + .name = "96345GW2", + .expected_cpu_id = 0x6345, }; + +static struct board_info __initdata board_rta770bw = { + .name = "RTA770BW", + .expected_cpu_id = 0x6345, + -+ .has_uart0 = 1, -+ + .has_enet0 = 1, + + .enet0 = { @@ -23,7 +21,7 @@ #endif /* CONFIG_BCM63XX_CPU_6345 */ /* -@@ -1655,6 +1671,7 @@ static const struct board_info __initcon +@@ -1341,6 +1355,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, @@ -31,7 +29,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6348 &board_96348r, -@@ -1725,6 +1742,7 @@ static struct of_device_id const bcm963x +@@ -1411,6 +1426,7 @@ static struct of_device_id const bcm963x #endif #ifdef CONFIG_BCM63XX_CPU_6345 { .compatible = "brcm,bcm96345gw2", .data = &board_96345gw2, }, diff --git a/target/linux/brcm63xx/patches-4.4/534-board_hw556.patch b/target/linux/brcm63xx/patches-4.4/534-board_hw556.patch index e59f1aa02d..604ffe7a36 100644 --- a/target/linux/brcm63xx/patches-4.4/534-board_hw556.patch +++ b/target/linux/brcm63xx/patches-4.4/534-board_hw556.patch @@ -8,7 +8,7 @@ #include #include #include -@@ -1481,6 +1482,95 @@ static struct board_info __initdata boar +@@ -1171,6 +1172,92 @@ static struct board_info __initdata boar }, }; @@ -16,7 +16,6 @@ + .name = "HW556_C", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -44,7 +43,6 @@ + .name = "HW556_A", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -74,7 +72,6 @@ + .name = "HW556_B", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -104,7 +101,7 @@ /* T-Home Speedport W 303V Typ B */ static struct board_info __initdata board_spw303v = { .name = "96358-502V", -@@ -1707,6 +1797,9 @@ static const struct board_info __initcon +@@ -1391,6 +1478,9 @@ static const struct board_info __initcon &board_nb4_fxc_r1, &board_ct6373_1, &board_HW553, @@ -114,7 +111,7 @@ &board_spw303v, &board_DVAG3810BN, #endif -@@ -1779,6 +1872,9 @@ static struct of_device_id const bcm963x +@@ -1463,6 +1553,9 @@ static struct of_device_id const bcm963x { .compatible = "d-link,dsl-2650u", .data = &board_96358vw2, }, { .compatible = "d-link,dva-g3810bn/tl", .data = &board_DVAG3810BN, }, { .compatible = "huawei,hg553", .data = &board_HW553, }, diff --git a/target/linux/brcm63xx/patches-4.4/535-board_rta770w.patch b/target/linux/brcm63xx/patches-4.4/535-board_rta770w.patch index e3b7724b8f..7149ed7480 100644 --- a/target/linux/brcm63xx/patches-4.4/535-board_rta770w.patch +++ b/target/linux/brcm63xx/patches-4.4/535-board_rta770w.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -537,6 +537,27 @@ static struct board_info __initdata boar +@@ -426,6 +426,25 @@ static struct board_info __initdata boar .force_duplex_full = 1, }, }; @@ -14,8 +14,6 @@ + .name = "RTA770W", + .expected_cpu_id = 0x6345, + -+ .has_uart0 = 1, -+ + .has_enet0 = 1, + + .enet0 = { @@ -28,7 +26,7 @@ #endif /* CONFIG_BCM63XX_CPU_6345 */ /* -@@ -1762,6 +1783,7 @@ static const struct board_info __initcon +@@ -1443,6 +1462,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, &board_rta770bw, @@ -36,7 +34,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6348 &board_96348r, -@@ -1836,6 +1858,7 @@ static struct of_device_id const bcm963x +@@ -1517,6 +1537,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6345 { .compatible = "brcm,bcm96345gw2", .data = &board_96345gw2, }, { .compatible = "dynalink,rta770bw", .data = &board_rta770bw, }, diff --git a/target/linux/brcm63xx/patches-4.4/536-board_fast2704.patch b/target/linux/brcm63xx/patches-4.4/536-board_fast2704.patch index 1cdef8b308..888854a9c3 100644 --- a/target/linux/brcm63xx/patches-4.4/536-board_fast2704.patch +++ b/target/linux/brcm63xx/patches-4.4/536-board_fast2704.patch @@ -12,7 +12,7 @@ Signed-off-by: Marcin Jurkowski --- --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -387,6 +387,44 @@ static struct board_info __initdata boar +@@ -341,6 +341,43 @@ static struct board_info __initdata boar }, }, }; @@ -21,7 +21,6 @@ Signed-off-by: Marcin Jurkowski + .name = "F@ST2704V2", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -57,7 +56,7 @@ Signed-off-by: Marcin Jurkowski #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -1773,6 +1811,7 @@ static const struct board_info __initcon +@@ -1452,6 +1489,7 @@ static const struct board_info __initcon &board_963281TAN, &board_A4001N1, &board_dsl_274xb_f1, @@ -65,7 +64,7 @@ Signed-off-by: Marcin Jurkowski #endif #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -1848,6 +1887,7 @@ static struct of_device_id const bcm963x +@@ -1527,6 +1565,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,ar-5381u", .data = &board_AR5381u, }, { .compatible = "comtrend,ar-5387un", .data = &board_AR5387un, }, { .compatible = "d-link,dsl-274xb-f", .data = &board_dsl_274xb_f1, }, diff --git a/target/linux/brcm63xx/patches-4.4/537-board_fast2504n.patch b/target/linux/brcm63xx/patches-4.4/537-board_fast2504n.patch index d5ecc3c4c7..3472d90e99 100644 --- a/target/linux/brcm63xx/patches-4.4/537-board_fast2504n.patch +++ b/target/linux/brcm63xx/patches-4.4/537-board_fast2504n.patch @@ -6,7 +6,7 @@ Signed-off-by: Max Staudt --- --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1702,6 +1702,43 @@ static struct board_info __initdata boar +@@ -1382,6 +1382,41 @@ static struct board_info __initdata boar }, }, }; @@ -15,8 +15,6 @@ Signed-off-by: Max Staudt + .name = "F@ST2504n", + .expected_cpu_id = 0x6362, + -+ .has_uart0 = 1, -+ + .has_enetsw = 1, + + .enetsw = { @@ -50,7 +48,7 @@ Signed-off-by: Max Staudt #endif /* CONFIG_BCM63XX_CPU_6362 */ /* -@@ -1867,6 +1904,7 @@ static const struct board_info __initcon +@@ -1545,6 +1580,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6362 &board_nb6, @@ -58,7 +56,7 @@ Signed-off-by: Max Staudt #endif #ifdef CONFIG_BCM63XX_CPU_6368 -@@ -1948,6 +1986,7 @@ static struct of_device_id const bcm963x +@@ -1626,6 +1662,7 @@ static struct of_device_id const bcm963x { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, #endif #ifdef CONFIG_BCM63XX_CPU_6362 diff --git a/target/linux/brcm63xx/patches-4.4/555-board_96318ref.patch b/target/linux/brcm63xx/patches-4.4/555-board_96318ref.patch index f0949f9ed1..c7eadf1b83 100644 --- a/target/linux/brcm63xx/patches-4.4/555-board_96318ref.patch +++ b/target/linux/brcm63xx/patches-4.4/555-board_96318ref.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -53,6 +53,56 @@ static struct board_info __initdata boar +@@ -50,6 +50,55 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_3368 */ /* @@ -11,7 +11,6 @@ + .name = "96318REF", + .expected_cpu_id = 0x6318, + -+ .has_uart0 = 1, + .has_pci = 1, + + .has_usbd = 1, @@ -57,7 +56,7 @@ * known 6328 boards */ #ifdef CONFIG_BCM63XX_CPU_6328 -@@ -1579,6 +1629,9 @@ static const struct board_info __initcon +@@ -1517,6 +1566,9 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_3368 &board_cvg834g, #endif @@ -67,7 +66,7 @@ #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, &board_AR5381u, -@@ -1656,6 +1709,9 @@ static struct of_device_id const bcm963x +@@ -1594,6 +1646,9 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_3368 { .compatible = "netgear,cvg834g", .data = &board_cvg834g, }, #endif diff --git a/target/linux/brcm63xx/patches-4.4/556-board_96318ref_p300.patch b/target/linux/brcm63xx/patches-4.4/556-board_96318ref_p300.patch index eda826e13f..162ecb7c39 100644 --- a/target/linux/brcm63xx/patches-4.4/556-board_96318ref_p300.patch +++ b/target/linux/brcm63xx/patches-4.4/556-board_96318ref_p300.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -100,6 +100,51 @@ static struct board_info __initdata boar +@@ -96,6 +96,50 @@ static struct board_info __initdata boar }, }, }; @@ -9,7 +9,6 @@ + .name = "96318REF_P300", + .expected_cpu_id = 0x6318, + -+ .has_uart0 = 1, + .has_pci = 1, + + .has_usbd = 1, @@ -52,7 +51,7 @@ #endif /* CONFIG_BCM63XX_CPU_6318 */ /* -@@ -1631,6 +1676,7 @@ static const struct board_info __initcon +@@ -1568,6 +1612,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_6318 &board_96318ref, @@ -60,7 +59,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, -@@ -1711,6 +1757,7 @@ static struct of_device_id const bcm963x +@@ -1648,6 +1693,7 @@ static struct of_device_id const bcm963x #endif #ifdef CONFIG_BCM63XX_CPU_6318 { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, }, diff --git a/target/linux/brcm63xx/patches-4.4/557-board_bcm963269bhr.patch b/target/linux/brcm63xx/patches-4.4/557-board_bcm963269bhr.patch index 2d5dc607b6..be0e7e7832 100644 --- a/target/linux/brcm63xx/patches-4.4/557-board_bcm963269bhr.patch +++ b/target/linux/brcm63xx/patches-4.4/557-board_bcm963269bhr.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1668,6 +1668,52 @@ static struct board_info __initdata boar +@@ -1604,6 +1604,50 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_6368 */ /* @@ -11,8 +11,6 @@ + .name = "963269BHR", + .expected_cpu_id = 0x63268, + -+ .has_uart0 = 1, -+ + .has_pci = 1, + + .has_ehci0 = 1, @@ -53,7 +51,7 @@ * all boards */ static const struct board_info __initconst *bcm963xx_boards[] = { -@@ -1748,6 +1794,9 @@ static const struct board_info __initcon +@@ -1684,6 +1728,9 @@ static const struct board_info __initcon &board_96368mvwg, &board_96368mvngr, #endif @@ -63,7 +61,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -1835,6 +1884,7 @@ static struct of_device_id const bcm963x +@@ -1771,6 +1818,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, #endif #ifdef CONFIG_BCM63XX_CPU_63268 diff --git a/target/linux/brcm63xx/patches-4.4/558-board_AR1004G.patch b/target/linux/brcm63xx/patches-4.4/558-board_AR1004G.patch index a312b4137b..dc3c13ef45 100644 --- a/target/linux/brcm63xx/patches-4.4/558-board_AR1004G.patch +++ b/target/linux/brcm63xx/patches-4.4/558-board_AR1004G.patch @@ -8,7 +8,7 @@ Signed-off-by: Adrian Feliks --- --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -679,6 +679,22 @@ static struct board_info __initdata boar +@@ -655,6 +655,21 @@ static struct board_info __initdata boar .has_ehci0 = 1, }; @@ -16,7 +16,6 @@ Signed-off-by: Adrian Feliks + .name = "AR1004G", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet1 = 1, + .has_pci = 1, + @@ -31,7 +30,7 @@ Signed-off-by: Adrian Feliks /* BT Voyager 2110 */ static struct board_info __initdata board_V2110 = { -@@ -1765,6 +1781,7 @@ static const struct board_info __initcon +@@ -1699,6 +1714,7 @@ static const struct board_info __initcon &board_96348A_122, &board_CPVA502plus, &board_96348W3, @@ -39,7 +38,7 @@ Signed-off-by: Adrian Feliks #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1829,6 +1846,7 @@ static struct of_device_id const bcm963x +@@ -1763,6 +1779,7 @@ static struct of_device_id const bcm963x { .compatible = "dynalink,rta770w", .data = &board_rta770w, }, #endif #ifdef CONFIG_BCM63XX_CPU_6348 diff --git a/target/linux/brcm63xx/patches-4.4/559-board_vw6339gu.patch b/target/linux/brcm63xx/patches-4.4/559-board_vw6339gu.patch index b9dd163d65..dff30121bb 100644 --- a/target/linux/brcm63xx/patches-4.4/559-board_vw6339gu.patch +++ b/target/linux/brcm63xx/patches-4.4/559-board_vw6339gu.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1727,6 +1727,53 @@ static struct board_info __initdata boar +@@ -1660,6 +1660,51 @@ static struct board_info __initdata boar }, }, }; @@ -9,8 +9,6 @@ + .name = "VW6339GU", + .expected_cpu_id = 0x63268, + -+ .has_uart0 = 1, -+ + .has_ehci0 = 1, + .has_ohci0 = 1, + .num_usbh_ports = 1, @@ -54,7 +52,7 @@ #endif /* CONFIG_BCM63XX_CPU_63268 */ /* -@@ -1813,6 +1860,7 @@ static const struct board_info __initcon +@@ -1746,6 +1791,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_63268 &board_963269bhr, @@ -62,7 +60,7 @@ #endif }; -@@ -1903,6 +1951,7 @@ static struct of_device_id const bcm963x +@@ -1836,6 +1882,7 @@ static struct of_device_id const bcm963x #endif #ifdef CONFIG_BCM63XX_CPU_63268 { .compatible = "brcm,bcm963269bhr", .data = &board_963269bhr, }, diff --git a/target/linux/brcm63xx/patches-4.4/560-board_963268gu_p300.patch b/target/linux/brcm63xx/patches-4.4/560-board_963268gu_p300.patch index 7a8575e705..4819fc545c 100644 --- a/target/linux/brcm63xx/patches-4.4/560-board_963268gu_p300.patch +++ b/target/linux/brcm63xx/patches-4.4/560-board_963268gu_p300.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1687,6 +1687,66 @@ static struct board_info __initdata boar +@@ -1622,6 +1622,64 @@ static struct board_info __initdata boar * known 63268/63269 boards */ #ifdef CONFIG_BCM63XX_CPU_63268 @@ -8,8 +8,6 @@ + .name = "963268BU_P300", + .expected_cpu_id = 0x63268, + -+ .has_uart0 = 1, -+ + .has_ehci0 = 1, + .has_ohci0 = 1, + .num_usbh_ports = 1, @@ -67,7 +65,7 @@ static struct board_info __initdata board_963269bhr = { .name = "963269BHR", .expected_cpu_id = 0x63268, -@@ -1859,6 +1919,7 @@ static const struct board_info __initcon +@@ -1790,6 +1848,7 @@ static const struct board_info __initcon &board_96368mvngr, #endif #ifdef CONFIG_BCM63XX_CPU_63268 @@ -75,7 +73,7 @@ &board_963269bhr, &board_vw6339gu, #endif -@@ -1950,6 +2011,7 @@ static struct of_device_id const bcm963x +@@ -1881,6 +1940,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, #endif #ifdef CONFIG_BCM63XX_CPU_63268 diff --git a/target/linux/brcm63xx/patches-4.4/561-board_WAP-5813n.patch b/target/linux/brcm63xx/patches-4.4/561-board_WAP-5813n.patch index 38c92b110a..6751850354 100644 --- a/target/linux/brcm63xx/patches-4.4/561-board_WAP-5813n.patch +++ b/target/linux/brcm63xx/patches-4.4/561-board_WAP-5813n.patch @@ -9,7 +9,7 @@ #include #include #include -@@ -1681,6 +1683,48 @@ static struct board_info __initdata boar +@@ -1616,6 +1618,47 @@ static struct board_info __initdata boar .has_ohci0 = 1, .has_ehci0 = 1, }; @@ -27,7 +27,6 @@ + .name = "96369R-1231N", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -58,7 +57,7 @@ #endif /* CONFIG_BCM63XX_CPU_6368 */ /* -@@ -1917,6 +1961,7 @@ static const struct board_info __initcon +@@ -1846,6 +1889,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, &board_96368mvngr, @@ -66,7 +65,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_63268 &board_963268bu_p300, -@@ -2009,6 +2054,7 @@ static struct of_device_id const bcm963x +@@ -1938,6 +1982,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6368 { .compatible = "brcm,bcm96368mvngr", .data = &board_96368mvngr, }, { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, diff --git a/target/linux/brcm63xx/patches-4.4/562-board_VR-3025u.patch b/target/linux/brcm63xx/patches-4.4/562-board_VR-3025u.patch index 5f56c0e979..29413e9478 100644 --- a/target/linux/brcm63xx/patches-4.4/562-board_VR-3025u.patch +++ b/target/linux/brcm63xx/patches-4.4/562-board_VR-3025u.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1684,6 +1684,60 @@ static struct board_info __initdata boar +@@ -1619,6 +1619,59 @@ static struct board_info __initdata boar .has_ehci0 = 1, }; @@ -17,7 +17,6 @@ + .name = "96368M-1541N", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -61,7 +60,7 @@ static struct sprom_fixup __initdata wap5813n_fixups[] = { { .offset = 97, .value = 0xfeed }, { .offset = 98, .value = 0x15d1 }, -@@ -1961,6 +2015,7 @@ static const struct board_info __initcon +@@ -1889,6 +1942,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, &board_96368mvngr, @@ -69,7 +68,7 @@ &board_WAP5813n, #endif #ifdef CONFIG_BCM63XX_CPU_63268 -@@ -2054,6 +2109,7 @@ static struct of_device_id const bcm963x +@@ -1982,6 +2036,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6368 { .compatible = "brcm,bcm96368mvngr", .data = &board_96368mvngr, }, { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, diff --git a/target/linux/brcm63xx/patches-4.4/563-board_VR-3025un.patch b/target/linux/brcm63xx/patches-4.4/563-board_VR-3025un.patch index c2c17fdc20..81ac7021cd 100644 --- a/target/linux/brcm63xx/patches-4.4/563-board_VR-3025un.patch +++ b/target/linux/brcm63xx/patches-4.4/563-board_VR-3025un.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1738,6 +1738,60 @@ static struct board_info __initdata boar +@@ -1672,6 +1672,59 @@ static struct board_info __initdata boar }, }; @@ -17,7 +17,6 @@ + .name = "96368M-1341N", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -61,7 +60,7 @@ static struct sprom_fixup __initdata wap5813n_fixups[] = { { .offset = 97, .value = 0xfeed }, { .offset = 98, .value = 0x15d1 }, -@@ -2016,6 +2070,7 @@ static const struct board_info __initcon +@@ -1943,6 +1996,7 @@ static const struct board_info __initcon &board_96368mvwg, &board_96368mvngr, &board_VR3025u, @@ -69,7 +68,7 @@ &board_WAP5813n, #endif #ifdef CONFIG_BCM63XX_CPU_63268 -@@ -2110,6 +2165,7 @@ static struct of_device_id const bcm963x +@@ -2037,6 +2091,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96368mvngr", .data = &board_96368mvngr, }, { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, diff --git a/target/linux/brcm63xx/patches-4.4/564-board_P870HW-51a_v2.patch b/target/linux/brcm63xx/patches-4.4/564-board_P870HW-51a_v2.patch index 2fd368a60f..cdab8de254 100644 --- a/target/linux/brcm63xx/patches-4.4/564-board_P870HW-51a_v2.patch +++ b/target/linux/brcm63xx/patches-4.4/564-board_P870HW-51a_v2.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1693,6 +1693,49 @@ static struct sprom_fixup __initdata vr3 +@@ -1628,6 +1628,48 @@ static struct sprom_fixup __initdata vr3 { .offset = 115, .value = 0xfad9 }, }; @@ -8,7 +8,6 @@ + .name = "P870HW-51a_v2", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -50,7 +49,7 @@ static struct board_info __initdata board_VR3025u = { .name = "96368M-1541N", .expected_cpu_id = 0x6368, -@@ -2069,6 +2112,7 @@ static const struct board_info __initcon +@@ -1995,6 +2037,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, &board_96368mvngr, @@ -58,7 +57,7 @@ &board_VR3025u, &board_VR3025un, &board_WAP5813n, -@@ -2167,6 +2211,7 @@ static struct of_device_id const bcm963x +@@ -2093,6 +2136,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, { .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, }, diff --git a/target/linux/brcm63xx/patches-4.4/565-board_hw520.patch b/target/linux/brcm63xx/patches-4.4/565-board_hw520.patch index 070e3ec82c..75b7ef96e8 100644 --- a/target/linux/brcm63xx/patches-4.4/565-board_hw520.patch +++ b/target/linux/brcm63xx/patches-4.4/565-board_hw520.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1364,6 +1364,37 @@ static struct board_info __initdata boar +@@ -1312,6 +1312,36 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "HW6358GW_B", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -38,7 +37,7 @@ static struct board_info __initdata board_HW553 = { .name = "HW553", .expected_cpu_id = 0x6358, -@@ -2096,6 +2127,7 @@ static const struct board_info __initcon +@@ -2021,6 +2051,7 @@ static const struct board_info __initcon &board_nb4_ser_r0, &board_nb4_fxc_r1, &board_ct6373_1, @@ -46,7 +45,7 @@ &board_HW553, &board_HW556_A, &board_HW556_B, -@@ -2188,6 +2220,7 @@ static struct of_device_id const bcm963x +@@ -2113,6 +2144,7 @@ static struct of_device_id const bcm963x { .compatible = "d-link,dsl-274xb-c2", .data = &board_dsl_274xb_rev_c, }, { .compatible = "d-link,dsl-2650u", .data = &board_96358vw2, }, { .compatible = "d-link,dva-g3810bn/tl", .data = &board_DVAG3810BN, }, diff --git a/target/linux/brcm63xx/patches-4.4/566-board_A4001N.patch b/target/linux/brcm63xx/patches-4.4/566-board_A4001N.patch index dfddf193ba..2e194a54f5 100644 --- a/target/linux/brcm63xx/patches-4.4/566-board_A4001N.patch +++ b/target/linux/brcm63xx/patches-4.4/566-board_A4001N.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -358,6 +358,50 @@ static struct board_info __initdata boar +@@ -349,6 +349,49 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "96328dg2x2", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -51,7 +50,7 @@ static struct board_info __initdata board_A4001N1 = { .name = "963281T_TEF", .expected_cpu_id = 0x6328, -@@ -2078,6 +2122,7 @@ static const struct board_info __initcon +@@ -2002,6 +2045,7 @@ static const struct board_info __initcon &board_AR5381u, &board_AR5387un, &board_963281TAN, @@ -59,7 +58,7 @@ &board_A4001N1, &board_dsl_274xb_f1, &board_FAST2704V2, -@@ -2166,6 +2211,7 @@ static struct of_device_id const bcm963x +@@ -2090,6 +2134,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96318ref_p300", .data = &board_96318ref_p300, }, #endif #ifdef CONFIG_BCM63XX_CPU_6328 diff --git a/target/linux/brcm63xx/patches-4.4/567-board_dsl-2751b_e1.patch b/target/linux/brcm63xx/patches-4.4/567-board_dsl-2751b_e1.patch index 24c15fd2ec..9852f34609 100644 --- a/target/linux/brcm63xx/patches-4.4/567-board_dsl-2751b_e1.patch +++ b/target/linux/brcm63xx/patches-4.4/567-board_dsl-2751b_e1.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -147,6 +147,75 @@ static struct board_info __initdata boar +@@ -142,6 +142,74 @@ static struct board_info __initdata boar }, }, }; @@ -30,7 +30,6 @@ + .name = "AW5200B", + .expected_cpu_id = 0x6318, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + @@ -76,7 +75,7 @@ #endif /* CONFIG_BCM63XX_CPU_6318 */ /* -@@ -2116,6 +2185,7 @@ static const struct board_info __initcon +@@ -2039,6 +2107,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6318 &board_96318ref, &board_96318ref_p300, @@ -84,7 +83,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, -@@ -2209,6 +2279,7 @@ static struct of_device_id const bcm963x +@@ -2132,6 +2201,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6318 { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, }, { .compatible = "brcm,bcm96318ref_p300", .data = &board_96318ref_p300, }, diff --git a/target/linux/brcm63xx/patches-4.4/568-board_DGND3700v1_3800B.patch b/target/linux/brcm63xx/patches-4.4/568-board_DGND3700v1_3800B.patch index a07ebdb9e7..cc31a81883 100644 --- a/target/linux/brcm63xx/patches-4.4/568-board_DGND3700v1_3800B.patch +++ b/target/linux/brcm63xx/patches-4.4/568-board_DGND3700v1_3800B.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1828,6 +1828,31 @@ static struct board_info __initdata boar +@@ -1760,6 +1760,30 @@ static struct board_info __initdata boar .has_ehci0 = 1, }; @@ -8,7 +8,6 @@ + .name = "DGND3700v1_3800B", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -32,7 +31,7 @@ static struct sprom_fixup __initdata vr3025u_fixups[] = { { .offset = 97, .value = 0xfeb3 }, { .offset = 98, .value = 0x1618 }, -@@ -2259,6 +2284,7 @@ static const struct board_info __initcon +@@ -2181,6 +2205,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, &board_96368mvngr, @@ -40,7 +39,7 @@ &board_P870HW51A_V2, &board_VR3025u, &board_VR3025un, -@@ -2361,6 +2387,7 @@ static struct of_device_id const bcm963x +@@ -2283,6 +2308,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, { .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, }, diff --git a/target/linux/brcm63xx/patches-4.4/569-board_homehub2a.patch b/target/linux/brcm63xx/patches-4.4/569-board_homehub2a.patch index e094882e36..8dca58683c 100644 --- a/target/linux/brcm63xx/patches-4.4/569-board_homehub2a.patch +++ b/target/linux/brcm63xx/patches-4.4/569-board_homehub2a.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1477,6 +1477,32 @@ static struct board_info __initdata boar +@@ -1423,6 +1423,31 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "HOMEHUB2A", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -33,7 +32,7 @@ static struct board_info __initdata board_HW520 = { .name = "HW6358GW_B", .expected_cpu_id = 0x6358, -@@ -2267,6 +2293,7 @@ static const struct board_info __initcon +@@ -2188,6 +2213,7 @@ static const struct board_info __initcon &board_nb4_ser_r0, &board_nb4_fxc_r1, &board_ct6373_1, @@ -41,7 +40,7 @@ &board_HW520, &board_HW553, &board_HW556_A, -@@ -2376,6 +2403,7 @@ static struct of_device_id const bcm963x +@@ -2297,6 +2323,7 @@ static struct of_device_id const bcm963x { .compatible = "sfr,nb4-fxc-r1", .data = &board_nb4_fxc_r1, }, { .compatible = "t-com,spw303v", .data = &board_spw303v, }, { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, diff --git a/target/linux/brcm63xx/patches-4.4/570-board_HG655b.patch b/target/linux/brcm63xx/patches-4.4/570-board_HG655b.patch index 2a13400f27..8fa9112b85 100644 --- a/target/linux/brcm63xx/patches-4.4/570-board_HG655b.patch +++ b/target/linux/brcm63xx/patches-4.4/570-board_HG655b.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1879,6 +1879,53 @@ static struct board_info __initdata boar +@@ -1809,6 +1809,52 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "HW65x", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -54,7 +53,7 @@ static struct sprom_fixup __initdata vr3025u_fixups[] = { { .offset = 97, .value = 0xfeb3 }, { .offset = 98, .value = 0x1618 }, -@@ -2312,6 +2359,7 @@ static const struct board_info __initcon +@@ -2232,6 +2278,7 @@ static const struct board_info __initcon &board_96368mvwg, &board_96368mvngr, &board_DGND3700v1_3800B, @@ -62,7 +61,7 @@ &board_P870HW51A_V2, &board_VR3025u, &board_VR3025un, -@@ -2415,6 +2463,7 @@ static struct of_device_id const bcm963x +@@ -2335,6 +2382,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, { .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, }, diff --git a/target/linux/brcm63xx/patches-4.4/571-board_fast2704n.patch b/target/linux/brcm63xx/patches-4.4/571-board_fast2704n.patch index c62f2ac8c3..bdae1a7e4d 100644 --- a/target/linux/brcm63xx/patches-4.4/571-board_fast2704n.patch +++ b/target/linux/brcm63xx/patches-4.4/571-board_fast2704n.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -216,6 +216,46 @@ static struct board_info __initdata boar +@@ -210,6 +210,45 @@ static struct board_info __initdata boar .num_board_fixups = ARRAY_SIZE(dsl2751b_e1_fixups), }, }; @@ -9,7 +9,6 @@ + .name = "F@ST2704N", + .expected_cpu_id = 0x6318, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + @@ -47,7 +46,7 @@ #endif /* CONFIG_BCM63XX_CPU_6318 */ /* -@@ -2284,6 +2324,7 @@ static const struct board_info __initcon +@@ -2203,6 +2242,7 @@ static const struct board_info __initcon &board_96318ref, &board_96318ref_p300, &board_dsl_2751b_d1, @@ -55,7 +54,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, -@@ -2381,6 +2422,7 @@ static struct of_device_id const bcm963x +@@ -2300,6 +2340,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, }, { .compatible = "brcm,bcm96318ref_p300", .data = &board_96318ref_p300, }, { .compatible = "d-link,dsl-275xb-d", .data = &board_dsl_2751b_d1, }, diff --git a/target/linux/brcm63xx/patches-4.4/572-board_VR-3026e.patch b/target/linux/brcm63xx/patches-4.4/572-board_VR-3026e.patch index 5a7d200e5c..260424bee6 100644 --- a/target/linux/brcm63xx/patches-4.4/572-board_VR-3026e.patch +++ b/target/linux/brcm63xx/patches-4.4/572-board_VR-3026e.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2117,6 +2117,60 @@ static struct board_info __initdata boar +@@ -2042,6 +2042,59 @@ static struct board_info __initdata boar }, }; @@ -17,7 +17,6 @@ + .name = "96368MT-1341N1", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -61,7 +60,7 @@ static struct sprom_fixup __initdata wap5813n_fixups[] = { { .offset = 97, .value = 0xfeed }, { .offset = 98, .value = 0x15d1 }, -@@ -2404,6 +2458,7 @@ static const struct board_info __initcon +@@ -2322,6 +2375,7 @@ static const struct board_info __initcon &board_P870HW51A_V2, &board_VR3025u, &board_VR3025un, @@ -69,7 +68,7 @@ &board_WAP5813n, #endif #ifdef CONFIG_BCM63XX_CPU_63268 -@@ -2504,6 +2559,7 @@ static struct of_device_id const bcm963x +@@ -2422,6 +2476,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, diff --git a/target/linux/brcm63xx/patches-4.4/573-board_R5010UNv2.patch b/target/linux/brcm63xx/patches-4.4/573-board_R5010UNv2.patch index cda9c41690..2764846a05 100644 --- a/target/linux/brcm63xx/patches-4.4/573-board_R5010UNv2.patch +++ b/target/linux/brcm63xx/patches-4.4/573-board_R5010UNv2.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -638,6 +638,51 @@ static struct board_info __initdata boar +@@ -623,6 +623,50 @@ static struct board_info __initdata boar }, }, }; @@ -9,7 +9,6 @@ + .name = "96328ang", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -52,7 +51,7 @@ #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -2389,6 +2434,7 @@ static const struct board_info __initcon +@@ -2306,6 +2350,7 @@ static const struct board_info __initcon &board_A4001N1, &board_dsl_274xb_f1, &board_FAST2704V2, @@ -60,7 +59,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -2487,6 +2533,7 @@ static struct of_device_id const bcm963x +@@ -2404,6 +2449,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,ar-5381u", .data = &board_AR5381u, }, { .compatible = "comtrend,ar-5387un", .data = &board_AR5387un, }, { .compatible = "d-link,dsl-274xb-f", .data = &board_dsl_274xb_f1, }, diff --git a/target/linux/brcm63xx/patches-4.4/574-board_HG622.patch b/target/linux/brcm63xx/patches-4.4/574-board_HG622.patch index 3ec2d139d6..860c0e7875 100644 --- a/target/linux/brcm63xx/patches-4.4/574-board_HG622.patch +++ b/target/linux/brcm63xx/patches-4.4/574-board_HG622.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2011,6 +2011,53 @@ static struct board_info __initdata boar +@@ -1938,6 +1938,52 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "96368MVWG_hg622", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -54,7 +53,7 @@ static struct sprom_fixup __initdata vr3025u_fixups[] = { { .offset = 97, .value = 0xfeb3 }, { .offset = 98, .value = 0x1618 }, -@@ -2500,6 +2547,7 @@ static const struct board_info __initcon +@@ -2416,6 +2462,7 @@ static const struct board_info __initcon &board_96368mvwg, &board_96368mvngr, &board_DGND3700v1_3800B, @@ -62,7 +61,7 @@ &board_HG655b, &board_P870HW51A_V2, &board_VR3025u, -@@ -2608,6 +2656,7 @@ static struct of_device_id const bcm963x +@@ -2524,6 +2571,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, { .compatible = "comtrend,vr-3026e", .data = &board_VR3026e, }, { .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, }, diff --git a/target/linux/brcm63xx/patches-4.4/575-board_EVG2000.patch b/target/linux/brcm63xx/patches-4.4/575-board_EVG2000.patch index cbec9492fc..4c9d19ac64 100644 --- a/target/linux/brcm63xx/patches-4.4/575-board_EVG2000.patch +++ b/target/linux/brcm63xx/patches-4.4/575-board_EVG2000.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1964,6 +1964,43 @@ static struct board_info __initdata boar +@@ -1892,6 +1892,42 @@ static struct board_info __initdata boar }, }; @@ -12,7 +12,6 @@ + .name = "96369PVG", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -44,7 +43,7 @@ static struct board_info __initdata board_HG655b = { .name = "HW65x", .expected_cpu_id = 0x6368, -@@ -2547,6 +2584,7 @@ static const struct board_info __initcon +@@ -2462,6 +2498,7 @@ static const struct board_info __initcon &board_96368mvwg, &board_96368mvngr, &board_DGND3700v1_3800B, @@ -52,7 +51,7 @@ &board_HG622, &board_HG655b, &board_P870HW51A_V2, -@@ -2659,6 +2697,7 @@ static struct of_device_id const bcm963x +@@ -2574,6 +2611,7 @@ static struct of_device_id const bcm963x { .compatible = "huawei,hg622", .data = &board_HG622, }, { .compatible = "huawei,hg655b", .data = &board_HG655b, }, { .compatible = "netgear,dgnd3700v1", .data = &board_DGND3700v1_3800B, }, diff --git a/target/linux/brcm63xx/patches-4.4/576-board_AV4202N.patch b/target/linux/brcm63xx/patches-4.4/576-board_AV4202N.patch index f3d08eb2a4..927ce2735a 100644 --- a/target/linux/brcm63xx/patches-4.4/576-board_AV4202N.patch +++ b/target/linux/brcm63xx/patches-4.4/576-board_AV4202N.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1851,6 +1851,52 @@ static struct board_info __initdata boar +@@ -1782,6 +1782,51 @@ static struct board_info __initdata boar * known 6368 boards */ #ifdef CONFIG_BCM63XX_CPU_6368 @@ -8,7 +8,6 @@ + .name = "96368_Swiss_S1", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -53,7 +52,7 @@ static struct board_info __initdata board_96368mvwg = { .name = "96368MVWG", .expected_cpu_id = 0x6368, -@@ -2581,6 +2627,7 @@ static const struct board_info __initcon +@@ -2495,6 +2540,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_6368 @@ -61,7 +60,7 @@ &board_96368mvwg, &board_96368mvngr, &board_DGND3700v1_3800B, -@@ -2688,6 +2735,7 @@ static struct of_device_id const bcm963x +@@ -2602,6 +2648,7 @@ static struct of_device_id const bcm963x { .compatible = "sfr,nb6-ser-r0", .data = &board_nb6, }, #endif #ifdef CONFIG_BCM63XX_CPU_6368 diff --git a/target/linux/brcm63xx/patches-4.4/577-board_VH4032N.patch b/target/linux/brcm63xx/patches-4.4/577-board_VH4032N.patch index 74f1b50062..e9bf9a7681 100644 --- a/target/linux/brcm63xx/patches-4.4/577-board_VH4032N.patch +++ b/target/linux/brcm63xx/patches-4.4/577-board_VH4032N.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2346,6 +2346,45 @@ static struct board_info __initdata boar +@@ -2266,6 +2266,44 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "VH4032N", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -46,7 +45,7 @@ static struct sprom_fixup __initdata wap5813n_fixups[] = { { .offset = 97, .value = 0xfeed }, { .offset = 98, .value = 0x15d1 }, -@@ -2635,6 +2674,7 @@ static const struct board_info __initcon +@@ -2548,6 +2586,7 @@ static const struct board_info __initcon &board_HG622, &board_HG655b, &board_P870HW51A_V2, @@ -54,7 +53,7 @@ &board_VR3025u, &board_VR3025un, &board_VR3026e, -@@ -2746,6 +2786,7 @@ static struct of_device_id const bcm963x +@@ -2659,6 +2698,7 @@ static struct of_device_id const bcm963x { .compatible = "huawei,hg655b", .data = &board_HG655b, }, { .compatible = "netgear,dgnd3700v1", .data = &board_DGND3700v1_3800B, }, { .compatible = "netgear,evg2000", .data = &board_EVG2000, }, diff --git a/target/linux/brcm63xx/patches-4.4/578-board_R1000H.patch b/target/linux/brcm63xx/patches-4.4/578-board_R1000H.patch index d1a1b03631..4b4b1a0de5 100644 --- a/target/linux/brcm63xx/patches-4.4/578-board_R1000H.patch +++ b/target/linux/brcm63xx/patches-4.4/578-board_R1000H.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2193,6 +2193,31 @@ static struct board_info __initdata boar +@@ -2116,6 +2116,29 @@ static struct board_info __initdata boar }, }; @@ -8,8 +8,6 @@ + .name = "R1000H", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, -+ .has_uart1 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -32,7 +30,7 @@ static struct board_info __initdata board_VR3025u = { .name = "96368M-1541N", .expected_cpu_id = 0x6368, -@@ -2674,6 +2699,7 @@ static const struct board_info __initcon +@@ -2586,6 +2609,7 @@ static const struct board_info __initcon &board_HG622, &board_HG655b, &board_P870HW51A_V2, @@ -40,7 +38,7 @@ &board_VH4032N, &board_VR3025u, &board_VR3025un, -@@ -2775,6 +2801,7 @@ static struct of_device_id const bcm963x +@@ -2687,6 +2711,7 @@ static struct of_device_id const bcm963x { .compatible = "sfr,nb6-ser-r0", .data = &board_nb6, }, #endif #ifdef CONFIG_BCM63XX_CPU_6368 diff --git a/target/linux/brcm63xx/patches-4.4/579-board_AR-5315u.patch b/target/linux/brcm63xx/patches-4.4/579-board_AR-5315u.patch index 6f7f26c320..1974ccd817 100644 --- a/target/linux/brcm63xx/patches-4.4/579-board_AR-5315u.patch +++ b/target/linux/brcm63xx/patches-4.4/579-board_AR-5315u.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -148,6 +148,68 @@ static struct board_info __initdata boar +@@ -143,6 +143,67 @@ static struct board_info __initdata boar }, }; @@ -22,7 +22,6 @@ + .name = "96318A-1441N1", + .expected_cpu_id = 0x6318, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + @@ -69,7 +68,7 @@ static struct sprom_fixup __initdata dsl2751b_e1_fixups[] = { { .offset = 96, .value = 0x2046 }, { .offset = 97, .value = 0xfe9d }, -@@ -2616,6 +2678,7 @@ static const struct board_info __initcon +@@ -2526,6 +2587,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6318 &board_96318ref, &board_96318ref_p300, @@ -77,7 +76,7 @@ &board_dsl_2751b_d1, &board_FAST2704N, #endif -@@ -2721,6 +2784,7 @@ static struct of_device_id const bcm963x +@@ -2631,6 +2693,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6318 { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, }, { .compatible = "brcm,bcm96318ref_p300", .data = &board_96318ref_p300, }, diff --git a/target/linux/brcm63xx/patches-4.4/580-board_AD1018.patch b/target/linux/brcm63xx/patches-4.4/580-board_AD1018.patch new file mode 100644 index 0000000000..7b28a24e3f --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/580-board_AD1018.patch @@ -0,0 +1,92 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -357,6 +357,73 @@ static struct board_info __initdata boar + }, + }; + ++static struct sprom_fixup __initdata ad1018_fixups[] = { ++ { .offset = 6, .value = 0x1c00 }, ++ { .offset = 65, .value = 0x1256 }, ++ { .offset = 96, .value = 0x2046 }, ++ { .offset = 97, .value = 0xfe69 }, ++ { .offset = 98, .value = 0x1726 }, ++ { .offset = 99, .value = 0xfa5c }, ++ { .offset = 112, .value = 0x2046 }, ++ { .offset = 113, .value = 0xfea8 }, ++ { .offset = 114, .value = 0x1978 }, ++ { .offset = 115, .value = 0xfa26 }, ++ { .offset = 161, .value = 0x2222 }, ++ { .offset = 169, .value = 0x2222 }, ++ { .offset = 171, .value = 0x2222 }, ++ { .offset = 173, .value = 0x2222 }, ++ { .offset = 174, .value = 0x4444 }, ++ { .offset = 175, .value = 0x2222 }, ++ { .offset = 176, .value = 0x4444 }, ++}; ++ ++static struct board_info __initdata board_AD1018 = { ++ .name = "96328avngr", ++ .expected_cpu_id = 0x6328, ++ ++ .has_pci = 1, ++ .use_fallback_sprom = 1, ++ ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ ++ .has_enetsw = 1, ++ ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "FIBRE", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "LAN3", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "LAN2", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "LAN1", ++ }, ++ }, ++ }, ++ ++ .fallback_sprom = { ++ .type = SPROM_BCM43217, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ .board_fixups = ad1018_fixups, ++ .num_board_fixups = ARRAY_SIZE(ad1018_fixups), ++ }, ++}; ++ + static struct sprom_fixup __initdata ar5381u_fixups[] = { + { .offset = 97, .value = 0xfee5 }, + { .offset = 98, .value = 0x157c }, +@@ -2593,6 +2660,7 @@ static const struct board_info __initcon + #endif + #ifdef CONFIG_BCM63XX_CPU_6328 + &board_96328avng, ++ &board_AD1018, + &board_AR5381u, + &board_AR5387un, + &board_963281TAN, +@@ -2707,6 +2775,7 @@ static struct of_device_id const bcm963x + { .compatible = "d-link,dsl-274xb-f", .data = &board_dsl_274xb_f1, }, + { .compatible = "nucom,r5010unv2", .data = &board_R5010UNV2, }, + { .compatible = "sagem,f@st2704v2", .data = &board_FAST2704V2, }, ++ { .compatible = "sercomm,ad1018-nor", .data = &board_AD1018, }, + #endif + #ifdef CONFIG_BCM63XX_CPU_6338 + { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, diff --git a/target/linux/brcm63xx/patches-4.4/804-bcm63xx_enet_63268_rgmii_ports.patch b/target/linux/brcm63xx/patches-4.4/804-bcm63xx_enet_63268_rgmii_ports.patch index 99075c6b9b..a573d2166b 100644 --- a/target/linux/brcm63xx/patches-4.4/804-bcm63xx_enet_63268_rgmii_ports.patch +++ b/target/linux/brcm63xx/patches-4.4/804-bcm63xx_enet_63268_rgmii_ports.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -2276,6 +2276,10 @@ static int bcm_enetsw_open(struct net_de +@@ -2270,6 +2270,10 @@ static int bcm_enetsw_open(struct net_de rgmii_ctrl = enetsw_readb(priv, ENETSW_RGMII_CTRL_REG(i)); rgmii_ctrl |= ENETSW_RGMII_CTRL_GMII_CLK_EN; diff --git a/target/linux/cns3xxx/config-4.9 b/target/linux/cns3xxx/config-4.9 index 4e5e016c11..36b4857c23 100644 --- a/target/linux/cns3xxx/config-4.9 +++ b/target/linux/cns3xxx/config-4.9 @@ -36,7 +36,6 @@ CONFIG_ATAGS=y CONFIG_ATA_VERBOSE_ERROR=y CONFIG_AUTO_ZRELADDR=y CONFIG_BCM_NET_PHYLIB=y -# CONFIG_BINFMT_FLAT is not set CONFIG_BLK_DEV_SD=y CONFIG_BLK_MQ_PCI=y CONFIG_BROADCOM_PHY=y @@ -173,12 +172,9 @@ CONFIG_LEDS_GPIO=y # CONFIG_LEDS_TRIGGER_NETDEV is not set CONFIG_LIBFDT=y CONFIG_LOCK_SPIN_ON_OWNER=y -CONFIG_LZO_COMPRESS=y -CONFIG_LZO_DECOMPRESS=y # CONFIG_MACH_CNS3420VB is not set CONFIG_MACH_GW2388=y CONFIG_MDIO_BOARDINFO=y -# CONFIG_MFD_MAX77620 is not set CONFIG_MIGHT_HAVE_CACHE_L2X0=y CONFIG_MIGHT_HAVE_PCI=y CONFIG_MMC=y @@ -265,7 +261,6 @@ CONFIG_SMP_ON_UP=y CONFIG_SPARSE_IRQ=y CONFIG_SPI=y CONFIG_SPI_BITBANG=y -# CONFIG_SPI_CADENCE_QUADSPI is not set CONFIG_SPI_CNS3XXX=y CONFIG_SPI_MASTER=y CONFIG_SRCU=y @@ -288,7 +283,6 @@ CONFIG_USB_DWC2_HOST=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_HCD_PLATFORM=y CONFIG_USB_EHCI_PCI=y -# CONFIG_USB_ETH is not set CONFIG_USB_GADGET=y CONFIG_USB_OHCI_HCD=y CONFIG_USB_OHCI_HCD_PLATFORM=y diff --git a/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/gpio.c b/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/gpio.c index 19de24c349..bdf930a79e 100644 --- a/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/gpio.c +++ b/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/gpio.c @@ -273,10 +273,10 @@ void __init cns3xxx_gpio_init(int gpio_base, int ngpio, ct = gc->chip_types; ct->type = IRQ_TYPE_EDGE_FALLING; ct->regs.ack = GPIO_INTERRUPT_CLEAR; - ct->regs.enable = GPIO_INTERRUPT_ENABLE; ct->chip.irq_ack = irq_gc_ack_set_bit; - ct->chip.irq_enable = irq_gc_unmask_enable_reg; - ct->chip.irq_disable = irq_gc_mask_disable_reg; + ct->regs.mask = GPIO_INTERRUPT_ENABLE; + ct->chip.irq_enable = irq_gc_mask_set_bit; + ct->chip.irq_disable = irq_gc_mask_clr_bit; ct->chip.irq_set_type = cns3xxx_gpio_irq_set_type; ct->handler = handle_edge_irq; diff --git a/target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch b/target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch index 3e28b7e3cd..2e30fe5006 100644 --- a/target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch +++ b/target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch @@ -1,6 +1,6 @@ --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c -@@ -2003,7 +2003,8 @@ static void pcie_write_mrrs(struct pci_d +@@ -2015,7 +2015,8 @@ static void pcie_write_mrrs(struct pci_d /* In the "safe" case, do not configure the MRRS. There appear to be * issues with setting MRRS to 0 on a number of devices. */ diff --git a/target/linux/gemini/image/Makefile b/target/linux/gemini/image/Makefile index 1c51b62f68..2cea857770 100644 --- a/target/linux/gemini/image/Makefile +++ b/target/linux/gemini/image/Makefile @@ -10,19 +10,19 @@ include $(INCLUDE_DIR)/image.mk ifeq ($(SUBTARGET),wiligear) define Image/Prepare # WBD111: mach id 1690 (0x69a) - echo -en "\x06\x1c\xa0\xe3\x9a\x10\x81\xe3" > $(KDIR)/$(IMG_PREFIX)-wbd111-zImage - cat $(KDIR)/zImage >> $(KDIR)/$(IMG_PREFIX)-wbd111-zImage + echo -en "\x06\x1c\xa0\xe3\x9a\x10\x81\xe3" > $(KDIR)/wbd111-zImage + cat $(KDIR)/zImage >> $(KDIR)/wbd111-zImage # WBD222: mach id 2753 (0xAC1) - echo -en "\x0a\x1c\xa0\xe3\xc1\x10\x81\xe3" > $(KDIR)/$(IMG_PREFIX)-wbd222-zImage - cat $(KDIR)/zImage >> $(KDIR)/$(IMG_PREFIX)-wbd222-zImage + echo -en "\x0a\x1c\xa0\xe3\xc1\x10\x81\xe3" > $(KDIR)/wbd222-zImage + cat $(KDIR)/zImage >> $(KDIR)/wbd222-zImage endef endif ifeq ($(SUBTARGET),raidsonic) define Image/Prepare # NAS4220: mach id 2038 (0x7F6) - echo -en "\x07\x1c\xa0\xe3\xf6\x10\x81\xe3" > $(KDIR)/$(IMG_PREFIX)-nas4220-zImage - cat $(KDIR)/zImage >> $(KDIR)/$(IMG_PREFIX)-nas4220-zImage + echo -en "\x07\x1c\xa0\xe3\xf6\x10\x81\xe3" > $(KDIR)/nas4220-zImage + cat $(KDIR)/zImage >> $(KDIR)/nas4220-zImage endef endif @@ -30,9 +30,9 @@ ifeq ($(SUBTARGET),wiligear) define Image/BuildKernel # workaround the bootloader's bug with extra nops echo -en "\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1" > $(BIN_DIR)/$(IMG_PREFIX)-wbd111-zImage - cat $(KDIR)/$(IMG_PREFIX)-wbd111-zImage >> $(BIN_DIR)/$(IMG_PREFIX)-wbd111-zImage + cat $(KDIR)/wbd111-zImage >> $(BIN_DIR)/$(IMG_PREFIX)-wbd111-zImage echo -en "\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1" > $(BIN_DIR)/$(IMG_PREFIX)-wbd222-zImage - cat $(KDIR)/$(IMG_PREFIX)-wbd222-zImage >> $(BIN_DIR)/$(IMG_PREFIX)-wbd222-zImage + cat $(KDIR)/wbd222-zImage >> $(BIN_DIR)/$(IMG_PREFIX)-wbd222-zImage endef endif @@ -74,7 +74,7 @@ define Image/Build dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img of=$(BIN_DIR)/rd.gz bs=6144k count=1 # dd if=/dev/zero of=$(BIN_DIR)/hddapp.tgz bs=6144k count=1 dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img of=$(BIN_DIR)/hddapp.tgz bs=6144k count=1 seek=1 - cp $(KDIR)/$(IMG_PREFIX)-nas4220-zImage $(BIN_DIR)/ + cp $(KDIR)/nas4220-zImage $(BIN_DIR)/$(IMG_PREFIX)-nas4220-zImage cp $(BIN_DIR)/$(IMG_PREFIX)-nas4220-zImage $(BIN_DIR)/zImage cp ./ImageInfo-ib4220 $(BIN_DIR)/ImageInfo (cd $(BIN_DIR); tar -czf $(IMG_PREFIX)-sysupgrade-ib4220.tar.gz ImageInfo zImage rd.gz hddapp.tgz) diff --git a/target/linux/gemini/patches-4.4/150-gemini-pata.patch b/target/linux/gemini/patches-4.4/150-gemini-pata.patch index 3da05c5193..1054be08b5 100644 --- a/target/linux/gemini/patches-4.4/150-gemini-pata.patch +++ b/target/linux/gemini/patches-4.4/150-gemini-pata.patch @@ -123,7 +123,7 @@ .length = SZ_512K, --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig -@@ -564,6 +564,16 @@ config PATA_EP93XX +@@ -567,6 +567,16 @@ config PATA_EP93XX If unsure, say N. diff --git a/target/linux/generic/backport-4.14/010-Kbuild-don-t-hardcode-path-to-awk-in-scripts-ld-vers.patch b/target/linux/generic/backport-4.14/010-Kbuild-don-t-hardcode-path-to-awk-in-scripts-ld-vers.patch new file mode 100644 index 0000000000..7ac4f9d240 --- /dev/null +++ b/target/linux/generic/backport-4.14/010-Kbuild-don-t-hardcode-path-to-awk-in-scripts-ld-vers.patch @@ -0,0 +1,30 @@ +From 13b1ecc3401653a355798eb1dee10cc1608202f4 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Mon, 18 Jan 2016 12:27:49 +0100 +Subject: [PATCH 33/34] Kbuild: don't hardcode path to awk in + scripts/ld-version.sh + +On some systems /usr/bin/awk does not exist, or is broken. Find it via +$PATH instead. + +Signed-off-by: Felix Fietkau +--- + scripts/ld-version.sh | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/scripts/ld-version.sh ++++ b/scripts/ld-version.sh +@@ -1,6 +1,7 @@ +-#!/usr/bin/awk -f ++#!/bin/sh + # SPDX-License-Identifier: GPL-2.0 + # extract linker version number from stdin and turn into single number ++exec awk ' + { + gsub(".*\\)", ""); + gsub(".*version ", ""); +@@ -9,3 +10,4 @@ + print a[1]*100000000 + a[2]*1000000 + a[3]*10000; + exit + } ++' diff --git a/target/linux/generic/backport-4.14/011-kbuild-export-SUBARCH.patch b/target/linux/generic/backport-4.14/011-kbuild-export-SUBARCH.patch new file mode 100644 index 0000000000..7080cd10a8 --- /dev/null +++ b/target/linux/generic/backport-4.14/011-kbuild-export-SUBARCH.patch @@ -0,0 +1,23 @@ +From 173019b66dcc9d68ad9333aa744dad1e369b5aa8 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sun, 9 Jul 2017 00:26:53 +0200 +Subject: [PATCH 34/34] kernel: add compile fix for linux 4.9 on x86 + +Signed-off-by: Felix Fietkau +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/Makefile ++++ b/Makefile +@@ -410,8 +410,8 @@ KERNELRELEASE = $(shell cat include/conf + KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) + + export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION +-export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC +-export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBES ++export ARCH SRCARCH SUBARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD ++export CC CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBES + export MAKE AWK GENKSYMS INSTALLKERNEL PERL PYTHON UTS_MACHINE + export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS + diff --git a/target/linux/generic/backport-4.14/020-backport_netfilter_rtcache.patch b/target/linux/generic/backport-4.14/020-backport_netfilter_rtcache.patch new file mode 100644 index 0000000000..8a6fba4307 --- /dev/null +++ b/target/linux/generic/backport-4.14/020-backport_netfilter_rtcache.patch @@ -0,0 +1,558 @@ +From 1bb0c3ec899827cfa4668bb63a08713a40744d21 Mon Sep 17 00:00:00 2001 +From: Florian Westphal +Date: Sun, 9 Jul 2017 08:58:30 +0200 +Subject: [PATCH] netfilter: conntrack: cache route for forwarded connections + +... to avoid per-packet FIB lookup if possible. + +The cached dst is re-used provided the input interface +is the same as that of the previous packet in the same direction. + +If not, the cached dst is invalidated. + +For ipv6 we also need to store sernum, else dst_check doesn't work, +pointed out by Eric Dumazet. + +This should speed up forwarding when conntrack is already in use +anyway, especially when using reverse path filtering -- active RPF +enforces two FIB lookups for each packet. + +Before the routing cache removal this didn't matter since RPF was performed +only when route cache didn't yield a result; but without route cache it +comes at higher price. + +Julian Anastasov suggested to add NETDEV_UNREGISTER handler to +avoid holding on to dsts of 'frozen' conntracks. + +Signed-off-by: Florian Westphal +--- + include/net/netfilter/nf_conntrack_extend.h | 4 + + include/net/netfilter/nf_conntrack_rtcache.h | 34 +++ + net/netfilter/Kconfig | 12 + + net/netfilter/Makefile | 3 + + net/netfilter/nf_conntrack_rtcache.c | 428 +++++++++++++++++++++++++++ + 5 files changed, 481 insertions(+) + create mode 100644 include/net/netfilter/nf_conntrack_rtcache.h + create mode 100644 net/netfilter/nf_conntrack_rtcache.c + +--- a/include/net/netfilter/nf_conntrack_extend.h ++++ b/include/net/netfilter/nf_conntrack_extend.h +@@ -28,6 +28,9 @@ enum nf_ct_ext_id { + #if IS_ENABLED(CONFIG_NETFILTER_SYNPROXY) + NF_CT_EXT_SYNPROXY, + #endif ++#if IS_ENABLED(CONFIG_NF_CONNTRACK_RTCACHE) ++ NF_CT_EXT_RTCACHE, ++#endif + NF_CT_EXT_NUM, + }; + +@@ -40,6 +43,7 @@ enum nf_ct_ext_id { + #define NF_CT_EXT_TIMEOUT_TYPE struct nf_conn_timeout + #define NF_CT_EXT_LABELS_TYPE struct nf_conn_labels + #define NF_CT_EXT_SYNPROXY_TYPE struct nf_conn_synproxy ++#define NF_CT_EXT_RTCACHE_TYPE struct nf_conn_rtcache + + /* Extensions: optional stuff which isn't permanently in struct. */ + struct nf_ct_ext { +--- /dev/null ++++ b/include/net/netfilter/nf_conntrack_rtcache.h +@@ -0,0 +1,34 @@ ++#include ++#include ++#include ++ ++struct dst_entry; ++ ++struct nf_conn_dst_cache { ++ struct dst_entry *dst; ++ int iif; ++#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6) ++ u32 cookie; ++#endif ++ ++}; ++ ++struct nf_conn_rtcache { ++ struct nf_conn_dst_cache cached_dst[IP_CT_DIR_MAX]; ++}; ++ ++static inline ++struct nf_conn_rtcache *nf_ct_rtcache_find(const struct nf_conn *ct) ++{ ++#if IS_ENABLED(CONFIG_NF_CONNTRACK_RTCACHE) ++ return nf_ct_ext_find(ct, NF_CT_EXT_RTCACHE); ++#else ++ return NULL; ++#endif ++} ++ ++static inline int nf_conn_rtcache_iif_get(const struct nf_conn_rtcache *rtc, ++ enum ip_conntrack_dir dir) ++{ ++ return rtc->cached_dst[dir].iif; ++} +--- a/net/netfilter/Kconfig ++++ b/net/netfilter/Kconfig +@@ -118,6 +118,18 @@ config NF_CONNTRACK_EVENTS + + If unsure, say `N'. + ++config NF_CONNTRACK_RTCACHE ++ tristate "Cache route entries in conntrack objects" ++ depends on NETFILTER_ADVANCED ++ depends on NF_CONNTRACK ++ help ++ If this option is enabled, the connection tracking code will ++ cache routing information for each connection that is being ++ forwarded, at a cost of 32 bytes per conntrack object. ++ ++ To compile it as a module, choose M here. If unsure, say N. ++ The module will be called nf_conntrack_rtcache. ++ + config NF_CONNTRACK_TIMEOUT + bool 'Connection tracking timeout' + depends on NETFILTER_ADVANCED +--- a/net/netfilter/Makefile ++++ b/net/netfilter/Makefile +@@ -19,6 +19,9 @@ obj-$(CONFIG_NETFILTER_NETLINK_LOG) += n + # connection tracking + obj-$(CONFIG_NF_CONNTRACK) += nf_conntrack.o + ++# optional conntrack route cache extension ++obj-$(CONFIG_NF_CONNTRACK_RTCACHE) += nf_conntrack_rtcache.o ++ + obj-$(CONFIG_NF_CT_PROTO_GRE) += nf_conntrack_proto_gre.o + + # netlink interface for nf_conntrack +--- /dev/null ++++ b/net/netfilter/nf_conntrack_rtcache.c +@@ -0,0 +1,428 @@ ++/* route cache for netfilter. ++ * ++ * (C) 2014 Red Hat GmbH ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#include ++#include ++#include ++#include ++ ++#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6) ++#include ++#endif ++ ++static void __nf_conn_rtcache_destroy(struct nf_conn_rtcache *rtc, ++ enum ip_conntrack_dir dir) ++{ ++ struct dst_entry *dst = rtc->cached_dst[dir].dst; ++ ++ dst_release(dst); ++} ++ ++static void nf_conn_rtcache_destroy(struct nf_conn *ct) ++{ ++ struct nf_conn_rtcache *rtc = nf_ct_rtcache_find(ct); ++ ++ if (!rtc) ++ return; ++ ++ __nf_conn_rtcache_destroy(rtc, IP_CT_DIR_ORIGINAL); ++ __nf_conn_rtcache_destroy(rtc, IP_CT_DIR_REPLY); ++} ++ ++static void nf_ct_rtcache_ext_add(struct nf_conn *ct) ++{ ++ struct nf_conn_rtcache *rtc; ++ ++ rtc = nf_ct_ext_add(ct, NF_CT_EXT_RTCACHE, GFP_ATOMIC); ++ if (rtc) { ++ rtc->cached_dst[IP_CT_DIR_ORIGINAL].iif = -1; ++ rtc->cached_dst[IP_CT_DIR_ORIGINAL].dst = NULL; ++ rtc->cached_dst[IP_CT_DIR_REPLY].iif = -1; ++ rtc->cached_dst[IP_CT_DIR_REPLY].dst = NULL; ++ } ++} ++ ++static struct nf_conn_rtcache *nf_ct_rtcache_find_usable(struct nf_conn *ct) ++{ ++ return nf_ct_rtcache_find(ct); ++} ++ ++static struct dst_entry * ++nf_conn_rtcache_dst_get(const struct nf_conn_rtcache *rtc, ++ enum ip_conntrack_dir dir) ++{ ++ return rtc->cached_dst[dir].dst; ++} ++ ++static u32 nf_rtcache_get_cookie(int pf, const struct dst_entry *dst) ++{ ++#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6) ++ if (pf == NFPROTO_IPV6) { ++ const struct rt6_info *rt = (const struct rt6_info *)dst; ++ ++ if (rt->rt6i_node) ++ return (u32)rt->rt6i_node->fn_sernum; ++ } ++#endif ++ return 0; ++} ++ ++static void nf_conn_rtcache_dst_set(int pf, ++ struct nf_conn_rtcache *rtc, ++ struct dst_entry *dst, ++ enum ip_conntrack_dir dir, int iif) ++{ ++ if (rtc->cached_dst[dir].iif != iif) ++ rtc->cached_dst[dir].iif = iif; ++ ++ if (rtc->cached_dst[dir].dst != dst) { ++ struct dst_entry *old; ++ ++ dst_hold(dst); ++ ++ old = xchg(&rtc->cached_dst[dir].dst, dst); ++ dst_release(old); ++ ++#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6) ++ if (pf == NFPROTO_IPV6) ++ rtc->cached_dst[dir].cookie = ++ nf_rtcache_get_cookie(pf, dst); ++#endif ++ } ++} ++ ++static void nf_conn_rtcache_dst_obsolete(struct nf_conn_rtcache *rtc, ++ enum ip_conntrack_dir dir) ++{ ++ struct dst_entry *old; ++ ++ pr_debug("Invalidate iif %d for dir %d on cache %p\n", ++ rtc->cached_dst[dir].iif, dir, rtc); ++ ++ old = xchg(&rtc->cached_dst[dir].dst, NULL); ++ dst_release(old); ++ rtc->cached_dst[dir].iif = -1; ++} ++ ++static unsigned int nf_rtcache_in(u_int8_t pf, ++ struct sk_buff *skb, ++ const struct nf_hook_state *state) ++{ ++ struct nf_conn_rtcache *rtc; ++ enum ip_conntrack_info ctinfo; ++ enum ip_conntrack_dir dir; ++ struct dst_entry *dst; ++ struct nf_conn *ct; ++ int iif; ++ u32 cookie; ++ ++ if (skb_dst(skb) || skb->sk) ++ return NF_ACCEPT; ++ ++ ct = nf_ct_get(skb, &ctinfo); ++ if (!ct) ++ return NF_ACCEPT; ++ ++ rtc = nf_ct_rtcache_find_usable(ct); ++ if (!rtc) ++ return NF_ACCEPT; ++ ++ /* if iif changes, don't use cache and let ip stack ++ * do route lookup. ++ * ++ * If rp_filter is enabled it might toss skb, so ++ * we don't want to avoid these checks. ++ */ ++ dir = CTINFO2DIR(ctinfo); ++ iif = nf_conn_rtcache_iif_get(rtc, dir); ++ if (state->in->ifindex != iif) { ++ pr_debug("ct %p, iif %d, cached iif %d, skip cached entry\n", ++ ct, iif, state->in->ifindex); ++ return NF_ACCEPT; ++ } ++ dst = nf_conn_rtcache_dst_get(rtc, dir); ++ if (dst == NULL) ++ return NF_ACCEPT; ++ ++ cookie = nf_rtcache_get_cookie(pf, dst); ++ ++ dst = dst_check(dst, cookie); ++ pr_debug("obtained dst %p for skb %p, cookie %d\n", dst, skb, cookie); ++ if (likely(dst)) ++ skb_dst_set_noref(skb, dst); ++ else ++ nf_conn_rtcache_dst_obsolete(rtc, dir); ++ ++ return NF_ACCEPT; ++} ++ ++static unsigned int nf_rtcache_forward(u_int8_t pf, ++ struct sk_buff *skb, ++ const struct nf_hook_state *state) ++{ ++ struct nf_conn_rtcache *rtc; ++ enum ip_conntrack_info ctinfo; ++ enum ip_conntrack_dir dir; ++ struct nf_conn *ct; ++ struct dst_entry *dst = skb_dst(skb); ++ int iif; ++ ++ ct = nf_ct_get(skb, &ctinfo); ++ if (!ct) ++ return NF_ACCEPT; ++ ++ if (dst && dst_xfrm(dst)) ++ return NF_ACCEPT; ++ ++ if (!nf_ct_is_confirmed(ct)) { ++ if (WARN_ON(nf_ct_rtcache_find(ct))) ++ return NF_ACCEPT; ++ nf_ct_rtcache_ext_add(ct); ++ return NF_ACCEPT; ++ } ++ ++ rtc = nf_ct_rtcache_find_usable(ct); ++ if (!rtc) ++ return NF_ACCEPT; ++ ++ dir = CTINFO2DIR(ctinfo); ++ iif = nf_conn_rtcache_iif_get(rtc, dir); ++ pr_debug("ct %p, skb %p, dir %d, iif %d, cached iif %d\n", ++ ct, skb, dir, iif, state->in->ifindex); ++ if (likely(state->in->ifindex == iif)) ++ return NF_ACCEPT; ++ ++ nf_conn_rtcache_dst_set(pf, rtc, skb_dst(skb), dir, state->in->ifindex); ++ return NF_ACCEPT; ++} ++ ++static unsigned int nf_rtcache_in4(void *priv, ++ struct sk_buff *skb, ++ const struct nf_hook_state *state) ++{ ++ return nf_rtcache_in(NFPROTO_IPV4, skb, state); ++} ++ ++static unsigned int nf_rtcache_forward4(void *priv, ++ struct sk_buff *skb, ++ const struct nf_hook_state *state) ++{ ++ return nf_rtcache_forward(NFPROTO_IPV4, skb, state); ++} ++ ++#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6) ++static unsigned int nf_rtcache_in6(void *priv, ++ struct sk_buff *skb, ++ const struct nf_hook_state *state) ++{ ++ return nf_rtcache_in(NFPROTO_IPV6, skb, state); ++} ++ ++static unsigned int nf_rtcache_forward6(void *priv, ++ struct sk_buff *skb, ++ const struct nf_hook_state *state) ++{ ++ return nf_rtcache_forward(NFPROTO_IPV6, skb, state); ++} ++#endif ++ ++static int nf_rtcache_dst_remove(struct nf_conn *ct, void *data) ++{ ++ struct nf_conn_rtcache *rtc = nf_ct_rtcache_find(ct); ++ struct net_device *dev = data; ++ ++ if (!rtc) ++ return 0; ++ ++ if (dev->ifindex == rtc->cached_dst[IP_CT_DIR_ORIGINAL].iif || ++ dev->ifindex == rtc->cached_dst[IP_CT_DIR_REPLY].iif) { ++ nf_conn_rtcache_dst_obsolete(rtc, IP_CT_DIR_ORIGINAL); ++ nf_conn_rtcache_dst_obsolete(rtc, IP_CT_DIR_REPLY); ++ } ++ ++ return 0; ++} ++ ++static int nf_rtcache_netdev_event(struct notifier_block *this, ++ unsigned long event, void *ptr) ++{ ++ struct net_device *dev = netdev_notifier_info_to_dev(ptr); ++ struct net *net = dev_net(dev); ++ ++ if (event == NETDEV_DOWN) ++ nf_ct_iterate_cleanup_net(net, nf_rtcache_dst_remove, dev, 0, 0); ++ ++ return NOTIFY_DONE; ++} ++ ++static struct notifier_block nf_rtcache_notifier = { ++ .notifier_call = nf_rtcache_netdev_event, ++}; ++ ++static struct nf_hook_ops rtcache_ops[] = { ++ { ++ .hook = nf_rtcache_in4, ++ .pf = NFPROTO_IPV4, ++ .hooknum = NF_INET_PRE_ROUTING, ++ .priority = NF_IP_PRI_LAST, ++ }, ++ { ++ .hook = nf_rtcache_forward4, ++ .pf = NFPROTO_IPV4, ++ .hooknum = NF_INET_FORWARD, ++ .priority = NF_IP_PRI_LAST, ++ }, ++#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6) ++ { ++ .hook = nf_rtcache_in6, ++ .pf = NFPROTO_IPV6, ++ .hooknum = NF_INET_PRE_ROUTING, ++ .priority = NF_IP_PRI_LAST, ++ }, ++ { ++ .hook = nf_rtcache_forward6, ++ .pf = NFPROTO_IPV6, ++ .hooknum = NF_INET_FORWARD, ++ .priority = NF_IP_PRI_LAST, ++ }, ++#endif ++}; ++ ++static struct nf_ct_ext_type rtcache_extend __read_mostly = { ++ .len = sizeof(struct nf_conn_rtcache), ++ .align = __alignof__(struct nf_conn_rtcache), ++ .id = NF_CT_EXT_RTCACHE, ++ .destroy = nf_conn_rtcache_destroy, ++}; ++ ++static void __net_exit rtcache_net_exit(struct net *net) ++{ ++ /* remove hooks so no new connections get rtcache extension */ ++ nf_unregister_net_hooks(net, rtcache_ops, ARRAY_SIZE(rtcache_ops)); ++} ++ ++static struct pernet_operations rtcache_ops_net_ops = { ++ .exit = rtcache_net_exit, ++}; ++ ++static int __init nf_conntrack_rtcache_init(void) ++{ ++ int ret = nf_ct_extend_register(&rtcache_extend); ++ ++ if (ret < 0) { ++ pr_err("nf_conntrack_rtcache: Unable to register extension\n"); ++ return ret; ++ } ++ ++ ret = register_pernet_subsys(&rtcache_ops_net_ops); ++ if (ret) { ++ nf_ct_extend_unregister(&rtcache_extend); ++ return ret; ++ } ++ ++ ret = nf_register_net_hooks(&init_net, rtcache_ops, ++ ARRAY_SIZE(rtcache_ops)); ++ if (ret < 0) { ++ nf_ct_extend_unregister(&rtcache_extend); ++ unregister_pernet_subsys(&rtcache_ops_net_ops); ++ return ret; ++ } ++ ++ ret = register_netdevice_notifier(&nf_rtcache_notifier); ++ if (ret) { ++ nf_unregister_net_hooks(&init_net, rtcache_ops, ++ ARRAY_SIZE(rtcache_ops)); ++ nf_ct_extend_unregister(&rtcache_extend); ++ unregister_pernet_subsys(&rtcache_ops_net_ops); ++ } ++ ++ return ret; ++} ++ ++static int nf_rtcache_ext_remove(struct nf_conn *ct, void *data) ++{ ++ struct nf_conn_rtcache *rtc = nf_ct_rtcache_find(ct); ++ ++ return rtc != NULL; ++} ++ ++static bool __exit nf_conntrack_rtcache_wait_for_dying(struct net *net) ++{ ++ bool wait = false; ++ int cpu; ++ ++ for_each_possible_cpu(cpu) { ++ struct nf_conntrack_tuple_hash *h; ++ struct hlist_nulls_node *n; ++ struct nf_conn *ct; ++ struct ct_pcpu *pcpu = per_cpu_ptr(net->ct.pcpu_lists, cpu); ++ ++ rcu_read_lock(); ++ spin_lock_bh(&pcpu->lock); ++ ++ hlist_nulls_for_each_entry(h, n, &pcpu->dying, hnnode) { ++ ct = nf_ct_tuplehash_to_ctrack(h); ++ if (nf_ct_rtcache_find(ct) != NULL) { ++ wait = true; ++ break; ++ } ++ } ++ spin_unlock_bh(&pcpu->lock); ++ rcu_read_unlock(); ++ } ++ ++ return wait; ++} ++ ++static void __exit nf_conntrack_rtcache_fini(void) ++{ ++ struct net *net; ++ int count = 0; ++ ++ synchronize_net(); ++ ++ unregister_netdevice_notifier(&nf_rtcache_notifier); ++ ++ rtnl_lock(); ++ ++ /* zap all conntracks with rtcache extension */ ++ for_each_net(net) ++ nf_ct_iterate_cleanup_net(net, nf_rtcache_ext_remove, NULL, 0, 0); ++ ++ for_each_net(net) { ++ /* .. and make sure they're gone from dying list, too */ ++ while (nf_conntrack_rtcache_wait_for_dying(net)) { ++ msleep(200); ++ WARN_ONCE(++count > 25, "Waiting for all rtcache conntracks to go away\n"); ++ } ++ } ++ ++ rtnl_unlock(); ++ synchronize_net(); ++ nf_ct_extend_unregister(&rtcache_extend); ++} ++module_init(nf_conntrack_rtcache_init); ++module_exit(nf_conntrack_rtcache_fini); ++ ++MODULE_LICENSE("GPL"); ++MODULE_AUTHOR("Florian Westphal "); ++MODULE_DESCRIPTION("Conntrack route cache extension"); diff --git a/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch b/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch new file mode 100644 index 0000000000..0c57f2e337 --- /dev/null +++ b/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch @@ -0,0 +1,85 @@ +From: Eric Dumazet +Date: Sat, 11 Nov 2017 15:54:12 -0800 +Subject: [PATCH] tcp: allow drivers to tweak TSQ logic +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +I had many reports that TSQ logic breaks wifi aggregation. + +Current logic is to allow up to 1 ms of bytes to be queued into qdisc +and drivers queues. + +But Wifi aggregation needs a bigger budget to allow bigger rates to +be discovered by various TCP Congestion Controls algorithms. + +This patch adds an extra socket field, allowing wifi drivers to select +another log scale to derive TCP Small Queue credit from current pacing +rate. + +Initial value is 10, meaning that this patch does not change current +behavior. + +We expect wifi drivers to set this field to smaller values (tests have +been done with values from 6 to 9) + +They would have to use following template : + +if (skb->sk && skb->sk->sk_pacing_shift != MY_PACING_SHIFT) + skb->sk->sk_pacing_shift = MY_PACING_SHIFT; + +Ref: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1670041 +Signed-off-by: Eric Dumazet +Cc: Johannes Berg +Cc: Toke Høiland-Jørgensen +Cc: Kir Kolyshkin +--- +--- a/include/net/sock.h ++++ b/include/net/sock.h +@@ -267,6 +267,7 @@ struct sock_common { + * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4) + * @sk_gso_max_size: Maximum GSO segment size to build + * @sk_gso_max_segs: Maximum number of GSO segments ++ * @sk_pacing_shift: scaling factor for TCP Small Queues + * @sk_lingertime: %SO_LINGER l_linger setting + * @sk_backlog: always used with the per-socket spinlock held + * @sk_callback_lock: used with the callbacks in the end of this struct +@@ -448,6 +449,8 @@ struct sock { + kmemcheck_bitfield_end(flags); + + u16 sk_gso_max_segs; ++#define sk_pacing_shift sk_pacing_shift /* for backport checks */ ++ u8 sk_pacing_shift; + unsigned long sk_lingertime; + struct proto *sk_prot_creator; + rwlock_t sk_callback_lock; +--- a/net/core/sock.c ++++ b/net/core/sock.c +@@ -2744,6 +2744,7 @@ void sock_init_data(struct socket *sock, + + sk->sk_max_pacing_rate = ~0U; + sk->sk_pacing_rate = ~0U; ++ sk->sk_pacing_shift = 10; + sk->sk_incoming_cpu = -1; + /* + * Before updating sk_refcnt, we must commit prior changes to memory +--- a/net/ipv4/tcp_output.c ++++ b/net/ipv4/tcp_output.c +@@ -1671,7 +1671,7 @@ u32 tcp_tso_autosize(const struct sock * + { + u32 bytes, segs; + +- bytes = min(sk->sk_pacing_rate >> 10, ++ bytes = min(sk->sk_pacing_rate >> sk->sk_pacing_shift, + sk->sk_gso_max_size - 1 - MAX_TCP_HEADER); + + /* Goal is to send at least one packet per ms, +@@ -2145,7 +2145,7 @@ static bool tcp_small_queue_check(struct + { + unsigned int limit; + +- limit = max(2 * skb->truesize, sk->sk_pacing_rate >> 10); ++ limit = max(2 * skb->truesize, sk->sk_pacing_rate >> sk->sk_pacing_shift); + limit = min_t(u32, limit, sysctl_tcp_limit_output_bytes); + limit <<= factor; + diff --git a/target/linux/generic/backport-4.14/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch b/target/linux/generic/backport-4.14/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch new file mode 100644 index 0000000000..b3e272066b --- /dev/null +++ b/target/linux/generic/backport-4.14/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch @@ -0,0 +1,25 @@ +From 4b05f09db650d215632da97f2c25ceba8235102a Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Sun, 26 Nov 2017 00:09:45 +0100 +Subject: [PATCH] crypto: fix typo in KPP dependency of CRYPTO_ECDH + +This fixes a typo in the CRYPTO_KPP dependency of CRYPTO_ECDH. + +Fixes: 3c4b23901a0c ("crypto: ecdh - Add ECDH software support") +Cc: # v4.8+ +Signed-off-by: Hauke Mehrtens +--- + crypto/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/crypto/Kconfig ++++ b/crypto/Kconfig +@@ -130,7 +130,7 @@ config CRYPTO_DH + + config CRYPTO_ECDH + tristate "ECDH algorithm" +- select CRYTPO_KPP ++ select CRYPTO_KPP + select CRYPTO_RNG_DEFAULT + help + Generic implementation of the ECDH algorithm diff --git a/target/linux/generic/backport-4.14/041-v4.16-0001-mtd-partitions-add-of_match_table-parser-matching.patch b/target/linux/generic/backport-4.14/041-v4.16-0001-mtd-partitions-add-of_match_table-parser-matching.patch new file mode 100644 index 0000000000..d698821f3c --- /dev/null +++ b/target/linux/generic/backport-4.14/041-v4.16-0001-mtd-partitions-add-of_match_table-parser-matching.patch @@ -0,0 +1,121 @@ +From bb2192123ec70470d6ea33f138846b175403a968 Mon Sep 17 00:00:00 2001 +From: Brian Norris +Date: Thu, 4 Jan 2018 08:05:33 +0100 +Subject: [PATCH] mtd: partitions: add of_match_table parser matching +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Partition parsers can now provide an of_match_table to enable +flash<-->parser matching via device tree as documented in the +mtd/partition.txt. + +It works by looking for a matching parser for every string in the +"compatibility" property (starting with the most specific one). + +This support is currently limited to built-in parsers as it uses +request_module() and friends. This should be sufficient for most cases +though as compiling parsers as modules isn't a common choice. + +Signed-off-by: Brian Norris +Signed-off-by: Rafał Miłecki +Signed-off-by: Boris Brezillon +--- + drivers/mtd/mtdpart.c | 59 ++++++++++++++++++++++++++++++++++++++++++ + include/linux/mtd/partitions.h | 1 + + 2 files changed, 60 insertions(+) + +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + + #include "mtdcore.h" + +@@ -894,6 +895,45 @@ static int mtd_part_do_parse(struct mtd_ + } + + /** ++ * mtd_part_get_compatible_parser - find MTD parser by a compatible string ++ * ++ * @compat: compatible string describing partitions in a device tree ++ * ++ * MTD parsers can specify supported partitions by providing a table of ++ * compatibility strings. This function finds a parser that advertises support ++ * for a passed value of "compatible". ++ */ ++static struct mtd_part_parser *mtd_part_get_compatible_parser(const char *compat) ++{ ++ struct mtd_part_parser *p, *ret = NULL; ++ ++ spin_lock(&part_parser_lock); ++ ++ list_for_each_entry(p, &part_parsers, list) { ++ const struct of_device_id *matches; ++ ++ matches = p->of_match_table; ++ if (!matches) ++ continue; ++ ++ for (; matches->compatible[0]; matches++) { ++ if (!strcmp(matches->compatible, compat) && ++ try_module_get(p->owner)) { ++ ret = p; ++ break; ++ } ++ } ++ ++ if (ret) ++ break; ++ } ++ ++ spin_unlock(&part_parser_lock); ++ ++ return ret; ++} ++ ++/** + * parse_mtd_partitions - parse MTD partitions + * @master: the master partition (describes whole MTD device) + * @types: names of partition parsers to try or %NULL +@@ -919,8 +959,27 @@ int parse_mtd_partitions(struct mtd_info + struct mtd_part_parser_data *data) + { + struct mtd_part_parser *parser; ++ struct device_node *np; ++ struct property *prop; ++ const char *compat; + int ret, err = 0; + ++ np = of_get_child_by_name(mtd_get_of_node(master), "partitions"); ++ of_property_for_each_string(np, "compatible", prop, compat) { ++ parser = mtd_part_get_compatible_parser(compat); ++ if (!parser) ++ continue; ++ ret = mtd_part_do_parse(parser, master, pparts, data); ++ if (ret > 0) { ++ of_node_put(np); ++ return 0; ++ } ++ mtd_part_parser_put(parser); ++ if (ret < 0 && !err) ++ err = ret; ++ } ++ of_node_put(np); ++ + if (!types) + types = default_mtd_part_types; + +--- a/include/linux/mtd/partitions.h ++++ b/include/linux/mtd/partitions.h +@@ -77,6 +77,7 @@ struct mtd_part_parser { + struct list_head list; + struct module *owner; + const char *name; ++ const struct of_device_id *of_match_table; + int (*parse_fn)(struct mtd_info *, const struct mtd_partition **, + struct mtd_part_parser_data *); + void (*cleanup)(const struct mtd_partition *pparts, int nr_parts); diff --git a/target/linux/generic/backport-4.14/041-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch b/target/linux/generic/backport-4.14/041-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch new file mode 100644 index 0000000000..2092cc28fd --- /dev/null +++ b/target/linux/generic/backport-4.14/041-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch @@ -0,0 +1,43 @@ +From 4ac9222778478a00c7fc9d347b7ed1e0e595120d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 4 Jan 2018 08:05:34 +0100 +Subject: [PATCH] mtd: ofpart: add of_match_table with "fixed-partitions" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This allows using this parser with any flash driver that takes care of +setting of_node (using mtd_set_of_node helper) correctly. Up to now +support for "fixed-partitions" DT compatibility string was working only +with flash drivers that were specifying "ofpart" (manually or by letting +mtd use the default set of parsers). + +This matches existing bindings documentation. + +Signed-off-by: Rafał Miłecki +Reviewed-by: Brian Norris +Tested-by: Brian Norris +Signed-off-by: Boris Brezillon +--- + drivers/mtd/ofpart.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/mtd/ofpart.c ++++ b/drivers/mtd/ofpart.c +@@ -140,9 +140,16 @@ ofpart_none: + return ret; + } + ++static const struct of_device_id parse_ofpart_match_table[] = { ++ { .compatible = "fixed-partitions" }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, parse_ofpart_match_table); ++ + static struct mtd_part_parser ofpart_parser = { + .parse_fn = parse_ofpart_partitions, + .name = "ofpart", ++ .of_match_table = parse_ofpart_match_table, + }; + + static int parse_ofoldpart_partitions(struct mtd_info *master, diff --git a/target/linux/generic/backport-4.14/071-v4.15-0001-net-bgmac-enable-master-mode-for-BCM54210E-and-B5021.patch b/target/linux/generic/backport-4.14/071-v4.15-0001-net-bgmac-enable-master-mode-for-BCM54210E-and-B5021.patch new file mode 100644 index 0000000000..db239e0a00 --- /dev/null +++ b/target/linux/generic/backport-4.14/071-v4.15-0001-net-bgmac-enable-master-mode-for-BCM54210E-and-B5021.patch @@ -0,0 +1,50 @@ +From 12acd136913ccdf394eeb2bc8686ff5505368119 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 12 Oct 2017 10:21:26 +0200 +Subject: [PATCH] net: bgmac: enable master mode for BCM54210E and B50212E PHYs +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +There are 4 very similar PHYs: +0x600d84a1: BCM54210E (rev B0) +0x600d84a2: BCM54210E (rev B1) +0x600d84a5: B50212E (rev B0) +0x600d84a6: B50212E (rev B1) +that need setting master mode manually. It's because they run in slave +mode by default with Automatic Slave/Master configuration disabled which +can lead to unreliable connection with massive ping loss. + +So far it was reported for a board with BCM47189 SoC and B50212E B1 PHY +connected to the bgmac supported ethernet device. Telling PHY driver to +setup PHY properly solves this issue. + +Signed-off-by: Rafał Miłecki +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/broadcom/bgmac-bcma.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c ++++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c +@@ -184,13 +184,19 @@ static int bgmac_probe(struct bcma_devic + + if (!bgmac_is_bcm4707_family(core) && + !(ci->id == BCMA_CHIP_ID_BCM53573 && core->core_unit == 1)) { ++ struct phy_device *phydev; ++ + mii_bus = bcma_mdio_mii_register(bgmac); + if (IS_ERR(mii_bus)) { + err = PTR_ERR(mii_bus); + goto err; + } +- + bgmac->mii_bus = mii_bus; ++ ++ phydev = mdiobus_get_phy(bgmac->mii_bus, bgmac->phyaddr); ++ if (ci->id == BCMA_CHIP_ID_BCM53573 && phydev && ++ (phydev->drv->phy_id & phydev->drv->phy_id_mask) == PHY_ID_BCM54210E) ++ phydev->dev_flags |= PHY_BRCM_EN_MASTER_MODE; + } + + if (core->bus->hosttype == BCMA_HOSTTYPE_PCI) { diff --git a/target/linux/generic/backport-4.14/076-v4.15-0001-net-phy-broadcom-support-new-device-flag-for-setting.patch b/target/linux/generic/backport-4.14/076-v4.15-0001-net-phy-broadcom-support-new-device-flag-for-setting.patch new file mode 100644 index 0000000000..a22d272656 --- /dev/null +++ b/target/linux/generic/backport-4.14/076-v4.15-0001-net-phy-broadcom-support-new-device-flag-for-setting.patch @@ -0,0 +1,54 @@ +From 2355a6546a053b1c16ebefd6ce1f0cccc00e1da5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 12 Oct 2017 10:21:25 +0200 +Subject: [PATCH] net: phy: broadcom: support new device flag for setting + master mode +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Some of Broadcom's PHYs run by default in slave mode with Automatic +Slave/Master configuration disabled. It stops them from working properly +with some devices. + +So far it has been verified for BCM54210E and BCM50212E which don't +work well with Intel's I217-LM and I218-LM: +http://ark.intel.com/products/60019/Intel-Ethernet-Connection-I217-LM +http://ark.intel.com/products/71307/Intel-Ethernet-Connection-I218-LM +I was told there is massive ping loss. + +This commit adds support for a new flag which can be set by an ethernet +driver to fixup PHY setup. + +Signed-off-by: Rafał Miłecki +Signed-off-by: David S. Miller +--- + drivers/net/phy/broadcom.c | 6 ++++++ + include/linux/brcmphy.h | 1 + + 2 files changed, 7 insertions(+) + +--- a/drivers/net/phy/broadcom.c ++++ b/drivers/net/phy/broadcom.c +@@ -43,6 +43,12 @@ static int bcm54210e_config_init(struct + val &= ~BCM54810_SHD_CLK_CTL_GTXCLK_EN; + bcm_phy_write_shadow(phydev, BCM54810_SHD_CLK_CTL, val); + ++ if (phydev->dev_flags & PHY_BRCM_EN_MASTER_MODE) { ++ val = phy_read(phydev, MII_CTRL1000); ++ val |= CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER; ++ phy_write(phydev, MII_CTRL1000, val); ++ } ++ + return 0; + } + +--- a/include/linux/brcmphy.h ++++ b/include/linux/brcmphy.h +@@ -64,6 +64,7 @@ + #define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00002000 + #define PHY_BRCM_CLEAR_RGMII_MODE 0x00004000 + #define PHY_BRCM_DIS_TXCRXC_NOENRGY 0x00008000 ++#define PHY_BRCM_EN_MASTER_MODE 0x00010000 + + /* Broadcom BCM7xxx specific workarounds */ + #define PHY_BRCM_7XXX_REV(x) (((x) >> 8) & 0xff) diff --git a/target/linux/generic/backport-4.9/011-kbuild-export-SUBARCH.patch b/target/linux/generic/backport-4.9/011-kbuild-export-SUBARCH.patch index d3d11e1044..a191f9b2c6 100644 --- a/target/linux/generic/backport-4.9/011-kbuild-export-SUBARCH.patch +++ b/target/linux/generic/backport-4.9/011-kbuild-export-SUBARCH.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -414,8 +414,8 @@ KERNELRELEASE = $(shell cat include/conf +@@ -409,8 +409,8 @@ KERNELRELEASE = $(shell cat include/conf KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION diff --git a/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch b/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch index 20311498aa..7bf4fd47d2 100644 --- a/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch +++ b/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch @@ -18,7 +18,7 @@ Signed-off-by: David S. Miller --- a/include/linux/tcp.h +++ b/include/linux/tcp.h -@@ -367,7 +367,7 @@ struct tcp_sock { +@@ -368,7 +368,7 @@ struct tcp_sock { u32 *saved_syn; }; @@ -27,7 +27,7 @@ Signed-off-by: David S. Miller TSQ_THROTTLED, TSQ_QUEUED, TCP_TSQ_DEFERRED, /* tcp_tasklet_func() found socket was owned */ -@@ -378,6 +378,15 @@ enum tsq_flags { +@@ -379,6 +379,15 @@ enum tsq_flags { */ }; diff --git a/target/linux/generic/backport-4.9/024-3-tcp-tsq-add-shortcut-in-tcp_tasklet_func.patch b/target/linux/generic/backport-4.9/024-3-tcp-tsq-add-shortcut-in-tcp_tasklet_func.patch index d3db74252a..249a2ce27e 100644 --- a/target/linux/generic/backport-4.9/024-3-tcp-tsq-add-shortcut-in-tcp_tasklet_func.patch +++ b/target/linux/generic/backport-4.9/024-3-tcp-tsq-add-shortcut-in-tcp_tasklet_func.patch @@ -60,7 +60,7 @@ Signed-off-by: David S. Miller nval = cmpxchg(&tp->tsq_flags, oval, nval); if (nval != oval) continue; -@@ -2182,6 +2182,8 @@ static bool tcp_write_xmit(struct sock * +@@ -2183,6 +2183,8 @@ static bool tcp_write_xmit(struct sock * unlikely(tso_fragment(sk, skb, limit, mss_now, gfp))) break; diff --git a/target/linux/generic/backport-4.9/024-5-tcp-tsq-add-a-shortcut-in-tcp_small_queue_check.patch b/target/linux/generic/backport-4.9/024-5-tcp-tsq-add-a-shortcut-in-tcp_small_queue_check.patch index 925d2dcead..463b955341 100644 --- a/target/linux/generic/backport-4.9/024-5-tcp-tsq-add-a-shortcut-in-tcp_small_queue_check.patch +++ b/target/linux/generic/backport-4.9/024-5-tcp-tsq-add-a-shortcut-in-tcp_small_queue_check.patch @@ -19,7 +19,7 @@ Signed-off-by: David S. Miller --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c -@@ -2087,6 +2087,15 @@ static bool tcp_small_queue_check(struct +@@ -2088,6 +2088,15 @@ static bool tcp_small_queue_check(struct limit <<= factor; if (atomic_read(&sk->sk_wmem_alloc) > limit) { diff --git a/target/linux/generic/backport-4.9/024-8-tcp-tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch b/target/linux/generic/backport-4.9/024-8-tcp-tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch index 6604a20fca..0acd00817e 100644 --- a/target/linux/generic/backport-4.9/024-8-tcp-tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch +++ b/target/linux/generic/backport-4.9/024-8-tcp-tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch @@ -114,7 +114,7 @@ Signed-off-by: David S. Miller if (nval != oval) continue; -@@ -2096,7 +2096,7 @@ static bool tcp_small_queue_check(struct +@@ -2097,7 +2097,7 @@ static bool tcp_small_queue_check(struct skb->prev == sk->sk_write_queue.next) return false; @@ -123,7 +123,7 @@ Signed-off-by: David S. Miller /* It is possible TX completion already happened * before we set TSQ_THROTTLED, so we must * test again the condition. -@@ -2194,8 +2194,8 @@ static bool tcp_write_xmit(struct sock * +@@ -2195,8 +2195,8 @@ static bool tcp_write_xmit(struct sock * unlikely(tso_fragment(sk, skb, limit, mss_now, gfp))) break; @@ -134,7 +134,7 @@ Signed-off-by: David S. Miller if (tcp_small_queue_check(sk, skb, 0)) break; -@@ -3508,8 +3508,6 @@ void tcp_send_ack(struct sock *sk) +@@ -3504,8 +3504,6 @@ void tcp_send_ack(struct sock *sk) /* We do not want pure acks influencing TCP Small Queues or fq/pacing * too much. * SKB_TRUESIZE(max(1 .. 66, MAX_TCP_HEADER)) is unfortunately ~784 diff --git a/target/linux/generic/backport-4.9/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch b/target/linux/generic/backport-4.9/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch new file mode 100644 index 0000000000..d92ce07478 --- /dev/null +++ b/target/linux/generic/backport-4.9/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch @@ -0,0 +1,85 @@ +From: Eric Dumazet +Date: Sat, 11 Nov 2017 15:54:12 -0800 +Subject: [PATCH] tcp: allow drivers to tweak TSQ logic +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +I had many reports that TSQ logic breaks wifi aggregation. + +Current logic is to allow up to 1 ms of bytes to be queued into qdisc +and drivers queues. + +But Wifi aggregation needs a bigger budget to allow bigger rates to +be discovered by various TCP Congestion Controls algorithms. + +This patch adds an extra socket field, allowing wifi drivers to select +another log scale to derive TCP Small Queue credit from current pacing +rate. + +Initial value is 10, meaning that this patch does not change current +behavior. + +We expect wifi drivers to set this field to smaller values (tests have +been done with values from 6 to 9) + +They would have to use following template : + +if (skb->sk && skb->sk->sk_pacing_shift != MY_PACING_SHIFT) + skb->sk->sk_pacing_shift = MY_PACING_SHIFT; + +Ref: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1670041 +Signed-off-by: Eric Dumazet +Cc: Johannes Berg +Cc: Toke Høiland-Jørgensen +Cc: Kir Kolyshkin +--- +--- a/include/net/sock.h ++++ b/include/net/sock.h +@@ -260,6 +260,7 @@ struct sock_common { + * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4) + * @sk_gso_max_size: Maximum GSO segment size to build + * @sk_gso_max_segs: Maximum number of GSO segments ++ * @sk_pacing_shift: scaling factor for TCP Small Queues + * @sk_lingertime: %SO_LINGER l_linger setting + * @sk_backlog: always used with the per-socket spinlock held + * @sk_callback_lock: used with the callbacks in the end of this struct +@@ -421,6 +422,8 @@ struct sock { + kmemcheck_bitfield_end(flags); + + u16 sk_gso_max_segs; ++#define sk_pacing_shift sk_pacing_shift /* for backport checks */ ++ u8 sk_pacing_shift; + unsigned long sk_lingertime; + struct proto *sk_prot_creator; + rwlock_t sk_callback_lock; +--- a/net/core/sock.c ++++ b/net/core/sock.c +@@ -2475,6 +2475,7 @@ void sock_init_data(struct socket *sock, + + sk->sk_max_pacing_rate = ~0U; + sk->sk_pacing_rate = ~0U; ++ sk->sk_pacing_shift = 10; + sk->sk_incoming_cpu = -1; + /* + * Before updating sk_refcnt, we must commit prior changes to memory +--- a/net/ipv4/tcp_output.c ++++ b/net/ipv4/tcp_output.c +@@ -1581,7 +1581,7 @@ u32 tcp_tso_autosize(const struct sock * + { + u32 bytes, segs; + +- bytes = min(sk->sk_pacing_rate >> 10, ++ bytes = min(sk->sk_pacing_rate >> sk->sk_pacing_shift, + sk->sk_gso_max_size - 1 - MAX_TCP_HEADER); + + /* Goal is to send at least one packet per ms, +@@ -2084,7 +2084,7 @@ static bool tcp_small_queue_check(struct + { + unsigned int limit; + +- limit = max(2 * skb->truesize, sk->sk_pacing_rate >> 10); ++ limit = max(2 * skb->truesize, sk->sk_pacing_rate >> sk->sk_pacing_shift); + limit = min_t(u32, limit, sysctl_tcp_limit_output_bytes); + limit <<= factor; + diff --git a/target/linux/generic/backport-4.9/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch b/target/linux/generic/backport-4.9/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch new file mode 100644 index 0000000000..eaef5ca0e5 --- /dev/null +++ b/target/linux/generic/backport-4.9/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch @@ -0,0 +1,25 @@ +From 4b05f09db650d215632da97f2c25ceba8235102a Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Sun, 26 Nov 2017 00:09:45 +0100 +Subject: [PATCH] crypto: fix typo in KPP dependency of CRYPTO_ECDH + +This fixes a typo in the CRYPTO_KPP dependency of CRYPTO_ECDH. + +Fixes: 3c4b23901a0c ("crypto: ecdh - Add ECDH software support") +Cc: # v4.8+ +Signed-off-by: Hauke Mehrtens +--- + crypto/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/crypto/Kconfig ++++ b/crypto/Kconfig +@@ -120,7 +120,7 @@ config CRYPTO_DH + + config CRYPTO_ECDH + tristate "ECDH algorithm" +- select CRYTPO_KPP ++ select CRYPTO_KPP + help + Generic implementation of the ECDH algorithm + diff --git a/target/linux/generic/backport-4.9/066-v4.16-0001-mtd-partitions-add-of_match_table-parser-matching.patch b/target/linux/generic/backport-4.9/066-v4.16-0001-mtd-partitions-add-of_match_table-parser-matching.patch new file mode 100644 index 0000000000..06931ce2a4 --- /dev/null +++ b/target/linux/generic/backport-4.9/066-v4.16-0001-mtd-partitions-add-of_match_table-parser-matching.patch @@ -0,0 +1,121 @@ +From bb2192123ec70470d6ea33f138846b175403a968 Mon Sep 17 00:00:00 2001 +From: Brian Norris +Date: Thu, 4 Jan 2018 08:05:33 +0100 +Subject: [PATCH] mtd: partitions: add of_match_table parser matching +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Partition parsers can now provide an of_match_table to enable +flash<-->parser matching via device tree as documented in the +mtd/partition.txt. + +It works by looking for a matching parser for every string in the +"compatibility" property (starting with the most specific one). + +This support is currently limited to built-in parsers as it uses +request_module() and friends. This should be sufficient for most cases +though as compiling parsers as modules isn't a common choice. + +Signed-off-by: Brian Norris +Signed-off-by: Rafał Miłecki +Signed-off-by: Boris Brezillon +--- + drivers/mtd/mtdpart.c | 59 ++++++++++++++++++++++++++++++++++++++++++ + include/linux/mtd/partitions.h | 1 + + 2 files changed, 60 insertions(+) + +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + + #include "mtdcore.h" + +@@ -886,6 +887,45 @@ static int mtd_part_do_parse(struct mtd_ + } + + /** ++ * mtd_part_get_compatible_parser - find MTD parser by a compatible string ++ * ++ * @compat: compatible string describing partitions in a device tree ++ * ++ * MTD parsers can specify supported partitions by providing a table of ++ * compatibility strings. This function finds a parser that advertises support ++ * for a passed value of "compatible". ++ */ ++static struct mtd_part_parser *mtd_part_get_compatible_parser(const char *compat) ++{ ++ struct mtd_part_parser *p, *ret = NULL; ++ ++ spin_lock(&part_parser_lock); ++ ++ list_for_each_entry(p, &part_parsers, list) { ++ const struct of_device_id *matches; ++ ++ matches = p->of_match_table; ++ if (!matches) ++ continue; ++ ++ for (; matches->compatible[0]; matches++) { ++ if (!strcmp(matches->compatible, compat) && ++ try_module_get(p->owner)) { ++ ret = p; ++ break; ++ } ++ } ++ ++ if (ret) ++ break; ++ } ++ ++ spin_unlock(&part_parser_lock); ++ ++ return ret; ++} ++ ++/** + * parse_mtd_partitions - parse MTD partitions + * @master: the master partition (describes whole MTD device) + * @types: names of partition parsers to try or %NULL +@@ -911,8 +951,27 @@ int parse_mtd_partitions(struct mtd_info + struct mtd_part_parser_data *data) + { + struct mtd_part_parser *parser; ++ struct device_node *np; ++ struct property *prop; ++ const char *compat; + int ret, err = 0; + ++ np = of_get_child_by_name(mtd_get_of_node(master), "partitions"); ++ of_property_for_each_string(np, "compatible", prop, compat) { ++ parser = mtd_part_get_compatible_parser(compat); ++ if (!parser) ++ continue; ++ ret = mtd_part_do_parse(parser, master, pparts, data); ++ if (ret > 0) { ++ of_node_put(np); ++ return 0; ++ } ++ mtd_part_parser_put(parser); ++ if (ret < 0 && !err) ++ err = ret; ++ } ++ of_node_put(np); ++ + if (!types) + types = default_mtd_part_types; + +--- a/include/linux/mtd/partitions.h ++++ b/include/linux/mtd/partitions.h +@@ -77,6 +77,7 @@ struct mtd_part_parser { + struct list_head list; + struct module *owner; + const char *name; ++ const struct of_device_id *of_match_table; + int (*parse_fn)(struct mtd_info *, const struct mtd_partition **, + struct mtd_part_parser_data *); + void (*cleanup)(const struct mtd_partition *pparts, int nr_parts); diff --git a/target/linux/generic/backport-4.9/066-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch b/target/linux/generic/backport-4.9/066-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch new file mode 100644 index 0000000000..2092cc28fd --- /dev/null +++ b/target/linux/generic/backport-4.9/066-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch @@ -0,0 +1,43 @@ +From 4ac9222778478a00c7fc9d347b7ed1e0e595120d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 4 Jan 2018 08:05:34 +0100 +Subject: [PATCH] mtd: ofpart: add of_match_table with "fixed-partitions" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This allows using this parser with any flash driver that takes care of +setting of_node (using mtd_set_of_node helper) correctly. Up to now +support for "fixed-partitions" DT compatibility string was working only +with flash drivers that were specifying "ofpart" (manually or by letting +mtd use the default set of parsers). + +This matches existing bindings documentation. + +Signed-off-by: Rafał Miłecki +Reviewed-by: Brian Norris +Tested-by: Brian Norris +Signed-off-by: Boris Brezillon +--- + drivers/mtd/ofpart.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/mtd/ofpart.c ++++ b/drivers/mtd/ofpart.c +@@ -140,9 +140,16 @@ ofpart_none: + return ret; + } + ++static const struct of_device_id parse_ofpart_match_table[] = { ++ { .compatible = "fixed-partitions" }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, parse_ofpart_match_table); ++ + static struct mtd_part_parser ofpart_parser = { + .parse_fn = parse_ofpart_partitions, + .name = "ofpart", ++ .of_match_table = parse_ofpart_match_table, + }; + + static int parse_ofoldpart_partitions(struct mtd_info *master, diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch index d7b7b48979..aaa7435196 100644 --- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch +++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch @@ -399,7 +399,7 @@ Signed-off-by: David S. Miller /* bnx2x_has_rx_work() reads the status block, --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c -@@ -1768,7 +1768,7 @@ static int bnxt_poll_nitroa0(struct napi +@@ -1774,7 +1774,7 @@ static int bnxt_poll_nitroa0(struct napi } if (!bnxt_has_work(bp, cpr) && rx_pkts < budget) { @@ -582,7 +582,7 @@ Signed-off-by: David S. Miller dnet_writel(bp, int_enable, INTR_ENB); --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c -@@ -3346,7 +3346,7 @@ int be_poll(struct napi_struct *napi, in +@@ -3344,7 +3344,7 @@ int be_poll(struct napi_struct *napi, in be_process_mcc(adapter); if (max_work < budget) { @@ -615,7 +615,7 @@ Signed-off-by: David S. Miller buf_int_enable_value |= NPS_ENET_ENABLE << RX_RDY_SHIFT; --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c -@@ -1615,7 +1615,7 @@ static int fec_enet_rx_napi(struct napi_ +@@ -1623,7 +1623,7 @@ static int fec_enet_rx_napi(struct napi_ fec_enet_tx(ndev); if (pkts < budget) { @@ -712,7 +712,7 @@ Signed-off-by: David S. Miller * then check once more to make sure we are done. --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c -@@ -999,7 +999,7 @@ restart_poll: +@@ -1009,7 +1009,7 @@ restart_poll: if (frames_processed < budget) { enable_scrq_irq(adapter, adapter->rx_scrq[scrq_num]); @@ -803,7 +803,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -2696,11 +2696,9 @@ static int mvneta_poll(struct napi_struc +@@ -2701,11 +2701,9 @@ static int mvneta_poll(struct napi_struc rx_done = mvneta_rx_swbm(pp, budget, &pp->rxqs[rx_queue]); } @@ -841,7 +841,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/moxa/moxart_ether.c +++ b/drivers/net/ethernet/moxa/moxart_ether.c -@@ -269,7 +269,7 @@ rx_next: +@@ -270,7 +270,7 @@ rx_next: } if (rx < budget) { @@ -1095,7 +1095,7 @@ Signed-off-by: David S. Miller dma_intr_ena = smsc9420_reg_read(pd, DMAC_INTR_ENA); --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -@@ -2677,7 +2677,7 @@ static int stmmac_poll(struct napi_struc +@@ -2678,7 +2678,7 @@ static int stmmac_poll(struct napi_struc work_done = stmmac_rx(priv, budget); if (work_done < budget) { @@ -1346,7 +1346,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c -@@ -2800,7 +2800,7 @@ static int ath10k_pci_napi_poll(struct n +@@ -2804,7 +2804,7 @@ static int ath10k_pci_napi_poll(struct n done = ath10k_htt_txrx_compl_task(ar, budget); if (done < budget) { diff --git a/target/linux/generic/config-3.18 b/target/linux/generic/config-3.18 index 1e3f0b5abe..7df43be975 100644 --- a/target/linux/generic/config-3.18 +++ b/target/linux/generic/config-3.18 @@ -90,7 +90,7 @@ CONFIG_32BIT=y # CONFIG_ADM6996_PHY is not set # CONFIG_ADM8211 is not set # CONFIG_ADT7316 is not set -# CONFIG_ADVISE_SYSCALLS is not set +CONFIG_ADVISE_SYSCALLS=y # CONFIG_ADXRS450 is not set CONFIG_AEABI=y # CONFIG_AFFS_FS is not set @@ -1630,7 +1630,7 @@ CONFIG_IPW2200_MONITOR=y CONFIG_IP_ADVANCED_ROUTER=y # CONFIG_IP_DCCP is not set # CONFIG_IP_FIB_TRIE_STATS is not set -CONFIG_IP_MROUTE=y +# CONFIG_IP_MROUTE is not set CONFIG_IP_MROUTE_MULTIPLE_TABLES=y CONFIG_IP_MULTICAST=y CONFIG_IP_MULTIPLE_TABLES=y diff --git a/target/linux/generic/config-4.14 b/target/linux/generic/config-4.14 new file mode 100644 index 0000000000..fa389bf8c0 --- /dev/null +++ b/target/linux/generic/config-4.14 @@ -0,0 +1,5614 @@ +CONFIG_32BIT=y +# CONFIG_6LOWPAN is not set +# CONFIG_6LOWPAN_DEBUGFS is not set +# CONFIG_6PACK is not set +# CONFIG_8139CP is not set +# CONFIG_8139TOO is not set +# CONFIG_9P_FS is not set +# CONFIG_AB3100_CORE is not set +# CONFIG_AB8500_CORE is not set +# CONFIG_ABP060MG is not set +# CONFIG_ABX500_CORE is not set +# CONFIG_ACCESSIBILITY is not set +# CONFIG_ACENIC is not set +# CONFIG_ACERHDF is not set +# CONFIG_ACORN_PARTITION is not set +# CONFIG_ACPI_ALS is not set +# CONFIG_ACPI_APEI is not set +# CONFIG_ACPI_BUTTON is not set +# CONFIG_ACPI_CONFIGFS is not set +# CONFIG_ACPI_CUSTOM_METHOD is not set +# CONFIG_ACPI_EXTLOG is not set +# CONFIG_ACPI_HED is not set +# CONFIG_ACPI_NFIT is not set +# CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set +# CONFIG_ACPI_TABLE_UPGRADE is not set +# CONFIG_ACPI_VIDEO is not set +# CONFIG_AD2S1200 is not set +# CONFIG_AD2S1210 is not set +# CONFIG_AD2S90 is not set +# CONFIG_AD5064 is not set +# CONFIG_AD525X_DPOT is not set +# CONFIG_AD5360 is not set +# CONFIG_AD5380 is not set +# CONFIG_AD5421 is not set +# CONFIG_AD5446 is not set +# CONFIG_AD5449 is not set +# CONFIG_AD5504 is not set +# CONFIG_AD5592R is not set +# CONFIG_AD5593R is not set +# CONFIG_AD5624R_SPI is not set +# CONFIG_AD5686 is not set +# CONFIG_AD5755 is not set +# CONFIG_AD5761 is not set +# CONFIG_AD5764 is not set +# CONFIG_AD5791 is not set +# CONFIG_AD5933 is not set +# CONFIG_AD7150 is not set +# CONFIG_AD7152 is not set +# CONFIG_AD7192 is not set +# CONFIG_AD7266 is not set +# CONFIG_AD7280 is not set +# CONFIG_AD7291 is not set +# CONFIG_AD7298 is not set +# CONFIG_AD7303 is not set +# CONFIG_AD7476 is not set +# CONFIG_AD7606 is not set +# CONFIG_AD7746 is not set +# CONFIG_AD7766 is not set +# CONFIG_AD7780 is not set +# CONFIG_AD7791 is not set +# CONFIG_AD7793 is not set +# CONFIG_AD7816 is not set +# CONFIG_AD7887 is not set +# CONFIG_AD7923 is not set +# CONFIG_AD799X is not set +# CONFIG_AD8366 is not set +# CONFIG_AD8801 is not set +# CONFIG_AD9523 is not set +# CONFIG_AD9832 is not set +# CONFIG_AD9834 is not set +# CONFIG_ADAPTEC_STARFIRE is not set +# CONFIG_ADE7753 is not set +# CONFIG_ADE7754 is not set +# CONFIG_ADE7758 is not set +# CONFIG_ADE7759 is not set +# CONFIG_ADE7854 is not set +# CONFIG_ADF4350 is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADIS16060 is not set +# CONFIG_ADIS16080 is not set +# CONFIG_ADIS16130 is not set +# CONFIG_ADIS16136 is not set +# CONFIG_ADIS16201 is not set +# CONFIG_ADIS16203 is not set +# CONFIG_ADIS16204 is not set +# CONFIG_ADIS16209 is not set +# CONFIG_ADIS16220 is not set +# CONFIG_ADIS16240 is not set +# CONFIG_ADIS16260 is not set +# CONFIG_ADIS16400 is not set +# CONFIG_ADIS16480 is not set +# CONFIG_ADJD_S311 is not set +# CONFIG_ADM6996_PHY is not set +# CONFIG_ADM8211 is not set +# CONFIG_ADT7316 is not set +CONFIG_ADVISE_SYSCALLS=y +# CONFIG_ADXL345_I2C is not set +# CONFIG_ADXL345_SPI is not set +# CONFIG_ADXRS450 is not set +CONFIG_AEABI=y +# CONFIG_AFE4403 is not set +# CONFIG_AFE4404 is not set +# CONFIG_AFFS_FS is not set +# CONFIG_AFS_FS is not set +# CONFIG_AF_KCM is not set +# CONFIG_AF_RXRPC is not set +# CONFIG_AF_RXRPC_INJECT_LOSS is not set +# CONFIG_AF_RXRPC_IPV6 is not set +# CONFIG_AGP is not set +# CONFIG_AHCI_CEVA is not set +# CONFIG_AHCI_IMX is not set +# CONFIG_AHCI_MVEBU is not set +# CONFIG_AHCI_QORIQ is not set +CONFIG_AIO=y +# CONFIG_AIRO is not set +# CONFIG_AIRO_CS is not set +# CONFIG_AIX_PARTITION is not set +# CONFIG_AK09911 is not set +# CONFIG_AK8974 is not set +# CONFIG_AK8975 is not set +# CONFIG_AL3320A is not set +# CONFIG_ALIM7101_WDT is not set +CONFIG_ALLOW_DEV_COREDUMP=y +# CONFIG_ALTERA_MBOX is not set +# CONFIG_ALTERA_MSGDMA is not set +# CONFIG_ALTERA_STAPL is not set +# CONFIG_ALTERA_TSE is not set +# CONFIG_ALX is not set +# CONFIG_AM2315 is not set +# CONFIG_AM335X_PHY_USB is not set +# CONFIG_AMBA_PL08X is not set +# CONFIG_AMD8111_ETH is not set +# CONFIG_AMD_MEM_ENCRYPT is not set +# CONFIG_AMD_PHY is not set +# CONFIG_AMD_XGBE is not set +# CONFIG_AMD_XGBE_HAVE_ECC is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_AMILO_RFKILL is not set +# CONFIG_ANDROID is not set +CONFIG_ANON_INODES=y +# CONFIG_APDS9300 is not set +# CONFIG_APDS9802ALS is not set +# CONFIG_APDS9960 is not set +# CONFIG_APM8018X is not set +# CONFIG_APM_EMULATION is not set +# CONFIG_APPLE_GMUX is not set +# CONFIG_APPLE_PROPERTIES is not set +# CONFIG_APPLICOM is not set +# CONFIG_AQTION is not set +# CONFIG_AQUANTIA_PHY is not set +# CONFIG_AR5523 is not set +# CONFIG_AR7 is not set +# CONFIG_AR8216_PHY is not set +# CONFIG_AR8216_PHY_LEDS is not set +# CONFIG_ARCH_ACTIONS is not set +# CONFIG_ARCH_ALPINE is not set +# CONFIG_ARCH_ARTPEC is not set +# CONFIG_ARCH_ASPEED is not set +# CONFIG_ARCH_AT91 is not set +# CONFIG_ARCH_BCM is not set +# CONFIG_ARCH_BCM2835 is not set +# CONFIG_ARCH_BCM_21664 is not set +# CONFIG_ARCH_BCM_23550 is not set +# CONFIG_ARCH_BCM_281XX is not set +# CONFIG_ARCH_BCM_5301X is not set +# CONFIG_ARCH_BCM_53573 is not set +# CONFIG_ARCH_BCM_63XX is not set +# CONFIG_ARCH_BCM_CYGNUS is not set +# CONFIG_ARCH_BCM_IPROC is not set +# CONFIG_ARCH_BCM_NSP is not set +# CONFIG_ARCH_BERLIN is not set +# CONFIG_ARCH_BRCMSTB is not set +# CONFIG_ARCH_CLPS711X is not set +# CONFIG_ARCH_CNS3XXX is not set +# CONFIG_ARCH_DAVINCI is not set +# CONFIG_ARCH_DIGICOLOR is not set +# CONFIG_ARCH_DMA_ADDR_T_64BIT is not set +# CONFIG_ARCH_DOVE is not set +# CONFIG_ARCH_EBSA110 is not set +# CONFIG_ARCH_EP93XX is not set +# CONFIG_ARCH_EXYNOS is not set +CONFIG_ARCH_FLATMEM_ENABLE=y +# CONFIG_ARCH_FOOTBRIDGE is not set +# CONFIG_ARCH_GEMINI is not set +CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y +# CONFIG_ARCH_HI3xxx is not set +# CONFIG_ARCH_HIGHBANK is not set +# CONFIG_ARCH_HISI is not set +# CONFIG_ARCH_INTEGRATOR is not set +# CONFIG_ARCH_IOP13XX is not set +# CONFIG_ARCH_IOP32X is not set +# CONFIG_ARCH_IOP33X is not set +# CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_KEYSTONE is not set +# CONFIG_ARCH_KS8695 is not set +# CONFIG_ARCH_LAYERSCAPE is not set +# CONFIG_ARCH_LG1K is not set +# CONFIG_ARCH_LPC32XX is not set +# CONFIG_ARCH_MEDIATEK is not set +# CONFIG_ARCH_MESON is not set +CONFIG_ARCH_MMAP_RND_BITS=8 +CONFIG_ARCH_MMAP_RND_BITS_MAX=16 +CONFIG_ARCH_MMAP_RND_BITS_MIN=8 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 +# CONFIG_ARCH_MMP is not set +# CONFIG_ARCH_MULTIPLATFORM is not set +# CONFIG_ARCH_MULTI_V6 is not set +# CONFIG_ARCH_MULTI_V7 is not set +# CONFIG_ARCH_MV78XX0 is not set +# CONFIG_ARCH_MVEBU is not set +# CONFIG_ARCH_MXC is not set +# CONFIG_ARCH_MXS is not set +# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set +# CONFIG_ARCH_NETX is not set +# CONFIG_ARCH_NOMADIK is not set +# CONFIG_ARCH_NSPIRE is not set +# CONFIG_ARCH_OMAP is not set +# CONFIG_ARCH_OMAP1 is not set +# CONFIG_ARCH_OMAP2 is not set +# CONFIG_ARCH_OMAP2PLUS is not set +# CONFIG_ARCH_OMAP3 is not set +# CONFIG_ARCH_OMAP4 is not set +# CONFIG_ARCH_ORION5X is not set +# CONFIG_ARCH_OXNAS is not set +# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set +# CONFIG_ARCH_PICOXCELL is not set +# CONFIG_ARCH_PRIMA2 is not set +# CONFIG_ARCH_PXA is not set +# CONFIG_ARCH_QCOM is not set +# CONFIG_ARCH_REALTEK is not set +# CONFIG_ARCH_REALVIEW is not set +# CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_ROCKCHIP is not set +# CONFIG_ARCH_RPC is not set +# CONFIG_ARCH_S3C24XX is not set +# CONFIG_ARCH_S3C64XX is not set +# CONFIG_ARCH_S5PV210 is not set +# CONFIG_ARCH_SA1100 is not set +# CONFIG_ARCH_SEATTLE is not set +# CONFIG_ARCH_SHMOBILE is not set +# CONFIG_ARCH_SHMOBILE_MULTI is not set +# CONFIG_ARCH_SIRF is not set +# CONFIG_ARCH_SOCFPGA is not set +# CONFIG_ARCH_SPRD is not set +# CONFIG_ARCH_STI is not set +# CONFIG_ARCH_STRATIX10 is not set +# CONFIG_ARCH_SUNXI is not set +# CONFIG_ARCH_TANGO is not set +# CONFIG_ARCH_TEGRA is not set +# CONFIG_ARCH_THUNDER is not set +# CONFIG_ARCH_THUNDER2 is not set +# CONFIG_ARCH_U300 is not set +# CONFIG_ARCH_U8500 is not set +# CONFIG_ARCH_UNIPHIER is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_VEXPRESS is not set +# CONFIG_ARCH_VIRT is not set +# CONFIG_ARCH_VT8500 is not set +# CONFIG_ARCH_VULCAN is not set +# CONFIG_ARCH_W90X900 is not set +# CONFIG_ARCH_WANTS_UBSAN_NO_NULL is not set +# CONFIG_ARCH_WM8505 is not set +# CONFIG_ARCH_WM8750 is not set +# CONFIG_ARCH_WM8850 is not set +# CONFIG_ARCH_XGENE is not set +# CONFIG_ARCH_ZX is not set +# CONFIG_ARCH_ZYNQ is not set +# CONFIG_ARCH_ZYNQMP is not set +# CONFIG_ARCNET is not set +# CONFIG_ARC_EMAC is not set +# CONFIG_ARM64_ERRATUM_819472 is not set +# CONFIG_ARM64_ERRATUM_824069 is not set +# CONFIG_ARM64_ERRATUM_826319 is not set +# CONFIG_ARM64_ERRATUM_827319 is not set +# CONFIG_ARM64_ERRATUM_832075 is not set +# CONFIG_ARM64_ERRATUM_834220 is not set +# CONFIG_ARM64_ERRATUM_843419 is not set +# CONFIG_ARM64_ERRATUM_845719 is not set +# CONFIG_ARM64_ERRATUM_858921 is not set +# CONFIG_ARM64_RELOC_TEST is not set +# CONFIG_ARM_APPENDED_DTB is not set +# CONFIG_ARM_ARCH_TIMER is not set +# CONFIG_ARM_BIG_LITTLE_CPUFREQ is not set +# CONFIG_ARM_CCI is not set +# CONFIG_ARM_CCI400_PMU is not set +# CONFIG_ARM_CCI5xx_PMU is not set +# CONFIG_ARM_CCN is not set +# CONFIG_ARM_CPUIDLE is not set +CONFIG_ARM_CPU_TOPOLOGY=y +# CONFIG_ARM_CRYPTO is not set +CONFIG_ARM_DMA_MEM_BUFFERABLE=y +# CONFIG_ARM_ERRATA_326103 is not set +# CONFIG_ARM_ERRATA_364296 is not set +# CONFIG_ARM_ERRATA_411920 is not set +# CONFIG_ARM_ERRATA_430973 is not set +# CONFIG_ARM_ERRATA_458693 is not set +# CONFIG_ARM_ERRATA_460075 is not set +# CONFIG_ARM_ERRATA_643719 is not set +# CONFIG_ARM_ERRATA_720789 is not set +# CONFIG_ARM_ERRATA_742230 is not set +# CONFIG_ARM_ERRATA_742231 is not set +# CONFIG_ARM_ERRATA_743622 is not set +# CONFIG_ARM_ERRATA_751472 is not set +# CONFIG_ARM_ERRATA_754322 is not set +# CONFIG_ARM_ERRATA_754327 is not set +# CONFIG_ARM_ERRATA_764369 is not set +# CONFIG_ARM_ERRATA_773022 is not set +# CONFIG_ARM_ERRATA_775420 is not set +# CONFIG_ARM_ERRATA_798181 is not set +# CONFIG_ARM_ERRATA_818325_852422 is not set +# CONFIG_ARM_ERRATA_821420 is not set +# CONFIG_ARM_ERRATA_825619 is not set +# CONFIG_ARM_ERRATA_852421 is not set +# CONFIG_ARM_ERRATA_852423 is not set +CONFIG_ARM_GIC_MAX_NR=1 +# CONFIG_ARM_KERNMEM_PERMS is not set +# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set +# CONFIG_ARM_KPROBES_TEST is not set +# CONFIG_ARM_MHU is not set +# CONFIG_ARM_MODULE_PLTS is not set +# CONFIG_ARM_PATCH_PHYS_VIRT is not set +# CONFIG_ARM_PSCI is not set +# CONFIG_ARM_PSCI_CHECKER is not set +# CONFIG_ARM_PTDUMP is not set +# CONFIG_ARM_SBSA_WATCHDOG is not set +# CONFIG_ARM_SCPI_PROTOCOL is not set +# CONFIG_ARM_TIMER_SP804 is not set +# CONFIG_ARM_UNWIND is not set +# CONFIG_ARM_VIRT_EXT is not set +# CONFIG_AS3935 is not set +# CONFIG_ASM9260_TIMER is not set +# CONFIG_ASUS_LAPTOP is not set +# CONFIG_ASUS_WIRELESS is not set +# CONFIG_ASYMMETRIC_KEY_TYPE is not set +# CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE is not set +# CONFIG_ASYNC_RAID6_TEST is not set +# CONFIG_ASYNC_TX_DMA is not set +# CONFIG_AT76C50X_USB is not set +# CONFIG_AT803X_PHY is not set +# CONFIG_AT91_SAMA5D2_ADC is not set +# CONFIG_ATA is not set +# CONFIG_ATAGS is not set +CONFIG_ATAGS_PROC=y +# CONFIG_ATALK is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_ATA_ACPI is not set +CONFIG_ATA_BMDMA=y +# CONFIG_ATA_GENERIC is not set +# CONFIG_ATA_NONSTANDARD is not set +# CONFIG_ATA_OVER_ETH is not set +# CONFIG_ATA_PIIX is not set +CONFIG_ATA_SFF=y +# CONFIG_ATA_VERBOSE_ERROR is not set +# CONFIG_ATH10K is not set +# CONFIG_ATH25 is not set +# CONFIG_ATH5K is not set +# CONFIG_ATH6KL is not set +# CONFIG_ATH79 is not set +# CONFIG_ATH9K is not set +# CONFIG_ATH9K_HTC is not set +# CONFIG_ATH_DEBUG is not set +# CONFIG_ATL1 is not set +# CONFIG_ATL1C is not set +# CONFIG_ATL1E is not set +# CONFIG_ATL2 is not set +# CONFIG_ATLAS_PH_SENSOR is not set +# CONFIG_ATM is not set +# CONFIG_ATMEL is not set +# CONFIG_ATMEL_PIT is not set +# CONFIG_ATMEL_SSC is not set +# CONFIG_ATM_AMBASSADOR is not set +# CONFIG_ATM_BR2684 is not set +CONFIG_ATM_BR2684_IPFILTER=y +# CONFIG_ATM_CLIP is not set +CONFIG_ATM_CLIP_NO_ICMP=y +# CONFIG_ATM_DRIVERS is not set +# CONFIG_ATM_DUMMY is not set +# CONFIG_ATM_ENI is not set +# CONFIG_ATM_FIRESTREAM is not set +# CONFIG_ATM_FORE200E is not set +# CONFIG_ATM_HE is not set +# CONFIG_ATM_HORIZON is not set +# CONFIG_ATM_IA is not set +# CONFIG_ATM_IDT77252 is not set +# CONFIG_ATM_LANAI is not set +# CONFIG_ATM_LANE is not set +# CONFIG_ATM_MPOA is not set +# CONFIG_ATM_NICSTAR is not set +# CONFIG_ATM_SOLOS is not set +# CONFIG_ATM_TCP is not set +# CONFIG_ATM_ZATM is not set +# CONFIG_ATOMIC64_SELFTEST is not set +# CONFIG_ATP is not set +# CONFIG_AUDIT is not set +# CONFIG_AUDIT_ARCH_COMPAT_GENERIC is not set +# CONFIG_AURORA_NB8800 is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_AUTO_ZRELADDR is not set +# CONFIG_AUXDISPLAY is not set +# CONFIG_AX25 is not set +# CONFIG_AX25_DAMA_SLAVE is not set +# CONFIG_AX88796 is not set +# CONFIG_AXP20X_ADC is not set +# CONFIG_AXP20X_POWER is not set +# CONFIG_AXP288_ADC is not set +# CONFIG_AXP288_FUEL_GAUGE is not set +# CONFIG_B43 is not set +# CONFIG_B43LEGACY is not set +# CONFIG_B44 is not set +# CONFIG_B53 is not set +# CONFIG_BACKLIGHT_ADP8860 is not set +# CONFIG_BACKLIGHT_ADP8870 is not set +# CONFIG_BACKLIGHT_APPLE is not set +# CONFIG_BACKLIGHT_ARCXCNN is not set +# CONFIG_BACKLIGHT_BD6107 is not set +# CONFIG_BACKLIGHT_GENERIC is not set +# CONFIG_BACKLIGHT_GPIO is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set +# CONFIG_BACKLIGHT_LM3630A is not set +# CONFIG_BACKLIGHT_LM3639 is not set +# CONFIG_BACKLIGHT_LP855X is not set +# CONFIG_BACKLIGHT_LV5207LP is not set +# CONFIG_BACKLIGHT_PANDORA is not set +# CONFIG_BACKLIGHT_PM8941_WLED is not set +# CONFIG_BACKLIGHT_RPI is not set +# CONFIG_BACKLIGHT_SAHARA is not set +# CONFIG_BACKTRACE_SELF_TEST is not set +CONFIG_BASE_FULL=y +CONFIG_BASE_SMALL=0 +# CONFIG_BATMAN_ADV is not set +# CONFIG_BATTERY_BQ27XXX is not set +# CONFIG_BATTERY_DS2760 is not set +# CONFIG_BATTERY_DS2780 is not set +# CONFIG_BATTERY_DS2781 is not set +# CONFIG_BATTERY_DS2782 is not set +# CONFIG_BATTERY_GAUGE_LTC2941 is not set +# CONFIG_BATTERY_GOLDFISH is not set +# CONFIG_BATTERY_LEGO_EV3 is not set +# CONFIG_BATTERY_MAX17040 is not set +# CONFIG_BATTERY_MAX17042 is not set +# CONFIG_BATTERY_MAX1721X is not set +# CONFIG_BATTERY_SBS is not set +# CONFIG_BAYCOM_EPP is not set +# CONFIG_BAYCOM_PAR is not set +# CONFIG_BAYCOM_SER_FDX is not set +# CONFIG_BAYCOM_SER_HDX is not set +# CONFIG_BCACHE is not set +# CONFIG_BCM47XX is not set +# CONFIG_BCM63XX is not set +# CONFIG_BCM63XX_PHY is not set +# CONFIG_BCM7038_WDT is not set +# CONFIG_BCM7XXX_PHY is not set +# CONFIG_BCM87XX_PHY is not set +# CONFIG_BCMA is not set +# CONFIG_BCMA_DRIVER_GPIO is not set +CONFIG_BCMA_POSSIBLE=y +# CONFIG_BCMGENET is not set +# CONFIG_BCM_IPROC_ADC is not set +# CONFIG_BCM_KONA_USB2_PHY is not set +# CONFIG_BDI_SWITCH is not set +# CONFIG_BE2ISCSI is not set +# CONFIG_BE2NET is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_BGMAC is not set +# CONFIG_BH1750 is not set +# CONFIG_BH1780 is not set +# CONFIG_BIG_KEYS is not set +# CONFIG_BIG_LITTLE is not set +# CONFIG_BINARY_PRINTF is not set +# CONFIG_BINFMT_AOUT is not set +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_FLAT is not set +# CONFIG_BINFMT_MISC is not set +CONFIG_BINFMT_SCRIPT=y +CONFIG_BITREVERSE=y +# CONFIG_BLK_CMDLINE_PARSER is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_DEBUG_FS is not set +CONFIG_BLK_DEV=y +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_BLK_DEV_4DRIVES is not set +# CONFIG_BLK_DEV_AEC62XX is not set +# CONFIG_BLK_DEV_ALI14XX is not set +# CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_BLK_DEV_AMD74XX is not set +# CONFIG_BLK_DEV_ATIIXP is not set +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_BSGLIB is not set +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD64X is not set +# CONFIG_BLK_DEV_COW_COMMON is not set +# CONFIG_BLK_DEV_CRYPTOLOOP is not set +# CONFIG_BLK_DEV_CS5520 is not set +# CONFIG_BLK_DEV_CS5530 is not set +# CONFIG_BLK_DEV_CS5535 is not set +# CONFIG_BLK_DEV_CS5536 is not set +# CONFIG_BLK_DEV_CY82C693 is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_DELKIN is not set +# CONFIG_BLK_DEV_DRBD is not set +# CONFIG_BLK_DEV_DTC2278 is not set +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_GENERIC is not set +# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_HT6560B is not set +# CONFIG_BLK_DEV_IDEACPI is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_BLK_DEV_IDEPNP is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDE_AU1XXX is not set +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_INITRD=y +# CONFIG_BLK_DEV_INTEGRITY is not set +# CONFIG_BLK_DEV_IO_TRACE is not set +# CONFIG_BLK_DEV_IT8172 is not set +# CONFIG_BLK_DEV_IT8213 is not set +# CONFIG_BLK_DEV_IT821X is not set +# CONFIG_BLK_DEV_JMICRON is not set +# CONFIG_BLK_DEV_LOOP is not set +CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_NS87415 is not set +# CONFIG_BLK_DEV_NULL_BLK is not set +# CONFIG_BLK_DEV_NVME is not set +# CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_BLK_DEV_OPTI621 is not set +# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +# CONFIG_BLK_DEV_PDC202XX_OLD is not set +# CONFIG_BLK_DEV_PIIX is not set +# CONFIG_BLK_DEV_PLATFORM is not set +# CONFIG_BLK_DEV_PMEM is not set +# CONFIG_BLK_DEV_QD65XX is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_RBD is not set +# CONFIG_BLK_DEV_RSXX is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_SC1200 is not set +# CONFIG_BLK_DEV_SD is not set +# CONFIG_BLK_DEV_SIIMAGE is not set +# CONFIG_BLK_DEV_SIS5513 is not set +# CONFIG_BLK_DEV_SKD is not set +# CONFIG_BLK_DEV_SL82C105 is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +# CONFIG_BLK_DEV_SR is not set +# CONFIG_BLK_DEV_SVWKS is not set +# CONFIG_BLK_DEV_SX8 is not set +# CONFIG_BLK_DEV_TC86C001 is not set +# CONFIG_BLK_DEV_THROTTLING is not set +# CONFIG_BLK_DEV_TRIFLEX is not set +# CONFIG_BLK_DEV_TRM290 is not set +# CONFIG_BLK_DEV_UMC8672 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_VIA82CXXX is not set +# CONFIG_BLK_DEV_ZONED is not set +# CONFIG_BLK_SED_OPAL is not set +# CONFIG_BLK_WBT is not set +CONFIG_BLOCK=y +# CONFIG_BMA180 is not set +# CONFIG_BMA220 is not set +# CONFIG_BMC150_ACCEL is not set +# CONFIG_BMC150_MAGN is not set +# CONFIG_BMC150_MAGN_I2C is not set +# CONFIG_BMC150_MAGN_SPI is not set +# CONFIG_BMG160 is not set +# CONFIG_BMI160_I2C is not set +# CONFIG_BMI160_SPI is not set +# CONFIG_BMIPS_GENERIC is not set +# CONFIG_BMP085 is not set +# CONFIG_BMP085_I2C is not set +# CONFIG_BMP085_SPI is not set +# CONFIG_BMP280 is not set +# CONFIG_BNA is not set +# CONFIG_BNX2 is not set +# CONFIG_BNX2X is not set +# CONFIG_BNXT is not set +# CONFIG_BONDING is not set +# CONFIG_BOOKE_WDT is not set +CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT=3 +# CONFIG_BOOT_PRINTK_DELAY is not set +CONFIG_BOOT_RAW=y +CONFIG_BPF=y +# CONFIG_BPF_JIT is not set +# CONFIG_BPF_STREAM_PARSER is not set +CONFIG_BPF_SYSCALL=y +# CONFIG_BPQETHER is not set +CONFIG_BQL=y +CONFIG_BRANCH_PROFILE_NONE=y +# CONFIG_BRCMFMAC is not set +# CONFIG_BRCMSMAC is not set +# CONFIG_BRCMSTB_GISB_ARB is not set +CONFIG_BRIDGE=y +# CONFIG_BRIDGE_EBT_802_3 is not set +# CONFIG_BRIDGE_EBT_AMONG is not set +# CONFIG_BRIDGE_EBT_ARP is not set +# CONFIG_BRIDGE_EBT_ARPREPLY is not set +# CONFIG_BRIDGE_EBT_BROUTE is not set +# CONFIG_BRIDGE_EBT_DNAT is not set +# CONFIG_BRIDGE_EBT_IP is not set +# CONFIG_BRIDGE_EBT_IP6 is not set +# CONFIG_BRIDGE_EBT_LIMIT is not set +# CONFIG_BRIDGE_EBT_LOG is not set +# CONFIG_BRIDGE_EBT_MARK is not set +# CONFIG_BRIDGE_EBT_MARK_T is not set +# CONFIG_BRIDGE_EBT_NFLOG is not set +# CONFIG_BRIDGE_EBT_PKTTYPE is not set +# CONFIG_BRIDGE_EBT_REDIRECT is not set +# CONFIG_BRIDGE_EBT_SNAT is not set +# CONFIG_BRIDGE_EBT_STP is not set +# CONFIG_BRIDGE_EBT_T_FILTER is not set +# CONFIG_BRIDGE_EBT_T_NAT is not set +# CONFIG_BRIDGE_EBT_VLAN is not set +CONFIG_BRIDGE_IGMP_SNOOPING=y +# CONFIG_BRIDGE_NETFILTER is not set +# CONFIG_BRIDGE_NF_EBTABLES is not set +# CONFIG_BRIDGE_VLAN_FILTERING is not set +# CONFIG_BROADCOM_PHY is not set +CONFIG_BROKEN_ON_SMP=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_BSD_PROCESS_ACCT_V3 is not set +# CONFIG_BT is not set +# CONFIG_BTRFS_ASSERT is not set +# CONFIG_BTRFS_DEBUG is not set +# CONFIG_BTRFS_FS is not set +# CONFIG_BTRFS_FS_POSIX_ACL is not set +# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set +# CONFIG_BT_ATH3K is not set +# CONFIG_BT_BNEP is not set +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +# CONFIG_BT_BREDR is not set +# CONFIG_BT_CMTP is not set +# CONFIG_BT_HCIBCM203X is not set +# CONFIG_BT_HCIBFUSB is not set +# CONFIG_BT_HCIBLUECARD is not set +# CONFIG_BT_HCIBPA10X is not set +# CONFIG_BT_HCIBT3C is not set +# CONFIG_BT_HCIBTSDIO is not set +# CONFIG_BT_HCIBTUART is not set +# CONFIG_BT_HCIBTUSB is not set +# CONFIG_BT_HCIBTUSB_RTL is not set +# CONFIG_BT_HCIDTL1 is not set +# CONFIG_BT_HCIUART is not set +# CONFIG_BT_HCIUART_3WIRE is not set +# CONFIG_BT_HCIUART_AG6XX is not set +# CONFIG_BT_HCIUART_ATH3K is not set +CONFIG_BT_HCIUART_BCSP=y +CONFIG_BT_HCIUART_H4=y +# CONFIG_BT_HCIUART_LL is not set +# CONFIG_BT_HCIUART_MRVL is not set +# CONFIG_BT_HCIUART_QCA is not set +# CONFIG_BT_HCIVHCI is not set +# CONFIG_BT_HIDP is not set +# CONFIG_BT_HS is not set +# CONFIG_BT_LE is not set +# CONFIG_BT_LEDS is not set +# CONFIG_BT_MRVL is not set +# CONFIG_BT_RFCOMM is not set +CONFIG_BT_RFCOMM_TTY=y +# CONFIG_BT_SELFTEST is not set +CONFIG_BUG=y +# CONFIG_BUG_ON_DATA_CORRUPTION is not set +CONFIG_BUILDTIME_EXTABLE_SORT=y +# CONFIG_BUILD_BIN2C is not set +# CONFIG_C2PORT is not set +CONFIG_CACHE_L2X0_PMU=y +# CONFIG_CADENCE_WATCHDOG is not set +# CONFIG_CAIF is not set +# CONFIG_CAN is not set +# CONFIG_CAN_BCM is not set +# CONFIG_CAN_DEBUG_DEVICES is not set +# CONFIG_CAN_DEV is not set +# CONFIG_CAN_GS_USB is not set +# CONFIG_CAN_GW is not set +# CONFIG_CAN_HI311X is not set +# CONFIG_CAN_IFI_CANFD is not set +# CONFIG_CAN_MCBA_USB is not set +# CONFIG_CAN_M_CAN is not set +# CONFIG_CAN_PEAK_PCIEFD is not set +# CONFIG_CAN_RAW is not set +# CONFIG_CAN_RCAR is not set +# CONFIG_CAN_RCAR_CANFD is not set +# CONFIG_CAN_SLCAN is not set +# CONFIG_CAN_SUN4I is not set +# CONFIG_CAN_VCAN is not set +# CONFIG_CAN_VXCAN is not set +# CONFIG_CAPI_AVM is not set +# CONFIG_CAPI_EICON is not set +# CONFIG_CAPI_TRACE is not set +CONFIG_CARDBUS=y +# CONFIG_CARDMAN_4000 is not set +# CONFIG_CARDMAN_4040 is not set +# CONFIG_CARL9170 is not set +# CONFIG_CASSINI is not set +# CONFIG_CAVIUM_ERRATUM_22375 is not set +# CONFIG_CAVIUM_ERRATUM_23144 is not set +# CONFIG_CAVIUM_ERRATUM_23154 is not set +# CONFIG_CAVIUM_ERRATUM_27456 is not set +# CONFIG_CAVIUM_ERRATUM_30115 is not set +# CONFIG_CAVIUM_OCTEON_SOC is not set +# CONFIG_CB710_CORE is not set +# CONFIG_CC10001_ADC is not set +# CONFIG_CCS811 is not set +# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +# CONFIG_CC_STACKPROTECTOR is not set +CONFIG_CC_STACKPROTECTOR_NONE=y +# CONFIG_CC_STACKPROTECTOR_REGULAR is not set +# CONFIG_CC_STACKPROTECTOR_STRONG is not set +# CONFIG_CDROM_PKTCDVD is not set +# CONFIG_CEPH_FS is not set +# CONFIG_CEPH_LIB is not set +# CONFIG_CFG80211 is not set +# CONFIG_CFG80211_CERTIFICATION_ONUS is not set +# CONFIG_CGROUPS is not set +# CONFIG_CGROUP_BPF is not set +# CONFIG_CGROUP_DEBUG is not set +# CONFIG_CGROUP_NET_PRIO is not set +# CONFIG_CGROUP_RDMA is not set +# CONFIG_CHARGER_BQ2415X is not set +# CONFIG_CHARGER_BQ24190 is not set +# CONFIG_CHARGER_BQ24257 is not set +# CONFIG_CHARGER_BQ24735 is not set +# CONFIG_CHARGER_BQ25890 is not set +# CONFIG_CHARGER_DETECTOR_MAX14656 is not set +# CONFIG_CHARGER_GPIO is not set +# CONFIG_CHARGER_ISP1704 is not set +# CONFIG_CHARGER_LP8727 is not set +# CONFIG_CHARGER_LTC3651 is not set +# CONFIG_CHARGER_MANAGER is not set +# CONFIG_CHARGER_MAX8903 is not set +# CONFIG_CHARGER_RT9455 is not set +# CONFIG_CHARGER_SBS is not set +# CONFIG_CHARGER_SMB347 is not set +# CONFIG_CHARGER_TWL4030 is not set +# CONFIG_CHECKPOINT_RESTORE is not set +# CONFIG_CHELSIO_T1 is not set +# CONFIG_CHELSIO_T3 is not set +# CONFIG_CHELSIO_T4 is not set +# CONFIG_CHELSIO_T4VF is not set +# CONFIG_CHROME_PLATFORMS is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_CHR_DEV_SCH is not set +# CONFIG_CHR_DEV_SG is not set +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CICADA_PHY is not set +# CONFIG_CIFS is not set +# CONFIG_CIFS_ACL is not set +# CONFIG_CIFS_DEBUG is not set +# CONFIG_CIFS_DEBUG2 is not set +# CONFIG_CIFS_FSCACHE is not set +# CONFIG_CIFS_NFSD_EXPORT is not set +CONFIG_CIFS_POSIX=y +# CONFIG_CIFS_SMB2 is not set +CONFIG_CIFS_STATS=y +# CONFIG_CIFS_STATS2 is not set +# CONFIG_CIFS_WEAK_PW_HASH is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIO_DAC is not set +# CONFIG_CLEANCACHE is not set +# CONFIG_CLKSRC_VERSATILE is not set +# CONFIG_CLK_HSDK is not set +# CONFIG_CLK_QORIQ is not set +# CONFIG_CLOCK_THERMAL is not set +CONFIG_CLS_U32_MARK=y +# CONFIG_CLS_U32_PERF is not set +# CONFIG_CM32181 is not set +# CONFIG_CM3232 is not set +# CONFIG_CM3323 is not set +# CONFIG_CM3605 is not set +# CONFIG_CM36651 is not set +# CONFIG_CMA is not set +CONFIG_CMDLINE="" +# CONFIG_CMDLINE_BOOL is not set +# CONFIG_CMDLINE_EXTEND is not set +# CONFIG_CMDLINE_FORCE is not set +# CONFIG_CMDLINE_FROM_BOOTLOADER is not set +# CONFIG_CMDLINE_PARTITION is not set +# CONFIG_CNIC is not set +# CONFIG_CODA_FS is not set +# CONFIG_CODE_PATCHING_SELFTEST is not set +# CONFIG_COMEDI is not set +# CONFIG_COMMON_CLK_CDCE706 is not set +# CONFIG_COMMON_CLK_CDCE925 is not set +# CONFIG_COMMON_CLK_CS2000_CP is not set +# CONFIG_COMMON_CLK_IPROC is not set +# CONFIG_COMMON_CLK_NXP is not set +# CONFIG_COMMON_CLK_PIC32 is not set +# CONFIG_COMMON_CLK_PWM is not set +# CONFIG_COMMON_CLK_PXA is not set +# CONFIG_COMMON_CLK_QCOM is not set +# CONFIG_COMMON_CLK_SI514 is not set +# CONFIG_COMMON_CLK_SI5351 is not set +# CONFIG_COMMON_CLK_SI570 is not set +# CONFIG_COMMON_CLK_VC5 is not set +# CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set +# CONFIG_COMPACTION is not set +# CONFIG_COMPAL_LAPTOP is not set +# CONFIG_COMPAT_BRK is not set +# CONFIG_COMPILE_TEST is not set +# CONFIG_CONFIGFS_FS is not set +# CONFIG_CONNECTOR is not set +CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7 +CONFIG_CONSTRUCTORS=y +# CONFIG_CONTEXT_SWITCH_TRACER is not set +# CONFIG_COPS is not set +# CONFIG_CORDIC is not set +# CONFIG_COREDUMP is not set +# CONFIG_CORESIGHT is not set +# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set +# CONFIG_CORTINA_PHY is not set +# CONFIG_CPA_DEBUG is not set +# CONFIG_CPU_DCACHE_DISABLE is not set +# CONFIG_CPU_FREQ is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set +# CONFIG_CPU_FREQ_GOV_SCHEDUTIL is not set +# CONFIG_CPU_FREQ_STAT_DETAILS is not set +# CONFIG_CPU_IDLE is not set +# CONFIG_CPU_IDLE_GOV_MENU is not set +# CONFIG_CPU_IDLE_MULTIPLE_DRIVERS is not set +# CONFIG_CPU_NO_EFFICIENT_FFS is not set +CONFIG_CPU_SW_DOMAIN_PAN=y +# CONFIG_CRAMFS is not set +CONFIG_CRASHLOG=y +# CONFIG_CRASH_DUMP is not set +# CONFIG_CRC16 is not set +CONFIG_CRC32=y +# CONFIG_CRC32_BIT is not set +CONFIG_CRC32_SARWATE=y +# CONFIG_CRC32_SELFTEST is not set +# CONFIG_CRC32_SLICEBY4 is not set +# CONFIG_CRC32_SLICEBY8 is not set +# CONFIG_CRC4 is not set +# CONFIG_CRC7 is not set +# CONFIG_CRC8 is not set +# CONFIG_CRC_CCITT is not set +# CONFIG_CRC_ITU_T is not set +# CONFIG_CRC_T10DIF is not set +CONFIG_CROSS_COMPILE="" +# CONFIG_CROSS_MEMORY_ATTACH is not set +CONFIG_CRYPTO=y +# CONFIG_CRYPTO_842 is not set +# CONFIG_CRYPTO_AEAD is not set +CONFIG_CRYPTO_AES=y +# CONFIG_CRYPTO_AES_586 is not set +# CONFIG_CRYPTO_AES_ARM is not set +# CONFIG_CRYPTO_AES_ARM_BS is not set +# CONFIG_CRYPTO_AES_NI_INTEL is not set +# CONFIG_CRYPTO_AES_TI is not set +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ALGAPI2=y +# CONFIG_CRYPTO_ANSI_CPRNG is not set +# CONFIG_CRYPTO_ANUBIS is not set +CONFIG_CRYPTO_ARC4=y +# CONFIG_CRYPTO_AUTHENC is not set +CONFIG_CRYPTO_BLKCIPHER=y +CONFIG_CRYPTO_BLKCIPHER2=y +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_CAMELLIA is not set +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST6 is not set +# CONFIG_CRYPTO_CBC is not set +# CONFIG_CRYPTO_CCM is not set +# CONFIG_CRYPTO_CHACHA20 is not set +# CONFIG_CRYPTO_CHACHA20POLY1305 is not set +# CONFIG_CRYPTO_CMAC is not set +# CONFIG_CRYPTO_CRC32 is not set +# CONFIG_CRYPTO_CRC32C is not set +# CONFIG_CRYPTO_CRC32C_INTEL is not set +# CONFIG_CRYPTO_CRCT10DIF is not set +# CONFIG_CRYPTO_CRYPTD is not set +# CONFIG_CRYPTO_CTR is not set +# CONFIG_CRYPTO_CTS is not set +# CONFIG_CRYPTO_DEFLATE is not set +# CONFIG_CRYPTO_DES is not set +# CONFIG_CRYPTO_DEV_ATMEL_AES is not set +# CONFIG_CRYPTO_DEV_ATMEL_SHA is not set +# CONFIG_CRYPTO_DEV_ATMEL_TDES is not set +# CONFIG_CRYPTO_DEV_CCP is not set +# CONFIG_CRYPTO_DEV_CCREE is not set +# CONFIG_CRYPTO_DEV_FSL_CAAM is not set +# CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_DESC is not set +# CONFIG_CRYPTO_DEV_HIFN_795X is not set +# CONFIG_CRYPTO_DEV_IMGTEC_HASH is not set +# CONFIG_CRYPTO_DEV_MARVELL_CESA is not set +# CONFIG_CRYPTO_DEV_MV_CESA is not set +# CONFIG_CRYPTO_DEV_MXS_DCP is not set +# CONFIG_CRYPTO_DEV_NITROX_CNN55XX is not set +# CONFIG_CRYPTO_DEV_QAT_C3XXX is not set +# CONFIG_CRYPTO_DEV_QAT_C3XXXVF is not set +# CONFIG_CRYPTO_DEV_QAT_C62X is not set +# CONFIG_CRYPTO_DEV_QAT_C62XVF is not set +# CONFIG_CRYPTO_DEV_QAT_DH895xCC is not set +# CONFIG_CRYPTO_DEV_QAT_DH895xCCVF is not set +# CONFIG_CRYPTO_DEV_QCE is not set +# CONFIG_CRYPTO_DEV_SAHARA is not set +# CONFIG_CRYPTO_DEV_TALITOS is not set +# CONFIG_CRYPTO_DEV_VIRTIO is not set +# CONFIG_CRYPTO_DH is not set +# CONFIG_CRYPTO_DRBG_CTR is not set +# CONFIG_CRYPTO_DRBG_HASH is not set +# CONFIG_CRYPTO_DRBG_MENU is not set +# CONFIG_CRYPTO_ECB is not set +# CONFIG_CRYPTO_ECDH is not set +# CONFIG_CRYPTO_ECHAINIV is not set +# CONFIG_CRYPTO_FCRYPT is not set +# CONFIG_CRYPTO_FIPS is not set +# CONFIG_CRYPTO_GCM is not set +# CONFIG_CRYPTO_GF128MUL is not set +# CONFIG_CRYPTO_GHASH is not set +# CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL is not set +# CONFIG_CRYPTO_HASH is not set +# CONFIG_CRYPTO_HMAC is not set +# CONFIG_CRYPTO_HW is not set +# CONFIG_CRYPTO_JITTERENTROPY is not set +# CONFIG_CRYPTO_KEYWRAP is not set +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_LRW is not set +# CONFIG_CRYPTO_LZ4 is not set +# CONFIG_CRYPTO_LZ4HC is not set +# CONFIG_CRYPTO_LZO is not set +# CONFIG_CRYPTO_MANAGER is not set +# CONFIG_CRYPTO_MANAGER2 is not set +CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y +# CONFIG_CRYPTO_MCRYPTD is not set +# CONFIG_CRYPTO_MD4 is not set +# CONFIG_CRYPTO_MD5 is not set +# CONFIG_CRYPTO_MICHAEL_MIC is not set +# CONFIG_CRYPTO_NULL is not set +# CONFIG_CRYPTO_PCBC is not set +# CONFIG_CRYPTO_PCOMP is not set +# CONFIG_CRYPTO_PCOMP2 is not set +CONFIG_CRYPTO_PCRYPT=y +# CONFIG_CRYPTO_POLY1305 is not set +# CONFIG_CRYPTO_RMD128 is not set +# CONFIG_CRYPTO_RMD160 is not set +# CONFIG_CRYPTO_RMD256 is not set +# CONFIG_CRYPTO_RMD320 is not set +# CONFIG_CRYPTO_RNG is not set +# CONFIG_CRYPTO_RSA is not set +# CONFIG_CRYPTO_SALSA20 is not set +# CONFIG_CRYPTO_SALSA20_586 is not set +# CONFIG_CRYPTO_SEED is not set +# CONFIG_CRYPTO_SEQIV is not set +# CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_SHA1 is not set +# CONFIG_CRYPTO_SHA1_ARM is not set +# CONFIG_CRYPTO_SHA256 is not set +# CONFIG_CRYPTO_SHA3 is not set +# CONFIG_CRYPTO_SHA512 is not set +# CONFIG_CRYPTO_TEA is not set +# CONFIG_CRYPTO_TEST is not set +# CONFIG_CRYPTO_TGR192 is not set +# CONFIG_CRYPTO_TWOFISH is not set +# CONFIG_CRYPTO_TWOFISH_586 is not set +# CONFIG_CRYPTO_TWOFISH_COMMON is not set +# CONFIG_CRYPTO_USER is not set +# CONFIG_CRYPTO_USER_API_AEAD is not set +# CONFIG_CRYPTO_USER_API_HASH is not set +# CONFIG_CRYPTO_USER_API_RNG is not set +# CONFIG_CRYPTO_USER_API_SKCIPHER is not set +# CONFIG_CRYPTO_VMAC is not set +# CONFIG_CRYPTO_WP512 is not set +# CONFIG_CRYPTO_XCBC is not set +# CONFIG_CRYPTO_XTS is not set +# CONFIG_CRYPTO_ZLIB is not set +# CONFIG_CS5535_MFGPT is not set +# CONFIG_CS89x0 is not set +# CONFIG_CUSE is not set +# CONFIG_CW1200 is not set +# CONFIG_CXL_AFU_DRIVER_OPS is not set +# CONFIG_CXL_BASE is not set +# CONFIG_CXL_EEH is not set +# CONFIG_CXL_KERNEL_API is not set +# CONFIG_CXL_LIB is not set +# CONFIG_CYPRESS_FIRMWARE is not set +# CONFIG_DA280 is not set +# CONFIG_DA311 is not set +# CONFIG_DAVICOM_PHY is not set +# CONFIG_DAX is not set +# CONFIG_DCB is not set +# CONFIG_DDR is not set +# CONFIG_DEBUG_ALIGN_RODATA is not set +# CONFIG_DEBUG_ATOMIC_SLEEP is not set +# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set +# CONFIG_DEBUG_BUGVERBOSE is not set +# CONFIG_DEBUG_CREDENTIALS is not set +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set +CONFIG_DEBUG_FS=y +# CONFIG_DEBUG_GPIO is not set +# CONFIG_DEBUG_HIGHMEM is not set +# CONFIG_DEBUG_ICEDCC is not set +# CONFIG_DEBUG_INFO is not set +# CONFIG_DEBUG_INFO_DWARF4 is not set +CONFIG_DEBUG_INFO_REDUCED=y +# CONFIG_DEBUG_INFO_SPLIT is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_KMEMLEAK is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_KOBJECT_RELEASE is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_LL is not set +# CONFIG_DEBUG_LL_UART_8250 is not set +# CONFIG_DEBUG_LL_UART_PL01X is not set +# CONFIG_DEBUG_LOCKDEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_DEBUG_MEMORY_INIT is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_NOTIFIERS is not set +# CONFIG_DEBUG_NX_TEST is not set +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_DEBUG_PAGEALLOC is not set +# CONFIG_DEBUG_PAGE_REF is not set +# CONFIG_DEBUG_PERF_USE_VMALLOC is not set +# CONFIG_DEBUG_PER_CPU_MAPS is not set +# CONFIG_DEBUG_PINCTRL is not set +# CONFIG_DEBUG_PI_LIST is not set +# CONFIG_DEBUG_PREEMPT is not set +# CONFIG_DEBUG_RODATA is not set +# CONFIG_DEBUG_RODATA_TEST is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_DEBUG_SECTION_MISMATCH is not set +# CONFIG_DEBUG_SEMIHOSTING is not set +# CONFIG_DEBUG_SET_MODULE_RONX is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_SHIRQ is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set +# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set +# CONFIG_DEBUG_TIMEKEEPING is not set +# CONFIG_DEBUG_UART_8250_PALMCHIP is not set +# CONFIG_DEBUG_UART_BCM63XX is not set +# CONFIG_DEBUG_VIRTUAL is not set +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set +# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set +# CONFIG_DEBUG_WX is not set +# CONFIG_DEBUG_ZBOOT is not set +# CONFIG_DECNET is not set +CONFIG_DEFAULT_CUBIC=y +CONFIG_DEFAULT_DEADLINE=y +CONFIG_DEFAULT_HOSTNAME="(none)" +CONFIG_DEFAULT_IOSCHED="deadline" +CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 +# CONFIG_DEFAULT_NOOP is not set +# CONFIG_DEFAULT_RENO is not set +CONFIG_DEFAULT_SECURITY="" +CONFIG_DEFAULT_SECURITY_DAC=y +CONFIG_DEFAULT_TCP_CONG="cubic" +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +# CONFIG_DELL_LAPTOP is not set +# CONFIG_DELL_RBTN is not set +# CONFIG_DELL_SMO8800 is not set +# CONFIG_DEPRECATED_PARAM_STRUCT is not set +# CONFIG_DETECT_HUNG_TASK is not set +# CONFIG_DEVKMEM is not set +# CONFIG_DEVMEM is not set +CONFIG_DEVPORT=y +# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set +# CONFIG_DEVTMPFS is not set +# CONFIG_DEVTMPFS_MOUNT is not set +# CONFIG_DGAP is not set +# CONFIG_DGNC is not set +# CONFIG_DHT11 is not set +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_DISPLAY_CONNECTOR_ANALOG_TV is not set +# CONFIG_DISPLAY_CONNECTOR_DVI is not set +# CONFIG_DISPLAY_CONNECTOR_HDMI is not set +# CONFIG_DISPLAY_ENCODER_TFP410 is not set +# CONFIG_DISPLAY_ENCODER_TPD12S015 is not set +# CONFIG_DISPLAY_PANEL_DPI is not set +# CONFIG_DISPLAY_PANEL_LGPHILIPS_LB035Q02 is not set +# CONFIG_DISPLAY_PANEL_TPO_TD028TTEC1 is not set +# CONFIG_DISPLAY_PANEL_TPO_TD043MTEA1 is not set +# CONFIG_DL2K is not set +# CONFIG_DLM is not set +# CONFIG_DM9000 is not set +# CONFIG_DMADEVICES is not set +# CONFIG_DMADEVICES_DEBUG is not set +# CONFIG_DMARD06 is not set +# CONFIG_DMARD09 is not set +# CONFIG_DMARD10 is not set +# CONFIG_DMASCC is not set +# CONFIG_DMATEST is not set +# CONFIG_DMA_API_DEBUG is not set +# CONFIG_DMA_ENGINE is not set +# CONFIG_DMA_FENCE_TRACE is not set +# CONFIG_DMA_SHARED_BUFFER is not set +# CONFIG_DM_CACHE is not set +# CONFIG_DM_DEBUG is not set +# CONFIG_DM_DELAY is not set +# CONFIG_DM_ERA is not set +# CONFIG_DM_FLAKEY is not set +# CONFIG_DM_INTEGRITY is not set +# CONFIG_DM_LOG_USERSPACE is not set +# CONFIG_DM_LOG_WRITES is not set +# CONFIG_DM_MQ_DEFAULT is not set +# CONFIG_DM_MULTIPATH is not set +# CONFIG_DM_RAID is not set +# CONFIG_DM_SWITCH is not set +# CONFIG_DM_THIN_PROVISIONING is not set +# CONFIG_DM_UEVENT is not set +# CONFIG_DM_VERITY is not set +# CONFIG_DM_ZERO is not set +# CONFIG_DNET is not set +# CONFIG_DNOTIFY is not set +# CONFIG_DNS_RESOLVER is not set +CONFIG_DOUBLEFAULT=y +# CONFIG_DP83848_PHY is not set +# CONFIG_DP83867_PHY is not set +# CONFIG_DPOT_DAC is not set +CONFIG_DQL=y +# CONFIG_DRAGONRISE_FF is not set +# CONFIG_DRM is not set +# CONFIG_DRM_AMDGPU is not set +# CONFIG_DRM_ANALOGIX_ANX78XX is not set +# CONFIG_DRM_ARCPGU is not set +# CONFIG_DRM_ARMADA is not set +# CONFIG_DRM_AST is not set +# CONFIG_DRM_BOCHS is not set +# CONFIG_DRM_CIRRUS_QEMU is not set +# CONFIG_DRM_DEBUG_MM is not set +# CONFIG_DRM_DEBUG_MM_SELFTEST is not set +# CONFIG_DRM_DP_AUX_CHARDEV is not set +# CONFIG_DRM_DUMB_VGA_DAC is not set +# CONFIG_DRM_DW_HDMI_CEC is not set +# CONFIG_DRM_ETNAVIV is not set +# CONFIG_DRM_EXYNOS is not set +# CONFIG_DRM_FBDEV_EMULATION is not set +# CONFIG_DRM_FSL_DCU is not set +# CONFIG_DRM_HDLCD is not set +# CONFIG_DRM_HISI_HIBMC is not set +# CONFIG_DRM_HISI_KIRIN is not set +# CONFIG_DRM_I2C_ADV7511 is not set +# CONFIG_DRM_I2C_CH7006 is not set +# CONFIG_DRM_I2C_NXP_TDA998X is not set +# CONFIG_DRM_I2C_SIL164 is not set +# CONFIG_DRM_LEGACY is not set +# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set +# CONFIG_DRM_LVDS_ENCODER is not set +# CONFIG_DRM_MALI_DISPLAY is not set +# CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW is not set +# CONFIG_DRM_MGAG200 is not set +# CONFIG_DRM_MXSFB is not set +# CONFIG_DRM_NOUVEAU is not set +# CONFIG_DRM_NXP_PTN3460 is not set +# CONFIG_DRM_OMAP is not set +# CONFIG_DRM_PANEL_JDI_LT070ME05000 is not set +# CONFIG_DRM_PANEL_LG_LG4573 is not set +# CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00 is not set +# CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN is not set +# CONFIG_DRM_PANEL_SAMSUNG_LD9040 is not set +# CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0 is not set +# CONFIG_DRM_PANEL_SHARP_LQ101R1SX01 is not set +# CONFIG_DRM_PANEL_SHARP_LS043T1LE01 is not set +# CONFIG_DRM_PARADE_PS8622 is not set +# CONFIG_DRM_PL111 is not set +# CONFIG_DRM_QXL is not set +# CONFIG_DRM_RADEON is not set +# CONFIG_DRM_RCAR_DW_HDMI is not set +# CONFIG_DRM_SII902X is not set +# CONFIG_DRM_SIL_SII8620 is not set +# CONFIG_DRM_STI is not set +# CONFIG_DRM_TILCDC is not set +# CONFIG_DRM_TINYDRM is not set +# CONFIG_DRM_TI_TFP410 is not set +# CONFIG_DRM_TOSHIBA_TC358767 is not set +# CONFIG_DRM_UDL is not set +# CONFIG_DRM_VBOXVIDEO is not set +# CONFIG_DRM_VGEM is not set +# CONFIG_DS1682 is not set +# CONFIG_DS1803 is not set +# CONFIG_DST_CACHE is not set +# CONFIG_DTLK is not set +# CONFIG_DUMMY is not set +CONFIG_DUMMY_CONSOLE_COLUMNS=80 +CONFIG_DUMMY_CONSOLE_ROWS=25 +# CONFIG_DUMMY_IRQ is not set +# CONFIG_DVB_AU8522_V4L is not set +# CONFIG_DVB_CORE is not set +# CONFIG_DVB_DUMMY_FE is not set +# CONFIG_DVB_TUNER_DIB0070 is not set +# CONFIG_DVB_TUNER_DIB0090 is not set +# CONFIG_DWC_XLGMAC is not set +# CONFIG_DWMAC_IPQ806X is not set +# CONFIG_DWMAC_LPC18XX is not set +# CONFIG_DWMAC_MESON is not set +# CONFIG_DWMAC_ROCKCHIP is not set +# CONFIG_DWMAC_SOCFPGA is not set +# CONFIG_DWMAC_STI is not set +# CONFIG_DW_DMAC is not set +# CONFIG_DW_DMAC_PCI is not set +# CONFIG_DW_WATCHDOG is not set +# CONFIG_DYNAMIC_DEBUG is not set +# CONFIG_E100 is not set +# CONFIG_E1000 is not set +# CONFIG_E1000E is not set +# CONFIG_E1000E_HWTS is not set +# CONFIG_EARLY_PRINTK_8250 is not set +# CONFIG_EARLY_PRINTK_USB_XDBC is not set +# CONFIG_ECHO is not set +# CONFIG_ECRYPT_FS is not set +# CONFIG_EDAC is not set +# CONFIG_EEEPC_LAPTOP is not set +# CONFIG_EEPROM_93CX6 is not set +# CONFIG_EEPROM_93XX46 is not set +# CONFIG_EEPROM_AT24 is not set +# CONFIG_EEPROM_AT25 is not set +# CONFIG_EEPROM_DIGSY_MTC_CFG is not set +# CONFIG_EEPROM_IDT_89HPESX is not set +# CONFIG_EEPROM_LEGACY is not set +# CONFIG_EEPROM_MAX6875 is not set +# CONFIG_EFI is not set +CONFIG_EFI_PARTITION=y +# CONFIG_EFS_FS is not set +CONFIG_ELFCORE=y +# CONFIG_ELF_CORE is not set +# CONFIG_EMAC_ROCKCHIP is not set +CONFIG_EMBEDDED=y +# CONFIG_EM_TIMER_STI is not set +# CONFIG_ENABLE_MUST_CHECK is not set +CONFIG_ENABLE_WARN_DEPRECATED=y +# CONFIG_ENA_ETHERNET is not set +# CONFIG_ENC28J60 is not set +# CONFIG_ENCLOSURE_SERVICES is not set +# CONFIG_ENCRYPTED_KEYS is not set +# CONFIG_ENCX24J600 is not set +# CONFIG_ENIC is not set +# CONFIG_ENVELOPE_DETECTOR is not set +# CONFIG_EPAPR_PARAVIRT is not set +# CONFIG_EPIC100 is not set +CONFIG_EPOLL=y +# CONFIG_EQUALIZER is not set +# CONFIG_ET131X is not set +CONFIG_ETHERNET=y +# CONFIG_ETHOC is not set +CONFIG_EVENTFD=y +CONFIG_EXPERT=y +# CONFIG_EXPORTFS is not set +# CONFIG_EXPORTFS_BLOCK_OPS is not set +# CONFIG_EXT2_FS is not set +# CONFIG_EXT2_FS_XATTR is not set +# CONFIG_EXT3_FS is not set +# CONFIG_EXT4_DEBUG is not set +# CONFIG_EXT4_ENCRYPTION is not set +# CONFIG_EXT4_FS is not set +# CONFIG_EXT4_FS_POSIX_ACL is not set +# CONFIG_EXT4_FS_SECURITY is not set +CONFIG_EXT4_USE_FOR_EXT2=y +# CONFIG_EXTCON is not set +# CONFIG_EXTCON_ADC_JACK is not set +# CONFIG_EXTCON_GPIO is not set +# CONFIG_EXTCON_INTEL_INT3496 is not set +# CONFIG_EXTCON_MAX3355 is not set +# CONFIG_EXTCON_QCOM_SPMI_MISC is not set +# CONFIG_EXTCON_RT8973A is not set +# CONFIG_EXTCON_SM5502 is not set +# CONFIG_EXTCON_USB_GPIO is not set +CONFIG_EXTRA_FIRMWARE="" +CONFIG_EXTRA_TARGETS="" +# CONFIG_EXYNOS_ADC is not set +# CONFIG_EXYNOS_VIDEO is not set +# CONFIG_EZCHIP_NPS_MANAGEMENT_ENET is not set +# CONFIG_EZX_PCAP is not set +# CONFIG_F2FS_FAULT_INJECTION is not set +# CONFIG_F2FS_FS is not set +# CONFIG_F2FS_FS_ENCRYPTION is not set +# CONFIG_F2FS_FS_POSIX_ACL is not set +# CONFIG_F2FS_IO_TRACE is not set +# CONFIG_FAIR_GROUP_SCHED is not set +# CONFIG_FANOTIFY is not set +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +# CONFIG_FAT_DEFAULT_UTF8 is not set +# CONFIG_FAT_FS is not set +# CONFIG_FAULT_INJECTION is not set +# CONFIG_FB is not set +# CONFIG_FB_3DFX is not set +# CONFIG_FB_ARC is not set +# CONFIG_FB_ARK is not set +# CONFIG_FB_ARMCLCD is not set +# CONFIG_FB_ASILIANT is not set +# CONFIG_FB_ATY is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_AUO_K190X is not set +# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_BIG_ENDIAN is not set +# CONFIG_FB_BOOT_VESA_SUPPORT is not set +# CONFIG_FB_BOTH_ENDIAN is not set +# CONFIG_FB_BROADSHEET is not set +# CONFIG_FB_CARMINE is not set +# CONFIG_FB_CFB_COPYAREA is not set +# CONFIG_FB_CFB_FILLRECT is not set +# CONFIG_FB_CFB_IMAGEBLIT is not set +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +# CONFIG_FB_CIRRUS is not set +# CONFIG_FB_CYBER2000 is not set +# CONFIG_FB_DA8XX is not set +# CONFIG_FB_DDC is not set +# CONFIG_FB_FOREIGN_ENDIAN is not set +# CONFIG_FB_GEODE is not set +# CONFIG_FB_GOLDFISH is not set +# CONFIG_FB_HGA is not set +# CONFIG_FB_I740 is not set +# CONFIG_FB_IBM_GXT4500 is not set +# CONFIG_FB_IMSTT is not set +# CONFIG_FB_IMX is not set +# CONFIG_FB_KYRO is not set +# CONFIG_FB_LE80578 is not set +# CONFIG_FB_LITTLE_ENDIAN is not set +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_MATROX is not set +# CONFIG_FB_MB862XX is not set +# CONFIG_FB_METRONOME is not set +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_MXS is not set +# CONFIG_FB_N411 is not set +# CONFIG_FB_NEOMAGIC is not set +CONFIG_FB_NOTIFY=y +# CONFIG_FB_NVIDIA is not set +# CONFIG_FB_OF is not set +# CONFIG_FB_OMAP2 is not set +# CONFIG_FB_OPENCORES is not set +# CONFIG_FB_PM2 is not set +# CONFIG_FB_PM3 is not set +# CONFIG_FB_PS3 is not set +# CONFIG_FB_PXA is not set +# CONFIG_FB_RADEON is not set +# CONFIG_FB_RIVA is not set +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_S3 is not set +# CONFIG_FB_SAVAGE is not set +# CONFIG_FB_SIMPLE is not set +# CONFIG_FB_SIS is not set +# CONFIG_FB_SM712 is not set +# CONFIG_FB_SM750 is not set +# CONFIG_FB_SMSCUFX is not set +# CONFIG_FB_SSD1307 is not set +# CONFIG_FB_SVGALIB is not set +# CONFIG_FB_SYS_COPYAREA is not set +# CONFIG_FB_SYS_FILLRECT is not set +# CONFIG_FB_SYS_FOPS is not set +# CONFIG_FB_SYS_IMAGEBLIT is not set +# CONFIG_FB_TFT is not set +# CONFIG_FB_TILEBLITTING is not set +# CONFIG_FB_TMIO is not set +# CONFIG_FB_TRIDENT is not set +# CONFIG_FB_UDL is not set +# CONFIG_FB_UVESA is not set +# CONFIG_FB_VGA16 is not set +# CONFIG_FB_VIA is not set +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FB_VOODOO1 is not set +# CONFIG_FB_VT8623 is not set +# CONFIG_FB_XGI is not set +# CONFIG_FCOE is not set +# CONFIG_FCOE_FNIC is not set +# CONFIG_FDDI is not set +# CONFIG_FEALNX is not set +# CONFIG_FENCE_TRACE is not set +# CONFIG_FHANDLE is not set +CONFIG_FIB_RULES=y +CONFIG_FILE_LOCKING=y +# CONFIG_FIREWIRE is not set +# CONFIG_FIREWIRE_NOSY is not set +# CONFIG_FIREWIRE_SERIAL is not set +# CONFIG_FIRMWARE_EDID is not set +# CONFIG_FIRMWARE_IN_KERNEL is not set +# CONFIG_FIRMWARE_MEMMAP is not set +# CONFIG_FIXED_PHY is not set +CONFIG_FLATMEM=y +CONFIG_FLATMEM_MANUAL=y +CONFIG_FLAT_NODE_MEM_MAP=y +# CONFIG_FM10K is not set +# CONFIG_FMC is not set +# CONFIG_FORCEDETH is not set +CONFIG_FORCE_MAX_ZONEORDER=11 +CONFIG_FORTIFY_SOURCE=y +# CONFIG_FPGA is not set +# CONFIG_FRAMEBUFFER_CONSOLE is not set +# CONFIG_FRAME_POINTER is not set +CONFIG_FRAME_WARN=1024 +# CONFIG_FREEZER is not set +# CONFIG_FRONTSWAP is not set +# CONFIG_FSCACHE is not set +# CONFIG_FSI is not set +# CONFIG_FSL_EDMA is not set +# CONFIG_FSL_ERRATUM_A008585 is not set +# CONFIG_FSL_MC_BUS is not set +# CONFIG_FSL_PQ_MDIO is not set +# CONFIG_FSL_XGMAC_MDIO is not set +CONFIG_FSNOTIFY=y +# CONFIG_FS_DAX is not set +# CONFIG_FS_ENCRYPTION is not set +# CONFIG_FS_POSIX_ACL is not set +# CONFIG_FTGMAC100 is not set +# CONFIG_FTL is not set +# CONFIG_FTMAC100 is not set +# CONFIG_FTRACE is not set +# CONFIG_FTRACE_STARTUP_TEST is not set +# CONFIG_FTR_FIXUP_SELFTEST is not set +# CONFIG_FUJITSU_ES is not set +# CONFIG_FUJITSU_LAPTOP is not set +# CONFIG_FUJITSU_TABLET is not set +# CONFIG_FUNCTION_TRACER is not set +# CONFIG_FUSE_FS is not set +# CONFIG_FUSION is not set +# CONFIG_FUSION_FC is not set +# CONFIG_FUSION_SAS is not set +# CONFIG_FUSION_SPI is not set +CONFIG_FUTEX=y +# CONFIG_FW_CFG_SYSFS is not set +CONFIG_FW_LOADER=y +CONFIG_FW_LOADER_USER_HELPER=y +CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y +CONFIG_GACT_PROB=y +# CONFIG_GADGET_UAC1 is not set +# CONFIG_GAMEPORT is not set +# CONFIG_GATEWORKS_GW16083 is not set +# CONFIG_GCC_PLUGINS is not set +# CONFIG_GCOV is not set +# CONFIG_GCOV_KERNEL is not set +# CONFIG_GDB_SCRIPTS is not set +# CONFIG_GENERIC_ADC_BATTERY is not set +# CONFIG_GENERIC_ADC_THERMAL is not set +CONFIG_GENERIC_CALIBRATE_DELAY=y +# CONFIG_GENERIC_CPU_DEVICES is not set +CONFIG_GENERIC_HWEIGHT=y +# CONFIG_GENERIC_IRQ_DEBUGFS is not set +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_NET_UTILS=y +# CONFIG_GENERIC_PHY is not set +# CONFIG_GENEVE is not set +# CONFIG_GENWQE is not set +# CONFIG_GFS2_FS is not set +# CONFIG_GIGASET_CAPI is not set +# CONFIG_GIGASET_DEBUG is not set +# CONFIG_GIGASET_DUMMYLL is not set +# CONFIG_GLOB_SELFTEST is not set +# CONFIG_GOLDFISH is not set +# CONFIG_GOOGLE_FIRMWARE is not set +# CONFIG_GP2AP020A00F is not set +# CONFIG_GPIOLIB is not set +# CONFIG_GPIO_74X164 is not set +# CONFIG_GPIO_74XX_MMIO is not set +# CONFIG_GPIO_ADNP is not set +# CONFIG_GPIO_ADP5588 is not set +# CONFIG_GPIO_ALTERA is not set +# CONFIG_GPIO_AMD8111 is not set +# CONFIG_GPIO_AMDPT is not set +# CONFIG_GPIO_BCM_KONA is not set +# CONFIG_GPIO_BT8XX is not set +# CONFIG_GPIO_CS5535 is not set +# CONFIG_GPIO_DWAPB is not set +# CONFIG_GPIO_EM is not set +# CONFIG_GPIO_EXAR is not set +# CONFIG_GPIO_F7188X is not set +# CONFIG_GPIO_FTGPIO010 is not set +# CONFIG_GPIO_GENERIC_PLATFORM is not set +# CONFIG_GPIO_GPIO_MM is not set +# CONFIG_GPIO_GRGPIO is not set +# CONFIG_GPIO_ICH is not set +# CONFIG_GPIO_IT87 is not set +# CONFIG_GPIO_LYNXPOINT is not set +# CONFIG_GPIO_MAX7300 is not set +# CONFIG_GPIO_MAX7301 is not set +# CONFIG_GPIO_MAX732X is not set +# CONFIG_GPIO_MC33880 is not set +# CONFIG_GPIO_MCP23S08 is not set +# CONFIG_GPIO_ML_IOH is not set +# CONFIG_GPIO_MOCKUP is not set +# CONFIG_GPIO_MPC8XXX is not set +# CONFIG_GPIO_PCA953X is not set +# CONFIG_GPIO_PCF857X is not set +# CONFIG_GPIO_PCH is not set +# CONFIG_GPIO_PCI_IDIO_16 is not set +# CONFIG_GPIO_PISOSR is not set +# CONFIG_GPIO_PL061 is not set +# CONFIG_GPIO_RCAR is not set +# CONFIG_GPIO_RDC321X is not set +# CONFIG_GPIO_SCH is not set +# CONFIG_GPIO_SCH311X is not set +# CONFIG_GPIO_SX150X is not set +# CONFIG_GPIO_SYSCON is not set +# CONFIG_GPIO_SYSFS is not set +# CONFIG_GPIO_TPIC2810 is not set +# CONFIG_GPIO_TS4900 is not set +# CONFIG_GPIO_TS5500 is not set +# CONFIG_GPIO_VX855 is not set +# CONFIG_GPIO_WATCHDOG is not set +# CONFIG_GPIO_WS16C48 is not set +# CONFIG_GPIO_XGENE is not set +# CONFIG_GPIO_XILINX is not set +# CONFIG_GPIO_XRA1403 is not set +# CONFIG_GPIO_ZEVIO is not set +# CONFIG_GPIO_ZX is not set +# CONFIG_GREENASIA_FF is not set +# CONFIG_GREYBUS is not set +# CONFIG_GS_FPGABOOT is not set +# CONFIG_GTP is not set +# CONFIG_HAMACHI is not set +# CONFIG_HAMRADIO is not set +# CONFIG_HAPPYMEAL is not set +# CONFIG_HARDENED_USERCOPY is not set +# CONFIG_HARDLOCKUP_DETECTOR is not set +# CONFIG_HAVE_AOUT is not set +CONFIG_HAVE_ARCH_HARDENED_USERCOPY=y +# CONFIG_HAVE_ARCH_HASH is not set +CONFIG_HAVE_ARCH_MMAP_RND_BITS=y +# CONFIG_HAVE_ARCH_VMAP_STACK is not set +CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES=y +# CONFIG_HAVE_ARM_ARCH_TIMER is not set +CONFIG_HAVE_EXIT_THREAD=y +CONFIG_HAVE_GCC_PLUGINS=y +CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y +CONFIG_HAVE_KERNEL_BZIP2=y +CONFIG_HAVE_KERNEL_CAT=y +CONFIG_HAVE_KERNEL_GZIP=y +CONFIG_HAVE_KERNEL_LZ4=y +CONFIG_HAVE_KERNEL_LZMA=y +CONFIG_HAVE_KERNEL_LZO=y +CONFIG_HAVE_KERNEL_XZ=y +CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y +CONFIG_HAVE_NMI=y +# CONFIG_HCALL_STATS is not set +# CONFIG_HDC100X is not set +# CONFIG_HDLC is not set +# CONFIG_HDLC_CISCO is not set +# CONFIG_HDLC_FR is not set +# CONFIG_HDLC_PPP is not set +# CONFIG_HDLC_RAW is not set +# CONFIG_HDLC_RAW_ETH is not set +# CONFIG_HDMI_LPE_AUDIO is not set +# CONFIG_HDQ_MASTER_OMAP is not set +# CONFIG_HEADERS_CHECK is not set +# CONFIG_HERMES is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_HFSPLUS_FS_POSIX_ACL is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFS_FS_POSIX_ACL is not set +# CONFIG_HI8435 is not set +# CONFIG_HIBERNATION is not set +# CONFIG_HID is not set +# CONFIG_HIDRAW is not set +# CONFIG_HID_A4TECH is not set +# CONFIG_HID_ACCUTOUCH is not set +# CONFIG_HID_ACRUX is not set +# CONFIG_HID_ACRUX_FF is not set +# CONFIG_HID_ALPS is not set +# CONFIG_HID_APPLE is not set +# CONFIG_HID_APPLEIR is not set +# CONFIG_HID_ASUS is not set +# CONFIG_HID_AUREAL is not set +# CONFIG_HID_BATTERY_STRENGTH is not set +# CONFIG_HID_BELKIN is not set +# CONFIG_HID_BETOP_FF is not set +# CONFIG_HID_CHERRY is not set +# CONFIG_HID_CHICONY is not set +# CONFIG_HID_CMEDIA is not set +# CONFIG_HID_CORSAIR is not set +# CONFIG_HID_CP2112 is not set +# CONFIG_HID_CYPRESS is not set +# CONFIG_HID_DRAGONRISE is not set +# CONFIG_HID_ELECOM is not set +# CONFIG_HID_ELO is not set +# CONFIG_HID_EMS_FF is not set +# CONFIG_HID_EZKEY is not set +# CONFIG_HID_GEMBIRD is not set +# CONFIG_HID_GENERIC is not set +# CONFIG_HID_GFRM is not set +# CONFIG_HID_GREENASIA is not set +# CONFIG_HID_GT683R is not set +# CONFIG_HID_GYRATION is not set +# CONFIG_HID_HOLTEK is not set +# CONFIG_HID_ICADE is not set +# CONFIG_HID_ITE is not set +# CONFIG_HID_KENSINGTON is not set +# CONFIG_HID_KEYTOUCH is not set +# CONFIG_HID_KYE is not set +# CONFIG_HID_LCPOWER is not set +# CONFIG_HID_LED is not set +# CONFIG_HID_LENOVO is not set +# CONFIG_HID_LOGITECH is not set +# CONFIG_HID_LOGITECH_DJ is not set +# CONFIG_HID_LOGITECH_HIDPP is not set +# CONFIG_HID_MAGICMOUSE is not set +# CONFIG_HID_MAYFLASH is not set +# CONFIG_HID_MICROSOFT is not set +# CONFIG_HID_MONTEREY is not set +# CONFIG_HID_MULTITOUCH is not set +# CONFIG_HID_NTI is not set +# CONFIG_HID_NTRIG is not set +# CONFIG_HID_ORTEK is not set +# CONFIG_HID_PANTHERLORD is not set +# CONFIG_HID_PENMOUNT is not set +# CONFIG_HID_PETALYNX is not set +# CONFIG_HID_PICOLCD is not set +# CONFIG_HID_PID is not set +# CONFIG_HID_PLANTRONICS is not set +# CONFIG_HID_PRIMAX is not set +# CONFIG_HID_PRODIKEYS is not set +# CONFIG_HID_RETRODE is not set +# CONFIG_HID_RMI is not set +# CONFIG_HID_ROCCAT is not set +# CONFIG_HID_SAITEK is not set +# CONFIG_HID_SAMSUNG is not set +# CONFIG_HID_SENSOR_HUB is not set +# CONFIG_HID_SMARTJOYPLUS is not set +# CONFIG_HID_SONY is not set +# CONFIG_HID_SPEEDLINK is not set +# CONFIG_HID_STEELSERIES is not set +# CONFIG_HID_SUNPLUS is not set +# CONFIG_HID_THINGM is not set +# CONFIG_HID_THRUSTMASTER is not set +# CONFIG_HID_TIVO is not set +# CONFIG_HID_TOPSEED is not set +# CONFIG_HID_TWINHAN is not set +# CONFIG_HID_UCLOGIC is not set +# CONFIG_HID_UDRAW_PS3 is not set +# CONFIG_HID_WACOM is not set +# CONFIG_HID_WALTOP is not set +# CONFIG_HID_WIIMOTE is not set +# CONFIG_HID_XINMO is not set +# CONFIG_HID_ZEROPLUS is not set +# CONFIG_HID_ZYDACRON is not set +# CONFIG_HIGHMEM is not set +CONFIG_HIGH_RES_TIMERS=y +# CONFIG_HINIC is not set +# CONFIG_HIP04_ETH is not set +# CONFIG_HIPPI is not set +# CONFIG_HISILICON_ERRATUM_161010101 is not set +# CONFIG_HISI_FEMAC is not set +# CONFIG_HIX5HD2_GMAC is not set +# CONFIG_HMC6352 is not set +# CONFIG_HNS is not set +# CONFIG_HNS3 is not set +# CONFIG_HNS_DSAF is not set +# CONFIG_HNS_ENET is not set +# CONFIG_HOSTAP is not set +# CONFIG_HOSTAP_CS is not set +# CONFIG_HOSTAP_PCI is not set +# CONFIG_HOSTAP_PLX is not set +# CONFIG_HOTPLUG_CPU is not set +# CONFIG_HOTPLUG_PCI is not set +# CONFIG_HP03 is not set +# CONFIG_HP100 is not set +# CONFIG_HP206C is not set +CONFIG_HPET_MMAP_DEFAULT=y +# CONFIG_HPFS_FS is not set +# CONFIG_HP_ILO is not set +# CONFIG_HP_WIRELESS is not set +# CONFIG_HSI is not set +# CONFIG_HSR is not set +# CONFIG_HTC_EGPIO is not set +# CONFIG_HTC_I2CPLD is not set +# CONFIG_HTC_PASIC3 is not set +# CONFIG_HTS221 is not set +# CONFIG_HTU21 is not set +# CONFIG_HUGETLB_PAGE is not set +# CONFIG_HVC_DCC is not set +# CONFIG_HVC_UDBG is not set +# CONFIG_HWLAT_TRACER is not set +# CONFIG_HWMON is not set +# CONFIG_HWMON_DEBUG_CHIP is not set +# CONFIG_HWMON_VID is not set +# CONFIG_HWSPINLOCK is not set +# CONFIG_HWSPINLOCK_OMAP is not set +CONFIG_HW_PERF_EVENTS=y +# CONFIG_HW_RANDOM is not set +# CONFIG_HW_RANDOM_AMD is not set +# CONFIG_HW_RANDOM_ATMEL is not set +# CONFIG_HW_RANDOM_EXYNOS is not set +# CONFIG_HW_RANDOM_GEODE is not set +# CONFIG_HW_RANDOM_INTEL is not set +# CONFIG_HW_RANDOM_IPROC_RNG200 is not set +# CONFIG_HW_RANDOM_OMAP3_ROM is not set +# CONFIG_HW_RANDOM_PPC4XX is not set +# CONFIG_HW_RANDOM_TIMERIOMEM is not set +# CONFIG_HW_RANDOM_TPM is not set +# CONFIG_HW_RANDOM_VIA is not set +# CONFIG_HW_RANDOM_VIRTIO is not set +# CONFIG_HX711 is not set +# CONFIG_HYPERV is not set +# CONFIG_HYPERV_TSCPAGE is not set +# CONFIG_HYSDN is not set +CONFIG_HZ=100 +CONFIG_HZ_100=y +# CONFIG_HZ_1000 is not set +# CONFIG_HZ_1024 is not set +# CONFIG_HZ_128 is not set +# CONFIG_HZ_200 is not set +# CONFIG_HZ_24 is not set +# CONFIG_HZ_250 is not set +# CONFIG_HZ_256 is not set +# CONFIG_HZ_300 is not set +# CONFIG_HZ_48 is not set +# CONFIG_HZ_500 is not set +# CONFIG_HZ_PERIODIC is not set +# CONFIG_I2C is not set +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_I2C_ALGOPCA is not set +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_ARB_GPIO_CHALLENGE is not set +# CONFIG_I2C_AU1550 is not set +# CONFIG_I2C_BCM2835 is not set +# CONFIG_I2C_BCM_IPROC is not set +# CONFIG_I2C_CADENCE is not set +# CONFIG_I2C_CBUS_GPIO is not set +# CONFIG_I2C_CHARDEV is not set +# CONFIG_I2C_COMPAT is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEMUX_PINCTRL is not set +# CONFIG_I2C_DESIGNWARE_PCI is not set +# CONFIG_I2C_DESIGNWARE_PLATFORM is not set +# CONFIG_I2C_DIOLAN_U2C is not set +# CONFIG_I2C_EG20T is not set +# CONFIG_I2C_ELEKTOR is not set +# CONFIG_I2C_EMEV2 is not set +# CONFIG_I2C_GPIO is not set +# CONFIG_I2C_HELPER_AUTO is not set +# CONFIG_I2C_HID is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_IBM_IIC is not set +# CONFIG_I2C_IMG is not set +# CONFIG_I2C_ISCH is not set +# CONFIG_I2C_ISMT is not set +# CONFIG_I2C_MLXCPLD is not set +# CONFIG_I2C_MPC is not set +# CONFIG_I2C_MUX is not set +# CONFIG_I2C_MUX_GPIO is not set +# CONFIG_I2C_MUX_GPMUX is not set +# CONFIG_I2C_MUX_LTC4306 is not set +# CONFIG_I2C_MUX_MLXCPLD is not set +# CONFIG_I2C_MUX_PCA9541 is not set +# CONFIG_I2C_MUX_PCA954x is not set +# CONFIG_I2C_MUX_PINCTRL is not set +# CONFIG_I2C_MUX_REG is not set +# CONFIG_I2C_MV64XXX is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_NOMADIK is not set +# CONFIG_I2C_OCORES is not set +# CONFIG_I2C_OCTEON is not set +# CONFIG_I2C_PARPORT is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_PCA_ISA is not set +# CONFIG_I2C_PCA_PLATFORM is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_PXA_PCI is not set +# CONFIG_I2C_RCAR is not set +# CONFIG_I2C_RK3X is not set +# CONFIG_I2C_ROBOTFUZZ_OSIF is not set +# CONFIG_I2C_SCMI is not set +# CONFIG_I2C_SH_MOBILE is not set +# CONFIG_I2C_SIMTEC is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_SLAVE is not set +# CONFIG_I2C_SMBUS is not set +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_TAOS_EVM is not set +# CONFIG_I2C_THUNDERX is not set +# CONFIG_I2C_TINY_USB is not set +# CONFIG_I2C_VERSATILE is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set +# CONFIG_I2C_XILINX is not set +# CONFIG_I40E is not set +# CONFIG_I40EVF is not set +# CONFIG_I6300ESB_WDT is not set +# CONFIG_I82092 is not set +# CONFIG_I82365 is not set +# CONFIG_IAQCORE is not set +# CONFIG_IBM_ASM is not set +# CONFIG_IBM_EMAC_DEBUG is not set +# CONFIG_IBM_EMAC_EMAC4 is not set +# CONFIG_IBM_EMAC_MAL_CLR_ICINTSTAT is not set +# CONFIG_IBM_EMAC_MAL_COMMON_ERR is not set +# CONFIG_IBM_EMAC_NO_FLOW_CTRL is not set +# CONFIG_IBM_EMAC_RGMII is not set +# CONFIG_IBM_EMAC_TAH is not set +# CONFIG_IBM_EMAC_ZMII is not set +# CONFIG_ICPLUS_PHY is not set +# CONFIG_ICS932S401 is not set +# CONFIG_IDE is not set +# CONFIG_IDEAPAD_LAPTOP is not set +# CONFIG_IDE_GD is not set +# CONFIG_IDE_PROC_FS is not set +# CONFIG_IDE_TASK_IOCTL is not set +# CONFIG_IDLE_PAGE_TRACKING is not set +# CONFIG_IEEE802154 is not set +# CONFIG_IEEE802154_ADF7242 is not set +# CONFIG_IEEE802154_ATUSB is not set +# CONFIG_IEEE802154_CA8210 is not set +# CONFIG_IFB is not set +# CONFIG_IGB is not set +# CONFIG_IGBVF is not set +# CONFIG_IIO is not set +# CONFIG_IIO_BUFFER_CB is not set +# CONFIG_IIO_CONFIGFS is not set +CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 +# CONFIG_IIO_INTERRUPT_TRIGGER is not set +# CONFIG_IIO_MUX is not set +# CONFIG_IIO_PERIODIC_RTC_TRIGGER is not set +# CONFIG_IIO_SIMPLE_DUMMY is not set +# CONFIG_IIO_SSP_SENSORHUB is not set +# CONFIG_IIO_ST_ACCEL_3AXIS is not set +# CONFIG_IIO_ST_GYRO_3AXIS is not set +# CONFIG_IIO_ST_LSM6DSX is not set +# CONFIG_IIO_ST_MAGN_3AXIS is not set +# CONFIG_IIO_ST_PRESS is not set +# CONFIG_IIO_SW_DEVICE is not set +# CONFIG_IIO_SW_TRIGGER is not set +# CONFIG_IIO_SYSFS_TRIGGER is not set +# CONFIG_IKCONFIG is not set +# CONFIG_IKCONFIG_PROC is not set +# CONFIG_IMAGE_CMDLINE_HACK is not set +# CONFIG_IMGPDC_WDT is not set +# CONFIG_IMG_MDC_DMA is not set +# CONFIG_IMX7D_ADC is not set +# CONFIG_IMX_IPUV3_CORE is not set +# CONFIG_IMX_THERMAL is not set +# CONFIG_INA2XX_ADC is not set +CONFIG_INET=y +# CONFIG_INET6_AH is not set +# CONFIG_INET6_ESP is not set +# CONFIG_INET6_IPCOMP is not set +# CONFIG_INET6_TUNNEL is not set +# CONFIG_INET6_XFRM_MODE_BEET is not set +# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set +# CONFIG_INET6_XFRM_MODE_TRANSPORT is not set +# CONFIG_INET6_XFRM_MODE_TUNNEL is not set +# CONFIG_INET6_XFRM_TUNNEL is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_DIAG is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_LRO is not set +# CONFIG_INET_TCP_DIAG is not set +# CONFIG_INET_TUNNEL is not set +# CONFIG_INET_UDP_DIAG is not set +# CONFIG_INET_XFRM_MODE_BEET is not set +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set +# CONFIG_INET_XFRM_MODE_TUNNEL is not set +# CONFIG_INET_XFRM_TUNNEL is not set +# CONFIG_INFINIBAND is not set +# CONFIG_INFTL is not set +CONFIG_INIT_ENV_ARG_LIMIT=32 +# CONFIG_INLINE_READ_LOCK is not set +# CONFIG_INLINE_READ_LOCK_BH is not set +# CONFIG_INLINE_READ_LOCK_IRQ is not set +# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set +# CONFIG_INLINE_READ_TRYLOCK is not set +CONFIG_INLINE_READ_UNLOCK=y +# CONFIG_INLINE_READ_UNLOCK_BH is not set +CONFIG_INLINE_READ_UNLOCK_IRQ=y +# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_SPIN_LOCK is not set +# CONFIG_INLINE_SPIN_LOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK_IRQ is not set +# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set +# CONFIG_INLINE_SPIN_TRYLOCK is not set +# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set +# CONFIG_INLINE_SPIN_UNLOCK_BH is not set +CONFIG_INLINE_SPIN_UNLOCK_IRQ=y +# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_WRITE_LOCK is not set +# CONFIG_INLINE_WRITE_LOCK_BH is not set +# CONFIG_INLINE_WRITE_LOCK_IRQ is not set +# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set +# CONFIG_INLINE_WRITE_TRYLOCK is not set +CONFIG_INLINE_WRITE_UNLOCK=y +# CONFIG_INLINE_WRITE_UNLOCK_BH is not set +CONFIG_INLINE_WRITE_UNLOCK_IRQ=y +# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set +CONFIG_INOTIFY_USER=y +# CONFIG_INPUT is not set +# CONFIG_INPUT_AD714X is not set +# CONFIG_INPUT_ADXL34X is not set +# CONFIG_INPUT_APANEL is not set +# CONFIG_INPUT_ATI_REMOTE2 is not set +# CONFIG_INPUT_ATLAS_BTNS is not set +# CONFIG_INPUT_ATMEL_CAPTOUCH is not set +# CONFIG_INPUT_BMA150 is not set +# CONFIG_INPUT_CM109 is not set +# CONFIG_INPUT_CMA3000 is not set +# CONFIG_INPUT_DRV260X_HAPTICS is not set +# CONFIG_INPUT_DRV2665_HAPTICS is not set +# CONFIG_INPUT_DRV2667_HAPTICS is not set +# CONFIG_INPUT_E3X0_BUTTON is not set +# CONFIG_INPUT_EVBUG is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_FF_MEMLESS is not set +# CONFIG_INPUT_GP2A is not set +# CONFIG_INPUT_GPIO_BEEPER is not set +# CONFIG_INPUT_GPIO_DECODER is not set +# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set +# CONFIG_INPUT_GPIO_TILT_POLLED is not set +# CONFIG_INPUT_IDEAPAD_SLIDEBAR is not set +# CONFIG_INPUT_IMS_PCU is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_KEYSPAN_REMOTE is not set +# CONFIG_INPUT_KXTJ9 is not set +# CONFIG_INPUT_LEDS is not set +# CONFIG_INPUT_MATRIXKMAP is not set +CONFIG_INPUT_MISC=y +# CONFIG_INPUT_MMA8450 is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_MPU3050 is not set +# CONFIG_INPUT_PALMAS_PWRBUTTON is not set +# CONFIG_INPUT_PCF8574 is not set +# CONFIG_INPUT_PCSPKR is not set +# CONFIG_INPUT_POLLDEV is not set +# CONFIG_INPUT_POWERMATE is not set +# CONFIG_INPUT_PWM_BEEPER is not set +# CONFIG_INPUT_PWM_VIBRA is not set +# CONFIG_INPUT_REGULATOR_HAPTIC is not set +# CONFIG_INPUT_SOC_BUTTON_ARRAY is not set +# CONFIG_INPUT_SPARSEKMAP is not set +# CONFIG_INPUT_TABLET is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_TPS65218_PWRBUTTON is not set +# CONFIG_INPUT_TWL4030_PWRBUTTON is not set +# CONFIG_INPUT_TWL4030_VIBRA is not set +# CONFIG_INPUT_TWL6040_VIBRA is not set +# CONFIG_INPUT_UINPUT is not set +# CONFIG_INPUT_WISTRON_BTNS is not set +# CONFIG_INPUT_YEALINK is not set +# CONFIG_INT340X_THERMAL is not set +# CONFIG_INTEL_CHT_INT33FE is not set +# CONFIG_INTEL_HID_EVENT is not set +# CONFIG_INTEL_IDLE is not set +# CONFIG_INTEL_IDMA64 is not set +# CONFIG_INTEL_IOATDMA is not set +# CONFIG_INTEL_ISH_HID is not set +# CONFIG_INTEL_MEI is not set +# CONFIG_INTEL_MEI_ME is not set +# CONFIG_INTEL_MEI_TXE is not set +# CONFIG_INTEL_MIC_CARD is not set +# CONFIG_INTEL_MIC_HOST is not set +# CONFIG_INTEL_MID_PTI is not set +# CONFIG_INTEL_OAKTRAIL is not set +# CONFIG_INTEL_PMC_CORE is not set +# CONFIG_INTEL_PUNIT_IPC is not set +# CONFIG_INTEL_RST is not set +# CONFIG_INTEL_SMARTCONNECT is not set +# CONFIG_INTEL_SOC_PMIC is not set +# CONFIG_INTEL_SOC_PMIC_CHTWC is not set +# CONFIG_INTEL_TH is not set +# CONFIG_INTEL_VBTN is not set +# CONFIG_INTEL_XWAY_PHY is not set +# CONFIG_INTERVAL_TREE_TEST is not set +# CONFIG_INV_MPU6050_I2C is not set +# CONFIG_INV_MPU6050_IIO is not set +# CONFIG_INV_MPU6050_SPI is not set +# CONFIG_IOMMU_SUPPORT is not set +# CONFIG_IOSCHED_BFQ is not set +# CONFIG_IOSCHED_CFQ is not set +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_NOOP=y +CONFIG_IO_STRICT_DEVMEM=y +# CONFIG_IP17XX_PHY is not set +# CONFIG_IP6_NF_FILTER is not set +# CONFIG_IP6_NF_IPTABLES is not set +# CONFIG_IP6_NF_MANGLE is not set +# CONFIG_IP6_NF_MATCH_AH is not set +# CONFIG_IP6_NF_MATCH_EUI64 is not set +# CONFIG_IP6_NF_MATCH_FRAG is not set +# CONFIG_IP6_NF_MATCH_HL is not set +# CONFIG_IP6_NF_MATCH_IPV6HEADER is not set +# CONFIG_IP6_NF_MATCH_MH is not set +# CONFIG_IP6_NF_MATCH_OPTS is not set +# CONFIG_IP6_NF_MATCH_RPFILTER is not set +# CONFIG_IP6_NF_MATCH_RT is not set +# CONFIG_IP6_NF_NAT is not set +# CONFIG_IP6_NF_RAW is not set +# CONFIG_IP6_NF_SECURITY is not set +# CONFIG_IP6_NF_TARGET_HL is not set +# CONFIG_IP6_NF_TARGET_REJECT is not set +# CONFIG_IP6_NF_TARGET_SYNPROXY is not set +# CONFIG_IPACK_BUS is not set +# CONFIG_IPC_NS is not set +# CONFIG_IPMI_HANDLER is not set +# CONFIG_IPV6 is not set +# CONFIG_IPV6_FOU is not set +# CONFIG_IPV6_FOU_TUNNEL is not set +# CONFIG_IPV6_ILA is not set +# CONFIG_IPV6_MIP6 is not set +# CONFIG_IPV6_MROUTE is not set +# CONFIG_IPV6_MROUTE_MULTIPLE_TABLES is not set +# CONFIG_IPV6_MULTIPLE_TABLES is not set +CONFIG_IPV6_NDISC_NODETYPE=y +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +# CONFIG_IPV6_ROUTER_PREF is not set +# CONFIG_IPV6_ROUTE_INFO is not set +# CONFIG_IPV6_SEG6_HMAC is not set +# CONFIG_IPV6_SEG6_LWTUNNEL is not set +# CONFIG_IPV6_SIT is not set +# CONFIG_IPV6_SIT_6RD is not set +# CONFIG_IPV6_TUNNEL is not set +# CONFIG_IPV6_VTI is not set +# CONFIG_IPVLAN is not set +# CONFIG_IPW2100 is not set +# CONFIG_IPW2100_DEBUG is not set +CONFIG_IPW2100_MONITOR=y +# CONFIG_IPW2200 is not set +# CONFIG_IPW2200_DEBUG is not set +CONFIG_IPW2200_MONITOR=y +# CONFIG_IPW2200_PROMISCUOUS is not set +# CONFIG_IPW2200_QOS is not set +# CONFIG_IPW2200_RADIOTAP is not set +# CONFIG_IPWIRELESS is not set +# CONFIG_IPX is not set +CONFIG_IP_ADVANCED_ROUTER=y +# CONFIG_IP_DCCP is not set +# CONFIG_IP_FIB_TRIE_STATS is not set +# CONFIG_IP_MROUTE is not set +CONFIG_IP_MROUTE_MULTIPLE_TABLES=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_MULTIPLE_TABLES=y +# CONFIG_IP_NF_ARPFILTER is not set +# CONFIG_IP_NF_ARPTABLES is not set +# CONFIG_IP_NF_ARP_MANGLE is not set +# CONFIG_IP_NF_FILTER is not set +# CONFIG_IP_NF_IPTABLES is not set +# CONFIG_IP_NF_MANGLE is not set +# CONFIG_IP_NF_MATCH_AH is not set +# CONFIG_IP_NF_MATCH_ECN is not set +# CONFIG_IP_NF_MATCH_RPFILTER is not set +# CONFIG_IP_NF_MATCH_TTL is not set +# CONFIG_IP_NF_RAW is not set +# CONFIG_IP_NF_SECURITY is not set +# CONFIG_IP_NF_TARGET_CLUSTERIP is not set +# CONFIG_IP_NF_TARGET_ECN is not set +# CONFIG_IP_NF_TARGET_MASQUERADE is not set +# CONFIG_IP_NF_TARGET_NETMAP is not set +# CONFIG_IP_NF_TARGET_REDIRECT is not set +# CONFIG_IP_NF_TARGET_REJECT is not set +# CONFIG_IP_NF_TARGET_SYNPROXY is not set +# CONFIG_IP_NF_TARGET_TTL is not set +# CONFIG_IP_PIMSM_V1 is not set +# CONFIG_IP_PIMSM_V2 is not set +# CONFIG_IP_PNP is not set +CONFIG_IP_ROUTE_MULTIPATH=y +CONFIG_IP_ROUTE_VERBOSE=y +# CONFIG_IP_SCTP is not set +# CONFIG_IP_SET is not set +# CONFIG_IP_SET_HASH_IPMAC is not set +# CONFIG_IP_VS is not set +# CONFIG_IRDA is not set +# CONFIG_IRQSOFF_TRACER is not set +# CONFIG_IRQ_ALL_CPUS is not set +# CONFIG_IRQ_DOMAIN_DEBUG is not set +# CONFIG_IRQ_POLL is not set +# CONFIG_IRQ_TIME_ACCOUNTING is not set +# CONFIG_IR_GPIO_CIR is not set +# CONFIG_IR_HIX5HD2 is not set +# CONFIG_IR_IGORPLUGUSB is not set +# CONFIG_IR_IGUANA is not set +# CONFIG_IR_IMG is not set +# CONFIG_IR_IMON is not set +# CONFIG_IR_JVC_DECODER is not set +# CONFIG_IR_LIRC_CODEC is not set +# CONFIG_IR_MCEUSB is not set +# CONFIG_IR_NEC_DECODER is not set +# CONFIG_IR_RC5_DECODER is not set +# CONFIG_IR_RC6_DECODER is not set +# CONFIG_IR_REDRAT3 is not set +# CONFIG_IR_SONY_DECODER is not set +# CONFIG_IR_STREAMZAP is not set +# CONFIG_IR_TTUSBIR is not set +# CONFIG_ISA_BUS is not set +# CONFIG_ISA_BUS_API is not set +# CONFIG_ISCSI_BOOT_SYSFS is not set +# CONFIG_ISCSI_TCP is not set +CONFIG_ISDN=y +# CONFIG_ISDN_AUDIO is not set +# CONFIG_ISDN_CAPI is not set +# CONFIG_ISDN_CAPI_CAPIDRV is not set +# CONFIG_ISDN_DIVERSION is not set +# CONFIG_ISDN_DRV_ACT2000 is not set +# CONFIG_ISDN_DRV_GIGASET is not set +# CONFIG_ISDN_DRV_HISAX is not set +# CONFIG_ISDN_DRV_ICN is not set +# CONFIG_ISDN_DRV_LOOP is not set +# CONFIG_ISDN_DRV_PCBIT is not set +# CONFIG_ISDN_DRV_SC is not set +# CONFIG_ISDN_I4L is not set +# CONFIG_ISL29003 is not set +# CONFIG_ISL29020 is not set +# CONFIG_ISL29125 is not set +# CONFIG_ISO9660_FS is not set +# CONFIG_ISS4xx is not set +# CONFIG_ITG3200 is not set +# CONFIG_IWL3945 is not set +# CONFIG_IWLWIFI is not set +# CONFIG_IXGB is not set +# CONFIG_IXGBE is not set +# CONFIG_IXGBEVF is not set +# CONFIG_JBD2_DEBUG is not set +# CONFIG_JFFS2_CMODE_FAVOURLZO is not set +# CONFIG_JFFS2_CMODE_NONE is not set +CONFIG_JFFS2_CMODE_PRIORITY=y +# CONFIG_JFFS2_CMODE_SIZE is not set +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_FS=y +CONFIG_JFFS2_FS_DEBUG=0 +# CONFIG_JFFS2_FS_POSIX_ACL is not set +# CONFIG_JFFS2_FS_SECURITY is not set +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +CONFIG_JFFS2_FS_WRITEBUFFER=y +CONFIG_JFFS2_FS_XATTR=y +CONFIG_JFFS2_LZMA=y +# CONFIG_JFFS2_LZO is not set +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set +CONFIG_JFFS2_SUMMARY=y +# CONFIG_JFFS2_ZLIB is not set +# CONFIG_JFS_DEBUG is not set +# CONFIG_JFS_FS is not set +# CONFIG_JFS_POSIX_ACL is not set +# CONFIG_JFS_SECURITY is not set +# CONFIG_JFS_STATISTICS is not set +# CONFIG_JME is not set +CONFIG_JOLIET=y +# CONFIG_JSA1212 is not set +# CONFIG_JUMP_LABEL is not set +# CONFIG_KALLSYMS is not set +# CONFIG_KALLSYMS_ABSOLUTE_PERCPU is not set +# CONFIG_KALLSYMS_ALL is not set +CONFIG_KALLSYMS_BASE_RELATIVE=y +# CONFIG_KALLSYMS_UNCOMPRESSED is not set +# CONFIG_KARMA_PARTITION is not set +# CONFIG_KASAN is not set +# CONFIG_KCOV is not set +# CONFIG_KERNEL_BZIP2 is not set +# CONFIG_KERNEL_CAT is not set +# CONFIG_KERNEL_GZIP is not set +# CONFIG_KERNEL_LZ4 is not set +# CONFIG_KERNEL_LZMA is not set +# CONFIG_KERNEL_LZO is not set +CONFIG_KERNEL_MODE_NEON=y +CONFIG_KERNEL_XZ=y +CONFIG_KERNFS=y +# CONFIG_KEXEC is not set +# CONFIG_KEXEC_FILE is not set +# CONFIG_KEYBOARD_ADC is not set +# CONFIG_KEYBOARD_ADP5588 is not set +# CONFIG_KEYBOARD_ADP5589 is not set +# CONFIG_KEYBOARD_ATKBD is not set +# CONFIG_KEYBOARD_BCM is not set +# CONFIG_KEYBOARD_CAP11XX is not set +# CONFIG_KEYBOARD_DLINK_DIR685 is not set +# CONFIG_KEYBOARD_GPIO is not set +# CONFIG_KEYBOARD_GPIO_POLLED is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_LM8323 is not set +# CONFIG_KEYBOARD_LM8333 is not set +# CONFIG_KEYBOARD_MATRIX is not set +# CONFIG_KEYBOARD_MAX7359 is not set +# CONFIG_KEYBOARD_MCS is not set +# CONFIG_KEYBOARD_MPR121 is not set +# CONFIG_KEYBOARD_NEWTON is not set +# CONFIG_KEYBOARD_OMAP4 is not set +# CONFIG_KEYBOARD_OPENCORES is not set +# CONFIG_KEYBOARD_PXA27x is not set +# CONFIG_KEYBOARD_QT1070 is not set +# CONFIG_KEYBOARD_QT2160 is not set +# CONFIG_KEYBOARD_SAMSUNG is not set +# CONFIG_KEYBOARD_SH_KEYSC is not set +# CONFIG_KEYBOARD_SNVS_PWRKEY is not set +# CONFIG_KEYBOARD_STOWAWAY is not set +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_TCA6416 is not set +# CONFIG_KEYBOARD_TCA8418 is not set +# CONFIG_KEYBOARD_TM2_TOUCHKEY is not set +# CONFIG_KEYBOARD_TWL4030 is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KEYS is not set +# CONFIG_KEY_DH_OPERATIONS is not set +# CONFIG_KGDB is not set +# CONFIG_KMEMCHECK is not set +# CONFIG_KMX61 is not set +# CONFIG_KPROBES is not set +# CONFIG_KPROBES_SANITY_TEST is not set +# CONFIG_KS7010 is not set +# CONFIG_KS8842 is not set +# CONFIG_KS8851 is not set +# CONFIG_KS8851_MLL is not set +# CONFIG_KSM is not set +# CONFIG_KSZ884X_PCI is not set +CONFIG_KUSER_HELPERS=y +# CONFIG_KVM_AMD is not set +# CONFIG_KVM_GUEST is not set +# CONFIG_KVM_INTEL is not set +# CONFIG_KXCJK1013 is not set +# CONFIG_KXSD9 is not set +# CONFIG_L2TP is not set +# CONFIG_L2TP_ETH is not set +# CONFIG_L2TP_IP is not set +# CONFIG_L2TP_V3 is not set +# CONFIG_LANMEDIA is not set +# CONFIG_LANTIQ is not set +# CONFIG_LAPB is not set +# CONFIG_LASAT is not set +# CONFIG_LATENCYTOP is not set +# CONFIG_LATTICE_ECP3_CONFIG is not set +CONFIG_LBDAF=y +# CONFIG_LCD_AMS369FG06 is not set +# CONFIG_LCD_HX8357 is not set +# CONFIG_LCD_ILI922X is not set +# CONFIG_LCD_ILI9320 is not set +# CONFIG_LCD_L4F00242T03 is not set +# CONFIG_LCD_LD9040 is not set +# CONFIG_LCD_LMS283GF05 is not set +# CONFIG_LCD_LMS501KF03 is not set +# CONFIG_LCD_LTV350QV is not set +# CONFIG_LCD_S6E63M0 is not set +# CONFIG_LCD_TDO24M is not set +# CONFIG_LCD_VGG2432A4 is not set +# CONFIG_LDM_PARTITION is not set +CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y +# CONFIG_LEDS_BCM6328 is not set +# CONFIG_LEDS_BCM6358 is not set +# CONFIG_LEDS_BD2802 is not set +# CONFIG_LEDS_BLINKM is not set +CONFIG_LEDS_BRIGHTNESS_HW_CHANGED=y +CONFIG_LEDS_CLASS=y +# CONFIG_LEDS_CLASS_FLASH is not set +# CONFIG_LEDS_DAC124S085 is not set +# CONFIG_LEDS_GPIO is not set +# CONFIG_LEDS_INTEL_SS4200 is not set +# CONFIG_LEDS_IS31FL319X is not set +# CONFIG_LEDS_IS31FL32XX is not set +# CONFIG_LEDS_LM3530 is not set +# CONFIG_LEDS_LM355x is not set +# CONFIG_LEDS_LM3642 is not set +# CONFIG_LEDS_LP3944 is not set +# CONFIG_LEDS_LP3952 is not set +# CONFIG_LEDS_LP5521 is not set +# CONFIG_LEDS_LP5523 is not set +# CONFIG_LEDS_LP5562 is not set +# CONFIG_LEDS_LP8501 is not set +# CONFIG_LEDS_LP8860 is not set +# CONFIG_LEDS_LT3593 is not set +# CONFIG_LEDS_MLXCPLD is not set +# CONFIG_LEDS_NIC78BX is not set +# CONFIG_LEDS_NS2 is not set +# CONFIG_LEDS_OT200 is not set +# CONFIG_LEDS_PCA9532 is not set +# CONFIG_LEDS_PCA955X is not set +# CONFIG_LEDS_PCA963X is not set +# CONFIG_LEDS_PWM is not set +# CONFIG_LEDS_REGULATOR is not set +# CONFIG_LEDS_SYSCON is not set +# CONFIG_LEDS_TCA6507 is not set +# CONFIG_LEDS_TLC591XX is not set +CONFIG_LEDS_TRIGGERS=y +# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set +# CONFIG_LEDS_TRIGGER_CAMERA is not set +# CONFIG_LEDS_TRIGGER_CPU is not set +CONFIG_LEDS_TRIGGER_DEFAULT_ON=y +# CONFIG_LEDS_TRIGGER_DISK is not set +# CONFIG_LEDS_TRIGGER_GPIO is not set +# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set +# CONFIG_LEDS_TRIGGER_IDE_DISK is not set +# CONFIG_LEDS_TRIGGER_MTD is not set +CONFIG_LEDS_TRIGGER_NETDEV=y +# CONFIG_LEDS_TRIGGER_ONESHOT is not set +# CONFIG_LEDS_TRIGGER_PANIC is not set +CONFIG_LEDS_TRIGGER_TIMER=y +# CONFIG_LEDS_TRIGGER_TRANSIENT is not set +# CONFIG_LEDS_USER is not set +# CONFIG_LED_TRIGGER_PHY is not set +# CONFIG_LEGACY_PTYS is not set +# CONFIG_LGUEST is not set +# CONFIG_LIB80211 is not set +# CONFIG_LIB80211_CRYPT_CCMP is not set +# CONFIG_LIB80211_CRYPT_TKIP is not set +# CONFIG_LIB80211_CRYPT_WEP is not set +# CONFIG_LIB80211_DEBUG is not set +# CONFIG_LIBCRC32C is not set +# CONFIG_LIBERTAS is not set +# CONFIG_LIBERTAS_THINFIRM is not set +# CONFIG_LIBERTAS_USB is not set +# CONFIG_LIBFC is not set +# CONFIG_LIBFCOE is not set +# CONFIG_LIBIPW_DEBUG is not set +# CONFIG_LIBNVDIMM is not set +# CONFIG_LIDAR_LITE_V2 is not set +# CONFIG_LIQUIDIO is not set +# CONFIG_LIQUIDIO_VF is not set +# CONFIG_LIRC_STAGING is not set +# CONFIG_LIS3L02DQ is not set +# CONFIG_LKDTM is not set +CONFIG_LLC=y +# CONFIG_LLC2 is not set +# CONFIG_LMP91000 is not set +# CONFIG_LNET is not set +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set +# CONFIG_LOCKD is not set +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_LOCKD_V4=y +# CONFIG_LOCKUP_DETECTOR is not set +# CONFIG_LOCK_STAT is not set +# CONFIG_LOCK_TORTURE_TEST is not set +# CONFIG_LOGFS is not set +# CONFIG_LOGIG940_FF is not set +# CONFIG_LOGIRUMBLEPAD2_FF is not set +# CONFIG_LOGITECH_FF is not set +# CONFIG_LOGIWHEELS_FF is not set +# CONFIG_LOGO is not set +CONFIG_LOG_BUF_SHIFT=17 +CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 +# CONFIG_LOONGSON_MC146818 is not set +# CONFIG_LPC_ICH is not set +# CONFIG_LPC_SCH is not set +# CONFIG_LP_CONSOLE is not set +# CONFIG_LSI_ET1011C_PHY is not set +# CONFIG_LTC2471 is not set +# CONFIG_LTC2485 is not set +# CONFIG_LTC2497 is not set +# CONFIG_LTC2632 is not set +# CONFIG_LTE_GDM724X is not set +# CONFIG_LTPC is not set +# CONFIG_LTR501 is not set +# CONFIG_LUSTRE_FS is not set +# CONFIG_LWTUNNEL is not set +# CONFIG_LXT_PHY is not set +# CONFIG_LZ4HC_COMPRESS is not set +# CONFIG_LZ4_COMPRESS is not set +# CONFIG_LZ4_DECOMPRESS is not set +CONFIG_LZMA_COMPRESS=y +CONFIG_LZMA_DECOMPRESS=y +# CONFIG_LZO_COMPRESS is not set +# CONFIG_LZO_DECOMPRESS is not set +# CONFIG_M62332 is not set +# CONFIG_MAC80211 is not set +# CONFIG_MAC80211_MESSAGE_TRACING is not set +CONFIG_MAC80211_STA_HASH_MAX_SIZE=0 +# CONFIG_MACB is not set +# CONFIG_MACH_ASM9260 is not set +# CONFIG_MACH_DECSTATION is not set +# CONFIG_MACH_INGENIC is not set +# CONFIG_MACH_JAZZ is not set +# CONFIG_MACH_JZ4740 is not set +# CONFIG_MACH_LOONGSON32 is not set +# CONFIG_MACH_LOONGSON64 is not set +# CONFIG_MACH_PIC32 is not set +# CONFIG_MACH_PISTACHIO is not set +# CONFIG_MACH_TX39XX is not set +# CONFIG_MACH_TX49XX is not set +# CONFIG_MACH_VR41XX is not set +# CONFIG_MACH_XILFPGA is not set +# CONFIG_MACINTOSH_DRIVERS is not set +# CONFIG_MACSEC is not set +# CONFIG_MACVLAN is not set +# CONFIG_MACVTAP is not set +# CONFIG_MAC_EMUMOUSEBTN is not set +# CONFIG_MAC_PARTITION is not set +# CONFIG_MAG3110 is not set +# CONFIG_MAGIC_SYSRQ is not set +CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1 +# CONFIG_MAGIC_SYSRQ_SERIAL is not set +# CONFIG_MAILBOX is not set +# CONFIG_MANDATORY_FILE_LOCKING is not set +# CONFIG_MANGLE_BOOTARGS is not set +# CONFIG_MARVELL_10G_PHY is not set +# CONFIG_MARVELL_PHY is not set +# CONFIG_MAX1027 is not set +# CONFIG_MAX11100 is not set +# CONFIG_MAX1118 is not set +# CONFIG_MAX1363 is not set +# CONFIG_MAX30100 is not set +# CONFIG_MAX30102 is not set +# CONFIG_MAX44000 is not set +# CONFIG_MAX517 is not set +# CONFIG_MAX5481 is not set +# CONFIG_MAX5487 is not set +# CONFIG_MAX5821 is not set +# CONFIG_MAX63XX_WATCHDOG is not set +# CONFIG_MAX9611 is not set +# CONFIG_MAXIM_THERMOCOUPLE is not set +CONFIG_MAY_USE_DEVLINK=y +# CONFIG_MC3230 is not set +# CONFIG_MCB is not set +# CONFIG_MCP320X is not set +# CONFIG_MCP3422 is not set +# CONFIG_MCP4131 is not set +# CONFIG_MCP4531 is not set +# CONFIG_MCP4725 is not set +# CONFIG_MCP4922 is not set +# CONFIG_MCPM is not set +# CONFIG_MD is not set +# CONFIG_MDIO_BCM_UNIMAC is not set +# CONFIG_MDIO_BITBANG is not set +# CONFIG_MDIO_BUS_MUX_GPIO is not set +# CONFIG_MDIO_BUS_MUX_MMIOREG is not set +# CONFIG_MDIO_DEVICE is not set +# CONFIG_MDIO_HISI_FEMAC is not set +# CONFIG_MDIO_OCTEON is not set +# CONFIG_MDIO_THUNDER is not set +# CONFIG_MD_FAULTY is not set +# CONFIG_MEDIA_ANALOG_TV_SUPPORT is not set +# CONFIG_MEDIA_ATTACH is not set +# CONFIG_MEDIA_CAMERA_SUPPORT is not set +# CONFIG_MEDIA_CEC_SUPPORT is not set +# CONFIG_MEDIA_CONTROLLER is not set +# CONFIG_MEDIA_DIGITAL_TV_SUPPORT is not set +# CONFIG_MEDIA_PCI_SUPPORT is not set +# CONFIG_MEDIA_RADIO_SUPPORT is not set +# CONFIG_MEDIA_RC_SUPPORT is not set +# CONFIG_MEDIA_SDR_SUPPORT is not set +# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set +# CONFIG_MEDIA_SUPPORT is not set +# CONFIG_MEDIA_USB_SUPPORT is not set +# CONFIG_MEGARAID_LEGACY is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_SAS is not set +CONFIG_MEMBARRIER=y +# CONFIG_MEMORY is not set +# CONFIG_MEMORY_FAILURE is not set +# CONFIG_MEMSTICK is not set +# CONFIG_MEMTEST is not set +# CONFIG_MEN_A21_WDT is not set +# CONFIG_MESON_SM is not set +CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 +# CONFIG_MFD_88PM800 is not set +# CONFIG_MFD_88PM805 is not set +# CONFIG_MFD_88PM860X is not set +# CONFIG_MFD_AAT2870_CORE is not set +# CONFIG_MFD_ACT8945A is not set +# CONFIG_MFD_ARIZONA_I2C is not set +# CONFIG_MFD_ARIZONA_SPI is not set +# CONFIG_MFD_AS3711 is not set +# CONFIG_MFD_AS3722 is not set +# CONFIG_MFD_ASIC3 is not set +# CONFIG_MFD_ATMEL_FLEXCOM is not set +# CONFIG_MFD_ATMEL_HLCDC is not set +# CONFIG_MFD_AXP20X is not set +# CONFIG_MFD_AXP20X_I2C is not set +# CONFIG_MFD_BCM590XX is not set +# CONFIG_MFD_BD9571MWV is not set +# CONFIG_MFD_CORE is not set +# CONFIG_MFD_CPCAP is not set +# CONFIG_MFD_CROS_EC is not set +# CONFIG_MFD_CS5535 is not set +# CONFIG_MFD_DA9052_I2C is not set +# CONFIG_MFD_DA9052_SPI is not set +# CONFIG_MFD_DA9055 is not set +# CONFIG_MFD_DA9062 is not set +# CONFIG_MFD_DA9063 is not set +# CONFIG_MFD_DA9150 is not set +# CONFIG_MFD_DLN2 is not set +# CONFIG_MFD_EXYNOS_LPASS is not set +# CONFIG_MFD_HI6421_PMIC is not set +# CONFIG_MFD_INTEL_QUARK_I2C_GPIO is not set +# CONFIG_MFD_JANZ_CMODIO is not set +# CONFIG_MFD_KEMPLD is not set +# CONFIG_MFD_LM3533 is not set +# CONFIG_MFD_LP3943 is not set +# CONFIG_MFD_LP8788 is not set +# CONFIG_MFD_MAX14577 is not set +# CONFIG_MFD_MAX77620 is not set +# CONFIG_MFD_MAX77686 is not set +# CONFIG_MFD_MAX77693 is not set +# CONFIG_MFD_MAX77843 is not set +# CONFIG_MFD_MAX8907 is not set +# CONFIG_MFD_MAX8925 is not set +# CONFIG_MFD_MAX8997 is not set +# CONFIG_MFD_MAX8998 is not set +# CONFIG_MFD_MC13XXX is not set +# CONFIG_MFD_MC13XXX_I2C is not set +# CONFIG_MFD_MC13XXX_SPI is not set +# CONFIG_MFD_MENF21BMC is not set +# CONFIG_MFD_MT6397 is not set +# CONFIG_MFD_OMAP_USB_HOST is not set +# CONFIG_MFD_PALMAS is not set +# CONFIG_MFD_PCF50633 is not set +# CONFIG_MFD_PM8921_CORE is not set +# CONFIG_MFD_PM8XXX is not set +# CONFIG_MFD_RC5T583 is not set +# CONFIG_MFD_RDC321X is not set +# CONFIG_MFD_RETU is not set +# CONFIG_MFD_RK808 is not set +# CONFIG_MFD_RN5T618 is not set +# CONFIG_MFD_RT5033 is not set +# CONFIG_MFD_RTSX_PCI is not set +# CONFIG_MFD_RTSX_USB is not set +# CONFIG_MFD_SEC_CORE is not set +# CONFIG_MFD_SI476X_CORE is not set +# CONFIG_MFD_SKY81452 is not set +# CONFIG_MFD_SM501 is not set +# CONFIG_MFD_SMSC is not set +# CONFIG_MFD_STMPE is not set +# CONFIG_MFD_SYSCON is not set +# CONFIG_MFD_T7L66XB is not set +# CONFIG_MFD_TC3589X is not set +# CONFIG_MFD_TC6387XB is not set +# CONFIG_MFD_TC6393XB is not set +# CONFIG_MFD_TIMBERDALE is not set +# CONFIG_MFD_TI_AM335X_TSCADC is not set +# CONFIG_MFD_TI_LMU is not set +# CONFIG_MFD_TI_LP873X is not set +# CONFIG_MFD_TI_LP87565 is not set +# CONFIG_MFD_TMIO is not set +# CONFIG_MFD_TPS65086 is not set +# CONFIG_MFD_TPS65090 is not set +# CONFIG_MFD_TPS65217 is not set +# CONFIG_MFD_TPS65218 is not set +# CONFIG_MFD_TPS6586X is not set +# CONFIG_MFD_TPS65910 is not set +# CONFIG_MFD_TPS65912 is not set +# CONFIG_MFD_TPS65912_I2C is not set +# CONFIG_MFD_TPS65912_SPI is not set +# CONFIG_MFD_TPS68470 is not set +# CONFIG_MFD_TPS80031 is not set +# CONFIG_MFD_VIPERBOARD is not set +# CONFIG_MFD_VX855 is not set +# CONFIG_MFD_WL1273_CORE is not set +# CONFIG_MFD_WM831X is not set +# CONFIG_MFD_WM831X_I2C is not set +# CONFIG_MFD_WM831X_SPI is not set +# CONFIG_MFD_WM8350_I2C is not set +# CONFIG_MFD_WM8400 is not set +# CONFIG_MFD_WM8994 is not set +# CONFIG_MG_DISK is not set +# CONFIG_MICREL_KS8995MA is not set +# CONFIG_MICREL_PHY is not set +# CONFIG_MICROCHIP_KSZ is not set +# CONFIG_MICROCHIP_PHY is not set +# CONFIG_MICROSEMI_PHY is not set +# CONFIG_MIGRATION is not set +CONFIG_MII=y +# CONFIG_MIKROTIK_RB532 is not set +# CONFIG_MINIX_FS is not set +# CONFIG_MINIX_FS_NATIVE_ENDIAN is not set +# CONFIG_MINIX_SUBPARTITION is not set +# CONFIG_MIPS_ALCHEMY is not set +# CONFIG_MIPS_CDMM is not set +# CONFIG_MIPS_COBALT is not set +# CONFIG_MIPS_FPU_EMULATOR is not set +# CONFIG_MIPS_GENERIC is not set +# CONFIG_MIPS_MALTA is not set +# CONFIG_MIPS_O32_FP64_SUPPORT is not set +# CONFIG_MIPS_PARAVIRT is not set +# CONFIG_MIPS_PLATFORM_DEVICES is not set +# CONFIG_MIPS_SEAD3 is not set +CONFIG_MISC_FILESYSTEMS=y +# CONFIG_MISDN is not set +# CONFIG_MISDN_AVMFRITZ is not set +# CONFIG_MISDN_HFCPCI is not set +# CONFIG_MISDN_HFCUSB is not set +# CONFIG_MISDN_INFINEON is not set +# CONFIG_MISDN_NETJET is not set +# CONFIG_MISDN_SPEEDFAX is not set +# CONFIG_MISDN_W6692 is not set +# CONFIG_MKISS is not set +# CONFIG_MLX4_CORE is not set +# CONFIG_MLX4_EN is not set +# CONFIG_MLX5_CORE is not set +# CONFIG_MLX90614 is not set +# CONFIG_MLXFW is not set +# CONFIG_MLXSW_CORE is not set +# CONFIG_MLX_CPLD_PLATFORM is not set +# CONFIG_MLX_PLATFORM is not set +# CONFIG_MMA7455_I2C is not set +# CONFIG_MMA7455_SPI is not set +# CONFIG_MMA7660 is not set +# CONFIG_MMA8452 is not set +# CONFIG_MMA9551 is not set +# CONFIG_MMA9553 is not set +# CONFIG_MMC is not set +# CONFIG_MMC35240 is not set +# CONFIG_MMC_ARMMMCI is not set +# CONFIG_MMC_AU1X is not set +# CONFIG_MMC_BLOCK is not set +CONFIG_MMC_BLOCK_BOUNCE=y +CONFIG_MMC_BLOCK_MINORS=8 +# CONFIG_MMC_CB710 is not set +# CONFIG_MMC_DEBUG is not set +# CONFIG_MMC_DW is not set +# CONFIG_MMC_MTK is not set +# CONFIG_MMC_MVSDIO is not set +# CONFIG_MMC_S3C is not set +# CONFIG_MMC_SDHCI is not set +# CONFIG_MMC_SDHCI_ACPI is not set +# CONFIG_MMC_SDHCI_BCM_KONA is not set +# CONFIG_MMC_SDHCI_CADENCE is not set +# CONFIG_MMC_SDHCI_F_SDH30 is not set +# CONFIG_MMC_SDHCI_IPROC is not set +# CONFIG_MMC_SDHCI_MSM is not set +# CONFIG_MMC_SDHCI_OF_ARASAN is not set +# CONFIG_MMC_SDHCI_OF_AT91 is not set +# CONFIG_MMC_SDHCI_OF_ESDHC is not set +# CONFIG_MMC_SDHCI_OF_HLWD is not set +# CONFIG_MMC_SDHCI_PXAV2 is not set +# CONFIG_MMC_SDHCI_PXAV3 is not set +# CONFIG_MMC_SDHCI_XENON is not set +# CONFIG_MMC_SDRICOH_CS is not set +# CONFIG_MMC_SPI is not set +# CONFIG_MMC_TEST is not set +# CONFIG_MMC_TOSHIBA_PCI is not set +# CONFIG_MMC_USDHI6ROL0 is not set +# CONFIG_MMC_USHC is not set +# CONFIG_MMC_VIA_SDMMC is not set +# CONFIG_MMC_VUB300 is not set +# CONFIG_MMIOTRACE is not set +CONFIG_MMU=y +CONFIG_MODULES=y +# CONFIG_MODULE_COMPRESS is not set +# CONFIG_MODULE_FORCE_LOAD is not set +# CONFIG_MODULE_FORCE_UNLOAD is not set +# CONFIG_MODULE_SIG is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_MODULE_STRIPPED=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODVERSIONS is not set +# CONFIG_MOST is not set +# CONFIG_MOUSE_APPLETOUCH is not set +# CONFIG_MOUSE_ELAN_I2C is not set +# CONFIG_MOUSE_GPIO is not set +# CONFIG_MOUSE_INPORT is not set +# CONFIG_MOUSE_LOGIBM is not set +# CONFIG_MOUSE_PC110PAD is not set +# CONFIG_MOUSE_PS2_FOCALTECH is not set +# CONFIG_MOUSE_PS2_SENTELIC is not set +# CONFIG_MOUSE_SYNAPTICS_I2C is not set +# CONFIG_MOUSE_SYNAPTICS_USB is not set +# CONFIG_MPL115 is not set +# CONFIG_MPL115_I2C is not set +# CONFIG_MPL115_SPI is not set +# CONFIG_MPL3115 is not set +# CONFIG_MPLS is not set +# CONFIG_MPU3050_I2C is not set +# CONFIG_MQ_IOSCHED_DEADLINE is not set +# CONFIG_MQ_IOSCHED_KYBER is not set +# CONFIG_MS5611 is not set +# CONFIG_MS5637 is not set +# CONFIG_MSDOS_FS is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_MSI_BITMAP_SELFTEST is not set +# CONFIG_MSI_LAPTOP is not set +CONFIG_MTD=y +# CONFIG_MTD_ABSENT is not set +# CONFIG_MTD_AFS_PARTS is not set +# CONFIG_MTD_AR7_PARTS is not set +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_BLOCK=y +# CONFIG_MTD_BLOCK2MTD is not set +CONFIG_MTD_CFI=y +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_CFI_AMDSTD=y +# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +CONFIG_MTD_CFI_INTELEXT=y +# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set +CONFIG_MTD_CFI_NOSWAP=y +# CONFIG_MTD_CFI_STAA is not set +CONFIG_MTD_CFI_UTIL=y +# CONFIG_MTD_CMDLINE_PARTS is not set +CONFIG_MTD_COMPLEX_MAPPINGS=y +# CONFIG_MTD_DATAFLASH is not set +# CONFIG_MTD_DOCG3 is not set +CONFIG_MTD_GEN_PROBE=y +# CONFIG_MTD_GPIO_ADDR is not set +# CONFIG_MTD_INTEL_VR_NOR is not set +# CONFIG_MTD_JEDECPROBE is not set +# CONFIG_MTD_LATCH_ADDR is not set +# CONFIG_MTD_LPDDR is not set +# CONFIG_MTD_LPDDR2_NVM is not set +# CONFIG_MTD_M25P80 is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +CONFIG_MTD_MAP_BANK_WIDTH_2=y +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MCHP23K256 is not set +# CONFIG_MTD_MT81xx_NOR is not set +# CONFIG_MTD_MTDRAM is not set +# CONFIG_MTD_MYLOADER_PARTS is not set +# CONFIG_MTD_NAND is not set +# CONFIG_MTD_NAND_AMS_DELTA is not set +# CONFIG_MTD_NAND_AR934X is not set +# CONFIG_MTD_NAND_AR934X_HW_ECC is not set +# CONFIG_MTD_NAND_ATMEL is not set +# CONFIG_MTD_NAND_AU1550 is not set +# CONFIG_MTD_NAND_BCH is not set +# CONFIG_MTD_NAND_BF5XX is not set +# CONFIG_MTD_NAND_BRCMNAND is not set +# CONFIG_MTD_NAND_CAFE is not set +# CONFIG_MTD_NAND_CM_X270 is not set +# CONFIG_MTD_NAND_CS553X is not set +# CONFIG_MTD_NAND_DAVINCI is not set +# CONFIG_MTD_NAND_DENALI is not set +# CONFIG_MTD_NAND_DENALI_DT is not set +# CONFIG_MTD_NAND_DENALI_PCI is not set +CONFIG_MTD_NAND_DENALI_SCRATCH_REG_ADDR=0xff108018 +# CONFIG_MTD_NAND_DISKONCHIP is not set +# CONFIG_MTD_NAND_DOCG4 is not set +# CONFIG_MTD_NAND_ECC is not set +# CONFIG_MTD_NAND_ECC_BCH is not set +# CONFIG_MTD_NAND_ECC_SMC is not set +# CONFIG_MTD_NAND_FSL_ELBC is not set +# CONFIG_MTD_NAND_FSL_IFC is not set +# CONFIG_MTD_NAND_FSL_UPM is not set +# CONFIG_MTD_NAND_FSMC is not set +# CONFIG_MTD_NAND_GPIO is not set +# CONFIG_MTD_NAND_GPMI_NAND is not set +# CONFIG_MTD_NAND_HISI504 is not set +CONFIG_MTD_NAND_IDS=y +# CONFIG_MTD_NAND_JZ4740 is not set +# CONFIG_MTD_NAND_MPC5121_NFC is not set +# CONFIG_MTD_NAND_MTK is not set +# CONFIG_MTD_NAND_MXC is not set +# CONFIG_MTD_NAND_NANDSIM is not set +# CONFIG_MTD_NAND_NDFC is not set +# CONFIG_MTD_NAND_NUC900 is not set +# CONFIG_MTD_NAND_OMAP2 is not set +# CONFIG_MTD_NAND_OMAP_BCH_BUILD is not set +# CONFIG_MTD_NAND_ORION is not set +# CONFIG_MTD_NAND_PASEMI is not set +# CONFIG_MTD_NAND_PLATFORM is not set +# CONFIG_MTD_NAND_PXA3xx is not set +# CONFIG_MTD_NAND_RB4XX is not set +# CONFIG_MTD_NAND_RB750 is not set +# CONFIG_MTD_NAND_RICOH is not set +# CONFIG_MTD_NAND_S3C2410 is not set +# CONFIG_MTD_NAND_SHARPSL is not set +# CONFIG_MTD_NAND_SH_FLCTL is not set +# CONFIG_MTD_NAND_SOCRATES is not set +# CONFIG_MTD_NAND_TMIO is not set +# CONFIG_MTD_NAND_TXX9NDFMC is not set +CONFIG_MTD_OF_PARTS=y +# CONFIG_MTD_ONENAND is not set +# CONFIG_MTD_OOPS is not set +# CONFIG_MTD_OTP is not set +# CONFIG_MTD_PARTITIONED_MASTER is not set +# CONFIG_MTD_PCI is not set +# CONFIG_MTD_PCMCIA is not set +# CONFIG_MTD_PHRAM is not set +# CONFIG_MTD_PHYSMAP is not set +# CONFIG_MTD_PHYSMAP_COMPAT is not set +CONFIG_MTD_PHYSMAP_OF=y +# CONFIG_MTD_PHYSMAP_OF_GEMINI is not set +# CONFIG_MTD_PHYSMAP_OF_VERSATILE is not set +# CONFIG_MTD_PLATRAM is not set +# CONFIG_MTD_PMC551 is not set +# CONFIG_MTD_RAM is not set +CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 +# CONFIG_MTD_REDBOOT_PARTS is not set +# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set +# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set +# CONFIG_MTD_ROM is not set +CONFIG_MTD_ROOTFS_ROOT_DEV=y +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_SM_COMMON is not set +# CONFIG_MTD_SPINAND_MT29F is not set +# CONFIG_MTD_SPI_NOR is not set +# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=4096 +CONFIG_MTD_SPLIT=y +# CONFIG_MTD_SPLIT_BRNIMAGE_FW is not set +# CONFIG_MTD_SPLIT_EVA_FW is not set +# CONFIG_MTD_SPLIT_FIRMWARE is not set +CONFIG_MTD_SPLIT_FIRMWARE_NAME="firmware" +# CONFIG_MTD_SPLIT_FIT_FW is not set +# CONFIG_MTD_SPLIT_LZMA_FW is not set +# CONFIG_MTD_SPLIT_MINOR_FW is not set +# CONFIG_MTD_SPLIT_SEAMA_FW is not set +CONFIG_MTD_SPLIT_SQUASHFS_ROOT=y +CONFIG_MTD_SPLIT_SUPPORT=y +# CONFIG_MTD_SPLIT_TPLINK_FW is not set +# CONFIG_MTD_SPLIT_TRX_FW is not set +# CONFIG_MTD_SPLIT_UIMAGE_FW is not set +# CONFIG_MTD_SPLIT_WRGG_FW is not set +# CONFIG_MTD_SST25L is not set +# CONFIG_MTD_SWAP is not set +# CONFIG_MTD_TESTS is not set +# CONFIG_MTD_UBI is not set +# CONFIG_MTD_UIMAGE_SPLIT is not set +CONFIG_MULTIUSER=y +# CONFIG_MUTEX_SPIN_ON_OWNER is not set +# CONFIG_MV643XX_ETH is not set +# CONFIG_MVMDIO is not set +# CONFIG_MVNETA_BM is not set +# CONFIG_MVSW61XX_PHY is not set +# CONFIG_MVSWITCH_PHY is not set +# CONFIG_MV_XOR_V2 is not set +# CONFIG_MWAVE is not set +# CONFIG_MWL8K is not set +# CONFIG_MXC4005 is not set +# CONFIG_MXC6255 is not set +# CONFIG_MYRI10GE is not set +# CONFIG_NAMESPACES is not set +# CONFIG_NATIONAL_PHY is not set +# CONFIG_NATSEMI is not set +# CONFIG_NAU7802 is not set +# CONFIG_NBPFAXI_DMA is not set +# CONFIG_NCP_FS is not set +# CONFIG_NE2000 is not set +# CONFIG_NE2K_PCI is not set +# CONFIG_NEC_MARKEINS is not set +CONFIG_NET=y +# CONFIG_NETCONSOLE is not set +CONFIG_NETDEVICES=y +# CONFIG_NETFILTER is not set +# CONFIG_NETFILTER_ADVANCED is not set +# CONFIG_NETFILTER_DEBUG is not set +# CONFIG_NETFILTER_INGRESS is not set +# CONFIG_NETFILTER_NETLINK is not set +# CONFIG_NETFILTER_NETLINK_ACCT is not set +# CONFIG_NETFILTER_NETLINK_GLUE_CT is not set +# CONFIG_NETFILTER_NETLINK_LOG is not set +# CONFIG_NETFILTER_NETLINK_QUEUE is not set +# CONFIG_NETFILTER_XTABLES is not set +# CONFIG_NETFILTER_XT_CONNMARK is not set +# CONFIG_NETFILTER_XT_MARK is not set +# CONFIG_NETFILTER_XT_MATCH_ADDRTYPE is not set +# CONFIG_NETFILTER_XT_MATCH_BPF is not set +# CONFIG_NETFILTER_XT_MATCH_CGROUP is not set +# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set +# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set +# CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set +# CONFIG_NETFILTER_XT_MATCH_CONNLABEL is not set +# CONFIG_NETFILTER_XT_MATCH_CONNLIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_CONNMARK is not set +# CONFIG_NETFILTER_XT_MATCH_CONNTRACK is not set +# CONFIG_NETFILTER_XT_MATCH_CPU is not set +# CONFIG_NETFILTER_XT_MATCH_DCCP is not set +# CONFIG_NETFILTER_XT_MATCH_DEVGROUP is not set +# CONFIG_NETFILTER_XT_MATCH_DSCP is not set +# CONFIG_NETFILTER_XT_MATCH_ECN is not set +# CONFIG_NETFILTER_XT_MATCH_ESP is not set +# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_HELPER is not set +# CONFIG_NETFILTER_XT_MATCH_HL is not set +# CONFIG_NETFILTER_XT_MATCH_IPCOMP is not set +# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set +# CONFIG_NETFILTER_XT_MATCH_L2TP is not set +# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set +# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_MAC is not set +# CONFIG_NETFILTER_XT_MATCH_MARK is not set +# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set +# CONFIG_NETFILTER_XT_MATCH_NFACCT is not set +# CONFIG_NETFILTER_XT_MATCH_OSF is not set +# CONFIG_NETFILTER_XT_MATCH_OWNER is not set +# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set +# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set +# CONFIG_NETFILTER_XT_MATCH_POLICY is not set +# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set +# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set +# CONFIG_NETFILTER_XT_MATCH_REALM is not set +# CONFIG_NETFILTER_XT_MATCH_RECENT is not set +# CONFIG_NETFILTER_XT_MATCH_SCTP is not set +# CONFIG_NETFILTER_XT_MATCH_SOCKET is not set +# CONFIG_NETFILTER_XT_MATCH_STATE is not set +# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set +# CONFIG_NETFILTER_XT_MATCH_STRING is not set +# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set +# CONFIG_NETFILTER_XT_MATCH_TIME is not set +# CONFIG_NETFILTER_XT_MATCH_U32 is not set +# CONFIG_NETFILTER_XT_TARGET_AUDIT is not set +# CONFIG_NETFILTER_XT_TARGET_CHECKSUM is not set +# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set +# CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set +# CONFIG_NETFILTER_XT_TARGET_CT is not set +# CONFIG_NETFILTER_XT_TARGET_DSCP is not set +# CONFIG_NETFILTER_XT_TARGET_HL is not set +# CONFIG_NETFILTER_XT_TARGET_HMARK is not set +# CONFIG_NETFILTER_XT_TARGET_IDLETIMER is not set +# CONFIG_NETFILTER_XT_TARGET_LED is not set +# CONFIG_NETFILTER_XT_TARGET_LOG is not set +# CONFIG_NETFILTER_XT_TARGET_MARK is not set +# CONFIG_NETFILTER_XT_TARGET_NETMAP is not set +# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set +# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set +# CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set +# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set +# CONFIG_NETFILTER_XT_TARGET_REDIRECT is not set +# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set +# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set +# CONFIG_NETFILTER_XT_TARGET_TEE is not set +# CONFIG_NETFILTER_XT_TARGET_TPROXY is not set +# CONFIG_NETFILTER_XT_TARGET_TRACE is not set +# CONFIG_NETLINK_DIAG is not set +# CONFIG_NETLINK_MMAP is not set +# CONFIG_NETPOLL is not set +# CONFIG_NETROM is not set +CONFIG_NETWORK_FILESYSTEMS=y +# CONFIG_NETWORK_PHY_TIMESTAMPING is not set +# CONFIG_NETWORK_SECMARK is not set +# CONFIG_NETXEN_NIC is not set +# CONFIG_NET_9P is not set +# CONFIG_NET_ACT_BPF is not set +# CONFIG_NET_ACT_CSUM is not set +# CONFIG_NET_ACT_GACT is not set +# CONFIG_NET_ACT_IFE is not set +# CONFIG_NET_ACT_IPT is not set +# CONFIG_NET_ACT_MIRRED is not set +# CONFIG_NET_ACT_NAT is not set +# CONFIG_NET_ACT_PEDIT is not set +# CONFIG_NET_ACT_POLICE is not set +# CONFIG_NET_ACT_SAMPLE is not set +# CONFIG_NET_ACT_SIMP is not set +# CONFIG_NET_ACT_SKBEDIT is not set +# CONFIG_NET_ACT_SKBMOD is not set +# CONFIG_NET_ACT_TUNNEL_KEY is not set +# CONFIG_NET_ACT_VLAN is not set +CONFIG_NET_CADENCE=y +# CONFIG_NET_CALXEDA_XGMAC is not set +CONFIG_NET_CLS=y +# CONFIG_NET_CLS_ACT is not set +# CONFIG_NET_CLS_BASIC is not set +# CONFIG_NET_CLS_BPF is not set +# CONFIG_NET_CLS_FLOW is not set +# CONFIG_NET_CLS_FLOWER is not set +# CONFIG_NET_CLS_FW is not set +CONFIG_NET_CLS_IND=y +# CONFIG_NET_CLS_MATCHALL is not set +# CONFIG_NET_CLS_ROUTE4 is not set +# CONFIG_NET_CLS_RSVP is not set +# CONFIG_NET_CLS_RSVP6 is not set +# CONFIG_NET_CLS_TCINDEX is not set +# CONFIG_NET_CLS_U32 is not set +CONFIG_NET_CORE=y +# CONFIG_NET_DEVLINK is not set +# CONFIG_NET_DROP_MONITOR is not set +# CONFIG_NET_DSA is not set +# CONFIG_NET_DSA_BCM_SF2 is not set +# CONFIG_NET_DSA_LOOP is not set +# CONFIG_NET_DSA_MT7530 is not set +# CONFIG_NET_DSA_MV88E6060 is not set +# CONFIG_NET_DSA_MV88E6123_61_65 is not set +# CONFIG_NET_DSA_MV88E6131 is not set +# CONFIG_NET_DSA_MV88E6171 is not set +# CONFIG_NET_DSA_MV88E6352 is not set +# CONFIG_NET_DSA_MV88E6XXX is not set +# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set +# CONFIG_NET_DSA_QCA8K is not set +# CONFIG_NET_DSA_SMSC_LAN9303_MDIO is not set +# CONFIG_NET_DSA_TAG_DSA is not set +# CONFIG_NET_DSA_TAG_EDSA is not set +# CONFIG_NET_EMATCH is not set +# CONFIG_NET_EMATCH_CANID is not set +# CONFIG_NET_EMATCH_CMP is not set +# CONFIG_NET_EMATCH_META is not set +# CONFIG_NET_EMATCH_NBYTE is not set +CONFIG_NET_EMATCH_STACK=32 +# CONFIG_NET_EMATCH_TEXT is not set +# CONFIG_NET_EMATCH_U32 is not set +# CONFIG_NET_FC is not set +# CONFIG_NET_FOU is not set +# CONFIG_NET_FOU_IP_TUNNELS is not set +# CONFIG_NET_IFE is not set +# CONFIG_NET_IPGRE is not set +CONFIG_NET_IPGRE_BROADCAST=y +# CONFIG_NET_IPGRE_DEMUX is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPVTI is not set +# CONFIG_NET_IP_TUNNEL is not set +# CONFIG_NET_KEY is not set +# CONFIG_NET_KEY_MIGRATE is not set +# CONFIG_NET_L3_MASTER_DEV is not set +# CONFIG_NET_MPLS_GSO is not set +# CONFIG_NET_NCSI is not set +# CONFIG_NET_NSH is not set +# CONFIG_NET_PACKET_ENGINE is not set +# CONFIG_NET_PKTGEN is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_NET_PTP_CLASSIFY is not set +CONFIG_NET_RX_BUSY_POLL=y +# CONFIG_NET_SB1000 is not set +CONFIG_NET_SCHED=y +# CONFIG_NET_SCH_ATM is not set +# CONFIG_NET_SCH_CBQ is not set +# CONFIG_NET_SCH_CHOKE is not set +# CONFIG_NET_SCH_CODEL is not set +# CONFIG_NET_SCH_DEFAULT is not set +# CONFIG_NET_SCH_DRR is not set +# CONFIG_NET_SCH_DSMARK is not set +CONFIG_NET_SCH_FIFO=y +# CONFIG_NET_SCH_FQ is not set +CONFIG_NET_SCH_FQ_CODEL=y +# CONFIG_NET_SCH_GRED is not set +# CONFIG_NET_SCH_HFSC is not set +# CONFIG_NET_SCH_HHF is not set +# CONFIG_NET_SCH_HTB is not set +# CONFIG_NET_SCH_INGRESS is not set +# CONFIG_NET_SCH_MQPRIO is not set +# CONFIG_NET_SCH_MULTIQ is not set +# CONFIG_NET_SCH_NETEM is not set +# CONFIG_NET_SCH_PIE is not set +# CONFIG_NET_SCH_PLUG is not set +# CONFIG_NET_SCH_PRIO is not set +# CONFIG_NET_SCH_QFQ is not set +# CONFIG_NET_SCH_RED is not set +# CONFIG_NET_SCH_SFB is not set +# CONFIG_NET_SCH_SFQ is not set +# CONFIG_NET_SCH_TBF is not set +# CONFIG_NET_SCH_TEQL is not set +# CONFIG_NET_SCTPPROBE is not set +# CONFIG_NET_SWITCHDEV is not set +# CONFIG_NET_TCPPROBE is not set +# CONFIG_NET_TEAM is not set +# CONFIG_NET_TULIP is not set +# CONFIG_NET_UDP_TUNNEL is not set +CONFIG_NET_VENDOR_3COM=y +CONFIG_NET_VENDOR_8390=y +CONFIG_NET_VENDOR_ADAPTEC=y +CONFIG_NET_VENDOR_AGERE=y +CONFIG_NET_VENDOR_ALACRITECH=y +CONFIG_NET_VENDOR_ALTEON=y +CONFIG_NET_VENDOR_AMAZON=y +CONFIG_NET_VENDOR_AMD=y +CONFIG_NET_VENDOR_AQUANTIA=y +CONFIG_NET_VENDOR_ARC=y +CONFIG_NET_VENDOR_ATHEROS=y +CONFIG_NET_VENDOR_AURORA=y +CONFIG_NET_VENDOR_BROADCOM=y +CONFIG_NET_VENDOR_BROCADE=y +CONFIG_NET_VENDOR_CAVIUM=y +CONFIG_NET_VENDOR_CHELSIO=y +CONFIG_NET_VENDOR_CIRRUS=y +CONFIG_NET_VENDOR_CISCO=y +CONFIG_NET_VENDOR_DEC=y +CONFIG_NET_VENDOR_DLINK=y +CONFIG_NET_VENDOR_EMULEX=y +CONFIG_NET_VENDOR_EXAR=y +CONFIG_NET_VENDOR_EZCHIP=y +CONFIG_NET_VENDOR_FARADAY=y +CONFIG_NET_VENDOR_FREESCALE=y +CONFIG_NET_VENDOR_FUJITSU=y +CONFIG_NET_VENDOR_HISILICON=y +CONFIG_NET_VENDOR_HP=y +CONFIG_NET_VENDOR_HUAWEI=y +CONFIG_NET_VENDOR_I825XX=y +CONFIG_NET_VENDOR_IBM=y +CONFIG_NET_VENDOR_INTEL=y +CONFIG_NET_VENDOR_MARVELL=y +CONFIG_NET_VENDOR_MELLANOX=y +CONFIG_NET_VENDOR_MICREL=y +CONFIG_NET_VENDOR_MICROCHIP=y +CONFIG_NET_VENDOR_MYRI=y +CONFIG_NET_VENDOR_NATSEMI=y +CONFIG_NET_VENDOR_NETRONOME=y +CONFIG_NET_VENDOR_NVIDIA=y +CONFIG_NET_VENDOR_OKI=y +CONFIG_NET_VENDOR_QLOGIC=y +CONFIG_NET_VENDOR_QUALCOMM=y +CONFIG_NET_VENDOR_RDC=y +CONFIG_NET_VENDOR_REALTEK=y +CONFIG_NET_VENDOR_RENESAS=y +CONFIG_NET_VENDOR_ROCKER=y +CONFIG_NET_VENDOR_SAMSUNG=y +CONFIG_NET_VENDOR_SEEQ=y +CONFIG_NET_VENDOR_SILAN=y +CONFIG_NET_VENDOR_SIS=y +CONFIG_NET_VENDOR_SMSC=y +CONFIG_NET_VENDOR_SOLARFLARE=y +CONFIG_NET_VENDOR_STMICRO=y +CONFIG_NET_VENDOR_SUN=y +CONFIG_NET_VENDOR_SYNOPSYS=y +CONFIG_NET_VENDOR_TEHUTI=y +CONFIG_NET_VENDOR_TI=y +CONFIG_NET_VENDOR_TOSHIBA=y +CONFIG_NET_VENDOR_VIA=y +CONFIG_NET_VENDOR_WIZNET=y +CONFIG_NET_VENDOR_XILINX=y +CONFIG_NET_VENDOR_XIRCOM=y +# CONFIG_NET_VRF is not set +# CONFIG_NET_XGENE is not set +CONFIG_NEW_LEDS=y +# CONFIG_NFC is not set +# CONFIG_NFP is not set +# CONFIG_NFSD is not set +# CONFIG_NFSD_V2_ACL is not set +CONFIG_NFSD_V3=y +# CONFIG_NFSD_V3_ACL is not set +# CONFIG_NFSD_V4 is not set +# CONFIG_NFS_ACL_SUPPORT is not set +CONFIG_NFS_COMMON=y +# CONFIG_NFS_FS is not set +# CONFIG_NFS_FSCACHE is not set +# CONFIG_NFS_SWAP is not set +# CONFIG_NFS_V2 is not set +CONFIG_NFS_V3=y +# CONFIG_NFS_V3_ACL is not set +# CONFIG_NFS_V4 is not set +# CONFIG_NFS_V4_1 is not set +# CONFIG_NFTL is not set +# CONFIG_NFT_BRIDGE_META is not set +# CONFIG_NFT_BRIDGE_REJECT is not set +# CONFIG_NFT_DUP_IPV4 is not set +# CONFIG_NFT_DUP_IPV6 is not set +# CONFIG_NFT_FIB_IPV4 is not set +# CONFIG_NFT_FIB_IPV6 is not set +# CONFIG_NFT_OBJREF is not set +# CONFIG_NFT_RT is not set +# CONFIG_NFT_SET_BITMAP is not set +# CONFIG_NF_CONNTRACK is not set +# CONFIG_NF_CONNTRACK_AMANDA is not set +# CONFIG_NF_CONNTRACK_EVENTS is not set +# CONFIG_NF_CONNTRACK_FTP is not set +# CONFIG_NF_CONNTRACK_H323 is not set +# CONFIG_NF_CONNTRACK_IPV4 is not set +# CONFIG_NF_CONNTRACK_IPV6 is not set +# CONFIG_NF_CONNTRACK_IRC is not set +# CONFIG_NF_CONNTRACK_MARK is not set +# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set +# CONFIG_NF_CONNTRACK_PPTP is not set +CONFIG_NF_CONNTRACK_PROCFS=y +# CONFIG_NF_CONNTRACK_PROC_COMPAT is not set +# CONFIG_NF_CONNTRACK_SANE is not set +# CONFIG_NF_CONNTRACK_SIP is not set +# CONFIG_NF_CONNTRACK_SNMP is not set +# CONFIG_NF_CONNTRACK_TFTP is not set +# CONFIG_NF_CONNTRACK_TIMEOUT is not set +# CONFIG_NF_CONNTRACK_TIMESTAMP is not set +# CONFIG_NF_CONNTRACK_ZONES is not set +# CONFIG_NF_CT_NETLINK is not set +# CONFIG_NF_CT_NETLINK_TIMEOUT is not set +# CONFIG_NF_CT_PROTO_DCCP is not set +# CONFIG_NF_CT_PROTO_GRE is not set +# CONFIG_NF_CT_PROTO_SCTP is not set +# CONFIG_NF_CT_PROTO_UDPLITE is not set +# CONFIG_NF_DEFRAG_IPV4 is not set +# CONFIG_NF_DUP_IPV4 is not set +# CONFIG_NF_DUP_IPV6 is not set +# CONFIG_NF_LOG_ARP is not set +# CONFIG_NF_LOG_IPV4 is not set +# CONFIG_NF_LOG_NETDEV is not set +# CONFIG_NF_NAT is not set +# CONFIG_NF_NAT_AMANDA is not set +# CONFIG_NF_NAT_FTP is not set +# CONFIG_NF_NAT_H323 is not set +# CONFIG_NF_NAT_IPV6 is not set +# CONFIG_NF_NAT_IRC is not set +# CONFIG_NF_NAT_MASQUERADE_IPV4 is not set +# CONFIG_NF_NAT_MASQUERADE_IPV6 is not set +# CONFIG_NF_NAT_NEEDED is not set +# CONFIG_NF_NAT_PPTP is not set +# CONFIG_NF_NAT_PROTO_GRE is not set +# CONFIG_NF_NAT_SIP is not set +# CONFIG_NF_NAT_SNMP_BASIC is not set +# CONFIG_NF_NAT_TFTP is not set +# CONFIG_NF_REJECT_IPV4 is not set +# CONFIG_NF_REJECT_IPV6 is not set +# CONFIG_NF_SOCKET_IPV4 is not set +# CONFIG_NF_SOCKET_IPV6 is not set +# CONFIG_NF_TABLES is not set +# CONFIG_NF_TABLES_NETDEV is not set +# CONFIG_NI65 is not set +# CONFIG_NI903X_WDT is not set +# CONFIG_NIC7018_WDT is not set +# CONFIG_NILFS2_FS is not set +# CONFIG_NIU is not set +CONFIG_NLATTR=y +# CONFIG_NLMON is not set +# CONFIG_NLM_XLP_BOARD is not set +# CONFIG_NLM_XLR_BOARD is not set +# CONFIG_NLS is not set +# CONFIG_NLS_ASCII is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +CONFIG_NLS_DEFAULT="iso8859-1" +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_MAC_CELTIC is not set +# CONFIG_NLS_MAC_CENTEURO is not set +# CONFIG_NLS_MAC_CROATIAN is not set +# CONFIG_NLS_MAC_CYRILLIC is not set +# CONFIG_NLS_MAC_GAELIC is not set +# CONFIG_NLS_MAC_GREEK is not set +# CONFIG_NLS_MAC_ICELAND is not set +# CONFIG_NLS_MAC_INUIT is not set +# CONFIG_NLS_MAC_ROMAN is not set +# CONFIG_NLS_MAC_ROMANIAN is not set +# CONFIG_NLS_MAC_TURKISH is not set +# CONFIG_NLS_UTF8 is not set +CONFIG_NMI_LOG_BUF_SHIFT=13 +# CONFIG_NOP_USB_XCEIV is not set +# CONFIG_NORTEL_HERMES is not set +# CONFIG_NOTIFIER_ERROR_INJECTION is not set +# CONFIG_NOZOMI is not set +# CONFIG_NO_BOOTMEM is not set +# CONFIG_NO_HZ is not set +# CONFIG_NO_HZ_FULL is not set +# CONFIG_NO_HZ_IDLE is not set +# CONFIG_NS83820 is not set +# CONFIG_NTB is not set +# CONFIG_NTFS_DEBUG is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_NTP_PPS is not set +# CONFIG_NVM is not set +# CONFIG_NVMEM is not set +# CONFIG_NVMEM_IMX_OCOTP is not set +# CONFIG_NVME_FC is not set +# CONFIG_NVME_TARGET is not set +# CONFIG_NVRAM is not set +# CONFIG_NV_TCO is not set +# CONFIG_NXP_STB220 is not set +# CONFIG_NXP_STB225 is not set +# CONFIG_N_GSM is not set +# CONFIG_OABI_COMPAT is not set +# CONFIG_OBS600 is not set +# CONFIG_OCFS2_FS is not set +# CONFIG_OF_OVERLAY is not set +# CONFIG_OF_UNITTEST is not set +# CONFIG_OMAP2_DSS_DEBUG is not set +# CONFIG_OMAP2_DSS_DEBUGFS is not set +# CONFIG_OMAP2_DSS_SDI is not set +# CONFIG_OMAP_OCP2SCP is not set +# CONFIG_OMAP_USB2 is not set +# CONFIG_OMFS_FS is not set +# CONFIG_OPENVSWITCH is not set +# CONFIG_OPROFILE is not set +# CONFIG_OPROFILE_EVENT_MULTIPLEX is not set +# CONFIG_OPT3001 is not set +# CONFIG_ORANGEFS_FS is not set +# CONFIG_ORION_WATCHDOG is not set +# CONFIG_OSF_PARTITION is not set +CONFIG_OVERLAY_FS=y +# CONFIG_OVERLAY_FS_INDEX is not set +# CONFIG_OVERLAY_FS_REDIRECT_DIR is not set +# CONFIG_OWL_LOADER is not set +# CONFIG_P54_COMMON is not set +# CONFIG_PA12203001 is not set +CONFIG_PACKET=y +# CONFIG_PACKET_DIAG is not set +# CONFIG_PAGE_EXTENSION is not set +# CONFIG_PAGE_OWNER is not set +# CONFIG_PAGE_POISONING is not set +# CONFIG_PAGE_SIZE_16KB is not set +# CONFIG_PAGE_SIZE_32KB is not set +CONFIG_PAGE_SIZE_4KB=y +# CONFIG_PAGE_SIZE_64KB is not set +# CONFIG_PAGE_SIZE_8KB is not set +# CONFIG_PALMAS_GPADC is not set +# CONFIG_PANASONIC_LAPTOP is not set +# CONFIG_PANEL is not set +CONFIG_PANIC_ON_OOPS=y +CONFIG_PANIC_ON_OOPS_VALUE=1 +CONFIG_PANIC_TIMEOUT=1 +# CONFIG_PANTHERLORD_FF is not set +# CONFIG_PARAVIRT is not set +# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set +# CONFIG_PARPORT is not set +# CONFIG_PARPORT_1284 is not set +# CONFIG_PARPORT_AX88796 is not set +# CONFIG_PARPORT_GSC is not set +# CONFIG_PARPORT_PC is not set +CONFIG_PARTITION_ADVANCED=y +# CONFIG_PATA_ALI is not set +# CONFIG_PATA_AMD is not set +# CONFIG_PATA_ARASAN_CF is not set +# CONFIG_PATA_ARTOP is not set +# CONFIG_PATA_ATIIXP is not set +# CONFIG_PATA_ATP867X is not set +# CONFIG_PATA_CMD640_PCI is not set +# CONFIG_PATA_CMD64X is not set +# CONFIG_PATA_CS5520 is not set +# CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CS5535 is not set +# CONFIG_PATA_CS5536 is not set +# CONFIG_PATA_CYPRESS is not set +# CONFIG_PATA_EFAR is not set +# CONFIG_PATA_HPT366 is not set +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +# CONFIG_PATA_HPT3X3 is not set +# CONFIG_PATA_IMX is not set +# CONFIG_PATA_ISAPNP is not set +# CONFIG_PATA_IT8213 is not set +# CONFIG_PATA_IT821X is not set +# CONFIG_PATA_JMICRON is not set +# CONFIG_PATA_LEGACY is not set +# CONFIG_PATA_MARVELL is not set +# CONFIG_PATA_MPIIX is not set +# CONFIG_PATA_NETCELL is not set +# CONFIG_PATA_NINJA32 is not set +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_NS87415 is not set +# CONFIG_PATA_OCTEON_CF is not set +# CONFIG_PATA_OF_PLATFORM is not set +# CONFIG_PATA_OLDPIIX is not set +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_OPTIDMA is not set +# CONFIG_PATA_PCMCIA is not set +# CONFIG_PATA_PDC2027X is not set +# CONFIG_PATA_PDC_OLD is not set +# CONFIG_PATA_PLATFORM is not set +# CONFIG_PATA_QDI is not set +# CONFIG_PATA_RADISYS is not set +# CONFIG_PATA_RDC is not set +# CONFIG_PATA_RZ1000 is not set +# CONFIG_PATA_SC1200 is not set +# CONFIG_PATA_SCH is not set +# CONFIG_PATA_SERVERWORKS is not set +# CONFIG_PATA_SIL680 is not set +# CONFIG_PATA_SIS is not set +# CONFIG_PATA_TOSHIBA is not set +# CONFIG_PATA_TRIFLEX is not set +# CONFIG_PATA_VIA is not set +# CONFIG_PATA_WINBOND is not set +# CONFIG_PATA_WINBOND_VLB is not set +# CONFIG_PC104 is not set +# CONFIG_PC300TOO is not set +# CONFIG_PCCARD is not set +# CONFIG_PCH_DMA is not set +# CONFIG_PCH_GBE is not set +# CONFIG_PCH_PHUB is not set +# CONFIG_PCI is not set +# CONFIG_PCI200SYN is not set +# CONFIG_PCIEAER_INJECT is not set +# CONFIG_PCIEASPM is not set +# CONFIG_PCIEPORTBUS is not set +# CONFIG_PCIE_ALTERA is not set +# CONFIG_PCIE_ARMADA_8K is not set +# CONFIG_PCIE_DPC is not set +# CONFIG_PCIE_DW_PLAT is not set +# CONFIG_PCIE_ECRC is not set +# CONFIG_PCIE_IPROC is not set +# CONFIG_PCIE_PTM is not set +# CONFIG_PCIPCWATCHDOG is not set +# CONFIG_PCI_ATMEL is not set +# CONFIG_PCI_CNB20LE_QUIRK is not set +# CONFIG_PCI_DEBUG is not set +# CONFIG_PCI_DISABLE_COMMON_QUIRKS is not set +# CONFIG_PCI_ENDPOINT is not set +# CONFIG_PCI_ENDPOINT_TEST is not set +# CONFIG_PCI_FTPCI100 is not set +# CONFIG_PCI_HERMES is not set +# CONFIG_PCI_HOST_GENERIC is not set +# CONFIG_PCI_HOST_THUNDER_ECAM is not set +# CONFIG_PCI_HOST_THUNDER_PEM is not set +# CONFIG_PCI_IOV is not set +# CONFIG_PCI_LAYERSCAPE is not set +# CONFIG_PCI_MSI is not set +# CONFIG_PCI_PASID is not set +# CONFIG_PCI_PRI is not set +CONFIG_PCI_QUIRKS=y +# CONFIG_PCI_REALLOC_ENABLE_AUTO is not set +# CONFIG_PCI_STUB is not set +# CONFIG_PCI_SW_SWITCHTEC is not set +CONFIG_PCI_SYSCALL=y +# CONFIG_PCMCIA is not set +# CONFIG_PCMCIA_3C574 is not set +# CONFIG_PCMCIA_3C589 is not set +# CONFIG_PCMCIA_AHA152X is not set +# CONFIG_PCMCIA_ATMEL is not set +# CONFIG_PCMCIA_AXNET is not set +# CONFIG_PCMCIA_DEBUG is not set +# CONFIG_PCMCIA_FDOMAIN is not set +# CONFIG_PCMCIA_FMVJ18X is not set +# CONFIG_PCMCIA_HERMES is not set +# CONFIG_PCMCIA_LOAD_CIS is not set +# CONFIG_PCMCIA_NINJA_SCSI is not set +# CONFIG_PCMCIA_NMCLAN is not set +# CONFIG_PCMCIA_PCNET is not set +# CONFIG_PCMCIA_QLOGIC is not set +# CONFIG_PCMCIA_RAYCS is not set +# CONFIG_PCMCIA_SMC91C92 is not set +# CONFIG_PCMCIA_SPECTRUM is not set +# CONFIG_PCMCIA_SYM53C500 is not set +# CONFIG_PCMCIA_WL3501 is not set +# CONFIG_PCMCIA_XIRC2PS is not set +# CONFIG_PCMCIA_XIRCOM is not set +# CONFIG_PCNET32 is not set +# CONFIG_PCSPKR_PLATFORM is not set +# CONFIG_PD6729 is not set +# CONFIG_PDA_POWER is not set +# CONFIG_PDC_ADMA is not set +# CONFIG_PERCPU_STATS is not set +# CONFIG_PERCPU_TEST is not set +# CONFIG_PERF_EVENTS is not set +# CONFIG_PERF_EVENTS_AMD_POWER is not set +# CONFIG_PERSISTENT_KEYRINGS is not set +# CONFIG_PHANTOM is not set +# CONFIG_PHONET is not set +# CONFIG_PHYLIB is not set +# CONFIG_PHYS_ADDR_T_64BIT is not set +# CONFIG_PHY_CPCAP_USB is not set +# CONFIG_PHY_EXYNOS_DP_VIDEO is not set +# CONFIG_PHY_EXYNOS_MIPI_VIDEO is not set +# CONFIG_PHY_PXA_28NM_HSIC is not set +# CONFIG_PHY_PXA_28NM_USB2 is not set +# CONFIG_PHY_QCOM_DWC3 is not set +# CONFIG_PHY_SAMSUNG_USB2 is not set +# CONFIG_PI433 is not set +# CONFIG_PID_IN_CONTEXTIDR is not set +# CONFIG_PID_NS is not set +CONFIG_PINCONF=y +# CONFIG_PINCTRL is not set +# CONFIG_PINCTRL_AMD is not set +# CONFIG_PINCTRL_EXYNOS is not set +# CONFIG_PINCTRL_EXYNOS5440 is not set +# CONFIG_PINCTRL_MCP23S08 is not set +# CONFIG_PINCTRL_MSM8X74 is not set +CONFIG_PINCTRL_SINGLE=y +# CONFIG_PINCTRL_SX150X is not set +CONFIG_PINMUX=y +# CONFIG_PKCS7_MESSAGE_PARSER is not set +# CONFIG_PL320_MBOX is not set +# CONFIG_PL330_DMA is not set +# CONFIG_PLATFORM_MHU is not set +# CONFIG_PLAT_SPEAR is not set +# CONFIG_PLIP is not set +# CONFIG_PLX_HERMES is not set +# CONFIG_PM is not set +# CONFIG_PMBUS is not set +# CONFIG_PMC_MSP is not set +# CONFIG_PMIC_ADP5520 is not set +# CONFIG_PMIC_DA903X is not set +# CONFIG_PM_AUTOSLEEP is not set +# CONFIG_PM_DEVFREQ is not set +# CONFIG_PM_WAKELOCKS is not set +# CONFIG_POSIX_MQUEUE is not set +CONFIG_POSIX_TIMERS=y +# CONFIG_POWERCAP is not set +# CONFIG_POWER_AVS is not set +# CONFIG_POWER_RESET is not set +# CONFIG_POWER_RESET_BRCMKONA is not set +# CONFIG_POWER_RESET_BRCMSTB is not set +# CONFIG_POWER_RESET_GPIO is not set +# CONFIG_POWER_RESET_GPIO_RESTART is not set +# CONFIG_POWER_RESET_LTC2952 is not set +# CONFIG_POWER_RESET_PIIX4_POWEROFF is not set +# CONFIG_POWER_RESET_RESTART is not set +# CONFIG_POWER_RESET_SYSCON is not set +# CONFIG_POWER_RESET_SYSCON_POWEROFF is not set +# CONFIG_POWER_RESET_VERSATILE is not set +# CONFIG_POWER_RESET_XGENE is not set +# CONFIG_POWER_SUPPLY is not set +# CONFIG_POWER_SUPPLY_DEBUG is not set +# CONFIG_PPC4xx_GPIO is not set +# CONFIG_PPC_16K_PAGES is not set +# CONFIG_PPC_256K_PAGES is not set +CONFIG_PPC_4K_PAGES=y +# CONFIG_PPC_64K_PAGES is not set +# CONFIG_PPC_DISABLE_WERROR is not set +# CONFIG_PPC_EMULATED_STATS is not set +# CONFIG_PPC_EPAPR_HV_BYTECHAN is not set +# CONFIG_PPP is not set +# CONFIG_PPPOATM is not set +# CONFIG_PPPOE is not set +# CONFIG_PPPOL2TP is not set +# CONFIG_PPP_ASYNC is not set +# CONFIG_PPP_BSDCOMP is not set +# CONFIG_PPP_DEFLATE is not set +CONFIG_PPP_FILTER=y +# CONFIG_PPP_MPPE is not set +CONFIG_PPP_MULTILINK=y +# CONFIG_PPP_SYNC_TTY is not set +# CONFIG_PPS is not set +# CONFIG_PPS_CLIENT_GPIO is not set +# CONFIG_PPS_CLIENT_KTIMER is not set +# CONFIG_PPS_CLIENT_LDISC is not set +# CONFIG_PPS_CLIENT_PARPORT is not set +# CONFIG_PPS_DEBUG is not set +# CONFIG_PPTP is not set +# CONFIG_PREEMPT is not set +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_TRACER is not set +# CONFIG_PREEMPT_VOLUNTARY is not set +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_PRINTK=y +CONFIG_PRINTK_NMI=y +CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 +# CONFIG_PRINTK_TIME is not set +CONFIG_PRINT_STACK_DEPTH=64 +# CONFIG_PRISM2_USB is not set +# CONFIG_PRISM54 is not set +# CONFIG_PROC_CHILDREN is not set +CONFIG_PROC_FS=y +# CONFIG_PROC_KCORE is not set +# CONFIG_PROC_PAGE_MONITOR is not set +CONFIG_PROC_STRIPPED=y +CONFIG_PROC_SYSCTL=y +# CONFIG_PROFILE_ALL_BRANCHES is not set +# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set +# CONFIG_PROFILING is not set +# CONFIG_PROVE_LOCKING is not set +# CONFIG_PROVE_RCU is not set +# CONFIG_PROVE_RCU_REPEATEDLY is not set +# CONFIG_PSAMPLE is not set +# CONFIG_PSB6970_PHY is not set +# CONFIG_PSTORE is not set +# CONFIG_PTP_1588_CLOCK is not set +# CONFIG_PTP_1588_CLOCK_IXP46X is not set +# CONFIG_PTP_1588_CLOCK_KVM is not set +# CONFIG_PTP_1588_CLOCK_PCH is not set +# CONFIG_PUBLIC_KEY_ALGO_RSA is not set +# CONFIG_PWM is not set +# CONFIG_PWM_FSL_FTM is not set +# CONFIG_PWM_PCA9685 is not set +CONFIG_PWRSEQ_EMMC=y +# CONFIG_PWRSEQ_SD8787 is not set +CONFIG_PWRSEQ_SIMPLE=y +# CONFIG_QCA7000 is not set +# CONFIG_QCA7000_SPI is not set +# CONFIG_QCOM_EMAC is not set +# CONFIG_QCOM_FALKOR_ERRATUM_1003 is not set +# CONFIG_QCOM_FALKOR_ERRATUM_1009 is not set +# CONFIG_QCOM_HIDMA is not set +# CONFIG_QCOM_HIDMA_MGMT is not set +# CONFIG_QCOM_QDF2400_ERRATUM_0065 is not set +# CONFIG_QCOM_SPMI_IADC is not set +# CONFIG_QCOM_SPMI_TEMP_ALARM is not set +# CONFIG_QCOM_SPMI_VADC is not set +# CONFIG_QED is not set +# CONFIG_QLA3XXX is not set +# CONFIG_QLCNIC is not set +# CONFIG_QLGE is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX6FS_FS is not set +# CONFIG_QORIQ_CPUFREQ is not set +# CONFIG_QORIQ_THERMAL is not set +# CONFIG_QSEMI_PHY is not set +# CONFIG_QUEUED_LOCK_STAT is not set +# CONFIG_QUOTA is not set +# CONFIG_QUOTACTL is not set +# CONFIG_QUOTA_DEBUG is not set +# CONFIG_R3964 is not set +# CONFIG_R6040 is not set +# CONFIG_R8169 is not set +# CONFIG_R8188EU is not set +# CONFIG_R8712U is not set +# CONFIG_R8723AU is not set +# CONFIG_RADIO_ADAPTERS is not set +# CONFIG_RADIO_AZTECH is not set +# CONFIG_RADIO_CADET is not set +# CONFIG_RADIO_GEMTEK is not set +# CONFIG_RADIO_MAXIRADIO is not set +# CONFIG_RADIO_RTRACK is not set +# CONFIG_RADIO_RTRACK2 is not set +# CONFIG_RADIO_SF16FMI is not set +# CONFIG_RADIO_SF16FMR2 is not set +# CONFIG_RADIO_TERRATEC is not set +# CONFIG_RADIO_TRUST is not set +# CONFIG_RADIO_TYPHOON is not set +# CONFIG_RADIO_ZOLTRIX is not set +# CONFIG_RAID_ATTRS is not set +# CONFIG_RALINK is not set +# CONFIG_RANDOM32_SELFTEST is not set +# CONFIG_RAPIDIO is not set +# CONFIG_RAS is not set +# CONFIG_RAW_DRIVER is not set +# CONFIG_RBTREE_TEST is not set +CONFIG_RCU_CPU_STALL_TIMEOUT=60 +# CONFIG_RCU_EQS_DEBUG is not set +# CONFIG_RCU_EXPEDITE_BOOT is not set +CONFIG_RCU_EXPERT=y +CONFIG_RCU_FANOUT=32 +CONFIG_RCU_FANOUT_LEAF=16 +# CONFIG_RCU_FAST_NO_HZ is not set +CONFIG_RCU_KTHREAD_PRIO=0 +# CONFIG_RCU_NOCB_CPU is not set +# CONFIG_RCU_PERF_TEST is not set +# CONFIG_RCU_TORTURE_TEST is not set +CONFIG_RCU_TORTURE_TEST_SLOW_INIT_DELAY=3 +# CONFIG_RCU_TRACE is not set +# CONFIG_RC_ATI_REMOTE is not set +# CONFIG_RC_CORE is not set +# CONFIG_RC_DECODERS is not set +# CONFIG_RC_LOOPBACK is not set +# CONFIG_RC_MAP is not set +# CONFIG_RDS is not set +# CONFIG_RD_BZIP2 is not set +# CONFIG_RD_GZIP is not set +# CONFIG_RD_LZ4 is not set +# CONFIG_RD_LZMA is not set +# CONFIG_RD_LZO is not set +# CONFIG_RD_XZ is not set +# CONFIG_READABLE_ASM is not set +# CONFIG_REALTEK_PHY is not set +# CONFIG_REDWOOD is not set +# CONFIG_REFCOUNT_FULL is not set +# CONFIG_REGMAP is not set +# CONFIG_REGMAP_I2C is not set +# CONFIG_REGMAP_MMIO is not set +# CONFIG_REGMAP_SPI is not set +# CONFIG_REGULATOR is not set +# CONFIG_REGULATOR_ACT8865 is not set +# CONFIG_REGULATOR_AD5398 is not set +# CONFIG_REGULATOR_ANATOP is not set +# CONFIG_REGULATOR_DA9210 is not set +# CONFIG_REGULATOR_DA9211 is not set +# CONFIG_REGULATOR_DEBUG is not set +# CONFIG_REGULATOR_FAN53555 is not set +# CONFIG_REGULATOR_FIXED_VOLTAGE is not set +# CONFIG_REGULATOR_GPIO is not set +# CONFIG_REGULATOR_ISL6271A is not set +# CONFIG_REGULATOR_ISL9305 is not set +# CONFIG_REGULATOR_LP3971 is not set +# CONFIG_REGULATOR_LP3972 is not set +# CONFIG_REGULATOR_LP872X is not set +# CONFIG_REGULATOR_LP8755 is not set +# CONFIG_REGULATOR_LTC3589 is not set +# CONFIG_REGULATOR_LTC3676 is not set +# CONFIG_REGULATOR_MAX1586 is not set +# CONFIG_REGULATOR_MAX8649 is not set +# CONFIG_REGULATOR_MAX8660 is not set +# CONFIG_REGULATOR_MAX8952 is not set +# CONFIG_REGULATOR_MAX8973 is not set +# CONFIG_REGULATOR_MT6311 is not set +# CONFIG_REGULATOR_PFUZE100 is not set +# CONFIG_REGULATOR_PV88060 is not set +# CONFIG_REGULATOR_PV88080 is not set +# CONFIG_REGULATOR_PV88090 is not set +# CONFIG_REGULATOR_PWM is not set +# CONFIG_REGULATOR_TI_ABB is not set +# CONFIG_REGULATOR_TPS51632 is not set +# CONFIG_REGULATOR_TPS62360 is not set +# CONFIG_REGULATOR_TPS65023 is not set +# CONFIG_REGULATOR_TPS6507X is not set +# CONFIG_REGULATOR_TPS65132 is not set +# CONFIG_REGULATOR_TPS6524X is not set +# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set +# CONFIG_REGULATOR_VCTRL is not set +# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_FS_POSIX_ACL is not set +# CONFIG_REISERFS_FS_SECURITY is not set +# CONFIG_REISERFS_FS_XATTR is not set +# CONFIG_REISERFS_PROC_INFO is not set +# CONFIG_RELAY is not set +# CONFIG_RELOCATABLE is not set +# CONFIG_REMOTEPROC is not set +# CONFIG_RESET_ATH79 is not set +# CONFIG_RESET_BERLIN is not set +# CONFIG_RESET_CONTROLLER is not set +# CONFIG_RESET_IMX7 is not set +# CONFIG_RESET_LANTIQ is not set +# CONFIG_RESET_LPC18XX is not set +# CONFIG_RESET_MESON is not set +# CONFIG_RESET_PISTACHIO is not set +# CONFIG_RESET_SOCFPGA is not set +# CONFIG_RESET_STM32 is not set +# CONFIG_RESET_SUNXI is not set +# CONFIG_RESET_TEGRA_BPMP is not set +# CONFIG_RESET_TI_SYSCON is not set +# CONFIG_RESET_ZYNQ is not set +# CONFIG_RFD_FTL is not set +CONFIG_RFKILL=y +# CONFIG_RFKILL_FULL is not set +# CONFIG_RFKILL_GPIO is not set +# CONFIG_RFKILL_INPUT is not set +# CONFIG_RFKILL_LEDS is not set +# CONFIG_RFKILL_REGULATOR is not set +# CONFIG_RING_BUFFER_BENCHMARK is not set +# CONFIG_RING_BUFFER_STARTUP_TEST is not set +# CONFIG_RMI4_CORE is not set +# CONFIG_RMNET is not set +# CONFIG_ROCKCHIP_PHY is not set +# CONFIG_ROCKER is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_ROSE is not set +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPMSG_QCOM_GLINK_RPM is not set +# CONFIG_RPR0521 is not set +# CONFIG_RT2X00 is not set +# CONFIG_RTC_CLASS is not set +# CONFIG_RTC_DEBUG is not set +# CONFIG_RTC_DRV_ABB5ZES3 is not set +# CONFIG_RTC_DRV_ABX80X is not set +# CONFIG_RTC_DRV_ARMADA38X is not set +# CONFIG_RTC_DRV_AU1XXX is not set +# CONFIG_RTC_DRV_BQ32K is not set +# CONFIG_RTC_DRV_BQ4802 is not set +CONFIG_RTC_DRV_CMOS=y +# CONFIG_RTC_DRV_DS1286 is not set +# CONFIG_RTC_DRV_DS1302 is not set +# CONFIG_RTC_DRV_DS1305 is not set +# CONFIG_RTC_DRV_DS1307 is not set +# CONFIG_RTC_DRV_DS1307_CENTURY is not set +# CONFIG_RTC_DRV_DS1307_HWMON is not set +# CONFIG_RTC_DRV_DS1343 is not set +# CONFIG_RTC_DRV_DS1347 is not set +# CONFIG_RTC_DRV_DS1374 is not set +# CONFIG_RTC_DRV_DS1390 is not set +# CONFIG_RTC_DRV_DS1511 is not set +# CONFIG_RTC_DRV_DS1553 is not set +# CONFIG_RTC_DRV_DS1672 is not set +# CONFIG_RTC_DRV_DS1685_FAMILY is not set +# CONFIG_RTC_DRV_DS1742 is not set +# CONFIG_RTC_DRV_DS2404 is not set +# CONFIG_RTC_DRV_DS3232 is not set +# CONFIG_RTC_DRV_DS3234 is not set +# CONFIG_RTC_DRV_EM3027 is not set +# CONFIG_RTC_DRV_EP93XX is not set +# CONFIG_RTC_DRV_FM3130 is not set +# CONFIG_RTC_DRV_FTRTC010 is not set +# CONFIG_RTC_DRV_GENERIC is not set +# CONFIG_RTC_DRV_HID_SENSOR_TIME is not set +# CONFIG_RTC_DRV_HYM8563 is not set +# CONFIG_RTC_DRV_ISL12022 is not set +# CONFIG_RTC_DRV_ISL12057 is not set +# CONFIG_RTC_DRV_ISL1208 is not set +# CONFIG_RTC_DRV_M41T80 is not set +# CONFIG_RTC_DRV_M41T93 is not set +# CONFIG_RTC_DRV_M41T94 is not set +# CONFIG_RTC_DRV_M48T35 is not set +# CONFIG_RTC_DRV_M48T59 is not set +# CONFIG_RTC_DRV_M48T86 is not set +# CONFIG_RTC_DRV_MAX6900 is not set +# CONFIG_RTC_DRV_MAX6902 is not set +# CONFIG_RTC_DRV_MAX6916 is not set +# CONFIG_RTC_DRV_MCP795 is not set +# CONFIG_RTC_DRV_MOXART is not set +# CONFIG_RTC_DRV_MPC5121 is not set +# CONFIG_RTC_DRV_MSM6242 is not set +# CONFIG_RTC_DRV_OMAP is not set +# CONFIG_RTC_DRV_PCF2123 is not set +# CONFIG_RTC_DRV_PCF2127 is not set +# CONFIG_RTC_DRV_PCF85063 is not set +# CONFIG_RTC_DRV_PCF8523 is not set +# CONFIG_RTC_DRV_PCF8563 is not set +# CONFIG_RTC_DRV_PCF8583 is not set +# CONFIG_RTC_DRV_PL030 is not set +# CONFIG_RTC_DRV_PL031 is not set +# CONFIG_RTC_DRV_PS3 is not set +# CONFIG_RTC_DRV_PT7C4338 is not set +# CONFIG_RTC_DRV_R7301 is not set +# CONFIG_RTC_DRV_R9701 is not set +# CONFIG_RTC_DRV_RP5C01 is not set +# CONFIG_RTC_DRV_RS5C348 is not set +# CONFIG_RTC_DRV_RS5C372 is not set +# CONFIG_RTC_DRV_RTC7301 is not set +# CONFIG_RTC_DRV_RV3029C2 is not set +# CONFIG_RTC_DRV_RV8803 is not set +# CONFIG_RTC_DRV_RX4581 is not set +# CONFIG_RTC_DRV_RX6110 is not set +# CONFIG_RTC_DRV_RX8010 is not set +# CONFIG_RTC_DRV_RX8025 is not set +# CONFIG_RTC_DRV_RX8581 is not set +# CONFIG_RTC_DRV_S35390A is not set +# CONFIG_RTC_DRV_SNVS is not set +# CONFIG_RTC_DRV_STK17TA8 is not set +# CONFIG_RTC_DRV_SUN6I is not set +# CONFIG_RTC_DRV_TEST is not set +# CONFIG_RTC_DRV_V3020 is not set +# CONFIG_RTC_DRV_X1205 is not set +# CONFIG_RTC_DRV_XGENE is not set +# CONFIG_RTC_DRV_ZYNQMP is not set +CONFIG_RTC_HCTOSYS=y +CONFIG_RTC_HCTOSYS_DEVICE="rtc0" +CONFIG_RTC_INTF_DEV=y +# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_LIB=y +# CONFIG_RTC_NVMEM is not set +CONFIG_RTC_SYSTOHC=y +CONFIG_RTC_SYSTOHC_DEVICE="rtc0" +# CONFIG_RTL8180 is not set +# CONFIG_RTL8187 is not set +# CONFIG_RTL8192E is not set +# CONFIG_RTL8192U is not set +# CONFIG_RTL8306_PHY is not set +# CONFIG_RTL8366RB_PHY is not set +# CONFIG_RTL8366S_PHY is not set +# CONFIG_RTL8366_SMI is not set +# CONFIG_RTL8366_SMI_DEBUG_FS is not set +# CONFIG_RTL8367B_PHY is not set +# CONFIG_RTL8367_PHY is not set +# CONFIG_RTLLIB is not set +# CONFIG_RTL_CARDS is not set +# CONFIG_RTS5208 is not set +CONFIG_RT_MUTEXES=y +# CONFIG_RUNTIME_DEBUG is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_RXKAD=y +# CONFIG_S2IO is not set +# CONFIG_SAMPLES is not set +# CONFIG_SAMSUNG_LAPTOP is not set +# CONFIG_SATA_ACARD_AHCI is not set +# CONFIG_SATA_AHCI is not set +# CONFIG_SATA_AHCI_PLATFORM is not set +# CONFIG_SATA_DWC is not set +# CONFIG_SATA_FSL is not set +# CONFIG_SATA_HIGHBANK is not set +# CONFIG_SATA_INIC162X is not set +# CONFIG_SATA_MV is not set +# CONFIG_SATA_NV is not set +# CONFIG_SATA_PMP is not set +# CONFIG_SATA_PROMISE is not set +# CONFIG_SATA_QSTOR is not set +# CONFIG_SATA_RCAR is not set +# CONFIG_SATA_SIL is not set +# CONFIG_SATA_SIL24 is not set +# CONFIG_SATA_SIS is not set +# CONFIG_SATA_SVW is not set +# CONFIG_SATA_SX4 is not set +# CONFIG_SATA_ULI is not set +# CONFIG_SATA_VIA is not set +# CONFIG_SATA_VITESSE is not set +# CONFIG_SBC_FITPC2_WATCHDOG is not set +CONFIG_SBITMAP=y +# CONFIG_SC92031 is not set +# CONFIG_SCA3000 is not set +# CONFIG_SCACHE_DEBUGFS is not set +# CONFIG_SCC is not set +# CONFIG_SCHEDSTATS is not set +# CONFIG_SCHED_AUTOGROUP is not set +# CONFIG_SCHED_DEBUG is not set +CONFIG_SCHED_HRTICK=y +# CONFIG_SCHED_MC is not set +CONFIG_SCHED_OMIT_FRAME_POINTER=y +# CONFIG_SCHED_SMT is not set +# CONFIG_SCHED_STACK_END_CHECK is not set +# CONFIG_SCHED_TRACER is not set +# CONFIG_SCR24X is not set +# CONFIG_SCSI is not set +# CONFIG_SCSI_3W_9XXX is not set +# CONFIG_SCSI_3W_SAS is not set +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_AACRAID is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC94XX is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_ARCMSR is not set +# CONFIG_SCSI_BFA_FC is not set +# CONFIG_SCSI_BNX2X_FCOE is not set +# CONFIG_SCSI_BNX2_ISCSI is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_CHELSIO_FCOE is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_CXGB3_ISCSI is not set +# CONFIG_SCSI_CXGB4_ISCSI is not set +# CONFIG_SCSI_DC395x is not set +# CONFIG_SCSI_DEBUG is not set +# CONFIG_SCSI_DH is not set +CONFIG_SCSI_DMA=y +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_ESAS2R is not set +# CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set +# CONFIG_SCSI_HISI_SAS is not set +# CONFIG_SCSI_HPSA is not set +# CONFIG_SCSI_HPTIOP is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_IPR is not set +# CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_ISCI is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set +# CONFIG_SCSI_LOGGING is not set +CONFIG_SCSI_LOWLEVEL=y +# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set +# CONFIG_SCSI_LPFC is not set +CONFIG_SCSI_MOD=y +# CONFIG_SCSI_MPT2SAS is not set +# CONFIG_SCSI_MPT3SAS is not set +# CONFIG_SCSI_MQ_DEFAULT is not set +# CONFIG_SCSI_MVSAS is not set +# CONFIG_SCSI_MVSAS_DEBUG is not set +# CONFIG_SCSI_MVUMI is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_NETLINK is not set +# CONFIG_SCSI_NSP32 is not set +# CONFIG_SCSI_OSD_INITIATOR is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PM8001 is not set +# CONFIG_SCSI_PMCRAID is not set +CONFIG_SCSI_PROC_FS=y +# CONFIG_SCSI_QLA_FC is not set +# CONFIG_SCSI_QLA_ISCSI is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_SAS_ATTRS is not set +# CONFIG_SCSI_SAS_LIBSAS is not set +# CONFIG_SCSI_SCAN_ASYNC is not set +# CONFIG_SCSI_SMARTPQI is not set +# CONFIG_SCSI_SNIC is not set +# CONFIG_SCSI_SPI_ATTRS is not set +# CONFIG_SCSI_SRP_ATTRS is not set +# CONFIG_SCSI_STEX is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_SYM53C8XX_2 is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_UFSHCD is not set +# CONFIG_SCSI_ULTRASTOR is not set +# CONFIG_SCSI_VIRTIO is not set +# CONFIG_SCSI_WD719X is not set +# CONFIG_SCx200_ACB is not set +# CONFIG_SDIO_UART is not set +# CONFIG_SECCOMP is not set +CONFIG_SECTION_MISMATCH_WARN_ONLY=y +# CONFIG_SECURITY is not set +# CONFIG_SECURITYFS is not set +# CONFIG_SECURITY_DMESG_RESTRICT is not set +CONFIG_SELECT_MEMORY_MODEL=y +# CONFIG_SENSORS_ABITUGURU is not set +# CONFIG_SENSORS_ABITUGURU3 is not set +# CONFIG_SENSORS_ACPI_POWER is not set +# CONFIG_SENSORS_AD7314 is not set +# CONFIG_SENSORS_AD7414 is not set +# CONFIG_SENSORS_AD7418 is not set +# CONFIG_SENSORS_ADC128D818 is not set +# CONFIG_SENSORS_ADCXX is not set +# CONFIG_SENSORS_ADM1021 is not set +# CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1026 is not set +# CONFIG_SENSORS_ADM1029 is not set +# CONFIG_SENSORS_ADM1031 is not set +# CONFIG_SENSORS_ADM9240 is not set +# CONFIG_SENSORS_ADS1015 is not set +# CONFIG_SENSORS_ADS7828 is not set +# CONFIG_SENSORS_ADS7871 is not set +# CONFIG_SENSORS_ADT7310 is not set +# CONFIG_SENSORS_ADT7410 is not set +# CONFIG_SENSORS_ADT7411 is not set +# CONFIG_SENSORS_ADT7462 is not set +# CONFIG_SENSORS_ADT7470 is not set +# CONFIG_SENSORS_ADT7475 is not set +# CONFIG_SENSORS_AMC6821 is not set +# CONFIG_SENSORS_APDS990X is not set +# CONFIG_SENSORS_APPLESMC is not set +# CONFIG_SENSORS_ASB100 is not set +# CONFIG_SENSORS_ASC7621 is not set +# CONFIG_SENSORS_ASPEED is not set +# CONFIG_SENSORS_ATK0110 is not set +# CONFIG_SENSORS_ATXP1 is not set +# CONFIG_SENSORS_BH1770 is not set +# CONFIG_SENSORS_BH1780 is not set +# CONFIG_SENSORS_CORETEMP is not set +# CONFIG_SENSORS_DELL_SMM is not set +# CONFIG_SENSORS_DME1737 is not set +# CONFIG_SENSORS_DS1621 is not set +# CONFIG_SENSORS_DS620 is not set +# CONFIG_SENSORS_EMC1403 is not set +# CONFIG_SENSORS_EMC2103 is not set +# CONFIG_SENSORS_EMC6W201 is not set +# CONFIG_SENSORS_F71805F is not set +# CONFIG_SENSORS_F71882FG is not set +# CONFIG_SENSORS_F75375S is not set +# CONFIG_SENSORS_FAM15H_POWER is not set +# CONFIG_SENSORS_FSCHMD is not set +# CONFIG_SENSORS_FTSTEUTATES is not set +# CONFIG_SENSORS_G760A is not set +# CONFIG_SENSORS_G762 is not set +# CONFIG_SENSORS_GL518SM is not set +# CONFIG_SENSORS_GL520SM is not set +# CONFIG_SENSORS_GPIO_FAN is not set +# CONFIG_SENSORS_GSC is not set +# CONFIG_SENSORS_HDAPS is not set +# CONFIG_SENSORS_HIH6130 is not set +# CONFIG_SENSORS_HMC5843 is not set +# CONFIG_SENSORS_HMC5843_I2C is not set +# CONFIG_SENSORS_HMC5843_SPI is not set +# CONFIG_SENSORS_HTU21 is not set +# CONFIG_SENSORS_I5500 is not set +# CONFIG_SENSORS_I5K_AMB is not set +# CONFIG_SENSORS_IIO_HWMON is not set +# CONFIG_SENSORS_INA209 is not set +# CONFIG_SENSORS_INA2XX is not set +# CONFIG_SENSORS_INA3221 is not set +# CONFIG_SENSORS_ISL29018 is not set +# CONFIG_SENSORS_ISL29028 is not set +# CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_JC42 is not set +# CONFIG_SENSORS_K10TEMP is not set +# CONFIG_SENSORS_K8TEMP is not set +# CONFIG_SENSORS_LINEAGE is not set +# CONFIG_SENSORS_LIS3LV02D is not set +# CONFIG_SENSORS_LIS3_I2C is not set +# CONFIG_SENSORS_LIS3_SPI is not set +# CONFIG_SENSORS_LM63 is not set +# CONFIG_SENSORS_LM70 is not set +# CONFIG_SENSORS_LM73 is not set +# CONFIG_SENSORS_LM75 is not set +# CONFIG_SENSORS_LM77 is not set +# CONFIG_SENSORS_LM78 is not set +# CONFIG_SENSORS_LM80 is not set +# CONFIG_SENSORS_LM83 is not set +# CONFIG_SENSORS_LM85 is not set +# CONFIG_SENSORS_LM87 is not set +# CONFIG_SENSORS_LM90 is not set +# CONFIG_SENSORS_LM92 is not set +# CONFIG_SENSORS_LM93 is not set +# CONFIG_SENSORS_LM95234 is not set +# CONFIG_SENSORS_LM95241 is not set +# CONFIG_SENSORS_LM95245 is not set +# CONFIG_SENSORS_LTC2945 is not set +# CONFIG_SENSORS_LTC2990 is not set +# CONFIG_SENSORS_LTC4151 is not set +# CONFIG_SENSORS_LTC4215 is not set +# CONFIG_SENSORS_LTC4222 is not set +# CONFIG_SENSORS_LTC4245 is not set +# CONFIG_SENSORS_LTC4260 is not set +# CONFIG_SENSORS_LTC4261 is not set +# CONFIG_SENSORS_MAX1111 is not set +# CONFIG_SENSORS_MAX16065 is not set +# CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_MAX1668 is not set +# CONFIG_SENSORS_MAX197 is not set +# CONFIG_SENSORS_MAX31722 is not set +# CONFIG_SENSORS_MAX31790 is not set +# CONFIG_SENSORS_MAX6639 is not set +# CONFIG_SENSORS_MAX6642 is not set +# CONFIG_SENSORS_MAX6650 is not set +# CONFIG_SENSORS_MAX6697 is not set +# CONFIG_SENSORS_MCP3021 is not set +# CONFIG_SENSORS_NCT6683 is not set +# CONFIG_SENSORS_NCT6775 is not set +# CONFIG_SENSORS_NCT7802 is not set +# CONFIG_SENSORS_NCT7904 is not set +# CONFIG_SENSORS_NSA320 is not set +# CONFIG_SENSORS_NTC_THERMISTOR is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_PC87427 is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_POWR1220 is not set +# CONFIG_SENSORS_PWM_FAN is not set +# CONFIG_SENSORS_SCH5627 is not set +# CONFIG_SENSORS_SCH5636 is not set +# CONFIG_SENSORS_SCH56XX_COMMON is not set +# CONFIG_SENSORS_SHT15 is not set +# CONFIG_SENSORS_SHT21 is not set +# CONFIG_SENSORS_SHT3x is not set +# CONFIG_SENSORS_SHTC1 is not set +# CONFIG_SENSORS_SIS5595 is not set +# CONFIG_SENSORS_SMM665 is not set +# CONFIG_SENSORS_SMSC47B397 is not set +# CONFIG_SENSORS_SMSC47M1 is not set +# CONFIG_SENSORS_SMSC47M192 is not set +# CONFIG_SENSORS_STTS751 is not set +# CONFIG_SENSORS_TC654 is not set +# CONFIG_SENSORS_TC74 is not set +# CONFIG_SENSORS_THMC50 is not set +# CONFIG_SENSORS_TMP102 is not set +# CONFIG_SENSORS_TMP103 is not set +# CONFIG_SENSORS_TMP108 is not set +# CONFIG_SENSORS_TMP401 is not set +# CONFIG_SENSORS_TMP421 is not set +# CONFIG_SENSORS_TSL2550 is not set +# CONFIG_SENSORS_TSL2563 is not set +# CONFIG_SENSORS_VEXPRESS is not set +# CONFIG_SENSORS_VIA686A is not set +# CONFIG_SENSORS_VIA_CPUTEMP is not set +# CONFIG_SENSORS_VT1211 is not set +# CONFIG_SENSORS_VT8231 is not set +# CONFIG_SENSORS_W83627EHF is not set +# CONFIG_SENSORS_W83627HF is not set +# CONFIG_SENSORS_W83781D is not set +# CONFIG_SENSORS_W83791D is not set +# CONFIG_SENSORS_W83792D is not set +# CONFIG_SENSORS_W83793 is not set +# CONFIG_SENSORS_W83795 is not set +# CONFIG_SENSORS_W83L785TS is not set +# CONFIG_SENSORS_W83L786NG is not set +# CONFIG_SENSORS_XGENE is not set +CONFIG_SERIAL_8250=y +# CONFIG_SERIAL_8250_ACCENT is not set +# CONFIG_SERIAL_8250_ASPEED_VUART is not set +# CONFIG_SERIAL_8250_BOCA is not set +CONFIG_SERIAL_8250_CONSOLE=y +# CONFIG_SERIAL_8250_CS is not set +# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set +# CONFIG_SERIAL_8250_DETECT_IRQ is not set +CONFIG_SERIAL_8250_DMA=y +# CONFIG_SERIAL_8250_DW is not set +# CONFIG_SERIAL_8250_EM is not set +# CONFIG_SERIAL_8250_EXAR is not set +# CONFIG_SERIAL_8250_EXAR_ST16C554 is not set +# CONFIG_SERIAL_8250_EXTENDED is not set +# CONFIG_SERIAL_8250_FINTEK is not set +# CONFIG_SERIAL_8250_FOURPORT is not set +# CONFIG_SERIAL_8250_HUB6 is not set +# CONFIG_SERIAL_8250_INGENIC is not set +# CONFIG_SERIAL_8250_LPSS is not set +# CONFIG_SERIAL_8250_MANY_PORTS is not set +# CONFIG_SERIAL_8250_MID is not set +# CONFIG_SERIAL_8250_MOXA is not set +CONFIG_SERIAL_8250_NR_UARTS=2 +# CONFIG_SERIAL_8250_PCI is not set +# CONFIG_SERIAL_8250_RSA is not set +# CONFIG_SERIAL_8250_RT288X is not set +CONFIG_SERIAL_8250_RUNTIME_UARTS=2 +# CONFIG_SERIAL_ALTERA_JTAGUART is not set +# CONFIG_SERIAL_ALTERA_UART is not set +# CONFIG_SERIAL_AMBA_PL010 is not set +# CONFIG_SERIAL_ARC is not set +# CONFIG_SERIAL_BCM63XX is not set +# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_SERIAL_DEV_BUS is not set +CONFIG_SERIAL_EARLYCON=y +# CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST is not set +# CONFIG_SERIAL_FSL_LPUART is not set +# CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set +# CONFIG_SERIAL_IFX6X60 is not set +# CONFIG_SERIAL_JSM is not set +# CONFIG_SERIAL_MAX3100 is not set +# CONFIG_SERIAL_MAX310X is not set +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_SERIAL_OF_PLATFORM is not set +# CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL is not set +# CONFIG_SERIAL_PCH_UART is not set +# CONFIG_SERIAL_RP2 is not set +# CONFIG_SERIAL_SC16IS7XX is not set +# CONFIG_SERIAL_SCCNXP is not set +# CONFIG_SERIAL_SH_SCI is not set +# CONFIG_SERIAL_STM32 is not set +# CONFIG_SERIAL_ST_ASC is not set +# CONFIG_SERIAL_TIMBERDALE is not set +# CONFIG_SERIAL_UARTLITE is not set +# CONFIG_SERIAL_XILINX_PS_UART is not set +# CONFIG_SERIO is not set +# CONFIG_SERIO_ALTERA_PS2 is not set +# CONFIG_SERIO_AMBAKMI is not set +# CONFIG_SERIO_APBPS2 is not set +# CONFIG_SERIO_ARC_PS2 is not set +# CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_GPIO_PS2 is not set +# CONFIG_SERIO_I8042 is not set +# CONFIG_SERIO_LIBPS2 is not set +# CONFIG_SERIO_PARKBD is not set +# CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_PS2MULT is not set +# CONFIG_SERIO_RAW is not set +# CONFIG_SERIO_SERPORT is not set +# CONFIG_SERIO_SUN4I_PS2 is not set +# CONFIG_SFC is not set +# CONFIG_SFC_FALCON is not set +# CONFIG_SFI is not set +# CONFIG_SGETMASK_SYSCALL is not set +# CONFIG_SGI_IOC4 is not set +# CONFIG_SGI_IP22 is not set +# CONFIG_SGI_IP27 is not set +# CONFIG_SGI_IP28 is not set +# CONFIG_SGI_IP32 is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_SG_POOL is not set +# CONFIG_SG_SPLIT is not set +CONFIG_SHMEM=y +# CONFIG_SH_ETH is not set +# CONFIG_SH_TIMER_CMT is not set +# CONFIG_SH_TIMER_MTU2 is not set +# CONFIG_SH_TIMER_TMU is not set +# CONFIG_SI1145 is not set +# CONFIG_SI7005 is not set +# CONFIG_SI7020 is not set +# CONFIG_SIBYTE_BIGSUR is not set +# CONFIG_SIBYTE_CARMEL is not set +# CONFIG_SIBYTE_CRHINE is not set +# CONFIG_SIBYTE_CRHONE is not set +# CONFIG_SIBYTE_LITTLESUR is not set +# CONFIG_SIBYTE_RHONE is not set +# CONFIG_SIBYTE_SENTOSA is not set +# CONFIG_SIBYTE_SWARM is not set +CONFIG_SIGNALFD=y +# CONFIG_SIGNED_PE_FILE_VERIFICATION is not set +# CONFIG_SIMPLE_GPIO is not set +# CONFIG_SIMPLE_PM_BUS is not set +# CONFIG_SIS190 is not set +# CONFIG_SIS900 is not set +# CONFIG_SKGE is not set +# CONFIG_SKY2 is not set +# CONFIG_SKY2_DEBUG is not set +# CONFIG_SLAB is not set +CONFIG_SLABINFO=y +# CONFIG_SLAB_FREELIST_HARDENED is not set +# CONFIG_SLAB_FREELIST_RANDOM is not set +CONFIG_SLAB_MERGE_DEFAULT=y +# CONFIG_SLHC is not set +# CONFIG_SLICOSS is not set +# CONFIG_SLIP is not set +# CONFIG_SLOB is not set +CONFIG_SLUB=y +CONFIG_SLUB_CPU_PARTIAL=y +# CONFIG_SLUB_DEBUG is not set +# CONFIG_SLUB_DEBUG_ON is not set +# CONFIG_SLUB_MEMCG_SYSFS_ON is not set +# CONFIG_SLUB_STATS is not set +# CONFIG_SMARTJOYPLUS_FF is not set +# CONFIG_SMC911X is not set +# CONFIG_SMC9194 is not set +# CONFIG_SMC91X is not set +# CONFIG_SMP is not set +# CONFIG_SMSC911X is not set +# CONFIG_SMSC9420 is not set +# CONFIG_SMSC_PHY is not set +# CONFIG_SM_FTL is not set +# CONFIG_SND is not set +# CONFIG_SND_AC97_POWER_SAVE is not set +# CONFIG_SND_AD1816A is not set +# CONFIG_SND_AD1848 is not set +# CONFIG_SND_AD1889 is not set +# CONFIG_SND_ADLIB is not set +# CONFIG_SND_ALI5451 is not set +# CONFIG_SND_ALOOP is not set +# CONFIG_SND_ALS100 is not set +# CONFIG_SND_ALS300 is not set +# CONFIG_SND_ALS4000 is not set +# CONFIG_SND_ARM is not set +# CONFIG_SND_ASIHPI is not set +# CONFIG_SND_ATIIXP is not set +# CONFIG_SND_ATIIXP_MODEM is not set +# CONFIG_SND_ATMEL_AC97C is not set +# CONFIG_SND_ATMEL_SOC is not set +# CONFIG_SND_AU8810 is not set +# CONFIG_SND_AU8820 is not set +# CONFIG_SND_AU8830 is not set +# CONFIG_SND_AUDIO_GRAPH_CARD is not set +# CONFIG_SND_AUDIO_GRAPH_SCU_CARD is not set +# CONFIG_SND_AW2 is not set +# CONFIG_SND_AZT2320 is not set +# CONFIG_SND_AZT3328 is not set +# CONFIG_SND_BCD2000 is not set +# CONFIG_SND_BT87X is not set +# CONFIG_SND_CA0106 is not set +# CONFIG_SND_CMI8330 is not set +# CONFIG_SND_CMIPCI is not set +# CONFIG_SND_CS4231 is not set +# CONFIG_SND_CS4236 is not set +# CONFIG_SND_CS4281 is not set +# CONFIG_SND_CS46XX is not set +# CONFIG_SND_CS5530 is not set +# CONFIG_SND_CS5535AUDIO is not set +# CONFIG_SND_CTXFI is not set +# CONFIG_SND_DARLA20 is not set +# CONFIG_SND_DARLA24 is not set +# CONFIG_SND_DEBUG is not set +# CONFIG_SND_DESIGNWARE_I2S is not set +CONFIG_SND_DRIVERS=y +# CONFIG_SND_DUMMY is not set +# CONFIG_SND_DYNAMIC_MINORS is not set +# CONFIG_SND_ECHO3G is not set +# CONFIG_SND_EDMA_SOC is not set +# CONFIG_SND_EMU10K1 is not set +# CONFIG_SND_EMU10K1X is not set +# CONFIG_SND_EMU10K1_SEQ is not set +# CONFIG_SND_ENS1370 is not set +# CONFIG_SND_ENS1371 is not set +# CONFIG_SND_ES1688 is not set +# CONFIG_SND_ES18XX is not set +# CONFIG_SND_ES1938 is not set +# CONFIG_SND_ES1968 is not set +# CONFIG_SND_FIREWIRE is not set +# CONFIG_SND_FM801 is not set +# CONFIG_SND_GINA20 is not set +# CONFIG_SND_GINA24 is not set +# CONFIG_SND_GUSCLASSIC is not set +# CONFIG_SND_GUSEXTREME is not set +# CONFIG_SND_GUSMAX is not set +# CONFIG_SND_HDA_INTEL is not set +CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0 +CONFIG_SND_HDA_PREALLOC_SIZE=64 +# CONFIG_SND_HDSP is not set +# CONFIG_SND_HDSPM is not set +# CONFIG_SND_HRTIMER is not set +# CONFIG_SND_HWDEP is not set +# CONFIG_SND_I2S_HI6210_I2S is not set +# CONFIG_SND_ICE1712 is not set +# CONFIG_SND_ICE1724 is not set +# CONFIG_SND_INDIGO is not set +# CONFIG_SND_INDIGODJ is not set +# CONFIG_SND_INDIGODJX is not set +# CONFIG_SND_INDIGOIO is not set +# CONFIG_SND_INDIGOIOX is not set +# CONFIG_SND_INTEL8X0 is not set +# CONFIG_SND_INTEL8X0M is not set +# CONFIG_SND_INTERWAVE is not set +# CONFIG_SND_INTERWAVE_STB is not set +# CONFIG_SND_ISA is not set +# CONFIG_SND_KIRKWOOD_SOC is not set +# CONFIG_SND_KORG1212 is not set +# CONFIG_SND_LAYLA20 is not set +# CONFIG_SND_LAYLA24 is not set +# CONFIG_SND_LOLA is not set +# CONFIG_SND_LX6464ES is not set +# CONFIG_SND_MAESTRO3 is not set +# CONFIG_SND_MIA is not set +# CONFIG_SND_MIPS is not set +# CONFIG_SND_MIRO is not set +# CONFIG_SND_MIXART is not set +# CONFIG_SND_MIXER_OSS is not set +# CONFIG_SND_MONA is not set +# CONFIG_SND_MPC52xx_SOC_EFIKA is not set +# CONFIG_SND_MPU401 is not set +# CONFIG_SND_MTPAV is not set +# CONFIG_SND_MTS64 is not set +# CONFIG_SND_MXS_SOC is not set +# CONFIG_SND_NM256 is not set +# CONFIG_SND_OPL3SA2 is not set +# CONFIG_SND_OPL3_LIB_SEQ is not set +# CONFIG_SND_OPL4_LIB_SEQ is not set +# CONFIG_SND_OPTI92X_AD1848 is not set +# CONFIG_SND_OPTI92X_CS4231 is not set +# CONFIG_SND_OPTI93X is not set +CONFIG_SND_OSSEMUL=y +# CONFIG_SND_OXYGEN is not set +CONFIG_SND_PCI=y +# CONFIG_SND_PCM is not set +# CONFIG_SND_PCMCIA is not set +# CONFIG_SND_PCM_OSS is not set +CONFIG_SND_PCM_OSS_PLUGINS=y +# CONFIG_SND_PCM_TIMER is not set +# CONFIG_SND_PCM_XRUN_DEBUG is not set +# CONFIG_SND_PCXHR is not set +# CONFIG_SND_PDAUDIOCF is not set +# CONFIG_SND_PORTMAN2X4 is not set +# CONFIG_SND_POWERPC_SOC is not set +# CONFIG_SND_PPC is not set +CONFIG_SND_PROC_FS=y +# CONFIG_SND_RAWMIDI is not set +# CONFIG_SND_RAWMIDI_SEQ is not set +# CONFIG_SND_RIPTIDE is not set +# CONFIG_SND_RME32 is not set +# CONFIG_SND_RME96 is not set +# CONFIG_SND_RME9652 is not set +# CONFIG_SND_RTCTIMER is not set +# CONFIG_SND_SB16 is not set +# CONFIG_SND_SB8 is not set +# CONFIG_SND_SBAWE is not set +# CONFIG_SND_SBAWE_SEQ is not set +# CONFIG_SND_SE6X is not set +# CONFIG_SND_SEQUENCER is not set +# CONFIG_SND_SERIAL_U16550 is not set +# CONFIG_SND_SIMPLE_CARD is not set +# CONFIG_SND_SIMPLE_SCU_CARD is not set +# CONFIG_SND_SIS7019 is not set +# CONFIG_SND_SOC is not set +# CONFIG_SND_SOC_AC97_CODEC is not set +# CONFIG_SND_SOC_ADAU1701 is not set +# CONFIG_SND_SOC_ADAU1761_I2C is not set +# CONFIG_SND_SOC_ADAU1761_SPI is not set +# CONFIG_SND_SOC_ADAU7002 is not set +# CONFIG_SND_SOC_AK4104 is not set +# CONFIG_SND_SOC_AK4554 is not set +# CONFIG_SND_SOC_AK4613 is not set +# CONFIG_SND_SOC_AK4642 is not set +# CONFIG_SND_SOC_AK5386 is not set +# CONFIG_SND_SOC_ALC5623 is not set +# CONFIG_SND_SOC_AMD_ACP is not set +# CONFIG_SND_SOC_AU1XAUDIO is not set +# CONFIG_SND_SOC_AU1XPSC is not set +# CONFIG_SND_SOC_BT_SCO is not set +# CONFIG_SND_SOC_CS35L32 is not set +# CONFIG_SND_SOC_CS35L33 is not set +# CONFIG_SND_SOC_CS35L34 is not set +# CONFIG_SND_SOC_CS35L35 is not set +# CONFIG_SND_SOC_CS4265 is not set +# CONFIG_SND_SOC_CS4270 is not set +# CONFIG_SND_SOC_CS4271 is not set +# CONFIG_SND_SOC_CS4271_I2C is not set +# CONFIG_SND_SOC_CS4271_SPI is not set +# CONFIG_SND_SOC_CS42L42 is not set +# CONFIG_SND_SOC_CS42L51_I2C is not set +# CONFIG_SND_SOC_CS42L52 is not set +# CONFIG_SND_SOC_CS42L56 is not set +# CONFIG_SND_SOC_CS42L73 is not set +# CONFIG_SND_SOC_CS42XX8_I2C is not set +# CONFIG_SND_SOC_CS43130 is not set +# CONFIG_SND_SOC_CS4349 is not set +# CONFIG_SND_SOC_CS53L30 is not set +# CONFIG_SND_SOC_DIO2125 is not set +# CONFIG_SND_SOC_ES7134 is not set +# CONFIG_SND_SOC_ES8316 is not set +# CONFIG_SND_SOC_ES8328 is not set +# CONFIG_SND_SOC_ES8328_I2C is not set +# CONFIG_SND_SOC_ES8328_SPI is not set +# CONFIG_SND_SOC_EUKREA_TLV320 is not set +# CONFIG_SND_SOC_FSL_ASOC_CARD is not set +# CONFIG_SND_SOC_FSL_ASRC is not set +# CONFIG_SND_SOC_FSL_ESAI is not set +# CONFIG_SND_SOC_FSL_SAI is not set +# CONFIG_SND_SOC_FSL_SPDIF is not set +# CONFIG_SND_SOC_FSL_SSI is not set +# CONFIG_SND_SOC_GTM601 is not set +# CONFIG_SND_SOC_IMG is not set +# CONFIG_SND_SOC_IMX_AUDMUX is not set +# CONFIG_SND_SOC_IMX_ES8328 is not set +# CONFIG_SND_SOC_IMX_SPDIF is not set +# CONFIG_SND_SOC_IMX_WM8962 is not set +# CONFIG_SND_SOC_INNO_RK3036 is not set +# CONFIG_SND_SOC_INTEL_BDW_RT5677_MACH is not set +# CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH is not set +# CONFIG_SND_SOC_INTEL_BXT_RT298_MACH is not set +# CONFIG_SND_SOC_INTEL_BYTCR_RT5640_MACH is not set +# CONFIG_SND_SOC_INTEL_BYTCR_RT5651_MACH is not set +# CONFIG_SND_SOC_INTEL_BYT_CHT_DA7213_MACH is not set +# CONFIG_SND_SOC_INTEL_BYT_CHT_ES8316_MACH is not set +# CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH is not set +# CONFIG_SND_SOC_INTEL_BYT_MAX98090_MACH is not set +# CONFIG_SND_SOC_INTEL_BYT_RT5640_MACH is not set +# CONFIG_SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH is not set +# CONFIG_SND_SOC_INTEL_CHT_BSW_RT5645_MACH is not set +# CONFIG_SND_SOC_INTEL_CHT_BSW_RT5672_MACH is not set +# CONFIG_SND_SOC_INTEL_KBL_RT5663_MAX98927_MACH is not set +# CONFIG_SND_SOC_INTEL_KBL_RT5663_RT5514_MAX98927_MACH is not set +# CONFIG_SND_SOC_INTEL_SKL_NAU88L25_MAX98357A_MACH is not set +# CONFIG_SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH is not set +# CONFIG_SND_SOC_INTEL_SKL_RT286_MACH is not set +# CONFIG_SND_SOC_INTEL_SST is not set +# CONFIG_SND_SOC_MAX98504 is not set +# CONFIG_SND_SOC_MAX9860 is not set +# CONFIG_SND_SOC_MAX98927 is not set +# CONFIG_SND_SOC_MEDIATEK is not set +# CONFIG_SND_SOC_MPC5200_AC97 is not set +# CONFIG_SND_SOC_MPC5200_I2S is not set +# CONFIG_SND_SOC_MSM8916_WCD_DIGITAL is not set +# CONFIG_SND_SOC_MT2701 is not set +# CONFIG_SND_SOC_MT8173 is not set +# CONFIG_SND_SOC_NAU8540 is not set +# CONFIG_SND_SOC_NAU8810 is not set +# CONFIG_SND_SOC_NAU8824 is not set +# CONFIG_SND_SOC_PCM1681 is not set +# CONFIG_SND_SOC_PCM1792A is not set +# CONFIG_SND_SOC_PCM179X_I2C is not set +# CONFIG_SND_SOC_PCM179X_SPI is not set +# CONFIG_SND_SOC_PCM3168A_I2C is not set +# CONFIG_SND_SOC_PCM3168A_SPI is not set +# CONFIG_SND_SOC_PCM512x_I2C is not set +# CONFIG_SND_SOC_PCM512x_SPI is not set +# CONFIG_SND_SOC_QCOM is not set +# CONFIG_SND_SOC_RT5616 is not set +# CONFIG_SND_SOC_RT5631 is not set +# CONFIG_SND_SOC_RT5677_SPI is not set +# CONFIG_SND_SOC_SGTL5000 is not set +# CONFIG_SND_SOC_SIRF_AUDIO_CODEC is not set +# CONFIG_SND_SOC_SPDIF is not set +# CONFIG_SND_SOC_SSM2602_I2C is not set +# CONFIG_SND_SOC_SSM2602_SPI is not set +# CONFIG_SND_SOC_SSM4567 is not set +# CONFIG_SND_SOC_STA32X is not set +# CONFIG_SND_SOC_STA350 is not set +# CONFIG_SND_SOC_STI_SAS is not set +# CONFIG_SND_SOC_TAS2552 is not set +# CONFIG_SND_SOC_TAS5086 is not set +# CONFIG_SND_SOC_TAS571X is not set +# CONFIG_SND_SOC_TAS5720 is not set +# CONFIG_SND_SOC_TFA9879 is not set +# CONFIG_SND_SOC_TLV320AIC23_I2C is not set +# CONFIG_SND_SOC_TLV320AIC23_SPI is not set +# CONFIG_SND_SOC_TLV320AIC31XX is not set +# CONFIG_SND_SOC_TLV320AIC3X is not set +# CONFIG_SND_SOC_TPA6130A2 is not set +# CONFIG_SND_SOC_TS3A227E is not set +# CONFIG_SND_SOC_WM8510 is not set +# CONFIG_SND_SOC_WM8523 is not set +# CONFIG_SND_SOC_WM8524 is not set +# CONFIG_SND_SOC_WM8580 is not set +# CONFIG_SND_SOC_WM8711 is not set +# CONFIG_SND_SOC_WM8728 is not set +# CONFIG_SND_SOC_WM8731 is not set +# CONFIG_SND_SOC_WM8737 is not set +# CONFIG_SND_SOC_WM8741 is not set +# CONFIG_SND_SOC_WM8750 is not set +# CONFIG_SND_SOC_WM8753 is not set +# CONFIG_SND_SOC_WM8770 is not set +# CONFIG_SND_SOC_WM8776 is not set +# CONFIG_SND_SOC_WM8804_I2C is not set +# CONFIG_SND_SOC_WM8804_SPI is not set +# CONFIG_SND_SOC_WM8903 is not set +# CONFIG_SND_SOC_WM8960 is not set +# CONFIG_SND_SOC_WM8962 is not set +# CONFIG_SND_SOC_WM8974 is not set +# CONFIG_SND_SOC_WM8978 is not set +# CONFIG_SND_SOC_WM8985 is not set +# CONFIG_SND_SOC_XTFPGA_I2S is not set +# CONFIG_SND_SOC_ZX_AUD96P22 is not set +# CONFIG_SND_SONICVIBES is not set +# CONFIG_SND_SPI is not set +# CONFIG_SND_SSCAPE is not set +# CONFIG_SND_SUN4I_CODEC is not set +# CONFIG_SND_SUPPORT_OLD_API is not set +# CONFIG_SND_TIMER is not set +# CONFIG_SND_TRIDENT is not set +CONFIG_SND_USB=y +# CONFIG_SND_USB_6FIRE is not set +# CONFIG_SND_USB_AUDIO is not set +# CONFIG_SND_USB_CAIAQ is not set +# CONFIG_SND_USB_HIFACE is not set +# CONFIG_SND_USB_POD is not set +# CONFIG_SND_USB_PODHD is not set +# CONFIG_SND_USB_TONEPORT is not set +# CONFIG_SND_USB_UA101 is not set +# CONFIG_SND_USB_US122L is not set +# CONFIG_SND_USB_USX2Y is not set +# CONFIG_SND_USB_VARIAX is not set +# CONFIG_SND_VERBOSE_PRINTK is not set +CONFIG_SND_VERBOSE_PROCFS=y +# CONFIG_SND_VIA82XX is not set +# CONFIG_SND_VIA82XX_MODEM is not set +# CONFIG_SND_VIRTUOSO is not set +# CONFIG_SND_VX222 is not set +# CONFIG_SND_VXPOCKET is not set +# CONFIG_SND_WAVEFRONT is not set +CONFIG_SND_X86=y +# CONFIG_SND_YMFPCI is not set +# CONFIG_SNI_RM is not set +# CONFIG_SOCK_CGROUP_DATA is not set +# CONFIG_SOC_AM33XX is not set +# CONFIG_SOC_AM43XX is not set +# CONFIG_SOC_BRCMSTB is not set +# CONFIG_SOC_CAMERA is not set +# CONFIG_SOC_DRA7XX is not set +# CONFIG_SOC_HAS_OMAP2_SDRC is not set +# CONFIG_SOC_OMAP5 is not set +# CONFIG_SOC_TI is not set +# CONFIG_SOFTLOCKUP_DETECTOR is not set +# CONFIG_SOFT_WATCHDOG is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_SONYPI is not set +# CONFIG_SONY_LAPTOP is not set +# CONFIG_SOUND is not set +# CONFIG_SOUND_OSS_CORE is not set +# CONFIG_SOUND_PRIME is not set +# CONFIG_SP5100_TCO is not set +# CONFIG_SPARSEMEM_MANUAL is not set +# CONFIG_SPARSEMEM_STATIC is not set +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set +# CONFIG_SPARSE_IRQ is not set +# CONFIG_SPARSE_RCU_POINTER is not set +# CONFIG_SPEAKUP is not set +# CONFIG_SPI is not set +# CONFIG_SPINLOCK_TEST is not set +# CONFIG_SPI_ALTERA is not set +# CONFIG_SPI_AU1550 is not set +# CONFIG_SPI_AXI_SPI_ENGINE is not set +# CONFIG_SPI_BCM2835 is not set +# CONFIG_SPI_BCM_QSPI is not set +# CONFIG_SPI_BITBANG is not set +# CONFIG_SPI_BUTTERFLY is not set +# CONFIG_SPI_CADENCE is not set +# CONFIG_SPI_CADENCE_QUADSPI is not set +# CONFIG_SPI_DEBUG is not set +# CONFIG_SPI_DESIGNWARE is not set +# CONFIG_SPI_FSL_DSPI is not set +# CONFIG_SPI_FSL_ESPI is not set +# CONFIG_SPI_FSL_SPI is not set +# CONFIG_SPI_GPIO is not set +# CONFIG_SPI_GPIO_OLD is not set +# CONFIG_SPI_IMG_SPFI is not set +# CONFIG_SPI_LM70_LLP is not set +# CONFIG_SPI_LOOPBACK_TEST is not set +# CONFIG_SPI_MASTER is not set +# CONFIG_SPI_MPC52xx is not set +# CONFIG_SPI_MPC52xx_PSC is not set +# CONFIG_SPI_OCTEON is not set +# CONFIG_SPI_OC_TINY is not set +# CONFIG_SPI_ORION is not set +# CONFIG_SPI_PL022 is not set +# CONFIG_SPI_PPC4xx is not set +# CONFIG_SPI_PXA2XX is not set +# CONFIG_SPI_PXA2XX_PCI is not set +# CONFIG_SPI_ROCKCHIP is not set +# CONFIG_SPI_SC18IS602 is not set +# CONFIG_SPI_SLAVE is not set +# CONFIG_SPI_SPIDEV is not set +# CONFIG_SPI_THUNDERX is not set +# CONFIG_SPI_TI_QSPI is not set +# CONFIG_SPI_TLE62X0 is not set +# CONFIG_SPI_TOPCLIFF_PCH is not set +# CONFIG_SPI_XCOMM is not set +# CONFIG_SPI_XILINX is not set +# CONFIG_SPI_XWAY is not set +# CONFIG_SPI_ZYNQMP_GQSPI is not set +CONFIG_SPLIT_PTLOCK_CPUS=4 +# CONFIG_SPMI is not set +CONFIG_SQUASHFS=y +# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set +# CONFIG_SQUASHFS_DECOMP_MULTI is not set +CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y +# CONFIG_SQUASHFS_DECOMP_SINGLE is not set +# CONFIG_SQUASHFS_EMBEDDED is not set +# CONFIG_SQUASHFS_FILE_CACHE is not set +CONFIG_SQUASHFS_FILE_DIRECT=y +CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 +# CONFIG_SQUASHFS_LZ4 is not set +# CONFIG_SQUASHFS_LZO is not set +# CONFIG_SQUASHFS_XATTR is not set +CONFIG_SQUASHFS_XZ=y +# CONFIG_SQUASHFS_ZLIB is not set +# CONFIG_SQUASHFS_ZSTD is not set +# CONFIG_SRAM is not set +# CONFIG_SRF04 is not set +# CONFIG_SRF08 is not set +# CONFIG_SSB is not set +# CONFIG_SSB_DEBUG is not set +# CONFIG_SSB_DRIVER_GPIO is not set +# CONFIG_SSB_HOST_SOC is not set +# CONFIG_SSB_PCMCIAHOST is not set +CONFIG_SSB_POSSIBLE=y +# CONFIG_SSB_SDIOHOST is not set +# CONFIG_SSB_SILENT is not set +# CONFIG_SSFDC is not set +# CONFIG_STACKTRACE is not set +CONFIG_STACKTRACE_SUPPORT=y +# CONFIG_STACK_TRACER is not set +# CONFIG_STACK_VALIDATION is not set +CONFIG_STAGING=y +# CONFIG_STAGING_BOARD is not set +# CONFIG_STAGING_MEDIA is not set +CONFIG_STANDALONE=y +# CONFIG_STATIC_KEYS_SELFTEST is not set +# CONFIG_STATIC_USERMODEHELPER is not set +CONFIG_STDBINUTILS=y +# CONFIG_STE10XP is not set +# CONFIG_STE_MODEM_RPROC is not set +# CONFIG_STK3310 is not set +# CONFIG_STK8312 is not set +# CONFIG_STK8BA50 is not set +# CONFIG_STM is not set +# CONFIG_STMMAC_ETH is not set +# CONFIG_STMMAC_PCI is not set +# CONFIG_STMMAC_PLATFORM is not set +# CONFIG_STM_DUMMY is not set +# CONFIG_STM_SOURCE_CONSOLE is not set +CONFIG_STP=y +# CONFIG_STREAM_PARSER is not set +# CONFIG_STRICT_DEVMEM is not set +CONFIG_STRICT_KERNEL_RWX=y +CONFIG_STRICT_MODULE_RWX=y +# CONFIG_STRING_SELFTEST is not set +CONFIG_STRIP_ASM_SYMS=y +# CONFIG_STX104 is not set +# CONFIG_SUN4I_GPADC is not set +# CONFIG_SUNDANCE is not set +# CONFIG_SUNGEM is not set +# CONFIG_SUNRPC is not set +# CONFIG_SUNRPC_DEBUG is not set +# CONFIG_SUNRPC_GSS is not set +# CONFIG_SUNXI_SRAM is not set +# CONFIG_SUN_PARTITION is not set +# CONFIG_SURFACE_3_BUTTON is not set +# CONFIG_SUSPEND is not set +# CONFIG_SUSPEND_SKIP_SYNC is not set +CONFIG_SWAP=y +# CONFIG_SWCONFIG is not set +# CONFIG_SWCONFIG_B53 is not set +# CONFIG_SWCONFIG_B53_SPI_DRIVER is not set +# CONFIG_SWCONFIG_LEDS is not set +# CONFIG_SX9500 is not set +# CONFIG_SXGBE_ETH is not set +# CONFIG_SYNCLINK_CS is not set +# CONFIG_SYNC_FILE is not set +# CONFIG_SYNOPSYS_DWC_ETH_QOS is not set +CONFIG_SYN_COOKIES=y +# CONFIG_SYSCON_REBOOT_MODE is not set +CONFIG_SYSCTL=y +# CONFIG_SYSCTL_SYSCALL is not set +CONFIG_SYSFS=y +# CONFIG_SYSFS_DEPRECATED is not set +# CONFIG_SYSFS_DEPRECATED_V2 is not set +# CONFIG_SYSFS_SYSCALL is not set +# CONFIG_SYSTEMPORT is not set +# CONFIG_SYSTEM_BLACKLIST_KEYRING is not set +# CONFIG_SYSTEM_DATA_VERIFICATION is not set +# CONFIG_SYSTEM_TRUSTED_KEYRING is not set +CONFIG_SYSTEM_TRUSTED_KEYS="" +# CONFIG_SYSV68_PARTITION is not set +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +# CONFIG_SYSV_FS is not set +# CONFIG_SYS_HYPERVISOR is not set +# CONFIG_T5403 is not set +# CONFIG_TARGET_CORE is not set +# CONFIG_TASKSTATS is not set +# CONFIG_TASKS_RCU is not set +# CONFIG_TASK_XACCT is not set +# CONFIG_TC35815 is not set +# CONFIG_TCG_ATMEL is not set +# CONFIG_TCG_CRB is not set +# CONFIG_TCG_INFINEON is not set +# CONFIG_TCG_NSC is not set +# CONFIG_TCG_ST33_I2C is not set +# CONFIG_TCG_TIS is not set +# CONFIG_TCG_TIS_I2C_ATMEL is not set +# CONFIG_TCG_TIS_I2C_INFINEON is not set +# CONFIG_TCG_TIS_I2C_NUVOTON is not set +# CONFIG_TCG_TIS_SPI is not set +# CONFIG_TCG_TIS_ST33ZP24_I2C is not set +# CONFIG_TCG_TIS_ST33ZP24_SPI is not set +# CONFIG_TCG_TPM is not set +# CONFIG_TCG_VTPM_PROXY is not set +# CONFIG_TCG_XEN is not set +# CONFIG_TCIC is not set +CONFIG_TCP_CONG_ADVANCED=y +# CONFIG_TCP_CONG_BBR is not set +# CONFIG_TCP_CONG_BIC is not set +# CONFIG_TCP_CONG_CDG is not set +CONFIG_TCP_CONG_CUBIC=y +# CONFIG_TCP_CONG_DCTCP is not set +# CONFIG_TCP_CONG_HSTCP is not set +# CONFIG_TCP_CONG_HTCP is not set +# CONFIG_TCP_CONG_HYBLA is not set +# CONFIG_TCP_CONG_ILLINOIS is not set +# CONFIG_TCP_CONG_LP is not set +# CONFIG_TCP_CONG_NV is not set +# CONFIG_TCP_CONG_SCALABLE is not set +# CONFIG_TCP_CONG_VEGAS is not set +# CONFIG_TCP_CONG_VENO is not set +# CONFIG_TCP_CONG_WESTWOOD is not set +# CONFIG_TCP_CONG_YEAH is not set +# CONFIG_TCP_MD5SIG is not set +# CONFIG_TCS3414 is not set +# CONFIG_TCS3472 is not set +# CONFIG_TEE is not set +# CONFIG_TEGRA_AHB is not set +# CONFIG_TEGRA_HOST1X is not set +# CONFIG_TEHUTI is not set +# CONFIG_TERANETICS_PHY is not set +# CONFIG_TEST_ASYNC_DRIVER_PROBE is not set +# CONFIG_TEST_BITMAP is not set +# CONFIG_TEST_BPF is not set +# CONFIG_TEST_FIRMWARE is not set +# CONFIG_TEST_HASH is not set +# CONFIG_TEST_HEXDUMP is not set +# CONFIG_TEST_KMOD is not set +# CONFIG_TEST_KSTRTOX is not set +# CONFIG_TEST_LIST_SORT is not set +# CONFIG_TEST_LKM is not set +# CONFIG_TEST_POWER is not set +# CONFIG_TEST_PRINTF is not set +# CONFIG_TEST_RHASHTABLE is not set +# CONFIG_TEST_SORT is not set +# CONFIG_TEST_STATIC_KEYS is not set +# CONFIG_TEST_STRING_HELPERS is not set +# CONFIG_TEST_SYSCTL is not set +# CONFIG_TEST_UDELAY is not set +# CONFIG_TEST_USER_COPY is not set +# CONFIG_TEST_UUID is not set +CONFIG_TEXTSEARCH=y +# CONFIG_TEXTSEARCH_BM is not set +# CONFIG_TEXTSEARCH_FSM is not set +# CONFIG_TEXTSEARCH_KMP is not set +# CONFIG_THERMAL is not set +# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set +# CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR is not set +# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set +# CONFIG_THERMAL_EMULATION is not set +# CONFIG_THERMAL_GOV_BANG_BANG is not set +# CONFIG_THERMAL_GOV_FAIR_SHARE is not set +# CONFIG_THERMAL_GOV_POWER_ALLOCATOR is not set +# CONFIG_THERMAL_GOV_USER_SPACE is not set +# CONFIG_THERMAL_HWMON is not set +# CONFIG_THERMAL_WRITABLE_TRIPS is not set +# CONFIG_THINKPAD_ACPI is not set +# CONFIG_THRUSTMASTER_FF is not set +# CONFIG_THUNDERBOLT is not set +# CONFIG_THUNDER_NIC_BGX is not set +# CONFIG_THUNDER_NIC_PF is not set +# CONFIG_THUNDER_NIC_RGX is not set +# CONFIG_THUNDER_NIC_VF is not set +# CONFIG_TICK_CPU_ACCOUNTING is not set +CONFIG_TICK_ONESHOT=y +# CONFIG_TIFM_CORE is not set +# CONFIG_TIGON3 is not set +# CONFIG_TIMB_DMA is not set +CONFIG_TIMERFD=y +# CONFIG_TIMER_STATS is not set +CONFIG_TINY_RCU=y +# CONFIG_TIPC is not set +# CONFIG_TI_ADC081C is not set +# CONFIG_TI_ADC0832 is not set +# CONFIG_TI_ADC084S021 is not set +# CONFIG_TI_ADC108S102 is not set +# CONFIG_TI_ADC12138 is not set +# CONFIG_TI_ADC128S052 is not set +# CONFIG_TI_ADC161S626 is not set +# CONFIG_TI_ADS1015 is not set +# CONFIG_TI_ADS7950 is not set +# CONFIG_TI_ADS8688 is not set +# CONFIG_TI_AM335X_ADC is not set +# CONFIG_TI_CPSW is not set +# CONFIG_TI_CPSW_ALE is not set +# CONFIG_TI_CPTS is not set +# CONFIG_TI_DAC7512 is not set +# CONFIG_TI_DAVINCI_CPDMA is not set +# CONFIG_TI_DAVINCI_MDIO is not set +# CONFIG_TI_ST is not set +# CONFIG_TI_SYSCON_RESET is not set +# CONFIG_TI_TLC4541 is not set +# CONFIG_TLAN is not set +# CONFIG_TLS is not set +# CONFIG_TMD_HERMES is not set +# CONFIG_TMP006 is not set +# CONFIG_TMP007 is not set +CONFIG_TMPFS=y +# CONFIG_TMPFS_POSIX_ACL is not set +CONFIG_TMPFS_XATTR=y +# CONFIG_TOPSTAR_LAPTOP is not set +# CONFIG_TORTURE_TEST is not set +# CONFIG_TOSHIBA_HAPS is not set +# CONFIG_TOUCHSCREEN_AD7877 is not set +# CONFIG_TOUCHSCREEN_AD7879 is not set +# CONFIG_TOUCHSCREEN_AD7879_I2C is not set +# CONFIG_TOUCHSCREEN_AD7879_SPI is not set +# CONFIG_TOUCHSCREEN_ADS7846 is not set +# CONFIG_TOUCHSCREEN_AR1021_I2C is not set +# CONFIG_TOUCHSCREEN_ATMEL_MXT is not set +# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set +# CONFIG_TOUCHSCREEN_BU21013 is not set +# CONFIG_TOUCHSCREEN_CHIPONE_ICN8318 is not set +# CONFIG_TOUCHSCREEN_CY8CTMG110 is not set +# CONFIG_TOUCHSCREEN_CYTTSP4_CORE is not set +# CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set +# CONFIG_TOUCHSCREEN_DYNAPRO is not set +# CONFIG_TOUCHSCREEN_EDT_FT5X06 is not set +# CONFIG_TOUCHSCREEN_EETI is not set +# CONFIG_TOUCHSCREEN_EGALAX is not set +# CONFIG_TOUCHSCREEN_EGALAX_SERIAL is not set +# CONFIG_TOUCHSCREEN_EKTF2127 is not set +# CONFIG_TOUCHSCREEN_ELAN is not set +# CONFIG_TOUCHSCREEN_ELO is not set +# CONFIG_TOUCHSCREEN_FT6236 is not set +# CONFIG_TOUCHSCREEN_FUJITSU is not set +# CONFIG_TOUCHSCREEN_GOODIX is not set +# CONFIG_TOUCHSCREEN_GUNZE is not set +# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set +# CONFIG_TOUCHSCREEN_ILI210X is not set +# CONFIG_TOUCHSCREEN_IMX6UL_TSC is not set +# CONFIG_TOUCHSCREEN_INEXIO is not set +# CONFIG_TOUCHSCREEN_MAX11801 is not set +# CONFIG_TOUCHSCREEN_MCS5000 is not set +# CONFIG_TOUCHSCREEN_MELFAS_MIP4 is not set +# CONFIG_TOUCHSCREEN_MK712 is not set +# CONFIG_TOUCHSCREEN_MMS114 is not set +# CONFIG_TOUCHSCREEN_MTOUCH is not set +# CONFIG_TOUCHSCREEN_PENMOUNT is not set +# CONFIG_TOUCHSCREEN_PIXCIR is not set +# CONFIG_TOUCHSCREEN_RM_TS is not set +# CONFIG_TOUCHSCREEN_ROHM_BU21023 is not set +# CONFIG_TOUCHSCREEN_S3C2410 is not set +# CONFIG_TOUCHSCREEN_SILEAD is not set +# CONFIG_TOUCHSCREEN_SIS_I2C is not set +# CONFIG_TOUCHSCREEN_ST1232 is not set +# CONFIG_TOUCHSCREEN_STMFTS is not set +# CONFIG_TOUCHSCREEN_SUR40 is not set +# CONFIG_TOUCHSCREEN_SURFACE3_SPI is not set +# CONFIG_TOUCHSCREEN_SX8654 is not set +# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set +# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set +# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set +# CONFIG_TOUCHSCREEN_TOUCHWIN is not set +# CONFIG_TOUCHSCREEN_TPS6507X is not set +# CONFIG_TOUCHSCREEN_TSC2004 is not set +# CONFIG_TOUCHSCREEN_TSC2005 is not set +# CONFIG_TOUCHSCREEN_TSC2007 is not set +# CONFIG_TOUCHSCREEN_TSC_SERIO is not set +# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set +# CONFIG_TOUCHSCREEN_W90X900 is not set +# CONFIG_TOUCHSCREEN_WACOM_I2C is not set +# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set +# CONFIG_TOUCHSCREEN_WDT87XX_I2C is not set +# CONFIG_TOUCHSCREEN_WM97XX is not set +# CONFIG_TOUCHSCREEN_ZET6223 is not set +# CONFIG_TOUCHSCREEN_ZFORCE is not set +# CONFIG_TPL0102 is not set +# CONFIG_TPS6105X is not set +# CONFIG_TPS65010 is not set +# CONFIG_TPS6507X is not set +# CONFIG_TRACEPOINT_BENCHMARK is not set +# CONFIG_TRACER_SNAPSHOT is not set +# CONFIG_TRACER_SNAPSHOT_PER_CPU_SWAP is not set +# CONFIG_TRACE_BRANCH_PROFILING is not set +# CONFIG_TRACE_ENUM_MAP_FILE is not set +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +# CONFIG_TRACE_SINK is not set +# CONFIG_TRACING_EVENTS_GPIO is not set +CONFIG_TRACING_SUPPORT=y +CONFIG_TRAD_SIGNALS=y +# CONFIG_TRANSPARENT_HUGEPAGE is not set +# CONFIG_TREE_RCU is not set +# CONFIG_TREE_RCU_TRACE is not set +# CONFIG_TRIM_UNUSED_KSYMS is not set +# CONFIG_TRUSTED_KEYS is not set +# CONFIG_TSL2583 is not set +# CONFIG_TSL2x7x is not set +# CONFIG_TSL4531 is not set +# CONFIG_TSYS01 is not set +# CONFIG_TSYS02D is not set +# CONFIG_TTPCI_EEPROM is not set +CONFIG_TTY=y +# CONFIG_TTY_PRINTK is not set +# CONFIG_TUN is not set +# CONFIG_TUN_VNET_CROSS_LE is not set +# CONFIG_TWL4030_CORE is not set +# CONFIG_TWL4030_MADC is not set +# CONFIG_TWL6030_GPADC is not set +# CONFIG_TWL6040_CORE is not set +# CONFIG_TYPEC_TCPM is not set +# CONFIG_TYPEC_UCSI is not set +# CONFIG_TYPHOON is not set +# CONFIG_UACCESS_WITH_MEMCPY is not set +# CONFIG_UBIFS_ATIME_SUPPORT is not set +# CONFIG_UBIFS_FS_ENCRYPTION is not set +# CONFIG_UBIFS_FS_SECURITY is not set +# CONFIG_UBSAN is not set +# CONFIG_UCB1400_CORE is not set +# CONFIG_UCSI is not set +# CONFIG_UDF_FS is not set +CONFIG_UDF_NLS=y +CONFIG_UEVENT_HELPER=y +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +# CONFIG_UFS_FS is not set +# CONFIG_UHID is not set +CONFIG_UID16=y +# CONFIG_UIO is not set +# CONFIG_ULTRA is not set +# CONFIG_ULTRIX_PARTITION is not set +CONFIG_UNIX=y +CONFIG_UNIX98_PTYS=y +# CONFIG_UNIXWARE_DISKLABEL is not set +# CONFIG_UNIX_DIAG is not set +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_UPROBES is not set +# CONFIG_UPROBE_EVENT is not set +# CONFIG_US5182D is not set +# CONFIG_USB is not set +# CONFIG_USBIP_CORE is not set +CONFIG_USBIP_VHCI_HC_PORTS=8 +CONFIG_USBIP_VHCI_NR_HCS=1 +# CONFIG_USBIP_VUDC is not set +# CONFIG_USBPCWATCHDOG is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_ADUTUX is not set +CONFIG_USB_ALI_M5632=y +# CONFIG_USB_AMD5536UDC is not set +CONFIG_USB_AN2720=y +# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set +# CONFIG_USB_APPLEDISPLAY is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARMLINUX=y +# CONFIG_USB_ATM is not set +# CONFIG_USB_BDC_UDC is not set +CONFIG_USB_BELKIN=y +# CONFIG_USB_C67X00_HCD is not set +# CONFIG_USB_CATC is not set +# CONFIG_USB_CDC_COMPOSITE is not set +# CONFIG_USB_CHAOSKEY is not set +# CONFIG_USB_CHIPIDEA is not set +# CONFIG_USB_CONFIGFS is not set +# CONFIG_USB_CXACRU is not set +# CONFIG_USB_CYPRESS_CY7C63 is not set +# CONFIG_USB_CYTHERM is not set +CONFIG_USB_DEFAULT_PERSIST=y +# CONFIG_USB_DSBR is not set +# CONFIG_USB_DUMMY_HCD is not set +# CONFIG_USB_DWC2 is not set +# CONFIG_USB_DWC2_DEBUG is not set +# CONFIG_USB_DWC2_DUAL_ROLE is not set +# CONFIG_USB_DWC2_HOST is not set +# CONFIG_USB_DWC2_PERIPHERAL is not set +# CONFIG_USB_DWC3 is not set +# CONFIG_USB_DWC3_EXYNOS is not set +# CONFIG_USB_DWC3_KEYSTONE is not set +# CONFIG_USB_DWC3_OF_SIMPLE is not set +# CONFIG_USB_DWC3_PCI is not set +# CONFIG_USB_DWC3_QCOM is not set +# CONFIG_USB_DYNAMIC_MINORS is not set +# CONFIG_USB_EG20T is not set +# CONFIG_USB_EHCI_ATH79 is not set +# CONFIG_USB_EHCI_HCD_AT91 is not set +# CONFIG_USB_EHCI_HCD_OMAP is not set +# CONFIG_USB_EHCI_HCD_PPC_OF is not set +# CONFIG_USB_EHCI_MSM is not set +# CONFIG_USB_EHCI_MV is not set +CONFIG_USB_EHCI_ROOT_HUB_TT=y +CONFIG_USB_EHCI_TT_NEWSCHED=y +# CONFIG_USB_EHSET_TEST_FIXTURE is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_EPSON2888 is not set +# CONFIG_USB_EZUSB_FX2 is not set +# CONFIG_USB_FOTG210_HCD is not set +# CONFIG_USB_FOTG210_UDC is not set +# CONFIG_USB_FSL_USB2 is not set +# CONFIG_USB_FTDI_ELAN is not set +# CONFIG_USB_FUNCTIONFS is not set +# CONFIG_USB_FUSB300 is not set +# CONFIG_USB_GADGET is not set +# CONFIG_USB_GADGETFS is not set +# CONFIG_USB_GADGET_DEBUG is not set +# CONFIG_USB_GADGET_DEBUG_FILES is not set +# CONFIG_USB_GADGET_DEBUG_FS is not set +CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2 +CONFIG_USB_GADGET_VBUS_DRAW=2 +# CONFIG_USB_GADGET_XILINX is not set +# CONFIG_USB_GL860 is not set +# CONFIG_USB_GOKU is not set +# CONFIG_USB_GPIO_VBUS is not set +# CONFIG_USB_GR_UDC is not set +# CONFIG_USB_GSPCA is not set +# CONFIG_USB_GSPCA_BENQ is not set +# CONFIG_USB_GSPCA_CONEX is not set +# CONFIG_USB_GSPCA_CPIA1 is not set +# CONFIG_USB_GSPCA_DTCS033 is not set +# CONFIG_USB_GSPCA_ETOMS is not set +# CONFIG_USB_GSPCA_FINEPIX is not set +# CONFIG_USB_GSPCA_JEILINJ is not set +# CONFIG_USB_GSPCA_JL2005BCD is not set +# CONFIG_USB_GSPCA_KINECT is not set +# CONFIG_USB_GSPCA_KONICA is not set +# CONFIG_USB_GSPCA_MARS is not set +# CONFIG_USB_GSPCA_MR97310A is not set +# CONFIG_USB_GSPCA_NW80X is not set +# CONFIG_USB_GSPCA_OV519 is not set +# CONFIG_USB_GSPCA_OV534 is not set +# CONFIG_USB_GSPCA_OV534_9 is not set +# CONFIG_USB_GSPCA_PAC207 is not set +# CONFIG_USB_GSPCA_PAC7302 is not set +# CONFIG_USB_GSPCA_PAC7311 is not set +# CONFIG_USB_GSPCA_SE401 is not set +# CONFIG_USB_GSPCA_SN9C2028 is not set +# CONFIG_USB_GSPCA_SN9C20X is not set +# CONFIG_USB_GSPCA_SONIXB is not set +# CONFIG_USB_GSPCA_SONIXJ is not set +# CONFIG_USB_GSPCA_SPCA1528 is not set +# CONFIG_USB_GSPCA_SPCA500 is not set +# CONFIG_USB_GSPCA_SPCA501 is not set +# CONFIG_USB_GSPCA_SPCA505 is not set +# CONFIG_USB_GSPCA_SPCA506 is not set +# CONFIG_USB_GSPCA_SPCA508 is not set +# CONFIG_USB_GSPCA_SPCA561 is not set +# CONFIG_USB_GSPCA_SQ905 is not set +# CONFIG_USB_GSPCA_SQ905C is not set +# CONFIG_USB_GSPCA_SQ930X is not set +# CONFIG_USB_GSPCA_STK014 is not set +# CONFIG_USB_GSPCA_STK1135 is not set +# CONFIG_USB_GSPCA_STV0680 is not set +# CONFIG_USB_GSPCA_SUNPLUS is not set +# CONFIG_USB_GSPCA_T613 is not set +# CONFIG_USB_GSPCA_TOPRO is not set +# CONFIG_USB_GSPCA_TOUPTEK is not set +# CONFIG_USB_GSPCA_TV8532 is not set +# CONFIG_USB_GSPCA_VC032X is not set +# CONFIG_USB_GSPCA_VICAM is not set +# CONFIG_USB_GSPCA_XIRLINK_CIT is not set +# CONFIG_USB_GSPCA_ZC3XX is not set +# CONFIG_USB_G_ACM_MS is not set +# CONFIG_USB_G_DBGP is not set +# CONFIG_USB_G_HID is not set +# CONFIG_USB_G_MULTI is not set +# CONFIG_USB_G_NCM is not set +# CONFIG_USB_G_NOKIA is not set +# CONFIG_USB_G_PRINTER is not set +# CONFIG_USB_G_SERIAL is not set +# CONFIG_USB_G_WEBCAM is not set +# CONFIG_USB_HCD_TEST_MODE is not set +# CONFIG_USB_HID is not set +# CONFIG_USB_HIDDEV is not set +# CONFIG_USB_HSIC_USB3503 is not set +# CONFIG_USB_HSIC_USB4604 is not set +# CONFIG_USB_HSO is not set +# CONFIG_USB_HUB_USB251XB is not set +# CONFIG_USB_HWA_HCD is not set +# CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_IOWARRIOR is not set +# CONFIG_USB_IPHETH is not set +# CONFIG_USB_ISIGHTFW is not set +# CONFIG_USB_ISP116X_HCD is not set +# CONFIG_USB_ISP1301 is not set +# CONFIG_USB_ISP1362_HCD is not set +# CONFIG_USB_ISP1760 is not set +# CONFIG_USB_ISP1760_HCD is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_KBD is not set +# CONFIG_USB_KC2190 is not set +# CONFIG_USB_LAN78XX is not set +# CONFIG_USB_LCD is not set +# CONFIG_USB_LD is not set +# CONFIG_USB_LED is not set +# CONFIG_USB_LEDS_TRIGGER_USBPORT is not set +# CONFIG_USB_LED_TRIG is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_LINK_LAYER_TEST is not set +# CONFIG_USB_M5602 is not set +# CONFIG_USB_M66592 is not set +# CONFIG_USB_MASS_STORAGE is not set +# CONFIG_USB_MAX3421_HCD is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_MIDI_GADGET is not set +# CONFIG_USB_MON is not set +# CONFIG_USB_MOUSE is not set +# CONFIG_USB_MSM_OTG is not set +# CONFIG_USB_MUSB_HDRC is not set +# CONFIG_USB_MV_U3D is not set +# CONFIG_USB_MV_UDC is not set +# CONFIG_USB_MXS_PHY is not set +# CONFIG_USB_NET2272 is not set +# CONFIG_USB_NET2280 is not set +# CONFIG_USB_NET_AX88179_178A is not set +# CONFIG_USB_NET_AX8817X is not set +# CONFIG_USB_NET_CDCETHER is not set +# CONFIG_USB_NET_CDC_EEM is not set +# CONFIG_USB_NET_CDC_MBIM is not set +# CONFIG_USB_NET_CDC_NCM is not set +# CONFIG_USB_NET_CDC_SUBSET is not set +# CONFIG_USB_NET_CH9200 is not set +# CONFIG_USB_NET_CX82310_ETH is not set +# CONFIG_USB_NET_DM9601 is not set +# CONFIG_USB_NET_DRIVERS is not set +# CONFIG_USB_NET_GL620A is not set +# CONFIG_USB_NET_HUAWEI_CDC_NCM is not set +# CONFIG_USB_NET_INT51X1 is not set +# CONFIG_USB_NET_KALMIA is not set +# CONFIG_USB_NET_MCS7830 is not set +# CONFIG_USB_NET_NET1080 is not set +# CONFIG_USB_NET_PLUSB is not set +# CONFIG_USB_NET_QMI_WWAN is not set +# CONFIG_USB_NET_RNDIS_HOST is not set +# CONFIG_USB_NET_RNDIS_WLAN is not set +# CONFIG_USB_NET_SMSC75XX is not set +# CONFIG_USB_NET_SMSC95XX is not set +# CONFIG_USB_NET_SR9700 is not set +# CONFIG_USB_NET_SR9800 is not set +# CONFIG_USB_NET_ZAURUS is not set +# CONFIG_USB_OHCI_HCD is not set +# CONFIG_USB_OHCI_HCD_PCI is not set +# CONFIG_USB_OHCI_HCD_PPC_OF is not set +# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set +# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set +# CONFIG_USB_OHCI_HCD_SSB is not set +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +# CONFIG_USB_OTG is not set +# CONFIG_USB_OTG_BLACKLIST_HUB is not set +# CONFIG_USB_OTG_FSM is not set +# CONFIG_USB_OTG_WHITELIST is not set +# CONFIG_USB_OXU210HP_HCD is not set +# CONFIG_USB_PCI is not set +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_PHY is not set +# CONFIG_USB_PRINTER is not set +# CONFIG_USB_PWC_INPUT_EVDEV is not set +# CONFIG_USB_PXA27X is not set +# CONFIG_USB_R8A66597 is not set +# CONFIG_USB_R8A66597_HCD is not set +# CONFIG_USB_RCAR_PHY is not set +# CONFIG_USB_RENESAS_USBHS is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_RTL8150 is not set +# CONFIG_USB_RTL8152 is not set +# CONFIG_USB_S2255 is not set +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_AIRCABLE is not set +# CONFIG_USB_SERIAL_ARK3116 is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_CH341 is not set +# CONFIG_USB_SERIAL_CP210X is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_CYPRESS_M8 is not set +# CONFIG_USB_SERIAL_DEBUG is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_EDGEPORT_TI is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_F81232 is not set +# CONFIG_USB_SERIAL_F8153X is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_GARMIN is not set +CONFIG_USB_SERIAL_GENERIC=y +# CONFIG_USB_SERIAL_IPAQ is not set +# CONFIG_USB_SERIAL_IPW is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_IUU is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +CONFIG_USB_SERIAL_KEYSPAN_MPR=y +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +CONFIG_USB_SERIAL_KEYSPAN_USA18X=y +CONFIG_USB_SERIAL_KEYSPAN_USA19=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y +CONFIG_USB_SERIAL_KEYSPAN_USA19W=y +CONFIG_USB_SERIAL_KEYSPAN_USA28=y +CONFIG_USB_SERIAL_KEYSPAN_USA28X=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y +CONFIG_USB_SERIAL_KEYSPAN_USA49W=y +CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y +# CONFIG_USB_SERIAL_KLSI is not set +# CONFIG_USB_SERIAL_KOBIL_SCT is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_METRO is not set +# CONFIG_USB_SERIAL_MOS7715_PARPORT is not set +# CONFIG_USB_SERIAL_MOS7720 is not set +# CONFIG_USB_SERIAL_MOS7840 is not set +# CONFIG_USB_SERIAL_MXUPORT is not set +# CONFIG_USB_SERIAL_NAVMAN is not set +# CONFIG_USB_SERIAL_OMNINET is not set +# CONFIG_USB_SERIAL_OPTICON is not set +# CONFIG_USB_SERIAL_OPTION is not set +# CONFIG_USB_SERIAL_OTI6858 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_QCAUX is not set +# CONFIG_USB_SERIAL_QT2 is not set +# CONFIG_USB_SERIAL_QUALCOMM is not set +# CONFIG_USB_SERIAL_SAFE is not set +CONFIG_USB_SERIAL_SAFE_PADDED=y +# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set +# CONFIG_USB_SERIAL_SIMPLE is not set +# CONFIG_USB_SERIAL_SPCP8X5 is not set +# CONFIG_USB_SERIAL_SSU100 is not set +# CONFIG_USB_SERIAL_SYMBOL is not set +# CONFIG_USB_SERIAL_TI is not set +# CONFIG_USB_SERIAL_UPD78F0730 is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_WISHBONE is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_XSENS_MT is not set +# CONFIG_USB_SEVSEG is not set +# CONFIG_USB_SIERRA_NET is not set +# CONFIG_USB_SISUSBVGA is not set +# CONFIG_USB_SL811_HCD is not set +# CONFIG_USB_SNP_UDC_PLAT is not set +# CONFIG_USB_SPEEDTOUCH is not set +# CONFIG_USB_STKWEBCAM is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_ALAUDA is not set +# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_ENE_UB6250 is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_STORAGE_KARMA is not set +# CONFIG_USB_STORAGE_ONETOUCH is not set +# CONFIG_USB_STORAGE_REALTEK is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_SDDR55 is not set +# CONFIG_USB_STORAGE_USBAT is not set +# CONFIG_USB_STV06XX is not set +# CONFIG_USB_SUPPORT is not set +# CONFIG_USB_SWITCH_FSA9480 is not set +# CONFIG_USB_TEST is not set +# CONFIG_USB_TMC is not set +# CONFIG_USB_TRANCEVIBRATOR is not set +# CONFIG_USB_UAS is not set +# CONFIG_USB_UEAGLEATM is not set +# CONFIG_USB_ULPI is not set +# CONFIG_USB_ULPI_BUS is not set +# CONFIG_USB_USBNET is not set +# CONFIG_USB_USS720 is not set +# CONFIG_USB_VIDEO_CLASS is not set +CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y +# CONFIG_USB_VL600 is not set +# CONFIG_USB_WDM is not set +# CONFIG_USB_WHCI_HCD is not set +# CONFIG_USB_WUSB is not set +# CONFIG_USB_WUSB_CBAF is not set +# CONFIG_USB_XHCI_HCD is not set +# CONFIG_USB_XUSBATM is not set +# CONFIG_USB_YUREX is not set +# CONFIG_USB_ZD1201 is not set +# CONFIG_USB_ZERO is not set +# CONFIG_USB_ZR364XX is not set +# CONFIG_USELIB is not set +# CONFIG_USERFAULTFD is not set +# CONFIG_USE_OF is not set +# CONFIG_UTS_NS is not set +# CONFIG_UWB is not set +# CONFIG_U_SERIAL_CONSOLE is not set +# CONFIG_V4L_MEM2MEM_DRIVERS is not set +# CONFIG_V4L_TEST_DRIVERS is not set +# CONFIG_VCNL4000 is not set +# CONFIG_VDSO is not set +# CONFIG_VEML6070 is not set +# CONFIG_VETH is not set +# CONFIG_VEXPRESS_CONFIG is not set +# CONFIG_VF610_ADC is not set +# CONFIG_VF610_DAC is not set +# CONFIG_VFAT_FS is not set +# CONFIG_VGASTATE is not set +# CONFIG_VGA_ARB is not set +# CONFIG_VGA_SWITCHEROO is not set +# CONFIG_VHOST_CROSS_ENDIAN_LEGACY is not set +# CONFIG_VHOST_NET is not set +# CONFIG_VHOST_VSOCK is not set +# CONFIG_VIA_RHINE is not set +# CONFIG_VIA_VELOCITY is not set +# CONFIG_VIDEO_ADV7170 is not set +# CONFIG_VIDEO_ADV7175 is not set +# CONFIG_VIDEO_ADV7180 is not set +# CONFIG_VIDEO_ADV7183 is not set +# CONFIG_VIDEO_ADV7343 is not set +# CONFIG_VIDEO_ADV7393 is not set +# CONFIG_VIDEO_ADV_DEBUG is not set +# CONFIG_VIDEO_AK881X is not set +# CONFIG_VIDEO_BT819 is not set +# CONFIG_VIDEO_BT848 is not set +# CONFIG_VIDEO_BT856 is not set +# CONFIG_VIDEO_BT866 is not set +# CONFIG_VIDEO_CAFE_CCIC is not set +# CONFIG_VIDEO_CS3308 is not set +# CONFIG_VIDEO_CS5345 is not set +# CONFIG_VIDEO_CS53L32A is not set +# CONFIG_VIDEO_CX231XX is not set +# CONFIG_VIDEO_CX2341X is not set +# CONFIG_VIDEO_CX25840 is not set +# CONFIG_VIDEO_CX88 is not set +# CONFIG_VIDEO_DEV is not set +# CONFIG_VIDEO_DM6446_CCDC is not set +# CONFIG_VIDEO_DT3155 is not set +# CONFIG_VIDEO_EM28XX is not set +# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set +# CONFIG_VIDEO_GO7007 is not set +# CONFIG_VIDEO_HDPVR is not set +# CONFIG_VIDEO_HEXIUM_GEMINI is not set +# CONFIG_VIDEO_HEXIUM_ORION is not set +# CONFIG_VIDEO_IR_I2C is not set +# CONFIG_VIDEO_IVTV is not set +# CONFIG_VIDEO_KS0127 is not set +# CONFIG_VIDEO_M52790 is not set +# CONFIG_VIDEO_ML86V7667 is not set +# CONFIG_VIDEO_MSP3400 is not set +# CONFIG_VIDEO_MT9M111 is not set +# CONFIG_VIDEO_MT9V011 is not set +# CONFIG_VIDEO_MXB is not set +# CONFIG_VIDEO_NOON010PC30 is not set +# CONFIG_VIDEO_OMAP2_VOUT is not set +# CONFIG_VIDEO_OV2640 is not set +# CONFIG_VIDEO_OV2659 is not set +# CONFIG_VIDEO_OV6650 is not set +# CONFIG_VIDEO_OV7640 is not set +# CONFIG_VIDEO_OV7670 is not set +# CONFIG_VIDEO_PVRUSB2 is not set +# CONFIG_VIDEO_SAA6588 is not set +# CONFIG_VIDEO_SAA6752HS is not set +# CONFIG_VIDEO_SAA7110 is not set +# CONFIG_VIDEO_SAA711X is not set +# CONFIG_VIDEO_SAA7127 is not set +# CONFIG_VIDEO_SAA7134 is not set +# CONFIG_VIDEO_SAA717X is not set +# CONFIG_VIDEO_SAA7185 is not set +# CONFIG_VIDEO_SH_MOBILE_CEU is not set +# CONFIG_VIDEO_SONY_BTF_MPX is not set +# CONFIG_VIDEO_SR030PC30 is not set +# CONFIG_VIDEO_TDA7432 is not set +# CONFIG_VIDEO_TDA9840 is not set +# CONFIG_VIDEO_TEA6415C is not set +# CONFIG_VIDEO_TEA6420 is not set +# CONFIG_VIDEO_THS7303 is not set +# CONFIG_VIDEO_THS8200 is not set +# CONFIG_VIDEO_TIMBERDALE is not set +# CONFIG_VIDEO_TLV320AIC23B is not set +# CONFIG_VIDEO_TM6000 is not set +# CONFIG_VIDEO_TVAUDIO is not set +# CONFIG_VIDEO_TVP514X is not set +# CONFIG_VIDEO_TVP5150 is not set +# CONFIG_VIDEO_TVP7002 is not set +# CONFIG_VIDEO_TW2804 is not set +# CONFIG_VIDEO_TW9903 is not set +# CONFIG_VIDEO_TW9906 is not set +# CONFIG_VIDEO_UDA1342 is not set +# CONFIG_VIDEO_UPD64031A is not set +# CONFIG_VIDEO_UPD64083 is not set +# CONFIG_VIDEO_USBTV is not set +# CONFIG_VIDEO_USBVISION is not set +# CONFIG_VIDEO_V4L2 is not set +# CONFIG_VIDEO_VP27SMPX is not set +# CONFIG_VIDEO_VPX3220 is not set +# CONFIG_VIDEO_VS6624 is not set +# CONFIG_VIDEO_WM8739 is not set +# CONFIG_VIDEO_WM8775 is not set +# CONFIG_VIDEO_ZORAN is not set +# CONFIG_VIRTIO_BALLOON is not set +# CONFIG_VIRTIO_BLK_SCSI is not set +# CONFIG_VIRTIO_INPUT is not set +# CONFIG_VIRTIO_MMIO is not set +# CONFIG_VIRTIO_PCI is not set +# CONFIG_VIRTUALIZATION is not set +# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set +# CONFIG_VIRT_DRIVERS is not set +CONFIG_VIRT_TO_BUS=y +# CONFIG_VITESSE_PHY is not set +# CONFIG_VL6180 is not set +CONFIG_VLAN_8021Q=y +# CONFIG_VLAN_8021Q_GVRP is not set +# CONFIG_VLAN_8021Q_MVRP is not set +# CONFIG_VME_BUS is not set +# CONFIG_VMSPLIT_1G is not set +# CONFIG_VMSPLIT_2G is not set +# CONFIG_VMSPLIT_2G_OPT is not set +CONFIG_VMSPLIT_3G=y +# CONFIG_VMSPLIT_3G_OPT is not set +# CONFIG_VMWARE_PVSCSI is not set +# CONFIG_VMXNET3 is not set +# CONFIG_VM_EVENT_COUNTERS is not set +# CONFIG_VOP_BUS is not set +# CONFIG_VORTEX is not set +# CONFIG_VSOCKETS is not set +# CONFIG_VT is not set +# CONFIG_VT6655 is not set +# CONFIG_VT6656 is not set +# CONFIG_VXFS_FS is not set +# CONFIG_VXGE is not set +# CONFIG_VXLAN is not set +# CONFIG_VZ89X is not set +# CONFIG_W1 is not set +# CONFIG_W1_CON is not set +# CONFIG_W1_MASTER_DS1WM is not set +# CONFIG_W1_MASTER_DS2482 is not set +# CONFIG_W1_MASTER_DS2490 is not set +# CONFIG_W1_MASTER_GPIO is not set +# CONFIG_W1_MASTER_MATROX is not set +# CONFIG_W1_SLAVE_BQ27000 is not set +# CONFIG_W1_SLAVE_DS2405 is not set +# CONFIG_W1_SLAVE_DS2406 is not set +# CONFIG_W1_SLAVE_DS2408 is not set +# CONFIG_W1_SLAVE_DS2413 is not set +# CONFIG_W1_SLAVE_DS2423 is not set +# CONFIG_W1_SLAVE_DS2431 is not set +# CONFIG_W1_SLAVE_DS2433 is not set +# CONFIG_W1_SLAVE_DS2438 is not set +# CONFIG_W1_SLAVE_DS2760 is not set +# CONFIG_W1_SLAVE_DS2780 is not set +# CONFIG_W1_SLAVE_DS2781 is not set +# CONFIG_W1_SLAVE_DS2805 is not set +# CONFIG_W1_SLAVE_DS28E04 is not set +# CONFIG_W1_SLAVE_SMEM is not set +# CONFIG_W1_SLAVE_THERM is not set +# CONFIG_W83627HF_WDT is not set +# CONFIG_W83877F_WDT is not set +# CONFIG_W83977F_WDT is not set +# CONFIG_WAN is not set +# CONFIG_WANXL is not set +# CONFIG_WARN_ALL_UNSEEDED_RANDOM is not set +CONFIG_WATCHDOG=y +# CONFIG_WATCHDOG_CORE is not set +CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y +# CONFIG_WATCHDOG_NOWAYOUT is not set +# CONFIG_WATCHDOG_PRETIMEOUT_GOV is not set +# CONFIG_WATCHDOG_SYSFS is not set +# CONFIG_WD80x3 is not set +# CONFIG_WDAT_WDT is not set +# CONFIG_WDTPCI is not set +CONFIG_WEXT_CORE=y +CONFIG_WEXT_PRIV=y +CONFIG_WEXT_PROC=y +CONFIG_WEXT_SPY=y +CONFIG_WILINK_PLATFORM_DATA=y +# CONFIG_WIMAX is not set +# CONFIG_WIMAX_GDM72XX is not set +CONFIG_WIRELESS=y +CONFIG_WIRELESS_EXT=y +# CONFIG_WIRELESS_WDS is not set +# CONFIG_WIZNET_W5100 is not set +# CONFIG_WIZNET_W5300 is not set +# CONFIG_WL1251 is not set +# CONFIG_WL12XX is not set +# CONFIG_WL18XX is not set +CONFIG_WLAN=y +# CONFIG_WLAN_VENDOR_ADMTEK is not set +# CONFIG_WLAN_VENDOR_ATH is not set +# CONFIG_WLAN_VENDOR_ATMEL is not set +# CONFIG_WLAN_VENDOR_BROADCOM is not set +# CONFIG_WLAN_VENDOR_CISCO is not set +# CONFIG_WLAN_VENDOR_INTEL is not set +# CONFIG_WLAN_VENDOR_INTERSIL is not set +# CONFIG_WLAN_VENDOR_MARVELL is not set +# CONFIG_WLAN_VENDOR_MEDIATEK is not set +# CONFIG_WLAN_VENDOR_QUANTENNA is not set +# CONFIG_WLAN_VENDOR_RALINK is not set +# CONFIG_WLAN_VENDOR_REALTEK is not set +# CONFIG_WLAN_VENDOR_RSI is not set +# CONFIG_WLAN_VENDOR_ST is not set +# CONFIG_WLAN_VENDOR_TI is not set +# CONFIG_WLAN_VENDOR_ZYDAS is not set +# CONFIG_WLCORE is not set +# CONFIG_WL_MEDIATEK is not set +CONFIG_WL_TI=y +CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y +# CONFIG_WQ_WATCHDOG is not set +# CONFIG_WW_MUTEX_SELFTEST is not set +# CONFIG_X25 is not set +# CONFIG_X509_CERTIFICATE_PARSER is not set +# CONFIG_X86_DEBUG_STATIC_CPU_HAS is not set +# CONFIG_X86_PKG_TEMP_THERMAL is not set +CONFIG_X86_SYSFB=y +# CONFIG_XEN is not set +CONFIG_XFRM=y +# CONFIG_XFRM_IPCOMP is not set +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_STATISTICS is not set +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_XFRM_USER is not set +# CONFIG_XFS_DEBUG is not set +# CONFIG_XFS_FS is not set +# CONFIG_XFS_POSIX_ACL is not set +# CONFIG_XFS_QUOTA is not set +# CONFIG_XFS_RT is not set +# CONFIG_XFS_WARN is not set +# CONFIG_XILINX_AXI_EMAC is not set +# CONFIG_XILINX_DMA is not set +# CONFIG_XILINX_EMACLITE is not set +# CONFIG_XILINX_GMII2RGMII is not set +# CONFIG_XILINX_LL_TEMAC is not set +# CONFIG_XILINX_WATCHDOG is not set +# CONFIG_XILINX_ZYNQMP_DMA is not set +# CONFIG_XILLYBUS is not set +# CONFIG_XIP_KERNEL is not set +# CONFIG_XMON is not set +CONFIG_XZ_DEC=y +# CONFIG_XZ_DEC_ARM is not set +# CONFIG_XZ_DEC_ARMTHUMB is not set +# CONFIG_XZ_DEC_BCJ is not set +# CONFIG_XZ_DEC_IA64 is not set +# CONFIG_XZ_DEC_POWERPC is not set +# CONFIG_XZ_DEC_SPARC is not set +# CONFIG_XZ_DEC_TEST is not set +# CONFIG_XZ_DEC_X86 is not set +# CONFIG_YAM is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_YENTA is not set +# CONFIG_YENTA_O2 is not set +# CONFIG_YENTA_RICOH is not set +# CONFIG_YENTA_TI is not set +# CONFIG_YENTA_TOSHIBA is not set +# CONFIG_ZBUD is not set +# CONFIG_ZD1211RW is not set +# CONFIG_ZD1211RW_DEBUG is not set +# CONFIG_ZEROPLUS_FF is not set +# CONFIG_ZIIRAVE_WATCHDOG is not set +# CONFIG_ZISOFS is not set +# CONFIG_ZLIB_DEFLATE is not set +# CONFIG_ZLIB_INFLATE is not set +CONFIG_ZONE_DMA=y +# CONFIG_ZPA2326 is not set +# CONFIG_ZPOOL is not set +# CONFIG_ZRAM is not set +# CONFIG_ZSMALLOC is not set +# CONFIG_ZX_TDM is not set diff --git a/target/linux/generic/config-4.4 b/target/linux/generic/config-4.4 index 980a7871e8..050756933d 100644 --- a/target/linux/generic/config-4.4 +++ b/target/linux/generic/config-4.4 @@ -82,7 +82,7 @@ CONFIG_32BIT=y # CONFIG_ADM6996_PHY is not set # CONFIG_ADM8211 is not set # CONFIG_ADT7316 is not set -# CONFIG_ADVISE_SYSCALLS is not set +CONFIG_ADVISE_SYSCALLS=y # CONFIG_ADXRS450 is not set CONFIG_AEABI=y # CONFIG_AFFS_FS is not set @@ -208,14 +208,14 @@ CONFIG_ARCH_FLATMEM_ENABLE=y # CONFIG_ARCH_ZYNQ is not set # CONFIG_ARCNET is not set # CONFIG_ARC_EMAC is not set +# CONFIG_ARM64_ERRATUM_819472 is not set +# CONFIG_ARM64_ERRATUM_824069 is not set # CONFIG_ARM64_ERRATUM_826319 is not set # CONFIG_ARM64_ERRATUM_827319 is not set -# CONFIG_ARM64_ERRATUM_824069 is not set -# CONFIG_ARM64_ERRATUM_819472 is not set # CONFIG_ARM64_ERRATUM_832075 is not set # CONFIG_ARM64_ERRATUM_834220 is not set -# CONFIG_ARM64_ERRATUM_845719 is not set # CONFIG_ARM64_ERRATUM_843419 is not set +# CONFIG_ARM64_ERRATUM_845719 is not set # CONFIG_ARM_APPENDED_DTB is not set # CONFIG_ARM_ARCH_TIMER is not set # CONFIG_ARM_BIG_LITTLE_CPUFREQ is not set @@ -1710,7 +1710,7 @@ CONFIG_IPW2200_MONITOR=y CONFIG_IP_ADVANCED_ROUTER=y # CONFIG_IP_DCCP is not set # CONFIG_IP_FIB_TRIE_STATS is not set -CONFIG_IP_MROUTE=y +# CONFIG_IP_MROUTE is not set CONFIG_IP_MROUTE_MULTIPLE_TABLES=y CONFIG_IP_MULTICAST=y CONFIG_IP_MULTIPLE_TABLES=y @@ -1821,6 +1821,7 @@ CONFIG_JOLIET=y # CONFIG_KALLSYMS_ALL is not set # CONFIG_KALLSYMS_UNCOMPRESSED is not set # CONFIG_KARMA_PARTITION is not set +# CONFIG_KASAN is not set # CONFIG_KERNEL_BZIP2 is not set # CONFIG_KERNEL_CAT is not set # CONFIG_KERNEL_GZIP is not set @@ -2682,7 +2683,6 @@ CONFIG_NFS_V3=y # CONFIG_NFT_DUP_IPV6 is not set # CONFIG_NF_CONNTRACK is not set # CONFIG_NF_CONNTRACK_AMANDA is not set -# CONFIG_NF_CONNTRACK_CHAIN_EVENTS is not set # CONFIG_NF_CONNTRACK_EVENTS is not set # CONFIG_NF_CONNTRACK_FTP is not set # CONFIG_NF_CONNTRACK_H323 is not set @@ -3651,7 +3651,6 @@ CONFIG_SHMEM=y # CONFIG_SH_ETH is not set # CONFIG_SH_TIMER_CMT is not set # CONFIG_SH_TIMER_MTU2 is not set -# CONFIG_SHORTCUT_FE is not set # CONFIG_SH_TIMER_TMU is not set # CONFIG_SI7005 is not set # CONFIG_SI7020 is not set @@ -3861,9 +3860,9 @@ CONFIG_SND_PROC_FS=y # CONFIG_SND_SOC_IMX_ES8328 is not set # CONFIG_SND_SOC_IMX_SPDIF is not set # CONFIG_SND_SOC_IMX_WM8962 is not set +# CONFIG_SND_SOC_INTEL_BYTCR_RT5640_MACH is not set # CONFIG_SND_SOC_INTEL_BYT_MAX98090_MACH is not set # CONFIG_SND_SOC_INTEL_BYT_RT5640_MACH is not set -# CONFIG_SND_SOC_INTEL_BYTCR_RT5640_MACH is not set # CONFIG_SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH is not set # CONFIG_SND_SOC_INTEL_CHT_BSW_RT5645_MACH is not set # CONFIG_SND_SOC_INTEL_CHT_BSW_RT5672_MACH is not set diff --git a/target/linux/generic/config-4.9 b/target/linux/generic/config-4.9 index 6a703c0a03..4ebcfb636c 100644 --- a/target/linux/generic/config-4.9 +++ b/target/linux/generic/config-4.9 @@ -19,6 +19,7 @@ CONFIG_32BIT=y # CONFIG_ACPI_CUSTOM_METHOD is not set # CONFIG_ACPI_EXTLOG is not set # CONFIG_ACPI_HED is not set +# CONFIG_ACPI_NFIT is not set # CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set # CONFIG_ACPI_TABLE_UPGRADE is not set # CONFIG_ACPI_VIDEO is not set @@ -90,7 +91,7 @@ CONFIG_32BIT=y # CONFIG_ADM6996_PHY is not set # CONFIG_ADM8211 is not set # CONFIG_ADT7316 is not set -# CONFIG_ADVISE_SYSCALLS is not set +CONFIG_ADVISE_SYSCALLS=y # CONFIG_ADXRS450 is not set CONFIG_AEABI=y # CONFIG_AFE4403 is not set @@ -259,14 +260,14 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARCH_ZYNQMP is not set # CONFIG_ARCNET is not set # CONFIG_ARC_EMAC is not set +# CONFIG_ARM64_ERRATUM_819472 is not set +# CONFIG_ARM64_ERRATUM_824069 is not set # CONFIG_ARM64_ERRATUM_826319 is not set # CONFIG_ARM64_ERRATUM_827319 is not set -# CONFIG_ARM64_ERRATUM_824069 is not set -# CONFIG_ARM64_ERRATUM_819472 is not set # CONFIG_ARM64_ERRATUM_832075 is not set # CONFIG_ARM64_ERRATUM_834220 is not set -# CONFIG_ARM64_ERRATUM_845719 is not set # CONFIG_ARM64_ERRATUM_843419 is not set +# CONFIG_ARM64_ERRATUM_845719 is not set # CONFIG_ARM_APPENDED_DTB is not set # CONFIG_ARM_ARCH_TIMER is not set # CONFIG_ARM_BIG_LITTLE_CPUFREQ is not set @@ -310,6 +311,8 @@ CONFIG_ARM_GIC_MAX_NR=1 # CONFIG_ARM_PATCH_PHYS_VIRT is not set # CONFIG_ARM_PSCI is not set # CONFIG_ARM_PTDUMP is not set +# CONFIG_ARM_SBSA_WATCHDOG is not set +# CONFIG_ARM_SCPI_PROTOCOL is not set # CONFIG_ARM_TIMER_SP804 is not set # CONFIG_ARM_UNWIND is not set # CONFIG_ARM_VIRT_EXT is not set @@ -323,6 +326,7 @@ CONFIG_ARM_GIC_MAX_NR=1 # CONFIG_ASYNC_TX_DMA is not set # CONFIG_AT76C50X_USB is not set # CONFIG_AT803X_PHY is not set +# CONFIG_AT91_SAMA5D2_ADC is not set # CONFIG_ATA is not set # CONFIG_ATAGS is not set CONFIG_ATAGS_PROC=y @@ -999,8 +1003,7 @@ CONFIG_DEBUG_KERNEL=y # CONFIG_DEBUG_WX is not set # CONFIG_DEBUG_ZBOOT is not set # CONFIG_DECNET is not set -CONFIG_DEFAULT_BBR=y -# CONFIG_DEFAULT_CUBIC is not set +CONFIG_DEFAULT_CUBIC=y CONFIG_DEFAULT_DEADLINE=y CONFIG_DEFAULT_HOSTNAME="(none)" CONFIG_DEFAULT_IOSCHED="deadline" @@ -1009,8 +1012,7 @@ CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 # CONFIG_DEFAULT_RENO is not set CONFIG_DEFAULT_SECURITY="" CONFIG_DEFAULT_SECURITY_DAC=y -CONFIG_DEFAULT_TCP_CONG="bbr" -# CONFIG_DEFAULT_VEGAS is not set +CONFIG_DEFAULT_TCP_CONG="cubic" CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # CONFIG_DELL_RBTN is not set # CONFIG_DELL_SMO8800 is not set @@ -1192,11 +1194,11 @@ CONFIG_EXT4_USE_FOR_EXT2=y # CONFIG_EXTCON is not set # CONFIG_EXTCON_ADC_JACK is not set # CONFIG_EXTCON_GPIO is not set +# CONFIG_EXTCON_MAX3355 is not set # CONFIG_EXTCON_QCOM_SPMI_MISC is not set # CONFIG_EXTCON_RT8973A is not set # CONFIG_EXTCON_SM5502 is not set # CONFIG_EXTCON_USB_GPIO is not set -# CONFIG_EXTCON_MAX3355 is not set CONFIG_EXTRA_FIRMWARE="" CONFIG_EXTRA_TARGETS="" # CONFIG_EXYNOS_ADC is not set @@ -1324,6 +1326,7 @@ CONFIG_FRAME_WARN=1024 # CONFIG_FRONTSWAP is not set # CONFIG_FSCACHE is not set # CONFIG_FSL_EDMA is not set +# CONFIG_FSL_MC_BUS is not set # CONFIG_FSL_PQ_MDIO is not set # CONFIG_FSL_XGMAC_MDIO is not set CONFIG_FSNOTIFY=y @@ -1382,14 +1385,19 @@ CONFIG_GENERIC_NET_UTILS=y # CONFIG_GPIO_ADP5588 is not set # CONFIG_GPIO_ALTERA is not set # CONFIG_GPIO_AMD8111 is not set +# CONFIG_GPIO_AMDPT is not set # CONFIG_GPIO_BCM_KONA is not set # CONFIG_GPIO_BT8XX is not set # CONFIG_GPIO_CS5535 is not set # CONFIG_GPIO_DWAPB is not set # CONFIG_GPIO_EM is not set +# CONFIG_GPIO_F7188X is not set # CONFIG_GPIO_GENERIC_PLATFORM is not set +# CONFIG_GPIO_GPIO_MM is not set # CONFIG_GPIO_GRGPIO is not set # CONFIG_GPIO_ICH is not set +# CONFIG_GPIO_IT87 is not set +# CONFIG_GPIO_LYNXPOINT is not set # CONFIG_GPIO_MAX7300 is not set # CONFIG_GPIO_MAX7301 is not set # CONFIG_GPIO_MAX732X is not set @@ -1415,6 +1423,7 @@ CONFIG_GENERIC_NET_UTILS=y # CONFIG_GPIO_TS5500 is not set # CONFIG_GPIO_VX855 is not set # CONFIG_GPIO_WATCHDOG is not set +# CONFIG_GPIO_WS16C48 is not set # CONFIG_GPIO_XGENE is not set # CONFIG_GPIO_XILINX is not set # CONFIG_GPIO_ZEVIO is not set @@ -1884,6 +1893,7 @@ CONFIG_IO_STRICT_DEVMEM=y # CONFIG_IP6_NF_MATCH_RT is not set # CONFIG_IP6_NF_NAT is not set # CONFIG_IP6_NF_RAW is not set +# CONFIG_IP6_NF_SECURITY is not set # CONFIG_IP6_NF_TARGET_HL is not set # CONFIG_IP6_NF_TARGET_REJECT is not set # CONFIG_IP6_NF_TARGET_SYNPROXY is not set @@ -1921,7 +1931,7 @@ CONFIG_IPW2200_MONITOR=y CONFIG_IP_ADVANCED_ROUTER=y # CONFIG_IP_DCCP is not set # CONFIG_IP_FIB_TRIE_STATS is not set -CONFIG_IP_MROUTE=y +# CONFIG_IP_MROUTE is not set CONFIG_IP_MROUTE_MULTIPLE_TABLES=y CONFIG_IP_MULTICAST=y CONFIG_IP_MULTIPLE_TABLES=y @@ -2037,6 +2047,7 @@ CONFIG_JOLIET=y CONFIG_KALLSYMS_BASE_RELATIVE=y # CONFIG_KALLSYMS_UNCOMPRESSED is not set # CONFIG_KARMA_PARTITION is not set +# CONFIG_KASAN is not set # CONFIG_KCOV is not set # CONFIG_KERNEL_BZIP2 is not set # CONFIG_KERNEL_CAT is not set @@ -2186,6 +2197,7 @@ CONFIG_LEDS_TRIGGER_TIMER=y # CONFIG_LIBIPW_DEBUG is not set # CONFIG_LIBNVDIMM is not set # CONFIG_LIDAR_LITE_V2 is not set +# CONFIG_LIQUIDIO is not set # CONFIG_LIRC_STAGING is not set # CONFIG_LIS3L02DQ is not set # CONFIG_LKDTM is not set @@ -2629,6 +2641,7 @@ CONFIG_MTD_ROOTFS_ROOT_DEV=y # CONFIG_MTD_SPINAND_MT29F is not set # CONFIG_MTD_SPI_NOR is not set # CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=4096 CONFIG_MTD_SPLIT=y # CONFIG_MTD_SPLIT_BRNIMAGE_FW is not set # CONFIG_MTD_SPLIT_EVA_FW is not set @@ -2949,11 +2962,12 @@ CONFIG_NFS_V3=y # CONFIG_NFS_V4 is not set # CONFIG_NFS_V4_1 is not set # CONFIG_NFTL is not set +# CONFIG_NFT_BRIDGE_META is not set +# CONFIG_NFT_BRIDGE_REJECT is not set # CONFIG_NFT_DUP_IPV4 is not set # CONFIG_NFT_DUP_IPV6 is not set # CONFIG_NF_CONNTRACK is not set # CONFIG_NF_CONNTRACK_AMANDA is not set -# CONFIG_NF_CONNTRACK_CHAIN_EVENTS is not set # CONFIG_NF_CONNTRACK_EVENTS is not set # CONFIG_NF_CONNTRACK_FTP is not set # CONFIG_NF_CONNTRACK_H323 is not set @@ -3116,6 +3130,7 @@ CONFIG_PACKET=y CONFIG_PAGE_SIZE_4KB=y # CONFIG_PAGE_SIZE_64KB is not set # CONFIG_PAGE_SIZE_8KB is not set +# CONFIG_PALMAS_GPADC is not set # CONFIG_PANASONIC_LAPTOP is not set # CONFIG_PANEL is not set CONFIG_PANIC_ON_OOPS=y @@ -3207,6 +3222,8 @@ CONFIG_PARTITION_ADVANCED=y # CONFIG_PCI_DISABLE_COMMON_QUIRKS is not set # CONFIG_PCI_HERMES is not set # CONFIG_PCI_HOST_GENERIC is not set +# CONFIG_PCI_HOST_THUNDER_ECAM is not set +# CONFIG_PCI_HOST_THUNDER_PEM is not set # CONFIG_PCI_IOV is not set # CONFIG_PCI_LAYERSCAPE is not set # CONFIG_PCI_MSI is not set @@ -3286,6 +3303,7 @@ CONFIG_PINMUX=y # CONFIG_POWERCAP is not set # CONFIG_POWER_AVS is not set # CONFIG_POWER_RESET is not set +# CONFIG_POWER_RESET_BRCMKONA is not set # CONFIG_POWER_RESET_BRCMSTB is not set # CONFIG_POWER_RESET_GPIO is not set # CONFIG_POWER_RESET_GPIO_RESTART is not set @@ -3902,6 +3920,7 @@ CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_SENSORS_W83795 is not set # CONFIG_SENSORS_W83L785TS is not set # CONFIG_SENSORS_W83L786NG is not set +# CONFIG_SENSORS_XGENE is not set CONFIG_SERIAL_8250=y # CONFIG_SERIAL_8250_ACCENT is not set # CONFIG_SERIAL_8250_BOCA is not set @@ -3929,6 +3948,7 @@ CONFIG_SERIAL_8250_NR_UARTS=2 CONFIG_SERIAL_8250_RUNTIME_UARTS=2 # CONFIG_SERIAL_ALTERA_JTAGUART is not set # CONFIG_SERIAL_ALTERA_UART is not set +# CONFIG_SERIAL_AMBA_PL010 is not set # CONFIG_SERIAL_ARC is not set # CONFIG_SERIAL_BCM63XX is not set # CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set @@ -3984,7 +4004,6 @@ CONFIG_SHMEM=y # CONFIG_SH_TIMER_CMT is not set # CONFIG_SH_TIMER_MTU2 is not set # CONFIG_SH_TIMER_TMU is not set -# CONFIG_SHORTCUT_FE is not set # CONFIG_SI1145 is not set # CONFIG_SI7005 is not set # CONFIG_SI7020 is not set @@ -4068,6 +4087,7 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_DUMMY is not set # CONFIG_SND_DYNAMIC_MINORS is not set # CONFIG_SND_ECHO3G is not set +# CONFIG_SND_EDMA_SOC is not set # CONFIG_SND_EMU10K1 is not set # CONFIG_SND_EMU10K1X is not set # CONFIG_SND_EMU10K1_SEQ is not set @@ -4206,10 +4226,10 @@ CONFIG_SND_PROC_FS=y # CONFIG_SND_SOC_INTEL_BDW_RT5677_MACH is not set # CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH is not set # CONFIG_SND_SOC_INTEL_BXT_RT298_MACH is not set -# CONFIG_SND_SOC_INTEL_BYT_MAX98090_MACH is not set -# CONFIG_SND_SOC_INTEL_BYT_RT5640_MACH is not set # CONFIG_SND_SOC_INTEL_BYTCR_RT5640_MACH is not set # CONFIG_SND_SOC_INTEL_BYTCR_RT5651_MACH is not set +# CONFIG_SND_SOC_INTEL_BYT_MAX98090_MACH is not set +# CONFIG_SND_SOC_INTEL_BYT_RT5640_MACH is not set # CONFIG_SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH is not set # CONFIG_SND_SOC_INTEL_CHT_BSW_RT5645_MACH is not set # CONFIG_SND_SOC_INTEL_CHT_BSW_RT5672_MACH is not set @@ -4272,6 +4292,7 @@ CONFIG_SND_PROC_FS=y # CONFIG_SND_SOC_WM8804_I2C is not set # CONFIG_SND_SOC_WM8804_SPI is not set # CONFIG_SND_SOC_WM8903 is not set +# CONFIG_SND_SOC_WM8960 is not set # CONFIG_SND_SOC_WM8962 is not set # CONFIG_SND_SOC_WM8974 is not set # CONFIG_SND_SOC_WM8978 is not set @@ -4339,6 +4360,7 @@ CONFIG_SND_VERBOSE_PROCFS=y # CONFIG_SPI_BITBANG is not set # CONFIG_SPI_BUTTERFLY is not set # CONFIG_SPI_CADENCE is not set +# CONFIG_SPI_CADENCE_QUADSPI is not set # CONFIG_SPI_DEBUG is not set # CONFIG_SPI_DESIGNWARE is not set # CONFIG_SPI_FSL_DSPI is not set @@ -4481,7 +4503,7 @@ CONFIG_SYSVIPC_SYSCTL=y # CONFIG_TCG_XEN is not set # CONFIG_TCIC is not set CONFIG_TCP_CONG_ADVANCED=y -CONFIG_TCP_CONG_BBR=y +# CONFIG_TCP_CONG_BBR is not set # CONFIG_TCP_CONG_BIC is not set # CONFIG_TCP_CONG_CDG is not set CONFIG_TCP_CONG_CUBIC=y @@ -4493,10 +4515,10 @@ CONFIG_TCP_CONG_CUBIC=y # CONFIG_TCP_CONG_LP is not set # CONFIG_TCP_CONG_NV is not set # CONFIG_TCP_CONG_SCALABLE is not set -CONFIG_TCP_CONG_VEGAS=y +# CONFIG_TCP_CONG_VEGAS is not set # CONFIG_TCP_CONG_VENO is not set # CONFIG_TCP_CONG_WESTWOOD is not set -CONFIG_TCP_CONG_YEAH=y +# CONFIG_TCP_CONG_YEAH is not set # CONFIG_TCP_MD5SIG is not set # CONFIG_TCS3414 is not set # CONFIG_TCS3472 is not set @@ -4538,6 +4560,10 @@ CONFIG_TEXTSEARCH=y # CONFIG_THINKPAD_ACPI is not set # CONFIG_THRUSTMASTER_FF is not set # CONFIG_THUNDERBOLT is not set +# CONFIG_THUNDER_NIC_BGX is not set +# CONFIG_THUNDER_NIC_PF is not set +# CONFIG_THUNDER_NIC_RGX is not set +# CONFIG_THUNDER_NIC_VF is not set # CONFIG_TICK_CPU_ACCOUNTING is not set CONFIG_TICK_ONESHOT=y # CONFIG_TIFM_CORE is not set @@ -4589,6 +4615,8 @@ CONFIG_TMPFS_XATTR=y # CONFIG_TOUCHSCREEN_EDT_FT5X06 is not set # CONFIG_TOUCHSCREEN_EETI is not set # CONFIG_TOUCHSCREEN_EGALAX is not set +# CONFIG_TOUCHSCREEN_EGALAX_SERIAL is not set +# CONFIG_TOUCHSCREEN_EKTF2127 is not set # CONFIG_TOUCHSCREEN_ELAN is not set # CONFIG_TOUCHSCREEN_ELO is not set # CONFIG_TOUCHSCREEN_FT6236 is not set @@ -4601,15 +4629,20 @@ CONFIG_TMPFS_XATTR=y # CONFIG_TOUCHSCREEN_INEXIO is not set # CONFIG_TOUCHSCREEN_MAX11801 is not set # CONFIG_TOUCHSCREEN_MCS5000 is not set +# CONFIG_TOUCHSCREEN_MELFAS_MIP4 is not set # CONFIG_TOUCHSCREEN_MK712 is not set # CONFIG_TOUCHSCREEN_MMS114 is not set # CONFIG_TOUCHSCREEN_MTOUCH is not set # CONFIG_TOUCHSCREEN_PENMOUNT is not set # CONFIG_TOUCHSCREEN_PIXCIR is not set +# CONFIG_TOUCHSCREEN_RM_TS is not set # CONFIG_TOUCHSCREEN_ROHM_BU21023 is not set # CONFIG_TOUCHSCREEN_S3C2410 is not set +# CONFIG_TOUCHSCREEN_SILEAD is not set +# CONFIG_TOUCHSCREEN_SIS_I2C is not set # CONFIG_TOUCHSCREEN_ST1232 is not set # CONFIG_TOUCHSCREEN_SUR40 is not set +# CONFIG_TOUCHSCREEN_SURFACE3_SPI is not set # CONFIG_TOUCHSCREEN_SX8654 is not set # CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set # CONFIG_TOUCHSCREEN_TOUCHIT213 is not set @@ -4729,6 +4762,7 @@ CONFIG_USB_DEFAULT_PERSIST=y # CONFIG_USB_EG20T is not set # CONFIG_USB_EHCI_ATH79 is not set # CONFIG_USB_EHCI_HCD_AT91 is not set +# CONFIG_USB_EHCI_HCD_OMAP is not set # CONFIG_USB_EHCI_HCD_PPC_OF is not set # CONFIG_USB_EHCI_MSM is not set # CONFIG_USB_EHCI_MV is not set diff --git a/target/linux/generic/files/drivers/misc/owl-loader.c b/target/linux/generic/files/drivers/misc/owl-loader.c index 30340da486..f11cb2b49c 100644 --- a/target/linux/generic/files/drivers/misc/owl-loader.c +++ b/target/linux/generic/files/drivers/misc/owl-loader.c @@ -89,7 +89,7 @@ static int ath9k_pci_fixup(struct pci_dev *pdev, const u16 *cal_data, val = swahb32(val); } -#if CONFIG_LANTIQ +#ifdef CONFIG_LANTIQ val = swab32(val); #endif diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_tplink.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_tplink.c index 3a50250715..c346aa8130 100644 --- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_tplink.c +++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_tplink.c @@ -106,6 +106,7 @@ static int mtdsplit_parse_tplink(struct mtd_info *master, return -EINVAL; kernel_size = sizeof(hdr) + be32_to_cpu(hdr.v1.kernel_len); + rootfs_offset = be32_to_cpu(hdr.v1.rootfs_ofs); break; case 2: case 3: @@ -113,6 +114,7 @@ static int mtdsplit_parse_tplink(struct mtd_info *master, return -EINVAL; kernel_size = sizeof(hdr) + be32_to_cpu(hdr.v2.kernel_len); + rootfs_offset = be32_to_cpu(hdr.v2.rootfs_ofs); break; default: return -EINVAL; @@ -121,11 +123,9 @@ static int mtdsplit_parse_tplink(struct mtd_info *master, if (kernel_size > master->size) return -EINVAL; - /* Find the rootfs after the kernel. */ - err = mtd_check_rootfs_magic(master, kernel_size, NULL); - if (!err) { - rootfs_offset = kernel_size; - } else { + /* Find the rootfs */ + err = mtd_check_rootfs_magic(master, rootfs_offset, NULL); + if (err) { /* * The size in the header might cover the rootfs as well. * Start the search from an arbitrary offset. @@ -142,7 +142,7 @@ static int mtdsplit_parse_tplink(struct mtd_info *master, parts[0].name = KERNEL_PART_NAME; parts[0].offset = 0; - parts[0].size = rootfs_offset; + parts[0].size = kernel_size; parts[1].name = ROOTFS_PART_NAME; parts[1].offset = rootfs_offset; diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c index 7f3d5115ab..61811370de 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.c +++ b/target/linux/generic/files/drivers/net/phy/ar8216.c @@ -49,12 +49,6 @@ extern const struct ar8xxx_chip ar8337_chip; .name = (_n), \ } -#define AR8216_MIB_RXB_ID 14 /* RxGoodByte */ -#define AR8216_MIB_TXB_ID 29 /* TxByte */ - -#define AR8236_MIB_RXB_ID 15 /* RxGoodByte */ -#define AR8236_MIB_TXB_ID 31 /* TxByte */ - static const struct ar8xxx_mib_desc ar8216_mibs[] = { MIB_DESC(1, AR8216_STATS_RXBROAD, "RxBroad"), MIB_DESC(1, AR8216_STATS_RXPAUSE, "RxPause"), @@ -1587,56 +1581,6 @@ ar8xxx_sw_set_flush_port_arl_table(struct switch_dev *dev, return ret; } -int -ar8xxx_sw_get_port_stats(struct switch_dev *dev, int port, - struct switch_port_stats *stats) -{ - struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev); - u64 *mib_stats; - int ret; - int mib_txb_id, mib_rxb_id; - - if (!ar8xxx_has_mib_counters(priv)) - return -EOPNOTSUPP; - - if (port >= dev->ports) - return -EINVAL; - - switch (priv->chip_ver) { - case AR8XXX_VER_AR8216: - mib_txb_id = AR8216_MIB_TXB_ID; - mib_rxb_id = AR8216_MIB_RXB_ID; - break; - case AR8XXX_VER_AR8236: - case AR8XXX_VER_AR8316: - case AR8XXX_VER_AR8327: - case AR8XXX_VER_AR8337: - mib_txb_id = AR8236_MIB_TXB_ID; - mib_rxb_id = AR8236_MIB_RXB_ID; - break; - default: - return -EOPNOTSUPP; - } - - mutex_lock(&priv->mib_lock); - ret = ar8xxx_mib_capture(priv); - if (ret) - goto unlock; - - ar8xxx_mib_fetch_port_stat(priv, port, false); - - mib_stats = &priv->mib_stats[port * priv->chip->num_mibs]; - - stats->tx_bytes = mib_stats[mib_txb_id]; - stats->rx_bytes = mib_stats[mib_rxb_id]; - - ret = 0; - -unlock: - mutex_unlock(&priv->mib_lock); - return ret; -} - static const struct switch_attr ar8xxx_sw_attr_globals[] = { { .type = SWITCH_TYPE_INT, @@ -1752,7 +1696,16 @@ static const struct switch_dev_ops ar8xxx_sw_ops = { .apply_config = ar8xxx_sw_hw_apply, .reset_switch = ar8xxx_sw_reset_switch, .get_port_link = ar8xxx_sw_get_port_link, +/* The following op is disabled as it hogs the CPU and degrades performance. + An implementation has been attempted in 4d8a66d but reading MIB data is slow + on ar8xxx switches. + + The high CPU load has been traced down to the ar8xxx_reg_wait() call in + ar8xxx_mib_op(), which has to usleep_range() till the MIB busy flag set by + the request to update the MIB counter is cleared. */ +#if 0 .get_port_stats = ar8xxx_sw_get_port_stats, +#endif }; static const struct ar8xxx_chip ar8216_chip = { diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.h b/target/linux/generic/files/drivers/net/phy/ar8216.h index 321eeb7923..d9508b9ff8 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.h +++ b/target/linux/generic/files/drivers/net/phy/ar8216.h @@ -566,9 +566,6 @@ ar8xxx_sw_set_flush_port_arl_table(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val); int -ar8xxx_sw_get_port_stats(struct switch_dev *dev, int port, - struct switch_port_stats *stats); -int ar8216_wait_bit(struct ar8xxx_priv *priv, int reg, u32 mask, u32 val); static inline struct ar8xxx_priv * diff --git a/target/linux/generic/files/drivers/net/phy/ar8327.c b/target/linux/generic/files/drivers/net/phy/ar8327.c index bae9744736..6ebd2e8aed 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8327.c +++ b/target/linux/generic/files/drivers/net/phy/ar8327.c @@ -1411,7 +1411,16 @@ static const struct switch_dev_ops ar8327_sw_ops = { .apply_config = ar8327_sw_hw_apply, .reset_switch = ar8xxx_sw_reset_switch, .get_port_link = ar8xxx_sw_get_port_link, +/* The following op is disabled as it hogs the CPU and degrades performance. + An implementation has been attempted in 4d8a66d but reading MIB data is slow + on ar8xxx switches. + + The high CPU load has been traced down to the ar8xxx_reg_wait() call in + ar8xxx_mib_op(), which has to usleep_range() till the MIB busy flag set by + the request to update the MIB counter is cleared. */ +#if 0 .get_port_stats = ar8xxx_sw_get_port_stats, +#endif }; const struct ar8xxx_chip ar8327_chip = { diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c index 4b88d1f8fe..670588c84e 100644 --- a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c +++ b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/target/linux/generic/files/drivers/net/phy/rtl8306.c b/target/linux/generic/files/drivers/net/phy/rtl8306.c index 7bbac40617..6d09c1063c 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8306.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8306.c @@ -25,6 +25,7 @@ #include #include #include +#include //#define DEBUG 1 @@ -1032,7 +1033,9 @@ rtl8306_read_status(struct phy_device *pdev) static struct phy_driver rtl8306_driver = { .name = "Realtek RTL8306S", +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,13,0)) .flags = PHY_HAS_MAGICANEG, +#endif .phy_id = RTL8306_MAGIC, .phy_id_mask = 0xffffffff, .features = PHY_BASIC_FEATURES, diff --git a/target/linux/generic/files/drivers/net/phy/swconfig.c b/target/linux/generic/files/drivers/net/phy/swconfig.c index f6f26e43ab..78569a9302 100644 --- a/target/linux/generic/files/drivers/net/phy/swconfig.c +++ b/target/linux/generic/files/drivers/net/phy/swconfig.c @@ -269,13 +269,7 @@ static void swconfig_defaults_init(struct switch_dev *dev) } -static struct genl_family switch_fam = { - .id = GENL_ID_GENERATE, - .name = "switch", - .hdrsize = 0, - .version = 1, - .maxattr = SWITCH_ATTR_MAX, -}; +static struct genl_family switch_fam; static const struct nla_policy switch_policy[SWITCH_ATTR_MAX+1] = { [SWITCH_ATTR_ID] = { .type = NLA_U32 }, @@ -597,8 +591,13 @@ swconfig_parse_ports(struct sk_buff *msg, struct nlattr *head, port = &val->value.ports[val->len]; +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0) if (nla_parse_nested(tb, SWITCH_PORT_ATTR_MAX, nla, port_policy)) +#else + if (nla_parse_nested(tb, SWITCH_PORT_ATTR_MAX, nla, + port_policy, NULL)) +#endif return -EINVAL; if (!tb[SWITCH_PORT_ID]) @@ -619,7 +618,11 @@ swconfig_parse_link(struct sk_buff *msg, struct nlattr *nla, { struct nlattr *tb[SWITCH_LINK_ATTR_MAX + 1]; +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0) if (nla_parse_nested(tb, SWITCH_LINK_ATTR_MAX, nla, link_policy)) +#else + if (nla_parse_nested(tb, SWITCH_LINK_ATTR_MAX, nla, link_policy, NULL)) +#endif return -EINVAL; link->duplex = !!tb[SWITCH_LINK_FLAG_DUPLEX]; @@ -1051,6 +1054,19 @@ static struct genl_ops swconfig_ops[] = { } }; +static struct genl_family switch_fam = { +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0) + .id = GENL_ID_GENERATE, +#endif + .name = "switch", + .hdrsize = 0, + .version = 1, + .maxattr = SWITCH_ATTR_MAX, + .module = THIS_MODULE, + .ops = swconfig_ops, + .n_ops = ARRAY_SIZE(swconfig_ops), +}; + #ifdef CONFIG_OF void of_switch_load_portmap(struct switch_dev *dev) @@ -1222,8 +1238,12 @@ static int __init swconfig_init(void) { INIT_LIST_HEAD(&swdevs); - + +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0) return genl_register_family_with_ops(&switch_fam, swconfig_ops); +#else + return genl_register_family(&switch_fam); +#endif } static void __exit diff --git a/target/linux/generic/hack-4.14/202-reduce_module_size.patch b/target/linux/generic/hack-4.14/202-reduce_module_size.patch new file mode 100644 index 0000000000..d3e014f417 --- /dev/null +++ b/target/linux/generic/hack-4.14/202-reduce_module_size.patch @@ -0,0 +1,24 @@ +From fd66884da2f96d2a7ea73f58b1b86251b959a913 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 16:56:19 +0200 +Subject: kernel: strip unnecessary symbol table information from kernel modules + +reduces default squashfs size on ar71xx by about 4k + +lede-commit: 058d331a39077f159ca8922f1f422a1346d6aa67 +Signed-off-by: Felix Fietkau +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/Makefile ++++ b/Makefile +@@ -402,7 +402,7 @@ KBUILD_AFLAGS_KERNEL := + KBUILD_CFLAGS_KERNEL := + KBUILD_AFLAGS_MODULE := -DMODULE + KBUILD_CFLAGS_MODULE := -DMODULE +-KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds ++KBUILD_LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds $(if $(CONFIG_PROFILING),,-s) + GCC_PLUGINS_CFLAGS := + + # Read KERNELRELEASE from include/config/kernel.release (if it exists) diff --git a/target/linux/generic/hack-4.14/204-module_strip.patch b/target/linux/generic/hack-4.14/204-module_strip.patch new file mode 100644 index 0000000000..2141cfef92 --- /dev/null +++ b/target/linux/generic/hack-4.14/204-module_strip.patch @@ -0,0 +1,205 @@ +From a779a482fb9b9f8fcdf8b2519c789b4b9bb5dd05 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 16:56:48 +0200 +Subject: build: add a hack for removing non-essential module info + +Signed-off-by: Felix Fietkau +--- + include/linux/module.h | 13 ++++++++----- + include/linux/moduleparam.h | 15 ++++++++++++--- + init/Kconfig | 7 +++++++ + kernel/module.c | 5 ++++- + scripts/mod/modpost.c | 12 ++++++++++++ + 5 files changed, 43 insertions(+), 9 deletions(-) + +--- a/include/linux/module.h ++++ b/include/linux/module.h +@@ -158,6 +158,7 @@ extern void cleanup_module(void); + + /* Generic info of form tag = "info" */ + #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info) ++#define MODULE_INFO_STRIP(tag, info) __MODULE_INFO_STRIP(tag, tag, info) + + /* For userspace: you can also call me... */ + #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias) +@@ -201,12 +202,12 @@ extern void cleanup_module(void); + * Author(s), use "Name " or just "Name", for multiple + * authors use multiple MODULE_AUTHOR() statements/lines. + */ +-#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) ++#define MODULE_AUTHOR(_author) MODULE_INFO_STRIP(author, _author) + + /* What your module does. */ +-#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) ++#define MODULE_DESCRIPTION(_description) MODULE_INFO_STRIP(description, _description) + +-#ifdef MODULE ++#if defined(MODULE) && !defined(CONFIG_MODULE_STRIPPED) + /* Creates an alias so file2alias.c can find device table. */ + #define MODULE_DEVICE_TABLE(type, name) \ + extern typeof(name) __mod_##type##__##name##_device_table \ +@@ -233,7 +234,9 @@ extern typeof(name) __mod_##type##__##na + */ + + #if defined(MODULE) || !defined(CONFIG_SYSFS) +-#define MODULE_VERSION(_version) MODULE_INFO(version, _version) ++#define MODULE_VERSION(_version) MODULE_INFO_STRIP(version, _version) ++#elif defined(CONFIG_MODULE_STRIPPED) ++#define MODULE_VERSION(_version) __MODULE_INFO_DISABLED(version) + #else + #define MODULE_VERSION(_version) \ + static struct module_version_attribute ___modver_attr = { \ +@@ -255,7 +258,7 @@ extern typeof(name) __mod_##type##__##na + /* Optional firmware file (or files) needed by the module + * format is simply firmware file name. Multiple firmware + * files require multiple MODULE_FIRMWARE() specifiers */ +-#define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware) ++#define MODULE_FIRMWARE(_firmware) MODULE_INFO_STRIP(firmware, _firmware) + + struct notifier_block; + +--- a/include/linux/moduleparam.h ++++ b/include/linux/moduleparam.h +@@ -17,6 +17,16 @@ + /* Chosen so that structs with an unsigned long line up. */ + #define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) + ++/* This struct is here for syntactic coherency, it is not used */ ++#define __MODULE_INFO_DISABLED(name) \ ++ struct __UNIQUE_ID(name) {} ++ ++#ifdef CONFIG_MODULE_STRIPPED ++#define __MODULE_INFO_STRIP(tag, name, info) __MODULE_INFO_DISABLED(name) ++#else ++#define __MODULE_INFO_STRIP(tag, name, info) __MODULE_INFO(tag, name, info) ++#endif ++ + #ifdef MODULE + #define __MODULE_INFO(tag, name, info) \ + static const char __UNIQUE_ID(name)[] \ +@@ -24,8 +34,7 @@ static const char __UNIQUE_ID(name)[] + = __stringify(tag) "=" info + #else /* !MODULE */ + /* This struct is here for syntactic coherency, it is not used */ +-#define __MODULE_INFO(tag, name, info) \ +- struct __UNIQUE_ID(name) {} ++#define __MODULE_INFO(tag, name, info) __MODULE_INFO_DISABLED(name) + #endif + #define __MODULE_PARM_TYPE(name, _type) \ + __MODULE_INFO(parmtype, name##type, #name ":" _type) +@@ -33,7 +42,7 @@ static const char __UNIQUE_ID(name)[] + /* One for each parameter, describing how to use it. Some files do + multiple of these per line, so can't just use MODULE_INFO. */ + #define MODULE_PARM_DESC(_parm, desc) \ +- __MODULE_INFO(parm, _parm, #_parm ":" desc) ++ __MODULE_INFO_STRIP(parm, _parm, #_parm ":" desc) + + struct kernel_param; + +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -1896,6 +1896,13 @@ config TRIM_UNUSED_KSYMS + + If unsure, or if you need to build out-of-tree modules, say N. + ++config MODULE_STRIPPED ++ bool "Reduce module size" ++ depends on MODULES ++ help ++ Remove module parameter descriptions, author info, version, aliases, ++ device tables, etc. ++ + endif # MODULES + + config MODULES_TREE_LOOKUP +--- a/kernel/module.c ++++ b/kernel/module.c +@@ -2997,9 +2997,11 @@ static struct module *setup_load_info(st + + static int check_modinfo(struct module *mod, struct load_info *info, int flags) + { +- const char *modmagic = get_modinfo(info, "vermagic"); + int err; + ++#ifndef CONFIG_MODULE_STRIPPED ++ const char *modmagic = get_modinfo(info, "vermagic"); ++ + if (flags & MODULE_INIT_IGNORE_VERMAGIC) + modmagic = NULL; + +@@ -3020,6 +3022,7 @@ static int check_modinfo(struct module * + mod->name); + add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK); + } ++#endif + + if (get_modinfo(info, "staging")) { + add_taint_module(mod, TAINT_CRAP, LOCKDEP_STILL_OK); +--- a/scripts/mod/modpost.c ++++ b/scripts/mod/modpost.c +@@ -1982,7 +1982,9 @@ static void read_symbols(char *modname) + symname = remove_dot(info.strtab + sym->st_name); + + handle_modversions(mod, &info, sym, symname); ++#ifndef CONFIG_MODULE_STRIPPED + handle_moddevtable(mod, &info, sym, symname); ++#endif + } + if (!is_vmlinux(modname) || + (is_vmlinux(modname) && vmlinux_section_warnings)) +@@ -2143,8 +2145,10 @@ static void add_header(struct buffer *b, + buf_printf(b, "#include \n"); + buf_printf(b, "#include \n"); + buf_printf(b, "\n"); ++#ifndef CONFIG_MODULE_STRIPPED + buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n"); + buf_printf(b, "MODULE_INFO(name, KBUILD_MODNAME);\n"); ++#endif + buf_printf(b, "\n"); + buf_printf(b, "__visible struct module __this_module\n"); + buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n"); +@@ -2161,16 +2165,20 @@ static void add_header(struct buffer *b, + + static void add_intree_flag(struct buffer *b, int is_intree) + { ++#ifndef CONFIG_MODULE_STRIPPED + if (is_intree) + buf_printf(b, "\nMODULE_INFO(intree, \"Y\");\n"); ++#endif + } + + static void add_staging_flag(struct buffer *b, const char *name) + { ++#ifndef CONFIG_MODULE_STRIPPED + static const char *staging_dir = "drivers/staging"; + + if (strncmp(staging_dir, name, strlen(staging_dir)) == 0) + buf_printf(b, "\nMODULE_INFO(staging, \"Y\");\n"); ++#endif + } + + /** +@@ -2269,11 +2277,13 @@ static void add_depends(struct buffer *b + + static void add_srcversion(struct buffer *b, struct module *mod) + { ++#ifndef CONFIG_MODULE_STRIPPED + if (mod->srcversion[0]) { + buf_printf(b, "\n"); + buf_printf(b, "MODULE_INFO(srcversion, \"%s\");\n", + mod->srcversion); + } ++#endif + } + + static void write_if_changed(struct buffer *b, const char *fname) +@@ -2509,7 +2519,9 @@ int main(int argc, char **argv) + add_staging_flag(&buf, mod->name); + err |= add_versions(&buf, mod); + add_depends(&buf, mod, modules); ++#ifndef CONFIG_MODULE_STRIPPED + add_moddevtable(&buf, mod); ++#endif + add_srcversion(&buf, mod); + + sprintf(fname, "%s.mod.c", mod->name); diff --git a/target/linux/generic/hack-4.14/207-disable-modorder.patch b/target/linux/generic/hack-4.14/207-disable-modorder.patch new file mode 100644 index 0000000000..4afed16a08 --- /dev/null +++ b/target/linux/generic/hack-4.14/207-disable-modorder.patch @@ -0,0 +1,44 @@ +From c9ef4ab0f54356ee9f91d9676ea0ec123840ddc7 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 16:57:33 +0200 +Subject: kernel: do not build modules.order + +It is not needed for anything on the system and skipping this saves some +build time, especially in cases where there is nothing to do. + +lede-commit: afc1675833a7bf5df094f59f7250369520646d04 +Signed-off-by: Felix Fietkau +--- + Makefile | 2 -- + scripts/Makefile.build | 2 +- + 2 files changed, 1 insertion(+), 3 deletions(-) + +--- a/Makefile ++++ b/Makefile +@@ -1212,7 +1212,6 @@ all: modules + + PHONY += modules + modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin +- $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order + @$(kecho) ' Building modules, stage 2.'; + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost + +@@ -1241,7 +1240,6 @@ _modinst_: + rm -f $(MODLIB)/build ; \ + ln -s $(CURDIR) $(MODLIB)/build ; \ + fi +- @cp -f $(objtree)/modules.order $(MODLIB)/ + @cp -f $(objtree)/modules.builtin $(MODLIB)/ + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst + +--- a/scripts/Makefile.build ++++ b/scripts/Makefile.build +@@ -94,7 +94,7 @@ modorder-target := $(obj)/modules.order + # We keep a list of all modules in $(MODVERDIR) + + __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \ +- $(if $(KBUILD_MODULES),$(obj-m) $(modorder-target)) \ ++ $(if $(KBUILD_MODULES),$(obj-m)) \ + $(subdir-ym) $(always) + @: + diff --git a/target/linux/generic/hack-4.14/210-darwin_scripts_include.patch b/target/linux/generic/hack-4.14/210-darwin_scripts_include.patch new file mode 100644 index 0000000000..95c7ea4232 --- /dev/null +++ b/target/linux/generic/hack-4.14/210-darwin_scripts_include.patch @@ -0,0 +1,3065 @@ +From db7c30dcd9a0391bf13b62c9f91e144d762ef43a Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Fri, 7 Jul 2017 17:00:49 +0200 +Subject: Add an OSX specific patch to make the kernel be compiled + +lede-commit: 3fc2a24f0422b2f55f9ed43f116db3111f700526 +Signed-off-by: Florian Fainelli +--- + scripts/kconfig/Makefile | 3 + + scripts/mod/elf.h | 3007 ++++++++++++++++++++++++++++++++++++++++++++ + scripts/mod/mk_elfconfig.c | 4 + + scripts/mod/modpost.h | 4 + + 4 files changed, 3018 insertions(+) + create mode 100644 scripts/mod/elf.h + +--- a/scripts/kconfig/Makefile ++++ b/scripts/kconfig/Makefile +@@ -164,6 +164,9 @@ check-lxdialog := $(srctree)/$(src)/lxd + # we really need to do so. (Do not call gcc as part of make mrproper) + HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \ + -DLOCALE ++ifeq ($(shell uname -s),Darwin) ++HOST_LOADLIBES += -lncurses ++endif + + # =========================================================================== + # Shared Makefile for the various kconfig executables: +--- /dev/null ++++ b/scripts/mod/elf.h +@@ -0,0 +1,3007 @@ ++/* This file defines standard ELF types, structures, and macros. ++ Copyright (C) 1995-2012 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#ifndef _ELF_H ++#define _ELF_H 1 ++ ++/* Standard ELF types. */ ++ ++#include ++ ++/* Type for a 16-bit quantity. */ ++typedef uint16_t Elf32_Half; ++typedef uint16_t Elf64_Half; ++ ++/* Types for signed and unsigned 32-bit quantities. */ ++typedef uint32_t Elf32_Word; ++typedef int32_t Elf32_Sword; ++typedef uint32_t Elf64_Word; ++typedef int32_t Elf64_Sword; ++ ++/* Types for signed and unsigned 64-bit quantities. */ ++typedef uint64_t Elf32_Xword; ++typedef int64_t Elf32_Sxword; ++typedef uint64_t Elf64_Xword; ++typedef int64_t Elf64_Sxword; ++ ++/* Type of addresses. */ ++typedef uint32_t Elf32_Addr; ++typedef uint64_t Elf64_Addr; ++ ++/* Type of file offsets. */ ++typedef uint32_t Elf32_Off; ++typedef uint64_t Elf64_Off; ++ ++/* Type for section indices, which are 16-bit quantities. */ ++typedef uint16_t Elf32_Section; ++typedef uint16_t Elf64_Section; ++ ++/* Type for version symbol information. */ ++typedef Elf32_Half Elf32_Versym; ++typedef Elf64_Half Elf64_Versym; ++ ++ ++/* The ELF file header. This appears at the start of every ELF file. */ ++ ++#define EI_NIDENT (16) ++ ++typedef struct ++{ ++ unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */ ++ Elf32_Half e_type; /* Object file type */ ++ Elf32_Half e_machine; /* Architecture */ ++ Elf32_Word e_version; /* Object file version */ ++ Elf32_Addr e_entry; /* Entry point virtual address */ ++ Elf32_Off e_phoff; /* Program header table file offset */ ++ Elf32_Off e_shoff; /* Section header table file offset */ ++ Elf32_Word e_flags; /* Processor-specific flags */ ++ Elf32_Half e_ehsize; /* ELF header size in bytes */ ++ Elf32_Half e_phentsize; /* Program header table entry size */ ++ Elf32_Half e_phnum; /* Program header table entry count */ ++ Elf32_Half e_shentsize; /* Section header table entry size */ ++ Elf32_Half e_shnum; /* Section header table entry count */ ++ Elf32_Half e_shstrndx; /* Section header string table index */ ++} Elf32_Ehdr; ++ ++typedef struct ++{ ++ unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */ ++ Elf64_Half e_type; /* Object file type */ ++ Elf64_Half e_machine; /* Architecture */ ++ Elf64_Word e_version; /* Object file version */ ++ Elf64_Addr e_entry; /* Entry point virtual address */ ++ Elf64_Off e_phoff; /* Program header table file offset */ ++ Elf64_Off e_shoff; /* Section header table file offset */ ++ Elf64_Word e_flags; /* Processor-specific flags */ ++ Elf64_Half e_ehsize; /* ELF header size in bytes */ ++ Elf64_Half e_phentsize; /* Program header table entry size */ ++ Elf64_Half e_phnum; /* Program header table entry count */ ++ Elf64_Half e_shentsize; /* Section header table entry size */ ++ Elf64_Half e_shnum; /* Section header table entry count */ ++ Elf64_Half e_shstrndx; /* Section header string table index */ ++} Elf64_Ehdr; ++ ++/* Fields in the e_ident array. The EI_* macros are indices into the ++ array. The macros under each EI_* macro are the values the byte ++ may have. */ ++ ++#define EI_MAG0 0 /* File identification byte 0 index */ ++#define ELFMAG0 0x7f /* Magic number byte 0 */ ++ ++#define EI_MAG1 1 /* File identification byte 1 index */ ++#define ELFMAG1 'E' /* Magic number byte 1 */ ++ ++#define EI_MAG2 2 /* File identification byte 2 index */ ++#define ELFMAG2 'L' /* Magic number byte 2 */ ++ ++#define EI_MAG3 3 /* File identification byte 3 index */ ++#define ELFMAG3 'F' /* Magic number byte 3 */ ++ ++/* Conglomeration of the identification bytes, for easy testing as a word. */ ++#define ELFMAG "\177ELF" ++#define SELFMAG 4 ++ ++#define EI_CLASS 4 /* File class byte index */ ++#define ELFCLASSNONE 0 /* Invalid class */ ++#define ELFCLASS32 1 /* 32-bit objects */ ++#define ELFCLASS64 2 /* 64-bit objects */ ++#define ELFCLASSNUM 3 ++ ++#define EI_DATA 5 /* Data encoding byte index */ ++#define ELFDATANONE 0 /* Invalid data encoding */ ++#define ELFDATA2LSB 1 /* 2's complement, little endian */ ++#define ELFDATA2MSB 2 /* 2's complement, big endian */ ++#define ELFDATANUM 3 ++ ++#define EI_VERSION 6 /* File version byte index */ ++ /* Value must be EV_CURRENT */ ++ ++#define EI_OSABI 7 /* OS ABI identification */ ++#define ELFOSABI_NONE 0 /* UNIX System V ABI */ ++#define ELFOSABI_SYSV 0 /* Alias. */ ++#define ELFOSABI_HPUX 1 /* HP-UX */ ++#define ELFOSABI_NETBSD 2 /* NetBSD. */ ++#define ELFOSABI_GNU 3 /* Object uses GNU ELF extensions. */ ++#define ELFOSABI_LINUX ELFOSABI_GNU /* Compatibility alias. */ ++#define ELFOSABI_SOLARIS 6 /* Sun Solaris. */ ++#define ELFOSABI_AIX 7 /* IBM AIX. */ ++#define ELFOSABI_IRIX 8 /* SGI Irix. */ ++#define ELFOSABI_FREEBSD 9 /* FreeBSD. */ ++#define ELFOSABI_TRU64 10 /* Compaq TRU64 UNIX. */ ++#define ELFOSABI_MODESTO 11 /* Novell Modesto. */ ++#define ELFOSABI_OPENBSD 12 /* OpenBSD. */ ++#define ELFOSABI_ARM_AEABI 64 /* ARM EABI */ ++#define ELFOSABI_ARM 97 /* ARM */ ++#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ ++ ++#define EI_ABIVERSION 8 /* ABI version */ ++ ++#define EI_PAD 9 /* Byte index of padding bytes */ ++ ++/* Legal values for e_type (object file type). */ ++ ++#define ET_NONE 0 /* No file type */ ++#define ET_REL 1 /* Relocatable file */ ++#define ET_EXEC 2 /* Executable file */ ++#define ET_DYN 3 /* Shared object file */ ++#define ET_CORE 4 /* Core file */ ++#define ET_NUM 5 /* Number of defined types */ ++#define ET_LOOS 0xfe00 /* OS-specific range start */ ++#define ET_HIOS 0xfeff /* OS-specific range end */ ++#define ET_LOPROC 0xff00 /* Processor-specific range start */ ++#define ET_HIPROC 0xffff /* Processor-specific range end */ ++ ++/* Legal values for e_machine (architecture). */ ++ ++#define EM_NONE 0 /* No machine */ ++#define EM_M32 1 /* AT&T WE 32100 */ ++#define EM_SPARC 2 /* SUN SPARC */ ++#define EM_386 3 /* Intel 80386 */ ++#define EM_68K 4 /* Motorola m68k family */ ++#define EM_88K 5 /* Motorola m88k family */ ++#define EM_860 7 /* Intel 80860 */ ++#define EM_MIPS 8 /* MIPS R3000 big-endian */ ++#define EM_S370 9 /* IBM System/370 */ ++#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */ ++ ++#define EM_PARISC 15 /* HPPA */ ++#define EM_VPP500 17 /* Fujitsu VPP500 */ ++#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */ ++#define EM_960 19 /* Intel 80960 */ ++#define EM_PPC 20 /* PowerPC */ ++#define EM_PPC64 21 /* PowerPC 64-bit */ ++#define EM_S390 22 /* IBM S390 */ ++ ++#define EM_V800 36 /* NEC V800 series */ ++#define EM_FR20 37 /* Fujitsu FR20 */ ++#define EM_RH32 38 /* TRW RH-32 */ ++#define EM_RCE 39 /* Motorola RCE */ ++#define EM_ARM 40 /* ARM */ ++#define EM_FAKE_ALPHA 41 /* Digital Alpha */ ++#define EM_SH 42 /* Hitachi SH */ ++#define EM_SPARCV9 43 /* SPARC v9 64-bit */ ++#define EM_TRICORE 44 /* Siemens Tricore */ ++#define EM_ARC 45 /* Argonaut RISC Core */ ++#define EM_H8_300 46 /* Hitachi H8/300 */ ++#define EM_H8_300H 47 /* Hitachi H8/300H */ ++#define EM_H8S 48 /* Hitachi H8S */ ++#define EM_H8_500 49 /* Hitachi H8/500 */ ++#define EM_IA_64 50 /* Intel Merced */ ++#define EM_MIPS_X 51 /* Stanford MIPS-X */ ++#define EM_COLDFIRE 52 /* Motorola Coldfire */ ++#define EM_68HC12 53 /* Motorola M68HC12 */ ++#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator*/ ++#define EM_PCP 55 /* Siemens PCP */ ++#define EM_NCPU 56 /* Sony nCPU embeeded RISC */ ++#define EM_NDR1 57 /* Denso NDR1 microprocessor */ ++#define EM_STARCORE 58 /* Motorola Start*Core processor */ ++#define EM_ME16 59 /* Toyota ME16 processor */ ++#define EM_ST100 60 /* STMicroelectronic ST100 processor */ ++#define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam*/ ++#define EM_X86_64 62 /* AMD x86-64 architecture */ ++#define EM_PDSP 63 /* Sony DSP Processor */ ++ ++#define EM_FX66 66 /* Siemens FX66 microcontroller */ ++#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */ ++#define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */ ++#define EM_68HC16 69 /* Motorola MC68HC16 microcontroller */ ++#define EM_68HC11 70 /* Motorola MC68HC11 microcontroller */ ++#define EM_68HC08 71 /* Motorola MC68HC08 microcontroller */ ++#define EM_68HC05 72 /* Motorola MC68HC05 microcontroller */ ++#define EM_SVX 73 /* Silicon Graphics SVx */ ++#define EM_ST19 74 /* STMicroelectronics ST19 8 bit mc */ ++#define EM_VAX 75 /* Digital VAX */ ++#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */ ++#define EM_JAVELIN 77 /* Infineon Technologies 32-bit embedded processor */ ++#define EM_FIREPATH 78 /* Element 14 64-bit DSP Processor */ ++#define EM_ZSP 79 /* LSI Logic 16-bit DSP Processor */ ++#define EM_MMIX 80 /* Donald Knuth's educational 64-bit processor */ ++#define EM_HUANY 81 /* Harvard University machine-independent object files */ ++#define EM_PRISM 82 /* SiTera Prism */ ++#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */ ++#define EM_FR30 84 /* Fujitsu FR30 */ ++#define EM_D10V 85 /* Mitsubishi D10V */ ++#define EM_D30V 86 /* Mitsubishi D30V */ ++#define EM_V850 87 /* NEC v850 */ ++#define EM_M32R 88 /* Mitsubishi M32R */ ++#define EM_MN10300 89 /* Matsushita MN10300 */ ++#define EM_MN10200 90 /* Matsushita MN10200 */ ++#define EM_PJ 91 /* picoJava */ ++#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */ ++#define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */ ++#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */ ++#define EM_TILEPRO 188 /* Tilera TILEPro */ ++#define EM_TILEGX 191 /* Tilera TILE-Gx */ ++#define EM_NUM 192 ++ ++/* If it is necessary to assign new unofficial EM_* values, please ++ pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the ++ chances of collision with official or non-GNU unofficial values. */ ++ ++#define EM_ALPHA 0x9026 ++ ++/* Legal values for e_version (version). */ ++ ++#define EV_NONE 0 /* Invalid ELF version */ ++#define EV_CURRENT 1 /* Current version */ ++#define EV_NUM 2 ++ ++/* Section header. */ ++ ++typedef struct ++{ ++ Elf32_Word sh_name; /* Section name (string tbl index) */ ++ Elf32_Word sh_type; /* Section type */ ++ Elf32_Word sh_flags; /* Section flags */ ++ Elf32_Addr sh_addr; /* Section virtual addr at execution */ ++ Elf32_Off sh_offset; /* Section file offset */ ++ Elf32_Word sh_size; /* Section size in bytes */ ++ Elf32_Word sh_link; /* Link to another section */ ++ Elf32_Word sh_info; /* Additional section information */ ++ Elf32_Word sh_addralign; /* Section alignment */ ++ Elf32_Word sh_entsize; /* Entry size if section holds table */ ++} Elf32_Shdr; ++ ++typedef struct ++{ ++ Elf64_Word sh_name; /* Section name (string tbl index) */ ++ Elf64_Word sh_type; /* Section type */ ++ Elf64_Xword sh_flags; /* Section flags */ ++ Elf64_Addr sh_addr; /* Section virtual addr at execution */ ++ Elf64_Off sh_offset; /* Section file offset */ ++ Elf64_Xword sh_size; /* Section size in bytes */ ++ Elf64_Word sh_link; /* Link to another section */ ++ Elf64_Word sh_info; /* Additional section information */ ++ Elf64_Xword sh_addralign; /* Section alignment */ ++ Elf64_Xword sh_entsize; /* Entry size if section holds table */ ++} Elf64_Shdr; ++ ++/* Special section indices. */ ++ ++#define SHN_UNDEF 0 /* Undefined section */ ++#define SHN_LORESERVE 0xff00 /* Start of reserved indices */ ++#define SHN_LOPROC 0xff00 /* Start of processor-specific */ ++#define SHN_BEFORE 0xff00 /* Order section before all others ++ (Solaris). */ ++#define SHN_AFTER 0xff01 /* Order section after all others ++ (Solaris). */ ++#define SHN_HIPROC 0xff1f /* End of processor-specific */ ++#define SHN_LOOS 0xff20 /* Start of OS-specific */ ++#define SHN_HIOS 0xff3f /* End of OS-specific */ ++#define SHN_ABS 0xfff1 /* Associated symbol is absolute */ ++#define SHN_COMMON 0xfff2 /* Associated symbol is common */ ++#define SHN_XINDEX 0xffff /* Index is in extra table. */ ++#define SHN_HIRESERVE 0xffff /* End of reserved indices */ ++ ++/* Legal values for sh_type (section type). */ ++ ++#define SHT_NULL 0 /* Section header table entry unused */ ++#define SHT_PROGBITS 1 /* Program data */ ++#define SHT_SYMTAB 2 /* Symbol table */ ++#define SHT_STRTAB 3 /* String table */ ++#define SHT_RELA 4 /* Relocation entries with addends */ ++#define SHT_HASH 5 /* Symbol hash table */ ++#define SHT_DYNAMIC 6 /* Dynamic linking information */ ++#define SHT_NOTE 7 /* Notes */ ++#define SHT_NOBITS 8 /* Program space with no data (bss) */ ++#define SHT_REL 9 /* Relocation entries, no addends */ ++#define SHT_SHLIB 10 /* Reserved */ ++#define SHT_DYNSYM 11 /* Dynamic linker symbol table */ ++#define SHT_INIT_ARRAY 14 /* Array of constructors */ ++#define SHT_FINI_ARRAY 15 /* Array of destructors */ ++#define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */ ++#define SHT_GROUP 17 /* Section group */ ++#define SHT_SYMTAB_SHNDX 18 /* Extended section indeces */ ++#define SHT_NUM 19 /* Number of defined types. */ ++#define SHT_LOOS 0x60000000 /* Start OS-specific. */ ++#define SHT_GNU_ATTRIBUTES 0x6ffffff5 /* Object attributes. */ ++#define SHT_GNU_HASH 0x6ffffff6 /* GNU-style hash table. */ ++#define SHT_GNU_LIBLIST 0x6ffffff7 /* Prelink library list */ ++#define SHT_CHECKSUM 0x6ffffff8 /* Checksum for DSO content. */ ++#define SHT_LOSUNW 0x6ffffffa /* Sun-specific low bound. */ ++#define SHT_SUNW_move 0x6ffffffa ++#define SHT_SUNW_COMDAT 0x6ffffffb ++#define SHT_SUNW_syminfo 0x6ffffffc ++#define SHT_GNU_verdef 0x6ffffffd /* Version definition section. */ ++#define SHT_GNU_verneed 0x6ffffffe /* Version needs section. */ ++#define SHT_GNU_versym 0x6fffffff /* Version symbol table. */ ++#define SHT_HISUNW 0x6fffffff /* Sun-specific high bound. */ ++#define SHT_HIOS 0x6fffffff /* End OS-specific type */ ++#define SHT_LOPROC 0x70000000 /* Start of processor-specific */ ++#define SHT_HIPROC 0x7fffffff /* End of processor-specific */ ++#define SHT_LOUSER 0x80000000 /* Start of application-specific */ ++#define SHT_HIUSER 0x8fffffff /* End of application-specific */ ++ ++/* Legal values for sh_flags (section flags). */ ++ ++#define SHF_WRITE (1 << 0) /* Writable */ ++#define SHF_ALLOC (1 << 1) /* Occupies memory during execution */ ++#define SHF_EXECINSTR (1 << 2) /* Executable */ ++#define SHF_MERGE (1 << 4) /* Might be merged */ ++#define SHF_STRINGS (1 << 5) /* Contains nul-terminated strings */ ++#define SHF_INFO_LINK (1 << 6) /* `sh_info' contains SHT index */ ++#define SHF_LINK_ORDER (1 << 7) /* Preserve order after combining */ ++#define SHF_OS_NONCONFORMING (1 << 8) /* Non-standard OS specific handling ++ required */ ++#define SHF_GROUP (1 << 9) /* Section is member of a group. */ ++#define SHF_TLS (1 << 10) /* Section hold thread-local data. */ ++#define SHF_MASKOS 0x0ff00000 /* OS-specific. */ ++#define SHF_MASKPROC 0xf0000000 /* Processor-specific */ ++#define SHF_ORDERED (1 << 30) /* Special ordering requirement ++ (Solaris). */ ++#define SHF_EXCLUDE (1 << 31) /* Section is excluded unless ++ referenced or allocated (Solaris).*/ ++ ++/* Section group handling. */ ++#define GRP_COMDAT 0x1 /* Mark group as COMDAT. */ ++ ++/* Symbol table entry. */ ++ ++typedef struct ++{ ++ Elf32_Word st_name; /* Symbol name (string tbl index) */ ++ Elf32_Addr st_value; /* Symbol value */ ++ Elf32_Word st_size; /* Symbol size */ ++ unsigned char st_info; /* Symbol type and binding */ ++ unsigned char st_other; /* Symbol visibility */ ++ Elf32_Section st_shndx; /* Section index */ ++} Elf32_Sym; ++ ++typedef struct ++{ ++ Elf64_Word st_name; /* Symbol name (string tbl index) */ ++ unsigned char st_info; /* Symbol type and binding */ ++ unsigned char st_other; /* Symbol visibility */ ++ Elf64_Section st_shndx; /* Section index */ ++ Elf64_Addr st_value; /* Symbol value */ ++ Elf64_Xword st_size; /* Symbol size */ ++} Elf64_Sym; ++ ++/* The syminfo section if available contains additional information about ++ every dynamic symbol. */ ++ ++typedef struct ++{ ++ Elf32_Half si_boundto; /* Direct bindings, symbol bound to */ ++ Elf32_Half si_flags; /* Per symbol flags */ ++} Elf32_Syminfo; ++ ++typedef struct ++{ ++ Elf64_Half si_boundto; /* Direct bindings, symbol bound to */ ++ Elf64_Half si_flags; /* Per symbol flags */ ++} Elf64_Syminfo; ++ ++/* Possible values for si_boundto. */ ++#define SYMINFO_BT_SELF 0xffff /* Symbol bound to self */ ++#define SYMINFO_BT_PARENT 0xfffe /* Symbol bound to parent */ ++#define SYMINFO_BT_LOWRESERVE 0xff00 /* Beginning of reserved entries */ ++ ++/* Possible bitmasks for si_flags. */ ++#define SYMINFO_FLG_DIRECT 0x0001 /* Direct bound symbol */ ++#define SYMINFO_FLG_PASSTHRU 0x0002 /* Pass-thru symbol for translator */ ++#define SYMINFO_FLG_COPY 0x0004 /* Symbol is a copy-reloc */ ++#define SYMINFO_FLG_LAZYLOAD 0x0008 /* Symbol bound to object to be lazy ++ loaded */ ++/* Syminfo version values. */ ++#define SYMINFO_NONE 0 ++#define SYMINFO_CURRENT 1 ++#define SYMINFO_NUM 2 ++ ++ ++/* How to extract and insert information held in the st_info field. */ ++ ++#define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4) ++#define ELF32_ST_TYPE(val) ((val) & 0xf) ++#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf)) ++ ++/* Both Elf32_Sym and Elf64_Sym use the same one-byte st_info field. */ ++#define ELF64_ST_BIND(val) ELF32_ST_BIND (val) ++#define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val) ++#define ELF64_ST_INFO(bind, type) ELF32_ST_INFO ((bind), (type)) ++ ++/* Legal values for ST_BIND subfield of st_info (symbol binding). */ ++ ++#define STB_LOCAL 0 /* Local symbol */ ++#define STB_GLOBAL 1 /* Global symbol */ ++#define STB_WEAK 2 /* Weak symbol */ ++#define STB_NUM 3 /* Number of defined types. */ ++#define STB_LOOS 10 /* Start of OS-specific */ ++#define STB_GNU_UNIQUE 10 /* Unique symbol. */ ++#define STB_HIOS 12 /* End of OS-specific */ ++#define STB_LOPROC 13 /* Start of processor-specific */ ++#define STB_HIPROC 15 /* End of processor-specific */ ++ ++/* Legal values for ST_TYPE subfield of st_info (symbol type). */ ++ ++#define STT_NOTYPE 0 /* Symbol type is unspecified */ ++#define STT_OBJECT 1 /* Symbol is a data object */ ++#define STT_FUNC 2 /* Symbol is a code object */ ++#define STT_SECTION 3 /* Symbol associated with a section */ ++#define STT_FILE 4 /* Symbol's name is file name */ ++#define STT_COMMON 5 /* Symbol is a common data object */ ++#define STT_TLS 6 /* Symbol is thread-local data object*/ ++#define STT_NUM 7 /* Number of defined types. */ ++#define STT_LOOS 10 /* Start of OS-specific */ ++#define STT_GNU_IFUNC 10 /* Symbol is indirect code object */ ++#define STT_HIOS 12 /* End of OS-specific */ ++#define STT_LOPROC 13 /* Start of processor-specific */ ++#define STT_HIPROC 15 /* End of processor-specific */ ++ ++ ++/* Symbol table indices are found in the hash buckets and chain table ++ of a symbol hash table section. This special index value indicates ++ the end of a chain, meaning no further symbols are found in that bucket. */ ++ ++#define STN_UNDEF 0 /* End of a chain. */ ++ ++ ++/* How to extract and insert information held in the st_other field. */ ++ ++#define ELF32_ST_VISIBILITY(o) ((o) & 0x03) ++ ++/* For ELF64 the definitions are the same. */ ++#define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o) ++ ++/* Symbol visibility specification encoded in the st_other field. */ ++#define STV_DEFAULT 0 /* Default symbol visibility rules */ ++#define STV_INTERNAL 1 /* Processor specific hidden class */ ++#define STV_HIDDEN 2 /* Sym unavailable in other modules */ ++#define STV_PROTECTED 3 /* Not preemptible, not exported */ ++ ++ ++/* Relocation table entry without addend (in section of type SHT_REL). */ ++ ++typedef struct ++{ ++ Elf32_Addr r_offset; /* Address */ ++ Elf32_Word r_info; /* Relocation type and symbol index */ ++} Elf32_Rel; ++ ++/* I have seen two different definitions of the Elf64_Rel and ++ Elf64_Rela structures, so we'll leave them out until Novell (or ++ whoever) gets their act together. */ ++/* The following, at least, is used on Sparc v9, MIPS, and Alpha. */ ++ ++typedef struct ++{ ++ Elf64_Addr r_offset; /* Address */ ++ Elf64_Xword r_info; /* Relocation type and symbol index */ ++} Elf64_Rel; ++ ++/* Relocation table entry with addend (in section of type SHT_RELA). */ ++ ++typedef struct ++{ ++ Elf32_Addr r_offset; /* Address */ ++ Elf32_Word r_info; /* Relocation type and symbol index */ ++ Elf32_Sword r_addend; /* Addend */ ++} Elf32_Rela; ++ ++typedef struct ++{ ++ Elf64_Addr r_offset; /* Address */ ++ Elf64_Xword r_info; /* Relocation type and symbol index */ ++ Elf64_Sxword r_addend; /* Addend */ ++} Elf64_Rela; ++ ++/* How to extract and insert information held in the r_info field. */ ++ ++#define ELF32_R_SYM(val) ((val) >> 8) ++#define ELF32_R_TYPE(val) ((val) & 0xff) ++#define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff)) ++ ++#define ELF64_R_SYM(i) ((i) >> 32) ++#define ELF64_R_TYPE(i) ((i) & 0xffffffff) ++#define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type)) ++ ++/* Program segment header. */ ++ ++typedef struct ++{ ++ Elf32_Word p_type; /* Segment type */ ++ Elf32_Off p_offset; /* Segment file offset */ ++ Elf32_Addr p_vaddr; /* Segment virtual address */ ++ Elf32_Addr p_paddr; /* Segment physical address */ ++ Elf32_Word p_filesz; /* Segment size in file */ ++ Elf32_Word p_memsz; /* Segment size in memory */ ++ Elf32_Word p_flags; /* Segment flags */ ++ Elf32_Word p_align; /* Segment alignment */ ++} Elf32_Phdr; ++ ++typedef struct ++{ ++ Elf64_Word p_type; /* Segment type */ ++ Elf64_Word p_flags; /* Segment flags */ ++ Elf64_Off p_offset; /* Segment file offset */ ++ Elf64_Addr p_vaddr; /* Segment virtual address */ ++ Elf64_Addr p_paddr; /* Segment physical address */ ++ Elf64_Xword p_filesz; /* Segment size in file */ ++ Elf64_Xword p_memsz; /* Segment size in memory */ ++ Elf64_Xword p_align; /* Segment alignment */ ++} Elf64_Phdr; ++ ++/* Special value for e_phnum. This indicates that the real number of ++ program headers is too large to fit into e_phnum. Instead the real ++ value is in the field sh_info of section 0. */ ++ ++#define PN_XNUM 0xffff ++ ++/* Legal values for p_type (segment type). */ ++ ++#define PT_NULL 0 /* Program header table entry unused */ ++#define PT_LOAD 1 /* Loadable program segment */ ++#define PT_DYNAMIC 2 /* Dynamic linking information */ ++#define PT_INTERP 3 /* Program interpreter */ ++#define PT_NOTE 4 /* Auxiliary information */ ++#define PT_SHLIB 5 /* Reserved */ ++#define PT_PHDR 6 /* Entry for header table itself */ ++#define PT_TLS 7 /* Thread-local storage segment */ ++#define PT_NUM 8 /* Number of defined types */ ++#define PT_LOOS 0x60000000 /* Start of OS-specific */ ++#define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */ ++#define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */ ++#define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */ ++#define PT_LOSUNW 0x6ffffffa ++#define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */ ++#define PT_SUNWSTACK 0x6ffffffb /* Stack segment */ ++#define PT_HISUNW 0x6fffffff ++#define PT_HIOS 0x6fffffff /* End of OS-specific */ ++#define PT_LOPROC 0x70000000 /* Start of processor-specific */ ++#define PT_HIPROC 0x7fffffff /* End of processor-specific */ ++ ++/* Legal values for p_flags (segment flags). */ ++ ++#define PF_X (1 << 0) /* Segment is executable */ ++#define PF_W (1 << 1) /* Segment is writable */ ++#define PF_R (1 << 2) /* Segment is readable */ ++#define PF_MASKOS 0x0ff00000 /* OS-specific */ ++#define PF_MASKPROC 0xf0000000 /* Processor-specific */ ++ ++/* Legal values for note segment descriptor types for core files. */ ++ ++#define NT_PRSTATUS 1 /* Contains copy of prstatus struct */ ++#define NT_FPREGSET 2 /* Contains copy of fpregset struct */ ++#define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */ ++#define NT_PRXREG 4 /* Contains copy of prxregset struct */ ++#define NT_TASKSTRUCT 4 /* Contains copy of task structure */ ++#define NT_PLATFORM 5 /* String from sysinfo(SI_PLATFORM) */ ++#define NT_AUXV 6 /* Contains copy of auxv array */ ++#define NT_GWINDOWS 7 /* Contains copy of gwindows struct */ ++#define NT_ASRS 8 /* Contains copy of asrset struct */ ++#define NT_PSTATUS 10 /* Contains copy of pstatus struct */ ++#define NT_PSINFO 13 /* Contains copy of psinfo struct */ ++#define NT_PRCRED 14 /* Contains copy of prcred struct */ ++#define NT_UTSNAME 15 /* Contains copy of utsname struct */ ++#define NT_LWPSTATUS 16 /* Contains copy of lwpstatus struct */ ++#define NT_LWPSINFO 17 /* Contains copy of lwpinfo struct */ ++#define NT_PRFPXREG 20 /* Contains copy of fprxregset struct */ ++#define NT_PRXFPREG 0x46e62b7f /* Contains copy of user_fxsr_struct */ ++#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */ ++#define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */ ++#define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ ++#define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ ++#define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ ++#define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */ ++ ++/* Legal values for the note segment descriptor types for object files. */ ++ ++#define NT_VERSION 1 /* Contains a version string. */ ++ ++ ++/* Dynamic section entry. */ ++ ++typedef struct ++{ ++ Elf32_Sword d_tag; /* Dynamic entry type */ ++ union ++ { ++ Elf32_Word d_val; /* Integer value */ ++ Elf32_Addr d_ptr; /* Address value */ ++ } d_un; ++} Elf32_Dyn; ++ ++typedef struct ++{ ++ Elf64_Sxword d_tag; /* Dynamic entry type */ ++ union ++ { ++ Elf64_Xword d_val; /* Integer value */ ++ Elf64_Addr d_ptr; /* Address value */ ++ } d_un; ++} Elf64_Dyn; ++ ++/* Legal values for d_tag (dynamic entry type). */ ++ ++#define DT_NULL 0 /* Marks end of dynamic section */ ++#define DT_NEEDED 1 /* Name of needed library */ ++#define DT_PLTRELSZ 2 /* Size in bytes of PLT relocs */ ++#define DT_PLTGOT 3 /* Processor defined value */ ++#define DT_HASH 4 /* Address of symbol hash table */ ++#define DT_STRTAB 5 /* Address of string table */ ++#define DT_SYMTAB 6 /* Address of symbol table */ ++#define DT_RELA 7 /* Address of Rela relocs */ ++#define DT_RELASZ 8 /* Total size of Rela relocs */ ++#define DT_RELAENT 9 /* Size of one Rela reloc */ ++#define DT_STRSZ 10 /* Size of string table */ ++#define DT_SYMENT 11 /* Size of one symbol table entry */ ++#define DT_INIT 12 /* Address of init function */ ++#define DT_FINI 13 /* Address of termination function */ ++#define DT_SONAME 14 /* Name of shared object */ ++#define DT_RPATH 15 /* Library search path (deprecated) */ ++#define DT_SYMBOLIC 16 /* Start symbol search here */ ++#define DT_REL 17 /* Address of Rel relocs */ ++#define DT_RELSZ 18 /* Total size of Rel relocs */ ++#define DT_RELENT 19 /* Size of one Rel reloc */ ++#define DT_PLTREL 20 /* Type of reloc in PLT */ ++#define DT_DEBUG 21 /* For debugging; unspecified */ ++#define DT_TEXTREL 22 /* Reloc might modify .text */ ++#define DT_JMPREL 23 /* Address of PLT relocs */ ++#define DT_BIND_NOW 24 /* Process relocations of object */ ++#define DT_INIT_ARRAY 25 /* Array with addresses of init fct */ ++#define DT_FINI_ARRAY 26 /* Array with addresses of fini fct */ ++#define DT_INIT_ARRAYSZ 27 /* Size in bytes of DT_INIT_ARRAY */ ++#define DT_FINI_ARRAYSZ 28 /* Size in bytes of DT_FINI_ARRAY */ ++#define DT_RUNPATH 29 /* Library search path */ ++#define DT_FLAGS 30 /* Flags for the object being loaded */ ++#define DT_ENCODING 32 /* Start of encoded range */ ++#define DT_PREINIT_ARRAY 32 /* Array with addresses of preinit fct*/ ++#define DT_PREINIT_ARRAYSZ 33 /* size in bytes of DT_PREINIT_ARRAY */ ++#define DT_NUM 34 /* Number used */ ++#define DT_LOOS 0x6000000d /* Start of OS-specific */ ++#define DT_HIOS 0x6ffff000 /* End of OS-specific */ ++#define DT_LOPROC 0x70000000 /* Start of processor-specific */ ++#define DT_HIPROC 0x7fffffff /* End of processor-specific */ ++#define DT_PROCNUM DT_MIPS_NUM /* Most used by any processor */ ++ ++/* DT_* entries which fall between DT_VALRNGHI & DT_VALRNGLO use the ++ Dyn.d_un.d_val field of the Elf*_Dyn structure. This follows Sun's ++ approach. */ ++#define DT_VALRNGLO 0x6ffffd00 ++#define DT_GNU_PRELINKED 0x6ffffdf5 /* Prelinking timestamp */ ++#define DT_GNU_CONFLICTSZ 0x6ffffdf6 /* Size of conflict section */ ++#define DT_GNU_LIBLISTSZ 0x6ffffdf7 /* Size of library list */ ++#define DT_CHECKSUM 0x6ffffdf8 ++#define DT_PLTPADSZ 0x6ffffdf9 ++#define DT_MOVEENT 0x6ffffdfa ++#define DT_MOVESZ 0x6ffffdfb ++#define DT_FEATURE_1 0x6ffffdfc /* Feature selection (DTF_*). */ ++#define DT_POSFLAG_1 0x6ffffdfd /* Flags for DT_* entries, effecting ++ the following DT_* entry. */ ++#define DT_SYMINSZ 0x6ffffdfe /* Size of syminfo table (in bytes) */ ++#define DT_SYMINENT 0x6ffffdff /* Entry size of syminfo */ ++#define DT_VALRNGHI 0x6ffffdff ++#define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag)) /* Reverse order! */ ++#define DT_VALNUM 12 ++ ++/* DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the ++ Dyn.d_un.d_ptr field of the Elf*_Dyn structure. ++ ++ If any adjustment is made to the ELF object after it has been ++ built these entries will need to be adjusted. */ ++#define DT_ADDRRNGLO 0x6ffffe00 ++#define DT_GNU_HASH 0x6ffffef5 /* GNU-style hash table. */ ++#define DT_TLSDESC_PLT 0x6ffffef6 ++#define DT_TLSDESC_GOT 0x6ffffef7 ++#define DT_GNU_CONFLICT 0x6ffffef8 /* Start of conflict section */ ++#define DT_GNU_LIBLIST 0x6ffffef9 /* Library list */ ++#define DT_CONFIG 0x6ffffefa /* Configuration information. */ ++#define DT_DEPAUDIT 0x6ffffefb /* Dependency auditing. */ ++#define DT_AUDIT 0x6ffffefc /* Object auditing. */ ++#define DT_PLTPAD 0x6ffffefd /* PLT padding. */ ++#define DT_MOVETAB 0x6ffffefe /* Move table. */ ++#define DT_SYMINFO 0x6ffffeff /* Syminfo table. */ ++#define DT_ADDRRNGHI 0x6ffffeff ++#define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag)) /* Reverse order! */ ++#define DT_ADDRNUM 11 ++ ++/* The versioning entry types. The next are defined as part of the ++ GNU extension. */ ++#define DT_VERSYM 0x6ffffff0 ++ ++#define DT_RELACOUNT 0x6ffffff9 ++#define DT_RELCOUNT 0x6ffffffa ++ ++/* These were chosen by Sun. */ ++#define DT_FLAGS_1 0x6ffffffb /* State flags, see DF_1_* below. */ ++#define DT_VERDEF 0x6ffffffc /* Address of version definition ++ table */ ++#define DT_VERDEFNUM 0x6ffffffd /* Number of version definitions */ ++#define DT_VERNEED 0x6ffffffe /* Address of table with needed ++ versions */ ++#define DT_VERNEEDNUM 0x6fffffff /* Number of needed versions */ ++#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) /* Reverse order! */ ++#define DT_VERSIONTAGNUM 16 ++ ++/* Sun added these machine-independent extensions in the "processor-specific" ++ range. Be compatible. */ ++#define DT_AUXILIARY 0x7ffffffd /* Shared object to load before self */ ++#define DT_FILTER 0x7fffffff /* Shared object to get values from */ ++#define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1) ++#define DT_EXTRANUM 3 ++ ++/* Values of `d_un.d_val' in the DT_FLAGS entry. */ ++#define DF_ORIGIN 0x00000001 /* Object may use DF_ORIGIN */ ++#define DF_SYMBOLIC 0x00000002 /* Symbol resolutions starts here */ ++#define DF_TEXTREL 0x00000004 /* Object contains text relocations */ ++#define DF_BIND_NOW 0x00000008 /* No lazy binding for this object */ ++#define DF_STATIC_TLS 0x00000010 /* Module uses the static TLS model */ ++ ++/* State flags selectable in the `d_un.d_val' element of the DT_FLAGS_1 ++ entry in the dynamic section. */ ++#define DF_1_NOW 0x00000001 /* Set RTLD_NOW for this object. */ ++#define DF_1_GLOBAL 0x00000002 /* Set RTLD_GLOBAL for this object. */ ++#define DF_1_GROUP 0x00000004 /* Set RTLD_GROUP for this object. */ ++#define DF_1_NODELETE 0x00000008 /* Set RTLD_NODELETE for this object.*/ ++#define DF_1_LOADFLTR 0x00000010 /* Trigger filtee loading at runtime.*/ ++#define DF_1_INITFIRST 0x00000020 /* Set RTLD_INITFIRST for this object*/ ++#define DF_1_NOOPEN 0x00000040 /* Set RTLD_NOOPEN for this object. */ ++#define DF_1_ORIGIN 0x00000080 /* $ORIGIN must be handled. */ ++#define DF_1_DIRECT 0x00000100 /* Direct binding enabled. */ ++#define DF_1_TRANS 0x00000200 ++#define DF_1_INTERPOSE 0x00000400 /* Object is used to interpose. */ ++#define DF_1_NODEFLIB 0x00000800 /* Ignore default lib search path. */ ++#define DF_1_NODUMP 0x00001000 /* Object can't be dldump'ed. */ ++#define DF_1_CONFALT 0x00002000 /* Configuration alternative created.*/ ++#define DF_1_ENDFILTEE 0x00004000 /* Filtee terminates filters search. */ ++#define DF_1_DISPRELDNE 0x00008000 /* Disp reloc applied at build time. */ ++#define DF_1_DISPRELPND 0x00010000 /* Disp reloc applied at run-time. */ ++ ++/* Flags for the feature selection in DT_FEATURE_1. */ ++#define DTF_1_PARINIT 0x00000001 ++#define DTF_1_CONFEXP 0x00000002 ++ ++/* Flags in the DT_POSFLAG_1 entry effecting only the next DT_* entry. */ ++#define DF_P1_LAZYLOAD 0x00000001 /* Lazyload following object. */ ++#define DF_P1_GROUPPERM 0x00000002 /* Symbols from next object are not ++ generally available. */ ++ ++/* Version definition sections. */ ++ ++typedef struct ++{ ++ Elf32_Half vd_version; /* Version revision */ ++ Elf32_Half vd_flags; /* Version information */ ++ Elf32_Half vd_ndx; /* Version Index */ ++ Elf32_Half vd_cnt; /* Number of associated aux entries */ ++ Elf32_Word vd_hash; /* Version name hash value */ ++ Elf32_Word vd_aux; /* Offset in bytes to verdaux array */ ++ Elf32_Word vd_next; /* Offset in bytes to next verdef ++ entry */ ++} Elf32_Verdef; ++ ++typedef struct ++{ ++ Elf64_Half vd_version; /* Version revision */ ++ Elf64_Half vd_flags; /* Version information */ ++ Elf64_Half vd_ndx; /* Version Index */ ++ Elf64_Half vd_cnt; /* Number of associated aux entries */ ++ Elf64_Word vd_hash; /* Version name hash value */ ++ Elf64_Word vd_aux; /* Offset in bytes to verdaux array */ ++ Elf64_Word vd_next; /* Offset in bytes to next verdef ++ entry */ ++} Elf64_Verdef; ++ ++ ++/* Legal values for vd_version (version revision). */ ++#define VER_DEF_NONE 0 /* No version */ ++#define VER_DEF_CURRENT 1 /* Current version */ ++#define VER_DEF_NUM 2 /* Given version number */ ++ ++/* Legal values for vd_flags (version information flags). */ ++#define VER_FLG_BASE 0x1 /* Version definition of file itself */ ++#define VER_FLG_WEAK 0x2 /* Weak version identifier */ ++ ++/* Versym symbol index values. */ ++#define VER_NDX_LOCAL 0 /* Symbol is local. */ ++#define VER_NDX_GLOBAL 1 /* Symbol is global. */ ++#define VER_NDX_LORESERVE 0xff00 /* Beginning of reserved entries. */ ++#define VER_NDX_ELIMINATE 0xff01 /* Symbol is to be eliminated. */ ++ ++/* Auxialiary version information. */ ++ ++typedef struct ++{ ++ Elf32_Word vda_name; /* Version or dependency names */ ++ Elf32_Word vda_next; /* Offset in bytes to next verdaux ++ entry */ ++} Elf32_Verdaux; ++ ++typedef struct ++{ ++ Elf64_Word vda_name; /* Version or dependency names */ ++ Elf64_Word vda_next; /* Offset in bytes to next verdaux ++ entry */ ++} Elf64_Verdaux; ++ ++ ++/* Version dependency section. */ ++ ++typedef struct ++{ ++ Elf32_Half vn_version; /* Version of structure */ ++ Elf32_Half vn_cnt; /* Number of associated aux entries */ ++ Elf32_Word vn_file; /* Offset of filename for this ++ dependency */ ++ Elf32_Word vn_aux; /* Offset in bytes to vernaux array */ ++ Elf32_Word vn_next; /* Offset in bytes to next verneed ++ entry */ ++} Elf32_Verneed; ++ ++typedef struct ++{ ++ Elf64_Half vn_version; /* Version of structure */ ++ Elf64_Half vn_cnt; /* Number of associated aux entries */ ++ Elf64_Word vn_file; /* Offset of filename for this ++ dependency */ ++ Elf64_Word vn_aux; /* Offset in bytes to vernaux array */ ++ Elf64_Word vn_next; /* Offset in bytes to next verneed ++ entry */ ++} Elf64_Verneed; ++ ++ ++/* Legal values for vn_version (version revision). */ ++#define VER_NEED_NONE 0 /* No version */ ++#define VER_NEED_CURRENT 1 /* Current version */ ++#define VER_NEED_NUM 2 /* Given version number */ ++ ++/* Auxiliary needed version information. */ ++ ++typedef struct ++{ ++ Elf32_Word vna_hash; /* Hash value of dependency name */ ++ Elf32_Half vna_flags; /* Dependency specific information */ ++ Elf32_Half vna_other; /* Unused */ ++ Elf32_Word vna_name; /* Dependency name string offset */ ++ Elf32_Word vna_next; /* Offset in bytes to next vernaux ++ entry */ ++} Elf32_Vernaux; ++ ++typedef struct ++{ ++ Elf64_Word vna_hash; /* Hash value of dependency name */ ++ Elf64_Half vna_flags; /* Dependency specific information */ ++ Elf64_Half vna_other; /* Unused */ ++ Elf64_Word vna_name; /* Dependency name string offset */ ++ Elf64_Word vna_next; /* Offset in bytes to next vernaux ++ entry */ ++} Elf64_Vernaux; ++ ++ ++/* Legal values for vna_flags. */ ++#define VER_FLG_WEAK 0x2 /* Weak version identifier */ ++ ++ ++/* Auxiliary vector. */ ++ ++/* This vector is normally only used by the program interpreter. The ++ usual definition in an ABI supplement uses the name auxv_t. The ++ vector is not usually defined in a standard file, but it ++ can't hurt. We rename it to avoid conflicts. The sizes of these ++ types are an arrangement between the exec server and the program ++ interpreter, so we don't fully specify them here. */ ++ ++typedef struct ++{ ++ uint32_t a_type; /* Entry type */ ++ union ++ { ++ uint32_t a_val; /* Integer value */ ++ /* We use to have pointer elements added here. We cannot do that, ++ though, since it does not work when using 32-bit definitions ++ on 64-bit platforms and vice versa. */ ++ } a_un; ++} Elf32_auxv_t; ++ ++typedef struct ++{ ++ uint64_t a_type; /* Entry type */ ++ union ++ { ++ uint64_t a_val; /* Integer value */ ++ /* We use to have pointer elements added here. We cannot do that, ++ though, since it does not work when using 32-bit definitions ++ on 64-bit platforms and vice versa. */ ++ } a_un; ++} Elf64_auxv_t; ++ ++/* Legal values for a_type (entry type). */ ++ ++#define AT_NULL 0 /* End of vector */ ++#define AT_IGNORE 1 /* Entry should be ignored */ ++#define AT_EXECFD 2 /* File descriptor of program */ ++#define AT_PHDR 3 /* Program headers for program */ ++#define AT_PHENT 4 /* Size of program header entry */ ++#define AT_PHNUM 5 /* Number of program headers */ ++#define AT_PAGESZ 6 /* System page size */ ++#define AT_BASE 7 /* Base address of interpreter */ ++#define AT_FLAGS 8 /* Flags */ ++#define AT_ENTRY 9 /* Entry point of program */ ++#define AT_NOTELF 10 /* Program is not ELF */ ++#define AT_UID 11 /* Real uid */ ++#define AT_EUID 12 /* Effective uid */ ++#define AT_GID 13 /* Real gid */ ++#define AT_EGID 14 /* Effective gid */ ++#define AT_CLKTCK 17 /* Frequency of times() */ ++ ++/* Some more special a_type values describing the hardware. */ ++#define AT_PLATFORM 15 /* String identifying platform. */ ++#define AT_HWCAP 16 /* Machine dependent hints about ++ processor capabilities. */ ++ ++/* This entry gives some information about the FPU initialization ++ performed by the kernel. */ ++#define AT_FPUCW 18 /* Used FPU control word. */ ++ ++/* Cache block sizes. */ ++#define AT_DCACHEBSIZE 19 /* Data cache block size. */ ++#define AT_ICACHEBSIZE 20 /* Instruction cache block size. */ ++#define AT_UCACHEBSIZE 21 /* Unified cache block size. */ ++ ++/* A special ignored value for PPC, used by the kernel to control the ++ interpretation of the AUXV. Must be > 16. */ ++#define AT_IGNOREPPC 22 /* Entry should be ignored. */ ++ ++#define AT_SECURE 23 /* Boolean, was exec setuid-like? */ ++ ++#define AT_BASE_PLATFORM 24 /* String identifying real platforms.*/ ++ ++#define AT_RANDOM 25 /* Address of 16 random bytes. */ ++ ++#define AT_EXECFN 31 /* Filename of executable. */ ++ ++/* Pointer to the global system page used for system calls and other ++ nice things. */ ++#define AT_SYSINFO 32 ++#define AT_SYSINFO_EHDR 33 ++ ++/* Shapes of the caches. Bits 0-3 contains associativity; bits 4-7 contains ++ log2 of line size; mask those to get cache size. */ ++#define AT_L1I_CACHESHAPE 34 ++#define AT_L1D_CACHESHAPE 35 ++#define AT_L2_CACHESHAPE 36 ++#define AT_L3_CACHESHAPE 37 ++ ++/* Note section contents. Each entry in the note section begins with ++ a header of a fixed form. */ ++ ++typedef struct ++{ ++ Elf32_Word n_namesz; /* Length of the note's name. */ ++ Elf32_Word n_descsz; /* Length of the note's descriptor. */ ++ Elf32_Word n_type; /* Type of the note. */ ++} Elf32_Nhdr; ++ ++typedef struct ++{ ++ Elf64_Word n_namesz; /* Length of the note's name. */ ++ Elf64_Word n_descsz; /* Length of the note's descriptor. */ ++ Elf64_Word n_type; /* Type of the note. */ ++} Elf64_Nhdr; ++ ++/* Known names of notes. */ ++ ++/* Solaris entries in the note section have this name. */ ++#define ELF_NOTE_SOLARIS "SUNW Solaris" ++ ++/* Note entries for GNU systems have this name. */ ++#define ELF_NOTE_GNU "GNU" ++ ++ ++/* Defined types of notes for Solaris. */ ++ ++/* Value of descriptor (one word) is desired pagesize for the binary. */ ++#define ELF_NOTE_PAGESIZE_HINT 1 ++ ++ ++/* Defined note types for GNU systems. */ ++ ++/* ABI information. The descriptor consists of words: ++ word 0: OS descriptor ++ word 1: major version of the ABI ++ word 2: minor version of the ABI ++ word 3: subminor version of the ABI ++*/ ++#define NT_GNU_ABI_TAG 1 ++#define ELF_NOTE_ABI NT_GNU_ABI_TAG /* Old name. */ ++ ++/* Known OSes. These values can appear in word 0 of an ++ NT_GNU_ABI_TAG note section entry. */ ++#define ELF_NOTE_OS_LINUX 0 ++#define ELF_NOTE_OS_GNU 1 ++#define ELF_NOTE_OS_SOLARIS2 2 ++#define ELF_NOTE_OS_FREEBSD 3 ++ ++/* Synthetic hwcap information. The descriptor begins with two words: ++ word 0: number of entries ++ word 1: bitmask of enabled entries ++ Then follow variable-length entries, one byte followed by a ++ '\0'-terminated hwcap name string. The byte gives the bit ++ number to test if enabled, (1U << bit) & bitmask. */ ++#define NT_GNU_HWCAP 2 ++ ++/* Build ID bits as generated by ld --build-id. ++ The descriptor consists of any nonzero number of bytes. */ ++#define NT_GNU_BUILD_ID 3 ++ ++/* Version note generated by GNU gold containing a version string. */ ++#define NT_GNU_GOLD_VERSION 4 ++ ++ ++/* Move records. */ ++typedef struct ++{ ++ Elf32_Xword m_value; /* Symbol value. */ ++ Elf32_Word m_info; /* Size and index. */ ++ Elf32_Word m_poffset; /* Symbol offset. */ ++ Elf32_Half m_repeat; /* Repeat count. */ ++ Elf32_Half m_stride; /* Stride info. */ ++} Elf32_Move; ++ ++typedef struct ++{ ++ Elf64_Xword m_value; /* Symbol value. */ ++ Elf64_Xword m_info; /* Size and index. */ ++ Elf64_Xword m_poffset; /* Symbol offset. */ ++ Elf64_Half m_repeat; /* Repeat count. */ ++ Elf64_Half m_stride; /* Stride info. */ ++} Elf64_Move; ++ ++/* Macro to construct move records. */ ++#define ELF32_M_SYM(info) ((info) >> 8) ++#define ELF32_M_SIZE(info) ((unsigned char) (info)) ++#define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char) (size)) ++ ++#define ELF64_M_SYM(info) ELF32_M_SYM (info) ++#define ELF64_M_SIZE(info) ELF32_M_SIZE (info) ++#define ELF64_M_INFO(sym, size) ELF32_M_INFO (sym, size) ++ ++ ++/* Motorola 68k specific definitions. */ ++ ++/* Values for Elf32_Ehdr.e_flags. */ ++#define EF_CPU32 0x00810000 ++ ++/* m68k relocs. */ ++ ++#define R_68K_NONE 0 /* No reloc */ ++#define R_68K_32 1 /* Direct 32 bit */ ++#define R_68K_16 2 /* Direct 16 bit */ ++#define R_68K_8 3 /* Direct 8 bit */ ++#define R_68K_PC32 4 /* PC relative 32 bit */ ++#define R_68K_PC16 5 /* PC relative 16 bit */ ++#define R_68K_PC8 6 /* PC relative 8 bit */ ++#define R_68K_GOT32 7 /* 32 bit PC relative GOT entry */ ++#define R_68K_GOT16 8 /* 16 bit PC relative GOT entry */ ++#define R_68K_GOT8 9 /* 8 bit PC relative GOT entry */ ++#define R_68K_GOT32O 10 /* 32 bit GOT offset */ ++#define R_68K_GOT16O 11 /* 16 bit GOT offset */ ++#define R_68K_GOT8O 12 /* 8 bit GOT offset */ ++#define R_68K_PLT32 13 /* 32 bit PC relative PLT address */ ++#define R_68K_PLT16 14 /* 16 bit PC relative PLT address */ ++#define R_68K_PLT8 15 /* 8 bit PC relative PLT address */ ++#define R_68K_PLT32O 16 /* 32 bit PLT offset */ ++#define R_68K_PLT16O 17 /* 16 bit PLT offset */ ++#define R_68K_PLT8O 18 /* 8 bit PLT offset */ ++#define R_68K_COPY 19 /* Copy symbol at runtime */ ++#define R_68K_GLOB_DAT 20 /* Create GOT entry */ ++#define R_68K_JMP_SLOT 21 /* Create PLT entry */ ++#define R_68K_RELATIVE 22 /* Adjust by program base */ ++#define R_68K_TLS_GD32 25 /* 32 bit GOT offset for GD */ ++#define R_68K_TLS_GD16 26 /* 16 bit GOT offset for GD */ ++#define R_68K_TLS_GD8 27 /* 8 bit GOT offset for GD */ ++#define R_68K_TLS_LDM32 28 /* 32 bit GOT offset for LDM */ ++#define R_68K_TLS_LDM16 29 /* 16 bit GOT offset for LDM */ ++#define R_68K_TLS_LDM8 30 /* 8 bit GOT offset for LDM */ ++#define R_68K_TLS_LDO32 31 /* 32 bit module-relative offset */ ++#define R_68K_TLS_LDO16 32 /* 16 bit module-relative offset */ ++#define R_68K_TLS_LDO8 33 /* 8 bit module-relative offset */ ++#define R_68K_TLS_IE32 34 /* 32 bit GOT offset for IE */ ++#define R_68K_TLS_IE16 35 /* 16 bit GOT offset for IE */ ++#define R_68K_TLS_IE8 36 /* 8 bit GOT offset for IE */ ++#define R_68K_TLS_LE32 37 /* 32 bit offset relative to ++ static TLS block */ ++#define R_68K_TLS_LE16 38 /* 16 bit offset relative to ++ static TLS block */ ++#define R_68K_TLS_LE8 39 /* 8 bit offset relative to ++ static TLS block */ ++#define R_68K_TLS_DTPMOD32 40 /* 32 bit module number */ ++#define R_68K_TLS_DTPREL32 41 /* 32 bit module-relative offset */ ++#define R_68K_TLS_TPREL32 42 /* 32 bit TP-relative offset */ ++/* Keep this the last entry. */ ++#define R_68K_NUM 43 ++ ++/* Intel 80386 specific definitions. */ ++ ++/* i386 relocs. */ ++ ++#define R_386_NONE 0 /* No reloc */ ++#define R_386_32 1 /* Direct 32 bit */ ++#define R_386_PC32 2 /* PC relative 32 bit */ ++#define R_386_GOT32 3 /* 32 bit GOT entry */ ++#define R_386_PLT32 4 /* 32 bit PLT address */ ++#define R_386_COPY 5 /* Copy symbol at runtime */ ++#define R_386_GLOB_DAT 6 /* Create GOT entry */ ++#define R_386_JMP_SLOT 7 /* Create PLT entry */ ++#define R_386_RELATIVE 8 /* Adjust by program base */ ++#define R_386_GOTOFF 9 /* 32 bit offset to GOT */ ++#define R_386_GOTPC 10 /* 32 bit PC relative offset to GOT */ ++#define R_386_32PLT 11 ++#define R_386_TLS_TPOFF 14 /* Offset in static TLS block */ ++#define R_386_TLS_IE 15 /* Address of GOT entry for static TLS ++ block offset */ ++#define R_386_TLS_GOTIE 16 /* GOT entry for static TLS block ++ offset */ ++#define R_386_TLS_LE 17 /* Offset relative to static TLS ++ block */ ++#define R_386_TLS_GD 18 /* Direct 32 bit for GNU version of ++ general dynamic thread local data */ ++#define R_386_TLS_LDM 19 /* Direct 32 bit for GNU version of ++ local dynamic thread local data ++ in LE code */ ++#define R_386_16 20 ++#define R_386_PC16 21 ++#define R_386_8 22 ++#define R_386_PC8 23 ++#define R_386_TLS_GD_32 24 /* Direct 32 bit for general dynamic ++ thread local data */ ++#define R_386_TLS_GD_PUSH 25 /* Tag for pushl in GD TLS code */ ++#define R_386_TLS_GD_CALL 26 /* Relocation for call to ++ __tls_get_addr() */ ++#define R_386_TLS_GD_POP 27 /* Tag for popl in GD TLS code */ ++#define R_386_TLS_LDM_32 28 /* Direct 32 bit for local dynamic ++ thread local data in LE code */ ++#define R_386_TLS_LDM_PUSH 29 /* Tag for pushl in LDM TLS code */ ++#define R_386_TLS_LDM_CALL 30 /* Relocation for call to ++ __tls_get_addr() in LDM code */ ++#define R_386_TLS_LDM_POP 31 /* Tag for popl in LDM TLS code */ ++#define R_386_TLS_LDO_32 32 /* Offset relative to TLS block */ ++#define R_386_TLS_IE_32 33 /* GOT entry for negated static TLS ++ block offset */ ++#define R_386_TLS_LE_32 34 /* Negated offset relative to static ++ TLS block */ ++#define R_386_TLS_DTPMOD32 35 /* ID of module containing symbol */ ++#define R_386_TLS_DTPOFF32 36 /* Offset in TLS block */ ++#define R_386_TLS_TPOFF32 37 /* Negated offset in static TLS block */ ++/* 38? */ ++#define R_386_TLS_GOTDESC 39 /* GOT offset for TLS descriptor. */ ++#define R_386_TLS_DESC_CALL 40 /* Marker of call through TLS ++ descriptor for ++ relaxation. */ ++#define R_386_TLS_DESC 41 /* TLS descriptor containing ++ pointer to code and to ++ argument, returning the TLS ++ offset for the symbol. */ ++#define R_386_IRELATIVE 42 /* Adjust indirectly by program base */ ++/* Keep this the last entry. */ ++#define R_386_NUM 43 ++ ++/* SUN SPARC specific definitions. */ ++ ++/* Legal values for ST_TYPE subfield of st_info (symbol type). */ ++ ++#define STT_SPARC_REGISTER 13 /* Global register reserved to app. */ ++ ++/* Values for Elf64_Ehdr.e_flags. */ ++ ++#define EF_SPARCV9_MM 3 ++#define EF_SPARCV9_TSO 0 ++#define EF_SPARCV9_PSO 1 ++#define EF_SPARCV9_RMO 2 ++#define EF_SPARC_LEDATA 0x800000 /* little endian data */ ++#define EF_SPARC_EXT_MASK 0xFFFF00 ++#define EF_SPARC_32PLUS 0x000100 /* generic V8+ features */ ++#define EF_SPARC_SUN_US1 0x000200 /* Sun UltraSPARC1 extensions */ ++#define EF_SPARC_HAL_R1 0x000400 /* HAL R1 extensions */ ++#define EF_SPARC_SUN_US3 0x000800 /* Sun UltraSPARCIII extensions */ ++ ++/* SPARC relocs. */ ++ ++#define R_SPARC_NONE 0 /* No reloc */ ++#define R_SPARC_8 1 /* Direct 8 bit */ ++#define R_SPARC_16 2 /* Direct 16 bit */ ++#define R_SPARC_32 3 /* Direct 32 bit */ ++#define R_SPARC_DISP8 4 /* PC relative 8 bit */ ++#define R_SPARC_DISP16 5 /* PC relative 16 bit */ ++#define R_SPARC_DISP32 6 /* PC relative 32 bit */ ++#define R_SPARC_WDISP30 7 /* PC relative 30 bit shifted */ ++#define R_SPARC_WDISP22 8 /* PC relative 22 bit shifted */ ++#define R_SPARC_HI22 9 /* High 22 bit */ ++#define R_SPARC_22 10 /* Direct 22 bit */ ++#define R_SPARC_13 11 /* Direct 13 bit */ ++#define R_SPARC_LO10 12 /* Truncated 10 bit */ ++#define R_SPARC_GOT10 13 /* Truncated 10 bit GOT entry */ ++#define R_SPARC_GOT13 14 /* 13 bit GOT entry */ ++#define R_SPARC_GOT22 15 /* 22 bit GOT entry shifted */ ++#define R_SPARC_PC10 16 /* PC relative 10 bit truncated */ ++#define R_SPARC_PC22 17 /* PC relative 22 bit shifted */ ++#define R_SPARC_WPLT30 18 /* 30 bit PC relative PLT address */ ++#define R_SPARC_COPY 19 /* Copy symbol at runtime */ ++#define R_SPARC_GLOB_DAT 20 /* Create GOT entry */ ++#define R_SPARC_JMP_SLOT 21 /* Create PLT entry */ ++#define R_SPARC_RELATIVE 22 /* Adjust by program base */ ++#define R_SPARC_UA32 23 /* Direct 32 bit unaligned */ ++ ++/* Additional Sparc64 relocs. */ ++ ++#define R_SPARC_PLT32 24 /* Direct 32 bit ref to PLT entry */ ++#define R_SPARC_HIPLT22 25 /* High 22 bit PLT entry */ ++#define R_SPARC_LOPLT10 26 /* Truncated 10 bit PLT entry */ ++#define R_SPARC_PCPLT32 27 /* PC rel 32 bit ref to PLT entry */ ++#define R_SPARC_PCPLT22 28 /* PC rel high 22 bit PLT entry */ ++#define R_SPARC_PCPLT10 29 /* PC rel trunc 10 bit PLT entry */ ++#define R_SPARC_10 30 /* Direct 10 bit */ ++#define R_SPARC_11 31 /* Direct 11 bit */ ++#define R_SPARC_64 32 /* Direct 64 bit */ ++#define R_SPARC_OLO10 33 /* 10bit with secondary 13bit addend */ ++#define R_SPARC_HH22 34 /* Top 22 bits of direct 64 bit */ ++#define R_SPARC_HM10 35 /* High middle 10 bits of ... */ ++#define R_SPARC_LM22 36 /* Low middle 22 bits of ... */ ++#define R_SPARC_PC_HH22 37 /* Top 22 bits of pc rel 64 bit */ ++#define R_SPARC_PC_HM10 38 /* High middle 10 bit of ... */ ++#define R_SPARC_PC_LM22 39 /* Low miggle 22 bits of ... */ ++#define R_SPARC_WDISP16 40 /* PC relative 16 bit shifted */ ++#define R_SPARC_WDISP19 41 /* PC relative 19 bit shifted */ ++#define R_SPARC_GLOB_JMP 42 /* was part of v9 ABI but was removed */ ++#define R_SPARC_7 43 /* Direct 7 bit */ ++#define R_SPARC_5 44 /* Direct 5 bit */ ++#define R_SPARC_6 45 /* Direct 6 bit */ ++#define R_SPARC_DISP64 46 /* PC relative 64 bit */ ++#define R_SPARC_PLT64 47 /* Direct 64 bit ref to PLT entry */ ++#define R_SPARC_HIX22 48 /* High 22 bit complemented */ ++#define R_SPARC_LOX10 49 /* Truncated 11 bit complemented */ ++#define R_SPARC_H44 50 /* Direct high 12 of 44 bit */ ++#define R_SPARC_M44 51 /* Direct mid 22 of 44 bit */ ++#define R_SPARC_L44 52 /* Direct low 10 of 44 bit */ ++#define R_SPARC_REGISTER 53 /* Global register usage */ ++#define R_SPARC_UA64 54 /* Direct 64 bit unaligned */ ++#define R_SPARC_UA16 55 /* Direct 16 bit unaligned */ ++#define R_SPARC_TLS_GD_HI22 56 ++#define R_SPARC_TLS_GD_LO10 57 ++#define R_SPARC_TLS_GD_ADD 58 ++#define R_SPARC_TLS_GD_CALL 59 ++#define R_SPARC_TLS_LDM_HI22 60 ++#define R_SPARC_TLS_LDM_LO10 61 ++#define R_SPARC_TLS_LDM_ADD 62 ++#define R_SPARC_TLS_LDM_CALL 63 ++#define R_SPARC_TLS_LDO_HIX22 64 ++#define R_SPARC_TLS_LDO_LOX10 65 ++#define R_SPARC_TLS_LDO_ADD 66 ++#define R_SPARC_TLS_IE_HI22 67 ++#define R_SPARC_TLS_IE_LO10 68 ++#define R_SPARC_TLS_IE_LD 69 ++#define R_SPARC_TLS_IE_LDX 70 ++#define R_SPARC_TLS_IE_ADD 71 ++#define R_SPARC_TLS_LE_HIX22 72 ++#define R_SPARC_TLS_LE_LOX10 73 ++#define R_SPARC_TLS_DTPMOD32 74 ++#define R_SPARC_TLS_DTPMOD64 75 ++#define R_SPARC_TLS_DTPOFF32 76 ++#define R_SPARC_TLS_DTPOFF64 77 ++#define R_SPARC_TLS_TPOFF32 78 ++#define R_SPARC_TLS_TPOFF64 79 ++#define R_SPARC_GOTDATA_HIX22 80 ++#define R_SPARC_GOTDATA_LOX10 81 ++#define R_SPARC_GOTDATA_OP_HIX22 82 ++#define R_SPARC_GOTDATA_OP_LOX10 83 ++#define R_SPARC_GOTDATA_OP 84 ++#define R_SPARC_H34 85 ++#define R_SPARC_SIZE32 86 ++#define R_SPARC_SIZE64 87 ++#define R_SPARC_WDISP10 88 ++#define R_SPARC_JMP_IREL 248 ++#define R_SPARC_IRELATIVE 249 ++#define R_SPARC_GNU_VTINHERIT 250 ++#define R_SPARC_GNU_VTENTRY 251 ++#define R_SPARC_REV32 252 ++/* Keep this the last entry. */ ++#define R_SPARC_NUM 253 ++ ++/* For Sparc64, legal values for d_tag of Elf64_Dyn. */ ++ ++#define DT_SPARC_REGISTER 0x70000001 ++#define DT_SPARC_NUM 2 ++ ++/* MIPS R3000 specific definitions. */ ++ ++/* Legal values for e_flags field of Elf32_Ehdr. */ ++ ++#define EF_MIPS_NOREORDER 1 /* A .noreorder directive was used */ ++#define EF_MIPS_PIC 2 /* Contains PIC code */ ++#define EF_MIPS_CPIC 4 /* Uses PIC calling sequence */ ++#define EF_MIPS_XGOT 8 ++#define EF_MIPS_64BIT_WHIRL 16 ++#define EF_MIPS_ABI2 32 ++#define EF_MIPS_ABI_ON32 64 ++#define EF_MIPS_ARCH 0xf0000000 /* MIPS architecture level */ ++ ++/* Legal values for MIPS architecture level. */ ++ ++#define EF_MIPS_ARCH_1 0x00000000 /* -mips1 code. */ ++#define EF_MIPS_ARCH_2 0x10000000 /* -mips2 code. */ ++#define EF_MIPS_ARCH_3 0x20000000 /* -mips3 code. */ ++#define EF_MIPS_ARCH_4 0x30000000 /* -mips4 code. */ ++#define EF_MIPS_ARCH_5 0x40000000 /* -mips5 code. */ ++#define EF_MIPS_ARCH_32 0x60000000 /* MIPS32 code. */ ++#define EF_MIPS_ARCH_64 0x70000000 /* MIPS64 code. */ ++ ++/* The following are non-official names and should not be used. */ ++ ++#define E_MIPS_ARCH_1 0x00000000 /* -mips1 code. */ ++#define E_MIPS_ARCH_2 0x10000000 /* -mips2 code. */ ++#define E_MIPS_ARCH_3 0x20000000 /* -mips3 code. */ ++#define E_MIPS_ARCH_4 0x30000000 /* -mips4 code. */ ++#define E_MIPS_ARCH_5 0x40000000 /* -mips5 code. */ ++#define E_MIPS_ARCH_32 0x60000000 /* MIPS32 code. */ ++#define E_MIPS_ARCH_64 0x70000000 /* MIPS64 code. */ ++ ++/* Special section indices. */ ++ ++#define SHN_MIPS_ACOMMON 0xff00 /* Allocated common symbols */ ++#define SHN_MIPS_TEXT 0xff01 /* Allocated test symbols. */ ++#define SHN_MIPS_DATA 0xff02 /* Allocated data symbols. */ ++#define SHN_MIPS_SCOMMON 0xff03 /* Small common symbols */ ++#define SHN_MIPS_SUNDEFINED 0xff04 /* Small undefined symbols */ ++ ++/* Legal values for sh_type field of Elf32_Shdr. */ ++ ++#define SHT_MIPS_LIBLIST 0x70000000 /* Shared objects used in link */ ++#define SHT_MIPS_MSYM 0x70000001 ++#define SHT_MIPS_CONFLICT 0x70000002 /* Conflicting symbols */ ++#define SHT_MIPS_GPTAB 0x70000003 /* Global data area sizes */ ++#define SHT_MIPS_UCODE 0x70000004 /* Reserved for SGI/MIPS compilers */ ++#define SHT_MIPS_DEBUG 0x70000005 /* MIPS ECOFF debugging information*/ ++#define SHT_MIPS_REGINFO 0x70000006 /* Register usage information */ ++#define SHT_MIPS_PACKAGE 0x70000007 ++#define SHT_MIPS_PACKSYM 0x70000008 ++#define SHT_MIPS_RELD 0x70000009 ++#define SHT_MIPS_IFACE 0x7000000b ++#define SHT_MIPS_CONTENT 0x7000000c ++#define SHT_MIPS_OPTIONS 0x7000000d /* Miscellaneous options. */ ++#define SHT_MIPS_SHDR 0x70000010 ++#define SHT_MIPS_FDESC 0x70000011 ++#define SHT_MIPS_EXTSYM 0x70000012 ++#define SHT_MIPS_DENSE 0x70000013 ++#define SHT_MIPS_PDESC 0x70000014 ++#define SHT_MIPS_LOCSYM 0x70000015 ++#define SHT_MIPS_AUXSYM 0x70000016 ++#define SHT_MIPS_OPTSYM 0x70000017 ++#define SHT_MIPS_LOCSTR 0x70000018 ++#define SHT_MIPS_LINE 0x70000019 ++#define SHT_MIPS_RFDESC 0x7000001a ++#define SHT_MIPS_DELTASYM 0x7000001b ++#define SHT_MIPS_DELTAINST 0x7000001c ++#define SHT_MIPS_DELTACLASS 0x7000001d ++#define SHT_MIPS_DWARF 0x7000001e /* DWARF debugging information. */ ++#define SHT_MIPS_DELTADECL 0x7000001f ++#define SHT_MIPS_SYMBOL_LIB 0x70000020 ++#define SHT_MIPS_EVENTS 0x70000021 /* Event section. */ ++#define SHT_MIPS_TRANSLATE 0x70000022 ++#define SHT_MIPS_PIXIE 0x70000023 ++#define SHT_MIPS_XLATE 0x70000024 ++#define SHT_MIPS_XLATE_DEBUG 0x70000025 ++#define SHT_MIPS_WHIRL 0x70000026 ++#define SHT_MIPS_EH_REGION 0x70000027 ++#define SHT_MIPS_XLATE_OLD 0x70000028 ++#define SHT_MIPS_PDR_EXCEPTION 0x70000029 ++ ++/* Legal values for sh_flags field of Elf32_Shdr. */ ++ ++#define SHF_MIPS_GPREL 0x10000000 /* Must be part of global data area */ ++#define SHF_MIPS_MERGE 0x20000000 ++#define SHF_MIPS_ADDR 0x40000000 ++#define SHF_MIPS_STRINGS 0x80000000 ++#define SHF_MIPS_NOSTRIP 0x08000000 ++#define SHF_MIPS_LOCAL 0x04000000 ++#define SHF_MIPS_NAMES 0x02000000 ++#define SHF_MIPS_NODUPE 0x01000000 ++ ++ ++/* Symbol tables. */ ++ ++/* MIPS specific values for `st_other'. */ ++#define STO_MIPS_DEFAULT 0x0 ++#define STO_MIPS_INTERNAL 0x1 ++#define STO_MIPS_HIDDEN 0x2 ++#define STO_MIPS_PROTECTED 0x3 ++#define STO_MIPS_PLT 0x8 ++#define STO_MIPS_SC_ALIGN_UNUSED 0xff ++ ++/* MIPS specific values for `st_info'. */ ++#define STB_MIPS_SPLIT_COMMON 13 ++ ++/* Entries found in sections of type SHT_MIPS_GPTAB. */ ++ ++typedef union ++{ ++ struct ++ { ++ Elf32_Word gt_current_g_value; /* -G value used for compilation */ ++ Elf32_Word gt_unused; /* Not used */ ++ } gt_header; /* First entry in section */ ++ struct ++ { ++ Elf32_Word gt_g_value; /* If this value were used for -G */ ++ Elf32_Word gt_bytes; /* This many bytes would be used */ ++ } gt_entry; /* Subsequent entries in section */ ++} Elf32_gptab; ++ ++/* Entry found in sections of type SHT_MIPS_REGINFO. */ ++ ++typedef struct ++{ ++ Elf32_Word ri_gprmask; /* General registers used */ ++ Elf32_Word ri_cprmask[4]; /* Coprocessor registers used */ ++ Elf32_Sword ri_gp_value; /* $gp register value */ ++} Elf32_RegInfo; ++ ++/* Entries found in sections of type SHT_MIPS_OPTIONS. */ ++ ++typedef struct ++{ ++ unsigned char kind; /* Determines interpretation of the ++ variable part of descriptor. */ ++ unsigned char size; /* Size of descriptor, including header. */ ++ Elf32_Section section; /* Section header index of section affected, ++ 0 for global options. */ ++ Elf32_Word info; /* Kind-specific information. */ ++} Elf_Options; ++ ++/* Values for `kind' field in Elf_Options. */ ++ ++#define ODK_NULL 0 /* Undefined. */ ++#define ODK_REGINFO 1 /* Register usage information. */ ++#define ODK_EXCEPTIONS 2 /* Exception processing options. */ ++#define ODK_PAD 3 /* Section padding options. */ ++#define ODK_HWPATCH 4 /* Hardware workarounds performed */ ++#define ODK_FILL 5 /* record the fill value used by the linker. */ ++#define ODK_TAGS 6 /* reserve space for desktop tools to write. */ ++#define ODK_HWAND 7 /* HW workarounds. 'AND' bits when merging. */ ++#define ODK_HWOR 8 /* HW workarounds. 'OR' bits when merging. */ ++ ++/* Values for `info' in Elf_Options for ODK_EXCEPTIONS entries. */ ++ ++#define OEX_FPU_MIN 0x1f /* FPE's which MUST be enabled. */ ++#define OEX_FPU_MAX 0x1f00 /* FPE's which MAY be enabled. */ ++#define OEX_PAGE0 0x10000 /* page zero must be mapped. */ ++#define OEX_SMM 0x20000 /* Force sequential memory mode? */ ++#define OEX_FPDBUG 0x40000 /* Force floating point debug mode? */ ++#define OEX_PRECISEFP OEX_FPDBUG ++#define OEX_DISMISS 0x80000 /* Dismiss invalid address faults? */ ++ ++#define OEX_FPU_INVAL 0x10 ++#define OEX_FPU_DIV0 0x08 ++#define OEX_FPU_OFLO 0x04 ++#define OEX_FPU_UFLO 0x02 ++#define OEX_FPU_INEX 0x01 ++ ++/* Masks for `info' in Elf_Options for an ODK_HWPATCH entry. */ ++ ++#define OHW_R4KEOP 0x1 /* R4000 end-of-page patch. */ ++#define OHW_R8KPFETCH 0x2 /* may need R8000 prefetch patch. */ ++#define OHW_R5KEOP 0x4 /* R5000 end-of-page patch. */ ++#define OHW_R5KCVTL 0x8 /* R5000 cvt.[ds].l bug. clean=1. */ ++ ++#define OPAD_PREFIX 0x1 ++#define OPAD_POSTFIX 0x2 ++#define OPAD_SYMBOL 0x4 ++ ++/* Entry found in `.options' section. */ ++ ++typedef struct ++{ ++ Elf32_Word hwp_flags1; /* Extra flags. */ ++ Elf32_Word hwp_flags2; /* Extra flags. */ ++} Elf_Options_Hw; ++ ++/* Masks for `info' in ElfOptions for ODK_HWAND and ODK_HWOR entries. */ ++ ++#define OHWA0_R4KEOP_CHECKED 0x00000001 ++#define OHWA1_R4KEOP_CLEAN 0x00000002 ++ ++/* MIPS relocs. */ ++ ++#define R_MIPS_NONE 0 /* No reloc */ ++#define R_MIPS_16 1 /* Direct 16 bit */ ++#define R_MIPS_32 2 /* Direct 32 bit */ ++#define R_MIPS_REL32 3 /* PC relative 32 bit */ ++#define R_MIPS_26 4 /* Direct 26 bit shifted */ ++#define R_MIPS_HI16 5 /* High 16 bit */ ++#define R_MIPS_LO16 6 /* Low 16 bit */ ++#define R_MIPS_GPREL16 7 /* GP relative 16 bit */ ++#define R_MIPS_LITERAL 8 /* 16 bit literal entry */ ++#define R_MIPS_GOT16 9 /* 16 bit GOT entry */ ++#define R_MIPS_PC16 10 /* PC relative 16 bit */ ++#define R_MIPS_CALL16 11 /* 16 bit GOT entry for function */ ++#define R_MIPS_GPREL32 12 /* GP relative 32 bit */ ++ ++#define R_MIPS_SHIFT5 16 ++#define R_MIPS_SHIFT6 17 ++#define R_MIPS_64 18 ++#define R_MIPS_GOT_DISP 19 ++#define R_MIPS_GOT_PAGE 20 ++#define R_MIPS_GOT_OFST 21 ++#define R_MIPS_GOT_HI16 22 ++#define R_MIPS_GOT_LO16 23 ++#define R_MIPS_SUB 24 ++#define R_MIPS_INSERT_A 25 ++#define R_MIPS_INSERT_B 26 ++#define R_MIPS_DELETE 27 ++#define R_MIPS_HIGHER 28 ++#define R_MIPS_HIGHEST 29 ++#define R_MIPS_CALL_HI16 30 ++#define R_MIPS_CALL_LO16 31 ++#define R_MIPS_SCN_DISP 32 ++#define R_MIPS_REL16 33 ++#define R_MIPS_ADD_IMMEDIATE 34 ++#define R_MIPS_PJUMP 35 ++#define R_MIPS_RELGOT 36 ++#define R_MIPS_JALR 37 ++#define R_MIPS_TLS_DTPMOD32 38 /* Module number 32 bit */ ++#define R_MIPS_TLS_DTPREL32 39 /* Module-relative offset 32 bit */ ++#define R_MIPS_TLS_DTPMOD64 40 /* Module number 64 bit */ ++#define R_MIPS_TLS_DTPREL64 41 /* Module-relative offset 64 bit */ ++#define R_MIPS_TLS_GD 42 /* 16 bit GOT offset for GD */ ++#define R_MIPS_TLS_LDM 43 /* 16 bit GOT offset for LDM */ ++#define R_MIPS_TLS_DTPREL_HI16 44 /* Module-relative offset, high 16 bits */ ++#define R_MIPS_TLS_DTPREL_LO16 45 /* Module-relative offset, low 16 bits */ ++#define R_MIPS_TLS_GOTTPREL 46 /* 16 bit GOT offset for IE */ ++#define R_MIPS_TLS_TPREL32 47 /* TP-relative offset, 32 bit */ ++#define R_MIPS_TLS_TPREL64 48 /* TP-relative offset, 64 bit */ ++#define R_MIPS_TLS_TPREL_HI16 49 /* TP-relative offset, high 16 bits */ ++#define R_MIPS_TLS_TPREL_LO16 50 /* TP-relative offset, low 16 bits */ ++#define R_MIPS_GLOB_DAT 51 ++#define R_MIPS_COPY 126 ++#define R_MIPS_JUMP_SLOT 127 ++/* Keep this the last entry. */ ++#define R_MIPS_NUM 128 ++ ++/* Legal values for p_type field of Elf32_Phdr. */ ++ ++#define PT_MIPS_REGINFO 0x70000000 /* Register usage information */ ++#define PT_MIPS_RTPROC 0x70000001 /* Runtime procedure table. */ ++#define PT_MIPS_OPTIONS 0x70000002 ++ ++/* Special program header types. */ ++ ++#define PF_MIPS_LOCAL 0x10000000 ++ ++/* Legal values for d_tag field of Elf32_Dyn. */ ++ ++#define DT_MIPS_RLD_VERSION 0x70000001 /* Runtime linker interface version */ ++#define DT_MIPS_TIME_STAMP 0x70000002 /* Timestamp */ ++#define DT_MIPS_ICHECKSUM 0x70000003 /* Checksum */ ++#define DT_MIPS_IVERSION 0x70000004 /* Version string (string tbl index) */ ++#define DT_MIPS_FLAGS 0x70000005 /* Flags */ ++#define DT_MIPS_BASE_ADDRESS 0x70000006 /* Base address */ ++#define DT_MIPS_MSYM 0x70000007 ++#define DT_MIPS_CONFLICT 0x70000008 /* Address of CONFLICT section */ ++#define DT_MIPS_LIBLIST 0x70000009 /* Address of LIBLIST section */ ++#define DT_MIPS_LOCAL_GOTNO 0x7000000a /* Number of local GOT entries */ ++#define DT_MIPS_CONFLICTNO 0x7000000b /* Number of CONFLICT entries */ ++#define DT_MIPS_LIBLISTNO 0x70000010 /* Number of LIBLIST entries */ ++#define DT_MIPS_SYMTABNO 0x70000011 /* Number of DYNSYM entries */ ++#define DT_MIPS_UNREFEXTNO 0x70000012 /* First external DYNSYM */ ++#define DT_MIPS_GOTSYM 0x70000013 /* First GOT entry in DYNSYM */ ++#define DT_MIPS_HIPAGENO 0x70000014 /* Number of GOT page table entries */ ++#define DT_MIPS_RLD_MAP 0x70000016 /* Address of run time loader map. */ ++#define DT_MIPS_DELTA_CLASS 0x70000017 /* Delta C++ class definition. */ ++#define DT_MIPS_DELTA_CLASS_NO 0x70000018 /* Number of entries in ++ DT_MIPS_DELTA_CLASS. */ ++#define DT_MIPS_DELTA_INSTANCE 0x70000019 /* Delta C++ class instances. */ ++#define DT_MIPS_DELTA_INSTANCE_NO 0x7000001a /* Number of entries in ++ DT_MIPS_DELTA_INSTANCE. */ ++#define DT_MIPS_DELTA_RELOC 0x7000001b /* Delta relocations. */ ++#define DT_MIPS_DELTA_RELOC_NO 0x7000001c /* Number of entries in ++ DT_MIPS_DELTA_RELOC. */ ++#define DT_MIPS_DELTA_SYM 0x7000001d /* Delta symbols that Delta ++ relocations refer to. */ ++#define DT_MIPS_DELTA_SYM_NO 0x7000001e /* Number of entries in ++ DT_MIPS_DELTA_SYM. */ ++#define DT_MIPS_DELTA_CLASSSYM 0x70000020 /* Delta symbols that hold the ++ class declaration. */ ++#define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021 /* Number of entries in ++ DT_MIPS_DELTA_CLASSSYM. */ ++#define DT_MIPS_CXX_FLAGS 0x70000022 /* Flags indicating for C++ flavor. */ ++#define DT_MIPS_PIXIE_INIT 0x70000023 ++#define DT_MIPS_SYMBOL_LIB 0x70000024 ++#define DT_MIPS_LOCALPAGE_GOTIDX 0x70000025 ++#define DT_MIPS_LOCAL_GOTIDX 0x70000026 ++#define DT_MIPS_HIDDEN_GOTIDX 0x70000027 ++#define DT_MIPS_PROTECTED_GOTIDX 0x70000028 ++#define DT_MIPS_OPTIONS 0x70000029 /* Address of .options. */ ++#define DT_MIPS_INTERFACE 0x7000002a /* Address of .interface. */ ++#define DT_MIPS_DYNSTR_ALIGN 0x7000002b ++#define DT_MIPS_INTERFACE_SIZE 0x7000002c /* Size of the .interface section. */ ++#define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002d /* Address of rld_text_rsolve ++ function stored in GOT. */ ++#define DT_MIPS_PERF_SUFFIX 0x7000002e /* Default suffix of dso to be added ++ by rld on dlopen() calls. */ ++#define DT_MIPS_COMPACT_SIZE 0x7000002f /* (O32)Size of compact rel section. */ ++#define DT_MIPS_GP_VALUE 0x70000030 /* GP value for aux GOTs. */ ++#define DT_MIPS_AUX_DYNAMIC 0x70000031 /* Address of aux .dynamic. */ ++/* The address of .got.plt in an executable using the new non-PIC ABI. */ ++#define DT_MIPS_PLTGOT 0x70000032 ++/* The base of the PLT in an executable using the new non-PIC ABI if that ++ PLT is writable. For a non-writable PLT, this is omitted or has a zero ++ value. */ ++#define DT_MIPS_RWPLT 0x70000034 ++#define DT_MIPS_NUM 0x35 ++ ++/* Legal values for DT_MIPS_FLAGS Elf32_Dyn entry. */ ++ ++#define RHF_NONE 0 /* No flags */ ++#define RHF_QUICKSTART (1 << 0) /* Use quickstart */ ++#define RHF_NOTPOT (1 << 1) /* Hash size not power of 2 */ ++#define RHF_NO_LIBRARY_REPLACEMENT (1 << 2) /* Ignore LD_LIBRARY_PATH */ ++#define RHF_NO_MOVE (1 << 3) ++#define RHF_SGI_ONLY (1 << 4) ++#define RHF_GUARANTEE_INIT (1 << 5) ++#define RHF_DELTA_C_PLUS_PLUS (1 << 6) ++#define RHF_GUARANTEE_START_INIT (1 << 7) ++#define RHF_PIXIE (1 << 8) ++#define RHF_DEFAULT_DELAY_LOAD (1 << 9) ++#define RHF_REQUICKSTART (1 << 10) ++#define RHF_REQUICKSTARTED (1 << 11) ++#define RHF_CORD (1 << 12) ++#define RHF_NO_UNRES_UNDEF (1 << 13) ++#define RHF_RLD_ORDER_SAFE (1 << 14) ++ ++/* Entries found in sections of type SHT_MIPS_LIBLIST. */ ++ ++typedef struct ++{ ++ Elf32_Word l_name; /* Name (string table index) */ ++ Elf32_Word l_time_stamp; /* Timestamp */ ++ Elf32_Word l_checksum; /* Checksum */ ++ Elf32_Word l_version; /* Interface version */ ++ Elf32_Word l_flags; /* Flags */ ++} Elf32_Lib; ++ ++typedef struct ++{ ++ Elf64_Word l_name; /* Name (string table index) */ ++ Elf64_Word l_time_stamp; /* Timestamp */ ++ Elf64_Word l_checksum; /* Checksum */ ++ Elf64_Word l_version; /* Interface version */ ++ Elf64_Word l_flags; /* Flags */ ++} Elf64_Lib; ++ ++ ++/* Legal values for l_flags. */ ++ ++#define LL_NONE 0 ++#define LL_EXACT_MATCH (1 << 0) /* Require exact match */ ++#define LL_IGNORE_INT_VER (1 << 1) /* Ignore interface version */ ++#define LL_REQUIRE_MINOR (1 << 2) ++#define LL_EXPORTS (1 << 3) ++#define LL_DELAY_LOAD (1 << 4) ++#define LL_DELTA (1 << 5) ++ ++/* Entries found in sections of type SHT_MIPS_CONFLICT. */ ++ ++typedef Elf32_Addr Elf32_Conflict; ++ ++ ++/* HPPA specific definitions. */ ++ ++/* Legal values for e_flags field of Elf32_Ehdr. */ ++ ++#define EF_PARISC_TRAPNIL 0x00010000 /* Trap nil pointer dereference. */ ++#define EF_PARISC_EXT 0x00020000 /* Program uses arch. extensions. */ ++#define EF_PARISC_LSB 0x00040000 /* Program expects little endian. */ ++#define EF_PARISC_WIDE 0x00080000 /* Program expects wide mode. */ ++#define EF_PARISC_NO_KABP 0x00100000 /* No kernel assisted branch ++ prediction. */ ++#define EF_PARISC_LAZYSWAP 0x00400000 /* Allow lazy swapping. */ ++#define EF_PARISC_ARCH 0x0000ffff /* Architecture version. */ ++ ++/* Defined values for `e_flags & EF_PARISC_ARCH' are: */ ++ ++#define EFA_PARISC_1_0 0x020b /* PA-RISC 1.0 big-endian. */ ++#define EFA_PARISC_1_1 0x0210 /* PA-RISC 1.1 big-endian. */ ++#define EFA_PARISC_2_0 0x0214 /* PA-RISC 2.0 big-endian. */ ++ ++/* Additional section indeces. */ ++ ++#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tenatively declared ++ symbols in ANSI C. */ ++#define SHN_PARISC_HUGE_COMMON 0xff01 /* Common blocks in huge model. */ ++ ++/* Legal values for sh_type field of Elf32_Shdr. */ ++ ++#define SHT_PARISC_EXT 0x70000000 /* Contains product specific ext. */ ++#define SHT_PARISC_UNWIND 0x70000001 /* Unwind information. */ ++#define SHT_PARISC_DOC 0x70000002 /* Debug info for optimized code. */ ++ ++/* Legal values for sh_flags field of Elf32_Shdr. */ ++ ++#define SHF_PARISC_SHORT 0x20000000 /* Section with short addressing. */ ++#define SHF_PARISC_HUGE 0x40000000 /* Section far from gp. */ ++#define SHF_PARISC_SBP 0x80000000 /* Static branch prediction code. */ ++ ++/* Legal values for ST_TYPE subfield of st_info (symbol type). */ ++ ++#define STT_PARISC_MILLICODE 13 /* Millicode function entry point. */ ++ ++#define STT_HP_OPAQUE (STT_LOOS + 0x1) ++#define STT_HP_STUB (STT_LOOS + 0x2) ++ ++/* HPPA relocs. */ ++ ++#define R_PARISC_NONE 0 /* No reloc. */ ++#define R_PARISC_DIR32 1 /* Direct 32-bit reference. */ ++#define R_PARISC_DIR21L 2 /* Left 21 bits of eff. address. */ ++#define R_PARISC_DIR17R 3 /* Right 17 bits of eff. address. */ ++#define R_PARISC_DIR17F 4 /* 17 bits of eff. address. */ ++#define R_PARISC_DIR14R 6 /* Right 14 bits of eff. address. */ ++#define R_PARISC_PCREL32 9 /* 32-bit rel. address. */ ++#define R_PARISC_PCREL21L 10 /* Left 21 bits of rel. address. */ ++#define R_PARISC_PCREL17R 11 /* Right 17 bits of rel. address. */ ++#define R_PARISC_PCREL17F 12 /* 17 bits of rel. address. */ ++#define R_PARISC_PCREL14R 14 /* Right 14 bits of rel. address. */ ++#define R_PARISC_DPREL21L 18 /* Left 21 bits of rel. address. */ ++#define R_PARISC_DPREL14R 22 /* Right 14 bits of rel. address. */ ++#define R_PARISC_GPREL21L 26 /* GP-relative, left 21 bits. */ ++#define R_PARISC_GPREL14R 30 /* GP-relative, right 14 bits. */ ++#define R_PARISC_LTOFF21L 34 /* LT-relative, left 21 bits. */ ++#define R_PARISC_LTOFF14R 38 /* LT-relative, right 14 bits. */ ++#define R_PARISC_SECREL32 41 /* 32 bits section rel. address. */ ++#define R_PARISC_SEGBASE 48 /* No relocation, set segment base. */ ++#define R_PARISC_SEGREL32 49 /* 32 bits segment rel. address. */ ++#define R_PARISC_PLTOFF21L 50 /* PLT rel. address, left 21 bits. */ ++#define R_PARISC_PLTOFF14R 54 /* PLT rel. address, right 14 bits. */ ++#define R_PARISC_LTOFF_FPTR32 57 /* 32 bits LT-rel. function pointer. */ ++#define R_PARISC_LTOFF_FPTR21L 58 /* LT-rel. fct ptr, left 21 bits. */ ++#define R_PARISC_LTOFF_FPTR14R 62 /* LT-rel. fct ptr, right 14 bits. */ ++#define R_PARISC_FPTR64 64 /* 64 bits function address. */ ++#define R_PARISC_PLABEL32 65 /* 32 bits function address. */ ++#define R_PARISC_PLABEL21L 66 /* Left 21 bits of fdesc address. */ ++#define R_PARISC_PLABEL14R 70 /* Right 14 bits of fdesc address. */ ++#define R_PARISC_PCREL64 72 /* 64 bits PC-rel. address. */ ++#define R_PARISC_PCREL22F 74 /* 22 bits PC-rel. address. */ ++#define R_PARISC_PCREL14WR 75 /* PC-rel. address, right 14 bits. */ ++#define R_PARISC_PCREL14DR 76 /* PC rel. address, right 14 bits. */ ++#define R_PARISC_PCREL16F 77 /* 16 bits PC-rel. address. */ ++#define R_PARISC_PCREL16WF 78 /* 16 bits PC-rel. address. */ ++#define R_PARISC_PCREL16DF 79 /* 16 bits PC-rel. address. */ ++#define R_PARISC_DIR64 80 /* 64 bits of eff. address. */ ++#define R_PARISC_DIR14WR 83 /* 14 bits of eff. address. */ ++#define R_PARISC_DIR14DR 84 /* 14 bits of eff. address. */ ++#define R_PARISC_DIR16F 85 /* 16 bits of eff. address. */ ++#define R_PARISC_DIR16WF 86 /* 16 bits of eff. address. */ ++#define R_PARISC_DIR16DF 87 /* 16 bits of eff. address. */ ++#define R_PARISC_GPREL64 88 /* 64 bits of GP-rel. address. */ ++#define R_PARISC_GPREL14WR 91 /* GP-rel. address, right 14 bits. */ ++#define R_PARISC_GPREL14DR 92 /* GP-rel. address, right 14 bits. */ ++#define R_PARISC_GPREL16F 93 /* 16 bits GP-rel. address. */ ++#define R_PARISC_GPREL16WF 94 /* 16 bits GP-rel. address. */ ++#define R_PARISC_GPREL16DF 95 /* 16 bits GP-rel. address. */ ++#define R_PARISC_LTOFF64 96 /* 64 bits LT-rel. address. */ ++#define R_PARISC_LTOFF14WR 99 /* LT-rel. address, right 14 bits. */ ++#define R_PARISC_LTOFF14DR 100 /* LT-rel. address, right 14 bits. */ ++#define R_PARISC_LTOFF16F 101 /* 16 bits LT-rel. address. */ ++#define R_PARISC_LTOFF16WF 102 /* 16 bits LT-rel. address. */ ++#define R_PARISC_LTOFF16DF 103 /* 16 bits LT-rel. address. */ ++#define R_PARISC_SECREL64 104 /* 64 bits section rel. address. */ ++#define R_PARISC_SEGREL64 112 /* 64 bits segment rel. address. */ ++#define R_PARISC_PLTOFF14WR 115 /* PLT-rel. address, right 14 bits. */ ++#define R_PARISC_PLTOFF14DR 116 /* PLT-rel. address, right 14 bits. */ ++#define R_PARISC_PLTOFF16F 117 /* 16 bits LT-rel. address. */ ++#define R_PARISC_PLTOFF16WF 118 /* 16 bits PLT-rel. address. */ ++#define R_PARISC_PLTOFF16DF 119 /* 16 bits PLT-rel. address. */ ++#define R_PARISC_LTOFF_FPTR64 120 /* 64 bits LT-rel. function ptr. */ ++#define R_PARISC_LTOFF_FPTR14WR 123 /* LT-rel. fct. ptr., right 14 bits. */ ++#define R_PARISC_LTOFF_FPTR14DR 124 /* LT-rel. fct. ptr., right 14 bits. */ ++#define R_PARISC_LTOFF_FPTR16F 125 /* 16 bits LT-rel. function ptr. */ ++#define R_PARISC_LTOFF_FPTR16WF 126 /* 16 bits LT-rel. function ptr. */ ++#define R_PARISC_LTOFF_FPTR16DF 127 /* 16 bits LT-rel. function ptr. */ ++#define R_PARISC_LORESERVE 128 ++#define R_PARISC_COPY 128 /* Copy relocation. */ ++#define R_PARISC_IPLT 129 /* Dynamic reloc, imported PLT */ ++#define R_PARISC_EPLT 130 /* Dynamic reloc, exported PLT */ ++#define R_PARISC_TPREL32 153 /* 32 bits TP-rel. address. */ ++#define R_PARISC_TPREL21L 154 /* TP-rel. address, left 21 bits. */ ++#define R_PARISC_TPREL14R 158 /* TP-rel. address, right 14 bits. */ ++#define R_PARISC_LTOFF_TP21L 162 /* LT-TP-rel. address, left 21 bits. */ ++#define R_PARISC_LTOFF_TP14R 166 /* LT-TP-rel. address, right 14 bits.*/ ++#define R_PARISC_LTOFF_TP14F 167 /* 14 bits LT-TP-rel. address. */ ++#define R_PARISC_TPREL64 216 /* 64 bits TP-rel. address. */ ++#define R_PARISC_TPREL14WR 219 /* TP-rel. address, right 14 bits. */ ++#define R_PARISC_TPREL14DR 220 /* TP-rel. address, right 14 bits. */ ++#define R_PARISC_TPREL16F 221 /* 16 bits TP-rel. address. */ ++#define R_PARISC_TPREL16WF 222 /* 16 bits TP-rel. address. */ ++#define R_PARISC_TPREL16DF 223 /* 16 bits TP-rel. address. */ ++#define R_PARISC_LTOFF_TP64 224 /* 64 bits LT-TP-rel. address. */ ++#define R_PARISC_LTOFF_TP14WR 227 /* LT-TP-rel. address, right 14 bits.*/ ++#define R_PARISC_LTOFF_TP14DR 228 /* LT-TP-rel. address, right 14 bits.*/ ++#define R_PARISC_LTOFF_TP16F 229 /* 16 bits LT-TP-rel. address. */ ++#define R_PARISC_LTOFF_TP16WF 230 /* 16 bits LT-TP-rel. address. */ ++#define R_PARISC_LTOFF_TP16DF 231 /* 16 bits LT-TP-rel. address. */ ++#define R_PARISC_GNU_VTENTRY 232 ++#define R_PARISC_GNU_VTINHERIT 233 ++#define R_PARISC_TLS_GD21L 234 /* GD 21-bit left. */ ++#define R_PARISC_TLS_GD14R 235 /* GD 14-bit right. */ ++#define R_PARISC_TLS_GDCALL 236 /* GD call to __t_g_a. */ ++#define R_PARISC_TLS_LDM21L 237 /* LD module 21-bit left. */ ++#define R_PARISC_TLS_LDM14R 238 /* LD module 14-bit right. */ ++#define R_PARISC_TLS_LDMCALL 239 /* LD module call to __t_g_a. */ ++#define R_PARISC_TLS_LDO21L 240 /* LD offset 21-bit left. */ ++#define R_PARISC_TLS_LDO14R 241 /* LD offset 14-bit right. */ ++#define R_PARISC_TLS_DTPMOD32 242 /* DTP module 32-bit. */ ++#define R_PARISC_TLS_DTPMOD64 243 /* DTP module 64-bit. */ ++#define R_PARISC_TLS_DTPOFF32 244 /* DTP offset 32-bit. */ ++#define R_PARISC_TLS_DTPOFF64 245 /* DTP offset 32-bit. */ ++#define R_PARISC_TLS_LE21L R_PARISC_TPREL21L ++#define R_PARISC_TLS_LE14R R_PARISC_TPREL14R ++#define R_PARISC_TLS_IE21L R_PARISC_LTOFF_TP21L ++#define R_PARISC_TLS_IE14R R_PARISC_LTOFF_TP14R ++#define R_PARISC_TLS_TPREL32 R_PARISC_TPREL32 ++#define R_PARISC_TLS_TPREL64 R_PARISC_TPREL64 ++#define R_PARISC_HIRESERVE 255 ++ ++/* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr. */ ++ ++#define PT_HP_TLS (PT_LOOS + 0x0) ++#define PT_HP_CORE_NONE (PT_LOOS + 0x1) ++#define PT_HP_CORE_VERSION (PT_LOOS + 0x2) ++#define PT_HP_CORE_KERNEL (PT_LOOS + 0x3) ++#define PT_HP_CORE_COMM (PT_LOOS + 0x4) ++#define PT_HP_CORE_PROC (PT_LOOS + 0x5) ++#define PT_HP_CORE_LOADABLE (PT_LOOS + 0x6) ++#define PT_HP_CORE_STACK (PT_LOOS + 0x7) ++#define PT_HP_CORE_SHM (PT_LOOS + 0x8) ++#define PT_HP_CORE_MMF (PT_LOOS + 0x9) ++#define PT_HP_PARALLEL (PT_LOOS + 0x10) ++#define PT_HP_FASTBIND (PT_LOOS + 0x11) ++#define PT_HP_OPT_ANNOT (PT_LOOS + 0x12) ++#define PT_HP_HSL_ANNOT (PT_LOOS + 0x13) ++#define PT_HP_STACK (PT_LOOS + 0x14) ++ ++#define PT_PARISC_ARCHEXT 0x70000000 ++#define PT_PARISC_UNWIND 0x70000001 ++ ++/* Legal values for p_flags field of Elf32_Phdr/Elf64_Phdr. */ ++ ++#define PF_PARISC_SBP 0x08000000 ++ ++#define PF_HP_PAGE_SIZE 0x00100000 ++#define PF_HP_FAR_SHARED 0x00200000 ++#define PF_HP_NEAR_SHARED 0x00400000 ++#define PF_HP_CODE 0x01000000 ++#define PF_HP_MODIFY 0x02000000 ++#define PF_HP_LAZYSWAP 0x04000000 ++#define PF_HP_SBP 0x08000000 ++ ++ ++/* Alpha specific definitions. */ ++ ++/* Legal values for e_flags field of Elf64_Ehdr. */ ++ ++#define EF_ALPHA_32BIT 1 /* All addresses must be < 2GB. */ ++#define EF_ALPHA_CANRELAX 2 /* Relocations for relaxing exist. */ ++ ++/* Legal values for sh_type field of Elf64_Shdr. */ ++ ++/* These two are primerily concerned with ECOFF debugging info. */ ++#define SHT_ALPHA_DEBUG 0x70000001 ++#define SHT_ALPHA_REGINFO 0x70000002 ++ ++/* Legal values for sh_flags field of Elf64_Shdr. */ ++ ++#define SHF_ALPHA_GPREL 0x10000000 ++ ++/* Legal values for st_other field of Elf64_Sym. */ ++#define STO_ALPHA_NOPV 0x80 /* No PV required. */ ++#define STO_ALPHA_STD_GPLOAD 0x88 /* PV only used for initial ldgp. */ ++ ++/* Alpha relocs. */ ++ ++#define R_ALPHA_NONE 0 /* No reloc */ ++#define R_ALPHA_REFLONG 1 /* Direct 32 bit */ ++#define R_ALPHA_REFQUAD 2 /* Direct 64 bit */ ++#define R_ALPHA_GPREL32 3 /* GP relative 32 bit */ ++#define R_ALPHA_LITERAL 4 /* GP relative 16 bit w/optimization */ ++#define R_ALPHA_LITUSE 5 /* Optimization hint for LITERAL */ ++#define R_ALPHA_GPDISP 6 /* Add displacement to GP */ ++#define R_ALPHA_BRADDR 7 /* PC+4 relative 23 bit shifted */ ++#define R_ALPHA_HINT 8 /* PC+4 relative 16 bit shifted */ ++#define R_ALPHA_SREL16 9 /* PC relative 16 bit */ ++#define R_ALPHA_SREL32 10 /* PC relative 32 bit */ ++#define R_ALPHA_SREL64 11 /* PC relative 64 bit */ ++#define R_ALPHA_GPRELHIGH 17 /* GP relative 32 bit, high 16 bits */ ++#define R_ALPHA_GPRELLOW 18 /* GP relative 32 bit, low 16 bits */ ++#define R_ALPHA_GPREL16 19 /* GP relative 16 bit */ ++#define R_ALPHA_COPY 24 /* Copy symbol at runtime */ ++#define R_ALPHA_GLOB_DAT 25 /* Create GOT entry */ ++#define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */ ++#define R_ALPHA_RELATIVE 27 /* Adjust by program base */ ++#define R_ALPHA_TLS_GD_HI 28 ++#define R_ALPHA_TLSGD 29 ++#define R_ALPHA_TLS_LDM 30 ++#define R_ALPHA_DTPMOD64 31 ++#define R_ALPHA_GOTDTPREL 32 ++#define R_ALPHA_DTPREL64 33 ++#define R_ALPHA_DTPRELHI 34 ++#define R_ALPHA_DTPRELLO 35 ++#define R_ALPHA_DTPREL16 36 ++#define R_ALPHA_GOTTPREL 37 ++#define R_ALPHA_TPREL64 38 ++#define R_ALPHA_TPRELHI 39 ++#define R_ALPHA_TPRELLO 40 ++#define R_ALPHA_TPREL16 41 ++/* Keep this the last entry. */ ++#define R_ALPHA_NUM 46 ++ ++/* Magic values of the LITUSE relocation addend. */ ++#define LITUSE_ALPHA_ADDR 0 ++#define LITUSE_ALPHA_BASE 1 ++#define LITUSE_ALPHA_BYTOFF 2 ++#define LITUSE_ALPHA_JSR 3 ++#define LITUSE_ALPHA_TLS_GD 4 ++#define LITUSE_ALPHA_TLS_LDM 5 ++ ++/* Legal values for d_tag of Elf64_Dyn. */ ++#define DT_ALPHA_PLTRO (DT_LOPROC + 0) ++#define DT_ALPHA_NUM 1 ++ ++/* PowerPC specific declarations */ ++ ++/* Values for Elf32/64_Ehdr.e_flags. */ ++#define EF_PPC_EMB 0x80000000 /* PowerPC embedded flag */ ++ ++/* Cygnus local bits below */ ++#define EF_PPC_RELOCATABLE 0x00010000 /* PowerPC -mrelocatable flag*/ ++#define EF_PPC_RELOCATABLE_LIB 0x00008000 /* PowerPC -mrelocatable-lib ++ flag */ ++ ++/* PowerPC relocations defined by the ABIs */ ++#define R_PPC_NONE 0 ++#define R_PPC_ADDR32 1 /* 32bit absolute address */ ++#define R_PPC_ADDR24 2 /* 26bit address, 2 bits ignored. */ ++#define R_PPC_ADDR16 3 /* 16bit absolute address */ ++#define R_PPC_ADDR16_LO 4 /* lower 16bit of absolute address */ ++#define R_PPC_ADDR16_HI 5 /* high 16bit of absolute address */ ++#define R_PPC_ADDR16_HA 6 /* adjusted high 16bit */ ++#define R_PPC_ADDR14 7 /* 16bit address, 2 bits ignored */ ++#define R_PPC_ADDR14_BRTAKEN 8 ++#define R_PPC_ADDR14_BRNTAKEN 9 ++#define R_PPC_REL24 10 /* PC relative 26 bit */ ++#define R_PPC_REL14 11 /* PC relative 16 bit */ ++#define R_PPC_REL14_BRTAKEN 12 ++#define R_PPC_REL14_BRNTAKEN 13 ++#define R_PPC_GOT16 14 ++#define R_PPC_GOT16_LO 15 ++#define R_PPC_GOT16_HI 16 ++#define R_PPC_GOT16_HA 17 ++#define R_PPC_PLTREL24 18 ++#define R_PPC_COPY 19 ++#define R_PPC_GLOB_DAT 20 ++#define R_PPC_JMP_SLOT 21 ++#define R_PPC_RELATIVE 22 ++#define R_PPC_LOCAL24PC 23 ++#define R_PPC_UADDR32 24 ++#define R_PPC_UADDR16 25 ++#define R_PPC_REL32 26 ++#define R_PPC_PLT32 27 ++#define R_PPC_PLTREL32 28 ++#define R_PPC_PLT16_LO 29 ++#define R_PPC_PLT16_HI 30 ++#define R_PPC_PLT16_HA 31 ++#define R_PPC_SDAREL16 32 ++#define R_PPC_SECTOFF 33 ++#define R_PPC_SECTOFF_LO 34 ++#define R_PPC_SECTOFF_HI 35 ++#define R_PPC_SECTOFF_HA 36 ++ ++/* PowerPC relocations defined for the TLS access ABI. */ ++#define R_PPC_TLS 67 /* none (sym+add)@tls */ ++#define R_PPC_DTPMOD32 68 /* word32 (sym+add)@dtpmod */ ++#define R_PPC_TPREL16 69 /* half16* (sym+add)@tprel */ ++#define R_PPC_TPREL16_LO 70 /* half16 (sym+add)@tprel@l */ ++#define R_PPC_TPREL16_HI 71 /* half16 (sym+add)@tprel@h */ ++#define R_PPC_TPREL16_HA 72 /* half16 (sym+add)@tprel@ha */ ++#define R_PPC_TPREL32 73 /* word32 (sym+add)@tprel */ ++#define R_PPC_DTPREL16 74 /* half16* (sym+add)@dtprel */ ++#define R_PPC_DTPREL16_LO 75 /* half16 (sym+add)@dtprel@l */ ++#define R_PPC_DTPREL16_HI 76 /* half16 (sym+add)@dtprel@h */ ++#define R_PPC_DTPREL16_HA 77 /* half16 (sym+add)@dtprel@ha */ ++#define R_PPC_DTPREL32 78 /* word32 (sym+add)@dtprel */ ++#define R_PPC_GOT_TLSGD16 79 /* half16* (sym+add)@got@tlsgd */ ++#define R_PPC_GOT_TLSGD16_LO 80 /* half16 (sym+add)@got@tlsgd@l */ ++#define R_PPC_GOT_TLSGD16_HI 81 /* half16 (sym+add)@got@tlsgd@h */ ++#define R_PPC_GOT_TLSGD16_HA 82 /* half16 (sym+add)@got@tlsgd@ha */ ++#define R_PPC_GOT_TLSLD16 83 /* half16* (sym+add)@got@tlsld */ ++#define R_PPC_GOT_TLSLD16_LO 84 /* half16 (sym+add)@got@tlsld@l */ ++#define R_PPC_GOT_TLSLD16_HI 85 /* half16 (sym+add)@got@tlsld@h */ ++#define R_PPC_GOT_TLSLD16_HA 86 /* half16 (sym+add)@got@tlsld@ha */ ++#define R_PPC_GOT_TPREL16 87 /* half16* (sym+add)@got@tprel */ ++#define R_PPC_GOT_TPREL16_LO 88 /* half16 (sym+add)@got@tprel@l */ ++#define R_PPC_GOT_TPREL16_HI 89 /* half16 (sym+add)@got@tprel@h */ ++#define R_PPC_GOT_TPREL16_HA 90 /* half16 (sym+add)@got@tprel@ha */ ++#define R_PPC_GOT_DTPREL16 91 /* half16* (sym+add)@got@dtprel */ ++#define R_PPC_GOT_DTPREL16_LO 92 /* half16* (sym+add)@got@dtprel@l */ ++#define R_PPC_GOT_DTPREL16_HI 93 /* half16* (sym+add)@got@dtprel@h */ ++#define R_PPC_GOT_DTPREL16_HA 94 /* half16* (sym+add)@got@dtprel@ha */ ++ ++/* The remaining relocs are from the Embedded ELF ABI, and are not ++ in the SVR4 ELF ABI. */ ++#define R_PPC_EMB_NADDR32 101 ++#define R_PPC_EMB_NADDR16 102 ++#define R_PPC_EMB_NADDR16_LO 103 ++#define R_PPC_EMB_NADDR16_HI 104 ++#define R_PPC_EMB_NADDR16_HA 105 ++#define R_PPC_EMB_SDAI16 106 ++#define R_PPC_EMB_SDA2I16 107 ++#define R_PPC_EMB_SDA2REL 108 ++#define R_PPC_EMB_SDA21 109 /* 16 bit offset in SDA */ ++#define R_PPC_EMB_MRKREF 110 ++#define R_PPC_EMB_RELSEC16 111 ++#define R_PPC_EMB_RELST_LO 112 ++#define R_PPC_EMB_RELST_HI 113 ++#define R_PPC_EMB_RELST_HA 114 ++#define R_PPC_EMB_BIT_FLD 115 ++#define R_PPC_EMB_RELSDA 116 /* 16 bit relative offset in SDA */ ++ ++/* Diab tool relocations. */ ++#define R_PPC_DIAB_SDA21_LO 180 /* like EMB_SDA21, but lower 16 bit */ ++#define R_PPC_DIAB_SDA21_HI 181 /* like EMB_SDA21, but high 16 bit */ ++#define R_PPC_DIAB_SDA21_HA 182 /* like EMB_SDA21, adjusted high 16 */ ++#define R_PPC_DIAB_RELSDA_LO 183 /* like EMB_RELSDA, but lower 16 bit */ ++#define R_PPC_DIAB_RELSDA_HI 184 /* like EMB_RELSDA, but high 16 bit */ ++#define R_PPC_DIAB_RELSDA_HA 185 /* like EMB_RELSDA, adjusted high 16 */ ++ ++/* GNU extension to support local ifunc. */ ++#define R_PPC_IRELATIVE 248 ++ ++/* GNU relocs used in PIC code sequences. */ ++#define R_PPC_REL16 249 /* half16 (sym+add-.) */ ++#define R_PPC_REL16_LO 250 /* half16 (sym+add-.)@l */ ++#define R_PPC_REL16_HI 251 /* half16 (sym+add-.)@h */ ++#define R_PPC_REL16_HA 252 /* half16 (sym+add-.)@ha */ ++ ++/* This is a phony reloc to handle any old fashioned TOC16 references ++ that may still be in object files. */ ++#define R_PPC_TOC16 255 ++ ++/* PowerPC specific values for the Dyn d_tag field. */ ++#define DT_PPC_GOT (DT_LOPROC + 0) ++#define DT_PPC_NUM 1 ++ ++/* PowerPC64 relocations defined by the ABIs */ ++#define R_PPC64_NONE R_PPC_NONE ++#define R_PPC64_ADDR32 R_PPC_ADDR32 /* 32bit absolute address */ ++#define R_PPC64_ADDR24 R_PPC_ADDR24 /* 26bit address, word aligned */ ++#define R_PPC64_ADDR16 R_PPC_ADDR16 /* 16bit absolute address */ ++#define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO /* lower 16bits of address */ ++#define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI /* high 16bits of address. */ ++#define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA /* adjusted high 16bits. */ ++#define R_PPC64_ADDR14 R_PPC_ADDR14 /* 16bit address, word aligned */ ++#define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN ++#define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN ++#define R_PPC64_REL24 R_PPC_REL24 /* PC-rel. 26 bit, word aligned */ ++#define R_PPC64_REL14 R_PPC_REL14 /* PC relative 16 bit */ ++#define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN ++#define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN ++#define R_PPC64_GOT16 R_PPC_GOT16 ++#define R_PPC64_GOT16_LO R_PPC_GOT16_LO ++#define R_PPC64_GOT16_HI R_PPC_GOT16_HI ++#define R_PPC64_GOT16_HA R_PPC_GOT16_HA ++ ++#define R_PPC64_COPY R_PPC_COPY ++#define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT ++#define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT ++#define R_PPC64_RELATIVE R_PPC_RELATIVE ++ ++#define R_PPC64_UADDR32 R_PPC_UADDR32 ++#define R_PPC64_UADDR16 R_PPC_UADDR16 ++#define R_PPC64_REL32 R_PPC_REL32 ++#define R_PPC64_PLT32 R_PPC_PLT32 ++#define R_PPC64_PLTREL32 R_PPC_PLTREL32 ++#define R_PPC64_PLT16_LO R_PPC_PLT16_LO ++#define R_PPC64_PLT16_HI R_PPC_PLT16_HI ++#define R_PPC64_PLT16_HA R_PPC_PLT16_HA ++ ++#define R_PPC64_SECTOFF R_PPC_SECTOFF ++#define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO ++#define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI ++#define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA ++#define R_PPC64_ADDR30 37 /* word30 (S + A - P) >> 2 */ ++#define R_PPC64_ADDR64 38 /* doubleword64 S + A */ ++#define R_PPC64_ADDR16_HIGHER 39 /* half16 #higher(S + A) */ ++#define R_PPC64_ADDR16_HIGHERA 40 /* half16 #highera(S + A) */ ++#define R_PPC64_ADDR16_HIGHEST 41 /* half16 #highest(S + A) */ ++#define R_PPC64_ADDR16_HIGHESTA 42 /* half16 #highesta(S + A) */ ++#define R_PPC64_UADDR64 43 /* doubleword64 S + A */ ++#define R_PPC64_REL64 44 /* doubleword64 S + A - P */ ++#define R_PPC64_PLT64 45 /* doubleword64 L + A */ ++#define R_PPC64_PLTREL64 46 /* doubleword64 L + A - P */ ++#define R_PPC64_TOC16 47 /* half16* S + A - .TOC */ ++#define R_PPC64_TOC16_LO 48 /* half16 #lo(S + A - .TOC.) */ ++#define R_PPC64_TOC16_HI 49 /* half16 #hi(S + A - .TOC.) */ ++#define R_PPC64_TOC16_HA 50 /* half16 #ha(S + A - .TOC.) */ ++#define R_PPC64_TOC 51 /* doubleword64 .TOC */ ++#define R_PPC64_PLTGOT16 52 /* half16* M + A */ ++#define R_PPC64_PLTGOT16_LO 53 /* half16 #lo(M + A) */ ++#define R_PPC64_PLTGOT16_HI 54 /* half16 #hi(M + A) */ ++#define R_PPC64_PLTGOT16_HA 55 /* half16 #ha(M + A) */ ++ ++#define R_PPC64_ADDR16_DS 56 /* half16ds* (S + A) >> 2 */ ++#define R_PPC64_ADDR16_LO_DS 57 /* half16ds #lo(S + A) >> 2 */ ++#define R_PPC64_GOT16_DS 58 /* half16ds* (G + A) >> 2 */ ++#define R_PPC64_GOT16_LO_DS 59 /* half16ds #lo(G + A) >> 2 */ ++#define R_PPC64_PLT16_LO_DS 60 /* half16ds #lo(L + A) >> 2 */ ++#define R_PPC64_SECTOFF_DS 61 /* half16ds* (R + A) >> 2 */ ++#define R_PPC64_SECTOFF_LO_DS 62 /* half16ds #lo(R + A) >> 2 */ ++#define R_PPC64_TOC16_DS 63 /* half16ds* (S + A - .TOC.) >> 2 */ ++#define R_PPC64_TOC16_LO_DS 64 /* half16ds #lo(S + A - .TOC.) >> 2 */ ++#define R_PPC64_PLTGOT16_DS 65 /* half16ds* (M + A) >> 2 */ ++#define R_PPC64_PLTGOT16_LO_DS 66 /* half16ds #lo(M + A) >> 2 */ ++ ++/* PowerPC64 relocations defined for the TLS access ABI. */ ++#define R_PPC64_TLS 67 /* none (sym+add)@tls */ ++#define R_PPC64_DTPMOD64 68 /* doubleword64 (sym+add)@dtpmod */ ++#define R_PPC64_TPREL16 69 /* half16* (sym+add)@tprel */ ++#define R_PPC64_TPREL16_LO 70 /* half16 (sym+add)@tprel@l */ ++#define R_PPC64_TPREL16_HI 71 /* half16 (sym+add)@tprel@h */ ++#define R_PPC64_TPREL16_HA 72 /* half16 (sym+add)@tprel@ha */ ++#define R_PPC64_TPREL64 73 /* doubleword64 (sym+add)@tprel */ ++#define R_PPC64_DTPREL16 74 /* half16* (sym+add)@dtprel */ ++#define R_PPC64_DTPREL16_LO 75 /* half16 (sym+add)@dtprel@l */ ++#define R_PPC64_DTPREL16_HI 76 /* half16 (sym+add)@dtprel@h */ ++#define R_PPC64_DTPREL16_HA 77 /* half16 (sym+add)@dtprel@ha */ ++#define R_PPC64_DTPREL64 78 /* doubleword64 (sym+add)@dtprel */ ++#define R_PPC64_GOT_TLSGD16 79 /* half16* (sym+add)@got@tlsgd */ ++#define R_PPC64_GOT_TLSGD16_LO 80 /* half16 (sym+add)@got@tlsgd@l */ ++#define R_PPC64_GOT_TLSGD16_HI 81 /* half16 (sym+add)@got@tlsgd@h */ ++#define R_PPC64_GOT_TLSGD16_HA 82 /* half16 (sym+add)@got@tlsgd@ha */ ++#define R_PPC64_GOT_TLSLD16 83 /* half16* (sym+add)@got@tlsld */ ++#define R_PPC64_GOT_TLSLD16_LO 84 /* half16 (sym+add)@got@tlsld@l */ ++#define R_PPC64_GOT_TLSLD16_HI 85 /* half16 (sym+add)@got@tlsld@h */ ++#define R_PPC64_GOT_TLSLD16_HA 86 /* half16 (sym+add)@got@tlsld@ha */ ++#define R_PPC64_GOT_TPREL16_DS 87 /* half16ds* (sym+add)@got@tprel */ ++#define R_PPC64_GOT_TPREL16_LO_DS 88 /* half16ds (sym+add)@got@tprel@l */ ++#define R_PPC64_GOT_TPREL16_HI 89 /* half16 (sym+add)@got@tprel@h */ ++#define R_PPC64_GOT_TPREL16_HA 90 /* half16 (sym+add)@got@tprel@ha */ ++#define R_PPC64_GOT_DTPREL16_DS 91 /* half16ds* (sym+add)@got@dtprel */ ++#define R_PPC64_GOT_DTPREL16_LO_DS 92 /* half16ds (sym+add)@got@dtprel@l */ ++#define R_PPC64_GOT_DTPREL16_HI 93 /* half16 (sym+add)@got@dtprel@h */ ++#define R_PPC64_GOT_DTPREL16_HA 94 /* half16 (sym+add)@got@dtprel@ha */ ++#define R_PPC64_TPREL16_DS 95 /* half16ds* (sym+add)@tprel */ ++#define R_PPC64_TPREL16_LO_DS 96 /* half16ds (sym+add)@tprel@l */ ++#define R_PPC64_TPREL16_HIGHER 97 /* half16 (sym+add)@tprel@higher */ ++#define R_PPC64_TPREL16_HIGHERA 98 /* half16 (sym+add)@tprel@highera */ ++#define R_PPC64_TPREL16_HIGHEST 99 /* half16 (sym+add)@tprel@highest */ ++#define R_PPC64_TPREL16_HIGHESTA 100 /* half16 (sym+add)@tprel@highesta */ ++#define R_PPC64_DTPREL16_DS 101 /* half16ds* (sym+add)@dtprel */ ++#define R_PPC64_DTPREL16_LO_DS 102 /* half16ds (sym+add)@dtprel@l */ ++#define R_PPC64_DTPREL16_HIGHER 103 /* half16 (sym+add)@dtprel@higher */ ++#define R_PPC64_DTPREL16_HIGHERA 104 /* half16 (sym+add)@dtprel@highera */ ++#define R_PPC64_DTPREL16_HIGHEST 105 /* half16 (sym+add)@dtprel@highest */ ++#define R_PPC64_DTPREL16_HIGHESTA 106 /* half16 (sym+add)@dtprel@highesta */ ++ ++/* GNU extension to support local ifunc. */ ++#define R_PPC64_JMP_IREL 247 ++#define R_PPC64_IRELATIVE 248 ++#define R_PPC64_REL16 249 /* half16 (sym+add-.) */ ++#define R_PPC64_REL16_LO 250 /* half16 (sym+add-.)@l */ ++#define R_PPC64_REL16_HI 251 /* half16 (sym+add-.)@h */ ++#define R_PPC64_REL16_HA 252 /* half16 (sym+add-.)@ha */ ++ ++/* PowerPC64 specific values for the Dyn d_tag field. */ ++#define DT_PPC64_GLINK (DT_LOPROC + 0) ++#define DT_PPC64_OPD (DT_LOPROC + 1) ++#define DT_PPC64_OPDSZ (DT_LOPROC + 2) ++#define DT_PPC64_NUM 3 ++ ++ ++/* ARM specific declarations */ ++ ++/* Processor specific flags for the ELF header e_flags field. */ ++#define EF_ARM_RELEXEC 0x01 ++#define EF_ARM_HASENTRY 0x02 ++#define EF_ARM_INTERWORK 0x04 ++#define EF_ARM_APCS_26 0x08 ++#define EF_ARM_APCS_FLOAT 0x10 ++#define EF_ARM_PIC 0x20 ++#define EF_ARM_ALIGN8 0x40 /* 8-bit structure alignment is in use */ ++#define EF_ARM_NEW_ABI 0x80 ++#define EF_ARM_OLD_ABI 0x100 ++#define EF_ARM_SOFT_FLOAT 0x200 ++#define EF_ARM_VFP_FLOAT 0x400 ++#define EF_ARM_MAVERICK_FLOAT 0x800 ++ ++ ++/* Other constants defined in the ARM ELF spec. version B-01. */ ++/* NB. These conflict with values defined above. */ ++#define EF_ARM_SYMSARESORTED 0x04 ++#define EF_ARM_DYNSYMSUSESEGIDX 0x08 ++#define EF_ARM_MAPSYMSFIRST 0x10 ++#define EF_ARM_EABIMASK 0XFF000000 ++ ++/* Constants defined in AAELF. */ ++#define EF_ARM_BE8 0x00800000 ++#define EF_ARM_LE8 0x00400000 ++ ++#define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK) ++#define EF_ARM_EABI_UNKNOWN 0x00000000 ++#define EF_ARM_EABI_VER1 0x01000000 ++#define EF_ARM_EABI_VER2 0x02000000 ++#define EF_ARM_EABI_VER3 0x03000000 ++#define EF_ARM_EABI_VER4 0x04000000 ++#define EF_ARM_EABI_VER5 0x05000000 ++ ++/* Additional symbol types for Thumb. */ ++#define STT_ARM_TFUNC STT_LOPROC /* A Thumb function. */ ++#define STT_ARM_16BIT STT_HIPROC /* A Thumb label. */ ++ ++/* ARM-specific values for sh_flags */ ++#define SHF_ARM_ENTRYSECT 0x10000000 /* Section contains an entry point */ ++#define SHF_ARM_COMDEF 0x80000000 /* Section may be multiply defined ++ in the input to a link step. */ ++ ++/* ARM-specific program header flags */ ++#define PF_ARM_SB 0x10000000 /* Segment contains the location ++ addressed by the static base. */ ++#define PF_ARM_PI 0x20000000 /* Position-independent segment. */ ++#define PF_ARM_ABS 0x40000000 /* Absolute segment. */ ++ ++/* Processor specific values for the Phdr p_type field. */ ++#define PT_ARM_EXIDX (PT_LOPROC + 1) /* ARM unwind segment. */ ++ ++/* Processor specific values for the Shdr sh_type field. */ ++#define SHT_ARM_EXIDX (SHT_LOPROC + 1) /* ARM unwind section. */ ++#define SHT_ARM_PREEMPTMAP (SHT_LOPROC + 2) /* Preemption details. */ ++#define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3) /* ARM attributes section. */ ++ ++ ++/* ARM relocs. */ ++ ++#define R_ARM_NONE 0 /* No reloc */ ++#define R_ARM_PC24 1 /* PC relative 26 bit branch */ ++#define R_ARM_ABS32 2 /* Direct 32 bit */ ++#define R_ARM_REL32 3 /* PC relative 32 bit */ ++#define R_ARM_PC13 4 ++#define R_ARM_ABS16 5 /* Direct 16 bit */ ++#define R_ARM_ABS12 6 /* Direct 12 bit */ ++#define R_ARM_THM_ABS5 7 ++#define R_ARM_ABS8 8 /* Direct 8 bit */ ++#define R_ARM_SBREL32 9 ++#define R_ARM_THM_PC22 10 ++#define R_ARM_THM_PC8 11 ++#define R_ARM_AMP_VCALL9 12 ++#define R_ARM_SWI24 13 /* Obsolete static relocation. */ ++#define R_ARM_TLS_DESC 13 /* Dynamic relocation. */ ++#define R_ARM_THM_SWI8 14 ++#define R_ARM_XPC25 15 ++#define R_ARM_THM_XPC22 16 ++#define R_ARM_TLS_DTPMOD32 17 /* ID of module containing symbol */ ++#define R_ARM_TLS_DTPOFF32 18 /* Offset in TLS block */ ++#define R_ARM_TLS_TPOFF32 19 /* Offset in static TLS block */ ++#define R_ARM_COPY 20 /* Copy symbol at runtime */ ++#define R_ARM_GLOB_DAT 21 /* Create GOT entry */ ++#define R_ARM_JUMP_SLOT 22 /* Create PLT entry */ ++#define R_ARM_RELATIVE 23 /* Adjust by program base */ ++#define R_ARM_GOTOFF 24 /* 32 bit offset to GOT */ ++#define R_ARM_GOTPC 25 /* 32 bit PC relative offset to GOT */ ++#define R_ARM_GOT32 26 /* 32 bit GOT entry */ ++#define R_ARM_PLT32 27 /* 32 bit PLT address */ ++#define R_ARM_ALU_PCREL_7_0 32 ++#define R_ARM_ALU_PCREL_15_8 33 ++#define R_ARM_ALU_PCREL_23_15 34 ++#define R_ARM_LDR_SBREL_11_0 35 ++#define R_ARM_ALU_SBREL_19_12 36 ++#define R_ARM_ALU_SBREL_27_20 37 ++#define R_ARM_TLS_GOTDESC 90 ++#define R_ARM_TLS_CALL 91 ++#define R_ARM_TLS_DESCSEQ 92 ++#define R_ARM_THM_TLS_CALL 93 ++#define R_ARM_GNU_VTENTRY 100 ++#define R_ARM_GNU_VTINHERIT 101 ++#define R_ARM_THM_PC11 102 /* thumb unconditional branch */ ++#define R_ARM_THM_PC9 103 /* thumb conditional branch */ ++#define R_ARM_TLS_GD32 104 /* PC-rel 32 bit for global dynamic ++ thread local data */ ++#define R_ARM_TLS_LDM32 105 /* PC-rel 32 bit for local dynamic ++ thread local data */ ++#define R_ARM_TLS_LDO32 106 /* 32 bit offset relative to TLS ++ block */ ++#define R_ARM_TLS_IE32 107 /* PC-rel 32 bit for GOT entry of ++ static TLS block offset */ ++#define R_ARM_TLS_LE32 108 /* 32 bit offset relative to static ++ TLS block */ ++#define R_ARM_THM_TLS_DESCSEQ 129 ++#define R_ARM_IRELATIVE 160 ++#define R_ARM_RXPC25 249 ++#define R_ARM_RSBREL32 250 ++#define R_ARM_THM_RPC22 251 ++#define R_ARM_RREL32 252 ++#define R_ARM_RABS22 253 ++#define R_ARM_RPC24 254 ++#define R_ARM_RBASE 255 ++/* Keep this the last entry. */ ++#define R_ARM_NUM 256 ++ ++/* IA-64 specific declarations. */ ++ ++/* Processor specific flags for the Ehdr e_flags field. */ ++#define EF_IA_64_MASKOS 0x0000000f /* os-specific flags */ ++#define EF_IA_64_ABI64 0x00000010 /* 64-bit ABI */ ++#define EF_IA_64_ARCH 0xff000000 /* arch. version mask */ ++ ++/* Processor specific values for the Phdr p_type field. */ ++#define PT_IA_64_ARCHEXT (PT_LOPROC + 0) /* arch extension bits */ ++#define PT_IA_64_UNWIND (PT_LOPROC + 1) /* ia64 unwind bits */ ++#define PT_IA_64_HP_OPT_ANOT (PT_LOOS + 0x12) ++#define PT_IA_64_HP_HSL_ANOT (PT_LOOS + 0x13) ++#define PT_IA_64_HP_STACK (PT_LOOS + 0x14) ++ ++/* Processor specific flags for the Phdr p_flags field. */ ++#define PF_IA_64_NORECOV 0x80000000 /* spec insns w/o recovery */ ++ ++/* Processor specific values for the Shdr sh_type field. */ ++#define SHT_IA_64_EXT (SHT_LOPROC + 0) /* extension bits */ ++#define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* unwind bits */ ++ ++/* Processor specific flags for the Shdr sh_flags field. */ ++#define SHF_IA_64_SHORT 0x10000000 /* section near gp */ ++#define SHF_IA_64_NORECOV 0x20000000 /* spec insns w/o recovery */ ++ ++/* Processor specific values for the Dyn d_tag field. */ ++#define DT_IA_64_PLT_RESERVE (DT_LOPROC + 0) ++#define DT_IA_64_NUM 1 ++ ++/* IA-64 relocations. */ ++#define R_IA64_NONE 0x00 /* none */ ++#define R_IA64_IMM14 0x21 /* symbol + addend, add imm14 */ ++#define R_IA64_IMM22 0x22 /* symbol + addend, add imm22 */ ++#define R_IA64_IMM64 0x23 /* symbol + addend, mov imm64 */ ++#define R_IA64_DIR32MSB 0x24 /* symbol + addend, data4 MSB */ ++#define R_IA64_DIR32LSB 0x25 /* symbol + addend, data4 LSB */ ++#define R_IA64_DIR64MSB 0x26 /* symbol + addend, data8 MSB */ ++#define R_IA64_DIR64LSB 0x27 /* symbol + addend, data8 LSB */ ++#define R_IA64_GPREL22 0x2a /* @gprel(sym + add), add imm22 */ ++#define R_IA64_GPREL64I 0x2b /* @gprel(sym + add), mov imm64 */ ++#define R_IA64_GPREL32MSB 0x2c /* @gprel(sym + add), data4 MSB */ ++#define R_IA64_GPREL32LSB 0x2d /* @gprel(sym + add), data4 LSB */ ++#define R_IA64_GPREL64MSB 0x2e /* @gprel(sym + add), data8 MSB */ ++#define R_IA64_GPREL64LSB 0x2f /* @gprel(sym + add), data8 LSB */ ++#define R_IA64_LTOFF22 0x32 /* @ltoff(sym + add), add imm22 */ ++#define R_IA64_LTOFF64I 0x33 /* @ltoff(sym + add), mov imm64 */ ++#define R_IA64_PLTOFF22 0x3a /* @pltoff(sym + add), add imm22 */ ++#define R_IA64_PLTOFF64I 0x3b /* @pltoff(sym + add), mov imm64 */ ++#define R_IA64_PLTOFF64MSB 0x3e /* @pltoff(sym + add), data8 MSB */ ++#define R_IA64_PLTOFF64LSB 0x3f /* @pltoff(sym + add), data8 LSB */ ++#define R_IA64_FPTR64I 0x43 /* @fptr(sym + add), mov imm64 */ ++#define R_IA64_FPTR32MSB 0x44 /* @fptr(sym + add), data4 MSB */ ++#define R_IA64_FPTR32LSB 0x45 /* @fptr(sym + add), data4 LSB */ ++#define R_IA64_FPTR64MSB 0x46 /* @fptr(sym + add), data8 MSB */ ++#define R_IA64_FPTR64LSB 0x47 /* @fptr(sym + add), data8 LSB */ ++#define R_IA64_PCREL60B 0x48 /* @pcrel(sym + add), brl */ ++#define R_IA64_PCREL21B 0x49 /* @pcrel(sym + add), ptb, call */ ++#define R_IA64_PCREL21M 0x4a /* @pcrel(sym + add), chk.s */ ++#define R_IA64_PCREL21F 0x4b /* @pcrel(sym + add), fchkf */ ++#define R_IA64_PCREL32MSB 0x4c /* @pcrel(sym + add), data4 MSB */ ++#define R_IA64_PCREL32LSB 0x4d /* @pcrel(sym + add), data4 LSB */ ++#define R_IA64_PCREL64MSB 0x4e /* @pcrel(sym + add), data8 MSB */ ++#define R_IA64_PCREL64LSB 0x4f /* @pcrel(sym + add), data8 LSB */ ++#define R_IA64_LTOFF_FPTR22 0x52 /* @ltoff(@fptr(s+a)), imm22 */ ++#define R_IA64_LTOFF_FPTR64I 0x53 /* @ltoff(@fptr(s+a)), imm64 */ ++#define R_IA64_LTOFF_FPTR32MSB 0x54 /* @ltoff(@fptr(s+a)), data4 MSB */ ++#define R_IA64_LTOFF_FPTR32LSB 0x55 /* @ltoff(@fptr(s+a)), data4 LSB */ ++#define R_IA64_LTOFF_FPTR64MSB 0x56 /* @ltoff(@fptr(s+a)), data8 MSB */ ++#define R_IA64_LTOFF_FPTR64LSB 0x57 /* @ltoff(@fptr(s+a)), data8 LSB */ ++#define R_IA64_SEGREL32MSB 0x5c /* @segrel(sym + add), data4 MSB */ ++#define R_IA64_SEGREL32LSB 0x5d /* @segrel(sym + add), data4 LSB */ ++#define R_IA64_SEGREL64MSB 0x5e /* @segrel(sym + add), data8 MSB */ ++#define R_IA64_SEGREL64LSB 0x5f /* @segrel(sym + add), data8 LSB */ ++#define R_IA64_SECREL32MSB 0x64 /* @secrel(sym + add), data4 MSB */ ++#define R_IA64_SECREL32LSB 0x65 /* @secrel(sym + add), data4 LSB */ ++#define R_IA64_SECREL64MSB 0x66 /* @secrel(sym + add), data8 MSB */ ++#define R_IA64_SECREL64LSB 0x67 /* @secrel(sym + add), data8 LSB */ ++#define R_IA64_REL32MSB 0x6c /* data 4 + REL */ ++#define R_IA64_REL32LSB 0x6d /* data 4 + REL */ ++#define R_IA64_REL64MSB 0x6e /* data 8 + REL */ ++#define R_IA64_REL64LSB 0x6f /* data 8 + REL */ ++#define R_IA64_LTV32MSB 0x74 /* symbol + addend, data4 MSB */ ++#define R_IA64_LTV32LSB 0x75 /* symbol + addend, data4 LSB */ ++#define R_IA64_LTV64MSB 0x76 /* symbol + addend, data8 MSB */ ++#define R_IA64_LTV64LSB 0x77 /* symbol + addend, data8 LSB */ ++#define R_IA64_PCREL21BI 0x79 /* @pcrel(sym + add), 21bit inst */ ++#define R_IA64_PCREL22 0x7a /* @pcrel(sym + add), 22bit inst */ ++#define R_IA64_PCREL64I 0x7b /* @pcrel(sym + add), 64bit inst */ ++#define R_IA64_IPLTMSB 0x80 /* dynamic reloc, imported PLT, MSB */ ++#define R_IA64_IPLTLSB 0x81 /* dynamic reloc, imported PLT, LSB */ ++#define R_IA64_COPY 0x84 /* copy relocation */ ++#define R_IA64_SUB 0x85 /* Addend and symbol difference */ ++#define R_IA64_LTOFF22X 0x86 /* LTOFF22, relaxable. */ ++#define R_IA64_LDXMOV 0x87 /* Use of LTOFF22X. */ ++#define R_IA64_TPREL14 0x91 /* @tprel(sym + add), imm14 */ ++#define R_IA64_TPREL22 0x92 /* @tprel(sym + add), imm22 */ ++#define R_IA64_TPREL64I 0x93 /* @tprel(sym + add), imm64 */ ++#define R_IA64_TPREL64MSB 0x96 /* @tprel(sym + add), data8 MSB */ ++#define R_IA64_TPREL64LSB 0x97 /* @tprel(sym + add), data8 LSB */ ++#define R_IA64_LTOFF_TPREL22 0x9a /* @ltoff(@tprel(s+a)), imm2 */ ++#define R_IA64_DTPMOD64MSB 0xa6 /* @dtpmod(sym + add), data8 MSB */ ++#define R_IA64_DTPMOD64LSB 0xa7 /* @dtpmod(sym + add), data8 LSB */ ++#define R_IA64_LTOFF_DTPMOD22 0xaa /* @ltoff(@dtpmod(sym + add)), imm22 */ ++#define R_IA64_DTPREL14 0xb1 /* @dtprel(sym + add), imm14 */ ++#define R_IA64_DTPREL22 0xb2 /* @dtprel(sym + add), imm22 */ ++#define R_IA64_DTPREL64I 0xb3 /* @dtprel(sym + add), imm64 */ ++#define R_IA64_DTPREL32MSB 0xb4 /* @dtprel(sym + add), data4 MSB */ ++#define R_IA64_DTPREL32LSB 0xb5 /* @dtprel(sym + add), data4 LSB */ ++#define R_IA64_DTPREL64MSB 0xb6 /* @dtprel(sym + add), data8 MSB */ ++#define R_IA64_DTPREL64LSB 0xb7 /* @dtprel(sym + add), data8 LSB */ ++#define R_IA64_LTOFF_DTPREL22 0xba /* @ltoff(@dtprel(s+a)), imm22 */ ++ ++/* SH specific declarations */ ++ ++/* Processor specific flags for the ELF header e_flags field. */ ++#define EF_SH_MACH_MASK 0x1f ++#define EF_SH_UNKNOWN 0x0 ++#define EF_SH1 0x1 ++#define EF_SH2 0x2 ++#define EF_SH3 0x3 ++#define EF_SH_DSP 0x4 ++#define EF_SH3_DSP 0x5 ++#define EF_SH4AL_DSP 0x6 ++#define EF_SH3E 0x8 ++#define EF_SH4 0x9 ++#define EF_SH2E 0xb ++#define EF_SH4A 0xc ++#define EF_SH2A 0xd ++#define EF_SH4_NOFPU 0x10 ++#define EF_SH4A_NOFPU 0x11 ++#define EF_SH4_NOMMU_NOFPU 0x12 ++#define EF_SH2A_NOFPU 0x13 ++#define EF_SH3_NOMMU 0x14 ++#define EF_SH2A_SH4_NOFPU 0x15 ++#define EF_SH2A_SH3_NOFPU 0x16 ++#define EF_SH2A_SH4 0x17 ++#define EF_SH2A_SH3E 0x18 ++ ++/* SH relocs. */ ++#define R_SH_NONE 0 ++#define R_SH_DIR32 1 ++#define R_SH_REL32 2 ++#define R_SH_DIR8WPN 3 ++#define R_SH_IND12W 4 ++#define R_SH_DIR8WPL 5 ++#define R_SH_DIR8WPZ 6 ++#define R_SH_DIR8BP 7 ++#define R_SH_DIR8W 8 ++#define R_SH_DIR8L 9 ++#define R_SH_SWITCH16 25 ++#define R_SH_SWITCH32 26 ++#define R_SH_USES 27 ++#define R_SH_COUNT 28 ++#define R_SH_ALIGN 29 ++#define R_SH_CODE 30 ++#define R_SH_DATA 31 ++#define R_SH_LABEL 32 ++#define R_SH_SWITCH8 33 ++#define R_SH_GNU_VTINHERIT 34 ++#define R_SH_GNU_VTENTRY 35 ++#define R_SH_TLS_GD_32 144 ++#define R_SH_TLS_LD_32 145 ++#define R_SH_TLS_LDO_32 146 ++#define R_SH_TLS_IE_32 147 ++#define R_SH_TLS_LE_32 148 ++#define R_SH_TLS_DTPMOD32 149 ++#define R_SH_TLS_DTPOFF32 150 ++#define R_SH_TLS_TPOFF32 151 ++#define R_SH_GOT32 160 ++#define R_SH_PLT32 161 ++#define R_SH_COPY 162 ++#define R_SH_GLOB_DAT 163 ++#define R_SH_JMP_SLOT 164 ++#define R_SH_RELATIVE 165 ++#define R_SH_GOTOFF 166 ++#define R_SH_GOTPC 167 ++/* Keep this the last entry. */ ++#define R_SH_NUM 256 ++ ++/* S/390 specific definitions. */ ++ ++/* Valid values for the e_flags field. */ ++ ++#define EF_S390_HIGH_GPRS 0x00000001 /* High GPRs kernel facility needed. */ ++ ++/* Additional s390 relocs */ ++ ++#define R_390_NONE 0 /* No reloc. */ ++#define R_390_8 1 /* Direct 8 bit. */ ++#define R_390_12 2 /* Direct 12 bit. */ ++#define R_390_16 3 /* Direct 16 bit. */ ++#define R_390_32 4 /* Direct 32 bit. */ ++#define R_390_PC32 5 /* PC relative 32 bit. */ ++#define R_390_GOT12 6 /* 12 bit GOT offset. */ ++#define R_390_GOT32 7 /* 32 bit GOT offset. */ ++#define R_390_PLT32 8 /* 32 bit PC relative PLT address. */ ++#define R_390_COPY 9 /* Copy symbol at runtime. */ ++#define R_390_GLOB_DAT 10 /* Create GOT entry. */ ++#define R_390_JMP_SLOT 11 /* Create PLT entry. */ ++#define R_390_RELATIVE 12 /* Adjust by program base. */ ++#define R_390_GOTOFF32 13 /* 32 bit offset to GOT. */ ++#define R_390_GOTPC 14 /* 32 bit PC relative offset to GOT. */ ++#define R_390_GOT16 15 /* 16 bit GOT offset. */ ++#define R_390_PC16 16 /* PC relative 16 bit. */ ++#define R_390_PC16DBL 17 /* PC relative 16 bit shifted by 1. */ ++#define R_390_PLT16DBL 18 /* 16 bit PC rel. PLT shifted by 1. */ ++#define R_390_PC32DBL 19 /* PC relative 32 bit shifted by 1. */ ++#define R_390_PLT32DBL 20 /* 32 bit PC rel. PLT shifted by 1. */ ++#define R_390_GOTPCDBL 21 /* 32 bit PC rel. GOT shifted by 1. */ ++#define R_390_64 22 /* Direct 64 bit. */ ++#define R_390_PC64 23 /* PC relative 64 bit. */ ++#define R_390_GOT64 24 /* 64 bit GOT offset. */ ++#define R_390_PLT64 25 /* 64 bit PC relative PLT address. */ ++#define R_390_GOTENT 26 /* 32 bit PC rel. to GOT entry >> 1. */ ++#define R_390_GOTOFF16 27 /* 16 bit offset to GOT. */ ++#define R_390_GOTOFF64 28 /* 64 bit offset to GOT. */ ++#define R_390_GOTPLT12 29 /* 12 bit offset to jump slot. */ ++#define R_390_GOTPLT16 30 /* 16 bit offset to jump slot. */ ++#define R_390_GOTPLT32 31 /* 32 bit offset to jump slot. */ ++#define R_390_GOTPLT64 32 /* 64 bit offset to jump slot. */ ++#define R_390_GOTPLTENT 33 /* 32 bit rel. offset to jump slot. */ ++#define R_390_PLTOFF16 34 /* 16 bit offset from GOT to PLT. */ ++#define R_390_PLTOFF32 35 /* 32 bit offset from GOT to PLT. */ ++#define R_390_PLTOFF64 36 /* 16 bit offset from GOT to PLT. */ ++#define R_390_TLS_LOAD 37 /* Tag for load insn in TLS code. */ ++#define R_390_TLS_GDCALL 38 /* Tag for function call in general ++ dynamic TLS code. */ ++#define R_390_TLS_LDCALL 39 /* Tag for function call in local ++ dynamic TLS code. */ ++#define R_390_TLS_GD32 40 /* Direct 32 bit for general dynamic ++ thread local data. */ ++#define R_390_TLS_GD64 41 /* Direct 64 bit for general dynamic ++ thread local data. */ ++#define R_390_TLS_GOTIE12 42 /* 12 bit GOT offset for static TLS ++ block offset. */ ++#define R_390_TLS_GOTIE32 43 /* 32 bit GOT offset for static TLS ++ block offset. */ ++#define R_390_TLS_GOTIE64 44 /* 64 bit GOT offset for static TLS ++ block offset. */ ++#define R_390_TLS_LDM32 45 /* Direct 32 bit for local dynamic ++ thread local data in LE code. */ ++#define R_390_TLS_LDM64 46 /* Direct 64 bit for local dynamic ++ thread local data in LE code. */ ++#define R_390_TLS_IE32 47 /* 32 bit address of GOT entry for ++ negated static TLS block offset. */ ++#define R_390_TLS_IE64 48 /* 64 bit address of GOT entry for ++ negated static TLS block offset. */ ++#define R_390_TLS_IEENT 49 /* 32 bit rel. offset to GOT entry for ++ negated static TLS block offset. */ ++#define R_390_TLS_LE32 50 /* 32 bit negated offset relative to ++ static TLS block. */ ++#define R_390_TLS_LE64 51 /* 64 bit negated offset relative to ++ static TLS block. */ ++#define R_390_TLS_LDO32 52 /* 32 bit offset relative to TLS ++ block. */ ++#define R_390_TLS_LDO64 53 /* 64 bit offset relative to TLS ++ block. */ ++#define R_390_TLS_DTPMOD 54 /* ID of module containing symbol. */ ++#define R_390_TLS_DTPOFF 55 /* Offset in TLS block. */ ++#define R_390_TLS_TPOFF 56 /* Negated offset in static TLS ++ block. */ ++#define R_390_20 57 /* Direct 20 bit. */ ++#define R_390_GOT20 58 /* 20 bit GOT offset. */ ++#define R_390_GOTPLT20 59 /* 20 bit offset to jump slot. */ ++#define R_390_TLS_GOTIE20 60 /* 20 bit GOT offset for static TLS ++ block offset. */ ++#define R_390_IRELATIVE 61 /* STT_GNU_IFUNC relocation. */ ++/* Keep this the last entry. */ ++#define R_390_NUM 62 ++ ++ ++/* CRIS relocations. */ ++#define R_CRIS_NONE 0 ++#define R_CRIS_8 1 ++#define R_CRIS_16 2 ++#define R_CRIS_32 3 ++#define R_CRIS_8_PCREL 4 ++#define R_CRIS_16_PCREL 5 ++#define R_CRIS_32_PCREL 6 ++#define R_CRIS_GNU_VTINHERIT 7 ++#define R_CRIS_GNU_VTENTRY 8 ++#define R_CRIS_COPY 9 ++#define R_CRIS_GLOB_DAT 10 ++#define R_CRIS_JUMP_SLOT 11 ++#define R_CRIS_RELATIVE 12 ++#define R_CRIS_16_GOT 13 ++#define R_CRIS_32_GOT 14 ++#define R_CRIS_16_GOTPLT 15 ++#define R_CRIS_32_GOTPLT 16 ++#define R_CRIS_32_GOTREL 17 ++#define R_CRIS_32_PLT_GOTREL 18 ++#define R_CRIS_32_PLT_PCREL 19 ++ ++#define R_CRIS_NUM 20 ++ ++ ++/* AMD x86-64 relocations. */ ++#define R_X86_64_NONE 0 /* No reloc */ ++#define R_X86_64_64 1 /* Direct 64 bit */ ++#define R_X86_64_PC32 2 /* PC relative 32 bit signed */ ++#define R_X86_64_GOT32 3 /* 32 bit GOT entry */ ++#define R_X86_64_PLT32 4 /* 32 bit PLT address */ ++#define R_X86_64_COPY 5 /* Copy symbol at runtime */ ++#define R_X86_64_GLOB_DAT 6 /* Create GOT entry */ ++#define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */ ++#define R_X86_64_RELATIVE 8 /* Adjust by program base */ ++#define R_X86_64_GOTPCREL 9 /* 32 bit signed PC relative ++ offset to GOT */ ++#define R_X86_64_32 10 /* Direct 32 bit zero extended */ ++#define R_X86_64_32S 11 /* Direct 32 bit sign extended */ ++#define R_X86_64_16 12 /* Direct 16 bit zero extended */ ++#define R_X86_64_PC16 13 /* 16 bit sign extended pc relative */ ++#define R_X86_64_8 14 /* Direct 8 bit sign extended */ ++#define R_X86_64_PC8 15 /* 8 bit sign extended pc relative */ ++#define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */ ++#define R_X86_64_DTPOFF64 17 /* Offset in module's TLS block */ ++#define R_X86_64_TPOFF64 18 /* Offset in initial TLS block */ ++#define R_X86_64_TLSGD 19 /* 32 bit signed PC relative offset ++ to two GOT entries for GD symbol */ ++#define R_X86_64_TLSLD 20 /* 32 bit signed PC relative offset ++ to two GOT entries for LD symbol */ ++#define R_X86_64_DTPOFF32 21 /* Offset in TLS block */ ++#define R_X86_64_GOTTPOFF 22 /* 32 bit signed PC relative offset ++ to GOT entry for IE symbol */ ++#define R_X86_64_TPOFF32 23 /* Offset in initial TLS block */ ++#define R_X86_64_PC64 24 /* PC relative 64 bit */ ++#define R_X86_64_GOTOFF64 25 /* 64 bit offset to GOT */ ++#define R_X86_64_GOTPC32 26 /* 32 bit signed pc relative ++ offset to GOT */ ++#define R_X86_64_GOT64 27 /* 64-bit GOT entry offset */ ++#define R_X86_64_GOTPCREL64 28 /* 64-bit PC relative offset ++ to GOT entry */ ++#define R_X86_64_GOTPC64 29 /* 64-bit PC relative offset to GOT */ ++#define R_X86_64_GOTPLT64 30 /* like GOT64, says PLT entry needed */ ++#define R_X86_64_PLTOFF64 31 /* 64-bit GOT relative offset ++ to PLT entry */ ++#define R_X86_64_SIZE32 32 /* Size of symbol plus 32-bit addend */ ++#define R_X86_64_SIZE64 33 /* Size of symbol plus 64-bit addend */ ++#define R_X86_64_GOTPC32_TLSDESC 34 /* GOT offset for TLS descriptor. */ ++#define R_X86_64_TLSDESC_CALL 35 /* Marker for call through TLS ++ descriptor. */ ++#define R_X86_64_TLSDESC 36 /* TLS descriptor. */ ++#define R_X86_64_IRELATIVE 37 /* Adjust indirectly by program base */ ++#define R_X86_64_RELATIVE64 38 /* 64-bit adjust by program base */ ++ ++#define R_X86_64_NUM 39 ++ ++ ++/* AM33 relocations. */ ++#define R_MN10300_NONE 0 /* No reloc. */ ++#define R_MN10300_32 1 /* Direct 32 bit. */ ++#define R_MN10300_16 2 /* Direct 16 bit. */ ++#define R_MN10300_8 3 /* Direct 8 bit. */ ++#define R_MN10300_PCREL32 4 /* PC-relative 32-bit. */ ++#define R_MN10300_PCREL16 5 /* PC-relative 16-bit signed. */ ++#define R_MN10300_PCREL8 6 /* PC-relative 8-bit signed. */ ++#define R_MN10300_GNU_VTINHERIT 7 /* Ancient C++ vtable garbage... */ ++#define R_MN10300_GNU_VTENTRY 8 /* ... collection annotation. */ ++#define R_MN10300_24 9 /* Direct 24 bit. */ ++#define R_MN10300_GOTPC32 10 /* 32-bit PCrel offset to GOT. */ ++#define R_MN10300_GOTPC16 11 /* 16-bit PCrel offset to GOT. */ ++#define R_MN10300_GOTOFF32 12 /* 32-bit offset from GOT. */ ++#define R_MN10300_GOTOFF24 13 /* 24-bit offset from GOT. */ ++#define R_MN10300_GOTOFF16 14 /* 16-bit offset from GOT. */ ++#define R_MN10300_PLT32 15 /* 32-bit PCrel to PLT entry. */ ++#define R_MN10300_PLT16 16 /* 16-bit PCrel to PLT entry. */ ++#define R_MN10300_GOT32 17 /* 32-bit offset to GOT entry. */ ++#define R_MN10300_GOT24 18 /* 24-bit offset to GOT entry. */ ++#define R_MN10300_GOT16 19 /* 16-bit offset to GOT entry. */ ++#define R_MN10300_COPY 20 /* Copy symbol at runtime. */ ++#define R_MN10300_GLOB_DAT 21 /* Create GOT entry. */ ++#define R_MN10300_JMP_SLOT 22 /* Create PLT entry. */ ++#define R_MN10300_RELATIVE 23 /* Adjust by program base. */ ++ ++#define R_MN10300_NUM 24 ++ ++ ++/* M32R relocs. */ ++#define R_M32R_NONE 0 /* No reloc. */ ++#define R_M32R_16 1 /* Direct 16 bit. */ ++#define R_M32R_32 2 /* Direct 32 bit. */ ++#define R_M32R_24 3 /* Direct 24 bit. */ ++#define R_M32R_10_PCREL 4 /* PC relative 10 bit shifted. */ ++#define R_M32R_18_PCREL 5 /* PC relative 18 bit shifted. */ ++#define R_M32R_26_PCREL 6 /* PC relative 26 bit shifted. */ ++#define R_M32R_HI16_ULO 7 /* High 16 bit with unsigned low. */ ++#define R_M32R_HI16_SLO 8 /* High 16 bit with signed low. */ ++#define R_M32R_LO16 9 /* Low 16 bit. */ ++#define R_M32R_SDA16 10 /* 16 bit offset in SDA. */ ++#define R_M32R_GNU_VTINHERIT 11 ++#define R_M32R_GNU_VTENTRY 12 ++/* M32R relocs use SHT_RELA. */ ++#define R_M32R_16_RELA 33 /* Direct 16 bit. */ ++#define R_M32R_32_RELA 34 /* Direct 32 bit. */ ++#define R_M32R_24_RELA 35 /* Direct 24 bit. */ ++#define R_M32R_10_PCREL_RELA 36 /* PC relative 10 bit shifted. */ ++#define R_M32R_18_PCREL_RELA 37 /* PC relative 18 bit shifted. */ ++#define R_M32R_26_PCREL_RELA 38 /* PC relative 26 bit shifted. */ ++#define R_M32R_HI16_ULO_RELA 39 /* High 16 bit with unsigned low */ ++#define R_M32R_HI16_SLO_RELA 40 /* High 16 bit with signed low */ ++#define R_M32R_LO16_RELA 41 /* Low 16 bit */ ++#define R_M32R_SDA16_RELA 42 /* 16 bit offset in SDA */ ++#define R_M32R_RELA_GNU_VTINHERIT 43 ++#define R_M32R_RELA_GNU_VTENTRY 44 ++#define R_M32R_REL32 45 /* PC relative 32 bit. */ ++ ++#define R_M32R_GOT24 48 /* 24 bit GOT entry */ ++#define R_M32R_26_PLTREL 49 /* 26 bit PC relative to PLT shifted */ ++#define R_M32R_COPY 50 /* Copy symbol at runtime */ ++#define R_M32R_GLOB_DAT 51 /* Create GOT entry */ ++#define R_M32R_JMP_SLOT 52 /* Create PLT entry */ ++#define R_M32R_RELATIVE 53 /* Adjust by program base */ ++#define R_M32R_GOTOFF 54 /* 24 bit offset to GOT */ ++#define R_M32R_GOTPC24 55 /* 24 bit PC relative offset to GOT */ ++#define R_M32R_GOT16_HI_ULO 56 /* High 16 bit GOT entry with unsigned ++ low */ ++#define R_M32R_GOT16_HI_SLO 57 /* High 16 bit GOT entry with signed ++ low */ ++#define R_M32R_GOT16_LO 58 /* Low 16 bit GOT entry */ ++#define R_M32R_GOTPC_HI_ULO 59 /* High 16 bit PC relative offset to ++ GOT with unsigned low */ ++#define R_M32R_GOTPC_HI_SLO 60 /* High 16 bit PC relative offset to ++ GOT with signed low */ ++#define R_M32R_GOTPC_LO 61 /* Low 16 bit PC relative offset to ++ GOT */ ++#define R_M32R_GOTOFF_HI_ULO 62 /* High 16 bit offset to GOT ++ with unsigned low */ ++#define R_M32R_GOTOFF_HI_SLO 63 /* High 16 bit offset to GOT ++ with signed low */ ++#define R_M32R_GOTOFF_LO 64 /* Low 16 bit offset to GOT */ ++#define R_M32R_NUM 256 /* Keep this the last entry. */ ++ ++ ++/* TILEPro relocations. */ ++#define R_TILEPRO_NONE 0 /* No reloc */ ++#define R_TILEPRO_32 1 /* Direct 32 bit */ ++#define R_TILEPRO_16 2 /* Direct 16 bit */ ++#define R_TILEPRO_8 3 /* Direct 8 bit */ ++#define R_TILEPRO_32_PCREL 4 /* PC relative 32 bit */ ++#define R_TILEPRO_16_PCREL 5 /* PC relative 16 bit */ ++#define R_TILEPRO_8_PCREL 6 /* PC relative 8 bit */ ++#define R_TILEPRO_LO16 7 /* Low 16 bit */ ++#define R_TILEPRO_HI16 8 /* High 16 bit */ ++#define R_TILEPRO_HA16 9 /* High 16 bit, adjusted */ ++#define R_TILEPRO_COPY 10 /* Copy relocation */ ++#define R_TILEPRO_GLOB_DAT 11 /* Create GOT entry */ ++#define R_TILEPRO_JMP_SLOT 12 /* Create PLT entry */ ++#define R_TILEPRO_RELATIVE 13 /* Adjust by program base */ ++#define R_TILEPRO_BROFF_X1 14 /* X1 pipe branch offset */ ++#define R_TILEPRO_JOFFLONG_X1 15 /* X1 pipe jump offset */ ++#define R_TILEPRO_JOFFLONG_X1_PLT 16 /* X1 pipe jump offset to PLT */ ++#define R_TILEPRO_IMM8_X0 17 /* X0 pipe 8-bit */ ++#define R_TILEPRO_IMM8_Y0 18 /* Y0 pipe 8-bit */ ++#define R_TILEPRO_IMM8_X1 19 /* X1 pipe 8-bit */ ++#define R_TILEPRO_IMM8_Y1 20 /* Y1 pipe 8-bit */ ++#define R_TILEPRO_MT_IMM15_X1 21 /* X1 pipe mtspr */ ++#define R_TILEPRO_MF_IMM15_X1 22 /* X1 pipe mfspr */ ++#define R_TILEPRO_IMM16_X0 23 /* X0 pipe 16-bit */ ++#define R_TILEPRO_IMM16_X1 24 /* X1 pipe 16-bit */ ++#define R_TILEPRO_IMM16_X0_LO 25 /* X0 pipe low 16-bit */ ++#define R_TILEPRO_IMM16_X1_LO 26 /* X1 pipe low 16-bit */ ++#define R_TILEPRO_IMM16_X0_HI 27 /* X0 pipe high 16-bit */ ++#define R_TILEPRO_IMM16_X1_HI 28 /* X1 pipe high 16-bit */ ++#define R_TILEPRO_IMM16_X0_HA 29 /* X0 pipe high 16-bit, adjusted */ ++#define R_TILEPRO_IMM16_X1_HA 30 /* X1 pipe high 16-bit, adjusted */ ++#define R_TILEPRO_IMM16_X0_PCREL 31 /* X0 pipe PC relative 16 bit */ ++#define R_TILEPRO_IMM16_X1_PCREL 32 /* X1 pipe PC relative 16 bit */ ++#define R_TILEPRO_IMM16_X0_LO_PCREL 33 /* X0 pipe PC relative low 16 bit */ ++#define R_TILEPRO_IMM16_X1_LO_PCREL 34 /* X1 pipe PC relative low 16 bit */ ++#define R_TILEPRO_IMM16_X0_HI_PCREL 35 /* X0 pipe PC relative high 16 bit */ ++#define R_TILEPRO_IMM16_X1_HI_PCREL 36 /* X1 pipe PC relative high 16 bit */ ++#define R_TILEPRO_IMM16_X0_HA_PCREL 37 /* X0 pipe PC relative ha() 16 bit */ ++#define R_TILEPRO_IMM16_X1_HA_PCREL 38 /* X1 pipe PC relative ha() 16 bit */ ++#define R_TILEPRO_IMM16_X0_GOT 39 /* X0 pipe 16-bit GOT offset */ ++#define R_TILEPRO_IMM16_X1_GOT 40 /* X1 pipe 16-bit GOT offset */ ++#define R_TILEPRO_IMM16_X0_GOT_LO 41 /* X0 pipe low 16-bit GOT offset */ ++#define R_TILEPRO_IMM16_X1_GOT_LO 42 /* X1 pipe low 16-bit GOT offset */ ++#define R_TILEPRO_IMM16_X0_GOT_HI 43 /* X0 pipe high 16-bit GOT offset */ ++#define R_TILEPRO_IMM16_X1_GOT_HI 44 /* X1 pipe high 16-bit GOT offset */ ++#define R_TILEPRO_IMM16_X0_GOT_HA 45 /* X0 pipe ha() 16-bit GOT offset */ ++#define R_TILEPRO_IMM16_X1_GOT_HA 46 /* X1 pipe ha() 16-bit GOT offset */ ++#define R_TILEPRO_MMSTART_X0 47 /* X0 pipe mm "start" */ ++#define R_TILEPRO_MMEND_X0 48 /* X0 pipe mm "end" */ ++#define R_TILEPRO_MMSTART_X1 49 /* X1 pipe mm "start" */ ++#define R_TILEPRO_MMEND_X1 50 /* X1 pipe mm "end" */ ++#define R_TILEPRO_SHAMT_X0 51 /* X0 pipe shift amount */ ++#define R_TILEPRO_SHAMT_X1 52 /* X1 pipe shift amount */ ++#define R_TILEPRO_SHAMT_Y0 53 /* Y0 pipe shift amount */ ++#define R_TILEPRO_SHAMT_Y1 54 /* Y1 pipe shift amount */ ++#define R_TILEPRO_DEST_IMM8_X1 55 /* X1 pipe destination 8-bit */ ++/* Relocs 56-59 are currently not defined. */ ++#define R_TILEPRO_TLS_GD_CALL 60 /* "jal" for TLS GD */ ++#define R_TILEPRO_IMM8_X0_TLS_GD_ADD 61 /* X0 pipe "addi" for TLS GD */ ++#define R_TILEPRO_IMM8_X1_TLS_GD_ADD 62 /* X1 pipe "addi" for TLS GD */ ++#define R_TILEPRO_IMM8_Y0_TLS_GD_ADD 63 /* Y0 pipe "addi" for TLS GD */ ++#define R_TILEPRO_IMM8_Y1_TLS_GD_ADD 64 /* Y1 pipe "addi" for TLS GD */ ++#define R_TILEPRO_TLS_IE_LOAD 65 /* "lw_tls" for TLS IE */ ++#define R_TILEPRO_IMM16_X0_TLS_GD 66 /* X0 pipe 16-bit TLS GD offset */ ++#define R_TILEPRO_IMM16_X1_TLS_GD 67 /* X1 pipe 16-bit TLS GD offset */ ++#define R_TILEPRO_IMM16_X0_TLS_GD_LO 68 /* X0 pipe low 16-bit TLS GD offset */ ++#define R_TILEPRO_IMM16_X1_TLS_GD_LO 69 /* X1 pipe low 16-bit TLS GD offset */ ++#define R_TILEPRO_IMM16_X0_TLS_GD_HI 70 /* X0 pipe high 16-bit TLS GD offset */ ++#define R_TILEPRO_IMM16_X1_TLS_GD_HI 71 /* X1 pipe high 16-bit TLS GD offset */ ++#define R_TILEPRO_IMM16_X0_TLS_GD_HA 72 /* X0 pipe ha() 16-bit TLS GD offset */ ++#define R_TILEPRO_IMM16_X1_TLS_GD_HA 73 /* X1 pipe ha() 16-bit TLS GD offset */ ++#define R_TILEPRO_IMM16_X0_TLS_IE 74 /* X0 pipe 16-bit TLS IE offset */ ++#define R_TILEPRO_IMM16_X1_TLS_IE 75 /* X1 pipe 16-bit TLS IE offset */ ++#define R_TILEPRO_IMM16_X0_TLS_IE_LO 76 /* X0 pipe low 16-bit TLS IE offset */ ++#define R_TILEPRO_IMM16_X1_TLS_IE_LO 77 /* X1 pipe low 16-bit TLS IE offset */ ++#define R_TILEPRO_IMM16_X0_TLS_IE_HI 78 /* X0 pipe high 16-bit TLS IE offset */ ++#define R_TILEPRO_IMM16_X1_TLS_IE_HI 79 /* X1 pipe high 16-bit TLS IE offset */ ++#define R_TILEPRO_IMM16_X0_TLS_IE_HA 80 /* X0 pipe ha() 16-bit TLS IE offset */ ++#define R_TILEPRO_IMM16_X1_TLS_IE_HA 81 /* X1 pipe ha() 16-bit TLS IE offset */ ++#define R_TILEPRO_TLS_DTPMOD32 82 /* ID of module containing symbol */ ++#define R_TILEPRO_TLS_DTPOFF32 83 /* Offset in TLS block */ ++#define R_TILEPRO_TLS_TPOFF32 84 /* Offset in static TLS block */ ++#define R_TILEPRO_IMM16_X0_TLS_LE 85 /* X0 pipe 16-bit TLS LE offset */ ++#define R_TILEPRO_IMM16_X1_TLS_LE 86 /* X1 pipe 16-bit TLS LE offset */ ++#define R_TILEPRO_IMM16_X0_TLS_LE_LO 87 /* X0 pipe low 16-bit TLS LE offset */ ++#define R_TILEPRO_IMM16_X1_TLS_LE_LO 88 /* X1 pipe low 16-bit TLS LE offset */ ++#define R_TILEPRO_IMM16_X0_TLS_LE_HI 89 /* X0 pipe high 16-bit TLS LE offset */ ++#define R_TILEPRO_IMM16_X1_TLS_LE_HI 90 /* X1 pipe high 16-bit TLS LE offset */ ++#define R_TILEPRO_IMM16_X0_TLS_LE_HA 91 /* X0 pipe ha() 16-bit TLS LE offset */ ++#define R_TILEPRO_IMM16_X1_TLS_LE_HA 92 /* X1 pipe ha() 16-bit TLS LE offset */ ++ ++#define R_TILEPRO_GNU_VTINHERIT 128 /* GNU C++ vtable hierarchy */ ++#define R_TILEPRO_GNU_VTENTRY 129 /* GNU C++ vtable member usage */ ++ ++#define R_TILEPRO_NUM 130 ++ ++ ++/* TILE-Gx relocations. */ ++#define R_TILEGX_NONE 0 /* No reloc */ ++#define R_TILEGX_64 1 /* Direct 64 bit */ ++#define R_TILEGX_32 2 /* Direct 32 bit */ ++#define R_TILEGX_16 3 /* Direct 16 bit */ ++#define R_TILEGX_8 4 /* Direct 8 bit */ ++#define R_TILEGX_64_PCREL 5 /* PC relative 64 bit */ ++#define R_TILEGX_32_PCREL 6 /* PC relative 32 bit */ ++#define R_TILEGX_16_PCREL 7 /* PC relative 16 bit */ ++#define R_TILEGX_8_PCREL 8 /* PC relative 8 bit */ ++#define R_TILEGX_HW0 9 /* hword 0 16-bit */ ++#define R_TILEGX_HW1 10 /* hword 1 16-bit */ ++#define R_TILEGX_HW2 11 /* hword 2 16-bit */ ++#define R_TILEGX_HW3 12 /* hword 3 16-bit */ ++#define R_TILEGX_HW0_LAST 13 /* last hword 0 16-bit */ ++#define R_TILEGX_HW1_LAST 14 /* last hword 1 16-bit */ ++#define R_TILEGX_HW2_LAST 15 /* last hword 2 16-bit */ ++#define R_TILEGX_COPY 16 /* Copy relocation */ ++#define R_TILEGX_GLOB_DAT 17 /* Create GOT entry */ ++#define R_TILEGX_JMP_SLOT 18 /* Create PLT entry */ ++#define R_TILEGX_RELATIVE 19 /* Adjust by program base */ ++#define R_TILEGX_BROFF_X1 20 /* X1 pipe branch offset */ ++#define R_TILEGX_JUMPOFF_X1 21 /* X1 pipe jump offset */ ++#define R_TILEGX_JUMPOFF_X1_PLT 22 /* X1 pipe jump offset to PLT */ ++#define R_TILEGX_IMM8_X0 23 /* X0 pipe 8-bit */ ++#define R_TILEGX_IMM8_Y0 24 /* Y0 pipe 8-bit */ ++#define R_TILEGX_IMM8_X1 25 /* X1 pipe 8-bit */ ++#define R_TILEGX_IMM8_Y1 26 /* Y1 pipe 8-bit */ ++#define R_TILEGX_DEST_IMM8_X1 27 /* X1 pipe destination 8-bit */ ++#define R_TILEGX_MT_IMM14_X1 28 /* X1 pipe mtspr */ ++#define R_TILEGX_MF_IMM14_X1 29 /* X1 pipe mfspr */ ++#define R_TILEGX_MMSTART_X0 30 /* X0 pipe mm "start" */ ++#define R_TILEGX_MMEND_X0 31 /* X0 pipe mm "end" */ ++#define R_TILEGX_SHAMT_X0 32 /* X0 pipe shift amount */ ++#define R_TILEGX_SHAMT_X1 33 /* X1 pipe shift amount */ ++#define R_TILEGX_SHAMT_Y0 34 /* Y0 pipe shift amount */ ++#define R_TILEGX_SHAMT_Y1 35 /* Y1 pipe shift amount */ ++#define R_TILEGX_IMM16_X0_HW0 36 /* X0 pipe hword 0 */ ++#define R_TILEGX_IMM16_X1_HW0 37 /* X1 pipe hword 0 */ ++#define R_TILEGX_IMM16_X0_HW1 38 /* X0 pipe hword 1 */ ++#define R_TILEGX_IMM16_X1_HW1 39 /* X1 pipe hword 1 */ ++#define R_TILEGX_IMM16_X0_HW2 40 /* X0 pipe hword 2 */ ++#define R_TILEGX_IMM16_X1_HW2 41 /* X1 pipe hword 2 */ ++#define R_TILEGX_IMM16_X0_HW3 42 /* X0 pipe hword 3 */ ++#define R_TILEGX_IMM16_X1_HW3 43 /* X1 pipe hword 3 */ ++#define R_TILEGX_IMM16_X0_HW0_LAST 44 /* X0 pipe last hword 0 */ ++#define R_TILEGX_IMM16_X1_HW0_LAST 45 /* X1 pipe last hword 0 */ ++#define R_TILEGX_IMM16_X0_HW1_LAST 46 /* X0 pipe last hword 1 */ ++#define R_TILEGX_IMM16_X1_HW1_LAST 47 /* X1 pipe last hword 1 */ ++#define R_TILEGX_IMM16_X0_HW2_LAST 48 /* X0 pipe last hword 2 */ ++#define R_TILEGX_IMM16_X1_HW2_LAST 49 /* X1 pipe last hword 2 */ ++#define R_TILEGX_IMM16_X0_HW0_PCREL 50 /* X0 pipe PC relative hword 0 */ ++#define R_TILEGX_IMM16_X1_HW0_PCREL 51 /* X1 pipe PC relative hword 0 */ ++#define R_TILEGX_IMM16_X0_HW1_PCREL 52 /* X0 pipe PC relative hword 1 */ ++#define R_TILEGX_IMM16_X1_HW1_PCREL 53 /* X1 pipe PC relative hword 1 */ ++#define R_TILEGX_IMM16_X0_HW2_PCREL 54 /* X0 pipe PC relative hword 2 */ ++#define R_TILEGX_IMM16_X1_HW2_PCREL 55 /* X1 pipe PC relative hword 2 */ ++#define R_TILEGX_IMM16_X0_HW3_PCREL 56 /* X0 pipe PC relative hword 3 */ ++#define R_TILEGX_IMM16_X1_HW3_PCREL 57 /* X1 pipe PC relative hword 3 */ ++#define R_TILEGX_IMM16_X0_HW0_LAST_PCREL 58 /* X0 pipe PC-rel last hword 0 */ ++#define R_TILEGX_IMM16_X1_HW0_LAST_PCREL 59 /* X1 pipe PC-rel last hword 0 */ ++#define R_TILEGX_IMM16_X0_HW1_LAST_PCREL 60 /* X0 pipe PC-rel last hword 1 */ ++#define R_TILEGX_IMM16_X1_HW1_LAST_PCREL 61 /* X1 pipe PC-rel last hword 1 */ ++#define R_TILEGX_IMM16_X0_HW2_LAST_PCREL 62 /* X0 pipe PC-rel last hword 2 */ ++#define R_TILEGX_IMM16_X1_HW2_LAST_PCREL 63 /* X1 pipe PC-rel last hword 2 */ ++#define R_TILEGX_IMM16_X0_HW0_GOT 64 /* X0 pipe hword 0 GOT offset */ ++#define R_TILEGX_IMM16_X1_HW0_GOT 65 /* X1 pipe hword 0 GOT offset */ ++/* Relocs 66-71 are currently not defined. */ ++#define R_TILEGX_IMM16_X0_HW0_LAST_GOT 72 /* X0 pipe last hword 0 GOT offset */ ++#define R_TILEGX_IMM16_X1_HW0_LAST_GOT 73 /* X1 pipe last hword 0 GOT offset */ ++#define R_TILEGX_IMM16_X0_HW1_LAST_GOT 74 /* X0 pipe last hword 1 GOT offset */ ++#define R_TILEGX_IMM16_X1_HW1_LAST_GOT 75 /* X1 pipe last hword 1 GOT offset */ ++/* Relocs 76-77 are currently not defined. */ ++#define R_TILEGX_IMM16_X0_HW0_TLS_GD 78 /* X0 pipe hword 0 TLS GD offset */ ++#define R_TILEGX_IMM16_X1_HW0_TLS_GD 79 /* X1 pipe hword 0 TLS GD offset */ ++#define R_TILEGX_IMM16_X0_HW0_TLS_LE 80 /* X0 pipe hword 0 TLS LE offset */ ++#define R_TILEGX_IMM16_X1_HW0_TLS_LE 81 /* X1 pipe hword 0 TLS LE offset */ ++#define R_TILEGX_IMM16_X0_HW0_LAST_TLS_LE 82 /* X0 pipe last hword 0 LE off */ ++#define R_TILEGX_IMM16_X1_HW0_LAST_TLS_LE 83 /* X1 pipe last hword 0 LE off */ ++#define R_TILEGX_IMM16_X0_HW1_LAST_TLS_LE 84 /* X0 pipe last hword 1 LE off */ ++#define R_TILEGX_IMM16_X1_HW1_LAST_TLS_LE 85 /* X1 pipe last hword 1 LE off */ ++#define R_TILEGX_IMM16_X0_HW0_LAST_TLS_GD 86 /* X0 pipe last hword 0 GD off */ ++#define R_TILEGX_IMM16_X1_HW0_LAST_TLS_GD 87 /* X1 pipe last hword 0 GD off */ ++#define R_TILEGX_IMM16_X0_HW1_LAST_TLS_GD 88 /* X0 pipe last hword 1 GD off */ ++#define R_TILEGX_IMM16_X1_HW1_LAST_TLS_GD 89 /* X1 pipe last hword 1 GD off */ ++/* Relocs 90-91 are currently not defined. */ ++#define R_TILEGX_IMM16_X0_HW0_TLS_IE 92 /* X0 pipe hword 0 TLS IE offset */ ++#define R_TILEGX_IMM16_X1_HW0_TLS_IE 93 /* X1 pipe hword 0 TLS IE offset */ ++/* Relocs 94-99 are currently not defined. */ ++#define R_TILEGX_IMM16_X0_HW0_LAST_TLS_IE 100 /* X0 pipe last hword 0 IE off */ ++#define R_TILEGX_IMM16_X1_HW0_LAST_TLS_IE 101 /* X1 pipe last hword 0 IE off */ ++#define R_TILEGX_IMM16_X0_HW1_LAST_TLS_IE 102 /* X0 pipe last hword 1 IE off */ ++#define R_TILEGX_IMM16_X1_HW1_LAST_TLS_IE 103 /* X1 pipe last hword 1 IE off */ ++/* Relocs 104-105 are currently not defined. */ ++#define R_TILEGX_TLS_DTPMOD64 106 /* 64-bit ID of symbol's module */ ++#define R_TILEGX_TLS_DTPOFF64 107 /* 64-bit offset in TLS block */ ++#define R_TILEGX_TLS_TPOFF64 108 /* 64-bit offset in static TLS block */ ++#define R_TILEGX_TLS_DTPMOD32 109 /* 32-bit ID of symbol's module */ ++#define R_TILEGX_TLS_DTPOFF32 110 /* 32-bit offset in TLS block */ ++#define R_TILEGX_TLS_TPOFF32 111 /* 32-bit offset in static TLS block */ ++#define R_TILEGX_TLS_GD_CALL 112 /* "jal" for TLS GD */ ++#define R_TILEGX_IMM8_X0_TLS_GD_ADD 113 /* X0 pipe "addi" for TLS GD */ ++#define R_TILEGX_IMM8_X1_TLS_GD_ADD 114 /* X1 pipe "addi" for TLS GD */ ++#define R_TILEGX_IMM8_Y0_TLS_GD_ADD 115 /* Y0 pipe "addi" for TLS GD */ ++#define R_TILEGX_IMM8_Y1_TLS_GD_ADD 116 /* Y1 pipe "addi" for TLS GD */ ++#define R_TILEGX_TLS_IE_LOAD 117 /* "ld_tls" for TLS IE */ ++#define R_TILEGX_IMM8_X0_TLS_ADD 118 /* X0 pipe "addi" for TLS GD/IE */ ++#define R_TILEGX_IMM8_X1_TLS_ADD 119 /* X1 pipe "addi" for TLS GD/IE */ ++#define R_TILEGX_IMM8_Y0_TLS_ADD 120 /* Y0 pipe "addi" for TLS GD/IE */ ++#define R_TILEGX_IMM8_Y1_TLS_ADD 121 /* Y1 pipe "addi" for TLS GD/IE */ ++ ++#define R_TILEGX_GNU_VTINHERIT 128 /* GNU C++ vtable hierarchy */ ++#define R_TILEGX_GNU_VTENTRY 129 /* GNU C++ vtable member usage */ ++ ++#define R_TILEGX_NUM 130 ++ ++#endif /* elf.h */ +--- a/scripts/mod/mk_elfconfig.c ++++ b/scripts/mod/mk_elfconfig.c +@@ -2,7 +2,11 @@ + #include + #include + #include ++#ifndef __APPLE__ + #include ++#else ++#include "elf.h" ++#endif + + int + main(int argc, char **argv) +--- a/scripts/mod/modpost.h ++++ b/scripts/mod/modpost.h +@@ -8,7 +8,11 @@ + #include + #include + #include ++#if !(defined(__APPLE__) || defined(__CYGWIN__)) + #include ++#else ++#include "elf.h" ++#endif + + #include "elfconfig.h" + diff --git a/target/linux/generic/hack-4.14/211-host_tools_portability.patch b/target/linux/generic/hack-4.14/211-host_tools_portability.patch new file mode 100644 index 0000000000..59f1479436 --- /dev/null +++ b/target/linux/generic/hack-4.14/211-host_tools_portability.patch @@ -0,0 +1,40 @@ +From 7f698012384ccb1ed10cc758acfd085096fdb307 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:02:03 +0200 +Subject: kernel: fix linux 4.9 host tools portability issues + +Signed-off-by: Felix Fietkau +--- + tools/build/Build.include | 2 +- + tools/perf/pmu-events/jevents.c | 1 + + tools/perf/pmu-events/json.c | 1 - + 3 files changed, 2 insertions(+), 2 deletions(-) + +--- a/tools/build/Build.include ++++ b/tools/build/Build.include +@@ -97,4 +97,4 @@ cxx_flags = -Wp,-MD,$(depfile) -Wp,-MT,$ + ### + ## HOSTCC C flags + +-host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj)) ++host_c_flags = -MD -MF $(depfile) -MT $@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj)) +--- a/tools/perf/pmu-events/jevents.c ++++ b/tools/perf/pmu-events/jevents.c +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + #include + #include + #include +--- a/tools/perf/pmu-events/json.c ++++ b/tools/perf/pmu-events/json.c +@@ -38,7 +38,6 @@ + #include + #include "jsmn.h" + #include "json.h" +-#include + + + static char *mapfile(const char *fn, size_t *size) diff --git a/target/linux/generic/hack-4.14/212-byteshift_portability.patch b/target/linux/generic/hack-4.14/212-byteshift_portability.patch new file mode 100644 index 0000000000..1a5ac87988 --- /dev/null +++ b/target/linux/generic/hack-4.14/212-byteshift_portability.patch @@ -0,0 +1,65 @@ +From 48232d3d931c95953ce2ddfe7da7bb164aef6a73 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:03:16 +0200 +Subject: linux-3.6: fix portability of some includes files in tools/ used on the host + +lede-commit: 6040b1d29ab1f047c5e49b748abcb6a3196add28 +Signed-off-by: Felix Fietkau +--- + tools/include/tools/be_byteshift.h | 4 ++++ + tools/include/tools/le_byteshift.h | 4 ++++ + tools/include/tools/linux_types.h | 22 ++++++++++++++++++++++ + 3 files changed, 30 insertions(+) + create mode 100644 tools/include/tools/linux_types.h + +--- a/tools/include/tools/be_byteshift.h ++++ b/tools/include/tools/be_byteshift.h +@@ -2,6 +2,10 @@ + #ifndef _TOOLS_BE_BYTESHIFT_H + #define _TOOLS_BE_BYTESHIFT_H + ++#ifndef __linux__ ++#include "linux_types.h" ++#endif ++ + #include + + static inline uint16_t __get_unaligned_be16(const uint8_t *p) +--- a/tools/include/tools/le_byteshift.h ++++ b/tools/include/tools/le_byteshift.h +@@ -2,6 +2,10 @@ + #ifndef _TOOLS_LE_BYTESHIFT_H + #define _TOOLS_LE_BYTESHIFT_H + ++#ifndef __linux__ ++#include "linux_types.h" ++#endif ++ + #include + + static inline uint16_t __get_unaligned_le16(const uint8_t *p) +--- /dev/null ++++ b/tools/include/tools/linux_types.h +@@ -0,0 +1,22 @@ ++#ifndef __LINUX_TYPES_H ++#define __LINUX_TYPES_H ++ ++#include ++ ++typedef uint8_t __u8; ++typedef uint8_t __be8; ++typedef uint8_t __le8; ++ ++typedef uint16_t __u16; ++typedef uint16_t __be16; ++typedef uint16_t __le16; ++ ++typedef uint32_t __u32; ++typedef uint32_t __be32; ++typedef uint32_t __le32; ++ ++typedef uint64_t __u64; ++typedef uint64_t __be64; ++typedef uint64_t __le64; ++ ++#endif diff --git a/target/linux/generic/hack-4.14/214-spidev_h_portability.patch b/target/linux/generic/hack-4.14/214-spidev_h_portability.patch new file mode 100644 index 0000000000..093f600c85 --- /dev/null +++ b/target/linux/generic/hack-4.14/214-spidev_h_portability.patch @@ -0,0 +1,24 @@ +From be9be95ff10e16a5b4ad36f903978d0cc5747024 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:04:08 +0200 +Subject: kernel: fix linux/spi/spidev.h portability issues with musl + +Felix will try to get this define included into musl + +lede-commit: 795e7cf60de19e7a076a46874fab7bb88b43bbff +Signed-off-by: Felix Fietkau +--- + include/uapi/linux/spi/spidev.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/uapi/linux/spi/spidev.h ++++ b/include/uapi/linux/spi/spidev.h +@@ -113,7 +113,7 @@ struct spi_ioc_transfer { + + /* not all platforms use or _IOC_TYPECHECK() ... */ + #define SPI_MSGSIZE(N) \ +- ((((N)*(sizeof (struct spi_ioc_transfer))) < (1 << _IOC_SIZEBITS)) \ ++ ((((N)*(sizeof (struct spi_ioc_transfer))) < (1 << 13)) \ + ? ((N)*(sizeof (struct spi_ioc_transfer))) : 0) + #define SPI_IOC_MESSAGE(N) _IOW(SPI_IOC_MAGIC, 0, char[SPI_MSGSIZE(N)]) + diff --git a/target/linux/generic/hack-4.14/220-gc_sections.patch b/target/linux/generic/hack-4.14/220-gc_sections.patch new file mode 100644 index 0000000000..e06ddb80d4 --- /dev/null +++ b/target/linux/generic/hack-4.14/220-gc_sections.patch @@ -0,0 +1,258 @@ +From e3d8676f5722b7622685581e06e8f53e6138e3ab Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sat, 15 Jul 2017 23:42:36 +0200 +Subject: use -ffunction-sections, -fdata-sections and --gc-sections + +In combination with kernel symbol export stripping this significantly reduces +the kernel image size. Used on both ARM and MIPS architectures. + +Signed-off-by: Felix Fietkau +Signed-off-by: Jonas Gorski +Signed-off-by: Gabor Juhos +--- + Makefile | 10 +++---- + arch/arm/Kconfig | 1 + + arch/arm/boot/compressed/Makefile | 1 + + arch/arm/kernel/vmlinux.lds.S | 26 ++++++++-------- + arch/mips/Kconfig | 1 + + arch/mips/kernel/vmlinux.lds.S | 4 +-- + include/asm-generic/vmlinux.lds.h | 63 ++++++++++++++++++++------------------- + 7 files changed, 55 insertions(+), 51 deletions(-) + +--- a/Makefile ++++ b/Makefile +@@ -405,6 +405,11 @@ KBUILD_CFLAGS_MODULE := -DMODULE + KBUILD_LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds $(if $(CONFIG_PROFILING),,-s) + GCC_PLUGINS_CFLAGS := + ++ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION ++KBUILD_CFLAGS_KERNEL += $(call cc-option,-ffunction-sections,) ++KBUILD_CFLAGS_KERNEL += $(call cc-option,-fdata-sections,) ++endif ++ + # Read KERNELRELEASE from include/config/kernel.release (if it exists) + KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) + KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) +@@ -784,11 +789,6 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH + KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once) + endif + +-ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION +-KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,) +-KBUILD_CFLAGS += $(call cc-option,-fdata-sections,) +-endif +- + # arch Makefile may override CC so keep this after arch Makefile is included + NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) + CHECKFLAGS += $(NOSTDINC_FLAGS) +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -91,6 +91,7 @@ config ARM + select HAVE_UID16 + select HAVE_VIRT_CPU_ACCOUNTING_GEN + select IRQ_FORCED_THREADING ++ select LD_DEAD_CODE_DATA_ELIMINATION + select MODULES_USE_ELF_REL + select NO_BOOTMEM + select OF_EARLY_FLATTREE if OF +--- a/arch/arm/boot/compressed/Makefile ++++ b/arch/arm/boot/compressed/Makefile +@@ -103,6 +103,7 @@ ifeq ($(CONFIG_FUNCTION_TRACER),y) + ORIG_CFLAGS := $(KBUILD_CFLAGS) + KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) + endif ++KBUILD_CFLAGS_KERNEL := $(patsubst -f%-sections,,$(KBUILD_CFLAGS_KERNEL)) + + # -fstack-protector-strong triggers protection checks in this code, + # but it is being used too early to link to meaningful stack_chk logic. +--- a/arch/arm/kernel/vmlinux.lds.S ++++ b/arch/arm/kernel/vmlinux.lds.S +@@ -18,7 +18,7 @@ + #define PROC_INFO \ + . = ALIGN(4); \ + VMLINUX_SYMBOL(__proc_info_begin) = .; \ +- *(.proc.info.init) \ ++ KEEP(*(.proc.info.init)) \ + VMLINUX_SYMBOL(__proc_info_end) = .; + + #define HYPERVISOR_TEXT \ +@@ -29,11 +29,11 @@ + #define IDMAP_TEXT \ + ALIGN_FUNCTION(); \ + VMLINUX_SYMBOL(__idmap_text_start) = .; \ +- *(.idmap.text) \ ++ KEEP(*(.idmap.text)) \ + VMLINUX_SYMBOL(__idmap_text_end) = .; \ + . = ALIGN(PAGE_SIZE); \ + VMLINUX_SYMBOL(__hyp_idmap_text_start) = .; \ +- *(.hyp.idmap.text) \ ++ KEEP(*(.hyp.idmap.text)) \ + VMLINUX_SYMBOL(__hyp_idmap_text_end) = .; + + #ifdef CONFIG_HOTPLUG_CPU +@@ -106,7 +106,7 @@ SECTIONS + _stext = .; /* Text and read-only data */ + IDMAP_TEXT + __exception_text_start = .; +- *(.exception.text) ++ KEEP(*(.exception.text)) + __exception_text_end = .; + IRQENTRY_TEXT + SOFTIRQENTRY_TEXT +@@ -135,7 +135,7 @@ SECTIONS + __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { + __start___ex_table = .; + #ifdef CONFIG_MMU +- *(__ex_table) ++ KEEP(*(__ex_table)) + #endif + __stop___ex_table = .; + } +@@ -147,12 +147,12 @@ SECTIONS + . = ALIGN(8); + .ARM.unwind_idx : { + __start_unwind_idx = .; +- *(.ARM.exidx*) ++ KEEP(*(.ARM.exidx*)) + __stop_unwind_idx = .; + } + .ARM.unwind_tab : { + __start_unwind_tab = .; +- *(.ARM.extab*) ++ KEEP(*(.ARM.extab*)) + __stop_unwind_tab = .; + } + #endif +@@ -172,14 +172,14 @@ SECTIONS + */ + __vectors_start = .; + .vectors 0xffff0000 : AT(__vectors_start) { +- *(.vectors) ++ KEEP(*(.vectors)) + } + . = __vectors_start + SIZEOF(.vectors); + __vectors_end = .; + + __stubs_start = .; + .stubs ADDR(.vectors) + 0x1000 : AT(__stubs_start) { +- *(.stubs) ++ KEEP(*(.stubs)) + } + . = __stubs_start + SIZEOF(.stubs); + __stubs_end = .; +@@ -195,24 +195,24 @@ SECTIONS + } + .init.arch.info : { + __arch_info_begin = .; +- *(.arch.info.init) ++ KEEP(*(.arch.info.init)) + __arch_info_end = .; + } + .init.tagtable : { + __tagtable_begin = .; +- *(.taglist.init) ++ KEEP(*(.taglist.init)) + __tagtable_end = .; + } + #ifdef CONFIG_SMP_ON_UP + .init.smpalt : { + __smpalt_begin = .; +- *(.alt.smp.init) ++ KEEP(*(.alt.smp.init)) + __smpalt_end = .; + } + #endif + .init.pv_table : { + __pv_table_begin = .; +- *(.pv_table) ++ KEEP(*(.pv_table)) + __pv_table_end = .; + } + .init.data : { +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -39,6 +39,7 @@ config MIPS + select HAVE_CBPF_JIT if (!64BIT && !CPU_MICROMIPS) + select HAVE_EBPF_JIT if (64BIT && !CPU_MICROMIPS) + select HAVE_CC_STACKPROTECTOR ++ select LD_DEAD_CODE_DATA_ELIMINATION + select HAVE_CONTEXT_TRACKING + select HAVE_COPY_THREAD_TLS + select HAVE_C_RECORDMCOUNT +--- a/arch/mips/kernel/vmlinux.lds.S ++++ b/arch/mips/kernel/vmlinux.lds.S +@@ -72,7 +72,7 @@ SECTIONS + /* Exception table for data bus errors */ + __dbe_table : { + __start___dbe_table = .; +- *(__dbe_table) ++ KEEP(*(__dbe_table)) + __stop___dbe_table = .; + } + +@@ -123,7 +123,7 @@ SECTIONS + . = ALIGN(4); + .mips.machines.init : AT(ADDR(.mips.machines.init) - LOAD_OFFSET) { + __mips_machines_start = .; +- *(.mips.machines.init) ++ KEEP(*(.mips.machines.init)) + __mips_machines_end = .; + } + +--- a/include/asm-generic/vmlinux.lds.h ++++ b/include/asm-generic/vmlinux.lds.h +@@ -105,7 +105,7 @@ + #ifdef CONFIG_FTRACE_MCOUNT_RECORD + #define MCOUNT_REC() . = ALIGN(8); \ + VMLINUX_SYMBOL(__start_mcount_loc) = .; \ +- *(__mcount_loc) \ ++ KEEP(*(__mcount_loc)) \ + VMLINUX_SYMBOL(__stop_mcount_loc) = .; + #else + #define MCOUNT_REC() +@@ -113,7 +113,7 @@ + + #ifdef CONFIG_TRACE_BRANCH_PROFILING + #define LIKELY_PROFILE() VMLINUX_SYMBOL(__start_annotated_branch_profile) = .; \ +- *(_ftrace_annotated_branch) \ ++ KEEP(*(_ftrace_annotated_branch)) \ + VMLINUX_SYMBOL(__stop_annotated_branch_profile) = .; + #else + #define LIKELY_PROFILE() +@@ -121,7 +121,7 @@ + + #ifdef CONFIG_PROFILE_ALL_BRANCHES + #define BRANCH_PROFILE() VMLINUX_SYMBOL(__start_branch_profile) = .; \ +- *(_ftrace_branch) \ ++ KEEP(*(_ftrace_branch)) \ + VMLINUX_SYMBOL(__stop_branch_profile) = .; + #else + #define BRANCH_PROFILE() +@@ -237,7 +237,8 @@ + LIKELY_PROFILE() \ + BRANCH_PROFILE() \ + TRACE_PRINTKS() \ +- TRACEPOINT_STR() ++ TRACEPOINT_STR() \ ++ *(.data.[a-zA-Z_]*) + + /* + * Data section helpers +@@ -496,7 +497,7 @@ + #define ENTRY_TEXT \ + ALIGN_FUNCTION(); \ + VMLINUX_SYMBOL(__entry_text_start) = .; \ +- *(.entry.text) \ ++ KEEP(*(.entry.text)) \ + VMLINUX_SYMBOL(__entry_text_end) = .; + + #define IRQENTRY_TEXT \ +@@ -603,7 +604,7 @@ + . = ALIGN(sbss_align); \ + .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) { \ + *(.dynsbss) \ +- *(.sbss) \ ++ *(.sbss .sbss.*) \ + *(.scommon) \ + } + diff --git a/target/linux/generic/hack-4.14/221-module_exports.patch b/target/linux/generic/hack-4.14/221-module_exports.patch new file mode 100644 index 0000000000..9fafc9fae2 --- /dev/null +++ b/target/linux/generic/hack-4.14/221-module_exports.patch @@ -0,0 +1,101 @@ +From b14784e7883390c20ed3ff904892255404a5914b Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:05:53 +0200 +Subject: add an optional config option for stripping all unnecessary symbol exports from the kernel image + +lede-commit: bb5a40c64b7c4f4848509fa0a6625055fc9e66cc +Signed-off-by: Felix Fietkau +--- + include/asm-generic/vmlinux.lds.h | 18 +++++++++++++++--- + include/linux/export.h | 9 ++++++++- + scripts/Makefile.build | 2 +- + 3 files changed, 24 insertions(+), 5 deletions(-) + +--- a/include/asm-generic/vmlinux.lds.h ++++ b/include/asm-generic/vmlinux.lds.h +@@ -54,6 +54,16 @@ + #define LOAD_OFFSET 0 + #endif + ++#ifndef SYMTAB_KEEP ++#define SYMTAB_KEEP KEEP(*(SORT(___ksymtab+*))) ++#define SYMTAB_KEEP_GPL KEEP(*(SORT(___ksymtab_gpl+*))) ++#endif ++ ++#ifndef SYMTAB_DISCARD ++#define SYMTAB_DISCARD ++#define SYMTAB_DISCARD_GPL ++#endif ++ + #include + + /* Align . to a 8 byte boundary equals to maximum function alignment. */ +@@ -341,14 +351,14 @@ + /* Kernel symbol table: Normal symbols */ \ + __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ + VMLINUX_SYMBOL(__start___ksymtab) = .; \ +- KEEP(*(SORT(___ksymtab+*))) \ ++ SYMTAB_KEEP \ + VMLINUX_SYMBOL(__stop___ksymtab) = .; \ + } \ + \ + /* Kernel symbol table: GPL-only symbols */ \ + __ksymtab_gpl : AT(ADDR(__ksymtab_gpl) - LOAD_OFFSET) { \ + VMLINUX_SYMBOL(__start___ksymtab_gpl) = .; \ +- KEEP(*(SORT(___ksymtab_gpl+*))) \ ++ SYMTAB_KEEP_GPL \ + VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \ + } \ + \ +@@ -410,7 +420,7 @@ + \ + /* Kernel symbol table: strings */ \ + __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ +- *(__ksymtab_strings) \ ++ *(__ksymtab_strings+*) \ + } \ + \ + /* __*init sections */ \ +@@ -793,6 +803,8 @@ + EXIT_TEXT \ + EXIT_DATA \ + EXIT_CALL \ ++ SYMTAB_DISCARD \ ++ SYMTAB_DISCARD_GPL \ + *(.discard) \ + *(.discard.*) \ + } +--- a/include/linux/export.h ++++ b/include/linux/export.h +@@ -60,12 +60,19 @@ extern struct module __this_module; + #define __CRC_SYMBOL(sym, sec) + #endif + ++#ifdef MODULE ++#define __EXPORT_SUFFIX(sym) ++#else ++#define __EXPORT_SUFFIX(sym) "+" #sym ++#endif ++ + /* For every exported symbol, place a struct in the __ksymtab section */ + #define ___EXPORT_SYMBOL(sym, sec) \ + extern typeof(sym) sym; \ + __CRC_SYMBOL(sym, sec) \ + static const char __kstrtab_##sym[] \ +- __attribute__((section("__ksymtab_strings"), aligned(1))) \ ++ __attribute__((section("__ksymtab_strings" \ ++ __EXPORT_SUFFIX(sym)), aligned(1))) \ + = VMLINUX_SYMBOL_STR(sym); \ + static const struct kernel_symbol __ksymtab_##sym \ + __used \ +--- a/scripts/Makefile.build ++++ b/scripts/Makefile.build +@@ -420,7 +420,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $( + # Linker scripts preprocessor (.lds.S -> .lds) + # --------------------------------------------------------------------------- + quiet_cmd_cpp_lds_S = LDS $@ +- cmd_cpp_lds_S = $(CPP) $(cpp_flags) -P -U$(ARCH) \ ++ cmd_cpp_lds_S = $(CPP) $(EXTRA_LDSFLAGS) $(cpp_flags) -P -U$(ARCH) \ + -D__ASSEMBLY__ -DLINKER_SCRIPT -o $@ $< + + $(obj)/%.lds: $(src)/%.lds.S FORCE diff --git a/target/linux/generic/hack-4.14/230-openwrt_lzma_options.patch b/target/linux/generic/hack-4.14/230-openwrt_lzma_options.patch new file mode 100644 index 0000000000..3ae578c271 --- /dev/null +++ b/target/linux/generic/hack-4.14/230-openwrt_lzma_options.patch @@ -0,0 +1,71 @@ +From b3d00b452467f621317953d9e4c6f9ae8dcfd271 Mon Sep 17 00:00:00 2001 +From: Imre Kaloz +Date: Fri, 7 Jul 2017 17:06:55 +0200 +Subject: use the openwrt lzma options for now + +lede-commit: 548de949f392049420a6a1feeef118b30ab8ea8c +Signed-off-by: Imre Kaloz +--- + lib/decompress.c | 1 + + scripts/Makefile.lib | 2 +- + scripts/gen_initramfs_list.sh | 10 +++++----- + 3 files changed, 7 insertions(+), 6 deletions(-) + +--- a/lib/decompress.c ++++ b/lib/decompress.c +@@ -49,6 +49,7 @@ static const struct compress_format comp + { {0x1f, 0x9e}, "gzip", gunzip }, + { {0x42, 0x5a}, "bzip2", bunzip2 }, + { {0x5d, 0x00}, "lzma", unlzma }, ++ { {0x6d, 0x00}, "lzma-openwrt", unlzma }, + { {0xfd, 0x37}, "xz", unxz }, + { {0x89, 0x4c}, "lzo", unlzo }, + { {0x02, 0x21}, "lz4", unlz4 }, +--- a/scripts/Makefile.lib ++++ b/scripts/Makefile.lib +@@ -348,7 +348,7 @@ cmd_bzip2 = (cat $(filter-out FORCE,$^) + + quiet_cmd_lzma = LZMA $@ + cmd_lzma = (cat $(filter-out FORCE,$^) | \ +- lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ ++ lzma e -d20 -lc1 -lp2 -pb2 -eos -si -so && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ + (rm -f $@ ; false) + + quiet_cmd_lzo = LZO $@ +--- a/scripts/gen_initramfs_list.sh ++++ b/scripts/gen_initramfs_list.sh +@@ -229,7 +229,7 @@ cpio_list= + output="/dev/stdout" + output_file="" + is_cpio_compressed= +-compr="gzip -n -9 -f" ++compr="gzip -n -9 -f -" + + arg="$1" + case "$arg" in +@@ -245,13 +245,13 @@ case "$arg" in + output=${cpio_list} + echo "$output_file" | grep -q "\.gz$" \ + && [ -x "`which gzip 2> /dev/null`" ] \ +- && compr="gzip -n -9 -f" ++ && compr="gzip -n -9 -f -" + echo "$output_file" | grep -q "\.bz2$" \ + && [ -x "`which bzip2 2> /dev/null`" ] \ +- && compr="bzip2 -9 -f" ++ && compr="bzip2 -9 -f -" + echo "$output_file" | grep -q "\.lzma$" \ + && [ -x "`which lzma 2> /dev/null`" ] \ +- && compr="lzma -9 -f" ++ && compr="lzma e -d20 -lc1 -lp2 -pb2 -eos -si -so" + echo "$output_file" | grep -q "\.xz$" \ + && [ -x "`which xz 2> /dev/null`" ] \ + && compr="xz --check=crc32 --lzma2=dict=1MiB" +@@ -320,7 +320,7 @@ if [ ! -z ${output_file} ]; then + if [ "${is_cpio_compressed}" = "compressed" ]; then + cat ${cpio_tfile} > ${output_file} + else +- (cat ${cpio_tfile} | ${compr} - > ${output_file}) \ ++ (cat ${cpio_tfile} | ${compr} > ${output_file}) \ + || (rm -f ${output_file} ; false) + fi + [ -z ${cpio_file} ] && rm ${cpio_tfile} diff --git a/target/linux/generic/hack-4.14/250-netfilter_depends.patch b/target/linux/generic/hack-4.14/250-netfilter_depends.patch new file mode 100644 index 0000000000..17068f7dab --- /dev/null +++ b/target/linux/generic/hack-4.14/250-netfilter_depends.patch @@ -0,0 +1,27 @@ +From: Felix Fietkau +Subject: hack: net: remove bogus netfilter dependencies + +lede-commit: 589d2a377dee27d206fc3725325309cf649e4df6 +Signed-off-by: Felix Fietkau +--- + net/netfilter/Kconfig | 2 -- + 1 file changed, 2 deletions(-) + +--- a/net/netfilter/Kconfig ++++ b/net/netfilter/Kconfig +@@ -223,7 +223,6 @@ config NF_CONNTRACK_FTP + + config NF_CONNTRACK_H323 + tristate "H.323 protocol support" +- depends on IPV6 || IPV6=n + depends on NETFILTER_ADVANCED + help + H.323 is a VoIP signalling protocol from ITU-T. As one of the most +@@ -1012,7 +1011,6 @@ config NETFILTER_XT_TARGET_SECMARK + + config NETFILTER_XT_TARGET_TCPMSS + tristate '"TCPMSS" target support' +- depends on IPV6 || IPV6=n + default m if NETFILTER_ADVANCED=n + ---help--- + This option adds a `TCPMSS' target, which allows you to alter the diff --git a/target/linux/generic/hack-4.14/251-sound_kconfig.patch b/target/linux/generic/hack-4.14/251-sound_kconfig.patch new file mode 100644 index 0000000000..e1e48ce5f3 --- /dev/null +++ b/target/linux/generic/hack-4.14/251-sound_kconfig.patch @@ -0,0 +1,197 @@ +From da3c50704f14132f4adf80d48e9a4cd5d46e54c9 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Fri, 7 Jul 2017 17:09:21 +0200 +Subject: kconfig: owrt specifc dependencies + +Signed-off-by: John Crispin +--- + crypto/Kconfig | 10 +++++----- + drivers/bcma/Kconfig | 1 + + drivers/ssb/Kconfig | 3 ++- + lib/Kconfig | 8 ++++---- + net/netfilter/Kconfig | 2 +- + net/wireless/Kconfig | 17 ++++++++++------- + sound/core/Kconfig | 4 ++-- + 7 files changed, 25 insertions(+), 20 deletions(-) + +--- a/crypto/Kconfig ++++ b/crypto/Kconfig +@@ -33,7 +33,7 @@ config CRYPTO_FIPS + this is. + + config CRYPTO_ALGAPI +- tristate ++ tristate "ALGAPI" + select CRYPTO_ALGAPI2 + help + This option provides the API for cryptographic algorithms. +@@ -42,7 +42,7 @@ config CRYPTO_ALGAPI2 + tristate + + config CRYPTO_AEAD +- tristate ++ tristate "AEAD" + select CRYPTO_AEAD2 + select CRYPTO_ALGAPI + +@@ -53,7 +53,7 @@ config CRYPTO_AEAD2 + select CRYPTO_RNG2 + + config CRYPTO_BLKCIPHER +- tristate ++ tristate "BLKCIPHER" + select CRYPTO_BLKCIPHER2 + select CRYPTO_ALGAPI + +@@ -64,7 +64,7 @@ config CRYPTO_BLKCIPHER2 + select CRYPTO_WORKQUEUE + + config CRYPTO_HASH +- tristate ++ tristate "HASH" + select CRYPTO_HASH2 + select CRYPTO_ALGAPI + +@@ -73,7 +73,7 @@ config CRYPTO_HASH2 + select CRYPTO_ALGAPI2 + + config CRYPTO_RNG +- tristate ++ tristate "RNG" + select CRYPTO_RNG2 + select CRYPTO_ALGAPI + +--- a/drivers/bcma/Kconfig ++++ b/drivers/bcma/Kconfig +@@ -15,6 +15,7 @@ menuconfig BCMA + config BCMA_BLOCKIO + bool + depends on BCMA ++ default y + + config BCMA_HOST_PCI_POSSIBLE + bool +--- a/drivers/ssb/Kconfig ++++ b/drivers/ssb/Kconfig +@@ -29,6 +29,7 @@ config SSB_SPROM + config SSB_BLOCKIO + bool + depends on SSB ++ default y + + config SSB_PCIHOST_POSSIBLE + bool +@@ -49,7 +50,7 @@ config SSB_PCIHOST + config SSB_B43_PCI_BRIDGE + bool + depends on SSB_PCIHOST +- default n ++ default y + + config SSB_PCMCIAHOST_POSSIBLE + bool +--- a/lib/Kconfig ++++ b/lib/Kconfig +@@ -358,16 +358,16 @@ config BCH_CONST_T + # Textsearch support is select'ed if needed + # + config TEXTSEARCH +- bool ++ boolean "Textsearch support" + + config TEXTSEARCH_KMP +- tristate ++ tristate "Textsearch KMP" + + config TEXTSEARCH_BM +- tristate ++ tristate "Textsearch BM" + + config TEXTSEARCH_FSM +- tristate ++ tristate "Textsearch FSM" + + config BTREE + bool +--- a/net/netfilter/Kconfig ++++ b/net/netfilter/Kconfig +@@ -10,7 +10,7 @@ config NETFILTER_INGRESS + infrastructure. + + config NETFILTER_NETLINK +- tristate ++ tristate "Netfilter NFNETLINK interface" + + config NETFILTER_NETLINK_ACCT + tristate "Netfilter NFACCT over NFNETLINK interface" +--- a/net/wireless/Kconfig ++++ b/net/wireless/Kconfig +@@ -1,5 +1,5 @@ + config WIRELESS_EXT +- bool ++ bool "Wireless extensions" + + config WEXT_CORE + def_bool y +@@ -11,10 +11,10 @@ config WEXT_PROC + depends on WEXT_CORE + + config WEXT_SPY +- bool ++ bool "WEXT_SPY" + + config WEXT_PRIV +- bool ++ bool "WEXT_PRIV" + + config CFG80211 + tristate "cfg80211 - wireless configuration API" +@@ -188,7 +188,7 @@ config CFG80211_WEXT_EXPORT + wext compatibility symbols to be exported. + + config LIB80211 +- tristate ++ tristate "LIB80211" + default n + help + This options enables a library of common routines used +@@ -197,13 +197,16 @@ config LIB80211 + Drivers should select this themselves if needed. + + config LIB80211_CRYPT_WEP +- tristate ++ tristate "LIB80211_CRYPT_WEP" ++ select LIB80211 + + config LIB80211_CRYPT_CCMP +- tristate ++ tristate "LIB80211_CRYPT_CCMP" ++ select LIB80211 + + config LIB80211_CRYPT_TKIP +- tristate ++ tristate "LIB80211_CRYPT_TKIP" ++ select LIB80211 + + config LIB80211_DEBUG + bool "lib80211 debugging messages" +--- a/sound/core/Kconfig ++++ b/sound/core/Kconfig +@@ -16,7 +16,7 @@ config SND_DMAENGINE_PCM + tristate + + config SND_HWDEP +- tristate ++ tristate "Sound hardware support" + + config SND_SEQ_DEVICE + tristate +@@ -26,7 +26,7 @@ config SND_RAWMIDI + select SND_SEQ_DEVICE if SND_SEQUENCER != n + + config SND_COMPRESS_OFFLOAD +- tristate ++ tristate "Compression offloading support" + + config SND_JACK + bool diff --git a/target/linux/generic/hack-4.14/259-regmap_dynamic.patch b/target/linux/generic/hack-4.14/259-regmap_dynamic.patch new file mode 100644 index 0000000000..1c6e78df30 --- /dev/null +++ b/target/linux/generic/hack-4.14/259-regmap_dynamic.patch @@ -0,0 +1,109 @@ +From 811d9e2268a62b830cfe93cd8bc929afcb8b198b Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sat, 15 Jul 2017 21:12:38 +0200 +Subject: kernel: move regmap bloat out of the kernel image if it is only being used in modules + +lede-commit: 96f39119815028073583e4fca3a9c5fe9141e998 +Signed-off-by: Felix Fietkau +--- + drivers/base/regmap/Kconfig | 15 ++++++++++----- + drivers/base/regmap/Makefile | 12 ++++++++---- + drivers/base/regmap/regmap.c | 3 +++ + include/linux/regmap.h | 2 +- + 4 files changed, 22 insertions(+), 10 deletions(-) + +--- a/drivers/base/regmap/Kconfig ++++ b/drivers/base/regmap/Kconfig +@@ -4,9 +4,8 @@ + # subsystems should select the appropriate symbols. + + config REGMAP +- default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ) + select IRQ_DOMAIN if REGMAP_IRQ +- bool ++ tristate "Regmap" + + config REGCACHE_COMPRESSED + select LZO_COMPRESS +@@ -17,23 +16,30 @@ config REGMAP_AC97 + tristate + + config REGMAP_I2C +- tristate ++ tristate "Regmap I2C" ++ select REGMAP + depends on I2C + + config REGMAP_SPI +- tristate ++ tristate "Regmap SPI" ++ select REGMAP ++ depends on SPI_MASTER + depends on SPI + + config REGMAP_SPMI ++ select REGMAP + tristate + depends on SPMI + + config REGMAP_W1 ++ select REGMAP + tristate + depends on W1 + + config REGMAP_MMIO +- tristate ++ tristate "Regmap MMIO" ++ select REGMAP + + config REGMAP_IRQ ++ select REGMAP + bool +--- a/drivers/base/regmap/Makefile ++++ b/drivers/base/regmap/Makefile +@@ -2,10 +2,14 @@ + # For include/trace/define_trace.h to include trace.h + CFLAGS_regmap.o := -I$(src) + +-obj-$(CONFIG_REGMAP) += regmap.o regcache.o +-obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-flat.o +-obj-$(CONFIG_REGCACHE_COMPRESSED) += regcache-lzo.o +-obj-$(CONFIG_DEBUG_FS) += regmap-debugfs.o ++regmap-core-objs = regmap.o regcache.o regcache-rbtree.o regcache-flat.o ++ifdef CONFIG_DEBUG_FS ++regmap-core-objs += regmap-debugfs.o ++endif ++ifdef CONFIG_REGCACHE_COMPRESSED ++regmap-core-objs += regcache-lzo.o ++endif ++obj-$(CONFIG_REGMAP) += regmap-core.o + obj-$(CONFIG_REGMAP_AC97) += regmap-ac97.o + obj-$(CONFIG_REGMAP_I2C) += regmap-i2c.o + obj-$(CONFIG_REGMAP_SPI) += regmap-spi.o +--- a/drivers/base/regmap/regmap.c ++++ b/drivers/base/regmap/regmap.c +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -2926,3 +2927,5 @@ static int __init regmap_initcall(void) + return 0; + } + postcore_initcall(regmap_initcall); ++ ++MODULE_LICENSE("GPL"); +--- a/include/linux/regmap.h ++++ b/include/linux/regmap.h +@@ -139,7 +139,7 @@ struct reg_sequence { + pollret ?: ((cond) ? 0 : -ETIMEDOUT); \ + }) + +-#ifdef CONFIG_REGMAP ++#if IS_ENABLED(CONFIG_REGMAP) + + enum regmap_endian { + /* Unspecified -> 0 -> Backwards compatible default */ diff --git a/target/linux/generic/hack-4.14/260-crypto_test_dependencies.patch b/target/linux/generic/hack-4.14/260-crypto_test_dependencies.patch new file mode 100644 index 0000000000..8523fc5374 --- /dev/null +++ b/target/linux/generic/hack-4.14/260-crypto_test_dependencies.patch @@ -0,0 +1,60 @@ +From fd1799b0bf5efa46dd3e6dfbbf3955564807e508 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:12:51 +0200 +Subject: kernel: prevent cryptomgr from pulling in useless extra dependencies for tests that are not run + +Reduces kernel size after LZMA by about 5k on MIPS + +lede-commit: 044c316167e076479a344c59905e5b435b84a77f +Signed-off-by: Felix Fietkau +--- + crypto/Kconfig | 13 ++++++------- + crypto/algboss.c | 4 ++++ + 2 files changed, 10 insertions(+), 7 deletions(-) + +--- a/crypto/Kconfig ++++ b/crypto/Kconfig +@@ -143,13 +143,13 @@ config CRYPTO_MANAGER + cbc(aes). + + config CRYPTO_MANAGER2 +- def_tristate CRYPTO_MANAGER || (CRYPTO_MANAGER!=n && CRYPTO_ALGAPI=y) +- select CRYPTO_AEAD2 +- select CRYPTO_HASH2 +- select CRYPTO_BLKCIPHER2 +- select CRYPTO_AKCIPHER2 +- select CRYPTO_KPP2 +- select CRYPTO_ACOMP2 ++ def_tristate CRYPTO_MANAGER || (CRYPTO_MANAGER!=n && CRYPTO_ALGAPI=y && !CRYPTO_MANAGER_DISABLE_TESTS) ++ select CRYPTO_AEAD2 if !CRYPTO_MANAGER_DISABLE_TESTS ++ select CRYPTO_HASH2 if !CRYPTO_MANAGER_DISABLE_TESTS ++ select CRYPTO_BLKCIPHER2 if !CRYPTO_MANAGER_DISABLE_TESTS ++ select CRYPTO_AKCIPHER2 if !CRYPTO_MANAGER_DISABLE_TESTS ++ select CRYPTO_KPP2 if !CRYPTO_MANAGER_DISABLE_TESTS ++ select CRYPTO_ACOMP2 if !CRYPTO_MANAGER_DISABLE_TESTS + + config CRYPTO_USER + tristate "Userspace cryptographic algorithm configuration" +@@ -162,7 +162,6 @@ config CRYPTO_USER + config CRYPTO_MANAGER_DISABLE_TESTS + bool "Disable run-time self tests" + default y +- depends on CRYPTO_MANAGER2 + help + Disable run-time self tests that normally take place at + algorithm registration. +--- a/crypto/algboss.c ++++ b/crypto/algboss.c +@@ -248,8 +248,12 @@ static int cryptomgr_schedule_test(struc + type = alg->cra_flags; + + /* Do not test internal algorithms. */ ++#ifdef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS ++ type |= CRYPTO_ALG_TESTED; ++#else + if (type & CRYPTO_ALG_INTERNAL) + type |= CRYPTO_ALG_TESTED; ++#endif + + param->type = type; + diff --git a/target/linux/generic/hack-4.14/280-rfkill-stubs.patch b/target/linux/generic/hack-4.14/280-rfkill-stubs.patch new file mode 100644 index 0000000000..85d01a6d10 --- /dev/null +++ b/target/linux/generic/hack-4.14/280-rfkill-stubs.patch @@ -0,0 +1,84 @@ +From 236c1acdfef5958010ac9814a9872e0a46fd78ee Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Fri, 7 Jul 2017 17:13:44 +0200 +Subject: rfkill: add fake rfkill support + +allow building of modules depending on RFKILL even if RFKILL is not enabled. + +Signed-off-by: John Crispin +--- + include/linux/rfkill.h | 2 +- + net/Makefile | 2 +- + net/rfkill/Kconfig | 14 +++++++++----- + net/rfkill/Makefile | 2 +- + 4 files changed, 12 insertions(+), 8 deletions(-) + +--- a/include/linux/rfkill.h ++++ b/include/linux/rfkill.h +@@ -64,7 +64,7 @@ struct rfkill_ops { + int (*set_block)(void *data, bool blocked); + }; + +-#if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) ++#if defined(CONFIG_RFKILL_FULL) || defined(CONFIG_RFKILL_FULL_MODULE) + /** + * rfkill_alloc - allocate rfkill structure + * @name: name of the struct -- the string is not copied internally +--- a/net/Makefile ++++ b/net/Makefile +@@ -53,7 +53,7 @@ obj-$(CONFIG_TIPC) += tipc/ + obj-$(CONFIG_NETLABEL) += netlabel/ + obj-$(CONFIG_IUCV) += iucv/ + obj-$(CONFIG_SMC) += smc/ +-obj-$(CONFIG_RFKILL) += rfkill/ ++obj-$(CONFIG_RFKILL_FULL) += rfkill/ + obj-$(CONFIG_NET_9P) += 9p/ + obj-$(CONFIG_CAIF) += caif/ + ifneq ($(CONFIG_DCB),) +--- a/net/rfkill/Kconfig ++++ b/net/rfkill/Kconfig +@@ -1,7 +1,11 @@ + # + # RF switch subsystem configuration + # +-menuconfig RFKILL ++config RFKILL ++ bool ++ default y ++ ++menuconfig RFKILL_FULL + tristate "RF switch subsystem support" + help + Say Y here if you want to have control over RF switches +@@ -13,19 +17,19 @@ menuconfig RFKILL + # LED trigger support + config RFKILL_LEDS + bool +- depends on RFKILL ++ depends on RFKILL_FULL + depends on LEDS_TRIGGERS = y || RFKILL = LEDS_TRIGGERS + default y + + config RFKILL_INPUT + bool "RF switch input support" if EXPERT +- depends on RFKILL ++ depends on RFKILL_FULL + depends on INPUT = y || RFKILL = INPUT + default y if !EXPERT + + config RFKILL_GPIO + tristate "GPIO RFKILL driver" +- depends on RFKILL ++ depends on RFKILL_FULL + depends on GPIOLIB || COMPILE_TEST + default n + help +--- a/net/rfkill/Makefile ++++ b/net/rfkill/Makefile +@@ -4,5 +4,5 @@ + + rfkill-y += core.o + rfkill-$(CONFIG_RFKILL_INPUT) += input.o +-obj-$(CONFIG_RFKILL) += rfkill.o ++obj-$(CONFIG_RFKILL_FULL) += rfkill.o + obj-$(CONFIG_RFKILL_GPIO) += rfkill-gpio.o diff --git a/target/linux/generic/hack-4.14/301-mips_image_cmdline_hack.patch b/target/linux/generic/hack-4.14/301-mips_image_cmdline_hack.patch new file mode 100644 index 0000000000..01caff5b89 --- /dev/null +++ b/target/linux/generic/hack-4.14/301-mips_image_cmdline_hack.patch @@ -0,0 +1,38 @@ +From: John Crispin +Subject: hack: kernel: add generic image_cmdline hack to MIPS targets + +lede-commit: d59f5b3a987a48508257a0ddbaeadc7909f9f976 +Signed-off-by: Gabor Juhos +--- + arch/mips/Kconfig | 4 ++++ + arch/mips/kernel/head.S | 6 ++++++ + 2 files changed, 10 insertions(+) + +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -1157,6 +1157,10 @@ config SYNC_R4K + config MIPS_MACHINE + def_bool n + ++config IMAGE_CMDLINE_HACK ++ bool "OpenWrt specific image command line hack" ++ default n ++ + config NO_IOPORT_MAP + def_bool n + +--- a/arch/mips/kernel/head.S ++++ b/arch/mips/kernel/head.S +@@ -79,6 +79,12 @@ FEXPORT(__kernel_entry) + j kernel_entry + #endif + ++#ifdef CONFIG_IMAGE_CMDLINE_HACK ++ .ascii "CMDLINE:" ++EXPORT(__image_cmdline) ++ .fill 0x400 ++#endif /* CONFIG_IMAGE_CMDLINE_HACK */ ++ + __REF + + NESTED(kernel_entry, 16, sp) # kernel entry point diff --git a/target/linux/generic/hack-4.14/321-powerpc_crtsavres_prereq.patch b/target/linux/generic/hack-4.14/321-powerpc_crtsavres_prereq.patch new file mode 100644 index 0000000000..3f81b2e05f --- /dev/null +++ b/target/linux/generic/hack-4.14/321-powerpc_crtsavres_prereq.patch @@ -0,0 +1,38 @@ +From 107c0964cb8db7ca28ac5199426414fdab3c274d Mon Sep 17 00:00:00 2001 +From: "Alexandros C. Couloumbis" +Date: Fri, 7 Jul 2017 17:14:51 +0200 +Subject: hack: arch: powerpc: drop register save/restore library from modules + +Upstream GCC uses a libgcc function for saving/restoring registers. This +makes the code bigger, and upstream kernels need to carry that function +for every single kernel module. Our GCC is patched to avoid those +references, so we can drop the extra bloat for modules. + +lede-commit: e8e1084654f50904e6bf77b70b2de3f137d7b3ec +Signed-off-by: Alexandros C. Couloumbis +--- + arch/powerpc/Makefile | 1 - + 1 file changed, 1 deletion(-) + +--- a/arch/powerpc/Makefile ++++ b/arch/powerpc/Makefile +@@ -59,19 +59,6 @@ machine-$(CONFIG_PPC64) += 64 + machine-$(CONFIG_CPU_LITTLE_ENDIAN) += le + UTS_MACHINE := $(subst $(space),,$(machine-y)) + +-# XXX This needs to be before we override LD below +-ifdef CONFIG_PPC32 +-KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o +-else +-ifeq ($(call ld-ifversion, -ge, 225000000, y),y) +-# Have the linker provide sfpr if possible. +-# There is a corresponding test in arch/powerpc/lib/Makefile +-KBUILD_LDFLAGS_MODULE += --save-restore-funcs +-else +-KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o +-endif +-endif +- + ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y) + override LD += -EL + LDEMULATION := lppc diff --git a/target/linux/generic/hack-4.14/531-debloat_lzma.patch b/target/linux/generic/hack-4.14/531-debloat_lzma.patch new file mode 100644 index 0000000000..2e453cc2f2 --- /dev/null +++ b/target/linux/generic/hack-4.14/531-debloat_lzma.patch @@ -0,0 +1,1040 @@ +From 3fd297761ac246c54d7723c57fca95c112b99465 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sat, 15 Jul 2017 21:15:44 +0200 +Subject: lzma: de-bloat the lzma library used by jffs2 + +lede-commit: 3fd1dd08fbcbb78b34efefd32c3032e5c99108d6 +Signed-off-by: Felix Fietkau +--- + include/linux/lzma/LzFind.h | 17 --- + include/linux/lzma/LzmaDec.h | 101 --------------- + include/linux/lzma/LzmaEnc.h | 20 --- + lib/lzma/LzFind.c | 287 ++++--------------------------------------- + lib/lzma/LzmaDec.c | 86 +------------ + lib/lzma/LzmaEnc.c | 172 ++------------------------ + 6 files changed, 42 insertions(+), 641 deletions(-) + +--- a/include/linux/lzma/LzFind.h ++++ b/include/linux/lzma/LzFind.h +@@ -55,11 +55,6 @@ typedef struct _CMatchFinder + + #define Inline_MatchFinder_GetNumAvailableBytes(p) ((p)->streamPos - (p)->pos) + +-int MatchFinder_NeedMove(CMatchFinder *p); +-Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p); +-void MatchFinder_MoveBlock(CMatchFinder *p); +-void MatchFinder_ReadIfRequired(CMatchFinder *p); +- + void MatchFinder_Construct(CMatchFinder *p); + + /* Conditions: +@@ -70,12 +65,6 @@ int MatchFinder_Create(CMatchFinder *p, + UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, + ISzAlloc *alloc); + void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc); +-void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems); +-void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue); +- +-UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son, +- UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue, +- UInt32 *distances, UInt32 maxLen); + + /* + Conditions: +@@ -102,12 +91,6 @@ typedef struct _IMatchFinder + + void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable); + +-void MatchFinder_Init(CMatchFinder *p); +-UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); +-UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); +-void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); +-void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); +- + #ifdef __cplusplus + } + #endif +--- a/include/linux/lzma/LzmaDec.h ++++ b/include/linux/lzma/LzmaDec.h +@@ -31,14 +31,6 @@ typedef struct _CLzmaProps + UInt32 dicSize; + } CLzmaProps; + +-/* LzmaProps_Decode - decodes properties +-Returns: +- SZ_OK +- SZ_ERROR_UNSUPPORTED - Unsupported properties +-*/ +- +-SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size); +- + + /* ---------- LZMA Decoder state ---------- */ + +@@ -70,8 +62,6 @@ typedef struct + + #define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; } + +-void LzmaDec_Init(CLzmaDec *p); +- + /* There are two types of LZMA streams: + 0) Stream with end mark. That end mark adds about 6 bytes to compressed size. + 1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */ +@@ -108,97 +98,6 @@ typedef enum + + /* ELzmaStatus is used only as output value for function call */ + +- +-/* ---------- Interfaces ---------- */ +- +-/* There are 3 levels of interfaces: +- 1) Dictionary Interface +- 2) Buffer Interface +- 3) One Call Interface +- You can select any of these interfaces, but don't mix functions from different +- groups for same object. */ +- +- +-/* There are two variants to allocate state for Dictionary Interface: +- 1) LzmaDec_Allocate / LzmaDec_Free +- 2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs +- You can use variant 2, if you set dictionary buffer manually. +- For Buffer Interface you must always use variant 1. +- +-LzmaDec_Allocate* can return: +- SZ_OK +- SZ_ERROR_MEM - Memory allocation error +- SZ_ERROR_UNSUPPORTED - Unsupported properties +-*/ +- +-SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc); +-void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc); +- +-SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc); +-void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc); +- +-/* ---------- Dictionary Interface ---------- */ +- +-/* You can use it, if you want to eliminate the overhead for data copying from +- dictionary to some other external buffer. +- You must work with CLzmaDec variables directly in this interface. +- +- STEPS: +- LzmaDec_Constr() +- LzmaDec_Allocate() +- for (each new stream) +- { +- LzmaDec_Init() +- while (it needs more decompression) +- { +- LzmaDec_DecodeToDic() +- use data from CLzmaDec::dic and update CLzmaDec::dicPos +- } +- } +- LzmaDec_Free() +-*/ +- +-/* LzmaDec_DecodeToDic +- +- The decoding to internal dictionary buffer (CLzmaDec::dic). +- You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!! +- +-finishMode: +- It has meaning only if the decoding reaches output limit (dicLimit). +- LZMA_FINISH_ANY - Decode just dicLimit bytes. +- LZMA_FINISH_END - Stream must be finished after dicLimit. +- +-Returns: +- SZ_OK +- status: +- LZMA_STATUS_FINISHED_WITH_MARK +- LZMA_STATUS_NOT_FINISHED +- LZMA_STATUS_NEEDS_MORE_INPUT +- LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK +- SZ_ERROR_DATA - Data error +-*/ +- +-SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, +- const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); +- +- +-/* ---------- Buffer Interface ---------- */ +- +-/* It's zlib-like interface. +- See LzmaDec_DecodeToDic description for information about STEPS and return results, +- but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need +- to work with CLzmaDec variables manually. +- +-finishMode: +- It has meaning only if the decoding reaches output limit (*destLen). +- LZMA_FINISH_ANY - Decode just destLen bytes. +- LZMA_FINISH_END - Stream must be finished after (*destLen). +-*/ +- +-SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, +- const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); +- +- + /* ---------- One Call Interface ---------- */ + + /* LzmaDecode +--- a/include/linux/lzma/LzmaEnc.h ++++ b/include/linux/lzma/LzmaEnc.h +@@ -31,9 +31,6 @@ typedef struct _CLzmaEncProps + } CLzmaEncProps; + + void LzmaEncProps_Init(CLzmaEncProps *p); +-void LzmaEncProps_Normalize(CLzmaEncProps *p); +-UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2); +- + + /* ---------- CLzmaEncHandle Interface ---------- */ + +@@ -53,26 +50,9 @@ CLzmaEncHandle LzmaEnc_Create(ISzAlloc * + void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig); + SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props); + SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size); +-SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream, +- ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); + SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, + int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); + +-/* ---------- One Call Interface ---------- */ +- +-/* LzmaEncode +-Return code: +- SZ_OK - OK +- SZ_ERROR_MEM - Memory allocation error +- SZ_ERROR_PARAM - Incorrect paramater +- SZ_ERROR_OUTPUT_EOF - output buffer overflow +- SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) +-*/ +- +-SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, +- const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, +- ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); +- + #ifdef __cplusplus + } + #endif +--- a/lib/lzma/LzFind.c ++++ b/lib/lzma/LzFind.c +@@ -14,9 +14,15 @@ + + #define kStartMaxLen 3 + ++#if 0 ++#define DIRECT_INPUT p->directInput ++#else ++#define DIRECT_INPUT 1 ++#endif ++ + static void LzInWindow_Free(CMatchFinder *p, ISzAlloc *alloc) + { +- if (!p->directInput) ++ if (!DIRECT_INPUT) + { + alloc->Free(alloc, p->bufferBase); + p->bufferBase = 0; +@@ -28,7 +34,7 @@ static void LzInWindow_Free(CMatchFinder + static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAlloc *alloc) + { + UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv; +- if (p->directInput) ++ if (DIRECT_INPUT) + { + p->blockSize = blockSize; + return 1; +@@ -42,12 +48,12 @@ static int LzInWindow_Create(CMatchFinde + return (p->bufferBase != 0); + } + +-Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; } +-Byte MatchFinder_GetIndexByte(CMatchFinder *p, Int32 index) { return p->buffer[index]; } ++static Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; } ++static Byte MatchFinder_GetIndexByte(CMatchFinder *p, Int32 index) { return p->buffer[index]; } + +-UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; } ++static UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; } + +-void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue) ++static void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue) + { + p->posLimit -= subValue; + p->pos -= subValue; +@@ -58,7 +64,7 @@ static void MatchFinder_ReadBlock(CMatch + { + if (p->streamEndWasReached || p->result != SZ_OK) + return; +- if (p->directInput) ++ if (DIRECT_INPUT) + { + UInt32 curSize = 0xFFFFFFFF - p->streamPos; + if (curSize > p->directInputRem) +@@ -89,7 +95,7 @@ static void MatchFinder_ReadBlock(CMatch + } + } + +-void MatchFinder_MoveBlock(CMatchFinder *p) ++static void MatchFinder_MoveBlock(CMatchFinder *p) + { + memmove(p->bufferBase, + p->buffer - p->keepSizeBefore, +@@ -97,22 +103,14 @@ void MatchFinder_MoveBlock(CMatchFinder + p->buffer = p->bufferBase + p->keepSizeBefore; + } + +-int MatchFinder_NeedMove(CMatchFinder *p) ++static int MatchFinder_NeedMove(CMatchFinder *p) + { +- if (p->directInput) ++ if (DIRECT_INPUT) + return 0; + /* if (p->streamEndWasReached) return 0; */ + return ((size_t)(p->bufferBase + p->blockSize - p->buffer) <= p->keepSizeAfter); + } + +-void MatchFinder_ReadIfRequired(CMatchFinder *p) +-{ +- if (p->streamEndWasReached) +- return; +- if (p->keepSizeAfter >= p->streamPos - p->pos) +- MatchFinder_ReadBlock(p); +-} +- + static void MatchFinder_CheckAndMoveAndRead(CMatchFinder *p) + { + if (MatchFinder_NeedMove(p)) +@@ -268,7 +266,7 @@ static void MatchFinder_SetLimits(CMatch + p->posLimit = p->pos + limit; + } + +-void MatchFinder_Init(CMatchFinder *p) ++static void MatchFinder_Init(CMatchFinder *p) + { + UInt32 i; + for (i = 0; i < p->hashSizeSum; i++) +@@ -287,7 +285,7 @@ static UInt32 MatchFinder_GetSubValue(CM + return (p->pos - p->historySize - 1) & kNormalizeMask; + } + +-void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems) ++static void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems) + { + UInt32 i; + for (i = 0; i < numItems; i++) +@@ -319,38 +317,7 @@ static void MatchFinder_CheckLimits(CMat + MatchFinder_SetLimits(p); + } + +-static UInt32 * Hc_GetMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, +- UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, +- UInt32 *distances, UInt32 maxLen) +-{ +- son[_cyclicBufferPos] = curMatch; +- for (;;) +- { +- UInt32 delta = pos - curMatch; +- if (cutValue-- == 0 || delta >= _cyclicBufferSize) +- return distances; +- { +- const Byte *pb = cur - delta; +- curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)]; +- if (pb[maxLen] == cur[maxLen] && *pb == *cur) +- { +- UInt32 len = 0; +- while (++len != lenLimit) +- if (pb[len] != cur[len]) +- break; +- if (maxLen < len) +- { +- *distances++ = maxLen = len; +- *distances++ = delta - 1; +- if (len == lenLimit) +- return distances; +- } +- } +- } +- } +-} +- +-UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, ++static UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, + UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, + UInt32 *distances, UInt32 maxLen) + { +@@ -460,10 +427,10 @@ static void SkipMatchesSpec(UInt32 lenLi + p->buffer++; \ + if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p); + +-#define MOVE_POS_RET MOVE_POS return offset; +- + static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; } + ++#define MOVE_POS_RET MatchFinder_MovePos(p); return offset; ++ + #define GET_MATCHES_HEADER2(minLen, ret_op) \ + UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; \ + lenLimit = p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \ +@@ -479,62 +446,7 @@ static void MatchFinder_MovePos(CMatchFi + distances + offset, maxLen) - distances); MOVE_POS_RET; + + #define SKIP_FOOTER \ +- SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS; +- +-static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +-{ +- UInt32 offset; +- GET_MATCHES_HEADER(2) +- HASH2_CALC; +- curMatch = p->hash[hashValue]; +- p->hash[hashValue] = p->pos; +- offset = 0; +- GET_MATCHES_FOOTER(offset, 1) +-} +- +-UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +-{ +- UInt32 offset; +- GET_MATCHES_HEADER(3) +- HASH_ZIP_CALC; +- curMatch = p->hash[hashValue]; +- p->hash[hashValue] = p->pos; +- offset = 0; +- GET_MATCHES_FOOTER(offset, 2) +-} +- +-static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +-{ +- UInt32 hash2Value, delta2, maxLen, offset; +- GET_MATCHES_HEADER(3) +- +- HASH3_CALC; +- +- delta2 = p->pos - p->hash[hash2Value]; +- curMatch = p->hash[kFix3HashSize + hashValue]; +- +- p->hash[hash2Value] = +- p->hash[kFix3HashSize + hashValue] = p->pos; +- +- +- maxLen = 2; +- offset = 0; +- if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) +- { +- for (; maxLen != lenLimit; maxLen++) +- if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) +- break; +- distances[0] = maxLen; +- distances[1] = delta2 - 1; +- offset = 2; +- if (maxLen == lenLimit) +- { +- SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); +- MOVE_POS_RET; +- } +- } +- GET_MATCHES_FOOTER(offset, maxLen) +-} ++ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MatchFinder_MovePos(p); + + static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) + { +@@ -583,108 +495,6 @@ static UInt32 Bt4_MatchFinder_GetMatches + GET_MATCHES_FOOTER(offset, maxLen) + } + +-static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +-{ +- UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset; +- GET_MATCHES_HEADER(4) +- +- HASH4_CALC; +- +- delta2 = p->pos - p->hash[ hash2Value]; +- delta3 = p->pos - p->hash[kFix3HashSize + hash3Value]; +- curMatch = p->hash[kFix4HashSize + hashValue]; +- +- p->hash[ hash2Value] = +- p->hash[kFix3HashSize + hash3Value] = +- p->hash[kFix4HashSize + hashValue] = p->pos; +- +- maxLen = 1; +- offset = 0; +- if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) +- { +- distances[0] = maxLen = 2; +- distances[1] = delta2 - 1; +- offset = 2; +- } +- if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur) +- { +- maxLen = 3; +- distances[offset + 1] = delta3 - 1; +- offset += 2; +- delta2 = delta3; +- } +- if (offset != 0) +- { +- for (; maxLen != lenLimit; maxLen++) +- if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) +- break; +- distances[offset - 2] = maxLen; +- if (maxLen == lenLimit) +- { +- p->son[p->cyclicBufferPos] = curMatch; +- MOVE_POS_RET; +- } +- } +- if (maxLen < 3) +- maxLen = 3; +- offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), +- distances + offset, maxLen) - (distances)); +- MOVE_POS_RET +-} +- +-UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +-{ +- UInt32 offset; +- GET_MATCHES_HEADER(3) +- HASH_ZIP_CALC; +- curMatch = p->hash[hashValue]; +- p->hash[hashValue] = p->pos; +- offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), +- distances, 2) - (distances)); +- MOVE_POS_RET +-} +- +-static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +-{ +- do +- { +- SKIP_HEADER(2) +- HASH2_CALC; +- curMatch = p->hash[hashValue]; +- p->hash[hashValue] = p->pos; +- SKIP_FOOTER +- } +- while (--num != 0); +-} +- +-void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +-{ +- do +- { +- SKIP_HEADER(3) +- HASH_ZIP_CALC; +- curMatch = p->hash[hashValue]; +- p->hash[hashValue] = p->pos; +- SKIP_FOOTER +- } +- while (--num != 0); +-} +- +-static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +-{ +- do +- { +- UInt32 hash2Value; +- SKIP_HEADER(3) +- HASH3_CALC; +- curMatch = p->hash[kFix3HashSize + hashValue]; +- p->hash[hash2Value] = +- p->hash[kFix3HashSize + hashValue] = p->pos; +- SKIP_FOOTER +- } +- while (--num != 0); +-} +- + static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) + { + do +@@ -701,61 +511,12 @@ static void Bt4_MatchFinder_Skip(CMatchF + while (--num != 0); + } + +-static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +-{ +- do +- { +- UInt32 hash2Value, hash3Value; +- SKIP_HEADER(4) +- HASH4_CALC; +- curMatch = p->hash[kFix4HashSize + hashValue]; +- p->hash[ hash2Value] = +- p->hash[kFix3HashSize + hash3Value] = +- p->hash[kFix4HashSize + hashValue] = p->pos; +- p->son[p->cyclicBufferPos] = curMatch; +- MOVE_POS +- } +- while (--num != 0); +-} +- +-void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +-{ +- do +- { +- SKIP_HEADER(3) +- HASH_ZIP_CALC; +- curMatch = p->hash[hashValue]; +- p->hash[hashValue] = p->pos; +- p->son[p->cyclicBufferPos] = curMatch; +- MOVE_POS +- } +- while (--num != 0); +-} +- + void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable) + { + vTable->Init = (Mf_Init_Func)MatchFinder_Init; + vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinder_GetIndexByte; + vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes; + vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos; +- if (!p->btMode) +- { +- vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches; +- vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip; +- } +- else if (p->numHashBytes == 2) +- { +- vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches; +- vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip; +- } +- else if (p->numHashBytes == 3) +- { +- vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches; +- vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip; +- } +- else +- { +- vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches; +- vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip; +- } ++ vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches; ++ vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip; + } +--- a/lib/lzma/LzmaDec.c ++++ b/lib/lzma/LzmaDec.c +@@ -682,7 +682,7 @@ static void LzmaDec_InitRc(CLzmaDec *p, + p->needFlush = 0; + } + +-void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState) ++static void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState) + { + p->needFlush = 1; + p->remainLen = 0; +@@ -698,7 +698,7 @@ void LzmaDec_InitDicAndState(CLzmaDec *p + p->needInitState = 1; + } + +-void LzmaDec_Init(CLzmaDec *p) ++static void LzmaDec_Init(CLzmaDec *p) + { + p->dicPos = 0; + LzmaDec_InitDicAndState(p, True, True); +@@ -716,7 +716,7 @@ static void LzmaDec_InitStateReal(CLzmaD + p->needInitState = 0; + } + +-SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen, ++static SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen, + ELzmaFinishMode finishMode, ELzmaStatus *status) + { + SizeT inSize = *srcLen; +@@ -837,65 +837,13 @@ SRes LzmaDec_DecodeToDic(CLzmaDec *p, Si + return (p->code == 0) ? SZ_OK : SZ_ERROR_DATA; + } + +-SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status) +-{ +- SizeT outSize = *destLen; +- SizeT inSize = *srcLen; +- *srcLen = *destLen = 0; +- for (;;) +- { +- SizeT inSizeCur = inSize, outSizeCur, dicPos; +- ELzmaFinishMode curFinishMode; +- SRes res; +- if (p->dicPos == p->dicBufSize) +- p->dicPos = 0; +- dicPos = p->dicPos; +- if (outSize > p->dicBufSize - dicPos) +- { +- outSizeCur = p->dicBufSize; +- curFinishMode = LZMA_FINISH_ANY; +- } +- else +- { +- outSizeCur = dicPos + outSize; +- curFinishMode = finishMode; +- } +- +- res = LzmaDec_DecodeToDic(p, outSizeCur, src, &inSizeCur, curFinishMode, status); +- src += inSizeCur; +- inSize -= inSizeCur; +- *srcLen += inSizeCur; +- outSizeCur = p->dicPos - dicPos; +- memcpy(dest, p->dic + dicPos, outSizeCur); +- dest += outSizeCur; +- outSize -= outSizeCur; +- *destLen += outSizeCur; +- if (res != 0) +- return res; +- if (outSizeCur == 0 || outSize == 0) +- return SZ_OK; +- } +-} +- +-void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc) ++static void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc) + { + alloc->Free(alloc, p->probs); + p->probs = 0; + } + +-static void LzmaDec_FreeDict(CLzmaDec *p, ISzAlloc *alloc) +-{ +- alloc->Free(alloc, p->dic); +- p->dic = 0; +-} +- +-void LzmaDec_Free(CLzmaDec *p, ISzAlloc *alloc) +-{ +- LzmaDec_FreeProbs(p, alloc); +- LzmaDec_FreeDict(p, alloc); +-} +- +-SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size) ++static SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size) + { + UInt32 dicSize; + Byte d; +@@ -935,7 +883,7 @@ static SRes LzmaDec_AllocateProbs2(CLzma + return SZ_OK; + } + +-SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) ++static SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) + { + CLzmaProps propNew; + RINOK(LzmaProps_Decode(&propNew, props, propsSize)); +@@ -943,28 +891,6 @@ SRes LzmaDec_AllocateProbs(CLzmaDec *p, + p->prop = propNew; + return SZ_OK; + } +- +-SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) +-{ +- CLzmaProps propNew; +- SizeT dicBufSize; +- RINOK(LzmaProps_Decode(&propNew, props, propsSize)); +- RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); +- dicBufSize = propNew.dicSize; +- if (p->dic == 0 || dicBufSize != p->dicBufSize) +- { +- LzmaDec_FreeDict(p, alloc); +- p->dic = (Byte *)alloc->Alloc(alloc, dicBufSize); +- if (p->dic == 0) +- { +- LzmaDec_FreeProbs(p, alloc); +- return SZ_ERROR_MEM; +- } +- } +- p->dicBufSize = dicBufSize; +- p->prop = propNew; +- return SZ_OK; +-} + + SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, + const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, +--- a/lib/lzma/LzmaEnc.c ++++ b/lib/lzma/LzmaEnc.c +@@ -53,7 +53,7 @@ void LzmaEncProps_Init(CLzmaEncProps *p) + p->writeEndMark = 0; + } + +-void LzmaEncProps_Normalize(CLzmaEncProps *p) ++static void LzmaEncProps_Normalize(CLzmaEncProps *p) + { + int level = p->level; + if (level < 0) level = 5; +@@ -76,7 +76,7 @@ void LzmaEncProps_Normalize(CLzmaEncProp + #endif + } + +-UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2) ++static UInt32 __maybe_unused LzmaEncProps_GetDictSize(const CLzmaEncProps *props2) + { + CLzmaEncProps props = *props2; + LzmaEncProps_Normalize(&props); +@@ -93,7 +93,7 @@ UInt32 LzmaEncProps_GetDictSize(const CL + + #define BSR2_RET(pos, res) { unsigned long i; _BitScanReverse(&i, (pos)); res = (i + i) + ((pos >> (i - 1)) & 1); } + +-UInt32 GetPosSlot1(UInt32 pos) ++static UInt32 GetPosSlot1(UInt32 pos) + { + UInt32 res; + BSR2_RET(pos, res); +@@ -107,7 +107,7 @@ UInt32 GetPosSlot1(UInt32 pos) + #define kNumLogBits (9 + (int)sizeof(size_t) / 2) + #define kDicLogSizeMaxCompress ((kNumLogBits - 1) * 2 + 7) + +-void LzmaEnc_FastPosInit(Byte *g_FastPos) ++static void LzmaEnc_FastPosInit(Byte *g_FastPos) + { + int c = 2, slotFast; + g_FastPos[0] = 0; +@@ -339,58 +339,6 @@ typedef struct + CSaveState saveState; + } CLzmaEnc; + +-void LzmaEnc_SaveState(CLzmaEncHandle pp) +-{ +- CLzmaEnc *p = (CLzmaEnc *)pp; +- CSaveState *dest = &p->saveState; +- int i; +- dest->lenEnc = p->lenEnc; +- dest->repLenEnc = p->repLenEnc; +- dest->state = p->state; +- +- for (i = 0; i < kNumStates; i++) +- { +- memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); +- memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); +- } +- for (i = 0; i < kNumLenToPosStates; i++) +- memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); +- memcpy(dest->isRep, p->isRep, sizeof(p->isRep)); +- memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); +- memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); +- memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); +- memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); +- memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); +- memcpy(dest->reps, p->reps, sizeof(p->reps)); +- memcpy(dest->litProbs, p->litProbs, (0x300 << p->lclp) * sizeof(CLzmaProb)); +-} +- +-void LzmaEnc_RestoreState(CLzmaEncHandle pp) +-{ +- CLzmaEnc *dest = (CLzmaEnc *)pp; +- const CSaveState *p = &dest->saveState; +- int i; +- dest->lenEnc = p->lenEnc; +- dest->repLenEnc = p->repLenEnc; +- dest->state = p->state; +- +- for (i = 0; i < kNumStates; i++) +- { +- memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); +- memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); +- } +- for (i = 0; i < kNumLenToPosStates; i++) +- memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); +- memcpy(dest->isRep, p->isRep, sizeof(p->isRep)); +- memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); +- memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); +- memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); +- memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); +- memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); +- memcpy(dest->reps, p->reps, sizeof(p->reps)); +- memcpy(dest->litProbs, p->litProbs, (0x300 << dest->lclp) * sizeof(CLzmaProb)); +-} +- + SRes LzmaEnc_SetProps(CLzmaEncHandle pp, const CLzmaEncProps *props2) + { + CLzmaEnc *p = (CLzmaEnc *)pp; +@@ -600,7 +548,7 @@ static void LitEnc_EncodeMatched(CRangeE + while (symbol < 0x10000); + } + +-void LzmaEnc_InitPriceTables(UInt32 *ProbPrices) ++static void LzmaEnc_InitPriceTables(UInt32 *ProbPrices) + { + UInt32 i; + for (i = (1 << kNumMoveReducingBits) / 2; i < kBitModelTotal; i += (1 << kNumMoveReducingBits)) +@@ -1676,7 +1624,7 @@ static void FillDistancesPrices(CLzmaEnc + p->matchPriceCount = 0; + } + +-void LzmaEnc_Construct(CLzmaEnc *p) ++static void LzmaEnc_Construct(CLzmaEnc *p) + { + RangeEnc_Construct(&p->rc); + MatchFinder_Construct(&p->matchFinderBase); +@@ -1709,7 +1657,7 @@ CLzmaEncHandle LzmaEnc_Create(ISzAlloc * + return p; + } + +-void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAlloc *alloc) ++static void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAlloc *alloc) + { + alloc->Free(alloc, p->litProbs); + alloc->Free(alloc, p->saveState.litProbs); +@@ -1717,7 +1665,7 @@ void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAl + p->saveState.litProbs = 0; + } + +-void LzmaEnc_Destruct(CLzmaEnc *p, ISzAlloc *alloc, ISzAlloc *allocBig) ++static void LzmaEnc_Destruct(CLzmaEnc *p, ISzAlloc *alloc, ISzAlloc *allocBig) + { + #ifndef _7ZIP_ST + MatchFinderMt_Destruct(&p->matchFinderMt, allocBig); +@@ -1947,7 +1895,7 @@ static SRes LzmaEnc_Alloc(CLzmaEnc *p, U + return SZ_OK; + } + +-void LzmaEnc_Init(CLzmaEnc *p) ++static void LzmaEnc_Init(CLzmaEnc *p) + { + UInt32 i; + p->state = 0; +@@ -2005,7 +1953,7 @@ void LzmaEnc_Init(CLzmaEnc *p) + p->lpMask = (1 << p->lp) - 1; + } + +-void LzmaEnc_InitPrices(CLzmaEnc *p) ++static void LzmaEnc_InitPrices(CLzmaEnc *p) + { + if (!p->fastMode) + { +@@ -2037,26 +1985,6 @@ static SRes LzmaEnc_AllocAndInit(CLzmaEn + return SZ_OK; + } + +-static SRes LzmaEnc_Prepare(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, +- ISzAlloc *alloc, ISzAlloc *allocBig) +-{ +- CLzmaEnc *p = (CLzmaEnc *)pp; +- p->matchFinderBase.stream = inStream; +- p->needInit = 1; +- p->rc.outStream = outStream; +- return LzmaEnc_AllocAndInit(p, 0, alloc, allocBig); +-} +- +-SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp, +- ISeqInStream *inStream, UInt32 keepWindowSize, +- ISzAlloc *alloc, ISzAlloc *allocBig) +-{ +- CLzmaEnc *p = (CLzmaEnc *)pp; +- p->matchFinderBase.stream = inStream; +- p->needInit = 1; +- return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); +-} +- + static void LzmaEnc_SetInputBuf(CLzmaEnc *p, const Byte *src, SizeT srcLen) + { + p->matchFinderBase.directInput = 1; +@@ -2064,7 +1992,7 @@ static void LzmaEnc_SetInputBuf(CLzmaEnc + p->matchFinderBase.directInputRem = srcLen; + } + +-SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen, ++static SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen, + UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) + { + CLzmaEnc *p = (CLzmaEnc *)pp; +@@ -2074,7 +2002,7 @@ SRes LzmaEnc_MemPrepare(CLzmaEncHandle p + return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); + } + +-void LzmaEnc_Finish(CLzmaEncHandle pp) ++static void LzmaEnc_Finish(CLzmaEncHandle pp) + { + #ifndef _7ZIP_ST + CLzmaEnc *p = (CLzmaEnc *)pp; +@@ -2107,53 +2035,6 @@ static size_t MyWrite(void *pp, const vo + return size; + } + +- +-UInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle pp) +-{ +- const CLzmaEnc *p = (CLzmaEnc *)pp; +- return p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); +-} +- +-const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp) +-{ +- const CLzmaEnc *p = (CLzmaEnc *)pp; +- return p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; +-} +- +-SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit, +- Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize) +-{ +- CLzmaEnc *p = (CLzmaEnc *)pp; +- UInt64 nowPos64; +- SRes res; +- CSeqOutStreamBuf outStream; +- +- outStream.funcTable.Write = MyWrite; +- outStream.data = dest; +- outStream.rem = *destLen; +- outStream.overflow = False; +- +- p->writeEndMark = False; +- p->finished = False; +- p->result = SZ_OK; +- +- if (reInit) +- LzmaEnc_Init(p); +- LzmaEnc_InitPrices(p); +- nowPos64 = p->nowPos64; +- RangeEnc_Init(&p->rc); +- p->rc.outStream = &outStream.funcTable; +- +- res = LzmaEnc_CodeOneBlock(p, True, desiredPackSize, *unpackSize); +- +- *unpackSize = (UInt32)(p->nowPos64 - nowPos64); +- *destLen -= outStream.rem; +- if (outStream.overflow) +- return SZ_ERROR_OUTPUT_EOF; +- +- return res; +-} +- + static SRes LzmaEnc_Encode2(CLzmaEnc *p, ICompressProgress *progress) + { + SRes res = SZ_OK; +@@ -2184,13 +2065,6 @@ static SRes LzmaEnc_Encode2(CLzmaEnc *p, + return res; + } + +-SRes LzmaEnc_Encode(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress, +- ISzAlloc *alloc, ISzAlloc *allocBig) +-{ +- RINOK(LzmaEnc_Prepare(pp, outStream, inStream, alloc, allocBig)); +- return LzmaEnc_Encode2((CLzmaEnc *)pp, progress); +-} +- + SRes LzmaEnc_WriteProperties(CLzmaEncHandle pp, Byte *props, SizeT *size) + { + CLzmaEnc *p = (CLzmaEnc *)pp; +@@ -2247,25 +2121,3 @@ SRes LzmaEnc_MemEncode(CLzmaEncHandle pp + return SZ_ERROR_OUTPUT_EOF; + return res; + } +- +-SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, +- const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, +- ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig) +-{ +- CLzmaEnc *p = (CLzmaEnc *)LzmaEnc_Create(alloc); +- SRes res; +- if (p == 0) +- return SZ_ERROR_MEM; +- +- res = LzmaEnc_SetProps(p, props); +- if (res == SZ_OK) +- { +- res = LzmaEnc_WriteProperties(p, propsEncoded, propsSize); +- if (res == SZ_OK) +- res = LzmaEnc_MemEncode(p, dest, destLen, src, srcLen, +- writeEndMark, progress, alloc, allocBig); +- } +- +- LzmaEnc_Destroy(p, alloc, allocBig); +- return res; +-} diff --git a/target/linux/generic/hack-4.14/640-bridge-only-accept-EAP-locally.patch b/target/linux/generic/hack-4.14/640-bridge-only-accept-EAP-locally.patch new file mode 100644 index 0000000000..83c9cf739f --- /dev/null +++ b/target/linux/generic/hack-4.14/640-bridge-only-accept-EAP-locally.patch @@ -0,0 +1,32 @@ +From c6905cfdeb31a5c049db3da434b10fa0d3e83569 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:18:54 +0200 +Subject: bridge: only accept EAP locally + +When bridging, do not forward EAP frames to other ports, only deliver +them locally, regardless of the state. + +Signed-off-by: Felix Fietkau +--- + net/bridge/br_input.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/net/bridge/br_input.c ++++ b/net/bridge/br_input.c +@@ -166,11 +166,14 @@ int br_handle_frame_finish(struct net *n + } + } + ++ BR_INPUT_SKB_CB(skb)->brdev = br->dev; ++ ++ if (skb->protocol == htons(ETH_P_PAE)) ++ return br_pass_frame_up(skb); ++ + if (p->state == BR_STATE_LEARNING) + goto drop; + +- BR_INPUT_SKB_CB(skb)->brdev = br->dev; +- + if (IS_ENABLED(CONFIG_INET) && skb->protocol == htons(ETH_P_ARP)) + br_do_proxy_arp(skb, br, vid, p); + diff --git a/target/linux/generic/hack-4.14/641-bridge_port_isolate.patch b/target/linux/generic/hack-4.14/641-bridge_port_isolate.patch new file mode 100644 index 0000000000..ab9f476577 --- /dev/null +++ b/target/linux/generic/hack-4.14/641-bridge_port_isolate.patch @@ -0,0 +1,76 @@ +From e988390850731aa1697ed09d47b0932fac1af175 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:20:03 +0200 +Subject: bridge: port isolate + +Isolating individual bridge ports + +Signed-off-by: Felix Fietkau +--- + include/linux/if_bridge.h | 1 + + net/bridge/br_forward.c | 5 +++++ + net/bridge/br_input.c | 3 +++ + net/bridge/br_sysfs_if.c | 2 ++ + 4 files changed, 11 insertions(+) + +--- a/include/linux/if_bridge.h ++++ b/include/linux/if_bridge.h +@@ -49,6 +49,7 @@ struct br_ip_list { + #define BR_MULTICAST_TO_UNICAST BIT(12) + #define BR_VLAN_TUNNEL BIT(13) + #define BR_BCAST_FLOOD BIT(14) ++#define BR_ISOLATE_MODE BIT(15) + + #define BR_DEFAULT_AGEING_TIME (300 * HZ) + +--- a/net/bridge/br_forward.c ++++ b/net/bridge/br_forward.c +@@ -141,6 +141,9 @@ static int deliver_clone(const struct ne + void br_forward(const struct net_bridge_port *to, + struct sk_buff *skb, bool local_rcv, bool local_orig) + { ++ if (to->flags & BR_ISOLATE_MODE) ++ to = NULL; ++ + if (to && should_deliver(to, skb)) { + if (local_rcv) + deliver_clone(to, skb, local_orig); +@@ -183,6 +186,8 @@ void br_flood(struct net_bridge *br, str + struct net_bridge_port *p; + + list_for_each_entry_rcu(p, &br->port_list, list) { ++ if (!local_orig && (p->flags & BR_ISOLATE_MODE)) ++ continue; + /* Do not flood unicast traffic to ports that turn it off, nor + * other traffic if flood off, except for traffic we originate + */ +--- a/net/bridge/br_input.c ++++ b/net/bridge/br_input.c +@@ -177,6 +177,9 @@ int br_handle_frame_finish(struct net *n + if (IS_ENABLED(CONFIG_INET) && skb->protocol == htons(ETH_P_ARP)) + br_do_proxy_arp(skb, br, vid, p); + ++ if (p->flags & BR_ISOLATE_MODE) ++ return br_pass_frame_up(skb); ++ + switch (pkt_type) { + case BR_PKT_MULTICAST: + mdst = br_mdb_get(br, skb, vid); +--- a/net/bridge/br_sysfs_if.c ++++ b/net/bridge/br_sysfs_if.c +@@ -174,6 +174,7 @@ BRPORT_ATTR_FLAG(proxyarp, BR_PROXYARP); + BRPORT_ATTR_FLAG(proxyarp_wifi, BR_PROXYARP_WIFI); + BRPORT_ATTR_FLAG(multicast_flood, BR_MCAST_FLOOD); + BRPORT_ATTR_FLAG(broadcast_flood, BR_BCAST_FLOOD); ++BRPORT_ATTR_FLAG(isolate_mode, BR_ISOLATE_MODE); + + #ifdef CONFIG_BRIDGE_IGMP_SNOOPING + static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf) +@@ -223,6 +224,7 @@ static const struct brport_attribute *br + &brport_attr_proxyarp_wifi, + &brport_attr_multicast_flood, + &brport_attr_broadcast_flood, ++ &brport_attr_isolate_mode, + NULL + }; + diff --git a/target/linux/generic/hack-4.14/651-wireless_mesh_header.patch b/target/linux/generic/hack-4.14/651-wireless_mesh_header.patch new file mode 100644 index 0000000000..f545d8ebbc --- /dev/null +++ b/target/linux/generic/hack-4.14/651-wireless_mesh_header.patch @@ -0,0 +1,24 @@ +From 6d3bc769657b0ee7c7506dad9911111c4226a7ea Mon Sep 17 00:00:00 2001 +From: Imre Kaloz +Date: Fri, 7 Jul 2017 17:21:05 +0200 +Subject: mac80211: increase wireless mesh header size + +lede-commit 3d4466cfd8f75f717efdb1f96fdde3c70d865fc1 +Signed-off-by: Imre Kaloz +--- + include/linux/netdevice.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/include/linux/netdevice.h ++++ b/include/linux/netdevice.h +@@ -138,8 +138,8 @@ static inline bool dev_xmit_complete(int + + #if defined(CONFIG_HYPERV_NET) + # define LL_MAX_HEADER 128 +-#elif defined(CONFIG_WLAN) || IS_ENABLED(CONFIG_AX25) +-# if defined(CONFIG_MAC80211_MESH) ++#elif defined(CONFIG_WLAN) || IS_ENABLED(CONFIG_AX25) || 1 ++# if defined(CONFIG_MAC80211_MESH) || 1 + # define LL_MAX_HEADER 128 + # else + # define LL_MAX_HEADER 96 diff --git a/target/linux/generic/hack-4.14/660-fq_codel_defaults.patch b/target/linux/generic/hack-4.14/660-fq_codel_defaults.patch new file mode 100644 index 0000000000..3e27351fa6 --- /dev/null +++ b/target/linux/generic/hack-4.14/660-fq_codel_defaults.patch @@ -0,0 +1,27 @@ +From a6ccb238939b25851474a279b20367fd24a0e816 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:21:53 +0200 +Subject: hack: net: fq_codel: tune defaults for small devices + +Assume that x86_64 devices always have a big memory and do not need this +optimization compared to devices with only 32 MB or 64 MB RAM. + +Signed-off-by: Felix Fietkau +--- + net/sched/sch_fq_codel.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/sched/sch_fq_codel.c ++++ b/net/sched/sch_fq_codel.c +@@ -465,7 +465,11 @@ static int fq_codel_init(struct Qdisc *s + + sch->limit = 10*1024; + q->flows_cnt = 1024; ++#ifdef CONFIG_X86_64 + q->memory_limit = 32 << 20; /* 32 MBytes */ ++#else ++ q->memory_limit = 4 << 20; /* 4 MBytes */ ++#endif + q->drop_batch_size = 64; + q->quantum = psched_mtu(qdisc_dev(sch)); + INIT_LIST_HEAD(&q->new_flows); diff --git a/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch new file mode 100644 index 0000000000..ae911db870 --- /dev/null +++ b/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch @@ -0,0 +1,94 @@ +From 1d418f7e88035ed7a94073f6354246c66e9193e9 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:22:58 +0200 +Subject: fq_codel: switch default qdisc from pfifo_fast to fq_codel and remove pfifo_fast + +Signed-off-by: Felix Fietkau +--- + include/net/sch_generic.h | 3 ++- + net/sched/Kconfig | 3 ++- + net/sched/sch_api.c | 2 +- + net/sched/sch_fq_codel.c | 3 ++- + net/sched/sch_generic.c | 4 ++-- + 5 files changed, 9 insertions(+), 6 deletions(-) + +--- a/include/net/sch_generic.h ++++ b/include/net/sch_generic.h +@@ -369,12 +369,13 @@ extern struct Qdisc_ops noop_qdisc_ops; + extern struct Qdisc_ops pfifo_fast_ops; + extern struct Qdisc_ops mq_qdisc_ops; + extern struct Qdisc_ops noqueue_qdisc_ops; ++extern struct Qdisc_ops fq_codel_qdisc_ops; + extern const struct Qdisc_ops *default_qdisc_ops; + static inline const struct Qdisc_ops * + get_default_qdisc_ops(const struct net_device *dev, int ntx) + { + return ntx < dev->real_num_tx_queues ? +- default_qdisc_ops : &pfifo_fast_ops; ++ default_qdisc_ops : &fq_codel_qdisc_ops; + } + + struct Qdisc_class_common { +--- a/net/sched/Kconfig ++++ b/net/sched/Kconfig +@@ -3,8 +3,9 @@ + # + + menuconfig NET_SCHED +- bool "QoS and/or fair queueing" ++ def_bool y + select NET_SCH_FIFO ++ select NET_SCH_FQ_CODEL + ---help--- + When the kernel has several packets to send out over a network + device, it has to decide which ones to send first, which ones to +--- a/net/sched/sch_api.c ++++ b/net/sched/sch_api.c +@@ -2014,7 +2014,7 @@ static int __init pktsched_init(void) + return err; + } + +- register_qdisc(&pfifo_fast_ops); ++ register_qdisc(&fq_codel_qdisc_ops); + register_qdisc(&pfifo_qdisc_ops); + register_qdisc(&bfifo_qdisc_ops); + register_qdisc(&pfifo_head_drop_qdisc_ops); +--- a/net/sched/sch_fq_codel.c ++++ b/net/sched/sch_fq_codel.c +@@ -694,7 +694,7 @@ static const struct Qdisc_class_ops fq_c + .walk = fq_codel_walk, + }; + +-static struct Qdisc_ops fq_codel_qdisc_ops __read_mostly = { ++struct Qdisc_ops fq_codel_qdisc_ops __read_mostly = { + .cl_ops = &fq_codel_class_ops, + .id = "fq_codel", + .priv_size = sizeof(struct fq_codel_sched_data), +@@ -709,6 +709,7 @@ static struct Qdisc_ops fq_codel_qdisc_o + .dump_stats = fq_codel_dump_stats, + .owner = THIS_MODULE, + }; ++EXPORT_SYMBOL(fq_codel_qdisc_ops); + + static int __init fq_codel_module_init(void) + { +--- a/net/sched/sch_generic.c ++++ b/net/sched/sch_generic.c +@@ -32,7 +32,7 @@ + #include + + /* Qdisc to use by default */ +-const struct Qdisc_ops *default_qdisc_ops = &pfifo_fast_ops; ++const struct Qdisc_ops *default_qdisc_ops = &fq_codel_qdisc_ops; + EXPORT_SYMBOL(default_qdisc_ops); + + /* Main transmission queue. */ +@@ -764,7 +764,7 @@ static void attach_one_default_qdisc(str + void *_unused) + { + struct Qdisc *qdisc; +- const struct Qdisc_ops *ops = default_qdisc_ops; ++ const struct Qdisc_ops *ops = &fq_codel_qdisc_ops; + + if (dev->priv_flags & IFF_NO_QUEUE) + ops = &noqueue_qdisc_ops; diff --git a/target/linux/generic/hack-4.14/662-remove_pfifo_fast.patch b/target/linux/generic/hack-4.14/662-remove_pfifo_fast.patch new file mode 100644 index 0000000000..7b6e38da29 --- /dev/null +++ b/target/linux/generic/hack-4.14/662-remove_pfifo_fast.patch @@ -0,0 +1,159 @@ +From b531d492d5ef1cf9dba0f4888eb5fd8624a6d762 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:23:42 +0200 +Subject: net: sched: switch default qdisc from pfifo_fast to fq_codel and remove pfifo_fast + +Signed-off-by: Felix Fietkau +--- + net/sched/sch_generic.c | 140 ------------------------------------------------ + 1 file changed, 140 deletions(-) + +--- a/net/sched/sch_generic.c ++++ b/net/sched/sch_generic.c +@@ -453,146 +453,6 @@ struct Qdisc_ops noqueue_qdisc_ops __rea + .owner = THIS_MODULE, + }; + +-static const u8 prio2band[TC_PRIO_MAX + 1] = { +- 1, 2, 2, 2, 1, 2, 0, 0 , 1, 1, 1, 1, 1, 1, 1, 1 +-}; +- +-/* 3-band FIFO queue: old style, but should be a bit faster than +- generic prio+fifo combination. +- */ +- +-#define PFIFO_FAST_BANDS 3 +- +-/* +- * Private data for a pfifo_fast scheduler containing: +- * - queues for the three band +- * - bitmap indicating which of the bands contain skbs +- */ +-struct pfifo_fast_priv { +- u32 bitmap; +- struct qdisc_skb_head q[PFIFO_FAST_BANDS]; +-}; +- +-/* +- * Convert a bitmap to the first band number where an skb is queued, where: +- * bitmap=0 means there are no skbs on any band. +- * bitmap=1 means there is an skb on band 0. +- * bitmap=7 means there are skbs on all 3 bands, etc. +- */ +-static const int bitmap2band[] = {-1, 0, 1, 0, 2, 0, 1, 0}; +- +-static inline struct qdisc_skb_head *band2list(struct pfifo_fast_priv *priv, +- int band) +-{ +- return priv->q + band; +-} +- +-static int pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc *qdisc, +- struct sk_buff **to_free) +-{ +- if (qdisc->q.qlen < qdisc_dev(qdisc)->tx_queue_len) { +- int band = prio2band[skb->priority & TC_PRIO_MAX]; +- struct pfifo_fast_priv *priv = qdisc_priv(qdisc); +- struct qdisc_skb_head *list = band2list(priv, band); +- +- priv->bitmap |= (1 << band); +- qdisc->q.qlen++; +- return __qdisc_enqueue_tail(skb, qdisc, list); +- } +- +- return qdisc_drop(skb, qdisc, to_free); +-} +- +-static struct sk_buff *pfifo_fast_dequeue(struct Qdisc *qdisc) +-{ +- struct pfifo_fast_priv *priv = qdisc_priv(qdisc); +- int band = bitmap2band[priv->bitmap]; +- +- if (likely(band >= 0)) { +- struct qdisc_skb_head *qh = band2list(priv, band); +- struct sk_buff *skb = __qdisc_dequeue_head(qh); +- +- if (likely(skb != NULL)) { +- qdisc_qstats_backlog_dec(qdisc, skb); +- qdisc_bstats_update(qdisc, skb); +- } +- +- qdisc->q.qlen--; +- if (qh->qlen == 0) +- priv->bitmap &= ~(1 << band); +- +- return skb; +- } +- +- return NULL; +-} +- +-static struct sk_buff *pfifo_fast_peek(struct Qdisc *qdisc) +-{ +- struct pfifo_fast_priv *priv = qdisc_priv(qdisc); +- int band = bitmap2band[priv->bitmap]; +- +- if (band >= 0) { +- struct qdisc_skb_head *qh = band2list(priv, band); +- +- return qh->head; +- } +- +- return NULL; +-} +- +-static void pfifo_fast_reset(struct Qdisc *qdisc) +-{ +- int prio; +- struct pfifo_fast_priv *priv = qdisc_priv(qdisc); +- +- for (prio = 0; prio < PFIFO_FAST_BANDS; prio++) +- __qdisc_reset_queue(band2list(priv, prio)); +- +- priv->bitmap = 0; +- qdisc->qstats.backlog = 0; +- qdisc->q.qlen = 0; +-} +- +-static int pfifo_fast_dump(struct Qdisc *qdisc, struct sk_buff *skb) +-{ +- struct tc_prio_qopt opt = { .bands = PFIFO_FAST_BANDS }; +- +- memcpy(&opt.priomap, prio2band, TC_PRIO_MAX + 1); +- if (nla_put(skb, TCA_OPTIONS, sizeof(opt), &opt)) +- goto nla_put_failure; +- return skb->len; +- +-nla_put_failure: +- return -1; +-} +- +-static int pfifo_fast_init(struct Qdisc *qdisc, struct nlattr *opt) +-{ +- int prio; +- struct pfifo_fast_priv *priv = qdisc_priv(qdisc); +- +- for (prio = 0; prio < PFIFO_FAST_BANDS; prio++) +- qdisc_skb_head_init(band2list(priv, prio)); +- +- /* Can by-pass the queue discipline */ +- qdisc->flags |= TCQ_F_CAN_BYPASS; +- return 0; +-} +- +-struct Qdisc_ops pfifo_fast_ops __read_mostly = { +- .id = "pfifo_fast", +- .priv_size = sizeof(struct pfifo_fast_priv), +- .enqueue = pfifo_fast_enqueue, +- .dequeue = pfifo_fast_dequeue, +- .peek = pfifo_fast_peek, +- .init = pfifo_fast_init, +- .reset = pfifo_fast_reset, +- .dump = pfifo_fast_dump, +- .owner = THIS_MODULE, +-}; +-EXPORT_SYMBOL(pfifo_fast_ops); +- + static struct lock_class_key qdisc_tx_busylock; + static struct lock_class_key qdisc_running_key; + diff --git a/target/linux/generic/hack-4.14/700-swconfig_switch_drivers.patch b/target/linux/generic/hack-4.14/700-swconfig_switch_drivers.patch new file mode 100644 index 0000000000..0ec197fbb0 --- /dev/null +++ b/target/linux/generic/hack-4.14/700-swconfig_switch_drivers.patch @@ -0,0 +1,128 @@ +From 36e516290611e613aa92996cb4339561452695b4 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:24:23 +0200 +Subject: net: swconfig: adds openwrt switch layer + +Signed-off-by: Felix Fietkau +--- + drivers/net/phy/Kconfig | 83 +++++++++++++++++++++++++++++++++++++++++++++++ + drivers/net/phy/Makefile | 15 +++++++++ + include/uapi/linux/Kbuild | 1 + + 3 files changed, 99 insertions(+) + +--- a/drivers/net/phy/Kconfig ++++ b/drivers/net/phy/Kconfig +@@ -198,6 +198,89 @@ config LED_TRIGGER_PHY + Mbps or Gbps + + ++comment "Switch configuration API + drivers" ++ ++config SWCONFIG ++ tristate "Switch configuration API" ++ ---help--- ++ Switch configuration API using netlink. This allows ++ you to configure the VLAN features of certain switches. ++ ++config SWCONFIG_LEDS ++ bool "Switch LED trigger support" ++ depends on (SWCONFIG && LEDS_TRIGGERS) ++ ++config ADM6996_PHY ++ tristate "Driver for ADM6996 switches" ++ select SWCONFIG ++ ---help--- ++ Currently supports the ADM6996FC and ADM6996M switches. ++ Support for FC is very limited. ++ ++config AR8216_PHY ++ tristate "Driver for Atheros AR8216 switches" ++ select ETHERNET_PACKET_MANGLE ++ select SWCONFIG ++ ++config AR8216_PHY_LEDS ++ bool "Atheros AR8216 switch LED support" ++ depends on (AR8216_PHY && LEDS_CLASS) ++ ++source "drivers/net/phy/b53/Kconfig" ++ ++config IP17XX_PHY ++ tristate "Driver for IC+ IP17xx switches" ++ select SWCONFIG ++ ++config MVSWITCH_PHY ++ tristate "Driver for Marvell 88E6060 switches" ++ select ETHERNET_PACKET_MANGLE ++ ++config MVSW61XX_PHY ++ tristate "Driver for Marvell 88E6171/6172 switches" ++ select SWCONFIG ++ ++config PSB6970_PHY ++ tristate "Lantiq XWAY Tantos (PSB6970) Ethernet switch" ++ select SWCONFIG ++ select ETHERNET_PACKET_MANGLE ++ ++config RTL8306_PHY ++ tristate "Driver for Realtek RTL8306S switches" ++ select SWCONFIG ++ ++config RTL8366_SMI ++ tristate "Driver for the RTL8366 SMI interface" ++ depends on GPIOLIB ++ ---help--- ++ This module implements the SMI interface protocol which is used ++ by some RTL8366 ethernet switch devices via the generic GPIO API. ++ ++if RTL8366_SMI ++ ++config RTL8366_SMI_DEBUG_FS ++ bool "RTL8366 SMI interface debugfs support" ++ depends on DEBUG_FS ++ default n ++ ++config RTL8366S_PHY ++ tristate "Driver for the Realtek RTL8366S switch" ++ select SWCONFIG ++ ++config RTL8366RB_PHY ++ tristate "Driver for the Realtek RTL8366RB switch" ++ select SWCONFIG ++ ++config RTL8367_PHY ++ tristate "Driver for the Realtek RTL8367R/M switches" ++ select SWCONFIG ++ ++config RTL8367B_PHY ++ tristate "Driver fot the Realtek RTL8367R-VB switch" ++ select SWCONFIG ++ ++endif # RTL8366_SMI ++ + comment "MII PHY device drivers" + + config SFP +--- a/drivers/net/phy/Makefile ++++ b/drivers/net/phy/Makefile +@@ -22,6 +22,21 @@ libphy-$(CONFIG_LED_TRIGGER_PHY) += phy_ + obj-$(CONFIG_PHYLINK) += phylink.o + obj-$(CONFIG_PHYLIB) += libphy.o + ++obj-$(CONFIG_SWCONFIG) += swconfig.o ++obj-$(CONFIG_ADM6996_PHY) += adm6996.o ++obj-$(CONFIG_AR8216_PHY) += ar8216.o ar8327.o ++obj-$(CONFIG_SWCONFIG_B53) += b53/ ++obj-$(CONFIG_IP17XX_PHY) += ip17xx.o ++obj-$(CONFIG_MVSWITCH_PHY) += mvswitch.o ++obj-$(CONFIG_MVSW61XX_PHY) += mvsw61xx.o ++obj-$(CONFIG_PSB6970_PHY) += psb6970.o ++obj-$(CONFIG_RTL8306_PHY) += rtl8306.o ++obj-$(CONFIG_RTL8366_SMI) += rtl8366_smi.o ++obj-$(CONFIG_RTL8366S_PHY) += rtl8366s.o ++obj-$(CONFIG_RTL8366RB_PHY) += rtl8366rb.o ++obj-$(CONFIG_RTL8367_PHY) += rtl8367.o ++obj-$(CONFIG_RTL8367B_PHY) += rtl8367b.o ++ + obj-$(CONFIG_MDIO_BCM_IPROC) += mdio-bcm-iproc.o + obj-$(CONFIG_MDIO_BCM_UNIMAC) += mdio-bcm-unimac.o + obj-$(CONFIG_MDIO_BITBANG) += mdio-bitbang.o diff --git a/target/linux/generic/hack-4.14/702-phy_add_aneg_done_function.patch b/target/linux/generic/hack-4.14/702-phy_add_aneg_done_function.patch new file mode 100644 index 0000000000..9c249ca4ce --- /dev/null +++ b/target/linux/generic/hack-4.14/702-phy_add_aneg_done_function.patch @@ -0,0 +1,27 @@ +--- a/include/linux/phy.h ++++ b/include/linux/phy.h +@@ -547,6 +547,12 @@ struct phy_driver { + /* Determines the negotiated speed and duplex */ + int (*read_status)(struct phy_device *phydev); + ++ /* ++ * Update the value in phydev->link to reflect the ++ * current link value ++ */ ++ int (*update_link)(struct phy_device *phydev); ++ + /* Clears any pending interrupts */ + int (*ack_interrupt)(struct phy_device *phydev); + +--- a/drivers/net/phy/phy_device.c ++++ b/drivers/net/phy/phy_device.c +@@ -1437,6 +1437,9 @@ int genphy_update_link(struct phy_device + { + int status; + ++ if (phydev->drv && phydev->drv->update_link) ++ return phydev->drv->update_link(phydev); ++ + /* Do a fake read */ + status = phy_read(phydev, MII_BMSR); + if (status < 0) diff --git a/target/linux/generic/hack-4.14/721-phy_packets.patch b/target/linux/generic/hack-4.14/721-phy_packets.patch new file mode 100644 index 0000000000..07e6e9da6d --- /dev/null +++ b/target/linux/generic/hack-4.14/721-phy_packets.patch @@ -0,0 +1,176 @@ +From ffe387740bbe88dd88bbe04d6375902708003d6e Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:25:00 +0200 +Subject: net: add packet mangeling patch + +Signed-off-by: Felix Fietkau +--- + include/linux/netdevice.h | 11 +++++++++++ + include/linux/skbuff.h | 14 ++++---------- + net/Kconfig | 6 ++++++ + net/core/dev.c | 18 ++++++++++++++---- + net/core/skbuff.c | 17 +++++++++++++++++ + net/ethernet/eth.c | 6 ++++++ + 6 files changed, 58 insertions(+), 14 deletions(-) + +--- a/include/linux/netdevice.h ++++ b/include/linux/netdevice.h +@@ -1386,6 +1386,7 @@ enum netdev_priv_flags { + IFF_RXFH_CONFIGURED = 1<<25, + IFF_PHONY_HEADROOM = 1<<26, + IFF_MACSEC = 1<<27, ++ IFF_NO_IP_ALIGN = 1<<28, + }; + + #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN +@@ -1415,6 +1416,7 @@ enum netdev_priv_flags { + #define IFF_TEAM IFF_TEAM + #define IFF_RXFH_CONFIGURED IFF_RXFH_CONFIGURED + #define IFF_MACSEC IFF_MACSEC ++#define IFF_NO_IP_ALIGN IFF_NO_IP_ALIGN + + /** + * struct net_device - The DEVICE structure. +@@ -1701,6 +1703,11 @@ struct net_device { + const struct xfrmdev_ops *xfrmdev_ops; + #endif + ++#ifdef CONFIG_ETHERNET_PACKET_MANGLE ++ void (*eth_mangle_rx)(struct net_device *dev, struct sk_buff *skb); ++ struct sk_buff *(*eth_mangle_tx)(struct net_device *dev, struct sk_buff *skb); ++#endif ++ + const struct header_ops *header_ops; + + unsigned int flags; +@@ -1770,6 +1777,10 @@ struct net_device { + struct mpls_dev __rcu *mpls_ptr; + #endif + ++#ifdef CONFIG_ETHERNET_PACKET_MANGLE ++ void *phy_ptr; /* PHY device specific data */ ++#endif ++ + /* + * Cache lines mostly used on receive path (including eth_type_trans()) + */ +--- a/include/linux/skbuff.h ++++ b/include/linux/skbuff.h +@@ -2494,6 +2494,10 @@ static inline int pskb_trim(struct sk_bu + return (len < skb->len) ? __pskb_trim(skb, len) : 0; + } + ++extern struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev, ++ unsigned int length, gfp_t gfp); ++ ++ + /** + * pskb_trim_unique - remove end from a paged unique (not cloned) buffer + * @skb: buffer to alter +@@ -2624,16 +2628,6 @@ static inline struct sk_buff *dev_alloc_ + } + + +-static inline struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev, +- unsigned int length, gfp_t gfp) +-{ +- struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp); +- +- if (NET_IP_ALIGN && skb) +- skb_reserve(skb, NET_IP_ALIGN); +- return skb; +-} +- + static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev, + unsigned int length) + { +--- a/net/Kconfig ++++ b/net/Kconfig +@@ -25,6 +25,12 @@ menuconfig NET + + if NET + ++config ETHERNET_PACKET_MANGLE ++ bool ++ help ++ This option can be selected by phy drivers that need to mangle ++ packets going in or out of an ethernet device. ++ + config WANT_COMPAT_NETLINK_MESSAGES + bool + help +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -2975,10 +2975,20 @@ static int xmit_one(struct sk_buff *skb, + if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all)) + dev_queue_xmit_nit(skb, dev); + +- len = skb->len; +- trace_net_dev_start_xmit(skb, dev); +- rc = netdev_start_xmit(skb, dev, txq, more); +- trace_net_dev_xmit(skb, rc, dev, len); ++#ifdef CONFIG_ETHERNET_PACKET_MANGLE ++ if (!dev->eth_mangle_tx || ++ (skb = dev->eth_mangle_tx(dev, skb)) != NULL) ++#else ++ if (1) ++#endif ++ { ++ len = skb->len; ++ trace_net_dev_start_xmit(skb, dev); ++ rc = netdev_start_xmit(skb, dev, txq, more); ++ trace_net_dev_xmit(skb, rc, dev, len); ++ } else { ++ rc = NETDEV_TX_OK; ++ } + + return rc; + } +--- a/net/core/skbuff.c ++++ b/net/core/skbuff.c +@@ -64,6 +64,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -503,6 +504,22 @@ skb_fail: + } + EXPORT_SYMBOL(__napi_alloc_skb); + ++struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev, ++ unsigned int length, gfp_t gfp) ++{ ++ struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp); ++ ++#ifdef CONFIG_ETHERNET_PACKET_MANGLE ++ if (dev && (dev->priv_flags & IFF_NO_IP_ALIGN)) ++ return skb; ++#endif ++ ++ if (NET_IP_ALIGN && skb) ++ skb_reserve(skb, NET_IP_ALIGN); ++ return skb; ++} ++EXPORT_SYMBOL(__netdev_alloc_skb_ip_align); ++ + void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, int off, + int size, unsigned int truesize) + { +--- a/net/ethernet/eth.c ++++ b/net/ethernet/eth.c +@@ -172,6 +172,12 @@ __be16 eth_type_trans(struct sk_buff *sk + const struct ethhdr *eth; + + skb->dev = dev; ++ ++#ifdef CONFIG_ETHERNET_PACKET_MANGLE ++ if (dev->eth_mangle_rx) ++ dev->eth_mangle_rx(dev, skb); ++#endif ++ + skb_reset_mac_header(skb); + + eth = (struct ethhdr *)skb->data; diff --git a/target/linux/generic/hack-4.14/773-bgmac-add-srab-switch.patch b/target/linux/generic/hack-4.14/773-bgmac-add-srab-switch.patch new file mode 100644 index 0000000000..a6ba81fb09 --- /dev/null +++ b/target/linux/generic/hack-4.14/773-bgmac-add-srab-switch.patch @@ -0,0 +1,98 @@ +From 3cb240533ab787899dc7f17aa7d6c5b4810e2e58 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Fri, 7 Jul 2017 17:26:01 +0200 +Subject: bcm53xx: bgmac: use srab switch driver + +use the srab switch driver on these SoCs. + +Signed-off-by: Hauke Mehrtens +--- + drivers/net/ethernet/broadcom/bgmac-bcma.c | 1 + + drivers/net/ethernet/broadcom/bgmac.c | 24 ++++++++++++++++++++++++ + drivers/net/ethernet/broadcom/bgmac.h | 4 ++++ + 3 files changed, 29 insertions(+) + +--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c ++++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c +@@ -268,6 +268,7 @@ static int bgmac_probe(struct bcma_devic + bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST; + bgmac->feature_flags |= BGMAC_FEAT_NO_RESET; + bgmac->feature_flags |= BGMAC_FEAT_FORCE_SPEED_2500; ++ bgmac->feature_flags |= BGMAC_FEAT_SRAB; + break; + default: + bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST; +--- a/drivers/net/ethernet/broadcom/bgmac.c ++++ b/drivers/net/ethernet/broadcom/bgmac.c +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -1409,6 +1410,17 @@ static const struct ethtool_ops bgmac_et + .set_link_ksettings = phy_ethtool_set_link_ksettings, + }; + ++static struct b53_platform_data bgmac_b53_pdata = { ++}; ++ ++static struct platform_device bgmac_b53_dev = { ++ .name = "b53-srab-switch", ++ .id = -1, ++ .dev = { ++ .platform_data = &bgmac_b53_pdata, ++ }, ++}; ++ + /************************************************** + * MII + **************************************************/ +@@ -1538,6 +1550,14 @@ int bgmac_enet_probe(struct bgmac *bgmac + net_dev->hw_features = net_dev->features; + net_dev->vlan_features = net_dev->features; + ++ if ((bgmac->feature_flags & BGMAC_FEAT_SRAB) && !bgmac_b53_pdata.regs) { ++ bgmac_b53_pdata.regs = ioremap_nocache(0x18007000, 0x1000); ++ ++ err = platform_device_register(&bgmac_b53_dev); ++ if (!err) ++ bgmac->b53_device = &bgmac_b53_dev; ++ } ++ + err = register_netdev(bgmac->net_dev); + if (err) { + dev_err(bgmac->dev, "Cannot register net device\n"); +@@ -1560,6 +1580,10 @@ EXPORT_SYMBOL_GPL(bgmac_enet_probe); + + void bgmac_enet_remove(struct bgmac *bgmac) + { ++ if (bgmac->b53_device) ++ platform_device_unregister(&bgmac_b53_dev); ++ bgmac->b53_device = NULL; ++ + unregister_netdev(bgmac->net_dev); + phy_disconnect(bgmac->net_dev->phydev); + netif_napi_del(&bgmac->napi); +--- a/drivers/net/ethernet/broadcom/bgmac.h ++++ b/drivers/net/ethernet/broadcom/bgmac.h +@@ -427,6 +427,7 @@ + #define BGMAC_FEAT_CC4_IF_SW_TYPE_RGMII BIT(18) + #define BGMAC_FEAT_CC7_IF_TYPE_RGMII BIT(19) + #define BGMAC_FEAT_IDM_MASK BIT(20) ++#define BGMAC_FEAT_SRAB BIT(21) + + struct bgmac_slot_info { + union { +@@ -532,6 +533,9 @@ struct bgmac { + void (*cmn_maskset32)(struct bgmac *bgmac, u16 offset, u32 mask, + u32 set); + int (*phy_connect)(struct bgmac *bgmac); ++ ++ /* platform device for associated switch */ ++ struct platform_device *b53_device; + }; + + struct bgmac *bgmac_alloc(struct device *dev); diff --git a/target/linux/generic/hack-4.14/835-misc-owl_loader.patch b/target/linux/generic/hack-4.14/835-misc-owl_loader.patch new file mode 100644 index 0000000000..bf7f7d5cba --- /dev/null +++ b/target/linux/generic/hack-4.14/835-misc-owl_loader.patch @@ -0,0 +1,52 @@ +From dd36f935973d91644449bd9749f6062a2bed821b Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 7 Jul 2017 17:26:46 +0200 +Subject: misc: owl-loader for delayed Atheros ath9k fixup + +Some devices (like the Cisco Meraki Z1 Cloud Managed Teleworker Gateway) +need to be able to initialize the PCIe wifi device. Normally, this is done +during the early stages of booting linux, because the necessary init code +is read from the memory mapped SPI and passed to pci_enable_ath9k_fixup. +However,this isn't possible for devices which have the init code for the +Atheros chip stored on NAND in an UBI volume. Hence, this module can be +used to initialze the chip when the user-space is ready to extract the +init code. + +Signed-off-by: Martin Blumenstingl +Signed-off-by: Christian Lamparter +--- + drivers/misc/Kconfig | 12 ++++++++++++ + drivers/misc/Makefile | 1 + + 2 files changed, 13 insertions(+) + +--- a/drivers/misc/Kconfig ++++ b/drivers/misc/Kconfig +@@ -151,6 +151,18 @@ config SGI_IOC4 + If you have an SGI Altix with an IOC4-based card say Y. + Otherwise say N. + ++config OWL_LOADER ++ tristate "Owl loader for initializing Atheros PCI(e) Wifi chips" ++ depends on PCI ++ ---help--- ++ This kernel module helps to initialize certain Qualcomm ++ Atheros' PCI(e) Wifi chips, which have the init data ++ (which contains the PCI device ID for example) stored ++ together with the calibration data in the file system. ++ ++ This is necessary for devices like the Cisco Meraki Z1, say M. ++ Otherwise say N. ++ + config TIFM_CORE + tristate "TI Flash Media interface support" + depends on PCI +--- a/drivers/misc/Makefile ++++ b/drivers/misc/Makefile +@@ -13,6 +13,7 @@ obj-$(CONFIG_ATMEL_TCLIB) += atmel_tclib + obj-$(CONFIG_DUMMY_IRQ) += dummy-irq.o + obj-$(CONFIG_ICS932S401) += ics932s401.o + obj-$(CONFIG_LKDTM) += lkdtm.o ++obj-$(CONFIG_OWL_LOADER) += owl-loader.o + obj-$(CONFIG_TIFM_CORE) += tifm_core.o + obj-$(CONFIG_TIFM_7XX1) += tifm_7xx1.o + obj-$(CONFIG_PHANTOM) += phantom.o diff --git a/target/linux/generic/hack-4.14/901-debloat_sock_diag.patch b/target/linux/generic/hack-4.14/901-debloat_sock_diag.patch new file mode 100644 index 0000000000..d854865d60 --- /dev/null +++ b/target/linux/generic/hack-4.14/901-debloat_sock_diag.patch @@ -0,0 +1,136 @@ +From 3b6115d6b57a263bdc8c9b1df273bd4a7955eead Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sat, 8 Jul 2017 08:16:31 +0200 +Subject: debloat: add some debloat patches, strip down procfs and make O_DIRECT support optional, saves ~15K after lzma on MIPS + +Signed-off-by: Felix Fietkau +--- + net/Kconfig | 3 +++ + net/core/Makefile | 3 ++- + net/core/sock.c | 2 ++ + net/ipv4/Kconfig | 1 + + net/netlink/Kconfig | 1 + + net/packet/Kconfig | 1 + + net/unix/Kconfig | 1 + + 7 files changed, 11 insertions(+), 1 deletion(-) + +--- a/net/Kconfig ++++ b/net/Kconfig +@@ -97,6 +97,9 @@ source "net/netlabel/Kconfig" + + endif # if INET + ++config SOCK_DIAG ++ bool ++ + config NETWORK_SECMARK + bool "Security Marking" + help +--- a/net/core/Makefile ++++ b/net/core/Makefile +@@ -10,9 +10,10 @@ obj-$(CONFIG_SYSCTL) += sysctl_net_core. + + obj-y += dev.o ethtool.o dev_addr_lists.o dst.o netevent.o \ + neighbour.o rtnetlink.o utils.o link_watch.o filter.o \ +- sock_diag.o dev_ioctl.o tso.o sock_reuseport.o \ ++ dev_ioctl.o tso.o sock_reuseport.o \ + fib_notifier.o + ++obj-$(CONFIG_SOCK_DIAG) += sock_diag.o + obj-y += net-sysfs.o + obj-$(CONFIG_PROC_FS) += net-procfs.o + obj-$(CONFIG_NET_PKTGEN) += pktgen.o +--- a/net/core/sock.c ++++ b/net/core/sock.c +@@ -528,6 +528,18 @@ discard_and_relse: + } + EXPORT_SYMBOL(__sk_receive_skb); + ++u64 sock_gen_cookie(struct sock *sk) ++{ ++ while (1) { ++ u64 res = atomic64_read(&sk->sk_cookie); ++ ++ if (res) ++ return res; ++ res = atomic64_inc_return(&sock_net(sk)->cookie_gen); ++ atomic64_cmpxchg(&sk->sk_cookie, 0, res); ++ } ++} ++ + struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie) + { + struct dst_entry *dst = __sk_dst_get(sk); +@@ -1597,9 +1609,11 @@ void sk_destruct(struct sock *sk) + + static void __sk_free(struct sock *sk) + { ++#ifdef CONFIG_SOCK_DIAG + if (unlikely(sock_diag_has_destroy_listeners(sk) && sk->sk_net_refcnt)) + sock_diag_broadcast_destroy(sk); + else ++#endif + sk_destruct(sk); + } + +--- a/net/core/sock_diag.c ++++ b/net/core/sock_diag.c +@@ -19,18 +19,6 @@ static int (*inet_rcv_compat)(struct sk_ + static DEFINE_MUTEX(sock_diag_table_mutex); + static struct workqueue_struct *broadcast_wq; + +-u64 sock_gen_cookie(struct sock *sk) +-{ +- while (1) { +- u64 res = atomic64_read(&sk->sk_cookie); +- +- if (res) +- return res; +- res = atomic64_inc_return(&sock_net(sk)->cookie_gen); +- atomic64_cmpxchg(&sk->sk_cookie, 0, res); +- } +-} +- + int sock_diag_check_cookie(struct sock *sk, const __u32 *cookie) + { + u64 res; +--- a/net/ipv4/Kconfig ++++ b/net/ipv4/Kconfig +@@ -420,6 +420,7 @@ config INET_XFRM_MODE_BEET + + config INET_DIAG + tristate "INET: socket monitoring interface" ++ select SOCK_DIAG + default y + ---help--- + Support for INET (TCP, DCCP, etc) socket monitoring interface used by +--- a/net/netlink/Kconfig ++++ b/net/netlink/Kconfig +@@ -4,6 +4,7 @@ + + config NETLINK_DIAG + tristate "NETLINK: socket monitoring interface" ++ select SOCK_DIAG + default n + ---help--- + Support for NETLINK socket monitoring interface used by the ss tool. +--- a/net/packet/Kconfig ++++ b/net/packet/Kconfig +@@ -18,6 +18,7 @@ config PACKET + config PACKET_DIAG + tristate "Packet: sockets monitoring interface" + depends on PACKET ++ select SOCK_DIAG + default n + ---help--- + Support for PF_PACKET sockets monitoring interface used by the ss tool. +--- a/net/unix/Kconfig ++++ b/net/unix/Kconfig +@@ -22,6 +22,7 @@ config UNIX + config UNIX_DIAG + tristate "UNIX: socket monitoring interface" + depends on UNIX ++ select SOCK_DIAG + default n + ---help--- + Support for UNIX socket monitoring interface used by the ss tool. diff --git a/target/linux/generic/hack-4.14/902-debloat_proc.patch b/target/linux/generic/hack-4.14/902-debloat_proc.patch new file mode 100644 index 0000000000..e291da5163 --- /dev/null +++ b/target/linux/generic/hack-4.14/902-debloat_proc.patch @@ -0,0 +1,405 @@ +From 9e3f1d0805b2d919904dd9a4ff0d956314cc3cba Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sat, 8 Jul 2017 08:20:09 +0200 +Subject: debloat: procfs + +Signed-off-by: Felix Fietkau +--- + fs/locks.c | 2 ++ + fs/proc/Kconfig | 5 +++++ + fs/proc/consoles.c | 3 +++ + fs/proc/proc_tty.c | 11 ++++++++++- + include/net/snmp.h | 18 +++++++++++++++++- + ipc/msg.c | 3 +++ + ipc/sem.c | 2 ++ + ipc/shm.c | 2 ++ + ipc/util.c | 3 +++ + kernel/exec_domain.c | 2 ++ + kernel/irq/proc.c | 9 +++++++++ + kernel/time/timer_list.c | 2 ++ + mm/vmalloc.c | 2 ++ + mm/vmstat.c | 8 +++++--- + net/8021q/vlanproc.c | 6 ++++++ + net/core/net-procfs.c | 18 ++++++++++++------ + net/core/sock.c | 2 ++ + net/ipv4/fib_trie.c | 18 ++++++++++++------ + net/ipv4/proc.c | 3 +++ + net/ipv4/route.c | 3 +++ + 20 files changed, 105 insertions(+), 17 deletions(-) + +--- a/fs/locks.c ++++ b/fs/locks.c +@@ -2805,6 +2805,8 @@ static const struct file_operations proc + + static int __init proc_locks_init(void) + { ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return 0; + proc_create("locks", 0, NULL, &proc_locks_operations); + return 0; + } +--- a/fs/proc/Kconfig ++++ b/fs/proc/Kconfig +@@ -81,3 +81,8 @@ config PROC_CHILDREN + + Say Y if you are running any user-space software which takes benefit from + this interface. For example, rkt is such a piece of software. ++ ++config PROC_STRIPPED ++ default n ++ depends on EXPERT ++ bool "Strip non-essential /proc functionality to reduce code size" +--- a/fs/proc/consoles.c ++++ b/fs/proc/consoles.c +@@ -106,6 +106,9 @@ static const struct file_operations proc + + static int __init proc_consoles_init(void) + { ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return 0; ++ + proc_create("consoles", 0, NULL, &proc_consoles_operations); + return 0; + } +--- a/fs/proc/proc_tty.c ++++ b/fs/proc/proc_tty.c +@@ -145,7 +145,10 @@ static const struct file_operations proc + void proc_tty_register_driver(struct tty_driver *driver) + { + struct proc_dir_entry *ent; +- ++ ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return; ++ + if (!driver->driver_name || driver->proc_entry || + !driver->ops->proc_fops) + return; +@@ -162,6 +165,9 @@ void proc_tty_unregister_driver(struct t + { + struct proc_dir_entry *ent; + ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return; ++ + ent = driver->proc_entry; + if (!ent) + return; +@@ -176,6 +182,9 @@ void proc_tty_unregister_driver(struct t + */ + void __init proc_tty_init(void) + { ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return; ++ + if (!proc_mkdir("tty", NULL)) + return; + proc_mkdir("tty/ldisc", NULL); /* Preserved: it's userspace visible */ +--- a/include/net/snmp.h ++++ b/include/net/snmp.h +@@ -123,6 +123,21 @@ struct linux_xfrm_mib { + #define DECLARE_SNMP_STAT(type, name) \ + extern __typeof__(type) __percpu *name + ++#ifdef CONFIG_PROC_STRIPPED ++#define __SNMP_STATS_DUMMY(mib) \ ++ do { (void) mib->mibs[0]; } while(0) ++ ++#define __SNMP_INC_STATS(mib, field) __SNMP_STATS_DUMMY(mib) ++#define SNMP_INC_STATS_ATOMIC_LONG(mib, field) __SNMP_STATS_DUMMY(mib) ++#define SNMP_INC_STATS(mib, field) __SNMP_STATS_DUMMY(mib) ++#define SNMP_DEC_STATS(mib, field) __SNMP_STATS_DUMMY(mib) ++#define __SNMP_ADD_STATS(mib, field, addend) __SNMP_STATS_DUMMY(mib) ++#define SNMP_ADD_STATS(mib, field, addend) __SNMP_STATS_DUMMY(mib) ++#define SNMP_UPD_PO_STATS(mib, basefield, addend) __SNMP_STATS_DUMMY(mib) ++#define __SNMP_UPD_PO_STATS(mib, basefield, addend) __SNMP_STATS_DUMMY(mib) ++ ++#else ++ + #define __SNMP_INC_STATS(mib, field) \ + __this_cpu_inc(mib->mibs[field]) + +@@ -153,8 +168,9 @@ struct linux_xfrm_mib { + __this_cpu_add(ptr[basefield##OCTETS], addend); \ + } while (0) + ++#endif + +-#if BITS_PER_LONG==32 ++#if (BITS_PER_LONG==32) && !defined(CONFIG_PROC_STRIPPED) + + #define __SNMP_ADD_STATS64(mib, field, addend) \ + do { \ +--- a/ipc/msg.c ++++ b/ipc/msg.c +@@ -1208,6 +1208,9 @@ int __init msg_init(void) + { + const int err = msg_init_ns(&init_ipc_ns); + ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return err; ++ + ipc_init_proc_interface("sysvipc/msg", + " key msqid perms cbytes qnum lspid lrpid uid gid cuid cgid stime rtime ctime\n", + IPC_MSG_IDS, sysvipc_msg_proc_show); +--- a/ipc/sem.c ++++ b/ipc/sem.c +@@ -207,6 +207,8 @@ int __init sem_init(void) + { + const int err = sem_init_ns(&init_ipc_ns); + ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return err; + ipc_init_proc_interface("sysvipc/sem", + " key semid perms nsems uid gid cuid cgid otime ctime\n", + IPC_SEM_IDS, sysvipc_sem_proc_show); +--- a/ipc/shm.c ++++ b/ipc/shm.c +@@ -122,6 +122,8 @@ pure_initcall(ipc_ns_init); + + void __init shm_init(void) + { ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return; + ipc_init_proc_interface("sysvipc/shm", + #if BITS_PER_LONG <= 32 + " key shmid perms size cpid lpid nattch uid gid cuid cgid atime dtime ctime rss swap\n", +--- a/ipc/util.c ++++ b/ipc/util.c +@@ -141,6 +141,9 @@ void __init ipc_init_proc_interface(cons + struct proc_dir_entry *pde; + struct ipc_proc_iface *iface; + ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return; ++ + iface = kmalloc(sizeof(*iface), GFP_KERNEL); + if (!iface) + return; +--- a/kernel/exec_domain.c ++++ b/kernel/exec_domain.c +@@ -42,6 +42,8 @@ static const struct file_operations exec + + static int __init proc_execdomains_init(void) + { ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return 0; + proc_create("execdomains", 0, NULL, &execdomains_proc_fops); + return 0; + } +--- a/kernel/irq/proc.c ++++ b/kernel/irq/proc.c +@@ -396,6 +396,9 @@ void register_irq_proc(unsigned int irq, + void __maybe_unused *irqp = (void *)(unsigned long) irq; + char name [MAX_NAMELEN]; + ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED) && !IS_ENABLED(CONFIG_SMP)) ++ return; ++ + if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip)) + return; + +@@ -449,6 +452,9 @@ void unregister_irq_proc(unsigned int ir + { + char name [MAX_NAMELEN]; + ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED) && !IS_ENABLED(CONFIG_SMP)) ++ return; ++ + if (!root_irq_dir || !desc->dir) + return; + #ifdef CONFIG_SMP +@@ -487,6 +493,9 @@ void init_irq_proc(void) + unsigned int irq; + struct irq_desc *desc; + ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED) && !IS_ENABLED(CONFIG_SMP)) ++ return; ++ + /* create /proc/irq */ + root_irq_dir = proc_mkdir("irq", NULL); + if (!root_irq_dir) +--- a/kernel/time/timer_list.c ++++ b/kernel/time/timer_list.c +@@ -389,6 +389,8 @@ static int __init init_timer_list_procfs + { + struct proc_dir_entry *pe; + ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return 0; + pe = proc_create("timer_list", 0444, NULL, &timer_list_fops); + if (!pe) + return -ENOMEM; +--- a/mm/vmalloc.c ++++ b/mm/vmalloc.c +@@ -2765,6 +2765,8 @@ static const struct file_operations proc + + static int __init proc_vmalloc_init(void) + { ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return 0; + proc_create("vmallocinfo", S_IRUSR, NULL, &proc_vmalloc_operations); + return 0; + } +--- a/mm/vmstat.c ++++ b/mm/vmstat.c +@@ -1944,10 +1944,12 @@ void __init init_mm_internals(void) + start_shepherd_timer(); + #endif + #ifdef CONFIG_PROC_FS +- proc_create("buddyinfo", 0444, NULL, &buddyinfo_file_operations); +- proc_create("pagetypeinfo", 0444, NULL, &pagetypeinfo_file_operations); ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED)) { ++ proc_create("buddyinfo", 0444, NULL, &buddyinfo_file_operations); ++ proc_create("pagetypeinfo", 0444, NULL, &pagetypeinfo_file_operations); ++ proc_create("zoneinfo", 0444, NULL, &zoneinfo_file_operations); ++ } + proc_create("vmstat", 0444, NULL, &vmstat_file_operations); +- proc_create("zoneinfo", 0444, NULL, &zoneinfo_file_operations); + #endif + } + +--- a/net/8021q/vlanproc.c ++++ b/net/8021q/vlanproc.c +@@ -127,6 +127,9 @@ void vlan_proc_cleanup(struct net *net) + { + struct vlan_net *vn = net_generic(net, vlan_net_id); + ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return; ++ + if (vn->proc_vlan_conf) + remove_proc_entry(name_conf, vn->proc_vlan_dir); + +@@ -146,6 +149,9 @@ int __net_init vlan_proc_init(struct net + { + struct vlan_net *vn = net_generic(net, vlan_net_id); + ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return 0; ++ + vn->proc_vlan_dir = proc_net_mkdir(net, name_root, net->proc_net); + if (!vn->proc_vlan_dir) + goto err; +--- a/net/core/net-procfs.c ++++ b/net/core/net-procfs.c +@@ -320,10 +320,12 @@ static int __net_init dev_proc_net_init( + + if (!proc_create("dev", S_IRUGO, net->proc_net, &dev_seq_fops)) + goto out; +- if (!proc_create("softnet_stat", S_IRUGO, net->proc_net, ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED) && ++ !proc_create("softnet_stat", S_IRUGO, net->proc_net, + &softnet_seq_fops)) + goto out_dev; +- if (!proc_create("ptype", S_IRUGO, net->proc_net, &ptype_seq_fops)) ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED) && ++ !proc_create("ptype", S_IRUGO, net->proc_net, &ptype_seq_fops)) + goto out_softnet; + + if (wext_proc_init(net)) +@@ -332,9 +334,11 @@ static int __net_init dev_proc_net_init( + out: + return rc; + out_ptype: +- remove_proc_entry("ptype", net->proc_net); ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ remove_proc_entry("ptype", net->proc_net); + out_softnet: +- remove_proc_entry("softnet_stat", net->proc_net); ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ remove_proc_entry("softnet_stat", net->proc_net); + out_dev: + remove_proc_entry("dev", net->proc_net); + goto out; +@@ -344,8 +348,10 @@ static void __net_exit dev_proc_net_exit + { + wext_proc_exit(net); + +- remove_proc_entry("ptype", net->proc_net); +- remove_proc_entry("softnet_stat", net->proc_net); ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED)) { ++ remove_proc_entry("ptype", net->proc_net); ++ remove_proc_entry("softnet_stat", net->proc_net); ++ } + remove_proc_entry("dev", net->proc_net); + } + +--- a/net/core/sock.c ++++ b/net/core/sock.c +@@ -3383,6 +3383,8 @@ static __net_initdata struct pernet_oper + + static int __init proto_init(void) + { ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return 0; + return register_pernet_subsys(&proto_net_ops); + } + +--- a/net/ipv4/fib_trie.c ++++ b/net/ipv4/fib_trie.c +@@ -2731,10 +2731,12 @@ static const struct file_operations fib_ + + int __net_init fib_proc_init(struct net *net) + { +- if (!proc_create("fib_trie", S_IRUGO, net->proc_net, &fib_trie_fops)) ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED) && ++ !proc_create("fib_trie", S_IRUGO, net->proc_net, &fib_trie_fops)) + goto out1; + +- if (!proc_create("fib_triestat", S_IRUGO, net->proc_net, ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED) && ++ !proc_create("fib_triestat", S_IRUGO, net->proc_net, + &fib_triestat_fops)) + goto out2; + +@@ -2744,17 +2746,21 @@ int __net_init fib_proc_init(struct net + return 0; + + out3: +- remove_proc_entry("fib_triestat", net->proc_net); ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ remove_proc_entry("fib_triestat", net->proc_net); + out2: +- remove_proc_entry("fib_trie", net->proc_net); ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ remove_proc_entry("fib_trie", net->proc_net); + out1: + return -ENOMEM; + } + + void __net_exit fib_proc_exit(struct net *net) + { +- remove_proc_entry("fib_trie", net->proc_net); +- remove_proc_entry("fib_triestat", net->proc_net); ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED)) { ++ remove_proc_entry("fib_trie", net->proc_net); ++ remove_proc_entry("fib_triestat", net->proc_net); ++ } + remove_proc_entry("route", net->proc_net); + } + +--- a/net/ipv4/proc.c ++++ b/net/ipv4/proc.c +@@ -557,6 +557,9 @@ static __net_initdata struct pernet_oper + + int __init ip_misc_proc_init(void) + { ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return 0; ++ + return register_pernet_subsys(&ip_proc_ops); + } + +--- a/net/ipv4/route.c ++++ b/net/ipv4/route.c +@@ -424,6 +424,9 @@ static struct pernet_operations ip_rt_pr + + static int __init ip_rt_proc_init(void) + { ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return 0; ++ + return register_pernet_subsys(&ip_rt_proc_ops); + } + diff --git a/target/linux/generic/hack-4.14/904-debloat_dma_buf.patch b/target/linux/generic/hack-4.14/904-debloat_dma_buf.patch new file mode 100644 index 0000000000..8f1a3bca82 --- /dev/null +++ b/target/linux/generic/hack-4.14/904-debloat_dma_buf.patch @@ -0,0 +1,64 @@ +From e3692cb2fcd5ba1244512a0f43b8118f65f1c375 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sat, 8 Jul 2017 08:20:43 +0200 +Subject: debloat: dmabuf + +Signed-off-by: Felix Fietkau +--- + drivers/base/Kconfig | 2 +- + drivers/dma-buf/Makefile | 10 +++++++--- + drivers/dma-buf/dma-buf.c | 4 +++- + kernel/sched/core.c | 1 + + 4 files changed, 12 insertions(+), 5 deletions(-) + +--- a/drivers/base/Kconfig ++++ b/drivers/base/Kconfig +@@ -243,7 +243,7 @@ config SOC_BUS + source "drivers/base/regmap/Kconfig" + + config DMA_SHARED_BUFFER +- bool ++ tristate + default n + select ANON_INODES + help +--- a/drivers/dma-buf/Makefile ++++ b/drivers/dma-buf/Makefile +@@ -1,3 +1,7 @@ +-obj-y := dma-buf.o dma-fence.o dma-fence-array.o reservation.o seqno-fence.o +-obj-$(CONFIG_SYNC_FILE) += sync_file.o +-obj-$(CONFIG_SW_SYNC) += sw_sync.o sync_debug.o ++obj-$(CONFIG_DMA_SHARED_BUFFER) := dma-shared-buffer.o ++ ++dma-buf-objs-y := dma-buf.o dma-fence.o dma-fence-array.o reservation.o seqno-fence.o ++dma-buf-objs-$(CONFIG_SYNC_FILE) += sync_file.o ++dma-buf-objs-$(CONFIG_SW_SYNC) += sw_sync.o sync_debug.o ++ ++dma-shared-buffer-objs := $(dma-buf-objs-y) +--- a/drivers/dma-buf/dma-buf.c ++++ b/drivers/dma-buf/dma-buf.c +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + + #include + +@@ -1205,4 +1206,5 @@ static void __exit dma_buf_deinit(void) + { + dma_buf_uninit_debugfs(); + } +-__exitcall(dma_buf_deinit); ++module_exit(dma_buf_deinit); ++MODULE_LICENSE("GPL"); +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -2146,6 +2146,7 @@ int wake_up_state(struct task_struct *p, + { + return try_to_wake_up(p, state, 0); + } ++EXPORT_SYMBOL_GPL(wake_up_state); + + /* + * Perform scheduler related setup for a newly forked process p. diff --git a/target/linux/generic/hack-4.14/910-kobject_uevent.patch b/target/linux/generic/hack-4.14/910-kobject_uevent.patch new file mode 100644 index 0000000000..113fbb54b3 --- /dev/null +++ b/target/linux/generic/hack-4.14/910-kobject_uevent.patch @@ -0,0 +1,32 @@ +From 0d37e6edc09c99e683dd91ca0e83bbc0df8477b3 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sun, 16 Jul 2017 16:56:10 +0200 +Subject: lib: add uevent_next_seqnum() + +Signed-off-by: Felix Fietkau +--- + include/linux/kobject.h | 5 +++++ + lib/kobject_uevent.c | 37 +++++++++++++++++++++++++++++++++++++ + 2 files changed, 42 insertions(+) + +--- a/lib/kobject_uevent.c ++++ b/lib/kobject_uevent.c +@@ -176,6 +176,18 @@ out: + return r; + } + ++u64 uevent_next_seqnum(void) ++{ ++ u64 seq; ++ ++ mutex_lock(&uevent_sock_mutex); ++ seq = ++uevent_seqnum; ++ mutex_unlock(&uevent_sock_mutex); ++ ++ return seq; ++} ++EXPORT_SYMBOL_GPL(uevent_next_seqnum); ++ + /** + * kobject_synth_uevent - send synthetic uevent with arguments + * diff --git a/target/linux/generic/hack-4.14/911-kobject_add_broadcast_uevent.patch b/target/linux/generic/hack-4.14/911-kobject_add_broadcast_uevent.patch new file mode 100644 index 0000000000..abacfc390a --- /dev/null +++ b/target/linux/generic/hack-4.14/911-kobject_add_broadcast_uevent.patch @@ -0,0 +1,76 @@ +From 0d37e6edc09c99e683dd91ca0e83bbc0df8477b3 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sun, 16 Jul 2017 16:56:10 +0200 +Subject: lib: add uevent_next_seqnum() + +Signed-off-by: Felix Fietkau +--- + include/linux/kobject.h | 5 +++++ + lib/kobject_uevent.c | 37 +++++++++++++++++++++++++++++++++++++ + 2 files changed, 42 insertions(+) + +--- a/include/linux/kobject.h ++++ b/include/linux/kobject.h +@@ -32,6 +32,8 @@ + #define UEVENT_NUM_ENVP 32 /* number of env pointers */ + #define UEVENT_BUFFER_SIZE 2048 /* buffer for the variables */ + ++struct sk_buff; ++ + #ifdef CONFIG_UEVENT_HELPER + /* path to the userspace helper executed on an event */ + extern char uevent_helper[]; +@@ -224,4 +226,7 @@ int kobject_synth_uevent(struct kobject + __printf(2, 3) + int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...); + ++int broadcast_uevent(struct sk_buff *skb, __u32 pid, __u32 group, ++ gfp_t allocation); ++ + #endif /* _KOBJECT_H_ */ +--- a/lib/kobject_uevent.c ++++ b/lib/kobject_uevent.c +@@ -599,6 +599,43 @@ int add_uevent_var(struct kobj_uevent_en + EXPORT_SYMBOL_GPL(add_uevent_var); + + #if defined(CONFIG_NET) ++int broadcast_uevent(struct sk_buff *skb, __u32 pid, __u32 group, ++ gfp_t allocation) ++{ ++ struct uevent_sock *ue_sk; ++ int err = 0; ++ ++ /* send netlink message */ ++ mutex_lock(&uevent_sock_mutex); ++ list_for_each_entry(ue_sk, &uevent_sock_list, list) { ++ struct sock *uevent_sock = ue_sk->sk; ++ struct sk_buff *skb2; ++ ++ skb2 = skb_clone(skb, allocation); ++ if (!skb2) ++ break; ++ ++ err = netlink_broadcast(uevent_sock, skb2, pid, group, ++ allocation); ++ if (err) ++ break; ++ } ++ mutex_unlock(&uevent_sock_mutex); ++ ++ kfree_skb(skb); ++ return err; ++} ++#else ++int broadcast_uevent(struct sk_buff *skb, __u32 pid, __u32 group, ++ gfp_t allocation) ++{ ++ kfree_skb(skb); ++ return 0; ++} ++#endif ++EXPORT_SYMBOL_GPL(broadcast_uevent); ++ ++#if defined(CONFIG_NET) + static int uevent_net_init(struct net *net) + { + struct uevent_sock *ue_sk; diff --git a/target/linux/generic/hack-4.14/921-always-create-console-node-in-initramfs.patch b/target/linux/generic/hack-4.14/921-always-create-console-node-in-initramfs.patch new file mode 100644 index 0000000000..6eeddcc3c6 --- /dev/null +++ b/target/linux/generic/hack-4.14/921-always-create-console-node-in-initramfs.patch @@ -0,0 +1,40 @@ +From 5d301596fdc72f6cb672f72eb3c66e7cddefb103 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sat, 8 Jul 2017 08:26:02 +0200 +Subject: initramfs: always create console node + +Signed-off-by: Felix Fietkau +--- + scripts/gen_initramfs_list.sh | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/scripts/gen_initramfs_list.sh ++++ b/scripts/gen_initramfs_list.sh +@@ -59,6 +59,18 @@ default_initramfs() { + EOF + } + ++list_openwrt_initramfs() { ++ : ++} ++ ++openwrt_initramfs() { ++ # make sure that /dev/console exists ++ cat <<-EOF >> ${output} ++ dir /dev 0755 0 0 ++ nod /dev/console 0600 0 0 c 5 1 ++ EOF ++} ++ + filetype() { + local argv1="$1" + +@@ -180,6 +192,8 @@ dir_filelist() { + if [ "$(echo "${dirlist}" | wc -l)" -gt 1 ]; then + ${dep_list}print_mtime "$1" + ++ ${dep_list}openwrt_initramfs ++ + echo "${dirlist}" | \ + while read x; do + ${dep_list}parse ${x} diff --git a/target/linux/generic/hack-4.14/930-crashlog.patch b/target/linux/generic/hack-4.14/930-crashlog.patch new file mode 100644 index 0000000000..17ba187925 --- /dev/null +++ b/target/linux/generic/hack-4.14/930-crashlog.patch @@ -0,0 +1,338 @@ +From 6b1ab74a9917012d0c559edc4ed299d9228ac89f Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sat, 8 Jul 2017 08:26:47 +0200 +Subject: kernel: add the new 'crashlog' feature + +this tries to store kernel oops/panic logs in a fixed location in RAM to +recover them available to user space using debugfs + +Signed-off-by: Felix Fietkau +--- + include/linux/crashlog.h | 17 ++++ + init/Kconfig | 4 + + kernel/Makefile | 1 + + kernel/crashlog.c | 213 +++++++++++++++++++++++++++++++++++++++++++++++ + kernel/module.c | 3 + + mm/bootmem.c | 2 + + mm/memblock.c | 5 ++ + 7 files changed, 245 insertions(+) + create mode 100644 include/linux/crashlog.h + create mode 100644 kernel/crashlog.c + +--- /dev/null ++++ b/include/linux/crashlog.h +@@ -0,0 +1,17 @@ ++#ifndef __CRASHLOG_H ++#define __CRASHLOG_H ++ ++#ifdef CONFIG_CRASHLOG ++void crashlog_init_bootmem(struct bootmem_data *bdata); ++void crashlog_init_memblock(phys_addr_t addr, phys_addr_t size); ++#else ++static inline void crashlog_init_bootmem(struct bootmem_data *bdata) ++{ ++} ++ ++static inline void crashlog_init_memblock(phys_addr_t addr, phys_addr_t size) ++{ ++} ++#endif ++ ++#endif +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -1009,6 +1009,10 @@ config RELAY + + If unsure, say N. + ++config CRASHLOG ++ bool "Crash logging" ++ depends on (!NO_BOOTMEM || HAVE_MEMBLOCK) ++ + config BLK_DEV_INITRD + bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support" + depends on BROKEN || !FRV +--- a/kernel/Makefile ++++ b/kernel/Makefile +@@ -112,6 +112,7 @@ obj-$(CONFIG_CONTEXT_TRACKING) += contex + obj-$(CONFIG_TORTURE_TEST) += torture.o + + obj-$(CONFIG_HAS_IOMEM) += memremap.o ++obj-$(CONFIG_CRASHLOG) += crashlog.o + + $(obj)/configs.o: $(obj)/config_data.h + +--- /dev/null ++++ b/kernel/crashlog.c +@@ -0,0 +1,213 @@ ++/* ++ * Crash information logger ++ * Copyright (C) 2010 Felix Fietkau ++ * ++ * Based on ramoops.c ++ * Copyright (C) 2010 Marco Stornelli ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ * ++ * 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., 51 Franklin St, Fifth Floor, Boston, MA ++ * 02110-1301 USA ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define CRASHLOG_PAGES 4 ++#define CRASHLOG_SIZE (CRASHLOG_PAGES * PAGE_SIZE) ++#define CRASHLOG_MAGIC 0xa1eedead ++ ++/* ++ * Start the log at 1M before the end of RAM, as some boot loaders like ++ * to use the end of the RAM for stack usage and other things ++ * If this fails, fall back to using the last part. ++ */ ++#define CRASHLOG_OFFSET (1024 * 1024) ++ ++struct crashlog_data { ++ u32 magic; ++ u32 len; ++ u8 data[]; ++}; ++ ++static struct debugfs_blob_wrapper crashlog_blob; ++static unsigned long crashlog_addr = 0; ++static struct crashlog_data *crashlog_buf; ++static struct kmsg_dumper dump; ++static bool first = true; ++ ++extern struct list_head *crashlog_modules; ++ ++static bool crashlog_set_addr(phys_addr_t addr, phys_addr_t size) ++{ ++ /* Limit to lower 64 MB to avoid highmem */ ++ phys_addr_t limit = 64 * 1024 * 1024; ++ ++ if (crashlog_addr) ++ return false; ++ ++ if (addr > limit) ++ return false; ++ ++ if (addr + size > limit) ++ size = limit - addr; ++ ++ crashlog_addr = addr; ++ ++ if (addr + size > CRASHLOG_OFFSET) ++ crashlog_addr += size - CRASHLOG_OFFSET; ++ ++ return true; ++} ++ ++#ifndef CONFIG_NO_BOOTMEM ++void __init crashlog_init_bootmem(bootmem_data_t *bdata) ++{ ++ phys_addr_t start, end; ++ ++ start = PFN_PHYS(bdata->node_low_pfn); ++ end = PFN_PHYS(bdata->node_min_pfn); ++ if (!crashlog_set_addr(start, end - start)) ++ return; ++ ++ if (reserve_bootmem(crashlog_addr, CRASHLOG_SIZE, BOOTMEM_EXCLUSIVE) < 0) { ++ printk("Crashlog failed to allocate RAM at address 0x%lx\n", ++ crashlog_addr); ++ crashlog_addr = 0; ++ } ++} ++#endif ++ ++#ifdef CONFIG_HAVE_MEMBLOCK ++void __init_memblock crashlog_init_memblock(phys_addr_t addr, phys_addr_t size) ++{ ++ if (!crashlog_set_addr(addr, size)) ++ return; ++ ++ if (memblock_reserve(crashlog_addr, CRASHLOG_SIZE)) { ++ printk("Crashlog failed to allocate RAM at address 0x%lx\n", ++ crashlog_addr); ++ crashlog_addr = 0; ++ } ++} ++#endif ++ ++static void __init crashlog_copy(void) ++{ ++ if (crashlog_buf->magic != CRASHLOG_MAGIC) ++ return; ++ ++ if (!crashlog_buf->len || crashlog_buf->len > ++ CRASHLOG_SIZE - sizeof(*crashlog_buf)) ++ return; ++ ++ crashlog_blob.size = crashlog_buf->len; ++ crashlog_blob.data = kmemdup(crashlog_buf->data, ++ crashlog_buf->len, GFP_KERNEL); ++ ++ debugfs_create_blob("crashlog", 0700, NULL, &crashlog_blob); ++} ++ ++static int get_maxlen(void) ++{ ++ return CRASHLOG_SIZE - sizeof(*crashlog_buf) - crashlog_buf->len; ++} ++ ++static void crashlog_printf(const char *fmt, ...) ++{ ++ va_list args; ++ int len = get_maxlen(); ++ ++ if (!len) ++ return; ++ ++ va_start(args, fmt); ++ crashlog_buf->len += vscnprintf( ++ &crashlog_buf->data[crashlog_buf->len], ++ len, fmt, args); ++ va_end(args); ++} ++ ++static void crashlog_do_dump(struct kmsg_dumper *dumper, ++ enum kmsg_dump_reason reason) ++{ ++ struct timeval tv; ++ struct module *m; ++ char *buf; ++ size_t len; ++ ++ if (!first) ++ crashlog_printf("\n===================================\n"); ++ ++ do_gettimeofday(&tv); ++ crashlog_printf("Time: %lu.%lu\n", ++ (long)tv.tv_sec, (long)tv.tv_usec); ++ ++ if (first) { ++ crashlog_printf("Modules:"); ++ list_for_each_entry(m, crashlog_modules, list) { ++ crashlog_printf("\t%s@%p+%x", m->name, ++ m->core_layout.base, m->core_layout.size, ++ m->init_layout.base, m->init_layout.size); ++ } ++ crashlog_printf("\n"); ++ first = false; ++ } ++ ++ buf = (char *)&crashlog_buf->data[crashlog_buf->len]; ++ ++ kmsg_dump_get_buffer(dumper, true, buf, get_maxlen(), &len); ++ ++ crashlog_buf->len += len; ++} ++ ++ ++int __init crashlog_init_fs(void) ++{ ++ struct page *pages[CRASHLOG_PAGES]; ++ pgprot_t prot; ++ int i; ++ ++ if (!crashlog_addr) { ++ printk("No memory allocated for crashlog\n"); ++ return -ENOMEM; ++ } ++ ++ printk("Crashlog allocated RAM at address 0x%lx\n", (unsigned long) crashlog_addr); ++ for (i = 0; i < CRASHLOG_PAGES; i++) ++ pages[i] = pfn_to_page((crashlog_addr >> PAGE_SHIFT) + i); ++ ++ prot = pgprot_writecombine(PAGE_KERNEL); ++ crashlog_buf = vmap(pages, CRASHLOG_PAGES, VM_MAP, prot); ++ ++ crashlog_copy(); ++ ++ crashlog_buf->magic = CRASHLOG_MAGIC; ++ crashlog_buf->len = 0; ++ ++ dump.max_reason = KMSG_DUMP_OOPS; ++ dump.dump = crashlog_do_dump; ++ kmsg_dump_register(&dump); ++ ++ return 0; ++} ++module_init(crashlog_init_fs); +--- a/kernel/module.c ++++ b/kernel/module.c +@@ -256,6 +256,9 @@ static void mod_update_bounds(struct mod + #ifdef CONFIG_KGDB_KDB + struct list_head *kdb_modules = &modules; /* kdb needs the list of modules */ + #endif /* CONFIG_KGDB_KDB */ ++#ifdef CONFIG_CRASHLOG ++struct list_head *crashlog_modules = &modules; ++#endif + + static void module_assert_mutex(void) + { +--- a/mm/bootmem.c ++++ b/mm/bootmem.c +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -175,6 +176,7 @@ static unsigned long __init free_all_boo + if (!bdata->node_bootmem_map) + return 0; + ++ crashlog_init_bootmem(bdata); + map = bdata->node_bootmem_map; + start = bdata->node_min_pfn; + end = bdata->node_low_pfn; +--- a/mm/memblock.c ++++ b/mm/memblock.c +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -483,6 +484,8 @@ static void __init_memblock memblock_ins + memblock_set_region_node(rgn, nid); + type->cnt++; + type->total_size += size; ++ if (type == &memblock.memory) ++ crashlog_init_memblock(base, size); + } + + /** +@@ -522,6 +525,8 @@ int __init_memblock memblock_add_range(s + type->regions[0].flags = flags; + memblock_set_region_node(&type->regions[0], nid); + type->total_size = size; ++ if (type == &memblock.memory) ++ crashlog_init_memblock(base, size); + return 0; + } + repeat: diff --git a/target/linux/generic/hack-4.9/202-reduce_module_size.patch b/target/linux/generic/hack-4.9/202-reduce_module_size.patch index 1b4e19a4a6..6e5fc9cd46 100644 --- a/target/linux/generic/hack-4.9/202-reduce_module_size.patch +++ b/target/linux/generic/hack-4.9/202-reduce_module_size.patch @@ -13,12 +13,12 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -407,7 +407,7 @@ KBUILD_CFLAGS_KERNEL := - KBUILD_AFLAGS := -D__ASSEMBLY__ $(call cc-option,-fno-PIE) +@@ -401,7 +401,7 @@ KBUILD_AFLAGS_KERNEL := + KBUILD_CFLAGS_KERNEL := KBUILD_AFLAGS_MODULE := -DMODULE KBUILD_CFLAGS_MODULE := -DMODULE -KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds +KBUILD_LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds $(if $(CONFIG_PROFILING),,-s) + GCC_PLUGINS_CFLAGS := # Read KERNELRELEASE from include/config/kernel.release (if it exists) - KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) diff --git a/target/linux/generic/hack-4.9/207-disable-modorder.patch b/target/linux/generic/hack-4.9/207-disable-modorder.patch index 354052d8b4..d52ca36c1c 100644 --- a/target/linux/generic/hack-4.9/207-disable-modorder.patch +++ b/target/linux/generic/hack-4.9/207-disable-modorder.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -1196,7 +1196,6 @@ all: modules +@@ -1200,7 +1200,6 @@ all: modules PHONY += modules modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild -@@ -1226,7 +1225,6 @@ _modinst_: +@@ -1230,7 +1229,6 @@ _modinst_: rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ fi diff --git a/target/linux/generic/hack-4.9/214-spidev_h_portability.patch b/target/linux/generic/hack-4.9/214-spidev_h_portability.patch index 23914d633b..ad4706c821 100644 --- a/target/linux/generic/hack-4.9/214-spidev_h_portability.patch +++ b/target/linux/generic/hack-4.9/214-spidev_h_portability.patch @@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau --- a/include/uapi/linux/spi/spidev.h +++ b/include/uapi/linux/spi/spidev.h -@@ -111,7 +111,7 @@ struct spi_ioc_transfer { +@@ -112,7 +112,7 @@ struct spi_ioc_transfer { /* not all platforms use or _IOC_TYPECHECK() ... */ #define SPI_MSGSIZE(N) \ diff --git a/target/linux/generic/hack-4.9/220-gc_sections.patch b/target/linux/generic/hack-4.9/220-gc_sections.patch index eda8bb8b2b..e39f0f5f44 100644 --- a/target/linux/generic/hack-4.9/220-gc_sections.patch +++ b/target/linux/generic/hack-4.9/220-gc_sections.patch @@ -21,9 +21,9 @@ Signed-off-by: Gabor Juhos --- a/Makefile +++ b/Makefile -@@ -409,6 +409,11 @@ KBUILD_AFLAGS_MODULE := -DMODULE - KBUILD_CFLAGS_MODULE := -DMODULE +@@ -404,6 +404,11 @@ KBUILD_CFLAGS_MODULE := -DMODULE KBUILD_LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds $(if $(CONFIG_PROFILING),,-s) + GCC_PLUGINS_CFLAGS := +ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION +KBUILD_CFLAGS_KERNEL += $(call cc-option,-ffunction-sections,) @@ -33,7 +33,7 @@ Signed-off-by: Gabor Juhos # Read KERNELRELEASE from include/config/kernel.release (if it exists) KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) -@@ -633,11 +638,6 @@ KBUILD_CFLAGS += $(call cc-disable-warni +@@ -634,11 +639,6 @@ KBUILD_CFLAGS += $(call cc-disable-warni KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow) KBUILD_CFLAGS += $(call cc-disable-warning, int-in-bool-context) diff --git a/target/linux/generic/hack-4.9/301-mips_image_cmdline_hack.patch b/target/linux/generic/hack-4.9/301-mips_image_cmdline_hack.patch index a3df4fbe3a..7c3e38efcf 100644 --- a/target/linux/generic/hack-4.9/301-mips_image_cmdline_hack.patch +++ b/target/linux/generic/hack-4.9/301-mips_image_cmdline_hack.patch @@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -1150,6 +1150,10 @@ config SYNC_R4K +@@ -1155,6 +1155,10 @@ config SYNC_R4K config MIPS_MACHINE def_bool n diff --git a/target/linux/generic/hack-4.9/321-powerpc_crtsavres_prereq.patch b/target/linux/generic/hack-4.9/321-powerpc_crtsavres_prereq.patch index c22a4823fe..8c6ed8c207 100644 --- a/target/linux/generic/hack-4.9/321-powerpc_crtsavres_prereq.patch +++ b/target/linux/generic/hack-4.9/321-powerpc_crtsavres_prereq.patch @@ -16,7 +16,7 @@ Signed-off-by: Alexandros C. Couloumbis --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile -@@ -179,7 +179,6 @@ else +@@ -188,7 +188,6 @@ else CHECKFLAGS += -D__LITTLE_ENDIAN__ endif diff --git a/target/linux/generic/hack-4.9/660-fq_codel_defaults.patch b/target/linux/generic/hack-4.9/660-fq_codel_defaults.patch index c91ea01b50..3e6473056c 100644 --- a/target/linux/generic/hack-4.9/660-fq_codel_defaults.patch +++ b/target/linux/generic/hack-4.9/660-fq_codel_defaults.patch @@ -3,6 +3,9 @@ From: Felix Fietkau Date: Fri, 7 Jul 2017 17:21:53 +0200 Subject: hack: net: fq_codel: tune defaults for small devices +Assume that x86_64 devices always have a big memory and do not need this +optimization compared to devices with only 32 MB or 64 MB RAM. + Signed-off-by: Felix Fietkau --- net/sched/sch_fq_codel.c | 2 +- @@ -10,12 +13,15 @@ Signed-off-by: Felix Fietkau --- a/net/sched/sch_fq_codel.c +++ b/net/sched/sch_fq_codel.c -@@ -479,7 +479,7 @@ static int fq_codel_init(struct Qdisc *s +@@ -479,7 +479,11 @@ static int fq_codel_init(struct Qdisc *s sch->limit = 10*1024; q->flows_cnt = 1024; -- q->memory_limit = 32 << 20; /* 32 MBytes */ ++#ifdef CONFIG_X86_64 + q->memory_limit = 32 << 20; /* 32 MBytes */ ++#else + q->memory_limit = 4 << 20; /* 4 MBytes */ ++#endif q->drop_batch_size = 64; q->quantum = psched_mtu(qdisc_dev(sch)); q->perturbation = prandom_u32(); diff --git a/target/linux/generic/hack-4.9/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-4.9/661-use_fq_codel_by_default.patch index 4e7b4ad1d6..7a249e37f3 100644 --- a/target/linux/generic/hack-4.9/661-use_fq_codel_by_default.patch +++ b/target/linux/generic/hack-4.9/661-use_fq_codel_by_default.patch @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau device, it has to decide which ones to send first, which ones to --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c -@@ -1976,7 +1976,7 @@ static int __init pktsched_init(void) +@@ -1978,7 +1978,7 @@ static int __init pktsched_init(void) return err; } @@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau register_qdisc(&pfifo_head_drop_qdisc_ops); --- a/net/sched/sch_fq_codel.c +++ b/net/sched/sch_fq_codel.c -@@ -705,7 +705,7 @@ static const struct Qdisc_class_ops fq_c +@@ -709,7 +709,7 @@ static const struct Qdisc_class_ops fq_c .walk = fq_codel_walk, }; @@ -64,7 +64,7 @@ Signed-off-by: Felix Fietkau .cl_ops = &fq_codel_class_ops, .id = "fq_codel", .priv_size = sizeof(struct fq_codel_sched_data), -@@ -720,6 +720,7 @@ static struct Qdisc_ops fq_codel_qdisc_o +@@ -724,6 +724,7 @@ static struct Qdisc_ops fq_codel_qdisc_o .dump_stats = fq_codel_dump_stats, .owner = THIS_MODULE, }; diff --git a/target/linux/generic/hack-4.9/702-phy_add_aneg_done_function.patch b/target/linux/generic/hack-4.9/702-phy_add_aneg_done_function.patch index cf798bc200..8a2b51a4f7 100644 --- a/target/linux/generic/hack-4.9/702-phy_add_aneg_done_function.patch +++ b/target/linux/generic/hack-4.9/702-phy_add_aneg_done_function.patch @@ -1,6 +1,6 @@ --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -499,6 +499,12 @@ struct phy_driver { +@@ -495,6 +495,12 @@ struct phy_driver { /* Determines the negotiated speed and duplex */ int (*read_status)(struct phy_device *phydev); diff --git a/target/linux/generic/hack-4.9/710-phy-add-mdio_register_board_info.patch b/target/linux/generic/hack-4.9/710-phy-add-mdio_register_board_info.patch index 838c73789c..55607bc6ea 100644 --- a/target/linux/generic/hack-4.9/710-phy-add-mdio_register_board_info.patch +++ b/target/linux/generic/hack-4.9/710-phy-add-mdio_register_board_info.patch @@ -50,7 +50,7 @@ phy_device_free(phydev); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -863,6 +863,23 @@ void mdio_bus_exit(void); +@@ -859,6 +859,23 @@ void mdio_bus_exit(void); extern struct bus_type mdio_bus_type; diff --git a/target/linux/generic/hack-4.9/721-phy_packets.patch b/target/linux/generic/hack-4.9/721-phy_packets.patch index 0d47c7621b..b312ac7d41 100644 --- a/target/linux/generic/hack-4.9/721-phy_packets.patch +++ b/target/linux/generic/hack-4.9/721-phy_packets.patch @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -2942,10 +2942,20 @@ static int xmit_one(struct sk_buff *skb, +@@ -2943,10 +2943,20 @@ static int xmit_one(struct sk_buff *skb, if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all)) dev_queue_xmit_nit(skb, dev); diff --git a/target/linux/generic/hack-4.9/902-debloat_proc.patch b/target/linux/generic/hack-4.9/902-debloat_proc.patch index 6881d5faf4..6216c2d4fb 100644 --- a/target/linux/generic/hack-4.9/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.9/902-debloat_proc.patch @@ -63,7 +63,7 @@ Signed-off-by: Felix Fietkau } --- a/fs/proc/proc_tty.c +++ b/fs/proc/proc_tty.c -@@ -143,7 +143,10 @@ static const struct file_operations proc +@@ -144,7 +144,10 @@ static const struct file_operations proc void proc_tty_register_driver(struct tty_driver *driver) { struct proc_dir_entry *ent; @@ -75,7 +75,7 @@ Signed-off-by: Felix Fietkau if (!driver->driver_name || driver->proc_entry || !driver->ops->proc_fops) return; -@@ -160,6 +163,9 @@ void proc_tty_unregister_driver(struct t +@@ -161,6 +164,9 @@ void proc_tty_unregister_driver(struct t { struct proc_dir_entry *ent; @@ -85,7 +85,7 @@ Signed-off-by: Felix Fietkau ent = driver->proc_entry; if (!ent) return; -@@ -174,6 +180,9 @@ void proc_tty_unregister_driver(struct t +@@ -175,6 +181,9 @@ void proc_tty_unregister_driver(struct t */ void __init proc_tty_init(void) { @@ -243,7 +243,7 @@ Signed-off-by: Felix Fietkau } --- a/mm/vmstat.c +++ b/mm/vmstat.c -@@ -1791,10 +1791,12 @@ static int __init setup_vmstat(void) +@@ -1792,10 +1792,12 @@ static int __init setup_vmstat(void) cpu_notifier_register_done(); #endif #ifdef CONFIG_PROC_FS diff --git a/target/linux/generic/hack-4.9/904-debloat_dma_buf.patch b/target/linux/generic/hack-4.9/904-debloat_dma_buf.patch index b9a5c1dca2..4f432c3568 100644 --- a/target/linux/generic/hack-4.9/904-debloat_dma_buf.patch +++ b/target/linux/generic/hack-4.9/904-debloat_dma_buf.patch @@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau +MODULE_LICENSE("GPL"); --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2171,6 +2171,7 @@ int wake_up_state(struct task_struct *p, +@@ -2170,6 +2170,7 @@ int wake_up_state(struct task_struct *p, { return try_to_wake_up(p, state, 0); } diff --git a/target/linux/generic/pending-3.18/002-phy_drivers_backport.patch b/target/linux/generic/pending-3.18/002-phy_drivers_backport.patch index c97c759e7e..63071c9997 100644 --- a/target/linux/generic/pending-3.18/002-phy_drivers_backport.patch +++ b/target/linux/generic/pending-3.18/002-phy_drivers_backport.patch @@ -1,6 +1,6 @@ --- a/drivers/net/phy/adm6996.c +++ b/drivers/net/phy/adm6996.c -@@ -287,7 +287,7 @@ static u16 +@@ -289,7 +289,7 @@ static u16 adm6996_read_mii_reg(struct adm6996_priv *priv, enum admreg reg) { struct phy_device *phydev = priv->priv; @@ -9,7 +9,7 @@ return bus->read(bus, PHYADDR(reg)); } -@@ -296,7 +296,7 @@ static void +@@ -298,7 +298,7 @@ static void adm6996_write_mii_reg(struct adm6996_priv *priv, enum admreg reg, u16 val) { struct phy_device *phydev = priv->priv; @@ -18,7 +18,7 @@ bus->write(bus, PHYADDR(reg), val); } -@@ -1019,13 +1019,13 @@ static int adm6996_config_init(struct ph +@@ -1050,13 +1050,13 @@ static int adm6996_config_init(struct ph pdev->supported = ADVERTISED_100baseT_Full; pdev->advertising = ADVERTISED_100baseT_Full; @@ -35,7 +35,7 @@ if (!priv) return -ENOMEM; -@@ -1045,7 +1045,7 @@ static int adm6996_config_init(struct ph +@@ -1076,7 +1076,7 @@ static int adm6996_config_init(struct ph } /* @@ -44,7 +44,7 @@ */ static int adm6996_read_status(struct phy_device *phydev) { -@@ -1061,7 +1061,7 @@ static int adm6996_read_status(struct ph +@@ -1092,7 +1092,7 @@ static int adm6996_read_status(struct ph } /* @@ -53,7 +53,7 @@ */ static int adm6996_config_aneg(struct phy_device *phydev) { -@@ -1070,11 +1070,11 @@ static int adm6996_config_aneg(struct ph +@@ -1101,11 +1101,11 @@ static int adm6996_config_aneg(struct ph static int adm6996_fixup(struct phy_device *dev) { @@ -67,7 +67,7 @@ return 0; /* look for the switch on the bus */ -@@ -1121,6 +1121,7 @@ static struct phy_driver adm6996_phy_dri +@@ -1152,6 +1152,7 @@ static struct phy_driver adm6996_phy_dri .config_aneg = &adm6996_config_aneg, .read_status = &adm6996_read_status, .soft_reset = adm6996_soft_reset, @@ -75,7 +75,7 @@ }; static int adm6996_gpio_probe(struct platform_device *pdev) -@@ -1193,7 +1194,7 @@ static int __init adm6996_init(void) +@@ -1220,7 +1221,7 @@ static int __init adm6996_init(void) int err; phy_register_fixup_for_id(PHY_ANY_ID, adm6996_fixup); @@ -95,7 +95,7 @@ ret |= BMCR_ANENABLE | BMCR_ANRESTART; return phy_write(phydev, MII_BMCR, ret); } -@@ -1996,7 +1996,7 @@ ar8xxx_phy_config_init(struct phy_device +@@ -2007,7 +2007,7 @@ ar8xxx_phy_config_init(struct phy_device priv->phy = phydev; @@ -104,7 +104,7 @@ if (chip_is_ar8316(priv)) { /* switch device has been initialized, reinit */ priv->dev.ports = (AR8216_NUM_PORTS - 1); -@@ -2044,7 +2044,7 @@ ar8xxx_check_link_states(struct ar8xxx_p +@@ -2055,7 +2055,7 @@ ar8xxx_check_link_states(struct ar8xxx_p /* flush ARL entries for this port if it went down*/ if (!link_new) priv->chip->atu_flush_port(priv, i); @@ -113,7 +113,7 @@ i, link_new ? "up" : "down"); } -@@ -2063,10 +2063,10 @@ ar8xxx_phy_read_status(struct phy_device +@@ -2074,10 +2074,10 @@ ar8xxx_phy_read_status(struct phy_device if (phydev->state == PHY_CHANGELINK) ar8xxx_check_link_states(priv); @@ -126,7 +126,7 @@ phydev->link = !!link.link; if (!phydev->link) return 0; -@@ -2096,7 +2096,7 @@ ar8xxx_phy_read_status(struct phy_device +@@ -2107,7 +2107,7 @@ ar8xxx_phy_read_status(struct phy_device static int ar8xxx_phy_config_aneg(struct phy_device *phydev) { @@ -135,7 +135,7 @@ return 0; return genphy_config_aneg(phydev); -@@ -2151,15 +2151,15 @@ ar8xxx_phy_probe(struct phy_device *phyd +@@ -2162,15 +2162,15 @@ ar8xxx_phy_probe(struct phy_device *phyd int ret; /* skip PHYs at unused adresses */ @@ -154,7 +154,7 @@ goto found; priv = ar8xxx_create(); -@@ -2168,7 +2168,7 @@ ar8xxx_phy_probe(struct phy_device *phyd +@@ -2179,7 +2179,7 @@ ar8xxx_phy_probe(struct phy_device *phyd goto unlock; } @@ -163,7 +163,7 @@ ret = ar8xxx_probe_switch(priv); if (ret) -@@ -2189,7 +2189,7 @@ ar8xxx_phy_probe(struct phy_device *phyd +@@ -2200,7 +2200,7 @@ ar8xxx_phy_probe(struct phy_device *phyd found: priv->use_count++; @@ -172,7 +172,7 @@ if (ar8xxx_has_gige(priv)) { phydev->supported = SUPPORTED_1000baseT_Full; phydev->advertising = ADVERTISED_1000baseT_Full; -@@ -2277,21 +2277,33 @@ ar8xxx_phy_soft_reset(struct phy_device +@@ -2288,21 +2288,33 @@ ar8xxx_phy_soft_reset(struct phy_device return 0; } @@ -223,7 +223,7 @@ MODULE_LICENSE("GPL"); --- a/drivers/net/phy/ar8327.c +++ b/drivers/net/phy/ar8327.c -@@ -619,11 +619,11 @@ ar8327_hw_init(struct ar8xxx_priv *priv) +@@ -627,11 +627,11 @@ ar8327_hw_init(struct ar8xxx_priv *priv) if (!priv->chip_data) return -ENOMEM; @@ -363,7 +363,7 @@ } -@@ -392,13 +388,12 @@ mvswitch_probe(struct phy_device *pdev) +@@ -398,13 +394,12 @@ mvswitch_probe(struct phy_device *pdev) static int mvswitch_fixup(struct phy_device *dev) { @@ -379,9 +379,9 @@ if (reg != MV_IDENT_VALUE) return 0; -@@ -418,13 +413,14 @@ static struct phy_driver mvswitch_driver - .config_init = &mvswitch_config_init, +@@ -425,13 +420,14 @@ static struct phy_driver mvswitch_driver .config_aneg = &mvswitch_config_aneg, + .aneg_done = &mvswitch_aneg_done, .read_status = &mvswitch_read_status, + .driver = { .owner = THIS_MODULE,}, }; @@ -464,7 +464,7 @@ module_init(psb6970_init); --- a/drivers/net/phy/rtl8306.c +++ b/drivers/net/phy/rtl8306.c -@@ -872,7 +872,7 @@ rtl8306_config_init(struct phy_device *p +@@ -876,7 +876,7 @@ rtl8306_config_init(struct phy_device *p int err; /* Only init the switch for the primary PHY */ @@ -473,7 +473,7 @@ return 0; val.value.i = 1; -@@ -882,7 +882,7 @@ rtl8306_config_init(struct phy_device *p +@@ -886,7 +886,7 @@ rtl8306_config_init(struct phy_device *p priv->dev.ops = &rtl8306_ops; priv->do_cpu = 0; priv->page = -1; @@ -482,7 +482,7 @@ chipid = rtl_get(dev, RTL_REG_CHIPID); chipver = rtl_get(dev, RTL_REG_CHIPVER); -@@ -928,13 +928,13 @@ rtl8306_fixup(struct phy_device *pdev) +@@ -932,13 +932,13 @@ rtl8306_fixup(struct phy_device *pdev) u16 chipid; /* Attach to primary LAN port and WAN port */ @@ -498,7 +498,7 @@ chipid = rtl_get(&priv.dev, RTL_REG_CHIPID); if (chipid == 0x5988) pdev->phy_id = RTL8306_MAGIC; -@@ -952,14 +952,14 @@ rtl8306_probe(struct phy_device *pdev) +@@ -956,14 +956,14 @@ rtl8306_probe(struct phy_device *pdev) * share one rtl_priv instance between virtual phy * devices on the same bus */ @@ -515,7 +515,7 @@ found: pdev->priv = priv; -@@ -980,7 +980,7 @@ rtl8306_config_aneg(struct phy_device *p +@@ -984,7 +984,7 @@ rtl8306_config_aneg(struct phy_device *p struct rtl_priv *priv = pdev->priv; /* Only for WAN */ @@ -524,7 +524,7 @@ return 0; /* Restart autonegotiation */ -@@ -996,7 +996,7 @@ rtl8306_read_status(struct phy_device *p +@@ -1000,7 +1000,7 @@ rtl8306_read_status(struct phy_device *p struct rtl_priv *priv = pdev->priv; struct switch_dev *dev = &priv->dev; @@ -533,7 +533,7 @@ /* WAN */ pdev->speed = rtl_get(dev, RTL_PORT_REG(4, SPEED)) ? SPEED_100 : SPEED_10; pdev->duplex = rtl_get(dev, RTL_PORT_REG(4, DUPLEX)) ? DUPLEX_FULL : DUPLEX_HALF; -@@ -1037,6 +1037,7 @@ static struct phy_driver rtl8306_driver +@@ -1041,6 +1041,7 @@ static struct phy_driver rtl8306_driver .config_init = &rtl8306_config_init, .config_aneg = &rtl8306_config_aneg, .read_status = &rtl8306_read_status, @@ -541,7 +541,7 @@ }; -@@ -1044,7 +1045,7 @@ static int __init +@@ -1048,7 +1049,7 @@ static int __init rtl_init(void) { phy_register_fixup_for_id(PHY_ANY_ID, rtl8306_fixup); diff --git a/target/linux/generic/pending-3.18/041-mtd-bcm47xxpart-backports-from-3.20.patch b/target/linux/generic/pending-3.18/041-mtd-bcm47xxpart-backports-from-3.20.patch index 59180c2084..f3dfa901f1 100644 --- a/target/linux/generic/pending-3.18/041-mtd-bcm47xxpart-backports-from-3.20.patch +++ b/target/linux/generic/pending-3.18/041-mtd-bcm47xxpart-backports-from-3.20.patch @@ -83,7 +83,7 @@ offset + trx->offset[i], 0); i++; -@@ -205,7 +235,8 @@ static int bcm47xxpart_parse(struct mtd_ +@@ -203,7 +233,8 @@ static int bcm47xxpart_parse(struct mtd_ } /* Squashfs on devices not using TRX */ diff --git a/target/linux/generic/pending-3.18/044-backport-m25p80-jedec-probe.patch b/target/linux/generic/pending-3.18/044-backport-m25p80-jedec-probe.patch index 41b912d5d4..24c264ba97 100644 --- a/target/linux/generic/pending-3.18/044-backport-m25p80-jedec-probe.patch +++ b/target/linux/generic/pending-3.18/044-backport-m25p80-jedec-probe.patch @@ -24,7 +24,7 @@ .probe = m25p_probe, --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -927,8 +927,11 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -934,8 +934,11 @@ int spi_nor_scan(struct spi_nor *nor, co if (ret) return ret; diff --git a/target/linux/generic/pending-3.18/070-bgmac-register-napi-before-the-device.patch b/target/linux/generic/pending-3.18/070-bgmac-register-napi-before-the-device.patch index aa45860e93..0e7e4f8b12 100644 --- a/target/linux/generic/pending-3.18/070-bgmac-register-napi-before-the-device.patch +++ b/target/linux/generic/pending-3.18/070-bgmac-register-napi-before-the-device.patch @@ -13,7 +13,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/broadcom/bgmac.c +++ b/drivers/net/ethernet/broadcom/bgmac.c -@@ -1515,6 +1515,8 @@ static int bgmac_probe(struct bcma_devic +@@ -1521,6 +1521,8 @@ static int bgmac_probe(struct bcma_devic if (core->bus->sprom.boardflags_lo & BGMAC_BFL_ENETADM) bgmac_warn(bgmac, "Support for ADMtek ethernet switch not implemented\n"); @@ -22,7 +22,7 @@ Signed-off-by: David S. Miller err = bgmac_mii_register(bgmac); if (err) { bgmac_err(bgmac, "Cannot register MDIO\n"); -@@ -1529,8 +1531,6 @@ static int bgmac_probe(struct bcma_devic +@@ -1535,8 +1537,6 @@ static int bgmac_probe(struct bcma_devic netif_carrier_off(net_dev); @@ -31,7 +31,7 @@ Signed-off-by: David S. Miller return 0; err_mii_unregister: -@@ -1549,9 +1549,9 @@ static void bgmac_remove(struct bcma_dev +@@ -1555,9 +1555,9 @@ static void bgmac_remove(struct bcma_dev { struct bgmac *bgmac = bcma_get_drvdata(core); diff --git a/target/linux/generic/pending-3.18/072-bgmac-fix-device-initialization-on-Northstar-SoCs-co.patch b/target/linux/generic/pending-3.18/072-bgmac-fix-device-initialization-on-Northstar-SoCs-co.patch deleted file mode 100644 index 121d2f4122..0000000000 --- a/target/linux/generic/pending-3.18/072-bgmac-fix-device-initialization-on-Northstar-SoCs-co.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 21697336d46b71dd031f29e426dda0b1e7f06cc0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Wed, 11 Feb 2015 18:06:34 +0100 -Subject: [PATCH] bgmac: fix device initialization on Northstar SoCs (condition - typo) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -On Northstar (Broadcom's ARM architecture) we need to manually enable -all cores. Code for that is already in place, but the condition for it -was wrong. - -Signed-off-by: Rafał Miłecki -Signed-off-by: David S. Miller ---- - drivers/net/ethernet/broadcom/bgmac.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - ---- a/drivers/net/ethernet/broadcom/bgmac.c -+++ b/drivers/net/ethernet/broadcom/bgmac.c -@@ -1412,6 +1412,7 @@ static void bgmac_mii_unregister(struct - /* http://bcm-v4.sipsolutions.net/mac-gbit/gmac/chipattach */ - static int bgmac_probe(struct bcma_device *core) - { -+ struct bcma_chipinfo *ci = &core->bus->chipinfo; - struct net_device *net_dev; - struct bgmac *bgmac; - struct ssb_sprom *sprom = &core->bus->sprom; -@@ -1474,8 +1475,8 @@ static int bgmac_probe(struct bcma_devic - bgmac_chip_reset(bgmac); - - /* For Northstar, we have to take all GMAC core out of reset */ -- if (core->id.id == BCMA_CHIP_ID_BCM4707 || -- core->id.id == BCMA_CHIP_ID_BCM53018) { -+ if (ci->id == BCMA_CHIP_ID_BCM4707 || -+ ci->id == BCMA_CHIP_ID_BCM53018) { - struct bcma_device *ns_core; - int ns_gmac; - diff --git a/target/linux/generic/pending-3.18/077-03-bgmac-implement-scatter-gather-support.patch b/target/linux/generic/pending-3.18/077-03-bgmac-implement-scatter-gather-support.patch index ceb25e85ad..642dd2ad73 100644 --- a/target/linux/generic/pending-3.18/077-03-bgmac-implement-scatter-gather-support.patch +++ b/target/linux/generic/pending-3.18/077-03-bgmac-implement-scatter-gather-support.patch @@ -254,7 +254,7 @@ Signed-off-by: Felix Fietkau } } -@@ -1583,6 +1657,10 @@ static int bgmac_probe(struct bcma_devic +@@ -1588,6 +1662,10 @@ static int bgmac_probe(struct bcma_devic goto err_dma_free; } diff --git a/target/linux/generic/pending-3.18/078-bgmac-reset-enable-Ethernet-core-before-using-it.patch b/target/linux/generic/pending-3.18/078-bgmac-reset-enable-Ethernet-core-before-using-it.patch index ca061a50d1..a4c7876d7f 100644 --- a/target/linux/generic/pending-3.18/078-bgmac-reset-enable-Ethernet-core-before-using-it.patch +++ b/target/linux/generic/pending-3.18/078-bgmac-reset-enable-Ethernet-core-before-using-it.patch @@ -17,9 +17,9 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/broadcom/bgmac.c +++ b/drivers/net/ethernet/broadcom/bgmac.c -@@ -1564,6 +1564,11 @@ static int bgmac_probe(struct bcma_devic - dev_warn(&core->dev, "Using random MAC: %pM\n", mac); - } +@@ -1569,6 +1569,11 @@ static int bgmac_probe(struct bcma_devic + */ + bcma_core_enable(core, 0); + /* This (reset &) enable is not preset in specs or reference driver but + * Broadcom does it in arch PCI code when enabling fake PCI device. diff --git a/target/linux/generic/pending-3.18/080-11-fib_trie-Push-rcu_read_lock-unlock-to-callers.patch b/target/linux/generic/pending-3.18/080-11-fib_trie-Push-rcu_read_lock-unlock-to-callers.patch index fe55323a50..29bec8387d 100644 --- a/target/linux/generic/pending-3.18/080-11-fib_trie-Push-rcu_read_lock-unlock-to-callers.patch +++ b/target/linux/generic/pending-3.18/080-11-fib_trie-Push-rcu_read_lock-unlock-to-callers.patch @@ -172,7 +172,7 @@ Signed-off-by: David S. Miller u32 portid; net = sock_net(skb->sk); -@@ -971,9 +976,7 @@ static void nl_fib_input(struct sk_buff +@@ -972,9 +977,7 @@ static void nl_fib_input(struct sk_buff nlh = nlmsg_hdr(skb); frn = (struct fib_result_nl *) nlmsg_data(nlh); diff --git a/target/linux/generic/pending-3.18/082-ipv6-ip6_fragment-fix-headroom-tests-and-skb-leak.patch b/target/linux/generic/pending-3.18/082-ipv6-ip6_fragment-fix-headroom-tests-and-skb-leak.patch index d3da41e918..9f39e5ba5e 100644 --- a/target/linux/generic/pending-3.18/082-ipv6-ip6_fragment-fix-headroom-tests-and-skb-leak.patch +++ b/target/linux/generic/pending-3.18/082-ipv6-ip6_fragment-fix-headroom-tests-and-skb-leak.patch @@ -44,7 +44,7 @@ Closes 20532 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c -@@ -597,20 +597,22 @@ int ip6_fragment(struct sk_buff *skb, in +@@ -600,20 +600,22 @@ int ip6_fragment(struct sk_buff *skb, in } mtu -= hlen + sizeof(struct frag_hdr); @@ -69,7 +69,7 @@ Closes 20532 goto slow_path_clean; /* Partially cloned skb? */ -@@ -627,8 +629,6 @@ int ip6_fragment(struct sk_buff *skb, in +@@ -630,8 +632,6 @@ int ip6_fragment(struct sk_buff *skb, in err = 0; offset = 0; @@ -78,7 +78,7 @@ Closes 20532 /* BUILD HEADER */ *prevhdr = NEXTHDR_FRAGMENT; -@@ -636,8 +636,11 @@ int ip6_fragment(struct sk_buff *skb, in +@@ -639,8 +639,11 @@ int ip6_fragment(struct sk_buff *skb, in if (!tmp_hdr) { IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_FRAGFAILS); @@ -91,7 +91,7 @@ Closes 20532 __skb_pull(skb, hlen); fh = (struct frag_hdr *)__skb_push(skb, sizeof(struct frag_hdr)); -@@ -735,7 +738,6 @@ slow_path: +@@ -738,7 +741,6 @@ slow_path: */ *prevhdr = NEXTHDR_FRAGMENT; diff --git a/target/linux/generic/pending-3.18/090-overlayfs-fallback-to-readonly-when-full.patch b/target/linux/generic/pending-3.18/090-overlayfs-fallback-to-readonly-when-full.patch index c75af99c60..6c26a47c5f 100644 --- a/target/linux/generic/pending-3.18/090-overlayfs-fallback-to-readonly-when-full.patch +++ b/target/linux/generic/pending-3.18/090-overlayfs-fallback-to-readonly-when-full.patch @@ -44,7 +44,7 @@ Miklos --- a/fs/overlayfs/copy_up.c +++ b/fs/overlayfs/copy_up.c -@@ -313,6 +313,9 @@ int ovl_copy_up_one(struct dentry *paren +@@ -315,6 +315,9 @@ int ovl_copy_up_one(struct dentry *paren struct cred *override_cred; char *link = NULL; diff --git a/target/linux/generic/pending-3.18/097-mm-remove-gup_flags-FOLL_WRITE-games-from-__get_user.patch b/target/linux/generic/pending-3.18/097-mm-remove-gup_flags-FOLL_WRITE-games-from-__get_user.patch deleted file mode 100644 index 213f85b0a9..0000000000 --- a/target/linux/generic/pending-3.18/097-mm-remove-gup_flags-FOLL_WRITE-games-from-__get_user.patch +++ /dev/null @@ -1,90 +0,0 @@ -From e45a502bdeae5a075257c4f061d1ff4ff0821354 Mon Sep 17 00:00:00 2001 -From: Linus Torvalds -Date: Thu, 13 Oct 2016 13:07:36 -0700 -Subject: [PATCH] mm: remove gup_flags FOLL_WRITE games from __get_user_pages() - -[ Upstream commit 19be0eaffa3ac7d8eb6784ad9bdbc7d67ed8e619 ] - -This is an ancient bug that was actually attempted to be fixed once -(badly) by me eleven years ago in commit 4ceb5db9757a ("Fix -get_user_pages() race for write access") but that was then undone due to -problems on s390 by commit f33ea7f404e5 ("fix get_user_pages bug"). - -In the meantime, the s390 situation has long been fixed, and we can now -fix it by checking the pte_dirty() bit properly (and do it better). The -s390 dirty bit was implemented in abf09bed3cce ("s390/mm: implement -software dirty bits") which made it into v3.9. Earlier kernels will -have to look at the page state itself. - -Also, the VM has become more scalable, and what used a purely -theoretical race back then has become easier to trigger. - -To fix it, we introduce a new internal FOLL_COW flag to mark the "yes, -we already did a COW" rather than play racy games with FOLL_WRITE that -is very fundamental, and then use the pte dirty flag to validate that -the FOLL_COW flag is still valid. - -Reported-and-tested-by: Phil "not Paul" Oester -Acked-by: Hugh Dickins -Reviewed-by: Michal Hocko -Cc: Andy Lutomirski -Cc: Kees Cook -Cc: Oleg Nesterov -Cc: Willy Tarreau -Cc: Nick Piggin -Cc: Greg Thelen -Cc: stable@vger.kernel.org -Signed-off-by: Linus Torvalds -Signed-off-by: Sasha Levin ---- - include/linux/mm.h | 1 + - mm/gup.c | 14 ++++++++++++-- - 2 files changed, 13 insertions(+), 2 deletions(-) - ---- a/include/linux/mm.h -+++ b/include/linux/mm.h -@@ -2029,6 +2029,7 @@ static inline struct page *follow_page(s - #define FOLL_NUMA 0x200 /* force NUMA hinting page fault */ - #define FOLL_MIGRATION 0x400 /* wait for page to replace migration entry */ - #define FOLL_TRIED 0x800 /* a retry, previous pass started an IO */ -+#define FOLL_COW 0x4000 /* internal GUP flag */ - - typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, - void *data); ---- a/mm/gup.c -+++ b/mm/gup.c -@@ -32,6 +32,16 @@ static struct page *no_page_table(struct - return NULL; - } - -+/* -+ * FOLL_FORCE can write to even unwritable pte's, but only -+ * after we've gone through a COW cycle and they are dirty. -+ */ -+static inline bool can_follow_write_pte(pte_t pte, unsigned int flags) -+{ -+ return pte_write(pte) || -+ ((flags & FOLL_FORCE) && (flags & FOLL_COW) && pte_dirty(pte)); -+} -+ - static struct page *follow_page_pte(struct vm_area_struct *vma, - unsigned long address, pmd_t *pmd, unsigned int flags) - { -@@ -66,7 +76,7 @@ retry: - } - if ((flags & FOLL_NUMA) && pte_numa(pte)) - goto no_page; -- if ((flags & FOLL_WRITE) && !pte_write(pte)) { -+ if ((flags & FOLL_WRITE) && !can_follow_write_pte(pte, flags)) { - pte_unmap_unlock(ptep, ptl); - return NULL; - } -@@ -315,7 +325,7 @@ static int faultin_page(struct task_stru - * reCOWed by userspace write). - */ - if ((ret & VM_FAULT_WRITE) && !(vma->vm_flags & VM_WRITE)) -- *flags &= ~FOLL_WRITE; -+ *flags |= FOLL_COW; - return 0; - } - diff --git a/target/linux/generic/pending-3.18/133-MIPS-UAPI-Ignore-__arch_swab-16-32-64-when-using-MIP.patch b/target/linux/generic/pending-3.18/133-MIPS-UAPI-Ignore-__arch_swab-16-32-64-when-using-MIP.patch deleted file mode 100644 index ebbe1bbaee..0000000000 --- a/target/linux/generic/pending-3.18/133-MIPS-UAPI-Ignore-__arch_swab-16-32-64-when-using-MIP.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 71a0a72456b48de972d7ed613b06a22a3aa9057f Mon Sep 17 00:00:00 2001 -From: Yousong Zhou -Date: Sat, 26 Sep 2015 13:41:43 +0800 -Subject: [PATCH] MIPS: UAPI: Ignore __arch_swab{16,32,64} when using MIPS16 - -Some GCC versions (e.g. 4.8.3) can incorrectly inline a function with -MIPS32 instructions into another function with MIPS16 code [1], causing -the assembler to genereate incorrect binary code or fail right away -complaining about unrecognized opcode. - -In the case of __arch_swab{16,32}, when inlined by the compiler with -flags `-mips32r2 -mips16 -Os', the assembler can fail with the following -error. - - {standard input}:79: Error: unrecognized opcode `wsbh $2,$2' - -For performance concerns and to workaround the issue already existing in -older compilers, just ignore these 2 functions when compiling with -mips16 enabled. - - [1] Inlining nomips16 function into mips16 function can result in - undefined builtins, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55777 - -Signed-off-by: Yousong Zhou -Cc: Maciej W. Rozycki -Cc: linux-mips@linux-mips.org -Patchwork: https://patchwork.linux-mips.org/patch/11241/ -Signed-off-by: Ralf Baechle ---- - arch/mips/include/uapi/asm/swab.h | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - ---- a/arch/mips/include/uapi/asm/swab.h -+++ b/arch/mips/include/uapi/asm/swab.h -@@ -13,8 +13,9 @@ - - #define __SWAB_64_THRU_32__ - --#if (defined(__mips_isa_rev) && (__mips_isa_rev >= 2)) || \ -- defined(_MIPS_ARCH_LOONGSON3A) -+#if !defined(__mips16) && \ -+ ((defined(__mips_isa_rev) && (__mips_isa_rev >= 2)) || \ -+ defined(_MIPS_ARCH_LOONGSON3A)) - - static inline __attribute_const__ __u16 __arch_swab16(__u16 x) - { -@@ -65,5 +66,5 @@ static inline __attribute_const__ __u64 - } - #define __arch_swab64 __arch_swab64 - #endif /* __mips64 */ --#endif /* MIPS R2 or newer or Loongson 3A */ -+#endif /* (not __mips16) and (MIPS R2 or newer or Loongson 3A) */ - #endif /* _ASM_SWAB_H */ diff --git a/target/linux/generic/pending-3.18/141-mtd-bcm47xxpart-limit-scanned-flash-area-on-BCM47XX-.patch b/target/linux/generic/pending-3.18/141-mtd-bcm47xxpart-limit-scanned-flash-area-on-BCM47XX-.patch deleted file mode 100644 index 761cff316d..0000000000 --- a/target/linux/generic/pending-3.18/141-mtd-bcm47xxpart-limit-scanned-flash-area-on-BCM47XX-.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Sat, 5 Dec 2015 02:03:32 +0100 -Subject: [PATCH] mtd: bcm47xxpart: limit scanned flash area on BCM47XX (MIPS) - only -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -We allowed using bcm47xxpart on BCM5301X arch with commit: -9e3afa5f5c7 ("mtd: bcm47xxpart: allow enabling on ARCH_BCM_5301X") - -BCM5301X devices may contain some partitions in higher memory, e.g. -Netgear R8000 has board_data at 0x2600000. To detect them we should -use size limit on MIPS only. - -Signed-off-by: Rafał Miłecki ---- - drivers/mtd/bcm47xxpart.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/mtd/bcm47xxpart.c -+++ b/drivers/mtd/bcm47xxpart.c -@@ -118,8 +118,8 @@ static int bcm47xxpart_parse(struct mtd_ - /* Parse block by block looking for magics */ - for (offset = 0; offset <= master->size - blocksize; - offset += blocksize) { -- /* Nothing more in higher memory */ -- if (offset >= 0x2000000) -+ /* Nothing more in higher memory on BCM47XX (MIPS) */ -+ if (config_enabled(CONFIG_BCM47XX) && offset >= 0x2000000) - break; - - if (curr_part >= BCM47XXPART_MAX_PARTS) { diff --git a/target/linux/generic/pending-3.18/142-mtd-bcm47xxpart-don-t-fail-because-of-bit-flips.patch b/target/linux/generic/pending-3.18/142-mtd-bcm47xxpart-don-t-fail-because-of-bit-flips.patch index 9073f795e2..926de5fef7 100644 --- a/target/linux/generic/pending-3.18/142-mtd-bcm47xxpart-don-t-fail-because-of-bit-flips.patch +++ b/target/linux/generic/pending-3.18/142-mtd-bcm47xxpart-don-t-fail-because-of-bit-flips.patch @@ -58,7 +58,7 @@ Signed-off-by: Rafał Miłecki continue; } -@@ -254,10 +258,11 @@ static int bcm47xxpart_parse(struct mtd_ +@@ -252,10 +256,11 @@ static int bcm47xxpart_parse(struct mtd_ } /* Read middle of the block */ @@ -74,7 +74,7 @@ Signed-off-by: Rafał Miłecki continue; } -@@ -277,10 +282,11 @@ static int bcm47xxpart_parse(struct mtd_ +@@ -275,10 +280,11 @@ static int bcm47xxpart_parse(struct mtd_ } offset = master->size - possible_nvram_sizes[i]; diff --git a/target/linux/generic/pending-3.18/190-cdc_ncm_add_support_for_moving_ndp_to_end_of_ncm_frame.patch b/target/linux/generic/pending-3.18/190-cdc_ncm_add_support_for_moving_ndp_to_end_of_ncm_frame.patch index 0b03963f0a..632384d56f 100644 --- a/target/linux/generic/pending-3.18/190-cdc_ncm_add_support_for_moving_ndp_to_end_of_ncm_frame.patch +++ b/target/linux/generic/pending-3.18/190-cdc_ncm_add_support_for_moving_ndp_to_end_of_ncm_frame.patch @@ -79,21 +79,21 @@ Signed-off-by: David S. Miller /* override ethtool_ops */ dev->net->ethtool_ops = &cdc_ncm_ethtool_ops; -@@ -958,8 +971,11 @@ static int cdc_ncm_bind(struct usbnet *d +@@ -956,8 +969,11 @@ static int cdc_ncm_bind(struct usbnet *d if (cdc_ncm_select_altsetting(intf) != CDC_NCM_COMM_ALTSETTING_NCM) return -ENODEV; - /* The NCM data altsetting is fixed */ -- ret = cdc_ncm_bind_common(dev, intf, CDC_NCM_DATA_ALTSETTING_NCM); +- return cdc_ncm_bind_common(dev, intf, CDC_NCM_DATA_ALTSETTING_NCM); + /* The NCM data altsetting is fixed, so we hard-coded it. + * Additionally, generic NCM devices are assumed to accept arbitrarily + * placed NDP. + */ -+ ret = cdc_ncm_bind_common(dev, intf, CDC_NCM_DATA_ALTSETTING_NCM, 0); ++ return cdc_ncm_bind_common(dev, intf, CDC_NCM_DATA_ALTSETTING_NCM, 0); + } - /* - * We should get an event when network connection is "connected" or -@@ -990,6 +1006,14 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm + static void cdc_ncm_align_tail(struct sk_buff *skb, size_t modulus, size_t remainder, size_t max) +@@ -979,6 +995,14 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm struct usb_cdc_ncm_nth16 *nth16 = (void *)skb->data; size_t ndpoffset = le16_to_cpu(nth16->wNdpIndex); @@ -108,7 +108,7 @@ Signed-off-by: David S. Miller /* follow the chain of NDPs, looking for a match */ while (ndpoffset) { ndp16 = (struct usb_cdc_ncm_ndp16 *)(skb->data + ndpoffset); -@@ -999,7 +1023,8 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm +@@ -988,7 +1012,8 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm } /* align new NDP */ @@ -118,7 +118,7 @@ Signed-off-by: David S. Miller /* verify that there is room for the NDP and the datagram (reserve) */ if ((ctx->tx_max - skb->len - reserve) < ctx->max_ndp_size) -@@ -1012,7 +1037,11 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm +@@ -1001,7 +1026,11 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm nth16->wNdpIndex = cpu_to_le16(skb->len); /* push a new empty NDP */ @@ -131,7 +131,7 @@ Signed-off-by: David S. Miller ndp16->dwSignature = sign; ndp16->wLength = cpu_to_le16(sizeof(struct usb_cdc_ncm_ndp16) + sizeof(struct usb_cdc_ncm_dpe16)); return ndp16; -@@ -1027,6 +1056,15 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev +@@ -1016,6 +1045,15 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev struct sk_buff *skb_out; u16 n = 0, index, ndplen; u8 ready2send = 0; @@ -147,7 +147,7 @@ Signed-off-by: David S. Miller /* if there is a remaining skb, it gets priority */ if (skb != NULL) { -@@ -1081,7 +1119,7 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev +@@ -1070,7 +1108,7 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev cdc_ncm_align_tail(skb_out, ctx->tx_modulus, ctx->tx_remainder, ctx->tx_max); /* check if we had enough room left for both NDP and frame */ @@ -156,7 +156,7 @@ Signed-off-by: David S. Miller if (n == 0) { /* won't fit, MTU problem? */ dev_kfree_skb_any(skb); -@@ -1154,6 +1192,17 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev +@@ -1143,6 +1181,17 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev /* variables will be reset at next call */ } diff --git a/target/linux/generic/pending-3.18/191-usb-ehci-orion-fix-probe-for-GENERIC_PHY.patch b/target/linux/generic/pending-3.18/191-usb-ehci-orion-fix-probe-for-GENERIC_PHY.patch deleted file mode 100644 index 5a3dc06c14..0000000000 --- a/target/linux/generic/pending-3.18/191-usb-ehci-orion-fix-probe-for-GENERIC_PHY.patch +++ /dev/null @@ -1,35 +0,0 @@ -From a95f03e51471dbdbafd3391991d867ac2358ed02 Mon Sep 17 00:00:00 2001 -From: Jonas Gorski -Date: Sun, 23 Aug 2015 14:23:29 +0200 -Subject: [PATCH] usb: ehci-orion: fix probe for !GENERIC_PHY - -Commit d445913ce0ab7f ("usb: ehci-orion: add optional PHY support") -added support for optional phys, but devm_phy_optional_get returns --ENOSYS if GENERIC_PHY is not enabled. - -This causes probe failures, even when there are no phys specified: - -[ 1.443365] orion-ehci f1058000.usb: init f1058000.usb fail, -38 -[ 1.449403] orion-ehci: probe of f1058000.usb failed with error -38 - -Similar to dwc3, treat -ENOSYS as no phy. - -Fixes: d445913ce0ab7f ("usb: ehci-orion: add optional PHY support") - -Signed-off-by: Jonas Gorski ---- - drivers/usb/host/ehci-orion.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/usb/host/ehci-orion.c -+++ b/drivers/usb/host/ehci-orion.c -@@ -226,7 +226,8 @@ static int ehci_orion_drv_probe(struct p - priv->phy = devm_phy_optional_get(&pdev->dev, "usb"); - if (IS_ERR(priv->phy)) { - err = PTR_ERR(priv->phy); -- goto err_phy_get; -+ if (err != -ENOSYS) -+ goto err_phy_get; - } else { - err = phy_init(priv->phy); - if (err) diff --git a/target/linux/generic/pending-3.18/192-USB-qcserial-Add-support-for-Quectel-EC20-Mini-PCIe-.patch b/target/linux/generic/pending-3.18/192-USB-qcserial-Add-support-for-Quectel-EC20-Mini-PCIe-.patch index 7c49a6f111..ae018cbab0 100644 --- a/target/linux/generic/pending-3.18/192-USB-qcserial-Add-support-for-Quectel-EC20-Mini-PCIe-.patch +++ b/target/linux/generic/pending-3.18/192-USB-qcserial-Add-support-for-Quectel-EC20-Mini-PCIe-.patch @@ -61,7 +61,7 @@ Signed-off-by: Petr Štetiar /* standard device layouts supported by this driver */ enum qcserial_layouts { QCSERIAL_G2K = 0, /* Gobi 2000 */ -@@ -171,6 +173,38 @@ static const struct usb_device_id id_tab +@@ -176,6 +178,38 @@ static const struct usb_device_id id_tab }; MODULE_DEVICE_TABLE(usb, id_table); @@ -100,7 +100,7 @@ Signed-off-by: Petr Štetiar static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) { struct usb_host_interface *intf = serial->interface->cur_altsetting; -@@ -239,6 +273,11 @@ static int qcprobe(struct usb_serial *se +@@ -244,6 +278,11 @@ static int qcprobe(struct usb_serial *se altsetting = -1; break; case QCSERIAL_G2K: diff --git a/target/linux/generic/pending-3.18/193-USB-qmi_wwan-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch b/target/linux/generic/pending-3.18/193-USB-qmi_wwan-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch index 1b1afd5d31..ee0d7b2ccc 100644 --- a/target/linux/generic/pending-3.18/193-USB-qmi_wwan-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch +++ b/target/linux/generic/pending-3.18/193-USB-qmi_wwan-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch @@ -48,7 +48,7 @@ Signed-off-by: Petr Štetiar --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c -@@ -822,6 +822,7 @@ static const struct usb_device_id produc +@@ -825,6 +825,7 @@ static const struct usb_device_id produc {QMI_GOBI_DEVICE(0x05c6, 0x9245)}, /* Samsung Gobi 2000 Modem device (VL176) */ {QMI_GOBI_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */ {QMI_GOBI_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */ @@ -56,7 +56,7 @@ Signed-off-by: Petr Štetiar {QMI_GOBI_DEVICE(0x05c6, 0x9265)}, /* Asus Gobi 2000 Modem device (VR305) */ {QMI_GOBI_DEVICE(0x05c6, 0x9235)}, /* Top Global Gobi 2000 Modem device (VR306) */ {QMI_GOBI_DEVICE(0x05c6, 0x9275)}, /* iRex Technologies Gobi 2000 Modem device (VR307) */ -@@ -853,10 +854,24 @@ static const struct usb_device_id produc +@@ -856,10 +857,24 @@ static const struct usb_device_id produc }; MODULE_DEVICE_TABLE(usb, products); @@ -81,7 +81,7 @@ Signed-off-by: Petr Štetiar /* Workaround to enable dynamic IDs. This disables usbnet * blacklisting functionality. Which, if required, can be -@@ -868,6 +883,12 @@ static int qmi_wwan_probe(struct usb_int +@@ -871,6 +886,12 @@ static int qmi_wwan_probe(struct usb_int id->driver_info = (unsigned long)&qmi_wwan_info; } diff --git a/target/linux/generic/pending-3.18/201-extra_optimization.patch b/target/linux/generic/pending-3.18/201-extra_optimization.patch index 7ec93a47f4..5a2396cfa3 100644 --- a/target/linux/generic/pending-3.18/201-extra_optimization.patch +++ b/target/linux/generic/pending-3.18/201-extra_optimization.patch @@ -1,7 +1,7 @@ --- a/Makefile +++ b/Makefile -@@ -612,9 +612,9 @@ include $(srctree)/arch/$(SRCARCH)/Makef - KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) +@@ -618,9 +618,9 @@ KBUILD_CFLAGS += $(call cc-option,-fno-P + KBUILD_AFLAGS += $(call cc-option,-fno-PIE) ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE -KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) diff --git a/target/linux/generic/pending-3.18/204-module_strip.patch b/target/linux/generic/pending-3.18/204-module_strip.patch index 844c3b550e..2df7ba0134 100644 --- a/target/linux/generic/pending-3.18/204-module_strip.patch +++ b/target/linux/generic/pending-3.18/204-module_strip.patch @@ -28,8 +28,8 @@ Signed-off-by: Felix Fietkau +#if defined(MODULE) && !defined(CONFIG_MODULE_STRIPPED) /* Creates an alias so file2alias.c can find device table. */ #define MODULE_DEVICE_TABLE(type, name) \ - extern const struct type##_device_id __mod_##type##__##name##_device_table \ -@@ -159,7 +160,9 @@ void trim_init_extable(struct module *m) + extern const typeof(name) __mod_##type##__##name##_device_table \ +@@ -159,7 +160,9 @@ extern const typeof(name) __mod_##type## */ #if defined(MODULE) || !defined(CONFIG_SYSFS) @@ -40,7 +40,7 @@ Signed-off-by: Felix Fietkau #else #define MODULE_VERSION(_version) \ static struct module_version_attribute ___modver_attr = { \ -@@ -181,7 +184,7 @@ void trim_init_extable(struct module *m) +@@ -181,7 +184,7 @@ extern const typeof(name) __mod_##type## /* Optional firmware file (or files) needed by the module * format is simply firmware file name. Multiple firmware * files require multiple MODULE_FIRMWARE() specifiers */ @@ -123,7 +123,7 @@ Signed-off-by: Felix Fietkau set_license(mod, get_modinfo(info, "license")); --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c -@@ -1726,7 +1726,9 @@ static void read_symbols(char *modname) +@@ -1758,7 +1758,9 @@ static void read_symbols(char *modname) symname = remove_dot(info.strtab + sym->st_name); handle_modversions(mod, &info, sym, symname); @@ -133,7 +133,7 @@ Signed-off-by: Felix Fietkau } if (!is_vmlinux(modname) || (is_vmlinux(modname) && vmlinux_section_warnings)) -@@ -1870,7 +1872,9 @@ static void add_header(struct buffer *b, +@@ -1902,7 +1904,9 @@ static void add_header(struct buffer *b, buf_printf(b, "#include \n"); buf_printf(b, "#include \n"); buf_printf(b, "\n"); @@ -143,7 +143,7 @@ Signed-off-by: Felix Fietkau buf_printf(b, "\n"); buf_printf(b, "__visible struct module __this_module\n"); buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n"); -@@ -1887,16 +1891,20 @@ static void add_header(struct buffer *b, +@@ -1919,16 +1923,20 @@ static void add_header(struct buffer *b, static void add_intree_flag(struct buffer *b, int is_intree) { @@ -164,7 +164,7 @@ Signed-off-by: Felix Fietkau } /** -@@ -1989,11 +1997,13 @@ static void add_depends(struct buffer *b +@@ -2021,11 +2029,13 @@ static void add_depends(struct buffer *b static void add_srcversion(struct buffer *b, struct module *mod) { @@ -178,7 +178,7 @@ Signed-off-by: Felix Fietkau } static void write_if_changed(struct buffer *b, const char *fname) -@@ -2224,7 +2234,9 @@ int main(int argc, char **argv) +@@ -2256,7 +2266,9 @@ int main(int argc, char **argv) add_staging_flag(&buf, mod->name); err |= add_versions(&buf, mod); add_depends(&buf, mod, modules); diff --git a/target/linux/generic/pending-3.18/550-ubifs-symlink-xattr-support.patch b/target/linux/generic/pending-3.18/550-ubifs-symlink-xattr-support.patch index 42ae9cb84a..6e08ca302e 100644 --- a/target/linux/generic/pending-3.18/550-ubifs-symlink-xattr-support.patch +++ b/target/linux/generic/pending-3.18/550-ubifs-symlink-xattr-support.patch @@ -39,7 +39,7 @@ --- a/fs/ubifs/xattr.c +++ b/fs/ubifs/xattr.c -@@ -209,12 +209,12 @@ static int change_xattr(struct ubifs_inf +@@ -210,12 +210,12 @@ static int change_xattr(struct ubifs_inf goto out_free; } inode->i_size = ui->ui_size = size; diff --git a/target/linux/generic/pending-3.18/630-packet_socket_type.patch b/target/linux/generic/pending-3.18/630-packet_socket_type.patch index 61ddea84c6..ec7383e114 100644 --- a/target/linux/generic/pending-3.18/630-packet_socket_type.patch +++ b/target/linux/generic/pending-3.18/630-packet_socket_type.patch @@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau #define PACKET_FANOUT_LB 1 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c -@@ -1530,6 +1530,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1529,6 +1529,7 @@ static int packet_rcv_spkt(struct sk_buf { struct sock *sk; struct sockaddr_pkt *spkt; @@ -34,7 +34,7 @@ Signed-off-by: Felix Fietkau /* * When we registered the protocol we saved the socket in the data -@@ -1537,6 +1538,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1536,6 +1537,7 @@ static int packet_rcv_spkt(struct sk_buf */ sk = pt->af_packet_priv; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau /* * Yank back the headers [hope the device set this -@@ -1549,7 +1551,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1548,7 +1550,7 @@ static int packet_rcv_spkt(struct sk_buf * so that this procedure is noop. */ @@ -51,7 +51,7 @@ Signed-off-by: Felix Fietkau goto out; if (!net_eq(dev_net(dev), sock_net(sk))) -@@ -1748,12 +1750,12 @@ static int packet_rcv(struct sk_buff *sk +@@ -1747,12 +1749,12 @@ static int packet_rcv(struct sk_buff *sk int skb_len = skb->len; unsigned int snaplen, res; @@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -1873,12 +1875,12 @@ static int tpacket_rcv(struct sk_buff *s +@@ -1872,12 +1874,12 @@ static int tpacket_rcv(struct sk_buff *s BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32); BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48); @@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -2828,6 +2830,7 @@ static int packet_create(struct net *net +@@ -2831,6 +2833,7 @@ static int packet_create(struct net *net spin_lock_init(&po->bind_lock); mutex_init(&po->pg_vec_lock); po->prot_hook.func = packet_rcv; @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3409,6 +3412,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3425,6 +3428,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -108,7 +108,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3460,6 +3473,13 @@ static int packet_getsockopt(struct sock +@@ -3476,6 +3489,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; diff --git a/target/linux/generic/pending-3.18/653-disable_netlink_trim.patch b/target/linux/generic/pending-3.18/653-disable_netlink_trim.patch index b38b87b48f..fe62110f06 100644 --- a/target/linux/generic/pending-3.18/653-disable_netlink_trim.patch +++ b/target/linux/generic/pending-3.18/653-disable_netlink_trim.patch @@ -1,15 +1,12 @@ --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c -@@ -1721,27 +1721,7 @@ void netlink_detachskb(struct sock *sk, +@@ -1107,23 +1107,7 @@ void netlink_detachskb(struct sock *sk, static struct sk_buff *netlink_trim(struct sk_buff *skb, gfp_t allocation) { - int delta; - WARN_ON(skb->sk != NULL); -- if (netlink_skb_is_mmaped(skb)) -- return skb; -- - delta = skb->end - skb->tail; - if (is_vmalloc_addr(skb->head) || delta * 2 < skb->truesize) - return skb; @@ -24,7 +21,6 @@ - - if (!pskb_expand_head(skb, 0, -delta, allocation)) - skb->truesize -= delta; -- + return skb; } - diff --git a/target/linux/generic/pending-3.18/655-increase_skb_pad.patch b/target/linux/generic/pending-3.18/655-increase_skb_pad.patch index 19344cca3f..96f81e9aa7 100644 --- a/target/linux/generic/pending-3.18/655-increase_skb_pad.patch +++ b/target/linux/generic/pending-3.18/655-increase_skb_pad.patch @@ -1,6 +1,6 @@ --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2023,7 +2023,7 @@ static inline int pskb_network_may_pull( +@@ -2024,7 +2024,7 @@ static inline int pskb_network_may_pull( * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) */ #ifndef NET_SKB_PAD diff --git a/target/linux/generic/pending-3.18/656-skb_reduce_truesize-helper.patch b/target/linux/generic/pending-3.18/656-skb_reduce_truesize-helper.patch index b326a8b727..0fde9f6e62 100644 --- a/target/linux/generic/pending-3.18/656-skb_reduce_truesize-helper.patch +++ b/target/linux/generic/pending-3.18/656-skb_reduce_truesize-helper.patch @@ -14,7 +14,7 @@ when needed. --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2068,6 +2068,24 @@ static inline void pskb_trim_unique(stru +@@ -2069,6 +2069,24 @@ static inline void pskb_trim_unique(stru BUG_ON(err); } diff --git a/target/linux/generic/pending-3.18/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/pending-3.18/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch index 000665f047..43bdbe456d 100644 --- a/target/linux/generic/pending-3.18/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch +++ b/target/linux/generic/pending-3.18/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch @@ -145,7 +145,7 @@ Signed-off-by: Steven Barth if (dev == ip6n->fb_tnl_dev) RCU_INIT_POINTER(ip6n->tnls_wc[0], NULL); else -@@ -771,6 +786,108 @@ int ip6_tnl_rcv_ctl(struct ip6_tnl *t, +@@ -781,6 +796,108 @@ int ip6_tnl_rcv_ctl(struct ip6_tnl *t, } EXPORT_SYMBOL_GPL(ip6_tnl_rcv_ctl); @@ -254,7 +254,7 @@ Signed-off-by: Steven Barth /** * ip6_tnl_rcv - decapsulate IPv6 packet and retransmit it locally * @skb: received socket buffer -@@ -815,6 +932,26 @@ static int ip6_tnl_rcv(struct sk_buff *s +@@ -825,6 +942,26 @@ static int ip6_tnl_rcv(struct sk_buff *s skb_reset_network_header(skb); skb->protocol = htons(protocol); memset(skb->cb, 0, sizeof(struct inet6_skb_parm)); @@ -281,7 +281,7 @@ Signed-off-by: Steven Barth __skb_tunnel_rx(skb, t->dev, t->net); -@@ -1076,6 +1213,7 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, str +@@ -1086,6 +1223,7 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, str __u8 dsfield; __u32 mtu; int err; @@ -289,7 +289,7 @@ Signed-off-by: Steven Barth if ((t->parms.proto != IPPROTO_IPIP && t->parms.proto != 0) || !ip6_tnl_xmit_ctl(t)) -@@ -1095,6 +1233,18 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, str +@@ -1105,6 +1243,18 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, str if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK) fl6.flowi6_mark = skb->mark; @@ -308,7 +308,7 @@ Signed-off-by: Steven Barth err = ip6_tnl_xmit2(skb, dev, dsfield, &fl6, encap_limit, &mtu); if (err != 0) { /* XXX: send ICMP error even if DF is not set. */ -@@ -1263,6 +1413,14 @@ ip6_tnl_change(struct ip6_tnl *t, const +@@ -1273,6 +1423,14 @@ ip6_tnl_change(struct ip6_tnl *t, const t->parms.flowinfo = p->flowinfo; t->parms.link = p->link; t->parms.proto = p->proto; @@ -323,7 +323,7 @@ Signed-off-by: Steven Barth ip6_tnl_dst_reset(t); ip6_tnl_link_config(t); return 0; -@@ -1293,6 +1451,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ +@@ -1303,6 +1461,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ p->flowinfo = u->flowinfo; p->link = u->link; p->proto = u->proto; @@ -331,7 +331,7 @@ Signed-off-by: Steven Barth memcpy(p->name, u->name, sizeof(u->name)); } -@@ -1568,6 +1727,15 @@ static int ip6_tnl_validate(struct nlatt +@@ -1578,6 +1737,15 @@ static int ip6_tnl_validate(struct nlatt return 0; } @@ -347,7 +347,7 @@ Signed-off-by: Steven Barth static void ip6_tnl_netlink_parms(struct nlattr *data[], struct __ip6_tnl_parm *parms) { -@@ -1601,6 +1769,46 @@ static void ip6_tnl_netlink_parms(struct +@@ -1611,6 +1779,46 @@ static void ip6_tnl_netlink_parms(struct if (data[IFLA_IPTUN_PROTO]) parms->proto = nla_get_u8(data[IFLA_IPTUN_PROTO]); @@ -394,7 +394,7 @@ Signed-off-by: Steven Barth } static int ip6_tnl_newlink(struct net *src_net, struct net_device *dev, -@@ -1653,6 +1861,12 @@ static void ip6_tnl_dellink(struct net_d +@@ -1663,6 +1871,12 @@ static void ip6_tnl_dellink(struct net_d static size_t ip6_tnl_get_size(const struct net_device *dev) { @@ -407,7 +407,7 @@ Signed-off-by: Steven Barth return /* IFLA_IPTUN_LINK */ nla_total_size(4) + -@@ -1670,6 +1884,24 @@ static size_t ip6_tnl_get_size(const str +@@ -1680,6 +1894,24 @@ static size_t ip6_tnl_get_size(const str nla_total_size(4) + /* IFLA_IPTUN_PROTO */ nla_total_size(1) + @@ -432,7 +432,7 @@ Signed-off-by: Steven Barth 0; } -@@ -1677,6 +1909,9 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -1687,6 +1919,9 @@ static int ip6_tnl_fill_info(struct sk_b { struct ip6_tnl *tunnel = netdev_priv(dev); struct __ip6_tnl_parm *parm = &tunnel->parms; @@ -442,7 +442,7 @@ Signed-off-by: Steven Barth if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) || nla_put(skb, IFLA_IPTUN_LOCAL, sizeof(struct in6_addr), -@@ -1687,8 +1922,27 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -1697,8 +1932,27 @@ static int ip6_tnl_fill_info(struct sk_b nla_put_u8(skb, IFLA_IPTUN_ENCAP_LIMIT, parm->encap_limit) || nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) || nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) || @@ -471,7 +471,7 @@ Signed-off-by: Steven Barth return 0; nla_put_failure: -@@ -1704,6 +1958,7 @@ static const struct nla_policy ip6_tnl_p +@@ -1714,6 +1968,7 @@ static const struct nla_policy ip6_tnl_p [IFLA_IPTUN_FLOWINFO] = { .type = NLA_U32 }, [IFLA_IPTUN_FLAGS] = { .type = NLA_U32 }, [IFLA_IPTUN_PROTO] = { .type = NLA_U8 }, diff --git a/target/linux/generic/pending-3.18/667-ipv6-Fixed-source-specific-default-route-handling.patch b/target/linux/generic/pending-3.18/667-ipv6-Fixed-source-specific-default-route-handling.patch index 0c951069c2..de8745cdc3 100644 --- a/target/linux/generic/pending-3.18/667-ipv6-Fixed-source-specific-default-route-handling.patch +++ b/target/linux/generic/pending-3.18/667-ipv6-Fixed-source-specific-default-route-handling.patch @@ -26,7 +26,7 @@ Signed-off-by: David S. Miller --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c -@@ -903,21 +903,45 @@ static int ip6_dst_lookup_tail(struct so +@@ -906,21 +906,45 @@ static int ip6_dst_lookup_tail(struct so #endif int err; @@ -81,7 +81,7 @@ Signed-off-by: David S. Miller * Here if the dst entry we've looked up --- a/net/ipv6/route.c +++ b/net/ipv6/route.c -@@ -2182,9 +2182,10 @@ int ip6_route_get_saddr(struct net *net, +@@ -2184,9 +2184,10 @@ int ip6_route_get_saddr(struct net *net, unsigned int prefs, struct in6_addr *saddr) { diff --git a/target/linux/generic/pending-3.18/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-3.18/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 1bf9dc99dc..f999d44df0 100644 --- a/target/linux/generic/pending-3.18/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-3.18/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -155,7 +155,7 @@ Signed-off-by: Jonas Gorski case RTN_THROW: default: rt->dst.error = (cfg->fc_type == RTN_THROW) ? -EAGAIN -@@ -2139,6 +2161,17 @@ static int ip6_pkt_prohibit_out(struct s +@@ -2141,6 +2163,17 @@ static int ip6_pkt_prohibit_out(struct s return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES); } @@ -173,7 +173,7 @@ Signed-off-by: Jonas Gorski /* * Allocate a dst for local (unicast / anycast) address. */ -@@ -2363,7 +2396,8 @@ static int rtm_to_fib6_config(struct sk_ +@@ -2365,7 +2398,8 @@ static int rtm_to_fib6_config(struct sk_ if (rtm->rtm_type == RTN_UNREACHABLE || rtm->rtm_type == RTN_BLACKHOLE || rtm->rtm_type == RTN_PROHIBIT || @@ -183,7 +183,7 @@ Signed-off-by: Jonas Gorski cfg->fc_flags |= RTF_REJECT; if (rtm->rtm_type == RTN_LOCAL) -@@ -2565,6 +2599,9 @@ static int rt6_fill_node(struct net *net +@@ -2567,6 +2601,9 @@ static int rt6_fill_node(struct net *net case -EACCES: rtm->rtm_type = RTN_PROHIBIT; break; @@ -193,7 +193,7 @@ Signed-off-by: Jonas Gorski case -EAGAIN: rtm->rtm_type = RTN_THROW; break; -@@ -2818,6 +2855,8 @@ static int ip6_route_dev_notify(struct n +@@ -2825,6 +2862,8 @@ static int ip6_route_dev_notify(struct n #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.ip6_prohibit_entry->dst.dev = dev; net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); @@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -3034,6 +3073,17 @@ static int __net_init ip6_route_net_init +@@ -3047,6 +3086,17 @@ static int __net_init ip6_route_net_init net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); @@ -220,7 +220,7 @@ Signed-off-by: Jonas Gorski #endif net->ipv6.sysctl.flush_delay = 0; -@@ -3052,6 +3102,8 @@ out: +@@ -3065,6 +3115,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -229,7 +229,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -3069,6 +3121,7 @@ static void __net_exit ip6_route_net_exi +@@ -3082,6 +3134,7 @@ static void __net_exit ip6_route_net_exi #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); kfree(net->ipv6.ip6_blk_hole_entry); @@ -237,7 +237,7 @@ Signed-off-by: Jonas Gorski #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); } -@@ -3165,6 +3218,9 @@ int __init ip6_route_init(void) +@@ -3155,6 +3208,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); @@ -245,5 +245,5 @@ Signed-off-by: Jonas Gorski + init_net.ipv6.ip6_policy_failed_entry->rt6i_idev = + in6_dev_get(init_net.loopback_dev); #endif - ret = fib6_init(); - if (ret) + } + diff --git a/target/linux/generic/pending-3.18/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-3.18/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 714097bca0..da4b58883a 100644 --- a/target/linux/generic/pending-3.18/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-3.18/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4002,6 +4002,9 @@ static enum gro_result dev_gro_receive(s +@@ -4006,6 +4006,9 @@ static enum gro_result dev_gro_receive(s enum gro_result ret; int grow; @@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau if (!(skb->dev->features & NETIF_F_GRO)) goto normal; -@@ -5067,6 +5070,48 @@ static void __netdev_adjacent_dev_unlink +@@ -5077,6 +5080,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *private) -@@ -5127,6 +5172,7 @@ static int __netdev_upper_dev_link(struc +@@ -5137,6 +5182,7 @@ static int __netdev_upper_dev_link(struc goto rollback_lower_mesh; } @@ -84,15 +84,15 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers(NETDEV_CHANGEUPPER, dev); return 0; -@@ -5244,6 +5290,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -5254,6 +5300,7 @@ void netdev_upper_dev_unlink(struct net_ list_for_each_entry(i, &upper_dev->all_adj_list.upper, list) - __netdev_adjacent_dev_unlink(dev, i->dev); + __netdev_adjacent_dev_unlink(dev, i->dev, i->ref_nr); + netdev_update_addr_mask(dev); call_netdevice_notifiers(NETDEV_CHANGEUPPER, dev); } EXPORT_SYMBOL(netdev_upper_dev_unlink); -@@ -5763,6 +5810,7 @@ int dev_set_mac_address(struct net_devic +@@ -5773,6 +5820,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; @@ -113,7 +113,7 @@ Signed-off-by: Felix Fietkau #endif --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -597,7 +597,8 @@ struct sk_buff { +@@ -598,7 +598,8 @@ struct sk_buff { #endif __u8 ipvs_property:1; __u8 inner_protocol_type:1; diff --git a/target/linux/generic/pending-3.18/701-phy_extension.patch b/target/linux/generic/pending-3.18/701-phy_extension.patch index 5c63dbec62..fa4542b88b 100644 --- a/target/linux/generic/pending-3.18/701-phy_extension.patch +++ b/target/linux/generic/pending-3.18/701-phy_extension.patch @@ -53,7 +53,7 @@ * @phydev: the phy_device struct --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -748,6 +748,7 @@ void phy_start_machine(struct phy_device +@@ -752,6 +752,7 @@ void phy_start_machine(struct phy_device void phy_stop_machine(struct phy_device *phydev); int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); diff --git a/target/linux/generic/pending-3.18/704-phy-no-genphy-soft-reset.patch b/target/linux/generic/pending-3.18/704-phy-no-genphy-soft-reset.patch deleted file mode 100644 index 0350f9efe4..0000000000 --- a/target/linux/generic/pending-3.18/704-phy-no-genphy-soft-reset.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/drivers/net/phy/phy_device.c -+++ b/drivers/net/phy/phy_device.c -@@ -1133,7 +1133,7 @@ int genphy_config_init(struct phy_device - return 0; - } - --static int gen10g_soft_reset(struct phy_device *phydev) -+static int no_soft_reset(struct phy_device *phydev) - { - /* Do nothing for now */ - return 0; -@@ -1347,7 +1347,7 @@ static struct phy_driver genphy_driver[] - .phy_id = 0xffffffff, - .phy_id_mask = 0xffffffff, - .name = "Generic PHY", -- .soft_reset = genphy_soft_reset, -+ .soft_reset = no_soft_reset, - .config_init = genphy_config_init, - .features = PHY_GBIT_FEATURES | SUPPORTED_MII | - SUPPORTED_AUI | SUPPORTED_FIBRE | -@@ -1362,7 +1362,7 @@ static struct phy_driver genphy_driver[] - .phy_id = 0xffffffff, - .phy_id_mask = 0xffffffff, - .name = "Generic 10G PHY", -- .soft_reset = gen10g_soft_reset, -+ .soft_reset = no_soft_reset, - .config_init = gen10g_config_init, - .features = 0, - .config_aneg = gen10g_config_aneg, diff --git a/target/linux/generic/pending-3.18/710-phy-add-mdio_register_board_info.patch b/target/linux/generic/pending-3.18/710-phy-add-mdio_register_board_info.patch index cc3cb2445d..424c63e311 100644 --- a/target/linux/generic/pending-3.18/710-phy-add-mdio_register_board_info.patch +++ b/target/linux/generic/pending-3.18/710-phy-add-mdio_register_board_info.patch @@ -46,7 +46,7 @@ phy_device_free(phydev); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -785,4 +785,22 @@ int __init mdio_bus_init(void); +@@ -789,4 +789,22 @@ int __init mdio_bus_init(void); void mdio_bus_exit(void); extern struct bus_type mdio_bus_type; diff --git a/target/linux/generic/pending-3.18/721-phy_packets.patch b/target/linux/generic/pending-3.18/721-phy_packets.patch index 99811c6242..7235ab355f 100644 --- a/target/linux/generic/pending-3.18/721-phy_packets.patch +++ b/target/linux/generic/pending-3.18/721-phy_packets.patch @@ -41,7 +41,7 @@ */ --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2054,6 +2054,10 @@ static inline int pskb_trim(struct sk_bu +@@ -2055,6 +2055,10 @@ static inline int pskb_trim(struct sk_bu return (len < skb->len) ? __pskb_trim(skb, len) : 0; } @@ -52,7 +52,7 @@ /** * pskb_trim_unique - remove end from a paged unique (not cloned) buffer * @skb: buffer to alter -@@ -2180,16 +2184,6 @@ static inline struct sk_buff *dev_alloc_ +@@ -2181,16 +2185,6 @@ static inline struct sk_buff *dev_alloc_ } @@ -86,7 +86,7 @@ help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -2623,10 +2623,20 @@ static int xmit_one(struct sk_buff *skb, +@@ -2626,10 +2626,20 @@ static int xmit_one(struct sk_buff *skb, if (!list_empty(&ptype_all)) dev_queue_xmit_nit(skb, dev); @@ -121,7 +121,7 @@ #include #include -@@ -469,6 +470,22 @@ struct sk_buff *__netdev_alloc_skb(struc +@@ -471,6 +472,22 @@ struct sk_buff *__netdev_alloc_skb(struc } EXPORT_SYMBOL(__netdev_alloc_skb); diff --git a/target/linux/generic/pending-3.18/773-bgmac-add-srab-switch.patch b/target/linux/generic/pending-3.18/773-bgmac-add-srab-switch.patch index 52fc252447..a93877b69e 100644 --- a/target/linux/generic/pending-3.18/773-bgmac-add-srab-switch.patch +++ b/target/linux/generic/pending-3.18/773-bgmac-add-srab-switch.patch @@ -30,7 +30,7 @@ Signed-off-by: Hauke Mehrtens /************************************************** * BCMA bus ops **************************************************/ -@@ -1666,6 +1678,16 @@ static int bgmac_probe(struct bcma_devic +@@ -1671,6 +1683,16 @@ static int bgmac_probe(struct bcma_devic net_dev->hw_features = net_dev->features; net_dev->vlan_features = net_dev->features; @@ -47,7 +47,7 @@ Signed-off-by: Hauke Mehrtens err = register_netdev(bgmac->net_dev); if (err) { bgmac_err(bgmac, "Cannot register net device\n"); -@@ -1692,6 +1714,10 @@ static void bgmac_remove(struct bcma_dev +@@ -1697,6 +1719,10 @@ static void bgmac_remove(struct bcma_dev { struct bgmac *bgmac = bcma_get_drvdata(core); diff --git a/target/linux/generic/pending-3.18/811-pci_disable_usb_common_quirks.patch b/target/linux/generic/pending-3.18/811-pci_disable_usb_common_quirks.patch index a7bf0bb9fa..ddc8549634 100644 --- a/target/linux/generic/pending-3.18/811-pci_disable_usb_common_quirks.patch +++ b/target/linux/generic/pending-3.18/811-pci_disable_usb_common_quirks.patch @@ -1,7 +1,7 @@ --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c -@@ -97,6 +97,8 @@ struct amd_chipset_type { +@@ -98,6 +98,8 @@ struct amd_chipset_type { u8 rev; }; @@ -10,7 +10,7 @@ static struct amd_chipset_info { struct pci_dev *nb_dev; struct pci_dev *smbus_dev; -@@ -454,6 +456,10 @@ void usb_amd_dev_put(void) +@@ -462,6 +464,10 @@ void usb_amd_dev_put(void) } EXPORT_SYMBOL_GPL(usb_amd_dev_put); @@ -21,7 +21,7 @@ /* * Make sure the controller is completely inactive, unable to * generate interrupts or do DMA. -@@ -533,8 +539,17 @@ reset_needed: +@@ -541,8 +547,17 @@ reset_needed: uhci_reset_hc(pdev, base); return 1; } @@ -39,7 +39,7 @@ static inline int io_type_enabled(struct pci_dev *pdev, unsigned int mask) { u16 cmd; -@@ -1095,3 +1110,4 @@ static void quirk_usb_early_handoff(stru +@@ -1103,3 +1118,4 @@ static void quirk_usb_early_handoff(stru } DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_SERIAL_USB, 8, quirk_usb_early_handoff); diff --git a/target/linux/generic/pending-3.18/901-debloat_sock_diag.patch b/target/linux/generic/pending-3.18/901-debloat_sock_diag.patch index 99f23a027e..41c9220a60 100644 --- a/target/linux/generic/pending-3.18/901-debloat_sock_diag.patch +++ b/target/linux/generic/pending-3.18/901-debloat_sock_diag.patch @@ -45,7 +45,7 @@ Support for UNIX socket monitoring interface used by the ss tool. --- a/net/netlink/Kconfig +++ b/net/netlink/Kconfig -@@ -13,6 +13,7 @@ config NETLINK_MMAP +@@ -4,6 +4,7 @@ config NETLINK_DIAG tristate "NETLINK: socket monitoring interface" diff --git a/target/linux/generic/pending-3.18/902-debloat_proc.patch b/target/linux/generic/pending-3.18/902-debloat_proc.patch index 79cecf90d4..596a84f8dd 100644 --- a/target/linux/generic/pending-3.18/902-debloat_proc.patch +++ b/target/linux/generic/pending-3.18/902-debloat_proc.patch @@ -173,7 +173,7 @@ goto err; --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -2933,6 +2933,8 @@ static __net_initdata struct pernet_oper +@@ -2939,6 +2939,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { diff --git a/target/linux/generic/pending-3.18/997-device_tree_cmdline.patch b/target/linux/generic/pending-3.18/997-device_tree_cmdline.patch index dd725b01b1..61fe71b784 100644 --- a/target/linux/generic/pending-3.18/997-device_tree_cmdline.patch +++ b/target/linux/generic/pending-3.18/997-device_tree_cmdline.patch @@ -1,6 +1,6 @@ --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c -@@ -903,6 +903,9 @@ int __init early_init_dt_scan_chosen(uns +@@ -909,6 +909,9 @@ int __init early_init_dt_scan_chosen(uns p = of_get_flat_dt_prop(node, "bootargs", &l); if (p != NULL && l > 0) strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE)); diff --git a/target/linux/generic/pending-4.14/100-MIPS-fix-cache-flushing-for-highmem-pages.patch b/target/linux/generic/pending-4.14/100-MIPS-fix-cache-flushing-for-highmem-pages.patch new file mode 100644 index 0000000000..b1c65f7cd8 --- /dev/null +++ b/target/linux/generic/pending-4.14/100-MIPS-fix-cache-flushing-for-highmem-pages.patch @@ -0,0 +1,30 @@ +From: Felix Fietkau +Subject: MIPS: fix cache flushing for highmem pages + +Most cache flush ops were no-op for highmem pages. This led to nasty +segfaults and (in the case of page_address(page) == NULL) kernel +crashes. + +Fix this by always flushing highmem pages using kmap/kunmap_atomic +around the actual cache flush. This might be a bit inefficient, but at +least it's stable. + +Signed-off-by: Felix Fietkau +--- + +--- a/arch/mips/mm/cache.c ++++ b/arch/mips/mm/cache.c +@@ -116,6 +116,13 @@ void __flush_anon_page(struct page *page + { + unsigned long addr = (unsigned long) page_address(page); + ++ if (PageHighMem(page)) { ++ addr = (unsigned long)kmap_atomic(page); ++ flush_data_cache_page(addr); ++ __kunmap_atomic((void *)addr); ++ return; ++ } ++ + if (pages_do_alias(addr, vmaddr)) { + if (page_mapcount(page) && !Page_dcache_dirty(page)) { + void *kaddr; diff --git a/target/linux/generic/pending-4.14/110-ehci_hcd_ignore_oc.patch b/target/linux/generic/pending-4.14/110-ehci_hcd_ignore_oc.patch new file mode 100644 index 0000000000..b45b1c079c --- /dev/null +++ b/target/linux/generic/pending-4.14/110-ehci_hcd_ignore_oc.patch @@ -0,0 +1,79 @@ +From: Florian Fainelli +Subject: USB: EHCI: add ignore_oc flag to disable overcurrent checking + +This patch adds an ignore_oc flag which can be set by EHCI controller +not supporting or wanting to disable overcurrent checking. The EHCI +platform data in include/linux/usb/ehci_pdriver.h is also augmented to +take advantage of this new flag. + +Signed-off-by: Florian Fainelli +--- + drivers/usb/host/ehci-hcd.c | 2 +- + drivers/usb/host/ehci-hub.c | 4 ++-- + drivers/usb/host/ehci-platform.c | 1 + + drivers/usb/host/ehci.h | 1 + + include/linux/usb/ehci_pdriver.h | 1 + + 5 files changed, 6 insertions(+), 3 deletions(-) + +--- a/drivers/usb/host/ehci-hcd.c ++++ b/drivers/usb/host/ehci-hcd.c +@@ -651,7 +651,7 @@ static int ehci_run (struct usb_hcd *hcd + "USB %x.%x started, EHCI %x.%02x%s\n", + ((ehci->sbrn & 0xf0)>>4), (ehci->sbrn & 0x0f), + temp >> 8, temp & 0xff, +- ignore_oc ? ", overcurrent ignored" : ""); ++ (ignore_oc || ehci->ignore_oc) ? ", overcurrent ignored" : ""); + + ehci_writel(ehci, INTR_MASK, + &ehci->regs->intr_enable); /* Turn On Interrupts */ +--- a/drivers/usb/host/ehci-hub.c ++++ b/drivers/usb/host/ehci-hub.c +@@ -646,7 +646,7 @@ ehci_hub_status_data (struct usb_hcd *hc + * always set, seem to clear PORT_OCC and PORT_CSC when writing to + * PORT_POWER; that's surprising, but maybe within-spec. + */ +- if (!ignore_oc) ++ if (!ignore_oc && !ehci->ignore_oc) + mask = PORT_CSC | PORT_PEC | PORT_OCC; + else + mask = PORT_CSC | PORT_PEC; +@@ -1016,7 +1016,7 @@ int ehci_hub_control( + if (temp & PORT_PEC) + status |= USB_PORT_STAT_C_ENABLE << 16; + +- if ((temp & PORT_OCC) && !ignore_oc){ ++ if ((temp & PORT_OCC) && (!ignore_oc && !ehci->ignore_oc)){ + status |= USB_PORT_STAT_C_OVERCURRENT << 16; + + /* +--- a/drivers/usb/host/ehci-platform.c ++++ b/drivers/usb/host/ehci-platform.c +@@ -263,6 +263,8 @@ static int ehci_platform_probe(struct pl + hcd->has_tt = 1; + if (pdata->reset_on_resume) + priv->reset_on_resume = true; ++ if (pdata->ignore_oc) ++ ehci->ignore_oc = 1; + + #ifndef CONFIG_USB_EHCI_BIG_ENDIAN_MMIO + if (ehci->big_endian_mmio) { +--- a/drivers/usb/host/ehci.h ++++ b/drivers/usb/host/ehci.h +@@ -231,6 +231,7 @@ struct ehci_hcd { /* one per controlle + unsigned frame_index_bug:1; /* MosChip (AKA NetMos) */ + unsigned need_oc_pp_cycle:1; /* MPC834X port power */ + unsigned imx28_write_fix:1; /* For Freescale i.MX28 */ ++ unsigned ignore_oc:1; + + /* required for usb32 quirk */ + #define OHCI_CTRL_HCFS (3 << 6) +--- a/include/linux/usb/ehci_pdriver.h ++++ b/include/linux/usb/ehci_pdriver.h +@@ -49,6 +49,7 @@ struct usb_ehci_pdata { + unsigned no_io_watchdog:1; + unsigned reset_on_resume:1; + unsigned dma_mask_64:1; ++ unsigned ignore_oc:1; + + /* Turn on all power and clocks */ + int (*power_on)(struct platform_device *pdev); diff --git a/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch new file mode 100644 index 0000000000..fbf9981384 --- /dev/null +++ b/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -0,0 +1,82 @@ +From: Tobias Wolf +Subject: mm: Fix alloc_node_mem_map with ARCH_PFN_OFFSET calculation + +An rt288x (ralink) based router (Belkin F5D8235 v1) does not boot with any +kernel beyond version 4.3 resulting in: + +BUG: Bad page state in process swapper pfn:086ac + +bisect resulted in: + +a1c34a3bf00af2cede839879502e12dc68491ad5 is the first bad commit +commit a1c34a3bf00af2cede839879502e12dc68491ad5 +Author: Laura Abbott +Date: Thu Nov 5 18:48:46 2015 -0800 + + mm: Don't offset memmap for flatmem + + Srinivas Kandagatla reported bad page messages when trying to remove the + bottom 2MB on an ARM based IFC6410 board + + BUG: Bad page state in process swapper pfn:fffa8 + page:ef7fb500 count:0 mapcount:0 mapping: (null) index:0x0 + flags: 0x96640253(locked|error|dirty|active|arch_1|reclaim|mlocked) + page dumped because: PAGE_FLAGS_CHECK_AT_FREE flag(s) set + bad because of flags: + flags: 0x200041(locked|active|mlocked) + Modules linked in: + CPU: 0 PID: 0 Comm: swapper Not tainted 3.19.0-rc3-00007-g412f9ba-dirty +#816 + Hardware name: Qualcomm (Flattened Device Tree) + unwind_backtrace + show_stack + dump_stack + bad_page + free_pages_prepare + free_hot_cold_page + __free_pages + free_highmem_page + mem_init + start_kernel + Disabling lock debugging due to kernel taint + [...] +:040000 040000 2de013c372345fd471cd58f0553c9b38b0ef1cc4 +0a8156f848733dfa21e16c196dfb6c0a76290709 M mm + +This fix for ARM does not account ARCH_PFN_OFFSET for mem_map as later used by +page_to_pfn anymore. + +The following output was generated with two hacked in printk statements: + +printk("before %p vs. %p or %p\n", mem_map, mem_map - offset, mem_map - +(pgdat->node_start_pfn - ARCH_PFN_OFFSET)); + if (page_to_pfn(mem_map) != pgdat->node_start_pfn) + mem_map -= offset + (pgdat->node_start_pfn - ARCH_PFN_OFFSET); +printk("after %p\n", mem_map); + +Output: + +[ 0.000000] before 8861b280 vs. 8861b280 or 8851b280 +[ 0.000000] after 8851b280 + +As seen in the first line mem_map with subtraction of offset does not equal the +mem_map after subtraction of ARCH_PFN_OFFSET. + +After adding the offset of ARCH_PFN_OFFSET as well to mem_map as the +previously calculated offset is zero for the named platform it is able to boot +4.4 and 4.9-rc7 again. + +Signed-off-by: Tobias Wolf +--- + +--- a/mm/page_alloc.c ++++ b/mm/page_alloc.c +@@ -6170,7 +6170,7 @@ static void __ref alloc_node_mem_map(str + mem_map = NODE_DATA(0)->node_mem_map; + #if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM) + if (page_to_pfn(mem_map) != pgdat->node_start_pfn) +- mem_map -= offset; ++ mem_map -= offset + (pgdat->node_start_pfn - ARCH_PFN_OFFSET); + #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ + } + #endif diff --git a/target/linux/generic/pending-4.14/130-add-linux-spidev-compatible-si3210.patch b/target/linux/generic/pending-4.14/130-add-linux-spidev-compatible-si3210.patch new file mode 100644 index 0000000000..b00fb8ee2e --- /dev/null +++ b/target/linux/generic/pending-4.14/130-add-linux-spidev-compatible-si3210.patch @@ -0,0 +1,18 @@ +From: Giuseppe Lippolis +Subject: Add the linux,spidev compatible in spidev Several device in ramips have this binding in the dts + +Signed-off-by: Giuseppe Lippolis +--- + drivers/spi/spidev.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/spi/spidev.c ++++ b/drivers/spi/spidev.c +@@ -669,6 +669,7 @@ static const struct of_device_id spidev_ + { .compatible = "lineartechnology,ltc2488" }, + { .compatible = "ge,achc" }, + { .compatible = "semtech,sx1301" }, ++ { .compatible = "siliconlabs,si3210" }, + {}, + }; + MODULE_DEVICE_TABLE(of, spidev_dt_ids); diff --git a/target/linux/generic/pending-4.14/131-spi-use-gpio_set_value_cansleep-for-setting-chipsele.patch b/target/linux/generic/pending-4.14/131-spi-use-gpio_set_value_cansleep-for-setting-chipsele.patch new file mode 100644 index 0000000000..9603385aed --- /dev/null +++ b/target/linux/generic/pending-4.14/131-spi-use-gpio_set_value_cansleep-for-setting-chipsele.patch @@ -0,0 +1,20 @@ +From: Felix Fietkau +Subject: spi: use gpio_set_value_cansleep for setting chipselect GPIO + +Sleeping is safe inside spi_transfer_one_message, and some GPIO chips +need to sleep for setting values + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/spi/spi.c ++++ b/drivers/spi/spi.c +@@ -729,7 +729,7 @@ static void spi_set_cs(struct spi_device + enable = !enable; + + if (gpio_is_valid(spi->cs_gpio)) { +- gpio_set_value(spi->cs_gpio, !enable); ++ gpio_set_value_cansleep(spi->cs_gpio, !enable); + /* Some SPI masters need both GPIO CS & slave_select */ + if ((spi->controller->flags & SPI_MASTER_GPIO_SS) && + spi->controller->set_cs) diff --git a/target/linux/generic/pending-4.14/140-jffs2-use-.rename2-and-add-RENAME_WHITEOUT-support.patch b/target/linux/generic/pending-4.14/140-jffs2-use-.rename2-and-add-RENAME_WHITEOUT-support.patch new file mode 100644 index 0000000000..b9bb3f71f1 --- /dev/null +++ b/target/linux/generic/pending-4.14/140-jffs2-use-.rename2-and-add-RENAME_WHITEOUT-support.patch @@ -0,0 +1,62 @@ +From: Felix Fietkau +Subject: jffs2: use .rename2 and add RENAME_WHITEOUT support + +It is required for renames on overlayfs + +Signed-off-by: Felix Fietkau +--- + +--- a/fs/jffs2/dir.c ++++ b/fs/jffs2/dir.c +@@ -756,6 +756,24 @@ static int jffs2_mknod (struct inode *di + return ret; + } + ++static int jffs2_whiteout (struct inode *old_dir, struct dentry *old_dentry) ++{ ++ struct dentry *wh; ++ int err; ++ ++ wh = d_alloc(old_dentry->d_parent, &old_dentry->d_name); ++ if (!wh) ++ return -ENOMEM; ++ ++ err = jffs2_mknod(old_dir, wh, S_IFCHR | WHITEOUT_MODE, ++ WHITEOUT_DEV); ++ if (err) ++ return err; ++ ++ d_rehash(wh); ++ return 0; ++} ++ + static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry, + struct inode *new_dir_i, struct dentry *new_dentry, + unsigned int flags) +@@ -766,7 +784,7 @@ static int jffs2_rename (struct inode *o + uint8_t type; + uint32_t now; + +- if (flags & ~RENAME_NOREPLACE) ++ if (flags & ~(RENAME_NOREPLACE|RENAME_WHITEOUT)) + return -EINVAL; + + /* The VFS will check for us and prevent trying to rename a +@@ -832,9 +850,14 @@ static int jffs2_rename (struct inode *o + if (d_is_dir(old_dentry) && !victim_f) + inc_nlink(new_dir_i); + +- /* Unlink the original */ +- ret = jffs2_do_unlink(c, JFFS2_INODE_INFO(old_dir_i), +- old_dentry->d_name.name, old_dentry->d_name.len, NULL, now); ++ if (flags & RENAME_WHITEOUT) ++ /* Replace with whiteout */ ++ ret = jffs2_whiteout(old_dir_i, old_dentry); ++ else ++ /* Unlink the original */ ++ ret = jffs2_do_unlink(c, JFFS2_INODE_INFO(old_dir_i), ++ old_dentry->d_name.name, ++ old_dentry->d_name.len, NULL, now); + + /* We don't touch inode->i_nlink */ + diff --git a/target/linux/generic/pending-4.14/141-jffs2-add-RENAME_EXCHANGE-support.patch b/target/linux/generic/pending-4.14/141-jffs2-add-RENAME_EXCHANGE-support.patch new file mode 100644 index 0000000000..4b30bc7cd0 --- /dev/null +++ b/target/linux/generic/pending-4.14/141-jffs2-add-RENAME_EXCHANGE-support.patch @@ -0,0 +1,73 @@ +From: Felix Fietkau +Subject: jffs2: add RENAME_EXCHANGE support + +Signed-off-by: Felix Fietkau +--- + +--- a/fs/jffs2/dir.c ++++ b/fs/jffs2/dir.c +@@ -781,18 +781,31 @@ static int jffs2_rename (struct inode *o + int ret; + struct jffs2_sb_info *c = JFFS2_SB_INFO(old_dir_i->i_sb); + struct jffs2_inode_info *victim_f = NULL; ++ struct inode *fst_inode = d_inode(old_dentry); ++ struct inode *snd_inode = d_inode(new_dentry); + uint8_t type; + uint32_t now; + +- if (flags & ~(RENAME_NOREPLACE|RENAME_WHITEOUT)) ++ if (flags & ~(RENAME_NOREPLACE|RENAME_WHITEOUT|RENAME_EXCHANGE)) + return -EINVAL; + ++ if ((flags & RENAME_EXCHANGE) && (old_dir_i != new_dir_i)) { ++ if (S_ISDIR(fst_inode->i_mode) && !S_ISDIR(snd_inode->i_mode)) { ++ inc_nlink(new_dir_i); ++ drop_nlink(old_dir_i); ++ } ++ else if (!S_ISDIR(fst_inode->i_mode) && S_ISDIR(snd_inode->i_mode)) { ++ drop_nlink(new_dir_i); ++ inc_nlink(old_dir_i); ++ } ++ } ++ + /* The VFS will check for us and prevent trying to rename a + * file over a directory and vice versa, but if it's a directory, + * the VFS can't check whether the victim is empty. The filesystem + * needs to do that for itself. + */ +- if (d_really_is_positive(new_dentry)) { ++ if (d_really_is_positive(new_dentry) && !(flags & RENAME_EXCHANGE)) { + victim_f = JFFS2_INODE_INFO(d_inode(new_dentry)); + if (d_is_dir(new_dentry)) { + struct jffs2_full_dirent *fd; +@@ -827,7 +840,7 @@ static int jffs2_rename (struct inode *o + if (ret) + return ret; + +- if (victim_f) { ++ if (victim_f && !(flags & RENAME_EXCHANGE)) { + /* There was a victim. Kill it off nicely */ + if (d_is_dir(new_dentry)) + clear_nlink(d_inode(new_dentry)); +@@ -853,6 +866,12 @@ static int jffs2_rename (struct inode *o + if (flags & RENAME_WHITEOUT) + /* Replace with whiteout */ + ret = jffs2_whiteout(old_dir_i, old_dentry); ++ else if (flags & RENAME_EXCHANGE) ++ /* Replace the original */ ++ ret = jffs2_do_link(c, JFFS2_INODE_INFO(old_dir_i), ++ d_inode(new_dentry)->i_ino, type, ++ old_dentry->d_name.name, old_dentry->d_name.len, ++ now); + else + /* Unlink the original */ + ret = jffs2_do_unlink(c, JFFS2_INODE_INFO(old_dir_i), +@@ -884,7 +903,7 @@ static int jffs2_rename (struct inode *o + return ret; + } + +- if (d_is_dir(old_dentry)) ++ if (d_is_dir(old_dentry) && !(flags & RENAME_EXCHANGE)) + drop_nlink(old_dir_i); + + new_dir_i->i_mtime = new_dir_i->i_ctime = old_dir_i->i_mtime = old_dir_i->i_ctime = ITIME(now); diff --git a/target/linux/generic/pending-4.14/150-bridge_allow_receiption_on_disabled_port.patch b/target/linux/generic/pending-4.14/150-bridge_allow_receiption_on_disabled_port.patch new file mode 100644 index 0000000000..03267310a0 --- /dev/null +++ b/target/linux/generic/pending-4.14/150-bridge_allow_receiption_on_disabled_port.patch @@ -0,0 +1,43 @@ +From: Stephen Hemminger +Subject: bridge: allow receiption on disabled port + +When an ethernet device is enslaved to a bridge, and the bridge STP +detects loss of carrier (or operational state down), then normally +packet receiption is blocked. + +This breaks control applications like WPA which maybe expecting to +receive packets to negotiate to bring link up. The bridge needs to +block forwarding packets from these disabled ports, but there is no +hard requirement to not allow local packet delivery. + +Signed-off-by: Stephen Hemminger +Signed-off-by: Felix Fietkau + +--- a/net/bridge/br_input.c ++++ b/net/bridge/br_input.c +@@ -238,7 +238,8 @@ static int br_handle_local_finish(struct + { + struct net_bridge_port *p = br_port_get_rcu(skb->dev); + +- __br_handle_local_finish(skb); ++ if (p->state != BR_STATE_DISABLED) ++ __br_handle_local_finish(skb); + + BR_INPUT_SKB_CB(skb)->brdev = p->br->dev; + br_pass_frame_up(skb); +@@ -326,6 +327,15 @@ rx_handler_result_t br_handle_frame(stru + + forward: + switch (p->state) { ++ case BR_STATE_DISABLED: ++ if (ether_addr_equal(p->br->dev->dev_addr, dest)) ++ skb->pkt_type = PACKET_HOST; ++ ++ NF_HOOK(NFPROTO_BRIDGE, NF_BR_PRE_ROUTING, ++ dev_net(skb->dev), NULL, skb, skb->dev, NULL, ++ br_handle_local_finish); ++ break; ++ + case BR_STATE_FORWARDING: + rhook = rcu_dereference(br_should_route_hook); + if (rhook) { diff --git a/target/linux/generic/pending-4.14/160-mtd-part-add-generic-parsing-of-linux-part-probe.patch b/target/linux/generic/pending-4.14/160-mtd-part-add-generic-parsing-of-linux-part-probe.patch new file mode 100644 index 0000000000..e57214ba05 --- /dev/null +++ b/target/linux/generic/pending-4.14/160-mtd-part-add-generic-parsing-of-linux-part-probe.patch @@ -0,0 +1,161 @@ +From: Hauke Mehrtens +Subject: mtd: part: add generic parsing of linux,part-probe + +This moves the linux,part-probe device tree parsing code from +physmap_of.c to mtdpart.c. Now all drivers can use this feature by just +providing a reference to their device tree node in struct +mtd_part_parser_data. + +Signed-off-by: Hauke Mehrtens +--- + Documentation/devicetree/bindings/mtd/nand.txt | 16 +++++++++ + drivers/mtd/maps/physmap_of.c | 46 +------------------------- + drivers/mtd/mtdpart.c | 45 +++++++++++++++++++++++++ + 3 files changed, 62 insertions(+), 45 deletions(-) + +--- a/Documentation/devicetree/bindings/mtd/nand.txt ++++ b/Documentation/devicetree/bindings/mtd/nand.txt +@@ -44,6 +44,22 @@ Optional NAND chip properties: + used by the upper layers, and you want to make your NAND + as reliable as possible. + ++- linux,part-probe: list of name as strings of the partition parser ++ which should be used to parse the partition table. ++ They will be tried in the specified ordering and ++ the next one will be used if the previous one ++ failed. ++ ++ Example: linux,part-probe = "cmdlinepart", "ofpart"; ++ ++ This is also the default value, which will be used ++ if this attribute is not specified. It could be ++ that the flash driver in use overwrote the default ++ value and uses some other default. ++ ++ Possible values are: bcm47xxpart, afs, ar7part, ++ ofoldpart, ofpart, bcm63xxpart, RedBoot, cmdlinepart ++ + The ECC strength and ECC step size properties define the correction capability + of a controller. Together, they say a controller can correct "{strength} bit + errors per {size} bytes". +--- a/drivers/mtd/maps/physmap_of_core.c ++++ b/drivers/mtd/maps/physmap_of_core.c +@@ -114,37 +114,9 @@ static struct mtd_info *obsolete_probe(s + static const char * const part_probe_types_def[] = { + "cmdlinepart", "RedBoot", "ofpart", "ofoldpart", NULL }; + +-static const char * const *of_get_probes(struct device_node *dp) +-{ +- const char **res; +- int count; +- +- count = of_property_count_strings(dp, "linux,part-probe"); +- if (count < 0) +- return part_probe_types_def; +- +- res = kzalloc((count + 1) * sizeof(*res), GFP_KERNEL); +- if (!res) +- return NULL; +- +- count = of_property_read_string_array(dp, "linux,part-probe", res, +- count); +- if (count < 0) +- return NULL; +- +- return res; +-} +- +-static void of_free_probes(const char * const *probes) +-{ +- if (probes != part_probe_types_def) +- kfree(probes); +-} +- + static const struct of_device_id of_flash_match[]; + static int of_flash_probe(struct platform_device *dev) + { +- const char * const *part_probe_types; + const struct of_device_id *match; + struct device_node *dp = dev->dev.of_node; + struct resource res; +@@ -310,14 +282,8 @@ static int of_flash_probe(struct platfor + + info->cmtd->dev.parent = &dev->dev; + mtd_set_of_node(info->cmtd, dp); +- part_probe_types = of_get_probes(dp); +- if (!part_probe_types) { +- err = -ENOMEM; +- goto err_out; +- } +- mtd_device_parse_register(info->cmtd, part_probe_types, NULL, ++ mtd_device_parse_register(info->cmtd, part_probe_types_def, NULL, + NULL, 0); +- of_free_probes(part_probe_types); + + kfree(mtd_list); + +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -864,6 +865,32 @@ void deregister_mtd_parser(struct mtd_pa + EXPORT_SYMBOL_GPL(deregister_mtd_parser); + + /* ++ * Parses the linux,part-probe device tree property. ++ * When a non null value is returned it has to be freed with kfree() by ++ * the caller. ++ */ ++static const char * const *of_get_probes(struct device_node *dp) ++{ ++ const char **res; ++ int count; ++ ++ count = of_property_count_strings(dp, "linux,part-probe"); ++ if (count < 0) ++ return NULL; ++ ++ res = kzalloc((count + 1) * sizeof(*res), GFP_KERNEL); ++ if (!res) ++ return NULL; ++ ++ count = of_property_read_string_array(dp, "linux,part-probe", res, ++ count); ++ if (count < 0) ++ return NULL; ++ ++ return res; ++} ++ ++/* + * Do not forget to update 'parse_mtd_partitions()' kerneldoc comment if you + * are changing this array! + */ +@@ -963,6 +990,13 @@ int parse_mtd_partitions(struct mtd_info + struct property *prop; + const char *compat; + int ret, err = 0; ++ const char *const *types_of = NULL; ++ ++ if (mtd_get_of_node(master)) { ++ types_of = of_get_probes(mtd_get_of_node(master)); ++ if (types_of != NULL) ++ types = types_of; ++ } + + np = of_get_child_by_name(mtd_get_of_node(master), "partitions"); + of_property_for_each_string(np, "compatible", prop, compat) { +@@ -1004,6 +1038,7 @@ int parse_mtd_partitions(struct mtd_info + if (ret < 0 && !err) + err = ret; + } ++ kfree(types_of); + return err; + } + diff --git a/target/linux/generic/pending-4.14/180-net-phy-at803x-add-support-for-AT8032.patch b/target/linux/generic/pending-4.14/180-net-phy-at803x-add-support-for-AT8032.patch new file mode 100644 index 0000000000..3b1a41a23b --- /dev/null +++ b/target/linux/generic/pending-4.14/180-net-phy-at803x-add-support-for-AT8032.patch @@ -0,0 +1,70 @@ +From: Felix Fietkau +Subject: net: phy: at803x: add support for AT8032 + +Like AT8030, this PHY needs the GPIO reset workaround + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/net/phy/at803x.c ++++ b/drivers/net/phy/at803x.c +@@ -62,6 +62,7 @@ + + #define ATH8030_PHY_ID 0x004dd076 + #define ATH8031_PHY_ID 0x004dd074 ++#define ATH8032_PHY_ID 0x004dd023 + #define ATH8035_PHY_ID 0x004dd072 + #define AT803X_PHY_ID_MASK 0xffffffef + +@@ -260,7 +261,8 @@ static int at803x_probe(struct phy_devic + if (!priv) + return -ENOMEM; + +- if (phydev->drv->phy_id != ATH8030_PHY_ID) ++ if (phydev->drv->phy_id != ATH8030_PHY_ID && ++ phydev->drv->phy_id != ATH8032_PHY_ID) + goto does_not_require_reset_workaround; + + gpiod_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); +@@ -336,7 +338,7 @@ static void at803x_link_change_notify(st + struct at803x_priv *priv = phydev->priv; + + /* +- * Conduct a hardware reset for AT8030 every time a link loss is ++ * Conduct a hardware reset for AT8030/2 every time a link loss is + * signalled. This is necessary to circumvent a hardware bug that + * occurs when the cable is unplugged while TX packets are pending + * in the FIFO. In such cases, the FIFO enters an error mode it +@@ -448,6 +450,24 @@ static struct phy_driver at803x_driver[] + .aneg_done = at803x_aneg_done, + .ack_interrupt = &at803x_ack_interrupt, + .config_intr = &at803x_config_intr, ++}, { ++ /* ATHEROS 8032 */ ++ .phy_id = ATH8032_PHY_ID, ++ .name = "Atheros 8032 ethernet", ++ .phy_id_mask = 0xffffffef, ++ .probe = at803x_probe, ++ .config_init = at803x_config_init, ++ .link_change_notify = at803x_link_change_notify, ++ .set_wol = at803x_set_wol, ++ .get_wol = at803x_get_wol, ++ .suspend = at803x_suspend, ++ .resume = at803x_resume, ++ .features = PHY_BASIC_FEATURES, ++ .flags = PHY_HAS_INTERRUPT, ++ .config_aneg = genphy_config_aneg, ++ .read_status = genphy_read_status, ++ .ack_interrupt = at803x_ack_interrupt, ++ .config_intr = at803x_config_intr, + } }; + + module_phy_driver(at803x_driver); +@@ -455,6 +475,7 @@ module_phy_driver(at803x_driver); + static struct mdio_device_id __maybe_unused atheros_tbl[] = { + { ATH8030_PHY_ID, AT803X_PHY_ID_MASK }, + { ATH8031_PHY_ID, AT803X_PHY_ID_MASK }, ++ { ATH8032_PHY_ID, AT803X_PHY_ID_MASK }, + { ATH8035_PHY_ID, AT803X_PHY_ID_MASK }, + { } + }; diff --git a/target/linux/generic/pending-4.14/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch b/target/linux/generic/pending-4.14/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch new file mode 100644 index 0000000000..d8aea32b5a --- /dev/null +++ b/target/linux/generic/pending-4.14/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch @@ -0,0 +1,43 @@ +From patchwork Fri Jul 21 18:36:24 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [2/5] e1000e: Fix wrong comment related to link detection +From: Benjamin Poirier +X-Patchwork-Id: 9857489 +Message-Id: <20170721183627.13373-2-bpoirier@suse.com> +To: Jeff Kirsher +Cc: Lennart Sorensen , + intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +Date: Fri, 21 Jul 2017 11:36:24 -0700 + +Reading e1000e_check_for_copper_link() shows that get_link_status is set to +false after link has been detected. Therefore, it stays TRUE until then. + +Signed-off-by: Benjamin Poirier +Tested-by: Aaron Brown +--- + drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/intel/e1000e/netdev.c ++++ b/drivers/net/ethernet/intel/e1000e/netdev.c +@@ -5096,7 +5096,7 @@ static bool e1000e_has_link(struct e1000 + + /* get_link_status is set on LSC (link status) interrupt or + * Rx sequence error interrupt. get_link_status will stay +- * false until the check_for_link establishes link ++ * true until the check_for_link establishes link + * for copper adapters ONLY + */ + switch (hw->phy.media_type) { +@@ -5114,7 +5114,7 @@ static bool e1000e_has_link(struct e1000 + break; + case e1000_media_type_internal_serdes: + ret_val = hw->mac.ops.check_for_link(hw); +- link_active = adapter->hw.mac.serdes_has_link; ++ link_active = hw->mac.serdes_has_link; + break; + default: + case e1000_media_type_unknown: diff --git a/target/linux/generic/pending-4.14/201-extra_optimization.patch b/target/linux/generic/pending-4.14/201-extra_optimization.patch new file mode 100644 index 0000000000..81f7e2664e --- /dev/null +++ b/target/linux/generic/pending-4.14/201-extra_optimization.patch @@ -0,0 +1,32 @@ +From: Felix Fietkau +Subject: Upgrade to Linux 2.6.19 + +- Includes large parts of the patch from #1021 by dpalffy +- Includes RB532 NAND driver changes by n0-1 + +[john@phrozen.org: feix will add this to his upstream queue] + +lede-commit: bff468813f78f81e36ebb2a3f4354de7365e640f +Signed-off-by: Felix Fietkau +--- + Makefile | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/Makefile ++++ b/Makefile +@@ -638,12 +638,12 @@ KBUILD_CFLAGS += $(call cc-disable-warni + + ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE + KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) +-KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) ++KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) $(EXTRA_OPTIMIZATION) + else + ifdef CONFIG_PROFILE_ALL_BRANCHES +-KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,) ++KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,) $(EXTRA_OPTIMIZATION) + else +-KBUILD_CFLAGS += -O2 ++KBUILD_CFLAGS += -O2 -fno-reorder-blocks -fno-tree-ch $(EXTRA_OPTIMIZATION) + endif + endif + diff --git a/target/linux/generic/pending-4.14/203-kallsyms_uncompressed.patch b/target/linux/generic/pending-4.14/203-kallsyms_uncompressed.patch new file mode 100644 index 0000000000..fa68f307d4 --- /dev/null +++ b/target/linux/generic/pending-4.14/203-kallsyms_uncompressed.patch @@ -0,0 +1,119 @@ +From: Felix Fietkau +Subject: kernel: add a config option for keeping the kallsyms table uncompressed, saving ~9kb kernel size after lzma on ar71xx + +[john@phrozen.org: added to my upstream queue 30.12.2016] +lede-commit: e0e3509b5ce2ccf93d4d67ea907613f5f7ec2eed +Signed-off-by: Felix Fietkau +--- + init/Kconfig | 11 +++++++++++ + kernel/kallsyms.c | 8 ++++++++ + scripts/kallsyms.c | 12 ++++++++++++ + scripts/link-vmlinux.sh | 4 ++++ + 4 files changed, 35 insertions(+) + +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -1081,6 +1081,17 @@ config SYSCTL_ARCH_UNALIGN_ALLOW + the unaligned access emulation. + see arch/parisc/kernel/unaligned.c for reference + ++config KALLSYMS_UNCOMPRESSED ++ bool "Keep kallsyms uncompressed" ++ depends on KALLSYMS ++ help ++ Normally kallsyms contains compressed symbols (using a token table), ++ reducing the uncompressed kernel image size. Keeping the symbol table ++ uncompressed significantly improves the size of this part in compressed ++ kernel images. ++ ++ Say N unless you need compressed kernel images to be small. ++ + config HAVE_PCSPKR_PLATFORM + bool + +--- a/kernel/kallsyms.c ++++ b/kernel/kallsyms.c +@@ -108,6 +108,11 @@ static unsigned int kallsyms_expand_symb + * For every byte on the compressed symbol data, copy the table + * entry for that byte. + */ ++#ifdef CONFIG_KALLSYMS_UNCOMPRESSED ++ memcpy(result, data + 1, len - 1); ++ result += len - 1; ++ len = 0; ++#endif + while (len) { + tptr = &kallsyms_token_table[kallsyms_token_index[*data]]; + data++; +@@ -140,6 +145,9 @@ tail: + */ + static char kallsyms_get_symbol_type(unsigned int off) + { ++#ifdef CONFIG_KALLSYMS_UNCOMPRESSED ++ return kallsyms_names[off + 1]; ++#endif + /* + * Get just the first code, look it up in the token table, + * and return the first char from this token. +--- a/scripts/kallsyms.c ++++ b/scripts/kallsyms.c +@@ -61,6 +61,7 @@ static struct addr_range percpu_range = + static struct sym_entry *table; + static unsigned int table_size, table_cnt; + static int all_symbols = 0; ++static int uncompressed = 0; + static int absolute_percpu = 0; + static char symbol_prefix_char = '\0'; + static int base_relative = 0; +@@ -457,6 +458,9 @@ static void write_src(void) + + free(markers); + ++ if (uncompressed) ++ return; ++ + output_label("kallsyms_token_table"); + off = 0; + for (i = 0; i < 256; i++) { +@@ -515,6 +519,9 @@ static void *find_token(unsigned char *s + { + int i; + ++ if (uncompressed) ++ return NULL; ++ + for (i = 0; i < len - 1; i++) { + if (str[i] == token[0] && str[i+1] == token[1]) + return &str[i]; +@@ -587,6 +594,9 @@ static void optimize_result(void) + { + int i, best; + ++ if (uncompressed) ++ return; ++ + /* using the '\0' symbol last allows compress_symbols to use standard + * fast string functions */ + for (i = 255; i >= 0; i--) { +@@ -775,6 +785,8 @@ int main(int argc, char **argv) + symbol_prefix_char = *p; + } else if (strcmp(argv[i], "--base-relative") == 0) + base_relative = 1; ++ else if (strcmp(argv[i], "--uncompressed") == 0) ++ uncompressed = 1; + else + usage(); + } +--- a/scripts/link-vmlinux.sh ++++ b/scripts/link-vmlinux.sh +@@ -164,6 +164,10 @@ kallsyms() + kallsymopt="${kallsymopt} --base-relative" + fi + ++ if [ -n "${CONFIG_KALLSYMS_UNCOMPRESSED}" ]; then ++ kallsymopt="${kallsymopt} --uncompressed" ++ fi ++ + local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \ + ${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}" + diff --git a/target/linux/generic/pending-4.14/205-backtrace_module_info.patch b/target/linux/generic/pending-4.14/205-backtrace_module_info.patch new file mode 100644 index 0000000000..4040f91021 --- /dev/null +++ b/target/linux/generic/pending-4.14/205-backtrace_module_info.patch @@ -0,0 +1,45 @@ +From: Felix Fietkau +Subject: kernel: when KALLSYMS is disabled, print module address + size for matching backtrace entries + +[john@phrozen.org: felix will add this to his upstream queue] + +lede-commit 53827cdc824556cda910b23ce5030c363b8f1461 +Signed-off-by: Felix Fietkau +--- + lib/vsprintf.c | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +--- a/lib/vsprintf.c ++++ b/lib/vsprintf.c +@@ -670,8 +670,10 @@ char *symbol_string(char *buf, char *end + struct printf_spec spec, const char *fmt) + { + unsigned long value; +-#ifdef CONFIG_KALLSYMS + char sym[KSYM_SYMBOL_LEN]; ++#ifndef CONFIG_KALLSYMS ++ struct module *mod; ++ int len; + #endif + + if (fmt[1] == 'R') +@@ -685,11 +687,16 @@ char *symbol_string(char *buf, char *end + sprint_symbol(sym, value); + else + sprint_symbol_no_offset(sym, value); +- +- return string(buf, end, sym, spec); + #else +- return special_hex_number(buf, end, value, sizeof(void *)); ++ len = snprintf(sym, sizeof(sym), "0x%lx", value); ++ ++ mod = __module_address(value); ++ if (mod) ++ snprintf(sym + len, sizeof(sym) - len, " [%s@%p+0x%x]", ++ mod->name, mod->core_layout.base, ++ mod->core_layout.size); + #endif ++ return string(buf, end, sym, spec); + } + + static noinline_for_stack diff --git a/target/linux/generic/pending-4.14/206-mips-disable-vdso.patch b/target/linux/generic/pending-4.14/206-mips-disable-vdso.patch new file mode 100644 index 0000000000..f3c58dcd3a --- /dev/null +++ b/target/linux/generic/pending-4.14/206-mips-disable-vdso.patch @@ -0,0 +1,23 @@ +From: Felix Fietkau +Subject: kernel: disable MIPS VDSO by default until the cache issues have been resolved + +lede-commit: 1185e645a773c86aa88cf04d0e2911dc62eb43f5 +Signed-off-by: Felix Fietkau +--- + arch/mips/vdso/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/mips/vdso/Makefile ++++ b/arch/mips/vdso/Makefile +@@ -30,9 +30,9 @@ aflags-vdso := $(ccflags-vdso) \ + ifndef CONFIG_CPU_MIPSR6 + ifeq ($(call ld-ifversion, -lt, 225000000, y),y) + $(warning MIPS VDSO requires binutils >= 2.25) +- obj-vdso-y := $(filter-out gettimeofday.o, $(obj-vdso-y)) +- ccflags-vdso += -DDISABLE_MIPS_VDSO + endif ++ obj-vdso-y := $(filter-out gettimeofday.o, $(obj-vdso-y)) ++ ccflags-vdso += -DDISABLE_MIPS_VDSO + endif + + # VDSO linker flags. diff --git a/target/linux/generic/pending-4.14/240-remove-unsane-filenames-from-deps_initramfs-list.patch b/target/linux/generic/pending-4.14/240-remove-unsane-filenames-from-deps_initramfs-list.patch new file mode 100644 index 0000000000..f440305c9b --- /dev/null +++ b/target/linux/generic/pending-4.14/240-remove-unsane-filenames-from-deps_initramfs-list.patch @@ -0,0 +1,46 @@ +From: Gabor Juhos +Subject: usr: sanitize deps_initramfs list + +If any filename in the intramfs dependency +list contains a colon, that causes a kernel +build error like this: + +/devel/openwrt/build_dir/linux-ar71xx_generic/linux-3.6.6/usr/Makefile:58: *** multiple target patterns. Stop. +make[5]: *** [usr] Error 2 + +Fix it by removing such filenames from the +deps_initramfs list. + +Signed-off-by: Gabor Juhos +--- + usr/Makefile | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- a/usr/Makefile ++++ b/usr/Makefile +@@ -39,20 +39,22 @@ ifneq ($(wildcard $(obj)/$(datafile_d_y) + include $(obj)/$(datafile_d_y) + endif + ++deps_initramfs_sane := $(foreach v,$(deps_initramfs),$(if $(findstring :,$(v)),,$(v))) ++ + quiet_cmd_initfs = GEN $@ + cmd_initfs = $(initramfs) -o $@ $(ramfs-args) $(ramfs-input) + + targets := $(datafile_y) + + # do not try to update files included in initramfs +-$(deps_initramfs): ; ++$(deps_initramfs_sane): ; + +-$(deps_initramfs): klibcdirs ++$(deps_initramfs_sane): klibcdirs + # We rebuild initramfs_data.cpio if: + # 1) Any included file is newer then initramfs_data.cpio + # 2) There are changes in which files are included (added or deleted) + # 3) If gen_init_cpio are newer than initramfs_data.cpio + # 4) arguments to gen_initramfs.sh changes +-$(obj)/$(datafile_y): $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs ++$(obj)/$(datafile_y): $(obj)/gen_init_cpio $(deps_initramfs_sane) klibcdirs + $(Q)$(initramfs) -l $(ramfs-input) > $(obj)/$(datafile_d_y) + $(call if_changed,initfs) diff --git a/target/linux/generic/pending-4.14/261-enable_wilink_platform_without_drivers.patch b/target/linux/generic/pending-4.14/261-enable_wilink_platform_without_drivers.patch new file mode 100644 index 0000000000..9955ab3c0b --- /dev/null +++ b/target/linux/generic/pending-4.14/261-enable_wilink_platform_without_drivers.patch @@ -0,0 +1,20 @@ +From: Imre Kaloz +Subject: [PATCH] hack: net: wireless: make the wl12xx glue code available with + compat-wireless, too + +Signed-off-by: Imre Kaloz +--- + drivers/net/wireless/ti/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/wireless/ti/Kconfig ++++ b/drivers/net/wireless/ti/Kconfig +@@ -19,7 +19,7 @@ source "drivers/net/wireless/ti/wlcore/K + + config WILINK_PLATFORM_DATA + bool "TI WiLink platform data" +- depends on WLCORE_SDIO || WL1251_SDIO ++ depends on WLCORE_SDIO || WL1251_SDIO || ARCH_OMAP2PLUS + default y + ---help--- + Small platform data bit needed to pass data to the sdio modules. diff --git a/target/linux/generic/pending-4.14/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch b/target/linux/generic/pending-4.14/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch new file mode 100644 index 0000000000..9ec8daf886 --- /dev/null +++ b/target/linux/generic/pending-4.14/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch @@ -0,0 +1,32 @@ +From: David Heidelberger +Subject: uapi/kernel.h: glibc specific inclusion of sysinfo.h + +including sysinfo.h from kernel.h makes no sense whatsoever, +but removing it breaks glibc's userspace header, +which includes kernel.h instead of sysinfo.h from their sys/sysinfo.h. +this seems to be a historical mistake. +on musl, including any header that uses kernel.h directly or indirectly +plus sys/sysinfo.h will produce a compile error due to redefinition of +struct sysinfo from sys/sysinfo.h. +so for now, only include it on glibc or when including from kernel +in order not to break their headers. + +Signed-off-by: John Spencer +Signed-off-by: David Heidelberger +Signed-off-by: Jonas Gorski +--- + include/uapi/linux/kernel.h | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/include/uapi/linux/kernel.h ++++ b/include/uapi/linux/kernel.h +@@ -2,7 +2,9 @@ + #ifndef _UAPI_LINUX_KERNEL_H + #define _UAPI_LINUX_KERNEL_H + ++#if defined(__KERNEL__) || defined( __GLIBC__) + #include ++#endif + + /* + * 'kernel.h' contains some often-used function prototypes etc diff --git a/target/linux/generic/pending-4.14/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch b/target/linux/generic/pending-4.14/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch new file mode 100644 index 0000000000..9ae148da4f --- /dev/null +++ b/target/linux/generic/pending-4.14/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch @@ -0,0 +1,105 @@ +From: David Heidelberger +Subject: uapi/libc-compat.h: do not rely on __GLIBC__ + +Musl provides the same structs as glibc, but does not provide a define to +allow its detection. Since the absence of __GLIBC__ also can mean that it +is included from the kernel, change the __GLIBC__ detection to +!__KERNEL__, which should always be true when included from userspace. + +Signed-off-by: John Spencer +Tested-by: David Heidelberger +Signed-off-by: Jonas Gorski +--- + include/uapi/linux/libc-compat.h | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +--- a/include/uapi/linux/libc-compat.h ++++ b/include/uapi/linux/libc-compat.h +@@ -49,13 +49,13 @@ + #ifndef _UAPI_LIBC_COMPAT_H + #define _UAPI_LIBC_COMPAT_H + +-/* We have included glibc headers... */ +-#if defined(__GLIBC__) ++/* We have included libc headers... */ ++#if !defined(__KERNEL__) + +-/* Coordinate with glibc net/if.h header. */ +-#if defined(_NET_IF_H) && defined(__USE_MISC) ++/* Coordinate with libc net/if.h header. */ ++#if defined(_NET_IF_H) && (!defined(__GLIBC__) || defined(__USE_MISC)) + +-/* GLIBC headers included first so don't define anything ++/* LIBC headers included first so don't define anything + * that would already be defined. */ + + #define __UAPI_DEF_IF_IFCONF 0 +@@ -66,7 +66,11 @@ + #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0 + /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */ + #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO ++#ifdef __GLIBC__ + #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1 ++#else ++#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0 ++#endif + #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */ + + #else /* _NET_IF_H */ +@@ -86,10 +90,10 @@ + + #endif /* _NET_IF_H */ + +-/* Coordinate with glibc netinet/in.h header. */ ++/* Coordinate with libc netinet/in.h header. */ + #if defined(_NETINET_IN_H) + +-/* GLIBC headers included first so don't define anything ++/* LIBC headers included first so don't define anything + * that would already be defined. */ + #define __UAPI_DEF_IN_ADDR 0 + #define __UAPI_DEF_IN_IPPROTO 0 +@@ -103,7 +107,7 @@ + * if the glibc code didn't define them. This guard matches + * the guard in glibc/inet/netinet/in.h which defines the + * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */ +-#if defined(__USE_MISC) || defined (__USE_GNU) ++#if !defined(__GLIBC__) || defined(__USE_MISC) || defined (__USE_GNU) + #define __UAPI_DEF_IN6_ADDR_ALT 0 + #else + #define __UAPI_DEF_IN6_ADDR_ALT 1 +@@ -118,7 +122,7 @@ + #else + + /* Linux headers included first, and we must define everything +- * we need. The expectation is that glibc will check the ++ * we need. The expectation is that the libc will check the + * __UAPI_DEF_* defines and adjust appropriately. */ + #define __UAPI_DEF_IN_ADDR 1 + #define __UAPI_DEF_IN_IPPROTO 1 +@@ -128,7 +132,7 @@ + #define __UAPI_DEF_IN_CLASS 1 + + #define __UAPI_DEF_IN6_ADDR 1 +-/* We unconditionally define the in6_addr macros and glibc must ++/* We unconditionally define the in6_addr macros and the libc must + * coordinate. */ + #define __UAPI_DEF_IN6_ADDR_ALT 1 + #define __UAPI_DEF_SOCKADDR_IN6 1 +@@ -169,7 +173,7 @@ + /* If we did not see any headers from any supported C libraries, + * or we are being included in the kernel, then define everything + * that we need. */ +-#else /* !defined(__GLIBC__) */ ++#else /* defined(__KERNEL__) */ + + /* Definitions for if.h */ + #define __UAPI_DEF_IF_IFCONF 1 +@@ -209,6 +213,6 @@ + /* Definitions for xattr.h */ + #define __UAPI_DEF_XATTR 1 + +-#endif /* __GLIBC__ */ ++#endif /* __KERNEL__ */ + + #endif /* _UAPI_LIBC_COMPAT_H */ diff --git a/target/linux/generic/pending-4.14/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch b/target/linux/generic/pending-4.14/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch new file mode 100644 index 0000000000..1dca07328d --- /dev/null +++ b/target/linux/generic/pending-4.14/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch @@ -0,0 +1,65 @@ +From: David Heidelberger +Subject: uapi/if_ether.h: prevent redefinition of struct ethhdr + +Musl provides its own ethhdr struct definition. Add a guard to prevent +its definition of the appropriate musl header has already been included. + +Signed-off-by: John Spencer +Tested-by: David Heidelberger +Signed-off-by: Jonas Gorski +--- + include/uapi/linux/if_ether.h | 3 +++ + include/uapi/linux/libc-compat.h | 11 +++++++++++ + 2 files changed, 14 insertions(+) + +--- a/include/uapi/linux/if_ether.h ++++ b/include/uapi/linux/if_ether.h +@@ -23,6 +23,7 @@ + #define _UAPI_LINUX_IF_ETHER_H + + #include ++#include + + /* + * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble +@@ -149,11 +150,13 @@ + * This is an Ethernet frame header. + */ + ++#if __UAPI_DEF_ETHHDR + struct ethhdr { + unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ + unsigned char h_source[ETH_ALEN]; /* source ether addr */ + __be16 h_proto; /* packet type ID field */ + } __attribute__((packed)); ++#endif + + + #endif /* _UAPI_LINUX_IF_ETHER_H */ +--- a/include/uapi/linux/libc-compat.h ++++ b/include/uapi/linux/libc-compat.h +@@ -90,6 +90,14 @@ + + #endif /* _NET_IF_H */ + ++/* musl defines the ethhdr struct itself in its netinet/if_ether.h. ++ * Glibc just includes the kernel header and uses a different guard. */ ++#if defined(_NETINET_IF_ETHER_H) ++#define __UAPI_DEF_ETHHDR 0 ++#else ++#define __UAPI_DEF_ETHHDR 1 ++#endif ++ + /* Coordinate with libc netinet/in.h header. */ + #if defined(_NETINET_IN_H) + +@@ -185,6 +193,9 @@ + /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */ + #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1 + ++/* Definitions for if_ether.h */ ++#define __UAPI_DEF_ETHHDR 1 ++ + /* Definitions for in.h */ + #define __UAPI_DEF_IN_ADDR 1 + #define __UAPI_DEF_IN_IPPROTO 1 diff --git a/target/linux/generic/pending-4.14/300-mips_expose_boot_raw.patch b/target/linux/generic/pending-4.14/300-mips_expose_boot_raw.patch new file mode 100644 index 0000000000..9419e9916b --- /dev/null +++ b/target/linux/generic/pending-4.14/300-mips_expose_boot_raw.patch @@ -0,0 +1,40 @@ +From: Mark Miller +Subject: mips: expose CONFIG_BOOT_RAW + +This exposes the CONFIG_BOOT_RAW symbol in Kconfig. This is needed on +certain Broadcom chipsets running CFE in order to load the kernel. + +Signed-off-by: Mark Miller +Acked-by: Rob Landley +--- +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -1066,9 +1066,6 @@ config FW_ARC + config ARCH_MAY_HAVE_PC_FDC + bool + +-config BOOT_RAW +- bool +- + config CEVT_BCM1480 + bool + +@@ -2966,6 +2963,18 @@ choice + bool "Extend builtin kernel arguments with bootloader arguments" + endchoice + ++config BOOT_RAW ++ bool "Enable the kernel to be executed from the load address" ++ default n ++ help ++ Allow the kernel to be executed from the load address for ++ bootloaders which cannot read the ELF format. This places ++ a jump to start_kernel at the load address. ++ ++ If unsure, say N. ++ ++ ++ + endmenu + + config LOCKDEP_SUPPORT diff --git a/target/linux/generic/pending-4.14/302-mips_no_branch_likely.patch b/target/linux/generic/pending-4.14/302-mips_no_branch_likely.patch new file mode 100644 index 0000000000..0e4600237d --- /dev/null +++ b/target/linux/generic/pending-4.14/302-mips_no_branch_likely.patch @@ -0,0 +1,22 @@ +From: Felix Fietkau +Subject: mips: use -mno-branch-likely for kernel and userspace + +saves ~11k kernel size after lzma and ~12k squashfs size in the + +lede-commit: 41a039f46450ffae9483d6216422098669da2900 +Signed-off-by: Felix Fietkau +--- + arch/mips/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/Makefile ++++ b/arch/mips/Makefile +@@ -90,7 +90,7 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlin + # machines may also. Since BFD is incredibly buggy with respect to + # crossformat linking we rely on the elf2ecoff tool for format conversion. + # +-cflags-y += -G 0 -mno-abicalls -fno-pic -pipe ++cflags-y += -G 0 -mno-abicalls -fno-pic -pipe -mno-branch-likely + cflags-y += -msoft-float + LDFLAGS_vmlinux += -G 0 -static -n -nostdlib + KBUILD_AFLAGS_MODULE += -mlong-calls diff --git a/target/linux/generic/pending-4.14/304-mips_disable_fpu.patch b/target/linux/generic/pending-4.14/304-mips_disable_fpu.patch new file mode 100644 index 0000000000..bee62b2664 --- /dev/null +++ b/target/linux/generic/pending-4.14/304-mips_disable_fpu.patch @@ -0,0 +1,137 @@ +From: Manuel Lauss +Subject: [RFC PATCH v4 2/2] MIPS: make FPU emulator optional + +This small patch makes the MIPS FPU emulator optional. The kernel +kills float-users on systems without a hardware FPU by sending a SIGILL. + +Disabling the emulator shrinks vmlinux by about 54kBytes (32bit, +optimizing for size). + +Signed-off-by: Manuel Lauss +--- +v4: rediffed because of patch 1/2, should now work with micromips as well +v3: updated patch description with size savings. +v2: incorporated changes suggested by Jonas Gorski + force the fpu emulator on for micromips: relocating the parts + of the mmips code in the emulator to other areas would be a + much larger change; I went the cheap route instead with this. + + arch/mips/Kbuild | 2 +- + arch/mips/Kconfig | 14 ++++++++++++++ + arch/mips/include/asm/fpu.h | 5 +++-- + arch/mips/include/asm/fpu_emulator.h | 15 +++++++++++++++ + 4 files changed, 33 insertions(+), 3 deletions(-) + +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -2890,6 +2890,20 @@ config MIPS_O32_FP64_SUPPORT + + If unsure, say N. + ++config MIPS_FPU_EMULATOR ++ bool "MIPS FPU Emulator" ++ default y ++ help ++ This option lets you disable the built-in MIPS FPU (Coprocessor 1) ++ emulator, which handles floating-point instructions on processors ++ without a hardware FPU. It is generally a good idea to keep the ++ emulator built-in, unless you are perfectly sure you have a ++ complete soft-float environment. With the emulator disabled, all ++ users of float operations will be killed with an illegal instr- ++ uction exception. ++ ++ Say Y, please. ++ + config USE_OF + bool + select OF +--- a/arch/mips/Makefile ++++ b/arch/mips/Makefile +@@ -319,7 +319,7 @@ OBJCOPYFLAGS += --remove-section=.regin + head-y := arch/mips/kernel/head.o + + libs-y += arch/mips/lib/ +-libs-y += arch/mips/math-emu/ ++libs-$(CONFIG_MIPS_FPU_EMULATOR) += arch/mips/math-emu/ + + # See arch/mips/Kbuild for content of core part of the kernel + core-y += arch/mips/ +--- a/arch/mips/include/asm/fpu.h ++++ b/arch/mips/include/asm/fpu.h +@@ -230,8 +230,10 @@ static inline int init_fpu(void) + /* Restore FRE */ + write_c0_config5(config5); + enable_fpu_hazard(); +- } else ++ } else if (IS_ENABLED(CONFIG_MIPS_FPU_EMULATOR)) + fpu_emulator_init_fpu(); ++ else ++ ret = SIGILL; + + return ret; + } +--- a/arch/mips/include/asm/fpu_emulator.h ++++ b/arch/mips/include/asm/fpu_emulator.h +@@ -30,6 +30,7 @@ + #include + #include + ++#ifdef CONFIG_MIPS_FPU_EMULATOR + #ifdef CONFIG_DEBUG_FS + + struct mips_fpu_emulator_stats { +@@ -179,6 +180,16 @@ do { \ + extern int fpu_emulator_cop1Handler(struct pt_regs *xcp, + struct mips_fpu_struct *ctx, int has_fpu, + void __user **fault_addr); ++#else /* no CONFIG_MIPS_FPU_EMULATOR */ ++static inline int fpu_emulator_cop1Handler(struct pt_regs *xcp, ++ struct mips_fpu_struct *ctx, int has_fpu, ++ void __user **fault_addr) ++{ ++ *fault_addr = NULL; ++ return SIGILL; /* we don't speak MIPS FPU */ ++} ++#endif /* CONFIG_MIPS_FPU_EMULATOR */ ++ + void force_fcr31_sig(unsigned long fcr31, void __user *fault_addr, + struct task_struct *tsk); + int process_fpemu_return(int sig, void __user *fault_addr, +--- a/arch/mips/include/asm/dsemul.h ++++ b/arch/mips/include/asm/dsemul.h +@@ -41,6 +41,7 @@ struct task_struct; + extern int mips_dsemul(struct pt_regs *regs, mips_instruction ir, + unsigned long branch_pc, unsigned long cont_pc); + ++#ifdef CONFIG_MIPS_FPU_EMULATOR + /** + * do_dsemulret() - Return from a delay slot 'emulation' frame + * @xcp: User thread register context. +@@ -88,5 +89,27 @@ extern bool dsemul_thread_rollback(struc + * before @mm is freed in order to avoid memory leaks. + */ + extern void dsemul_mm_cleanup(struct mm_struct *mm); ++#else ++static inline bool do_dsemulret(struct pt_regs *xcp) ++{ ++ return false; ++} ++ ++static inline bool dsemul_thread_cleanup(struct task_struct *tsk) ++{ ++ return false; ++} ++ ++static inline bool dsemul_thread_rollback(struct pt_regs *regs) ++{ ++ return false; ++} ++ ++static inline void dsemul_mm_cleanup(struct mm_struct *mm) ++{ ++ ++} ++ ++#endif + + #endif /* __MIPS_ASM_DSEMUL_H__ */ diff --git a/target/linux/generic/pending-4.14/305-mips_module_reloc.patch b/target/linux/generic/pending-4.14/305-mips_module_reloc.patch new file mode 100644 index 0000000000..253b50f62c --- /dev/null +++ b/target/linux/generic/pending-4.14/305-mips_module_reloc.patch @@ -0,0 +1,366 @@ +From: Felix Fietkau +Subject: mips: replace -mlong-calls with -mno-long-calls to make function calls faster in kernel modules to achieve this, try to + +lede-commit: 3b3d64743ba2a874df9d70cd19e242205b0a788c +Signed-off-by: Felix Fietkau +--- + arch/mips/Makefile | 5 + + arch/mips/include/asm/module.h | 5 + + arch/mips/kernel/module.c | 279 ++++++++++++++++++++++++++++++++++++++++- + 3 files changed, 284 insertions(+), 5 deletions(-) + +--- a/arch/mips/Makefile ++++ b/arch/mips/Makefile +@@ -93,8 +93,13 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlin + cflags-y += -G 0 -mno-abicalls -fno-pic -pipe -mno-branch-likely + cflags-y += -msoft-float + LDFLAGS_vmlinux += -G 0 -static -n -nostdlib ++ifdef CONFIG_64BIT + KBUILD_AFLAGS_MODULE += -mlong-calls + KBUILD_CFLAGS_MODULE += -mlong-calls ++else ++KBUILD_AFLAGS_MODULE += -mno-long-calls ++KBUILD_CFLAGS_MODULE += -mno-long-calls ++endif + + ifeq ($(CONFIG_RELOCATABLE),y) + LDFLAGS_vmlinux += --emit-relocs +--- a/arch/mips/include/asm/module.h ++++ b/arch/mips/include/asm/module.h +@@ -12,6 +12,11 @@ struct mod_arch_specific { + const struct exception_table_entry *dbe_start; + const struct exception_table_entry *dbe_end; + struct mips_hi16 *r_mips_hi16_list; ++ ++ void *phys_plt_tbl; ++ void *virt_plt_tbl; ++ unsigned int phys_plt_offset; ++ unsigned int virt_plt_offset; + }; + + typedef uint8_t Elf64_Byte; /* Type for a 8-bit quantity. */ +--- a/arch/mips/kernel/module.c ++++ b/arch/mips/kernel/module.c +@@ -44,14 +44,221 @@ struct mips_hi16 { + static LIST_HEAD(dbe_list); + static DEFINE_SPINLOCK(dbe_lock); + +-#ifdef MODULE_START ++/* ++ * Get the potential max trampolines size required of the init and ++ * non-init sections. Only used if we cannot find enough contiguous ++ * physically mapped memory to put the module into. ++ */ ++static unsigned int ++get_plt_size(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, ++ const char *secstrings, unsigned int symindex, bool is_init) ++{ ++ unsigned long ret = 0; ++ unsigned int i, j; ++ Elf_Sym *syms; ++ ++ /* Everything marked ALLOC (this includes the exported symbols) */ ++ for (i = 1; i < hdr->e_shnum; ++i) { ++ unsigned int info = sechdrs[i].sh_info; ++ ++ if (sechdrs[i].sh_type != SHT_REL ++ && sechdrs[i].sh_type != SHT_RELA) ++ continue; ++ ++ /* Not a valid relocation section? */ ++ if (info >= hdr->e_shnum) ++ continue; ++ ++ /* Don't bother with non-allocated sections */ ++ if (!(sechdrs[info].sh_flags & SHF_ALLOC)) ++ continue; ++ ++ /* If it's called *.init*, and we're not init, we're ++ not interested */ ++ if ((strstr(secstrings + sechdrs[i].sh_name, ".init") != 0) ++ != is_init) ++ continue; ++ ++ syms = (Elf_Sym *) sechdrs[symindex].sh_addr; ++ if (sechdrs[i].sh_type == SHT_REL) { ++ Elf_Mips_Rel *rel = (void *) sechdrs[i].sh_addr; ++ unsigned int size = sechdrs[i].sh_size / sizeof(*rel); ++ ++ for (j = 0; j < size; ++j) { ++ Elf_Sym *sym; ++ ++ if (ELF_MIPS_R_TYPE(rel[j]) != R_MIPS_26) ++ continue; ++ ++ sym = syms + ELF_MIPS_R_SYM(rel[j]); ++ if (!is_init && sym->st_shndx != SHN_UNDEF) ++ continue; ++ ++ ret += 4 * sizeof(int); ++ } ++ } else { ++ Elf_Mips_Rela *rela = (void *) sechdrs[i].sh_addr; ++ unsigned int size = sechdrs[i].sh_size / sizeof(*rela); ++ ++ for (j = 0; j < size; ++j) { ++ Elf_Sym *sym; ++ ++ if (ELF_MIPS_R_TYPE(rela[j]) != R_MIPS_26) ++ continue; ++ ++ sym = syms + ELF_MIPS_R_SYM(rela[j]); ++ if (!is_init && sym->st_shndx != SHN_UNDEF) ++ continue; ++ ++ ret += 4 * sizeof(int); ++ } ++ } ++ } ++ ++ return ret; ++} ++ ++#ifndef MODULE_START ++static void *alloc_phys(unsigned long size) ++{ ++ unsigned order; ++ struct page *page; ++ struct page *p; ++ ++ size = PAGE_ALIGN(size); ++ order = get_order(size); ++ ++ page = alloc_pages(GFP_KERNEL | __GFP_NORETRY | __GFP_NOWARN | ++ __GFP_THISNODE, order); ++ if (!page) ++ return NULL; ++ ++ split_page(page, order); ++ ++ /* mark all pages except for the last one */ ++ for (p = page; p + 1 < page + (size >> PAGE_SHIFT); ++p) ++ set_bit(PG_owner_priv_1, &p->flags); ++ ++ for (p = page + (size >> PAGE_SHIFT); p < page + (1 << order); ++p) ++ __free_page(p); ++ ++ return page_address(page); ++} ++#endif ++ ++static void free_phys(void *ptr) ++{ ++ struct page *page; ++ bool free; ++ ++ page = virt_to_page(ptr); ++ do { ++ free = test_and_clear_bit(PG_owner_priv_1, &page->flags); ++ __free_page(page); ++ page++; ++ } while (free); ++} ++ ++ + void *module_alloc(unsigned long size) + { ++#ifdef MODULE_START + return __vmalloc_node_range(size, 1, MODULE_START, MODULE_END, + GFP_KERNEL, PAGE_KERNEL, 0, NUMA_NO_NODE, + __builtin_return_address(0)); ++#else ++ void *ptr; ++ ++ if (size == 0) ++ return NULL; ++ ++ ptr = alloc_phys(size); ++ ++ /* If we failed to allocate physically contiguous memory, ++ * fall back to regular vmalloc. The module loader code will ++ * create jump tables to handle long jumps */ ++ if (!ptr) ++ return vmalloc(size); ++ ++ return ptr; ++#endif + } ++ ++static inline bool is_phys_addr(void *ptr) ++{ ++#ifdef CONFIG_64BIT ++ return (KSEGX((unsigned long)ptr) == CKSEG0); ++#else ++ return (KSEGX(ptr) == KSEG0); + #endif ++} ++ ++/* Free memory returned from module_alloc */ ++void module_memfree(void *module_region) ++{ ++ if (is_phys_addr(module_region)) ++ free_phys(module_region); ++ else ++ vfree(module_region); ++} ++ ++static void *__module_alloc(int size, bool phys) ++{ ++ void *ptr; ++ ++ if (phys) ++ ptr = kmalloc(size, GFP_KERNEL); ++ else ++ ptr = vmalloc(size); ++ return ptr; ++} ++ ++static void __module_free(void *ptr) ++{ ++ if (is_phys_addr(ptr)) ++ kfree(ptr); ++ else ++ vfree(ptr); ++} ++ ++int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, ++ char *secstrings, struct module *mod) ++{ ++ unsigned int symindex = 0; ++ unsigned int core_size, init_size; ++ int i; ++ ++ mod->arch.phys_plt_offset = 0; ++ mod->arch.virt_plt_offset = 0; ++ mod->arch.phys_plt_tbl = NULL; ++ mod->arch.virt_plt_tbl = NULL; ++ ++ if (IS_ENABLED(CONFIG_64BIT)) ++ return 0; ++ ++ for (i = 1; i < hdr->e_shnum; i++) ++ if (sechdrs[i].sh_type == SHT_SYMTAB) ++ symindex = i; ++ ++ core_size = get_plt_size(hdr, sechdrs, secstrings, symindex, false); ++ init_size = get_plt_size(hdr, sechdrs, secstrings, symindex, true); ++ ++ if ((core_size + init_size) == 0) ++ return 0; ++ ++ mod->arch.phys_plt_tbl = __module_alloc(core_size + init_size, 1); ++ if (!mod->arch.phys_plt_tbl) ++ return -ENOMEM; ++ ++ mod->arch.virt_plt_tbl = __module_alloc(core_size + init_size, 0); ++ if (!mod->arch.virt_plt_tbl) { ++ __module_free(mod->arch.phys_plt_tbl); ++ mod->arch.phys_plt_tbl = NULL; ++ return -ENOMEM; ++ } ++ ++ return 0; ++} + + static int apply_r_mips_none(struct module *me, u32 *location, + u32 base, Elf_Addr v, bool rela) +@@ -67,9 +274,40 @@ static int apply_r_mips_32(struct module + return 0; + } + ++static Elf_Addr add_plt_entry_to(unsigned *plt_offset, ++ void *start, Elf_Addr v) ++{ ++ unsigned *tramp = start + *plt_offset; ++ *plt_offset += 4 * sizeof(int); ++ ++ /* adjust carry for addiu */ ++ if (v & 0x00008000) ++ v += 0x10000; ++ ++ tramp[0] = 0x3c190000 | (v >> 16); /* lui t9, hi16 */ ++ tramp[1] = 0x27390000 | (v & 0xffff); /* addiu t9, t9, lo16 */ ++ tramp[2] = 0x03200008; /* jr t9 */ ++ tramp[3] = 0x00000000; /* nop */ ++ ++ return (Elf_Addr) tramp; ++} ++ ++static Elf_Addr add_plt_entry(struct module *me, void *location, Elf_Addr v) ++{ ++ if (is_phys_addr(location)) ++ return add_plt_entry_to(&me->arch.phys_plt_offset, ++ me->arch.phys_plt_tbl, v); ++ else ++ return add_plt_entry_to(&me->arch.virt_plt_offset, ++ me->arch.virt_plt_tbl, v); ++ ++} ++ + static int apply_r_mips_26(struct module *me, u32 *location, + u32 base, Elf_Addr v, bool rela) + { ++ u32 ofs = base & 0x03ffffff; ++ + if (v % 4) { + pr_err("module %s: dangerous R_MIPS_26 relocation\n", + me->name); +@@ -77,13 +315,17 @@ static int apply_r_mips_26(struct module + } + + if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) { +- pr_err("module %s: relocation overflow\n", +- me->name); +- return -ENOEXEC; ++ v = add_plt_entry(me, location, v + (ofs << 2)); ++ if (!v) { ++ pr_err("module %s: relocation overflow\n", ++ me->name); ++ return -ENOEXEC; ++ } ++ ofs = 0; + } + + *location = (*location & ~0x03ffffff) | +- ((base + (v >> 2)) & 0x03ffffff); ++ ((ofs + (v >> 2)) & 0x03ffffff); + + return 0; + } +@@ -459,9 +701,36 @@ int module_finalize(const Elf_Ehdr *hdr, + list_add(&me->arch.dbe_list, &dbe_list); + spin_unlock_irq(&dbe_lock); + } ++ ++ /* Get rid of the fixup trampoline if we're running the module ++ * from physically mapped address space */ ++ if (me->arch.phys_plt_offset == 0) { ++ __module_free(me->arch.phys_plt_tbl); ++ me->arch.phys_plt_tbl = NULL; ++ } ++ if (me->arch.virt_plt_offset == 0) { ++ __module_free(me->arch.virt_plt_tbl); ++ me->arch.virt_plt_tbl = NULL; ++ } ++ + return 0; + } + ++void module_arch_freeing_init(struct module *mod) ++{ ++ if (mod->state == MODULE_STATE_LIVE) ++ return; ++ ++ if (mod->arch.phys_plt_tbl) { ++ __module_free(mod->arch.phys_plt_tbl); ++ mod->arch.phys_plt_tbl = NULL; ++ } ++ if (mod->arch.virt_plt_tbl) { ++ __module_free(mod->arch.virt_plt_tbl); ++ mod->arch.virt_plt_tbl = NULL; ++ } ++} ++ + void module_arch_cleanup(struct module *mod) + { + spin_lock_irq(&dbe_lock); diff --git a/target/linux/generic/pending-4.14/306-mips_mem_functions_performance.patch b/target/linux/generic/pending-4.14/306-mips_mem_functions_performance.patch new file mode 100644 index 0000000000..e73cfd61b3 --- /dev/null +++ b/target/linux/generic/pending-4.14/306-mips_mem_functions_performance.patch @@ -0,0 +1,106 @@ +From: Felix Fietkau +Subject: [PATCH] mips: allow the compiler to optimize memset, memcmp, memcpy for better performance and (in some instances) smaller code + +lede-commit: 07e59c7bc7f375f792ec9734be42fe4fa391a8bb +Signed-off-by: Felix Fietkau +--- + arch/mips/boot/compressed/Makefile | 3 ++- + arch/mips/include/asm/string.h | 38 ++++++++++++++++++++++++++++++++++++++ + arch/mips/lib/Makefile | 2 +- + arch/mips/lib/memcmp.c | 22 ++++++++++++++++++++++ + 4 files changed, 63 insertions(+), 2 deletions(-) + create mode 100644 arch/mips/lib/memcmp.c + +--- a/arch/mips/boot/compressed/Makefile ++++ b/arch/mips/boot/compressed/Makefile +@@ -23,7 +23,8 @@ KBUILD_CFLAGS := $(filter-out -pg, $(KBU + KBUILD_CFLAGS := $(filter-out -fstack-protector, $(KBUILD_CFLAGS)) + + KBUILD_CFLAGS := $(KBUILD_CFLAGS) -D__KERNEL__ \ +- -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) -D"VMLINUX_LOAD_ADDRESS_ULL=$(VMLINUX_LOAD_ADDRESS)ull" ++ -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) -D"VMLINUX_LOAD_ADDRESS_ULL=$(VMLINUX_LOAD_ADDRESS)ull" \ ++ -D__ZBOOT__ + + KBUILD_AFLAGS := $(KBUILD_AFLAGS) -D__ASSEMBLY__ \ + -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) \ +--- a/arch/mips/include/asm/string.h ++++ b/arch/mips/include/asm/string.h +@@ -140,4 +140,42 @@ extern void *memcpy(void *__to, __const_ + #define __HAVE_ARCH_MEMMOVE + extern void *memmove(void *__dest, __const__ void *__src, size_t __n); + ++#ifndef __ZBOOT__ ++#define memset(__s, __c, len) \ ++({ \ ++ size_t __len = (len); \ ++ void *__ret; \ ++ if (__builtin_constant_p(len) && __len >= 64) \ ++ __ret = memset((__s), (__c), __len); \ ++ else \ ++ __ret = __builtin_memset((__s), (__c), __len); \ ++ __ret; \ ++}) ++ ++#define memcpy(dst, src, len) \ ++({ \ ++ size_t __len = (len); \ ++ void *__ret; \ ++ if (__builtin_constant_p(len) && __len >= 64) \ ++ __ret = memcpy((dst), (src), __len); \ ++ else \ ++ __ret = __builtin_memcpy((dst), (src), __len); \ ++ __ret; \ ++}) ++ ++#define memmove(dst, src, len) \ ++({ \ ++ size_t __len = (len); \ ++ void *__ret; \ ++ if (__builtin_constant_p(len) && __len >= 64) \ ++ __ret = memmove((dst), (src), __len); \ ++ else \ ++ __ret = __builtin_memmove((dst), (src), __len); \ ++ __ret; \ ++}) ++ ++#define __HAVE_ARCH_MEMCMP ++#define memcmp(src1, src2, len) __builtin_memcmp((src1), (src2), (len)) ++#endif ++ + #endif /* _ASM_STRING_H */ +--- a/arch/mips/lib/Makefile ++++ b/arch/mips/lib/Makefile +@@ -5,7 +5,7 @@ + + lib-y += bitops.o csum_partial.o delay.o memcpy.o memset.o \ + mips-atomic.o strncpy_user.o \ +- strnlen_user.o uncached.o ++ strnlen_user.o uncached.o memcmp.o + + obj-y += iomap.o iomap_copy.o + obj-$(CONFIG_PCI) += iomap-pci.o +--- /dev/null ++++ b/arch/mips/lib/memcmp.c +@@ -0,0 +1,22 @@ ++/* ++ * copied from linux/lib/string.c ++ * ++ * Copyright (C) 1991, 1992 Linus Torvalds ++ */ ++ ++#include ++#include ++ ++#undef memcmp ++int memcmp(const void *cs, const void *ct, size_t count) ++{ ++ const unsigned char *su1, *su2; ++ int res = 0; ++ ++ for (su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--) ++ if ((res = *su1 - *su2) != 0) ++ break; ++ return res; ++} ++EXPORT_SYMBOL(memcmp); ++ diff --git a/target/linux/generic/pending-4.14/307-mips_highmem_offset.patch b/target/linux/generic/pending-4.14/307-mips_highmem_offset.patch new file mode 100644 index 0000000000..0529b0c5c8 --- /dev/null +++ b/target/linux/generic/pending-4.14/307-mips_highmem_offset.patch @@ -0,0 +1,19 @@ +From: Felix Fietkau +Subject: kernel: adjust mips highmem offset to avoid the need for -mlong-calls on systems with >256M RAM + +Signed-off-by: Felix Fietkau +--- + arch/mips/include/asm/mach-generic/spaces.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/include/asm/mach-generic/spaces.h ++++ b/arch/mips/include/asm/mach-generic/spaces.h +@@ -46,7 +46,7 @@ + * Memory above this physical address will be considered highmem. + */ + #ifndef HIGHMEM_START +-#define HIGHMEM_START _AC(0x20000000, UL) ++#define HIGHMEM_START _AC(0x10000000, UL) + #endif + + #endif /* CONFIG_32BIT */ diff --git a/target/linux/generic/pending-4.14/308-mips32r2_tune.patch b/target/linux/generic/pending-4.14/308-mips32r2_tune.patch new file mode 100644 index 0000000000..7f98616d7a --- /dev/null +++ b/target/linux/generic/pending-4.14/308-mips32r2_tune.patch @@ -0,0 +1,22 @@ +From: Felix Fietkau +Subject: kernel: add -mtune=34kc to MIPS CFLAGS when building for mips32r2 + +This provides a good tradeoff across at least 24Kc-74Kc, while also +producing smaller code. + +Signed-off-by: Felix Fietkau +--- + arch/mips/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/Makefile ++++ b/arch/mips/Makefile +@@ -162,7 +162,7 @@ cflags-$(CONFIG_CPU_R4X00) += -march=r46 + cflags-$(CONFIG_CPU_TX49XX) += -march=r4600 -Wa,--trap + cflags-$(CONFIG_CPU_MIPS32_R1) += $(call cc-option,-march=mips32,-mips32 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ + -Wa,-mips32 -Wa,--trap +-cflags-$(CONFIG_CPU_MIPS32_R2) += $(call cc-option,-march=mips32r2,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ ++cflags-$(CONFIG_CPU_MIPS32_R2) += $(call cc-option,-march=mips32r2 -mtune=34kc,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ + -Wa,-mips32r2 -Wa,--trap + cflags-$(CONFIG_CPU_MIPS32_R6) += -march=mips32r6 -Wa,--trap -modd-spreg + cflags-$(CONFIG_CPU_MIPS64_R1) += $(call cc-option,-march=mips64,-mips64 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \ diff --git a/target/linux/generic/pending-4.14/310-arm_module_unresolved_weak_sym.patch b/target/linux/generic/pending-4.14/310-arm_module_unresolved_weak_sym.patch new file mode 100644 index 0000000000..bc9f0a4c4d --- /dev/null +++ b/target/linux/generic/pending-4.14/310-arm_module_unresolved_weak_sym.patch @@ -0,0 +1,22 @@ +From: Felix Fietkau +Subject: fix errors in unresolved weak symbols on arm + +lede-commit: 570699d4838a907c3ef9f2819bf19eb72997b32f +Signed-off-by: Felix Fietkau +--- + arch/arm/kernel/module.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/arch/arm/kernel/module.c ++++ b/arch/arm/kernel/module.c +@@ -95,6 +95,10 @@ apply_relocate(Elf32_Shdr *sechdrs, cons + return -ENOEXEC; + } + ++ if ((IS_ERR_VALUE(sym->st_value) || !sym->st_value) && ++ ELF_ST_BIND(sym->st_info) == STB_WEAK) ++ continue; ++ + loc = dstsec->sh_addr + rel->r_offset; + + switch (ELF32_R_TYPE(rel->r_info)) { diff --git a/target/linux/generic/pending-4.14/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch b/target/linux/generic/pending-4.14/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch new file mode 100644 index 0000000000..5cdcc2b242 --- /dev/null +++ b/target/linux/generic/pending-4.14/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch @@ -0,0 +1,272 @@ +From: Yousong Zhou +Subject: MIPS: kexec: Accept command line parameters from userspace. + +Signed-off-by: Yousong Zhou +--- + arch/mips/kernel/machine_kexec.c | 153 +++++++++++++++++++++++++++++++----- + arch/mips/kernel/machine_kexec.h | 20 +++++ + arch/mips/kernel/relocate_kernel.S | 21 +++-- + 3 files changed, 167 insertions(+), 27 deletions(-) + create mode 100644 arch/mips/kernel/machine_kexec.h + +--- a/arch/mips/kernel/machine_kexec.c ++++ b/arch/mips/kernel/machine_kexec.c +@@ -10,14 +10,11 @@ + #include + #include + ++#include + #include + #include +- +-extern const unsigned char relocate_new_kernel[]; +-extern const size_t relocate_new_kernel_size; +- +-extern unsigned long kexec_start_address; +-extern unsigned long kexec_indirection_page; ++#include ++#include "machine_kexec.h" + + int (*_machine_kexec_prepare)(struct kimage *) = NULL; + void (*_machine_kexec_shutdown)(void) = NULL; +@@ -28,6 +25,99 @@ atomic_t kexec_ready_to_reboot = ATOMIC_ + void (*_crash_smp_send_stop)(void) = NULL; + #endif + ++static void machine_kexec_print_args(void) ++{ ++ unsigned long argc = (int)kexec_args[0]; ++ int i; ++ ++ pr_info("kexec_args[0] (argc): %lu\n", argc); ++ pr_info("kexec_args[1] (argv): %p\n", (void *)kexec_args[1]); ++ pr_info("kexec_args[2] (env ): %p\n", (void *)kexec_args[2]); ++ pr_info("kexec_args[3] (desc): %p\n", (void *)kexec_args[3]); ++ ++ for (i = 0; i < argc; i++) { ++ pr_info("kexec_argv[%d] = %p, %s\n", ++ i, kexec_argv[i], kexec_argv[i]); ++ } ++} ++ ++static void machine_kexec_init_argv(struct kimage *image) ++{ ++ void __user *buf = NULL; ++ size_t bufsz; ++ size_t size; ++ int i; ++ ++ bufsz = 0; ++ for (i = 0; i < image->nr_segments; i++) { ++ struct kexec_segment *seg; ++ ++ seg = &image->segment[i]; ++ if (seg->bufsz < 6) ++ continue; ++ ++ if (strncmp((char *) seg->buf, "kexec ", 6)) ++ continue; ++ ++ buf = seg->buf; ++ bufsz = seg->bufsz; ++ break; ++ } ++ ++ if (!buf) ++ return; ++ ++ size = KEXEC_COMMAND_LINE_SIZE; ++ size = min(size, bufsz); ++ if (size < bufsz) ++ pr_warn("kexec command line truncated to %zd bytes\n", size); ++ ++ /* Copy to kernel space */ ++ copy_from_user(kexec_argv_buf, buf, size); ++ kexec_argv_buf[size - 1] = 0; ++} ++ ++static void machine_kexec_parse_argv(struct kimage *image) ++{ ++ char *reboot_code_buffer; ++ int reloc_delta; ++ char *ptr; ++ int argc; ++ int i; ++ ++ ptr = kexec_argv_buf; ++ argc = 0; ++ ++ /* ++ * convert command line string to array of parameters ++ * (as bootloader does). ++ */ ++ while (ptr && *ptr && (KEXEC_MAX_ARGC > argc)) { ++ if (*ptr == ' ') { ++ *ptr++ = '\0'; ++ continue; ++ } ++ ++ kexec_argv[argc++] = ptr; ++ ptr = strchr(ptr, ' '); ++ } ++ ++ if (!argc) ++ return; ++ ++ kexec_args[0] = argc; ++ kexec_args[1] = (unsigned long)kexec_argv; ++ kexec_args[2] = 0; ++ kexec_args[3] = 0; ++ ++ reboot_code_buffer = page_address(image->control_code_page); ++ reloc_delta = reboot_code_buffer - (char *)kexec_relocate_new_kernel; ++ ++ kexec_args[1] += reloc_delta; ++ for (i = 0; i < argc; i++) ++ kexec_argv[i] += reloc_delta; ++} ++ + static void kexec_image_info(const struct kimage *kimage) + { + unsigned long i; +@@ -52,6 +142,18 @@ int + machine_kexec_prepare(struct kimage *kimage) + { + kexec_image_info(kimage); ++ /* ++ * Whenever arguments passed from kexec-tools, Init the arguments as ++ * the original ones to try avoiding booting failure. ++ */ ++ ++ kexec_args[0] = fw_arg0; ++ kexec_args[1] = fw_arg1; ++ kexec_args[2] = fw_arg2; ++ kexec_args[3] = fw_arg3; ++ ++ machine_kexec_init_argv(kimage); ++ machine_kexec_parse_argv(kimage); + + if (_machine_kexec_prepare) + return _machine_kexec_prepare(kimage); +@@ -89,10 +191,12 @@ machine_kexec(struct kimage *image) + unsigned long *ptr; + + reboot_code_buffer = +- (unsigned long)page_address(image->control_code_page); ++ (unsigned long)page_address(image->control_code_page); ++ pr_info("reboot_code_buffer = %p\n", (void *)reboot_code_buffer); + + kexec_start_address = + (unsigned long) phys_to_virt(image->start); ++ pr_info("kexec_start_address = %p\n", (void *)kexec_start_address); + + if (image->type == KEXEC_TYPE_DEFAULT) { + kexec_indirection_page = +@@ -100,9 +204,19 @@ machine_kexec(struct kimage *image) + } else { + kexec_indirection_page = (unsigned long)&image->head; + } ++ pr_info("kexec_indirection_page = %p\n", (void *)kexec_indirection_page); + +- memcpy((void*)reboot_code_buffer, relocate_new_kernel, +- relocate_new_kernel_size); ++ pr_info("Where is memcpy: %p\n", memcpy); ++ pr_info("kexec_relocate_new_kernel = %p, kexec_relocate_new_kernel_end = %p\n", ++ (void *)kexec_relocate_new_kernel, &kexec_relocate_new_kernel_end); ++ pr_info("Copy %lu bytes from %p to %p\n", KEXEC_RELOCATE_NEW_KERNEL_SIZE, ++ (void *)kexec_relocate_new_kernel, (void *)reboot_code_buffer); ++ memcpy((void*)reboot_code_buffer, kexec_relocate_new_kernel, ++ KEXEC_RELOCATE_NEW_KERNEL_SIZE); ++ ++ pr_info("Before _print_args().\n"); ++ machine_kexec_print_args(); ++ pr_info("Before eval loop.\n"); + + /* + * The generic kexec code builds a page list with physical +@@ -121,15 +235,16 @@ machine_kexec(struct kimage *image) + /* + * we do not want to be bothered. + */ ++ pr_info("Before irq_disable.\n"); + local_irq_disable(); + +- printk("Will call new kernel at %08lx\n", image->start); +- printk("Bye ...\n"); ++ pr_info("Will call new kernel at %08lx\n", image->start); ++ pr_info("Bye ...\n"); + __flush_cache_all(); + #ifdef CONFIG_SMP + /* All secondary cpus now may jump to kexec_wait cycle */ + relocated_kexec_smp_wait = reboot_code_buffer + +- (void *)(kexec_smp_wait - relocate_new_kernel); ++ (void *)(kexec_smp_wait - kexec_relocate_new_kernel); + smp_wmb(); + atomic_set(&kexec_ready_to_reboot, 1); + #endif +--- /dev/null ++++ b/arch/mips/kernel/machine_kexec.h +@@ -0,0 +1,20 @@ ++#ifndef _MACHINE_KEXEC_H ++#define _MACHINE_KEXEC_H ++ ++#ifndef __ASSEMBLY__ ++extern const unsigned char kexec_relocate_new_kernel[]; ++extern unsigned long kexec_relocate_new_kernel_end; ++extern unsigned long kexec_start_address; ++extern unsigned long kexec_indirection_page; ++ ++extern char kexec_argv_buf[]; ++extern char *kexec_argv[]; ++ ++#define KEXEC_RELOCATE_NEW_KERNEL_SIZE ((unsigned long)&kexec_relocate_new_kernel_end - (unsigned long)kexec_relocate_new_kernel) ++#endif /* !__ASSEMBLY__ */ ++ ++#define KEXEC_COMMAND_LINE_SIZE 256 ++#define KEXEC_ARGV_SIZE (KEXEC_COMMAND_LINE_SIZE / 16) ++#define KEXEC_MAX_ARGC (KEXEC_ARGV_SIZE / sizeof(long)) ++ ++#endif +--- a/arch/mips/kernel/relocate_kernel.S ++++ b/arch/mips/kernel/relocate_kernel.S +@@ -12,8 +12,9 @@ + #include + #include + #include ++#include "machine_kexec.h" + +-LEAF(relocate_new_kernel) ++LEAF(kexec_relocate_new_kernel) + PTR_L a0, arg0 + PTR_L a1, arg1 + PTR_L a2, arg2 +@@ -98,7 +99,7 @@ done: + #endif + /* jump to kexec_start_address */ + j s1 +- END(relocate_new_kernel) ++ END(kexec_relocate_new_kernel) + + #ifdef CONFIG_SMP + /* +@@ -184,9 +185,15 @@ kexec_indirection_page: + PTR 0 + .size kexec_indirection_page, PTRSIZE + +-relocate_new_kernel_end: ++kexec_argv_buf: ++ EXPORT(kexec_argv_buf) ++ .skip KEXEC_COMMAND_LINE_SIZE ++ .size kexec_argv_buf, KEXEC_COMMAND_LINE_SIZE ++ ++kexec_argv: ++ EXPORT(kexec_argv) ++ .skip KEXEC_ARGV_SIZE ++ .size kexec_argv, KEXEC_ARGV_SIZE + +-relocate_new_kernel_size: +- EXPORT(relocate_new_kernel_size) +- PTR relocate_new_kernel_end - relocate_new_kernel +- .size relocate_new_kernel_size, PTRSIZE ++kexec_relocate_new_kernel_end: ++ EXPORT(kexec_relocate_new_kernel_end) diff --git a/target/linux/generic/pending-4.14/332-arc-add-OWRTDTB-section.patch b/target/linux/generic/pending-4.14/332-arc-add-OWRTDTB-section.patch new file mode 100644 index 0000000000..58f14b6ca5 --- /dev/null +++ b/target/linux/generic/pending-4.14/332-arc-add-OWRTDTB-section.patch @@ -0,0 +1,80 @@ +From: Alexey Brodkin +Subject: openwrt: arc - add OWRTDTB section + +This change allows OpenWRT to patch resulting kernel binary with +external .dtb. + +That allows us to re-use exactky the same vmlinux on different boards +given its ARC core configurations match (at least cache line sizes etc). + +""patch-dtb" searches for ASCII "OWRTDTB:" strign and copies external +.dtb right after it, keeping the string in place. + +Signed-off-by: Alexey Brodkin +--- + arch/arc/kernel/head.S | 10 ++++++++++ + arch/arc/kernel/setup.c | 4 +++- + arch/arc/kernel/vmlinux.lds.S | 13 +++++++++++++ + 3 files changed, 26 insertions(+), 1 deletion(-) + +--- a/arch/arc/kernel/head.S ++++ b/arch/arc/kernel/head.S +@@ -49,6 +49,16 @@ + 1: + .endm + ++; Here "patch-dtb" will embed external .dtb ++; Note "patch-dtb" searches for ASCII "OWRTDTB:" string ++; and pastes .dtb right after it, hense the string precedes ++; __image_dtb symbol. ++ .section .owrt, "aw",@progbits ++ .ascii "OWRTDTB:" ++ENTRY(__image_dtb) ++ .fill 0x4000 ++END(__image_dtb) ++ + .section .init.text, "ax",@progbits + + ;---------------------------------------------------------------- +--- a/arch/arc/kernel/setup.c ++++ b/arch/arc/kernel/setup.c +@@ -421,6 +421,8 @@ static inline int is_kernel(unsigned lon + return 0; + } + ++extern struct boot_param_header __image_dtb; ++ + void __init setup_arch(char **cmdline_p) + { + #ifdef CONFIG_ARC_UBOOT_SUPPORT +@@ -434,7 +436,7 @@ void __init setup_arch(char **cmdline_p) + #endif + { + /* No, so try the embedded one */ +- machine_desc = setup_machine_fdt(__dtb_start); ++ machine_desc = setup_machine_fdt(&__image_dtb); + if (!machine_desc) + panic("Embedded DT invalid\n"); + +--- a/arch/arc/kernel/vmlinux.lds.S ++++ b/arch/arc/kernel/vmlinux.lds.S +@@ -30,6 +30,19 @@ SECTIONS + + . = CONFIG_LINUX_LINK_BASE; + ++ /* ++ * In OpenWRT we want to patch built binary embedding .dtb of choice. ++ * This is implemented with "patch-dtb" utility which searches for ++ * "OWRTDTB:" string in first 16k of image and if it is found ++ * copies .dtb right after mentioned string. ++ * ++ * Note: "OWRTDTB:" won't be overwritten with .dtb, .dtb will follow it. ++ */ ++ .owrt : { ++ *(.owrt) ++ . = ALIGN(PAGE_SIZE); ++ } ++ + _int_vec_base_lds = .; + .vector : { + *(.vector) diff --git a/target/linux/generic/pending-4.14/333-arc-enable-unaligned-access-in-kernel-mode.patch b/target/linux/generic/pending-4.14/333-arc-enable-unaligned-access-in-kernel-mode.patch new file mode 100644 index 0000000000..4e0265aef5 --- /dev/null +++ b/target/linux/generic/pending-4.14/333-arc-enable-unaligned-access-in-kernel-mode.patch @@ -0,0 +1,24 @@ +From: Alexey Brodkin +Subject: arc: enable unaligned access in kernel mode + +This enables misaligned access handling even in kernel mode. +Some wireless drivers (ath9k-htc and mt7601u) use misaligned accesses +here and there and to cope with that without fixing stuff in the drivers +we're just gracefully handling it on ARC. + +Signed-off-by: Alexey Brodkin +--- + arch/arc/kernel/unaligned.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arc/kernel/unaligned.c ++++ b/arch/arc/kernel/unaligned.c +@@ -206,7 +206,7 @@ int misaligned_fixup(unsigned long addre + char buf[TASK_COMM_LEN]; + + /* handle user mode only and only if enabled by sysadmin */ +- if (!user_mode(regs) || !unaligned_enabled) ++ if (!unaligned_enabled) + return 1; + + if (no_unaligned_warning) { diff --git a/target/linux/generic/pending-4.14/340-MIPS-mm-remove-mips_dma_mapping_error.patch b/target/linux/generic/pending-4.14/340-MIPS-mm-remove-mips_dma_mapping_error.patch new file mode 100644 index 0000000000..8d6cada842 --- /dev/null +++ b/target/linux/generic/pending-4.14/340-MIPS-mm-remove-mips_dma_mapping_error.patch @@ -0,0 +1,32 @@ +From: Felix Fietkau +Date: Tue, 5 Dec 2017 12:34:31 +0100 +Subject: [PATCH] MIPS: mm: remove mips_dma_mapping_error + +dma_mapping_error() already checks if ops->mapping_error is a null +pointer + +Signed-off-by: Felix Fietkau +--- + +--- a/arch/mips/mm/dma-default.c ++++ b/arch/mips/mm/dma-default.c +@@ -373,11 +373,6 @@ static void mips_dma_sync_sg_for_device( + } + } + +-static int mips_dma_mapping_error(struct device *dev, dma_addr_t dma_addr) +-{ +- return 0; +-} +- + static int mips_dma_supported(struct device *dev, u64 mask) + { + return plat_dma_supported(dev, mask); +@@ -406,7 +401,6 @@ static const struct dma_map_ops mips_def + .sync_single_for_device = mips_dma_sync_single_for_device, + .sync_sg_for_cpu = mips_dma_sync_sg_for_cpu, + .sync_sg_for_device = mips_dma_sync_sg_for_device, +- .mapping_error = mips_dma_mapping_error, + .dma_supported = mips_dma_supported + }; + diff --git a/target/linux/generic/pending-4.14/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch b/target/linux/generic/pending-4.14/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch new file mode 100644 index 0000000000..3cd87861a4 --- /dev/null +++ b/target/linux/generic/pending-4.14/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch @@ -0,0 +1,140 @@ +From: Felix Fietkau +Date: Tue, 5 Dec 2017 12:46:01 +0100 +Subject: [PATCH] MIPS: mm: remove no-op dma_map_ops where possible + +If no post-DMA flush is required, and the platform does not provide +plat_unmap_dma_mem(), there is no need to include unmap or sync_for_cpu +ops. + +With this patch they are compiled out to improve icache footprint +on devices that handle lots of DMA traffic (especially network routers). + +Signed-off-by: Felix Fietkau +--- + +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -220,6 +220,7 @@ config BMIPS_GENERIC + select BRCMSTB_L2_IRQ + select IRQ_MIPS_CPU + select DMA_NONCOHERENT ++ select DMA_UNMAP_POST_FLUSH + select SYS_SUPPORTS_32BIT_KERNEL + select SYS_SUPPORTS_LITTLE_ENDIAN + select SYS_SUPPORTS_BIG_ENDIAN +@@ -345,6 +346,7 @@ config MACH_JAZZ + select CSRC_R4K + select DEFAULT_SGI_PARTITION if CPU_BIG_ENDIAN + select GENERIC_ISA_DMA ++ select DMA_UNMAP_POST_FLUSH + select HAVE_PCSPKR_PLATFORM + select IRQ_MIPS_CPU + select I8253 +@@ -1127,6 +1129,9 @@ config DMA_NONCOHERENT + bool + select NEED_DMA_MAP_STATE + ++config DMA_UNMAP_POST_FLUSH ++ bool ++ + config NEED_DMA_MAP_STATE + bool + +@@ -1651,6 +1656,7 @@ config CPU_R10000 + select CPU_SUPPORTS_64BIT_KERNEL + select CPU_SUPPORTS_HIGHMEM + select CPU_SUPPORTS_HUGEPAGES ++ select DMA_UNMAP_POST_FLUSH + help + MIPS Technologies R10000-series processors. + +@@ -1899,9 +1905,11 @@ config SYS_HAS_CPU_MIPS32_R3_5 + bool + + config SYS_HAS_CPU_MIPS32_R5 ++ select DMA_UNMAP_POST_FLUSH + bool + + config SYS_HAS_CPU_MIPS32_R6 ++ select DMA_UNMAP_POST_FLUSH + bool + + config SYS_HAS_CPU_MIPS64_R1 +@@ -1911,6 +1919,7 @@ config SYS_HAS_CPU_MIPS64_R2 + bool + + config SYS_HAS_CPU_MIPS64_R6 ++ select DMA_UNMAP_POST_FLUSH + bool + + config SYS_HAS_CPU_R3000 +--- a/arch/mips/mm/dma-default.c ++++ b/arch/mips/mm/dma-default.c +@@ -267,8 +267,9 @@ static inline void __dma_sync(struct pag + } while (left); + } + +-static void mips_dma_unmap_page(struct device *dev, dma_addr_t dma_addr, +- size_t size, enum dma_data_direction direction, unsigned long attrs) ++static void __maybe_unused ++mips_dma_unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size, ++ enum dma_data_direction direction, unsigned long attrs) + { + if (cpu_needs_post_dma_flush(dev) && !(attrs & DMA_ATTR_SKIP_CPU_SYNC)) + __dma_sync(dma_addr_to_page(dev, dma_addr), +@@ -308,9 +309,10 @@ static dma_addr_t mips_dma_map_page(stru + return plat_map_dma_mem_page(dev, page) + offset; + } + +-static void mips_dma_unmap_sg(struct device *dev, struct scatterlist *sglist, +- int nhwentries, enum dma_data_direction direction, +- unsigned long attrs) ++static void __maybe_unused ++mips_dma_unmap_sg(struct device *dev, struct scatterlist *sglist, ++ int nhwentries, enum dma_data_direction direction, ++ unsigned long attrs) + { + int i; + struct scatterlist *sg; +@@ -325,8 +327,9 @@ static void mips_dma_unmap_sg(struct dev + } + } + +-static void mips_dma_sync_single_for_cpu(struct device *dev, +- dma_addr_t dma_handle, size_t size, enum dma_data_direction direction) ++static void __maybe_unused ++mips_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, ++ size_t size, enum dma_data_direction direction) + { + if (cpu_needs_post_dma_flush(dev)) + __dma_sync(dma_addr_to_page(dev, dma_handle), +@@ -342,9 +345,9 @@ static void mips_dma_sync_single_for_dev + dma_handle & ~PAGE_MASK, size, direction); + } + +-static void mips_dma_sync_sg_for_cpu(struct device *dev, +- struct scatterlist *sglist, int nelems, +- enum dma_data_direction direction) ++static void __maybe_unused ++mips_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sglist, ++ int nelems, enum dma_data_direction direction) + { + int i; + struct scatterlist *sg; +@@ -394,12 +397,14 @@ static const struct dma_map_ops mips_def + .free = mips_dma_free_coherent, + .mmap = mips_dma_mmap, + .map_page = mips_dma_map_page, +- .unmap_page = mips_dma_unmap_page, + .map_sg = mips_dma_map_sg, ++#ifdef CONFIG_DMA_UNMAP_POST_FLUSH ++ .unmap_page = mips_dma_unmap_page, + .unmap_sg = mips_dma_unmap_sg, + .sync_single_for_cpu = mips_dma_sync_single_for_cpu, +- .sync_single_for_device = mips_dma_sync_single_for_device, + .sync_sg_for_cpu = mips_dma_sync_sg_for_cpu, ++#endif ++ .sync_single_for_device = mips_dma_sync_single_for_device, + .sync_sg_for_device = mips_dma_sync_sg_for_device, + .dma_supported = mips_dma_supported + }; diff --git a/target/linux/generic/pending-4.14/400-mtd-add-rootfs-split-support.patch b/target/linux/generic/pending-4.14/400-mtd-add-rootfs-split-support.patch new file mode 100644 index 0000000000..e722d8ca92 --- /dev/null +++ b/target/linux/generic/pending-4.14/400-mtd-add-rootfs-split-support.patch @@ -0,0 +1,124 @@ +From: Felix Fietkau +Subject: make rootfs split/detection more generic - patch can be moved to generic-2.6 after testing on other platforms + +lede-commit: 328e660b31f0937d52c5ae3d6e7029409918a9df +Signed-off-by: Felix Fietkau +--- + drivers/mtd/Kconfig | 17 +++++++++++++++++ + drivers/mtd/mtdpart.c | 35 +++++++++++++++++++++++++++++++++++ + include/linux/mtd/partitions.h | 2 ++ + 3 files changed, 54 insertions(+) + +--- a/drivers/mtd/Kconfig ++++ b/drivers/mtd/Kconfig +@@ -12,6 +12,23 @@ menuconfig MTD + + if MTD + ++menu "OpenWrt specific MTD options" ++ ++config MTD_ROOTFS_ROOT_DEV ++ bool "Automatically set 'rootfs' partition to be root filesystem" ++ default y ++ ++config MTD_SPLIT_FIRMWARE ++ bool "Automatically split firmware partition for kernel+rootfs" ++ default y ++ ++config MTD_SPLIT_FIRMWARE_NAME ++ string "Firmware partition name" ++ depends on MTD_SPLIT_FIRMWARE ++ default "firmware" ++ ++endmenu ++ + config MTD_TESTS + tristate "MTD tests support (DANGEROUS)" + depends on m +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -29,11 +29,13 @@ + #include + #include + #include ++#include + #include + #include + #include + + #include "mtdcore.h" ++#include "mtdsplit/mtdsplit.h" + + /* Our partition linked list */ + static LIST_HEAD(mtd_partitions); +@@ -53,6 +55,8 @@ struct mtd_part { + struct list_head list; + }; + ++static void mtd_partition_split(struct mtd_info *master, struct mtd_part *part); ++ + /* + * Given a pointer to the MTD object in the mtd_part structure, we can retrieve + * the pointer to that structure. +@@ -687,6 +691,7 @@ int mtd_add_partition(struct mtd_info *p + mutex_unlock(&mtd_partitions_mutex); + + add_mtd_device(&new->mtd); ++ mtd_partition_split(parent, new); + + mtd_add_partition_attrs(new); + +@@ -765,6 +770,35 @@ int mtd_del_partition(struct mtd_info *m + } + EXPORT_SYMBOL_GPL(mtd_del_partition); + ++#ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME ++#define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME ++#else ++#define SPLIT_FIRMWARE_NAME "unused" ++#endif ++ ++static void split_firmware(struct mtd_info *master, struct mtd_part *part) ++{ ++} ++ ++void __weak arch_split_mtd_part(struct mtd_info *master, const char *name, ++ int offset, int size) ++{ ++} ++ ++static void mtd_partition_split(struct mtd_info *master, struct mtd_part *part) ++{ ++ static int rootfs_found = 0; ++ ++ if (rootfs_found) ++ return; ++ ++ if (!strcmp(part->mtd.name, SPLIT_FIRMWARE_NAME) && ++ IS_ENABLED(CONFIG_MTD_SPLIT_FIRMWARE)) ++ split_firmware(master, part); ++ ++ arch_split_mtd_part(master, part->mtd.name, part->offset, ++ part->mtd.size); ++} + /* + * This function, given a master MTD object and a partition table, creates + * and registers slave MTD objects which are bound to the master according to +@@ -796,6 +830,7 @@ int add_mtd_partitions(struct mtd_info * + mutex_unlock(&mtd_partitions_mutex); + + add_mtd_device(&slave->mtd); ++ mtd_partition_split(master, slave); + mtd_add_partition_attrs(slave); + if (parts[i].types) + mtd_parse_part(slave, parts[i].types); +--- a/include/linux/mtd/partitions.h ++++ b/include/linux/mtd/partitions.h +@@ -110,5 +110,7 @@ int mtd_add_partition(struct mtd_info *m + long long offset, long long length); + int mtd_del_partition(struct mtd_info *master, int partno); + uint64_t mtd_get_device_size(const struct mtd_info *mtd); ++extern void __weak arch_split_mtd_part(struct mtd_info *master, ++ const char *name, int offset, int size); + + #endif diff --git a/target/linux/generic/pending-4.14/401-mtd-add-support-for-different-partition-parser-types.patch b/target/linux/generic/pending-4.14/401-mtd-add-support-for-different-partition-parser-types.patch new file mode 100644 index 0000000000..7481225be8 --- /dev/null +++ b/target/linux/generic/pending-4.14/401-mtd-add-support-for-different-partition-parser-types.patch @@ -0,0 +1,110 @@ +From: Gabor Juhos +Subject: mtd: add support for different partition parser types + +Signed-off-by: Gabor Juhos +--- + drivers/mtd/mtdpart.c | 56 ++++++++++++++++++++++++++++++++++++++++ + include/linux/mtd/partitions.h | 11 ++++++++ + 2 files changed, 67 insertions(+) + +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -1093,6 +1093,62 @@ void mtd_part_parser_cleanup(struct mtd_ + } + } + ++static struct mtd_part_parser * ++get_partition_parser_by_type(enum mtd_parser_type type, ++ struct mtd_part_parser *start) ++{ ++ struct mtd_part_parser *p, *ret = NULL; ++ ++ spin_lock(&part_parser_lock); ++ ++ p = list_prepare_entry(start, &part_parsers, list); ++ if (start) ++ mtd_part_parser_put(start); ++ ++ list_for_each_entry_continue(p, &part_parsers, list) { ++ if (p->type == type && try_module_get(p->owner)) { ++ ret = p; ++ break; ++ } ++ } ++ ++ spin_unlock(&part_parser_lock); ++ ++ return ret; ++} ++ ++int parse_mtd_partitions_by_type(struct mtd_info *master, ++ enum mtd_parser_type type, ++ const struct mtd_partition **pparts, ++ struct mtd_part_parser_data *data) ++{ ++ struct mtd_part_parser *prev = NULL; ++ int ret = 0; ++ ++ while (1) { ++ struct mtd_part_parser *parser; ++ ++ parser = get_partition_parser_by_type(type, prev); ++ if (!parser) ++ break; ++ ++ ret = (*parser->parse_fn)(master, pparts, data); ++ ++ if (ret > 0) { ++ mtd_part_parser_put(parser); ++ printk(KERN_NOTICE ++ "%d %s partitions found on MTD device %s\n", ++ ret, parser->name, master->name); ++ break; ++ } ++ ++ prev = parser; ++ } ++ ++ return ret; ++} ++EXPORT_SYMBOL_GPL(parse_mtd_partitions_by_type); ++ + int mtd_is_partition(const struct mtd_info *mtd) + { + struct mtd_part *part; +--- a/include/linux/mtd/partitions.h ++++ b/include/linux/mtd/partitions.h +@@ -68,11 +68,14 @@ struct mtd_part_parser_data { + unsigned long origin; + }; + +- + /* + * Functions dealing with the various ways of partitioning the space + */ + ++enum mtd_parser_type { ++ MTD_PARSER_TYPE_DEVICE = 0, ++}; ++ + struct mtd_part_parser { + struct list_head list; + struct module *owner; +@@ -81,6 +84,7 @@ struct mtd_part_parser { + int (*parse_fn)(struct mtd_info *, const struct mtd_partition **, + struct mtd_part_parser_data *); + void (*cleanup)(const struct mtd_partition *pparts, int nr_parts); ++ enum mtd_parser_type type; + }; + + /* Container for passing around a set of parsed partitions */ +@@ -113,4 +117,9 @@ uint64_t mtd_get_device_size(const struc + extern void __weak arch_split_mtd_part(struct mtd_info *master, + const char *name, int offset, int size); + ++int parse_mtd_partitions_by_type(struct mtd_info *master, ++ enum mtd_parser_type type, ++ const struct mtd_partition **pparts, ++ struct mtd_part_parser_data *data); ++ + #endif diff --git a/target/linux/generic/pending-4.14/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch b/target/linux/generic/pending-4.14/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch new file mode 100644 index 0000000000..26a19b82fd --- /dev/null +++ b/target/linux/generic/pending-4.14/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch @@ -0,0 +1,81 @@ +From: Gabor Juhos +Subject: kernel/3.10: allow to use partition parsers for rootfs and firmware split + +lede-commit: 3b71cd94bc9517bc25267dccb393b07d4b54564e +Signed-off-by: Gabor Juhos +--- + drivers/mtd/mtdpart.c | 37 +++++++++++++++++++++++++++++++++++++ + include/linux/mtd/partitions.h | 2 ++ + 2 files changed, 39 insertions(+) + +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -770,6 +770,36 @@ int mtd_del_partition(struct mtd_info *m + } + EXPORT_SYMBOL_GPL(mtd_del_partition); + ++static int ++run_parsers_by_type(struct mtd_part *slave, enum mtd_parser_type type) ++{ ++ struct mtd_partition *parts; ++ int nr_parts; ++ int i; ++ ++ nr_parts = parse_mtd_partitions_by_type(&slave->mtd, type, (const struct mtd_partition **)&parts, ++ NULL); ++ if (nr_parts <= 0) ++ return nr_parts; ++ ++ if (WARN_ON(!parts)) ++ return 0; ++ ++ for (i = 0; i < nr_parts; i++) { ++ /* adjust partition offsets */ ++ parts[i].offset += slave->offset; ++ ++ mtd_add_partition(slave->parent, ++ parts[i].name, ++ parts[i].offset, ++ parts[i].size); ++ } ++ ++ kfree(parts); ++ ++ return nr_parts; ++} ++ + #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME + #define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME + #else +@@ -778,6 +808,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition); + + static void split_firmware(struct mtd_info *master, struct mtd_part *part) + { ++ run_parsers_by_type(part, MTD_PARSER_TYPE_FIRMWARE); + } + + void __weak arch_split_mtd_part(struct mtd_info *master, const char *name, +@@ -792,6 +823,12 @@ static void mtd_partition_split(struct m + if (rootfs_found) + return; + ++ if (!strcmp(part->mtd.name, "rootfs")) { ++ run_parsers_by_type(part, MTD_PARSER_TYPE_ROOTFS); ++ ++ rootfs_found = 1; ++ } ++ + if (!strcmp(part->mtd.name, SPLIT_FIRMWARE_NAME) && + IS_ENABLED(CONFIG_MTD_SPLIT_FIRMWARE)) + split_firmware(master, part); +--- a/include/linux/mtd/partitions.h ++++ b/include/linux/mtd/partitions.h +@@ -74,6 +74,8 @@ struct mtd_part_parser_data { + + enum mtd_parser_type { + MTD_PARSER_TYPE_DEVICE = 0, ++ MTD_PARSER_TYPE_ROOTFS, ++ MTD_PARSER_TYPE_FIRMWARE, + }; + + struct mtd_part_parser { diff --git a/target/linux/generic/pending-4.14/403-mtd-hook-mtdsplit-to-Kbuild.patch b/target/linux/generic/pending-4.14/403-mtd-hook-mtdsplit-to-Kbuild.patch new file mode 100644 index 0000000000..89c202bc0d --- /dev/null +++ b/target/linux/generic/pending-4.14/403-mtd-hook-mtdsplit-to-Kbuild.patch @@ -0,0 +1,32 @@ +From: Gabor Juhos +Subject: [PATCH] kernel/3.10: move squashfs check from rootfs split code into a separate file + +lede-commit: d89bea92b31b4e157a0fa438e75370f089f73427 +Signed-off-by: Gabor Juhos +--- + drivers/mtd/Kconfig | 2 ++ + drivers/mtd/Makefile | 2 ++ + 2 files changed, 4 insertions(+) + +--- a/drivers/mtd/Kconfig ++++ b/drivers/mtd/Kconfig +@@ -27,6 +27,8 @@ config MTD_SPLIT_FIRMWARE_NAME + depends on MTD_SPLIT_FIRMWARE + default "firmware" + ++source "drivers/mtd/mtdsplit/Kconfig" ++ + endmenu + + config MTD_TESTS +--- a/drivers/mtd/Makefile ++++ b/drivers/mtd/Makefile +@@ -7,6 +7,8 @@ + obj-$(CONFIG_MTD) += mtd.o + mtd-y := mtdcore.o mtdsuper.o mtdconcat.o mtdpart.o mtdchar.o + ++obj-$(CONFIG_MTD_SPLIT) += mtdsplit/ ++ + obj-$(CONFIG_MTD_OF_PARTS) += ofpart.o + obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o + obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o diff --git a/target/linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch b/target/linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch new file mode 100644 index 0000000000..a4fb155863 --- /dev/null +++ b/target/linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch @@ -0,0 +1,94 @@ +From: Gabor Juhos +Subject: kernel/3.10: add separate rootfs partition parser + +lede-commit: daec7ad7688415156e2730e401503d09bd3acf91 +Signed-off-by: Gabor Juhos +--- + drivers/mtd/mtdpart.c | 29 +++++++++++++++++++++++++++++ + include/linux/mtd/mtd.h | 18 ++++++++++++++++++ + include/linux/mtd/partitions.h | 2 ++ + 3 files changed, 49 insertions(+) + +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -800,6 +800,17 @@ run_parsers_by_type(struct mtd_part *sla + return nr_parts; + } + ++static inline unsigned long ++mtd_pad_erasesize(struct mtd_info *mtd, int offset, int len) ++{ ++ unsigned long mask = mtd->erasesize - 1; ++ ++ len += offset & mask; ++ len = (len + mask) & ~mask; ++ len -= offset & mask; ++ return len; ++} ++ + #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME + #define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME + #else +@@ -1203,6 +1214,24 @@ int mtd_is_partition(const struct mtd_in + } + EXPORT_SYMBOL_GPL(mtd_is_partition); + ++struct mtd_info *mtdpart_get_master(const struct mtd_info *mtd) ++{ ++ if (!mtd_is_partition(mtd)) ++ return (struct mtd_info *)mtd; ++ ++ return mtd_to_part(mtd)->parent; ++} ++EXPORT_SYMBOL_GPL(mtdpart_get_master); ++ ++uint64_t mtdpart_get_offset(const struct mtd_info *mtd) ++{ ++ if (!mtd_is_partition(mtd)) ++ return 0; ++ ++ return mtd_to_part(mtd)->offset; ++} ++EXPORT_SYMBOL_GPL(mtdpart_get_offset); ++ + /* Returns the size of the entire flash chip */ + uint64_t mtd_get_device_size(const struct mtd_info *mtd) + { +--- a/include/linux/mtd/mtd.h ++++ b/include/linux/mtd/mtd.h +@@ -493,6 +493,24 @@ static inline uint32_t mtd_mod_by_eb(uin + return do_div(sz, mtd->erasesize); + } + ++static inline uint64_t mtd_roundup_to_eb(uint64_t sz, struct mtd_info *mtd) ++{ ++ if (mtd_mod_by_eb(sz, mtd) == 0) ++ return sz; ++ ++ /* Round up to next erase block */ ++ return (mtd_div_by_eb(sz, mtd) + 1) * mtd->erasesize; ++} ++ ++static inline uint64_t mtd_rounddown_to_eb(uint64_t sz, struct mtd_info *mtd) ++{ ++ if (mtd_mod_by_eb(sz, mtd) == 0) ++ return sz; ++ ++ /* Round down to the start of the current erase block */ ++ return (mtd_div_by_eb(sz, mtd)) * mtd->erasesize; ++} ++ + static inline uint32_t mtd_div_by_ws(uint64_t sz, struct mtd_info *mtd) + { + if (mtd->writesize_shift) +--- a/include/linux/mtd/partitions.h ++++ b/include/linux/mtd/partitions.h +@@ -115,6 +115,8 @@ int mtd_is_partition(const struct mtd_in + int mtd_add_partition(struct mtd_info *master, const char *name, + long long offset, long long length); + int mtd_del_partition(struct mtd_info *master, int partno); ++struct mtd_info *mtdpart_get_master(const struct mtd_info *mtd); ++uint64_t mtdpart_get_offset(const struct mtd_info *mtd); + uint64_t mtd_get_device_size(const struct mtd_info *mtd); + extern void __weak arch_split_mtd_part(struct mtd_info *master, + const char *name, int offset, int size); diff --git a/target/linux/generic/pending-4.14/411-mtd-partial_eraseblock_write.patch b/target/linux/generic/pending-4.14/411-mtd-partial_eraseblock_write.patch new file mode 100644 index 0000000000..9de5fd263c --- /dev/null +++ b/target/linux/generic/pending-4.14/411-mtd-partial_eraseblock_write.patch @@ -0,0 +1,154 @@ +From: Felix Fietkau +Subject: mtd: implement write support for partitions covering only a part of an eraseblock (buffer data that would otherwise be erased) + +lede-commit: 87a8e8ac1067f58ba831c4aae443f3655c31cd80 +Signed-off-by: Felix Fietkau +--- + drivers/mtd/mtdpart.c | 90 ++++++++++++++++++++++++++++++++++++++++++++----- + include/linux/mtd/mtd.h | 4 +++ + 2 files changed, 85 insertions(+), 9 deletions(-) + +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -37,6 +37,8 @@ + #include "mtdcore.h" + #include "mtdsplit/mtdsplit.h" + ++#define MTD_ERASE_PARTIAL 0x8000 /* partition only covers parts of an erase block */ ++ + /* Our partition linked list */ + static LIST_HEAD(mtd_partitions); + static DEFINE_MUTEX(mtd_partitions_mutex); +@@ -242,13 +244,61 @@ static int part_erase(struct mtd_info *m + struct mtd_part *part = mtd_to_part(mtd); + int ret; + ++ ++ instr->partial_start = false; ++ if (mtd->flags & MTD_ERASE_PARTIAL) { ++ size_t readlen = 0; ++ u64 mtd_ofs; ++ ++ instr->erase_buf = kmalloc(part->parent->erasesize, GFP_ATOMIC); ++ if (!instr->erase_buf) ++ return -ENOMEM; ++ ++ mtd_ofs = part->offset + instr->addr; ++ instr->erase_buf_ofs = do_div(mtd_ofs, part->parent->erasesize); ++ ++ if (instr->erase_buf_ofs > 0) { ++ instr->addr -= instr->erase_buf_ofs; ++ ret = mtd_read(part->parent, ++ instr->addr + part->offset, ++ part->parent->erasesize, ++ &readlen, instr->erase_buf); ++ ++ instr->len += instr->erase_buf_ofs; ++ instr->partial_start = true; ++ } else { ++ mtd_ofs = part->offset + part->mtd.size; ++ instr->erase_buf_ofs = part->parent->erasesize - ++ do_div(mtd_ofs, part->parent->erasesize); ++ ++ if (instr->erase_buf_ofs > 0) { ++ instr->len += instr->erase_buf_ofs; ++ ret = mtd_read(part->parent, ++ part->offset + instr->addr + ++ instr->len - part->parent->erasesize, ++ part->parent->erasesize, &readlen, ++ instr->erase_buf); ++ } else { ++ ret = 0; ++ } ++ } ++ if (ret < 0) { ++ kfree(instr->erase_buf); ++ return ret; ++ } ++ ++ } ++ + instr->addr += part->offset; + ret = part->parent->_erase(part->parent, instr); + if (ret) { + if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN) + instr->fail_addr -= part->offset; + instr->addr -= part->offset; ++ if (mtd->flags & MTD_ERASE_PARTIAL) ++ kfree(instr->erase_buf); + } ++ + return ret; + } + +@@ -256,6 +306,25 @@ void mtd_erase_callback(struct erase_inf + { + if (instr->mtd->_erase == part_erase) { + struct mtd_part *part = mtd_to_part(instr->mtd); ++ size_t wrlen = 0; ++ ++ if (instr->mtd->flags & MTD_ERASE_PARTIAL) { ++ if (instr->partial_start) { ++ part->parent->_write(part->parent, ++ instr->addr, instr->erase_buf_ofs, ++ &wrlen, instr->erase_buf); ++ instr->addr += instr->erase_buf_ofs; ++ } else { ++ instr->len -= instr->erase_buf_ofs; ++ part->parent->_write(part->parent, ++ instr->addr + instr->len, ++ instr->erase_buf_ofs, &wrlen, ++ instr->erase_buf + ++ part->parent->erasesize - ++ instr->erase_buf_ofs); ++ } ++ kfree(instr->erase_buf); ++ } + + if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN) + instr->fail_addr -= part->offset; +@@ -599,19 +668,22 @@ static struct mtd_part *allocate_partiti + remainder = do_div(tmp, wr_alignment); + if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) { + /* Doesn't start on a boundary of major erase size */ +- /* FIXME: Let it be writable if it is on a boundary of +- * _minor_ erase size though */ +- slave->mtd.flags &= ~MTD_WRITEABLE; +- printk(KERN_WARNING"mtd: partition \"%s\" doesn't start on an erase/write block boundary -- force read-only\n", +- part->name); ++ slave->mtd.flags |= MTD_ERASE_PARTIAL; ++ if (((u32)slave->mtd.size) > parent->erasesize) ++ slave->mtd.flags &= ~MTD_WRITEABLE; ++ else ++ slave->mtd.erasesize = slave->mtd.size; + } + +- tmp = slave->mtd.size; ++ tmp = slave->offset + slave->mtd.size; + remainder = do_div(tmp, wr_alignment); + if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) { +- slave->mtd.flags &= ~MTD_WRITEABLE; +- printk(KERN_WARNING"mtd: partition \"%s\" doesn't end on an erase/write block -- force read-only\n", +- part->name); ++ slave->mtd.flags |= MTD_ERASE_PARTIAL; ++ ++ if ((u32)slave->mtd.size > parent->erasesize) ++ slave->mtd.flags &= ~MTD_WRITEABLE; ++ else ++ slave->mtd.erasesize = slave->mtd.size; + } + + mtd_set_ooblayout(&slave->mtd, &part_ooblayout_ops); +--- a/include/linux/mtd/mtd.h ++++ b/include/linux/mtd/mtd.h +@@ -56,6 +56,10 @@ struct erase_info { + u_long priv; + u_char state; + struct erase_info *next; ++ ++ u8 *erase_buf; ++ u32 erase_buf_ofs; ++ bool partial_start; + }; + + struct mtd_erase_region_info { diff --git a/target/linux/generic/pending-4.14/412-mtd-partial_eraseblock_unlock.patch b/target/linux/generic/pending-4.14/412-mtd-partial_eraseblock_unlock.patch new file mode 100644 index 0000000000..2ffff4ecf9 --- /dev/null +++ b/target/linux/generic/pending-4.14/412-mtd-partial_eraseblock_unlock.patch @@ -0,0 +1,40 @@ +From: Tim Harvey +Subject: mtd: allow partial block unlock + +This allows sysupgrade for devices such as the Gateworks Avila/Cambria +product families based on the ixp4xx using the redboot bootloader with +combined FIS directory and RedBoot config partitions on larger FLASH +devices with larger eraseblocks. + +This second iteration of this patch addresses previous issues: +- whitespace breakage fixed +- unlock in all scenarios +- simplification and fix logic bug + +[john@phrozen.org: this should be moved to the ixp4xx folder] + +Signed-off-by: Tim Harvey +--- + drivers/mtd/mtdpart.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -344,7 +344,16 @@ static int part_lock(struct mtd_info *mt + static int part_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) + { + struct mtd_part *part = mtd_to_part(mtd); +- return part->parent->_unlock(part->parent, ofs + part->offset, len); ++ ++ ofs += part->offset; ++ ++ if (mtd->flags & MTD_ERASE_PARTIAL) { ++ /* round up len to next erasesize and round down offset to prev block */ ++ len = (mtd_div_by_eb(len, part->parent) + 1) * part->parent->erasesize; ++ ofs &= ~(part->parent->erasesize - 1); ++ } ++ ++ return part->parent->_unlock(part->parent, ofs, len); + } + + static int part_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len) diff --git a/target/linux/generic/pending-4.14/420-mtd-redboot_space.patch b/target/linux/generic/pending-4.14/420-mtd-redboot_space.patch new file mode 100644 index 0000000000..85fbe0512d --- /dev/null +++ b/target/linux/generic/pending-4.14/420-mtd-redboot_space.patch @@ -0,0 +1,41 @@ +From: Felix Fietkau +Subject: add patch for including unpartitioned space in the rootfs partition for redboot devices (if applicable) + +[john@phrozen.org: used by ixp and others] + +lede-commit: 394918851f84e4d00fa16eb900e7700e95091f00 +Signed-off-by: Felix Fietkau +--- + drivers/mtd/redboot.c | 19 +++++++++++++------ + 1 file changed, 13 insertions(+), 6 deletions(-) + +--- a/drivers/mtd/redboot.c ++++ b/drivers/mtd/redboot.c +@@ -265,14 +265,21 @@ static int parse_redboot_partitions(stru + #endif + names += strlen(names)+1; + +-#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED + if(fl->next && fl->img->flash_base + fl->img->size + master->erasesize <= fl->next->img->flash_base) { +- i++; +- parts[i].offset = parts[i-1].size + parts[i-1].offset; +- parts[i].size = fl->next->img->flash_base - parts[i].offset; +- parts[i].name = nullname; +- } ++ if (!strcmp(parts[i].name, "rootfs")) { ++ parts[i].size = fl->next->img->flash_base; ++ parts[i].size &= ~(master->erasesize - 1); ++ parts[i].size -= parts[i].offset; ++#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED ++ nrparts--; ++ } else { ++ i++; ++ parts[i].offset = parts[i-1].size + parts[i-1].offset; ++ parts[i].size = fl->next->img->flash_base - parts[i].offset; ++ parts[i].name = nullname; + #endif ++ } ++ } + tmp_fl = fl; + fl = fl->next; + kfree(tmp_fl); diff --git a/target/linux/generic/pending-4.14/430-mtd-add-myloader-partition-parser.patch b/target/linux/generic/pending-4.14/430-mtd-add-myloader-partition-parser.patch new file mode 100644 index 0000000000..889c452057 --- /dev/null +++ b/target/linux/generic/pending-4.14/430-mtd-add-myloader-partition-parser.patch @@ -0,0 +1,47 @@ +From: Florian Fainelli +Subject: Add myloader partition table parser + +[john@phozen.org: shoud be upstreamable] + +lede-commit: d8bf22859b51faa09d22c056fe221a45d2f7a3b8 +Signed-off-by: Florian Fainelli +--- + drivers/mtd/Kconfig | 16 ++++++++++++++++ + drivers/mtd/Makefile | 1 + + 2 files changed, 17 insertions(+) + +--- a/drivers/mtd/Kconfig ++++ b/drivers/mtd/Kconfig +@@ -178,6 +178,22 @@ menu "Partition parsers" + source "drivers/mtd/parsers/Kconfig" + endmenu + ++config MTD_MYLOADER_PARTS ++ tristate "MyLoader partition parsing" ++ depends on ADM5120 || ATH25 || ATH79 ++ ---help--- ++ MyLoader is a bootloader which allows the user to define partitions ++ in flash devices, by putting a table in the second erase block ++ on the device, similar to a partition table. This table gives the ++ offsets and lengths of the user defined partitions. ++ ++ If you need code which can detect and parse these tables, and ++ register MTD 'partitions' corresponding to each image detected, ++ enable this option. ++ ++ You will still need the parsing functions to be called by the driver ++ for your particular device. It won't happen automatically. ++ + comment "User Modules And Translation Layers" + + # +--- a/drivers/mtd/Makefile ++++ b/drivers/mtd/Makefile +@@ -16,6 +16,7 @@ obj-$(CONFIG_MTD_AFS_PARTS) += afs.o + obj-$(CONFIG_MTD_AR7_PARTS) += ar7part.o + obj-$(CONFIG_MTD_BCM63XX_PARTS) += bcm63xxpart.o + obj-$(CONFIG_MTD_BCM47XX_PARTS) += bcm47xxpart.o ++obj-$(CONFIG_MTD_MYLOADER_PARTS) += myloader.o + obj-y += parsers/ + + # 'Users' - code which presents functionality to userspace. diff --git a/target/linux/generic/pending-4.14/431-mtd-bcm47xxpart-check-for-bad-blocks-when-calculatin.patch b/target/linux/generic/pending-4.14/431-mtd-bcm47xxpart-check-for-bad-blocks-when-calculatin.patch new file mode 100644 index 0000000000..9299e88671 --- /dev/null +++ b/target/linux/generic/pending-4.14/431-mtd-bcm47xxpart-check-for-bad-blocks-when-calculatin.patch @@ -0,0 +1,67 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Subject: [PATCH] mtd: bcm47xxpart: check for bad blocks when calculating offsets + +Signed-off-by: Rafał Miłecki +--- + +--- a/drivers/mtd/parsers/parser_trx.c ++++ b/drivers/mtd/parsers/parser_trx.c +@@ -29,6 +29,33 @@ struct trx_header { + uint32_t offset[3]; + } __packed; + ++/* ++ * Calculate real end offset (address) for a given amount of data. It checks ++ * all blocks skipping bad ones. ++ */ ++static size_t parser_trx_real_offset(struct mtd_info *mtd, size_t bytes) ++{ ++ size_t real_offset = 0; ++ ++ if (mtd_block_isbad(mtd, real_offset)) ++ pr_warn("Base offset shouldn't be at bad block"); ++ ++ while (bytes >= mtd->erasesize) { ++ bytes -= mtd->erasesize; ++ real_offset += mtd->erasesize; ++ while (mtd_block_isbad(mtd, real_offset)) { ++ real_offset += mtd->erasesize; ++ ++ if (real_offset >= mtd->size) ++ return real_offset - mtd->erasesize; ++ } ++ } ++ ++ real_offset += bytes; ++ ++ return real_offset; ++} ++ + static const char *parser_trx_data_part_name(struct mtd_info *master, + size_t offset) + { +@@ -83,21 +110,21 @@ static int parser_trx_parse(struct mtd_i + if (trx.offset[2]) { + part = &parts[curr_part++]; + part->name = "loader"; +- part->offset = trx.offset[i]; ++ part->offset = parser_trx_real_offset(mtd, trx.offset[i]); + i++; + } + + if (trx.offset[i]) { + part = &parts[curr_part++]; + part->name = "linux"; +- part->offset = trx.offset[i]; ++ part->offset = parser_trx_real_offset(mtd, trx.offset[i]); + i++; + } + + if (trx.offset[i]) { + part = &parts[curr_part++]; + part->name = parser_trx_data_part_name(mtd, trx.offset[i]); +- part->offset = trx.offset[i]; ++ part->offset = parser_trx_real_offset(mtd, trx.offset[i]); + i++; + } + diff --git a/target/linux/generic/pending-4.14/432-mtd-bcm47xxpart-detect-T_Meter-partition.patch b/target/linux/generic/pending-4.14/432-mtd-bcm47xxpart-detect-T_Meter-partition.patch new file mode 100644 index 0000000000..a6d0828b99 --- /dev/null +++ b/target/linux/generic/pending-4.14/432-mtd-bcm47xxpart-detect-T_Meter-partition.patch @@ -0,0 +1,37 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Subject: mtd: bcm47xxpart: detect T_Meter partition + +It can be found on many Netgear devices. It consists of many 0x30 blocks +starting with 4D 54. + +Signed-off-by: Rafał Miłecki +--- + drivers/mtd/bcm47xxpart.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/mtd/bcm47xxpart.c ++++ b/drivers/mtd/bcm47xxpart.c +@@ -39,6 +39,7 @@ + #define NVRAM_HEADER 0x48534C46 /* FLSH */ + #define POT_MAGIC1 0x54544f50 /* POTT */ + #define POT_MAGIC2 0x504f /* OP */ ++#define T_METER_MAGIC 0x4D540000 /* MT */ + #define ML_MAGIC1 0x39685a42 + #define ML_MAGIC2 0x26594131 + #define TRX_MAGIC 0x30524448 +@@ -182,6 +183,15 @@ static int bcm47xxpart_parse(struct mtd_ + MTD_WRITEABLE); + continue; + } ++ ++ /* T_Meter */ ++ if ((le32_to_cpu(buf[0x000 / 4]) & 0xFFFF0000) == T_METER_MAGIC && ++ (le32_to_cpu(buf[0x030 / 4]) & 0xFFFF0000) == T_METER_MAGIC && ++ (le32_to_cpu(buf[0x060 / 4]) & 0xFFFF0000) == T_METER_MAGIC) { ++ bcm47xxpart_add_part(&parts[curr_part++], "T_Meter", offset, ++ MTD_WRITEABLE); ++ continue; ++ } + + /* TRX */ + if (buf[0x000 / 4] == TRX_MAGIC) { diff --git a/target/linux/generic/pending-4.14/440-block2mtd_init.patch b/target/linux/generic/pending-4.14/440-block2mtd_init.patch new file mode 100644 index 0000000000..8834788732 --- /dev/null +++ b/target/linux/generic/pending-4.14/440-block2mtd_init.patch @@ -0,0 +1,116 @@ +From: Felix Fietkau +Subject: block2mtd + +Signed-off-by: Felix Fietkau +--- + drivers/mtd/devices/block2mtd.c | 30 ++++++++++++++++++++---------- + 1 file changed, 20 insertions(+), 10 deletions(-) + +--- a/drivers/mtd/devices/block2mtd.c ++++ b/drivers/mtd/devices/block2mtd.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -219,7 +220,7 @@ static void block2mtd_free_device(struct + + + static struct block2mtd_dev *add_device(char *devname, int erase_size, +- int timeout) ++ const char *mtdname, int timeout) + { + #ifndef MODULE + int i; +@@ -227,6 +228,7 @@ static struct block2mtd_dev *add_device( + const fmode_t mode = FMODE_READ | FMODE_WRITE | FMODE_EXCL; + struct block_device *bdev = ERR_PTR(-ENODEV); + struct block2mtd_dev *dev; ++ struct mtd_partition *part; + char *name; + + if (!devname) +@@ -283,13 +285,16 @@ static struct block2mtd_dev *add_device( + + /* Setup the MTD structure */ + /* make the name contain the block device in */ +- name = kasprintf(GFP_KERNEL, "block2mtd: %s", devname); ++ if (!mtdname) ++ mtdname = devname; ++ name = kmalloc(strlen(mtdname) + 1, GFP_KERNEL); + if (!name) + goto err_destroy_mutex; + ++ strcpy(name, mtdname); + dev->mtd.name = name; + +- dev->mtd.size = dev->blkdev->bd_inode->i_size & PAGE_MASK; ++ dev->mtd.size = dev->blkdev->bd_inode->i_size & PAGE_MASK & ~(erase_size - 1); + dev->mtd.erasesize = erase_size; + dev->mtd.writesize = 1; + dev->mtd.writebufsize = PAGE_SIZE; +@@ -302,7 +307,11 @@ static struct block2mtd_dev *add_device( + dev->mtd.priv = dev; + dev->mtd.owner = THIS_MODULE; + +- if (mtd_device_register(&dev->mtd, NULL, 0)) { ++ part = kzalloc(sizeof(struct mtd_partition), GFP_KERNEL); ++ part->name = name; ++ part->offset = 0; ++ part->size = dev->mtd.size; ++ if (mtd_device_register(&dev->mtd, part, 1)) { + /* Device didn't get added, so free the entry */ + goto err_destroy_mutex; + } +@@ -310,8 +319,7 @@ static struct block2mtd_dev *add_device( + list_add(&dev->list, &blkmtd_device_list); + pr_info("mtd%d: [%s] erase_size = %dKiB [%d]\n", + dev->mtd.index, +- dev->mtd.name + strlen("block2mtd: "), +- dev->mtd.erasesize >> 10, dev->mtd.erasesize); ++ mtdname, dev->mtd.erasesize >> 10, dev->mtd.erasesize); + return dev; + + err_destroy_mutex: +@@ -384,7 +392,7 @@ static int block2mtd_setup2(const char * + /* 80 for device, 12 for erase size, 80 for name, 8 for timeout */ + char buf[80 + 12 + 80 + 8]; + char *str = buf; +- char *token[2]; ++ char *token[3]; + char *name; + size_t erase_size = PAGE_SIZE; + unsigned long timeout = MTD_DEFAULT_TIMEOUT; +@@ -398,7 +406,7 @@ static int block2mtd_setup2(const char * + strcpy(str, val); + kill_final_newline(str); + +- for (i = 0; i < 2; i++) ++ for (i = 0; i < 3; i++) + token[i] = strsep(&str, ","); + + if (str) { +@@ -424,8 +432,10 @@ static int block2mtd_setup2(const char * + return 0; + } + } ++ if (token[2] && (strlen(token[2]) + 1 > 80)) ++ pr_err("mtd device name too long\n"); + +- add_device(name, erase_size, timeout); ++ add_device(name, erase_size, token[2], timeout); + + return 0; + } +@@ -459,7 +469,7 @@ static int block2mtd_setup(const char *v + + + module_param_call(block2mtd, block2mtd_setup, NULL, NULL, 0200); +-MODULE_PARM_DESC(block2mtd, "Device to use. \"block2mtd=[,]\""); ++MODULE_PARM_DESC(block2mtd, "Device to use. \"block2mtd=[,[,]]\""); + + static int __init block2mtd_init(void) + { diff --git a/target/linux/generic/pending-4.14/441-block2mtd_probe.patch b/target/linux/generic/pending-4.14/441-block2mtd_probe.patch new file mode 100644 index 0000000000..fee970ab61 --- /dev/null +++ b/target/linux/generic/pending-4.14/441-block2mtd_probe.patch @@ -0,0 +1,47 @@ +From: Felix Fietkau +Subject: block2mtd + +Signed-off-by: Felix Fietkau +--- + drivers/mtd/devices/block2mtd.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +--- a/drivers/mtd/devices/block2mtd.c ++++ b/drivers/mtd/devices/block2mtd.c +@@ -392,7 +392,7 @@ static int block2mtd_setup2(const char * + /* 80 for device, 12 for erase size, 80 for name, 8 for timeout */ + char buf[80 + 12 + 80 + 8]; + char *str = buf; +- char *token[3]; ++ char *token[4]; + char *name; + size_t erase_size = PAGE_SIZE; + unsigned long timeout = MTD_DEFAULT_TIMEOUT; +@@ -406,7 +406,7 @@ static int block2mtd_setup2(const char * + strcpy(str, val); + kill_final_newline(str); + +- for (i = 0; i < 3; i++) ++ for (i = 0; i < 4; i++) + token[i] = strsep(&str, ","); + + if (str) { +@@ -435,6 +435,9 @@ static int block2mtd_setup2(const char * + if (token[2] && (strlen(token[2]) + 1 > 80)) + pr_err("mtd device name too long\n"); + ++ if (token[3] && kstrtoul(token[3], 0, &timeout)) ++ pr_err("invalid timeout\n"); ++ + add_device(name, erase_size, token[2], timeout); + + return 0; +@@ -469,7 +472,7 @@ static int block2mtd_setup(const char *v + + + module_param_call(block2mtd, block2mtd_setup, NULL, NULL, 0200); +-MODULE_PARM_DESC(block2mtd, "Device to use. \"block2mtd=[,[,]]\""); ++MODULE_PARM_DESC(block2mtd, "Device to use. \"block2mtd=[,[,[,]]]\""); + + static int __init block2mtd_init(void) + { diff --git a/target/linux/generic/pending-4.14/460-mtd-cfi_cmdset_0002-no-erase_suspend.patch b/target/linux/generic/pending-4.14/460-mtd-cfi_cmdset_0002-no-erase_suspend.patch new file mode 100644 index 0000000000..41f9d31cb0 --- /dev/null +++ b/target/linux/generic/pending-4.14/460-mtd-cfi_cmdset_0002-no-erase_suspend.patch @@ -0,0 +1,25 @@ +From: Felix Fietkau +Subject: kernel: disable cfi cmdset 0002 erase suspend + +on some platforms, erase suspend leads to data corruption and lockups when write +ops collide with erase ops. this has been observed on the buffalo wzr-hp-g300nh. +rather than play whack-a-mole with a hard to reproduce issue on a variety of devices, +simply disable erase suspend, as it will usually not produce any useful gain on +the small filesystems used on embedded hardware. + +Signed-off-by: Felix Fietkau +--- + drivers/mtd/chips/cfi_cmdset_0002.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/mtd/chips/cfi_cmdset_0002.c ++++ b/drivers/mtd/chips/cfi_cmdset_0002.c +@@ -811,7 +811,7 @@ static int get_chip(struct map_info *map + return 0; + + case FL_ERASING: +- if (!cfip || !(cfip->EraseSuspend & (0x1|0x2)) || ++ if (1 /* no suspend */ || !cfip || !(cfip->EraseSuspend & (0x1|0x2)) || + !(mode == FL_READY || mode == FL_POINT || + (mode == FL_WRITING && (cfip->EraseSuspend & 0x2)))) + goto sleep; diff --git a/target/linux/generic/pending-4.14/461-mtd-cfi_cmdset_0002-add-buffer-write-cmd-timeout.patch b/target/linux/generic/pending-4.14/461-mtd-cfi_cmdset_0002-add-buffer-write-cmd-timeout.patch new file mode 100644 index 0000000000..f4ba5b72f7 --- /dev/null +++ b/target/linux/generic/pending-4.14/461-mtd-cfi_cmdset_0002-add-buffer-write-cmd-timeout.patch @@ -0,0 +1,17 @@ +From: George Kashperko +Subject: Issue map read after Write Buffer Load command to ensure chip is ready to receive data. + +Signed-off-by: George Kashperko +--- + drivers/mtd/chips/cfi_cmdset_0002.c | 1 + + 1 file changed, 1 insertion(+) +--- a/drivers/mtd/chips/cfi_cmdset_0002.c ++++ b/drivers/mtd/chips/cfi_cmdset_0002.c +@@ -1832,6 +1832,7 @@ static int __xipram do_write_buffer(stru + + /* Write Buffer Load */ + map_write(map, CMD(0x25), cmd_adr); ++ (void) map_read(map, cmd_adr); + + chip->state = FL_WRITING_TO_BUFFER; + diff --git a/target/linux/generic/pending-4.14/465-m25p80-mx-disable-software-protection.patch b/target/linux/generic/pending-4.14/465-m25p80-mx-disable-software-protection.patch new file mode 100644 index 0000000000..89d38ec303 --- /dev/null +++ b/target/linux/generic/pending-4.14/465-m25p80-mx-disable-software-protection.patch @@ -0,0 +1,18 @@ +From: Felix Fietkau +Subject: Disable software protection bits for Macronix flashes. + +Signed-off-by: Felix Fietkau +--- + drivers/mtd/spi-nor/spi-nor.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -2715,6 +2715,7 @@ int spi_nor_scan(struct spi_nor *nor, co + + if (JEDEC_MFR(info) == SNOR_MFR_ATMEL || + JEDEC_MFR(info) == SNOR_MFR_INTEL || ++ JEDEC_MFR(info) == SNOR_MFR_MACRONIX || + JEDEC_MFR(info) == SNOR_MFR_SST || + info->flags & SPI_NOR_HAS_LOCK) { + write_enable(nor); diff --git a/target/linux/generic/pending-4.14/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch b/target/linux/generic/pending-4.14/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch new file mode 100644 index 0000000000..b7877297ae --- /dev/null +++ b/target/linux/generic/pending-4.14/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch @@ -0,0 +1,37 @@ +From: Matthias Schiffer +Date: Tue, 9 Jan 2018 20:41:48 +0100 +Subject: [PATCH] Revert "mtd: spi-nor: fix Spansion regressions (aliased with + Winbond)" + +This reverts commit 67b9bcd36906e12a15ffec19463afbbd6a41660e. + +The underlying issue breaking Spansion flash has been fixed with "mtd: spi-nor: +wait until lock/unlock operations are ready" and "mtd: spi-nor: wait for SR_WIP +to clear on initial unlock", so we can support unlocking for Winbond flash +again. + +Signed-off-by: Matthias Schiffer +--- + drivers/mtd/spi-nor/spi-nor.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -2717,6 +2717,7 @@ int spi_nor_scan(struct spi_nor *nor, co + JEDEC_MFR(info) == SNOR_MFR_INTEL || + JEDEC_MFR(info) == SNOR_MFR_MACRONIX || + JEDEC_MFR(info) == SNOR_MFR_SST || ++ JEDEC_MFR(info) == SNOR_MFR_WINBOND || + info->flags & SPI_NOR_HAS_LOCK) { + write_enable(nor); + write_sr(nor, 0); +@@ -2735,7 +2736,8 @@ int spi_nor_scan(struct spi_nor *nor, co + + /* NOR protection support for STmicro/Micron chips and similar */ + if (JEDEC_MFR(info) == SNOR_MFR_MICRON || +- info->flags & SPI_NOR_HAS_LOCK) { ++ JEDEC_MFR(info) == SNOR_MFR_WINBOND || ++ info->flags & SPI_NOR_HAS_LOCK) { + nor->flash_lock = stm_lock; + nor->flash_unlock = stm_unlock; + nor->flash_is_locked = stm_is_locked; diff --git a/target/linux/generic/pending-4.14/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch b/target/linux/generic/pending-4.14/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch new file mode 100644 index 0000000000..10db289cc9 --- /dev/null +++ b/target/linux/generic/pending-4.14/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch @@ -0,0 +1,56 @@ +From: Felix Fietkau +Date: Sat, 4 Nov 2017 07:40:23 +0100 +Subject: [PATCH] mtd: spi-nor: support limiting 4K sectors support based on + flash size + +Some devices need 4K sectors to be able to deal with small flash chips. +For instance, w25x05 is 64 KiB in size, and without 4K sectors, the +entire chip is just one erase block. +On bigger flash chip sizes, using 4K sectors can significantly slow down +many operations, including using a writable filesystem. There are several +platforms where it makes sense to use a single kernel on both kinds of +devices. + +To support this properly, allow configuring an upper flash chip size +limit for 4K sectors support. + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/mtd/spi-nor/Kconfig ++++ b/drivers/mtd/spi-nor/Kconfig +@@ -39,6 +39,17 @@ config SPI_ASPEED_SMC + and support for the SPI flash memory controller (SPI) for + the host firmware. The implementation only supports SPI NOR. + ++config MTD_SPI_NOR_USE_4K_SECTORS_LIMIT ++ int "Maximum flash chip size to use 4K sectors on (in KiB)" ++ depends on MTD_SPI_NOR_USE_4K_SECTORS ++ default "4096" ++ help ++ There are many flash chips that support 4K sectors, but are so large ++ that using them significantly slows down writing large amounts of ++ data or using a writable filesystem. ++ Any flash chip larger than the size specified in this option will ++ not use 4K sectors. ++ + config SPI_ATMEL_QUADSPI + tristate "Atmel Quad SPI Controller" + depends on ARCH_AT91 || (ARM && COMPILE_TEST) +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -2562,10 +2562,12 @@ static int spi_nor_select_erase(struct s + + #ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS + /* prefer "small sector" erase if possible */ +- if (info->flags & SECT_4K) { ++ if ((info->flags & SECT_4K) && (mtd->size <= ++ CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT * 1024)) { + nor->erase_opcode = SPINOR_OP_BE_4K; + mtd->erasesize = 4096; +- } else if (info->flags & SECT_4K_PMC) { ++ } else if ((info->flags & SECT_4K_PMC) && (mtd->size <= ++ CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT * 1024)) { + nor->erase_opcode = SPINOR_OP_BE_4K_PMC; + mtd->erasesize = 4096; + } else diff --git a/target/linux/generic/pending-4.14/476-mtd-spi-nor-add-eon-en25q128.patch b/target/linux/generic/pending-4.14/476-mtd-spi-nor-add-eon-en25q128.patch new file mode 100644 index 0000000000..ac1fda5159 --- /dev/null +++ b/target/linux/generic/pending-4.14/476-mtd-spi-nor-add-eon-en25q128.patch @@ -0,0 +1,18 @@ +From: Piotr Dymacz +Subject: kernel/mtd: add support for EON EN25Q128 + +Signed-off-by: Piotr Dymacz +--- + drivers/mtd/spi-nor/spi-nor.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -954,6 +954,7 @@ static const struct flash_info spi_nor_i + { "en25q32b", INFO(0x1c3016, 0, 64 * 1024, 64, 0) }, + { "en25p64", INFO(0x1c2017, 0, 64 * 1024, 128, 0) }, + { "en25q64", INFO(0x1c3017, 0, 64 * 1024, 128, SECT_4K) }, ++ { "en25q128", INFO(0x1c3018, 0, 64 * 1024, 256, SECT_4K) }, + { "en25qh128", INFO(0x1c7018, 0, 64 * 1024, 256, 0) }, + { "en25qh256", INFO(0x1c7019, 0, 64 * 1024, 512, 0) }, + { "en25s64", INFO(0x1c3817, 0, 64 * 1024, 128, SECT_4K) }, diff --git a/target/linux/generic/pending-4.14/477-mtd-add-spi-nor-add-mx25u3235f.patch b/target/linux/generic/pending-4.14/477-mtd-add-spi-nor-add-mx25u3235f.patch new file mode 100644 index 0000000000..191e01df7a --- /dev/null +++ b/target/linux/generic/pending-4.14/477-mtd-add-spi-nor-add-mx25u3235f.patch @@ -0,0 +1,18 @@ +From: André Valentin +Subject: linux/mtd: add id for mx25u3235f needed by ZyXEL NBG6817 + +Signed-off-by: André Valentin +--- + drivers/mtd/spi-nor/spi-nor.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -1016,6 +1016,7 @@ static const struct flash_info spi_nor_i + { "mx25l3205d", INFO(0xc22016, 0, 64 * 1024, 64, SECT_4K) }, + { "mx25l3255e", INFO(0xc29e16, 0, 64 * 1024, 64, SECT_4K) }, + { "mx25l6405d", INFO(0xc22017, 0, 64 * 1024, 128, SECT_4K) }, ++ { "mx25u3235f", INFO(0xc22536, 0, 64 * 1024, 64, 0) }, + { "mx25u2033e", INFO(0xc22532, 0, 64 * 1024, 4, SECT_4K) }, + { "mx25u4035", INFO(0xc22533, 0, 64 * 1024, 8, SECT_4K) }, + { "mx25u8035", INFO(0xc22534, 0, 64 * 1024, 16, SECT_4K) }, diff --git a/target/linux/generic/pending-4.14/480-mtd-set-rootfs-to-be-root-dev.patch b/target/linux/generic/pending-4.14/480-mtd-set-rootfs-to-be-root-dev.patch new file mode 100644 index 0000000000..6cddaf01b7 --- /dev/null +++ b/target/linux/generic/pending-4.14/480-mtd-set-rootfs-to-be-root-dev.patch @@ -0,0 +1,38 @@ +From: Gabor Juhos +Subject: kernel/3.1[02]: move MTD root device setup code to mtdcore + +The current code only allows to automatically set +root device on MTD partitions. Move the code to MTD +core to allow to use it with all MTD devices. + +Signed-off-by: Gabor Juhos +--- + drivers/mtd/mtdcore.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/mtd/mtdcore.c ++++ b/drivers/mtd/mtdcore.c +@@ -41,6 +41,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -578,6 +579,15 @@ int add_mtd_device(struct mtd_info *mtd) + of this try_ nonsense, and no bitching about it + either. :) */ + __module_get(THIS_MODULE); ++ ++ if (!strcmp(mtd->name, "rootfs") && ++ IS_ENABLED(CONFIG_MTD_ROOTFS_ROOT_DEV) && ++ ROOT_DEV == 0) { ++ pr_notice("mtd: device %d (%s) set to be root filesystem\n", ++ mtd->index, mtd->name); ++ ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, mtd->index); ++ } ++ + return 0; + + fail_added: diff --git a/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch new file mode 100644 index 0000000000..180d1407d2 --- /dev/null +++ b/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -0,0 +1,73 @@ +From: Daniel Golle +Subject: ubi: auto-attach mtd device named "ubi" or "data" on boot + +Signed-off-by: Daniel Golle +--- + drivers/mtd/ubi/build.c | 36 ++++++++++++++++++++++++++++++++++++ + 1 file changed, 36 insertions(+) + +--- a/drivers/mtd/ubi/build.c ++++ b/drivers/mtd/ubi/build.c +@@ -1157,6 +1157,49 @@ static struct mtd_info * __init open_mtd + return mtd; + } + ++/* ++ * This function tries attaching mtd partitions named either "ubi" or "data" ++ * during boot. ++ */ ++static void __init ubi_auto_attach(void) ++{ ++ int err; ++ struct mtd_info *mtd; ++ ++ /* try attaching mtd device named "ubi" or "data" */ ++ mtd = open_mtd_device("ubi"); ++ if (IS_ERR(mtd)) ++ mtd = open_mtd_device("data"); ++ ++ if (!IS_ERR(mtd)) { ++ size_t len; ++ char magic[4]; ++ ++ /* check for a valid ubi magic */ ++ err = mtd_read(mtd, 0, 4, &len, (void *) magic); ++ if (!err && len == 4 && strncmp(magic, "UBI#", 4)) { ++ pr_err("UBI error: no valid UBI magic found inside mtd%d\n", mtd->index); ++ put_mtd_device(mtd); ++ return; ++ } ++ ++ /* auto-add only media types where UBI makes sense */ ++ if (mtd->type == MTD_NANDFLASH || ++ mtd->type == MTD_NORFLASH || ++ mtd->type == MTD_DATAFLASH || ++ mtd->type == MTD_MLCNANDFLASH) { ++ mutex_lock(&ubi_devices_mutex); ++ pr_notice("UBI: auto-attach mtd%d\n", mtd->index); ++ err = ubi_attach_mtd_dev(mtd, UBI_DEV_NUM_AUTO, 0, 0); ++ mutex_unlock(&ubi_devices_mutex); ++ if (err < 0) { ++ pr_err("UBI error: cannot attach mtd%d\n", mtd->index); ++ put_mtd_device(mtd); ++ } ++ } ++ } ++} ++ + static int __init ubi_init(void) + { + int err, i, k; +@@ -1240,6 +1283,12 @@ static int __init ubi_init(void) + } + } + ++ /* auto-attach mtd devices only if built-in to the kernel and no ubi.mtd ++ * parameter was given */ ++ if (IS_ENABLED(CONFIG_MTD_ROOTFS_ROOT_DEV) && ++ !ubi_is_module() && !mtd_devs) ++ ubi_auto_attach(); ++ + err = ubiblock_init(); + if (err) { + pr_err("UBI error: block: cannot initialize, error %d\n", err); diff --git a/target/linux/generic/pending-4.14/491-ubi-auto-create-ubiblock-device-for-rootfs.patch b/target/linux/generic/pending-4.14/491-ubi-auto-create-ubiblock-device-for-rootfs.patch new file mode 100644 index 0000000000..f8dc1bcb28 --- /dev/null +++ b/target/linux/generic/pending-4.14/491-ubi-auto-create-ubiblock-device-for-rootfs.patch @@ -0,0 +1,66 @@ +From: Daniel Golle +Subject: ubi: auto-create ubiblock device for rootfs + +Signed-off-by: Daniel Golle +--- + drivers/mtd/ubi/block.c | 42 ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 42 insertions(+) + +--- a/drivers/mtd/ubi/block.c ++++ b/drivers/mtd/ubi/block.c +@@ -625,6 +625,44 @@ static void __init ubiblock_create_from_ + } + } + ++#define UBIFS_NODE_MAGIC 0x06101831 ++static inline int ubi_vol_is_ubifs(struct ubi_volume_desc *desc) ++{ ++ int ret; ++ uint32_t magic_of, magic; ++ ret = ubi_read(desc, 0, (char *)&magic_of, 0, 4); ++ if (ret) ++ return 0; ++ magic = le32_to_cpu(magic_of); ++ return magic == UBIFS_NODE_MAGIC; ++} ++ ++static void __init ubiblock_create_auto_rootfs(void) ++{ ++ int ubi_num, ret, is_ubifs; ++ struct ubi_volume_desc *desc; ++ struct ubi_volume_info vi; ++ ++ for (ubi_num = 0; ubi_num < UBI_MAX_DEVICES; ubi_num++) { ++ desc = ubi_open_volume_nm(ubi_num, "rootfs", UBI_READONLY); ++ if (IS_ERR(desc)) ++ continue; ++ ++ ubi_get_volume_info(desc, &vi); ++ is_ubifs = ubi_vol_is_ubifs(desc); ++ ubi_close_volume(desc); ++ if (is_ubifs) ++ break; ++ ++ ret = ubiblock_create(&vi); ++ if (ret) ++ pr_err("UBI error: block: can't add '%s' volume, err=%d\n", ++ vi.name, ret); ++ /* always break if we get here */ ++ break; ++ } ++} ++ + static void ubiblock_remove_all(void) + { + struct ubiblock *next; +@@ -655,6 +693,10 @@ int __init ubiblock_init(void) + */ + ubiblock_create_from_param(); + ++ /* auto-attach "rootfs" volume if existing and non-ubifs */ ++ if (IS_ENABLED(CONFIG_MTD_ROOTFS_ROOT_DEV)) ++ ubiblock_create_auto_rootfs(); ++ + /* + * Block devices are only created upon user requests, so we ignore + * existing volumes. diff --git a/target/linux/generic/pending-4.14/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch b/target/linux/generic/pending-4.14/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch new file mode 100644 index 0000000000..69a35c25e7 --- /dev/null +++ b/target/linux/generic/pending-4.14/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch @@ -0,0 +1,51 @@ +From: Daniel Golle +Subject: try auto-mounting ubi0:rootfs in init/do_mounts.c + +Signed-off-by: Daniel Golle +--- + init/do_mounts.c | 26 +++++++++++++++++++++++++- + 1 file changed, 25 insertions(+), 1 deletion(-) + +--- a/init/do_mounts.c ++++ b/init/do_mounts.c +@@ -438,7 +438,28 @@ retry: + out: + put_page(page); + } +- ++ ++static int __init mount_ubi_rootfs(void) ++{ ++ int flags = MS_SILENT; ++ int err, tried = 0; ++ ++ while (tried < 2) { ++ err = do_mount_root("ubi0:rootfs", "ubifs", flags, \ ++ root_mount_data); ++ switch (err) { ++ case -EACCES: ++ flags |= MS_RDONLY; ++ tried++; ++ break; ++ default: ++ return err; ++ } ++ } ++ ++ return -EINVAL; ++} ++ + #ifdef CONFIG_ROOT_NFS + + #define NFSROOT_TIMEOUT_MIN 5 +@@ -532,6 +553,10 @@ void __init mount_root(void) + change_floppy("root floppy"); + } + #endif ++#ifdef CONFIG_MTD_ROOTFS_ROOT_DEV ++ if (!mount_ubi_rootfs()) ++ return; ++#endif + #ifdef CONFIG_BLOCK + { + int err = create_dev("/dev/root", ROOT_DEV); diff --git a/target/linux/generic/pending-4.14/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch b/target/linux/generic/pending-4.14/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch new file mode 100644 index 0000000000..06cd1b62ac --- /dev/null +++ b/target/linux/generic/pending-4.14/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch @@ -0,0 +1,34 @@ +From: Daniel Golle +Subject: ubi: set ROOT_DEV to ubiblock "rootfs" if unset + +Signed-off-by: Daniel Golle +--- + drivers/mtd/ubi/block.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/mtd/ubi/block.c ++++ b/drivers/mtd/ubi/block.c +@@ -50,6 +50,7 @@ + #include + #include + #include ++#include + + #include "ubi-media.h" + #include "ubi.h" +@@ -445,6 +446,15 @@ int ubiblock_create(struct ubi_volume_in + add_disk(dev->gd); + dev_info(disk_to_dev(dev->gd), "created from ubi%d:%d(%s)", + dev->ubi_num, dev->vol_id, vi->name); ++ ++ if (!strcmp(vi->name, "rootfs") && ++ IS_ENABLED(CONFIG_MTD_ROOTFS_ROOT_DEV) && ++ ROOT_DEV == 0) { ++ pr_notice("ubiblock: device ubiblock%d_%d (%s) set to be root filesystem\n", ++ dev->ubi_num, dev->vol_id, vi->name); ++ ROOT_DEV = MKDEV(gd->major, gd->first_minor); ++ } ++ + return 0; + + out_free_queue: diff --git a/target/linux/generic/pending-4.14/494-mtd-ubi-add-EOF-marker-support.patch b/target/linux/generic/pending-4.14/494-mtd-ubi-add-EOF-marker-support.patch new file mode 100644 index 0000000000..c8e25710b2 --- /dev/null +++ b/target/linux/generic/pending-4.14/494-mtd-ubi-add-EOF-marker-support.patch @@ -0,0 +1,60 @@ +From: Gabor Juhos +Subject: mtd: add EOF marker support to the UBI layer + +Signed-off-by: Gabor Juhos +--- + drivers/mtd/ubi/attach.c | 25 ++++++++++++++++++++++--- + drivers/mtd/ubi/ubi.h | 1 + + 2 files changed, 23 insertions(+), 3 deletions(-) + +--- a/drivers/mtd/ubi/attach.c ++++ b/drivers/mtd/ubi/attach.c +@@ -939,6 +939,13 @@ static bool vol_ignored(int vol_id) + #endif + } + ++static bool ec_hdr_has_eof(struct ubi_ec_hdr *ech) ++{ ++ return ech->padding1[0] == 'E' && ++ ech->padding1[1] == 'O' && ++ ech->padding1[2] == 'F'; ++} ++ + /** + * scan_peb - scan and process UBI headers of a PEB. + * @ubi: UBI device description object +@@ -971,9 +978,21 @@ static int scan_peb(struct ubi_device *u + return 0; + } + +- err = ubi_io_read_ec_hdr(ubi, pnum, ech, 0); +- if (err < 0) +- return err; ++ if (!ai->eof_found) { ++ err = ubi_io_read_ec_hdr(ubi, pnum, ech, 0); ++ if (err < 0) ++ return err; ++ ++ if (ec_hdr_has_eof(ech)) { ++ pr_notice("UBI: EOF marker found, PEBs from %d will be erased\n", ++ pnum); ++ ai->eof_found = true; ++ } ++ } ++ ++ if (ai->eof_found) ++ err = UBI_IO_FF_BITFLIPS; ++ + switch (err) { + case 0: + break; +--- a/drivers/mtd/ubi/ubi.h ++++ b/drivers/mtd/ubi/ubi.h +@@ -778,6 +778,7 @@ struct ubi_attach_info { + int mean_ec; + uint64_t ec_sum; + int ec_count; ++ bool eof_found; + struct kmem_cache *aeb_slab_cache; + struct ubi_ec_hdr *ech; + struct ubi_vid_io_buf *vidb; diff --git a/target/linux/generic/pending-4.14/530-jffs2_make_lzma_available.patch b/target/linux/generic/pending-4.14/530-jffs2_make_lzma_available.patch new file mode 100644 index 0000000000..046e9d54d3 --- /dev/null +++ b/target/linux/generic/pending-4.14/530-jffs2_make_lzma_available.patch @@ -0,0 +1,5180 @@ +From: Alexandros C. Couloumbis +Subject: fs: add jffs2/lzma support (not activated by default yet) + +lede-commit: c2c88d315fa0e881f8b19da07b62859b915b11b2 +Signed-off-by: Alexandros C. Couloumbis +--- + fs/jffs2/Kconfig | 9 + + fs/jffs2/Makefile | 3 + + fs/jffs2/compr.c | 6 + + fs/jffs2/compr.h | 10 +- + fs/jffs2/compr_lzma.c | 128 +++ + fs/jffs2/super.c | 33 +- + include/linux/lzma.h | 62 ++ + include/linux/lzma/LzFind.h | 115 +++ + include/linux/lzma/LzHash.h | 54 + + include/linux/lzma/LzmaDec.h | 231 +++++ + include/linux/lzma/LzmaEnc.h | 80 ++ + include/linux/lzma/Types.h | 226 +++++ + include/uapi/linux/jffs2.h | 1 + + lib/Kconfig | 6 + + lib/Makefile | 12 + + lib/lzma/LzFind.c | 761 ++++++++++++++ + lib/lzma/LzmaDec.c | 999 +++++++++++++++++++ + lib/lzma/LzmaEnc.c | 2271 ++++++++++++++++++++++++++++++++++++++++++ + lib/lzma/Makefile | 7 + + 19 files changed, 5008 insertions(+), 6 deletions(-) + create mode 100644 fs/jffs2/compr_lzma.c + create mode 100644 include/linux/lzma.h + create mode 100644 include/linux/lzma/LzFind.h + create mode 100644 include/linux/lzma/LzHash.h + create mode 100644 include/linux/lzma/LzmaDec.h + create mode 100644 include/linux/lzma/LzmaEnc.h + create mode 100644 include/linux/lzma/Types.h + create mode 100644 lib/lzma/LzFind.c + create mode 100644 lib/lzma/LzmaDec.c + create mode 100644 lib/lzma/LzmaEnc.c + create mode 100644 lib/lzma/Makefile + +--- a/fs/jffs2/Kconfig ++++ b/fs/jffs2/Kconfig +@@ -139,6 +139,15 @@ config JFFS2_LZO + This feature was added in July, 2007. Say 'N' if you need + compatibility with older bootloaders or kernels. + ++config JFFS2_LZMA ++ bool "JFFS2 LZMA compression support" if JFFS2_COMPRESSION_OPTIONS ++ select LZMA_COMPRESS ++ select LZMA_DECOMPRESS ++ depends on JFFS2_FS ++ default n ++ help ++ JFFS2 wrapper to the LZMA C SDK ++ + config JFFS2_RTIME + bool "JFFS2 RTIME compression support" if JFFS2_COMPRESSION_OPTIONS + depends on JFFS2_FS +--- a/fs/jffs2/Makefile ++++ b/fs/jffs2/Makefile +@@ -19,4 +19,7 @@ jffs2-$(CONFIG_JFFS2_RUBIN) += compr_rub + jffs2-$(CONFIG_JFFS2_RTIME) += compr_rtime.o + jffs2-$(CONFIG_JFFS2_ZLIB) += compr_zlib.o + jffs2-$(CONFIG_JFFS2_LZO) += compr_lzo.o ++jffs2-$(CONFIG_JFFS2_LZMA) += compr_lzma.o + jffs2-$(CONFIG_JFFS2_SUMMARY) += summary.o ++ ++CFLAGS_compr_lzma.o += -Iinclude/linux -Ilib/lzma +--- a/fs/jffs2/compr.c ++++ b/fs/jffs2/compr.c +@@ -378,6 +378,9 @@ int __init jffs2_compressors_init(void) + #ifdef CONFIG_JFFS2_LZO + jffs2_lzo_init(); + #endif ++#ifdef CONFIG_JFFS2_LZMA ++ jffs2_lzma_init(); ++#endif + /* Setting default compression mode */ + #ifdef CONFIG_JFFS2_CMODE_NONE + jffs2_compression_mode = JFFS2_COMPR_MODE_NONE; +@@ -401,6 +404,9 @@ int __init jffs2_compressors_init(void) + int jffs2_compressors_exit(void) + { + /* Unregistering compressors */ ++#ifdef CONFIG_JFFS2_LZMA ++ jffs2_lzma_exit(); ++#endif + #ifdef CONFIG_JFFS2_LZO + jffs2_lzo_exit(); + #endif +--- a/fs/jffs2/compr.h ++++ b/fs/jffs2/compr.h +@@ -29,9 +29,9 @@ + #define JFFS2_DYNRUBIN_PRIORITY 20 + #define JFFS2_LZARI_PRIORITY 30 + #define JFFS2_RTIME_PRIORITY 50 +-#define JFFS2_ZLIB_PRIORITY 60 +-#define JFFS2_LZO_PRIORITY 80 +- ++#define JFFS2_LZMA_PRIORITY 70 ++#define JFFS2_ZLIB_PRIORITY 80 ++#define JFFS2_LZO_PRIORITY 90 + + #define JFFS2_RUBINMIPS_DISABLED /* RUBINs will be used only */ + #define JFFS2_DYNRUBIN_DISABLED /* for decompression */ +@@ -101,5 +101,9 @@ void jffs2_zlib_exit(void); + int jffs2_lzo_init(void); + void jffs2_lzo_exit(void); + #endif ++#ifdef CONFIG_JFFS2_LZMA ++int jffs2_lzma_init(void); ++void jffs2_lzma_exit(void); ++#endif + + #endif /* __JFFS2_COMPR_H__ */ +--- /dev/null ++++ b/fs/jffs2/compr_lzma.c +@@ -0,0 +1,128 @@ ++/* ++ * JFFS2 -- Journalling Flash File System, Version 2. ++ * ++ * For licensing information, see the file 'LICENCE' in this directory. ++ * ++ * JFFS2 wrapper to the LZMA C SDK ++ * ++ */ ++ ++#include ++#include "compr.h" ++ ++#ifdef __KERNEL__ ++ static DEFINE_MUTEX(deflate_mutex); ++#endif ++ ++CLzmaEncHandle *p; ++Byte propsEncoded[LZMA_PROPS_SIZE]; ++SizeT propsSize = sizeof(propsEncoded); ++ ++STATIC void lzma_free_workspace(void) ++{ ++ LzmaEnc_Destroy(p, &lzma_alloc, &lzma_alloc); ++} ++ ++STATIC int INIT lzma_alloc_workspace(CLzmaEncProps *props) ++{ ++ if ((p = (CLzmaEncHandle *)LzmaEnc_Create(&lzma_alloc)) == NULL) ++ { ++ PRINT_ERROR("Failed to allocate lzma deflate workspace\n"); ++ return -ENOMEM; ++ } ++ ++ if (LzmaEnc_SetProps(p, props) != SZ_OK) ++ { ++ lzma_free_workspace(); ++ return -1; ++ } ++ ++ if (LzmaEnc_WriteProperties(p, propsEncoded, &propsSize) != SZ_OK) ++ { ++ lzma_free_workspace(); ++ return -1; ++ } ++ ++ return 0; ++} ++ ++STATIC int jffs2_lzma_compress(unsigned char *data_in, unsigned char *cpage_out, ++ uint32_t *sourcelen, uint32_t *dstlen) ++{ ++ SizeT compress_size = (SizeT)(*dstlen); ++ int ret; ++ ++ #ifdef __KERNEL__ ++ mutex_lock(&deflate_mutex); ++ #endif ++ ++ ret = LzmaEnc_MemEncode(p, cpage_out, &compress_size, data_in, *sourcelen, ++ 0, NULL, &lzma_alloc, &lzma_alloc); ++ ++ #ifdef __KERNEL__ ++ mutex_unlock(&deflate_mutex); ++ #endif ++ ++ if (ret != SZ_OK) ++ return -1; ++ ++ *dstlen = (uint32_t)compress_size; ++ ++ return 0; ++} ++ ++STATIC int jffs2_lzma_decompress(unsigned char *data_in, unsigned char *cpage_out, ++ uint32_t srclen, uint32_t destlen) ++{ ++ int ret; ++ SizeT dl = (SizeT)destlen; ++ SizeT sl = (SizeT)srclen; ++ ELzmaStatus status; ++ ++ ret = LzmaDecode(cpage_out, &dl, data_in, &sl, propsEncoded, ++ propsSize, LZMA_FINISH_ANY, &status, &lzma_alloc); ++ ++ if (ret != SZ_OK || status == LZMA_STATUS_NOT_FINISHED || dl != (SizeT)destlen) ++ return -1; ++ ++ return 0; ++} ++ ++static struct jffs2_compressor jffs2_lzma_comp = { ++ .priority = JFFS2_LZMA_PRIORITY, ++ .name = "lzma", ++ .compr = JFFS2_COMPR_LZMA, ++ .compress = &jffs2_lzma_compress, ++ .decompress = &jffs2_lzma_decompress, ++ .disabled = 0, ++}; ++ ++int INIT jffs2_lzma_init(void) ++{ ++ int ret; ++ CLzmaEncProps props; ++ LzmaEncProps_Init(&props); ++ ++ props.dictSize = LZMA_BEST_DICT(0x2000); ++ props.level = LZMA_BEST_LEVEL; ++ props.lc = LZMA_BEST_LC; ++ props.lp = LZMA_BEST_LP; ++ props.pb = LZMA_BEST_PB; ++ props.fb = LZMA_BEST_FB; ++ ++ ret = lzma_alloc_workspace(&props); ++ if (ret < 0) ++ return ret; ++ ++ ret = jffs2_register_compressor(&jffs2_lzma_comp); ++ if (ret) ++ lzma_free_workspace(); ++ ++ return ret; ++} ++ ++void jffs2_lzma_exit(void) ++{ ++ jffs2_unregister_compressor(&jffs2_lzma_comp); ++ lzma_free_workspace(); ++} +--- a/fs/jffs2/super.c ++++ b/fs/jffs2/super.c +@@ -372,14 +372,41 @@ static int __init init_jffs2_fs(void) + BUILD_BUG_ON(sizeof(struct jffs2_raw_inode) != 68); + BUILD_BUG_ON(sizeof(struct jffs2_raw_summary) != 32); + +- pr_info("version 2.2." ++ pr_info("version 2.2" + #ifdef CONFIG_JFFS2_FS_WRITEBUFFER + " (NAND)" + #endif + #ifdef CONFIG_JFFS2_SUMMARY +- " (SUMMARY) " ++ " (SUMMARY)" + #endif +- " © 2001-2006 Red Hat, Inc.\n"); ++#ifdef CONFIG_JFFS2_ZLIB ++ " (ZLIB)" ++#endif ++#ifdef CONFIG_JFFS2_LZO ++ " (LZO)" ++#endif ++#ifdef CONFIG_JFFS2_LZMA ++ " (LZMA)" ++#endif ++#ifdef CONFIG_JFFS2_RTIME ++ " (RTIME)" ++#endif ++#ifdef CONFIG_JFFS2_RUBIN ++ " (RUBIN)" ++#endif ++#ifdef CONFIG_JFFS2_CMODE_NONE ++ " (CMODE_NONE)" ++#endif ++#ifdef CONFIG_JFFS2_CMODE_PRIORITY ++ " (CMODE_PRIORITY)" ++#endif ++#ifdef CONFIG_JFFS2_CMODE_SIZE ++ " (CMODE_SIZE)" ++#endif ++#ifdef CONFIG_JFFS2_CMODE_FAVOURLZO ++ " (CMODE_FAVOURLZO)" ++#endif ++ " (c) 2001-2006 Red Hat, Inc.\n"); + + jffs2_inode_cachep = kmem_cache_create("jffs2_i", + sizeof(struct jffs2_inode_info), +--- /dev/null ++++ b/include/linux/lzma.h +@@ -0,0 +1,62 @@ ++#ifndef __LZMA_H__ ++#define __LZMA_H__ ++ ++#ifdef __KERNEL__ ++ #include ++ #include ++ #include ++ #include ++ #include ++ #define LZMA_MALLOC vmalloc ++ #define LZMA_FREE vfree ++ #define PRINT_ERROR(msg) printk(KERN_WARNING #msg) ++ #define INIT __init ++ #define STATIC static ++#else ++ #include ++ #include ++ #include ++ #include ++ #include ++ #include ++ #include ++ #include ++ #ifndef PAGE_SIZE ++ extern int page_size; ++ #define PAGE_SIZE page_size ++ #endif ++ #define LZMA_MALLOC malloc ++ #define LZMA_FREE free ++ #define PRINT_ERROR(msg) fprintf(stderr, msg) ++ #define INIT ++ #define STATIC ++#endif ++ ++#include "lzma/LzmaDec.h" ++#include "lzma/LzmaEnc.h" ++ ++#define LZMA_BEST_LEVEL (9) ++#define LZMA_BEST_LC (0) ++#define LZMA_BEST_LP (0) ++#define LZMA_BEST_PB (0) ++#define LZMA_BEST_FB (273) ++ ++#define LZMA_BEST_DICT(n) (((int)((n) / 2)) * 2) ++ ++static void *p_lzma_malloc(void *p, size_t size) ++{ ++ if (size == 0) ++ return NULL; ++ ++ return LZMA_MALLOC(size); ++} ++ ++static void p_lzma_free(void *p, void *address) ++{ ++ if (address != NULL) ++ LZMA_FREE(address); ++} ++ ++static ISzAlloc lzma_alloc = {p_lzma_malloc, p_lzma_free}; ++ ++#endif +--- /dev/null ++++ b/include/linux/lzma/LzFind.h +@@ -0,0 +1,115 @@ ++/* LzFind.h -- Match finder for LZ algorithms ++2009-04-22 : Igor Pavlov : Public domain */ ++ ++#ifndef __LZ_FIND_H ++#define __LZ_FIND_H ++ ++#include "Types.h" ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++typedef UInt32 CLzRef; ++ ++typedef struct _CMatchFinder ++{ ++ Byte *buffer; ++ UInt32 pos; ++ UInt32 posLimit; ++ UInt32 streamPos; ++ UInt32 lenLimit; ++ ++ UInt32 cyclicBufferPos; ++ UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */ ++ ++ UInt32 matchMaxLen; ++ CLzRef *hash; ++ CLzRef *son; ++ UInt32 hashMask; ++ UInt32 cutValue; ++ ++ Byte *bufferBase; ++ ISeqInStream *stream; ++ int streamEndWasReached; ++ ++ UInt32 blockSize; ++ UInt32 keepSizeBefore; ++ UInt32 keepSizeAfter; ++ ++ UInt32 numHashBytes; ++ int directInput; ++ size_t directInputRem; ++ int btMode; ++ int bigHash; ++ UInt32 historySize; ++ UInt32 fixedHashSize; ++ UInt32 hashSizeSum; ++ UInt32 numSons; ++ SRes result; ++ UInt32 crc[256]; ++} CMatchFinder; ++ ++#define Inline_MatchFinder_GetPointerToCurrentPos(p) ((p)->buffer) ++#define Inline_MatchFinder_GetIndexByte(p, index) ((p)->buffer[(Int32)(index)]) ++ ++#define Inline_MatchFinder_GetNumAvailableBytes(p) ((p)->streamPos - (p)->pos) ++ ++int MatchFinder_NeedMove(CMatchFinder *p); ++Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p); ++void MatchFinder_MoveBlock(CMatchFinder *p); ++void MatchFinder_ReadIfRequired(CMatchFinder *p); ++ ++void MatchFinder_Construct(CMatchFinder *p); ++ ++/* Conditions: ++ historySize <= 3 GB ++ keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB ++*/ ++int MatchFinder_Create(CMatchFinder *p, UInt32 historySize, ++ UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ++ ISzAlloc *alloc); ++void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc); ++void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems); ++void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue); ++ ++UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son, ++ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue, ++ UInt32 *distances, UInt32 maxLen); ++ ++/* ++Conditions: ++ Mf_GetNumAvailableBytes_Func must be called before each Mf_GetMatchLen_Func. ++ Mf_GetPointerToCurrentPos_Func's result must be used only before any other function ++*/ ++ ++typedef void (*Mf_Init_Func)(void *object); ++typedef Byte (*Mf_GetIndexByte_Func)(void *object, Int32 index); ++typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object); ++typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object); ++typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances); ++typedef void (*Mf_Skip_Func)(void *object, UInt32); ++ ++typedef struct _IMatchFinder ++{ ++ Mf_Init_Func Init; ++ Mf_GetIndexByte_Func GetIndexByte; ++ Mf_GetNumAvailableBytes_Func GetNumAvailableBytes; ++ Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos; ++ Mf_GetMatches_Func GetMatches; ++ Mf_Skip_Func Skip; ++} IMatchFinder; ++ ++void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable); ++ ++void MatchFinder_Init(CMatchFinder *p); ++UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); ++UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); ++void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); ++void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +--- /dev/null ++++ b/include/linux/lzma/LzHash.h +@@ -0,0 +1,54 @@ ++/* LzHash.h -- HASH functions for LZ algorithms ++2009-02-07 : Igor Pavlov : Public domain */ ++ ++#ifndef __LZ_HASH_H ++#define __LZ_HASH_H ++ ++#define kHash2Size (1 << 10) ++#define kHash3Size (1 << 16) ++#define kHash4Size (1 << 20) ++ ++#define kFix3HashSize (kHash2Size) ++#define kFix4HashSize (kHash2Size + kHash3Size) ++#define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size) ++ ++#define HASH2_CALC hashValue = cur[0] | ((UInt32)cur[1] << 8); ++ ++#define HASH3_CALC { \ ++ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ ++ hash2Value = temp & (kHash2Size - 1); \ ++ hashValue = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; } ++ ++#define HASH4_CALC { \ ++ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ ++ hash2Value = temp & (kHash2Size - 1); \ ++ hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ ++ hashValue = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & p->hashMask; } ++ ++#define HASH5_CALC { \ ++ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ ++ hash2Value = temp & (kHash2Size - 1); \ ++ hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ ++ hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)); \ ++ hashValue = (hash4Value ^ (p->crc[cur[4]] << 3)) & p->hashMask; \ ++ hash4Value &= (kHash4Size - 1); } ++ ++/* #define HASH_ZIP_CALC hashValue = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */ ++#define HASH_ZIP_CALC hashValue = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF; ++ ++ ++#define MT_HASH2_CALC \ ++ hash2Value = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1); ++ ++#define MT_HASH3_CALC { \ ++ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ ++ hash2Value = temp & (kHash2Size - 1); \ ++ hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); } ++ ++#define MT_HASH4_CALC { \ ++ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ ++ hash2Value = temp & (kHash2Size - 1); \ ++ hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ ++ hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); } ++ ++#endif +--- /dev/null ++++ b/include/linux/lzma/LzmaDec.h +@@ -0,0 +1,231 @@ ++/* LzmaDec.h -- LZMA Decoder ++2009-02-07 : Igor Pavlov : Public domain */ ++ ++#ifndef __LZMA_DEC_H ++#define __LZMA_DEC_H ++ ++#include "Types.h" ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++/* #define _LZMA_PROB32 */ ++/* _LZMA_PROB32 can increase the speed on some CPUs, ++ but memory usage for CLzmaDec::probs will be doubled in that case */ ++ ++#ifdef _LZMA_PROB32 ++#define CLzmaProb UInt32 ++#else ++#define CLzmaProb UInt16 ++#endif ++ ++ ++/* ---------- LZMA Properties ---------- */ ++ ++#define LZMA_PROPS_SIZE 5 ++ ++typedef struct _CLzmaProps ++{ ++ unsigned lc, lp, pb; ++ UInt32 dicSize; ++} CLzmaProps; ++ ++/* LzmaProps_Decode - decodes properties ++Returns: ++ SZ_OK ++ SZ_ERROR_UNSUPPORTED - Unsupported properties ++*/ ++ ++SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size); ++ ++ ++/* ---------- LZMA Decoder state ---------- */ ++ ++/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case. ++ Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */ ++ ++#define LZMA_REQUIRED_INPUT_MAX 20 ++ ++typedef struct ++{ ++ CLzmaProps prop; ++ CLzmaProb *probs; ++ Byte *dic; ++ const Byte *buf; ++ UInt32 range, code; ++ SizeT dicPos; ++ SizeT dicBufSize; ++ UInt32 processedPos; ++ UInt32 checkDicSize; ++ unsigned state; ++ UInt32 reps[4]; ++ unsigned remainLen; ++ int needFlush; ++ int needInitState; ++ UInt32 numProbs; ++ unsigned tempBufSize; ++ Byte tempBuf[LZMA_REQUIRED_INPUT_MAX]; ++} CLzmaDec; ++ ++#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; } ++ ++void LzmaDec_Init(CLzmaDec *p); ++ ++/* There are two types of LZMA streams: ++ 0) Stream with end mark. That end mark adds about 6 bytes to compressed size. ++ 1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */ ++ ++typedef enum ++{ ++ LZMA_FINISH_ANY, /* finish at any point */ ++ LZMA_FINISH_END /* block must be finished at the end */ ++} ELzmaFinishMode; ++ ++/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!! ++ ++ You must use LZMA_FINISH_END, when you know that current output buffer ++ covers last bytes of block. In other cases you must use LZMA_FINISH_ANY. ++ ++ If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK, ++ and output value of destLen will be less than output buffer size limit. ++ You can check status result also. ++ ++ You can use multiple checks to test data integrity after full decompression: ++ 1) Check Result and "status" variable. ++ 2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize. ++ 3) Check that output(srcLen) = compressedSize, if you know real compressedSize. ++ You must use correct finish mode in that case. */ ++ ++typedef enum ++{ ++ LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */ ++ LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */ ++ LZMA_STATUS_NOT_FINISHED, /* stream was not finished */ ++ LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */ ++ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */ ++} ELzmaStatus; ++ ++/* ELzmaStatus is used only as output value for function call */ ++ ++ ++/* ---------- Interfaces ---------- */ ++ ++/* There are 3 levels of interfaces: ++ 1) Dictionary Interface ++ 2) Buffer Interface ++ 3) One Call Interface ++ You can select any of these interfaces, but don't mix functions from different ++ groups for same object. */ ++ ++ ++/* There are two variants to allocate state for Dictionary Interface: ++ 1) LzmaDec_Allocate / LzmaDec_Free ++ 2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs ++ You can use variant 2, if you set dictionary buffer manually. ++ For Buffer Interface you must always use variant 1. ++ ++LzmaDec_Allocate* can return: ++ SZ_OK ++ SZ_ERROR_MEM - Memory allocation error ++ SZ_ERROR_UNSUPPORTED - Unsupported properties ++*/ ++ ++SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc); ++void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc); ++ ++SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc); ++void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc); ++ ++/* ---------- Dictionary Interface ---------- */ ++ ++/* You can use it, if you want to eliminate the overhead for data copying from ++ dictionary to some other external buffer. ++ You must work with CLzmaDec variables directly in this interface. ++ ++ STEPS: ++ LzmaDec_Constr() ++ LzmaDec_Allocate() ++ for (each new stream) ++ { ++ LzmaDec_Init() ++ while (it needs more decompression) ++ { ++ LzmaDec_DecodeToDic() ++ use data from CLzmaDec::dic and update CLzmaDec::dicPos ++ } ++ } ++ LzmaDec_Free() ++*/ ++ ++/* LzmaDec_DecodeToDic ++ ++ The decoding to internal dictionary buffer (CLzmaDec::dic). ++ You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!! ++ ++finishMode: ++ It has meaning only if the decoding reaches output limit (dicLimit). ++ LZMA_FINISH_ANY - Decode just dicLimit bytes. ++ LZMA_FINISH_END - Stream must be finished after dicLimit. ++ ++Returns: ++ SZ_OK ++ status: ++ LZMA_STATUS_FINISHED_WITH_MARK ++ LZMA_STATUS_NOT_FINISHED ++ LZMA_STATUS_NEEDS_MORE_INPUT ++ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK ++ SZ_ERROR_DATA - Data error ++*/ ++ ++SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, ++ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); ++ ++ ++/* ---------- Buffer Interface ---------- */ ++ ++/* It's zlib-like interface. ++ See LzmaDec_DecodeToDic description for information about STEPS and return results, ++ but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need ++ to work with CLzmaDec variables manually. ++ ++finishMode: ++ It has meaning only if the decoding reaches output limit (*destLen). ++ LZMA_FINISH_ANY - Decode just destLen bytes. ++ LZMA_FINISH_END - Stream must be finished after (*destLen). ++*/ ++ ++SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, ++ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); ++ ++ ++/* ---------- One Call Interface ---------- */ ++ ++/* LzmaDecode ++ ++finishMode: ++ It has meaning only if the decoding reaches output limit (*destLen). ++ LZMA_FINISH_ANY - Decode just destLen bytes. ++ LZMA_FINISH_END - Stream must be finished after (*destLen). ++ ++Returns: ++ SZ_OK ++ status: ++ LZMA_STATUS_FINISHED_WITH_MARK ++ LZMA_STATUS_NOT_FINISHED ++ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK ++ SZ_ERROR_DATA - Data error ++ SZ_ERROR_MEM - Memory allocation error ++ SZ_ERROR_UNSUPPORTED - Unsupported properties ++ SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src). ++*/ ++ ++SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ++ const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, ++ ELzmaStatus *status, ISzAlloc *alloc); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +--- /dev/null ++++ b/include/linux/lzma/LzmaEnc.h +@@ -0,0 +1,80 @@ ++/* LzmaEnc.h -- LZMA Encoder ++2009-02-07 : Igor Pavlov : Public domain */ ++ ++#ifndef __LZMA_ENC_H ++#define __LZMA_ENC_H ++ ++#include "Types.h" ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#define LZMA_PROPS_SIZE 5 ++ ++typedef struct _CLzmaEncProps ++{ ++ int level; /* 0 <= level <= 9 */ ++ UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version ++ (1 << 12) <= dictSize <= (1 << 30) for 64-bit version ++ default = (1 << 24) */ ++ int lc; /* 0 <= lc <= 8, default = 3 */ ++ int lp; /* 0 <= lp <= 4, default = 0 */ ++ int pb; /* 0 <= pb <= 4, default = 2 */ ++ int algo; /* 0 - fast, 1 - normal, default = 1 */ ++ int fb; /* 5 <= fb <= 273, default = 32 */ ++ int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */ ++ int numHashBytes; /* 2, 3 or 4, default = 4 */ ++ UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */ ++ unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */ ++ int numThreads; /* 1 or 2, default = 2 */ ++} CLzmaEncProps; ++ ++void LzmaEncProps_Init(CLzmaEncProps *p); ++void LzmaEncProps_Normalize(CLzmaEncProps *p); ++UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2); ++ ++ ++/* ---------- CLzmaEncHandle Interface ---------- */ ++ ++/* LzmaEnc_* functions can return the following exit codes: ++Returns: ++ SZ_OK - OK ++ SZ_ERROR_MEM - Memory allocation error ++ SZ_ERROR_PARAM - Incorrect paramater in props ++ SZ_ERROR_WRITE - Write callback error. ++ SZ_ERROR_PROGRESS - some break from progress callback ++ SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) ++*/ ++ ++typedef void * CLzmaEncHandle; ++ ++CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc); ++void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig); ++SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props); ++SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size); ++SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream, ++ ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); ++SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, ++ int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); ++ ++/* ---------- One Call Interface ---------- */ ++ ++/* LzmaEncode ++Return code: ++ SZ_OK - OK ++ SZ_ERROR_MEM - Memory allocation error ++ SZ_ERROR_PARAM - Incorrect paramater ++ SZ_ERROR_OUTPUT_EOF - output buffer overflow ++ SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) ++*/ ++ ++SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, ++ const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, ++ ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +--- /dev/null ++++ b/include/linux/lzma/Types.h +@@ -0,0 +1,226 @@ ++/* Types.h -- Basic types ++2009-11-23 : Igor Pavlov : Public domain */ ++ ++#ifndef __7Z_TYPES_H ++#define __7Z_TYPES_H ++ ++#include ++ ++#ifdef _WIN32 ++#include ++#endif ++ ++#ifndef EXTERN_C_BEGIN ++#ifdef __cplusplus ++#define EXTERN_C_BEGIN extern "C" { ++#define EXTERN_C_END } ++#else ++#define EXTERN_C_BEGIN ++#define EXTERN_C_END ++#endif ++#endif ++ ++EXTERN_C_BEGIN ++ ++#define SZ_OK 0 ++ ++#define SZ_ERROR_DATA 1 ++#define SZ_ERROR_MEM 2 ++#define SZ_ERROR_CRC 3 ++#define SZ_ERROR_UNSUPPORTED 4 ++#define SZ_ERROR_PARAM 5 ++#define SZ_ERROR_INPUT_EOF 6 ++#define SZ_ERROR_OUTPUT_EOF 7 ++#define SZ_ERROR_READ 8 ++#define SZ_ERROR_WRITE 9 ++#define SZ_ERROR_PROGRESS 10 ++#define SZ_ERROR_FAIL 11 ++#define SZ_ERROR_THREAD 12 ++ ++#define SZ_ERROR_ARCHIVE 16 ++#define SZ_ERROR_NO_ARCHIVE 17 ++ ++typedef int SRes; ++ ++#ifdef _WIN32 ++typedef DWORD WRes; ++#else ++typedef int WRes; ++#endif ++ ++#ifndef RINOK ++#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; } ++#endif ++ ++typedef unsigned char Byte; ++typedef short Int16; ++typedef unsigned short UInt16; ++ ++#ifdef _LZMA_UINT32_IS_ULONG ++typedef long Int32; ++typedef unsigned long UInt32; ++#else ++typedef int Int32; ++typedef unsigned int UInt32; ++#endif ++ ++#ifdef _SZ_NO_INT_64 ++ ++/* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers. ++ NOTES: Some code will work incorrectly in that case! */ ++ ++typedef long Int64; ++typedef unsigned long UInt64; ++ ++#else ++ ++#if defined(_MSC_VER) || defined(__BORLANDC__) ++typedef __int64 Int64; ++typedef unsigned __int64 UInt64; ++#else ++typedef long long int Int64; ++typedef unsigned long long int UInt64; ++#endif ++ ++#endif ++ ++#ifdef _LZMA_NO_SYSTEM_SIZE_T ++typedef UInt32 SizeT; ++#else ++typedef size_t SizeT; ++#endif ++ ++typedef int Bool; ++#define True 1 ++#define False 0 ++ ++ ++#ifdef _WIN32 ++#define MY_STD_CALL __stdcall ++#else ++#define MY_STD_CALL ++#endif ++ ++#ifdef _MSC_VER ++ ++#if _MSC_VER >= 1300 ++#define MY_NO_INLINE __declspec(noinline) ++#else ++#define MY_NO_INLINE ++#endif ++ ++#define MY_CDECL __cdecl ++#define MY_FAST_CALL __fastcall ++ ++#else ++ ++#define MY_CDECL ++#define MY_FAST_CALL ++ ++#endif ++ ++ ++/* The following interfaces use first parameter as pointer to structure */ ++ ++typedef struct ++{ ++ SRes (*Read)(void *p, void *buf, size_t *size); ++ /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. ++ (output(*size) < input(*size)) is allowed */ ++} ISeqInStream; ++ ++/* it can return SZ_ERROR_INPUT_EOF */ ++SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size); ++SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType); ++SRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf); ++ ++typedef struct ++{ ++ size_t (*Write)(void *p, const void *buf, size_t size); ++ /* Returns: result - the number of actually written bytes. ++ (result < size) means error */ ++} ISeqOutStream; ++ ++typedef enum ++{ ++ SZ_SEEK_SET = 0, ++ SZ_SEEK_CUR = 1, ++ SZ_SEEK_END = 2 ++} ESzSeek; ++ ++typedef struct ++{ ++ SRes (*Read)(void *p, void *buf, size_t *size); /* same as ISeqInStream::Read */ ++ SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin); ++} ISeekInStream; ++ ++typedef struct ++{ ++ SRes (*Look)(void *p, void **buf, size_t *size); ++ /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. ++ (output(*size) > input(*size)) is not allowed ++ (output(*size) < input(*size)) is allowed */ ++ SRes (*Skip)(void *p, size_t offset); ++ /* offset must be <= output(*size) of Look */ ++ ++ SRes (*Read)(void *p, void *buf, size_t *size); ++ /* reads directly (without buffer). It's same as ISeqInStream::Read */ ++ SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin); ++} ILookInStream; ++ ++SRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size); ++SRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset); ++ ++/* reads via ILookInStream::Read */ ++SRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType); ++SRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size); ++ ++#define LookToRead_BUF_SIZE (1 << 14) ++ ++typedef struct ++{ ++ ILookInStream s; ++ ISeekInStream *realStream; ++ size_t pos; ++ size_t size; ++ Byte buf[LookToRead_BUF_SIZE]; ++} CLookToRead; ++ ++void LookToRead_CreateVTable(CLookToRead *p, int lookahead); ++void LookToRead_Init(CLookToRead *p); ++ ++typedef struct ++{ ++ ISeqInStream s; ++ ILookInStream *realStream; ++} CSecToLook; ++ ++void SecToLook_CreateVTable(CSecToLook *p); ++ ++typedef struct ++{ ++ ISeqInStream s; ++ ILookInStream *realStream; ++} CSecToRead; ++ ++void SecToRead_CreateVTable(CSecToRead *p); ++ ++typedef struct ++{ ++ SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize); ++ /* Returns: result. (result != SZ_OK) means break. ++ Value (UInt64)(Int64)-1 for size means unknown value. */ ++} ICompressProgress; ++ ++typedef struct ++{ ++ void *(*Alloc)(void *p, size_t size); ++ void (*Free)(void *p, void *address); /* address can be 0 */ ++} ISzAlloc; ++ ++#define IAlloc_Alloc(p, size) (p)->Alloc((p), size) ++#define IAlloc_Free(p, a) (p)->Free((p), a) ++ ++EXTERN_C_END ++ ++#endif +--- a/include/uapi/linux/jffs2.h ++++ b/include/uapi/linux/jffs2.h +@@ -46,6 +46,7 @@ + #define JFFS2_COMPR_DYNRUBIN 0x05 + #define JFFS2_COMPR_ZLIB 0x06 + #define JFFS2_COMPR_LZO 0x07 ++#define JFFS2_COMPR_LZMA 0x08 + /* Compatibility flags. */ + #define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */ + #define JFFS2_NODE_ACCURATE 0x2000 +--- a/lib/Kconfig ++++ b/lib/Kconfig +@@ -259,6 +259,12 @@ config ZSTD_DECOMPRESS + + source "lib/xz/Kconfig" + ++config LZMA_COMPRESS ++ tristate ++ ++config LZMA_DECOMPRESS ++ tristate ++ + # + # These all provide a common interface (hence the apparent duplication with + # ZLIB_INFLATE; DECOMPRESS_GZIP is just a wrapper.) +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -3,6 +3,16 @@ + # Makefile for some libs needed in the kernel. + # + ++ifdef CONFIG_JFFS2_ZLIB ++ CONFIG_ZLIB_INFLATE:=y ++ CONFIG_ZLIB_DEFLATE:=y ++endif ++ ++ifdef CONFIG_JFFS2_LZMA ++ CONFIG_LZMA_DECOMPRESS:=y ++ CONFIG_LZMA_COMPRESS:=y ++endif ++ + ifdef CONFIG_FUNCTION_TRACER + ORIG_CFLAGS := $(KBUILD_CFLAGS) + KBUILD_CFLAGS = $(subst $(CC_FLAGS_FTRACE),,$(ORIG_CFLAGS)) +@@ -122,6 +132,8 @@ obj-$(CONFIG_ZSTD_COMPRESS) += zstd/ + obj-$(CONFIG_ZSTD_DECOMPRESS) += zstd/ + obj-$(CONFIG_XZ_DEC) += xz/ + obj-$(CONFIG_RAID6_PQ) += raid6/ ++obj-$(CONFIG_LZMA_COMPRESS) += lzma/ ++obj-$(CONFIG_LZMA_DECOMPRESS) += lzma/ + + lib-$(CONFIG_DECOMPRESS_GZIP) += decompress_inflate.o + lib-$(CONFIG_DECOMPRESS_BZIP2) += decompress_bunzip2.o +--- /dev/null ++++ b/lib/lzma/LzFind.c +@@ -0,0 +1,761 @@ ++/* LzFind.c -- Match finder for LZ algorithms ++2009-04-22 : Igor Pavlov : Public domain */ ++ ++#include ++ ++#include "LzFind.h" ++#include "LzHash.h" ++ ++#define kEmptyHashValue 0 ++#define kMaxValForNormalize ((UInt32)0xFFFFFFFF) ++#define kNormalizeStepMin (1 << 10) /* it must be power of 2 */ ++#define kNormalizeMask (~(kNormalizeStepMin - 1)) ++#define kMaxHistorySize ((UInt32)3 << 30) ++ ++#define kStartMaxLen 3 ++ ++static void LzInWindow_Free(CMatchFinder *p, ISzAlloc *alloc) ++{ ++ if (!p->directInput) ++ { ++ alloc->Free(alloc, p->bufferBase); ++ p->bufferBase = 0; ++ } ++} ++ ++/* keepSizeBefore + keepSizeAfter + keepSizeReserv must be < 4G) */ ++ ++static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAlloc *alloc) ++{ ++ UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv; ++ if (p->directInput) ++ { ++ p->blockSize = blockSize; ++ return 1; ++ } ++ if (p->bufferBase == 0 || p->blockSize != blockSize) ++ { ++ LzInWindow_Free(p, alloc); ++ p->blockSize = blockSize; ++ p->bufferBase = (Byte *)alloc->Alloc(alloc, (size_t)blockSize); ++ } ++ return (p->bufferBase != 0); ++} ++ ++Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; } ++Byte MatchFinder_GetIndexByte(CMatchFinder *p, Int32 index) { return p->buffer[index]; } ++ ++UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; } ++ ++void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue) ++{ ++ p->posLimit -= subValue; ++ p->pos -= subValue; ++ p->streamPos -= subValue; ++} ++ ++static void MatchFinder_ReadBlock(CMatchFinder *p) ++{ ++ if (p->streamEndWasReached || p->result != SZ_OK) ++ return; ++ if (p->directInput) ++ { ++ UInt32 curSize = 0xFFFFFFFF - p->streamPos; ++ if (curSize > p->directInputRem) ++ curSize = (UInt32)p->directInputRem; ++ p->directInputRem -= curSize; ++ p->streamPos += curSize; ++ if (p->directInputRem == 0) ++ p->streamEndWasReached = 1; ++ return; ++ } ++ for (;;) ++ { ++ Byte *dest = p->buffer + (p->streamPos - p->pos); ++ size_t size = (p->bufferBase + p->blockSize - dest); ++ if (size == 0) ++ return; ++ p->result = p->stream->Read(p->stream, dest, &size); ++ if (p->result != SZ_OK) ++ return; ++ if (size == 0) ++ { ++ p->streamEndWasReached = 1; ++ return; ++ } ++ p->streamPos += (UInt32)size; ++ if (p->streamPos - p->pos > p->keepSizeAfter) ++ return; ++ } ++} ++ ++void MatchFinder_MoveBlock(CMatchFinder *p) ++{ ++ memmove(p->bufferBase, ++ p->buffer - p->keepSizeBefore, ++ (size_t)(p->streamPos - p->pos + p->keepSizeBefore)); ++ p->buffer = p->bufferBase + p->keepSizeBefore; ++} ++ ++int MatchFinder_NeedMove(CMatchFinder *p) ++{ ++ if (p->directInput) ++ return 0; ++ /* if (p->streamEndWasReached) return 0; */ ++ return ((size_t)(p->bufferBase + p->blockSize - p->buffer) <= p->keepSizeAfter); ++} ++ ++void MatchFinder_ReadIfRequired(CMatchFinder *p) ++{ ++ if (p->streamEndWasReached) ++ return; ++ if (p->keepSizeAfter >= p->streamPos - p->pos) ++ MatchFinder_ReadBlock(p); ++} ++ ++static void MatchFinder_CheckAndMoveAndRead(CMatchFinder *p) ++{ ++ if (MatchFinder_NeedMove(p)) ++ MatchFinder_MoveBlock(p); ++ MatchFinder_ReadBlock(p); ++} ++ ++static void MatchFinder_SetDefaultSettings(CMatchFinder *p) ++{ ++ p->cutValue = 32; ++ p->btMode = 1; ++ p->numHashBytes = 4; ++ p->bigHash = 0; ++} ++ ++#define kCrcPoly 0xEDB88320 ++ ++void MatchFinder_Construct(CMatchFinder *p) ++{ ++ UInt32 i; ++ p->bufferBase = 0; ++ p->directInput = 0; ++ p->hash = 0; ++ MatchFinder_SetDefaultSettings(p); ++ ++ for (i = 0; i < 256; i++) ++ { ++ UInt32 r = i; ++ int j; ++ for (j = 0; j < 8; j++) ++ r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1)); ++ p->crc[i] = r; ++ } ++} ++ ++static void MatchFinder_FreeThisClassMemory(CMatchFinder *p, ISzAlloc *alloc) ++{ ++ alloc->Free(alloc, p->hash); ++ p->hash = 0; ++} ++ ++void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc) ++{ ++ MatchFinder_FreeThisClassMemory(p, alloc); ++ LzInWindow_Free(p, alloc); ++} ++ ++static CLzRef* AllocRefs(UInt32 num, ISzAlloc *alloc) ++{ ++ size_t sizeInBytes = (size_t)num * sizeof(CLzRef); ++ if (sizeInBytes / sizeof(CLzRef) != num) ++ return 0; ++ return (CLzRef *)alloc->Alloc(alloc, sizeInBytes); ++} ++ ++int MatchFinder_Create(CMatchFinder *p, UInt32 historySize, ++ UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ++ ISzAlloc *alloc) ++{ ++ UInt32 sizeReserv; ++ if (historySize > kMaxHistorySize) ++ { ++ MatchFinder_Free(p, alloc); ++ return 0; ++ } ++ sizeReserv = historySize >> 1; ++ if (historySize > ((UInt32)2 << 30)) ++ sizeReserv = historySize >> 2; ++ sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19); ++ ++ p->keepSizeBefore = historySize + keepAddBufferBefore + 1; ++ p->keepSizeAfter = matchMaxLen + keepAddBufferAfter; ++ /* we need one additional byte, since we use MoveBlock after pos++ and before dictionary using */ ++ if (LzInWindow_Create(p, sizeReserv, alloc)) ++ { ++ UInt32 newCyclicBufferSize = historySize + 1; ++ UInt32 hs; ++ p->matchMaxLen = matchMaxLen; ++ { ++ p->fixedHashSize = 0; ++ if (p->numHashBytes == 2) ++ hs = (1 << 16) - 1; ++ else ++ { ++ hs = historySize - 1; ++ hs |= (hs >> 1); ++ hs |= (hs >> 2); ++ hs |= (hs >> 4); ++ hs |= (hs >> 8); ++ hs >>= 1; ++ hs |= 0xFFFF; /* don't change it! It's required for Deflate */ ++ if (hs > (1 << 24)) ++ { ++ if (p->numHashBytes == 3) ++ hs = (1 << 24) - 1; ++ else ++ hs >>= 1; ++ } ++ } ++ p->hashMask = hs; ++ hs++; ++ if (p->numHashBytes > 2) p->fixedHashSize += kHash2Size; ++ if (p->numHashBytes > 3) p->fixedHashSize += kHash3Size; ++ if (p->numHashBytes > 4) p->fixedHashSize += kHash4Size; ++ hs += p->fixedHashSize; ++ } ++ ++ { ++ UInt32 prevSize = p->hashSizeSum + p->numSons; ++ UInt32 newSize; ++ p->historySize = historySize; ++ p->hashSizeSum = hs; ++ p->cyclicBufferSize = newCyclicBufferSize; ++ p->numSons = (p->btMode ? newCyclicBufferSize * 2 : newCyclicBufferSize); ++ newSize = p->hashSizeSum + p->numSons; ++ if (p->hash != 0 && prevSize == newSize) ++ return 1; ++ MatchFinder_FreeThisClassMemory(p, alloc); ++ p->hash = AllocRefs(newSize, alloc); ++ if (p->hash != 0) ++ { ++ p->son = p->hash + p->hashSizeSum; ++ return 1; ++ } ++ } ++ } ++ MatchFinder_Free(p, alloc); ++ return 0; ++} ++ ++static void MatchFinder_SetLimits(CMatchFinder *p) ++{ ++ UInt32 limit = kMaxValForNormalize - p->pos; ++ UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos; ++ if (limit2 < limit) ++ limit = limit2; ++ limit2 = p->streamPos - p->pos; ++ if (limit2 <= p->keepSizeAfter) ++ { ++ if (limit2 > 0) ++ limit2 = 1; ++ } ++ else ++ limit2 -= p->keepSizeAfter; ++ if (limit2 < limit) ++ limit = limit2; ++ { ++ UInt32 lenLimit = p->streamPos - p->pos; ++ if (lenLimit > p->matchMaxLen) ++ lenLimit = p->matchMaxLen; ++ p->lenLimit = lenLimit; ++ } ++ p->posLimit = p->pos + limit; ++} ++ ++void MatchFinder_Init(CMatchFinder *p) ++{ ++ UInt32 i; ++ for (i = 0; i < p->hashSizeSum; i++) ++ p->hash[i] = kEmptyHashValue; ++ p->cyclicBufferPos = 0; ++ p->buffer = p->bufferBase; ++ p->pos = p->streamPos = p->cyclicBufferSize; ++ p->result = SZ_OK; ++ p->streamEndWasReached = 0; ++ MatchFinder_ReadBlock(p); ++ MatchFinder_SetLimits(p); ++} ++ ++static UInt32 MatchFinder_GetSubValue(CMatchFinder *p) ++{ ++ return (p->pos - p->historySize - 1) & kNormalizeMask; ++} ++ ++void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems) ++{ ++ UInt32 i; ++ for (i = 0; i < numItems; i++) ++ { ++ UInt32 value = items[i]; ++ if (value <= subValue) ++ value = kEmptyHashValue; ++ else ++ value -= subValue; ++ items[i] = value; ++ } ++} ++ ++static void MatchFinder_Normalize(CMatchFinder *p) ++{ ++ UInt32 subValue = MatchFinder_GetSubValue(p); ++ MatchFinder_Normalize3(subValue, p->hash, p->hashSizeSum + p->numSons); ++ MatchFinder_ReduceOffsets(p, subValue); ++} ++ ++static void MatchFinder_CheckLimits(CMatchFinder *p) ++{ ++ if (p->pos == kMaxValForNormalize) ++ MatchFinder_Normalize(p); ++ if (!p->streamEndWasReached && p->keepSizeAfter == p->streamPos - p->pos) ++ MatchFinder_CheckAndMoveAndRead(p); ++ if (p->cyclicBufferPos == p->cyclicBufferSize) ++ p->cyclicBufferPos = 0; ++ MatchFinder_SetLimits(p); ++} ++ ++static UInt32 * Hc_GetMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, ++ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, ++ UInt32 *distances, UInt32 maxLen) ++{ ++ son[_cyclicBufferPos] = curMatch; ++ for (;;) ++ { ++ UInt32 delta = pos - curMatch; ++ if (cutValue-- == 0 || delta >= _cyclicBufferSize) ++ return distances; ++ { ++ const Byte *pb = cur - delta; ++ curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)]; ++ if (pb[maxLen] == cur[maxLen] && *pb == *cur) ++ { ++ UInt32 len = 0; ++ while (++len != lenLimit) ++ if (pb[len] != cur[len]) ++ break; ++ if (maxLen < len) ++ { ++ *distances++ = maxLen = len; ++ *distances++ = delta - 1; ++ if (len == lenLimit) ++ return distances; ++ } ++ } ++ } ++ } ++} ++ ++UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, ++ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, ++ UInt32 *distances, UInt32 maxLen) ++{ ++ CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1; ++ CLzRef *ptr1 = son + (_cyclicBufferPos << 1); ++ UInt32 len0 = 0, len1 = 0; ++ for (;;) ++ { ++ UInt32 delta = pos - curMatch; ++ if (cutValue-- == 0 || delta >= _cyclicBufferSize) ++ { ++ *ptr0 = *ptr1 = kEmptyHashValue; ++ return distances; ++ } ++ { ++ CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); ++ const Byte *pb = cur - delta; ++ UInt32 len = (len0 < len1 ? len0 : len1); ++ if (pb[len] == cur[len]) ++ { ++ if (++len != lenLimit && pb[len] == cur[len]) ++ while (++len != lenLimit) ++ if (pb[len] != cur[len]) ++ break; ++ if (maxLen < len) ++ { ++ *distances++ = maxLen = len; ++ *distances++ = delta - 1; ++ if (len == lenLimit) ++ { ++ *ptr1 = pair[0]; ++ *ptr0 = pair[1]; ++ return distances; ++ } ++ } ++ } ++ if (pb[len] < cur[len]) ++ { ++ *ptr1 = curMatch; ++ ptr1 = pair + 1; ++ curMatch = *ptr1; ++ len1 = len; ++ } ++ else ++ { ++ *ptr0 = curMatch; ++ ptr0 = pair; ++ curMatch = *ptr0; ++ len0 = len; ++ } ++ } ++ } ++} ++ ++static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, ++ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue) ++{ ++ CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1; ++ CLzRef *ptr1 = son + (_cyclicBufferPos << 1); ++ UInt32 len0 = 0, len1 = 0; ++ for (;;) ++ { ++ UInt32 delta = pos - curMatch; ++ if (cutValue-- == 0 || delta >= _cyclicBufferSize) ++ { ++ *ptr0 = *ptr1 = kEmptyHashValue; ++ return; ++ } ++ { ++ CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); ++ const Byte *pb = cur - delta; ++ UInt32 len = (len0 < len1 ? len0 : len1); ++ if (pb[len] == cur[len]) ++ { ++ while (++len != lenLimit) ++ if (pb[len] != cur[len]) ++ break; ++ { ++ if (len == lenLimit) ++ { ++ *ptr1 = pair[0]; ++ *ptr0 = pair[1]; ++ return; ++ } ++ } ++ } ++ if (pb[len] < cur[len]) ++ { ++ *ptr1 = curMatch; ++ ptr1 = pair + 1; ++ curMatch = *ptr1; ++ len1 = len; ++ } ++ else ++ { ++ *ptr0 = curMatch; ++ ptr0 = pair; ++ curMatch = *ptr0; ++ len0 = len; ++ } ++ } ++ } ++} ++ ++#define MOVE_POS \ ++ ++p->cyclicBufferPos; \ ++ p->buffer++; \ ++ if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p); ++ ++#define MOVE_POS_RET MOVE_POS return offset; ++ ++static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; } ++ ++#define GET_MATCHES_HEADER2(minLen, ret_op) \ ++ UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; \ ++ lenLimit = p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \ ++ cur = p->buffer; ++ ++#define GET_MATCHES_HEADER(minLen) GET_MATCHES_HEADER2(minLen, return 0) ++#define SKIP_HEADER(minLen) GET_MATCHES_HEADER2(minLen, continue) ++ ++#define MF_PARAMS(p) p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue ++ ++#define GET_MATCHES_FOOTER(offset, maxLen) \ ++ offset = (UInt32)(GetMatchesSpec1(lenLimit, curMatch, MF_PARAMS(p), \ ++ distances + offset, maxLen) - distances); MOVE_POS_RET; ++ ++#define SKIP_FOOTER \ ++ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS; ++ ++static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) ++{ ++ UInt32 offset; ++ GET_MATCHES_HEADER(2) ++ HASH2_CALC; ++ curMatch = p->hash[hashValue]; ++ p->hash[hashValue] = p->pos; ++ offset = 0; ++ GET_MATCHES_FOOTER(offset, 1) ++} ++ ++UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) ++{ ++ UInt32 offset; ++ GET_MATCHES_HEADER(3) ++ HASH_ZIP_CALC; ++ curMatch = p->hash[hashValue]; ++ p->hash[hashValue] = p->pos; ++ offset = 0; ++ GET_MATCHES_FOOTER(offset, 2) ++} ++ ++static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) ++{ ++ UInt32 hash2Value, delta2, maxLen, offset; ++ GET_MATCHES_HEADER(3) ++ ++ HASH3_CALC; ++ ++ delta2 = p->pos - p->hash[hash2Value]; ++ curMatch = p->hash[kFix3HashSize + hashValue]; ++ ++ p->hash[hash2Value] = ++ p->hash[kFix3HashSize + hashValue] = p->pos; ++ ++ ++ maxLen = 2; ++ offset = 0; ++ if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) ++ { ++ for (; maxLen != lenLimit; maxLen++) ++ if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) ++ break; ++ distances[0] = maxLen; ++ distances[1] = delta2 - 1; ++ offset = 2; ++ if (maxLen == lenLimit) ++ { ++ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); ++ MOVE_POS_RET; ++ } ++ } ++ GET_MATCHES_FOOTER(offset, maxLen) ++} ++ ++static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) ++{ ++ UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset; ++ GET_MATCHES_HEADER(4) ++ ++ HASH4_CALC; ++ ++ delta2 = p->pos - p->hash[ hash2Value]; ++ delta3 = p->pos - p->hash[kFix3HashSize + hash3Value]; ++ curMatch = p->hash[kFix4HashSize + hashValue]; ++ ++ p->hash[ hash2Value] = ++ p->hash[kFix3HashSize + hash3Value] = ++ p->hash[kFix4HashSize + hashValue] = p->pos; ++ ++ maxLen = 1; ++ offset = 0; ++ if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) ++ { ++ distances[0] = maxLen = 2; ++ distances[1] = delta2 - 1; ++ offset = 2; ++ } ++ if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur) ++ { ++ maxLen = 3; ++ distances[offset + 1] = delta3 - 1; ++ offset += 2; ++ delta2 = delta3; ++ } ++ if (offset != 0) ++ { ++ for (; maxLen != lenLimit; maxLen++) ++ if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) ++ break; ++ distances[offset - 2] = maxLen; ++ if (maxLen == lenLimit) ++ { ++ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); ++ MOVE_POS_RET; ++ } ++ } ++ if (maxLen < 3) ++ maxLen = 3; ++ GET_MATCHES_FOOTER(offset, maxLen) ++} ++ ++static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) ++{ ++ UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset; ++ GET_MATCHES_HEADER(4) ++ ++ HASH4_CALC; ++ ++ delta2 = p->pos - p->hash[ hash2Value]; ++ delta3 = p->pos - p->hash[kFix3HashSize + hash3Value]; ++ curMatch = p->hash[kFix4HashSize + hashValue]; ++ ++ p->hash[ hash2Value] = ++ p->hash[kFix3HashSize + hash3Value] = ++ p->hash[kFix4HashSize + hashValue] = p->pos; ++ ++ maxLen = 1; ++ offset = 0; ++ if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) ++ { ++ distances[0] = maxLen = 2; ++ distances[1] = delta2 - 1; ++ offset = 2; ++ } ++ if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur) ++ { ++ maxLen = 3; ++ distances[offset + 1] = delta3 - 1; ++ offset += 2; ++ delta2 = delta3; ++ } ++ if (offset != 0) ++ { ++ for (; maxLen != lenLimit; maxLen++) ++ if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) ++ break; ++ distances[offset - 2] = maxLen; ++ if (maxLen == lenLimit) ++ { ++ p->son[p->cyclicBufferPos] = curMatch; ++ MOVE_POS_RET; ++ } ++ } ++ if (maxLen < 3) ++ maxLen = 3; ++ offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), ++ distances + offset, maxLen) - (distances)); ++ MOVE_POS_RET ++} ++ ++UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) ++{ ++ UInt32 offset; ++ GET_MATCHES_HEADER(3) ++ HASH_ZIP_CALC; ++ curMatch = p->hash[hashValue]; ++ p->hash[hashValue] = p->pos; ++ offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), ++ distances, 2) - (distances)); ++ MOVE_POS_RET ++} ++ ++static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num) ++{ ++ do ++ { ++ SKIP_HEADER(2) ++ HASH2_CALC; ++ curMatch = p->hash[hashValue]; ++ p->hash[hashValue] = p->pos; ++ SKIP_FOOTER ++ } ++ while (--num != 0); ++} ++ ++void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) ++{ ++ do ++ { ++ SKIP_HEADER(3) ++ HASH_ZIP_CALC; ++ curMatch = p->hash[hashValue]; ++ p->hash[hashValue] = p->pos; ++ SKIP_FOOTER ++ } ++ while (--num != 0); ++} ++ ++static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num) ++{ ++ do ++ { ++ UInt32 hash2Value; ++ SKIP_HEADER(3) ++ HASH3_CALC; ++ curMatch = p->hash[kFix3HashSize + hashValue]; ++ p->hash[hash2Value] = ++ p->hash[kFix3HashSize + hashValue] = p->pos; ++ SKIP_FOOTER ++ } ++ while (--num != 0); ++} ++ ++static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) ++{ ++ do ++ { ++ UInt32 hash2Value, hash3Value; ++ SKIP_HEADER(4) ++ HASH4_CALC; ++ curMatch = p->hash[kFix4HashSize + hashValue]; ++ p->hash[ hash2Value] = ++ p->hash[kFix3HashSize + hash3Value] = p->pos; ++ p->hash[kFix4HashSize + hashValue] = p->pos; ++ SKIP_FOOTER ++ } ++ while (--num != 0); ++} ++ ++static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) ++{ ++ do ++ { ++ UInt32 hash2Value, hash3Value; ++ SKIP_HEADER(4) ++ HASH4_CALC; ++ curMatch = p->hash[kFix4HashSize + hashValue]; ++ p->hash[ hash2Value] = ++ p->hash[kFix3HashSize + hash3Value] = ++ p->hash[kFix4HashSize + hashValue] = p->pos; ++ p->son[p->cyclicBufferPos] = curMatch; ++ MOVE_POS ++ } ++ while (--num != 0); ++} ++ ++void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) ++{ ++ do ++ { ++ SKIP_HEADER(3) ++ HASH_ZIP_CALC; ++ curMatch = p->hash[hashValue]; ++ p->hash[hashValue] = p->pos; ++ p->son[p->cyclicBufferPos] = curMatch; ++ MOVE_POS ++ } ++ while (--num != 0); ++} ++ ++void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable) ++{ ++ vTable->Init = (Mf_Init_Func)MatchFinder_Init; ++ vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinder_GetIndexByte; ++ vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes; ++ vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos; ++ if (!p->btMode) ++ { ++ vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches; ++ vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip; ++ } ++ else if (p->numHashBytes == 2) ++ { ++ vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches; ++ vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip; ++ } ++ else if (p->numHashBytes == 3) ++ { ++ vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches; ++ vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip; ++ } ++ else ++ { ++ vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches; ++ vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip; ++ } ++} +--- /dev/null ++++ b/lib/lzma/LzmaDec.c +@@ -0,0 +1,999 @@ ++/* LzmaDec.c -- LZMA Decoder ++2009-09-20 : Igor Pavlov : Public domain */ ++ ++#include "LzmaDec.h" ++ ++#include ++ ++#define kNumTopBits 24 ++#define kTopValue ((UInt32)1 << kNumTopBits) ++ ++#define kNumBitModelTotalBits 11 ++#define kBitModelTotal (1 << kNumBitModelTotalBits) ++#define kNumMoveBits 5 ++ ++#define RC_INIT_SIZE 5 ++ ++#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); } ++ ++#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound) ++#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); ++#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits)); ++#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \ ++ { UPDATE_0(p); i = (i + i); A0; } else \ ++ { UPDATE_1(p); i = (i + i) + 1; A1; } ++#define GET_BIT(p, i) GET_BIT2(p, i, ; , ;) ++ ++#define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); } ++#define TREE_DECODE(probs, limit, i) \ ++ { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; } ++ ++/* #define _LZMA_SIZE_OPT */ ++ ++#ifdef _LZMA_SIZE_OPT ++#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i) ++#else ++#define TREE_6_DECODE(probs, i) \ ++ { i = 1; \ ++ TREE_GET_BIT(probs, i); \ ++ TREE_GET_BIT(probs, i); \ ++ TREE_GET_BIT(probs, i); \ ++ TREE_GET_BIT(probs, i); \ ++ TREE_GET_BIT(probs, i); \ ++ TREE_GET_BIT(probs, i); \ ++ i -= 0x40; } ++#endif ++ ++#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); } ++ ++#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound) ++#define UPDATE_0_CHECK range = bound; ++#define UPDATE_1_CHECK range -= bound; code -= bound; ++#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \ ++ { UPDATE_0_CHECK; i = (i + i); A0; } else \ ++ { UPDATE_1_CHECK; i = (i + i) + 1; A1; } ++#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;) ++#define TREE_DECODE_CHECK(probs, limit, i) \ ++ { i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; } ++ ++ ++#define kNumPosBitsMax 4 ++#define kNumPosStatesMax (1 << kNumPosBitsMax) ++ ++#define kLenNumLowBits 3 ++#define kLenNumLowSymbols (1 << kLenNumLowBits) ++#define kLenNumMidBits 3 ++#define kLenNumMidSymbols (1 << kLenNumMidBits) ++#define kLenNumHighBits 8 ++#define kLenNumHighSymbols (1 << kLenNumHighBits) ++ ++#define LenChoice 0 ++#define LenChoice2 (LenChoice + 1) ++#define LenLow (LenChoice2 + 1) ++#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits)) ++#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits)) ++#define kNumLenProbs (LenHigh + kLenNumHighSymbols) ++ ++ ++#define kNumStates 12 ++#define kNumLitStates 7 ++ ++#define kStartPosModelIndex 4 ++#define kEndPosModelIndex 14 ++#define kNumFullDistances (1 << (kEndPosModelIndex >> 1)) ++ ++#define kNumPosSlotBits 6 ++#define kNumLenToPosStates 4 ++ ++#define kNumAlignBits 4 ++#define kAlignTableSize (1 << kNumAlignBits) ++ ++#define kMatchMinLen 2 ++#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols) ++ ++#define IsMatch 0 ++#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax)) ++#define IsRepG0 (IsRep + kNumStates) ++#define IsRepG1 (IsRepG0 + kNumStates) ++#define IsRepG2 (IsRepG1 + kNumStates) ++#define IsRep0Long (IsRepG2 + kNumStates) ++#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax)) ++#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits)) ++#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex) ++#define LenCoder (Align + kAlignTableSize) ++#define RepLenCoder (LenCoder + kNumLenProbs) ++#define Literal (RepLenCoder + kNumLenProbs) ++ ++#define LZMA_BASE_SIZE 1846 ++#define LZMA_LIT_SIZE 768 ++ ++#define LzmaProps_GetNumProbs(p) ((UInt32)LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((p)->lc + (p)->lp))) ++ ++#if Literal != LZMA_BASE_SIZE ++StopCompilingDueBUG ++#endif ++ ++#define LZMA_DIC_MIN (1 << 12) ++ ++/* First LZMA-symbol is always decoded. ++And it decodes new LZMA-symbols while (buf < bufLimit), but "buf" is without last normalization ++Out: ++ Result: ++ SZ_OK - OK ++ SZ_ERROR_DATA - Error ++ p->remainLen: ++ < kMatchSpecLenStart : normal remain ++ = kMatchSpecLenStart : finished ++ = kMatchSpecLenStart + 1 : Flush marker ++ = kMatchSpecLenStart + 2 : State Init Marker ++*/ ++ ++static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte *bufLimit) ++{ ++ CLzmaProb *probs = p->probs; ++ ++ unsigned state = p->state; ++ UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3]; ++ unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1; ++ unsigned lpMask = ((unsigned)1 << (p->prop.lp)) - 1; ++ unsigned lc = p->prop.lc; ++ ++ Byte *dic = p->dic; ++ SizeT dicBufSize = p->dicBufSize; ++ SizeT dicPos = p->dicPos; ++ ++ UInt32 processedPos = p->processedPos; ++ UInt32 checkDicSize = p->checkDicSize; ++ unsigned len = 0; ++ ++ const Byte *buf = p->buf; ++ UInt32 range = p->range; ++ UInt32 code = p->code; ++ ++ do ++ { ++ CLzmaProb *prob; ++ UInt32 bound; ++ unsigned ttt; ++ unsigned posState = processedPos & pbMask; ++ ++ prob = probs + IsMatch + (state << kNumPosBitsMax) + posState; ++ IF_BIT_0(prob) ++ { ++ unsigned symbol; ++ UPDATE_0(prob); ++ prob = probs + Literal; ++ if (checkDicSize != 0 || processedPos != 0) ++ prob += (LZMA_LIT_SIZE * (((processedPos & lpMask) << lc) + ++ (dic[(dicPos == 0 ? dicBufSize : dicPos) - 1] >> (8 - lc)))); ++ ++ if (state < kNumLitStates) ++ { ++ state -= (state < 4) ? state : 3; ++ symbol = 1; ++ do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100); ++ } ++ else ++ { ++ unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; ++ unsigned offs = 0x100; ++ state -= (state < 10) ? 3 : 6; ++ symbol = 1; ++ do ++ { ++ unsigned bit; ++ CLzmaProb *probLit; ++ matchByte <<= 1; ++ bit = (matchByte & offs); ++ probLit = prob + offs + bit + symbol; ++ GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit) ++ } ++ while (symbol < 0x100); ++ } ++ dic[dicPos++] = (Byte)symbol; ++ processedPos++; ++ continue; ++ } ++ else ++ { ++ UPDATE_1(prob); ++ prob = probs + IsRep + state; ++ IF_BIT_0(prob) ++ { ++ UPDATE_0(prob); ++ state += kNumStates; ++ prob = probs + LenCoder; ++ } ++ else ++ { ++ UPDATE_1(prob); ++ if (checkDicSize == 0 && processedPos == 0) ++ return SZ_ERROR_DATA; ++ prob = probs + IsRepG0 + state; ++ IF_BIT_0(prob) ++ { ++ UPDATE_0(prob); ++ prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState; ++ IF_BIT_0(prob) ++ { ++ UPDATE_0(prob); ++ dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; ++ dicPos++; ++ processedPos++; ++ state = state < kNumLitStates ? 9 : 11; ++ continue; ++ } ++ UPDATE_1(prob); ++ } ++ else ++ { ++ UInt32 distance; ++ UPDATE_1(prob); ++ prob = probs + IsRepG1 + state; ++ IF_BIT_0(prob) ++ { ++ UPDATE_0(prob); ++ distance = rep1; ++ } ++ else ++ { ++ UPDATE_1(prob); ++ prob = probs + IsRepG2 + state; ++ IF_BIT_0(prob) ++ { ++ UPDATE_0(prob); ++ distance = rep2; ++ } ++ else ++ { ++ UPDATE_1(prob); ++ distance = rep3; ++ rep3 = rep2; ++ } ++ rep2 = rep1; ++ } ++ rep1 = rep0; ++ rep0 = distance; ++ } ++ state = state < kNumLitStates ? 8 : 11; ++ prob = probs + RepLenCoder; ++ } ++ { ++ unsigned limit, offset; ++ CLzmaProb *probLen = prob + LenChoice; ++ IF_BIT_0(probLen) ++ { ++ UPDATE_0(probLen); ++ probLen = prob + LenLow + (posState << kLenNumLowBits); ++ offset = 0; ++ limit = (1 << kLenNumLowBits); ++ } ++ else ++ { ++ UPDATE_1(probLen); ++ probLen = prob + LenChoice2; ++ IF_BIT_0(probLen) ++ { ++ UPDATE_0(probLen); ++ probLen = prob + LenMid + (posState << kLenNumMidBits); ++ offset = kLenNumLowSymbols; ++ limit = (1 << kLenNumMidBits); ++ } ++ else ++ { ++ UPDATE_1(probLen); ++ probLen = prob + LenHigh; ++ offset = kLenNumLowSymbols + kLenNumMidSymbols; ++ limit = (1 << kLenNumHighBits); ++ } ++ } ++ TREE_DECODE(probLen, limit, len); ++ len += offset; ++ } ++ ++ if (state >= kNumStates) ++ { ++ UInt32 distance; ++ prob = probs + PosSlot + ++ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits); ++ TREE_6_DECODE(prob, distance); ++ if (distance >= kStartPosModelIndex) ++ { ++ unsigned posSlot = (unsigned)distance; ++ int numDirectBits = (int)(((distance >> 1) - 1)); ++ distance = (2 | (distance & 1)); ++ if (posSlot < kEndPosModelIndex) ++ { ++ distance <<= numDirectBits; ++ prob = probs + SpecPos + distance - posSlot - 1; ++ { ++ UInt32 mask = 1; ++ unsigned i = 1; ++ do ++ { ++ GET_BIT2(prob + i, i, ; , distance |= mask); ++ mask <<= 1; ++ } ++ while (--numDirectBits != 0); ++ } ++ } ++ else ++ { ++ numDirectBits -= kNumAlignBits; ++ do ++ { ++ NORMALIZE ++ range >>= 1; ++ ++ { ++ UInt32 t; ++ code -= range; ++ t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */ ++ distance = (distance << 1) + (t + 1); ++ code += range & t; ++ } ++ /* ++ distance <<= 1; ++ if (code >= range) ++ { ++ code -= range; ++ distance |= 1; ++ } ++ */ ++ } ++ while (--numDirectBits != 0); ++ prob = probs + Align; ++ distance <<= kNumAlignBits; ++ { ++ unsigned i = 1; ++ GET_BIT2(prob + i, i, ; , distance |= 1); ++ GET_BIT2(prob + i, i, ; , distance |= 2); ++ GET_BIT2(prob + i, i, ; , distance |= 4); ++ GET_BIT2(prob + i, i, ; , distance |= 8); ++ } ++ if (distance == (UInt32)0xFFFFFFFF) ++ { ++ len += kMatchSpecLenStart; ++ state -= kNumStates; ++ break; ++ } ++ } ++ } ++ rep3 = rep2; ++ rep2 = rep1; ++ rep1 = rep0; ++ rep0 = distance + 1; ++ if (checkDicSize == 0) ++ { ++ if (distance >= processedPos) ++ return SZ_ERROR_DATA; ++ } ++ else if (distance >= checkDicSize) ++ return SZ_ERROR_DATA; ++ state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3; ++ } ++ ++ len += kMatchMinLen; ++ ++ if (limit == dicPos) ++ return SZ_ERROR_DATA; ++ { ++ SizeT rem = limit - dicPos; ++ unsigned curLen = ((rem < len) ? (unsigned)rem : len); ++ SizeT pos = (dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0); ++ ++ processedPos += curLen; ++ ++ len -= curLen; ++ if (pos + curLen <= dicBufSize) ++ { ++ Byte *dest = dic + dicPos; ++ ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos; ++ const Byte *lim = dest + curLen; ++ dicPos += curLen; ++ do ++ *(dest) = (Byte)*(dest + src); ++ while (++dest != lim); ++ } ++ else ++ { ++ do ++ { ++ dic[dicPos++] = dic[pos]; ++ if (++pos == dicBufSize) ++ pos = 0; ++ } ++ while (--curLen != 0); ++ } ++ } ++ } ++ } ++ while (dicPos < limit && buf < bufLimit); ++ NORMALIZE; ++ p->buf = buf; ++ p->range = range; ++ p->code = code; ++ p->remainLen = len; ++ p->dicPos = dicPos; ++ p->processedPos = processedPos; ++ p->reps[0] = rep0; ++ p->reps[1] = rep1; ++ p->reps[2] = rep2; ++ p->reps[3] = rep3; ++ p->state = state; ++ ++ return SZ_OK; ++} ++ ++static void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit) ++{ ++ if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart) ++ { ++ Byte *dic = p->dic; ++ SizeT dicPos = p->dicPos; ++ SizeT dicBufSize = p->dicBufSize; ++ unsigned len = p->remainLen; ++ UInt32 rep0 = p->reps[0]; ++ if (limit - dicPos < len) ++ len = (unsigned)(limit - dicPos); ++ ++ if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len) ++ p->checkDicSize = p->prop.dicSize; ++ ++ p->processedPos += len; ++ p->remainLen -= len; ++ while (len-- != 0) ++ { ++ dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; ++ dicPos++; ++ } ++ p->dicPos = dicPos; ++ } ++} ++ ++static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte *bufLimit) ++{ ++ do ++ { ++ SizeT limit2 = limit; ++ if (p->checkDicSize == 0) ++ { ++ UInt32 rem = p->prop.dicSize - p->processedPos; ++ if (limit - p->dicPos > rem) ++ limit2 = p->dicPos + rem; ++ } ++ RINOK(LzmaDec_DecodeReal(p, limit2, bufLimit)); ++ if (p->processedPos >= p->prop.dicSize) ++ p->checkDicSize = p->prop.dicSize; ++ LzmaDec_WriteRem(p, limit); ++ } ++ while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart); ++ ++ if (p->remainLen > kMatchSpecLenStart) ++ { ++ p->remainLen = kMatchSpecLenStart; ++ } ++ return 0; ++} ++ ++typedef enum ++{ ++ DUMMY_ERROR, /* unexpected end of input stream */ ++ DUMMY_LIT, ++ DUMMY_MATCH, ++ DUMMY_REP ++} ELzmaDummy; ++ ++static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize) ++{ ++ UInt32 range = p->range; ++ UInt32 code = p->code; ++ const Byte *bufLimit = buf + inSize; ++ CLzmaProb *probs = p->probs; ++ unsigned state = p->state; ++ ELzmaDummy res; ++ ++ { ++ CLzmaProb *prob; ++ UInt32 bound; ++ unsigned ttt; ++ unsigned posState = (p->processedPos) & ((1 << p->prop.pb) - 1); ++ ++ prob = probs + IsMatch + (state << kNumPosBitsMax) + posState; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK ++ ++ /* if (bufLimit - buf >= 7) return DUMMY_LIT; */ ++ ++ prob = probs + Literal; ++ if (p->checkDicSize != 0 || p->processedPos != 0) ++ prob += (LZMA_LIT_SIZE * ++ ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) + ++ (p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc)))); ++ ++ if (state < kNumLitStates) ++ { ++ unsigned symbol = 1; ++ do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100); ++ } ++ else ++ { ++ unsigned matchByte = p->dic[p->dicPos - p->reps[0] + ++ ((p->dicPos < p->reps[0]) ? p->dicBufSize : 0)]; ++ unsigned offs = 0x100; ++ unsigned symbol = 1; ++ do ++ { ++ unsigned bit; ++ CLzmaProb *probLit; ++ matchByte <<= 1; ++ bit = (matchByte & offs); ++ probLit = prob + offs + bit + symbol; ++ GET_BIT2_CHECK(probLit, symbol, offs &= ~bit, offs &= bit) ++ } ++ while (symbol < 0x100); ++ } ++ res = DUMMY_LIT; ++ } ++ else ++ { ++ unsigned len; ++ UPDATE_1_CHECK; ++ ++ prob = probs + IsRep + state; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK; ++ state = 0; ++ prob = probs + LenCoder; ++ res = DUMMY_MATCH; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ res = DUMMY_REP; ++ prob = probs + IsRepG0 + state; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK; ++ prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK; ++ NORMALIZE_CHECK; ++ return DUMMY_REP; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ } ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ prob = probs + IsRepG1 + state; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ prob = probs + IsRepG2 + state; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ } ++ } ++ } ++ state = kNumStates; ++ prob = probs + RepLenCoder; ++ } ++ { ++ unsigned limit, offset; ++ CLzmaProb *probLen = prob + LenChoice; ++ IF_BIT_0_CHECK(probLen) ++ { ++ UPDATE_0_CHECK; ++ probLen = prob + LenLow + (posState << kLenNumLowBits); ++ offset = 0; ++ limit = 1 << kLenNumLowBits; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ probLen = prob + LenChoice2; ++ IF_BIT_0_CHECK(probLen) ++ { ++ UPDATE_0_CHECK; ++ probLen = prob + LenMid + (posState << kLenNumMidBits); ++ offset = kLenNumLowSymbols; ++ limit = 1 << kLenNumMidBits; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ probLen = prob + LenHigh; ++ offset = kLenNumLowSymbols + kLenNumMidSymbols; ++ limit = 1 << kLenNumHighBits; ++ } ++ } ++ TREE_DECODE_CHECK(probLen, limit, len); ++ len += offset; ++ } ++ ++ if (state < 4) ++ { ++ unsigned posSlot; ++ prob = probs + PosSlot + ++ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << ++ kNumPosSlotBits); ++ TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot); ++ if (posSlot >= kStartPosModelIndex) ++ { ++ int numDirectBits = ((posSlot >> 1) - 1); ++ ++ /* if (bufLimit - buf >= 8) return DUMMY_MATCH; */ ++ ++ if (posSlot < kEndPosModelIndex) ++ { ++ prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits) - posSlot - 1; ++ } ++ else ++ { ++ numDirectBits -= kNumAlignBits; ++ do ++ { ++ NORMALIZE_CHECK ++ range >>= 1; ++ code -= range & (((code - range) >> 31) - 1); ++ /* if (code >= range) code -= range; */ ++ } ++ while (--numDirectBits != 0); ++ prob = probs + Align; ++ numDirectBits = kNumAlignBits; ++ } ++ { ++ unsigned i = 1; ++ do ++ { ++ GET_BIT_CHECK(prob + i, i); ++ } ++ while (--numDirectBits != 0); ++ } ++ } ++ } ++ } ++ } ++ NORMALIZE_CHECK; ++ return res; ++} ++ ++ ++static void LzmaDec_InitRc(CLzmaDec *p, const Byte *data) ++{ ++ p->code = ((UInt32)data[1] << 24) | ((UInt32)data[2] << 16) | ((UInt32)data[3] << 8) | ((UInt32)data[4]); ++ p->range = 0xFFFFFFFF; ++ p->needFlush = 0; ++} ++ ++void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState) ++{ ++ p->needFlush = 1; ++ p->remainLen = 0; ++ p->tempBufSize = 0; ++ ++ if (initDic) ++ { ++ p->processedPos = 0; ++ p->checkDicSize = 0; ++ p->needInitState = 1; ++ } ++ if (initState) ++ p->needInitState = 1; ++} ++ ++void LzmaDec_Init(CLzmaDec *p) ++{ ++ p->dicPos = 0; ++ LzmaDec_InitDicAndState(p, True, True); ++} ++ ++static void LzmaDec_InitStateReal(CLzmaDec *p) ++{ ++ UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (p->prop.lc + p->prop.lp)); ++ UInt32 i; ++ CLzmaProb *probs = p->probs; ++ for (i = 0; i < numProbs; i++) ++ probs[i] = kBitModelTotal >> 1; ++ p->reps[0] = p->reps[1] = p->reps[2] = p->reps[3] = 1; ++ p->state = 0; ++ p->needInitState = 0; ++} ++ ++SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen, ++ ELzmaFinishMode finishMode, ELzmaStatus *status) ++{ ++ SizeT inSize = *srcLen; ++ (*srcLen) = 0; ++ LzmaDec_WriteRem(p, dicLimit); ++ ++ *status = LZMA_STATUS_NOT_SPECIFIED; ++ ++ while (p->remainLen != kMatchSpecLenStart) ++ { ++ int checkEndMarkNow; ++ ++ if (p->needFlush != 0) ++ { ++ for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--) ++ p->tempBuf[p->tempBufSize++] = *src++; ++ if (p->tempBufSize < RC_INIT_SIZE) ++ { ++ *status = LZMA_STATUS_NEEDS_MORE_INPUT; ++ return SZ_OK; ++ } ++ if (p->tempBuf[0] != 0) ++ return SZ_ERROR_DATA; ++ ++ LzmaDec_InitRc(p, p->tempBuf); ++ p->tempBufSize = 0; ++ } ++ ++ checkEndMarkNow = 0; ++ if (p->dicPos >= dicLimit) ++ { ++ if (p->remainLen == 0 && p->code == 0) ++ { ++ *status = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK; ++ return SZ_OK; ++ } ++ if (finishMode == LZMA_FINISH_ANY) ++ { ++ *status = LZMA_STATUS_NOT_FINISHED; ++ return SZ_OK; ++ } ++ if (p->remainLen != 0) ++ { ++ *status = LZMA_STATUS_NOT_FINISHED; ++ return SZ_ERROR_DATA; ++ } ++ checkEndMarkNow = 1; ++ } ++ ++ if (p->needInitState) ++ LzmaDec_InitStateReal(p); ++ ++ if (p->tempBufSize == 0) ++ { ++ SizeT processed; ++ const Byte *bufLimit; ++ if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) ++ { ++ int dummyRes = LzmaDec_TryDummy(p, src, inSize); ++ if (dummyRes == DUMMY_ERROR) ++ { ++ memcpy(p->tempBuf, src, inSize); ++ p->tempBufSize = (unsigned)inSize; ++ (*srcLen) += inSize; ++ *status = LZMA_STATUS_NEEDS_MORE_INPUT; ++ return SZ_OK; ++ } ++ if (checkEndMarkNow && dummyRes != DUMMY_MATCH) ++ { ++ *status = LZMA_STATUS_NOT_FINISHED; ++ return SZ_ERROR_DATA; ++ } ++ bufLimit = src; ++ } ++ else ++ bufLimit = src + inSize - LZMA_REQUIRED_INPUT_MAX; ++ p->buf = src; ++ if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0) ++ return SZ_ERROR_DATA; ++ processed = (SizeT)(p->buf - src); ++ (*srcLen) += processed; ++ src += processed; ++ inSize -= processed; ++ } ++ else ++ { ++ unsigned rem = p->tempBufSize, lookAhead = 0; ++ while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize) ++ p->tempBuf[rem++] = src[lookAhead++]; ++ p->tempBufSize = rem; ++ if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) ++ { ++ int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, rem); ++ if (dummyRes == DUMMY_ERROR) ++ { ++ (*srcLen) += lookAhead; ++ *status = LZMA_STATUS_NEEDS_MORE_INPUT; ++ return SZ_OK; ++ } ++ if (checkEndMarkNow && dummyRes != DUMMY_MATCH) ++ { ++ *status = LZMA_STATUS_NOT_FINISHED; ++ return SZ_ERROR_DATA; ++ } ++ } ++ p->buf = p->tempBuf; ++ if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0) ++ return SZ_ERROR_DATA; ++ lookAhead -= (rem - (unsigned)(p->buf - p->tempBuf)); ++ (*srcLen) += lookAhead; ++ src += lookAhead; ++ inSize -= lookAhead; ++ p->tempBufSize = 0; ++ } ++ } ++ if (p->code == 0) ++ *status = LZMA_STATUS_FINISHED_WITH_MARK; ++ return (p->code == 0) ? SZ_OK : SZ_ERROR_DATA; ++} ++ ++SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status) ++{ ++ SizeT outSize = *destLen; ++ SizeT inSize = *srcLen; ++ *srcLen = *destLen = 0; ++ for (;;) ++ { ++ SizeT inSizeCur = inSize, outSizeCur, dicPos; ++ ELzmaFinishMode curFinishMode; ++ SRes res; ++ if (p->dicPos == p->dicBufSize) ++ p->dicPos = 0; ++ dicPos = p->dicPos; ++ if (outSize > p->dicBufSize - dicPos) ++ { ++ outSizeCur = p->dicBufSize; ++ curFinishMode = LZMA_FINISH_ANY; ++ } ++ else ++ { ++ outSizeCur = dicPos + outSize; ++ curFinishMode = finishMode; ++ } ++ ++ res = LzmaDec_DecodeToDic(p, outSizeCur, src, &inSizeCur, curFinishMode, status); ++ src += inSizeCur; ++ inSize -= inSizeCur; ++ *srcLen += inSizeCur; ++ outSizeCur = p->dicPos - dicPos; ++ memcpy(dest, p->dic + dicPos, outSizeCur); ++ dest += outSizeCur; ++ outSize -= outSizeCur; ++ *destLen += outSizeCur; ++ if (res != 0) ++ return res; ++ if (outSizeCur == 0 || outSize == 0) ++ return SZ_OK; ++ } ++} ++ ++void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc) ++{ ++ alloc->Free(alloc, p->probs); ++ p->probs = 0; ++} ++ ++static void LzmaDec_FreeDict(CLzmaDec *p, ISzAlloc *alloc) ++{ ++ alloc->Free(alloc, p->dic); ++ p->dic = 0; ++} ++ ++void LzmaDec_Free(CLzmaDec *p, ISzAlloc *alloc) ++{ ++ LzmaDec_FreeProbs(p, alloc); ++ LzmaDec_FreeDict(p, alloc); ++} ++ ++SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size) ++{ ++ UInt32 dicSize; ++ Byte d; ++ ++ if (size < LZMA_PROPS_SIZE) ++ return SZ_ERROR_UNSUPPORTED; ++ else ++ dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24); ++ ++ if (dicSize < LZMA_DIC_MIN) ++ dicSize = LZMA_DIC_MIN; ++ p->dicSize = dicSize; ++ ++ d = data[0]; ++ if (d >= (9 * 5 * 5)) ++ return SZ_ERROR_UNSUPPORTED; ++ ++ p->lc = d % 9; ++ d /= 9; ++ p->pb = d / 5; ++ p->lp = d % 5; ++ ++ return SZ_OK; ++} ++ ++static SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc) ++{ ++ UInt32 numProbs = LzmaProps_GetNumProbs(propNew); ++ if (p->probs == 0 || numProbs != p->numProbs) ++ { ++ LzmaDec_FreeProbs(p, alloc); ++ p->probs = (CLzmaProb *)alloc->Alloc(alloc, numProbs * sizeof(CLzmaProb)); ++ p->numProbs = numProbs; ++ if (p->probs == 0) ++ return SZ_ERROR_MEM; ++ } ++ return SZ_OK; ++} ++ ++SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) ++{ ++ CLzmaProps propNew; ++ RINOK(LzmaProps_Decode(&propNew, props, propsSize)); ++ RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); ++ p->prop = propNew; ++ return SZ_OK; ++} ++ ++SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) ++{ ++ CLzmaProps propNew; ++ SizeT dicBufSize; ++ RINOK(LzmaProps_Decode(&propNew, props, propsSize)); ++ RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); ++ dicBufSize = propNew.dicSize; ++ if (p->dic == 0 || dicBufSize != p->dicBufSize) ++ { ++ LzmaDec_FreeDict(p, alloc); ++ p->dic = (Byte *)alloc->Alloc(alloc, dicBufSize); ++ if (p->dic == 0) ++ { ++ LzmaDec_FreeProbs(p, alloc); ++ return SZ_ERROR_MEM; ++ } ++ } ++ p->dicBufSize = dicBufSize; ++ p->prop = propNew; ++ return SZ_OK; ++} ++ ++SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ++ const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, ++ ELzmaStatus *status, ISzAlloc *alloc) ++{ ++ CLzmaDec p; ++ SRes res; ++ SizeT inSize = *srcLen; ++ SizeT outSize = *destLen; ++ *srcLen = *destLen = 0; ++ if (inSize < RC_INIT_SIZE) ++ return SZ_ERROR_INPUT_EOF; ++ ++ LzmaDec_Construct(&p); ++ res = LzmaDec_AllocateProbs(&p, propData, propSize, alloc); ++ if (res != 0) ++ return res; ++ p.dic = dest; ++ p.dicBufSize = outSize; ++ ++ LzmaDec_Init(&p); ++ ++ *srcLen = inSize; ++ res = LzmaDec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status); ++ ++ if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT) ++ res = SZ_ERROR_INPUT_EOF; ++ ++ (*destLen) = p.dicPos; ++ LzmaDec_FreeProbs(&p, alloc); ++ return res; ++} +--- /dev/null ++++ b/lib/lzma/LzmaEnc.c +@@ -0,0 +1,2271 @@ ++/* LzmaEnc.c -- LZMA Encoder ++2009-11-24 : Igor Pavlov : Public domain */ ++ ++#include ++ ++/* #define SHOW_STAT */ ++/* #define SHOW_STAT2 */ ++ ++#if defined(SHOW_STAT) || defined(SHOW_STAT2) ++#include ++#endif ++ ++#include "LzmaEnc.h" ++ ++/* disable MT */ ++#define _7ZIP_ST ++ ++#include "LzFind.h" ++#ifndef _7ZIP_ST ++#include "LzFindMt.h" ++#endif ++ ++#ifdef SHOW_STAT ++static int ttt = 0; ++#endif ++ ++#define kBlockSizeMax ((1 << LZMA_NUM_BLOCK_SIZE_BITS) - 1) ++ ++#define kBlockSize (9 << 10) ++#define kUnpackBlockSize (1 << 18) ++#define kMatchArraySize (1 << 21) ++#define kMatchRecordMaxSize ((LZMA_MATCH_LEN_MAX * 2 + 3) * LZMA_MATCH_LEN_MAX) ++ ++#define kNumMaxDirectBits (31) ++ ++#define kNumTopBits 24 ++#define kTopValue ((UInt32)1 << kNumTopBits) ++ ++#define kNumBitModelTotalBits 11 ++#define kBitModelTotal (1 << kNumBitModelTotalBits) ++#define kNumMoveBits 5 ++#define kProbInitValue (kBitModelTotal >> 1) ++ ++#define kNumMoveReducingBits 4 ++#define kNumBitPriceShiftBits 4 ++#define kBitPrice (1 << kNumBitPriceShiftBits) ++ ++void LzmaEncProps_Init(CLzmaEncProps *p) ++{ ++ p->level = 5; ++ p->dictSize = p->mc = 0; ++ p->lc = p->lp = p->pb = p->algo = p->fb = p->btMode = p->numHashBytes = p->numThreads = -1; ++ p->writeEndMark = 0; ++} ++ ++void LzmaEncProps_Normalize(CLzmaEncProps *p) ++{ ++ int level = p->level; ++ if (level < 0) level = 5; ++ p->level = level; ++ if (p->dictSize == 0) p->dictSize = (level <= 5 ? (1 << (level * 2 + 14)) : (level == 6 ? (1 << 25) : (1 << 26))); ++ if (p->lc < 0) p->lc = 3; ++ if (p->lp < 0) p->lp = 0; ++ if (p->pb < 0) p->pb = 2; ++ if (p->algo < 0) p->algo = (level < 5 ? 0 : 1); ++ if (p->fb < 0) p->fb = (level < 7 ? 32 : 64); ++ if (p->btMode < 0) p->btMode = (p->algo == 0 ? 0 : 1); ++ if (p->numHashBytes < 0) p->numHashBytes = 4; ++ if (p->mc == 0) p->mc = (16 + (p->fb >> 1)) >> (p->btMode ? 0 : 1); ++ if (p->numThreads < 0) ++ p->numThreads = ++ #ifndef _7ZIP_ST ++ ((p->btMode && p->algo) ? 2 : 1); ++ #else ++ 1; ++ #endif ++} ++ ++UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2) ++{ ++ CLzmaEncProps props = *props2; ++ LzmaEncProps_Normalize(&props); ++ return props.dictSize; ++} ++ ++/* #define LZMA_LOG_BSR */ ++/* Define it for Intel's CPU */ ++ ++ ++#ifdef LZMA_LOG_BSR ++ ++#define kDicLogSizeMaxCompress 30 ++ ++#define BSR2_RET(pos, res) { unsigned long i; _BitScanReverse(&i, (pos)); res = (i + i) + ((pos >> (i - 1)) & 1); } ++ ++UInt32 GetPosSlot1(UInt32 pos) ++{ ++ UInt32 res; ++ BSR2_RET(pos, res); ++ return res; ++} ++#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); } ++#define GetPosSlot(pos, res) { if (pos < 2) res = pos; else BSR2_RET(pos, res); } ++ ++#else ++ ++#define kNumLogBits (9 + (int)sizeof(size_t) / 2) ++#define kDicLogSizeMaxCompress ((kNumLogBits - 1) * 2 + 7) ++ ++void LzmaEnc_FastPosInit(Byte *g_FastPos) ++{ ++ int c = 2, slotFast; ++ g_FastPos[0] = 0; ++ g_FastPos[1] = 1; ++ ++ for (slotFast = 2; slotFast < kNumLogBits * 2; slotFast++) ++ { ++ UInt32 k = (1 << ((slotFast >> 1) - 1)); ++ UInt32 j; ++ for (j = 0; j < k; j++, c++) ++ g_FastPos[c] = (Byte)slotFast; ++ } ++} ++ ++#define BSR2_RET(pos, res) { UInt32 i = 6 + ((kNumLogBits - 1) & \ ++ (0 - (((((UInt32)1 << (kNumLogBits + 6)) - 1) - pos) >> 31))); \ ++ res = p->g_FastPos[pos >> i] + (i * 2); } ++/* ++#define BSR2_RET(pos, res) { res = (pos < (1 << (kNumLogBits + 6))) ? \ ++ p->g_FastPos[pos >> 6] + 12 : \ ++ p->g_FastPos[pos >> (6 + kNumLogBits - 1)] + (6 + (kNumLogBits - 1)) * 2; } ++*/ ++ ++#define GetPosSlot1(pos) p->g_FastPos[pos] ++#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); } ++#define GetPosSlot(pos, res) { if (pos < kNumFullDistances) res = p->g_FastPos[pos]; else BSR2_RET(pos, res); } ++ ++#endif ++ ++ ++#define LZMA_NUM_REPS 4 ++ ++typedef unsigned CState; ++ ++typedef struct ++{ ++ UInt32 price; ++ ++ CState state; ++ int prev1IsChar; ++ int prev2; ++ ++ UInt32 posPrev2; ++ UInt32 backPrev2; ++ ++ UInt32 posPrev; ++ UInt32 backPrev; ++ UInt32 backs[LZMA_NUM_REPS]; ++} COptimal; ++ ++#define kNumOpts (1 << 12) ++ ++#define kNumLenToPosStates 4 ++#define kNumPosSlotBits 6 ++#define kDicLogSizeMin 0 ++#define kDicLogSizeMax 32 ++#define kDistTableSizeMax (kDicLogSizeMax * 2) ++ ++ ++#define kNumAlignBits 4 ++#define kAlignTableSize (1 << kNumAlignBits) ++#define kAlignMask (kAlignTableSize - 1) ++ ++#define kStartPosModelIndex 4 ++#define kEndPosModelIndex 14 ++#define kNumPosModels (kEndPosModelIndex - kStartPosModelIndex) ++ ++#define kNumFullDistances (1 << (kEndPosModelIndex >> 1)) ++ ++#ifdef _LZMA_PROB32 ++#define CLzmaProb UInt32 ++#else ++#define CLzmaProb UInt16 ++#endif ++ ++#define LZMA_PB_MAX 4 ++#define LZMA_LC_MAX 8 ++#define LZMA_LP_MAX 4 ++ ++#define LZMA_NUM_PB_STATES_MAX (1 << LZMA_PB_MAX) ++ ++ ++#define kLenNumLowBits 3 ++#define kLenNumLowSymbols (1 << kLenNumLowBits) ++#define kLenNumMidBits 3 ++#define kLenNumMidSymbols (1 << kLenNumMidBits) ++#define kLenNumHighBits 8 ++#define kLenNumHighSymbols (1 << kLenNumHighBits) ++ ++#define kLenNumSymbolsTotal (kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols) ++ ++#define LZMA_MATCH_LEN_MIN 2 ++#define LZMA_MATCH_LEN_MAX (LZMA_MATCH_LEN_MIN + kLenNumSymbolsTotal - 1) ++ ++#define kNumStates 12 ++ ++typedef struct ++{ ++ CLzmaProb choice; ++ CLzmaProb choice2; ++ CLzmaProb low[LZMA_NUM_PB_STATES_MAX << kLenNumLowBits]; ++ CLzmaProb mid[LZMA_NUM_PB_STATES_MAX << kLenNumMidBits]; ++ CLzmaProb high[kLenNumHighSymbols]; ++} CLenEnc; ++ ++typedef struct ++{ ++ CLenEnc p; ++ UInt32 prices[LZMA_NUM_PB_STATES_MAX][kLenNumSymbolsTotal]; ++ UInt32 tableSize; ++ UInt32 counters[LZMA_NUM_PB_STATES_MAX]; ++} CLenPriceEnc; ++ ++typedef struct ++{ ++ UInt32 range; ++ Byte cache; ++ UInt64 low; ++ UInt64 cacheSize; ++ Byte *buf; ++ Byte *bufLim; ++ Byte *bufBase; ++ ISeqOutStream *outStream; ++ UInt64 processed; ++ SRes res; ++} CRangeEnc; ++ ++typedef struct ++{ ++ CLzmaProb *litProbs; ++ ++ CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX]; ++ CLzmaProb isRep[kNumStates]; ++ CLzmaProb isRepG0[kNumStates]; ++ CLzmaProb isRepG1[kNumStates]; ++ CLzmaProb isRepG2[kNumStates]; ++ CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX]; ++ ++ CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits]; ++ CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex]; ++ CLzmaProb posAlignEncoder[1 << kNumAlignBits]; ++ ++ CLenPriceEnc lenEnc; ++ CLenPriceEnc repLenEnc; ++ ++ UInt32 reps[LZMA_NUM_REPS]; ++ UInt32 state; ++} CSaveState; ++ ++typedef struct ++{ ++ IMatchFinder matchFinder; ++ void *matchFinderObj; ++ ++ #ifndef _7ZIP_ST ++ Bool mtMode; ++ CMatchFinderMt matchFinderMt; ++ #endif ++ ++ CMatchFinder matchFinderBase; ++ ++ #ifndef _7ZIP_ST ++ Byte pad[128]; ++ #endif ++ ++ UInt32 optimumEndIndex; ++ UInt32 optimumCurrentIndex; ++ ++ UInt32 longestMatchLength; ++ UInt32 numPairs; ++ UInt32 numAvail; ++ COptimal opt[kNumOpts]; ++ ++ #ifndef LZMA_LOG_BSR ++ Byte g_FastPos[1 << kNumLogBits]; ++ #endif ++ ++ UInt32 ProbPrices[kBitModelTotal >> kNumMoveReducingBits]; ++ UInt32 matches[LZMA_MATCH_LEN_MAX * 2 + 2 + 1]; ++ UInt32 numFastBytes; ++ UInt32 additionalOffset; ++ UInt32 reps[LZMA_NUM_REPS]; ++ UInt32 state; ++ ++ UInt32 posSlotPrices[kNumLenToPosStates][kDistTableSizeMax]; ++ UInt32 distancesPrices[kNumLenToPosStates][kNumFullDistances]; ++ UInt32 alignPrices[kAlignTableSize]; ++ UInt32 alignPriceCount; ++ ++ UInt32 distTableSize; ++ ++ unsigned lc, lp, pb; ++ unsigned lpMask, pbMask; ++ ++ CLzmaProb *litProbs; ++ ++ CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX]; ++ CLzmaProb isRep[kNumStates]; ++ CLzmaProb isRepG0[kNumStates]; ++ CLzmaProb isRepG1[kNumStates]; ++ CLzmaProb isRepG2[kNumStates]; ++ CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX]; ++ ++ CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits]; ++ CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex]; ++ CLzmaProb posAlignEncoder[1 << kNumAlignBits]; ++ ++ CLenPriceEnc lenEnc; ++ CLenPriceEnc repLenEnc; ++ ++ unsigned lclp; ++ ++ Bool fastMode; ++ ++ CRangeEnc rc; ++ ++ Bool writeEndMark; ++ UInt64 nowPos64; ++ UInt32 matchPriceCount; ++ Bool finished; ++ Bool multiThread; ++ ++ SRes result; ++ UInt32 dictSize; ++ UInt32 matchFinderCycles; ++ ++ int needInit; ++ ++ CSaveState saveState; ++} CLzmaEnc; ++ ++void LzmaEnc_SaveState(CLzmaEncHandle pp) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ CSaveState *dest = &p->saveState; ++ int i; ++ dest->lenEnc = p->lenEnc; ++ dest->repLenEnc = p->repLenEnc; ++ dest->state = p->state; ++ ++ for (i = 0; i < kNumStates; i++) ++ { ++ memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); ++ memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); ++ } ++ for (i = 0; i < kNumLenToPosStates; i++) ++ memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); ++ memcpy(dest->isRep, p->isRep, sizeof(p->isRep)); ++ memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); ++ memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); ++ memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); ++ memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); ++ memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); ++ memcpy(dest->reps, p->reps, sizeof(p->reps)); ++ memcpy(dest->litProbs, p->litProbs, (0x300 << p->lclp) * sizeof(CLzmaProb)); ++} ++ ++void LzmaEnc_RestoreState(CLzmaEncHandle pp) ++{ ++ CLzmaEnc *dest = (CLzmaEnc *)pp; ++ const CSaveState *p = &dest->saveState; ++ int i; ++ dest->lenEnc = p->lenEnc; ++ dest->repLenEnc = p->repLenEnc; ++ dest->state = p->state; ++ ++ for (i = 0; i < kNumStates; i++) ++ { ++ memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); ++ memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); ++ } ++ for (i = 0; i < kNumLenToPosStates; i++) ++ memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); ++ memcpy(dest->isRep, p->isRep, sizeof(p->isRep)); ++ memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); ++ memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); ++ memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); ++ memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); ++ memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); ++ memcpy(dest->reps, p->reps, sizeof(p->reps)); ++ memcpy(dest->litProbs, p->litProbs, (0x300 << dest->lclp) * sizeof(CLzmaProb)); ++} ++ ++SRes LzmaEnc_SetProps(CLzmaEncHandle pp, const CLzmaEncProps *props2) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ CLzmaEncProps props = *props2; ++ LzmaEncProps_Normalize(&props); ++ ++ if (props.lc > LZMA_LC_MAX || props.lp > LZMA_LP_MAX || props.pb > LZMA_PB_MAX || ++ props.dictSize > (1 << kDicLogSizeMaxCompress) || props.dictSize > (1 << 30)) ++ return SZ_ERROR_PARAM; ++ p->dictSize = props.dictSize; ++ p->matchFinderCycles = props.mc; ++ { ++ unsigned fb = props.fb; ++ if (fb < 5) ++ fb = 5; ++ if (fb > LZMA_MATCH_LEN_MAX) ++ fb = LZMA_MATCH_LEN_MAX; ++ p->numFastBytes = fb; ++ } ++ p->lc = props.lc; ++ p->lp = props.lp; ++ p->pb = props.pb; ++ p->fastMode = (props.algo == 0); ++ p->matchFinderBase.btMode = props.btMode; ++ { ++ UInt32 numHashBytes = 4; ++ if (props.btMode) ++ { ++ if (props.numHashBytes < 2) ++ numHashBytes = 2; ++ else if (props.numHashBytes < 4) ++ numHashBytes = props.numHashBytes; ++ } ++ p->matchFinderBase.numHashBytes = numHashBytes; ++ } ++ ++ p->matchFinderBase.cutValue = props.mc; ++ ++ p->writeEndMark = props.writeEndMark; ++ ++ #ifndef _7ZIP_ST ++ /* ++ if (newMultiThread != _multiThread) ++ { ++ ReleaseMatchFinder(); ++ _multiThread = newMultiThread; ++ } ++ */ ++ p->multiThread = (props.numThreads > 1); ++ #endif ++ ++ return SZ_OK; ++} ++ ++static const int kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5}; ++static const int kMatchNextStates[kNumStates] = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10}; ++static const int kRepNextStates[kNumStates] = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11}; ++static const int kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11}; ++ ++#define IsCharState(s) ((s) < 7) ++ ++#define GetLenToPosState(len) (((len) < kNumLenToPosStates + 1) ? (len) - 2 : kNumLenToPosStates - 1) ++ ++#define kInfinityPrice (1 << 30) ++ ++static void RangeEnc_Construct(CRangeEnc *p) ++{ ++ p->outStream = 0; ++ p->bufBase = 0; ++} ++ ++#define RangeEnc_GetProcessed(p) ((p)->processed + ((p)->buf - (p)->bufBase) + (p)->cacheSize) ++ ++#define RC_BUF_SIZE (1 << 16) ++static int RangeEnc_Alloc(CRangeEnc *p, ISzAlloc *alloc) ++{ ++ if (p->bufBase == 0) ++ { ++ p->bufBase = (Byte *)alloc->Alloc(alloc, RC_BUF_SIZE); ++ if (p->bufBase == 0) ++ return 0; ++ p->bufLim = p->bufBase + RC_BUF_SIZE; ++ } ++ return 1; ++} ++ ++static void RangeEnc_Free(CRangeEnc *p, ISzAlloc *alloc) ++{ ++ alloc->Free(alloc, p->bufBase); ++ p->bufBase = 0; ++} ++ ++static void RangeEnc_Init(CRangeEnc *p) ++{ ++ /* Stream.Init(); */ ++ p->low = 0; ++ p->range = 0xFFFFFFFF; ++ p->cacheSize = 1; ++ p->cache = 0; ++ ++ p->buf = p->bufBase; ++ ++ p->processed = 0; ++ p->res = SZ_OK; ++} ++ ++static void RangeEnc_FlushStream(CRangeEnc *p) ++{ ++ size_t num; ++ if (p->res != SZ_OK) ++ return; ++ num = p->buf - p->bufBase; ++ if (num != p->outStream->Write(p->outStream, p->bufBase, num)) ++ p->res = SZ_ERROR_WRITE; ++ p->processed += num; ++ p->buf = p->bufBase; ++} ++ ++static void MY_FAST_CALL RangeEnc_ShiftLow(CRangeEnc *p) ++{ ++ if ((UInt32)p->low < (UInt32)0xFF000000 || (int)(p->low >> 32) != 0) ++ { ++ Byte temp = p->cache; ++ do ++ { ++ Byte *buf = p->buf; ++ *buf++ = (Byte)(temp + (Byte)(p->low >> 32)); ++ p->buf = buf; ++ if (buf == p->bufLim) ++ RangeEnc_FlushStream(p); ++ temp = 0xFF; ++ } ++ while (--p->cacheSize != 0); ++ p->cache = (Byte)((UInt32)p->low >> 24); ++ } ++ p->cacheSize++; ++ p->low = (UInt32)p->low << 8; ++} ++ ++static void RangeEnc_FlushData(CRangeEnc *p) ++{ ++ int i; ++ for (i = 0; i < 5; i++) ++ RangeEnc_ShiftLow(p); ++} ++ ++static void RangeEnc_EncodeDirectBits(CRangeEnc *p, UInt32 value, int numBits) ++{ ++ do ++ { ++ p->range >>= 1; ++ p->low += p->range & (0 - ((value >> --numBits) & 1)); ++ if (p->range < kTopValue) ++ { ++ p->range <<= 8; ++ RangeEnc_ShiftLow(p); ++ } ++ } ++ while (numBits != 0); ++} ++ ++static void RangeEnc_EncodeBit(CRangeEnc *p, CLzmaProb *prob, UInt32 symbol) ++{ ++ UInt32 ttt = *prob; ++ UInt32 newBound = (p->range >> kNumBitModelTotalBits) * ttt; ++ if (symbol == 0) ++ { ++ p->range = newBound; ++ ttt += (kBitModelTotal - ttt) >> kNumMoveBits; ++ } ++ else ++ { ++ p->low += newBound; ++ p->range -= newBound; ++ ttt -= ttt >> kNumMoveBits; ++ } ++ *prob = (CLzmaProb)ttt; ++ if (p->range < kTopValue) ++ { ++ p->range <<= 8; ++ RangeEnc_ShiftLow(p); ++ } ++} ++ ++static void LitEnc_Encode(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol) ++{ ++ symbol |= 0x100; ++ do ++ { ++ RangeEnc_EncodeBit(p, probs + (symbol >> 8), (symbol >> 7) & 1); ++ symbol <<= 1; ++ } ++ while (symbol < 0x10000); ++} ++ ++static void LitEnc_EncodeMatched(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol, UInt32 matchByte) ++{ ++ UInt32 offs = 0x100; ++ symbol |= 0x100; ++ do ++ { ++ matchByte <<= 1; ++ RangeEnc_EncodeBit(p, probs + (offs + (matchByte & offs) + (symbol >> 8)), (symbol >> 7) & 1); ++ symbol <<= 1; ++ offs &= ~(matchByte ^ symbol); ++ } ++ while (symbol < 0x10000); ++} ++ ++void LzmaEnc_InitPriceTables(UInt32 *ProbPrices) ++{ ++ UInt32 i; ++ for (i = (1 << kNumMoveReducingBits) / 2; i < kBitModelTotal; i += (1 << kNumMoveReducingBits)) ++ { ++ const int kCyclesBits = kNumBitPriceShiftBits; ++ UInt32 w = i; ++ UInt32 bitCount = 0; ++ int j; ++ for (j = 0; j < kCyclesBits; j++) ++ { ++ w = w * w; ++ bitCount <<= 1; ++ while (w >= ((UInt32)1 << 16)) ++ { ++ w >>= 1; ++ bitCount++; ++ } ++ } ++ ProbPrices[i >> kNumMoveReducingBits] = ((kNumBitModelTotalBits << kCyclesBits) - 15 - bitCount); ++ } ++} ++ ++ ++#define GET_PRICE(prob, symbol) \ ++ p->ProbPrices[((prob) ^ (((-(int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits]; ++ ++#define GET_PRICEa(prob, symbol) \ ++ ProbPrices[((prob) ^ ((-((int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits]; ++ ++#define GET_PRICE_0(prob) p->ProbPrices[(prob) >> kNumMoveReducingBits] ++#define GET_PRICE_1(prob) p->ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits] ++ ++#define GET_PRICE_0a(prob) ProbPrices[(prob) >> kNumMoveReducingBits] ++#define GET_PRICE_1a(prob) ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits] ++ ++static UInt32 LitEnc_GetPrice(const CLzmaProb *probs, UInt32 symbol, UInt32 *ProbPrices) ++{ ++ UInt32 price = 0; ++ symbol |= 0x100; ++ do ++ { ++ price += GET_PRICEa(probs[symbol >> 8], (symbol >> 7) & 1); ++ symbol <<= 1; ++ } ++ while (symbol < 0x10000); ++ return price; ++} ++ ++static UInt32 LitEnc_GetPriceMatched(const CLzmaProb *probs, UInt32 symbol, UInt32 matchByte, UInt32 *ProbPrices) ++{ ++ UInt32 price = 0; ++ UInt32 offs = 0x100; ++ symbol |= 0x100; ++ do ++ { ++ matchByte <<= 1; ++ price += GET_PRICEa(probs[offs + (matchByte & offs) + (symbol >> 8)], (symbol >> 7) & 1); ++ symbol <<= 1; ++ offs &= ~(matchByte ^ symbol); ++ } ++ while (symbol < 0x10000); ++ return price; ++} ++ ++ ++static void RcTree_Encode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol) ++{ ++ UInt32 m = 1; ++ int i; ++ for (i = numBitLevels; i != 0;) ++ { ++ UInt32 bit; ++ i--; ++ bit = (symbol >> i) & 1; ++ RangeEnc_EncodeBit(rc, probs + m, bit); ++ m = (m << 1) | bit; ++ } ++} ++ ++static void RcTree_ReverseEncode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol) ++{ ++ UInt32 m = 1; ++ int i; ++ for (i = 0; i < numBitLevels; i++) ++ { ++ UInt32 bit = symbol & 1; ++ RangeEnc_EncodeBit(rc, probs + m, bit); ++ m = (m << 1) | bit; ++ symbol >>= 1; ++ } ++} ++ ++static UInt32 RcTree_GetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices) ++{ ++ UInt32 price = 0; ++ symbol |= (1 << numBitLevels); ++ while (symbol != 1) ++ { ++ price += GET_PRICEa(probs[symbol >> 1], symbol & 1); ++ symbol >>= 1; ++ } ++ return price; ++} ++ ++static UInt32 RcTree_ReverseGetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices) ++{ ++ UInt32 price = 0; ++ UInt32 m = 1; ++ int i; ++ for (i = numBitLevels; i != 0; i--) ++ { ++ UInt32 bit = symbol & 1; ++ symbol >>= 1; ++ price += GET_PRICEa(probs[m], bit); ++ m = (m << 1) | bit; ++ } ++ return price; ++} ++ ++ ++static void LenEnc_Init(CLenEnc *p) ++{ ++ unsigned i; ++ p->choice = p->choice2 = kProbInitValue; ++ for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumLowBits); i++) ++ p->low[i] = kProbInitValue; ++ for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumMidBits); i++) ++ p->mid[i] = kProbInitValue; ++ for (i = 0; i < kLenNumHighSymbols; i++) ++ p->high[i] = kProbInitValue; ++} ++ ++static void LenEnc_Encode(CLenEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState) ++{ ++ if (symbol < kLenNumLowSymbols) ++ { ++ RangeEnc_EncodeBit(rc, &p->choice, 0); ++ RcTree_Encode(rc, p->low + (posState << kLenNumLowBits), kLenNumLowBits, symbol); ++ } ++ else ++ { ++ RangeEnc_EncodeBit(rc, &p->choice, 1); ++ if (symbol < kLenNumLowSymbols + kLenNumMidSymbols) ++ { ++ RangeEnc_EncodeBit(rc, &p->choice2, 0); ++ RcTree_Encode(rc, p->mid + (posState << kLenNumMidBits), kLenNumMidBits, symbol - kLenNumLowSymbols); ++ } ++ else ++ { ++ RangeEnc_EncodeBit(rc, &p->choice2, 1); ++ RcTree_Encode(rc, p->high, kLenNumHighBits, symbol - kLenNumLowSymbols - kLenNumMidSymbols); ++ } ++ } ++} ++ ++static void LenEnc_SetPrices(CLenEnc *p, UInt32 posState, UInt32 numSymbols, UInt32 *prices, UInt32 *ProbPrices) ++{ ++ UInt32 a0 = GET_PRICE_0a(p->choice); ++ UInt32 a1 = GET_PRICE_1a(p->choice); ++ UInt32 b0 = a1 + GET_PRICE_0a(p->choice2); ++ UInt32 b1 = a1 + GET_PRICE_1a(p->choice2); ++ UInt32 i = 0; ++ for (i = 0; i < kLenNumLowSymbols; i++) ++ { ++ if (i >= numSymbols) ++ return; ++ prices[i] = a0 + RcTree_GetPrice(p->low + (posState << kLenNumLowBits), kLenNumLowBits, i, ProbPrices); ++ } ++ for (; i < kLenNumLowSymbols + kLenNumMidSymbols; i++) ++ { ++ if (i >= numSymbols) ++ return; ++ prices[i] = b0 + RcTree_GetPrice(p->mid + (posState << kLenNumMidBits), kLenNumMidBits, i - kLenNumLowSymbols, ProbPrices); ++ } ++ for (; i < numSymbols; i++) ++ prices[i] = b1 + RcTree_GetPrice(p->high, kLenNumHighBits, i - kLenNumLowSymbols - kLenNumMidSymbols, ProbPrices); ++} ++ ++static void MY_FAST_CALL LenPriceEnc_UpdateTable(CLenPriceEnc *p, UInt32 posState, UInt32 *ProbPrices) ++{ ++ LenEnc_SetPrices(&p->p, posState, p->tableSize, p->prices[posState], ProbPrices); ++ p->counters[posState] = p->tableSize; ++} ++ ++static void LenPriceEnc_UpdateTables(CLenPriceEnc *p, UInt32 numPosStates, UInt32 *ProbPrices) ++{ ++ UInt32 posState; ++ for (posState = 0; posState < numPosStates; posState++) ++ LenPriceEnc_UpdateTable(p, posState, ProbPrices); ++} ++ ++static void LenEnc_Encode2(CLenPriceEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState, Bool updatePrice, UInt32 *ProbPrices) ++{ ++ LenEnc_Encode(&p->p, rc, symbol, posState); ++ if (updatePrice) ++ if (--p->counters[posState] == 0) ++ LenPriceEnc_UpdateTable(p, posState, ProbPrices); ++} ++ ++ ++ ++ ++static void MovePos(CLzmaEnc *p, UInt32 num) ++{ ++ #ifdef SHOW_STAT ++ ttt += num; ++ printf("\n MovePos %d", num); ++ #endif ++ if (num != 0) ++ { ++ p->additionalOffset += num; ++ p->matchFinder.Skip(p->matchFinderObj, num); ++ } ++} ++ ++static UInt32 ReadMatchDistances(CLzmaEnc *p, UInt32 *numDistancePairsRes) ++{ ++ UInt32 lenRes = 0, numPairs; ++ p->numAvail = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); ++ numPairs = p->matchFinder.GetMatches(p->matchFinderObj, p->matches); ++ #ifdef SHOW_STAT ++ printf("\n i = %d numPairs = %d ", ttt, numPairs / 2); ++ ttt++; ++ { ++ UInt32 i; ++ for (i = 0; i < numPairs; i += 2) ++ printf("%2d %6d | ", p->matches[i], p->matches[i + 1]); ++ } ++ #endif ++ if (numPairs > 0) ++ { ++ lenRes = p->matches[numPairs - 2]; ++ if (lenRes == p->numFastBytes) ++ { ++ const Byte *pby = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; ++ UInt32 distance = p->matches[numPairs - 1] + 1; ++ UInt32 numAvail = p->numAvail; ++ if (numAvail > LZMA_MATCH_LEN_MAX) ++ numAvail = LZMA_MATCH_LEN_MAX; ++ { ++ const Byte *pby2 = pby - distance; ++ for (; lenRes < numAvail && pby[lenRes] == pby2[lenRes]; lenRes++); ++ } ++ } ++ } ++ p->additionalOffset++; ++ *numDistancePairsRes = numPairs; ++ return lenRes; ++} ++ ++ ++#define MakeAsChar(p) (p)->backPrev = (UInt32)(-1); (p)->prev1IsChar = False; ++#define MakeAsShortRep(p) (p)->backPrev = 0; (p)->prev1IsChar = False; ++#define IsShortRep(p) ((p)->backPrev == 0) ++ ++static UInt32 GetRepLen1Price(CLzmaEnc *p, UInt32 state, UInt32 posState) ++{ ++ return ++ GET_PRICE_0(p->isRepG0[state]) + ++ GET_PRICE_0(p->isRep0Long[state][posState]); ++} ++ ++static UInt32 GetPureRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 state, UInt32 posState) ++{ ++ UInt32 price; ++ if (repIndex == 0) ++ { ++ price = GET_PRICE_0(p->isRepG0[state]); ++ price += GET_PRICE_1(p->isRep0Long[state][posState]); ++ } ++ else ++ { ++ price = GET_PRICE_1(p->isRepG0[state]); ++ if (repIndex == 1) ++ price += GET_PRICE_0(p->isRepG1[state]); ++ else ++ { ++ price += GET_PRICE_1(p->isRepG1[state]); ++ price += GET_PRICE(p->isRepG2[state], repIndex - 2); ++ } ++ } ++ return price; ++} ++ ++static UInt32 GetRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 len, UInt32 state, UInt32 posState) ++{ ++ return p->repLenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN] + ++ GetPureRepPrice(p, repIndex, state, posState); ++} ++ ++static UInt32 Backward(CLzmaEnc *p, UInt32 *backRes, UInt32 cur) ++{ ++ UInt32 posMem = p->opt[cur].posPrev; ++ UInt32 backMem = p->opt[cur].backPrev; ++ p->optimumEndIndex = cur; ++ do ++ { ++ if (p->opt[cur].prev1IsChar) ++ { ++ MakeAsChar(&p->opt[posMem]) ++ p->opt[posMem].posPrev = posMem - 1; ++ if (p->opt[cur].prev2) ++ { ++ p->opt[posMem - 1].prev1IsChar = False; ++ p->opt[posMem - 1].posPrev = p->opt[cur].posPrev2; ++ p->opt[posMem - 1].backPrev = p->opt[cur].backPrev2; ++ } ++ } ++ { ++ UInt32 posPrev = posMem; ++ UInt32 backCur = backMem; ++ ++ backMem = p->opt[posPrev].backPrev; ++ posMem = p->opt[posPrev].posPrev; ++ ++ p->opt[posPrev].backPrev = backCur; ++ p->opt[posPrev].posPrev = cur; ++ cur = posPrev; ++ } ++ } ++ while (cur != 0); ++ *backRes = p->opt[0].backPrev; ++ p->optimumCurrentIndex = p->opt[0].posPrev; ++ return p->optimumCurrentIndex; ++} ++ ++#define LIT_PROBS(pos, prevByte) (p->litProbs + ((((pos) & p->lpMask) << p->lc) + ((prevByte) >> (8 - p->lc))) * 0x300) ++ ++static UInt32 GetOptimum(CLzmaEnc *p, UInt32 position, UInt32 *backRes) ++{ ++ UInt32 numAvail, mainLen, numPairs, repMaxIndex, i, posState, lenEnd, len, cur; ++ UInt32 matchPrice, repMatchPrice, normalMatchPrice; ++ UInt32 reps[LZMA_NUM_REPS], repLens[LZMA_NUM_REPS]; ++ UInt32 *matches; ++ const Byte *data; ++ Byte curByte, matchByte; ++ if (p->optimumEndIndex != p->optimumCurrentIndex) ++ { ++ const COptimal *opt = &p->opt[p->optimumCurrentIndex]; ++ UInt32 lenRes = opt->posPrev - p->optimumCurrentIndex; ++ *backRes = opt->backPrev; ++ p->optimumCurrentIndex = opt->posPrev; ++ return lenRes; ++ } ++ p->optimumCurrentIndex = p->optimumEndIndex = 0; ++ ++ if (p->additionalOffset == 0) ++ mainLen = ReadMatchDistances(p, &numPairs); ++ else ++ { ++ mainLen = p->longestMatchLength; ++ numPairs = p->numPairs; ++ } ++ ++ numAvail = p->numAvail; ++ if (numAvail < 2) ++ { ++ *backRes = (UInt32)(-1); ++ return 1; ++ } ++ if (numAvail > LZMA_MATCH_LEN_MAX) ++ numAvail = LZMA_MATCH_LEN_MAX; ++ ++ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; ++ repMaxIndex = 0; ++ for (i = 0; i < LZMA_NUM_REPS; i++) ++ { ++ UInt32 lenTest; ++ const Byte *data2; ++ reps[i] = p->reps[i]; ++ data2 = data - (reps[i] + 1); ++ if (data[0] != data2[0] || data[1] != data2[1]) ++ { ++ repLens[i] = 0; ++ continue; ++ } ++ for (lenTest = 2; lenTest < numAvail && data[lenTest] == data2[lenTest]; lenTest++); ++ repLens[i] = lenTest; ++ if (lenTest > repLens[repMaxIndex]) ++ repMaxIndex = i; ++ } ++ if (repLens[repMaxIndex] >= p->numFastBytes) ++ { ++ UInt32 lenRes; ++ *backRes = repMaxIndex; ++ lenRes = repLens[repMaxIndex]; ++ MovePos(p, lenRes - 1); ++ return lenRes; ++ } ++ ++ matches = p->matches; ++ if (mainLen >= p->numFastBytes) ++ { ++ *backRes = matches[numPairs - 1] + LZMA_NUM_REPS; ++ MovePos(p, mainLen - 1); ++ return mainLen; ++ } ++ curByte = *data; ++ matchByte = *(data - (reps[0] + 1)); ++ ++ if (mainLen < 2 && curByte != matchByte && repLens[repMaxIndex] < 2) ++ { ++ *backRes = (UInt32)-1; ++ return 1; ++ } ++ ++ p->opt[0].state = (CState)p->state; ++ ++ posState = (position & p->pbMask); ++ ++ { ++ const CLzmaProb *probs = LIT_PROBS(position, *(data - 1)); ++ p->opt[1].price = GET_PRICE_0(p->isMatch[p->state][posState]) + ++ (!IsCharState(p->state) ? ++ LitEnc_GetPriceMatched(probs, curByte, matchByte, p->ProbPrices) : ++ LitEnc_GetPrice(probs, curByte, p->ProbPrices)); ++ } ++ ++ MakeAsChar(&p->opt[1]); ++ ++ matchPrice = GET_PRICE_1(p->isMatch[p->state][posState]); ++ repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[p->state]); ++ ++ if (matchByte == curByte) ++ { ++ UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, p->state, posState); ++ if (shortRepPrice < p->opt[1].price) ++ { ++ p->opt[1].price = shortRepPrice; ++ MakeAsShortRep(&p->opt[1]); ++ } ++ } ++ lenEnd = ((mainLen >= repLens[repMaxIndex]) ? mainLen : repLens[repMaxIndex]); ++ ++ if (lenEnd < 2) ++ { ++ *backRes = p->opt[1].backPrev; ++ return 1; ++ } ++ ++ p->opt[1].posPrev = 0; ++ for (i = 0; i < LZMA_NUM_REPS; i++) ++ p->opt[0].backs[i] = reps[i]; ++ ++ len = lenEnd; ++ do ++ p->opt[len--].price = kInfinityPrice; ++ while (len >= 2); ++ ++ for (i = 0; i < LZMA_NUM_REPS; i++) ++ { ++ UInt32 repLen = repLens[i]; ++ UInt32 price; ++ if (repLen < 2) ++ continue; ++ price = repMatchPrice + GetPureRepPrice(p, i, p->state, posState); ++ do ++ { ++ UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][repLen - 2]; ++ COptimal *opt = &p->opt[repLen]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = 0; ++ opt->backPrev = i; ++ opt->prev1IsChar = False; ++ } ++ } ++ while (--repLen >= 2); ++ } ++ ++ normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[p->state]); ++ ++ len = ((repLens[0] >= 2) ? repLens[0] + 1 : 2); ++ if (len <= mainLen) ++ { ++ UInt32 offs = 0; ++ while (len > matches[offs]) ++ offs += 2; ++ for (; ; len++) ++ { ++ COptimal *opt; ++ UInt32 distance = matches[offs + 1]; ++ ++ UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN]; ++ UInt32 lenToPosState = GetLenToPosState(len); ++ if (distance < kNumFullDistances) ++ curAndLenPrice += p->distancesPrices[lenToPosState][distance]; ++ else ++ { ++ UInt32 slot; ++ GetPosSlot2(distance, slot); ++ curAndLenPrice += p->alignPrices[distance & kAlignMask] + p->posSlotPrices[lenToPosState][slot]; ++ } ++ opt = &p->opt[len]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = 0; ++ opt->backPrev = distance + LZMA_NUM_REPS; ++ opt->prev1IsChar = False; ++ } ++ if (len == matches[offs]) ++ { ++ offs += 2; ++ if (offs == numPairs) ++ break; ++ } ++ } ++ } ++ ++ cur = 0; ++ ++ #ifdef SHOW_STAT2 ++ if (position >= 0) ++ { ++ unsigned i; ++ printf("\n pos = %4X", position); ++ for (i = cur; i <= lenEnd; i++) ++ printf("\nprice[%4X] = %d", position - cur + i, p->opt[i].price); ++ } ++ #endif ++ ++ for (;;) ++ { ++ UInt32 numAvailFull, newLen, numPairs, posPrev, state, posState, startLen; ++ UInt32 curPrice, curAnd1Price, matchPrice, repMatchPrice; ++ Bool nextIsChar; ++ Byte curByte, matchByte; ++ const Byte *data; ++ COptimal *curOpt; ++ COptimal *nextOpt; ++ ++ cur++; ++ if (cur == lenEnd) ++ return Backward(p, backRes, cur); ++ ++ newLen = ReadMatchDistances(p, &numPairs); ++ if (newLen >= p->numFastBytes) ++ { ++ p->numPairs = numPairs; ++ p->longestMatchLength = newLen; ++ return Backward(p, backRes, cur); ++ } ++ position++; ++ curOpt = &p->opt[cur]; ++ posPrev = curOpt->posPrev; ++ if (curOpt->prev1IsChar) ++ { ++ posPrev--; ++ if (curOpt->prev2) ++ { ++ state = p->opt[curOpt->posPrev2].state; ++ if (curOpt->backPrev2 < LZMA_NUM_REPS) ++ state = kRepNextStates[state]; ++ else ++ state = kMatchNextStates[state]; ++ } ++ else ++ state = p->opt[posPrev].state; ++ state = kLiteralNextStates[state]; ++ } ++ else ++ state = p->opt[posPrev].state; ++ if (posPrev == cur - 1) ++ { ++ if (IsShortRep(curOpt)) ++ state = kShortRepNextStates[state]; ++ else ++ state = kLiteralNextStates[state]; ++ } ++ else ++ { ++ UInt32 pos; ++ const COptimal *prevOpt; ++ if (curOpt->prev1IsChar && curOpt->prev2) ++ { ++ posPrev = curOpt->posPrev2; ++ pos = curOpt->backPrev2; ++ state = kRepNextStates[state]; ++ } ++ else ++ { ++ pos = curOpt->backPrev; ++ if (pos < LZMA_NUM_REPS) ++ state = kRepNextStates[state]; ++ else ++ state = kMatchNextStates[state]; ++ } ++ prevOpt = &p->opt[posPrev]; ++ if (pos < LZMA_NUM_REPS) ++ { ++ UInt32 i; ++ reps[0] = prevOpt->backs[pos]; ++ for (i = 1; i <= pos; i++) ++ reps[i] = prevOpt->backs[i - 1]; ++ for (; i < LZMA_NUM_REPS; i++) ++ reps[i] = prevOpt->backs[i]; ++ } ++ else ++ { ++ UInt32 i; ++ reps[0] = (pos - LZMA_NUM_REPS); ++ for (i = 1; i < LZMA_NUM_REPS; i++) ++ reps[i] = prevOpt->backs[i - 1]; ++ } ++ } ++ curOpt->state = (CState)state; ++ ++ curOpt->backs[0] = reps[0]; ++ curOpt->backs[1] = reps[1]; ++ curOpt->backs[2] = reps[2]; ++ curOpt->backs[3] = reps[3]; ++ ++ curPrice = curOpt->price; ++ nextIsChar = False; ++ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; ++ curByte = *data; ++ matchByte = *(data - (reps[0] + 1)); ++ ++ posState = (position & p->pbMask); ++ ++ curAnd1Price = curPrice + GET_PRICE_0(p->isMatch[state][posState]); ++ { ++ const CLzmaProb *probs = LIT_PROBS(position, *(data - 1)); ++ curAnd1Price += ++ (!IsCharState(state) ? ++ LitEnc_GetPriceMatched(probs, curByte, matchByte, p->ProbPrices) : ++ LitEnc_GetPrice(probs, curByte, p->ProbPrices)); ++ } ++ ++ nextOpt = &p->opt[cur + 1]; ++ ++ if (curAnd1Price < nextOpt->price) ++ { ++ nextOpt->price = curAnd1Price; ++ nextOpt->posPrev = cur; ++ MakeAsChar(nextOpt); ++ nextIsChar = True; ++ } ++ ++ matchPrice = curPrice + GET_PRICE_1(p->isMatch[state][posState]); ++ repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[state]); ++ ++ if (matchByte == curByte && !(nextOpt->posPrev < cur && nextOpt->backPrev == 0)) ++ { ++ UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, state, posState); ++ if (shortRepPrice <= nextOpt->price) ++ { ++ nextOpt->price = shortRepPrice; ++ nextOpt->posPrev = cur; ++ MakeAsShortRep(nextOpt); ++ nextIsChar = True; ++ } ++ } ++ numAvailFull = p->numAvail; ++ { ++ UInt32 temp = kNumOpts - 1 - cur; ++ if (temp < numAvailFull) ++ numAvailFull = temp; ++ } ++ ++ if (numAvailFull < 2) ++ continue; ++ numAvail = (numAvailFull <= p->numFastBytes ? numAvailFull : p->numFastBytes); ++ ++ if (!nextIsChar && matchByte != curByte) /* speed optimization */ ++ { ++ /* try Literal + rep0 */ ++ UInt32 temp; ++ UInt32 lenTest2; ++ const Byte *data2 = data - (reps[0] + 1); ++ UInt32 limit = p->numFastBytes + 1; ++ if (limit > numAvailFull) ++ limit = numAvailFull; ++ ++ for (temp = 1; temp < limit && data[temp] == data2[temp]; temp++); ++ lenTest2 = temp - 1; ++ if (lenTest2 >= 2) ++ { ++ UInt32 state2 = kLiteralNextStates[state]; ++ UInt32 posStateNext = (position + 1) & p->pbMask; ++ UInt32 nextRepMatchPrice = curAnd1Price + ++ GET_PRICE_1(p->isMatch[state2][posStateNext]) + ++ GET_PRICE_1(p->isRep[state2]); ++ /* for (; lenTest2 >= 2; lenTest2--) */ ++ { ++ UInt32 curAndLenPrice; ++ COptimal *opt; ++ UInt32 offset = cur + 1 + lenTest2; ++ while (lenEnd < offset) ++ p->opt[++lenEnd].price = kInfinityPrice; ++ curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); ++ opt = &p->opt[offset]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = cur + 1; ++ opt->backPrev = 0; ++ opt->prev1IsChar = True; ++ opt->prev2 = False; ++ } ++ } ++ } ++ } ++ ++ startLen = 2; /* speed optimization */ ++ { ++ UInt32 repIndex; ++ for (repIndex = 0; repIndex < LZMA_NUM_REPS; repIndex++) ++ { ++ UInt32 lenTest; ++ UInt32 lenTestTemp; ++ UInt32 price; ++ const Byte *data2 = data - (reps[repIndex] + 1); ++ if (data[0] != data2[0] || data[1] != data2[1]) ++ continue; ++ for (lenTest = 2; lenTest < numAvail && data[lenTest] == data2[lenTest]; lenTest++); ++ while (lenEnd < cur + lenTest) ++ p->opt[++lenEnd].price = kInfinityPrice; ++ lenTestTemp = lenTest; ++ price = repMatchPrice + GetPureRepPrice(p, repIndex, state, posState); ++ do ++ { ++ UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][lenTest - 2]; ++ COptimal *opt = &p->opt[cur + lenTest]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = cur; ++ opt->backPrev = repIndex; ++ opt->prev1IsChar = False; ++ } ++ } ++ while (--lenTest >= 2); ++ lenTest = lenTestTemp; ++ ++ if (repIndex == 0) ++ startLen = lenTest + 1; ++ ++ /* if (_maxMode) */ ++ { ++ UInt32 lenTest2 = lenTest + 1; ++ UInt32 limit = lenTest2 + p->numFastBytes; ++ UInt32 nextRepMatchPrice; ++ if (limit > numAvailFull) ++ limit = numAvailFull; ++ for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++); ++ lenTest2 -= lenTest + 1; ++ if (lenTest2 >= 2) ++ { ++ UInt32 state2 = kRepNextStates[state]; ++ UInt32 posStateNext = (position + lenTest) & p->pbMask; ++ UInt32 curAndLenCharPrice = ++ price + p->repLenEnc.prices[posState][lenTest - 2] + ++ GET_PRICE_0(p->isMatch[state2][posStateNext]) + ++ LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]), ++ data[lenTest], data2[lenTest], p->ProbPrices); ++ state2 = kLiteralNextStates[state2]; ++ posStateNext = (position + lenTest + 1) & p->pbMask; ++ nextRepMatchPrice = curAndLenCharPrice + ++ GET_PRICE_1(p->isMatch[state2][posStateNext]) + ++ GET_PRICE_1(p->isRep[state2]); ++ ++ /* for (; lenTest2 >= 2; lenTest2--) */ ++ { ++ UInt32 curAndLenPrice; ++ COptimal *opt; ++ UInt32 offset = cur + lenTest + 1 + lenTest2; ++ while (lenEnd < offset) ++ p->opt[++lenEnd].price = kInfinityPrice; ++ curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); ++ opt = &p->opt[offset]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = cur + lenTest + 1; ++ opt->backPrev = 0; ++ opt->prev1IsChar = True; ++ opt->prev2 = True; ++ opt->posPrev2 = cur; ++ opt->backPrev2 = repIndex; ++ } ++ } ++ } ++ } ++ } ++ } ++ /* for (UInt32 lenTest = 2; lenTest <= newLen; lenTest++) */ ++ if (newLen > numAvail) ++ { ++ newLen = numAvail; ++ for (numPairs = 0; newLen > matches[numPairs]; numPairs += 2); ++ matches[numPairs] = newLen; ++ numPairs += 2; ++ } ++ if (newLen >= startLen) ++ { ++ UInt32 normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[state]); ++ UInt32 offs, curBack, posSlot; ++ UInt32 lenTest; ++ while (lenEnd < cur + newLen) ++ p->opt[++lenEnd].price = kInfinityPrice; ++ ++ offs = 0; ++ while (startLen > matches[offs]) ++ offs += 2; ++ curBack = matches[offs + 1]; ++ GetPosSlot2(curBack, posSlot); ++ for (lenTest = /*2*/ startLen; ; lenTest++) ++ { ++ UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][lenTest - LZMA_MATCH_LEN_MIN]; ++ UInt32 lenToPosState = GetLenToPosState(lenTest); ++ COptimal *opt; ++ if (curBack < kNumFullDistances) ++ curAndLenPrice += p->distancesPrices[lenToPosState][curBack]; ++ else ++ curAndLenPrice += p->posSlotPrices[lenToPosState][posSlot] + p->alignPrices[curBack & kAlignMask]; ++ ++ opt = &p->opt[cur + lenTest]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = cur; ++ opt->backPrev = curBack + LZMA_NUM_REPS; ++ opt->prev1IsChar = False; ++ } ++ ++ if (/*_maxMode && */lenTest == matches[offs]) ++ { ++ /* Try Match + Literal + Rep0 */ ++ const Byte *data2 = data - (curBack + 1); ++ UInt32 lenTest2 = lenTest + 1; ++ UInt32 limit = lenTest2 + p->numFastBytes; ++ UInt32 nextRepMatchPrice; ++ if (limit > numAvailFull) ++ limit = numAvailFull; ++ for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++); ++ lenTest2 -= lenTest + 1; ++ if (lenTest2 >= 2) ++ { ++ UInt32 state2 = kMatchNextStates[state]; ++ UInt32 posStateNext = (position + lenTest) & p->pbMask; ++ UInt32 curAndLenCharPrice = curAndLenPrice + ++ GET_PRICE_0(p->isMatch[state2][posStateNext]) + ++ LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]), ++ data[lenTest], data2[lenTest], p->ProbPrices); ++ state2 = kLiteralNextStates[state2]; ++ posStateNext = (posStateNext + 1) & p->pbMask; ++ nextRepMatchPrice = curAndLenCharPrice + ++ GET_PRICE_1(p->isMatch[state2][posStateNext]) + ++ GET_PRICE_1(p->isRep[state2]); ++ ++ /* for (; lenTest2 >= 2; lenTest2--) */ ++ { ++ UInt32 offset = cur + lenTest + 1 + lenTest2; ++ UInt32 curAndLenPrice; ++ COptimal *opt; ++ while (lenEnd < offset) ++ p->opt[++lenEnd].price = kInfinityPrice; ++ curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); ++ opt = &p->opt[offset]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = cur + lenTest + 1; ++ opt->backPrev = 0; ++ opt->prev1IsChar = True; ++ opt->prev2 = True; ++ opt->posPrev2 = cur; ++ opt->backPrev2 = curBack + LZMA_NUM_REPS; ++ } ++ } ++ } ++ offs += 2; ++ if (offs == numPairs) ++ break; ++ curBack = matches[offs + 1]; ++ if (curBack >= kNumFullDistances) ++ GetPosSlot2(curBack, posSlot); ++ } ++ } ++ } ++ } ++} ++ ++#define ChangePair(smallDist, bigDist) (((bigDist) >> 7) > (smallDist)) ++ ++static UInt32 GetOptimumFast(CLzmaEnc *p, UInt32 *backRes) ++{ ++ UInt32 numAvail, mainLen, mainDist, numPairs, repIndex, repLen, i; ++ const Byte *data; ++ const UInt32 *matches; ++ ++ if (p->additionalOffset == 0) ++ mainLen = ReadMatchDistances(p, &numPairs); ++ else ++ { ++ mainLen = p->longestMatchLength; ++ numPairs = p->numPairs; ++ } ++ ++ numAvail = p->numAvail; ++ *backRes = (UInt32)-1; ++ if (numAvail < 2) ++ return 1; ++ if (numAvail > LZMA_MATCH_LEN_MAX) ++ numAvail = LZMA_MATCH_LEN_MAX; ++ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; ++ ++ repLen = repIndex = 0; ++ for (i = 0; i < LZMA_NUM_REPS; i++) ++ { ++ UInt32 len; ++ const Byte *data2 = data - (p->reps[i] + 1); ++ if (data[0] != data2[0] || data[1] != data2[1]) ++ continue; ++ for (len = 2; len < numAvail && data[len] == data2[len]; len++); ++ if (len >= p->numFastBytes) ++ { ++ *backRes = i; ++ MovePos(p, len - 1); ++ return len; ++ } ++ if (len > repLen) ++ { ++ repIndex = i; ++ repLen = len; ++ } ++ } ++ ++ matches = p->matches; ++ if (mainLen >= p->numFastBytes) ++ { ++ *backRes = matches[numPairs - 1] + LZMA_NUM_REPS; ++ MovePos(p, mainLen - 1); ++ return mainLen; ++ } ++ ++ mainDist = 0; /* for GCC */ ++ if (mainLen >= 2) ++ { ++ mainDist = matches[numPairs - 1]; ++ while (numPairs > 2 && mainLen == matches[numPairs - 4] + 1) ++ { ++ if (!ChangePair(matches[numPairs - 3], mainDist)) ++ break; ++ numPairs -= 2; ++ mainLen = matches[numPairs - 2]; ++ mainDist = matches[numPairs - 1]; ++ } ++ if (mainLen == 2 && mainDist >= 0x80) ++ mainLen = 1; ++ } ++ ++ if (repLen >= 2 && ( ++ (repLen + 1 >= mainLen) || ++ (repLen + 2 >= mainLen && mainDist >= (1 << 9)) || ++ (repLen + 3 >= mainLen && mainDist >= (1 << 15)))) ++ { ++ *backRes = repIndex; ++ MovePos(p, repLen - 1); ++ return repLen; ++ } ++ ++ if (mainLen < 2 || numAvail <= 2) ++ return 1; ++ ++ p->longestMatchLength = ReadMatchDistances(p, &p->numPairs); ++ if (p->longestMatchLength >= 2) ++ { ++ UInt32 newDistance = matches[p->numPairs - 1]; ++ if ((p->longestMatchLength >= mainLen && newDistance < mainDist) || ++ (p->longestMatchLength == mainLen + 1 && !ChangePair(mainDist, newDistance)) || ++ (p->longestMatchLength > mainLen + 1) || ++ (p->longestMatchLength + 1 >= mainLen && mainLen >= 3 && ChangePair(newDistance, mainDist))) ++ return 1; ++ } ++ ++ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; ++ for (i = 0; i < LZMA_NUM_REPS; i++) ++ { ++ UInt32 len, limit; ++ const Byte *data2 = data - (p->reps[i] + 1); ++ if (data[0] != data2[0] || data[1] != data2[1]) ++ continue; ++ limit = mainLen - 1; ++ for (len = 2; len < limit && data[len] == data2[len]; len++); ++ if (len >= limit) ++ return 1; ++ } ++ *backRes = mainDist + LZMA_NUM_REPS; ++ MovePos(p, mainLen - 2); ++ return mainLen; ++} ++ ++static void WriteEndMarker(CLzmaEnc *p, UInt32 posState) ++{ ++ UInt32 len; ++ RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1); ++ RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0); ++ p->state = kMatchNextStates[p->state]; ++ len = LZMA_MATCH_LEN_MIN; ++ LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); ++ RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, (1 << kNumPosSlotBits) - 1); ++ RangeEnc_EncodeDirectBits(&p->rc, (((UInt32)1 << 30) - 1) >> kNumAlignBits, 30 - kNumAlignBits); ++ RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, kAlignMask); ++} ++ ++static SRes CheckErrors(CLzmaEnc *p) ++{ ++ if (p->result != SZ_OK) ++ return p->result; ++ if (p->rc.res != SZ_OK) ++ p->result = SZ_ERROR_WRITE; ++ if (p->matchFinderBase.result != SZ_OK) ++ p->result = SZ_ERROR_READ; ++ if (p->result != SZ_OK) ++ p->finished = True; ++ return p->result; ++} ++ ++static SRes Flush(CLzmaEnc *p, UInt32 nowPos) ++{ ++ /* ReleaseMFStream(); */ ++ p->finished = True; ++ if (p->writeEndMark) ++ WriteEndMarker(p, nowPos & p->pbMask); ++ RangeEnc_FlushData(&p->rc); ++ RangeEnc_FlushStream(&p->rc); ++ return CheckErrors(p); ++} ++ ++static void FillAlignPrices(CLzmaEnc *p) ++{ ++ UInt32 i; ++ for (i = 0; i < kAlignTableSize; i++) ++ p->alignPrices[i] = RcTree_ReverseGetPrice(p->posAlignEncoder, kNumAlignBits, i, p->ProbPrices); ++ p->alignPriceCount = 0; ++} ++ ++static void FillDistancesPrices(CLzmaEnc *p) ++{ ++ UInt32 tempPrices[kNumFullDistances]; ++ UInt32 i, lenToPosState; ++ for (i = kStartPosModelIndex; i < kNumFullDistances; i++) ++ { ++ UInt32 posSlot = GetPosSlot1(i); ++ UInt32 footerBits = ((posSlot >> 1) - 1); ++ UInt32 base = ((2 | (posSlot & 1)) << footerBits); ++ tempPrices[i] = RcTree_ReverseGetPrice(p->posEncoders + base - posSlot - 1, footerBits, i - base, p->ProbPrices); ++ } ++ ++ for (lenToPosState = 0; lenToPosState < kNumLenToPosStates; lenToPosState++) ++ { ++ UInt32 posSlot; ++ const CLzmaProb *encoder = p->posSlotEncoder[lenToPosState]; ++ UInt32 *posSlotPrices = p->posSlotPrices[lenToPosState]; ++ for (posSlot = 0; posSlot < p->distTableSize; posSlot++) ++ posSlotPrices[posSlot] = RcTree_GetPrice(encoder, kNumPosSlotBits, posSlot, p->ProbPrices); ++ for (posSlot = kEndPosModelIndex; posSlot < p->distTableSize; posSlot++) ++ posSlotPrices[posSlot] += ((((posSlot >> 1) - 1) - kNumAlignBits) << kNumBitPriceShiftBits); ++ ++ { ++ UInt32 *distancesPrices = p->distancesPrices[lenToPosState]; ++ UInt32 i; ++ for (i = 0; i < kStartPosModelIndex; i++) ++ distancesPrices[i] = posSlotPrices[i]; ++ for (; i < kNumFullDistances; i++) ++ distancesPrices[i] = posSlotPrices[GetPosSlot1(i)] + tempPrices[i]; ++ } ++ } ++ p->matchPriceCount = 0; ++} ++ ++void LzmaEnc_Construct(CLzmaEnc *p) ++{ ++ RangeEnc_Construct(&p->rc); ++ MatchFinder_Construct(&p->matchFinderBase); ++ #ifndef _7ZIP_ST ++ MatchFinderMt_Construct(&p->matchFinderMt); ++ p->matchFinderMt.MatchFinder = &p->matchFinderBase; ++ #endif ++ ++ { ++ CLzmaEncProps props; ++ LzmaEncProps_Init(&props); ++ LzmaEnc_SetProps(p, &props); ++ } ++ ++ #ifndef LZMA_LOG_BSR ++ LzmaEnc_FastPosInit(p->g_FastPos); ++ #endif ++ ++ LzmaEnc_InitPriceTables(p->ProbPrices); ++ p->litProbs = 0; ++ p->saveState.litProbs = 0; ++} ++ ++CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc) ++{ ++ void *p; ++ p = alloc->Alloc(alloc, sizeof(CLzmaEnc)); ++ if (p != 0) ++ LzmaEnc_Construct((CLzmaEnc *)p); ++ return p; ++} ++ ++void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAlloc *alloc) ++{ ++ alloc->Free(alloc, p->litProbs); ++ alloc->Free(alloc, p->saveState.litProbs); ++ p->litProbs = 0; ++ p->saveState.litProbs = 0; ++} ++ ++void LzmaEnc_Destruct(CLzmaEnc *p, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ #ifndef _7ZIP_ST ++ MatchFinderMt_Destruct(&p->matchFinderMt, allocBig); ++ #endif ++ MatchFinder_Free(&p->matchFinderBase, allocBig); ++ LzmaEnc_FreeLits(p, alloc); ++ RangeEnc_Free(&p->rc, alloc); ++} ++ ++void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ LzmaEnc_Destruct((CLzmaEnc *)p, alloc, allocBig); ++ alloc->Free(alloc, p); ++} ++ ++static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, Bool useLimits, UInt32 maxPackSize, UInt32 maxUnpackSize) ++{ ++ UInt32 nowPos32, startPos32; ++ if (p->needInit) ++ { ++ p->matchFinder.Init(p->matchFinderObj); ++ p->needInit = 0; ++ } ++ ++ if (p->finished) ++ return p->result; ++ RINOK(CheckErrors(p)); ++ ++ nowPos32 = (UInt32)p->nowPos64; ++ startPos32 = nowPos32; ++ ++ if (p->nowPos64 == 0) ++ { ++ UInt32 numPairs; ++ Byte curByte; ++ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0) ++ return Flush(p, nowPos32); ++ ReadMatchDistances(p, &numPairs); ++ RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][0], 0); ++ p->state = kLiteralNextStates[p->state]; ++ curByte = p->matchFinder.GetIndexByte(p->matchFinderObj, 0 - p->additionalOffset); ++ LitEnc_Encode(&p->rc, p->litProbs, curByte); ++ p->additionalOffset--; ++ nowPos32++; ++ } ++ ++ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) != 0) ++ for (;;) ++ { ++ UInt32 pos, len, posState; ++ ++ if (p->fastMode) ++ len = GetOptimumFast(p, &pos); ++ else ++ len = GetOptimum(p, nowPos32, &pos); ++ ++ #ifdef SHOW_STAT2 ++ printf("\n pos = %4X, len = %d pos = %d", nowPos32, len, pos); ++ #endif ++ ++ posState = nowPos32 & p->pbMask; ++ if (len == 1 && pos == (UInt32)-1) ++ { ++ Byte curByte; ++ CLzmaProb *probs; ++ const Byte *data; ++ ++ RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 0); ++ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; ++ curByte = *data; ++ probs = LIT_PROBS(nowPos32, *(data - 1)); ++ if (IsCharState(p->state)) ++ LitEnc_Encode(&p->rc, probs, curByte); ++ else ++ LitEnc_EncodeMatched(&p->rc, probs, curByte, *(data - p->reps[0] - 1)); ++ p->state = kLiteralNextStates[p->state]; ++ } ++ else ++ { ++ RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1); ++ if (pos < LZMA_NUM_REPS) ++ { ++ RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 1); ++ if (pos == 0) ++ { ++ RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 0); ++ RangeEnc_EncodeBit(&p->rc, &p->isRep0Long[p->state][posState], ((len == 1) ? 0 : 1)); ++ } ++ else ++ { ++ UInt32 distance = p->reps[pos]; ++ RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 1); ++ if (pos == 1) ++ RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 0); ++ else ++ { ++ RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 1); ++ RangeEnc_EncodeBit(&p->rc, &p->isRepG2[p->state], pos - 2); ++ if (pos == 3) ++ p->reps[3] = p->reps[2]; ++ p->reps[2] = p->reps[1]; ++ } ++ p->reps[1] = p->reps[0]; ++ p->reps[0] = distance; ++ } ++ if (len == 1) ++ p->state = kShortRepNextStates[p->state]; ++ else ++ { ++ LenEnc_Encode2(&p->repLenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); ++ p->state = kRepNextStates[p->state]; ++ } ++ } ++ else ++ { ++ UInt32 posSlot; ++ RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0); ++ p->state = kMatchNextStates[p->state]; ++ LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); ++ pos -= LZMA_NUM_REPS; ++ GetPosSlot(pos, posSlot); ++ RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, posSlot); ++ ++ if (posSlot >= kStartPosModelIndex) ++ { ++ UInt32 footerBits = ((posSlot >> 1) - 1); ++ UInt32 base = ((2 | (posSlot & 1)) << footerBits); ++ UInt32 posReduced = pos - base; ++ ++ if (posSlot < kEndPosModelIndex) ++ RcTree_ReverseEncode(&p->rc, p->posEncoders + base - posSlot - 1, footerBits, posReduced); ++ else ++ { ++ RangeEnc_EncodeDirectBits(&p->rc, posReduced >> kNumAlignBits, footerBits - kNumAlignBits); ++ RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, posReduced & kAlignMask); ++ p->alignPriceCount++; ++ } ++ } ++ p->reps[3] = p->reps[2]; ++ p->reps[2] = p->reps[1]; ++ p->reps[1] = p->reps[0]; ++ p->reps[0] = pos; ++ p->matchPriceCount++; ++ } ++ } ++ p->additionalOffset -= len; ++ nowPos32 += len; ++ if (p->additionalOffset == 0) ++ { ++ UInt32 processed; ++ if (!p->fastMode) ++ { ++ if (p->matchPriceCount >= (1 << 7)) ++ FillDistancesPrices(p); ++ if (p->alignPriceCount >= kAlignTableSize) ++ FillAlignPrices(p); ++ } ++ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0) ++ break; ++ processed = nowPos32 - startPos32; ++ if (useLimits) ++ { ++ if (processed + kNumOpts + 300 >= maxUnpackSize || ++ RangeEnc_GetProcessed(&p->rc) + kNumOpts * 2 >= maxPackSize) ++ break; ++ } ++ else if (processed >= (1 << 15)) ++ { ++ p->nowPos64 += nowPos32 - startPos32; ++ return CheckErrors(p); ++ } ++ } ++ } ++ p->nowPos64 += nowPos32 - startPos32; ++ return Flush(p, nowPos32); ++} ++ ++#define kBigHashDicLimit ((UInt32)1 << 24) ++ ++static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ UInt32 beforeSize = kNumOpts; ++ Bool btMode; ++ if (!RangeEnc_Alloc(&p->rc, alloc)) ++ return SZ_ERROR_MEM; ++ btMode = (p->matchFinderBase.btMode != 0); ++ #ifndef _7ZIP_ST ++ p->mtMode = (p->multiThread && !p->fastMode && btMode); ++ #endif ++ ++ { ++ unsigned lclp = p->lc + p->lp; ++ if (p->litProbs == 0 || p->saveState.litProbs == 0 || p->lclp != lclp) ++ { ++ LzmaEnc_FreeLits(p, alloc); ++ p->litProbs = (CLzmaProb *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(CLzmaProb)); ++ p->saveState.litProbs = (CLzmaProb *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(CLzmaProb)); ++ if (p->litProbs == 0 || p->saveState.litProbs == 0) ++ { ++ LzmaEnc_FreeLits(p, alloc); ++ return SZ_ERROR_MEM; ++ } ++ p->lclp = lclp; ++ } ++ } ++ ++ p->matchFinderBase.bigHash = (p->dictSize > kBigHashDicLimit); ++ ++ if (beforeSize + p->dictSize < keepWindowSize) ++ beforeSize = keepWindowSize - p->dictSize; ++ ++ #ifndef _7ZIP_ST ++ if (p->mtMode) ++ { ++ RINOK(MatchFinderMt_Create(&p->matchFinderMt, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig)); ++ p->matchFinderObj = &p->matchFinderMt; ++ MatchFinderMt_CreateVTable(&p->matchFinderMt, &p->matchFinder); ++ } ++ else ++ #endif ++ { ++ if (!MatchFinder_Create(&p->matchFinderBase, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig)) ++ return SZ_ERROR_MEM; ++ p->matchFinderObj = &p->matchFinderBase; ++ MatchFinder_CreateVTable(&p->matchFinderBase, &p->matchFinder); ++ } ++ return SZ_OK; ++} ++ ++void LzmaEnc_Init(CLzmaEnc *p) ++{ ++ UInt32 i; ++ p->state = 0; ++ for (i = 0 ; i < LZMA_NUM_REPS; i++) ++ p->reps[i] = 0; ++ ++ RangeEnc_Init(&p->rc); ++ ++ ++ for (i = 0; i < kNumStates; i++) ++ { ++ UInt32 j; ++ for (j = 0; j < LZMA_NUM_PB_STATES_MAX; j++) ++ { ++ p->isMatch[i][j] = kProbInitValue; ++ p->isRep0Long[i][j] = kProbInitValue; ++ } ++ p->isRep[i] = kProbInitValue; ++ p->isRepG0[i] = kProbInitValue; ++ p->isRepG1[i] = kProbInitValue; ++ p->isRepG2[i] = kProbInitValue; ++ } ++ ++ { ++ UInt32 num = 0x300 << (p->lp + p->lc); ++ for (i = 0; i < num; i++) ++ p->litProbs[i] = kProbInitValue; ++ } ++ ++ { ++ for (i = 0; i < kNumLenToPosStates; i++) ++ { ++ CLzmaProb *probs = p->posSlotEncoder[i]; ++ UInt32 j; ++ for (j = 0; j < (1 << kNumPosSlotBits); j++) ++ probs[j] = kProbInitValue; ++ } ++ } ++ { ++ for (i = 0; i < kNumFullDistances - kEndPosModelIndex; i++) ++ p->posEncoders[i] = kProbInitValue; ++ } ++ ++ LenEnc_Init(&p->lenEnc.p); ++ LenEnc_Init(&p->repLenEnc.p); ++ ++ for (i = 0; i < (1 << kNumAlignBits); i++) ++ p->posAlignEncoder[i] = kProbInitValue; ++ ++ p->optimumEndIndex = 0; ++ p->optimumCurrentIndex = 0; ++ p->additionalOffset = 0; ++ ++ p->pbMask = (1 << p->pb) - 1; ++ p->lpMask = (1 << p->lp) - 1; ++} ++ ++void LzmaEnc_InitPrices(CLzmaEnc *p) ++{ ++ if (!p->fastMode) ++ { ++ FillDistancesPrices(p); ++ FillAlignPrices(p); ++ } ++ ++ p->lenEnc.tableSize = ++ p->repLenEnc.tableSize = ++ p->numFastBytes + 1 - LZMA_MATCH_LEN_MIN; ++ LenPriceEnc_UpdateTables(&p->lenEnc, 1 << p->pb, p->ProbPrices); ++ LenPriceEnc_UpdateTables(&p->repLenEnc, 1 << p->pb, p->ProbPrices); ++} ++ ++static SRes LzmaEnc_AllocAndInit(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ UInt32 i; ++ for (i = 0; i < (UInt32)kDicLogSizeMaxCompress; i++) ++ if (p->dictSize <= ((UInt32)1 << i)) ++ break; ++ p->distTableSize = i * 2; ++ ++ p->finished = False; ++ p->result = SZ_OK; ++ RINOK(LzmaEnc_Alloc(p, keepWindowSize, alloc, allocBig)); ++ LzmaEnc_Init(p); ++ LzmaEnc_InitPrices(p); ++ p->nowPos64 = 0; ++ return SZ_OK; ++} ++ ++static SRes LzmaEnc_Prepare(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ++ ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ p->matchFinderBase.stream = inStream; ++ p->needInit = 1; ++ p->rc.outStream = outStream; ++ return LzmaEnc_AllocAndInit(p, 0, alloc, allocBig); ++} ++ ++SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp, ++ ISeqInStream *inStream, UInt32 keepWindowSize, ++ ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ p->matchFinderBase.stream = inStream; ++ p->needInit = 1; ++ return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); ++} ++ ++static void LzmaEnc_SetInputBuf(CLzmaEnc *p, const Byte *src, SizeT srcLen) ++{ ++ p->matchFinderBase.directInput = 1; ++ p->matchFinderBase.bufferBase = (Byte *)src; ++ p->matchFinderBase.directInputRem = srcLen; ++} ++ ++SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen, ++ UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ LzmaEnc_SetInputBuf(p, src, srcLen); ++ p->needInit = 1; ++ ++ return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); ++} ++ ++void LzmaEnc_Finish(CLzmaEncHandle pp) ++{ ++ #ifndef _7ZIP_ST ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ if (p->mtMode) ++ MatchFinderMt_ReleaseStream(&p->matchFinderMt); ++ #else ++ pp = pp; ++ #endif ++} ++ ++typedef struct ++{ ++ ISeqOutStream funcTable; ++ Byte *data; ++ SizeT rem; ++ Bool overflow; ++} CSeqOutStreamBuf; ++ ++static size_t MyWrite(void *pp, const void *data, size_t size) ++{ ++ CSeqOutStreamBuf *p = (CSeqOutStreamBuf *)pp; ++ if (p->rem < size) ++ { ++ size = p->rem; ++ p->overflow = True; ++ } ++ memcpy(p->data, data, size); ++ p->rem -= size; ++ p->data += size; ++ return size; ++} ++ ++ ++UInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle pp) ++{ ++ const CLzmaEnc *p = (CLzmaEnc *)pp; ++ return p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); ++} ++ ++const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp) ++{ ++ const CLzmaEnc *p = (CLzmaEnc *)pp; ++ return p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; ++} ++ ++SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit, ++ Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ UInt64 nowPos64; ++ SRes res; ++ CSeqOutStreamBuf outStream; ++ ++ outStream.funcTable.Write = MyWrite; ++ outStream.data = dest; ++ outStream.rem = *destLen; ++ outStream.overflow = False; ++ ++ p->writeEndMark = False; ++ p->finished = False; ++ p->result = SZ_OK; ++ ++ if (reInit) ++ LzmaEnc_Init(p); ++ LzmaEnc_InitPrices(p); ++ nowPos64 = p->nowPos64; ++ RangeEnc_Init(&p->rc); ++ p->rc.outStream = &outStream.funcTable; ++ ++ res = LzmaEnc_CodeOneBlock(p, True, desiredPackSize, *unpackSize); ++ ++ *unpackSize = (UInt32)(p->nowPos64 - nowPos64); ++ *destLen -= outStream.rem; ++ if (outStream.overflow) ++ return SZ_ERROR_OUTPUT_EOF; ++ ++ return res; ++} ++ ++static SRes LzmaEnc_Encode2(CLzmaEnc *p, ICompressProgress *progress) ++{ ++ SRes res = SZ_OK; ++ ++ #ifndef _7ZIP_ST ++ Byte allocaDummy[0x300]; ++ int i = 0; ++ for (i = 0; i < 16; i++) ++ allocaDummy[i] = (Byte)i; ++ #endif ++ ++ for (;;) ++ { ++ res = LzmaEnc_CodeOneBlock(p, False, 0, 0); ++ if (res != SZ_OK || p->finished != 0) ++ break; ++ if (progress != 0) ++ { ++ res = progress->Progress(progress, p->nowPos64, RangeEnc_GetProcessed(&p->rc)); ++ if (res != SZ_OK) ++ { ++ res = SZ_ERROR_PROGRESS; ++ break; ++ } ++ } ++ } ++ LzmaEnc_Finish(p); ++ return res; ++} ++ ++SRes LzmaEnc_Encode(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress, ++ ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ RINOK(LzmaEnc_Prepare(pp, outStream, inStream, alloc, allocBig)); ++ return LzmaEnc_Encode2((CLzmaEnc *)pp, progress); ++} ++ ++SRes LzmaEnc_WriteProperties(CLzmaEncHandle pp, Byte *props, SizeT *size) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ int i; ++ UInt32 dictSize = p->dictSize; ++ if (*size < LZMA_PROPS_SIZE) ++ return SZ_ERROR_PARAM; ++ *size = LZMA_PROPS_SIZE; ++ props[0] = (Byte)((p->pb * 5 + p->lp) * 9 + p->lc); ++ ++ for (i = 11; i <= 30; i++) ++ { ++ if (dictSize <= ((UInt32)2 << i)) ++ { ++ dictSize = (2 << i); ++ break; ++ } ++ if (dictSize <= ((UInt32)3 << i)) ++ { ++ dictSize = (3 << i); ++ break; ++ } ++ } ++ ++ for (i = 0; i < 4; i++) ++ props[1 + i] = (Byte)(dictSize >> (8 * i)); ++ return SZ_OK; ++} ++ ++SRes LzmaEnc_MemEncode(CLzmaEncHandle pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, ++ int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ SRes res; ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ ++ CSeqOutStreamBuf outStream; ++ ++ LzmaEnc_SetInputBuf(p, src, srcLen); ++ ++ outStream.funcTable.Write = MyWrite; ++ outStream.data = dest; ++ outStream.rem = *destLen; ++ outStream.overflow = False; ++ ++ p->writeEndMark = writeEndMark; ++ ++ p->rc.outStream = &outStream.funcTable; ++ res = LzmaEnc_MemPrepare(pp, src, srcLen, 0, alloc, allocBig); ++ if (res == SZ_OK) ++ res = LzmaEnc_Encode2(p, progress); ++ ++ *destLen -= outStream.rem; ++ if (outStream.overflow) ++ return SZ_ERROR_OUTPUT_EOF; ++ return res; ++} ++ ++SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, ++ const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, ++ ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)LzmaEnc_Create(alloc); ++ SRes res; ++ if (p == 0) ++ return SZ_ERROR_MEM; ++ ++ res = LzmaEnc_SetProps(p, props); ++ if (res == SZ_OK) ++ { ++ res = LzmaEnc_WriteProperties(p, propsEncoded, propsSize); ++ if (res == SZ_OK) ++ res = LzmaEnc_MemEncode(p, dest, destLen, src, srcLen, ++ writeEndMark, progress, alloc, allocBig); ++ } ++ ++ LzmaEnc_Destroy(p, alloc, allocBig); ++ return res; ++} +--- /dev/null ++++ b/lib/lzma/Makefile +@@ -0,0 +1,7 @@ ++lzma_compress-objs := LzFind.o LzmaEnc.o ++lzma_decompress-objs := LzmaDec.o ++ ++obj-$(CONFIG_LZMA_COMPRESS) += lzma_compress.o ++obj-$(CONFIG_LZMA_DECOMPRESS) += lzma_decompress.o ++ ++EXTRA_CFLAGS += -Iinclude/linux -Iinclude/linux/lzma -include types.h diff --git a/target/linux/generic/pending-4.14/532-jffs2_eofdetect.patch b/target/linux/generic/pending-4.14/532-jffs2_eofdetect.patch new file mode 100644 index 0000000000..e9952c6d84 --- /dev/null +++ b/target/linux/generic/pending-4.14/532-jffs2_eofdetect.patch @@ -0,0 +1,65 @@ +From: Felix Fietkau +Subject: fs: jffs2: EOF marker + +Signed-off-by: Felix Fietkau +--- + fs/jffs2/build.c | 10 ++++++++++ + fs/jffs2/scan.c | 21 +++++++++++++++++++-- + 2 files changed, 29 insertions(+), 2 deletions(-) + +--- a/fs/jffs2/build.c ++++ b/fs/jffs2/build.c +@@ -117,6 +117,16 @@ static int jffs2_build_filesystem(struct + dbg_fsbuild("scanned flash completely\n"); + jffs2_dbg_dump_block_lists_nolock(c); + ++ if (c->flags & (1 << 7)) { ++ printk("%s(): unlocking the mtd device... ", __func__); ++ mtd_unlock(c->mtd, 0, c->mtd->size); ++ printk("done.\n"); ++ ++ printk("%s(): erasing all blocks after the end marker... ", __func__); ++ jffs2_erase_pending_blocks(c, -1); ++ printk("done.\n"); ++ } ++ + dbg_fsbuild("pass 1 starting\n"); + c->flags |= JFFS2_SB_FLAG_BUILDING; + /* Now scan the directory tree, increasing nlink according to every dirent found. */ +--- a/fs/jffs2/scan.c ++++ b/fs/jffs2/scan.c +@@ -148,8 +148,14 @@ int jffs2_scan_medium(struct jffs2_sb_in + /* reset summary info for next eraseblock scan */ + jffs2_sum_reset_collected(s); + +- ret = jffs2_scan_eraseblock(c, jeb, buf_size?flashbuf:(flashbuf+jeb->offset), +- buf_size, s); ++ if (c->flags & (1 << 7)) { ++ if (mtd_block_isbad(c->mtd, jeb->offset)) ++ ret = BLK_STATE_BADBLOCK; ++ else ++ ret = BLK_STATE_ALLFF; ++ } else ++ ret = jffs2_scan_eraseblock(c, jeb, buf_size?flashbuf:(flashbuf+jeb->offset), ++ buf_size, s); + + if (ret < 0) + goto out; +@@ -561,6 +567,17 @@ full_scan: + return err; + } + ++ if ((buf[0] == 0xde) && ++ (buf[1] == 0xad) && ++ (buf[2] == 0xc0) && ++ (buf[3] == 0xde)) { ++ /* end of filesystem. erase everything after this point */ ++ printk("%s(): End of filesystem marker found at 0x%x\n", __func__, jeb->offset); ++ c->flags |= (1 << 7); ++ ++ return BLK_STATE_ALLFF; ++ } ++ + /* We temporarily use 'ofs' as a pointer into the buffer/jeb */ + ofs = 0; + max_ofs = EMPTY_SCAN_SIZE(c->sector_size); diff --git a/target/linux/generic/pending-4.14/551-ubifs-fix-default-compression-selection.patch b/target/linux/generic/pending-4.14/551-ubifs-fix-default-compression-selection.patch new file mode 100644 index 0000000000..4782fc9ed8 --- /dev/null +++ b/target/linux/generic/pending-4.14/551-ubifs-fix-default-compression-selection.patch @@ -0,0 +1,37 @@ +From: Gabor Juhos +Subject: fs: ubifs: fix default compression selection in ubifs + +Signed-off-by: Gabor Juhos +--- + fs/ubifs/sb.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +--- a/fs/ubifs/sb.c ++++ b/fs/ubifs/sb.c +@@ -63,6 +63,17 @@ + /* Default time granularity in nanoseconds */ + #define DEFAULT_TIME_GRAN 1000000000 + ++static int get_default_compressor(void) ++{ ++ if (ubifs_compr_present(UBIFS_COMPR_LZO)) ++ return UBIFS_COMPR_LZO; ++ ++ if (ubifs_compr_present(UBIFS_COMPR_ZLIB)) ++ return UBIFS_COMPR_ZLIB; ++ ++ return UBIFS_COMPR_NONE; ++} ++ + /** + * create_default_filesystem - format empty UBI volume. + * @c: UBIFS file-system description object +@@ -186,7 +197,7 @@ static int create_default_filesystem(str + if (c->mount_opts.override_compr) + sup->default_compr = cpu_to_le16(c->mount_opts.compr_type); + else +- sup->default_compr = cpu_to_le16(UBIFS_COMPR_LZO); ++ sup->default_compr = cpu_to_le16(get_default_compressor()); + + generate_random_uuid(sup->uuid); + diff --git a/target/linux/generic/pending-4.14/600-netfilter_conntrack_flush.patch b/target/linux/generic/pending-4.14/600-netfilter_conntrack_flush.patch new file mode 100644 index 0000000000..f39ed62dc0 --- /dev/null +++ b/target/linux/generic/pending-4.14/600-netfilter_conntrack_flush.patch @@ -0,0 +1,95 @@ +From: Felix Fietkau +Subject: netfilter: add support for flushing conntrack via /proc + +lede-commit 8193bbe59a74d34d6a26d4a8cb857b1952905314 +Signed-off-by: Felix Fietkau +--- + net/netfilter/nf_conntrack_standalone.c | 59 ++++++++++++++++++++++++++++++++- + 1 file changed, 58 insertions(+), 1 deletion(-) + +--- a/net/netfilter/nf_conntrack_standalone.c ++++ b/net/netfilter/nf_conntrack_standalone.c +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + #include + #ifdef CONFIG_SYSCTL + #include +@@ -377,10 +378,66 @@ static int ct_open(struct inode *inode, + sizeof(struct ct_iter_state)); + } + ++struct kill_request { ++ u16 family; ++ union nf_inet_addr addr; ++}; ++ ++static int kill_matching(struct nf_conn *i, void *data) ++{ ++ struct kill_request *kr = data; ++ struct nf_conntrack_tuple *t1 = &i->tuplehash[IP_CT_DIR_ORIGINAL].tuple; ++ struct nf_conntrack_tuple *t2 = &i->tuplehash[IP_CT_DIR_REPLY].tuple; ++ ++ if (!kr->family) ++ return 1; ++ ++ if (t1->src.l3num != kr->family) ++ return 0; ++ ++ return (nf_inet_addr_cmp(&kr->addr, &t1->src.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t1->dst.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t2->src.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t2->dst.u3)); ++} ++ ++static ssize_t ct_file_write(struct file *file, const char __user *buf, ++ size_t count, loff_t *ppos) ++{ ++ struct seq_file *seq = file->private_data; ++ struct net *net = seq_file_net(seq); ++ struct kill_request kr = { }; ++ char req[INET6_ADDRSTRLEN] = { }; ++ ++ if (count == 0) ++ return 0; ++ ++ if (count >= INET6_ADDRSTRLEN) ++ count = INET6_ADDRSTRLEN - 1; ++ ++ if (copy_from_user(req, buf, count)) ++ return -EFAULT; ++ ++ if (strnchr(req, count, ':')) { ++ kr.family = AF_INET6; ++ if (!in6_pton(req, count, (void *)&kr.addr, '\n', NULL)) ++ return -EINVAL; ++ } else if (strnchr(req, count, '.')) { ++ kr.family = AF_INET; ++ if (!in4_pton(req, count, (void *)&kr.addr, '\n', NULL)) ++ return -EINVAL; ++ } ++ ++ nf_ct_iterate_cleanup_net(net, kill_matching, &kr, 0, 0); ++ ++ return count; ++} ++ + static const struct file_operations ct_file_ops = { + .owner = THIS_MODULE, + .open = ct_open, + .read = seq_read, ++ .write = ct_file_write, + .llseek = seq_lseek, + .release = seq_release_net, + }; +@@ -484,7 +541,7 @@ static int nf_conntrack_standalone_init_ + kuid_t root_uid; + kgid_t root_gid; + +- pde = proc_create("nf_conntrack", 0440, net->proc_net, &ct_file_ops); ++ pde = proc_create("nf_conntrack", 0660, net->proc_net, &ct_file_ops); + if (!pde) + goto out_nf_conntrack; + diff --git a/target/linux/generic/pending-4.14/610-netfilter_match_bypass_default_checks.patch b/target/linux/generic/pending-4.14/610-netfilter_match_bypass_default_checks.patch new file mode 100644 index 0000000000..0a3c0f9677 --- /dev/null +++ b/target/linux/generic/pending-4.14/610-netfilter_match_bypass_default_checks.patch @@ -0,0 +1,110 @@ +From: Felix Fietkau +Subject: kernel: add a new version of my netfilter speedup patches for linux 2.6.39 and 3.0 + +Signed-off-by: Felix Fietkau +--- + include/uapi/linux/netfilter_ipv4/ip_tables.h | 1 + + net/ipv4/netfilter/ip_tables.c | 37 +++++++++++++++++++++++++++ + 2 files changed, 38 insertions(+) + +--- a/include/uapi/linux/netfilter_ipv4/ip_tables.h ++++ b/include/uapi/linux/netfilter_ipv4/ip_tables.h +@@ -89,6 +89,7 @@ struct ipt_ip { + #define IPT_F_FRAG 0x01 /* Set if rule is a fragment rule */ + #define IPT_F_GOTO 0x02 /* Set if jump is a goto */ + #define IPT_F_MASK 0x03 /* All possible flag bits mask. */ ++#define IPT_F_NO_DEF_MATCH 0x80 /* Internal: no default match rules present */ + + /* Values for "inv" field in struct ipt_ip. */ + #define IPT_INV_VIA_IN 0x01 /* Invert the sense of IN IFACE. */ +--- a/net/ipv4/netfilter/ip_tables.c ++++ b/net/ipv4/netfilter/ip_tables.c +@@ -52,6 +52,9 @@ ip_packet_match(const struct iphdr *ip, + { + unsigned long ret; + ++ if (ipinfo->flags & IPT_F_NO_DEF_MATCH) ++ return true; ++ + if (NF_INVF(ipinfo, IPT_INV_SRCIP, + (ip->saddr & ipinfo->smsk.s_addr) != ipinfo->src.s_addr) || + NF_INVF(ipinfo, IPT_INV_DSTIP, +@@ -82,6 +85,29 @@ ip_packet_match(const struct iphdr *ip, + return true; + } + ++static void ++ip_checkdefault(struct ipt_ip *ip) ++{ ++ static const char iface_mask[IFNAMSIZ] = {}; ++ ++ if (ip->invflags || ip->flags & IPT_F_FRAG) ++ return; ++ ++ if (memcmp(ip->iniface_mask, iface_mask, IFNAMSIZ) != 0) ++ return; ++ ++ if (memcmp(ip->outiface_mask, iface_mask, IFNAMSIZ) != 0) ++ return; ++ ++ if (ip->smsk.s_addr || ip->dmsk.s_addr) ++ return; ++ ++ if (ip->proto) ++ return; ++ ++ ip->flags |= IPT_F_NO_DEF_MATCH; ++} ++ + static bool + ip_checkentry(const struct ipt_ip *ip) + { +@@ -532,6 +558,8 @@ find_check_entry(struct ipt_entry *e, st + struct xt_mtchk_param mtpar; + struct xt_entry_match *ematch; + ++ ip_checkdefault(&e->ip); ++ + if (!xt_percpu_counter_alloc(alloc_state, &e->counters)) + return -ENOMEM; + +@@ -812,6 +840,7 @@ copy_entries_to_user(unsigned int total_ + const struct xt_table_info *private = table->private; + int ret = 0; + const void *loc_cpu_entry; ++ u8 flags; + + counters = alloc_counters(table); + if (IS_ERR(counters)) +@@ -839,6 +868,14 @@ copy_entries_to_user(unsigned int total_ + goto free_counters; + } + ++ flags = e->ip.flags & IPT_F_MASK; ++ if (copy_to_user(userptr + off ++ + offsetof(struct ipt_entry, ip.flags), ++ &flags, sizeof(flags)) != 0) { ++ ret = -EFAULT; ++ goto free_counters; ++ } ++ + for (i = sizeof(struct ipt_entry); + i < e->target_offset; + i += m->u.match_size) { +@@ -1219,12 +1256,15 @@ compat_copy_entry_to_user(struct ipt_ent + compat_uint_t origsize; + const struct xt_entry_match *ematch; + int ret = 0; ++ u8 flags = e->ip.flags & IPT_F_MASK; + + origsize = *size; + ce = *dstptr; + if (copy_to_user(ce, e, sizeof(struct ipt_entry)) != 0 || + copy_to_user(&ce->counters, &counters[i], +- sizeof(counters[i])) != 0) ++ sizeof(counters[i])) != 0 || ++ copy_to_user(&ce->ip.flags, &flags, ++ sizeof(flags)) != 0) + return -EFAULT; + + *dstptr += sizeof(struct compat_ipt_entry); diff --git a/target/linux/generic/pending-4.14/611-netfilter_match_bypass_default_table.patch b/target/linux/generic/pending-4.14/611-netfilter_match_bypass_default_table.patch new file mode 100644 index 0000000000..11f07e12b3 --- /dev/null +++ b/target/linux/generic/pending-4.14/611-netfilter_match_bypass_default_table.patch @@ -0,0 +1,111 @@ +From: Felix Fietkau +Subject: netfilter: match bypass default table + +Signed-off-by: Felix Fietkau +--- + net/ipv4/netfilter/ip_tables.c | 79 +++++++++++++++++++++++++++++++----------- + 1 file changed, 58 insertions(+), 21 deletions(-) + +--- a/net/ipv4/netfilter/ip_tables.c ++++ b/net/ipv4/netfilter/ip_tables.c +@@ -248,6 +248,33 @@ struct ipt_entry *ipt_next_entry(const s + return (void *)entry + entry->next_offset; + } + ++static bool ++ipt_handle_default_rule(struct ipt_entry *e, unsigned int *verdict) ++{ ++ struct xt_entry_target *t; ++ struct xt_standard_target *st; ++ ++ if (e->target_offset != sizeof(struct ipt_entry)) ++ return false; ++ ++ if (!(e->ip.flags & IPT_F_NO_DEF_MATCH)) ++ return false; ++ ++ t = ipt_get_target(e); ++ if (t->u.kernel.target->target) ++ return false; ++ ++ st = (struct xt_standard_target *) t; ++ if (st->verdict == XT_RETURN) ++ return false; ++ ++ if (st->verdict >= 0) ++ return false; ++ ++ *verdict = (unsigned)(-st->verdict) - 1; ++ return true; ++} ++ + /* Returns one of the generic firewall policies, like NF_ACCEPT. */ + unsigned int + ipt_do_table(struct sk_buff *skb, +@@ -268,24 +295,8 @@ ipt_do_table(struct sk_buff *skb, + unsigned int addend; + + /* Initialization */ +- stackidx = 0; +- ip = ip_hdr(skb); +- indev = state->in ? state->in->name : nulldevname; +- outdev = state->out ? state->out->name : nulldevname; +- /* We handle fragments by dealing with the first fragment as +- * if it was a normal packet. All other fragments are treated +- * normally, except that they will NEVER match rules that ask +- * things we don't know, ie. tcp syn flag or ports). If the +- * rule is also a fragment-specific rule, non-fragments won't +- * match it. */ +- acpar.fragoff = ntohs(ip->frag_off) & IP_OFFSET; +- acpar.thoff = ip_hdrlen(skb); +- acpar.hotdrop = false; +- acpar.state = state; +- + WARN_ON(!(table->valid_hooks & (1 << hook))); + local_bh_disable(); +- addend = xt_write_recseq_begin(); + private = table->private; + cpu = smp_processor_id(); + /* +@@ -294,6 +305,23 @@ ipt_do_table(struct sk_buff *skb, + */ + smp_read_barrier_depends(); + table_base = private->entries; ++ ++ e = get_entry(table_base, private->hook_entry[hook]); ++ if (ipt_handle_default_rule(e, &verdict)) { ++ struct xt_counters *counter; ++ ++ counter = xt_get_this_cpu_counter(&e->counters); ++ ADD_COUNTER(*counter, skb->len, 1); ++ local_bh_enable(); ++ return verdict; ++ } ++ ++ stackidx = 0; ++ ip = ip_hdr(skb); ++ indev = state->in ? state->in->name : nulldevname; ++ outdev = state->out ? state->out->name : nulldevname; ++ ++ addend = xt_write_recseq_begin(); + jumpstack = (struct ipt_entry **)private->jumpstack[cpu]; + + /* Switch to alternate jumpstack if we're being invoked via TEE. +@@ -306,7 +334,16 @@ ipt_do_table(struct sk_buff *skb, + if (static_key_false(&xt_tee_enabled)) + jumpstack += private->stacksize * __this_cpu_read(nf_skb_duplicated); + +- e = get_entry(table_base, private->hook_entry[hook]); ++ /* We handle fragments by dealing with the first fragment as ++ * if it was a normal packet. All other fragments are treated ++ * normally, except that they will NEVER match rules that ask ++ * things we don't know, ie. tcp syn flag or ports). If the ++ * rule is also a fragment-specific rule, non-fragments won't ++ * match it. */ ++ acpar.fragoff = ntohs(ip->frag_off) & IP_OFFSET; ++ acpar.thoff = ip_hdrlen(skb); ++ acpar.hotdrop = false; ++ acpar.state = state; + + do { + const struct xt_entry_target *t; diff --git a/target/linux/generic/pending-4.14/612-netfilter_match_reduce_memory_access.patch b/target/linux/generic/pending-4.14/612-netfilter_match_reduce_memory_access.patch new file mode 100644 index 0000000000..183c74c1c7 --- /dev/null +++ b/target/linux/generic/pending-4.14/612-netfilter_match_reduce_memory_access.patch @@ -0,0 +1,22 @@ +From: Felix Fietkau +Subject: netfilter: reduce match memory access + +Signed-off-by: Felix Fietkau +--- + net/ipv4/netfilter/ip_tables.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/net/ipv4/netfilter/ip_tables.c ++++ b/net/ipv4/netfilter/ip_tables.c +@@ -55,9 +55,9 @@ ip_packet_match(const struct iphdr *ip, + if (ipinfo->flags & IPT_F_NO_DEF_MATCH) + return true; + +- if (NF_INVF(ipinfo, IPT_INV_SRCIP, ++ if (NF_INVF(ipinfo, IPT_INV_SRCIP, ipinfo->smsk.s_addr && + (ip->saddr & ipinfo->smsk.s_addr) != ipinfo->src.s_addr) || +- NF_INVF(ipinfo, IPT_INV_DSTIP, ++ NF_INVF(ipinfo, IPT_INV_DSTIP, ipinfo->dmsk.s_addr && + (ip->daddr & ipinfo->dmsk.s_addr) != ipinfo->dst.s_addr)) + return false; + diff --git a/target/linux/generic/pending-4.14/613-netfilter_optional_tcp_window_check.patch b/target/linux/generic/pending-4.14/613-netfilter_optional_tcp_window_check.patch new file mode 100644 index 0000000000..3ded90168f --- /dev/null +++ b/target/linux/generic/pending-4.14/613-netfilter_optional_tcp_window_check.patch @@ -0,0 +1,44 @@ +From: Felix Fietkau +Subject: netfilter: optional tcp window check + +Signed-off-by: Felix Fietkau +--- + net/netfilter/nf_conntrack_proto_tcp.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +--- a/net/netfilter/nf_conntrack_proto_tcp.c ++++ b/net/netfilter/nf_conntrack_proto_tcp.c +@@ -33,6 +33,9 @@ + #include + #include + ++/* Do not check the TCP window for incoming packets */ ++static int nf_ct_tcp_no_window_check __read_mostly = 1; ++ + /* "Be conservative in what you do, + be liberal in what you accept from others." + If it's non-zero, we mark only out of window RST segments as INVALID. */ +@@ -505,6 +508,9 @@ static bool tcp_in_window(const struct n + s32 receiver_offset; + bool res, in_recv_win; + ++ if (nf_ct_tcp_no_window_check) ++ return true; ++ + /* + * Get the required data from the packet. + */ +@@ -1486,6 +1492,13 @@ static struct ctl_table tcp_sysctl_table + .mode = 0644, + .proc_handler = proc_dointvec, + }, ++ { ++ .procname = "nf_conntrack_tcp_no_window_check", ++ .data = &nf_ct_tcp_no_window_check, ++ .maxlen = sizeof(unsigned int), ++ .mode = 0644, ++ .proc_handler = proc_dointvec, ++ }, + { } + }; + #endif /* CONFIG_SYSCTL */ diff --git a/target/linux/generic/pending-4.14/616-net_optimize_xfrm_calls.patch b/target/linux/generic/pending-4.14/616-net_optimize_xfrm_calls.patch new file mode 100644 index 0000000000..c64694ea3c --- /dev/null +++ b/target/linux/generic/pending-4.14/616-net_optimize_xfrm_calls.patch @@ -0,0 +1,20 @@ +From: Felix Fietkau +Subject: kernel: add a small xfrm related performance optimization + +Signed-off-by: Felix Fietkau +--- + net/netfilter/nf_nat_core.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/net/netfilter/nf_nat_core.c ++++ b/net/netfilter/nf_nat_core.c +@@ -90,6 +90,9 @@ int nf_xfrm_me_harder(struct net *net, s + struct dst_entry *dst; + int err; + ++ if (skb->dev && !dev_net(skb->dev)->xfrm.policy_count[XFRM_POLICY_OUT]) ++ return 0; ++ + err = xfrm_decode_session(skb, &fl, family); + if (err < 0) + return err; diff --git a/target/linux/generic/pending-4.14/630-packet_socket_type.patch b/target/linux/generic/pending-4.14/630-packet_socket_type.patch new file mode 100644 index 0000000000..ed48128c9e --- /dev/null +++ b/target/linux/generic/pending-4.14/630-packet_socket_type.patch @@ -0,0 +1,138 @@ +From: Felix Fietkau +Subject: net: add an optimization for dealing with raw sockets + +lede-commit: 4898039703d7315f0f3431c860123338ec3be0f6 +Signed-off-by: Felix Fietkau +--- + include/uapi/linux/if_packet.h | 3 +++ + net/packet/af_packet.c | 34 +++++++++++++++++++++++++++------- + net/packet/internal.h | 1 + + 3 files changed, 31 insertions(+), 7 deletions(-) + +--- a/include/uapi/linux/if_packet.h ++++ b/include/uapi/linux/if_packet.h +@@ -32,6 +32,8 @@ struct sockaddr_ll { + #define PACKET_KERNEL 7 /* To kernel space */ + /* Unused, PACKET_FASTROUTE and PACKET_LOOPBACK are invisible to user space */ + #define PACKET_FASTROUTE 6 /* Fastrouted frame */ ++#define PACKET_MASK_ANY 0xffffffff /* mask for packet type bits */ ++ + + /* Packet socket options */ + +@@ -57,6 +59,7 @@ struct sockaddr_ll { + #define PACKET_QDISC_BYPASS 20 + #define PACKET_ROLLOVER_STATS 21 + #define PACKET_FANOUT_DATA 22 ++#define PACKET_RECV_TYPE 23 + + #define PACKET_FANOUT_HASH 0 + #define PACKET_FANOUT_LB 1 +--- a/net/packet/af_packet.c ++++ b/net/packet/af_packet.c +@@ -1822,6 +1822,7 @@ static int packet_rcv_spkt(struct sk_buf + { + struct sock *sk; + struct sockaddr_pkt *spkt; ++ struct packet_sock *po; + + /* + * When we registered the protocol we saved the socket in the data +@@ -1829,6 +1830,7 @@ static int packet_rcv_spkt(struct sk_buf + */ + + sk = pt->af_packet_priv; ++ po = pkt_sk(sk); + + /* + * Yank back the headers [hope the device set this +@@ -1841,7 +1843,7 @@ static int packet_rcv_spkt(struct sk_buf + * so that this procedure is noop. + */ + +- if (skb->pkt_type == PACKET_LOOPBACK) ++ if (!(po->pkt_type & (1 << skb->pkt_type))) + goto out; + + if (!net_eq(dev_net(dev), sock_net(sk))) +@@ -2068,12 +2070,12 @@ static int packet_rcv(struct sk_buff *sk + unsigned int snaplen, res; + bool is_drop_n_account = false; + +- if (skb->pkt_type == PACKET_LOOPBACK) +- goto drop; +- + sk = pt->af_packet_priv; + po = pkt_sk(sk); + ++ if (!(po->pkt_type & (1 << skb->pkt_type))) ++ goto drop; ++ + if (!net_eq(dev_net(dev), sock_net(sk))) + goto drop; + +@@ -2199,12 +2201,12 @@ static int tpacket_rcv(struct sk_buff *s + BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32); + BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48); + +- if (skb->pkt_type == PACKET_LOOPBACK) +- goto drop; +- + sk = pt->af_packet_priv; + po = pkt_sk(sk); + ++ if (!(po->pkt_type & (1 << skb->pkt_type))) ++ goto drop; ++ + if (!net_eq(dev_net(dev), sock_net(sk))) + goto drop; + +@@ -3251,6 +3253,7 @@ static int packet_create(struct net *net + mutex_init(&po->pg_vec_lock); + po->rollover = NULL; + po->prot_hook.func = packet_rcv; ++ po->pkt_type = PACKET_MASK_ANY & ~(1 << PACKET_LOOPBACK); + + if (sock->type == SOCK_PACKET) + po->prot_hook.func = packet_rcv_spkt; +@@ -3837,6 +3840,16 @@ packet_setsockopt(struct socket *sock, i + po->xmit = val ? packet_direct_xmit : dev_queue_xmit; + return 0; + } ++ case PACKET_RECV_TYPE: ++ { ++ unsigned int val; ++ if (optlen != sizeof(val)) ++ return -EINVAL; ++ if (copy_from_user(&val, optval, sizeof(val))) ++ return -EFAULT; ++ po->pkt_type = val & ~BIT(PACKET_LOOPBACK); ++ return 0; ++ } + default: + return -ENOPROTOOPT; + } +@@ -3889,6 +3902,13 @@ static int packet_getsockopt(struct sock + case PACKET_VNET_HDR: + val = po->has_vnet_hdr; + break; ++ case PACKET_RECV_TYPE: ++ if (len > sizeof(unsigned int)) ++ len = sizeof(unsigned int); ++ val = po->pkt_type; ++ ++ data = &val; ++ break; + case PACKET_VERSION: + val = po->tp_version; + break; +--- a/net/packet/internal.h ++++ b/net/packet/internal.h +@@ -131,6 +131,7 @@ struct packet_sock { + struct net_device __rcu *cached_dev; + int (*xmit)(struct sk_buff *skb); + struct packet_type prot_hook ____cacheline_aligned_in_smp; ++ unsigned int pkt_type; + }; + + static struct packet_sock *pkt_sk(struct sock *sk) diff --git a/target/linux/generic/pending-4.14/650-pppoe_header_pad.patch b/target/linux/generic/pending-4.14/650-pppoe_header_pad.patch new file mode 100644 index 0000000000..3115073b50 --- /dev/null +++ b/target/linux/generic/pending-4.14/650-pppoe_header_pad.patch @@ -0,0 +1,29 @@ +From: Felix Fietkau +Subject: pppoe: add extra padding for the header (useful for drivers that need headroom) + +lede-commit 6517a757ec711fc3354b857e273e2621042f3c7a +Signed-off-by: Felix Fietkau +--- + drivers/net/ppp/pppoe.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/ppp/pppoe.c ++++ b/drivers/net/ppp/pppoe.c +@@ -861,7 +861,7 @@ static int pppoe_sendmsg(struct socket * + goto end; + + +- skb = sock_wmalloc(sk, total_len + dev->hard_header_len + 32, ++ skb = sock_wmalloc(sk, total_len + dev->hard_header_len + 32 + NET_SKB_PAD, + 0, GFP_KERNEL); + if (!skb) { + error = -ENOMEM; +@@ -869,7 +869,7 @@ static int pppoe_sendmsg(struct socket * + } + + /* Reserve space for headers. */ +- skb_reserve(skb, dev->hard_header_len); ++ skb_reserve(skb, dev->hard_header_len + NET_SKB_PAD); + skb_reset_network_header(skb); + + skb->dev = dev; diff --git a/target/linux/generic/pending-4.14/655-increase_skb_pad.patch b/target/linux/generic/pending-4.14/655-increase_skb_pad.patch new file mode 100644 index 0000000000..515c69f810 --- /dev/null +++ b/target/linux/generic/pending-4.14/655-increase_skb_pad.patch @@ -0,0 +1,20 @@ +From: Felix Fietkau +Subject: kernel: add a few patches for avoiding unnecessary skb reallocations - significantly improves ethernet<->wireless performance + +lede-commit: 6f89cffc9add6939d44a6b54cf9a5e77849aa7fd +Signed-off-by: Felix Fietkau +--- + include/linux/skbuff.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/linux/skbuff.h ++++ b/include/linux/skbuff.h +@@ -2458,7 +2458,7 @@ static inline int pskb_network_may_pull( + * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) + */ + #ifndef NET_SKB_PAD +-#define NET_SKB_PAD max(32, L1_CACHE_BYTES) ++#define NET_SKB_PAD max(64, L1_CACHE_BYTES) + #endif + + int ___pskb_trim(struct sk_buff *skb, unsigned int len); diff --git a/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch new file mode 100644 index 0000000000..a114acda92 --- /dev/null +++ b/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch @@ -0,0 +1,500 @@ +From: Steven Barth +Subject: Add support for MAP-E FMRs (mesh mode) + +MAP-E FMRs (draft-ietf-softwire-map-10) are rules for IPv4-communication +between MAP CEs (mesh mode) without the need to forward such data to a +border relay. This is similar to how 6rd works but for IPv4 over IPv6. + +Signed-off-by: Steven Barth +--- + include/net/ip6_tunnel.h | 13 ++ + include/uapi/linux/if_tunnel.h | 13 ++ + net/ipv6/ip6_tunnel.c | 276 +++++++++++++++++++++++++++++++++++++++-- + 3 files changed, 291 insertions(+), 11 deletions(-) + +--- a/include/net/ip6_tunnel.h ++++ b/include/net/ip6_tunnel.h +@@ -18,6 +18,18 @@ + /* determine capability on a per-packet basis */ + #define IP6_TNL_F_CAP_PER_PACKET 0x40000 + ++/* IPv6 tunnel FMR */ ++struct __ip6_tnl_fmr { ++ struct __ip6_tnl_fmr *next; /* next fmr in list */ ++ struct in6_addr ip6_prefix; ++ struct in_addr ip4_prefix; ++ ++ __u8 ip6_prefix_len; ++ __u8 ip4_prefix_len; ++ __u8 ea_len; ++ __u8 offset; ++}; ++ + struct __ip6_tnl_parm { + char name[IFNAMSIZ]; /* name of tunnel device */ + int link; /* ifindex of underlying L2 interface */ +@@ -29,6 +41,7 @@ struct __ip6_tnl_parm { + __u32 flags; /* tunnel flags */ + struct in6_addr laddr; /* local tunnel end-point address */ + struct in6_addr raddr; /* remote tunnel end-point address */ ++ struct __ip6_tnl_fmr *fmrs; /* FMRs */ + + __be16 i_flags; + __be16 o_flags; +--- a/include/uapi/linux/if_tunnel.h ++++ b/include/uapi/linux/if_tunnel.h +@@ -77,10 +77,23 @@ enum { + IFLA_IPTUN_ENCAP_DPORT, + IFLA_IPTUN_COLLECT_METADATA, + IFLA_IPTUN_FWMARK, ++ IFLA_IPTUN_FMRS, + __IFLA_IPTUN_MAX, + }; + #define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1) + ++enum { ++ IFLA_IPTUN_FMR_UNSPEC, ++ IFLA_IPTUN_FMR_IP6_PREFIX, ++ IFLA_IPTUN_FMR_IP4_PREFIX, ++ IFLA_IPTUN_FMR_IP6_PREFIX_LEN, ++ IFLA_IPTUN_FMR_IP4_PREFIX_LEN, ++ IFLA_IPTUN_FMR_EA_LEN, ++ IFLA_IPTUN_FMR_OFFSET, ++ __IFLA_IPTUN_FMR_MAX, ++}; ++#define IFLA_IPTUN_FMR_MAX (__IFLA_IPTUN_FMR_MAX - 1) ++ + enum tunnel_encap_types { + TUNNEL_ENCAP_NONE, + TUNNEL_ENCAP_FOU, +--- a/net/ipv6/ip6_tunnel.c ++++ b/net/ipv6/ip6_tunnel.c +@@ -16,6 +16,8 @@ + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * ++ * Changes: ++ * Steven Barth : MAP-E FMR support + */ + + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +@@ -72,9 +74,9 @@ static bool log_ecn_error = true; + module_param(log_ecn_error, bool, 0644); + MODULE_PARM_DESC(log_ecn_error, "Log packets received with corrupted ECN"); + +-static u32 HASH(const struct in6_addr *addr1, const struct in6_addr *addr2) ++static u32 HASH(const struct in6_addr *addr) + { +- u32 hash = ipv6_addr_hash(addr1) ^ ipv6_addr_hash(addr2); ++ u32 hash = ipv6_addr_hash(addr); + + return hash_32(hash, IP6_TUNNEL_HASH_SIZE_SHIFT); + } +@@ -141,20 +143,29 @@ static struct net_device_stats *ip6_get_ + static struct ip6_tnl * + ip6_tnl_lookup(struct net *net, const struct in6_addr *remote, const struct in6_addr *local) + { +- unsigned int hash = HASH(remote, local); ++ unsigned int hash = HASH(local); + struct ip6_tnl *t; + struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id); + struct in6_addr any; ++ struct __ip6_tnl_fmr *fmr; + + for_each_ip6_tunnel_rcu(ip6n->tnls_r_l[hash]) { +- if (ipv6_addr_equal(local, &t->parms.laddr) && +- ipv6_addr_equal(remote, &t->parms.raddr) && +- (t->dev->flags & IFF_UP)) ++ if (!ipv6_addr_equal(local, &t->parms.laddr) || ++ !(t->dev->flags & IFF_UP)) ++ continue; ++ ++ if (ipv6_addr_equal(remote, &t->parms.raddr)) + return t; ++ ++ for (fmr = t->parms.fmrs; fmr; fmr = fmr->next) { ++ if (ipv6_prefix_equal(remote, &fmr->ip6_prefix, ++ fmr->ip6_prefix_len)) ++ return t; ++ } + } + + memset(&any, 0, sizeof(any)); +- hash = HASH(&any, local); ++ hash = HASH(local); + for_each_ip6_tunnel_rcu(ip6n->tnls_r_l[hash]) { + if (ipv6_addr_equal(local, &t->parms.laddr) && + ipv6_addr_any(&t->parms.raddr) && +@@ -162,7 +173,7 @@ ip6_tnl_lookup(struct net *net, const st + return t; + } + +- hash = HASH(remote, &any); ++ hash = HASH(&any); + for_each_ip6_tunnel_rcu(ip6n->tnls_r_l[hash]) { + if (ipv6_addr_equal(remote, &t->parms.raddr) && + ipv6_addr_any(&t->parms.laddr) && +@@ -202,7 +213,7 @@ ip6_tnl_bucket(struct ip6_tnl_net *ip6n, + + if (!ipv6_addr_any(remote) || !ipv6_addr_any(local)) { + prio = 1; +- h = HASH(remote, local); ++ h = HASH(local); + } + return &ip6n->tnls[prio][h]; + } +@@ -380,6 +391,12 @@ ip6_tnl_dev_uninit(struct net_device *de + struct net *net = t->net; + struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id); + ++ while (t->parms.fmrs) { ++ struct __ip6_tnl_fmr *next = t->parms.fmrs->next; ++ kfree(t->parms.fmrs); ++ t->parms.fmrs = next; ++ } ++ + if (dev == ip6n->fb_tnl_dev) + RCU_INIT_POINTER(ip6n->tnls_wc[0], NULL); + else +@@ -776,6 +793,107 @@ int ip6_tnl_rcv_ctl(struct ip6_tnl *t, + } + EXPORT_SYMBOL_GPL(ip6_tnl_rcv_ctl); + ++/** ++ * ip4ip6_fmr_calc - calculate target / source IPv6-address based on FMR ++ * @dest: destination IPv6 address buffer ++ * @skb: received socket buffer ++ * @fmr: MAP FMR ++ * @xmit: Calculate for xmit or rcv ++ **/ ++static void ip4ip6_fmr_calc(struct in6_addr *dest, ++ const struct iphdr *iph, const uint8_t *end, ++ const struct __ip6_tnl_fmr *fmr, bool xmit) ++{ ++ int psidlen = fmr->ea_len - (32 - fmr->ip4_prefix_len); ++ u8 *portp = NULL; ++ bool use_dest_addr; ++ const struct iphdr *dsth = iph; ++ ++ if ((u8*)dsth >= end) ++ return; ++ ++ /* find significant IP header */ ++ if (iph->protocol == IPPROTO_ICMP) { ++ struct icmphdr *ih = (struct icmphdr*)(((u8*)dsth) + dsth->ihl * 4); ++ if (ih && ((u8*)&ih[1]) <= end && ( ++ ih->type == ICMP_DEST_UNREACH || ++ ih->type == ICMP_SOURCE_QUENCH || ++ ih->type == ICMP_TIME_EXCEEDED || ++ ih->type == ICMP_PARAMETERPROB || ++ ih->type == ICMP_REDIRECT)) ++ dsth = (const struct iphdr*)&ih[1]; ++ } ++ ++ /* in xmit-path use dest port by default and source port only if ++ this is an ICMP reply to something else; vice versa in rcv-path */ ++ use_dest_addr = (xmit && dsth == iph) || (!xmit && dsth != iph); ++ ++ /* get dst port */ ++ if (((u8*)&dsth[1]) <= end && ( ++ dsth->protocol == IPPROTO_UDP || ++ dsth->protocol == IPPROTO_TCP || ++ dsth->protocol == IPPROTO_SCTP || ++ dsth->protocol == IPPROTO_DCCP)) { ++ /* for UDP, TCP, SCTP and DCCP source and dest port ++ follow IPv4 header directly */ ++ portp = ((u8*)dsth) + dsth->ihl * 4; ++ ++ if (use_dest_addr) ++ portp += sizeof(u16); ++ } else if (iph->protocol == IPPROTO_ICMP) { ++ struct icmphdr *ih = (struct icmphdr*)(((u8*)dsth) + dsth->ihl * 4); ++ ++ /* use icmp identifier as port */ ++ if (((u8*)&ih) <= end && ( ++ (use_dest_addr && ( ++ ih->type == ICMP_ECHOREPLY || ++ ih->type == ICMP_TIMESTAMPREPLY || ++ ih->type == ICMP_INFO_REPLY || ++ ih->type == ICMP_ADDRESSREPLY)) || ++ (!use_dest_addr && ( ++ ih->type == ICMP_ECHO || ++ ih->type == ICMP_TIMESTAMP || ++ ih->type == ICMP_INFO_REQUEST || ++ ih->type == ICMP_ADDRESS) ++ ))) ++ portp = (u8*)&ih->un.echo.id; ++ } ++ ++ if ((portp && &portp[2] <= end) || psidlen == 0) { ++ int frombyte = fmr->ip6_prefix_len / 8; ++ int fromrem = fmr->ip6_prefix_len % 8; ++ int bytes = sizeof(struct in6_addr) - frombyte; ++ const u32 *addr = (use_dest_addr) ? &iph->daddr : &iph->saddr; ++ u64 eabits = ((u64)ntohl(*addr)) << (32 + fmr->ip4_prefix_len); ++ u64 t = 0; ++ ++ /* extract PSID from port and add it to eabits */ ++ u16 psidbits = 0; ++ if (psidlen > 0) { ++ psidbits = ((u16)portp[0]) << 8 | ((u16)portp[1]); ++ psidbits >>= 16 - psidlen - fmr->offset; ++ psidbits = (u16)(psidbits << (16 - psidlen)); ++ eabits |= ((u64)psidbits) << (48 - (fmr->ea_len - psidlen)); ++ } ++ ++ /* rewrite destination address */ ++ *dest = fmr->ip6_prefix; ++ memcpy(&dest->s6_addr[10], addr, sizeof(*addr)); ++ dest->s6_addr16[7] = htons(psidbits >> (16 - psidlen)); ++ ++ if (bytes > sizeof(u64)) ++ bytes = sizeof(u64); ++ ++ /* insert eabits */ ++ memcpy(&t, &dest->s6_addr[frombyte], bytes); ++ t = be64_to_cpu(t) & ~(((((u64)1) << fmr->ea_len) - 1) ++ << (64 - fmr->ea_len - fromrem)); ++ t = cpu_to_be64(t | (eabits >> fromrem)); ++ memcpy(&dest->s6_addr[frombyte], &t, bytes); ++ } ++} ++ ++ + static int __ip6_tnl_rcv(struct ip6_tnl *tunnel, struct sk_buff *skb, + const struct tnl_ptk_info *tpi, + struct metadata_dst *tun_dst, +@@ -828,6 +946,27 @@ static int __ip6_tnl_rcv(struct ip6_tnl + skb_reset_network_header(skb); + memset(skb->cb, 0, sizeof(struct inet6_skb_parm)); + ++ if (tpi->proto == htons(ETH_P_IP) && ++ !ipv6_addr_equal(&ipv6h->saddr, &tunnel->parms.raddr)) { ++ /* Packet didn't come from BR, so lookup FMR */ ++ struct __ip6_tnl_fmr *fmr; ++ struct in6_addr expected = tunnel->parms.raddr; ++ for (fmr = tunnel->parms.fmrs; fmr; fmr = fmr->next) ++ if (ipv6_prefix_equal(&ipv6h->saddr, ++ &fmr->ip6_prefix, fmr->ip6_prefix_len)) ++ break; ++ ++ /* Check that IPv6 matches IPv4 source to prevent spoofing */ ++ if (fmr) ++ ip4ip6_fmr_calc(&expected, ip_hdr(skb), ++ skb_tail_pointer(skb), fmr, false); ++ ++ if (!ipv6_addr_equal(&ipv6h->saddr, &expected)) { ++ rcu_read_unlock(); ++ goto drop; ++ } ++ } ++ + __skb_tunnel_rx(skb, tunnel->dev, tunnel->net); + + err = dscp_ecn_decapsulate(tunnel, ipv6h, skb); +@@ -959,6 +1098,7 @@ static void init_tel_txopt(struct ipv6_t + opt->ops.opt_nflen = 8; + } + ++ + /** + * ip6_tnl_addr_conflict - compare packet addresses to tunnel's own + * @t: the outgoing tunnel device +@@ -1295,6 +1435,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str + { + struct ip6_tnl *t = netdev_priv(dev); + struct ipv6hdr *ipv6h = ipv6_hdr(skb); ++ struct __ip6_tnl_fmr *fmr; + int encap_limit = -1; + __u16 offset; + struct flowi6 fl6; +@@ -1357,6 +1498,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str + + fl6.flowi6_uid = sock_net_uid(dev_net(dev), NULL); + ++ /* try to find matching FMR */ ++ for (fmr = t->parms.fmrs; fmr; fmr = fmr->next) { ++ unsigned mshift = 32 - fmr->ip4_prefix_len; ++ if (ntohl(fmr->ip4_prefix.s_addr) >> mshift == ++ ntohl(ip_hdr(skb)->daddr) >> mshift) ++ break; ++ } ++ ++ /* change dstaddr according to FMR */ ++ if (fmr) ++ ip4ip6_fmr_calc(&fl6.daddr, ip_hdr(skb), skb_tail_pointer(skb), fmr, true); ++ + if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6)) + return -1; + +@@ -1485,6 +1638,14 @@ ip6_tnl_change(struct ip6_tnl *t, const + t->parms.link = p->link; + t->parms.proto = p->proto; + t->parms.fwmark = p->fwmark; ++ ++ while (t->parms.fmrs) { ++ struct __ip6_tnl_fmr *next = t->parms.fmrs->next; ++ kfree(t->parms.fmrs); ++ t->parms.fmrs = next; ++ } ++ t->parms.fmrs = p->fmrs; ++ + dst_cache_reset(&t->dst_cache); + ip6_tnl_link_config(t); + return 0; +@@ -1523,6 +1684,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ + p->flowinfo = u->flowinfo; + p->link = u->link; + p->proto = u->proto; ++ p->fmrs = NULL; + memcpy(p->name, u->name, sizeof(u->name)); + } + +@@ -1904,6 +2066,15 @@ static int ip6_tnl_validate(struct nlatt + return 0; + } + ++static const struct nla_policy ip6_tnl_fmr_policy[IFLA_IPTUN_FMR_MAX + 1] = { ++ [IFLA_IPTUN_FMR_IP6_PREFIX] = { .len = sizeof(struct in6_addr) }, ++ [IFLA_IPTUN_FMR_IP4_PREFIX] = { .len = sizeof(struct in_addr) }, ++ [IFLA_IPTUN_FMR_IP6_PREFIX_LEN] = { .type = NLA_U8 }, ++ [IFLA_IPTUN_FMR_IP4_PREFIX_LEN] = { .type = NLA_U8 }, ++ [IFLA_IPTUN_FMR_EA_LEN] = { .type = NLA_U8 }, ++ [IFLA_IPTUN_FMR_OFFSET] = { .type = NLA_U8 } ++}; ++ + static void ip6_tnl_netlink_parms(struct nlattr *data[], + struct __ip6_tnl_parm *parms) + { +@@ -1941,6 +2112,46 @@ static void ip6_tnl_netlink_parms(struct + + if (data[IFLA_IPTUN_FWMARK]) + parms->fwmark = nla_get_u32(data[IFLA_IPTUN_FWMARK]); ++ ++ if (data[IFLA_IPTUN_FMRS]) { ++ unsigned rem; ++ struct nlattr *fmr; ++ nla_for_each_nested(fmr, data[IFLA_IPTUN_FMRS], rem) { ++ struct nlattr *fmrd[IFLA_IPTUN_FMR_MAX + 1], *c; ++ struct __ip6_tnl_fmr *nfmr; ++ ++ nla_parse_nested(fmrd, IFLA_IPTUN_FMR_MAX, ++ fmr, ip6_tnl_fmr_policy, NULL); ++ ++ if (!(nfmr = kzalloc(sizeof(*nfmr), GFP_KERNEL))) ++ continue; ++ ++ nfmr->offset = 6; ++ ++ if ((c = fmrd[IFLA_IPTUN_FMR_IP6_PREFIX])) ++ nla_memcpy(&nfmr->ip6_prefix, fmrd[IFLA_IPTUN_FMR_IP6_PREFIX], ++ sizeof(nfmr->ip6_prefix)); ++ ++ if ((c = fmrd[IFLA_IPTUN_FMR_IP4_PREFIX])) ++ nla_memcpy(&nfmr->ip4_prefix, fmrd[IFLA_IPTUN_FMR_IP4_PREFIX], ++ sizeof(nfmr->ip4_prefix)); ++ ++ if ((c = fmrd[IFLA_IPTUN_FMR_IP6_PREFIX_LEN])) ++ nfmr->ip6_prefix_len = nla_get_u8(c); ++ ++ if ((c = fmrd[IFLA_IPTUN_FMR_IP4_PREFIX_LEN])) ++ nfmr->ip4_prefix_len = nla_get_u8(c); ++ ++ if ((c = fmrd[IFLA_IPTUN_FMR_EA_LEN])) ++ nfmr->ea_len = nla_get_u8(c); ++ ++ if ((c = fmrd[IFLA_IPTUN_FMR_OFFSET])) ++ nfmr->offset = nla_get_u8(c); ++ ++ nfmr->next = parms->fmrs; ++ parms->fmrs = nfmr; ++ } ++ } + } + + static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[], +@@ -2052,6 +2263,12 @@ static void ip6_tnl_dellink(struct net_d + + static size_t ip6_tnl_get_size(const struct net_device *dev) + { ++ const struct ip6_tnl *t = netdev_priv(dev); ++ struct __ip6_tnl_fmr *c; ++ int fmrs = 0; ++ for (c = t->parms.fmrs; c; c = c->next) ++ ++fmrs; ++ + return + /* IFLA_IPTUN_LINK */ + nla_total_size(4) + +@@ -2081,6 +2298,24 @@ static size_t ip6_tnl_get_size(const str + nla_total_size(0) + + /* IFLA_IPTUN_FWMARK */ + nla_total_size(4) + ++ /* IFLA_IPTUN_FMRS */ ++ nla_total_size(0) + ++ ( ++ /* nest */ ++ nla_total_size(0) + ++ /* IFLA_IPTUN_FMR_IP6_PREFIX */ ++ nla_total_size(sizeof(struct in6_addr)) + ++ /* IFLA_IPTUN_FMR_IP4_PREFIX */ ++ nla_total_size(sizeof(struct in_addr)) + ++ /* IFLA_IPTUN_FMR_EA_LEN */ ++ nla_total_size(1) + ++ /* IFLA_IPTUN_FMR_IP6_PREFIX_LEN */ ++ nla_total_size(1) + ++ /* IFLA_IPTUN_FMR_IP4_PREFIX_LEN */ ++ nla_total_size(1) + ++ /* IFLA_IPTUN_FMR_OFFSET */ ++ nla_total_size(1) ++ ) * fmrs + + 0; + } + +@@ -2088,6 +2323,9 @@ static int ip6_tnl_fill_info(struct sk_b + { + struct ip6_tnl *tunnel = netdev_priv(dev); + struct __ip6_tnl_parm *parm = &tunnel->parms; ++ struct __ip6_tnl_fmr *c; ++ int fmrcnt = 0; ++ struct nlattr *fmrs; + + if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) || + nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) || +@@ -2097,9 +2335,27 @@ static int ip6_tnl_fill_info(struct sk_b + nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) || + nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) || + nla_put_u8(skb, IFLA_IPTUN_PROTO, parm->proto) || +- nla_put_u32(skb, IFLA_IPTUN_FWMARK, parm->fwmark)) ++ nla_put_u32(skb, IFLA_IPTUN_FWMARK, parm->fwmark) || ++ !(fmrs = nla_nest_start(skb, IFLA_IPTUN_FMRS))) + goto nla_put_failure; + ++ for (c = parm->fmrs; c; c = c->next) { ++ struct nlattr *fmr = nla_nest_start(skb, ++fmrcnt); ++ if (!fmr || ++ nla_put(skb, IFLA_IPTUN_FMR_IP6_PREFIX, ++ sizeof(c->ip6_prefix), &c->ip6_prefix) || ++ nla_put(skb, IFLA_IPTUN_FMR_IP4_PREFIX, ++ sizeof(c->ip4_prefix), &c->ip4_prefix) || ++ nla_put_u8(skb, IFLA_IPTUN_FMR_IP6_PREFIX_LEN, c->ip6_prefix_len) || ++ nla_put_u8(skb, IFLA_IPTUN_FMR_IP4_PREFIX_LEN, c->ip4_prefix_len) || ++ nla_put_u8(skb, IFLA_IPTUN_FMR_EA_LEN, c->ea_len) || ++ nla_put_u8(skb, IFLA_IPTUN_FMR_OFFSET, c->offset)) ++ goto nla_put_failure; ++ ++ nla_nest_end(skb, fmr); ++ } ++ nla_nest_end(skb, fmrs); ++ + if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) || + nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) || + nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) || +@@ -2139,6 +2395,7 @@ static const struct nla_policy ip6_tnl_p + [IFLA_IPTUN_ENCAP_DPORT] = { .type = NLA_U16 }, + [IFLA_IPTUN_COLLECT_METADATA] = { .type = NLA_FLAG }, + [IFLA_IPTUN_FWMARK] = { .type = NLA_U32 }, ++ [IFLA_IPTUN_FMRS] = { .type = NLA_NESTED }, + }; + + static struct rtnl_link_ops ip6_link_ops __read_mostly = { diff --git a/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch new file mode 100644 index 0000000000..9a088c461a --- /dev/null +++ b/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -0,0 +1,247 @@ +From: Jonas Gorski +Subject: ipv6: allow rejecting with "source address failed policy" + +RFC6204 L-14 requires rejecting traffic from invalid addresses with +ICMPv6 Destination Unreachable, Code 5 (Source address failed ingress/ +egress policy) on the LAN side, so add an appropriate rule for that. + +Signed-off-by: Jonas Gorski +--- + include/net/netns/ipv6.h | 1 + + include/uapi/linux/fib_rules.h | 4 +++ + include/uapi/linux/rtnetlink.h | 1 + + net/ipv4/fib_semantics.c | 4 +++ + net/ipv4/fib_trie.c | 1 + + net/ipv4/ipmr.c | 1 + + net/ipv6/fib6_rules.c | 4 +++ + net/ipv6/ip6mr.c | 2 ++ + net/ipv6/route.c | 58 +++++++++++++++++++++++++++++++++++++++++- + 9 files changed, 75 insertions(+), 1 deletion(-) + +--- a/include/net/netns/ipv6.h ++++ b/include/net/netns/ipv6.h +@@ -69,6 +69,7 @@ struct netns_ipv6 { + #ifdef CONFIG_IPV6_MULTIPLE_TABLES + bool fib6_has_custom_rules; + struct rt6_info *ip6_prohibit_entry; ++ struct rt6_info *ip6_policy_failed_entry; + struct rt6_info *ip6_blk_hole_entry; + struct fib6_table *fib6_local_tbl; + struct fib_rules_ops *fib6_rules_ops; +--- a/include/uapi/linux/fib_rules.h ++++ b/include/uapi/linux/fib_rules.h +@@ -73,6 +73,10 @@ enum { + FR_ACT_BLACKHOLE, /* Drop without notification */ + FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */ + FR_ACT_PROHIBIT, /* Drop with EACCES */ ++ FR_ACT_RES9, ++ FR_ACT_RES10, ++ FR_ACT_RES11, ++ FR_ACT_POLICY_FAILED, /* Drop with EACCES */ + __FR_ACT_MAX, + }; + +--- a/include/uapi/linux/rtnetlink.h ++++ b/include/uapi/linux/rtnetlink.h +@@ -221,6 +221,7 @@ enum { + RTN_THROW, /* Not in this table */ + RTN_NAT, /* Translate this address */ + RTN_XRESOLVE, /* Use external resolver */ ++ RTN_POLICY_FAILED, /* Failed ingress/egress policy */ + __RTN_MAX + }; + +--- a/net/ipv4/fib_semantics.c ++++ b/net/ipv4/fib_semantics.c +@@ -139,6 +139,10 @@ const struct fib_prop fib_props[RTN_MAX + .error = -EINVAL, + .scope = RT_SCOPE_NOWHERE, + }, ++ [RTN_POLICY_FAILED] = { ++ .error = -EACCES, ++ .scope = RT_SCOPE_UNIVERSE, ++ }, + }; + + static void rt_fibinfo_free(struct rtable __rcu **rtp) +--- a/net/ipv4/fib_trie.c ++++ b/net/ipv4/fib_trie.c +@@ -2460,6 +2460,7 @@ static const char *const rtn_type_names[ + [RTN_THROW] = "THROW", + [RTN_NAT] = "NAT", + [RTN_XRESOLVE] = "XRESOLVE", ++ [RTN_POLICY_FAILED] = "POLICY_FAILED", + }; + + static inline const char *rtn_type(char *buf, size_t len, unsigned int t) +--- a/net/ipv4/ipmr.c ++++ b/net/ipv4/ipmr.c +@@ -161,6 +161,7 @@ static int ipmr_rule_action(struct fib_r + case FR_ACT_UNREACHABLE: + return -ENETUNREACH; + case FR_ACT_PROHIBIT: ++ case FR_ACT_POLICY_FAILED: + return -EACCES; + case FR_ACT_BLACKHOLE: + default: +--- a/net/ipv6/fib6_rules.c ++++ b/net/ipv6/fib6_rules.c +@@ -121,6 +121,10 @@ static int fib6_rule_action(struct fib_r + err = -EACCES; + rt = net->ipv6.ip6_prohibit_entry; + goto discard_pkt; ++ case FR_ACT_POLICY_FAILED: ++ err = -EACCES; ++ rt = net->ipv6.ip6_policy_failed_entry; ++ goto discard_pkt; + } + + tb_id = fib_rule_get_table(rule, arg); +--- a/net/ipv6/ip6mr.c ++++ b/net/ipv6/ip6mr.c +@@ -168,6 +168,8 @@ static int ip6mr_rule_action(struct fib_ + return -ENETUNREACH; + case FR_ACT_PROHIBIT: + return -EACCES; ++ case FR_ACT_POLICY_FAILED: ++ return -EACCES; + case FR_ACT_BLACKHOLE: + default: + return -EINVAL; +--- a/net/ipv6/route.c ++++ b/net/ipv6/route.c +@@ -91,6 +91,8 @@ static int ip6_pkt_discard(struct sk_bu + static int ip6_pkt_discard_out(struct net *net, struct sock *sk, struct sk_buff *skb); + static int ip6_pkt_prohibit(struct sk_buff *skb); + static int ip6_pkt_prohibit_out(struct net *net, struct sock *sk, struct sk_buff *skb); ++static int ip6_pkt_policy_failed(struct sk_buff *skb); ++static int ip6_pkt_policy_failed_out(struct net *net, struct sock *sk, struct sk_buff *skb); + static void ip6_link_failure(struct sk_buff *skb); + static void ip6_rt_update_pmtu(struct dst_entry *dst, struct sock *sk, + struct sk_buff *skb, u32 mtu); +@@ -321,6 +323,21 @@ static const struct rt6_info ip6_prohibi + .rt6i_ref = ATOMIC_INIT(1), + }; + ++static const struct rt6_info ip6_policy_failed_entry_template = { ++ .dst = { ++ .__refcnt = ATOMIC_INIT(1), ++ .__use = 1, ++ .obsolete = DST_OBSOLETE_FORCE_CHK, ++ .error = -EACCES, ++ .input = ip6_pkt_policy_failed, ++ .output = ip6_pkt_policy_failed_out, ++ }, ++ .rt6i_flags = (RTF_REJECT | RTF_NONEXTHOP), ++ .rt6i_protocol = RTPROT_KERNEL, ++ .rt6i_metric = ~(u32) 0, ++ .rt6i_ref = ATOMIC_INIT(1), ++}; ++ + static const struct rt6_info ip6_blk_hole_entry_template = { + .dst = { + .__refcnt = ATOMIC_INIT(1), +@@ -2037,6 +2054,11 @@ static struct rt6_info *ip6_route_info_c + rt->dst.output = ip6_pkt_prohibit_out; + rt->dst.input = ip6_pkt_prohibit; + break; ++ case RTN_POLICY_FAILED: ++ rt->dst.error = -EACCES; ++ rt->dst.output = ip6_pkt_policy_failed_out; ++ rt->dst.input = ip6_pkt_policy_failed; ++ break; + case RTN_THROW: + case RTN_UNREACHABLE: + default: +@@ -2762,6 +2784,17 @@ static int ip6_pkt_prohibit_out(struct n + return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES); + } + ++static int ip6_pkt_policy_failed(struct sk_buff *skb) ++{ ++ return ip6_pkt_drop(skb, ICMPV6_POLICY_FAIL, IPSTATS_MIB_INNOROUTES); ++} ++ ++static int ip6_pkt_policy_failed_out(struct net *net, struct sock *sk, struct sk_buff *skb) ++{ ++ skb->dev = skb_dst(skb)->dev; ++ return ip6_pkt_drop(skb, ICMPV6_POLICY_FAIL, IPSTATS_MIB_OUTNOROUTES); ++} ++ + /* + * Allocate a dst for local (unicast / anycast) address. + */ +@@ -2996,7 +3029,8 @@ static int rtm_to_fib6_config(struct sk_ + if (rtm->rtm_type == RTN_UNREACHABLE || + rtm->rtm_type == RTN_BLACKHOLE || + rtm->rtm_type == RTN_PROHIBIT || +- rtm->rtm_type == RTN_THROW) ++ rtm->rtm_type == RTN_THROW || ++ rtm->rtm_type == RTN_POLICY_FAILED) + cfg->fc_flags |= RTF_REJECT; + + if (rtm->rtm_type == RTN_LOCAL) +@@ -3486,6 +3520,9 @@ static int rt6_fill_node(struct net *net + case -EACCES: + rtm->rtm_type = RTN_PROHIBIT; + break; ++ case -EPERM: ++ rtm->rtm_type = RTN_POLICY_FAILED; ++ break; + case -EAGAIN: + rtm->rtm_type = RTN_THROW; + break; +@@ -3804,6 +3841,8 @@ static int ip6_route_dev_notify(struct n + #ifdef CONFIG_IPV6_MULTIPLE_TABLES + net->ipv6.ip6_prohibit_entry->dst.dev = dev; + net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); ++ net->ipv6.ip6_policy_failed_entry->dst.dev = dev; ++ net->ipv6.ip6_policy_failed_entry->rt6i_idev = in6_dev_get(dev); + net->ipv6.ip6_blk_hole_entry->dst.dev = dev; + net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); + #endif +@@ -4031,6 +4070,17 @@ static int __net_init ip6_route_net_init + net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; + dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, + ip6_template_metrics, true); ++ ++ net->ipv6.ip6_policy_failed_entry = ++ kmemdup(&ip6_policy_failed_entry_template, ++ sizeof(*net->ipv6.ip6_policy_failed_entry), GFP_KERNEL); ++ if (!net->ipv6.ip6_policy_failed_entry) ++ goto out_ip6_blk_hole_entry; ++ net->ipv6.ip6_policy_failed_entry->dst.path = ++ (struct dst_entry *)net->ipv6.ip6_policy_failed_entry; ++ net->ipv6.ip6_policy_failed_entry->dst.ops = &net->ipv6.ip6_dst_ops; ++ dst_init_metrics(&net->ipv6.ip6_policy_failed_entry->dst, ++ ip6_template_metrics, true); + #endif + + net->ipv6.sysctl.flush_delay = 0; +@@ -4049,6 +4099,8 @@ out: + return ret; + + #ifdef CONFIG_IPV6_MULTIPLE_TABLES ++out_ip6_blk_hole_entry: ++ kfree(net->ipv6.ip6_blk_hole_entry); + out_ip6_prohibit_entry: + kfree(net->ipv6.ip6_prohibit_entry); + out_ip6_null_entry: +@@ -4066,6 +4118,7 @@ static void __net_exit ip6_route_net_exi + #ifdef CONFIG_IPV6_MULTIPLE_TABLES + kfree(net->ipv6.ip6_prohibit_entry); + kfree(net->ipv6.ip6_blk_hole_entry); ++ kfree(net->ipv6.ip6_policy_failed_entry); + #endif + dst_entries_destroy(&net->ipv6.ip6_dst_ops); + } +@@ -4139,6 +4192,9 @@ void __init ip6_route_init_special_entri + init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); + init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; + init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); ++ init_net.ipv6.ip6_policy_failed_entry->dst.dev = init_net.loopback_dev; ++ init_net.ipv6.ip6_policy_failed_entry->rt6i_idev = ++ in6_dev_get(init_net.loopback_dev); + #endif + } + diff --git a/target/linux/generic/pending-4.14/671-net-provide-defines-for-_POLICY_FAILED-until-all-cod.patch b/target/linux/generic/pending-4.14/671-net-provide-defines-for-_POLICY_FAILED-until-all-cod.patch new file mode 100644 index 0000000000..cfea527e3d --- /dev/null +++ b/target/linux/generic/pending-4.14/671-net-provide-defines-for-_POLICY_FAILED-until-all-cod.patch @@ -0,0 +1,50 @@ +From: Jonas Gorski +Subject: net: provide defines for _POLICY_FAILED until all code is updated + +Upstream introduced ICMPV6_POLICY_FAIL for code 5 of destination +unreachable, conflicting with our name. + +Add appropriate defines to allow our code to build with the new +name until we have updated our local patches for older kernels +and userspace packages. + +Signed-off-by: Jonas Gorski +--- + include/uapi/linux/fib_rules.h | 2 ++ + include/uapi/linux/icmpv6.h | 2 ++ + include/uapi/linux/rtnetlink.h | 2 ++ + 3 files changed, 6 insertions(+) + +--- a/include/uapi/linux/fib_rules.h ++++ b/include/uapi/linux/fib_rules.h +@@ -80,6 +80,8 @@ enum { + __FR_ACT_MAX, + }; + ++#define FR_ACT_FAILED_POLICY FR_ACT_POLICY_FAILED ++ + #define FR_ACT_MAX (__FR_ACT_MAX - 1) + + #endif +--- a/include/uapi/linux/icmpv6.h ++++ b/include/uapi/linux/icmpv6.h +@@ -119,6 +119,8 @@ struct icmp6hdr { + #define ICMPV6_POLICY_FAIL 5 + #define ICMPV6_REJECT_ROUTE 6 + ++#define ICMPV6_FAILED_POLICY ICMPV6_POLICY_FAIL ++ + /* + * Codes for Time Exceeded + */ +--- a/include/uapi/linux/rtnetlink.h ++++ b/include/uapi/linux/rtnetlink.h +@@ -225,6 +225,8 @@ enum { + __RTN_MAX + }; + ++#define RTN_FAILED_POLICY RTN_POLICY_FAILED ++ + #define RTN_MAX (__RTN_MAX - 1) + + diff --git a/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch new file mode 100644 index 0000000000..e7fb83cee2 --- /dev/null +++ b/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -0,0 +1,145 @@ +From: Felix Fietkau +Subject: net: replace GRO optimization patch with a new one that supports VLANs/bridges with different MAC addresses + +Signed-off-by: Felix Fietkau +--- + include/linux/netdevice.h | 2 ++ + include/linux/skbuff.h | 3 ++- + net/core/dev.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++ + net/ethernet/eth.c | 18 +++++++++++++++++- + 4 files changed, 69 insertions(+), 2 deletions(-) + +--- a/include/linux/netdevice.h ++++ b/include/linux/netdevice.h +@@ -1739,6 +1739,8 @@ struct net_device { + struct netdev_hw_addr_list mc; + struct netdev_hw_addr_list dev_addrs; + ++ unsigned char local_addr_mask[MAX_ADDR_LEN]; ++ + #ifdef CONFIG_SYSFS + struct kset *queues_kset; + #endif +--- a/include/linux/skbuff.h ++++ b/include/linux/skbuff.h +@@ -780,6 +780,7 @@ struct sk_buff { + __u8 tc_redirected:1; + __u8 tc_from_ingress:1; + #endif ++ __u8 gro_skip:1; + + #ifdef CONFIG_NET_SCHED + __u16 tc_index; /* traffic control index */ +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -4757,6 +4757,9 @@ static enum gro_result dev_gro_receive(s + enum gro_result ret; + int grow; + ++ if (skb->gro_skip) ++ goto normal; ++ + if (netif_elide_gro(skb->dev)) + goto normal; + +@@ -6227,6 +6230,48 @@ static void __netdev_adjacent_dev_unlink + &upper_dev->adj_list.lower); + } + ++static void __netdev_addr_mask(unsigned char *mask, const unsigned char *addr, ++ struct net_device *dev) ++{ ++ int i; ++ ++ for (i = 0; i < dev->addr_len; i++) ++ mask[i] |= addr[i] ^ dev->dev_addr[i]; ++} ++ ++static void __netdev_upper_mask(unsigned char *mask, struct net_device *dev, ++ struct net_device *lower) ++{ ++ struct net_device *cur; ++ struct list_head *iter; ++ ++ netdev_for_each_upper_dev_rcu(dev, cur, iter) { ++ __netdev_addr_mask(mask, cur->dev_addr, lower); ++ __netdev_upper_mask(mask, cur, lower); ++ } ++} ++ ++static void __netdev_update_addr_mask(struct net_device *dev) ++{ ++ unsigned char mask[MAX_ADDR_LEN]; ++ struct net_device *cur; ++ struct list_head *iter; ++ ++ memset(mask, 0, sizeof(mask)); ++ __netdev_upper_mask(mask, dev, dev); ++ memcpy(dev->local_addr_mask, mask, dev->addr_len); ++ ++ netdev_for_each_lower_dev(dev, cur, iter) ++ __netdev_update_addr_mask(cur); ++} ++ ++static void netdev_update_addr_mask(struct net_device *dev) ++{ ++ rcu_read_lock(); ++ __netdev_update_addr_mask(dev); ++ rcu_read_unlock(); ++} ++ + static int __netdev_upper_dev_link(struct net_device *dev, + struct net_device *upper_dev, bool master, + void *upper_priv, void *upper_info) +@@ -6342,6 +6387,8 @@ void netdev_upper_dev_unlink(struct net_ + + __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev); + ++ netdev_update_addr_mask(dev); ++ netdev_update_addr_mask(dev); + call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, + &changeupper_info.info); + } +@@ -6912,6 +6959,7 @@ int dev_set_mac_address(struct net_devic + if (err) + return err; + dev->addr_assign_type = NET_ADDR_SET; ++ netdev_update_addr_mask(dev); + call_netdevice_notifiers(NETDEV_CHANGEADDR, dev); + add_device_randomness(dev->dev_addr, dev->addr_len); + return 0; +--- a/net/ethernet/eth.c ++++ b/net/ethernet/eth.c +@@ -144,6 +144,18 @@ u32 eth_get_headlen(void *data, unsigned + } + EXPORT_SYMBOL(eth_get_headlen); + ++static inline bool ++eth_check_local_mask(const void *addr1, const void *addr2, const void *mask) ++{ ++ const u16 *a1 = addr1; ++ const u16 *a2 = addr2; ++ const u16 *m = mask; ++ ++ return (((a1[0] ^ a2[0]) & ~m[0]) | ++ ((a1[1] ^ a2[1]) & ~m[1]) | ++ ((a1[2] ^ a2[2]) & ~m[2])); ++} ++ + /** + * eth_type_trans - determine the packet's protocol ID. + * @skb: received socket data +@@ -172,8 +184,12 @@ __be16 eth_type_trans(struct sk_buff *sk + skb->pkt_type = PACKET_MULTICAST; + } + else if (unlikely(!ether_addr_equal_64bits(eth->h_dest, +- dev->dev_addr))) ++ dev->dev_addr))) { + skb->pkt_type = PACKET_OTHERHOST; ++ if (eth_check_local_mask(eth->h_dest, dev->dev_addr, ++ dev->local_addr_mask)) ++ skb->gro_skip = 1; ++ } + + /* + * Some variants of DSA tagging don't have an ethertype field diff --git a/target/linux/generic/pending-4.14/681-NET-add-of_get_mac_address_mtd.patch b/target/linux/generic/pending-4.14/681-NET-add-of_get_mac_address_mtd.patch new file mode 100644 index 0000000000..b29b5f11b0 --- /dev/null +++ b/target/linux/generic/pending-4.14/681-NET-add-of_get_mac_address_mtd.patch @@ -0,0 +1,127 @@ +From: John Crispin +Subject: NET: add mtd-mac-address support to of_get_mac_address() + +Many embedded devices have information such as mac addresses stored inside mtd +devices. This patch allows us to add a property inside a node describing a +network interface. The new property points at a mtd partition with an offset +where the mac address can be found. + +Signed-off-by: John Crispin +Signed-off-by: Felix Fietkau +--- + drivers/of/of_net.c | 37 +++++++++++++++++++++++++++++++++++++ + include/linux/of_net.h | 1 + + 2 files changed, 38 insertions(+) + +--- a/drivers/of/of_net.c ++++ b/drivers/of/of_net.c +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + /** + * of_get_phy_mode - Get phy mode for given device_node +@@ -38,7 +39,7 @@ int of_get_phy_mode(struct device_node * + } + EXPORT_SYMBOL_GPL(of_get_phy_mode); + +-static const void *of_get_mac_addr(struct device_node *np, const char *name) ++static void *of_get_mac_addr(struct device_node *np, const char *name) + { + struct property *pp = of_find_property(np, name, NULL); + +@@ -47,6 +48,73 @@ static const void *of_get_mac_addr(struc + return NULL; + } + ++static const void *of_get_mac_address_mtd(struct device_node *np) ++{ ++#ifdef CONFIG_MTD ++ struct device_node *mtd_np = NULL; ++ struct property *prop; ++ size_t retlen; ++ int size, ret; ++ struct mtd_info *mtd; ++ const char *part; ++ const __be32 *list; ++ phandle phandle; ++ u32 mac_inc = 0; ++ u8 mac[ETH_ALEN]; ++ void *addr; ++ ++ list = of_get_property(np, "mtd-mac-address", &size); ++ if (!list || (size != (2 * sizeof(*list)))) ++ return NULL; ++ ++ phandle = be32_to_cpup(list++); ++ if (phandle) ++ mtd_np = of_find_node_by_phandle(phandle); ++ ++ if (!mtd_np) ++ return NULL; ++ ++ part = of_get_property(mtd_np, "label", NULL); ++ if (!part) ++ part = mtd_np->name; ++ ++ mtd = get_mtd_device_nm(part); ++ if (IS_ERR(mtd)) ++ return NULL; ++ ++ ret = mtd_read(mtd, be32_to_cpup(list), 6, &retlen, mac); ++ put_mtd_device(mtd); ++ ++ if (!of_property_read_u32(np, "mtd-mac-address-increment", &mac_inc)) ++ mac[5] += mac_inc; ++ ++ if (!is_valid_ether_addr(mac)) ++ return NULL; ++ ++ addr = of_get_mac_addr(np, "mac-address"); ++ if (addr) { ++ memcpy(addr, mac, ETH_ALEN); ++ return addr; ++ } ++ ++ prop = kzalloc(sizeof(*prop), GFP_KERNEL); ++ if (!prop) ++ return NULL; ++ ++ prop->name = "mac-address"; ++ prop->length = ETH_ALEN; ++ prop->value = kmemdup(mac, ETH_ALEN, GFP_KERNEL); ++ if (!prop->value || of_add_property(np, prop)) ++ goto free; ++ ++ return prop->value; ++free: ++ kfree(prop->value); ++ kfree(prop); ++#endif ++ return NULL; ++} ++ + /** + * Search the device tree for the best MAC address to use. 'mac-address' is + * checked first, because that is supposed to contain to "most recent" MAC +@@ -64,11 +132,18 @@ static const void *of_get_mac_addr(struc + * addresses. Some older U-Boots only initialized 'local-mac-address'. In + * this case, the real MAC is in 'local-mac-address', and 'mac-address' exists + * but is all zeros. ++ * ++ * If a mtd-mac-address property exists, try to fetch the MAC address from the ++ * specified mtd device, and store it as a 'mac-address' property + */ + const void *of_get_mac_address(struct device_node *np) + { + const void *addr; + ++ addr = of_get_mac_address_mtd(np); ++ if (addr) ++ return addr; ++ + addr = of_get_mac_addr(np, "mac-address"); + if (addr) + return addr; diff --git a/target/linux/generic/pending-4.14/701-phy_extension.patch b/target/linux/generic/pending-4.14/701-phy_extension.patch new file mode 100644 index 0000000000..1b380e24a9 --- /dev/null +++ b/target/linux/generic/pending-4.14/701-phy_extension.patch @@ -0,0 +1,95 @@ +From: John Crispin +Subject: net: phy: add phy_ethtool_ioctl() + +Signed-off-by: John Crispin +--- + drivers/net/phy/phy.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ + include/linux/phy.h | 1 + + 2 files changed, 45 insertions(+) + +--- a/drivers/net/phy/phy.c ++++ b/drivers/net/phy/phy.c +@@ -382,6 +382,73 @@ void phy_ethtool_ksettings_get(struct ph + } + EXPORT_SYMBOL(phy_ethtool_ksettings_get); + ++static int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd) ++{ ++ cmd->supported = phydev->supported; ++ ++ cmd->advertising = phydev->advertising; ++ cmd->lp_advertising = phydev->lp_advertising; ++ ++ ethtool_cmd_speed_set(cmd, phydev->speed); ++ cmd->duplex = phydev->duplex; ++ if (phydev->interface == PHY_INTERFACE_MODE_MOCA) ++ cmd->port = PORT_BNC; ++ else ++ cmd->port = PORT_MII; ++ cmd->phy_address = phydev->mdio.addr; ++ cmd->transceiver = phy_is_internal(phydev) ? ++ XCVR_INTERNAL : XCVR_EXTERNAL; ++ cmd->autoneg = phydev->autoneg; ++ cmd->eth_tp_mdix_ctrl = phydev->mdix_ctrl; ++ cmd->eth_tp_mdix = phydev->mdix; ++ ++ return 0; ++} ++ ++int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr) ++{ ++ u32 cmd; ++ int tmp; ++ struct ethtool_cmd ecmd = { ETHTOOL_GSET }; ++ struct ethtool_value edata = { ETHTOOL_GLINK }; ++ ++ if (get_user(cmd, (u32 *) useraddr)) ++ return -EFAULT; ++ ++ switch (cmd) { ++ case ETHTOOL_GSET: ++ phy_ethtool_gset(phydev, &ecmd); ++ if (copy_to_user(useraddr, &ecmd, sizeof(ecmd))) ++ return -EFAULT; ++ return 0; ++ ++ case ETHTOOL_SSET: ++ if (copy_from_user(&ecmd, useraddr, sizeof(ecmd))) ++ return -EFAULT; ++ return phy_ethtool_sset(phydev, &ecmd); ++ ++ case ETHTOOL_NWAY_RST: ++ /* if autoneg is off, it's an error */ ++ tmp = phy_read(phydev, MII_BMCR); ++ if (tmp & BMCR_ANENABLE) { ++ tmp |= (BMCR_ANRESTART); ++ phy_write(phydev, MII_BMCR, tmp); ++ return 0; ++ } ++ return -EINVAL; ++ ++ case ETHTOOL_GLINK: ++ edata.data = (phy_read(phydev, ++ MII_BMSR) & BMSR_LSTATUS) ? 1 : 0; ++ if (copy_to_user(useraddr, &edata, sizeof(edata))) ++ return -EFAULT; ++ return 0; ++ } ++ ++ return -EOPNOTSUPP; ++} ++EXPORT_SYMBOL(phy_ethtool_ioctl); ++ + /** + * phy_mii_ioctl - generic PHY MII ioctl interface + * @phydev: the phy_device struct +--- a/include/linux/phy.h ++++ b/include/linux/phy.h +@@ -905,6 +905,7 @@ void phy_ethtool_ksettings_get(struct ph + struct ethtool_link_ksettings *cmd); + int phy_ethtool_ksettings_set(struct phy_device *phydev, + const struct ethtool_link_ksettings *cmd); ++int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr); + int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd); + int phy_start_interrupts(struct phy_device *phydev); + void phy_print_status(struct phy_device *phydev); diff --git a/target/linux/generic/pending-4.14/703-phy-add-detach-callback-to-struct-phy_driver.patch b/target/linux/generic/pending-4.14/703-phy-add-detach-callback-to-struct-phy_driver.patch new file mode 100644 index 0000000000..3d5f8fc5ed --- /dev/null +++ b/target/linux/generic/pending-4.14/703-phy-add-detach-callback-to-struct-phy_driver.patch @@ -0,0 +1,38 @@ +From: Gabor Juhos +Subject: generic: add detach callback to struct phy_driver + +lede-commit: fe61fc2d7d0b3fb348b502f68f98243b3ddf5867 + +Signed-off-by: Gabor Juhos +--- + drivers/net/phy/phy_device.c | 3 +++ + include/linux/phy.h | 6 ++++++ + 2 files changed, 9 insertions(+) + +--- a/drivers/net/phy/phy_device.c ++++ b/drivers/net/phy/phy_device.c +@@ -1095,6 +1095,9 @@ void phy_detach(struct phy_device *phyde + struct module *ndev_owner = dev->dev.parent->driver->owner; + struct mii_bus *bus; + ++ if (phydev->drv && phydev->drv->detach) ++ phydev->drv->detach(phydev); ++ + if (phydev->sysfs_links) { + sysfs_remove_link(&dev->dev.kobj, "phydev"); + sysfs_remove_link(&phydev->mdio.dev.kobj, "attached_dev"); +--- a/include/linux/phy.h ++++ b/include/linux/phy.h +@@ -559,6 +559,12 @@ struct phy_driver { + */ + int (*did_interrupt)(struct phy_device *phydev); + ++ /* ++ * Called before an ethernet device is detached ++ * from the PHY. ++ */ ++ void (*detach)(struct phy_device *phydev); ++ + /* Clears up any memory if needed */ + void (*remove)(struct phy_device *phydev); + diff --git a/target/linux/generic/pending-4.14/734-net-phy-at803x-allow-to-configure-via-pdata.patch b/target/linux/generic/pending-4.14/734-net-phy-at803x-allow-to-configure-via-pdata.patch new file mode 100644 index 0000000000..19dea170c3 --- /dev/null +++ b/target/linux/generic/pending-4.14/734-net-phy-at803x-allow-to-configure-via-pdata.patch @@ -0,0 +1,142 @@ +From: Gabor Juhos +Subject: net: phy: allow to configure AR803x PHYs via platform data + +Add a patch for the at803x phy driver, in order to be able +to configure some register settings via platform data. + +Signed-off-by: Gabor Juhos +--- + drivers/net/phy/at803x.c | 56 ++++++++++++++++++++++++++++++++ + include/linux/platform_data/phy-at803x.h | 11 +++++++ + 2 files changed, 67 insertions(+) + create mode 100644 include/linux/platform_data/phy-at803x.h + +--- a/drivers/net/phy/at803x.c ++++ b/drivers/net/phy/at803x.c +@@ -12,12 +12,14 @@ + */ + + #include ++#include + #include + #include + #include + #include + #include + #include ++#include + + #define AT803X_INTR_ENABLE 0x12 + #define AT803X_INTR_ENABLE_AUTONEG_ERR BIT(15) +@@ -45,6 +47,11 @@ + #define AT803X_REG_CHIP_CONFIG 0x1f + #define AT803X_BT_BX_REG_SEL 0x8000 + ++#define AT803X_PCS_SMART_EEE_CTRL3 0x805D ++#define AT803X_SMART_EEE_CTRL3_LPI_TX_DELAY_SEL_MASK 0x3 ++#define AT803X_SMART_EEE_CTRL3_LPI_TX_DELAY_SEL_SHIFT 12 ++#define AT803X_SMART_EEE_CTRL3_LPI_EN BIT(8) ++ + #define AT803X_DEBUG_ADDR 0x1D + #define AT803X_DEBUG_DATA 0x1E + +@@ -73,6 +80,7 @@ MODULE_LICENSE("GPL"); + struct at803x_priv { + bool phy_reset:1; + struct gpio_desc *gpiod_reset; ++ int prev_speed; + }; + + struct at803x_context { +@@ -277,8 +285,16 @@ does_not_require_reset_workaround: + return 0; + } + ++static void at803x_disable_smarteee(struct phy_device *phydev) ++{ ++ phy_write_mmd(phydev, MDIO_MMD_PCS, AT803X_PCS_SMART_EEE_CTRL3, ++ 1 << AT803X_SMART_EEE_CTRL3_LPI_TX_DELAY_SEL_SHIFT); ++ phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_EEE_ADV, 0); ++} ++ + static int at803x_config_init(struct phy_device *phydev) + { ++ struct at803x_platform_data *pdata; + int ret; + + ret = genphy_config_init(phydev); +@@ -299,6 +315,26 @@ static int at803x_config_init(struct phy + return ret; + } + ++ pdata = dev_get_platdata(&phydev->mdio.dev); ++ if (pdata) { ++ if (pdata->disable_smarteee) ++ at803x_disable_smarteee(phydev); ++ ++ if (pdata->enable_rgmii_rx_delay) ++ at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, 0, ++ AT803X_DEBUG_RX_CLK_DLY_EN); ++ else ++ at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, ++ AT803X_DEBUG_RX_CLK_DLY_EN, 0); ++ ++ if (pdata->enable_rgmii_tx_delay) ++ at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, 0, ++ AT803X_DEBUG_TX_CLK_DLY_EN); ++ else ++ at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, ++ AT803X_DEBUG_TX_CLK_DLY_EN, 0); ++ } ++ + return 0; + } + +@@ -336,6 +372,8 @@ static int at803x_config_intr(struct phy + static void at803x_link_change_notify(struct phy_device *phydev) + { + struct at803x_priv *priv = phydev->priv; ++ struct at803x_platform_data *pdata; ++ pdata = dev_get_platdata(&phydev->mdio.dev); + + /* + * Conduct a hardware reset for AT8030/2 every time a link loss is +@@ -364,6 +402,24 @@ static void at803x_link_change_notify(st + } else { + priv->phy_reset = false; + } ++ if (pdata && pdata->fixup_rgmii_tx_delay && ++ phydev->speed != priv->prev_speed) { ++ switch (phydev->speed) { ++ case SPEED_10: ++ case SPEED_100: ++ at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, 0, ++ AT803X_DEBUG_TX_CLK_DLY_EN); ++ break; ++ case SPEED_1000: ++ at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, ++ AT803X_DEBUG_TX_CLK_DLY_EN, 0); ++ break; ++ default: ++ break; ++ } ++ ++ priv->prev_speed = phydev->speed; ++ } + } + + static int at803x_aneg_done(struct phy_device *phydev) +--- /dev/null ++++ b/include/linux/platform_data/phy-at803x.h +@@ -0,0 +1,11 @@ ++#ifndef _PHY_AT803X_PDATA_H ++#define _PHY_AT803X_PDATA_H ++ ++struct at803x_platform_data { ++ int disable_smarteee:1; ++ int enable_rgmii_tx_delay:1; ++ int enable_rgmii_rx_delay:1; ++ int fixup_rgmii_tx_delay:1; ++}; ++ ++#endif /* _PHY_AT803X_PDATA_H */ diff --git a/target/linux/generic/pending-4.14/735-net-phy-at803x-fix-at8033-sgmii-mode.patch b/target/linux/generic/pending-4.14/735-net-phy-at803x-fix-at8033-sgmii-mode.patch new file mode 100644 index 0000000000..3c686623b9 --- /dev/null +++ b/target/linux/generic/pending-4.14/735-net-phy-at803x-fix-at8033-sgmii-mode.patch @@ -0,0 +1,54 @@ +From: Roman Yeryomin +Subject: kernel: add at803x fix for sgmii mode + +Some (possibly broken) bootloaders incorreclty initialize at8033 +phy. This patch enables sgmii autonegotiation mode. + +[john@phrozen.org: felix added this to his upstream queue] + +Signed-off-by: Roman Yeryomin +--- + drivers/net/phy/at803x.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +--- a/drivers/net/phy/at803x.c ++++ b/drivers/net/phy/at803x.c +@@ -55,6 +55,10 @@ + #define AT803X_DEBUG_ADDR 0x1D + #define AT803X_DEBUG_DATA 0x1E + ++#define AT803X_REG_CHIP_CONFIG 0x1f ++#define AT803X_BT_BX_REG_SEL 0x8000 ++#define AT803X_SGMII_ANEG_EN 0x1000 ++ + #define AT803X_MODE_CFG_MASK 0x0F + #define AT803X_MODE_CFG_SGMII 0x01 + +@@ -296,6 +300,27 @@ static int at803x_config_init(struct phy + { + struct at803x_platform_data *pdata; + int ret; ++ u32 v; ++ ++ if (phydev->drv->phy_id == ATH8031_PHY_ID && ++ phydev->interface == PHY_INTERFACE_MODE_SGMII) ++ { ++ v = phy_read(phydev, AT803X_REG_CHIP_CONFIG); ++ /* select SGMII/fiber page */ ++ ret = phy_write(phydev, AT803X_REG_CHIP_CONFIG, ++ v & ~AT803X_BT_BX_REG_SEL); ++ if (ret) ++ return ret; ++ /* enable SGMII autonegotiation */ ++ ret = phy_write(phydev, MII_BMCR, AT803X_SGMII_ANEG_EN); ++ if (ret) ++ return ret; ++ /* select copper page */ ++ ret = phy_write(phydev, AT803X_REG_CHIP_CONFIG, ++ v | AT803X_BT_BX_REG_SEL); ++ if (ret) ++ return ret; ++ } + + ret = genphy_config_init(phydev); + if (ret < 0) diff --git a/target/linux/generic/pending-4.14/810-pci_disable_common_quirks.patch b/target/linux/generic/pending-4.14/810-pci_disable_common_quirks.patch new file mode 100644 index 0000000000..2a5bcc8ef1 --- /dev/null +++ b/target/linux/generic/pending-4.14/810-pci_disable_common_quirks.patch @@ -0,0 +1,60 @@ +From: Gabor Juhos +Subject: debloat: add kernel config option to disabling common PCI quirks + +Signed-off-by: Gabor Juhos +--- + drivers/pci/Kconfig | 6 ++++++ + drivers/pci/quirks.c | 6 ++++++ + 2 files changed, 12 insertions(+) + +--- a/drivers/pci/Kconfig ++++ b/drivers/pci/Kconfig +@@ -71,6 +71,12 @@ config XEN_PCIDEV_FRONTEND + The PCI device frontend driver allows the kernel to import arbitrary + PCI devices from a PCI backend to support PCI driver domains. + ++config PCI_DISABLE_COMMON_QUIRKS ++ bool "PCI disable common quirks" ++ depends on PCI ++ help ++ If you don't know what to do here, say N. ++ + config HT_IRQ + bool "Interrupts on hypertransport devices" + default y +--- a/drivers/pci/quirks.c ++++ b/drivers/pci/quirks.c +@@ -43,6 +43,7 @@ static void quirk_mmio_always_on(struct + DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_ANY_ID, PCI_ANY_ID, + PCI_CLASS_BRIDGE_HOST, 8, quirk_mmio_always_on); + ++#ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS + /* The Mellanox Tavor device gives false positive parity errors + * Mark this device with a broken_parity_status, to allow + * PCI scanning code to "skip" this now blacklisted device. +@@ -3077,6 +3078,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f9, quirk_intel_mc_errata); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65fa, quirk_intel_mc_errata); + ++#endif /* !CONFIG_PCI_DISABLE_COMMON_QUIRKS */ + + /* + * Ivytown NTB BAR sizes are misreported by the hardware due to an erratum. To +@@ -3133,6 +3135,8 @@ static void fixup_debug_report(struct pc + } + } + ++#ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS ++ + /* + * Some BIOS implementations leave the Intel GPU interrupts enabled, + * even though no one is handling them (f.e. i915 driver is never loaded). +@@ -3167,6 +3171,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN + DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); + DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq); + ++#endif /* !CONFIG_PCI_DISABLE_COMMON_QUIRKS */ ++ + /* + * PCI devices which are on Intel chips can skip the 10ms delay + * before entering D3 mode. diff --git a/target/linux/generic/pending-4.14/811-pci_disable_usb_common_quirks.patch b/target/linux/generic/pending-4.14/811-pci_disable_usb_common_quirks.patch new file mode 100644 index 0000000000..005c25d048 --- /dev/null +++ b/target/linux/generic/pending-4.14/811-pci_disable_usb_common_quirks.patch @@ -0,0 +1,113 @@ +From: Felix Fietkau +Subject: debloat: disable common USB quirks + +Signed-off-by: Felix Fietkau +--- + drivers/usb/host/pci-quirks.c | 16 ++++++++++++++++ + drivers/usb/host/pci-quirks.h | 18 +++++++++++++++++- + include/linux/usb/hcd.h | 7 +++++++ + 3 files changed, 40 insertions(+), 1 deletion(-) + +--- a/drivers/usb/host/pci-quirks.c ++++ b/drivers/usb/host/pci-quirks.c +@@ -107,6 +107,8 @@ struct amd_chipset_type { + u8 rev; + }; + ++#ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS ++ + static struct amd_chipset_info { + struct pci_dev *nb_dev; + struct pci_dev *smbus_dev; +@@ -511,6 +513,10 @@ void usb_amd_dev_put(void) + } + EXPORT_SYMBOL_GPL(usb_amd_dev_put); + ++#endif /* CONFIG_PCI_DISABLE_COMMON_QUIRKS */ ++ ++#if IS_ENABLED(CONFIG_USB_UHCI_HCD) ++ + /* + * Make sure the controller is completely inactive, unable to + * generate interrupts or do DMA. +@@ -590,8 +596,17 @@ reset_needed: + uhci_reset_hc(pdev, base); + return 1; + } ++#else ++int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base) ++{ ++ return 0; ++} ++ ++#endif + EXPORT_SYMBOL_GPL(uhci_check_and_reset_hc); + ++#ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS ++ + static inline int io_type_enabled(struct pci_dev *pdev, unsigned int mask) + { + u16 cmd; +@@ -1158,6 +1173,7 @@ static void quirk_usb_early_handoff(stru + } + DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID, + PCI_CLASS_SERIAL_USB, 8, quirk_usb_early_handoff); ++#endif + + bool usb_xhci_needs_pci_reset(struct pci_dev *pdev) + { +--- a/drivers/usb/host/pci-quirks.h ++++ b/drivers/usb/host/pci-quirks.h +@@ -5,6 +5,9 @@ + #ifdef CONFIG_USB_PCI + void uhci_reset_hc(struct pci_dev *pdev, unsigned long base); + int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base); ++#endif /* CONFIG_USB_PCI */ ++ ++#if defined(CONFIG_USB_PCI) && !defined(CONFIG_PCI_DISABLE_COMMON_QUIRKS) + int usb_amd_find_chipset_info(void); + int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *pdev); + bool usb_amd_hang_symptom_quirk(void); +@@ -19,12 +22,25 @@ void sb800_prefetch(struct device *dev, + bool usb_xhci_needs_pci_reset(struct pci_dev *pdev); + #else + struct pci_dev; ++static inline int usb_amd_find_chipset_info(void) ++{ ++ return 0; ++} ++static inline bool usb_amd_hang_symptom_quirk(void) ++{ ++ return false; ++} ++static inline bool usb_amd_prefetch_quirk(void) ++{ ++ return false; ++} + static inline void usb_amd_quirk_pll_disable(void) {} + static inline void usb_amd_quirk_pll_enable(void) {} + static inline void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev) {} + static inline void usb_amd_dev_put(void) {} + static inline void usb_disable_xhci_ports(struct pci_dev *xhci_pdev) {} + static inline void sb800_prefetch(struct device *dev, int on) {} ++static inline void usb_enable_intel_xhci_ports(struct pci_dev *xhci_pdev) {} + #endif /* CONFIG_USB_PCI */ + + #endif /* __LINUX_USB_PCI_QUIRKS_H */ +--- a/include/linux/usb/hcd.h ++++ b/include/linux/usb/hcd.h +@@ -465,7 +465,14 @@ extern int usb_hcd_pci_probe(struct pci_ + extern void usb_hcd_pci_remove(struct pci_dev *dev); + extern void usb_hcd_pci_shutdown(struct pci_dev *dev); + ++#ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS + extern int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *dev); ++#else ++static inline int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *dev) ++{ ++ return 0; ++} ++#endif + + #ifdef CONFIG_PM + extern const struct dev_pm_ops usb_hcd_pci_pm_ops; diff --git a/target/linux/generic/pending-4.14/821-usb-Remove-annoying-warning-about-bogus-URB.patch b/target/linux/generic/pending-4.14/821-usb-Remove-annoying-warning-about-bogus-URB.patch new file mode 100644 index 0000000000..c14e679590 --- /dev/null +++ b/target/linux/generic/pending-4.14/821-usb-Remove-annoying-warning-about-bogus-URB.patch @@ -0,0 +1,76 @@ +From: Alexey Brodkin +Subject: usb: Remove annoying warning about bogus URB + +When ath9k-htc Wi-Fi dongle is used with generic OHCI controller +infinite stream of warnings appears in debug console like this: +-------------------------->8---------------------- +usb 1-1: new full-speed USB device number 2 using ohci-platform +usb 1-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested +usb 1-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.4.0.fw, size: +51008 +------------[ cut here ]------------ +WARNING: CPU: 0 PID: 19 at drivers/usb/core/urb.c:449 +usb_submit_urb+0x1b4/0x498() +usb 1-1: BOGUS urb xfer, pipe 1 != type 3 +Modules linked in: +CPU: 0 PID: 19 Comm: kworker/0:1 Not tainted +4.4.0-rc4-00017-g00e2d79-dirty #3 +Workqueue: events request_firmware_work_func + +Stack Trace: + arc_unwind_core.constprop.1+0xa4/0x110 +---[ end trace 649ef8c342817fc2 ]--- +------------[ cut here ]------------ +WARNING: CPU: 0 PID: 19 at drivers/usb/core/urb.c:449 +usb_submit_urb+0x1b4/0x498() +usb 1-1: BOGUS urb xfer, pipe 1 != type 3 +Modules linked in: +CPU: 0 PID: 19 Comm: kworker/0:1 Tainted: G W +4.4.0-rc4-00017-g00e2d79-dirty #3 +Workqueue: events request_firmware_work_func + +Stack Trace: + arc_unwind_core.constprop.1+0xa4/0x110 +---[ end trace 649ef8c342817fc3 ]--- +------------[ cut here ]------------ +-------------------------->8---------------------- + +There're some discussions in mailing lists proposing to disable +that particular check alltogether and magically all seem to work +fine with muted warning. + +Anyways new thread on that regard could be found here: +http://lists.infradead.org/pipermail/linux-snps-arc/2016-July/001310.html + +Let's see what comes out of that new discussion, hopefully patching +of generic USB stuff won't be required then. + +Signed-off-by: Alexey Brodkin +--- + drivers/usb/core/urb.c | 5 ----- + 1 file changed, 5 deletions(-) + +--- a/drivers/usb/core/urb.c ++++ b/drivers/usb/core/urb.c +@@ -326,9 +326,6 @@ EXPORT_SYMBOL_GPL(usb_unanchor_urb); + */ + int usb_submit_urb(struct urb *urb, gfp_t mem_flags) + { +- static int pipetypes[4] = { +- PIPE_CONTROL, PIPE_ISOCHRONOUS, PIPE_BULK, PIPE_INTERRUPT +- }; + int xfertype, max; + struct usb_device *dev; + struct usb_host_endpoint *ep; +@@ -443,11 +440,6 @@ int usb_submit_urb(struct urb *urb, gfp_ + * cause problems in HCDs if they get it wrong. + */ + +- /* Check that the pipe's type matches the endpoint's type */ +- if (usb_pipetype(urb->pipe) != pipetypes[xfertype]) +- dev_WARN(&dev->dev, "BOGUS urb xfer, pipe %x != type %x\n", +- usb_pipetype(urb->pipe), pipetypes[xfertype]); +- + /* Check against a simple/standard policy */ + allowed = (URB_NO_TRANSFER_DMA_MAP | URB_NO_INTERRUPT | URB_DIR_MASK | + URB_FREE_BUFFER); diff --git a/target/linux/generic/pending-4.14/831-ledtrig_netdev.patch b/target/linux/generic/pending-4.14/831-ledtrig_netdev.patch new file mode 100644 index 0000000000..a12e6dba96 --- /dev/null +++ b/target/linux/generic/pending-4.14/831-ledtrig_netdev.patch @@ -0,0 +1,74 @@ +From: Alexey Brodkin +Subject: usb: Remove annoying warning about bogus URB + +When ath9k-htc Wi-Fi dongle is used with generic OHCI controller +infinite stream of warnings appears in debug console like this: +-------------------------->8---------------------- +usb 1-1: new full-speed USB device number 2 using ohci-platform +usb 1-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested +usb 1-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.4.0.fw, size: +51008 +------------[ cut here ]------------ +WARNING: CPU: 0 PID: 19 at drivers/usb/core/urb.c:449 +usb_submit_urb+0x1b4/0x498() +usb 1-1: BOGUS urb xfer, pipe 1 != type 3 +Modules linked in: +CPU: 0 PID: 19 Comm: kworker/0:1 Not tainted +4.4.0-rc4-00017-g00e2d79-dirty #3 +Workqueue: events request_firmware_work_func + +Stack Trace: +arc_unwind_core.constprop.1+0xa4/0x110 +---[ end trace 649ef8c342817fc2 ]--- +------------[ cut here ]------------ +WARNING: CPU: 0 PID: 19 at drivers/usb/core/urb.c:449 +usb_submit_urb+0x1b4/0x498() +usb 1-1: BOGUS urb xfer, pipe 1 != type 3 +Modules linked in: +CPU: 0 PID: 19 Comm: kworker/0:1 Tainted: G W +4.4.0-rc4-00017-g00e2d79-dirty #3 +Workqueue: events request_firmware_work_func + +Stack Trace: +arc_unwind_core.constprop.1+0xa4/0x110 +---[ end trace 649ef8c342817fc3 ]--- +------------[ cut here ]------------ +-------------------------->8---------------------- + +There're some discussions in mailing lists proposing to disable +that particular check alltogether and magically all seem to work +fine with muted warning. + +Anyways new thread on that regard could be found here: +http://lists.infradead.org/pipermail/linux-snps-arc/2016-July/001310.html + +Let's see what comes out of that new discussion, hopefully patching +of generic USB stuff won't be required then. + +Signed-off-by: Alexey Brodkin +--- + drivers/leds/Makefile | 1 + + drivers/leds/trigger/Kconfig | 7 +++++++ + 2 files changed, 8 insertions(+) + +--- a/drivers/leds/Makefile ++++ b/drivers/leds/Makefile +@@ -82,3 +82,4 @@ obj-$(CONFIG_LEDS_USER) += uleds.o + + # LED Triggers + obj-$(CONFIG_LEDS_TRIGGERS) += trigger/ ++obj-$(CONFIG_LEDS_TRIGGER_NETDEV) += ledtrig-netdev.o +--- a/drivers/leds/trigger/Kconfig ++++ b/drivers/leds/trigger/Kconfig +@@ -126,4 +126,11 @@ config LEDS_TRIGGER_PANIC + a different trigger. + If unsure, say Y. + ++config LEDS_TRIGGER_NETDEV ++ tristate "LED Netdev Trigger" ++ depends on NET && LEDS_TRIGGERS ++ help ++ This allows LEDs to be controlled by network device activity. ++ If unsure, say Y. ++ + endif # LEDS_TRIGGERS diff --git a/target/linux/generic/pending-4.14/834-ledtrig-libata.patch b/target/linux/generic/pending-4.14/834-ledtrig-libata.patch new file mode 100644 index 0000000000..8597a936f5 --- /dev/null +++ b/target/linux/generic/pending-4.14/834-ledtrig-libata.patch @@ -0,0 +1,149 @@ +From: Daniel Golle +Subject: libata: add ledtrig support + +This adds a LED trigger for each ATA port indicating disk activity. + +As this is needed only on specific platforms (NAS SoCs and such), +these platforms should define ARCH_WANTS_LIBATA_LEDS if there +are boards with LED(s) intended to indicate ATA disk activity and +need the OS to take care of that. +In that way, if not selected, LED trigger support not will be +included in libata-core and both, codepaths and structures remain +untouched. + +Signed-off-by: Daniel Golle +--- + drivers/ata/Kconfig | 16 ++++++++++++++++ + drivers/ata/libata-core.c | 41 +++++++++++++++++++++++++++++++++++++++++ + include/linux/libata.h | 9 +++++++++ + 3 files changed, 66 insertions(+) + +--- a/drivers/ata/Kconfig ++++ b/drivers/ata/Kconfig +@@ -46,6 +46,22 @@ config ATA_VERBOSE_ERROR + + If unsure, say Y. + ++config ARCH_WANT_LIBATA_LEDS ++ bool ++ ++config ATA_LEDS ++ bool "support ATA port LED triggers" ++ depends on ARCH_WANT_LIBATA_LEDS ++ select NEW_LEDS ++ select LEDS_CLASS ++ select LEDS_TRIGGERS ++ default y ++ help ++ This option adds a LED trigger for each registered ATA port. ++ It is used to drive disk activity leds connected via GPIO. ++ ++ If unsure, say N. ++ + config ATA_ACPI + bool "ATA ACPI Support" + depends on ACPI +--- a/drivers/ata/libata-core.c ++++ b/drivers/ata/libata-core.c +@@ -731,6 +731,19 @@ u64 ata_tf_read_block(const struct ata_t + return block; + } + ++#ifdef CONFIG_ATA_LEDS ++#define LIBATA_BLINK_DELAY 20 /* ms */ ++static inline void ata_led_act(struct ata_port *ap) ++{ ++ unsigned long led_delay = LIBATA_BLINK_DELAY; ++ ++ if (unlikely(!ap->ledtrig)) ++ return; ++ ++ led_trigger_blink_oneshot(ap->ledtrig, &led_delay, &led_delay, 0); ++} ++#endif ++ + /** + * ata_build_rw_tf - Build ATA taskfile for given read/write request + * @tf: Target ATA taskfile +@@ -5089,6 +5102,9 @@ struct ata_queued_cmd *ata_qc_new_init(s + if (tag < 0) + return NULL; + } ++#ifdef CONFIG_ATA_LEDS ++ ata_led_act(ap); ++#endif + + qc = __ata_qc_from_tag(ap, tag); + qc->tag = tag; +@@ -5991,6 +6007,9 @@ struct ata_port *ata_port_alloc(struct a + ap->stats.unhandled_irq = 1; + ap->stats.idle_irq = 1; + #endif ++#ifdef CONFIG_ATA_LEDS ++ ap->ledtrig = kzalloc(sizeof(struct led_trigger), GFP_KERNEL); ++#endif + ata_sff_port_init(ap); + + return ap; +@@ -6012,6 +6031,12 @@ static void ata_host_release(struct devi + + kfree(ap->pmp_link); + kfree(ap->slave_link); ++#ifdef CONFIG_ATA_LEDS ++ if (ap->ledtrig) { ++ led_trigger_unregister(ap->ledtrig); ++ kfree(ap->ledtrig); ++ }; ++#endif + kfree(ap); + host->ports[i] = NULL; + } +@@ -6458,7 +6483,23 @@ int ata_host_register(struct ata_host *h + host->ports[i]->print_id = atomic_inc_return(&ata_print_id); + host->ports[i]->local_port_no = i + 1; + } ++#ifdef CONFIG_ATA_LEDS ++ for (i = 0; i < host->n_ports; i++) { ++ if (unlikely(!host->ports[i]->ledtrig)) ++ continue; + ++ snprintf(host->ports[i]->ledtrig_name, ++ sizeof(host->ports[i]->ledtrig_name), "ata%u", ++ host->ports[i]->print_id); ++ ++ host->ports[i]->ledtrig->name = host->ports[i]->ledtrig_name; ++ ++ if (led_trigger_register(host->ports[i]->ledtrig)) { ++ kfree(host->ports[i]->ledtrig); ++ host->ports[i]->ledtrig = NULL; ++ } ++ } ++#endif + /* Create associated sysfs transport objects */ + for (i = 0; i < host->n_ports; i++) { + rc = ata_tport_add(host->dev,host->ports[i]); +--- a/include/linux/libata.h ++++ b/include/linux/libata.h +@@ -38,6 +38,9 @@ + #include + #include + #include ++#ifdef CONFIG_ATA_LEDS ++#include ++#endif + + /* + * Define if arch has non-standard setup. This is a _PCI_ standard +@@ -889,6 +892,12 @@ struct ata_port { + #ifdef CONFIG_ATA_ACPI + struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */ + #endif ++ ++#ifdef CONFIG_ATA_LEDS ++ struct led_trigger *ledtrig; ++ char ledtrig_name[8]; ++#endif ++ + /* owned by EH */ + u8 sector_buf[ATA_SECT_SIZE] ____cacheline_aligned; + }; diff --git a/target/linux/generic/pending-4.14/920-mangle_bootargs.patch b/target/linux/generic/pending-4.14/920-mangle_bootargs.patch new file mode 100644 index 0000000000..ec5ec6b521 --- /dev/null +++ b/target/linux/generic/pending-4.14/920-mangle_bootargs.patch @@ -0,0 +1,71 @@ +From: Imre Kaloz +Subject: init: add CONFIG_MANGLE_BOOTARGS and disable it by default + +Enabling this option renames the bootloader supplied root= +and rootfstype= variables, which might have to be know but +would break the automatisms OpenWrt uses. + +Signed-off-by: Imre Kaloz +--- + init/Kconfig | 9 +++++++++ + init/main.c | 24 ++++++++++++++++++++++++ + 2 files changed, 33 insertions(+) + +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -1420,6 +1420,15 @@ config EMBEDDED + an embedded system so certain expert options are available + for configuration. + ++config MANGLE_BOOTARGS ++ bool "Rename offending bootargs" ++ depends on EXPERT ++ help ++ Sometimes the bootloader passed bogus root= and rootfstype= ++ parameters to the kernel, and while you want to ignore them, ++ you need to know the values f.e. to support dual firmware ++ layouts on the flash. ++ + config HAVE_PERF_EVENTS + bool + help +--- a/init/main.c ++++ b/init/main.c +@@ -360,6 +360,29 @@ static inline void setup_nr_cpu_ids(void + static inline void smp_prepare_cpus(unsigned int maxcpus) { } + #endif + ++#ifdef CONFIG_MANGLE_BOOTARGS ++static void __init mangle_bootargs(char *command_line) ++{ ++ char *rootdev; ++ char *rootfs; ++ ++ rootdev = strstr(command_line, "root=/dev/mtdblock"); ++ ++ if (rootdev) ++ strncpy(rootdev, "mangled_rootblock=", 18); ++ ++ rootfs = strstr(command_line, "rootfstype"); ++ ++ if (rootfs) ++ strncpy(rootfs, "mangled_fs", 10); ++ ++} ++#else ++static void __init mangle_bootargs(char *command_line) ++{ ++} ++#endif ++ + /* + * We need to store the untouched command line for future reference. + * We also need to store the touched command line since the parameter +@@ -541,6 +564,7 @@ asmlinkage __visible void __init start_k + add_device_randomness(command_line, strlen(command_line)); + boot_init_stack_canary(); + mm_init_cpumask(&init_mm); ++ mangle_bootargs(command_line); + setup_command_line(command_line); + setup_nr_cpu_ids(); + setup_per_cpu_areas(); diff --git a/target/linux/generic/pending-4.4/001-mtdsplit_backport.patch b/target/linux/generic/pending-4.4/001-mtdsplit_backport.patch index 97cd62d75c..f0839b6b90 100644 --- a/target/linux/generic/pending-4.4/001-mtdsplit_backport.patch +++ b/target/linux/generic/pending-4.4/001-mtdsplit_backport.patch @@ -140,3 +140,14 @@ { struct wrgg03_header hdr; size_t hdr_len, retlen, kernel_ent_size; +--- a/drivers/mtd/mtdsplit/mtdsplit_minor.c ++++ b/drivers/mtd/mtdsplit/mtdsplit_minor.c +@@ -49,7 +49,7 @@ struct minor_header { + }; + + static int mtdsplit_parse_minor(struct mtd_info *master, +- const struct mtd_partition **pparts, ++ struct mtd_partition **pparts, + struct mtd_part_parser_data *data) + { + struct minor_header hdr; diff --git a/target/linux/generic/pending-4.4/002-phy_drivers_backport.patch b/target/linux/generic/pending-4.4/002-phy_drivers_backport.patch index 5d83aa3bb1..6c9f30a97d 100644 --- a/target/linux/generic/pending-4.4/002-phy_drivers_backport.patch +++ b/target/linux/generic/pending-4.4/002-phy_drivers_backport.patch @@ -464,7 +464,7 @@ module_init(psb6970_init); --- a/drivers/net/phy/rtl8306.c +++ b/drivers/net/phy/rtl8306.c -@@ -876,7 +876,7 @@ rtl8306_config_init(struct phy_device *p +@@ -877,7 +877,7 @@ rtl8306_config_init(struct phy_device *p int err; /* Only init the switch for the primary PHY */ @@ -473,7 +473,7 @@ return 0; val.value.i = 1; -@@ -886,7 +886,7 @@ rtl8306_config_init(struct phy_device *p +@@ -887,7 +887,7 @@ rtl8306_config_init(struct phy_device *p priv->dev.ops = &rtl8306_ops; priv->do_cpu = 0; priv->page = -1; @@ -482,7 +482,7 @@ chipid = rtl_get(dev, RTL_REG_CHIPID); chipver = rtl_get(dev, RTL_REG_CHIPVER); -@@ -932,13 +932,13 @@ rtl8306_fixup(struct phy_device *pdev) +@@ -933,13 +933,13 @@ rtl8306_fixup(struct phy_device *pdev) u16 chipid; /* Attach to primary LAN port and WAN port */ @@ -498,7 +498,7 @@ chipid = rtl_get(&priv.dev, RTL_REG_CHIPID); if (chipid == 0x5988) pdev->phy_id = RTL8306_MAGIC; -@@ -956,14 +956,14 @@ rtl8306_probe(struct phy_device *pdev) +@@ -957,14 +957,14 @@ rtl8306_probe(struct phy_device *pdev) * share one rtl_priv instance between virtual phy * devices on the same bus */ @@ -515,7 +515,7 @@ found: pdev->priv = priv; -@@ -984,7 +984,7 @@ rtl8306_config_aneg(struct phy_device *p +@@ -985,7 +985,7 @@ rtl8306_config_aneg(struct phy_device *p struct rtl_priv *priv = pdev->priv; /* Only for WAN */ @@ -524,7 +524,7 @@ return 0; /* Restart autonegotiation */ -@@ -1000,7 +1000,7 @@ rtl8306_read_status(struct phy_device *p +@@ -1001,7 +1001,7 @@ rtl8306_read_status(struct phy_device *p struct rtl_priv *priv = pdev->priv; struct switch_dev *dev = &priv->dev; @@ -533,7 +533,7 @@ /* WAN */ pdev->speed = rtl_get(dev, RTL_PORT_REG(4, SPEED)) ? SPEED_100 : SPEED_10; pdev->duplex = rtl_get(dev, RTL_PORT_REG(4, DUPLEX)) ? DUPLEX_FULL : DUPLEX_HALF; -@@ -1041,6 +1041,7 @@ static struct phy_driver rtl8306_driver +@@ -1044,6 +1044,7 @@ static struct phy_driver rtl8306_driver .config_init = &rtl8306_config_init, .config_aneg = &rtl8306_config_aneg, .read_status = &rtl8306_read_status, @@ -541,7 +541,7 @@ }; -@@ -1048,7 +1049,7 @@ static int __init +@@ -1051,7 +1052,7 @@ static int __init rtl_init(void) { phy_register_fixup_for_id(PHY_ANY_ID, rtl8306_fixup); diff --git a/target/linux/generic/pending-4.4/093-MIPS-store-the-appended-dtb-address-in-a-variable.patch b/target/linux/generic/pending-4.4/093-MIPS-store-the-appended-dtb-address-in-a-variable.patch index 764c1cb830..d868d210aa 100644 --- a/target/linux/generic/pending-4.4/093-MIPS-store-the-appended-dtb-address-in-a-variable.patch +++ b/target/linux/generic/pending-4.4/093-MIPS-store-the-appended-dtb-address-in-a-variable.patch @@ -119,7 +119,7 @@ Signed-off-by: Ralf Baechle /* Set the SP after an empty pt_regs. */ --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c -@@ -814,6 +814,10 @@ void __init setup_arch(char **cmdline_p) +@@ -886,6 +886,10 @@ void __init setup_arch(char **cmdline_p) unsigned long kernelsp[NR_CPUS]; unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3; diff --git a/target/linux/generic/pending-4.4/103-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-4.4/103-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index 6c9b12c2e1..a53be2d15c 100644 --- a/target/linux/generic/pending-4.4/103-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/target/linux/generic/pending-4.4/103-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -75,7 +75,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -5357,7 +5357,7 @@ static void __init_refok alloc_node_mem_ +@@ -5372,7 +5372,7 @@ static void __init_refok alloc_node_mem_ mem_map = NODE_DATA(0)->node_mem_map; #if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM) if (page_to_pfn(mem_map) != pgdat->node_start_pfn) diff --git a/target/linux/generic/pending-4.4/204-module_strip.patch b/target/linux/generic/pending-4.4/204-module_strip.patch index 85805b3ea1..d4c8039f75 100644 --- a/target/linux/generic/pending-4.4/204-module_strip.patch +++ b/target/linux/generic/pending-4.4/204-module_strip.patch @@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau config MODULES_TREE_LOOKUP --- a/kernel/module.c +++ b/kernel/module.c -@@ -2864,6 +2864,7 @@ static struct module *setup_load_info(st +@@ -2871,6 +2871,7 @@ static struct module *setup_load_info(st static int check_modinfo(struct module *mod, struct load_info *info, int flags) { @@ -113,7 +113,7 @@ Signed-off-by: Felix Fietkau const char *modmagic = get_modinfo(info, "vermagic"); int err; -@@ -2889,6 +2890,7 @@ static int check_modinfo(struct module * +@@ -2900,6 +2901,7 @@ static int check_modinfo(struct module * pr_warn("%s: module is from the staging directory, the quality " "is unknown, you have been warned.\n", mod->name); } diff --git a/target/linux/generic/pending-4.4/208-disable-modorder.patch b/target/linux/generic/pending-4.4/208-disable-modorder.patch index 7ea91f2951..00d6e41952 100644 --- a/target/linux/generic/pending-4.4/208-disable-modorder.patch +++ b/target/linux/generic/pending-4.4/208-disable-modorder.patch @@ -5,7 +5,7 @@ Signed-off-by: Felix Fietkau --- --- a/Makefile +++ b/Makefile -@@ -1118,7 +1118,6 @@ all: modules +@@ -1121,7 +1121,6 @@ all: modules PHONY += modules modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin @@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild -@@ -1148,7 +1147,6 @@ _modinst_: +@@ -1151,7 +1150,6 @@ _modinst_: rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ fi diff --git a/target/linux/generic/pending-4.4/214-spidev_h_portability.patch b/target/linux/generic/pending-4.4/214-spidev_h_portability.patch index dbee090547..39fa32ffa2 100644 --- a/target/linux/generic/pending-4.4/214-spidev_h_portability.patch +++ b/target/linux/generic/pending-4.4/214-spidev_h_portability.patch @@ -1,6 +1,6 @@ --- a/include/uapi/linux/spi/spidev.h +++ b/include/uapi/linux/spi/spidev.h -@@ -111,7 +111,7 @@ struct spi_ioc_transfer { +@@ -112,7 +112,7 @@ struct spi_ioc_transfer { /* not all platforms use or _IOC_TYPECHECK() ... */ #define SPI_MSGSIZE(N) \ diff --git a/target/linux/generic/pending-4.4/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-4.4/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index f08f9b4a7c..b15066f757 100644 --- a/target/linux/generic/pending-4.4/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-4.4/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -36,7 +36,7 @@ Signed-off-by: Daniel Golle + /* check for a valid ubi magic */ + err = mtd_read(mtd, 0, 4, &len, (void *) magic); + if (!err && len == 4 && strncmp(magic, "UBI#", 4)) { -+ pr_err("UBI error: no valid UBI magic found inside mtd%d", mtd->index); ++ pr_err("UBI error: no valid UBI magic found inside mtd%d\n", mtd->index); + put_mtd_device(mtd); + return; + } @@ -47,11 +47,11 @@ Signed-off-by: Daniel Golle + mtd->type == MTD_DATAFLASH || + mtd->type == MTD_MLCNANDFLASH) { + mutex_lock(&ubi_devices_mutex); -+ pr_notice("UBI: auto-attach mtd%d", mtd->index); ++ pr_notice("UBI: auto-attach mtd%d\n", mtd->index); + err = ubi_attach_mtd_dev(mtd, UBI_DEV_NUM_AUTO, 0, 0); + mutex_unlock(&ubi_devices_mutex); + if (err < 0) { -+ pr_err("UBI error: cannot attach mtd%d", mtd->index); ++ pr_err("UBI error: cannot attach mtd%d\n", mtd->index); + put_mtd_device(mtd); + } + } diff --git a/target/linux/generic/pending-4.4/494-mtd-ubi-add-EOF-marker-support.patch b/target/linux/generic/pending-4.4/494-mtd-ubi-add-EOF-marker-support.patch index dd5ee306ef..749232a396 100644 --- a/target/linux/generic/pending-4.4/494-mtd-ubi-add-EOF-marker-support.patch +++ b/target/linux/generic/pending-4.4/494-mtd-ubi-add-EOF-marker-support.patch @@ -27,7 +27,7 @@ + return err; + + if (ec_hdr_has_eof(ech)) { -+ pr_notice("UBI: EOF marker found, PEBs from %d will be erased", ++ pr_notice("UBI: EOF marker found, PEBs from %d will be erased\n", + pnum); + ai->eof_found = true; + } diff --git a/target/linux/generic/pending-4.4/630-packet_socket_type.patch b/target/linux/generic/pending-4.4/630-packet_socket_type.patch index 8c6b7a37b5..0314938ac4 100644 --- a/target/linux/generic/pending-4.4/630-packet_socket_type.patch +++ b/target/linux/generic/pending-4.4/630-packet_socket_type.patch @@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau #define PACKET_FANOUT_LB 1 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c -@@ -1776,6 +1776,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1777,6 +1777,7 @@ static int packet_rcv_spkt(struct sk_buf { struct sock *sk; struct sockaddr_pkt *spkt; @@ -34,7 +34,7 @@ Signed-off-by: Felix Fietkau /* * When we registered the protocol we saved the socket in the data -@@ -1783,6 +1784,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1784,6 +1785,7 @@ static int packet_rcv_spkt(struct sk_buf */ sk = pt->af_packet_priv; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau /* * Yank back the headers [hope the device set this -@@ -1795,7 +1797,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1796,7 +1798,7 @@ static int packet_rcv_spkt(struct sk_buf * so that this procedure is noop. */ @@ -51,7 +51,7 @@ Signed-off-by: Felix Fietkau goto out; if (!net_eq(dev_net(dev), sock_net(sk))) -@@ -1998,12 +2000,12 @@ static int packet_rcv(struct sk_buff *sk +@@ -1999,12 +2001,12 @@ static int packet_rcv(struct sk_buff *sk int skb_len = skb->len; unsigned int snaplen, res; @@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -2123,12 +2125,12 @@ static int tpacket_rcv(struct sk_buff *s +@@ -2124,12 +2126,12 @@ static int tpacket_rcv(struct sk_buff *s BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32); BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48); @@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3115,6 +3117,7 @@ static int packet_create(struct net *net +@@ -3126,6 +3128,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3744,6 +3747,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3755,6 +3758,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -108,7 +108,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3796,6 +3809,13 @@ static int packet_getsockopt(struct sock +@@ -3807,6 +3820,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; @@ -124,7 +124,7 @@ Signed-off-by: Felix Fietkau break; --- a/net/packet/internal.h +++ b/net/packet/internal.h -@@ -129,6 +129,7 @@ struct packet_sock { +@@ -128,6 +128,7 @@ struct packet_sock { struct net_device __rcu *cached_dev; int (*xmit)(struct sk_buff *skb); struct packet_type prot_hook ____cacheline_aligned_in_smp; diff --git a/target/linux/generic/pending-4.4/653-disable_netlink_trim.patch b/target/linux/generic/pending-4.4/653-disable_netlink_trim.patch index cc19b8ef33..b11104be9e 100644 --- a/target/linux/generic/pending-4.4/653-disable_netlink_trim.patch +++ b/target/linux/generic/pending-4.4/653-disable_netlink_trim.patch @@ -1,6 +1,6 @@ --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c -@@ -1187,24 +1187,7 @@ void netlink_detachskb(struct sock *sk, +@@ -1231,24 +1231,7 @@ void netlink_detachskb(struct sock *sk, static struct sk_buff *netlink_trim(struct sk_buff *skb, gfp_t allocation) { diff --git a/target/linux/generic/pending-4.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-4.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index c5f3e195da..4bf34c128e 100644 --- a/target/linux/generic/pending-4.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-4.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -3597,6 +3636,17 @@ static int __net_init ip6_route_net_init +@@ -3601,6 +3640,17 @@ static int __net_init ip6_route_net_init net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); @@ -220,7 +220,7 @@ Signed-off-by: Jonas Gorski #endif net->ipv6.sysctl.flush_delay = 0; -@@ -3615,6 +3665,8 @@ out: +@@ -3619,6 +3669,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -229,7 +229,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -3632,6 +3684,7 @@ static void __net_exit ip6_route_net_exi +@@ -3636,6 +3688,7 @@ static void __net_exit ip6_route_net_exi #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); kfree(net->ipv6.ip6_blk_hole_entry); @@ -237,7 +237,7 @@ Signed-off-by: Jonas Gorski #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); } -@@ -3705,6 +3758,9 @@ void __init ip6_route_init_special_entri +@@ -3709,6 +3762,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); diff --git a/target/linux/generic/pending-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index b7ba384f4c..d91db1fe73 100644 --- a/target/linux/generic/pending-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4259,6 +4259,9 @@ static enum gro_result dev_gro_receive(s +@@ -4260,6 +4260,9 @@ static enum gro_result dev_gro_receive(s enum gro_result ret; int grow; @@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau if (!(skb->dev->features & NETIF_F_GRO)) goto normal; -@@ -5425,6 +5428,48 @@ static void __netdev_adjacent_dev_unlink +@@ -5426,6 +5429,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *private) -@@ -5496,6 +5541,7 @@ static int __netdev_upper_dev_link(struc +@@ -5497,6 +5542,7 @@ static int __netdev_upper_dev_link(struc goto rollback_lower_mesh; } @@ -84,7 +84,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); return 0; -@@ -5622,6 +5668,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -5623,6 +5669,7 @@ void netdev_upper_dev_unlink(struct net_ list_for_each_entry(i, &upper_dev->all_adj_list.upper, list) __netdev_adjacent_dev_unlink(dev, i->dev, i->ref_nr); @@ -92,7 +92,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); } -@@ -6162,6 +6209,7 @@ int dev_set_mac_address(struct net_devic +@@ -6163,6 +6210,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/generic/pending-4.4/701-phy_extension.patch b/target/linux/generic/pending-4.4/701-phy_extension.patch index a1c48b7a3a..6cb3fdfd44 100644 --- a/target/linux/generic/pending-4.4/701-phy_extension.patch +++ b/target/linux/generic/pending-4.4/701-phy_extension.patch @@ -53,7 +53,7 @@ * @phydev: the phy_device struct --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -800,6 +800,7 @@ void phy_start_machine(struct phy_device +@@ -796,6 +796,7 @@ void phy_start_machine(struct phy_device void phy_stop_machine(struct phy_device *phydev); int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); diff --git a/target/linux/generic/pending-4.4/702-phy_add_aneg_done_function.patch b/target/linux/generic/pending-4.4/702-phy_add_aneg_done_function.patch index 39ac22f1ad..f20f48f405 100644 --- a/target/linux/generic/pending-4.4/702-phy_add_aneg_done_function.patch +++ b/target/linux/generic/pending-4.4/702-phy_add_aneg_done_function.patch @@ -1,6 +1,6 @@ --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -501,6 +501,12 @@ struct phy_driver { +@@ -497,6 +497,12 @@ struct phy_driver { /* Determines the negotiated speed and duplex */ int (*read_status)(struct phy_device *phydev); diff --git a/target/linux/generic/pending-4.4/703-phy-add-detach-callback-to-struct-phy_driver.patch b/target/linux/generic/pending-4.4/703-phy-add-detach-callback-to-struct-phy_driver.patch index 5babfdf5e2..4ef3b781fa 100644 --- a/target/linux/generic/pending-4.4/703-phy-add-detach-callback-to-struct-phy_driver.patch +++ b/target/linux/generic/pending-4.4/703-phy-add-detach-callback-to-struct-phy_driver.patch @@ -12,7 +12,7 @@ phy_suspend(phydev); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -519,6 +519,12 @@ struct phy_driver { +@@ -515,6 +515,12 @@ struct phy_driver { */ int (*did_interrupt)(struct phy_device *phydev); diff --git a/target/linux/generic/pending-4.4/704-phy-no-genphy-soft-reset.patch b/target/linux/generic/pending-4.4/704-phy-no-genphy-soft-reset.patch deleted file mode 100644 index 7cec6d3226..0000000000 --- a/target/linux/generic/pending-4.4/704-phy-no-genphy-soft-reset.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/drivers/net/phy/phy_device.c -+++ b/drivers/net/phy/phy_device.c -@@ -1465,7 +1465,7 @@ static struct phy_driver genphy_driver[] - .phy_id = 0xffffffff, - .phy_id_mask = 0xffffffff, - .name = "Generic 10G PHY", -- .soft_reset = gen10g_soft_reset, -+ .soft_reset = genphy_no_soft_reset, - .config_init = gen10g_config_init, - .features = 0, - .config_aneg = gen10g_config_aneg, diff --git a/target/linux/generic/pending-4.4/710-phy-add-mdio_register_board_info.patch b/target/linux/generic/pending-4.4/710-phy-add-mdio_register_board_info.patch index bd15df2384..4886dd0e3a 100644 --- a/target/linux/generic/pending-4.4/710-phy-add-mdio_register_board_info.patch +++ b/target/linux/generic/pending-4.4/710-phy-add-mdio_register_board_info.patch @@ -46,7 +46,7 @@ phy_device_free(phydev); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -839,6 +839,23 @@ void mdio_bus_exit(void); +@@ -835,6 +835,23 @@ void mdio_bus_exit(void); extern struct bus_type mdio_bus_type; diff --git a/target/linux/generic/pending-4.4/721-phy_packets.patch b/target/linux/generic/pending-4.4/721-phy_packets.patch index a7a23278d0..716c1a0273 100644 --- a/target/linux/generic/pending-4.4/721-phy_packets.patch +++ b/target/linux/generic/pending-4.4/721-phy_packets.patch @@ -86,7 +86,7 @@ help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -2746,10 +2746,20 @@ static int xmit_one(struct sk_buff *skb, +@@ -2747,10 +2747,20 @@ static int xmit_one(struct sk_buff *skb, if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all)) dev_queue_xmit_nit(skb, dev); diff --git a/target/linux/generic/pending-4.4/902-debloat_proc.patch b/target/linux/generic/pending-4.4/902-debloat_proc.patch index 98e78183de..f7718bc5bf 100644 --- a/target/linux/generic/pending-4.4/902-debloat_proc.patch +++ b/target/linux/generic/pending-4.4/902-debloat_proc.patch @@ -34,7 +34,7 @@ } --- a/fs/proc/proc_tty.c +++ b/fs/proc/proc_tty.c -@@ -143,7 +143,10 @@ static const struct file_operations proc +@@ -144,7 +144,10 @@ static const struct file_operations proc void proc_tty_register_driver(struct tty_driver *driver) { struct proc_dir_entry *ent; @@ -46,7 +46,7 @@ if (!driver->driver_name || driver->proc_entry || !driver->ops->proc_fops) return; -@@ -160,6 +163,9 @@ void proc_tty_unregister_driver(struct t +@@ -161,6 +164,9 @@ void proc_tty_unregister_driver(struct t { struct proc_dir_entry *ent; @@ -56,7 +56,7 @@ ent = driver->proc_entry; if (!ent) return; -@@ -174,6 +180,9 @@ void proc_tty_unregister_driver(struct t +@@ -175,6 +181,9 @@ void proc_tty_unregister_driver(struct t */ void __init proc_tty_init(void) { @@ -133,7 +133,7 @@ } --- a/mm/vmstat.c +++ b/mm/vmstat.c -@@ -1553,10 +1553,12 @@ static int __init setup_vmstat(void) +@@ -1558,10 +1558,12 @@ static int __init setup_vmstat(void) cpu_notifier_register_done(); #endif #ifdef CONFIG_PROC_FS @@ -173,7 +173,7 @@ goto err; --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -3042,6 +3042,8 @@ static __net_initdata struct pernet_oper +@@ -3044,6 +3044,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { diff --git a/target/linux/generic/pending-4.4/904-debloat_dma_buf.patch b/target/linux/generic/pending-4.4/904-debloat_dma_buf.patch index 10613de852..eac39669d0 100644 --- a/target/linux/generic/pending-4.4/904-debloat_dma_buf.patch +++ b/target/linux/generic/pending-4.4/904-debloat_dma_buf.patch @@ -34,7 +34,7 @@ +MODULE_LICENSE("GPL"); --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2097,6 +2097,7 @@ int wake_up_state(struct task_struct *p, +@@ -2096,6 +2096,7 @@ int wake_up_state(struct task_struct *p, { return try_to_wake_up(p, state, 0); } diff --git a/target/linux/generic/pending-4.4/921-use_preinit_as_init.patch b/target/linux/generic/pending-4.4/921-use_preinit_as_init.patch index 1f4e6322b1..3aba9d63ba 100644 --- a/target/linux/generic/pending-4.4/921-use_preinit_as_init.patch +++ b/target/linux/generic/pending-4.4/921-use_preinit_as_init.patch @@ -1,6 +1,6 @@ --- a/init/main.c +++ b/init/main.c -@@ -964,7 +964,8 @@ static int __ref kernel_init(void *unuse +@@ -966,7 +966,8 @@ static int __ref kernel_init(void *unuse panic("Requested init %s failed (error %d).", execute_command, ret); } diff --git a/target/linux/generic/pending-4.4/995-mangle_bootargs.patch b/target/linux/generic/pending-4.4/995-mangle_bootargs.patch index 2483e1bb98..e008dd9098 100644 --- a/target/linux/generic/pending-4.4/995-mangle_bootargs.patch +++ b/target/linux/generic/pending-4.4/995-mangle_bootargs.patch @@ -1,6 +1,6 @@ --- a/init/main.c +++ b/init/main.c -@@ -355,6 +355,29 @@ static inline void setup_nr_cpu_ids(void +@@ -356,6 +356,29 @@ static inline void setup_nr_cpu_ids(void static inline void smp_prepare_cpus(unsigned int maxcpus) { } #endif @@ -30,7 +30,7 @@ /* * We need to store the untouched command line for future reference. * We also need to store the touched command line since the parameter -@@ -527,6 +550,7 @@ asmlinkage __visible void __init start_k +@@ -529,6 +552,7 @@ asmlinkage __visible void __init start_k pr_notice("%s", linux_banner); setup_arch(&command_line); mm_init_cpumask(&init_mm); diff --git a/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index 8168a885b2..794280eec9 100644 --- a/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -5921,7 +5921,7 @@ static void __ref alloc_node_mem_map(str +@@ -5923,7 +5923,7 @@ static void __ref alloc_node_mem_map(str mem_map = NODE_DATA(0)->node_mem_map; #if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM) if (page_to_pfn(mem_map) != pgdat->node_start_pfn) diff --git a/target/linux/generic/pending-4.9/160-mtd-part-add-generic-parsing-of-linux-part-probe.patch b/target/linux/generic/pending-4.9/160-mtd-part-add-generic-parsing-of-linux-part-probe.patch index 5e9ad8cf07..6c2e2602e1 100644 --- a/target/linux/generic/pending-4.9/160-mtd-part-add-generic-parsing-of-linux-part-probe.patch +++ b/target/linux/generic/pending-4.9/160-mtd-part-add-generic-parsing-of-linux-part-probe.patch @@ -112,9 +112,9 @@ Signed-off-by: Hauke Mehrtens #include +#include #include + #include - #include "mtdcore.h" -@@ -855,6 +856,42 @@ void deregister_mtd_parser(struct mtd_pa +@@ -856,6 +857,42 @@ void deregister_mtd_parser(struct mtd_pa EXPORT_SYMBOL_GPL(deregister_mtd_parser); /* @@ -157,9 +157,9 @@ Signed-off-by: Hauke Mehrtens * Do not forget to update 'parse_mtd_partitions()' kerneldoc comment if you * are changing this array! */ -@@ -912,6 +949,13 @@ int parse_mtd_partitions(struct mtd_info - { - struct mtd_part_parser *parser; +@@ -955,6 +992,13 @@ int parse_mtd_partitions(struct mtd_info + struct property *prop; + const char *compat; int ret, err = 0; + const char *const *types_of = NULL; + @@ -169,9 +169,9 @@ Signed-off-by: Hauke Mehrtens + types = types_of; + } - if (!types) - types = default_mtd_part_types; -@@ -937,6 +981,7 @@ int parse_mtd_partitions(struct mtd_info + np = of_get_child_by_name(mtd_get_of_node(master), "partitions"); + of_property_for_each_string(np, "compatible", prop, compat) { +@@ -996,6 +1040,7 @@ int parse_mtd_partitions(struct mtd_info if (ret < 0 && !err) err = ret; } diff --git a/target/linux/generic/pending-4.9/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch b/target/linux/generic/pending-4.9/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch new file mode 100644 index 0000000000..f980bb080d --- /dev/null +++ b/target/linux/generic/pending-4.9/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch @@ -0,0 +1,43 @@ +From patchwork Fri Jul 21 18:36:24 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [2/5] e1000e: Fix wrong comment related to link detection +From: Benjamin Poirier +X-Patchwork-Id: 9857489 +Message-Id: <20170721183627.13373-2-bpoirier@suse.com> +To: Jeff Kirsher +Cc: Lennart Sorensen , + intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +Date: Fri, 21 Jul 2017 11:36:24 -0700 + +Reading e1000e_check_for_copper_link() shows that get_link_status is set to +false after link has been detected. Therefore, it stays TRUE until then. + +Signed-off-by: Benjamin Poirier +Tested-by: Aaron Brown +--- + drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/intel/e1000e/netdev.c ++++ b/drivers/net/ethernet/intel/e1000e/netdev.c +@@ -5066,7 +5066,7 @@ static bool e1000e_has_link(struct e1000 + + /* get_link_status is set on LSC (link status) interrupt or + * Rx sequence error interrupt. get_link_status will stay +- * false until the check_for_link establishes link ++ * true until the check_for_link establishes link + * for copper adapters ONLY + */ + switch (hw->phy.media_type) { +@@ -5084,7 +5084,7 @@ static bool e1000e_has_link(struct e1000 + break; + case e1000_media_type_internal_serdes: + ret_val = hw->mac.ops.check_for_link(hw); +- link_active = adapter->hw.mac.serdes_has_link; ++ link_active = hw->mac.serdes_has_link; + break; + default: + case e1000_media_type_unknown: diff --git a/target/linux/generic/pending-4.9/201-extra_optimization.patch b/target/linux/generic/pending-4.9/201-extra_optimization.patch index 74acc35715..6a8467a8b2 100644 --- a/target/linux/generic/pending-4.9/201-extra_optimization.patch +++ b/target/linux/generic/pending-4.9/201-extra_optimization.patch @@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -639,12 +639,12 @@ KBUILD_CFLAGS += $(call cc-option,-fdata +@@ -640,12 +640,12 @@ KBUILD_CFLAGS += $(call cc-option,-fdata endif ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE diff --git a/target/linux/generic/pending-4.9/340-MIPS-mm-remove-mips_dma_mapping_error.patch b/target/linux/generic/pending-4.9/340-MIPS-mm-remove-mips_dma_mapping_error.patch new file mode 100644 index 0000000000..4091542581 --- /dev/null +++ b/target/linux/generic/pending-4.9/340-MIPS-mm-remove-mips_dma_mapping_error.patch @@ -0,0 +1,32 @@ +From: Felix Fietkau +Date: Tue, 5 Dec 2017 12:34:31 +0100 +Subject: [PATCH] MIPS: mm: remove mips_dma_mapping_error + +dma_mapping_error() already checks if ops->mapping_error is a null +pointer + +Signed-off-by: Felix Fietkau +--- + +--- a/arch/mips/mm/dma-default.c ++++ b/arch/mips/mm/dma-default.c +@@ -394,11 +394,6 @@ static void mips_dma_sync_sg_for_device( + } + } + +-int mips_dma_mapping_error(struct device *dev, dma_addr_t dma_addr) +-{ +- return 0; +-} +- + int mips_dma_supported(struct device *dev, u64 mask) + { + return plat_dma_supported(dev, mask); +@@ -427,7 +422,6 @@ static struct dma_map_ops mips_default_d + .sync_single_for_device = mips_dma_sync_single_for_device, + .sync_sg_for_cpu = mips_dma_sync_sg_for_cpu, + .sync_sg_for_device = mips_dma_sync_sg_for_device, +- .mapping_error = mips_dma_mapping_error, + .dma_supported = mips_dma_supported + }; + diff --git a/target/linux/generic/pending-4.9/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch b/target/linux/generic/pending-4.9/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch new file mode 100644 index 0000000000..5b237a6d23 --- /dev/null +++ b/target/linux/generic/pending-4.9/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch @@ -0,0 +1,140 @@ +From: Felix Fietkau +Date: Tue, 5 Dec 2017 12:46:01 +0100 +Subject: [PATCH] MIPS: mm: remove no-op dma_map_ops where possible + +If no post-DMA flush is required, and the platform does not provide +plat_unmap_dma_mem(), there is no need to include unmap or sync_for_cpu +ops. + +With this patch they are compiled out to improve icache footprint +on devices that handle lots of DMA traffic (especially network routers). + +Signed-off-by: Felix Fietkau +--- + +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -213,6 +213,7 @@ config BMIPS_GENERIC + select BRCMSTB_L2_IRQ + select IRQ_MIPS_CPU + select DMA_NONCOHERENT ++ select DMA_UNMAP_POST_FLUSH + select SYS_SUPPORTS_32BIT_KERNEL + select SYS_SUPPORTS_LITTLE_ENDIAN + select SYS_SUPPORTS_BIG_ENDIAN +@@ -338,6 +339,7 @@ config MACH_JAZZ + select CSRC_R4K + select DEFAULT_SGI_PARTITION if CPU_BIG_ENDIAN + select GENERIC_ISA_DMA ++ select DMA_UNMAP_POST_FLUSH + select HAVE_PCSPKR_PLATFORM + select IRQ_MIPS_CPU + select I8253 +@@ -1125,6 +1127,9 @@ config DMA_NONCOHERENT + bool + select NEED_DMA_MAP_STATE + ++config DMA_UNMAP_POST_FLUSH ++ bool ++ + config NEED_DMA_MAP_STATE + bool + +@@ -1649,6 +1654,7 @@ config CPU_R10000 + select CPU_SUPPORTS_64BIT_KERNEL + select CPU_SUPPORTS_HIGHMEM + select CPU_SUPPORTS_HUGEPAGES ++ select DMA_UNMAP_POST_FLUSH + help + MIPS Technologies R10000-series processors. + +@@ -1894,9 +1900,11 @@ config SYS_HAS_CPU_MIPS32_R3_5 + bool + + config SYS_HAS_CPU_MIPS32_R5 ++ select DMA_UNMAP_POST_FLUSH + bool + + config SYS_HAS_CPU_MIPS32_R6 ++ select DMA_UNMAP_POST_FLUSH + bool + + config SYS_HAS_CPU_MIPS64_R1 +@@ -1906,6 +1914,7 @@ config SYS_HAS_CPU_MIPS64_R2 + bool + + config SYS_HAS_CPU_MIPS64_R6 ++ select DMA_UNMAP_POST_FLUSH + bool + + config SYS_HAS_CPU_R3000 +--- a/arch/mips/mm/dma-default.c ++++ b/arch/mips/mm/dma-default.c +@@ -290,8 +290,9 @@ static inline void __dma_sync(struct pag + } while (left); + } + +-static void mips_dma_unmap_page(struct device *dev, dma_addr_t dma_addr, +- size_t size, enum dma_data_direction direction, unsigned long attrs) ++static void __maybe_unused ++mips_dma_unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size, ++ enum dma_data_direction direction, unsigned long attrs) + { + if (cpu_needs_post_dma_flush(dev)) + __dma_sync(dma_addr_to_page(dev, dma_addr), +@@ -330,9 +331,10 @@ static dma_addr_t mips_dma_map_page(stru + return plat_map_dma_mem_page(dev, page) + offset; + } + +-static void mips_dma_unmap_sg(struct device *dev, struct scatterlist *sglist, +- int nhwentries, enum dma_data_direction direction, +- unsigned long attrs) ++static void __maybe_unused ++mips_dma_unmap_sg(struct device *dev, struct scatterlist *sglist, ++ int nhwentries, enum dma_data_direction direction, ++ unsigned long attrs) + { + int i; + struct scatterlist *sg; +@@ -346,8 +348,9 @@ static void mips_dma_unmap_sg(struct dev + } + } + +-static void mips_dma_sync_single_for_cpu(struct device *dev, +- dma_addr_t dma_handle, size_t size, enum dma_data_direction direction) ++static void __maybe_unused ++mips_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, ++ size_t size, enum dma_data_direction direction) + { + if (cpu_needs_post_dma_flush(dev)) + __dma_sync(dma_addr_to_page(dev, dma_handle), +@@ -363,9 +366,9 @@ static void mips_dma_sync_single_for_dev + dma_handle & ~PAGE_MASK, size, direction); + } + +-static void mips_dma_sync_sg_for_cpu(struct device *dev, +- struct scatterlist *sglist, int nelems, +- enum dma_data_direction direction) ++static void __maybe_unused ++mips_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sglist, ++ int nelems, enum dma_data_direction direction) + { + int i; + struct scatterlist *sg; +@@ -415,12 +418,14 @@ static struct dma_map_ops mips_default_d + .free = mips_dma_free_coherent, + .mmap = mips_dma_mmap, + .map_page = mips_dma_map_page, +- .unmap_page = mips_dma_unmap_page, + .map_sg = mips_dma_map_sg, ++#ifdef CONFIG_DMA_UNMAP_POST_FLUSH ++ .unmap_page = mips_dma_unmap_page, + .unmap_sg = mips_dma_unmap_sg, + .sync_single_for_cpu = mips_dma_sync_single_for_cpu, +- .sync_single_for_device = mips_dma_sync_single_for_device, + .sync_sg_for_cpu = mips_dma_sync_sg_for_cpu, ++#endif ++ .sync_single_for_device = mips_dma_sync_single_for_device, + .sync_sg_for_device = mips_dma_sync_sg_for_device, + .dma_supported = mips_dma_supported + }; diff --git a/target/linux/generic/pending-4.9/400-mtd-add-rootfs-split-support.patch b/target/linux/generic/pending-4.9/400-mtd-add-rootfs-split-support.patch index cf8a54ff56..ef7a6df3ea 100644 --- a/target/linux/generic/pending-4.9/400-mtd-add-rootfs-split-support.patch +++ b/target/linux/generic/pending-4.9/400-mtd-add-rootfs-split-support.patch @@ -37,20 +37,21 @@ Signed-off-by: Felix Fietkau depends on m --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -29,10 +29,12 @@ +@@ -29,11 +29,13 @@ #include #include #include +#include #include #include + #include #include "mtdcore.h" +#include "mtdsplit/mtdsplit.h" /* Our partition linked list */ static LIST_HEAD(mtd_partitions); -@@ -52,6 +54,8 @@ struct mtd_part { +@@ -53,6 +55,8 @@ struct mtd_part { struct list_head list; }; @@ -59,7 +60,7 @@ Signed-off-by: Felix Fietkau /* * Given a pointer to the MTD object in the mtd_part structure, we can retrieve * the pointer to that structure. -@@ -678,6 +682,7 @@ int mtd_add_partition(struct mtd_info *p +@@ -679,6 +683,7 @@ int mtd_add_partition(struct mtd_info *p mutex_unlock(&mtd_partitions_mutex); add_mtd_device(&new->mtd); @@ -67,7 +68,7 @@ Signed-off-by: Felix Fietkau mtd_add_partition_attrs(new); -@@ -756,6 +761,35 @@ int mtd_del_partition(struct mtd_info *m +@@ -757,6 +762,35 @@ int mtd_del_partition(struct mtd_info *m } EXPORT_SYMBOL_GPL(mtd_del_partition); @@ -103,7 +104,7 @@ Signed-off-by: Felix Fietkau /* * This function, given a master MTD object and a partition table, creates * and registers slave MTD objects which are bound to the master according to -@@ -787,6 +821,7 @@ int add_mtd_partitions(struct mtd_info * +@@ -788,6 +822,7 @@ int add_mtd_partitions(struct mtd_info * mutex_unlock(&mtd_partitions_mutex); add_mtd_device(&slave->mtd); @@ -113,7 +114,7 @@ Signed-off-by: Felix Fietkau mtd_parse_part(slave, parts[i].types); --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h -@@ -109,5 +109,7 @@ int mtd_add_partition(struct mtd_info *m +@@ -110,5 +110,7 @@ int mtd_add_partition(struct mtd_info *m long long offset, long long length); int mtd_del_partition(struct mtd_info *master, int partno); uint64_t mtd_get_device_size(const struct mtd_info *mtd); diff --git a/target/linux/generic/pending-4.9/401-mtd-add-support-for-different-partition-parser-types.patch b/target/linux/generic/pending-4.9/401-mtd-add-support-for-different-partition-parser-types.patch index c112453498..66c499d3e7 100644 --- a/target/linux/generic/pending-4.9/401-mtd-add-support-for-different-partition-parser-types.patch +++ b/target/linux/generic/pending-4.9/401-mtd-add-support-for-different-partition-parser-types.patch @@ -9,7 +9,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -1036,6 +1036,62 @@ void mtd_part_parser_cleanup(struct mtd_ +@@ -1095,6 +1095,62 @@ void mtd_part_parser_cleanup(struct mtd_ } } @@ -90,7 +90,7 @@ Signed-off-by: Gabor Juhos struct mtd_part_parser { struct list_head list; struct module *owner; -@@ -80,6 +83,7 @@ struct mtd_part_parser { +@@ -81,6 +84,7 @@ struct mtd_part_parser { int (*parse_fn)(struct mtd_info *, const struct mtd_partition **, struct mtd_part_parser_data *); void (*cleanup)(const struct mtd_partition *pparts, int nr_parts); @@ -98,7 +98,7 @@ Signed-off-by: Gabor Juhos }; /* Container for passing around a set of parsed partitions */ -@@ -112,4 +116,9 @@ uint64_t mtd_get_device_size(const struc +@@ -113,4 +117,9 @@ uint64_t mtd_get_device_size(const struc extern void __weak arch_split_mtd_part(struct mtd_info *master, const char *name, int offset, int size); diff --git a/target/linux/generic/pending-4.9/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch b/target/linux/generic/pending-4.9/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch index b78ff526ff..9b406d4688 100644 --- a/target/linux/generic/pending-4.9/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch +++ b/target/linux/generic/pending-4.9/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch @@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -761,6 +761,36 @@ int mtd_del_partition(struct mtd_info *m +@@ -762,6 +762,36 @@ int mtd_del_partition(struct mtd_info *m } EXPORT_SYMBOL_GPL(mtd_del_partition); @@ -47,7 +47,7 @@ Signed-off-by: Gabor Juhos #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME #define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME #else -@@ -769,6 +799,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition); +@@ -770,6 +800,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition); static void split_firmware(struct mtd_info *master, struct mtd_part *part) { @@ -55,7 +55,7 @@ Signed-off-by: Gabor Juhos } void __weak arch_split_mtd_part(struct mtd_info *master, const char *name, -@@ -783,6 +814,12 @@ static void mtd_partition_split(struct m +@@ -784,6 +815,12 @@ static void mtd_partition_split(struct m if (rootfs_found) return; diff --git a/target/linux/generic/pending-4.9/404-mtd-add-more-helper-functions.patch b/target/linux/generic/pending-4.9/404-mtd-add-more-helper-functions.patch index 8e9604fb7d..0ec5540d03 100644 --- a/target/linux/generic/pending-4.9/404-mtd-add-more-helper-functions.patch +++ b/target/linux/generic/pending-4.9/404-mtd-add-more-helper-functions.patch @@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -791,6 +791,17 @@ run_parsers_by_type(struct mtd_part *sla +@@ -792,6 +792,17 @@ run_parsers_by_type(struct mtd_part *sla return nr_parts; } @@ -29,7 +29,7 @@ Signed-off-by: Gabor Juhos #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME #define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME #else -@@ -1146,6 +1157,24 @@ int mtd_is_partition(const struct mtd_in +@@ -1205,6 +1216,24 @@ int mtd_is_partition(const struct mtd_in } EXPORT_SYMBOL_GPL(mtd_is_partition); @@ -83,7 +83,7 @@ Signed-off-by: Gabor Juhos if (mtd->writesize_shift) --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h -@@ -114,6 +114,8 @@ int mtd_is_partition(const struct mtd_in +@@ -115,6 +115,8 @@ int mtd_is_partition(const struct mtd_in int mtd_add_partition(struct mtd_info *master, const char *name, long long offset, long long length); int mtd_del_partition(struct mtd_info *master, int partno); diff --git a/target/linux/generic/pending-4.9/411-mtd-partial_eraseblock_write.patch b/target/linux/generic/pending-4.9/411-mtd-partial_eraseblock_write.patch index 6c03a29842..9a585214ed 100644 --- a/target/linux/generic/pending-4.9/411-mtd-partial_eraseblock_write.patch +++ b/target/linux/generic/pending-4.9/411-mtd-partial_eraseblock_write.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -36,6 +36,8 @@ +@@ -37,6 +37,8 @@ #include "mtdcore.h" #include "mtdsplit/mtdsplit.h" @@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau /* Our partition linked list */ static LIST_HEAD(mtd_partitions); static DEFINE_MUTEX(mtd_partitions_mutex); -@@ -241,13 +243,61 @@ static int part_erase(struct mtd_info *m +@@ -242,13 +244,61 @@ static int part_erase(struct mtd_info *m struct mtd_part *part = mtd_to_part(mtd); int ret; @@ -81,7 +81,7 @@ Signed-off-by: Felix Fietkau return ret; } -@@ -255,6 +305,25 @@ void mtd_erase_callback(struct erase_inf +@@ -256,6 +306,25 @@ void mtd_erase_callback(struct erase_inf { if (instr->mtd->_erase == part_erase) { struct mtd_part *part = mtd_to_part(instr->mtd); @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN) instr->fail_addr -= part->offset; -@@ -590,19 +659,22 @@ static struct mtd_part *allocate_partiti +@@ -591,19 +660,22 @@ static struct mtd_part *allocate_partiti remainder = do_div(tmp, wr_alignment); if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) { /* Doesn't start on a boundary of major erase size */ diff --git a/target/linux/generic/pending-4.9/412-mtd-partial_eraseblock_unlock.patch b/target/linux/generic/pending-4.9/412-mtd-partial_eraseblock_unlock.patch index fd6ffc6fa9..2ffff4ecf9 100644 --- a/target/linux/generic/pending-4.9/412-mtd-partial_eraseblock_unlock.patch +++ b/target/linux/generic/pending-4.9/412-mtd-partial_eraseblock_unlock.patch @@ -20,7 +20,7 @@ Signed-off-by: Tim Harvey --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -343,7 +343,16 @@ static int part_lock(struct mtd_info *mt +@@ -344,7 +344,16 @@ static int part_lock(struct mtd_info *mt static int part_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) { struct mtd_part *part = mtd_to_part(mtd); diff --git a/target/linux/generic/pending-4.9/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch b/target/linux/generic/pending-4.9/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch new file mode 100644 index 0000000000..e032b08f4d --- /dev/null +++ b/target/linux/generic/pending-4.9/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch @@ -0,0 +1,37 @@ +From: Matthias Schiffer +Date: Tue, 9 Jan 2018 20:41:48 +0100 +Subject: [PATCH] Revert "mtd: spi-nor: fix Spansion regressions (aliased with + Winbond)" + +This reverts commit 67b9bcd36906e12a15ffec19463afbbd6a41660e. + +The underlying issue breaking Spansion flash has been fixed with "mtd: spi-nor: +wait until lock/unlock operations are ready" and "mtd: spi-nor: wait for SR_WIP +to clear on initial unlock", so we can support unlocking for Winbond flash +again. + +Signed-off-by: Matthias Schiffer +--- + drivers/mtd/spi-nor/spi-nor.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -1597,6 +1597,7 @@ int spi_nor_scan(struct spi_nor *nor, co + JEDEC_MFR(info) == SNOR_MFR_INTEL || + JEDEC_MFR(info) == SNOR_MFR_MACRONIX || + JEDEC_MFR(info) == SNOR_MFR_SST || ++ JEDEC_MFR(info) == SNOR_MFR_WINBOND || + info->flags & SPI_NOR_HAS_LOCK) { + write_enable(nor); + write_sr(nor, 0); +@@ -1615,7 +1616,8 @@ int spi_nor_scan(struct spi_nor *nor, co + + /* NOR protection support for STmicro/Micron chips and similar */ + if (JEDEC_MFR(info) == SNOR_MFR_MICRON || +- info->flags & SPI_NOR_HAS_LOCK) { ++ JEDEC_MFR(info) == SNOR_MFR_WINBOND || ++ info->flags & SPI_NOR_HAS_LOCK) { + nor->flash_lock = stm_lock; + nor->flash_unlock = stm_unlock; + nor->flash_is_locked = stm_is_locked; diff --git a/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch b/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch new file mode 100644 index 0000000000..1c5b9c3b26 --- /dev/null +++ b/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch @@ -0,0 +1,56 @@ +From: Felix Fietkau +Date: Sat, 4 Nov 2017 07:40:23 +0100 +Subject: [PATCH] mtd: spi-nor: support limiting 4K sectors support based on + flash size + +Some devices need 4K sectors to be able to deal with small flash chips. +For instance, w25x05 is 64 KiB in size, and without 4K sectors, the +entire chip is just one erase block. +On bigger flash chip sizes, using 4K sectors can significantly slow down +many operations, including using a writable filesystem. There are several +platforms where it makes sense to use a single kernel on both kinds of +devices. + +To support this properly, allow configuring an upper flash chip size +limit for 4K sectors support. + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/mtd/spi-nor/Kconfig ++++ b/drivers/mtd/spi-nor/Kconfig +@@ -29,6 +29,17 @@ config MTD_SPI_NOR_USE_4K_SECTORS + Please note that some tools/drivers/filesystems may not work with + 4096 B erase size (e.g. UBIFS requires 15 KiB as a minimum). + ++config MTD_SPI_NOR_USE_4K_SECTORS_LIMIT ++ int "Maximum flash chip size to use 4K sectors on (in KiB)" ++ depends on MTD_SPI_NOR_USE_4K_SECTORS ++ default "4096" ++ help ++ There are many flash chips that support 4K sectors, but are so large ++ that using them significantly slows down writing large amounts of ++ data or using a writable filesystem. ++ Any flash chip larger than the size specified in this option will ++ not use 4K sectors. ++ + config SPI_ATMEL_QUADSPI + tristate "Atmel Quad SPI Controller" + depends on ARCH_AT91 || (ARM && COMPILE_TEST) +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -1640,10 +1640,12 @@ int spi_nor_scan(struct spi_nor *nor, co + + #ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS + /* prefer "small sector" erase if possible */ +- if (info->flags & SECT_4K) { ++ if ((info->flags & SECT_4K) && (mtd->size <= ++ CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT * 1024)) { + nor->erase_opcode = SPINOR_OP_BE_4K; + mtd->erasesize = 4096; +- } else if (info->flags & SECT_4K_PMC) { ++ } else if ((info->flags & SECT_4K_PMC) && (mtd->size <= ++ CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT * 1024)) { + nor->erase_opcode = SPINOR_OP_BE_4K_PMC; + mtd->erasesize = 4096; + } else diff --git a/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index a8dcad458f..76d031002e 100644 --- a/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -33,7 +33,7 @@ Signed-off-by: Daniel Golle + /* check for a valid ubi magic */ + err = mtd_read(mtd, 0, 4, &len, (void *) magic); + if (!err && len == 4 && strncmp(magic, "UBI#", 4)) { -+ pr_err("UBI error: no valid UBI magic found inside mtd%d", mtd->index); ++ pr_err("UBI error: no valid UBI magic found inside mtd%d\n", mtd->index); + put_mtd_device(mtd); + return; + } @@ -48,7 +48,7 @@ Signed-off-by: Daniel Golle + err = ubi_attach_mtd_dev(mtd, UBI_DEV_NUM_AUTO, 0, 0); + mutex_unlock(&ubi_devices_mutex); + if (err < 0) { -+ pr_err("UBI error: cannot attach mtd%d", mtd->index); ++ pr_err("UBI error: cannot attach mtd%d\n", mtd->index); + put_mtd_device(mtd); + } + } diff --git a/target/linux/generic/pending-4.9/494-mtd-ubi-add-EOF-marker-support.patch b/target/linux/generic/pending-4.9/494-mtd-ubi-add-EOF-marker-support.patch index c6ba444b4d..0b2314955b 100644 --- a/target/linux/generic/pending-4.9/494-mtd-ubi-add-EOF-marker-support.patch +++ b/target/linux/generic/pending-4.9/494-mtd-ubi-add-EOF-marker-support.patch @@ -36,7 +36,7 @@ Signed-off-by: Gabor Juhos + return err; + + if (ec_hdr_has_eof(ech)) { -+ pr_notice("UBI: EOF marker found, PEBs from %d will be erased", ++ pr_notice("UBI: EOF marker found, PEBs from %d will be erased\n", + pnum); + ai->eof_found = true; + } diff --git a/target/linux/generic/pending-4.9/616-net_optimize_xfrm_calls.patch b/target/linux/generic/pending-4.9/616-net_optimize_xfrm_calls.patch index e627fa0ca0..a147f5f94f 100644 --- a/target/linux/generic/pending-4.9/616-net_optimize_xfrm_calls.patch +++ b/target/linux/generic/pending-4.9/616-net_optimize_xfrm_calls.patch @@ -8,7 +8,7 @@ Signed-off-by: Felix Fietkau --- a/net/netfilter/nf_nat_core.c +++ b/net/netfilter/nf_nat_core.c -@@ -95,6 +95,9 @@ int nf_xfrm_me_harder(struct net *net, s +@@ -93,6 +93,9 @@ int nf_xfrm_me_harder(struct net *net, s struct dst_entry *dst; int err; diff --git a/target/linux/generic/pending-4.9/630-packet_socket_type.patch b/target/linux/generic/pending-4.9/630-packet_socket_type.patch index dea2e2ce76..092011d0ec 100644 --- a/target/linux/generic/pending-4.9/630-packet_socket_type.patch +++ b/target/linux/generic/pending-4.9/630-packet_socket_type.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau #define PACKET_FANOUT_LB 1 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c -@@ -1778,6 +1778,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1773,6 +1773,7 @@ static int packet_rcv_spkt(struct sk_buf { struct sock *sk; struct sockaddr_pkt *spkt; @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau /* * When we registered the protocol we saved the socket in the data -@@ -1785,6 +1786,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1780,6 +1781,7 @@ static int packet_rcv_spkt(struct sk_buf */ sk = pt->af_packet_priv; @@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau /* * Yank back the headers [hope the device set this -@@ -1797,7 +1799,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1792,7 +1794,7 @@ static int packet_rcv_spkt(struct sk_buf * so that this procedure is noop. */ @@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau goto out; if (!net_eq(dev_net(dev), sock_net(sk))) -@@ -2035,12 +2037,12 @@ static int packet_rcv(struct sk_buff *sk +@@ -2030,12 +2032,12 @@ static int packet_rcv(struct sk_buff *sk unsigned int snaplen, res; bool is_drop_n_account = false; @@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -2166,12 +2168,12 @@ static int tpacket_rcv(struct sk_buff *s +@@ -2161,12 +2163,12 @@ static int tpacket_rcv(struct sk_buff *s BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32); BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48); @@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3250,6 +3252,7 @@ static int packet_create(struct net *net +@@ -3251,6 +3253,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3836,6 +3839,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3837,6 +3840,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3888,6 +3901,13 @@ static int packet_getsockopt(struct sock +@@ -3889,6 +3902,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; @@ -128,7 +128,7 @@ Signed-off-by: Felix Fietkau break; --- a/net/packet/internal.h +++ b/net/packet/internal.h -@@ -129,6 +129,7 @@ struct packet_sock { +@@ -128,6 +128,7 @@ struct packet_sock { struct net_device __rcu *cached_dev; int (*xmit)(struct sk_buff *skb); struct packet_type prot_hook ____cacheline_aligned_in_smp; diff --git a/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 3b09bffa15..e9c247fad0 100644 --- a/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -200,7 +200,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -3714,6 +3753,17 @@ static int __net_init ip6_route_net_init +@@ -3718,6 +3757,17 @@ static int __net_init ip6_route_net_init net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); @@ -218,7 +218,7 @@ Signed-off-by: Jonas Gorski #endif net->ipv6.sysctl.flush_delay = 0; -@@ -3732,6 +3782,8 @@ out: +@@ -3736,6 +3786,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -227,7 +227,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -3749,6 +3801,7 @@ static void __net_exit ip6_route_net_exi +@@ -3753,6 +3805,7 @@ static void __net_exit ip6_route_net_exi #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); kfree(net->ipv6.ip6_blk_hole_entry); @@ -235,7 +235,7 @@ Signed-off-by: Jonas Gorski #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); } -@@ -3822,6 +3875,9 @@ void __init ip6_route_init_special_entri +@@ -3826,6 +3879,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); diff --git a/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index ad0fb5bdc5..bd2ffe34ef 100644 --- a/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -34,7 +34,7 @@ Signed-off-by: Felix Fietkau __u16 tc_index; /* traffic control index */ --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4523,6 +4523,9 @@ static enum gro_result dev_gro_receive(s +@@ -4524,6 +4524,9 @@ static enum gro_result dev_gro_receive(s enum gro_result ret; int grow; @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau if (!(skb->dev->features & NETIF_F_GRO)) goto normal; -@@ -5811,6 +5814,48 @@ static void __netdev_adjacent_dev_unlink +@@ -5812,6 +5815,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -93,7 +93,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info) -@@ -6009,6 +6054,8 @@ void netdev_upper_dev_unlink(struct net_ +@@ -6010,6 +6055,8 @@ void netdev_upper_dev_unlink(struct net_ list_for_each_entry(i, &upper_dev->all_adj_list.upper, list) __netdev_adjacent_dev_unlink(dev, i->dev, i->ref_nr); @@ -102,7 +102,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); } -@@ -6609,6 +6656,7 @@ int dev_set_mac_address(struct net_devic +@@ -6610,6 +6657,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/generic/pending-4.9/701-phy_extension.patch b/target/linux/generic/pending-4.9/701-phy_extension.patch index 2b9e424055..b480b1d78d 100644 --- a/target/linux/generic/pending-4.9/701-phy_extension.patch +++ b/target/linux/generic/pending-4.9/701-phy_extension.patch @@ -62,7 +62,7 @@ Signed-off-by: John Crispin * @phydev: the phy_device struct --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -820,6 +820,7 @@ int phy_ethtool_ksettings_get(struct phy +@@ -816,6 +816,7 @@ int phy_ethtool_ksettings_get(struct phy struct ethtool_link_ksettings *cmd); int phy_ethtool_ksettings_set(struct phy_device *phydev, const struct ethtool_link_ksettings *cmd); diff --git a/target/linux/generic/pending-4.9/703-phy-add-detach-callback-to-struct-phy_driver.patch b/target/linux/generic/pending-4.9/703-phy-add-detach-callback-to-struct-phy_driver.patch index c64c3bea3e..7cc39dcb8a 100644 --- a/target/linux/generic/pending-4.9/703-phy-add-detach-callback-to-struct-phy_driver.patch +++ b/target/linux/generic/pending-4.9/703-phy-add-detach-callback-to-struct-phy_driver.patch @@ -23,7 +23,7 @@ Signed-off-by: Gabor Juhos phy_suspend(phydev); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -511,6 +511,12 @@ struct phy_driver { +@@ -507,6 +507,12 @@ struct phy_driver { */ int (*did_interrupt)(struct phy_device *phydev); diff --git a/target/linux/generic/pending-4.9/704-phy-no-genphy-soft-reset.patch b/target/linux/generic/pending-4.9/704-phy-no-genphy-soft-reset.patch deleted file mode 100644 index 4fad37ab30..0000000000 --- a/target/linux/generic/pending-4.9/704-phy-no-genphy-soft-reset.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Felix Fietkau -Subject: net: phy: disable soft-reset for generic PHY devices to avoid accidentally clearing preinitialized state - -Signed-off-by: Felix Fietkau ---- - drivers/net/phy/phy_device.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/drivers/net/phy/phy_device.c -+++ b/drivers/net/phy/phy_device.c -@@ -1524,11 +1524,6 @@ int genphy_config_init(struct phy_device - return 0; - } - --static int gen10g_soft_reset(struct phy_device *phydev) --{ -- /* Do nothing for now */ -- return 0; --} - EXPORT_SYMBOL(genphy_config_init); - - static int gen10g_config_init(struct phy_device *phydev) -@@ -1811,7 +1806,7 @@ static struct phy_driver genphy_driver[] - .phy_id = 0xffffffff, - .phy_id_mask = 0xffffffff, - .name = "Generic 10G PHY", -- .soft_reset = gen10g_soft_reset, -+ .soft_reset = genphy_no_soft_reset, - .config_init = gen10g_config_init, - .features = 0, - .config_aneg = gen10g_config_aneg, diff --git a/target/linux/generic/pending-4.9/920-mangle_bootargs.patch b/target/linux/generic/pending-4.9/920-mangle_bootargs.patch index a985a7c952..bdf8c0d383 100644 --- a/target/linux/generic/pending-4.9/920-mangle_bootargs.patch +++ b/target/linux/generic/pending-4.9/920-mangle_bootargs.patch @@ -31,7 +31,7 @@ Signed-off-by: Imre Kaloz help --- a/init/main.c +++ b/init/main.c -@@ -351,6 +351,29 @@ static inline void setup_nr_cpu_ids(void +@@ -352,6 +352,29 @@ static inline void setup_nr_cpu_ids(void static inline void smp_prepare_cpus(unsigned int maxcpus) { } #endif @@ -61,7 +61,7 @@ Signed-off-by: Imre Kaloz /* * We need to store the untouched command line for future reference. * We also need to store the touched command line since the parameter -@@ -503,6 +526,7 @@ asmlinkage __visible void __init start_k +@@ -505,6 +528,7 @@ asmlinkage __visible void __init start_k pr_notice("%s", linux_banner); setup_arch(&command_line); mm_init_cpumask(&init_mm); diff --git a/target/linux/imx6/image/Makefile b/target/linux/imx6/image/Makefile index c3653cd6fc..7f35c56b79 100644 --- a/target/linux/imx6/image/Makefile +++ b/target/linux/imx6/image/Makefile @@ -104,6 +104,7 @@ define Device/ventana BLOCKSIZE := 128k MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB endef +TARGET_DEVICES += ventana define Device/ventana-large $(Device/ventana) @@ -114,14 +115,12 @@ define Device/ventana-large BLOCKSIZE := 256k MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB endef +TARGET_DEVICES += ventana-large define Device/wandboard DEVICE_TITLE := Wandboard Dual DEVICE_DTS := imx6dl-wandboard endef - -TARGET_DEVICES += \ - ventana ventana-large \ - wandboard +TARGET_DEVICES += wandboard $(eval $(call BuildImage)) diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds b/target/linux/ipq806x/base-files/etc/board.d/01_leds index a5b6bfc034..9d5f7fde04 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/01_leds +++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds @@ -35,7 +35,16 @@ nbg6817) ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:amber:wifi5g" "phy0tpt" ucidef_set_led_netdev "wan" "WAN" "$board:white:internet" "eth1" ;; -rt-acrh17 |\ +rt-acrh17) + ucidef_set_led_default "status" "STATUS" "${board}:blue:status" "1" + ucidef_set_led_wlan "wlan2g" "WLAN2G" "${board}:blue:wlan2g" "phy0tpt" + ucidef_set_led_wlan "wlan5g" "WLAN5G" "${board}:blue:wlan5g" "phy1tpt" + ucidef_set_led_switch "wan" "WAN(blue)" "${board}:blue:wan" "switch0" "0x20" + ucidef_set_led_switch "lan1" "LAN1" "${board}:blue:lan1" "switch0" "0x02" + ucidef_set_led_switch "lan2" "LAN2" "${board}:blue:lan2" "switch0" "0x04" + ucidef_set_led_switch "lan3" "LAN3" "${board}:blue:lan3" "switch0" "0x08" + ucidef_set_led_switch "lan4" "LAN4" "${board}:blue:lan4" "switch0" "0x10" + ;; rt-ac58u) ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:blue:wlan2G" "phy0tpt" ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:blue:wlan5G" "phy1tpt" diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index 9d5ba2d68c..f69638f03e 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -53,7 +53,15 @@ nbg6817) ucidef_set_interface_macaddr "lan" "$hw_mac_addr" ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 1)" ;; -rt-acrh17 |\ +rt-acrh17) + CI_UBIPART=UBI_DEV + lan_mac_addr=$(mtd_get_mac_binary_ubi Factory 4102) + wan_mac_addr=$(mtd_get_mac_binary_ubi Factory 36870) + ucidef_add_switch "switch0" \ + "0t@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" + ucidef_set_interface_macaddr "lan" "$lan_mac_addr" + ucidef_set_interface_macaddr "wan" "$wan_mac_addr" + ;; rt-ac58u) CI_UBIPART=UBI_DEV wan_mac_addr=$(mtd_get_mac_binary_ubi Factory 20486) diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 9557b539a8..22de2de822 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -76,7 +76,6 @@ case "$FIRMWARE" in ;; "ath10k/pre-cal-ahb-a800000.wifi.bin") case "$board" in - rt-acrh17 |\ rt-ac58u) . /lib/upgrade/nand.sh @@ -91,6 +90,11 @@ case "$FIRMWARE" in "ath10k/pre-cal-pci-0000:01:00.0.bin") case $board in + rt-acrh17) + CI_UBIPART=UBI_DEV + . /lib/upgrade/nand.sh + ath10kcal_ubi_extract "Factory" 36864 12064 + ;; c2600) ath10kcal_extract "radio" 4096 12064 # ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 8) -1) diff --git a/target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac b/target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac new file mode 100644 index 0000000000..d08f265585 --- /dev/null +++ b/target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac @@ -0,0 +1,19 @@ +# +# Copyright (C) 2014-2015 OpenWrt.org +# Copyright (C) 2016 LEDE-Project.org +# + +preinit_set_mac_address() { + local mac + + . /lib/functions.sh + + case $(board_name) in + rt-acrh17) + CI_UBIPART=UBI_DEV + mac=$(mtd_get_mac_binary_ubi Factory 4102) + ifconfig eth0 hw ether $mac 2>/dev/null + esac +} + +boot_hook_add preinit_main preinit_set_mac_address diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh index cf046800d0..797caf061a 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh @@ -34,6 +34,16 @@ EOF platform_do_upgrade() { case "$(board_name)" in + rt-acrh17) + CI_UBIPART="UBI_DEV" + CI_KERNPART="linux" + local ubidev=$(nand_find_ubi $CI_UBIPART) + local jffs2=$(nand_find_volume $ubidev jffs2) + local linux2=$(nand_find_volume $ubidev linux2) + [ -n "$jffs2" ] && ubirmvol /dev/$ubidev --name=jffs2 + [ -n "$linux2" ] && ubirmvol /dev/$ubidev --name=linux2 + nand_do_upgrade "$1" + ;; ap148 |\ ap-dk04.1-c1 |\ d7800 |\ diff --git a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts index c68cc0e9ea..beace8ecfa 100644 --- a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts +++ b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts @@ -14,7 +14,7 @@ * */ -#include "qcom-ipq4019-ap.dk01.1.dtsi" +#include "qcom-ipq4019-ap.dk04.1.dtsi" #include "qcom-ipq4019-bus.dtsi" #include #include @@ -48,6 +48,91 @@ }; soc { + spi_0: spi@78b5000 { + status = "disabled"; + }; + + pcie0: qcom,pcie@80000 { + compatible = "qcom,msm_pcie"; + cell-index = <0>; + qcom,ctrl-amt = <1>; + + reg = <0x80000 0x2000>, + <0x99000 0x800>, + <0x40000000 0xf1d>, + <0x40000f20 0xa8>, + <0x40100000 0x1000>, + <0x40200000 0x100000>, + <0x40300000 0xd00000>; + reg-names = "parf", "phy", "dm_core", "elbi", + "conf", "io", "bars"; + + #address-cells = <0>; + interrupt-parent = <&pcie0>; + interrupts = <0 1 2 3 4 5 6 7 8 9 10 11 12>; + #interrupt-cells = <1>; + interrupt-map-mask = <0xffffffff>; + interrupt-map = <0 &intc 0 141 0 + 1 &intc 0 142 0 + 2 &intc 0 143 0 + 3 &intc 0 144 0 + 4 &intc 0 145 0 + 5 &intc 0 146 0 + 6 &intc 0 147 0 + 7 &intc 0 148 0 + 8 &intc 0 149 0 + 9 &intc 0 150 0 + 10 &intc 0 151 0 + 11 &intc 0 152 0 >; + + interrupt-names = "int_msi", "int_a", "int_b", "int_c", "int_d", + "int_pls_pme", "int_pme_legacy", "int_pls_err", + "int_aer_legacy", "int_pls_link_up", + "int_pls_link_down", "int_bridge_flush_n","int_wake"; + + qcom,ep-latency = <10>; + + clocks = <&gcc GCC_PCIE_AHB_CLK>, + <&gcc GCC_PCIE_AXI_M_CLK>, + <&gcc GCC_PCIE_AXI_S_CLK>; + + clock-names = "pcie_0_cfg_ahb_clk", + "pcie_0_mstr_axi_clk", + "pcie_0_slv_axi_clk"; + + max-clock-frequency-hz = <0>, <0>, <0>; + + resets = <&gcc PCIE_AXI_M_ARES>, + <&gcc PCIE_AXI_S_ARES>, + <&gcc PCIE_PIPE_ARES>, + <&gcc PCIE_AXI_M_VMIDMT_ARES>, + <&gcc PCIE_AXI_S_XPU_ARES>, + <&gcc PCIE_PARF_XPU_ARES>, + <&gcc PCIE_PHY_ARES>, + <&gcc PCIE_AXI_M_STICKY_ARES>, + <&gcc PCIE_PIPE_STICKY_ARES>, + <&gcc PCIE_PWR_ARES>, + <&gcc PCIE_AHB_ARES>, + <&gcc PCIE_PHY_AHB_ARES>; + + reset-names = "pcie_rst_axi_m_ares", + "pcie_rst_axi_s_ares", + "pcie_rst_pipe_ares", + "pcie_rst_axi_m_vmidmt_ares", + "pcie_rst_axi_s_xpu_ares", + "pcie_rst_parf_xpu_ares", + "pcie_rst_phy_ares", + "pcie_rst_axi_m_sticky_ares", + "pcie_rst_pipe_sticky_ares", + "pcie_rst_pwr_ares", + "pcie_rst_ahb_res", + "pcie_rst_phy_ahb_ares"; + + status = "ok"; + perst-gpio = <&tlmm 38 0>; + wake-gpio = <&tlmm 50 0>; + clkreq-gpio = <&tlmm 39 0>; + }; tcsr@194b000 { /* select hostmode */ @@ -63,7 +148,6 @@ qcom,ess-interface-select = ; }; - tcsr@1949000 { compatible = "qcom,tcsr"; reg = <0x1949000 0x100>; @@ -76,11 +160,6 @@ qcom,wifi_noc_memtype_m0_m2 = ; }; - counter@4a1000 { - compatible = "qcom,qca-gcnt"; - reg = <0x4a1000 0x4>; - }; - mdio@90000 { status = "okay"; }; @@ -97,20 +176,20 @@ status = "okay"; }; - wifi@a000000 { - status = "okay"; + wifi0: wifi@a000000 { + status = "ok"; + core-id = <0x0>; + qca,msi_addr = <0x0b006040>; + qca,msi_base = <0x40>; + wifi_led_num = <2>; /* Wifi 2G */ + wifi_led_source = <0>; /* source id 0 */ + qcom,mtd-name = "0:ART"; + qcom,cal-offset = <0x1000>; + qcom,cal-len = <12064>; }; - wifi@a800000 { - status = "okay"; - }; - - cryptobam: dma@8e04000 { - status = "okay"; - }; - - crypto@8e3a000 { - status = "okay"; + wifi1: wifi@a800000 { + status = "disabled"; }; }; @@ -119,13 +198,13 @@ reset { label = "reset"; - gpios = <&tlmm 4 GPIO_ACTIVE_LOW>; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; linux,code = ; }; wps { label = "wps"; - gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + gpios = <&tlmm 11 GPIO_ACTIVE_LOW>; linux,code = ; }; }; @@ -135,137 +214,78 @@ power: status { label = "rt-acrh17:blue:status"; - gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + gpios = <&tlmm 40 GPIO_ACTIVE_LOW>; }; - wan { + lan1 { + label = "rt-acrh17:blue:lan1"; + gpios = <&tlmm 45 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "rt-acrh17:blue:lan2"; + gpios = <&tlmm 43 GPIO_ACTIVE_LOW>; + }; + + lan3 { + label = "rt-acrh17:blue:lan3"; + gpios = <&tlmm 42 GPIO_ACTIVE_LOW>; + }; + + lan4 { + label = "rt-acrh17:blue:lan4"; + gpios = <&tlmm 49 GPIO_ACTIVE_LOW>; + }; + + wan_blue { label = "rt-acrh17:blue:wan"; - gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; + gpios = <&tlmm 61 GPIO_ACTIVE_HIGH>; }; - wlan2G { - label = "rt-acrh17:blue:wlan2G"; - gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>; + wan_red { + label = "rt-acrh17:red:wan"; + gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; }; - wan5G { - label = "rt-acrh17:blue:wlan5G"; - gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>; + wlan2g { + label = "rt-acrh17:blue:wlan2g"; + gpios = <&tlmm 52 GPIO_ACTIVE_LOW>; }; - usb { - label = "rt-acrh17:blue:usb"; - gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; - }; - - lan { - label = "rt-acrh17:blue:lan"; - gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; + wlan5g { + label = "rt-acrh17:blue:wlan5g"; + gpios = <&tlmm 54 GPIO_ACTIVE_LOW>; }; }; }; -&spi_0_pins { - pinmux_cs { - function = "gpio"; - pins = "gpio54", "gpio59"; +&nand_pins { + pullups { + pins = "gpio53", "gpio58", + "gpio59"; + function = "qpic"; + bias-pull-up; }; - pinconf_cs { - pins = "gpio54", "gpio59"; - drive-strength = <2>; + + pulldowns { + pins = "gpio55", "gpio56", + "gpio57", "gpio60", + "gpio62", "gpio63", "gpio64", + "gpio65", "gpio66", "gpio67", + "gpio69"; + function = "qpic"; + bias-pull-down; + }; +}; + +&i2c_0_pins { + pinmux { + function = "blsp_i2c0"; + pins = "gpio10"; + }; + pinconf { + pins = "gpio10"; + drive-strength = <16>; bias-disable; - output-high; - }; -}; - - -&spi_0 { /* BLSP1 QUP1 */ - status = "ok"; - cs-gpios = <&tlmm 54 0>, - <&tlmm 59 0>; - - mx25l25635e@0 { - status = "disabled"; - }; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <0>; - /* - * U-boot looks for "n25q128a11" node, - * if we don't have it, it will spit out the following warning: - * "ipq: fdt fixup unable to find compatible node". - */ - compatible = "mx25l1606e", "n25q128a11", "jedec,spi-nor"; - reg = <0>; - linux,modalias = "m25p80", "mx25l1606e", "n25q128a11"; - spi-max-frequency = <24000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition0@0 { - label = "SBL1"; - reg = <0x00000000 0x00040000>; - read-only; - }; - partition1@40000 { - label = "MIBIB"; - reg = <0x00040000 0x00020000>; - read-only; - }; - partition2@60000 { - label = "QSEE"; - reg = <0x00060000 0x00060000>; - read-only; - }; - partition3@c0000 { - label = "CDT"; - reg = <0x000c0000 0x00010000>; - read-only; - }; - partition4@d0000 { - label = "DDRPARAMS"; - reg = <0x000d0000 0x00010000>; - read-only; - }; - partition5@e0000 { - label = "APPSBLENV"; /* uboot env*/ - reg = <0x000e0000 0x00010000>; - read-only; - }; - partition5@f0000 { - label = "APPSBL"; /* uboot */ - reg = <0x000f0000 0x00080000>; - read-only; - }; - partition5@170000 { - label = "ART"; - reg = <0x00170000 0x00010000>; - read-only; - }; - /* 0x00180000 - 0x00200000 unused */ - }; - }; - - mt29f@1 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "spinand,mt29f", "w25n01gv"; - reg = <1>; - spi-max-frequency = <24000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition0@0 { - label = "ubi"; - reg = <0x00000000 0x08000000>; - }; - }; }; }; diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index c79afb9d7e..a9353ec772 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -267,7 +267,7 @@ define Device/RT-ACRH17 IMAGES = sysupgrade.tar flash-factory.trx IMAGE/flash-factory.trx := copy-file $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE) | uImage none IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata - DEVICE_PACKAGES := kmod-usb-phy-qcom-ipq4019 ipq-wifi-rt-ac58u ath10k-firmware-qca9984 + DEVICE_PACKAGES := kmod-usb-phy-qcom-ipq4019 ath10k-firmware-qca4019 ath10k-firmware-qca9984 endef define Device/NBG6817 diff --git a/target/linux/ipq806x/patches-4.9/0016-clk-ipq4019-report-accurate-fixed-clock-rates.patch b/target/linux/ipq806x/patches-4.9/0016-clk-ipq4019-report-accurate-fixed-clock-rates.patch index 6f7665390d..be9c4eb1b2 100644 --- a/target/linux/ipq806x/patches-4.9/0016-clk-ipq4019-report-accurate-fixed-clock-rates.patch +++ b/target/linux/ipq806x/patches-4.9/0016-clk-ipq4019-report-accurate-fixed-clock-rates.patch @@ -13,7 +13,7 @@ Signed-off-by: Matthew McClintock --- a/drivers/clk/qcom/gcc-ipq4019.c +++ b/drivers/clk/qcom/gcc-ipq4019.c -@@ -1317,12 +1317,12 @@ static int gcc_ipq4019_probe(struct plat +@@ -1327,12 +1327,12 @@ static int gcc_ipq4019_probe(struct plat { struct device *dev = &pdev->dev; diff --git a/target/linux/ipq806x/patches-4.9/0067-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/ipq806x/patches-4.9/0067-generic-Mangle-bootloader-s-kernel-arguments.patch index 467ffbf220..478dad7861 100644 --- a/target/linux/ipq806x/patches-4.9/0067-generic-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/ipq806x/patches-4.9/0067-generic-Mangle-bootloader-s-kernel-arguments.patch @@ -157,7 +157,7 @@ Signed-off-by: Adrian Panella } --- a/init/main.c +++ b/init/main.c -@@ -87,6 +87,10 @@ +@@ -88,6 +88,10 @@ #include #include @@ -168,7 +168,7 @@ Signed-off-by: Adrian Panella static int kernel_init(void *); extern void init_IRQ(void); -@@ -537,6 +541,18 @@ asmlinkage __visible void __init start_k +@@ -539,6 +543,18 @@ asmlinkage __visible void __init start_k page_alloc_init(); pr_notice("Kernel command line: %s\n", boot_command_line); diff --git a/target/linux/ixp4xx/Makefile b/target/linux/ixp4xx/Makefile index a185ce8df5..e1964331a0 100644 --- a/target/linux/ixp4xx/Makefile +++ b/target/linux/ixp4xx/Makefile @@ -10,10 +10,11 @@ ARCH:=armeb BOARD:=ixp4xx BOARDNAME:=Intel IXP4xx FEATURES:=squashfs -MAINTAINER:=Imre Kaloz +MAINTAINER:=Ted Hess , \ + Imre Kaloz SUBTARGETS:=generic harddisk -KERNEL_PATCHVER:=4.4 +KERNEL_PATCHVER:=4.9 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/ixp4xx/config-4.9 b/target/linux/ixp4xx/config-4.9 new file mode 100644 index 0000000000..c9b1be9304 --- /dev/null +++ b/target/linux/ixp4xx/config-4.9 @@ -0,0 +1,247 @@ +CONFIG_ALIGNMENT_TRAP=y +# CONFIG_ARCH_ADI_COYOTE is not set +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_HAS_DMA_SET_COHERENT_MASK=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +# CONFIG_ARCH_HAS_SG_CHAIN is not set +CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_IXCDP1100=y +CONFIG_ARCH_IXDP425=y +CONFIG_ARCH_IXDP4XX=y +CONFIG_ARCH_IXP4XX=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_NR_GPIO=0 +# CONFIG_ARCH_PRPMC1100 is not set +# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set +# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARCH_WANT_GENERAL_HUGETLB=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ARM=y +# CONFIG_ARM_CPU_SUSPEND is not set +CONFIG_ARM_L1_CACHE_SHIFT=5 +CONFIG_ARM_PATCH_PHYS_VIRT=y +# CONFIG_ARM_THUMB is not set +CONFIG_ATAGS=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BOUNCE=y +# CONFIG_CACHE_L2X0 is not set +CONFIG_CLKSRC_MMIO=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE="root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200" +CONFIG_CMDLINE_FROM_BOOTLOADER=y +CONFIG_CPU_32v5=y +CONFIG_CPU_ABRT_EV5T=y +CONFIG_CPU_BIG_ENDIAN=y +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +CONFIG_CPU_ENDIAN_BE32=y +# CONFIG_CPU_ENDIAN_BE8 is not set +CONFIG_CPU_IXP43X=y +CONFIG_CPU_IXP46X=y +CONFIG_CPU_PABRT_LEGACY=y +CONFIG_CPU_TLB_V4WBI=y +CONFIG_CPU_USE_DOMAINS=y +CONFIG_CPU_XSCALE=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_LL_INCLUDE="debug/8250.S" +CONFIG_DEBUG_UART_8250=y +# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set +CONFIG_DEBUG_UART_8250_SHIFT=2 +# CONFIG_DEBUG_UART_8250_WORD is not set +CONFIG_DEBUG_UART_PHYS=0xc8000003 +CONFIG_DEBUG_UART_VIRT=0xfef00003 +# CONFIG_DEBUG_USER is not set +CONFIG_DMABOUNCE=y +CONFIG_DNOTIFY=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EEPROM_AT24=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FRAME_POINTER=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GPIOLIB=y +CONFIG_GPIO_SYSFS=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set +CONFIG_HAVE_ARCH_AUDITSYSCALL=y +# CONFIG_HAVE_ARCH_BITREVERSE is not set +CONFIG_HAVE_ARCH_PFN_VALID=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_CBPF_JIT=y +CONFIG_HAVE_CC_STACKPROTECTOR=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_OPTPROBES=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_PROC_CPU=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_UID16=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HWMON=y +CONFIG_HWMON_VID=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_IXP4XX=y +CONFIG_HZ_FIXED=0 +CONFIG_HZ_PERIODIC=y +CONFIG_I2C=y +CONFIG_I2C_ALGOBIT=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_GPIO=y +# CONFIG_I2C_IOP3XX is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IOMMU_HELPER=y +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +# CONFIG_IWMMXT is not set +CONFIG_IXP4XX_ETH=y +# CONFIG_IXP4XX_INDIRECT_PCI is not set +CONFIG_IXP4XX_NPE=y +CONFIG_IXP4XX_QMGR=y +CONFIG_IXP4XX_WATCHDOG=y +CONFIG_LEDS_FSG=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_LATCH=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_MACH_AP1000=y +CONFIG_MACH_AP42X=y +# CONFIG_MACH_ARCOM_VULCAN is not set +CONFIG_MACH_AVILA=y +CONFIG_MACH_CAMBRIA=y +CONFIG_MACH_COMPEXWP18=y +# CONFIG_MACH_DEVIXP is not set +CONFIG_MACH_DSMG600=y +CONFIG_MACH_FSG=y +CONFIG_MACH_GATEWAY7001=y +# CONFIG_MACH_GORAMO_MLR is not set +# CONFIG_MACH_GTWX5715 is not set +# CONFIG_MACH_IXDP465 is not set +CONFIG_MACH_IXDPG425=y +# CONFIG_MACH_KIXRP435 is not set +CONFIG_MACH_LOFT=y +CONFIG_MACH_MI424WR=y +# CONFIG_MACH_MIC256 is not set +# CONFIG_MACH_MICCPT is not set +CONFIG_MACH_NAS100D=y +CONFIG_MACH_NSLU2=y +CONFIG_MACH_PRONGHORN=y +CONFIG_MACH_PRONGHORNMETRO=y +CONFIG_MACH_SIDEWINDER=y +CONFIG_MACH_TW2662=y +CONFIG_MACH_TW5334=y +CONFIG_MACH_USR8200=y +CONFIG_MACH_WG302V1=y +CONFIG_MACH_WG302V2=y +CONFIG_MACH_WRT300NV2=y +CONFIG_MDIO_BOARDINFO=y +CONFIG_MIGHT_HAVE_PCI=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MTD_CFI_ADV_OPTIONS=y +# CONFIG_MTD_CFI_GEOMETRY is not set +CONFIG_MTD_IXP4XX=y +CONFIG_MTD_OTP=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_REDBOOT_PARTS=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_KUSER_HELPERS=y +CONFIG_NEED_MACH_IO_H=y +CONFIG_NEED_PER_CPU_KM=y +CONFIG_NET_PTP_CLASSIFY=y +CONFIG_NET_VENDOR_XSCALE=y +CONFIG_NO_BOOTMEM=y +CONFIG_NVMEM=y +# CONFIG_OF is not set +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PCI=y +# CONFIG_PCI_DOMAINS_GENERIC is not set +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +# CONFIG_RCU_STALL_COMMON is not set +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_DS1672=y +CONFIG_RTC_DRV_ISL1208=y +CONFIG_RTC_DRV_PCF8563=y +CONFIG_RTC_DRV_X1205=y +CONFIG_RTC_I2C_AND_SPI=y +CONFIG_RTC_MC146818_LIB=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +# CONFIG_SCHED_INFO is not set +# CONFIG_SCSI_DMA is not set +CONFIG_SENSORS_AD7418=y +CONFIG_SENSORS_MAX6650=y +CONFIG_SENSORS_W83781D=y +CONFIG_SERIAL_8250_FSL=y +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SPLIT_PTLOCK_CPUS=999999 +CONFIG_SRCU=y +CONFIG_SWIOTLB=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_UNCOMPRESS_INCLUDE="mach/uncompress.h" +CONFIG_USB_EHCI_BIG_ENDIAN_DESC=y +CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y +CONFIG_USB_SUPPORT=y +CONFIG_VECTORS_BASE=0xffff0000 +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_WATCHDOG_NOWAYOUT=y +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_ZBOOT_ROM_TEXT=0x0 diff --git a/target/linux/ixp4xx/patches-4.4/160-delayed_uart_io.patch b/target/linux/ixp4xx/patches-4.4/160-delayed_uart_io.patch index 2bcc801b14..937a65e43a 100644 --- a/target/linux/ixp4xx/patches-4.4/160-delayed_uart_io.patch +++ b/target/linux/ixp4xx/patches-4.4/160-delayed_uart_io.patch @@ -115,7 +115,7 @@ case UPIO_AU: p->serial_out(p, offset, value); p->serial_in(p, UART_LCR); /* safe, no side-effects */ -@@ -2457,6 +2477,7 @@ static int serial8250_request_std_resour +@@ -2460,6 +2480,7 @@ static int serial8250_request_std_resour case UPIO_MEM32: case UPIO_MEM32BE: case UPIO_MEM: @@ -123,7 +123,7 @@ if (!port->mapbase) break; -@@ -2494,6 +2515,7 @@ static void serial8250_release_std_resou +@@ -2497,6 +2518,7 @@ static void serial8250_release_std_resou case UPIO_MEM32: case UPIO_MEM32BE: case UPIO_MEM: diff --git a/target/linux/ixp4xx/patches-4.4/207-npe_driver_multiphy_support.patch b/target/linux/ixp4xx/patches-4.4/207-npe_driver_multiphy_support.patch index 207ccc533a..33c3327ee9 100644 --- a/target/linux/ixp4xx/patches-4.4/207-npe_driver_multiphy_support.patch +++ b/target/linux/ixp4xx/patches-4.4/207-npe_driver_multiphy_support.patch @@ -66,7 +66,18 @@ TODO: take care of additional PHYs through the PHY abstraction layer snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, mdio_bus->id, plat->phy); port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, -@@ -632,21 +663,32 @@ static void ixp4xx_phy_disconnect(struct +@@ -625,6 +656,10 @@ static int ixp4xx_phy_connect(struct net + + port->phydev->irq = PHY_POLL; + ++ port->link = 0; ++ port->speed = 0; ++ port->duplex = -1; ++ + return 0; + } + +@@ -632,21 +667,32 @@ static void ixp4xx_phy_disconnect(struct { struct port *port = netdev_priv(dev); @@ -102,7 +113,7 @@ TODO: take care of additional PHYs through the PHY abstraction layer } static inline void debug_pkt(struct net_device *dev, const char *func, -@@ -1048,6 +1090,9 @@ static int eth_ioctl(struct net_device * +@@ -1048,6 +1094,9 @@ static int eth_ioctl(struct net_device * return hwtstamp_get(dev, req); } @@ -112,7 +123,7 @@ TODO: take care of additional PHYs through the PHY abstraction layer return phy_mii_ioctl(port->phydev, req, cmd); } -@@ -1068,18 +1113,30 @@ static void ixp4xx_get_drvinfo(struct ne +@@ -1068,18 +1117,30 @@ static void ixp4xx_get_drvinfo(struct ne static int ixp4xx_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) { struct port *port = netdev_priv(dev); @@ -143,3 +154,14 @@ TODO: take care of additional PHYs through the PHY abstraction layer return phy_start_aneg(port->phydev); } +@@ -1529,10 +1590,6 @@ static int eth_init_one(struct platform_ + if ((err = register_netdev(dev))) + goto err_phy_dis; + +- port->link = 0; +- port->speed = 0; +- port->duplex = -1; +- + printk(KERN_INFO "%s: MII PHY %i on %s\n", dev->name, plat->phy, + npe_name(port->npe)); + diff --git a/target/linux/ixp4xx/patches-4.9/001-arm-ixp4xx-set-cohorent_dma_mask-for-ethernet-platfo.patch b/target/linux/ixp4xx/patches-4.9/001-arm-ixp4xx-set-cohorent_dma_mask-for-ethernet-platfo.patch new file mode 100644 index 0000000000..3ca3eb76a6 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/001-arm-ixp4xx-set-cohorent_dma_mask-for-ethernet-platfo.patch @@ -0,0 +1,136 @@ +From 7113f56b683c5123df5c20724ac813cee66fa21a Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Mon, 1 Jul 2013 16:49:05 +0200 +Subject: [PATCH 1/2] arm: ixp4xx: set cohorent_dma_mask for ethernet platform + devices + +ARM requires the cohorent_dma_mask set, so set it for the platform +devices so that the ethernet driver has access to it. + +Signed-off-by: Jonas Gorski +--- + arch/arm/mach-ixp4xx/fsg-setup.c | 2 ++ + arch/arm/mach-ixp4xx/goramo_mlr.c | 2 ++ + arch/arm/mach-ixp4xx/ixdp425-setup.c | 3 +++ + arch/arm/mach-ixp4xx/nas100d-setup.c | 1 + + arch/arm/mach-ixp4xx/nslu2-setup.c | 1 + + arch/arm/mach-ixp4xx/omixp-setup.c | 3 +++ + arch/arm/mach-ixp4xx/vulcan-setup.c | 2 ++ + 7 files changed, 14 insertions(+) + +--- a/arch/arm/mach-ixp4xx/fsg-setup.c ++++ b/arch/arm/mach-ixp4xx/fsg-setup.c +@@ -142,12 +142,14 @@ static struct platform_device fsg_eth[] + .id = IXP4XX_ETH_NPEB, + .dev = { + .platform_data = fsg_plat_eth, ++ .coherent_dma_mask = DMA_BIT_MASK(32), + }, + }, { + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEC, + .dev = { + .platform_data = fsg_plat_eth + 1, ++ .coherent_dma_mask = DMA_BIT_MASK(32), + }, + } + }; +--- a/arch/arm/mach-ixp4xx/goramo_mlr.c ++++ b/arch/arm/mach-ixp4xx/goramo_mlr.c +@@ -295,10 +295,12 @@ static struct platform_device device_eth + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEB, + .dev.platform_data = eth_plat, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + }, { + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEC, + .dev.platform_data = eth_plat + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + } + }; + +--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c ++++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -196,10 +197,12 @@ static struct platform_device ixdp425_et + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEB, + .dev.platform_data = ixdp425_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + }, { + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEC, + .dev.platform_data = ixdp425_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + } + }; + +--- a/arch/arm/mach-ixp4xx/nas100d-setup.c ++++ b/arch/arm/mach-ixp4xx/nas100d-setup.c +@@ -170,6 +170,7 @@ static struct platform_device nas100d_et + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEB, + .dev.platform_data = nas100d_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + } + }; + +--- a/arch/arm/mach-ixp4xx/nslu2-setup.c ++++ b/arch/arm/mach-ixp4xx/nslu2-setup.c +@@ -182,6 +182,7 @@ static struct platform_device nslu2_eth[ + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEB, + .dev.platform_data = nslu2_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + } + }; + +--- a/arch/arm/mach-ixp4xx/omixp-setup.c ++++ b/arch/arm/mach-ixp4xx/omixp-setup.c +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + #include + + #include +@@ -188,10 +189,12 @@ static struct platform_device ixdp425_et + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEB, + .dev.platform_data = ixdp425_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + }, { + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEC, + .dev.platform_data = ixdp425_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + }, + }; + +--- a/arch/arm/mach-ixp4xx/vulcan-setup.c ++++ b/arch/arm/mach-ixp4xx/vulcan-setup.c +@@ -139,6 +139,7 @@ static struct platform_device vulcan_eth + .id = IXP4XX_ETH_NPEB, + .dev = { + .platform_data = &vulcan_plat_eth[0], ++ .coherent_dma_mask = DMA_BIT_MASK(32), + }, + }, + [1] = { +@@ -146,6 +147,7 @@ static struct platform_device vulcan_eth + .id = IXP4XX_ETH_NPEC, + .dev = { + .platform_data = &vulcan_plat_eth[1], ++ .coherent_dma_mask = DMA_BIT_MASK(32), + }, + }, + }; diff --git a/target/linux/ixp4xx/patches-4.9/002-ixp4xx_eth-use-parent-device-for-dma-allocations.patch b/target/linux/ixp4xx/patches-4.9/002-ixp4xx_eth-use-parent-device-for-dma-allocations.patch new file mode 100644 index 0000000000..b369b56f00 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/002-ixp4xx_eth-use-parent-device-for-dma-allocations.patch @@ -0,0 +1,95 @@ +From 1d67040af0144c549f4db8144d2ccc253ff8639c Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Mon, 1 Jul 2013 16:39:28 +0200 +Subject: [PATCH 2/2] net: ixp4xx_eth: use parent device for dma allocations + +Now that the platfomr device provides a dma_cohorent_mask, use it for +dma operations. + +This fixes ethernet on ixp4xx which was broken since 3.7. + +Signed-off-by: Jonas Gorski +--- + drivers/net/ethernet/xscale/ixp4xx_eth.c | 23 ++++++++++++----------- + 1 file changed, 12 insertions(+), 11 deletions(-) + +--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c ++++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c +@@ -656,10 +656,10 @@ static inline void queue_put_desc(unsign + static inline void dma_unmap_tx(struct port *port, struct desc *desc) + { + #ifdef __ARMEB__ +- dma_unmap_single(&port->netdev->dev, desc->data, ++ dma_unmap_single(port->netdev->dev.parent, desc->data, + desc->buf_len, DMA_TO_DEVICE); + #else +- dma_unmap_single(&port->netdev->dev, desc->data & ~3, ++ dma_unmap_single(port->netdev->dev.parent, desc->data & ~3, + ALIGN((desc->data & 3) + desc->buf_len, 4), + DMA_TO_DEVICE); + #endif +@@ -725,9 +725,9 @@ static int eth_poll(struct napi_struct * + + #ifdef __ARMEB__ + if ((skb = netdev_alloc_skb(dev, RX_BUFF_SIZE))) { +- phys = dma_map_single(&dev->dev, skb->data, ++ phys = dma_map_single(dev->dev.parent, skb->data, + RX_BUFF_SIZE, DMA_FROM_DEVICE); +- if (dma_mapping_error(&dev->dev, phys)) { ++ if (dma_mapping_error(dev->dev.parent, phys)) { + dev_kfree_skb(skb); + skb = NULL; + } +@@ -750,10 +750,11 @@ static int eth_poll(struct napi_struct * + #ifdef __ARMEB__ + temp = skb; + skb = port->rx_buff_tab[n]; +- dma_unmap_single(&dev->dev, desc->data - NET_IP_ALIGN, ++ dma_unmap_single(dev->dev.parent, desc->data - NET_IP_ALIGN, + RX_BUFF_SIZE, DMA_FROM_DEVICE); + #else +- dma_sync_single_for_cpu(&dev->dev, desc->data - NET_IP_ALIGN, ++ dma_sync_single_for_cpu(dev->dev.parent, ++ desc->data - NET_IP_ALIGN, + RX_BUFF_SIZE, DMA_FROM_DEVICE); + memcpy_swab32((u32 *)skb->data, (u32 *)port->rx_buff_tab[n], + ALIGN(NET_IP_ALIGN + desc->pkt_len, 4) / 4); +@@ -872,7 +873,7 @@ static int eth_xmit(struct sk_buff *skb, + memcpy_swab32(mem, (u32 *)((int)skb->data & ~3), bytes / 4); + #endif + +- phys = dma_map_single(&dev->dev, mem, bytes, DMA_TO_DEVICE); ++ phys = dma_map_single(dev->dev.parent, mem, bytes, DMA_TO_DEVICE); + if (dma_mapping_error(&dev->dev, phys)) { + dev_kfree_skb(skb); + #ifndef __ARMEB__ +@@ -1107,7 +1108,7 @@ static int init_queues(struct port *port + int i; + + if (!ports_open) { +- dma_pool = dma_pool_create(DRV_NAME, &port->netdev->dev, ++ dma_pool = dma_pool_create(DRV_NAME, port->netdev->dev.parent, + POOL_ALLOC_SIZE, 32, 0); + if (!dma_pool) + return -ENOMEM; +@@ -1135,9 +1136,9 @@ static int init_queues(struct port *port + data = buff; + #endif + desc->buf_len = MAX_MRU; +- desc->data = dma_map_single(&port->netdev->dev, data, ++ desc->data = dma_map_single(port->netdev->dev.parent, data, + RX_BUFF_SIZE, DMA_FROM_DEVICE); +- if (dma_mapping_error(&port->netdev->dev, desc->data)) { ++ if (dma_mapping_error(port->netdev->dev.parent, desc->data)) { + free_buffer(buff); + return -EIO; + } +@@ -1157,7 +1158,7 @@ static void destroy_queues(struct port * + struct desc *desc = rx_desc_ptr(port, i); + buffer_t *buff = port->rx_buff_tab[i]; + if (buff) { +- dma_unmap_single(&port->netdev->dev, ++ dma_unmap_single(port->netdev->dev.parent, + desc->data - NET_IP_ALIGN, + RX_BUFF_SIZE, DMA_FROM_DEVICE); + free_buffer(buff); diff --git a/target/linux/ixp4xx/patches-4.9/020-gateworks_i2c_pld.patch b/target/linux/ixp4xx/patches-4.9/020-gateworks_i2c_pld.patch new file mode 100644 index 0000000000..185a09fff2 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/020-gateworks_i2c_pld.patch @@ -0,0 +1,424 @@ +--- a/drivers/gpio/Kconfig ++++ b/drivers/gpio/Kconfig +@@ -656,6 +656,14 @@ config GPIO_WS16C48 + parameter. The interrupt line numbers for the devices may be + configured via the irq module parameter. + ++config GPIO_GW_I2C_PLD ++ tristate "Gateworks I2C PLD GPIO Expander" ++ depends on I2C ++ help ++ Say yes here to provide access to the Gateworks I2C PLD GPIO ++ Expander. This is used at least on the GW2358-4. ++ ++ + endmenu + + menu "I2C GPIO expanders" +--- a/drivers/gpio/Makefile ++++ b/drivers/gpio/Makefile +@@ -48,6 +48,7 @@ obj-$(CONFIG_GPIO_F7188X) += gpio-f7188x + obj-$(CONFIG_GPIO_GE_FPGA) += gpio-ge.o + obj-$(CONFIG_GPIO_GPIO_MM) += gpio-gpio-mm.o + obj-$(CONFIG_GPIO_GRGPIO) += gpio-grgpio.o ++obj-$(CONFIG_GPIO_GW_I2C_PLD) += gw_i2c_pld.o + obj-$(CONFIG_HTC_EGPIO) += gpio-htc-egpio.o + obj-$(CONFIG_GPIO_ICH) += gpio-ich.o + obj-$(CONFIG_GPIO_IOP) += gpio-iop.o +--- /dev/null ++++ b/drivers/gpio/gw_i2c_pld.c +@@ -0,0 +1,371 @@ ++/* ++ * Gateworks I2C PLD GPIO expander ++ * ++ * Copyright (C) 2009 Gateworks Corporation ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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., 675 Mass Ave, Cambridge, MA 02139, USA. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static const struct i2c_device_id gw_i2c_pld_id[] = { ++ { "gw_i2c_pld", 8 }, ++ { } ++}; ++MODULE_DEVICE_TABLE(i2c, gw_i2c_pld_id); ++ ++/* ++ * The Gateworks I2C PLD chip only expose one read and one ++ * write register. Writing a "one" bit (to match the reset state) lets ++ * that pin be used as an input. It is an open-drain model. ++ */ ++ ++struct gw_i2c_pld { ++ struct gpio_chip chip; ++ struct i2c_client *client; ++ unsigned out; /* software latch */ ++}; ++ ++/*-------------------------------------------------------------------------*/ ++ ++/* ++ * The Gateworks I2C PLD chip does not properly send the acknowledge bit ++ * thus we cannot use standard i2c_smbus functions. We have recreated ++ * our own here, but we still use the rt_mutex_lock to lock the i2c_bus ++ * as the device still exists on the I2C bus. ++*/ ++ ++#define PLD_SCL_GPIO 6 ++#define PLD_SDA_GPIO 7 ++ ++#define SCL_LO() gpio_line_set(PLD_SCL_GPIO, IXP4XX_GPIO_LOW) ++#define SCL_HI() gpio_line_set(PLD_SCL_GPIO, IXP4XX_GPIO_HIGH) ++#define SCL_EN() gpio_line_config(PLD_SCL_GPIO, IXP4XX_GPIO_OUT) ++#define SDA_LO() gpio_line_set(PLD_SDA_GPIO, IXP4XX_GPIO_LOW) ++#define SDA_HI() gpio_line_set(PLD_SDA_GPIO, IXP4XX_GPIO_HIGH) ++#define SDA_EN() gpio_line_config(PLD_SDA_GPIO, IXP4XX_GPIO_OUT) ++#define SDA_DIS() gpio_line_config(PLD_SDA_GPIO, IXP4XX_GPIO_IN) ++#define SDA_IN(x) gpio_line_get(PLD_SDA_GPIO, &x); ++ ++static int i2c_pld_write_byte(int address, int byte) ++{ ++ int i; ++ ++ address = (address << 1) & ~0x1; ++ ++ SDA_HI(); ++ SDA_EN(); ++ SCL_EN(); ++ SCL_HI(); ++ SDA_LO(); ++ SCL_LO(); ++ ++ for (i = 7; i >= 0; i--) ++ { ++ if (address & (1 << i)) ++ SDA_HI(); ++ else ++ SDA_LO(); ++ ++ SCL_HI(); ++ SCL_LO(); ++ } ++ ++ SDA_DIS(); ++ SCL_HI(); ++ SDA_IN(i); ++ SCL_LO(); ++ SDA_EN(); ++ ++ for (i = 7; i >= 0; i--) ++ { ++ if (byte & (1 << i)) ++ SDA_HI(); ++ else ++ SDA_LO(); ++ SCL_HI(); ++ SCL_LO(); ++ } ++ ++ SDA_DIS(); ++ SCL_HI(); ++ SDA_IN(i); ++ SCL_LO(); ++ ++ SDA_HI(); ++ SDA_EN(); ++ ++ SDA_LO(); ++ SCL_HI(); ++ SDA_HI(); ++ SCL_LO(); ++ SCL_HI(); ++ ++ return 0; ++} ++ ++static unsigned int i2c_pld_read_byte(int address) ++{ ++ int i = 0, byte = 0; ++ int bit; ++ ++ address = (address << 1) | 0x1; ++ ++ SDA_HI(); ++ SDA_EN(); ++ SCL_EN(); ++ SCL_HI(); ++ SDA_LO(); ++ SCL_LO(); ++ ++ for (i = 7; i >= 0; i--) ++ { ++ if (address & (1 << i)) ++ SDA_HI(); ++ else ++ SDA_LO(); ++ ++ SCL_HI(); ++ SCL_LO(); ++ } ++ ++ SDA_DIS(); ++ SCL_HI(); ++ SDA_IN(i); ++ SCL_LO(); ++ SDA_EN(); ++ ++ SDA_DIS(); ++ for (i = 7; i >= 0; i--) ++ { ++ SCL_HI(); ++ SDA_IN(bit); ++ byte |= bit << i; ++ SCL_LO(); ++ } ++ ++ SDA_LO(); ++ SCL_HI(); ++ SDA_HI(); ++ SCL_LO(); ++ SCL_HI(); ++ ++ return byte; ++} ++ ++ ++static int gw_i2c_pld_input8(struct gpio_chip *chip, unsigned offset) ++{ ++ int ret; ++ struct gw_i2c_pld *gpio = container_of(chip, struct gw_i2c_pld, chip); ++ struct i2c_adapter *adap = gpio->client->adapter; ++ ++ if (in_atomic() || irqs_disabled()) { ++ ret = rt_mutex_trylock(&adap->bus_lock); ++ if (!ret) ++ /* I2C activity is ongoing. */ ++ return -EAGAIN; ++ } else { ++ rt_mutex_lock(&adap->bus_lock); ++ } ++ ++ gpio->out |= (1 << offset); ++ ++ ret = i2c_pld_write_byte(gpio->client->addr, gpio->out); ++ ++ rt_mutex_unlock(&adap->bus_lock); ++ ++ return ret; ++} ++ ++static int gw_i2c_pld_get8(struct gpio_chip *chip, unsigned offset) ++{ ++ int ret; ++ s32 value; ++ struct gw_i2c_pld *gpio = container_of(chip, struct gw_i2c_pld, chip); ++ struct i2c_adapter *adap = gpio->client->adapter; ++ ++ if (in_atomic() || irqs_disabled()) { ++ ret = rt_mutex_trylock(&adap->bus_lock); ++ if (!ret) ++ /* I2C activity is ongoing. */ ++ return -EAGAIN; ++ } else { ++ rt_mutex_lock(&adap->bus_lock); ++ } ++ ++ value = i2c_pld_read_byte(gpio->client->addr); ++ ++ rt_mutex_unlock(&adap->bus_lock); ++ ++ return (value < 0) ? 0 : (value & (1 << offset)); ++} ++ ++static int gw_i2c_pld_output8(struct gpio_chip *chip, unsigned offset, int value) ++{ ++ int ret; ++ ++ struct gw_i2c_pld *gpio = container_of(chip, struct gw_i2c_pld, chip); ++ struct i2c_adapter *adap = gpio->client->adapter; ++ ++ unsigned bit = 1 << offset; ++ ++ if (in_atomic() || irqs_disabled()) { ++ ret = rt_mutex_trylock(&adap->bus_lock); ++ if (!ret) ++ /* I2C activity is ongoing. */ ++ return -EAGAIN; ++ } else { ++ rt_mutex_lock(&adap->bus_lock); ++ } ++ ++ ++ if (value) ++ gpio->out |= bit; ++ else ++ gpio->out &= ~bit; ++ ++ ret = i2c_pld_write_byte(gpio->client->addr, gpio->out); ++ ++ rt_mutex_unlock(&adap->bus_lock); ++ ++ return ret; ++} ++ ++static void gw_i2c_pld_set8(struct gpio_chip *chip, unsigned offset, int value) ++{ ++ gw_i2c_pld_output8(chip, offset, value); ++} ++ ++/*-------------------------------------------------------------------------*/ ++ ++static int gw_i2c_pld_probe(struct i2c_client *client, ++ const struct i2c_device_id *id) ++{ ++ struct gw_i2c_pld_platform_data *pdata; ++ struct gw_i2c_pld *gpio; ++ int status; ++ ++ pdata = client->dev.platform_data; ++ if (!pdata) ++ return -ENODEV; ++ ++ /* Allocate, initialize, and register this gpio_chip. */ ++ gpio = kzalloc(sizeof *gpio, GFP_KERNEL); ++ if (!gpio) ++ return -ENOMEM; ++ ++ gpio->chip.base = pdata->gpio_base; ++ gpio->chip.can_sleep = 1; ++ gpio->chip.dev = &client->dev; ++ gpio->chip.owner = THIS_MODULE; ++ ++ gpio->chip.ngpio = pdata->nr_gpio; ++ gpio->chip.direction_input = gw_i2c_pld_input8; ++ gpio->chip.get = gw_i2c_pld_get8; ++ gpio->chip.direction_output = gw_i2c_pld_output8; ++ gpio->chip.set = gw_i2c_pld_set8; ++ ++ gpio->chip.label = client->name; ++ ++ gpio->client = client; ++ i2c_set_clientdata(client, gpio); ++ ++ gpio->out = 0xFF; ++ ++ status = gpiochip_add(&gpio->chip); ++ if (status < 0) ++ goto fail; ++ ++ dev_info(&client->dev, "gpios %d..%d on a %s%s\n", ++ gpio->chip.base, ++ gpio->chip.base + gpio->chip.ngpio - 1, ++ client->name, ++ client->irq ? " (irq ignored)" : ""); ++ ++ /* Let platform code set up the GPIOs and their users. ++ * Now is the first time anyone could use them. ++ */ ++ if (pdata->setup) { ++ status = pdata->setup(client, ++ gpio->chip.base, gpio->chip.ngpio, ++ pdata->context); ++ if (status < 0) ++ dev_warn(&client->dev, "setup --> %d\n", status); ++ } ++ ++ return 0; ++ ++fail: ++ dev_dbg(&client->dev, "probe error %d for '%s'\n", ++ status, client->name); ++ kfree(gpio); ++ return status; ++} ++ ++static int gw_i2c_pld_remove(struct i2c_client *client) ++{ ++ struct gw_i2c_pld_platform_data *pdata = client->dev.platform_data; ++ struct gw_i2c_pld *gpio = i2c_get_clientdata(client); ++ int status = 0; ++ ++ if (pdata->teardown) { ++ status = pdata->teardown(client, ++ gpio->chip.base, gpio->chip.ngpio, ++ pdata->context); ++ if (status < 0) { ++ dev_err(&client->dev, "%s --> %d\n", ++ "teardown", status); ++ return status; ++ } ++ } ++ ++ gpiochip_remove(&gpio->chip); ++ kfree(gpio); ++ return 0; ++} ++ ++static struct i2c_driver gw_i2c_pld_driver = { ++ .driver = { ++ .name = "gw_i2c_pld", ++ .owner = THIS_MODULE, ++ }, ++ .probe = gw_i2c_pld_probe, ++ .remove = gw_i2c_pld_remove, ++ .id_table = gw_i2c_pld_id, ++}; ++ ++static int __init gw_i2c_pld_init(void) ++{ ++ return i2c_add_driver(&gw_i2c_pld_driver); ++} ++module_init(gw_i2c_pld_init); ++ ++static void __exit gw_i2c_pld_exit(void) ++{ ++ i2c_del_driver(&gw_i2c_pld_driver); ++} ++module_exit(gw_i2c_pld_exit); ++ ++MODULE_LICENSE("GPL"); ++MODULE_AUTHOR("Chris Lang"); +--- /dev/null ++++ b/include/linux/i2c/gw_i2c_pld.h +@@ -0,0 +1,20 @@ ++#ifndef __LINUX_GW_I2C_PLD_H ++#define __LINUX_GW_I2C_PLD_H ++ ++/** ++ * The Gateworks I2C PLD Implements an additional 8 bits of GPIO through the PLD ++ */ ++ ++struct gw_i2c_pld_platform_data { ++ unsigned gpio_base; ++ unsigned nr_gpio; ++ int (*setup)(struct i2c_client *client, ++ int gpio, unsigned ngpio, ++ void *context); ++ int (*teardown)(struct i2c_client *client, ++ int gpio, unsigned ngpio, ++ void *context); ++ void *context; ++}; ++ ++#endif /* __LINUX_GW_I2C_PLD_H */ diff --git a/target/linux/ixp4xx/patches-4.9/030-gpio_line_config.patch b/target/linux/ixp4xx/patches-4.9/030-gpio_line_config.patch new file mode 100644 index 0000000000..0e51793273 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/030-gpio_line_config.patch @@ -0,0 +1,73 @@ +--- a/arch/arm/mach-ixp4xx/common.c ++++ b/arch/arm/mach-ixp4xx/common.c +@@ -93,22 +93,7 @@ void __init ixp4xx_map_io(void) + /* + * GPIO-functions + */ +-/* +- * The following converted to the real HW bits the gpio_line_config +- */ +-/* GPIO pin types */ +-#define IXP4XX_GPIO_OUT 0x1 +-#define IXP4XX_GPIO_IN 0x2 +- +-/* GPIO signal types */ +-#define IXP4XX_GPIO_LOW 0 +-#define IXP4XX_GPIO_HIGH 1 +- +-/* GPIO Clocks */ +-#define IXP4XX_GPIO_CLK_0 14 +-#define IXP4XX_GPIO_CLK_1 15 +- +-static void gpio_line_config(u8 line, u32 direction) ++void gpio_line_config(u8 line, u32 direction) + { + if (direction == IXP4XX_GPIO_IN) + *IXP4XX_GPIO_GPOER |= (1 << line); +@@ -116,17 +101,17 @@ static void gpio_line_config(u8 line, u3 + *IXP4XX_GPIO_GPOER &= ~(1 << line); + } + +-static void gpio_line_get(u8 line, int *value) ++void gpio_line_get(u8 line, int *value) + { + *value = (*IXP4XX_GPIO_GPINR >> line) & 0x1; + } + +-static void gpio_line_set(u8 line, int value) ++void gpio_line_set(u8 line, int value) + { +- if (value == IXP4XX_GPIO_HIGH) +- *IXP4XX_GPIO_GPOUTR |= (1 << line); +- else if (value == IXP4XX_GPIO_LOW) ++ if (value == IXP4XX_GPIO_LOW) + *IXP4XX_GPIO_GPOUTR &= ~(1 << line); ++ else ++ *IXP4XX_GPIO_GPOUTR |= (1 << line); + } + + /************************************************************************* +--- a/arch/arm/mach-ixp4xx/include/mach/platform.h ++++ b/arch/arm/mach-ixp4xx/include/mach/platform.h +@@ -131,5 +131,21 @@ struct pci_sys_data; + extern int ixp4xx_setup(int nr, struct pci_sys_data *sys); + extern struct pci_ops ixp4xx_ops; + ++/* GPIO pin types */ ++#define IXP4XX_GPIO_OUT 0x1 ++#define IXP4XX_GPIO_IN 0x2 ++ ++/* GPIO signal types */ ++#define IXP4XX_GPIO_LOW 0 ++#define IXP4XX_GPIO_HIGH 1 ++ ++/* GPIO Clocks */ ++#define IXP4XX_GPIO_CLK_0 14 ++#define IXP4XX_GPIO_CLK_1 15 ++ ++void gpio_line_config(u8 line, u32 direction); ++void gpio_line_get(u8 line, int *value); ++void gpio_line_set(u8 line, int value); ++ + #endif // __ASSEMBLY__ + diff --git a/target/linux/ixp4xx/patches-4.9/040-arm_mach_types.patch b/target/linux/ixp4xx/patches-4.9/040-arm_mach_types.patch new file mode 100644 index 0000000000..c6392ef2f8 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/040-arm_mach_types.patch @@ -0,0 +1,18 @@ +--- a/arch/arm/tools/mach-types ++++ b/arch/arm/tools/mach-types +@@ -1006,3 +1006,15 @@ eco5_bx2 MACH_ECO5_BX2 ECO5_BX2 4572 + eukrea_cpuimx28sd MACH_EUKREA_CPUIMX28SD EUKREA_CPUIMX28SD 4573 + domotab MACH_DOMOTAB DOMOTAB 4574 + pfla03 MACH_PFLA03 PFLA03 4575 ++wg302v1 MACH_WG302V1 WG302V1 889 ++pronghorn MACH_PRONGHORN PRONGHORN 928 ++pronghorn_metro MACH_PRONGHORNMETRO PRONGHORNMETRO 1040 ++sidewinder MACH_SIDEWINDER SIDEWINDER 1041 ++wrt300nv2 MACH_WRT300NV2 WRT300NV2 1077 ++compex42x MACH_COMPEXWP18 COMPEXWP18 1273 ++cambria MACH_CAMBRIA CAMBRIA 1468 ++ap1000 MACH_AP1000 AP1000 1543 ++tw2662 MACH_TW2662 TW2662 1658 ++tw5334 MACH_TW5334 TW5334 1664 ++usr8200 MACH_USR8200 USR8200 1762 ++mi424wr MACH_MI424WR MI424WR 1778 diff --git a/target/linux/ixp4xx/patches-4.9/090-increase_entropy_pools.patch b/target/linux/ixp4xx/patches-4.9/090-increase_entropy_pools.patch new file mode 100644 index 0000000000..2b4db053c2 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/090-increase_entropy_pools.patch @@ -0,0 +1,17 @@ +--- a/drivers/char/random.c ++++ b/drivers/char/random.c +@@ -278,11 +278,11 @@ + /* + * Configuration information + */ +-#define INPUT_POOL_SHIFT 12 ++#define INPUT_POOL_SHIFT 13 + #define INPUT_POOL_WORDS (1 << (INPUT_POOL_SHIFT-5)) +-#define OUTPUT_POOL_SHIFT 10 ++#define OUTPUT_POOL_SHIFT 11 + #define OUTPUT_POOL_WORDS (1 << (OUTPUT_POOL_SHIFT-5)) +-#define SEC_XFER_SIZE 512 ++#define SEC_XFER_SIZE 1024 + #define EXTRACT_SIZE 10 + + #define DEBUG_RANDOM_BOOT 0 diff --git a/target/linux/ixp4xx/patches-4.9/100-wg302v2_gateway7001_mac_plat_info.patch b/target/linux/ixp4xx/patches-4.9/100-wg302v2_gateway7001_mac_plat_info.patch new file mode 100644 index 0000000000..317103fdab --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/100-wg302v2_gateway7001_mac_plat_info.patch @@ -0,0 +1,78 @@ +--- a/arch/arm/mach-ixp4xx/gateway7001-setup.c ++++ b/arch/arm/mach-ixp4xx/gateway7001-setup.c +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -75,9 +76,37 @@ static struct platform_device gateway700 + .resource = &gateway7001_uart_resource, + }; + ++static struct eth_plat_info gateway7001_plat_eth[] = { ++ { ++ .phy = 1, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 2, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device gateway7001_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = gateway7001_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = gateway7001_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ + static struct platform_device *gateway7001_devices[] __initdata = { + &gateway7001_flash, +- &gateway7001_uart ++ &gateway7001_uart, ++ &gateway7001_eth[0], ++ &gateway7001_eth[1], + }; + + static void __init gateway7001_init(void) +--- a/arch/arm/mach-ixp4xx/wg302v2-setup.c ++++ b/arch/arm/mach-ixp4xx/wg302v2-setup.c +@@ -76,9 +76,26 @@ static struct platform_device wg302v2_ua + .resource = &wg302v2_uart_resource, + }; + ++static struct eth_plat_info wg302v2_plat_eth[] = { ++ { ++ .phy = 8, ++ .rxq = 3, ++ .txreadyq = 20, ++ } ++}; ++ ++static struct platform_device wg302v2_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = wg302v2_plat_eth, ++ } ++}; ++ + static struct platform_device *wg302v2_devices[] __initdata = { + &wg302v2_flash, + &wg302v2_uart, ++ &wg302v2_eth[0], + }; + + static void __init wg302v2_init(void) diff --git a/target/linux/ixp4xx/patches-4.9/105-wg302v1_support.patch b/target/linux/ixp4xx/patches-4.9/105-wg302v1_support.patch new file mode 100644 index 0000000000..8793549c64 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/105-wg302v1_support.patch @@ -0,0 +1,261 @@ +--- a/arch/arm/configs/ixp4xx_defconfig ++++ b/arch/arm/configs/ixp4xx_defconfig +@@ -13,6 +13,7 @@ CONFIG_MACH_AVILA=y + CONFIG_MACH_LOFT=y + CONFIG_ARCH_ADI_COYOTE=y + CONFIG_MACH_GATEWAY7001=y ++CONFIG_MACH_WG302V1=y + CONFIG_MACH_WG302V2=y + CONFIG_ARCH_IXDP425=y + CONFIG_MACH_IXDPG425=y +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -45,6 +45,14 @@ config MACH_GATEWAY7001 + 7001 Access Point. For more information on this platform, + see http://openwrt.org + ++config MACH_WG302V1 ++ bool "Netgear WG302 v1 / WAG302 v1" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support Netgear's ++ WG302 v1 or WAG302 v1 Access Points. For more information ++ on this platform, see http://openwrt.org ++ + config MACH_WG302V2 + bool "Netgear WG302 v2 / WAG302 v2" + select PCI +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -15,6 +15,7 @@ obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-p + obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o + obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o + obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o ++obj-pci-$(CONFIG_MACH_WG302V1) += wg302v1-pci.o + obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o + obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o + obj-pci-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-pci.o +@@ -33,6 +34,7 @@ obj-$(CONFIG_MACH_NSLU2) += nslu2-setup. + obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o + obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o + obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o ++obj-$(CONFIG_MACH_WG302V1) += wg302v1-setup.o + obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o + obj-$(CONFIG_MACH_FSG) += fsg-setup.o + obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_mlr.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/wg302v1-pci.c +@@ -0,0 +1,63 @@ ++/* ++ * arch/arch/mach-ixp4xx/wg302v1-pci.c ++ * ++ * PCI setup routines for the Netgear WG302 v1 and WAG302 v1 ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Software, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++ ++void __init wg302v1_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init wg302v1_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 1) ++ return IRQ_IXP4XX_GPIO8; ++ else if (slot == 2) ++ return IRQ_IXP4XX_GPIO10; ++ else ++ return -1; ++} ++ ++struct hw_pci wg302v1_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = wg302v1_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = wg302v1_map_irq, ++}; ++ ++int __init wg302v1_pci_init(void) ++{ ++ if (machine_is_wg302v1()) ++ pci_common_init(&wg302v1_pci); ++ return 0; ++} ++ ++subsys_initcall(wg302v1_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/wg302v1-setup.c +@@ -0,0 +1,147 @@ ++/* ++ * arch/arm/mach-ixp4xx/wg302v1-setup.c ++ * ++ * Board setup for the Netgear WG302 v1 and WAG302 v1 ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct flash_platform_data wg302v1_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource wg302v1_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device wg302v1_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &wg302v1_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &wg302v1_flash_resource, ++}; ++ ++static struct resource wg302v1_uart_resources[] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ } ++}; ++ ++static struct plat_serial8250_port wg302v1_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device wg302v1_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = wg302v1_uart_data, ++ }, ++ .num_resources = 2, ++ .resource = wg302v1_uart_resources, ++}; ++ ++static struct eth_plat_info wg302v1_plat_eth[] = { ++ { ++ .phy = 30, ++ .rxq = 3, ++ .txreadyq = 20, ++ } ++}; ++ ++static struct platform_device wg302v1_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = wg302v1_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *wg302v1_devices[] __initdata = { ++ &wg302v1_flash, ++ &wg302v1_uart, ++ &wg302v1_eth[0], ++}; ++ ++static void __init wg302v1_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ wg302v1_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ wg302v1_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(wg302v1_devices, ARRAY_SIZE(wg302v1_devices)); ++} ++ ++#ifdef CONFIG_MACH_WG302V1 ++MACHINE_START(WG302V1, "Netgear WG302 v1 / WAG302 v1") ++ /* Maintainer: Imre Kaloz */ ++ .fixup = wg302v1_fixup, ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = wg302v1_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++#endif diff --git a/target/linux/ixp4xx/patches-4.9/110-pronghorn_series_support.patch b/target/linux/ixp4xx/patches-4.9/110-pronghorn_series_support.patch new file mode 100644 index 0000000000..d1fdfcba49 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/110-pronghorn_series_support.patch @@ -0,0 +1,393 @@ +--- a/arch/arm/configs/ixp4xx_defconfig ++++ b/arch/arm/configs/ixp4xx_defconfig +@@ -15,6 +15,8 @@ CONFIG_ARCH_ADI_COYOTE=y + CONFIG_MACH_GATEWAY7001=y + CONFIG_MACH_WG302V1=y + CONFIG_MACH_WG302V2=y ++CONFIG_MACH_PRONGHORN=y ++CONFIG_MACH_PRONGHORNMETRO=y + CONFIG_ARCH_IXDP425=y + CONFIG_MACH_IXDPG425=y + CONFIG_MACH_IXDP465=y +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -61,6 +61,22 @@ config MACH_WG302V2 + WG302 v2 or WAG302 v2 Access Points. For more information + on this platform, see http://openwrt.org + ++config MACH_PRONGHORN ++ bool "ADI Pronghorn series" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support the ADI ++ Engineering Pronghorn series. For more ++ information on this platform, see http://www.adiengineering.com ++ ++# ++# There're only minimal differences kernel-wise between the Pronghorn and ++# Pronghorn Metro boards - they use different chip selects to drive the ++# CF slot connected to the expansion bus, so we just enable them together. ++# ++config MACH_PRONGHORNMETRO ++ def_bool MACH_PRONGHORN ++ + config ARCH_IXDP425 + bool "IXDP425" + help +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -19,6 +19,7 @@ obj-pci-$(CONFIG_MACH_WG302V1) += wg302 + obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o + obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o + obj-pci-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-pci.o ++obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o + + obj-y += common.o + +@@ -39,6 +40,7 @@ obj-$(CONFIG_MACH_WG302V2) += wg302v2-se + obj-$(CONFIG_MACH_FSG) += fsg-setup.o + obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_mlr.o + obj-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-setup.o ++obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h ++++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h +@@ -42,7 +42,8 @@ static __inline__ void __arch_decomp_set + */ + if (machine_is_adi_coyote() || machine_is_gtwx5715() || + machine_is_gateway7001() || machine_is_wg302v2() || +- machine_is_devixp() || machine_is_miccpt() || machine_is_mic256()) ++ machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() || ++ machine_is_pronghorn() || machine_is_pronghorn_metro()) + uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; + else + uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/pronghorn-pci.c +@@ -0,0 +1,69 @@ ++/* ++ * arch/arch/mach-ixp4xx/pronghorn-pci.c ++ * ++ * PCI setup routines for ADI Engineering Pronghorn series ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++ ++void __init pronghorn_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO1, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init pronghorn_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 13) ++ return IRQ_IXP4XX_GPIO4; ++ else if (slot == 14) ++ return IRQ_IXP4XX_GPIO6; ++ else if (slot == 15) ++ return IRQ_IXP4XX_GPIO11; ++ else if (slot == 16) ++ return IRQ_IXP4XX_GPIO1; ++ else ++ return -1; ++} ++ ++struct hw_pci pronghorn_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = pronghorn_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = pronghorn_map_irq, ++}; ++ ++int __init pronghorn_pci_init(void) ++{ ++ if (machine_is_pronghorn() || machine_is_pronghorn_metro()) ++ pci_common_init(&pronghorn_pci); ++ return 0; ++} ++ ++subsys_initcall(pronghorn_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/pronghorn-setup.c +@@ -0,0 +1,252 @@ ++/* ++ * arch/arm/mach-ixp4xx/pronghorn-setup.c ++ * ++ * Board setup for the ADI Engineering Pronghorn series ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct flash_platform_data pronghorn_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource pronghorn_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device pronghorn_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &pronghorn_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &pronghorn_flash_resource, ++}; ++ ++static struct resource pronghorn_uart_resources [] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port pronghorn_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device pronghorn_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = pronghorn_uart_data, ++ }, ++ .num_resources = 2, ++ .resource = pronghorn_uart_resources, ++}; ++ ++static struct i2c_gpio_platform_data pronghorn_i2c_gpio_data = { ++ .sda_pin = 9, ++ .scl_pin = 10, ++}; ++ ++static struct platform_device pronghorn_i2c_gpio = { ++ .name = "i2c-gpio", ++ .id = 0, ++ .dev = { ++ .platform_data = &pronghorn_i2c_gpio_data, ++ }, ++}; ++ ++static struct gpio_led pronghorn_led_pin[] = { ++ { ++ .name = "pronghorn:green:status", ++ .gpio = 7, ++ } ++}; ++ ++static struct gpio_led_platform_data pronghorn_led_data = { ++ .num_leds = 1, ++ .leds = pronghorn_led_pin, ++}; ++ ++static struct platform_device pronghorn_led = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev.platform_data = &pronghorn_led_data, ++}; ++ ++static struct resource pronghorn_pata_resources[] = { ++ { ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .name = "intrq", ++ .start = IRQ_IXP4XX_GPIO0, ++ .end = IRQ_IXP4XX_GPIO0, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static struct ixp4xx_pata_data pronghorn_pata_data = { ++ .cs0_bits = 0xbfff0043, ++ .cs1_bits = 0xbfff0043, ++}; ++ ++static struct platform_device pronghorn_pata = { ++ .name = "pata_ixp4xx_cf", ++ .id = 0, ++ .dev.platform_data = &pronghorn_pata_data, ++ .num_resources = ARRAY_SIZE(pronghorn_pata_resources), ++ .resource = pronghorn_pata_resources, ++}; ++ ++static struct eth_plat_info pronghorn_plat_eth[] = { ++ { ++ .phy = 0, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device pronghorn_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = pronghorn_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = pronghorn_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *pronghorn_devices[] __initdata = { ++ &pronghorn_flash, ++ &pronghorn_uart, ++ &pronghorn_led, ++ &pronghorn_eth[0], ++ &pronghorn_eth[1], ++}; ++ ++static void __init pronghorn_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ pronghorn_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ pronghorn_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(pronghorn_devices, ARRAY_SIZE(pronghorn_devices)); ++ ++ if (machine_is_pronghorn()) { ++ pronghorn_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(2); ++ pronghorn_pata_resources[0].end = IXP4XX_EXP_BUS_END(2); ++ ++ pronghorn_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(3); ++ pronghorn_pata_resources[1].end = IXP4XX_EXP_BUS_END(3); ++ ++ pronghorn_pata_data.cs0_cfg = IXP4XX_EXP_CS2; ++ pronghorn_pata_data.cs1_cfg = IXP4XX_EXP_CS3; ++ } else { ++ pronghorn_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(3); ++ pronghorn_pata_resources[0].end = IXP4XX_EXP_BUS_END(3); ++ ++ pronghorn_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(4); ++ pronghorn_pata_resources[1].end = IXP4XX_EXP_BUS_END(4); ++ ++ pronghorn_pata_data.cs0_cfg = IXP4XX_EXP_CS3; ++ pronghorn_pata_data.cs1_cfg = IXP4XX_EXP_CS4; ++ ++ platform_device_register(&pronghorn_i2c_gpio); ++ } ++ ++ platform_device_register(&pronghorn_pata); ++} ++ ++MACHINE_START(PRONGHORN, "ADI Engineering Pronghorn") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = pronghorn_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++ ++MACHINE_START(PRONGHORNMETRO, "ADI Engineering Pronghorn Metro") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = pronghorn_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END diff --git a/target/linux/ixp4xx/patches-4.9/111-pronghorn_swap_uarts.patch b/target/linux/ixp4xx/patches-4.9/111-pronghorn_swap_uarts.patch new file mode 100644 index 0000000000..ed9f7a785d --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/111-pronghorn_swap_uarts.patch @@ -0,0 +1,44 @@ +--- a/arch/arm/mach-ixp4xx/pronghorn-setup.c ++++ b/arch/arm/mach-ixp4xx/pronghorn-setup.c +@@ -52,31 +52,31 @@ static struct platform_device pronghorn_ + + static struct resource pronghorn_uart_resources [] = { + { +- .start = IXP4XX_UART1_BASE_PHYS, +- .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, + .flags = IORESOURCE_MEM + }, + { +- .start = IXP4XX_UART2_BASE_PHYS, +- .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, + .flags = IORESOURCE_MEM + } + }; + + static struct plat_serial8250_port pronghorn_uart_data[] = { + { +- .mapbase = IXP4XX_UART1_BASE_PHYS, +- .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, +- .irq = IRQ_IXP4XX_UART1, ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + .iotype = UPIO_MEM, + .regshift = 2, + .uartclk = IXP4XX_UART_XTAL, + }, + { +- .mapbase = IXP4XX_UART2_BASE_PHYS, +- .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, +- .irq = IRQ_IXP4XX_UART2, ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + .iotype = UPIO_MEM, + .regshift = 2, diff --git a/target/linux/ixp4xx/patches-4.9/115-sidewinder_support.patch b/target/linux/ixp4xx/patches-4.9/115-sidewinder_support.patch new file mode 100644 index 0000000000..20adbb5c04 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/115-sidewinder_support.patch @@ -0,0 +1,286 @@ +From 95dac4a842a3c66f69f949b48f9075e16275f77b Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 30 Jun 2013 15:48:47 +0200 +Subject: [PATCH 07/36] 115-sidewinder_support.patch + +--- + arch/arm/mach-ixp4xx/Kconfig | 10 +- + arch/arm/mach-ixp4xx/Makefile | 2 + + arch/arm/mach-ixp4xx/sidewinder-pci.c | 68 ++++++++++++++ + arch/arm/mach-ixp4xx/sidewinder-setup.c | 151 +++++++++++++++++++++++++++++++ + 4 files changed, 230 insertions(+), 1 deletion(-) + create mode 100644 arch/arm/mach-ixp4xx/sidewinder-pci.c + create mode 100644 arch/arm/mach-ixp4xx/sidewinder-setup.c + +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -77,6 +77,14 @@ config MACH_PRONGHORN + config MACH_PRONGHORNMETRO + def_bool MACH_PRONGHORN + ++config MACH_SIDEWINDER ++ bool "ADI Sidewinder" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support the ADI ++ Engineering Sidewinder board. For more information on this ++ platform, see http://www.adiengineering.com ++ + config ARCH_IXDP425 + bool "IXDP425" + help +@@ -173,7 +181,7 @@ config MACH_ARCOM_VULCAN + # + config CPU_IXP46X + bool +- depends on MACH_IXDP465 ++ depends on MACH_IXDP465 || MACH_SIDEWINDER + default y + + config CPU_IXP43X +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -20,6 +20,7 @@ obj-pci-$(CONFIG_MACH_WG302V2) += wg302 + obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o + obj-pci-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-pci.o + obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o ++obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o + + obj-y += common.o + +@@ -41,6 +42,7 @@ obj-$(CONFIG_MACH_FSG) += fsg-setup.o + obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_mlr.o + obj-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-setup.o + obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o ++obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/sidewinder-pci.c +@@ -0,0 +1,67 @@ ++/* ++ * arch/arch/mach-ixp4xx/pronghornmetro-pci.c ++ * ++ * PCI setup routines for ADI Engineering Sidewinder ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include ++ ++void __init sidewinder_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init sidewinder_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 1) ++ return IRQ_IXP4XX_GPIO11; ++ else if (slot == 2) ++ return IRQ_IXP4XX_GPIO10; ++ else if (slot == 3) ++ return IRQ_IXP4XX_GPIO9; ++ else ++ return -1; ++} ++ ++struct hw_pci sidewinder_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = sidewinder_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = sidewinder_map_irq, ++}; ++ ++int __init sidewinder_pci_init(void) ++{ ++ if (machine_is_sidewinder()) ++ pci_common_init(&sidewinder_pci); ++ return 0; ++} ++ ++subsys_initcall(sidewinder_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/sidewinder-setup.c +@@ -0,0 +1,155 @@ ++/* ++ * arch/arm/mach-ixp4xx/sidewinder-setup.c ++ * ++ * Board setup for the ADI Engineering Sidewinder ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++static struct flash_platform_data sidewinder_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource sidewinder_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device sidewinder_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &sidewinder_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &sidewinder_flash_resource, ++}; ++ ++static struct resource sidewinder_uart_resources[] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ } ++}; ++ ++static struct plat_serial8250_port sidewinder_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device sidewinder_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = sidewinder_uart_data, ++ }, ++ .num_resources = ARRAY_SIZE(sidewinder_uart_resources), ++ .resource = sidewinder_uart_resources, ++}; ++ ++static struct eth_plat_info sidewinder_plat_eth[] = { ++ { ++ .phy = 5, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x1e, ++ .rxq = 4, ++ .txreadyq = 21, ++ }, { ++ .phy = 31, ++ .rxq = 2, ++ .txreadyq = 19, ++ } ++}; ++ ++static struct platform_device sidewinder_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = sidewinder_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = sidewinder_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEA, ++ .dev.platform_data = sidewinder_plat_eth + 2, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *sidewinder_devices[] __initdata = { ++ &sidewinder_flash, ++ &sidewinder_uart, ++ &sidewinder_eth[0], ++ &sidewinder_eth[1], ++ &sidewinder_eth[2], ++}; ++ ++static void __init sidewinder_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ sidewinder_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ sidewinder_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_64M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(sidewinder_devices, ARRAY_SIZE(sidewinder_devices)); ++} ++ ++MACHINE_START(SIDEWINDER, "ADI Engineering Sidewinder") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = sidewinder_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END diff --git a/target/linux/ixp4xx/patches-4.9/116-sidewinder_fis_location.patch b/target/linux/ixp4xx/patches-4.9/116-sidewinder_fis_location.patch new file mode 100644 index 0000000000..7d633f7135 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/116-sidewinder_fis_location.patch @@ -0,0 +1,30 @@ +--- a/drivers/mtd/redboot.c ++++ b/drivers/mtd/redboot.c +@@ -30,6 +30,8 @@ + #include + #include + ++#include ++ + struct fis_image_desc { + unsigned char name[16]; // Null terminated name + uint32_t flash_base; // Address within FLASH of image +@@ -47,7 +49,8 @@ struct fis_list { + struct fis_list *next; + }; + +-static int directory = CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK; ++int directory = CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK; ++ + module_param(directory, int, 0); + + static inline int redboot_checksum(struct fis_image_desc *img) +@@ -75,6 +78,8 @@ static int parse_redboot_partitions(stru + #ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED + static char nullstring[] = "unallocated"; + #endif ++ if (machine_is_sidewinder()) ++ directory = -5; + + if ( directory < 0 ) { + offset = master->size + directory * master->erasesize; diff --git a/target/linux/ixp4xx/patches-4.9/120-compex_support.patch b/target/linux/ixp4xx/patches-4.9/120-compex_support.patch new file mode 100644 index 0000000000..2abc159f04 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/120-compex_support.patch @@ -0,0 +1,199 @@ +From 24025a2dcf1248079dd3019fac6ed955252d277f Mon Sep 17 00:00:00 2001 +From: Imre Kaloz +Date: Mon, 14 Jul 2008 21:56:34 +0200 +Subject: [PATCH] Add support for the Compex WP18 / NP18A boards + +Signed-off-by: Imre Kaloz +--- + +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -85,6 +85,14 @@ config MACH_SIDEWINDER + Engineering Sidewinder board. For more information on this + platform, see http://www.adiengineering.com + ++config MACH_COMPEXWP18 ++ bool "Compex WP18 / NP18A" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support Compex' ++ WP18 or NP18A boards. For more information on this ++ platform, see http://www.compex.com.sg/home/OEM/product_ap.htm ++ + config ARCH_IXDP425 + bool "IXDP425" + help +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -21,6 +21,7 @@ obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o + obj-pci-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-pci.o + obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o + obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o ++obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixdp425-pci.o + + obj-y += common.o + +@@ -43,6 +44,7 @@ obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_ + obj-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-setup.o + obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o + obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o ++obj-$(CONFIG_MACH_COMPEXWP18) += compex42x-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/compex42x-setup.c +@@ -0,0 +1,141 @@ ++/* ++ * arch/arm/mach-ixp4xx/compex-setup.c ++ * ++ * Compex WP18 / NP18A board-setup ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++static struct flash_platform_data compex42x_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource compex42x_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device compex42x_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &compex42x_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &compex42x_flash_resource, ++}; ++ ++static struct resource compex42x_uart_resources[] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port compex42x_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device compex42x_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev.platform_data = compex42x_uart_data, ++ .num_resources = 2, ++ .resource = compex42x_uart_resources, ++}; ++ ++static struct eth_plat_info compex42x_plat_eth[] = { ++ { ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0xf0000, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 3, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device compex42x_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = compex42x_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = compex42x_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *compex42x_devices[] __initdata = { ++ &compex42x_flash, ++ &compex42x_uart, ++ &compex42x_eth[0], ++ &compex42x_eth[1], ++}; ++ ++static void __init compex42x_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ compex42x_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ compex42x_flash_resource.end = ++ IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ platform_add_devices(compex42x_devices, ARRAY_SIZE(compex42x_devices)); ++} ++ ++MACHINE_START(COMPEXWP18, "Compex WP18 / NP18A") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = compex42x_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END +--- a/arch/arm/mach-ixp4xx/ixdp425-pci.c ++++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c +@@ -69,7 +69,8 @@ struct hw_pci ixdp425_pci __initdata = { + int __init ixdp425_pci_init(void) + { + if (machine_is_ixdp425() || machine_is_ixcdp1100() || +- machine_is_ixdp465() || machine_is_kixrp435()) ++ machine_is_ixdp465() || machine_is_kixrp435() || ++ machine_is_compex42x()) + pci_common_init(&ixdp425_pci); + return 0; + } diff --git a/target/linux/ixp4xx/patches-4.9/130-wrt300nv2_support.patch b/target/linux/ixp4xx/patches-4.9/130-wrt300nv2_support.patch new file mode 100644 index 0000000000..49359be447 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/130-wrt300nv2_support.patch @@ -0,0 +1,227 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -93,6 +93,14 @@ config MACH_COMPEXWP18 + WP18 or NP18A boards. For more information on this + platform, see http://www.compex.com.sg/home/OEM/product_ap.htm + ++config MACH_WRT300NV2 ++ bool "Linksys WRT300N v2" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support Linksys' ++ WRT300N v2 router. For more information on this ++ platform, see http://openwrt.org ++ + config ARCH_IXDP425 + bool "IXDP425" + help +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -22,6 +22,7 @@ obj-pci-$(CONFIG_MACH_ARCOM_VULCAN) += v + obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o + obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o + obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixdp425-pci.o ++obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o + + obj-y += common.o + +@@ -45,6 +46,7 @@ obj-$(CONFIG_MACH_ARCOM_VULCAN) += vulca + obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o + obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o + obj-$(CONFIG_MACH_COMPEXWP18) += compex42x-setup.o ++obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h ++++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h +@@ -43,7 +43,8 @@ static __inline__ void __arch_decomp_set + if (machine_is_adi_coyote() || machine_is_gtwx5715() || + machine_is_gateway7001() || machine_is_wg302v2() || + machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() || +- machine_is_pronghorn() || machine_is_pronghorn_metro()) ++ machine_is_pronghorn() || machine_is_pronghorn_metro() || ++ machine_is_wrt300nv2()) + uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; + else + uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/wrt300nv2-pci.c +@@ -0,0 +1,64 @@ ++/* ++ * arch/arch/mach-ixp4xx/wrt300nv2-pci.c ++ * ++ * PCI setup routines for Linksys WRT300N v2 ++ * ++ * Copyright (C) 2007 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include ++ ++extern void ixp4xx_pci_preinit(void); ++extern int ixp4xx_setup(int nr, struct pci_sys_data *sys); ++extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys); ++ ++void __init wrt300nv2_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init wrt300nv2_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 1) ++ return IRQ_IXP4XX_GPIO8; ++ else return -1; ++} ++ ++struct hw_pci wrt300nv2_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = wrt300nv2_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = wrt300nv2_map_irq, ++}; ++ ++int __init wrt300nv2_pci_init(void) ++{ ++ if (machine_is_wrt300nv2()) ++ pci_common_init(&wrt300nv2_pci); ++ return 0; ++} ++ ++subsys_initcall(wrt300nv2_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/wrt300nv2-setup.c +@@ -0,0 +1,110 @@ ++/* ++ * arch/arm/mach-ixp4xx/wrt300nv2-setup.c ++ * ++ * Board setup for the Linksys WRT300N v2 ++ * ++ * Copyright (C) 2007 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct flash_platform_data wrt300nv2_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource wrt300nv2_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device wrt300nv2_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &wrt300nv2_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &wrt300nv2_flash_resource, ++}; ++ ++static struct resource wrt300nv2_uart_resource = { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct plat_serial8250_port wrt300nv2_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device wrt300nv2_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = wrt300nv2_uart_data, ++ }, ++ .num_resources = 1, ++ .resource = &wrt300nv2_uart_resource, ++}; ++ ++static struct platform_device *wrt300nv2_devices[] __initdata = { ++ &wrt300nv2_flash, ++ &wrt300nv2_uart ++}; ++ ++static void __init wrt300nv2_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ wrt300nv2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ wrt300nv2_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(wrt300nv2_devices, ARRAY_SIZE(wrt300nv2_devices)); ++} ++ ++#ifdef CONFIG_MACH_WRT300NV2 ++MACHINE_START(WRT300NV2, "Linksys WRT300N v2") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = wrt300nv2_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++#endif diff --git a/target/linux/ixp4xx/patches-4.9/131-wrt300nv2_mac_plat_info.patch b/target/linux/ixp4xx/patches-4.9/131-wrt300nv2_mac_plat_info.patch new file mode 100644 index 0000000000..5debbf1072 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/131-wrt300nv2_mac_plat_info.patch @@ -0,0 +1,42 @@ +--- a/arch/arm/mach-ixp4xx/wrt300nv2-setup.c ++++ b/arch/arm/mach-ixp4xx/wrt300nv2-setup.c +@@ -76,9 +76,38 @@ static struct platform_device wrt300nv2_ + .resource = &wrt300nv2_uart_resource, + }; + ++/* Built-in 10/100 Ethernet MAC interfaces */ ++static struct eth_plat_info wrt300nv2_plat_eth[] = { ++ { ++ .phy = -1, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device wrt300nv2_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = wrt300nv2_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = wrt300nv2_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ + static struct platform_device *wrt300nv2_devices[] __initdata = { + &wrt300nv2_flash, +- &wrt300nv2_uart ++ &wrt300nv2_uart, ++ &wrt300nv2_eth[0], ++ &wrt300nv2_eth[1], + }; + + static void __init wrt300nv2_init(void) diff --git a/target/linux/ixp4xx/patches-4.9/132-wrt300nv2_mac_fix.patch b/target/linux/ixp4xx/patches-4.9/132-wrt300nv2_mac_fix.patch new file mode 100644 index 0000000000..99db2673d0 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/132-wrt300nv2_mac_fix.patch @@ -0,0 +1,72 @@ +--- a/arch/arm/mach-ixp4xx/wrt300nv2-setup.c ++++ b/arch/arm/mach-ixp4xx/wrt300nv2-setup.c +@@ -3,6 +3,7 @@ + * + * Board setup for the Linksys WRT300N v2 + * ++ * Copyright (C) 2010 Alexandros C. Couloumbis + * Copyright (C) 2007 Imre Kaloz + * + * based on coyote-setup.c: +@@ -18,6 +19,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -79,7 +81,8 @@ static struct platform_device wrt300nv2_ + /* Built-in 10/100 Ethernet MAC interfaces */ + static struct eth_plat_info wrt300nv2_plat_eth[] = { + { +- .phy = -1, ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x0F0000, + .rxq = 3, + .txreadyq = 20, + }, { +@@ -112,6 +115,10 @@ static struct platform_device *wrt300nv2 + + static void __init wrt300nv2_init(void) + { ++ uint8_t __iomem *f; ++ int offset = 0; ++ int i; ++ + ixp4xx_sys_init(); + + wrt300nv2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); +@@ -121,6 +128,32 @@ static void __init wrt300nv2_init(void) + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; + + platform_add_devices(wrt300nv2_devices, ARRAY_SIZE(wrt300nv2_devices)); ++ ++ f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x60000); ++ ++ if (f) { ++ for (i = 0; i < 6; i++) { ++#ifdef __ARMEB__ ++ wrt300nv2_plat_eth[0].hwaddr[i] = readb(f + 0x5FFA0 + i); ++ if (i == 5) ++ offset = 1; ++ wrt300nv2_plat_eth[1].hwaddr[i] = (wrt300nv2_plat_eth[0].hwaddr[i] + offset); ++#else ++ wrt300nv2_plat_eth[0].hwaddr[i] = readb(f + 0x5FFA0 + (i^3)); ++ if (i == 5) ++ offset = 1; ++ wrt300nv2_plat_eth[1].hwaddr[i] = (wrt300nv2_plat_eth[0].hwaddr[i] + offset); ++#endif ++ } ++ iounmap(f); ++ } ++ ++ if (!(is_valid_ether_addr(wrt300nv2_plat_eth[0].hwaddr))) ++ random_ether_addr(wrt300nv2_plat_eth[0].hwaddr); ++ if (!(is_valid_ether_addr(wrt300nv2_plat_eth[1].hwaddr))) { ++ memcpy(wrt300nv2_plat_eth[1].hwaddr, wrt300nv2_plat_eth[0].hwaddr, ETH_ALEN); ++ wrt300nv2_plat_eth[1].hwaddr[5] = (wrt300nv2_plat_eth[0].hwaddr[5] + 1); ++ } + } + + #ifdef CONFIG_MACH_WRT300NV2 diff --git a/target/linux/ixp4xx/patches-4.9/150-lanready_ap1000_support.patch b/target/linux/ixp4xx/patches-4.9/150-lanready_ap1000_support.patch new file mode 100644 index 0000000000..fb5c3adb76 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/150-lanready_ap1000_support.patch @@ -0,0 +1,201 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -101,6 +101,14 @@ config MACH_WRT300NV2 + WRT300N v2 router. For more information on this + platform, see http://openwrt.org + ++config MACH_AP1000 ++ bool "Lanready AP-1000" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support Lanready's ++ AP1000 board. For more information on this ++ platform, see http://openwrt.org ++ + config ARCH_IXDP425 + bool "IXDP425" + help +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -23,6 +23,7 @@ obj-pci-$(CONFIG_MACH_PRONGHORN) += pron + obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o + obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o ++obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o + + obj-y += common.o + +@@ -47,6 +48,7 @@ obj-$(CONFIG_MACH_PRONGHORN) += pronghor + obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o + obj-$(CONFIG_MACH_COMPEXWP18) += compex42x-setup.o + obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o ++obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/ap1000-setup.c +@@ -0,0 +1,152 @@ ++/* ++ * arch/arm/mach-ixp4xx/ap1000-setup.c ++ * ++ * Lanready AP-1000 ++ * ++ * Copyright (C) 2007 Imre Kaloz ++ * ++ * based on ixdp425-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct flash_platform_data ap1000_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource ap1000_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device ap1000_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &ap1000_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &ap1000_flash_resource, ++}; ++ ++static struct resource ap1000_uart_resources[] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port ap1000_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device ap1000_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev.platform_data = ap1000_uart_data, ++ .num_resources = 2, ++ .resource = ap1000_uart_resources ++}; ++ ++static struct platform_device *ap1000_devices[] __initdata = { ++ &ap1000_flash, ++ &ap1000_uart ++}; ++ ++static char ap1000_mem_fixup[] __initdata = "mem=64M "; ++ ++static void __init ap1000_fixup(struct tag *tags, char **cmdline) ++{ ++ struct tag *t = tags; ++ char *p = *cmdline; ++ ++ /* Find the end of the tags table, taking note of any cmdline tag. */ ++ for (; t->hdr.size; t = tag_next(t)) { ++ if (t->hdr.tag == ATAG_CMDLINE) { ++ p = t->u.cmdline.cmdline; ++ } ++ } ++ ++ /* Overwrite the end of the table with a new cmdline tag. */ ++ t->hdr.tag = ATAG_CMDLINE; ++ t->hdr.size = (sizeof (struct tag_header) + ++ strlen(ap1000_mem_fixup) + strlen(p) + 1 + 4) >> 2; ++ strlcpy(t->u.cmdline.cmdline, ap1000_mem_fixup, COMMAND_LINE_SIZE); ++ strlcpy(t->u.cmdline.cmdline + strlen(ap1000_mem_fixup), p, ++ COMMAND_LINE_SIZE - strlen(ap1000_mem_fixup)); ++ ++ /* Terminate the table. */ ++ t = tag_next(t); ++ t->hdr.tag = ATAG_NONE; ++ t->hdr.size = 0; ++} ++ ++static void __init ap1000_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ ap1000_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ ap1000_flash_resource.end = ++ IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; ++ ++ platform_add_devices(ap1000_devices, ARRAY_SIZE(ap1000_devices)); ++} ++ ++#ifdef CONFIG_MACH_AP1000 ++MACHINE_START(AP1000, "Lanready AP-1000") ++ /* Maintainer: Imre Kaloz */ ++ .fixup = ap1000_fixup, ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = ap1000_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++#endif +--- a/arch/arm/mach-ixp4xx/ixdp425-pci.c ++++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c +@@ -70,7 +70,7 @@ int __init ixdp425_pci_init(void) + { + if (machine_is_ixdp425() || machine_is_ixcdp1100() || + machine_is_ixdp465() || machine_is_kixrp435() || +- machine_is_compex42x()) ++ machine_is_compex42x() || machine_is_ap1000()) + pci_common_init(&ixdp425_pci); + return 0; + } diff --git a/target/linux/ixp4xx/patches-4.9/151-lanready_ap1000_mac_plat_info.patch b/target/linux/ixp4xx/patches-4.9/151-lanready_ap1000_mac_plat_info.patch new file mode 100644 index 0000000000..a3ed2d066e --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/151-lanready_ap1000_mac_plat_info.patch @@ -0,0 +1,44 @@ +--- a/arch/arm/mach-ixp4xx/ap1000-setup.c ++++ b/arch/arm/mach-ixp4xx/ap1000-setup.c +@@ -91,9 +91,39 @@ static struct platform_device ap1000_uar + .resource = ap1000_uart_resources + }; + ++/* Built-in 10/100 Ethernet MAC interfaces */ ++static struct eth_plat_info ap1000_plat_eth[] = { ++ { ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x1e, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 5, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device ap1000_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = ap1000_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = ap1000_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ + static struct platform_device *ap1000_devices[] __initdata = { +- &ap1000_flash, +- &ap1000_uart ++ &ap1000_flash, ++ &ap1000_uart, ++ &ap1000_eth[0], ++ &ap1000_eth[1], + }; + + static char ap1000_mem_fixup[] __initdata = "mem=64M "; diff --git a/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch b/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch new file mode 100644 index 0000000000..1ac9e5f9fb --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch @@ -0,0 +1,133 @@ +--- a/drivers/tty/serial/8250/8250_core.c ++++ b/drivers/tty/serial/8250/8250_core.c +@@ -833,6 +833,7 @@ static int serial8250_probe(struct platf + uart.port.get_mctrl = p->get_mctrl; + uart.port.pm = p->pm; + uart.port.dev = &dev->dev; ++ uart.port.rw_delay = p->rw_delay; + uart.port.irqflags |= irqflag; + ret = serial8250_register_8250_port(&uart); + if (ret < 0) { +@@ -989,6 +990,7 @@ int serial8250_register_8250_port(struct + uart->bugs = up->bugs; + uart->port.mapbase = up->port.mapbase; + uart->port.mapsize = up->port.mapsize; ++ uart->port.rw_delay = up->port.rw_delay; + uart->port.private_data = up->port.private_data; + uart->tx_loadsz = up->tx_loadsz; + uart->capabilities = up->capabilities; +--- a/drivers/tty/serial/serial_core.c ++++ b/drivers/tty/serial/serial_core.c +@@ -2229,6 +2229,7 @@ uart_report_port(struct uart_driver *drv + snprintf(address, sizeof(address), + "I/O 0x%lx offset 0x%x", port->iobase, port->hub6); + break; ++ case UPIO_MEM_DELAY: + case UPIO_MEM: + case UPIO_MEM16: + case UPIO_MEM32: +@@ -2893,6 +2894,7 @@ int uart_match_port(struct uart_port *po + case UPIO_HUB6: + return (port1->iobase == port2->iobase) && + (port1->hub6 == port2->hub6); ++ case UPIO_MEM_DELAY: + case UPIO_MEM: + case UPIO_MEM16: + case UPIO_MEM32: +--- a/include/linux/serial_8250.h ++++ b/include/linux/serial_8250.h +@@ -28,6 +28,7 @@ struct plat_serial8250_port { + void *private_data; + unsigned char regshift; /* register shift */ + unsigned char iotype; /* UPIO_* */ ++ unsigned int rw_delay; /* udelay for slower busses IXP4XX Expansion Bus */ + unsigned char hub6; + upf_t flags; /* UPF_* flags */ + unsigned int type; /* If UPF_FIXED_TYPE */ +--- a/include/linux/serial_core.h ++++ b/include/linux/serial_core.h +@@ -152,6 +152,7 @@ struct uart_port { + #define UPIO_TSI (SERIAL_IO_TSI) /* Tsi108/109 type IO */ + #define UPIO_MEM32BE (SERIAL_IO_MEM32BE) /* 32b big endian */ + #define UPIO_MEM16 (SERIAL_IO_MEM16) /* 16b little endian */ ++#define UPIO_MEM_DELAY (SERIAL_IO_MEM_DELAY) + + unsigned int read_status_mask; /* driver specific */ + unsigned int ignore_status_mask; /* driver specific */ +@@ -233,6 +234,7 @@ struct uart_port { + int hw_stopped; /* sw-assisted CTS flow state */ + unsigned int mctrl; /* current modem ctrl settings */ + unsigned int timeout; /* character-based timeout */ ++ unsigned int rw_delay; /* udelay for slow busses, IXP4XX Expansion Bus */ + unsigned int type; /* port type */ + const struct uart_ops *ops; + unsigned int custom_divisor; +--- a/drivers/tty/serial/8250/8250_port.c ++++ b/drivers/tty/serial/8250/8250_port.c +@@ -384,6 +384,20 @@ static unsigned int mem16_serial_in(stru + return readw(p->membase + offset); + } + ++static unsigned int memdelay_serial_in(struct uart_port *p, int offset) ++{ ++ struct uart_8250_port *up = (struct uart_8250_port *)p; ++ udelay(up->port.rw_delay); ++ return mem_serial_in(p, offset); ++} ++ ++static void memdelay_serial_out(struct uart_port *p, int offset, int value) ++{ ++ struct uart_8250_port *up = (struct uart_8250_port *)p; ++ udelay(up->port.rw_delay); ++ mem_serial_out(p, offset, value); ++} ++ + static void mem32_serial_out(struct uart_port *p, int offset, int value) + { + offset = offset << p->regshift; +@@ -456,6 +470,11 @@ static void set_io_from_upio(struct uart + p->serial_out = mem32be_serial_out; + break; + ++ case UPIO_MEM_DELAY: ++ p->serial_in = memdelay_serial_in; ++ p->serial_out = memdelay_serial_out; ++ break; ++ + #ifdef CONFIG_SERIAL_8250_RT288X + case UPIO_AU: + p->serial_in = au_serial_in; +@@ -483,6 +502,7 @@ serial_port_out_sync(struct uart_port *p + case UPIO_MEM16: + case UPIO_MEM32: + case UPIO_MEM32BE: ++ case UPIO_MEM_DELAY: + case UPIO_AU: + p->serial_out(p, offset, value); + p->serial_in(p, UART_LCR); /* safe, no side-effects */ +@@ -2759,6 +2779,7 @@ static int serial8250_request_std_resour + case UPIO_MEM32BE: + case UPIO_MEM16: + case UPIO_MEM: ++ case UPIO_MEM_DELAY: + if (!port->mapbase) + break; + +@@ -2797,6 +2818,7 @@ static void serial8250_release_std_resou + case UPIO_MEM32BE: + case UPIO_MEM16: + case UPIO_MEM: ++ case UPIO_MEM_DELAY: + if (!port->mapbase) + break; + +--- a/include/uapi/linux/serial.h ++++ b/include/uapi/linux/serial.h +@@ -70,6 +70,7 @@ struct serial_struct { + #define SERIAL_IO_TSI 5 + #define SERIAL_IO_MEM32BE 6 + #define SERIAL_IO_MEM16 7 ++#define SERIAL_IO_MEM_DELAY 10 + + #define UART_CLEAR_FIFO 0x01 + #define UART_USE_FIFO 0x02 diff --git a/target/linux/ixp4xx/patches-4.9/162-wg302v1_mem_fixup.patch b/target/linux/ixp4xx/patches-4.9/162-wg302v1_mem_fixup.patch new file mode 100644 index 0000000000..efa389d786 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/162-wg302v1_mem_fixup.patch @@ -0,0 +1,37 @@ +--- a/arch/arm/mach-ixp4xx/wg302v1-setup.c ++++ b/arch/arm/mach-ixp4xx/wg302v1-setup.c +@@ -117,6 +117,34 @@ static struct platform_device *wg302v1_d + &wg302v1_eth[0], + }; + ++static char wg302v1_mem_fixup[] __initdata = " mem=32M"; ++ ++static void __init wg302v1_fixup(struct tag *tags, char **cmdline) ++{ ++ struct tag *t = tags; ++ char *p = *cmdline; ++ size_t fixlen, cmdlen; ++ ++ /* Find the end of the tags table, taking note of any cmdline tag. */ ++ for (; t->hdr.size; t = tag_next(t)) { ++ if (t->hdr.tag == ATAG_CMDLINE) { ++ p = t->u.cmdline.cmdline; ++ } ++ } ++ ++ fixlen = strlen(wg302v1_mem_fixup); ++ cmdlen = strlen(p); ++ if (fixlen + cmdlen >= COMMAND_LINE_SIZE) ++ return; ++ ++ /* append the fixup to the cmdline */ ++ memmove(p + cmdlen, wg302v1_mem_fixup, fixlen + 1); ++ ++ /* Adjust the size of the atag if there was one */ ++ if (t->hdr.size) ++ t->hdr.size += fixlen; ++} ++ + static void __init wg302v1_init(void) + { + ixp4xx_sys_init(); diff --git a/target/linux/ixp4xx/patches-4.9/170-ixdpg425_mac_plat_info.patch b/target/linux/ixp4xx/patches-4.9/170-ixdpg425_mac_plat_info.patch new file mode 100644 index 0000000000..f7090cd1b4 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/170-ixdpg425_mac_plat_info.patch @@ -0,0 +1,51 @@ +--- a/arch/arm/mach-ixp4xx/coyote-setup.c ++++ b/arch/arm/mach-ixp4xx/coyote-setup.c +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -81,9 +82,39 @@ static struct platform_device coyote_uar + .resource = &coyote_uart_resource, + }; + ++/* Built-in 10/100 Ethernet MAC interfaces */ ++static struct eth_plat_info ixdpg425_plat_eth[] = { ++ { ++ .phy = 5, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 4, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device ixdpg425_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = ixdpg425_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = ixdpg425_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++ + static struct platform_device *coyote_devices[] __initdata = { + &coyote_flash, +- &coyote_uart ++ &coyote_uart, ++ &ixdpg425_eth[0], ++ &ixdpg425_eth[1], + }; + + static void __init coyote_init(void) diff --git a/target/linux/ixp4xx/patches-4.9/175-avila_hss_audio_support.patch b/target/linux/ixp4xx/patches-4.9/175-avila_hss_audio_support.patch new file mode 100644 index 0000000000..398344d188 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/175-avila_hss_audio_support.patch @@ -0,0 +1,2093 @@ +--- a/sound/soc/Kconfig ++++ b/sound/soc/Kconfig +@@ -47,6 +47,7 @@ source "sound/soc/cirrus/Kconfig" + source "sound/soc/davinci/Kconfig" + source "sound/soc/dwc/Kconfig" + source "sound/soc/fsl/Kconfig" ++source "sound/soc/gw-avila/Kconfig" + source "sound/soc/jz4740/Kconfig" + source "sound/soc/nuc900/Kconfig" + source "sound/soc/omap/Kconfig" +--- a/sound/soc/Makefile ++++ b/sound/soc/Makefile +@@ -27,6 +27,7 @@ obj-$(CONFIG_SND_SOC) += cirrus/ + obj-$(CONFIG_SND_SOC) += davinci/ + obj-$(CONFIG_SND_SOC) += dwc/ + obj-$(CONFIG_SND_SOC) += fsl/ ++obj-$(CONFIG_SND_SOC) += gw-avila/ + obj-$(CONFIG_SND_SOC) += jz4740/ + obj-$(CONFIG_SND_SOC) += img/ + obj-$(CONFIG_SND_SOC) += intel/ +--- /dev/null ++++ b/sound/soc/gw-avila/Kconfig +@@ -0,0 +1,17 @@ ++config SND_GW_AVILA_SOC_PCM ++ tristate ++ ++config SND_GW_AVILA_SOC_HSS ++ tristate ++ ++config SND_GW_AVILA_SOC ++ tristate "SoC Audio for the Gateworks AVILA Family" ++ depends on ARCH_IXP4XX && SND_SOC ++ select SND_GW_AVILA_SOC_PCM ++ select SND_GW_AVILA_SOC_HSS ++ select SND_SOC_TLV320AIC3X ++ help ++ Say Y or M if you want to add support for codecs attached to ++ the Gateworks HSS interface. You will also need ++ to select the audio interfaces to support below. ++ +--- /dev/null ++++ b/sound/soc/gw-avila/Makefile +@@ -0,0 +1,8 @@ ++# Gateworks Avila HSS Platform Support ++snd-soc-gw-avila-objs := gw-avila.o ixp4xx_hss.o ++snd-soc-gw-avila-pcm-objs := gw-avila-pcm.o ++snd-soc-gw-avila-hss-objs := gw-avila-hss.o ++ ++obj-$(CONFIG_SND_GW_AVILA_SOC) += snd-soc-gw-avila.o ++obj-$(CONFIG_SND_GW_AVILA_SOC_PCM) += snd-soc-gw-avila-pcm.o ++obj-$(CONFIG_SND_GW_AVILA_SOC_HSS) += snd-soc-gw-avila-hss.o +--- /dev/null ++++ b/sound/soc/gw-avila/gw-avila-hss.c +@@ -0,0 +1,103 @@ ++/* ++ * gw-avila-hss.c -- HSS Audio Support for Gateworks Avila ++ * ++ * Author: Chris Lang ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include "ixp4xx_hss.h" ++#include "gw-avila-hss.h" ++ ++#define gw_avila_hss_suspend NULL ++#define gw_avila_hss_resume NULL ++ ++struct snd_soc_dai_driver gw_avila_hss_dai = { ++ .playback = { ++ .channels_min = 2, ++ .channels_max = 2, ++ .rates = (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | ++ SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | ++ SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | ++ SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | ++ SNDRV_PCM_RATE_KNOT), ++ .formats = SNDRV_PCM_FMTBIT_S16_LE, }, ++ .capture = { ++ .channels_min = 2, ++ .channels_max = 2, ++ .rates = (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | ++ SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | ++ SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | ++ SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | ++ SNDRV_PCM_RATE_KNOT), ++ .formats = SNDRV_PCM_FMTBIT_S16_LE, }, ++}; ++ ++static const struct snd_soc_component_driver gw_avila_hss_component = { ++ .name = "gw_avila_hss", ++}; ++ ++static int gw_avila_hss_probe(struct platform_device *pdev) ++{ ++ int port = (pdev->id < 2) ? 0 : 1; ++ int channel = (pdev->id % 2); ++ ++ hss_handle[pdev->id] = hss_init(port, channel); ++ if (!hss_handle[pdev->id]) { ++ return -ENODEV; ++ } ++ ++ return snd_soc_register_component(&pdev->dev, &gw_avila_hss_component, ++ &gw_avila_hss_dai, 1); ++} ++ ++static int gw_avila_hss_remove(struct platform_device *pdev) ++{ ++ snd_soc_unregister_component(&pdev->dev); ++ ++ return 0; ++} ++ ++static struct platform_driver gw_avila_hss_driver = { ++ .probe = gw_avila_hss_probe, ++ .remove = gw_avila_hss_remove, ++ .driver = { ++ .name = "gw_avila_hss", ++ .owner = THIS_MODULE, ++ } ++}; ++ ++static int __init gw_avila_hss_init(void) ++{ ++ return platform_driver_register(&gw_avila_hss_driver); ++} ++module_init(gw_avila_hss_init); ++ ++static void __exit gw_avila_hss_exit(void) ++{ ++ platform_driver_unregister(&gw_avila_hss_driver); ++} ++module_exit(gw_avila_hss_exit); ++ ++MODULE_AUTHOR("Chris Lang"); ++MODULE_DESCRIPTION("HSS Audio Driver for Gateworks Avila"); ++MODULE_LICENSE("GPL"); +--- /dev/null ++++ b/sound/soc/gw-avila/gw-avila-hss.h +@@ -0,0 +1,12 @@ ++/* ++ * Author: Chris Lang ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#ifndef _GW_AVILA_HSS_H ++#define _GW_AVILA_HSS_H ++ ++#endif +--- /dev/null ++++ b/sound/soc/gw-avila/gw-avila-pcm.c +@@ -0,0 +1,327 @@ ++/* ++ * ALSA PCM interface for the TI DAVINCI processor ++ * ++ * Author: Chris Lang, ++ * Copyright: (C) 2009 Gateworks Corporation ++ * ++ * Based On: davinci-evm.c, Author: Vladimir Barinov, ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include ++ ++#include "gw-avila-pcm.h" ++#include "gw-avila-hss.h" ++#include "ixp4xx_hss.h" ++ ++#define GW_AVILA_PCM_DEBUG 0 ++#if GW_AVILA_PCM_DEBUG ++#define DPRINTK(x...) printk(KERN_DEBUG x) ++#else ++#define DPRINTK(x...) ++#endif ++ ++static struct snd_pcm_hardware gw_avila_pcm_hardware = { ++ .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | ++ SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID), ++/* SNDRV_PCM_INFO_PAUSE),*/ ++ .formats = (SNDRV_PCM_FMTBIT_S16_LE), ++ .rates = (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | ++ SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | ++ SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | ++ SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | ++ SNDRV_PCM_RATE_KNOT), ++ .rate_min = 8000, ++ .rate_max = 8000, ++ .channels_min = 2, ++ .channels_max = 2, ++ .buffer_bytes_max = 64 * 1024, // All of the lines below may need to be changed ++ .period_bytes_min = 128, ++ .period_bytes_max = 4 * 1024, ++ .periods_min = 16, ++ .periods_max = 32, ++ .fifo_size = 0, ++}; ++ ++struct gw_avila_runtime_data { ++ spinlock_t lock; ++ int period; /* current DMA period */ ++ int master_lch; /* Master DMA channel */ ++ int slave_lch; /* Slave DMA channel */ ++ struct gw_avila_pcm_dma_params *params; /* DMA params */ ++}; ++ ++static void gw_avila_dma_irq(void *data) ++{ ++ struct snd_pcm_substream *substream = data; ++ snd_pcm_period_elapsed(substream); ++} ++ ++static int gw_avila_pcm_trigger(struct snd_pcm_substream *substream, int cmd) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ struct hss_device *hdev = runtime->private_data; ++ int ret = 0; ++ ++ switch (cmd) { ++ case SNDRV_PCM_TRIGGER_START: ++ case SNDRV_PCM_TRIGGER_RESUME: ++ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ++ hss_tx_start(hdev); ++ else ++ hss_rx_start(hdev); ++ break; ++ case SNDRV_PCM_TRIGGER_STOP: ++ case SNDRV_PCM_TRIGGER_SUSPEND: ++ case SNDRV_PCM_TRIGGER_PAUSE_PUSH: ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ++ hss_tx_stop(hdev); ++ else ++ hss_rx_stop(hdev); ++ break; ++ default: ++ ret = -EINVAL; ++ break; ++ } ++ return ret; ++} ++ ++static int gw_avila_pcm_prepare(struct snd_pcm_substream *substream) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ struct hss_device *hdev = runtime->private_data; ++ ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { ++ hss_set_tx_callback(hdev, gw_avila_dma_irq, substream); ++ hss_config_tx_dma(hdev, runtime->dma_area, runtime->buffer_size, runtime->period_size); ++ } else { ++ hss_set_rx_callback(hdev, gw_avila_dma_irq, substream); ++ hss_config_rx_dma(hdev, runtime->dma_area, runtime->buffer_size, runtime->period_size); ++ } ++ ++ return 0; ++} ++ ++static snd_pcm_uframes_t ++gw_avila_pcm_pointer(struct snd_pcm_substream *substream) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ struct hss_device *hdev = runtime->private_data; ++ ++ unsigned int curr = 0; ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ++ curr = hss_curr_offset_tx(hdev); ++ else ++ curr = hss_curr_offset_rx(hdev); ++ return curr; ++} ++ ++static int gw_avila_pcm_open(struct snd_pcm_substream *substream) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ ++ snd_soc_set_runtime_hwparams(substream, &gw_avila_pcm_hardware); ++ ++ if (hss_handle[cpu_dai->id] != NULL) ++ runtime->private_data = hss_handle[cpu_dai->id]; ++ else { ++ pr_err("hss_handle is NULL\n"); ++ return -1; ++ } ++ ++ hss_chan_open(hss_handle[cpu_dai->id]); ++ ++ return 0; ++} ++ ++static int gw_avila_pcm_close(struct snd_pcm_substream *substream) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ struct hss_device *hdev = runtime->private_data; ++ ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { ++ memset(hdev->tx_buf, 0, runtime->buffer_size); ++ } else ++ memset(hdev->rx_buf, 0, runtime->buffer_size); ++ ++ hss_chan_close(hdev); ++ ++ return 0; ++} ++ ++static int gw_avila_pcm_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *hw_params) ++{ ++ return snd_pcm_lib_malloc_pages(substream, ++ params_buffer_bytes(hw_params)); ++} ++ ++static int gw_avila_pcm_hw_free(struct snd_pcm_substream *substream) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ++ memset(runtime->dma_area, 0, runtime->buffer_size); ++ ++ return snd_pcm_lib_free_pages(substream); ++} ++ ++static int gw_avila_pcm_mmap(struct snd_pcm_substream *substream, ++ struct vm_area_struct *vma) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ ++ return dma_mmap_writecombine(substream->pcm->card->dev, vma, ++ runtime->dma_area, ++ runtime->dma_addr, ++ runtime->dma_bytes); ++} ++ ++struct snd_pcm_ops gw_avila_pcm_ops = { ++ .open = gw_avila_pcm_open, ++ .close = gw_avila_pcm_close, ++ .ioctl = snd_pcm_lib_ioctl, ++ .hw_params = gw_avila_pcm_hw_params, ++ .hw_free = gw_avila_pcm_hw_free, ++ .prepare = gw_avila_pcm_prepare, ++ .trigger = gw_avila_pcm_trigger, ++ .pointer = gw_avila_pcm_pointer, ++ .mmap = gw_avila_pcm_mmap, ++}; ++ ++static int gw_avila_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream) ++{ ++ struct snd_pcm_substream *substream = pcm->streams[stream].substream; ++ struct snd_dma_buffer *buf = &substream->dma_buffer; ++ size_t size = gw_avila_pcm_hardware.buffer_bytes_max; ++ ++ buf->dev.type = SNDRV_DMA_TYPE_DEV; ++ buf->dev.dev = pcm->card->dev; ++ buf->private_data = NULL; ++ ++ buf->area = dma_alloc_coherent(pcm->card->dev, size, ++ &buf->addr, GFP_KERNEL); ++ ++ if (!buf->area) { ++ return -ENOMEM; ++ } ++ ++ memset(buf->area, 0xff, size); ++ ++ DPRINTK("preallocate_dma_buffer: area=%p, addr=%p, size=%d\n", ++ (void *) buf->area, (void *) buf->addr, size); ++ ++ buf->bytes = size; ++ ++ return 0; ++} ++ ++static void gw_avila_pcm_free(struct snd_pcm *pcm) ++{ ++ struct snd_pcm_substream *substream; ++ struct snd_dma_buffer *buf; ++ int stream; ++ ++ for (stream = 0; stream < 2; stream++) { ++ substream = pcm->streams[stream].substream; ++ if (!substream) ++ continue; ++ ++ buf = &substream->dma_buffer; ++ if (!buf->area) ++ continue; ++ ++ dma_free_coherent(NULL, buf->bytes, buf->area, 0); ++ buf->area = NULL; ++ } ++} ++ ++static u64 gw_avila_pcm_dmamask = 0xFFFFFFFF; ++ ++static int gw_avila_pcm_new(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct snd_card *card = rtd->card->snd_card; ++ struct snd_pcm *pcm = rtd->pcm; ++ struct snd_soc_dai *dai = rtd->codec_dai; ++ int ret; ++ ++ if (!card->dev->dma_mask) ++ card->dev->dma_mask = &gw_avila_pcm_dmamask; ++ if (!card->dev->coherent_dma_mask) ++ card->dev->coherent_dma_mask = 0xFFFFFFFF; ++ ++ if (dai->driver->playback.channels_min) { ++ ret = gw_avila_pcm_preallocate_dma_buffer(pcm, ++ SNDRV_PCM_STREAM_PLAYBACK); ++ if (ret) ++ return ret; ++ } ++ ++ if (dai->driver->capture.channels_min) { ++ ret = gw_avila_pcm_preallocate_dma_buffer(pcm, ++ SNDRV_PCM_STREAM_CAPTURE); ++ if (ret) ++ return ret; ++ } ++ ++ return 0; ++} ++ ++struct snd_soc_platform_driver gw_avila_soc_platform = { ++ .ops = &gw_avila_pcm_ops, ++ .pcm_new = gw_avila_pcm_new, ++ .pcm_free = gw_avila_pcm_free, ++}; ++ ++static int gw_avila_pcm_platform_probe(struct platform_device *pdev) ++{ ++ return snd_soc_register_platform(&pdev->dev, &gw_avila_soc_platform); ++} ++ ++static int gw_avila_pcm_platform_remove(struct platform_device *pdev) ++{ ++ snd_soc_unregister_platform(&pdev->dev); ++ return 0; ++} ++ ++static struct platform_driver gw_avila_pcm_driver = { ++ .driver = { ++ .name = "gw_avila-audio", ++ .owner = THIS_MODULE, ++ }, ++ .probe = gw_avila_pcm_platform_probe, ++ .remove = gw_avila_pcm_platform_remove, ++}; ++ ++static int __init gw_avila_soc_platform_init(void) ++{ ++ return platform_driver_register(&gw_avila_pcm_driver); ++} ++module_init(gw_avila_soc_platform_init); ++ ++static void __exit gw_avila_soc_platform_exit(void) ++{ ++ platform_driver_unregister(&gw_avila_pcm_driver); ++} ++module_exit(gw_avila_soc_platform_exit); ++ ++MODULE_AUTHOR("Chris Lang"); ++MODULE_DESCRIPTION("Gateworks Avila PCM DMA module"); ++MODULE_LICENSE("GPL"); +--- /dev/null ++++ b/sound/soc/gw-avila/gw-avila-pcm.h +@@ -0,0 +1,32 @@ ++/* ++ * ALSA PCM interface for the Gateworks Avila platform ++ * ++ * Author: Chris Lang, ++ * Copyright: (C) 2009 Gateworks Corporation ++ * ++ * Based On: davinci-evm.c, Author: Vladimir Barinov, ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#ifndef _GW_AVILA_PCM_H ++#define _GW_AVILA_PCM_H ++ ++#if 0 ++struct gw_avila_pcm_dma_params { ++ char *name; /* stream identifier */ ++ int channel; /* sync dma channel ID */ ++ dma_addr_t dma_addr; /* device physical address for DMA */ ++ unsigned int data_type; /* xfer data type */ ++}; ++ ++struct gw_avila_snd_platform_data { ++ int tx_dma_ch; // XXX Do we need this? ++ int rx_dma_ch; // XXX Do we need this ++}; ++extern struct snd_soc_platform gw_avila_soc_platform[]; ++#endif ++ ++#endif +--- /dev/null ++++ b/sound/soc/gw-avila/gw-avila.c +@@ -0,0 +1,244 @@ ++/* ++ * File: sound/soc/gw-avila/gw_avila.c ++ * Author: Chris Lang ++ * ++ * Created: Tue June 06 2008 ++ * Description: Board driver for Gateworks Avila ++ * ++ * Modified: ++ * Copyright 2009 Gateworks Corporation ++ * ++ * Bugs: What Bugs? ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see the file COPYING, or write ++ * to the Free Software Foundation, Inc., ++ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "ixp4xx_hss.h" ++#include "gw-avila-hss.h" ++#include "gw-avila-pcm.h" ++ ++#define CODEC_FREQ 33333000 ++ ++static int gw_avila_board_startup(struct snd_pcm_substream *substream) ++{ ++ pr_debug("%s enter\n", __func__); ++ return 0; ++} ++ ++static int gw_avila_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *codec_dai = rtd->codec_dai; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ ++ int ret = 0; ++ ++ /* set codec DAI configuration */ ++ if (cpu_dai->id % 2) { ++ ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_IB_NF | SND_SOC_DAIFMT_CBS_CFS); ++ snd_soc_dai_set_tdm_slot(codec_dai, 0, 0, 1, 32); ++ } else { ++ ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_IB_NF | SND_SOC_DAIFMT_CBM_CFM); ++ snd_soc_dai_set_tdm_slot(codec_dai, 0, 0, 0, 32); ++ } ++ ++ if (ret < 0) ++ return ret; ++ ++ /* set the codec system clock */ ++ ret = snd_soc_dai_set_sysclk(codec_dai, 0, CODEC_FREQ, SND_SOC_CLOCK_OUT); ++ if (ret < 0) ++ return ret; ++ ++ return 0; ++} ++ ++static const struct snd_soc_dapm_widget aic3x_dapm_widgets[] = { ++ SND_SOC_DAPM_HP("Headphone Jack", NULL), ++ SND_SOC_DAPM_LINE("Line Out", NULL), ++ SND_SOC_DAPM_LINE("Line In", NULL), ++}; ++ ++static const struct snd_soc_dapm_route audio_map[] = { ++ {"Headphone Jack", NULL, "HPLOUT"}, ++ {"Headphone Jack", NULL, "HPROUT"}, ++ ++ /* Line Out connected to LLOUT, RLOUT */ ++ {"Line Out", NULL, "LLOUT"}, ++ {"Line Out", NULL, "RLOUT"}, ++ ++ /* Line In connected to (LINE1L | LINE2L), (LINE1R | LINE2R) */ ++ {"LINE1L", NULL, "Line In"}, ++ {"LINE1R", NULL, "Line In"}, ++}; ++ ++/* Logic for a aic3x as connected on a davinci-evm */ ++static int avila_aic3x_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct snd_soc_codec *codec = rtd->codec; ++ struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); ++ ++ /* Add davinci-evm specific widgets */ ++ snd_soc_dapm_new_controls(dapm, aic3x_dapm_widgets, ++ ARRAY_SIZE(aic3x_dapm_widgets)); ++ ++ /* Set up davinci-evm specific audio path audio_map */ ++ snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); ++ ++ /* not connected */ ++ snd_soc_dapm_disable_pin(dapm, "MONO_LOUT"); ++ //snd_soc_dapm_disable_pin(dapm, "HPLCOM"); ++ //snd_soc_dapm_disable_pin(dapm, "HPRCOM"); ++ snd_soc_dapm_disable_pin(dapm, "MIC3L"); ++ snd_soc_dapm_disable_pin(dapm, "MIC3R"); ++ snd_soc_dapm_disable_pin(dapm, "LINE2L"); ++ snd_soc_dapm_disable_pin(dapm, "LINE2R"); ++ ++ /* always connected */ ++ snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); ++ snd_soc_dapm_enable_pin(dapm, "Line Out"); ++ snd_soc_dapm_enable_pin(dapm, "Line In"); ++ ++ snd_soc_dapm_sync(dapm); ++ ++ return 0; ++} ++ ++static struct snd_soc_ops gw_avila_board_ops = { ++ .startup = gw_avila_board_startup, ++ .hw_params = gw_avila_hw_params, ++}; ++ ++static struct snd_soc_dai_link gw_avila_board_dai[] = { ++ { ++ .name = "HSS-0", ++ .stream_name = "HSS-0", ++ .cpu_dai_name = "gw_avila_hss.0", ++ .codec_dai_name = "tlv320aic3x-hifi", ++ .codec_name = "tlv320aic3x-codec.0-001b", ++ .platform_name = "gw_avila-audio.0", ++ .init = avila_aic3x_init, ++ .ops = &gw_avila_board_ops, ++ },{ ++ .name = "HSS-1", ++ .stream_name = "HSS-1", ++ .cpu_dai_name = "gw_avila_hss.1", ++ .codec_dai_name = "tlv320aic3x-hifi", ++ .codec_name = "tlv320aic3x-codec.0-001a", ++ .platform_name = "gw_avila-audio.1", ++ .init = avila_aic3x_init, ++ .ops = &gw_avila_board_ops, ++ },{ ++ .name = "HSS-2", ++ .stream_name = "HSS-2", ++ .cpu_dai_name = "gw_avila_hss.2", ++ .codec_dai_name = "tlv320aic3x-hifi", ++ .codec_name = "tlv320aic3x-codec.0-0019", ++ .platform_name = "gw_avila-audio.2", ++ .init = avila_aic3x_init, ++ .ops = &gw_avila_board_ops, ++ },{ ++ .name = "HSS-3", ++ .stream_name = "HSS-3", ++ .cpu_dai_name = "gw_avila_hss.3", ++ .codec_dai_name = "tlv320aic3x-hifi", ++ .codec_name = "tlv320aic3x-codec.0-0018", ++ .platform_name = "gw_avila-audio.3", ++ .init = avila_aic3x_init, ++ .ops = &gw_avila_board_ops, ++ }, ++}; ++ ++static struct snd_soc_card gw_avila_board[] = { ++ { ++ .name = "gw_avila-board.0", ++ .owner = THIS_MODULE, ++ .dai_link = &gw_avila_board_dai[0], ++ .num_links = 1, ++ },{ ++ .name = "gw_avila-board.1", ++ .owner = THIS_MODULE, ++ .dai_link = &gw_avila_board_dai[1], ++ .num_links = 1, ++ },{ ++ .name = "gw_avila-board.2", ++ .owner = THIS_MODULE, ++ .dai_link = &gw_avila_board_dai[2], ++ .num_links = 1, ++ },{ ++ .name = "gw_avila-board.3", ++ .owner = THIS_MODULE, ++ .dai_link = &gw_avila_board_dai[3], ++ .num_links = 1, ++ } ++}; ++ ++static struct platform_device *gw_avila_board_snd_device[4]; ++ ++static int __init gw_avila_board_init(void) ++{ ++ int ret; ++ struct port *port; ++ int i; ++ ++ if ((hss_port[0] = kzalloc(sizeof(*port), GFP_KERNEL)) == NULL) ++ return -ENOMEM; ++ ++ if ((hss_port[1] = kzalloc(sizeof(*port), GFP_KERNEL)) == NULL) ++ return -ENOMEM; ++ ++ for (i = 0; i < 4; i++) { ++ gw_avila_board_snd_device[i] = platform_device_alloc("soc-audio", i); ++ if (!gw_avila_board_snd_device[i]) { ++ return -ENOMEM; ++ } ++ ++ platform_set_drvdata(gw_avila_board_snd_device[i], &gw_avila_board[i]); ++ ret = platform_device_add(gw_avila_board_snd_device[i]); ++ ++ if (ret) { ++ platform_device_put(gw_avila_board_snd_device[i]); ++ } ++ } ++ return ret; ++} ++ ++static void __exit gw_avila_board_exit(void) ++{ ++ int i; ++ for (i = 0; i < 4; i++) ++ platform_device_unregister(gw_avila_board_snd_device[i]); ++} ++ ++module_init(gw_avila_board_init); ++module_exit(gw_avila_board_exit); ++ ++/* Module information */ ++MODULE_AUTHOR("Chris Lang"); ++MODULE_DESCRIPTION("ALSA SoC HSS Audio gw_avila board"); ++MODULE_LICENSE("GPL"); +--- /dev/null ++++ b/sound/soc/gw-avila/ixp4xx_hss.c +@@ -0,0 +1,902 @@ ++/* ++ * Intel IXP4xx HSS (synchronous serial port) driver for Linux ++ * ++ * Copyright (C) 2009 Chris Lang ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of version 2 of the GNU General Public License ++ * as published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include "ixp4xx_hss.h" ++ ++/***************************************************************************** ++ * global variables ++ ****************************************************************************/ ++ ++void hss_chan_read(unsigned long data); ++static char lock_init = 0; ++static spinlock_t npe_lock; ++static struct npe *npe; ++ ++static const struct { ++ int tx, txdone, rx, rxfree, chan; ++}queue_ids[2] = {{HSS0_PKT_TX0_QUEUE, HSS0_PKT_TXDONE_QUEUE, HSS0_PKT_RX_QUEUE, ++ HSS0_PKT_RXFREE0_QUEUE, HSS0_CHL_RXTRIG_QUEUE}, ++ {HSS1_PKT_TX0_QUEUE, HSS1_PKT_TXDONE_QUEUE, HSS1_PKT_RX_QUEUE, ++ HSS1_PKT_RXFREE0_QUEUE, HSS1_CHL_RXTRIG_QUEUE}, ++}; ++ ++struct port *hss_port[2]; ++struct hss_device *hss_handle[32]; ++EXPORT_SYMBOL(hss_handle); ++ ++/***************************************************************************** ++ * utility functions ++ ****************************************************************************/ ++ ++#ifndef __ARMEB__ ++static inline void memcpy_swab32(u32 *dest, u32 *src, int cnt) ++{ ++ int i; ++ for (i = 0; i < cnt; i++) ++ dest[i] = swab32(src[i]); ++} ++#endif ++ ++static inline unsigned int sub_offset(unsigned int a, unsigned int b, ++ unsigned int modulo) ++{ ++ return (modulo /* make sure the result >= 0 */ + a - b) % modulo; ++} ++ ++/***************************************************************************** ++ * HSS access ++ ****************************************************************************/ ++ ++static void hss_config_load(struct port *port) ++{ ++ struct msg msg; ++ ++ do { ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_LOAD; ++ msg.hss_port = port->id; ++ if (npe_send_message(npe, &msg, "HSS_LOAD_CONFIG")) ++ break; ++ if (npe_recv_message(npe, &msg, "HSS_LOAD_CONFIG")) ++ break; ++ ++ /* HSS_LOAD_CONFIG for port #1 returns port_id = #4 */ ++ if (msg.cmd != PORT_CONFIG_LOAD || msg.data32) ++ break; ++ ++ /* HDLC may stop working without this */ ++ npe_recv_message(npe, &msg, "FLUSH_IT"); ++ return; ++ } while (0); ++ ++ printk(KERN_CRIT "HSS-%i: unable to reload HSS configuration\n", ++ port->id); ++ BUG(); ++} ++ ++static void hss_config_set_pcr(struct port *port) ++{ ++ struct msg msg; ++ ++ do { ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_WRITE; ++ msg.hss_port = port->id; ++ msg.index = HSS_CONFIG_TX_PCR; ++#if 0 ++ msg.data32 = PCR_FRM_SYNC_RISINGEDGE | PCR_MSB_ENDIAN | ++ PCR_TX_DATA_ENABLE | PCR_TX_UNASS_HIGH_IMP | PCR_TX_V56K_HIGH_IMP | PCR_TX_FB_HIGH_IMP; ++#else ++ msg.data32 = PCR_FRM_SYNC_RISINGEDGE | PCR_MSB_ENDIAN | ++ PCR_TX_DATA_ENABLE | PCR_TX_FB_HIGH_IMP | PCR_DCLK_EDGE_RISING; ++#endif ++ if (port->frame_size % 8 == 0) ++ msg.data32 |= PCR_SOF_NO_FBIT; ++ ++ if (npe_send_message(npe, &msg, "HSS_SET_TX_PCR")) ++ break; ++ ++ msg.index = HSS_CONFIG_RX_PCR; ++ msg.data32 &= ~ (PCR_DCLK_EDGE_RISING | PCR_FCLK_EDGE_RISING | PCR_TX_DATA_ENABLE); ++ ++ if (npe_send_message(npe, &msg, "HSS_SET_RX_PCR")) ++ break; ++ return; ++ } while (0); ++ ++ printk(KERN_CRIT "HSS-%i: unable to set HSS PCR registers\n", port->id); ++ BUG(); ++} ++ ++static void hss_config_set_core(struct port *port) ++{ ++ struct msg msg; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_WRITE; ++ msg.hss_port = port->id; ++ msg.index = HSS_CONFIG_CORE_CR; ++#if 0 ++ msg.data32 = 0 | CCR_LOOPBACK | ++ (port->id ? CCR_SECOND_HSS : 0); ++#else ++ msg.data32 = 0 | ++ (port->id ? CCR_SECOND_HSS : 0); ++#endif ++ if (npe_send_message(npe, &msg, "HSS_SET_CORE_CR")) { ++ printk(KERN_CRIT "HSS-%i: unable to set HSS core control" ++ " register\n", port->id); ++ BUG(); ++ } ++} ++ ++static void hss_config_set_line(struct port *port) ++{ ++ struct msg msg; ++ ++ hss_config_set_pcr(port); ++ hss_config_set_core(port); ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_WRITE; ++ msg.hss_port = port->id; ++ msg.index = HSS_CONFIG_CLOCK_CR; ++ msg.data32 = CLK42X_SPEED_8192KHZ /* FIXME */; ++ if (npe_send_message(npe, &msg, "HSS_SET_CLOCK_CR")) { ++ printk(KERN_CRIT "HSS-%i: unable to set HSS clock control" ++ " register\n", port->id); ++ BUG(); ++ } ++} ++ ++static void hss_config_set_rx_frame(struct port *port) ++{ ++ struct msg msg; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_WRITE; ++ msg.hss_port = port->id; ++ msg.index = HSS_CONFIG_RX_FCR; ++ msg.data16a = port->frame_sync_offset; ++ msg.data16b = port->frame_size - 1; ++ if (npe_send_message(npe, &msg, "HSS_SET_RX_FCR")) { ++ printk(KERN_CRIT "HSS-%i: unable to set HSS RX frame size" ++ " and offset\n", port->id); ++ BUG(); ++ } ++} ++ ++static void hss_config_set_frame(struct port *port) ++{ ++ struct msg msg; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_WRITE; ++ msg.hss_port = port->id; ++ msg.index = HSS_CONFIG_TX_FCR; ++ msg.data16a = TX_FRAME_SYNC_OFFSET; ++ msg.data16b = port->frame_size - 1; ++ if (npe_send_message(npe, &msg, "HSS_SET_TX_FCR")) { ++ printk(KERN_CRIT "HSS-%i: unable to set HSS TX frame size" ++ " and offset\n", port->id); ++ BUG(); ++ } ++ hss_config_set_rx_frame(port); ++} ++ ++static void hss_config_set_lut(struct port *port) ++{ ++ struct msg msg; ++ int chan_count = 32; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_WRITE; ++ msg.hss_port = port->id; ++ ++ msg.index = HSS_CONFIG_TX_LUT; ++ msg.data32 = 0xffffffff; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.data32 = 0x0; ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ ++ msg.index = HSS_CONFIG_RX_LUT; ++ msg.data32 = 0xffffffff; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.data32 = 0x0; ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ ++ hss_config_set_frame(port); ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_NUM_CHANS_WRITE; ++ msg.hss_port = port->id; ++ msg.data8a = chan_count; ++ if (npe_send_message(npe, &msg, "CHAN_NUM_CHANS_WRITE")) { ++ printk(KERN_CRIT "HSS-%i: unable to set HSS channel count\n", ++ port->id); ++ BUG(); ++ } ++} ++ ++static u32 hss_config_get_status(struct port *port) ++{ ++ struct msg msg; ++ ++ do { ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_ERROR_READ; ++ msg.hss_port = port->id; ++ if (npe_send_message(npe, &msg, "PORT_ERROR_READ")) ++ break; ++ if (npe_recv_message(npe, &msg, "PORT_ERROR_READ")) ++ break; ++ ++ return msg.data32; ++ } while (0); ++ ++ printk(KERN_CRIT "HSS-%i: unable to read HSS status\n", port->id); ++ BUG(); ++} ++ ++static void hss_config_start_chan(struct port *port) ++{ ++ struct msg msg; ++ ++ port->chan_last_tx = 0; ++ port->chan_last_rx = 0; ++ ++ do { ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_RX_BUF_ADDR_WRITE; ++ msg.hss_port = port->id; ++ msg.data32 = port->chan_rx_buf_phys; ++ if (npe_send_message(npe, &msg, "CHAN_RX_BUF_ADDR_WRITE")) ++ break; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_TX_BUF_ADDR_WRITE; ++ msg.hss_port = port->id; ++ msg.data32 = port->chan_tx_pointers_phys; ++ if (npe_send_message(npe, &msg, "CHAN_TX_BUF_ADDR_WRITE")) ++ break; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_FLOW_ENABLE; ++ msg.hss_port = port->id; ++ if (npe_send_message(npe, &msg, "CHAN_FLOW_ENABLE")) ++ break; ++ port->chan_started = 1; ++ return; ++ } while (0); ++ ++ printk(KERN_CRIT "HSS-%i: unable to start channelized flow\n", ++ port->id); ++ BUG(); ++} ++ ++static void hss_config_stop_chan(struct port *port) ++{ ++ struct msg msg; ++ ++ if (!port->chan_started) ++ return; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_FLOW_DISABLE; ++ msg.hss_port = port->id; ++ if (npe_send_message(npe, &msg, "CHAN_FLOW_DISABLE")) { ++ printk(KERN_CRIT "HSS-%i: unable to stop channelized flow\n", ++ port->id); ++ BUG(); ++ } ++ hss_config_get_status(port); /* make sure it's halted */ ++ port->chan_started = 0; ++} ++ ++static int hss_config_load_firmware(struct port *port) ++{ ++ struct msg msg; ++ ++ if (port->initialized) ++ return 0; ++ ++ if (!npe_running(npe)) { ++ int err; ++ if ((err = npe_load_firmware(npe, "NPE-A-HSS", ++ port->dev))) ++ return err; ++ } ++ ++ do { ++ /* HSS main configuration */ ++ hss_config_set_line(port); ++ ++ hss_config_set_frame(port); ++ ++ /* Channelized operation settings */ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_TX_BLK_CFG_WRITE; ++ msg.hss_port = port->id; ++ msg.data8b = (CHAN_TX_LIST_FRAMES & ~7) / 2; ++ msg.data8a = msg.data8b / 4; ++ msg.data8d = CHAN_TX_LIST_FRAMES - msg.data8b; ++ msg.data8c = msg.data8d / 4; ++ if (npe_send_message(npe, &msg, "CHAN_TX_BLK_CFG_WRITE")) ++ break; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_RX_BUF_CFG_WRITE; ++ msg.hss_port = port->id; ++ msg.data8a = CHAN_RX_TRIGGER / 8; ++ msg.data8b = CHAN_RX_FRAMES; ++ if (npe_send_message(npe, &msg, "CHAN_RX_BUF_CFG_WRITE")) ++ break; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_TX_BUF_SIZE_WRITE; ++ msg.hss_port = port->id; ++ msg.data8a = CHAN_TX_LISTS; ++ if (npe_send_message(npe, &msg, "CHAN_TX_BUF_SIZE_WRITE")) ++ break; ++ ++ port->initialized = 1; ++ return 0; ++ } while (0); ++ ++ printk(KERN_CRIT "HSS-%i: unable to start HSS operation\n", port->id); ++ BUG(); ++} ++ ++void hss_chan_irq(void *pdev) ++{ ++ struct port *port = pdev; ++ ++ qmgr_disable_irq(queue_ids[port->id].chan); ++ ++ tasklet_hi_schedule(&port->task); ++} ++ ++ ++int hss_prepare_chan(struct port *port) ++{ ++ int err, i, j; ++ u32 *temp; ++ u32 temp2; ++ u8 *temp3; ++ ++ if (port->initialized) ++ return 0; ++ ++ if ((err = hss_config_load_firmware(port))) ++ return err; ++ ++ if ((err = qmgr_request_queue(queue_ids[port->id].chan, ++ CHAN_QUEUE_LEN, 0, 0, "%s:hss", "hss"))) ++ return err; ++ ++ port->chan_tx_buf = dma_alloc_coherent(port->dev, chan_tx_buf_len(port), &port->chan_tx_buf_phys, GFP_DMA); ++ memset(port->chan_tx_buf, 0, chan_tx_buf_len(port)); ++ ++ port->chan_tx_pointers = dma_alloc_coherent(port->dev, chan_tx_buf_len(port) / CHAN_TX_LIST_FRAMES * 4, &port->chan_tx_pointers_phys, GFP_DMA); ++ ++ temp3 = port->chan_tx_buf; ++ for (i = 0; i < CHAN_TX_LISTS; i++) { ++ for (j = 0; j < 8; j++) { ++ port->tx_lists[i][j] = temp3; ++ temp3 += CHAN_TX_LIST_FRAMES * 4; ++ } ++ } ++ ++ temp = port->chan_tx_pointers; ++ temp2 = port->chan_tx_buf_phys; ++ for (i = 0; i < CHAN_TX_LISTS; i++) ++ { ++ for (j = 0; j < 32; j++) ++ { ++ *temp = temp2; ++ temp2 += CHAN_TX_LIST_FRAMES; ++ temp++; ++ } ++ } ++ ++ port->chan_rx_buf = dma_alloc_coherent(port->dev, chan_rx_buf_len(port), &port->chan_rx_buf_phys, GFP_DMA); ++ ++ for (i = 0; i < 8; i++) { ++ temp3 = port->chan_rx_buf + (i * 4 * 128); ++ for (j = 0; j < 8; j++) { ++ port->rx_frames[i][j] = temp3; ++ temp3 += CHAN_RX_TRIGGER; ++ } ++ } ++ ++ qmgr_set_irq(queue_ids[port->id].chan, QUEUE_IRQ_SRC_NOT_EMPTY, ++ hss_chan_irq, port); ++ ++ return 0; ++ ++} ++ ++int hss_tx_start(struct hss_device *hdev) ++{ ++ unsigned long flags; ++ struct port *port = hdev->port; ++ ++ hdev->tx_loc = 0; ++ hdev->tx_frame = 0; ++ ++ set_bit((1 << hdev->id), &port->chan_tx_bitmap); ++ ++ if (!port->chan_started) ++ { ++ qmgr_enable_irq(queue_ids[port->id].chan); ++ spin_lock_irqsave(&npe_lock, flags); ++ hss_config_start_chan(port); ++ spin_unlock_irqrestore(&npe_lock, flags); ++ hss_chan_irq(port); ++ } ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_tx_start); ++ ++int hss_rx_start(struct hss_device *hdev) ++{ ++ unsigned long flags; ++ struct port *port = hdev->port; ++ ++ hdev->rx_loc = 0; ++ hdev->rx_frame = 0; ++ ++ set_bit((1 << hdev->id), &port->chan_rx_bitmap); ++ ++ if (!port->chan_started) ++ { ++ qmgr_enable_irq(queue_ids[port->id].chan); ++ spin_lock_irqsave(&npe_lock, flags); ++ hss_config_start_chan(port); ++ spin_unlock_irqrestore(&npe_lock, flags); ++ hss_chan_irq(port); ++ } ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_rx_start); ++ ++int hss_tx_stop(struct hss_device *hdev) ++{ ++ struct port *port = hdev->port; ++ ++ clear_bit((1 << hdev->id), &port->chan_tx_bitmap); ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_tx_stop); ++ ++int hss_rx_stop(struct hss_device *hdev) ++{ ++ struct port *port = hdev->port; ++ ++ clear_bit((1 << hdev->id), &port->chan_rx_bitmap); ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_rx_stop); ++ ++int hss_chan_open(struct hss_device *hdev) ++{ ++ struct port *port = hdev->port; ++ int i, err = 0; ++ ++ if (port->chan_open) ++ return 0; ++ ++ if (port->mode == MODE_HDLC) { ++ err = -ENOSYS; ++ goto out; ++ } ++ ++ if (port->mode == MODE_G704 && port->channels[0] == hdev->id) { ++ err = -EBUSY; /* channel #0 is used for G.704 signaling */ ++ goto out; ++ } ++ ++ for (i = MAX_CHANNELS; i > port->frame_size / 8; i--) ++ if (port->channels[i - 1] == hdev->id) { ++ err = -ECHRNG; /* frame too short */ ++ goto out; ++ } ++ ++ hdev->rx_loc = hdev->tx_loc = 0; ++ hdev->rx_frame = hdev->tx_frame = 0; ++ ++ //clear_bit((1 << hdev->id), &port->chan_rx_bitmap); ++ //clear_bit((1 << hdev->id), &port->chan_tx_bitmap); ++ ++ if (!port->initialized) { ++ hss_prepare_chan(port); ++ ++ hss_config_stop_chan(port); ++ hdev->open_count++; ++ port->chan_open_count++; ++ ++ hss_config_set_lut(port); ++ hss_config_load(port); ++ ++ } ++ port->chan_open = 1; ++ ++out: ++ return err; ++} ++EXPORT_SYMBOL(hss_chan_open); ++ ++int hss_chan_close(struct hss_device *hdev) ++{ ++ return 0; ++} ++EXPORT_SYMBOL(hss_chan_close); ++ ++void hss_chan_read(unsigned long data) ++{ ++ struct port *port = (void *)data; ++ struct hss_device *hdev; ++ u8 *hw_buf, *save_buf; ++ u8 *buf; ++ u32 v; ++ unsigned int tx_list, rx_frame; ++ int i, j, channel; ++ u8 more_work = 0; ++ ++/* ++ My Data in the hardware buffer is scattered by channels into 4 trunks ++ as follows for rx ++ ++ channel 0 channel 1 channel 2 channel 3 ++Trunk 1 = 0 -> 127 128 -> 255 256 -> 383 384 -> 512 ++Trunk 2 = 513 -> 639 640 -> 768 769 -> 895 896 -> 1023 ++Trunk 3 = 1024 -> 1151 1152 -> 1207 1208 -> 1407 1408 -> 1535 ++Trunk 4 = 1535 -> 1663 1664 -> 1791 1792 -> 1920 1921 -> 2047 ++ ++ I will get CHAN_RX_TRIGGER worth of bytes out of each channel on each trunk ++ with each IRQ ++ ++ For TX Data, it is split into 8 lists with each list containing 16 bytes per ++ channel ++ ++Trunk 1 = 0 -> 16 17 -> 32 33 -> 48 49 -> 64 ++Trunk 2 = 65 -> 80 81 -> 96 97 -> 112 113 -> 128 ++Trunk 3 = 129 -> 144 145 -> 160 161 -> 176 177 -> 192 ++Trunk 4 = 193 -> 208 209 -> 224 225 -> 240 241 -> 256 ++ ++*/ ++ ++ ++ while ((v = qmgr_get_entry(queue_ids[port->id].chan))) ++ { ++ tx_list = (v >> 8) & 0xFF; ++ rx_frame = v & 0xFF; ++ ++ if (tx_list == 7) ++ tx_list = 0; ++ else ++ tx_list++; ++ for (channel = 0; channel < 8; channel++) { ++ ++ hdev = port->chan_devices[channel]; ++ if (!hdev) ++ continue; ++ ++ if (test_bit(1 << channel, &port->chan_tx_bitmap)) { ++ buf = (u8 *)hdev->tx_buf + hdev->tx_loc; ++#if 0 ++ hw_buf = (u8 *)port->chan_tx_buf; ++ hw_buf += (tx_list * CHAN_TX_LIST_FRAMES * 32); ++ hw_buf += (4 * CHAN_TX_LIST_FRAMES * channel); ++ save_buf = hw_buf; ++#else ++ save_buf = port->tx_lists[tx_list][channel]; ++#endif ++ for (i = 0; i < CHAN_TX_LIST_FRAMES; i++) { ++ hw_buf = save_buf + i; ++ for (j = 0; j < 4; j++) { ++ *hw_buf = *(buf++); ++ hw_buf += CHAN_TX_LIST_FRAMES; ++ } ++ ++ hdev->tx_loc += 4; ++ hdev->tx_frame++; ++ if (hdev->tx_loc >= hdev->tx_buffer_size) { ++ hdev->tx_loc = 0; ++ buf = (u8 *)hdev->tx_buf; ++ } ++ } ++ } else { ++#if 0 ++ hw_buf = (u8 *)port->chan_tx_buf; ++ hw_buf += (tx_list * CHAN_TX_LIST_FRAMES * 32); ++ hw_buf += (4 * CHAN_TX_LIST_FRAMES * channel); ++#else ++ hw_buf = port->tx_lists[tx_list][channel]; ++#endif ++ memset(hw_buf, 0, 64); ++ } ++ ++ if (hdev->tx_frame >= hdev->tx_period_size && test_bit(1 << channel, &port->chan_tx_bitmap)) ++ { ++ hdev->tx_frame %= hdev->tx_period_size; ++ if (hdev->tx_callback) ++ hdev->tx_callback(hdev->tx_data); ++ more_work = 1; ++ } ++ ++ if (test_bit(1 << channel, &port->chan_rx_bitmap)) { ++ buf = (u8 *)hdev->rx_buf + hdev->rx_loc; ++#if 0 ++ hw_buf = (u8 *)port->chan_rx_buf; ++ hw_buf += (4 * CHAN_RX_FRAMES * channel); ++ hw_buf += rx_frame; ++ save_buf = hw_buf; ++#else ++ save_buf = port->rx_frames[channel][rx_frame >> 4]; ++#endif ++ for (i = 0; i < CHAN_RX_TRIGGER; i++) { ++ hw_buf = save_buf + i; ++ for (j = 0; j < 4; j++) { ++ *(buf++) = *hw_buf; ++ hw_buf += CHAN_RX_FRAMES; ++ } ++ hdev->rx_loc += 4; ++ hdev->rx_frame++; ++ if (hdev->rx_loc >= hdev->rx_buffer_size) { ++ hdev->rx_loc = 0; ++ buf = (u8 *)hdev->rx_buf; ++ } ++ } ++ } ++ ++ if (hdev->rx_frame >= hdev->rx_period_size && test_bit(1 << channel, &port->chan_rx_bitmap)) ++ { ++ hdev->rx_frame %= hdev->rx_period_size; ++ if (hdev->rx_callback) ++ hdev->rx_callback(hdev->rx_data); ++ more_work = 1; ++ } ++ } ++#if 0 ++ if (more_work) ++ { ++ tasklet_hi_schedule(&port->task); ++ return; ++ } ++#endif ++ } ++ ++ qmgr_enable_irq(queue_ids[port->id].chan); ++ ++ return; ++ ++} ++ ++struct hss_device *hss_chan_create(struct port *port, unsigned int channel) ++{ ++ struct hss_device *chan_dev; ++ unsigned long flags; ++ ++ chan_dev = kzalloc(sizeof(struct hss_device), GFP_KERNEL); ++ ++ spin_lock_irqsave(&npe_lock, flags); ++ ++ chan_dev->id = channel; ++ chan_dev->port = port; ++ ++ port->channels[channel] = channel; ++ ++ port->chan_devices[channel] = chan_dev; ++ ++ spin_unlock_irqrestore(&npe_lock, flags); ++ ++ return chan_dev; ++} ++ ++/***************************************************************************** ++ * initialization ++ ****************************************************************************/ ++ ++static struct platform_device gw_avila_hss_device_0 = { ++ .name = "ixp4xx_hss", ++ .id = 0, ++}; ++ ++static struct platform_device gw_avila_hss_device_1 = { ++ .name = "ixp4xx_hss", ++ .id = 1, ++}; ++ ++static struct platform_device *gw_avila_hss_port_0; ++static struct platform_device *gw_avila_hss_port_1; ++static u64 hss_dmamask = 0xFFFFFFFF; ++ ++struct hss_device *hss_init(int id, int channel) ++{ ++ struct port *port = hss_port[id]; ++ struct hss_device *hdev; ++ int ret; ++ ++ if (!lock_init) ++ { ++ spin_lock_init(&npe_lock); ++ lock_init = 1; ++ npe = npe_request(0); ++ } ++ ++ if (!port->init) { ++ if (id == 0) { ++ gw_avila_hss_port_0 = platform_device_alloc("hss-port", 0); ++ ++ platform_set_drvdata(gw_avila_hss_port_0, &gw_avila_hss_device_0); ++ port->dev = &gw_avila_hss_port_0->dev; ++ ++ if (!port->dev->dma_mask) ++ port->dev->dma_mask = &hss_dmamask; ++ if (!port->dev->coherent_dma_mask) ++ port->dev->coherent_dma_mask = 0xFFFFFFFF; ++ ++ ret = platform_device_add(gw_avila_hss_port_0); ++ ++ if (ret) ++ platform_device_put(gw_avila_hss_port_0); ++ ++ tasklet_init(&port->task, hss_chan_read, (unsigned long) port); ++ } ++ else ++ { ++ gw_avila_hss_port_1 = platform_device_alloc("hss-port", 1); ++ ++ platform_set_drvdata(gw_avila_hss_port_1, &gw_avila_hss_device_1); ++ port->dev = &gw_avila_hss_port_1->dev; ++ ++ if (!port->dev->dma_mask) ++ port->dev->dma_mask = &hss_dmamask; ++ if (!port->dev->coherent_dma_mask) ++ port->dev->coherent_dma_mask = 0xFFFFFFFF; ++ ++ ret = platform_device_add(gw_avila_hss_port_1); ++ ++ if (ret) ++ platform_device_put(gw_avila_hss_port_1); ++ ++ tasklet_init(&port->task, hss_chan_read, (unsigned long) port); ++ } ++ ++ port->init = 1; ++ port->id = id; ++ port->clock_type = CLOCK_EXT; ++ port->clock_rate = 8192000; ++ port->frame_size = 256; /* E1 */ ++ port->mode = MODE_RAW; ++ port->next_rx_frame = 0; ++ memset(port->channels, CHANNEL_UNUSED, sizeof(port->channels)); ++ } ++ ++ hdev = hss_chan_create(port, channel); ++ ++ return hdev; ++} ++EXPORT_SYMBOL(hss_init); ++ ++int hss_set_tx_callback(struct hss_device *hdev, void (*tx_callback)(void *), void *tx_data) ++{ ++ BUG_ON(tx_callback == NULL); ++ hdev->tx_callback = tx_callback; ++ hdev->tx_data = tx_data; ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_set_tx_callback); ++ ++int hss_set_rx_callback(struct hss_device *hdev, void (*rx_callback)(void *), void *rx_data) ++{ ++ BUG_ON(rx_callback == NULL); ++ hdev->rx_callback = rx_callback; ++ hdev->rx_data = rx_data; ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_set_rx_callback); ++ ++int hss_config_rx_dma(struct hss_device *hdev, void *buf, size_t buffer_size, size_t period_size) ++{ ++ /* ++ * Period Size and Buffer Size are in Frames which are u32 ++ * We convert the u32 *buf to u8 in order to make channel reads ++ * and rx_loc easier ++ */ ++ ++ hdev->rx_buf = (u8 *)buf; ++ hdev->rx_buffer_size = buffer_size << 2; ++ hdev->rx_period_size = period_size; ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_config_rx_dma); ++ ++int hss_config_tx_dma(struct hss_device *hdev, void *buf, size_t buffer_size, size_t period_size) ++{ ++ /* ++ * Period Size and Buffer Size are in Frames which are u32 ++ * We convert the u32 *buf to u8 in order to make channel reads ++ * and rx_loc easier ++ */ ++ ++ hdev->tx_buf = (u8 *)buf; ++ hdev->tx_buffer_size = buffer_size << 2; ++ hdev->tx_period_size = period_size; ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_config_tx_dma); ++ ++unsigned long hss_curr_offset_rx(struct hss_device *hdev) ++{ ++ return hdev->rx_loc >> 2; ++} ++EXPORT_SYMBOL(hss_curr_offset_rx); ++ ++unsigned long hss_curr_offset_tx(struct hss_device *hdev) ++{ ++ return hdev->tx_loc >> 2; ++} ++EXPORT_SYMBOL(hss_curr_offset_tx); ++ ++MODULE_AUTHOR("Chris Lang"); ++MODULE_DESCRIPTION("Intel IXP4xx HSS Audio driver"); ++MODULE_LICENSE("GPL v2"); +--- /dev/null ++++ b/sound/soc/gw-avila/ixp4xx_hss.h +@@ -0,0 +1,401 @@ ++/* ++ * ++ * ++ * Copyright (C) 2009 Gateworks Corporation ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of version 2 of the GNU General Public License ++ * as published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++//#include XXX We aren't HDLC ++ ++#define DEBUG_QUEUES 0 ++#define DEBUG_DESC 0 ++#define DEBUG_RX 0 ++#define DEBUG_TX 0 ++#define DEBUG_PKT_BYTES 0 ++#define DEBUG_CLOSE 0 ++#define DEBUG_FRAMER 0 ++ ++#define DRV_NAME "ixp4xx_hss" ++ ++#define PKT_EXTRA_FLAGS 0 /* orig 1 */ ++#define TX_FRAME_SYNC_OFFSET 0 /* channelized */ ++#define PKT_NUM_PIPES 1 /* 1, 2 or 4 */ ++#define PKT_PIPE_FIFO_SIZEW 4 /* total 4 dwords per HSS */ ++ ++#define RX_DESCS 512 /* also length of all RX queues */ ++#define TX_DESCS 512 /* also length of all TX queues */ ++ ++//#define POOL_ALLOC_SIZE (sizeof(struct desc) * (RX_DESCS + TX_DESCS)) ++#define RX_SIZE (HDLC_MAX_MRU + 4) /* NPE needs more space */ ++#define MAX_CLOSE_WAIT 1000 /* microseconds */ ++#define HSS_COUNT 2 ++#define MIN_FRAME_SIZE 16 /* bits */ ++#define MAX_FRAME_SIZE 257 /* 256 bits + framing bit */ ++#define MAX_CHANNELS (MAX_FRAME_SIZE / 8) ++#define MAX_CHAN_DEVICES 32 ++#define CHANNEL_HDLC 0xFE ++#define CHANNEL_UNUSED 0xFF ++ ++#define NAPI_WEIGHT 16 ++#define CHAN_RX_TRIGGER 16 /* 8 RX frames = 1 ms @ E1 */ ++#define CHAN_RX_FRAMES 128 ++#define CHAN_RX_TRUNKS 1 ++#define MAX_CHAN_RX_BAD_SYNC (CHAN_RX_TRIGGER / 2 /* pairs */ - 3) ++ ++#define CHAN_TX_LIST_FRAMES CHAN_RX_TRIGGER /* bytes/channel per list, 16 - 48 */ ++#define CHAN_TX_LISTS 8 ++#define CHAN_TX_TRUNKS CHAN_RX_TRUNKS ++#define CHAN_TX_FRAMES (CHAN_TX_LIST_FRAMES * CHAN_TX_LISTS) ++ ++#define CHAN_QUEUE_LEN 32 /* minimum possible */ ++ ++#define chan_rx_buf_len(port) (port->frame_size / 8 * CHAN_RX_FRAMES * CHAN_RX_TRUNKS) ++#define chan_tx_buf_len(port) (port->frame_size / 8 * CHAN_TX_FRAMES * CHAN_TX_TRUNKS) ++ ++/* Queue IDs */ ++#define HSS0_CHL_RXTRIG_QUEUE 12 /* orig size = 32 dwords */ ++#define HSS0_PKT_RX_QUEUE 13 /* orig size = 32 dwords */ ++#define HSS0_PKT_TX0_QUEUE 14 /* orig size = 16 dwords */ ++#define HSS0_PKT_TX1_QUEUE 15 ++#define HSS0_PKT_TX2_QUEUE 16 ++#define HSS0_PKT_TX3_QUEUE 17 ++#define HSS0_PKT_RXFREE0_QUEUE 18 /* orig size = 16 dwords */ ++#define HSS0_PKT_RXFREE1_QUEUE 19 ++#define HSS0_PKT_RXFREE2_QUEUE 20 ++#define HSS0_PKT_RXFREE3_QUEUE 21 ++#define HSS0_PKT_TXDONE_QUEUE 22 /* orig size = 64 dwords */ ++ ++#define HSS1_CHL_RXTRIG_QUEUE 10 ++#define HSS1_PKT_RX_QUEUE 0 ++#define HSS1_PKT_TX0_QUEUE 5 ++#define HSS1_PKT_TX1_QUEUE 6 ++#define HSS1_PKT_TX2_QUEUE 7 ++#define HSS1_PKT_TX3_QUEUE 8 ++#define HSS1_PKT_RXFREE0_QUEUE 1 ++#define HSS1_PKT_RXFREE1_QUEUE 2 ++#define HSS1_PKT_RXFREE2_QUEUE 3 ++#define HSS1_PKT_RXFREE3_QUEUE 4 ++#define HSS1_PKT_TXDONE_QUEUE 9 ++ ++#define NPE_PKT_MODE_HDLC 0 ++#define NPE_PKT_MODE_RAW 1 ++#define NPE_PKT_MODE_56KMODE 2 ++#define NPE_PKT_MODE_56KENDIAN_MSB 4 ++ ++/* PKT_PIPE_HDLC_CFG_WRITE flags */ ++#define PKT_HDLC_IDLE_ONES 0x1 /* default = flags */ ++#define PKT_HDLC_CRC_32 0x2 /* default = CRC-16 */ ++#define PKT_HDLC_MSB_ENDIAN 0x4 /* default = LE */ ++ ++ ++/* hss_config, PCRs */ ++/* Frame sync sampling, default = active low */ ++#define PCR_FRM_SYNC_ACTIVE_HIGH 0x40000000 ++#define PCR_FRM_SYNC_FALLINGEDGE 0x80000000 ++#define PCR_FRM_SYNC_RISINGEDGE 0xC0000000 ++ ++/* Frame sync pin: input (default) or output generated off a given clk edge */ ++#define PCR_FRM_SYNC_OUTPUT_FALLING 0x20000000 ++#define PCR_FRM_SYNC_OUTPUT_RISING 0x30000000 ++ ++/* Frame and data clock sampling on edge, default = falling */ ++#define PCR_FCLK_EDGE_RISING 0x08000000 ++#define PCR_DCLK_EDGE_RISING 0x04000000 ++ ++/* Clock direction, default = input */ ++#define PCR_SYNC_CLK_DIR_OUTPUT 0x02000000 ++ ++/* Generate/Receive frame pulses, default = enabled */ ++#define PCR_FRM_PULSE_DISABLED 0x01000000 ++ ++ /* Data rate is full (default) or half the configured clk speed */ ++#define PCR_HALF_CLK_RATE 0x00200000 ++ ++/* Invert data between NPE and HSS FIFOs? (default = no) */ ++#define PCR_DATA_POLARITY_INVERT 0x00100000 ++ ++/* TX/RX endianness, default = LSB */ ++#define PCR_MSB_ENDIAN 0x00080000 ++ ++/* Normal (default) / open drain mode (TX only) */ ++#define PCR_TX_PINS_OPEN_DRAIN 0x00040000 ++ ++/* No framing bit transmitted and expected on RX? (default = framing bit) */ ++#define PCR_SOF_NO_FBIT 0x00020000 ++ ++/* Drive data pins? */ ++#define PCR_TX_DATA_ENABLE 0x00010000 ++ ++/* Voice 56k type: drive the data pins low (default), high, high Z */ ++#define PCR_TX_V56K_HIGH 0x00002000 ++#define PCR_TX_V56K_HIGH_IMP 0x00004000 ++ ++/* Unassigned type: drive the data pins low (default), high, high Z */ ++#define PCR_TX_UNASS_HIGH 0x00000800 ++#define PCR_TX_UNASS_HIGH_IMP 0x00001000 ++ ++/* T1 @ 1.544MHz only: Fbit dictated in FIFO (default) or high Z */ ++#define PCR_TX_FB_HIGH_IMP 0x00000400 ++ ++/* 56k data endiannes - which bit unused: high (default) or low */ ++#define PCR_TX_56KE_BIT_0_UNUSED 0x00000200 ++ ++/* 56k data transmission type: 32/8 bit data (default) or 56K data */ ++#define PCR_TX_56KS_56K_DATA 0x00000100 ++ ++/* hss_config, cCR */ ++/* Number of packetized clients, default = 1 */ ++#define CCR_NPE_HFIFO_2_HDLC 0x04000000 ++#define CCR_NPE_HFIFO_3_OR_4HDLC 0x08000000 ++ ++/* default = no loopback */ ++#define CCR_LOOPBACK 0x02000000 ++ ++/* HSS number, default = 0 (first) */ ++#define CCR_SECOND_HSS 0x01000000 ++ ++ ++/* hss_config, clkCR: main:10, num:10, denom:12 */ ++#define CLK42X_SPEED_EXP ((0x3FF << 22) | ( 2 << 12) | 15) /*65 KHz*/ ++ ++#define CLK42X_SPEED_512KHZ (( 130 << 22) | ( 2 << 12) | 15) ++#define CLK42X_SPEED_1536KHZ (( 43 << 22) | ( 18 << 12) | 47) ++#define CLK42X_SPEED_1544KHZ (( 43 << 22) | ( 33 << 12) | 192) ++#define CLK42X_SPEED_2048KHZ (( 32 << 22) | ( 34 << 12) | 63) ++#define CLK42X_SPEED_4096KHZ (( 16 << 22) | ( 34 << 12) | 127) ++#define CLK42X_SPEED_8192KHZ (( 8 << 22) | ( 34 << 12) | 255) ++ ++#define CLK46X_SPEED_512KHZ (( 130 << 22) | ( 24 << 12) | 127) ++#define CLK46X_SPEED_1536KHZ (( 43 << 22) | (152 << 12) | 383) ++#define CLK46X_SPEED_1544KHZ (( 43 << 22) | ( 66 << 12) | 385) ++#define CLK46X_SPEED_2048KHZ (( 32 << 22) | (280 << 12) | 511) ++#define CLK46X_SPEED_4096KHZ (( 16 << 22) | (280 << 12) | 1023) ++#define CLK46X_SPEED_8192KHZ (( 8 << 22) | (280 << 12) | 2047) ++ ++ ++/* hss_config, LUT entries */ ++#define TDMMAP_UNASSIGNED 0 ++#define TDMMAP_HDLC 1 /* HDLC - packetized */ ++#define TDMMAP_VOICE56K 2 /* Voice56K - 7-bit channelized */ ++#define TDMMAP_VOICE64K 3 /* Voice64K - 8-bit channelized */ ++ ++/* offsets into HSS config */ ++#define HSS_CONFIG_TX_PCR 0x00 /* port configuration registers */ ++#define HSS_CONFIG_RX_PCR 0x04 ++#define HSS_CONFIG_CORE_CR 0x08 /* loopback control, HSS# */ ++#define HSS_CONFIG_CLOCK_CR 0x0C /* clock generator control */ ++#define HSS_CONFIG_TX_FCR 0x10 /* frame configuration registers */ ++#define HSS_CONFIG_RX_FCR 0x14 ++#define HSS_CONFIG_TX_LUT 0x18 /* channel look-up tables */ ++#define HSS_CONFIG_RX_LUT 0x38 ++ ++ ++/* NPE command codes */ ++/* writes the ConfigWord value to the location specified by offset */ ++#define PORT_CONFIG_WRITE 0x40 ++ ++/* triggers the NPE to load the contents of the configuration table */ ++#define PORT_CONFIG_LOAD 0x41 ++ ++/* triggers the NPE to return an HssErrorReadResponse message */ ++#define PORT_ERROR_READ 0x42 ++ ++/* reset NPE internal status and enable the HssChannelized operation */ ++#define CHAN_FLOW_ENABLE 0x43 ++#define CHAN_FLOW_DISABLE 0x44 ++#define CHAN_IDLE_PATTERN_WRITE 0x45 ++#define CHAN_NUM_CHANS_WRITE 0x46 ++#define CHAN_RX_BUF_ADDR_WRITE 0x47 ++#define CHAN_RX_BUF_CFG_WRITE 0x48 ++#define CHAN_TX_BLK_CFG_WRITE 0x49 ++#define CHAN_TX_BUF_ADDR_WRITE 0x4A ++#define CHAN_TX_BUF_SIZE_WRITE 0x4B ++#define CHAN_TSLOTSWITCH_ENABLE 0x4C ++#define CHAN_TSLOTSWITCH_DISABLE 0x4D ++ ++/* downloads the gainWord value for a timeslot switching channel associated ++ with bypassNum */ ++#define CHAN_TSLOTSWITCH_GCT_DOWNLOAD 0x4E ++ ++/* triggers the NPE to reset internal status and enable the HssPacketized ++ operation for the flow specified by pPipe */ ++#define PKT_PIPE_FLOW_ENABLE 0x50 ++#define PKT_PIPE_FLOW_DISABLE 0x51 ++#define PKT_NUM_PIPES_WRITE 0x52 ++#define PKT_PIPE_FIFO_SIZEW_WRITE 0x53 ++#define PKT_PIPE_HDLC_CFG_WRITE 0x54 ++#define PKT_PIPE_IDLE_PATTERN_WRITE 0x55 ++#define PKT_PIPE_RX_SIZE_WRITE 0x56 ++#define PKT_PIPE_MODE_WRITE 0x57 ++ ++/* HDLC packet status values - desc->status */ ++#define ERR_SHUTDOWN 1 /* stop or shutdown occurrance */ ++#define ERR_HDLC_ALIGN 2 /* HDLC alignment error */ ++#define ERR_HDLC_FCS 3 /* HDLC Frame Check Sum error */ ++#define ERR_RXFREE_Q_EMPTY 4 /* RX-free queue became empty while receiving ++ this packet (if buf_len < pkt_len) */ ++#define ERR_HDLC_TOO_LONG 5 /* HDLC frame size too long */ ++#define ERR_HDLC_ABORT 6 /* abort sequence received */ ++#define ERR_DISCONNECTING 7 /* disconnect is in progress */ ++ ++#define CLOCK_EXT 0 ++#define CLOCK_INT 1 ++ ++enum mode {MODE_HDLC = 0, MODE_RAW, MODE_G704}; ++enum rx_tx_bit { ++ TX_BIT = 0, ++ RX_BIT = 1 ++}; ++enum chan_bit { ++ CHAN_0 = (1 << 0), ++ CHAN_1 = (1 << 1), ++ CHAN_2 = (1 << 2), ++ CHAN_3 = (1 << 3), ++ CHAN_4 = (1 << 4), ++ CHAN_5 = (1 << 5), ++ CHAN_6 = (1 << 6), ++ CHAN_7 = (1 << 7), ++ CHAN_8 = (1 << 8), ++ CHAN_9 = (1 << 9), ++ CHAN_10 = (1 << 10), ++ CHAN_11 = (1 << 11), ++ CHAN_12 = (1 << 12), ++ CHAN_13 = (1 << 13), ++ CHAN_14 = (1 << 14), ++ CHAN_15 = (1 << 15) ++}; ++ ++enum alignment { NOT_ALIGNED = 0, EVEN_FIRST, ODD_FIRST }; ++ ++#ifdef __ARMEB__ ++typedef struct sk_buff buffer_t; ++#define free_buffer dev_kfree_skb ++#define free_buffer_irq dev_kfree_skb_irq ++#else ++typedef void buffer_t; ++#define free_buffer kfree ++#define free_buffer_irq kfree ++#endif ++ ++struct hss_device { ++ struct port *port; ++ unsigned int open_count, excl_open; ++ unsigned long tx_loc, rx_loc; /* bytes */ ++ unsigned long tx_frame, rx_frame; /* Frames */ ++ u8 id, chan_count; ++ u8 log_channels[MAX_CHANNELS]; ++ ++ u8 *rx_buf; ++ u8 *tx_buf; ++ ++ size_t rx_buffer_size; ++ size_t rx_period_size; ++ size_t tx_buffer_size; ++ size_t tx_period_size; ++ ++ void (*rx_callback)(void *data); ++ void *rx_data; ++ void (*tx_callback)(void *data); ++ void *tx_data; ++ void *private_data; ++}; ++ ++extern struct hss_device *hss_handle[32]; ++extern struct port *hss_port[2]; ++ ++struct port { ++ unsigned char init; ++ ++ struct device *dev; ++ ++ struct tasklet_struct task; ++ unsigned int id; ++ unsigned long chan_rx_bitmap; ++ unsigned long chan_tx_bitmap; ++ unsigned char chan_open; ++ ++ /* the following fields must be protected by npe_lock */ ++ enum mode mode; ++ unsigned int clock_type, clock_rate, loopback; ++ unsigned int frame_size, frame_sync_offset; ++ unsigned int next_rx_frame; ++ ++ struct hss_device *chan_devices[MAX_CHAN_DEVICES]; ++ u32 chan_tx_buf_phys, chan_rx_buf_phys; ++ u32 chan_tx_pointers_phys; ++ u32 *chan_tx_pointers; ++ u8 *chan_rx_buf; ++ u8 *chan_tx_buf; ++ u8 *tx_lists[CHAN_TX_LISTS][8]; ++ u8 *rx_frames[8][CHAN_TX_LISTS]; ++ unsigned int chan_open_count, hdlc_open; ++ unsigned int chan_started, initialized, just_set_offset; ++ unsigned int chan_last_rx, chan_last_tx; ++ ++ /* assigned channels, may be invalid with given frame length or mode */ ++ u8 channels[MAX_CHANNELS]; ++ int msg_count; ++}; ++ ++/* NPE message structure */ ++struct msg { ++#ifdef __ARMEB__ ++ u8 cmd, unused, hss_port, index; ++ union { ++ struct { u8 data8a, data8b, data8c, data8d; }; ++ struct { u16 data16a, data16b; }; ++ struct { u32 data32; }; ++ }; ++#else ++ u8 index, hss_port, unused, cmd; ++ union { ++ struct { u8 data8d, data8c, data8b, data8a; }; ++ struct { u16 data16b, data16a; }; ++ struct { u32 data32; }; ++ }; ++#endif ++}; ++ ++#define rx_desc_phys(port, n) ((port)->desc_tab_phys + \ ++ (n) * sizeof(struct desc)) ++#define rx_desc_ptr(port, n) (&(port)->desc_tab[n]) ++ ++#define tx_desc_phys(port, n) ((port)->desc_tab_phys + \ ++ ((n) + RX_DESCS) * sizeof(struct desc)) ++#define tx_desc_ptr(port, n) (&(port)->desc_tab[(n) + RX_DESCS]) ++ ++int hss_prepare_chan(struct port *port); ++void hss_chan_stop(struct port *port); ++ ++struct hss_device *hss_init(int id, int channel); ++int hss_chan_open(struct hss_device *hdev); ++int hss_chan_close(struct hss_device *hdev); ++ ++int hss_set_tx_callback(struct hss_device *hdev, void (*tx_callback)(void *), void *tx_data); ++int hss_set_rx_callback(struct hss_device *hdev, void (*rx_callback)(void *), void *rx_data); ++int hss_tx_start(struct hss_device *hdev); ++int hss_tx_stop(struct hss_device *hdev); ++int hss_rx_start(struct hss_device *hdev); ++int hss_rx_stop(struct hss_device *hdev); ++ ++int hss_config_rx_dma(struct hss_device *hdev, void *buf, size_t buffer_size, size_t period_size); ++int hss_config_tx_dma(struct hss_device *hdev, void *buf, size_t buffer_size, size_t period_size); ++unsigned long hss_curr_offset_rx(struct hss_device *hdev); ++unsigned long hss_curr_offset_tx(struct hss_device *hdev); ++ diff --git a/target/linux/ixp4xx/patches-4.9/180-tw5334_support.patch b/target/linux/ixp4xx/patches-4.9/180-tw5334_support.patch new file mode 100644 index 0000000000..b56fbb732d --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/180-tw5334_support.patch @@ -0,0 +1,287 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -160,6 +160,14 @@ config ARCH_PRPMC1100 + PrPCM1100 Processor Mezanine Module. For more information on + this platform, see . + ++config MACH_TW5334 ++ bool "Titan Wireless TW-533-4" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support the Titan ++ Wireless TW533-4. For more information on this platform, ++ see http://openwrt.org ++ + config MACH_NAS100D + bool + prompt "NAS100D" +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -24,6 +24,7 @@ obj-pci-$(CONFIG_MACH_SIDEWINDER) += sid + obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o + obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o ++obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o + + obj-y += common.o + +@@ -49,6 +50,7 @@ obj-$(CONFIG_MACH_SIDEWINDER) += sidewin + obj-$(CONFIG_MACH_COMPEXWP18) += compex42x-setup.o + obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o + obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o ++obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h ++++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h +@@ -44,7 +44,7 @@ static __inline__ void __arch_decomp_set + machine_is_gateway7001() || machine_is_wg302v2() || + machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() || + machine_is_pronghorn() || machine_is_pronghorn_metro() || +- machine_is_wrt300nv2()) ++ machine_is_wrt300nv2() || machine_is_tw5334()) + uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; + else + uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/tw5334-pci.c +@@ -0,0 +1,68 @@ ++/* ++ * arch/arch/mach-ixp4xx/tw5334-pci.c ++ * ++ * PCI setup routines for the Titan Wireless TW-533-4 ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++ ++void __init tw5334_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO2, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO1, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO0, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init tw5334_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 12) ++ return IRQ_IXP4XX_GPIO6; ++ else if (slot == 13) ++ return IRQ_IXP4XX_GPIO2; ++ else if (slot == 14) ++ return IRQ_IXP4XX_GPIO1; ++ else if (slot == 15) ++ return IRQ_IXP4XX_GPIO0; ++ else return -1; ++} ++ ++struct hw_pci tw5334_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = tw5334_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = tw5334_map_irq, ++}; ++ ++int __init tw5334_pci_init(void) ++{ ++ if (machine_is_tw5334()) ++ pci_common_init(&tw5334_pci); ++ return 0; ++} ++ ++subsys_initcall(tw5334_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/tw5334-setup.c +@@ -0,0 +1,167 @@ ++/* ++ * arch/arm/mach-ixp4xx/tw5334-setup.c ++ * ++ * Board setup for the Titan Wireless TW-533-4 ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct flash_platform_data tw5334_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource tw5334_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device tw5334_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &tw5334_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &tw5334_flash_resource, ++}; ++ ++static struct resource tw5334_uart_resource = { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct plat_serial8250_port tw5334_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device tw5334_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = tw5334_uart_data, ++ }, ++ .num_resources = 1, ++ .resource = &tw5334_uart_resource, ++}; ++ ++/* Built-in 10/100 Ethernet MAC interfaces */ ++static struct eth_plat_info tw5334_plat_eth[] = { ++ { ++ .phy = 0, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device tw5334_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = tw5334_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = tw5334_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *tw5334_devices[] __initdata = { ++ &tw5334_flash, ++ &tw5334_uart, ++ &tw5334_eth[0], ++ &tw5334_eth[1], ++}; ++ ++static void __init tw5334_init(void) ++{ ++ uint8_t __iomem *f; ++ int i; ++ ++ ixp4xx_sys_init(); ++ ++ tw5334_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ tw5334_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(tw5334_devices, ARRAY_SIZE(tw5334_devices)); ++ ++ /* ++ * Map in a portion of the flash and read the MAC addresses. ++ * Since it is stored in BE in the flash itself, we need to ++ * byteswap it if we're in LE mode. ++ */ ++ f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x1000000); ++ if (f) { ++ for (i = 0; i < 6; i++) { ++#ifdef __ARMEB__ ++ tw5334_plat_eth[0].hwaddr[i] = readb(f + 0xFC0422 + i); ++ tw5334_plat_eth[1].hwaddr[i] = readb(f + 0xFC043B + i); ++#else ++ tw5334_plat_eth[0].hwaddr[i] = readb(f + 0xFC0422 + (i^3)); ++ tw5334_plat_eth[1].hwaddr[i] = readb(f + 0xFC043B + (i^3)); ++#endif ++ } ++ iounmap(f); ++ } ++ ++ printk(KERN_INFO "TW-533-4: Using MAC address %pM for port 0\n", ++ tw5334_plat_eth[0].hwaddr); ++ printk(KERN_INFO "TW-533-4: Using MAC address %pM for port 1\n", ++ tw5334_plat_eth[1].hwaddr); ++} ++ ++#ifdef CONFIG_MACH_TW5334 ++MACHINE_START(TW5334, "Titan Wireless TW-533-4") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = tw5334_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++#endif diff --git a/target/linux/ixp4xx/patches-4.9/185-mi424wr_support.patch b/target/linux/ixp4xx/patches-4.9/185-mi424wr_support.patch new file mode 100644 index 0000000000..7c229276fc --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/185-mi424wr_support.patch @@ -0,0 +1,504 @@ +--- a/arch/arm/configs/ixp4xx_defconfig ++++ b/arch/arm/configs/ixp4xx_defconfig +@@ -26,6 +26,7 @@ CONFIG_MACH_NAS100D=y + CONFIG_MACH_DSMG600=y + CONFIG_MACH_FSG=y + CONFIG_MACH_GTWX5715=y ++CONFIG_MACH_MI424WR=y + CONFIG_IXP4XX_QMGR=y + CONFIG_IXP4XX_NPE=y + # CONFIG_ARM_THUMB is not set +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -258,6 +258,13 @@ config MACH_MIC256 + Say 'Y' here if you want your kernel to support the MIC256 + board from OMICRON electronics GmbH. + ++config MACH_MI424WR ++ bool "Actiontec MI424WR" ++ depends on ARCH_IXP4XX ++ select PCI ++ help ++ Add support for the Actiontec MI424-WR. ++ + comment "IXP4xx Options" + + config IXP4XX_INDIRECT_PCI +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -25,6 +25,7 @@ obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixd + obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o + obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o ++obj-pci-$(CONFIG_MACH_MI424WR) += mi424wr-pci.o + + obj-y += common.o + +@@ -51,6 +52,7 @@ obj-$(CONFIG_MACH_COMPEXWP18) += compex4 + obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o + obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o + obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o ++obj-$(CONFIG_MACH_MI424WR) += mi424wr-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/mi424wr-pci.c +@@ -0,0 +1,70 @@ ++/* ++ * arch/arm/mach-ixp4xx/mi424wr-pci.c ++ * ++ * Actiontec MI424WR board-level PCI initialization ++ * ++ * Copyright (C) 2008 Jose Vasconcellos ++ * ++ * Maintainer: Jose Vasconcellos ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++/* PCI controller GPIO to IRQ pin mappings ++ * This information was obtained from Actiontec's GPL release. ++ * ++ * INTA INTB ++ * SLOT 13 8 6 ++ * SLOT 14 7 8 ++ * SLOT 15 6 7 ++ */ ++ ++void __init mi424wr_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO7, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init mi424wr_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 13) ++ return IRQ_IXP4XX_GPIO8; ++ if (slot == 14) ++ return IRQ_IXP4XX_GPIO7; ++ if (slot == 15) ++ return IRQ_IXP4XX_GPIO6; ++ ++ return -1; ++} ++ ++struct hw_pci mi424wr_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = mi424wr_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = mi424wr_map_irq, ++}; ++ ++int __init mi424wr_pci_init(void) ++{ ++ if (machine_is_mi424wr()) ++ pci_common_init(&mi424wr_pci); ++ return 0; ++} ++ ++subsys_initcall(mi424wr_pci_init); ++ +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/mi424wr-setup.c +@@ -0,0 +1,384 @@ ++/* ++ * arch/arm/mach-ixp4xx/mi424wr-setup.c ++ * ++ * Actiontec MI424-WR board setup ++ * Copyright (c) 2008 Jose Vasconcellos ++ * ++ * Based on Gemtek GTWX5715 by ++ * Copyright (C) 2004 George T. Joseph ++ * Derived from Coyote ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version 2 ++ * of the License, or (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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* ++ * GPIO 2,3,4 and 9 are hard wired to the Micrel/Kendin KS8995M Switch ++ * and operate as an SPI type interface. The details of the interface ++ * are available on Kendin/Micrel's web site. ++ */ ++ ++#define MI424WR_KSSPI_SELECT 9 ++#define MI424WR_KSSPI_TXD 4 ++#define MI424WR_KSSPI_CLOCK 2 ++#define MI424WR_KSSPI_RXD 3 ++ ++/* ++ * The "reset" button is wired to GPIO 10. ++ * The GPIO is brought "low" when the button is pushed. ++ */ ++ ++#define MI424WR_BUTTON_GPIO 10 ++#define MI424WR_BUTTON_IRQ IRQ_IXP4XX_GPIO10 ++ ++#define MI424WR_MOCA_WAN_LED 11 ++ ++/* Latch on CS1 - taken from Actiontec's 2.4 source code ++ * ++ * default latch value ++ * 0 - power alarm led (red) 0 (off) ++ * 1 - power led (green) 0 (off) ++ * 2 - wireless led (green) 1 (off) ++ * 3 - no internet led (red) 0 (off) ++ * 4 - internet ok led (green) 0 (off) ++ * 5 - moca LAN 0 (off) ++ * 6 - WAN alarm led (red) 0 (off) ++ * 7 - PCI reset 1 (not reset) ++ * 8 - IP phone 1 led (green) 1 (off) ++ * 9 - IP phone 2 led (green) 1 (off) ++ * 10 - VOIP ready led (green) 1 (off) ++ * 11 - PSTN relay 1 control 0 (PSTN) ++ * 12 - PSTN relay 1 control 0 (PSTN) ++ * 13 - N/A ++ * 14 - N/A ++ * 15 - N/A ++ */ ++ ++#define MI424WR_LATCH_MASK 0x04 ++#define MI424WR_LATCH_DEFAULT 0x1f86 ++ ++#define MI424WR_LATCH_ALARM_LED 0x00 ++#define MI424WR_LATCH_POWER_LED 0x01 ++#define MI424WR_LATCH_WIRELESS_LED 0x02 ++#define MI424WR_LATCH_INET_DOWN_LED 0x03 ++#define MI424WR_LATCH_INET_OK_LED 0x04 ++#define MI424WR_LATCH_MOCA_LAN_LED 0x05 ++#define MI424WR_LATCH_WAN_ALARM_LED 0x06 ++#define MI424WR_LATCH_PCI_RESET 0x07 ++#define MI424WR_LATCH_PHONE1_LED 0x08 ++#define MI424WR_LATCH_PHONE2_LED 0x09 ++#define MI424WR_LATCH_VOIP_LED 0x10 ++#define MI424WR_LATCH_PSTN_RELAY1 0x11 ++#define MI424WR_LATCH_PSTN_RELAY2 0x12 ++ ++/* initialize CS1 to default timings, Intel style, 16-bit bus */ ++#define MI424WR_CS1_CONFIG 0x80000002 ++ ++/* Define both UARTs but they are not easily accessible. ++ */ ++ ++static struct resource mi424wr_uart_resources[] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ } ++}; ++ ++ ++static struct plat_serial8250_port mi424wr_uart_platform_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device mi424wr_uart_device = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev.platform_data = mi424wr_uart_platform_data, ++ .num_resources = ARRAY_SIZE(mi424wr_uart_resources), ++ .resource = mi424wr_uart_resources, ++}; ++ ++static struct flash_platform_data mi424wr_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource mi424wr_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device mi424wr_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev.platform_data = &mi424wr_flash_data, ++ .num_resources = 1, ++ .resource = &mi424wr_flash_resource, ++}; ++ ++static struct spi_gpio_platform_data mi424wr_spi_platform_data = { ++ .sck = MI424WR_KSSPI_CLOCK, ++ .mosi = MI424WR_KSSPI_TXD, ++ .miso = MI424WR_KSSPI_RXD, ++ .num_chipselect = 1, ++}; ++ ++static struct platform_device mi424wr_spi_device = { ++ .name = "spi-gpio", ++ .id = 1, ++ .dev.platform_data = &mi424wr_spi_platform_data, ++}; ++ ++static struct spi_board_info mi424wr_spi_devices[] __initdata = { ++ { ++ .modalias = "spi-ks8995", ++ .max_speed_hz = 500000, ++ .mode = SPI_MODE_0, ++ .bus_num = 1, ++ .chip_select = 0, ++ .controller_data = (void *)MI424WR_KSSPI_SELECT, ++ } ++}; ++ ++static struct gpio_led mi424wr_gpio_led[] = { ++ { ++ .name = "moca-wan", /* green led */ ++ .gpio = MI424WR_MOCA_WAN_LED, ++ .active_low = 0, ++ } ++}; ++ ++static struct gpio_led_platform_data mi424wr_gpio_leds_data = { ++ .num_leds = 1, ++ .leds = mi424wr_gpio_led, ++}; ++ ++static struct platform_device mi424wr_gpio_leds = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev.platform_data = &mi424wr_gpio_leds_data, ++}; ++ ++static uint16_t latch_value = MI424WR_LATCH_DEFAULT; ++static uint16_t __iomem *iobase; ++ ++static void mi424wr_latch_set_led(u8 bit, enum led_brightness value) ++{ ++ ++ if (((MI424WR_LATCH_MASK >> bit) & 1) ^ (value == LED_OFF)) ++ latch_value &= ~(0x1 << bit); ++ else ++ latch_value |= (0x1 << bit); ++ ++ __raw_writew(latch_value, iobase); ++ ++} ++ ++static struct latch_led mi424wr_latch_led[] = { ++ { ++ .name = "power-alarm", ++ .bit = MI424WR_LATCH_ALARM_LED, ++ }, ++ { ++ .name = "power-ok", ++ .bit = MI424WR_LATCH_POWER_LED, ++ }, ++ { ++ .name = "wireless", /* green led */ ++ .bit = MI424WR_LATCH_WIRELESS_LED, ++ }, ++ { ++ .name = "inet-down", /* red led */ ++ .bit = MI424WR_LATCH_INET_DOWN_LED, ++ }, ++ { ++ .name = "inet-up", /* green led */ ++ .bit = MI424WR_LATCH_INET_OK_LED, ++ }, ++ { ++ .name = "moca-lan", /* green led */ ++ .bit = MI424WR_LATCH_MOCA_LAN_LED, ++ }, ++ { ++ .name = "wan-alarm", /* red led */ ++ .bit = MI424WR_LATCH_WAN_ALARM_LED, ++ } ++}; ++ ++static struct latch_led_platform_data mi424wr_latch_leds_data = { ++ .num_leds = ARRAY_SIZE(mi424wr_latch_led), ++ .mem = 0x51000000, ++ .leds = mi424wr_latch_led, ++ .set_led = mi424wr_latch_set_led, ++}; ++ ++static struct platform_device mi424wr_latch_leds = { ++ .name = "leds-latch", ++ .id = -1, ++ .dev.platform_data = &mi424wr_latch_leds_data, ++}; ++ ++static struct eth_plat_info mi424wr_wan_data = { ++ .phy = 17, /* KS8721 */ ++ .rxq = 3, ++ .txreadyq = 20, ++}; ++ ++static struct eth_plat_info mi424wr_lan_data = { ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x1e, /* ports 1-4 of the KS8995 switch */ ++ .rxq = 4, ++ .txreadyq = 21, ++}; ++ ++static struct platform_device mi424wr_npe_devices[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = &mi424wr_lan_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = &mi424wr_wan_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct eth_plat_info mi424wr_wanD_data = { ++ .phy = 5, ++ .rxq = 4, ++ .txreadyq = 21, ++}; ++ ++static struct eth_plat_info mi424wr_lanD_data = { ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x1e, /* ports 1-4 of the KS8995 switch */ ++ .rxq = 3, ++ .txreadyq = 20, ++}; ++ ++static struct platform_device mi424wr_npeD_devices[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = &mi424wr_lanD_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = &mi424wr_wanD_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *mi424wr_devices[] __initdata = { ++ &mi424wr_uart_device, ++ &mi424wr_flash, ++ &mi424wr_spi_device, ++ &mi424wr_gpio_leds, ++ &mi424wr_latch_leds, ++}; ++ ++static void __init mi424wr_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ mi424wr_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ mi424wr_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_8M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = MI424WR_CS1_CONFIG; ++ ++ /* configure button as input ++ */ ++ gpio_line_config(MI424WR_BUTTON_GPIO, IXP4XX_GPIO_IN); ++ ++ /* Initialize LEDs and enables PCI bus. ++ */ ++ iobase = ioremap_nocache(IXP4XX_EXP_BUS_BASE(1), 0x1000); ++ __raw_writew(latch_value, iobase); ++ ++ spi_register_board_info(mi424wr_spi_devices, ARRAY_SIZE(mi424wr_spi_devices)); ++ platform_add_devices(mi424wr_devices, ARRAY_SIZE(mi424wr_devices)); ++ ++ /* Need to figure out how to detect revD. ++ * Look for a revision argument sent by redboot. ++ */ ++#define revD 4 ++ if (system_rev == revD) { ++ platform_device_register(&mi424wr_npeD_devices[0]); ++ platform_device_register(&mi424wr_npeD_devices[1]); ++ } else { ++ platform_device_register(&mi424wr_npe_devices[0]); ++ platform_device_register(&mi424wr_npe_devices[1]); ++ } ++} ++ ++ ++MACHINE_START(MI424WR, "Actiontec MI424WR") ++ /* Maintainer: Jose Vasconcellos */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = mi424wr_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++ diff --git a/target/linux/ixp4xx/patches-4.9/190-cambria_support.patch b/target/linux/ixp4xx/patches-4.9/190-cambria_support.patch new file mode 100644 index 0000000000..83a3319261 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/190-cambria_support.patch @@ -0,0 +1,1131 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -21,6 +21,14 @@ config MACH_AVILA + Avila Network Platform. For more information on this platform, + see . + ++config MACH_CAMBRIA ++ bool "Cambria" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support the Gateworks ++ Cambria series. For more information on this platform, ++ see . ++ + config MACH_LOFT + bool "Loft" + depends on MACH_AVILA +@@ -218,7 +226,7 @@ config CPU_IXP46X + + config CPU_IXP43X + bool +- depends on MACH_KIXRP435 ++ depends on MACH_KIXRP435 || MACH_CAMBRIA + default y + + config MACH_GTWX5715 +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -7,6 +7,7 @@ obj-pci-n := + + obj-pci-$(CONFIG_ARCH_IXDP4XX) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_AVILA) += avila-pci.o ++obj-pci-$(CONFIG_MACH_CAMBRIA) += cambria-pci.o + obj-pci-$(CONFIG_MACH_IXDPG425) += ixdpg425-pci.o + obj-pci-$(CONFIG_ARCH_ADI_COYOTE) += coyote-pci.o + obj-pci-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o +@@ -31,6 +32,7 @@ obj-y += common.o + + obj-$(CONFIG_ARCH_IXDP4XX) += ixdp425-setup.o + obj-$(CONFIG_MACH_AVILA) += avila-setup.o ++obj-$(CONFIG_MACH_CAMBRIA) += cambria-setup.o + obj-$(CONFIG_MACH_IXDPG425) += coyote-setup.o + obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote-setup.o + obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-setup.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/cambria-pci.c +@@ -0,0 +1,78 @@ ++/* ++ * arch/arch/mach-ixp4xx/cambria-pci.c ++ * ++ * PCI setup routines for Gateworks Cambria series ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include ++ ++extern void ixp4xx_pci_preinit(void); ++extern int ixp4xx_setup(int nr, struct pci_sys_data *sys); ++extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys); ++ ++void __init cambria_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init cambria_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 1) ++ return IRQ_IXP4XX_GPIO11; ++ else if (slot == 2) ++ return IRQ_IXP4XX_GPIO10; ++ else if (slot == 3) ++ return IRQ_IXP4XX_GPIO9; ++ else if (slot == 4) ++ return IRQ_IXP4XX_GPIO8; ++ else if (slot == 6) ++ return IRQ_IXP4XX_GPIO10; ++ else if (slot == 15) ++ return IRQ_IXP4XX_GPIO8; ++ ++ else return -1; ++} ++ ++struct hw_pci cambria_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = cambria_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = cambria_map_irq, ++}; ++ ++int __init cambria_pci_init(void) ++{ ++ if (machine_is_cambria()) ++ pci_common_init(&cambria_pci); ++ return 0; ++} ++ ++subsys_initcall(cambria_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/cambria-setup.c +@@ -0,0 +1,1003 @@ ++/* ++ * arch/arm/mach-ixp4xx/cambria-setup.c ++ * ++ * Board setup for the Gateworks Cambria series ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * Copyright (C) 2012 Gateworks Corporation ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ * Tim Harvey ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) ++ ++struct cambria_board_info { ++ unsigned char *model; ++ void (*setup)(void); ++}; ++ ++static struct cambria_board_info *cambria_info __initdata; ++ ++static struct flash_platform_data cambria_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource cambria_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device cambria_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &cambria_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &cambria_flash_resource, ++}; ++ ++static struct i2c_gpio_platform_data cambria_i2c_gpio_data = { ++ .sda_pin = 7, ++ .scl_pin = 6, ++}; ++ ++static struct platform_device cambria_i2c_gpio = { ++ .name = "i2c-gpio", ++ .id = 0, ++ .dev = { ++ .platform_data = &cambria_i2c_gpio_data, ++ }, ++}; ++ ++#ifdef SFP_SERIALID ++static struct i2c_gpio_platform_data cambria_i2c_gpio_sfpa_data = { ++ .sda_pin = 113, ++ .scl_pin = 112, ++ .sda_is_open_drain = 0, ++ .scl_is_open_drain = 0, ++}; ++ ++static struct platform_device cambria_i2c_gpio_sfpa = { ++ .name = "i2c-gpio", ++ .id = 1, ++ .dev = { ++ .platform_data = &cambria_i2c_gpio_sfpa_data, ++ }, ++}; ++ ++static struct i2c_gpio_platform_data cambria_i2c_gpio_sfpb_data = { ++ .sda_pin = 115, ++ .scl_pin = 114, ++ .sda_is_open_drain = 0, ++ .scl_is_open_drain = 0, ++}; ++ ++static struct platform_device cambria_i2c_gpio_sfpb = { ++ .name = "i2c-gpio", ++ .id = 2, ++ .dev = { ++ .platform_data = &cambria_i2c_gpio_sfpb_data, ++ }, ++}; ++#endif // #ifdef SFP_SERIALID ++ ++static struct eth_plat_info cambria_npec_data = { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++}; ++ ++static struct eth_plat_info cambria_npea_data = { ++ .phy = 2, ++ .rxq = 2, ++ .txreadyq = 19, ++}; ++ ++static struct platform_device cambria_npec_device = { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = &cambria_npec_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++}; ++ ++static struct platform_device cambria_npea_device = { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEA, ++ .dev.platform_data = &cambria_npea_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++}; ++ ++static struct resource cambria_uart_resource = { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct plat_serial8250_port cambria_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device cambria_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = cambria_uart_data, ++ }, ++ .num_resources = 1, ++ .resource = &cambria_uart_resource, ++}; ++ ++static struct resource cambria_optional_uart_resources[] = { ++ { ++ .start = 0x52000000, ++ .end = 0x52000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x53000000, ++ .end = 0x53000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x52000000, ++ .end = 0x52000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x52000000, ++ .end = 0x52000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x52000000, ++ .end = 0x52000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x52000000, ++ .end = 0x52000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x52000000, ++ .end = 0x52000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x53000000, ++ .end = 0x53000fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port cambria_optional_uart_data[] = { ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM_DELAY, ++ .regshift = 0, ++ .uartclk = 1843200, ++ .rw_delay = 10, ++ }, ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM_DELAY, ++ .regshift = 0, ++ .uartclk = 1843200, ++ .rw_delay = 10, ++ }, ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ }, ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ }, ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ }, ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ }, ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ }, ++ { }, ++}; ++ ++static struct platform_device cambria_optional_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM1, ++ .dev.platform_data = cambria_optional_uart_data, ++ .num_resources = 2, ++ .resource = cambria_optional_uart_resources, ++}; ++ ++static struct resource cambria_pata_resources[] = { ++ { ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .name = "intrq", ++ .start = IRQ_IXP4XX_GPIO12, ++ .end = IRQ_IXP4XX_GPIO12, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static struct ixp4xx_pata_data cambria_pata_data = { ++ .cs0_bits = 0xbfff3c03, ++ .cs1_bits = 0xbfff3c03, ++}; ++ ++static struct platform_device cambria_pata = { ++ .name = "pata_ixp4xx_cf", ++ .id = 0, ++ .dev.platform_data = &cambria_pata_data, ++ .num_resources = ARRAY_SIZE(cambria_pata_resources), ++ .resource = cambria_pata_resources, ++}; ++ ++static struct gpio_led cambria_gpio_leds[] = { ++ { ++ .name = "user", ++ .gpio = 5, ++ .active_low = 1, ++ }, ++ { ++ .name = "user2", ++ .gpio = 0, ++ .active_low = 1, ++ }, ++ { ++ .name = "user3", ++ .gpio = 0, ++ .active_low = 1, ++ }, ++ { ++ .name = "user4", ++ .gpio = 0, ++ .active_low = 1, ++ } ++}; ++ ++static struct gpio_led_platform_data cambria_gpio_leds_data = { ++ .num_leds = 1, ++ .leds = cambria_gpio_leds, ++}; ++ ++static struct platform_device cambria_gpio_leds_device = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev.platform_data = &cambria_gpio_leds_data, ++}; ++ ++static struct resource cambria_gpio_resources[] = { ++ { ++ .name = "gpio", ++ .flags = 0, ++ }, ++}; ++ ++static struct gpio cambria_gpios_gw2350[] = { ++ // ARM GPIO ++#if 0 // configured from bootloader ++ { 0, GPIOF_IN, "ARM_DIO0" }, ++ { 1, GPIOF_IN, "ARM_DIO1" }, ++ { 2, GPIOF_IN, "ARM_DIO2" }, ++ { 3, GPIOF_IN, "ARM_DIO3" }, ++ { 4, GPIOF_IN, "ARM_DIO4" }, ++ { 5, GPIOF_IN, "ARM_DIO5" }, ++ { 12, GPIOF_OUT_INIT_HIGH, "WDOGEN#" }, ++#endif ++ { 8, GPIOF_IN, "ARM_DIO8" }, ++ { 9, GPIOF_IN, "ARM_DIO9" }, ++}; ++ ++static struct gpio cambria_gpios_gw2358[] = { ++ // ARM GPIO ++#if 0 // configured from bootloader ++ { 0, GPIOF_IN, "*VINLOW#" }, ++ { 2, GPIOF_IN, "*GPS_PPS" }, ++ { 3, GPIOF_IN, "*GPS_IRQ#" }, ++ { 4, GPIOF_IN, "*RS485_IRQ#" }, ++ { 5, GPIOF_IN, "*SER_EN#" }, ++ { 14, GPIOF_OUT_INIT_HIGH, "*WDOGEN#" }, ++#endif ++}; ++ ++static struct gpio cambria_gpios_gw2359[] = { ++ // ARM GPIO ++#if 0 // configured from bootloader ++ { 0, GPIOF_IN, "*PCA_IRQ#" }, ++ { 1, GPIOF_IN, "ARM_DIO1" }, ++ { 2, GPIOF_IN, "ARM_DIO2" }, ++ { 3, GPIOF_IN, "ARM_DIO3" }, ++ { 4, GPIOF_IN, "ARM_DIO4" }, ++ { 5, GPIOF_IN, "ARM_DIO5" }, ++ { 8, GPIOF_OUT_INIT_HIGH, "*WDOGEN#" }, ++#endif ++ { 11, GPIOF_OUT_INIT_HIGH, "*SER_EN" }, // console serial enable ++ { 12, GPIOF_IN, "*GSC_IRQ#" }, ++ { 13, GPIOF_OUT_INIT_HIGH, "*PCIE_RST#"}, ++ // GSC GPIO ++#if !(IS_ENABLED(CONFIG_KEYBOARD_GPIO_POLLED)) ++ {100, GPIOF_IN, "*USER_PB#" }, ++#endif ++ {103, GPIOF_OUT_INIT_HIGH, "*5V_EN" }, // 5V aux supply enable ++ {108, GPIOF_IN, "*SMUXDA0" }, ++ {109, GPIOF_IN, "*SMUXDA1" }, ++ {110, GPIOF_IN, "*SMUXDA2" }, ++ {111, GPIOF_IN, "*SMUXDB0" }, ++ {112, GPIOF_IN, "*SMUXDB1" }, ++ {113, GPIOF_IN, "*SMUXDB2" }, ++ // PCA GPIO ++ {118, GPIOF_IN, "*USIM2_DET#"}, // USIM2 Detect ++ {120, GPIOF_OUT_INIT_LOW, "*USB1_PCI_SEL"}, // USB1 Select (1=PCI, 0=FP) ++ {121, GPIOF_OUT_INIT_LOW, "*USB2_PCI_SEL"}, // USB2 Select (1=PCI, 0=FP) ++ {122, GPIOF_IN, "*USIM1_DET#"}, // USIM1 Detect ++ {123, GPIOF_OUT_INIT_HIGH, "*COM1_DTR#" }, // J21/J10 ++ {124, GPIOF_IN, "*COM1_DSR#" }, // J21/J10 ++ {127, GPIOF_IN, "PCA_DIO0" }, ++ {128, GPIOF_IN, "PCA_DIO1" }, ++ {129, GPIOF_IN, "PCA_DIO2" }, ++ {130, GPIOF_IN, "PCA_DIO3" }, ++ {131, GPIOF_IN, "PCA_DIO4" }, ++}; ++ ++static struct gpio cambria_gpios_gw2360[] = { ++ // ARM GPIO ++ { 0, GPIOF_IN, "*PCA_IRQ#" }, ++ { 11, GPIOF_OUT_INIT_LOW, "*SER0_EN#" }, ++ { 12, GPIOF_IN, "*GSC_IRQ#" }, ++ { 13, GPIOF_OUT_INIT_HIGH, "*PCIE_RST#"}, ++ // GSC GPIO ++#if !(IS_ENABLED(CONFIG_KEYBOARD_GPIO_POLLED)) ++ {100, GPIOF_IN, "*USER_PB#" }, ++#endif ++ {108, GPIOF_OUT_INIT_LOW, "*ENET1_EN#" }, // ENET1 TX Enable ++ {109, GPIOF_IN, "*ENET1_PRES#" }, // ENET1 Detect (0=SFP present) ++ {110, GPIOF_OUT_INIT_LOW, "*ENET2_EN#" }, // ENET2 TX Enable ++ {111, GPIOF_IN, "*ENET2_PRES#"}, // ENET2 Detect (0=SFP present) ++ // PCA GPIO ++ {116, GPIOF_OUT_INIT_HIGH, "*USIM2_LOC"}, // USIM2 Select (1=Loc, 0=Rem) ++ {117, GPIOF_IN, "*USIM2_DET_LOC#" },// USIM2 Detect (Local Slot) ++ {118, GPIOF_IN, "*USIM2_DET_REM#" },// USIM2 Detect (Remote Slot) ++ {120, GPIOF_OUT_INIT_LOW, "*USB1_PCI_SEL"}, // USB1 Select (1=PCIe1, 0=J1) ++ {121, GPIOF_OUT_INIT_LOW, "*USB2_PCI_SEL"}, // USB2 Select (1=PCIe2, 0=J1) ++ {122, GPIOF_IN, "*USIM1_DET#"}, // USIM1 Detect ++ {127, GPIOF_IN, "DIO0" }, ++ {128, GPIOF_IN, "DIO1" }, ++ {129, GPIOF_IN, "DIO2" }, ++ {130, GPIOF_IN, "DIO3" }, ++ {131, GPIOF_IN, "DIO4" }, ++}; ++ ++static struct latch_led cambria_latch_leds[] = { ++ { ++ .name = "ledA", /* green led */ ++ .bit = 0, ++ }, ++ { ++ .name = "ledB", /* green led */ ++ .bit = 1, ++ }, ++ { ++ .name = "ledC", /* green led */ ++ .bit = 2, ++ }, ++ { ++ .name = "ledD", /* green led */ ++ .bit = 3, ++ }, ++ { ++ .name = "ledE", /* green led */ ++ .bit = 4, ++ }, ++ { ++ .name = "ledF", /* green led */ ++ .bit = 5, ++ }, ++ { ++ .name = "ledG", /* green led */ ++ .bit = 6, ++ }, ++ { ++ .name = "ledH", /* green led */ ++ .bit = 7, ++ } ++}; ++ ++static struct latch_led_platform_data cambria_latch_leds_data = { ++ .num_leds = 8, ++ .leds = cambria_latch_leds, ++ .mem = 0x53F40000, ++}; ++ ++static struct platform_device cambria_latch_leds_device = { ++ .name = "leds-latch", ++ .id = -1, ++ .dev.platform_data = &cambria_latch_leds_data, ++}; ++ ++static struct resource cambria_usb0_resources[] = { ++ { ++ .start = 0xCD000000, ++ .end = 0xCD000300, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = 32, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static struct resource cambria_usb1_resources[] = { ++ { ++ .start = 0xCE000000, ++ .end = 0xCE000300, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = 33, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static u64 ehci_dma_mask = ~(u32)0; ++ ++static struct usb_ehci_pdata cambria_usb_pdata = { ++ .big_endian_desc = 1, ++ .big_endian_mmio = 1, ++ .has_tt = 1, ++ .caps_offset = 0x100, ++}; ++ ++static struct platform_device cambria_usb0_device = { ++ .name = "ehci-platform", ++ .id = 0, ++ .resource = cambria_usb0_resources, ++ .num_resources = ARRAY_SIZE(cambria_usb0_resources), ++ .dev = { ++ .dma_mask = &ehci_dma_mask, ++ .coherent_dma_mask = 0xffffffff, ++ .platform_data = &cambria_usb_pdata, ++ }, ++}; ++ ++static struct platform_device cambria_usb1_device = { ++ .name = "ehci-platform", ++ .id = 1, ++ .resource = cambria_usb1_resources, ++ .num_resources = ARRAY_SIZE(cambria_usb1_resources), ++ .dev = { ++ .dma_mask = &ehci_dma_mask, ++ .coherent_dma_mask = 0xffffffff, ++ .platform_data = &cambria_usb_pdata, ++ }, ++}; ++ ++static struct gw_i2c_pld_platform_data gw_i2c_pld_data0 = { ++ .gpio_base = 16, ++ .nr_gpio = 8, ++}; ++ ++static struct gw_i2c_pld_platform_data gw_i2c_pld_data1 = { ++ .gpio_base = 24, ++ .nr_gpio = 2, ++}; ++ ++ ++static struct gpio_keys_button cambria_gpio_buttons[] = { ++ { ++ .desc = "user", ++ .type = EV_KEY, ++ .code = BTN_0, ++ .debounce_interval = 6, ++ .gpio = 25, ++ } ++}; ++ ++static struct gpio_keys_platform_data cambria_gpio_buttons_data = { ++ .poll_interval = 500, ++ .nbuttons = 1, ++ .buttons = cambria_gpio_buttons, ++}; ++ ++static struct platform_device cambria_gpio_buttons_device = { ++ .name = "gpio-keys-polled", ++ .id = -1, ++ .dev.platform_data = &cambria_gpio_buttons_data, ++}; ++ ++static struct platform_device *cambria_devices[] __initdata = { ++ &cambria_i2c_gpio, ++ &cambria_flash, ++ &cambria_uart, ++}; ++ ++static int cambria_register_gpio(struct gpio *array, size_t num) ++{ ++ int i, err, ret; ++ ++ ret = 0; ++ for (i = 0; i < num; i++, array++) { ++ const char *label = array->label; ++ if (label[0] == '*') ++ label++; ++ err = gpio_request_one(array->gpio, array->flags, label); ++ if (err) ++ ret = err; ++ else { ++ err = gpio_export(array->gpio, array->label[0] != '*'); ++ } ++ } ++ return ret; ++} ++ ++static void __init cambria_gw23xx_setup(void) ++{ ++ cambria_gpio_resources[0].start = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) |\ ++ (1 << 5) | (1 << 8) | (1 << 9) | (1 << 12); ++ cambria_gpio_resources[0].end = cambria_gpio_resources[0].start; ++ ++ platform_device_register(&cambria_npec_device); ++ platform_device_register(&cambria_npea_device); ++} ++ ++static void __init cambria_gw2350_setup(void) ++{ ++ *IXP4XX_EXP_CS2 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING); ++ cambria_optional_uart_data[0].mapbase = 0x52FF0000; ++ cambria_optional_uart_data[0].membase = (void __iomem *)ioremap(0x52FF0000, 0x0fff); ++ cambria_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO3; ++ ++ *IXP4XX_EXP_CS3 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_EDGE_RISING); ++ cambria_optional_uart_data[1].mapbase = 0x53FF0000; ++ cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53FF0000, 0x0fff); ++ cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO4; ++ ++ cambria_gpio_resources[0].start = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) |\ ++ (1 << 5) | (1 << 8) | (1 << 9) | (1 << 12); ++ cambria_gpio_resources[0].end = cambria_gpio_resources[0].start; ++ ++ platform_device_register(&cambria_optional_uart); ++ platform_device_register(&cambria_npec_device); ++ platform_device_register(&cambria_npea_device); ++ ++ platform_device_register(&cambria_usb0_device); ++ platform_device_register(&cambria_usb1_device); ++ ++ platform_device_register(&cambria_gpio_leds_device); ++ ++ /* gpio config (/sys/class/gpio) */ ++ cambria_register_gpio(ARRAY_AND_SIZE(cambria_gpios_gw2350)); ++} ++ ++static void __init cambria_gw2358_setup(void) ++{ ++ *IXP4XX_EXP_CS3 = 0xBFFF3C43; // bit0 = 16bit vs 8bit bus ++ irq_set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING); ++ cambria_optional_uart_data[0].mapbase = 0x53FC0000; ++ cambria_optional_uart_data[0].membase = (void __iomem *)ioremap(0x53FC0000, 0x0fff); ++ cambria_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO3; ++ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_EDGE_RISING); ++ cambria_optional_uart_data[1].mapbase = 0x53F80000; ++ cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53F80000, 0x0fff); ++ cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO4; ++ ++ cambria_gpio_resources[0].start = (1 << 14) | (1 << 16) | (1 << 17) | (1 << 18) |\ ++ (1 << 19) | (1 << 20) | (1 << 24) | (1 << 25); ++ cambria_gpio_resources[0].end = cambria_gpio_resources[0].start; ++ ++ platform_device_register(&cambria_optional_uart); ++ ++ platform_device_register(&cambria_npec_device); ++ platform_device_register(&cambria_npea_device); ++ ++ platform_device_register(&cambria_usb0_device); ++ platform_device_register(&cambria_usb1_device); ++ ++ platform_device_register(&cambria_pata); ++ ++ cambria_gpio_leds[0].gpio = 24; ++ platform_device_register(&cambria_gpio_leds_device); ++ ++ platform_device_register(&cambria_latch_leds_device); ++ ++ platform_device_register(&cambria_gpio_buttons_device); ++ ++ /* gpio config (/sys/class/gpio) */ ++ cambria_register_gpio(ARRAY_AND_SIZE(cambria_gpios_gw2358)); ++} ++ ++static void __init cambria_gw2359_setup(void) ++{ ++#if defined(CONFIG_MVSWITCH_PHY) || defined(CONFIG_MVSWITCH_PHY_MODULE) ++ /* The mvswitch driver has some hard-coded values which could ++ * easily be turned into a platform resource if needed. For now they ++ * match our hardware configuration: ++ * MV_BASE 0x10 - phy base address ++ * MV_WANPORT 0 - Port0 (ENET2) is WAN (SFP module) ++ * MV_CPUPORT 5 - Port5 is CPU NPEA (eth1) ++ * ++ * The mvswitch driver registers a fixup which forces a driver match ++ * if phy_addr matches MV_BASE ++ * ++ * Two static defautl VLAN's are created: WAN port in 1, and all other ports ++ * in the other. ++ */ ++ cambria_npea_data.phy = 0x10; // mvswitch driver catches this ++#else ++ // Switch Port5 to CPU is MII<->MII (no PHY) - this disables the genphy driver ++ cambria_npea_data.phy = IXP4XX_ETH_PHY_MAX_ADDR; ++ // CPU NPE-C is in bridge bypass mode to Port4 PHY@0x14 ++ cambria_npec_data.phy = 0x14; ++#endif ++ platform_device_register(&cambria_npec_device); ++ platform_device_register(&cambria_npea_device); ++ ++ platform_device_register(&cambria_usb0_device); ++ platform_device_register(&cambria_usb1_device); ++ ++ cambria_gpio_leds_data.num_leds = 3; ++ cambria_gpio_leds[0].name = "user1"; ++ cambria_gpio_leds[0].gpio = 125; // PNLLED1# ++ cambria_gpio_leds[1].gpio = 126; // PNLLED3# ++ cambria_gpio_leds[2].gpio = 119; // PNLLED4# ++ platform_device_register(&cambria_gpio_leds_device); ++ ++#if (IS_ENABLED(CONFIG_KEYBOARD_GPIO_POLLED)) ++ cambria_gpio_buttons[0].gpio = 100; ++ platform_device_register(&cambria_gpio_buttons_device); ++#endif ++ ++ /* gpio config (/sys/class/gpio) */ ++ cambria_register_gpio(ARRAY_AND_SIZE(cambria_gpios_gw2359)); ++} ++ ++static void __init cambria_gw2360_setup(void) ++{ ++ /* The GW2360 has 8 UARTs in addition to the 1 IXP4xxx UART. ++ * The chip-selects are expanded via a 3-to-8 decoder and CS2 ++ * and they are 8bit devices ++ */ ++ *IXP4XX_EXP_CS2 = 0xBFFF3C43; ++ cambria_optional_uart_data[0].mapbase = 0x52000000; ++ cambria_optional_uart_data[0].membase = (void __iomem *)ioremap(0x52000000, 0x0fff); ++ cambria_optional_uart_data[0].uartclk = 18432000; ++ cambria_optional_uart_data[0].iotype = UPIO_MEM; ++ cambria_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO2; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO2, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart_data[1].mapbase = 0x52000008; ++ cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x52000008, 0x0fff); ++ cambria_optional_uart_data[1].uartclk = 18432000; ++ cambria_optional_uart_data[1].iotype = UPIO_MEM; ++ cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO3; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart_data[2].mapbase = 0x52000010; ++ cambria_optional_uart_data[2].membase = (void __iomem *)ioremap(0x52000010, 0x0fff); ++ cambria_optional_uart_data[2].uartclk = 18432000; ++ cambria_optional_uart_data[2].iotype = UPIO_MEM; ++ cambria_optional_uart_data[2].irq = IRQ_IXP4XX_GPIO4; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart_data[3].mapbase = 0x52000018; ++ cambria_optional_uart_data[3].membase = (void __iomem *)ioremap(0x52000018, 0x0fff); ++ cambria_optional_uart_data[3].uartclk = 18432000; ++ cambria_optional_uart_data[3].iotype = UPIO_MEM; ++ cambria_optional_uart_data[3].irq = IRQ_IXP4XX_GPIO5; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO5, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart_data[4].mapbase = 0x52000020; ++ cambria_optional_uart_data[4].membase = (void __iomem *)ioremap(0x52000020, 0x0fff); ++ cambria_optional_uart_data[4].uartclk = 18432000; ++ cambria_optional_uart_data[4].iotype = UPIO_MEM; ++ cambria_optional_uart_data[4].irq = IRQ_IXP4XX_GPIO8; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart_data[5].mapbase = 0x52000028; ++ cambria_optional_uart_data[5].membase = (void __iomem *)ioremap(0x52000028, 0x0fff); ++ cambria_optional_uart_data[5].uartclk = 18432000; ++ cambria_optional_uart_data[5].iotype = UPIO_MEM; ++ cambria_optional_uart_data[5].irq = IRQ_IXP4XX_GPIO9; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart_data[6].mapbase = 0x52000030; ++ cambria_optional_uart_data[6].membase = (void __iomem *)ioremap(0x52000030, 0x0fff); ++ cambria_optional_uart_data[6].uartclk = 18432000; ++ cambria_optional_uart_data[6].iotype = UPIO_MEM; ++ cambria_optional_uart_data[6].irq = IRQ_IXP4XX_GPIO10; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart.num_resources = 7, ++ platform_device_register(&cambria_optional_uart); ++ ++#if defined(CONFIG_MVSWITCH_PHY) || defined(CONFIG_MVSWITCH_PHY_MODULE) ++ /* The mvswitch driver has some hard-coded values which could ++ * easily be turned into a platform resource if needed. For now they ++ * match our hardware configuration: ++ * MV_BASE 0x10 - phy base address ++ * MV_WANPORT 0 - Port0 (ENET2) is WAN (SFP module) ++ * MV_CPUPORT 5 - Port5 is CPU NPEA (eth1) ++ * ++ * The mvswitch driver registers a fixup which forces a driver match ++ * if phy_addr matches MV_BASE ++ * ++ * Two static defautl VLAN's are created: WAN port in 1, and all other ports ++ * in the other. ++ */ ++ cambria_npea_data.phy = 0x10; // mvswitch driver catches this ++#else ++ // Switch Port5 to CPU is MII<->MII (no PHY) - this disables the generic PHY driver ++ cambria_npea_data.phy = IXP4XX_ETH_PHY_MAX_ADDR; ++#endif ++ ++ // disable genphy autonegotiation on NPE-C PHY (eth1) as its 100BaseFX ++ //cambria_npec_data.noautoneg = 1; // disable autoneg ++ cambria_npec_data.speed_10 = 0; // 100mbps ++ cambria_npec_data.half_duplex = 0; // full-duplex ++ platform_device_register(&cambria_npec_device); ++ platform_device_register(&cambria_npea_device); ++ ++ platform_device_register(&cambria_usb0_device); ++ platform_device_register(&cambria_usb1_device); ++ ++ cambria_gpio_leds_data.num_leds = 3; ++ cambria_gpio_leds[0].name = "user1"; ++ cambria_gpio_leds[0].gpio = 125; ++ cambria_gpio_leds[1].gpio = 126; ++ cambria_gpio_leds[2].gpio = 119; ++ platform_device_register(&cambria_gpio_leds_device); ++ ++#if (IS_ENABLED(CONFIG_KEYBOARD_GPIO_POLLED)) ++ cambria_gpio_buttons[0].gpio = 100; ++ platform_device_register(&cambria_gpio_buttons_device); ++#endif ++ ++#ifdef SFP_SERIALID ++ /* the SFP modules each have an i2c bus for serial ident via GSC GPIO ++ * To use these the i2c-gpio driver must be changed to use the _cansleep ++ * varients of gpio_get_value/gpio_set_value (I don't know why it doesn't ++ * use that anyway as it doesn't operate in an IRQ context). ++ * Additionally the i2c-gpio module must set the gpio to output-high prior ++ * to changing direction to an input to enable internal Pullups ++ */ ++ platform_device_register(&cambria_i2c_gpio_sfpa); ++ platform_device_register(&cambria_i2c_gpio_sfpb); ++#endif ++ ++ /* gpio config (/sys/class/gpio) */ ++ cambria_register_gpio(ARRAY_AND_SIZE(cambria_gpios_gw2360)); ++} ++ ++static struct cambria_board_info cambria_boards[] __initdata = { ++ { ++ .model = "GW2350", ++ .setup = cambria_gw2350_setup, ++ }, { ++ .model = "GW2351", ++ .setup = cambria_gw2350_setup, ++ }, { ++ .model = "GW2358", ++ .setup = cambria_gw2358_setup, ++ }, { ++ .model = "GW2359", ++ .setup = cambria_gw2359_setup, ++ }, { ++ .model = "GW2360", ++ .setup = cambria_gw2360_setup, ++ }, { ++ .model = "GW2371", ++ .setup = cambria_gw2358_setup, ++ } ++}; ++ ++static struct cambria_board_info * __init cambria_find_board_info(char *model) ++{ ++ int i; ++ model[6] = '\0'; ++ ++ for (i = 0; i < ARRAY_SIZE(cambria_boards); i++) { ++ struct cambria_board_info *info = &cambria_boards[i]; ++ if (strcmp(info->model, model) == 0) ++ return info; ++ } ++ ++ return NULL; ++} ++ ++static struct nvmem_device *at24_nvmem; ++ ++static void at24_setup(struct nvmem_device *mem_acc, void *context) ++{ ++ char mac_addr[ETH_ALEN]; ++ char model[7]; ++ ++ at24_nvmem = mem_acc; ++ ++ /* Read MAC addresses */ ++ if (nvmem_device_read(at24_nvmem, 0x0, 6, mac_addr) == 6) { ++ memcpy(&cambria_npec_data.hwaddr, mac_addr, ETH_ALEN); ++ } ++ if (nvmem_device_read(at24_nvmem, 0x6, 6, mac_addr) == 6) { ++ memcpy(&cambria_npea_data.hwaddr, mac_addr, ETH_ALEN); ++ } ++ ++ /* Read the first 6 bytes of the model number */ ++ if (nvmem_device_read(at24_nvmem, 0x20, 6, model) == 6) { ++ cambria_info = cambria_find_board_info(model); ++ } ++ ++} ++ ++static struct at24_platform_data cambria_eeprom_info = { ++ .byte_len = 1024, ++ .page_size = 16, ++ .flags = AT24_FLAG_READONLY, ++ .setup = at24_setup, ++}; ++ ++static struct pca953x_platform_data cambria_pca_data = { ++ .gpio_base = 100, ++ .irq_base = -1, ++}; ++ ++static struct pca953x_platform_data cambria_pca2_data = { ++ .gpio_base = 116, ++ .irq_base = -1, ++}; ++ ++static struct i2c_board_info __initdata cambria_i2c_board_info[] = { ++ { ++ I2C_BOARD_INFO("pca9555", 0x23), ++ .platform_data = &cambria_pca_data, ++ }, ++ { ++ I2C_BOARD_INFO("pca9555", 0x27), ++ .platform_data = &cambria_pca2_data, ++ }, ++ { ++ I2C_BOARD_INFO("ds1672", 0x68), ++ }, ++ { ++ I2C_BOARD_INFO("gsp", 0x29), ++ }, ++ { ++ I2C_BOARD_INFO("ad7418", 0x28), ++ }, ++ { ++ I2C_BOARD_INFO("24c08", 0x51), ++ .platform_data = &cambria_eeprom_info ++ }, ++ { ++ I2C_BOARD_INFO("gw_i2c_pld", 0x56), ++ .platform_data = &gw_i2c_pld_data0, ++ }, ++ { ++ I2C_BOARD_INFO("gw_i2c_pld", 0x57), ++ .platform_data = &gw_i2c_pld_data1, ++ }, ++}; ++ ++static void __init cambria_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ cambria_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ cambria_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; // make sure window is writable ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(ARRAY_AND_SIZE(cambria_devices)); ++ ++ cambria_pata_resources[0].start = 0x53e00000; ++ cambria_pata_resources[0].end = 0x53e3ffff; ++ ++ cambria_pata_resources[1].start = 0x53e40000; ++ cambria_pata_resources[1].end = 0x53e7ffff; ++ ++ cambria_pata_data.cs0_cfg = IXP4XX_EXP_CS3; ++ cambria_pata_data.cs1_cfg = IXP4XX_EXP_CS3; ++ ++ i2c_register_board_info(0, ARRAY_AND_SIZE(cambria_i2c_board_info)); ++} ++ ++static int __init cambria_model_setup(void) ++{ ++ if (!machine_is_cambria()) ++ return 0; ++ ++ if (cambria_info) { ++ printk(KERN_DEBUG "Running on Gateworks Cambria %s\n", ++ cambria_info->model); ++ cambria_info->setup(); ++ } else { ++ printk(KERN_INFO "Unknown/missing Cambria model number" ++ " -- defaults will be used\n"); ++ cambria_gw23xx_setup(); ++ } ++ ++ return 0; ++} ++late_initcall(cambria_model_setup); ++ ++MACHINE_START(CAMBRIA, "Gateworks Cambria series") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = cambria_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END diff --git a/target/linux/ixp4xx/patches-4.9/201-npe_driver_print_license_location.patch b/target/linux/ixp4xx/patches-4.9/201-npe_driver_print_license_location.patch new file mode 100644 index 0000000000..f46b9c61bf --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/201-npe_driver_print_license_location.patch @@ -0,0 +1,11 @@ +--- a/arch/arm/mach-ixp4xx/ixp4xx_npe.c ++++ b/arch/arm/mach-ixp4xx/ixp4xx_npe.c +@@ -586,6 +586,8 @@ int npe_load_firmware(struct npe *npe, c + npe_reset(npe); + #endif + ++ print_npe(KERN_INFO, npe, "firmware's license can be found in /usr/share/doc/LICENSE.IPL\n"); ++ + print_npe(KERN_INFO, npe, "firmware functionality 0x%X, " + "revision 0x%X:%X\n", (image->id >> 16) & 0xFF, + (image->id >> 8) & 0xFF, image->id & 0xFF); diff --git a/target/linux/ixp4xx/patches-4.9/205-npe_driver_separate_phy_functions.patch b/target/linux/ixp4xx/patches-4.9/205-npe_driver_separate_phy_functions.patch new file mode 100644 index 0000000000..cc77c5dddc --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/205-npe_driver_separate_phy_functions.patch @@ -0,0 +1,127 @@ +From e3eab80fb5d0a7d7fdb0f2f231b27161d5ec3804 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 30 Jun 2013 15:52:53 +0200 +Subject: [PATCH 23/36] 205-npe_driver_separate_phy_functions.patch + +--- + drivers/net/ethernet/xscale/ixp4xx_eth.c | 70 ++++++++++++++++++++++-------- + 1 file changed, 51 insertions(+), 19 deletions(-) + +--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c ++++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c +@@ -588,6 +588,51 @@ static void ixp4xx_adjust_link(struct ne + dev->name, port->speed, port->duplex ? "full" : "half"); + } + ++static int ixp4xx_phy_connect(struct net_device *dev) ++{ ++ struct port *port = netdev_priv(dev); ++ struct eth_plat_info *plat = port->plat; ++ char phy_id[MII_BUS_ID_SIZE + 3]; ++ ++ snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, ++ mdio_bus->id, plat->phy); ++ port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, ++ PHY_INTERFACE_MODE_MII); ++ if (IS_ERR(port->phydev)) { ++ printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); ++ return PTR_ERR(port->phydev); ++ } ++ ++ /* mask with MAC supported features */ ++ port->phydev->supported &= PHY_BASIC_FEATURES; ++ port->phydev->advertising = port->phydev->supported; ++ ++ port->phydev->irq = PHY_POLL; ++ ++ return 0; ++} ++ ++static void ixp4xx_phy_disconnect(struct net_device *dev) ++{ ++ struct port *port = netdev_priv(dev); ++ ++ phy_disconnect(port->phydev); ++} ++ ++static void ixp4xx_phy_start(struct net_device *dev) ++{ ++ struct port *port = netdev_priv(dev); ++ ++ port->speed = 0; /* force "link up" message */ ++ phy_start(port->phydev); ++} ++ ++static void ixp4xx_phy_stop(struct net_device *dev) ++{ ++ struct port *port = netdev_priv(dev); ++ ++ phy_stop(port->phydev); ++} + + static inline void debug_pkt(struct net_device *dev, const char *func, + u8 *data, int len) +@@ -1242,8 +1287,7 @@ static int eth_open(struct net_device *d + return err; + } + +- port->speed = 0; /* force "link up" message */ +- phy_start(dev->phydev); ++ ixp4xx_phy_start(dev); + + for (i = 0; i < ETH_ALEN; i++) + __raw_writel(dev->dev_addr[i], &port->regs->hw_addr[i]); +@@ -1364,7 +1408,7 @@ static int eth_close(struct net_device * + printk(KERN_CRIT "%s: unable to disable loopback\n", + dev->name); + +- phy_stop(dev->phydev); ++ ixp4xx_phy_stop(dev); + + if (!ports_open) + qmgr_disable_irq(TXDONE_QUEUE); +@@ -1391,7 +1435,6 @@ static int eth_init_one(struct platform_ + struct eth_plat_info *plat = dev_get_platdata(&pdev->dev); + struct phy_device *phydev = NULL; + u32 regs_phys; +- char phy_id[MII_BUS_ID_SIZE + 3]; + int err; + + if (!(dev = alloc_etherdev(sizeof(struct port)))) +@@ -1449,16 +1492,9 @@ static int eth_init_one(struct platform_ + __raw_writel(DEFAULT_CORE_CNTRL, &port->regs->core_control); + udelay(50); + +- snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, +- mdio_bus->id, plat->phy); +- phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, +- PHY_INTERFACE_MODE_MII); +- if (IS_ERR(phydev)) { +- err = PTR_ERR(phydev); ++ err = ixp4xx_phy_connect(dev); ++ if (err) + goto err_free_mem; +- } +- +- phydev->irq = PHY_POLL; + + if ((err = register_netdev(dev))) + goto err_phy_dis; +@@ -1469,7 +1505,7 @@ static int eth_init_one(struct platform_ + return 0; + + err_phy_dis: +- phy_disconnect(phydev); ++ ixp4xx_phy_disconnect(phydev); + err_free_mem: + npe_port_tab[NPE_ID(port->id)] = NULL; + release_resource(port->mem_res); +@@ -1487,7 +1523,7 @@ static int eth_remove_one(struct platfor + struct port *port = netdev_priv(dev); + + unregister_netdev(dev); +- phy_disconnect(phydev); ++ ixp4xx_phy_disconnect(phydev); + npe_port_tab[NPE_ID(port->id)] = NULL; + npe_release(port->npe); + release_resource(port->mem_res); diff --git a/target/linux/ixp4xx/patches-4.9/206-npe_driver_add_update_link_function.patch b/target/linux/ixp4xx/patches-4.9/206-npe_driver_add_update_link_function.patch new file mode 100644 index 0000000000..e12764e053 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/206-npe_driver_add_update_link_function.patch @@ -0,0 +1,100 @@ +--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c ++++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c +@@ -171,12 +171,13 @@ struct port { + struct npe *npe; + struct net_device *netdev; + struct napi_struct napi; ++ struct phy_device *phydev; + struct eth_plat_info *plat; + buffer_t *rx_buff_tab[RX_DESCS], *tx_buff_tab[TX_DESCS]; + struct desc *desc_tab; /* coherent */ + u32 desc_tab_phys; + int id; /* logical port ID */ +- int speed, duplex; ++ int link, speed, duplex; + u8 firmware[4]; + int hwts_tx_en; + int hwts_rx_en; +@@ -558,36 +559,46 @@ static void ixp4xx_mdio_remove(void) + } + + +-static void ixp4xx_adjust_link(struct net_device *dev) ++static void ixp4xx_update_link(struct net_device *dev) + { + struct port *port = netdev_priv(dev); +- struct phy_device *phydev = dev->phydev; +- +- if (!phydev->link) { +- if (port->speed) { +- port->speed = 0; +- printk(KERN_INFO "%s: link down\n", dev->name); +- } +- return; +- } +- +- if (port->speed == phydev->speed && port->duplex == phydev->duplex) +- return; +- +- port->speed = phydev->speed; +- port->duplex = phydev->duplex; + +- if (port->duplex) ++ if (port->duplex == DUPLEX_FULL) + __raw_writel(DEFAULT_TX_CNTRL0 & ~TX_CNTRL0_HALFDUPLEX, + &port->regs->tx_control[0]); + else + __raw_writel(DEFAULT_TX_CNTRL0 | TX_CNTRL0_HALFDUPLEX, + &port->regs->tx_control[0]); + ++ netif_carrier_on(dev); + printk(KERN_INFO "%s: link up, speed %u Mb/s, %s duplex\n", + dev->name, port->speed, port->duplex ? "full" : "half"); + } + ++static void ixp4xx_adjust_link(struct net_device *dev) ++{ ++ struct port *port = netdev_priv(dev); ++ struct phy_device *phydev = port->phydev; ++ int status_change = 0; ++ ++ if (phydev->link) { ++ if (port->duplex != phydev->duplex ++ || port->speed != phydev->speed) { ++ status_change = 1; ++ } ++ } ++ ++ if (phydev->link != port->link) ++ status_change = 1; ++ ++ port->link = phydev->link; ++ port->speed = phydev->speed; ++ port->duplex = phydev->duplex; ++ ++ if (status_change) ++ ixp4xx_update_link(dev); ++} ++ + static int ixp4xx_phy_connect(struct net_device *dev) + { + struct port *port = netdev_priv(dev); +@@ -623,7 +634,6 @@ static void ixp4xx_phy_start(struct net_ + { + struct port *port = netdev_priv(dev); + +- port->speed = 0; /* force "link up" message */ + phy_start(port->phydev); + } + +@@ -1499,6 +1509,10 @@ static int eth_init_one(struct platform_ + if ((err = register_netdev(dev))) + goto err_phy_dis; + ++ port->link = 0; ++ port->speed = 0; ++ port->duplex = -1; ++ + printk(KERN_INFO "%s: MII PHY %i on %s\n", dev->name, plat->phy, + npe_name(port->npe)); + diff --git a/target/linux/ixp4xx/patches-4.9/207-npe_driver_multiphy_support.patch b/target/linux/ixp4xx/patches-4.9/207-npe_driver_multiphy_support.patch new file mode 100644 index 0000000000..a23644a167 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/207-npe_driver_multiphy_support.patch @@ -0,0 +1,153 @@ +TODO: take care of additional PHYs through the PHY abstraction layer + +--- a/arch/arm/mach-ixp4xx/include/mach/platform.h ++++ b/arch/arm/mach-ixp4xx/include/mach/platform.h +@@ -95,12 +95,23 @@ struct ixp4xx_pata_data { + #define IXP4XX_ETH_NPEB 0x10 + #define IXP4XX_ETH_NPEC 0x20 + ++#define IXP4XX_ETH_PHY_MAX_ADDR 32 ++ + /* Information about built-in Ethernet MAC interfaces */ + struct eth_plat_info { + u8 phy; /* MII PHY ID, 0 - 31 */ + u8 rxq; /* configurable, currently 0 - 31 only */ + u8 txreadyq; + u8 hwaddr[6]; ++ ++ u32 phy_mask; ++#if 0 ++ int speed; ++ int duplex; ++#else ++ int speed_10; ++ int half_duplex; ++#endif + }; + + /* Information about built-in HSS (synchronous serial) interfaces */ +--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c ++++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c +@@ -605,6 +605,37 @@ static int ixp4xx_phy_connect(struct net + struct eth_plat_info *plat = port->plat; + char phy_id[MII_BUS_ID_SIZE + 3]; + ++ if (plat->phy == IXP4XX_ETH_PHY_MAX_ADDR) { ++#if 0 ++ switch (plat->speed) { ++ case SPEED_10: ++ case SPEED_100: ++ break; ++ default: ++ printk(KERN_ERR "%s: invalid speed (%d)\n", ++ dev->name, plat->speed); ++ return -EINVAL; ++ } ++ ++ switch (plat->duplex) { ++ case DUPLEX_HALF: ++ case DUPLEX_FULL: ++ break; ++ default: ++ printk(KERN_ERR "%s: invalid duplex mode (%d)\n", ++ dev->name, plat->duplex); ++ return -EINVAL; ++ } ++ port->speed = plat->speed; ++ port->duplex = plat->duplex; ++#else ++ port->speed = plat->speed_10 ? SPEED_10 : SPEED_100; ++ port->duplex = plat->half_duplex ? DUPLEX_HALF : DUPLEX_FULL; ++#endif ++ ++ return 0; ++ } ++ + snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, + mdio_bus->id, plat->phy); + port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, +@@ -627,21 +658,32 @@ static void ixp4xx_phy_disconnect(struct + { + struct port *port = netdev_priv(dev); + +- phy_disconnect(port->phydev); ++ if (port->phydev) ++ phy_disconnect(port->phydev); + } + + static void ixp4xx_phy_start(struct net_device *dev) + { + struct port *port = netdev_priv(dev); + +- phy_start(port->phydev); ++ if (port->phydev) { ++ phy_start(port->phydev); ++ } else { ++ port->link = 1; ++ ixp4xx_update_link(dev); ++ } + } + + static void ixp4xx_phy_stop(struct net_device *dev) + { + struct port *port = netdev_priv(dev); + +- phy_stop(port->phydev); ++ if (port->phydev) { ++ phy_stop(port->phydev); ++ } else { ++ port->link = 0; ++ ixp4xx_update_link(dev); ++ } + } + + static inline void debug_pkt(struct net_device *dev, const char *func, +@@ -1030,6 +1072,8 @@ static void eth_set_mcast_list(struct ne + + static int eth_ioctl(struct net_device *dev, struct ifreq *req, int cmd) + { ++ struct port *port = netdev_priv(dev); ++ + if (!netif_running(dev)) + return -EINVAL; + +@@ -1040,6 +1084,9 @@ static int eth_ioctl(struct net_device * + return hwtstamp_get(dev, req); + } + ++ if (!port->phydev) ++ return -EOPNOTSUPP; ++ + return phy_mii_ioctl(dev->phydev, req, cmd); + } + +@@ -1059,6 +1106,11 @@ static void ixp4xx_get_drvinfo(struct ne + + static int ixp4xx_nway_reset(struct net_device *dev) + { ++ struct port *port = netdev_priv(dev); ++ ++ if (!port->phydev) ++ return -EOPNOTSUPP; ++ + return phy_start_aneg(dev->phydev); + } + +@@ -1519,7 +1571,7 @@ static int eth_init_one(struct platform_ + return 0; + + err_phy_dis: +- ixp4xx_phy_disconnect(phydev); ++ ixp4xx_phy_disconnect(port->netdev); + err_free_mem: + npe_port_tab[NPE_ID(port->id)] = NULL; + release_resource(port->mem_res); +@@ -1537,7 +1589,7 @@ static int eth_remove_one(struct platfor + struct port *port = netdev_priv(dev); + + unregister_netdev(dev); +- ixp4xx_phy_disconnect(phydev); ++ ixp4xx_phy_disconnect(port->netdev); + npe_port_tab[NPE_ID(port->id)] = NULL; + npe_release(port->npe); + release_resource(port->mem_res); diff --git a/target/linux/ixp4xx/patches-4.9/295-latch_led_driver.patch b/target/linux/ixp4xx/patches-4.9/295-latch_led_driver.patch new file mode 100644 index 0000000000..66bc3e86b0 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/295-latch_led_driver.patch @@ -0,0 +1,201 @@ +--- a/drivers/leds/Kconfig ++++ b/drivers/leds/Kconfig +@@ -312,6 +312,12 @@ config LEDS_LP8860 + on the LP8860 4 channel LED driver using the I2C communication + bus. + ++config LEDS_LATCH ++ tristate "LED Support for Memory Latched LEDs" ++ depends on LEDS_CLASS ++ help ++ -- To Do -- ++ + config LEDS_CLEVO_MAIL + tristate "Mail LED on Clevo notebook" + depends on LEDS_CLASS +--- a/drivers/leds/Makefile ++++ b/drivers/leds/Makefile +@@ -25,6 +25,7 @@ obj-$(CONFIG_LEDS_SUNFIRE) += leds-sunf + obj-$(CONFIG_LEDS_PCA9532) += leds-pca9532.o + obj-$(CONFIG_LEDS_GPIO_REGISTER) += leds-gpio-register.o + obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o ++obj-$(CONFIG_LEDS_LATCH) += leds-latch.o + obj-$(CONFIG_LEDS_LP3944) += leds-lp3944.o + obj-$(CONFIG_LEDS_LP3952) += leds-lp3952.o + obj-$(CONFIG_LEDS_LP55XX_COMMON) += leds-lp55xx-common.o +--- /dev/null ++++ b/drivers/leds/leds-latch.c +@@ -0,0 +1,152 @@ ++/* ++ * LEDs driver for Memory Latched Devices ++ * ++ * Copyright (C) 2008 Gateworks Corp. ++ * Chris Lang ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static unsigned int mem_keep = 0xFF; ++static spinlock_t mem_lock; ++static unsigned char *iobase; ++ ++struct latch_led_data { ++ struct led_classdev cdev; ++ struct work_struct work; ++ u8 new_level; ++ u8 bit; ++ void (*set_led)(u8 bit, enum led_brightness value); ++}; ++ ++static void latch_set_led(u8 bit, enum led_brightness value) ++{ ++ if (value == LED_OFF) ++ mem_keep |= (0x1 << bit); ++ else ++ mem_keep &= ~(0x1 << bit); ++ ++ writeb(mem_keep, iobase); ++} ++ ++static void latch_led_set(struct led_classdev *led_cdev, ++ enum led_brightness value) ++{ ++ struct latch_led_data *led_dat = ++ container_of(led_cdev, struct latch_led_data, cdev); ++ ++ raw_spin_lock(mem_lock); ++ ++ led_dat->set_led(led_dat->bit, value); ++ ++ raw_spin_unlock(mem_lock); ++} ++ ++static int latch_led_probe(struct platform_device *pdev) ++{ ++ struct latch_led_platform_data *pdata = pdev->dev.platform_data; ++ struct latch_led *cur_led; ++ struct latch_led_data *leds_data, *led_dat; ++ int i, ret = 0; ++ ++ if (!pdata) ++ return -EBUSY; ++ ++ leds_data = kzalloc(sizeof(struct latch_led_data) * pdata->num_leds, ++ GFP_KERNEL); ++ if (!leds_data) ++ return -ENOMEM; ++ ++ for (i = 0; i < pdata->num_leds; i++) { ++ cur_led = &pdata->leds[i]; ++ led_dat = &leds_data[i]; ++ ++ led_dat->cdev.name = cur_led->name; ++ led_dat->cdev.default_trigger = cur_led->default_trigger; ++ led_dat->cdev.brightness_set = latch_led_set; ++ led_dat->cdev.brightness = LED_OFF; ++ led_dat->bit = cur_led->bit; ++ led_dat->set_led = pdata->set_led ? pdata->set_led : latch_set_led; ++ ++ ret = led_classdev_register(&pdev->dev, &led_dat->cdev); ++ if (ret < 0) { ++ goto err; ++ } ++ } ++ ++ if (!pdata->set_led) { ++ iobase = ioremap_nocache(pdata->mem, 0x1000); ++ writeb(0xFF, iobase); ++ } ++ platform_set_drvdata(pdev, leds_data); ++ ++ return 0; ++ ++err: ++ if (i > 0) { ++ for (i = i - 1; i >= 0; i--) { ++ led_classdev_unregister(&leds_data[i].cdev); ++ } ++ } ++ ++ kfree(leds_data); ++ ++ return ret; ++} ++ ++static int latch_led_remove(struct platform_device *pdev) ++{ ++ int i; ++ struct latch_led_platform_data *pdata = pdev->dev.platform_data; ++ struct latch_led_data *leds_data; ++ ++ leds_data = platform_get_drvdata(pdev); ++ ++ for (i = 0; i < pdata->num_leds; i++) { ++ led_classdev_unregister(&leds_data[i].cdev); ++ cancel_work_sync(&leds_data[i].work); ++ } ++ ++ kfree(leds_data); ++ ++ return 0; ++} ++ ++static struct platform_driver latch_led_driver = { ++ .probe = latch_led_probe, ++ .remove = latch_led_remove, ++ .driver = { ++ .name = "leds-latch", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static int __init latch_led_init(void) ++{ ++ return platform_driver_register(&latch_led_driver); ++} ++ ++static void __exit latch_led_exit(void) ++{ ++ platform_driver_unregister(&latch_led_driver); ++} ++ ++module_init(latch_led_init); ++module_exit(latch_led_exit); ++ ++MODULE_AUTHOR("Chris Lang "); ++MODULE_DESCRIPTION("Latch LED driver"); +--- a/include/linux/leds.h ++++ b/include/linux/leds.h +@@ -423,4 +423,18 @@ static inline void ledtrig_cpu(enum cpu_ + } + #endif + ++/* For the leds-latch driver */ ++struct latch_led { ++ const char *name; ++ char *default_trigger; ++ unsigned bit; ++}; ++ ++struct latch_led_platform_data { ++ int num_leds; ++ u32 mem; ++ struct latch_led *leds; ++ void (*set_led)(u8 bit, enum led_brightness value); ++}; ++ + #endif /* __LINUX_LEDS_H_INCLUDED */ diff --git a/target/linux/ixp4xx/patches-4.9/300-avila_support.patch b/target/linux/ixp4xx/patches-4.9/300-avila_support.patch new file mode 100644 index 0000000000..c801607f4b --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/300-avila_support.patch @@ -0,0 +1,726 @@ +--- a/arch/arm/mach-ixp4xx/avila-pci.c ++++ b/arch/arm/mach-ixp4xx/avila-pci.c +@@ -27,8 +27,8 @@ + #include + #include + +-#define AVILA_MAX_DEV 4 +-#define LOFT_MAX_DEV 6 ++#define AVILA_MAX_DEV 6 ++ + #define IRQ_LINES 4 + + /* PCI controller GPIO to IRQ pin mappings */ +@@ -55,10 +55,8 @@ static int __init avila_map_irq(const st + IXP4XX_GPIO_IRQ(INTD) + }; + +- if (slot >= 1 && +- slot <= (machine_is_loft() ? LOFT_MAX_DEV : AVILA_MAX_DEV) && +- pin >= 1 && pin <= IRQ_LINES) +- return pci_irq_table[(slot + pin - 2) % 4]; ++ if (slot >= 1 && slot <= AVILA_MAX_DEV && pin >= 1 && pin <= IRQ_LINES) ++ return pci_irq_table[(slot + pin - 2) % IRQ_LINES]; + + return -1; + } +--- a/arch/arm/mach-ixp4xx/avila-setup.c ++++ b/arch/arm/mach-ixp4xx/avila-setup.c +@@ -14,9 +14,16 @@ + #include + #include + #include ++#include ++#include ++#include + #include + #include + #include ++#include ++#include ++#include ++#include + #include + #include + #include +@@ -26,10 +33,25 @@ + #include + #include + #include ++#include + + #define AVILA_SDA_PIN 7 + #define AVILA_SCL_PIN 6 + ++/* User LEDs */ ++#define AVILA_GW23XX_LED_USER_GPIO 3 ++#define AVILA_GW23X7_LED_USER_GPIO 4 ++ ++/* gpio mask used by platform device */ ++#define AVILA_GPIO_MASK (1 << 1) | (1 << 3) | (1 << 5) | (1 << 7) | (1 << 9) ++ ++struct avila_board_info { ++ unsigned char *model; ++ void (*setup)(void); ++}; ++ ++static struct avila_board_info *avila_info __initdata; ++ + static struct flash_platform_data avila_flash_data = { + .map_name = "cfi_probe", + .width = 2, +@@ -105,14 +127,69 @@ static struct platform_device avila_uart + .resource = avila_uart_resources + }; + +-static struct resource avila_pata_resources[] = { ++static struct resource avila_optional_uart_resources[] = { + { +- .flags = IORESOURCE_MEM +- }, ++ .start = 0x54000000, ++ .end = 0x54000fff, ++ .flags = IORESOURCE_MEM ++ },{ ++ .start = 0x55000000, ++ .end = 0x55000fff, ++ .flags = IORESOURCE_MEM ++ },{ ++ .start = 0x56000000, ++ .end = 0x56000fff, ++ .flags = IORESOURCE_MEM ++ },{ ++ .start = 0x57000000, ++ .end = 0x57000fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port avila_optional_uart_data[] = { + { +- .flags = IORESOURCE_MEM, ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ .rw_delay = 2, ++ },{ ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ .rw_delay = 2, ++ },{ ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ .rw_delay = 2, ++ },{ ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ .rw_delay = 2, + }, ++ { } ++}; ++ ++static struct platform_device avila_optional_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM1, ++ .dev.platform_data = avila_optional_uart_data, ++ .num_resources = 4, ++ .resource = avila_optional_uart_resources, ++}; ++ ++static struct resource avila_pata_resources[] = { + { ++ .flags = IORESOURCE_MEM ++ },{ ++ .flags = IORESOURCE_MEM, ++ },{ + .name = "intrq", + .start = IRQ_IXP4XX_GPIO12, + .end = IRQ_IXP4XX_GPIO12, +@@ -133,21 +210,237 @@ static struct platform_device avila_pata + .resource = avila_pata_resources, + }; + ++/* Built-in 10/100 Ethernet MAC interfaces */ ++static struct eth_plat_info avila_npeb_data = { ++ .phy = 0, ++ .rxq = 3, ++ .txreadyq = 20, ++}; ++ ++static struct eth_plat_info avila_npec_data = { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++}; ++ ++static struct platform_device avila_npeb_device = { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = &avila_npeb_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++}; ++ ++static struct platform_device avila_npec_device = { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = &avila_npec_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++}; ++ ++static struct gpio_led avila_gpio_leds[] = { ++ { ++ .name = "user", /* green led */ ++ .gpio = AVILA_GW23XX_LED_USER_GPIO, ++ .active_low = 1, ++ }, ++ { ++ .name = "radio1", /* green led */ ++ .gpio = 104, ++ .active_low = 1, ++ }, ++ { ++ .name = "radio2", /* green led */ ++ .gpio = 105, ++ .active_low = 1, ++ }, ++ { ++ .name = "radio3", /* green led */ ++ .gpio = 106, ++ .active_low = 1, ++ }, ++ { ++ .name = "radio4", /* green led */ ++ .gpio = 107, ++ .active_low = 1, ++ }, ++ ++}; ++ ++static struct gpio_led_platform_data avila_gpio_leds_data = { ++ .num_leds = 1, ++ .leds = avila_gpio_leds, ++}; ++ ++static struct platform_device avila_gpio_leds_device = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev.platform_data = &avila_gpio_leds_data, ++}; ++ ++static struct latch_led avila_latch_leds[] = { ++ { ++ .name = "led0", /* green led */ ++ .bit = 0, ++ }, ++ { ++ .name = "led1", /* green led */ ++ .bit = 1, ++ }, ++ { ++ .name = "led2", /* green led */ ++ .bit = 2, ++ }, ++ { ++ .name = "led3", /* green led */ ++ .bit = 3, ++ }, ++ { ++ .name = "led4", /* green led */ ++ .bit = 4, ++ }, ++ { ++ .name = "led5", /* green led */ ++ .bit = 5, ++ }, ++ { ++ .name = "led6", /* green led */ ++ .bit = 6, ++ }, ++ { ++ .name = "led7", /* green led */ ++ .bit = 7, ++ } ++}; ++ ++static struct latch_led_platform_data avila_latch_leds_data = { ++ .num_leds = 8, ++ .leds = avila_latch_leds, ++ .mem = 0x51000000, ++}; ++ ++static struct platform_device avila_latch_leds_device = { ++ .name = "leds-latch", ++ .id = -1, ++ .dev.platform_data = &avila_latch_leds_data, ++}; ++ + static struct platform_device *avila_devices[] __initdata = { + &avila_i2c_gpio, +- &avila_flash, + &avila_uart + }; + +-static void __init avila_init(void) ++/* ++ * Audio Devices ++ */ ++ ++static struct platform_device avila_hss_device[] = { ++ { ++ .name = "gw_avila_hss", ++ .id = 0, ++ },{ ++ .name = "gw_avila_hss", ++ .id = 1, ++ },{ ++ .name = "gw_avila_hss", ++ .id = 2, ++ },{ ++ .name = "gw_avila_hss", ++ .id = 3, ++ }, ++}; ++ ++static struct platform_device avila_pcm_device[] = { ++ { ++ .name = "gw_avila-audio", ++ .id = 0, ++ },{ ++ .name = "gw_avila-audio", ++ .id = 1, ++ },{ ++ .name = "gw_avila-audio", ++ .id = 2, ++ },{ ++ .name = "gw_avila-audio", ++ .id = 3, ++ } ++}; ++ ++static void setup_audio_devices(void) { ++ platform_device_register(&avila_hss_device[0]); ++ platform_device_register(&avila_hss_device[1]); ++ platform_device_register(&avila_hss_device[2]); ++ platform_device_register(&avila_hss_device[3]); ++ ++ platform_device_register(&avila_pcm_device[0]); ++ platform_device_register(&avila_pcm_device[1]); ++ platform_device_register(&avila_pcm_device[2]); ++ platform_device_register(&avila_pcm_device[3]); ++} ++ ++static void __init avila_gw23xx_setup(void) + { +- ixp4xx_sys_init(); ++ platform_device_register(&avila_npeb_device); ++ platform_device_register(&avila_npec_device); + +- avila_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); +- avila_flash_resource.end = +- IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; ++ platform_device_register(&avila_gpio_leds_device); ++} + +- platform_add_devices(avila_devices, ARRAY_SIZE(avila_devices)); ++static void __init avila_gw2342_setup(void) ++{ ++ platform_device_register(&avila_npeb_device); ++ platform_device_register(&avila_npec_device); ++ ++ platform_device_register(&avila_gpio_leds_device); ++ ++ avila_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(1); ++ avila_pata_resources[0].end = IXP4XX_EXP_BUS_END(1); ++ ++ avila_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(2); ++ avila_pata_resources[1].end = IXP4XX_EXP_BUS_END(2); ++ ++ avila_pata_data.cs0_cfg = IXP4XX_EXP_CS1; ++ avila_pata_data.cs1_cfg = IXP4XX_EXP_CS2; ++ ++ platform_device_register(&avila_pata); ++} ++ ++static void __init avila_gw2345_setup(void) ++{ ++ avila_npeb_data.phy = IXP4XX_ETH_PHY_MAX_ADDR; ++ avila_npeb_data.phy_mask = 0x1e; /* ports 1-4 of the KS8995 switch */ ++ platform_device_register(&avila_npeb_device); ++ ++ avila_npec_data.phy = 5; /* port 5 of the KS8995 switch */ ++ platform_device_register(&avila_npec_device); ++ ++ platform_device_register(&avila_gpio_leds_device); ++ ++ avila_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(1); ++ avila_pata_resources[0].end = IXP4XX_EXP_BUS_END(1); ++ ++ avila_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(2); ++ avila_pata_resources[1].end = IXP4XX_EXP_BUS_END(2); ++ ++ avila_pata_data.cs0_cfg = IXP4XX_EXP_CS1; ++ avila_pata_data.cs1_cfg = IXP4XX_EXP_CS2; ++ ++ platform_device_register(&avila_pata); ++} ++ ++static void __init avila_gw2347_setup(void) ++{ ++ platform_device_register(&avila_npeb_device); ++ ++ avila_gpio_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO; ++ platform_device_register(&avila_gpio_leds_device); ++} ++ ++static void __init avila_gw2348_setup(void) ++{ ++ platform_device_register(&avila_npeb_device); ++ platform_device_register(&avila_npec_device); ++ ++ platform_device_register(&avila_gpio_leds_device); + + avila_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(1); + avila_pata_resources[0].end = IXP4XX_EXP_BUS_END(1); +@@ -159,8 +452,335 @@ static void __init avila_init(void) + avila_pata_data.cs1_cfg = IXP4XX_EXP_CS2; + + platform_device_register(&avila_pata); ++} ++ ++static void __init avila_gw2353_setup(void) ++{ ++ platform_device_register(&avila_npeb_device); ++ platform_device_register(&avila_gpio_leds_device); ++} ++ ++static void __init avila_gw2355_setup(void) ++{ ++ avila_npeb_data.phy = IXP4XX_ETH_PHY_MAX_ADDR; ++ avila_npeb_data.phy_mask = 0x1e; /* ports 1-4 of the KS8995 switch */ ++ platform_device_register(&avila_npeb_device); ++ ++ avila_npec_data.phy = 16; ++ platform_device_register(&avila_npec_device); ++ ++ avila_gpio_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO; ++ platform_device_register(&avila_gpio_leds_device); ++ ++ *IXP4XX_EXP_CS4 |= 0xbfff3c03; ++ avila_latch_leds[0].name = "RXD"; ++ avila_latch_leds[1].name = "TXD"; ++ avila_latch_leds[2].name = "POL"; ++ avila_latch_leds[3].name = "LNK"; ++ avila_latch_leds[4].name = "ERR"; ++ avila_latch_leds_data.num_leds = 5; ++ avila_latch_leds_data.mem = 0x54000000; ++ platform_device_register(&avila_latch_leds_device); ++ ++ avila_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(1); ++ avila_pata_resources[0].end = IXP4XX_EXP_BUS_END(1); ++ ++ avila_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(2); ++ avila_pata_resources[1].end = IXP4XX_EXP_BUS_END(2); ++ ++ avila_pata_data.cs0_cfg = IXP4XX_EXP_CS1; ++ avila_pata_data.cs1_cfg = IXP4XX_EXP_CS2; ++ ++ platform_device_register(&avila_pata); ++} ++ ++static void __init avila_gw2357_setup(void) ++{ ++ platform_device_register(&avila_npeb_device); ++ ++ avila_gpio_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO; ++ platform_device_register(&avila_gpio_leds_device); ++ ++ *IXP4XX_EXP_CS1 |= 0xbfff3c03; ++ platform_device_register(&avila_latch_leds_device); ++} ++ ++static void __init avila_gw2365_setup(void) ++{ ++ avila_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS4 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO0, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[0].mapbase = 0x54000000; ++ avila_optional_uart_data[0].membase = (void __iomem *)ioremap(0x54000000, 0x0fff); ++ avila_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO0; ++ ++ *IXP4XX_EXP_CS5 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO1, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[1].mapbase = 0x55000000; ++ avila_optional_uart_data[1].membase = (void __iomem *)ioremap(0x55000000, 0x0fff); ++ avila_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO1; ++ ++ *IXP4XX_EXP_CS6 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO2, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[2].mapbase = 0x56000000; ++ avila_optional_uart_data[2].membase = (void __iomem *)ioremap(0x56000000, 0x0fff); ++ avila_optional_uart_data[2].irq = IRQ_IXP4XX_GPIO2; ++ ++ *IXP4XX_EXP_CS7 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[3].mapbase = 0x57000000; ++ avila_optional_uart_data[3].membase = (void __iomem *)ioremap(0x57000000, 0x0fff); ++ avila_optional_uart_data[3].irq = IRQ_IXP4XX_GPIO3; ++ ++ platform_device_register(&avila_optional_uart); ++ ++ avila_npeb_data.phy = 1; ++ platform_device_register(&avila_npeb_device); ++ ++ avila_npec_data.phy = 2; ++ platform_device_register(&avila_npec_device); ++ ++ avila_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(2); ++ avila_pata_resources[0].end = IXP4XX_EXP_BUS_END(2); ++ ++ avila_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(3); ++ avila_pata_resources[1].end = IXP4XX_EXP_BUS_END(3); ++ ++ avila_pata_data.cs0_cfg = IXP4XX_EXP_CS2; ++ avila_pata_data.cs1_cfg = IXP4XX_EXP_CS3; ++ ++ platform_device_register(&avila_pata); ++ ++ avila_gpio_leds[0].gpio = 109; ++ avila_gpio_leds_data.num_leds = 5; ++ platform_device_register(&avila_gpio_leds_device); ++ ++ setup_audio_devices(); ++} ++ ++static void __init avila_gw2369_setup(void) ++{ ++ avila_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ avila_npeb_data.phy = 1; ++ platform_device_register(&avila_npeb_device); ++ ++ avila_npec_data.phy = 2; ++ platform_device_register(&avila_npec_device); ++ ++ setup_audio_devices(); ++} ++ ++static void __init avila_gw2370_setup(void) ++{ ++ avila_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ avila_npeb_data.phy = 5; ++ platform_device_register(&avila_npeb_device); ++ ++ avila_npec_data.phy = IXP4XX_ETH_PHY_MAX_ADDR; ++ avila_npec_data.phy_mask = 0x1e; /* ports 1-4 of the KS8995 switch */ ++ platform_device_register(&avila_npec_device); ++ ++ *IXP4XX_EXP_CS2 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO2, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[0].mapbase = 0x52000000; ++ avila_optional_uart_data[0].membase = (void __iomem *)ioremap(0x52000000, 0x0fff); ++ avila_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO2; ++ ++ *IXP4XX_EXP_CS3 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[1].mapbase = 0x53000000; ++ avila_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53000000, 0x0fff); ++ avila_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO3; ++ ++ avila_optional_uart.num_resources = 2; ++ ++ platform_device_register(&avila_optional_uart); ++ ++ avila_gpio_leds[0].gpio = 101; ++ platform_device_register(&avila_gpio_leds_device); ++ ++ setup_audio_devices(); ++} ++ ++static void __init avila_gw2375_setup(void) ++{ ++ avila_npeb_data.phy = 1; ++ platform_device_register(&avila_npeb_device); ++ ++ avila_npec_data.phy = 2; ++ platform_device_register(&avila_npec_device); ++ ++ *IXP4XX_EXP_CS2 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[0].mapbase = 0x52000000; ++ avila_optional_uart_data[0].membase = (void __iomem *)ioremap(0x52000000, 0x0fff); ++ avila_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO10; ++ ++ avila_optional_uart.num_resources = 1; ++ ++ platform_device_register(&avila_optional_uart); ++ ++ setup_audio_devices(); ++} ++ ++ ++static struct avila_board_info avila_boards[] __initdata = { ++ { ++ .model = "GW2342", ++ .setup = avila_gw2342_setup, ++ }, { ++ .model = "GW2345", ++ .setup = avila_gw2345_setup, ++ }, { ++ .model = "GW2347", ++ .setup = avila_gw2347_setup, ++ }, { ++ .model = "GW2348", ++ .setup = avila_gw2348_setup, ++ }, { ++ .model = "GW2353", ++ .setup = avila_gw2353_setup, ++ }, { ++ .model = "GW2355", ++ .setup = avila_gw2355_setup, ++ }, { ++ .model = "GW2357", ++ .setup = avila_gw2357_setup, ++ }, { ++ .model = "GW2365", ++ .setup = avila_gw2365_setup, ++ }, { ++ .model = "GW2369", ++ .setup = avila_gw2369_setup, ++ }, { ++ .model = "GW2370", ++ .setup = avila_gw2370_setup, ++ }, { ++ .model = "GW2373", ++ .setup = avila_gw2369_setup, ++ }, { ++ .model = "GW2375", ++ .setup = avila_gw2375_setup, ++ } ++}; ++ ++static struct avila_board_info * __init avila_find_board_info(char *model) ++{ ++ int i; ++ model[6] = '\0'; ++ ++ for (i = 0; i < ARRAY_SIZE(avila_boards); i++) { ++ struct avila_board_info *info = &avila_boards[i]; ++ if (strcmp(info->model, model) == 0) ++ return info; ++ } ++ ++ return NULL; ++} ++ ++static struct nvmem_device *at24_nvmem; ++ ++static void at24_setup(struct nvmem_device *mem_acc, void *context) ++{ ++ char mac_addr[ETH_ALEN]; ++ char model[7]; ++ ++ at24_nvmem = mem_acc; ++ ++ /* Read MAC addresses */ ++ if (nvmem_device_read(at24_nvmem, 0x0, 6, mac_addr) == 6) { ++ memcpy(&avila_npeb_data.hwaddr, mac_addr, ETH_ALEN); ++ } ++ if (nvmem_device_read(at24_nvmem, 0x6, 6, mac_addr) == 6) { ++ memcpy(&avila_npec_data.hwaddr, mac_addr, ETH_ALEN); ++ } ++ ++ /* Read the first 6 bytes of the model number */ ++ if (nvmem_device_read(at24_nvmem, 0x20, 6, model) == 6) { ++ avila_info = avila_find_board_info(model); ++ } ++ ++} ++ ++static struct at24_platform_data avila_eeprom_info = { ++ .byte_len = 1024, ++ .page_size = 16, ++// .flags = AT24_FLAG_READONLY, ++ .setup = at24_setup, ++}; ++ ++static struct pca953x_platform_data avila_pca_data = { ++ .gpio_base = 100, ++}; ++ ++static struct i2c_board_info __initdata avila_i2c_board_info[] = { ++ { ++ I2C_BOARD_INFO("ds1672", 0x68), ++ }, ++ { ++ I2C_BOARD_INFO("gsp", 0x29), ++ }, ++ { ++ I2C_BOARD_INFO("pca9555", 0x23), ++ .platform_data = &avila_pca_data, ++ }, ++ { ++ I2C_BOARD_INFO("ad7418", 0x28), ++ }, ++ { ++ I2C_BOARD_INFO("24c08", 0x51), ++ .platform_data = &avila_eeprom_info ++ }, ++ { ++ I2C_BOARD_INFO("tlv320aic33", 0x1b), ++ }, ++ { ++ I2C_BOARD_INFO("tlv320aic33", 0x1a), ++ }, ++ { ++ I2C_BOARD_INFO("tlv320aic33", 0x19), ++ }, ++ { ++ I2C_BOARD_INFO("tlv320aic33", 0x18), ++ }, ++}; ++ ++static void __init avila_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ platform_add_devices(avila_devices, ARRAY_SIZE(avila_devices)); ++ ++ i2c_register_board_info(0, avila_i2c_board_info, ++ ARRAY_SIZE(avila_i2c_board_info)); ++} ++ ++static int __init avila_model_setup(void) ++{ ++ if (!machine_is_avila()) ++ return 0; ++ ++ /* default 16MB flash */ ++ avila_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ avila_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_16M - 1; ++ ++ if (avila_info) { ++ printk(KERN_DEBUG "Running on Gateworks Avila %s\n", ++ avila_info->model); ++ avila_info->setup(); ++ } else { ++ printk(KERN_INFO "Unknown/missing Avila model number" ++ " -- defaults will be used\n"); ++ avila_gw23xx_setup(); ++ } ++ platform_device_register(&avila_flash); + ++ return 0; + } ++late_initcall(avila_model_setup); + + MACHINE_START(AVILA, "Gateworks Avila Network Platform") + /* Maintainer: Deepak Saxena */ diff --git a/target/linux/ixp4xx/patches-4.4/304-ixp4xx_eth_jumboframe.patch b/target/linux/ixp4xx/patches-4.9/304-ixp4xx_eth_jumboframe.patch similarity index 90% rename from target/linux/ixp4xx/patches-4.4/304-ixp4xx_eth_jumboframe.patch rename to target/linux/ixp4xx/patches-4.9/304-ixp4xx_eth_jumboframe.patch index b16086bbc4..108fbcb37a 100644 --- a/target/linux/ixp4xx/patches-4.4/304-ixp4xx_eth_jumboframe.patch +++ b/target/linux/ixp4xx/patches-4.9/304-ixp4xx_eth_jumboframe.patch @@ -9,7 +9,7 @@ #define RX_BUFF_SIZE ALIGN((NET_IP_ALIGN) + MAX_MRU, 4) #define NAPI_WEIGHT 16 -@@ -1315,6 +1315,32 @@ static void destroy_queues(struct port * +@@ -1289,6 +1289,32 @@ static void destroy_queues(struct port * } } @@ -42,7 +42,7 @@ static int eth_open(struct net_device *dev) { struct port *port = netdev_priv(dev); -@@ -1366,6 +1392,8 @@ static int eth_open(struct net_device *d +@@ -1340,6 +1366,8 @@ static int eth_open(struct net_device *d if (npe_send_recv_message(port->npe, &msg, "ETH_SET_FIREWALL_MODE")) return -EIO; @@ -51,7 +51,7 @@ if ((err = request_queues(port)) != 0) return err; -@@ -1505,7 +1533,26 @@ static int eth_close(struct net_device * +@@ -1479,7 +1507,26 @@ static int eth_close(struct net_device * return 0; } diff --git a/target/linux/ixp4xx/patches-4.9/310-gtwx5717_spi_bus.patch b/target/linux/ixp4xx/patches-4.9/310-gtwx5717_spi_bus.patch new file mode 100644 index 0000000000..51f3f14510 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/310-gtwx5717_spi_bus.patch @@ -0,0 +1,57 @@ +--- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c ++++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c +@@ -27,6 +27,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include +@@ -146,9 +148,37 @@ static struct platform_device gtwx5715_f + .resource = >wx5715_flash_resource, + }; + ++static struct spi_gpio_platform_data gtwx5715_spi_platform_data = { ++ .sck = GTWX5715_KSSPI_CLOCK, ++ .mosi = GTWX5715_KSSPI_TXD, ++ .miso = GTWX5715_KSSPI_RXD, ++ .num_chipselect = 1, ++}; ++ ++static struct platform_device gtwx5715_spi_device = { ++ .name = "spi_gpio", ++ .id = 1, ++ .dev = { ++ .platform_data = >wx5715_spi_platform_data, ++ } ++}; ++ ++static struct spi_board_info gtwx5715_spi_devices[] __initdata = { ++ { ++ .modalias = "spi-ks8995", ++ .max_speed_hz = 5000000, ++ .mode = SPI_MODE_0, ++ .bus_num = 1, ++ .chip_select = 0, ++ .controller_data = (void *)GTWX5715_KSSPI_SELECT, ++ } ++}; ++ ++ + static struct platform_device *gtwx5715_devices[] __initdata = { + >wx5715_uart_device, + >wx5715_flash, ++ >wx5715_spi_device, + }; + + static void __init gtwx5715_init(void) +@@ -158,6 +188,7 @@ static void __init gtwx5715_init(void) + gtwx5715_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); + gtwx5715_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_8M - 1; + ++ spi_register_board_info(gtwx5715_spi_devices, ARRAY_SIZE(gtwx5715_spi_devices)); + platform_add_devices(gtwx5715_devices, ARRAY_SIZE(gtwx5715_devices)); + } + diff --git a/target/linux/ixp4xx/patches-4.9/311-gtwx5717_mac_plat_info.patch b/target/linux/ixp4xx/patches-4.9/311-gtwx5717_mac_plat_info.patch new file mode 100644 index 0000000000..85a8f162c6 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/311-gtwx5717_mac_plat_info.patch @@ -0,0 +1,50 @@ +--- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c ++++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -174,11 +175,39 @@ static struct spi_board_info gtwx5715_sp + } + }; + ++static struct eth_plat_info gtwx5715_npeb_data = { ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x1e, /* ports 1-4 of the KS8995 switch */ ++ .rxq = 3, ++ .txreadyq = 20, ++}; ++ ++static struct eth_plat_info gtwx5715_npec_data = { ++ .phy = 5, /* port 5 of the KS8995 switch */ ++ .rxq = 4, ++ .txreadyq = 21, ++}; ++ ++static struct platform_device gtwx5715_npeb_device = { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = >wx5715_npeb_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++}; ++ ++static struct platform_device gtwx5715_npec_device = { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = >wx5715_npec_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++}; + + static struct platform_device *gtwx5715_devices[] __initdata = { + >wx5715_uart_device, + >wx5715_flash, + >wx5715_spi_device, ++ >wx5715_npeb_device, ++ >wx5715_npec_device, + }; + + static void __init gtwx5715_init(void) diff --git a/target/linux/ixp4xx/patches-4.9/312-ixp4xx_pata_optimization.patch b/target/linux/ixp4xx/patches-4.9/312-ixp4xx_pata_optimization.patch new file mode 100644 index 0000000000..59c2837f0c --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/312-ixp4xx_pata_optimization.patch @@ -0,0 +1,137 @@ +--- a/drivers/ata/pata_ixp4xx_cf.c ++++ b/drivers/ata/pata_ixp4xx_cf.c +@@ -24,16 +24,58 @@ + #include + + #define DRV_NAME "pata_ixp4xx_cf" +-#define DRV_VERSION "0.2" ++#define DRV_VERSION "0.3" + + static int ixp4xx_set_mode(struct ata_link *link, struct ata_device **error) + { ++ struct ixp4xx_pata_data *data = link->ap->host->dev->platform_data; ++ unsigned int pio_mask; + struct ata_device *dev; + + ata_for_each_dev(dev, link, ENABLED) { +- ata_dev_info(dev, "configured for PIO0\n"); +- dev->pio_mode = XFER_PIO_0; +- dev->xfer_mode = XFER_PIO_0; ++ if (dev->id[ATA_ID_FIELD_VALID] & (1 << 1)) { ++ pio_mask = dev->id[ATA_ID_PIO_MODES] & 0x03; ++ if (pio_mask & (1 << 1)) { ++ pio_mask = 4; ++ } else { ++ pio_mask = 3; ++ } ++ } else { ++ pio_mask = (dev->id[ATA_ID_OLD_PIO_MODES] >> 8); ++ } ++ ++ switch (pio_mask){ ++ case 0: ++ ata_dev_printk(dev, KERN_INFO, "configured for PIO0\n"); ++ dev->pio_mode = XFER_PIO_0; ++ dev->xfer_mode = XFER_PIO_0; ++ *data->cs0_cfg = 0x8a473c03; ++ break; ++ case 1: ++ ata_dev_printk(dev, KERN_INFO, "configured for PIO1\n"); ++ dev->pio_mode = XFER_PIO_1; ++ dev->xfer_mode = XFER_PIO_1; ++ *data->cs0_cfg = 0x86433c03; ++ break; ++ case 2: ++ ata_dev_printk(dev, KERN_INFO, "configured for PIO2\n"); ++ dev->pio_mode = XFER_PIO_2; ++ dev->xfer_mode = XFER_PIO_2; ++ *data->cs0_cfg = 0x82413c03; ++ break; ++ case 3: ++ ata_dev_printk(dev, KERN_INFO, "configured for PIO3\n"); ++ dev->pio_mode = XFER_PIO_3; ++ dev->xfer_mode = XFER_PIO_3; ++ *data->cs0_cfg = 0x80823c03; ++ break; ++ case 4: ++ ata_dev_printk(dev, KERN_INFO, "configured for PIO4\n"); ++ dev->pio_mode = XFER_PIO_4; ++ dev->xfer_mode = XFER_PIO_4; ++ *data->cs0_cfg = 0x80403c03; ++ break; ++ } + dev->xfer_shift = ATA_SHIFT_PIO; + dev->flags |= ATA_DFLAG_PIO; + } +@@ -46,6 +88,7 @@ static unsigned int ixp4xx_mmio_data_xfe + unsigned int i; + unsigned int words = buflen >> 1; + u16 *buf16 = (u16 *) buf; ++ unsigned int pio_mask; + struct ata_port *ap = dev->link->ap; + void __iomem *mmio = ap->ioaddr.data_addr; + struct ixp4xx_pata_data *data = dev_get_platdata(ap->host->dev); +@@ -53,8 +96,34 @@ static unsigned int ixp4xx_mmio_data_xfe + /* set the expansion bus in 16bit mode and restore + * 8 bit mode after the transaction. + */ +- *data->cs0_cfg &= ~(0x01); +- udelay(100); ++ if (dev->id[ATA_ID_FIELD_VALID] & (1 << 1)){ ++ pio_mask = dev->id[ATA_ID_PIO_MODES] & 0x03; ++ if (pio_mask & (1 << 1)){ ++ pio_mask = 4; ++ }else{ ++ pio_mask = 3; ++ } ++ }else{ ++ pio_mask = (dev->id[ATA_ID_OLD_PIO_MODES] >> 8); ++ } ++ switch (pio_mask){ ++ case 0: ++ *data->cs0_cfg = 0xa9643c42; ++ break; ++ case 1: ++ *data->cs0_cfg = 0x85033c42; ++ break; ++ case 2: ++ *data->cs0_cfg = 0x80b23c42; ++ break; ++ case 3: ++ *data->cs0_cfg = 0x80823c42; ++ break; ++ case 4: ++ *data->cs0_cfg = 0x80403c42; ++ break; ++ } ++ udelay(5); + + /* Transfer multiple of 2 bytes */ + if (rw == READ) +@@ -79,8 +148,24 @@ static unsigned int ixp4xx_mmio_data_xfe + words++; + } + +- udelay(100); +- *data->cs0_cfg |= 0x01; ++ udelay(5); ++ switch (pio_mask){ ++ case 0: ++ *data->cs0_cfg = 0x8a473c03; ++ break; ++ case 1: ++ *data->cs0_cfg = 0x86433c03; ++ break; ++ case 2: ++ *data->cs0_cfg = 0x82413c03; ++ break; ++ case 3: ++ *data->cs0_cfg = 0x80823c03; ++ break; ++ case 4: ++ *data->cs0_cfg = 0x80403c03; ++ break; ++ } + + return words << 1; + } diff --git a/target/linux/ixp4xx/patches-4.9/500-usr8200_support.patch b/target/linux/ixp4xx/patches-4.9/500-usr8200_support.patch new file mode 100644 index 0000000000..fb7f03ee1a --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/500-usr8200_support.patch @@ -0,0 +1,347 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -93,6 +93,14 @@ config MACH_SIDEWINDER + Engineering Sidewinder board. For more information on this + platform, see http://www.adiengineering.com + ++config MACH_USR8200 ++ bool "USRobotics USR8200" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support the USRobotics ++ USR8200 router board. For more information on this platform, see ++ http://openwrt.org ++ + config MACH_COMPEXWP18 + bool "Compex WP18 / NP18A" + select PCI +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -27,6 +27,7 @@ obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt + obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o + obj-pci-$(CONFIG_MACH_MI424WR) += mi424wr-pci.o ++obj-pci-$(CONFIG_MACH_USR8200) += usr8200-pci.o + + obj-y += common.o + +@@ -55,6 +56,7 @@ obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv + obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o + obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o + obj-$(CONFIG_MACH_MI424WR) += mi424wr-setup.o ++obj-$(CONFIG_MACH_USR8200) += usr8200-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h ++++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h +@@ -44,7 +44,8 @@ static __inline__ void __arch_decomp_set + machine_is_gateway7001() || machine_is_wg302v2() || + machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() || + machine_is_pronghorn() || machine_is_pronghorn_metro() || +- machine_is_wrt300nv2() || machine_is_tw5334()) ++ machine_is_wrt300nv2() || machine_is_tw5334() || ++ machine_is_usr8200()) + uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; + else + uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/usr8200-pci.c +@@ -0,0 +1,77 @@ ++/* ++ * arch/arch/mach-ixp4xx/usr8200-pci.c ++ * ++ * PCI setup routines for USRobotics USR8200 ++ * ++ * Copyright (C) 2008 Peter Denison ++ * ++ * based on pronghorn-pci.c ++ * Copyright (C) 2008 Imre Kaloz ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Peter Denison ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++ ++void __init usr8200_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO7, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init usr8200_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 14) ++ return IRQ_IXP4XX_GPIO7; ++ else if (slot == 15) ++ return IRQ_IXP4XX_GPIO8; ++ else if (slot == 16) { ++ if (pin == 1) ++ return IRQ_IXP4XX_GPIO11; ++ else if (pin == 2) ++ return IRQ_IXP4XX_GPIO10; ++ else if (pin == 3) ++ return IRQ_IXP4XX_GPIO9; ++ else ++ return -1; ++ } else ++ return -1; ++} ++ ++struct hw_pci usr8200_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = usr8200_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = usr8200_map_irq, ++}; ++ ++int __init usr8200_pci_init(void) ++{ ++ if (machine_is_usr8200()) ++ pci_common_init(&usr8200_pci); ++ return 0; ++} ++ ++subsys_initcall(usr8200_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/usr8200-setup.c +@@ -0,0 +1,217 @@ ++/* ++ * arch/arm/mach-ixp4xx/usr8200-setup.c ++ * ++ * Board setup for the USRobotics USR8200 ++ * ++ * Copyright (C) 2008 Peter Denison ++ * ++ * based on pronghorn-setup.c: ++ * Copyright (C) 2008 Imre Kaloz ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Peter Denison ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct flash_platform_data usr8200_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource usr8200_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device usr8200_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &usr8200_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &usr8200_flash_resource, ++}; ++ ++static struct resource usr8200_uart_resources [] = { ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port usr8200_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device usr8200_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = usr8200_uart_data, ++ }, ++ .num_resources = 2, ++ .resource = usr8200_uart_resources, ++}; ++ ++static struct gpio_led usr8200_led_pin[] = { ++ { ++ .name = "usr8200:usb1", ++ .gpio = 0, ++ .active_low = 1, ++ }, ++ { ++ .name = "usr8200:usb2", ++ .gpio = 1, ++ .active_low = 1, ++ }, ++ { ++ .name = "usr8200:ieee1394", ++ .gpio = 2, ++ .active_low = 1, ++ }, ++ { ++ .name = "usr8200:internal", ++ .gpio = 3, ++ .active_low = 1, ++ }, ++ { ++ .name = "usr8200:power", ++ .gpio = 14, ++ } ++}; ++ ++static struct gpio_led_platform_data usr8200_led_data = { ++ .num_leds = ARRAY_SIZE(usr8200_led_pin), ++ .leds = usr8200_led_pin, ++}; ++ ++static struct platform_device usr8200_led = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev.platform_data = &usr8200_led_data, ++}; ++ ++static struct eth_plat_info usr8200_plat_eth[] = { ++ { /* NPEC - LAN with Marvell 88E6060 switch */ ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x0F0000, ++ .rxq = 4, ++ .txreadyq = 21, ++ }, { /* NPEB - WAN */ ++ .phy = 9, ++ .rxq = 3, ++ .txreadyq = 20, ++ } ++}; ++ ++static struct platform_device usr8200_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = usr8200_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = usr8200_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct resource usr8200_rtc_resources = { ++ .flags = IORESOURCE_MEM ++}; ++ ++static struct platform_device usr8200_rtc = { ++ .name = "rtc7301", ++ .id = 0, ++ .num_resources = 1, ++ .resource = &usr8200_rtc_resources, ++}; ++ ++static struct platform_device *usr8200_devices[] __initdata = { ++ &usr8200_flash, ++ &usr8200_uart, ++ &usr8200_led, ++ &usr8200_eth[0], ++ &usr8200_eth[1], ++ &usr8200_rtc, ++}; ++ ++static void __init usr8200_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ usr8200_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ usr8200_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_16M - 1; ++ ++ usr8200_rtc_resources.start = IXP4XX_EXP_BUS_BASE(2); ++ usr8200_rtc_resources.end = IXP4XX_EXP_BUS_BASE(2) + 0x01ff; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS2 = 0x3fff000 | IXP4XX_EXP_BUS_SIZE(0) | IXP4XX_EXP_BUS_WR_EN | ++ IXP4XX_EXP_BUS_CS_EN | IXP4XX_EXP_BUS_BYTE_EN; ++ *IXP4XX_GPIO_GPCLKR = 0x01100000; ++ ++ /* configure button as input */ ++ gpio_line_config(12, IXP4XX_GPIO_IN); ++ ++ platform_add_devices(usr8200_devices, ARRAY_SIZE(usr8200_devices)); ++} ++ ++MACHINE_START(USR8200, "USRobotics USR8200") ++ /* Maintainer: Peter Denison */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = usr8200_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END diff --git a/target/linux/ixp4xx/patches-4.9/520-tw2662_support.patch b/target/linux/ixp4xx/patches-4.9/520-tw2662_support.patch new file mode 100644 index 0000000000..39a261b8e0 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/520-tw2662_support.patch @@ -0,0 +1,316 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -176,6 +176,15 @@ config ARCH_PRPMC1100 + PrPCM1100 Processor Mezanine Module. For more information on + this platform, see . + ++config MACH_TW2662 ++ bool "Titan Wireless TW-266-2" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support the Titan ++ Wireless TW266-2. For more information on this platform, ++ see http://openwrt.org ++ ++ + config MACH_TW5334 + bool "Titan Wireless TW-533-4" + select PCI +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -25,6 +25,7 @@ obj-pci-$(CONFIG_MACH_SIDEWINDER) += sid + obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o + obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o ++obj-pci-$(CONFIG_MACH_TW2662) += tw2662-pci.o + obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o + obj-pci-$(CONFIG_MACH_MI424WR) += mi424wr-pci.o + obj-pci-$(CONFIG_MACH_USR8200) += usr8200-pci.o +@@ -54,6 +55,7 @@ obj-$(CONFIG_MACH_SIDEWINDER) += sidewin + obj-$(CONFIG_MACH_COMPEXWP18) += compex42x-setup.o + obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o + obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o ++obj-$(CONFIG_MACH_TW2662) += tw2662-setup.o + obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o + obj-$(CONFIG_MACH_MI424WR) += mi424wr-setup.o + obj-$(CONFIG_MACH_USR8200) += usr8200-setup.o +--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h ++++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h +@@ -45,7 +45,7 @@ static __inline__ void __arch_decomp_set + machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() || + machine_is_pronghorn() || machine_is_pronghorn_metro() || + machine_is_wrt300nv2() || machine_is_tw5334() || +- machine_is_usr8200()) ++ machine_is_usr8200() || machine_is_tw2662()) + uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; + else + uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/tw2662-pci.c +@@ -0,0 +1,67 @@ ++/* ++ * arch/arm/mach-ixp4xx/tw2662-pci.c ++ * ++ * PCI setup routines for Tiran Wireless TW-266-2 platform ++ * ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * Copyright (C) 2010 Alexandros C. Couloumbis ++ * Copyright (C) 2010 Gabor Juhos ++ * ++ * Maintainer: Deepak Saxena ++ * Maintainer: Alexandros C. Couloumbis ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define SLOT0_DEVID 1 ++#define SLOT1_DEVID 3 ++ ++/* PCI controller GPIO to IRQ pin mappings */ ++#define SLOT0_INTA 11 ++#define SLOT1_INTA 9 ++ ++void __init tw2662_pci_preinit(void) ++{ ++ irq_set_irq_type(IXP4XX_GPIO_IRQ(SLOT0_INTA), IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IXP4XX_GPIO_IRQ(SLOT1_INTA), IRQ_TYPE_LEVEL_LOW); ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init tw2662_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == SLOT0_DEVID) ++ return IXP4XX_GPIO_IRQ(SLOT0_INTA); ++ else if (slot == SLOT1_DEVID) ++ return IXP4XX_GPIO_IRQ(SLOT1_INTA); ++ else return -1; ++} ++ ++struct hw_pci tw2662_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = tw2662_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = tw2662_map_irq, ++}; ++ ++int __init tw2662_pci_init(void) ++{ ++ if (machine_is_tw2662()) ++ pci_common_init(&tw2662_pci); ++ return 0; ++} ++ ++subsys_initcall(tw2662_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/tw2662-setup.c +@@ -0,0 +1,196 @@ ++/* ++ * arch/arm/mach-ixp4xx/tw2662-setup.c ++ * ++ * Titan Wireless TW-266-2 ++ * ++ * Copyright (C) 2010 Gabor Juhos ++ * Copyright (C) 2010 Alexandros C. Couloumbis ++ * ++ * based on ap1000-setup.c: ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* gpio mask used by platform device */ ++#define TW2662_GPIO_MASK (1 << 1) | (1 << 3) | (1 << 5) | (1 << 7) ++ ++static struct flash_platform_data tw2662_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource tw2662_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device tw2662_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &tw2662_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &tw2662_flash_resource, ++}; ++ ++static struct resource tw2662_uart_resources[] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port tw2662_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device tw2662_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev.platform_data = tw2662_uart_data, ++ .num_resources = 2, ++ .resource = tw2662_uart_resources ++}; ++ ++/* Built-in 10/100 Ethernet MAC interfaces */ ++static struct eth_plat_info tw2662_plat_eth[] = { ++ { ++ .phy = 3, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device tw2662_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = tw2662_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = tw2662_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++ ++static struct platform_device *tw2662_devices[] __initdata = { ++ &tw2662_flash, ++ &tw2662_uart, ++ &tw2662_eth[0], ++ &tw2662_eth[1], ++}; ++ ++static char tw2662_mem_fixup[] __initdata = "mem=64M "; ++ ++static void __init tw2662_fixup(struct tag *tags, char **cmdline) ++{ ++ struct tag *t = tags; ++ char *p = *cmdline; ++ ++ /* Find the end of the tags table, taking note of any cmdline tag. */ ++ for (; t->hdr.size; t = tag_next(t)) { ++ if (t->hdr.tag == ATAG_CMDLINE) { ++ p = t->u.cmdline.cmdline; ++ } ++ } ++ ++ /* Overwrite the end of the table with a new cmdline tag. */ ++ t->hdr.tag = ATAG_CMDLINE; ++ t->hdr.size = (sizeof (struct tag_header) + ++ strlen(tw2662_mem_fixup) + strlen(p) + 1 + 4) >> 2; ++ strlcpy(t->u.cmdline.cmdline, tw2662_mem_fixup, COMMAND_LINE_SIZE); ++ strlcpy(t->u.cmdline.cmdline + strlen(tw2662_mem_fixup), p, ++ COMMAND_LINE_SIZE - strlen(tw2662_mem_fixup)); ++ ++ /* Terminate the table. */ ++ t = tag_next(t); ++ t->hdr.tag = ATAG_NONE; ++ t->hdr.size = 0; ++} ++ ++static void __init tw2662_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ tw2662_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ tw2662_flash_resource.end = ++ IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; ++ ++ platform_add_devices(tw2662_devices, ARRAY_SIZE(tw2662_devices)); ++ ++ if (!(is_valid_ether_addr(tw2662_plat_eth[0].hwaddr))) ++ random_ether_addr(tw2662_plat_eth[0].hwaddr); ++ if (!(is_valid_ether_addr(tw2662_plat_eth[1].hwaddr))) { ++ memcpy(tw2662_plat_eth[1].hwaddr, tw2662_plat_eth[0].hwaddr, ETH_ALEN); ++ tw2662_plat_eth[1].hwaddr[5] = (tw2662_plat_eth[0].hwaddr[5] + 1); ++ } ++ ++} ++ ++#ifdef CONFIG_MACH_TW2662 ++MACHINE_START(TW2662, "Titan Wireless TW-266-2") ++ /* Maintainer: Alexandros C. Couloumbis */ ++ .fixup = tw2662_fixup, ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = tw2662_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++#endif diff --git a/target/linux/ixp4xx/patches-4.9/530-ap42x_support.patch b/target/linux/ixp4xx/patches-4.9/530-ap42x_support.patch new file mode 100644 index 0000000000..1afbe3d61e --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/530-ap42x_support.patch @@ -0,0 +1,282 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -4,6 +4,14 @@ menu "Intel IXP4xx Implementation Option + + comment "IXP4xx Platforms" + ++config MACH_AP42X ++ bool "Tonze AP-422/425" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support Tonze's ++ AP-422/425 boards. For more information on this platform, ++ see http://tonze.com.tw ++ + config MACH_NSLU2 + bool + prompt "Linksys NSLU2" +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -5,6 +5,7 @@ + obj-pci-y := + obj-pci-n := + ++obj-pci-$(CONFIG_MACH_AP42X) += ap42x-pci.o + obj-pci-$(CONFIG_ARCH_IXDP4XX) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_AVILA) += avila-pci.o + obj-pci-$(CONFIG_MACH_CAMBRIA) += cambria-pci.o +@@ -32,6 +33,7 @@ obj-pci-$(CONFIG_MACH_USR8200) += usr82 + + obj-y += common.o + ++obj-$(CONFIG_MACH_AP42X) += ap42x-setup.o + obj-$(CONFIG_ARCH_IXDP4XX) += ixdp425-setup.o + obj-$(CONFIG_MACH_AVILA) += avila-setup.o + obj-$(CONFIG_MACH_CAMBRIA) += cambria-setup.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/ap42x-pci.c +@@ -0,0 +1,63 @@ ++/* ++ * arch/arch/mach-ixp4xx/ap42x-pci.c ++ * ++ * PCI setup routines for Tonze AP-422/425 ++ * ++ * Copyright (C) 2012 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++ ++void __init ap42x_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init ap42x_map_irq(const struct pci_dev *dev, u8 slot, ++ u8 pin) ++{ ++ if (slot == 1) ++ return IRQ_IXP4XX_GPIO11; ++ else if (slot == 2) ++ return IRQ_IXP4XX_GPIO10; ++ else return -1; ++} ++ ++struct hw_pci ap42x_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = ap42x_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = ap42x_map_irq, ++}; ++ ++int __init ap42x_pci_init(void) ++{ ++ if (machine_is_ap42x()) ++ pci_common_init(&ap42x_pci); ++ return 0; ++} ++ ++subsys_initcall(ap42x_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/ap42x-setup.c +@@ -0,0 +1,166 @@ ++/* ++ * arch/arm/mach-ixp4xx/ap42x-setup.c ++ * ++ * Board setup for the Tonze AP-42x boards ++ * ++ * Copyright (C) 2012 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct mtd_partition ap42x_flash_partitions[] = { ++ { ++ .name = "RedBoot", ++ .offset = 0x00000000, ++ .size = 0x00080000, ++ }, { ++ .name = "linux", ++ .offset = 0x00080000, ++ .size = 0x00100000, ++ }, { ++ .name = "rootfs", ++ .offset = 0x00180000, ++ .size = 0x00660000, ++ }, { ++ .name = "FIS directory", ++ .offset = 0x007f8000, ++ .size = 0x00007000, ++ }, { ++ .name = "RedBoot config", ++ .offset = 0x007ff000, ++ .size = 0x00001000, ++ }, ++}; ++ ++static struct physmap_flash_data ap42x_flash_data = { ++ .width = 2, ++ .parts = ap42x_flash_partitions, ++ .nr_parts = ARRAY_SIZE(ap42x_flash_partitions), ++}; ++ ++static struct resource ap42x_flash_resource = { ++ .flags = IORESOURCE_MEM, ++ .start = IXP4XX_EXP_BUS_BASE_PHYS, ++ .end = IXP4XX_EXP_BUS_BASE_PHYS + SZ_8M - 1, ++}; ++ ++static struct platform_device ap42x_flash = { ++ .name = "physmap-flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &ap42x_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &ap42x_flash_resource, ++}; ++ ++static struct resource ap42x_uart_resource = { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct plat_serial8250_port ap42x_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device ap42x_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = ap42x_uart_data, ++ }, ++ .num_resources = 1, ++ .resource = &ap42x_uart_resource, ++}; ++ ++static struct eth_plat_info ap42x_plat_eth[] = { ++ { ++ .phy = 2, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device ap42x_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = ap42x_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = ap42x_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *ap42x_devices[] __initdata = { ++ &ap42x_flash, ++ &ap42x_uart, ++ &ap42x_eth[0], ++ &ap42x_eth[1], ++}; ++ ++static void __init ap42x_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ ap42x_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ ap42x_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(ap42x_devices, ARRAY_SIZE(ap42x_devices)); ++} ++ ++#ifdef CONFIG_MACH_AP42X ++MACHINE_START(AP42X, "Tonze AP-422/425") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x100, ++ .init_machine = ap42x_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++#endif +--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h ++++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h +@@ -45,7 +45,8 @@ static __inline__ void __arch_decomp_set + machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() || + machine_is_pronghorn() || machine_is_pronghorn_metro() || + machine_is_wrt300nv2() || machine_is_tw5334() || +- machine_is_usr8200() || machine_is_tw2662()) ++ machine_is_usr8200() || machine_is_tw2662() || ++ machine_is_ap42x()) + uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; + else + uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; diff --git a/target/linux/ixp4xx/patches-4.9/600-skb_avoid_dmabounce.patch b/target/linux/ixp4xx/patches-4.9/600-skb_avoid_dmabounce.patch new file mode 100644 index 0000000000..3f3621b0d0 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/600-skb_avoid_dmabounce.patch @@ -0,0 +1,23 @@ +--- a/net/core/skbuff.c ++++ b/net/core/skbuff.c +@@ -215,6 +215,9 @@ struct sk_buff *__alloc_skb(unsigned int + + if (sk_memalloc_socks() && (flags & SKB_ALLOC_RX)) + gfp_mask |= __GFP_MEMALLOC; ++#ifdef CONFIG_ARCH_IXP4XX ++ gfp_mask |= GFP_DMA; ++#endif + + /* Get the HEAD */ + skb = kmem_cache_alloc_node(cache, gfp_mask & ~__GFP_DMA, node); +@@ -1222,6 +1225,10 @@ int pskb_expand_head(struct sk_buff *skb + if (skb_shared(skb)) + BUG(); + ++#ifdef CONFIG_ARCH_IXP4XX ++ gfp_mask |= GFP_DMA; ++#endif ++ + size = SKB_DATA_ALIGN(size); + + if (skb_pfmemalloc(skb)) diff --git a/target/linux/ixp4xx/patches-4.9/900-ixp4xx-crypto-include-module.h.patch b/target/linux/ixp4xx/patches-4.9/900-ixp4xx-crypto-include-module.h.patch new file mode 100644 index 0000000000..24c93dc741 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/900-ixp4xx-crypto-include-module.h.patch @@ -0,0 +1,10 @@ +--- a/drivers/crypto/ixp4xx_crypto.c ++++ b/drivers/crypto/ixp4xx_crypto.c +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/target/linux/ixp4xx/patches-4.9/910-ixp4xx-nr_irq_lines.patch b/target/linux/ixp4xx/patches-4.9/910-ixp4xx-nr_irq_lines.patch new file mode 100644 index 0000000000..06e09f469d --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/910-ixp4xx-nr_irq_lines.patch @@ -0,0 +1,22 @@ +--- a/arch/arm/mach-ixp4xx/ixdp425-pci.c ++++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c +@@ -53,7 +53,7 @@ static int __init ixdp425_map_irq(const + }; + + if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) +- return pci_irq_table[(slot + pin - 2) % 4]; ++ return pci_irq_table[(slot + pin - 2) % IRQ_LINES]; + + return -1; + } +--- a/arch/arm/mach-ixp4xx/miccpt-pci.c ++++ b/arch/arm/mach-ixp4xx/miccpt-pci.c +@@ -54,7 +54,7 @@ static int __init miccpt_map_irq(const s + }; + + if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) +- return pci_irq_table[(slot + pin - 2) % 4]; ++ return pci_irq_table[(slot + pin - 2) % IRQ_LINES]; + + return -1; + } diff --git a/target/linux/kirkwood/base-files/etc/board.d/01_leds b/target/linux/kirkwood/base-files/etc/board.d/01_leds index 0d89759180..4e72e344aa 100755 --- a/target/linux/kirkwood/base-files/etc/board.d/01_leds +++ b/target/linux/kirkwood/base-files/etc/board.d/01_leds @@ -10,51 +10,42 @@ board_config_update board=$(board_name) case "$board" in -"dockstar") - ucidef_set_led_default "health" "health" "status:green:health" "1" - ucidef_set_led_default "fault" "fault" "status:orange:fault" "1" - ;; -"linksys-audi") - ucidef_set_led_default "power" "power" "audi:green:power" "1" - ;; -"linksys-viper") - ucidef_set_led_default "health" "health" "viper:white:health" "1" - ucidef_set_led_default "pulse" "pulse" "viper:white:pulse" "1" - ;; -"goflexhome" | \ -"goflexnet") - ucidef_set_led_default "health" "health" "status:green:health" "1" - ucidef_set_led_default "fault" "fault" "status:orange:fault" "0" - ;; -"ib62x0") - ucidef_set_led_default "health" "health" "ib62x0:green:os" "1" - ucidef_set_led_default "fault" "fault" "ib62x0:red:os" "1" - ;; -"pogo_e02") +"cloudengines,pogoe02") ucidef_set_led_default "health" "health" "pogo_e02:green:health" "1" ucidef_set_led_default "fault" "fault" "pogo_e02:orange:fault" "1" ;; -"guruplug-server-plus") - ucidef_set_led_timer "health" "health" "guruplug:red:health" "200" "800" +"linksys,audi") + ucidef_set_led_default "power" "power" "audi:green:power" "1" ;; -"nsa310b") +"linksys,viper") + ucidef_set_led_default "health" "health" "viper:white:health" "1" + ucidef_set_led_default "pulse" "pulse" "viper:white:pulse" "1" + ;; +"raidsonic,ib-nas62x0") + ucidef_set_led_default "health" "health" "ib62x0:green:os" "1" + ucidef_set_led_default "fault" "fault" "ib62x0:red:os" "1" + ;; +"seagate,dockstar") + ucidef_set_led_default "health" "health" "status:green:health" "1" + ucidef_set_led_default "fault" "fault" "status:orange:fault" "1" + ;; +"seagate,goflexhome"|\ +"seagate,goflexnet") + ucidef_set_led_default "health" "health" "status:green:health" "1" + ucidef_set_led_default "fault" "fault" "status:orange:fault" "0" + ;; +"zyxel,nsa310b") ucidef_set_led_default "health" "health" "nsa310:green:sys" "1" ucidef_set_led_usbhost "usb" "USB" "nsa310:green:usb" ucidef_set_led_ataport "hdd" "HDD" "nsa310:green:hdd" "1" ucidef_set_led_ataport "esata" "eSata" "nsa310:green:esata" "2" ;; -"nsa325") +"zyxel,nsa325") ucidef_set_led_default "health" "health" "nsa325:green:sys" "1" ucidef_set_led_usbhost "usb" "USB" "nsa325:green:usb" ucidef_set_led_ataport "hdd1" "HDD1" "nsa325:green:sata1" "1" ucidef_set_led_ataport "hdd2" "HDD2" "nsa325:green:sata2" "2" ;; -"sheevaplug" | \ -"sheevaplug-esata") - ucidef_set_led_timer "health" "health" "sheevaplug:blue:health" "200" "800" - ;; -*) - ;; esac board_config_flush diff --git a/target/linux/kirkwood/base-files/etc/board.d/02_network b/target/linux/kirkwood/base-files/etc/board.d/02_network index 85049d2968..5d66e0ffea 100755 --- a/target/linux/kirkwood/base-files/etc/board.d/02_network +++ b/target/linux/kirkwood/base-files/etc/board.d/02_network @@ -11,32 +11,28 @@ board_config_update board=$(board_name) case "$board" in -"dockstar"|\ -"goflexhome"|\ -"goflexnet"|\ -"ib62x0"|\ -"iconnect"|\ -"nsa310s"|\ -"pogo_e02"|\ -"sheevaplug"|\ -"sheevaplug-esata") +"cisco,on100") + ucidef_set_interface_lan "eth0 eth1" + ;; +"cloudengines,pogoe02"|\ +"cloudengines,pogoplugv4"|\ +"iom,iconnect-1.1"|\ +"raidsonic,ib-nas62x0"|\ +"seagate,dockstar"|\ +"seagate,goflexhome"|\ +"seagate,goflexnet") ucidef_set_interface_lan "eth0" "dhcp" ;; -"guruplug-server-plus") - ucidef_set_interface_lan "eth0 eth1" "dhcp" - ;; -"linksys-audi"|\ -"linksys-viper") +"linksys,audi"|\ +"linksys,viper") ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0" "6@eth1" ;; -"nsa310b"|"nsa325") +"zyxel,nsa310b"|\ +"zyxel,nsa325") ucidef_set_interface_lan "eth0" "dhcp" ucidef_set_interface_macaddr "lan" $( mtd_get_mac_ascii uboot_env ethaddr ) ;; -"on100") - ucidef_set_interface_lan "eth0 eth1" - ;; *) ucidef_set_interface_lan "eth0" ;; diff --git a/target/linux/kirkwood/base-files/etc/diag.sh b/target/linux/kirkwood/base-files/etc/diag.sh index 71a1639c2a..0667ad29fe 100755 --- a/target/linux/kirkwood/base-files/etc/diag.sh +++ b/target/linux/kirkwood/base-files/etc/diag.sh @@ -6,25 +6,28 @@ get_status_led() { case $(board_name) in - dockstar|\ - goflexhome|\ - goflexnet) - status_led="status:orange:fault" + cisco,on100) + status_led="on100:green:health" ;; - pogo_e02) + cloudengines,pogoe02) status_led="pogo_e02:orange:fault" ;; - linksys-audi) + cloudengines,pogoplugv4) + status_led="pogoplugv4:green:health" + ;; + linksys,audi) status_led="audi:green:power" ;; - linksys-viper) + linksys,viper) status_led="viper:white:health" ;; - nsa310b) - status_led="nsa310:green:sys" + seagate,dockstar|\ + seagate,goflexhome|\ + seagate,goflexnet) + status_led="status:orange:fault" ;; - on100) - status_led="on100:green:health" + zyxel,nsa310b) + status_led="nsa310:green:sys" ;; esac } diff --git a/target/linux/kirkwood/base-files/etc/init.d/linksys_recovery b/target/linux/kirkwood/base-files/etc/init.d/linksys_recovery index ba7e4bb393..8fd2f387ab 100755 --- a/target/linux/kirkwood/base-files/etc/init.d/linksys_recovery +++ b/target/linux/kirkwood/base-files/etc/init.d/linksys_recovery @@ -6,7 +6,7 @@ boot() { . /lib/functions.sh case $(board_name) in - linksys-audi|linksys-viper) + linksys,audi|linksys,viper) # make sure auto_recovery in uboot is always on AUTO_RECOVERY_ENA="`fw_printenv -n auto_recovery`" if [ "$AUTO_RECOVERY_ENA" != "yes" ] ; then diff --git a/target/linux/kirkwood/base-files/etc/init.d/nsa310_fancontrol b/target/linux/kirkwood/base-files/etc/init.d/nsa310_fancontrol index 4073c2d559..10eb5aa73c 100755 --- a/target/linux/kirkwood/base-files/etc/init.d/nsa310_fancontrol +++ b/target/linux/kirkwood/base-files/etc/init.d/nsa310_fancontrol @@ -10,7 +10,7 @@ boot() { path_to_hwmon='/sys/devices/platform/ocp@f1000000/f1011000.i2c/i2c-0/0-002e/hwmon/hwmon0' case $(board_name) in - nsa310b) + zyxel,nsa310b) echo 2 > "$path_to_hwmon/pwm1_enable" # fan is on pwm1 echo 1 > "$path_to_hwmon/pwm1_auto_channels" # temp1 is the only one that changes echo 23000 > "$path_to_hwmon/temp1_auto_temp_min" diff --git a/target/linux/kirkwood/base-files/lib/kirkwood.sh b/target/linux/kirkwood/base-files/lib/kirkwood.sh deleted file mode 100755 index f1229fa97b..0000000000 --- a/target/linux/kirkwood/base-files/lib/kirkwood.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2014 OpenWrt.org -# - -KIRKWOOD_BOARD_NAME= -KIRKWOOD_MODEL= - -kirkwood_board_detect() { - local machine - local name - - machine=$(cat /proc/device-tree/model) - - case "$machine" in - "Seagate FreeAgent Dockstar") - name="dockstar" - ;; - - "Seagate GoFlex Home") - name="goflexhome" - ;; - - "Seagate GoFlex Net") - name="goflexnet" - ;; - - "Iomega Iconnect") - name="iconnect" - ;; - - "RaidSonic ICY BOX IB-NAS62x0 (Rev B)") - name="ib62x0" - ;; - - "Cisco Systems ON100") - name="on100" - ;; - - "Cloud Engines Pogoplug E02") - name="pogo_e02" - ;; - - "Linksys Audi (EA3500)") - name="linksys-audi" - ;; - - "Linksys Viper (E4200v2 / EA4500)") - name="linksys-viper" - ;; - - "Globalscale Technologies Guruplug Server Plus") - name="guruplug-server-plus" - ;; - - "Globalscale Technologies SheevaPlug") - name="sheevaplug" - ;; - - "Globalscale Technologies eSATA SheevaPlug") - name="sheevaplug-esata" - ;; - - "ZyXEL NSA310b") - name="nsa310b" - ;; - - "ZyXEL NSA310S") - name="nsa310s" - ;; - - "ZyXEL NSA325") - name="nsa325" - ;; - - *) - name="generic" - ;; - esac - - [ -z "$KIRKWOOD_BOARD_NAME" ] && KIRKWOOD_BOARD_NAME="$name" - [ -z "$KIRKWOOD_MODEL" ] && KIRKWOOD_MODEL="$machine" - - [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" - - echo "$KIRKWOOD_BOARD_NAME" > /tmp/sysinfo/board_name - echo "$KIRKWOOD_MODEL" > /tmp/sysinfo/model -} diff --git a/target/linux/kirkwood/base-files/lib/preinit/01_sysinfo b/target/linux/kirkwood/base-files/lib/preinit/01_sysinfo deleted file mode 100644 index d45fc92ec3..0000000000 --- a/target/linux/kirkwood/base-files/lib/preinit/01_sysinfo +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -do_sysinfo_kirkwood() { - . /lib/kirkwood.sh - - kirkwood_board_detect -} - -boot_hook_add preinit_main do_sysinfo_kirkwood diff --git a/target/linux/kirkwood/base-files/lib/upgrade/platform.sh b/target/linux/kirkwood/base-files/lib/upgrade/platform.sh index b28ee873b3..27012bd21d 100644 --- a/target/linux/kirkwood/base-files/lib/upgrade/platform.sh +++ b/target/linux/kirkwood/base-files/lib/upgrade/platform.sh @@ -1,27 +1,9 @@ RAMFS_COPY_BIN='fw_printenv fw_setenv' RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock' +REQUIRE_IMAGE_METADATA=1 + platform_check_image() { - [ "$#" -gt 1 ] && return 1 - local board="$(board_name)" - local magic="$(get_magic_long "$1")" - - case "$board" in - "linksys-audi"|\ - "linksys-viper") - [ "$magic" != "27051956" -a "$magic" != "73797375" ] && { - echo "Invalid image type." - return 1 - } - return 0 - ;; - *) - nand_do_platform_check $board $1 - return $? - ;; - esac - - echo "Sysupgrade is not yet supported on $board." return 1 } @@ -29,8 +11,8 @@ platform_do_upgrade() { local board="$(board_name)" case "$board" in - "linksys-audi"|\ - "linksys-viper") + "linksys,audi"|\ + "linksys,viper") platform_do_upgrade_linksys "$ARGV" ;; *) diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index fc21aa4657..39d93275f4 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -5,16 +5,10 @@ # See /LICENSE for more information. # -NAND_BLOCKSIZE := 2048-128k - include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk KERNEL_LOADADDR:=0x8000 -TARGET_DEVICES = linksys-audi linksys-viper dockstar goflexnet goflexhome iconnect pogo_e02 ib62x0 nsa310b nsa325 on100 - -UBI_OPTS := -m 2048 -p 128KiB -s 512 -UBIFS_OPTS := -m 2048 -e 126KiB -c 4096 define Device/Default PROFILES := Default @@ -22,99 +16,124 @@ define Device/Default KERNEL := kernel-bin | append-dtb | uImage none KERNEL_NAME := zImage KERNEL_SUFFIX := -uImage - KERNEL_INSTALL := 1 + KERNEL_IN_UBI := 1 PAGESIZE := 2048 SUBPAGESIZE := 512 BLOCKSIZE := 128k - IMAGES := sysupgrade.tar - IMAGE/sysupgrade.tar := sysupgrade-tar -endef - -define Device/dockstar - DEVICE_DTS := kirkwood-dockstar - FILESYSTEMS := squashfs - DEVICE_TITLE := Seagate FreeAgent Dockstar - IMAGES += factory.bin + IMAGES := sysupgrade.bin factory.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/factory.bin := append-ubi - KERNEL_IN_UBI := 1 + SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) endef -define Device/goflexnet -$(Device/dockstar) - DEVICE_TITLE := Seagate GoFlexNet - DEVICE_DTS := kirkwood-goflexnet +define Device/cisco_on100 + DEVICE_TITLE := Cisco Systems ON100 + DEVICE_DTS := kirkwood-on100 + DEVICE_PACKAGES := kmod-i2c-mv64xxx + KERNEL_SIZE := 5376k + KERNEL_IN_UBI := 0 + UBINIZE_OPTS := -E 5 + IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi + BOARD_NAME := on100 endef +TARGET_DEVICES += cisco_on100 -define Device/goflexhome -$(Device/dockstar) - DEVICE_TITLE := Seagate GoFlexHome - DEVICE_DTS := kirkwood-goflexhome +define Device/cloudengines_pogoe02 + DEVICE_TITLE := Cloud Engines Pogoplug E02 + DEVICE_DTS := kirkwood-pogo_e02 + BOARD_NAME := pogo_e02 + SUPPORTED_DEVICES += pogo_e02 endef +TARGET_DEVICES += cloudengines_pogoe02 -define Device/linksys-audi +define Device/cloudengines_pogoplugv4 + DEVICE_TITLE := Cloud Engines Pogoplug V4 + DEVICE_DTS := kirkwood-pogoplug-series-4 + DEVICE_PACKAGES := kmod-usb3 +endef +TARGET_DEVICES += cloudengines_pogoplugv4 + +define Device/iom_iconnect-1.1 + DEVICE_TITLE := Iomega Iconnect + DEVICE_DTS := kirkwood-iconnect + BOARD_NAME := iconnect + SUPPORTED_DEVICES += iconnect +endef +TARGET_DEVICES += iom_iconnect-1.1 + +define Device/linksys_audi DEVICE_TITLE := Linksys EA3500 (Audi) DEVICE_PACKAGES := kmod-mwl8k swconfig wpad-mini DEVICE_DTS := kirkwood-linksys-audi KERNEL_SIZE := 2624k - FILESYSTEMS := squashfs - IMAGES += factory.bin + KERNEL_IN_UBI := 0 UBINIZE_OPTS := -E 5 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi + BOARD_NAME := linksys-audi + SUPPORTED_DEVICES += linksys-audi endef +TARGET_DEVICES += linksys_audi -define Device/linksys-viper +define Device/linksys_viper DEVICE_TITLE := Linksys E4200v2 / EA4500 (Viper) DEVICE_PACKAGES := kmod-mwl8k swconfig wpad-mini DEVICE_DTS := kirkwood-linksys-viper KERNEL_SIZE := 2688k - FILESYSTEMS := squashfs - IMAGES += factory.bin + KERNEL_IN_UBI := 0 UBINIZE_OPTS := -E 5 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi + BOARD_NAME := linksys-viper + SUPPORTED_DEVICES += linksys-viper endef +TARGET_DEVICES += linksys_viper -define Device/iconnect -$(Device/dockstar) - DEVICE_TITLE := Iomega Iconnect - DEVICE_DTS := kirkwood-iconnect +define Device/raidsonic_ib-nas62x0 + DEVICE_TITLE := RaidSonic ICY BOX IB-NAS62x0 + DEVICE_DTS := kirkwood-ib62x0 + BOARD_NAME := ib62x0 + SUPPORTED_DEVICES += ib62x0 endef +TARGET_DEVICES += raidsonic_ib-nas62x0 -define Device/nsa310b -$(Device/dockstar) +define Device/seagate_dockstar + DEVICE_DTS := kirkwood-dockstar + DEVICE_TITLE := Seagate FreeAgent Dockstar + BOARD_NAME := dockstar + SUPPORTED_DEVICES += dockstar +endef +TARGET_DEVICES += seagate_dockstar + +define Device/seagate_goflexnet + DEVICE_TITLE := Seagate GoFlexNet + DEVICE_DTS := kirkwood-goflexnet + BOARD_NAME := goflexnet + SUPPORTED_DEVICES += goflexnet +endef +TARGET_DEVICES += seagate_goflexnet + +define Device/seagate_goflexhome + DEVICE_TITLE := Seagate GoFlexHome + DEVICE_DTS := kirkwood-goflexhome + BOARD_NAME := goflexhome + SUPPORTED_DEVICES += goflexhome +endef +TARGET_DEVICES += seagate_goflexhome + +define Device/zyxel_nsa310b DEVICE_TITLE := ZyXEL NSA310b DEVICE_DTS := kirkwood-nsa310b DEVICE_PACKAGES := kmod-r8169 kmod-gpio-button-hotplug kmod-hwmon-lm85 + BOARD_NAME := nsa310b endef +TARGET_DEVICES += zyxel_nsa310b -define Device/nsa325 -$(Device/dockstar) +define Device/zyxel_nsa325 DEVICE_TITLE := ZyXEL NSA325 (v1 and v2) DEVICE_DTS := kirkwood-nsa325 DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-rtc-pcf8563 kmod-usb3 + BOARD_NAME := nsa325 endef - -define Device/on100 - DEVICE_TITLE := Cisco Systems ON100 - DEVICE_DTS := kirkwood-on100 -# DEVICE_PACKAGES := kmod-mvsdio kmod-usb-storage kmod-i2c-core kmod-i2c-mv64xxx kmod-ata-core kmod-btmrvl kmod-btmrvl-sdio kmod-libertas kmod-libertas-sdio - DEVICE_PACKAGES := kmod-i2c-mv64xxx - KERNEL_SIZE := 5376k - IMAGES += factory.bin - IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi - UBINIZE_OPTS := -E 5 -endef - -define Device/pogo_e02 -$(Device/dockstar) - DEVICE_TITLE := Cloud Engines Pogoplug E02 - DEVICE_DTS := kirkwood-pogo_e02 -endef - -define Device/ib62x0 -$(Device/dockstar) - DEVICE_TITLE := RaidSonic ICY BOX IB-NAS62x0 - DEVICE_DTS := kirkwood-ib62x0 -endef +TARGET_DEVICES += zyxel_nsa325 $(eval $(call BuildImage)) diff --git a/target/linux/kirkwood/patches-4.9/100-ib62x0.patch b/target/linux/kirkwood/patches-4.9/100-ib62x0.patch index d6d10d8144..f4e6947374 100644 --- a/target/linux/kirkwood/patches-4.9/100-ib62x0.patch +++ b/target/linux/kirkwood/patches-4.9/100-ib62x0.patch @@ -1,5 +1,14 @@ --- a/arch/arm/boot/dts/kirkwood-ib62x0.dts +++ b/arch/arm/boot/dts/kirkwood-ib62x0.dts +@@ -5,7 +5,7 @@ + + / { + model = "RaidSonic ICY BOX IB-NAS62x0 (Rev B)"; +- compatible = "raidsonic,ib-nas6210-b", "raidsonic,ib-nas6220-b", "raidsonic,ib-nas6210", "raidsonic,ib-nas6220", "raidsonic,ib-nas62x0", "marvell,kirkwood-88f6281", "marvell,kirkwood"; ++ compatible = "raidsonic,ib-nas62x0", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + + memory { + device_type = "memory"; @@ -117,13 +117,13 @@ }; diff --git a/target/linux/kirkwood/patches-4.9/107-02-nsa310b.patch b/target/linux/kirkwood/patches-4.9/107-02-nsa310b.patch index 7110222936..faf8d891a5 100644 --- a/target/linux/kirkwood/patches-4.9/107-02-nsa310b.patch +++ b/target/linux/kirkwood/patches-4.9/107-02-nsa310b.patch @@ -32,7 +32,7 @@ NOTE: this patch can be upstreamed as-is, LEDE-specific + +/ { + model = "ZyXEL NSA310b"; -+ compatible = "zyxel,nsa310a", "zyxel,nsa310", "marvell,kirkwood-88f6281", "marvell,kirkwood"; ++ compatible = "zyxel,nsa310b", "zyxel,nsa310", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + + memory { + device_type = "memory"; diff --git a/target/linux/kirkwood/patches-4.9/107-03-nsa310s.patch b/target/linux/kirkwood/patches-4.9/107-03-nsa310s.patch deleted file mode 100644 index 0e69f0cfa4..0000000000 --- a/target/linux/kirkwood/patches-4.9/107-03-nsa310s.patch +++ /dev/null @@ -1,267 +0,0 @@ ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -239,6 +239,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ - kirkwood-nsa310.dtb \ - kirkwood-nsa310a.dtb \ - kirkwood-nsa310b.dtb \ -+ kirkwood-nsa310s.dtb \ - kirkwood-nsa320.dtb \ - kirkwood-nsa325.dtb \ - kirkwood-openblocks_a6.dtb \ ---- /dev/null -+++ b/arch/arm/boot/dts/kirkwood-nsa310s.dts -@@ -0,0 +1,254 @@ -+/dts-v1/; -+ -+#include "kirkwood-nsa3x0-common.dtsi" -+ -+/ { -+ model = "ZyXEL NSA310S"; -+ compatible = "zyxel,nsa320s", "marvell,kirkwood-88f6702", "marvell,kirkwood"; -+ -+ memory { -+ device_type = "memory"; -+ reg = <0x00000000 0x10000000>; -+ }; -+ -+ chosen { -+ bootargs = "console=ttyS0,115200n8 earlyprintk"; -+ stdout-path = &uart0; -+ }; -+ -+ ocp@f1000000 { -+ pinctrl: pin-controller@10000 { -+ pinctrl-names = "default"; -+ -+ pmx_sata0: pmx-sata0 { -+ marvell,pins; -+ marvell,function = "sata0"; -+ }; -+ -+ pmx_sata1: pmx-sata1 { -+ marvell,pins; -+ marvell,function = "sata1"; -+ }; -+ -+ pmx_usb_power: pmx-usb-power { -+ marvell,pins = "mpp21"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_pwr_off: pmx-pwr-off { -+ marvell,pins = "mpp27"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_btn_reset: pmx-btn-reset { -+ marvell,pins = "mpp24"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_btn_copy: pmx-btn-copy { -+ marvell,pins = "mpp25"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_btn_power: pmx-btn-power { -+ marvell,pins = "mpp26"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_hdd2_green: pmx-led-hdd2-green { -+ marvell,pins = "mpp34"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_hdd2_red: pmx-led-hdd2-red { -+ marvell,pins = "mpp12"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_usb_green: pmx-led-usb-green { -+ marvell,pins = "mpp15"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_copy_green: pmx-led-copy-green { -+ marvell,pins = "mpp22"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_copy_red: pmx-led-copy-red { -+ marvell,pins = "mpp23"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_sys_green: pmx-led-sys-green { -+ marvell,pins = "mpp28"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_sys_orange: pmx-led-sys-orange { -+ marvell,pins = "mpp29"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_hdd1_green: pmx-led-hdd1-green { -+ marvell,pins = "mpp16"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_hdd1_red: pmx-led-hdd1-red { -+ marvell,pins = "mpp13"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_pwr_sata1: pmx-pwr-sata1 { -+ marvell,pins = "mpp33"; -+ marvell,function = "gpio"; -+ }; -+ -+ }; -+ -+ i2c@11000 { -+ status = "okay"; -+ -+ ht1382: rtc@68 { -+ compatible = "htk,ht1382"; -+ reg = <0x68>; -+ }; -+ }; -+ }; -+ -+ regulators { -+ compatible = "simple-bus"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ pinctrl-0 = <&pmx_pwr_sata1>; -+ pinctrl-names = "default"; -+ -+ usb0_power: regulator@1 { -+ enable-active-high; -+ }; -+ -+ sata1_power: regulator@2 { -+ compatible = "regulator-fixed"; -+ reg = <2>; -+ regulator-name = "SATA1 Power"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ regulator-always-on; -+ regulator-boot-on; -+ enable-active-high; -+ gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+ -+ gpio_keys { -+ power { -+ gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; -+ }; -+ copy { -+ gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; -+ }; -+ reset { -+ gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+ -+ gpio-leds { -+ compatible = "gpio-leds"; -+ -+ green-sys { -+ label = "nsa310s:green:sys"; -+ gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; -+ }; -+ orange-sys { -+ label = "nsa310s:orange:sys"; -+ gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; -+ }; -+ green-hdd1 { -+ label = "nsa310s:green:hdd1"; -+ gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>; -+ }; -+ red-hdd1 { -+ label = "nsa310s:red:hdd1"; -+ gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; -+ }; -+ green-hdd2 { -+ label = "nsa310s:green:hdd2"; -+ gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; -+ }; -+ red-hdd2 { -+ label = "nsa310s:red:hdd2"; -+ gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; -+ }; -+ green-usb { -+ label = "nsa310s:green:usb"; -+ gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; -+ }; -+ green-copy { -+ label = "nsa310s:green:copy"; -+ gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>; -+ }; -+ red-copy { -+ label = "nsa310s:red:copy"; -+ gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+ -+ gpio_poweroff { -+ gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>; -+ }; -+}; -+ -+&nand { -+ status = "okay"; -+ chip-delay = <35>; -+ -+ partition@0 { -+ label = "uboot"; -+ reg = <0x0000000 0xe0000>; -+ read-only; -+ }; -+ -+ partition@e0000 { -+ label = "uboot_env"; -+ reg = <0xe0000 0x100000>; -+ }; -+ -+ partition@100000 { -+ label = "second stage u-boot"; -+ reg = <0x100000 0x200000>; -+ }; -+ -+ partition@200000 { -+ label = "ubi"; -+ reg = <0x200000 0x7e00000>; -+ }; -+}; -+ -+&sata { -+ status = "okay"; -+ nr-ports = <2>; -+}; -+ -+&mdio { -+ status = "okay"; -+ ethphy0: ethernet-phy@1 { -+ compatible = "marvell,88e1318s"; -+ reg = <1>; -+ marvell,reg-init = <0x1 0x16 0x0 0x3>, -+ <0x1 0x10 0x0 0x1017>, -+ <0x1 0x11 0x0 0x4408>, -+ <0x1 0x16 0x0 0x0>, -+ <0x1 0x4 0x0 0x1e1>, -+ <0x1 0x9 0x0 0x300>, -+ <0x1 0x10 0x0 0x3860>, -+ <0x1 0x0 0x0 0x9140>; -+ }; -+}; -+ -+ð0 { -+ status = "okay"; -+ ethernet0-port@0 { -+ phy-handle = <ðphy0>; -+ }; -+}; diff --git a/target/linux/kirkwood/patches-4.9/108-on100.patch b/target/linux/kirkwood/patches-4.9/108-on100.patch index 28c3e535d2..3cab70aaa8 100644 --- a/target/linux/kirkwood/patches-4.9/108-on100.patch +++ b/target/linux/kirkwood/patches-4.9/108-on100.patch @@ -163,8 +163,8 @@ +}; --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -242,6 +242,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ - kirkwood-nsa310s.dtb \ +@@ -241,6 +241,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ + kirkwood-nsa310b.dtb \ kirkwood-nsa320.dtb \ kirkwood-nsa325.dtb \ + kirkwood-on100.dtb \ diff --git a/target/linux/kirkwood/patches-4.9/109-pogoplug_v4.patch b/target/linux/kirkwood/patches-4.9/109-pogoplug_v4.patch new file mode 100644 index 0000000000..dff1966d5c --- /dev/null +++ b/target/linux/kirkwood/patches-4.9/109-pogoplug_v4.patch @@ -0,0 +1,59 @@ +--- a/arch/arm/boot/dts/kirkwood-pogoplug-series-4.dts ++++ b/arch/arm/boot/dts/kirkwood-pogoplug-series-4.dts +@@ -23,6 +23,7 @@ + }; + + chosen { ++ bootargs = "console=ttyS0,115200"; + stdout-path = "uart0:115200n8"; + }; + +@@ -36,8 +37,8 @@ + eject { + debounce_interval = <50>; + wakeup-source; +- linux,code = ; +- label = "Eject Button"; ++ linux,code = ; ++ label = "Reset"; + gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; + }; + }; +@@ -136,29 +137,19 @@ + #size-cells = <1>; + + partition@0 { +- label = "u-boot"; +- reg = <0x00000000 0x200000>; ++ label = "uboot"; ++ reg = <0x00000000 0x1c0000>; + read-only; + }; + +- partition@200000 { +- label = "uImage"; +- reg = <0x00200000 0x300000>; +- }; +- +- partition@500000 { +- label = "uImage2"; +- reg = <0x00500000 0x300000>; ++ partition@1c0000 { ++ label = "uboot_env"; ++ reg = <0x001c0000 0x40000>; + }; + +- partition@800000 { +- label = "failsafe"; +- reg = <0x00800000 0x800000>; +- }; +- +- partition@1000000 { +- label = "root"; +- reg = <0x01000000 0x7000000>; ++ partition@200000 { ++ label = "ubi"; ++ reg = <0x00200000 0x7e00000>; + }; + }; + }; diff --git a/target/linux/lantiq/ase/config-default b/target/linux/lantiq/ase/config-default index b6cd4f3910..b802509022 100644 --- a/target/linux/lantiq/ase/config-default +++ b/target/linux/lantiq/ase/config-default @@ -1,5 +1,4 @@ CONFIG_ADM6996_PHY=y -CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_CPU_MIPS32_R1=y # CONFIG_CPU_MIPS32_R2 is not set CONFIG_CPU_MIPSR1=y @@ -9,18 +8,18 @@ CONFIG_FIRMWARE_IN_KERNEL=y CONFIG_FIRMWARE_MEMMAP=y CONFIG_GPIO_GENERIC=y CONFIG_GPIO_GENERIC_PLATFORM=y -CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y # CONFIG_ISDN is not set # CONFIG_LBDAF is not set CONFIG_LEDS_TRIGGER_HEARTBEAT=y CONFIG_MIPS_FPU_EMULATOR=y +CONFIG_NLS=y # CONFIG_PSB6970_PHY is not set # CONFIG_RTL8366_SMI is not set CONFIG_SOC_AMAZON_SE=y # CONFIG_SOC_XWAY is not set -# CONFIG_SPI is not set +CONFIG_USB=y +CONFIG_USB_COMMON=y +# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y -# CONFIG_WIRELESS is not set -# CONFIG_WLAN is not set CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/lantiq/base-files/etc/board.d/01_leds b/target/linux/lantiq/base-files/etc/board.d/01_leds index 817e2e91c5..0426fb18e6 100755 --- a/target/linux/lantiq/base-files/etc/board.d/01_leds +++ b/target/linux/lantiq/base-files/etc/board.d/01_leds @@ -4,68 +4,71 @@ # based on ar71xx # +. /lib/functions/leds.sh . /lib/functions/uci-defaults.sh -. /lib/functions/lantiq.sh board_config_update -led_wifi="$(lantiq_get_dt_led wifi)" +led_wifi="$(get_dt_led wifi)" [ -n "$led_wifi" ] && ucidef_set_led_wlan "wifi" "wifi" "$led_wifi" "phy0tpt" -led_usb="$(lantiq_get_dt_led usb)" +led_usb="$(get_dt_led usb)" [ -n "$led_usb" ] && ucidef_set_led_usbdev "usb" "usb" "$led_usb" "1-1" -led_usb2="$(lantiq_get_dt_led usb2)" +led_usb2="$(get_dt_led usb2)" [ -n "$led_usb2" ] && ucidef_set_led_usbdev "usb2" "usb2" "$led_usb2" "2-1" -led_dsl="$(lantiq_get_dt_led dsl)" +led_dsl="$(get_dt_led dsl)" [ -n "$led_dsl" ] && { - interface="nas0" - lantiq_is_vdsl_system && interface="ptm0" - - led_internet="$(lantiq_get_dt_led internet)" + led_internet="$(get_dt_led internet)" if [ -n "$led_internet" ]; then ucidef_set_led_default "dsl" "dsl" "$led_dsl" "0" ucidef_set_led_netdev "internet" "internet" "$led_internet" "pppoe-wan" else - ucidef_set_led_netdev "dsl" "dsl" "$led_dsl" "$interface" + ucidef_set_led_netdev "dsl" "dsl" "$led_dsl" "dsl0" fi } board=$(board_name) case "$board" in -ALL0333CJ) +allnet,all0333cj) ucidef_set_led_netdev "lan" "lan" "all0333cj:green:lan" "eth0.1" ;; -ARV4525PW) +arcadyan,arv4525pw) ucidef_set_led_netdev "wifi" "wifi" "arv4525pw:green:wlan" "wlan0" ;; -ARV7506PW11) +arcadyan,arv7506pw11) ucidef_set_led_wlan "wifi" "wifi" "arv7506pw11:green:wlan" "phy0radio" ;; -ARV7519RW22) +arcadyan,arv7519rw22) ucidef_set_led_netdev "lan" "lan" "arv7519rw22:green:lan" "eth0.1" ;; -BTHOMEHUBV5A) +arcadyan,arv752dpw22) + ucidef_set_led_wlan "wifi" "wifi" "arv752dpw22:red:wifi" "phy0radio" + ;; +bt,homehub-v5a) ucidef_set_led_default "dimmed" "dimmed" "dimmed" "0" ;; -DM200) +netgear,dm200) ucidef_set_led_netdev "lan" "lan" "dm200:green:lan" "eth0" ;; -FRITZ7320) +avm,fritz7320) ucidef_set_led_netdev "wifi" "wifi" "fritz7320:green:wlan" "wlan0" ;; -P2812HNUF*) +zyxel,p-2812hnu-f1|\ +zyxel,p-2812hnu-f3) ucidef_set_led_wlan "wifi" "wifi" "p2812hnufx:green:wlan" "phy0radio" ;; -VGV7510KW22*) +arcadyan,vgv7510kw22-nor|\ +arcadyan,vgv7510kw22-brn) ucidef_set_led_wlan "wifi" "wifi" "vgv7510kw22:green:wlan" "phy0radio" ;; -VGV7519*) +arcadyan,vgv7519-nor|\ +arcadyan,vgv7519-brn) ucidef_set_led_wlan "wifi" "wifi" "vgv7519:green:wireless" "phy0radio" ;; -WBMR300) +buffalo,wbmr-300hpd) ucidef_set_led_switch "lan1" "LAN1" "wbmr300:green:lan1" "switch0" "0x08" ucidef_set_led_switch "lan2" "LAN2" "wbmr300:green:lan2" "switch0" "0x04" ucidef_set_led_switch "wan" "WAN" "wbmr300:green:wan" "switch0" "0x10" diff --git a/target/linux/lantiq/base-files/etc/board.d/02_network b/target/linux/lantiq/base-files/etc/board.d/02_network index 2feeb9c208..ca974b071e 100755 --- a/target/linux/lantiq/base-files/etc/board.d/02_network +++ b/target/linux/lantiq/base-files/etc/board.d/02_network @@ -18,171 +18,204 @@ encaps="llc" payload="bridged" lan_mac="" wan_mac="" -interface_wan="" +interface_wan="dsl0" board=$(board_name) case "$board" in -ACMP252|GIGASX76X) +audiocodes,mp-252) ucidef_add_switch "switch0" \ "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5t@eth0" ;; -ALL0333CJ) +allnet,all0333cj) annex="b" lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr) wan_mac=$(macaddr_add "$lan_mac" 1) ucidef_set_interface_lan 'eth0' ;; -ARV4510PW) +arcadyan,arv4510pw) lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr) wan_mac=$(macaddr_add "$lan_mac" 1) ucidef_add_switch "switch0" \ "0:lan:4" "2:lan:2" "1:lan:3" "3:lan:1" "5t@eth0" ;; -ARV4519PW|ARV7510PW22|ARV7518PW|ARV752DPW22|ARV8539PW22) +arcadyan,arv4519pw|arcadyan,arv7510pw22|arcadyan,arv7518pw) ucidef_add_switch "switch0" \ "0t@eth0" "2:lan" "3:lan" "4:lan" "5:lan" ;; -ARV4520PW) +arcadyan,arv4520pw) + annex="b" ucidef_add_switch "switch0" \ "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5t@eth0" ;; -ARV7506PW11) +arcadyan,arv4525pw|arcadyan,arv452cqw|arcadyan,arv7525pw|arcadyan,arv752dpw) + annex="b" + ucidef_set_interface_lan 'eth0' + ;; + +arcadyan,arv7506pw11) + annex="b" wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 22)" 2) ucidef_add_switch "switch0" \ "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5t@eth0" ;; -ARV7519PW) +arcadyan,arv7519pw) wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 22)" 1) ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "4t@eth0" ;; -ARV7519RW22) +arcadyan,arv7519rw22) wan_mac=$(macaddr_add "$(mtd_get_mac_binary boardconfig 22)" 1) ucidef_add_switch "switch0" \ "0:lan:5" "2:lan:3" "3:lan:4" "4:lan:1" "5:lan:2" "6t@eth0" ;; -ASL56026) +arcadyan,arv752dpw22|arcadyan,arv8539pw22) + annex="b" + ucidef_add_switch "switch0" \ + "0t@eth0" "2:lan" "3:lan" "4:lan" "5:lan" + ;; + +alphanetworks,asl56026) lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr) wan_mac=$(mtd_get_mac_ascii uboot_env wanmac) ucidef_add_switch "switch0"\ "2:lan" "3:lan" "6t@eth0" ;; -BTHOMEHUBV2B) +bt,homehub-v2b) lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr) wan_mac=$(macaddr_add "$lan_mac" 1) ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "5t@eth0" ;; -BTHOMEHUBV3A) +bt,homehub-v3a) lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr) wan_mac=$(macaddr_add "$lan_mac" 1) ucidef_set_interface_lan 'eth0' ;; -BTHOMEHUBV5A) +bt,homehub-v5a) lan_mac=$(mtd_get_mac_binary_ubi caldata 4364) wan_mac=$(macaddr_add "$lan_mac" 1) ucidef_add_switch "switch0" \ "0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "5:wan:5" "6t@eth0" ;; -DGN3500*) +netgear,dgn1000b) + annex="b" + ucidef_set_interface_lan 'eth0' + ;; + +netgear,dgn3500|netgear,dgn3500b) + lan_mac=$(mtd_get_mac_ascii uboot-env ethaddr) + wan_mac=$(macaddr_add "$lan_mac" 1) ucidef_add_switch "switch0" \ "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5t@eth0" ;; -DM200) +netgear,dm200) lan_mac=$(mtd_get_mac_binary ART 0) wan_mac=$(macaddr_add "$lan_mac" 1) ucidef_set_interface_lan 'eth0' ;; -EASY80920NAND|EASY80920NOR) +lantiq,easy80920-nand|lantiq,easy80920-nor) lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr) wan_mac=$(macaddr_add "$lan_mac" 1) ucidef_add_switch "switch0" \ "0:lan:4" "1:lan:3" "2:lan:2" "4:lan:1" "5:wan:5" "6t@eth0" ;; -FRITZ3370) +avm,fritz3370) + annex="b" wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 2439)" 1) + ucidef_set_interface_lan 'eth0' ;; -FRITZ7320) +avm,fritz7320) + annex="b" wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 2705)" 1) + ucidef_set_interface_lan 'eth0' ;; -FRITZ7360SL) +avm,fritz7360sl) + annex="b" wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 2705)" 1) ucidef_add_switch "switch0" \ "0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "6t@eth0" ;; -H201L) +siemens,gigaset-sx76x) + annex="b" + ucidef_add_switch "switch0" \ + "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5t@eth0" + ;; + +zte,h201l) + annex="b" ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "4t@eth0" ;; -P2601HNFX) +zyxel,p-2601hn) ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "5t@eth0" ;; -P2812HNUF*) +zyxel,p-2812hnu-f1|zyxel,p-2812hnu-f3) lan_mac=$(mtd_get_mac_ascii uboot-env ethaddr) wan_mac=$(macaddr_add "$lan_mac" 1) ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "4:lan" "5:wan" "6t@eth0" ;; -TDW8970|TDW8980) +tplink,tdw8970|tplink,tdw8980) wan_mac=$(macaddr_add "$(mtd_get_mac_binary boardconfig 61696)" 1) ucidef_add_switch "switch0" \ "0:lan:2" "2:lan:3" "4:lan:4" "5:lan:1" "6t@eth0" ;; -VG3503J) +arcadyan,vg3503j) lan_mac=$(mtd_get_mac_ascii uboot-env ethaddr) wan_mac=$(macaddr_add "$lan_mac" 1) ucidef_add_switch "switch0" \ "2:lan:1" "4:lan:2" "6t@eth0" ;; -VR200v) +tplink,vr200v) wan_mac=$(macaddr_add "$(mtd_get_mac_binary romfile 61696)" 1) ucidef_add_switch "switch0" \ "0:lan" "2:lan" "4:lan" "5:lan" "6t@eth0" ;; -VGV7510KW22*) +arcadyan,vgv7510kw22-nor|arcadyan,vgv7510kw22-brn) + annex="b" wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 22)" 2) ucidef_add_switch "switch0" \ "2:lan:2" "3:lan:1" "4:lan:4" "5:lan:3" "0:wan:5" "6t@eth0" ;; -VGV7519*) +arcadyan,vgv7519-nor|arcadyan,vgv7519-brn) wan_mac=$(mtd_get_mac_binary board_config 22) ucidef_add_switch "switch0" \ "0:lan:4" "1:lan:3" "2:lan:2" "4:lan:1" "5:wan:5" "6t@eth0" ;; -WBMR) +buffalo,wbmr-hp-g300h) ucidef_add_switch "switch0" \ "0t@eth0" "2:lan" "3:lan" "4:lan" "5:lan" ;; -WBMR300) +buffalo,wbmr-300hpd) lan_mac=$(mtd_get_mac_ascii ubootconfig ethaddr) wan_mac="$lan_mac" ucidef_add_switch "switch0" \ @@ -196,13 +229,11 @@ WBMR300) esac ls /lib/modules/$(uname -r)/ltq_atm* 1> /dev/null 2>&1 && \ - ucidef_add_atm_bridge "$vpi" "$vci" "$encaps" "$payload" + ucidef_add_atm_bridge "$vpi" "$vci" "$encaps" "$payload" "dsl" if lantiq_is_vdsl_system; then - interface_wan="ptm0" ucidef_add_vdsl_modem "$annex" "$tone" "$xfer_mode" else - interface_wan="nas0" ucidef_add_adsl_modem "$annex" "/lib/firmware/adsl.bin" fi diff --git a/target/linux/lantiq/base-files/etc/diag.sh b/target/linux/lantiq/base-files/etc/diag.sh index 70ed25cb80..4fb47bd273 100644 --- a/target/linux/lantiq/base-files/etc/diag.sh +++ b/target/linux/lantiq/base-files/etc/diag.sh @@ -2,14 +2,13 @@ # Copyright (C) 2010-2015 OpenWrt.org . /lib/functions/leds.sh -. /lib/functions/lantiq.sh -boot="$(lantiq_get_dt_led boot)" -failsafe="$(lantiq_get_dt_led failsafe)" -running="$(lantiq_get_dt_led running)" +boot="$(get_dt_led boot)" +failsafe="$(get_dt_led failsafe)" +running="$(get_dt_led running)" set_state() { - status_led="$boot" + status_led="$boot" case "$1" in preinit) diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 1c2b8456fc..6b4d09dd33 100644 --- a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -38,7 +38,7 @@ case "$FIRMWARE" in "ath10k/cal-pci-0000:02:00.0.bin") board=$(board_name) case $board in - BTHOMEHUBV5A) + bt,homehub-v5a) ath10k_caldata_extract_ubi "caldata" 20480 2116 ath10k_caldata_set_macaddr $(macaddr_add $(mtd_get_mac_binary_ubi caldata 4364) +3) ;; diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom index 7144423d43..498a509012 100644 --- a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom +++ b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom @@ -116,32 +116,32 @@ case "$FIRMWARE" in board=$(board_name) case "$board" in - ARV7518PW) + arcadyan,arv7518pw) ath9k_eeprom_extract "boardconfig" 1024 1 ;; - ARV8539PW22) + arcadyan,arv8539pw22) ath9k_eeprom_extract "art" 1024 1 ;; - BTHOMEHUBV2B) + bt,homehub-v2b) ath9k_eeprom_extract "art" 0 1 ath9k_patch_fw_mac_crc "00:00:00:00:00:00" 524 ;; - BTHOMEHUBV3A) + bt,homehub-v3a) ath9k_eeprom_extract "art-copy" 0 1 ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_ascii uboot_env ethaddr) +2) 268 ;; - BTHOMEHUBV5A) + bt,homehub-v5a) ath9k_ubi_eeprom_extract "caldata" 4096 0 ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_binary_ubi caldata 4364) +2) 268 ;; - DGN3500*) + netgear,dgn3500|netgear,dgn3500b) ath9k_eeprom_extract "calibration" 61440 0 ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_ascii uboot-env ethaddr) +2) 524 ;; - FRITZ3370|FRITZ7320|FRITZ7360SL) + avm,fritz3370|avm,fritz7320|avm,fritz7360sl) ath9k_eeprom_extract "urlader" 2437 0 ;; - TDW8970|TDW8980) + tplink,tdw8970|tplink,tdw8980) ath9k_eeprom_extract "boardconfig" 135168 0 ;; *) diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/01_led_migration b/target/linux/lantiq/base-files/etc/uci-defaults/01_led_migration index 6ff4355853..dc594e35e9 100644 --- a/target/linux/lantiq/base-files/etc/uci-defaults/01_led_migration +++ b/target/linux/lantiq/base-files/etc/uci-defaults/01_led_migration @@ -56,20 +56,21 @@ migrate_leds() } case "$(board_name)" in -ARV452CQW|\ -ARV7510PW22|\ -ARV7519RW22|\ -ARV752DPW|\ -ARV752DPW22|\ -ASL56026|\ -BTHOMEHUBV2B|\ -BTHOMEHUBV3A|\ -BTHOMEHUBV5A|\ -FRTZ7360SL|\ -VG3503J) +arcadyan,arv452cqw|\ +arcadyan,arv7510pw22|\ +arcadyan,arv7519rw22|\ +arcadyan,arv752dpw|\ +arcadyan,arv752dpw22|\ +alphanetworks,asl56026|\ +bt,homehub-v2b|\ +bt,homehub-v3a|\ +bt,homehub-v5a|\ +avm,fritz7360sl|\ +arcadyan,vg3503j) do_internet_led_rename ;; -DGN3500*) +netgear,dgn3500|\ +netgear,dgn3500b) migrate_leds "dgn3500:blue:wireless=dgn3500:green:wireless" ;; *) diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/02_migrate_xdsl_iface b/target/linux/lantiq/base-files/etc/uci-defaults/02_migrate_xdsl_iface new file mode 100644 index 0000000000..3b0313d1aa --- /dev/null +++ b/target/linux/lantiq/base-files/etc/uci-defaults/02_migrate_xdsl_iface @@ -0,0 +1,67 @@ +#!/bin/sh + +. /lib/functions.sh +. /lib/functions/lantiq.sh + +IFNAME_CHANGED=0 + +rename_xdsl_ifname() +{ + local cfg="$1" + local section="$2" + local option="$3" + local name + + config_get name ${section} $option + case $name in + nas0*) + name=${name/nas0/dsl0} + ;; + ptm0*) + name=${name/ptm0/dsl0} + ;; + *) + return + ;; + esac + + uci set ${cfg}.${section}.$option=$name + IFNAME_CHANGED=1 +} + +add_atm_bridge_nameprefix() +{ + local cfg="$1" + + config_get nameprefix "$cfg" nameprefix + [ -z "$nameprefix" ] || return + + uci set network.${cfg}.nameprefix="dsl" + IFNAME_CHANGED=1 +} + +migrate_network_xdsl_ifname() +{ + rename_xdsl_ifname network "$1" ifname + rename_xdsl_ifname network "$1" name +} + +migrate_led_xdsl_ifname() +{ + rename_xdsl_ifname system "$1" dev +} + +config_load network +config_foreach migrate_network_xdsl_ifname +config_foreach add_atm_bridge_nameprefix atm-bridge + +[ "$IFNAME_CHANGED" = "1" ] && uci commit network + +IFNAME_CHANGED=0 + +config_load system +config_foreach migrate_led_xdsl_ifname led + +[ "$IFNAME_CHANGED" = "1" ] && uci commit system + +exit 0 diff --git a/target/linux/lantiq/base-files/lib/functions/lantiq.sh b/target/linux/lantiq/base-files/lib/functions/lantiq.sh index 8c2e0ce5c1..62c7a6b662 100644 --- a/target/linux/lantiq/base-files/lib/functions/lantiq.sh +++ b/target/linux/lantiq/base-files/lib/functions/lantiq.sh @@ -1,17 +1,5 @@ #!/bin/sh -lantiq_get_dt_led() { - local label - local ledpath - local basepath="/proc/device-tree" - local nodepath="$basepath/aliases/led-$1" - - [ -f "$nodepath" ] && ledpath=$(cat "$nodepath") - [ -n "$ledpath" ] && label=$(cat "$basepath$ledpath/label") - - echo "$label" -} - lantiq_is_vdsl_system() { grep -qE "system type.*: (VR9|xRX200)" /proc/cpuinfo } diff --git a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh index 47f5b73814..a76fec94ed 100755 --- a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh +++ b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh @@ -166,20 +166,18 @@ data_rates() { chipset() { local vig local cs - local csv vig=$(dsl_cmd vig) cs=$(dsl_val "$vig" DSL_ChipSetType) - csv=$(dsl_val "$vig" DSL_ChipSetHWVersion) csfw=$(dsl_val "$vig" DSL_ChipSetFWVersion) csapi=$(dsl_val "$vig" DSL_DriverVersionApi) if [ "$action" = "lucistat" ]; then - echo "dsl.chipset=\"${cs} ${csv}\"" + echo "dsl.chipset=\"${cs}\"" echo "dsl.firmware_version=\"${csfw}\"" echo "dsl.api_version=\"${csapi}\"" else - echo "Chipset: ${cs} ${csv}" + echo "Chipset: ${cs}" echo "Firmware Version: ${csfw}" echo "API Version: ${csapi}" fi diff --git a/target/linux/lantiq/base-files/lib/preinit/01_preinit_board.sh b/target/linux/lantiq/base-files/lib/preinit/01_preinit_board.sh deleted file mode 100755 index aef946036e..0000000000 --- a/target/linux/lantiq/base-files/lib/preinit/01_preinit_board.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -lantiq_board_detect() { - name=`grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/\(.*\) - .*/\1/g"` - model=`grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/.* - \(.*\)/\1/g"` - [ -z "$name" ] && name="unknown" - [ -z "$model" ] && model="unknown" - [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" - echo $name > /tmp/sysinfo/board_name - echo $model > /tmp/sysinfo/model -} - -do_lantiq() { - . /lib/functions/lantiq.sh - - lantiq_board_detect -} - -boot_hook_add preinit_main do_lantiq diff --git a/target/linux/lantiq/base-files/lib/upgrade/platform.sh b/target/linux/lantiq/base-files/lib/upgrade/platform.sh index 9158fa742f..77b3868dc0 100755 --- a/target/linux/lantiq/base-files/lib/upgrade/platform.sh +++ b/target/linux/lantiq/base-files/lib/upgrade/platform.sh @@ -9,7 +9,7 @@ platform_pre_upgrade() { local board=$(board_name) case "$board" in - BTHOMEHUBV2B|BTHOMEHUBV3A|BTHOMEHUBV5A|P2812HNUF* ) + bt,homehub-v2b|bt,homehub-v3a|bt,homehub-v5a|zyxel,p-2812hnu-f1|zyxel,p-2812hnu-f3) nand_do_upgrade $1 ;; esac diff --git a/target/linux/lantiq/config-4.9 b/target/linux/lantiq/config-4.9 index 387a1893b8..a98509e5d6 100644 --- a/target/linux/lantiq/config-4.9 +++ b/target/linux/lantiq/config-4.9 @@ -12,7 +12,6 @@ CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_USE_BUILTIN_BSWAP=y CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y -CONFIG_BLK_MQ_PCI=y CONFIG_CEVT_R4K=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLONE_BACKWARDS=y @@ -151,20 +150,13 @@ CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y # CONFIG_NO_IOPORT_MAP is not set CONFIG_OF=y CONFIG_OF_ADDRESS=y -CONFIG_OF_ADDRESS_PCI=y CONFIG_OF_EARLY_FLATTREE=y CONFIG_OF_FLATTREE=y CONFIG_OF_GPIO=y CONFIG_OF_IRQ=y CONFIG_OF_MDIO=y CONFIG_OF_NET=y -CONFIG_OF_PCI=y -CONFIG_OF_PCI_IRQ=y -CONFIG_PCI=y -# CONFIG_PCIE_LANTIQ is not set -CONFIG_PCI_DOMAINS=y CONFIG_PCI_DRIVERS_LEGACY=y -CONFIG_PCI_LANTIQ=y CONFIG_PERF_USE_VMALLOC=y CONFIG_PGTABLE_LEVELS=2 CONFIG_PHYLIB=y diff --git a/target/linux/lantiq/dts/ACMP252.dts b/target/linux/lantiq/dts/ACMP252.dts index a94014b0f9..7294720117 100644 --- a/target/linux/lantiq/dts/ACMP252.dts +++ b/target/linux/lantiq/dts/ACMP252.dts @@ -3,7 +3,8 @@ #include "danube.dtsi" / { - model = "ACMP252 - AudioCodes MediaPack MP-252"; + compatible = "audiocodes,mp-252", "lantiq,xway", "lantiq,danube"; + model = "AudioCodes MediaPack MP-252"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ALL0333CJ.dts b/target/linux/lantiq/dts/ALL0333CJ.dts index 99174c53fb..16c5facb35 100644 --- a/target/linux/lantiq/dts/ALL0333CJ.dts +++ b/target/linux/lantiq/dts/ALL0333CJ.dts @@ -3,7 +3,8 @@ #include "amazonse.dtsi" / { - model = "ALL0333CJ - Allnet ALL0333CJ DSL Modem"; + compatible = "allnet,all0333cj", "lantiq,xway", "lantiq,ase"; + model = "Allnet ALL0333CJ DSL Modem"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV4510PW.dts b/target/linux/lantiq/dts/ARV4510PW.dts index 17609e25ba..4720b57dd3 100644 --- a/target/linux/lantiq/dts/ARV4510PW.dts +++ b/target/linux/lantiq/dts/ARV4510PW.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV4510PW - Wippies, Elisa"; + compatible = "arcadyan,arv4510pw", "lantiq,xway", "lantiq,danube"; + model = "Wippies, Elisa"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV4518PWR01.dts b/target/linux/lantiq/dts/ARV4518PWR01.dts index 21a03dde48..34f868f484 100644 --- a/target/linux/lantiq/dts/ARV4518PWR01.dts +++ b/target/linux/lantiq/dts/ARV4518PWR01.dts @@ -3,5 +3,6 @@ #include "ARV4518PWR01.dtsi" / { - model = "ARV4518PWR01 - SMC7908A-ISP"; + compatible = "arcadyan,arv4518pwr01", "lantiq,xway", "lantiq,danube"; + model = "SMC7908A-ISP"; }; diff --git a/target/linux/lantiq/dts/ARV4518PWR01A.dts b/target/linux/lantiq/dts/ARV4518PWR01A.dts index e94076b43d..771d0146d8 100644 --- a/target/linux/lantiq/dts/ARV4518PWR01A.dts +++ b/target/linux/lantiq/dts/ARV4518PWR01A.dts @@ -3,7 +3,8 @@ #include "ARV4518PWR01.dtsi" / { - model = "ARV4518PWR01A - SMC7908A-ISP, Airties WAV-221"; + compatible = "arcadyan,arv4518pwr01a", "lantiq,xway", "lantiq,danube"; + model = "SMC7908A-ISP, Airties WAV-221"; fpi@10000000 { pci@E105400 { diff --git a/target/linux/lantiq/dts/ARV4519PW.dts b/target/linux/lantiq/dts/ARV4519PW.dts index 86c0d48763..8f781760f9 100644 --- a/target/linux/lantiq/dts/ARV4519PW.dts +++ b/target/linux/lantiq/dts/ARV4519PW.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV4519PW - Vodafone Netfaster IAD 2, Pirelli P.RG A4201G"; + compatible = "arcadyan,arv4519pw", "lantiq,xway", "lantiq,danube"; + model = "Vodafone Netfaster IAD 2, Pirelli P.RG A4201G"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV4520PW.dts b/target/linux/lantiq/dts/ARV4520PW.dts index 030e316c87..05e0dfe048 100644 --- a/target/linux/lantiq/dts/ARV4520PW.dts +++ b/target/linux/lantiq/dts/ARV4520PW.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV4520PW - Easybox 800, WAV-281"; + compatible = "arcadyan,arv4520pw", "lantiq,xway", "lantiq,danube"; + model = "Easybox 800, WAV-281"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV4525PW.dts b/target/linux/lantiq/dts/ARV4525PW.dts index 64b45aedb7..61548c793a 100644 --- a/target/linux/lantiq/dts/ARV4525PW.dts +++ b/target/linux/lantiq/dts/ARV4525PW.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV4525PW - Speedport W501V Typ A"; + compatible = "arcadyan,arv4525pw", "lantiq,xway", "lantiq,danube"; + model = "Speedport W501V Typ A"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV452CQW.dts b/target/linux/lantiq/dts/ARV452CQW.dts index e43bab3dd1..d996e8b66f 100644 --- a/target/linux/lantiq/dts/ARV452CQW.dts +++ b/target/linux/lantiq/dts/ARV452CQW.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV452CQW - Arcor 801"; + compatible = "arcadyan,arv452cqw", "lantiq,xway", "lantiq,danube"; + model = "Arcor 801"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV7506PW11.dts b/target/linux/lantiq/dts/ARV7506PW11.dts index 1a57d64cb9..3ec4bf41a0 100644 --- a/target/linux/lantiq/dts/ARV7506PW11.dts +++ b/target/linux/lantiq/dts/ARV7506PW11.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV7506PW11 - Alice/O2 IAD 4421"; + compatible = "arcadyan,arv7506pw11", "lantiq,xway", "lantiq,danube"; + model = "Alice/O2 IAD 4421"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV7510PW22.dts b/target/linux/lantiq/dts/ARV7510PW22.dts index 6bad4e3e71..dc3f614b9d 100644 --- a/target/linux/lantiq/dts/ARV7510PW22.dts +++ b/target/linux/lantiq/dts/ARV7510PW22.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV7510PW22 - Astoria Networks"; + compatible = "arcadyan,arv7510pw22", "lantiq,xway", "lantiq,danube"; + model = "Astoria Networks ARV7510PW22"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV7518PW.dts b/target/linux/lantiq/dts/ARV7518PW.dts index a054437258..41b1249323 100644 --- a/target/linux/lantiq/dts/ARV7518PW.dts +++ b/target/linux/lantiq/dts/ARV7518PW.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV7518PW - Astoria Networks"; + compatible = "arcadyan,arv7518pw", "lantiq,xway", "lantiq,danube"; + model = "Astoria Networks ARV7518PW"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV7519PW.dts b/target/linux/lantiq/dts/ARV7519PW.dts index cc6786833f..9983a7906f 100644 --- a/target/linux/lantiq/dts/ARV7519PW.dts +++ b/target/linux/lantiq/dts/ARV7519PW.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV7519PW - Astoria Networks"; + compatible = "arcadyan,arv7519pw", "lantiq,xway", "lantiq,danube"; + model = "Astoria Networks ARV7519PW"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV7519RW22.dts b/target/linux/lantiq/dts/ARV7519RW22.dts index f31c03f451..9e2ae9d6f2 100644 --- a/target/linux/lantiq/dts/ARV7519RW22.dts +++ b/target/linux/lantiq/dts/ARV7519RW22.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV7519RW22 - Orange Livebox 2.1"; + compatible = "arcadyan,arv7519rw22", "lantiq,xway", "lantiq,vr9"; + model = "Orange Livebox 2.1"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV7525PW.dts b/target/linux/lantiq/dts/ARV7525PW.dts index 7d643be2fd..0007535895 100644 --- a/target/linux/lantiq/dts/ARV7525PW.dts +++ b/target/linux/lantiq/dts/ARV7525PW.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV7525PW - Speedport W303V Typ A"; + compatible = "arcadyan,arv7525pw", "lantiq,xway", "lantiq,danube"; + model = "Speedport W303V Typ A"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV752DPW.dts b/target/linux/lantiq/dts/ARV752DPW.dts index 5069d0d748..3591b43671 100644 --- a/target/linux/lantiq/dts/ARV752DPW.dts +++ b/target/linux/lantiq/dts/ARV752DPW.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV752DPW - Arcor 802"; + compatible = "arcadyan,arv752dpw", "lantiq,xway", "lantiq,danube"; + model = "Arcor 802"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV752DPW22.dts b/target/linux/lantiq/dts/ARV752DPW22.dts index d5a6d3184a..8b5be8b76c 100644 --- a/target/linux/lantiq/dts/ARV752DPW22.dts +++ b/target/linux/lantiq/dts/ARV752DPW22.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV752DPW22 - Arcor 803"; + compatible = "arcadyan,arv752dpw22", "lantiq,xway", "lantiq,danube"; + model = "Arcor 803"; chosen { bootargs = "console=ttyLTQ0,115200"; @@ -253,5 +254,6 @@ reg = <0x7000 0 0 0 0>; ralink,mtd-eeprom = <&boardconfig 0x410>; ralink,mtd-eeprom-swap; + mtd-mac-address = <&boardconfig 0x16>; }; }; diff --git a/target/linux/lantiq/dts/ARV8539PW22.dts b/target/linux/lantiq/dts/ARV8539PW22.dts index c55c9a61eb..4edcde9763 100644 --- a/target/linux/lantiq/dts/ARV8539PW22.dts +++ b/target/linux/lantiq/dts/ARV8539PW22.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV8539PW22 - Speedport W 504V Typ A"; + compatible = "arcadyan,arv8539pw22", "lantiq,xway", "lantiq,danube"; + model = "Speedport W 504V Typ A"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ASL56026.dts b/target/linux/lantiq/dts/ASL56026.dts index e2990e4519..293a3e27de 100644 --- a/target/linux/lantiq/dts/ASL56026.dts +++ b/target/linux/lantiq/dts/ASL56026.dts @@ -5,7 +5,8 @@ #include / { - model = "ASL56026 - BT OpenReach VDSL Modem"; + compatible = "alphanetworks,asl56026", "lantiq,xway", "lantiq,vr9"; + model = "BT OpenReach VDSL Modem"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/BTHOMEHUBV2B.dts b/target/linux/lantiq/dts/BTHOMEHUBV2B.dts index 87b4dfbd4a..961fd9b929 100644 --- a/target/linux/lantiq/dts/BTHOMEHUBV2B.dts +++ b/target/linux/lantiq/dts/BTHOMEHUBV2B.dts @@ -5,7 +5,8 @@ #include / { - model = "BTHOMEHUBV2B - BT Home Hub 2B"; /* SoC: Lantiq Danube-S PSB 50712 @ 333MHz V1.3/1.5 */ + compatible = "bt,homehub-v2b", "lantiq,xway", "lantiq,danube"; + model = "BT Home Hub 2B"; /* SoC: Lantiq Danube-S PSB 50712 @ 333MHz V1.3/1.5 */ chosen { bootargs = "console=ttyLTQ0,115200"; @@ -74,7 +75,7 @@ }; nand-parts@0 { /* NAND Flash: Samsung K9F5608U0D-JIB0 32MB */ - compatible = "gen_nand", "lantiq,nand-xway"; + compatible = "lantiq,nand-xway"; lantiq,cs = <1>; bank-width = <2>; reg = <1 0x0 0x2000000 >; diff --git a/target/linux/lantiq/dts/BTHOMEHUBV3A.dts b/target/linux/lantiq/dts/BTHOMEHUBV3A.dts index ca9020bf73..d37b9728d2 100644 --- a/target/linux/lantiq/dts/BTHOMEHUBV3A.dts +++ b/target/linux/lantiq/dts/BTHOMEHUBV3A.dts @@ -5,7 +5,8 @@ #include / { - model = "BTHOMEHUBV3A - BT Home Hub 3A"; /* SoC: Lantiq ar9 @ 333MHz */ + compatible = "bt,homehub-v3a", "lantiq,xway", "lantiq,ar9"; + model = "BT Home Hub 3A"; /* SoC: Lantiq ar9 @ 333MHz */ chosen { bootargs = "console=ttyLTQ0,115200"; @@ -34,7 +35,7 @@ fpi@10000000 { localbus@0 { nand-parts@0 { /* NAND Flash: Samsung K9F5608U0D-JIB0 32MB */ - compatible = "gen_nand", "lantiq,nand-xway"; + compatible = "lantiq,nand-xway"; lantiq,cs = <1>; bank-width = <2>; reg = <1 0x0 0x2000000 >; diff --git a/target/linux/lantiq/dts/BTHOMEHUBV5A.dts b/target/linux/lantiq/dts/BTHOMEHUBV5A.dts index a33690cef6..4bdeddcafa 100644 --- a/target/linux/lantiq/dts/BTHOMEHUBV5A.dts +++ b/target/linux/lantiq/dts/BTHOMEHUBV5A.dts @@ -5,7 +5,8 @@ #include / { - model = "BTHOMEHUBV5A - BT Home Hub 5A"; + compatible = "bt,homehub-v5a", "lantiq,xway", "lantiq,vr9"; + model = "BT Home Hub 5A"; chosen { bootargs = "console=ttyLTQ0,115200"; @@ -27,7 +28,7 @@ fpi@10000000 { localbus@0 { nand-parts@0 { - compatible = "gen_nand", "lantiq,nand-xway"; + compatible = "lantiq,nand-xway"; lantiq,cs = <1>; bank-width = <2>; reg = <0x1 0x0 0x2000000>; diff --git a/target/linux/lantiq/dts/DGN1000B.dts b/target/linux/lantiq/dts/DGN1000B.dts index 558658292e..e5637efca5 100644 --- a/target/linux/lantiq/dts/DGN1000B.dts +++ b/target/linux/lantiq/dts/DGN1000B.dts @@ -5,7 +5,8 @@ #include / { - model = "DGN1000B - Netgear DGN1000B"; + compatible = "netgear,dgn1000b", "lantiq,xway", "lantiq,ase"; + model = "Netgear DGN1000B"; chosen { bootargs = "console=ttyLTQ0,115200"; @@ -60,6 +61,7 @@ }; spi@E100800 { + status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&pins_spi_default>; diff --git a/target/linux/lantiq/dts/DGN3500.dts b/target/linux/lantiq/dts/DGN3500.dts index 9017a427cc..98a2ebd98e 100644 --- a/target/linux/lantiq/dts/DGN3500.dts +++ b/target/linux/lantiq/dts/DGN3500.dts @@ -3,5 +3,6 @@ #include "DGN3500.dtsi" / { - model = "DGN3500 - Netgear DGN3500"; + compatible = "netgear,dgn3500", "lantiq,xway", "lantiq,ar9"; + model = "Netgear DGN3500"; }; diff --git a/target/linux/lantiq/dts/DGN3500B.dts b/target/linux/lantiq/dts/DGN3500B.dts index d0ed5ebd53..d1d788cc7d 100644 --- a/target/linux/lantiq/dts/DGN3500B.dts +++ b/target/linux/lantiq/dts/DGN3500B.dts @@ -3,5 +3,6 @@ #include "DGN3500.dtsi" / { - model = "DGN3500B - Netgear DGN3500B"; + compatible = "netgear,dgn3500b", "lantiq,xway", "lantiq,ar9"; + model = "Netgear DGN3500B"; }; diff --git a/target/linux/lantiq/dts/DM200.dts b/target/linux/lantiq/dts/DM200.dts index 050d558a29..eef4084915 100644 --- a/target/linux/lantiq/dts/DM200.dts +++ b/target/linux/lantiq/dts/DM200.dts @@ -5,7 +5,8 @@ #include / { - model = "DM200 - Netgear DM200"; + compatible = "netgear,dm200", "lantiq,xway", "lantiq,vr9"; + model = "Netgear DM200"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/EASY50712.dts b/target/linux/lantiq/dts/EASY50712.dts index ec3516ca8c..ebd30a7c06 100644 --- a/target/linux/lantiq/dts/EASY50712.dts +++ b/target/linux/lantiq/dts/EASY50712.dts @@ -3,7 +3,8 @@ #include "danube.dtsi" / { - model = "EASY50712 - Intel EASY50712 Nand"; + compatible = "lantiq,easy50712", "lantiq,xway", "lantiq,danube"; + model = "Intel EASY50712 Nand"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/EASY50810.dts b/target/linux/lantiq/dts/EASY50810.dts index 7c274a15a6..605eb826a2 100644 --- a/target/linux/lantiq/dts/EASY50810.dts +++ b/target/linux/lantiq/dts/EASY50810.dts @@ -3,6 +3,9 @@ #include "ar9.dtsi" / { + compatible = "lantiq,easy50810", "lantiq,xway", "lantiq,ar9"; + model = "Lantiq EASY50810"; + chosen { bootargs = "console=ttyLTQ0,115200"; }; diff --git a/target/linux/lantiq/dts/EASY80920.dtsi b/target/linux/lantiq/dts/EASY80920.dtsi index 2209162660..3565842f24 100644 --- a/target/linux/lantiq/dts/EASY80920.dtsi +++ b/target/linux/lantiq/dts/EASY80920.dtsi @@ -3,6 +3,8 @@ #include / { + compatible = "lantiq,easy80920", "lantiq,xway", "lantiq,vr9"; + chosen { bootargs = "console=ttyLTQ0,115200"; }; diff --git a/target/linux/lantiq/dts/EASY80920NAND.dts b/target/linux/lantiq/dts/EASY80920NAND.dts index 332f2fb35c..095bd564da 100644 --- a/target/linux/lantiq/dts/EASY80920NAND.dts +++ b/target/linux/lantiq/dts/EASY80920NAND.dts @@ -4,7 +4,8 @@ #include "EASY80920.dtsi" / { - model = "EASY80920NAND - Intel EASY80920 Nand"; + compatible = "lantiq,easy80920-nand", "lantiq,easy80920", "lantiq,xway", "lantiq,vr9"; + model = "Intel EASY80920 Nand"; chosen { bootargs = "ubi.mtd=ubi ubi.block=0,rootfsA root=/dev/ubiblock0_1"; @@ -14,7 +15,7 @@ localbus@0 { ranges = <0 0 0x4000000 0x3ffffff>; nand-parts@0 { - compatible = "gen_nand", "lantiq,nand-xway"; + compatible = "lantiq,nand-xway"; lantiq,cs = <1>; bank-width = <2>; reg = <0 0x0 0x2000000>; diff --git a/target/linux/lantiq/dts/EASY80920NOR.dts b/target/linux/lantiq/dts/EASY80920NOR.dts index 6ad17d6fcc..e273138d8a 100644 --- a/target/linux/lantiq/dts/EASY80920NOR.dts +++ b/target/linux/lantiq/dts/EASY80920NOR.dts @@ -4,7 +4,8 @@ #include "EASY80920.dtsi" / { - model = "EASY80920NOR - Intel EASY80920 Nor"; + compatible = "lantiq,easy80920-nor", "lantiq,easy80920", "lantiq,xway", "lantiq,vr9"; + model = "Intel EASY80920 Nor"; fpi@10000000 { localbus@0 { diff --git a/target/linux/lantiq/dts/EASY88388.dts b/target/linux/lantiq/dts/EASY88388.dts index a6382e785f..a9c5b3c24b 100644 --- a/target/linux/lantiq/dts/EASY88388.dts +++ b/target/linux/lantiq/dts/EASY88388.dts @@ -5,8 +5,8 @@ #include "falcon-sflash-16M.dtsi" / { - model = "EASY88388 - Lantiq Falcon FTTDP8 Reference Board"; - compatible = "lantiq,falcon-easy88388", "lantiq,falcon"; + model = "Lantiq Falcon FTTDP8 Reference Board"; + compatible = "lantiq,easy88388", "lantiq,falcon"; aliases { spi0 = &ebu_cs0; diff --git a/target/linux/lantiq/dts/EASY88444.dts b/target/linux/lantiq/dts/EASY88444.dts index 583f5fbcd6..ceb81ea13b 100644 --- a/target/linux/lantiq/dts/EASY88444.dts +++ b/target/linux/lantiq/dts/EASY88444.dts @@ -5,8 +5,8 @@ #include "falcon-sflash-16M.dtsi" / { - model = "EASY88444 - Lantiq Falcon FTTdp G.FAST Reference Board"; - compatible = "lantiq,falcon-easy88444", "lantiq,falcon"; + model = "Lantiq Falcon FTTdp G.FAST Reference Board"; + compatible = "lantiq,easy88444", "lantiq,falcon"; aliases { spi0 = &ebu_cs0; diff --git a/target/linux/lantiq/dts/EASY98000-base.dtsi b/target/linux/lantiq/dts/EASY98000-base.dtsi index ccb96247e4..cfe1140ac1 100644 --- a/target/linux/lantiq/dts/EASY98000-base.dtsi +++ b/target/linux/lantiq/dts/EASY98000-base.dtsi @@ -3,7 +3,7 @@ #include / { - compatible = "lantiq,falcon-easy98000", "lantiq,falcon"; + compatible = "lantiq,easy98000", "lantiq,falcon"; memory@0 { device_type = "memory"; diff --git a/target/linux/lantiq/dts/EASY98000NAND.dts b/target/linux/lantiq/dts/EASY98000NAND.dts index 0e5b89d50e..a40cef3931 100644 --- a/target/linux/lantiq/dts/EASY98000NAND.dts +++ b/target/linux/lantiq/dts/EASY98000NAND.dts @@ -4,8 +4,8 @@ #include "EASY98000-base.dtsi" / { - model = "EASY98000NAND - Lantiq Falcon (NAND)"; - compatible = "lantiq,falcon-easy98000-nand", "lantiq,falcon-easy98000", "lantiq,falcon"; + model = "Lantiq Falcon (NAND)"; + compatible = "lantiq,easy98000-nand", "lantiq,easy98000", "lantiq,falcon"; aliases { spi0 = &spi; diff --git a/target/linux/lantiq/dts/EASY98000NOR.dts b/target/linux/lantiq/dts/EASY98000NOR.dts index 812ffb6c5c..ad53bf96e9 100644 --- a/target/linux/lantiq/dts/EASY98000NOR.dts +++ b/target/linux/lantiq/dts/EASY98000NOR.dts @@ -4,8 +4,8 @@ #include "EASY98000-base.dtsi" / { - model = "EASY98000NOR - Lantiq Falcon (NOR)"; - compatible = "lantiq,falcon-easy98000-nor", "lantiq,falcon-easy98000", "lantiq,falcon"; + model = "Lantiq Falcon (NOR)"; + compatible = "lantiq,easy98000-nor", "lantiq,easy98000", "lantiq,falcon"; aliases { spi0 = &spi; diff --git a/target/linux/lantiq/dts/EASY98000SFLASH.dts b/target/linux/lantiq/dts/EASY98000SFLASH.dts index 4fb5ba577d..bbe524e94e 100644 --- a/target/linux/lantiq/dts/EASY98000SFLASH.dts +++ b/target/linux/lantiq/dts/EASY98000SFLASH.dts @@ -5,8 +5,8 @@ #include "falcon-sflash-16M.dtsi" / { - model = "EASY98000SFLASH - Lantiq Falcon (SFLASH)"; - compatible = "lantiq,falcon-easy98000-sflash", "lantiq,falcon-easy98000", "lantiq,falcon"; + model = "Lantiq Falcon (SFLASH)"; + compatible = "lantiq,easy98000-sflash", "lantiq,easy98000", "lantiq,falcon"; aliases { spi0 = &ebu_cs0; diff --git a/target/linux/lantiq/dts/EASY98020.dts b/target/linux/lantiq/dts/EASY98020.dts index 5e5e13017b..c0970ef48c 100644 --- a/target/linux/lantiq/dts/EASY98020.dts +++ b/target/linux/lantiq/dts/EASY98020.dts @@ -6,8 +6,8 @@ #include "falcon-sflash-16M.dtsi" / { - model = "EASY98020 - Lantiq Falcon Reference Board"; - compatible = "lantiq,falcon-easy98020", "lantiq,falcon"; + model = "Lantiq Falcon Reference Board"; + compatible = "lantiq,easy98020", "lantiq,falcon"; aliases { spi0 = &ebu_cs0; diff --git a/target/linux/lantiq/dts/EASY98020V18.dts b/target/linux/lantiq/dts/EASY98020V18.dts index 136f56c9ff..9aa1be91ed 100644 --- a/target/linux/lantiq/dts/EASY98020V18.dts +++ b/target/linux/lantiq/dts/EASY98020V18.dts @@ -6,8 +6,8 @@ #include "falcon-sflash-16M.dtsi" / { - model = "EASY98020V18 - Lantiq Falcon Reference Board V1.8"; - compatible = "lantiq,falcon-easy98020-V18", "lantiq,falcon-easy98020", "lantiq,falcon"; + model = "Lantiq Falcon Reference Board V1.8"; + compatible = "lantiq,easy98020-v18", "lantiq,easy98020", "lantiq,falcon"; aliases { spi0 = &ebu_cs0; diff --git a/target/linux/lantiq/dts/EASY98021.dts b/target/linux/lantiq/dts/EASY98021.dts index a7c5ad9bc0..7b2e490fcc 100644 --- a/target/linux/lantiq/dts/EASY98021.dts +++ b/target/linux/lantiq/dts/EASY98021.dts @@ -6,8 +6,8 @@ #include "falcon-sflash-16M.dtsi" / { - model = "EASY98021 - Lantiq Falcon HGU Reference Board"; - compatible = "lantiq,falcon-easy98021", "lantiq,falcon-easy98020", "lantiq,falcon"; + model = "Lantiq Falcon HGU Reference Board"; + compatible = "lantiq,easy98021", "lantiq,easy98020", "lantiq,falcon"; aliases { spi0 = &ebu_cs0; diff --git a/target/linux/lantiq/dts/EASY98035SYNCE.dts b/target/linux/lantiq/dts/EASY98035SYNCE.dts index f6d98e79ad..df941cdb67 100644 --- a/target/linux/lantiq/dts/EASY98035SYNCE.dts +++ b/target/linux/lantiq/dts/EASY98035SYNCE.dts @@ -4,8 +4,8 @@ #include "falcon-sflash-16M.dtsi" / { - model = "EASY98035SYNCE - Lantiq Falcon SFP Stick with SyncE"; - compatible = "lantiq,falcon-easy98035synce", "lantiq,falcon-sfp", "lantiq,falcon"; + model = "Lantiq Falcon SFP Stick with SyncE"; + compatible = "lantiq,easy98035synce", "lantiq,falcon-sfp", "lantiq,falcon"; aliases { spi0 = &ebu_cs0; diff --git a/target/linux/lantiq/dts/EASY98035SYNCE1588.dts b/target/linux/lantiq/dts/EASY98035SYNCE1588.dts index 8cefef8c14..a3abc6e707 100644 --- a/target/linux/lantiq/dts/EASY98035SYNCE1588.dts +++ b/target/linux/lantiq/dts/EASY98035SYNCE1588.dts @@ -4,8 +4,8 @@ #include "falcon-sflash-16M.dtsi" / { - model = "EASY98035SYNCE1588 - Lantiq Falcon SFP Stick with SyncE/1588"; - compatible = "lantiq,falcon-easy98035synce1588", "lantiq,falcon-sfp", "lantiq,falcon"; + model = "Lantiq Falcon SFP Stick with SyncE/1588"; + compatible = "lantiq,easy98035synce1588", "lantiq,falcon-sfp", "lantiq,falcon"; aliases { spi0 = &ebu_cs0; diff --git a/target/linux/lantiq/dts/FALCON-MDU.dts b/target/linux/lantiq/dts/FALCON-MDU.dts index 32b7e23557..6710bbe98e 100644 --- a/target/linux/lantiq/dts/FALCON-MDU.dts +++ b/target/linux/lantiq/dts/FALCON-MDU.dts @@ -6,7 +6,7 @@ #include "falcon-sflash-16M.dtsi" / { - model = "FALCON-MDU - Lantiq Falcon / Vinax MDU Board"; + model = "Lantiq Falcon / Vinax MDU Board"; compatible = "lantiq,falcon-mdu", "lantiq,falcon"; aliases { diff --git a/target/linux/lantiq/dts/FALCON-SFP.dts b/target/linux/lantiq/dts/FALCON-SFP.dts index bba52d8768..8d45de4ebe 100644 --- a/target/linux/lantiq/dts/FALCON-SFP.dts +++ b/target/linux/lantiq/dts/FALCON-SFP.dts @@ -4,7 +4,7 @@ #include "falcon-sflash-16M.dtsi" / { - model = "FALCON-SFP - Lantiq Falcon SFP Stick"; + model = "Lantiq Falcon SFP Stick"; compatible = "lantiq,falcon-sfp", "lantiq,falcon"; aliases { diff --git a/target/linux/lantiq/dts/FRITZ3370.dts b/target/linux/lantiq/dts/FRITZ3370.dts index 3f57f45ee8..76f7f877bc 100644 --- a/target/linux/lantiq/dts/FRITZ3370.dts +++ b/target/linux/lantiq/dts/FRITZ3370.dts @@ -5,7 +5,8 @@ #include / { - model = "FRITZ3370 - Fritz!Box WLAN 3370"; + compatible = "avm,fritz3370", "lantiq,xway", "lantiq,vr9"; + model = "Fritz!Box WLAN 3370"; chosen { bootargs = "console=ttyLTQ0,115200 ubi.mtd=1,512 root=/dev/mtdblock9"; @@ -28,7 +29,7 @@ fpi@10000000 { localbus@0 { nand-parts@0 { - compatible = "gen_nand", "lantiq,nand-xway"; + compatible = "lantiq,nand-xway"; bank-width = <2>; reg = <1 0x0 0x2000000>; #address-cells = <1>; diff --git a/target/linux/lantiq/dts/FRITZ7320.dts b/target/linux/lantiq/dts/FRITZ7320.dts index 491baee7ea..34d0df9b3b 100644 --- a/target/linux/lantiq/dts/FRITZ7320.dts +++ b/target/linux/lantiq/dts/FRITZ7320.dts @@ -5,7 +5,8 @@ #include / { - model = "FRITZ7320 - 1&1 HomeServer"; + compatible = "avm,fritz7320", "lantiq,xway", "lantiq,ar9"; + model = "1&1 HomeServer"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/FRITZ7360SL.dts b/target/linux/lantiq/dts/FRITZ7360SL.dts index 496fe2e96d..cf82451400 100644 --- a/target/linux/lantiq/dts/FRITZ7360SL.dts +++ b/target/linux/lantiq/dts/FRITZ7360SL.dts @@ -5,7 +5,8 @@ #include / { - model = "FRITZ7360SL - 1&1 HomeServer"; + compatible = "avm,fritz7360sl", "lantiq,xway", "lantiq,vr9"; + model = "1&1 HomeServer"; chosen { bootargs = "console=ttyLTQ0,115200"; @@ -191,12 +192,12 @@ compatible = "lantiq,xrx200-mdio"; phy0: ethernet-phy@0 { reg = <0x00>; - compatible = "ethernet-phy-id004d.d076", "ethernet-phy-ieee802.3-c22"; + compatible = "ethernet-phy-ieee802.3-c22"; reset-gpios = <&gpio 37 GPIO_ACTIVE_LOW>; }; phy1: ethernet-phy@1 { reg = <0x01>; - compatible = "ethernet-phy-id004d.d076", "ethernet-phy-ieee802.3-c22"; + compatible = "ethernet-phy-ieee802.3-c22"; reset-gpios = <&gpio 44 GPIO_ACTIVE_LOW>; }; phy11: ethernet-phy@11 { diff --git a/target/linux/lantiq/dts/GIGASX76X.dts b/target/linux/lantiq/dts/GIGASX76X.dts index f5707e9c9b..99ccbce296 100644 --- a/target/linux/lantiq/dts/GIGASX76X.dts +++ b/target/linux/lantiq/dts/GIGASX76X.dts @@ -5,7 +5,8 @@ #include / { - model = "GIGASX76X - Gigaset SX761,SX762,SX763"; + compatible = "siemens,gigaset-sx76x", "lantiq,xway", "lantiq,danube"; + model = "Gigaset SX761,SX762,SX763"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/H201L.dts b/target/linux/lantiq/dts/H201L.dts index a24d7590e4..01016f45c9 100644 --- a/target/linux/lantiq/dts/H201L.dts +++ b/target/linux/lantiq/dts/H201L.dts @@ -5,7 +5,8 @@ #include / { - model = "H201L - ZTE H210L"; + compatible = "zte,h201l", "lantiq,xway", "lantiq,ar9"; + model = "ZTE H210L"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/P2601HNFX.dts b/target/linux/lantiq/dts/P2601HNFX.dts index 7bfd52cf57..1b885ad841 100644 --- a/target/linux/lantiq/dts/P2601HNFX.dts +++ b/target/linux/lantiq/dts/P2601HNFX.dts @@ -5,7 +5,8 @@ #include / { - model = "P2601HNFX - ZyXEL P-2601HN-Fx"; + compatible = "zyxel,p-2601hn", "lantiq,xway", "lantiq,ar9"; + model = "ZyXEL P-2601HN-Fx"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/P2812HNUF1.dts b/target/linux/lantiq/dts/P2812HNUF1.dts index b1d9eedb35..4a29cd9296 100644 --- a/target/linux/lantiq/dts/P2812HNUF1.dts +++ b/target/linux/lantiq/dts/P2812HNUF1.dts @@ -3,7 +3,8 @@ #include "P2812HNUFX.dtsi" / { - model = "P2812HNUF1 - ZyXEL P-2812HNU-F1"; + compatible = "zyxel,p-2812hnu-f1", "zyxel,p-2812hnu", "lantiq,xway", "lantiq,vr9"; + model = "ZyXEL P-2812HNU-F1"; aliases { led-usb = &usb1; @@ -13,7 +14,7 @@ fpi@10000000 { localbus@0 { nand-parts@0 { - compatible = "gen_nand", "lantiq,nand-xway"; + compatible = "lantiq,nand-xway"; lantiq,cs = <1>; bank-width = <2>; reg = <0 0x0 0x2000000>; diff --git a/target/linux/lantiq/dts/P2812HNUF3.dts b/target/linux/lantiq/dts/P2812HNUF3.dts index 366d034670..d37ad0a8e5 100644 --- a/target/linux/lantiq/dts/P2812HNUF3.dts +++ b/target/linux/lantiq/dts/P2812HNUF3.dts @@ -3,7 +3,8 @@ #include "P2812HNUFX.dtsi" / { - model = "P2812HNUF3 - ZyXEL P-2812HNU-F3"; + compatible = "zyxel,p-2812hnu-f3", "zyxel,p-2812hnu", "lantiq,xway", "lantiq,vr9"; + model = "ZyXEL P-2812HNU-F3"; fpi@10000000 { localbus@0 { @@ -36,7 +37,7 @@ }; nand-parts@0 { - compatible = "gen_nand", "lantiq,nand-xway"; + compatible = "lantiq,nand-xway"; lantiq,cs = <1>; bank-width = <2>; reg = <1 0x0 0x2000000>; diff --git a/target/linux/lantiq/dts/P2812HNUFX.dtsi b/target/linux/lantiq/dts/P2812HNUFX.dtsi index cc133f65ff..9429d5caf3 100644 --- a/target/linux/lantiq/dts/P2812HNUFX.dtsi +++ b/target/linux/lantiq/dts/P2812HNUFX.dtsi @@ -3,6 +3,8 @@ #include / { + compatible = "zyxel,p-2812hnu", "lantiq,xway", "lantiq,vr9"; + chosen { bootargs = "console=ttyLTQ0,115200"; }; diff --git a/target/linux/lantiq/dts/TDW8970.dts b/target/linux/lantiq/dts/TDW8970.dts index 6a376a05c5..25eb3dac67 100644 --- a/target/linux/lantiq/dts/TDW8970.dts +++ b/target/linux/lantiq/dts/TDW8970.dts @@ -3,5 +3,6 @@ #include "TDW89X0.dtsi" / { - model = "TDW8970 - TP-LINK TD-W8970"; + compatible = "tplink,tdw8970", "tplink,tdw89x0", "lantiq,xway", "lantiq,vr9"; + model = "TP-LINK TD-W8970"; }; diff --git a/target/linux/lantiq/dts/TDW8980.dts b/target/linux/lantiq/dts/TDW8980.dts index 0796b2b234..def34b55bb 100644 --- a/target/linux/lantiq/dts/TDW8980.dts +++ b/target/linux/lantiq/dts/TDW8980.dts @@ -3,7 +3,8 @@ #include "TDW89X0.dtsi" / { - model = "TDW8980 - TP-LINK TD-W8980"; + compatible = "tplink,tdw8980", "tplink,tdw89x0", "lantiq,xway", "lantiq,vr9"; + model = "TP-LINK TD-W8980"; fpi@10000000 { gpio: pinmux@E100B10 { diff --git a/target/linux/lantiq/dts/TDW89X0.dtsi b/target/linux/lantiq/dts/TDW89X0.dtsi index 4252297df7..79bcfc103b 100644 --- a/target/linux/lantiq/dts/TDW89X0.dtsi +++ b/target/linux/lantiq/dts/TDW89X0.dtsi @@ -3,6 +3,8 @@ #include / { + compatible = "tplink,tdw89x0", "lantiq,xway", "lantiq,vr9"; + chosen { bootargs = "console=ttyLTQ0,115200"; }; diff --git a/target/linux/lantiq/dts/VG3503J.dts b/target/linux/lantiq/dts/VG3503J.dts index 99fe486dc6..cb0d5ddecd 100644 --- a/target/linux/lantiq/dts/VG3503J.dts +++ b/target/linux/lantiq/dts/VG3503J.dts @@ -5,7 +5,8 @@ #include / { - model = "VG3503J - BT OpenReach VDSL Modem"; + compatible = "arcadyan,vg3503j", "lantiq,xway", "lantiq,vr9"; + model = "BT OpenReach VDSL Modem"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/VGV7510KW22.dtsi b/target/linux/lantiq/dts/VGV7510KW22.dtsi index 73240bf2bc..2d8e528f4e 100644 --- a/target/linux/lantiq/dts/VGV7510KW22.dtsi +++ b/target/linux/lantiq/dts/VGV7510KW22.dtsi @@ -3,6 +3,8 @@ #include / { + compatible = "arcadyan,vgv7510kw22", "lantiq,xway", "lantiq,vr9"; + chosen { bootargs = "console=ttyLTQ0,115200 mem=62M vpe1_load_addr=0x83e00000 vpe1_mem=2M maxvpes=1 maxtcs=1 nosmp"; }; @@ -228,7 +230,7 @@ phy1: ethernet-phy@1 { reg = <0x1>; - compatible = "ethernet-phy-id0243.0c54", "ethernet-phy-ieee802.3-c22"; + compatible = "ethernet-phy-ieee802.3-c22"; }; phy11: ethernet-phy@11 { diff --git a/target/linux/lantiq/dts/VGV7510KW22BRN.dts b/target/linux/lantiq/dts/VGV7510KW22BRN.dts index 2fec1aedde..d0be62f632 100644 --- a/target/linux/lantiq/dts/VGV7510KW22BRN.dts +++ b/target/linux/lantiq/dts/VGV7510KW22BRN.dts @@ -3,7 +3,8 @@ #include "VGV7510KW22.dtsi" / { - model = "VGV7510KW22BRN - o2 Box 6431"; + compatible = "arcadyan,vgv7510kw22-brn", "arcadyan,vgv7510kw22", "lantiq,xway", "lantiq,vr9"; + model = "o2 Box 6431"; sram@1F000000 { cgu@103000 { diff --git a/target/linux/lantiq/dts/VGV7510KW22NOR.dts b/target/linux/lantiq/dts/VGV7510KW22NOR.dts index 5dfc149c3b..1d21e14f0a 100644 --- a/target/linux/lantiq/dts/VGV7510KW22NOR.dts +++ b/target/linux/lantiq/dts/VGV7510KW22NOR.dts @@ -3,7 +3,8 @@ #include "VGV7510KW22.dtsi" / { - model = "VGV7510KW22NOR - o2 Box 6431"; + compatible = "arcadyan,vgv7510kw22-nor", "arcadyan,vgv7510kw22", "lantiq,xway", "lantiq,vr9"; + model = "o2 Box 6431"; fpi@10000000 { localbus@0 { diff --git a/target/linux/lantiq/dts/VGV7519.dtsi b/target/linux/lantiq/dts/VGV7519.dtsi index 0c2da5279a..edff93cf47 100644 --- a/target/linux/lantiq/dts/VGV7519.dtsi +++ b/target/linux/lantiq/dts/VGV7519.dtsi @@ -3,6 +3,8 @@ #include / { + compatible = "arcadyan,vgv7519", "lantiq,xway", "lantiq,vr9"; + chosen { bootargs = "console=ttyLTQ0,115200 mem=62M vpe1_load_addr=0x83e00000 vpe1_mem=2M maxvpes=1 maxtcs=1 nosmp"; }; diff --git a/target/linux/lantiq/dts/VGV7519BRN.dts b/target/linux/lantiq/dts/VGV7519BRN.dts index 3d51aaa43a..f30d2f920e 100644 --- a/target/linux/lantiq/dts/VGV7519BRN.dts +++ b/target/linux/lantiq/dts/VGV7519BRN.dts @@ -4,7 +4,8 @@ #include "VGV7519.dtsi" / { - model = "VGV7519BRN - KPN Experiabox V8"; + compatible = "arcadyan,vgv7519-brn", "arcadyan,vgv7519", "lantiq,xway", "lantiq,vr9"; + model = "KPN Experiabox V8"; fpi@10000000 { localbus@0 { diff --git a/target/linux/lantiq/dts/VGV7519NOR.dts b/target/linux/lantiq/dts/VGV7519NOR.dts index 4ca820844b..ec548fbe72 100644 --- a/target/linux/lantiq/dts/VGV7519NOR.dts +++ b/target/linux/lantiq/dts/VGV7519NOR.dts @@ -4,7 +4,8 @@ #include "VGV7519.dtsi" / { - model = "VGV7519NOR - KPN Experiabox V8"; + compatible = "arcadyan,vgv7519-nor", "arcadyan,vgv7519", "lantiq,xway", "lantiq,vr9"; + model = "KPN Experiabox V8"; fpi@10000000 { localbus@0 { diff --git a/target/linux/lantiq/dts/VR200v.dts b/target/linux/lantiq/dts/VR200v.dts index 11930ba676..b063d758c3 100644 --- a/target/linux/lantiq/dts/VR200v.dts +++ b/target/linux/lantiq/dts/VR200v.dts @@ -5,7 +5,8 @@ #include / { - model = "VR200v - TP-LINK Archer VR200v"; + compatible = "tplink,vr200v", "lantiq,xway", "lantiq,vr9"; + model = "TP-LINK Archer VR200v"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/WBMR.dts b/target/linux/lantiq/dts/WBMR.dts index 79d7b63bff..fab99d00e7 100644 --- a/target/linux/lantiq/dts/WBMR.dts +++ b/target/linux/lantiq/dts/WBMR.dts @@ -5,7 +5,8 @@ #include / { - model = "WBMR - Buffalo WBMR-HP-G300H"; + compatible = "buffalo,wbmr-hp-g300h", "lantiq,xway", "lantiq,ar9"; + model = "Buffalo WBMR-HP-G300H"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/WBMR300.dts b/target/linux/lantiq/dts/WBMR300.dts index d89e8a19db..de2be582f5 100644 --- a/target/linux/lantiq/dts/WBMR300.dts +++ b/target/linux/lantiq/dts/WBMR300.dts @@ -5,7 +5,8 @@ #include / { - model = "WBMR300 - Buffalo WBMR-300HPD"; + compatible = "buffalo,wbmr-300hpd", "lantiq,xway", "lantiq,vr9"; + model = "Buffalo WBMR-300HPD"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/amazonse.dtsi b/target/linux/lantiq/dts/amazonse.dtsi index e88fc161b7..e6925a3adf 100644 --- a/target/linux/lantiq/dts/amazonse.dtsi +++ b/target/linux/lantiq/dts/amazonse.dtsi @@ -104,6 +104,7 @@ "spi_frm"; #address-cells = <1>; #size-cells = <1>; + status = "disabled"; }; gptu@E100A00 { diff --git a/target/linux/lantiq/image/Makefile b/target/linux/lantiq/image/Makefile index 9326c62d42..dcd0c710d1 100644 --- a/target/linux/lantiq/image/Makefile +++ b/target/linux/lantiq/image/Makefile @@ -39,7 +39,7 @@ endef define Build/fullimage mkimage -A mips -O linux -C lzma -T filesystem -a 0x00 \ - -e 0x00 -n 'LEDE RootFS' \ + -e 0x00 -n 'OpenWrt RootFS' \ -d $(IMAGE_ROOTFS) $(IMAGE_ROOTFS).new cat $(IMAGE_KERNEL) $(IMAGE_ROOTFS).new > $@.tmp @@ -60,10 +60,9 @@ define Device/Default KERNEL := kernel-bin | append-dtb | lzma | uImage lzma KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma FILESYSTEMS := squashfs - DEVICE_DTS := $(1) DEVICE_DTS_DIR := ../dts IMAGE_SIZE := - SUPPORTED_DEVICES = $$(DEVICE_DTS) + SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) endef @@ -97,8 +96,8 @@ DEVICE_VARS += SIGNATURE MAGIC CRC32_POLY define Device/lantiqFullImage KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | pad-offset 4 0 - IMAGES := sysupgrade.bin fullimage.img - IMAGE/fullimage.img := fullimage | check-size $$$$(IMAGE_SIZE) + IMAGES := sysupgrade.bin fullimage.bin + IMAGE/fullimage.bin := fullimage | check-size $$$$(IMAGE_SIZE) endef define Device/AVM @@ -109,7 +108,7 @@ endef ifeq ($(SUBTARGET),ase) -define Device/ALL0333CJ +define Device/allnet_all0333cj IMAGE_SIZE := 3700k DEVICE_DTS := ALL0333CJ DEVICE_TITLE := Allnet ALL0333CJ @@ -117,75 +116,86 @@ define Device/ALL0333CJ kmod-ltq-adsl-ase-fw-b kmod-ltq-atm-ase \ ltq-adsl-app ppp-mod-pppoe endef -TARGET_DEVICES += ALL0333CJ +TARGET_DEVICES += allnet_all0333cj -define Device/DGN1000B +define Device/netgear_dgn1000b IMAGE_SIZE := 6000k DEVICE_DTS := DGN1000B DEVICE_TITLE := Netgear DGN1000B DEVICE_PACKAGES := kmod-ltq-adsl-ase kmod-ltq-adsl-ase-mei \ kmod-ltq-adsl-ase-fw-b kmod-ltq-atm-ase \ ltq-adsl-app ppp-mod-pppoe + SUPPORTED_DEVICES += DGN1000B endef -TARGET_DEVICES += DGN1000B +TARGET_DEVICES += netgear_dgn1000b endif ifeq ($(SUBTARGET),xway_legacy) -define Device/ARV4520PW +define Device/arcadyan_arv4520pw IMAGE_SIZE := 3648k + DEVICE_DTS := ARV4520PW DEVICE_TITLE := Easybox 800, WAV-281 - ARV4520PW DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-rt61-pci wpad-mini + SUPPORTED_DEVICES += ARV4520PW endef -TARGET_DEVICES += ARV4520PW +TARGET_DEVICES += arcadyan_arv4520pw -define Device/ARV4525PW +define Device/arcadyan_arv4525pw IMAGE_SIZE := 3776k + DEVICE_DTS := ARV4525PW DEVICE_TITLE := Speedport W502V Typ A - ARV4525PW DEVICE_PACKAGES := kmod-ath5k wpad-mini \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa -swconfig + SUPPORTED_DEVICES += ARV4525PW endef -TARGET_DEVICES += ARV4525PW +TARGET_DEVICES += arcadyan_arv4525pw -define Device/ARV452CQW +define Device/arcadyan_arv452cqw IMAGE_SIZE := 3776k + DEVICE_DTS := ARV452CQW DEVICE_TITLE := Easybox 801 - ARV452CQW DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ath5k wpad-mini \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa + SUPPORTED_DEVICES += ARV452CQW endef -TARGET_DEVICES += ARV452CQW +TARGET_DEVICES += arcadyan_arv452cqw -define Device/ARV4518PWR01 +define Device/arcadyan_arv4518pwr01 IMAGE_SIZE := 3776k + DEVICE_DTS := ARV4518PWR01 DEVICE_TITLE := ARV4518PWR01 DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-ath5k wpad-mini + SUPPORTED_DEVICES += ARV4518PWR01 endef -TARGET_DEVICES += ARV4518PWR01 +TARGET_DEVICES += arcadyan_arv4518pwr01 -define Device/ARV4518PWR01A +define Device/arcadyan_arv4518pwr01a IMAGE_SIZE := 3776k + DEVICE_DTS := ARV4518PWR01A DEVICE_TITLE := ARV4518PWR01A DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-ath5k wpad-mini + SUPPORTED_DEVICES += ARV4518PWR01A endef -TARGET_DEVICES += ARV4518PWR01A +TARGET_DEVICES += arcadyan_arv4518pwr01a endif @@ -193,8 +203,10 @@ ifeq ($(SUBTARGET),xway) # Danube -define Device/BTHOMEHUBV2B +define Device/bt_homehub-v2b $(Device/NAND) + BOARD_NAME := BTHOMEHUBV2B + DEVICE_DTS := BTHOMEHUBV2B DEVICE_TITLE := BT Home Hub 2B DEVICE_PACKAGES := kmod-usb-dwc2 \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ @@ -202,17 +214,20 @@ define Device/BTHOMEHUBV2B kmod-ltq-deu-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-ath9k kmod-owl-loader wpad-mini + SUPPORTED_DEVICES += BTHOMEHUBV2B endef -TARGET_DEVICES += BTHOMEHUBV2B +TARGET_DEVICES += bt_homehub-v2b -define Device/EASY50712 +define Device/lantiq_easy50712 + DEVICE_DTS := EASY50712 IMAGE_SIZE := 3776k DEVICE_TITLE := Lantiq Danube - EASY50712 endef -TARGET_DEVICES += EASY50712 +TARGET_DEVICES += lantiq_easy50712 -define Device/ACMP252 +define Device/audiocodes_mp-252 IMAGE_SIZE := 14848k + DEVICE_DTS := ACMP252 DEVICE_TITLE := AudioCodes MediaPack MP-252 DEVICE_PACKAGES := kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ @@ -221,11 +236,13 @@ define Device/ACMP252 kmod-rt2800-pci \ ltq-adsl-app ppp-mod-pppoa \ wpad-mini + SUPPORTED_DEVICES += ACMP252 endef -TARGET_DEVICES += ACMP252 +TARGET_DEVICES += audiocodes_mp-252 -define Device/ARV4510PW +define Device/arcadyan_arv4510pw IMAGE_SIZE := 15616k + DEVICE_DTS := ARV4510PW DEVICE_TITLE := Wippies, Elisa - ARV4510PW DEVICE_PACKAGES := kmod-usb-ledtrig-usbport kmod-usb2-pci kmod-usb-uhci \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ @@ -233,41 +250,49 @@ define Device/ARV4510PW ltq-adsl-app ppp-mod-pppoa \ kmod-ltq-tapi kmod-ltq-vmmc \ kmod-rt2800-pci kmod-ath5k wpad-mini + SUPPORTED_DEVICES += ARV4510PW endef -TARGET_DEVICES += ARV4510PW +TARGET_DEVICES += arcadyan_arv4510pw -define Device/ARV7525PW +define Device/arcadyan_arv7525pw IMAGE_SIZE := 3776k + DEVICE_DTS := ARV4510PW DEVICE_TITLE := Speedport W303V Typ A - ARV7525PW DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa -swconfig + SUPPORTED_DEVICES += ARV4510PW endef -TARGET_DEVICES += ARV7525PW +TARGET_DEVICES += arcadyan_arv7525pw -define Device/ARV4519PW +define Device/arcadyan_arv4519pw IMAGE_SIZE := 3776k + DEVICE_DTS := ARV4519PW DEVICE_TITLE := Vodafone, Pirelli - ARV4519PW DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa + SUPPORTED_DEVICES += ARV4519PW endef -TARGET_DEVICES += ARV4519PW +TARGET_DEVICES += arcadyan_arv4519pw -define Device/ARV7506PW11 +define Device/arcadyan_arv7506pw11 IMAGE_SIZE := 7808k + DEVICE_DTS := ARV7506PW11 DEVICE_TITLE := Alice/O2 IAD 4421 - ARV7506PW11 DEVICE_PACKAGES := kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-rt2800-pci wpad-mini + SUPPORTED_DEVICES += ARV7506PW11 endef -TARGET_DEVICES += ARV7506PW11 +TARGET_DEVICES += arcadyan_arv7506pw11 -define Device/ARV7510PW22 +define Device/arcadyan_arv7510pw22 IMAGE_SIZE := 31232k + DEVICE_DTS := ARV7510PW22 DEVICE_TITLE := Astoria - ARV7510PW22 DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ @@ -276,33 +301,39 @@ define Device/ARV7510PW22 kmod-ltq-tapi kmod-ltq-vmmc \ kmod-rt2800-pci wpad-mini \ kmod-usb-uhci kmod-usb2 kmod-usb2-pci + SUPPORTED_DEVICES += ARV7510PW22 endef -TARGET_DEVICES += ARV7510PW22 +TARGET_DEVICES += arcadyan_arv7510pw22 -define Device/ARV7518PW +define Device/arcadyan_arv7518pw IMAGE_SIZE := 7872k + DEVICE_DTS := ARV7518PW DEVICE_TITLE := Astoria - ARV7518PW DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-ath9k kmod-owl-loader wpad-mini + SUPPORTED_DEVICES += ARV7518PW endef -TARGET_DEVICES += ARV7518PW +TARGET_DEVICES += arcadyan_arv7518pw -define Device/ARV7519PW +define Device/arcadyan_arv7519pw IMAGE_SIZE := 15488k + DEVICE_DTS := ARV7519PW DEVICE_TITLE := Astoria - ARV7519PW DEVICE_PACKAGES := kmod-usb-dwc2 \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-rt2800-pci wpad-mini + SUPPORTED_DEVICES += ARV7519PW endef -TARGET_DEVICES += ARV7519PW +TARGET_DEVICES += arcadyan_arv7519pw -define Device/ARV752DPW +define Device/arcadyan_arv752dpw IMAGE_SIZE := 7872k + DEVICE_DTS := ARV752DPW DEVICE_TITLE := Easybox 802 - ARV752DPW DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ @@ -310,11 +341,13 @@ define Device/ARV752DPW ltq-adsl-app ppp-mod-pppoa \ kmod-ltq-tapi kmod-ltq-vmmc \ kmod-rt2800-pci wpad-mini + SUPPORTED_DEVICES += ARV752DPW endef -TARGET_DEVICES += ARV752DPW +TARGET_DEVICES += arcadyan_arv752dpw -define Device/ARV752DPW22 +define Device/arcadyan_arv752dpw22 IMAGE_SIZE := 7616k + DEVICE_DTS := ARV752DPW22 DEVICE_TITLE := Easybox 803 - ARV752DPW22 DEVICE_PACKAGES := kmod-usb2-pci kmod-usb-uhci kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ @@ -322,36 +355,43 @@ define Device/ARV752DPW22 ltq-adsl-app ppp-mod-pppoa \ kmod-ltq-tapi kmod-ltq-vmmc \ kmod-rt2800-pci wpad-mini + SUPPORTED_DEVICES += ARV752DPW22 endef -TARGET_DEVICES += ARV752DPW22 +TARGET_DEVICES += arcadyan_arv752dpw22 -define Device/ARV8539PW22 +define Device/arcadyan_arv8539pw22 IMAGE_SIZE := 7616k + DEVICE_DTS := ARV8539PW22 DEVICE_TITLE := Speedport W504V Typ A - ARV8539PW22 DEVICE_PACKAGES := kmod-usb-dwc2 \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-ath9k kmod-owl-loader wpad-mini + SUPPORTED_DEVICES += ARV8539PW22 endef -TARGET_DEVICES += ARV8539PW22 +TARGET_DEVICES += arcadyan_arv8539pw22 -define Device/GIGASX76X +define Device/siemens_gigaset-sx76x IMAGE_SIZE := 7680k + DEVICE_DTS := GIGASX76X DEVICE_TITLE := Gigaset sx76x DEVICE_PACKAGES := kmod-usb-dwc2 \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoe \ kmod-ath5k wpad-mini + SUPPORTED_DEVICES += GIGASX76X endef -TARGET_DEVICES += GIGASX76X +TARGET_DEVICES += siemens_gigaset-sx76x # AR9 -define Device/BTHOMEHUBV3A +define Device/bt_homehub-v3a $(Device/NAND) + BOARD_NAME := BTHOMEHUBV3A + DEVICE_DTS := BTHOMEHUBV3A DEVICE_TITLE := BT Home Hub 3A DEVICE_PACKAGES := kmod-usb-dwc2 \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ @@ -360,27 +400,29 @@ define Device/BTHOMEHUBV3A ltq-adsl-app ppp-mod-pppoa \ kmod-ath9k kmod-owl-loader wpad-mini \ uboot-envtools + SUPPORTED_DEVICES += BTHOMEHUBV3A endef -TARGET_DEVICES += BTHOMEHUBV3A +TARGET_DEVICES += bt_homehub-v3a DGN3500_KERNEL_OFFSET_HEX=0x50000 DGN3500_KERNEL_OFFSET_DEC=327680 -define Device/DGN3500 +define Device/netgear_dgn3500 + DEVICE_DTS := DGN3500 IMAGE_SIZE := 16000k IMAGES := \ - sysupgrade-NA.bin sysupgrade-WW.bin \ - factory-NA.img factory-WW.img - IMAGE/sysupgrade-NA.bin := \ + sysupgrade-na.bin sysupgrade.bin \ + factory-na.img factory.img + IMAGE/sysupgrade-na.bin := \ append-kernel | append-rootfs | dgn3500-sercom-footer 0x0 "NA" | \ pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) - IMAGE/sysupgrade-WW.bin := \ + IMAGE/sysupgrade.bin := \ append-kernel | append-rootfs | dgn3500-sercom-footer 0x0 "WW" | \ pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) - IMAGE/factory-NA.img := \ + IMAGE/factory-na.img := \ pad-extra $(DGN3500_KERNEL_OFFSET_DEC) | append-kernel | append-rootfs | \ dgn3500-sercom-footer $(DGN3500_KERNEL_OFFSET_HEX) "NA" | pad-rootfs | \ check-size 16320k | pad-to 16384k - IMAGE/factory-WW.img := \ + IMAGE/factory.img := \ pad-extra $(DGN3500_KERNEL_OFFSET_DEC) | append-kernel | append-rootfs | \ dgn3500-sercom-footer $(DGN3500_KERNEL_OFFSET_HEX) "WW" | pad-rootfs | \ check-size 16320k | pad-to 16384k @@ -391,10 +433,12 @@ define Device/DGN3500 kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ kmod-ltq-deu-ar9 + SUPPORTED_DEVICES += DGN3500 endef -TARGET_DEVICES += DGN3500 +TARGET_DEVICES += netgear_dgn3500 -define Device/DGN3500B +define Device/netgear_dgn3500b + DEVICE_DTS := DGN3500B IMAGE_SIZE := 16000k IMAGES += factory.img IMAGE/sysupgrade.bin := \ @@ -411,10 +455,11 @@ define Device/DGN3500B kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ kmod-ltq-deu-ar9 + SUPPORTED_DEVICES += DGN3500B endef -TARGET_DEVICES += DGN3500B +TARGET_DEVICES += netgear_dgn3500b -define Device/WBMRA +define Device/buffalo_wbmr-hp-g300h-a IMAGE_SIZE := 31488k DEVICE_DTS := WBMR DEVICE_TITLE := Buffalo WBMR-HP-G300H (A) - WBMR @@ -423,10 +468,11 @@ define Device/WBMRA kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ kmod-ath9k kmod-owl-loader wpad-mini + SUPPORTED_DEVICES := WBMR buffalo,wbmr-hp-g300h endef -TARGET_DEVICES += WBMRA +TARGET_DEVICES += buffalo_wbmr-hp-g300h-a -define Device/WBMRB +define Device/buffalo_wbmr-hp-g300h-b IMAGE_SIZE := 31488k DEVICE_DTS := WBMR DEVICE_TITLE := Buffalo WBMR-HP-G300H (B) - WBMR @@ -435,11 +481,13 @@ define Device/WBMRB kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ kmod-ath9k kmod-owl-loader wpad-mini + SUPPORTED_DEVICES := WBMR buffalo,wbmr-hp-g300h endef -TARGET_DEVICES += WBMRB +TARGET_DEVICES += buffalo_wbmr-hp-g300h-b -define Device/FRITZ7320 +define Device/avm_fritz7320 $(Device/AVM) + DEVICE_DTS := FRITZ7320 IMAGE_SIZE := 15744k DEVICE_TITLE := 1&1 HomeServer - FRITZ7320 DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-mini \ @@ -447,11 +495,13 @@ define Device/FRITZ7320 kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ kmod-ltq-deu-ar9 kmod-usb-dwc2 -swconfig + SUPPORTED_DEVICES += FRITZ7320 endef -TARGET_DEVICES += FRITZ7320 +TARGET_DEVICES += avm_fritz7320 -define Device/H201L +define Device/zte_h201l IMAGE_SIZE := 7808k + DEVICE_DTS := H201L DEVICE_TITLE := ZTE H201L - H201L DEVICE_PACKAGES := kmod-ath9k-htc wpad-mini \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ @@ -459,19 +509,22 @@ define Device/H201L ltq-adsl-app ppp-mod-pppoe \ kmod-ltq-deu-ar9 kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ltq-tapi kmod-ltq-vmmc + SUPPORTED_DEVICES += H201L endef -TARGET_DEVICES += H201L +TARGET_DEVICES += zte_h201l -define Device/P2601HNFX +define Device/zyxel_p-2601hn IMAGE_SIZE := 15616k + DEVICE_DTS := P2601HNFX DEVICE_TITLE := ZyXEL P-2601HN-Fx DEVICE_PACKAGES := kmod-rt2800-usb wpad-mini \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoe \ kmod-ltq-deu-ar9 kmod-usb-dwc2 + SUPPORTED_DEVICES += P2601HNFX endef -TARGET_DEVICES += P2601HNFX +TARGET_DEVICES += zyxel_p-2601hn endif @@ -481,42 +534,55 @@ ifeq ($(SUBTARGET),xrx200) # VR9 -define Device/P2812HNUF1 +define Device/zyxel_p-2812hnu-f1 $(Device/NAND) + BOARD_NAME := P2812HNUF1 + DEVICE_DTS := P2812HNUF1 DEVICE_TITLE := ZyXEL P-2812HNU-F1 DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += P2812HNUF1 endef -TARGET_DEVICES += P2812HNUF1 +TARGET_DEVICES += zyxel_p-2812hnu-f1 -define Device/P2812HNUF3 +define Device/zyxel_p-2812hnu-f3 $(Device/NAND) + BOARD_NAME := P2812HNUF3 + DEVICE_DTS := P2812HNUF3 DEVICE_TITLE := ZyXEL P-2812HNU-F3 DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2 + SUPPORTED_DEVICES += P2812HNUF3 endef -TARGET_DEVICES += P2812HNUF3 +TARGET_DEVICES += zyxel_p-2812hnu-f3 -define Device/ARV7519RW22 +define Device/arcadyan_arv7519rw22 IMAGE_SIZE := 31232k + DEVICE_DTS := ARV7519RW22 DEVICE_TITLE := Livebox Astoria ARV7519RW22 DEVICE_PACKAGES := kmod-usb-dwc2 + SUPPORTED_DEVICES += ARV7519RW22 endef -TARGET_DEVICES += ARV7519RW22 +TARGET_DEVICES += arcadyan_arv7519rw22 -define Device/ASL56026 +define Device/alphanetworks_asl56026 + DEVICE_DTS := ASL56026 IMAGE_SIZE := 7488k DEVICE_TITLE := BT OpenReach - ECI VDSL Modem V-2FUb/I endef -TARGET_DEVICES += ASL56026 +TARGET_DEVICES += alphanetworks_asl56026 -define Device/BTHOMEHUBV5A +define Device/bt_homehub-v5a $(Device/NAND) + BOARD_NAME := BTHOMEHUBV5A + DEVICE_DTS := BTHOMEHUBV5A DEVICE_TITLE := BT Home Hub 5A DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader \ kmod-ath10k ath10k-firmware-qca988x wpad-mini kmod-usb-dwc2 + SUPPORTED_DEVICES += BTHOMEHUBV5A endef -TARGET_DEVICES += BTHOMEHUBV5A +TARGET_DEVICES += bt_homehub-v5a -define Device/DM200 +define Device/netgear_dm200 + DEVICE_DTS := DM200 IMAGES := sysupgrade.bin factory.img IMAGE/factory.img := $$(IMAGE/sysupgrade.bin) | netgear-dni IMAGE_SIZE := 7872k @@ -525,169 +591,200 @@ define Device/DM200 NETGEAR_HW_ID := 29765233+8+0+64+0+0 endef DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID -TARGET_DEVICES += DM200 +TARGET_DEVICES += netgear_dm200 -define Device/EASY80920NAND +define Device/lantiq_easy80920-nand $(Device/lantiqFullImage) + DEVICE_DTS := EASY80920NAND IMAGE_SIZE := 64512k DEVICE_TITLE := Lantiq VR9 - EASY80920NAND DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-mini kmod-usb-dwc2 kmod-usb-ledtrig-usbport endef -TARGET_DEVICES += EASY80920NAND +TARGET_DEVICES += lantiq_easy80920-nand -define Device/EASY80920NOR +define Device/lantiq_easy80920-nor + DEVICE_DTS := EASY80920NOR IMAGE_SIZE := 7936k DEVICE_TITLE := Lantiq VR9 - EASY80920NOR DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-mini kmod-usb-dwc2 kmod-usb-ledtrig-usbport endef -TARGET_DEVICES += EASY80920NOR +TARGET_DEVICES += lantiq_easy80920-nor -define Device/FRITZ3370 +define Device/avm_fritz3370 $(Device/AVM) $(Device/NAND) + BOARD_NAME := FRITZ3370 + DEVICE_DTS := FRITZ3370 DEVICE_TITLE := Fritz!Box WLan - FRITZ3370 DEVICE_PACKAGES := kmod-ath9k wpad-mini kmod-usb-dwc2 + SUPPORTED_DEVICES += FRITZ3370 endef -TARGET_DEVICES += FRITZ3370 +TARGET_DEVICES += avm_fritz3370 -define Device/FRITZ7360SL +define Device/avm_fritz7360sl $(Device/AVM) IMAGE_SIZE := 15744k + DEVICE_DTS := FRITZ7360SL DEVICE_TITLE := 1&1 HomeServer - FRITZ7360SL DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-mini kmod-usb-dwc2 + SUPPORTED_DEVICES += FRITZ7360SL endef -TARGET_DEVICES += FRITZ7360SL +TARGET_DEVICES += avm_fritz7360sl -define Device/VG3503J +define Device/arcadyan_vg3503j IMAGE_SIZE := 8000k + DEVICE_DTS := VG3503J DEVICE_TITLE := BT OpenReach - ECI VDSL Modem V-2FUb/R + SUPPORTED_DEVICES += VG3503J endef -TARGET_DEVICES += VG3503J +TARGET_DEVICES += arcadyan_vg3503j include tp-link.mk -define Device/WBMR300 +define Device/buffalo_wbmr-300hpd IMAGE_SIZE := 15616k + DEVICE_DTS := WBMR300 DEVICE_TITLE := Buffalo WBMR-300HPD DEVICE_PACKAGES := kmod-mt7603 wpad-mini kmod-usb-dwc2 + SUPPORTED_DEVICES += WBMR300 endef -TARGET_DEVICES += WBMR300 +TARGET_DEVICES += buffalo_wbmr-300hpd -define Device/VGV7510KW22NOR +define Device/arcadyan_vgv7510kw22-nor IMAGE_SIZE := 15232k + DEVICE_DTS := VGV7510KW22NOR DEVICE_TITLE := o2 Box 6431 / Arcadyan VGV7510KW22 (NOR) DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc + SUPPORTED_DEVICES += VGV7510KW22NOR endef -TARGET_DEVICES += VGV7510KW22NOR +TARGET_DEVICES += arcadyan_vgv7510kw22-nor -define Device/VGV7510KW22BRN +define Device/arcadyan_vgv7510kw22-brn $(Device/lantiqBrnImage) IMAGE_SIZE := 7168k + DEVICE_DTS := VGV7510KW22BRN SIGNATURE := BRNDA6431 MAGIC := 0x12345678 CRC32_POLY := 0x04c11db7 DEVICE_TITLE := o2 Box 6431 / Arcadyan VGV7510KW22 (BRN) DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc + SUPPORTED_DEVICES += VGV7510KW22BRN endef -TARGET_DEVICES += VGV7510KW22BRN +TARGET_DEVICES += arcadyan_vgv7510kw22-brn -define Device/VGV7519NOR +define Device/arcadyan_vgv7519-nor IMAGE_SIZE := 15360k + DEVICE_DTS := VGV7519NOR DEVICE_TITLE := Experiabox 8 VGV7519 DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc + SUPPORTED_DEVICES += VGV7519NOR endef -TARGET_DEVICES += VGV7519NOR +TARGET_DEVICES += arcadyan_vgv7519-nor -define Device/VGV7519BRN +define Device/arcadyan_vgv7519-brn $(Device/lantiqBrnImage) IMAGE_SIZE := 7168k + DEVICE_DTS := VGV7519BRN SIGNATURE := 5D00008000 MAGIC := 0x12345678 CRC32_POLY := 0x2083b8ed DEVICE_TITLE := Experiabox 8 VGV7519 (BRN) DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc + SUPPORTED_DEVICES += VGV7519BRN endef -TARGET_DEVICES += VGV7519BRN +TARGET_DEVICES += arcadyan_vgv7519-brn endif ifeq ($(SUBTARGET),falcon) -define Device/EASY98000NOR +define Device/lantiq_easy98000-nor IMAGE_SIZE := 3904k + DEVICE_DTS := EASY98000NOR DEVICE_TITLE := EASY98000 - Lantiq Falcon Eval Board NOR DEVICE_PACKAGES := kmod-dm9000 kmod-i2c-lantiq kmod-eeprom-at24 endef -TARGET_DEVICES += EASY98000NOR +TARGET_DEVICES += lantiq_easy98000-nor -define Device/EASY98000NAND +define Device/lantiq_easy98000-nand IMAGE_SIZE := 3904k + DEVICE_DTS := EASY98000NAND DEVICE_TITLE := EASY98000 - Lantiq Falcon Eval Board NAND DEVICE_PACKAGES := kmod-dm9000 kmod-i2c-lantiq kmod-eeprom-at24 endef -TARGET_DEVICES += EASY98000NAND +TARGET_DEVICES += lantiq_easy98000-nand -define Device/EASY98000SFLASH +define Device/lantiq_easy98000-sflash IMAGE_SIZE := 7424k + DEVICE_DTS := EASY98000SFLASH DEVICE_TITLE := EASY98000 - Lantiq Falcon Eval Board SFLASH DEVICE_PACKAGES := kmod-dm9000 kmod-i2c-lantiq kmod-eeprom-at24 endef -TARGET_DEVICES += EASY98000SFLASH +TARGET_DEVICES += lantiq_easy98000-sflash -define Device/FALCON-MDU +define Device/lantiq_falcon-mdu IMAGE_SIZE := 7424k + DEVICE_DTS := FALCON-MDU DEVICE_TITLE := MDU - Lantiq Falcon / VINAXdp MDU Board endef -TARGET_DEVICES += FALCON-MDU +TARGET_DEVICES += lantiq_falcon-mdu -define Device/EASY88388 +define Device/lantiq_easy88388 IMAGE_SIZE := 7424k + DEVICE_DTS := EASY88388 DEVICE_TITLE := EASY88388 - Lantiq Falcon FTTDP8 Reference Board endef -TARGET_DEVICES += EASY88388 +TARGET_DEVICES += lantiq_easy88388 -define Device/EASY88444 +define Device/lantiq_easy88444 IMAGE_SIZE := 7424k + DEVICE_DTS := EASY88444 DEVICE_TITLE := EASY88444 - Lantiq Falcon FTTdp G.FAST Reference Board endef -TARGET_DEVICES += EASY88444 +TARGET_DEVICES += lantiq_easy88444 -define Device/FALCON-SFP +define Device/lantiq_falcon-sfp IMAGE_SIZE := 7424k + DEVICE_DTS := FALCON-SFP DEVICE_TITLE := SFP - Lantiq Falcon SFP Stick endef -TARGET_DEVICES += FALCON-SFP +TARGET_DEVICES += lantiq_falcon-sfp -define Device/EASY98035SYNCE +define Device/lantiq_easy98035synce IMAGE_SIZE := 7424k + DEVICE_DTS := EASY98035SYNCE DEVICE_TITLE := EASY98035SYNCE - Lantiq Falcon SFP Stick with Synchronous Ethernet endef -TARGET_DEVICES += EASY98035SYNCE +TARGET_DEVICES += lantiq_easy98035synce -define Device/EASY98035SYNCE1588 +define Device/lantiq_easy98035synce1588 IMAGE_SIZE := 7424k + DEVICE_DTS := EASY98035SYNCE1588 DEVICE_TITLE := EASY98035SYNCE1588 - Lantiq Falcon SFP Stick with SyncE and IEEE1588 endef -TARGET_DEVICES += EASY98035SYNCE1588 +TARGET_DEVICES += lantiq_easy98035synce1588 -define Device/EASY98020 +define Device/lantiq_easy98020 IMAGE_SIZE := 7424k + DEVICE_DTS := EASY98020 DEVICE_TITLE := EASY98020 - Lantiq Falcon SFU Reference Board endef -TARGET_DEVICES += EASY98020 +TARGET_DEVICES += lantiq_easy98020 -define Device/EASY98020V18 +define Device/lantiq_easy98020-v18 IMAGE_SIZE := 7424k + DEVICE_DTS := EASY98020V18 DEVICE_TITLE := EASY98020V18 - Lantiq Falcon SFU Reference Board V1.8 endef -TARGET_DEVICES += EASY98020V18 +TARGET_DEVICES += lantiq_easy98020-v18 -define Device/EASY98021 +define Device/lantiq_easy98021 IMAGE_SIZE := 7424k + DEVICE_DTS := EASY98021 DEVICE_TITLE := EASY98021 - Lantiq Falcon HGU Reference Board endef -TARGET_DEVICES += EASY98021 +TARGET_DEVICES += lantiq_easy98021 endif diff --git a/target/linux/lantiq/image/tp-link.mk b/target/linux/lantiq/image/tp-link.mk index 976184175a..561d390d8c 100644 --- a/target/linux/lantiq/image/tp-link.mk +++ b/target/linux/lantiq/image/tp-link.mk @@ -1,6 +1,8 @@ -DEVICE_VARS += TPLINK_BOARD_ID +DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD TPLINK_HVERSION define Device/lantiqTpLink + TPLINK_HWREVADD := 0 + TPLINK_HVERSION := 2 KERNEL := kernel-bin | append-dtb | lzma KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | \ tplink-v2-header -s -V "ver. 1.0" @@ -9,31 +11,42 @@ define Device/lantiqTpLink append-metadata | check-size $$$$(IMAGE_SIZE) endef -define Device/TDW8970 +define Device/tplink_tdw8970 $(Device/lantiqTpLink) - DEVICE_PROFILE := TDW8970 - TPLINK_BOARD_ID := TD-W8970v1 + DEVICE_DTS := TDW8970 + TPLINK_FLASHLAYOUT := 8Mltq + TPLINK_HWID := 0x89700001 + TPLINK_HWREV := 1 IMAGE_SIZE := 7680k DEVICE_TITLE := TP-LINK TD-W8970 DEVICE_PACKAGES:= kmod-ath9k wpad-mini kmod-usb-dwc2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += TDW8970 endef +TARGET_DEVICES += tplink_tdw8970 -define Device/TDW8980 +define Device/tplink_tdw8980 $(Device/lantiqTpLink) - DEVICE_PROFILE := TDW8980 - TPLINK_BOARD_ID := TD-W8980v1 + DEVICE_DTS := TDW8980 + TPLINK_FLASHLAYOUT := 8Mltq + TPLINK_HWID := 0x89800001 + TPLINK_HWREV := 14 IMAGE_SIZE := 7680k DEVICE_TITLE := TP-LINK TD-W8980 DEVICE_PACKAGES:= kmod-ath9k kmod-owl-loader wpad-mini kmod-usb-dwc2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += TDW8980 endef +TARGET_DEVICES += tplink_tdw8980 -define Device/VR200v +define Device/tplink_vr200v $(Device/lantiqTpLink) - DEVICE_PROFILE := VR200v + DEVICE_DTS := VR200v TPLINK_BOARD_ID := ArcherVR200V + TPLINK_FLASHLAYOUT := 16Mltq + TPLINK_HWID := 0x73b70801 + TPLINK_HWREV := 0x2f IMAGE_SIZE := 15808k DEVICE_TITLE := TP-LINK Archer VR200v DEVICE_PACKAGES:= kmod-usb-dwc2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += VR200v endef -TARGET_DEVICES += TDW8970 TDW8980 VR200v - +TARGET_DEVICES += tplink_vr200v diff --git a/target/linux/lantiq/patches-4.9/0026-NET-multi-phy-support.patch b/target/linux/lantiq/patches-4.9/0026-NET-multi-phy-support.patch index 9e71051d37..6046d6cde1 100644 --- a/target/linux/lantiq/patches-4.9/0026-NET-multi-phy-support.patch +++ b/target/linux/lantiq/patches-4.9/0026-NET-multi-phy-support.patch @@ -43,7 +43,7 @@ Signed-off-by: John Crispin } --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -373,6 +373,7 @@ struct phy_device { +@@ -369,6 +369,7 @@ struct phy_device { bool is_pseudo_fixed_link; bool has_fixups; bool suspended; diff --git a/target/linux/lantiq/patches-4.9/0028-NET-lantiq-various-etop-fixes.patch b/target/linux/lantiq/patches-4.9/0028-NET-lantiq-various-etop-fixes.patch index 4f3d46ce67..dc99f48eae 100644 --- a/target/linux/lantiq/patches-4.9/0028-NET-lantiq-various-etop-fixes.patch +++ b/target/linux/lantiq/patches-4.9/0028-NET-lantiq-various-etop-fixes.patch @@ -203,28 +203,27 @@ Signed-off-by: John Crispin } static int -@@ -156,8 +224,10 @@ ltq_etop_poll_rx(struct napi_struct *nap +@@ -156,7 +224,9 @@ ltq_etop_poll_rx(struct napi_struct *nap { struct ltq_etop_chan *ch = container_of(napi, struct ltq_etop_chan, napi); + struct ltq_etop_priv *priv = netdev_priv(ch->netdev); - int rx = 0; - int complete = 0; + int work_done = 0; + unsigned long flags; - while ((rx < budget) && !complete) { + while (work_done < budget) { struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->dma.desc]; -@@ -171,7 +241,9 @@ ltq_etop_poll_rx(struct napi_struct *nap +@@ -168,7 +238,9 @@ ltq_etop_poll_rx(struct napi_struct *nap } - if (complete || !rx) { - napi_complete(&ch->napi); + if (work_done < budget) { + napi_complete_done(&ch->napi, work_done); + spin_lock_irqsave(&priv->lock, flags); ltq_dma_ack_irq(&ch->dma); + spin_unlock_irqrestore(&priv->lock, flags); } - return rx; + return work_done; } -@@ -183,12 +255,14 @@ ltq_etop_poll_tx(struct napi_struct *nap +@@ -180,12 +252,14 @@ ltq_etop_poll_tx(struct napi_struct *nap container_of(napi, struct ltq_etop_chan, napi); struct ltq_etop_priv *priv = netdev_priv(ch->netdev); struct netdev_queue *txq = @@ -240,7 +239,7 @@ Signed-off-by: John Crispin dev_kfree_skb_any(ch->skb[ch->tx_free]); ch->skb[ch->tx_free] = NULL; memset(&ch->dma.desc_base[ch->tx_free], 0, -@@ -201,7 +275,9 @@ ltq_etop_poll_tx(struct napi_struct *nap +@@ -198,7 +272,9 @@ ltq_etop_poll_tx(struct napi_struct *nap if (netif_tx_queue_stopped(txq)) netif_tx_start_queue(txq); napi_complete(&ch->napi); @@ -250,7 +249,7 @@ Signed-off-by: John Crispin return 1; } -@@ -209,9 +285,10 @@ static irqreturn_t +@@ -206,9 +282,10 @@ static irqreturn_t ltq_etop_dma_irq(int irq, void *_priv) { struct ltq_etop_priv *priv = _priv; @@ -264,7 +263,7 @@ Signed-off-by: John Crispin return IRQ_HANDLED; } -@@ -223,7 +300,7 @@ ltq_etop_free_channel(struct net_device +@@ -220,7 +297,7 @@ ltq_etop_free_channel(struct net_device ltq_dma_free(&ch->dma); if (ch->dma.irq) free_irq(ch->dma.irq, priv); @@ -273,7 +272,7 @@ Signed-off-by: John Crispin int desc; for (desc = 0; desc < LTQ_DESC_NUM; desc++) dev_kfree_skb_any(ch->skb[ch->dma.desc]); -@@ -234,65 +311,133 @@ static void +@@ -231,65 +308,133 @@ static void ltq_etop_hw_exit(struct net_device *dev) { struct ltq_etop_priv *priv = netdev_priv(dev); @@ -329,11 +328,10 @@ Signed-off-by: John Crispin struct ltq_etop_priv *priv = netdev_priv(dev); - int i; + int mii_mode = priv->mii_mode; - -- ltq_pmu_enable(PMU_PPE); ++ + clk_enable(priv->clk_ppe); -- switch (priv->pldata->mii_mode) { +- ltq_pmu_enable(PMU_PPE); + if (of_machine_is_compatible("lantiq,ar9")) { + ltq_etop_gbit_init(dev); + /* force the etops link to the gbit to MII */ @@ -342,7 +340,8 @@ Signed-off-by: John Crispin + ltq_etop_w32_mask(MDIO_CFG_MASK, 0, LTQ_ETOP_MDIO_CFG); + ltq_etop_w32_mask(MAC_CFG_MASK, MAC_CFG_CGEN | MAC_CFG_DUPLEX | + MAC_CFG_SPEED | MAC_CFG_LINK, LTQ_ETOP_MAC_CFG); -+ + +- switch (priv->pldata->mii_mode) { + switch (mii_mode) { case PHY_INTERFACE_MODE_RMII: - ltq_etop_w32_mask(ETOP_MII_MASK, @@ -441,7 +440,7 @@ Signed-off-by: John Crispin } static void -@@ -306,7 +451,10 @@ ltq_etop_get_drvinfo(struct net_device * +@@ -303,7 +448,10 @@ ltq_etop_get_drvinfo(struct net_device * static int ltq_etop_nway_reset(struct net_device *dev) { @@ -453,7 +452,7 @@ Signed-off-by: John Crispin } static const struct ethtool_ops ltq_etop_ethtool_ops = { -@@ -317,6 +465,39 @@ static const struct ethtool_ops ltq_etop +@@ -314,6 +462,39 @@ static const struct ethtool_ops ltq_etop }; static int @@ -493,7 +492,7 @@ Signed-off-by: John Crispin ltq_etop_mdio_wr(struct mii_bus *bus, int phy_addr, int phy_reg, u16 phy_data) { u32 val = MDIO_REQUEST | -@@ -324,9 +505,9 @@ ltq_etop_mdio_wr(struct mii_bus *bus, in +@@ -321,9 +502,9 @@ ltq_etop_mdio_wr(struct mii_bus *bus, in ((phy_reg & MDIO_REG_MASK) << MDIO_REG_OFFSET) | phy_data; @@ -505,7 +504,7 @@ Signed-off-by: John Crispin return 0; } -@@ -337,12 +518,12 @@ ltq_etop_mdio_rd(struct mii_bus *bus, in +@@ -334,12 +515,12 @@ ltq_etop_mdio_rd(struct mii_bus *bus, in ((phy_addr & MDIO_ADDR_MASK) << MDIO_ADDR_OFFSET) | ((phy_reg & MDIO_REG_MASK) << MDIO_REG_OFFSET); @@ -522,7 +521,7 @@ Signed-off-by: John Crispin return val; } -@@ -357,8 +538,18 @@ ltq_etop_mdio_probe(struct net_device *d +@@ -354,8 +535,18 @@ ltq_etop_mdio_probe(struct net_device *d { struct ltq_etop_priv *priv = netdev_priv(dev); struct phy_device *phydev; @@ -542,7 +541,7 @@ Signed-off-by: John Crispin if (!phydev) { netdev_err(dev, "no PHY found\n"); -@@ -366,21 +557,18 @@ ltq_etop_mdio_probe(struct net_device *d +@@ -363,21 +554,18 @@ ltq_etop_mdio_probe(struct net_device *d } phydev = phy_connect(dev, phydev_name(phydev), @@ -569,7 +568,7 @@ Signed-off-by: John Crispin phydev->advertising = phydev->supported; phy_attached_info(phydev); -@@ -401,8 +589,13 @@ ltq_etop_mdio_init(struct net_device *de +@@ -398,8 +586,13 @@ ltq_etop_mdio_init(struct net_device *de } priv->mii_bus->priv = dev; @@ -585,7 +584,7 @@ Signed-off-by: John Crispin priv->mii_bus->name = "ltq_mii"; snprintf(priv->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x", priv->pdev->name, priv->pdev->id); -@@ -439,17 +632,19 @@ static int +@@ -436,17 +629,19 @@ static int ltq_etop_open(struct net_device *dev) { struct ltq_etop_priv *priv = netdev_priv(dev); @@ -614,7 +613,7 @@ Signed-off-by: John Crispin netif_tx_start_all_queues(dev); return 0; } -@@ -458,18 +653,19 @@ static int +@@ -455,18 +650,19 @@ static int ltq_etop_stop(struct net_device *dev) { struct ltq_etop_priv *priv = netdev_priv(dev); @@ -644,7 +643,7 @@ Signed-off-by: John Crispin return 0; } -@@ -479,16 +675,16 @@ ltq_etop_tx(struct sk_buff *skb, struct +@@ -476,16 +672,16 @@ ltq_etop_tx(struct sk_buff *skb, struct int queue = skb_get_queue_mapping(skb); struct netdev_queue *txq = netdev_get_tx_queue(dev, queue); struct ltq_etop_priv *priv = netdev_priv(dev); @@ -666,7 +665,7 @@ Signed-off-by: John Crispin netdev_err(dev, "tx ring full\n"); netif_tx_stop_queue(txq); return NETDEV_TX_BUSY; -@@ -496,7 +692,7 @@ ltq_etop_tx(struct sk_buff *skb, struct +@@ -493,7 +689,7 @@ ltq_etop_tx(struct sk_buff *skb, struct /* dma needs to start on a 16 byte aligned address */ byte_offset = CPHYSADDR(skb->data) % 16; @@ -675,7 +674,7 @@ Signed-off-by: John Crispin netif_trans_update(dev); -@@ -506,11 +702,11 @@ ltq_etop_tx(struct sk_buff *skb, struct +@@ -503,11 +699,11 @@ ltq_etop_tx(struct sk_buff *skb, struct wmb(); desc->ctl = LTQ_DMA_OWN | LTQ_DMA_SOP | LTQ_DMA_EOP | LTQ_DMA_TX_OFFSET(byte_offset) | (len & LTQ_DMA_SIZE_MASK); @@ -690,7 +689,7 @@ Signed-off-by: John Crispin netif_tx_stop_queue(txq); return NETDEV_TX_OK; -@@ -525,8 +721,10 @@ ltq_etop_change_mtu(struct net_device *d +@@ -522,8 +718,10 @@ ltq_etop_change_mtu(struct net_device *d struct ltq_etop_priv *priv = netdev_priv(dev); unsigned long flags; @@ -702,7 +701,7 @@ Signed-off-by: John Crispin LTQ_ETOP_IGPLEN); spin_unlock_irqrestore(&priv->lock, flags); } -@@ -595,6 +793,9 @@ ltq_etop_init(struct net_device *dev) +@@ -592,6 +790,9 @@ ltq_etop_init(struct net_device *dev) if (err) goto err_hw; ltq_etop_change_mtu(dev, 1500); @@ -712,7 +711,7 @@ Signed-off-by: John Crispin memcpy(&mac, &priv->pldata->mac, sizeof(struct sockaddr)); if (!is_valid_ether_addr(mac.sa_data)) { -@@ -612,9 +813,10 @@ ltq_etop_init(struct net_device *dev) +@@ -609,9 +810,10 @@ ltq_etop_init(struct net_device *dev) dev->addr_assign_type = NET_ADDR_RANDOM; ltq_etop_set_multicast_list(dev); @@ -726,7 +725,7 @@ Signed-off-by: John Crispin return 0; err_netdev: -@@ -634,6 +836,9 @@ ltq_etop_tx_timeout(struct net_device *d +@@ -631,6 +833,9 @@ ltq_etop_tx_timeout(struct net_device *d err = ltq_etop_hw_init(dev); if (err) goto err_hw; @@ -736,7 +735,7 @@ Signed-off-by: John Crispin netif_trans_update(dev); netif_wake_queue(dev); return; -@@ -657,14 +862,19 @@ static const struct net_device_ops ltq_e +@@ -654,14 +859,19 @@ static const struct net_device_ops ltq_e .ndo_tx_timeout = ltq_etop_tx_timeout, }; @@ -760,7 +759,7 @@ Signed-off-by: John Crispin res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { -@@ -690,31 +900,62 @@ ltq_etop_probe(struct platform_device *p +@@ -687,31 +897,62 @@ ltq_etop_probe(struct platform_device *p goto err_out; } @@ -838,7 +837,7 @@ Signed-off-by: John Crispin err = register_netdev(dev); if (err) -@@ -743,31 +984,22 @@ ltq_etop_remove(struct platform_device * +@@ -740,31 +981,22 @@ ltq_etop_remove(struct platform_device * return 0; } diff --git a/target/linux/lantiq/patches-4.9/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch b/target/linux/lantiq/patches-4.9/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch index cef4c1e2a3..a5ecd94c4a 100644 --- a/target/linux/lantiq/patches-4.9/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch +++ b/target/linux/lantiq/patches-4.9/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch @@ -204,7 +204,7 @@ Signed-off-by: John Crispin +early_param("ethaddr", setup_ethaddr); --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c -@@ -797,7 +797,11 @@ ltq_etop_init(struct net_device *dev) +@@ -794,7 +794,11 @@ ltq_etop_init(struct net_device *dev) if (err) goto err_hw; diff --git a/target/linux/lantiq/patches-4.9/0152-lantiq-VPE.patch b/target/linux/lantiq/patches-4.9/0152-lantiq-VPE.patch index 101902b937..7b14d9e5a9 100644 --- a/target/linux/lantiq/patches-4.9/0152-lantiq-VPE.patch +++ b/target/linux/lantiq/patches-4.9/0152-lantiq-VPE.patch @@ -1,6 +1,6 @@ --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -2311,6 +2311,12 @@ config MIPS_VPE_LOADER +@@ -2320,6 +2320,12 @@ config MIPS_VPE_LOADER Includes a loader for loading an elf relocatable object onto another VPE and running it. diff --git a/target/linux/lantiq/xrx200/config-default b/target/linux/lantiq/xrx200/config-default index c307dc8029..73ccaf34ab 100644 --- a/target/linux/lantiq/xrx200/config-default +++ b/target/linux/lantiq/xrx200/config-default @@ -1,21 +1,27 @@ CONFIG_ADM6996_PHY=y CONFIG_AR8216_PHY=y CONFIG_AT803X_PHY=y +CONFIG_BLK_MQ_PCI=y CONFIG_CPU_MIPSR2_IRQ_EI=y CONFIG_CPU_MIPSR2_IRQ_VI=y CONFIG_CPU_RMAP=y CONFIG_CRC16=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_NULL2=y CONFIG_FIRMWARE_IN_KERNEL=y CONFIG_HWMON=y CONFIG_ICPLUS_PHY=y +CONFIG_IFX_VPE_EXT=y CONFIG_INPUT=y CONFIG_INPUT_EVDEV=y CONFIG_INPUT_POLLDEV=y CONFIG_INTEL_XWAY_PHY=y # CONFIG_ISDN is not set -CONFIG_LANTIQ_PHY=y CONFIG_LANTIQ_XRX200=y CONFIG_LEDS_TRIGGER_HEARTBEAT=y CONFIG_LZO_COMPRESS=y @@ -24,6 +30,11 @@ CONFIG_MIPS_MT=y # CONFIG_MIPS_MT_FPAFF is not set CONFIG_MIPS_MT_SMP=y CONFIG_MIPS_PERF_SHARED_TC_COUNTERS=y +CONFIG_MIPS_VPE_APSP_API=y +CONFIG_MIPS_VPE_APSP_API_MT=y +CONFIG_MIPS_VPE_LOADER=y +CONFIG_MIPS_VPE_LOADER_MT=y +CONFIG_MIPS_VPE_LOADER_TOM=y CONFIG_MTD_NAND=y CONFIG_MTD_NAND_ECC=y CONFIG_MTD_NAND_PLATFORM=y @@ -38,7 +49,14 @@ CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_NET_FLOW_LIMIT=y CONFIG_NLS=y CONFIG_NR_CPUS=2 +CONFIG_OF_ADDRESS_PCI=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_PADATA=y +CONFIG_PCI=y CONFIG_PCIE_LANTIQ=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_LANTIQ=y CONFIG_POWER_RESET=y CONFIG_POWER_RESET_GPIO=y CONFIG_POWER_SUPPLY=y @@ -70,9 +88,3 @@ CONFIG_XPS=y CONFIG_XRX200_PHY_FW=y CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y -CONFIG_MIPS_VPE_LOADER=y -CONFIG_MIPS_VPE_LOADER_TOM=y -CONFIG_MIPS_VPE_APSP_API=y -CONFIG_IFX_VPE_EXT=y -CONFIG_PERFCTRS=n -# CONFIG_MTSCHED is not set diff --git a/target/linux/lantiq/xrx200/target.mk b/target/linux/lantiq/xrx200/target.mk index 9600f04fd2..fc8115e795 100644 --- a/target/linux/lantiq/xrx200/target.mk +++ b/target/linux/lantiq/xrx200/target.mk @@ -1,7 +1,7 @@ ARCH:=mips SUBTARGET:=xrx200 BOARDNAME:=XRX200 -FEATURES:=squashfs atm nand ubifs +FEATURES:=squashfs atm nand CPU_TYPE:=24kc DEFAULT_PACKAGES+=kmod-leds-gpio \ diff --git a/target/linux/lantiq/xway/config-default b/target/linux/lantiq/xway/config-default index bddf02763a..79064ccc02 100644 --- a/target/linux/lantiq/xway/config-default +++ b/target/linux/lantiq/xway/config-default @@ -1,36 +1,15 @@ CONFIG_ADM6996_PHY=y CONFIG_AR8216_PHY=y -# CONFIG_ARCH_HAS_SG_CHAIN is not set -CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y -CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y -CONFIG_CPU_SUPPORTS_MSA=y +CONFIG_BLK_MQ_PCI=y CONFIG_CRC16=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_LZO=y CONFIG_FIRMWARE_IN_KERNEL=y -CONFIG_GPIO_DEVRES=y -CONFIG_HAS_IOPORT_MAP=y -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_HAVE_BPF_JIT=y -CONFIG_HAVE_CC_STACKPROTECTOR=y -CONFIG_HAVE_CONTEXT_TRACKING=y -CONFIG_HAVE_DEBUG_STACKOVERFLOW=y -CONFIG_HAVE_DMA_CONTIGUOUS=y -CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -CONFIG_HZ_PERIODIC=y CONFIG_INPUT=y CONFIG_INPUT_EVDEV=y CONFIG_INPUT_POLLDEV=y -CONFIG_IRQCHIP=y -CONFIG_IRQ_WORK=y # CONFIG_ISDN is not set CONFIG_LEDS_TRIGGER_HEARTBEAT=y -CONFIG_LIBFDT=y CONFIG_LZO_COMPRESS=y CONFIG_LZO_DECOMPRESS=y CONFIG_MTD_NAND=y @@ -38,7 +17,6 @@ CONFIG_MTD_NAND_ECC=y CONFIG_MTD_NAND_PLATFORM=y CONFIG_MTD_NAND_XWAY=y # CONFIG_MTD_PHYSMAP_OF is not set -CONFIG_MTD_SPLIT_UIMAGE_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y @@ -46,17 +24,17 @@ CONFIG_MTD_UBI_BLOCK=y # CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_NLS=y -# CONFIG_NO_IOPORT_MAP is not set CONFIG_OF_ADDRESS_PCI=y -# CONFIG_RCU_STALL_COMMON is not set +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_PCI=y +# CONFIG_PCIE_LANTIQ is not set +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_LANTIQ=y CONFIG_RTL8306_PHY=y CONFIG_RTL8366S_PHY=y CONFIG_RTL8367B_PHY=y CONFIG_RTL8367_PHY=y -CONFIG_SPI=y -CONFIG_SPI_LANTIQ=y -CONFIG_SPI_MASTER=y -CONFIG_SYS_SUPPORTS_MIPS16=y CONFIG_UBIFS_FS=y CONFIG_UBIFS_FS_ADVANCED_COMPR=y CONFIG_UBIFS_FS_LZO=y @@ -66,6 +44,5 @@ CONFIG_USB_COMMON=y # CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y # CONFIG_USB_UHCI_HCD is not set -# CONFIG_XRX200_PHY_FW is not set CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/lantiq/xway/target.mk b/target/linux/lantiq/xway/target.mk index 429be761c4..550c61edf0 100644 --- a/target/linux/lantiq/xway/target.mk +++ b/target/linux/lantiq/xway/target.mk @@ -1,7 +1,7 @@ ARCH:=mips SUBTARGET:=xway BOARDNAME:=XWAY -FEATURES:=squashfs atm nand ubifs ramdisk +FEATURES:=squashfs atm nand ramdisk CPU_TYPE:=24kc DEFAULT_PACKAGES+=kmod-leds-gpio kmod-gpio-button-hotplug swconfig diff --git a/target/linux/lantiq/xway_legacy/config-default b/target/linux/lantiq/xway_legacy/config-default index b838106ddc..c8aa631787 100644 --- a/target/linux/lantiq/xway_legacy/config-default +++ b/target/linux/lantiq/xway_legacy/config-default @@ -1,5 +1,6 @@ CONFIG_ADM6996_PHY=y CONFIG_AR8216_PHY=y +CONFIG_BLK_MQ_PCI=y CONFIG_CRC16=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_LZO=y @@ -16,6 +17,13 @@ CONFIG_LZO_COMPRESS=y CONFIG_LZO_DECOMPRESS=y # CONFIG_MTD_PHYSMAP_OF is not set CONFIG_NLS=y +CONFIG_OF_ADDRESS_PCI=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_PCI=y +# CONFIG_PCIE_LANTIQ is not set +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_LANTIQ=y CONFIG_RTL8306_PHY=y CONFIG_RTL8366S_PHY=y CONFIG_RTL8367B_PHY=y diff --git a/target/linux/layerscape/Makefile b/target/linux/layerscape/Makefile index 67da8449aa..bd91556ef4 100644 --- a/target/linux/layerscape/Makefile +++ b/target/linux/layerscape/Makefile @@ -10,7 +10,7 @@ BOARD:=layerscape BOARDNAME:=NXP Layerscape DEVICE_TYPE:=developerboard KERNEL_PATCHVER:=4.9 -FEATURES:=squashfs nand usb pcie gpio +FEATURES:=squashfs nand usb pcie gpio fpu SUBTARGETS:=armv8_64b armv8_32b MAINTAINER:=Yangbo Lu diff --git a/target/linux/layerscape/README b/target/linux/layerscape/README new file mode 100644 index 0000000000..eaeee32e8c --- /dev/null +++ b/target/linux/layerscape/README @@ -0,0 +1,151 @@ + +Layerscape Quick Start + +1. Layerscape target support +---------------------------- +* ARMv8 64-bit + LS1012ARDB LS1012AFRDM LS1043ARDB LS1046ARDB LS1088ARDB LS2088ARDB + +* ARMv8 32-bit + LS1012ARDB LS1012AFRDM LS1043ARDB LS1046ARDB + + +2. Build +-------- + +2.1 make menuconfig +------------------- +* For single device + + Target System: "NXP Layerscape". + Subtarget: "ARMv8 64-bit based boards" or "ARMv8 32-bit based boards" + Target Profile: (select device you want to build) + + For example, build firmware for 64-bit ls1043ardb. + +---------------------------------------------+ + | Target System (NXP Layerscape) ---> | + |---------------------------------------------| + | Subtarget (ARMv8 64-bit based boards) ---> | + |---------------------------------------------| + | Target Profile (ls1043ardb-armv8_64b) ---> | + +---------------------------------------------+ + +* For multiple devices + + Target System: "NXP Layerscape". + Subtarget: "ARMv8 64-bit based boards" or "ARMv8 32-bit based boards" + Target Profile: "Multiple devices" + Target Devices: (select devices you want to build) + + For example, build firmware for all 64-bit devices. + Target Devices ---> + +-----------------------------------------------------------------+ + | [*] Enable all profiles by default | + |-----------------------------------------------------------------| + | [ ] Use a per-device root filesystem that adds profile packages | + |-----------------------------------------------------------------| + | [*] ls1012afrdm-armv8_64b ---- | + |-----------------------------------------------------------------| + | [*] ls1012ardb-armv8_64b ---- | + |-----------------------------------------------------------------| + | [*] ls1043ardb-armv8_64b ---- | + |-----------------------------------------------------------------| + | [*] ls1046ardb-armv8_64b ---- | + |-----------------------------------------------------------------| + | [*] ls1088ardb-armv8_64b ---- | + |-----------------------------------------------------------------| + | [*] ls2088ardb-armv8_64b ---- | + +-----------------------------------------------------------------+ + + Note: per-device root filesystem hasn't been supported for now. + +2.2 make (or make -j) +------------------------ + +2.3 Final firmware +------------------ +Final firmware would be in bin/targets/layerscape//, and +named as lede-layerscape---squashfs-firmware.bin. + + +3. Program firmware to NOR/QSPI flash +------------------------------------- +* LS1043ARDB (NOR flash) + + Start up from bank0, and program firmware to bank4 with below commands. + Switch to bank4 to start up LEDE. + + => tftp a0000000 lede-layerscape---squashfs-firmware.bin + => protect off all + => erase 64000000 +$filesize + => cp.b a0000000 64000000 $filesize + => cpld reset altbank + +* LS2088ARDB (NOR flash) + + Start up from bank0, and program firmware to bank4 with below commands. + Switch to bank4 to start up LEDE. + + => tftp a0000000 lede-layerscape---squashfs-firmware.bin + => protect off all + => erase 584000000 +$filesize + => cp.b a0000000 584000000 $filesize + => qix altbank + +* LS1012ARDB (QSPI flash) + + Start up from bank1, and program firmware to bank2 with below commands. + Switch to bank2 to start up LEDE. + + => tftp a0000000 lede-layerscape---squashfs-firmware.bin + => i2c mw 0x24 0x7 0xfc;i2c mw 0x24 0x3 0xf5 + => sf probe 0:0 + => sf erase 0 +$filesize + => sf write a0000000 0 $filesize + => reset + +* LS1012AFRDM (QSPI flash) + + LS1012AFRDM board only has one bank. Start up board, and program firmware + with below commands. Reset to start up LEDE. + + => tftp 96000000 lede-layerscape---squashfs-firmware.bin + => sf probe 0:0 + => sf erase 0 +$filesize + => sf write 96000000 0 $filesize + => reset + +* LS1046ARDB (QSPI flash) + + Start up from bank1, and program firmware to bank2 with below commands. + Switch to bank2 to start up LEDE. + + => tftp a0000000 lede-layerscape---squashfs-firmware.bin + => sf probe 0:1 + => sf erase 0 +$filesize + => sf write a0000000 0 $filesize + => cpld reset altbank + +* LS1088ARDB (QSPI flash) + + Start up from bank0, and program firmware to bank1 with below commands. + Switch to bank1 to start up LEDE. + + => tftp a0000000 lede-layerscape---squashfs-firmware.bin + => sf probe 0:1 + => sf erase 0 +$filesize + => sf write a0000000 0 $filesize + => qix altbank + + Note: old version u-boot of ls1088ardb may use below commands to switch to + bank1 instead of 'qix altbank'. + => i2c mw 66 50 20;i2c mw 66 10 20;i2c mw 66 10 21 + + +4. Other references and sources +------------------------------- +- NXP LSDK site: https://lsdk.github.io/ + +- NXP LSDK github: https://github.com/qoriq-open-source + +- LEDE documentation: https://lede-project.org/docs/start diff --git a/target/linux/layerscape/armv8_32b/config-4.9 b/target/linux/layerscape/armv8_32b/config-4.9 index f0687f3804..0d98e8a13a 100644 --- a/target/linux/layerscape/armv8_32b/config-4.9 +++ b/target/linux/layerscape/armv8_32b/config-4.9 @@ -2,7 +2,6 @@ CONFIG_ABX500_CORE=y CONFIG_AD525X_DPOT=y CONFIG_AD525X_DPOT_I2C=y # CONFIG_AD525X_DPOT_SPI is not set -CONFIG_ADVISE_SYSCALLS=y CONFIG_AHCI_IMX=y CONFIG_AHCI_QORIQ=y CONFIG_AK8975=y @@ -11,6 +10,7 @@ CONFIG_APDS9802ALS=y CONFIG_AQUANTIA_PHY=y # CONFIG_ARCH_AXXIA is not set CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_DMA_ADDR_T_64BIT=y CONFIG_ARCH_HAS_BANDGAP=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y @@ -254,7 +254,6 @@ CONFIG_CROSS_MEMORY_ATTACH=y CONFIG_CRYPTO_AEAD=y CONFIG_CRYPTO_AEAD2=y # CONFIG_CRYPTO_AES_ARM_CE is not set -# CONFIG_CRYPTO_ARC4 is not set CONFIG_CRYPTO_AUTHENC=y CONFIG_CRYPTO_CBC=y CONFIG_CRYPTO_CRC32C=y @@ -304,7 +303,6 @@ CONFIG_DEBUG_RODATA=y # CONFIG_DEBUG_USER is not set CONFIG_DECOMPRESS_BZIP2=y CONFIG_DECOMPRESS_GZIP=y -CONFIG_DECOMPRESS_LZ4=y CONFIG_DECOMPRESS_LZMA=y CONFIG_DECOMPRESS_LZO=y CONFIG_DECOMPRESS_XZ=y @@ -450,6 +448,9 @@ CONFIG_FSL_EDMA=y CONFIG_FSL_FM_MAX_FRAME_SIZE=1522 CONFIG_FSL_FM_RX_EXTRA_HEADROOM=64 CONFIG_FSL_GUTS=y +CONFIG_FSL_IFC=y +CONFIG_FSL_PPFE=y +CONFIG_FSL_PPFE_UTIL_DISABLED=y CONFIG_FSL_PQ_MDIO=y # CONFIG_FSL_QDMA is not set CONFIG_FSL_QMAN_CI_SCHED_CFG_BMAN_W=2 @@ -524,7 +525,6 @@ CONFIG_GPIO_TPS6586X=y CONFIG_GPIO_TPS65910=y CONFIG_GPIO_TWL4030=y CONFIG_GPIO_XILINX=y -CONFIG_GRACE_PERIOD=y CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y @@ -669,11 +669,6 @@ CONFIG_IOMMU_HELPER=y # CONFIG_IOMMU_IO_PGTABLE_LPAE is not set CONFIG_IOMMU_SUPPORT=y CONFIG_IOSCHED_CFQ=y -CONFIG_IP6_NF_FILTER=y -CONFIG_IP6_NF_IPTABLES=y -CONFIG_IP6_NF_NAT=y -CONFIG_IP6_NF_TARGET_MASQUERADE=y -# CONFIG_IP6_NF_TARGET_NPT is not set CONFIG_IPC_NS=y CONFIG_IPV6=y CONFIG_IPV6_MULTIPLE_TABLES=y @@ -683,39 +678,10 @@ CONFIG_IPV6_SIT=y # CONFIG_IPV6_SUBTREES is not set # CONFIG_IP_ADVANCED_ROUTER is not set # CONFIG_IP_MROUTE is not set -CONFIG_IP_NF_FILTER=y -CONFIG_IP_NF_IPTABLES=y -CONFIG_IP_NF_MANGLE=y -CONFIG_IP_NF_NAT=y -CONFIG_IP_NF_TARGET_MASQUERADE=y CONFIG_IP_PNP=y CONFIG_IP_PNP_BOOTP=y CONFIG_IP_PNP_DHCP=y CONFIG_IP_PNP_RARP=y -CONFIG_IP_VS=y -# CONFIG_IP_VS_DEBUG is not set -# CONFIG_IP_VS_DH is not set -# CONFIG_IP_VS_FO is not set -# CONFIG_IP_VS_IPV6 is not set -# CONFIG_IP_VS_LBLC is not set -# CONFIG_IP_VS_LBLCR is not set -# CONFIG_IP_VS_LC is not set -# CONFIG_IP_VS_NFCT is not set -# CONFIG_IP_VS_NQ is not set -# CONFIG_IP_VS_OVF is not set -# CONFIG_IP_VS_PROTO_AH is not set -# CONFIG_IP_VS_PROTO_AH_ESP is not set -# CONFIG_IP_VS_PROTO_ESP is not set -# CONFIG_IP_VS_PROTO_SCTP is not set -# CONFIG_IP_VS_PROTO_TCP is not set -# CONFIG_IP_VS_PROTO_UDP is not set -# CONFIG_IP_VS_RR is not set -# CONFIG_IP_VS_SED is not set -# CONFIG_IP_VS_SH is not set -CONFIG_IP_VS_SH_TAB_BITS=8 -CONFIG_IP_VS_TAB_BITS=12 -# CONFIG_IP_VS_WLC is not set -# CONFIG_IP_VS_WRR is not set CONFIG_IRQCHIP=y CONFIG_IRQ_CROSSBAR=y CONFIG_IRQ_DOMAIN=y @@ -726,7 +692,6 @@ CONFIG_IRQ_WORK=y # CONFIG_ISDN is not set CONFIG_ISL29003=y CONFIG_JBD2=y -# CONFIG_JFFS2_FS is not set CONFIG_KALLSYMS=y CONFIG_KERNEL_GZIP=y # CONFIG_KERNEL_XZ is not set @@ -759,14 +724,14 @@ CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 CONFIG_LIBFDT=y CONFIG_LOCALVERSION_AUTO=y -CONFIG_LOCKD=y CONFIG_LOCKUP_DETECTOR=y CONFIG_LOCK_SPIN_ON_OWNER=y CONFIG_LOGO=y CONFIG_LOGO_LINUX_CLUT224=y CONFIG_LOGO_LINUX_MONO=y CONFIG_LOGO_LINUX_VGA16=y -CONFIG_LZ4_DECOMPRESS=y +CONFIG_LS_SCFG_MSI=y +# CONFIG_LS_SOC_DRIVERS is not set CONFIG_LZO_COMPRESS=y CONFIG_LZO_DECOMPRESS=y CONFIG_MACB=y @@ -878,8 +843,10 @@ CONFIG_MTD_NAND_BRCMNAND=y CONFIG_MTD_NAND_DENALI=y CONFIG_MTD_NAND_DENALI_DT=y CONFIG_MTD_NAND_ECC=y +CONFIG_MTD_NAND_FSL_IFC=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384 CONFIG_MTD_SST25L=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 @@ -896,49 +863,11 @@ CONFIG_NAMESPACES=y CONFIG_NATIONAL_PHY=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEON=y -CONFIG_NETFILTER=y -CONFIG_NETFILTER_ADVANCED=y -CONFIG_NETFILTER_INGRESS=y -CONFIG_NETFILTER_XTABLES=y -CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=y -CONFIG_NETFILTER_XT_MATCH_COMMENT=y -CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y -CONFIG_NETFILTER_XT_MATCH_IPVS=y -CONFIG_NETFILTER_XT_NAT=y -CONFIG_NETFILTER_XT_TARGET_CHECKSUM=y -CONFIG_NETLINK_DIAG=y # CONFIG_NET_CLS_CGROUP is not set CONFIG_NET_FLOW_LIMIT=y -CONFIG_NET_INGRESS=y CONFIG_NET_IP_TUNNEL=y -CONFIG_NET_KEY=y CONFIG_NET_NS=y -CONFIG_NET_PACKET_ENGINE=y CONFIG_NET_PTP_CLASSIFY=y -CONFIG_NET_SWITCHDEV=y -# CONFIG_NET_VENDOR_AURORA is not set -CONFIG_NFS_ACL_SUPPORT=y -CONFIG_NFS_FS=y -CONFIG_NFS_USE_KERNEL_DNS=y -# CONFIG_NFS_USE_LEGACY_DNS is not set -CONFIG_NFS_V2=y -CONFIG_NFS_V3_ACL=y -CONFIG_NFS_V4=y -CONFIG_NF_CONNTRACK=y -CONFIG_NF_CONNTRACK_IPV4=y -CONFIG_NF_CONNTRACK_IPV6=y -CONFIG_NF_CONNTRACK_MARK=y -# CONFIG_NF_CONNTRACK_RTCACHE is not set -CONFIG_NF_DEFRAG_IPV4=y -CONFIG_NF_DEFRAG_IPV6=y -# CONFIG_NF_LOG_IPV6 is not set -CONFIG_NF_NAT=y -CONFIG_NF_NAT_IPV4=y -CONFIG_NF_NAT_IPV6=y -CONFIG_NF_NAT_MASQUERADE_IPV4=y -CONFIG_NF_NAT_MASQUERADE_IPV6=y -CONFIG_NF_NAT_NEEDED=y -# CONFIG_NF_NAT_REDIRECT is not set CONFIG_NLS=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y @@ -964,7 +893,6 @@ CONFIG_OF_NET=y CONFIG_OF_PCI=y CONFIG_OF_PCI_IRQ=y CONFIG_OF_RESERVED_MEM=y -CONFIG_OID_REGISTRY=y CONFIG_OLD_SIGACTION=y CONFIG_OLD_SIGSUSPEND3=y # CONFIG_OMAP2PLUS_MBOX is not set @@ -994,7 +922,6 @@ CONFIG_OUTER_CACHE_SYNC=y CONFIG_PACKET_DIAG=y CONFIG_PAGE_COUNTER=y CONFIG_PAGE_OFFSET=0xC0000000 -# CONFIG_PALMAS_GPADC is not set # CONFIG_PANIC_ON_OOPS is not set CONFIG_PANIC_ON_OOPS_VALUE=0 CONFIG_PANIC_TIMEOUT=0 @@ -1009,6 +936,7 @@ CONFIG_PCIEASPM_DEFAULT=y CONFIG_PCIEPORTBUS=y CONFIG_PCIE_DW=y CONFIG_PCIE_PME=y +CONFIG_PCI_BUS_ADDR_T_64BIT=y CONFIG_PCI_DOMAINS=y CONFIG_PCI_DOMAINS_GENERIC=y # CONFIG_PCI_DRA7XX is not set @@ -1062,7 +990,6 @@ CONFIG_PREEMPT_NOTIFIERS=y CONFIG_PRINTK_TIME=y # CONFIG_PROBE_EVENTS is not set CONFIG_PROC_CHILDREN=y -CONFIG_PROC_PAGE_MONITOR=y CONFIG_PROC_PID_CPUSET=y CONFIG_PSTORE=y CONFIG_PSTORE_CONSOLE=y @@ -1094,7 +1021,6 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=21 CONFIG_RCU_STALL_COMMON=y CONFIG_RD_BZIP2=y CONFIG_RD_GZIP=y -CONFIG_RD_LZ4=y CONFIG_RD_LZMA=y CONFIG_RD_LZO=y CONFIG_RD_XZ=y @@ -1147,7 +1073,6 @@ CONFIG_REGULATOR_TWL4030=y CONFIG_REGULATOR_VEXPRESS=y CONFIG_RESET_CONTROLLER=y CONFIG_RFS_ACCEL=y -CONFIG_ROOT_NFS=y CONFIG_RPS=y CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_AS3722=y @@ -1245,7 +1170,7 @@ CONFIG_SOC_HAS_REALTIME_COUNTER=y # CONFIG_SOC_IMX6SX is not set # CONFIG_SOC_IMX6UL is not set # CONFIG_SOC_IMX7D is not set -# CONFIG_SOC_LS1021A is not set +CONFIG_SOC_LS1021A=y CONFIG_SOC_OMAP3430=y CONFIG_SOC_OMAP5=y CONFIG_SOC_TI81XX=y @@ -1254,7 +1179,6 @@ CONFIG_SPARSE_IRQ=y CONFIG_SPI=y CONFIG_SPI_BITBANG=y CONFIG_SPI_CADENCE=y -# CONFIG_SPI_CADENCE_QUADSPI is not set CONFIG_SPI_FSL_QUADSPI=y # CONFIG_SPI_IMX is not set CONFIG_SPI_MASTER=y @@ -1278,8 +1202,6 @@ CONFIG_STMPE_I2C=y # CONFIG_STMPE_SPI is not set CONFIG_STMP_DEVICE=y # CONFIG_STRIP_ASM_SYMS is not set -CONFIG_SUNRPC=y -CONFIG_SUNRPC_GSS=y CONFIG_SUSPEND=y CONFIG_SUSPEND_FREEZER=y CONFIG_SWIOTLB=y @@ -1347,7 +1269,6 @@ CONFIG_USB_DWC3_DUAL_ROLE=y CONFIG_USB_DWC3_OF_SIMPLE=y CONFIG_USB_DWC3_OMAP=y CONFIG_USB_DWC3_PCI=y -# CONFIG_USB_EHCI_FSL is not set CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_HCD_PLATFORM=y # CONFIG_USB_EHCI_MXC is not set diff --git a/target/linux/layerscape/armv8_32b/profiles/00-default.mk b/target/linux/layerscape/armv8_32b/profiles/00-default.mk deleted file mode 100644 index fc1231dc7a..0000000000 --- a/target/linux/layerscape/armv8_32b/profiles/00-default.mk +++ /dev/null @@ -1,18 +0,0 @@ -define Profile/Default - NAME:=Default Profile - PRIORITY:=1 -endef - -define Profile/Default/Description - Default package set compatible with most boards. -endef - -DEFAULT_PACKAGES+= \ - rcw-layerscape-ls1043ardb uboot-layerscape-$(SUBTARGET)-ls1043ardb \ - fman-layerscape-ls1043ardb \ - rcw-layerscape-ls1046ardb uboot-layerscape-$(SUBTARGET)-ls1046ardb \ - fman-layerscape-ls1046ardb \ - rcw-layerscape-ls1012ardb uboot-layerscape-$(SUBTARGET)-ls1012ardb \ - kmod-ppfe ppfe-ls1012ardb - -$(eval $(call Profile,Default)) diff --git a/target/linux/layerscape/armv8_64b/config-4.9 b/target/linux/layerscape/armv8_64b/config-4.9 index 91a89a25b9..bb74434317 100644 --- a/target/linux/layerscape/armv8_64b/config-4.9 +++ b/target/linux/layerscape/armv8_64b/config-4.9 @@ -23,7 +23,6 @@ CONFIG_ACPI_REDUCED_HARDWARE_ONLY=y CONFIG_ACPI_SPCR_TABLE=y CONFIG_ACPI_TABLE_UPGRADE=y CONFIG_ACPI_THERMAL=y -CONFIG_ADVISE_SYSCALLS=y CONFIG_AHCI_CEVA=y CONFIG_AHCI_QORIQ=y CONFIG_AHCI_XGENE=y @@ -107,6 +106,7 @@ CONFIG_ARM_SP805_WATCHDOG=y CONFIG_ARM_TIMER_SP804=y CONFIG_ASN1=y CONFIG_ASSOCIATIVE_ARRAY=y +CONFIG_ASYNC_CORE=y CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y CONFIG_ATA=y CONFIG_ATA_ACPI=y @@ -145,11 +145,6 @@ CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 CONFIG_BOUNCE=y CONFIG_BPF_JIT=y # CONFIG_BPF_SYSCALL is not set -CONFIG_BRIDGE_EBT_DNAT=y -CONFIG_BRIDGE_EBT_SNAT=y -CONFIG_BRIDGE_EBT_T_NAT=y -CONFIG_BRIDGE_NETFILTER=y -CONFIG_BRIDGE_NF_EBTABLES=y CONFIG_BRIDGE_VLAN_FILTERING=y CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y @@ -259,7 +254,6 @@ CONFIG_CRYPTO_AES_ARM64_CE_CCM=y CONFIG_CRYPTO_AKCIPHER=y CONFIG_CRYPTO_AKCIPHER2=y CONFIG_CRYPTO_ANSI_CPRNG=y -# CONFIG_CRYPTO_ARC4 is not set CONFIG_CRYPTO_AUTHENC=y CONFIG_CRYPTO_CBC=y CONFIG_CRYPTO_CRC32C=y @@ -274,12 +268,13 @@ CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API=y CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_DESC=y CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI=y # CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG is not set +CONFIG_CRYPTO_DEV_FSL_CAAM_DMA=y # CONFIG_CRYPTO_DEV_FSL_CAAM_INTC is not set CONFIG_CRYPTO_DEV_FSL_CAAM_JR=y CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API=y CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9 CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API=y -# CONFIG_CRYPTO_DEV_FSL_DPAA2_CAAM is not set +CONFIG_CRYPTO_DEV_FSL_DPAA2_CAAM=y CONFIG_CRYPTO_DRBG=y CONFIG_CRYPTO_DRBG_HMAC=y CONFIG_CRYPTO_DRBG_MENU=y @@ -318,7 +313,6 @@ CONFIG_DEBUG_RODATA=y CONFIG_DEBUG_SET_MODULE_RONX=y CONFIG_DECOMPRESS_BZIP2=y CONFIG_DECOMPRESS_GZIP=y -CONFIG_DECOMPRESS_LZ4=y CONFIG_DECOMPRESS_LZMA=y CONFIG_DECOMPRESS_LZO=y CONFIG_DECOMPRESS_XZ=y @@ -461,6 +455,8 @@ CONFIG_FSL_LS2_CONSOLE=y CONFIG_FSL_MC_BUS=y CONFIG_FSL_MC_DPIO=y CONFIG_FSL_MC_RESTOOL=y +CONFIG_FSL_PPFE=y +CONFIG_FSL_PPFE_UTIL_DISABLED=y # CONFIG_FSL_QBMAN_DEBUG is not set # CONFIG_FSL_QDMA is not set CONFIG_FSL_QMAN_CI_SCHED_CFG_BMAN_W=2 @@ -691,11 +687,6 @@ CONFIG_IPV6=y CONFIG_IPV6_SIT=y # CONFIG_IP_ADVANCED_ROUTER is not set # CONFIG_IP_MROUTE is not set -CONFIG_IP_NF_FILTER=y -CONFIG_IP_NF_IPTABLES=y -CONFIG_IP_NF_MANGLE=y -CONFIG_IP_NF_NAT=y -CONFIG_IP_NF_TARGET_MASQUERADE=y CONFIG_IP_PNP=y CONFIG_IP_PNP_BOOTP=y CONFIG_IP_PNP_DHCP=y @@ -708,11 +699,9 @@ CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_WORK=y # CONFIG_ISDN is not set CONFIG_JBD2=y -# CONFIG_JFFS2_FS is not set CONFIG_JUMP_LABEL=y CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y -# CONFIG_KASAN is not set CONFIG_KEXEC=y CONFIG_KEXEC_CORE=y CONFIG_KEYBOARD_ATKBD=y @@ -748,7 +737,6 @@ CONFIG_LOGO_LINUX_CLUT224=y # CONFIG_LOGO_LINUX_VGA16 is not set CONFIG_LS_SCFG_MSI=y CONFIG_LS_SOC_DRIVERS=y -CONFIG_LZ4_DECOMPRESS=y CONFIG_LZO_COMPRESS=y CONFIG_LZO_DECOMPRESS=y CONFIG_MACB=y @@ -837,6 +825,7 @@ CONFIG_MTD_NAND_ECC=y CONFIG_MTD_NAND_FSL_IFC=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384 CONFIG_MTD_SST25L=y CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_MV_XOR_V2=y @@ -845,76 +834,12 @@ CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_MULTIPLE_NODES=y CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y CONFIG_NEED_SG_DMA_LENGTH=y -CONFIG_NETFILTER=y -CONFIG_NETFILTER_ADVANCED=y -CONFIG_NETFILTER_INGRESS=y -CONFIG_NETFILTER_NETLINK=y -CONFIG_NETFILTER_XTABLES=y -CONFIG_NETFILTER_XT_CONNMARK=y -CONFIG_NETFILTER_XT_MATCH_COMMENT=y -CONFIG_NETFILTER_XT_NAT=y -CONFIG_NETFILTER_XT_TARGET_CONNMARK=y # CONFIG_NETLABEL is not set -CONFIG_NETLINK_DIAG=y -# CONFIG_NETWORK_FILESYSTEMS is not set -CONFIG_NET_9P=y -# CONFIG_NET_9P_DEBUG is not set -CONFIG_NET_9P_VIRTIO=y # CONFIG_NET_CLS_CGROUP is not set CONFIG_NET_FLOW_LIMIT=y -CONFIG_NET_INGRESS=y CONFIG_NET_IP_TUNNEL=y -CONFIG_NET_KEY=y CONFIG_NET_NS=y -CONFIG_NET_PACKET_ENGINE=y CONFIG_NET_PTP_CLASSIFY=y -# CONFIG_NET_VENDOR_AURORA is not set -# CONFIG_NET_VENDOR_STMICRO is not set -# CONFIG_NFT_CHAIN_NAT_IPV4 is not set -# CONFIG_NFT_CHAIN_ROUTE_IPV4 is not set -CONFIG_NFT_COMPAT=y -# CONFIG_NFT_COUNTER is not set -CONFIG_NFT_CT=y -# CONFIG_NFT_EXTHDR is not set -# CONFIG_NFT_HASH is not set -# CONFIG_NFT_LIMIT is not set -# CONFIG_NFT_LOG is not set -CONFIG_NFT_MASQ=y -# CONFIG_NFT_MASQ_IPV4 is not set -# CONFIG_NFT_META is not set -CONFIG_NFT_NAT=y -# CONFIG_NFT_NUMGEN is not set -# CONFIG_NFT_QUOTA is not set -# CONFIG_NFT_REDIR is not set -# CONFIG_NFT_REJECT is not set -# CONFIG_NFT_REJECT_IPV4 is not set -# CONFIG_NFT_SET_HASH is not set -# CONFIG_NFT_SET_RBTREE is not set -CONFIG_NF_CONNTRACK=y -CONFIG_NF_CONNTRACK_EVENTS=y -CONFIG_NF_CONNTRACK_IPV4=y -CONFIG_NF_CONNTRACK_IPV6=y -CONFIG_NF_CONNTRACK_MARK=y -# CONFIG_NF_CONNTRACK_RTCACHE is not set -CONFIG_NF_DEFRAG_IPV4=y -CONFIG_NF_DEFRAG_IPV6=y -# CONFIG_NF_LOG_BRIDGE is not set -CONFIG_NF_LOG_COMMON=y -CONFIG_NF_LOG_IPV6=y -CONFIG_NF_NAT=y -CONFIG_NF_NAT_IPV4=y -CONFIG_NF_NAT_IPV6=y -CONFIG_NF_NAT_MASQUERADE_IPV4=y -CONFIG_NF_NAT_MASQUERADE_IPV6=y -CONFIG_NF_NAT_NEEDED=y -# CONFIG_NF_NAT_REDIRECT is not set -CONFIG_NF_REJECT_IPV6=y -CONFIG_NF_TABLES=y -# CONFIG_NF_TABLES_ARP is not set -CONFIG_NF_TABLES_BRIDGE=y -# CONFIG_NF_TABLES_INET is not set -CONFIG_NF_TABLES_IPV4=y -# CONFIG_NF_TABLES_IPV6 is not set CONFIG_NLS=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y @@ -1016,7 +941,6 @@ CONFIG_PREEMPT_RCU=y CONFIG_PRINTK_TIME=y CONFIG_PRINT_QUOTA_WARNING=y CONFIG_PROC_CHILDREN=y -CONFIG_PROC_PAGE_MONITOR=y CONFIG_PROC_PID_CPUSET=y CONFIG_PROFILING=y CONFIG_PTP_1588_CLOCK=y @@ -1046,7 +970,6 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=21 CONFIG_RCU_STALL_COMMON=y CONFIG_RD_BZIP2=y CONFIG_RD_GZIP=y -CONFIG_RD_LZ4=y CONFIG_RD_LZMA=y CONFIG_RD_LZO=y CONFIG_RD_XZ=y @@ -1240,7 +1163,6 @@ CONFIG_USB_DWC3_DUAL_ROLE=y # CONFIG_USB_DWC3_HOST is not set CONFIG_USB_DWC3_OF_SIMPLE=y CONFIG_USB_DWC3_PCI=y -# CONFIG_USB_EHCI_FSL is not set CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_HCD_PLATFORM=y CONFIG_USB_EHCI_PCI=y diff --git a/target/linux/layerscape/armv8_64b/profiles/00-default.mk b/target/linux/layerscape/armv8_64b/profiles/00-default.mk deleted file mode 100644 index fc1231dc7a..0000000000 --- a/target/linux/layerscape/armv8_64b/profiles/00-default.mk +++ /dev/null @@ -1,18 +0,0 @@ -define Profile/Default - NAME:=Default Profile - PRIORITY:=1 -endef - -define Profile/Default/Description - Default package set compatible with most boards. -endef - -DEFAULT_PACKAGES+= \ - rcw-layerscape-ls1043ardb uboot-layerscape-$(SUBTARGET)-ls1043ardb \ - fman-layerscape-ls1043ardb \ - rcw-layerscape-ls1046ardb uboot-layerscape-$(SUBTARGET)-ls1046ardb \ - fman-layerscape-ls1046ardb \ - rcw-layerscape-ls1012ardb uboot-layerscape-$(SUBTARGET)-ls1012ardb \ - kmod-ppfe ppfe-ls1012ardb - -$(eval $(call Profile,Default)) diff --git a/target/linux/layerscape/base-files/etc/rc.local b/target/linux/layerscape/base-files/etc/rc.local deleted file mode 100644 index 297c3a83db..0000000000 --- a/target/linux/layerscape/base-files/etc/rc.local +++ /dev/null @@ -1,4 +0,0 @@ -# Put your custom commands here that should be executed once -# the system init finished. By default this file does nothing. -modprobe pfe.ko -exit 0 diff --git a/target/linux/layerscape/image/Makefile b/target/linux/layerscape/image/Makefile index 5577b16238..88bf8d7b40 100644 --- a/target/linux/layerscape/image/Makefile +++ b/target/linux/layerscape/image/Makefile @@ -16,10 +16,30 @@ define Build/append-ls-uboot dd if=$(STAGING_DIR_IMAGE)/$(1)-$(SUBTARGET)-uboot.bin >> $@ endef +define Build/append-ls-ppa + dd if=$(STAGING_DIR_IMAGE)/$(1)-ppa.itb >> $@ +endef + define Build/append-ls-fman dd if=$(STAGING_DIR_IMAGE)/$(1)-fman.bin >> $@ endef +define Build/append-ls-mc + dd if=$(STAGING_DIR_IMAGE)/$(1)-mc.itb >> $@ +endef + +define Build/append-ls-ppfe + dd if=$(STAGING_DIR_IMAGE)/pfe.itb >> $@ +endef + +define Build/append-ls-dpl + dd if=$(STAGING_DIR_IMAGE)/$(1)-dpl.dtb >> $@ +endef + +define Build/append-ls-dpc + dd if=$(STAGING_DIR_IMAGE)/$(1)-dpc.dtb >> $@ +endef + define Build/append-ls-dtb $(call Image/BuildDTB,$(DTS_DIR)/$(1).dts,$(DTS_DIR)/$(1).dtb) dd if=$(DTS_DIR)/$(1).dtb >> $@ @@ -51,10 +71,12 @@ endef define Device/ls1043ardb DEVICE_TITLE := ls1043ardb-$(SUBTARGET) - DEVICE_PACKAGES += rcw-layerscape-ls1043ardb uboot-layerscape-$(SUBTARGET)-ls1043ardb fman-layerscape-ls1043ardb + DEVICE_PACKAGES += rcw-layerscape-ls1043ardb uboot-layerscape-$(SUBTARGET)-ls1043ardb \ + fman-layerscape-ls1043ardb layerscape-ppa-ls1043ardb DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1043a-rdb-sdk IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \ - append-ls-uboot $(1) | pad-to 9M | \ + append-ls-uboot $(1) | pad-to 4M | \ + append-ls-ppa $(1) | pad-to 9M | \ append-ls-fman $(1) | pad-to 15M | \ append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ @@ -64,47 +86,83 @@ TARGET_DEVICES += ls1043ardb define Device/ls1046ardb DEVICE_TITLE := ls1046ardb-$(SUBTARGET) - DEVICE_PACKAGES += rcw-layerscape-ls1046ardb uboot-layerscape-$(SUBTARGET)-ls1046ardb fman-layerscape-ls1046ardb + DEVICE_PACKAGES += rcw-layerscape-ls1046ardb uboot-layerscape-$(SUBTARGET)-ls1046ardb \ + fman-layerscape-ls1046ardb layerscape-ppa-ls1046ardb DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1046a-rdb-sdk IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \ - append-ls-uboot $(1) | pad-to 9M | \ + append-ls-uboot $(1) | pad-to 4M | \ + append-ls-ppa $(1) | pad-to 9M | \ append-ls-fman $(1) | pad-to 15M | \ append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-ls-rootfs-ext4 $(1) 22M | check-size 67108865 + append-ls-rootfs-ext4 $(1) 30M | check-size 67108865 endef TARGET_DEVICES += ls1046ardb define Device/ls1012ardb DEVICE_TITLE := ls1012ardb-$(SUBTARGET) - DEVICE_PACKAGES += rcw-layerscape-ls1012ardb uboot-layerscape-$(SUBTARGET)-ls1012ardb kmod-ppfe ppfe-ls1012ardb + DEVICE_PACKAGES += rcw-layerscape-ls1012ardb uboot-layerscape-$(SUBTARGET)-ls1012ardb \ + kmod-ppfe layerscape-ppfe layerscape-ppa-ls1012ardb DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1012a-rdb IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \ - append-ls-uboot $(1) | pad-to 15M | \ + append-ls-uboot $(1) | pad-to 4M | \ + append-ls-ppa $(1) | pad-to 10M | \ + append-ls-ppfe | pad-to 15M | \ append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-ls-rootfs-ext4 $(1) 23M | check-size 67108865 + append-ls-rootfs-ext4 $(1) 30M | check-size 67108865 endef TARGET_DEVICES += ls1012ardb +define Device/ls1012afrdm + DEVICE_TITLE := ls1012afrdm-$(SUBTARGET) + DEVICE_PACKAGES += rcw-layerscape-ls1012afrdm uboot-layerscape-$(SUBTARGET)-ls1012afrdm \ + kmod-ppfe layerscape-ppfe layerscape-ppa-ls1012afrdm + DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1012a-frdm + IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \ + append-ls-uboot $(1) | pad-to 4M | \ + append-ls-ppa $(1) | pad-to 10M | \ + append-ls-ppfe | pad-to 15M | \ + append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \ + append-kernel | pad-to 32M | \ + append-ls-rootfs-ext4 $(1) 30M | check-size 67108865 +endef +TARGET_DEVICES += ls1012afrdm + ifeq ($(SUBTARGET),armv8_64b) define Device/ls1088ardb DEVICE_TITLE := ls1088ardb-$(SUBTARGET) - DEVICE_PACKAGES += rcw-layerscape-ls1088ardb uboot-layerscape-$(SUBTARGET)-ls1088ardb mc-binary-ls1088ardb + DEVICE_PACKAGES += rcw-layerscape-ls1088ardb uboot-layerscape-$(SUBTARGET)-ls1088ardb \ + layerscape-mc-ls1088ardb layerscape-dpl-ls1088ardb restool \ + layerscape-ppa-ls1088ardb DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1088a-rdb - IMAGE/firmware.bin = append-ls-dtb $$(DEVICE_DTS) | pad-to 1M | \ - append-kernel | pad-to 17M | \ - append-ls-rootfs-ext4 $(1) 17M | check-size 51380225 + IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \ + append-ls-uboot $(1) | pad-to 4M | \ + append-ls-ppa $(1) | pad-to 10M | \ + append-ls-mc $(1) | pad-to 13M | \ + append-ls-dpl $(1) | pad-to 14M | \ + append-ls-dpc $(1) | pad-to 15M | \ + append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \ + append-kernel | pad-to 32M | \ + append-ls-rootfs-ext4 $(1) 30M | check-size 67108865 endef TARGET_DEVICES += ls1088ardb define Device/ls2088ardb DEVICE_TITLE := ls2088ardb-$(SUBTARGET) - DEVICE_PACKAGES += rcw-layerscape-ls2088ardb uboot-layerscape-$(SUBTARGET)-ls2088ardb mc-binary-ls2088ardb + DEVICE_PACKAGES += rcw-layerscape-ls2088ardb uboot-layerscape-$(SUBTARGET)-ls2088ardb \ + layerscape-mc-ls2088ardb layerscape-dpl-ls2088ardb restool \ + layerscape-ppa-ls2088ardb DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls2088a-rdb - IMAGE/firmware.bin = append-ls-dtb $$(DEVICE_DTS) | pad-to 1M | \ - append-kernel | pad-to 17M | \ - append-rootfs | pad-rootfs | check-size 51380225 + IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \ + append-ls-uboot $(1) | pad-to 4M | \ + append-ls-ppa $(1) | pad-to 10M | \ + append-ls-mc $(1) | pad-to 13M | \ + append-ls-dpl $(1) | pad-to 14M | \ + append-ls-dpc $(1) | pad-to 15M | \ + append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \ + append-kernel | pad-to 32M | \ + append-rootfs | pad-rootfs | check-size 67108865 endef TARGET_DEVICES += ls2088ardb endif diff --git a/target/linux/layerscape/modules.mk b/target/linux/layerscape/modules.mk index 0b34f96b33..7a368a0d29 100644 --- a/target/linux/layerscape/modules.mk +++ b/target/linux/layerscape/modules.mk @@ -8,9 +8,10 @@ define KernelPackage/ppfe SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=Freescale PPFE Driver support - KCONFIG:=CONFIG_FSL_PPFE + DEPENDS:=@TARGET_layerscape + KCONFIG:=CONFIG_FSL_PPFE CONFIG_FSL_PPFE_UTIL_DISABLED FILES:=$(LINUX_DIR)/drivers/staging/fsl_ppfe/pfe.ko - AUTOLOAD:=$(call AutoLoad,35,ppfe) + AUTOLOAD:=$(call AutoLoad,35,pfe) endef define KernelPackage/ppfe/description diff --git a/target/linux/layerscape/patches-4.9/201-config-support-layerscape.patch b/target/linux/layerscape/patches-4.9/201-config-support-layerscape.patch index 939880fd14..333a9d1212 100644 --- a/target/linux/layerscape/patches-4.9/201-config-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/201-config-support-layerscape.patch @@ -1,4 +1,4 @@ -From 11edf9c88acea13d1a02901289060263b4027a77 Mon Sep 17 00:00:00 2001 +From 7992b4384d94c5e1bad998ca3a9a5781caac8e62 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 25 Sep 2017 09:52:26 +0800 Subject: [PATCH] config: support layerscape @@ -30,11 +30,11 @@ Signed-off-by: Yangbo Lu drivers/soc/fsl/layerscape/Kconfig | 10 +++ drivers/soc/fsl/layerscape/Makefile | 1 + drivers/soc/fsl/rcpm.c | 154 ++++++++++++++++++++++++++++++++ - drivers/staging/Kconfig | 4 + - drivers/staging/Makefile | 2 + + drivers/staging/Kconfig | 6 ++ + drivers/staging/Makefile | 3 + drivers/staging/fsl-dpaa2/Kconfig | 41 +++++++++ drivers/staging/fsl-dpaa2/Makefile | 9 ++ - 18 files changed, 309 insertions(+), 4 deletions(-) + 18 files changed, 312 insertions(+), 4 deletions(-) create mode 100644 drivers/soc/fsl/Kconfig create mode 100644 drivers/soc/fsl/Kconfig.arm create mode 100644 drivers/soc/fsl/layerscape/Kconfig @@ -407,16 +407,18 @@ Signed-off-by: Yangbo Lu source "drivers/staging/wilc1000/Kconfig" source "drivers/staging/most/Kconfig" -@@ -106,4 +108,6 @@ source "drivers/staging/greybus/Kconfig" +@@ -106,4 +108,8 @@ source "drivers/staging/greybus/Kconfig" source "drivers/staging/vc04_services/Kconfig" +source "drivers/staging/fsl_qbman/Kconfig" ++ ++source "drivers/staging/fsl_ppfe/Kconfig" + endif # STAGING --- a/drivers/staging/Makefile +++ b/drivers/staging/Makefile -@@ -36,9 +36,11 @@ obj-$(CONFIG_UNISYSSPAR) += unisys/ +@@ -36,9 +36,12 @@ obj-$(CONFIG_UNISYSSPAR) += unisys/ obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) += clocking-wizard/ obj-$(CONFIG_FB_TFT) += fbtft/ obj-$(CONFIG_FSL_MC_BUS) += fsl-mc/ @@ -428,6 +430,7 @@ Signed-off-by: Yangbo Lu obj-$(CONFIG_GREYBUS) += greybus/ obj-$(CONFIG_BCM2708_VCHIQ) += vc04_services/ +obj-$(CONFIG_FSL_SDK_DPA) += fsl_qbman/ ++obj-$(CONFIG_FSL_PPFE) += fsl_ppfe/ --- /dev/null +++ b/drivers/staging/fsl-dpaa2/Kconfig @@ -0,0 +1,41 @@ diff --git a/target/linux/layerscape/patches-4.9/202-core-linux-support-layerscape.patch b/target/linux/layerscape/patches-4.9/202-core-linux-support-layerscape.patch new file mode 100644 index 0000000000..51408253c0 --- /dev/null +++ b/target/linux/layerscape/patches-4.9/202-core-linux-support-layerscape.patch @@ -0,0 +1,508 @@ +From c37953457a7ebeb0d97ae8574b3d41274fcd9119 Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Wed, 1 Nov 2017 16:22:33 +0800 +Subject: [PATCH] core-linux: support layerscape + +This is a integrated patch for layerscape core-linux support. + +Signed-off-by: Madalin Bucur +Signed-off-by: Zhao Qiang +Signed-off-by: Camelia Groza +Signed-off-by: Madalin Bucur +Signed-off-by: Zhang Ying-22455 +Signed-off-by: Ramneek Mehresh +Signed-off-by: Jarod Wilson +Signed-off-by: Nikhil Badola +Signed-off-by: stephen hemminger +Signed-off-by: Arnd Bergmann +Signed-off-by: Yangbo Lu +--- + drivers/base/devres.c | 66 ++++++++++++++++++++++++++++ + drivers/base/soc.c | 66 ++++++++++++++++++++++++++++ + include/linux/device.h | 19 ++++++++ + include/linux/fsl/svr.h | 97 +++++++++++++++++++++++++++++++++++++++++ + include/linux/fsl_devices.h | 3 ++ + include/linux/netdev_features.h | 2 + + include/linux/netdevice.h | 4 ++ + include/linux/skbuff.h | 2 + + include/linux/sys_soc.h | 3 ++ + include/uapi/linux/if_ether.h | 1 + + net/core/dev.c | 13 +++++- + net/core/skbuff.c | 29 +++++++++++- + net/sched/sch_generic.c | 7 +++ + 13 files changed, 309 insertions(+), 3 deletions(-) + create mode 100644 include/linux/fsl/svr.h + +--- a/drivers/base/devres.c ++++ b/drivers/base/devres.c +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + #include "base.h" + +@@ -985,3 +986,68 @@ void devm_free_pages(struct device *dev, + &devres)); + } + EXPORT_SYMBOL_GPL(devm_free_pages); ++ ++static void devm_percpu_release(struct device *dev, void *pdata) ++{ ++ void __percpu *p; ++ ++ p = *(void __percpu **)pdata; ++ free_percpu(p); ++} ++ ++static int devm_percpu_match(struct device *dev, void *data, void *p) ++{ ++ struct devres *devr = container_of(data, struct devres, data); ++ ++ return *(void **)devr->data == p; ++} ++ ++/** ++ * __devm_alloc_percpu - Resource-managed alloc_percpu ++ * @dev: Device to allocate per-cpu memory for ++ * @size: Size of per-cpu memory to allocate ++ * @align: Alignment of per-cpu memory to allocate ++ * ++ * Managed alloc_percpu. Per-cpu memory allocated with this function is ++ * automatically freed on driver detach. ++ * ++ * RETURNS: ++ * Pointer to allocated memory on success, NULL on failure. ++ */ ++void __percpu *__devm_alloc_percpu(struct device *dev, size_t size, ++ size_t align) ++{ ++ void *p; ++ void __percpu *pcpu; ++ ++ pcpu = __alloc_percpu(size, align); ++ if (!pcpu) ++ return NULL; ++ ++ p = devres_alloc(devm_percpu_release, sizeof(void *), GFP_KERNEL); ++ if (!p) { ++ free_percpu(pcpu); ++ return NULL; ++ } ++ ++ *(void __percpu **)p = pcpu; ++ ++ devres_add(dev, p); ++ ++ return pcpu; ++} ++EXPORT_SYMBOL_GPL(__devm_alloc_percpu); ++ ++/** ++ * devm_free_percpu - Resource-managed free_percpu ++ * @dev: Device this memory belongs to ++ * @pdata: Per-cpu memory to free ++ * ++ * Free memory allocated with devm_alloc_percpu(). ++ */ ++void devm_free_percpu(struct device *dev, void __percpu *pdata) ++{ ++ WARN_ON(devres_destroy(dev, devm_percpu_release, devm_percpu_match, ++ (void *)pdata)); ++} ++EXPORT_SYMBOL_GPL(devm_free_percpu); +--- a/drivers/base/soc.c ++++ b/drivers/base/soc.c +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + + static DEFINE_IDA(soc_ida); + +@@ -159,3 +160,68 @@ static int __init soc_bus_register(void) + return bus_register(&soc_bus_type); + } + core_initcall(soc_bus_register); ++ ++static int soc_device_match_one(struct device *dev, void *arg) ++{ ++ struct soc_device *soc_dev = container_of(dev, struct soc_device, dev); ++ const struct soc_device_attribute *match = arg; ++ ++ if (match->machine && ++ !glob_match(match->machine, soc_dev->attr->machine)) ++ return 0; ++ ++ if (match->family && ++ !glob_match(match->family, soc_dev->attr->family)) ++ return 0; ++ ++ if (match->revision && ++ !glob_match(match->revision, soc_dev->attr->revision)) ++ return 0; ++ ++ if (match->soc_id && ++ !glob_match(match->soc_id, soc_dev->attr->soc_id)) ++ return 0; ++ ++ return 1; ++} ++ ++/* ++ * soc_device_match - identify the SoC in the machine ++ * @matches: zero-terminated array of possible matches ++ * ++ * returns the first matching entry of the argument array, or NULL ++ * if none of them match. ++ * ++ * This function is meant as a helper in place of of_match_node() ++ * in cases where either no device tree is available or the information ++ * in a device node is insufficient to identify a particular variant ++ * by its compatible strings or other properties. For new devices, ++ * the DT binding should always provide unique compatible strings ++ * that allow the use of of_match_node() instead. ++ * ++ * The calling function can use the .data entry of the ++ * soc_device_attribute to pass a structure or function pointer for ++ * each entry. ++ */ ++const struct soc_device_attribute *soc_device_match( ++ const struct soc_device_attribute *matches) ++{ ++ int ret = 0; ++ ++ if (!matches) ++ return NULL; ++ ++ while (!ret) { ++ if (!(matches->machine || matches->family || ++ matches->revision || matches->soc_id)) ++ break; ++ ret = bus_for_each_dev(&soc_bus_type, NULL, (void *)matches, ++ soc_device_match_one); ++ if (!ret) ++ matches++; ++ else ++ return matches; ++ } ++ return NULL; ++} ++EXPORT_SYMBOL_GPL(soc_device_match); +--- a/include/linux/device.h ++++ b/include/linux/device.h +@@ -688,6 +688,25 @@ void __iomem *devm_ioremap_resource(stru + int devm_add_action(struct device *dev, void (*action)(void *), void *data); + void devm_remove_action(struct device *dev, void (*action)(void *), void *data); + ++/** ++ * devm_alloc_percpu - Resource-managed alloc_percpu ++ * @dev: Device to allocate per-cpu memory for ++ * @type: Type to allocate per-cpu memory for ++ * ++ * Managed alloc_percpu. Per-cpu memory allocated with this function is ++ * automatically freed on driver detach. ++ * ++ * RETURNS: ++ * Pointer to allocated memory on success, NULL on failure. ++ */ ++#define devm_alloc_percpu(dev, type) \ ++ ((typeof(type) __percpu *)__devm_alloc_percpu((dev), sizeof(type), \ ++ __alignof__(type))) ++ ++void __percpu *__devm_alloc_percpu(struct device *dev, size_t size, ++ size_t align); ++void devm_free_percpu(struct device *dev, void __percpu *pdata); ++ + static inline int devm_add_action_or_reset(struct device *dev, + void (*action)(void *), void *data) + { +--- /dev/null ++++ b/include/linux/fsl/svr.h +@@ -0,0 +1,97 @@ ++/* ++ * MPC85xx cpu type detection ++ * ++ * Copyright 2011-2012 Freescale Semiconductor, Inc. ++ * ++ * This is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ */ ++ ++#ifndef FSL_SVR_H ++#define FSL_SVR_H ++ ++#define SVR_REV(svr) ((svr) & 0xFF) /* SOC design resision */ ++#define SVR_MAJ(svr) (((svr) >> 4) & 0xF) /* Major revision field*/ ++#define SVR_MIN(svr) (((svr) >> 0) & 0xF) /* Minor revision field*/ ++ ++/* Some parts define SVR[0:23] as the SOC version */ ++#define SVR_SOC_VER(svr) (((svr) >> 8) & 0xFFF7FF) /* SOC Version fields */ ++ ++#define SVR_8533 0x803400 ++#define SVR_8535 0x803701 ++#define SVR_8536 0x803700 ++#define SVR_8540 0x803000 ++#define SVR_8541 0x807200 ++#define SVR_8543 0x803200 ++#define SVR_8544 0x803401 ++#define SVR_8545 0x803102 ++#define SVR_8547 0x803101 ++#define SVR_8548 0x803100 ++#define SVR_8555 0x807100 ++#define SVR_8560 0x807000 ++#define SVR_8567 0x807501 ++#define SVR_8568 0x807500 ++#define SVR_8569 0x808000 ++#define SVR_8572 0x80E000 ++#define SVR_P1010 0x80F100 ++#define SVR_P1011 0x80E500 ++#define SVR_P1012 0x80E501 ++#define SVR_P1013 0x80E700 ++#define SVR_P1014 0x80F101 ++#define SVR_P1017 0x80F700 ++#define SVR_P1020 0x80E400 ++#define SVR_P1021 0x80E401 ++#define SVR_P1022 0x80E600 ++#define SVR_P1023 0x80F600 ++#define SVR_P1024 0x80E402 ++#define SVR_P1025 0x80E403 ++#define SVR_P2010 0x80E300 ++#define SVR_P2020 0x80E200 ++#define SVR_P2040 0x821000 ++#define SVR_P2041 0x821001 ++#define SVR_P3041 0x821103 ++#define SVR_P4040 0x820100 ++#define SVR_P4080 0x820000 ++#define SVR_P5010 0x822100 ++#define SVR_P5020 0x822000 ++#define SVR_P5021 0X820500 ++#define SVR_P5040 0x820400 ++#define SVR_T4240 0x824000 ++#define SVR_T4120 0x824001 ++#define SVR_T4160 0x824100 ++#define SVR_T4080 0x824102 ++#define SVR_C291 0x850000 ++#define SVR_C292 0x850020 ++#define SVR_C293 0x850030 ++#define SVR_B4860 0X868000 ++#define SVR_G4860 0x868001 ++#define SVR_G4060 0x868003 ++#define SVR_B4440 0x868100 ++#define SVR_G4440 0x868101 ++#define SVR_B4420 0x868102 ++#define SVR_B4220 0x868103 ++#define SVR_T1040 0x852000 ++#define SVR_T1041 0x852001 ++#define SVR_T1042 0x852002 ++#define SVR_T1020 0x852100 ++#define SVR_T1021 0x852101 ++#define SVR_T1022 0x852102 ++#define SVR_T1023 0x854100 ++#define SVR_T1024 0x854000 ++#define SVR_T2080 0x853000 ++#define SVR_T2081 0x853100 ++ ++#define SVR_8610 0x80A000 ++#define SVR_8641 0x809000 ++#define SVR_8641D 0x809001 ++ ++#define SVR_9130 0x860001 ++#define SVR_9131 0x860000 ++#define SVR_9132 0x861000 ++#define SVR_9232 0x861400 ++ ++#define SVR_Unknown 0xFFFFFF ++ ++#endif +--- a/include/linux/fsl_devices.h ++++ b/include/linux/fsl_devices.h +@@ -99,7 +99,10 @@ struct fsl_usb2_platform_data { + unsigned suspended:1; + unsigned already_suspended:1; + unsigned has_fsl_erratum_a007792:1; ++ unsigned has_fsl_erratum_14:1; + unsigned has_fsl_erratum_a005275:1; ++ unsigned has_fsl_erratum_a006918:1; ++ unsigned has_fsl_erratum_a005697:1; + unsigned check_phy_clk_valid:1; + + /* register save area for suspend/resume */ +--- a/include/linux/netdev_features.h ++++ b/include/linux/netdev_features.h +@@ -74,6 +74,7 @@ enum { + NETIF_F_BUSY_POLL_BIT, /* Busy poll */ + + NETIF_F_HW_TC_BIT, /* Offload TC infrastructure */ ++ NETIF_F_HW_ACCEL_MQ_BIT, /* Hardware-accelerated multiqueue */ + + /* + * Add your fresh new feature above and remember to update +@@ -136,6 +137,7 @@ enum { + #define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD) + #define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL) + #define NETIF_F_HW_TC __NETIF_F(HW_TC) ++#define NETIF_F_HW_ACCEL_MQ __NETIF_F(HW_ACCEL_MQ) + + #define for_each_netdev_feature(mask_addr, bit) \ + for_each_set_bit(bit, (unsigned long *)mask_addr, NETDEV_FEATURE_COUNT) +--- a/include/linux/netdevice.h ++++ b/include/linux/netdevice.h +@@ -1509,6 +1509,8 @@ enum netdev_priv_flags { + * @if_port: Selectable AUI, TP, ... + * @dma: DMA channel + * @mtu: Interface MTU value ++ * @min_mtu: Interface Minimum MTU value ++ * @max_mtu: Interface Maximum MTU value + * @type: Interface hardware type + * @hard_header_len: Maximum hardware header length. + * @min_header_len: Minimum hardware header length +@@ -1735,6 +1737,8 @@ struct net_device { + unsigned char dma; + + unsigned int mtu; ++ unsigned int min_mtu; ++ unsigned int max_mtu; + unsigned short type; + unsigned short hard_header_len; + unsigned short min_header_len; +--- a/include/linux/skbuff.h ++++ b/include/linux/skbuff.h +@@ -903,6 +903,7 @@ void kfree_skb(struct sk_buff *skb); + void kfree_skb_list(struct sk_buff *segs); + void skb_tx_error(struct sk_buff *skb); + void consume_skb(struct sk_buff *skb); ++void skb_recycle(struct sk_buff *skb); + void __kfree_skb(struct sk_buff *skb); + extern struct kmem_cache *skbuff_head_cache; + +@@ -3057,6 +3058,7 @@ static inline void skb_free_datagram_loc + } + int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags); + int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len); ++void copy_skb_header(struct sk_buff *new, const struct sk_buff *old); + int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len); + __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, u8 *to, + int len, __wsum csum); +--- a/include/linux/sys_soc.h ++++ b/include/linux/sys_soc.h +@@ -13,6 +13,7 @@ struct soc_device_attribute { + const char *family; + const char *revision; + const char *soc_id; ++ const void *data; + }; + + /** +@@ -34,4 +35,6 @@ void soc_device_unregister(struct soc_de + */ + struct device *soc_device_to_device(struct soc_device *soc); + ++const struct soc_device_attribute *soc_device_match( ++ const struct soc_device_attribute *matches); + #endif /* __SOC_BUS_H */ +--- a/include/uapi/linux/if_ether.h ++++ b/include/uapi/linux/if_ether.h +@@ -35,6 +35,7 @@ + #define ETH_DATA_LEN 1500 /* Max. octets in payload */ + #define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */ + #define ETH_FCS_LEN 4 /* Octets in the FCS */ ++#define ETH_MIN_MTU 68 /* Min IPv4 MTU per RFC791 */ + + /* + * These are the defined Ethernet Protocol ID's. +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -6604,9 +6604,18 @@ int dev_set_mtu(struct net_device *dev, + if (new_mtu == dev->mtu) + return 0; + +- /* MTU must be positive. */ +- if (new_mtu < 0) ++ /* MTU must be positive, and in range */ ++ if (new_mtu < 0 || new_mtu < dev->min_mtu) { ++ net_err_ratelimited("%s: Invalid MTU %d requested, hw min %d\n", ++ dev->name, new_mtu, dev->min_mtu); + return -EINVAL; ++ } ++ ++ if (dev->max_mtu > 0 && new_mtu > dev->max_mtu) { ++ net_err_ratelimited("%s: Invalid MTU %d requested, hw max %d\n", ++ dev->name, new_mtu, dev->min_mtu); ++ return -EINVAL; ++ } + + if (!netif_device_present(dev)) + return -ENODEV; +--- a/net/core/skbuff.c ++++ b/net/core/skbuff.c +@@ -842,6 +842,32 @@ void napi_consume_skb(struct sk_buff *sk + } + EXPORT_SYMBOL(napi_consume_skb); + ++/** ++ * skb_recycle - clean up an skb for reuse ++ * @skb: buffer ++ * ++ * Recycles the skb to be reused as a receive buffer. This ++ * function does any necessary reference count dropping, and ++ * cleans up the skbuff as if it just came from __alloc_skb(). ++ */ ++void skb_recycle(struct sk_buff *skb) ++{ ++ struct skb_shared_info *shinfo; ++ u8 head_frag = skb->head_frag; ++ ++ skb_release_head_state(skb); ++ ++ shinfo = skb_shinfo(skb); ++ memset(shinfo, 0, offsetof(struct skb_shared_info, dataref)); ++ atomic_set(&shinfo->dataref, 1); ++ ++ memset(skb, 0, offsetof(struct sk_buff, tail)); ++ skb->data = skb->head + NET_SKB_PAD; ++ skb->head_frag = head_frag; ++ skb_reset_tail_pointer(skb); ++} ++EXPORT_SYMBOL(skb_recycle); ++ + /* Make sure a field is enclosed inside headers_start/headers_end section */ + #define CHECK_SKB_FIELD(field) \ + BUILD_BUG_ON(offsetof(struct sk_buff, field) < \ +@@ -1073,7 +1099,7 @@ static void skb_headers_offset_update(st + skb->inner_mac_header += off; + } + +-static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old) ++void copy_skb_header(struct sk_buff *new, const struct sk_buff *old) + { + __copy_skb_header(new, old); + +@@ -1081,6 +1107,7 @@ static void copy_skb_header(struct sk_bu + skb_shinfo(new)->gso_segs = skb_shinfo(old)->gso_segs; + skb_shinfo(new)->gso_type = skb_shinfo(old)->gso_type; + } ++EXPORT_SYMBOL(copy_skb_header); + + static inline int skb_alloc_rx_flag(const struct sk_buff *skb) + { +--- a/net/sched/sch_generic.c ++++ b/net/sched/sch_generic.c +@@ -309,6 +309,13 @@ static void dev_watchdog(unsigned long a + txq->trans_timeout++; + break; + } ++ ++ /* Devices with HW_ACCEL_MQ have multiple txqs ++ * but update only the first one's transmission ++ * timestamp so avoid checking the rest. ++ */ ++ if (dev->features & NETIF_F_HW_ACCEL_MQ) ++ break; + } + + if (some_queue_timedout) { diff --git a/target/linux/layerscape/patches-4.9/301-arch-support-layerscape.patch b/target/linux/layerscape/patches-4.9/301-arch-support-layerscape.patch index 3a2e9c64bc..135333e472 100644 --- a/target/linux/layerscape/patches-4.9/301-arch-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/301-arch-support-layerscape.patch @@ -1,4 +1,4 @@ -From 7edaf7ed8fbd5fb50950a4fc8067a9c14557d010 Mon Sep 17 00:00:00 2001 +From 739029f49bd9181b821298f9d27b29ce2d292967 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 25 Sep 2017 10:03:52 +0800 Subject: [PATCH] arch: support layerscape @@ -34,8 +34,8 @@ Signed-off-by: Yangbo Lu arch/arm64/include/asm/pgtable-prot.h | 1 + arch/arm64/include/asm/pgtable.h | 5 +++ arch/arm64/kernel/pci.c | 62 +++++++++++++++++++++++++++++++++++ - arch/arm64/mm/dma-mapping.c | 6 ++++ - 15 files changed, 197 insertions(+), 3 deletions(-) + arch/arm64/mm/dma-mapping.c | 23 ++++++++++--- + 15 files changed, 209 insertions(+), 8 deletions(-) --- a/arch/arm/include/asm/delay.h +++ b/arch/arm/include/asm/delay.h @@ -207,7 +207,7 @@ Signed-off-by: Yangbo Lu * Note that the arbiter/ISA bridge appears to be buggy, specifically in --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c -@@ -2392,6 +2392,7 @@ void arch_setup_dma_ops(struct device *d +@@ -2410,6 +2410,7 @@ void arch_setup_dma_ops(struct device *d set_dma_ops(dev, dma_ops); } @@ -310,7 +310,7 @@ Signed-off-by: Yangbo Lu #define PROT_SECT_NORMAL (PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PMD_ATTRINDX(MT_NORMAL)) --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h -@@ -356,6 +356,11 @@ static inline int pmd_protnone(pmd_t pmd +@@ -370,6 +370,11 @@ static inline int pmd_protnone(pmd_t pmd __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRnE) | PTE_PXN | PTE_UXN) #define pgprot_writecombine(prot) \ __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC) | PTE_PXN | PTE_UXN) @@ -410,7 +410,7 @@ Signed-off-by: Yangbo Lu static int swiotlb __ro_after_init; -@@ -918,6 +919,10 @@ static int __init __iommu_dma_init(void) +@@ -925,6 +926,10 @@ static int __init __iommu_dma_init(void) if (!ret) ret = register_iommu_dma_ops_notifier(&pci_bus_type); #endif @@ -421,7 +421,7 @@ Signed-off-by: Yangbo Lu return ret; } arch_initcall(__iommu_dma_init); -@@ -971,3 +976,4 @@ void arch_setup_dma_ops(struct device *d +@@ -978,3 +983,4 @@ void arch_setup_dma_ops(struct device *d dev->archdata.dma_coherent = coherent; __iommu_setup_dma_ops(dev, dma_base, size, iommu); } diff --git a/target/linux/layerscape/patches-4.9/302-dts-support-layercape.patch b/target/linux/layerscape/patches-4.9/302-dts-support-layercape.patch index a7a3a48e61..7dae7d6aca 100644 --- a/target/linux/layerscape/patches-4.9/302-dts-support-layercape.patch +++ b/target/linux/layerscape/patches-4.9/302-dts-support-layercape.patch @@ -1,4 +1,4 @@ -From 2b2e3b9a0d2abf276b40843f75d97b623e4ee109 Mon Sep 17 00:00:00 2001 +From bfa4a794f91162cfeccfa4d59121cde9a84e32a3 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 25 Sep 2017 10:02:10 +0800 Subject: [PATCH] dts: support layercape @@ -45,10 +45,10 @@ Signed-off-by: Yangbo Lu arch/arm/boot/dts/sun8i-a23-a33.dtsi | 2 +- arch/arm/boot/dts/sun9i-a80.dtsi | 2 +- arch/arm64/boot/dts/freescale/Makefile | 16 + - arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts | 134 +++ - arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts | 155 ++++ - arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts | 91 +++ - arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi | 517 ++++++++++++ + arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts | 177 ++++ + arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts | 198 +++++ + arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts | 134 +++ + arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi | 594 ++++++++++++++ arch/arm64/boot/dts/freescale/fsl-ls1043-post.dtsi | 45 + .../boot/dts/freescale/fsl-ls1043a-qds-sdk.dts | 69 ++ arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts | 171 +++- @@ -65,7 +65,7 @@ Signed-off-by: Yangbo Lu arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi | 793 ++++++++++++++++++ arch/arm64/boot/dts/freescale/fsl-ls1088a-qds.dts | 173 ++++ arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts | 236 ++++++ - arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 816 ++++++++++++++++++ + arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 818 ++++++++++++++++++ arch/arm64/boot/dts/freescale/fsl-ls2080a-qds.dts | 191 ++--- arch/arm64/boot/dts/freescale/fsl-ls2080a-rdb.dts | 169 ++-- arch/arm64/boot/dts/freescale/fsl-ls2080a-simu.dts | 9 +- @@ -76,7 +76,7 @@ Signed-off-by: Yangbo Lu arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi | 195 +++++ arch/arm64/boot/dts/freescale/fsl-ls208xa-qds.dtsi | 198 +++++ arch/arm64/boot/dts/freescale/fsl-ls208xa-rdb.dtsi | 161 ++++ - arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi | 910 +++++++++++++++++++++ + arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi | 912 +++++++++++++++++++++ .../boot/dts/freescale/qoriq-bman1-portals.dtsi | 81 ++ arch/arm64/boot/dts/freescale/qoriq-dpaa-eth.dtsi | 66 ++ .../boot/dts/freescale/qoriq-fman3-0-10g-0.dtsi | 43 + @@ -93,7 +93,7 @@ Signed-off-by: Yangbo Lu arch/powerpc/boot/dts/fsl/qoriq-bman1-portals.dtsi | 10 + arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi | 4 +- arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi | 4 +- - 66 files changed, 7778 insertions(+), 1021 deletions(-) + 66 files changed, 7988 insertions(+), 1021 deletions(-) create mode 100644 arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts create mode 100644 arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts create mode 100644 arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts @@ -484,7 +484,7 @@ Signed-off-by: Yangbo Lu }; + ftm0: ftm0@29d0000 { -+ compatible = "fsl,ftm-alarm"; ++ compatible = "fsl,ls1021a-ftm"; + reg = <0x0 0x29d0000 0x0 0x10000>, + <0x0 0x1ee2140 0x0 0x4>; + reg-names = "ftm", "FlexTimer1"; @@ -740,7 +740,7 @@ Signed-off-by: Yangbo Lu subdir-y := $(dts-dirs) --- /dev/null +++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts -@@ -0,0 +1,134 @@ +@@ -0,0 +1,177 @@ +/* + * Device Tree file for Freescale LS1012A Freedom Board. + * @@ -792,6 +792,11 @@ Signed-off-by: Yangbo Lu + model = "LS1012A Freedom Board"; + compatible = "fsl,ls1012a-frdm", "fsl,ls1012a"; + ++ aliases { ++ ethernet0 = &pfe_mac0; ++ ethernet1 = &pfe_mac1; ++ }; ++ + sys_mclk: clock-mclk { + compatible = "fixed-clock"; + #clock-cells = <0>; @@ -868,6 +873,44 @@ Signed-off-by: Yangbo Lu + }; +}; + ++&pfe { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ ethernet@0 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x0>; /* GEM_ID */ ++ fsl,gemac-bus-id = <0x0>; /* BUS_ID */ ++ fsl,gemac-phy-id = <0x2>; /* PHY_ID */ ++ fsl,mdio-mux-val = <0x0>; ++ phy-mode = "sgmii"; ++ fsl,pfe-phy-if-flags = <0x0>; ++ ++ mdio@0 { ++ reg = <0x1>; /* enabled/disabled */ ++ }; ++ }; ++ ++ ethernet@1 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x1>; /* GEM_ID */ ++ fsl,gemac-bus-id = <0x1>; /* BUS_ID */ ++ fsl,gemac-phy-id = <0x1>; /* PHY_ID */ ++ fsl,mdio-mux-val = <0x0>; ++ phy-mode = "sgmii"; ++ fsl,pfe-phy-if-flags = <0x0>; ++ ++ mdio@0 { ++ reg = <0x0>; /* enabled/disabled */ ++ }; ++ }; ++}; ++ +&sai2 { + status = "okay"; +}; @@ -877,7 +920,7 @@ Signed-off-by: Yangbo Lu +}; --- /dev/null +++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts -@@ -0,0 +1,155 @@ +@@ -0,0 +1,198 @@ +/* + * Device Tree file for Freescale LS1012A QDS Board. + * @@ -929,6 +972,11 @@ Signed-off-by: Yangbo Lu + model = "LS1012A QDS Board"; + compatible = "fsl,ls1012a-qds", "fsl,ls1012a"; + ++ aliases { ++ ethernet0 = &pfe_mac0; ++ ethernet1 = &pfe_mac1; ++ }; ++ + sys_mclk: clock-mclk { + compatible = "fixed-clock"; + #clock-cells = <0>; @@ -1018,6 +1066,44 @@ Signed-off-by: Yangbo Lu + }; +}; + ++&pfe { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ ethernet@0 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x0>; /* GEM_ID */ ++ fsl,gemac-bus-id = <0x0>; /* BUS_ID */ ++ fsl,gemac-phy-id = <0x1>; /* PHY_ID */ ++ fsl,mdio-mux-val = <0x2>; ++ phy-mode = "sgmii-2500"; ++ fsl,pfe-phy-if-flags = <0x0>; ++ ++ mdio@0 { ++ reg = <0x1>; /* enabled/disabled */ ++ }; ++ }; ++ ++ ethernet@1 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x1>; /* GEM_ID */ ++ fsl,gemac-bus-id = <0x1>; /* BUS_ID */ ++ fsl,gemac-phy-id = <0x2>; /* PHY_ID */ ++ fsl,mdio-mux-val = <0x3>; ++ phy-mode = "sgmii-2500"; ++ fsl,pfe-phy-if-flags = <0x0>; ++ ++ mdio@0 { ++ reg = <0x0>; /* enabled/disabled */ ++ }; ++ }; ++}; ++ +&sai2 { + status = "okay"; +}; @@ -1035,7 +1121,7 @@ Signed-off-by: Yangbo Lu +}; --- /dev/null +++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts -@@ -0,0 +1,91 @@ +@@ -0,0 +1,134 @@ +/* + * Device Tree file for Freescale LS1012A RDB Board. + * @@ -1086,6 +1172,11 @@ Signed-off-by: Yangbo Lu +/ { + model = "LS1012A RDB Board"; + compatible = "fsl,ls1012a-rdb", "fsl,ls1012a"; ++ ++ aliases { ++ ethernet0 = &pfe_mac0; ++ ethernet1 = &pfe_mac1; ++ }; +}; + +&duart0 { @@ -1127,9 +1218,47 @@ Signed-off-by: Yangbo Lu + mmc-hs200-1_8v; + status = "okay"; +}; ++ ++&pfe { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ ethernet@0 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x0>; /* GEM_ID */ ++ fsl,gemac-bus-id = <0x0>; /* BUS_ID */ ++ fsl,gemac-phy-id = <0x2>; /* PHY_ID */ ++ fsl,mdio-mux-val = <0x0>; ++ phy-mode = "sgmii"; ++ fsl,pfe-phy-if-flags = <0x0>; ++ ++ mdio@0 { ++ reg = <0x1>; /* enabled/disabled */ ++ }; ++ }; ++ ++ ethernet@1 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x1>; /* GEM_ID */ ++ fsl,gemac-bus-id = < 0x1 >; /* BUS_ID */ ++ fsl,gemac-phy-id = < 0x1 >; /* PHY_ID */ ++ fsl,mdio-mux-val = <0x0>; ++ phy-mode = "rgmii-txid"; ++ fsl,pfe-phy-if-flags = <0x0>; ++ ++ mdio@0 { ++ reg = <0x0>; /* enabled/disabled */ ++ }; ++ }; ++}; --- /dev/null +++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi -@@ -0,0 +1,517 @@ +@@ -0,0 +1,594 @@ +/* + * Device Tree Include file for Freescale Layerscape-1012A family SoC. + * @@ -1322,6 +1451,12 @@ Signed-off-by: Yangbo Lu + interrupts = ; + }; + ++ caam-dma { ++ compatible = "fsl,sec-v5.4-dma", ++ "fsl,sec-v5.0-dma", ++ "fsl,sec-v4.0-dma"; ++ }; ++ + rtic@60000 { + compatible = "fsl,sec-v5.4-rtic", + "fsl,sec-v5.0-rtic", @@ -1485,8 +1620,14 @@ Signed-off-by: Yangbo Lu + status = "disabled"; + }; + ++ rcpm: rcpm@1ee2000 { ++ compatible = "fsl,ls1012a-rcpm", "fsl,qoriq-rcpm-2.1"; ++ reg = <0x0 0x1ee2000 0x0 0x1000>; ++ fsl,#rcpm-wakeup-cells = <1>; ++ }; ++ + ftm0: ftm0@29d0000 { -+ compatible = "fsl,ftm-alarm"; ++ compatible = "fsl,ls1012a-ftm"; + reg = <0x0 0x29d0000 0x0 0x10000>, + <0x0 0x1ee2140 0x0 0x4>; + reg-names = "ftm", "FlexTimer1"; @@ -1645,6 +1786,71 @@ Signed-off-by: Yangbo Lu + dma-coherent; + status = "disabled"; + }; ++ ++ msi: msi-controller1@1572000 { ++ compatible = "fsl,ls1012a-msi"; ++ reg = <0x0 0x1572000 0x0 0x8>; ++ msi-controller; ++ interrupts = <0 126 IRQ_TYPE_LEVEL_HIGH>; ++ }; ++ ++ pcie@3400000 { ++ compatible = "fsl,ls1012a-pcie", "snps,dw-pcie"; ++ reg = <0x00 0x03400000 0x0 0x00100000 /* controller registers */ ++ 0x40 0x00000000 0x0 0x00002000>; /* configuration space */ ++ reg-names = "regs", "config"; ++ interrupts = <0 118 0x4>, /* AER interrupt */ ++ <0 117 0x4>; /* PME interrupt */ ++ interrupt-names = "aer", "pme"; ++ #address-cells = <3>; ++ #size-cells = <2>; ++ device_type = "pci"; ++ num-lanes = <4>; ++ bus-range = <0x0 0xff>; ++ ranges = <0x81000000 0x0 0x00000000 0x40 0x00010000 0x0 0x00010000 /* downstream I/O */ ++ 0x82000000 0x0 0x40000000 0x40 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */ ++ msi-parent = <&msi>; ++ #interrupt-cells = <1>; ++ interrupt-map-mask = <0 0 0 7>; ++ interrupt-map = <0000 0 0 1 &gic 0 110 IRQ_TYPE_LEVEL_HIGH>, ++ <0000 0 0 2 &gic 0 111 IRQ_TYPE_LEVEL_HIGH>, ++ <0000 0 0 3 &gic 0 112 IRQ_TYPE_LEVEL_HIGH>, ++ <0000 0 0 4 &gic 0 113 IRQ_TYPE_LEVEL_HIGH>; ++ }; ++ }; ++ ++ reserved-memory { ++ #address-cells = <2>; ++ #size-cells = <2>; ++ ranges; ++ ++ pfe_reserved: packetbuffer@83400000 { ++ reg = <0 0x83400000 0 0xc00000>; ++ }; ++ }; ++ ++ pfe: pfe@04000000 { ++ compatible = "fsl,pfe"; ++ reg = <0x0 0x04000000 0x0 0xc00000>, /* AXI 16M */ ++ <0x0 0x83400000 0x0 0xc00000>; /* PFE DDR 12M */ ++ reg-names = "pfe", "pfe-ddr"; ++ fsl,pfe-num-interfaces = <0x2>; ++ interrupts = <0 172 0x4>, /* HIF interrupt */ ++ <0 173 0x4>, /*HIF_NOCPY interrupt */ ++ <0 174 0x4>; /* WoL interrupt */ ++ interrupt-names = "pfe_hif", "pfe_hif_nocpy", "pfe_wol"; ++ memory-region = <&pfe_reserved>; ++ fsl,pfe-scfg = <&scfg 0>; ++ fsl,rcpm-wakeup = <&rcpm 0xf0000020>; ++ clocks = <&clockgen 4 0>; ++ clock-names = "pfe"; ++ ++ status = "okay"; ++ pfe_mac0: ethernet@0 { ++ }; ++ ++ pfe_mac1: ethernet@1 { ++ }; + }; +}; --- /dev/null @@ -2646,7 +2852,7 @@ Signed-off-by: Yangbo Lu }; + ftm0: ftm0@29d0000 { -+ compatible = "fsl,ftm-alarm"; ++ compatible = "fsl,ls1043a-ftm"; + reg = <0x0 0x29d0000 0x0 0x10000>, + <0x0 0x1ee2140 0x0 0x4>; + reg-names = "ftm", "FlexTimer1"; @@ -4326,7 +4532,7 @@ Signed-off-by: Yangbo Lu + }; + + ftm0: ftm0@29d0000 { -+ compatible = "fsl,ftm-alarm"; ++ compatible = "fsl,ls1046a-ftm"; + reg = <0x0 0x29d0000 0x0 0x10000>, + <0x0 0x1ee2140 0x0 0x4>; + reg-names = "ftm", "FlexTimer1"; @@ -4962,7 +5168,7 @@ Signed-off-by: Yangbo Lu +}; --- /dev/null +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi -@@ -0,0 +1,816 @@ +@@ -0,0 +1,818 @@ +/* + * Device Tree Include file for NXP Layerscape-1088A family SoC. + * @@ -5475,9 +5681,11 @@ Signed-off-by: Yangbo Lu + }; + + ftm0: ftm0@2800000 { -+ compatible = "fsl,ftm-alarm"; -+ reg = <0x0 0x2800000 0x0 0x10000>; ++ compatible = "fsl,ls1088a-ftm"; ++ reg = <0x0 0x2800000 0x0 0x10000>, ++ <0x0 0x1e34050 0x0 0x4>; + interrupts = <0 44 4>; ++ reg-names = "ftm", "FlexTimer1"; + }; + + i2c0: i2c@2000000 { @@ -8124,7 +8332,7 @@ Signed-off-by: Yangbo Lu +}; --- /dev/null +++ b/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi -@@ -0,0 +1,910 @@ +@@ -0,0 +1,912 @@ +/* + * Device Tree Include file for Freescale Layerscape-2080A family SoC. + * @@ -9015,9 +9223,11 @@ Signed-off-by: Yangbo Lu + }; + + ftm0: ftm0@2800000 { -+ compatible = "fsl,ftm-alarm"; -+ reg = <0x0 0x2800000 0x0 0x10000>; ++ compatible = "fsl,ls208xa-ftm"; ++ reg = <0x0 0x2800000 0x0 0x10000>, ++ <0x0 0x1e34050 0x0 0x4>; + interrupts = <0 44 4>; ++ reg-names = "ftm", "FlexTimer1"; + }; + }; + diff --git a/target/linux/layerscape/patches-4.9/303-arm-imx-select-ARCH_DMA_ADDR_T_64BIT-for-LPAE.patch b/target/linux/layerscape/patches-4.9/303-arm-imx-select-ARCH_DMA_ADDR_T_64BIT-for-LPAE.patch new file mode 100644 index 0000000000..097c4320f2 --- /dev/null +++ b/target/linux/layerscape/patches-4.9/303-arm-imx-select-ARCH_DMA_ADDR_T_64BIT-for-LPAE.patch @@ -0,0 +1,23 @@ +From c079739fa1101dcf7a1e40a195e019065e327d15 Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Fri, 20 Oct 2017 16:45:17 +0800 +Subject: [PATCH] arm: imx: select ARCH_DMA_ADDR_T_64BIT for LPAE + +Selected ARCH_DMA_ADDR_T_64BIT for LPAE since +hardware could support it. + +Signed-off-by: Yangbo Lu +--- + arch/arm/mach-imx/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/mach-imx/Kconfig ++++ b/arch/arm/mach-imx/Kconfig +@@ -1,6 +1,7 @@ + menuconfig ARCH_MXC + bool "Freescale i.MX family" + depends on ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7 || ARM_SINGLE_ARMV7M ++ select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE + select ARCH_SUPPORTS_BIG_ENDIAN + select CLKSRC_IMX_GPT + select GENERIC_IRQ_CHIP diff --git a/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch b/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch index 445a6fa028..3627773171 100644 --- a/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch @@ -1,4 +1,4 @@ -From 120fa458ffe2250ea58578ccfc85e674005463dc Mon Sep 17 00:00:00 2001 +From a3757157751a8a5302ee5e11faf828dc5db02018 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 25 Sep 2017 10:53:50 +0800 Subject: [PATCH] mtd: spi-nor: support layerscape @@ -18,10 +18,10 @@ Signed-off-by: Ash Benz Signed-off-by: Yangbo Lu --- drivers/mtd/mtdchar.c | 2 +- - drivers/mtd/spi-nor/fsl-quadspi.c | 356 +++++++++++++++++++++++++++++++------- - drivers/mtd/spi-nor/spi-nor.c | 136 +++++++++++++-- + drivers/mtd/spi-nor/fsl-quadspi.c | 327 +++++++++++++++++++++++++++++++------- + drivers/mtd/spi-nor/spi-nor.c | 136 ++++++++++++++-- include/linux/mtd/spi-nor.h | 14 +- - 4 files changed, 432 insertions(+), 76 deletions(-) + 4 files changed, 409 insertions(+), 70 deletions(-) --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c @@ -209,13 +209,15 @@ Signed-off-by: Yangbo Lu fsl_qspi_unlock_lut(q); -@@ -382,25 +449,51 @@ static void fsl_qspi_init_lut(struct fsl +@@ -382,24 +449,50 @@ static void fsl_qspi_init_lut(struct fsl for (i = 0; i < QUADSPI_LUT_NUM; i++) qspi_writel(q, 0, base + QUADSPI_LUT_BASE + i * 4); - /* Quad Read */ - lut_base = SEQID_QUAD_READ * 4; -- ++ /* Read */ ++ lut_base = SEQID_READ * 4; + - if (q->nor_size <= SZ_16M) { - cmd = SPINOR_OP_READ_1_1_4; - addrlen = ADDR24BIT; @@ -226,9 +228,7 @@ Signed-off-by: Yangbo Lu - addrlen = ADDR32BIT; - dummy = 8; - } -+ /* Read */ -+ lut_base = SEQID_READ * 4; - +- - qspi_writel(q, LUT0(CMD, PAD1, cmd) | LUT1(ADDR, PAD1, addrlen), + if (nor->flash_read == SPI_NOR_FAST) { + qspi_writel(q, LUT0(CMD, PAD1, read_op) | @@ -242,10 +242,11 @@ Signed-off-by: Yangbo Lu + read_op = 0xEC; + qspi_writel(q, + LUT0(CMD, PAD1, read_op) | LUT1(ADDR, PAD4, addrlen), -+ base + QUADSPI_LUT(lut_base)); + base + QUADSPI_LUT(lut_base)); +- qspi_writel(q, LUT0(DUMMY, PAD1, dummy) | LUT1(FSL_READ, PAD4, rxfifo), + qspi_writel(q, + LUT0(MODE, PAD4, 0xff) | LUT1(DUMMY, PAD4, read_dm), -+ base + QUADSPI_LUT(lut_base + 1)); + base + QUADSPI_LUT(lut_base + 1)); + qspi_writel(q, + LUT0(FSL_READ, PAD4, rxfifo), + base + QUADSPI_LUT(lut_base + 2)); @@ -261,21 +262,19 @@ Signed-off-by: Yangbo Lu + /* read mode : 1-4-4, such as Spansion s25fl128s. */ + qspi_writel(q, LUT0(CMD, PAD1, read_op) + | LUT1(ADDR_DDR, PAD4, addrlen), - base + QUADSPI_LUT(lut_base)); -- qspi_writel(q, LUT0(DUMMY, PAD1, dummy) | LUT1(FSL_READ, PAD4, rxfifo), ++ base + QUADSPI_LUT(lut_base)); + + qspi_writel(q, LUT0(MODE_DDR, PAD4, 0xff) + | LUT1(DUMMY, PAD1, read_dm), - base + QUADSPI_LUT(lut_base + 1)); - ++ base + QUADSPI_LUT(lut_base + 1)); ++ + qspi_writel(q, LUT0(FSL_READ_DDR, PAD4, rxfifo) + | LUT1(JMP_ON_CS, PAD1, 0), + base + QUADSPI_LUT(lut_base + 2)); + } -+ + /* Write enable */ lut_base = SEQID_WREN * 4; - qspi_writel(q, LUT0(CMD, PAD1, SPINOR_OP_WREN), @@ -409,16 +502,8 @@ static void fsl_qspi_init_lut(struct fsl /* Page Program */ lut_base = SEQID_PP * 4; @@ -501,50 +500,7 @@ Signed-off-by: Yangbo Lu } /* -@@ -681,19 +860,36 @@ static void fsl_qspi_init_abh_read(struc - { - void __iomem *base = q->iobase; - int seqid; -+ const struct fsl_qspi_devtype_data *devtype_data = q->devtype_data; - - /* AHB configuration for access buffer 0/1/2 .*/ - qspi_writel(q, QUADSPI_BUFXCR_INVALID_MSTRID, base + QUADSPI_BUF0CR); - qspi_writel(q, QUADSPI_BUFXCR_INVALID_MSTRID, base + QUADSPI_BUF1CR); - qspi_writel(q, QUADSPI_BUFXCR_INVALID_MSTRID, base + QUADSPI_BUF2CR); -+ - /* -- * Set ADATSZ with the maximum AHB buffer size to improve the -- * read performance. -+ * Errata: A-009282: QuadSPI data prefetch may result in incorrect data -+ * Workaround: Keep the read data size to 64 bits (8 bytes). -+ * This disables the prefetch on the AHB buffer and -+ * prevents this issue from occurring. - */ -- qspi_writel(q, QUADSPI_BUF3CR_ALLMST_MASK | -- ((q->devtype_data->ahb_buf_size / 8) -- << QUADSPI_BUF3CR_ADATSZ_SHIFT), -- base + QUADSPI_BUF3CR); -+ if (devtype_data->devtype == FSL_QUADSPI_LS2080A || -+ devtype_data->devtype == FSL_QUADSPI_LS1021A) { -+ -+ qspi_writel(q, QUADSPI_BUF3CR_ALLMST_MASK | -+ (1 << QUADSPI_BUF3CR_ADATSZ_SHIFT), -+ base + QUADSPI_BUF3CR); -+ -+ } else { -+ /* -+ * Set ADATSZ with the maximum AHB buffer size to improve the -+ * read performance. -+ */ -+ qspi_writel(q, QUADSPI_BUF3CR_ALLMST_MASK | -+ ((q->devtype_data->ahb_buf_size / 8) -+ << QUADSPI_BUF3CR_ADATSZ_SHIFT), -+ base + QUADSPI_BUF3CR); -+ } - - /* We only use the buffer3 */ - qspi_writel(q, 0, base + QUADSPI_BUF0IND); -@@ -704,6 +900,11 @@ static void fsl_qspi_init_abh_read(struc +@@ -704,6 +883,11 @@ static void fsl_qspi_init_abh_read(struc seqid = fsl_qspi_get_seqid(q, q->nor[0].read_opcode); qspi_writel(q, seqid << QUADSPI_BFGENCR_SEQID_SHIFT, q->iobase + QUADSPI_BFGENCR); @@ -556,7 +512,7 @@ Signed-off-by: Yangbo Lu } /* This function was used to prepare and enable QSPI clock */ -@@ -822,6 +1023,7 @@ static const struct of_device_id fsl_qsp +@@ -822,6 +1006,7 @@ static const struct of_device_id fsl_qsp { .compatible = "fsl,imx7d-qspi", .data = (void *)&imx7d_data, }, { .compatible = "fsl,imx6ul-qspi", .data = (void *)&imx6ul_data, }, { .compatible = "fsl,ls1021a-qspi", .data = (void *)&ls1021a_data, }, @@ -564,21 +520,21 @@ Signed-off-by: Yangbo Lu { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, fsl_qspi_dt_ids); -@@ -835,8 +1037,12 @@ static int fsl_qspi_read_reg(struct spi_ +@@ -835,8 +1020,12 @@ static int fsl_qspi_read_reg(struct spi_ { int ret; struct fsl_qspi *q = nor->priv; + u32 to = 0; -+ -+ if (opcode == SPINOR_OP_SPANSION_RDAR) -+ u8tou32(&to, nor->cmd_buf, 4); - ret = fsl_qspi_runcmd(q, opcode, 0, len); ++ if (opcode == SPINOR_OP_SPANSION_RDAR) ++ u8tou32(&to, nor->cmd_buf, 4); ++ + ret = fsl_qspi_runcmd(q, opcode, to, len); if (ret) return ret; -@@ -848,9 +1054,13 @@ static int fsl_qspi_write_reg(struct spi +@@ -848,9 +1037,13 @@ static int fsl_qspi_write_reg(struct spi { struct fsl_qspi *q = nor->priv; int ret; @@ -593,7 +549,7 @@ Signed-off-by: Yangbo Lu if (ret) return ret; -@@ -859,7 +1069,7 @@ static int fsl_qspi_write_reg(struct spi +@@ -859,7 +1052,7 @@ static int fsl_qspi_write_reg(struct spi } else if (len > 0) { ret = fsl_qspi_nor_write(q, nor, opcode, 0, @@ -602,7 +558,7 @@ Signed-off-by: Yangbo Lu if (ret > 0) return 0; } else { -@@ -875,7 +1085,7 @@ static ssize_t fsl_qspi_write(struct spi +@@ -875,7 +1068,7 @@ static ssize_t fsl_qspi_write(struct spi { struct fsl_qspi *q = nor->priv; ssize_t ret = fsl_qspi_nor_write(q, nor, nor->program_opcode, to, @@ -611,7 +567,7 @@ Signed-off-by: Yangbo Lu /* invalid the data in the AHB buffer. */ fsl_qspi_invalid(q); -@@ -922,7 +1132,7 @@ static ssize_t fsl_qspi_read(struct spi_ +@@ -922,7 +1115,7 @@ static ssize_t fsl_qspi_read(struct spi_ len); /* Read out the data directly from the AHB buffer.*/ @@ -620,7 +576,7 @@ Signed-off-by: Yangbo Lu len); return len; -@@ -980,6 +1190,8 @@ static int fsl_qspi_probe(struct platfor +@@ -980,6 +1173,8 @@ static int fsl_qspi_probe(struct platfor struct spi_nor *nor; struct mtd_info *mtd; int ret, i = 0; @@ -629,7 +585,7 @@ Signed-off-by: Yangbo Lu q = devm_kzalloc(dev, sizeof(*q), GFP_KERNEL); if (!q) -@@ -1027,6 +1239,12 @@ static int fsl_qspi_probe(struct platfor +@@ -1027,6 +1222,12 @@ static int fsl_qspi_probe(struct platfor goto clk_failed; } @@ -642,7 +598,7 @@ Signed-off-by: Yangbo Lu /* find the irq */ ret = platform_get_irq(pdev, 0); if (ret < 0) { -@@ -1050,6 +1268,7 @@ static int fsl_qspi_probe(struct platfor +@@ -1050,6 +1251,7 @@ static int fsl_qspi_probe(struct platfor mutex_init(&q->lock); @@ -650,7 +606,7 @@ Signed-off-by: Yangbo Lu /* iterate the subnodes. */ for_each_available_child_of_node(dev->of_node, np) { /* skip the holes */ -@@ -1076,18 +1295,25 @@ static int fsl_qspi_probe(struct platfor +@@ -1076,18 +1278,25 @@ static int fsl_qspi_probe(struct platfor ret = of_property_read_u32(np, "spi-max-frequency", &q->clk_rate); if (ret < 0) @@ -680,7 +636,7 @@ Signed-off-by: Yangbo Lu /* Set the correct NOR size now. */ if (q->nor_size == 0) { -@@ -1110,8 +1336,12 @@ static int fsl_qspi_probe(struct platfor +@@ -1110,8 +1319,12 @@ static int fsl_qspi_probe(struct platfor nor->page_size = q->devtype_data->txfifo; i++; @@ -935,7 +891,7 @@ Signed-off-by: Yangbo Lu #ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS /* prefer "small sector" erase if possible */ -@@ -1676,9 +1783,15 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1678,9 +1785,15 @@ int spi_nor_scan(struct spi_nor *nor, co /* Some devices cannot do fast-read, no matter what DT tells us */ if (info->flags & SPI_NOR_NO_FR) nor->flash_read = SPI_NOR_NORMAL; @@ -954,7 +910,7 @@ Signed-off-by: Yangbo Lu ret = set_quad_mode(nor, info); if (ret) { dev_err(dev, "quad mode not supported\n"); -@@ -1691,6 +1804,9 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1693,6 +1806,9 @@ int spi_nor_scan(struct spi_nor *nor, co /* Default commands */ switch (nor->flash_read) { diff --git a/target/linux/layerscape/patches-4.9/601-net-support-layerscape.patch b/target/linux/layerscape/patches-4.9/601-net-support-layerscape.patch deleted file mode 100644 index 9db40dc2ff..0000000000 --- a/target/linux/layerscape/patches-4.9/601-net-support-layerscape.patch +++ /dev/null @@ -1,2365 +0,0 @@ -From 2ed7bff3d1f2fa6c5f6eff0b2bd98deaa3dc18b0 Mon Sep 17 00:00:00 2001 -From: Yangbo Lu -Date: Mon, 25 Sep 2017 10:57:14 +0800 -Subject: [PATCH] net: support layerscape - -This is a integrated patch for layerscape net support. - -Signed-off-by: Madalin Bucur -Signed-off-by: Zhao Qiang -Signed-off-by: Camelia Groza -Signed-off-by: Madalin Bucur -Signed-off-by: Zhang Ying-22455 -Signed-off-by: Ramneek Mehresh -Signed-off-by: Jarod Wilson -Signed-off-by: Nikhil Badola -Signed-off-by: stephen hemminger -Signed-off-by: Arnd Bergmann -Signed-off-by: Yangbo Lu ---- - drivers/base/devres.c | 66 +++++++++++++++ - drivers/base/soc.c | 66 +++++++++++++++ - drivers/net/bonding/bond_main.c | 10 +-- - drivers/net/dummy.c | 5 +- - drivers/net/ethernet/amazon/ena/ena_netdev.c | 10 +-- - drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 6 +- - drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 4 +- - drivers/net/ethernet/atheros/alx/main.c | 6 +- - drivers/net/ethernet/broadcom/b44.c | 5 +- - drivers/net/ethernet/broadcom/bnx2.c | 5 +- - drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 +- - drivers/net/ethernet/broadcom/tg3.c | 8 +- - drivers/net/ethernet/brocade/bna/bnad.c | 6 +- - drivers/net/ethernet/calxeda/xgmac.c | 5 +- - drivers/net/ethernet/cavium/thunder/nicvf_main.c | 5 +- - drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 7 +- - drivers/net/ethernet/cisco/enic/enic_main.c | 8 +- - drivers/net/ethernet/ec_bhf.c | 4 +- - drivers/net/ethernet/emulex/benet/be_main.c | 5 +- - drivers/net/ethernet/hisilicon/hns/hns_enet.c | 6 +- - drivers/net/ethernet/ibm/ehea/ehea_main.c | 5 +- - drivers/net/ethernet/intel/e1000e/e1000.h | 4 +- - drivers/net/ethernet/intel/e1000e/netdev.c | 5 +- - drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 6 +- - drivers/net/ethernet/intel/i40e/i40e.h | 5 +- - drivers/net/ethernet/intel/i40e/i40e_main.c | 18 ++-- - drivers/net/ethernet/intel/igb/igb_main.c | 10 +-- - drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 7 +- - drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 6 +- - drivers/net/ethernet/marvell/mvneta.c | 4 +- - drivers/net/ethernet/marvell/mvpp2.c | 4 +- - drivers/net/ethernet/marvell/sky2.c | 6 +- - drivers/net/ethernet/mediatek/mtk_eth_soc.c | 6 +- - drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 4 +- - drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 +- - drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 4 +- - drivers/net/ethernet/mellanox/mlxsw/switchx2.c | 3 +- - drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 9 +- - drivers/net/ethernet/neterion/vxge/vxge-main.c | 4 +- - .../net/ethernet/netronome/nfp/nfp_net_common.c | 6 +- - drivers/net/ethernet/nvidia/forcedeth.c | 4 +- - .../net/ethernet/qlogic/netxen/netxen_nic_main.c | 10 +-- - drivers/net/ethernet/qlogic/qede/qede_main.c | 7 +- - drivers/net/ethernet/qualcomm/emac/emac.c | 6 +- - drivers/net/ethernet/realtek/8139too.c | 9 +- - drivers/net/ethernet/realtek/r8169.c | 4 +- - drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 8 +- - drivers/net/ethernet/sfc/efx.c | 6 +- - drivers/net/ethernet/sun/niu.c | 6 +- - drivers/net/ethernet/synopsys/dwc_eth_qos.c | 4 +- - drivers/net/ethernet/tile/tilepro.c | 4 +- - drivers/net/ethernet/via/via-rhine.c | 8 +- - drivers/net/fjes/fjes_main.c | 7 +- - drivers/net/hyperv/netvsc_drv.c | 6 +- - drivers/net/ifb.c | 6 +- - drivers/net/ipvlan/ipvlan_main.c | 5 +- - drivers/net/loopback.c | 5 +- - drivers/net/macsec.c | 8 +- - drivers/net/macvlan.c | 5 +- - drivers/net/nlmon.c | 4 +- - drivers/net/ppp/ppp_generic.c | 4 +- - drivers/net/slip/slip.c | 3 +- - drivers/net/team/team.c | 3 +- - drivers/net/tun.c | 3 +- - drivers/net/veth.c | 6 +- - drivers/net/virtio_net.c | 6 +- - drivers/net/vmxnet3/vmxnet3_ethtool.c | 4 +- - drivers/net/vmxnet3/vmxnet3_int.h | 4 +- - drivers/net/vrf.c | 5 +- - drivers/net/xen-netfront.c | 6 +- - drivers/staging/netlogic/xlr_net.c | 10 +-- - include/linux/device.h | 19 +++++ - include/linux/fsl/svr.h | 97 ++++++++++++++++++++++ - include/linux/fsl_devices.h | 3 + - include/linux/netdev_features.h | 2 + - include/linux/netdevice.h | 12 ++- - include/linux/skbuff.h | 2 + - include/linux/sys_soc.h | 3 + - include/net/ip_tunnels.h | 4 +- - include/uapi/linux/if_ether.h | 1 + - net/8021q/vlan_dev.c | 5 +- - net/bridge/br_device.c | 6 +- - net/core/dev.c | 13 ++- - net/core/skbuff.c | 29 ++++++- - net/ipv4/ip_tunnel_core.c | 6 +- - net/l2tp/l2tp_eth.c | 6 +- - net/mac80211/iface.c | 4 +- - net/openvswitch/vport-internal_dev.c | 4 +- - net/sched/sch_generic.c | 7 ++ - net/sched/sch_teql.c | 5 +- - 90 files changed, 468 insertions(+), 298 deletions(-) - create mode 100644 include/linux/fsl/svr.h - ---- a/drivers/base/devres.c -+++ b/drivers/base/devres.c -@@ -10,6 +10,7 @@ - #include - #include - #include -+#include - - #include "base.h" - -@@ -985,3 +986,68 @@ void devm_free_pages(struct device *dev, - &devres)); - } - EXPORT_SYMBOL_GPL(devm_free_pages); -+ -+static void devm_percpu_release(struct device *dev, void *pdata) -+{ -+ void __percpu *p; -+ -+ p = *(void __percpu **)pdata; -+ free_percpu(p); -+} -+ -+static int devm_percpu_match(struct device *dev, void *data, void *p) -+{ -+ struct devres *devr = container_of(data, struct devres, data); -+ -+ return *(void **)devr->data == p; -+} -+ -+/** -+ * __devm_alloc_percpu - Resource-managed alloc_percpu -+ * @dev: Device to allocate per-cpu memory for -+ * @size: Size of per-cpu memory to allocate -+ * @align: Alignment of per-cpu memory to allocate -+ * -+ * Managed alloc_percpu. Per-cpu memory allocated with this function is -+ * automatically freed on driver detach. -+ * -+ * RETURNS: -+ * Pointer to allocated memory on success, NULL on failure. -+ */ -+void __percpu *__devm_alloc_percpu(struct device *dev, size_t size, -+ size_t align) -+{ -+ void *p; -+ void __percpu *pcpu; -+ -+ pcpu = __alloc_percpu(size, align); -+ if (!pcpu) -+ return NULL; -+ -+ p = devres_alloc(devm_percpu_release, sizeof(void *), GFP_KERNEL); -+ if (!p) { -+ free_percpu(pcpu); -+ return NULL; -+ } -+ -+ *(void __percpu **)p = pcpu; -+ -+ devres_add(dev, p); -+ -+ return pcpu; -+} -+EXPORT_SYMBOL_GPL(__devm_alloc_percpu); -+ -+/** -+ * devm_free_percpu - Resource-managed free_percpu -+ * @dev: Device this memory belongs to -+ * @pdata: Per-cpu memory to free -+ * -+ * Free memory allocated with devm_alloc_percpu(). -+ */ -+void devm_free_percpu(struct device *dev, void __percpu *pdata) -+{ -+ WARN_ON(devres_destroy(dev, devm_percpu_release, devm_percpu_match, -+ (void *)pdata)); -+} -+EXPORT_SYMBOL_GPL(devm_free_percpu); ---- a/drivers/base/soc.c -+++ b/drivers/base/soc.c -@@ -13,6 +13,7 @@ - #include - #include - #include -+#include - - static DEFINE_IDA(soc_ida); - -@@ -159,3 +160,68 @@ static int __init soc_bus_register(void) - return bus_register(&soc_bus_type); - } - core_initcall(soc_bus_register); -+ -+static int soc_device_match_one(struct device *dev, void *arg) -+{ -+ struct soc_device *soc_dev = container_of(dev, struct soc_device, dev); -+ const struct soc_device_attribute *match = arg; -+ -+ if (match->machine && -+ !glob_match(match->machine, soc_dev->attr->machine)) -+ return 0; -+ -+ if (match->family && -+ !glob_match(match->family, soc_dev->attr->family)) -+ return 0; -+ -+ if (match->revision && -+ !glob_match(match->revision, soc_dev->attr->revision)) -+ return 0; -+ -+ if (match->soc_id && -+ !glob_match(match->soc_id, soc_dev->attr->soc_id)) -+ return 0; -+ -+ return 1; -+} -+ -+/* -+ * soc_device_match - identify the SoC in the machine -+ * @matches: zero-terminated array of possible matches -+ * -+ * returns the first matching entry of the argument array, or NULL -+ * if none of them match. -+ * -+ * This function is meant as a helper in place of of_match_node() -+ * in cases where either no device tree is available or the information -+ * in a device node is insufficient to identify a particular variant -+ * by its compatible strings or other properties. For new devices, -+ * the DT binding should always provide unique compatible strings -+ * that allow the use of of_match_node() instead. -+ * -+ * The calling function can use the .data entry of the -+ * soc_device_attribute to pass a structure or function pointer for -+ * each entry. -+ */ -+const struct soc_device_attribute *soc_device_match( -+ const struct soc_device_attribute *matches) -+{ -+ int ret = 0; -+ -+ if (!matches) -+ return NULL; -+ -+ while (!ret) { -+ if (!(matches->machine || matches->family || -+ matches->revision || matches->soc_id)) -+ break; -+ ret = bus_for_each_dev(&soc_bus_type, NULL, (void *)matches, -+ soc_device_match_one); -+ if (!ret) -+ matches++; -+ else -+ return matches; -+ } -+ return NULL; -+} -+EXPORT_SYMBOL_GPL(soc_device_match); ---- a/drivers/net/bonding/bond_main.c -+++ b/drivers/net/bonding/bond_main.c -@@ -211,8 +211,8 @@ static int lacp_fast; - - static int bond_init(struct net_device *bond_dev); - static void bond_uninit(struct net_device *bond_dev); --static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev, -- struct rtnl_link_stats64 *stats); -+static void bond_get_stats(struct net_device *bond_dev, -+ struct rtnl_link_stats64 *stats); - static void bond_slave_arr_handler(struct work_struct *work); - static bool bond_time_in_interval(struct bonding *bond, unsigned long last_act, - int mod); -@@ -3336,8 +3336,8 @@ static void bond_fold_stats(struct rtnl_ - } - } - --static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev, -- struct rtnl_link_stats64 *stats) -+static void bond_get_stats(struct net_device *bond_dev, -+ struct rtnl_link_stats64 *stats) - { - struct bonding *bond = netdev_priv(bond_dev); - struct rtnl_link_stats64 temp; -@@ -3361,8 +3361,6 @@ static struct rtnl_link_stats64 *bond_ge - - memcpy(&bond->bond_stats, stats, sizeof(*stats)); - spin_unlock(&bond->stats_lock); -- -- return stats; - } - - static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd) ---- a/drivers/net/dummy.c -+++ b/drivers/net/dummy.c -@@ -54,8 +54,8 @@ struct pcpu_dstats { - struct u64_stats_sync syncp; - }; - --static struct rtnl_link_stats64 *dummy_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void dummy_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - int i; - -@@ -73,7 +73,6 @@ static struct rtnl_link_stats64 *dummy_g - stats->tx_bytes += tbytes; - stats->tx_packets += tpackets; - } -- return stats; - } - - static netdev_tx_t dummy_xmit(struct sk_buff *skb, struct net_device *dev) ---- a/drivers/net/ethernet/amazon/ena/ena_netdev.c -+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c -@@ -2172,19 +2172,19 @@ err: - ena_com_delete_debug_area(adapter->ena_dev); - } - --static struct rtnl_link_stats64 *ena_get_stats64(struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+static void ena_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct ena_adapter *adapter = netdev_priv(netdev); - struct ena_admin_basic_stats ena_stats; - int rc; - - if (!test_bit(ENA_FLAG_DEV_UP, &adapter->flags)) -- return NULL; -+ return; - - rc = ena_com_get_dev_basic_stats(adapter->ena_dev, &ena_stats); - if (rc) -- return NULL; -+ return; - - stats->tx_bytes = ((u64)ena_stats.tx_bytes_high << 32) | - ena_stats.tx_bytes_low; -@@ -2211,8 +2211,6 @@ static struct rtnl_link_stats64 *ena_get - - stats->rx_errors = 0; - stats->tx_errors = 0; -- -- return stats; - } - - static const struct net_device_ops ena_netdev_ops = { ---- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c -+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c -@@ -1542,8 +1542,8 @@ static void xgbe_tx_timeout(struct net_d - schedule_work(&pdata->restart_work); - } - --static struct rtnl_link_stats64 *xgbe_get_stats64(struct net_device *netdev, -- struct rtnl_link_stats64 *s) -+static void xgbe_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *s) - { - struct xgbe_prv_data *pdata = netdev_priv(netdev); - struct xgbe_mmc_stats *pstats = &pdata->mmc_stats; -@@ -1569,8 +1569,6 @@ static struct rtnl_link_stats64 *xgbe_ge - s->tx_dropped = netdev->stats.tx_dropped; - - DBGPR("<--%s\n", __func__); -- -- return s; - } - - static int xgbe_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, ---- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c -+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c -@@ -1199,7 +1199,7 @@ err: - return ret; - } - --static struct rtnl_link_stats64 *xgene_enet_get_stats64( -+static void xgene_enet_get_stats64( - struct net_device *ndev, - struct rtnl_link_stats64 *storage) - { -@@ -1230,8 +1230,6 @@ static struct rtnl_link_stats64 *xgene_e - } - } - memcpy(storage, stats, sizeof(struct rtnl_link_stats64)); -- -- return storage; - } - - static int xgene_enet_set_mac_address(struct net_device *ndev, void *addr) ---- a/drivers/net/ethernet/atheros/alx/main.c -+++ b/drivers/net/ethernet/atheros/alx/main.c -@@ -1424,8 +1424,8 @@ static void alx_poll_controller(struct n - } - #endif - --static struct rtnl_link_stats64 *alx_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *net_stats) -+static void alx_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *net_stats) - { - struct alx_priv *alx = netdev_priv(dev); - struct alx_hw_stats *hw_stats = &alx->hw.stats; -@@ -1469,8 +1469,6 @@ static struct rtnl_link_stats64 *alx_get - net_stats->rx_packets = hw_stats->rx_ok + net_stats->rx_errors; - - spin_unlock(&alx->stats_lock); -- -- return net_stats; - } - - static const struct net_device_ops alx_netdev_ops = { ---- a/drivers/net/ethernet/broadcom/b44.c -+++ b/drivers/net/ethernet/broadcom/b44.c -@@ -1677,8 +1677,8 @@ static int b44_close(struct net_device * - return 0; - } - --static struct rtnl_link_stats64 *b44_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *nstat) -+static void b44_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *nstat) - { - struct b44 *bp = netdev_priv(dev); - struct b44_hw_stats *hwstat = &bp->hw_stats; -@@ -1721,7 +1721,6 @@ static struct rtnl_link_stats64 *b44_get - #endif - } while (u64_stats_fetch_retry_irq(&hwstat->syncp, start)); - -- return nstat; - } - - static int __b44_load_mcast(struct b44 *bp, struct net_device *dev) ---- a/drivers/net/ethernet/broadcom/bnx2.c -+++ b/drivers/net/ethernet/broadcom/bnx2.c -@@ -6828,13 +6828,13 @@ bnx2_save_stats(struct bnx2 *bp) - (unsigned long) (bp->stats_blk->ctr + \ - bp->temp_stats_blk->ctr) - --static struct rtnl_link_stats64 * -+static void - bnx2_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *net_stats) - { - struct bnx2 *bp = netdev_priv(dev); - - if (bp->stats_blk == NULL) -- return net_stats; -+ return; - - net_stats->rx_packets = - GET_64BIT_NET_STATS(stat_IfHCInUcastPkts) + -@@ -6898,7 +6898,6 @@ bnx2_get_stats64(struct net_device *dev, - GET_32BIT_NET_STATS(stat_IfInMBUFDiscards) + - GET_32BIT_NET_STATS(stat_FwRxDrop); - -- return net_stats; - } - - /* All ethtool functions called with rtnl_lock */ ---- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c -+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c -@@ -5664,7 +5664,7 @@ static int bnxt_ioctl(struct net_device - return -EOPNOTSUPP; - } - --static struct rtnl_link_stats64 * -+static void - bnxt_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - u32 i; -@@ -5673,7 +5673,7 @@ bnxt_get_stats64(struct net_device *dev, - memset(stats, 0, sizeof(struct rtnl_link_stats64)); - - if (!bp->bnapi) -- return stats; -+ return; - - /* TODO check if we need to synchronize with bnxt_close path */ - for (i = 0; i < bp->cp_nr_rings; i++) { -@@ -5720,8 +5720,6 @@ bnxt_get_stats64(struct net_device *dev, - stats->tx_fifo_errors = le64_to_cpu(tx->tx_fifo_underruns); - stats->tx_errors = le64_to_cpu(tx->tx_err); - } -- -- return stats; - } - - static bool bnxt_mc_list_updated(struct bnxt *bp, u32 *rx_mask) ---- a/drivers/net/ethernet/broadcom/tg3.c -+++ b/drivers/net/ethernet/broadcom/tg3.c -@@ -14145,8 +14145,8 @@ static const struct ethtool_ops tg3_etht - .set_link_ksettings = tg3_set_link_ksettings, - }; - --static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void tg3_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct tg3 *tp = netdev_priv(dev); - -@@ -14154,13 +14154,11 @@ static struct rtnl_link_stats64 *tg3_get - if (!tp->hw_stats) { - *stats = tp->net_stats_prev; - spin_unlock_bh(&tp->lock); -- return stats; -+ return; - } - - tg3_get_nstats(tp, stats); - spin_unlock_bh(&tp->lock); -- -- return stats; - } - - static void tg3_set_rx_mode(struct net_device *dev) ---- a/drivers/net/ethernet/brocade/bna/bnad.c -+++ b/drivers/net/ethernet/brocade/bna/bnad.c -@@ -3111,7 +3111,7 @@ bnad_start_xmit(struct sk_buff *skb, str - * Used spin_lock to synchronize reading of stats structures, which - * is written by BNA under the same lock. - */ --static struct rtnl_link_stats64 * -+static void - bnad_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats) - { - struct bnad *bnad = netdev_priv(netdev); -@@ -3123,8 +3123,6 @@ bnad_get_stats64(struct net_device *netd - bnad_netdev_hwstats_fill(bnad, stats); - - spin_unlock_irqrestore(&bnad->bna_lock, flags); -- -- return stats; - } - - static void -@@ -3430,7 +3428,7 @@ static const struct net_device_ops bnad_ - .ndo_open = bnad_open, - .ndo_stop = bnad_stop, - .ndo_start_xmit = bnad_start_xmit, -- .ndo_get_stats64 = bnad_get_stats64, -+ .ndo_get_stats64 = bnad_get_stats64, - .ndo_set_rx_mode = bnad_set_rx_mode, - .ndo_validate_addr = eth_validate_addr, - .ndo_set_mac_address = bnad_set_mac_address, ---- a/drivers/net/ethernet/calxeda/xgmac.c -+++ b/drivers/net/ethernet/calxeda/xgmac.c -@@ -1460,9 +1460,9 @@ static void xgmac_poll_controller(struct - } - #endif - --static struct rtnl_link_stats64 * -+static void - xgmac_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *storage) -+ struct rtnl_link_stats64 *storage) - { - struct xgmac_priv *priv = netdev_priv(dev); - void __iomem *base = priv->base; -@@ -1490,7 +1490,6 @@ xgmac_get_stats64(struct net_device *dev - - writel(0, base + XGMAC_MMC_CTRL); - spin_unlock_bh(&priv->stats_lock); -- return storage; - } - - static int xgmac_set_mac_address(struct net_device *dev, void *p) ---- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c -+++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c -@@ -1423,8 +1423,8 @@ void nicvf_update_stats(struct nicvf *ni - nicvf_update_sq_stats(nic, qidx); - } - --static struct rtnl_link_stats64 *nicvf_get_stats64(struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+static void nicvf_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct nicvf *nic = netdev_priv(netdev); - struct nicvf_hw_stats *hw_stats = &nic->hw_stats; -@@ -1440,7 +1440,6 @@ static struct rtnl_link_stats64 *nicvf_g - stats->tx_packets = hw_stats->tx_frames; - stats->tx_dropped = hw_stats->tx_drops; - -- return stats; - } - - static void nicvf_tx_timeout(struct net_device *dev) ---- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c -+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c -@@ -2383,8 +2383,8 @@ int cxgb4_remove_server_filter(const str - } - EXPORT_SYMBOL(cxgb4_remove_server_filter); - --static struct rtnl_link_stats64 *cxgb_get_stats(struct net_device *dev, -- struct rtnl_link_stats64 *ns) -+static void cxgb_get_stats(struct net_device *dev, -+ struct rtnl_link_stats64 *ns) - { - struct port_stats stats; - struct port_info *p = netdev_priv(dev); -@@ -2397,7 +2397,7 @@ static struct rtnl_link_stats64 *cxgb_ge - spin_lock(&adapter->stats_lock); - if (!netif_device_present(dev)) { - spin_unlock(&adapter->stats_lock); -- return ns; -+ return; - } - t4_get_port_stats_offset(adapter, p->tx_chan, &stats, - &p->stats_base); -@@ -2431,7 +2431,6 @@ static struct rtnl_link_stats64 *cxgb_ge - ns->tx_errors = stats.tx_error_frames; - ns->rx_errors = stats.rx_symbol_err + stats.rx_fcs_err + - ns->rx_length_errors + stats.rx_len_err + ns->rx_fifo_errors; -- return ns; - } - - static int cxgb_ioctl(struct net_device *dev, struct ifreq *req, int cmd) ---- a/drivers/net/ethernet/cisco/enic/enic_main.c -+++ b/drivers/net/ethernet/cisco/enic/enic_main.c -@@ -680,8 +680,8 @@ static netdev_tx_t enic_hard_start_xmit( - } - - /* dev_base_lock rwlock held, nominally process context */ --static struct rtnl_link_stats64 *enic_get_stats(struct net_device *netdev, -- struct rtnl_link_stats64 *net_stats) -+static void enic_get_stats(struct net_device *netdev, -+ struct rtnl_link_stats64 *net_stats) - { - struct enic *enic = netdev_priv(netdev); - struct vnic_stats *stats; -@@ -693,7 +693,7 @@ static struct rtnl_link_stats64 *enic_ge - * recorded stats. - */ - if (err == -ENOMEM) -- return net_stats; -+ return; - - net_stats->tx_packets = stats->tx.tx_frames_ok; - net_stats->tx_bytes = stats->tx.tx_bytes_ok; -@@ -707,8 +707,6 @@ static struct rtnl_link_stats64 *enic_ge - net_stats->rx_over_errors = enic->rq_truncated_pkts; - net_stats->rx_crc_errors = enic->rq_bad_fcs; - net_stats->rx_dropped = stats->rx.rx_no_bufs + stats->rx.rx_drop; -- -- return net_stats; - } - - static int enic_mc_sync(struct net_device *netdev, const u8 *mc_addr) ---- a/drivers/net/ethernet/ec_bhf.c -+++ b/drivers/net/ethernet/ec_bhf.c -@@ -458,7 +458,7 @@ static int ec_bhf_stop(struct net_device - return 0; - } - --static struct rtnl_link_stats64 * -+static void - ec_bhf_get_stats(struct net_device *net_dev, - struct rtnl_link_stats64 *stats) - { -@@ -473,8 +473,6 @@ ec_bhf_get_stats(struct net_device *net_ - - stats->tx_bytes = priv->stat_tx_bytes; - stats->rx_bytes = priv->stat_rx_bytes; -- -- return stats; - } - - static const struct net_device_ops ec_bhf_netdev_ops = { ---- a/drivers/net/ethernet/emulex/benet/be_main.c -+++ b/drivers/net/ethernet/emulex/benet/be_main.c -@@ -646,8 +646,8 @@ void be_parse_stats(struct be_adapter *a - } - } - --static struct rtnl_link_stats64 *be_get_stats64(struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+static void be_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct be_adapter *adapter = netdev_priv(netdev); - struct be_drv_stats *drvs = &adapter->drv_stats; -@@ -711,7 +711,6 @@ static struct rtnl_link_stats64 *be_get_ - stats->rx_fifo_errors = drvs->rxpp_fifo_overflow_drop + - drvs->rx_input_fifo_overflow_drop + - drvs->rx_drops_no_pbuf; -- return stats; - } - - void be_link_status_update(struct be_adapter *adapter, u8 link_status) ---- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c -+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c -@@ -1536,8 +1536,8 @@ void hns_nic_set_rx_mode(struct net_devi - hns_set_multicast_list(ndev); - } - --struct rtnl_link_stats64 *hns_nic_get_stats64(struct net_device *ndev, -- struct rtnl_link_stats64 *stats) -+static void hns_nic_get_stats64(struct net_device *ndev, -+ struct rtnl_link_stats64 *stats) - { - int idx = 0; - u64 tx_bytes = 0; -@@ -1579,8 +1579,6 @@ struct rtnl_link_stats64 *hns_nic_get_st - stats->tx_window_errors = ndev->stats.tx_window_errors; - stats->rx_compressed = ndev->stats.rx_compressed; - stats->tx_compressed = ndev->stats.tx_compressed; -- -- return stats; - } - - static u16 ---- a/drivers/net/ethernet/ibm/ehea/ehea_main.c -+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c -@@ -328,8 +328,8 @@ out: - spin_unlock_irqrestore(&ehea_bcmc_regs.lock, flags); - } - --static struct rtnl_link_stats64 *ehea_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void ehea_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct ehea_port *port = netdev_priv(dev); - u64 rx_packets = 0, tx_packets = 0, rx_bytes = 0, tx_bytes = 0; -@@ -352,7 +352,6 @@ static struct rtnl_link_stats64 *ehea_ge - - stats->multicast = port->stats.multicast; - stats->rx_errors = port->stats.rx_errors; -- return stats; - } - - static void ehea_update_stats(struct work_struct *work) ---- a/drivers/net/ethernet/intel/e1000e/e1000.h -+++ b/drivers/net/ethernet/intel/e1000e/e1000.h -@@ -493,8 +493,8 @@ int e1000e_setup_rx_resources(struct e10 - int e1000e_setup_tx_resources(struct e1000_ring *ring); - void e1000e_free_rx_resources(struct e1000_ring *ring); - void e1000e_free_tx_resources(struct e1000_ring *ring); --struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev, -- struct rtnl_link_stats64 *stats); -+void e1000e_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats); - void e1000e_set_interrupt_capability(struct e1000_adapter *adapter); - void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter); - void e1000e_get_hw_control(struct e1000_adapter *adapter); ---- a/drivers/net/ethernet/intel/e1000e/netdev.c -+++ b/drivers/net/ethernet/intel/e1000e/netdev.c -@@ -5939,8 +5939,8 @@ static void e1000_reset_task(struct work - * - * Returns the address of the device statistics structure. - **/ --struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+void e1000e_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct e1000_adapter *adapter = netdev_priv(netdev); - -@@ -5977,7 +5977,6 @@ struct rtnl_link_stats64 *e1000e_get_sta - /* Tx Dropped needs to be maintained elsewhere */ - - spin_unlock(&adapter->stats64_lock); -- return stats; - } - - /** ---- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c -+++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c -@@ -1128,8 +1128,8 @@ void fm10k_reset_rx_state(struct fm10k_i - * Returns 64bit statistics, for use in the ndo_get_stats64 callback. This - * function replaces fm10k_get_stats for kernels which support it. - */ --static struct rtnl_link_stats64 *fm10k_get_stats64(struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+static void fm10k_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct fm10k_intfc *interface = netdev_priv(netdev); - struct fm10k_ring *ring; -@@ -1174,8 +1174,6 @@ static struct rtnl_link_stats64 *fm10k_g - - /* following stats updated by fm10k_service_task() */ - stats->rx_missed_errors = netdev->stats.rx_missed_errors; -- -- return stats; - } - - int fm10k_setup_tc(struct net_device *dev, u8 tc) ---- a/drivers/net/ethernet/intel/i40e/i40e.h -+++ b/drivers/net/ethernet/intel/i40e/i40e.h -@@ -797,9 +797,8 @@ static inline void i40e_irq_dynamic_enab - void i40e_irq_dynamic_disable_icr0(struct i40e_pf *pf); - void i40e_irq_dynamic_enable_icr0(struct i40e_pf *pf, bool clearpba); - #ifdef I40E_FCOE --struct rtnl_link_stats64 *i40e_get_netdev_stats_struct( -- struct net_device *netdev, -- struct rtnl_link_stats64 *storage); -+void i40e_get_netdev_stats_struct(struct net_device *netdev, -+ struct rtnl_link_stats64 *storage); - int i40e_set_mac(struct net_device *netdev, void *p); - void i40e_set_rx_mode(struct net_device *netdev); - #endif ---- a/drivers/net/ethernet/intel/i40e/i40e_main.c -+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c -@@ -408,15 +408,11 @@ struct rtnl_link_stats64 *i40e_get_vsi_s - * Returns the address of the device statistics structure. - * The statistics are actually updated from the service task. - **/ --#ifdef I40E_FCOE --struct rtnl_link_stats64 *i40e_get_netdev_stats_struct( -- struct net_device *netdev, -- struct rtnl_link_stats64 *stats) --#else --static struct rtnl_link_stats64 *i40e_get_netdev_stats_struct( -- struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+#ifndef I40E_FCOE -+static - #endif -+void i40e_get_netdev_stats_struct(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct i40e_netdev_priv *np = netdev_priv(netdev); - struct i40e_ring *tx_ring, *rx_ring; -@@ -425,10 +421,10 @@ static struct rtnl_link_stats64 *i40e_ge - int i; - - if (test_bit(__I40E_DOWN, &vsi->state)) -- return stats; -+ return; - - if (!vsi->tx_rings) -- return stats; -+ return; - - rcu_read_lock(); - for (i = 0; i < vsi->num_queue_pairs; i++) { -@@ -468,8 +464,6 @@ static struct rtnl_link_stats64 *i40e_ge - stats->rx_dropped = vsi_stats->rx_dropped; - stats->rx_crc_errors = vsi_stats->rx_crc_errors; - stats->rx_length_errors = vsi_stats->rx_length_errors; -- -- return stats; - } - - /** ---- a/drivers/net/ethernet/intel/igb/igb_main.c -+++ b/drivers/net/ethernet/intel/igb/igb_main.c -@@ -137,8 +137,8 @@ static void igb_update_phy_info(unsigned - static void igb_watchdog(unsigned long); - static void igb_watchdog_task(struct work_struct *); - static netdev_tx_t igb_xmit_frame(struct sk_buff *skb, struct net_device *); --static struct rtnl_link_stats64 *igb_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats); -+static void igb_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats); - static int igb_change_mtu(struct net_device *, int); - static int igb_set_mac(struct net_device *, void *); - static void igb_set_uta(struct igb_adapter *adapter, bool set); -@@ -5386,8 +5386,8 @@ static void igb_reset_task(struct work_s - * @netdev: network interface device structure - * @stats: rtnl_link_stats64 pointer - **/ --static struct rtnl_link_stats64 *igb_get_stats64(struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+static void igb_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct igb_adapter *adapter = netdev_priv(netdev); - -@@ -5395,8 +5395,6 @@ static struct rtnl_link_stats64 *igb_get - igb_update_stats(adapter, &adapter->stats64); - memcpy(stats, &adapter->stats64, sizeof(*stats)); - spin_unlock(&adapter->stats64_lock); -- -- return stats; - } - - /** ---- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c -+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c -@@ -8085,8 +8085,9 @@ static void ixgbe_netpoll(struct net_dev - } - - #endif --static struct rtnl_link_stats64 *ixgbe_get_stats64(struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+ -+static void ixgbe_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct ixgbe_adapter *adapter = netdev_priv(netdev); - int i; -@@ -8124,13 +8125,13 @@ static struct rtnl_link_stats64 *ixgbe_g - } - } - rcu_read_unlock(); -+ - /* following stats updated by ixgbe_watchdog_task() */ - stats->multicast = netdev->stats.multicast; - stats->rx_errors = netdev->stats.rx_errors; - stats->rx_length_errors = netdev->stats.rx_length_errors; - stats->rx_crc_errors = netdev->stats.rx_crc_errors; - stats->rx_missed_errors = netdev->stats.rx_missed_errors; -- return stats; - } - - #ifdef CONFIG_IXGBE_DCB ---- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c -+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c -@@ -3880,8 +3880,8 @@ static void ixgbevf_shutdown(struct pci_ - ixgbevf_suspend(pdev, PMSG_SUSPEND); - } - --static struct rtnl_link_stats64 *ixgbevf_get_stats(struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+static void ixgbevf_get_stats(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct ixgbevf_adapter *adapter = netdev_priv(netdev); - unsigned int start; -@@ -3914,8 +3914,6 @@ static struct rtnl_link_stats64 *ixgbevf - stats->tx_bytes += bytes; - stats->tx_packets += packets; - } -- -- return stats; - } - - #define IXGBEVF_MAX_MAC_HDR_LEN 127 ---- a/drivers/net/ethernet/marvell/mvneta.c -+++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -636,7 +636,7 @@ static void mvneta_mib_counters_clear(st - } - - /* Get System Network Statistics */ --static struct rtnl_link_stats64 * -+static void - mvneta_get_stats64(struct net_device *dev, - struct rtnl_link_stats64 *stats) - { -@@ -670,8 +670,6 @@ mvneta_get_stats64(struct net_device *de - stats->rx_dropped = dev->stats.rx_dropped; - - stats->tx_dropped = dev->stats.tx_dropped; -- -- return stats; - } - - /* Rx descriptors helper methods */ ---- a/drivers/net/ethernet/marvell/mvpp2.c -+++ b/drivers/net/ethernet/marvell/mvpp2.c -@@ -5761,7 +5761,7 @@ error: - return err; - } - --static struct rtnl_link_stats64 * -+static void - mvpp2_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - struct mvpp2_port *port = netdev_priv(dev); -@@ -5793,8 +5793,6 @@ mvpp2_get_stats64(struct net_device *dev - stats->rx_errors = dev->stats.rx_errors; - stats->rx_dropped = dev->stats.rx_dropped; - stats->tx_dropped = dev->stats.tx_dropped; -- -- return stats; - } - - static int mvpp2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ---- a/drivers/net/ethernet/marvell/sky2.c -+++ b/drivers/net/ethernet/marvell/sky2.c -@@ -3898,8 +3898,8 @@ static void sky2_set_multicast(struct ne - gma_write16(hw, port, GM_RX_CTRL, reg); - } - --static struct rtnl_link_stats64 *sky2_get_stats(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void sky2_get_stats(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct sky2_port *sky2 = netdev_priv(dev); - struct sky2_hw *hw = sky2->hw; -@@ -3939,8 +3939,6 @@ static struct rtnl_link_stats64 *sky2_ge - stats->rx_dropped = dev->stats.rx_dropped; - stats->rx_fifo_errors = dev->stats.rx_fifo_errors; - stats->tx_fifo_errors = dev->stats.tx_fifo_errors; -- -- return stats; - } - - /* Can have one global because blinking is controlled by ---- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c -+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -462,8 +462,8 @@ static void mtk_stats_update(struct mtk_ - } - } - --static struct rtnl_link_stats64 *mtk_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *storage) -+static void mtk_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *storage) - { - struct mtk_mac *mac = netdev_priv(dev); - struct mtk_hw_stats *hw_stats = mac->hw_stats; -@@ -494,8 +494,6 @@ static struct rtnl_link_stats64 *mtk_get - storage->tx_errors = dev->stats.tx_errors; - storage->rx_dropped = dev->stats.rx_dropped; - storage->tx_dropped = dev->stats.tx_dropped; -- -- return storage; - } - - static inline int mtk_max_frag_size(int mtu) ---- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c -+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c -@@ -1316,7 +1316,7 @@ static void mlx4_en_tx_timeout(struct ne - } - - --static struct rtnl_link_stats64 * -+static void - mlx4_en_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - struct mlx4_en_priv *priv = netdev_priv(dev); -@@ -1324,8 +1324,6 @@ mlx4_en_get_stats64(struct net_device *d - spin_lock_bh(&priv->stats_lock); - netdev_stats_to_stats64(stats, &dev->stats); - spin_unlock_bh(&priv->stats_lock); -- -- return stats; - } - - static void mlx4_en_set_default_moderation(struct mlx4_en_priv *priv) ---- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c -+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c -@@ -2647,7 +2647,7 @@ mqprio: - return mlx5e_setup_tc(dev, tc->tc); - } - --struct rtnl_link_stats64 * -+static void - mlx5e_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - struct mlx5e_priv *priv = netdev_priv(dev); -@@ -2681,7 +2681,6 @@ mlx5e_get_stats(struct net_device *dev, - stats->multicast = - VPORT_COUNTER_GET(vstats, received_eth_multicast.packets); - -- return stats; - } - - static void mlx5e_set_rx_mode(struct net_device *dev) ---- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c -@@ -949,15 +949,13 @@ out: - /* Return the stats from a cache that is updated periodically, - * as this function might get called in an atomic context. - */ --static struct rtnl_link_stats64 * -+static void - mlxsw_sp_port_get_stats64(struct net_device *dev, - struct rtnl_link_stats64 *stats) - { - struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(dev); - - memcpy(stats, mlxsw_sp_port->hw_stats.cache, sizeof(*stats)); -- -- return stats; - } - - int mlxsw_sp_port_vlan_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid_begin, ---- a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c -@@ -351,7 +351,7 @@ static int mlxsw_sx_port_change_mtu(stru - return 0; - } - --static struct rtnl_link_stats64 * -+static void - mlxsw_sx_port_get_stats64(struct net_device *dev, - struct rtnl_link_stats64 *stats) - { -@@ -380,7 +380,6 @@ mlxsw_sx_port_get_stats64(struct net_dev - tx_dropped += p->tx_dropped; - } - stats->tx_dropped = tx_dropped; -- return stats; - } - - static const struct net_device_ops mlxsw_sx_port_netdev_ops = { ---- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c -+++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c -@@ -378,8 +378,8 @@ static inline void put_be32(__be32 val, - __raw_writel((__force __u32) val, (__force void __iomem *)p); - } - --static struct rtnl_link_stats64 *myri10ge_get_stats(struct net_device *dev, -- struct rtnl_link_stats64 *stats); -+static void myri10ge_get_stats(struct net_device *dev, -+ struct rtnl_link_stats64 *stats); - - static void set_fw_name(struct myri10ge_priv *mgp, char *name, bool allocated) - { -@@ -3119,8 +3119,8 @@ drop: - return NETDEV_TX_OK; - } - --static struct rtnl_link_stats64 *myri10ge_get_stats(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void myri10ge_get_stats(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - const struct myri10ge_priv *mgp = netdev_priv(dev); - const struct myri10ge_slice_netstats *slice_stats; -@@ -3135,7 +3135,6 @@ static struct rtnl_link_stats64 *myri10g - stats->rx_dropped += slice_stats->rx_dropped; - stats->tx_dropped += slice_stats->tx_dropped; - } -- return stats; - } - - static void myri10ge_set_multicast_list(struct net_device *dev) ---- a/drivers/net/ethernet/neterion/vxge/vxge-main.c -+++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c -@@ -3116,7 +3116,7 @@ static int vxge_change_mtu(struct net_de - * @stats: pointer to struct rtnl_link_stats64 - * - */ --static struct rtnl_link_stats64 * -+static void - vxge_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *net_stats) - { - struct vxgedev *vdev = netdev_priv(dev); -@@ -3155,8 +3155,6 @@ vxge_get_stats64(struct net_device *dev, - net_stats->tx_bytes += bytes; - net_stats->tx_errors += txstats->tx_errors; - } -- -- return net_stats; - } - - static enum vxge_hw_status vxge_timestamp_config(struct __vxge_hw_device *devh) ---- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c -+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c -@@ -2400,8 +2400,8 @@ int nfp_net_set_ring_size(struct nfp_net - return err; - } - --static struct rtnl_link_stats64 *nfp_net_stat64(struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+static void nfp_net_stat64(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct nfp_net *nn = netdev_priv(netdev); - int r; -@@ -2431,8 +2431,6 @@ static struct rtnl_link_stats64 *nfp_net - stats->tx_bytes += data[1]; - stats->tx_errors += data[2]; - } -- -- return stats; - } - - static bool nfp_net_ebpf_capable(struct nfp_net *nn) ---- a/drivers/net/ethernet/nvidia/forcedeth.c -+++ b/drivers/net/ethernet/nvidia/forcedeth.c -@@ -1733,7 +1733,7 @@ static void nv_update_stats(struct net_d - * Called with read_lock(&dev_base_lock) held for read - - * only synchronized against unregister_netdevice. - */ --static struct rtnl_link_stats64* -+static void - nv_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *storage) - __acquires(&netdev_priv(dev)->hwstats_lock) - __releases(&netdev_priv(dev)->hwstats_lock) -@@ -1793,8 +1793,6 @@ nv_get_stats64(struct net_device *dev, s - - spin_unlock_bh(&np->hwstats_lock); - } -- -- return storage; - } - - /* ---- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c -+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c -@@ -90,8 +90,8 @@ static irqreturn_t netxen_msix_intr(int - - static void netxen_free_ip_list(struct netxen_adapter *, bool); - static void netxen_restore_indev_addr(struct net_device *dev, unsigned long); --static struct rtnl_link_stats64 *netxen_nic_get_stats(struct net_device *dev, -- struct rtnl_link_stats64 *stats); -+static void netxen_nic_get_stats(struct net_device *dev, -+ struct rtnl_link_stats64 *stats); - static int netxen_nic_set_mac(struct net_device *netdev, void *p); - - /* PCI Device ID Table */ -@@ -2295,8 +2295,8 @@ request_reset: - clear_bit(__NX_RESETTING, &adapter->state); - } - --static struct rtnl_link_stats64 *netxen_nic_get_stats(struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+static void netxen_nic_get_stats(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct netxen_adapter *adapter = netdev_priv(netdev); - -@@ -2306,8 +2306,6 @@ static struct rtnl_link_stats64 *netxen_ - stats->tx_bytes = adapter->stats.txbytes; - stats->rx_dropped = adapter->stats.rxdropped; - stats->tx_dropped = adapter->stats.txdropped; -- -- return stats; - } - - static irqreturn_t netxen_intr(int irq, void *data) ---- a/drivers/net/ethernet/qlogic/qede/qede_main.c -+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c -@@ -1803,9 +1803,8 @@ void qede_fill_by_demand_stats(struct qe - edev->stats.tx_mac_ctrl_frames = stats.tx_mac_ctrl_frames; - } - --static --struct rtnl_link_stats64 *qede_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void qede_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct qede_dev *edev = netdev_priv(dev); - -@@ -1835,8 +1834,6 @@ struct rtnl_link_stats64 *qede_get_stats - stats->collisions = edev->stats.tx_total_collisions; - stats->rx_crc_errors = edev->stats.rx_crc_errors; - stats->rx_frame_errors = edev->stats.rx_align_errors; -- -- return stats; - } - - #ifdef CONFIG_QED_SRIOV ---- a/drivers/net/ethernet/qualcomm/emac/emac.c -+++ b/drivers/net/ethernet/qualcomm/emac/emac.c -@@ -319,8 +319,8 @@ static int emac_ioctl(struct net_device - } - - /* Provide network statistics info for the interface */ --static struct rtnl_link_stats64 *emac_get_stats64(struct net_device *netdev, -- struct rtnl_link_stats64 *net_stats) -+static void emac_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *net_stats) - { - struct emac_adapter *adpt = netdev_priv(netdev); - unsigned int addr = REG_MAC_RX_STATUS_BIN; -@@ -384,8 +384,6 @@ static struct rtnl_link_stats64 *emac_ge - net_stats->tx_window_errors = stats->tx_late_col; - - spin_unlock(&stats->lock); -- -- return net_stats; - } - - static const struct net_device_ops emac_netdev_ops = { ---- a/drivers/net/ethernet/realtek/8139too.c -+++ b/drivers/net/ethernet/realtek/8139too.c -@@ -653,9 +653,8 @@ static int rtl8139_poll(struct napi_stru - static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance); - static int rtl8139_close (struct net_device *dev); - static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd); --static struct rtnl_link_stats64 *rtl8139_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 -- *stats); -+static void rtl8139_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats); - static void rtl8139_set_rx_mode (struct net_device *dev); - static void __set_rx_mode (struct net_device *dev); - static void rtl8139_hw_start (struct net_device *dev); -@@ -2521,7 +2520,7 @@ static int netdev_ioctl(struct net_devic - } - - --static struct rtnl_link_stats64 * -+static void - rtl8139_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - struct rtl8139_private *tp = netdev_priv(dev); -@@ -2549,8 +2548,6 @@ rtl8139_get_stats64(struct net_device *d - stats->tx_packets = tp->tx_stats.packets; - stats->tx_bytes = tp->tx_stats.bytes; - } while (u64_stats_fetch_retry_irq(&tp->tx_stats.syncp, start)); -- -- return stats; - } - - /* Set or clear the multicast filter for this adaptor. ---- a/drivers/net/ethernet/realtek/r8169.c -+++ b/drivers/net/ethernet/realtek/r8169.c -@@ -7751,7 +7751,7 @@ err_pm_runtime_put: - goto out; - } - --static struct rtnl_link_stats64 * -+static void - rtl8169_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - struct rtl8169_private *tp = netdev_priv(dev); -@@ -7805,8 +7805,6 @@ rtl8169_get_stats64(struct net_device *d - le16_to_cpu(tp->tc_offset.tx_aborted); - - pm_runtime_put_noidle(&pdev->dev); -- -- return stats; - } - - static void rtl8169_net_suspend(struct net_device *dev) ---- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c -+++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c -@@ -1721,11 +1721,9 @@ static inline u64 sxgbe_get_stat64(void - * This function is a driver entry point whenever ifconfig command gets - * executed to see device statistics. Statistics are number of - * bytes sent or received, errors occurred etc. -- * Return value: -- * This function returns various statistical information of device. - */ --static struct rtnl_link_stats64 *sxgbe_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void sxgbe_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct sxgbe_priv_data *priv = netdev_priv(dev); - void __iomem *ioaddr = priv->ioaddr; -@@ -1776,8 +1774,6 @@ static struct rtnl_link_stats64 *sxgbe_g - SXGBE_MMC_TXUFLWHI_GBCNT_REG); - writel(0, ioaddr + SXGBE_MMC_CTL_REG); - spin_unlock(&priv->stats_lock); -- -- return stats; - } - - /* sxgbe_set_features - entry point to set offload features of the device. ---- a/drivers/net/ethernet/sfc/efx.c -+++ b/drivers/net/ethernet/sfc/efx.c -@@ -2232,16 +2232,14 @@ int efx_net_stop(struct net_device *net_ - } - - /* Context: process, dev_base_lock or RTNL held, non-blocking. */ --static struct rtnl_link_stats64 *efx_net_stats(struct net_device *net_dev, -- struct rtnl_link_stats64 *stats) -+static void efx_net_stats(struct net_device *net_dev, -+ struct rtnl_link_stats64 *stats) - { - struct efx_nic *efx = netdev_priv(net_dev); - - spin_lock_bh(&efx->stats_lock); - efx->type->update_stats(efx, NULL, stats); - spin_unlock_bh(&efx->stats_lock); -- -- return stats; - } - - /* Context: netif_tx_lock held, BHs disabled. */ ---- a/drivers/net/ethernet/sun/niu.c -+++ b/drivers/net/ethernet/sun/niu.c -@@ -6294,8 +6294,8 @@ no_rings: - stats->tx_errors = errors; - } - --static struct rtnl_link_stats64 *niu_get_stats(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void niu_get_stats(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct niu *np = netdev_priv(dev); - -@@ -6303,8 +6303,6 @@ static struct rtnl_link_stats64 *niu_get - niu_get_rx_stats(np, stats); - niu_get_tx_stats(np, stats); - } -- -- return stats; - } - - static void niu_load_hash_xmac(struct niu *np, u16 *hash) ---- a/drivers/net/ethernet/synopsys/dwc_eth_qos.c -+++ b/drivers/net/ethernet/synopsys/dwc_eth_qos.c -@@ -2490,7 +2490,7 @@ static void dwceqos_read_mmc_counters(st - dwceqos_read(lp, DWC_MMC_RXPACKETCOUNT_GB); - } - --static struct rtnl_link_stats64* -+static void - dwceqos_get_stats64(struct net_device *ndev, struct rtnl_link_stats64 *s) - { - unsigned long flags; -@@ -2522,8 +2522,6 @@ dwceqos_get_stats64(struct net_device *n - else - s->tx_errors = hwstats->txunderflowerror + - hwstats->txcarriererror; -- -- return s; - } - - static void ---- a/drivers/net/ethernet/tile/tilepro.c -+++ b/drivers/net/ethernet/tile/tilepro.c -@@ -2047,8 +2047,8 @@ static int tile_net_ioctl(struct net_dev - * - * Returns the address of the device statistics structure. - */ --static struct rtnl_link_stats64 *tile_net_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void tile_net_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct tile_net_priv *priv = netdev_priv(dev); - u64 rx_packets = 0, tx_packets = 0; ---- a/drivers/net/ethernet/via/via-rhine.c -+++ b/drivers/net/ethernet/via/via-rhine.c -@@ -513,8 +513,8 @@ static irqreturn_t rhine_interrupt(int i - static void rhine_tx(struct net_device *dev); - static int rhine_rx(struct net_device *dev, int limit); - static void rhine_set_rx_mode(struct net_device *dev); --static struct rtnl_link_stats64 *rhine_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats); -+static void rhine_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats); - static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); - static const struct ethtool_ops netdev_ethtool_ops; - static int rhine_close(struct net_device *dev); -@@ -2222,7 +2222,7 @@ out_unlock: - mutex_unlock(&rp->task_lock); - } - --static struct rtnl_link_stats64 * -+static void - rhine_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - struct rhine_private *rp = netdev_priv(dev); -@@ -2245,8 +2245,6 @@ rhine_get_stats64(struct net_device *dev - stats->tx_packets = rp->tx_stats.packets; - stats->tx_bytes = rp->tx_stats.bytes; - } while (u64_stats_fetch_retry_irq(&rp->tx_stats.syncp, start)); -- -- return stats; - } - - static void rhine_set_rx_mode(struct net_device *dev) ---- a/drivers/net/fjes/fjes_main.c -+++ b/drivers/net/fjes/fjes_main.c -@@ -56,8 +56,7 @@ static void fjes_raise_intr_rxdata_task( - static void fjes_tx_stall_task(struct work_struct *); - static void fjes_force_close_task(struct work_struct *); - static irqreturn_t fjes_intr(int, void*); --static struct rtnl_link_stats64 * --fjes_get_stats64(struct net_device *, struct rtnl_link_stats64 *); -+static void fjes_get_stats64(struct net_device *, struct rtnl_link_stats64 *); - static int fjes_change_mtu(struct net_device *, int); - static int fjes_vlan_rx_add_vid(struct net_device *, __be16 proto, u16); - static int fjes_vlan_rx_kill_vid(struct net_device *, __be16 proto, u16); -@@ -762,14 +761,12 @@ static void fjes_tx_retry(struct net_dev - netif_tx_wake_queue(queue); - } - --static struct rtnl_link_stats64 * -+static void - fjes_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats) - { - struct fjes_adapter *adapter = netdev_priv(netdev); - - memcpy(stats, &adapter->stats64, sizeof(struct rtnl_link_stats64)); -- -- return stats; - } - - static int fjes_change_mtu(struct net_device *netdev, int new_mtu) ---- a/drivers/net/hyperv/netvsc_drv.c -+++ b/drivers/net/hyperv/netvsc_drv.c -@@ -918,8 +918,8 @@ out: - return ret; - } - --static struct rtnl_link_stats64 *netvsc_get_stats64(struct net_device *net, -- struct rtnl_link_stats64 *t) -+static void netvsc_get_stats64(struct net_device *net, -+ struct rtnl_link_stats64 *t) - { - struct net_device_context *ndev_ctx = netdev_priv(net); - int cpu; -@@ -957,8 +957,6 @@ static struct rtnl_link_stats64 *netvsc_ - - t->rx_dropped = net->stats.rx_dropped; - t->rx_errors = net->stats.rx_errors; -- -- return t; - } - - static int netvsc_set_mac_addr(struct net_device *ndev, void *p) ---- a/drivers/net/ifb.c -+++ b/drivers/net/ifb.c -@@ -129,8 +129,8 @@ resched: - - } - --static struct rtnl_link_stats64 *ifb_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void ifb_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct ifb_dev_private *dp = netdev_priv(dev); - struct ifb_q_private *txp = dp->tx_private; -@@ -157,8 +157,6 @@ static struct rtnl_link_stats64 *ifb_sta - } - stats->rx_dropped = dev->stats.rx_dropped; - stats->tx_dropped = dev->stats.tx_dropped; -- -- return stats; - } - - static int ifb_dev_init(struct net_device *dev) ---- a/drivers/net/ipvlan/ipvlan_main.c -+++ b/drivers/net/ipvlan/ipvlan_main.c -@@ -296,8 +296,8 @@ static void ipvlan_set_multicast_mac_fil - dev_mc_sync(ipvlan->phy_dev, dev); - } - --static struct rtnl_link_stats64 *ipvlan_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *s) -+static void ipvlan_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *s) - { - struct ipvl_dev *ipvlan = netdev_priv(dev); - -@@ -334,7 +334,6 @@ static struct rtnl_link_stats64 *ipvlan_ - s->rx_dropped = rx_errs; - s->tx_dropped = tx_drps; - } -- return s; - } - - static int ipvlan_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) ---- a/drivers/net/loopback.c -+++ b/drivers/net/loopback.c -@@ -97,8 +97,8 @@ static netdev_tx_t loopback_xmit(struct - return NETDEV_TX_OK; - } - --static struct rtnl_link_stats64 *loopback_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void loopback_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - u64 bytes = 0; - u64 packets = 0; -@@ -122,7 +122,6 @@ static struct rtnl_link_stats64 *loopbac - stats->tx_packets = packets; - stats->rx_bytes = bytes; - stats->tx_bytes = bytes; -- return stats; - } - - static u32 always_on(struct net_device *dev) ---- a/drivers/net/macsec.c -+++ b/drivers/net/macsec.c -@@ -2899,13 +2899,13 @@ static int macsec_change_mtu(struct net_ - return 0; - } - --static struct rtnl_link_stats64 *macsec_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *s) -+static void macsec_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *s) - { - int cpu; - - if (!dev->tstats) -- return s; -+ return; - - for_each_possible_cpu(cpu) { - struct pcpu_sw_netstats *stats; -@@ -2929,8 +2929,6 @@ static struct rtnl_link_stats64 *macsec_ - - s->rx_dropped = dev->stats.rx_dropped; - s->tx_dropped = dev->stats.tx_dropped; -- -- return s; - } - - static int macsec_get_iflink(const struct net_device *dev) ---- a/drivers/net/macvlan.c -+++ b/drivers/net/macvlan.c -@@ -857,8 +857,8 @@ static void macvlan_uninit(struct net_de - macvlan_port_destroy(port->dev); - } - --static struct rtnl_link_stats64 *macvlan_dev_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void macvlan_dev_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct macvlan_dev *vlan = netdev_priv(dev); - -@@ -895,7 +895,6 @@ static struct rtnl_link_stats64 *macvlan - stats->rx_dropped = rx_errors; - stats->tx_dropped = tx_dropped; - } -- return stats; - } - - static int macvlan_vlan_rx_add_vid(struct net_device *dev, ---- a/drivers/net/nlmon.c -+++ b/drivers/net/nlmon.c -@@ -76,7 +76,7 @@ static int nlmon_close(struct net_device - return netlink_remove_tap(&nlmon->nt); - } - --static struct rtnl_link_stats64 * -+static void - nlmon_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - int i; -@@ -104,8 +104,6 @@ nlmon_get_stats64(struct net_device *dev - - stats->rx_bytes = bytes; - stats->tx_bytes = 0; -- -- return stats; - } - - static u32 always_on(struct net_device *dev) ---- a/drivers/net/ppp/ppp_generic.c -+++ b/drivers/net/ppp/ppp_generic.c -@@ -1312,7 +1312,7 @@ ppp_net_ioctl(struct net_device *dev, st - return err; - } - --static struct rtnl_link_stats64* -+static void - ppp_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats64) - { - struct ppp *ppp = netdev_priv(dev); -@@ -1332,8 +1332,6 @@ ppp_get_stats64(struct net_device *dev, - stats64->rx_dropped = dev->stats.rx_dropped; - stats64->tx_dropped = dev->stats.tx_dropped; - stats64->rx_length_errors = dev->stats.rx_length_errors; -- -- return stats64; - } - - static int ppp_dev_init(struct net_device *dev) ---- a/drivers/net/slip/slip.c -+++ b/drivers/net/slip/slip.c -@@ -571,7 +571,7 @@ static int sl_change_mtu(struct net_devi - - /* Netdevice get statistics request */ - --static struct rtnl_link_stats64 * -+static void - sl_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - struct net_device_stats *devstats = &dev->stats; -@@ -602,7 +602,6 @@ sl_get_stats64(struct net_device *dev, s - stats->collisions += comp->sls_o_misses; - } - #endif -- return stats; - } - - /* Netdevice register callback */ ---- a/drivers/net/team/team.c -+++ b/drivers/net/team/team.c -@@ -1798,7 +1798,7 @@ unwind: - return err; - } - --static struct rtnl_link_stats64 * -+static void - team_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - struct team *team = netdev_priv(dev); -@@ -1835,7 +1835,6 @@ team_get_stats64(struct net_device *dev, - stats->rx_dropped = rx_dropped; - stats->tx_dropped = tx_dropped; - stats->rx_nohandler = rx_nohandler; -- return stats; - } - - static int team_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) ---- a/drivers/net/tun.c -+++ b/drivers/net/tun.c -@@ -983,7 +983,7 @@ static void tun_set_headroom(struct net_ - tun->align = new_hr; - } - --static struct rtnl_link_stats64 * -+static void - tun_net_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - u32 rx_dropped = 0, tx_dropped = 0, rx_frame_errors = 0; -@@ -1017,7 +1017,6 @@ tun_net_get_stats64(struct net_device *d - stats->rx_dropped = rx_dropped; - stats->rx_frame_errors = rx_frame_errors; - stats->tx_dropped = tx_dropped; -- return stats; - } - - static const struct net_device_ops tun_netdev_ops = { ---- a/drivers/net/veth.c -+++ b/drivers/net/veth.c -@@ -161,8 +161,8 @@ static u64 veth_stats_one(struct pcpu_vs - return atomic64_read(&priv->dropped); - } - --static struct rtnl_link_stats64 *veth_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *tot) -+static void veth_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *tot) - { - struct veth_priv *priv = netdev_priv(dev); - struct net_device *peer; -@@ -180,8 +180,6 @@ static struct rtnl_link_stats64 *veth_ge - tot->rx_packets = one.packets; - } - rcu_read_unlock(); -- -- return tot; - } - - /* fake multicast ability */ ---- a/drivers/net/virtio_net.c -+++ b/drivers/net/virtio_net.c -@@ -1017,8 +1017,8 @@ out: - return ret; - } - --static struct rtnl_link_stats64 *virtnet_stats(struct net_device *dev, -- struct rtnl_link_stats64 *tot) -+static void virtnet_stats(struct net_device *dev, -+ struct rtnl_link_stats64 *tot) - { - struct virtnet_info *vi = netdev_priv(dev); - int cpu; -@@ -1051,8 +1051,6 @@ static struct rtnl_link_stats64 *virtnet - tot->rx_dropped = dev->stats.rx_dropped; - tot->rx_length_errors = dev->stats.rx_length_errors; - tot->rx_frame_errors = dev->stats.rx_frame_errors; -- -- return tot; - } - - #ifdef CONFIG_NET_POLL_CONTROLLER ---- a/drivers/net/vmxnet3/vmxnet3_ethtool.c -+++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c -@@ -113,7 +113,7 @@ vmxnet3_global_stats[] = { - }; - - --struct rtnl_link_stats64 * -+void - vmxnet3_get_stats64(struct net_device *netdev, - struct rtnl_link_stats64 *stats) - { -@@ -160,8 +160,6 @@ vmxnet3_get_stats64(struct net_device *n - stats->rx_dropped += drvRxStats->drop_total; - stats->multicast += devRxStats->mcastPktsRxOK; - } -- -- return stats; - } - - static int ---- a/drivers/net/vmxnet3/vmxnet3_int.h -+++ b/drivers/net/vmxnet3/vmxnet3_int.h -@@ -466,8 +466,8 @@ vmxnet3_create_queues(struct vmxnet3_ada - - void vmxnet3_set_ethtool_ops(struct net_device *netdev); - --struct rtnl_link_stats64 * --vmxnet3_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats); -+void vmxnet3_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats); - - extern char vmxnet3_driver_name[]; - #endif ---- a/drivers/net/vrf.c -+++ b/drivers/net/vrf.c -@@ -79,8 +79,8 @@ static void vrf_tx_error(struct net_devi - kfree_skb(skb); - } - --static struct rtnl_link_stats64 *vrf_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void vrf_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - int i; - -@@ -104,7 +104,6 @@ static struct rtnl_link_stats64 *vrf_get - stats->rx_bytes += rbytes; - stats->rx_packets += rpkts; - } -- return stats; - } - - /* Local traffic destined to local address. Reinsert the packet to rx ---- a/drivers/net/xen-netfront.c -+++ b/drivers/net/xen-netfront.c -@@ -1081,8 +1081,8 @@ static int xennet_change_mtu(struct net_ - return 0; - } - --static struct rtnl_link_stats64 *xennet_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *tot) -+static void xennet_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *tot) - { - struct netfront_info *np = netdev_priv(dev); - int cpu; -@@ -1113,8 +1113,6 @@ static struct rtnl_link_stats64 *xennet_ - - tot->rx_errors = dev->stats.rx_errors; - tot->tx_dropped = dev->stats.tx_dropped; -- -- return tot; - } - - static void xennet_release_tx_bufs(struct netfront_queue *queue) ---- a/drivers/staging/netlogic/xlr_net.c -+++ b/drivers/staging/netlogic/xlr_net.c -@@ -395,14 +395,6 @@ static void xlr_stats(struct net_device - TX_DROP_FRAME_COUNTER); - } - --static struct rtnl_link_stats64 *xlr_get_stats64(struct net_device *ndev, -- struct rtnl_link_stats64 *stats -- ) --{ -- xlr_stats(ndev, stats); -- return stats; --} -- - static const struct net_device_ops xlr_netdev_ops = { - .ndo_open = xlr_net_open, - .ndo_stop = xlr_net_stop, -@@ -410,7 +402,7 @@ static const struct net_device_ops xlr_n - .ndo_select_queue = xlr_net_select_queue, - .ndo_set_mac_address = xlr_net_set_mac_addr, - .ndo_set_rx_mode = xlr_set_rx_mode, -- .ndo_get_stats64 = xlr_get_stats64, -+ .ndo_get_stats64 = xlr_stats, - }; - - /* ---- a/include/linux/device.h -+++ b/include/linux/device.h -@@ -688,6 +688,25 @@ void __iomem *devm_ioremap_resource(stru - int devm_add_action(struct device *dev, void (*action)(void *), void *data); - void devm_remove_action(struct device *dev, void (*action)(void *), void *data); - -+/** -+ * devm_alloc_percpu - Resource-managed alloc_percpu -+ * @dev: Device to allocate per-cpu memory for -+ * @type: Type to allocate per-cpu memory for -+ * -+ * Managed alloc_percpu. Per-cpu memory allocated with this function is -+ * automatically freed on driver detach. -+ * -+ * RETURNS: -+ * Pointer to allocated memory on success, NULL on failure. -+ */ -+#define devm_alloc_percpu(dev, type) \ -+ ((typeof(type) __percpu *)__devm_alloc_percpu((dev), sizeof(type), \ -+ __alignof__(type))) -+ -+void __percpu *__devm_alloc_percpu(struct device *dev, size_t size, -+ size_t align); -+void devm_free_percpu(struct device *dev, void __percpu *pdata); -+ - static inline int devm_add_action_or_reset(struct device *dev, - void (*action)(void *), void *data) - { ---- /dev/null -+++ b/include/linux/fsl/svr.h -@@ -0,0 +1,97 @@ -+/* -+ * MPC85xx cpu type detection -+ * -+ * Copyright 2011-2012 Freescale Semiconductor, Inc. -+ * -+ * This is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ */ -+ -+#ifndef FSL_SVR_H -+#define FSL_SVR_H -+ -+#define SVR_REV(svr) ((svr) & 0xFF) /* SOC design resision */ -+#define SVR_MAJ(svr) (((svr) >> 4) & 0xF) /* Major revision field*/ -+#define SVR_MIN(svr) (((svr) >> 0) & 0xF) /* Minor revision field*/ -+ -+/* Some parts define SVR[0:23] as the SOC version */ -+#define SVR_SOC_VER(svr) (((svr) >> 8) & 0xFFF7FF) /* SOC Version fields */ -+ -+#define SVR_8533 0x803400 -+#define SVR_8535 0x803701 -+#define SVR_8536 0x803700 -+#define SVR_8540 0x803000 -+#define SVR_8541 0x807200 -+#define SVR_8543 0x803200 -+#define SVR_8544 0x803401 -+#define SVR_8545 0x803102 -+#define SVR_8547 0x803101 -+#define SVR_8548 0x803100 -+#define SVR_8555 0x807100 -+#define SVR_8560 0x807000 -+#define SVR_8567 0x807501 -+#define SVR_8568 0x807500 -+#define SVR_8569 0x808000 -+#define SVR_8572 0x80E000 -+#define SVR_P1010 0x80F100 -+#define SVR_P1011 0x80E500 -+#define SVR_P1012 0x80E501 -+#define SVR_P1013 0x80E700 -+#define SVR_P1014 0x80F101 -+#define SVR_P1017 0x80F700 -+#define SVR_P1020 0x80E400 -+#define SVR_P1021 0x80E401 -+#define SVR_P1022 0x80E600 -+#define SVR_P1023 0x80F600 -+#define SVR_P1024 0x80E402 -+#define SVR_P1025 0x80E403 -+#define SVR_P2010 0x80E300 -+#define SVR_P2020 0x80E200 -+#define SVR_P2040 0x821000 -+#define SVR_P2041 0x821001 -+#define SVR_P3041 0x821103 -+#define SVR_P4040 0x820100 -+#define SVR_P4080 0x820000 -+#define SVR_P5010 0x822100 -+#define SVR_P5020 0x822000 -+#define SVR_P5021 0X820500 -+#define SVR_P5040 0x820400 -+#define SVR_T4240 0x824000 -+#define SVR_T4120 0x824001 -+#define SVR_T4160 0x824100 -+#define SVR_T4080 0x824102 -+#define SVR_C291 0x850000 -+#define SVR_C292 0x850020 -+#define SVR_C293 0x850030 -+#define SVR_B4860 0X868000 -+#define SVR_G4860 0x868001 -+#define SVR_G4060 0x868003 -+#define SVR_B4440 0x868100 -+#define SVR_G4440 0x868101 -+#define SVR_B4420 0x868102 -+#define SVR_B4220 0x868103 -+#define SVR_T1040 0x852000 -+#define SVR_T1041 0x852001 -+#define SVR_T1042 0x852002 -+#define SVR_T1020 0x852100 -+#define SVR_T1021 0x852101 -+#define SVR_T1022 0x852102 -+#define SVR_T1023 0x854100 -+#define SVR_T1024 0x854000 -+#define SVR_T2080 0x853000 -+#define SVR_T2081 0x853100 -+ -+#define SVR_8610 0x80A000 -+#define SVR_8641 0x809000 -+#define SVR_8641D 0x809001 -+ -+#define SVR_9130 0x860001 -+#define SVR_9131 0x860000 -+#define SVR_9132 0x861000 -+#define SVR_9232 0x861400 -+ -+#define SVR_Unknown 0xFFFFFF -+ -+#endif ---- a/include/linux/fsl_devices.h -+++ b/include/linux/fsl_devices.h -@@ -99,7 +99,10 @@ struct fsl_usb2_platform_data { - unsigned suspended:1; - unsigned already_suspended:1; - unsigned has_fsl_erratum_a007792:1; -+ unsigned has_fsl_erratum_14:1; - unsigned has_fsl_erratum_a005275:1; -+ unsigned has_fsl_erratum_a006918:1; -+ unsigned has_fsl_erratum_a005697:1; - unsigned check_phy_clk_valid:1; - - /* register save area for suspend/resume */ ---- a/include/linux/netdev_features.h -+++ b/include/linux/netdev_features.h -@@ -74,6 +74,7 @@ enum { - NETIF_F_BUSY_POLL_BIT, /* Busy poll */ - - NETIF_F_HW_TC_BIT, /* Offload TC infrastructure */ -+ NETIF_F_HW_ACCEL_MQ_BIT, /* Hardware-accelerated multiqueue */ - - /* - * Add your fresh new feature above and remember to update -@@ -136,6 +137,7 @@ enum { - #define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD) - #define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL) - #define NETIF_F_HW_TC __NETIF_F(HW_TC) -+#define NETIF_F_HW_ACCEL_MQ __NETIF_F(HW_ACCEL_MQ) - - #define for_each_netdev_feature(mask_addr, bit) \ - for_each_set_bit(bit, (unsigned long *)mask_addr, NETDEV_FEATURE_COUNT) ---- a/include/linux/netdevice.h -+++ b/include/linux/netdevice.h -@@ -916,8 +916,8 @@ struct netdev_xdp { - * Callback used when the transmitter has not made any progress - * for dev->watchdog ticks. - * -- * struct rtnl_link_stats64* (*ndo_get_stats64)(struct net_device *dev, -- * struct rtnl_link_stats64 *storage); -+ * void (*ndo_get_stats64)(struct net_device *dev, -+ * struct rtnl_link_stats64 *storage); - * struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); - * Called when a user wants to get the network device usage - * statistics. Drivers must do one of the following: -@@ -1165,8 +1165,8 @@ struct net_device_ops { - struct neigh_parms *); - void (*ndo_tx_timeout) (struct net_device *dev); - -- struct rtnl_link_stats64* (*ndo_get_stats64)(struct net_device *dev, -- struct rtnl_link_stats64 *storage); -+ void (*ndo_get_stats64)(struct net_device *dev, -+ struct rtnl_link_stats64 *storage); - bool (*ndo_has_offload_stats)(int attr_id); - int (*ndo_get_offload_stats)(int attr_id, - const struct net_device *dev, -@@ -1509,6 +1509,8 @@ enum netdev_priv_flags { - * @if_port: Selectable AUI, TP, ... - * @dma: DMA channel - * @mtu: Interface MTU value -+ * @min_mtu: Interface Minimum MTU value -+ * @max_mtu: Interface Maximum MTU value - * @type: Interface hardware type - * @hard_header_len: Maximum hardware header length. - * @min_header_len: Minimum hardware header length -@@ -1735,6 +1737,8 @@ struct net_device { - unsigned char dma; - - unsigned int mtu; -+ unsigned int min_mtu; -+ unsigned int max_mtu; - unsigned short type; - unsigned short hard_header_len; - unsigned short min_header_len; ---- a/include/linux/skbuff.h -+++ b/include/linux/skbuff.h -@@ -903,6 +903,7 @@ void kfree_skb(struct sk_buff *skb); - void kfree_skb_list(struct sk_buff *segs); - void skb_tx_error(struct sk_buff *skb); - void consume_skb(struct sk_buff *skb); -+void skb_recycle(struct sk_buff *skb); - void __kfree_skb(struct sk_buff *skb); - extern struct kmem_cache *skbuff_head_cache; - -@@ -3057,6 +3058,7 @@ static inline void skb_free_datagram_loc - } - int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags); - int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len); -+void copy_skb_header(struct sk_buff *new, const struct sk_buff *old); - int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len); - __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, u8 *to, - int len, __wsum csum); ---- a/include/linux/sys_soc.h -+++ b/include/linux/sys_soc.h -@@ -13,6 +13,7 @@ struct soc_device_attribute { - const char *family; - const char *revision; - const char *soc_id; -+ const void *data; - }; - - /** -@@ -34,4 +35,6 @@ void soc_device_unregister(struct soc_de - */ - struct device *soc_device_to_device(struct soc_device *soc); - -+const struct soc_device_attribute *soc_device_match( -+ const struct soc_device_attribute *matches); - #endif /* __SOC_BUS_H */ ---- a/include/net/ip_tunnels.h -+++ b/include/net/ip_tunnels.h -@@ -261,8 +261,8 @@ int ip_tunnel_ioctl(struct net_device *d - int __ip_tunnel_change_mtu(struct net_device *dev, int new_mtu, bool strict); - int ip_tunnel_change_mtu(struct net_device *dev, int new_mtu); - --struct rtnl_link_stats64 *ip_tunnel_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *tot); -+void ip_tunnel_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *tot); - struct ip_tunnel *ip_tunnel_lookup(struct ip_tunnel_net *itn, - int link, __be16 flags, - __be32 remote, __be32 local, ---- a/include/uapi/linux/if_ether.h -+++ b/include/uapi/linux/if_ether.h -@@ -35,6 +35,7 @@ - #define ETH_DATA_LEN 1500 /* Max. octets in payload */ - #define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */ - #define ETH_FCS_LEN 4 /* Octets in the FCS */ -+#define ETH_MIN_MTU 68 /* Min IPv4 MTU per RFC791 */ - - /* - * These are the defined Ethernet Protocol ID's. ---- a/net/8021q/vlan_dev.c -+++ b/net/8021q/vlan_dev.c -@@ -671,7 +671,8 @@ static int vlan_ethtool_get_ts_info(stru - return 0; - } - --static struct rtnl_link_stats64 *vlan_dev_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) -+static void vlan_dev_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct vlan_pcpu_stats *p; - u32 rx_errors = 0, tx_dropped = 0; -@@ -702,8 +703,6 @@ static struct rtnl_link_stats64 *vlan_de - } - stats->rx_errors = rx_errors; - stats->tx_dropped = tx_dropped; -- -- return stats; - } - - #ifdef CONFIG_NET_POLL_CONTROLLER ---- a/net/bridge/br_device.c -+++ b/net/bridge/br_device.c -@@ -156,8 +156,8 @@ static int br_dev_stop(struct net_device - return 0; - } - --static struct rtnl_link_stats64 *br_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void br_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct net_bridge *br = netdev_priv(dev); - struct pcpu_sw_netstats tmp, sum = { 0 }; -@@ -181,8 +181,6 @@ static struct rtnl_link_stats64 *br_get_ - stats->tx_packets = sum.tx_packets; - stats->rx_bytes = sum.rx_bytes; - stats->rx_packets = sum.rx_packets; -- -- return stats; - } - - static int br_change_mtu(struct net_device *dev, int new_mtu) ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -6603,9 +6603,18 @@ int dev_set_mtu(struct net_device *dev, - if (new_mtu == dev->mtu) - return 0; - -- /* MTU must be positive. */ -- if (new_mtu < 0) -+ /* MTU must be positive, and in range */ -+ if (new_mtu < 0 || new_mtu < dev->min_mtu) { -+ net_err_ratelimited("%s: Invalid MTU %d requested, hw min %d\n", -+ dev->name, new_mtu, dev->min_mtu); - return -EINVAL; -+ } -+ -+ if (dev->max_mtu > 0 && new_mtu > dev->max_mtu) { -+ net_err_ratelimited("%s: Invalid MTU %d requested, hw max %d\n", -+ dev->name, new_mtu, dev->min_mtu); -+ return -EINVAL; -+ } - - if (!netif_device_present(dev)) - return -ENODEV; ---- a/net/core/skbuff.c -+++ b/net/core/skbuff.c -@@ -842,6 +842,32 @@ void napi_consume_skb(struct sk_buff *sk - } - EXPORT_SYMBOL(napi_consume_skb); - -+/** -+ * skb_recycle - clean up an skb for reuse -+ * @skb: buffer -+ * -+ * Recycles the skb to be reused as a receive buffer. This -+ * function does any necessary reference count dropping, and -+ * cleans up the skbuff as if it just came from __alloc_skb(). -+ */ -+void skb_recycle(struct sk_buff *skb) -+{ -+ struct skb_shared_info *shinfo; -+ u8 head_frag = skb->head_frag; -+ -+ skb_release_head_state(skb); -+ -+ shinfo = skb_shinfo(skb); -+ memset(shinfo, 0, offsetof(struct skb_shared_info, dataref)); -+ atomic_set(&shinfo->dataref, 1); -+ -+ memset(skb, 0, offsetof(struct sk_buff, tail)); -+ skb->data = skb->head + NET_SKB_PAD; -+ skb->head_frag = head_frag; -+ skb_reset_tail_pointer(skb); -+} -+EXPORT_SYMBOL(skb_recycle); -+ - /* Make sure a field is enclosed inside headers_start/headers_end section */ - #define CHECK_SKB_FIELD(field) \ - BUILD_BUG_ON(offsetof(struct sk_buff, field) < \ -@@ -1073,7 +1099,7 @@ static void skb_headers_offset_update(st - skb->inner_mac_header += off; - } - --static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old) -+void copy_skb_header(struct sk_buff *new, const struct sk_buff *old) - { - __copy_skb_header(new, old); - -@@ -1081,6 +1107,7 @@ static void copy_skb_header(struct sk_bu - skb_shinfo(new)->gso_segs = skb_shinfo(old)->gso_segs; - skb_shinfo(new)->gso_type = skb_shinfo(old)->gso_type; - } -+EXPORT_SYMBOL(copy_skb_header); - - static inline int skb_alloc_rx_flag(const struct sk_buff *skb) - { ---- a/net/ipv4/ip_tunnel_core.c -+++ b/net/ipv4/ip_tunnel_core.c -@@ -188,8 +188,8 @@ int iptunnel_handle_offloads(struct sk_b - EXPORT_SYMBOL_GPL(iptunnel_handle_offloads); - - /* Often modified stats are per cpu, other are shared (netdev->stats) */ --struct rtnl_link_stats64 *ip_tunnel_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *tot) -+void ip_tunnel_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *tot) - { - int i; - -@@ -214,8 +214,6 @@ struct rtnl_link_stats64 *ip_tunnel_get_ - tot->rx_bytes += rx_bytes; - tot->tx_bytes += tx_bytes; - } -- -- return tot; - } - EXPORT_SYMBOL_GPL(ip_tunnel_get_stats64); - ---- a/net/l2tp/l2tp_eth.c -+++ b/net/l2tp/l2tp_eth.c -@@ -106,8 +106,8 @@ static int l2tp_eth_dev_xmit(struct sk_b - return NETDEV_TX_OK; - } - --static struct rtnl_link_stats64 *l2tp_eth_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void l2tp_eth_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct l2tp_eth *priv = netdev_priv(dev); - -@@ -117,10 +117,8 @@ static struct rtnl_link_stats64 *l2tp_et - stats->rx_bytes = atomic_long_read(&priv->rx_bytes); - stats->rx_packets = atomic_long_read(&priv->rx_packets); - stats->rx_errors = atomic_long_read(&priv->rx_errors); -- return stats; - } - -- - static const struct net_device_ops l2tp_eth_netdev_ops = { - .ndo_init = l2tp_eth_dev_init, - .ndo_uninit = l2tp_eth_dev_uninit, ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -1146,7 +1146,7 @@ static u16 ieee80211_netdev_select_queue - return ieee80211_select_queue(IEEE80211_DEV_TO_SUB_IF(dev), skb); - } - --static struct rtnl_link_stats64 * -+static void - ieee80211_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - int i; -@@ -1171,8 +1171,6 @@ ieee80211_get_stats64(struct net_device - stats->rx_bytes += rx_bytes; - stats->tx_bytes += tx_bytes; - } -- -- return stats; - } - - static const struct net_device_ops ieee80211_dataif_ops = { ---- a/net/openvswitch/vport-internal_dev.c -+++ b/net/openvswitch/vport-internal_dev.c -@@ -106,7 +106,7 @@ static void internal_dev_destructor(stru - free_netdev(dev); - } - --static struct rtnl_link_stats64 * -+static void - internal_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - int i; -@@ -134,8 +134,6 @@ internal_get_stats(struct net_device *de - stats->tx_bytes += local_stats.tx_bytes; - stats->tx_packets += local_stats.tx_packets; - } -- -- return stats; - } - - static void internal_set_rx_headroom(struct net_device *dev, int new_hr) ---- a/net/sched/sch_generic.c -+++ b/net/sched/sch_generic.c -@@ -309,6 +309,13 @@ static void dev_watchdog(unsigned long a - txq->trans_timeout++; - break; - } -+ -+ /* Devices with HW_ACCEL_MQ have multiple txqs -+ * but update only the first one's transmission -+ * timestamp so avoid checking the rest. -+ */ -+ if (dev->features & NETIF_F_HW_ACCEL_MQ) -+ break; - } - - if (some_queue_timedout) { ---- a/net/sched/sch_teql.c -+++ b/net/sched/sch_teql.c -@@ -401,8 +401,8 @@ static int teql_master_close(struct net_ - return 0; - } - --static struct rtnl_link_stats64 *teql_master_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void teql_master_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct teql_master *m = netdev_priv(dev); - -@@ -410,7 +410,6 @@ static struct rtnl_link_stats64 *teql_ma - stats->tx_bytes = m->tx_bytes; - stats->tx_errors = m->tx_errors; - stats->tx_dropped = m->tx_dropped; -- return stats; - } - - static int teql_master_mtu(struct net_device *dev, int new_mtu) diff --git a/target/linux/layerscape/patches-4.9/701-sdk_dpaa-support-layerscape.patch b/target/linux/layerscape/patches-4.9/701-sdk_dpaa-support-layerscape.patch index 56c07c5e6f..4ebcdc73a0 100644 --- a/target/linux/layerscape/patches-4.9/701-sdk_dpaa-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/701-sdk_dpaa-support-layerscape.patch @@ -1,4 +1,4 @@ -From 6fe4518adbbbab0404958db4aa95673d60174881 Mon Sep 17 00:00:00 2001 +From 3cd36deb674720ab34eabb9783648ed743e52121 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 25 Sep 2017 11:58:03 +0800 Subject: [PATCH] sdk_dpaa: support layerscape @@ -18,15 +18,15 @@ Signed-off-by: Yangbo Lu .../net/ethernet/freescale/sdk_dpaa/dpaa_debugfs.c | 180 + .../net/ethernet/freescale/sdk_dpaa/dpaa_debugfs.h | 43 + drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.c | 1213 ++++ - drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h | 698 ++ + drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h | 687 ++ .../ethernet/freescale/sdk_dpaa/dpaa_eth_base.c | 205 + .../ethernet/freescale/sdk_dpaa/dpaa_eth_base.h | 49 + .../ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.c | 1992 +++++ .../ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.h | 237 + - .../ethernet/freescale/sdk_dpaa/dpaa_eth_common.c | 1811 +++++ + .../ethernet/freescale/sdk_dpaa/dpaa_eth_common.c | 1820 +++++ .../ethernet/freescale/sdk_dpaa/dpaa_eth_common.h | 225 + .../ethernet/freescale/sdk_dpaa/dpaa_eth_proxy.c | 381 + - .../net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c | 1179 +++ + .../net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c | 1168 +++ .../ethernet/freescale/sdk_dpaa/dpaa_eth_sysfs.c | 278 + .../ethernet/freescale/sdk_dpaa/dpaa_eth_trace.h | 144 + .../net/ethernet/freescale/sdk_dpaa/dpaa_ethtool.c | 544 ++ @@ -41,24 +41,24 @@ Signed-off-by: Yangbo Lu .../freescale/sdk_fman/Peripherals/FM/HC/Makefile | 15 + .../freescale/sdk_fman/Peripherals/FM/HC/hc.c | 1232 ++++ .../freescale/sdk_fman/Peripherals/FM/MAC/Makefile | 28 + - .../freescale/sdk_fman/Peripherals/FM/MAC/dtsec.c | 1464 ++++ + .../freescale/sdk_fman/Peripherals/FM/MAC/dtsec.c | 1465 ++++ .../freescale/sdk_fman/Peripherals/FM/MAC/dtsec.h | 228 + .../sdk_fman/Peripherals/FM/MAC/dtsec_mii_acc.c | 97 + .../sdk_fman/Peripherals/FM/MAC/dtsec_mii_acc.h | 42 + - .../freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.c | 658 ++ - .../freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.h | 225 + + .../freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.c | 674 ++ + .../freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.h | 226 + .../sdk_fman/Peripherals/FM/MAC/fman_crc32.c | 119 + .../sdk_fman/Peripherals/FM/MAC/fman_crc32.h | 43 + .../sdk_fman/Peripherals/FM/MAC/fman_dtsec.c | 845 +++ .../Peripherals/FM/MAC/fman_dtsec_mii_acc.c | 163 + - .../sdk_fman/Peripherals/FM/MAC/fman_memac.c | 511 ++ + .../sdk_fman/Peripherals/FM/MAC/fman_memac.c | 532 ++ .../Peripherals/FM/MAC/fman_memac_mii_acc.c | 213 + .../sdk_fman/Peripherals/FM/MAC/fman_tgec.c | 367 + - .../freescale/sdk_fman/Peripherals/FM/MAC/memac.c | 1096 +++ + .../freescale/sdk_fman/Peripherals/FM/MAC/memac.c | 1153 +++ .../freescale/sdk_fman/Peripherals/FM/MAC/memac.h | 110 + .../sdk_fman/Peripherals/FM/MAC/memac_mii_acc.c | 78 + .../sdk_fman/Peripherals/FM/MAC/memac_mii_acc.h | 73 + - .../freescale/sdk_fman/Peripherals/FM/MAC/tgec.c | 975 +++ + .../freescale/sdk_fman/Peripherals/FM/MAC/tgec.c | 1017 +++ .../freescale/sdk_fman/Peripherals/FM/MAC/tgec.h | 151 + .../sdk_fman/Peripherals/FM/MAC/tgec_mii_acc.c | 139 + .../sdk_fman/Peripherals/FM/MAC/tgec_mii_acc.h | 80 + @@ -124,7 +124,7 @@ Signed-off-by: Yangbo Lu .../sdk_fman/inc/Peripherals/crc_mac_addr_ext.h | 364 + .../freescale/sdk_fman/inc/Peripherals/dpaa_ext.h | 210 + .../freescale/sdk_fman/inc/Peripherals/fm_ext.h | 1731 +++++ - .../sdk_fman/inc/Peripherals/fm_mac_ext.h | 859 +++ + .../sdk_fman/inc/Peripherals/fm_mac_ext.h | 887 +++ .../sdk_fman/inc/Peripherals/fm_macsec_ext.h | 1271 ++++ .../sdk_fman/inc/Peripherals/fm_muram_ext.h | 170 + .../sdk_fman/inc/Peripherals/fm_pcd_ext.h | 3974 ++++++++++ @@ -154,7 +154,7 @@ Signed-off-by: Yangbo Lu .../freescale/sdk_fman/inc/flib/fsl_fman_dtsec.h | 1096 +++ .../sdk_fman/inc/flib/fsl_fman_dtsec_mii_acc.h | 107 + .../freescale/sdk_fman/inc/flib/fsl_fman_kg.h | 514 ++ - .../freescale/sdk_fman/inc/flib/fsl_fman_memac.h | 427 ++ + .../freescale/sdk_fman/inc/flib/fsl_fman_memac.h | 434 ++ .../sdk_fman/inc/flib/fsl_fman_memac_mii_acc.h | 78 + .../freescale/sdk_fman/inc/flib/fsl_fman_port.h | 593 ++ .../freescale/sdk_fman/inc/flib/fsl_fman_prs.h | 102 + @@ -195,7 +195,7 @@ Signed-off-by: Yangbo Lu .../freescale/sdk_fman/src/inc/system/sys_io_ext.h | 46 + .../freescale/sdk_fman/src/inc/types_linux.h | 208 + .../sdk_fman/src/inc/wrapper/fsl_fman_test.h | 84 + - .../sdk_fman/src/inc/wrapper/lnxwrp_exp_sym.h | 128 + + .../sdk_fman/src/inc/wrapper/lnxwrp_exp_sym.h | 130 + .../sdk_fman/src/inc/wrapper/lnxwrp_fm_ext.h | 163 + .../sdk_fman/src/inc/wrapper/lnxwrp_fsl_fman.h | 921 +++ .../ethernet/freescale/sdk_fman/src/inc/xx/xx.h | 50 + @@ -206,7 +206,7 @@ Signed-off-by: Yangbo Lu .../freescale/sdk_fman/src/wrapper/lnxwrp_fm.c | 2908 ++++++++ .../freescale/sdk_fman/src/wrapper/lnxwrp_fm.h | 294 + .../sdk_fman/src/wrapper/lnxwrp_fm_port.c | 1480 ++++ - .../sdk_fman/src/wrapper/lnxwrp_ioctls_fm.c | 4813 +++++++++++++ + .../sdk_fman/src/wrapper/lnxwrp_ioctls_fm.c | 4854 +++++++++++++ .../sdk_fman/src/wrapper/lnxwrp_ioctls_fm_compat.c | 1297 ++++ .../sdk_fman/src/wrapper/lnxwrp_ioctls_fm_compat.h | 755 ++ .../sdk_fman/src/wrapper/lnxwrp_resources.h | 121 + @@ -262,13 +262,13 @@ Signed-off-by: Yangbo Lu include/uapi/linux/fmd/Peripherals/Kbuild | 4 + include/uapi/linux/fmd/Peripherals/fm_ioctls.h | 628 ++ include/uapi/linux/fmd/Peripherals/fm_pcd_ioctls.h | 3084 ++++++++ - .../uapi/linux/fmd/Peripherals/fm_port_ioctls.h | 948 +++ + .../uapi/linux/fmd/Peripherals/fm_port_ioctls.h | 973 +++ .../uapi/linux/fmd/Peripherals/fm_test_ioctls.h | 208 + include/uapi/linux/fmd/integrations/Kbuild | 1 + .../linux/fmd/integrations/integration_ioctls.h | 56 + include/uapi/linux/fmd/ioctls.h | 96 + include/uapi/linux/fmd/net_ioctls.h | 430 ++ - 257 files changed, 152931 insertions(+) + 257 files changed, 153159 insertions(+) create mode 100644 drivers/net/ethernet/freescale/sdk_dpaa/Kconfig create mode 100644 drivers/net/ethernet/freescale/sdk_dpaa/Makefile create mode 100644 drivers/net/ethernet/freescale/sdk_dpaa/dpaa_1588.c @@ -2923,7 +2923,7 @@ Signed-off-by: Yangbo Lu +module_exit(dpa_unload); --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h -@@ -0,0 +1,698 @@ +@@ -0,0 +1,687 @@ +/* Copyright 2008-2012 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without @@ -3440,17 +3440,6 @@ Signed-off-by: Yangbo Lu + return fd->offset; +} + -+/* Verifies if the skb length is below the interface MTU */ -+static inline int dpa_check_rx_mtu(struct sk_buff *skb, int mtu) -+{ -+ if (unlikely(skb->len > mtu)) -+ if ((skb->protocol != htons(ETH_P_8021Q)) -+ || (skb->len > mtu + 4)) -+ return -1; -+ -+ return 0; -+} -+ +static inline uint16_t dpa_get_headroom(struct dpa_buffer_layout_s *bl) +{ + uint16_t headroom; @@ -6119,7 +6108,7 @@ Signed-off-by: Yangbo Lu +#endif --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c -@@ -0,0 +1,1811 @@ +@@ -0,0 +1,1820 @@ +/* Copyright 2008-2013 Freescale Semiconductor, Inc. + * + * Redistribution and use in source and binary forms, with or without @@ -6385,7 +6374,16 @@ Signed-off-by: Yangbo Lu + +int dpa_change_mtu(struct net_device *net_dev, int new_mtu) +{ -+ const int max_mtu = dpa_get_max_mtu(); ++ int max_mtu = dpa_get_max_mtu(); ++ ++#ifndef CONFIG_PPC ++ /* Due to the A010022 FMan errata, we can not use contig frames larger ++ * than 4K, nor S/G frames. We need to prevent the user from setting a ++ * large MTU. ++ */ ++ if (unlikely(dpaa_errata_a010022)) ++ max_mtu = DPA_BP_RAW_SIZE; ++#endif + + /* Make sure we don't exceed the Ethernet controller's MAXFRM */ + if (new_mtu < 68 || new_mtu > max_mtu) { @@ -8545,7 +8543,7 @@ Signed-off-by: Yangbo Lu +module_exit(dpa_proxy_unload); --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c -@@ -0,0 +1,1179 @@ +@@ -0,0 +1,1168 @@ +/* Copyright 2012 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without @@ -9164,13 +9162,6 @@ Signed-off-by: Yangbo Lu + (*count_ptr)--; + skb->protocol = eth_type_trans(skb, net_dev); + -+ /* IP Reassembled frames are allowed to be larger than MTU */ -+ if (unlikely(dpa_check_rx_mtu(skb, net_dev->mtu) && -+ !(fd_status & FM_FD_IPR))) { -+ percpu_stats->rx_dropped++; -+ goto drop_bad_frame; -+ } -+ + skb_len = skb->len; + +#ifdef CONFIG_FSL_DPAA_DBG_LOOP @@ -9203,10 +9194,6 @@ Signed-off-by: Yangbo Lu +packet_dropped: + return; + -+drop_bad_frame: -+ dev_kfree_skb(skb); -+ return; -+ +_release_frame: + dpa_fd_release(net_dev, fd); +} @@ -14903,7 +14890,7 @@ Signed-off-by: Yangbo Lu + --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/dtsec.c -@@ -0,0 +1,1464 @@ +@@ -0,0 +1,1465 @@ +/* + * Copyright 2008-2013 Freescale Semiconductor Inc. + * @@ -16295,6 +16282,7 @@ Signed-off-by: Yangbo Lu + + p_FmMacControllerDriver->f_FM_MAC_ResetCounters = DtsecResetCounters; + p_FmMacControllerDriver->f_FM_MAC_GetStatistics = DtsecGetStatistics; ++ p_FmMacControllerDriver->f_FM_MAC_GetFrameSizeCounters = NULL; + + p_FmMacControllerDriver->f_FM_MAC_ModifyMacAddr = DtsecModifyMacAddress; + p_FmMacControllerDriver->f_FM_MAC_AddHashMacAddr = DtsecAddHashMacAddress; @@ -16746,7 +16734,7 @@ Signed-off-by: Yangbo Lu +#endif /* __DTSEC_MII_ACC_H */ --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.c -@@ -0,0 +1,658 @@ +@@ -0,0 +1,674 @@ +/* + * Copyright 2008-2012 Freescale Semiconductor Inc. + * @@ -17210,6 +17198,22 @@ Signed-off-by: Yangbo Lu + +/* ......................................................................... */ + ++t_Error FM_MAC_GetFrameSizeCounters(t_Handle h_FmMac, t_FmMacFrameSizeCounters *p_FrameSizeCounters, e_CommMode type) ++{ ++ t_FmMacControllerDriver *p_FmMacControllerDriver = (t_FmMacControllerDriver *)h_FmMac; ++ ++ SANITY_CHECK_RETURN_ERROR(p_FmMacControllerDriver, E_INVALID_HANDLE); ++ ++ memset(p_FrameSizeCounters, 0, sizeof(t_FmMacFrameSizeCounters)); ++ ++ if (p_FmMacControllerDriver->f_FM_MAC_GetFrameSizeCounters) ++ return p_FmMacControllerDriver->f_FM_MAC_GetFrameSizeCounters(h_FmMac, p_FrameSizeCounters, type); ++ ++ RETURN_ERROR(MINOR, E_NOT_SUPPORTED, NO_MSG); ++} ++ ++/* ......................................................................... */ ++ +t_Error FM_MAC_ModifyMacAddr (t_Handle h_FmMac, t_EnetAddr *p_EnetAddr) +{ + t_FmMacControllerDriver *p_FmMacControllerDriver = (t_FmMacControllerDriver *)h_FmMac; @@ -17407,7 +17411,7 @@ Signed-off-by: Yangbo Lu +#endif /* (defined(DEBUG_ERRORS) && ... */ --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.h -@@ -0,0 +1,225 @@ +@@ -0,0 +1,226 @@ +/* + * Copyright 2008-2012 Freescale Semiconductor Inc. + * @@ -17516,6 +17520,7 @@ Signed-off-by: Yangbo Lu + + t_Error (*f_FM_MAC_ResetCounters) (t_Handle h_FmMac); + t_Error (*f_FM_MAC_GetStatistics) (t_Handle h_FmMac, t_FmMacStatistics *p_Statistics); ++ t_Error (*f_FM_MAC_GetFrameSizeCounters) (t_Handle h_FmMac, t_FmMacFrameSizeCounters *p_FrameSizeCounters, e_CommMode type); + + t_Error (*f_FM_MAC_ModifyMacAddr) (t_Handle h_FmMac, t_EnetAddr *p_EnetAddr); + t_Error (*f_FM_MAC_AddHashMacAddr) (t_Handle h_FmMac, t_EnetAddr *p_EnetAddr); @@ -18817,7 +18822,7 @@ Signed-off-by: Yangbo Lu + --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_memac.c -@@ -0,0 +1,511 @@ +@@ -0,0 +1,532 @@ +/* + * Copyright 2008-2012 Freescale Semiconductor Inc. + * @@ -19180,24 +19185,45 @@ Signed-off-by: Yangbo Lu + case E_MEMAC_COUNTER_R64: + ret_val = GET_MEMAC_CNTR_64(r64); + break; ++ case E_MEMAC_COUNTER_T64: ++ ret_val = GET_MEMAC_CNTR_64(t64); ++ break; + case E_MEMAC_COUNTER_R127: + ret_val = GET_MEMAC_CNTR_64(r127); + break; ++ case E_MEMAC_COUNTER_T127: ++ ret_val = GET_MEMAC_CNTR_64(t127); ++ break; + case E_MEMAC_COUNTER_R255: + ret_val = GET_MEMAC_CNTR_64(r255); + break; ++ case E_MEMAC_COUNTER_T255: ++ ret_val = GET_MEMAC_CNTR_64(t255); ++ break; + case E_MEMAC_COUNTER_R511: + ret_val = GET_MEMAC_CNTR_64(r511); + break; ++ case E_MEMAC_COUNTER_T511: ++ ret_val = GET_MEMAC_CNTR_64(t511); ++ break; + case E_MEMAC_COUNTER_R1023: + ret_val = GET_MEMAC_CNTR_64(r1023); + break; ++ case E_MEMAC_COUNTER_T1023: ++ ret_val = GET_MEMAC_CNTR_64(t1023); ++ break; + case E_MEMAC_COUNTER_R1518: + ret_val = GET_MEMAC_CNTR_64(r1518); + break; ++ case E_MEMAC_COUNTER_T1518: ++ ret_val = GET_MEMAC_CNTR_64(t1518); ++ break; + case E_MEMAC_COUNTER_R1519X: + ret_val = GET_MEMAC_CNTR_64(r1519x); + break; ++ case E_MEMAC_COUNTER_T1519X: ++ ret_val = GET_MEMAC_CNTR_64(t1519x); ++ break; + case E_MEMAC_COUNTER_RFRG: + ret_val = GET_MEMAC_CNTR_64(rfrg); + break; @@ -19917,7 +19943,7 @@ Signed-off-by: Yangbo Lu +} --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/memac.c -@@ -0,0 +1,1096 @@ +@@ -0,0 +1,1153 @@ +/* + * Copyright 2008-2012 Freescale Semiconductor Inc. + * @@ -20513,6 +20539,62 @@ Signed-off-by: Yangbo Lu + +/* ......................................................................... */ + ++static t_Error MemacGetFrameSizeCounters(t_Handle h_Memac, t_FmMacFrameSizeCounters *p_FrameSizeCounters, e_CommMode type) ++{ ++ t_Memac *p_Memac = (t_Memac *)h_Memac; ++ ++ SANITY_CHECK_RETURN_ERROR(p_Memac, E_NULL_POINTER); ++ SANITY_CHECK_RETURN_ERROR(!p_Memac->p_MemacDriverParam, E_INVALID_STATE); ++ SANITY_CHECK_RETURN_ERROR(p_FrameSizeCounters, E_NULL_POINTER); ++ ++ switch (type) ++ { ++ case e_COMM_MODE_NONE: ++ break; ++ ++ case e_COMM_MODE_RX: ++ p_FrameSizeCounters->count_pkts_64 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R64); ++ p_FrameSizeCounters->count_pkts_65_to_127 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R127); ++ p_FrameSizeCounters->count_pkts_128_to_255 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R255); ++ p_FrameSizeCounters->count_pkts_256_to_511 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R511); ++ p_FrameSizeCounters->count_pkts_512_to_1023 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R1023); ++ p_FrameSizeCounters->count_pkts_1024_to_1518 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R1518); ++ p_FrameSizeCounters->count_pkts_1519_to_1522 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R1519X); ++ break; ++ ++ case e_COMM_MODE_TX: ++ p_FrameSizeCounters->count_pkts_64 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T64); ++ p_FrameSizeCounters->count_pkts_65_to_127 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T127); ++ p_FrameSizeCounters->count_pkts_128_to_255 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T255); ++ p_FrameSizeCounters->count_pkts_256_to_511 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T511); ++ p_FrameSizeCounters->count_pkts_512_to_1023 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T1023); ++ p_FrameSizeCounters->count_pkts_1024_to_1518 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T1518); ++ p_FrameSizeCounters->count_pkts_1519_to_1522 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T1519X); ++ break; ++ ++ case e_COMM_MODE_RX_AND_TX: ++ p_FrameSizeCounters->count_pkts_64 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R64) ++ + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T64); ++ p_FrameSizeCounters->count_pkts_65_to_127 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R127) ++ + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T127); ++ p_FrameSizeCounters->count_pkts_128_to_255 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R255) ++ + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T255); ++ p_FrameSizeCounters->count_pkts_256_to_511 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R511) ++ + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T511); ++ p_FrameSizeCounters->count_pkts_512_to_1023 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R1023) ++ + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T1023); ++ p_FrameSizeCounters->count_pkts_1024_to_1518 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R1518) ++ + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T1518); ++ p_FrameSizeCounters->count_pkts_1519_to_1522 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R1519X) ++ + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T1519X); ++ break; ++ } ++ ++ return E_OK; ++} ++ ++/* ......................................................................... */ ++ +static t_Error MemacModifyMacAddress (t_Handle h_Memac, t_EnetAddr *p_EnetAddr) +{ + t_Memac *p_Memac = (t_Memac *)h_Memac; @@ -20945,6 +21027,7 @@ Signed-off-by: Yangbo Lu + + p_FmMacControllerDriver->f_FM_MAC_ResetCounters = MemacResetCounters; + p_FmMacControllerDriver->f_FM_MAC_GetStatistics = MemacGetStatistics; ++ p_FmMacControllerDriver->f_FM_MAC_GetFrameSizeCounters = MemacGetFrameSizeCounters; + + p_FmMacControllerDriver->f_FM_MAC_ModifyMacAddr = MemacModifyMacAddress; + p_FmMacControllerDriver->f_FM_MAC_AddHashMacAddr = MemacAddHashMacAddress; @@ -21286,7 +21369,7 @@ Signed-off-by: Yangbo Lu +#endif /* __MEMAC_MII_ACC_H */ --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/tgec.c -@@ -0,0 +1,975 @@ +@@ -0,0 +1,1017 @@ +/* + * Copyright 2008-2012 Freescale Semiconductor Inc. + * @@ -21727,6 +21810,47 @@ Signed-off-by: Yangbo Lu + +/* ......................................................................... */ + ++static t_Error TgecGetFrameSizeCounters(t_Handle h_Tgec, t_FmMacFrameSizeCounters *p_FrameSizeCounters, e_CommMode type) ++{ ++ t_Tgec *p_Tgec = (t_Tgec *)h_Tgec; ++ struct tgec_regs *p_TgecMemMap; ++ ++ SANITY_CHECK_RETURN_ERROR(p_Tgec, E_NULL_POINTER); ++ SANITY_CHECK_RETURN_ERROR(!p_Tgec->p_TgecDriverParam, E_INVALID_STATE); ++ SANITY_CHECK_RETURN_ERROR(p_FrameSizeCounters, E_NULL_POINTER); ++ ++ p_TgecMemMap = p_Tgec->p_MemMap; ++ ++ switch (type) ++ { ++ case e_COMM_MODE_NONE: ++ break; ++ ++ case e_COMM_MODE_RX: ++ p_FrameSizeCounters->count_pkts_64 = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R64); ++ p_FrameSizeCounters->count_pkts_65_to_127 = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R127); ++ p_FrameSizeCounters->count_pkts_128_to_255 = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R255); ++ p_FrameSizeCounters->count_pkts_256_to_511 = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R511); ++ p_FrameSizeCounters->count_pkts_512_to_1023 = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R1023); ++ p_FrameSizeCounters->count_pkts_1024_to_1518 = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R1518); ++ p_FrameSizeCounters->count_pkts_1519_to_1522 = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R1519X); ++ break; ++ ++ case e_COMM_MODE_TX: ++ //Tx counters not supported ++ break; ++ ++ case e_COMM_MODE_RX_AND_TX: ++ //Tx counters not supported ++ break; ++ } ++ ++ return E_OK; ++} ++ ++ ++/* ......................................................................... */ ++ +static t_Error TgecEnable1588TimeStamp(t_Handle h_Tgec) +{ + t_Tgec *p_Tgec = (t_Tgec *)h_Tgec; @@ -22194,6 +22318,7 @@ Signed-off-by: Yangbo Lu + + p_FmMacControllerDriver->f_FM_MAC_ResetCounters = TgecResetCounters; + p_FmMacControllerDriver->f_FM_MAC_GetStatistics = TgecGetStatistics; ++ p_FmMacControllerDriver->f_FM_MAC_GetFrameSizeCounters = TgecGetFrameSizeCounters; + + p_FmMacControllerDriver->f_FM_MAC_ModifyMacAddr = TgecModifyMacAddress; + p_FmMacControllerDriver->f_FM_MAC_AddHashMacAddr = TgecAddHashMacAddress; @@ -77953,7 +78078,7 @@ Signed-off-by: Yangbo Lu +#endif /* __FM_EXT */ --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_mac_ext.h -@@ -0,0 +1,859 @@ +@@ -0,0 +1,887 @@ +/* + * Copyright 2008-2012 Freescale Semiconductor Inc. + * @@ -78153,6 +78278,19 @@ Signed-off-by: Yangbo Lu + - Other */ +} t_FmMacStatistics; + ++/**************************************************************************//** ++ @Description FM MAC Frame Size Counters ++*//***************************************************************************/ ++typedef struct t_FmMacFrameSizeCounters { ++ ++ uint64_t count_pkts_64; /**< 64 byte frame counter */ ++ uint64_t count_pkts_65_to_127; /**< 65 to 127 byte frame counter */ ++ uint64_t count_pkts_128_to_255; /**< 128 to 255 byte frame counter */ ++ uint64_t count_pkts_256_to_511; /**< 256 to 511 byte frame counter */ ++ uint64_t count_pkts_512_to_1023; /**< 512 to 1023 byte frame counter */ ++ uint64_t count_pkts_1024_to_1518; /**< 1024 to 1518 byte frame counter */ ++ uint64_t count_pkts_1519_to_1522; /**< 1519 to 1522 byte good frame count */ ++} t_FmMacFrameSizeCounters; + +/**************************************************************************//** + @Group FM_mac_init_grp FM MAC Initialization Unit @@ -78610,6 +78748,21 @@ Signed-off-by: Yangbo Lu +t_Error FM_MAC_GetStatistics(t_Handle h_FmMac, t_FmMacStatistics *p_Statistics); + +/**************************************************************************//** ++ @Function FM_MAC_GetFrameSizeCounters ++ ++ @Description get MAC statistics counters for different frame size ++ ++ @Param[in] h_FmMac - A handle to a FM MAC Module. ++ @Param[in] p_FrameSizeCounters - Structure with counters ++ @Param[in] type - Type of counters to be read ++ ++ @Return E_OK on success; Error code otherwise. ++ ++ @Cautions Allowed only following FM_Init(). ++*//***************************************************************************/ ++t_Error FM_MAC_GetFrameSizeCounters(t_Handle h_FmMac, t_FmMacFrameSizeCounters *p_FrameSizeCounters, e_CommMode type); ++ ++/**************************************************************************//** + @Function FM_MAC_ModifyMacAddr + + @Description Replace the main MAC Address @@ -94578,7 +94731,7 @@ Signed-off-by: Yangbo Lu +#endif /* __FSL_FMAN_KG_H */ --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_memac.h -@@ -0,0 +1,427 @@ +@@ -0,0 +1,434 @@ +/* + * Copyright 2008-2012 Freescale Semiconductor Inc. + * @@ -94727,12 +94880,19 @@ Signed-off-by: Yangbo Lu + +enum memac_counters { + E_MEMAC_COUNTER_R64, ++ E_MEMAC_COUNTER_T64, + E_MEMAC_COUNTER_R127, ++ E_MEMAC_COUNTER_T127, + E_MEMAC_COUNTER_R255, ++ E_MEMAC_COUNTER_T255, + E_MEMAC_COUNTER_R511, ++ E_MEMAC_COUNTER_T511, + E_MEMAC_COUNTER_R1023, ++ E_MEMAC_COUNTER_T1023, + E_MEMAC_COUNTER_R1518, ++ E_MEMAC_COUNTER_T1518, + E_MEMAC_COUNTER_R1519X, ++ E_MEMAC_COUNTER_T1519X, + E_MEMAC_COUNTER_RFRG, + E_MEMAC_COUNTER_RJBR, + E_MEMAC_COUNTER_RDRP, @@ -103346,7 +103506,7 @@ Signed-off-by: Yangbo Lu +#endif /* __FSL_FMAN_TEST_H */ --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_fman/src/inc/wrapper/lnxwrp_exp_sym.h -@@ -0,0 +1,128 @@ +@@ -0,0 +1,130 @@ +/* Copyright (c) 2008-2012 Freescale Semiconductor, Inc. + * All rights reserved. + * @@ -103472,6 +103632,8 @@ Signed-off-by: Yangbo Lu +/* FMAN MAC exported routines */ +EXPORT_SYMBOL(FM_MAC_GetStatistics); + ++EXPORT_SYMBOL(FM_MAC_GetFrameSizeCounters); ++ +EXPORT_SYMBOL(FM_GetSpecialOperationCoding); + +#endif /* __LNXWRP_EXP_SYM_H */ @@ -111188,7 +111350,7 @@ Signed-off-by: Yangbo Lu +module_exit(fm_port_unload); --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_ioctls_fm.c -@@ -0,0 +1,4813 @@ +@@ -0,0 +1,4854 @@ +/* + * Copyright 2008-2012 Freescale Semiconductor Inc. + * @@ -115799,6 +115961,47 @@ Signed-off-by: Yangbo Lu + break; + } + ++ case FM_PORT_IOC_GET_MAC_FRAME_SIZE_COUNTERS: ++ { ++ t_LnxWrpFmDev *p_LnxWrpFmDev = ++ (t_LnxWrpFmDev *)p_LnxWrpFmPortDev->h_LnxWrpFmDev; ++ ioc_fm_port_mac_frame_size_counters_t param; ++ t_FmMacFrameSizeCounters frameSizeCounters; ++ int mac_id = p_LnxWrpFmPortDev->id; ++ ++ if (!p_LnxWrpFmDev) ++ RETURN_ERROR(MINOR, E_NOT_AVAILABLE, ("Port not initialized or other error!")); ++ ++ if (&p_LnxWrpFmDev->txPorts[mac_id] != p_LnxWrpFmPortDev && ++ &p_LnxWrpFmDev->rxPorts[mac_id] != p_LnxWrpFmPortDev) ++ mac_id += FM_MAX_NUM_OF_1G_MACS; /* 10G port */ ++ ++ if (!p_LnxWrpFmDev->macs[mac_id].h_Dev) ++ RETURN_ERROR(MINOR, E_NOT_AVAILABLE, ("Port not initialized or other error!")); ++ ++ if (copy_from_user(¶m, (ioc_fm_port_mac_frame_size_counters_t *)arg, ++ sizeof(ioc_fm_port_mac_frame_size_counters_t))) ++ RETURN_ERROR(MINOR, E_WRITE_FAILED, NO_MSG); ++ ++ if (FM_MAC_GetFrameSizeCounters(p_LnxWrpFmDev->macs[mac_id].h_Dev, ++ &frameSizeCounters, param.type)) ++ RETURN_ERROR(MINOR, E_WRITE_FAILED, NO_MSG); ++ ++ param.count_pkts_64 = frameSizeCounters.count_pkts_64; ++ param.count_pkts_65_to_127 = frameSizeCounters.count_pkts_65_to_127; ++ param.count_pkts_128_to_255 = frameSizeCounters.count_pkts_128_to_255; ++ param.count_pkts_256_to_511 = frameSizeCounters.count_pkts_256_to_511; ++ param.count_pkts_512_to_1023 = frameSizeCounters.count_pkts_512_to_1023; ++ param.count_pkts_1024_to_1518 = frameSizeCounters.count_pkts_1024_to_1518; ++ param.count_pkts_1519_to_1522 = frameSizeCounters.count_pkts_1519_to_1522; ++ ++ if (copy_to_user((ioc_fm_port_mac_frame_size_counters_t *)arg, ¶m, ++ sizeof(ioc_fm_port_mac_frame_size_counters_t))) ++ RETURN_ERROR(MINOR, E_WRITE_FAILED, NO_MSG); ++ ++ break; ++ } ++ + case FM_PORT_IOC_GET_BMI_COUNTERS: + { + t_LnxWrpFmDev *p_LnxWrpFmDev = @@ -152474,7 +152677,7 @@ Signed-off-by: Yangbo Lu +/** @} */ /* end of lnx_ioctl_FM_grp group */ --- /dev/null +++ b/include/uapi/linux/fmd/Peripherals/fm_port_ioctls.h -@@ -0,0 +1,948 @@ +@@ -0,0 +1,973 @@ +/* Copyright (c) 2008-2012 Freescale Semiconductor, Inc. + * All rights reserved. + * @@ -153416,6 +153619,31 @@ Signed-off-by: Yangbo Lu + +#define FM_PORT_IOC_GET_BMI_COUNTERS _IOR(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(42), ioc_fm_port_bmi_stats_t) + ++typedef struct ioc_fm_port_mac_frame_size_counters_t { ++ ++ e_CommMode type; ++ uint64_t count_pkts_64; /**< 64 byte frame counter */ ++ uint64_t count_pkts_65_to_127; /**< 65 to 127 byte frame counter */ ++ uint64_t count_pkts_128_to_255; /**< 128 to 255 byte frame counter */ ++ uint64_t count_pkts_256_to_511; /**< 256 to 511 byte frame counter */ ++ uint64_t count_pkts_512_to_1023; /**< 512 to 1023 byte frame counter */ ++ uint64_t count_pkts_1024_to_1518; /**< 1024 to 1518 byte frame counter */ ++ uint64_t count_pkts_1519_to_1522; /**< 1519 to 1522 byte good frame count */ ++} ioc_fm_port_mac_frame_size_counters_t; ++ ++/**************************************************************************//** ++ @Function FM_MAC_GetFrameSizeCounters ++ ++ @Description get MAC statistics counters for different frame size ++ ++ @Param[out] ioc_fm_port_mac_frame_size_counters_t A structure holding the counters ++ ++ @Return E_OK on success; Error code otherwise. ++ ++ @Cautions Allowed only following FM_Init(). ++*//***************************************************************************/ ++#define FM_PORT_IOC_GET_MAC_FRAME_SIZE_COUNTERS _IOR(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(43), ioc_fm_port_mac_frame_size_counters_t) ++ + +/** @} */ /* end of lnx_ioctl_FM_PORT_pcd_runtime_control_grp group */ +/** @} */ /* end of lnx_ioctl_FM_PORT_runtime_control_grp group */ diff --git a/target/linux/layerscape/patches-4.9/702-pci-support-layerscape.patch b/target/linux/layerscape/patches-4.9/702-pci-support-layerscape.patch index 4e3b139b40..65243518ae 100644 --- a/target/linux/layerscape/patches-4.9/702-pci-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/702-pci-support-layerscape.patch @@ -1,4 +1,4 @@ -From c4813da334b0c31e9c55eea015f1e898e84ff45b Mon Sep 17 00:00:00 2001 +From 9e6e0a53b29190dbd86a39304b59c3028f5b36c2 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 25 Sep 2017 11:04:10 +0800 Subject: [PATCH] pci: support layerscape @@ -15,17 +15,17 @@ Signed-off-by: Mingkai Hu Signed-off-by: Christoph Hellwig Signed-off-by: Yangbo Lu --- - drivers/irqchip/irq-ls-scfg-msi.c | 256 +++++++-- + drivers/irqchip/irq-ls-scfg-msi.c | 257 +++++++-- drivers/pci/host/Makefile | 2 +- drivers/pci/host/pci-layerscape-ep-debugfs.c | 758 +++++++++++++++++++++++++++ drivers/pci/host/pci-layerscape-ep.c | 309 +++++++++++ drivers/pci/host/pci-layerscape-ep.h | 115 ++++ - drivers/pci/host/pci-layerscape.c | 37 +- + drivers/pci/host/pci-layerscape.c | 38 +- drivers/pci/host/pcie-designware.c | 6 + drivers/pci/host/pcie-designware.h | 1 + drivers/pci/pcie/portdrv_core.c | 181 +++---- include/linux/pci.h | 1 + - 10 files changed, 1518 insertions(+), 148 deletions(-) + 10 files changed, 1520 insertions(+), 148 deletions(-) create mode 100644 drivers/pci/host/pci-layerscape-ep-debugfs.c create mode 100644 drivers/pci/host/pci-layerscape-ep.c create mode 100644 drivers/pci/host/pci-layerscape-ep.h @@ -198,7 +198,7 @@ Signed-off-by: Yangbo Lu &ls_scfg_msi_domain_ops, msi_data); if (!msi_data->parent) { -@@ -164,16 +230,117 @@ static int ls_scfg_msi_domains_init(stru +@@ -164,16 +230,118 @@ static int ls_scfg_msi_domains_init(stru return 0; } @@ -288,6 +288,7 @@ Signed-off-by: Yangbo Lu + { .compatible = "fsl,1s1021a-msi", .data = &ls1021_msi_cfg}, + { .compatible = "fsl,1s1043a-msi", .data = &ls1021_msi_cfg}, + ++ { .compatible = "fsl,ls1012a-msi", .data = &ls1021_msi_cfg }, + { .compatible = "fsl,ls1021a-msi", .data = &ls1021_msi_cfg }, + { .compatible = "fsl,ls1043a-msi", .data = &ls1021_msi_cfg }, + { .compatible = "fsl,ls1043a-v1.1-msi", .data = &ls1043_v1_1_msi_cfg }, @@ -317,7 +318,7 @@ Signed-off-by: Yangbo Lu res = platform_get_resource(pdev, IORESOURCE_MEM, 0); msi_data->regs = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(msi_data->regs)) { -@@ -182,23 +349,48 @@ static int ls_scfg_msi_probe(struct plat +@@ -182,23 +350,48 @@ static int ls_scfg_msi_probe(struct plat } msi_data->msiir_addr = res->start; @@ -376,7 +377,7 @@ Signed-off-by: Yangbo Lu platform_set_drvdata(pdev, msi_data); return 0; -@@ -207,8 +399,10 @@ static int ls_scfg_msi_probe(struct plat +@@ -207,8 +400,10 @@ static int ls_scfg_msi_probe(struct plat static int ls_scfg_msi_remove(struct platform_device *pdev) { struct ls_scfg_msi *msi_data = platform_get_drvdata(pdev); @@ -388,7 +389,7 @@ Signed-off-by: Yangbo Lu irq_domain_remove(msi_data->msi_domain); irq_domain_remove(msi_data->parent); -@@ -218,12 +412,6 @@ static int ls_scfg_msi_remove(struct pla +@@ -218,12 +413,6 @@ static int ls_scfg_msi_remove(struct pla return 0; } @@ -1656,7 +1657,7 @@ Signed-off-by: Yangbo Lu } static int ls_pcie_msi_host_init(struct pcie_port *pp, -@@ -196,20 +209,38 @@ static struct ls_pcie_drvdata ls1021_drv +@@ -196,20 +209,39 @@ static struct ls_pcie_drvdata ls1021_drv static struct ls_pcie_drvdata ls1043_drvdata = { .lut_offset = 0x10000, .ltssm_shift = 24, @@ -1686,6 +1687,7 @@ Signed-off-by: Yangbo Lu }; static const struct of_device_id ls_pcie_of_match[] = { ++ { .compatible = "fsl,ls1012a-pcie", .data = &ls1046_drvdata }, { .compatible = "fsl,ls1021a-pcie", .data = &ls1021_drvdata }, { .compatible = "fsl,ls1043a-pcie", .data = &ls1043_drvdata }, + { .compatible = "fsl,ls1046a-pcie", .data = &ls1046_drvdata }, diff --git a/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch b/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch index 312faf2c5b..81c473c4d2 100644 --- a/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch @@ -1741,7 +1741,7 @@ Signed-off-by: Yangbo Lu PHY_INTERFACE_MODE_MAX, } phy_interface_t; -@@ -784,6 +785,9 @@ int phy_stop_interrupts(struct phy_devic +@@ -780,6 +781,9 @@ int phy_stop_interrupts(struct phy_devic static inline int phy_read_status(struct phy_device *phydev) { diff --git a/target/linux/layerscape/patches-4.9/704-fsl-mc-layerscape-support.patch b/target/linux/layerscape/patches-4.9/704-fsl-mc-layerscape-support.patch index 2927c7e669..a35e593105 100644 --- a/target/linux/layerscape/patches-4.9/704-fsl-mc-layerscape-support.patch +++ b/target/linux/layerscape/patches-4.9/704-fsl-mc-layerscape-support.patch @@ -1,4 +1,4 @@ -From 464b4d9b8282e0f1e5040e4914505f91ce4d3750 Mon Sep 17 00:00:00 2001 +From afb7254de9f03c3efaf4e306dcf5f88e1873fc6b Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 25 Sep 2017 12:06:25 +0800 Subject: [PATCH] fsl-mc: layerscape support @@ -29,7 +29,7 @@ Signed-off-by: Yangbo Lu .../{include/dpcon-cmd.h => bus/dpio/dpio-cmd.h} | 73 +- drivers/staging/fsl-mc/bus/dpio/dpio-driver.c | 296 ++++++ drivers/staging/fsl-mc/bus/dpio/dpio-driver.txt | 135 +++ - drivers/staging/fsl-mc/bus/dpio/dpio-service.c | 689 +++++++++++++ + drivers/staging/fsl-mc/bus/dpio/dpio-service.c | 693 +++++++++++++ drivers/staging/fsl-mc/bus/dpio/dpio.c | 224 +++++ drivers/staging/fsl-mc/bus/dpio/dpio.h | 109 ++ drivers/staging/fsl-mc/bus/dpio/qbman-portal.c | 1049 ++++++++++++++++++++ @@ -68,7 +68,7 @@ Signed-off-by: Yangbo Lu drivers/staging/fsl-mc/include/mc-cmd.h | 44 +- drivers/staging/fsl-mc/include/mc-sys.h | 3 +- drivers/staging/fsl-mc/include/mc.h | 17 +- - 49 files changed, 7380 insertions(+), 2612 deletions(-) + 49 files changed, 7384 insertions(+), 2612 deletions(-) create mode 100644 drivers/staging/fsl-mc/bus/dpbp-cmd.h create mode 100644 drivers/staging/fsl-mc/bus/dpcon-cmd.h create mode 100644 drivers/staging/fsl-mc/bus/dpcon.c @@ -1772,7 +1772,7 @@ Signed-off-by: Yangbo Lu + Dequeue result struct and parsing APIs are defined in dpaa2-global.h. --- /dev/null +++ b/drivers/staging/fsl-mc/bus/dpio/dpio-service.c -@@ -0,0 +1,689 @@ +@@ -0,0 +1,693 @@ +/* + * Copyright 2014-2016 Freescale Semiconductor Inc. + * Copyright 2016 NXP @@ -1852,14 +1852,14 @@ Signed-off-by: Yangbo Lu + if (d) + return d; + -+ if (unlikely(cpu >= num_possible_cpus())) ++ if (unlikely(cpu >= (int)num_possible_cpus())) + return NULL; + + /* + * If cpu == -1, choose the current cpu, with no guarantees about + * potentially being migrated away. + */ -+ if (unlikely(cpu < 0)) ++ if (cpu < 0) + cpu = smp_processor_id(); + + /* If a specific cpu was requested, pick it up immediately */ @@ -1871,6 +1871,10 @@ Signed-off-by: Yangbo Lu + if (d) + return d; + ++ d = service_select_by_cpu(d, -1); ++ if (d) ++ return d; ++ + spin_lock(&dpio_list_lock); + d = list_entry(dpio_list.next, struct dpaa2_io, node); + list_del(&d->node); @@ -1897,7 +1901,7 @@ Signed-off-by: Yangbo Lu + return NULL; + + /* check if CPU is out of range (-1 means any cpu) */ -+ if (desc->cpu >= num_possible_cpus()) { ++ if (desc->cpu >= (int)num_possible_cpus()) { + kfree(obj); + return NULL; + } @@ -8354,14 +8358,6 @@ Signed-off-by: Yangbo Lu * Author: German Rivera * * This file is licensed under the terms of the GNU General Public -@@ -17,6 +17,7 @@ - #include - #include - #include "../include/mc-bus.h" -+#include "fsl-mc-private.h" - - /* - * Generate a unique ID identifying the interrupt (only used within the MSI --- a/drivers/staging/fsl-mc/bus/fsl-mc-private.h +++ b/drivers/staging/fsl-mc/bus/fsl-mc-private.h @@ -10,13 +10,15 @@ @@ -8393,11 +8389,8 @@ Signed-off-by: Yangbo Lu * Author: German Rivera * * This file is licensed under the terms of the GNU General Public -@@ -17,9 +17,10 @@ - #include - #include - #include "../include/mc-bus.h" -+#include "fsl-mc-private.h" +@@ -20,7 +20,7 @@ + #include "fsl-mc-private.h" static struct irq_chip its_msi_irq_chip = { - .name = "fsl-mc-bus-msi", @@ -8405,7 +8398,7 @@ Signed-off-by: Yangbo Lu .irq_mask = irq_chip_mask_parent, .irq_unmask = irq_chip_unmask_parent, .irq_eoi = irq_chip_eoi_parent, -@@ -51,7 +52,7 @@ static int its_fsl_mc_msi_prepare(struct +@@ -52,7 +52,7 @@ static int its_fsl_mc_msi_prepare(struct return msi_info->ops->msi_prepare(msi_domain->parent, dev, nvec, info); } @@ -8414,7 +8407,7 @@ Signed-off-by: Yangbo Lu .msi_prepare = its_fsl_mc_msi_prepare, }; -@@ -94,8 +95,8 @@ int __init its_fsl_mc_msi_init(void) +@@ -95,8 +95,8 @@ int __init its_fsl_mc_msi_init(void) continue; } diff --git a/target/linux/layerscape/patches-4.9/706-fsl-dpaa-use-4-9-ndo-get-stats64.patch b/target/linux/layerscape/patches-4.9/706-fsl-dpaa-use-4-9-ndo-get-stats64.patch new file mode 100644 index 0000000000..4fa29b2909 --- /dev/null +++ b/target/linux/layerscape/patches-4.9/706-fsl-dpaa-use-4-9-ndo-get-stats64.patch @@ -0,0 +1,112 @@ +From: Mathew McBride +Date: Tue, 24 Oct 2017 11:30:00 +1100 +Subject: [PATCH] dpaa: backport use of 4.9 ndo_get_stats64 + +This patch changes the declarations of ndo_get_stats64 handlers +to the previous struct rtnl_link_stats64 * return type instead of +the mainline void return. + +Suggested-by: Adrien Gallouët +Signed-off-by: Mathew McBride + +--- + drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c | 5 +++-- + drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.h | 4 ++-- + drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 3 ++- + drivers/staging/fsl-dpaa2/ethsw/switch.c | 4 ++-- + drivers/staging/fsl-dpaa2/evb/evb.c | 4 ++-- + 5 files changed, 11 insertions(+), 9 deletions(-) + +--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c ++++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c +@@ -1296,7 +1296,7 @@ static int dpaa2_eth_set_addr(struct net + /** Fill in counters maintained by the GPP driver. These may be different from + * the hardware counters obtained by ethtool. + */ +-static void dpaa2_eth_get_stats(struct net_device *net_dev, ++static struct rtnl_link_stats64 *dpaa2_eth_get_stats(struct net_device *net_dev, + struct rtnl_link_stats64 *stats) + { + struct dpaa2_eth_priv *priv = netdev_priv(net_dev); +@@ -1312,6 +1312,7 @@ static void dpaa2_eth_get_stats(struct n + for (j = 0; j < num; j++) + netstats[j] += cpustats[j]; + } ++ return stats; + } + + static int dpaa2_eth_change_mtu(struct net_device *net_dev, int mtu) +--- a/drivers/staging/fsl-dpaa2/ethsw/switch.c ++++ b/drivers/staging/fsl-dpaa2/ethsw/switch.c +@@ -1094,7 +1094,7 @@ static int ethsw_port_fdb_del(struct ndm + return 0; + } + +-void ethsw_port_get_stats(struct net_device *netdev, ++struct rtnl_link_stats64 *ethsw_port_get_stats(struct net_device *netdev, + struct rtnl_link_stats64 *storage) + { + struct ethsw_port_priv *port_priv = netdev_priv(netdev); +@@ -1154,7 +1154,7 @@ void ethsw_port_get_stats(struct net_dev + if (err) + goto error; + +- return; ++ return storage; + + error: + netdev_err(netdev, "dpsw_if_get_counter err %d\n", err); +--- a/drivers/staging/fsl-dpaa2/evb/evb.c ++++ b/drivers/staging/fsl-dpaa2/evb/evb.c +@@ -765,7 +765,7 @@ static int evb_dellink(struct net_device + return 0; + } + +-void evb_port_get_stats(struct net_device *netdev, ++struct rtnl_link_stats64 *evb_port_get_stats(struct net_device *netdev, + struct rtnl_link_stats64 *storage) + { + struct evb_port_priv *port_priv = netdev_priv(netdev); +@@ -842,7 +842,7 @@ void evb_port_get_stats(struct net_devic + if (unlikely(err)) + goto error; + +- return; ++ return storage; + + error: + netdev_err(netdev, "dpdmux_if_get_counter err %d\n", err); +--- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c ++++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c +@@ -239,8 +239,8 @@ EXPORT_SYMBOL(dpa_timeout); + * Calculates the statistics for the given device by adding the statistics + * collected by each CPU. + */ +-void __cold +-dpa_get_stats64(struct net_device *net_dev, ++struct rtnl_link_stats64 __cold ++*dpa_get_stats64(struct net_device *net_dev, + struct rtnl_link_stats64 *stats) + { + struct dpa_priv_s *priv = netdev_priv(net_dev); +@@ -258,6 +258,7 @@ dpa_get_stats64(struct net_device *net_d + for (j = 0; j < numstats; j++) + netstats[j] += cpustats[j]; + } ++ return stats; + } + EXPORT_SYMBOL(dpa_get_stats64); + +--- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.h ++++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.h +@@ -140,8 +140,8 @@ int dpa_netdev_init(struct net_device *n + int __cold dpa_start(struct net_device *net_dev); + int __cold dpa_stop(struct net_device *net_dev); + void __cold dpa_timeout(struct net_device *net_dev); +-void __cold +-dpa_get_stats64(struct net_device *net_dev, ++struct rtnl_link_stats64 __cold ++*dpa_get_stats64(struct net_device *net_dev, + struct rtnl_link_stats64 *stats); + int dpa_change_mtu(struct net_device *net_dev, int new_mtu); + int dpa_ndo_init(struct net_device *net_dev); diff --git a/target/linux/layerscape/patches-4.9/706-fsl_ppfe-support-layercape.patch b/target/linux/layerscape/patches-4.9/706-fsl_ppfe-support-layercape.patch new file mode 100644 index 0000000000..4104272eff --- /dev/null +++ b/target/linux/layerscape/patches-4.9/706-fsl_ppfe-support-layercape.patch @@ -0,0 +1,10548 @@ +From 8b7935a883d42187716fe486c83352f24d01ddcd Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Thu, 19 Oct 2017 12:48:19 +0800 +Subject: [PATCH] fsl_ppfe: support layercape + +This is a integrated patch for layerscape pfe support. + +Calvin Johnson +Signed-off-by: Yangbo Lu +--- + drivers/staging/fsl_ppfe/Kconfig | 20 + + drivers/staging/fsl_ppfe/Makefile | 19 + + drivers/staging/fsl_ppfe/TODO | 2 + + drivers/staging/fsl_ppfe/include/pfe/cbus.h | 78 + + drivers/staging/fsl_ppfe/include/pfe/cbus/bmu.h | 55 + + .../staging/fsl_ppfe/include/pfe/cbus/class_csr.h | 289 +++ + .../staging/fsl_ppfe/include/pfe/cbus/emac_mtip.h | 242 ++ + drivers/staging/fsl_ppfe/include/pfe/cbus/gpi.h | 86 + + drivers/staging/fsl_ppfe/include/pfe/cbus/hif.h | 100 + + .../staging/fsl_ppfe/include/pfe/cbus/hif_nocpy.h | 50 + + .../staging/fsl_ppfe/include/pfe/cbus/tmu_csr.h | 168 ++ + .../staging/fsl_ppfe/include/pfe/cbus/util_csr.h | 61 + + drivers/staging/fsl_ppfe/include/pfe/pfe.h | 372 +++ + drivers/staging/fsl_ppfe/pfe_ctrl.c | 238 ++ + drivers/staging/fsl_ppfe/pfe_ctrl.h | 112 + + drivers/staging/fsl_ppfe/pfe_debugfs.c | 111 + + drivers/staging/fsl_ppfe/pfe_debugfs.h | 25 + + drivers/staging/fsl_ppfe/pfe_eth.c | 2434 ++++++++++++++++++++ + drivers/staging/fsl_ppfe/pfe_eth.h | 184 ++ + drivers/staging/fsl_ppfe/pfe_firmware.c | 314 +++ + drivers/staging/fsl_ppfe/pfe_firmware.h | 32 + + drivers/staging/fsl_ppfe/pfe_hal.c | 1516 ++++++++++++ + drivers/staging/fsl_ppfe/pfe_hif.c | 1072 +++++++++ + drivers/staging/fsl_ppfe/pfe_hif.h | 211 ++ + drivers/staging/fsl_ppfe/pfe_hif_lib.c | 601 +++++ + drivers/staging/fsl_ppfe/pfe_hif_lib.h | 239 ++ + drivers/staging/fsl_ppfe/pfe_hw.c | 176 ++ + drivers/staging/fsl_ppfe/pfe_hw.h | 27 + + drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c | 394 ++++ + drivers/staging/fsl_ppfe/pfe_mod.c | 141 ++ + drivers/staging/fsl_ppfe/pfe_mod.h | 112 + + drivers/staging/fsl_ppfe/pfe_perfmon.h | 38 + + drivers/staging/fsl_ppfe/pfe_sysfs.c | 818 +++++++ + drivers/staging/fsl_ppfe/pfe_sysfs.h | 29 + + 34 files changed, 10366 insertions(+) + create mode 100644 drivers/staging/fsl_ppfe/Kconfig + create mode 100644 drivers/staging/fsl_ppfe/Makefile + create mode 100644 drivers/staging/fsl_ppfe/TODO + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/bmu.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/class_csr.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/emac_mtip.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/gpi.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/hif.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/hif_nocpy.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/tmu_csr.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/util_csr.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/pfe.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_ctrl.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_ctrl.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_debugfs.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_debugfs.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_eth.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_eth.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_firmware.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_firmware.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_hal.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_hif.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_hif.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_hif_lib.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_hif_lib.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_hw.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_hw.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_mod.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_mod.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_perfmon.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_sysfs.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_sysfs.h + +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/Kconfig +@@ -0,0 +1,20 @@ ++# ++# Freescale Programmable Packet Forwarding Engine driver ++# ++config FSL_PPFE ++ bool "Freescale PPFE Driver" ++ default n ++ ---help--- ++ Freescale LS1012A SoC has a Programmable Packet Forwarding Engine. ++ It provides two high performance ethernet interfaces. ++ This driver initializes, programs and controls the PPFE. ++ Use this driver to enable network connectivity on LS1012A platforms. ++ ++if FSL_PPFE ++ ++config FSL_PPFE_UTIL_DISABLED ++ bool "Disable PPFE UTIL Processor Engine" ++ ---help--- ++ UTIL PE has to be enabled only if required. ++ ++endif # FSL_PPFE +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/Makefile +@@ -0,0 +1,19 @@ ++# ++# Makefile for Freesecale PPFE driver ++# ++ ++ccflags-y += -I$(src)/include -I$(src) ++ ++obj-m += pfe.o ++ ++pfe-y += pfe_mod.o \ ++ pfe_hw.o \ ++ pfe_firmware.o \ ++ pfe_ctrl.o \ ++ pfe_hif.o \ ++ pfe_hif_lib.o\ ++ pfe_eth.o \ ++ pfe_sysfs.o \ ++ pfe_debugfs.o \ ++ pfe_ls1012a_platform.o \ ++ pfe_hal.o +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/TODO +@@ -0,0 +1,2 @@ ++TODO: ++ - provide pfe pe monitoring support +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus.h +@@ -0,0 +1,78 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#ifndef _CBUS_H_ ++#define _CBUS_H_ ++ ++#define EMAC1_BASE_ADDR (CBUS_BASE_ADDR + 0x200000) ++#define EGPI1_BASE_ADDR (CBUS_BASE_ADDR + 0x210000) ++#define EMAC2_BASE_ADDR (CBUS_BASE_ADDR + 0x220000) ++#define EGPI2_BASE_ADDR (CBUS_BASE_ADDR + 0x230000) ++#define BMU1_BASE_ADDR (CBUS_BASE_ADDR + 0x240000) ++#define BMU2_BASE_ADDR (CBUS_BASE_ADDR + 0x250000) ++#define ARB_BASE_ADDR (CBUS_BASE_ADDR + 0x260000) ++#define DDR_CONFIG_BASE_ADDR (CBUS_BASE_ADDR + 0x270000) ++#define HIF_BASE_ADDR (CBUS_BASE_ADDR + 0x280000) ++#define HGPI_BASE_ADDR (CBUS_BASE_ADDR + 0x290000) ++#define LMEM_BASE_ADDR (CBUS_BASE_ADDR + 0x300000) ++#define LMEM_SIZE 0x10000 ++#define LMEM_END (LMEM_BASE_ADDR + LMEM_SIZE) ++#define TMU_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x310000) ++#define CLASS_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x320000) ++#define HIF_NOCPY_BASE_ADDR (CBUS_BASE_ADDR + 0x350000) ++#define UTIL_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x360000) ++#define CBUS_GPT_BASE_ADDR (CBUS_BASE_ADDR + 0x370000) ++ ++/* ++ * defgroup XXX_MEM_ACCESS_ADDR PE memory access through CSR ++ * XXX_MEM_ACCESS_ADDR register bit definitions. ++ */ ++#define PE_MEM_ACCESS_WRITE BIT(31) /* Internal Memory Write. */ ++#define PE_MEM_ACCESS_IMEM BIT(15) ++#define PE_MEM_ACCESS_DMEM BIT(16) ++ ++/* Byte Enables of the Internal memory access. These are interpred in BE */ ++#define PE_MEM_ACCESS_BYTE_ENABLE(offset, size) \ ++ ({ typeof(size) size_ = (size); \ ++ (((BIT(size_) - 1) << (4 - (offset) - (size_))) & 0xf) << 24; }) ++ ++#include "cbus/emac_mtip.h" ++#include "cbus/gpi.h" ++#include "cbus/bmu.h" ++#include "cbus/hif.h" ++#include "cbus/tmu_csr.h" ++#include "cbus/class_csr.h" ++#include "cbus/hif_nocpy.h" ++#include "cbus/util_csr.h" ++ ++/* PFE cores states */ ++#define CORE_DISABLE 0x00000000 ++#define CORE_ENABLE 0x00000001 ++#define CORE_SW_RESET 0x00000002 ++ ++/* LMEM defines */ ++#define LMEM_HDR_SIZE 0x0010 ++#define LMEM_BUF_SIZE_LN2 0x7 ++#define LMEM_BUF_SIZE BIT(LMEM_BUF_SIZE_LN2) ++ ++/* DDR defines */ ++#define DDR_HDR_SIZE 0x0100 ++#define DDR_BUF_SIZE_LN2 0xb ++#define DDR_BUF_SIZE BIT(DDR_BUF_SIZE_LN2) ++ ++#endif /* _CBUS_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/bmu.h +@@ -0,0 +1,55 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#ifndef _BMU_H_ ++#define _BMU_H_ ++ ++#define BMU_VERSION 0x000 ++#define BMU_CTRL 0x004 ++#define BMU_UCAST_CONFIG 0x008 ++#define BMU_UCAST_BASE_ADDR 0x00c ++#define BMU_BUF_SIZE 0x010 ++#define BMU_BUF_CNT 0x014 ++#define BMU_THRES 0x018 ++#define BMU_INT_SRC 0x020 ++#define BMU_INT_ENABLE 0x024 ++#define BMU_ALLOC_CTRL 0x030 ++#define BMU_FREE_CTRL 0x034 ++#define BMU_FREE_ERR_ADDR 0x038 ++#define BMU_CURR_BUF_CNT 0x03c ++#define BMU_MCAST_CNT 0x040 ++#define BMU_MCAST_ALLOC_CTRL 0x044 ++#define BMU_REM_BUF_CNT 0x048 ++#define BMU_LOW_WATERMARK 0x050 ++#define BMU_HIGH_WATERMARK 0x054 ++#define BMU_INT_MEM_ACCESS 0x100 ++ ++struct BMU_CFG { ++ unsigned long baseaddr; ++ u32 count; ++ u32 size; ++ u32 low_watermark; ++ u32 high_watermark; ++}; ++ ++#define BMU1_BUF_SIZE LMEM_BUF_SIZE_LN2 ++#define BMU2_BUF_SIZE DDR_BUF_SIZE_LN2 ++ ++#define BMU2_MCAST_ALLOC_CTRL (BMU2_BASE_ADDR + BMU_MCAST_ALLOC_CTRL) ++ ++#endif /* _BMU_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/class_csr.h +@@ -0,0 +1,289 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#ifndef _CLASS_CSR_H_ ++#define _CLASS_CSR_H_ ++ ++/* @file class_csr.h. ++ * class_csr - block containing all the classifier control and status register. ++ * Mapped on CBUS and accessible from all PE's and ARM. ++ */ ++#define CLASS_VERSION (CLASS_CSR_BASE_ADDR + 0x000) ++#define CLASS_TX_CTRL (CLASS_CSR_BASE_ADDR + 0x004) ++#define CLASS_INQ_PKTPTR (CLASS_CSR_BASE_ADDR + 0x010) ++ ++/* (ddr_hdr_size[24:16], lmem_hdr_size[5:0]) */ ++#define CLASS_HDR_SIZE (CLASS_CSR_BASE_ADDR + 0x014) ++ ++/* LMEM header size for the Classifier block.\ Data in the LMEM ++ * is written from this offset. ++ */ ++#define CLASS_HDR_SIZE_LMEM(off) ((off) & 0x3f) ++ ++/* DDR header size for the Classifier block.\ Data in the DDR ++ * is written from this offset. ++ */ ++#define CLASS_HDR_SIZE_DDR(off) (((off) & 0x1ff) << 16) ++ ++#define CLASS_PE0_QB_DM_ADDR0 (CLASS_CSR_BASE_ADDR + 0x020) ++ ++/* DMEM address of first [15:0] and second [31:16] buffers on QB side. */ ++#define CLASS_PE0_QB_DM_ADDR1 (CLASS_CSR_BASE_ADDR + 0x024) ++ ++/* DMEM address of third [15:0] and fourth [31:16] buffers on QB side. */ ++#define CLASS_PE0_RO_DM_ADDR0 (CLASS_CSR_BASE_ADDR + 0x060) ++ ++/* DMEM address of first [15:0] and second [31:16] buffers on RO side. */ ++#define CLASS_PE0_RO_DM_ADDR1 (CLASS_CSR_BASE_ADDR + 0x064) ++ ++/* DMEM address of third [15:0] and fourth [31:16] buffers on RO side. */ ++ ++/* @name Class PE memory access. Allows external PE's and HOST to ++ * read/write PMEM/DMEM memory ranges for each classifier PE. ++ */ ++/* {sr_pe_mem_cmd[31], csr_pe_mem_wren[27:24], csr_pe_mem_addr[23:0]}, ++ * See \ref XXX_MEM_ACCESS_ADDR for details. ++ */ ++#define CLASS_MEM_ACCESS_ADDR (CLASS_CSR_BASE_ADDR + 0x100) ++ ++/* Internal Memory Access Write Data [31:0] */ ++#define CLASS_MEM_ACCESS_WDATA (CLASS_CSR_BASE_ADDR + 0x104) ++ ++/* Internal Memory Access Read Data [31:0] */ ++#define CLASS_MEM_ACCESS_RDATA (CLASS_CSR_BASE_ADDR + 0x108) ++#define CLASS_TM_INQ_ADDR (CLASS_CSR_BASE_ADDR + 0x114) ++#define CLASS_PE_STATUS (CLASS_CSR_BASE_ADDR + 0x118) ++ ++#define CLASS_PHY1_RX_PKTS (CLASS_CSR_BASE_ADDR + 0x11c) ++#define CLASS_PHY1_TX_PKTS (CLASS_CSR_BASE_ADDR + 0x120) ++#define CLASS_PHY1_LP_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x124) ++#define CLASS_PHY1_INTF_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x128) ++#define CLASS_PHY1_INTF_MATCH_PKTS (CLASS_CSR_BASE_ADDR + 0x12c) ++#define CLASS_PHY1_L3_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x130) ++#define CLASS_PHY1_V4_PKTS (CLASS_CSR_BASE_ADDR + 0x134) ++#define CLASS_PHY1_V6_PKTS (CLASS_CSR_BASE_ADDR + 0x138) ++#define CLASS_PHY1_CHKSUM_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x13c) ++#define CLASS_PHY1_TTL_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x140) ++#define CLASS_PHY2_RX_PKTS (CLASS_CSR_BASE_ADDR + 0x144) ++#define CLASS_PHY2_TX_PKTS (CLASS_CSR_BASE_ADDR + 0x148) ++#define CLASS_PHY2_LP_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x14c) ++#define CLASS_PHY2_INTF_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x150) ++#define CLASS_PHY2_INTF_MATCH_PKTS (CLASS_CSR_BASE_ADDR + 0x154) ++#define CLASS_PHY2_L3_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x158) ++#define CLASS_PHY2_V4_PKTS (CLASS_CSR_BASE_ADDR + 0x15c) ++#define CLASS_PHY2_V6_PKTS (CLASS_CSR_BASE_ADDR + 0x160) ++#define CLASS_PHY2_CHKSUM_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x164) ++#define CLASS_PHY2_TTL_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x168) ++#define CLASS_PHY3_RX_PKTS (CLASS_CSR_BASE_ADDR + 0x16c) ++#define CLASS_PHY3_TX_PKTS (CLASS_CSR_BASE_ADDR + 0x170) ++#define CLASS_PHY3_LP_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x174) ++#define CLASS_PHY3_INTF_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x178) ++#define CLASS_PHY3_INTF_MATCH_PKTS (CLASS_CSR_BASE_ADDR + 0x17c) ++#define CLASS_PHY3_L3_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x180) ++#define CLASS_PHY3_V4_PKTS (CLASS_CSR_BASE_ADDR + 0x184) ++#define CLASS_PHY3_V6_PKTS (CLASS_CSR_BASE_ADDR + 0x188) ++#define CLASS_PHY3_CHKSUM_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x18c) ++#define CLASS_PHY3_TTL_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x190) ++#define CLASS_PHY1_ICMP_PKTS (CLASS_CSR_BASE_ADDR + 0x194) ++#define CLASS_PHY1_IGMP_PKTS (CLASS_CSR_BASE_ADDR + 0x198) ++#define CLASS_PHY1_TCP_PKTS (CLASS_CSR_BASE_ADDR + 0x19c) ++#define CLASS_PHY1_UDP_PKTS (CLASS_CSR_BASE_ADDR + 0x1a0) ++#define CLASS_PHY2_ICMP_PKTS (CLASS_CSR_BASE_ADDR + 0x1a4) ++#define CLASS_PHY2_IGMP_PKTS (CLASS_CSR_BASE_ADDR + 0x1a8) ++#define CLASS_PHY2_TCP_PKTS (CLASS_CSR_BASE_ADDR + 0x1ac) ++#define CLASS_PHY2_UDP_PKTS (CLASS_CSR_BASE_ADDR + 0x1b0) ++#define CLASS_PHY3_ICMP_PKTS (CLASS_CSR_BASE_ADDR + 0x1b4) ++#define CLASS_PHY3_IGMP_PKTS (CLASS_CSR_BASE_ADDR + 0x1b8) ++#define CLASS_PHY3_TCP_PKTS (CLASS_CSR_BASE_ADDR + 0x1bc) ++#define CLASS_PHY3_UDP_PKTS (CLASS_CSR_BASE_ADDR + 0x1c0) ++#define CLASS_PHY4_ICMP_PKTS (CLASS_CSR_BASE_ADDR + 0x1c4) ++#define CLASS_PHY4_IGMP_PKTS (CLASS_CSR_BASE_ADDR + 0x1c8) ++#define CLASS_PHY4_TCP_PKTS (CLASS_CSR_BASE_ADDR + 0x1cc) ++#define CLASS_PHY4_UDP_PKTS (CLASS_CSR_BASE_ADDR + 0x1d0) ++#define CLASS_PHY4_RX_PKTS (CLASS_CSR_BASE_ADDR + 0x1d4) ++#define CLASS_PHY4_TX_PKTS (CLASS_CSR_BASE_ADDR + 0x1d8) ++#define CLASS_PHY4_LP_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x1dc) ++#define CLASS_PHY4_INTF_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x1e0) ++#define CLASS_PHY4_INTF_MATCH_PKTS (CLASS_CSR_BASE_ADDR + 0x1e4) ++#define CLASS_PHY4_L3_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x1e8) ++#define CLASS_PHY4_V4_PKTS (CLASS_CSR_BASE_ADDR + 0x1ec) ++#define CLASS_PHY4_V6_PKTS (CLASS_CSR_BASE_ADDR + 0x1f0) ++#define CLASS_PHY4_CHKSUM_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x1f4) ++#define CLASS_PHY4_TTL_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x1f8) ++ ++#define CLASS_PE_SYS_CLK_RATIO (CLASS_CSR_BASE_ADDR + 0x200) ++#define CLASS_AFULL_THRES (CLASS_CSR_BASE_ADDR + 0x204) ++#define CLASS_GAP_BETWEEN_READS (CLASS_CSR_BASE_ADDR + 0x208) ++#define CLASS_MAX_BUF_CNT (CLASS_CSR_BASE_ADDR + 0x20c) ++#define CLASS_TSQ_FIFO_THRES (CLASS_CSR_BASE_ADDR + 0x210) ++#define CLASS_TSQ_MAX_CNT (CLASS_CSR_BASE_ADDR + 0x214) ++#define CLASS_IRAM_DATA_0 (CLASS_CSR_BASE_ADDR + 0x218) ++#define CLASS_IRAM_DATA_1 (CLASS_CSR_BASE_ADDR + 0x21c) ++#define CLASS_IRAM_DATA_2 (CLASS_CSR_BASE_ADDR + 0x220) ++#define CLASS_IRAM_DATA_3 (CLASS_CSR_BASE_ADDR + 0x224) ++ ++#define CLASS_BUS_ACCESS_ADDR (CLASS_CSR_BASE_ADDR + 0x228) ++ ++#define CLASS_BUS_ACCESS_WDATA (CLASS_CSR_BASE_ADDR + 0x22c) ++#define CLASS_BUS_ACCESS_RDATA (CLASS_CSR_BASE_ADDR + 0x230) ++ ++/* (route_entry_size[9:0], route_hash_size[23:16] ++ * (this is actually ln2(size))) ++ */ ++#define CLASS_ROUTE_HASH_ENTRY_SIZE (CLASS_CSR_BASE_ADDR + 0x234) ++ ++#define CLASS_ROUTE_ENTRY_SIZE(size) ((size) & 0x1ff) ++#define CLASS_ROUTE_HASH_SIZE(hash_bits) (((hash_bits) & 0xff) << 16) ++ ++#define CLASS_ROUTE_TABLE_BASE (CLASS_CSR_BASE_ADDR + 0x238) ++ ++#define CLASS_ROUTE_MULTI (CLASS_CSR_BASE_ADDR + 0x23c) ++#define CLASS_SMEM_OFFSET (CLASS_CSR_BASE_ADDR + 0x240) ++#define CLASS_LMEM_BUF_SIZE (CLASS_CSR_BASE_ADDR + 0x244) ++#define CLASS_VLAN_ID (CLASS_CSR_BASE_ADDR + 0x248) ++#define CLASS_BMU1_BUF_FREE (CLASS_CSR_BASE_ADDR + 0x24c) ++#define CLASS_USE_TMU_INQ (CLASS_CSR_BASE_ADDR + 0x250) ++#define CLASS_VLAN_ID1 (CLASS_CSR_BASE_ADDR + 0x254) ++ ++#define CLASS_BUS_ACCESS_BASE (CLASS_CSR_BASE_ADDR + 0x258) ++#define CLASS_BUS_ACCESS_BASE_MASK (0xFF000000) ++/* bit 31:24 of PE peripheral address are stored in CLASS_BUS_ACCESS_BASE */ ++ ++#define CLASS_HIF_PARSE (CLASS_CSR_BASE_ADDR + 0x25c) ++ ++#define CLASS_HOST_PE0_GP (CLASS_CSR_BASE_ADDR + 0x260) ++#define CLASS_PE0_GP (CLASS_CSR_BASE_ADDR + 0x264) ++#define CLASS_HOST_PE1_GP (CLASS_CSR_BASE_ADDR + 0x268) ++#define CLASS_PE1_GP (CLASS_CSR_BASE_ADDR + 0x26c) ++#define CLASS_HOST_PE2_GP (CLASS_CSR_BASE_ADDR + 0x270) ++#define CLASS_PE2_GP (CLASS_CSR_BASE_ADDR + 0x274) ++#define CLASS_HOST_PE3_GP (CLASS_CSR_BASE_ADDR + 0x278) ++#define CLASS_PE3_GP (CLASS_CSR_BASE_ADDR + 0x27c) ++#define CLASS_HOST_PE4_GP (CLASS_CSR_BASE_ADDR + 0x280) ++#define CLASS_PE4_GP (CLASS_CSR_BASE_ADDR + 0x284) ++#define CLASS_HOST_PE5_GP (CLASS_CSR_BASE_ADDR + 0x288) ++#define CLASS_PE5_GP (CLASS_CSR_BASE_ADDR + 0x28c) ++ ++#define CLASS_PE_INT_SRC (CLASS_CSR_BASE_ADDR + 0x290) ++#define CLASS_PE_INT_ENABLE (CLASS_CSR_BASE_ADDR + 0x294) ++ ++#define CLASS_TPID0_TPID1 (CLASS_CSR_BASE_ADDR + 0x298) ++#define CLASS_TPID2 (CLASS_CSR_BASE_ADDR + 0x29c) ++ ++#define CLASS_L4_CHKSUM_ADDR (CLASS_CSR_BASE_ADDR + 0x2a0) ++ ++#define CLASS_PE0_DEBUG (CLASS_CSR_BASE_ADDR + 0x2a4) ++#define CLASS_PE1_DEBUG (CLASS_CSR_BASE_ADDR + 0x2a8) ++#define CLASS_PE2_DEBUG (CLASS_CSR_BASE_ADDR + 0x2ac) ++#define CLASS_PE3_DEBUG (CLASS_CSR_BASE_ADDR + 0x2b0) ++#define CLASS_PE4_DEBUG (CLASS_CSR_BASE_ADDR + 0x2b4) ++#define CLASS_PE5_DEBUG (CLASS_CSR_BASE_ADDR + 0x2b8) ++ ++#define CLASS_STATE (CLASS_CSR_BASE_ADDR + 0x2bc) ++ ++/* CLASS defines */ ++#define CLASS_PBUF_SIZE 0x100 /* Fixed by hardware */ ++#define CLASS_PBUF_HEADER_OFFSET 0x80 /* Can be configured */ ++ ++/* Can be configured */ ++#define CLASS_PBUF0_BASE_ADDR 0x000 ++/* Can be configured */ ++#define CLASS_PBUF1_BASE_ADDR (CLASS_PBUF0_BASE_ADDR + CLASS_PBUF_SIZE) ++/* Can be configured */ ++#define CLASS_PBUF2_BASE_ADDR (CLASS_PBUF1_BASE_ADDR + CLASS_PBUF_SIZE) ++/* Can be configured */ ++#define CLASS_PBUF3_BASE_ADDR (CLASS_PBUF2_BASE_ADDR + CLASS_PBUF_SIZE) ++ ++#define CLASS_PBUF0_HEADER_BASE_ADDR (CLASS_PBUF0_BASE_ADDR + \ ++ CLASS_PBUF_HEADER_OFFSET) ++#define CLASS_PBUF1_HEADER_BASE_ADDR (CLASS_PBUF1_BASE_ADDR + \ ++ CLASS_PBUF_HEADER_OFFSET) ++#define CLASS_PBUF2_HEADER_BASE_ADDR (CLASS_PBUF2_BASE_ADDR + \ ++ CLASS_PBUF_HEADER_OFFSET) ++#define CLASS_PBUF3_HEADER_BASE_ADDR (CLASS_PBUF3_BASE_ADDR + \ ++ CLASS_PBUF_HEADER_OFFSET) ++ ++#define CLASS_PE0_RO_DM_ADDR0_VAL ((CLASS_PBUF1_BASE_ADDR << 16) | \ ++ CLASS_PBUF0_BASE_ADDR) ++#define CLASS_PE0_RO_DM_ADDR1_VAL ((CLASS_PBUF3_BASE_ADDR << 16) | \ ++ CLASS_PBUF2_BASE_ADDR) ++ ++#define CLASS_PE0_QB_DM_ADDR0_VAL ((CLASS_PBUF1_HEADER_BASE_ADDR << 16) |\ ++ CLASS_PBUF0_HEADER_BASE_ADDR) ++#define CLASS_PE0_QB_DM_ADDR1_VAL ((CLASS_PBUF3_HEADER_BASE_ADDR << 16) |\ ++ CLASS_PBUF2_HEADER_BASE_ADDR) ++ ++#define CLASS_ROUTE_SIZE 128 ++#define CLASS_MAX_ROUTE_SIZE 256 ++#define CLASS_ROUTE_HASH_BITS 20 ++#define CLASS_ROUTE_HASH_MASK (BIT(CLASS_ROUTE_HASH_BITS) - 1) ++ ++/* Can be configured */ ++#define CLASS_ROUTE0_BASE_ADDR 0x400 ++/* Can be configured */ ++#define CLASS_ROUTE1_BASE_ADDR (CLASS_ROUTE0_BASE_ADDR + CLASS_ROUTE_SIZE) ++/* Can be configured */ ++#define CLASS_ROUTE2_BASE_ADDR (CLASS_ROUTE1_BASE_ADDR + CLASS_ROUTE_SIZE) ++/* Can be configured */ ++#define CLASS_ROUTE3_BASE_ADDR (CLASS_ROUTE2_BASE_ADDR + CLASS_ROUTE_SIZE) ++ ++#define CLASS_SA_SIZE 128 ++#define CLASS_IPSEC_SA0_BASE_ADDR 0x600 ++/* not used */ ++#define CLASS_IPSEC_SA1_BASE_ADDR (CLASS_IPSEC_SA0_BASE_ADDR + CLASS_SA_SIZE) ++/* not used */ ++#define CLASS_IPSEC_SA2_BASE_ADDR (CLASS_IPSEC_SA1_BASE_ADDR + CLASS_SA_SIZE) ++/* not used */ ++#define CLASS_IPSEC_SA3_BASE_ADDR (CLASS_IPSEC_SA2_BASE_ADDR + CLASS_SA_SIZE) ++ ++/* generic purpose free dmem buffer, last portion of 2K dmem pbuf */ ++#define CLASS_GP_DMEM_BUF_SIZE (2048 - (CLASS_PBUF_SIZE * 4) - \ ++ (CLASS_ROUTE_SIZE * 4) - (CLASS_SA_SIZE)) ++#define CLASS_GP_DMEM_BUF ((void *)(CLASS_IPSEC_SA0_BASE_ADDR + \ ++ CLASS_SA_SIZE)) ++ ++#define TWO_LEVEL_ROUTE BIT(0) ++#define PHYNO_IN_HASH BIT(1) ++#define HW_ROUTE_FETCH BIT(3) ++#define HW_BRIDGE_FETCH BIT(5) ++#define IP_ALIGNED BIT(6) ++#define ARC_HIT_CHECK_EN BIT(7) ++#define CLASS_TOE BIT(11) ++#define HASH_NORMAL (0 << 12) ++#define HASH_CRC_PORT BIT(12) ++#define HASH_CRC_IP (2 << 12) ++#define HASH_CRC_PORT_IP (3 << 12) ++#define QB2BUS_LE BIT(15) ++ ++#define TCP_CHKSUM_DROP BIT(0) ++#define UDP_CHKSUM_DROP BIT(1) ++#define IPV4_CHKSUM_DROP BIT(9) ++ ++/*CLASS_HIF_PARSE bits*/ ++#define HIF_PKT_CLASS_EN BIT(0) ++#define HIF_PKT_OFFSET(ofst) (((ofst) & 0xF) << 1) ++ ++struct class_cfg { ++ u32 toe_mode; ++ unsigned long route_table_baseaddr; ++ u32 route_table_hash_bits; ++ u32 pe_sys_clk_ratio; ++ u32 resume; ++}; ++ ++#endif /* _CLASS_CSR_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/emac_mtip.h +@@ -0,0 +1,242 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#ifndef _EMAC_H_ ++#define _EMAC_H_ ++ ++#include ++ ++#define EMAC_IEVENT_REG 0x004 ++#define EMAC_IMASK_REG 0x008 ++#define EMAC_R_DES_ACTIVE_REG 0x010 ++#define EMAC_X_DES_ACTIVE_REG 0x014 ++#define EMAC_ECNTRL_REG 0x024 ++#define EMAC_MII_DATA_REG 0x040 ++#define EMAC_MII_CTRL_REG 0x044 ++#define EMAC_MIB_CTRL_STS_REG 0x064 ++#define EMAC_RCNTRL_REG 0x084 ++#define EMAC_TCNTRL_REG 0x0C4 ++#define EMAC_PHY_ADDR_LOW 0x0E4 ++#define EMAC_PHY_ADDR_HIGH 0x0E8 ++#define EMAC_GAUR 0x120 ++#define EMAC_GALR 0x124 ++#define EMAC_TFWR_STR_FWD 0x144 ++#define EMAC_RX_SECTION_FULL 0x190 ++#define EMAC_RX_SECTION_EMPTY 0x194 ++#define EMAC_TX_SECTION_EMPTY 0x1A0 ++#define EMAC_TRUNC_FL 0x1B0 ++ ++#define RMON_T_DROP 0x200 /* Count of frames not cntd correctly */ ++#define RMON_T_PACKETS 0x204 /* RMON TX packet count */ ++#define RMON_T_BC_PKT 0x208 /* RMON TX broadcast pkts */ ++#define RMON_T_MC_PKT 0x20c /* RMON TX multicast pkts */ ++#define RMON_T_CRC_ALIGN 0x210 /* RMON TX pkts with CRC align err */ ++#define RMON_T_UNDERSIZE 0x214 /* RMON TX pkts < 64 bytes, good CRC */ ++#define RMON_T_OVERSIZE 0x218 /* RMON TX pkts > MAX_FL bytes good CRC */ ++#define RMON_T_FRAG 0x21c /* RMON TX pkts < 64 bytes, bad CRC */ ++#define RMON_T_JAB 0x220 /* RMON TX pkts > MAX_FL bytes, bad CRC */ ++#define RMON_T_COL 0x224 /* RMON TX collision count */ ++#define RMON_T_P64 0x228 /* RMON TX 64 byte pkts */ ++#define RMON_T_P65TO127 0x22c /* RMON TX 65 to 127 byte pkts */ ++#define RMON_T_P128TO255 0x230 /* RMON TX 128 to 255 byte pkts */ ++#define RMON_T_P256TO511 0x234 /* RMON TX 256 to 511 byte pkts */ ++#define RMON_T_P512TO1023 0x238 /* RMON TX 512 to 1023 byte pkts */ ++#define RMON_T_P1024TO2047 0x23c /* RMON TX 1024 to 2047 byte pkts */ ++#define RMON_T_P_GTE2048 0x240 /* RMON TX pkts > 2048 bytes */ ++#define RMON_T_OCTETS 0x244 /* RMON TX octets */ ++#define IEEE_T_DROP 0x248 /* Count of frames not counted crtly */ ++#define IEEE_T_FRAME_OK 0x24c /* Frames tx'd OK */ ++#define IEEE_T_1COL 0x250 /* Frames tx'd with single collision */ ++#define IEEE_T_MCOL 0x254 /* Frames tx'd with multiple collision */ ++#define IEEE_T_DEF 0x258 /* Frames tx'd after deferral delay */ ++#define IEEE_T_LCOL 0x25c /* Frames tx'd with late collision */ ++#define IEEE_T_EXCOL 0x260 /* Frames tx'd with excesv collisions */ ++#define IEEE_T_MACERR 0x264 /* Frames tx'd with TX FIFO underrun */ ++#define IEEE_T_CSERR 0x268 /* Frames tx'd with carrier sense err */ ++#define IEEE_T_SQE 0x26c /* Frames tx'd with SQE err */ ++#define IEEE_T_FDXFC 0x270 /* Flow control pause frames tx'd */ ++#define IEEE_T_OCTETS_OK 0x274 /* Octet count for frames tx'd w/o err */ ++#define RMON_R_PACKETS 0x284 /* RMON RX packet count */ ++#define RMON_R_BC_PKT 0x288 /* RMON RX broadcast pkts */ ++#define RMON_R_MC_PKT 0x28c /* RMON RX multicast pkts */ ++#define RMON_R_CRC_ALIGN 0x290 /* RMON RX pkts with CRC alignment err */ ++#define RMON_R_UNDERSIZE 0x294 /* RMON RX pkts < 64 bytes, good CRC */ ++#define RMON_R_OVERSIZE 0x298 /* RMON RX pkts > MAX_FL bytes good CRC */ ++#define RMON_R_FRAG 0x29c /* RMON RX pkts < 64 bytes, bad CRC */ ++#define RMON_R_JAB 0x2a0 /* RMON RX pkts > MAX_FL bytes, bad CRC */ ++#define RMON_R_RESVD_O 0x2a4 /* Reserved */ ++#define RMON_R_P64 0x2a8 /* RMON RX 64 byte pkts */ ++#define RMON_R_P65TO127 0x2ac /* RMON RX 65 to 127 byte pkts */ ++#define RMON_R_P128TO255 0x2b0 /* RMON RX 128 to 255 byte pkts */ ++#define RMON_R_P256TO511 0x2b4 /* RMON RX 256 to 511 byte pkts */ ++#define RMON_R_P512TO1023 0x2b8 /* RMON RX 512 to 1023 byte pkts */ ++#define RMON_R_P1024TO2047 0x2bc /* RMON RX 1024 to 2047 byte pkts */ ++#define RMON_R_P_GTE2048 0x2c0 /* RMON RX pkts > 2048 bytes */ ++#define RMON_R_OCTETS 0x2c4 /* RMON RX octets */ ++#define IEEE_R_DROP 0x2c8 /* Count frames not counted correctly */ ++#define IEEE_R_FRAME_OK 0x2cc /* Frames rx'd OK */ ++#define IEEE_R_CRC 0x2d0 /* Frames rx'd with CRC err */ ++#define IEEE_R_ALIGN 0x2d4 /* Frames rx'd with alignment err */ ++#define IEEE_R_MACERR 0x2d8 /* Receive FIFO overflow count */ ++#define IEEE_R_FDXFC 0x2dc /* Flow control pause frames rx'd */ ++#define IEEE_R_OCTETS_OK 0x2e0 /* Octet cnt for frames rx'd w/o err */ ++ ++#define EMAC_SMAC_0_0 0x500 /*Supplemental MAC Address 0 (RW).*/ ++#define EMAC_SMAC_0_1 0x504 /*Supplemental MAC Address 0 (RW).*/ ++ ++/* GEMAC definitions and settings */ ++ ++#define EMAC_PORT_0 0 ++#define EMAC_PORT_1 1 ++ ++/* GEMAC Bit definitions */ ++#define EMAC_IEVENT_HBERR 0x80000000 ++#define EMAC_IEVENT_BABR 0x40000000 ++#define EMAC_IEVENT_BABT 0x20000000 ++#define EMAC_IEVENT_GRA 0x10000000 ++#define EMAC_IEVENT_TXF 0x08000000 ++#define EMAC_IEVENT_TXB 0x04000000 ++#define EMAC_IEVENT_RXF 0x02000000 ++#define EMAC_IEVENT_RXB 0x01000000 ++#define EMAC_IEVENT_MII 0x00800000 ++#define EMAC_IEVENT_EBERR 0x00400000 ++#define EMAC_IEVENT_LC 0x00200000 ++#define EMAC_IEVENT_RL 0x00100000 ++#define EMAC_IEVENT_UN 0x00080000 ++ ++#define EMAC_IMASK_HBERR 0x80000000 ++#define EMAC_IMASK_BABR 0x40000000 ++#define EMAC_IMASKT_BABT 0x20000000 ++#define EMAC_IMASK_GRA 0x10000000 ++#define EMAC_IMASKT_TXF 0x08000000 ++#define EMAC_IMASK_TXB 0x04000000 ++#define EMAC_IMASKT_RXF 0x02000000 ++#define EMAC_IMASK_RXB 0x01000000 ++#define EMAC_IMASK_MII 0x00800000 ++#define EMAC_IMASK_EBERR 0x00400000 ++#define EMAC_IMASK_LC 0x00200000 ++#define EMAC_IMASKT_RL 0x00100000 ++#define EMAC_IMASK_UN 0x00080000 ++ ++#define EMAC_RCNTRL_MAX_FL_SHIFT 16 ++#define EMAC_RCNTRL_LOOP 0x00000001 ++#define EMAC_RCNTRL_DRT 0x00000002 ++#define EMAC_RCNTRL_MII_MODE 0x00000004 ++#define EMAC_RCNTRL_PROM 0x00000008 ++#define EMAC_RCNTRL_BC_REJ 0x00000010 ++#define EMAC_RCNTRL_FCE 0x00000020 ++#define EMAC_RCNTRL_RGMII 0x00000040 ++#define EMAC_RCNTRL_SGMII 0x00000080 ++#define EMAC_RCNTRL_RMII 0x00000100 ++#define EMAC_RCNTRL_RMII_10T 0x00000200 ++#define EMAC_RCNTRL_CRC_FWD 0x00004000 ++ ++#define EMAC_TCNTRL_GTS 0x00000001 ++#define EMAC_TCNTRL_HBC 0x00000002 ++#define EMAC_TCNTRL_FDEN 0x00000004 ++#define EMAC_TCNTRL_TFC_PAUSE 0x00000008 ++#define EMAC_TCNTRL_RFC_PAUSE 0x00000010 ++ ++#define EMAC_ECNTRL_RESET 0x00000001 /* reset the EMAC */ ++#define EMAC_ECNTRL_ETHER_EN 0x00000002 /* enable the EMAC */ ++#define EMAC_ECNTRL_MAGIC_ENA 0x00000004 ++#define EMAC_ECNTRL_SLEEP 0x00000008 ++#define EMAC_ECNTRL_SPEED 0x00000020 ++#define EMAC_ECNTRL_DBSWAP 0x00000100 ++ ++#define EMAC_X_WMRK_STRFWD 0x00000100 ++ ++#define EMAC_X_DES_ACTIVE_TDAR 0x01000000 ++#define EMAC_R_DES_ACTIVE_RDAR 0x01000000 ++ ++#define EMAC_RX_SECTION_EMPTY_V 0x00010006 ++/* ++ * The possible operating speeds of the MAC, currently supporting 10, 100 and ++ * 1000Mb modes. ++ */ ++enum mac_speed {SPEED_10M, SPEED_100M, SPEED_1000M, SPEED_1000M_PCS}; ++ ++/* MII-related definitios */ ++#define EMAC_MII_DATA_ST 0x40000000 /* Start of frame delimiter */ ++#define EMAC_MII_DATA_OP_RD 0x20000000 /* Perform a read operation */ ++#define EMAC_MII_DATA_OP_CL45_RD 0x30000000 /* Perform a read operation */ ++#define EMAC_MII_DATA_OP_WR 0x10000000 /* Perform a write operation */ ++#define EMAC_MII_DATA_OP_CL45_WR 0x10000000 /* Perform a write operation */ ++#define EMAC_MII_DATA_PA_MSK 0x0f800000 /* PHY Address field mask */ ++#define EMAC_MII_DATA_RA_MSK 0x007c0000 /* PHY Register field mask */ ++#define EMAC_MII_DATA_TA 0x00020000 /* Turnaround */ ++#define EMAC_MII_DATA_DATAMSK 0x0000ffff /* PHY data field */ ++ ++#define EMAC_MII_DATA_RA_SHIFT 18 /* MII Register address bits */ ++#define EMAC_MII_DATA_RA_MASK 0x1F /* MII Register address mask */ ++#define EMAC_MII_DATA_PA_SHIFT 23 /* MII PHY address bits */ ++#define EMAC_MII_DATA_PA_MASK 0x1F /* MII PHY address mask */ ++ ++#define EMAC_MII_DATA_RA(v) (((v) & EMAC_MII_DATA_RA_MASK) << \ ++ EMAC_MII_DATA_RA_SHIFT) ++#define EMAC_MII_DATA_PA(v) (((v) & EMAC_MII_DATA_RA_MASK) << \ ++ EMAC_MII_DATA_PA_SHIFT) ++#define EMAC_MII_DATA(v) ((v) & 0xffff) ++ ++#define EMAC_MII_SPEED_SHIFT 1 ++#define EMAC_HOLDTIME_SHIFT 8 ++#define EMAC_HOLDTIME_MASK 0x7 ++#define EMAC_HOLDTIME(v) (((v) & EMAC_HOLDTIME_MASK) << \ ++ EMAC_HOLDTIME_SHIFT) ++ ++/* ++ * The Address organisation for the MAC device. All addresses are split into ++ * two 32-bit register fields. The first one (bottom) is the lower 32-bits of ++ * the address and the other field are the high order bits - this may be 16-bits ++ * in the case of MAC addresses, or 32-bits for the hash address. ++ * In terms of memory storage, the first item (bottom) is assumed to be at a ++ * lower address location than 'top'. i.e. top should be at address location of ++ * 'bottom' + 4 bytes. ++ */ ++struct pfe_mac_addr { ++ u32 bottom; /* Lower 32-bits of address. */ ++ u32 top; /* Upper 32-bits of address. */ ++}; ++ ++/* ++ * The following is the organisation of the address filters section of the MAC ++ * registers. The Cadence MAC contains four possible specific address match ++ * addresses, if an incoming frame corresponds to any one of these four ++ * addresses then the frame will be copied to memory. ++ * It is not necessary for all four of the address match registers to be ++ * programmed, this is application dependent. ++ */ ++struct spec_addr { ++ struct pfe_mac_addr one; /* Specific address register 1. */ ++ struct pfe_mac_addr two; /* Specific address register 2. */ ++ struct pfe_mac_addr three; /* Specific address register 3. */ ++ struct pfe_mac_addr four; /* Specific address register 4. */ ++}; ++ ++struct gemac_cfg { ++ u32 mode; ++ u32 speed; ++ u32 duplex; ++}; ++ ++/* EMAC Hash size */ ++#define EMAC_HASH_REG_BITS 64 ++ ++#define EMAC_SPEC_ADDR_MAX 4 ++ ++#endif /* _EMAC_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/gpi.h +@@ -0,0 +1,86 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#ifndef _GPI_H_ ++#define _GPI_H_ ++ ++#define GPI_VERSION 0x00 ++#define GPI_CTRL 0x04 ++#define GPI_RX_CONFIG 0x08 ++#define GPI_HDR_SIZE 0x0c ++#define GPI_BUF_SIZE 0x10 ++#define GPI_LMEM_ALLOC_ADDR 0x14 ++#define GPI_LMEM_FREE_ADDR 0x18 ++#define GPI_DDR_ALLOC_ADDR 0x1c ++#define GPI_DDR_FREE_ADDR 0x20 ++#define GPI_CLASS_ADDR 0x24 ++#define GPI_DRX_FIFO 0x28 ++#define GPI_TRX_FIFO 0x2c ++#define GPI_INQ_PKTPTR 0x30 ++#define GPI_DDR_DATA_OFFSET 0x34 ++#define GPI_LMEM_DATA_OFFSET 0x38 ++#define GPI_TMLF_TX 0x4c ++#define GPI_DTX_ASEQ 0x50 ++#define GPI_FIFO_STATUS 0x54 ++#define GPI_FIFO_DEBUG 0x58 ++#define GPI_TX_PAUSE_TIME 0x5c ++#define GPI_LMEM_SEC_BUF_DATA_OFFSET 0x60 ++#define GPI_DDR_SEC_BUF_DATA_OFFSET 0x64 ++#define GPI_TOE_CHKSUM_EN 0x68 ++#define GPI_OVERRUN_DROPCNT 0x6c ++#define GPI_CSR_MTIP_PAUSE_REG 0x74 ++#define GPI_CSR_MTIP_PAUSE_QUANTUM 0x78 ++#define GPI_CSR_RX_CNT 0x7c ++#define GPI_CSR_TX_CNT 0x80 ++#define GPI_CSR_DEBUG1 0x84 ++#define GPI_CSR_DEBUG2 0x88 ++ ++struct gpi_cfg { ++ u32 lmem_rtry_cnt; ++ u32 tmlf_txthres; ++ u32 aseq_len; ++ u32 mtip_pause_reg; ++}; ++ ++/* GPI commons defines */ ++#define GPI_LMEM_BUF_EN 0x1 ++#define GPI_DDR_BUF_EN 0x1 ++ ++/* EGPI 1 defines */ ++#define EGPI1_LMEM_RTRY_CNT 0x40 ++#define EGPI1_TMLF_TXTHRES 0xBC ++#define EGPI1_ASEQ_LEN 0x50 ++ ++/* EGPI 2 defines */ ++#define EGPI2_LMEM_RTRY_CNT 0x40 ++#define EGPI2_TMLF_TXTHRES 0xBC ++#define EGPI2_ASEQ_LEN 0x40 ++ ++/* EGPI 3 defines */ ++#define EGPI3_LMEM_RTRY_CNT 0x40 ++#define EGPI3_TMLF_TXTHRES 0xBC ++#define EGPI3_ASEQ_LEN 0x40 ++ ++/* HGPI defines */ ++#define HGPI_LMEM_RTRY_CNT 0x40 ++#define HGPI_TMLF_TXTHRES 0xBC ++#define HGPI_ASEQ_LEN 0x40 ++ ++#define EGPI_PAUSE_TIME 0x000007D0 ++#define EGPI_PAUSE_ENABLE 0x40000000 ++#endif /* _GPI_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/hif.h +@@ -0,0 +1,100 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#ifndef _HIF_H_ ++#define _HIF_H_ ++ ++/* @file hif.h. ++ * hif - PFE hif block control and status register. ++ * Mapped on CBUS and accessible from all PE's and ARM. ++ */ ++#define HIF_VERSION (HIF_BASE_ADDR + 0x00) ++#define HIF_TX_CTRL (HIF_BASE_ADDR + 0x04) ++#define HIF_TX_CURR_BD_ADDR (HIF_BASE_ADDR + 0x08) ++#define HIF_TX_ALLOC (HIF_BASE_ADDR + 0x0c) ++#define HIF_TX_BDP_ADDR (HIF_BASE_ADDR + 0x10) ++#define HIF_TX_STATUS (HIF_BASE_ADDR + 0x14) ++#define HIF_RX_CTRL (HIF_BASE_ADDR + 0x20) ++#define HIF_RX_BDP_ADDR (HIF_BASE_ADDR + 0x24) ++#define HIF_RX_STATUS (HIF_BASE_ADDR + 0x30) ++#define HIF_INT_SRC (HIF_BASE_ADDR + 0x34) ++#define HIF_INT_ENABLE (HIF_BASE_ADDR + 0x38) ++#define HIF_POLL_CTRL (HIF_BASE_ADDR + 0x3c) ++#define HIF_RX_CURR_BD_ADDR (HIF_BASE_ADDR + 0x40) ++#define HIF_RX_ALLOC (HIF_BASE_ADDR + 0x44) ++#define HIF_TX_DMA_STATUS (HIF_BASE_ADDR + 0x48) ++#define HIF_RX_DMA_STATUS (HIF_BASE_ADDR + 0x4c) ++#define HIF_INT_COAL (HIF_BASE_ADDR + 0x50) ++ ++/* HIF_INT_SRC/ HIF_INT_ENABLE control bits */ ++#define HIF_INT BIT(0) ++#define HIF_RXBD_INT BIT(1) ++#define HIF_RXPKT_INT BIT(2) ++#define HIF_TXBD_INT BIT(3) ++#define HIF_TXPKT_INT BIT(4) ++ ++/* HIF_TX_CTRL bits */ ++#define HIF_CTRL_DMA_EN BIT(0) ++#define HIF_CTRL_BDP_POLL_CTRL_EN BIT(1) ++#define HIF_CTRL_BDP_CH_START_WSTB BIT(2) ++ ++/* HIF_RX_STATUS bits */ ++#define BDP_CSR_RX_DMA_ACTV BIT(16) ++ ++/* HIF_INT_ENABLE bits */ ++#define HIF_INT_EN BIT(0) ++#define HIF_RXBD_INT_EN BIT(1) ++#define HIF_RXPKT_INT_EN BIT(2) ++#define HIF_TXBD_INT_EN BIT(3) ++#define HIF_TXPKT_INT_EN BIT(4) ++ ++/* HIF_POLL_CTRL bits*/ ++#define HIF_RX_POLL_CTRL_CYCLE 0x0400 ++#define HIF_TX_POLL_CTRL_CYCLE 0x0400 ++ ++/* HIF_INT_COAL bits*/ ++#define HIF_INT_COAL_ENABLE BIT(31) ++ ++/* Buffer descriptor control bits */ ++#define BD_CTRL_BUFLEN_MASK 0x3fff ++#define BD_BUF_LEN(x) ((x) & BD_CTRL_BUFLEN_MASK) ++#define BD_CTRL_CBD_INT_EN BIT(16) ++#define BD_CTRL_PKT_INT_EN BIT(17) ++#define BD_CTRL_LIFM BIT(18) ++#define BD_CTRL_LAST_BD BIT(19) ++#define BD_CTRL_DIR BIT(20) ++#define BD_CTRL_LMEM_CPY BIT(21) /* Valid only for HIF_NOCPY */ ++#define BD_CTRL_PKT_XFER BIT(24) ++#define BD_CTRL_DESC_EN BIT(31) ++#define BD_CTRL_PARSE_DISABLE BIT(25) ++#define BD_CTRL_BRFETCH_DISABLE BIT(26) ++#define BD_CTRL_RTFETCH_DISABLE BIT(27) ++ ++/* Buffer descriptor status bits*/ ++#define BD_STATUS_CONN_ID(x) ((x) & 0xffff) ++#define BD_STATUS_DIR_PROC_ID BIT(16) ++#define BD_STATUS_CONN_ID_EN BIT(17) ++#define BD_STATUS_PE2PROC_ID(x) (((x) & 7) << 18) ++#define BD_STATUS_LE_DATA BIT(21) ++#define BD_STATUS_CHKSUM_EN BIT(22) ++ ++/* HIF Buffer descriptor status bits */ ++#define DIR_PROC_ID BIT(16) ++#define PROC_ID(id) ((id) << 18) ++ ++#endif /* _HIF_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/hif_nocpy.h +@@ -0,0 +1,50 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#ifndef _HIF_NOCPY_H_ ++#define _HIF_NOCPY_H_ ++ ++#define HIF_NOCPY_VERSION (HIF_NOCPY_BASE_ADDR + 0x00) ++#define HIF_NOCPY_TX_CTRL (HIF_NOCPY_BASE_ADDR + 0x04) ++#define HIF_NOCPY_TX_CURR_BD_ADDR (HIF_NOCPY_BASE_ADDR + 0x08) ++#define HIF_NOCPY_TX_ALLOC (HIF_NOCPY_BASE_ADDR + 0x0c) ++#define HIF_NOCPY_TX_BDP_ADDR (HIF_NOCPY_BASE_ADDR + 0x10) ++#define HIF_NOCPY_TX_STATUS (HIF_NOCPY_BASE_ADDR + 0x14) ++#define HIF_NOCPY_RX_CTRL (HIF_NOCPY_BASE_ADDR + 0x20) ++#define HIF_NOCPY_RX_BDP_ADDR (HIF_NOCPY_BASE_ADDR + 0x24) ++#define HIF_NOCPY_RX_STATUS (HIF_NOCPY_BASE_ADDR + 0x30) ++#define HIF_NOCPY_INT_SRC (HIF_NOCPY_BASE_ADDR + 0x34) ++#define HIF_NOCPY_INT_ENABLE (HIF_NOCPY_BASE_ADDR + 0x38) ++#define HIF_NOCPY_POLL_CTRL (HIF_NOCPY_BASE_ADDR + 0x3c) ++#define HIF_NOCPY_RX_CURR_BD_ADDR (HIF_NOCPY_BASE_ADDR + 0x40) ++#define HIF_NOCPY_RX_ALLOC (HIF_NOCPY_BASE_ADDR + 0x44) ++#define HIF_NOCPY_TX_DMA_STATUS (HIF_NOCPY_BASE_ADDR + 0x48) ++#define HIF_NOCPY_RX_DMA_STATUS (HIF_NOCPY_BASE_ADDR + 0x4c) ++#define HIF_NOCPY_RX_INQ0_PKTPTR (HIF_NOCPY_BASE_ADDR + 0x50) ++#define HIF_NOCPY_RX_INQ1_PKTPTR (HIF_NOCPY_BASE_ADDR + 0x54) ++#define HIF_NOCPY_TX_PORT_NO (HIF_NOCPY_BASE_ADDR + 0x60) ++#define HIF_NOCPY_LMEM_ALLOC_ADDR (HIF_NOCPY_BASE_ADDR + 0x64) ++#define HIF_NOCPY_CLASS_ADDR (HIF_NOCPY_BASE_ADDR + 0x68) ++#define HIF_NOCPY_TMU_PORT0_ADDR (HIF_NOCPY_BASE_ADDR + 0x70) ++#define HIF_NOCPY_TMU_PORT1_ADDR (HIF_NOCPY_BASE_ADDR + 0x74) ++#define HIF_NOCPY_TMU_PORT2_ADDR (HIF_NOCPY_BASE_ADDR + 0x7c) ++#define HIF_NOCPY_TMU_PORT3_ADDR (HIF_NOCPY_BASE_ADDR + 0x80) ++#define HIF_NOCPY_TMU_PORT4_ADDR (HIF_NOCPY_BASE_ADDR + 0x84) ++#define HIF_NOCPY_INT_COAL (HIF_NOCPY_BASE_ADDR + 0x90) ++ ++#endif /* _HIF_NOCPY_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/tmu_csr.h +@@ -0,0 +1,168 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#ifndef _TMU_CSR_H_ ++#define _TMU_CSR_H_ ++ ++#define TMU_VERSION (TMU_CSR_BASE_ADDR + 0x000) ++#define TMU_INQ_WATERMARK (TMU_CSR_BASE_ADDR + 0x004) ++#define TMU_PHY_INQ_PKTPTR (TMU_CSR_BASE_ADDR + 0x008) ++#define TMU_PHY_INQ_PKTINFO (TMU_CSR_BASE_ADDR + 0x00c) ++#define TMU_PHY_INQ_FIFO_CNT (TMU_CSR_BASE_ADDR + 0x010) ++#define TMU_SYS_GENERIC_CONTROL (TMU_CSR_BASE_ADDR + 0x014) ++#define TMU_SYS_GENERIC_STATUS (TMU_CSR_BASE_ADDR + 0x018) ++#define TMU_SYS_GEN_CON0 (TMU_CSR_BASE_ADDR + 0x01c) ++#define TMU_SYS_GEN_CON1 (TMU_CSR_BASE_ADDR + 0x020) ++#define TMU_SYS_GEN_CON2 (TMU_CSR_BASE_ADDR + 0x024) ++#define TMU_SYS_GEN_CON3 (TMU_CSR_BASE_ADDR + 0x028) ++#define TMU_SYS_GEN_CON4 (TMU_CSR_BASE_ADDR + 0x02c) ++#define TMU_TEQ_DISABLE_DROPCHK (TMU_CSR_BASE_ADDR + 0x030) ++#define TMU_TEQ_CTRL (TMU_CSR_BASE_ADDR + 0x034) ++#define TMU_TEQ_QCFG (TMU_CSR_BASE_ADDR + 0x038) ++#define TMU_TEQ_DROP_STAT (TMU_CSR_BASE_ADDR + 0x03c) ++#define TMU_TEQ_QAVG (TMU_CSR_BASE_ADDR + 0x040) ++#define TMU_TEQ_WREG_PROB (TMU_CSR_BASE_ADDR + 0x044) ++#define TMU_TEQ_TRANS_STAT (TMU_CSR_BASE_ADDR + 0x048) ++#define TMU_TEQ_HW_PROB_CFG0 (TMU_CSR_BASE_ADDR + 0x04c) ++#define TMU_TEQ_HW_PROB_CFG1 (TMU_CSR_BASE_ADDR + 0x050) ++#define TMU_TEQ_HW_PROB_CFG2 (TMU_CSR_BASE_ADDR + 0x054) ++#define TMU_TEQ_HW_PROB_CFG3 (TMU_CSR_BASE_ADDR + 0x058) ++#define TMU_TEQ_HW_PROB_CFG4 (TMU_CSR_BASE_ADDR + 0x05c) ++#define TMU_TEQ_HW_PROB_CFG5 (TMU_CSR_BASE_ADDR + 0x060) ++#define TMU_TEQ_HW_PROB_CFG6 (TMU_CSR_BASE_ADDR + 0x064) ++#define TMU_TEQ_HW_PROB_CFG7 (TMU_CSR_BASE_ADDR + 0x068) ++#define TMU_TEQ_HW_PROB_CFG8 (TMU_CSR_BASE_ADDR + 0x06c) ++#define TMU_TEQ_HW_PROB_CFG9 (TMU_CSR_BASE_ADDR + 0x070) ++#define TMU_TEQ_HW_PROB_CFG10 (TMU_CSR_BASE_ADDR + 0x074) ++#define TMU_TEQ_HW_PROB_CFG11 (TMU_CSR_BASE_ADDR + 0x078) ++#define TMU_TEQ_HW_PROB_CFG12 (TMU_CSR_BASE_ADDR + 0x07c) ++#define TMU_TEQ_HW_PROB_CFG13 (TMU_CSR_BASE_ADDR + 0x080) ++#define TMU_TEQ_HW_PROB_CFG14 (TMU_CSR_BASE_ADDR + 0x084) ++#define TMU_TEQ_HW_PROB_CFG15 (TMU_CSR_BASE_ADDR + 0x088) ++#define TMU_TEQ_HW_PROB_CFG16 (TMU_CSR_BASE_ADDR + 0x08c) ++#define TMU_TEQ_HW_PROB_CFG17 (TMU_CSR_BASE_ADDR + 0x090) ++#define TMU_TEQ_HW_PROB_CFG18 (TMU_CSR_BASE_ADDR + 0x094) ++#define TMU_TEQ_HW_PROB_CFG19 (TMU_CSR_BASE_ADDR + 0x098) ++#define TMU_TEQ_HW_PROB_CFG20 (TMU_CSR_BASE_ADDR + 0x09c) ++#define TMU_TEQ_HW_PROB_CFG21 (TMU_CSR_BASE_ADDR + 0x0a0) ++#define TMU_TEQ_HW_PROB_CFG22 (TMU_CSR_BASE_ADDR + 0x0a4) ++#define TMU_TEQ_HW_PROB_CFG23 (TMU_CSR_BASE_ADDR + 0x0a8) ++#define TMU_TEQ_HW_PROB_CFG24 (TMU_CSR_BASE_ADDR + 0x0ac) ++#define TMU_TEQ_HW_PROB_CFG25 (TMU_CSR_BASE_ADDR + 0x0b0) ++#define TMU_TDQ_IIFG_CFG (TMU_CSR_BASE_ADDR + 0x0b4) ++/* [9:0] Scheduler Enable for each of the scheduler in the TDQ. ++ * This is a global Enable for all schedulers in PHY0 ++ */ ++#define TMU_TDQ0_SCH_CTRL (TMU_CSR_BASE_ADDR + 0x0b8) ++ ++#define TMU_LLM_CTRL (TMU_CSR_BASE_ADDR + 0x0bc) ++#define TMU_LLM_BASE_ADDR (TMU_CSR_BASE_ADDR + 0x0c0) ++#define TMU_LLM_QUE_LEN (TMU_CSR_BASE_ADDR + 0x0c4) ++#define TMU_LLM_QUE_HEADPTR (TMU_CSR_BASE_ADDR + 0x0c8) ++#define TMU_LLM_QUE_TAILPTR (TMU_CSR_BASE_ADDR + 0x0cc) ++#define TMU_LLM_QUE_DROPCNT (TMU_CSR_BASE_ADDR + 0x0d0) ++#define TMU_INT_EN (TMU_CSR_BASE_ADDR + 0x0d4) ++#define TMU_INT_SRC (TMU_CSR_BASE_ADDR + 0x0d8) ++#define TMU_INQ_STAT (TMU_CSR_BASE_ADDR + 0x0dc) ++#define TMU_CTRL (TMU_CSR_BASE_ADDR + 0x0e0) ++ ++/* [31] Mem Access Command. 0 = Internal Memory Read, 1 = Internal memory ++ * Write [27:24] Byte Enables of the Internal memory access [23:0] Address of ++ * the internal memory. This address is used to access both the PM and DM of ++ * all the PE's ++ */ ++#define TMU_MEM_ACCESS_ADDR (TMU_CSR_BASE_ADDR + 0x0e4) ++ ++/* Internal Memory Access Write Data */ ++#define TMU_MEM_ACCESS_WDATA (TMU_CSR_BASE_ADDR + 0x0e8) ++/* Internal Memory Access Read Data. The commands are blocked ++ * at the mem_access only ++ */ ++#define TMU_MEM_ACCESS_RDATA (TMU_CSR_BASE_ADDR + 0x0ec) ++ ++/* [31:0] PHY0 in queue address (must be initialized with one of the ++ * xxx_INQ_PKTPTR cbus addresses) ++ */ ++#define TMU_PHY0_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x0f0) ++/* [31:0] PHY1 in queue address (must be initialized with one of the ++ * xxx_INQ_PKTPTR cbus addresses) ++ */ ++#define TMU_PHY1_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x0f4) ++/* [31:0] PHY2 in queue address (must be initialized with one of the ++ * xxx_INQ_PKTPTR cbus addresses) ++ */ ++#define TMU_PHY2_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x0f8) ++/* [31:0] PHY3 in queue address (must be initialized with one of the ++ * xxx_INQ_PKTPTR cbus addresses) ++ */ ++#define TMU_PHY3_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x0fc) ++#define TMU_BMU_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x100) ++#define TMU_TX_CTRL (TMU_CSR_BASE_ADDR + 0x104) ++ ++#define TMU_BUS_ACCESS_WDATA (TMU_CSR_BASE_ADDR + 0x108) ++#define TMU_BUS_ACCESS (TMU_CSR_BASE_ADDR + 0x10c) ++#define TMU_BUS_ACCESS_RDATA (TMU_CSR_BASE_ADDR + 0x110) ++ ++#define TMU_PE_SYS_CLK_RATIO (TMU_CSR_BASE_ADDR + 0x114) ++#define TMU_PE_STATUS (TMU_CSR_BASE_ADDR + 0x118) ++#define TMU_TEQ_MAX_THRESHOLD (TMU_CSR_BASE_ADDR + 0x11c) ++/* [31:0] PHY4 in queue address (must be initialized with one of the ++ * xxx_INQ_PKTPTR cbus addresses) ++ */ ++#define TMU_PHY4_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x134) ++/* [9:0] Scheduler Enable for each of the scheduler in the TDQ. ++ * This is a global Enable for all schedulers in PHY1 ++ */ ++#define TMU_TDQ1_SCH_CTRL (TMU_CSR_BASE_ADDR + 0x138) ++/* [9:0] Scheduler Enable for each of the scheduler in the TDQ. ++ * This is a global Enable for all schedulers in PHY2 ++ */ ++#define TMU_TDQ2_SCH_CTRL (TMU_CSR_BASE_ADDR + 0x13c) ++/* [9:0] Scheduler Enable for each of the scheduler in the TDQ. ++ * This is a global Enable for all schedulers in PHY3 ++ */ ++#define TMU_TDQ3_SCH_CTRL (TMU_CSR_BASE_ADDR + 0x140) ++#define TMU_BMU_BUF_SIZE (TMU_CSR_BASE_ADDR + 0x144) ++/* [31:0] PHY5 in queue address (must be initialized with one of the ++ * xxx_INQ_PKTPTR cbus addresses) ++ */ ++#define TMU_PHY5_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x148) ++ ++#define SW_RESET BIT(0) /* Global software reset */ ++#define INQ_RESET BIT(2) ++#define TEQ_RESET BIT(3) ++#define TDQ_RESET BIT(4) ++#define PE_RESET BIT(5) ++#define MEM_INIT BIT(6) ++#define MEM_INIT_DONE BIT(7) ++#define LLM_INIT BIT(8) ++#define LLM_INIT_DONE BIT(9) ++#define ECC_MEM_INIT_DONE BIT(10) ++ ++struct tmu_cfg { ++ u32 pe_sys_clk_ratio; ++ unsigned long llm_base_addr; ++ u32 llm_queue_len; ++}; ++ ++/* Not HW related for pfe_ctrl / pfe common defines */ ++#define DEFAULT_MAX_QDEPTH 80 ++#define DEFAULT_Q0_QDEPTH 511 /*We keep one large queue for host tx qos */ ++#define DEFAULT_TMU3_QDEPTH 127 ++ ++#endif /* _TMU_CSR_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/util_csr.h +@@ -0,0 +1,61 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#ifndef _UTIL_CSR_H_ ++#define _UTIL_CSR_H_ ++ ++#define UTIL_VERSION (UTIL_CSR_BASE_ADDR + 0x000) ++#define UTIL_TX_CTRL (UTIL_CSR_BASE_ADDR + 0x004) ++#define UTIL_INQ_PKTPTR (UTIL_CSR_BASE_ADDR + 0x010) ++ ++#define UTIL_HDR_SIZE (UTIL_CSR_BASE_ADDR + 0x014) ++ ++#define UTIL_PE0_QB_DM_ADDR0 (UTIL_CSR_BASE_ADDR + 0x020) ++#define UTIL_PE0_QB_DM_ADDR1 (UTIL_CSR_BASE_ADDR + 0x024) ++#define UTIL_PE0_RO_DM_ADDR0 (UTIL_CSR_BASE_ADDR + 0x060) ++#define UTIL_PE0_RO_DM_ADDR1 (UTIL_CSR_BASE_ADDR + 0x064) ++ ++#define UTIL_MEM_ACCESS_ADDR (UTIL_CSR_BASE_ADDR + 0x100) ++#define UTIL_MEM_ACCESS_WDATA (UTIL_CSR_BASE_ADDR + 0x104) ++#define UTIL_MEM_ACCESS_RDATA (UTIL_CSR_BASE_ADDR + 0x108) ++ ++#define UTIL_TM_INQ_ADDR (UTIL_CSR_BASE_ADDR + 0x114) ++#define UTIL_PE_STATUS (UTIL_CSR_BASE_ADDR + 0x118) ++ ++#define UTIL_PE_SYS_CLK_RATIO (UTIL_CSR_BASE_ADDR + 0x200) ++#define UTIL_AFULL_THRES (UTIL_CSR_BASE_ADDR + 0x204) ++#define UTIL_GAP_BETWEEN_READS (UTIL_CSR_BASE_ADDR + 0x208) ++#define UTIL_MAX_BUF_CNT (UTIL_CSR_BASE_ADDR + 0x20c) ++#define UTIL_TSQ_FIFO_THRES (UTIL_CSR_BASE_ADDR + 0x210) ++#define UTIL_TSQ_MAX_CNT (UTIL_CSR_BASE_ADDR + 0x214) ++#define UTIL_IRAM_DATA_0 (UTIL_CSR_BASE_ADDR + 0x218) ++#define UTIL_IRAM_DATA_1 (UTIL_CSR_BASE_ADDR + 0x21c) ++#define UTIL_IRAM_DATA_2 (UTIL_CSR_BASE_ADDR + 0x220) ++#define UTIL_IRAM_DATA_3 (UTIL_CSR_BASE_ADDR + 0x224) ++ ++#define UTIL_BUS_ACCESS_ADDR (UTIL_CSR_BASE_ADDR + 0x228) ++#define UTIL_BUS_ACCESS_WDATA (UTIL_CSR_BASE_ADDR + 0x22c) ++#define UTIL_BUS_ACCESS_RDATA (UTIL_CSR_BASE_ADDR + 0x230) ++ ++#define UTIL_INQ_AFULL_THRES (UTIL_CSR_BASE_ADDR + 0x234) ++ ++struct util_cfg { ++ u32 pe_sys_clk_ratio; ++}; ++ ++#endif /* _UTIL_CSR_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/pfe.h +@@ -0,0 +1,372 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#ifndef _PFE_H_ ++#define _PFE_H_ ++ ++#include "cbus.h" ++ ++#define CLASS_DMEM_BASE_ADDR(i) (0x00000000 | ((i) << 20)) ++/* ++ * Only valid for mem access register interface ++ */ ++#define CLASS_IMEM_BASE_ADDR(i) (0x00000000 | ((i) << 20)) ++#define CLASS_DMEM_SIZE 0x00002000 ++#define CLASS_IMEM_SIZE 0x00008000 ++ ++#define TMU_DMEM_BASE_ADDR(i) (0x00000000 + ((i) << 20)) ++/* ++ * Only valid for mem access register interface ++ */ ++#define TMU_IMEM_BASE_ADDR(i) (0x00000000 + ((i) << 20)) ++#define TMU_DMEM_SIZE 0x00000800 ++#define TMU_IMEM_SIZE 0x00002000 ++ ++#define UTIL_DMEM_BASE_ADDR 0x00000000 ++#define UTIL_DMEM_SIZE 0x00002000 ++ ++#define PE_LMEM_BASE_ADDR 0xc3010000 ++#define PE_LMEM_SIZE 0x8000 ++#define PE_LMEM_END (PE_LMEM_BASE_ADDR + PE_LMEM_SIZE) ++ ++#define DMEM_BASE_ADDR 0x00000000 ++#define DMEM_SIZE 0x2000 /* TMU has less... */ ++#define DMEM_END (DMEM_BASE_ADDR + DMEM_SIZE) ++ ++#define PMEM_BASE_ADDR 0x00010000 ++#define PMEM_SIZE 0x8000 /* TMU has less... */ ++#define PMEM_END (PMEM_BASE_ADDR + PMEM_SIZE) ++ ++/* These check memory ranges from PE point of view/memory map */ ++#define IS_DMEM(addr, len) \ ++ ({ typeof(addr) addr_ = (addr); \ ++ ((unsigned long)(addr_) >= DMEM_BASE_ADDR) && \ ++ (((unsigned long)(addr_) + (len)) <= DMEM_END); }) ++ ++#define IS_PMEM(addr, len) \ ++ ({ typeof(addr) addr_ = (addr); \ ++ ((unsigned long)(addr_) >= PMEM_BASE_ADDR) && \ ++ (((unsigned long)(addr_) + (len)) <= PMEM_END); }) ++ ++#define IS_PE_LMEM(addr, len) \ ++ ({ typeof(addr) addr_ = (addr); \ ++ ((unsigned long)(addr_) >= \ ++ PE_LMEM_BASE_ADDR) && \ ++ (((unsigned long)(addr_) + \ ++ (len)) <= PE_LMEM_END); }) ++ ++#define IS_PFE_LMEM(addr, len) \ ++ ({ typeof(addr) addr_ = (addr); \ ++ ((unsigned long)(addr_) >= \ ++ CBUS_VIRT_TO_PFE(LMEM_BASE_ADDR)) && \ ++ (((unsigned long)(addr_) + (len)) <= \ ++ CBUS_VIRT_TO_PFE(LMEM_END)); }) ++ ++#define __IS_PHYS_DDR(addr, len) \ ++ ({ typeof(addr) addr_ = (addr); \ ++ ((unsigned long)(addr_) >= \ ++ DDR_PHYS_BASE_ADDR) && \ ++ (((unsigned long)(addr_) + (len)) <= \ ++ DDR_PHYS_END); }) ++ ++#define IS_PHYS_DDR(addr, len) __IS_PHYS_DDR(DDR_PFE_TO_PHYS(addr), len) ++ ++/* ++ * If using a run-time virtual address for the cbus base address use this code ++ */ ++extern void *cbus_base_addr; ++extern void *ddr_base_addr; ++extern unsigned long ddr_phys_base_addr; ++extern unsigned int ddr_size; ++ ++#define CBUS_BASE_ADDR cbus_base_addr ++#define DDR_PHYS_BASE_ADDR ddr_phys_base_addr ++#define DDR_BASE_ADDR ddr_base_addr ++#define DDR_SIZE ddr_size ++ ++#define DDR_PHYS_END (DDR_PHYS_BASE_ADDR + DDR_SIZE) ++ ++#define LS1012A_PFE_RESET_WA /* ++ * PFE doesn't have global reset and re-init ++ * should takecare few things to make PFE ++ * functional after reset ++ */ ++#define PFE_CBUS_PHYS_BASE_ADDR 0xc0000000 /* CBUS physical base address ++ * as seen by PE's. ++ */ ++/* CBUS physical base address as seen by PE's. */ ++#define PFE_CBUS_PHYS_BASE_ADDR_FROM_PFE 0xc0000000 ++ ++#define DDR_PHYS_TO_PFE(p) (((unsigned long int)(p)) & 0x7FFFFFFF) ++#define DDR_PFE_TO_PHYS(p) (((unsigned long int)(p)) | 0x80000000) ++#define CBUS_PHYS_TO_PFE(p) (((p) - PFE_CBUS_PHYS_BASE_ADDR) + \ ++ PFE_CBUS_PHYS_BASE_ADDR_FROM_PFE) ++/* Translates to PFE address map */ ++ ++#define DDR_PHYS_TO_VIRT(p) (((p) - DDR_PHYS_BASE_ADDR) + DDR_BASE_ADDR) ++#define DDR_VIRT_TO_PHYS(v) (((v) - DDR_BASE_ADDR) + DDR_PHYS_BASE_ADDR) ++#define DDR_VIRT_TO_PFE(p) (DDR_PHYS_TO_PFE(DDR_VIRT_TO_PHYS(p))) ++ ++#define CBUS_VIRT_TO_PFE(v) (((v) - CBUS_BASE_ADDR) + \ ++ PFE_CBUS_PHYS_BASE_ADDR) ++#define CBUS_PFE_TO_VIRT(p) (((unsigned long int)(p) - \ ++ PFE_CBUS_PHYS_BASE_ADDR) + CBUS_BASE_ADDR) ++ ++/* The below part of the code is used in QOS control driver from host */ ++#define TMU_APB_BASE_ADDR 0xc1000000 /* TMU base address seen by ++ * pe's ++ */ ++ ++enum { ++ CLASS0_ID = 0, ++ CLASS1_ID, ++ CLASS2_ID, ++ CLASS3_ID, ++ CLASS4_ID, ++ CLASS5_ID, ++ TMU0_ID, ++ TMU1_ID, ++ TMU2_ID, ++ TMU3_ID, ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ UTIL_ID, ++#endif ++ MAX_PE ++}; ++ ++#define CLASS_MASK (BIT(CLASS0_ID) | BIT(CLASS1_ID) |\ ++ BIT(CLASS2_ID) | BIT(CLASS3_ID) |\ ++ BIT(CLASS4_ID) | BIT(CLASS5_ID)) ++#define CLASS_MAX_ID CLASS5_ID ++ ++#define TMU_MASK (BIT(TMU0_ID) | BIT(TMU1_ID) |\ ++ BIT(TMU3_ID)) ++ ++#define TMU_MAX_ID TMU3_ID ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++#define UTIL_MASK BIT(UTIL_ID) ++#endif ++ ++struct pe_status { ++ u32 cpu_state; ++ u32 activity_counter; ++ u32 rx; ++ union { ++ u32 tx; ++ u32 tmu_qstatus; ++ }; ++ u32 drop; ++#if defined(CFG_PE_DEBUG) ++ u32 debug_indicator; ++ u32 debug[16]; ++#endif ++} __aligned(16); ++ ++struct pe_sync_mailbox { ++ u32 stop; ++ u32 stopped; ++}; ++ ++/* Drop counter definitions */ ++ ++#define CLASS_NUM_DROP_COUNTERS 13 ++#define UTIL_NUM_DROP_COUNTERS 8 ++ ++/* PE information. ++ * Structure containing PE's specific information. It is used to create ++ * generic C functions common to all PE's. ++ * Before using the library functions this structure needs to be initialized ++ * with the different registers virtual addresses ++ * (according to the ARM MMU mmaping). The default initialization supports a ++ * virtual == physical mapping. ++ */ ++struct pe_info { ++ u32 dmem_base_addr; /* PE's dmem base address */ ++ u32 pmem_base_addr; /* PE's pmem base address */ ++ u32 pmem_size; /* PE's pmem size */ ++ ++ void *mem_access_wdata; /* PE's _MEM_ACCESS_WDATA register ++ * address ++ */ ++ void *mem_access_addr; /* PE's _MEM_ACCESS_ADDR register ++ * address ++ */ ++ void *mem_access_rdata; /* PE's _MEM_ACCESS_RDATA register ++ * address ++ */ ++}; ++ ++void pe_lmem_read(u32 *dst, u32 len, u32 offset); ++void pe_lmem_write(u32 *src, u32 len, u32 offset); ++ ++void pe_dmem_memcpy_to32(int id, u32 dst, const void *src, unsigned int len); ++void pe_pmem_memcpy_to32(int id, u32 dst, const void *src, unsigned int len); ++ ++u32 pe_pmem_read(int id, u32 addr, u8 size); ++ ++void pe_dmem_write(int id, u32 val, u32 addr, u8 size); ++u32 pe_dmem_read(int id, u32 addr, u8 size); ++void class_pe_lmem_memcpy_to32(u32 dst, const void *src, unsigned int len); ++void class_pe_lmem_memset(u32 dst, int val, unsigned int len); ++void class_bus_write(u32 val, u32 addr, u8 size); ++u32 class_bus_read(u32 addr, u8 size); ++ ++#define class_bus_readl(addr) class_bus_read(addr, 4) ++#define class_bus_readw(addr) class_bus_read(addr, 2) ++#define class_bus_readb(addr) class_bus_read(addr, 1) ++ ++#define class_bus_writel(val, addr) class_bus_write(val, addr, 4) ++#define class_bus_writew(val, addr) class_bus_write(val, addr, 2) ++#define class_bus_writeb(val, addr) class_bus_write(val, addr, 1) ++ ++#define pe_dmem_readl(id, addr) pe_dmem_read(id, addr, 4) ++#define pe_dmem_readw(id, addr) pe_dmem_read(id, addr, 2) ++#define pe_dmem_readb(id, addr) pe_dmem_read(id, addr, 1) ++ ++#define pe_dmem_writel(id, val, addr) pe_dmem_write(id, val, addr, 4) ++#define pe_dmem_writew(id, val, addr) pe_dmem_write(id, val, addr, 2) ++#define pe_dmem_writeb(id, val, addr) pe_dmem_write(id, val, addr, 1) ++ ++/*int pe_load_elf_section(int id, const void *data, elf32_shdr *shdr); */ ++int pe_load_elf_section(int id, const void *data, struct elf32_shdr *shdr, ++ struct device *dev); ++ ++void pfe_lib_init(void *cbus_base, void *ddr_base, unsigned long ddr_phys_base, ++ unsigned int ddr_size); ++void bmu_init(void *base, struct BMU_CFG *cfg); ++void bmu_reset(void *base); ++void bmu_enable(void *base); ++void bmu_disable(void *base); ++void bmu_set_config(void *base, struct BMU_CFG *cfg); ++ ++/* ++ * An enumerated type for loopback values. This can be one of three values, no ++ * loopback -normal operation, local loopback with internal loopback module of ++ * MAC or PHY loopback which is through the external PHY. ++ */ ++#ifndef __MAC_LOOP_ENUM__ ++#define __MAC_LOOP_ENUM__ ++enum mac_loop {LB_NONE, LB_EXT, LB_LOCAL}; ++#endif ++ ++void gemac_init(void *base, void *config); ++void gemac_disable_rx_checksum_offload(void *base); ++void gemac_enable_rx_checksum_offload(void *base); ++void gemac_set_mdc_div(void *base, int mdc_div); ++void gemac_set_speed(void *base, enum mac_speed gem_speed); ++void gemac_set_duplex(void *base, int duplex); ++void gemac_set_mode(void *base, int mode); ++void gemac_enable(void *base); ++void gemac_tx_disable(void *base); ++void gemac_tx_enable(void *base); ++void gemac_disable(void *base); ++void gemac_reset(void *base); ++void gemac_set_address(void *base, struct spec_addr *addr); ++struct spec_addr gemac_get_address(void *base); ++void gemac_set_loop(void *base, enum mac_loop gem_loop); ++void gemac_set_laddr1(void *base, struct pfe_mac_addr *address); ++void gemac_set_laddr2(void *base, struct pfe_mac_addr *address); ++void gemac_set_laddr3(void *base, struct pfe_mac_addr *address); ++void gemac_set_laddr4(void *base, struct pfe_mac_addr *address); ++void gemac_set_laddrN(void *base, struct pfe_mac_addr *address, ++ unsigned int entry_index); ++void gemac_clear_laddr1(void *base); ++void gemac_clear_laddr2(void *base); ++void gemac_clear_laddr3(void *base); ++void gemac_clear_laddr4(void *base); ++void gemac_clear_laddrN(void *base, unsigned int entry_index); ++struct pfe_mac_addr gemac_get_hash(void *base); ++void gemac_set_hash(void *base, struct pfe_mac_addr *hash); ++struct pfe_mac_addr gem_get_laddr1(void *base); ++struct pfe_mac_addr gem_get_laddr2(void *base); ++struct pfe_mac_addr gem_get_laddr3(void *base); ++struct pfe_mac_addr gem_get_laddr4(void *base); ++struct pfe_mac_addr gem_get_laddrN(void *base, unsigned int entry_index); ++void gemac_set_config(void *base, struct gemac_cfg *cfg); ++void gemac_allow_broadcast(void *base); ++void gemac_no_broadcast(void *base); ++void gemac_enable_1536_rx(void *base); ++void gemac_disable_1536_rx(void *base); ++void gemac_enable_rx_jmb(void *base); ++void gemac_disable_rx_jmb(void *base); ++void gemac_enable_stacked_vlan(void *base); ++void gemac_disable_stacked_vlan(void *base); ++void gemac_enable_pause_rx(void *base); ++void gemac_disable_pause_rx(void *base); ++void gemac_enable_copy_all(void *base); ++void gemac_disable_copy_all(void *base); ++void gemac_set_bus_width(void *base, int width); ++void gemac_set_wol(void *base, u32 wol_conf); ++ ++void gpi_init(void *base, struct gpi_cfg *cfg); ++void gpi_reset(void *base); ++void gpi_enable(void *base); ++void gpi_disable(void *base); ++void gpi_set_config(void *base, struct gpi_cfg *cfg); ++ ++void class_init(struct class_cfg *cfg); ++void class_reset(void); ++void class_enable(void); ++void class_disable(void); ++void class_set_config(struct class_cfg *cfg); ++ ++void tmu_reset(void); ++void tmu_init(struct tmu_cfg *cfg); ++void tmu_enable(u32 pe_mask); ++void tmu_disable(u32 pe_mask); ++u32 tmu_qstatus(u32 if_id); ++u32 tmu_pkts_processed(u32 if_id); ++ ++void util_init(struct util_cfg *cfg); ++void util_reset(void); ++void util_enable(void); ++void util_disable(void); ++ ++void hif_init(void); ++void hif_tx_enable(void); ++void hif_tx_disable(void); ++void hif_rx_enable(void); ++void hif_rx_disable(void); ++ ++/* Get Chip Revision level ++ * ++ */ ++static inline unsigned int CHIP_REVISION(void) ++{ ++ /*For LS1012A return always 1 */ ++ return 1; ++} ++ ++/* Start HIF rx DMA ++ * ++ */ ++static inline void hif_rx_dma_start(void) ++{ ++ writel(HIF_CTRL_DMA_EN | HIF_CTRL_BDP_CH_START_WSTB, HIF_RX_CTRL); ++} ++ ++/* Start HIF tx DMA ++ * ++ */ ++static inline void hif_tx_dma_start(void) ++{ ++ writel(HIF_CTRL_DMA_EN | HIF_CTRL_BDP_CH_START_WSTB, HIF_TX_CTRL); ++} ++ ++#endif /* _PFE_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_ctrl.c +@@ -0,0 +1,238 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "pfe_mod.h" ++#include "pfe_ctrl.h" ++ ++#define TIMEOUT_MS 1000 ++ ++int relax(unsigned long end) ++{ ++ if (time_after(jiffies, end)) { ++ if (time_after(jiffies, end + (TIMEOUT_MS * HZ) / 1000)) ++ return -1; ++ ++ if (need_resched()) ++ schedule(); ++ } ++ ++ return 0; ++} ++ ++void pfe_ctrl_suspend(struct pfe_ctrl *ctrl) ++{ ++ int id; ++ ++ mutex_lock(&ctrl->mutex); ++ ++ for (id = CLASS0_ID; id <= CLASS_MAX_ID; id++) ++ pe_dmem_write(id, cpu_to_be32(0x1), CLASS_DM_RESUME, 4); ++ ++ for (id = TMU0_ID; id <= TMU_MAX_ID; id++) { ++ if (id == TMU2_ID) ++ continue; ++ pe_dmem_write(id, cpu_to_be32(0x1), TMU_DM_RESUME, 4); ++ } ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ pe_dmem_write(UTIL_ID, cpu_to_be32(0x1), UTIL_DM_RESUME, 4); ++#endif ++ mutex_unlock(&ctrl->mutex); ++} ++ ++void pfe_ctrl_resume(struct pfe_ctrl *ctrl) ++{ ++ int pe_mask = CLASS_MASK | TMU_MASK; ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ pe_mask |= UTIL_MASK; ++#endif ++ mutex_lock(&ctrl->mutex); ++ pe_start(&pfe->ctrl, pe_mask); ++ mutex_unlock(&ctrl->mutex); ++} ++ ++/* PE sync stop. ++ * Stops packet processing for a list of PE's (specified using a bitmask). ++ * The caller must hold ctrl->mutex. ++ * ++ * @param ctrl Control context ++ * @param pe_mask Mask of PE id's to stop ++ * ++ */ ++int pe_sync_stop(struct pfe_ctrl *ctrl, int pe_mask) ++{ ++ struct pe_sync_mailbox *mbox; ++ int pe_stopped = 0; ++ unsigned long end = jiffies + 2; ++ int i; ++ ++ pe_mask &= 0x2FF; /*Exclude Util + TMU2 */ ++ ++ for (i = 0; i < MAX_PE; i++) ++ if (pe_mask & (1 << i)) { ++ mbox = (void *)ctrl->sync_mailbox_baseaddr[i]; ++ ++ pe_dmem_write(i, cpu_to_be32(0x1), (unsigned ++ long)&mbox->stop, 4); ++ } ++ ++ while (pe_stopped != pe_mask) { ++ for (i = 0; i < MAX_PE; i++) ++ if ((pe_mask & (1 << i)) && !(pe_stopped & (1 << i))) { ++ mbox = (void *)ctrl->sync_mailbox_baseaddr[i]; ++ ++ if (pe_dmem_read(i, (unsigned ++ long)&mbox->stopped, 4) & ++ cpu_to_be32(0x1)) ++ pe_stopped |= (1 << i); ++ } ++ ++ if (relax(end) < 0) ++ goto err; ++ } ++ ++ return 0; ++ ++err: ++ pr_err("%s: timeout, %x %x\n", __func__, pe_mask, pe_stopped); ++ ++ for (i = 0; i < MAX_PE; i++) ++ if (pe_mask & (1 << i)) { ++ mbox = (void *)ctrl->sync_mailbox_baseaddr[i]; ++ ++ pe_dmem_write(i, cpu_to_be32(0x0), (unsigned ++ long)&mbox->stop, 4); ++ } ++ ++ return -EIO; ++} ++ ++/* PE start. ++ * Starts packet processing for a list of PE's (specified using a bitmask). ++ * The caller must hold ctrl->mutex. ++ * ++ * @param ctrl Control context ++ * @param pe_mask Mask of PE id's to start ++ * ++ */ ++void pe_start(struct pfe_ctrl *ctrl, int pe_mask) ++{ ++ struct pe_sync_mailbox *mbox; ++ int i; ++ ++ for (i = 0; i < MAX_PE; i++) ++ if (pe_mask & (1 << i)) { ++ mbox = (void *)ctrl->sync_mailbox_baseaddr[i]; ++ ++ pe_dmem_write(i, cpu_to_be32(0x0), (unsigned ++ long)&mbox->stop, 4); ++ } ++} ++ ++/* This function will ensure all PEs are put in to idle state */ ++int pe_reset_all(struct pfe_ctrl *ctrl) ++{ ++ struct pe_sync_mailbox *mbox; ++ int pe_stopped = 0; ++ unsigned long end = jiffies + 2; ++ int i; ++ int pe_mask = CLASS_MASK | TMU_MASK; ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ pe_mask |= UTIL_MASK; ++#endif ++ ++ for (i = 0; i < MAX_PE; i++) ++ if (pe_mask & (1 << i)) { ++ mbox = (void *)ctrl->sync_mailbox_baseaddr[i]; ++ ++ pe_dmem_write(i, cpu_to_be32(0x2), (unsigned ++ long)&mbox->stop, 4); ++ } ++ ++ while (pe_stopped != pe_mask) { ++ for (i = 0; i < MAX_PE; i++) ++ if ((pe_mask & (1 << i)) && !(pe_stopped & (1 << i))) { ++ mbox = (void *)ctrl->sync_mailbox_baseaddr[i]; ++ ++ if (pe_dmem_read(i, (unsigned long) ++ &mbox->stopped, 4) & ++ cpu_to_be32(0x1)) ++ pe_stopped |= (1 << i); ++ } ++ ++ if (relax(end) < 0) ++ goto err; ++ } ++ ++ return 0; ++ ++err: ++ pr_err("%s: timeout, %x %x\n", __func__, pe_mask, pe_stopped); ++ return -EIO; ++} ++ ++int pfe_ctrl_init(struct pfe *pfe) ++{ ++ struct pfe_ctrl *ctrl = &pfe->ctrl; ++ int id; ++ ++ pr_info("%s\n", __func__); ++ ++ mutex_init(&ctrl->mutex); ++ spin_lock_init(&ctrl->lock); ++ ++ for (id = CLASS0_ID; id <= CLASS_MAX_ID; id++) { ++ ctrl->sync_mailbox_baseaddr[id] = CLASS_DM_SYNC_MBOX; ++ ctrl->msg_mailbox_baseaddr[id] = CLASS_DM_MSG_MBOX; ++ } ++ ++ for (id = TMU0_ID; id <= TMU_MAX_ID; id++) { ++ if (id == TMU2_ID) ++ continue; ++ ctrl->sync_mailbox_baseaddr[id] = TMU_DM_SYNC_MBOX; ++ ctrl->msg_mailbox_baseaddr[id] = TMU_DM_MSG_MBOX; ++ } ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ ctrl->sync_mailbox_baseaddr[UTIL_ID] = UTIL_DM_SYNC_MBOX; ++ ctrl->msg_mailbox_baseaddr[UTIL_ID] = UTIL_DM_MSG_MBOX; ++#endif ++ ++ ctrl->hash_array_baseaddr = pfe->ddr_baseaddr + ROUTE_TABLE_BASEADDR; ++ ctrl->hash_array_phys_baseaddr = pfe->ddr_phys_baseaddr + ++ ROUTE_TABLE_BASEADDR; ++ ++ ctrl->dev = pfe->dev; ++ ++ pr_info("%s finished\n", __func__); ++ ++ return 0; ++} ++ ++void pfe_ctrl_exit(struct pfe *pfe) ++{ ++ pr_info("%s\n", __func__); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_ctrl.h +@@ -0,0 +1,112 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#ifndef _PFE_CTRL_H_ ++#define _PFE_CTRL_H_ ++ ++#include ++ ++#include "pfe_mod.h" ++#include "pfe/pfe.h" ++ ++#define DMA_BUF_SIZE_128 0x80 /* enough for 1 conntracks */ ++#define DMA_BUF_SIZE_256 0x100 ++/* enough for 2 conntracks, 1 bridge entry or 1 multicast entry */ ++#define DMA_BUF_SIZE_512 0x200 ++/* 512bytes dma allocated buffers used by rtp relay feature */ ++#define DMA_BUF_MIN_ALIGNMENT 8 ++#define DMA_BUF_BOUNDARY (4 * 1024) ++/* bursts can not cross 4k boundary */ ++ ++#define CMD_TX_ENABLE 0x0501 ++#define CMD_TX_DISABLE 0x0502 ++ ++#define CMD_RX_LRO 0x0011 ++#define CMD_PKTCAP_ENABLE 0x0d01 ++#define CMD_QM_EXPT_RATE 0x020c ++ ++#define CLASS_DM_SH_STATIC (0x800) ++#define CLASS_DM_CPU_TICKS (CLASS_DM_SH_STATIC) ++#define CLASS_DM_SYNC_MBOX (0x808) ++#define CLASS_DM_MSG_MBOX (0x810) ++#define CLASS_DM_DROP_CNTR (0x820) ++#define CLASS_DM_RESUME (0x854) ++#define CLASS_DM_PESTATUS (0x860) ++ ++#define TMU_DM_SH_STATIC (0x80) ++#define TMU_DM_CPU_TICKS (TMU_DM_SH_STATIC) ++#define TMU_DM_SYNC_MBOX (0x88) ++#define TMU_DM_MSG_MBOX (0x90) ++#define TMU_DM_RESUME (0xA0) ++#define TMU_DM_PESTATUS (0xB0) ++#define TMU_DM_CONTEXT (0x300) ++#define TMU_DM_TX_TRANS (0x480) ++ ++#define UTIL_DM_SH_STATIC (0x0) ++#define UTIL_DM_CPU_TICKS (UTIL_DM_SH_STATIC) ++#define UTIL_DM_SYNC_MBOX (0x8) ++#define UTIL_DM_MSG_MBOX (0x10) ++#define UTIL_DM_DROP_CNTR (0x20) ++#define UTIL_DM_RESUME (0x40) ++#define UTIL_DM_PESTATUS (0x50) ++ ++struct pfe_ctrl { ++ struct mutex mutex; /* to serialize pfe control access */ ++ spinlock_t lock; ++ ++ void *dma_pool; ++ void *dma_pool_512; ++ void *dma_pool_128; ++ ++ struct device *dev; ++ ++ void *hash_array_baseaddr; /* ++ * Virtual base address of ++ * the conntrack hash array ++ */ ++ unsigned long hash_array_phys_baseaddr; /* ++ * Physical base address of ++ * the conntrack hash array ++ */ ++ ++ int (*event_cb)(u16, u16, u16*); ++ ++ unsigned long sync_mailbox_baseaddr[MAX_PE]; /* ++ * Sync mailbox PFE ++ * internal address, ++ * initialized ++ * when parsing elf images ++ */ ++ unsigned long msg_mailbox_baseaddr[MAX_PE]; /* ++ * Msg mailbox PFE internal ++ * address, initialized ++ * when parsing elf images ++ */ ++ unsigned int sys_clk; /* AXI clock value, in KHz */ ++}; ++ ++int pfe_ctrl_init(struct pfe *pfe); ++void pfe_ctrl_exit(struct pfe *pfe); ++int pe_sync_stop(struct pfe_ctrl *ctrl, int pe_mask); ++void pe_start(struct pfe_ctrl *ctrl, int pe_mask); ++int pe_reset_all(struct pfe_ctrl *ctrl); ++void pfe_ctrl_suspend(struct pfe_ctrl *ctrl); ++void pfe_ctrl_resume(struct pfe_ctrl *ctrl); ++int relax(unsigned long end); ++ ++#endif /* _PFE_CTRL_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_debugfs.c +@@ -0,0 +1,111 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#include ++#include ++#include ++ ++#include "pfe_mod.h" ++ ++static int dmem_show(struct seq_file *s, void *unused) ++{ ++ u32 dmem_addr, val; ++ int id = (long int)s->private; ++ int i; ++ ++ for (dmem_addr = 0; dmem_addr < CLASS_DMEM_SIZE; dmem_addr += 8 * 4) { ++ seq_printf(s, "%04x:", dmem_addr); ++ ++ for (i = 0; i < 8; i++) { ++ val = pe_dmem_read(id, dmem_addr + i * 4, 4); ++ seq_printf(s, " %02x %02x %02x %02x", val & 0xff, ++ (val >> 8) & 0xff, (val >> 16) & 0xff, ++ (val >> 24) & 0xff); ++ } ++ ++ seq_puts(s, "\n"); ++ } ++ ++ return 0; ++} ++ ++static int dmem_open(struct inode *inode, struct file *file) ++{ ++ return single_open(file, dmem_show, inode->i_private); ++} ++ ++static const struct file_operations dmem_fops = { ++ .open = dmem_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = single_release, ++}; ++ ++int pfe_debugfs_init(struct pfe *pfe) ++{ ++ struct dentry *d; ++ ++ pr_info("%s\n", __func__); ++ ++ pfe->dentry = debugfs_create_dir("pfe", NULL); ++ if (IS_ERR_OR_NULL(pfe->dentry)) ++ goto err_dir; ++ ++ d = debugfs_create_file("pe0_dmem", 0444, pfe->dentry, (void *)0, ++ &dmem_fops); ++ if (IS_ERR_OR_NULL(d)) ++ goto err_pe; ++ ++ d = debugfs_create_file("pe1_dmem", 0444, pfe->dentry, (void *)1, ++ &dmem_fops); ++ if (IS_ERR_OR_NULL(d)) ++ goto err_pe; ++ ++ d = debugfs_create_file("pe2_dmem", 0444, pfe->dentry, (void *)2, ++ &dmem_fops); ++ if (IS_ERR_OR_NULL(d)) ++ goto err_pe; ++ ++ d = debugfs_create_file("pe3_dmem", 0444, pfe->dentry, (void *)3, ++ &dmem_fops); ++ if (IS_ERR_OR_NULL(d)) ++ goto err_pe; ++ ++ d = debugfs_create_file("pe4_dmem", 0444, pfe->dentry, (void *)4, ++ &dmem_fops); ++ if (IS_ERR_OR_NULL(d)) ++ goto err_pe; ++ ++ d = debugfs_create_file("pe5_dmem", 0444, pfe->dentry, (void *)5, ++ &dmem_fops); ++ if (IS_ERR_OR_NULL(d)) ++ goto err_pe; ++ ++ return 0; ++ ++err_pe: ++ debugfs_remove_recursive(pfe->dentry); ++ ++err_dir: ++ return -1; ++} ++ ++void pfe_debugfs_exit(struct pfe *pfe) ++{ ++ debugfs_remove_recursive(pfe->dentry); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_debugfs.h +@@ -0,0 +1,25 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#ifndef _PFE_DEBUGFS_H_ ++#define _PFE_DEBUGFS_H_ ++ ++int pfe_debugfs_init(struct pfe *pfe); ++void pfe_debugfs_exit(struct pfe *pfe); ++ ++#endif /* _PFE_DEBUGFS_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_eth.c +@@ -0,0 +1,2434 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++/* @pfe_eth.c. ++ * Ethernet driver for to handle exception path for PFE. ++ * - uses HIF functions to send/receive packets. ++ * - uses ctrl function to start/stop interfaces. ++ * - uses direct register accesses to control phy operation. ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++#if defined(CONFIG_NF_CONNTRACK_MARK) ++#include ++#endif ++ ++#include "pfe_mod.h" ++#include "pfe_eth.h" ++ ++static void *cbus_emac_base[3]; ++static void *cbus_gpi_base[3]; ++ ++/* Forward Declaration */ ++static void pfe_eth_exit_one(struct pfe_eth_priv_s *priv); ++static void pfe_eth_flush_tx(struct pfe_eth_priv_s *priv); ++static void pfe_eth_flush_txQ(struct pfe_eth_priv_s *priv, int tx_q_num, int ++ from_tx, int n_desc); ++ ++unsigned int gemac_regs[] = { ++ 0x0004, /* Interrupt event */ ++ 0x0008, /* Interrupt mask */ ++ 0x0024, /* Ethernet control */ ++ 0x0064, /* MIB Control/Status */ ++ 0x0084, /* Receive control/status */ ++ 0x00C4, /* Transmit control */ ++ 0x00E4, /* Physical address low */ ++ 0x00E8, /* Physical address high */ ++ 0x0144, /* Transmit FIFO Watermark and Store and Forward Control*/ ++ 0x0190, /* Receive FIFO Section Full Threshold */ ++ 0x01A0, /* Transmit FIFO Section Empty Threshold */ ++ 0x01B0, /* Frame Truncation Length */ ++}; ++ ++/********************************************************************/ ++/* SYSFS INTERFACE */ ++/********************************************************************/ ++ ++#ifdef PFE_ETH_NAPI_STATS ++/* ++ * pfe_eth_show_napi_stats ++ */ ++static ssize_t pfe_eth_show_napi_stats(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ ssize_t len = 0; ++ ++ len += sprintf(buf + len, "sched: %u\n", ++ priv->napi_counters[NAPI_SCHED_COUNT]); ++ len += sprintf(buf + len, "poll: %u\n", ++ priv->napi_counters[NAPI_POLL_COUNT]); ++ len += sprintf(buf + len, "packet: %u\n", ++ priv->napi_counters[NAPI_PACKET_COUNT]); ++ len += sprintf(buf + len, "budget: %u\n", ++ priv->napi_counters[NAPI_FULL_BUDGET_COUNT]); ++ len += sprintf(buf + len, "desc: %u\n", ++ priv->napi_counters[NAPI_DESC_COUNT]); ++ ++ return len; ++} ++ ++/* ++ * pfe_eth_set_napi_stats ++ */ ++static ssize_t pfe_eth_set_napi_stats(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ ++ memset(priv->napi_counters, 0, sizeof(priv->napi_counters)); ++ ++ return count; ++} ++#endif ++#ifdef PFE_ETH_TX_STATS ++/* pfe_eth_show_tx_stats ++ * ++ */ ++static ssize_t pfe_eth_show_tx_stats(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ ssize_t len = 0; ++ int i; ++ ++ len += sprintf(buf + len, "TX queues stats:\n"); ++ ++ for (i = 0; i < emac_txq_cnt; i++) { ++ struct netdev_queue *tx_queue = netdev_get_tx_queue(priv->ndev, ++ i); ++ ++ len += sprintf(buf + len, "\n"); ++ __netif_tx_lock_bh(tx_queue); ++ ++ hif_tx_lock(&pfe->hif); ++ len += sprintf(buf + len, ++ "Queue %2d : credits = %10d\n" ++ , i, hif_lib_tx_credit_avail(pfe, priv->id, i)); ++ len += sprintf(buf + len, ++ " tx packets = %10d\n" ++ , pfe->tmu_credit.tx_packets[priv->id][i]); ++ hif_tx_unlock(&pfe->hif); ++ ++ /* Don't output additionnal stats if queue never used */ ++ if (!pfe->tmu_credit.tx_packets[priv->id][i]) ++ goto skip; ++ ++ len += sprintf(buf + len, ++ " clean_fail = %10d\n" ++ , priv->clean_fail[i]); ++ len += sprintf(buf + len, ++ " stop_queue = %10d\n" ++ , priv->stop_queue_total[i]); ++ len += sprintf(buf + len, ++ " stop_queue_hif = %10d\n" ++ , priv->stop_queue_hif[i]); ++ len += sprintf(buf + len, ++ " stop_queue_hif_client = %10d\n" ++ , priv->stop_queue_hif_client[i]); ++ len += sprintf(buf + len, ++ " stop_queue_credit = %10d\n" ++ , priv->stop_queue_credit[i]); ++skip: ++ __netif_tx_unlock_bh(tx_queue); ++ } ++ return len; ++} ++ ++/* pfe_eth_set_tx_stats ++ * ++ */ ++static ssize_t pfe_eth_set_tx_stats(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ int i; ++ ++ for (i = 0; i < emac_txq_cnt; i++) { ++ struct netdev_queue *tx_queue = netdev_get_tx_queue(priv->ndev, ++ i); ++ ++ __netif_tx_lock_bh(tx_queue); ++ priv->clean_fail[i] = 0; ++ priv->stop_queue_total[i] = 0; ++ priv->stop_queue_hif[i] = 0; ++ priv->stop_queue_hif_client[i] = 0; ++ priv->stop_queue_credit[i] = 0; ++ __netif_tx_unlock_bh(tx_queue); ++ } ++ ++ return count; ++} ++#endif ++/* pfe_eth_show_txavail ++ * ++ */ ++static ssize_t pfe_eth_show_txavail(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ ssize_t len = 0; ++ int i; ++ ++ for (i = 0; i < emac_txq_cnt; i++) { ++ struct netdev_queue *tx_queue = netdev_get_tx_queue(priv->ndev, ++ i); ++ ++ __netif_tx_lock_bh(tx_queue); ++ ++ len += sprintf(buf + len, "%d", ++ hif_lib_tx_avail(&priv->client, i)); ++ ++ __netif_tx_unlock_bh(tx_queue); ++ ++ if (i == (emac_txq_cnt - 1)) ++ len += sprintf(buf + len, "\n"); ++ else ++ len += sprintf(buf + len, " "); ++ } ++ ++ return len; ++} ++ ++/* pfe_eth_show_default_priority ++ * ++ */ ++static ssize_t pfe_eth_show_default_priority(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ unsigned long flags; ++ int rc; ++ ++ spin_lock_irqsave(&priv->lock, flags); ++ rc = sprintf(buf, "%d\n", priv->default_priority); ++ spin_unlock_irqrestore(&priv->lock, flags); ++ ++ return rc; ++} ++ ++/* pfe_eth_set_default_priority ++ * ++ */ ++ ++static ssize_t pfe_eth_set_default_priority(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ unsigned long flags; ++ ++ spin_lock_irqsave(&priv->lock, flags); ++ priv->default_priority = kstrtoul(buf, 0, 0); ++ spin_unlock_irqrestore(&priv->lock, flags); ++ ++ return count; ++} ++ ++static DEVICE_ATTR(txavail, 0444, pfe_eth_show_txavail, NULL); ++static DEVICE_ATTR(default_priority, 0644, pfe_eth_show_default_priority, ++ pfe_eth_set_default_priority); ++ ++#ifdef PFE_ETH_NAPI_STATS ++static DEVICE_ATTR(napi_stats, 0644, pfe_eth_show_napi_stats, ++ pfe_eth_set_napi_stats); ++#endif ++ ++#ifdef PFE_ETH_TX_STATS ++static DEVICE_ATTR(tx_stats, 0644, pfe_eth_show_tx_stats, ++ pfe_eth_set_tx_stats); ++#endif ++ ++/* ++ * pfe_eth_sysfs_init ++ * ++ */ ++static int pfe_eth_sysfs_init(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ int err; ++ ++ /* Initialize the default values */ ++ ++ /* ++ * By default, packets without conntrack will use this default high ++ * priority queue ++ */ ++ priv->default_priority = 15; ++ ++ /* Create our sysfs files */ ++ err = device_create_file(&ndev->dev, &dev_attr_default_priority); ++ if (err) { ++ netdev_err(ndev, ++ "failed to create default_priority sysfs files\n"); ++ goto err_priority; ++ } ++ ++ err = device_create_file(&ndev->dev, &dev_attr_txavail); ++ if (err) { ++ netdev_err(ndev, ++ "failed to create default_priority sysfs files\n"); ++ goto err_txavail; ++ } ++ ++#ifdef PFE_ETH_NAPI_STATS ++ err = device_create_file(&ndev->dev, &dev_attr_napi_stats); ++ if (err) { ++ netdev_err(ndev, "failed to create napi stats sysfs files\n"); ++ goto err_napi; ++ } ++#endif ++ ++#ifdef PFE_ETH_TX_STATS ++ err = device_create_file(&ndev->dev, &dev_attr_tx_stats); ++ if (err) { ++ netdev_err(ndev, "failed to create tx stats sysfs files\n"); ++ goto err_tx; ++ } ++#endif ++ ++ return 0; ++ ++#ifdef PFE_ETH_TX_STATS ++err_tx: ++#endif ++#ifdef PFE_ETH_NAPI_STATS ++ device_remove_file(&ndev->dev, &dev_attr_napi_stats); ++ ++err_napi: ++#endif ++ device_remove_file(&ndev->dev, &dev_attr_txavail); ++ ++err_txavail: ++ device_remove_file(&ndev->dev, &dev_attr_default_priority); ++ ++err_priority: ++ return -1; ++} ++ ++/* pfe_eth_sysfs_exit ++ * ++ */ ++void pfe_eth_sysfs_exit(struct net_device *ndev) ++{ ++#ifdef PFE_ETH_TX_STATS ++ device_remove_file(&ndev->dev, &dev_attr_tx_stats); ++#endif ++ ++#ifdef PFE_ETH_NAPI_STATS ++ device_remove_file(&ndev->dev, &dev_attr_napi_stats); ++#endif ++ device_remove_file(&ndev->dev, &dev_attr_txavail); ++ device_remove_file(&ndev->dev, &dev_attr_default_priority); ++} ++ ++/*************************************************************************/ ++/* ETHTOOL INTERCAE */ ++/*************************************************************************/ ++ ++/*MTIP GEMAC */ ++static const struct fec_stat { ++ char name[ETH_GSTRING_LEN]; ++ u16 offset; ++} fec_stats[] = { ++ /* RMON TX */ ++ { "tx_dropped", RMON_T_DROP }, ++ { "tx_packets", RMON_T_PACKETS }, ++ { "tx_broadcast", RMON_T_BC_PKT }, ++ { "tx_multicast", RMON_T_MC_PKT }, ++ { "tx_crc_errors", RMON_T_CRC_ALIGN }, ++ { "tx_undersize", RMON_T_UNDERSIZE }, ++ { "tx_oversize", RMON_T_OVERSIZE }, ++ { "tx_fragment", RMON_T_FRAG }, ++ { "tx_jabber", RMON_T_JAB }, ++ { "tx_collision", RMON_T_COL }, ++ { "tx_64byte", RMON_T_P64 }, ++ { "tx_65to127byte", RMON_T_P65TO127 }, ++ { "tx_128to255byte", RMON_T_P128TO255 }, ++ { "tx_256to511byte", RMON_T_P256TO511 }, ++ { "tx_512to1023byte", RMON_T_P512TO1023 }, ++ { "tx_1024to2047byte", RMON_T_P1024TO2047 }, ++ { "tx_GTE2048byte", RMON_T_P_GTE2048 }, ++ { "tx_octets", RMON_T_OCTETS }, ++ ++ /* IEEE TX */ ++ { "IEEE_tx_drop", IEEE_T_DROP }, ++ { "IEEE_tx_frame_ok", IEEE_T_FRAME_OK }, ++ { "IEEE_tx_1col", IEEE_T_1COL }, ++ { "IEEE_tx_mcol", IEEE_T_MCOL }, ++ { "IEEE_tx_def", IEEE_T_DEF }, ++ { "IEEE_tx_lcol", IEEE_T_LCOL }, ++ { "IEEE_tx_excol", IEEE_T_EXCOL }, ++ { "IEEE_tx_macerr", IEEE_T_MACERR }, ++ { "IEEE_tx_cserr", IEEE_T_CSERR }, ++ { "IEEE_tx_sqe", IEEE_T_SQE }, ++ { "IEEE_tx_fdxfc", IEEE_T_FDXFC }, ++ { "IEEE_tx_octets_ok", IEEE_T_OCTETS_OK }, ++ ++ /* RMON RX */ ++ { "rx_packets", RMON_R_PACKETS }, ++ { "rx_broadcast", RMON_R_BC_PKT }, ++ { "rx_multicast", RMON_R_MC_PKT }, ++ { "rx_crc_errors", RMON_R_CRC_ALIGN }, ++ { "rx_undersize", RMON_R_UNDERSIZE }, ++ { "rx_oversize", RMON_R_OVERSIZE }, ++ { "rx_fragment", RMON_R_FRAG }, ++ { "rx_jabber", RMON_R_JAB }, ++ { "rx_64byte", RMON_R_P64 }, ++ { "rx_65to127byte", RMON_R_P65TO127 }, ++ { "rx_128to255byte", RMON_R_P128TO255 }, ++ { "rx_256to511byte", RMON_R_P256TO511 }, ++ { "rx_512to1023byte", RMON_R_P512TO1023 }, ++ { "rx_1024to2047byte", RMON_R_P1024TO2047 }, ++ { "rx_GTE2048byte", RMON_R_P_GTE2048 }, ++ { "rx_octets", RMON_R_OCTETS }, ++ ++ /* IEEE RX */ ++ { "IEEE_rx_drop", IEEE_R_DROP }, ++ { "IEEE_rx_frame_ok", IEEE_R_FRAME_OK }, ++ { "IEEE_rx_crc", IEEE_R_CRC }, ++ { "IEEE_rx_align", IEEE_R_ALIGN }, ++ { "IEEE_rx_macerr", IEEE_R_MACERR }, ++ { "IEEE_rx_fdxfc", IEEE_R_FDXFC }, ++ { "IEEE_rx_octets_ok", IEEE_R_OCTETS_OK }, ++}; ++ ++static void pfe_eth_fill_stats(struct net_device *ndev, struct ethtool_stats ++ *stats, u64 *data) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ int i; ++ ++ for (i = 0; i < ARRAY_SIZE(fec_stats); i++) ++ data[i] = readl(priv->EMAC_baseaddr + fec_stats[i].offset); ++} ++ ++static void pfe_eth_gstrings(struct net_device *netdev, ++ u32 stringset, u8 *data) ++{ ++ int i; ++ ++ switch (stringset) { ++ case ETH_SS_STATS: ++ for (i = 0; i < ARRAY_SIZE(fec_stats); i++) ++ memcpy(data + i * ETH_GSTRING_LEN, ++ fec_stats[i].name, ETH_GSTRING_LEN); ++ break; ++ } ++} ++ ++static int pfe_eth_stats_count(struct net_device *ndev, int sset) ++{ ++ switch (sset) { ++ case ETH_SS_STATS: ++ return ARRAY_SIZE(fec_stats); ++ default: ++ return -EOPNOTSUPP; ++ } ++} ++ ++/* ++ * pfe_eth_gemac_reglen - Return the length of the register structure. ++ * ++ */ ++static int pfe_eth_gemac_reglen(struct net_device *ndev) ++{ ++ pr_info("%s()\n", __func__); ++ return (sizeof(gemac_regs) / sizeof(u32)); ++} ++ ++/* ++ * pfe_eth_gemac_get_regs - Return the gemac register structure. ++ * ++ */ ++static void pfe_eth_gemac_get_regs(struct net_device *ndev, struct ethtool_regs ++ *regs, void *regbuf) ++{ ++ int i; ++ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ u32 *buf = (u32 *)regbuf; ++ ++ pr_info("%s()\n", __func__); ++ for (i = 0; i < sizeof(gemac_regs) / sizeof(u32); i++) ++ buf[i] = readl(priv->EMAC_baseaddr + gemac_regs[i]); ++} ++ ++/* ++ * pfe_eth_set_wol - Set the magic packet option, in WoL register. ++ * ++ */ ++static int pfe_eth_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ if (wol->wolopts & ~WAKE_MAGIC) ++ return -EOPNOTSUPP; ++ ++ /* for MTIP we store wol->wolopts */ ++ priv->wol = wol->wolopts; ++ ++ device_set_wakeup_enable(&ndev->dev, wol->wolopts & WAKE_MAGIC); ++ ++ return 0; ++} ++ ++/* ++ * ++ * pfe_eth_get_wol - Get the WoL options. ++ * ++ */ ++static void pfe_eth_get_wol(struct net_device *ndev, struct ethtool_wolinfo ++ *wol) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ wol->supported = WAKE_MAGIC; ++ wol->wolopts = 0; ++ ++ if (priv->wol & WAKE_MAGIC) ++ wol->wolopts = WAKE_MAGIC; ++ ++ memset(&wol->sopass, 0, sizeof(wol->sopass)); ++} ++ ++/* ++ * pfe_eth_get_drvinfo - Fills in the drvinfo structure with some basic info ++ * ++ */ ++static void pfe_eth_get_drvinfo(struct net_device *ndev, struct ethtool_drvinfo ++ *drvinfo) ++{ ++ strlcpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver)); ++ strlcpy(drvinfo->version, DRV_VERSION, sizeof(drvinfo->version)); ++ strlcpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version)); ++ strlcpy(drvinfo->bus_info, "N/A", sizeof(drvinfo->bus_info)); ++} ++ ++/* ++ * pfe_eth_set_settings - Used to send commands to PHY. ++ * ++ */ ++static int pfe_eth_set_settings(struct net_device *ndev, ++ const struct ethtool_link_ksettings *cmd) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ struct phy_device *phydev = priv->phydev; ++ ++ if (!phydev) ++ return -ENODEV; ++ ++ return phy_ethtool_ksettings_set(phydev, cmd); ++} ++ ++/* ++ * pfe_eth_getsettings - Return the current settings in the ethtool_cmd ++ * structure. ++ * ++ */ ++static int pfe_eth_get_settings(struct net_device *ndev, ++ struct ethtool_link_ksettings *cmd) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ struct phy_device *phydev = priv->phydev; ++ ++ if (!phydev) ++ return -ENODEV; ++ ++ return phy_ethtool_ksettings_get(phydev, cmd); ++} ++ ++/* ++ * pfe_eth_get_msglevel - Gets the debug message mask. ++ * ++ */ ++static uint32_t pfe_eth_get_msglevel(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ return priv->msg_enable; ++} ++ ++/* ++ * pfe_eth_set_msglevel - Sets the debug message mask. ++ * ++ */ ++static void pfe_eth_set_msglevel(struct net_device *ndev, uint32_t data) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ priv->msg_enable = data; ++} ++ ++#define HIF_RX_COAL_MAX_CLKS (~(1 << 31)) ++#define HIF_RX_COAL_CLKS_PER_USEC (pfe->ctrl.sys_clk / 1000) ++#define HIF_RX_COAL_MAX_USECS (HIF_RX_COAL_MAX_CLKS / \ ++ HIF_RX_COAL_CLKS_PER_USEC) ++ ++/* ++ * pfe_eth_set_coalesce - Sets rx interrupt coalescing timer. ++ * ++ */ ++static int pfe_eth_set_coalesce(struct net_device *ndev, ++ struct ethtool_coalesce *ec) ++{ ++ if (ec->rx_coalesce_usecs > HIF_RX_COAL_MAX_USECS) ++ return -EINVAL; ++ ++ if (!ec->rx_coalesce_usecs) { ++ writel(0, HIF_INT_COAL); ++ return 0; ++ } ++ ++ writel((ec->rx_coalesce_usecs * HIF_RX_COAL_CLKS_PER_USEC) | ++ HIF_INT_COAL_ENABLE, HIF_INT_COAL); ++ ++ return 0; ++} ++ ++/* ++ * pfe_eth_get_coalesce - Gets rx interrupt coalescing timer value. ++ * ++ */ ++static int pfe_eth_get_coalesce(struct net_device *ndev, ++ struct ethtool_coalesce *ec) ++{ ++ int reg_val = readl(HIF_INT_COAL); ++ ++ if (reg_val & HIF_INT_COAL_ENABLE) ++ ec->rx_coalesce_usecs = (reg_val & HIF_RX_COAL_MAX_CLKS) / ++ HIF_RX_COAL_CLKS_PER_USEC; ++ else ++ ec->rx_coalesce_usecs = 0; ++ ++ return 0; ++} ++ ++/* ++ * pfe_eth_set_pauseparam - Sets pause parameters ++ * ++ */ ++static int pfe_eth_set_pauseparam(struct net_device *ndev, ++ struct ethtool_pauseparam *epause) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ if (epause->tx_pause != epause->rx_pause) { ++ netdev_info(ndev, ++ "hardware only support enable/disable both tx and rx\n"); ++ return -EINVAL; ++ } ++ ++ priv->pause_flag = 0; ++ priv->pause_flag |= epause->rx_pause ? PFE_PAUSE_FLAG_ENABLE : 0; ++ priv->pause_flag |= epause->autoneg ? PFE_PAUSE_FLAG_AUTONEG : 0; ++ ++ if (epause->rx_pause || epause->autoneg) { ++ gemac_enable_pause_rx(priv->EMAC_baseaddr); ++ writel((readl(priv->GPI_baseaddr + GPI_TX_PAUSE_TIME) | ++ EGPI_PAUSE_ENABLE), ++ priv->GPI_baseaddr + GPI_TX_PAUSE_TIME); ++ if (priv->phydev) { ++ priv->phydev->supported |= ADVERTISED_Pause | ++ ADVERTISED_Asym_Pause; ++ priv->phydev->advertising |= ADVERTISED_Pause | ++ ADVERTISED_Asym_Pause; ++ } ++ } else { ++ gemac_disable_pause_rx(priv->EMAC_baseaddr); ++ writel((readl(priv->GPI_baseaddr + GPI_TX_PAUSE_TIME) & ++ ~EGPI_PAUSE_ENABLE), ++ priv->GPI_baseaddr + GPI_TX_PAUSE_TIME); ++ if (priv->phydev) { ++ priv->phydev->supported &= ~(ADVERTISED_Pause | ++ ADVERTISED_Asym_Pause); ++ priv->phydev->advertising &= ~(ADVERTISED_Pause | ++ ADVERTISED_Asym_Pause); ++ } ++ } ++ ++ return 0; ++} ++ ++/* ++ * pfe_eth_get_pauseparam - Gets pause parameters ++ * ++ */ ++static void pfe_eth_get_pauseparam(struct net_device *ndev, ++ struct ethtool_pauseparam *epause) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ epause->autoneg = (priv->pause_flag & PFE_PAUSE_FLAG_AUTONEG) != 0; ++ epause->tx_pause = (priv->pause_flag & PFE_PAUSE_FLAG_ENABLE) != 0; ++ epause->rx_pause = epause->tx_pause; ++} ++ ++/* ++ * pfe_eth_get_hash ++ */ ++#define PFE_HASH_BITS 6 /* #bits in hash */ ++#define CRC32_POLY 0xEDB88320 ++ ++static int pfe_eth_get_hash(u8 *addr) ++{ ++ unsigned int i, bit, data, crc, hash; ++ ++ /* calculate crc32 value of mac address */ ++ crc = 0xffffffff; ++ ++ for (i = 0; i < 6; i++) { ++ data = addr[i]; ++ for (bit = 0; bit < 8; bit++, data >>= 1) { ++ crc = (crc >> 1) ^ ++ (((crc ^ data) & 1) ? CRC32_POLY : 0); ++ } ++ } ++ ++ /* ++ * only upper 6 bits (PFE_HASH_BITS) are used ++ * which point to specific bit in the hash registers ++ */ ++ hash = (crc >> (32 - PFE_HASH_BITS)) & 0x3f; ++ ++ return hash; ++} ++ ++const struct ethtool_ops pfe_ethtool_ops = { ++ .get_drvinfo = pfe_eth_get_drvinfo, ++ .get_regs_len = pfe_eth_gemac_reglen, ++ .get_regs = pfe_eth_gemac_get_regs, ++ .get_link = ethtool_op_get_link, ++ .get_wol = pfe_eth_get_wol, ++ .set_wol = pfe_eth_set_wol, ++ .set_pauseparam = pfe_eth_set_pauseparam, ++ .get_pauseparam = pfe_eth_get_pauseparam, ++ .get_strings = pfe_eth_gstrings, ++ .get_sset_count = pfe_eth_stats_count, ++ .get_ethtool_stats = pfe_eth_fill_stats, ++ .get_msglevel = pfe_eth_get_msglevel, ++ .set_msglevel = pfe_eth_set_msglevel, ++ .set_coalesce = pfe_eth_set_coalesce, ++ .get_coalesce = pfe_eth_get_coalesce, ++ .get_link_ksettings = pfe_eth_get_settings, ++ .set_link_ksettings = pfe_eth_set_settings, ++}; ++ ++/* pfe_eth_mdio_reset ++ */ ++int pfe_eth_mdio_reset(struct mii_bus *bus) ++{ ++ struct pfe_eth_priv_s *priv = (struct pfe_eth_priv_s *)bus->priv; ++ u32 phy_speed; ++ ++ netif_info(priv, hw, priv->ndev, "%s\n", __func__); ++ ++ mutex_lock(&bus->mdio_lock); ++ ++ /* ++ * Set MII speed to 2.5 MHz (= clk_get_rate() / 2 * phy_speed) ++ * ++ * The formula for FEC MDC is 'ref_freq / (MII_SPEED x 2)' while ++ * for ENET-MAC is 'ref_freq / ((MII_SPEED + 1) x 2)'. ++ */ ++ phy_speed = (DIV_ROUND_UP((pfe->ctrl.sys_clk * 1000), 4000000) ++ << EMAC_MII_SPEED_SHIFT); ++ phy_speed |= EMAC_HOLDTIME(0x5); ++ __raw_writel(phy_speed, priv->PHY_baseaddr + EMAC_MII_CTRL_REG); ++ ++ mutex_unlock(&bus->mdio_lock); ++ ++ return 0; ++} ++ ++/* pfe_eth_gemac_phy_timeout ++ * ++ */ ++static int pfe_eth_gemac_phy_timeout(struct pfe_eth_priv_s *priv, int timeout) ++{ ++ while (!(__raw_readl(priv->PHY_baseaddr + EMAC_IEVENT_REG) & ++ EMAC_IEVENT_MII)) { ++ if (timeout-- <= 0) ++ return -1; ++ usleep_range(10, 20); ++ } ++ __raw_writel(EMAC_IEVENT_MII, priv->PHY_baseaddr + EMAC_IEVENT_REG); ++ return 0; ++} ++ ++static int pfe_eth_mdio_mux(u8 muxval) ++{ ++ struct i2c_adapter *a; ++ struct i2c_msg msg; ++ unsigned char buf[2]; ++ int ret; ++ ++ a = i2c_get_adapter(0); ++ if (!a) ++ return -ENODEV; ++ ++ /* set bit 1 (the second bit) of chip at 0x09, register 0x13 */ ++ buf[0] = 0x54; /* reg number */ ++ buf[1] = (muxval << 6) | 0x3; /* data */ ++ msg.addr = 0x66; ++ msg.buf = buf; ++ msg.len = 2; ++ msg.flags = 0; ++ ret = i2c_transfer(a, &msg, 1); ++ i2c_put_adapter(a); ++ if (ret != 1) ++ return -ENODEV; ++ return 0; ++} ++ ++static int pfe_eth_mdio_write_addr(struct mii_bus *bus, int mii_id, ++ int dev_addr, int regnum) ++{ ++ struct pfe_eth_priv_s *priv = (struct pfe_eth_priv_s *)bus->priv; ++ ++ __raw_writel(EMAC_MII_DATA_PA(mii_id) | ++ EMAC_MII_DATA_RA(dev_addr) | ++ EMAC_MII_DATA_TA | EMAC_MII_DATA(regnum), ++ priv->PHY_baseaddr + EMAC_MII_DATA_REG); ++ ++ if (pfe_eth_gemac_phy_timeout(priv, EMAC_MDIO_TIMEOUT)) { ++ netdev_err(priv->ndev, "%s: phy MDIO address write timeout\n", ++ __func__); ++ return -1; ++ } ++ ++ return 0; ++} ++ ++static int pfe_eth_mdio_write(struct mii_bus *bus, int mii_id, int regnum, ++ u16 value) ++{ ++ struct pfe_eth_priv_s *priv = (struct pfe_eth_priv_s *)bus->priv; ++ ++ /*To access external PHYs on QDS board mux needs to be configured*/ ++ if ((mii_id) && (pfe->mdio_muxval[mii_id])) ++ pfe_eth_mdio_mux(pfe->mdio_muxval[mii_id]); ++ ++ if (regnum & MII_ADDR_C45) { ++ pfe_eth_mdio_write_addr(bus, mii_id, (regnum >> 16) & 0x1f, ++ regnum & 0xffff); ++ __raw_writel(EMAC_MII_DATA_OP_CL45_WR | ++ EMAC_MII_DATA_PA(mii_id) | ++ EMAC_MII_DATA_RA((regnum >> 16) & 0x1f) | ++ EMAC_MII_DATA_TA | EMAC_MII_DATA(value), ++ priv->PHY_baseaddr + EMAC_MII_DATA_REG); ++ } else { ++ /* start a write op */ ++ __raw_writel(EMAC_MII_DATA_ST | EMAC_MII_DATA_OP_WR | ++ EMAC_MII_DATA_PA(mii_id) | ++ EMAC_MII_DATA_RA(regnum) | ++ EMAC_MII_DATA_TA | EMAC_MII_DATA(value), ++ priv->PHY_baseaddr + EMAC_MII_DATA_REG); ++ } ++ ++ if (pfe_eth_gemac_phy_timeout(priv, EMAC_MDIO_TIMEOUT)) { ++ netdev_err(priv->ndev, "%s: phy MDIO write timeout\n", ++ __func__); ++ return -1; ++ } ++ netif_info(priv, hw, priv->ndev, "%s: phy %x reg %x val %x\n", __func__, ++ mii_id, regnum, value); ++ ++ return 0; ++} ++ ++static int pfe_eth_mdio_read(struct mii_bus *bus, int mii_id, int regnum) ++{ ++ struct pfe_eth_priv_s *priv = (struct pfe_eth_priv_s *)bus->priv; ++ u16 value = 0; ++ ++ /*To access external PHYs on QDS board mux needs to be configured*/ ++ if ((mii_id) && (pfe->mdio_muxval[mii_id])) ++ pfe_eth_mdio_mux(pfe->mdio_muxval[mii_id]); ++ ++ if (regnum & MII_ADDR_C45) { ++ pfe_eth_mdio_write_addr(bus, mii_id, (regnum >> 16) & 0x1f, ++ regnum & 0xffff); ++ __raw_writel(EMAC_MII_DATA_OP_CL45_RD | ++ EMAC_MII_DATA_PA(mii_id) | ++ EMAC_MII_DATA_RA((regnum >> 16) & 0x1f) | ++ EMAC_MII_DATA_TA, ++ priv->PHY_baseaddr + EMAC_MII_DATA_REG); ++ } else { ++ /* start a read op */ ++ __raw_writel(EMAC_MII_DATA_ST | EMAC_MII_DATA_OP_RD | ++ EMAC_MII_DATA_PA(mii_id) | ++ EMAC_MII_DATA_RA(regnum) | ++ EMAC_MII_DATA_TA, priv->PHY_baseaddr + ++ EMAC_MII_DATA_REG); ++ } ++ ++ if (pfe_eth_gemac_phy_timeout(priv, EMAC_MDIO_TIMEOUT)) { ++ netdev_err(priv->ndev, "%s: phy MDIO read timeout\n", __func__); ++ return -1; ++ } ++ ++ value = EMAC_MII_DATA(__raw_readl(priv->PHY_baseaddr + ++ EMAC_MII_DATA_REG)); ++ netif_info(priv, hw, priv->ndev, "%s: phy %x reg %x val %x\n", __func__, ++ mii_id, regnum, value); ++ return value; ++} ++ ++static int pfe_eth_mdio_init(struct pfe_eth_priv_s *priv, ++ struct ls1012a_mdio_platform_data *minfo) ++{ ++ struct mii_bus *bus; ++ int rc; ++ ++ netif_info(priv, drv, priv->ndev, "%s\n", __func__); ++ pr_info("%s\n", __func__); ++ ++ bus = mdiobus_alloc(); ++ if (!bus) { ++ netdev_err(priv->ndev, "mdiobus_alloc() failed\n"); ++ rc = -ENOMEM; ++ goto err0; ++ } ++ ++ bus->name = "ls1012a MDIO Bus"; ++ bus->read = &pfe_eth_mdio_read; ++ bus->write = &pfe_eth_mdio_write; ++ bus->reset = &pfe_eth_mdio_reset; ++ snprintf(bus->id, MII_BUS_ID_SIZE, "ls1012a-%x", priv->id); ++ bus->priv = priv; ++ ++ bus->phy_mask = minfo->phy_mask; ++ priv->mdc_div = minfo->mdc_div; ++ ++ if (!priv->mdc_div) ++ priv->mdc_div = 64; ++ ++ bus->irq[0] = minfo->irq[0]; ++ ++ bus->parent = priv->pfe->dev; ++ ++ netif_info(priv, drv, priv->ndev, "%s: mdc_div: %d, phy_mask: %x\n", ++ __func__, priv->mdc_div, bus->phy_mask); ++ rc = mdiobus_register(bus); ++ if (rc) { ++ netdev_err(priv->ndev, "mdiobus_register(%s) failed\n", ++ bus->name); ++ goto err1; ++ } ++ ++ priv->mii_bus = bus; ++ pfe_eth_mdio_reset(bus); ++ ++ return 0; ++ ++err1: ++ mdiobus_free(bus); ++err0: ++ return rc; ++} ++ ++/* pfe_eth_mdio_exit ++ */ ++static void pfe_eth_mdio_exit(struct mii_bus *bus) ++{ ++ if (!bus) ++ return; ++ ++ netif_info((struct pfe_eth_priv_s *)bus->priv, drv, ((struct ++ pfe_eth_priv_s *)(bus->priv))->ndev, "%s\n", __func__); ++ ++ mdiobus_unregister(bus); ++ mdiobus_free(bus); ++} ++ ++/* pfe_get_phydev_speed ++ */ ++static int pfe_get_phydev_speed(struct phy_device *phydev) ++{ ++ switch (phydev->speed) { ++ case 10: ++ return SPEED_10M; ++ case 100: ++ return SPEED_100M; ++ case 1000: ++ default: ++ return SPEED_1000M; ++ } ++} ++ ++/* pfe_set_rgmii_speed ++ */ ++#define RGMIIPCR 0x434 ++/* RGMIIPCR bit definitions*/ ++#define SCFG_RGMIIPCR_EN_AUTO (0x00000008) ++#define SCFG_RGMIIPCR_SETSP_1000M (0x00000004) ++#define SCFG_RGMIIPCR_SETSP_100M (0x00000000) ++#define SCFG_RGMIIPCR_SETSP_10M (0x00000002) ++#define SCFG_RGMIIPCR_SETFD (0x00000001) ++ ++static void pfe_set_rgmii_speed(struct phy_device *phydev) ++{ ++ u32 rgmii_pcr; ++ ++ regmap_read(pfe->scfg, RGMIIPCR, &rgmii_pcr); ++ rgmii_pcr &= ~(SCFG_RGMIIPCR_SETSP_1000M | SCFG_RGMIIPCR_SETSP_10M); ++ ++ switch (phydev->speed) { ++ case 10: ++ rgmii_pcr |= SCFG_RGMIIPCR_SETSP_10M; ++ break; ++ case 1000: ++ rgmii_pcr |= SCFG_RGMIIPCR_SETSP_1000M; ++ break; ++ case 100: ++ default: ++ /* Default is 100M */ ++ break; ++ } ++ regmap_write(pfe->scfg, RGMIIPCR, rgmii_pcr); ++} ++ ++/* pfe_get_phydev_duplex ++ */ ++static int pfe_get_phydev_duplex(struct phy_device *phydev) ++{ ++ /*return (phydev->duplex == DUPLEX_HALF) ? DUP_HALF:DUP_FULL ; */ ++ return DUPLEX_FULL; ++} ++ ++/* pfe_eth_adjust_link ++ */ ++static void pfe_eth_adjust_link(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ unsigned long flags; ++ struct phy_device *phydev = priv->phydev; ++ int new_state = 0; ++ ++ netif_info(priv, drv, ndev, "%s\n", __func__); ++ ++ spin_lock_irqsave(&priv->lock, flags); ++ ++ if (phydev->link) { ++ /* ++ * Now we make sure that we can be in full duplex mode. ++ * If not, we operate in half-duplex mode. ++ */ ++ if (phydev->duplex != priv->oldduplex) { ++ new_state = 1; ++ gemac_set_duplex(priv->EMAC_baseaddr, ++ pfe_get_phydev_duplex(phydev)); ++ priv->oldduplex = phydev->duplex; ++ } ++ ++ if (phydev->speed != priv->oldspeed) { ++ new_state = 1; ++ gemac_set_speed(priv->EMAC_baseaddr, ++ pfe_get_phydev_speed(phydev)); ++ if (priv->einfo->mii_config == PHY_INTERFACE_MODE_RGMII_TXID) ++ pfe_set_rgmii_speed(phydev); ++ priv->oldspeed = phydev->speed; ++ } ++ ++ if (!priv->oldlink) { ++ new_state = 1; ++ priv->oldlink = 1; ++ } ++ ++ } else if (priv->oldlink) { ++ new_state = 1; ++ priv->oldlink = 0; ++ priv->oldspeed = 0; ++ priv->oldduplex = -1; ++ } ++ ++ if (new_state && netif_msg_link(priv)) ++ phy_print_status(phydev); ++ ++ spin_unlock_irqrestore(&priv->lock, flags); ++} ++ ++/* pfe_phy_exit ++ */ ++static void pfe_phy_exit(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ netif_info(priv, drv, ndev, "%s\n", __func__); ++ ++ phy_disconnect(priv->phydev); ++ priv->phydev = NULL; ++} ++ ++/* pfe_eth_stop ++ */ ++static void pfe_eth_stop(struct net_device *ndev, int wake) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ netif_info(priv, drv, ndev, "%s\n", __func__); ++ ++ if (wake) { ++ gemac_tx_disable(priv->EMAC_baseaddr); ++ } else { ++ gemac_disable(priv->EMAC_baseaddr); ++ gpi_disable(priv->GPI_baseaddr); ++ ++ if (priv->phydev) ++ phy_stop(priv->phydev); ++ } ++} ++ ++/* pfe_eth_start ++ */ ++static int pfe_eth_start(struct pfe_eth_priv_s *priv) ++{ ++ netif_info(priv, drv, priv->ndev, "%s\n", __func__); ++ ++ if (priv->phydev) ++ phy_start(priv->phydev); ++ ++ gpi_enable(priv->GPI_baseaddr); ++ gemac_enable(priv->EMAC_baseaddr); ++ ++ return 0; ++} ++ ++/* ++ * Configure on chip serdes through mdio ++ */ ++static void ls1012a_configure_serdes(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = pfe->eth.eth_priv[0]; ++ int sgmii_2500 = 0; ++ struct mii_bus *bus = priv->mii_bus; ++ ++ if (priv->einfo->mii_config == PHY_INTERFACE_MODE_SGMII_2500) ++ sgmii_2500 = 1; ++ ++ netif_info(priv, drv, ndev, "%s\n", __func__); ++ /* PCS configuration done with corresponding GEMAC */ ++ ++ pfe_eth_mdio_read(bus, 0, 0); ++ pfe_eth_mdio_read(bus, 0, 1); ++ ++ /*These settings taken from validtion team */ ++ pfe_eth_mdio_write(bus, 0, 0x0, 0x8000); ++ if (sgmii_2500) { ++ pfe_eth_mdio_write(bus, 0, 0x14, 0x9); ++ pfe_eth_mdio_write(bus, 0, 0x4, 0x4001); ++ pfe_eth_mdio_write(bus, 0, 0x12, 0xa120); ++ pfe_eth_mdio_write(bus, 0, 0x13, 0x7); ++ } else { ++ pfe_eth_mdio_write(bus, 0, 0x14, 0xb); ++ pfe_eth_mdio_write(bus, 0, 0x4, 0x1a1); ++ pfe_eth_mdio_write(bus, 0, 0x12, 0x400); ++ pfe_eth_mdio_write(bus, 0, 0x13, 0x0); ++ } ++ ++ pfe_eth_mdio_write(bus, 0, 0x0, 0x1140); ++} ++ ++/* ++ * pfe_phy_init ++ * ++ */ ++static int pfe_phy_init(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ struct phy_device *phydev; ++ char phy_id[MII_BUS_ID_SIZE + 3]; ++ char bus_id[MII_BUS_ID_SIZE]; ++ phy_interface_t interface; ++ ++ priv->oldlink = 0; ++ priv->oldspeed = 0; ++ priv->oldduplex = -1; ++ ++ snprintf(bus_id, MII_BUS_ID_SIZE, "ls1012a-%d", 0); ++ snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, bus_id, ++ priv->einfo->phy_id); ++ ++ netif_info(priv, drv, ndev, "%s: %s\n", __func__, phy_id); ++ interface = priv->einfo->mii_config; ++ if ((interface == PHY_INTERFACE_MODE_SGMII) || ++ (interface == PHY_INTERFACE_MODE_SGMII_2500)) { ++ /*Configure SGMII PCS */ ++ if (pfe->scfg) { ++ /*Config MDIO from serdes */ ++ regmap_write(pfe->scfg, 0x484, 0x00000000); ++ } ++ ls1012a_configure_serdes(ndev); ++ } ++ ++ if (pfe->scfg) { ++ /*Config MDIO from PAD */ ++ regmap_write(pfe->scfg, 0x484, 0x80000000); ++ } ++ ++ priv->oldlink = 0; ++ priv->oldspeed = 0; ++ priv->oldduplex = -1; ++ pr_info("%s interface %x\n", __func__, interface); ++ phydev = phy_connect(ndev, phy_id, &pfe_eth_adjust_link, interface); ++ ++ if (IS_ERR(phydev)) { ++ netdev_err(ndev, "phy_connect() failed\n"); ++ return PTR_ERR(phydev); ++ } ++ ++ priv->phydev = phydev; ++ phydev->irq = PHY_POLL; ++ ++ return 0; ++} ++ ++/* pfe_gemac_init ++ */ ++static int pfe_gemac_init(struct pfe_eth_priv_s *priv) ++{ ++ struct gemac_cfg cfg; ++ ++ netif_info(priv, ifup, priv->ndev, "%s\n", __func__); ++ ++ cfg.speed = SPEED_1000M; ++ cfg.duplex = DUPLEX_FULL; ++ ++ gemac_set_config(priv->EMAC_baseaddr, &cfg); ++ gemac_allow_broadcast(priv->EMAC_baseaddr); ++ gemac_enable_1536_rx(priv->EMAC_baseaddr); ++ gemac_enable_rx_jmb(priv->EMAC_baseaddr); ++ gemac_enable_stacked_vlan(priv->EMAC_baseaddr); ++ gemac_enable_pause_rx(priv->EMAC_baseaddr); ++ gemac_set_bus_width(priv->EMAC_baseaddr, 64); ++ ++ /*GEM will perform checksum verifications*/ ++ if (priv->ndev->features & NETIF_F_RXCSUM) ++ gemac_enable_rx_checksum_offload(priv->EMAC_baseaddr); ++ else ++ gemac_disable_rx_checksum_offload(priv->EMAC_baseaddr); ++ ++ return 0; ++} ++ ++/* pfe_eth_event_handler ++ */ ++static int pfe_eth_event_handler(void *data, int event, int qno) ++{ ++ struct pfe_eth_priv_s *priv = data; ++ ++ switch (event) { ++ case EVENT_RX_PKT_IND: ++ ++ if (qno == 0) { ++ if (napi_schedule_prep(&priv->high_napi)) { ++ netif_info(priv, intr, priv->ndev, ++ "%s: schedule high prio poll\n" ++ , __func__); ++ ++#ifdef PFE_ETH_NAPI_STATS ++ priv->napi_counters[NAPI_SCHED_COUNT]++; ++#endif ++ ++ __napi_schedule(&priv->high_napi); ++ } ++ } else if (qno == 1) { ++ if (napi_schedule_prep(&priv->low_napi)) { ++ netif_info(priv, intr, priv->ndev, ++ "%s: schedule low prio poll\n" ++ , __func__); ++ ++#ifdef PFE_ETH_NAPI_STATS ++ priv->napi_counters[NAPI_SCHED_COUNT]++; ++#endif ++ __napi_schedule(&priv->low_napi); ++ } ++ } else if (qno == 2) { ++ if (napi_schedule_prep(&priv->lro_napi)) { ++ netif_info(priv, intr, priv->ndev, ++ "%s: schedule lro prio poll\n" ++ , __func__); ++ ++#ifdef PFE_ETH_NAPI_STATS ++ priv->napi_counters[NAPI_SCHED_COUNT]++; ++#endif ++ __napi_schedule(&priv->lro_napi); ++ } ++ } ++ ++ break; ++ ++ case EVENT_TXDONE_IND: ++ pfe_eth_flush_tx(priv); ++ hif_lib_event_handler_start(&priv->client, EVENT_TXDONE_IND, 0); ++ break; ++ case EVENT_HIGH_RX_WM: ++ default: ++ break; ++ } ++ ++ return 0; ++} ++ ++/* pfe_eth_open ++ */ ++static int pfe_eth_open(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ struct hif_client_s *client; ++ int rc; ++ ++ netif_info(priv, ifup, ndev, "%s\n", __func__); ++ ++ /* Register client driver with HIF */ ++ client = &priv->client; ++ memset(client, 0, sizeof(*client)); ++ client->id = PFE_CL_GEM0 + priv->id; ++ client->tx_qn = emac_txq_cnt; ++ client->rx_qn = EMAC_RXQ_CNT; ++ client->priv = priv; ++ client->pfe = priv->pfe; ++ client->event_handler = pfe_eth_event_handler; ++ ++ client->tx_qsize = EMAC_TXQ_DEPTH; ++ client->rx_qsize = EMAC_RXQ_DEPTH; ++ ++ rc = hif_lib_client_register(client); ++ if (rc) { ++ netdev_err(ndev, "%s: hif_lib_client_register(%d) failed\n", ++ __func__, client->id); ++ goto err0; ++ } ++ ++ netif_info(priv, drv, ndev, "%s: registered client: %p\n", __func__, ++ client); ++ ++ pfe_gemac_init(priv); ++ ++ if (!is_valid_ether_addr(ndev->dev_addr)) { ++ netdev_err(ndev, "%s: invalid MAC address\n", __func__); ++ rc = -EADDRNOTAVAIL; ++ goto err1; ++ } ++ ++ gemac_set_laddrN(priv->EMAC_baseaddr, ++ (struct pfe_mac_addr *)ndev->dev_addr, 1); ++ ++ napi_enable(&priv->high_napi); ++ napi_enable(&priv->low_napi); ++ napi_enable(&priv->lro_napi); ++ ++ rc = pfe_eth_start(priv); ++ ++ netif_tx_wake_all_queues(ndev); ++ ++ return rc; ++ ++err1: ++ hif_lib_client_unregister(&priv->client); ++ ++err0: ++ return rc; ++} ++ ++/* ++ * pfe_eth_shutdown ++ */ ++int pfe_eth_shutdown(struct net_device *ndev, int wake) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ int i, qstatus; ++ unsigned long next_poll = jiffies + 1, end = jiffies + ++ (TX_POLL_TIMEOUT_MS * HZ) / 1000; ++ int tx_pkts, prv_tx_pkts; ++ ++ netif_info(priv, ifdown, ndev, "%s\n", __func__); ++ ++ for (i = 0; i < emac_txq_cnt; i++) ++ hrtimer_cancel(&priv->fast_tx_timeout[i].timer); ++ ++ netif_tx_stop_all_queues(ndev); ++ ++ do { ++ tx_pkts = 0; ++ pfe_eth_flush_tx(priv); ++ ++ for (i = 0; i < emac_txq_cnt; i++) ++ tx_pkts += hif_lib_tx_pending(&priv->client, i); ++ ++ if (tx_pkts) { ++ /*Don't wait forever, break if we cross max timeout */ ++ if (time_after(jiffies, end)) { ++ pr_err( ++ "(%s)Tx is not complete after %dmsec\n", ++ ndev->name, TX_POLL_TIMEOUT_MS); ++ break; ++ } ++ ++ pr_info("%s : (%s) Waiting for tx packets to free. Pending tx pkts = %d.\n" ++ , __func__, ndev->name, tx_pkts); ++ if (need_resched()) ++ schedule(); ++ } ++ ++ } while (tx_pkts); ++ ++ end = jiffies + (TX_POLL_TIMEOUT_MS * HZ) / 1000; ++ ++ prv_tx_pkts = tmu_pkts_processed(priv->id); ++ /* ++ * Wait till TMU transmits all pending packets ++ * poll tmu_qstatus and pkts processed by TMU for every 10ms ++ * Consider TMU is busy, If we see TMU qeueu pending or any packets ++ * processed by TMU ++ */ ++ while (1) { ++ if (time_after(jiffies, next_poll)) { ++ tx_pkts = tmu_pkts_processed(priv->id); ++ qstatus = tmu_qstatus(priv->id) & 0x7ffff; ++ ++ if (!qstatus && (tx_pkts == prv_tx_pkts)) ++ break; ++ /* Don't wait forever, break if we cross max ++ * timeout(TX_POLL_TIMEOUT_MS) ++ */ ++ if (time_after(jiffies, end)) { ++ pr_err("TMU%d is busy after %dmsec\n", ++ priv->id, TX_POLL_TIMEOUT_MS); ++ break; ++ } ++ prv_tx_pkts = tx_pkts; ++ next_poll++; ++ } ++ if (need_resched()) ++ schedule(); ++ } ++ /* Wait for some more time to complete transmitting packet if any */ ++ next_poll = jiffies + 1; ++ while (1) { ++ if (time_after(jiffies, next_poll)) ++ break; ++ if (need_resched()) ++ schedule(); ++ } ++ ++ pfe_eth_stop(ndev, wake); ++ ++ napi_disable(&priv->lro_napi); ++ napi_disable(&priv->low_napi); ++ napi_disable(&priv->high_napi); ++ ++ hif_lib_client_unregister(&priv->client); ++ ++ return 0; ++} ++ ++/* pfe_eth_close ++ * ++ */ ++static int pfe_eth_close(struct net_device *ndev) ++{ ++ pfe_eth_shutdown(ndev, 0); ++ ++ return 0; ++} ++ ++/* pfe_eth_suspend ++ * ++ * return value : 1 if netdevice is configured to wakeup system ++ * 0 otherwise ++ */ ++int pfe_eth_suspend(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ int retval = 0; ++ ++ if (priv->wol) { ++ gemac_set_wol(priv->EMAC_baseaddr, priv->wol); ++ retval = 1; ++ } ++ pfe_eth_shutdown(ndev, priv->wol); ++ ++ return retval; ++} ++ ++/* pfe_eth_resume ++ * ++ */ ++int pfe_eth_resume(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ if (priv->wol) ++ gemac_set_wol(priv->EMAC_baseaddr, 0); ++ gemac_tx_enable(priv->EMAC_baseaddr); ++ ++ return pfe_eth_open(ndev); ++} ++ ++/* pfe_eth_get_queuenum ++ */ ++static int pfe_eth_get_queuenum(struct pfe_eth_priv_s *priv, struct sk_buff ++ *skb) ++{ ++ int queuenum = 0; ++ unsigned long flags; ++ ++ /* Get the Fast Path queue number */ ++ /* ++ * Use conntrack mark (if conntrack exists), then packet mark (if any), ++ * then fallback to default ++ */ ++#if defined(CONFIG_IP_NF_CONNTRACK_MARK) || defined(CONFIG_NF_CONNTRACK_MARK) ++ if (skb->nfct) { ++ enum ip_conntrack_info cinfo; ++ struct nf_conn *ct; ++ ++ ct = nf_ct_get(skb, &cinfo); ++ ++ if (ct) { ++ u32 connmark; ++ ++ connmark = ct->mark; ++ ++ if ((connmark & 0x80000000) && priv->id != 0) ++ connmark >>= 16; ++ ++ queuenum = connmark & EMAC_QUEUENUM_MASK; ++ } ++ } else {/* continued after #endif ... */ ++#endif ++ if (skb->mark) { ++ queuenum = skb->mark & EMAC_QUEUENUM_MASK; ++ } else { ++ spin_lock_irqsave(&priv->lock, flags); ++ queuenum = priv->default_priority & EMAC_QUEUENUM_MASK; ++ spin_unlock_irqrestore(&priv->lock, flags); ++ } ++#if defined(CONFIG_IP_NF_CONNTRACK_MARK) || defined(CONFIG_NF_CONNTRACK_MARK) ++ } ++#endif ++ return queuenum; ++} ++ ++/* pfe_eth_might_stop_tx ++ * ++ */ ++static int pfe_eth_might_stop_tx(struct pfe_eth_priv_s *priv, int queuenum, ++ struct netdev_queue *tx_queue, ++ unsigned int n_desc, ++ unsigned int n_segs) ++{ ++ ktime_t kt; ++ ++ if (unlikely((__hif_tx_avail(&pfe->hif) < n_desc) || ++ (hif_lib_tx_avail(&priv->client, queuenum) < n_desc) || ++ (hif_lib_tx_credit_avail(pfe, priv->id, queuenum) < n_segs))) { ++#ifdef PFE_ETH_TX_STATS ++ if (__hif_tx_avail(&pfe->hif) < n_desc) { ++ priv->stop_queue_hif[queuenum]++; ++ } else if (hif_lib_tx_avail(&priv->client, queuenum) < n_desc) { ++ priv->stop_queue_hif_client[queuenum]++; ++ } else if (hif_lib_tx_credit_avail(pfe, priv->id, queuenum) < ++ n_segs) { ++ priv->stop_queue_credit[queuenum]++; ++ } ++ priv->stop_queue_total[queuenum]++; ++#endif ++ netif_tx_stop_queue(tx_queue); ++ ++ kt = ktime_set(0, LS1012A_TX_FAST_RECOVERY_TIMEOUT_MS * ++ NSEC_PER_MSEC); ++ hrtimer_start(&priv->fast_tx_timeout[queuenum].timer, kt, ++ HRTIMER_MODE_REL); ++ return -1; ++ } else { ++ return 0; ++ } ++} ++ ++#define SA_MAX_OP 2 ++/* pfe_hif_send_packet ++ * ++ * At this level if TX fails we drop the packet ++ */ ++static void pfe_hif_send_packet(struct sk_buff *skb, struct pfe_eth_priv_s ++ *priv, int queuenum) ++{ ++ struct skb_shared_info *sh = skb_shinfo(skb); ++ unsigned int nr_frags; ++ u32 ctrl = 0; ++ ++ netif_info(priv, tx_queued, priv->ndev, "%s\n", __func__); ++ ++ if (skb_is_gso(skb)) { ++ priv->stats.tx_dropped++; ++ return; ++ } ++ ++ if (skb->ip_summed == CHECKSUM_PARTIAL) ++ ctrl = HIF_CTRL_TX_CHECKSUM; ++ ++ nr_frags = sh->nr_frags; ++ ++ if (nr_frags) { ++ skb_frag_t *f; ++ int i; ++ ++ __hif_lib_xmit_pkt(&priv->client, queuenum, skb->data, ++ skb_headlen(skb), ctrl, HIF_FIRST_BUFFER, ++ skb); ++ ++ for (i = 0; i < nr_frags - 1; i++) { ++ f = &sh->frags[i]; ++ __hif_lib_xmit_pkt(&priv->client, queuenum, ++ skb_frag_address(f), ++ skb_frag_size(f), ++ 0x0, 0x0, skb); ++ } ++ ++ f = &sh->frags[i]; ++ ++ __hif_lib_xmit_pkt(&priv->client, queuenum, ++ skb_frag_address(f), skb_frag_size(f), ++ 0x0, HIF_LAST_BUFFER | HIF_DATA_VALID, ++ skb); ++ ++ netif_info(priv, tx_queued, priv->ndev, ++ "%s: pkt sent successfully skb:%p nr_frags:%d len:%d\n", ++ __func__, skb, nr_frags, skb->len); ++ } else { ++ __hif_lib_xmit_pkt(&priv->client, queuenum, skb->data, ++ skb->len, ctrl, HIF_FIRST_BUFFER | ++ HIF_LAST_BUFFER | HIF_DATA_VALID, ++ skb); ++ netif_info(priv, tx_queued, priv->ndev, ++ "%s: pkt sent successfully skb:%p len:%d\n", ++ __func__, skb, skb->len); ++ } ++ hif_tx_dma_start(); ++ priv->stats.tx_packets++; ++ priv->stats.tx_bytes += skb->len; ++ hif_lib_tx_credit_use(pfe, priv->id, queuenum, 1); ++} ++ ++/* pfe_eth_flush_txQ ++ */ ++static void pfe_eth_flush_txQ(struct pfe_eth_priv_s *priv, int tx_q_num, int ++ from_tx, int n_desc) ++{ ++ struct sk_buff *skb; ++ struct netdev_queue *tx_queue = netdev_get_tx_queue(priv->ndev, ++ tx_q_num); ++ unsigned int flags; ++ ++ netif_info(priv, tx_done, priv->ndev, "%s\n", __func__); ++ ++ if (!from_tx) ++ __netif_tx_lock_bh(tx_queue); ++ ++ /* Clean HIF and client queue */ ++ while ((skb = hif_lib_tx_get_next_complete(&priv->client, ++ tx_q_num, &flags, ++ HIF_TX_DESC_NT))) { ++ if (flags & HIF_DATA_VALID) ++ dev_kfree_skb_any(skb); ++ } ++ if (!from_tx) ++ __netif_tx_unlock_bh(tx_queue); ++} ++ ++/* pfe_eth_flush_tx ++ */ ++static void pfe_eth_flush_tx(struct pfe_eth_priv_s *priv) ++{ ++ int ii; ++ ++ netif_info(priv, tx_done, priv->ndev, "%s\n", __func__); ++ ++ for (ii = 0; ii < emac_txq_cnt; ii++) ++ pfe_eth_flush_txQ(priv, ii, 0, 0); ++} ++ ++void pfe_tx_get_req_desc(struct sk_buff *skb, unsigned int *n_desc, unsigned int ++ *n_segs) ++{ ++ struct skb_shared_info *sh = skb_shinfo(skb); ++ ++ /* Scattered data */ ++ if (sh->nr_frags) { ++ *n_desc = sh->nr_frags + 1; ++ *n_segs = 1; ++ /* Regular case */ ++ } else { ++ *n_desc = 1; ++ *n_segs = 1; ++ } ++} ++ ++/* pfe_eth_send_packet ++ */ ++static int pfe_eth_send_packet(struct sk_buff *skb, struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ int tx_q_num = skb_get_queue_mapping(skb); ++ int n_desc, n_segs; ++ struct netdev_queue *tx_queue = netdev_get_tx_queue(priv->ndev, ++ tx_q_num); ++ ++ netif_info(priv, tx_queued, ndev, "%s\n", __func__); ++ ++ if ((!skb_is_gso(skb)) && (skb_headroom(skb) < (PFE_PKT_HEADER_SZ + ++ sizeof(unsigned long)))) { ++ netif_warn(priv, tx_err, priv->ndev, "%s: copying skb\n", ++ __func__); ++ ++ if (pskb_expand_head(skb, (PFE_PKT_HEADER_SZ + sizeof(unsigned ++ long)), 0, GFP_ATOMIC)) { ++ /* No need to re-transmit, no way to recover*/ ++ kfree_skb(skb); ++ priv->stats.tx_dropped++; ++ return NETDEV_TX_OK; ++ } ++ } ++ ++ pfe_tx_get_req_desc(skb, &n_desc, &n_segs); ++ ++ hif_tx_lock(&pfe->hif); ++ if (unlikely(pfe_eth_might_stop_tx(priv, tx_q_num, tx_queue, n_desc, ++ n_segs))) { ++#ifdef PFE_ETH_TX_STATS ++ if (priv->was_stopped[tx_q_num]) { ++ priv->clean_fail[tx_q_num]++; ++ priv->was_stopped[tx_q_num] = 0; ++ } ++#endif ++ hif_tx_unlock(&pfe->hif); ++ return NETDEV_TX_BUSY; ++ } ++ ++ pfe_hif_send_packet(skb, priv, tx_q_num); ++ ++ hif_tx_unlock(&pfe->hif); ++ ++ tx_queue->trans_start = jiffies; ++ ++#ifdef PFE_ETH_TX_STATS ++ priv->was_stopped[tx_q_num] = 0; ++#endif ++ ++ return NETDEV_TX_OK; ++} ++ ++/* pfe_eth_select_queue ++ * ++ */ ++static u16 pfe_eth_select_queue(struct net_device *ndev, struct sk_buff *skb, ++ void *accel_priv, ++ select_queue_fallback_t fallback) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ return pfe_eth_get_queuenum(priv, skb); ++} ++ ++/* pfe_eth_get_stats ++ */ ++static struct net_device_stats *pfe_eth_get_stats(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ netif_info(priv, drv, ndev, "%s\n", __func__); ++ ++ return &priv->stats; ++} ++ ++/* pfe_eth_set_mac_address ++ */ ++static int pfe_eth_set_mac_address(struct net_device *ndev, void *addr) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ struct sockaddr *sa = addr; ++ ++ netif_info(priv, drv, ndev, "%s\n", __func__); ++ ++ if (!is_valid_ether_addr(sa->sa_data)) ++ return -EADDRNOTAVAIL; ++ ++ memcpy(ndev->dev_addr, sa->sa_data, ETH_ALEN); ++ ++ gemac_set_laddrN(priv->EMAC_baseaddr, ++ (struct pfe_mac_addr *)ndev->dev_addr, 1); ++ ++ return 0; ++} ++ ++/* pfe_eth_enet_addr_byte_mac ++ */ ++int pfe_eth_enet_addr_byte_mac(u8 *enet_byte_addr, ++ struct pfe_mac_addr *enet_addr) ++{ ++ if (!enet_byte_addr || !enet_addr) { ++ return -1; ++ ++ } else { ++ enet_addr->bottom = enet_byte_addr[0] | ++ (enet_byte_addr[1] << 8) | ++ (enet_byte_addr[2] << 16) | ++ (enet_byte_addr[3] << 24); ++ enet_addr->top = enet_byte_addr[4] | ++ (enet_byte_addr[5] << 8); ++ return 0; ++ } ++} ++ ++/* pfe_eth_set_multi ++ */ ++static void pfe_eth_set_multi(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ struct pfe_mac_addr hash_addr; /* hash register structure */ ++ /* specific mac address register structure */ ++ struct pfe_mac_addr spec_addr; ++ int result; /* index into hash register to set.. */ ++ int uc_count = 0; ++ struct netdev_hw_addr *ha; ++ ++ if (ndev->flags & IFF_PROMISC) { ++ netif_info(priv, drv, ndev, "entering promiscuous mode\n"); ++ ++ priv->promisc = 1; ++ gemac_enable_copy_all(priv->EMAC_baseaddr); ++ } else { ++ priv->promisc = 0; ++ gemac_disable_copy_all(priv->EMAC_baseaddr); ++ } ++ ++ /* Enable broadcast frame reception if required. */ ++ if (ndev->flags & IFF_BROADCAST) { ++ gemac_allow_broadcast(priv->EMAC_baseaddr); ++ } else { ++ netif_info(priv, drv, ndev, ++ "disabling broadcast frame reception\n"); ++ ++ gemac_no_broadcast(priv->EMAC_baseaddr); ++ } ++ ++ if (ndev->flags & IFF_ALLMULTI) { ++ /* Set the hash to rx all multicast frames */ ++ hash_addr.bottom = 0xFFFFFFFF; ++ hash_addr.top = 0xFFFFFFFF; ++ gemac_set_hash(priv->EMAC_baseaddr, &hash_addr); ++ netdev_for_each_uc_addr(ha, ndev) { ++ if (uc_count >= MAX_UC_SPEC_ADDR_REG) ++ break; ++ pfe_eth_enet_addr_byte_mac(ha->addr, &spec_addr); ++ gemac_set_laddrN(priv->EMAC_baseaddr, &spec_addr, ++ uc_count + 2); ++ uc_count++; ++ } ++ } else if ((netdev_mc_count(ndev) > 0) || (netdev_uc_count(ndev))) { ++ u8 *addr; ++ ++ hash_addr.bottom = 0; ++ hash_addr.top = 0; ++ ++ netdev_for_each_mc_addr(ha, ndev) { ++ addr = ha->addr; ++ ++ netif_info(priv, drv, ndev, ++ "adding multicast address %X:%X:%X:%X:%X:%X to gem filter\n", ++ addr[0], addr[1], addr[2], ++ addr[3], addr[4], addr[5]); ++ ++ result = pfe_eth_get_hash(addr); ++ ++ if (result < EMAC_HASH_REG_BITS) { ++ if (result < 32) ++ hash_addr.bottom |= (1 << result); ++ else ++ hash_addr.top |= (1 << (result - 32)); ++ } else { ++ break; ++ } ++ } ++ ++ uc_count = -1; ++ netdev_for_each_uc_addr(ha, ndev) { ++ addr = ha->addr; ++ ++ if (++uc_count < MAX_UC_SPEC_ADDR_REG) { ++ netdev_info(ndev, ++ "adding unicast address %02x:%02x:%02x:%02x:%02x:%02x to gem filter\n", ++ addr[0], addr[1], addr[2], ++ addr[3], addr[4], addr[5]); ++ pfe_eth_enet_addr_byte_mac(addr, &spec_addr); ++ gemac_set_laddrN(priv->EMAC_baseaddr, ++ &spec_addr, uc_count + 2); ++ } else { ++ netif_info(priv, drv, ndev, ++ "adding unicast address %02x:%02x:%02x:%02x:%02x:%02x to gem hash\n", ++ addr[0], addr[1], addr[2], ++ addr[3], addr[4], addr[5]); ++ ++ result = pfe_eth_get_hash(addr); ++ if (result >= EMAC_HASH_REG_BITS) { ++ break; ++ ++ } else { ++ if (result < 32) ++ hash_addr.bottom |= (1 << ++ result); ++ else ++ hash_addr.top |= (1 << ++ (result - 32)); ++ } ++ } ++ } ++ ++ gemac_set_hash(priv->EMAC_baseaddr, &hash_addr); ++ } ++ ++ if (!(netdev_uc_count(ndev) >= MAX_UC_SPEC_ADDR_REG)) { ++ /* ++ * Check if there are any specific address HW registers that ++ * need to be flushed ++ */ ++ for (uc_count = netdev_uc_count(ndev); uc_count < ++ MAX_UC_SPEC_ADDR_REG; uc_count++) ++ gemac_clear_laddrN(priv->EMAC_baseaddr, uc_count + 2); ++ } ++ ++ if (ndev->flags & IFF_LOOPBACK) ++ gemac_set_loop(priv->EMAC_baseaddr, LB_LOCAL); ++} ++ ++/* pfe_eth_set_features ++ */ ++static int pfe_eth_set_features(struct net_device *ndev, netdev_features_t ++ features) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ int rc = 0; ++ ++ if (features & NETIF_F_RXCSUM) ++ gemac_enable_rx_checksum_offload(priv->EMAC_baseaddr); ++ else ++ gemac_disable_rx_checksum_offload(priv->EMAC_baseaddr); ++ return rc; ++} ++ ++/* pfe_eth_fast_tx_timeout ++ */ ++static enum hrtimer_restart pfe_eth_fast_tx_timeout(struct hrtimer *timer) ++{ ++ struct pfe_eth_fast_timer *fast_tx_timeout = container_of(timer, struct ++ pfe_eth_fast_timer, ++ timer); ++ struct pfe_eth_priv_s *priv = container_of(fast_tx_timeout->base, ++ struct pfe_eth_priv_s, ++ fast_tx_timeout); ++ struct netdev_queue *tx_queue = netdev_get_tx_queue(priv->ndev, ++ fast_tx_timeout->queuenum); ++ ++ if (netif_tx_queue_stopped(tx_queue)) { ++#ifdef PFE_ETH_TX_STATS ++ priv->was_stopped[fast_tx_timeout->queuenum] = 1; ++#endif ++ netif_tx_wake_queue(tx_queue); ++ } ++ ++ return HRTIMER_NORESTART; ++} ++ ++/* pfe_eth_fast_tx_timeout_init ++ */ ++static void pfe_eth_fast_tx_timeout_init(struct pfe_eth_priv_s *priv) ++{ ++ int i; ++ ++ for (i = 0; i < emac_txq_cnt; i++) { ++ priv->fast_tx_timeout[i].queuenum = i; ++ hrtimer_init(&priv->fast_tx_timeout[i].timer, CLOCK_MONOTONIC, ++ HRTIMER_MODE_REL); ++ priv->fast_tx_timeout[i].timer.function = ++ pfe_eth_fast_tx_timeout; ++ priv->fast_tx_timeout[i].base = priv->fast_tx_timeout; ++ } ++} ++ ++static struct sk_buff *pfe_eth_rx_skb(struct net_device *ndev, ++ struct pfe_eth_priv_s *priv, ++ unsigned int qno) ++{ ++ void *buf_addr; ++ unsigned int rx_ctrl; ++ unsigned int desc_ctrl = 0; ++ struct hif_ipsec_hdr *ipsec_hdr = NULL; ++ struct sk_buff *skb; ++ struct sk_buff *skb_frag, *skb_frag_last = NULL; ++ int length = 0, offset; ++ ++ skb = priv->skb_inflight[qno]; ++ ++ if (skb) { ++ skb_frag_last = skb_shinfo(skb)->frag_list; ++ if (skb_frag_last) { ++ while (skb_frag_last->next) ++ skb_frag_last = skb_frag_last->next; ++ } ++ } ++ ++ while (!(desc_ctrl & CL_DESC_LAST)) { ++ buf_addr = hif_lib_receive_pkt(&priv->client, qno, &length, ++ &offset, &rx_ctrl, &desc_ctrl, ++ (void **)&ipsec_hdr); ++ if (!buf_addr) ++ goto incomplete; ++ ++#ifdef PFE_ETH_NAPI_STATS ++ priv->napi_counters[NAPI_DESC_COUNT]++; ++#endif ++ ++ /* First frag */ ++ if (desc_ctrl & CL_DESC_FIRST) { ++ skb = build_skb(buf_addr, 0); ++ if (unlikely(!skb)) ++ goto pkt_drop; ++ ++ skb_reserve(skb, offset); ++ skb_put(skb, length); ++ skb->dev = ndev; ++ ++ if ((ndev->features & NETIF_F_RXCSUM) && (rx_ctrl & ++ HIF_CTRL_RX_CHECKSUMMED)) ++ skb->ip_summed = CHECKSUM_UNNECESSARY; ++ else ++ skb_checksum_none_assert(skb); ++ ++ } else { ++ /* Next frags */ ++ if (unlikely(!skb)) { ++ pr_err("%s: NULL skb_inflight\n", ++ __func__); ++ goto pkt_drop; ++ } ++ ++ skb_frag = build_skb(buf_addr, 0); ++ ++ if (unlikely(!skb_frag)) { ++ kfree(buf_addr); ++ goto pkt_drop; ++ } ++ ++ skb_reserve(skb_frag, offset); ++ skb_put(skb_frag, length); ++ ++ skb_frag->dev = ndev; ++ ++ if (skb_shinfo(skb)->frag_list) ++ skb_frag_last->next = skb_frag; ++ else ++ skb_shinfo(skb)->frag_list = skb_frag; ++ ++ skb->truesize += skb_frag->truesize; ++ skb->data_len += length; ++ skb->len += length; ++ skb_frag_last = skb_frag; ++ } ++ } ++ ++ priv->skb_inflight[qno] = NULL; ++ return skb; ++ ++incomplete: ++ priv->skb_inflight[qno] = skb; ++ return NULL; ++ ++pkt_drop: ++ priv->skb_inflight[qno] = NULL; ++ ++ if (skb) ++ kfree_skb(skb); ++ else ++ kfree(buf_addr); ++ ++ priv->stats.rx_errors++; ++ ++ return NULL; ++} ++ ++/* pfe_eth_poll ++ */ ++static int pfe_eth_poll(struct pfe_eth_priv_s *priv, struct napi_struct *napi, ++ unsigned int qno, int budget) ++{ ++ struct net_device *ndev = priv->ndev; ++ struct sk_buff *skb; ++ int work_done = 0; ++ unsigned int len; ++ ++ netif_info(priv, intr, priv->ndev, "%s\n", __func__); ++ ++#ifdef PFE_ETH_NAPI_STATS ++ priv->napi_counters[NAPI_POLL_COUNT]++; ++#endif ++ ++ do { ++ skb = pfe_eth_rx_skb(ndev, priv, qno); ++ ++ if (!skb) ++ break; ++ ++ len = skb->len; ++ ++ /* Packet will be processed */ ++ skb->protocol = eth_type_trans(skb, ndev); ++ ++ netif_receive_skb(skb); ++ ++ priv->stats.rx_packets++; ++ priv->stats.rx_bytes += len; ++ ++ work_done++; ++ ++#ifdef PFE_ETH_NAPI_STATS ++ priv->napi_counters[NAPI_PACKET_COUNT]++; ++#endif ++ ++ } while (work_done < budget); ++ ++ /* ++ * If no Rx receive nor cleanup work was done, exit polling mode. ++ * No more netif_running(dev) check is required here , as this is ++ * checked in net/core/dev.c (2.6.33.5 kernel specific). ++ */ ++ if (work_done < budget) { ++ napi_complete(napi); ++ ++ hif_lib_event_handler_start(&priv->client, EVENT_RX_PKT_IND, ++ qno); ++ } ++#ifdef PFE_ETH_NAPI_STATS ++ else ++ priv->napi_counters[NAPI_FULL_BUDGET_COUNT]++; ++#endif ++ ++ return work_done; ++} ++ ++/* ++ * pfe_eth_lro_poll ++ */ ++static int pfe_eth_lro_poll(struct napi_struct *napi, int budget) ++{ ++ struct pfe_eth_priv_s *priv = container_of(napi, struct pfe_eth_priv_s, ++ lro_napi); ++ ++ netif_info(priv, intr, priv->ndev, "%s\n", __func__); ++ ++ return pfe_eth_poll(priv, napi, 2, budget); ++} ++ ++/* pfe_eth_low_poll ++ */ ++static int pfe_eth_low_poll(struct napi_struct *napi, int budget) ++{ ++ struct pfe_eth_priv_s *priv = container_of(napi, struct pfe_eth_priv_s, ++ low_napi); ++ ++ netif_info(priv, intr, priv->ndev, "%s\n", __func__); ++ ++ return pfe_eth_poll(priv, napi, 1, budget); ++} ++ ++/* pfe_eth_high_poll ++ */ ++static int pfe_eth_high_poll(struct napi_struct *napi, int budget) ++{ ++ struct pfe_eth_priv_s *priv = container_of(napi, struct pfe_eth_priv_s, ++ high_napi); ++ ++ netif_info(priv, intr, priv->ndev, "%s\n", __func__); ++ ++ return pfe_eth_poll(priv, napi, 0, budget); ++} ++ ++static const struct net_device_ops pfe_netdev_ops = { ++ .ndo_open = pfe_eth_open, ++ .ndo_stop = pfe_eth_close, ++ .ndo_start_xmit = pfe_eth_send_packet, ++ .ndo_select_queue = pfe_eth_select_queue, ++ .ndo_get_stats = pfe_eth_get_stats, ++ .ndo_set_mac_address = pfe_eth_set_mac_address, ++ .ndo_set_rx_mode = pfe_eth_set_multi, ++ .ndo_set_features = pfe_eth_set_features, ++ .ndo_validate_addr = eth_validate_addr, ++}; ++ ++/* pfe_eth_init_one ++ */ ++static int pfe_eth_init_one(struct pfe *pfe, int id) ++{ ++ struct net_device *ndev = NULL; ++ struct pfe_eth_priv_s *priv = NULL; ++ struct ls1012a_eth_platform_data *einfo; ++ struct ls1012a_mdio_platform_data *minfo; ++ struct ls1012a_pfe_platform_data *pfe_info; ++ int err; ++ ++ /* Extract pltform data */ ++ pfe_info = (struct ls1012a_pfe_platform_data *) ++ pfe->dev->platform_data; ++ if (!pfe_info) { ++ pr_err( ++ "%s: pfe missing additional platform data\n" ++ , __func__); ++ err = -ENODEV; ++ goto err0; ++ } ++ ++ einfo = (struct ls1012a_eth_platform_data *) ++ pfe_info->ls1012a_eth_pdata; ++ ++ /* einfo never be NULL, but no harm in having this check */ ++ if (!einfo) { ++ pr_err( ++ "%s: pfe missing additional gemacs platform data\n" ++ , __func__); ++ err = -ENODEV; ++ goto err0; ++ } ++ ++ minfo = (struct ls1012a_mdio_platform_data *) ++ pfe_info->ls1012a_mdio_pdata; ++ ++ /* einfo never be NULL, but no harm in having this check */ ++ if (!minfo) { ++ pr_err( ++ "%s: pfe missing additional mdios platform data\n", ++ __func__); ++ err = -ENODEV; ++ goto err0; ++ } ++ ++ /* Create an ethernet device instance */ ++ ndev = alloc_etherdev_mq(sizeof(*priv), emac_txq_cnt); ++ ++ if (!ndev) { ++ pr_err("%s: gemac %d device allocation failed\n", ++ __func__, einfo[id].gem_id); ++ err = -ENOMEM; ++ goto err0; ++ } ++ ++ priv = netdev_priv(ndev); ++ priv->ndev = ndev; ++ priv->id = einfo[id].gem_id; ++ priv->pfe = pfe; ++ ++ SET_NETDEV_DEV(priv->ndev, priv->pfe->dev); ++ ++ pfe->eth.eth_priv[id] = priv; ++ ++ /* Set the info in the priv to the current info */ ++ priv->einfo = &einfo[id]; ++ priv->EMAC_baseaddr = cbus_emac_base[id]; ++ priv->PHY_baseaddr = cbus_emac_base[0]; ++ priv->GPI_baseaddr = cbus_gpi_base[id]; ++ ++#define HIF_GEMAC_TMUQ_BASE 6 ++ priv->low_tmu_q = HIF_GEMAC_TMUQ_BASE + (id * 2); ++ priv->high_tmu_q = priv->low_tmu_q + 1; ++ ++ spin_lock_init(&priv->lock); ++ ++ pfe_eth_fast_tx_timeout_init(priv); ++ ++ /* Copy the station address into the dev structure, */ ++ memcpy(ndev->dev_addr, einfo[id].mac_addr, ETH_ALEN); ++ ++ /* Initialize mdio */ ++ if (minfo[id].enabled) { ++ err = pfe_eth_mdio_init(priv, &minfo[id]); ++ if (err) { ++ netdev_err(ndev, "%s: pfe_eth_mdio_init() failed\n", ++ __func__); ++ goto err2; ++ } ++ } ++ ++ ndev->mtu = 1500; ++ ++ /* Set MTU limits */ ++ ndev->min_mtu = ETH_MIN_MTU; ++ ndev->max_mtu = JUMBO_FRAME_SIZE; ++ ++ /* supported features */ ++ ndev->hw_features = NETIF_F_SG; ++ ++ /*Enable after checksum offload is validated */ ++ ndev->hw_features = NETIF_F_RXCSUM | NETIF_F_IP_CSUM | ++ NETIF_F_IPV6_CSUM | NETIF_F_SG; ++ ++ /* enabled by default */ ++ ndev->features = ndev->hw_features; ++ ++ priv->usr_features = ndev->features; ++ ++ ndev->netdev_ops = &pfe_netdev_ops; ++ ++ ndev->ethtool_ops = &pfe_ethtool_ops; ++ ++ /* Enable basic messages by default */ ++ priv->msg_enable = NETIF_MSG_IFUP | NETIF_MSG_IFDOWN | NETIF_MSG_LINK | ++ NETIF_MSG_PROBE; ++ ++ netif_napi_add(ndev, &priv->low_napi, pfe_eth_low_poll, ++ HIF_RX_POLL_WEIGHT - 16); ++ netif_napi_add(ndev, &priv->high_napi, pfe_eth_high_poll, ++ HIF_RX_POLL_WEIGHT - 16); ++ netif_napi_add(ndev, &priv->lro_napi, pfe_eth_lro_poll, ++ HIF_RX_POLL_WEIGHT - 16); ++ ++ err = register_netdev(ndev); ++ ++ if (err) { ++ netdev_err(ndev, "register_netdev() failed\n"); ++ goto err3; ++ } ++ device_init_wakeup(&ndev->dev, WAKE_MAGIC); ++ ++ if (!(priv->einfo->phy_flags & GEMAC_NO_PHY)) { ++ err = pfe_phy_init(ndev); ++ if (err) { ++ netdev_err(ndev, "%s: pfe_phy_init() failed\n", ++ __func__); ++ goto err4; ++ } ++ } ++ ++ netif_carrier_on(ndev); ++ ++ /* Create all the sysfs files */ ++ if (pfe_eth_sysfs_init(ndev)) ++ goto err4; ++ ++ netif_info(priv, probe, ndev, "%s: created interface, baseaddr: %p\n", ++ __func__, priv->EMAC_baseaddr); ++ ++ return 0; ++err4: ++ unregister_netdev(ndev); ++err3: ++ pfe_eth_mdio_exit(priv->mii_bus); ++err2: ++ free_netdev(priv->ndev); ++err0: ++ return err; ++} ++ ++/* pfe_eth_init ++ */ ++int pfe_eth_init(struct pfe *pfe) ++{ ++ int ii = 0; ++ int err; ++ ++ pr_info("%s\n", __func__); ++ ++ cbus_emac_base[0] = EMAC1_BASE_ADDR; ++ cbus_emac_base[1] = EMAC2_BASE_ADDR; ++ ++ cbus_gpi_base[0] = EGPI1_BASE_ADDR; ++ cbus_gpi_base[1] = EGPI2_BASE_ADDR; ++ ++ for (ii = 0; ii < NUM_GEMAC_SUPPORT; ii++) { ++ err = pfe_eth_init_one(pfe, ii); ++ if (err) ++ goto err0; ++ } ++ ++ return 0; ++ ++err0: ++ while (ii--) ++ pfe_eth_exit_one(pfe->eth.eth_priv[ii]); ++ ++ /* Register three network devices in the kernel */ ++ return err; ++} ++ ++/* pfe_eth_exit_one ++ */ ++static void pfe_eth_exit_one(struct pfe_eth_priv_s *priv) ++{ ++ netif_info(priv, probe, priv->ndev, "%s\n", __func__); ++ ++ pfe_eth_sysfs_exit(priv->ndev); ++ ++ unregister_netdev(priv->ndev); ++ ++ if (!(priv->einfo->phy_flags & GEMAC_NO_PHY)) ++ pfe_phy_exit(priv->ndev); ++ ++ if (priv->mii_bus) ++ pfe_eth_mdio_exit(priv->mii_bus); ++ ++ free_netdev(priv->ndev); ++} ++ ++/* pfe_eth_exit ++ */ ++void pfe_eth_exit(struct pfe *pfe) ++{ ++ int ii; ++ ++ pr_info("%s\n", __func__); ++ ++ for (ii = NUM_GEMAC_SUPPORT - 1; ii >= 0; ii--) ++ pfe_eth_exit_one(pfe->eth.eth_priv[ii]); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_eth.h +@@ -0,0 +1,184 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#ifndef _PFE_ETH_H_ ++#define _PFE_ETH_H_ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define PFE_ETH_NAPI_STATS ++#define PFE_ETH_TX_STATS ++ ++#define PFE_ETH_FRAGS_MAX (65536 / HIF_RX_PKT_MIN_SIZE) ++#define LRO_LEN_COUNT_MAX 32 ++#define LRO_NB_COUNT_MAX 32 ++ ++#define PFE_PAUSE_FLAG_ENABLE 1 ++#define PFE_PAUSE_FLAG_AUTONEG 2 ++ ++/* GEMAC configured by SW */ ++/* GEMAC configured by phy lines (not for MII/GMII) */ ++ ++#define GEMAC_SW_FULL_DUPLEX BIT(9) ++#define GEMAC_SW_SPEED_10M (0 << 12) ++#define GEMAC_SW_SPEED_100M BIT(12) ++#define GEMAC_SW_SPEED_1G (2 << 12) ++ ++#define GEMAC_NO_PHY BIT(0) ++ ++struct ls1012a_eth_platform_data { ++ /* device specific information */ ++ u32 device_flags; ++ char name[16]; ++ ++ /* board specific information */ ++ u32 mii_config; ++ u32 phy_flags; ++ u32 gem_id; ++ u32 bus_id; ++ u32 phy_id; ++ u32 mdio_muxval; ++ u8 mac_addr[ETH_ALEN]; ++}; ++ ++struct ls1012a_mdio_platform_data { ++ int enabled; ++ int irq[32]; ++ u32 phy_mask; ++ int mdc_div; ++}; ++ ++struct ls1012a_pfe_platform_data { ++ struct ls1012a_eth_platform_data ls1012a_eth_pdata[3]; ++ struct ls1012a_mdio_platform_data ls1012a_mdio_pdata[3]; ++}; ++ ++#define NUM_GEMAC_SUPPORT 2 ++#define DRV_NAME "pfe-eth" ++#define DRV_VERSION "1.0" ++ ++#define LS1012A_TX_FAST_RECOVERY_TIMEOUT_MS 3 ++#define TX_POLL_TIMEOUT_MS 1000 ++ ++#define EMAC_TXQ_CNT 16 ++#define EMAC_TXQ_DEPTH (HIF_TX_DESC_NT) ++ ++#define JUMBO_FRAME_SIZE 10258 ++/* ++ * Client Tx queue threshold, for txQ flush condition. ++ * It must be smaller than the queue size (in case we ever change it in the ++ * future). ++ */ ++#define HIF_CL_TX_FLUSH_MARK 32 ++ ++/* ++ * Max number of TX resources (HIF descriptors or skbs) that will be released ++ * in a single go during batch recycling. ++ * Should be lower than the flush mark so the SW can provide the HW with a ++ * continuous stream of packets instead of bursts. ++ */ ++#define TX_FREE_MAX_COUNT 16 ++#define EMAC_RXQ_CNT 3 ++#define EMAC_RXQ_DEPTH HIF_RX_DESC_NT ++/* make sure clients can receive a full burst of packets */ ++#define EMAC_RMON_TXBYTES_POS 0x00 ++#define EMAC_RMON_RXBYTES_POS 0x14 ++ ++#define EMAC_QUEUENUM_MASK (emac_txq_cnt - 1) ++#define EMAC_MDIO_TIMEOUT 1000 ++#define MAX_UC_SPEC_ADDR_REG 31 ++ ++struct pfe_eth_fast_timer { ++ int queuenum; ++ struct hrtimer timer; ++ void *base; ++}; ++ ++struct pfe_eth_priv_s { ++ struct pfe *pfe; ++ struct hif_client_s client; ++ struct napi_struct lro_napi; ++ struct napi_struct low_napi; ++ struct napi_struct high_napi; ++ int low_tmu_q; ++ int high_tmu_q; ++ struct net_device_stats stats; ++ struct net_device *ndev; ++ int id; ++ int promisc; ++ unsigned int msg_enable; ++ unsigned int usr_features; ++ ++ spinlock_t lock; /* protect member variables */ ++ unsigned int event_status; ++ int irq; ++ void *EMAC_baseaddr; ++ /* This points to the EMAC base from where we access PHY */ ++ void *PHY_baseaddr; ++ void *GPI_baseaddr; ++ /* PHY stuff */ ++ struct phy_device *phydev; ++ int oldspeed; ++ int oldduplex; ++ int oldlink; ++ /* mdio info */ ++ int mdc_div; ++ struct mii_bus *mii_bus; ++ struct clk *gemtx_clk; ++ int wol; ++ int pause_flag; ++ ++ int default_priority; ++ struct pfe_eth_fast_timer fast_tx_timeout[EMAC_TXQ_CNT]; ++ ++ struct ls1012a_eth_platform_data *einfo; ++ struct sk_buff *skb_inflight[EMAC_RXQ_CNT + 6]; ++ ++#ifdef PFE_ETH_TX_STATS ++ unsigned int stop_queue_total[EMAC_TXQ_CNT]; ++ unsigned int stop_queue_hif[EMAC_TXQ_CNT]; ++ unsigned int stop_queue_hif_client[EMAC_TXQ_CNT]; ++ unsigned int stop_queue_credit[EMAC_TXQ_CNT]; ++ unsigned int clean_fail[EMAC_TXQ_CNT]; ++ unsigned int was_stopped[EMAC_TXQ_CNT]; ++#endif ++ ++#ifdef PFE_ETH_NAPI_STATS ++ unsigned int napi_counters[NAPI_MAX_COUNT]; ++#endif ++ unsigned int frags_inflight[EMAC_RXQ_CNT + 6]; ++}; ++ ++struct pfe_eth { ++ struct pfe_eth_priv_s *eth_priv[3]; ++}; ++ ++int pfe_eth_init(struct pfe *pfe); ++void pfe_eth_exit(struct pfe *pfe); ++int pfe_eth_suspend(struct net_device *dev); ++int pfe_eth_resume(struct net_device *dev); ++int pfe_eth_mdio_reset(struct mii_bus *bus); ++ ++#endif /* _PFE_ETH_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_firmware.c +@@ -0,0 +1,314 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++/* ++ * @file ++ * Contains all the functions to handle parsing and loading of PE firmware ++ * files. ++ */ ++#include ++ ++#include "pfe_mod.h" ++#include "pfe_firmware.h" ++#include "pfe/pfe.h" ++ ++static struct elf32_shdr *get_elf_section_header(const struct firmware *fw, ++ const char *section) ++{ ++ struct elf32_hdr *elf_hdr = (struct elf32_hdr *)fw->data; ++ struct elf32_shdr *shdr; ++ struct elf32_shdr *shdr_shstr; ++ Elf32_Off e_shoff = be32_to_cpu(elf_hdr->e_shoff); ++ Elf32_Half e_shentsize = be16_to_cpu(elf_hdr->e_shentsize); ++ Elf32_Half e_shnum = be16_to_cpu(elf_hdr->e_shnum); ++ Elf32_Half e_shstrndx = be16_to_cpu(elf_hdr->e_shstrndx); ++ Elf32_Off shstr_offset; ++ Elf32_Word sh_name; ++ const char *name; ++ int i; ++ ++ /* Section header strings */ ++ shdr_shstr = (struct elf32_shdr *)(fw->data + e_shoff + e_shstrndx * ++ e_shentsize); ++ shstr_offset = be32_to_cpu(shdr_shstr->sh_offset); ++ ++ for (i = 0; i < e_shnum; i++) { ++ shdr = (struct elf32_shdr *)(fw->data + e_shoff ++ + i * e_shentsize); ++ ++ sh_name = be32_to_cpu(shdr->sh_name); ++ ++ name = (const char *)(fw->data + shstr_offset + sh_name); ++ ++ if (!strcmp(name, section)) ++ return shdr; ++ } ++ ++ pr_err("%s: didn't find section %s\n", __func__, section); ++ ++ return NULL; ++} ++ ++#if defined(CFG_DIAGS) ++static int pfe_get_diags_info(const struct firmware *fw, struct pfe_diags_info ++ *diags_info) ++{ ++ struct elf32_shdr *shdr; ++ unsigned long offset, size; ++ ++ shdr = get_elf_section_header(fw, ".pfe_diags_str"); ++ if (shdr) { ++ offset = be32_to_cpu(shdr->sh_offset); ++ size = be32_to_cpu(shdr->sh_size); ++ diags_info->diags_str_base = be32_to_cpu(shdr->sh_addr); ++ diags_info->diags_str_size = size; ++ diags_info->diags_str_array = kmalloc(size, GFP_KERNEL); ++ memcpy(diags_info->diags_str_array, fw->data + offset, size); ++ ++ return 0; ++ } else { ++ return -1; ++ } ++} ++#endif ++ ++static void pfe_check_version_info(const struct firmware *fw) ++{ ++ /*static char *version = NULL;*/ ++ static char *version; ++ ++ struct elf32_shdr *shdr = get_elf_section_header(fw, ".version"); ++ ++ if (shdr) { ++ if (!version) { ++ /* ++ * this is the first fw we load, use its version ++ * string as reference (whatever it is) ++ */ ++ version = (char *)(fw->data + ++ be32_to_cpu(shdr->sh_offset)); ++ ++ pr_info("PFE binary version: %s\n", version); ++ } else { ++ /* ++ * already have loaded at least one firmware, check ++ * sequence can start now ++ */ ++ if (strcmp(version, (char *)(fw->data + ++ be32_to_cpu(shdr->sh_offset)))) { ++ pr_info( ++ "WARNING: PFE firmware binaries from incompatible version\n"); ++ } ++ } ++ } else { ++ /* ++ * version cannot be verified, a potential issue that should ++ * be reported ++ */ ++ pr_info( ++ "WARNING: PFE firmware binaries from incompatible version\n"); ++ } ++} ++ ++/* PFE elf firmware loader. ++ * Loads an elf firmware image into a list of PE's (specified using a bitmask) ++ * ++ * @param pe_mask Mask of PE id's to load firmware to ++ * @param fw Pointer to the firmware image ++ * ++ * @return 0 on success, a negative value on error ++ * ++ */ ++int pfe_load_elf(int pe_mask, const struct firmware *fw, struct pfe *pfe) ++{ ++ struct elf32_hdr *elf_hdr = (struct elf32_hdr *)fw->data; ++ Elf32_Half sections = be16_to_cpu(elf_hdr->e_shnum); ++ struct elf32_shdr *shdr = (struct elf32_shdr *)(fw->data + ++ be32_to_cpu(elf_hdr->e_shoff)); ++ int id, section; ++ int rc; ++ ++ pr_info("%s\n", __func__); ++ ++ /* Some sanity checks */ ++ if (strncmp(&elf_hdr->e_ident[EI_MAG0], ELFMAG, SELFMAG)) { ++ pr_err("%s: incorrect elf magic number\n", __func__); ++ return -EINVAL; ++ } ++ ++ if (elf_hdr->e_ident[EI_CLASS] != ELFCLASS32) { ++ pr_err("%s: incorrect elf class(%x)\n", __func__, ++ elf_hdr->e_ident[EI_CLASS]); ++ return -EINVAL; ++ } ++ ++ if (elf_hdr->e_ident[EI_DATA] != ELFDATA2MSB) { ++ pr_err("%s: incorrect elf data(%x)\n", __func__, ++ elf_hdr->e_ident[EI_DATA]); ++ return -EINVAL; ++ } ++ ++ if (be16_to_cpu(elf_hdr->e_type) != ET_EXEC) { ++ pr_err("%s: incorrect elf file type(%x)\n", __func__, ++ be16_to_cpu(elf_hdr->e_type)); ++ return -EINVAL; ++ } ++ ++ for (section = 0; section < sections; section++, shdr++) { ++ if (!(be32_to_cpu(shdr->sh_flags) & (SHF_WRITE | SHF_ALLOC | ++ SHF_EXECINSTR))) ++ continue; ++ ++ for (id = 0; id < MAX_PE; id++) ++ if (pe_mask & (1 << id)) { ++ rc = pe_load_elf_section(id, fw->data, shdr, ++ pfe->dev); ++ if (rc < 0) ++ goto err; ++ } ++ } ++ ++ pfe_check_version_info(fw); ++ ++ return 0; ++ ++err: ++ return rc; ++} ++ ++/* PFE firmware initialization. ++ * Loads different firmware files from filesystem. ++ * Initializes PE IMEM/DMEM and UTIL-PE DDR ++ * Initializes control path symbol addresses (by looking them up in the elf ++ * firmware files ++ * Takes PE's out of reset ++ * ++ * @return 0 on success, a negative value on error ++ * ++ */ ++int pfe_firmware_init(struct pfe *pfe) ++{ ++ const struct firmware *class_fw, *tmu_fw; ++ int rc = 0; ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ const char *util_fw_name; ++ const struct firmware *util_fw; ++#endif ++ ++ pr_info("%s\n", __func__); ++ ++ if (request_firmware(&class_fw, CLASS_FIRMWARE_FILENAME, pfe->dev)) { ++ pr_err("%s: request firmware %s failed\n", __func__, ++ CLASS_FIRMWARE_FILENAME); ++ rc = -ETIMEDOUT; ++ goto err0; ++ } ++ ++ if (request_firmware(&tmu_fw, TMU_FIRMWARE_FILENAME, pfe->dev)) { ++ pr_err("%s: request firmware %s failed\n", __func__, ++ TMU_FIRMWARE_FILENAME); ++ rc = -ETIMEDOUT; ++ goto err1; ++} ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ util_fw_name = UTIL_FIRMWARE_FILENAME; ++ ++ if (request_firmware(&util_fw, util_fw_name, pfe->dev)) { ++ pr_err("%s: request firmware %s failed\n", __func__, ++ util_fw_name); ++ rc = -ETIMEDOUT; ++ goto err2; ++ } ++#endif ++ rc = pfe_load_elf(CLASS_MASK, class_fw, pfe); ++ if (rc < 0) { ++ pr_err("%s: class firmware load failed\n", __func__); ++ goto err3; ++ } ++ ++#if defined(CFG_DIAGS) ++ rc = pfe_get_diags_info(class_fw, &pfe->diags.class_diags_info); ++ if (rc < 0) { ++ pr_warn( ++ "PFE diags won't be available for class PEs\n"); ++ rc = 0; ++ } ++#endif ++ ++ rc = pfe_load_elf(TMU_MASK, tmu_fw, pfe); ++ if (rc < 0) { ++ pr_err("%s: tmu firmware load failed\n", __func__); ++ goto err3; ++ } ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ rc = pfe_load_elf(UTIL_MASK, util_fw, pfe); ++ if (rc < 0) { ++ pr_err("%s: util firmware load failed\n", __func__); ++ goto err3; ++ } ++ ++#if defined(CFG_DIAGS) ++ rc = pfe_get_diags_info(util_fw, &pfe->diags.util_diags_info); ++ if (rc < 0) { ++ pr_warn( ++ "PFE diags won't be available for util PE\n"); ++ rc = 0; ++ } ++#endif ++ ++ util_enable(); ++#endif ++ ++ tmu_enable(0xf); ++ class_enable(); ++ ++err3: ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ release_firmware(util_fw); ++ ++err2: ++#endif ++ release_firmware(tmu_fw); ++ ++err1: ++ release_firmware(class_fw); ++ ++err0: ++ return rc; ++} ++ ++/* PFE firmware cleanup ++ * Puts PE's in reset ++ * ++ * ++ */ ++void pfe_firmware_exit(struct pfe *pfe) ++{ ++ pr_info("%s\n", __func__); ++ ++ if (pe_reset_all(&pfe->ctrl) != 0) ++ pr_err("Error: Failed to stop PEs, PFE reload may not work correctly\n"); ++ ++ class_disable(); ++ tmu_disable(0xf); ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ util_disable(); ++#endif ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_firmware.h +@@ -0,0 +1,32 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#ifndef _PFE_FIRMWARE_H_ ++#define _PFE_FIRMWARE_H_ ++ ++#define CLASS_FIRMWARE_FILENAME "ppfe_class_ls1012a.elf" ++#define TMU_FIRMWARE_FILENAME "ppfe_tmu_ls1012a.elf" ++ ++#define PFE_FW_CHECK_PASS 0 ++#define PFE_FW_CHECK_FAIL 1 ++#define NUM_PFE_FW 3 ++ ++int pfe_firmware_init(struct pfe *pfe); ++void pfe_firmware_exit(struct pfe *pfe); ++ ++#endif /* _PFE_FIRMWARE_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hal.c +@@ -0,0 +1,1516 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#include "pfe_mod.h" ++#include "pfe/pfe.h" ++ ++void *cbus_base_addr; ++void *ddr_base_addr; ++unsigned long ddr_phys_base_addr; ++unsigned int ddr_size; ++ ++static struct pe_info pe[MAX_PE]; ++ ++/* Initializes the PFE library. ++ * Must be called before using any of the library functions. ++ * ++ * @param[in] cbus_base CBUS virtual base address (as mapped in ++ * the host CPU address space) ++ * @param[in] ddr_base PFE DDR range virtual base address (as ++ * mapped in the host CPU address space) ++ * @param[in] ddr_phys_base PFE DDR range physical base address (as ++ * mapped in platform) ++ * @param[in] size PFE DDR range size (as defined by the host ++ * software) ++ */ ++void pfe_lib_init(void *cbus_base, void *ddr_base, unsigned long ddr_phys_base, ++ unsigned int size) ++{ ++ cbus_base_addr = cbus_base; ++ ddr_base_addr = ddr_base; ++ ddr_phys_base_addr = ddr_phys_base; ++ ddr_size = size; ++ ++ pe[CLASS0_ID].dmem_base_addr = CLASS_DMEM_BASE_ADDR(0); ++ pe[CLASS0_ID].pmem_base_addr = CLASS_IMEM_BASE_ADDR(0); ++ pe[CLASS0_ID].pmem_size = CLASS_IMEM_SIZE; ++ pe[CLASS0_ID].mem_access_wdata = CLASS_MEM_ACCESS_WDATA; ++ pe[CLASS0_ID].mem_access_addr = CLASS_MEM_ACCESS_ADDR; ++ pe[CLASS0_ID].mem_access_rdata = CLASS_MEM_ACCESS_RDATA; ++ ++ pe[CLASS1_ID].dmem_base_addr = CLASS_DMEM_BASE_ADDR(1); ++ pe[CLASS1_ID].pmem_base_addr = CLASS_IMEM_BASE_ADDR(1); ++ pe[CLASS1_ID].pmem_size = CLASS_IMEM_SIZE; ++ pe[CLASS1_ID].mem_access_wdata = CLASS_MEM_ACCESS_WDATA; ++ pe[CLASS1_ID].mem_access_addr = CLASS_MEM_ACCESS_ADDR; ++ pe[CLASS1_ID].mem_access_rdata = CLASS_MEM_ACCESS_RDATA; ++ ++ pe[CLASS2_ID].dmem_base_addr = CLASS_DMEM_BASE_ADDR(2); ++ pe[CLASS2_ID].pmem_base_addr = CLASS_IMEM_BASE_ADDR(2); ++ pe[CLASS2_ID].pmem_size = CLASS_IMEM_SIZE; ++ pe[CLASS2_ID].mem_access_wdata = CLASS_MEM_ACCESS_WDATA; ++ pe[CLASS2_ID].mem_access_addr = CLASS_MEM_ACCESS_ADDR; ++ pe[CLASS2_ID].mem_access_rdata = CLASS_MEM_ACCESS_RDATA; ++ ++ pe[CLASS3_ID].dmem_base_addr = CLASS_DMEM_BASE_ADDR(3); ++ pe[CLASS3_ID].pmem_base_addr = CLASS_IMEM_BASE_ADDR(3); ++ pe[CLASS3_ID].pmem_size = CLASS_IMEM_SIZE; ++ pe[CLASS3_ID].mem_access_wdata = CLASS_MEM_ACCESS_WDATA; ++ pe[CLASS3_ID].mem_access_addr = CLASS_MEM_ACCESS_ADDR; ++ pe[CLASS3_ID].mem_access_rdata = CLASS_MEM_ACCESS_RDATA; ++ ++ pe[CLASS4_ID].dmem_base_addr = CLASS_DMEM_BASE_ADDR(4); ++ pe[CLASS4_ID].pmem_base_addr = CLASS_IMEM_BASE_ADDR(4); ++ pe[CLASS4_ID].pmem_size = CLASS_IMEM_SIZE; ++ pe[CLASS4_ID].mem_access_wdata = CLASS_MEM_ACCESS_WDATA; ++ pe[CLASS4_ID].mem_access_addr = CLASS_MEM_ACCESS_ADDR; ++ pe[CLASS4_ID].mem_access_rdata = CLASS_MEM_ACCESS_RDATA; ++ ++ pe[CLASS5_ID].dmem_base_addr = CLASS_DMEM_BASE_ADDR(5); ++ pe[CLASS5_ID].pmem_base_addr = CLASS_IMEM_BASE_ADDR(5); ++ pe[CLASS5_ID].pmem_size = CLASS_IMEM_SIZE; ++ pe[CLASS5_ID].mem_access_wdata = CLASS_MEM_ACCESS_WDATA; ++ pe[CLASS5_ID].mem_access_addr = CLASS_MEM_ACCESS_ADDR; ++ pe[CLASS5_ID].mem_access_rdata = CLASS_MEM_ACCESS_RDATA; ++ ++ pe[TMU0_ID].dmem_base_addr = TMU_DMEM_BASE_ADDR(0); ++ pe[TMU0_ID].pmem_base_addr = TMU_IMEM_BASE_ADDR(0); ++ pe[TMU0_ID].pmem_size = TMU_IMEM_SIZE; ++ pe[TMU0_ID].mem_access_wdata = TMU_MEM_ACCESS_WDATA; ++ pe[TMU0_ID].mem_access_addr = TMU_MEM_ACCESS_ADDR; ++ pe[TMU0_ID].mem_access_rdata = TMU_MEM_ACCESS_RDATA; ++ ++ pe[TMU1_ID].dmem_base_addr = TMU_DMEM_BASE_ADDR(1); ++ pe[TMU1_ID].pmem_base_addr = TMU_IMEM_BASE_ADDR(1); ++ pe[TMU1_ID].pmem_size = TMU_IMEM_SIZE; ++ pe[TMU1_ID].mem_access_wdata = TMU_MEM_ACCESS_WDATA; ++ pe[TMU1_ID].mem_access_addr = TMU_MEM_ACCESS_ADDR; ++ pe[TMU1_ID].mem_access_rdata = TMU_MEM_ACCESS_RDATA; ++ ++ pe[TMU3_ID].dmem_base_addr = TMU_DMEM_BASE_ADDR(3); ++ pe[TMU3_ID].pmem_base_addr = TMU_IMEM_BASE_ADDR(3); ++ pe[TMU3_ID].pmem_size = TMU_IMEM_SIZE; ++ pe[TMU3_ID].mem_access_wdata = TMU_MEM_ACCESS_WDATA; ++ pe[TMU3_ID].mem_access_addr = TMU_MEM_ACCESS_ADDR; ++ pe[TMU3_ID].mem_access_rdata = TMU_MEM_ACCESS_RDATA; ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ pe[UTIL_ID].dmem_base_addr = UTIL_DMEM_BASE_ADDR; ++ pe[UTIL_ID].mem_access_wdata = UTIL_MEM_ACCESS_WDATA; ++ pe[UTIL_ID].mem_access_addr = UTIL_MEM_ACCESS_ADDR; ++ pe[UTIL_ID].mem_access_rdata = UTIL_MEM_ACCESS_RDATA; ++#endif ++} ++ ++/* Writes a buffer to PE internal memory from the host ++ * through indirect access registers. ++ * ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] src Buffer source address ++ * @param[in] mem_access_addr DMEM destination address (must be 32bit ++ * aligned) ++ * @param[in] len Number of bytes to copy ++ */ ++void pe_mem_memcpy_to32(int id, u32 mem_access_addr, const void *src, unsigned ++int len) ++{ ++ u32 offset = 0, val, addr; ++ unsigned int len32 = len >> 2; ++ int i; ++ ++ addr = mem_access_addr | PE_MEM_ACCESS_WRITE | ++ PE_MEM_ACCESS_BYTE_ENABLE(0, 4); ++ ++ for (i = 0; i < len32; i++, offset += 4, src += 4) { ++ val = *(u32 *)src; ++ writel(cpu_to_be32(val), pe[id].mem_access_wdata); ++ writel(addr + offset, pe[id].mem_access_addr); ++ } ++ ++ len = (len & 0x3); ++ if (len) { ++ val = 0; ++ ++ addr = (mem_access_addr | PE_MEM_ACCESS_WRITE | ++ PE_MEM_ACCESS_BYTE_ENABLE(0, len)) + offset; ++ ++ for (i = 0; i < len; i++, src++) ++ val |= (*(u8 *)src) << (8 * i); ++ ++ writel(cpu_to_be32(val), pe[id].mem_access_wdata); ++ writel(addr, pe[id].mem_access_addr); ++ } ++} ++ ++/* Writes a buffer to PE internal data memory (DMEM) from the host ++ * through indirect access registers. ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] src Buffer source address ++ * @param[in] dst DMEM destination address (must be 32bit ++ * aligned) ++ * @param[in] len Number of bytes to copy ++ */ ++void pe_dmem_memcpy_to32(int id, u32 dst, const void *src, unsigned int len) ++{ ++ pe_mem_memcpy_to32(id, pe[id].dmem_base_addr | dst | ++ PE_MEM_ACCESS_DMEM, src, len); ++} ++ ++/* Writes a buffer to PE internal program memory (PMEM) from the host ++ * through indirect access registers. ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., TMU3_ID) ++ * @param[in] src Buffer source address ++ * @param[in] dst PMEM destination address (must be 32bit ++ * aligned) ++ * @param[in] len Number of bytes to copy ++ */ ++void pe_pmem_memcpy_to32(int id, u32 dst, const void *src, unsigned int len) ++{ ++ pe_mem_memcpy_to32(id, pe[id].pmem_base_addr | (dst & (pe[id].pmem_size ++ - 1)) | PE_MEM_ACCESS_IMEM, src, len); ++} ++ ++/* Reads PE internal program memory (IMEM) from the host ++ * through indirect access registers. ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., TMU3_ID) ++ * @param[in] addr PMEM read address (must be aligned on size) ++ * @param[in] size Number of bytes to read (maximum 4, must not ++ * cross 32bit boundaries) ++ * @return the data read (in PE endianness, i.e BE). ++ */ ++u32 pe_pmem_read(int id, u32 addr, u8 size) ++{ ++ u32 offset = addr & 0x3; ++ u32 mask = 0xffffffff >> ((4 - size) << 3); ++ u32 val; ++ ++ addr = pe[id].pmem_base_addr | ((addr & ~0x3) & (pe[id].pmem_size - 1)) ++ | PE_MEM_ACCESS_IMEM | PE_MEM_ACCESS_BYTE_ENABLE(offset, size); ++ ++ writel(addr, pe[id].mem_access_addr); ++ val = be32_to_cpu(readl(pe[id].mem_access_rdata)); ++ ++ return (val >> (offset << 3)) & mask; ++} ++ ++/* Writes PE internal data memory (DMEM) from the host ++ * through indirect access registers. ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] addr DMEM write address (must be aligned on size) ++ * @param[in] val Value to write (in PE endianness, i.e BE) ++ * @param[in] size Number of bytes to write (maximum 4, must not ++ * cross 32bit boundaries) ++ */ ++void pe_dmem_write(int id, u32 val, u32 addr, u8 size) ++{ ++ u32 offset = addr & 0x3; ++ ++ addr = pe[id].dmem_base_addr | (addr & ~0x3) | PE_MEM_ACCESS_WRITE | ++ PE_MEM_ACCESS_DMEM | PE_MEM_ACCESS_BYTE_ENABLE(offset, size); ++ ++ /* Indirect access interface is byte swapping data being written */ ++ writel(cpu_to_be32(val << (offset << 3)), pe[id].mem_access_wdata); ++ writel(addr, pe[id].mem_access_addr); ++} ++ ++/* Reads PE internal data memory (DMEM) from the host ++ * through indirect access registers. ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] addr DMEM read address (must be aligned on size) ++ * @param[in] size Number of bytes to read (maximum 4, must not ++ * cross 32bit boundaries) ++ * @return the data read (in PE endianness, i.e BE). ++ */ ++u32 pe_dmem_read(int id, u32 addr, u8 size) ++{ ++ u32 offset = addr & 0x3; ++ u32 mask = 0xffffffff >> ((4 - size) << 3); ++ u32 val; ++ ++ addr = pe[id].dmem_base_addr | (addr & ~0x3) | PE_MEM_ACCESS_DMEM | ++ PE_MEM_ACCESS_BYTE_ENABLE(offset, size); ++ ++ writel(addr, pe[id].mem_access_addr); ++ ++ /* Indirect access interface is byte swapping data being read */ ++ val = be32_to_cpu(readl(pe[id].mem_access_rdata)); ++ ++ return (val >> (offset << 3)) & mask; ++} ++ ++/* This function is used to write to CLASS internal bus peripherals (ccu, ++ * pe-lem) from the host ++ * through indirect access registers. ++ * @param[in] val value to write ++ * @param[in] addr Address to write to (must be aligned on size) ++ * @param[in] size Number of bytes to write (1, 2 or 4) ++ * ++ */ ++void class_bus_write(u32 val, u32 addr, u8 size) ++{ ++ u32 offset = addr & 0x3; ++ ++ writel((addr & CLASS_BUS_ACCESS_BASE_MASK), CLASS_BUS_ACCESS_BASE); ++ ++ addr = (addr & ~CLASS_BUS_ACCESS_BASE_MASK) | PE_MEM_ACCESS_WRITE | ++ (size << 24); ++ ++ writel(cpu_to_be32(val << (offset << 3)), CLASS_BUS_ACCESS_WDATA); ++ writel(addr, CLASS_BUS_ACCESS_ADDR); ++} ++ ++/* Reads from CLASS internal bus peripherals (ccu, pe-lem) from the host ++ * through indirect access registers. ++ * @param[in] addr Address to read from (must be aligned on size) ++ * @param[in] size Number of bytes to read (1, 2 or 4) ++ * @return the read data ++ * ++ */ ++u32 class_bus_read(u32 addr, u8 size) ++{ ++ u32 offset = addr & 0x3; ++ u32 mask = 0xffffffff >> ((4 - size) << 3); ++ u32 val; ++ ++ writel((addr & CLASS_BUS_ACCESS_BASE_MASK), CLASS_BUS_ACCESS_BASE); ++ ++ addr = (addr & ~CLASS_BUS_ACCESS_BASE_MASK) | (size << 24); ++ ++ writel(addr, CLASS_BUS_ACCESS_ADDR); ++ val = be32_to_cpu(readl(CLASS_BUS_ACCESS_RDATA)); ++ ++ return (val >> (offset << 3)) & mask; ++} ++ ++/* Writes data to the cluster memory (PE_LMEM) ++ * @param[in] dst PE LMEM destination address (must be 32bit aligned) ++ * @param[in] src Buffer source address ++ * @param[in] len Number of bytes to copy ++ */ ++void class_pe_lmem_memcpy_to32(u32 dst, const void *src, unsigned int len) ++{ ++ u32 len32 = len >> 2; ++ int i; ++ ++ for (i = 0; i < len32; i++, src += 4, dst += 4) ++ class_bus_write(*(u32 *)src, dst, 4); ++ ++ if (len & 0x2) { ++ class_bus_write(*(u16 *)src, dst, 2); ++ src += 2; ++ dst += 2; ++ } ++ ++ if (len & 0x1) { ++ class_bus_write(*(u8 *)src, dst, 1); ++ src++; ++ dst++; ++ } ++} ++ ++/* Writes value to the cluster memory (PE_LMEM) ++ * @param[in] dst PE LMEM destination address (must be 32bit aligned) ++ * @param[in] val Value to write ++ * @param[in] len Number of bytes to write ++ */ ++void class_pe_lmem_memset(u32 dst, int val, unsigned int len) ++{ ++ u32 len32 = len >> 2; ++ int i; ++ ++ val = val | (val << 8) | (val << 16) | (val << 24); ++ ++ for (i = 0; i < len32; i++, dst += 4) ++ class_bus_write(val, dst, 4); ++ ++ if (len & 0x2) { ++ class_bus_write(val, dst, 2); ++ dst += 2; ++ } ++ ++ if (len & 0x1) { ++ class_bus_write(val, dst, 1); ++ dst++; ++ } ++} ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ ++/* Writes UTIL program memory (DDR) from the host. ++ * ++ * @param[in] addr Address to write (virtual, must be aligned on size) ++ * @param[in] val Value to write (in PE endianness, i.e BE) ++ * @param[in] size Number of bytes to write (2 or 4) ++ */ ++static void util_pmem_write(u32 val, void *addr, u8 size) ++{ ++ void *addr64 = (void *)((unsigned long)addr & ~0x7); ++ unsigned long off = 8 - ((unsigned long)addr & 0x7) - size; ++ ++ /* ++ * IMEM should be loaded as a 64bit swapped value in a 64bit aligned ++ * location ++ */ ++ if (size == 4) ++ writel(be32_to_cpu(val), addr64 + off); ++ else ++ writew(be16_to_cpu((u16)val), addr64 + off); ++} ++ ++/* Writes a buffer to UTIL program memory (DDR) from the host. ++ * ++ * @param[in] dst Address to write (virtual, must be at least 16bit ++ * aligned) ++ * @param[in] src Buffer to write (in PE endianness, i.e BE, must have ++ * same alignment as dst) ++ * @param[in] len Number of bytes to write (must be at least 16bit ++ * aligned) ++ */ ++static void util_pmem_memcpy(void *dst, const void *src, unsigned int len) ++{ ++ unsigned int len32; ++ int i; ++ ++ if ((unsigned long)src & 0x2) { ++ util_pmem_write(*(u16 *)src, dst, 2); ++ src += 2; ++ dst += 2; ++ len -= 2; ++ } ++ ++ len32 = len >> 2; ++ ++ for (i = 0; i < len32; i++, dst += 4, src += 4) ++ util_pmem_write(*(u32 *)src, dst, 4); ++ ++ if (len & 0x2) ++ util_pmem_write(*(u16 *)src, dst, len & 0x2); ++} ++#endif ++ ++/* Loads an elf section into pmem ++ * Code needs to be at least 16bit aligned and only PROGBITS sections are ++ * supported ++ * ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ..., ++ * TMU3_ID) ++ * @param[in] data pointer to the elf firmware ++ * @param[in] shdr pointer to the elf section header ++ * ++ */ ++static int pe_load_pmem_section(int id, const void *data, ++ struct elf32_shdr *shdr) ++{ ++ u32 offset = be32_to_cpu(shdr->sh_offset); ++ u32 addr = be32_to_cpu(shdr->sh_addr); ++ u32 size = be32_to_cpu(shdr->sh_size); ++ u32 type = be32_to_cpu(shdr->sh_type); ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ if (id == UTIL_ID) { ++ pr_err("%s: unsupported pmem section for UTIL\n", ++ __func__); ++ return -EINVAL; ++ } ++#endif ++ ++ if (((unsigned long)(data + offset) & 0x3) != (addr & 0x3)) { ++ pr_err( ++ "%s: load address(%x) and elf file address(%lx) don't have the same alignment\n" ++ , __func__, addr, (unsigned long)data + offset); ++ ++ return -EINVAL; ++ } ++ ++ if (addr & 0x1) { ++ pr_err("%s: load address(%x) is not 16bit aligned\n", ++ __func__, addr); ++ return -EINVAL; ++ } ++ ++ if (size & 0x1) { ++ pr_err("%s: load size(%x) is not 16bit aligned\n", ++ __func__, size); ++ return -EINVAL; ++ } ++ ++ switch (type) { ++ case SHT_PROGBITS: ++ pe_pmem_memcpy_to32(id, addr, data + offset, size); ++ ++ break; ++ ++ default: ++ pr_err("%s: unsupported section type(%x)\n", __func__, ++ type); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++/* Loads an elf section into dmem ++ * Data needs to be at least 32bit aligned, NOBITS sections are correctly ++ * initialized to 0 ++ * ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] data pointer to the elf firmware ++ * @param[in] shdr pointer to the elf section header ++ * ++ */ ++static int pe_load_dmem_section(int id, const void *data, ++ struct elf32_shdr *shdr) ++{ ++ u32 offset = be32_to_cpu(shdr->sh_offset); ++ u32 addr = be32_to_cpu(shdr->sh_addr); ++ u32 size = be32_to_cpu(shdr->sh_size); ++ u32 type = be32_to_cpu(shdr->sh_type); ++ u32 size32 = size >> 2; ++ int i; ++ ++ if (((unsigned long)(data + offset) & 0x3) != (addr & 0x3)) { ++ pr_err( ++ "%s: load address(%x) and elf file address(%lx) don't have the same alignment\n", ++ __func__, addr, (unsigned long)data + offset); ++ ++ return -EINVAL; ++ } ++ ++ if (addr & 0x3) { ++ pr_err("%s: load address(%x) is not 32bit aligned\n", ++ __func__, addr); ++ return -EINVAL; ++ } ++ ++ switch (type) { ++ case SHT_PROGBITS: ++ pe_dmem_memcpy_to32(id, addr, data + offset, size); ++ break; ++ ++ case SHT_NOBITS: ++ for (i = 0; i < size32; i++, addr += 4) ++ pe_dmem_write(id, 0, addr, 4); ++ ++ if (size & 0x3) ++ pe_dmem_write(id, 0, addr, size & 0x3); ++ ++ break; ++ ++ default: ++ pr_err("%s: unsupported section type(%x)\n", __func__, ++ type); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++/* Loads an elf section into DDR ++ * Data needs to be at least 32bit aligned, NOBITS sections are correctly ++ * initialized to 0 ++ * ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] data pointer to the elf firmware ++ * @param[in] shdr pointer to the elf section header ++ * ++ */ ++static int pe_load_ddr_section(int id, const void *data, ++ struct elf32_shdr *shdr, ++ struct device *dev) { ++ u32 offset = be32_to_cpu(shdr->sh_offset); ++ u32 addr = be32_to_cpu(shdr->sh_addr); ++ u32 size = be32_to_cpu(shdr->sh_size); ++ u32 type = be32_to_cpu(shdr->sh_type); ++ u32 flags = be32_to_cpu(shdr->sh_flags); ++ ++ switch (type) { ++ case SHT_PROGBITS: ++ if (flags & SHF_EXECINSTR) { ++ if (id <= CLASS_MAX_ID) { ++ /* DO the loading only once in DDR */ ++ if (id == CLASS0_ID) { ++ pr_err( ++ "%s: load address(%x) and elf file address(%lx) rcvd\n", ++ __func__, addr, ++ (unsigned long)data + offset); ++ if (((unsigned long)(data + offset) ++ & 0x3) != (addr & 0x3)) { ++ pr_err( ++ "%s: load address(%x) and elf file address(%lx) don't have the same alignment\n" ++ , __func__, addr, ++ (unsigned long)data + offset); ++ ++ return -EINVAL; ++ } ++ ++ if (addr & 0x1) { ++ pr_err( ++ "%s: load address(%x) is not 16bit aligned\n" ++ , __func__, addr); ++ return -EINVAL; ++ } ++ ++ if (size & 0x1) { ++ pr_err( ++ "%s: load length(%x) is not 16bit aligned\n" ++ , __func__, size); ++ return -EINVAL; ++ } ++ memcpy(DDR_PHYS_TO_VIRT( ++ DDR_PFE_TO_PHYS(addr)), ++ data + offset, size); ++ } ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ } else if (id == UTIL_ID) { ++ if (((unsigned long)(data + offset) & 0x3) ++ != (addr & 0x3)) { ++ pr_err( ++ "%s: load address(%x) and elf file address(%lx) don't have the same alignment\n" ++ , __func__, addr, ++ (unsigned long)data + offset); ++ ++ return -EINVAL; ++ } ++ ++ if (addr & 0x1) { ++ pr_err( ++ "%s: load address(%x) is not 16bit aligned\n" ++ , __func__, addr); ++ return -EINVAL; ++ } ++ ++ if (size & 0x1) { ++ pr_err( ++ "%s: load length(%x) is not 16bit aligned\n" ++ , __func__, size); ++ return -EINVAL; ++ } ++ ++ util_pmem_memcpy(DDR_PHYS_TO_VIRT( ++ DDR_PFE_TO_PHYS(addr)), ++ data + offset, size); ++ } ++#endif ++ } else { ++ pr_err( ++ "%s: unsupported ddr section type(%x) for PE(%d)\n" ++ , __func__, type, id); ++ return -EINVAL; ++ } ++ ++ } else { ++ memcpy(DDR_PHYS_TO_VIRT(DDR_PFE_TO_PHYS(addr)), data ++ + offset, size); ++ } ++ ++ break; ++ ++ case SHT_NOBITS: ++ memset(DDR_PHYS_TO_VIRT(DDR_PFE_TO_PHYS(addr)), 0, size); ++ ++ break; ++ ++ default: ++ pr_err("%s: unsupported section type(%x)\n", __func__, ++ type); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++/* Loads an elf section into pe lmem ++ * Data needs to be at least 32bit aligned, NOBITS sections are correctly ++ * initialized to 0 ++ * ++ * @param[in] id PE identification (CLASS0_ID,..., CLASS5_ID) ++ * @param[in] data pointer to the elf firmware ++ * @param[in] shdr pointer to the elf section header ++ * ++ */ ++static int pe_load_pe_lmem_section(int id, const void *data, ++ struct elf32_shdr *shdr) ++{ ++ u32 offset = be32_to_cpu(shdr->sh_offset); ++ u32 addr = be32_to_cpu(shdr->sh_addr); ++ u32 size = be32_to_cpu(shdr->sh_size); ++ u32 type = be32_to_cpu(shdr->sh_type); ++ ++ if (id > CLASS_MAX_ID) { ++ pr_err( ++ "%s: unsupported pe-lmem section type(%x) for PE(%d)\n", ++ __func__, type, id); ++ return -EINVAL; ++ } ++ ++ if (((unsigned long)(data + offset) & 0x3) != (addr & 0x3)) { ++ pr_err( ++ "%s: load address(%x) and elf file address(%lx) don't have the same alignment\n", ++ __func__, addr, (unsigned long)data + offset); ++ ++ return -EINVAL; ++ } ++ ++ if (addr & 0x3) { ++ pr_err("%s: load address(%x) is not 32bit aligned\n", ++ __func__, addr); ++ return -EINVAL; ++ } ++ ++ switch (type) { ++ case SHT_PROGBITS: ++ class_pe_lmem_memcpy_to32(addr, data + offset, size); ++ break; ++ ++ case SHT_NOBITS: ++ class_pe_lmem_memset(addr, 0, size); ++ break; ++ ++ default: ++ pr_err("%s: unsupported section type(%x)\n", __func__, ++ type); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++/* Loads an elf section into a PE ++ * For now only supports loading a section to dmem (all PE's), pmem (class and ++ * tmu PE's), ++ * DDDR (util PE code) ++ * ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] data pointer to the elf firmware ++ * @param[in] shdr pointer to the elf section header ++ * ++ */ ++int pe_load_elf_section(int id, const void *data, struct elf32_shdr *shdr, ++ struct device *dev) { ++ u32 addr = be32_to_cpu(shdr->sh_addr); ++ u32 size = be32_to_cpu(shdr->sh_size); ++ ++ if (IS_DMEM(addr, size)) ++ return pe_load_dmem_section(id, data, shdr); ++ else if (IS_PMEM(addr, size)) ++ return pe_load_pmem_section(id, data, shdr); ++ else if (IS_PFE_LMEM(addr, size)) ++ return 0; ++ else if (IS_PHYS_DDR(addr, size)) ++ return pe_load_ddr_section(id, data, shdr, dev); ++ else if (IS_PE_LMEM(addr, size)) ++ return pe_load_pe_lmem_section(id, data, shdr); ++ ++ pr_err("%s: unsupported memory range(%x)\n", __func__, ++ addr); ++ return 0; ++} ++ ++/**************************** BMU ***************************/ ++ ++/* Initializes a BMU block. ++ * @param[in] base BMU block base address ++ * @param[in] cfg BMU configuration ++ */ ++void bmu_init(void *base, struct BMU_CFG *cfg) ++{ ++ bmu_disable(base); ++ ++ bmu_set_config(base, cfg); ++ ++ bmu_reset(base); ++} ++ ++/* Resets a BMU block. ++ * @param[in] base BMU block base address ++ */ ++void bmu_reset(void *base) ++{ ++ writel(CORE_SW_RESET, base + BMU_CTRL); ++ ++ /* Wait for self clear */ ++ while (readl(base + BMU_CTRL) & CORE_SW_RESET) ++ ; ++} ++ ++/* Enabled a BMU block. ++ * @param[in] base BMU block base address ++ */ ++void bmu_enable(void *base) ++{ ++ writel(CORE_ENABLE, base + BMU_CTRL); ++} ++ ++/* Disables a BMU block. ++ * @param[in] base BMU block base address ++ */ ++void bmu_disable(void *base) ++{ ++ writel(CORE_DISABLE, base + BMU_CTRL); ++} ++ ++/* Sets the configuration of a BMU block. ++ * @param[in] base BMU block base address ++ * @param[in] cfg BMU configuration ++ */ ++void bmu_set_config(void *base, struct BMU_CFG *cfg) ++{ ++ writel(cfg->baseaddr, base + BMU_UCAST_BASE_ADDR); ++ writel(cfg->count & 0xffff, base + BMU_UCAST_CONFIG); ++ writel(cfg->size & 0xffff, base + BMU_BUF_SIZE); ++ ++ /* Interrupts are never used */ ++ writel(cfg->low_watermark, base + BMU_LOW_WATERMARK); ++ writel(cfg->high_watermark, base + BMU_HIGH_WATERMARK); ++ writel(0x0, base + BMU_INT_ENABLE); ++} ++ ++/**************************** MTIP GEMAC ***************************/ ++ ++/* Enable Rx Checksum Engine. With this enabled, Frame with bad IP, ++ * TCP or UDP checksums are discarded ++ * ++ * @param[in] base GEMAC base address. ++ */ ++void gemac_enable_rx_checksum_offload(void *base) ++{ ++ /*Do not find configuration to do this */ ++} ++ ++/* Disable Rx Checksum Engine. ++ * ++ * @param[in] base GEMAC base address. ++ */ ++void gemac_disable_rx_checksum_offload(void *base) ++{ ++ /*Do not find configuration to do this */ ++} ++ ++/* GEMAC set speed. ++ * @param[in] base GEMAC base address ++ * @param[in] speed GEMAC speed (10, 100 or 1000 Mbps) ++ */ ++void gemac_set_speed(void *base, enum mac_speed gem_speed) ++{ ++ u32 ecr = readl(base + EMAC_ECNTRL_REG) & ~EMAC_ECNTRL_SPEED; ++ u32 rcr = readl(base + EMAC_RCNTRL_REG) & ~EMAC_RCNTRL_RMII_10T; ++ ++ switch (gem_speed) { ++ case SPEED_10M: ++ rcr |= EMAC_RCNTRL_RMII_10T; ++ break; ++ ++ case SPEED_1000M: ++ ecr |= EMAC_ECNTRL_SPEED; ++ break; ++ ++ case SPEED_100M: ++ default: ++ /*It is in 100M mode */ ++ break; ++ } ++ writel(ecr, (base + EMAC_ECNTRL_REG)); ++ writel(rcr, (base + EMAC_RCNTRL_REG)); ++} ++ ++/* GEMAC set duplex. ++ * @param[in] base GEMAC base address ++ * @param[in] duplex GEMAC duplex mode (Full, Half) ++ */ ++void gemac_set_duplex(void *base, int duplex) ++{ ++ if (duplex == DUPLEX_HALF) { ++ writel(readl(base + EMAC_TCNTRL_REG) & ~EMAC_TCNTRL_FDEN, base ++ + EMAC_TCNTRL_REG); ++ writel(readl(base + EMAC_RCNTRL_REG) | EMAC_RCNTRL_DRT, (base ++ + EMAC_RCNTRL_REG)); ++ } else{ ++ writel(readl(base + EMAC_TCNTRL_REG) | EMAC_TCNTRL_FDEN, base ++ + EMAC_TCNTRL_REG); ++ writel(readl(base + EMAC_RCNTRL_REG) & ~EMAC_RCNTRL_DRT, (base ++ + EMAC_RCNTRL_REG)); ++ } ++} ++ ++/* GEMAC set mode. ++ * @param[in] base GEMAC base address ++ * @param[in] mode GEMAC operation mode (MII, RMII, RGMII, SGMII) ++ */ ++void gemac_set_mode(void *base, int mode) ++{ ++ u32 val = readl(base + EMAC_RCNTRL_REG); ++ ++ /*Remove loopbank*/ ++ val &= ~EMAC_RCNTRL_LOOP; ++ ++ /*Enable flow control and MII mode*/ ++ val |= (EMAC_RCNTRL_FCE | EMAC_RCNTRL_MII_MODE); ++ ++ writel(val, base + EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC enable function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_enable(void *base) ++{ ++ writel(readl(base + EMAC_ECNTRL_REG) | EMAC_ECNTRL_ETHER_EN, base + ++ EMAC_ECNTRL_REG); ++} ++ ++/* GEMAC disable function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_disable(void *base) ++{ ++ writel(readl(base + EMAC_ECNTRL_REG) & ~EMAC_ECNTRL_ETHER_EN, base + ++ EMAC_ECNTRL_REG); ++} ++ ++/* GEMAC TX disable function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_tx_disable(void *base) ++{ ++ writel(readl(base + EMAC_TCNTRL_REG) | EMAC_TCNTRL_GTS, base + ++ EMAC_TCNTRL_REG); ++} ++ ++void gemac_tx_enable(void *base) ++{ ++ writel(readl(base + EMAC_TCNTRL_REG) & ~EMAC_TCNTRL_GTS, base + ++ EMAC_TCNTRL_REG); ++} ++ ++/* Sets the hash register of the MAC. ++ * This register is used for matching unicast and multicast frames. ++ * ++ * @param[in] base GEMAC base address. ++ * @param[in] hash 64-bit hash to be configured. ++ */ ++void gemac_set_hash(void *base, struct pfe_mac_addr *hash) ++{ ++ writel(hash->bottom, base + EMAC_GALR); ++ writel(hash->top, base + EMAC_GAUR); ++} ++ ++void gemac_set_laddrN(void *base, struct pfe_mac_addr *address, ++ unsigned int entry_index) ++{ ++ if ((entry_index < 1) || (entry_index > EMAC_SPEC_ADDR_MAX)) ++ return; ++ ++ entry_index = entry_index - 1; ++ if (entry_index < 1) { ++ writel(htonl(address->bottom), base + EMAC_PHY_ADDR_LOW); ++ writel((htonl(address->top) | 0x8808), base + ++ EMAC_PHY_ADDR_HIGH); ++ } else { ++ writel(htonl(address->bottom), base + ((entry_index - 1) * 8) ++ + EMAC_SMAC_0_0); ++ writel((htonl(address->top) | 0x8808), base + ((entry_index - ++ 1) * 8) + EMAC_SMAC_0_1); ++ } ++} ++ ++void gemac_clear_laddrN(void *base, unsigned int entry_index) ++{ ++ if ((entry_index < 1) || (entry_index > EMAC_SPEC_ADDR_MAX)) ++ return; ++ ++ entry_index = entry_index - 1; ++ if (entry_index < 1) { ++ writel(0, base + EMAC_PHY_ADDR_LOW); ++ writel(0, base + EMAC_PHY_ADDR_HIGH); ++ } else { ++ writel(0, base + ((entry_index - 1) * 8) + EMAC_SMAC_0_0); ++ writel(0, base + ((entry_index - 1) * 8) + EMAC_SMAC_0_1); ++ } ++} ++ ++/* Set the loopback mode of the MAC. This can be either no loopback for ++ * normal operation, local loopback through MAC internal loopback module or PHY ++ * loopback for external loopback through a PHY. This asserts the external ++ * loop pin. ++ * ++ * @param[in] base GEMAC base address. ++ * @param[in] gem_loop Loopback mode to be enabled. LB_LOCAL - MAC ++ * Loopback, ++ * LB_EXT - PHY Loopback. ++ */ ++void gemac_set_loop(void *base, enum mac_loop gem_loop) ++{ ++ pr_info("%s()\n", __func__); ++ writel(readl(base + EMAC_RCNTRL_REG) | EMAC_RCNTRL_LOOP, (base + ++ EMAC_RCNTRL_REG)); ++} ++ ++/* GEMAC allow frames ++ * @param[in] base GEMAC base address ++ */ ++void gemac_enable_copy_all(void *base) ++{ ++ writel(readl(base + EMAC_RCNTRL_REG) | EMAC_RCNTRL_PROM, (base + ++ EMAC_RCNTRL_REG)); ++} ++ ++/* GEMAC do not allow frames ++ * @param[in] base GEMAC base address ++ */ ++void gemac_disable_copy_all(void *base) ++{ ++ writel(readl(base + EMAC_RCNTRL_REG) & ~EMAC_RCNTRL_PROM, (base + ++ EMAC_RCNTRL_REG)); ++} ++ ++/* GEMAC allow broadcast function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_allow_broadcast(void *base) ++{ ++ writel(readl(base + EMAC_RCNTRL_REG) & ~EMAC_RCNTRL_BC_REJ, base + ++ EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC no broadcast function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_no_broadcast(void *base) ++{ ++ writel(readl(base + EMAC_RCNTRL_REG) | EMAC_RCNTRL_BC_REJ, base + ++ EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC enable 1536 rx function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_enable_1536_rx(void *base) ++{ ++ /* Set 1536 as Maximum frame length */ ++ writel(readl(base + EMAC_RCNTRL_REG) | (1536 << 16), base + ++ EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC enable jumbo function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_enable_rx_jmb(void *base) ++{ ++ writel(readl(base + EMAC_RCNTRL_REG) | (JUMBO_FRAME_SIZE << 16), base ++ + EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC enable stacked vlan function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_enable_stacked_vlan(void *base) ++{ ++ /* MTIP doesn't support stacked vlan */ ++} ++ ++/* GEMAC enable pause rx function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_enable_pause_rx(void *base) ++{ ++ writel(readl(base + EMAC_RCNTRL_REG) | EMAC_RCNTRL_FCE, ++ base + EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC disable pause rx function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_disable_pause_rx(void *base) ++{ ++ writel(readl(base + EMAC_RCNTRL_REG) & ~EMAC_RCNTRL_FCE, ++ base + EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC enable pause tx function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_enable_pause_tx(void *base) ++{ ++ writel(EMAC_RX_SECTION_EMPTY_V, base + EMAC_RX_SECTION_EMPTY); ++} ++ ++/* GEMAC disable pause tx function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_disable_pause_tx(void *base) ++{ ++ writel(0x0, base + EMAC_RX_SECTION_EMPTY); ++} ++ ++/* GEMAC wol configuration ++ * @param[in] base GEMAC base address ++ * @param[in] wol_conf WoL register configuration ++ */ ++void gemac_set_wol(void *base, u32 wol_conf) ++{ ++ u32 val = readl(base + EMAC_ECNTRL_REG); ++ ++ if (wol_conf) ++ val |= (EMAC_ECNTRL_MAGIC_ENA | EMAC_ECNTRL_SLEEP); ++ else ++ val &= ~(EMAC_ECNTRL_MAGIC_ENA | EMAC_ECNTRL_SLEEP); ++ writel(val, base + EMAC_ECNTRL_REG); ++} ++ ++/* Sets Gemac bus width to 64bit ++ * @param[in] base GEMAC base address ++ * @param[in] width gemac bus width to be set possible values are 32/64/128 ++ */ ++void gemac_set_bus_width(void *base, int width) ++{ ++} ++ ++/* Sets Gemac configuration. ++ * @param[in] base GEMAC base address ++ * @param[in] cfg GEMAC configuration ++ */ ++void gemac_set_config(void *base, struct gemac_cfg *cfg) ++{ ++ /*GEMAC config taken from VLSI */ ++ writel(0x00000004, base + EMAC_TFWR_STR_FWD); ++ writel(0x00000005, base + EMAC_RX_SECTION_FULL); ++ writel(0x00003fff, base + EMAC_TRUNC_FL); ++ writel(0x00000030, base + EMAC_TX_SECTION_EMPTY); ++ writel(0x00000000, base + EMAC_MIB_CTRL_STS_REG); ++ ++ gemac_set_mode(base, cfg->mode); ++ ++ gemac_set_speed(base, cfg->speed); ++ ++ gemac_set_duplex(base, cfg->duplex); ++} ++ ++/**************************** GPI ***************************/ ++ ++/* Initializes a GPI block. ++ * @param[in] base GPI base address ++ * @param[in] cfg GPI configuration ++ */ ++void gpi_init(void *base, struct gpi_cfg *cfg) ++{ ++ gpi_reset(base); ++ ++ gpi_disable(base); ++ ++ gpi_set_config(base, cfg); ++} ++ ++/* Resets a GPI block. ++ * @param[in] base GPI base address ++ */ ++void gpi_reset(void *base) ++{ ++ writel(CORE_SW_RESET, base + GPI_CTRL); ++} ++ ++/* Enables a GPI block. ++ * @param[in] base GPI base address ++ */ ++void gpi_enable(void *base) ++{ ++ writel(CORE_ENABLE, base + GPI_CTRL); ++} ++ ++/* Disables a GPI block. ++ * @param[in] base GPI base address ++ */ ++void gpi_disable(void *base) ++{ ++ writel(CORE_DISABLE, base + GPI_CTRL); ++} ++ ++/* Sets the configuration of a GPI block. ++ * @param[in] base GPI base address ++ * @param[in] cfg GPI configuration ++ */ ++void gpi_set_config(void *base, struct gpi_cfg *cfg) ++{ ++ writel(CBUS_VIRT_TO_PFE(BMU1_BASE_ADDR + BMU_ALLOC_CTRL), base ++ + GPI_LMEM_ALLOC_ADDR); ++ writel(CBUS_VIRT_TO_PFE(BMU1_BASE_ADDR + BMU_FREE_CTRL), base ++ + GPI_LMEM_FREE_ADDR); ++ writel(CBUS_VIRT_TO_PFE(BMU2_BASE_ADDR + BMU_ALLOC_CTRL), base ++ + GPI_DDR_ALLOC_ADDR); ++ writel(CBUS_VIRT_TO_PFE(BMU2_BASE_ADDR + BMU_FREE_CTRL), base ++ + GPI_DDR_FREE_ADDR); ++ writel(CBUS_VIRT_TO_PFE(CLASS_INQ_PKTPTR), base + GPI_CLASS_ADDR); ++ writel(DDR_HDR_SIZE, base + GPI_DDR_DATA_OFFSET); ++ writel(LMEM_HDR_SIZE, base + GPI_LMEM_DATA_OFFSET); ++ writel(0, base + GPI_LMEM_SEC_BUF_DATA_OFFSET); ++ writel(0, base + GPI_DDR_SEC_BUF_DATA_OFFSET); ++ writel((DDR_HDR_SIZE << 16) | LMEM_HDR_SIZE, base + GPI_HDR_SIZE); ++ writel((DDR_BUF_SIZE << 16) | LMEM_BUF_SIZE, base + GPI_BUF_SIZE); ++ ++ writel(((cfg->lmem_rtry_cnt << 16) | (GPI_DDR_BUF_EN << 1) | ++ GPI_LMEM_BUF_EN), base + GPI_RX_CONFIG); ++ writel(cfg->tmlf_txthres, base + GPI_TMLF_TX); ++ writel(cfg->aseq_len, base + GPI_DTX_ASEQ); ++ writel(1, base + GPI_TOE_CHKSUM_EN); ++ ++ if (cfg->mtip_pause_reg) { ++ writel(cfg->mtip_pause_reg, base + GPI_CSR_MTIP_PAUSE_REG); ++ writel(EGPI_PAUSE_TIME, base + GPI_TX_PAUSE_TIME); ++ } ++} ++ ++/**************************** CLASSIFIER ***************************/ ++ ++/* Initializes CLASSIFIER block. ++ * @param[in] cfg CLASSIFIER configuration ++ */ ++void class_init(struct class_cfg *cfg) ++{ ++ class_reset(); ++ ++ class_disable(); ++ ++ class_set_config(cfg); ++} ++ ++/* Resets CLASSIFIER block. ++ * ++ */ ++void class_reset(void) ++{ ++ writel(CORE_SW_RESET, CLASS_TX_CTRL); ++} ++ ++/* Enables all CLASS-PE's cores. ++ * ++ */ ++void class_enable(void) ++{ ++ writel(CORE_ENABLE, CLASS_TX_CTRL); ++} ++ ++/* Disables all CLASS-PE's cores. ++ * ++ */ ++void class_disable(void) ++{ ++ writel(CORE_DISABLE, CLASS_TX_CTRL); ++} ++ ++/* ++ * Sets the configuration of the CLASSIFIER block. ++ * @param[in] cfg CLASSIFIER configuration ++ */ ++void class_set_config(struct class_cfg *cfg) ++{ ++ u32 val; ++ ++ /* Initialize route table */ ++ if (!cfg->resume) ++ memset(DDR_PHYS_TO_VIRT(cfg->route_table_baseaddr), 0, (1 << ++ cfg->route_table_hash_bits) * CLASS_ROUTE_SIZE); ++ ++#if !defined(LS1012A_PFE_RESET_WA) ++ writel(cfg->pe_sys_clk_ratio, CLASS_PE_SYS_CLK_RATIO); ++#endif ++ ++ writel((DDR_HDR_SIZE << 16) | LMEM_HDR_SIZE, CLASS_HDR_SIZE); ++ writel(LMEM_BUF_SIZE, CLASS_LMEM_BUF_SIZE); ++ writel(CLASS_ROUTE_ENTRY_SIZE(CLASS_ROUTE_SIZE) | ++ CLASS_ROUTE_HASH_SIZE(cfg->route_table_hash_bits), ++ CLASS_ROUTE_HASH_ENTRY_SIZE); ++ writel(HIF_PKT_CLASS_EN | HIF_PKT_OFFSET(sizeof(struct hif_hdr)), ++ CLASS_HIF_PARSE); ++ ++ val = HASH_CRC_PORT_IP | QB2BUS_LE; ++ ++#if defined(CONFIG_IP_ALIGNED) ++ val |= IP_ALIGNED; ++#endif ++ ++ /* ++ * Class PE packet steering will only work if TOE mode, bridge fetch or ++ * route fetch are enabled (see class/qb_fet.v). Route fetch would ++ * trigger additional memory copies (likely from DDR because of hash ++ * table size, which cannot be reduced because PE software still ++ * relies on hash value computed in HW), so when not in TOE mode we ++ * simply enable HW bridge fetch even though we don't use it. ++ */ ++ if (cfg->toe_mode) ++ val |= CLASS_TOE; ++ else ++ val |= HW_BRIDGE_FETCH; ++ ++ writel(val, CLASS_ROUTE_MULTI); ++ ++ writel(DDR_PHYS_TO_PFE(cfg->route_table_baseaddr), ++ CLASS_ROUTE_TABLE_BASE); ++ writel(CLASS_PE0_RO_DM_ADDR0_VAL, CLASS_PE0_RO_DM_ADDR0); ++ writel(CLASS_PE0_RO_DM_ADDR1_VAL, CLASS_PE0_RO_DM_ADDR1); ++ writel(CLASS_PE0_QB_DM_ADDR0_VAL, CLASS_PE0_QB_DM_ADDR0); ++ writel(CLASS_PE0_QB_DM_ADDR1_VAL, CLASS_PE0_QB_DM_ADDR1); ++ writel(CBUS_VIRT_TO_PFE(TMU_PHY_INQ_PKTPTR), CLASS_TM_INQ_ADDR); ++ ++ writel(23, CLASS_AFULL_THRES); ++ writel(23, CLASS_TSQ_FIFO_THRES); ++ ++ writel(24, CLASS_MAX_BUF_CNT); ++ writel(24, CLASS_TSQ_MAX_CNT); ++} ++ ++/**************************** TMU ***************************/ ++ ++void tmu_reset(void) ++{ ++ writel(SW_RESET, TMU_CTRL); ++} ++ ++/* Initializes TMU block. ++ * @param[in] cfg TMU configuration ++ */ ++void tmu_init(struct tmu_cfg *cfg) ++{ ++ int q, phyno; ++ ++ tmu_disable(0xF); ++ mdelay(10); ++ ++#if !defined(LS1012A_PFE_RESET_WA) ++ /* keep in soft reset */ ++ writel(SW_RESET, TMU_CTRL); ++#endif ++ writel(0x3, TMU_SYS_GENERIC_CONTROL); ++ writel(750, TMU_INQ_WATERMARK); ++ writel(CBUS_VIRT_TO_PFE(EGPI1_BASE_ADDR + ++ GPI_INQ_PKTPTR), TMU_PHY0_INQ_ADDR); ++ writel(CBUS_VIRT_TO_PFE(EGPI2_BASE_ADDR + ++ GPI_INQ_PKTPTR), TMU_PHY1_INQ_ADDR); ++ writel(CBUS_VIRT_TO_PFE(HGPI_BASE_ADDR + ++ GPI_INQ_PKTPTR), TMU_PHY3_INQ_ADDR); ++ writel(CBUS_VIRT_TO_PFE(HIF_NOCPY_RX_INQ0_PKTPTR), TMU_PHY4_INQ_ADDR); ++ writel(CBUS_VIRT_TO_PFE(UTIL_INQ_PKTPTR), TMU_PHY5_INQ_ADDR); ++ writel(CBUS_VIRT_TO_PFE(BMU2_BASE_ADDR + BMU_FREE_CTRL), ++ TMU_BMU_INQ_ADDR); ++ ++ writel(0x3FF, TMU_TDQ0_SCH_CTRL); /* ++ * enabling all 10 ++ * schedulers [9:0] of each TDQ ++ */ ++ writel(0x3FF, TMU_TDQ1_SCH_CTRL); ++ writel(0x3FF, TMU_TDQ3_SCH_CTRL); ++ ++#if !defined(LS1012A_PFE_RESET_WA) ++ writel(cfg->pe_sys_clk_ratio, TMU_PE_SYS_CLK_RATIO); ++#endif ++ ++#if !defined(LS1012A_PFE_RESET_WA) ++ writel(DDR_PHYS_TO_PFE(cfg->llm_base_addr), TMU_LLM_BASE_ADDR); ++ /* Extra packet pointers will be stored from this address onwards */ ++ ++ writel(cfg->llm_queue_len, TMU_LLM_QUE_LEN); ++ writel(5, TMU_TDQ_IIFG_CFG); ++ writel(DDR_BUF_SIZE, TMU_BMU_BUF_SIZE); ++ ++ writel(0x0, TMU_CTRL); ++ ++ /* MEM init */ ++ pr_info("%s: mem init\n", __func__); ++ writel(MEM_INIT, TMU_CTRL); ++ ++ while (!(readl(TMU_CTRL) & MEM_INIT_DONE)) ++ ; ++ ++ /* LLM init */ ++ pr_info("%s: lmem init\n", __func__); ++ writel(LLM_INIT, TMU_CTRL); ++ ++ while (!(readl(TMU_CTRL) & LLM_INIT_DONE)) ++ ; ++#endif ++ /* set up each queue for tail drop */ ++ for (phyno = 0; phyno < 4; phyno++) { ++ if (phyno == 2) ++ continue; ++ for (q = 0; q < 16; q++) { ++ u32 qdepth; ++ ++ writel((phyno << 8) | q, TMU_TEQ_CTRL); ++ writel(1 << 22, TMU_TEQ_QCFG); /*Enable tail drop */ ++ ++ if (phyno == 3) ++ qdepth = DEFAULT_TMU3_QDEPTH; ++ else ++ qdepth = (q == 0) ? DEFAULT_Q0_QDEPTH : ++ DEFAULT_MAX_QDEPTH; ++ ++ /* LOG: 68855 */ ++ /* ++ * The following is a workaround for the reordered ++ * packet and BMU2 buffer leakage issue. ++ */ ++ if (CHIP_REVISION() == 0) ++ qdepth = 31; ++ ++ writel(qdepth << 18, TMU_TEQ_HW_PROB_CFG2); ++ writel(qdepth >> 14, TMU_TEQ_HW_PROB_CFG3); ++ } ++ } ++ ++#ifdef CFG_LRO ++ /* Set TMU-3 queue 5 (LRO) in no-drop mode */ ++ writel((3 << 8) | TMU_QUEUE_LRO, TMU_TEQ_CTRL); ++ writel(0, TMU_TEQ_QCFG); ++#endif ++ ++ writel(0x05, TMU_TEQ_DISABLE_DROPCHK); ++ ++ writel(0x0, TMU_CTRL); ++} ++ ++/* Enables TMU-PE cores. ++ * @param[in] pe_mask TMU PE mask ++ */ ++void tmu_enable(u32 pe_mask) ++{ ++ writel(readl(TMU_TX_CTRL) | (pe_mask & 0xF), TMU_TX_CTRL); ++} ++ ++/* Disables TMU cores. ++ * @param[in] pe_mask TMU PE mask ++ */ ++void tmu_disable(u32 pe_mask) ++{ ++ writel(readl(TMU_TX_CTRL) & ~(pe_mask & 0xF), TMU_TX_CTRL); ++} ++ ++/* This will return the tmu queue status ++ * @param[in] if_id gem interface id or TMU index ++ * @return returns the bit mask of busy queues, zero means all ++ * queues are empty ++ */ ++u32 tmu_qstatus(u32 if_id) ++{ ++ return cpu_to_be32(pe_dmem_read(TMU0_ID + if_id, TMU_DM_PESTATUS + ++ offsetof(struct pe_status, tmu_qstatus), 4)); ++} ++ ++u32 tmu_pkts_processed(u32 if_id) ++{ ++ return cpu_to_be32(pe_dmem_read(TMU0_ID + if_id, TMU_DM_PESTATUS + ++ offsetof(struct pe_status, rx), 4)); ++} ++ ++/**************************** UTIL ***************************/ ++ ++/* Resets UTIL block. ++ */ ++void util_reset(void) ++{ ++ writel(CORE_SW_RESET, UTIL_TX_CTRL); ++} ++ ++/* Initializes UTIL block. ++ * @param[in] cfg UTIL configuration ++ */ ++void util_init(struct util_cfg *cfg) ++{ ++ writel(cfg->pe_sys_clk_ratio, UTIL_PE_SYS_CLK_RATIO); ++} ++ ++/* Enables UTIL-PE core. ++ * ++ */ ++void util_enable(void) ++{ ++ writel(CORE_ENABLE, UTIL_TX_CTRL); ++} ++ ++/* Disables UTIL-PE core. ++ * ++ */ ++void util_disable(void) ++{ ++ writel(CORE_DISABLE, UTIL_TX_CTRL); ++} ++ ++/**************************** HIF ***************************/ ++/* Initializes HIF copy block. ++ * ++ */ ++void hif_init(void) ++{ ++ /*Initialize HIF registers*/ ++ writel((HIF_RX_POLL_CTRL_CYCLE << 16) | HIF_TX_POLL_CTRL_CYCLE, ++ HIF_POLL_CTRL); ++} ++ ++/* Enable hif tx DMA and interrupt ++ * ++ */ ++void hif_tx_enable(void) ++{ ++ writel(HIF_CTRL_DMA_EN, HIF_TX_CTRL); ++ writel((readl(HIF_INT_ENABLE) | HIF_INT_EN | HIF_TXPKT_INT_EN), ++ HIF_INT_ENABLE); ++} ++ ++/* Disable hif tx DMA and interrupt ++ * ++ */ ++void hif_tx_disable(void) ++{ ++ u32 hif_int; ++ ++ writel(0, HIF_TX_CTRL); ++ ++ hif_int = readl(HIF_INT_ENABLE); ++ hif_int &= HIF_TXPKT_INT_EN; ++ writel(hif_int, HIF_INT_ENABLE); ++} ++ ++/* Enable hif rx DMA and interrupt ++ * ++ */ ++void hif_rx_enable(void) ++{ ++ hif_rx_dma_start(); ++ writel((readl(HIF_INT_ENABLE) | HIF_INT_EN | HIF_RXPKT_INT_EN), ++ HIF_INT_ENABLE); ++} ++ ++/* Disable hif rx DMA and interrupt ++ * ++ */ ++void hif_rx_disable(void) ++{ ++ u32 hif_int; ++ ++ writel(0, HIF_RX_CTRL); ++ ++ hif_int = readl(HIF_INT_ENABLE); ++ hif_int &= HIF_RXPKT_INT_EN; ++ writel(hif_int, HIF_INT_ENABLE); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hif.c +@@ -0,0 +1,1072 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include "pfe_mod.h" ++ ++#define HIF_INT_MASK (HIF_INT | HIF_RXPKT_INT | HIF_TXPKT_INT) ++ ++unsigned char napi_first_batch; ++ ++static void pfe_tx_do_cleanup(unsigned long data); ++ ++static int pfe_hif_alloc_descr(struct pfe_hif *hif) ++{ ++ void *addr; ++ dma_addr_t dma_addr; ++ int err = 0; ++ ++ pr_info("%s\n", __func__); ++ addr = dma_alloc_coherent(pfe->dev, ++ HIF_RX_DESC_NT * sizeof(struct hif_desc) + ++ HIF_TX_DESC_NT * sizeof(struct hif_desc), ++ &dma_addr, GFP_KERNEL); ++ ++ if (!addr) { ++ pr_err("%s: Could not allocate buffer descriptors!\n" ++ , __func__); ++ err = -ENOMEM; ++ goto err0; ++ } ++ ++ hif->descr_baseaddr_p = dma_addr; ++ hif->descr_baseaddr_v = addr; ++ hif->rx_ring_size = HIF_RX_DESC_NT; ++ hif->tx_ring_size = HIF_TX_DESC_NT; ++ ++ return 0; ++ ++err0: ++ return err; ++} ++ ++#if defined(LS1012A_PFE_RESET_WA) ++static void pfe_hif_disable_rx_desc(struct pfe_hif *hif) ++{ ++ int ii; ++ struct hif_desc *desc = hif->rx_base; ++ ++ /*Mark all descriptors as LAST_BD */ ++ for (ii = 0; ii < hif->rx_ring_size; ii++) { ++ desc->ctrl |= BD_CTRL_LAST_BD; ++ desc++; ++ } ++} ++ ++struct class_rx_hdr_t { ++ u32 next_ptr; /* ptr to the start of the first DDR buffer */ ++ u16 length; /* total packet length */ ++ u16 phyno; /* input physical port number */ ++ u32 status; /* gemac status bits */ ++ u32 status2; /* reserved for software usage */ ++}; ++ ++/* STATUS_BAD_FRAME_ERR is set for all errors (including checksums if enabled) ++ * except overflow ++ */ ++#define STATUS_BAD_FRAME_ERR BIT(16) ++#define STATUS_LENGTH_ERR BIT(17) ++#define STATUS_CRC_ERR BIT(18) ++#define STATUS_TOO_SHORT_ERR BIT(19) ++#define STATUS_TOO_LONG_ERR BIT(20) ++#define STATUS_CODE_ERR BIT(21) ++#define STATUS_MC_HASH_MATCH BIT(22) ++#define STATUS_CUMULATIVE_ARC_HIT BIT(23) ++#define STATUS_UNICAST_HASH_MATCH BIT(24) ++#define STATUS_IP_CHECKSUM_CORRECT BIT(25) ++#define STATUS_TCP_CHECKSUM_CORRECT BIT(26) ++#define STATUS_UDP_CHECKSUM_CORRECT BIT(27) ++#define STATUS_OVERFLOW_ERR BIT(28) /* GPI error */ ++#define MIN_PKT_SIZE 64 ++ ++static inline void copy_to_lmem(u32 *dst, u32 *src, int len) ++{ ++ int i; ++ ++ for (i = 0; i < len; i += sizeof(u32)) { ++ *dst = htonl(*src); ++ dst++; src++; ++ } ++} ++ ++static void send_dummy_pkt_to_hif(void) ++{ ++ void *lmem_ptr, *ddr_ptr, *lmem_virt_addr; ++ u32 physaddr; ++ struct class_rx_hdr_t local_hdr; ++ static u32 dummy_pkt[] = { ++ 0x33221100, 0x2b785544, 0xd73093cb, 0x01000608, ++ 0x04060008, 0x2b780200, 0xd73093cb, 0x0a01a8c0, ++ 0x33221100, 0xa8c05544, 0x00000301, 0x00000000, ++ 0x00000000, 0x00000000, 0x00000000, 0xbe86c51f }; ++ ++ ddr_ptr = (void *)((u64)readl(BMU2_BASE_ADDR + BMU_ALLOC_CTRL)); ++ if (!ddr_ptr) ++ return; ++ ++ lmem_ptr = (void *)((u64)readl(BMU1_BASE_ADDR + BMU_ALLOC_CTRL)); ++ if (!lmem_ptr) ++ return; ++ ++ pr_info("Sending a dummy pkt to HIF %p %p\n", ddr_ptr, lmem_ptr); ++ physaddr = (u32)DDR_VIRT_TO_PFE(ddr_ptr); ++ ++ lmem_virt_addr = (void *)CBUS_PFE_TO_VIRT((unsigned long int)lmem_ptr); ++ ++ local_hdr.phyno = htons(0); /* RX_PHY_0 */ ++ local_hdr.length = htons(MIN_PKT_SIZE); ++ ++ local_hdr.next_ptr = htonl((u32)physaddr); ++ /*Mark checksum is correct */ ++ local_hdr.status = htonl((STATUS_IP_CHECKSUM_CORRECT | ++ STATUS_UDP_CHECKSUM_CORRECT | ++ STATUS_TCP_CHECKSUM_CORRECT | ++ STATUS_UNICAST_HASH_MATCH | ++ STATUS_CUMULATIVE_ARC_HIT)); ++ copy_to_lmem((u32 *)lmem_virt_addr, (u32 *)&local_hdr, ++ sizeof(local_hdr)); ++ ++ copy_to_lmem((u32 *)(lmem_virt_addr + LMEM_HDR_SIZE), (u32 *)dummy_pkt, ++ 0x40); ++ ++ writel((unsigned long int)lmem_ptr, CLASS_INQ_PKTPTR); ++} ++ ++void pfe_hif_rx_idle(struct pfe_hif *hif) ++{ ++ int hif_stop_loop = 10; ++ u32 rx_status; ++ ++ pfe_hif_disable_rx_desc(hif); ++ pr_info("Bringing hif to idle state..."); ++ writel(0, HIF_INT_ENABLE); ++ /*If HIF Rx BDP is busy send a dummy packet */ ++ do { ++ rx_status = readl(HIF_RX_STATUS); ++ if (rx_status & BDP_CSR_RX_DMA_ACTV) ++ send_dummy_pkt_to_hif(); ++ ++ usleep_range(100, 150); ++ } while (--hif_stop_loop); ++ ++ if (readl(HIF_RX_STATUS) & BDP_CSR_RX_DMA_ACTV) ++ pr_info("Failed\n"); ++ else ++ pr_info("Done\n"); ++} ++#endif ++ ++static void pfe_hif_free_descr(struct pfe_hif *hif) ++{ ++ pr_info("%s\n", __func__); ++ ++ dma_free_coherent(pfe->dev, ++ hif->rx_ring_size * sizeof(struct hif_desc) + ++ hif->tx_ring_size * sizeof(struct hif_desc), ++ hif->descr_baseaddr_v, hif->descr_baseaddr_p); ++} ++ ++void pfe_hif_desc_dump(struct pfe_hif *hif) ++{ ++ struct hif_desc *desc; ++ unsigned long desc_p; ++ int ii = 0; ++ ++ pr_info("%s\n", __func__); ++ ++ desc = hif->rx_base; ++ desc_p = (u32)((u64)desc - (u64)hif->descr_baseaddr_v + ++ hif->descr_baseaddr_p); ++ ++ pr_info("HIF Rx desc base %p physical %x\n", desc, (u32)desc_p); ++ for (ii = 0; ii < hif->rx_ring_size; ii++) { ++ pr_info("status: %08x, ctrl: %08x, data: %08x, next: %x\n", ++ readl(&desc->status), readl(&desc->ctrl), ++ readl(&desc->data), readl(&desc->next)); ++ desc++; ++ } ++ ++ desc = hif->tx_base; ++ desc_p = ((u64)desc - (u64)hif->descr_baseaddr_v + ++ hif->descr_baseaddr_p); ++ ++ pr_info("HIF Tx desc base %p physical %x\n", desc, (u32)desc_p); ++ for (ii = 0; ii < hif->tx_ring_size; ii++) { ++ pr_info("status: %08x, ctrl: %08x, data: %08x, next: %x\n", ++ readl(&desc->status), readl(&desc->ctrl), ++ readl(&desc->data), readl(&desc->next)); ++ desc++; ++ } ++} ++ ++/* pfe_hif_release_buffers */ ++static void pfe_hif_release_buffers(struct pfe_hif *hif) ++{ ++ struct hif_desc *desc; ++ int i = 0; ++ ++ hif->rx_base = hif->descr_baseaddr_v; ++ ++ pr_info("%s\n", __func__); ++ ++ /*Free Rx buffers */ ++ desc = hif->rx_base; ++ for (i = 0; i < hif->rx_ring_size; i++) { ++ if (readl(&desc->data)) { ++ if ((i < hif->shm->rx_buf_pool_cnt) && ++ (!hif->shm->rx_buf_pool[i])) { ++ /* ++ * dma_unmap_single(hif->dev, desc->data, ++ * hif->rx_buf_len[i], DMA_FROM_DEVICE); ++ */ ++ dma_unmap_single(hif->dev, ++ DDR_PFE_TO_PHYS( ++ readl(&desc->data)), ++ hif->rx_buf_len[i], ++ DMA_FROM_DEVICE); ++ hif->shm->rx_buf_pool[i] = hif->rx_buf_addr[i]; ++ } else { ++ pr_err("%s: buffer pool already full\n" ++ , __func__); ++ } ++ } ++ ++ writel(0, &desc->data); ++ writel(0, &desc->status); ++ writel(0, &desc->ctrl); ++ desc++; ++ } ++} ++ ++/* ++ * pfe_hif_init_buffers ++ * This function initializes the HIF Rx/Tx ring descriptors and ++ * initialize Rx queue with buffers. ++ */ ++static int pfe_hif_init_buffers(struct pfe_hif *hif) ++{ ++ struct hif_desc *desc, *first_desc_p; ++ u32 data; ++ int i = 0; ++ ++ pr_info("%s\n", __func__); ++ ++ /* Check enough Rx buffers available in the shared memory */ ++ if (hif->shm->rx_buf_pool_cnt < hif->rx_ring_size) ++ return -ENOMEM; ++ ++ hif->rx_base = hif->descr_baseaddr_v; ++ memset(hif->rx_base, 0, hif->rx_ring_size * sizeof(struct hif_desc)); ++ ++ /*Initialize Rx descriptors */ ++ desc = hif->rx_base; ++ first_desc_p = (struct hif_desc *)hif->descr_baseaddr_p; ++ ++ for (i = 0; i < hif->rx_ring_size; i++) { ++ /* Initialize Rx buffers from the shared memory */ ++ ++ data = (u32)dma_map_single(hif->dev, hif->shm->rx_buf_pool[i], ++ pfe_pkt_size, DMA_FROM_DEVICE); ++ hif->rx_buf_addr[i] = hif->shm->rx_buf_pool[i]; ++ hif->rx_buf_len[i] = pfe_pkt_size; ++ hif->shm->rx_buf_pool[i] = NULL; ++ ++ if (likely(dma_mapping_error(hif->dev, data) == 0)) { ++ writel(DDR_PHYS_TO_PFE(data), &desc->data); ++ } else { ++ pr_err("%s : low on mem\n", __func__); ++ ++ goto err; ++ } ++ ++ writel(0, &desc->status); ++ ++ /* ++ * Ensure everything else is written to DDR before ++ * writing bd->ctrl ++ */ ++ wmb(); ++ ++ writel((BD_CTRL_PKT_INT_EN | BD_CTRL_LIFM ++ | BD_CTRL_DIR | BD_CTRL_DESC_EN ++ | BD_BUF_LEN(pfe_pkt_size)), &desc->ctrl); ++ ++ /* Chain descriptors */ ++ writel((u32)DDR_PHYS_TO_PFE(first_desc_p + i + 1), &desc->next); ++ desc++; ++ } ++ ++ /* Overwrite last descriptor to chain it to first one*/ ++ desc--; ++ writel((u32)DDR_PHYS_TO_PFE(first_desc_p), &desc->next); ++ ++ hif->rxtoclean_index = 0; ++ ++ /*Initialize Rx buffer descriptor ring base address */ ++ writel(DDR_PHYS_TO_PFE(hif->descr_baseaddr_p), HIF_RX_BDP_ADDR); ++ ++ hif->tx_base = hif->rx_base + hif->rx_ring_size; ++ first_desc_p = (struct hif_desc *)hif->descr_baseaddr_p + ++ hif->rx_ring_size; ++ memset(hif->tx_base, 0, hif->tx_ring_size * sizeof(struct hif_desc)); ++ ++ /*Initialize tx descriptors */ ++ desc = hif->tx_base; ++ ++ for (i = 0; i < hif->tx_ring_size; i++) { ++ /* Chain descriptors */ ++ writel((u32)DDR_PHYS_TO_PFE(first_desc_p + i + 1), &desc->next); ++ writel(0, &desc->ctrl); ++ desc++; ++ } ++ ++ /* Overwrite last descriptor to chain it to first one */ ++ desc--; ++ writel((u32)DDR_PHYS_TO_PFE(first_desc_p), &desc->next); ++ hif->txavail = hif->tx_ring_size; ++ hif->txtosend = 0; ++ hif->txtoclean = 0; ++ hif->txtoflush = 0; ++ ++ /*Initialize Tx buffer descriptor ring base address */ ++ writel((u32)DDR_PHYS_TO_PFE(first_desc_p), HIF_TX_BDP_ADDR); ++ ++ return 0; ++ ++err: ++ pfe_hif_release_buffers(hif); ++ return -ENOMEM; ++} ++ ++/* ++ * pfe_hif_client_register ++ * ++ * This function used to register a client driver with the HIF driver. ++ * ++ * Return value: ++ * 0 - on Successful registration ++ */ ++static int pfe_hif_client_register(struct pfe_hif *hif, u32 client_id, ++ struct hif_client_shm *client_shm) ++{ ++ struct hif_client *client = &hif->client[client_id]; ++ u32 i, cnt; ++ struct rx_queue_desc *rx_qbase; ++ struct tx_queue_desc *tx_qbase; ++ struct hif_rx_queue *rx_queue; ++ struct hif_tx_queue *tx_queue; ++ int err = 0; ++ ++ pr_info("%s\n", __func__); ++ ++ spin_lock_bh(&hif->tx_lock); ++ ++ if (test_bit(client_id, &hif->shm->g_client_status[0])) { ++ pr_err("%s: client %d already registered\n", ++ __func__, client_id); ++ err = -1; ++ goto unlock; ++ } ++ ++ memset(client, 0, sizeof(struct hif_client)); ++ ++ /* Initialize client Rx queues baseaddr, size */ ++ ++ cnt = CLIENT_CTRL_RX_Q_CNT(client_shm->ctrl); ++ /* Check if client is requesting for more queues than supported */ ++ if (cnt > HIF_CLIENT_QUEUES_MAX) ++ cnt = HIF_CLIENT_QUEUES_MAX; ++ ++ client->rx_qn = cnt; ++ rx_qbase = (struct rx_queue_desc *)client_shm->rx_qbase; ++ for (i = 0; i < cnt; i++) { ++ rx_queue = &client->rx_q[i]; ++ rx_queue->base = rx_qbase + i * client_shm->rx_qsize; ++ rx_queue->size = client_shm->rx_qsize; ++ rx_queue->write_idx = 0; ++ } ++ ++ /* Initialize client Tx queues baseaddr, size */ ++ cnt = CLIENT_CTRL_TX_Q_CNT(client_shm->ctrl); ++ ++ /* Check if client is requesting for more queues than supported */ ++ if (cnt > HIF_CLIENT_QUEUES_MAX) ++ cnt = HIF_CLIENT_QUEUES_MAX; ++ ++ client->tx_qn = cnt; ++ tx_qbase = (struct tx_queue_desc *)client_shm->tx_qbase; ++ for (i = 0; i < cnt; i++) { ++ tx_queue = &client->tx_q[i]; ++ tx_queue->base = tx_qbase + i * client_shm->tx_qsize; ++ tx_queue->size = client_shm->tx_qsize; ++ tx_queue->ack_idx = 0; ++ } ++ ++ set_bit(client_id, &hif->shm->g_client_status[0]); ++ ++unlock: ++ spin_unlock_bh(&hif->tx_lock); ++ ++ return err; ++} ++ ++/* ++ * pfe_hif_client_unregister ++ * ++ * This function used to unregister a client from the HIF driver. ++ * ++ */ ++static void pfe_hif_client_unregister(struct pfe_hif *hif, u32 client_id) ++{ ++ pr_info("%s\n", __func__); ++ ++ /* ++ * Mark client as no longer available (which prevents further packet ++ * receive for this client) ++ */ ++ spin_lock_bh(&hif->tx_lock); ++ ++ if (!test_bit(client_id, &hif->shm->g_client_status[0])) { ++ pr_err("%s: client %d not registered\n", __func__, ++ client_id); ++ ++ spin_unlock_bh(&hif->tx_lock); ++ return; ++ } ++ ++ clear_bit(client_id, &hif->shm->g_client_status[0]); ++ ++ spin_unlock_bh(&hif->tx_lock); ++} ++ ++/* ++ * client_put_rxpacket- ++ * This functions puts the Rx pkt in the given client Rx queue. ++ * It actually swap the Rx pkt in the client Rx descriptor buffer ++ * and returns the free buffer from it. ++ * ++ * If the function returns NULL means client Rx queue is full and ++ * packet couldn't send to client queue. ++ */ ++static void *client_put_rxpacket(struct hif_rx_queue *queue, void *pkt, u32 len, ++ u32 flags, u32 client_ctrl, u32 *rem_len) ++{ ++ void *free_pkt = NULL; ++ struct rx_queue_desc *desc = queue->base + queue->write_idx; ++ ++ if (readl(&desc->ctrl) & CL_DESC_OWN) { ++ if (page_mode) { ++ int rem_page_size = PAGE_SIZE - ++ PRESENT_OFST_IN_PAGE(pkt); ++ int cur_pkt_size = ROUND_MIN_RX_SIZE(len + ++ pfe_pkt_headroom); ++ *rem_len = (rem_page_size - cur_pkt_size); ++ if (*rem_len) { ++ free_pkt = pkt + cur_pkt_size; ++ get_page(virt_to_page(free_pkt)); ++ } else { ++ free_pkt = (void ++ *)__get_free_page(GFP_ATOMIC | GFP_DMA_PFE); ++ *rem_len = pfe_pkt_size; ++ } ++ } else { ++ free_pkt = kmalloc(PFE_BUF_SIZE, GFP_ATOMIC | ++ GFP_DMA_PFE); ++ *rem_len = PFE_BUF_SIZE - pfe_pkt_headroom; ++ } ++ ++ if (free_pkt) { ++ desc->data = pkt; ++ desc->client_ctrl = client_ctrl; ++ /* ++ * Ensure everything else is written to DDR before ++ * writing bd->ctrl ++ */ ++ smp_wmb(); ++ writel(CL_DESC_BUF_LEN(len) | flags, &desc->ctrl); ++ queue->write_idx = (queue->write_idx + 1) ++ & (queue->size - 1); ++ ++ free_pkt += pfe_pkt_headroom; ++ } ++ } ++ ++ return free_pkt; ++} ++ ++/* ++ * pfe_hif_rx_process- ++ * This function does pfe hif rx queue processing. ++ * Dequeue packet from Rx queue and send it to corresponding client queue ++ */ ++static int pfe_hif_rx_process(struct pfe_hif *hif, int budget) ++{ ++ struct hif_desc *desc; ++ struct hif_hdr *pkt_hdr; ++ struct __hif_hdr hif_hdr; ++ void *free_buf; ++ int rtc, len, rx_processed = 0; ++ struct __hif_desc local_desc; ++ int flags; ++ unsigned int desc_p; ++ unsigned int buf_size = 0; ++ ++ spin_lock_bh(&hif->lock); ++ ++ rtc = hif->rxtoclean_index; ++ ++ while (rx_processed < budget) { ++ desc = hif->rx_base + rtc; ++ ++ __memcpy12(&local_desc, desc); ++ ++ /* ACK pending Rx interrupt */ ++ if (local_desc.ctrl & BD_CTRL_DESC_EN) { ++ writel(HIF_INT | HIF_RXPKT_INT, HIF_INT_SRC); ++ ++ if (rx_processed == 0) { ++ if (napi_first_batch == 1) { ++ desc_p = hif->descr_baseaddr_p + ++ ((unsigned long int)(desc) - ++ (unsigned long ++ int)hif->descr_baseaddr_v); ++ napi_first_batch = 0; ++ } ++ } ++ ++ __memcpy12(&local_desc, desc); ++ ++ if (local_desc.ctrl & BD_CTRL_DESC_EN) ++ break; ++ } ++ ++ napi_first_batch = 0; ++ ++#ifdef HIF_NAPI_STATS ++ hif->napi_counters[NAPI_DESC_COUNT]++; ++#endif ++ len = BD_BUF_LEN(local_desc.ctrl); ++ /* ++ * dma_unmap_single(hif->dev, DDR_PFE_TO_PHYS(local_desc.data), ++ * hif->rx_buf_len[rtc], DMA_FROM_DEVICE); ++ */ ++ dma_unmap_single(hif->dev, DDR_PFE_TO_PHYS(local_desc.data), ++ hif->rx_buf_len[rtc], DMA_FROM_DEVICE); ++ ++ pkt_hdr = (struct hif_hdr *)hif->rx_buf_addr[rtc]; ++ ++ /* Track last HIF header received */ ++ if (!hif->started) { ++ hif->started = 1; ++ ++ __memcpy8(&hif_hdr, pkt_hdr); ++ ++ hif->qno = hif_hdr.hdr.q_num; ++ hif->client_id = hif_hdr.hdr.client_id; ++ hif->client_ctrl = (hif_hdr.hdr.client_ctrl1 << 16) | ++ hif_hdr.hdr.client_ctrl; ++ flags = CL_DESC_FIRST; ++ ++ } else { ++ flags = 0; ++ } ++ ++ if (local_desc.ctrl & BD_CTRL_LIFM) ++ flags |= CL_DESC_LAST; ++ ++ /* Check for valid client id and still registered */ ++ if ((hif->client_id >= HIF_CLIENTS_MAX) || ++ !(test_bit(hif->client_id, ++ &hif->shm->g_client_status[0]))) { ++ printk_ratelimited("%s: packet with invalid client id %d q_num %d\n", ++ __func__, ++ hif->client_id, ++ hif->qno); ++ ++ free_buf = pkt_hdr; ++ ++ goto pkt_drop; ++ } ++ ++ /* Check to valid queue number */ ++ if (hif->client[hif->client_id].rx_qn <= hif->qno) { ++ pr_info("%s: packet with invalid queue: %d\n" ++ , __func__, hif->qno); ++ hif->qno = 0; ++ } ++ ++ free_buf = ++ client_put_rxpacket(&hif->client[hif->client_id].rx_q[hif->qno], ++ (void *)pkt_hdr, len, flags, ++ hif->client_ctrl, &buf_size); ++ ++ hif_lib_indicate_client(hif->client_id, EVENT_RX_PKT_IND, ++ hif->qno); ++ ++ if (unlikely(!free_buf)) { ++#ifdef HIF_NAPI_STATS ++ hif->napi_counters[NAPI_CLIENT_FULL_COUNT]++; ++#endif ++ /* ++ * If we want to keep in polling mode to retry later, ++ * we need to tell napi that we consumed ++ * the full budget or we will hit a livelock scenario. ++ * The core code keeps this napi instance ++ * at the head of the list and none of the other ++ * instances get to run ++ */ ++ rx_processed = budget; ++ ++ if (flags & CL_DESC_FIRST) ++ hif->started = 0; ++ ++ break; ++ } ++ ++pkt_drop: ++ /*Fill free buffer in the descriptor */ ++ hif->rx_buf_addr[rtc] = free_buf; ++ hif->rx_buf_len[rtc] = min(pfe_pkt_size, buf_size); ++ writel((DDR_PHYS_TO_PFE ++ ((u32)dma_map_single(hif->dev, ++ free_buf, hif->rx_buf_len[rtc], DMA_FROM_DEVICE))), ++ &desc->data); ++ /* ++ * Ensure everything else is written to DDR before ++ * writing bd->ctrl ++ */ ++ wmb(); ++ writel((BD_CTRL_PKT_INT_EN | BD_CTRL_LIFM | BD_CTRL_DIR | ++ BD_CTRL_DESC_EN | BD_BUF_LEN(hif->rx_buf_len[rtc])), ++ &desc->ctrl); ++ ++ rtc = (rtc + 1) & (hif->rx_ring_size - 1); ++ ++ if (local_desc.ctrl & BD_CTRL_LIFM) { ++ if (!(hif->client_ctrl & HIF_CTRL_RX_CONTINUED)) { ++ rx_processed++; ++ ++#ifdef HIF_NAPI_STATS ++ hif->napi_counters[NAPI_PACKET_COUNT]++; ++#endif ++ } ++ hif->started = 0; ++ } ++ } ++ ++ hif->rxtoclean_index = rtc; ++ spin_unlock_bh(&hif->lock); ++ ++ /* we made some progress, re-start rx dma in case it stopped */ ++ hif_rx_dma_start(); ++ ++ return rx_processed; ++} ++ ++/* ++ * client_ack_txpacket- ++ * This function ack the Tx packet in the give client Tx queue by resetting ++ * ownership bit in the descriptor. ++ */ ++static int client_ack_txpacket(struct pfe_hif *hif, unsigned int client_id, ++ unsigned int q_no) ++{ ++ struct hif_tx_queue *queue = &hif->client[client_id].tx_q[q_no]; ++ struct tx_queue_desc *desc = queue->base + queue->ack_idx; ++ ++ if (readl(&desc->ctrl) & CL_DESC_OWN) { ++ writel((readl(&desc->ctrl) & ~CL_DESC_OWN), &desc->ctrl); ++ queue->ack_idx = (queue->ack_idx + 1) & (queue->size - 1); ++ ++ return 0; ++ ++ } else { ++ /*This should not happen */ ++ pr_err("%s: %d %d %d %d %d %p %d\n", __func__, ++ hif->txtosend, hif->txtoclean, hif->txavail, ++ client_id, q_no, queue, queue->ack_idx); ++ WARN(1, "%s: doesn't own this descriptor", __func__); ++ return 1; ++ } ++} ++ ++void __hif_tx_done_process(struct pfe_hif *hif, int count) ++{ ++ struct hif_desc *desc; ++ struct hif_desc_sw *desc_sw; ++ int ttc, tx_avl; ++ int pkts_done[HIF_CLIENTS_MAX] = {0, 0}; ++ ++ ttc = hif->txtoclean; ++ tx_avl = hif->txavail; ++ ++ while ((tx_avl < hif->tx_ring_size) && count--) { ++ desc = hif->tx_base + ttc; ++ ++ if (readl(&desc->ctrl) & BD_CTRL_DESC_EN) ++ break; ++ ++ desc_sw = &hif->tx_sw_queue[ttc]; ++ ++ if (desc_sw->data) { ++ /* ++ * dmap_unmap_single(hif->dev, desc_sw->data, ++ * desc_sw->len, DMA_TO_DEVICE); ++ */ ++ dma_unmap_single(hif->dev, desc_sw->data, ++ desc_sw->len, DMA_TO_DEVICE); ++ } ++ ++ if (desc_sw->client_id > HIF_CLIENTS_MAX) ++ pr_err("Invalid cl id %d\n", desc_sw->client_id); ++ ++ pkts_done[desc_sw->client_id]++; ++ ++ client_ack_txpacket(hif, desc_sw->client_id, desc_sw->q_no); ++ ++ ttc = (ttc + 1) & (hif->tx_ring_size - 1); ++ tx_avl++; ++ } ++ ++ if (pkts_done[0]) ++ hif_lib_indicate_client(0, EVENT_TXDONE_IND, 0); ++ if (pkts_done[1]) ++ hif_lib_indicate_client(1, EVENT_TXDONE_IND, 0); ++ ++ hif->txtoclean = ttc; ++ hif->txavail = tx_avl; ++ ++ if (!count) { ++ tasklet_schedule(&hif->tx_cleanup_tasklet); ++ } else { ++ /*Enable Tx done interrupt */ ++ writel(readl_relaxed(HIF_INT_ENABLE) | HIF_TXPKT_INT, ++ HIF_INT_ENABLE); ++ } ++} ++ ++static void pfe_tx_do_cleanup(unsigned long data) ++{ ++ struct pfe_hif *hif = (struct pfe_hif *)data; ++ ++ writel(HIF_INT | HIF_TXPKT_INT, HIF_INT_SRC); ++ ++ hif_tx_done_process(hif, 64); ++} ++ ++/* ++ * __hif_xmit_pkt - ++ * This function puts one packet in the HIF Tx queue ++ */ ++void __hif_xmit_pkt(struct pfe_hif *hif, unsigned int client_id, unsigned int ++ q_no, void *data, u32 len, unsigned int flags) ++{ ++ struct hif_desc *desc; ++ struct hif_desc_sw *desc_sw; ++ ++ desc = hif->tx_base + hif->txtosend; ++ desc_sw = &hif->tx_sw_queue[hif->txtosend]; ++ ++ desc_sw->len = len; ++ desc_sw->client_id = client_id; ++ desc_sw->q_no = q_no; ++ desc_sw->flags = flags; ++ ++ if (flags & HIF_DONT_DMA_MAP) { ++ desc_sw->data = 0; ++ writel((u32)DDR_PHYS_TO_PFE(data), &desc->data); ++ } else { ++ desc_sw->data = dma_map_single(hif->dev, data, len, ++ DMA_TO_DEVICE); ++ writel((u32)DDR_PHYS_TO_PFE(desc_sw->data), &desc->data); ++ } ++ ++ hif->txtosend = (hif->txtosend + 1) & (hif->tx_ring_size - 1); ++ hif->txavail--; ++ ++ if ((!((flags & HIF_DATA_VALID) && (flags & ++ HIF_LAST_BUFFER)))) ++ goto skip_tx; ++ ++ /* ++ * Ensure everything else is written to DDR before ++ * writing bd->ctrl ++ */ ++ wmb(); ++ ++ do { ++ desc_sw = &hif->tx_sw_queue[hif->txtoflush]; ++ desc = hif->tx_base + hif->txtoflush; ++ ++ if (desc_sw->flags & HIF_LAST_BUFFER) { ++ writel((BD_CTRL_LIFM | ++ BD_CTRL_BRFETCH_DISABLE | BD_CTRL_RTFETCH_DISABLE ++ | BD_CTRL_PARSE_DISABLE | BD_CTRL_DESC_EN | ++ BD_CTRL_PKT_INT_EN | BD_BUF_LEN(desc_sw->len)), ++ &desc->ctrl); ++ } else { ++ writel((BD_CTRL_DESC_EN | ++ BD_BUF_LEN(desc_sw->len)), &desc->ctrl); ++ } ++ hif->txtoflush = (hif->txtoflush + 1) & (hif->tx_ring_size - 1); ++ } ++ while (hif->txtoflush != hif->txtosend) ++ ; ++ ++skip_tx: ++ return; ++} ++ ++static irqreturn_t wol_isr(int irq, void *dev_id) ++{ ++ pr_info("WoL\n"); ++ gemac_set_wol(EMAC1_BASE_ADDR, 0); ++ gemac_set_wol(EMAC2_BASE_ADDR, 0); ++ return IRQ_HANDLED; ++} ++ ++/* ++ * hif_isr- ++ * This ISR routine processes Rx/Tx done interrupts from the HIF hardware block ++ */ ++static irqreturn_t hif_isr(int irq, void *dev_id) ++{ ++ struct pfe_hif *hif = (struct pfe_hif *)dev_id; ++ int int_status; ++ int int_enable_mask; ++ ++ /*Read hif interrupt source register */ ++ int_status = readl_relaxed(HIF_INT_SRC); ++ int_enable_mask = readl_relaxed(HIF_INT_ENABLE); ++ ++ if ((int_status & HIF_INT) == 0) ++ return IRQ_NONE; ++ ++ int_status &= ~(HIF_INT); ++ ++ if (int_status & HIF_RXPKT_INT) { ++ int_status &= ~(HIF_RXPKT_INT); ++ int_enable_mask &= ~(HIF_RXPKT_INT); ++ ++ napi_first_batch = 1; ++ ++ if (napi_schedule_prep(&hif->napi)) { ++#ifdef HIF_NAPI_STATS ++ hif->napi_counters[NAPI_SCHED_COUNT]++; ++#endif ++ __napi_schedule(&hif->napi); ++ } ++ } ++ ++ if (int_status & HIF_TXPKT_INT) { ++ int_status &= ~(HIF_TXPKT_INT); ++ int_enable_mask &= ~(HIF_TXPKT_INT); ++ /*Schedule tx cleanup tassklet */ ++ tasklet_schedule(&hif->tx_cleanup_tasklet); ++ } ++ ++ /*Disable interrupts, they will be enabled after they are serviced */ ++ writel_relaxed(int_enable_mask, HIF_INT_ENABLE); ++ ++ if (int_status) { ++ pr_info("%s : Invalid interrupt : %d\n", __func__, ++ int_status); ++ writel(int_status, HIF_INT_SRC); ++ } ++ ++ return IRQ_HANDLED; ++} ++ ++void hif_process_client_req(struct pfe_hif *hif, int req, int data1, int data2) ++{ ++ unsigned int client_id = data1; ++ ++ if (client_id >= HIF_CLIENTS_MAX) { ++ pr_err("%s: client id %d out of bounds\n", __func__, ++ client_id); ++ return; ++ } ++ ++ switch (req) { ++ case REQUEST_CL_REGISTER: ++ /* Request for register a client */ ++ pr_info("%s: register client_id %d\n", ++ __func__, client_id); ++ pfe_hif_client_register(hif, client_id, (struct ++ hif_client_shm *)&hif->shm->client[client_id]); ++ break; ++ ++ case REQUEST_CL_UNREGISTER: ++ pr_info("%s: unregister client_id %d\n", ++ __func__, client_id); ++ ++ /* Request for unregister a client */ ++ pfe_hif_client_unregister(hif, client_id); ++ ++ break; ++ ++ default: ++ pr_err("%s: unsupported request %d\n", ++ __func__, req); ++ break; ++ } ++ ++ /* ++ * Process client Tx queues ++ * Currently we don't have checking for tx pending ++ */ ++} ++ ++/* ++ * pfe_hif_rx_poll ++ * This function is NAPI poll function to process HIF Rx queue. ++ */ ++static int pfe_hif_rx_poll(struct napi_struct *napi, int budget) ++{ ++ struct pfe_hif *hif = container_of(napi, struct pfe_hif, napi); ++ int work_done; ++ ++#ifdef HIF_NAPI_STATS ++ hif->napi_counters[NAPI_POLL_COUNT]++; ++#endif ++ ++ work_done = pfe_hif_rx_process(hif, budget); ++ ++ if (work_done < budget) { ++ napi_complete(napi); ++ writel(readl_relaxed(HIF_INT_ENABLE) | HIF_RXPKT_INT, ++ HIF_INT_ENABLE); ++ } ++#ifdef HIF_NAPI_STATS ++ else ++ hif->napi_counters[NAPI_FULL_BUDGET_COUNT]++; ++#endif ++ ++ return work_done; ++} ++ ++/* ++ * pfe_hif_init ++ * This function initializes the baseaddresses and irq, etc. ++ */ ++int pfe_hif_init(struct pfe *pfe) ++{ ++ struct pfe_hif *hif = &pfe->hif; ++ int err; ++ ++ pr_info("%s\n", __func__); ++ ++ hif->dev = pfe->dev; ++ hif->irq = pfe->hif_irq; ++ ++ err = pfe_hif_alloc_descr(hif); ++ if (err) ++ goto err0; ++ ++ if (pfe_hif_init_buffers(hif)) { ++ pr_err("%s: Could not initialize buffer descriptors\n" ++ , __func__); ++ err = -ENOMEM; ++ goto err1; ++ } ++ ++ /* Initialize NAPI for Rx processing */ ++ init_dummy_netdev(&hif->dummy_dev); ++ netif_napi_add(&hif->dummy_dev, &hif->napi, pfe_hif_rx_poll, ++ HIF_RX_POLL_WEIGHT); ++ napi_enable(&hif->napi); ++ ++ spin_lock_init(&hif->tx_lock); ++ spin_lock_init(&hif->lock); ++ ++ hif_init(); ++ hif_rx_enable(); ++ hif_tx_enable(); ++ ++ /* Disable tx done interrupt */ ++ writel(HIF_INT_MASK, HIF_INT_ENABLE); ++ ++ gpi_enable(HGPI_BASE_ADDR); ++ ++ err = request_irq(hif->irq, hif_isr, 0, "pfe_hif", hif); ++ if (err) { ++ pr_err("%s: failed to get the hif IRQ = %d\n", ++ __func__, hif->irq); ++ goto err1; ++ } ++ ++ err = request_irq(pfe->wol_irq, wol_isr, 0, "pfe_wol", pfe); ++ if (err) { ++ pr_err("%s: failed to get the wol IRQ = %d\n", ++ __func__, pfe->wol_irq); ++ goto err1; ++ } ++ ++ tasklet_init(&hif->tx_cleanup_tasklet, ++ (void(*)(unsigned long))pfe_tx_do_cleanup, ++ (unsigned long)hif); ++ ++ return 0; ++err1: ++ pfe_hif_free_descr(hif); ++err0: ++ return err; ++} ++ ++/* pfe_hif_exit- */ ++void pfe_hif_exit(struct pfe *pfe) ++{ ++ struct pfe_hif *hif = &pfe->hif; ++ ++ pr_info("%s\n", __func__); ++ ++ tasklet_kill(&hif->tx_cleanup_tasklet); ++ ++ spin_lock_bh(&hif->lock); ++ hif->shm->g_client_status[0] = 0; ++ /* Make sure all clients are disabled*/ ++ hif->shm->g_client_status[1] = 0; ++ ++ spin_unlock_bh(&hif->lock); ++ ++ /*Disable Rx/Tx */ ++ gpi_disable(HGPI_BASE_ADDR); ++ hif_rx_disable(); ++ hif_tx_disable(); ++ ++ napi_disable(&hif->napi); ++ netif_napi_del(&hif->napi); ++ ++ free_irq(pfe->wol_irq, pfe); ++ free_irq(hif->irq, hif); ++ ++ pfe_hif_release_buffers(hif); ++ pfe_hif_free_descr(hif); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hif.h +@@ -0,0 +1,211 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#ifndef _PFE_HIF_H_ ++#define _PFE_HIF_H_ ++ ++#include ++ ++#define HIF_NAPI_STATS ++ ++#define HIF_CLIENT_QUEUES_MAX 16 ++#define HIF_RX_POLL_WEIGHT 64 ++ ++#define HIF_RX_PKT_MIN_SIZE 0x800 /* 2KB */ ++#define HIF_RX_PKT_MIN_SIZE_MASK ~(HIF_RX_PKT_MIN_SIZE - 1) ++#define ROUND_MIN_RX_SIZE(_sz) (((_sz) + (HIF_RX_PKT_MIN_SIZE - 1)) \ ++ & HIF_RX_PKT_MIN_SIZE_MASK) ++#define PRESENT_OFST_IN_PAGE(_buf) (((unsigned long int)(_buf) & (PAGE_SIZE \ ++ - 1)) & HIF_RX_PKT_MIN_SIZE_MASK) ++ ++enum { ++ NAPI_SCHED_COUNT = 0, ++ NAPI_POLL_COUNT, ++ NAPI_PACKET_COUNT, ++ NAPI_DESC_COUNT, ++ NAPI_FULL_BUDGET_COUNT, ++ NAPI_CLIENT_FULL_COUNT, ++ NAPI_MAX_COUNT ++}; ++ ++/* ++ * HIF_TX_DESC_NT value should be always greter than 4, ++ * Otherwise HIF_TX_POLL_MARK will become zero. ++ */ ++#define HIF_RX_DESC_NT 256 ++#define HIF_TX_DESC_NT 2048 ++ ++#define HIF_FIRST_BUFFER BIT(0) ++#define HIF_LAST_BUFFER BIT(1) ++#define HIF_DONT_DMA_MAP BIT(2) ++#define HIF_DATA_VALID BIT(3) ++#define HIF_TSO BIT(4) ++ ++enum { ++ PFE_CL_GEM0 = 0, ++ PFE_CL_GEM1, ++ HIF_CLIENTS_MAX ++}; ++ ++/*structure to store client queue info */ ++struct hif_rx_queue { ++ struct rx_queue_desc *base; ++ u32 size; ++ u32 write_idx; ++}; ++ ++struct hif_tx_queue { ++ struct tx_queue_desc *base; ++ u32 size; ++ u32 ack_idx; ++}; ++ ++/*Structure to store the client info */ ++struct hif_client { ++ int rx_qn; ++ struct hif_rx_queue rx_q[HIF_CLIENT_QUEUES_MAX]; ++ int tx_qn; ++ struct hif_tx_queue tx_q[HIF_CLIENT_QUEUES_MAX]; ++}; ++ ++/*HIF hardware buffer descriptor */ ++struct hif_desc { ++ u32 ctrl; ++ u32 status; ++ u32 data; ++ u32 next; ++}; ++ ++struct __hif_desc { ++ u32 ctrl; ++ u32 status; ++ u32 data; ++}; ++ ++struct hif_desc_sw { ++ dma_addr_t data; ++ u16 len; ++ u8 client_id; ++ u8 q_no; ++ u16 flags; ++}; ++ ++struct hif_hdr { ++ u8 client_id; ++ u8 q_num; ++ u16 client_ctrl; ++ u16 client_ctrl1; ++}; ++ ++struct __hif_hdr { ++ union { ++ struct hif_hdr hdr; ++ u32 word[2]; ++ }; ++}; ++ ++struct hif_ipsec_hdr { ++ u16 sa_handle[2]; ++} __packed; ++ ++/* HIF_CTRL_TX... defines */ ++#define HIF_CTRL_TX_CHECKSUM BIT(2) ++ ++/* HIF_CTRL_RX... defines */ ++#define HIF_CTRL_RX_OFFSET_OFST (24) ++#define HIF_CTRL_RX_CHECKSUMMED BIT(2) ++#define HIF_CTRL_RX_CONTINUED BIT(1) ++ ++struct pfe_hif { ++ /* To store registered clients in hif layer */ ++ struct hif_client client[HIF_CLIENTS_MAX]; ++ struct hif_shm *shm; ++ int irq; ++ ++ void *descr_baseaddr_v; ++ unsigned long descr_baseaddr_p; ++ ++ struct hif_desc *rx_base; ++ u32 rx_ring_size; ++ u32 rxtoclean_index; ++ void *rx_buf_addr[HIF_RX_DESC_NT]; ++ int rx_buf_len[HIF_RX_DESC_NT]; ++ unsigned int qno; ++ unsigned int client_id; ++ unsigned int client_ctrl; ++ unsigned int started; ++ ++ struct hif_desc *tx_base; ++ u32 tx_ring_size; ++ u32 txtosend; ++ u32 txtoclean; ++ u32 txavail; ++ u32 txtoflush; ++ struct hif_desc_sw tx_sw_queue[HIF_TX_DESC_NT]; ++ ++/* tx_lock synchronizes hif packet tx as well as pfe_hif structure access */ ++ spinlock_t tx_lock; ++/* lock synchronizes hif rx queue processing */ ++ spinlock_t lock; ++ struct net_device dummy_dev; ++ struct napi_struct napi; ++ struct device *dev; ++ ++#ifdef HIF_NAPI_STATS ++ unsigned int napi_counters[NAPI_MAX_COUNT]; ++#endif ++ struct tasklet_struct tx_cleanup_tasklet; ++}; ++ ++void __hif_xmit_pkt(struct pfe_hif *hif, unsigned int client_id, unsigned int ++ q_no, void *data, u32 len, unsigned int flags); ++int hif_xmit_pkt(struct pfe_hif *hif, unsigned int client_id, unsigned int q_no, ++ void *data, unsigned int len); ++void __hif_tx_done_process(struct pfe_hif *hif, int count); ++void hif_process_client_req(struct pfe_hif *hif, int req, int data1, int ++ data2); ++int pfe_hif_init(struct pfe *pfe); ++void pfe_hif_exit(struct pfe *pfe); ++void pfe_hif_rx_idle(struct pfe_hif *hif); ++static inline void hif_tx_done_process(struct pfe_hif *hif, int count) ++{ ++ spin_lock_bh(&hif->tx_lock); ++ __hif_tx_done_process(hif, count); ++ spin_unlock_bh(&hif->tx_lock); ++} ++ ++static inline void hif_tx_lock(struct pfe_hif *hif) ++{ ++ spin_lock_bh(&hif->tx_lock); ++} ++ ++static inline void hif_tx_unlock(struct pfe_hif *hif) ++{ ++ spin_unlock_bh(&hif->tx_lock); ++} ++ ++static inline int __hif_tx_avail(struct pfe_hif *hif) ++{ ++ return hif->txavail; ++} ++ ++#define __memcpy8(dst, src) memcpy(dst, src, 8) ++#define __memcpy12(dst, src) memcpy(dst, src, 12) ++#define __memcpy(dst, src, len) memcpy(dst, src, len) ++ ++#endif /* _PFE_HIF_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hif_lib.c +@@ -0,0 +1,601 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "pfe_mod.h" ++#include "pfe_hif.h" ++#include "pfe_hif_lib.h" ++ ++unsigned int lro_mode; ++unsigned int page_mode; ++unsigned int tx_qos; ++unsigned int pfe_pkt_size; ++unsigned int pfe_pkt_headroom; ++unsigned int emac_txq_cnt; ++ ++/* ++ * @pfe_hal_lib.c. ++ * Common functions used by HIF client drivers ++ */ ++ ++/*HIF shared memory Global variable */ ++struct hif_shm ghif_shm; ++ ++/* Cleanup the HIF shared memory, release HIF rx_buffer_pool. ++ * This function should be called after pfe_hif_exit ++ * ++ * @param[in] hif_shm Shared memory address location in DDR ++ */ ++static void pfe_hif_shm_clean(struct hif_shm *hif_shm) ++{ ++ int i; ++ void *pkt; ++ ++ for (i = 0; i < hif_shm->rx_buf_pool_cnt; i++) { ++ pkt = hif_shm->rx_buf_pool[i]; ++ if (pkt) { ++ hif_shm->rx_buf_pool[i] = NULL; ++ pkt -= pfe_pkt_headroom; ++ ++ if (page_mode) ++ put_page(virt_to_page(pkt)); ++ else ++ kfree(pkt); ++ } ++ } ++} ++ ++/* Initialize shared memory used between HIF driver and clients, ++ * allocate rx_buffer_pool required for HIF Rx descriptors. ++ * This function should be called before initializing HIF driver. ++ * ++ * @param[in] hif_shm Shared memory address location in DDR ++ * @rerurn 0 - on succes, <0 on fail to initialize ++ */ ++static int pfe_hif_shm_init(struct hif_shm *hif_shm) ++{ ++ int i; ++ void *pkt; ++ ++ memset(hif_shm, 0, sizeof(struct hif_shm)); ++ hif_shm->rx_buf_pool_cnt = HIF_RX_DESC_NT; ++ ++ for (i = 0; i < hif_shm->rx_buf_pool_cnt; i++) { ++ if (page_mode) { ++ pkt = (void *)__get_free_page(GFP_KERNEL | ++ GFP_DMA_PFE); ++ } else { ++ pkt = kmalloc(PFE_BUF_SIZE, GFP_KERNEL | GFP_DMA_PFE); ++ } ++ ++ if (pkt) ++ hif_shm->rx_buf_pool[i] = pkt + pfe_pkt_headroom; ++ else ++ goto err0; ++ } ++ ++ return 0; ++ ++err0: ++ pr_err("%s Low memory\n", __func__); ++ pfe_hif_shm_clean(hif_shm); ++ return -ENOMEM; ++} ++ ++/*This function sends indication to HIF driver ++ * ++ * @param[in] hif hif context ++ */ ++static void hif_lib_indicate_hif(struct pfe_hif *hif, int req, int data1, int ++ data2) ++{ ++ hif_process_client_req(hif, req, data1, data2); ++} ++ ++void hif_lib_indicate_client(int client_id, int event_type, int qno) ++{ ++ struct hif_client_s *client = pfe->hif_client[client_id]; ++ ++ if (!client || (event_type >= HIF_EVENT_MAX) || (qno >= ++ HIF_CLIENT_QUEUES_MAX)) ++ return; ++ ++ if (!test_and_set_bit(qno, &client->queue_mask[event_type])) ++ client->event_handler(client->priv, event_type, qno); ++} ++ ++/*This function releases Rx queue descriptors memory and pre-filled buffers ++ * ++ * @param[in] client hif_client context ++ */ ++static void hif_lib_client_release_rx_buffers(struct hif_client_s *client) ++{ ++ struct rx_queue_desc *desc; ++ int qno, ii; ++ void *buf; ++ ++ for (qno = 0; qno < client->rx_qn; qno++) { ++ desc = client->rx_q[qno].base; ++ ++ for (ii = 0; ii < client->rx_q[qno].size; ii++) { ++ buf = (void *)desc->data; ++ if (buf) { ++ buf -= pfe_pkt_headroom; ++ ++ if (page_mode) ++ free_page((unsigned long)buf); ++ else ++ kfree(buf); ++ ++ desc->ctrl = 0; ++ } ++ ++ desc++; ++ } ++ } ++ ++ kfree(client->rx_qbase); ++} ++ ++/*This function allocates memory for the rxq descriptors and pre-fill rx queues ++ * with buffers. ++ * @param[in] client client context ++ * @param[in] q_size size of the rxQ, all queues are of same size ++ */ ++static int hif_lib_client_init_rx_buffers(struct hif_client_s *client, int ++ q_size) ++{ ++ struct rx_queue_desc *desc; ++ struct hif_client_rx_queue *queue; ++ int ii, qno; ++ ++ /*Allocate memory for the client queues */ ++ client->rx_qbase = kzalloc(client->rx_qn * q_size * sizeof(struct ++ rx_queue_desc), GFP_KERNEL); ++ if (!client->rx_qbase) ++ goto err; ++ ++ for (qno = 0; qno < client->rx_qn; qno++) { ++ queue = &client->rx_q[qno]; ++ ++ queue->base = client->rx_qbase + qno * q_size * sizeof(struct ++ rx_queue_desc); ++ queue->size = q_size; ++ queue->read_idx = 0; ++ queue->write_idx = 0; ++ ++ pr_debug("rx queue: %d, base: %p, size: %d\n", qno, ++ queue->base, queue->size); ++ } ++ ++ for (qno = 0; qno < client->rx_qn; qno++) { ++ queue = &client->rx_q[qno]; ++ desc = queue->base; ++ ++ for (ii = 0; ii < queue->size; ii++) { ++ desc->ctrl = CL_DESC_BUF_LEN(pfe_pkt_size) | ++ CL_DESC_OWN; ++ desc++; ++ } ++ } ++ ++ return 0; ++ ++err: ++ return 1; ++} ++ ++ ++static void hif_lib_client_cleanup_tx_queue(struct hif_client_tx_queue *queue) ++{ ++ pr_debug("%s\n", __func__); ++ ++ /* ++ * Check if there are any pending packets. Client must flush the tx ++ * queues before unregistering, by calling by calling ++ * hif_lib_tx_get_next_complete() ++ * ++ * Hif no longer calls since we are no longer registered ++ */ ++ if (queue->tx_pending) ++ pr_err("%s: pending transmit packets\n", __func__); ++} ++ ++static void hif_lib_client_release_tx_buffers(struct hif_client_s *client) ++{ ++ int qno; ++ ++ pr_debug("%s\n", __func__); ++ ++ for (qno = 0; qno < client->tx_qn; qno++) ++ hif_lib_client_cleanup_tx_queue(&client->tx_q[qno]); ++ ++ kfree(client->tx_qbase); ++} ++ ++static int hif_lib_client_init_tx_buffers(struct hif_client_s *client, int ++ q_size) ++{ ++ struct hif_client_tx_queue *queue; ++ int qno; ++ ++ client->tx_qbase = kzalloc(client->tx_qn * q_size * sizeof(struct ++ tx_queue_desc), GFP_KERNEL); ++ if (!client->tx_qbase) ++ return 1; ++ ++ for (qno = 0; qno < client->tx_qn; qno++) { ++ queue = &client->tx_q[qno]; ++ ++ queue->base = client->tx_qbase + qno * q_size * sizeof(struct ++ tx_queue_desc); ++ queue->size = q_size; ++ queue->read_idx = 0; ++ queue->write_idx = 0; ++ queue->tx_pending = 0; ++ queue->nocpy_flag = 0; ++ queue->prev_tmu_tx_pkts = 0; ++ queue->done_tmu_tx_pkts = 0; ++ ++ pr_debug("tx queue: %d, base: %p, size: %d\n", qno, ++ queue->base, queue->size); ++ } ++ ++ return 0; ++} ++ ++static int hif_lib_event_dummy(void *priv, int event_type, int qno) ++{ ++ return 0; ++} ++ ++int hif_lib_client_register(struct hif_client_s *client) ++{ ++ struct hif_shm *hif_shm; ++ struct hif_client_shm *client_shm; ++ int err, i; ++ /* int loop_cnt = 0; */ ++ ++ pr_debug("%s\n", __func__); ++ ++ /*Allocate memory before spin_lock*/ ++ if (hif_lib_client_init_rx_buffers(client, client->rx_qsize)) { ++ err = -ENOMEM; ++ goto err_rx; ++ } ++ ++ if (hif_lib_client_init_tx_buffers(client, client->tx_qsize)) { ++ err = -ENOMEM; ++ goto err_tx; ++ } ++ ++ spin_lock_bh(&pfe->hif.lock); ++ if (!(client->pfe) || (client->id >= HIF_CLIENTS_MAX) || ++ (pfe->hif_client[client->id])) { ++ err = -EINVAL; ++ goto err; ++ } ++ ++ hif_shm = client->pfe->hif.shm; ++ ++ if (!client->event_handler) ++ client->event_handler = hif_lib_event_dummy; ++ ++ /*Initialize client specific shared memory */ ++ client_shm = (struct hif_client_shm *)&hif_shm->client[client->id]; ++ client_shm->rx_qbase = (unsigned long int)client->rx_qbase; ++ client_shm->rx_qsize = client->rx_qsize; ++ client_shm->tx_qbase = (unsigned long int)client->tx_qbase; ++ client_shm->tx_qsize = client->tx_qsize; ++ client_shm->ctrl = (client->tx_qn << CLIENT_CTRL_TX_Q_CNT_OFST) | ++ (client->rx_qn << CLIENT_CTRL_RX_Q_CNT_OFST); ++ /* spin_lock_init(&client->rx_lock); */ ++ ++ for (i = 0; i < HIF_EVENT_MAX; i++) { ++ client->queue_mask[i] = 0; /* ++ * By default all events are ++ * unmasked ++ */ ++ } ++ ++ /*Indicate to HIF driver*/ ++ hif_lib_indicate_hif(&pfe->hif, REQUEST_CL_REGISTER, client->id, 0); ++ ++ pr_debug("%s: client: %p, client_id: %d, tx_qsize: %d, rx_qsize: %d\n", ++ __func__, client, client->id, client->tx_qsize, ++ client->rx_qsize); ++ ++ client->cpu_id = -1; ++ ++ pfe->hif_client[client->id] = client; ++ spin_unlock_bh(&pfe->hif.lock); ++ ++ return 0; ++ ++err: ++ spin_unlock_bh(&pfe->hif.lock); ++ hif_lib_client_release_tx_buffers(client); ++ ++err_tx: ++ hif_lib_client_release_rx_buffers(client); ++ ++err_rx: ++ return err; ++} ++ ++int hif_lib_client_unregister(struct hif_client_s *client) ++{ ++ struct pfe *pfe = client->pfe; ++ u32 client_id = client->id; ++ ++ pr_info( ++ "%s : client: %p, client_id: %d, txQ_depth: %d, rxQ_depth: %d\n" ++ , __func__, client, client->id, client->tx_qsize, ++ client->rx_qsize); ++ ++ spin_lock_bh(&pfe->hif.lock); ++ hif_lib_indicate_hif(&pfe->hif, REQUEST_CL_UNREGISTER, client->id, 0); ++ ++ hif_lib_client_release_tx_buffers(client); ++ hif_lib_client_release_rx_buffers(client); ++ pfe->hif_client[client_id] = NULL; ++ spin_unlock_bh(&pfe->hif.lock); ++ ++ return 0; ++} ++ ++int hif_lib_event_handler_start(struct hif_client_s *client, int event, ++ int qno) ++{ ++ struct hif_client_rx_queue *queue = &client->rx_q[qno]; ++ struct rx_queue_desc *desc = queue->base + queue->read_idx; ++ ++ if ((event >= HIF_EVENT_MAX) || (qno >= HIF_CLIENT_QUEUES_MAX)) { ++ pr_debug("%s: Unsupported event : %d queue number : %d\n", ++ __func__, event, qno); ++ return -1; ++ } ++ ++ test_and_clear_bit(qno, &client->queue_mask[event]); ++ ++ switch (event) { ++ case EVENT_RX_PKT_IND: ++ if (!(desc->ctrl & CL_DESC_OWN)) ++ hif_lib_indicate_client(client->id, ++ EVENT_RX_PKT_IND, qno); ++ break; ++ ++ case EVENT_HIGH_RX_WM: ++ case EVENT_TXDONE_IND: ++ default: ++ break; ++ } ++ ++ return 0; ++} ++ ++/* ++ * This function gets one packet from the specified client queue ++ * It also refill the rx buffer ++ */ ++void *hif_lib_receive_pkt(struct hif_client_s *client, int qno, int *len, int ++ *ofst, unsigned int *rx_ctrl, ++ unsigned int *desc_ctrl, void **priv_data) ++{ ++ struct hif_client_rx_queue *queue = &client->rx_q[qno]; ++ struct rx_queue_desc *desc; ++ void *pkt = NULL; ++ ++ /* ++ * Following lock is to protect rx queue access from, ++ * hif_lib_event_handler_start. ++ * In general below lock is not required, because hif_lib_xmit_pkt and ++ * hif_lib_event_handler_start are called from napi poll and which is ++ * not re-entrant. But if some client use in different way this lock is ++ * required. ++ */ ++ /*spin_lock_irqsave(&client->rx_lock, flags); */ ++ desc = queue->base + queue->read_idx; ++ if (!(desc->ctrl & CL_DESC_OWN)) { ++ pkt = desc->data - pfe_pkt_headroom; ++ ++ *rx_ctrl = desc->client_ctrl; ++ *desc_ctrl = desc->ctrl; ++ ++ if (desc->ctrl & CL_DESC_FIRST) { ++ u16 size = *rx_ctrl >> HIF_CTRL_RX_OFFSET_OFST; ++ ++ if (size) { ++ *len = CL_DESC_BUF_LEN(desc->ctrl) - ++ PFE_PKT_HEADER_SZ - size; ++ *ofst = pfe_pkt_headroom + PFE_PKT_HEADER_SZ ++ + size; ++ *priv_data = desc->data + PFE_PKT_HEADER_SZ; ++ } else { ++ *len = CL_DESC_BUF_LEN(desc->ctrl) - ++ PFE_PKT_HEADER_SZ; ++ *ofst = pfe_pkt_headroom + PFE_PKT_HEADER_SZ; ++ *priv_data = NULL; ++ } ++ ++ } else { ++ *len = CL_DESC_BUF_LEN(desc->ctrl); ++ *ofst = pfe_pkt_headroom; ++ } ++ ++ /* ++ * Needed so we don't free a buffer/page ++ * twice on module_exit ++ */ ++ desc->data = NULL; ++ ++ /* ++ * Ensure everything else is written to DDR before ++ * writing bd->ctrl ++ */ ++ smp_wmb(); ++ ++ desc->ctrl = CL_DESC_BUF_LEN(pfe_pkt_size) | CL_DESC_OWN; ++ queue->read_idx = (queue->read_idx + 1) & (queue->size - 1); ++ } ++ ++ /*spin_unlock_irqrestore(&client->rx_lock, flags); */ ++ return pkt; ++} ++ ++static inline void hif_hdr_write(struct hif_hdr *pkt_hdr, unsigned int ++ client_id, unsigned int qno, ++ u32 client_ctrl) ++{ ++ /* Optimize the write since the destinaton may be non-cacheable */ ++ if (!((unsigned long)pkt_hdr & 0x3)) { ++ ((u32 *)pkt_hdr)[0] = (client_ctrl << 16) | (qno << 8) | ++ client_id; ++ } else { ++ ((u16 *)pkt_hdr)[0] = (qno << 8) | (client_id & 0xFF); ++ ((u16 *)pkt_hdr)[1] = (client_ctrl & 0xFFFF); ++ } ++} ++ ++/*This function puts the given packet in the specific client queue */ ++void __hif_lib_xmit_pkt(struct hif_client_s *client, unsigned int qno, void ++ *data, unsigned int len, u32 client_ctrl, ++ unsigned int flags, void *client_data) ++{ ++ struct hif_client_tx_queue *queue = &client->tx_q[qno]; ++ struct tx_queue_desc *desc = queue->base + queue->write_idx; ++ ++ /* First buffer */ ++ if (flags & HIF_FIRST_BUFFER) { ++ data -= sizeof(struct hif_hdr); ++ len += sizeof(struct hif_hdr); ++ ++ hif_hdr_write(data, client->id, qno, client_ctrl); ++ } ++ ++ desc->data = client_data; ++ desc->ctrl = CL_DESC_OWN | CL_DESC_FLAGS(flags); ++ ++ __hif_xmit_pkt(&pfe->hif, client->id, qno, data, len, flags); ++ ++ queue->write_idx = (queue->write_idx + 1) & (queue->size - 1); ++ queue->tx_pending++; ++ queue->jiffies_last_packet = jiffies; ++} ++ ++void *hif_lib_tx_get_next_complete(struct hif_client_s *client, int qno, ++ unsigned int *flags, int count) ++{ ++ struct hif_client_tx_queue *queue = &client->tx_q[qno]; ++ struct tx_queue_desc *desc = queue->base + queue->read_idx; ++ ++ pr_debug("%s: qno : %d rd_indx: %d pending:%d\n", __func__, qno, ++ queue->read_idx, queue->tx_pending); ++ ++ if (!queue->tx_pending) ++ return NULL; ++ ++ if (queue->nocpy_flag && !queue->done_tmu_tx_pkts) { ++ u32 tmu_tx_pkts = be32_to_cpu(pe_dmem_read(TMU0_ID + ++ client->id, TMU_DM_TX_TRANS, 4)); ++ ++ if (queue->prev_tmu_tx_pkts > tmu_tx_pkts) ++ queue->done_tmu_tx_pkts = UINT_MAX - ++ queue->prev_tmu_tx_pkts + tmu_tx_pkts; ++ else ++ queue->done_tmu_tx_pkts = tmu_tx_pkts - ++ queue->prev_tmu_tx_pkts; ++ ++ queue->prev_tmu_tx_pkts = tmu_tx_pkts; ++ ++ if (!queue->done_tmu_tx_pkts) ++ return NULL; ++ } ++ ++ if (desc->ctrl & CL_DESC_OWN) ++ return NULL; ++ ++ queue->read_idx = (queue->read_idx + 1) & (queue->size - 1); ++ queue->tx_pending--; ++ ++ *flags = CL_DESC_GET_FLAGS(desc->ctrl); ++ ++ if (queue->done_tmu_tx_pkts && (*flags & HIF_LAST_BUFFER)) ++ queue->done_tmu_tx_pkts--; ++ ++ return desc->data; ++} ++ ++static void hif_lib_tmu_credit_init(struct pfe *pfe) ++{ ++ int i, q; ++ ++ for (i = 0; i < NUM_GEMAC_SUPPORT; i++) ++ for (q = 0; q < emac_txq_cnt; q++) { ++ pfe->tmu_credit.tx_credit_max[i][q] = (q == 0) ? ++ DEFAULT_Q0_QDEPTH : DEFAULT_MAX_QDEPTH; ++ pfe->tmu_credit.tx_credit[i][q] = ++ pfe->tmu_credit.tx_credit_max[i][q]; ++ } ++} ++ ++int pfe_hif_lib_init(struct pfe *pfe) ++{ ++ int rc; ++ ++ pr_info("%s\n", __func__); ++ ++ if (lro_mode) { ++ page_mode = 1; ++ pfe_pkt_size = min(PAGE_SIZE, MAX_PFE_PKT_SIZE); ++ pfe_pkt_headroom = 0; ++ } else { ++ page_mode = 0; ++ pfe_pkt_size = PFE_PKT_SIZE; ++ pfe_pkt_headroom = PFE_PKT_HEADROOM; ++ } ++ ++ if (tx_qos) ++ emac_txq_cnt = EMAC_TXQ_CNT / 2; ++ else ++ emac_txq_cnt = EMAC_TXQ_CNT; ++ ++ hif_lib_tmu_credit_init(pfe); ++ pfe->hif.shm = &ghif_shm; ++ rc = pfe_hif_shm_init(pfe->hif.shm); ++ ++ return rc; ++} ++ ++void pfe_hif_lib_exit(struct pfe *pfe) ++{ ++ pr_info("%s\n", __func__); ++ ++ pfe_hif_shm_clean(pfe->hif.shm); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hif_lib.h +@@ -0,0 +1,239 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#ifndef _PFE_HIF_LIB_H_ ++#define _PFE_HIF_LIB_H_ ++ ++#include "pfe_hif.h" ++ ++#define HIF_CL_REQ_TIMEOUT 10 ++#define GFP_DMA_PFE 0 ++ ++enum { ++ REQUEST_CL_REGISTER = 0, ++ REQUEST_CL_UNREGISTER, ++ HIF_REQUEST_MAX ++}; ++ ++enum { ++ /* Event to indicate that client rx queue is reached water mark level */ ++ EVENT_HIGH_RX_WM = 0, ++ /* Event to indicate that, packet received for client */ ++ EVENT_RX_PKT_IND, ++ /* Event to indicate that, packet tx done for client */ ++ EVENT_TXDONE_IND, ++ HIF_EVENT_MAX ++}; ++ ++/*structure to store client queue info */ ++ ++/*structure to store client queue info */ ++struct hif_client_rx_queue { ++ struct rx_queue_desc *base; ++ u32 size; ++ u32 read_idx; ++ u32 write_idx; ++}; ++ ++struct hif_client_tx_queue { ++ struct tx_queue_desc *base; ++ u32 size; ++ u32 read_idx; ++ u32 write_idx; ++ u32 tx_pending; ++ unsigned long jiffies_last_packet; ++ u32 nocpy_flag; ++ u32 prev_tmu_tx_pkts; ++ u32 done_tmu_tx_pkts; ++}; ++ ++struct hif_client_s { ++ int id; ++ int tx_qn; ++ int rx_qn; ++ void *rx_qbase; ++ void *tx_qbase; ++ int tx_qsize; ++ int rx_qsize; ++ int cpu_id; ++ struct hif_client_tx_queue tx_q[HIF_CLIENT_QUEUES_MAX]; ++ struct hif_client_rx_queue rx_q[HIF_CLIENT_QUEUES_MAX]; ++ int (*event_handler)(void *priv, int event, int data); ++ unsigned long queue_mask[HIF_EVENT_MAX]; ++ struct pfe *pfe; ++ void *priv; ++}; ++ ++/* ++ * Client specific shared memory ++ * It contains number of Rx/Tx queues, base addresses and queue sizes ++ */ ++struct hif_client_shm { ++ u32 ctrl; /*0-7: number of Rx queues, 8-15: number of tx queues */ ++ unsigned long rx_qbase; /*Rx queue base address */ ++ u32 rx_qsize; /*each Rx queue size, all Rx queues are of same size */ ++ unsigned long tx_qbase; /* Tx queue base address */ ++ u32 tx_qsize; /*each Tx queue size, all Tx queues are of same size */ ++}; ++ ++/*Client shared memory ctrl bit description */ ++#define CLIENT_CTRL_RX_Q_CNT_OFST 0 ++#define CLIENT_CTRL_TX_Q_CNT_OFST 8 ++#define CLIENT_CTRL_RX_Q_CNT(ctrl) (((ctrl) >> CLIENT_CTRL_RX_Q_CNT_OFST) \ ++ & 0xFF) ++#define CLIENT_CTRL_TX_Q_CNT(ctrl) (((ctrl) >> CLIENT_CTRL_TX_Q_CNT_OFST) \ ++ & 0xFF) ++ ++/* ++ * Shared memory used to communicate between HIF driver and host/client drivers ++ * Before starting the hif driver rx_buf_pool ans rx_buf_pool_cnt should be ++ * initialized with host buffers and buffers count in the pool. ++ * rx_buf_pool_cnt should be >= HIF_RX_DESC_NT. ++ * ++ */ ++struct hif_shm { ++ u32 rx_buf_pool_cnt; /*Number of rx buffers available*/ ++ /*Rx buffers required to initialize HIF rx descriptors */ ++ void *rx_buf_pool[HIF_RX_DESC_NT]; ++ unsigned long g_client_status[2]; /*Global client status bit mask */ ++ /* Client specific shared memory */ ++ struct hif_client_shm client[HIF_CLIENTS_MAX]; ++}; ++ ++#define CL_DESC_OWN BIT(31) ++/* This sets owner ship to HIF driver */ ++#define CL_DESC_LAST BIT(30) ++/* This indicates last packet for multi buffers handling */ ++#define CL_DESC_FIRST BIT(29) ++/* This indicates first packet for multi buffers handling */ ++ ++#define CL_DESC_BUF_LEN(x) ((x) & 0xFFFF) ++#define CL_DESC_FLAGS(x) (((x) & 0xF) << 16) ++#define CL_DESC_GET_FLAGS(x) (((x) >> 16) & 0xF) ++ ++struct rx_queue_desc { ++ void *data; ++ u32 ctrl; /*0-15bit len, 16-20bit flags, 31bit owner*/ ++ u32 client_ctrl; ++}; ++ ++struct tx_queue_desc { ++ void *data; ++ u32 ctrl; /*0-15bit len, 16-20bit flags, 31bit owner*/ ++}; ++ ++/* HIF Rx is not working properly for 2-byte aligned buffers and ++ * ip_header should be 4byte aligned for better iperformance. ++ * "ip_header = 64 + 6(hif_header) + 14 (MAC Header)" will be 4byte aligned. ++ */ ++#define PFE_PKT_HEADER_SZ sizeof(struct hif_hdr) ++/* must be big enough for headroom, pkt size and skb shared info */ ++#define PFE_BUF_SIZE 2048 ++#define PFE_PKT_HEADROOM 128 ++ ++#define SKB_SHARED_INFO_SIZE (sizeof(struct skb_shared_info)) ++#define PFE_PKT_SIZE (PFE_BUF_SIZE - PFE_PKT_HEADROOM \ ++ - SKB_SHARED_INFO_SIZE) ++#define MAX_L2_HDR_SIZE 14 /* Not correct for VLAN/PPPoE */ ++#define MAX_L3_HDR_SIZE 20 /* Not correct for IPv6 */ ++#define MAX_L4_HDR_SIZE 60 /* TCP with maximum options */ ++#define MAX_HDR_SIZE (MAX_L2_HDR_SIZE + MAX_L3_HDR_SIZE \ ++ + MAX_L4_HDR_SIZE) ++/* Used in page mode to clamp packet size to the maximum supported by the hif ++ *hw interface (<16KiB) ++ */ ++#define MAX_PFE_PKT_SIZE 16380UL ++ ++extern unsigned int pfe_pkt_size; ++extern unsigned int pfe_pkt_headroom; ++extern unsigned int page_mode; ++extern unsigned int lro_mode; ++extern unsigned int tx_qos; ++extern unsigned int emac_txq_cnt; ++ ++int pfe_hif_lib_init(struct pfe *pfe); ++void pfe_hif_lib_exit(struct pfe *pfe); ++int hif_lib_client_register(struct hif_client_s *client); ++int hif_lib_client_unregister(struct hif_client_s *client); ++void __hif_lib_xmit_pkt(struct hif_client_s *client, unsigned int qno, void ++ *data, unsigned int len, u32 client_ctrl, ++ unsigned int flags, void *client_data); ++int hif_lib_xmit_pkt(struct hif_client_s *client, unsigned int qno, void *data, ++ unsigned int len, u32 client_ctrl, void *client_data); ++void hif_lib_indicate_client(int cl_id, int event, int data); ++int hif_lib_event_handler_start(struct hif_client_s *client, int event, int ++ data); ++int hif_lib_tmu_queue_start(struct hif_client_s *client, int qno); ++int hif_lib_tmu_queue_stop(struct hif_client_s *client, int qno); ++void *hif_lib_tx_get_next_complete(struct hif_client_s *client, int qno, ++ unsigned int *flags, int count); ++void *hif_lib_receive_pkt(struct hif_client_s *client, int qno, int *len, int ++ *ofst, unsigned int *rx_ctrl, ++ unsigned int *desc_ctrl, void **priv_data); ++void hif_lib_set_rx_cpu_affinity(struct hif_client_s *client, int cpu_id); ++void hif_lib_set_tx_queue_nocpy(struct hif_client_s *client, int qno, int ++ enable); ++static inline int hif_lib_tx_avail(struct hif_client_s *client, unsigned int ++ qno) ++{ ++ struct hif_client_tx_queue *queue = &client->tx_q[qno]; ++ ++ return (queue->size - queue->tx_pending); ++} ++ ++static inline int hif_lib_get_tx_wr_index(struct hif_client_s *client, unsigned ++ int qno) ++{ ++ struct hif_client_tx_queue *queue = &client->tx_q[qno]; ++ ++ return queue->write_idx; ++} ++ ++static inline int hif_lib_tx_pending(struct hif_client_s *client, unsigned int ++ qno) ++{ ++ struct hif_client_tx_queue *queue = &client->tx_q[qno]; ++ ++ return queue->tx_pending; ++} ++ ++#define hif_lib_tx_credit_avail(pfe, id, qno) \ ++ ((pfe)->tmu_credit.tx_credit[id][qno]) ++ ++#define hif_lib_tx_credit_max(pfe, id, qno) \ ++ ((pfe)->tmu_credit.tx_credit_max[id][qno]) ++ ++/* ++ * Test comment ++ */ ++#define hif_lib_tx_credit_use(pfe, id, qno, credit) \ ++ ({ typeof(pfe) pfe_ = pfe; \ ++ typeof(id) id_ = id; \ ++ typeof(qno) qno_ = qno_; \ ++ typeof(credit) credit_ = credit; \ ++ do { \ ++ if (tx_qos) { \ ++ (pfe_)->tmu_credit.tx_credit[id_][qno_]\ ++ -= credit_; \ ++ (pfe_)->tmu_credit.tx_packets[id_][qno_]\ ++ += credit_; \ ++ } \ ++ } while (0); \ ++ }) ++ ++#endif /* _PFE_HIF_LIB_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hw.c +@@ -0,0 +1,176 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#include "pfe_mod.h" ++#include "pfe_hw.h" ++ ++/* Functions to handle most of pfe hw register initialization */ ++int pfe_hw_init(struct pfe *pfe, int resume) ++{ ++ struct class_cfg class_cfg = { ++ .pe_sys_clk_ratio = PE_SYS_CLK_RATIO, ++ .route_table_baseaddr = pfe->ddr_phys_baseaddr + ++ ROUTE_TABLE_BASEADDR, ++ .route_table_hash_bits = ROUTE_TABLE_HASH_BITS, ++ }; ++ ++ struct tmu_cfg tmu_cfg = { ++ .pe_sys_clk_ratio = PE_SYS_CLK_RATIO, ++ .llm_base_addr = pfe->ddr_phys_baseaddr + TMU_LLM_BASEADDR, ++ .llm_queue_len = TMU_LLM_QUEUE_LEN, ++ }; ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ struct util_cfg util_cfg = { ++ .pe_sys_clk_ratio = PE_SYS_CLK_RATIO, ++ }; ++#endif ++ ++ struct BMU_CFG bmu1_cfg = { ++ .baseaddr = CBUS_VIRT_TO_PFE(LMEM_BASE_ADDR + ++ BMU1_LMEM_BASEADDR), ++ .count = BMU1_BUF_COUNT, ++ .size = BMU1_BUF_SIZE, ++ .low_watermark = 10, ++ .high_watermark = 15, ++ }; ++ ++ struct BMU_CFG bmu2_cfg = { ++ .baseaddr = DDR_PHYS_TO_PFE(pfe->ddr_phys_baseaddr + ++ BMU2_DDR_BASEADDR), ++ .count = BMU2_BUF_COUNT, ++ .size = BMU2_BUF_SIZE, ++ .low_watermark = 250, ++ .high_watermark = 253, ++ }; ++ ++ struct gpi_cfg egpi1_cfg = { ++ .lmem_rtry_cnt = EGPI1_LMEM_RTRY_CNT, ++ .tmlf_txthres = EGPI1_TMLF_TXTHRES, ++ .aseq_len = EGPI1_ASEQ_LEN, ++ .mtip_pause_reg = CBUS_VIRT_TO_PFE(EMAC1_BASE_ADDR + ++ EMAC_TCNTRL_REG), ++ }; ++ ++ struct gpi_cfg egpi2_cfg = { ++ .lmem_rtry_cnt = EGPI2_LMEM_RTRY_CNT, ++ .tmlf_txthres = EGPI2_TMLF_TXTHRES, ++ .aseq_len = EGPI2_ASEQ_LEN, ++ .mtip_pause_reg = CBUS_VIRT_TO_PFE(EMAC2_BASE_ADDR + ++ EMAC_TCNTRL_REG), ++ }; ++ ++ struct gpi_cfg hgpi_cfg = { ++ .lmem_rtry_cnt = HGPI_LMEM_RTRY_CNT, ++ .tmlf_txthres = HGPI_TMLF_TXTHRES, ++ .aseq_len = HGPI_ASEQ_LEN, ++ .mtip_pause_reg = 0, ++ }; ++ ++ pr_info("%s\n", __func__); ++ ++#if !defined(LS1012A_PFE_RESET_WA) ++ /* LS1012A needs this to make PE work correctly */ ++ writel(0x3, CLASS_PE_SYS_CLK_RATIO); ++ writel(0x3, TMU_PE_SYS_CLK_RATIO); ++ writel(0x3, UTIL_PE_SYS_CLK_RATIO); ++ usleep_range(10, 20); ++#endif ++ ++ pr_info("CLASS version: %x\n", readl(CLASS_VERSION)); ++ pr_info("TMU version: %x\n", readl(TMU_VERSION)); ++ ++ pr_info("BMU1 version: %x\n", readl(BMU1_BASE_ADDR + ++ BMU_VERSION)); ++ pr_info("BMU2 version: %x\n", readl(BMU2_BASE_ADDR + ++ BMU_VERSION)); ++ ++ pr_info("EGPI1 version: %x\n", readl(EGPI1_BASE_ADDR + ++ GPI_VERSION)); ++ pr_info("EGPI2 version: %x\n", readl(EGPI2_BASE_ADDR + ++ GPI_VERSION)); ++ pr_info("HGPI version: %x\n", readl(HGPI_BASE_ADDR + ++ GPI_VERSION)); ++ ++ pr_info("HIF version: %x\n", readl(HIF_VERSION)); ++ pr_info("HIF NOPCY version: %x\n", readl(HIF_NOCPY_VERSION)); ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ pr_info("UTIL version: %x\n", readl(UTIL_VERSION)); ++#endif ++ while (!(readl(TMU_CTRL) & ECC_MEM_INIT_DONE)) ++ ; ++ ++ hif_rx_disable(); ++ hif_tx_disable(); ++ ++ bmu_init(BMU1_BASE_ADDR, &bmu1_cfg); ++ ++ pr_info("bmu_init(1) done\n"); ++ ++ bmu_init(BMU2_BASE_ADDR, &bmu2_cfg); ++ ++ pr_info("bmu_init(2) done\n"); ++ ++ class_cfg.resume = resume ? 1 : 0; ++ ++ class_init(&class_cfg); ++ ++ pr_info("class_init() done\n"); ++ ++ tmu_init(&tmu_cfg); ++ ++ pr_info("tmu_init() done\n"); ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ util_init(&util_cfg); ++ ++ pr_info("util_init() done\n"); ++#endif ++ gpi_init(EGPI1_BASE_ADDR, &egpi1_cfg); ++ ++ pr_info("gpi_init(1) done\n"); ++ ++ gpi_init(EGPI2_BASE_ADDR, &egpi2_cfg); ++ ++ pr_info("gpi_init(2) done\n"); ++ ++ gpi_init(HGPI_BASE_ADDR, &hgpi_cfg); ++ ++ pr_info("gpi_init(hif) done\n"); ++ ++ bmu_enable(BMU1_BASE_ADDR); ++ ++ pr_info("bmu_enable(1) done\n"); ++ ++ bmu_enable(BMU2_BASE_ADDR); ++ ++ pr_info("bmu_enable(2) done\n"); ++ ++ return 0; ++} ++ ++void pfe_hw_exit(struct pfe *pfe) ++{ ++ pr_info("%s\n", __func__); ++ ++ bmu_disable(BMU1_BASE_ADDR); ++ bmu_reset(BMU1_BASE_ADDR); ++ ++ bmu_disable(BMU2_BASE_ADDR); ++ bmu_reset(BMU2_BASE_ADDR); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hw.h +@@ -0,0 +1,27 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#ifndef _PFE_HW_H_ ++#define _PFE_HW_H_ ++ ++#define PE_SYS_CLK_RATIO 1 /* SYS/AXI = 250MHz, HFE = 500MHz */ ++ ++int pfe_hw_init(struct pfe *pfe, int resume); ++void pfe_hw_exit(struct pfe *pfe); ++ ++#endif /* _PFE_HW_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c +@@ -0,0 +1,394 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "pfe_mod.h" ++ ++struct ls1012a_pfe_platform_data pfe_platform_data; ++ ++static int pfe_get_gemac_if_proprties(struct device_node *parent, int port, int ++ if_cnt, ++ struct ls1012a_pfe_platform_data ++ *pdata) ++{ ++ struct device_node *gem = NULL, *phy = NULL; ++ int size; ++ int ii = 0, phy_id = 0; ++ const u32 *addr; ++ const void *mac_addr; ++ ++ for (ii = 0; ii < if_cnt; ii++) { ++ gem = of_get_next_child(parent, gem); ++ if (!gem) ++ goto err; ++ addr = of_get_property(gem, "reg", &size); ++ if (addr && (be32_to_cpup(addr) == port)) ++ break; ++ } ++ ++ if (ii >= if_cnt) { ++ pr_err("%s:%d Failed to find interface = %d\n", ++ __func__, __LINE__, if_cnt); ++ goto err; ++ } ++ ++ pdata->ls1012a_eth_pdata[port].gem_id = port; ++ ++ mac_addr = of_get_mac_address(gem); ++ ++ if (mac_addr) { ++ memcpy(pdata->ls1012a_eth_pdata[port].mac_addr, mac_addr, ++ ETH_ALEN); ++ } ++ ++ pdata->ls1012a_eth_pdata[port].mii_config = of_get_phy_mode(gem); ++ ++ if ((pdata->ls1012a_eth_pdata[port].mii_config) < 0) ++ pr_err("%s:%d Incorrect Phy mode....\n", __func__, ++ __LINE__); ++ ++ addr = of_get_property(gem, "fsl,gemac-bus-id", &size); ++ if (!addr) ++ pr_err("%s:%d Invalid gemac-bus-id....\n", __func__, ++ __LINE__); ++ else ++ pdata->ls1012a_eth_pdata[port].bus_id = be32_to_cpup(addr); ++ ++ addr = of_get_property(gem, "fsl,gemac-phy-id", &size); ++ if (!addr) { ++ pr_err("%s:%d Invalid gemac-phy-id....\n", __func__, ++ __LINE__); ++ } else { ++ phy_id = be32_to_cpup(addr); ++ pdata->ls1012a_eth_pdata[port].phy_id = phy_id; ++ pdata->ls1012a_mdio_pdata[0].phy_mask &= ~(1 << phy_id); ++ } ++ ++ addr = of_get_property(gem, "fsl,mdio-mux-val", &size); ++ if (!addr) ++ pr_err("%s: Invalid mdio-mux-val....\n", __func__); ++ else ++ phy_id = be32_to_cpup(addr); ++ pdata->ls1012a_eth_pdata[port].mdio_muxval = phy_id; ++ ++ if (pdata->ls1012a_eth_pdata[port].phy_id < 32) ++ pfe->mdio_muxval[pdata->ls1012a_eth_pdata[port].phy_id] = ++ pdata->ls1012a_eth_pdata[port].mdio_muxval; ++ ++ addr = of_get_property(gem, "fsl,pfe-phy-if-flags", &size); ++ if (!addr) ++ pr_err("%s:%d Invalid pfe-phy-if-flags....\n", ++ __func__, __LINE__); ++ else ++ pdata->ls1012a_eth_pdata[port].phy_flags = be32_to_cpup(addr); ++ ++ /* If PHY is enabled, read mdio properties */ ++ if (pdata->ls1012a_eth_pdata[port].phy_flags & GEMAC_NO_PHY) ++ goto done; ++ ++ phy = of_get_next_child(gem, NULL); ++ ++ addr = of_get_property(phy, "reg", &size); ++ ++ if (!addr) ++ pr_err("%s:%d Invalid phy enable flag....\n", ++ __func__, __LINE__); ++ else ++ pdata->ls1012a_mdio_pdata[port].enabled = be32_to_cpup(addr); ++ ++ pdata->ls1012a_mdio_pdata[port].irq[0] = PHY_POLL; ++ ++done: ++ ++ return 0; ++ ++err: ++ return -1; ++} ++ ++/* ++ * ++ * pfe_platform_probe - ++ * ++ * ++ */ ++static int pfe_platform_probe(struct platform_device *pdev) ++{ ++ struct resource res; ++ int ii, rc, interface_count = 0, size = 0; ++ const u32 *prop; ++ struct device_node *np; ++ struct clk *pfe_clk; ++ ++ np = pdev->dev.of_node; ++ ++ if (!np) { ++ pr_err("Invalid device node\n"); ++ return -EINVAL; ++ } ++ ++ pfe = kzalloc(sizeof(*pfe), GFP_KERNEL); ++ if (!pfe) { ++ rc = -ENOMEM; ++ goto err_alloc; ++ } ++ ++ platform_set_drvdata(pdev, pfe); ++ ++ dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); ++ ++ if (of_address_to_resource(np, 1, &res)) { ++ rc = -ENOMEM; ++ pr_err("failed to get ddr resource\n"); ++ goto err_ddr; ++ } ++ ++ pfe->ddr_phys_baseaddr = res.start; ++ pfe->ddr_size = resource_size(&res); ++ ++ pfe->ddr_baseaddr = phys_to_virt(res.start); ++ if (!pfe->ddr_baseaddr) { ++ pr_err("ioremap() ddr failed\n"); ++ rc = -ENOMEM; ++ goto err_ddr; ++ } ++ ++ pfe->scfg = ++ syscon_regmap_lookup_by_phandle(pdev->dev.of_node, ++ "fsl,pfe-scfg"); ++ if (IS_ERR(pfe->scfg)) { ++ dev_err(&pdev->dev, "No syscfg phandle specified\n"); ++ return PTR_ERR(pfe->scfg); ++ } ++ ++ pfe->cbus_baseaddr = of_iomap(np, 0); ++ if (!pfe->cbus_baseaddr) { ++ rc = -ENOMEM; ++ pr_err("failed to get axi resource\n"); ++ goto err_axi; ++ } ++ ++ pfe->hif_irq = platform_get_irq(pdev, 0); ++ if (pfe->hif_irq < 0) { ++ pr_err("platform_get_irq for hif failed\n"); ++ rc = pfe->hif_irq; ++ goto err_hif_irq; ++ } ++ ++ pfe->wol_irq = platform_get_irq(pdev, 2); ++ if (pfe->wol_irq < 0) { ++ pr_err("platform_get_irq for WoL failed\n"); ++ rc = pfe->wol_irq; ++ goto err_hif_irq; ++ } ++ ++ /* Read interface count */ ++ prop = of_get_property(np, "fsl,pfe-num-interfaces", &size); ++ if (!prop) { ++ pr_err("Failed to read number of interfaces\n"); ++ rc = -ENXIO; ++ goto err_prop; ++ } ++ ++ interface_count = be32_to_cpup(prop); ++ if (interface_count <= 0) { ++ pr_err("No ethernet interface count : %d\n", ++ interface_count); ++ rc = -ENXIO; ++ goto err_prop; ++ } ++ ++ pfe_platform_data.ls1012a_mdio_pdata[0].phy_mask = 0xffffffff; ++ ++ for (ii = 0; ii < interface_count; ii++) { ++ pfe_get_gemac_if_proprties(np, ii, interface_count, ++ &pfe_platform_data); ++ } ++ ++ pfe->dev = &pdev->dev; ++ ++ pfe->dev->platform_data = &pfe_platform_data; ++ ++ /* declare WoL capabilities */ ++ device_init_wakeup(&pdev->dev, true); ++ ++ /* find the clocks */ ++ pfe_clk = devm_clk_get(pfe->dev, "pfe"); ++ if (IS_ERR(pfe_clk)) ++ return PTR_ERR(pfe_clk); ++ ++ /* PFE clock is (platform clock / 2) */ ++ /* save sys_clk value as KHz */ ++ pfe->ctrl.sys_clk = clk_get_rate(pfe_clk) / (2 * 1000); ++ ++ rc = pfe_probe(pfe); ++ if (rc < 0) ++ goto err_probe; ++ ++ return 0; ++ ++err_probe: ++err_prop: ++err_hif_irq: ++ iounmap(pfe->cbus_baseaddr); ++ ++err_axi: ++ iounmap(pfe->ddr_baseaddr); ++ ++err_ddr: ++ platform_set_drvdata(pdev, NULL); ++ ++ kfree(pfe); ++ ++err_alloc: ++ return rc; ++} ++ ++/* ++ * pfe_platform_remove - ++ */ ++static int pfe_platform_remove(struct platform_device *pdev) ++{ ++ struct pfe *pfe = platform_get_drvdata(pdev); ++ int rc; ++ ++ pr_info("%s\n", __func__); ++ ++ rc = pfe_remove(pfe); ++ ++ iounmap(pfe->cbus_baseaddr); ++ iounmap(pfe->ddr_baseaddr); ++ ++ platform_set_drvdata(pdev, NULL); ++ ++ kfree(pfe); ++ ++ return rc; ++} ++ ++#ifdef CONFIG_PM ++#ifdef CONFIG_PM_SLEEP ++int pfe_platform_suspend(struct device *dev) ++{ ++ struct pfe *pfe = platform_get_drvdata(to_platform_device(dev)); ++ struct net_device *netdev; ++ int i; ++ ++ pfe->wake = 0; ++ ++ for (i = 0; i < (NUM_GEMAC_SUPPORT); i++) { ++ netdev = pfe->eth.eth_priv[i]->ndev; ++ ++ netif_device_detach(netdev); ++ ++ if (netif_running(netdev)) ++ if (pfe_eth_suspend(netdev)) ++ pfe->wake = 1; ++ } ++ ++ /* Shutdown PFE only if we're not waking up the system */ ++ if (!pfe->wake) { ++#if defined(LS1012A_PFE_RESET_WA) ++ pfe_hif_rx_idle(&pfe->hif); ++#endif ++ pfe_ctrl_suspend(&pfe->ctrl); ++ pfe_firmware_exit(pfe); ++ ++ pfe_hif_exit(pfe); ++ pfe_hif_lib_exit(pfe); ++ ++ pfe_hw_exit(pfe); ++ } ++ ++ return 0; ++} ++ ++static int pfe_platform_resume(struct device *dev) ++{ ++ struct pfe *pfe = platform_get_drvdata(to_platform_device(dev)); ++ struct net_device *netdev; ++ int i; ++ ++ if (!pfe->wake) { ++ pfe_hw_init(pfe, 1); ++ pfe_hif_lib_init(pfe); ++ pfe_hif_init(pfe); ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ util_enable(); ++#endif ++ tmu_enable(0xf); ++ class_enable(); ++ pfe_ctrl_resume(&pfe->ctrl); ++ } ++ ++ for (i = 0; i < (NUM_GEMAC_SUPPORT); i++) { ++ netdev = pfe->eth.eth_priv[i]->ndev; ++ ++ if (pfe->eth.eth_priv[i]->mii_bus) ++ pfe_eth_mdio_reset(pfe->eth.eth_priv[i]->mii_bus); ++ ++ if (netif_running(netdev)) ++ pfe_eth_resume(netdev); ++ ++ netif_device_attach(netdev); ++ } ++ return 0; ++} ++#else ++#define pfe_platform_suspend NULL ++#define pfe_platform_resume NULL ++#endif ++ ++static const struct dev_pm_ops pfe_platform_pm_ops = { ++ SET_SYSTEM_SLEEP_PM_OPS(pfe_platform_suspend, pfe_platform_resume) ++}; ++#endif ++ ++static const struct of_device_id pfe_match[] = { ++ { ++ .compatible = "fsl,pfe", ++ }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, pfe_match); ++ ++static struct platform_driver pfe_platform_driver = { ++ .probe = pfe_platform_probe, ++ .remove = pfe_platform_remove, ++ .driver = { ++ .name = "pfe", ++ .of_match_table = pfe_match, ++#ifdef CONFIG_PM ++ .pm = &pfe_platform_pm_ops, ++#endif ++ }, ++}; ++ ++module_platform_driver(pfe_platform_driver); ++MODULE_LICENSE("GPL"); ++MODULE_DESCRIPTION("PFE Ethernet driver"); ++MODULE_AUTHOR("NXP DNCPE"); +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_mod.c +@@ -0,0 +1,141 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#include ++#include "pfe_mod.h" ++ ++struct pfe *pfe; ++ ++/* ++ * pfe_probe - ++ */ ++int pfe_probe(struct pfe *pfe) ++{ ++ int rc; ++ ++ if (pfe->ddr_size < DDR_MAX_SIZE) { ++ pr_err("%s: required DDR memory (%x) above platform ddr memory (%x)\n", ++ __func__, (unsigned int)DDR_MAX_SIZE, pfe->ddr_size); ++ rc = -ENOMEM; ++ goto err_hw; ++ } ++ ++ if (((int)(pfe->ddr_phys_baseaddr + BMU2_DDR_BASEADDR) & ++ (8 * SZ_1M - 1)) != 0) { ++ pr_err("%s: BMU2 base address (0x%x) must be aligned on 8MB boundary\n", ++ __func__, (int)pfe->ddr_phys_baseaddr + ++ BMU2_DDR_BASEADDR); ++ rc = -ENOMEM; ++ goto err_hw; ++ } ++ ++ pr_info("cbus_baseaddr: %lx, ddr_baseaddr: %lx, ddr_phys_baseaddr: %lx, ddr_size: %x\n", ++ (unsigned long)pfe->cbus_baseaddr, ++ (unsigned long)pfe->ddr_baseaddr, ++ pfe->ddr_phys_baseaddr, pfe->ddr_size); ++ ++ pfe_lib_init(pfe->cbus_baseaddr, pfe->ddr_baseaddr, ++ pfe->ddr_phys_baseaddr, pfe->ddr_size); ++ ++ rc = pfe_hw_init(pfe, 0); ++ if (rc < 0) ++ goto err_hw; ++ ++ rc = pfe_hif_lib_init(pfe); ++ if (rc < 0) ++ goto err_hif_lib; ++ ++ rc = pfe_hif_init(pfe); ++ if (rc < 0) ++ goto err_hif; ++ ++ rc = pfe_firmware_init(pfe); ++ if (rc < 0) ++ goto err_firmware; ++ ++ rc = pfe_ctrl_init(pfe); ++ if (rc < 0) ++ goto err_ctrl; ++ ++ rc = pfe_eth_init(pfe); ++ if (rc < 0) ++ goto err_eth; ++ ++ rc = pfe_sysfs_init(pfe); ++ if (rc < 0) ++ goto err_sysfs; ++ ++ rc = pfe_debugfs_init(pfe); ++ if (rc < 0) ++ goto err_debugfs; ++ ++ return 0; ++ ++err_debugfs: ++ pfe_sysfs_exit(pfe); ++ ++err_sysfs: ++ pfe_eth_exit(pfe); ++ ++err_eth: ++ pfe_ctrl_exit(pfe); ++ ++err_ctrl: ++ pfe_firmware_exit(pfe); ++ ++err_firmware: ++ pfe_hif_exit(pfe); ++ ++err_hif: ++ pfe_hif_lib_exit(pfe); ++ ++err_hif_lib: ++ pfe_hw_exit(pfe); ++ ++err_hw: ++ return rc; ++} ++ ++/* ++ * pfe_remove - ++ */ ++int pfe_remove(struct pfe *pfe) ++{ ++ pr_info("%s\n", __func__); ++ ++ pfe_debugfs_exit(pfe); ++ ++ pfe_sysfs_exit(pfe); ++ ++ pfe_eth_exit(pfe); ++ ++ pfe_ctrl_exit(pfe); ++ ++#if defined(LS1012A_PFE_RESET_WA) ++ pfe_hif_rx_idle(&pfe->hif); ++#endif ++ pfe_firmware_exit(pfe); ++ ++ pfe_hif_exit(pfe); ++ ++ pfe_hif_lib_exit(pfe); ++ ++ pfe_hw_exit(pfe); ++ ++ return 0; ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_mod.h +@@ -0,0 +1,112 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#ifndef _PFE_MOD_H_ ++#define _PFE_MOD_H_ ++ ++#include ++#include ++ ++struct pfe; ++ ++#include "pfe_hw.h" ++#include "pfe_firmware.h" ++#include "pfe_ctrl.h" ++#include "pfe_hif.h" ++#include "pfe_hif_lib.h" ++#include "pfe_eth.h" ++#include "pfe_sysfs.h" ++#include "pfe_perfmon.h" ++#include "pfe_debugfs.h" ++ ++#define PHYID_MAX_VAL 32 ++ ++struct pfe_tmu_credit { ++ /* Number of allowed TX packet in-flight, matches TMU queue size */ ++ unsigned int tx_credit[NUM_GEMAC_SUPPORT][EMAC_TXQ_CNT]; ++ unsigned int tx_credit_max[NUM_GEMAC_SUPPORT][EMAC_TXQ_CNT]; ++ unsigned int tx_packets[NUM_GEMAC_SUPPORT][EMAC_TXQ_CNT]; ++}; ++ ++struct pfe { ++ struct regmap *scfg; ++ unsigned long ddr_phys_baseaddr; ++ void *ddr_baseaddr; ++ unsigned int ddr_size; ++ void *cbus_baseaddr; ++ void *apb_baseaddr; ++ unsigned long iram_phys_baseaddr; ++ void *iram_baseaddr; ++ unsigned long ipsec_phys_baseaddr; ++ void *ipsec_baseaddr; ++ int hif_irq; ++ int wol_irq; ++ int hif_client_irq; ++ struct device *dev; ++ struct dentry *dentry; ++ struct pfe_ctrl ctrl; ++ struct pfe_hif hif; ++ struct pfe_eth eth; ++ struct hif_client_s *hif_client[HIF_CLIENTS_MAX]; ++#if defined(CFG_DIAGS) ++ struct pfe_diags diags; ++#endif ++ struct pfe_tmu_credit tmu_credit; ++ struct pfe_cpumon cpumon; ++ struct pfe_memmon memmon; ++ int wake; ++ int mdio_muxval[PHYID_MAX_VAL]; ++ struct clk *hfe_clock; ++}; ++ ++extern struct pfe *pfe; ++ ++int pfe_probe(struct pfe *pfe); ++int pfe_remove(struct pfe *pfe); ++ ++/* DDR Mapping in reserved memory*/ ++#define ROUTE_TABLE_BASEADDR 0 ++#define ROUTE_TABLE_HASH_BITS 15 /* 32K entries */ ++#define ROUTE_TABLE_SIZE ((1 << ROUTE_TABLE_HASH_BITS) \ ++ * CLASS_ROUTE_SIZE) ++#define BMU2_DDR_BASEADDR (ROUTE_TABLE_BASEADDR + ROUTE_TABLE_SIZE) ++#define BMU2_BUF_COUNT (4096 - 256) ++/* This is to get a total DDR size of 12MiB */ ++#define BMU2_DDR_SIZE (DDR_BUF_SIZE * BMU2_BUF_COUNT) ++#define UTIL_CODE_BASEADDR (BMU2_DDR_BASEADDR + BMU2_DDR_SIZE) ++#define UTIL_CODE_SIZE (128 * SZ_1K) ++#define UTIL_DDR_DATA_BASEADDR (UTIL_CODE_BASEADDR + UTIL_CODE_SIZE) ++#define UTIL_DDR_DATA_SIZE (64 * SZ_1K) ++#define CLASS_DDR_DATA_BASEADDR (UTIL_DDR_DATA_BASEADDR + UTIL_DDR_DATA_SIZE) ++#define CLASS_DDR_DATA_SIZE (32 * SZ_1K) ++#define TMU_DDR_DATA_BASEADDR (CLASS_DDR_DATA_BASEADDR + CLASS_DDR_DATA_SIZE) ++#define TMU_DDR_DATA_SIZE (32 * SZ_1K) ++#define TMU_LLM_BASEADDR (TMU_DDR_DATA_BASEADDR + TMU_DDR_DATA_SIZE) ++#define TMU_LLM_QUEUE_LEN (8 * 512) ++/* Must be power of two and at least 16 * 8 = 128 bytes */ ++#define TMU_LLM_SIZE (4 * 16 * TMU_LLM_QUEUE_LEN) ++/* (4 TMU's x 16 queues x queue_len) */ ++ ++#define DDR_MAX_SIZE (TMU_LLM_BASEADDR + TMU_LLM_SIZE) ++ ++/* LMEM Mapping */ ++#define BMU1_LMEM_BASEADDR 0 ++#define BMU1_BUF_COUNT 256 ++#define BMU1_LMEM_SIZE (LMEM_BUF_SIZE * BMU1_BUF_COUNT) ++ ++#endif /* _PFE_MOD_H */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_perfmon.h +@@ -0,0 +1,38 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#ifndef _PFE_PERFMON_H_ ++#define _PFE_PERFMON_H_ ++ ++#include "pfe/pfe.h" ++ ++#define CT_CPUMON_INTERVAL (1 * TIMER_TICKS_PER_SEC) ++ ++struct pfe_cpumon { ++ u32 cpu_usage_pct[MAX_PE]; ++ u32 class_usage_pct; ++}; ++ ++struct pfe_memmon { ++ u32 kernel_memory_allocated; ++}; ++ ++int pfe_perfmon_init(struct pfe *pfe); ++void pfe_perfmon_exit(struct pfe *pfe); ++ ++#endif /* _PFE_PERFMON_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_sysfs.c +@@ -0,0 +1,818 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#include ++#include ++ ++#include "pfe_mod.h" ++ ++#define PE_EXCEPTION_DUMP_ADDRESS 0x1fa8 ++#define NUM_QUEUES 16 ++ ++static char register_name[20][5] = { ++ "EPC", "ECAS", "EID", "ED", ++ "r0", "r1", "r2", "r3", ++ "r4", "r5", "r6", "r7", ++ "r8", "r9", "r10", "r11", ++ "r12", "r13", "r14", "r15", ++}; ++ ++static char exception_name[14][20] = { ++ "Reset", ++ "HardwareFailure", ++ "NMI", ++ "InstBreakpoint", ++ "DataBreakpoint", ++ "Unsupported", ++ "PrivilegeViolation", ++ "InstBusError", ++ "DataBusError", ++ "AlignmentError", ++ "ArithmeticError", ++ "SystemCall", ++ "MemoryManagement", ++ "Interrupt", ++}; ++ ++static unsigned long class_do_clear; ++static unsigned long tmu_do_clear; ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++static unsigned long util_do_clear; ++#endif ++ ++static ssize_t display_pe_status(char *buf, int id, u32 dmem_addr, unsigned long ++ do_clear) ++{ ++ ssize_t len = 0; ++ u32 val; ++ char statebuf[5]; ++ struct pfe_cpumon *cpumon = &pfe->cpumon; ++ u32 debug_indicator; ++ u32 debug[20]; ++ ++ *(u32 *)statebuf = pe_dmem_read(id, dmem_addr, 4); ++ dmem_addr += 4; ++ ++ statebuf[4] = '\0'; ++ len += sprintf(buf + len, "state=%4s ", statebuf); ++ ++ val = pe_dmem_read(id, dmem_addr, 4); ++ dmem_addr += 4; ++ len += sprintf(buf + len, "ctr=%08x ", cpu_to_be32(val)); ++ ++ val = pe_dmem_read(id, dmem_addr, 4); ++ if (do_clear && val) ++ pe_dmem_write(id, 0, dmem_addr, 4); ++ dmem_addr += 4; ++ len += sprintf(buf + len, "rx=%u ", cpu_to_be32(val)); ++ ++ val = pe_dmem_read(id, dmem_addr, 4); ++ if (do_clear && val) ++ pe_dmem_write(id, 0, dmem_addr, 4); ++ dmem_addr += 4; ++ if (id >= TMU0_ID && id <= TMU_MAX_ID) ++ len += sprintf(buf + len, "qstatus=%x", cpu_to_be32(val)); ++ else ++ len += sprintf(buf + len, "tx=%u", cpu_to_be32(val)); ++ ++ val = pe_dmem_read(id, dmem_addr, 4); ++ if (do_clear && val) ++ pe_dmem_write(id, 0, dmem_addr, 4); ++ dmem_addr += 4; ++ if (val) ++ len += sprintf(buf + len, " drop=%u", cpu_to_be32(val)); ++ ++ len += sprintf(buf + len, " load=%d%%", cpumon->cpu_usage_pct[id]); ++ ++ len += sprintf(buf + len, "\n"); ++ ++ debug_indicator = pe_dmem_read(id, dmem_addr, 4); ++ dmem_addr += 4; ++ if (!strncmp((char *)&debug_indicator, "DBUG", 4)) { ++ int j, last = 0; ++ ++ for (j = 0; j < 16; j++) { ++ debug[j] = pe_dmem_read(id, dmem_addr, 4); ++ if (debug[j]) { ++ if (do_clear) ++ pe_dmem_write(id, 0, dmem_addr, 4); ++ last = j + 1; ++ } ++ dmem_addr += 4; ++ } ++ for (j = 0; j < last; j++) { ++ len += sprintf(buf + len, "%08x%s", ++ cpu_to_be32(debug[j]), ++ (j & 0x7) == 0x7 || j == last - 1 ? "\n" : " "); ++ } ++ } ++ ++ if (!strncmp(statebuf, "DEAD", 4)) { ++ u32 i, dump = PE_EXCEPTION_DUMP_ADDRESS; ++ ++ len += sprintf(buf + len, "Exception details:\n"); ++ for (i = 0; i < 20; i++) { ++ debug[i] = pe_dmem_read(id, dump, 4); ++ dump += 4; ++ if (i == 2) ++ len += sprintf(buf + len, "%4s = %08x (=%s) ", ++ register_name[i], cpu_to_be32(debug[i]), ++ exception_name[min((u32) ++ cpu_to_be32(debug[i]), (u32)13)]); ++ else ++ len += sprintf(buf + len, "%4s = %08x%s", ++ register_name[i], cpu_to_be32(debug[i]), ++ (i & 0x3) == 0x3 || i == 19 ? "\n" : " "); ++ } ++ } ++ ++ return len; ++} ++ ++static ssize_t class_phy_stats(char *buf, int phy) ++{ ++ ssize_t len = 0; ++ int off1 = phy * 0x28; ++ int off2 = phy * 0x10; ++ ++ if (phy == 3) ++ off1 = CLASS_PHY4_RX_PKTS - CLASS_PHY1_RX_PKTS; ++ ++ len += sprintf(buf + len, "phy: %d\n", phy); ++ len += sprintf(buf + len, ++ " rx: %10u, tx: %10u, intf: %10u, ipv4: %10u, ipv6: %10u\n", ++ readl(CLASS_PHY1_RX_PKTS + off1), ++ readl(CLASS_PHY1_TX_PKTS + off1), ++ readl(CLASS_PHY1_INTF_MATCH_PKTS + off1), ++ readl(CLASS_PHY1_V4_PKTS + off1), ++ readl(CLASS_PHY1_V6_PKTS + off1)); ++ ++ len += sprintf(buf + len, ++ " icmp: %10u, igmp: %10u, tcp: %10u, udp: %10u\n", ++ readl(CLASS_PHY1_ICMP_PKTS + off2), ++ readl(CLASS_PHY1_IGMP_PKTS + off2), ++ readl(CLASS_PHY1_TCP_PKTS + off2), ++ readl(CLASS_PHY1_UDP_PKTS + off2)); ++ ++ len += sprintf(buf + len, " err\n"); ++ len += sprintf(buf + len, ++ " lp: %10u, intf: %10u, l3: %10u, chcksum: %10u, ttl: %10u\n", ++ readl(CLASS_PHY1_LP_FAIL_PKTS + off1), ++ readl(CLASS_PHY1_INTF_FAIL_PKTS + off1), ++ readl(CLASS_PHY1_L3_FAIL_PKTS + off1), ++ readl(CLASS_PHY1_CHKSUM_ERR_PKTS + off1), ++ readl(CLASS_PHY1_TTL_ERR_PKTS + off1)); ++ ++ return len; ++} ++ ++/* qm_read_drop_stat ++ * This function is used to read the drop statistics from the TMU ++ * hw drop counter. Since the hw counter is always cleared afer ++ * reading, this function maintains the previous drop count, and ++ * adds the new value to it. That value can be retrieved by ++ * passing a pointer to it with the total_drops arg. ++ * ++ * @param tmu TMU number (0 - 3) ++ * @param queue queue number (0 - 15) ++ * @param total_drops pointer to location to store total drops (or NULL) ++ * @param do_reset if TRUE, clear total drops after updating ++ */ ++u32 qm_read_drop_stat(u32 tmu, u32 queue, u32 *total_drops, int do_reset) ++{ ++ static u32 qtotal[TMU_MAX_ID + 1][NUM_QUEUES]; ++ u32 val; ++ ++ writel((tmu << 8) | queue, TMU_TEQ_CTRL); ++ writel((tmu << 8) | queue, TMU_LLM_CTRL); ++ val = readl(TMU_TEQ_DROP_STAT); ++ qtotal[tmu][queue] += val; ++ if (total_drops) ++ *total_drops = qtotal[tmu][queue]; ++ if (do_reset) ++ qtotal[tmu][queue] = 0; ++ return val; ++} ++ ++static ssize_t tmu_queue_stats(char *buf, int tmu, int queue) ++{ ++ ssize_t len = 0; ++ u32 drops; ++ ++ len += sprintf(buf + len, "%d-%02d, ", tmu, queue); ++ ++ drops = qm_read_drop_stat(tmu, queue, NULL, 0); ++ ++ /* Select queue */ ++ writel((tmu << 8) | queue, TMU_TEQ_CTRL); ++ writel((tmu << 8) | queue, TMU_LLM_CTRL); ++ ++ len += sprintf(buf + len, ++ "(teq) drop: %10u, tx: %10u (llm) head: %08x, tail: %08x, drop: %10u\n", ++ drops, readl(TMU_TEQ_TRANS_STAT), ++ readl(TMU_LLM_QUE_HEADPTR), readl(TMU_LLM_QUE_TAILPTR), ++ readl(TMU_LLM_QUE_DROPCNT)); ++ ++ return len; ++} ++ ++static ssize_t tmu_queues(char *buf, int tmu) ++{ ++ ssize_t len = 0; ++ int queue; ++ ++ for (queue = 0; queue < 16; queue++) ++ len += tmu_queue_stats(buf + len, tmu, queue); ++ ++ return len; ++} ++ ++static ssize_t block_version(char *buf, void *addr) ++{ ++ ssize_t len = 0; ++ u32 val; ++ ++ val = readl(addr); ++ len += sprintf(buf + len, "revision: %x, version: %x, id: %x\n", ++ (val >> 24) & 0xff, (val >> 16) & 0xff, val & 0xffff); ++ ++ return len; ++} ++ ++static ssize_t bmu(char *buf, int id, void *base) ++{ ++ ssize_t len = 0; ++ ++ len += sprintf(buf + len, "%s: %d\n ", __func__, id); ++ ++ len += block_version(buf + len, base + BMU_VERSION); ++ ++ len += sprintf(buf + len, " buf size: %x\n", (1 << readl(base + ++ BMU_BUF_SIZE))); ++ len += sprintf(buf + len, " buf count: %x\n", readl(base + ++ BMU_BUF_CNT)); ++ len += sprintf(buf + len, " buf rem: %x\n", readl(base + ++ BMU_REM_BUF_CNT)); ++ len += sprintf(buf + len, " buf curr: %x\n", readl(base + ++ BMU_CURR_BUF_CNT)); ++ len += sprintf(buf + len, " free err: %x\n", readl(base + ++ BMU_FREE_ERR_ADDR)); ++ ++ return len; ++} ++ ++static ssize_t gpi(char *buf, int id, void *base) ++{ ++ ssize_t len = 0; ++ u32 val; ++ ++ len += sprintf(buf + len, "%s%d:\n ", __func__, id); ++ len += block_version(buf + len, base + GPI_VERSION); ++ ++ len += sprintf(buf + len, " tx under stick: %x\n", readl(base + ++ GPI_FIFO_STATUS)); ++ val = readl(base + GPI_FIFO_DEBUG); ++ len += sprintf(buf + len, " tx pkts: %x\n", (val >> 23) & ++ 0x3f); ++ len += sprintf(buf + len, " rx pkts: %x\n", (val >> 18) & ++ 0x3f); ++ len += sprintf(buf + len, " tx bytes: %x\n", (val >> 9) & ++ 0x1ff); ++ len += sprintf(buf + len, " rx bytes: %x\n", (val >> 0) & ++ 0x1ff); ++ len += sprintf(buf + len, " overrun: %x\n", readl(base + ++ GPI_OVERRUN_DROPCNT)); ++ ++ return len; ++} ++ ++static ssize_t pfe_set_class(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ class_do_clear = kstrtoul(buf, 0, 0); ++ return count; ++} ++ ++static ssize_t pfe_show_class(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ int id; ++ u32 val; ++ struct pfe_cpumon *cpumon = &pfe->cpumon; ++ ++ len += block_version(buf + len, CLASS_VERSION); ++ ++ for (id = CLASS0_ID; id <= CLASS_MAX_ID; id++) { ++ len += sprintf(buf + len, "%d: ", id - CLASS0_ID); ++ ++ val = readl(CLASS_PE0_DEBUG + id * 4); ++ len += sprintf(buf + len, "pc=1%04x ", val & 0xffff); ++ ++ len += display_pe_status(buf + len, id, CLASS_DM_PESTATUS, ++ class_do_clear); ++ } ++ len += sprintf(buf + len, "aggregate load=%d%%\n\n", ++ cpumon->class_usage_pct); ++ ++ len += sprintf(buf + len, "pe status: 0x%x\n", ++ readl(CLASS_PE_STATUS)); ++ len += sprintf(buf + len, "max buf cnt: 0x%x afull thres: 0x%x\n", ++ readl(CLASS_MAX_BUF_CNT), readl(CLASS_AFULL_THRES)); ++ len += sprintf(buf + len, "tsq max cnt: 0x%x tsq fifo thres: 0x%x\n", ++ readl(CLASS_TSQ_MAX_CNT), readl(CLASS_TSQ_FIFO_THRES)); ++ len += sprintf(buf + len, "state: 0x%x\n", readl(CLASS_STATE)); ++ ++ len += class_phy_stats(buf + len, 0); ++ len += class_phy_stats(buf + len, 1); ++ len += class_phy_stats(buf + len, 2); ++ len += class_phy_stats(buf + len, 3); ++ ++ return len; ++} ++ ++static ssize_t pfe_set_tmu(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ tmu_do_clear = kstrtoul(buf, 0, 0); ++ return count; ++} ++ ++static ssize_t pfe_show_tmu(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ int id; ++ u32 val; ++ ++ len += block_version(buf + len, TMU_VERSION); ++ ++ for (id = TMU0_ID; id <= TMU_MAX_ID; id++) { ++ if (id == TMU2_ID) ++ continue; ++ len += sprintf(buf + len, "%d: ", id - TMU0_ID); ++ ++ len += display_pe_status(buf + len, id, TMU_DM_PESTATUS, ++ tmu_do_clear); ++ } ++ ++ len += sprintf(buf + len, "pe status: %x\n", readl(TMU_PE_STATUS)); ++ len += sprintf(buf + len, "inq fifo cnt: %x\n", ++ readl(TMU_PHY_INQ_FIFO_CNT)); ++ val = readl(TMU_INQ_STAT); ++ len += sprintf(buf + len, "inq wr ptr: %x\n", val & 0x3ff); ++ len += sprintf(buf + len, "inq rd ptr: %x\n", val >> 10); ++ ++ return len; ++} ++ ++static unsigned long drops_do_clear; ++static u32 class_drop_counter[CLASS_NUM_DROP_COUNTERS]; ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++static u32 util_drop_counter[UTIL_NUM_DROP_COUNTERS]; ++#endif ++ ++char *class_drop_description[CLASS_NUM_DROP_COUNTERS] = { ++ "ICC", ++ "Host Pkt Error", ++ "Rx Error", ++ "IPsec Outbound", ++ "IPsec Inbound", ++ "EXPT IPsec Error", ++ "Reassembly", ++ "Fragmenter", ++ "NAT-T", ++ "Socket", ++ "Multicast", ++ "NAT-PT", ++ "Tx Disabled", ++}; ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++char *util_drop_description[UTIL_NUM_DROP_COUNTERS] = { ++ "IPsec Outbound", ++ "IPsec Inbound", ++ "IPsec Rate Limiter", ++ "Fragmenter", ++ "Socket", ++ "Tx Disabled", ++ "Rx Error", ++}; ++#endif ++ ++static ssize_t pfe_set_drops(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ drops_do_clear = kstrtoul(buf, 0, 0); ++ return count; ++} ++ ++static u32 tmu_drops[4][16]; ++static ssize_t pfe_show_drops(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ int id, dropnum; ++ int tmu, queue; ++ u32 val; ++ u32 dmem_addr; ++ int num_class_drops = 0, num_tmu_drops = 0, num_util_drops = 0; ++ struct pfe_ctrl *ctrl = &pfe->ctrl; ++ ++ memset(class_drop_counter, 0, sizeof(class_drop_counter)); ++ for (id = CLASS0_ID; id <= CLASS_MAX_ID; id++) { ++ if (drops_do_clear) ++ pe_sync_stop(ctrl, (1 << id)); ++ for (dropnum = 0; dropnum < CLASS_NUM_DROP_COUNTERS; ++ dropnum++) { ++ dmem_addr = CLASS_DM_DROP_CNTR; ++ val = be32_to_cpu(pe_dmem_read(id, dmem_addr, 4)); ++ class_drop_counter[dropnum] += val; ++ num_class_drops += val; ++ if (drops_do_clear) ++ pe_dmem_write(id, 0, dmem_addr, 4); ++ } ++ if (drops_do_clear) ++ pe_start(ctrl, (1 << id)); ++ } ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ if (drops_do_clear) ++ pe_sync_stop(ctrl, (1 << UTIL_ID)); ++ for (dropnum = 0; dropnum < UTIL_NUM_DROP_COUNTERS; dropnum++) { ++ dmem_addr = UTIL_DM_DROP_CNTR; ++ val = be32_to_cpu(pe_dmem_read(UTIL_ID, dmem_addr, 4)); ++ util_drop_counter[dropnum] = val; ++ num_util_drops += val; ++ if (drops_do_clear) ++ pe_dmem_write(UTIL_ID, 0, dmem_addr, 4); ++ } ++ if (drops_do_clear) ++ pe_start(ctrl, (1 << UTIL_ID)); ++#endif ++ for (tmu = 0; tmu < 4; tmu++) { ++ for (queue = 0; queue < 16; queue++) { ++ qm_read_drop_stat(tmu, queue, &tmu_drops[tmu][queue], ++ drops_do_clear); ++ num_tmu_drops += tmu_drops[tmu][queue]; ++ } ++ } ++ ++ if (num_class_drops == 0 && num_util_drops == 0 && num_tmu_drops == 0) ++ len += sprintf(buf + len, "No PE drops\n\n"); ++ ++ if (num_class_drops > 0) { ++ len += sprintf(buf + len, "Class PE drops --\n"); ++ for (dropnum = 0; dropnum < CLASS_NUM_DROP_COUNTERS; ++ dropnum++) { ++ if (class_drop_counter[dropnum] > 0) ++ len += sprintf(buf + len, " %s: %d\n", ++ class_drop_description[dropnum], ++ class_drop_counter[dropnum]); ++ } ++ len += sprintf(buf + len, "\n"); ++ } ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ if (num_util_drops > 0) { ++ len += sprintf(buf + len, "Util PE drops --\n"); ++ for (dropnum = 0; dropnum < UTIL_NUM_DROP_COUNTERS; dropnum++) { ++ if (util_drop_counter[dropnum] > 0) ++ len += sprintf(buf + len, " %s: %d\n", ++ util_drop_description[dropnum], ++ util_drop_counter[dropnum]); ++ } ++ len += sprintf(buf + len, "\n"); ++ } ++#endif ++ if (num_tmu_drops > 0) { ++ len += sprintf(buf + len, "TMU drops --\n"); ++ for (tmu = 0; tmu < 4; tmu++) { ++ for (queue = 0; queue < 16; queue++) { ++ if (tmu_drops[tmu][queue] > 0) ++ len += sprintf(buf + len, ++ " TMU%d-Q%d: %d\n" ++ , tmu, queue, tmu_drops[tmu][queue]); ++ } ++ } ++ len += sprintf(buf + len, "\n"); ++ } ++ ++ return len; ++} ++ ++static ssize_t pfe_show_tmu0_queues(struct device *dev, struct device_attribute ++ *attr, char *buf) ++{ ++ return tmu_queues(buf, 0); ++} ++ ++static ssize_t pfe_show_tmu1_queues(struct device *dev, struct device_attribute ++ *attr, char *buf) ++{ ++ return tmu_queues(buf, 1); ++} ++ ++static ssize_t pfe_show_tmu2_queues(struct device *dev, struct device_attribute ++ *attr, char *buf) ++{ ++ return tmu_queues(buf, 2); ++} ++ ++static ssize_t pfe_show_tmu3_queues(struct device *dev, struct device_attribute ++ *attr, char *buf) ++{ ++ return tmu_queues(buf, 3); ++} ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++static ssize_t pfe_set_util(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ util_do_clear = kstrtoul(buf, NULL, 0); ++ return count; ++} ++ ++static ssize_t pfe_show_util(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ struct pfe_ctrl *ctrl = &pfe->ctrl; ++ ++ len += block_version(buf + len, UTIL_VERSION); ++ ++ pe_sync_stop(ctrl, (1 << UTIL_ID)); ++ len += display_pe_status(buf + len, UTIL_ID, UTIL_DM_PESTATUS, ++ util_do_clear); ++ pe_start(ctrl, (1 << UTIL_ID)); ++ ++ len += sprintf(buf + len, "pe status: %x\n", readl(UTIL_PE_STATUS)); ++ len += sprintf(buf + len, "max buf cnt: %x\n", ++ readl(UTIL_MAX_BUF_CNT)); ++ len += sprintf(buf + len, "tsq max cnt: %x\n", ++ readl(UTIL_TSQ_MAX_CNT)); ++ ++ return len; ++} ++#endif ++ ++static ssize_t pfe_show_bmu(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ ++ len += bmu(buf + len, 1, BMU1_BASE_ADDR); ++ len += bmu(buf + len, 2, BMU2_BASE_ADDR); ++ ++ return len; ++} ++ ++static ssize_t pfe_show_hif(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ ++ len += sprintf(buf + len, "hif:\n "); ++ len += block_version(buf + len, HIF_VERSION); ++ ++ len += sprintf(buf + len, " tx curr bd: %x\n", ++ readl(HIF_TX_CURR_BD_ADDR)); ++ len += sprintf(buf + len, " tx status: %x\n", ++ readl(HIF_TX_STATUS)); ++ len += sprintf(buf + len, " tx dma status: %x\n", ++ readl(HIF_TX_DMA_STATUS)); ++ ++ len += sprintf(buf + len, " rx curr bd: %x\n", ++ readl(HIF_RX_CURR_BD_ADDR)); ++ len += sprintf(buf + len, " rx status: %x\n", ++ readl(HIF_RX_STATUS)); ++ len += sprintf(buf + len, " rx dma status: %x\n", ++ readl(HIF_RX_DMA_STATUS)); ++ ++ len += sprintf(buf + len, "hif nocopy:\n "); ++ len += block_version(buf + len, HIF_NOCPY_VERSION); ++ ++ len += sprintf(buf + len, " tx curr bd: %x\n", ++ readl(HIF_NOCPY_TX_CURR_BD_ADDR)); ++ len += sprintf(buf + len, " tx status: %x\n", ++ readl(HIF_NOCPY_TX_STATUS)); ++ len += sprintf(buf + len, " tx dma status: %x\n", ++ readl(HIF_NOCPY_TX_DMA_STATUS)); ++ ++ len += sprintf(buf + len, " rx curr bd: %x\n", ++ readl(HIF_NOCPY_RX_CURR_BD_ADDR)); ++ len += sprintf(buf + len, " rx status: %x\n", ++ readl(HIF_NOCPY_RX_STATUS)); ++ len += sprintf(buf + len, " rx dma status: %x\n", ++ readl(HIF_NOCPY_RX_DMA_STATUS)); ++ ++ return len; ++} ++ ++static ssize_t pfe_show_gpi(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ ++ len += gpi(buf + len, 0, EGPI1_BASE_ADDR); ++ len += gpi(buf + len, 1, EGPI2_BASE_ADDR); ++ len += gpi(buf + len, 3, HGPI_BASE_ADDR); ++ ++ return len; ++} ++ ++static ssize_t pfe_show_pfemem(struct device *dev, struct device_attribute ++ *attr, char *buf) ++{ ++ ssize_t len = 0; ++ struct pfe_memmon *memmon = &pfe->memmon; ++ ++ len += sprintf(buf + len, "Kernel Memory: %d Bytes (%d KB)\n", ++ memmon->kernel_memory_allocated, ++ (memmon->kernel_memory_allocated + 1023) / 1024); ++ ++ return len; ++} ++ ++#ifdef HIF_NAPI_STATS ++static ssize_t pfe_show_hif_napi_stats(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ struct platform_device *pdev = to_platform_device(dev); ++ struct pfe *pfe = platform_get_drvdata(pdev); ++ ssize_t len = 0; ++ ++ len += sprintf(buf + len, "sched: %u\n", ++ pfe->hif.napi_counters[NAPI_SCHED_COUNT]); ++ len += sprintf(buf + len, "poll: %u\n", ++ pfe->hif.napi_counters[NAPI_POLL_COUNT]); ++ len += sprintf(buf + len, "packet: %u\n", ++ pfe->hif.napi_counters[NAPI_PACKET_COUNT]); ++ len += sprintf(buf + len, "budget: %u\n", ++ pfe->hif.napi_counters[NAPI_FULL_BUDGET_COUNT]); ++ len += sprintf(buf + len, "desc: %u\n", ++ pfe->hif.napi_counters[NAPI_DESC_COUNT]); ++ len += sprintf(buf + len, "full: %u\n", ++ pfe->hif.napi_counters[NAPI_CLIENT_FULL_COUNT]); ++ ++ return len; ++} ++ ++static ssize_t pfe_set_hif_napi_stats(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct platform_device *pdev = to_platform_device(dev); ++ struct pfe *pfe = platform_get_drvdata(pdev); ++ ++ memset(pfe->hif.napi_counters, 0, sizeof(pfe->hif.napi_counters)); ++ ++ return count; ++} ++ ++static DEVICE_ATTR(hif_napi_stats, 0644, pfe_show_hif_napi_stats, ++ pfe_set_hif_napi_stats); ++#endif ++ ++static DEVICE_ATTR(class, 0644, pfe_show_class, pfe_set_class); ++static DEVICE_ATTR(tmu, 0644, pfe_show_tmu, pfe_set_tmu); ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++static DEVICE_ATTR(util, 0644, pfe_show_util, pfe_set_util); ++#endif ++static DEVICE_ATTR(bmu, 0444, pfe_show_bmu, NULL); ++static DEVICE_ATTR(hif, 0444, pfe_show_hif, NULL); ++static DEVICE_ATTR(gpi, 0444, pfe_show_gpi, NULL); ++static DEVICE_ATTR(drops, 0644, pfe_show_drops, pfe_set_drops); ++static DEVICE_ATTR(tmu0_queues, 0444, pfe_show_tmu0_queues, NULL); ++static DEVICE_ATTR(tmu1_queues, 0444, pfe_show_tmu1_queues, NULL); ++static DEVICE_ATTR(tmu2_queues, 0444, pfe_show_tmu2_queues, NULL); ++static DEVICE_ATTR(tmu3_queues, 0444, pfe_show_tmu3_queues, NULL); ++static DEVICE_ATTR(pfemem, 0444, pfe_show_pfemem, NULL); ++ ++int pfe_sysfs_init(struct pfe *pfe) ++{ ++ if (device_create_file(pfe->dev, &dev_attr_class)) ++ goto err_class; ++ ++ if (device_create_file(pfe->dev, &dev_attr_tmu)) ++ goto err_tmu; ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ if (device_create_file(pfe->dev, &dev_attr_util)) ++ goto err_util; ++#endif ++ ++ if (device_create_file(pfe->dev, &dev_attr_bmu)) ++ goto err_bmu; ++ ++ if (device_create_file(pfe->dev, &dev_attr_hif)) ++ goto err_hif; ++ ++ if (device_create_file(pfe->dev, &dev_attr_gpi)) ++ goto err_gpi; ++ ++ if (device_create_file(pfe->dev, &dev_attr_drops)) ++ goto err_drops; ++ ++ if (device_create_file(pfe->dev, &dev_attr_tmu0_queues)) ++ goto err_tmu0_queues; ++ ++ if (device_create_file(pfe->dev, &dev_attr_tmu1_queues)) ++ goto err_tmu1_queues; ++ ++ if (device_create_file(pfe->dev, &dev_attr_tmu2_queues)) ++ goto err_tmu2_queues; ++ ++ if (device_create_file(pfe->dev, &dev_attr_tmu3_queues)) ++ goto err_tmu3_queues; ++ ++ if (device_create_file(pfe->dev, &dev_attr_pfemem)) ++ goto err_pfemem; ++ ++#ifdef HIF_NAPI_STATS ++ if (device_create_file(pfe->dev, &dev_attr_hif_napi_stats)) ++ goto err_hif_napi_stats; ++#endif ++ ++ return 0; ++ ++#ifdef HIF_NAPI_STATS ++err_hif_napi_stats: ++ device_remove_file(pfe->dev, &dev_attr_pfemem); ++#endif ++ ++err_pfemem: ++ device_remove_file(pfe->dev, &dev_attr_tmu3_queues); ++ ++err_tmu3_queues: ++ device_remove_file(pfe->dev, &dev_attr_tmu2_queues); ++ ++err_tmu2_queues: ++ device_remove_file(pfe->dev, &dev_attr_tmu1_queues); ++ ++err_tmu1_queues: ++ device_remove_file(pfe->dev, &dev_attr_tmu0_queues); ++ ++err_tmu0_queues: ++ device_remove_file(pfe->dev, &dev_attr_drops); ++ ++err_drops: ++ device_remove_file(pfe->dev, &dev_attr_gpi); ++ ++err_gpi: ++ device_remove_file(pfe->dev, &dev_attr_hif); ++ ++err_hif: ++ device_remove_file(pfe->dev, &dev_attr_bmu); ++ ++err_bmu: ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ device_remove_file(pfe->dev, &dev_attr_util); ++ ++err_util: ++#endif ++ device_remove_file(pfe->dev, &dev_attr_tmu); ++ ++err_tmu: ++ device_remove_file(pfe->dev, &dev_attr_class); ++ ++err_class: ++ return -1; ++} ++ ++void pfe_sysfs_exit(struct pfe *pfe) ++{ ++#ifdef HIF_NAPI_STATS ++ device_remove_file(pfe->dev, &dev_attr_hif_napi_stats); ++#endif ++ device_remove_file(pfe->dev, &dev_attr_pfemem); ++ device_remove_file(pfe->dev, &dev_attr_tmu3_queues); ++ device_remove_file(pfe->dev, &dev_attr_tmu2_queues); ++ device_remove_file(pfe->dev, &dev_attr_tmu1_queues); ++ device_remove_file(pfe->dev, &dev_attr_tmu0_queues); ++ device_remove_file(pfe->dev, &dev_attr_drops); ++ device_remove_file(pfe->dev, &dev_attr_gpi); ++ device_remove_file(pfe->dev, &dev_attr_hif); ++ device_remove_file(pfe->dev, &dev_attr_bmu); ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ device_remove_file(pfe->dev, &dev_attr_util); ++#endif ++ device_remove_file(pfe->dev, &dev_attr_tmu); ++ device_remove_file(pfe->dev, &dev_attr_class); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_sysfs.h +@@ -0,0 +1,29 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (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, see . ++ */ ++ ++#ifndef _PFE_SYSFS_H_ ++#define _PFE_SYSFS_H_ ++ ++#include ++ ++u32 qm_read_drop_stat(u32 tmu, u32 queue, u32 *total_drops, int do_reset); ++ ++int pfe_sysfs_init(struct pfe *pfe); ++void pfe_sysfs_exit(struct pfe *pfe); ++ ++#endif /* _PFE_SYSFS_H_ */ diff --git a/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch b/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch index 79103a273b..6deb5f9756 100644 --- a/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch @@ -1,4 +1,4 @@ -From 0a5b97d1f524c1769b4059e3c7123b52755f7121 Mon Sep 17 00:00:00 2001 +From 9c9579d76ccd6e738ab98c9b4c73c168912cdb8a Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Wed, 27 Sep 2017 15:02:01 +0800 Subject: [PATCH] crypto: support layerscape @@ -54,7 +54,7 @@ Signed-off-by: Yangbo Lu drivers/crypto/caam/compat.h | 1 + drivers/crypto/caam/ctrl.c | 356 +- drivers/crypto/caam/ctrl.h | 2 + - drivers/crypto/caam/desc.h | 52 +- + drivers/crypto/caam/desc.h | 55 +- drivers/crypto/caam/desc_constr.h | 139 +- drivers/crypto/caam/dpseci.c | 859 ++++ drivers/crypto/caam/dpseci.h | 395 ++ @@ -62,7 +62,8 @@ Signed-off-by: Yangbo Lu drivers/crypto/caam/error.c | 127 +- drivers/crypto/caam/error.h | 10 +- drivers/crypto/caam/intern.h | 31 +- - drivers/crypto/caam/jr.c | 55 +- + drivers/crypto/caam/jr.c | 97 +- + drivers/crypto/caam/jr.h | 2 + drivers/crypto/caam/key_gen.c | 32 +- drivers/crypto/caam/key_gen.h | 36 +- drivers/crypto/caam/pdb.h | 62 + @@ -83,7 +84,7 @@ Signed-off-by: Yangbo Lu include/uapi/linux/cryptouser.h | 5 + scripts/spelling.txt | 3 + sound/soc/amd/acp-pcm-dma.c | 2 +- - 54 files changed, 17263 insertions(+), 3955 deletions(-) + 55 files changed, 17310 insertions(+), 3955 deletions(-) create mode 100644 crypto/acompress.c create mode 100644 crypto/scompress.c create mode 100644 crypto/tls.c @@ -776,7 +777,7 @@ Signed-off-by: Yangbo Lu }; struct tcrypt_result { -@@ -1329,6 +1329,10 @@ static int do_test(const char *alg, u32 +@@ -1331,6 +1331,10 @@ static int do_test(const char *alg, u32 ret += tcrypt_test("hmac(sha3-512)"); break; @@ -787,7 +788,7 @@ Signed-off-by: Yangbo Lu case 150: ret += tcrypt_test("ansi_cprng"); break; -@@ -1390,6 +1394,9 @@ static int do_test(const char *alg, u32 +@@ -1392,6 +1396,9 @@ static int do_test(const char *alg, u32 case 190: ret += tcrypt_test("authenc(hmac(sha512),cbc(des3_ede))"); break; @@ -797,7 +798,7 @@ Signed-off-by: Yangbo Lu case 200: test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0, speed_template_16_24_32); -@@ -1404,9 +1411,9 @@ static int do_test(const char *alg, u32 +@@ -1406,9 +1413,9 @@ static int do_test(const char *alg, u32 test_cipher_speed("lrw(aes)", DECRYPT, sec, NULL, 0, speed_template_32_40_48); test_cipher_speed("xts(aes)", ENCRYPT, sec, NULL, 0, @@ -809,7 +810,7 @@ Signed-off-by: Yangbo Lu test_cipher_speed("cts(cbc(aes))", ENCRYPT, sec, NULL, 0, speed_template_16_24_32); test_cipher_speed("cts(cbc(aes))", DECRYPT, sec, NULL, 0, -@@ -1837,9 +1844,9 @@ static int do_test(const char *alg, u32 +@@ -1839,9 +1846,9 @@ static int do_test(const char *alg, u32 test_acipher_speed("lrw(aes)", DECRYPT, sec, NULL, 0, speed_template_32_40_48); test_acipher_speed("xts(aes)", ENCRYPT, sec, NULL, 0, @@ -15259,9 +15260,9 @@ Signed-off-by: Yangbo Lu +} + +/* -+ * qi_cache_alloc - Allocate buffers from CAAM-QI cache ++ * qi_cache_zalloc - Allocate buffers from CAAM-QI cache + * -+ * Allocate data on the hotpath. Instead of using kmalloc, one can use the ++ * Allocate data on the hotpath. Instead of using kzalloc, one can use the + * services of the CAAM QI memory cache (backed by kmem_cache). The buffers + * will have a size of CAAM_QI_MEMCACHE_SIZE, which should be sufficient for + * hosting 16 SG entries. @@ -15270,15 +15271,15 @@ Signed-off-by: Yangbo Lu + * + * Returns a pointer to a retrieved buffer on success or NULL on failure. + */ -+static inline void *qi_cache_alloc(gfp_t flags) ++static inline void *qi_cache_zalloc(gfp_t flags) +{ -+ return kmem_cache_alloc(qi_cache, flags); ++ return kmem_cache_zalloc(qi_cache, flags); +} + +/* + * qi_cache_free - Frees buffers allocated from CAAM-QI cache + * -+ * @obj - buffer previously allocated by qi_cache_alloc ++ * @obj - buffer previously allocated by qi_cache_zalloc + * + * No checking is being done, the call is a passthrough call to + * kmem_cache_free(...) @@ -15690,7 +15691,7 @@ Signed-off-by: Yangbo Lu + enum optype op_type = encrypt ? ENCRYPT : DECRYPT; + + /* allocate space for base edesc and link tables */ -+ edesc = qi_cache_alloc(GFP_DMA | flags); ++ edesc = qi_cache_zalloc(GFP_DMA | flags); + if (unlikely(!edesc)) { + dev_err(dev, "could not allocate extended descriptor\n"); + return ERR_PTR(-ENOMEM); @@ -15895,7 +15896,7 @@ Signed-off-by: Yangbo Lu + } + + /* allocate space for base edesc and link tables */ -+ edesc = qi_cache_alloc(GFP_DMA | flags); ++ edesc = qi_cache_zalloc(GFP_DMA | flags); + if (unlikely(!edesc)) { + dev_err(dev, "could not allocate extended descriptor\n"); + return ERR_PTR(-ENOMEM); @@ -16761,7 +16762,7 @@ Signed-off-by: Yangbo Lu + } + + /* allocate space for base edesc and link tables */ -+ edesc = qi_cache_alloc(GFP_DMA | flags); ++ edesc = qi_cache_zalloc(GFP_DMA | flags); + if (unlikely(!edesc)) { + dev_err(dev, "could not allocate extended descriptor\n"); + caam_unmap(dev, req->src, req->dst, src_nents, dst_nents, @@ -16916,7 +16917,7 @@ Signed-off-by: Yangbo Lu + } + + /* allocate space for base edesc and link tables */ -+ edesc = qi_cache_alloc(GFP_DMA | flags); ++ edesc = qi_cache_zalloc(GFP_DMA | flags); + if (!edesc) { + dev_err(dev, "could not allocate extended descriptor\n"); + caam_unmap(dev, req->src, req->dst, src_nents, dst_nents, @@ -22122,7 +22123,15 @@ Signed-off-by: Yangbo Lu #define LDST_SRCDST_WORD_ALTDS_CLASS1 (0x0f << LDST_SRCDST_SHIFT) #define LDST_SRCDST_WORD_PKHA_A_SZ (0x10 << LDST_SRCDST_SHIFT) #define LDST_SRCDST_WORD_PKHA_B_SZ (0x11 << LDST_SRCDST_SHIFT) -@@ -400,7 +395,7 @@ struct sec4_sg_entry { +@@ -360,6 +355,7 @@ struct sec4_sg_entry { + #define FIFOLD_TYPE_PK_N (0x08 << FIFOLD_TYPE_SHIFT) + #define FIFOLD_TYPE_PK_A (0x0c << FIFOLD_TYPE_SHIFT) + #define FIFOLD_TYPE_PK_B (0x0d << FIFOLD_TYPE_SHIFT) ++#define FIFOLD_TYPE_IFIFO (0x0f << FIFOLD_TYPE_SHIFT) + + /* Other types. Need to OR in last/flush bits as desired */ + #define FIFOLD_TYPE_MSG_MASK (0x38 << FIFOLD_TYPE_SHIFT) +@@ -400,7 +396,7 @@ struct sec4_sg_entry { #define FIFOST_TYPE_PKHA_N (0x08 << FIFOST_TYPE_SHIFT) #define FIFOST_TYPE_PKHA_A (0x0c << FIFOST_TYPE_SHIFT) #define FIFOST_TYPE_PKHA_B (0x0d << FIFOST_TYPE_SHIFT) @@ -22131,7 +22140,15 @@ Signed-off-by: Yangbo Lu #define FIFOST_TYPE_AF_SBOX_TKEK (0x21 << FIFOST_TYPE_SHIFT) #define FIFOST_TYPE_PKHA_E_JKEK (0x22 << FIFOST_TYPE_SHIFT) #define FIFOST_TYPE_PKHA_E_TKEK (0x23 << FIFOST_TYPE_SHIFT) -@@ -1107,8 +1102,8 @@ struct sec4_sg_entry { +@@ -413,6 +409,7 @@ struct sec4_sg_entry { + #define FIFOST_TYPE_MESSAGE_DATA (0x30 << FIFOST_TYPE_SHIFT) + #define FIFOST_TYPE_RNGSTORE (0x34 << FIFOST_TYPE_SHIFT) + #define FIFOST_TYPE_RNGFIFO (0x35 << FIFOST_TYPE_SHIFT) ++#define FIFOST_TYPE_METADATA (0x3e << FIFOST_TYPE_SHIFT) + #define FIFOST_TYPE_SKIP (0x3f << FIFOST_TYPE_SHIFT) + + /* +@@ -1107,8 +1104,8 @@ struct sec4_sg_entry { /* For non-protocol/alg-only op commands */ #define OP_ALG_TYPE_SHIFT 24 #define OP_ALG_TYPE_MASK (0x7 << OP_ALG_TYPE_SHIFT) @@ -22142,7 +22159,7 @@ Signed-off-by: Yangbo Lu #define OP_ALG_ALGSEL_SHIFT 16 #define OP_ALG_ALGSEL_MASK (0xff << OP_ALG_ALGSEL_SHIFT) -@@ -1249,7 +1244,7 @@ struct sec4_sg_entry { +@@ -1249,7 +1246,7 @@ struct sec4_sg_entry { #define OP_ALG_PKMODE_MOD_PRIMALITY 0x00f /* PKHA mode copy-memory functions */ @@ -22151,7 +22168,7 @@ Signed-off-by: Yangbo Lu #define OP_ALG_PKMODE_SRC_REG_MASK (7 << OP_ALG_PKMODE_SRC_REG_SHIFT) #define OP_ALG_PKMODE_DST_REG_SHIFT 10 #define OP_ALG_PKMODE_DST_REG_MASK (7 << OP_ALG_PKMODE_DST_REG_SHIFT) -@@ -1445,7 +1440,7 @@ struct sec4_sg_entry { +@@ -1445,10 +1442,11 @@ struct sec4_sg_entry { #define MATH_SRC1_REG2 (0x02 << MATH_SRC1_SHIFT) #define MATH_SRC1_REG3 (0x03 << MATH_SRC1_SHIFT) #define MATH_SRC1_IMM (0x04 << MATH_SRC1_SHIFT) @@ -22160,7 +22177,11 @@ Signed-off-by: Yangbo Lu #define MATH_SRC1_INFIFO (0x0a << MATH_SRC1_SHIFT) #define MATH_SRC1_OUTFIFO (0x0b << MATH_SRC1_SHIFT) #define MATH_SRC1_ONE (0x0c << MATH_SRC1_SHIFT) -@@ -1629,4 +1624,31 @@ struct sec4_sg_entry { ++#define MATH_SRC1_ZERO (0x0f << MATH_SRC1_SHIFT) + + /* Destination selectors */ + #define MATH_DEST_SHIFT 8 +@@ -1629,4 +1627,31 @@ struct sec4_sg_entry { /* Frame Descriptor Command for Replacement Job Descriptor */ #define FD_CMD_REPLACE_JOB_DESC 0x20000000 @@ -24260,15 +24281,7 @@ Signed-off-by: Yangbo Lu #endif /* CAAM_ERROR_H */ --- a/drivers/crypto/caam/intern.h +++ b/drivers/crypto/caam/intern.h -@@ -41,6 +41,7 @@ struct caam_drv_private_jr { - struct device *dev; - int ridx; - struct caam_job_ring __iomem *rregs; /* JobR's register space */ -+ struct tasklet_struct irqtask; - int irq; /* One per queue */ - - /* Number of scatterlist crypt transforms active on the JobR */ -@@ -63,10 +64,9 @@ struct caam_drv_private_jr { +@@ -64,10 +64,9 @@ struct caam_drv_private_jr { * Driver-private storage for a single CAAM block instance */ struct caam_drv_private { @@ -24282,7 +24295,7 @@ Signed-off-by: Yangbo Lu /* Physical-presence section */ struct caam_ctrl __iomem *ctrl; /* controller region */ -@@ -102,11 +102,6 @@ struct caam_drv_private { +@@ -103,11 +102,6 @@ struct caam_drv_private { #ifdef CONFIG_DEBUG_FS struct dentry *dfs_root; struct dentry *ctl; /* controller dir */ @@ -24294,7 +24307,7 @@ Signed-off-by: Yangbo Lu struct debugfs_blob_wrapper ctl_kek_wrap, ctl_tkek_wrap, ctl_tdsk_wrap; struct dentry *ctl_kek, *ctl_tkek, *ctl_tdsk; #endif -@@ -114,4 +109,22 @@ struct caam_drv_private { +@@ -115,4 +109,22 @@ struct caam_drv_private { void caam_jr_algapi_init(struct device *dev); void caam_jr_algapi_remove(struct device *dev); @@ -24327,79 +24340,68 @@ Signed-off-by: Yangbo Lu #include "regs.h" #include "jr.h" #include "desc.h" -@@ -73,6 +74,8 @@ static int caam_jr_shutdown(struct devic +@@ -22,6 +23,14 @@ struct jr_driver_data { - ret = caam_reset_hw_jr(dev); + static struct jr_driver_data driver_data; -+ tasklet_kill(&jrp->irqtask); ++static int jr_driver_probed; + - /* Release interrupt */ - free_irq(jrp->irq, dev); - -@@ -128,7 +131,7 @@ static irqreturn_t caam_jr_interrupt(int - - /* - * Check the output ring for ready responses, kick -- * the threaded irq if jobs done. -+ * tasklet if jobs done. - */ - irqstate = rd_reg32(&jrp->rregs->jrintstatus); - if (!irqstate) -@@ -150,13 +153,18 @@ static irqreturn_t caam_jr_interrupt(int - /* Have valid interrupt at this point, just ACK and trigger */ - wr_reg32(&jrp->rregs->jrintstatus, irqstate); - -- return IRQ_WAKE_THREAD; -+ preempt_disable(); -+ tasklet_schedule(&jrp->irqtask); -+ preempt_enable(); ++int caam_jr_driver_probed(void) ++{ ++ return jr_driver_probed; ++} ++EXPORT_SYMBOL(caam_jr_driver_probed); + -+ return IRQ_HANDLED; - } - --static irqreturn_t caam_jr_threadirq(int irq, void *st_dev) -+/* Deferred service handler, run as interrupt-fired tasklet */ -+static void caam_jr_dequeue(unsigned long devarg) + static int caam_reset_hw_jr(struct device *dev) { - int hw_idx, sw_idx, i, head, tail; -- struct device *dev = st_dev; -+ struct device *dev = (struct device *)devarg; struct caam_drv_private_jr *jrp = dev_get_drvdata(dev); - void (*usercall)(struct device *dev, u32 *desc, u32 status, void *arg); - u32 *userdesc, userstatus; -@@ -230,8 +238,6 @@ static irqreturn_t caam_jr_threadirq(int +@@ -118,6 +127,8 @@ static int caam_jr_remove(struct platfor + dev_err(jrdev, "Failed to shut down job ring\n"); + irq_dispose_mapping(jrpriv->irq); - /* reenable / unmask IRQs */ - clrsetbits_32(&jrp->rregs->rconfig_lo, JRCFG_IMSK, 0); -- -- return IRQ_HANDLED; ++ jr_driver_probed--; ++ + return ret; } +@@ -280,6 +291,36 @@ struct device *caam_jr_alloc(void) + EXPORT_SYMBOL(caam_jr_alloc); + /** -@@ -389,10 +395,11 @@ static int caam_jr_init(struct device *d - - jrp = dev_get_drvdata(dev); - -+ tasklet_init(&jrp->irqtask, caam_jr_dequeue, (unsigned long)dev); ++ * caam_jridx_alloc() - Alloc a specific job ring based on its index. ++ * ++ * returns : pointer to the newly allocated physical ++ * JobR dev can be written to if successful. ++ **/ ++struct device *caam_jridx_alloc(int idx) ++{ ++ struct caam_drv_private_jr *jrpriv; ++ struct device *dev = ERR_PTR(-ENODEV); + - /* Connect job ring interrupt handler. */ -- error = request_threaded_irq(jrp->irq, caam_jr_interrupt, -- caam_jr_threadirq, IRQF_SHARED, -- dev_name(dev), dev); -+ error = request_irq(jrp->irq, caam_jr_interrupt, IRQF_SHARED, -+ dev_name(dev), dev); - if (error) { - dev_err(dev, "can't connect JobR %d interrupt (%d)\n", - jrp->ridx, jrp->irq); -@@ -454,6 +461,7 @@ out_free_inpring: - out_free_irq: - free_irq(jrp->irq, dev); - out_kill_deq: -+ tasklet_kill(&jrp->irqtask); - return error; - } - -@@ -489,15 +497,28 @@ static int caam_jr_probe(struct platform ++ spin_lock(&driver_data.jr_alloc_lock); ++ ++ if (list_empty(&driver_data.jr_list)) ++ goto end; ++ ++ list_for_each_entry(jrpriv, &driver_data.jr_list, list_node) { ++ if (jrpriv->ridx == idx) { ++ atomic_inc(&jrpriv->tfm_count); ++ dev = jrpriv->dev; ++ break; ++ } ++ } ++ ++end: ++ spin_unlock(&driver_data.jr_alloc_lock); ++ return dev; ++} ++EXPORT_SYMBOL(caam_jridx_alloc); ++ ++/** + * caam_jr_free() - Free the Job Ring + * @rdev - points to the dev that identifies the Job ring to + * be released. +@@ -496,15 +537,28 @@ static int caam_jr_probe(struct platform return -ENOMEM; } @@ -24435,7 +24437,12 @@ Signed-off-by: Yangbo Lu /* Identify the interrupt */ jrpriv->irq = irq_of_parse_and_map(nprop, 0); -@@ -520,7 +541,7 @@ static int caam_jr_probe(struct platform +@@ -524,10 +578,12 @@ static int caam_jr_probe(struct platform + + atomic_set(&jrpriv->tfm_count, 0); + ++ jr_driver_probed++; ++ return 0; } @@ -24444,6 +24451,18 @@ Signed-off-by: Yangbo Lu { .compatible = "fsl,sec-v4.0-job-ring", }, +--- a/drivers/crypto/caam/jr.h ++++ b/drivers/crypto/caam/jr.h +@@ -8,7 +8,9 @@ + #define JR_H + + /* Prototypes for backend-level services exposed to APIs */ ++int caam_jr_driver_probed(void); + struct device *caam_jr_alloc(void); ++struct device *caam_jridx_alloc(int idx); + void caam_jr_free(struct device *rdev); + int caam_jr_enqueue(struct device *dev, u32 *desc, + void (*cbk)(struct device *dev, u32 *desc, u32 status, --- a/drivers/crypto/caam/key_gen.c +++ b/drivers/crypto/caam/key_gen.c @@ -41,15 +41,29 @@ Split key generation-------------------- diff --git a/target/linux/layerscape/patches-4.9/805-dma-support-layerscape.patch b/target/linux/layerscape/patches-4.9/805-dma-support-layerscape.patch index 703aeed3e5..94f0a3444e 100644 --- a/target/linux/layerscape/patches-4.9/805-dma-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/805-dma-support-layerscape.patch @@ -1,4 +1,4 @@ -From 659603c5f6cbc3d39922d4374df25ae4627d0e88 Mon Sep 17 00:00:00 2001 +From 854c1f0e9574e9b25a55b439608c71e013b34a56 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 25 Sep 2017 12:12:20 +0800 Subject: [PATCH] dma: support layerscape @@ -8,8 +8,9 @@ This is a integrated patch for layerscape dma support. Signed-off-by: jiaheng.fan Signed-off-by: Yangbo Lu --- - drivers/dma/Kconfig | 14 + - drivers/dma/Makefile | 2 + + drivers/dma/Kconfig | 31 + + drivers/dma/Makefile | 3 + + drivers/dma/caam_dma.c | 563 +++++++++++++++ drivers/dma/dpaa2-qdma/Kconfig | 8 + drivers/dma/dpaa2-qdma/Makefile | 8 + drivers/dma/dpaa2-qdma/dpaa2-qdma.c | 986 +++++++++++++++++++++++++ @@ -18,7 +19,8 @@ Signed-off-by: Yangbo Lu drivers/dma/dpaa2-qdma/fsl_dpdmai.h | 521 ++++++++++++++ drivers/dma/dpaa2-qdma/fsl_dpdmai_cmd.h | 222 ++++++ drivers/dma/fsl-qdma.c | 1201 +++++++++++++++++++++++++++++++ - 10 files changed, 3678 insertions(+) + 11 files changed, 4259 insertions(+) + create mode 100644 drivers/dma/caam_dma.c create mode 100644 drivers/dma/dpaa2-qdma/Kconfig create mode 100644 drivers/dma/dpaa2-qdma/Makefile create mode 100644 drivers/dma/dpaa2-qdma/dpaa2-qdma.c @@ -51,6 +53,30 @@ Signed-off-by: Yangbo Lu config FSL_RAID tristate "Freescale RAID engine Support" depends on FSL_SOC && !ASYNC_TX_ENABLE_CHANNEL_SWITCH +@@ -564,6 +578,23 @@ config ZX_DMA + help + Support the DMA engine for ZTE ZX296702 platform devices. + ++config CRYPTO_DEV_FSL_CAAM_DMA ++ tristate "CAAM DMA engine support" ++ depends on CRYPTO_DEV_FSL_CAAM_JR ++ default y ++ select DMA_ENGINE ++ select ASYNC_CORE ++ select ASYNC_TX_ENABLE_CHANNEL_SWITCH ++ help ++ Selecting this will offload the DMA operations for users of ++ the scatter gather memcopy API to the CAAM via job rings. The ++ CAAM is a hardware module that provides hardware acceleration to ++ cryptographic operations. It has a built-in DMA controller that can ++ be programmed to read/write cryptographic data. This module defines ++ a DMA driver that uses the DMA capabilities of the CAAM. ++ ++ To compile this as a module, choose M here: the module ++ will be called caam_dma. + + # driver files + source "drivers/dma/bestcomm/Kconfig" --- a/drivers/dma/Makefile +++ b/drivers/dma/Makefile @@ -29,6 +29,8 @@ obj-$(CONFIG_DW_DMAC_CORE) += dw/ @@ -62,6 +88,580 @@ Signed-off-by: Yangbo Lu obj-$(CONFIG_FSL_RAID) += fsl_raid.o obj-$(CONFIG_HSU_DMA) += hsu/ obj-$(CONFIG_IMG_MDC_DMA) += img-mdc-dma.o +@@ -67,6 +69,7 @@ obj-$(CONFIG_TI_DMA_CROSSBAR) += ti-dma- + obj-$(CONFIG_TI_EDMA) += edma.o + obj-$(CONFIG_XGENE_DMA) += xgene-dma.o + obj-$(CONFIG_ZX_DMA) += zx296702_dma.o ++obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_DMA) += caam_dma.o + + obj-y += qcom/ + obj-y += xilinx/ +--- /dev/null ++++ b/drivers/dma/caam_dma.c +@@ -0,0 +1,563 @@ ++/* ++ * caam support for SG DMA ++ * ++ * Copyright 2016 Freescale Semiconductor, Inc ++ * Copyright 2017 NXP ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include "dmaengine.h" ++ ++#include "../crypto/caam/regs.h" ++#include "../crypto/caam/jr.h" ++#include "../crypto/caam/error.h" ++#include "../crypto/caam/intern.h" ++#include "../crypto/caam/desc_constr.h" ++#include "../crypto/caam/sg_sw_sec4.h" ++ ++#define DESC_DMA_MEMCPY_LEN ((CAAM_DESC_BYTES_MAX - DESC_JOB_IO_LEN) / \ ++ CAAM_CMD_SZ) ++ ++/* This is max chunk size of a DMA transfer. If a buffer is larger than this ++ * value it is internally broken into chunks of max CAAM_DMA_CHUNK_SIZE bytes ++ * and for each chunk a DMA transfer request is issued. ++ * This value is the largest number on 16 bits that is a multiple of 256 bytes ++ * (the largest configurable CAAM DMA burst size). ++ */ ++#define CAAM_DMA_CHUNK_SIZE 65280 ++ ++struct caam_dma_sh_desc { ++ u32 desc[DESC_DMA_MEMCPY_LEN] ____cacheline_aligned; ++ dma_addr_t desc_dma; ++}; ++ ++/* caam dma extended descriptor */ ++struct caam_dma_edesc { ++ struct dma_async_tx_descriptor async_tx; ++ struct list_head node; ++ struct caam_dma_ctx *ctx; ++ dma_addr_t src_dma; ++ dma_addr_t dst_dma; ++ unsigned int src_len; ++ unsigned int dst_len; ++ struct sec4_sg_entry *sec4_sg; ++ u32 jd[] ____cacheline_aligned; ++}; ++ ++/* ++ * caam_dma_ctx - per jr/channel context ++ * @chan: dma channel used by async_tx API ++ * @node: list_head used to attach to the global dma_ctx_list ++ * @jrdev: Job Ring device ++ * @submit_q: queue of pending (submitted, but not enqueued) jobs ++ * @done_not_acked: jobs that have been completed by jr, but maybe not acked ++ * @edesc_lock: protects extended descriptor ++ */ ++struct caam_dma_ctx { ++ struct dma_chan chan; ++ struct list_head node; ++ struct device *jrdev; ++ struct list_head submit_q; ++ struct list_head done_not_acked; ++ spinlock_t edesc_lock; ++}; ++ ++static struct dma_device *dma_dev; ++static struct caam_dma_sh_desc *dma_sh_desc; ++static LIST_HEAD(dma_ctx_list); ++ ++static dma_cookie_t caam_dma_tx_submit(struct dma_async_tx_descriptor *tx) ++{ ++ struct caam_dma_edesc *edesc = NULL; ++ struct caam_dma_ctx *ctx = NULL; ++ dma_cookie_t cookie; ++ ++ edesc = container_of(tx, struct caam_dma_edesc, async_tx); ++ ctx = container_of(tx->chan, struct caam_dma_ctx, chan); ++ ++ spin_lock_bh(&ctx->edesc_lock); ++ ++ cookie = dma_cookie_assign(tx); ++ list_add_tail(&edesc->node, &ctx->submit_q); ++ ++ spin_unlock_bh(&ctx->edesc_lock); ++ ++ return cookie; ++} ++ ++static unsigned int caam_dma_sg_dma_len(struct scatterlist *sg, ++ unsigned int nents) ++{ ++ unsigned int len; ++ ++ for (len = 0; sg && nents; sg = sg_next(sg), nents--) ++ len += sg_dma_len(sg); ++ ++ return len; ++} ++ ++static struct caam_dma_edesc * ++caam_dma_sg_edesc_alloc(struct dma_chan *chan, ++ struct scatterlist *dst_sg, unsigned int dst_nents, ++ struct scatterlist *src_sg, unsigned int src_nents, ++ unsigned long flags) ++{ ++ struct caam_dma_ctx *ctx = container_of(chan, struct caam_dma_ctx, ++ chan); ++ struct device *jrdev = ctx->jrdev; ++ struct caam_dma_edesc *edesc; ++ struct sec4_sg_entry *sec4_sg; ++ dma_addr_t sec4_sg_dma_src; ++ unsigned int sec4_sg_bytes; ++ ++ if (!dst_sg || !src_sg || !dst_nents || !src_nents) ++ return NULL; ++ ++ sec4_sg_bytes = (src_nents + dst_nents) * sizeof(*sec4_sg); ++ ++ edesc = kzalloc(sizeof(*edesc) + DESC_JOB_IO_LEN + sec4_sg_bytes, ++ GFP_DMA | GFP_NOWAIT); ++ if (!edesc) ++ return ERR_PTR(-ENOMEM); ++ ++ edesc->src_len = caam_dma_sg_dma_len(src_sg, src_nents); ++ edesc->dst_len = caam_dma_sg_dma_len(dst_sg, dst_nents); ++ if (edesc->src_len != edesc->dst_len) { ++ dev_err(jrdev, "%s: src(%u) and dst(%u) len mismatch.\n", ++ __func__, edesc->src_len, edesc->dst_len); ++ kfree(edesc); ++ return ERR_PTR(-EINVAL); ++ } ++ ++ dma_async_tx_descriptor_init(&edesc->async_tx, chan); ++ edesc->async_tx.tx_submit = caam_dma_tx_submit; ++ edesc->async_tx.flags = flags; ++ edesc->async_tx.cookie = -EBUSY; ++ ++ /* Prepare SEC SGs */ ++ edesc->sec4_sg = (void *)edesc + offsetof(struct caam_dma_edesc, jd) + ++ DESC_JOB_IO_LEN; ++ ++ sec4_sg = edesc->sec4_sg; ++ sg_to_sec4_sg_last(src_sg, src_nents, sec4_sg, 0); ++ ++ sec4_sg += src_nents; ++ sg_to_sec4_sg_last(dst_sg, dst_nents, sec4_sg, 0); ++ ++ sec4_sg_dma_src = dma_map_single(jrdev, edesc->sec4_sg, sec4_sg_bytes, ++ DMA_TO_DEVICE); ++ if (dma_mapping_error(jrdev, sec4_sg_dma_src)) { ++ dev_err(jrdev, "error mapping segments to device\n"); ++ kfree(edesc); ++ return ERR_PTR(-ENOMEM); ++ } ++ ++ edesc->src_dma = sec4_sg_dma_src; ++ edesc->dst_dma = sec4_sg_dma_src + src_nents * sizeof(*sec4_sg); ++ edesc->ctx = ctx; ++ ++ return edesc; ++} ++ ++static void caam_jr_chan_free_edesc(struct caam_dma_edesc *edesc) ++{ ++ struct caam_dma_ctx *ctx = edesc->ctx; ++ struct caam_dma_edesc *_edesc = NULL; ++ ++ spin_lock_bh(&ctx->edesc_lock); ++ ++ list_add_tail(&edesc->node, &ctx->done_not_acked); ++ list_for_each_entry_safe(edesc, _edesc, &ctx->done_not_acked, node) { ++ if (async_tx_test_ack(&edesc->async_tx)) { ++ list_del(&edesc->node); ++ kfree(edesc); ++ } ++ } ++ ++ spin_unlock_bh(&ctx->edesc_lock); ++} ++ ++static void caam_dma_done(struct device *dev, u32 *hwdesc, u32 err, ++ void *context) ++{ ++ struct caam_dma_edesc *edesc = context; ++ struct caam_dma_ctx *ctx = edesc->ctx; ++ dma_async_tx_callback callback; ++ void *callback_param; ++ ++ if (err) ++ caam_jr_strstatus(ctx->jrdev, err); ++ ++ dma_run_dependencies(&edesc->async_tx); ++ ++ spin_lock_bh(&ctx->edesc_lock); ++ dma_cookie_complete(&edesc->async_tx); ++ spin_unlock_bh(&ctx->edesc_lock); ++ ++ callback = edesc->async_tx.callback; ++ callback_param = edesc->async_tx.callback_param; ++ ++ dma_descriptor_unmap(&edesc->async_tx); ++ ++ caam_jr_chan_free_edesc(edesc); ++ ++ if (callback) ++ callback(callback_param); ++} ++ ++static void caam_dma_sg_init_job_desc(struct caam_dma_edesc *edesc) ++{ ++ u32 *jd = edesc->jd; ++ u32 *sh_desc = dma_sh_desc->desc; ++ dma_addr_t desc_dma = dma_sh_desc->desc_dma; ++ ++ /* init the job descriptor */ ++ init_job_desc_shared(jd, desc_dma, desc_len(sh_desc), HDR_REVERSE); ++ ++ /* set SEQIN PTR */ ++ append_seq_in_ptr(jd, edesc->src_dma, edesc->src_len, LDST_SGF); ++ ++ /* set SEQOUT PTR */ ++ append_seq_out_ptr(jd, edesc->dst_dma, edesc->dst_len, LDST_SGF); ++ ++#ifdef DEBUG ++ print_hex_dump(KERN_ERR, "caam dma desc@" __stringify(__LINE__) ": ", ++ DUMP_PREFIX_ADDRESS, 16, 4, jd, desc_bytes(jd), 1); ++#endif ++} ++ ++/* This function can be called from an interrupt context */ ++static struct dma_async_tx_descriptor * ++caam_dma_prep_sg(struct dma_chan *chan, struct scatterlist *dst_sg, ++ unsigned int dst_nents, struct scatterlist *src_sg, ++ unsigned int src_nents, unsigned long flags) ++{ ++ struct caam_dma_edesc *edesc; ++ ++ /* allocate extended descriptor */ ++ edesc = caam_dma_sg_edesc_alloc(chan, dst_sg, dst_nents, src_sg, ++ src_nents, flags); ++ if (IS_ERR_OR_NULL(edesc)) ++ return ERR_CAST(edesc); ++ ++ /* Initialize job descriptor */ ++ caam_dma_sg_init_job_desc(edesc); ++ ++ return &edesc->async_tx; ++} ++ ++static void caam_dma_memcpy_init_job_desc(struct caam_dma_edesc *edesc) ++{ ++ u32 *jd = edesc->jd; ++ u32 *sh_desc = dma_sh_desc->desc; ++ dma_addr_t desc_dma = dma_sh_desc->desc_dma; ++ ++ /* init the job descriptor */ ++ init_job_desc_shared(jd, desc_dma, desc_len(sh_desc), HDR_REVERSE); ++ ++ /* set SEQIN PTR */ ++ append_seq_in_ptr(jd, edesc->src_dma, edesc->src_len, 0); ++ ++ /* set SEQOUT PTR */ ++ append_seq_out_ptr(jd, edesc->dst_dma, edesc->dst_len, 0); ++ ++#ifdef DEBUG ++ print_hex_dump(KERN_ERR, "caam dma desc@" __stringify(__LINE__) ": ", ++ DUMP_PREFIX_ADDRESS, 16, 4, jd, desc_bytes(jd), 1); ++#endif ++} ++ ++static struct dma_async_tx_descriptor * ++caam_dma_prep_memcpy(struct dma_chan *chan, dma_addr_t dst, dma_addr_t src, ++ size_t len, unsigned long flags) ++{ ++ struct caam_dma_edesc *edesc; ++ struct caam_dma_ctx *ctx = container_of(chan, struct caam_dma_ctx, ++ chan); ++ ++ edesc = kzalloc(sizeof(*edesc) + DESC_JOB_IO_LEN, GFP_DMA | GFP_NOWAIT); ++ if (!edesc) ++ return ERR_PTR(-ENOMEM); ++ ++ dma_async_tx_descriptor_init(&edesc->async_tx, chan); ++ edesc->async_tx.tx_submit = caam_dma_tx_submit; ++ edesc->async_tx.flags = flags; ++ edesc->async_tx.cookie = -EBUSY; ++ ++ edesc->src_dma = src; ++ edesc->src_len = len; ++ edesc->dst_dma = dst; ++ edesc->dst_len = len; ++ edesc->ctx = ctx; ++ ++ caam_dma_memcpy_init_job_desc(edesc); ++ ++ return &edesc->async_tx; ++} ++ ++/* This function can be called in an interrupt context */ ++static void caam_dma_issue_pending(struct dma_chan *chan) ++{ ++ struct caam_dma_ctx *ctx = container_of(chan, struct caam_dma_ctx, ++ chan); ++ struct caam_dma_edesc *edesc, *_edesc; ++ ++ spin_lock_bh(&ctx->edesc_lock); ++ list_for_each_entry_safe(edesc, _edesc, &ctx->submit_q, node) { ++ if (caam_jr_enqueue(ctx->jrdev, edesc->jd, ++ caam_dma_done, edesc) < 0) ++ break; ++ list_del(&edesc->node); ++ } ++ spin_unlock_bh(&ctx->edesc_lock); ++} ++ ++static void caam_dma_free_chan_resources(struct dma_chan *chan) ++{ ++ struct caam_dma_ctx *ctx = container_of(chan, struct caam_dma_ctx, ++ chan); ++ struct caam_dma_edesc *edesc, *_edesc; ++ ++ spin_lock_bh(&ctx->edesc_lock); ++ list_for_each_entry_safe(edesc, _edesc, &ctx->submit_q, node) { ++ list_del(&edesc->node); ++ kfree(edesc); ++ } ++ list_for_each_entry_safe(edesc, _edesc, &ctx->done_not_acked, node) { ++ list_del(&edesc->node); ++ kfree(edesc); ++ } ++ spin_unlock_bh(&ctx->edesc_lock); ++} ++ ++static int caam_dma_jr_chan_bind(void) ++{ ++ struct device *jrdev; ++ struct caam_dma_ctx *ctx; ++ int bonds = 0; ++ int i; ++ ++ for (i = 0; i < caam_jr_driver_probed(); i++) { ++ jrdev = caam_jridx_alloc(i); ++ if (IS_ERR(jrdev)) { ++ pr_err("job ring device %d allocation failed\n", i); ++ continue; ++ } ++ ++ ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); ++ if (!ctx) { ++ caam_jr_free(jrdev); ++ continue; ++ } ++ ++ ctx->chan.device = dma_dev; ++ ctx->chan.private = ctx; ++ ++ ctx->jrdev = jrdev; ++ ++ INIT_LIST_HEAD(&ctx->submit_q); ++ INIT_LIST_HEAD(&ctx->done_not_acked); ++ INIT_LIST_HEAD(&ctx->node); ++ spin_lock_init(&ctx->edesc_lock); ++ ++ dma_cookie_init(&ctx->chan); ++ ++ /* add the context of this channel to the context list */ ++ list_add_tail(&ctx->node, &dma_ctx_list); ++ ++ /* add this channel to the device chan list */ ++ list_add_tail(&ctx->chan.device_node, &dma_dev->channels); ++ ++ bonds++; ++ } ++ ++ return bonds; ++} ++ ++static inline void caam_jr_dma_free(struct dma_chan *chan) ++{ ++ struct caam_dma_ctx *ctx = container_of(chan, struct caam_dma_ctx, ++ chan); ++ ++ list_del(&ctx->node); ++ list_del(&chan->device_node); ++ caam_jr_free(ctx->jrdev); ++ kfree(ctx); ++} ++ ++static void set_caam_dma_desc(u32 *desc) ++{ ++ u32 *jmp_cmd; ++ ++ /* dma shared descriptor */ ++ init_sh_desc(desc, HDR_SHARE_NEVER | (1 << HDR_START_IDX_SHIFT)); ++ ++ /* REG1 = CAAM_DMA_CHUNK_SIZE */ ++ append_math_add_imm_u32(desc, REG1, ZERO, IMM, CAAM_DMA_CHUNK_SIZE); ++ ++ /* REG0 = SEQINLEN - CAAM_DMA_CHUNK_SIZE */ ++ append_math_sub_imm_u32(desc, REG0, SEQINLEN, IMM, CAAM_DMA_CHUNK_SIZE); ++ ++ /* if (REG0 > 0) ++ * jmp to LABEL1 ++ */ ++ jmp_cmd = append_jump(desc, JUMP_TEST_INVALL | JUMP_COND_MATH_N | ++ JUMP_COND_MATH_Z); ++ ++ /* REG1 = SEQINLEN */ ++ append_math_sub(desc, REG1, SEQINLEN, ZERO, CAAM_CMD_SZ); ++ ++ /* LABEL1 */ ++ set_jump_tgt_here(desc, jmp_cmd); ++ ++ /* VARSEQINLEN = REG1 */ ++ append_math_add(desc, VARSEQINLEN, REG1, ZERO, CAAM_CMD_SZ); ++ ++ /* VARSEQOUTLEN = REG1 */ ++ append_math_add(desc, VARSEQOUTLEN, REG1, ZERO, CAAM_CMD_SZ); ++ ++ /* do FIFO STORE */ ++ append_seq_fifo_store(desc, 0, FIFOST_TYPE_METADATA | LDST_VLF); ++ ++ /* do FIFO LOAD */ ++ append_seq_fifo_load(desc, 0, FIFOLD_CLASS_CLASS1 | ++ FIFOLD_TYPE_IFIFO | LDST_VLF); ++ ++ /* if (REG0 > 0) ++ * jmp 0xF8 (after shared desc header) ++ */ ++ append_jump(desc, JUMP_TEST_INVALL | JUMP_COND_MATH_N | ++ JUMP_COND_MATH_Z | 0xF8); ++ ++#ifdef DEBUG ++ print_hex_dump(KERN_ERR, "caam dma shdesc@" __stringify(__LINE__) ": ", ++ DUMP_PREFIX_ADDRESS, 16, 4, desc, desc_bytes(desc), 1); ++#endif ++} ++ ++static int __init caam_dma_probe(struct platform_device *pdev) ++{ ++ struct device *dev = &pdev->dev; ++ struct device *ctrldev = dev->parent; ++ struct dma_chan *chan, *_chan; ++ u32 *sh_desc; ++ int err = -ENOMEM; ++ int bonds; ++ ++ if (!caam_jr_driver_probed()) { ++ dev_info(dev, "Defer probing after JR driver probing\n"); ++ return -EPROBE_DEFER; ++ } ++ ++ dma_dev = kzalloc(sizeof(*dma_dev), GFP_KERNEL); ++ if (!dma_dev) ++ return -ENOMEM; ++ ++ dma_sh_desc = kzalloc(sizeof(*dma_sh_desc), GFP_KERNEL | GFP_DMA); ++ if (!dma_sh_desc) ++ goto desc_err; ++ ++ sh_desc = dma_sh_desc->desc; ++ set_caam_dma_desc(sh_desc); ++ dma_sh_desc->desc_dma = dma_map_single(ctrldev, sh_desc, ++ desc_bytes(sh_desc), ++ DMA_TO_DEVICE); ++ if (dma_mapping_error(ctrldev, dma_sh_desc->desc_dma)) { ++ dev_err(dev, "unable to map dma descriptor\n"); ++ goto map_err; ++ } ++ ++ INIT_LIST_HEAD(&dma_dev->channels); ++ ++ bonds = caam_dma_jr_chan_bind(); ++ if (!bonds) { ++ err = -ENODEV; ++ goto jr_bind_err; ++ } ++ ++ dma_dev->dev = dev; ++ dma_dev->residue_granularity = DMA_RESIDUE_GRANULARITY_DESCRIPTOR; ++ dma_cap_set(DMA_SG, dma_dev->cap_mask); ++ dma_cap_set(DMA_MEMCPY, dma_dev->cap_mask); ++ dma_cap_set(DMA_PRIVATE, dma_dev->cap_mask); ++ dma_dev->device_tx_status = dma_cookie_status; ++ dma_dev->device_issue_pending = caam_dma_issue_pending; ++ dma_dev->device_prep_dma_sg = caam_dma_prep_sg; ++ dma_dev->device_prep_dma_memcpy = caam_dma_prep_memcpy; ++ dma_dev->device_free_chan_resources = caam_dma_free_chan_resources; ++ ++ err = dma_async_device_register(dma_dev); ++ if (err) { ++ dev_err(dev, "Failed to register CAAM DMA engine\n"); ++ goto jr_bind_err; ++ } ++ ++ dev_info(dev, "caam dma support with %d job rings\n", bonds); ++ ++ return err; ++ ++jr_bind_err: ++ list_for_each_entry_safe(chan, _chan, &dma_dev->channels, device_node) ++ caam_jr_dma_free(chan); ++ ++ dma_unmap_single(ctrldev, dma_sh_desc->desc_dma, desc_bytes(sh_desc), ++ DMA_TO_DEVICE); ++map_err: ++ kfree(dma_sh_desc); ++desc_err: ++ kfree(dma_dev); ++ return err; ++} ++ ++static int caam_dma_remove(struct platform_device *pdev) ++{ ++ struct device *dev = &pdev->dev; ++ struct device *ctrldev = dev->parent; ++ struct caam_dma_ctx *ctx, *_ctx; ++ ++ dma_async_device_unregister(dma_dev); ++ ++ list_for_each_entry_safe(ctx, _ctx, &dma_ctx_list, node) { ++ list_del(&ctx->node); ++ caam_jr_free(ctx->jrdev); ++ kfree(ctx); ++ } ++ ++ dma_unmap_single(ctrldev, dma_sh_desc->desc_dma, ++ desc_bytes(dma_sh_desc->desc), DMA_TO_DEVICE); ++ ++ kfree(dma_sh_desc); ++ kfree(dma_dev); ++ ++ dev_info(dev, "caam dma support disabled\n"); ++ return 0; ++} ++ ++static const struct of_device_id caam_dma_match[] = { ++ { .compatible = "fsl,sec-v5.4-dma", }, ++ { .compatible = "fsl,sec-v5.0-dma", }, ++ { .compatible = "fsl,sec-v4.0-dma", }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, caam_dma_match); ++ ++static struct platform_driver caam_dma_driver = { ++ .driver = { ++ .name = "caam-dma", ++ .of_match_table = caam_dma_match, ++ }, ++ .probe = caam_dma_probe, ++ .remove = caam_dma_remove, ++}; ++module_platform_driver(caam_dma_driver); ++ ++MODULE_LICENSE("Dual BSD/GPL"); ++MODULE_DESCRIPTION("NXP CAAM support for SG DMA"); ++MODULE_AUTHOR("NXP Semiconductors"); --- /dev/null +++ b/drivers/dma/dpaa2-qdma/Kconfig @@ -0,0 +1,8 @@ diff --git a/target/linux/layerscape/patches-4.9/806-flextimer-support-layerscape.patch b/target/linux/layerscape/patches-4.9/806-flextimer-support-layerscape.patch index 711fde77de..7ead7b6eca 100644 --- a/target/linux/layerscape/patches-4.9/806-flextimer-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/806-flextimer-support-layerscape.patch @@ -1,4 +1,4 @@ -From a5b3155b532289af793c26251cb087b4a24d5c15 Mon Sep 17 00:00:00 2001 +From 76cd2ef6b69b67c09480a3248f7b910897f0bb2f Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 25 Sep 2017 12:13:12 +0800 Subject: [PATCH] flextimer: support layerscape @@ -10,8 +10,8 @@ Signed-off-by: Meng Yi Signed-off-by: Yangbo Lu --- drivers/clocksource/fsl_ftm_timer.c | 8 +- - drivers/soc/fsl/layerscape/ftm_alarm.c | 286 +++++++++++++++++++++++++++++++++ - 2 files changed, 290 insertions(+), 4 deletions(-) + drivers/soc/fsl/layerscape/ftm_alarm.c | 367 +++++++++++++++++++++++++++++++++ + 2 files changed, 371 insertions(+), 4 deletions(-) create mode 100644 drivers/soc/fsl/layerscape/ftm_alarm.c --- a/drivers/clocksource/fsl_ftm_timer.c @@ -34,7 +34,7 @@ Signed-off-by: Yangbo Lu static inline void ftm_irq_enable(void __iomem *base) --- /dev/null +++ b/drivers/soc/fsl/layerscape/ftm_alarm.c -@@ -0,0 +1,286 @@ +@@ -0,0 +1,367 @@ +/* + * Freescale FlexTimer Module (FTM) Alarm driver. + * @@ -53,6 +53,10 @@ Signed-off-by: Yangbo Lu +#include +#include +#include ++#include ++#include ++#include ++#include + +#define FTM_SC 0x00 +#define FTM_SC_CLK_SHIFT 3 @@ -77,6 +81,57 @@ Signed-off-by: Yangbo Lu +static u32 alarm_freq; +static bool big_endian; + ++enum pmu_endian_type { ++ BIG_ENDIAN, ++ LITTLE_ENDIAN, ++}; ++ ++struct rcpm_cfg { ++ enum pmu_endian_type big_endian; /* Big/Little endian of PMU module */ ++ u32 flextimer_set_bit; /* FlexTimer1 is not powerdown during device LPM20 */ ++}; ++ ++static struct rcpm_cfg ls1012a_rcpm_cfg = { ++ .big_endian = BIG_ENDIAN, ++ .flextimer_set_bit = 0x20000, ++}; ++ ++static struct rcpm_cfg ls1021a_rcpm_cfg = { ++ .big_endian = BIG_ENDIAN, ++ .flextimer_set_bit = 0x20000, ++}; ++ ++static struct rcpm_cfg ls1043a_rcpm_cfg = { ++ .big_endian = BIG_ENDIAN, ++ .flextimer_set_bit = 0x20000, ++}; ++ ++static struct rcpm_cfg ls1046a_rcpm_cfg = { ++ .big_endian = BIG_ENDIAN, ++ .flextimer_set_bit = 0x20000, ++}; ++ ++static struct rcpm_cfg ls1088a_rcpm_cfg = { ++ .big_endian = LITTLE_ENDIAN, ++ .flextimer_set_bit = 0x4000, ++}; ++ ++static struct rcpm_cfg ls208xa_rcpm_cfg = { ++ .big_endian = LITTLE_ENDIAN, ++ .flextimer_set_bit = 0x4000, ++}; ++ ++static const struct of_device_id ippdexpcr_of_match[] = { ++ { .compatible = "fsl,ls1012a-ftm", .data = &ls1012a_rcpm_cfg}, ++ { .compatible = "fsl,ls1021a-ftm", .data = &ls1021a_rcpm_cfg}, ++ { .compatible = "fsl,ls1043a-ftm", .data = &ls1043a_rcpm_cfg}, ++ { .compatible = "fsl,ls1046a-ftm", .data = &ls1046a_rcpm_cfg}, ++ { .compatible = "fsl,ls1088a-ftm", .data = &ls1088a_rcpm_cfg}, ++ { .compatible = "fsl,ls208xa-ftm", .data = &ls208xa_rcpm_cfg}, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, ippdexpcr_of_match); ++ +static inline u32 ftm_readl(void __iomem *addr) +{ + if (big_endian) @@ -251,7 +306,10 @@ Signed-off-by: Yangbo Lu + struct resource *r; + int irq; + int ret; -+ u32 ippdexpcr; ++ struct rcpm_cfg *rcpm_cfg; ++ u32 ippdexpcr, flextimer; ++ const struct of_device_id *of_id; ++ enum pmu_endian_type endian; + + r = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!r) @@ -261,14 +319,32 @@ Signed-off-by: Yangbo Lu + if (IS_ERR(ftm1_base)) + return PTR_ERR(ftm1_base); + ++ of_id = of_match_node(ippdexpcr_of_match, np); ++ if (!of_id) ++ return -ENODEV; ++ ++ rcpm_cfg = devm_kzalloc(&pdev->dev, sizeof(*rcpm_cfg), GFP_KERNEL); ++ if (!rcpm_cfg) ++ return -ENOMEM; ++ ++ rcpm_cfg = (struct rcpm_cfg*)of_id->data; ++ endian = rcpm_cfg->big_endian; ++ flextimer = rcpm_cfg->flextimer_set_bit; ++ + r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "FlexTimer1"); + if (r) { + rcpm_ftm_addr = devm_ioremap_resource(&pdev->dev, r); + if (IS_ERR(rcpm_ftm_addr)) + return PTR_ERR(rcpm_ftm_addr); -+ ippdexpcr = ioread32be(rcpm_ftm_addr); -+ ippdexpcr |= 0x20000; -+ iowrite32be(ippdexpcr, rcpm_ftm_addr); ++ if (endian == BIG_ENDIAN) ++ ippdexpcr = ioread32be(rcpm_ftm_addr); ++ else ++ ippdexpcr = ioread32(rcpm_ftm_addr); ++ ippdexpcr |= flextimer; ++ if (endian == BIG_ENDIAN) ++ iowrite32be(ippdexpcr, rcpm_ftm_addr); ++ else ++ iowrite32(ippdexpcr, rcpm_ftm_addr); + } + + irq = irq_of_parse_and_map(np, 0); @@ -302,7 +378,12 @@ Signed-off-by: Yangbo Lu +} + +static const struct of_device_id ftm_alarm_match[] = { -+ { .compatible = "fsl,ftm-alarm", }, ++ { .compatible = "fsl,ls1012a-ftm", }, ++ { .compatible = "fsl,ls1021a-ftm", }, ++ { .compatible = "fsl,ls1043a-ftm", }, ++ { .compatible = "fsl,ls1046a-ftm", }, ++ { .compatible = "fsl,ls1088a-ftm", }, ++ { .compatible = "fsl,ls208xa-ftm", }, + { .compatible = "fsl,ftm-timer", }, + { }, +}; diff --git a/target/linux/layerscape/patches-4.9/807-gpu-support-layerscape.patch b/target/linux/layerscape/patches-4.9/807-gpu-support-layerscape.patch index 6c81b00449..cd99f94925 100644 --- a/target/linux/layerscape/patches-4.9/807-gpu-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/807-gpu-support-layerscape.patch @@ -27,10 +27,10 @@ Signed-off-by: Yangbo Lu + disable_irq(fsl_dev->irq); + - clk_disable_unprepare(fsl_dev->pix_clk); clk_disable_unprepare(fsl_dev->clk); -@@ -263,6 +264,14 @@ static int fsl_dcu_drm_pm_resume(struct + return 0; +@@ -262,6 +263,12 @@ static int fsl_dcu_drm_pm_resume(struct return ret; } @@ -39,21 +39,11 @@ Signed-off-by: Yangbo Lu + dev_err(dev, "failed to enable dcu pix clk\n"); + return ret; + } -+ -+ enable_irq(fsl_dev->irq); + if (fsl_dev->tcon) fsl_tcon_bypass_enable(fsl_dev->tcon); fsl_dcu_drm_init_planes(fsl_dev->drm); -@@ -273,7 +282,6 @@ static int fsl_dcu_drm_pm_resume(struct - console_unlock(); - - drm_kms_helper_poll_enable(fsl_dev->drm); -- enable_irq(fsl_dev->irq); - - return 0; - } -@@ -389,6 +397,12 @@ static int fsl_dcu_drm_probe(struct plat +@@ -388,6 +395,12 @@ static int fsl_dcu_drm_probe(struct plat goto disable_clk; } diff --git a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch index ec89173619..71ef5d87af 100644 --- a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch @@ -1,4 +1,4 @@ -From f1874c71c855bd8ca8478a622053276f2c61eeca Mon Sep 17 00:00:00 2001 +From 152f316e7829f6aeb3a36009e7e5ec0f1d97d770 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Wed, 27 Sep 2017 10:33:26 +0800 Subject: [PATCH] iommu: support layerscape @@ -12,16 +12,16 @@ Signed-off-by: Sunil Goutham Signed-off-by: Yangbo Lu --- drivers/iommu/amd_iommu.c | 56 ++++++---- - drivers/iommu/arm-smmu-v3.c | 35 ++++++- - drivers/iommu/arm-smmu.c | 74 ++++++++++--- + drivers/iommu/arm-smmu-v3.c | 117 ++++++++++++++------- + drivers/iommu/arm-smmu.c | 100 +++++++++++++++--- drivers/iommu/dma-iommu.c | 242 ++++++++++++++++++++++++++++++++++++------- drivers/iommu/intel-iommu.c | 92 ++++++++++++---- - drivers/iommu/iommu.c | 191 ++++++++++++++++++++++++++++++++-- + drivers/iommu/iommu.c | 219 ++++++++++++++++++++++++++++++++++++--- drivers/iommu/mtk_iommu.c | 2 + drivers/iommu/mtk_iommu_v1.c | 2 + include/linux/dma-iommu.h | 11 ++ include/linux/iommu.h | 55 +++++++--- - 10 files changed, 645 insertions(+), 115 deletions(-) + 10 files changed, 739 insertions(+), 157 deletions(-) --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -143,7 +143,78 @@ Signed-off-by: Yangbo Lu static bool disable_bypass; module_param_named(disable_bypass, disable_bypass, bool, S_IRUGO); MODULE_PARM_DESC(disable_bypass, -@@ -1370,8 +1373,6 @@ static bool arm_smmu_capable(enum iommu_ +@@ -552,9 +555,14 @@ struct arm_smmu_s2_cfg { + }; + + struct arm_smmu_strtab_ent { +- bool valid; +- +- bool bypass; /* Overrides s1/s2 config */ ++ /* ++ * An STE is "assigned" if the master emitting the corresponding SID ++ * is attached to a domain. The behaviour of an unassigned STE is ++ * determined by the disable_bypass parameter, whereas an assigned ++ * STE behaves according to s1_cfg/s2_cfg, which themselves are ++ * configured according to the domain type. ++ */ ++ bool assigned; + struct arm_smmu_s1_cfg *s1_cfg; + struct arm_smmu_s2_cfg *s2_cfg; + }; +@@ -627,6 +635,7 @@ enum arm_smmu_domain_stage { + ARM_SMMU_DOMAIN_S1 = 0, + ARM_SMMU_DOMAIN_S2, + ARM_SMMU_DOMAIN_NESTED, ++ ARM_SMMU_DOMAIN_BYPASS, + }; + + struct arm_smmu_domain { +@@ -1000,9 +1009,9 @@ static void arm_smmu_write_strtab_ent(st + * This is hideously complicated, but we only really care about + * three cases at the moment: + * +- * 1. Invalid (all zero) -> bypass (init) +- * 2. Bypass -> translation (attach) +- * 3. Translation -> bypass (detach) ++ * 1. Invalid (all zero) -> bypass/fault (init) ++ * 2. Bypass/fault -> translation/bypass (attach) ++ * 3. Translation/bypass -> bypass/fault (detach) + * + * Given that we can't update the STE atomically and the SMMU + * doesn't read the thing in a defined order, that leaves us +@@ -1041,11 +1050,15 @@ static void arm_smmu_write_strtab_ent(st + } + + /* Nuke the existing STE_0 value, as we're going to rewrite it */ +- val = ste->valid ? STRTAB_STE_0_V : 0; ++ val = STRTAB_STE_0_V; ++ ++ /* Bypass/fault */ ++ if (!ste->assigned || !(ste->s1_cfg || ste->s2_cfg)) { ++ if (!ste->assigned && disable_bypass) ++ val |= STRTAB_STE_0_CFG_ABORT; ++ else ++ val |= STRTAB_STE_0_CFG_BYPASS; + +- if (ste->bypass) { +- val |= disable_bypass ? STRTAB_STE_0_CFG_ABORT +- : STRTAB_STE_0_CFG_BYPASS; + dst[0] = cpu_to_le64(val); + dst[1] = cpu_to_le64(STRTAB_STE_1_SHCFG_INCOMING + << STRTAB_STE_1_SHCFG_SHIFT); +@@ -1108,10 +1121,7 @@ static void arm_smmu_write_strtab_ent(st + static void arm_smmu_init_bypass_stes(u64 *strtab, unsigned int nent) + { + unsigned int i; +- struct arm_smmu_strtab_ent ste = { +- .valid = true, +- .bypass = true, +- }; ++ struct arm_smmu_strtab_ent ste = { .assigned = false }; + + for (i = 0; i < nent; ++i) { + arm_smmu_write_strtab_ent(NULL, -1, strtab, &ste); +@@ -1364,8 +1374,6 @@ static bool arm_smmu_capable(enum iommu_ switch (cap) { case IOMMU_CAP_CACHE_COHERENCY: return true; @@ -152,7 +223,96 @@ Signed-off-by: Yangbo Lu case IOMMU_CAP_NOEXEC: return true; default: -@@ -1709,6 +1710,9 @@ arm_smmu_iova_to_phys(struct iommu_domai +@@ -1377,7 +1385,9 @@ static struct iommu_domain *arm_smmu_dom + { + struct arm_smmu_domain *smmu_domain; + +- if (type != IOMMU_DOMAIN_UNMANAGED && type != IOMMU_DOMAIN_DMA) ++ if (type != IOMMU_DOMAIN_UNMANAGED && ++ type != IOMMU_DOMAIN_DMA && ++ type != IOMMU_DOMAIN_IDENTITY) + return NULL; + + /* +@@ -1508,6 +1518,11 @@ static int arm_smmu_domain_finalise(stru + struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); + struct arm_smmu_device *smmu = smmu_domain->smmu; + ++ if (domain->type == IOMMU_DOMAIN_IDENTITY) { ++ smmu_domain->stage = ARM_SMMU_DOMAIN_BYPASS; ++ return 0; ++ } ++ + /* Restrict the stage to what we can actually support */ + if (!(smmu->features & ARM_SMMU_FEAT_TRANS_S1)) + smmu_domain->stage = ARM_SMMU_DOMAIN_S2; +@@ -1580,7 +1595,7 @@ static __le64 *arm_smmu_get_step_for_sid + return step; + } + +-static int arm_smmu_install_ste_for_dev(struct iommu_fwspec *fwspec) ++static void arm_smmu_install_ste_for_dev(struct iommu_fwspec *fwspec) + { + int i, j; + struct arm_smmu_master_data *master = fwspec->iommu_priv; +@@ -1599,17 +1614,14 @@ static int arm_smmu_install_ste_for_dev( + + arm_smmu_write_strtab_ent(smmu, sid, step, &master->ste); + } +- +- return 0; + } + + static void arm_smmu_detach_dev(struct device *dev) + { + struct arm_smmu_master_data *master = dev->iommu_fwspec->iommu_priv; + +- master->ste.bypass = true; +- if (arm_smmu_install_ste_for_dev(dev->iommu_fwspec) < 0) +- dev_warn(dev, "failed to install bypass STE\n"); ++ master->ste.assigned = false; ++ arm_smmu_install_ste_for_dev(dev->iommu_fwspec); + } + + static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev) +@@ -1628,7 +1640,7 @@ static int arm_smmu_attach_dev(struct io + ste = &master->ste; + + /* Already attached to a different domain? */ +- if (!ste->bypass) ++ if (ste->assigned) + arm_smmu_detach_dev(dev); + + mutex_lock(&smmu_domain->init_mutex); +@@ -1649,10 +1661,12 @@ static int arm_smmu_attach_dev(struct io + goto out_unlock; + } + +- ste->bypass = false; +- ste->valid = true; ++ ste->assigned = true; + +- if (smmu_domain->stage == ARM_SMMU_DOMAIN_S1) { ++ if (smmu_domain->stage == ARM_SMMU_DOMAIN_BYPASS) { ++ ste->s1_cfg = NULL; ++ ste->s2_cfg = NULL; ++ } else if (smmu_domain->stage == ARM_SMMU_DOMAIN_S1) { + ste->s1_cfg = &smmu_domain->s1_cfg; + ste->s2_cfg = NULL; + arm_smmu_write_ctx_desc(smmu, ste->s1_cfg); +@@ -1661,10 +1675,7 @@ static int arm_smmu_attach_dev(struct io + ste->s2_cfg = &smmu_domain->s2_cfg; + } + +- ret = arm_smmu_install_ste_for_dev(dev->iommu_fwspec); +- if (ret < 0) +- ste->valid = false; +- ++ arm_smmu_install_ste_for_dev(dev->iommu_fwspec); + out_unlock: + mutex_unlock(&smmu_domain->init_mutex); + return ret; +@@ -1712,6 +1723,9 @@ arm_smmu_iova_to_phys(struct iommu_domai struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); struct io_pgtable_ops *ops = smmu_domain->pgtbl_ops; @@ -162,7 +322,36 @@ Signed-off-by: Yangbo Lu if (!ops) return 0; -@@ -1880,6 +1884,31 @@ static int arm_smmu_of_xlate(struct devi +@@ -1810,7 +1824,7 @@ static void arm_smmu_remove_device(struc + return; + + master = fwspec->iommu_priv; +- if (master && master->ste.valid) ++ if (master && master->ste.assigned) + arm_smmu_detach_dev(dev); + iommu_group_remove_device(dev); + kfree(master); +@@ -1839,6 +1853,9 @@ static int arm_smmu_domain_get_attr(stru + { + struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); + ++ if (domain->type != IOMMU_DOMAIN_UNMANAGED) ++ return -EINVAL; ++ + switch (attr) { + case DOMAIN_ATTR_NESTING: + *(int *)data = (smmu_domain->stage == ARM_SMMU_DOMAIN_NESTED); +@@ -1854,6 +1871,9 @@ static int arm_smmu_domain_set_attr(stru + int ret = 0; + struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); + ++ if (domain->type != IOMMU_DOMAIN_UNMANAGED) ++ return -EINVAL; ++ + mutex_lock(&smmu_domain->init_mutex); + + switch (attr) { +@@ -1883,6 +1903,31 @@ static int arm_smmu_of_xlate(struct devi return iommu_fwspec_add_ids(dev, args->args, 1); } @@ -194,7 +383,7 @@ Signed-off-by: Yangbo Lu static struct iommu_ops arm_smmu_ops = { .capable = arm_smmu_capable, .domain_alloc = arm_smmu_domain_alloc, -@@ -1895,6 +1924,8 @@ static struct iommu_ops arm_smmu_ops = { +@@ -1898,6 +1943,8 @@ static struct iommu_ops arm_smmu_ops = { .domain_get_attr = arm_smmu_domain_get_attr, .domain_set_attr = arm_smmu_domain_set_attr, .of_xlate = arm_smmu_of_xlate, @@ -231,7 +420,65 @@ Signed-off-by: Yangbo Lu static int force_stage; module_param(force_stage, int, S_IRUGO); MODULE_PARM_DESC(force_stage, -@@ -1343,6 +1348,9 @@ static phys_addr_t arm_smmu_iova_to_phys +@@ -401,6 +406,7 @@ enum arm_smmu_domain_stage { + ARM_SMMU_DOMAIN_S1 = 0, + ARM_SMMU_DOMAIN_S2, + ARM_SMMU_DOMAIN_NESTED, ++ ARM_SMMU_DOMAIN_BYPASS, + }; + + struct arm_smmu_domain { +@@ -821,6 +827,12 @@ static int arm_smmu_init_domain_context( + if (smmu_domain->smmu) + goto out_unlock; + ++ if (domain->type == IOMMU_DOMAIN_IDENTITY) { ++ smmu_domain->stage = ARM_SMMU_DOMAIN_BYPASS; ++ smmu_domain->smmu = smmu; ++ goto out_unlock; ++ } ++ + /* + * Mapping the requested stage onto what we support is surprisingly + * complicated, mainly because the spec allows S1+S2 SMMUs without +@@ -981,7 +993,7 @@ static void arm_smmu_destroy_domain_cont + void __iomem *cb_base; + int irq; + +- if (!smmu) ++ if (!smmu || domain->type == IOMMU_DOMAIN_IDENTITY) + return; + + /* +@@ -1004,7 +1016,9 @@ static struct iommu_domain *arm_smmu_dom + { + struct arm_smmu_domain *smmu_domain; + +- if (type != IOMMU_DOMAIN_UNMANAGED && type != IOMMU_DOMAIN_DMA) ++ if (type != IOMMU_DOMAIN_UNMANAGED && ++ type != IOMMU_DOMAIN_DMA && ++ type != IOMMU_DOMAIN_IDENTITY) + return NULL; + /* + * Allocate the domain and initialise some of its data structures. +@@ -1202,10 +1216,15 @@ static int arm_smmu_domain_add_master(st + { + struct arm_smmu_device *smmu = smmu_domain->smmu; + struct arm_smmu_s2cr *s2cr = smmu->s2crs; +- enum arm_smmu_s2cr_type type = S2CR_TYPE_TRANS; + u8 cbndx = smmu_domain->cfg.cbndx; ++ enum arm_smmu_s2cr_type type; + int i, idx; + ++ if (smmu_domain->stage == ARM_SMMU_DOMAIN_BYPASS) ++ type = S2CR_TYPE_BYPASS; ++ else ++ type = S2CR_TYPE_TRANS; ++ + for_each_cfg_sme(fwspec, i, idx) { + if (type == s2cr[idx].type && cbndx == s2cr[idx].cbndx) + continue; +@@ -1343,6 +1362,9 @@ static phys_addr_t arm_smmu_iova_to_phys struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); struct io_pgtable_ops *ops= smmu_domain->pgtbl_ops; @@ -241,7 +488,7 @@ Signed-off-by: Yangbo Lu if (!ops) return 0; -@@ -1368,8 +1376,6 @@ static bool arm_smmu_capable(enum iommu_ +@@ -1368,8 +1390,6 @@ static bool arm_smmu_capable(enum iommu_ * requests. */ return true; @@ -250,7 +497,7 @@ Signed-off-by: Yangbo Lu case IOMMU_CAP_NOEXEC: return true; default: -@@ -1478,10 +1484,12 @@ static struct iommu_group *arm_smmu_devi +@@ -1478,10 +1498,12 @@ static struct iommu_group *arm_smmu_devi } if (group) @@ -264,7 +511,27 @@ Signed-off-by: Yangbo Lu else group = generic_device_group(dev); -@@ -1534,17 +1542,44 @@ out_unlock: +@@ -1493,6 +1515,9 @@ static int arm_smmu_domain_get_attr(stru + { + struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); + ++ if (domain->type != IOMMU_DOMAIN_UNMANAGED) ++ return -EINVAL; ++ + switch (attr) { + case DOMAIN_ATTR_NESTING: + *(int *)data = (smmu_domain->stage == ARM_SMMU_DOMAIN_NESTED); +@@ -1508,6 +1533,9 @@ static int arm_smmu_domain_set_attr(stru + int ret = 0; + struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); + ++ if (domain->type != IOMMU_DOMAIN_UNMANAGED) ++ return -EINVAL; ++ + mutex_lock(&smmu_domain->init_mutex); + + switch (attr) { +@@ -1534,17 +1562,44 @@ out_unlock: static int arm_smmu_of_xlate(struct device *dev, struct of_phandle_args *args) { @@ -310,7 +577,7 @@ Signed-off-by: Yangbo Lu static struct iommu_ops arm_smmu_ops = { .capable = arm_smmu_capable, .domain_alloc = arm_smmu_domain_alloc, -@@ -1560,6 +1595,8 @@ static struct iommu_ops arm_smmu_ops = { +@@ -1560,6 +1615,8 @@ static struct iommu_ops arm_smmu_ops = { .domain_get_attr = arm_smmu_domain_get_attr, .domain_set_attr = arm_smmu_domain_set_attr, .of_xlate = arm_smmu_of_xlate, @@ -319,7 +586,7 @@ Signed-off-by: Yangbo Lu .pgsize_bitmap = -1UL, /* Restricted during device attach */ }; -@@ -1581,16 +1618,22 @@ static void arm_smmu_device_reset(struct +@@ -1581,16 +1638,22 @@ static void arm_smmu_device_reset(struct for (i = 0; i < smmu->num_mapping_groups; ++i) arm_smmu_write_sme(smmu, i); @@ -351,7 +618,7 @@ Signed-off-by: Yangbo Lu writel_relaxed(reg, gr0_base + ARM_SMMU_GR0_sACR); } -@@ -2024,6 +2067,11 @@ static int arm_smmu_device_dt_probe(stru +@@ -2024,6 +2087,11 @@ static int arm_smmu_device_dt_probe(stru bus_set_iommu(&pci_bus_type, &arm_smmu_ops); } #endif @@ -728,7 +995,7 @@ Signed-off-by: Yangbo Lu }; struct dmar_atsr_unit { -@@ -4250,27 +4251,40 @@ static inline void init_iommu_pm_ops(voi +@@ -4252,27 +4253,40 @@ static inline void init_iommu_pm_ops(voi int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg) { struct acpi_dmar_reserved_memory *rmrr; @@ -774,7 +1041,7 @@ Signed-off-by: Yangbo Lu } static struct dmar_atsr_unit *dmar_find_atsr(struct acpi_dmar_atsr *atsr) -@@ -4484,6 +4498,7 @@ static void intel_iommu_free_dmars(void) +@@ -4486,6 +4500,7 @@ static void intel_iommu_free_dmars(void) list_for_each_entry_safe(rmrru, rmrr_n, &dmar_rmrr_units, list) { list_del(&rmrru->list); dmar_free_dev_scope(&rmrru->devices, &rmrru->devices_cnt); @@ -782,7 +1049,7 @@ Signed-off-by: Yangbo Lu kfree(rmrru); } -@@ -5219,6 +5234,45 @@ static void intel_iommu_remove_device(st +@@ -5221,6 +5236,45 @@ static void intel_iommu_remove_device(st iommu_device_unlink(iommu->iommu_dev, dev); } @@ -828,7 +1095,7 @@ Signed-off-by: Yangbo Lu #ifdef CONFIG_INTEL_IOMMU_SVM #define MAX_NR_PASID_BITS (20) static inline unsigned long intel_iommu_get_pts(struct intel_iommu *iommu) -@@ -5349,19 +5403,21 @@ struct intel_iommu *intel_svm_device_to_ +@@ -5351,19 +5405,21 @@ struct intel_iommu *intel_svm_device_to_ #endif /* CONFIG_INTEL_IOMMU_SVM */ static const struct iommu_ops intel_iommu_ops = { @@ -865,7 +1132,15 @@ Signed-off-by: Yangbo Lu static void quirk_iommu_g4x_gfx(struct pci_dev *dev) --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c -@@ -68,6 +68,13 @@ struct iommu_group_attribute { +@@ -36,6 +36,7 @@ + + static struct kset *iommu_group_kset; + static DEFINE_IDA(iommu_group_ida); ++static unsigned int iommu_def_domain_type = IOMMU_DOMAIN_DMA; + + struct iommu_callback_data { + const struct iommu_ops *ops; +@@ -68,6 +69,13 @@ struct iommu_group_attribute { const char *buf, size_t count); }; @@ -879,7 +1154,26 @@ Signed-off-by: Yangbo Lu #define IOMMU_GROUP_ATTR(_name, _mode, _show, _store) \ struct iommu_group_attribute iommu_group_attr_##_name = \ __ATTR(_name, _mode, _show, _store) -@@ -133,8 +140,131 @@ static ssize_t iommu_group_show_name(str +@@ -86,6 +94,18 @@ static int __iommu_attach_group(struct i + static void __iommu_detach_group(struct iommu_domain *domain, + struct iommu_group *group); + ++static int __init iommu_set_def_domain_type(char *str) ++{ ++ bool pt; ++ ++ if (!str || strtobool(str, &pt)) ++ return -EINVAL; ++ ++ iommu_def_domain_type = pt ? IOMMU_DOMAIN_IDENTITY : IOMMU_DOMAIN_DMA; ++ return 0; ++} ++early_param("iommu.passthrough", iommu_set_def_domain_type); ++ + static ssize_t iommu_group_attr_show(struct kobject *kobj, + struct attribute *__attr, char *buf) + { +@@ -133,8 +153,131 @@ static ssize_t iommu_group_show_name(str return sprintf(buf, "%s\n", group->name); } @@ -1011,7 +1305,7 @@ Signed-off-by: Yangbo Lu static void iommu_group_release(struct kobject *kobj) { struct iommu_group *group = to_iommu_group(kobj); -@@ -212,6 +342,11 @@ struct iommu_group *iommu_group_alloc(vo +@@ -212,6 +355,11 @@ struct iommu_group *iommu_group_alloc(vo */ kobject_put(&group->kobj); @@ -1023,7 +1317,7 @@ Signed-off-by: Yangbo Lu pr_debug("Allocated group %d\n", group->id); return group; -@@ -318,7 +453,7 @@ static int iommu_group_create_direct_map +@@ -318,7 +466,7 @@ static int iommu_group_create_direct_map struct device *dev) { struct iommu_domain *domain = group->default_domain; @@ -1032,7 +1326,7 @@ Signed-off-by: Yangbo Lu struct list_head mappings; unsigned long pg_size; int ret = 0; -@@ -331,18 +466,21 @@ static int iommu_group_create_direct_map +@@ -331,18 +479,21 @@ static int iommu_group_create_direct_map pg_size = 1UL << __ffs(domain->pgsize_bitmap); INIT_LIST_HEAD(&mappings); @@ -1057,7 +1351,7 @@ Signed-off-by: Yangbo Lu for (addr = start; addr < end; addr += pg_size) { phys_addr_t phys_addr; -@@ -358,7 +496,7 @@ static int iommu_group_create_direct_map +@@ -358,7 +509,7 @@ static int iommu_group_create_direct_map } out: @@ -1066,7 +1360,7 @@ Signed-off-by: Yangbo Lu return ret; } -@@ -563,6 +701,19 @@ struct iommu_group *iommu_group_get(stru +@@ -563,6 +714,19 @@ struct iommu_group *iommu_group_get(stru EXPORT_SYMBOL_GPL(iommu_group_get); /** @@ -1086,7 +1380,30 @@ Signed-off-by: Yangbo Lu * iommu_group_put - Decrement group reference * @group: the group to use * -@@ -1557,20 +1708,38 @@ int iommu_domain_set_attr(struct iommu_d +@@ -845,10 +1009,19 @@ struct iommu_group *iommu_group_get_for_ + * IOMMU driver. + */ + if (!group->default_domain) { +- group->default_domain = __iommu_domain_alloc(dev->bus, +- IOMMU_DOMAIN_DMA); ++ struct iommu_domain *dom; ++ ++ dom = __iommu_domain_alloc(dev->bus, iommu_def_domain_type); ++ if (!dom && iommu_def_domain_type != IOMMU_DOMAIN_DMA) { ++ dev_warn(dev, ++ "failed to allocate default IOMMU domain of type %u; falling back to IOMMU_DOMAIN_DMA", ++ iommu_def_domain_type); ++ dom = __iommu_domain_alloc(dev->bus, IOMMU_DOMAIN_DMA); ++ } ++ ++ group->default_domain = dom; + if (!group->domain) +- group->domain = group->default_domain; ++ group->domain = dom; + } + + ret = iommu_group_add_device(group, dev); +@@ -1557,20 +1730,38 @@ int iommu_domain_set_attr(struct iommu_d } EXPORT_SYMBOL_GPL(iommu_domain_set_attr); diff --git a/target/linux/layerscape/patches-4.9/815-spi-support-layerscape.patch b/target/linux/layerscape/patches-4.9/815-spi-support-layerscape.patch index b9c5316518..761680913b 100644 --- a/target/linux/layerscape/patches-4.9/815-spi-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/815-spi-support-layerscape.patch @@ -15,16 +15,6 @@ Signed-off-by: Yangbo Lu drivers/spi/spi-fsl-dspi.c | 309 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 305 insertions(+), 5 deletions(-) ---- a/drivers/spi/Kconfig -+++ b/drivers/spi/Kconfig -@@ -365,6 +365,7 @@ config SPI_FSL_SPI - config SPI_FSL_DSPI - tristate "Freescale DSPI controller" - select REGMAP_MMIO -+ depends on HAS_DMA - depends on SOC_VF610 || SOC_LS1021A || ARCH_LAYERSCAPE || COMPILE_TEST - help - This enables support for the Freescale DSPI controller in master --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -15,6 +15,8 @@ diff --git a/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch b/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch index 147b03ae27..2e7885a694 100644 --- a/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch @@ -1,4 +1,4 @@ -From f8daa8e984213554008e73cd155530dceec5a109 Mon Sep 17 00:00:00 2001 +From b14460ee524a34d3b94b44032b52155c4cd708e5 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Wed, 27 Sep 2017 10:34:07 +0800 Subject: [PATCH] usb: support layerscape @@ -15,6 +15,7 @@ Signed-off-by: Suresh Gupta Signed-off-by: Zhao Chenhui Signed-off-by: Yangbo Lu --- + drivers/net/usb/r8152.c | 4 + drivers/usb/common/common.c | 50 ++++++ drivers/usb/core/hub.c | 8 + drivers/usb/dwc3/core.c | 235 ++++++++++++++++++++++++++- @@ -32,8 +33,21 @@ Signed-off-by: Yangbo Lu drivers/usb/phy/phy-fsl-usb.h | 8 + include/linux/usb.h | 1 + include/linux/usb/of.h | 2 + - 17 files changed, 726 insertions(+), 73 deletions(-) + 18 files changed, 730 insertions(+), 73 deletions(-) +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -1816,6 +1816,10 @@ static int rx_bottom(struct r8152 *tp, i + unsigned int pkt_len; + struct sk_buff *skb; + ++ /* limite the skb numbers for rx_queue */ ++ if (unlikely(skb_queue_len(&tp->rx_queue) >= 1000)) ++ break; ++ + pkt_len = le32_to_cpu(rx_desc->opts1) & RX_LEN_MASK; + if (pkt_len < ETH_ZLEN) + break; --- a/drivers/usb/common/common.c +++ b/drivers/usb/common/common.c @@ -105,6 +105,56 @@ static const char *const usb_dr_modes[] @@ -95,7 +109,7 @@ Signed-off-by: Yangbo Lu int ret; --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -4412,6 +4412,14 @@ hub_port_init(struct usb_hub *hub, struc +@@ -4415,6 +4415,14 @@ hub_port_init(struct usb_hub *hub, struc else speed = usb_speed_string(udev->speed); diff --git a/target/linux/malta/Makefile b/target/linux/malta/Makefile index 34818f17ba..1833f95ba6 100644 --- a/target/linux/malta/Makefile +++ b/target/linux/malta/Makefile @@ -14,7 +14,7 @@ INITRAMFS_EXTRA_FILES:= MAINTAINER:=Florian Fainelli FEATURES:=ramdisk -KERNEL_PATCHVER:=4.4 +KERNEL_PATCHVER:=4.14 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/malta/README b/target/linux/malta/README index c34afe110e..0bb1a1e35a 100644 --- a/target/linux/malta/README +++ b/target/linux/malta/README @@ -4,10 +4,16 @@ troubleshoot MIPS applications without access to real hardware. To use the images built by OpenWrt with qemu, use the following commands: -For the little-endian image: -qemu-system-mipsel -kernel bin/targets/malta/le/lede-malta-le-vmlinux-initramfs.elf -nographic -m 256 +For the 32 bit little-endian image: +qemu-system-mipsel -kernel bin/targets/malta/le/openwrt-malta-le-vmlinux-initramfs.elf -nographic -m 256 -For the big-endian image: -qemu-system-mips -kernel bin/targets/malta/be/lede-malta-be-vmlinux-initramfs.elf -nographic -m 256 +For the 32 bit big-endian image: +qemu-system-mips -kernel bin/targets/malta/be/openwrt-malta-be-vmlinux-initramfs.elf -nographic -m 256 + +For the 64 bit little-endian image: +qemu-system-mips64el -kernel bin/targets/malta/le64/openwrt-malta-le64-vmlinux-initramfs.elf -nographic -m 256 + +For the 64 bit big-endian image: +qemu-system-mips64 -kernel bin/targets/malta/be64/openwrt-malta-be64-vmlinux-initramfs.elf -nographic -m 256 and enjoy the system bootin. diff --git a/target/linux/malta/be/config-default b/target/linux/malta/be/config-default index 2772ed75bd..f51301a058 100644 --- a/target/linux/malta/be/config-default +++ b/target/linux/malta/be/config-default @@ -1,9 +1,3 @@ CONFIG_CPU_BIG_ENDIAN=y # CONFIG_CPU_LITTLE_ENDIAN is not set -CONFIG_CPU_MIPS32=y -# CONFIG_CPU_MIPS32_R1 is not set CONFIG_CPU_MIPS32_R2=y -# CONFIG_CPU_MIPS64_R1 is not set -# CONFIG_CPU_MIPS64_R2 is not set -CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set diff --git a/target/linux/malta/be64/config-default b/target/linux/malta/be64/config-default index 374e29a562..2c0c9d2db9 100644 --- a/target/linux/malta/be64/config-default +++ b/target/linux/malta/be64/config-default @@ -1,6 +1,7 @@ # CONFIG_32BIT is not set CONFIG_64BIT=y CONFIG_ARCH_DMA_ADDR_T_64BIT=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y CONFIG_BINFMT_ELF32=y @@ -8,15 +9,10 @@ CONFIG_BLOCK_COMPAT=y CONFIG_COMPAT=y CONFIG_COMPAT_NETLINK_MESSAGES=y CONFIG_CPU_BIG_ENDIAN=y -# CONFIG_LIQUIDIO is not set # CONFIG_CPU_LITTLE_ENDIAN is not set -# CONFIG_CPU_MIPS32_R1 is not set -# CONFIG_CPU_MIPS32_R2 is not set CONFIG_CPU_MIPS64=y CONFIG_CPU_MIPS64_R1=y -# CONFIG_CPU_MIPS64_R2 is not set CONFIG_CPU_MIPSR1=y -CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y CONFIG_CPU_SUPPORTS_HUGEPAGES=y CONFIG_HAVE_64BIT_ALIGNED_ACCESS=y @@ -25,13 +21,11 @@ CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y CONFIG_MIPS32_COMPAT=y CONFIG_MIPS32_N32=y CONFIG_MIPS32_O32=y +# CONFIG_MIPS_VA_BITS_48 is not set CONFIG_MODULES_USE_ELF_RELA=y CONFIG_PCI_BUS_ADDR_T_64BIT=y CONFIG_PGTABLE_LEVELS=3 CONFIG_PHYS_ADDR_T_64BIT=y CONFIG_SYSVIPC_COMPAT=y CONFIG_SYS_SUPPORTS_HUGETLBFS=y -# CONFIG_THUNDER_NIC_BGX is not set -# CONFIG_THUNDER_NIC_PF is not set -# CONFIG_THUNDER_NIC_VF is not set CONFIG_ZONE_DMA32=y diff --git a/target/linux/malta/config-4.14 b/target/linux/malta/config-4.14 new file mode 100644 index 0000000000..61684be9ab --- /dev/null +++ b/target/linux/malta/config-4.14 @@ -0,0 +1,309 @@ +CONFIG_ARCH_BINFMT_ELF_STATE=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_DISCARD_MEMBLOCK=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set +# CONFIG_ARCH_HAS_SG_CHAIN is not set +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ATA=y +CONFIG_ATA_PIIX=y +CONFIG_BLK_DEV_BSG=y +CONFIG_BLK_DEV_BSGLIB=y +# CONFIG_BLK_DEV_DM is not set +# CONFIG_BLK_DEV_INITRD is not set +# CONFIG_BLK_DEV_MD is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=4096 +CONFIG_BLK_DEV_SD=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BOARD_SCACHE=y +CONFIG_BOOT_ELF32=y +CONFIG_BOUNCE=y +CONFIG_BUILTIN_DTB=y +CONFIG_CEVT_R4K=y +CONFIG_CLKBLD_I8253=y +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLKEVT_I8253=y +CONFIG_CLKSRC_I8253=y +CONFIG_CLKSRC_MIPS_GIC=y +CONFIG_CLKSRC_OF=y +CONFIG_CLKSRC_PROBE=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_COMMON_CLK=y +# CONFIG_COMMON_CLK_BOSTON is not set +CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_CPU_GENERIC_DUMP_TLB=y +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_CPU_HAS_RIXI=y +# CONFIG_CPU_HAS_SMARTMIPS is not set +CONFIG_CPU_HAS_SYNC=y +# CONFIG_CPU_MICROMIPS is not set +CONFIG_CPU_MIPS32=y +# CONFIG_CPU_MIPS32_3_5_FEATURES is not set +# CONFIG_CPU_MIPS32_R1 is not set +# CONFIG_CPU_MIPS32_R2 is not set +# CONFIG_CPU_MIPS32_R5_FEATURES is not set +# CONFIG_CPU_MIPS32_R6 is not set +# CONFIG_CPU_MIPS64_R1 is not set +# CONFIG_CPU_MIPS64_R2 is not set +# CONFIG_CPU_MIPS64_R6 is not set +CONFIG_CPU_MIPSR2=y +CONFIG_CPU_MIPSR2_IRQ_EI=y +CONFIG_CPU_MIPSR2_IRQ_VI=y +CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y +# CONFIG_CPU_NEVADA is not set +CONFIG_CPU_R4K_CACHE_TLB=y +CONFIG_CPU_R4K_FPU=y +# CONFIG_CPU_RM7000 is not set +CONFIG_CPU_RMAP=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_CPU_SUPPORTS_MSA=y +CONFIG_CRC16=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_NULL2=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_CSRC_R4K=y +CONFIG_DMA_MAYBE_COHERENT=y +CONFIG_DMA_NONCOHERENT=y +CONFIG_DNOTIFY=y +CONFIG_DTC=y +CONFIG_DUMMY_CONSOLE=y +CONFIG_ENABLE_MUST_CHECK=y +CONFIG_EXT4_FS=y +CONFIG_FIRMWARE_IN_KERNEL=y +CONFIG_FS_MBCACHE=y +CONFIG_FS_POSIX_ACL=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_IPI=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GLOB=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDWARE_WATCHPOINTS=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set +# CONFIG_HAVE_ARCH_BITREVERSE is not set +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_CBPF_JIT=y +CONFIG_HAVE_CC_STACKPROTECTOR=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DEBUG_STACKOVERFLOW=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_KVM=y +CONFIG_HAVE_LATENCYTOP_SUPPORT=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MEMBLOCK_NODE_MAP=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_PCSPKR_PLATFORM=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HW_CONSOLE=y +CONFIG_HW_HAS_PCI=y +CONFIG_I8253=y +CONFIG_I8253_LOCK=y +CONFIG_I8259=y +CONFIG_INPUT=y +# CONFIG_INPUT_MISC is not set +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +# CONFIG_IP_MROUTE is not set +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_MIPS_CPU=y +CONFIG_IRQ_WORK=y +CONFIG_ISA_DMA_API=y +CONFIG_JBD2=y +CONFIG_JFFS2_FS_POSIX_ACL=y +CONFIG_JFFS2_FS_SECURITY=y +CONFIG_KALLSYMS=y +CONFIG_KERNEL_GZIP=y +# CONFIG_KERNEL_XZ is not set +# CONFIG_LEDS_TRIGGER_TIMER is not set +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_LIBFDT=y +CONFIG_MD=y +CONFIG_MIPS=y +CONFIG_MIPS_ASID_BITS=8 +CONFIG_MIPS_ASID_SHIFT=0 +CONFIG_MIPS_BONITO64=y +CONFIG_MIPS_CLOCK_VSYSCALL=y +CONFIG_MIPS_CM=y +# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set +CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y +# CONFIG_MIPS_CMDLINE_FROM_DTB is not set +# CONFIG_MIPS_CMP is not set +# CONFIG_MIPS_CPS is not set +CONFIG_MIPS_CPU_SCACHE=y +# CONFIG_MIPS_ELF_APPENDED_DTB is not set +CONFIG_MIPS_EXTERNAL_TIMER=y +CONFIG_MIPS_GIC=y +# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set +CONFIG_MIPS_L1_CACHE_SHIFT=6 +CONFIG_MIPS_L1_CACHE_SHIFT_6=y +# CONFIG_MIPS_MACHINE is not set +CONFIG_MIPS_MALTA=y +CONFIG_MIPS_MALTA_PM=y +CONFIG_MIPS_MSC=y +CONFIG_MIPS_MT=y +CONFIG_MIPS_MT_FPAFF=y +CONFIG_MIPS_MT_SMP=y +CONFIG_MIPS_NO_APPENDED_DTB=y +CONFIG_MIPS_PERF_SHARED_TC_COUNTERS=y +# CONFIG_MIPS_RAW_APPENDED_DTB is not set +CONFIG_MIPS_SPRAM=y +# CONFIG_MIPS_VPE_LOADER is not set +CONFIG_MODULES_TREE_LOOKUP=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MODULE_FORCE_UNLOAD=y +CONFIG_MTD_CFI_STAA=y +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +CONFIG_MTD_PHYSMAP=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +CONFIG_NO_HZ=y +CONFIG_NO_HZ_COMMON=y +CONFIG_NO_HZ_IDLE=y +# CONFIG_NO_IOPORT_MAP is not set +CONFIG_NR_CPUS=2 +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_ADDRESS_PCI=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_IRQ=y +CONFIG_OF_NET=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_PADATA=y +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DRIVERS_LEGACY=y +CONFIG_PCI_GT64XXX_PCI0=y +CONFIG_PCSPKR_PLATFORM=y +CONFIG_PERF_EVENTS=y +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PRINT_QUOTA_WARNING=y +CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 +CONFIG_PROC_PAGE_MONITOR=y +# CONFIG_QFMT_V1 is not set +CONFIG_QFMT_V2=y +CONFIG_QUOTA=y +CONFIG_QUOTACTL=y +# CONFIG_QUOTA_NETLINK_INTERFACE is not set +CONFIG_QUOTA_TREE=y +CONFIG_RATIONAL=y +CONFIG_RCU_STALL_COMMON=y +CONFIG_RELAY=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_MC146818_LIB=y +# CONFIG_SCHED_INFO is not set +CONFIG_SCSI=y +CONFIG_SECCOMP=y +CONFIG_SECCOMP_FILTER=y +# CONFIG_SERIAL_8250_FSL is not set +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SERIO=y +CONFIG_SERIO_SERPORT=y +CONFIG_SG_POOL=y +CONFIG_SMP=y +CONFIG_SMP_UP=y +CONFIG_SRCU=y +CONFIG_SWAP_IO_SPACE=y +CONFIG_SYNC_R4K=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +CONFIG_SYSFS_DEPRECATED=y +CONFIG_SYSFS_DEPRECATED_V2=y +CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_SYS_HAS_CPU_MIPS32_R2=y +CONFIG_SYS_HAS_CPU_MIPS32_R3_5=y +CONFIG_SYS_HAS_CPU_MIPS32_R5=y +CONFIG_SYS_HAS_CPU_MIPS32_R6=y +CONFIG_SYS_HAS_CPU_MIPS64_R1=y +CONFIG_SYS_HAS_CPU_MIPS64_R2=y +CONFIG_SYS_HAS_CPU_MIPS64_R6=y +CONFIG_SYS_HAS_CPU_NEVADA=y +CONFIG_SYS_HAS_CPU_RM7000=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y +CONFIG_SYS_SUPPORTS_HIGHMEM=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y +CONFIG_SYS_SUPPORTS_MICROMIPS=y +CONFIG_SYS_SUPPORTS_MIPS16=y +CONFIG_SYS_SUPPORTS_MIPS_CMP=y +CONFIG_SYS_SUPPORTS_MIPS_CPS=y +CONFIG_SYS_SUPPORTS_MULTITHREADING=y +CONFIG_SYS_SUPPORTS_RELOCATABLE=y +CONFIG_SYS_SUPPORTS_SCHED_SMT=y +CONFIG_SYS_SUPPORTS_SMARTMIPS=y +CONFIG_SYS_SUPPORTS_SMP=y +CONFIG_SYS_SUPPORTS_ZBOOT=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TREE_RCU=y +CONFIG_USB_SUPPORT=y +# CONFIG_USERIO is not set +CONFIG_USE_OF=y +# CONFIG_VGA_CONSOLE is not set +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_VXFS_FS=y +CONFIG_XPS=y diff --git a/target/linux/malta/config-4.4 b/target/linux/malta/config-4.9 similarity index 90% rename from target/linux/malta/config-4.4 rename to target/linux/malta/config-4.9 index d027c9db93..0e9daf6e09 100644 --- a/target/linux/malta/config-4.4 +++ b/target/linux/malta/config-4.9 @@ -1,7 +1,6 @@ CONFIG_ARCH_BINFMT_ELF_STATE=y CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_ARCH_DISCARD_MEMBLOCK=y -CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y # CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set # CONFIG_ARCH_HAS_SG_CHAIN is not set @@ -10,7 +9,6 @@ CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_ARCH_USE_BUILTIN_BSWAP=y -CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y CONFIG_ATA=y CONFIG_ATA_PIIX=y @@ -23,11 +21,11 @@ CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_SD=y +CONFIG_BLK_MQ_PCI=y CONFIG_BOARD_SCACHE=y CONFIG_BOOT_ELF32=y CONFIG_BOUNCE=y CONFIG_BUILTIN_DTB=y -CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_CEVT_R4K=y CONFIG_CLKBLD_I8253=y CONFIG_CLKDEV_LOOKUP=y @@ -41,12 +39,18 @@ CONFIG_COMMON_CLK=y CONFIG_CONSOLE_TRANSLATIONS=y CONFIG_CPU_GENERIC_DUMP_TLB=y CONFIG_CPU_HAS_PREFETCH=y +CONFIG_CPU_HAS_RIXI=y # CONFIG_CPU_HAS_SMARTMIPS is not set CONFIG_CPU_HAS_SYNC=y # CONFIG_CPU_MICROMIPS is not set +CONFIG_CPU_MIPS32=y # CONFIG_CPU_MIPS32_3_5_FEATURES is not set +# CONFIG_CPU_MIPS32_R1 is not set +# CONFIG_CPU_MIPS32_R2 is not set # CONFIG_CPU_MIPS32_R5_FEATURES is not set # CONFIG_CPU_MIPS32_R6 is not set +# CONFIG_CPU_MIPS64_R1 is not set +# CONFIG_CPU_MIPS64_R2 is not set # CONFIG_CPU_MIPS64_R6 is not set CONFIG_CPU_MIPSR2=y CONFIG_CPU_MIPSR2_IRQ_EI=y @@ -57,16 +61,21 @@ CONFIG_CPU_R4K_CACHE_TLB=y CONFIG_CPU_R4K_FPU=y # CONFIG_CPU_RM7000 is not set CONFIG_CPU_RMAP=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y CONFIG_CPU_SUPPORTS_HIGHMEM=y CONFIG_CPU_SUPPORTS_MSA=y CONFIG_CRC16=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y CONFIG_CRYPTO_CRC32C=y CONFIG_CRYPTO_HASH=y CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_NULL2=y CONFIG_CRYPTO_RNG2=y CONFIG_CRYPTO_WORKQUEUE=y CONFIG_CSRC_R4K=y -# CONFIG_DEBUG_FS is not set CONFIG_DMA_MAYBE_COHERENT=y CONFIG_DMA_NONCOHERENT=y CONFIG_DNOTIFY=y @@ -82,6 +91,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y CONFIG_GENERIC_IO=y CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_IPI=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_PCI_IOMAP=y @@ -89,17 +99,19 @@ CONFIG_GENERIC_SCHED_CLOCK=y CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GLOB=y +CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDWARE_WATCHPOINTS=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set # CONFIG_HAVE_ARCH_BITREVERSE is not set CONFIG_HAVE_ARCH_JUMP_LABEL=y CONFIG_HAVE_ARCH_KGDB=y CONFIG_HAVE_ARCH_SECCOMP_FILTER=y CONFIG_HAVE_ARCH_TRACEHOOK=y # CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_HAVE_BPF_JIT=y +CONFIG_HAVE_CBPF_JIT=y CONFIG_HAVE_CC_STACKPROTECTOR=y CONFIG_HAVE_CLK=y CONFIG_HAVE_CLK_PREPARE=y @@ -108,7 +120,6 @@ CONFIG_HAVE_C_RECORDMCOUNT=y CONFIG_HAVE_DEBUG_KMEMLEAK=y CONFIG_HAVE_DEBUG_STACKOVERFLOW=y CONFIG_HAVE_DMA_API_DEBUG=y -CONFIG_HAVE_DMA_ATTRS=y CONFIG_HAVE_DMA_CONTIGUOUS=y CONFIG_HAVE_DYNAMIC_FTRACE=y CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y @@ -116,13 +127,8 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y CONFIG_HAVE_FUNCTION_TRACER=y CONFIG_HAVE_GENERIC_DMA_COHERENT=y CONFIG_HAVE_IDE=y +CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_KERNEL_BZIP2=y -CONFIG_HAVE_KERNEL_GZIP=y -CONFIG_HAVE_KERNEL_LZ4=y -CONFIG_HAVE_KERNEL_LZMA=y -CONFIG_HAVE_KERNEL_LZO=y -CONFIG_HAVE_KERNEL_XZ=y CONFIG_HAVE_KVM=y CONFIG_HAVE_LATENCYTOP_SUPPORT=y CONFIG_HAVE_MEMBLOCK=y @@ -132,6 +138,7 @@ CONFIG_HAVE_NET_DSA=y CONFIG_HAVE_OPROFILE=y CONFIG_HAVE_PCSPKR_PLATFORM=y CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y CONFIG_HW_CONSOLE=y @@ -148,6 +155,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_IP_MROUTE is not set CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_MIPS_CPU=y CONFIG_IRQ_WORK=y @@ -155,7 +163,6 @@ CONFIG_ISA_DMA_API=y CONFIG_JBD2=y CONFIG_JFFS2_FS_POSIX_ACL=y CONFIG_JFFS2_FS_SECURITY=y -# CONFIG_JFFS2_SUMMARY is not set CONFIG_KALLSYMS=y CONFIG_KERNEL_GZIP=y # CONFIG_KERNEL_XZ is not set @@ -165,6 +172,8 @@ CONFIG_LEGACY_PTY_COUNT=256 CONFIG_LIBFDT=y CONFIG_MD=y CONFIG_MIPS=y +CONFIG_MIPS_ASID_BITS=8 +CONFIG_MIPS_ASID_SHIFT=0 CONFIG_MIPS_BONITO64=y CONFIG_MIPS_CLOCK_VSYSCALL=y CONFIG_MIPS_CM=y @@ -177,7 +186,6 @@ CONFIG_MIPS_CPU_SCACHE=y # CONFIG_MIPS_ELF_APPENDED_DTB is not set CONFIG_MIPS_EXTERNAL_TIMER=y CONFIG_MIPS_GIC=y -CONFIG_MIPS_GIC_IPI=y # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set CONFIG_MIPS_L1_CACHE_SHIFT=6 CONFIG_MIPS_L1_CACHE_SHIFT_6=y @@ -193,7 +201,6 @@ CONFIG_MIPS_PERF_SHARED_TC_COUNTERS=y # CONFIG_MIPS_RAW_APPENDED_DTB is not set CONFIG_MIPS_SPRAM=y # CONFIG_MIPS_VPE_LOADER is not set -# CONFIG_MIPS_ZBOOT_APPENDED_DTB is not set CONFIG_MODULES_TREE_LOOKUP=y CONFIG_MODULES_USE_ELF_REL=y CONFIG_MODULE_FORCE_UNLOAD=y @@ -214,13 +221,14 @@ CONFIG_OF_ADDRESS_PCI=y CONFIG_OF_EARLY_FLATTREE=y CONFIG_OF_FLATTREE=y CONFIG_OF_IRQ=y -CONFIG_OF_MTD=y CONFIG_OF_NET=y CONFIG_OF_PCI=y CONFIG_OF_PCI_IRQ=y +CONFIG_PADATA=y # CONFIG_PARTITION_ADVANCED is not set CONFIG_PCI=y CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DRIVERS_LEGACY=y CONFIG_PCI_GT64XXX_PCI0=y CONFIG_PCSPKR_PLATFORM=y CONFIG_PERF_EVENTS=y @@ -240,6 +248,7 @@ CONFIG_RELAY=y CONFIG_RFS_ACCEL=y CONFIG_RPS=y CONFIG_RTC_CLASS=y +CONFIG_RTC_MC146818_LIB=y # CONFIG_SCHED_INFO is not set CONFIG_SCSI=y CONFIG_SECCOMP=y @@ -249,11 +258,10 @@ CONFIG_SERIAL_8250_NR_UARTS=4 CONFIG_SERIAL_8250_RUNTIME_UARTS=4 CONFIG_SERIO=y CONFIG_SERIO_SERPORT=y +CONFIG_SG_POOL=y CONFIG_SMP=y CONFIG_SMP_UP=y CONFIG_SRCU=y -# CONFIG_STAGING is not set -# CONFIG_SUNXI_SRAM is not set CONFIG_SWAP_IO_SPACE=y CONFIG_SYNC_R4K=y CONFIG_SYSCTL_EXCEPTION_TRACE=y @@ -280,11 +288,11 @@ CONFIG_SYS_SUPPORTS_MIPS16=y CONFIG_SYS_SUPPORTS_MIPS_CMP=y CONFIG_SYS_SUPPORTS_MIPS_CPS=y CONFIG_SYS_SUPPORTS_MULTITHREADING=y +CONFIG_SYS_SUPPORTS_RELOCATABLE=y CONFIG_SYS_SUPPORTS_SCHED_SMT=y CONFIG_SYS_SUPPORTS_SMARTMIPS=y CONFIG_SYS_SUPPORTS_SMP=y CONFIG_SYS_SUPPORTS_ZBOOT=y -# CONFIG_TCP_CONG_ADVANCED is not set CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_TREE_RCU=y CONFIG_USB_SUPPORT=y @@ -296,5 +304,4 @@ CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_VT_HW_CONSOLE_BINDING=y CONFIG_VXFS_FS=y -# CONFIG_WATCHDOG is not set CONFIG_XPS=y diff --git a/target/linux/malta/image/Makefile b/target/linux/malta/image/Makefile index 31eb7ca0bb..d49d4a762d 100644 --- a/target/linux/malta/image/Makefile +++ b/target/linux/malta/image/Makefile @@ -22,7 +22,6 @@ define MkuImage endef define Image/Prepare - cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf $(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma) $(call MkuImage,lzma,,$(KDIR)/vmlinux.bin.lzma,$(KDIR)/uImage.lzma) $(call CompressGzip,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.gz) @@ -30,6 +29,7 @@ define Image/Prepare endef define Image/BuildKernel + cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf cp $(KDIR)/uImage.lzma $(BIN_DIR)/$(IMG_PREFIX)-uImage-lzma cp $(KDIR)/uImage.gz $(BIN_DIR)/$(IMG_PREFIX)-uImage-gzip endef diff --git a/target/linux/malta/le/config-default b/target/linux/malta/le/config-default index b5634c6756..aab569be3b 100644 --- a/target/linux/malta/le/config-default +++ b/target/linux/malta/le/config-default @@ -1,9 +1,3 @@ # CONFIG_CPU_BIG_ENDIAN is not set CONFIG_CPU_LITTLE_ENDIAN=y -CONFIG_CPU_MIPS32=y -# CONFIG_CPU_MIPS32_R1 is not set CONFIG_CPU_MIPS32_R2=y -# CONFIG_CPU_MIPS64_R1 is not set -# CONFIG_CPU_MIPS64_R2 is not set -CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set diff --git a/target/linux/malta/le64/config-default b/target/linux/malta/le64/config-default index 725c3e4900..28954537a9 100644 --- a/target/linux/malta/le64/config-default +++ b/target/linux/malta/le64/config-default @@ -1,6 +1,7 @@ # CONFIG_32BIT is not set CONFIG_64BIT=y CONFIG_ARCH_DMA_ADDR_T_64BIT=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y CONFIG_BINFMT_ELF32=y @@ -8,15 +9,10 @@ CONFIG_BLOCK_COMPAT=y CONFIG_COMPAT=y CONFIG_COMPAT_NETLINK_MESSAGES=y # CONFIG_CPU_BIG_ENDIAN is not set -# CONFIG_LIQUIDIO is not set CONFIG_CPU_LITTLE_ENDIAN=y -# CONFIG_CPU_MIPS32_R1 is not set -# CONFIG_CPU_MIPS32_R2 is not set CONFIG_CPU_MIPS64=y CONFIG_CPU_MIPS64_R1=y -# CONFIG_CPU_MIPS64_R2 is not set CONFIG_CPU_MIPSR1=y -CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y CONFIG_CPU_SUPPORTS_HUGEPAGES=y CONFIG_HAVE_64BIT_ALIGNED_ACCESS=y @@ -25,13 +21,11 @@ CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y CONFIG_MIPS32_COMPAT=y CONFIG_MIPS32_N32=y CONFIG_MIPS32_O32=y +# CONFIG_MIPS_VA_BITS_48 is not set CONFIG_MODULES_USE_ELF_RELA=y CONFIG_PCI_BUS_ADDR_T_64BIT=y CONFIG_PGTABLE_LEVELS=3 CONFIG_PHYS_ADDR_T_64BIT=y CONFIG_SYSVIPC_COMPAT=y CONFIG_SYS_SUPPORTS_HUGETLBFS=y -# CONFIG_THUNDER_NIC_BGX is not set -# CONFIG_THUNDER_NIC_PF is not set -# CONFIG_THUNDER_NIC_VF is not set CONFIG_ZONE_DMA32=y diff --git a/target/linux/mcs814x/image/Makefile b/target/linux/mcs814x/image/Makefile index 7be7f8cd99..3afd660c14 100644 --- a/target/linux/mcs814x/image/Makefile +++ b/target/linux/mcs814x/image/Makefile @@ -20,7 +20,7 @@ UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage define Image/Build/MkuImage mkimage -A arm -O linux -T kernel -a $(LOADADDR) -C none -e $(LOADADDR) \ - -n 'ARM LEDE Linux-$(LINUX_VERSION)' -d $(1) $(2); + -n 'ARM OpenWrt Linux-$(LINUX_VERSION)' -d $(1) $(2); endef define Image/Build/DTB diff --git a/target/linux/mediatek/patches-4.9/0028-net-next-dsa-add-Mediatek-tag-RX-TX-handler.patch b/target/linux/mediatek/patches-4.9/0028-net-next-dsa-add-Mediatek-tag-RX-TX-handler.patch index 2ba1cb80d3..ef545e3db4 100644 --- a/target/linux/mediatek/patches-4.9/0028-net-next-dsa-add-Mediatek-tag-RX-TX-handler.patch +++ b/target/linux/mediatek/patches-4.9/0028-net-next-dsa-add-Mediatek-tag-RX-TX-handler.patch @@ -34,7 +34,7 @@ Reviewed-by: Florian Fainelli --- a/net/dsa/Kconfig +++ b/net/dsa/Kconfig -@@ -41,4 +41,6 @@ config NET_DSA_TAG_TRAILER +@@ -42,4 +42,6 @@ config NET_DSA_TAG_TRAILER config NET_DSA_TAG_QCA bool diff --git a/target/linux/mediatek/patches-4.9/0048-net-core-add-RPS-balancer.patch b/target/linux/mediatek/patches-4.9/0048-net-core-add-RPS-balancer.patch index fca43cbdf3..aeb81e14bf 100644 --- a/target/linux/mediatek/patches-4.9/0048-net-core-add-RPS-balancer.patch +++ b/target/linux/mediatek/patches-4.9/0048-net-core-add-RPS-balancer.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3550,6 +3550,58 @@ set_rps_cpu(struct net_device *dev, stru +@@ -3551,6 +3551,58 @@ set_rps_cpu(struct net_device *dev, stru return rflow; } @@ -69,7 +69,7 @@ Signed-off-by: John Crispin /* * get_rps_cpu is called from netif_receive_skb and returns the target * CPU from the RPS map of the receiving queue for a given skb. -@@ -3639,7 +3691,7 @@ static int get_rps_cpu(struct net_device +@@ -3640,7 +3692,7 @@ static int get_rps_cpu(struct net_device try_rps: if (map) { @@ -78,7 +78,7 @@ Signed-off-by: John Crispin if (cpu_online(tcpu)) { cpu = tcpu; goto done; -@@ -8430,6 +8482,9 @@ static int __init net_dev_init(void) +@@ -8431,6 +8483,9 @@ static int __init net_dev_init(void) sd->backlog.weight = weight_p; } diff --git a/target/linux/mpc85xx/Makefile b/target/linux/mpc85xx/Makefile index 8428bec6bc..b181e67c0e 100644 --- a/target/linux/mpc85xx/Makefile +++ b/target/linux/mpc85xx/Makefile @@ -16,17 +16,10 @@ SUBTARGETS:=generic p1020 KERNEL_PATCHVER:=4.9 -define Target/Description - Build images for the Freescale MPC85xx based boards. -endef +KERNELNAME:=zImage include $(INCLUDE_DIR)/target.mk -KERNEL_IMAGES := zImage -ifeq ($(SUBTARGET),generic) -KERNEL_IMAGES += cuImage.tl-wdr4900-v1 -endif - DEFAULT_PACKAGES += \ kmod-input-core kmod-input-gpio-keys kmod-button-hotplug \ kmod-leds-gpio swconfig kmod-ath9k wpad-mini diff --git a/target/linux/mpc85xx/base-files/etc/board.d/02_network b/target/linux/mpc85xx/base-files/etc/board.d/02_network index 511b56b1cc..19f01a6589 100755 --- a/target/linux/mpc85xx/base-files/etc/board.d/02_network +++ b/target/linux/mpc85xx/base-files/etc/board.d/02_network @@ -10,7 +10,10 @@ board_config_update board=$(board_name) case "$board" in -tl-wdr4900-v1) +aerohive,hiveap-330) + ucidef_set_interfaces_lan_wan "eth1" "eth0" + ;; +tplink,tl-wdr4900-v1) ucidef_add_switch "switch0" \ "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan" ucidef_set_interface_macaddr "wan" "$(mtd_get_mac_binary config 332)" diff --git a/target/linux/mpc85xx/base-files/etc/diag.sh b/target/linux/mpc85xx/base-files/etc/diag.sh index b269427a51..3d56d14b08 100644 --- a/target/linux/mpc85xx/base-files/etc/diag.sh +++ b/target/linux/mpc85xx/base-files/etc/diag.sh @@ -5,11 +5,14 @@ . /lib/functions/leds.sh get_status_led() { - case $(board_name) in - tl-wdr4900-v1) - status_led="tp-link:blue:system" - ;; - esac + case $(board_name) in + aerohive,hiveap-330) + status_led="hiveap-330:green:tricolor0" + ;; + tplink,tl-wdr4900-v1) + status_led="tp-link:blue:system" + ;; + esac } set_state() { diff --git a/target/linux/mpc85xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/mpc85xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 4b5b7a30ba..3e6488b4c7 100644 --- a/target/linux/mpc85xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/mpc85xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -42,7 +42,7 @@ board=$(board_name) case "$FIRMWARE" in "pci_wmac0.eeprom") case $board in - tl-wdr4900-v1) + tplink,tl-wdr4900-v1) ath9k_eeprom_extract "caldata" 4096 2048 tpl_set_wireless_mac 0 ;; @@ -54,7 +54,7 @@ case "$FIRMWARE" in "pci_wmac1.eeprom") case $board in - tl-wdr4900-v1) + tplink,tl-wdr4900-v1) ath9k_eeprom_extract "caldata" 20480 2048 tpl_set_wireless_mac -1 ;; diff --git a/target/linux/mpc85xx/base-files/lib/mpc85xx.sh b/target/linux/mpc85xx/base-files/lib/mpc85xx.sh deleted file mode 100755 index 1a2a671e28..0000000000 --- a/target/linux/mpc85xx/base-files/lib/mpc85xx.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2013 OpenWrt.org -# - -MPC85XX_BOARD_NAME= -MPC85XX_MODEL= - -mpc85xx_board_detect() { - local model - local name - - model=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /model/ {print $2}' /proc/cpuinfo) - - case "$model" in - *"TL-WDR4900 v1") - name="tl-wdr4900-v1" - ;; - esac - - [ -z "$name" ] && name="unknown" - - [ -z "$MPC85XX_BOARD_NAME" ] && MPC85XX_BOARD_NAME="$name" - [ -z "$MPC85XX_MODEL" ] && MPC85XX_MODEL="$model" - - [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" - - echo "$MPC85XX_BOARD_NAME" > /tmp/sysinfo/board_name - echo "$MPC85XX_MODEL" > /tmp/sysinfo/model -} diff --git a/target/linux/mpc85xx/base-files/lib/preinit/01_preinit_do_mpc85xx.sh b/target/linux/mpc85xx/base-files/lib/preinit/01_preinit_do_mpc85xx.sh deleted file mode 100644 index 88ba608379..0000000000 --- a/target/linux/mpc85xx/base-files/lib/preinit/01_preinit_do_mpc85xx.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -do_mpc85xx() { - . /lib/mpc85xx.sh - - mpc85xx_board_detect -} - -boot_hook_add preinit_main do_mpc85xx diff --git a/target/linux/mpc85xx/base-files/lib/preinit/05_set_preinit_iface_mpc85xx b/target/linux/mpc85xx/base-files/lib/preinit/05_set_preinit_iface_mpc85xx index 22d7471dda..748a87490e 100644 --- a/target/linux/mpc85xx/base-files/lib/preinit/05_set_preinit_iface_mpc85xx +++ b/target/linux/mpc85xx/base-files/lib/preinit/05_set_preinit_iface_mpc85xx @@ -3,8 +3,6 @@ # Copyright (C) 2013 OpenWrt.org # -. /lib/mpc85xx.sh - mpc85xx_set_preinit_iface() { ifname=eth0 } diff --git a/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh b/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh index 65b3674769..67e8324c2a 100755 --- a/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh @@ -3,73 +3,13 @@ # PART_NAME=firmware - -tplink_get_hwid() { - local part - - part=$(find_mtd_part u-boot) - [ -z "$part" ] && return 1 - - dd if=$part bs=4 count=1 skip=81728 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"' -} - -tplink_get_image_hwid() { - get_image "$@" | dd bs=4 count=1 skip=16 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"' -} - -tplink_get_image_boot_size() { - get_image "$@" | dd bs=4 count=1 skip=37 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"' -} +REQUIRE_IMAGE_METADATA=1 platform_check_image() { - local board=$(board_name) - local magic="$(get_magic_long "$1")" - - [ "$#" -gt 1 ] && return 1 - - case $board in - tl-wdr4900-v1) - [ "$magic" != "01000000" ] && { - echo "Invalid image type." - return 1 - } - - local hwid - local imageid - - hwid=$(tplink_get_hwid) - imageid=$(tplink_get_image_hwid "$1") - - [ "$hwid" != "$imageid" ] && { - echo "Invalid image, hardware ID mismatch, hw:$hwid image:$imageid." - return 1 - } - - local boot_size - - boot_size=$(tplink_get_image_boot_size "$1") - [ "$boot_size" != "00000000" ] && { - echo "Invalid image, it contains a bootloader." - return 1 - } - - return 0 - ;; - esac - - echo "Sysupgrade is not yet supported on $board." - return 1 + return 0 } -platform_do_upgrade() { - local board=$(board_name) - - case "$board" in - *) - default_do_upgrade "$ARGV" - ;; - esac -} +# use default for platform_do_upgrade() disable_watchdog() { killall watchdog diff --git a/target/linux/mpc85xx/config-4.9 b/target/linux/mpc85xx/config-4.9 index 64ab239613..68568c4a62 100644 --- a/target/linux/mpc85xx/config-4.9 +++ b/target/linux/mpc85xx/config-4.9 @@ -37,6 +37,7 @@ CONFIG_CLONE_BACKWARDS=y CONFIG_CLZ_TAB=y CONFIG_CMDLINE="console=ttyS0,115200" CONFIG_CMDLINE_BOOL=y +# CONFIG_CMDLINE_OVERRIDE is not set # CONFIG_CORENET_GENERIC is not set # CONFIG_CPM2 is not set CONFIG_CPU_BIG_ENDIAN=y @@ -72,7 +73,7 @@ CONFIG_CRYPTO_RSA=y # CONFIG_CRYPTO_SHA256_PPC_SPE is not set CONFIG_CRYPTO_WORKQUEUE=y CONFIG_DEBUG_BUGVERBOSE=y -CONFIG_DEFAULT_UIMAGE=y +# CONFIG_DEFAULT_UIMAGE is not set CONFIG_DNOTIFY=y CONFIG_DTC=y # CONFIG_E200 is not set @@ -95,7 +96,7 @@ CONFIG_FSL_PCI=y CONFIG_FSL_PQ_MDIO=y CONFIG_FSL_SOC=y CONFIG_FSL_SOC_BOOKE=y -CONFIG_FSL_ULI1575=y +# CONFIG_FSL_ULI1575 is not set CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_BUG=y @@ -125,7 +126,7 @@ CONFIG_GPIO_SYSFS=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y -CONFIG_HAS_RAPIDIO=y +# CONFIG_HAS_RAPIDIO is not set # CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set CONFIG_HAVE_ARCH_AUDITSYSCALL=y # CONFIG_HAVE_ARCH_BITREVERSE is not set @@ -160,6 +161,7 @@ CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y # CONFIG_HAVE_SETUP_PER_CPU_AREA is not set CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING=y +# CONFIG_HIVEAP_330 is not set CONFIG_HW_RANDOM=y CONFIG_HZ=250 # CONFIG_HZ_100 is not set @@ -185,21 +187,18 @@ CONFIG_LIBFDT=y CONFIG_LOWMEM_CAM_NUM=3 CONFIG_LOWMEM_SIZE=0x30000000 CONFIG_LXT_PHY=y -CONFIG_LZO_COMPRESS=y -CONFIG_LZO_DECOMPRESS=y # CONFIG_MATH_EMULATION is not set CONFIG_MDIO_BOARDINFO=y -# CONFIG_MFD_MAX77620 is not set CONFIG_MIGRATION=y # CONFIG_MMIO_NVRAM is not set CONFIG_MODULES_USE_ELF_RELA=y # CONFIG_MPC8536_DS is not set # CONFIG_MPC8540_ADS is not set # CONFIG_MPC8560_ADS is not set -CONFIG_MPC85xx_CDS=y +# CONFIG_MPC85xx_CDS is not set # CONFIG_MPC85xx_DS is not set -CONFIG_MPC85xx_MDS=y -CONFIG_MPC85xx_RDB=y +# CONFIG_MPC85xx_MDS is not set +# CONFIG_MPC85xx_RDB is not set CONFIG_MPIC=y # CONFIG_MPIC_MSGR is not set CONFIG_MPIC_TIMER=y @@ -232,7 +231,7 @@ CONFIG_OF_PCI_IRQ=y CONFIG_OF_RESERVED_MEM=y CONFIG_OLD_SIGACTION=y CONFIG_OLD_SIGSUSPEND=y -CONFIG_P1010_RDB=y +# CONFIG_P1010_RDB is not set # CONFIG_P1022_DS is not set # CONFIG_P1022_RDK is not set # CONFIG_P1023_RDB is not set @@ -274,7 +273,7 @@ CONFIG_PPC_DOORBELL=y # CONFIG_PPC_EARLY_DEBUG is not set # CONFIG_PPC_EPAPR_HV_PIC is not set CONFIG_PPC_FSL_BOOK3E=y -CONFIG_PPC_I8259=y +# CONFIG_PPC_I8259 is not set # CONFIG_PPC_ICP_HV is not set # CONFIG_PPC_ICP_NATIVE is not set # CONFIG_PPC_ICS_RTAS is not set @@ -291,7 +290,6 @@ CONFIG_PPC_UDBG_16550=y CONFIG_PPC_WERROR=y # CONFIG_PPC_XICS is not set # CONFIG_PQ2ADS is not set -CONFIG_PROC_PAGE_MONITOR=y # CONFIG_PTP_1588_CLOCK_GIANFAR is not set CONFIG_QE_GPIO=y CONFIG_QE_USB=y @@ -332,7 +330,7 @@ CONFIG_SWPHY=y CONFIG_SYSCTL_EXCEPTION_TRACE=y CONFIG_TASK_SIZE=0xc0000000 CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TL_WDR4900_V1=y +# CONFIG_TL_WDR4900_V1 is not set # CONFIG_TQM8540 is not set # CONFIG_TQM8541 is not set # CONFIG_TQM8548 is not set diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts new file mode 100644 index 0000000000..5e732664aa --- /dev/null +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts @@ -0,0 +1,228 @@ +/* + * Aerohive HiveAP-330 Device Tree Source + * + * Copyright (C) 2017 Chris Blake + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +/include/ "fsl/p1020si-pre.dtsi" +/ { + model = "Aerohive HiveAP-330"; + compatible = "aerohive,hiveap-330"; + + chosen { + bootargs-override = "console=ttyS0,9600"; + }; + + memory { + device_type = "memory"; + }; + + board_lbc: lbc: localbus@ffe05000 { + reg = <0 0xffe05000 0 0x1000>; + ranges = <0x0 0x0 0x0 0xec000000 0x4000000>; + + nor@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x0 0x0 0x4000000>; + bank-width = <2>; + device-width = <1>; + + partition@0 { + reg = <0x0 0x40000>; + label = "dtb"; + }; + + partition@40000 { + reg = <0x40000 0x40000>; + label = "initrd"; + }; + + partition@80000 { + reg = <0x80000 0x27c0000>; + label = "rootfs"; + }; + + partition@2840000 { + reg = <0x2840000 0x800000>; + label = "kernel"; + }; + + partition@3040000 { + reg = <0x3040000 0xec0000>; + label = "stock-jffs2"; + read-only; + }; + + hwinfo: partition@3f00000 { + reg = <0x3f00000 0x20000>; + label = "hw-info"; + read-only; + }; + + partition@3f20000 { + reg = <0x3f20000 0x20000>; + label = "boot-info"; + read-only; + }; + + partition@3f40000 { + reg = <0x3f40000 0x20000>; + label = "boot-info-backup"; + read-only; + }; + + partition@3f60000 { + reg = <0x3f60000 0x20000>; + label = "u-boot-env"; + }; + + partition@3f80000 { + reg = <0x3f80000 0x80000>; + label = "u-boot"; + read-only; + }; + + firmware@0 { + reg = <0x0 0x3040000>; + label = "firmware"; + }; + }; + }; + + board_soc: soc: soc@ffe00000 { + ranges = <0x0 0x0 0xffe00000 0x100000>; + + i2c@3100 { + tpm@29 { + compatible = "atmel,at97sc3204t"; + reg = <0x29>; + }; + + lp5521@32 { + compatible = "national,lp5521"; + reg = <0x32>; + clock-mode = /bits/ 8 <2>; + chan0 { + chan-name = "hiveap-330:red:tricolor0"; + led-cur = /bits/ 8 <0x2f>; + max-cur = /bits/ 8 <0x5f>; + }; + chan1 { + chan-name = "hiveap-330:green:tricolor0"; + led-cur = /bits/ 8 <0x2f>; + max-cur = /bits/ 8 <0x5f>; + }; + chan2 { + chan-name = "hiveap-330:blue:tricolor0"; + led-cur = /bits/ 8 <0x2f>; + max-cur = /bits/ 8 <0x5f>; + }; + }; + + /* Most likely SoC boot config */ + eeprom@51 { + compatible = "eeprom"; + reg = <0x51>; + }; + }; + + mdio@24000 { + phy0: ethernet-phy@0 { + interrupts = <3 1 0 0>; + reg = <0x1>; + }; + + phy1: ethernet-phy@1 { + interrupts = <2 1 0 0>; + reg = <0x2>; + }; + }; + + mdio@25000 { + status = "disabled"; + }; + + mdio@26000 { + status = "disabled"; + }; + + enet0: ethernet@b0000 { + status = "okay"; + phy-handle = <&phy0>; + phy-connection-type = "rgmii-id"; + mtd-mac-address = <&hwinfo 0>; + }; + + enet1: ethernet@b1000 { + status = "disabled"; + }; + + enet2: ethernet@b2000 { + status = "okay"; + phy-handle = <&phy1>; + phy-connection-type = "rgmii-id"; + mtd-mac-address = <&hwinfo 0>; + mtd-mac-address-increment = <1>; + }; + + gpio0: gpio-controller@fc00 { + }; + + usb@22000 { + phy_type = "ulpi"; + dr_mode = "host"; + }; + + usb@23000 { + status = "disabled"; + }; + }; + + pci0: pcie@ffe09000 { + reg = <0x0 0xffe09000 0x0 0x1000>; + ranges = <0x2000000 0x0 0xa0000000 0x0 0xa0000000 0x0 0x20000000 + 0x1000000 0x0 0x00000000 0x0 0xffc30000 0x0 0x10000>; + pcie@0 { + ranges = <0x2000000 0x0 0xa0000000 + 0x2000000 0x0 0xa0000000 + 0x0 0x20000000 + + 0x1000000 0x0 0x0 + 0x1000000 0x0 0x0 + 0x0 0x100000>; + }; + }; + + pci1: pcie@ffe0a000 { + reg = <0x0 0xffe0a000 0x0 0x1000>; + ranges = <0x2000000 0x0 0xc0000000 0x0 0xc0000000 0x0 0x20000000 + 0x1000000 0x0 0x00000000 0x0 0xffc20000 0x0 0x10000>; + pcie@0 { + ranges = <0x2000000 0x0 0xc0000000 + 0x2000000 0x0 0xc0000000 + 0x0 0x20000000 + + 0x1000000 0x0 0x0 + 0x1000000 0x0 0x0 + 0x0 0x100000>; + }; + }; + + buttons { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + gpios = <&gpio0 8 1>; /* active low */ + linux,code = <0x198>; /* KEY_RESTART */ + }; + }; +}; +/include/ "fsl/p1020si-post.dtsi" diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts index 2ad58d3fda..c2444936b7 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts @@ -13,7 +13,7 @@ / { model = "TP-Link TL-WDR4900 v1"; - compatible = "tp-link,TL-WDR4900v1"; + compatible = "tplink,tl-wdr4900-v1"; chosen { bootargs = "console=ttyS0,115200"; diff --git a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/hiveap-330.c b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/hiveap-330.c new file mode 100644 index 0000000000..f325b32ce6 --- /dev/null +++ b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/hiveap-330.c @@ -0,0 +1,89 @@ +/* + * Aerohive HiveAP-330 Board Setup + * + * Copyright (C) 2017 Chris Blake + * + * Based on: + * mpc85xx_rdb.c: + * MPC85xx RDB Board Setup + * Copyright 2013 Freescale Semiconductor Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "smp.h" + +#include "mpc85xx.h" + +void __init hiveap_330_pic_init(void) +{ + struct mpic *mpic; + + mpic = mpic_alloc(NULL, 0, + MPIC_BIG_ENDIAN | + MPIC_SINGLE_DEST_CPU, + 0, 256, " OpenPIC "); + + BUG_ON(mpic == NULL); + mpic_init(mpic); +} + +/* + * Setup the architecture + */ +static void __init hiveap_330_setup_arch(void) +{ + if (ppc_md.progress) + ppc_md.progress("hiveap_330_setup_arch()", 0); + + mpc85xx_smp_init(); + + fsl_pci_assign_primary(); + + printk(KERN_INFO "HiveAP-330 board from Aerohive\n"); +} + +machine_arch_initcall(hiveap_330, mpc85xx_common_publish_devices); + +/* + * Called very early, device-tree isn't unflattened + */ +static int __init hiveap_330_probe(void) +{ + if (of_machine_is_compatible("aerohive,hiveap-330")) + return 1; + return 0; +} + +define_machine(hiveap_330) { + .name = "P1020 RDB", + .probe = hiveap_330_probe, + .setup_arch = hiveap_330_setup_arch, + .init_IRQ = hiveap_330_pic_init, +#ifdef CONFIG_PCI + .pcibios_fixup_bus = fsl_pcibios_fixup_bus, + .pcibios_fixup_phb = fsl_pcibios_fixup_phb, +#endif + .get_irq = mpic_get_irq, + .calibrate_decr = generic_calibrate_decr, + .progress = udbg_progress, +}; diff --git a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/tl_wdr4900_v1.c b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/tl_wdr4900_v1.c index 1b6dc18ac2..9d7a22d173 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/tl_wdr4900_v1.c +++ b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/tl_wdr4900_v1.c @@ -124,7 +124,7 @@ static int __init tl_wdr4900_v1_probe(void) { unsigned long root = of_get_flat_dt_root(); - if (of_flat_dt_is_compatible(root, "tp-link,TL-WDR4900v1")) + if (of_flat_dt_is_compatible(root, "tplink,tl-wdr4900-v1")) return 1; return 0; diff --git a/target/linux/mpc85xx/generic/config-default b/target/linux/mpc85xx/generic/config-default index e69de29bb2..81bf934b33 100644 --- a/target/linux/mpc85xx/generic/config-default +++ b/target/linux/mpc85xx/generic/config-default @@ -0,0 +1 @@ +CONFIG_TL_WDR4900_V1=y diff --git a/target/linux/mpc85xx/profiles/00-default.mk b/target/linux/mpc85xx/generic/profiles/00-default.mk similarity index 64% rename from target/linux/mpc85xx/profiles/00-default.mk rename to target/linux/mpc85xx/generic/profiles/00-default.mk index 7dcb8faaa3..67507ace8a 100644 --- a/target/linux/mpc85xx/profiles/00-default.mk +++ b/target/linux/mpc85xx/generic/profiles/00-default.mk @@ -1,15 +1,15 @@ # -# Copyright (C) 2013 OpenWrt.org -# # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # define Profile/Default - NAME:=Default Profile (all drivers) + NAME:=Default Profile + PRIORITY:=1 endef define Profile/Default/Description - Default package set compatible with most boards. + Default package set compatible with most MPC85xx boards. endef + $(eval $(call Profile,Default)) diff --git a/target/linux/mpc85xx/generic/target.mk b/target/linux/mpc85xx/generic/target.mk index f8a79a7b90..2620a22899 100644 --- a/target/linux/mpc85xx/generic/target.mk +++ b/target/linux/mpc85xx/generic/target.mk @@ -1,4 +1,5 @@ BOARDNAME:=Generic +KERNELNAME:=cuImage.tl-wdr4900-v1 define Target/Description Build firmware images for generic MPC85xx based boards. diff --git a/target/linux/mpc85xx/image/Makefile b/target/linux/mpc85xx/image/Makefile index 25a9b070c5..7ae6e27b35 100644 --- a/target/linux/mpc85xx/image/Makefile +++ b/target/linux/mpc85xx/image/Makefile @@ -1,77 +1,79 @@ # -# Copyright (C) 2010 OpenWrt.org -# # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -define imgname -$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1))) +DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT + +define Device/Default + PROFILES := Default + DEVICE_DTS := $(1) + KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts) + KERNEL_ENTRY := 0x00000000 + KERNEL_LOADADDR := 0x00000000 + KERNEL := kernel-bin endef -define sysupname -$(call imgname,$(1),$(2))-sysupgrade.bin +define Build/append-uImage-fakeramdisk-hdr + rm -f $@.fakeramdisk + $(STAGING_DIR_HOST)/bin/mkimage \ + -A $(LINUX_KARCH) -O linux -T ramdisk -C none \ + -n 'fakeramdisk' \ + -s \ + $@.fakeramdisk + cat $@.fakeramdisk >> $@ endef -define factoryname -$(call imgname,$(1),$(2))-factory.bin +define Build/tplink-v1-image + $(STAGING_DIR_HOST)/bin/mktplinkfw \ + -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) \ + -N "$(VERSION_DIST)" -V $(REVISION) \ + -k $(IMAGE_KERNEL) \ + -r $(IMAGE_ROOTFS) \ + -j \ + $(1) \ + -o $@ endef -zImage:=$(BIN_DIR)/$(IMG_PREFIX)-zImage - -DTS_TARGETS = fsl/p1010rdb-pa tl-wdr4900-v1 fsl/p1020rdb - -define Image/BuildKernel - cp $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage - $(foreach dts,$(DTS_TARGETS), - $(LINUX_DIR)/scripts/dtc/dtc -I dts -O dtb $(DTS_DIR)/$(dts).dts > $(BIN_DIR)/$(IMG_PREFIX)-$(notdir $(dts)).fdt - ) -endef - -define Image/BuildKernel/Initramfs - cp $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-initramfs-zImage ifeq ($(SUBTARGET),generic) - cp $(KDIR)/cuImage.tl-wdr4900-v1-initramfs $(BIN_DIR)/$(IMG_PREFIX)-tl-wdr4900-v1-initramfs.uImage + +define Device/tl-wdr4900-v1 + DEVICE_TITLE := TP-Link TL-WDR4900 + DEVICE_PACKAGES := kmod-ath9k wpad-mini + TPLINK_HWID := 0x49000001 + TPLINK_HWREV := 1 + TPLINK_FLASHLAYOUT := 16Mppc + KERNEL_NAME := cuImage.tl-wdr4900-v1 + SUPPORTED_DEVICES:=tl-wdr4900-v1 tplink,tl-wdr4900-v1 + IMAGES := fdt.bin factory.bin sysupgrade.bin + IMAGE/fdt.bin := append-dtb + IMAGE/factory.bin := tplink-v1-image + IMAGE/sysupgrade.bin := tplink-v1-image -s | append-metadata +endef +TARGET_DEVICES += tl-wdr4900-v1 + endif -endef -define Image/Build/TPLINK - -$(STAGING_DIR_HOST)/bin/mktplinkfw \ - -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) $(7) \ - -k $(KDIR)/$(3) \ - -r $(KDIR)/root.$(1) \ - -o $(call factoryname,$(1),$(2)) - -$(STAGING_DIR_HOST)/bin/mktplinkfw \ - -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) $(7) -s \ - -k $(KDIR)/$(3) \ - -r $(KDIR)/root.$(1) \ - -o $(call sysupname,$(1),$(2)) -endef +ifeq ($(SUBTARGET),p1020) -define Image/Build/Profile/TLWDR4900 - $(call Image/Build/TPLINK,$(1),tl-wdr4900-v1,cuImage.tl-wdr4900-v1,0x49000001,1,16Mppc) +define Device/hiveap-330 + DEVICE_TITLE := Aerohive HiveAP-330 + DEVICE_PACKAGES := kmod-ath9k wpad-mini kmod-tpm-i2c-atmel + BLOCKSIZE := 128k + KERNEL_NAME := zImage + KERNEL_SIZE := 8m + SUPPORTED_DEVICES := aerohive,hiveap-330 + IMAGES := fdt.bin sysupgrade.bin + IMAGE/fdt.bin := append-dtb + IMAGE/sysupgrade.bin := append-dtb | pad-to 256k | check-size 256k | \ + append-uImage-fakeramdisk-hdr | pad-to 256k | check-size 512k | \ + append-rootfs | pad-rootfs $$(BLOCKSIZE) | pad-to 41216k | check-size 41216k | \ + append-kernel | append-metadata endef +TARGET_DEVICES += hiveap-330 -define Image/Build/Profile/Default - $(call Image/Build/Profile/TLWDR4900,$(1)) -endef - -define Image/Build/ext2 - cp $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-ext2.img -endef - -define Image/Build/squashfs - $(call prepare_generic_squashfs,$(KDIR)/root.squashfs) - cp $(KDIR)/root.squashfs $(BIN_DIR)/$(IMG_PREFIX)-root.squashfs -endef - -PROFILE ?= Default - -define Image/Build - $(call Image/Build/$(1),$(1)) - $(call Image/Build/Profile/$(PROFILE),$(1)) -endef +endif $(eval $(call BuildImage)) diff --git a/target/linux/mpc85xx/p1020/config-default b/target/linux/mpc85xx/p1020/config-default index 8fd795730e..fd9433b59a 100644 --- a/target/linux/mpc85xx/p1020/config-default +++ b/target/linux/mpc85xx/p1020/config-default @@ -1,15 +1,31 @@ CONFIG_ARCH_HAS_TICK_BROADCAST=y +CONFIG_AT803X_PHY=y +CONFIG_CMDLINE_OVERRIDE=y CONFIG_CPU_RMAP=y +CONFIG_EEPROM_LEGACY=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_TBSYNC=y +# CONFIG_GPIO_MAX77620 is not set CONFIG_HAVE_RCU_TABLE_FREE=y +CONFIG_HIVEAP_330=y +CONFIG_I2C_CHARDEV=y +CONFIG_LEDS_LP5521=y +CONFIG_LEDS_LP55XX_COMMON=y CONFIG_LOCK_SPIN_ON_OWNER=y +# CONFIG_MAX77620_WATCHDOG is not set +CONFIG_MFD_CORE=y +CONFIG_MFD_MAX77620=y +CONFIG_MTD_CFI=y +CONFIG_MTD_PHYSMAP=y CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_NET_FLOW_LIMIT=y CONFIG_NR_CPUS=2 +CONFIG_PADATA=y CONFIG_RCU_STALL_COMMON=y +CONFIG_REGMAP_IRQ=y CONFIG_RFS_ACCEL=y CONFIG_RPS=y +# CONFIG_RTC_DRV_MAX77686 is not set CONFIG_RWSEM_SPIN_ON_OWNER=y CONFIG_SMP=y CONFIG_TREE_RCU=y diff --git a/target/linux/mpc85xx/p1020/profiles/00-default.mk b/target/linux/mpc85xx/p1020/profiles/00-default.mk new file mode 100644 index 0000000000..67d43020a2 --- /dev/null +++ b/target/linux/mpc85xx/p1020/profiles/00-default.mk @@ -0,0 +1,15 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Profile/Default + NAME:=Default Profile + PRIORITY:=1 +endef + +define Profile/Default/Description + Default package set compatible with most P1020 boards. +endef + +$(eval $(call Profile,Default)) diff --git a/target/linux/mpc85xx/p1020/target.mk b/target/linux/mpc85xx/p1020/target.mk index c111d7a4af..5d84d83205 100644 --- a/target/linux/mpc85xx/p1020/target.mk +++ b/target/linux/mpc85xx/p1020/target.mk @@ -1,6 +1,6 @@ BOARDNAME:=P1020 +FEATURES += ramdisk define Target/Description Build firmware images for Freescale P1020 based boards. endef - diff --git a/target/linux/mpc85xx/patches-4.9/101-powerpc-85xx-hiveap-330-support.patch b/target/linux/mpc85xx/patches-4.9/101-powerpc-85xx-hiveap-330-support.patch new file mode 100644 index 0000000000..ece8c7d80e --- /dev/null +++ b/target/linux/mpc85xx/patches-4.9/101-powerpc-85xx-hiveap-330-support.patch @@ -0,0 +1,30 @@ +--- a/arch/powerpc/platforms/85xx/Kconfig ++++ b/arch/powerpc/platforms/85xx/Kconfig +@@ -48,6 +48,17 @@ config BSC9132_QDS + and dual StarCore SC3850 DSP cores. + Manufacturer : Freescale Semiconductor, Inc + ++config HIVEAP_330 ++ bool "Aerohive HiveAP-330" ++ select DEFAULT_UIMAGE ++ select ARCH_REQUIRE_GPIOLIB ++ select GPIO_MPC8XXX ++ help ++ This option enables support for the Aerohive HiveAP-330 board. ++ ++ This board is a Concurrent Dual-Band wireless access point with a ++ Freescale P1020 SoC. ++ + config MPC8540_ADS + bool "Freescale MPC8540 ADS" + select DEFAULT_UIMAGE +--- a/arch/powerpc/platforms/85xx/Makefile ++++ b/arch/powerpc/platforms/85xx/Makefile +@@ -9,6 +9,7 @@ obj-y += common.o + obj-$(CONFIG_BSC9131_RDB) += bsc913x_rdb.o + obj-$(CONFIG_BSC9132_QDS) += bsc913x_qds.o + obj-$(CONFIG_C293_PCIE) += c293pcie.o ++obj-$(CONFIG_HIVEAP_330) += hiveap-330.o + obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o + obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o + obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o diff --git a/target/linux/mpc85xx/patches-4.9/102-powerpc-add-cmdline-override.patch b/target/linux/mpc85xx/patches-4.9/102-powerpc-add-cmdline-override.patch new file mode 100644 index 0000000000..3d59927d1d --- /dev/null +++ b/target/linux/mpc85xx/patches-4.9/102-powerpc-add-cmdline-override.patch @@ -0,0 +1,37 @@ +--- a/arch/powerpc/Kconfig ++++ b/arch/powerpc/Kconfig +@@ -707,6 +707,14 @@ config CMDLINE_FORCE + This is useful if you cannot or don't want to change the + command-line options your boot loader passes to the kernel. + ++config CMDLINE_OVERRIDE ++ bool "Use alternative cmdline from device tree" ++ help ++ Some bootloaders may have uneditable bootargs. While CMDLINE_FORCE can ++ be used, this is not a good option for kernels that are shared across ++ devices. This setting enables using "chosen/cmdline-override" as the ++ cmdline if it exists in the device tree. ++ + config EXTRA_TARGETS + string "Additional default image types" + help +--- a/drivers/of/fdt.c ++++ b/drivers/of/fdt.c +@@ -1079,6 +1079,17 @@ int __init early_init_dt_scan_chosen(uns + if (p != NULL && l > 0) + strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE)); + ++ /* CONFIG_CMDLINE_OVERRIDE is used to fallback to a different ++ * device tree option of chosen/bootargs-override. This is ++ * helpful on boards where u-boot sets bootargs, and is unable ++ * to be modified. ++ */ ++#ifdef CONFIG_CMDLINE_OVERRIDE ++ p = of_get_flat_dt_prop(node, "bootargs-override", &l); ++ if (p != NULL && l > 0) ++ strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE)); ++#endif ++ + /* + * CONFIG_CMDLINE is meant to be a default in case nothing else + * managed to set the command line, unless CONFIG_CMDLINE_FORCE diff --git a/target/linux/mpc85xx/profiles/tp-link.mk b/target/linux/mpc85xx/profiles/tp-link.mk deleted file mode 100644 index 18a7cddd83..0000000000 --- a/target/linux/mpc85xx/profiles/tp-link.mk +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (C) 2013 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -define Profile/TLWDR4900 - NAME:=TP-Link TL-WDR4900 - PACKAGES:=kmod-ath9k wpad-mini -endef - -define Profile/TLWDR4900/Description - Package set optimized for the TP-Link TL-WDR4900. -endef -$(eval $(call Profile,TLWDR4900)) diff --git a/target/linux/mvebu/base-files/etc/init.d/set_cpu_affinity b/target/linux/mvebu/base-files/etc/init.d/set_cpu_affinity deleted file mode 100755 index a52e62acb5..0000000000 --- a/target/linux/mvebu/base-files/etc/init.d/set_cpu_affinity +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=99 - -set_irq_affinity() { - local name="$1" - local val="$2" - -case "$name" in -wifi0) - local irq_wifi0=`grep -E -m1 'mwlwifi' /proc/interrupts | cut -d: -f1 | tail -n1 | tr -d ' '` - [ -n "$irq_wifi0" ] || echo "$name irq not found." - echo "$val" > "/proc/irq/$irq_wifi0/smp_affinity" - ;; -wifi1) - local irq_wifi1=`grep -E -m2 'mwlwifi' /proc/interrupts | cut -d: -f1 | tail -n1 | tr -d ' '` - [ -n "$irq_wifi1" ] || echo "$name irq not found." - echo "$val" > "/proc/irq/$irq_wifi1/smp_affinity" - ;; -wifi2) - local irq_wifi1=`grep -E -m3 'mwlwifi' /proc/interrupts | cut -d: -f1 | tail -n1 | tr -d ' '` - [ -n "$irq_wifi1" ] || echo "$name irq not found." - echo "$val" > "/proc/irq/$irq_wifi1/smp_affinity" - ;; -*) - local irq=`grep -m 1 "$name" /proc/interrupts | cut -d: -f1 | sed 's, *,,'` - [ -n "$irq" ] || echo "$name irq not found." - echo "$val" > "/proc/irq/$irq/smp_affinity" - ;; -esac -} - -start() { - -. /lib/functions.sh - -local board=$(board_name) - -case "$board" in -armada-385-linksys-caiman |\ -armada-385-linksys-cobra |\ -armada-385-linksys-shelby |\ -armada-xp-linksys-mamba) - set_irq_affinity wifi0 2 - set_irq_affinity wifi1 2 - ;; -armada-385-linksys-rango) - set_irq_affinity wifi0 2 - set_irq_affinity wifi1 2 - set_irq_affinity wifi2 2 - ;; -*) - echo "Unsupported hardware. CPU affinity is not adjusted." - ;; -esac -} diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile index f0c4b09c9e..989ba5084b 100644 --- a/target/linux/mvebu/image/Makefile +++ b/target/linux/mvebu/image/Makefile @@ -163,11 +163,25 @@ define Device/marvell-nand DEVICE_TITLE := Marvell Armada $(1) endef -Device/armada-370-db = $(call Device/marvell-nand,370 DB (DB-88F6710-BP-DDR3)) -Device/armada-370-rd = $(call Device/marvell-nand,370 RD (RD-88F6710-A1)) -Device/armada-xp-db = $(call Device/marvell-nand,XP DB (DB-78460-BP)) -Device/armada-xp-gp = $(call Device/marvell-nand,XP GP (DB-MV784MP-GP)) -TARGET_DEVICES += armada-370-db armada-370-rd armada-xp-db armada-xp-gp +define Device/armada-370-db + $(call Device/marvell-nand,370 DB (DB-88F6710-BP-DDR3)) +endef +TARGET_DEVICES += armada-370-db + +define Device/armada-370-rd + $(call Device/marvell-nand,370 RD (RD-88F6710-A1)) +endef +TARGET_DEVICES += armada-370-rd + +define Device/armada-xp-db + $(call Device/marvell-nand,XP DB (DB-78460-BP)) +endef +TARGET_DEVICES += armada-xp-db + +define Device/armada-xp-gp + $(call Device/marvell-nand,XP GP (DB-MV784MP-GP)) +endef +TARGET_DEVICES += armada-xp-gp define Device/armada-388-rd DEVICE_TITLE := Marvell Armada 388 RD (RD-88F6820-AP) diff --git a/target/linux/mvebu/image/cfbase-boot.script b/target/linux/mvebu/image/cfbase-boot.script index 5f9bcd70ba..89fa1dc578 100644 --- a/target/linux/mvebu/image/cfbase-boot.script +++ b/target/linux/mvebu/image/cfbase-boot.script @@ -9,8 +9,8 @@ setenv fdtfile armada-388-clearfog-base.dtb # generate bootargs for rootfs on MMC if test "${devtype}" = "mmc"; then - setexpr lede_rootpart ${distro_bootpart} + 1 - setenv bootargs ${bootargs} root=/dev/mmcblk${devnum}p${lede_rootpart} rootfstype=auto rootwait + setexpr openwrt_rootpart ${distro_bootpart} + 1 + setenv bootargs ${bootargs} root=/dev/mmcblk${devnum}p${openwrt_rootpart} rootfstype=auto rootwait fi # here one could add logic for other rootfs device types such as scsi and usb diff --git a/target/linux/mvebu/image/cfpro-boot.script b/target/linux/mvebu/image/cfpro-boot.script index e1523f8fb3..1588c1546e 100644 --- a/target/linux/mvebu/image/cfpro-boot.script +++ b/target/linux/mvebu/image/cfpro-boot.script @@ -5,8 +5,8 @@ # generate bootargs for rootfs on MMC if test "${devtype}" = "mmc"; then - setexpr lede_rootpart ${distro_bootpart} + 1 - setenv bootargs ${bootargs} root=/dev/mmcblk${devnum}p${lede_rootpart} rootfstype=auto rootwait + setexpr openwrt_rootpart ${distro_bootpart} + 1 + setenv bootargs ${bootargs} root=/dev/mmcblk${devnum}p${openwrt_rootpart} rootfstype=auto rootwait fi # here one could add logic for other rootfs device types such as scsi and usb diff --git a/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch b/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch index c398a47341..fbee3d2887 100644 --- a/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch +++ b/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch @@ -14,7 +14,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -1067,15 +1067,28 @@ static void mvneta_defaults_set(struct m +@@ -1071,15 +1071,28 @@ static void mvneta_defaults_set(struct m MVNETA_GMAC_AN_SPEED_EN | MVNETA_GMAC_AN_DUPLEX_EN; mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); @@ -43,7 +43,7 @@ Signed-off-by: David S. Miller } mvneta_set_ucast_table(pp, -1); -@@ -3228,9 +3241,6 @@ static int mvneta_port_power_up(struct m +@@ -3232,9 +3245,6 @@ static int mvneta_port_power_up(struct m return -EINVAL; } diff --git a/target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch b/target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch index dc4a224b74..3154d7cfbe 100644 --- a/target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch +++ b/target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch @@ -32,7 +32,7 @@ Signed-off-by: David S. Miller u64 ethtool_stats[ARRAY_SIZE(mvneta_statistics)]; }; -@@ -973,6 +973,44 @@ static void mvneta_set_other_mcast_table +@@ -977,6 +977,44 @@ static void mvneta_set_other_mcast_table mvreg_write(pp, MVNETA_DA_FILT_OTH_MCAST + offset, val); } @@ -77,7 +77,7 @@ Signed-off-by: David S. Miller /* This method sets defaults to the NETA port: * Clears interrupt Cause and Mask registers. * Clears all MAC tables. -@@ -1058,39 +1096,7 @@ static void mvneta_defaults_set(struct m +@@ -1062,39 +1100,7 @@ static void mvneta_defaults_set(struct m val &= ~MVNETA_PHY_POLLING_ENABLE; mvreg_write(pp, MVNETA_UNIT_CONTROL, val); @@ -118,7 +118,7 @@ Signed-off-by: David S. Miller mvneta_set_ucast_table(pp, -1); mvneta_set_special_mcast_table(pp, -1); mvneta_set_other_mcast_table(pp, -1); -@@ -2954,10 +2960,43 @@ int mvneta_ethtool_get_settings(struct n +@@ -2958,10 +2964,43 @@ int mvneta_ethtool_get_settings(struct n int mvneta_ethtool_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) { struct mvneta_port *pp = netdev_priv(dev); diff --git a/target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch b/target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch index 83782a0b4f..3be47abc8a 100644 --- a/target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch +++ b/target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch @@ -28,7 +28,7 @@ Signed-off-by: David S. Miller } /* Stop the Ethernet port activity */ -@@ -1067,7 +1068,7 @@ static void mvneta_defaults_set(struct m +@@ -1071,7 +1072,7 @@ static void mvneta_defaults_set(struct m mvreg_write(pp, MVNETA_ACC_MODE, val); /* Update val of portCfg register accordingly with all RxQueue types */ @@ -37,7 +37,7 @@ Signed-off-by: David S. Miller mvreg_write(pp, MVNETA_PORT_CONFIG, val); val = 0; -@@ -2101,19 +2102,19 @@ static void mvneta_set_rx_mode(struct ne +@@ -2105,19 +2106,19 @@ static void mvneta_set_rx_mode(struct ne if (dev->flags & IFF_PROMISC) { /* Accept all: Multicast + Unicast */ mvneta_rx_unicast_promisc_set(pp, 1); @@ -63,7 +63,7 @@ Signed-off-by: David S. Miller } else { /* Accept only initialized multicast */ mvneta_set_special_mcast_table(pp, -1); -@@ -2122,7 +2123,7 @@ static void mvneta_set_rx_mode(struct ne +@@ -2126,7 +2127,7 @@ static void mvneta_set_rx_mode(struct ne if (!netdev_mc_empty(dev)) { netdev_for_each_mc_addr(ha, dev) { mvneta_mcast_addr_set(pp, ha->addr, @@ -72,7 +72,7 @@ Signed-off-by: David S. Miller } } } -@@ -2205,7 +2206,7 @@ static int mvneta_poll(struct napi_struc +@@ -2209,7 +2210,7 @@ static int mvneta_poll(struct napi_struc * RX packets */ cause_rx_tx |= port->cause_rx_tx; @@ -81,7 +81,7 @@ Signed-off-by: David S. Miller budget -= rx_done; if (budget > 0) { -@@ -2418,17 +2419,17 @@ static void mvneta_cleanup_txqs(struct m +@@ -2422,17 +2423,17 @@ static void mvneta_cleanup_txqs(struct m /* Cleanup all Rx queues */ static void mvneta_cleanup_rxqs(struct mvneta_port *pp) { @@ -102,7 +102,7 @@ Signed-off-by: David S. Miller mvneta_cleanup_rxqs(pp); return err; } -@@ -2634,7 +2635,7 @@ static int mvneta_set_mac_addr(struct ne +@@ -2638,7 +2639,7 @@ static int mvneta_set_mac_addr(struct ne mvneta_mac_addr_set(pp, dev->dev_addr, -1); /* Set new addr in hw */ @@ -111,7 +111,7 @@ Signed-off-by: David S. Miller eth_commit_mac_addr_change(dev, addr); return 0; -@@ -2753,7 +2754,7 @@ static void mvneta_percpu_elect(struct m +@@ -2757,7 +2758,7 @@ static void mvneta_percpu_elect(struct m { int online_cpu_idx, cpu, i = 0; @@ -120,7 +120,7 @@ Signed-off-by: David S. Miller for_each_online_cpu(cpu) { if (i == online_cpu_idx) -@@ -3361,6 +3362,8 @@ static int mvneta_probe(struct platform_ +@@ -3365,6 +3366,8 @@ static int mvneta_probe(struct platform_ strcmp(managed, "in-band-status") == 0); pp->cpu_notifier.notifier_call = mvneta_percpu_notifier; diff --git a/target/linux/mvebu/patches-4.4/033-net-mvneta-Associate-RX-queues-with-each-CPU.patch b/target/linux/mvebu/patches-4.4/033-net-mvneta-Associate-RX-queues-with-each-CPU.patch index 636c6cf364..a08d5fdcba 100644 --- a/target/linux/mvebu/patches-4.4/033-net-mvneta-Associate-RX-queues-with-each-CPU.patch +++ b/target/linux/mvebu/patches-4.4/033-net-mvneta-Associate-RX-queues-with-each-CPU.patch @@ -47,7 +47,7 @@ Signed-off-by: David S. Miller } /* Stop the Ethernet port activity */ -@@ -1026,6 +1039,7 @@ static void mvneta_defaults_set(struct m +@@ -1030,6 +1043,7 @@ static void mvneta_defaults_set(struct m int cpu; int queue; u32 val; @@ -55,7 +55,7 @@ Signed-off-by: David S. Miller /* Clear all Cause registers */ mvreg_write(pp, MVNETA_INTR_NEW_CAUSE, 0); -@@ -1041,13 +1055,23 @@ static void mvneta_defaults_set(struct m +@@ -1045,13 +1059,23 @@ static void mvneta_defaults_set(struct m /* Enable MBUS Retry bit16 */ mvreg_write(pp, MVNETA_MBUS_RETRY, 0x20); @@ -85,7 +85,7 @@ Signed-off-by: David S. Miller /* Reset RX and TX DMAs */ mvreg_write(pp, MVNETA_PORT_RX_RESET, MVNETA_PORT_RX_DMA_RESET); -@@ -2174,6 +2198,7 @@ static int mvneta_poll(struct napi_struc +@@ -2178,6 +2202,7 @@ static int mvneta_poll(struct napi_struc { int rx_done = 0; u32 cause_rx_tx; @@ -93,7 +93,7 @@ Signed-off-by: David S. Miller struct mvneta_port *pp = netdev_priv(napi->dev); struct mvneta_pcpu_port *port = this_cpu_ptr(pp->ports); -@@ -2205,8 +2230,15 @@ static int mvneta_poll(struct napi_struc +@@ -2209,8 +2234,15 @@ static int mvneta_poll(struct napi_struc /* For the case where the last mvneta_poll did not process all * RX packets */ @@ -110,7 +110,7 @@ Signed-off-by: David S. Miller budget -= rx_done; if (budget > 0) { -@@ -2419,19 +2451,27 @@ static void mvneta_cleanup_txqs(struct m +@@ -2423,19 +2455,27 @@ static void mvneta_cleanup_txqs(struct m /* Cleanup all Rx queues */ static void mvneta_cleanup_rxqs(struct mvneta_port *pp) { @@ -145,7 +145,7 @@ Signed-off-by: David S. Miller } return 0; -@@ -2455,6 +2495,19 @@ static int mvneta_setup_txqs(struct mvne +@@ -2459,6 +2499,19 @@ static int mvneta_setup_txqs(struct mvne return 0; } @@ -165,7 +165,7 @@ Signed-off-by: David S. Miller static void mvneta_start_dev(struct mvneta_port *pp) { unsigned int cpu; -@@ -2472,11 +2525,10 @@ static void mvneta_start_dev(struct mvne +@@ -2476,11 +2529,10 @@ static void mvneta_start_dev(struct mvne napi_enable(&port->napi); } @@ -181,7 +181,7 @@ Signed-off-by: David S. Miller mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | MVNETA_CAUSE_LINK_CHANGE | -@@ -2752,22 +2804,35 @@ static void mvneta_percpu_disable(void * +@@ -2756,22 +2808,35 @@ static void mvneta_percpu_disable(void * static void mvneta_percpu_elect(struct mvneta_port *pp) { @@ -227,7 +227,7 @@ Signed-off-by: David S. Miller } }; -@@ -2802,12 +2867,22 @@ static int mvneta_percpu_notifier(struct +@@ -2806,12 +2871,22 @@ static int mvneta_percpu_notifier(struct mvreg_write(pp, MVNETA_INTR_MISC_MASK, 0); napi_enable(&port->napi); @@ -251,7 +251,7 @@ Signed-off-by: David S. Miller mvreg_write(pp, MVNETA_INTR_NEW_MASK, MVNETA_RX_INTR_MASK(rxq_number) | MVNETA_TX_INTR_MASK(txq_number) | -@@ -2858,7 +2933,7 @@ static int mvneta_percpu_notifier(struct +@@ -2862,7 +2937,7 @@ static int mvneta_percpu_notifier(struct static int mvneta_open(struct net_device *dev) { struct mvneta_port *pp = netdev_priv(dev); @@ -260,7 +260,7 @@ Signed-off-by: David S. Miller pp->pkt_size = MVNETA_RX_PKT_SIZE(pp->dev->mtu); pp->frag_size = SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(pp->pkt_size)) + -@@ -2888,8 +2963,13 @@ static int mvneta_open(struct net_device +@@ -2892,8 +2967,13 @@ static int mvneta_open(struct net_device */ mvneta_percpu_disable(pp); diff --git a/target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch b/target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch index 9d729b50bb..ee2c71b5e9 100644 --- a/target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch +++ b/target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch @@ -34,7 +34,7 @@ Signed-off-by: David S. Miller }; /* The mvneta_tx_desc and mvneta_rx_desc structures describe the -@@ -1067,7 +1074,7 @@ static void mvneta_defaults_set(struct m +@@ -1071,7 +1078,7 @@ static void mvneta_defaults_set(struct m if ((rxq % max_cpu) == cpu) rxq_map |= MVNETA_CPU_RXQ_ACCESS(rxq); @@ -43,7 +43,7 @@ Signed-off-by: David S. Miller txq_map = MVNETA_CPU_TXQ_ACCESS_ALL_MASK; mvreg_write(pp, MVNETA_CPU_MAP(cpu), rxq_map | txq_map); -@@ -2508,6 +2515,18 @@ static void mvneta_percpu_unmask_interru +@@ -2512,6 +2519,18 @@ static void mvneta_percpu_unmask_interru MVNETA_MISCINTR_INTR_MASK); } @@ -62,7 +62,7 @@ Signed-off-by: David S. Miller static void mvneta_start_dev(struct mvneta_port *pp) { unsigned int cpu; -@@ -3229,6 +3248,106 @@ static int mvneta_ethtool_get_sset_count +@@ -3233,6 +3252,106 @@ static int mvneta_ethtool_get_sset_count return -EOPNOTSUPP; } @@ -169,7 +169,7 @@ Signed-off-by: David S. Miller static const struct net_device_ops mvneta_netdev_ops = { .ndo_open = mvneta_open, .ndo_stop = mvneta_stop, -@@ -3253,6 +3372,10 @@ const struct ethtool_ops mvneta_eth_tool +@@ -3257,6 +3376,10 @@ const struct ethtool_ops mvneta_eth_tool .get_strings = mvneta_ethtool_get_strings, .get_ethtool_stats = mvneta_ethtool_get_stats, .get_sset_count = mvneta_ethtool_get_sset_count, @@ -180,7 +180,7 @@ Signed-off-by: David S. Miller }; /* Initialize hw */ -@@ -3444,6 +3567,8 @@ static int mvneta_probe(struct platform_ +@@ -3448,6 +3571,8 @@ static int mvneta_probe(struct platform_ pp->rxq_def = rxq_def; diff --git a/target/linux/mvebu/patches-4.4/035-net-mvneta-Configure-XPS-support.patch b/target/linux/mvebu/patches-4.4/035-net-mvneta-Configure-XPS-support.patch index 5b35b6442b..7389466b6d 100644 --- a/target/linux/mvebu/patches-4.4/035-net-mvneta-Configure-XPS-support.patch +++ b/target/linux/mvebu/patches-4.4/035-net-mvneta-Configure-XPS-support.patch @@ -32,7 +32,7 @@ Signed-off-by: David S. Miller }; struct mvneta_rx_queue { -@@ -1062,20 +1066,30 @@ static void mvneta_defaults_set(struct m +@@ -1066,20 +1070,30 @@ static void mvneta_defaults_set(struct m /* Enable MBUS Retry bit16 */ mvreg_write(pp, MVNETA_MBUS_RETRY, 0x20); @@ -69,7 +69,7 @@ Signed-off-by: David S. Miller mvreg_write(pp, MVNETA_CPU_MAP(cpu), rxq_map | txq_map); } -@@ -2362,6 +2376,8 @@ static void mvneta_rxq_deinit(struct mvn +@@ -2366,6 +2380,8 @@ static void mvneta_rxq_deinit(struct mvn static int mvneta_txq_init(struct mvneta_port *pp, struct mvneta_tx_queue *txq) { @@ -78,7 +78,7 @@ Signed-off-by: David S. Miller txq->size = pp->tx_ring_size; /* A queue must always have room for at least one skb. -@@ -2414,6 +2430,14 @@ static int mvneta_txq_init(struct mvneta +@@ -2418,6 +2434,14 @@ static int mvneta_txq_init(struct mvneta } mvneta_tx_done_pkts_coal_set(pp, txq, txq->done_pkts_coal); @@ -93,7 +93,7 @@ Signed-off-by: David S. Miller return 0; } -@@ -2836,13 +2860,23 @@ static void mvneta_percpu_elect(struct m +@@ -2840,13 +2864,23 @@ static void mvneta_percpu_elect(struct m if ((rxq % max_cpu) == cpu) rxq_map |= MVNETA_CPU_RXQ_ACCESS(rxq); diff --git a/target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch b/target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch index d88336701d..e79a11a4f1 100644 --- a/target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch +++ b/target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch @@ -13,7 +13,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3240,26 +3240,25 @@ static void mvneta_ethtool_update_stats( +@@ -3244,26 +3244,25 @@ static void mvneta_ethtool_update_stats( const struct mvneta_statistic *s; void __iomem *base = pp->base; u32 high, low, val; diff --git a/target/linux/mvebu/patches-4.4/038-net-mvneta-Fix-the-CPU-choice-in-mvneta_percpu_elect.patch b/target/linux/mvebu/patches-4.4/038-net-mvneta-Fix-the-CPU-choice-in-mvneta_percpu_elect.patch index 4fc9ccc76a..3423307c1c 100644 --- a/target/linux/mvebu/patches-4.4/038-net-mvneta-Fix-the-CPU-choice-in-mvneta_percpu_elect.patch +++ b/target/linux/mvebu/patches-4.4/038-net-mvneta-Fix-the-CPU-choice-in-mvneta_percpu_elect.patch @@ -20,7 +20,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -2847,9 +2847,14 @@ static void mvneta_percpu_disable(void * +@@ -2851,9 +2851,14 @@ static void mvneta_percpu_disable(void * static void mvneta_percpu_elect(struct mvneta_port *pp) { @@ -37,7 +37,7 @@ Signed-off-by: David S. Miller max_cpu = num_present_cpus(); for_each_online_cpu(cpu) { -@@ -2860,7 +2865,7 @@ static void mvneta_percpu_elect(struct m +@@ -2864,7 +2869,7 @@ static void mvneta_percpu_elect(struct m if ((rxq % max_cpu) == cpu) rxq_map |= MVNETA_CPU_RXQ_ACCESS(rxq); @@ -46,7 +46,7 @@ Signed-off-by: David S. Miller /* Map the default receive queue queue to the * elected CPU */ -@@ -2871,7 +2876,7 @@ static void mvneta_percpu_elect(struct m +@@ -2875,7 +2880,7 @@ static void mvneta_percpu_elect(struct m * the CPU bound to the default RX queue */ if (txq_number == 1) diff --git a/target/linux/mvebu/patches-4.4/039-net-mvneta-Use-on_each_cpu-when-possible.patch b/target/linux/mvebu/patches-4.4/039-net-mvneta-Use-on_each_cpu-when-possible.patch index 76257a2a71..8d22df0f9c 100644 --- a/target/linux/mvebu/patches-4.4/039-net-mvneta-Use-on_each_cpu-when-possible.patch +++ b/target/linux/mvebu/patches-4.4/039-net-mvneta-Use-on_each_cpu-when-possible.patch @@ -14,7 +14,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -2553,7 +2553,7 @@ static void mvneta_percpu_mask_interrupt +@@ -2557,7 +2557,7 @@ static void mvneta_percpu_mask_interrupt static void mvneta_start_dev(struct mvneta_port *pp) { @@ -23,7 +23,7 @@ Signed-off-by: David S. Miller mvneta_max_rx_size_set(pp, pp->pkt_size); mvneta_txq_max_tx_size_set(pp, pp->pkt_size); -@@ -2569,9 +2569,8 @@ static void mvneta_start_dev(struct mvne +@@ -2573,9 +2573,8 @@ static void mvneta_start_dev(struct mvne } /* Unmask interrupts. It has to be done from each CPU */ @@ -35,7 +35,7 @@ Signed-off-by: David S. Miller mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | MVNETA_CAUSE_LINK_CHANGE | -@@ -2991,7 +2990,7 @@ static int mvneta_percpu_notifier(struct +@@ -2995,7 +2994,7 @@ static int mvneta_percpu_notifier(struct static int mvneta_open(struct net_device *dev) { struct mvneta_port *pp = netdev_priv(dev); @@ -44,7 +44,7 @@ Signed-off-by: David S. Miller pp->pkt_size = MVNETA_RX_PKT_SIZE(pp->dev->mtu); pp->frag_size = SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(pp->pkt_size)) + -@@ -3024,9 +3023,7 @@ static int mvneta_open(struct net_device +@@ -3028,9 +3027,7 @@ static int mvneta_open(struct net_device /* Enable per-CPU interrupt on all the CPU to handle our RX * queue interrupts */ @@ -55,7 +55,7 @@ Signed-off-by: David S. Miller /* Register a CPU notifier to handle the case where our CPU -@@ -3313,9 +3310,7 @@ static int mvneta_config_rss(struct mvn +@@ -3317,9 +3314,7 @@ static int mvneta_config_rss(struct mvn netif_tx_stop_all_queues(pp->dev); diff --git a/target/linux/mvebu/patches-4.4/040-net-mvneta-Modify-the-queue-related-fields-from-each.patch b/target/linux/mvebu/patches-4.4/040-net-mvneta-Modify-the-queue-related-fields-from-each.patch index b025777df9..acb6c94bb2 100644 --- a/target/linux/mvebu/patches-4.4/040-net-mvneta-Modify-the-queue-related-fields-from-each.patch +++ b/target/linux/mvebu/patches-4.4/040-net-mvneta-Modify-the-queue-related-fields-from-each.patch @@ -17,7 +17,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -1036,6 +1036,43 @@ static void mvneta_set_autoneg(struct mv +@@ -1040,6 +1040,43 @@ static void mvneta_set_autoneg(struct mv } } @@ -61,7 +61,7 @@ Signed-off-by: David S. Miller /* This method sets defaults to the NETA port: * Clears interrupt Cause and Mask registers. * Clears all MAC tables. -@@ -1053,14 +1090,10 @@ static void mvneta_defaults_set(struct m +@@ -1057,14 +1094,10 @@ static void mvneta_defaults_set(struct m int max_cpu = num_present_cpus(); /* Clear all Cause registers */ @@ -78,7 +78,7 @@ Signed-off-by: David S. Miller mvreg_write(pp, MVNETA_INTR_ENABLE, 0); /* Enable MBUS Retry bit16 */ -@@ -2526,31 +2559,6 @@ static int mvneta_setup_txqs(struct mvne +@@ -2530,31 +2563,6 @@ static int mvneta_setup_txqs(struct mvne return 0; } @@ -110,7 +110,7 @@ Signed-off-by: David S. Miller static void mvneta_start_dev(struct mvneta_port *pp) { int cpu; -@@ -2601,13 +2609,10 @@ static void mvneta_stop_dev(struct mvnet +@@ -2605,13 +2613,10 @@ static void mvneta_stop_dev(struct mvnet mvneta_port_disable(pp); /* Clear all ethernet port interrupts */ @@ -126,7 +126,7 @@ Signed-off-by: David S. Miller mvneta_tx_reset(pp); mvneta_rx_reset(pp); -@@ -2919,9 +2924,7 @@ static int mvneta_percpu_notifier(struct +@@ -2923,9 +2928,7 @@ static int mvneta_percpu_notifier(struct } /* Mask all ethernet port interrupts */ @@ -137,7 +137,7 @@ Signed-off-by: David S. Miller napi_enable(&port->napi); -@@ -2936,14 +2939,8 @@ static int mvneta_percpu_notifier(struct +@@ -2940,14 +2943,8 @@ static int mvneta_percpu_notifier(struct */ mvneta_percpu_elect(pp); @@ -154,7 +154,7 @@ Signed-off-by: David S. Miller mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | MVNETA_CAUSE_LINK_CHANGE | -@@ -2954,9 +2951,7 @@ static int mvneta_percpu_notifier(struct +@@ -2958,9 +2955,7 @@ static int mvneta_percpu_notifier(struct case CPU_DOWN_PREPARE_FROZEN: netif_tx_stop_all_queues(pp->dev); /* Mask all ethernet port interrupts */ @@ -165,7 +165,7 @@ Signed-off-by: David S. Miller napi_synchronize(&port->napi); napi_disable(&port->napi); -@@ -2972,10 +2967,7 @@ static int mvneta_percpu_notifier(struct +@@ -2976,10 +2971,7 @@ static int mvneta_percpu_notifier(struct /* Check if a new CPU must be elected now this on is down */ mvneta_percpu_elect(pp); /* Unmask all ethernet port interrupts */ diff --git a/target/linux/mvebu/patches-4.4/041-net-mvneta-The-mvneta_percpu_elect-function-should-b.patch b/target/linux/mvebu/patches-4.4/041-net-mvneta-The-mvneta_percpu_elect-function-should-b.patch index a77bef44e4..1d3d6aaf14 100644 --- a/target/linux/mvebu/patches-4.4/041-net-mvneta-The-mvneta_percpu_elect-function-should-b.patch +++ b/target/linux/mvebu/patches-4.4/041-net-mvneta-The-mvneta_percpu_elect-function-should-b.patch @@ -31,7 +31,7 @@ Signed-off-by: David S. Miller /* Core clock */ struct clk *clk; -@@ -2853,6 +2857,12 @@ static void mvneta_percpu_elect(struct m +@@ -2857,6 +2861,12 @@ static void mvneta_percpu_elect(struct m { int elected_cpu = 0, max_cpu, cpu, i = 0; @@ -44,7 +44,7 @@ Signed-off-by: David S. Miller /* Use the cpu associated to the rxq when it is online, in all * the other cases, use the cpu 0 which can't be offline. */ -@@ -2896,6 +2906,7 @@ static void mvneta_percpu_elect(struct m +@@ -2900,6 +2910,7 @@ static void mvneta_percpu_elect(struct m i++; } @@ -52,7 +52,7 @@ Signed-off-by: David S. Miller }; static int mvneta_percpu_notifier(struct notifier_block *nfb, -@@ -2950,8 +2961,13 @@ static int mvneta_percpu_notifier(struct +@@ -2954,8 +2965,13 @@ static int mvneta_percpu_notifier(struct case CPU_DOWN_PREPARE: case CPU_DOWN_PREPARE_FROZEN: netif_tx_stop_all_queues(pp->dev); diff --git a/target/linux/mvebu/patches-4.4/042-net-mvneta-Fix-race-condition-during-stopping.patch b/target/linux/mvebu/patches-4.4/042-net-mvneta-Fix-race-condition-during-stopping.patch index 9936ebf320..878229cbf7 100644 --- a/target/linux/mvebu/patches-4.4/042-net-mvneta-Fix-race-condition-during-stopping.patch +++ b/target/linux/mvebu/patches-4.4/042-net-mvneta-Fix-race-condition-during-stopping.patch @@ -26,7 +26,7 @@ Signed-off-by: David S. Miller /* Core clock */ struct clk *clk; -@@ -2853,16 +2854,14 @@ static void mvneta_percpu_disable(void * +@@ -2857,16 +2858,14 @@ static void mvneta_percpu_disable(void * disable_percpu_irq(pp->dev->irq); } @@ -47,7 +47,7 @@ Signed-off-by: David S. Miller /* Use the cpu associated to the rxq when it is online, in all * the other cases, use the cpu 0 which can't be offline. */ -@@ -2906,7 +2905,6 @@ static void mvneta_percpu_elect(struct m +@@ -2910,7 +2909,6 @@ static void mvneta_percpu_elect(struct m i++; } @@ -55,7 +55,7 @@ Signed-off-by: David S. Miller }; static int mvneta_percpu_notifier(struct notifier_block *nfb, -@@ -2920,6 +2918,14 @@ static int mvneta_percpu_notifier(struct +@@ -2924,6 +2922,14 @@ static int mvneta_percpu_notifier(struct switch (action) { case CPU_ONLINE: case CPU_ONLINE_FROZEN: @@ -70,7 +70,7 @@ Signed-off-by: David S. Miller netif_tx_stop_all_queues(pp->dev); /* We have to synchronise on tha napi of each CPU -@@ -2957,6 +2963,7 @@ static int mvneta_percpu_notifier(struct +@@ -2961,6 +2967,7 @@ static int mvneta_percpu_notifier(struct MVNETA_CAUSE_LINK_CHANGE | MVNETA_CAUSE_PSC_SYNC_CHANGE); netif_tx_start_all_queues(pp->dev); @@ -78,7 +78,7 @@ Signed-off-by: David S. Miller break; case CPU_DOWN_PREPARE: case CPU_DOWN_PREPARE_FROZEN: -@@ -2981,7 +2988,9 @@ static int mvneta_percpu_notifier(struct +@@ -2985,7 +2992,9 @@ static int mvneta_percpu_notifier(struct case CPU_DEAD: case CPU_DEAD_FROZEN: /* Check if a new CPU must be elected now this on is down */ @@ -88,7 +88,7 @@ Signed-off-by: David S. Miller /* Unmask all ethernet port interrupts */ on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true); mvreg_write(pp, MVNETA_INTR_MISC_MASK, -@@ -3033,7 +3042,7 @@ static int mvneta_open(struct net_device +@@ -3037,7 +3046,7 @@ static int mvneta_open(struct net_device */ on_each_cpu(mvneta_percpu_enable, pp, true); @@ -97,7 +97,7 @@ Signed-off-by: David S. Miller /* Register a CPU notifier to handle the case where our CPU * might be taken offline. */ -@@ -3066,9 +3075,18 @@ static int mvneta_stop(struct net_device +@@ -3070,9 +3079,18 @@ static int mvneta_stop(struct net_device { struct mvneta_port *pp = netdev_priv(dev); @@ -116,7 +116,7 @@ Signed-off-by: David S. Miller on_each_cpu(mvneta_percpu_disable, pp, true); free_percpu_irq(dev->irq, pp->ports); mvneta_cleanup_rxqs(pp); -@@ -3339,7 +3357,9 @@ static int mvneta_config_rss(struct mvn +@@ -3343,7 +3361,9 @@ static int mvneta_config_rss(struct mvn mvreg_write(pp, MVNETA_PORT_CONFIG, val); /* Update the elected CPU matching the new rxq_def */ diff --git a/target/linux/mvebu/patches-4.4/045-net-mvneta-bm-add-support-for-hardware-buffer-manage.patch b/target/linux/mvebu/patches-4.4/045-net-mvneta-bm-add-support-for-hardware-buffer-manage.patch index d343b3983f..a1b5ca8c6a 100644 --- a/target/linux/mvebu/patches-4.4/045-net-mvneta-bm-add-support-for-hardware-buffer-manage.patch +++ b/target/linux/mvebu/patches-4.4/045-net-mvneta-bm-add-support-for-hardware-buffer-manage.patch @@ -495,7 +495,7 @@ Signed-off-by: David S. Miller /* Start the Ethernet port RX and TX activity */ static void mvneta_port_up(struct mvneta_port *pp) { -@@ -1147,9 +1379,17 @@ static void mvneta_defaults_set(struct m +@@ -1151,9 +1383,17 @@ static void mvneta_defaults_set(struct m mvreg_write(pp, MVNETA_PORT_RX_RESET, 0); /* Set Port Acceleration Mode */ @@ -514,7 +514,7 @@ Signed-off-by: David S. Miller /* Update val of portCfg register accordingly with all RxQueue types */ val = MVNETA_PORT_CONFIG_DEFL_VALUE(pp->rxq_def); mvreg_write(pp, MVNETA_PORT_CONFIG, val); -@@ -1516,23 +1756,25 @@ static void mvneta_txq_done(struct mvnet +@@ -1520,23 +1760,25 @@ static void mvneta_txq_done(struct mvnet } } @@ -547,7 +547,7 @@ Signed-off-by: David S. Miller static int mvneta_rx_refill(struct mvneta_port *pp, struct mvneta_rx_desc *rx_desc) -@@ -1540,7 +1782,7 @@ static int mvneta_rx_refill(struct mvnet +@@ -1544,7 +1786,7 @@ static int mvneta_rx_refill(struct mvnet dma_addr_t phys_addr; void *data; @@ -556,7 +556,7 @@ Signed-off-by: David S. Miller if (!data) return -ENOMEM; -@@ -1548,7 +1790,7 @@ static int mvneta_rx_refill(struct mvnet +@@ -1552,7 +1794,7 @@ static int mvneta_rx_refill(struct mvnet MVNETA_RX_BUF_SIZE(pp->pkt_size), DMA_FROM_DEVICE); if (unlikely(dma_mapping_error(pp->dev->dev.parent, phys_addr))) { @@ -565,7 +565,7 @@ Signed-off-by: David S. Miller return -ENOMEM; } -@@ -1594,22 +1836,156 @@ static void mvneta_rxq_drop_pkts(struct +@@ -1598,22 +1840,156 @@ static void mvneta_rxq_drop_pkts(struct int rx_done, i; rx_done = mvneta_rxq_busy_desc_num_get(pp, rxq); @@ -728,7 +728,7 @@ Signed-off-by: David S. Miller { struct mvneta_pcpu_port *port = this_cpu_ptr(pp->ports); struct net_device *dev = pp->dev; -@@ -1628,21 +2004,29 @@ static int mvneta_rx(struct mvneta_port +@@ -1632,21 +2008,29 @@ static int mvneta_rx(struct mvneta_port /* Fairness NAPI loop */ while (rx_done < rx_todo) { struct mvneta_rx_desc *rx_desc = mvneta_rxq_next_desc_get(rxq); @@ -760,7 +760,7 @@ Signed-off-by: David S. Miller dev->stats.rx_errors++; mvneta_rx_error(pp, rx_desc); /* leave the descriptor untouched */ -@@ -1653,7 +2037,7 @@ static int mvneta_rx(struct mvneta_port +@@ -1657,7 +2041,7 @@ static int mvneta_rx(struct mvneta_port /* better copy a small frame and not unmap the DMA region */ skb = netdev_alloc_skb_ip_align(dev, rx_bytes); if (unlikely(!skb)) @@ -769,7 +769,7 @@ Signed-off-by: David S. Miller dma_sync_single_range_for_cpu(dev->dev.parent, rx_desc->buf_phys_addr, -@@ -1671,26 +2055,31 @@ static int mvneta_rx(struct mvneta_port +@@ -1675,26 +2059,31 @@ static int mvneta_rx(struct mvneta_port rcvd_pkts++; rcvd_bytes += rx_bytes; @@ -807,7 +807,7 @@ Signed-off-by: David S. Miller if (!skb) goto err_drop_frame; -@@ -2295,7 +2684,10 @@ static int mvneta_poll(struct napi_struc +@@ -2299,7 +2688,10 @@ static int mvneta_poll(struct napi_struc if (rx_queue) { rx_queue = rx_queue - 1; @@ -819,7 +819,7 @@ Signed-off-by: David S. Miller } budget -= rx_done; -@@ -2384,9 +2776,17 @@ static int mvneta_rxq_init(struct mvneta +@@ -2388,9 +2780,17 @@ static int mvneta_rxq_init(struct mvneta mvneta_rx_pkts_coal_set(pp, rxq, rxq->pkts_coal); mvneta_rx_time_coal_set(pp, rxq, rxq->time_coal); @@ -840,7 +840,7 @@ Signed-off-by: David S. Miller mvneta_rxq_fill(pp, rxq, rxq->size); return 0; -@@ -2659,6 +3059,9 @@ static int mvneta_change_mtu(struct net_ +@@ -2663,6 +3063,9 @@ static int mvneta_change_mtu(struct net_ dev->mtu = mtu; if (!netif_running(dev)) { @@ -850,7 +850,7 @@ Signed-off-by: David S. Miller netdev_update_features(dev); return 0; } -@@ -2671,6 +3074,9 @@ static int mvneta_change_mtu(struct net_ +@@ -2675,6 +3078,9 @@ static int mvneta_change_mtu(struct net_ mvneta_cleanup_txqs(pp); mvneta_cleanup_rxqs(pp); @@ -860,7 +860,7 @@ Signed-off-by: David S. Miller pp->pkt_size = MVNETA_RX_PKT_SIZE(dev->mtu); pp->frag_size = SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(pp->pkt_size)) + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); -@@ -3563,6 +3969,7 @@ static int mvneta_probe(struct platform_ +@@ -3567,6 +3973,7 @@ static int mvneta_probe(struct platform_ struct resource *res; struct device_node *dn = pdev->dev.of_node; struct device_node *phy_node; @@ -868,7 +868,7 @@ Signed-off-by: David S. Miller struct mvneta_port *pp; struct net_device *dev; const char *dt_mac_addr; -@@ -3690,26 +4097,39 @@ static int mvneta_probe(struct platform_ +@@ -3694,26 +4101,39 @@ static int mvneta_probe(struct platform_ pp->tx_csum_limit = tx_csum_limit; @@ -914,7 +914,7 @@ Signed-off-by: David S. Miller for_each_present_cpu(cpu) { struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu); -@@ -3744,6 +4164,13 @@ static int mvneta_probe(struct platform_ +@@ -3748,6 +4168,13 @@ static int mvneta_probe(struct platform_ return 0; @@ -928,7 +928,7 @@ Signed-off-by: David S. Miller err_free_stats: free_percpu(pp->stats); err_free_ports: -@@ -3773,6 +4200,12 @@ static int mvneta_remove(struct platform +@@ -3777,6 +4204,12 @@ static int mvneta_remove(struct platform of_node_put(pp->phy_node); free_netdev(dev); diff --git a/target/linux/mvebu/patches-4.4/046-net-mvneta-Use-the-new-hwbm-framework.patch b/target/linux/mvebu/patches-4.4/046-net-mvneta-Use-the-new-hwbm-framework.patch index 210504c39e..fb9859c5d2 100644 --- a/target/linux/mvebu/patches-4.4/046-net-mvneta-Use-the-new-hwbm-framework.patch +++ b/target/linux/mvebu/patches-4.4/046-net-mvneta-Use-the-new-hwbm-framework.patch @@ -64,7 +64,7 @@ Signed-off-by: David S. Miller goto bm_mtu_err; } mvneta_bm_pool_bufsize_set(pp, bm_pool->buf_size, bm_pool->id); -@@ -2064,14 +2066,14 @@ err_drop_frame: +@@ -2068,14 +2070,14 @@ err_drop_frame: } /* Refill processing */ diff --git a/target/linux/mvebu/patches-4.4/047-net-mvneta-Fix-spinlock-usage.patch b/target/linux/mvebu/patches-4.4/047-net-mvneta-Fix-spinlock-usage.patch index a8e78df2e9..7058686c20 100644 --- a/target/linux/mvebu/patches-4.4/047-net-mvneta-Fix-spinlock-usage.patch +++ b/target/linux/mvebu/patches-4.4/047-net-mvneta-Fix-spinlock-usage.patch @@ -19,7 +19,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3484,17 +3484,17 @@ static int mvneta_stop(struct net_device +@@ -3488,17 +3488,17 @@ static int mvneta_stop(struct net_device struct mvneta_port *pp = netdev_priv(dev); /* Inform that we are stopping so we don't want to setup the @@ -42,7 +42,7 @@ Signed-off-by: David S. Miller on_each_cpu(mvneta_percpu_disable, pp, true); free_percpu_irq(dev->irq, pp->ports); mvneta_cleanup_rxqs(pp); -@@ -4027,6 +4027,7 @@ static int mvneta_probe(struct platform_ +@@ -4031,6 +4031,7 @@ static int mvneta_probe(struct platform_ dev->ethtool_ops = &mvneta_eth_tool_ops; pp = netdev_priv(dev); diff --git a/target/linux/mvebu/patches-4.4/049-net-mvneta-replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch b/target/linux/mvebu/patches-4.4/049-net-mvneta-replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch index c12d98a4e2..4b319e26a7 100644 --- a/target/linux/mvebu/patches-4.4/049-net-mvneta-replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch +++ b/target/linux/mvebu/patches-4.4/049-net-mvneta-replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch @@ -33,7 +33,7 @@ Signed-off-by: David S. Miller #define IS_TSO_HEADER(txq, addr) \ ((addr >= txq->tso_hdrs_phys) && \ -@@ -2762,9 +2761,6 @@ static int mvneta_rxq_init(struct mvneta +@@ -2766,9 +2765,6 @@ static int mvneta_rxq_init(struct mvneta if (rxq->descs == NULL) return -ENOMEM; @@ -43,7 +43,7 @@ Signed-off-by: David S. Miller rxq->last_desc = rxq->size - 1; /* Set Rx descriptors queue starting address */ -@@ -2835,10 +2831,6 @@ static int mvneta_txq_init(struct mvneta +@@ -2839,10 +2835,6 @@ static int mvneta_txq_init(struct mvneta if (txq->descs == NULL) return -ENOMEM; diff --git a/target/linux/mvebu/patches-4.4/050-net-mvneta-fix-changing-MTU-when-using-per-cpu-proce.patch b/target/linux/mvebu/patches-4.4/050-net-mvneta-fix-changing-MTU-when-using-per-cpu-proce.patch index 07862008a7..fdc5663510 100644 --- a/target/linux/mvebu/patches-4.4/050-net-mvneta-fix-changing-MTU-when-using-per-cpu-proce.patch +++ b/target/linux/mvebu/patches-4.4/050-net-mvneta-fix-changing-MTU-when-using-per-cpu-proce.patch @@ -15,7 +15,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3040,6 +3040,20 @@ static int mvneta_check_mtu_valid(struct +@@ -3044,6 +3044,20 @@ static int mvneta_check_mtu_valid(struct return mtu; } @@ -36,7 +36,7 @@ Signed-off-by: David S. Miller /* Change the device mtu */ static int mvneta_change_mtu(struct net_device *dev, int mtu) { -@@ -3064,6 +3078,7 @@ static int mvneta_change_mtu(struct net_ +@@ -3068,6 +3082,7 @@ static int mvneta_change_mtu(struct net_ * reallocation of the queues */ mvneta_stop_dev(pp); @@ -44,7 +44,7 @@ Signed-off-by: David S. Miller mvneta_cleanup_txqs(pp); mvneta_cleanup_rxqs(pp); -@@ -3087,6 +3102,7 @@ static int mvneta_change_mtu(struct net_ +@@ -3091,6 +3106,7 @@ static int mvneta_change_mtu(struct net_ return ret; } @@ -52,7 +52,7 @@ Signed-off-by: David S. Miller mvneta_start_dev(pp); mvneta_port_up(pp); -@@ -3240,20 +3256,6 @@ static void mvneta_mdio_remove(struct mv +@@ -3244,20 +3260,6 @@ static void mvneta_mdio_remove(struct mv pp->phy_dev = NULL; } diff --git a/target/linux/mvebu/patches-4.4/120-phy-move-fixed_phy-MII-register-generation-to-a-libr.patch b/target/linux/mvebu/patches-4.4/120-phy-move-fixed_phy-MII-register-generation-to-a-libr.patch index 0b5042afd0..00745f1c9b 100644 --- a/target/linux/mvebu/patches-4.4/120-phy-move-fixed_phy-MII-register-generation-to-a-libr.patch +++ b/target/linux/mvebu/patches-4.4/120-phy-move-fixed_phy-MII-register-generation-to-a-libr.patch @@ -31,7 +31,7 @@ Signed-off-by: Russell King comment "MII PHY device drivers" config AQUANTIA_PHY -@@ -210,6 +213,7 @@ config RTL8306_PHY +@@ -205,6 +208,7 @@ config RTL8306_PHY config FIXED_PHY tristate "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs" depends on PHYLIB diff --git a/target/linux/mvebu/patches-4.4/125-phy-provide-a-hook-for-link-up-link-down-events.patch b/target/linux/mvebu/patches-4.4/125-phy-provide-a-hook-for-link-up-link-down-events.patch index a27e6baec3..0a0157be9d 100644 --- a/target/linux/mvebu/patches-4.4/125-phy-provide-a-hook-for-link-up-link-down-events.patch +++ b/target/linux/mvebu/patches-4.4/125-phy-provide-a-hook-for-link-up-link-down-events.patch @@ -173,7 +173,7 @@ Signed-off-by: Russell King --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -433,6 +433,7 @@ struct phy_device { +@@ -429,6 +429,7 @@ struct phy_device { u8 mdix; diff --git a/target/linux/mvebu/patches-4.4/128-phy-export-phy_speed_to_str-for-phylink.patch b/target/linux/mvebu/patches-4.4/128-phy-export-phy_speed_to_str-for-phylink.patch index 1b79259dac..c43607029c 100644 --- a/target/linux/mvebu/patches-4.4/128-phy-export-phy_speed_to_str-for-phylink.patch +++ b/target/linux/mvebu/patches-4.4/128-phy-export-phy_speed_to_str-for-phylink.patch @@ -34,7 +34,7 @@ Signed-off-by: Russell King case PHY_##_state: \ --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -816,6 +816,7 @@ int phy_ethtool_gset(struct phy_device * +@@ -812,6 +812,7 @@ int phy_ethtool_gset(struct phy_device * int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr); int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd); int phy_start_interrupts(struct phy_device *phydev); diff --git a/target/linux/mvebu/patches-4.4/129-phy-add-I2C-mdio-bus.patch b/target/linux/mvebu/patches-4.4/129-phy-add-I2C-mdio-bus.patch index ad26e6b45a..13f8ecfcd4 100644 --- a/target/linux/mvebu/patches-4.4/129-phy-add-I2C-mdio-bus.patch +++ b/target/linux/mvebu/patches-4.4/129-phy-add-I2C-mdio-bus.patch @@ -19,7 +19,7 @@ Signed-off-by: Russell King --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -238,6 +238,16 @@ config MDIO_GPIO +@@ -233,6 +233,16 @@ config MDIO_GPIO To compile this driver as a module, choose M here: the module will be called mdio-gpio. diff --git a/target/linux/mvebu/patches-4.4/130-phylink-add-phylink-infrastructure.patch b/target/linux/mvebu/patches-4.4/130-phylink-add-phylink-infrastructure.patch index 0d340c8278..141ea07d2a 100644 --- a/target/linux/mvebu/patches-4.4/130-phylink-add-phylink-infrastructure.patch +++ b/target/linux/mvebu/patches-4.4/130-phylink-add-phylink-infrastructure.patch @@ -914,7 +914,7 @@ Signed-off-by: Russell King +MODULE_LICENSE("GPL"); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -147,6 +147,7 @@ static inline const char *phy_modes(phy_ +@@ -143,6 +143,7 @@ static inline const char *phy_modes(phy_ #define MII_ADDR_C45 (1<<30) struct device; @@ -922,7 +922,7 @@ Signed-off-by: Russell King struct sk_buff; /* -@@ -429,6 +430,7 @@ struct phy_device { +@@ -425,6 +426,7 @@ struct phy_device { struct mutex lock; diff --git a/target/linux/mvebu/patches-4.4/132-sfp-add-phylink-based-SFP-module-support.patch b/target/linux/mvebu/patches-4.4/132-sfp-add-phylink-based-SFP-module-support.patch index dbfcaccac4..07b1766b0b 100644 --- a/target/linux/mvebu/patches-4.4/132-sfp-add-phylink-based-SFP-module-support.patch +++ b/target/linux/mvebu/patches-4.4/132-sfp-add-phylink-based-SFP-module-support.patch @@ -30,7 +30,7 @@ Signed-off-by: Russell King --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -230,6 +230,11 @@ config FIXED_PHY +@@ -225,6 +225,11 @@ config FIXED_PHY Currently tested with mpc866ads and mpc8349e-mitx. @@ -44,7 +44,7 @@ Signed-off-by: Russell King help --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile -@@ -62,3 +62,4 @@ obj-$(CONFIG_MDIO_MOXART) += mdio-moxart +@@ -61,3 +61,4 @@ obj-$(CONFIG_MDIO_MOXART) += mdio-moxart obj-$(CONFIG_MDIO_BCM_UNIMAC) += mdio-bcm-unimac.o obj-$(CONFIG_MICROCHIP_PHY) += microchip.o obj-$(CONFIG_MDIO_BCM_IPROC) += mdio-bcm-iproc.o diff --git a/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch b/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch index fac283f3ee..3bfaf1582e 100644 --- a/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch +++ b/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch @@ -79,7 +79,18 @@ Signed-off-by: Russell King struct mvneta_bm *bm_priv; struct mvneta_bm_pool *pool_long; -@@ -1236,44 +1238,6 @@ static void mvneta_set_other_mcast_table +@@ -1177,10 +1179,6 @@ static void mvneta_port_disable(struct m + val &= ~MVNETA_GMAC0_PORT_ENABLE; + mvreg_write(pp, MVNETA_GMAC_CTRL_0, val); + +- pp->link = 0; +- pp->duplex = -1; +- pp->speed = 0; +- + udelay(200); + } + +@@ -1240,44 +1238,6 @@ static void mvneta_set_other_mcast_table mvreg_write(pp, MVNETA_DA_FILT_OTH_MCAST + offset, val); } @@ -124,7 +135,7 @@ Signed-off-by: Russell King static void mvneta_percpu_unmask_interrupt(void *arg) { struct mvneta_port *pp = arg; -@@ -1421,7 +1385,6 @@ static void mvneta_defaults_set(struct m +@@ -1425,7 +1385,6 @@ static void mvneta_defaults_set(struct m val &= ~MVNETA_PHY_POLLING_ENABLE; mvreg_write(pp, MVNETA_UNIT_CONTROL, val); @@ -132,7 +143,7 @@ Signed-off-by: Russell King mvneta_set_ucast_table(pp, -1); mvneta_set_special_mcast_table(pp, -1); mvneta_set_other_mcast_table(pp, -1); -@@ -2614,26 +2577,11 @@ static irqreturn_t mvneta_isr(int irq, v +@@ -2618,26 +2577,11 @@ static irqreturn_t mvneta_isr(int irq, v return IRQ_HANDLED; } @@ -161,7 +172,7 @@ Signed-off-by: Russell King } /* NAPI handler -@@ -2662,12 +2610,11 @@ static int mvneta_poll(struct napi_struc +@@ -2666,12 +2610,11 @@ static int mvneta_poll(struct napi_struc u32 cause_misc = mvreg_read(pp, MVNETA_INTR_MISC_CAUSE); mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0); @@ -179,7 +190,7 @@ Signed-off-by: Russell King } /* Release Tx descriptors */ -@@ -2983,7 +2930,7 @@ static void mvneta_start_dev(struct mvne +@@ -2987,7 +2930,7 @@ static void mvneta_start_dev(struct mvne MVNETA_CAUSE_LINK_CHANGE | MVNETA_CAUSE_PSC_SYNC_CHANGE); @@ -188,7 +199,7 @@ Signed-off-by: Russell King netif_tx_start_all_queues(pp->dev); } -@@ -2991,7 +2938,7 @@ static void mvneta_stop_dev(struct mvnet +@@ -2995,7 +2938,7 @@ static void mvneta_stop_dev(struct mvnet { unsigned int cpu; @@ -197,7 +208,7 @@ Signed-off-by: Russell King for_each_online_cpu(cpu) { struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu); -@@ -3161,99 +3108,219 @@ static int mvneta_set_mac_addr(struct ne +@@ -3165,99 +3108,219 @@ static int mvneta_set_mac_addr(struct ne return 0; } @@ -438,13 +449,6 @@ Signed-off-by: Russell King - struct phy_device *phy_dev; + struct mvneta_port *pp = netdev_priv(ndev); + u32 val; -+ -+ if (mode == MLO_AN_PHY || mode == MLO_AN_FIXED) { -+ val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG); -+ val &= ~MVNETA_GMAC_FORCE_LINK_DOWN; -+ val |= MVNETA_GMAC_FORCE_LINK_PASS; -+ mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); -+ } - phy_dev = of_phy_connect(pp->dev, pp->phy_node, mvneta_adjust_link, 0, - pp->phy_interface); @@ -460,10 +464,17 @@ Signed-off-by: Russell King - pp->link = 0; - pp->duplex = 0; - pp->speed = 0; -+ mvneta_port_up(pp); -+} ++ if (mode == MLO_AN_PHY || mode == MLO_AN_FIXED) { ++ val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG); ++ val &= ~MVNETA_GMAC_FORCE_LINK_DOWN; ++ val |= MVNETA_GMAC_FORCE_LINK_PASS; ++ mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); ++ } - return 0; ++ mvneta_port_up(pp); ++} ++ +static const struct phylink_mac_ops mvneta_phylink_ops = { + .mac_get_support = mvneta_mac_support, + .mac_link_state = mvneta_mac_link_state, @@ -490,7 +501,7 @@ Signed-off-by: Russell King } /* Electing a CPU must be done in an atomic way: it should be done -@@ -3501,10 +3568,7 @@ static int mvneta_ioctl(struct net_devic +@@ -3505,10 +3568,7 @@ static int mvneta_ioctl(struct net_devic { struct mvneta_port *pp = netdev_priv(dev); @@ -502,7 +513,7 @@ Signed-off-by: Russell King } /* Ethtool methods */ -@@ -3514,54 +3578,15 @@ int mvneta_ethtool_get_settings(struct n +@@ -3518,54 +3578,15 @@ int mvneta_ethtool_get_settings(struct n { struct mvneta_port *pp = netdev_priv(dev); @@ -559,7 +570,7 @@ Signed-off-by: Russell King } /* Set interrupt coalescing for ethtools */ -@@ -3669,7 +3694,8 @@ static void mvneta_ethtool_update_stats( +@@ -3673,7 +3694,8 @@ static void mvneta_ethtool_update_stats( { const struct mvneta_statistic *s; void __iomem *base = pp->base; @@ -569,7 +580,7 @@ Signed-off-by: Russell King u64 val64; int i; -@@ -3964,14 +3990,13 @@ static int mvneta_probe(struct platform_ +@@ -3968,14 +3990,13 @@ static int mvneta_probe(struct platform_ const struct mbus_dram_target_info *dram_target_info; struct resource *res; struct device_node *dn = pdev->dev.of_node; @@ -585,7 +596,7 @@ Signed-off-by: Russell King int tx_csum_limit; int phy_mode; int err; -@@ -3987,31 +4012,11 @@ static int mvneta_probe(struct platform_ +@@ -3991,31 +4012,11 @@ static int mvneta_probe(struct platform_ goto err_free_netdev; } @@ -618,7 +629,7 @@ Signed-off-by: Russell King } dev->tx_queue_len = MVNETA_MAX_TXD; -@@ -4022,12 +4027,7 @@ static int mvneta_probe(struct platform_ +@@ -4026,12 +4027,7 @@ static int mvneta_probe(struct platform_ pp = netdev_priv(dev); spin_lock_init(&pp->lock); @@ -632,7 +643,7 @@ Signed-off-by: Russell King pp->cpu_notifier.notifier_call = mvneta_percpu_notifier; pp->rxq_def = rxq_def; -@@ -4037,7 +4037,7 @@ static int mvneta_probe(struct platform_ +@@ -4041,7 +4037,7 @@ static int mvneta_probe(struct platform_ pp->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(pp->clk)) { err = PTR_ERR(pp->clk); @@ -641,7 +652,7 @@ Signed-off-by: Russell King } clk_prepare_enable(pp->clk); -@@ -4140,6 +4140,14 @@ static int mvneta_probe(struct platform_ +@@ -4144,6 +4140,14 @@ static int mvneta_probe(struct platform_ dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE; dev->gso_max_segs = MVNETA_MAX_TSO_SEGS; @@ -656,7 +667,7 @@ Signed-off-by: Russell King err = register_netdev(dev); if (err < 0) { dev_err(&pdev->dev, "failed to register\n"); -@@ -4151,13 +4159,6 @@ static int mvneta_probe(struct platform_ +@@ -4155,13 +4159,6 @@ static int mvneta_probe(struct platform_ platform_set_drvdata(pdev, pp->dev); @@ -670,7 +681,7 @@ Signed-off-by: Russell King return 0; -@@ -4169,13 +4170,13 @@ err_netdev: +@@ -4173,13 +4170,13 @@ err_netdev: 1 << pp->id); } err_free_stats: @@ -686,7 +697,7 @@ Signed-off-by: Russell King err_free_irq: irq_dispose_mapping(dev->irq); err_free_netdev: -@@ -4194,7 +4195,7 @@ static int mvneta_remove(struct platform +@@ -4198,7 +4195,7 @@ static int mvneta_remove(struct platform free_percpu(pp->ports); free_percpu(pp->stats); irq_dispose_mapping(dev->irq); diff --git a/target/linux/mvebu/patches-4.4/470-ClearFog-renamed-upstream.patch b/target/linux/mvebu/patches-4.4/470-ClearFog-renamed-upstream.patch new file mode 100644 index 0000000000..3eeda9fd3a --- /dev/null +++ b/target/linux/mvebu/patches-4.4/470-ClearFog-renamed-upstream.patch @@ -0,0 +1,80 @@ +From b0db8cc1fe7eab722bc1f7c386132b3905d67f30 Mon Sep 17 00:00:00 2001 +From: Marko Ratkaj +Date: Fri, 7 Apr 2017 11:01:26 +0200 +Subject: [PATCH 1/2] ClearFog renamed upstream + +Signed-off-by: Marko Ratkaj +--- + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/armada-388-clearfog-pro.dts | 55 +++++++++++++++++++++++++++ + 2 files changed, 56 insertions(+) + create mode 100644 arch/arm/boot/dts/armada-388-clearfog-pro.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -924,6 +924,7 @@ dtb-$(CONFIG_MACH_ARMADA_38X) += \ + armada-385-linksys-rango.dtb \ + armada-385-linksys-shelby.dtb \ + armada-388-clearfog.dtb \ ++ armada-388-clearfog-pro.dtb \ + armada-388-db.dtb \ + armada-388-gp.dtb \ + armada-388-rd.dtb +--- /dev/null ++++ b/arch/arm/boot/dts/armada-388-clearfog-pro.dts +@@ -0,0 +1,55 @@ ++/* ++ * Device Tree file for SolidRun Clearfog Pro revision A1 rev 2.0 (88F6828) ++ * ++ * Copyright (C) 2015 Russell King ++ * ++ * This board is in development; the contents of this file work with ++ * the A1 rev 2.0 of the board, which does not represent final ++ * production board. Things will change, don't expect this file to ++ * remain compatible info the future. ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This file 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. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++#include "armada-388-clearfog.dts" ++ ++/ { ++ model = "SolidRun Clearfog Pro A1"; ++ compatible = "solidrun,clearfog-pro-a1", ++ "solidrun,clearfog-a1", "marvell,armada388", ++ "marvell,armada385", "marvell,armada380"; ++}; diff --git a/target/linux/mvebu/patches-4.4/471-add-ClearFog-Base-device-tree-files.patch b/target/linux/mvebu/patches-4.4/471-add-ClearFog-Base-device-tree-files.patch new file mode 100644 index 0000000000..aa442d2562 --- /dev/null +++ b/target/linux/mvebu/patches-4.4/471-add-ClearFog-Base-device-tree-files.patch @@ -0,0 +1,540 @@ +From b4ac5820bdc98ee24a2f73b8bd7fdf7f82db3a46 Mon Sep 17 00:00:00 2001 +From: Marko Ratkaj +Date: Fri, 7 Apr 2017 11:02:30 +0200 +Subject: [PATCH 2/2] add ClearFog Base device tree files + +Signed-off-by: Marko Ratkaj +--- + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/armada-388-clearfog-base.dts | 161 ++++++++++++ + arch/arm/boot/dts/armada-388-clearfog.dtsi | 282 +++++++++++++++++++++ + .../dts/armada-38x-solidrun-microsom-emmc.dtsi | 62 +++++ + 4 files changed, 506 insertions(+) + create mode 100644 arch/arm/boot/dts/armada-388-clearfog-base.dts + create mode 100644 arch/arm/boot/dts/armada-388-clearfog.dtsi + create mode 100644 arch/arm/boot/dts/armada-38x-solidrun-microsom-emmc.dtsi + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -925,6 +925,7 @@ dtb-$(CONFIG_MACH_ARMADA_38X) += \ + armada-385-linksys-shelby.dtb \ + armada-388-clearfog.dtb \ + armada-388-clearfog-pro.dtb \ ++ armada-388-clearfog-base.dtb \ + armada-388-db.dtb \ + armada-388-gp.dtb \ + armada-388-rd.dtb +--- /dev/null ++++ b/arch/arm/boot/dts/armada-388-clearfog-base.dts +@@ -0,0 +1,161 @@ ++/* ++ * Device Tree file for SolidRun Clearfog Base revision A1 rev 2.0 (88F6828) ++ * ++ * Copyright (C) 2015 Russell King ++ * ++ * This board is in development; the contents of this file work with ++ * the A1 rev 2.0 of the board, which does not represent final ++ * production board. Things will change, don't expect this file to ++ * remain compatible info the future. ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This file 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. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/dts-v1/; ++#include "armada-388-clearfog.dtsi" ++#include "armada-38x-solidrun-microsom-emmc.dtsi" ++ ++/ { ++ model = "SolidRun Clearfog Base A1"; ++ compatible = "solidrun,clearfog-base-a1", ++ "solidrun,clearfog-a1", "marvell,armada388", ++ "marvell,armada385", "marvell,armada380"; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ pinctrl-0 = <&rear_button_pins>; ++ pinctrl-names = "default"; ++ ++ button_0 { ++ /* The rear SW3 button */ ++ label = "Rear Button"; ++ gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; ++ linux,can-disable; ++ linux,code = ; ++ }; ++ }; ++}; ++ ++ð1 { ++ phy = <&phy1>; ++}; ++ ++&gpio0 { ++ phy1_reset { ++ gpio-hog; ++ gpios = <19 GPIO_ACTIVE_LOW>; ++ output-low; ++ line-name = "phy1-reset"; ++ }; ++}; ++ ++&mdio { ++ pinctrl-0 = <&mdio_pins µsom_phy_clk_pins &clearfog_phy_pins>; ++ phy1: ethernet-phy@1 { ++ /* ++ * Annoyingly, the marvell phy driver configures the LED ++ * register, rather than preserving reset-loaded setting. ++ * We undo that rubbish here. ++ */ ++ marvell,reg-init = <3 16 0 0x101e>; ++ reg = <1>; ++ }; ++}; ++ ++&pinctrl { ++ /* phy1 reset */ ++ clearfog_phy_pins: clearfog-phy-pins { ++ marvell,pins = "mpp19"; ++ marvell,function = "gpio"; ++ }; ++ rear_button_pins: rear-button-pins { ++ marvell,pins = "mpp44"; ++ marvell,function = "gpio"; ++ }; ++}; ++ ++/* ++MPP ++18: pu gpio pca9655 int ++19: gpio phy reset ++20: pu gpio sd0 detect ++21: sd0:cmd ++22: pd gpio mikro int ++23: ++ ++24: ua1:rxd mikro rx ++25: ua1:txd mikro tx ++26: pu i2c1:sck ++27: pu i2c1:sda ++28: sd0:clk ++29: pd gpio mikro rst ++30: ++31: ++ ++32: ++33: ++34: ++35: ++36: ++37: sd0:d3 ++38: sd0:d0 ++39: sd0:d1 ++ ++40: sd0:d2 ++41: ++42: ++43: spi1:cs2 mikro cs ++44: gpio rear button sw3 ++45: ref:clk_out0 phy#0 clock ++46: ref:clk_out1 phy#1 clock ++47: ++ ++48: gpio J18 spare gpio ++49: gpio U10 I2C_IRQ(GNSS) ++50: gpio board id? ++51: ++52: ++53: ++54: gpio mikro pwm ++55: ++ ++56: pu spi1:mosi mikro mosi ++57: pd spi1:sck mikro sck ++58: spi1:miso mikro miso ++59: ++*/ +--- /dev/null ++++ b/arch/arm/boot/dts/armada-388-clearfog.dtsi +@@ -0,0 +1,282 @@ ++/* ++ * Device Tree include file for SolidRun Clearfog 88F6828 based boards ++ * ++ * Copyright (C) 2015 Russell King ++ * ++ * This board is in development; the contents of this file work with ++ * the A1 rev 2.0 of the board, which does not represent final ++ * production board. Things will change, don't expect this file to ++ * remain compatible info the future. ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This file 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. ++ * ++ * Or, alternatively ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++#include "armada-388.dtsi" ++#include "armada-38x-solidrun-microsom.dtsi" ++ ++/ { ++ aliases { ++ /* So that mvebu u-boot can update the MAC addresses */ ++ ethernet1 = ð0; ++ ethernet2 = ð1; ++ ethernet3 = ð2; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ reg_3p3v: regulator-3p3v { ++ compatible = "regulator-fixed"; ++ regulator-name = "3P3V"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-always-on; ++ }; ++ ++ soc { ++ internal-regs { ++ sata@a8000 { ++ /* pinctrl? */ ++ status = "okay"; ++ }; ++ ++ sata@e0000 { ++ /* pinctrl? */ ++ status = "okay"; ++ }; ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ usb@58000 { ++ /* CON3, nearest power. */ ++ status = "okay"; ++ }; ++ ++ usb3@f8000 { ++ /* CON7 */ ++ status = "okay"; ++ }; ++ }; ++ ++ pcie-controller { ++ status = "okay"; ++ /* ++ * The two PCIe units are accessible through ++ * the mini-PCIe connectors on the board. ++ */ ++ pcie@2,0 { ++ /* Port 1, Lane 0. CON3, nearest power. */ ++ reset-gpios = <&expander0 1 GPIO_ACTIVE_LOW>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ sfp: sfp { ++ compatible = "sff,sfp"; ++ i2c-bus = <&i2c1>; ++ los-gpio = <&expander0 12 GPIO_ACTIVE_HIGH>; ++ moddef0-gpio = <&expander0 15 GPIO_ACTIVE_LOW>; ++ sfp,ethernet = <ð2>; ++ tx-disable-gpio = <&expander0 14 GPIO_ACTIVE_HIGH>; ++ tx-fault-gpio = <&expander0 13 GPIO_ACTIVE_HIGH>; ++ }; ++}; ++ ++ð1 { ++ /* ethernet@30000 */ ++ bm,pool-long = <2>; ++ bm,pool-short = <1>; ++ buffer-manager = <&bm>; ++ phy-mode = "sgmii"; ++ status = "okay"; ++}; ++ ++ð2 { ++ /* ethernet@34000 */ ++ bm,pool-long = <3>; ++ bm,pool-short = <1>; ++ buffer-manager = <&bm>; ++ managed = "in-band-status"; ++ phy-mode = "sgmii"; ++ status = "okay"; ++}; ++ ++&i2c0 { ++ clock-frequency = <400000>; ++ pinctrl-0 = <&i2c0_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++ ++ /* ++ * PCA9655 GPIO expander, up to 1MHz clock. ++ * 0-CON3 CLKREQ# ++ * 1-CON3 PERST# ++ * 2- ++ * 3-CON3 W_DISABLE ++ * 4- ++ * 5-USB3 overcurrent ++ * 6-USB3 power ++ * 7- ++ * 8-JP4 P1 ++ * 9-JP4 P4 ++ * 10-JP4 P5 ++ * 11-m.2 DEVSLP ++ * 12-SFP_LOS ++ * 13-SFP_TX_FAULT ++ * 14-SFP_TX_DISABLE ++ * 15-SFP_MOD_DEF0 ++ */ ++ expander0: gpio-expander@20 { ++ /* ++ * This is how it should be: ++ * compatible = "onnn,pca9655", "nxp,pca9555"; ++ * but you can't do this because of the way I2C works. ++ */ ++ compatible = "nxp,pca9555"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ reg = <0x20>; ++ ++ pcie1_0_clkreq { ++ gpio-hog; ++ gpios = <0 GPIO_ACTIVE_LOW>; ++ input; ++ line-name = "pcie1.0-clkreq"; ++ }; ++ pcie1_0_w_disable { ++ gpio-hog; ++ gpios = <3 GPIO_ACTIVE_LOW>; ++ output-low; ++ line-name = "pcie1.0-w-disable"; ++ }; ++ usb3_ilimit { ++ gpio-hog; ++ gpios = <5 GPIO_ACTIVE_LOW>; ++ input; ++ line-name = "usb3-current-limit"; ++ }; ++ usb3_power { ++ gpio-hog; ++ gpios = <6 GPIO_ACTIVE_HIGH>; ++ output-high; ++ line-name = "usb3-power"; ++ }; ++ m2_devslp { ++ gpio-hog; ++ gpios = <11 GPIO_ACTIVE_HIGH>; ++ output-low; ++ line-name = "m.2 devslp"; ++ }; ++ }; ++ ++ /* The MCP3021 supports standard and fast modes */ ++ mikrobus_adc: mcp3021@4c { ++ compatible = "microchip,mcp3021"; ++ reg = <0x4c>; ++ }; ++}; ++ ++&i2c1 { ++ /* ++ * Routed to SFP, mikrobus, and PCIe. ++ * SFP limits this to 100kHz, and requires an AT24C01A/02/04 with ++ * address pins tied low, which takes addresses 0x50 and 0x51. ++ * Mikrobus doesn't specify beyond an I2C bus being present. ++ * PCIe uses ARP to assign addresses, or 0x63-0x64. ++ */ ++ clock-frequency = <100000>; ++ pinctrl-0 = <&clearfog_i2c1_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++}; ++ ++&pinctrl { ++ clearfog_i2c1_pins: i2c1-pins { ++ /* SFP, PCIe, mSATA, mikrobus */ ++ marvell,pins = "mpp26", "mpp27"; ++ marvell,function = "i2c1"; ++ }; ++ clearfog_sdhci_cd_pins: clearfog-sdhci-cd-pins { ++ marvell,pins = "mpp20"; ++ marvell,function = "gpio"; ++ }; ++ mikro_pins: mikro-pins { ++ /* int: mpp22 rst: mpp29 */ ++ marvell,pins = "mpp22", "mpp29"; ++ marvell,function = "gpio"; ++ }; ++ mikro_spi_pins: mikro-spi-pins { ++ marvell,pins = "mpp43"; ++ marvell,function = "spi1"; ++ }; ++ mikro_uart_pins: mikro-uart-pins { ++ marvell,pins = "mpp24", "mpp25"; ++ marvell,function = "ua1"; ++ }; ++}; ++ ++&spi1 { ++ /* ++ * Add SPI CS pins for clearfog: ++ * CS0: W25Q32 (not populated on uSOM) ++ * CS1: PIC microcontroller (Pro models) ++ * CS2: mikrobus ++ */ ++ pinctrl-0 = <&spi1_pins &mikro_spi_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++}; ++ ++&uart1 { ++ /* mikrobus uart */ ++ pinctrl-0 = <&mikro_uart_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++}; +--- /dev/null ++++ b/arch/arm/boot/dts/armada-38x-solidrun-microsom-emmc.dtsi +@@ -0,0 +1,62 @@ ++/* ++ * Device Tree file for SolidRun Armada 38x Microsom add-on for eMMC ++ * ++ * Copyright (C) 2015 Russell King ++ * ++ * This board is in development; the contents of this file work with ++ * the A1 rev 2.0 of the board, which does not represent final ++ * production board. Things will change, don't expect this file to ++ * remain compatible info the future. ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This file 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. ++ * ++ * Or, alternatively ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++/ { ++ soc { ++ internal-regs { ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ }; ++ }; ++}; diff --git a/target/linux/mvebu/patches-4.9/110-pxa3xxx_revert_irq_thread.patch b/target/linux/mvebu/patches-4.9/110-pxa3xxx_revert_irq_thread.patch index 419306ed90..299f079669 100644 --- a/target/linux/mvebu/patches-4.9/110-pxa3xxx_revert_irq_thread.patch +++ b/target/linux/mvebu/patches-4.9/110-pxa3xxx_revert_irq_thread.patch @@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau } static inline int is_buf_blank(uint8_t *buf, size_t len) -@@ -1856,9 +1842,7 @@ static int alloc_nand_resource(struct pl +@@ -1857,9 +1843,7 @@ static int alloc_nand_resource(struct pl /* initialize all interrupts to be disabled */ disable_int(info, NDSR_MASK); diff --git a/target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch b/target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch index 5fedc8e8ab..f9d5ac1bbd 100644 --- a/target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch +++ b/target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -1719,8 +1719,10 @@ static struct mvneta_tx_queue *mvneta_tx +@@ -1724,8 +1724,10 @@ static struct mvneta_tx_queue *mvneta_tx /* Free tx queue skbuffs */ static void mvneta_txq_bufs_free(struct mvneta_port *pp, @@ -12,7 +12,7 @@ int i; for (i = 0; i < num; i++) { -@@ -1728,6 +1730,11 @@ static void mvneta_txq_bufs_free(struct +@@ -1733,6 +1735,11 @@ static void mvneta_txq_bufs_free(struct txq->txq_get_index; struct sk_buff *skb = txq->tx_skb[txq->txq_get_index]; @@ -24,7 +24,7 @@ mvneta_txq_inc_get(txq); if (!IS_TSO_HEADER(txq, tx_desc->buf_phys_addr)) -@@ -1738,6 +1745,8 @@ static void mvneta_txq_bufs_free(struct +@@ -1743,6 +1750,8 @@ static void mvneta_txq_bufs_free(struct continue; dev_kfree_skb_any(skb); } @@ -33,7 +33,7 @@ } /* Handle end of transmission */ -@@ -1751,7 +1760,7 @@ static void mvneta_txq_done(struct mvnet +@@ -1756,7 +1765,7 @@ static void mvneta_txq_done(struct mvnet if (!tx_done) return; @@ -42,7 +42,7 @@ txq->count -= tx_done; -@@ -2358,6 +2367,8 @@ out: +@@ -2363,6 +2372,8 @@ out: struct mvneta_pcpu_stats *stats = this_cpu_ptr(pp->stats); struct netdev_queue *nq = netdev_get_tx_queue(dev, txq_id); @@ -51,7 +51,7 @@ txq->count += frags; mvneta_txq_pend_desc_add(pp, txq, frags); -@@ -2382,9 +2393,10 @@ static void mvneta_txq_done_force(struct +@@ -2387,9 +2398,10 @@ static void mvneta_txq_done_force(struct struct mvneta_tx_queue *txq) { @@ -63,7 +63,7 @@ /* reset txq */ txq->count = 0; -@@ -2880,6 +2892,8 @@ static int mvneta_txq_init(struct mvneta +@@ -2885,6 +2897,8 @@ static int mvneta_txq_init(struct mvneta static void mvneta_txq_deinit(struct mvneta_port *pp, struct mvneta_tx_queue *txq) { @@ -72,7 +72,7 @@ kfree(txq->tx_skb); if (txq->tso_hdrs) -@@ -2891,6 +2905,8 @@ static void mvneta_txq_deinit(struct mvn +@@ -2896,6 +2910,8 @@ static void mvneta_txq_deinit(struct mvn txq->size * MVNETA_DESC_ALIGNED_SIZE, txq->descs, txq->descs_phys); diff --git a/target/linux/mvebu/patches-4.9/130-irqchip-armada-xp-backport.patch b/target/linux/mvebu/patches-4.9/130-irqchip-armada-xp-backport.patch new file mode 100644 index 0000000000..14cbb7beb5 --- /dev/null +++ b/target/linux/mvebu/patches-4.9/130-irqchip-armada-xp-backport.patch @@ -0,0 +1,17 @@ +Backport a change that updates the effective affinity mask. The Armada IRQ +controller only supports setting the affinity to a single CPU, and the IRQ +subsystem needs to know about that. + +Signed-off-by: Felix Fietkau +--- +--- a/drivers/irqchip/irq-armada-370-xp.c ++++ b/drivers/irqchip/irq-armada-370-xp.c +@@ -251,6 +251,8 @@ static int armada_xp_set_affinity(struct + writel(reg, main_int_base + ARMADA_370_XP_INT_SOURCE_CTL(hwirq)); + raw_spin_unlock(&irq_controller_lock); + ++ cpumask_copy(irq_data_get_affinity_mask(d), cpumask_of(cpu)); ++ + return IRQ_SET_MASK_OK; + } + #endif diff --git a/target/linux/mvebu/patches-4.9/300-mvneta-tx-queue-workaround.patch b/target/linux/mvebu/patches-4.9/300-mvneta-tx-queue-workaround.patch index 2582a41993..d5486e7388 100644 --- a/target/linux/mvebu/patches-4.9/300-mvneta-tx-queue-workaround.patch +++ b/target/linux/mvebu/patches-4.9/300-mvneta-tx-queue-workaround.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3833,6 +3833,16 @@ static int mvneta_ethtool_get_rxfh(struc +@@ -3838,6 +3838,16 @@ static int mvneta_ethtool_get_rxfh(struc return 0; } @@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau static const struct net_device_ops mvneta_netdev_ops = { .ndo_open = mvneta_open, .ndo_stop = mvneta_stop, -@@ -3843,6 +3853,7 @@ static const struct net_device_ops mvnet +@@ -3848,6 +3858,7 @@ static const struct net_device_ops mvnet .ndo_fix_features = mvneta_fix_features, .ndo_get_stats64 = mvneta_get_stats64, .ndo_do_ioctl = mvneta_ioctl, diff --git a/target/linux/mvebu/patches-4.9/400-phy-provide-a-hook-for-link-up-link-down-events.patch b/target/linux/mvebu/patches-4.9/400-phy-provide-a-hook-for-link-up-link-down-events.patch index da4d24b7d4..cac2e6ea6d 100644 --- a/target/linux/mvebu/patches-4.9/400-phy-provide-a-hook-for-link-up-link-down-events.patch +++ b/target/linux/mvebu/patches-4.9/400-phy-provide-a-hook-for-link-up-link-down-events.patch @@ -167,7 +167,7 @@ Signed-off-by: Russell King --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -429,6 +429,7 @@ struct phy_device { +@@ -425,6 +425,7 @@ struct phy_device { u8 mdix; diff --git a/target/linux/mvebu/patches-4.9/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch b/target/linux/mvebu/patches-4.9/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch index 360108fcc4..20ed3119d6 100644 --- a/target/linux/mvebu/patches-4.9/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch +++ b/target/linux/mvebu/patches-4.9/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch @@ -256,7 +256,7 @@ Signed-off-by: Russell King +EXPORT_SYMBOL(phy_write_mmd); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -630,14 +630,7 @@ struct phy_fixup { +@@ -626,14 +626,7 @@ struct phy_fixup { * * Same rules as for phy_read(); */ @@ -272,7 +272,7 @@ Signed-off-by: Russell King /** * phy_read_mmd_indirect - reads data from the MMD registers -@@ -731,16 +724,7 @@ static inline bool phy_is_pseudo_fixed_l +@@ -727,16 +720,7 @@ static inline bool phy_is_pseudo_fixed_l * * Same rules as for phy_write(); */ diff --git a/target/linux/mvebu/patches-4.9/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch b/target/linux/mvebu/patches-4.9/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch index fcb274d557..33d467794a 100644 --- a/target/linux/mvebu/patches-4.9/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch +++ b/target/linux/mvebu/patches-4.9/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch @@ -64,7 +64,7 @@ Signed-off-by: Russell King EXPORT_SYMBOL(phy_write_mmd); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -573,6 +573,30 @@ struct phy_driver { +@@ -569,6 +569,30 @@ struct phy_driver { */ void (*link_change_notify)(struct phy_device *dev); diff --git a/target/linux/mvebu/patches-4.9/407-net-phy-add-802.3-clause-45-support-to-phylib.patch b/target/linux/mvebu/patches-4.9/407-net-phy-add-802.3-clause-45-support-to-phylib.patch index ae4bb846f3..0715a6a8aa 100644 --- a/target/linux/mvebu/patches-4.9/407-net-phy-add-802.3-clause-45-support-to-phylib.patch +++ b/target/linux/mvebu/patches-4.9/407-net-phy-add-802.3-clause-45-support-to-phylib.patch @@ -295,7 +295,7 @@ Signed-off-by: Russell King } --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -810,6 +810,8 @@ static inline const char *phydev_name(co +@@ -806,6 +806,8 @@ static inline const char *phydev_name(co void phy_attached_print(struct phy_device *phydev, const char *fmt, ...) __printf(2, 3); void phy_attached_info(struct phy_device *phydev); @@ -304,7 +304,7 @@ Signed-off-by: Russell King int genphy_config_init(struct phy_device *phydev); int genphy_setup_forced(struct phy_device *phydev); int genphy_restart_aneg(struct phy_device *phydev); -@@ -824,6 +826,16 @@ static inline int genphy_no_soft_reset(s +@@ -820,6 +822,16 @@ static inline int genphy_no_soft_reset(s { return 0; } diff --git a/target/linux/mvebu/patches-4.9/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch b/target/linux/mvebu/patches-4.9/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch index f4da7e92e0..2f0039b111 100644 --- a/target/linux/mvebu/patches-4.9/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch +++ b/target/linux/mvebu/patches-4.9/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch @@ -91,7 +91,7 @@ Signed-off-by: Russell King { --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -645,6 +645,9 @@ struct phy_fixup { +@@ -641,6 +641,9 @@ struct phy_fixup { int (*run)(struct phy_device *phydev); }; diff --git a/target/linux/mvebu/patches-4.9/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch b/target/linux/mvebu/patches-4.9/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch index 051a9ed68e..8ead41cd6c 100644 --- a/target/linux/mvebu/patches-4.9/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch +++ b/target/linux/mvebu/patches-4.9/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch @@ -305,7 +305,7 @@ Signed-off-by: Russell King { --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -648,6 +648,21 @@ struct phy_fixup { +@@ -644,6 +644,21 @@ struct phy_fixup { const char *phy_speed_to_str(int speed); const char *phy_duplex_to_str(unsigned int duplex); diff --git a/target/linux/mvebu/patches-4.9/415-phylink-add-phylink-infrastructure.patch b/target/linux/mvebu/patches-4.9/415-phylink-add-phylink-infrastructure.patch index 59e8aa81b7..cf9b2061cb 100644 --- a/target/linux/mvebu/patches-4.9/415-phylink-add-phylink-infrastructure.patch +++ b/target/linux/mvebu/patches-4.9/415-phylink-add-phylink-infrastructure.patch @@ -999,7 +999,7 @@ Signed-off-by: Russell King +MODULE_LICENSE("GPL"); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -153,6 +153,7 @@ static inline const char *phy_modes(phy_ +@@ -149,6 +149,7 @@ static inline const char *phy_modes(phy_ #define MII_ADDR_C45 (1<<30) struct device; @@ -1007,7 +1007,7 @@ Signed-off-by: Russell King struct sk_buff; /* -@@ -425,6 +426,7 @@ struct phy_device { +@@ -421,6 +422,7 @@ struct phy_device { struct mutex lock; diff --git a/target/linux/mvebu/patches-4.9/419-net-mvneta-convert-to-phylink.patch b/target/linux/mvebu/patches-4.9/419-net-mvneta-convert-to-phylink.patch index bc8d5fdacf..b62dadd2f3 100644 --- a/target/linux/mvebu/patches-4.9/419-net-mvneta-convert-to-phylink.patch +++ b/target/linux/mvebu/patches-4.9/419-net-mvneta-convert-to-phylink.patch @@ -21,15 +21,15 @@ Signed-off-by: Russell King Marvell ARMADA XP, ARMADA 370 and ARMADA 38x SoC family. --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -28,6 +28,7 @@ - #include +@@ -29,6 +29,7 @@ #include #include + #include +#include #include #include #include -@@ -188,6 +189,7 @@ +@@ -189,6 +190,7 @@ #define MVNETA_GMAC_CTRL_0 0x2c00 #define MVNETA_GMAC_MAX_RX_SIZE_SHIFT 2 #define MVNETA_GMAC_MAX_RX_SIZE_MASK 0x7ffc @@ -37,7 +37,7 @@ Signed-off-by: Russell King #define MVNETA_GMAC0_PORT_ENABLE BIT(0) #define MVNETA_GMAC_CTRL_2 0x2c08 #define MVNETA_GMAC2_INBAND_AN_ENABLE BIT(0) -@@ -203,13 +205,19 @@ +@@ -204,13 +206,19 @@ #define MVNETA_GMAC_TX_FLOW_CTRL_ENABLE BIT(5) #define MVNETA_GMAC_RX_FLOW_CTRL_ACTIVE BIT(6) #define MVNETA_GMAC_TX_FLOW_CTRL_ACTIVE BIT(7) @@ -57,7 +57,7 @@ Signed-off-by: Russell King #define MVNETA_GMAC_AN_FLOW_CTRL_EN BIT(11) #define MVNETA_GMAC_CONFIG_FULL_DUPLEX BIT(12) #define MVNETA_GMAC_AN_DUPLEX_EN BIT(13) -@@ -399,14 +407,9 @@ struct mvneta_port { +@@ -400,14 +408,9 @@ struct mvneta_port { u16 tx_ring_size; u16 rx_ring_size; @@ -74,7 +74,18 @@ Signed-off-by: Russell King struct mvneta_bm *bm_priv; struct mvneta_bm_pool *pool_long; -@@ -1240,44 +1243,6 @@ static void mvneta_set_other_mcast_table +@@ -1182,10 +1185,6 @@ static void mvneta_port_disable(struct m + val &= ~MVNETA_GMAC0_PORT_ENABLE; + mvreg_write(pp, MVNETA_GMAC_CTRL_0, val); + +- pp->link = 0; +- pp->duplex = -1; +- pp->speed = 0; +- + udelay(200); + } + +@@ -1245,44 +1244,6 @@ static void mvneta_set_other_mcast_table mvreg_write(pp, MVNETA_DA_FILT_OTH_MCAST + offset, val); } @@ -119,7 +130,7 @@ Signed-off-by: Russell King static void mvneta_percpu_unmask_interrupt(void *arg) { struct mvneta_port *pp = arg; -@@ -1425,7 +1390,6 @@ static void mvneta_defaults_set(struct m +@@ -1430,7 +1391,6 @@ static void mvneta_defaults_set(struct m val &= ~MVNETA_PHY_POLLING_ENABLE; mvreg_write(pp, MVNETA_UNIT_CONTROL, val); @@ -127,7 +138,7 @@ Signed-off-by: Russell King mvneta_set_ucast_table(pp, -1); mvneta_set_special_mcast_table(pp, -1); mvneta_set_other_mcast_table(pp, -1); -@@ -2630,26 +2594,11 @@ static irqreturn_t mvneta_isr(int irq, v +@@ -2635,26 +2595,11 @@ static irqreturn_t mvneta_isr(int irq, v return IRQ_HANDLED; } @@ -156,7 +167,7 @@ Signed-off-by: Russell King } /* NAPI handler -@@ -2665,7 +2614,6 @@ static int mvneta_poll(struct napi_struc +@@ -2670,7 +2615,6 @@ static int mvneta_poll(struct napi_struc u32 cause_rx_tx; int rx_queue; struct mvneta_port *pp = netdev_priv(napi->dev); @@ -164,7 +175,7 @@ Signed-off-by: Russell King struct mvneta_pcpu_port *port = this_cpu_ptr(pp->ports); if (!netif_running(pp->dev)) { -@@ -2679,12 +2627,11 @@ static int mvneta_poll(struct napi_struc +@@ -2684,12 +2628,11 @@ static int mvneta_poll(struct napi_struc u32 cause_misc = mvreg_read(pp, MVNETA_INTR_MISC_CAUSE); mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0); @@ -182,7 +193,7 @@ Signed-off-by: Russell King } /* Release Tx descriptors */ -@@ -2980,7 +2927,6 @@ static int mvneta_setup_txqs(struct mvne +@@ -2985,7 +2928,6 @@ static int mvneta_setup_txqs(struct mvne static void mvneta_start_dev(struct mvneta_port *pp) { int cpu; @@ -190,7 +201,7 @@ Signed-off-by: Russell King mvneta_max_rx_size_set(pp, pp->pkt_size); mvneta_txq_max_tx_size_set(pp, pp->pkt_size); -@@ -3003,16 +2949,15 @@ static void mvneta_start_dev(struct mvne +@@ -3008,16 +2950,15 @@ static void mvneta_start_dev(struct mvne MVNETA_CAUSE_LINK_CHANGE | MVNETA_CAUSE_PSC_SYNC_CHANGE); @@ -209,7 +220,7 @@ Signed-off-by: Russell King for_each_online_cpu(cpu) { struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu); -@@ -3182,99 +3127,210 @@ static int mvneta_set_mac_addr(struct ne +@@ -3187,99 +3128,210 @@ static int mvneta_set_mac_addr(struct ne return 0; } @@ -252,15 +263,6 @@ Signed-off-by: Russell King - struct phy_device *phydev = ndev->phydev; - int status_change = 0; + u32 gmac_stat; -+ -+ gmac_stat = mvreg_read(pp, MVNETA_GMAC_STATUS); -+ -+ if (gmac_stat & MVNETA_GMAC_SPEED_1000) -+ state->speed = SPEED_1000; -+ else if (gmac_stat & MVNETA_GMAC_SPEED_100) -+ state->speed = SPEED_100; -+ else -+ state->speed = SPEED_10; - if (phydev->link) { - if ((pp->speed != phydev->speed) || @@ -279,17 +281,26 @@ Signed-off-by: Russell King - val |= MVNETA_GMAC_CONFIG_GMII_SPEED; - else if (phydev->speed == SPEED_100) - val |= MVNETA_GMAC_CONFIG_MII_SPEED; -+ state->an_complete = !!(gmac_stat & MVNETA_GMAC_AN_COMPLETE); -+ state->link = !!(gmac_stat & MVNETA_GMAC_LINK_UP); -+ state->duplex = !!(gmac_stat & MVNETA_GMAC_FULL_DUPLEX); ++ gmac_stat = mvreg_read(pp, MVNETA_GMAC_STATUS); - mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); -+ return 1; -+} ++ if (gmac_stat & MVNETA_GMAC_SPEED_1000) ++ state->speed = SPEED_1000; ++ else if (gmac_stat & MVNETA_GMAC_SPEED_100) ++ state->speed = SPEED_100; ++ else ++ state->speed = SPEED_10; - pp->duplex = phydev->duplex; - pp->speed = phydev->speed; - } ++ state->an_complete = !!(gmac_stat & MVNETA_GMAC_AN_COMPLETE); ++ state->link = !!(gmac_stat & MVNETA_GMAC_LINK_UP); ++ state->duplex = !!(gmac_stat & MVNETA_GMAC_FULL_DUPLEX); ++ ++ return 1; ++} ++ +static void mvneta_mac_an_restart(struct net_device *ndev, unsigned int mode) +{ + struct mvneta_port *pp = netdev_priv(ndev); @@ -490,7 +501,7 @@ Signed-off-by: Russell King } /* Electing a CPU must be done in an atomic way: it should be done -@@ -3532,10 +3588,9 @@ static int mvneta_stop(struct net_device +@@ -3537,10 +3589,9 @@ static int mvneta_stop(struct net_device static int mvneta_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { @@ -503,7 +514,7 @@ Signed-off-by: Russell King } /* Ethtool methods */ -@@ -3546,44 +3601,18 @@ mvneta_ethtool_set_link_ksettings(struct +@@ -3551,44 +3602,18 @@ mvneta_ethtool_set_link_ksettings(struct const struct ethtool_link_ksettings *cmd) { struct mvneta_port *pp = netdev_priv(ndev); @@ -557,7 +568,7 @@ Signed-off-by: Russell King } /* Set interrupt coalescing for ethtools */ -@@ -3691,26 +3720,28 @@ static void mvneta_ethtool_update_stats( +@@ -3696,26 +3721,28 @@ static void mvneta_ethtool_update_stats( { const struct mvneta_statistic *s; void __iomem *base = pp->base; @@ -591,7 +602,7 @@ Signed-off-by: Russell King } } -@@ -3870,7 +3901,7 @@ const struct ethtool_ops mvneta_eth_tool +@@ -3875,7 +3902,7 @@ const struct ethtool_ops mvneta_eth_tool .get_rxnfc = mvneta_ethtool_get_rxnfc, .get_rxfh = mvneta_ethtool_get_rxfh, .set_rxfh = mvneta_ethtool_set_rxfh, @@ -600,7 +611,7 @@ Signed-off-by: Russell King .set_link_ksettings = mvneta_ethtool_set_link_ksettings, }; -@@ -3997,14 +4028,13 @@ static int mvneta_probe(struct platform_ +@@ -4002,14 +4029,13 @@ static int mvneta_probe(struct platform_ const struct mbus_dram_target_info *dram_target_info; struct resource *res; struct device_node *dn = pdev->dev.of_node; @@ -616,7 +627,7 @@ Signed-off-by: Russell King int tx_csum_limit; int phy_mode; int err; -@@ -4020,31 +4050,11 @@ static int mvneta_probe(struct platform_ +@@ -4025,31 +4051,11 @@ static int mvneta_probe(struct platform_ goto err_free_netdev; } @@ -649,7 +660,7 @@ Signed-off-by: Russell King } dev->tx_queue_len = MVNETA_MAX_TXD; -@@ -4055,12 +4065,7 @@ static int mvneta_probe(struct platform_ +@@ -4060,12 +4066,7 @@ static int mvneta_probe(struct platform_ pp = netdev_priv(dev); spin_lock_init(&pp->lock); @@ -663,7 +674,7 @@ Signed-off-by: Russell King pp->rxq_def = rxq_def; -@@ -4071,7 +4076,7 @@ static int mvneta_probe(struct platform_ +@@ -4076,7 +4077,7 @@ static int mvneta_probe(struct platform_ pp->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(pp->clk)) { err = PTR_ERR(pp->clk); @@ -672,7 +683,7 @@ Signed-off-by: Russell King } clk_prepare_enable(pp->clk); -@@ -4179,6 +4184,14 @@ static int mvneta_probe(struct platform_ +@@ -4184,6 +4185,14 @@ static int mvneta_probe(struct platform_ dev->priv_flags |= IFF_LIVE_ADDR_CHANGE; dev->gso_max_segs = MVNETA_MAX_TSO_SEGS; @@ -687,7 +698,7 @@ Signed-off-by: Russell King err = register_netdev(dev); if (err < 0) { dev_err(&pdev->dev, "failed to register\n"); -@@ -4190,14 +4203,6 @@ static int mvneta_probe(struct platform_ +@@ -4195,14 +4204,6 @@ static int mvneta_probe(struct platform_ platform_set_drvdata(pdev, pp->dev); @@ -702,7 +713,7 @@ Signed-off-by: Russell King return 0; err_netdev: -@@ -4208,16 +4213,14 @@ err_netdev: +@@ -4213,16 +4214,14 @@ err_netdev: 1 << pp->id); } err_free_stats: @@ -721,7 +732,7 @@ Signed-off-by: Russell King err_free_irq: irq_dispose_mapping(dev->irq); err_free_netdev: -@@ -4229,7 +4232,6 @@ err_free_netdev: +@@ -4234,7 +4233,6 @@ err_free_netdev: static int mvneta_remove(struct platform_device *pdev) { struct net_device *dev = platform_get_drvdata(pdev); @@ -729,7 +740,7 @@ Signed-off-by: Russell King struct mvneta_port *pp = netdev_priv(dev); unregister_netdev(dev); -@@ -4237,10 +4239,8 @@ static int mvneta_remove(struct platform +@@ -4242,10 +4240,8 @@ static int mvneta_remove(struct platform clk_disable_unprepare(pp->clk); free_percpu(pp->ports); free_percpu(pp->stats); diff --git a/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch b/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch index 2558720261..6d35b5005c 100644 --- a/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch +++ b/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch @@ -12,7 +12,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -2629,9 +2629,11 @@ static int mvneta_poll(struct napi_struc +@@ -2630,9 +2630,11 @@ static int mvneta_poll(struct napi_struc mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0); if (cause_misc & (MVNETA_CAUSE_PHY_STATUS_CHANGE | @@ -26,7 +26,7 @@ Signed-off-by: Russell King } /* Release Tx descriptors */ -@@ -2946,8 +2948,7 @@ static void mvneta_start_dev(struct mvne +@@ -2947,8 +2949,7 @@ static void mvneta_start_dev(struct mvne mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | @@ -36,7 +36,7 @@ Signed-off-by: Russell King phylink_start(pp->phylink); netif_tx_start_all_queues(pp->dev); -@@ -3438,8 +3439,7 @@ static int mvneta_cpu_online(unsigned in +@@ -3439,8 +3440,7 @@ static int mvneta_cpu_online(unsigned in on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true); mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | @@ -46,7 +46,7 @@ Signed-off-by: Russell King netif_tx_start_all_queues(pp->dev); spin_unlock(&pp->lock); return 0; -@@ -3480,8 +3480,7 @@ static int mvneta_cpu_dead(unsigned int +@@ -3481,8 +3481,7 @@ static int mvneta_cpu_dead(unsigned int on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true); mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | diff --git a/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch b/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch index 9a604eb03a..20c23ba2ac 100644 --- a/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch +++ b/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch @@ -11,7 +11,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3614,6 +3614,13 @@ mvneta_ethtool_get_link_ksettings(struct +@@ -3615,6 +3615,13 @@ mvneta_ethtool_get_link_ksettings(struct return phylink_ethtool_ksettings_get(pp->phylink, cmd); } @@ -25,7 +25,7 @@ Signed-off-by: Russell King /* Set interrupt coalescing for ethtools */ static int mvneta_ethtool_set_coalesce(struct net_device *dev, struct ethtool_coalesce *c) -@@ -3887,6 +3894,7 @@ static const struct net_device_ops mvnet +@@ -3888,6 +3895,7 @@ static const struct net_device_ops mvnet }; const struct ethtool_ops mvneta_eth_tool_ops = { diff --git a/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch b/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch index f10b57c99a..3f778953e0 100644 --- a/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch +++ b/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch @@ -11,7 +11,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3178,6 +3178,12 @@ static int mvneta_mac_link_state(struct +@@ -3179,6 +3179,12 @@ static int mvneta_mac_link_state(struct state->link = !!(gmac_stat & MVNETA_GMAC_LINK_UP); state->duplex = !!(gmac_stat & MVNETA_GMAC_FULL_DUPLEX); @@ -24,7 +24,7 @@ Signed-off-by: Russell King return 1; } -@@ -3220,6 +3226,8 @@ static void mvneta_mac_config(struct net +@@ -3221,6 +3227,8 @@ static void mvneta_mac_config(struct net if (phylink_test(state->advertising, Pause)) new_an |= MVNETA_GMAC_ADVERT_SYM_FLOW_CTRL; @@ -33,7 +33,7 @@ Signed-off-by: Russell King switch (mode) { case MLO_AN_SGMII: -@@ -3244,7 +3252,7 @@ static void mvneta_mac_config(struct net +@@ -3245,7 +3253,7 @@ static void mvneta_mac_config(struct net /* The MAC only supports FD mode */ MVNETA_GMAC_CONFIG_FULL_DUPLEX; @@ -42,7 +42,7 @@ Signed-off-by: Russell King new_an |= MVNETA_GMAC_AN_FLOW_CTRL_EN; break; -@@ -3710,6 +3718,22 @@ static int mvneta_ethtool_set_ringparam( +@@ -3711,6 +3719,22 @@ static int mvneta_ethtool_set_ringparam( return 0; } @@ -65,7 +65,7 @@ Signed-off-by: Russell King static void mvneta_ethtool_get_strings(struct net_device *netdev, u32 sset, u8 *data) { -@@ -3901,6 +3925,8 @@ const struct ethtool_ops mvneta_eth_tool +@@ -3902,6 +3926,8 @@ const struct ethtool_ops mvneta_eth_tool .get_drvinfo = mvneta_ethtool_get_drvinfo, .get_ringparam = mvneta_ethtool_get_ringparam, .set_ringparam = mvneta_ethtool_set_ringparam, diff --git a/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch b/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch index 29d45f9216..f2d14afdac 100644 --- a/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch +++ b/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch @@ -12,7 +12,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3152,10 +3152,11 @@ static void mvneta_validate_support(stru +@@ -3153,10 +3153,11 @@ static void mvneta_validate_support(stru phylink_set(mask, 10baseT_Full); phylink_set(mask, 100baseT_Half); phylink_set(mask, 100baseT_Full); diff --git a/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch b/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch index 60f549cc8b..bac74ca4e7 100644 --- a/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch +++ b/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch @@ -11,7 +11,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3142,6 +3142,8 @@ static void mvneta_validate_support(stru +@@ -3143,6 +3143,8 @@ static void mvneta_validate_support(stru phylink_set(mask, BNC); phylink_set(mask, Backplane); @@ -20,7 +20,7 @@ Signed-off-by: Russell King /* Half-duplex at speeds higher than 100Mbit is unsupported */ phylink_set(mask, 1000baseT_Full); phylink_set(mask, 1000baseX_Full); -@@ -3154,9 +3156,6 @@ static void mvneta_validate_support(stru +@@ -3155,9 +3157,6 @@ static void mvneta_validate_support(stru phylink_set(mask, 100baseT_Full); } diff --git a/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch b/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch index 767830419c..bc7e5eeeb4 100644 --- a/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch +++ b/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch @@ -10,7 +10,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3304,7 +3304,8 @@ static void mvneta_mac_link_down(struct +@@ -3305,7 +3305,8 @@ static void mvneta_mac_link_down(struct } } diff --git a/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch b/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch index e1e11ee290..3a20a06bee 100644 --- a/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch +++ b/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch @@ -13,7 +13,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -243,6 +243,12 @@ +@@ -244,6 +244,12 @@ #define MVNETA_TXQ_TOKEN_SIZE_REG(q) (0x3e40 + ((q) << 2)) #define MVNETA_TXQ_TOKEN_SIZE_MAX 0x7fffffff @@ -26,7 +26,7 @@ Signed-off-by: Russell King #define MVNETA_CAUSE_TXQ_SENT_DESC_ALL_MASK 0xff /* Descriptor ring Macros */ -@@ -316,6 +322,11 @@ +@@ -317,6 +323,11 @@ #define MVNETA_RX_GET_BM_POOL_ID(rxd) \ (((rxd)->status & MVNETA_RXD_BM_POOL_MASK) >> MVNETA_RXD_BM_POOL_SHIFT) @@ -38,7 +38,7 @@ Signed-off-by: Russell King struct mvneta_statistic { unsigned short offset; unsigned short type; -@@ -324,6 +335,7 @@ struct mvneta_statistic { +@@ -325,6 +336,7 @@ struct mvneta_statistic { #define T_REG_32 32 #define T_REG_64 64 @@ -46,7 +46,7 @@ Signed-off-by: Russell King static const struct mvneta_statistic mvneta_statistics[] = { { 0x3000, T_REG_64, "good_octets_received", }, -@@ -358,6 +370,7 @@ static const struct mvneta_statistic mvn +@@ -359,6 +371,7 @@ static const struct mvneta_statistic mvn { 0x304c, T_REG_32, "broadcast_frames_sent", }, { 0x3054, T_REG_32, "fc_sent", }, { 0x300c, T_REG_32, "internal_mac_transmit_err", }, @@ -54,7 +54,7 @@ Signed-off-by: Russell King }; struct mvneta_pcpu_stats { -@@ -416,6 +429,10 @@ struct mvneta_port { +@@ -417,6 +430,10 @@ struct mvneta_port { struct mvneta_bm_pool *pool_short; int bm_win_id; @@ -65,7 +65,7 @@ Signed-off-by: Russell King u64 ethtool_stats[ARRAY_SIZE(mvneta_statistics)]; u32 indir[MVNETA_RSS_LU_TABLE_SIZE]; -@@ -3289,6 +3306,18 @@ static void mvneta_mac_config(struct net +@@ -3290,6 +3307,18 @@ static void mvneta_mac_config(struct net mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, new_an); } @@ -84,7 +84,7 @@ Signed-off-by: Russell King static void mvneta_mac_link_down(struct net_device *ndev, unsigned int mode) { struct mvneta_port *pp = netdev_priv(ndev); -@@ -3302,6 +3331,9 @@ static void mvneta_mac_link_down(struct +@@ -3303,6 +3332,9 @@ static void mvneta_mac_link_down(struct val |= MVNETA_GMAC_FORCE_LINK_DOWN; mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); } @@ -94,7 +94,7 @@ Signed-off-by: Russell King } static void mvneta_mac_link_up(struct net_device *ndev, unsigned int mode, -@@ -3318,6 +3350,11 @@ static void mvneta_mac_link_up(struct ne +@@ -3319,6 +3351,11 @@ static void mvneta_mac_link_up(struct ne } mvneta_port_up(pp); @@ -106,7 +106,7 @@ Signed-off-by: Russell King } static const struct phylink_mac_ops mvneta_phylink_ops = { -@@ -3770,6 +3807,13 @@ static void mvneta_ethtool_update_stats( +@@ -3771,6 +3808,13 @@ static void mvneta_ethtool_update_stats( high = readl_relaxed(base + s->offset + 4); val = (u64)high << 32 | low; break; @@ -120,7 +120,7 @@ Signed-off-by: Russell King } pp->ethtool_stats[i] += val; -@@ -3905,6 +3949,47 @@ static u16 mvneta_select_queue(struct ne +@@ -3906,6 +3950,47 @@ static u16 mvneta_select_queue(struct ne } @@ -168,7 +168,7 @@ Signed-off-by: Russell King static const struct net_device_ops mvneta_netdev_ops = { .ndo_open = mvneta_open, .ndo_stop = mvneta_stop, -@@ -3937,6 +4022,8 @@ const struct ethtool_ops mvneta_eth_tool +@@ -3938,6 +4023,8 @@ const struct ethtool_ops mvneta_eth_tool .set_rxfh = mvneta_ethtool_set_rxfh, .get_link_ksettings = mvneta_ethtool_get_link_ksettings, .set_link_ksettings = mvneta_ethtool_set_link_ksettings, diff --git a/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch b/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch index 1f35a18b9d..834bbe9a3e 100644 --- a/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch +++ b/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch @@ -7,7 +7,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3949,6 +3949,22 @@ static u16 mvneta_select_queue(struct ne +@@ -3950,6 +3950,22 @@ static u16 mvneta_select_queue(struct ne } @@ -30,7 +30,7 @@ Signed-off-by: Russell King static int mvneta_ethtool_get_eee(struct net_device *dev, struct ethtool_eee *eee) { -@@ -4022,6 +4038,8 @@ const struct ethtool_ops mvneta_eth_tool +@@ -4023,6 +4039,8 @@ const struct ethtool_ops mvneta_eth_tool .set_rxfh = mvneta_ethtool_set_rxfh, .get_link_ksettings = mvneta_ethtool_get_link_ksettings, .set_link_ksettings = mvneta_ethtool_set_link_ksettings, diff --git a/target/linux/octeon/config-4.14 b/target/linux/octeon/config-4.14 new file mode 100644 index 0000000000..24cba2b80a --- /dev/null +++ b/target/linux/octeon/config-4.14 @@ -0,0 +1,321 @@ +CONFIG_64BIT=y +CONFIG_ARCH_BINFMT_ELF_STATE=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_DISCARD_MEMBLOCK=y +CONFIG_ARCH_DMA_ADDR_T_64BIT=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set +# CONFIG_ARCH_HAS_SG_CHAIN is not set +# CONFIG_ARCH_HAS_STRICT_KERNEL_RWX is not set +# CONFIG_ARCH_HAS_STRICT_MODULE_RWX is not set +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y +CONFIG_ARCH_MMAP_RND_BITS=12 +CONFIG_ARCH_MMAP_RND_BITS_MAX=18 +CONFIG_ARCH_MMAP_RND_BITS_MIN=12 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS=8 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 +# CONFIG_ARCH_OPTIONAL_KERNEL_RWX is not set +# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set +CONFIG_ARCH_PHYS_ADDR_T_64BIT=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARCH_USE_QUEUED_RWLOCKS=y +CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y +# CONFIG_ARCH_WANTS_THP_SWAP is not set +CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y +CONFIG_BINFMT_ELF32=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_SD=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BLK_SCSI_REQUEST=y +CONFIG_BLOCK_COMPAT=y +# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set +CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 +CONFIG_BUILTIN_DTB=y +CONFIG_CAVIUM_CN63XXP1=y +CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE=2 +CONFIG_CAVIUM_OCTEON_LOCK_L2=y +CONFIG_CAVIUM_OCTEON_LOCK_L2_EXCEPTION=y +CONFIG_CAVIUM_OCTEON_LOCK_L2_INTERRUPT=y +CONFIG_CAVIUM_OCTEON_LOCK_L2_LOW_LEVEL_INTERRUPT=y +CONFIG_CAVIUM_OCTEON_LOCK_L2_MEMCPY=y +CONFIG_CAVIUM_OCTEON_LOCK_L2_TLB=y +CONFIG_CAVIUM_OCTEON_SOC=y +CONFIG_CEVT_R4K=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_COMPAT=y +CONFIG_COMPAT_BRK=y +CONFIG_COMPAT_NETLINK_MESSAGES=y +CONFIG_CPU_BIG_ENDIAN=y +CONFIG_CPU_CAVIUM_OCTEON=y +CONFIG_CPU_GENERIC_DUMP_TLB=y +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_CPU_HAS_RIXI=y +CONFIG_CPU_HAS_SYNC=y +# CONFIG_CPU_LITTLE_ENDIAN is not set +CONFIG_CPU_MIPSR2=y +CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y +CONFIG_CPU_R4K_FPU=y +CONFIG_CPU_RMAP=y +CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_CPU_SUPPORTS_HUGEPAGES=y +CONFIG_CRAMFS=y +CONFIG_CRASH_CORE=y +CONFIG_CRC16=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_CRC32=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +# CONFIG_CRYPTO_MD5_OCTEON is not set +CONFIG_CRYPTO_NULL2=y +CONFIG_CRYPTO_RNG2=y +# CONFIG_CRYPTO_SHA1_OCTEON is not set +# CONFIG_CRYPTO_SHA256_OCTEON is not set +# CONFIG_CRYPTO_SHA512_OCTEON is not set +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_SPINLOCK=y +CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 +CONFIG_DETECT_HUNG_TASK=y +CONFIG_DMA_COHERENT=y +# CONFIG_DMA_NOOP_OPS is not set +# CONFIG_DMA_VIRT_OPS is not set +CONFIG_DNOTIFY=y +# CONFIG_DRM_LIB_RANDOM is not set +CONFIG_DTC=y +CONFIG_EARLY_PRINTK=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_ENABLE_MUST_CHECK=y +CONFIG_EXPORTFS=y +CONFIG_EXT4_FS=y +# CONFIG_F2FS_CHECK_FS is not set +CONFIG_F2FS_FS=y +# CONFIG_F2FS_FS_SECURITY is not set +CONFIG_F2FS_FS_XATTR=y +CONFIG_F2FS_STAT_FS=y +CONFIG_FAT_FS=y +CONFIG_FIXED_PHY=y +CONFIG_FRAME_WARN=2048 +CONFIG_FS_MBCACHE=y +CONFIG_FUTEX_PI=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GPIOLIB=y +CONFIG_GPIO_OCTEON=y +CONFIG_GPIO_SYSFS=y +# CONFIG_GRO_CELLS is not set +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDWARE_WATCHPOINTS=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HAVE_64BIT_ALIGNED_ACCESS=y +# CONFIG_HAVE_ARCH_BITREVERSE is not set +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_CC_STACKPROTECTOR=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_COPY_THREAD_TLS=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DEBUG_STACKOVERFLOW=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_EBPF_JIT=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_KVM=y +CONFIG_HAVE_LATENCYTOP_SUPPORT=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MEMBLOCK_NODE_MAP=y +CONFIG_HAVE_MEMORY_PRESENT=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HOLES_IN_ZONE=y +# CONFIG_HUGETLBFS is not set +CONFIG_HW_HAS_PCI=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_OCTEON=y +CONFIG_HZ=250 +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +CONFIG_HZ_PERIODIC=y +CONFIG_IMAGE_CMDLINE_HACK=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IOMMU_HELPER=y +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +CONFIG_JBD2=y +CONFIG_KALLSYMS=y +CONFIG_KEXEC=y +CONFIG_KEXEC_CORE=y +CONFIG_LIBFDT=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_CAVIUM=y +CONFIG_MDIO_DEVICE=y +CONFIG_MDIO_OCTEON=y +CONFIG_MIPS=y +CONFIG_MIPS32_COMPAT=y +CONFIG_MIPS32_N32=y +CONFIG_MIPS32_O32=y +CONFIG_MIPS_ASID_BITS=8 +CONFIG_MIPS_ASID_SHIFT=0 +# CONFIG_MIPS_CLOCK_VSYSCALL is not set +# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set +CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y +# CONFIG_MIPS_CMDLINE_FROM_DTB is not set +# CONFIG_MIPS_ELF_APPENDED_DTB is not set +# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set +CONFIG_MIPS_L1_CACHE_SHIFT=7 +CONFIG_MIPS_L1_CACHE_SHIFT_7=y +# CONFIG_MIPS_MACHINE is not set +# CONFIG_MIPS_NO_APPENDED_DTB is not set +CONFIG_MIPS_PGD_C0_CONTEXT=y +CONFIG_MIPS_RAW_APPENDED_DTB=y +CONFIG_MIPS_SPRAM=y +# CONFIG_MIPS_VA_BITS_48 is not set +CONFIG_MMC=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_CAVIUM_OCTEON=y +CONFIG_MMC_OCTEON=y +# CONFIG_MMC_TIFM_SD is not set +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MODULES_USE_ELF_RELA=y +# CONFIG_MTD_CFI_INTELEXT is not set +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_PHYSMAP=y +CONFIG_NEED_SG_DMA_LENGTH=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NLS=y +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +# CONFIG_NO_IOPORT_MAP is not set +CONFIG_NR_CPUS=16 +CONFIG_NR_CPUS_DEFAULT_16=y +CONFIG_OCTEON_ETHERNET=y +# CONFIG_OCTEON_ILM is not set +CONFIG_OCTEON_MGMT_ETHERNET=y +CONFIG_OCTEON_USB=y +CONFIG_OCTEON_WDT=y +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_ADDRESS_PCI=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_MDIO=y +CONFIG_OF_NET=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_PADATA=y +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_PCI=y +CONFIG_PCI_BUS_ADDR_T_64BIT=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DRIVERS_LEGACY=y +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=3 +CONFIG_PHYLIB=y +CONFIG_PHYS_ADDR_T_64BIT=y +CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MQUEUE_SYSCTL=y +CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 +CONFIG_QUEUED_RWLOCKS=y +CONFIG_QUEUED_SPINLOCKS=y +CONFIG_RCU_NEED_SEGCBLIST=y +CONFIG_RCU_STALL_COMMON=y +CONFIG_RELAY=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +CONFIG_SCHED_DEBUG=y +# CONFIG_SCHED_INFO is not set +CONFIG_SCSI=y +CONFIG_SECCOMP=y +CONFIG_SECCOMP_FILTER=y +CONFIG_SERIAL_8250_DW=y +# CONFIG_SERIAL_8250_FSL is not set +CONFIG_SG_POOL=y +CONFIG_SMP=y +CONFIG_SPARSEMEM=y +CONFIG_SPARSEMEM_STATIC=y +CONFIG_SRCU=y +CONFIG_SWIOTLB=y +CONFIG_SWPHY=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +CONFIG_SYSFS_DEPRECATED=y +CONFIG_SYSFS_DEPRECATED_V2=y +CONFIG_SYSVIPC_COMPAT=y +CONFIG_SYS_HAS_CPU_CAVIUM_OCTEON=y +CONFIG_SYS_HAS_EARLY_PRINTK=y +CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y +CONFIG_SYS_SUPPORTS_HOTPLUG_CPU=y +CONFIG_SYS_SUPPORTS_HUGETLBFS=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y +CONFIG_SYS_SUPPORTS_RELOCATABLE=y +CONFIG_SYS_SUPPORTS_SMP=y +CONFIG_THIN_ARCHIVES=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TREE_RCU=y +CONFIG_TREE_SRCU=y +CONFIG_UNINLINE_SPIN_UNLOCK=y +CONFIG_USB=y +CONFIG_USB_COMMON=y +CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_HCD_PLATFORM=y +CONFIG_USB_OCTEON_EHCI=y +CONFIG_USB_OCTEON_OHCI=y +CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y +CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_HCD_PLATFORM=y +CONFIG_USB_STORAGE=y +CONFIG_USB_SUPPORT=y +CONFIG_USE_OF=y +CONFIG_VFAT_FS=y +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_WATCHDOG_CORE=y +CONFIG_WEAK_ORDERING=y +CONFIG_XPS=y +CONFIG_ZLIB_INFLATE=y +CONFIG_ZONE_DMA32=y diff --git a/target/linux/octeon/config-4.9 b/target/linux/octeon/config-4.9 index 2802446692..5599b2407e 100644 --- a/target/linux/octeon/config-4.9 +++ b/target/linux/octeon/config-4.9 @@ -233,7 +233,6 @@ CONFIG_PHYLIB=y CONFIG_PHYS_ADDR_T_64BIT=y CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE_SYSCTL=y -CONFIG_PROC_PAGE_MONITOR=y CONFIG_RCU_STALL_COMMON=y CONFIG_RELAY=y CONFIG_RFS_ACCEL=y diff --git a/target/linux/octeon/patches-4.14/100-ubnt_edgerouter2_support.patch b/target/linux/octeon/patches-4.14/100-ubnt_edgerouter2_support.patch new file mode 100644 index 0000000000..991eb56ce2 --- /dev/null +++ b/target/linux/octeon/patches-4.14/100-ubnt_edgerouter2_support.patch @@ -0,0 +1,31 @@ +--- a/arch/mips/include/asm/octeon/cvmx-bootinfo.h ++++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h +@@ -295,6 +295,8 @@ enum cvmx_board_types_enum { + */ + CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001, + CVMX_BOARD_TYPE_UBNT_E100 = 20002, ++ CVMX_BOARD_TYPE_UBNT_E200 = 20003, ++ CVMX_BOARD_TYPE_UBNT_E220 = 20005, + CVMX_BOARD_TYPE_CUST_DSR1000N = 20006, + CVMX_BOARD_TYPE_KONTRON_S1901 = 21901, + CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000, +@@ -396,6 +398,8 @@ static inline const char *cvmx_board_typ + /* Customer private range */ + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E100) ++ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E200) ++ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E220) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DSR1000N) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_KONTRON_S1901) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX) +--- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c ++++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c +@@ -173,6 +173,8 @@ int cvmx_helper_board_get_mii_address(in + return 7 - ipd_port; + else + return -1; ++ case CVMX_BOARD_TYPE_UBNT_E200: ++ return -1; + case CVMX_BOARD_TYPE_KONTRON_S1901: + if (ipd_port == CVMX_HELPER_BOARD_MGMT_IPD_PORT) + return 1; diff --git a/target/linux/octeon/patches-4.14/110-er200-ethernet_probe_order.patch b/target/linux/octeon/patches-4.14/110-er200-ethernet_probe_order.patch new file mode 100644 index 0000000000..6b1eaf92a2 --- /dev/null +++ b/target/linux/octeon/patches-4.14/110-er200-ethernet_probe_order.patch @@ -0,0 +1,34 @@ +--- a/drivers/staging/octeon/ethernet.c ++++ b/drivers/staging/octeon/ethernet.c +@@ -673,6 +673,7 @@ static int cvm_oct_probe(struct platform + int interface; + int fau = FAU_NUM_PACKET_BUFFERS_TO_FREE; + int qos; ++ int i; + struct device_node *pip; + int mtu_overhead = ETH_HLEN + ETH_FCS_LEN; + +@@ -796,13 +797,19 @@ static int cvm_oct_probe(struct platform + } + + num_interfaces = cvmx_helper_get_number_of_interfaces(); +- for (interface = 0; interface < num_interfaces; interface++) { +- cvmx_helper_interface_mode_t imode = +- cvmx_helper_interface_get_mode(interface); +- int num_ports = cvmx_helper_ports_on_interface(interface); ++ for (i = 0; i < num_interfaces; i++) { ++ cvmx_helper_interface_mode_t imode; ++ int interface; ++ int num_ports; + int port; + int port_index; + ++ interface = i; ++ if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_UBNT_E200) ++ interface = num_interfaces - (i + 1); ++ ++ num_ports = cvmx_helper_ports_on_interface(interface); ++ imode = cvmx_helper_interface_get_mode(interface); + for (port_index = 0, + port = cvmx_helper_get_ipd_port(interface, 0); + port < cvmx_helper_get_ipd_port(interface, num_ports); diff --git a/target/linux/octeon/patches-4.14/160-cmdline-hack.patch b/target/linux/octeon/patches-4.14/160-cmdline-hack.patch new file mode 100644 index 0000000000..e902e853e8 --- /dev/null +++ b/target/linux/octeon/patches-4.14/160-cmdline-hack.patch @@ -0,0 +1,47 @@ +--- a/arch/mips/cavium-octeon/setup.c ++++ b/arch/mips/cavium-octeon/setup.c +@@ -650,6 +650,35 @@ void octeon_user_io_init(void) + write_c0_derraddr1(0); + } + ++#ifdef CONFIG_IMAGE_CMDLINE_HACK ++extern char __image_cmdline[]; ++ ++static int __init octeon_use_image_cmdline(void) ++{ ++ char *p = __image_cmdline; ++ int replace = 0; ++ ++ if (*p == '-') { ++ replace = 1; ++ p++; ++ } ++ ++ if (*p == '\0') ++ return 0; ++ ++ if (replace) { ++ strlcpy(arcs_cmdline, p, sizeof(arcs_cmdline)); ++ } else { ++ strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline)); ++ strlcat(arcs_cmdline, p, sizeof(arcs_cmdline)); ++ } ++ ++ return 1; ++} ++#else ++static inline int octeon_use_image_cmdline(void) { return 0; } ++#endif ++ + /** + * Early entry point for arch setup + */ +@@ -894,6 +923,8 @@ void __init prom_init(void) + } + } + ++ octeon_use_image_cmdline(); ++ + if (strstr(arcs_cmdline, "console=") == NULL) { + if (octeon_uart == 1) + strcat(arcs_cmdline, " console=ttyS1,115200"); diff --git a/target/linux/octeon/patches-4.14/170-cisco-hack.patch b/target/linux/octeon/patches-4.14/170-cisco-hack.patch new file mode 100644 index 0000000000..72774209dc --- /dev/null +++ b/target/linux/octeon/patches-4.14/170-cisco-hack.patch @@ -0,0 +1,31 @@ +From patchwork Wed Jun 8 13:49:26 2016 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 8bit +Subject: [LEDE-DEV] cavium: Ignore MEM boot param when too small +From: =?utf-8?q?Micha=C5=82_Osowiecki?= +X-Patchwork-Id: 632273 +Message-Id: <57582266.8020105@gmail.com> +To: lede-dev@lists.infradead.org +Date: Wed, 8 Jun 2016 15:49:26 +0200 + +Cisco RV0XX u-boot sets MEM=2048 as boot param. We assume that at least +4MB (mem_alloc_size) of ram is needed to run linux on cavium boards, so +if mem < 4M - ignore it and set default value + + +Signed-off-by: Michał Osowiecki + +--- a/arch/mips/cavium-octeon/setup.c ++++ b/arch/mips/cavium-octeon/setup.c +@@ -1018,6 +1018,10 @@ void __init plat_mem_setup(void) + if (mem_alloc_size > max_memory) + mem_alloc_size = max_memory; + ++ /* Ignore bootarg MEM <= 4MB - cisco uses a b0rked uboot env on their products */ ++ if (max_memory <= mem_alloc_size) ++ max_memory = 512ull << 20; ++ + /* Crashkernel ignores bootmem list. It relies on mem=X@Y option */ + #ifdef CONFIG_CRASH_DUMP + add_memory_region(reserve_low_mem, max_memory, BOOT_MEM_RAM); diff --git a/target/linux/omap/Makefile b/target/linux/omap/Makefile index 34dc9a4b5e..d8c0fd88e9 100644 --- a/target/linux/omap/Makefile +++ b/target/linux/omap/Makefile @@ -14,7 +14,7 @@ FEATURES:=usb usbgadget ext4 targz fpu audio display nand ubifs CPU_TYPE:=cortex-a8 CPU_SUBTYPE:=vfpv3 -KERNEL_PATCHVER:=4.4 +KERNEL_PATCHVER:=4.9 MAINTAINER:=Alexander Couzens diff --git a/target/linux/omap/config-4.9 b/target/linux/omap/config-4.9 new file mode 100644 index 0000000000..d6f0649093 --- /dev/null +++ b/target/linux/omap/config-4.9 @@ -0,0 +1,730 @@ +CONFIG_ALIGNMENT_TRAP=y +CONFIG_AM335X_CONTROL_USB=y +CONFIG_AM335X_PHY_USB=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_HAS_BANDGAP=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +CONFIG_ARCH_HAS_HOLES_MEMORYMODEL=y +CONFIG_ARCH_HAS_SG_CHAIN=y +CONFIG_ARCH_HAS_TICK_BROADCAST=y +CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MULTIPLATFORM=y +# CONFIG_ARCH_MULTI_CPU_AUTO is not set +CONFIG_ARCH_MULTI_V6_V7=y +CONFIG_ARCH_MULTI_V7=y +CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED=y +CONFIG_ARCH_NR_GPIO=0 +CONFIG_ARCH_OMAP=y +CONFIG_ARCH_OMAP2PLUS=y +CONFIG_ARCH_OMAP2PLUS_TYPICAL=y +CONFIG_ARCH_OMAP3=y +CONFIG_ARCH_OMAP4=y +# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set +# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARCH_WANT_GENERAL_HUGETLB=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ARM=y +CONFIG_ARM_APPENDED_DTB=y +CONFIG_ARM_ATAG_DTB_COMPAT=y +# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set +CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y +CONFIG_ARM_CPU_SUSPEND=y +CONFIG_ARM_ERRATA_430973=y +CONFIG_ARM_ERRATA_720789=y +CONFIG_ARM_ERRATA_754322=y +CONFIG_ARM_ERRATA_775420=y +CONFIG_ARM_GIC=y +CONFIG_ARM_HAS_SG_CHAIN=y +CONFIG_ARM_HEAVY_MB=y +CONFIG_ARM_L1_CACHE_SHIFT=6 +CONFIG_ARM_L1_CACHE_SHIFT_6=y +# CONFIG_ARM_LPAE is not set +CONFIG_ARM_OMAP2PLUS_CPUFREQ=y +CONFIG_ARM_PATCH_IDIV=y +CONFIG_ARM_PATCH_PHYS_VIRT=y +CONFIG_ARM_THUMB=y +CONFIG_ARM_THUMBEE=y +CONFIG_ARM_VIRT_EXT=y +CONFIG_ASSOCIATIVE_ARRAY=y +CONFIG_AT803X_PHY=y +CONFIG_ATA=y +CONFIG_AUDIT=y +CONFIG_AUDITSYSCALL=y +CONFIG_AUDIT_GENERIC=y +CONFIG_AUDIT_TREE=y +CONFIG_AUDIT_WATCH=y +CONFIG_AUTO_ZRELADDR=y +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_LCD_SUPPORT=y +# CONFIG_BACKLIGHT_PWM is not set +# CONFIG_BACKLIGHT_TPS65217 is not set +CONFIG_BCH=y +CONFIG_BINFMT_MISC=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=16384 +CONFIG_BLK_DEV_SD=y +CONFIG_BOUNCE=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BUILD_BIN2C=y +CONFIG_CACHE_L2X0=y +# CONFIG_CHARGER_TPS65217 is not set +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLKSRC_MMIO=y +CONFIG_CLKSRC_OF=y +CONFIG_CLKSRC_PROBE=y +CONFIG_CLKSRC_TI_32K=y +CONFIG_CLK_TWL6040=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_CMA=y +CONFIG_CMA_ALIGNMENT=8 +CONFIG_CMA_AREAS=7 +# CONFIG_CMA_DEBUG is not set +# CONFIG_CMA_DEBUGFS is not set +CONFIG_CMA_SIZE_MBYTES=16 +# CONFIG_CMA_SIZE_SEL_MAX is not set +CONFIG_CMA_SIZE_SEL_MBYTES=y +# CONFIG_CMA_SIZE_SEL_MIN is not set +# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set +CONFIG_CMDLINE="root=/dev/mmcblk0p2 rootwait console=ttyO2,115200" +CONFIG_COMMON_CLK=y +# CONFIG_COMMON_CLK_PALMAS is not set +# CONFIG_COMMON_CLK_TI_ADPLL is not set +CONFIG_CONFIGFS_FS=y +CONFIG_CONNECTOR=y +CONFIG_CPUFREQ_DT=y +CONFIG_CPUFREQ_DT_PLATDEV=y +CONFIG_CPU_32v6K=y +CONFIG_CPU_32v7=y +CONFIG_CPU_ABRT_EV7=y +# CONFIG_CPU_BPREDICT_DISABLE is not set +CONFIG_CPU_CACHE_V7=y +CONFIG_CPU_CACHE_VIPT=y +CONFIG_CPU_COPY_V6=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set +CONFIG_CPU_FREQ_GOV_ATTR_SET=y +CONFIG_CPU_FREQ_GOV_COMMON=y +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=y +CONFIG_CPU_FREQ_GOV_USERSPACE=y +CONFIG_CPU_FREQ_STAT=y +CONFIG_CPU_FREQ_STAT_DETAILS=y +CONFIG_CPU_HAS_ASID=y +# CONFIG_CPU_ICACHE_DISABLE is not set +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_IDLE_GOV_MENU=y +CONFIG_CPU_PABRT_V7=y +CONFIG_CPU_PM=y +CONFIG_CPU_RMAP=y +CONFIG_CPU_THERMAL=y +CONFIG_CPU_TLB_V7=y +CONFIG_CPU_V7=y +CONFIG_CRAMFS=y +CONFIG_CRC16=y +CONFIG_CRC7=y +CONFIG_CRC_CCITT=y +CONFIG_CRC_ITU_T=y +CONFIG_CRC_T10DIF=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_CBC=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_CRCT10DIF=y +CONFIG_CRYPTO_CTR=y +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_DES=y +CONFIG_CRYPTO_DEV_OMAP_AES=y +CONFIG_CRYPTO_DEV_OMAP_DES=y +CONFIG_CRYPTO_DEV_OMAP_SHAM=y +CONFIG_CRYPTO_DRBG=y +CONFIG_CRYPTO_DRBG_HMAC=y +CONFIG_CRYPTO_DRBG_MENU=y +CONFIG_CRYPTO_ECB=y +CONFIG_CRYPTO_ENGINE=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_JITTERENTROPY=y +CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_NULL=y +CONFIG_CRYPTO_NULL2=y +CONFIG_CRYPTO_RNG=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_RNG_DEFAULT=y +CONFIG_CRYPTO_SEQIV=y +CONFIG_CRYPTO_SHA1=y +CONFIG_CRYPTO_SHA256=y +CONFIG_CRYPTO_SHA512=y +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_DCACHE_WORD_ACCESS=y +CONFIG_DDR=y +CONFIG_DEBUG_GPIO=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" +CONFIG_DEBUG_LOCK_ALLOC=y +CONFIG_DEBUG_MUTEXES=y +CONFIG_DEBUG_SPINLOCK=y +# CONFIG_DEBUG_UART_8250 is not set +# CONFIG_DEBUG_USER is not set +CONFIG_DM9000=y +# CONFIG_DM9000_FORCE_SIMPLE_PHY_POLL is not set +CONFIG_DMADEVICES=y +CONFIG_DMA_CMA=y +CONFIG_DMA_ENGINE=y +CONFIG_DMA_OF=y +CONFIG_DMA_OMAP=y +CONFIG_DMA_SHARED_BUFFER=y +CONFIG_DMA_VIRTUAL_CHANNELS=y +CONFIG_DNS_RESOLVER=y +CONFIG_DRM=y +CONFIG_DRM_BRIDGE=y +CONFIG_DRM_KMS_HELPER=y +CONFIG_DRM_OMAP=y +CONFIG_DRM_OMAP_CONNECTOR_ANALOG_TV=y +CONFIG_DRM_OMAP_CONNECTOR_DVI=y +CONFIG_DRM_OMAP_CONNECTOR_HDMI=y +# CONFIG_DRM_OMAP_ENCODER_OPA362 is not set +CONFIG_DRM_OMAP_ENCODER_TFP410=y +CONFIG_DRM_OMAP_ENCODER_TPD12S015=y +CONFIG_DRM_OMAP_NUM_CRTCS=1 +CONFIG_DRM_OMAP_PANEL_DPI=y +CONFIG_DRM_OMAP_PANEL_DSI_CM=y +CONFIG_DRM_OMAP_PANEL_LGPHILIPS_LB035Q02=y +CONFIG_DRM_OMAP_PANEL_NEC_NL8048HL11=y +CONFIG_DRM_OMAP_PANEL_SHARP_LS037V7DW01=y +CONFIG_DRM_OMAP_PANEL_SONY_ACX565AKM=y +CONFIG_DRM_OMAP_PANEL_TPO_TD028TTEC1=y +CONFIG_DRM_OMAP_PANEL_TPO_TD043MTEA1=y +CONFIG_DTC=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EEPROM_93CX6=y +CONFIG_EXPORTFS=y +CONFIG_EXT2_FS=y +CONFIG_EXT3_FS=y +# CONFIG_EXT3_FS_POSIX_ACL is not set +# CONFIG_EXT3_FS_SECURITY is not set +CONFIG_EXT4_FS=y +CONFIG_EXTCON=y +CONFIG_EXTCON_PALMAS=y +CONFIG_EXTCON_USB_GPIO=y +CONFIG_FANOTIFY=y +CONFIG_FAT_FS=y +CONFIG_FB_CMDLINE=y +CONFIG_FHANDLE=y +CONFIG_FIXED_PHY=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FRAME_POINTER=y +CONFIG_FS_MBCACHE=y +CONFIG_FS_POSIX_ACL=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_PHY=y +CONFIG_GENERIC_PINCONF=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GLOB=y +CONFIG_GPIOLIB=y +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_OMAP=y +CONFIG_GPIO_PALMAS=y +CONFIG_GPIO_PCA953X=y +CONFIG_GPIO_PCA953X_IRQ=y +CONFIG_GPIO_PCF857X=y +CONFIG_GPIO_SYSFS=y +# CONFIG_GPIO_TPS65218 is not set +CONFIG_GPIO_TPS65910=y +CONFIG_GPIO_TWL4030=y +CONFIG_GPIO_TWL6040=y +CONFIG_GRACE_PERIOD=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set +CONFIG_HAVE_ARCH_AUDITSYSCALL=y +CONFIG_HAVE_ARCH_BITREVERSE=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_PFN_VALID=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +CONFIG_HAVE_ARM_SCU=y +CONFIG_HAVE_ARM_SMCCC=y +CONFIG_HAVE_ARM_TWD=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_CBPF_JIT=y +CONFIG_HAVE_CC_STACKPROTECTOR=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_OPTPROBES=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_PROC_CPU=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_SMP=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_UID16=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HDMI=y +CONFIG_HIGHMEM=y +CONFIG_HIGHPTE=y +CONFIG_HSI=y +CONFIG_HSI_BOARDINFO=y +# CONFIG_HSI_CHAR is not set +CONFIG_HWMON=y +CONFIG_HZ_FIXED=0 +CONFIG_I2C=y +CONFIG_I2C_ALGOBIT=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_OMAP=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IOMMU_HELPER=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_BOOTP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_RARP=y +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +CONFIG_JBD2=y +CONFIG_JFFS2_LZO=y +CONFIG_JFFS2_RUBIN=y +CONFIG_KALLSYMS=y +CONFIG_KALLSYMS_ALL=y +CONFIG_KEYS=y +CONFIG_KPROBES=y +CONFIG_KRETPROBES=y +CONFIG_KS8851=y +CONFIG_KS8851_MLL=y +CONFIG_LCD_CLASS_DEVICE=y +CONFIG_LCD_PLATFORM=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_PWM=y +CONFIG_LEDS_TRIGGER_BACKLIGHT=y +CONFIG_LEDS_TRIGGER_CPU=y +CONFIG_LEDS_TRIGGER_GPIO=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=y +CONFIG_LEDS_TRIGGER_ONESHOT=y +CONFIG_LIBCRC32C=y +CONFIG_LIBFDT=y +CONFIG_LOCKD=y +CONFIG_LOCKDEP=y +CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +# CONFIG_MACH_OMAP3517EVM is not set +# CONFIG_MACH_OMAP3_PANDORA is not set +CONFIG_MACH_OMAP_GENERIC=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_MDIO_BOARDINFO=y +CONFIG_MEMORY=y +CONFIG_MEMORY_ISOLATION=y +CONFIG_MFD_CORE=y +CONFIG_MFD_PALMAS=y +CONFIG_MFD_SYSCON=y +CONFIG_MFD_TI_AM335X_TSCADC=y +CONFIG_MFD_TPS65217=y +CONFIG_MFD_TPS65218=y +CONFIG_MFD_TPS65910=y +CONFIG_MFD_TWL4030_AUDIO=y +CONFIG_MIGHT_HAVE_CACHE_L2X0=y +CONFIG_MIGHT_HAVE_PCI=y +CONFIG_MIGRATION=y +CONFIG_MMC=y +CONFIG_MMC_BLOCK=y +# CONFIG_MMC_OMAP is not set +CONFIG_MMC_OMAP_HS=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MSDOS_FS=y +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_M25P80=y +CONFIG_MTD_NAND=y +CONFIG_MTD_NAND_BCH=y +CONFIG_MTD_NAND_ECC=y +CONFIG_MTD_NAND_ECC_BCH=y +CONFIG_MTD_NAND_OMAP2=y +CONFIG_MTD_NAND_OMAP_BCH=y +CONFIG_MTD_NAND_OMAP_BCH_BUILD=y +CONFIG_MTD_ONENAND=y +# CONFIG_MTD_ONENAND_2X_PROGRAM is not set +# CONFIG_MTD_ONENAND_GENERIC is not set +CONFIG_MTD_ONENAND_OMAP2=y +# CONFIG_MTD_ONENAND_OTP is not set +CONFIG_MTD_ONENAND_VERIFY_WRITE=y +CONFIG_MTD_OOPS=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_BEB_LIMIT=20 +# CONFIG_MTD_UBI_BLOCK is not set +# CONFIG_MTD_UBI_FASTMAP is not set +# CONFIG_MTD_UBI_GLUEBI is not set +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MULTI_IRQ_HANDLER=y +# CONFIG_MUSB_PIO_ONLY is not set +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEON=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_KEY=y +CONFIG_NET_KEY_MIGRATE=y +CONFIG_NET_PTP_CLASSIFY=y +CONFIG_NFS_ACL_SUPPORT=y +CONFIG_NFS_FS=y +CONFIG_NFS_USE_KERNEL_DNS=y +# CONFIG_NFS_USE_LEGACY_DNS is not set +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_NLS=y +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NOP_USB_XCEIV=y +CONFIG_NO_BOOTMEM=y +CONFIG_NO_HZ=y +CONFIG_NO_HZ_COMMON=y +CONFIG_NO_HZ_IDLE=y +CONFIG_NR_CPUS=4 +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_MDIO=y +CONFIG_OF_NET=y +CONFIG_OF_RESERVED_MEM=y +CONFIG_OID_REGISTRY=y +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_OMAP2_DSS=y +CONFIG_OMAP2_DSS_DPI=y +CONFIG_OMAP2_DSS_DSI=y +CONFIG_OMAP2_DSS_HDMI_COMMON=y +CONFIG_OMAP2_DSS_INIT=y +CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0 +CONFIG_OMAP2_DSS_SDI=y +CONFIG_OMAP2_DSS_SLEEP_AFTER_VENC_RESET=y +CONFIG_OMAP2_DSS_VENC=y +# CONFIG_OMAP3_L2_AUX_SECURE_SAVE_RESTORE is not set +# CONFIG_OMAP3_SDRC_AC_TIMING is not set +CONFIG_OMAP3_THERMAL=y +CONFIG_OMAP4_DSS_HDMI=y +CONFIG_OMAP4_THERMAL=y +CONFIG_OMAP5_DSS_HDMI=y +CONFIG_OMAP_32K_TIMER=y +CONFIG_OMAP_CONTROL_PHY=y +CONFIG_OMAP_DM_TIMER=y +CONFIG_OMAP_GPMC=y +# CONFIG_OMAP_GPMC_DEBUG is not set +CONFIG_OMAP_INTERCONNECT=y +CONFIG_OMAP_INTERCONNECT_BARRIER=y +CONFIG_OMAP_IRQCHIP=y +CONFIG_OMAP_MUX=y +CONFIG_OMAP_MUX_DEBUG=y +CONFIG_OMAP_MUX_WARNINGS=y +CONFIG_OMAP_OCP2SCP=y +CONFIG_OMAP_PM_NOOP=y +CONFIG_OMAP_RESET_CLOCKS=y +# CONFIG_OMAP_SSI is not set +CONFIG_OMAP_USB2=y +CONFIG_OMAP_WATCHDOG=y +CONFIG_OPROFILE=y +CONFIG_OPTPROBES=y +CONFIG_OUTER_CACHE=y +CONFIG_OUTER_CACHE_SYNC=y +CONFIG_PADATA=y +CONFIG_PAGE_OFFSET=0xC0000000 +# CONFIG_PCI_DOMAINS_GENERIC is not set +# CONFIG_PCI_SYSCALL is not set +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +# CONFIG_PHY_DM816X_USB is not set +CONFIG_PINCTRL=y +# CONFIG_PINCTRL_PALMAS is not set +CONFIG_PL310_ERRATA_588369=y +CONFIG_PL310_ERRATA_727915=y +# CONFIG_PL310_ERRATA_753970 is not set +# CONFIG_PL310_ERRATA_769419 is not set +CONFIG_PM=y +# CONFIG_PM_ADVANCED_DEBUG is not set +CONFIG_PM_CLK=y +CONFIG_PM_DEBUG=y +CONFIG_PM_OPP=y +CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MQUEUE_SYSCTL=y +CONFIG_POWER_AVS=y +CONFIG_POWER_AVS_OMAP=y +CONFIG_POWER_AVS_OMAP_CLASS3=y +CONFIG_POWER_SUPPLY=y +CONFIG_PPS=y +CONFIG_PRINTK_TIME=y +CONFIG_PRINT_QUOTA_WARNING=y +CONFIG_PROC_EVENTS=y +CONFIG_PROFILING=y +CONFIG_PROVE_LOCKING=y +CONFIG_PROVE_RCU=y +CONFIG_PTP_1588_CLOCK=y +CONFIG_PWM=y +# CONFIG_PWM_OMAP_DMTIMER is not set +CONFIG_PWM_SYSFS=y +CONFIG_PWM_TIECAP=y +CONFIG_PWM_TIEHRPWM=y +CONFIG_PWM_TIPWMSS=y +# CONFIG_PWM_TWL is not set +# CONFIG_PWM_TWL_LED is not set +# CONFIG_QFMT_V1 is not set +CONFIG_QFMT_V2=y +CONFIG_QUOTA=y +CONFIG_QUOTACTL=y +# CONFIG_QUOTA_NETLINK_INTERFACE is not set +CONFIG_QUOTA_TREE=y +CONFIG_RATIONAL=y +CONFIG_RCU_STALL_COMMON=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_REGMAP_IRQ=y +CONFIG_REGMAP_MMIO=y +CONFIG_REGMAP_SPI=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_REGULATOR_PALMAS=y +CONFIG_REGULATOR_PBIAS=y +CONFIG_REGULATOR_TI_ABB=y +CONFIG_REGULATOR_TPS62360=y +CONFIG_REGULATOR_TPS65023=y +CONFIG_REGULATOR_TPS6507X=y +CONFIG_REGULATOR_TPS65217=y +CONFIG_REGULATOR_TPS65218=y +CONFIG_REGULATOR_TPS65910=y +CONFIG_REGULATOR_TWL4030=y +CONFIG_RFS_ACCEL=y +CONFIG_RING_BUFFER=y +CONFIG_RING_BUFFER_ALLOW_SWAP=y +CONFIG_ROOT_NFS=y +CONFIG_RPS=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_DS1307=y +CONFIG_RTC_DRV_OMAP=y +CONFIG_RTC_DRV_PALMAS=y +# CONFIG_RTC_DRV_TPS65910 is not set +CONFIG_RTC_DRV_TWL4030=y +CONFIG_RTC_I2C_AND_SPI=y +CONFIG_RTC_MC146818_LIB=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_SATA_AHCI_PLATFORM=y +CONFIG_SCHEDSTATS=y +CONFIG_SCHED_INFO=y +CONFIG_SCHED_MC=y +CONFIG_SCSI=y +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_SDIO_UART=y +CONFIG_SECCOMP=y +CONFIG_SECCOMP_FILTER=y +CONFIG_SENSORS_GPIO_FAN=y +CONFIG_SENSORS_LM75=y +CONFIG_SENSORS_TMP102=y +CONFIG_SENSORS_TSL2550=y +CONFIG_SERIAL_8250_DETECT_IRQ=y +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_FSL=y +CONFIG_SERIAL_8250_MANY_PORTS=y +CONFIG_SERIAL_8250_NR_UARTS=32 +# CONFIG_SERIAL_8250_OMAP is not set +CONFIG_SERIAL_8250_RSA=y +CONFIG_SERIAL_8250_SHARE_IRQ=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SERIAL_OMAP=y +CONFIG_SERIAL_OMAP_CONSOLE=y +CONFIG_SERIO=y +CONFIG_SG_POOL=y +CONFIG_SG_SPLIT=y +CONFIG_SMC91X=y +CONFIG_SMP=y +CONFIG_SMP_ON_UP=y +CONFIG_SMSC911X=y +# CONFIG_SMSC911X_ARCH_HOOKS is not set +CONFIG_SMSC_PHY=y +CONFIG_SND=y +# CONFIG_SND_COMPRESS_OFFLOAD is not set +CONFIG_SND_DAVINCI_SOC_MCASP=y +CONFIG_SND_DMAENGINE_PCM=y +CONFIG_SND_JACK=y +CONFIG_SND_MIXER_OSS=y +CONFIG_SND_OMAP_SOC=y +CONFIG_SND_OMAP_SOC_DMIC=y +# CONFIG_SND_OMAP_SOC_HDMI_AUDIO is not set +CONFIG_SND_OMAP_SOC_MCBSP=y +CONFIG_SND_OMAP_SOC_MCPDM=y +CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=y +CONFIG_SND_OMAP_SOC_OMAP_TWL4030=y +# CONFIG_SND_OMAP_SOC_RX51 is not set +CONFIG_SND_PCM=y +CONFIG_SND_PCM_OSS=y +CONFIG_SND_SIMPLE_CARD=y +CONFIG_SND_SIMPLE_CARD_UTILS=y +CONFIG_SND_SOC=y +CONFIG_SND_SOC_DMIC=y +CONFIG_SND_SOC_I2C_AND_SPI=y +CONFIG_SND_SOC_TLV320AIC3X=y +CONFIG_SND_SOC_TWL4030=y +CONFIG_SND_SOC_TWL6040=y +CONFIG_SND_VERBOSE_PRINTK=y +CONFIG_SOC_AM33XX=y +CONFIG_SOC_AM43XX=y +CONFIG_SOC_BUS=y +CONFIG_SOC_HAS_OMAP2_SDRC=y +CONFIG_SOC_OMAP3430=y +# CONFIG_SOC_TI81XX is not set +CONFIG_SOUND=y +CONFIG_SOUND_OSS_CORE=y +CONFIG_SOUND_OSS_CORE_PRECLAIM=y +CONFIG_SPARSE_IRQ=y +CONFIG_SPI=y +CONFIG_SPI_MASTER=y +CONFIG_SPI_OMAP24XX=y +CONFIG_SPI_TI_QSPI=y +CONFIG_SRAM=y +CONFIG_SRCU=y +CONFIG_STACKTRACE=y +CONFIG_SUNRPC=y +CONFIG_SUNRPC_GSS=y +CONFIG_SWIOTLB=y +CONFIG_SWPHY=y +CONFIG_SWP_EMULATE=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_THERMAL=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +CONFIG_THERMAL_GOV_FAIR_SHARE=y +CONFIG_THERMAL_GOV_STEP_WISE=y +CONFIG_THERMAL_GOV_USER_SPACE=y +CONFIG_THERMAL_OF=y +# CONFIG_THUMB2_KERNEL is not set +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TIMER_STATS=y +CONFIG_TI_CPPI41=y +CONFIG_TI_CPSW=y +CONFIG_TI_CPSW_ALE=y +CONFIG_TI_CPSW_PHY_SEL=y +CONFIG_TI_CPTS=y +CONFIG_TI_DAVINCI_CPDMA=y +CONFIG_TI_DAVINCI_EMAC=y +CONFIG_TI_DAVINCI_MDIO=y +CONFIG_TI_DMA_CROSSBAR=y +CONFIG_TI_EDMA=y +CONFIG_TI_EMIF=y +CONFIG_TI_PIPE3=y +CONFIG_TI_SOC_THERMAL=y +CONFIG_TI_THERMAL=y +CONFIG_TMPFS_POSIX_ACL=y +CONFIG_TRACE_CLOCK=y +CONFIG_TRACE_IRQFLAGS=y +CONFIG_TREE_RCU=y +CONFIG_TWL4030_CORE=y +CONFIG_TWL4030_POWER=y +CONFIG_TWL4030_USB=y +CONFIG_TWL4030_WATCHDOG=y +# CONFIG_TWL6030_USB is not set +CONFIG_TWL6040_CORE=y +CONFIG_UBIFS_FS=y +# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_ZLIB=y +CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" +CONFIG_UNINLINE_SPIN_UNLOCK=y +CONFIG_USB=y +CONFIG_USB_COMMON=y +CONFIG_USB_DWC3=y +CONFIG_USB_DWC3_DUAL_ROLE=y +# CONFIG_USB_DWC3_GADGET is not set +# CONFIG_USB_DWC3_HOST is not set +CONFIG_USB_DWC3_OMAP=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_HCD_OMAP=y +# CONFIG_USB_EHCI_HCD_PLATFORM is not set +CONFIG_USB_GADGET=y +CONFIG_USB_INVENTRA_DMA=y +CONFIG_USB_MUSB_AM335X_CHILD=y +CONFIG_USB_MUSB_AM35X=y +CONFIG_USB_MUSB_DSPS=y +CONFIG_USB_MUSB_DUAL_ROLE=y +# CONFIG_USB_MUSB_GADGET is not set +CONFIG_USB_MUSB_HDRC=y +# CONFIG_USB_MUSB_HOST is not set +CONFIG_USB_MUSB_OMAP2PLUS=y +CONFIG_USB_MUSB_TUSB6010=y +CONFIG_USB_PHY=y +CONFIG_USB_SUPPORT=y +CONFIG_USB_TI_CPPI41_DMA=y +CONFIG_USB_TUSB_OMAP_DMA=y +# CONFIG_USERIO is not set +CONFIG_USE_OF=y +CONFIG_VECTORS_BASE=0xffff0000 +CONFIG_VFAT_FS=y +CONFIG_VFP=y +CONFIG_VFPv3=y +CONFIG_VIDEOMODE_HELPERS=y +CONFIG_WATCHDOG_CORE=y +# CONFIG_WKUP_M3_RPROC is not set +CONFIG_XFRM_ALGO=y +CONFIG_XFRM_MIGRATE=y +CONFIG_XPS=y +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/omap/patches-4.9/001-omap4_pandaboard-wlan_fix.patch b/target/linux/omap/patches-4.9/001-omap4_pandaboard-wlan_fix.patch new file mode 100644 index 0000000000..5a6f76fd15 --- /dev/null +++ b/target/linux/omap/patches-4.9/001-omap4_pandaboard-wlan_fix.patch @@ -0,0 +1,10 @@ +--- a/arch/arm/mach-omap2/twl-common.c ++++ b/arch/arm/mach-omap2/twl-common.c +@@ -368,6 +368,7 @@ static struct regulator_init_data omap4_ + static struct regulator_init_data omap4_clk32kg_idata = { + .constraints = { + .valid_ops_mask = REGULATOR_CHANGE_STATUS, ++ .always_on = true, + }, + }; + diff --git a/target/linux/omap24xx/base-files/etc/config/wireless b/target/linux/omap24xx/base-files/etc/config/wireless index f61721e518..b640ce6c26 100644 --- a/target/linux/omap24xx/base-files/etc/config/wireless +++ b/target/linux/omap24xx/base-files/etc/config/wireless @@ -15,6 +15,6 @@ config wifi-iface option powersave 1 option network lan option mode sta - option ssid LEDE + option ssid OpenWrt # option encryption psk2 # option key "foobar" diff --git a/target/linux/orion/Makefile b/target/linux/orion/Makefile index 5a541001f4..07583e485f 100644 --- a/target/linux/orion/Makefile +++ b/target/linux/orion/Makefile @@ -13,7 +13,7 @@ FEATURES:=broken rtc SUBTARGETS:=generic harddisk MAINTAINER:=Imre Kaloz -KERNEL_PATCHVER:=4.4 +KERNEL_PATCHVER:=4.9 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/orion/config-4.9 b/target/linux/orion/config-4.9 new file mode 100644 index 0000000000..56ae5ee98a --- /dev/null +++ b/target/linux/orion/config-4.9 @@ -0,0 +1,246 @@ +CONFIG_ALIGNMENT_TRAP=y +CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +# CONFIG_ARCH_HAS_SG_CHAIN is not set +CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +# CONFIG_ARCH_MULTI_V4 is not set +# CONFIG_ARCH_MULTI_V4T is not set +CONFIG_ARCH_NR_GPIO=0 +CONFIG_ARCH_ORION5X=y +# CONFIG_ARCH_ORION5X_DT is not set +CONFIG_ARCH_REQUIRE_GPIOLIB=y +# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set +# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARCH_WANT_GENERAL_HUGETLB=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ARM=y +# CONFIG_ARM_CPU_SUSPEND is not set +CONFIG_ARM_L1_CACHE_SHIFT=5 +CONFIG_ARM_PATCH_PHYS_VIRT=y +# CONFIG_ARM_THUMB is not set +CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y +CONFIG_ATAGS=y +CONFIG_AUTO_ZRELADDR=y +# CONFIG_CACHE_L2X0 is not set +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLKSRC_MMIO=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE="rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200 earlyprintk" +CONFIG_CMDLINE_FORCE=y +CONFIG_COMMON_CLK=y +CONFIG_CPU_32v5=y +CONFIG_CPU_ABRT_EV5T=y +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_COPY_FEROCEON=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +CONFIG_CPU_FEROCEON=y +CONFIG_CPU_FEROCEON_OLD_ID=y +# CONFIG_CPU_ICACHE_DISABLE is not set +CONFIG_CPU_PABRT_LEGACY=y +CONFIG_CPU_TLB_FEROCEON=y +CONFIG_CPU_USE_DOMAINS=y +CONFIG_CRYPTO_DES=y +CONFIG_CRYPTO_DEV_MARVELL_CESA=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_DEBUG_LL=y +CONFIG_DEBUG_LL_INCLUDE="debug/8250.S" +CONFIG_DEBUG_LL_UART_8250=y +CONFIG_DEBUG_UART_8250=y +# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set +CONFIG_DEBUG_UART_8250_SHIFT=2 +# CONFIG_DEBUG_UART_8250_WORD is not set +CONFIG_DEBUG_UART_PHYS=0xf1012000 +CONFIG_DEBUG_UART_VIRT=0xfe012000 +# CONFIG_DEBUG_USER is not set +CONFIG_DMADEVICES=y +CONFIG_DMA_ENGINE=y +CONFIG_DMA_ENGINE_RAID=y +CONFIG_DMA_OF=y +CONFIG_DNOTIFY=y +CONFIG_DTC=y +CONFIG_EARLY_PRINTK=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_FIXED_PHY=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FRAME_POINTER=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GPIOLIB=y +CONFIG_GPIO_DEVRES=y +CONFIG_GPIO_MVEBU=y +CONFIG_GPIO_SYSFS=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set +CONFIG_HAVE_ARCH_AUDITSYSCALL=y +# CONFIG_HAVE_ARCH_BITREVERSE is not set +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_PFN_VALID=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_BPF_JIT=y +CONFIG_HAVE_CC_STACKPROTECTOR=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_ATTRS=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_LATENCYTOP_SUPPORT=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_OPTPROBES=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_PROC_CPU=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_UID16=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HZ_FIXED=0 +CONFIG_HZ_PERIODIC=y +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_MV64XXX=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IOMMU_HELPER=y +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +CONFIG_LEDS_GPIO=y +CONFIG_LIBFDT=y +# CONFIG_MACH_D2NET_DT is not set +# CONFIG_MACH_DB88F5281 is not set +# CONFIG_MACH_DNS323 is not set +# CONFIG_MACH_DT2 is not set +# CONFIG_MACH_KUROBOX_PRO is not set +# CONFIG_MACH_LINKSTATION_LSCHL is not set +# CONFIG_MACH_LINKSTATION_LS_HGL is not set +# CONFIG_MACH_LINKSTATION_MINI is not set +# CONFIG_MACH_LINKSTATION_PRO is not set +# CONFIG_MACH_MSS2_DT is not set +# CONFIG_MACH_MV2120 is not set +# CONFIG_MACH_NET2BIG is not set +# CONFIG_MACH_RD88F5181L_FXO is not set +# CONFIG_MACH_RD88F5181L_GE is not set +# CONFIG_MACH_RD88F5182 is not set +# CONFIG_MACH_RD88F5182_DT is not set +# CONFIG_MACH_RD88F6183AP_GE is not set +CONFIG_MACH_TERASTATION_PRO2=y +# CONFIG_MACH_TS209 is not set +# CONFIG_MACH_TS409 is not set +# CONFIG_MACH_TS78XX is not set +CONFIG_MACH_WN802T=y +CONFIG_MACH_WNR854T=y +CONFIG_MACH_WRT350N_V2=y +CONFIG_MDIO_BOARDINFO=y +CONFIG_MMC=y +CONFIG_MMC_MVSDIO=y +# CONFIG_MMC_TIFM_SD is not set +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MULTI_IRQ_HANDLER=y +CONFIG_MV643XX_ETH=y +CONFIG_MVEBU_MBUS=y +CONFIG_MVMDIO=y +# CONFIG_MVNETA is not set +CONFIG_MV_XOR=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_KUSER_HELPERS=y +CONFIG_NEED_PER_CPU_KM=y +# CONFIG_NET_VENDOR_AURORA is not set +CONFIG_NO_BOOTMEM=y +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_ADDRESS_PCI=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_MDIO=y +CONFIG_OF_MTD=y +CONFIG_OF_NET=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_OF_RESERVED_MEM=y +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_ORION_WATCHDOG=y +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PCI=y +# CONFIG_PCI_DOMAINS_GENERIC is not set +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +CONFIG_PLAT_ORION=y +CONFIG_PLAT_ORION_LEGACY=y +CONFIG_RATIONAL=y +# CONFIG_RCU_EXPERT is not set +# CONFIG_RCU_STALL_COMMON is not set +CONFIG_RTC_CLASS=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +# CONFIG_SCHED_INFO is not set +# CONFIG_SCSI_DMA is not set +CONFIG_SERIAL_8250_FSL=y +CONFIG_SPLIT_PTLOCK_CPUS=999999 +CONFIG_SRAM=y +CONFIG_SRCU=y +CONFIG_SWIOTLB=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_UNCOMPRESS_INCLUDE="mach/uncompress.h" +CONFIG_USB_SUPPORT=y +CONFIG_USE_OF=y +CONFIG_VECTORS_BASE=0xffff0000 +# CONFIG_VFP is not set +CONFIG_WATCHDOG_CORE=y +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/orion/patches-4.9/000-arm_openwrt_machtypes.patch b/target/linux/orion/patches-4.9/000-arm_openwrt_machtypes.patch new file mode 100644 index 0000000000..764f992288 --- /dev/null +++ b/target/linux/orion/patches-4.9/000-arm_openwrt_machtypes.patch @@ -0,0 +1,8 @@ +--- a/arch/arm/tools/mach-types ++++ b/arch/arm/tools/mach-types +@@ -1006,3 +1006,5 @@ eco5_bx2 MACH_ECO5_BX2 ECO5_BX2 4572 + eukrea_cpuimx28sd MACH_EUKREA_CPUIMX28SD EUKREA_CPUIMX28SD 4573 + domotab MACH_DOMOTAB DOMOTAB 4574 + pfla03 MACH_PFLA03 PFLA03 4575 ++dt2 MACH_DT2 DT2 1514 ++wn802t MACH_WN802T WN802T 3306 diff --git a/target/linux/orion/patches-4.9/100-wrt350nv2_openwrt_partition_map.patch b/target/linux/orion/patches-4.9/100-wrt350nv2_openwrt_partition_map.patch new file mode 100644 index 0000000000..89c2c9420b --- /dev/null +++ b/target/linux/orion/patches-4.9/100-wrt350nv2_openwrt_partition_map.patch @@ -0,0 +1,32 @@ +--- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c ++++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c +@@ -134,11 +134,11 @@ static struct mtd_partition wrt350n_v2_n + { + .name = "kernel", + .offset = 0x00000000, +- .size = 0x00760000, ++ .size = 0x00140000, // change to kernel mtd size here (1/3) + }, { + .name = "rootfs", +- .offset = 0x001a0000, +- .size = 0x005c0000, ++ .offset = 0x00140000, // change to kernel mtd size here (2/3) ++ .size = 0x00610000, // adopt to kernel mtd size here (3/3) = 0x00750000 - + }, { + .name = "lang", + .offset = 0x00760000, +@@ -151,6 +151,14 @@ static struct mtd_partition wrt350n_v2_n + .name = "u-boot", + .offset = 0x007c0000, + .size = 0x00040000, ++ }, { ++ .name = "eRcOmM_do_not_touch", ++ .offset = 0x00750000, ++ .size = 0x00010000, // erasesize ++ }, { ++ .name = "image", // for sysupgrade ++ .offset = 0x00000000, ++ .size = 0x00750000, + }, + }; + diff --git a/target/linux/orion/patches-4.9/101-wnr854t_partition_map.patch b/target/linux/orion/patches-4.9/101-wnr854t_partition_map.patch new file mode 100644 index 0000000000..881cfb773e --- /dev/null +++ b/target/linux/orion/patches-4.9/101-wnr854t_partition_map.patch @@ -0,0 +1,25 @@ +--- a/arch/arm/mach-orion5x/wnr854t-setup.c ++++ b/arch/arm/mach-orion5x/wnr854t-setup.c +@@ -57,15 +57,19 @@ static struct mtd_partition wnr854t_nor_ + { + .name = "kernel", + .offset = 0x00000000, +- .size = 0x00100000, ++ .size = 0x00140000, + }, { + .name = "rootfs", +- .offset = 0x00100000, +- .size = 0x00660000, ++ .offset = 0x00140000, ++ .size = 0x00620000, + }, { + .name = "uboot", + .offset = 0x00760000, + .size = 0x00040000, ++ }, { ++ .name = "image", // for sysupgrade ++ .offset = 0x00000000, ++ .size = 0x00760000, + }, + }; + diff --git a/target/linux/orion/patches-4.9/200-dt2_board_support.patch b/target/linux/orion/patches-4.9/200-dt2_board_support.patch new file mode 100644 index 0000000000..5528069cd5 --- /dev/null +++ b/target/linux/orion/patches-4.9/200-dt2_board_support.patch @@ -0,0 +1,562 @@ +--- a/arch/arm/mach-orion5x/Kconfig ++++ b/arch/arm/mach-orion5x/Kconfig +@@ -48,6 +48,13 @@ config MACH_RD88F5182_DT + Say 'Y' here if you want your kernel to support the Marvell + Orion-NAS (88F5182) RD2, Flattened Device Tree. + ++config MACH_DT2 ++ bool "Freecom DataTank Gateway" ++ select I2C_BOARDINFO ++ help ++ Say 'Y' here if you want your kernel to support the ++ Freecom DataTank Gateway ++ + config MACH_KUROBOX_PRO + bool "KuroBox Pro" + select I2C_BOARDINFO if I2C +--- a/arch/arm/mach-orion5x/Makefile ++++ b/arch/arm/mach-orion5x/Makefile +@@ -15,6 +15,7 @@ obj-$(CONFIG_MACH_TS78XX) += ts78xx-setu + obj-$(CONFIG_MACH_MV2120) += mv2120-setup.o + obj-$(CONFIG_MACH_NET2BIG) += net2big-setup.o + obj-$(CONFIG_MACH_WNR854T) += wnr854t-setup.o ++obj-$(CONFIG_MACH_DT2) += dt2-setup.o + obj-$(CONFIG_MACH_RD88F5181L_GE) += rd88f5181l-ge-setup.o + obj-$(CONFIG_MACH_RD88F5181L_FXO) += rd88f5181l-fxo-setup.o + obj-$(CONFIG_MACH_RD88F6183AP_GE) += rd88f6183ap-ge-setup.o +--- /dev/null ++++ b/arch/arm/mach-orion5x/dt2-common.h +@@ -0,0 +1,82 @@ ++#ifndef __INC_DT2_COMMON_H ++#define __INC_DT2_COMMON_H ++ ++#define ATAG_MV_UBOOT 0x41000403 ++ ++struct tag_mv_uboot { ++ u32 uboot_version; ++ u32 tclk; ++ u32 sysclk; ++ u32 isUsbHost; ++ u32 overEthAddr; ++ u8 dt2_eeprom[256]; ++}; ++ ++#define DT2_EEPROM_ADDR 0x50 ++#define DT2_EEPROM_OFFSET 0 ++#define DT2_EEPROM_LENGTH 256 ++ ++#define DT2_SERIAL_NUMBER_DEFAULT "run on default\0" ++#define DT2_REVISION_DEFAULT_INIT 0xFF ++#define DT2_CONFIG_FLAGS_DEFAULT 0x00 ++ ++#define _PACKED_ __attribute__((packed)) ++ ++struct DT2_EEPROM_SD_CONFIG { ++ unsigned int ram_1; ++ unsigned int ram_2; ++ unsigned int ram_3; ++ unsigned int ram_4; ++ unsigned char ram_5; ++ unsigned char ram_6; ++ unsigned short ram_7; ++ unsigned int magic_id; ++ } _PACKED_; // 24 Bytes in total ++ ++struct DT2_EEPROM_FC_CONFIG { ++ unsigned char rtc_sts_mask; ++ unsigned char rtc_sts_init; ++ unsigned char rtc_int_mask; ++ unsigned char rtc_int_init; ++ unsigned char rtc_atrim_init; ++ unsigned char rtc_dtrim_init; ++ unsigned char dummy1; ++ unsigned char dummy2; ++ unsigned char dt2_config_flags; /* 0x80 to load rtc_values to RTC */ ++ unsigned char dt2_revision; /* upper nibble is HW, lower nibble is FW */ ++ unsigned char dt2_serial_number[16]; /* Serial number of DT-2 */ ++ } _PACKED_; // 26 Bytes in total ++ ++#define CFG_LOAD_RTC_VALUES 0x80 ++ ++struct DT2_EEPROM_GW_CONFIG { ++ unsigned int dummy1; ++ unsigned int dummy2; ++ unsigned int dummy3; ++ unsigned char dummy4; ++ unsigned char tos_video_val1; ++ unsigned char tos_video_val2; ++ unsigned char tos_voip_val; ++ unsigned char qos_igmp_cfg; ++ unsigned char num_of_ifs; ++ unsigned short vlan_ports_if[3]; ++ unsigned char mac_addr[3][6]; ++ } _PACKED_; // 42 Bytes in total ++ ++#define _SIZE_OF_ALL_STRUCTS_ (sizeof(struct DT2_EEPROM_SD_CONFIG) + sizeof(struct DT2_EEPROM_FC_CONFIG) + sizeof(struct DT2_EEPROM_GW_CONFIG)) ++ ++// MV = EEPROM - SD - FC - GW - CRC ++struct DT2_EEPROM_MV_CONFIG { ++ unsigned int reg_addr[(DT2_EEPROM_LENGTH - _SIZE_OF_ALL_STRUCTS_ - sizeof(unsigned int)) / (sizeof(unsigned int) * 2)]; ++ unsigned int reg_data[(DT2_EEPROM_LENGTH - _SIZE_OF_ALL_STRUCTS_ - sizeof(unsigned int)) / (sizeof(unsigned int) * 2)]; ++ } _PACKED_; ++ ++struct DT2_EEPROM_STRUCT { ++ struct DT2_EEPROM_MV_CONFIG mv; ++ struct DT2_EEPROM_SD_CONFIG sd; ++ struct DT2_EEPROM_FC_CONFIG fc; ++ struct DT2_EEPROM_GW_CONFIG gw; ++ unsigned int crc; ++ } _PACKED_; ++ ++#endif +--- /dev/null ++++ b/arch/arm/mach-orion5x/dt2-setup.c +@@ -0,0 +1,448 @@ ++/* ++ * arch/arm/mach-orion5x/dt2-setup.c ++ * ++ * Freecom DataTank Gateway Setup ++ * ++ * Copyright (C) 2009 Zintis Petersons ++ * ++ * This file is licensed under the terms of the GNU General Public ++ * License version 2. This program is licensed "as is" without any ++ * warranty of any kind, whether express or implied. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "orion5x.h" ++#include "common.h" ++#include "mpp.h" ++ ++/***************************************************************************** ++ * DT2 local ++ ****************************************************************************/ ++#include ++#include "dt2-common.h" ++ ++u32 mvUbootVer = 0; ++u32 mvTclk = 166666667; ++u32 mvSysclk = 200000000; ++u32 mvIsUsbHost = 1; ++u32 overEthAddr = 0; ++u32 gBoardId = -1; ++struct DT2_EEPROM_STRUCT dt2_eeprom; ++ ++/***************************************************************************** ++ * DT2 Info ++ ****************************************************************************/ ++/* ++ * PCI ++ */ ++ ++#define DT2_PCI_SLOT0_OFFS 7 ++#define DT2_PCI_SLOT0_IRQ_A_PIN 3 ++#define DT2_PCI_SLOT0_IRQ_B_PIN 2 ++ ++#define DT2_PIN_GPIO_SYNC 25 ++#define DT2_PIN_GPIO_POWER 24 ++#define DT2_PIN_GPIO_UNPLUG1 23 ++#define DT2_PIN_GPIO_UNPLUG2 22 ++#define DT2_PIN_GPIO_RESET 4 ++ ++#define DT2_NOR_BOOT_BASE 0xf4000000 ++#define DT2_NOR_BOOT_SIZE SZ_512K ++ ++#define DT2_LEDS_BASE 0xfa000000 ++#define DT2_LEDS_SIZE SZ_1K ++ ++/***************************************************************************** ++ * 512K NOR Flash on Device bus Boot CS ++ ****************************************************************************/ ++ ++static struct mtd_partition dt2_partitions[] = { ++ { ++ .name = "u-boot", ++ .size = 0x00080000, ++ .offset = 0, ++ }, ++}; ++ ++static struct physmap_flash_data dt2_nor_flash_data = { ++ .width = 1, /* 8 bit bus width */ ++ .parts = dt2_partitions, ++ .nr_parts = ARRAY_SIZE(dt2_partitions) ++}; ++ ++static struct resource dt2_nor_flash_resource = { ++ .flags = IORESOURCE_MEM, ++ .start = DT2_NOR_BOOT_BASE, ++ .end = DT2_NOR_BOOT_BASE + DT2_NOR_BOOT_SIZE - 1, ++}; ++ ++static struct platform_device dt2_nor_flash = { ++ .name = "physmap-flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &dt2_nor_flash_data, ++ }, ++ .resource = &dt2_nor_flash_resource, ++ .num_resources = 1, ++}; ++ ++/***************************************************************************** ++ * PCI ++ ****************************************************************************/ ++ ++void __init dt2_pci_preinit(void) ++{ ++ int pin, irq; ++ ++ /* ++ * Configure PCI GPIO IRQ pins ++ */ ++ pin = DT2_PCI_SLOT0_IRQ_A_PIN; ++ if (gpio_request(pin, "PCI IntA") == 0) { ++ if (gpio_direction_input(pin) == 0) { ++ irq = gpio_to_irq(pin); ++ irq_set_irq_type(irq, IRQ_TYPE_LEVEL_LOW); ++ printk (KERN_INFO "PCI IntA IRQ: %d\n", irq); ++ } else { ++ printk(KERN_ERR "dt2_pci_preinit failed to " ++ "irq_set_irq_type pin %d\n", pin); ++ gpio_free(pin); ++ } ++ } else { ++ printk(KERN_ERR "dt2_pci_preinit failed to request gpio %d\n", pin); ++ } ++ ++ pin = DT2_PCI_SLOT0_IRQ_B_PIN; ++ if (gpio_request(pin, "PCI IntB") == 0) { ++ if (gpio_direction_input(pin) == 0) { ++ irq = gpio_to_irq(pin); ++ irq_set_irq_type(irq, IRQ_TYPE_LEVEL_LOW); ++ printk (KERN_INFO "PCI IntB IRQ: %d\n", irq); ++ } else { ++ printk(KERN_ERR "dt2_pci_preinit failed to " ++ "irq_set_irq_type pin %d\n", pin); ++ gpio_free(pin); ++ } ++ } else { ++ printk(KERN_ERR "dt2_pci_preinit failed to gpio_request %d\n", pin); ++ } ++} ++ ++static int __init dt2_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ int irq; ++ ++ /* ++ * Check for devices with hard-wired IRQs. ++ */ ++ irq = orion5x_pci_map_irq(dev, slot, pin); ++ if (irq != -1){ ++ printk(KERN_INFO "orion5x_pci_map_irq: %d\n", irq); ++ return irq; ++ } ++ ++ /* ++ * PCI IRQs are connected via GPIOs ++ */ ++ switch (slot - DT2_PCI_SLOT0_OFFS) { ++ case 0: ++ if (pin == 1){ ++ irq = gpio_to_irq(DT2_PCI_SLOT0_IRQ_A_PIN); ++ printk(KERN_INFO "dt2_pci_map_irq DT2_PCI_SLOT0_IRQ_A_PIN: %d\n", irq); ++ } ++ else { ++ irq = gpio_to_irq(DT2_PCI_SLOT0_IRQ_B_PIN); ++ printk(KERN_INFO "dt2_pci_map_irq DT2_PCI_SLOT0_IRQ_B_PIN: %d\n", irq); ++ } ++ default: ++ irq = -1; ++ printk(KERN_INFO "dt2_pci_map_irq IRQ: %d\n", irq); ++ } ++ ++ return irq; ++} ++ ++static struct hw_pci dt2_pci __initdata = { ++ .nr_controllers = 2, ++ .preinit = dt2_pci_preinit, ++ .setup = orion5x_pci_sys_setup, ++ .scan = orion5x_pci_sys_scan_bus, ++ .map_irq = dt2_pci_map_irq, ++}; ++ ++static int __init dt2_pci_init(void) ++{ ++ if (machine_is_dt2()) ++ pci_common_init(&dt2_pci); ++ ++ return 0; ++} ++ ++subsys_initcall(dt2_pci_init); ++ ++/***************************************************************************** ++ * Ethernet ++ ****************************************************************************/ ++ ++static struct mv643xx_eth_platform_data dt2_eth_data = { ++ .phy_addr = MV643XX_ETH_PHY_NONE, ++ .speed = SPEED_1000, ++ .duplex = DUPLEX_FULL, ++}; ++ ++static struct dsa_chip_data dt2_switch_chip_data = { ++ .port_names[0] = "wan", ++ .port_names[1] = "lan1", ++ .port_names[2] = "lan2", ++ .port_names[3] = "cpu", ++ .port_names[4] = "lan3", ++ .port_names[5] = "lan4", ++}; ++ ++static struct dsa_platform_data dt2_switch_plat_data = { ++ .nr_chips = 1, ++ .chip = &dt2_switch_chip_data, ++}; ++ ++/***************************************************************************** ++ * RTC ISL1208 on I2C bus ++ ****************************************************************************/ ++static struct i2c_board_info __initdata dt2_i2c_rtc = { ++ I2C_BOARD_INFO("isl1208", 0x6F), ++}; ++ ++/***************************************************************************** ++ * Sata ++ ****************************************************************************/ ++static struct mv_sata_platform_data dt2_sata_data = { ++ .n_ports = 2, ++}; ++ ++/***************************************************************************** ++ * General Setup ++ ****************************************************************************/ ++static unsigned int dt2_mpp_modes[] __initdata = { ++ MPP0_GPIO, // RTC interrupt ++ MPP1_GPIO, // 88e6131 interrupt ++ MPP2_GPIO, // PCI_intB ++ MPP3_GPIO, // PCI_intA ++ MPP4_GPIO, // reset button switch ++ MPP5_GPIO, ++ MPP6_GPIO, ++ MPP7_GPIO, ++ MPP8_GPIO, ++ MPP9_GIGE, /* GE_RXERR */ ++ MPP10_GPIO, // usb ++ MPP11_GPIO, // usb ++ MPP12_GIGE, // GE_TXD[4] ++ MPP13_GIGE, // GE_TXD[5] ++ MPP14_GIGE, // GE_TXD[6] ++ MPP15_GIGE, // GE_TXD[7] ++ MPP16_GIGE, // GE_RXD[4] ++ MPP17_GIGE, // GE_RXD[5] ++ MPP18_GIGE, // GE_RXD[6] ++ MPP19_GIGE, // GE_RXD[7] ++ 0, ++}; ++ ++/***************************************************************************** ++ * LEDS ++ ****************************************************************************/ ++static struct platform_device dt2_leds = { ++ .name = "dt2-led", ++ .id = -1, ++}; ++ ++/**************************************************************************** ++ * GPIO key ++ ****************************************************************************/ ++static irqreturn_t dt2_reset_handler(int irq, void *dev_id) ++{ ++ /* This is the paper-clip reset which does an emergency reboot. */ ++ printk(KERN_INFO "Restarting system.\n"); ++ machine_restart(NULL); ++ ++ /* This should never be reached. */ ++ return IRQ_HANDLED; ++} ++ ++static irqreturn_t dt2_power_handler(int irq, void *dev_id) ++{ ++ printk(KERN_INFO "Shutting down system.\n"); ++ machine_power_off(); ++ return IRQ_HANDLED; ++} ++ ++static void __init dt2_init(void) ++{ ++ /* ++ * Setup basic Orion functions. Need to be called early. ++ */ ++ orion5x_init(); ++ ++ orion5x_mpp_conf(dt2_mpp_modes); ++ ++ /* ++ * Configure peripherals. ++ */ ++ ++ orion5x_uart0_init(); ++ orion5x_ehci0_init(); ++ orion5x_ehci1_init(); ++ orion5x_i2c_init(); ++ orion5x_sata_init(&dt2_sata_data); ++ orion5x_xor_init(); ++ ++ printk(KERN_INFO "U-Boot parameters:\n"); ++ printk(KERN_INFO "Sys Clk = %d, Tclk = %d, BoardID = 0x%02x\n", mvSysclk, mvTclk, gBoardId); ++ ++ printk(KERN_INFO "Serial: %s\n", dt2_eeprom.fc.dt2_serial_number); ++ printk(KERN_INFO "Revision: %016x\n", dt2_eeprom.fc.dt2_revision); ++ printk(KERN_INFO "DT2: Using MAC address %pM for port 0\n", ++ dt2_eeprom.gw.mac_addr[0]); ++ printk(KERN_INFO "DT2: Using MAC address %pM for port 1\n", ++ dt2_eeprom.gw.mac_addr[1]); ++ ++ orion5x_eth_init(&dt2_eth_data); ++ memcpy(dt2_eth_data.mac_addr, dt2_eeprom.gw.mac_addr[0], 6); ++ orion5x_eth_switch_init(&dt2_switch_plat_data); ++ ++ i2c_register_board_info(0, &dt2_i2c_rtc, 1); ++ ++ mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET, ++ ORION_MBUS_DEVBUS_BOOT_ATTR, ++ DT2_NOR_BOOT_BASE, DT2_NOR_BOOT_SIZE); ++ ++ platform_device_register(&dt2_nor_flash); ++ ++ mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_TARGET(0), ++ ORION_MBUS_DEVBUS_ATTR(0), ++ DT2_LEDS_BASE, DT2_LEDS_SIZE); ++ platform_device_register(&dt2_leds); ++ ++ if (request_irq(gpio_to_irq(DT2_PIN_GPIO_RESET), &dt2_reset_handler, ++ IRQF_TRIGGER_LOW, ++ "DT2: Reset button", NULL) < 0) { ++ ++ printk("DT2: Reset Button IRQ %d not available\n", ++ gpio_to_irq(DT2_PIN_GPIO_RESET)); ++ } ++ ++ if (request_irq(gpio_to_irq(DT2_PIN_GPIO_POWER), &dt2_power_handler, ++ IRQF_TRIGGER_LOW, ++ "DT2: Power button", NULL) < 0) { ++ ++ printk(KERN_DEBUG "DT2: Power Button IRQ %d not available\n", ++ gpio_to_irq(DT2_PIN_GPIO_POWER)); ++ } ++} ++ ++static int __init parse_tag_dt2_uboot(const struct tag *t) ++{ ++ struct tag_mv_uboot *mv_uboot; ++ ++ // Get pointer to our block ++ mv_uboot = (struct tag_mv_uboot*)&t->u; ++ mvTclk = mv_uboot->tclk; ++ mvSysclk = mv_uboot->sysclk; ++ mvUbootVer = mv_uboot->uboot_version; ++ mvIsUsbHost = mv_uboot->isUsbHost; ++ ++ // Some clock fixups ++ if(mvTclk == 166000000) mvTclk = 166666667; ++ else if(mvTclk == 133000000) mvTclk = 133333333; ++ else if(mvSysclk == 166000000) mvSysclk = 166666667; ++ ++ gBoardId = (mvUbootVer & 0xff); ++ ++ //DT2 specific data ++ memcpy(&dt2_eeprom, mv_uboot->dt2_eeprom, sizeof(struct DT2_EEPROM_STRUCT)); ++ ++ return 0; ++} ++__tagtable(ATAG_MV_UBOOT, parse_tag_dt2_uboot); ++ ++/* ++ * This is OpenWrt specific fixup. It includes code from original "tag_fixup_mem32" to ++ * fixup bogus memory tags and also fixes kernel cmdline by adding " init=/etc/preinit" ++ * at the end. It is important to flash OpenWrt image from original Freecom firmware. ++ * ++ * Vanilla kernel should use "tag_fixup_mem32" function. ++ */ ++static void __init openwrt_fixup(struct tag *t, char **from) ++{ ++ char *p = NULL; ++ static char openwrt_init_tag[] __initdata = " init=/etc/preinit"; ++ ++ for (; t->hdr.size; t = tag_next(t)){ ++ /* Locate the Freecom cmdline */ ++ if (t->hdr.tag == ATAG_CMDLINE) { ++ p = t->u.cmdline.cmdline; ++ printk("%s(%d): Found cmdline '%s' at 0x%0lx\n", ++ __FUNCTION__, __LINE__, p, (unsigned long)p); ++ } ++ /* ++ * Many orion-based systems have buggy bootloader implementations. ++ * This is a common fixup for bogus memory tags. ++ */ ++ if (t->hdr.tag == ATAG_MEM && ++ (!t->u.mem.size || t->u.mem.size & ~PAGE_MASK || ++ t->u.mem.start & ~PAGE_MASK)) { ++ printk(KERN_WARNING ++ "Clearing invalid memory bank %dKB@0x%08x\n", ++ t->u.mem.size / 1024, t->u.mem.start); ++ t->hdr.tag = 0; ++ } ++ } ++ ++ printk("%s(%d): End of table at 0x%0lx\n", __FUNCTION__, __LINE__, (unsigned long)t); ++ ++ /* Overwrite the end of the table with a new cmdline tag. */ ++ t->hdr.tag = ATAG_CMDLINE; ++ t->hdr.size = ++ (sizeof (struct tag_header) + ++ strlen(p) + strlen(openwrt_init_tag) + 1 + 4) >> 2; ++ ++ strlcpy(t->u.cmdline.cmdline, p, COMMAND_LINE_SIZE); ++ strlcpy(t->u.cmdline.cmdline + strlen(p), openwrt_init_tag, ++ COMMAND_LINE_SIZE - strlen(p)); ++ ++ printk("%s(%d): New cmdline '%s' at 0x%0lx\n", ++ __FUNCTION__, __LINE__, ++ t->u.cmdline.cmdline, (unsigned long)t->u.cmdline.cmdline); ++ ++ t = tag_next(t); ++ ++ printk("%s(%d): New end of table at 0x%0lx\n", __FUNCTION__, __LINE__, (unsigned long)t); ++ ++ t->hdr.tag = ATAG_NONE; ++ t->hdr.size = 0; ++} ++ ++/* Warning: Freecom uses their own custom bootloader with mach-type (=1500) */ ++MACHINE_START(DT2, "Freecom DataTank Gateway") ++ /* Maintainer: Zintis Petersons */ ++ .atag_offset = 0x100, ++ .init_machine = dt2_init, ++ .map_io = orion5x_map_io, ++ .init_irq = orion5x_init_irq, ++ .init_time = orion5x_timer_init, ++ .fixup = openwrt_fixup, //tag_fixup_mem32, ++MACHINE_END diff --git a/target/linux/orion/patches-4.9/210-wn802t_support.patch b/target/linux/orion/patches-4.9/210-wn802t_support.patch new file mode 100644 index 0000000000..a274beedc3 --- /dev/null +++ b/target/linux/orion/patches-4.9/210-wn802t_support.patch @@ -0,0 +1,73 @@ +--- a/arch/arm/mach-orion5x/Kconfig ++++ b/arch/arm/mach-orion5x/Kconfig +@@ -159,10 +159,13 @@ config MACH_MSS2_DT + Maxtor Shared Storage II platform. + + config MACH_WNR854T +- bool "Netgear WNR854T" ++ bool "Netgear WNR854T / WN802T" + help + Say 'Y' here if you want your kernel to support the +- Netgear WNR854T platform. ++ Netgear WNR854T or WN802T platform. ++ ++config MACH_WN802T ++ def_bool MACH_WNR854T + + config MACH_RD88F5181L_GE + bool "Marvell Orion-VoIP GE Reference Design" +--- a/arch/arm/mach-orion5x/wnr854t-setup.c ++++ b/arch/arm/mach-orion5x/wnr854t-setup.c +@@ -115,6 +115,15 @@ static struct dsa_platform_data __initda + .chip = &wnr854t_switch_chip_data, + }; + ++static struct dsa_chip_data wn802t_switch_chip_data = { ++ .port_names[2] = "wan", ++ .port_names[3] = "cpu", ++}; ++ ++static struct dsa_platform_data wn802t_switch_plat_data = { ++ .nr_chips = 1, ++ .chip = &wn802t_switch_chip_data, ++}; + static void __init wnr854t_init(void) + { + /* +@@ -128,7 +137,10 @@ static void __init wnr854t_init(void) + * Configure peripherals. + */ + orion5x_eth_init(&wnr854t_eth_data); +- orion5x_eth_switch_init(&wnr854t_switch_plat_data); ++ if (machine_is_wn802t()) ++ orion5x_eth_switch_init(&wn802t_switch_plat_data); ++ else ++ orion5x_eth_switch_init(&wnr854t_switch_plat_data); + orion5x_uart0_init(); + + mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET, +@@ -168,7 +180,7 @@ static struct hw_pci wnr854t_pci __initd + + static int __init wnr854t_pci_init(void) + { +- if (machine_is_wnr854t()) ++ if (machine_is_wnr854t() || machine_is_wn802t()) + pci_common_init(&wnr854t_pci); + + return 0; +@@ -187,3 +199,15 @@ MACHINE_START(WNR854T, "Netgear WNR854T" + .fixup = tag_fixup_mem32, + .restart = orion5x_restart, + MACHINE_END ++ ++MACHINE_START(WN802T, "Netgear WN802T") ++ /* Maintainer: Imre Kaloz */ ++ .atag_offset = 0x100, ++ .init_machine = wnr854t_init, ++ .map_io = orion5x_map_io, ++ .init_early = orion5x_init_early, ++ .init_irq = orion5x_init_irq, ++ .init_time = orion5x_timer_init, ++ .fixup = tag_fixup_mem32, ++ .restart = orion5x_restart, ++MACHINE_END diff --git a/target/linux/oxnas/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch b/target/linux/oxnas/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch index 48fda9b020..9f4b044473 100644 --- a/target/linux/oxnas/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch +++ b/target/linux/oxnas/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch @@ -2512,10 +2512,10 @@ Signed-off-by: John Crispin { - struct nand_chip *chip = mtd->priv; + struct nand_chip *chip = mtd_to_nand(mtd); + int chipnr = (int)(to >> chip->chip_shift); struct mtd_oob_ops ops; int ret; - -@@ -2722,15 +2757,12 @@ static int nand_do_write_oob(struct mtd_ +@@ -2725,15 +2760,12 @@ static int nand_do_write_oob(struct mtd_ struct mtd_oob_ops *ops) { int chipnr, page, status, len; @@ -2533,7 +2533,7 @@ Signed-off-by: John Crispin /* Do not allow write past end of page */ if ((ops->ooboffs + ops->ooblen) > len) { -@@ -2847,7 +2879,7 @@ out: +@@ -2850,7 +2882,7 @@ out: */ static int single_erase(struct mtd_info *mtd, int page) { @@ -2542,7 +2542,7 @@ Signed-off-by: John Crispin /* Send commands to erase a block */ chip->cmdfunc(mtd, NAND_CMD_ERASE1, -1, page); chip->cmdfunc(mtd, NAND_CMD_ERASE2, -1, -1); -@@ -2879,7 +2911,7 @@ int nand_erase_nand(struct mtd_info *mtd +@@ -2882,7 +2914,7 @@ int nand_erase_nand(struct mtd_info *mtd int allowbbt) { int page, status, pages_per_block, ret, chipnr; @@ -2551,7 +2551,7 @@ Signed-off-by: John Crispin loff_t len; pr_debug("%s: start = 0x%012llx, len = %llu\n", -@@ -2918,7 +2950,7 @@ int nand_erase_nand(struct mtd_info *mtd +@@ -2921,7 +2953,7 @@ int nand_erase_nand(struct mtd_info *mtd while (len) { /* Check if we have a bad block, we do not erase bad blocks! */ if (nand_block_checkbad(mtd, ((loff_t) page) << @@ -2560,7 +2560,7 @@ Signed-off-by: John Crispin pr_warn("%s: attempt to erase a bad block at page 0x%08x\n", __func__, page); instr->state = MTD_ERASE_FAILED; -@@ -3005,7 +3037,20 @@ static void nand_sync(struct mtd_info *m +@@ -3008,7 +3040,20 @@ static void nand_sync(struct mtd_info *m */ static int nand_block_isbad(struct mtd_info *mtd, loff_t offs) { @@ -2582,7 +2582,7 @@ Signed-off-by: John Crispin } /** -@@ -3094,7 +3139,7 @@ static int nand_suspend(struct mtd_info +@@ -3097,7 +3142,7 @@ static int nand_suspend(struct mtd_info */ static void nand_resume(struct mtd_info *mtd) { @@ -2591,7 +2591,7 @@ Signed-off-by: John Crispin if (chip->state == FL_PM_SUSPENDED) nand_release_device(mtd); -@@ -3266,7 +3311,7 @@ ext_out: +@@ -3269,7 +3314,7 @@ ext_out: static int nand_setup_read_retry_micron(struct mtd_info *mtd, int retry_mode) { @@ -2600,7 +2600,7 @@ Signed-off-by: John Crispin uint8_t feature[ONFI_SUBFEATURE_PARAM_LEN] = {retry_mode}; return chip->onfi_set_features(mtd, chip, ONFI_FEATURE_ADDR_READ_RETRY, -@@ -3937,10 +3982,13 @@ ident_done: +@@ -3940,10 +3985,13 @@ ident_done: return type; } @@ -2617,7 +2617,7 @@ Signed-off-by: John Crispin if (of_get_nand_bus_width(dn) == 16) chip->options |= NAND_BUSWIDTH_16; -@@ -3949,6 +3997,7 @@ static int nand_dt_init(struct mtd_info +@@ -3952,6 +4000,7 @@ static int nand_dt_init(struct mtd_info chip->bbt_options |= NAND_BBT_USE_FLASH; ecc_mode = of_get_nand_ecc_mode(dn); @@ -2625,7 +2625,7 @@ Signed-off-by: John Crispin ecc_strength = of_get_nand_ecc_strength(dn); ecc_step = of_get_nand_ecc_step_size(dn); -@@ -3961,6 +4010,9 @@ static int nand_dt_init(struct mtd_info +@@ -3964,6 +4013,9 @@ static int nand_dt_init(struct mtd_info if (ecc_mode >= 0) chip->ecc.mode = ecc_mode; @@ -2635,7 +2635,7 @@ Signed-off-by: John Crispin if (ecc_strength >= 0) chip->ecc.strength = ecc_strength; -@@ -3984,15 +4036,16 @@ int nand_scan_ident(struct mtd_info *mtd +@@ -3987,15 +4039,16 @@ int nand_scan_ident(struct mtd_info *mtd struct nand_flash_dev *table) { int i, nand_maf_id, nand_dev_id; @@ -2658,7 +2658,7 @@ Signed-off-by: John Crispin if (!mtd->name && mtd->dev.parent) mtd->name = dev_name(mtd->dev.parent); -@@ -4055,7 +4108,7 @@ EXPORT_SYMBOL(nand_scan_ident); +@@ -4058,7 +4111,7 @@ EXPORT_SYMBOL(nand_scan_ident); */ static bool nand_ecc_strength_good(struct mtd_info *mtd) { @@ -2667,7 +2667,7 @@ Signed-off-by: John Crispin struct nand_ecc_ctrl *ecc = &chip->ecc; int corr, ds_corr; -@@ -4083,10 +4136,10 @@ static bool nand_ecc_strength_good(struc +@@ -4086,10 +4139,10 @@ static bool nand_ecc_strength_good(struc */ int nand_scan_tail(struct mtd_info *mtd) { @@ -2680,7 +2680,7 @@ Signed-off-by: John Crispin /* New bad blocks should be marked in OOB, flash-based BBT, or both */ BUG_ON((chip->bbt_options & NAND_BBT_NO_OOB_BBM) && -@@ -4113,19 +4166,15 @@ int nand_scan_tail(struct mtd_info *mtd) +@@ -4116,19 +4169,15 @@ int nand_scan_tail(struct mtd_info *mtd) /* * If no default placement scheme is given, select an appropriate one. */ @@ -2703,7 +2703,7 @@ Signed-off-by: John Crispin break; default: pr_warn("No oob scheme defined for oobsize %d\n", -@@ -4168,7 +4217,7 @@ int nand_scan_tail(struct mtd_info *mtd) +@@ -4171,7 +4220,7 @@ int nand_scan_tail(struct mtd_info *mtd) ecc->write_oob = nand_write_oob_std; if (!ecc->read_subpage) ecc->read_subpage = nand_read_subpage; @@ -2712,7 +2712,7 @@ Signed-off-by: John Crispin ecc->write_subpage = nand_write_subpage_hwecc; case NAND_ECC_HW_SYNDROME: -@@ -4246,10 +4295,8 @@ int nand_scan_tail(struct mtd_info *mtd) +@@ -4249,10 +4298,8 @@ int nand_scan_tail(struct mtd_info *mtd) } /* See nand_bch_init() for details. */ @@ -2725,7 +2725,7 @@ Signed-off-by: John Crispin if (!ecc->priv) { pr_warn("BCH ECC initialization failed!\n"); BUG(); -@@ -4280,20 +4327,9 @@ int nand_scan_tail(struct mtd_info *mtd) +@@ -4283,20 +4330,9 @@ int nand_scan_tail(struct mtd_info *mtd) if (!ecc->write_oob_raw) ecc->write_oob_raw = ecc->write_oob; @@ -2749,7 +2749,7 @@ Signed-off-by: John Crispin /* * Set the number of read / write steps for one page depending on ECC -@@ -4306,6 +4342,21 @@ int nand_scan_tail(struct mtd_info *mtd) +@@ -4309,6 +4345,21 @@ int nand_scan_tail(struct mtd_info *mtd) } ecc->total = ecc->steps * ecc->bytes; @@ -2771,7 +2771,7 @@ Signed-off-by: John Crispin /* Allow subpage writes up to ecc.steps. Not possible for MLC flash */ if (!(chip->options & NAND_NO_SUBPAGE_WRITE) && nand_is_slc(chip)) { switch (ecc->steps) { -@@ -4362,10 +4413,6 @@ int nand_scan_tail(struct mtd_info *mtd) +@@ -4365,10 +4416,6 @@ int nand_scan_tail(struct mtd_info *mtd) mtd->_block_markbad = nand_block_markbad; mtd->writebufsize = mtd->writesize; @@ -2782,7 +2782,7 @@ Signed-off-by: John Crispin /* * Initialize bitflip_threshold to its default prior scan_bbt() call. * scan_bbt() might invoke mtd_read(), thus bitflip_threshold must be -@@ -4421,7 +4468,7 @@ EXPORT_SYMBOL(nand_scan); +@@ -4424,7 +4471,7 @@ EXPORT_SYMBOL(nand_scan); */ void nand_release(struct mtd_info *mtd) { diff --git a/target/linux/oxnas/patches-4.4/0074-mtd-nand-import-nand_hw_control_init.patch b/target/linux/oxnas/patches-4.4/0074-mtd-nand-import-nand_hw_control_init.patch index 4b3260c41b..aefcfd98a7 100644 --- a/target/linux/oxnas/patches-4.4/0074-mtd-nand-import-nand_hw_control_init.patch +++ b/target/linux/oxnas/patches-4.4/0074-mtd-nand-import-nand_hw_control_init.patch @@ -87,7 +87,7 @@ Signed-off-by: Boris Brezillon } --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c -@@ -3202,8 +3202,7 @@ static void nand_set_defaults(struct nan +@@ -3205,8 +3205,7 @@ static void nand_set_defaults(struct nan if (!chip->controller) { chip->controller = &chip->hwcontrol; diff --git a/target/linux/oxnas/patches-4.4/330-oxnas-pinctrl.patch b/target/linux/oxnas/patches-4.4/330-oxnas-pinctrl.patch index 479bfddc50..76a19267a2 100644 --- a/target/linux/oxnas/patches-4.4/330-oxnas-pinctrl.patch +++ b/target/linux/oxnas/patches-4.4/330-oxnas-pinctrl.patch @@ -1,6 +1,6 @@ --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig -@@ -227,6 +227,15 @@ config PINCTRL_COH901 +@@ -228,6 +228,15 @@ config PINCTRL_COH901 COH 901 335 and COH 901 571/3. They contain 3, 5 or 7 ports of 8 GPIO pins each. diff --git a/target/linux/oxnas/patches-4.4/500-oxnas-sata.patch b/target/linux/oxnas/patches-4.4/500-oxnas-sata.patch index 3891dc1bc2..b833b635aa 100644 --- a/target/linux/oxnas/patches-4.4/500-oxnas-sata.patch +++ b/target/linux/oxnas/patches-4.4/500-oxnas-sata.patch @@ -1,6 +1,6 @@ --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig -@@ -429,6 +429,13 @@ config SATA_VITESSE +@@ -432,6 +432,13 @@ config SATA_VITESSE If unsure, say N. diff --git a/target/linux/oxnas/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch b/target/linux/oxnas/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch index 2a607c6c62..6bffa6fe6a 100644 --- a/target/linux/oxnas/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch +++ b/target/linux/oxnas/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch @@ -153,7 +153,7 @@ Signed-off-by: Adrian Panella } --- a/init/main.c +++ b/init/main.c -@@ -88,6 +88,10 @@ +@@ -89,6 +89,10 @@ #include #include @@ -164,7 +164,7 @@ Signed-off-by: Adrian Panella static int kernel_init(void *); extern void init_IRQ(void); -@@ -560,6 +564,18 @@ asmlinkage __visible void __init start_k +@@ -562,6 +566,18 @@ asmlinkage __visible void __init start_k page_alloc_init(); pr_notice("Kernel command line: %s\n", boot_command_line); diff --git a/target/linux/pistachio/config-4.9 b/target/linux/pistachio/config-4.9 index 121f6a8c13..a417a6b064 100644 --- a/target/linux/pistachio/config-4.9 +++ b/target/linux/pistachio/config-4.9 @@ -216,6 +216,7 @@ CONFIG_MTD_SPI_NAND=y CONFIG_MTD_SPI_NAND_DEVICES=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384 CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y diff --git a/target/linux/pistachio/patches-4.9/411-mtd-nand-Check-length-of-ID-before-reading-bits-per-.patch b/target/linux/pistachio/patches-4.9/411-mtd-nand-Check-length-of-ID-before-reading-bits-per-.patch index 69d96932b6..f360613f9f 100644 --- a/target/linux/pistachio/patches-4.9/411-mtd-nand-Check-length-of-ID-before-reading-bits-per-.patch +++ b/target/linux/pistachio/patches-4.9/411-mtd-nand-Check-length-of-ID-before-reading-bits-per-.patch @@ -21,7 +21,7 @@ Signed-off-by: Ezequiel Garcia --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c -@@ -4040,7 +4040,8 @@ static bool find_full_id_nand(struct mtd +@@ -4043,7 +4043,8 @@ static bool find_full_id_nand(struct mtd mtd->erasesize = type->erasesize; mtd->oobsize = type->oobsize; diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds index 83e1a94000..3e26493e54 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -12,6 +12,7 @@ set_wifi_led() { board=$(board_name) +boardname="${board##*,}" board_config_update @@ -25,35 +26,39 @@ sap-g3200u3|\ sk-wb8|\ w2914nsv2|\ wf-2881) - set_usb_led "$board:green:usb" + set_usb_led "$boardname:green:usb" ;; 3g150b|\ 3g300m) - set_usb_led "$board:blue:3g" + set_usb_led "$boardname:blue:3g" ;; 3g-6200n) - set_wifi_led "$board:amber:wlan" - set_usb_led "$board:blue:3g" + set_wifi_led "$boardname:amber:wlan" + set_usb_led "$boardname:blue:3g" ;; 3g-6200nl|\ wnce2001) - set_wifi_led "$board:green:wlan" + set_wifi_led "$boardname:green:wlan" ;; br-6475nd|\ mzk-w300nh2) - set_wifi_led "$board:amber:wlan" + set_wifi_led "$boardname:amber:wlan" ;; a5-v11|\ cs-qr10) - ucidef_set_led_default "power" "POWER" "$board:red:power" "1" + ucidef_set_led_default "power" "POWER" "$boardname:red:power" "1" ;; ai-br100) - ucidef_set_led_netdev "wan" "wan" "$board:blue:wan" "eth0.2" - set_wifi_led "$board:blue:wlan" + ucidef_set_led_netdev "wan" "wan" "$boardname:blue:wan" "eth0.2" + set_wifi_led "$boardname:blue:wlan" ;; air3gii) - set_wifi_led "$board:green:wlan" - set_usb_led "$board:green:mobile" + set_wifi_led "$boardname:green:wlan" + set_usb_led "$boardname:green:mobile" + ;; +alfa-network,ac1200rm) + set_wifi_led "$boardname:green:wlan2g" "wlan1" + ucidef_set_led_default "wps" "wps" "$boardname:green:wps" "0" ;; all0256n-4M|\ all0256n-8M) @@ -76,60 +81,66 @@ asl26555-16M) set_usb_led "asl26555:green:3g" ;; bc2) - set_usb_led "$board:blue:usb" + set_usb_led "$boardname:blue:usb" ;; broadway) - set_usb_led "$board:red:diskmounted" - set_wifi_led "$board:red:wps_active" + set_usb_led "$boardname:red:diskmounted" + set_wifi_led "$boardname:red:wps_active" ;; c108) - ucidef_set_led_netdev "lan" "lan" "$board:green:lan" "eth0" - ucidef_set_led_netdev "modem" "modem" "$board:green:modem" "wwan0" + ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0" + ucidef_set_led_netdev "modem" "modem" "$boardname:green:modem" "wwan0" + ;; +c20) + ucidef_set_led_switch "lan" "lan" "$boardname:blue:lan" "switch0" "0x1e" + ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x01" + set_usb_led "$boardname:blue:usb" + ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:blue:wlan2g" "wlan0" ;; c20i) - ucidef_set_led_switch "lan" "lan" "$board:blue:lan" "switch0" "0x1e" - ucidef_set_led_switch "wan" "wan" "$board:blue:wan" "switch0" "0x01" - set_usb_led "$board:blue:usb" "2-1" - ucidef_set_led_wlan "wlan" "wlan" "$board:blue:wlan" "phy0radio" + ucidef_set_led_switch "lan" "lan" "$boardname:blue:lan" "switch0" "0x1e" + ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x01" + set_usb_led "$boardname:blue:usb" "2-1" + ucidef_set_led_wlan "wlan" "wlan" "$boardname:blue:wlan" "phy0radio" ;; c50) - ucidef_set_led_switch "lan" "lan" "$board:green:lan" "switch0" "0x1e" - ucidef_set_led_switch "wan" "wan" "$board:green:wan" "switch0" "0x01" - set_usb_led "$board:green:usb" - ucidef_set_led_netdev "wlan2g" "wlan2g" "$board:green:wlan2g" wlan1 - set_wifi_led "$board:green:wlan5g" + ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e" + ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" + set_usb_led "$boardname:green:usb" + ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:green:wlan2g" wlan1 + set_wifi_led "$boardname:green:wlan5g" ;; cf-wr800n) - ucidef_set_led_netdev "lan" "lan" "$board:white:ethernet" eth0.1 - set_wifi_led "$board:white:wifi" + ucidef_set_led_netdev "lan" "lan" "$boardname:white:ethernet" eth0.1 + set_wifi_led "$boardname:white:wifi" ;; cy-swr1100) - ucidef_set_led_default "wps" "WPS" "$board:blue:wps" "0" - set_usb_led "$board:blue:usb" + ucidef_set_led_default "wps" "WPS" "$boardname:blue:wps" "0" + set_usb_led "$boardname:blue:usb" ;; d105) - ucidef_set_led_default "power" "POWER" "$board:red:power" "1" - set_usb_led "$board:green:usb" + ucidef_set_led_default "power" "POWER" "$boardname:red:power" "1" + set_usb_led "$boardname:green:usb" ;; d240) - set_wifi_led "$board:blue:wifi" - set_usb_led "$board:blue:usb" + set_wifi_led "$boardname:blue:wifi" + set_usb_led "$boardname:blue:usb" ;; db-wrt01) - ucidef_set_led_default "power" "power" "$board:orange:power" "1" + ucidef_set_led_default "power" "power" "$boardname:orange:power" "1" ;; dch-m225) ucidef_set_led_default "power" "POWER" "$board:geeen:power" "1" ucidef_set_led_default "status" "STATUS" "$board:red:status" "0" ;; dcs-930l-b1) - ucidef_set_led_default "power" "POWER" "$board:red:power" "1" - ucidef_set_led_netdev "wifi" "WiFi" "$board:blue:wps" + ucidef_set_led_default "power" "POWER" "$boardname:red:power" "1" + ucidef_set_led_netdev "wifi" "WiFi" "$boardname:blue:wps" ;; dir-300-b1|\ dir-600-b1|\ dir-620-a1) - ucidef_set_led_default "wan" "WAN LED (amber)" "$board:amber:wan" "1" + ucidef_set_led_default "wan" "WAN LED (amber)" "$boardname:amber:wan" "1" set_wifi_led "rt2800pci-phy0::radio" ;; dir-300-b7|\ @@ -146,164 +157,174 @@ wt1520-8M) ;; dir-615-d|\ dir-615-h1) - ucidef_set_led_default "status" "Status LED (amber)" "$board:amber:status" "0" + ucidef_set_led_default "status" "Status LED (amber)" "$boardname:amber:status" "0" set_wifi_led "rt2800pci-phy0::radio" ;; dir-620-d1|\ mzk-ex300np) - set_wifi_led "$board:green:wifi" + set_wifi_led "$boardname:green:wifi" ;; dir-810l|\ mzk-750dhp|\ mzk-dp150n|\ vr500) - ucidef_set_led_default "power" "power" "$board:green:power" "1" + ucidef_set_led_default "power" "power" "$boardname:green:power" "1" ;; dir-860l-b1) - ucidef_set_led_netdev "wan" "wan" "$board:green:net" "eth0.2" + ucidef_set_led_netdev "wan" "wan" "$boardname:green:net" "eth0.2" ;; ex2700|\ wn3000rpv3) - set_wifi_led "$board:green:router" + set_wifi_led "$boardname:green:router" ;; ex3700) - ucidef_set_led_netdev "wlan5g" "ROUTER (green)" "$board:green:router" "wlan0" - ucidef_set_led_netdev "wlan2g" "DEVICE (green)" "$board:green:device" "wlan1" + ucidef_set_led_netdev "wlan5g" "ROUTER (green)" "$boardname:green:router" "wlan0" + ucidef_set_led_netdev "wlan2g" "DEVICE (green)" "$boardname:green:device" "wlan1" ;; f5d8235-v1) - ucidef_set_led_default "lan" "lan" "$board:blue:wired" "0" - set_usb_led "$board:blue:storage" - set_wifi_led "$board:blue:wireless" + ucidef_set_led_default "lan" "lan" "$boardname:blue:wired" "0" + set_usb_led "$boardname:blue:storage" + set_wifi_led "$boardname:blue:wireless" ;; f5d8235-v2) - set_usb_led "$board:blue:storage" + set_usb_led "$boardname:blue:storage" ;; fonera20n) - set_usb_led "$board:orange:usb" - set_wifi_led "$board:orange:wifi" + set_usb_led "$boardname:orange:usb" + set_wifi_led "$boardname:orange:wifi" ;; gb-pc1) - ucidef_set_led_switch "lan1" "lan1" "$board:green:lan1" "switch0" "0x01" - ucidef_set_led_switch "lan2" "lan2" "$board:green:lan2" "switch0" "0x10" + ucidef_set_led_switch "lan1" "lan1" "$boardname:green:lan1" "switch0" "0x01" + ucidef_set_led_switch "lan2" "lan2" "$boardname:green:lan2" "switch0" "0x10" ;; gl-mt300a|\ gl-mt300n|\ gl-mt750) - set_wifi_led "$board:wlan" + set_wifi_led "$boardname:wlan" ;; gl-mt300n-v2) - set_wifi_led "$board:red:wlan" + set_wifi_led "$boardname:red:wlan" ;; hc5661|\ hc5661a) - ucidef_set_led_default "system" "system" "$board:blue:system" "1" - ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2" - set_wifi_led "$board:blue:wlan2g" + ucidef_set_led_default "system" "system" "$boardname:blue:system" "1" + ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2" + set_wifi_led "$boardname:blue:wlan2g" ;; hc5761) - ucidef_set_led_default "system" "system" "$board:blue:system" "1" - ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2" - set_wifi_led "$board:blue:wlan2g" - ucidef_set_led_netdev "wifi5g" "wifi5g" "$board:blue:wlan5g" "rai0" + ucidef_set_led_default "system" "system" "$boardname:blue:system" "1" + ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2" + set_wifi_led "$boardname:blue:wlan2g" + ucidef_set_led_netdev "wifi5g" "wifi5g" "$boardname:blue:wlan5g" "rai0" ;; hc5861) - ucidef_set_led_default "system" "system" "$board:blue:system" "1" - ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2" - set_wifi_led "$board:blue:wlan2g" - ucidef_set_led_netdev "wifi5g" "wifi5g" "$board:blue:wlan5g" "rai0" - ucidef_set_led_default "turbo" "turbo" "$board:blue:turbo" "0" + ucidef_set_led_default "system" "system" "$boardname:blue:system" "1" + ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2" + set_wifi_led "$boardname:blue:wlan2g" + ucidef_set_led_netdev "wifi5g" "wifi5g" "$boardname:blue:wlan5g" "rai0" + ucidef_set_led_default "turbo" "turbo" "$boardname:blue:turbo" "0" ;; hg255d) - set_wifi_led "$board:green:wlan" - set_usb_led "$board:green:usb" - ucidef_set_led_netdev "internet" "internet" "$board:green:internet" "eth0.2" + set_wifi_led "$boardname:green:wlan" + set_usb_led "$boardname:green:usb" + ucidef_set_led_netdev "internet" "internet" "$boardname:green:internet" "eth0.2" ;; hpm) - ucidef_set_led_default "power" "POWER" "$board:orange:power" "1" - ucidef_set_led_netdev "eth" "ETH" "$board:green:eth" "eth0" - set_wifi_led "$board:green:wifi" + ucidef_set_led_default "power" "POWER" "$boardname:orange:power" "1" + ucidef_set_led_netdev "eth" "ETH" "$boardname:green:eth" "eth0" + set_wifi_led "$boardname:green:wifi" ;; ht-tm02) - ucidef_set_led_netdev "eth" "Ethernet" "$board:green:lan" "eth0" - set_wifi_led "$board:blue:wlan" + ucidef_set_led_netdev "eth" "Ethernet" "$boardname:green:lan" "eth0" + set_wifi_led "$boardname:blue:wlan" ;; kn|\ nbg-419n2) - set_usb_led "$board:green:usb" + set_usb_led "$boardname:green:usb" set_wifi_led "rt2800pci-phy0::radio" ;; kn_rc|\ kn_rf|\ kng_rc) - set_usb_led "$board:green:usb" - set_wifi_led "$board:green:wifi" + set_usb_led "$boardname:green:usb" + set_wifi_led "$boardname:green:wifi" + ;; +linkits7688) + ucidef_set_led_wlan "wifi" "wifi" "linkit-smart-7688:orange:wifi" "phy0tpt" ;; m2m) - set_wifi_led "$board:blue:wifi" - ucidef_set_led_netdev "eth" "Ethernet" "$board:green:wan" "eth0" + set_wifi_led "$boardname:blue:wifi" + ucidef_set_led_netdev "eth" "Ethernet" "$boardname:green:wan" "eth0" ;; miniembplug) - set_wifi_led "$board:red:wlan" - set_usb_led "$board:green:mobile" + set_wifi_led "$boardname:red:wlan" + set_usb_led "$boardname:green:mobile" ;; mir3g) - ucidef_set_led_netdev "eth" "Ethernet" "$board:red:wan" "eth0" - set_usb_led "$board:blue:usb" + ucidef_set_led_switch "wan-amber" "WAN (amber)" "$boardname:amber:wan" "switch0" "0x02" "0x08" + ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x08" "0x08" + ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08" ;; miwifi-mini) - ucidef_set_led_default "power" "power" "$board:red:status" "1" + ucidef_set_led_default "power" "power" "$boardname:red:status" "1" ;; mlw221|\ mlwg2) - set_wifi_led "$board:blue:wifi" - ucidef_set_led_default "system" "system" "$board:blue:system" "1" + set_wifi_led "$boardname:blue:wifi" + ucidef_set_led_default "system" "system" "$boardname:blue:system" "1" ;; mpr-a1|\ mpr-a2) - set_wifi_led "$board:blue:system" + set_wifi_led "$boardname:blue:system" ;; mr-102n) - set_wifi_led "$board:green:wlan" - set_usb_led "$board:green:usb" + set_wifi_led "$boardname:green:wlan" + set_usb_led "$boardname:green:usb" ;; mr200) - ucidef_set_led_default "power" "power" "$board:white:power" "1" - ucidef_set_led_netdev "lan" "lan" "$board:white:lan" "eth0.1" - ucidef_set_led_netdev "wan" "wan" "$board:white:wan" "usb0" - set_wifi_led "$board:white:wlan" + ucidef_set_led_default "power" "power" "$boardname:white:power" "1" + ucidef_set_led_netdev "lan" "lan" "$boardname:white:lan" "eth0.1" + ucidef_set_led_netdev "wan" "wan" "$boardname:white:wan" "usb0" + set_wifi_led "$boardname:white:wlan" ;; mzk-ex750np) - ucidef_set_led_default "power" "power" "$board:red:power" "1" - set_wifi_led "$board:red:wifi" + ucidef_set_led_default "power" "power" "$boardname:red:power" "1" + set_wifi_led "$boardname:red:wifi" ;; na930) - set_usb_led "$board:blue:status" + set_usb_led "$boardname:blue:status" ;; newifi-d1) - set_usb_led "$board:red:status" + set_usb_led "$boardname:red:status" ;; nw718) - set_usb_led "$board:amber:usb" + set_usb_led "$boardname:amber:usb" ;; oy-0001) - ucidef_set_led_default "power" "power" "$board:green:power" "1" - set_wifi_led "$board:green:wifi" + ucidef_set_led_default "power" "power" "$boardname:green:power" "1" + set_wifi_led "$boardname:green:wifi" ;; pbr-d1) - set_usb_led "$board:orange:usb" + set_usb_led "$boardname:orange:usb" ;; pbr-m1) - ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2" - ucidef_set_led_default "power" "power" "$board:blue:power" "1" - ucidef_set_led_default "sys" "sys" "$board:blue:sys" "1" + ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2" + ucidef_set_led_default "power" "power" "$boardname:blue:power" "1" + ucidef_set_led_default "sys" "sys" "$boardname:blue:sys" "1" + ;; +d-team,newifi-d2) + set_usb_led "$boardname:blue:usb" + ucidef_set_led_switch "internet" "internet" "$boardname:amber:internet" "switch0" "0x10" + ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "$boardname:blue:wlan2g" "wlan0" + ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "$boardname:blue:wlan5g" "wlan1" ;; psg1208) - set_wifi_led "$board:white:wlan2g" + set_wifi_led "$boardname:white:wlan2g" ;; psg1218a|\ psg1218b) - ucidef_set_led_netdev "Network" "Network" "$board:blue:status" "eth0" - ucidef_set_led_default "status" "STATUS" "$board:yellow:status" "0" + ucidef_set_led_netdev "Network" "Network" "$boardname:blue:status" "eth0" + ucidef_set_led_default "status" "STATUS" "$boardname:yellow:status" "0" ;; px-4885-4M|\ px-4885-8M) @@ -311,55 +332,80 @@ px-4885-8M) set_usb_led "px-4885:blue:storage" ;; r6220) - ucidef_set_led_netdev "wan" "wan" "$board:green:wan" eth0.2 - set_wifi_led "$board:green:wifi" - set_usb_led "$board:green:usb" + ucidef_set_led_netdev "wan" "wan" "$boardname:green:wan" eth0.2 + set_wifi_led "$boardname:green:wifi" + set_usb_led "$boardname:green:usb" ;; re350-v1) - ucidef_set_led_netdev "wifi2g" "Wifi 2.4G" "$board:blue:wifi2G" "wlan0" - ucidef_set_led_netdev "wifi5g" "Wifi 5G" "$board:blue:wifi5G" "wlan1" - ucidef_set_led_netdev "eth_act" "LAN act" "$board:green:eth_act" "eth0" "tx rx" - ucidef_set_led_switch "eth_link" "LAN link" "$board:green:eth_link" "switch0" "0x01" + ucidef_set_led_netdev "wifi2g" "Wifi 2.4G" "$boardname:blue:wifi2G" "wlan0" + ucidef_set_led_netdev "wifi5g" "Wifi 5G" "$boardname:blue:wifi5G" "wlan1" + ucidef_set_led_netdev "eth_act" "LAN act" "$boardname:green:eth_act" "eth0" "tx rx" + ucidef_set_led_switch "eth_link" "LAN link" "$boardname:green:eth_link" "switch0" "0x01" ;; re6500) - ucidef_set_led_default "power" "power" "$board:white:power" "1" - ucidef_set_led_default "wifi" "wifi" "$board:orange:wifi" "1" + ucidef_set_led_default "power" "power" "$boardname:white:power" "1" + ucidef_set_led_default "wifi" "wifi" "$boardname:orange:wifi" "1" ;; rp-n53) - ucidef_set_led_netdev "eth" "Network" "$board:white:back" "eth0" - set_wifi_led "$board:blue:wifi" + ucidef_set_led_netdev "eth" "Network" "$boardname:white:back" "eth0" + set_wifi_led "$boardname:blue:wifi" ;; rt-ac51u) - set_wifi_led "$board:blue:wifi" - set_usb_led "$board:blue:usb" "1-1" + set_wifi_led "$boardname:blue:wifi" + set_usb_led "$boardname:blue:usb" "1-1" + ;; +rt-n12p) + ucidef_set_led_default "power" "power" "$board:green:power" "1" + ucidef_set_led_netdev "lan" "lan" "$board:green:lan" eth0.1 + ucidef_set_led_netdev "wan" "wan" "$board:green:wan" eth0.2 + set_wifi_led "$board:green:air" ;; rt-n14u) - ucidef_set_led_default "power" "power" "$board:blue:power" "1" - ucidef_set_led_netdev "lan" "lan" "$board:blue:lan" eth0.1 - ucidef_set_led_netdev "wan" "wan" "$board:blue:wan" eth0.2 - set_wifi_led "$board:blue:air" - set_usb_led "$board:blue:usb" + ucidef_set_led_default "power" "power" "$boardname:blue:power" "1" + ucidef_set_led_netdev "lan" "lan" "$boardname:blue:lan" eth0.1 + ucidef_set_led_netdev "wan" "wan" "$boardname:blue:wan" eth0.2 + set_wifi_led "$boardname:blue:air" + set_usb_led "$boardname:blue:usb" ;; tew-714tru) - set_usb_led "$board:red:usb" - set_wifi_led "$board:green:wifi" + set_usb_led "$boardname:red:usb" + set_wifi_led "$boardname:green:wifi" ;; tiny-ac) - set_wifi_led "$board:orange:wifi" - set_usb_led "$board:green:usb" + set_wifi_led "$boardname:orange:wifi" + set_usb_led "$boardname:green:usb" ;; tl-wr840n-v4) - set_wifi_led "$board:green:wlan" - ucidef_set_led_switch "lan" "lan" "$board:green:lan" "switch0" "0x1e" - ucidef_set_led_switch "wan" "wan" "$board:green:wan" "switch0" "0x01" + set_wifi_led "$boardname:green:wlan" + ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e" + ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" ;; tl-wr841n-v13) - set_wifi_led "$board:green:wlan" - ucidef_set_led_switch "lan1" "lan1" "$board:green:lan1" "switch0" "0x2" - ucidef_set_led_switch "lan2" "lan2" "$board:green:lan2" "switch0" "0x4" - ucidef_set_led_switch "lan3" "lan3" "$board:green:lan3" "switch0" "0x8" - ucidef_set_led_switch "lan4" "lan4" "$board:green:lan4" "switch0" "0x10" - ucidef_set_led_switch "wan" "wan" "$board:green:wan" "switch0" "0x01" + set_wifi_led "$boardname:green:wlan" + ucidef_set_led_switch "lan1" "lan1" "$boardname:green:lan1" "switch0" "0x2" + ucidef_set_led_switch "lan2" "lan2" "$boardname:green:lan2" "switch0" "0x4" + ucidef_set_led_switch "lan3" "lan3" "$boardname:green:lan3" "switch0" "0x8" + ucidef_set_led_switch "lan4" "lan4" "$boardname:green:lan4" "switch0" "0x10" + ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" + ;; +tplink,tl-mr3420-v5) + set_usb_led "$boardname:green:usb" + set_wifi_led "$boardname:green:wlan" + ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e" + ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" + ;; +u25awf-h1) + set_wifi_led "u25awf:red:wifi" + ucidef_set_led_netdev "eth" "eth" "u25awf:green:lan" "eth0" + ;; +u7628-01-128M-16M) + ucidef_set_led_switch "lan1" "lan1" "u7628-01:green:lan1" "switch0" "0x2" + ucidef_set_led_switch "lan2" "lan2" "u7628-01:green:lan2" "switch0" "0x4" + ucidef_set_led_switch "lan3" "lan3" "u7628-01:green:lan3" "switch0" "0x8" + ucidef_set_led_switch "lan4" "lan4" "u7628-01:green:lan4" "switch0" "0x10" + ucidef_set_led_switch "wan" "wan" "u7628-01:green:wan" "switch0" "0x01" + set_usb_led "u7628-01:green:usb" + set_wifi_led "u7628-01:green:wlan" ;; vocore-8M|\ vocore-16M) @@ -367,69 +413,73 @@ vocore-16M) set_wifi_led "vocore:green:status" ;; vocore2) - set_wifi_led "$board:fuchsia:status" + set_wifi_led "$boardname:fuchsia:status" ;; vocore2lite) - set_wifi_led "$board:green:status" + set_wifi_led "$boardname:green:status" ;; w502u) - set_usb_led "$board:blue:usb" + set_usb_led "$boardname:blue:usb" set_wifi_led "rt2800pci-phy0::radio" ;; wcr-150gn) - set_usb_led "$board:amber:user" + set_usb_led "$boardname:amber:user" + ;; +we1026-5g-16m) + ucidef_set_led_netdev "lan" "LAN" "we1026-5g:green:lan" "eth0" + set_wifi_led "we1026-5g:green:wifi" + set_usb_led "we1026-5g:green:usb" "1-1.1" ;; whr-1166d|\ whr-300hp2|\ whr-600d) - ucidef_set_led_default "power" "power" "$board:green:power" "1" - ucidef_set_led_default "router" "router" "$board:green:router" "1" + ucidef_set_led_default "power" "power" "$boardname:green:power" "1" + ucidef_set_led_default "router" "router" "$boardname:green:router" "1" ;; wl-wn575a3) ucidef_set_rssimon "wlan1" "200000" "1" - ucidef_set_led_rssi "wifi-low" "wifi-low" "$board:green:wifi-low" "wlan1" "1" "49" - ucidef_set_led_rssi "wifi-med" "wifi-med" "$board:green:wifi-med" "wlan1" "50" "84" - ucidef_set_led_rssi "wifi-high" "wifi-high" "$board:green:wifi-high" "wlan1" "85" "100" + ucidef_set_led_rssi "wifi-low" "wifi-low" "$boardname:green:wifi-low" "wlan1" "1" "49" + ucidef_set_led_rssi "wifi-med" "wifi-med" "$boardname:green:wifi-med" "wlan1" "50" "84" + ucidef_set_led_rssi "wifi-high" "wifi-high" "$boardname:green:wifi-high" "wlan1" "85" "100" ;; wrh-300cr) - set_wifi_led "$board:green:wlan" - ucidef_set_led_netdev "lan" "lan" "$board:green:ethernet" "eth0" + set_wifi_led "$boardname:green:wlan" + ucidef_set_led_netdev "lan" "lan" "$boardname:green:ethernet" "eth0" ;; wndr3700v5) - ucidef_set_led_default "power" "POWER" "$board:green:power" "0" + ucidef_set_led_default "power" "POWER" "$boardname:green:power" "0" ;; wt3020-4M|\ wt3020-8M) ucidef_set_led_default "power" "power" "wt3020:blue:power" "0" ;; y1) - set_usb_led "$board:blue:usb" - ucidef_set_led_netdev "wifi" "WIFI" "$board:blue:wifi" "wlan1" - ucidef_set_led_netdev "wifi5g" "WIFI5G" "$board:blue:wifi5g" "wlan0" - ucidef_set_led_netdev "lan" "LAN" "$board:blue:lan" "eth0.1" "tx rx" - ucidef_set_led_netdev "wan" "WAN" "$board:blue:internet" "eth0.2" "tx rx" + set_usb_led "$boardname:blue:usb" + ucidef_set_led_netdev "wifi" "WIFI" "$boardname:blue:wifi" "wlan1" + ucidef_set_led_netdev "wifi5g" "WIFI5G" "$boardname:blue:wifi5g" "wlan0" + ucidef_set_led_switch "lan" "LAN" "$boardname:blue:lan" "switch0" "0x03" ;; y1s) - set_usb_led "$board:blue:usb" - ucidef_set_led_netdev "wifi" "WIFI" "$board:yellow:wifi" "wlan1" - ucidef_set_led_netdev "wifi5g" "WIFI5G" "$board:blue:wifi" "wlan0" - ucidef_set_led_netdev "wan" "WAN" "$board:blue:internet" "eth0.2" "tx rx" + set_usb_led "$boardname:blue:usb" + ucidef_set_led_netdev "wifi" "WIFI" "$boardname:yellow:wifi" "wlan1" + ucidef_set_led_netdev "wifi5g" "WIFI5G" "$boardname:blue:wifi" "wlan0" + ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:internet" "eth0.2" "tx rx" ;; zbt-ape522ii) - ucidef_set_led_netdev "wlan2g4" "wlan1-link" "$board:green:wlan2g4" "wlan1" - ucidef_set_led_netdev "sys1" "wlan1" "$board:green:sys1" "wlan1" "tx rx" - ucidef_set_led_netdev "sys2" "wlan0" "$board:green:sys2" "wlan0" "tx rx" + ucidef_set_led_netdev "wlan2g4" "wlan1-link" "$boardname:green:wlan2g4" "wlan1" + ucidef_set_led_netdev "sys1" "wlan1" "$boardname:green:sys1" "wlan1" "tx rx" + ucidef_set_led_netdev "sys2" "wlan0" "$boardname:green:sys2" "wlan0" "tx rx" ;; zbt-cpe102) - ucidef_set_led_default "power" "power" "$board:green:4g-0" "0" + ucidef_set_led_default "power" "power" "$boardname:green:4g-0" "0" ;; zbt-wa05) - ucidef_set_led_default "power" "power" "$board:blue:power" "1" - set_wifi_led "$board:blue:air" - set_usb_led "$board:blue:usb" + ucidef_set_led_default "power" "power" "$boardname:blue:power" "1" + set_wifi_led "$boardname:blue:air" + set_usb_led "$boardname:blue:usb" ;; zbt-we2026) - set_wifi_led "$board:green:wlan" + set_wifi_led "$boardname:green:wlan" ;; zbt-we826-16M|\ zbt-we826-32M) @@ -437,17 +487,17 @@ zbt-we826-32M) set_usb_led "zbt-we826:green:usb" ;; zbt-wr8305rt) - ucidef_set_led_default "power" "power" "$board:green:sys" "1" - set_usb_led "$board:green:usb" - set_wifi_led "$board:green:wifi" + ucidef_set_led_default "power" "power" "$boardname:green:sys" "1" + set_usb_led "$boardname:green:usb" + set_wifi_led "$boardname:green:wifi" ;; zte-q7) - set_wifi_led "$board:blue:status" + set_wifi_led "$boardname:blue:status" ;; youku-yk1) - ucidef_set_led_default "power" "power" "$board:blue:power" "1" - set_wifi_led "$board:blue:air" - set_usb_led "$board:blue:usb" + set_wifi_led "$boardname:blue:air" + set_usb_led "$boardname:blue:usb" + ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x10" ;; esac diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network index 9284b1812f..105f5e9e32 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -49,7 +49,6 @@ ramips_setup_interfaces() dcs-930l-b1|\ ht-tm02|\ linkits7688 | \ - linkits7688d | \ m2m|\ microwrt|\ mpr-a2|\ @@ -72,6 +71,7 @@ ramips_setup_interfaces() ;; 3g-6200n|\ ai-br100|\ + alfa-network,ac1200rm|\ d240|\ db-wrt01|\ dir-300-b7|\ @@ -93,6 +93,7 @@ ramips_setup_interfaces() mt7628|\ mzk-750dhp|\ mzk-w300nh2|\ + d-team,newifi-d2|\ nixcore-x1-8M|\ nixcore-x1-16M|\ oy-0001|\ @@ -100,8 +101,10 @@ ramips_setup_interfaces() psg1208|\ psg1218a|\ r6220|\ + rt-n12p|\ sap-g3200u3|\ sk-wb8|\ + u7621-06-256M-16M|\ vr500|\ wf-2881|\ witi|\ @@ -109,10 +112,10 @@ ramips_setup_interfaces() wndr3700v5|\ wt1520-4M|\ wt1520-8M|\ - y1|\ youku-yk1|\ zbt-ape522ii|\ zbt-we1326|\ + zbtlink,zbt-we3526|\ zbt-we826-16M|\ zbt-we826-32M|\ zbt-wg2626|\ @@ -124,7 +127,7 @@ ramips_setup_interfaces() ;; mir3g) ucidef_add_switch "switch0" \ - "1:wan" "2:lan:2" "3:lan:1" "6@eth0" + "2:lan:2" "3:lan:1" "1:wan" "6t@eth0" ;; psg1218b) ucidef_add_switch "switch0" \ @@ -170,8 +173,11 @@ ramips_setup_interfaces() mzk-wdpr|\ rb750gr3|\ rt-n14u|\ + tplink,tl-mr3420-v5|\ tl-wr840n-v4|\ + tl-wr840n-v5|\ tl-wr841n-v13|\ + u7628-01-128M-16M|\ ubnt-erx|\ ubnt-erx-sfp|\ ur-326n4g|\ @@ -184,6 +190,7 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0" ;; + c20|\ c50) ucidef_add_switch "switch0" \ "1:lan:3" "2:lan:4" "3:lan:1" "4:lan:2" "0:wan" "6@eth0" @@ -236,6 +243,7 @@ ramips_setup_interfaces() mzk-ex750np|\ na930|\ pbr-d1|\ + u25awf-h1|\ wli-tx4-ag300n|\ wmdr-143n|\ wmr-300|\ @@ -307,6 +315,10 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0" ;; + vonets,var11n-300) + ucidef_add_switch "switch0" \ + "0:lan" "4:wan" "6@eth0" + ;; vocore2|\ vocore2lite) ucidef_add_switch "switch0" \ @@ -323,7 +335,8 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "3:lan" "4:wan" "6@eth0" ;; - wcr-150gn) + wcr-150gn|\ + we1026-5g-16m) ucidef_add_switch "switch0" \ "0:lan" "6t@eth0" ;; @@ -335,6 +348,10 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan" "2:lan" "0:wan" "6@eth0" ;; + y1) + ucidef_add_switch "switch0" \ + "0:lan:2" "1:lan:1" "4:wan" "6@eth0" + ;; *) RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350)"` if [ -n "${RT3X5X}" ]; then @@ -417,8 +434,7 @@ ramips_setup_macs() kng_rc) wan_mac=$(mtd_get_mac_binary factory 40) ;; - linkits7688 | \ - linkits7688d) + linkits7688) wan_mac=$(mtd_get_mac_binary factory 4) lan_mac=$(mtd_get_mac_binary factory 46) ;; @@ -427,7 +443,7 @@ ramips_setup_macs() wan_mac=$(macaddr_add "$lan_mac" 1) ;; mir3g) - lan_mac=$(mtd_get_mac_binary Factory e006) + lan_mac=$(mtd_get_mac_binary Factory 0xe006) ;; miwifi-mini) wan_mac=$(cat /sys/class/net/eth0/address) diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index 75171673bb..e1d29152f1 100644 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -6,12 +6,13 @@ get_status_led() { board=$(board_name) + boardname="${board##*,}" case $board in 3g150b|\ 3g300m|\ w150m) - status_led="$board:blue:ap" + status_led="$boardname:blue:ap" ;; 3g-6200n|\ ar670w|\ @@ -24,6 +25,8 @@ get_status_led() { ex2700|\ ex3700|\ fonera20n|\ + firewrt|\ + hg255d|\ kn|\ kn_rc|\ kn_rf|\ @@ -35,7 +38,9 @@ get_status_led() { nbg-419n2|\ pwh2004|\ r6220|\ + tplink,tl-mr3420-v5|\ tl-wr840n-v4|\ + tl-wr840n-v5|\ tl-wr841n-v13|\ vr500|\ wnce2001|\ @@ -44,10 +49,10 @@ get_status_led() { x8|\ xdxrn502j|\ wn3000rpv3) - status_led="$board:green:power" + status_led="$boardname:green:power" ;; 3g-6200nl) - status_led="$board:green:internet" + status_led="$boardname:green:internet" ;; a5-v11|\ cs-qr10|\ @@ -58,11 +63,18 @@ get_status_led() { mpr-a1|\ mpr-a2|\ mzk-ex750np) - status_led="$board:red:power" + status_led="$boardname:red:power" ;; ai-br100|\ ht-tm02) - status_led="$board:blue:wlan" + status_led="$boardname:blue:wlan" + ;; + alfa-network,ac1200rm|\ + awapn2403|\ + dir-645|\ + sk-wb8|\ + wrh-300cr) + status_led="$boardname:green:wps" ;; all0239-3g|\ dcs-930|\ @@ -86,7 +98,7 @@ get_status_led() { v11st-fe|\ wmr-300|\ zbt-wg2626) - status_led="$board:green:status" + status_led="$boardname:green:status" ;; asl26555-8M|\ asl26555-16M) @@ -95,32 +107,28 @@ get_status_led() { atp-52b|\ ew1200|\ ip2202) - status_led="$board:green:run" - ;; - awapn2403|\ - dir-645|\ - sk-wb8|\ - wrh-300cr) - status_led="$board:green:wps" + status_led="$boardname:green:run" ;; c108) - status_led="$board:green:lan" + status_led="$boardname:green:lan" ;; cf-wr800n|\ psg1208) - status_led="$board:white:wps" + status_led="$boardname:white:wps" ;; psg1218a|\ psg1218b) - status_led="$board:yellow:status" + status_led="$boardname:yellow:status" ;; cy-swr1100|\ w502u) - status_led="$board:blue:wps" + status_led="$boardname:blue:wps" ;; + c20|\ d240|\ dap-1350|\ na930|\ + d-team,newifi-d2|\ pbr-m1|\ re350-v1|\ rt-ac51u|\ @@ -132,83 +140,84 @@ get_status_led() { wl-330n3g|\ wli-tx4-ag300n|\ y1|\ - y1s) - status_led="$board:blue:power" + y1s|\ + youku-yk1) + status_led="$boardname:blue:power" ;; db-wrt01|\ esr-9753|\ pbr-d1) - status_led="$board:orange:power" + status_led="$boardname:orange:power" ;; f5d8235-v1) - status_led="$board:blue:wired" + status_led="$boardname:blue:wired" ;; f5d8235-v2) - status_led="$board:blue:router" + status_led="$boardname:blue:router" ;; f7c027|\ timecloud) - status_led="$board:orange:status" + status_led="$boardname:orange:status" ;; hc5*61|\ hc5661a|\ jhr-n805r|\ jhr-n926r|\ mlw221|\ - mlwg2) - status_led="$board:blue:system" + mlwg2|\ + vonets,var11n-300) + status_led="$boardname:blue:system" ;; hc5962) - status_led="$board:white:status" + status_led="$boardname:white:status" ;; k2p|\ m3|\ miwifi-nano) - status_led="$board:blue:status" + status_led="$boardname:blue:status" ;; - linkits7688| \ - linkits7688d) - [ "$1" = "upgrade" ] && status_led="mediatek:orange:wifi" + linkits7688) + status_led="linkit-smart-7688:orange:wifi" ;; m2m) - status_led="$board:blue:wifi" + status_led="$boardname:blue:wifi" ;; gl-mt300n-v2) - status_led="$board:red:wlan" + status_led="$boardname:red:wlan" ;; m4-4M|\ m4-8M) status_led="m4:blue:status" ;; mir3g) - status_led="$board:yellow:status" + status_led="$boardname:yellow:status" ;; miwifi-mini|\ zte-q7) - status_led="$board:red:status" + status_led="$boardname:red:status" ;; mr-102n) - status_led="$board:amber:status" + status_led="$boardname:amber:status" ;; mr200) - status_led="$board:white:power" + status_led="$boardname:white:power" ;; nw718) - status_led="$board:amber:cpu" + status_led="$boardname:amber:cpu" ;; newifi-d1) - status_led="$board:blue:status" + status_led="$boardname:blue:status" ;; omega2| \ omega2p) - status_led="$board:amber:system" + status_led="$boardname:amber:system" ;; oy-0001|\ sl-r7205) - status_led="$board:green:wifi" + status_led="$boardname:green:wifi" ;; psr-680w) - status_led="$board:red:wan" + status_led="$boardname:red:wan" ;; px-4885-4M|\ px-4885-8M) @@ -216,9 +225,8 @@ get_status_led() { ;; re6500|\ whr-1166d|\ - whr-600d|\ - widora-neo) - status_led="$board:orange:wifi" + whr-600d) + status_led="$boardname:orange:wifi" ;; mzk-ex300np|\ rt-n10-plus|\ @@ -228,52 +236,64 @@ get_status_led() { ur-326n4g|\ ur-336un|\ wf-2881) - status_led="$board:green:wps" + status_led="$boardname:green:wps" ;; rb750gr3) - status_led="$board:blue:pwr" + status_led="$boardname:blue:pwr" ;; sap-g3200u3) - status_led="$board:green:usb" + status_led="$boardname:green:usb" + ;; + u25awf-h1) + status_led="u25awf:red:wifi" + ;; + u7621-06-256M-16M) + status_led="u7621-06:green:status" + ;; + u7628-01-128M-16M) + status_led="u7628-01:green:power" ;; v22rw-2x2) - status_led="$board:green:security" + status_led="$boardname:green:security" ;; vocore-8M|\ vocore-16M) status_led="vocore:green:status" ;; vocore2) - status_led="$board:fuchsia:status" + status_led="$boardname:fuchsia:status" ;; vocore2lite) - status_led="$board:green:status" + status_led="$boardname:green:status" ;; w306r-v20|\ witi|\ zbt-wr8305rt) - status_led="$board:green:sys" + status_led="$boardname:green:sys" ;; wcr-1166ds|\ whr-300hp2|\ wsr-1166|\ wsr-600) - status_led="$board:green:power" + status_led="$boardname:green:power" ;; wcr-150gn|\ wl-351) - status_led="$board:amber:power" + status_led="$boardname:amber:power" ;; whr-g300n|\ wlr-6000|\ zbt-we2026) - status_led="$board:red:power" + status_led="$boardname:red:power" + ;; + widora-neo) + status_led="widora:orange:wifi" ;; wzr-agl300nh) - status_led="$board:green:router" + status_led="$boardname:green:router" ;; wizfi630a) - status_led="$board::run" + status_led="$boardname::run" ;; wr512-3gn-4M|\ wr512-3gn-8M) @@ -289,7 +309,7 @@ get_status_led() { status_led="wt3020:blue:power" ;; zbt-cpe102) - status_led="$board:green:4g-0" + status_led="$boardname:green:4g-0" ;; zbt-we826-16M|\ zbt-we826-32M) diff --git a/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips b/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips index 452b1b203f..5048dacb4f 100644 --- a/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips +++ b/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips @@ -6,17 +6,22 @@ . /lib/ramips.sh ramips_set_preinit_iface() { - RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350|MT7628|MT7688|MT7620)"` + RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350|MT7628|MT7688|MT7620|MT7621)"` if [ -n "${RT3X5X}" ]; then # The ethernet switch driver enables VLAN by default, but # failsafe uses eth0, making the device unreachable: # https://dev.openwrt.org/ticket/18768 - ralink_switchdev=rt305x case "${RT3X5X}" in *MT7620*) ralink_switchdev=mt7620 ;; + *MT7621*) + ralink_switchdev=mt7530 + ;; + *) + ralink_switchdev=rt305x + ;; esac swconfig dev $ralink_switchdev set reset 1 swconfig dev $ralink_switchdev set enable_vlan 0 diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 174e29e434..e85b293610 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -3,9 +3,6 @@ # Copyright (C) 2010-2013 OpenWrt.org # -RAMIPS_BOARD_NAME= -RAMIPS_MODEL= - ramips_board_detect() { local machine local name @@ -88,6 +85,9 @@ ramips_board_detect() { *"C108") name="c108" ;; + *"C20") + name="c20" + ;; *"C20i") name="c20i" ;; @@ -275,13 +275,7 @@ ramips_board_detect() { name="m4-8M" ;; *"MediaTek LinkIt Smart 7688") - linkit="$(dd bs=1 skip=1024 count=12 if=/dev/mtd2 2> /dev/null)" - if [ "${linkit}" = "LINKITS7688D" ]; then - name="linkits7688d" - RAMIPS_MODEL="${machine} DUO" - else - name="linkits7688" - fi + name="linkits7688" ;; *"Memory 2 Move") name="m2m" @@ -457,6 +451,9 @@ ramips_board_detect() { *"RT-N10+") name="rt-n10-plus" ;; + *"RT-N12+") + name="rt-n12p" + ;; *"RT-N13U") name="rt-n13u" ;; @@ -499,9 +496,21 @@ ramips_board_detect() { *"TL-WR840N v4") name="tl-wr840n-v4" ;; + *"TL-WR840N v5") + name="tl-wr840n-v5" + ;; *"TL-WR841N v13") name="tl-wr841n-v13" ;; + *"U25AWF-H1") + name="u25awf-h1" + ;; + *"U7621-06 (256M RAM/16M flash)") + name="u7621-06-256M-16M" + ;; + *"U7628-01 (128M RAM/16M flash)") + name="u7628-01-128M-16M" + ;; *"UBNT-ERX") name="ubnt-erx" ;; @@ -553,6 +562,9 @@ ramips_board_detect() { *"WCR-150GN") name="wcr-150gn" ;; + *"WE1026-5G (16M)") + name="we1026-5g-16m" + ;; *"WF-2881") name="wf-2881" ;; @@ -718,16 +730,13 @@ ramips_board_detect() { *"YK1") name="youku-yk1" ;; - *) - name="generic" - ;; esac - [ -z "$RAMIPS_BOARD_NAME" ] && RAMIPS_BOARD_NAME="$name" - [ -z "$RAMIPS_MODEL" ] && RAMIPS_MODEL="$machine" + # use generic board detect if no name is set + [ -z "$name" ] && return [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" - echo "$RAMIPS_BOARD_NAME" > /tmp/sysinfo/board_name - echo "$RAMIPS_MODEL" > /tmp/sysinfo/model + echo "$name" > /tmp/sysinfo/board_name + echo "$machine" > /tmp/sysinfo/model } diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 5cfca52ab1..cd21001324 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -16,6 +16,7 @@ platform_check_image() { a5-v11|\ ai-br100|\ air3gii|\ + alfa-network,ac1200rm|\ all0239-3g|\ all0256n-4M|\ all0256n-8M|\ @@ -81,7 +82,6 @@ platform_check_image() { kn_rf|\ kng_rc|\ linkits7688|\ - linkits7688d|\ m2m|\ m3|\ m4-4M|\ @@ -108,6 +108,7 @@ platform_check_image() { nbg-419n|\ nbg-419n2|\ newifi-d1|\ + d-team,newifi-d2|\ nixcore-x1-8M|\ nixcore-x1-16M|\ nw718|\ @@ -130,6 +131,7 @@ platform_check_image() { rt-ac51u|\ rt-g32-b1|\ rt-n10-plus|\ + rt-n12p|\ rt-n13u|\ rt-n14u|\ rt-n15|\ @@ -144,9 +146,13 @@ platform_check_image() { tew-714tru|\ timecloud|\ tiny-ac|\ + u25awf-h1|\ + u7621-06-256M-16M|\ + u7628-01-128M-16M|\ ur-326n4g|\ ur-336un|\ v22rw-2x2|\ + vonets,var11n-300|\ vocore-8M|\ vocore-16M|\ vocore2|\ @@ -193,11 +199,13 @@ platform_check_image() { x8|\ y1|\ y1s|\ + we1026-5g-16m|\ zbt-ape522ii|\ zbt-cpe102|\ zbt-wa05|\ zbt-we1326|\ zbt-we2026|\ + zbtlink,zbt-we3526|\ zbt-we826-16M|\ zbt-we826-32M|\ zbt-wg2626|\ @@ -229,10 +237,13 @@ platform_check_image() { } return 0 ;; + c20|\ c20i|\ c50|\ mr200|\ + tplink,tl-mr3420-v5|\ tl-wr840n-v4|\ + tl-wr840n-v5|\ tl-wr841n-v13) [ "$magic" != "03000000" ] && { echo "Invalid image type." diff --git a/target/linux/ramips/dts/AC1200RM.dts b/target/linux/ramips/dts/AC1200RM.dts new file mode 100644 index 0000000000..9305cb00e0 --- /dev/null +++ b/target/linux/ramips/dts/AC1200RM.dts @@ -0,0 +1,171 @@ +/* + * BSD LICENSE + * + * Copyright (C) 2018 Piotr Dymacz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the names of the copyright holders nor the names of any + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/dts-v1/; + +#include "mt7620a.dtsi" + +#include +#include + +/ { + compatible = "alfa-network,ac1200rm", "ralink,mt7620a-soc"; + model = "ALFA Network AC1200RM"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio2 15 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + wlan2g { + label = "ac1200rm:green:wlan2g"; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "ac1200rm:green:wps"; + gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&ehci { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x28>; + mediatek,portmap = "llllw"; + pinctrl-names = "default"; + pinctrl-0 = <&ephy_pins>; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&gsw { + mediatek,port4 = "ephy"; +}; + +&ohci { + status = "okay"; +}; + +&pcie { + status = "okay"; + + pcie-bridge { + mt76@0,0 { + reg = <0x0000 0 0 0 0>; + device_type = "pci"; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + + led { + led-sources = <2>; + led-active-low; + }; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "nd_sd", "spi refclk", "wled"; + ralink,function = "gpio"; + }; + }; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "config"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0>; +}; diff --git a/target/linux/ramips/dts/ArcherC20.dts b/target/linux/ramips/dts/ArcherC20.dts new file mode 100644 index 0000000000..f0281c37c3 --- /dev/null +++ b/target/linux/ramips/dts/ArcherC20.dts @@ -0,0 +1,187 @@ +/dts-v1/; + +#include "mt7620a.dtsi" + +#include +#include + +/ { + compatible = "tplink,c20", "ralink,mt7620a-soc"; + model = "TP-Link Archer C20"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + gpio-leds { + compatible = "gpio-leds"; + + lan { + label = "c20:blue:lan"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + }; + + power { + label = "c20:blue:power"; + gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; + default-state = "keep"; + }; + + usb { + label = "c20:blue:usb"; + gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "c20:blue:wan"; + gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; + }; + + wan_orange { + label = "c20:orange:wan"; + gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>; + }; + + wlan5g { + label = "c20:blue:wlan5g"; + gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "c20:blue:wlan2g"; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "c20:blue:wps"; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + rfkill { + label = "rfkill"; + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + linux,code = ; + }; }; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x20000>; + read-only; + }; + + partition@20000 { + label = "firmware"; + reg = <0x20000 0x7a0000>; + }; + + partition@7c0000 { + label = "config"; + reg = <0x7c0000 0x10000>; + read-only; + }; + + rom: partition@7d0000 { + label = "rom"; + reg = <0x7d0000 0x10000>; + read-only; + }; + + partition@7e0000 { + label = "romfile"; + reg = <0x7e0000 0x10000>; + read-only; + }; + + radio: partition@7f0000 { + label = "radio"; + reg = <0x7f0000 0x10000>; + read-only; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "uartf", "wled", "ephy", "spi refclk", "wdt"; + ralink,function = "gpio"; + }; + }; +}; + +ðernet { + pinctrl-names = "default"; + mtd-mac-address = <&rom 0xf100>; + mediatek,portmap = "wllll"; + }; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +&gsw { + mediatek,port4 = "ephy"; +}; + +&wmac { + ralink,mtd-eeprom = <&radio 0>; + mtd-mac-address = <&rom 0xf100>; + mtd-mac-address-increment = <(-2)>; + pinctrl-names = "default"; + pinctrl-0 = <&pa_pins>; +}; + +&pcie { + status = "okay"; + + pcie-bridge { + mt76@0,0 { + reg = <0x0000 0 0 0 0>; + device_type = "pci"; + mediatek,mtd-eeprom = <&radio 32768>; + ieee80211-freq-limit = <5000000 6000000>; + mtd-mac-address = <&rom 0xf100>; + mtd-mac-address-increment = <(-1)>; + }; + }; +}; diff --git a/target/linux/ramips/dts/ArcherC50.dts b/target/linux/ramips/dts/ArcherC50.dts index e8729232b0..88bd3272d7 100644 --- a/target/linux/ramips/dts/ArcherC50.dts +++ b/target/linux/ramips/dts/ArcherC50.dts @@ -142,11 +142,6 @@ ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "ephy", "spi refclk", "mdio", "wdt", "nd_sd"; ralink,function = "gpio"; }; - - pa { - ralink,group = "pa"; - ralink,function = "pa"; - }; }; }; @@ -172,6 +167,8 @@ ralink,mtd-eeprom = <&radio 0>; mtd-mac-address = <&rom 0xf100>; mtd-mac-address-increment = <(-2)>; + pinctrl-names = "default"; + pinctrl-0 = <&pa_pins>; }; &pcie { diff --git a/target/linux/ramips/dts/ArcherMR200.dts b/target/linux/ramips/dts/ArcherMR200.dts index 2736a05b35..ec28d39672 100644 --- a/target/linux/ramips/dts/ArcherMR200.dts +++ b/target/linux/ramips/dts/ArcherMR200.dts @@ -92,7 +92,7 @@ power_usb { gpio-export,name = "power_usb1"; gpio-export,output = <1>; - gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; }; }; diff --git a/target/linux/ramips/dts/BR-6475ND.dts b/target/linux/ramips/dts/BR-6475ND.dts index 4e52da04b5..11611b083f 100644 --- a/target/linux/ramips/dts/BR-6475ND.dts +++ b/target/linux/ramips/dts/BR-6475ND.dts @@ -103,7 +103,7 @@ usb { gpio-export,name="usb"; gpio-export,output=<0>; - gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 19 GPIO_ACTIVE_LOW>; }; }; */ diff --git a/target/linux/ramips/dts/D240.dts b/target/linux/ramips/dts/D240.dts index 4f3da8d316..392e92d466 100644 --- a/target/linux/ramips/dts/D240.dts +++ b/target/linux/ramips/dts/D240.dts @@ -52,9 +52,16 @@ power_mpcie2 { gpio-export,name = "power_mpcie2"; - gpio-export,output = ; - gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; + gpio-export,output = <1>; + gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>; }; + + power_mpcie1 { + gpio-export,name = "power_mpcie1"; + gpio-export,output = <1>; + gpios = <&gpio2 6 GPIO_ACTIVE_HIGH>; + }; + }; gpio-leds { @@ -94,6 +101,10 @@ status = "okay"; }; +&gpio2 { + status = "okay"; +}; + &gpio3 { status = "okay"; }; @@ -157,7 +168,7 @@ &pinctrl { state_default: pinctrl0 { default { - ralink,group = "i2c", "uartf", "wled", "spi refclk", "pa"; + ralink,group = "i2c", "uartf", "wled", "spi refclk", "pa", "nd_sd"; ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/DCH-M225.dts b/target/linux/ramips/dts/DCH-M225.dts index 867335e957..1aea90805c 100644 --- a/target/linux/ramips/dts/DCH-M225.dts +++ b/target/linux/ramips/dts/DCH-M225.dts @@ -90,7 +90,7 @@ #sound-dai-cells = <0>; status = "okay"; pinctrl-names = "default"; - pinctrl-0 = <&gpio_i2s_pins>, <&wm8960_mclk_pins>; + pinctrl-0 = <&mdio_refclk_pins>; }; &spi0 { @@ -158,16 +158,9 @@ ralink,function = "gpio"; }; - pa { - ralink,group = "pa"; - ralink,function = "pa"; - }; - - wm8960_mclk_pins: wm8960_mclk { - wm8960_mclk { - ralink,group = "mdio"; - ralink,function = "refclk"; - }; + gpio_i2s { + ralink,group = "uartf"; + ralink,function = "gpio i2s"; }; }; }; @@ -182,5 +175,6 @@ &wmac { ralink,mtd-eeprom = <&factory 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pa_pins>; }; - diff --git a/target/linux/ramips/dts/DIR-615-H1.dts b/target/linux/ramips/dts/DIR-615-H1.dts index 9e8b86ed7c..7d410f1ddc 100644 --- a/target/linux/ramips/dts/DIR-615-H1.dts +++ b/target/linux/ramips/dts/DIR-615-H1.dts @@ -99,21 +99,13 @@ ralink,group = "i2c", "jtag", "uartf"; ralink,function = "gpio"; }; - - rgmii { - ralink,group = "rgmii"; - ralink,function = "rgmii"; - }; - - mdio { - ralink,group = "mdio"; - ralink,function = "mdio"; - }; }; }; ðernet { mtd-mac-address = <&factory 0x28>; + pinctrl-names = "default"; + pinctrl-0 = <&rgmii_pins &mdio_pins>; }; &esw { diff --git a/target/linux/ramips/dts/DIR-620-D1.dts b/target/linux/ramips/dts/DIR-620-D1.dts index baf17e7331..2def8aae4a 100644 --- a/target/linux/ramips/dts/DIR-620-D1.dts +++ b/target/linux/ramips/dts/DIR-620-D1.dts @@ -78,21 +78,13 @@ ralink,group = "i2c", "jtag", "uartf"; ralink,function = "gpio"; }; - - rgmii { - ralink,group = "rgmii"; - ralink,function = "rgmii"; - }; - - mdio { - ralink,group = "mdio"; - ralink,function = "mdio"; - }; }; }; ðernet { mtd-mac-address = <&factory 0x4>; + pinctrl-names = "default"; + pinctrl-0 = <&rgmii_pins &mdio_pins>; }; &esw { diff --git a/target/linux/ramips/dts/DUZUN-DM06.dts b/target/linux/ramips/dts/DUZUN-DM06.dts index 97625d875e..b8261a591e 100644 --- a/target/linux/ramips/dts/DUZUN-DM06.dts +++ b/target/linux/ramips/dts/DUZUN-DM06.dts @@ -63,20 +63,6 @@ ralink,function = "gpio"; }; }; - - i2s_pins: i2s { - i2s { - ralink,group = "i2s"; - ralink,function = "i2s"; - }; - }; - - wm8960_mclk_pins: wm8960_mclk { - wm8960_mclk { - ralink,group = "refclk"; - ralink,function = "reclk"; - }; - }; }; &gpio1 { @@ -108,7 +94,7 @@ #sound-dai-cells = <0>; status = "okay"; pinctrl-names = "default"; - pinctrl-0 = <&i2s_pins>, <&wm8960_mclk_pins>; + pinctrl-0 = <&i2s_pins>, <&refclk_pins>; }; &sdhci { diff --git a/target/linux/ramips/dts/DWR-512-B.dts b/target/linux/ramips/dts/DWR-512-B.dts index f531df80a1..afcac21c6c 100644 --- a/target/linux/ramips/dts/DWR-512-B.dts +++ b/target/linux/ramips/dts/DWR-512-B.dts @@ -68,7 +68,7 @@ modem3g_enable { gpio-export,name = "modem3g_enable"; gpio-export,output = <1>; - gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>; }; }; }; diff --git a/target/linux/ramips/dts/EW1200.dts b/target/linux/ramips/dts/EW1200.dts index e6b96fa2b0..84c4f72cb6 100644 --- a/target/linux/ramips/dts/EW1200.dts +++ b/target/linux/ramips/dts/EW1200.dts @@ -121,7 +121,7 @@ &pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "wdt", "rgmii2", "wdt rst", "jtag", "mdio"; + ralink,group = "wdt", "rgmii2", "jtag", "mdio"; ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/GB-PC1.dts b/target/linux/ramips/dts/GB-PC1.dts index df7caa9100..664dfa1efd 100644 --- a/target/linux/ramips/dts/GB-PC1.dts +++ b/target/linux/ramips/dts/GB-PC1.dts @@ -102,6 +102,11 @@ }; }; +&cpuclock { + compatible = "fixed-clock"; + clock-frequency = <90000000>; +}; + &pcie { status = "okay"; }; diff --git a/target/linux/ramips/dts/GL-MT300N-V2.dts b/target/linux/ramips/dts/GL-MT300N-V2.dts index e7df340eec..8db3d4bc91 100644 --- a/target/linux/ramips/dts/GL-MT300N-V2.dts +++ b/target/linux/ramips/dts/GL-MT300N-V2.dts @@ -64,7 +64,7 @@ usb { gpio-export,name = "usb"; gpio-export,output = <1>; - gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; }; }; diff --git a/target/linux/ramips/dts/HC5861.dts b/target/linux/ramips/dts/HC5861.dts index d4f34b32d1..8773588e3e 100644 --- a/target/linux/ramips/dts/HC5861.dts +++ b/target/linux/ramips/dts/HC5861.dts @@ -42,13 +42,13 @@ usbpower { gpio-export,name = "usbpower"; gpio-export,output = <0>; - gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; }; sdpower { gpio-export,name = "sdpower"; gpio-export,output = <0>; - gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; }; }; }; diff --git a/target/linux/ramips/dts/HC5X61.dtsi b/target/linux/ramips/dts/HC5X61.dtsi index 1a5927dfd4..f0b59ecf11 100644 --- a/target/linux/ramips/dts/HC5X61.dtsi +++ b/target/linux/ramips/dts/HC5X61.dtsi @@ -122,6 +122,8 @@ &wmac { ralink,mtd-eeprom = <&factory 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pa_pins>; }; &pcie { @@ -134,10 +136,5 @@ ralink,group = "uartf", "wled", "nd_sd"; ralink,function = "gpio"; }; - - pa { - ralink,group = "pa"; - ralink,function = "pa"; - }; }; }; diff --git a/target/linux/ramips/dts/JHR-N926R.dts b/target/linux/ramips/dts/JHR-N926R.dts index 93310e1287..d1d2627f26 100644 --- a/target/linux/ramips/dts/JHR-N926R.dts +++ b/target/linux/ramips/dts/JHR-N926R.dts @@ -72,7 +72,7 @@ display_data { gpio-export,name = "display_data"; gpio-export,output = <1>; - gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; + gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; }; display_clock { diff --git a/target/linux/ramips/dts/K2P.dts b/target/linux/ramips/dts/K2P.dts index 4089ce64f5..db4dc29878 100644 --- a/target/linux/ramips/dts/K2P.dts +++ b/target/linux/ramips/dts/K2P.dts @@ -106,7 +106,7 @@ }; ðernet { - mtd-mac-address = <&factory 0xe000>; + mtd-mac-address = <&factory 0xe006>; }; &pinctrl { diff --git a/target/linux/ramips/dts/LINKIT7688.dts b/target/linux/ramips/dts/LINKIT7688.dts index f21ffcca66..a81a2d5a4c 100644 --- a/target/linux/ramips/dts/LINKIT7688.dts +++ b/target/linux/ramips/dts/LINKIT7688.dts @@ -6,7 +6,7 @@ #include / { - compatible = "mediatek,linkit", "mediatek,mt7628an-soc"; + compatible = "mediatek,linkit-smart-7688", "mediatek,mt7628an-soc"; model = "MediaTek LinkIt Smart 7688"; chosen { @@ -32,9 +32,8 @@ compatible = "gpio-leds"; wifi { - label = "mediatek:orange:wifi"; - gpios = <&wgpio 0 GPIO_ACTIVE_HIGH>; - default-state = "on"; + label = "linkit-smart-7688:orange:wifi"; + gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; }; }; @@ -50,14 +49,6 @@ linux,code = ; }; }; - - wgpio: gpio-wifi { - compatible = "mediatek,gpio-wifi"; - #address-cells = <1>; - #size-cells = <0>; - gpio-controller; - #gpio-cells = <2>; - }; }; &pinctrl { @@ -67,11 +58,6 @@ ralink,function = "gpio"; }; - perst { - ralink,group = "perst"; - ralink,function = "gpio"; - }; - refclk { ralink,group = "refclk"; ralink,function = "gpio"; @@ -87,14 +73,9 @@ ralink,function = "gpio"; }; - wled_kn { - ralink,group = "wled_kn"; - ralink,function = "gpio"; - }; - wled_an { ralink,group = "wled_an"; - ralink,function = "wled_an"; + ralink,function = "gpio"; }; wdt { diff --git a/target/linux/ramips/dts/MIR3G.dts b/target/linux/ramips/dts/MIR3G.dts index 0cdb6d57f3..efe98b0e10 100644 --- a/target/linux/ramips/dts/MIR3G.dts +++ b/target/linux/ramips/dts/MIR3G.dts @@ -21,20 +21,36 @@ gpio-leds { compatible = "gpio-leds"; - wan { - label = "mir3g:red:wan"; + status_red { + label = "mir3g:red:status"; gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; }; - usb { - label = "mir3g:blue:usb"; + status_blue { + label = "mir3g:blue:status"; gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; }; - status { + status_yellow { label = "mir3g:yellow:status"; gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; }; + + wan_amber { + label = "mir3g:amber:wan"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + }; + + lan1_amber { + label = "mir3g:amber:lan1"; + gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; + }; + + lan2_amber { + label = "mir3g:amber:lan2"; + gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; + }; + }; gpio-keys-polled { @@ -45,10 +61,21 @@ reset { label = "reset"; - gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; linux,code = ; }; }; + + gpio_export { + compatible = "gpio-export"; + #size-cells = <0>; + + usbpower { + gpio-export,name = "usbpower"; + gpio-export,output = <1>; + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + }; + }; }; &nand { @@ -63,7 +90,6 @@ partition@80000 { label = "Config"; reg = <0x80000 0x40000>; - read-only; }; partition@c0000 { @@ -81,13 +107,11 @@ partition@140000 { label = "crash"; reg = <0x140000 0x40000>; - read-only; }; partition@180000 { label = "crash_syslog"; reg = <0x180000 0x40000>; - read-only; }; partition@1c0000 { @@ -96,15 +120,22 @@ read-only; }; - /* - * kernel0 partition should be erased, so - * u-boot in failsafe routine switches - * to next one looking for kernel image. - * To remind about this fact rename kernel0 - * into kernel_erase. + /* uboot expects to find kernels at 0x200000 & 0x600000 + * referred to as system 1 & system 2 respectively. + * a kernel is considered suitable for handing control over + * if its linux magic number exists & uImage CRC are correct. + * If either of those conditions fail, a matching sys'n'_fail flag + * is set in uboot env & a restart performed in the hope that the + * alternate kernel is okay. + * if neither kernel checksums ok and both are marked failed, system 2 + * is booted anyway. + * + * Note uboot's tftp flash install writes the transferred + * image to both kernel partitions. */ + partition@200000 { - label = "kernel_erase"; + label = "kernel_stock"; reg = <0x200000 0x400000>; }; @@ -114,12 +145,13 @@ }; /* ubi partition is the result of squashing - * next consequent stock partitions: - * - rootfs0 (rootfs partition for stock kernel0), - * - rootfs1 (rootfs partition for stock failsafe kernel1), + * next consecutive stock partitions: + * - rootfs0 (rootfs partition for stock kernel0), + * - rootfs1 (rootfs partition for stock failsafe kernel1), * - overlay (used as ubi overlay in stock fw) * resulting 117,5MiB space for packages. */ + partition@a00000 { label = "ubi"; reg = <0xa00000 0x7580000>; @@ -136,7 +168,7 @@ mediatek,mtd-eeprom = <&factory 0x0000>; ieee80211-freq-limit = <2400000 2500000>; }; - }; + }; pcie1 { wifi@14c3,7662 { @@ -156,7 +188,7 @@ &pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "jtag", "uart3", "wdt"; + ralink,group = "jtag", "uart2", "uart3", "wdt"; ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/MIWIFI-MINI.dts b/target/linux/ramips/dts/MIWIFI-MINI.dts index 9da5673d4a..3da39c529e 100644 --- a/target/linux/ramips/dts/MIWIFI-MINI.dts +++ b/target/linux/ramips/dts/MIWIFI-MINI.dts @@ -125,6 +125,8 @@ &wmac { ralink,mtd-eeprom = <&factory 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pa_pins>; }; &pcie { @@ -146,10 +148,5 @@ ralink,group = "i2c", "rgmii1"; ralink,function = "gpio"; }; - - pa { - ralink,group = "pa"; - ralink,function = "pa"; - }; }; }; diff --git a/target/linux/ramips/dts/Newifi-D2.dts b/target/linux/ramips/dts/Newifi-D2.dts new file mode 100644 index 0000000000..e919338e4e --- /dev/null +++ b/target/linux/ramips/dts/Newifi-D2.dts @@ -0,0 +1,159 @@ +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "d-team,newifi-d2", "mediatek,mt7621-soc"; + model = "Newifi-D2"; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x1c000000>, <0x20000000 0x4000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + gpio-leds { + compatible = "gpio-leds"; + + power-amber { + label = "newifi-d2:amber:power"; + gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; + }; + + power-blue { + label = "newifi-d2:blue:power"; + gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; + }; + + internet-amber { + label = "newifi-d2:amber:internet"; + gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; + }; + + internet-blue { + label = "newifi-d2:blue:internet"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "newifi-d2:blue:wlan2g"; + gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; + }; + + wlan5g { + label = "newifi-d2:blue:wlan5g"; + gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; + }; + + usb { + label = "newifi-d2:blue:usb"; + gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio_export { + compatible = "gpio-export"; + #size-cells = <0>; + + power_usb3 { + gpio-export,name = "power_usb3"; + gpio-export,output = <1>; + gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + m25p,chunked-io = <32>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0x1fb0000>; + }; + }; +}; + +&pcie { + status = "okay"; + + pcie0 { + mt76@0,0 { + reg = <0x0000 0 0 0 0>; + device_type = "pci"; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; + }; + + pcie1 { + mt76@1,0 { + reg = <0x0000 0 0 0 0>; + device_type = "pci"; + mediatek,mtd-eeprom = <&factory 0x0000>; + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0xe000>; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "jtag", "uart2", "uart3"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/OMEGA2.dts b/target/linux/ramips/dts/OMEGA2.dts index f419dc9c74..25cc818d56 100644 --- a/target/linux/ramips/dts/OMEGA2.dts +++ b/target/linux/ramips/dts/OMEGA2.dts @@ -3,6 +3,7 @@ #include "OMEGA2.dtsi" / { + compatible = "onion,omega2", "mediatek,mt7628an-soc"; model = "Onion Omega2"; memory@0 { diff --git a/target/linux/ramips/dts/OMEGA2.dtsi b/target/linux/ramips/dts/OMEGA2.dtsi index 132df58ac4..73a6908792 100644 --- a/target/linux/ramips/dts/OMEGA2.dtsi +++ b/target/linux/ramips/dts/OMEGA2.dtsi @@ -4,7 +4,7 @@ #include / { - compatible = "onion,omega", "mediatek,mt7628an-soc"; + compatible = "onion,omega2", "mediatek,mt7628an-soc"; chosen { bootargs = "console=ttyS0,115200"; diff --git a/target/linux/ramips/dts/OMEGA2P.dts b/target/linux/ramips/dts/OMEGA2P.dts index a49d94c08f..53e8377292 100644 --- a/target/linux/ramips/dts/OMEGA2P.dts +++ b/target/linux/ramips/dts/OMEGA2P.dts @@ -3,6 +3,7 @@ #include "OMEGA2.dtsi" / { + compatible = "onion,omega2p", "onion,omega2", "mediatek,mt7628an-soc"; model = "Onion Omega2+"; memory@0 { diff --git a/target/linux/ramips/dts/PBR-D1.dts b/target/linux/ramips/dts/PBR-D1.dts index a982eebbef..78a36577c0 100644 --- a/target/linux/ramips/dts/PBR-D1.dts +++ b/target/linux/ramips/dts/PBR-D1.dts @@ -6,7 +6,7 @@ #include / { - compatible = "pandorabox,pbr-d1", "mediatek,mt7628an-soc"; + compatible = "d-team,pbr-d1", "mediatek,mt7628an-soc"; model = "PBR-D1"; chosen { diff --git a/target/linux/ramips/dts/PBR-M1.dts b/target/linux/ramips/dts/PBR-M1.dts index f5d5f29a75..66a71a91ad 100644 --- a/target/linux/ramips/dts/PBR-M1.dts +++ b/target/linux/ramips/dts/PBR-M1.dts @@ -6,7 +6,7 @@ #include / { - compatible = "pandorabox,pbr-m1", "mediatek,mt7621-soc"; + compatible = "d-team,pbr-m1", "mediatek,mt7621-soc"; model = "PBR-M1"; memory@0 { diff --git a/target/linux/ramips/dts/PSG1218A.dts b/target/linux/ramips/dts/PSG1218A.dts index c63af58034..d76abc39fc 100644 --- a/target/linux/ramips/dts/PSG1218A.dts +++ b/target/linux/ramips/dts/PSG1218A.dts @@ -31,11 +31,6 @@ ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "nd_sd"; ralink,function = "gpio"; }; - - pa { - ralink,group = "pa"; - ralink,function = "pa"; - }; }; }; @@ -45,3 +40,8 @@ mtd-mac-address = <&factory 0x28>; mediatek,portmap = "llllw"; }; + +&wmac { + pinctrl-names = "default"; + pinctrl-0 = <&pa_pins>; +}; diff --git a/target/linux/ramips/dts/R6220.dts b/target/linux/ramips/dts/R6220.dts index 2bbb0db3b2..7d886725e1 100644 --- a/target/linux/ramips/dts/R6220.dts +++ b/target/linux/ramips/dts/R6220.dts @@ -79,7 +79,7 @@ usbpower { gpio-export,name = "usbpower"; gpio-export,output = <1>; - gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>; }; }; }; diff --git a/target/linux/ramips/dts/RT-N12-PLUS.dts b/target/linux/ramips/dts/RT-N12-PLUS.dts new file mode 100644 index 0000000000..f3e0284aed --- /dev/null +++ b/target/linux/ramips/dts/RT-N12-PLUS.dts @@ -0,0 +1,117 @@ +/dts-v1/; + +#include "mt7620n.dtsi" + +#include +#include + +/ { + compatible = "asus,rt-n12p", "ralink,mt7620n-soc"; + model = "Asus RT-N12+"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + gpio-leds { + compatible = "gpio-leds"; + + wan { + label = "rt-n12p:green:wan"; + gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "rt-n12p:green:lan"; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + }; + + power { + label = "rt-n12p:green:power"; + gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; + }; + + air { + label = "rt-n12p:green:air"; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0>; +}; + +&pinctrl { + state_default: pinctrl0 { + default { + ralink,group = "ephy", "wled", "i2c", "wdt", "pa", "spi refclk"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts b/target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts index 7811ee20d7..5c7b3c7c42 100644 --- a/target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts +++ b/target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "rt5350.dtsi" +#include "RT5350F-OLINUXINO.dtsi" #include @@ -30,72 +30,3 @@ }; }; }; - -&spi0 { - status = "okay"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - label = "firmware"; - reg = <0x50000 0x7b0000>; - }; - }; -}; - -&gpio1 { - status = "okay"; -}; - -&pinctrl { - state_default: pinctrl0 { - gpio { - ralink,group = "jtag", "rgmii", "mdio", "uartf"; - ralink,function = "gpio"; - }; - }; -}; - -ðernet { - mtd-mac-address = <&factory 0x4>; -}; - -&esw { - mediatek,portmap = <0x2f>; - mediatek,led_polarity = <0x17>; -}; - -&wmac { - ralink,mtd-eeprom = <&factory 0>; -}; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/RT5350F-OLINUXINO.dts b/target/linux/ramips/dts/RT5350F-OLINUXINO.dts index 6ee3daeaa1..2e0dcb1558 100644 --- a/target/linux/ramips/dts/RT5350F-OLINUXINO.dts +++ b/target/linux/ramips/dts/RT5350F-OLINUXINO.dts @@ -1,77 +1,8 @@ /dts-v1/; -#include "rt5350.dtsi" +#include "RT5350F-OLINUXINO.dtsi" / { compatible = "olimex,rt5350f-olinuxino", "ralink,rt5350-soc"; model = "Olimex RT5350F-OLinuXino"; }; - -&spi0 { - status = "okay"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - label = "firmware"; - reg = <0x50000 0x7b0000>; - }; - }; -}; - -&gpio1 { - status = "okay"; -}; - -&pinctrl { - state_default: pinctrl0 { - gpio { - ralink,group = "jtag", "rgmii", "mdio", "uartf"; - ralink,function = "gpio"; - }; - }; -}; - -ðernet { - mtd-mac-address = <&factory 0x4>; -}; - -&esw { - mediatek,portmap = <0x2f>; - mediatek,led_polarity = <0x17>; -}; - -&wmac { - ralink,mtd-eeprom = <&factory 0>; -}; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi b/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi new file mode 100644 index 0000000000..629dab8934 --- /dev/null +++ b/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi @@ -0,0 +1,94 @@ +#include "rt5350.dtsi" + +/ { + compatible = "olimex,rt5350f-olinuxino", "ralink,rt5350-soc"; + + aliases { + serial0 = &uartlite; + serial1 = &uart; + }; +}; + + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0x7b0000>; + }; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "jtag", "rgmii", "mdio"; + ralink,function = "gpio"; + }; + uartf_gpio { + ralink,group = "uartf"; + ralink,function = "gpio uartf"; + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0x4>; +}; + +&esw { + mediatek,portmap = <0x2f>; + mediatek,led_polarity = <0x17>; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0>; + ralink,led-polarity = <1>; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +&i2c { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + diff --git a/target/linux/ramips/dts/TL-MR3420V5.dts b/target/linux/ramips/dts/TL-MR3420V5.dts new file mode 100644 index 0000000000..fdb09dcd6e --- /dev/null +++ b/target/linux/ramips/dts/TL-MR3420V5.dts @@ -0,0 +1,86 @@ +/dts-v1/; + +#include "TL-WR84XN.dtsi" + +#include +#include + +/ { + compatible = "tplink,tl-mr3420-v5", "mediatek,mt7628an-soc"; + model = "TP-Link TL-MR3420 v5"; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + rfkill { + label = "rfkill"; + gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + lan { + label = "tl-mr3420-v5:green:lan"; + gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; + }; + + power { + label = "tl-mr3420-v5:green:power"; + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + }; + + usb { + label = "tl-mr3420-v5:green:usb"; + gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "tl-mr3420-v5:green:wan"; + gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; + }; + + wan_amber { + label = "tl-mr3420-v5:amber:wan"; + gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "tl-mr3420-v5:green:wlan"; + gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "tl-mr3420-v5:green:wps"; + gpios = <&gpio1 5 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "i2s", "p2led_an", "refclk", "uart1", "wdt", "wled_an"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/TL-WR840NV5.dts b/target/linux/ramips/dts/TL-WR840NV5.dts new file mode 100644 index 0000000000..340f2bbd83 --- /dev/null +++ b/target/linux/ramips/dts/TL-WR840NV5.dts @@ -0,0 +1,111 @@ +/dts-v1/; + +#include "mt7628an.dtsi" + +#include +#include + +/ { + compatible = "tplink,tl-wr840n-v5", "mediatek,mt7628an-soc"; + model = "TP-Link TL-WR840N v5"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x4000000>; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + /* LED used is dual-color,dual lead LED */ + gpio-leds { + compatible = "gpio-leds"; + + power { + label = "tl-wr840n-v5:green:power"; + gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; + }; + + orange { + label = "tl-wr840n-v5:orange:power"; + gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + m25p,chunked-io = <32>; + + partition@0 { + label = "boot"; + reg = <0x0 0x20000>; + read-only; + }; + + partition@20000 { + label = "firmware"; + reg = <0x20000 0x3c0000>; + }; + + partition@3e0000 { + label = "config"; + reg = <0x3e0000 0x10000>; + read-only; + }; + + factory: partition@3f0000 { + label = "factory"; + reg = <0x3f0000 0x10000>; + read-only; + }; + }; +}; + +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + +&wmac { + status = "okay"; + mtd-mac-address = <&factory 0xf100>; + mediatek,mtd-eeprom = <&factory 0x10000>; +}; + +ðernet { + mtd-mac-address = <&factory 0xf100>; + mediatek,portmap = "wllll"; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "p0led_an", "p2led_an", "perst"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/U25AWF-H1.dts b/target/linux/ramips/dts/U25AWF-H1.dts new file mode 100644 index 0000000000..8021b0f79d --- /dev/null +++ b/target/linux/ramips/dts/U25AWF-H1.dts @@ -0,0 +1,106 @@ +/dts-v1/; + +#include "mt7620a.dtsi" + +#include +#include + +/{ + compatible = "kimax,u25awf-h1","ralink,mt7620a-soc"; + model = "Kimax U25AWF-H1"; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + wifi { + label = "u25awf:red:wifi"; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "u25awf:green:lan"; + gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x4>; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0>; +}; + +&pinctrl { + state_default: pinctrl0 { + default { + ralink,group = "uartf", "ephy", "wled"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/U7621-06-256M-16M.dts b/target/linux/ramips/dts/U7621-06-256M-16M.dts new file mode 100644 index 0000000000..1bf03fdf52 --- /dev/null +++ b/target/linux/ramips/dts/U7621-06-256M-16M.dts @@ -0,0 +1,86 @@ +/* + * BSD LICENSE + * + * Copyright(c) 2017 Kristian Evensen . + * Copyright(c) 2017 Piotr Dymacz . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Broadcom Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/dts-v1/; + +#include "U7621-06.dtsi" + +#include +#include + +/ { + compatible = "unielec,u7621-06-256m-16m", "unielec,u7621-06", "mediatek,mt7621-soc"; + model = "UniElec U7621-06 (256M RAM/16M flash)"; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x10000000>; + }; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <14000000>; + m25p,chunked-io = <32>; + + partition@0 { + label = "bootloader"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "config"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + firmware: partition@50000 { + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; +}; diff --git a/target/linux/ramips/dts/U7621-06.dtsi b/target/linux/ramips/dts/U7621-06.dtsi new file mode 100644 index 0000000000..0502904bd0 --- /dev/null +++ b/target/linux/ramips/dts/U7621-06.dtsi @@ -0,0 +1,117 @@ +/* + * BSD LICENSE + * + * Copyright(c) 2017 Kristian Evensen . + * Copyright(c) 2017 Piotr Dymacz . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Broadcom Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "unielec,u7621-06", "mediatek,mt7621-soc"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + gpio-export { + compatible = "gpio-export"; + #size-cells = <0>; + + modem_reset { + gpio-export,name = "modem_reset"; + gpio-export,output = <1>; + gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + status { + label = "u7621-06:green:status"; + gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + }; + + led4 { + label = "u7621-06:green:led4"; + gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; + }; + + led5 { + label = "u7621-06:green:led5"; + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&gpio0 { + status = "okay"; +}; + +&sdhci { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&sdhci_pins>; +}; + +&pcie { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0xe000>; + mediatek,portmap = "llllw"; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "jtag", "uart2", "wdt"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/U7628-01-128M-16M.dts b/target/linux/ramips/dts/U7628-01-128M-16M.dts new file mode 100644 index 0000000000..4b3345da38 --- /dev/null +++ b/target/linux/ramips/dts/U7628-01-128M-16M.dts @@ -0,0 +1,83 @@ +/* + * BSD LICENSE + * + * Copyright(c) 2017 Kristian Evensen . + * Copyright(c) 2017 Piotr Dymacz . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Broadcom Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/dts-v1/; + +#include "U7628-01.dtsi" + +/ { + compatible = "unielec,u7628-01-128m-16m", "unielec,u7628-01", "mediatek,mt7628an-soc"; + model = "UniElec U7628-01 (128M RAM/16M flash)"; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x8000000>; + }; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <12000000>; + m25p,chunked-io = <32>; + + partition@0 { + label = "bootloader"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "config"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; +}; diff --git a/target/linux/ramips/dts/U7628-01.dtsi b/target/linux/ramips/dts/U7628-01.dtsi new file mode 100644 index 0000000000..34226a4a4e --- /dev/null +++ b/target/linux/ramips/dts/U7628-01.dtsi @@ -0,0 +1,132 @@ +/* + * BSD LICENSE + * + * Copyright(c) 2017 Kristian Evensen . + * Copyright(c) 2017 Piotr Dymacz . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Broadcom Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "mt7628an.dtsi" + +#include +#include + +/ { + compatible = "unielec,u7628-01", "mediatek,mt7628an-soc"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + reset { + label = "reset"; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + power { + label = "u7628-01:green:power"; + gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "u7628-01:green:wlan"; + gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "u7628-01:green:wan"; + gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; + }; + + lan1 { + label = "u7628-01:green:lan1"; + gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "u7628-01:green:lan2"; + gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; + }; + + lan3 { + label = "u7628-01:green:lan3"; + gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; + }; + + lan4 { + label = "u7628-01:green:lan4"; + gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; + }; + + usb { + label = "u7628-01:green:usb"; + gpios = <&gpio1 5 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&pcie { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x28>; +}; + +&wmac { + status = "okay"; + ralink,mtd-eeprom = <&factory 0x0>; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "gpio", "p0led_an", "p1led_an", "p2led_an", "p3led_an", "p4led_an", "refclk", "wdt", "wled_an"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/UBNT-ER-e50.dtsi b/target/linux/ramips/dts/UBNT-ER-e50.dtsi index b38c719494..0947dd6106 100644 --- a/target/linux/ramips/dts/UBNT-ER-e50.dtsi +++ b/target/linux/ramips/dts/UBNT-ER-e50.dtsi @@ -4,7 +4,7 @@ #include / { - compatible = "ubiquiti,edgerouterx"; + compatible = "ubiquiti,edgerouterx", "mediatek,mt7621-soc"; memory@0 { device_type = "memory"; diff --git a/target/linux/ramips/dts/UBNT-ERX-SFP.dts b/target/linux/ramips/dts/UBNT-ERX-SFP.dts index ca26d81721..7de37804a5 100644 --- a/target/linux/ramips/dts/UBNT-ERX-SFP.dts +++ b/target/linux/ramips/dts/UBNT-ERX-SFP.dts @@ -6,7 +6,7 @@ / { model = "UBNT-ERX-SFP"; - compatible = "ubiquiti,edgerouterx-sfp"; + compatible = "ubiquiti,edgerouterx-sfp", "mediatek,mt7621-soc"; i2c-gpio { compatible = "i2c-gpio"; diff --git a/target/linux/ramips/dts/VAR11N-300.dts b/target/linux/ramips/dts/VAR11N-300.dts new file mode 100644 index 0000000000..54bcb3df02 --- /dev/null +++ b/target/linux/ramips/dts/VAR11N-300.dts @@ -0,0 +1,90 @@ +/dts-v1/; + +#include "mt7620n.dtsi" + +#include +#include + +/ { + compatible = "vonets,var11n-300", "ralink,mt7620n-soc"; + model = "Vonets VAR11N-300"; + + gpio-leds { + compatible = "gpio-leds"; + + system { + label = "var11n-300:blue:system"; + gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&gpio0 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0x3b0000>; + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "llllw"; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0>; +}; + +&pinctrl { + state_default: pinctrl0 { + default { + ralink,group = "i2c"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/VOCORE2.dtsi b/target/linux/ramips/dts/VOCORE2.dtsi index dc1bd17b08..f7aec8e1f5 100644 --- a/target/linux/ramips/dts/VOCORE2.dtsi +++ b/target/linux/ramips/dts/VOCORE2.dtsi @@ -12,7 +12,7 @@ &pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "wled_an", "perst", "wdt"; + ralink,group = "wled_an", "refclk", "wdt"; ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/WE1026-5G-16M.dts b/target/linux/ramips/dts/WE1026-5G-16M.dts new file mode 100644 index 0000000000..e01e86423c --- /dev/null +++ b/target/linux/ramips/dts/WE1026-5G-16M.dts @@ -0,0 +1,76 @@ +/* + * BSD LICENSE + * + * Copyright(c) 2017 Kristian Evensen . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Broadcom Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/dts-v1/; + +#include "WE1026-5G.dtsi" + +/ { + compatible = "zbtlink,we1026-5g-16m", "ralink,mt7620a-soc"; + model = "ZBT WE1026-5G (16M)"; +}; + +&spi0 { + status = "okay"; + + en25q128@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + firmware: partition@50000 { + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; +}; diff --git a/target/linux/ramips/dts/WE1026-5G.dtsi b/target/linux/ramips/dts/WE1026-5G.dtsi new file mode 100644 index 0000000000..c357e1eee7 --- /dev/null +++ b/target/linux/ramips/dts/WE1026-5G.dtsi @@ -0,0 +1,124 @@ +/* + * BSD LICENSE + * + * Copyright(c) 2017 Kristian Evensen . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Broadcom Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "mt7620a.dtsi" + +#include +#include + +/ { + compatible = "zbtlink,we1026-5g", "ralink,mt7620a-soc"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + gpio-leds { + compatible = "gpio-leds"; + lan { + label = "we1026-5g:green:lan"; + gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; + }; + + usb { + label = "we1026-5g:green:usb"; + gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>; + }; + + wifi { + label = "we1026-5g:green:wifi"; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + reset { + label = "reset"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&sdhci { + status = "okay"; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x28>; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0>; +}; + +&pinctrl { + state_default: pinctrl0 { + default { + ralink,group = "i2c", "uartf", "spi refclk", "ephy", "wled"; + ralink,function = "gpio"; + }; + }; +}; + +&pcie { + status = "okay"; + pcie-bridge { + wifi@14c3,7662 { + compatible = "pci14c3,7662"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; + }; +}; diff --git a/target/linux/ramips/dts/WHR-300HP2.dts b/target/linux/ramips/dts/WHR-300HP2.dts index f74a0b84b8..d405686d7a 100644 --- a/target/linux/ramips/dts/WHR-300HP2.dts +++ b/target/linux/ramips/dts/WHR-300HP2.dts @@ -127,11 +127,6 @@ ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "nd_sd"; ralink,function = "gpio"; }; - - pa { - ralink,group = "pa"; - ralink,function = "pa"; - }; }; }; @@ -147,4 +142,6 @@ &wmac { ralink,mtd-eeprom = <&factory 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pa_pins>; }; diff --git a/target/linux/ramips/dts/WIZFI630A.dts b/target/linux/ramips/dts/WIZFI630A.dts index 882086bcc0..d12753650e 100644 --- a/target/linux/ramips/dts/WIZFI630A.dts +++ b/target/linux/ramips/dts/WIZFI630A.dts @@ -13,11 +13,6 @@ bootargs = "console=ttyS1,115200"; }; - gpio-export { - compatible = "gpio-export"; - #size-cells = <0>; - }; - gpio-leds { compatible = "gpio-leds"; @@ -118,28 +113,9 @@ }; &uart { - compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a"; - reg = <0x500 0x100>; - resets = <&rstctrl 12>; - reset-names = "uart"; - interrupt-parent = <&intc>; - interrupts = <5>; - reg-shift = <2>; + status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&uartf_pins>; - status = "okay"; -}; - -&uartlite { - compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a"; - reg = <0xc00 0x100>; - resets = <&rstctrl 19>; - reset-names = "uartl"; - interrupt-parent = <&intc>; - interrupts = <12>; - reg-shift = <2>; - pinctrl-names = "default"; - pinctrl-0 = <&uartlite_pins>; }; &pinctrl { @@ -149,20 +125,6 @@ ralink,function = "gpio"; }; }; - - uartf_gpio_pins: uartf_gpio { - uartf_gpio { - ralink,group = "uartf"; - ralink,function = "uartf"; - }; - }; - - uartlite_pins: uartlite { - uart { - ralink,group = "uartlite"; - ralink,function = "uartlite"; - }; - }; }; ðernet { diff --git a/target/linux/ramips/dts/WL-351.dts b/target/linux/ramips/dts/WL-351.dts index e620f10d84..0dd596cfe6 100644 --- a/target/linux/ramips/dts/WL-351.dts +++ b/target/linux/ramips/dts/WL-351.dts @@ -92,15 +92,13 @@ ralink,group = "spi", "i2c", "jtag", "mdio", "uartf"; ralink,function = "gpio"; }; - rgmii { - ralink,group = "rgmii"; - ralink,function = "rgmii"; - }; }; }; ðernet { mtd-mac-address = <&factory 0x4>; + pinctrl-names = "default"; + pinctrl-0 = <&rgmii_pins>; }; &esw { diff --git a/target/linux/ramips/dts/WNDR3700V5.dts b/target/linux/ramips/dts/WNDR3700V5.dts index c7800115d4..ce96440369 100644 --- a/target/linux/ramips/dts/WNDR3700V5.dts +++ b/target/linux/ramips/dts/WNDR3700V5.dts @@ -64,7 +64,7 @@ usbpower { gpio-export,name = "usbpower"; gpio-export,output = <1>; - gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>; }; }; }; diff --git a/target/linux/ramips/dts/WR6202.dts b/target/linux/ramips/dts/WR6202.dts index 3cc1b23efb..2f39818044 100644 --- a/target/linux/ramips/dts/WR6202.dts +++ b/target/linux/ramips/dts/WR6202.dts @@ -85,7 +85,7 @@ usb { gpio-export,name = "usb"; gpio-export,output = <0>; - gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; }; }; }; diff --git a/target/linux/ramips/dts/WT1520.dtsi b/target/linux/ramips/dts/WT1520.dtsi index 1031e22749..95886d7e29 100644 --- a/target/linux/ramips/dts/WT1520.dtsi +++ b/target/linux/ramips/dts/WT1520.dtsi @@ -1,5 +1,8 @@ #include "rt5350.dtsi" +#include +#include + / { compatible = "nexx,wt1520", "ralink,rt5350-soc"; @@ -8,21 +11,24 @@ reg = <0x0 0x2000000>; }; - chosen { - bootargs = "console=ttyS1,57600"; - }; -}; + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; -&uart { - pinctrl-names = "default"; - pinctrl-0 = <&uartf_pins>; - status = "okay"; + reset { + label = "reset"; + gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; }; &pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "jtag"; + ralink,group = "jtag", "uartf"; ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/WT3020-8M.dts b/target/linux/ramips/dts/WT3020-8M.dts index 05ade7c5a4..b2397d2cd5 100644 --- a/target/linux/ramips/dts/WT3020-8M.dts +++ b/target/linux/ramips/dts/WT3020-8M.dts @@ -7,6 +7,14 @@ model = "Nexx WT3020 (8M)"; }; +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + &spi0 { status = "okay"; diff --git a/target/linux/ramips/dts/WT3020.dtsi b/target/linux/ramips/dts/WT3020.dtsi index 6bea6cc1f3..91720e32c9 100644 --- a/target/linux/ramips/dts/WT3020.dtsi +++ b/target/linux/ramips/dts/WT3020.dtsi @@ -37,15 +37,6 @@ status = "okay"; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - ðernet { mtd-mac-address = <&factory 0x4>; mediatek,portmap = "wllll"; diff --git a/target/linux/ramips/dts/X5.dts b/target/linux/ramips/dts/X5.dts index 8911fa80e5..20c4237eb8 100644 --- a/target/linux/ramips/dts/X5.dts +++ b/target/linux/ramips/dts/X5.dts @@ -66,7 +66,7 @@ usb-mode { gpio-export,name = "usb-mode"; gpio-export,output = <0>; - gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; }; }; }; diff --git a/target/linux/ramips/dts/Y1.dts b/target/linux/ramips/dts/Y1.dts index 15b3b3b819..8aed5c120e 100644 --- a/target/linux/ramips/dts/Y1.dts +++ b/target/linux/ramips/dts/Y1.dts @@ -3,7 +3,7 @@ #include "Y1.dtsi" / { - compatible = "lenovo,y1", "ralink,mt7620a-soc"; + compatible = "lenovo,newifi-y1", "ralink,mt7620a-soc"; model = "Lenovo Y1"; gpio-leds { diff --git a/target/linux/ramips/dts/Y1.dtsi b/target/linux/ramips/dts/Y1.dtsi index 022b67949d..0db064576f 100644 --- a/target/linux/ramips/dts/Y1.dtsi +++ b/target/linux/ramips/dts/Y1.dtsi @@ -4,7 +4,7 @@ #include / { - compatible = "lenovo,y1", "ralink,mt7620a-soc"; + compatible = "lenovo,newifi-y1", "ralink,mt7620a-soc"; chosen { bootargs = "console=ttyS0,115200"; @@ -94,6 +94,8 @@ &wmac { ralink,mtd-eeprom = <&factory 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pa_pins>; }; &pinctrl { @@ -102,10 +104,5 @@ ralink,group = "uartf", "wled", "nd_sd"; ralink,function = "gpio"; }; - - pa { - ralink,group = "pa"; - ralink,function = "pa"; - }; }; }; diff --git a/target/linux/ramips/dts/Y1S.dts b/target/linux/ramips/dts/Y1S.dts index 07719c25e5..74f7ca93cd 100644 --- a/target/linux/ramips/dts/Y1S.dts +++ b/target/linux/ramips/dts/Y1S.dts @@ -3,7 +3,7 @@ #include "Y1.dtsi" / { - compatible = "lenovo,y1s", "lenovo,y1", "ralink,mt7620a-soc"; + compatible = "lenovo,newifi-y1s", "lenovo,newifi-y1", "ralink,mt7620a-soc"; model = "Lenovo Y1S"; gpio_export { diff --git a/target/linux/ramips/dts/YOUKU-YK1.dts b/target/linux/ramips/dts/YOUKU-YK1.dts index d4e3c905b3..8a0e0819ec 100644 --- a/target/linux/ramips/dts/YOUKU-YK1.dts +++ b/target/linux/ramips/dts/YOUKU-YK1.dts @@ -96,7 +96,7 @@ &pinctrl { state_default: pinctrl0 { default { - ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled", "nd_sd"; + ralink,group = "i2c", "rgmii1", "ephy", "wled"; ralink,function = "gpio"; }; }; @@ -104,7 +104,6 @@ ðernet { pinctrl-names = "default"; - pinctrl-0 = <&ephy_pins>; mtd-mac-address = <&factory 0x4>; mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/ZBT-APE522II.dts b/target/linux/ramips/dts/ZBT-APE522II.dts index 45fef667ca..05d053f22a 100644 --- a/target/linux/ramips/dts/ZBT-APE522II.dts +++ b/target/linux/ramips/dts/ZBT-APE522II.dts @@ -115,6 +115,8 @@ &wmac { ralink,mtd-eeprom = <&factory 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pa_pins>; }; &pcie { @@ -136,10 +138,5 @@ ralink,group = "wled", "i2c", "uartf", "wdt"; ralink,function = "gpio"; }; - - pa { - ralink,group = "pa"; - ralink,function = "pa"; - }; }; }; diff --git a/target/linux/ramips/dts/ZBT-WE3526.dts b/target/linux/ramips/dts/ZBT-WE3526.dts new file mode 100644 index 0000000000..dc7896f13e --- /dev/null +++ b/target/linux/ramips/dts/ZBT-WE3526.dts @@ -0,0 +1,117 @@ +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "zbtlink,zbt-we3526", "mediatek,mt7621-soc"; + model = "ZBT-WE3526"; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x1c000000>, <0x20000000 0x4000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + palmbus: palmbus@1E000000 { + i2c@900 { + status = "okay"; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&sdhci { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + m25p,chunked-io = <32>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + firmware: partition@50000 { + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; +}; + +&pcie { + status = "okay"; + + pcie0 { + wifi@14c3,7662 { + compatible = "pci14c3,7662"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + + led { + led-sources = <2>; + }; + }; + }; + + pcie1 { + wifi@14c3,7603 { + compatible = "pci14c3,7603"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0xe000>; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "wdt"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/ZBT-WG2626.dts b/target/linux/ramips/dts/ZBT-WG2626.dts index a55fd09e6e..79f2859bb7 100644 --- a/target/linux/ramips/dts/ZBT-WG2626.dts +++ b/target/linux/ramips/dts/ZBT-WG2626.dts @@ -116,7 +116,7 @@ &pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "wdt", "rgmii2", "wdt rst", "jtag", "mdio"; + ralink,group = "wdt", "rgmii2", "jtag", "mdio"; ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/ZBT-WG3526.dtsi b/target/linux/ramips/dts/ZBT-WG3526.dtsi index ccd5ab1e0b..104a51f8de 100644 --- a/target/linux/ramips/dts/ZBT-WG3526.dtsi +++ b/target/linux/ramips/dts/ZBT-WG3526.dtsi @@ -111,7 +111,7 @@ &pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "wdt", "rgmii2", "wdt rst", "jtag", "mdio"; + ralink,group = "wdt", "rgmii2", "jtag", "mdio"; ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/ZBT-WR8305RT.dts b/target/linux/ramips/dts/ZBT-WR8305RT.dts index 11911b9f09..52cac80a72 100644 --- a/target/linux/ramips/dts/ZBT-WR8305RT.dts +++ b/target/linux/ramips/dts/ZBT-WR8305RT.dts @@ -94,6 +94,8 @@ }; ðernet { + pinctrl-names = "default"; + pinctrl-0 = <&ephy_pins>; mtd-mac-address = <&factory 0x4>; mediatek,portmap = "llllw"; }; @@ -104,11 +106,6 @@ &pinctrl { state_default: pinctrl0 { - ephy { - ralink,group = "ephy"; - ralink,function = "ephy"; - }; - default { ralink,group = "i2c", "uartf", "spi refclk", "wled"; ralink,function = "gpio"; diff --git a/target/linux/ramips/dts/mt7620a.dtsi b/target/linux/ramips/dts/mt7620a.dtsi index 96966b4647..882cf88104 100644 --- a/target/linux/ramips/dts/mt7620a.dtsi +++ b/target/linux/ramips/dts/mt7620a.dtsi @@ -365,6 +365,13 @@ }; }; + mdio_refclk_pins: mdio_refclk { + mdio_refclk { + ralink,group = "mdio"; + ralink,function = "refclk"; + }; + }; + ephy_pins: ephy { ephy { ralink,group = "ephy"; @@ -399,6 +406,13 @@ ralink,function = "pcie rst"; }; }; + + pa_pins: pa { + pa { + ralink,group = "pa"; + ralink,function = "pa"; + }; + }; }; rstctrl: rstctrl { diff --git a/target/linux/ramips/dts/mt7620n.dtsi b/target/linux/ramips/dts/mt7620n.dtsi index f1593acd93..5d3c1e3fa4 100644 --- a/target/linux/ramips/dts/mt7620n.dtsi +++ b/target/linux/ramips/dts/mt7620n.dtsi @@ -228,6 +228,13 @@ state_default: pinctrl0 { }; + ephy_pins: ephy { + ephy { + ralink,group = "ephy"; + ralink,function = "ephy"; + }; + }; + spi_pins: spi { spi { ralink,group = "spi"; diff --git a/target/linux/ramips/dts/mt7621.dtsi b/target/linux/ramips/dts/mt7621.dtsi index 7662518992..d68ddf3bc6 100644 --- a/target/linux/ramips/dts/mt7621.dtsi +++ b/target/linux/ramips/dts/mt7621.dtsi @@ -58,7 +58,7 @@ }; wdt: wdt@100 { - compatible = "mtk,mt7621-wdt"; + compatible = "mediatek,mt7621-wdt"; reg = <0x100 0x100>; }; diff --git a/target/linux/ramips/dts/mt7628an.dtsi b/target/linux/ramips/dts/mt7628an.dtsi index b64a87a493..b572f2ae40 100644 --- a/target/linux/ramips/dts/mt7628an.dtsi +++ b/target/linux/ramips/dts/mt7628an.dtsi @@ -38,7 +38,7 @@ }; watchdog: watchdog@120 { - compatible = "ralink,mt7628an-wdt", "mtk,mt7621-wdt"; + compatible = "ralink,mt7628an-wdt", "mediatek,mt7621-wdt"; reg = <0x120 0x10>; resets = <&rstctrl 8>; @@ -298,6 +298,13 @@ }; }; + i2s_pins: i2s { + i2s { + ralink,group = "i2s"; + ralink,function = "i2s"; + }; + }; + uart0_pins: uartlite { uartlite { ralink,group = "uart0"; @@ -340,12 +347,19 @@ }; }; - pcm_i2s_pins: i2s { - i2s { + pcm_i2s_pins: pcm_i2s { + pcm_i2s { ralink,group = "i2s"; ralink,function = "pcm"; }; }; + + refclk_pins: refclk { + refclk { + ralink,group = "refclk"; + ralink,function = "refclk"; + }; + }; }; rstctrl: rstctrl { diff --git a/target/linux/ramips/dts/rt3050.dtsi b/target/linux/ramips/dts/rt3050.dtsi index 23da1c43ef..5c69d282a3 100644 --- a/target/linux/ramips/dts/rt3050.dtsi +++ b/target/linux/ramips/dts/rt3050.dtsi @@ -260,6 +260,13 @@ }; }; + rgmii_pins: rgmii { + rgmii { + ralink,group = "rgmii"; + ralink,function = "rgmii"; + }; + }; + uartlite_pins: uartlite { uart { ralink,group = "uartlite"; diff --git a/target/linux/ramips/dts/rt3352.dtsi b/target/linux/ramips/dts/rt3352.dtsi index a617281b75..5612458f10 100644 --- a/target/linux/ramips/dts/rt3352.dtsi +++ b/target/linux/ramips/dts/rt3352.dtsi @@ -262,6 +262,20 @@ }; }; + mdio_pins: mdio { + mdio { + ralink,group = "mdio"; + ralink,function = "mdio"; + }; + }; + + rgmii_pins: rgmii { + rgmii { + ralink,group = "rgmii"; + ralink,function = "rgmii"; + }; + }; + spi_pins: spi { spi { ralink,group = "spi"; diff --git a/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mt7530.c b/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mt7530.c index 74b4a7103c..439d8c2661 100644 --- a/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mt7530.c +++ b/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mt7530.c @@ -220,6 +220,12 @@ struct mt7530_mapping { .members = { 0, 0x7e, 0x41 }, .etags = { 0, 0x40, 0x40 }, .vids = { 0, 1, 2 }, + }, { + .name = "lwlll", + .pvids = { 1, 2, 1, 1, 1, 1, 1 }, + .members = { 0, 0x7d, 0x42 }, + .etags = { 0, 0x40, 0x40 }, + .vids = { 0, 1, 2 }, }, }; @@ -922,7 +928,7 @@ mt7530_probe(struct device *dev, void __iomem *base, struct mii_bus *bus, int vl /* magic vodoo */ if (!IS_ENABLED(CONFIG_SOC_MT7621) && bus && mt7530_r32(mt7530, REG_HWTRAP) != 0x1117edf) { - dev_info(dev, "fixing up MHWTRAP register - bootloader probably played with it\n"); + dev_info(dev, "fixing up MHWTRAP register - bootloader probably played with it\n"); mt7530_w32(mt7530, REG_HWTRAP, 0x1117edf); } dev_info(dev, "loaded %s driver\n", swdev->name); diff --git a/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mtk_eth_soc.c b/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mtk_eth_soc.c index 5f4afade06..a9d2f385a4 100644 --- a/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mtk_eth_soc.c +++ b/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mtk_eth_soc.c @@ -1003,7 +1003,7 @@ static int fe_poll(struct napi_struct *napi, int budget) goto poll_again; } - napi_complete(napi); + napi_complete_done(napi, rx_done); fe_int_enable(tx_intr | rx_intr); } else { rx_done = budget; @@ -1536,7 +1536,7 @@ static int fe_probe(struct platform_device *pdev) priv->rx_ring.rx_ring_size = NUM_DMA_DESC; INIT_WORK(&priv->pending_work, fe_pending_work); - napi_weight = 32; + napi_weight = 16; if (priv->flags & FE_FLAG_NAPI_WEIGHT) { napi_weight *= 4; priv->tx_ring.tx_ring_size *= 4; diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index c70761b250..ea7ce0bc90 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -39,7 +39,7 @@ define Device/Default DEVICE_DTS_DIR := ../dts IMAGES := sysupgrade.bin IMAGE_SIZE := $(ralink_default_fw_size_8M) - SUPPORTED_DEVICES = $(1) + SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) sysupgrade_bin := append-kernel | append-rootfs | pad-rootfs IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) endef diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index f201c9d404..6f9aa1aa6d 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -2,7 +2,7 @@ # MT7620A Profiles # -DEVICE_VARS += TPLINK_BOARD_ID +DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD TPLINK_HVERSION define Build/elecom-header cp $@ $(KDIR)/v_0.0.0.bin @@ -10,7 +10,9 @@ define Build/elecom-header mkhash md5 $(KDIR)/v_0.0.0.bin && \ echo 458 \ ) | mkhash md5 > $(KDIR)/v_0.0.0.md5 - $(STAGING_DIR_HOST)/bin/tar -cf $@ -C $(KDIR) v_0.0.0.bin v_0.0.0.md5 + $(STAGING_DIR_HOST)/bin/tar -c \ + $(if $(SOURCE_DATE_EPOCH),--mtime=@$(SOURCE_DATE_EPOCH)) \ + -f $@ -C $(KDIR) v_0.0.0.bin v_0.0.0.md5 endef define Build/zyimage @@ -25,18 +27,45 @@ define Device/ai-br100 endef TARGET_DEVICES += ai-br100 -define Device/Archer - KERNEL := $(KERNEL_DTB) - KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header - IMAGE/factory.bin := tplink-v2-image - IMAGE/sysupgrade.bin := tplink-v2-image -s | append-metadata +define Device/alfa-network_ac1200rm + DTS := AC1200RM + IMAGE_SIZE := 16064k + DEVICE_TITLE := ALFA Network AC1200RM + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) endef +TARGET_DEVICES += alfa-network_ac1200rm + +define Device/Archer + TPLINK_HWREVADD := 0 + TPLINK_HVERSION := 3 + KERNEL := $(KERNEL_DTB) + KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header -e + IMAGE/factory.bin := tplink-v2-image -e + IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata +endef + +define Device/ArcherC20 + $(Device/Archer) + DTS := ArcherC20 + SUPPORTED_DEVICES := c20 + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0xc2000001 + TPLINK_HWREV := 0x44 + TPLINK_HWREVADD := 0x1 + IMAGES += factory.bin + DEVICE_TITLE := TP-Link ArcherC20 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += ArcherC20 define Device/ArcherC20i $(Device/Archer) DTS := ArcherC20i SUPPORTED_DEVICES := c20i - TPLINK_BOARD_ID := ArcherC20i + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0xc2000001 + TPLINK_HWREV := 58 IMAGES += factory.bin DEVICE_TITLE := TP-Link ArcherC20i endef @@ -46,10 +75,12 @@ define Device/ArcherC50v1 $(Device/Archer) DTS := ArcherC50 SUPPORTED_DEVICES := c50 - TPLINK_BOARD_ID := ArcherC50 + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0xc7500001 + TPLINK_HWREV := 69 IMAGES += factory-us.bin factory-eu.bin - IMAGE/factory-us.bin := tplink-v2-image -w 0 - IMAGE/factory-eu.bin := tplink-v2-image -w 2 + IMAGE/factory-us.bin := tplink-v2-image -e -w 0 + IMAGE/factory-eu.bin := tplink-v2-image -e -w 2 DEVICE_TITLE := TP-Link ArcherC50v1 endef TARGET_DEVICES += ArcherC50v1 @@ -58,7 +89,9 @@ define Device/ArcherMR200 $(Device/Archer) DTS := ArcherMR200 SUPPORTED_DEVICES := mr200 - TPLINK_BOARD_ID := ArcherMR200 + TPLINK_FLASHLAYOUT := 8MLmtk + TPLINK_HWID := 0xd7500001 + TPLINK_HWREV := 0x4a DEVICE_PACKAGES := kmod-usb2 kmod-usb-net kmod-usb-net-rndis kmod-usb-serial kmod-usb-serial-option adb-enablemodem DEVICE_TITLE := TP-Link ArcherMR200 endef @@ -81,7 +114,9 @@ TARGET_DEVICES += cf-wr800n define Device/cs-qr10 DTS := CS-QR10 DEVICE_TITLE := Planex CS-QR10 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-i2c-core kmod-i2c-ralink kmod-sound-core kmod-sound-mtk kmod-sdhci-mt7620 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci \ + kmod-sound-core kmod-sound-mt7620 \ + kmod-i2c-ralink kmod-sdhci-mt7620 endef TARGET_DEVICES += cs-qr10 @@ -115,7 +150,7 @@ define Device/dch-m225 seama-seal -m "signature=wapn22_dlink.2013gui_dap1320b" | \ check-size $$$$(IMAGE_SIZE) DEVICE_TITLE := D-Link DCH-M225 - DEVICE_PACKAGES := kmod-mt76 + DEVICE_PACKAGES := kmod-mt76 kmod-sound-core kmod-sound-mt7620 kmod-i2c-ralink endef TARGET_DEVICES += dch-m225 @@ -171,6 +206,13 @@ define Device/gl-mt300a endef TARGET_DEVICES += gl-mt300a +define Device/u25awf-h1 + DTS := U25AWF-H1 + IMAGE_SIZE := 16064k + DEVICE_TITLE := Kimax U25AWF-H1 +endef +TARGET_DEVICES += u25awf-h1 + define Device/gl-mt300n DTS := GL-MT300N IMAGE_SIZE := $(ralink_default_fw_size_16M) @@ -219,6 +261,7 @@ define Device/kng_rc IMAGES += factory.bin IMAGE/factory.bin := $$(sysupgrade_bin) | pad-to 64k | check-size $$$$(IMAGE_SIZE) | \ zyimage -d 8997 -v "ZyXEL Keenetic Viva" + SUPPORTED_DEVICES := kng_rc endef TARGET_DEVICES += kng_rc @@ -229,6 +272,7 @@ define Device/kn_rc IMAGES += factory.bin IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | pad-to 64k | check-size $$$$(IMAGE_SIZE) | \ zyimage -d 4882 -v "ZyXEL Keenetic Omni" + SUPPORTED_DEVICES := kn_rc endef TARGET_DEVICES += kn_rc @@ -239,6 +283,7 @@ define Device/kn_rf IMAGES += factory.bin IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | pad-to 64k | check-size $$$$(IMAGE_SIZE) | \ zyimage -d 2102034 -v "ZyXEL Keenetic Omni II" + SUPPORTED_DEVICES := kn_rf endef TARGET_DEVICES += kn_rf @@ -280,18 +325,21 @@ TARGET_DEVICES += mt7620a define Device/mt7620a_mt7530 DTS := MT7620a_MT7530 DEVICE_TITLE := MediaTek MT7620a + MT7530 EVB + SUPPORTED_DEVICES := mt7620a_mt7530 endef TARGET_DEVICES += mt7620a_mt7530 define Device/mt7620a_mt7610e DTS := MT7620a_MT7610e DEVICE_TITLE := MediaTek MT7620a + MT7610e EVB + SUPPORTED_DEVICES := mt7620a_mt7610e endef TARGET_DEVICES += mt7620a_mt7610e define Device/mt7620a_v22sg DTS := MT7620a_V22SG DEVICE_TITLE := MediaTek MT7620a V22SG + SUPPORTED_DEVICES := mt7620a_v22sg endef TARGET_DEVICES += mt7620a_v22sg @@ -358,6 +406,12 @@ define Device/rp-n53 endef TARGET_DEVICES += rp-n53 +define Device/rt-n12p + DTS := RT-N12-PLUS + DEVICE_TITLE := Asus RT-N11P/RT-N12+/RT-N12Eb1 +endef +TARGET_DEVICES += rt-n12p + define Device/rt-n14u DTS := RT-N14U DEVICE_TITLE := Asus RT-N14u @@ -379,6 +433,14 @@ define Device/tiny-ac endef TARGET_DEVICES += tiny-ac +define Device/vonets_var11n-300 + DTS := VAR11N-300 + IMAGE_SIZE := $(ralink_default_fw_size_4M) + BLOCKSIZE := 4k + DEVICE_TITLE := Vonets VAR11N-300 +endef +TARGET_DEVICES += vonets_var11n-300 + define Device/whr-1166d DTS := WHR-1166D IMAGE_SIZE := 15040k @@ -456,6 +518,7 @@ define Device/wt3020-8M IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ poray-header -B WT3020 -F 8M DEVICE_TITLE := Nexx WT3020 (8MB) + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci endef TARGET_DEVICES += wt3020-8M @@ -475,11 +538,21 @@ TARGET_DEVICES += y1s define Device/youku-yk1 DTS := YOUKU-YK1 - IMAGE_SIZE := $(ralink_default_fw_size_16M) + IMAGE_SIZE := $(ralink_default_fw_size_32M) DEVICE_TITLE := YOUKU YK1 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 kmod-usb-ledtrig-usbport endef TARGET_DEVICES += youku-yk1 +define Device/we1026-5g-16m + DTS := WE1026-5G-16M + IMAGE_SIZE := 16777216 + SUPPORTED_DEVICES += we1026-5g-16m + DEVICE_TITLE := Zbtlink ZBT-WE1026-5G (16M) + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-mt76 kmod-sdhci-mt7620 +endef +TARGET_DEVICES += we1026-5g-16m + define Device/zbt-ape522ii DTS := ZBT-APE522II DEVICE_TITLE := Zbtlink ZBT-APE522II diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 779616292d..8ba65a1af2 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -121,7 +121,7 @@ define Device/mir3g SUPPORTED_DEVICES += R3G DEVICE_PACKAGES := \ kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini \ - kmod-softdog + uboot-envtools endef TARGET_DEVICES += mir3g @@ -142,6 +142,15 @@ define Device/newifi-d1 endef TARGET_DEVICES += newifi-d1 +define Device/d-team_newifi-d2 + DTS := Newifi-D2 + IMAGE_SIZE := $(ralink_default_fw_size_32M) + DEVICE_TITLE := Newifi D2 + DEVICE_PACKAGES := \ + kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += d-team_newifi-d2 + define Device/pbr-m1 DTS := PBR-M1 IMAGE_SIZE := $(ralink_default_fw_size_16M) @@ -225,6 +234,14 @@ define Device/timecloud endef TARGET_DEVICES += timecloud +define Device/u7621-06-256M-16M + DTS := U7621-06-256M-16M + IMAGE_SIZE := 16064k + DEVICE_TITLE := UniElec U7621-06 (256M RAM/16M flash) + DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 +endef +TARGET_DEVICES += u7621-06-256M-16M + define Device/ubnt-erx DTS := UBNT-ERX FILESYSTEMS := squashfs @@ -321,6 +338,16 @@ define Device/zbt-we1326 endef TARGET_DEVICES += zbt-we1326 +define Device/zbtlink_zbt-we3526 + DTS := ZBT-WE3526 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := ZBT WE3526 + DEVICE_PACKAGES := \ + kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \ + kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini +endef +TARGET_DEVICES += zbtlink_zbt-we3526 + define Device/zbt-wg2626 DTS := ZBT-WG2626 IMAGE_SIZE := $(ralink_default_fw_size_16M) diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index f4b3171a0b..8bbbcf6ad9 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -2,7 +2,22 @@ # MT76x8 Profiles # -DEVICE_VARS += TPLINK_BOARD_ID +define Device/tplink + TPLINK_FLASHLAYOUT := + TPLINK_HWID := + TPLINK_HWREV := + TPLINK_HWREVADD := + TPLINK_HVERSION := + KERNEL := $(KERNEL_DTB) + KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header -e + IMAGES += tftp-recovery.bin + IMAGE/factory.bin := tplink-v2-image -e + IMAGE/tftp-recovery.bin := pad-extra 128k | $$(IMAGE/factory.bin) + IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata | \ + check-size $$$$(IMAGE_SIZE) +endef +DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD TPLINK_HVERSION + define Device/duzun-dm06 DTS := DUZUN-DM06 @@ -64,6 +79,7 @@ define Device/omega2 DEVICE_TITLE := Onion Omega2 DEVICE_PACKAGES:= kmod-usb2 kmod-usb-ohci uboot-envtools endef +TARGET_DEVICES += omega2 define Device/omega2p DTS := OMEGA2P @@ -71,7 +87,7 @@ define Device/omega2p DEVICE_TITLE := Onion Omega2+ DEVICE_PACKAGES:= kmod-usb2 kmod-usb-ohci uboot-envtools kmod-sdhci-mt7620 endef -TARGET_DEVICES += omega2 omega2p +TARGET_DEVICES += omega2p define Device/pbr-d1 DTS := PBR-D1 @@ -82,25 +98,68 @@ endef TARGET_DEVICES += pbr-d1 define Device/tl-wr840n-v4 + $(Device/tplink) DTS := TL-WR840NV4 IMAGE_SIZE := 7808k DEVICE_TITLE := TP-Link TL-WR840N v4 - TPLINK_BOARD_ID := TL-WR840NV4 + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0x08400004 + TPLINK_HWREV := 0x1 + TPLINK_HWREVADD := 0x4 + TPLINK_HVERSION := 3 +endef +TARGET_DEVICES += tl-wr840n-v4 + +define Device/tl-wr840n-v5 + DTS := TL-WR840NV5 + IMAGE_SIZE := 3840k + DEVICE_TITLE := TP-Link TL-WR840N v5 + TPLINK_FLASHLAYOUT := 4Mmtk + TPLINK_HWID := 0x08400005 + TPLINK_HWREV := 0x1 + TPLINK_HWREVADD := 0x5 + TPLINK_HVERSION := 3 KERNEL := $(KERNEL_DTB) - IMAGES += tftp-recovery.bin - IMAGE/factory.bin := tplink-v2-image - IMAGE/tftp-recovery.bin := pad-extra 128k | $$(IMAGE/factory.bin) - IMAGE/sysupgrade.bin := tplink-v2-image -s | append-metadata | \ + KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header -e + IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata | \ check-size $$$$(IMAGE_SIZE) endef +TARGET_DEVICES += tl-wr840n-v5 define Device/tl-wr841n-v13 - $(Device/tl-wr840n-v4) + $(Device/tplink) DTS := TL-WR841NV13 + IMAGE_SIZE := 7808k DEVICE_TITLE := TP-Link TL-WR841N v13 - TPLINK_BOARD_ID := TL-WR841NV13 + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0x08410013 + TPLINK_HWREV := 0x268 + TPLINK_HWREVADD := 0x13 + TPLINK_HVERSION := 3 endef -TARGET_DEVICES += tl-wr840n-v4 tl-wr841n-v13 +TARGET_DEVICES += tl-wr841n-v13 + +define Device/tplink_tl-mr3420-v5 + $(Device/tplink) + DTS := TL-MR3420V5 + IMAGE_SIZE := 7808k + DEVICE_TITLE := TP-Link TL-MR3420 v5 + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0x34200005 + TPLINK_HWREV := 0x5 + TPLINK_HWREVADD := 0x5 + TPLINK_HVERSION := 3 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += tplink_tl-mr3420-v5 + +define Device/u7628-01-128M-16M + DTS := U7628-01-128M-16M + IMAGE_SIZE := 16064k + DEVICE_TITLE := UniElec U7628-01 (128M RAM/16M flash) + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += u7628-01-128M-16M define Device/vocore2 DTS := VOCORE2 @@ -109,6 +168,7 @@ define Device/vocore2 DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport \ kmod-sdhci-mt7620 endef +TARGET_DEVICES += vocore2 define Device/vocore2lite DTS := VOCORE2LITE @@ -117,7 +177,7 @@ define Device/vocore2lite DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport \ kmod-sdhci-mt7620 endef -TARGET_DEVICES += vocore2 vocore2lite +TARGET_DEVICES += vocore2lite define Device/wcr-1166ds DTS := WCR-1166DS @@ -156,6 +216,7 @@ define Device/wrtnode2p DEVICE_TITLE := WRTnode 2P DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport endef +TARGET_DEVICES += wrtnode2p define Device/wrtnode2r DTS := WRTNODE2R @@ -163,4 +224,4 @@ define Device/wrtnode2r DEVICE_TITLE := WRTnode 2R DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci endef -TARGET_DEVICES += wrtnode2p wrtnode2r +TARGET_DEVICES += wrtnode2r diff --git a/target/linux/ramips/mt7620/config-4.9 b/target/linux/ramips/mt7620/config-4.9 index 52c05185eb..4f8c68629e 100644 --- a/target/linux/ramips/mt7620/config-4.9 +++ b/target/linux/ramips/mt7620/config-4.9 @@ -126,7 +126,6 @@ CONFIG_MIPS_CLOCK_VSYSCALL=y # CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER is not set CONFIG_MIPS_CMDLINE_FROM_DTB=y # CONFIG_MIPS_ELF_APPENDED_DTB is not set -CONFIG_MIPS_FPU_EMULATOR=y # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 # CONFIG_MIPS_MACHINE is not set @@ -138,9 +137,11 @@ CONFIG_MODULES_USE_ELF_REL=y # CONFIG_MTD_CFI_INTELEXT is not set CONFIG_MTD_CMDLINE_PARTS=y CONFIG_MTD_M25P80=y +CONFIG_MTD_NAND_MT7620=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384 CONFIG_MTD_SPLIT_FIRMWARE=y CONFIG_MTD_SPLIT_SEAMA_FW=y CONFIG_MTD_SPLIT_TPLINK_FW=y diff --git a/target/linux/ramips/mt7621/config-4.9 b/target/linux/ramips/mt7621/config-4.9 index ce8ba450cf..f9765edaf2 100644 --- a/target/linux/ramips/mt7621/config-4.9 +++ b/target/linux/ramips/mt7621/config-4.9 @@ -5,7 +5,6 @@ CONFIG_ARCH_HAS_ELF_RANDOMIZE=y # CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set CONFIG_ARCH_HAS_RESET_CONTROLLER=y # CONFIG_ARCH_HAS_SG_CHAIN is not set -CONFIG_ARCH_HAS_TICK_BROADCAST=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y @@ -65,7 +64,6 @@ CONFIG_EARLY_PRINTK=y CONFIG_FIXED_PHY=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_CMOS_UPDATE=y CONFIG_GENERIC_IO=y CONFIG_GENERIC_IRQ_CHIP=y @@ -151,7 +149,6 @@ CONFIG_MIPS_CPS=y # CONFIG_MIPS_CPS_NS16550 is not set CONFIG_MIPS_CPU_SCACHE=y # CONFIG_MIPS_ELF_APPENDED_DTB is not set -CONFIG_MIPS_FPU_EMULATOR=y CONFIG_MIPS_GIC=y # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 @@ -255,8 +252,8 @@ CONFIG_SPI_MASTER=y CONFIG_SPI_MT7621=y # CONFIG_SPI_RT2880 is not set CONFIG_SRCU=y -CONFIG_SWCONFIG=y CONFIG_SWCONFIG_LEDS=y +CONFIG_SWCONFIG=y CONFIG_SWPHY=y CONFIG_SYNC_R4K=y CONFIG_SYSCTL_EXCEPTION_TRACE=y @@ -283,7 +280,6 @@ CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y CONFIG_WATCHDOG_CORE=y CONFIG_WEAK_ORDERING=y -CONFIG_WEAK_REORDERING_BEYOND_LLSC=y CONFIG_XPS=y CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/ramips/patches-4.9/0013-owrt-hack-fix-mt7688-cache-issue.patch b/target/linux/ramips/patches-4.9/0013-owrt-hack-fix-mt7688-cache-issue.patch index 8602801587..0a3ef365fa 100644 --- a/target/linux/ramips/patches-4.9/0013-owrt-hack-fix-mt7688-cache-issue.patch +++ b/target/linux/ramips/patches-4.9/0013-owrt-hack-fix-mt7688-cache-issue.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c -@@ -774,7 +774,6 @@ static void __init arch_mem_init(char ** +@@ -846,7 +846,6 @@ static void __init arch_mem_init(char ** crashk_res.end - crashk_res.start + 1, BOOTMEM_DEFAULT); #endif @@ -18,7 +18,7 @@ Signed-off-by: John Crispin sparse_init(); plat_swiotlb_setup(); -@@ -890,6 +889,7 @@ void __init setup_arch(char **cmdline_p) +@@ -962,6 +961,7 @@ void __init setup_arch(char **cmdline_p) cpu_cache_init(); paging_init(); diff --git a/target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch b/target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch index 2225454d19..0dfd4c233c 100644 --- a/target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch +++ b/target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch @@ -14,7 +14,7 @@ Signed-off-by: John Crispin --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -617,6 +617,8 @@ config RALINK +@@ -619,6 +619,8 @@ config RALINK select CLKDEV_LOOKUP select ARCH_HAS_RESET_CONTROLLER select RESET_CONTROLLER @@ -25,7 +25,7 @@ Signed-off-by: John Crispin bool "SGI IP22 (Indy/Indigo2)" --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig -@@ -115,6 +115,11 @@ config PINCTRL_LPC18XX +@@ -116,6 +116,11 @@ config PINCTRL_LPC18XX help Pinctrl driver for NXP LPC18xx/43xx System Control Unit (SCU). diff --git a/target/linux/ramips/patches-4.9/0028-GPIO-ralink-add-mt7621-gpio-controller.patch b/target/linux/ramips/patches-4.9/0028-GPIO-ralink-add-mt7621-gpio-controller.patch index ca3dc84641..3b84aefd08 100644 --- a/target/linux/ramips/patches-4.9/0028-GPIO-ralink-add-mt7621-gpio-controller.patch +++ b/target/linux/ramips/patches-4.9/0028-GPIO-ralink-add-mt7621-gpio-controller.patch @@ -14,7 +14,7 @@ Signed-off-by: John Crispin --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -619,6 +619,9 @@ config RALINK +@@ -621,6 +621,9 @@ config RALINK select RESET_CONTROLLER select PINCTRL select PINCTRL_RT2880 diff --git a/target/linux/ramips/patches-4.9/0034-NET-multi-phy-support.patch b/target/linux/ramips/patches-4.9/0034-NET-multi-phy-support.patch index c19c3cd35a..4d7f590285 100644 --- a/target/linux/ramips/patches-4.9/0034-NET-multi-phy-support.patch +++ b/target/linux/ramips/patches-4.9/0034-NET-multi-phy-support.patch @@ -43,7 +43,7 @@ Signed-off-by: John Crispin } --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -373,6 +373,7 @@ struct phy_device { +@@ -369,6 +369,7 @@ struct phy_device { bool is_pseudo_fixed_link; bool has_fixups; bool suspended; diff --git a/target/linux/ramips/patches-4.9/0039-mtd-add-mt7621-nand-support.patch b/target/linux/ramips/patches-4.9/0039-mtd-add-mt7621-nand-support.patch index f3fc9767a3..f5b1d82347 100644 --- a/target/linux/ramips/patches-4.9/0039-mtd-add-mt7621-nand-support.patch +++ b/target/linux/ramips/patches-4.9/0039-mtd-add-mt7621-nand-support.patch @@ -3379,7 +3379,7 @@ Signed-off-by: John Crispin + data |= ((0x2<<18) |(0x2<<16)); + DRV_WriteReg32(RALINK_SYSCTL_BASE+0x60, data); + -+ hw = &mt7621_nand_hw, ++ hw = &mt7621_nand_hw; + BUG_ON(!hw); + /* Allocate memory for the device structure (and zero it) */ + host = kzalloc(sizeof(struct mtk_nand_host), GFP_KERNEL); @@ -4302,7 +4302,7 @@ Signed-off-by: John Crispin +#endif /* __NAND_DEF_H__ */ --- /dev/null +++ b/drivers/mtd/nand/nand_device_list.h -@@ -0,0 +1,55 @@ +@@ -0,0 +1,56 @@ +/* Copyright Statement: + * + * This software/firmware and related documentation ("MediaTek Software") are @@ -4345,6 +4345,7 @@ Signed-off-by: John Crispin + {0x20BC, 0x105554, 5, 16, 512, 128, 2048, 64, 0x1123, "EHD013151MA_5", 0}, + {0xECBC, 0x005554, 5, 16, 512, 128, 2048, 64, 0x1123, "K524G2GACB_A0", 0}, + {0x2CBC, 0x905556, 5, 16, 512, 128, 2048, 64, 0x21044333, "MT29C4G96MAZA", 0}, ++ {0x2CDA, 0x909506, 5, 8, 256, 128, 2048, 64, 0x30C77fff, "MT29F2G08ABAE", 0}, + {0xADBC, 0x905554, 5, 16, 512, 128, 2048, 64, 0x10801011, "H9DA4GH4JJAMC", 0}, + {0x01F1, 0x801D01, 4, 8, 128, 128, 2048, 64, 0x30C77fff, "S34ML01G100TF", 0}, + {0x92F1, 0x8095FF, 4, 8, 128, 128, 2048, 64, 0x30C77fff, "F59L1G81A", 0}, diff --git a/target/linux/ramips/patches-4.9/0040-nand-hack.patch b/target/linux/ramips/patches-4.9/0040-nand-hack.patch index 64a325300e..e0bd5f6026 100644 --- a/target/linux/ramips/patches-4.9/0040-nand-hack.patch +++ b/target/linux/ramips/patches-4.9/0040-nand-hack.patch @@ -18,7 +18,7 @@ if (ret < 0) { if (use_bufpoi) /* Invalidate page cache */ -@@ -3203,8 +3207,11 @@ int nand_erase_nand(struct mtd_info *mtd +@@ -3206,8 +3210,11 @@ int nand_erase_nand(struct mtd_info *mtd (page + pages_per_block)) chip->pagebuf = -1; @@ -31,7 +31,7 @@ /* * See if operation failed and additional status checks are * available -@@ -4398,6 +4405,7 @@ int nand_scan_ident(struct mtd_info *mtd +@@ -4401,6 +4408,7 @@ int nand_scan_ident(struct mtd_info *mtd * cmdfunc() both expect cmd_ctrl() to be populated, * so we need to check that that's the case */ @@ -41,7 +41,7 @@ } --- a/drivers/mtd/nand/nand_device_list.h +++ b/drivers/mtd/nand/nand_device_list.h -@@ -43,6 +43,8 @@ static const flashdev_info gen_FlashTabl +@@ -44,6 +44,8 @@ static const flashdev_info gen_FlashTabl {0xADBC, 0x905554, 5, 16, 512, 128, 2048, 64, 0x10801011, "H9DA4GH4JJAMC", 0}, {0x01F1, 0x801D01, 4, 8, 128, 128, 2048, 64, 0x30C77fff, "S34ML01G100TF", 0}, {0x92F1, 0x8095FF, 4, 8, 128, 128, 2048, 64, 0x30C77fff, "F59L1G81A", 0}, diff --git a/target/linux/ramips/patches-4.9/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch b/target/linux/ramips/patches-4.9/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch new file mode 100644 index 0000000000..9d45ad010d --- /dev/null +++ b/target/linux/ramips/patches-4.9/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch @@ -0,0 +1,214 @@ +mtd: spi-nor: add support for switching between 3-byte and 4-byte addressing on w25q256 flash + +On some devices the flash chip needs to be in 3-byte addressing mode during +reboot, otherwise the boot loader will fail to start. +This mode however does not allow regular reads/writes onto the upper 16M +half. W25Q256 has separate read commands for reading from >16M, however +it does not have any separate write commands. +This patch changes the code to leave the chip in 3-byte mode most of the +time and only switch during erase/write cycles that go to >16M +addresses. + +Signed-off-by: Felix Fietkau +--- +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -85,6 +85,10 @@ struct flash_info { + * Use dedicated 4byte address op codes + * to support memory size above 128Mib. + */ ++#define SPI_NOR_4B_READ_OP BIT(12) /* ++ * Like SPI_NOR_4B_OPCODES, but for read ++ * op code only. ++ */ + }; + + #define JEDEC_MFR(info) ((info)->id[0]) +@@ -250,6 +254,15 @@ static inline u8 spi_nor_convert_3to4_er + ARRAY_SIZE(spi_nor_3to4_erase)); + } + ++static void spi_nor_set_4byte_read(struct spi_nor *nor, ++ const struct flash_info *info) ++{ ++ nor->addr_width = 3; ++ nor->ext_addr = 0; ++ nor->read_opcode = spi_nor_convert_3to4_read(nor->read_opcode); ++ nor->flags |= SNOR_F_4B_EXT_ADDR; ++} ++ + static void spi_nor_set_4byte_opcodes(struct spi_nor *nor, + const struct flash_info *info) + { +@@ -467,6 +480,36 @@ static int spi_nor_erase_sector(struct s + return nor->write_reg(nor, nor->erase_opcode, buf, nor->addr_width); + } + ++static int spi_nor_check_ext_addr(struct spi_nor *nor, u32 addr) ++{ ++ bool ext_addr; ++ int ret; ++ u8 cmd; ++ ++ if (!(nor->flags & SNOR_F_4B_EXT_ADDR)) ++ return 0; ++ ++ ext_addr = !!(addr & 0xff000000); ++ if (nor->ext_addr == ext_addr) ++ return 0; ++ ++ cmd = ext_addr ? SPINOR_OP_EN4B : SPINOR_OP_EX4B; ++ write_enable(nor); ++ ret = nor->write_reg(nor, cmd, NULL, 0); ++ if (ret) ++ return ret; ++ ++ cmd = 0; ++ ret = nor->write_reg(nor, SPINOR_OP_WREAR, &cmd, 1); ++ if (ret) ++ return ret; ++ ++ nor->addr_width = 3 + ext_addr; ++ nor->ext_addr = ext_addr; ++ write_disable(nor); ++ return 0; ++} ++ + /* + * Erase an address range on the nor chip. The address range may extend + * one or more erase sectors. Return an error is there is a problem erasing. +@@ -492,6 +535,10 @@ static int spi_nor_erase(struct mtd_info + if (ret) + return ret; + ++ ret = spi_nor_check_ext_addr(nor, addr + len); ++ if (ret) ++ return ret; ++ + /* whole-chip erase? */ + if (len == mtd->size && !(nor->flags & SNOR_F_NO_OP_CHIP_ERASE)) { + unsigned long timeout; +@@ -542,6 +589,7 @@ static int spi_nor_erase(struct mtd_info + write_disable(nor); + + erase_err: ++ spi_nor_check_ext_addr(nor, 0); + spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_ERASE); + + instr->state = ret ? MTD_ERASE_FAILED : MTD_ERASE_DONE; +@@ -834,7 +882,9 @@ static int spi_nor_lock(struct mtd_info + if (ret) + return ret; + ++ spi_nor_check_ext_addr(nor, ofs + len); + ret = nor->flash_lock(nor, ofs, len); ++ spi_nor_check_ext_addr(nor, 0); + + spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_UNLOCK); + return ret; +@@ -849,7 +899,9 @@ static int spi_nor_unlock(struct mtd_inf + if (ret) + return ret; + ++ spi_nor_check_ext_addr(nor, ofs + len); + ret = nor->flash_unlock(nor, ofs, len); ++ spi_nor_check_ext_addr(nor, 0); + + spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_LOCK); + return ret; +@@ -1151,7 +1203,7 @@ static const struct flash_info spi_nor_i + { "w25q80", INFO(0xef5014, 0, 64 * 1024, 16, SECT_4K) }, + { "w25q80bl", INFO(0xef4014, 0, 64 * 1024, 16, SECT_4K) }, + { "w25q128", INFO(0xef4018, 0, 64 * 1024, 256, SECT_4K) }, +- { "w25q256", INFO(0xef4019, 0, 64 * 1024, 512, SECT_4K) }, ++ { "w25q256", INFO(0xef4019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_4B_READ_OP) }, + + /* Catalyst / On Semiconductor -- non-JEDEC */ + { "cat25c11", CAT25_INFO( 16, 8, 16, 1, SPI_NOR_NO_ERASE | SPI_NOR_NO_FR) }, +@@ -1205,6 +1257,9 @@ static int spi_nor_read(struct mtd_info + if (ret) + return ret; + ++ if (nor->flags & SNOR_F_4B_EXT_ADDR) ++ nor->addr_width = 4; ++ + while (len) { + loff_t addr = from; + +@@ -1229,6 +1284,18 @@ static int spi_nor_read(struct mtd_info + ret = 0; + + read_err: ++ if (nor->flags & SNOR_F_4B_EXT_ADDR) { ++ u8 val = 0; ++ ++ if ((from + len) & 0xff000000) { ++ write_enable(nor); ++ nor->write_reg(nor, SPINOR_OP_WREAR, &val, 1); ++ write_disable(nor); ++ } ++ ++ nor->addr_width = 3; ++ } ++ + spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_READ); + return ret; + } +@@ -1330,6 +1397,10 @@ static int spi_nor_write(struct mtd_info + if (ret) + return ret; + ++ ret = spi_nor_check_ext_addr(nor, to + len); ++ if (ret < 0) ++ return ret; ++ + for (i = 0; i < len; ) { + ssize_t written; + loff_t addr = to + i; +@@ -1377,6 +1448,7 @@ static int spi_nor_write(struct mtd_info + } + + write_err: ++ spi_nor_check_ext_addr(nor, 0); + spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_WRITE); + return ret; + } +@@ -1717,8 +1789,10 @@ int spi_nor_scan(struct spi_nor *nor, co + else if (mtd->size > 0x1000000) { + /* enable 4-byte addressing if the device exceeds 16MiB */ + nor->addr_width = 4; +- if (JEDEC_MFR(info) == SNOR_MFR_SPANSION || +- info->flags & SPI_NOR_4B_OPCODES) ++ if (info->flags & SPI_NOR_4B_READ_OP) ++ spi_nor_set_4byte_read(nor, info); ++ else if (JEDEC_MFR(info) == SNOR_MFR_SPANSION || ++ info->flags & SPI_NOR_4B_OPCODES) + spi_nor_set_4byte_opcodes(nor, info); + else + set_4byte(nor, info, 1); +--- a/include/linux/mtd/spi-nor.h ++++ b/include/linux/mtd/spi-nor.h +@@ -90,6 +90,7 @@ + /* Used for Macronix and Winbond flashes. */ + #define SPINOR_OP_EN4B 0xb7 /* Enter 4-byte mode */ + #define SPINOR_OP_EX4B 0xe9 /* Exit 4-byte mode */ ++#define SPINOR_OP_WREAR 0xc5 /* Write extended address register */ + + /* Used for Spansion flashes only. */ + #define SPINOR_OP_BRWR 0x17 /* Bank register write */ +@@ -141,6 +142,7 @@ enum spi_nor_option_flags { + SNOR_F_NO_OP_CHIP_ERASE = BIT(2), + SNOR_F_S3AN_ADDR_DEFAULT = BIT(3), + SNOR_F_READY_XSR_RDY = BIT(4), ++ SNOR_F_4B_EXT_ADDR = BIT(5), + }; + + /** +@@ -188,6 +190,7 @@ struct spi_nor { + enum read_mode flash_read; + bool sst_write_second; + u32 flags; ++ u8 ext_addr; + u8 cmd_buf[SPI_NOR_MAX_CMD_SIZE]; + + int (*prepare)(struct spi_nor *nor, enum spi_nor_ops ops); diff --git a/target/linux/ramips/patches-4.9/0054-mtd-add-chunked-read-io-to-m25p80.patch b/target/linux/ramips/patches-4.9/0054-mtd-add-chunked-read-io-to-m25p80.patch index 40994fb8d3..0a429d2bcd 100644 --- a/target/linux/ramips/patches-4.9/0054-mtd-add-chunked-read-io-to-m25p80.patch +++ b/target/linux/ramips/patches-4.9/0054-mtd-add-chunked-read-io-to-m25p80.patch @@ -1,6 +1,6 @@ --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1381,6 +1381,66 @@ write_err: +@@ -1453,6 +1453,67 @@ write_err: return ret; } @@ -8,6 +8,7 @@ + size_t *_retlen, const u_char *_buf) +{ + struct spi_nor *nor = mtd_to_spi_nor(mtd); ++ u32 addr_width = nor->addr_width + !!(nor->flags & SNOR_F_4B_EXT_ADDR); + int chunk_size; + int retlen = 0; + int ret; @@ -16,8 +17,8 @@ + if (!chunk_size) + chunk_size = _len; + -+ if (nor->addr_width > 3) -+ chunk_size -= nor->addr_width - 3; ++ if (addr_width > 3) ++ chunk_size -= addr_width - 3; + + while (retlen < _len) { + size_t len = min_t(int, chunk_size, _len - retlen); @@ -67,7 +68,7 @@ static int macronix_quad_enable(struct spi_nor *nor) { int ret, val; -@@ -1630,10 +1690,12 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1702,10 +1763,12 @@ int spi_nor_scan(struct spi_nor *nor, co } /* sst nor chips use AAI word program */ @@ -82,7 +83,7 @@ if (info->flags & USE_FSR) nor->flags |= SNOR_F_USE_FSR; -@@ -1663,11 +1725,20 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1737,11 +1800,20 @@ int spi_nor_scan(struct spi_nor *nor, co mtd->writebufsize = nor->page_size; if (np) { @@ -105,15 +106,15 @@ nor->flash_read = SPI_NOR_FAST; --- a/include/linux/mtd/spi-nor.h +++ b/include/linux/mtd/spi-nor.h -@@ -141,6 +141,7 @@ enum spi_nor_option_flags { - SNOR_F_NO_OP_CHIP_ERASE = BIT(2), +@@ -143,6 +143,7 @@ enum spi_nor_option_flags { SNOR_F_S3AN_ADDR_DEFAULT = BIT(3), SNOR_F_READY_XSR_RDY = BIT(4), -+ SNOR_F_SST = BIT(5), + SNOR_F_4B_EXT_ADDR = BIT(5), ++ SNOR_F_SST = BIT(6), }; /** -@@ -180,6 +181,7 @@ struct spi_nor { +@@ -182,6 +183,7 @@ struct spi_nor { struct mutex lock; struct device *dev; u32 page_size; diff --git a/target/linux/ramips/patches-4.9/0063-set-CM_GCR_BASE_CMDEFTGT_MEM-according-to-datasheet.patch b/target/linux/ramips/patches-4.9/0063-set-CM_GCR_BASE_CMDEFTGT_MEM-according-to-datasheet.patch deleted file mode 100644 index d950c47573..0000000000 --- a/target/linux/ramips/patches-4.9/0063-set-CM_GCR_BASE_CMDEFTGT_MEM-according-to-datasheet.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/arch/mips/include/asm/mips-cm.h -+++ b/arch/mips/include/asm/mips-cm.h -@@ -239,8 +239,7 @@ BUILD_CM_Cx_R_(tcid_8_priority, 0x80) - #define CM_GCR_BASE_GCRBASE_MSK (_ULCAST_(0x1ffff) << 15) - #define CM_GCR_BASE_CMDEFTGT_SHF 0 - #define CM_GCR_BASE_CMDEFTGT_MSK (_ULCAST_(0x3) << 0) --#define CM_GCR_BASE_CMDEFTGT_DISABLED 0 --#define CM_GCR_BASE_CMDEFTGT_MEM 1 -+#define CM_GCR_BASE_CMDEFTGT_MEM 0 - #define CM_GCR_BASE_CMDEFTGT_IOCU0 2 - #define CM_GCR_BASE_CMDEFTGT_IOCU1 3 - diff --git a/target/linux/ramips/patches-4.9/0099-pci-mt7620.patch b/target/linux/ramips/patches-4.9/0099-pci-mt7620.patch index f532f30db8..997fb6a2b3 100644 --- a/target/linux/ramips/patches-4.9/0099-pci-mt7620.patch +++ b/target/linux/ramips/patches-4.9/0099-pci-mt7620.patch @@ -8,12 +8,3 @@ #define PPLL_DRV 0xa0 #define PDRV_SW_SET (1<<31) -@@ -121,7 +120,7 @@ static int wait_pciephy_busy(void) - else - break; - if (retry++ > WAITRETRY_MAX) { -- printk(KERN_WARN "PCIE-PHY retry failed.\n"); -+ pr_warn("PCIE-PHY retry failed.\n"); - return -1; - } - } diff --git a/target/linux/ramips/patches-4.9/0901-spansion_nand_id_fix.patch b/target/linux/ramips/patches-4.9/0901-spansion_nand_id_fix.patch index 4edc7416a7..daaa0aca65 100644 --- a/target/linux/ramips/patches-4.9/0901-spansion_nand_id_fix.patch +++ b/target/linux/ramips/patches-4.9/0901-spansion_nand_id_fix.patch @@ -13,7 +13,7 @@ Signed-off-by: Nikolay Martynov --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c -@@ -3850,6 +3850,7 @@ static void nand_decode_ext_id(struct mt +@@ -3853,6 +3853,7 @@ static void nand_decode_ext_id(struct mt /* * Field definitions are in the following datasheets: * Old style (4,5 byte ID): Samsung K9GAG08U0M (p.32) @@ -21,7 +21,7 @@ Signed-off-by: Nikolay Martynov * New Samsung (6 byte ID): Samsung K9GAG08U0F (p.44) * Hynix MLC (6 byte ID): Hynix H27UBG8T2B (p.22) * -@@ -3947,6 +3948,19 @@ static void nand_decode_ext_id(struct mt +@@ -3950,6 +3951,19 @@ static void nand_decode_ext_id(struct mt *busw = (extid & 0x01) ? NAND_BUSWIDTH_16 : 0; /* diff --git a/target/linux/ramips/rt305x/config-4.9 b/target/linux/ramips/rt305x/config-4.9 index d7b53038d4..ae843f3720 100644 --- a/target/linux/ramips/rt305x/config-4.9 +++ b/target/linux/ramips/rt305x/config-4.9 @@ -134,6 +134,7 @@ CONFIG_MTD_M25P80=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384 CONFIG_MTD_SPLIT_FIRMWARE=y CONFIG_MTD_SPLIT_SEAMA_FW=y CONFIG_MTD_SPLIT_UIMAGE_FW=y diff --git a/target/linux/ramips/rt3883/config-4.9 b/target/linux/ramips/rt3883/config-4.9 index 3e6b73f80c..3b116e560f 100644 --- a/target/linux/ramips/rt3883/config-4.9 +++ b/target/linux/ramips/rt3883/config-4.9 @@ -134,6 +134,7 @@ CONFIG_MTD_M25P80=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384 CONFIG_MTD_SPLIT_FIRMWARE=y CONFIG_MTD_SPLIT_SEAMA_FW=y CONFIG_MTD_SPLIT_UIMAGE_FW=y diff --git a/target/linux/rb532/Makefile b/target/linux/rb532/Makefile index e95524aed2..7979bb4b85 100644 --- a/target/linux/rb532/Makefile +++ b/target/linux/rb532/Makefile @@ -10,8 +10,9 @@ ARCH:=mipsel BOARD:=rb532 BOARDNAME:=Mikrotik RouterBoard 532 FEATURES:=pci targz squashfs minor nand +MAINTAINER:=Roman Yeryomin -KERNEL_PATCHVER:=4.4 +KERNEL_PATCHVER:=4.9 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/rb532/base-files/etc/config/network b/target/linux/rb532/base-files/etc/config/network index 75a14a7308..c689d63278 100644 --- a/target/linux/rb532/base-files/etc/config/network +++ b/target/linux/rb532/base-files/etc/config/network @@ -11,6 +11,7 @@ config interface wan option proto dhcp config interface lan + option type bridge option ifname eth2 option proto static option ipaddr 192.168.1.1 diff --git a/target/linux/rb532/config-4.4 b/target/linux/rb532/config-4.9 similarity index 98% rename from target/linux/rb532/config-4.4 rename to target/linux/rb532/config-4.9 index 7d0bb3ab15..9290a1869a 100644 --- a/target/linux/rb532/config-4.4 +++ b/target/linux/rb532/config-4.9 @@ -61,7 +61,6 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GLOB=y CONFIG_GPIOLIB=y -CONFIG_GPIO_DEVRES=y CONFIG_GPIO_SYSFS=y CONFIG_HARDWARE_WATCHPOINTS=y CONFIG_HAS_DMA=y @@ -74,7 +73,6 @@ CONFIG_HAVE_ARCH_KGDB=y CONFIG_HAVE_ARCH_SECCOMP_FILTER=y CONFIG_HAVE_ARCH_TRACEHOOK=y # CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_HAVE_BPF_JIT=y CONFIG_HAVE_CC_STACKPROTECTOR=y CONFIG_HAVE_CONTEXT_TRACKING=y CONFIG_HAVE_C_RECORDMCOUNT=y @@ -89,7 +87,6 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y CONFIG_HAVE_FUNCTION_TRACER=y CONFIG_HAVE_GENERIC_DMA_COHERENT=y CONFIG_HAVE_IDE=y -CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y CONFIG_HAVE_LATENCYTOP_SUPPORT=y CONFIG_HAVE_MEMBLOCK=y @@ -100,6 +97,7 @@ CONFIG_HAVE_OPROFILE=y CONFIG_HAVE_PERF_EVENTS=y CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +# CONFIG_HIGH_RES_TIMERS is not set CONFIG_HW_HAS_PCI=y CONFIG_HW_RANDOM=y CONFIG_HZ=250 @@ -157,6 +155,7 @@ CONFIG_PERF_USE_VMALLOC=y CONFIG_PGTABLE_LEVELS=2 CONFIG_RC32434_WDT=y # CONFIG_RCU_STALL_COMMON is not set +# CONFIG_SCHED_HRTICK is not set # CONFIG_SCHED_INFO is not set CONFIG_SCSI=y # CONFIG_SCSI_LOWLEVEL is not set diff --git a/target/linux/rb532/image/Makefile b/target/linux/rb532/image/Makefile index 06255c60ed..12265fe2c6 100644 --- a/target/linux/rb532/image/Makefile +++ b/target/linux/rb532/image/Makefile @@ -85,7 +85,7 @@ define Image/Build $(CP) $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-$(1).kernel $(STAGING_DIR_HOST)/bin/patch-cmdline $(BIN_DIR)/$(IMG_PREFIX)-$(1).kernel 'root=/dev/sda2 ' ./gen_image.sh $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).bin \ - 5 $(BIN_DIR)/$(IMG_PREFIX)-$(1).kernel \ + 6 $(BIN_DIR)/$(IMG_PREFIX)-$(1).kernel \ $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(KDIR)/root.$(1) \ 128 endef diff --git a/target/linux/rb532/patches-4.4/002-rb532_nand_fixup.patch b/target/linux/rb532/patches-4.4/002-rb532_nand_fixup.patch deleted file mode 100644 index 3172d0384a..0000000000 --- a/target/linux/rb532/patches-4.4/002-rb532_nand_fixup.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- a/arch/mips/rb532/devices.c -+++ b/arch/mips/rb532/devices.c -@@ -141,6 +141,19 @@ static struct platform_device cf_slot0 = - }; - - /* Resources and device for NAND */ -+ -+/* -+ * We need to use the OLD Yaffs-1 OOB layout, otherwise the RB bootloader -+ * will not be able to find the kernel that we load. So set the oobinfo -+ * when creating the partitions -+ */ -+static struct nand_ecclayout rb532_nand_ecclayout = { -+ .eccbytes = 6, -+ .eccpos = { 8, 9, 10, 13, 14, 15 }, -+ .oobavail = 9, -+ .oobfree = { { 0, 4 }, { 6, 2 }, { 11, 2 }, { 4, 1 } } -+}; -+ - static int rb532_dev_ready(struct mtd_info *mtd) - { - return gpio_get_value(GPIO_RDY); -@@ -255,6 +268,16 @@ static struct platform_device *rb532_dev - /* NAND definitions */ - #define NAND_CHIP_DELAY 25 - -+static int rb532_nand_fixup(struct mtd_info *mtd) -+{ -+ struct nand_chip *chip = mtd->priv; -+ -+ if (mtd->writesize == 512) -+ chip->ecc.layout = &rb532_nand_ecclayout; -+ -+ return 0; -+} -+ - static void __init rb532_nand_setup(void) - { - switch (mips_machtype) { -@@ -273,6 +296,7 @@ static void __init rb532_nand_setup(void - rb532_nand_data.chip.nr_partitions = ARRAY_SIZE(rb532_partition_info); - rb532_nand_data.chip.partitions = rb532_partition_info; - rb532_nand_data.chip.chip_delay = NAND_CHIP_DELAY; -+ rb532_nand_data.chip.chip_fixup = &rb532_nand_fixup; - } - - diff --git a/target/linux/rb532/patches-4.4/001-cmdline_hack.patch b/target/linux/rb532/patches-4.9/001-cmdline_hack.patch similarity index 100% rename from target/linux/rb532/patches-4.4/001-cmdline_hack.patch rename to target/linux/rb532/patches-4.9/001-cmdline_hack.patch diff --git a/target/linux/rb532/patches-4.4/004-rb532-fix-partition-info.patch b/target/linux/rb532/patches-4.9/004-rb532-fix-partition-info.patch similarity index 85% rename from target/linux/rb532/patches-4.4/004-rb532-fix-partition-info.patch rename to target/linux/rb532/patches-4.9/004-rb532-fix-partition-info.patch index fd23e09e45..5161a233dd 100644 --- a/target/linux/rb532/patches-4.4/004-rb532-fix-partition-info.patch +++ b/target/linux/rb532/patches-4.9/004-rb532-fix-partition-info.patch @@ -1,6 +1,6 @@ --- a/arch/mips/rb532/devices.c +++ b/arch/mips/rb532/devices.c -@@ -199,11 +199,11 @@ static struct platform_device nand_slot0 +@@ -186,11 +186,11 @@ static struct platform_device nand_slot0 static struct mtd_partition rb532_partition_info[] = { { diff --git a/target/linux/rb532/patches-4.9/106-dont-use-rx-overflow-and-tx-underflow-interrupts.patch b/target/linux/rb532/patches-4.9/106-dont-use-rx-overflow-and-tx-underflow-interrupts.patch new file mode 100644 index 0000000000..e75079b12f --- /dev/null +++ b/target/linux/rb532/patches-4.9/106-dont-use-rx-overflow-and-tx-underflow-interrupts.patch @@ -0,0 +1,156 @@ +--- a/drivers/net/ethernet/korina.c ++++ b/drivers/net/ethernet/korina.c +@@ -122,8 +122,6 @@ struct korina_private { + + int rx_irq; + int tx_irq; +- int ovr_irq; +- int und_irq; + + spinlock_t lock; /* NIC xmit lock */ + +@@ -890,8 +888,6 @@ static void korina_restart_task(struct w + */ + disable_irq(lp->rx_irq); + disable_irq(lp->tx_irq); +- disable_irq(lp->ovr_irq); +- disable_irq(lp->und_irq); + + writel(readl(&lp->tx_dma_regs->dmasm) | + DMA_STAT_FINI | DMA_STAT_ERR, +@@ -910,40 +906,10 @@ static void korina_restart_task(struct w + } + korina_multicast_list(dev); + +- enable_irq(lp->und_irq); +- enable_irq(lp->ovr_irq); + enable_irq(lp->tx_irq); + enable_irq(lp->rx_irq); + } + +-static void korina_clear_and_restart(struct net_device *dev, u32 value) +-{ +- struct korina_private *lp = netdev_priv(dev); +- +- netif_stop_queue(dev); +- writel(value, &lp->eth_regs->ethintfc); +- schedule_work(&lp->restart_task); +-} +- +-/* Ethernet Tx Underflow interrupt */ +-static irqreturn_t korina_und_interrupt(int irq, void *dev_id) +-{ +- struct net_device *dev = dev_id; +- struct korina_private *lp = netdev_priv(dev); +- unsigned int und; +- +- spin_lock(&lp->lock); +- +- und = readl(&lp->eth_regs->ethintfc); +- +- if (und & ETH_INT_FC_UND) +- korina_clear_and_restart(dev, und & ~ETH_INT_FC_UND); +- +- spin_unlock(&lp->lock); +- +- return IRQ_HANDLED; +-} +- + static void korina_tx_timeout(struct net_device *dev) + { + struct korina_private *lp = netdev_priv(dev); +@@ -951,25 +917,6 @@ static void korina_tx_timeout(struct net + schedule_work(&lp->restart_task); + } + +-/* Ethernet Rx Overflow interrupt */ +-static irqreturn_t +-korina_ovr_interrupt(int irq, void *dev_id) +-{ +- struct net_device *dev = dev_id; +- struct korina_private *lp = netdev_priv(dev); +- unsigned int ovr; +- +- spin_lock(&lp->lock); +- ovr = readl(&lp->eth_regs->ethintfc); +- +- if (ovr & ETH_INT_FC_OVR) +- korina_clear_and_restart(dev, ovr & ~ETH_INT_FC_OVR); +- +- spin_unlock(&lp->lock); +- +- return IRQ_HANDLED; +-} +- + #ifdef CONFIG_NET_POLL_CONTROLLER + static void korina_poll_controller(struct net_device *dev) + { +@@ -992,8 +939,7 @@ static int korina_open(struct net_device + } + + /* Install the interrupt handler +- * that handles the Done Finished +- * Ovr and Und Events */ ++ * that handles the Done Finished */ + ret = request_irq(lp->rx_irq, korina_rx_dma_interrupt, + 0, "Korina ethernet Rx", dev); + if (ret < 0) { +@@ -1009,31 +955,10 @@ static int korina_open(struct net_device + goto err_free_rx_irq; + } + +- /* Install handler for overrun error. */ +- ret = request_irq(lp->ovr_irq, korina_ovr_interrupt, +- 0, "Ethernet Overflow", dev); +- if (ret < 0) { +- printk(KERN_ERR "%s: unable to get OVR IRQ %d\n", +- dev->name, lp->ovr_irq); +- goto err_free_tx_irq; +- } +- +- /* Install handler for underflow error. */ +- ret = request_irq(lp->und_irq, korina_und_interrupt, +- 0, "Ethernet Underflow", dev); +- if (ret < 0) { +- printk(KERN_ERR "%s: unable to get UND IRQ %d\n", +- dev->name, lp->und_irq); +- goto err_free_ovr_irq; +- } + mod_timer(&lp->media_check_timer, jiffies + 1); + out: + return ret; + +-err_free_ovr_irq: +- free_irq(lp->ovr_irq, dev); +-err_free_tx_irq: +- free_irq(lp->tx_irq, dev); + err_free_rx_irq: + free_irq(lp->rx_irq, dev); + err_release: +@@ -1051,8 +976,6 @@ static int korina_close(struct net_devic + /* Disable interrupts */ + disable_irq(lp->rx_irq); + disable_irq(lp->tx_irq); +- disable_irq(lp->ovr_irq); +- disable_irq(lp->und_irq); + + korina_abort_tx(dev); + tmp = readl(&lp->tx_dma_regs->dmasm); +@@ -1072,8 +995,6 @@ static int korina_close(struct net_devic + + free_irq(lp->rx_irq, dev); + free_irq(lp->tx_irq, dev); +- free_irq(lp->ovr_irq, dev); +- free_irq(lp->und_irq, dev); + + return 0; + } +@@ -1113,8 +1034,6 @@ static int korina_probe(struct platform_ + + lp->rx_irq = platform_get_irq_byname(pdev, "korina_rx"); + lp->tx_irq = platform_get_irq_byname(pdev, "korina_tx"); +- lp->ovr_irq = platform_get_irq_byname(pdev, "korina_ovr"); +- lp->und_irq = platform_get_irq_byname(pdev, "korina_und"); + + r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "korina_regs"); + dev->base_addr = r->start; diff --git a/target/linux/rb532/patches-4.9/107-korina-refactor-rx-descriptor-flags-processing.patch b/target/linux/rb532/patches-4.9/107-korina-refactor-rx-descriptor-flags-processing.patch new file mode 100644 index 0000000000..80745f534d --- /dev/null +++ b/target/linux/rb532/patches-4.9/107-korina-refactor-rx-descriptor-flags-processing.patch @@ -0,0 +1,110 @@ +--- a/drivers/net/ethernet/korina.c ++++ b/drivers/net/ethernet/korina.c +@@ -363,59 +363,60 @@ static int korina_rx(struct net_device * + if ((KORINA_RBSIZE - (u32)DMA_COUNT(rd->control)) == 0) + break; + +- /* Update statistics counters */ +- if (devcs & ETH_RX_CRC) +- dev->stats.rx_crc_errors++; +- if (devcs & ETH_RX_LOR) +- dev->stats.rx_length_errors++; +- if (devcs & ETH_RX_LE) +- dev->stats.rx_length_errors++; +- if (devcs & ETH_RX_OVR) +- dev->stats.rx_fifo_errors++; +- if (devcs & ETH_RX_CV) +- dev->stats.rx_frame_errors++; +- if (devcs & ETH_RX_CES) +- dev->stats.rx_length_errors++; +- if (devcs & ETH_RX_MP) +- dev->stats.multicast++; ++ /* check that this is a whole packet ++ * WARNING: DMA_FD bit incorrectly set ++ * in Rc32434 (errata ref #077) */ ++ if (!(devcs & ETH_RX_LD)) ++ goto next; + +- if ((devcs & ETH_RX_LD) != ETH_RX_LD) { +- /* check that this is a whole packet +- * WARNING: DMA_FD bit incorrectly set +- * in Rc32434 (errata ref #077) */ ++ if (!(devcs & ETH_RX_ROK)) { ++ /* Update statistics counters */ + dev->stats.rx_errors++; + dev->stats.rx_dropped++; +- } else if ((devcs & ETH_RX_ROK)) { +- pkt_len = RCVPKT_LENGTH(devcs); ++ if (devcs & ETH_RX_CRC) ++ dev->stats.rx_crc_errors++; ++ if (devcs & ETH_RX_LE) ++ dev->stats.rx_length_errors++; ++ if (devcs & ETH_RX_OVR) ++ dev->stats.rx_fifo_errors++; ++ if (devcs & ETH_RX_CV) ++ dev->stats.rx_frame_errors++; ++ if (devcs & ETH_RX_CES) ++ dev->stats.rx_frame_errors++; + +- /* must be the (first and) last +- * descriptor then */ +- pkt_buf = (u8 *)lp->rx_skb[lp->rx_next_done]->data; +- +- /* invalidate the cache */ +- dma_cache_inv((unsigned long)pkt_buf, pkt_len - 4); +- +- /* Malloc up new buffer. */ +- skb_new = netdev_alloc_skb_ip_align(dev, KORINA_RBSIZE); +- +- if (!skb_new) +- break; +- /* Do not count the CRC */ +- skb_put(skb, pkt_len - 4); +- skb->protocol = eth_type_trans(skb, dev); +- +- /* Pass the packet to upper layers */ +- netif_receive_skb(skb); +- dev->stats.rx_packets++; +- dev->stats.rx_bytes += pkt_len; +- +- /* Update the mcast stats */ +- if (devcs & ETH_RX_MP) +- dev->stats.multicast++; +- +- lp->rx_skb[lp->rx_next_done] = skb_new; ++ goto next; + } + ++ pkt_len = RCVPKT_LENGTH(devcs); ++ ++ /* must be the (first and) last ++ * descriptor then */ ++ pkt_buf = (u8 *)lp->rx_skb[lp->rx_next_done]->data; ++ ++ /* invalidate the cache */ ++ dma_cache_inv((unsigned long)pkt_buf, pkt_len - 4); ++ ++ /* Malloc up new buffer. */ ++ skb_new = netdev_alloc_skb_ip_align(dev, KORINA_RBSIZE); ++ ++ if (!skb_new) ++ break; ++ /* Do not count the CRC */ ++ skb_put(skb, pkt_len - 4); ++ skb->protocol = eth_type_trans(skb, dev); ++ ++ /* Pass the packet to upper layers */ ++ netif_receive_skb(skb); ++ dev->stats.rx_packets++; ++ dev->stats.rx_bytes += pkt_len; ++ ++ /* Update the mcast stats */ ++ if (devcs & ETH_RX_MP) ++ dev->stats.multicast++; ++ ++ lp->rx_skb[lp->rx_next_done] = skb_new; ++ ++next: + rd->devcs = 0; + + /* Restore descriptor's curr_addr */ diff --git a/target/linux/rb532/patches-4.9/107-use-NAPI_POLL_WEIGHT.patch b/target/linux/rb532/patches-4.9/107-use-NAPI_POLL_WEIGHT.patch new file mode 100644 index 0000000000..d4af90636f --- /dev/null +++ b/target/linux/rb532/patches-4.9/107-use-NAPI_POLL_WEIGHT.patch @@ -0,0 +1,11 @@ +--- a/drivers/net/ethernet/korina.c ++++ b/drivers/net/ethernet/korina.c +@@ -1082,7 +1082,7 @@ static int korina_probe(struct platform_ + dev->netdev_ops = &korina_netdev_ops; + dev->ethtool_ops = &netdev_ethtool_ops; + dev->watchdog_timeo = TX_TIMEOUT; +- netif_napi_add(dev, &lp->napi, korina_poll, 64); ++ netif_napi_add(dev, &lp->napi, korina_poll, NAPI_POLL_WEIGHT); + + lp->phy_addr = (((lp->rx_irq == 0x2c? 1:0) << 8) | 0x05); + lp->mii_if.dev = dev; diff --git a/target/linux/rb532/patches-4.9/108-korina-use-gro.patch b/target/linux/rb532/patches-4.9/108-korina-use-gro.patch new file mode 100644 index 0000000000..8cbe2a0777 --- /dev/null +++ b/target/linux/rb532/patches-4.9/108-korina-use-gro.patch @@ -0,0 +1,11 @@ +--- a/drivers/net/ethernet/korina.c ++++ b/drivers/net/ethernet/korina.c +@@ -406,7 +406,7 @@ static int korina_rx(struct net_device * + skb->protocol = eth_type_trans(skb, dev); + + /* Pass the packet to upper layers */ +- netif_receive_skb(skb); ++ napi_gro_receive(&lp->napi, skb); + dev->stats.rx_packets++; + dev->stats.rx_bytes += pkt_len; + diff --git a/target/linux/rb532/patches-4.9/109-korina-whitespace-cleanup-2.patch b/target/linux/rb532/patches-4.9/109-korina-whitespace-cleanup-2.patch new file mode 100644 index 0000000000..0265433951 --- /dev/null +++ b/target/linux/rb532/patches-4.9/109-korina-whitespace-cleanup-2.patch @@ -0,0 +1,135 @@ +--- a/drivers/net/ethernet/korina.c ++++ b/drivers/net/ethernet/korina.c +@@ -64,9 +64,9 @@ + #include + #include + +-#define DRV_NAME "korina" +-#define DRV_VERSION "0.10" +-#define DRV_RELDATE "04Mar2008" ++#define DRV_NAME "korina" ++#define DRV_VERSION "0.10" ++#define DRV_RELDATE "04Mar2008" + + #define STATION_ADDRESS_HIGH(dev) (((dev)->dev_addr[0] << 8) | \ + ((dev)->dev_addr[1])) +@@ -75,7 +75,7 @@ + ((dev)->dev_addr[4] << 8) | \ + ((dev)->dev_addr[5])) + +-#define MII_CLOCK 1250000 /* no more than 2.5MHz */ ++#define MII_CLOCK 1250000 /* no more than 2.5MHz */ + + /* the following must be powers of two */ + #define KORINA_NUM_RDS 64 /* number of receive descriptors */ +@@ -87,15 +87,19 @@ + #define KORINA_RBSIZE 1536 /* size of one resource buffer = Ether MTU */ + #define KORINA_RDS_MASK (KORINA_NUM_RDS - 1) + #define KORINA_TDS_MASK (KORINA_NUM_TDS - 1) +-#define RD_RING_SIZE (KORINA_NUM_RDS * sizeof(struct dma_desc)) ++#define RD_RING_SIZE (KORINA_NUM_RDS * sizeof(struct dma_desc)) + #define TD_RING_SIZE (KORINA_NUM_TDS * sizeof(struct dma_desc)) + +-#define TX_TIMEOUT (6000 * HZ / 1000) ++#define TX_TIMEOUT (6000 * HZ / 1000) + +-enum chain_status { desc_filled, desc_empty }; +-#define IS_DMA_FINISHED(X) (((X) & (DMA_DESC_FINI)) != 0) +-#define IS_DMA_DONE(X) (((X) & (DMA_DESC_DONE)) != 0) +-#define RCVPKT_LENGTH(X) (((X) & ETH_RX_LEN) >> ETH_RX_LEN_BIT) ++enum chain_status { ++ desc_filled, ++ desc_empty ++}; ++ ++#define IS_DMA_FINISHED(X) (((X) & (DMA_DESC_FINI)) != 0) ++#define IS_DMA_DONE(X) (((X) & (DMA_DESC_DONE)) != 0) ++#define RCVPKT_LENGTH(X) (((X) & ETH_RX_LEN) >> ETH_RX_LEN_BIT) + + /* Information that need to be kept for each board. */ + struct korina_private { +@@ -123,7 +127,7 @@ struct korina_private { + int rx_irq; + int tx_irq; + +- spinlock_t lock; /* NIC xmit lock */ ++ spinlock_t lock; /* NIC xmit lock */ + + int dma_halt_cnt; + int dma_run_cnt; +@@ -146,17 +150,17 @@ static inline void korina_start_dma(stru + static inline void korina_abort_dma(struct net_device *dev, + struct dma_reg *ch) + { +- if (readl(&ch->dmac) & DMA_CHAN_RUN_BIT) { +- writel(0x10, &ch->dmac); ++ if (readl(&ch->dmac) & DMA_CHAN_RUN_BIT) { ++ writel(0x10, &ch->dmac); + +- while (!(readl(&ch->dmas) & DMA_STAT_HALT)) +- netif_trans_update(dev); ++ while (!(readl(&ch->dmas) & DMA_STAT_HALT)) ++ netif_trans_update(dev); + +- writel(0, &ch->dmas); +- } ++ writel(0, &ch->dmas); ++ } + +- writel(0, &ch->dmadptr); +- writel(0, &ch->dmandptr); ++ writel(0, &ch->dmadptr); ++ writel(0, &ch->dmandptr); + } + + static inline void korina_chain_dma(struct dma_reg *ch, u32 dma_addr) +@@ -685,7 +689,7 @@ static int korina_ioctl(struct net_devic + + /* ethtool helpers */ + static void netdev_get_drvinfo(struct net_device *dev, +- struct ethtool_drvinfo *info) ++ struct ethtool_drvinfo *info) + { + struct korina_private *lp = netdev_priv(dev); + +@@ -727,10 +731,10 @@ static u32 netdev_get_link(struct net_de + } + + static const struct ethtool_ops netdev_ethtool_ops = { +- .get_drvinfo = netdev_get_drvinfo, +- .get_settings = netdev_get_settings, +- .set_settings = netdev_set_settings, +- .get_link = netdev_get_link, ++ .get_drvinfo = netdev_get_drvinfo, ++ .get_settings = netdev_get_settings, ++ .set_settings = netdev_set_settings, ++ .get_link = netdev_get_link, + }; + + static int korina_alloc_ring(struct net_device *dev) +@@ -862,7 +866,7 @@ static int korina_init(struct net_device + /* Management Clock Prescaler Divisor + * Clock independent setting */ + writel(((idt_cpu_freq) / MII_CLOCK + 1) & ~1, +- &lp->eth_regs->ethmcp); ++ &lp->eth_regs->ethmcp); + + /* don't transmit until fifo contains 48b */ + writel(48, &lp->eth_regs->ethfifott); +@@ -945,14 +949,14 @@ static int korina_open(struct net_device + 0, "Korina ethernet Rx", dev); + if (ret < 0) { + printk(KERN_ERR "%s: unable to get Rx DMA IRQ %d\n", +- dev->name, lp->rx_irq); ++ dev->name, lp->rx_irq); + goto err_release; + } + ret = request_irq(lp->tx_irq, korina_tx_dma_interrupt, + 0, "Korina ethernet Tx", dev); + if (ret < 0) { + printk(KERN_ERR "%s: unable to get Tx DMA IRQ %d\n", +- dev->name, lp->tx_irq); ++ dev->name, lp->tx_irq); + goto err_free_rx_irq; + } + diff --git a/target/linux/rb532/patches-4.9/110-korina-update-authors.patch b/target/linux/rb532/patches-4.9/110-korina-update-authors.patch new file mode 100644 index 0000000000..843397cf37 --- /dev/null +++ b/target/linux/rb532/patches-4.9/110-korina-update-authors.patch @@ -0,0 +1,17 @@ +--- a/drivers/net/ethernet/korina.c ++++ b/drivers/net/ethernet/korina.c +@@ -4,6 +4,7 @@ + * Copyright 2004 IDT Inc. (rischelp@idt.com) + * Copyright 2006 Felix Fietkau + * Copyright 2008 Florian Fainelli ++ * Copyright 2017 Roman Yeryomin + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the +@@ -1150,5 +1151,6 @@ module_platform_driver(korina_driver); + MODULE_AUTHOR("Philip Rischel "); + MODULE_AUTHOR("Felix Fietkau "); + MODULE_AUTHOR("Florian Fainelli "); ++MODULE_AUTHOR("Roman Yeryomin "); + MODULE_DESCRIPTION("IDT RC32434 (Korina) Ethernet driver"); + MODULE_LICENSE("GPL"); diff --git a/target/linux/rb532/patches-4.9/111-korina-version-bump.patch b/target/linux/rb532/patches-4.9/111-korina-version-bump.patch new file mode 100644 index 0000000000..1501e174b1 --- /dev/null +++ b/target/linux/rb532/patches-4.9/111-korina-version-bump.patch @@ -0,0 +1,13 @@ +--- a/drivers/net/ethernet/korina.c ++++ b/drivers/net/ethernet/korina.c +@@ -66,8 +66,8 @@ + #include + + #define DRV_NAME "korina" +-#define DRV_VERSION "0.10" +-#define DRV_RELDATE "04Mar2008" ++#define DRV_VERSION "0.20" ++#define DRV_RELDATE "15Sep2017" + + #define STATION_ADDRESS_HIGH(dev) (((dev)->dev_addr[0] << 8) | \ + ((dev)->dev_addr[1])) diff --git a/target/linux/sunxi/base-files/lib/firmware/brcm/brcmfmac43430-sdio.txt b/target/linux/sunxi/base-files/lib/firmware/brcm/brcmfmac43430-sdio.txt new file mode 100644 index 0000000000..9baa5c33bf --- /dev/null +++ b/target/linux/sunxi/base-files/lib/firmware/brcm/brcmfmac43430-sdio.txt @@ -0,0 +1,53 @@ +#AP6212_NVRAM_V1.0_20140603 +# 2.4 GHz, 20 MHz BW mode + +# The following parameter values are just placeholders, need to be updated. +manfid=0x2d0 +prodid=0x0726 +vendid=0x14e4 +devid=0x43e2 +boardtype=0x0726 +boardrev=0x1101 +boardnum=22 +macaddr=00:90:4c:c5:12:38 +sromrev=11 +boardflags=0x00404201 +xtalfreq=26000 +nocrc=1 +ag0=255 +aa2g=1 +ccode=ALL + +pa0itssit=0x20 +extpagain2g=0 + +#PA parameters for 2.4GHz, measured at CHIP OUTPUT +pa2ga0=-168,7161,-820 +AvVmid_c0=0x0,0xc8 +cckpwroffset0=5 + +# PPR params +maxp2ga0=90 +txpwrbckof=6 +cckbw202gpo=0x5555 +legofdmbw202gpo=0x77777777 +mcsbw202gpo=0xaaaaaaaa + +# OFDM IIR : +ofdmdigfilttype=7 +# PAPD mode: +papdmode=2 + +il0macaddr=00:90:4c:c5:12:38 +wl0id=0x431b + +#OOB parameters +hostwake=0x40 +hostrdy=0x41 +usbrdy=0x03 +usbrdydelay=100 +deadman_to=0xffffffff +# muxenab: 0x1 for UART enable, 0x10 for Host awake +muxenab=0x10 +# CLDO PWM voltage settings - 0x4 - 1.1 volt +#cldo_pwm=0x4 diff --git a/target/linux/sunxi/config-4.4 b/target/linux/sunxi/config-4.4 deleted file mode 100644 index 907fc50969..0000000000 --- a/target/linux/sunxi/config-4.4 +++ /dev/null @@ -1,549 +0,0 @@ -CONFIG_ADVISE_SYSCALLS=y -# CONFIG_AHCI_SUNXI is not set -CONFIG_ALIGNMENT_TRAP=y -# CONFIG_APM_EMULATION is not set -# CONFIG_ARCH_AXXIA is not set -CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y -CONFIG_ARCH_HAS_ELF_RANDOMIZE=y -CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y -CONFIG_ARCH_HAS_RESET_CONTROLLER=y -CONFIG_ARCH_HAS_SG_CHAIN=y -CONFIG_ARCH_HAS_TICK_BROADCAST=y -CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y -CONFIG_ARCH_MULTIPLATFORM=y -# CONFIG_ARCH_MULTI_CPU_AUTO is not set -CONFIG_ARCH_MULTI_V6_V7=y -CONFIG_ARCH_MULTI_V7=y -CONFIG_ARCH_NR_GPIO=416 -CONFIG_ARCH_PHYS_ADDR_T_64BIT=y -CONFIG_ARCH_REQUIRE_GPIOLIB=y -# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set -# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set -CONFIG_ARCH_SUNXI=y -CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y -CONFIG_ARCH_SUPPORTS_UPROBES=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_ARCH_USE_BUILTIN_BSWAP=y -CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y -CONFIG_ARCH_WANT_GENERAL_HUGETLB=y -CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y -CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y -CONFIG_ARM=y -CONFIG_ARM_APPENDED_DTB=y -CONFIG_ARM_ARCH_TIMER=y -CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y -CONFIG_ARM_ATAG_DTB_COMPAT=y -# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set -CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y -CONFIG_ARM_CPU_SUSPEND=y -CONFIG_ARM_ERRATA_643719=y -CONFIG_ARM_GIC=y -CONFIG_ARM_HAS_SG_CHAIN=y -CONFIG_ARM_HEAVY_MB=y -CONFIG_ARM_L1_CACHE_SHIFT=6 -CONFIG_ARM_L1_CACHE_SHIFT_6=y -CONFIG_ARM_LPAE=y -CONFIG_ARM_PATCH_PHYS_VIRT=y -CONFIG_ARM_PMU=y -CONFIG_ARM_PSCI=y -CONFIG_ARM_PSCI_FW=y -CONFIG_ARM_THUMB=y -# CONFIG_ARM_THUMBEE is not set -CONFIG_ARM_UNWIND=y -CONFIG_ARM_VIRT_EXT=y -CONFIG_ATA=y -CONFIG_ATAGS=y -# CONFIG_ATA_SFF is not set -CONFIG_AUDIT=y -# CONFIG_AUDITSYSCALL is not set -CONFIG_AUDIT_GENERIC=y -CONFIG_AUTO_ZRELADDR=y -CONFIG_AXP20X_POWER=y -CONFIG_BACKLIGHT_CLASS_DEVICE=y -CONFIG_BACKLIGHT_LCD_SUPPORT=y -CONFIG_BACKLIGHT_PWM=y -CONFIG_BINFMT_MISC=y -CONFIG_BLK_DEV_LOOP=y -CONFIG_BOUNCE=y -# CONFIG_BPF_SYSCALL is not set -CONFIG_CACHE_L2X0=y -CONFIG_CAN=y -CONFIG_CLKDEV_LOOKUP=y -CONFIG_CLKSRC_MMIO=y -CONFIG_CLKSRC_OF=y -CONFIG_CLKSRC_PROBE=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_COMMON_CLK=y -CONFIG_COMPACTION=y -CONFIG_CONFIGFS_FS=y -CONFIG_CONNECTOR=y -CONFIG_CONSOLE_TRANSLATIONS=y -CONFIG_COREDUMP=y -CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y -CONFIG_CPUFREQ_DT=y -CONFIG_CPU_32v6K=y -CONFIG_CPU_32v7=y -CONFIG_CPU_ABRT_EV7=y -# CONFIG_CPU_BPREDICT_DISABLE is not set -CONFIG_CPU_CACHE_V7=y -CONFIG_CPU_CACHE_VIPT=y -CONFIG_CPU_COPY_V6=y -CONFIG_CPU_CP15=y -CONFIG_CPU_CP15_MMU=y -CONFIG_CPU_FREQ=y -CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y -CONFIG_CPU_FREQ_GOV_COMMON=y -CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y -CONFIG_CPU_FREQ_GOV_ONDEMAND=y -CONFIG_CPU_FREQ_GOV_PERFORMANCE=y -CONFIG_CPU_FREQ_GOV_POWERSAVE=y -CONFIG_CPU_FREQ_GOV_USERSPACE=y -CONFIG_CPU_FREQ_STAT=y -CONFIG_CPU_HAS_ASID=y -# CONFIG_CPU_ICACHE_DISABLE is not set -CONFIG_CPU_PABRT_V7=y -CONFIG_CPU_PM=y -CONFIG_CPU_RMAP=y -CONFIG_CPU_THERMAL=y -CONFIG_CPU_TLB_V7=y -CONFIG_CPU_V7=y -CONFIG_CRC16=y -CONFIG_CRC_T10DIF=y -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_AEAD2=y -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_CRCT10DIF=y -CONFIG_CRYPTO_DES=y -CONFIG_CRYPTO_DEV_SUN4I_SS=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_HW=y -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -CONFIG_CRYPTO_MD5=y -CONFIG_CRYPTO_NULL2=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_SHA1=y -CONFIG_CRYPTO_WORKQUEUE=y -CONFIG_DCACHE_WORD_ACCESS=y -CONFIG_DEBUG_BUGVERBOSE=y -CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" -CONFIG_DEBUG_MEMORY_INIT=y -# CONFIG_DEBUG_UART_8250 is not set -# CONFIG_DEBUG_USER is not set -CONFIG_DEFAULT_CFQ=y -# CONFIG_DEFAULT_DEADLINE is not set -CONFIG_DEFAULT_IOSCHED="cfq" -CONFIG_DMADEVICES=y -CONFIG_DMA_ENGINE=y -CONFIG_DMA_OF=y -CONFIG_DMA_SUN4I=y -CONFIG_DMA_SUN6I=y -CONFIG_DMA_VIRTUAL_CHANNELS=y -CONFIG_DNOTIFY=y -CONFIG_DTC=y -CONFIG_DUMMY_CONSOLE=y -CONFIG_DWMAC_GENERIC=y -CONFIG_DWMAC_SUNXI=y -CONFIG_DYNAMIC_DEBUG=y -CONFIG_EDAC_ATOMIC_SCRUB=y -CONFIG_EDAC_SUPPORT=y -CONFIG_ELF_CORE=y -# CONFIG_EMBEDDED is not set -CONFIG_ENABLE_MUST_CHECK=y -# CONFIG_ENABLE_WARN_DEPRECATED is not set -CONFIG_EXT4_FS=y -CONFIG_EXTCON=y -# CONFIG_F2FS_CHECK_FS is not set -CONFIG_F2FS_FS=y -# CONFIG_F2FS_FS_SECURITY is not set -CONFIG_F2FS_FS_XATTR=y -CONFIG_F2FS_STAT_FS=y -CONFIG_FAT_FS=y -CONFIG_FB=y -CONFIG_FB_CFB_COPYAREA=y -CONFIG_FB_CFB_FILLRECT=y -CONFIG_FB_CFB_IMAGEBLIT=y -CONFIG_FB_CMDLINE=y -CONFIG_FB_FOREIGN_ENDIAN=y -CONFIG_FB_LITTLE_ENDIAN=y -CONFIG_FB_MODE_HELPERS=y -CONFIG_FB_SIMPLE=y -CONFIG_FB_TILEBLITTING=y -CONFIG_FIX_EARLYCON_MEM=y -# CONFIG_FONTS is not set -CONFIG_FONT_8x16=y -CONFIG_FONT_8x8=y -CONFIG_FONT_SUPPORT=y -CONFIG_FRAMEBUFFER_CONSOLE=y -CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y -CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y -CONFIG_FRAME_WARN=2048 -CONFIG_FREEZER=y -CONFIG_FS_MBCACHE=y -CONFIG_FS_POSIX_ACL=y -CONFIG_GENERIC_ALLOCATOR=y -CONFIG_GENERIC_BUG=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y -CONFIG_GENERIC_IDLE_POLL_SETUP=y -CONFIG_GENERIC_IO=y -CONFIG_GENERIC_IRQ_CHIP=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_IRQ_SHOW_LEVEL=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_PHY=y -CONFIG_GENERIC_PINCONF=y -CONFIG_GENERIC_SCHED_CLOCK=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_GLOB=y -CONFIG_GPIOLIB=y -CONFIG_GPIO_DEVRES=y -CONFIG_GPIO_SYSFS=y -CONFIG_HANDLE_DOMAIN_IRQ=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT_MAP=y -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -CONFIG_HAVE_ARCH_AUDITSYSCALL=y -CONFIG_HAVE_ARCH_BITREVERSE=y -CONFIG_HAVE_ARCH_JUMP_LABEL=y -CONFIG_HAVE_ARCH_KGDB=y -CONFIG_HAVE_ARCH_PFN_VALID=y -CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y -CONFIG_HAVE_ARM_ARCH_TIMER=y -# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_HAVE_BPF_JIT=y -CONFIG_HAVE_CC_STACKPROTECTOR=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y -CONFIG_HAVE_CONTEXT_TRACKING=y -CONFIG_HAVE_C_RECORDMCOUNT=y -CONFIG_HAVE_DEBUG_KMEMLEAK=y -CONFIG_HAVE_DMA_API_DEBUG=y -CONFIG_HAVE_DMA_ATTRS=y -CONFIG_HAVE_DMA_CONTIGUOUS=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_GENERIC_DMA_COHERENT=y -CONFIG_HAVE_GENERIC_RCU_GUP=y -CONFIG_HAVE_HW_BREAKPOINT=y -CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_KVM_ARCH_TLB_FLUSH_ALL=y -CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y -CONFIG_HAVE_KVM_EVENTFD=y -CONFIG_HAVE_KVM_IRQFD=y -CONFIG_HAVE_MEMBLOCK=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_HAVE_NET_DSA=y -CONFIG_HAVE_OPROFILE=y -CONFIG_HAVE_OPTPROBES=y -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_HAVE_PERF_REGS=y -CONFIG_HAVE_PERF_USER_STACK_DUMP=y -CONFIG_HAVE_PROC_CPU=y -CONFIG_HAVE_RCU_TABLE_FREE=y -CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y -CONFIG_HAVE_SMP=y -CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -CONFIG_HAVE_UID16=y -CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y -CONFIG_HIGHMEM=y -CONFIG_HIGHPTE=y -CONFIG_HOTPLUG_CPU=y -# CONFIG_HUGETLBFS is not set -CONFIG_HWMON=y -CONFIG_HW_CONSOLE=y -CONFIG_HW_RANDOM=y -CONFIG_HW_RANDOM_TIMERIOMEM=y -CONFIG_HZ_FIXED=0 -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_CHARDEV=y -CONFIG_I2C_COMPAT=y -CONFIG_I2C_HELPER_AUTO=y -CONFIG_I2C_MV64XXX=y -CONFIG_I2C_SUN6I_P2WI=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_INPUT=y -CONFIG_INPUT_AXP20X_PEK=y -CONFIG_INPUT_KEYBOARD=y -CONFIG_INPUT_MOUSEDEV=y -CONFIG_INPUT_MOUSEDEV_PSAUX=y -CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 -CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 -CONFIG_INPUT_TOUCHSCREEN=y -CONFIG_IOMMU_HELPER=y -CONFIG_IOSCHED_CFQ=y -CONFIG_IRQCHIP=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_DOMAIN_HIERARCHY=y -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_IRQ_WORK=y -CONFIG_JBD2=y -CONFIG_KALLSYMS=y -# CONFIG_KERNEL_MODE_NEON is not set -CONFIG_KEYBOARD_SUN4I_LRADC=y -CONFIG_KSM=y -CONFIG_KVM=y -CONFIG_KVM_ARM_HOST=y -CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y -CONFIG_KVM_MMIO=y -CONFIG_KVM_VFIO=y -CONFIG_LCD_CLASS_DEVICE=y -CONFIG_LCD_PLATFORM=y -CONFIG_LEDS_GPIO=y -CONFIG_LEGACY_PTYS=y -CONFIG_LEGACY_PTY_COUNT=256 -CONFIG_LIBFDT=y -CONFIG_LOCK_SPIN_ON_OWNER=y -CONFIG_LOGO=y -CONFIG_LOGO_LINUX_CLUT224=y -CONFIG_LOGO_LINUX_MONO=y -CONFIG_LOGO_LINUX_VGA16=y -CONFIG_LZO_COMPRESS=y -CONFIG_LZO_DECOMPRESS=y -CONFIG_MACH_SUN4I=y -CONFIG_MACH_SUN5I=y -CONFIG_MACH_SUN6I=y -CONFIG_MACH_SUN7I=y -CONFIG_MACH_SUN8I=y -CONFIG_MACH_SUN9I=y -CONFIG_MAGIC_SYSRQ=y -CONFIG_MDIO_BOARDINFO=y -CONFIG_MDIO_SUN4I=y -CONFIG_MEDIA_SUPPORT=y -CONFIG_MFD_AXP20X=y -CONFIG_MFD_CORE=y -CONFIG_MFD_SUN6I_PRCM=y -CONFIG_MFD_SYSCON=y -CONFIG_MIGHT_HAVE_CACHE_L2X0=y -CONFIG_MIGHT_HAVE_PCI=y -CONFIG_MIGRATION=y -CONFIG_MMC=y -CONFIG_MMC_BLOCK=y -# CONFIG_MMC_BLOCK_BOUNCE is not set -CONFIG_MMC_SUNXI=y -CONFIG_MMU_NOTIFIER=y -CONFIG_MODULES_TREE_LOOKUP=y -CONFIG_MODULES_USE_ELF_REL=y -# CONFIG_MTD is not set -CONFIG_MULTI_IRQ_HANDLER=y -CONFIG_MUTEX_SPIN_ON_OWNER=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_NEON=y -CONFIG_NET_FLOW_LIMIT=y -CONFIG_NET_PTP_CLASSIFY=y -CONFIG_NET_VENDOR_ALLWINNER=y -CONFIG_NLS=y -CONFIG_NLS_CODEPAGE_437=y -CONFIG_NLS_ISO8859_1=y -CONFIG_NO_BOOTMEM=y -CONFIG_NO_HZ=y -CONFIG_NO_HZ_COMMON=y -CONFIG_NO_HZ_IDLE=y -CONFIG_NR_CPUS=8 -CONFIG_NVMEM=y -CONFIG_NVMEM_SUNXI_SID=y -CONFIG_OF=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_FLATTREE=y -CONFIG_OF_GPIO=y -CONFIG_OF_IRQ=y -CONFIG_OF_MDIO=y -CONFIG_OF_NET=y -CONFIG_OF_RESERVED_MEM=y -CONFIG_OLD_SIGACTION=y -CONFIG_OLD_SIGSUSPEND3=y -CONFIG_OUTER_CACHE=y -CONFIG_OUTER_CACHE_SYNC=y -CONFIG_PADATA=y -CONFIG_PAGE_OFFSET=0xC0000000 -# CONFIG_PARTITION_ADVANCED is not set -# CONFIG_PCI is not set -# CONFIG_PCI_DOMAINS_GENERIC is not set -# CONFIG_PCI_SYSCALL is not set -CONFIG_PERF_EVENTS=y -CONFIG_PERF_USE_VMALLOC=y -CONFIG_PGTABLE_LEVELS=3 -CONFIG_PHYLIB=y -CONFIG_PHYS_ADDR_T_64BIT=y -CONFIG_PHY_SUN4I_USB=y -CONFIG_PHY_SUN9I_USB=y -CONFIG_PINCTRL=y -# CONFIG_PINCTRL_SINGLE is not set -CONFIG_PINCTRL_SUN4I_A10=y -CONFIG_PINCTRL_SUN5I_A10S=y -CONFIG_PINCTRL_SUN5I_A13=y -CONFIG_PINCTRL_SUN6I_A31=y -CONFIG_PINCTRL_SUN6I_A31S=y -CONFIG_PINCTRL_SUN6I_A31_R=y -CONFIG_PINCTRL_SUN7I_A20=y -CONFIG_PINCTRL_SUN8I_A23=y -CONFIG_PINCTRL_SUN8I_A23_R=y -CONFIG_PINCTRL_SUN8I_A33=y -CONFIG_PINCTRL_SUN8I_A83T=y -CONFIG_PINCTRL_SUN8I_H3=y -CONFIG_PINCTRL_SUN9I_A80=y -CONFIG_PINCTRL_SUNXI_COMMON=y -# CONFIG_PL310_ERRATA_588369 is not set -# CONFIG_PL310_ERRATA_727915 is not set -# CONFIG_PL310_ERRATA_753970 is not set -# CONFIG_PL310_ERRATA_769419 is not set -CONFIG_PM=y -CONFIG_PM_CLK=y -# CONFIG_PM_DEBUG is not set -CONFIG_PM_OPP=y -CONFIG_PM_SLEEP=y -CONFIG_PM_SLEEP_SMP=y -CONFIG_POWER_RESET=y -CONFIG_POWER_SUPPLY=y -CONFIG_PPS=y -CONFIG_PREEMPT=y -CONFIG_PREEMPT_COUNT=y -# CONFIG_PREEMPT_NONE is not set -CONFIG_PREEMPT_NOTIFIERS=y -CONFIG_PREEMPT_RCU=y -CONFIG_PRINTK_TIME=y -CONFIG_PROC_EVENTS=y -CONFIG_PROC_PAGE_MONITOR=y -CONFIG_PTP_1588_CLOCK=y -CONFIG_PWM=y -CONFIG_PWM_SUN4I=y -CONFIG_PWM_SYSFS=y -CONFIG_RATIONAL=y -# CONFIG_RCU_BOOST is not set -CONFIG_RCU_STALL_COMMON=y -CONFIG_REGMAP=y -CONFIG_REGMAP_I2C=y -CONFIG_REGMAP_IRQ=y -CONFIG_REGMAP_MMIO=y -CONFIG_REGMAP_SPI=y -CONFIG_REGULATOR=y -CONFIG_REGULATOR_AXP20X=y -CONFIG_REGULATOR_FIXED_VOLTAGE=y -CONFIG_REGULATOR_GPIO=y -CONFIG_RELAY=y -CONFIG_RESET_CONTROLLER=y -CONFIG_RFS_ACCEL=y -CONFIG_RPS=y -CONFIG_RTC_CLASS=y -# CONFIG_RTC_DRV_SUNXI is not set -CONFIG_RWSEM_SPIN_ON_OWNER=y -CONFIG_RWSEM_XCHGADD_ALGORITHM=y -CONFIG_SATA_PMP=y -# CONFIG_SCHED_INFO is not set -CONFIG_SCSI=y -CONFIG_SDIO_UART=y -CONFIG_SECURITYFS=y -CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y -CONFIG_SERIAL_8250_DW=y -CONFIG_SERIAL_8250_FSL=y -CONFIG_SERIAL_8250_NR_UARTS=8 -CONFIG_SERIAL_8250_RUNTIME_UARTS=8 -CONFIG_SERIAL_OF_PLATFORM=y -CONFIG_SERIO=y -CONFIG_SERIO_SERPORT=y -CONFIG_SMP=y -CONFIG_SMP_ON_UP=y -CONFIG_SND=y -CONFIG_SND_COMPRESS_OFFLOAD=y -CONFIG_SND_JACK=y -CONFIG_SND_PCM=y -CONFIG_SND_SOC=y -CONFIG_SND_SOC_I2C_AND_SPI=y -# CONFIG_SND_USB is not set -CONFIG_SOUND=y -CONFIG_SPARSE_IRQ=y -CONFIG_SPI=y -CONFIG_SPI_MASTER=y -CONFIG_SPI_SUN4I=y -CONFIG_SPI_SUN6I=y -CONFIG_SRCU=y -# CONFIG_STAGING is not set -CONFIG_STMMAC_ETH=y -CONFIG_STMMAC_PLATFORM=y -CONFIG_STRICT_DEVMEM=y -# CONFIG_SUN4I_EMAC is not set -CONFIG_SUN4I_TIMER=y -CONFIG_SUN5I_HSTIMER=y -CONFIG_SUNXI_RSB=y -CONFIG_SUNXI_SRAM=y -CONFIG_SUNXI_WATCHDOG=y -CONFIG_SUSPEND=y -CONFIG_SUSPEND_FREEZER=y -CONFIG_SWCONFIG=y -CONFIG_SWCONFIG_B53=y -# CONFIG_SWCONFIG_B53_MMAP_DRIVER is not set -CONFIG_SWCONFIG_B53_PHY_DRIVER=y -CONFIG_SWCONFIG_B53_PHY_FIXUP=y -# CONFIG_SWCONFIG_B53_SRAB_DRIVER is not set -CONFIG_SWIOTLB=y -CONFIG_SWP_EMULATE=y -CONFIG_SYSFS_SYSCALL=y -CONFIG_SYS_SUPPORTS_APM_EMULATION=y -CONFIG_SYS_SUPPORTS_HUGETLBFS=y -CONFIG_THERMAL=y -CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y -CONFIG_THERMAL_GOV_STEP_WISE=y -CONFIG_THERMAL_HWMON=y -CONFIG_THERMAL_OF=y -# CONFIG_THUMB2_KERNEL is not set -CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TMPFS_POSIX_ACL=y -CONFIG_TOUCHSCREEN_PROPERTIES=y -CONFIG_TOUCHSCREEN_SUN4I=y -CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" -CONFIG_UNINLINE_SPIN_UNLOCK=y -CONFIG_USB=y -CONFIG_USB_ANNOUNCE_NEW_DEVICES=y -# CONFIG_USB_AUDIO is not set -CONFIG_USB_COMMON=y -CONFIG_USB_DWC2=y -CONFIG_USB_DWC2_HOST=y -# CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set -CONFIG_USB_EHCI_HCD=y -CONFIG_USB_EHCI_HCD_PLATFORM=y -# CONFIG_USB_ETH is not set -CONFIG_USB_GADGET=y -CONFIG_USB_NET_DRIVERS=y -CONFIG_USB_OHCI_HCD=y -CONFIG_USB_OHCI_HCD_PLATFORM=y -CONFIG_USB_STORAGE=y -CONFIG_USB_SUPPORT=y -CONFIG_USERIO=y -CONFIG_USE_OF=y -CONFIG_VDSO=y -CONFIG_VECTORS_BASE=0xffff0000 -CONFIG_VFAT_FS=y -CONFIG_VFP=y -CONFIG_VFPv3=y -CONFIG_VHOST=y -CONFIG_VHOST_NET=y -CONFIG_VHOST_RING=y -CONFIG_VIRTUALIZATION=y -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_VT=y -CONFIG_VT_CONSOLE=y -CONFIG_VT_CONSOLE_SLEEP=y -CONFIG_VT_HW_CONSOLE_BINDING=y -CONFIG_WATCHDOG_CORE=y -# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set -CONFIG_XPS=y -CONFIG_XZ_DEC_ARM=y -CONFIG_XZ_DEC_BCJ=y -CONFIG_ZBOOT_ROM_BSS=0 -CONFIG_ZBOOT_ROM_TEXT=0 -CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/sunxi/config-4.9 b/target/linux/sunxi/config-4.9 index e961c8ad82..bf2111dc0f 100644 --- a/target/linux/sunxi/config-4.9 +++ b/target/linux/sunxi/config-4.9 @@ -1,4 +1,3 @@ -CONFIG_ADVISE_SYSCALLS=y # CONFIG_AHCI_SUNXI is not set CONFIG_ALIGNMENT_TRAP=y # CONFIG_ARCH_AXXIA is not set @@ -331,6 +330,7 @@ CONFIG_MDIO_SUN4I=y CONFIG_MEDIA_SUPPORT=y # CONFIG_MFD_AC100 is not set CONFIG_MFD_AXP20X=y +CONFIG_MFD_AXP20X_I2C=y CONFIG_MFD_AXP20X_RSB=y CONFIG_MFD_CORE=y CONFIG_MFD_SUN6I_PRCM=y @@ -427,7 +427,6 @@ CONFIG_PREEMPT_NOTIFIERS=y CONFIG_PREEMPT_RCU=y CONFIG_PRINTK_TIME=y CONFIG_PROC_EVENTS=y -CONFIG_PROC_PAGE_MONITOR=y CONFIG_PTP_1588_CLOCK=y CONFIG_PWM=y CONFIG_PWM_SUN4I=y diff --git a/target/linux/sunxi/cortexa53/config-default b/target/linux/sunxi/cortexa53/config-default index 527a6f6979..bb94574da7 100644 --- a/target/linux/sunxi/cortexa53/config-default +++ b/target/linux/sunxi/cortexa53/config-default @@ -61,7 +61,6 @@ CONFIG_HAVE_KVM_MSI=y CONFIG_HAVE_MEMORY_PRESENT=y CONFIG_HAVE_PATA_PLATFORM=y CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 -# CONFIG_KASAN is not set CONFIG_KERNEL_MODE_NEON=y CONFIG_KVM_ARM_PMU=y CONFIG_KVM_ARM_VGIC_V3_ITS=y diff --git a/target/linux/sunxi/image/cortex-a7.mk b/target/linux/sunxi/image/cortex-a7.mk index d0b7aa04b6..229b055e68 100644 --- a/target/linux/sunxi/image/cortex-a7.mk +++ b/target/linux/sunxi/image/cortex-a7.mk @@ -118,6 +118,18 @@ endef TARGET_DEVICES += sun8i-h2-plus-orangepi-r1 +define Device/sun8i-h3-nanopi-m1-plus + DEVICE_TITLE:=FriendlyArm NanoPi M1 Plus + DEVICE_PACKAGES:=kmod-rtc-sunxi \ + kmod-leds-gpio kmod-ledtrig-heartbeat \ + kmod-brcmfmac brcmfmac-firmware-43430-sdio wpad-mini + SUPPORTED_DEVICES:=friendlyarm,nanopi-m1-plus + SUNXI_DTS:=sun8i-h3-nanopi-m1-plus +endef + +TARGET_DEVICES += sun8i-h3-nanopi-m1-plus + + define Device/sun8i-h3-nanopi-neo DEVICE_TITLE:=FriendlyARM NanoPi NEO SUPPORTED_DEVICES:=friendlyarm,nanopi-neo @@ -136,6 +148,15 @@ endef TARGET_DEVICES += sun8i-h3-orangepi-plus +define Device/sun8i-h3-orangepi-2 + DEVICE_TITLE:=Xunlong Orange Pi 2 + DEVICE_PACKAGES:=kmod-rtc-sunxi + SUPPORTED_DEVICES:=xunlong,orangepi-2 + SUNXI_DTS:=sun8i-h3-orangepi-2 +endef + +TARGET_DEVICES += sun8i-h3-orangepi-2 + define Device/sun7i-a20-pcduino3 DEVICE_TITLE:=LinkSprite pcDuino3 diff --git a/target/linux/sunxi/image/cortex-a8.mk b/target/linux/sunxi/image/cortex-a8.mk index 97e033dbb3..564a66f938 100644 --- a/target/linux/sunxi/image/cortex-a8.mk +++ b/target/linux/sunxi/image/cortex-a8.mk @@ -56,4 +56,14 @@ endef TARGET_DEVICES += sun4i-a10-pcduino + +define Device/sun4i-a10-marsboard + DEVICE_TITLE:=HAOYU Electronics Marsboard A10 + DEVICE_PACKAGES:=mod-ata-core kmod-ata-sunxi kmod-sun4i-emac kmod-rtc-sunxi sound-soc-sunxi + SUPPORTED_DEVICES:=marsboard,a10-marsboard + SUNXI_DTS:=sun4i-a10-marsboard +endef + +TARGET_DEVICES += sun4i-a10-marsboard + endif diff --git a/target/linux/sunxi/patches-4.4/100-clk-sunxi-add-dram-gates-support.patch b/target/linux/sunxi/patches-4.4/100-clk-sunxi-add-dram-gates-support.patch deleted file mode 100644 index a94e9b8778..0000000000 --- a/target/linux/sunxi/patches-4.4/100-clk-sunxi-add-dram-gates-support.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 6d3a47c29186aa8d26ff05a6209c94291ace0696 Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Sat, 5 Dec 2015 21:16:42 +0800 -Subject: [PATCH] clk: sunxi: Add DRAM gates support for sun4i-a10 - -The A10/A20 share the same set of DRAM clock gates, which controls -direct memory access for some peripherals. - -On the A10, bit 15 controls the system's DRAM clock output (possibly -to the DRAM chips), which we need to keep on. - -On the A20 this has been moved to the DRAM controller, becoming a no-op. -However it is still listed in the user manual, so add it anyway. - -Signed-off-by: Chen-Yu Tsai -Signed-off-by: Maxime Ripard ---- - Documentation/devicetree/bindings/clock/sunxi.txt | 1 + - drivers/clk/sunxi/clk-simple-gates.c | 12 ++++++++++++ - 2 files changed, 13 insertions(+) - ---- a/drivers/clk/sunxi/clk-simple-gates.c -+++ b/drivers/clk/sunxi/clk-simple-gates.c -@@ -160,3 +160,15 @@ CLK_OF_DECLARE(sun5i_a13_ahb, "allwinner - sun4i_a10_ahb_init); - CLK_OF_DECLARE(sun7i_a20_ahb, "allwinner,sun7i-a20-ahb-gates-clk", - sun4i_a10_ahb_init); -+ -+static const int sun4i_a10_dram_critical_clocks[] __initconst = { -+ 15, /* dram_output */ -+}; -+ -+static void __init sun4i_a10_dram_init(struct device_node *node) -+{ -+ sunxi_simple_gates_setup(node, sun4i_a10_dram_critical_clocks, -+ ARRAY_SIZE(sun4i_a10_dram_critical_clocks)); -+} -+CLK_OF_DECLARE(sun4i_a10_dram, "allwinner,sun4i-a10-dram-gates-clk", -+ sun4i_a10_dram_init); diff --git a/target/linux/sunxi/patches-4.4/101-dt-sun4i-add-dram-gates.patch b/target/linux/sunxi/patches-4.4/101-dt-sun4i-add-dram-gates.patch deleted file mode 100644 index e21eca4e1f..0000000000 --- a/target/linux/sunxi/patches-4.4/101-dt-sun4i-add-dram-gates.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 82f8582feef4c048ee7ef0155a71c23614a7856d Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Sat, 5 Dec 2015 21:16:44 +0800 -Subject: [PATCH] ARM: dts: sun4i: Add DRAM gates - -The DRAM gates controls direct memory access for some peripherals. -These peripherals include the display pipeline, so add the required -gates to the simplefb nodes as well. - -Signed-off-by: Chen-Yu Tsai -Signed-off-by: Maxime Ripard ---- - arch/arm/boot/dts/sun4i-a10.dtsi | 36 ++++++++++++++++++++++++++++++++---- - 1 file changed, 32 insertions(+), 4 deletions(-) - ---- a/arch/arm/boot/dts/sun4i-a10.dtsi -+++ b/arch/arm/boot/dts/sun4i-a10.dtsi -@@ -66,7 +66,7 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0-hdmi"; - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, -- <&ahb_gates 44>; -+ <&ahb_gates 44>, <&dram_gates 26>; - status = "disabled"; - }; - -@@ -75,7 +75,8 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_fe0-de_be0-lcd0-hdmi"; - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, -- <&ahb_gates 44>, <&ahb_gates 46>; -+ <&ahb_gates 44>, <&ahb_gates 46>, -+ <&dram_gates 25>, <&dram_gates 26>; - status = "disabled"; - }; - -@@ -84,7 +85,8 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_fe0-de_be0-lcd0"; - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>, -- <&ahb_gates 46>; -+ <&ahb_gates 46>, <&dram_gates 25>, -+ <&dram_gates 26>; - status = "disabled"; - }; - -@@ -93,7 +95,8 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_fe0-de_be0-lcd0-tve0"; - clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>, -- <&ahb_gates 44>, <&ahb_gates 46>; -+ <&ahb_gates 44>, <&ahb_gates 46>, -+ <&dram_gates 25>, <&dram_gates 26>; - status = "disabled"; - }; - }; -@@ -492,6 +495,31 @@ - clock-output-names = "spi3"; - }; - -+ dram_gates: clk@01c20100 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-dram-gates-clk"; -+ reg = <0x01c20100 0x4>; -+ clocks = <&pll5 0>; -+ clock-indices = <0>, -+ <1>, <2>, -+ <3>, -+ <4>, -+ <5>, <6>, -+ <15>, -+ <24>, <25>, -+ <26>, <27>, -+ <28>, <29>; -+ clock-output-names = "dram_ve", -+ "dram_csi0", "dram_csi1", -+ "dram_ts", -+ "dram_tvd", -+ "dram_tve0", "dram_tve1", -+ "dram_output", -+ "dram_de_fe1", "dram_de_fe0", -+ "dram_de_be0", "dram_de_be1", -+ "dram_de_mp", "dram_ace"; -+ }; -+ - codec_clk: clk@01c20140 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-codec-clk"; diff --git a/target/linux/sunxi/patches-4.4/102-dt-sun7i-add-dram-gates.patch b/target/linux/sunxi/patches-4.4/102-dt-sun7i-add-dram-gates.patch deleted file mode 100644 index 397269076c..0000000000 --- a/target/linux/sunxi/patches-4.4/102-dt-sun7i-add-dram-gates.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 0b4bf5a5200b9ac5ddf545665f171feb5594677d Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Sat, 5 Dec 2015 21:16:46 +0800 -Subject: [PATCH] ARM: dts: sun7i: Add DRAM gates - -The DRAM gates controls direct memory access for some peripherals. -These peripherals include the display pipeline, so add the required -gates to the simplefb nodes as well. - -Signed-off-by: Chen-Yu Tsai -Signed-off-by: Maxime Ripard ---- - arch/arm/boot/dts/sun7i-a20.dtsi | 32 +++++++++++++++++++++++++++++--- - 1 file changed, 29 insertions(+), 3 deletions(-) - ---- a/arch/arm/boot/dts/sun7i-a20.dtsi -+++ b/arch/arm/boot/dts/sun7i-a20.dtsi -@@ -68,7 +68,7 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0-hdmi"; - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, -- <&ahb_gates 44>; -+ <&ahb_gates 44>, <&dram_gates 26>; - status = "disabled"; - }; - -@@ -76,7 +76,8 @@ - compatible = "allwinner,simple-framebuffer", - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0"; -- clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>; -+ clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>, -+ <&dram_gates 26>; - status = "disabled"; - }; - -@@ -85,7 +86,7 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0-tve0"; - clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>, -- <&ahb_gates 44>; -+ <&ahb_gates 44>, <&dram_gates 26>; - status = "disabled"; - }; - }; -@@ -501,6 +502,31 @@ - clock-output-names = "spi3"; - }; - -+ dram_gates: clk@01c20100 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-dram-gates-clk"; -+ reg = <0x01c20100 0x4>; -+ clocks = <&pll5 0>; -+ clock-indices = <0>, -+ <1>, <2>, -+ <3>, -+ <4>, -+ <5>, <6>, -+ <15>, -+ <24>, <25>, -+ <26>, <27>, -+ <28>, <29>; -+ clock-output-names = "dram_ve", -+ "dram_csi0", "dram_csi1", -+ "dram_ts", -+ "dram_tvd", -+ "dram_tve0", "dram_tve1", -+ "dram_output", -+ "dram_de_fe1", "dram_de_fe0", -+ "dram_de_be0", "dram_de_be1", -+ "dram_de_mp", "dram_ace"; -+ }; -+ - codec_clk: clk@01c20140 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-codec-clk"; diff --git a/target/linux/sunxi/patches-4.4/103-clk-sunxi-add-h3-clksupport.patch b/target/linux/sunxi/patches-4.4/103-clk-sunxi-add-h3-clksupport.patch deleted file mode 100644 index 8bc66274c3..0000000000 --- a/target/linux/sunxi/patches-4.4/103-clk-sunxi-add-h3-clksupport.patch +++ /dev/null @@ -1,180 +0,0 @@ -From ab6e23a4e388f5f2696b8e92c350f845142da118 Mon Sep 17 00:00:00 2001 -From: Jens Kuske -Date: Fri, 4 Dec 2015 22:24:40 +0100 -Subject: [PATCH] clk: sunxi: Add H3 clocks support - -The H3 clock control unit is similar to the those of other sun8i family -members like the A23. - -It adds a new bus gates clock similar to the simple gates, but with a -different parent clock for each single gate. -Some of the gates use the new AHB2 clock as parent, whose clock source -is muxable between AHB1 and PLL6/2. The documentation isn't totally clear -about which devices belong to AHB2 now, especially USB EHIC/OHIC, so it -is mostly based on Allwinner kernel source code. - -Signed-off-by: Jens Kuske -Acked-by: Rob Herring -Signed-off-by: Maxime Ripard ---- - Documentation/devicetree/bindings/clock/sunxi.txt | 2 + - drivers/clk/sunxi/Makefile | 1 + - drivers/clk/sunxi/clk-sun8i-bus-gates.c | 112 ++++++++++++++++++++++ - drivers/clk/sunxi/clk-sunxi.c | 6 ++ - 4 files changed, 121 insertions(+) - create mode 100644 drivers/clk/sunxi/clk-sun8i-bus-gates.c - ---- a/drivers/clk/sunxi/Makefile -+++ b/drivers/clk/sunxi/Makefile -@@ -10,6 +10,7 @@ obj-y += clk-a10-pll2.o - obj-y += clk-a20-gmac.o - obj-y += clk-mod0.o - obj-y += clk-simple-gates.o -+obj-y += clk-sun8i-bus-gates.o - obj-y += clk-sun8i-mbus.o - obj-y += clk-sun9i-core.o - obj-y += clk-sun9i-mmc.o ---- /dev/null -+++ b/drivers/clk/sunxi/clk-sun8i-bus-gates.c -@@ -0,0 +1,112 @@ -+/* -+ * Copyright (C) 2015 Jens Kuske -+ * -+ * Based on clk-simple-gates.c, which is: -+ * Copyright 2015 Maxime Ripard -+ * -+ * Maxime Ripard -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (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. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static DEFINE_SPINLOCK(gates_lock); -+ -+static void __init sun8i_h3_bus_gates_init(struct device_node *node) -+{ -+ static const char * const names[] = { "ahb1", "ahb2", "apb1", "apb2" }; -+ enum { AHB1, AHB2, APB1, APB2, PARENT_MAX } clk_parent; -+ const char *parents[PARENT_MAX]; -+ struct clk_onecell_data *clk_data; -+ const char *clk_name; -+ struct property *prop; -+ struct resource res; -+ void __iomem *clk_reg; -+ void __iomem *reg; -+ const __be32 *p; -+ int number, i; -+ u8 clk_bit; -+ u32 index; -+ -+ reg = of_io_request_and_map(node, 0, of_node_full_name(node)); -+ if (IS_ERR(reg)) -+ return; -+ -+ for (i = 0; i < ARRAY_SIZE(names); i++) { -+ index = of_property_match_string(node, "clock-names", -+ names[i]); -+ if (index < 0) -+ return; -+ -+ parents[i] = of_clk_get_parent_name(node, index); -+ } -+ -+ clk_data = kmalloc(sizeof(struct clk_onecell_data), GFP_KERNEL); -+ if (!clk_data) -+ goto err_unmap; -+ -+ number = of_property_count_u32_elems(node, "clock-indices"); -+ of_property_read_u32_index(node, "clock-indices", number - 1, &number); -+ -+ clk_data->clks = kcalloc(number + 1, sizeof(struct clk *), GFP_KERNEL); -+ if (!clk_data->clks) -+ goto err_free_data; -+ -+ i = 0; -+ of_property_for_each_u32(node, "clock-indices", prop, p, index) { -+ of_property_read_string_index(node, "clock-output-names", -+ i, &clk_name); -+ -+ if (index == 17 || (index >= 29 && index <= 31)) -+ clk_parent = AHB2; -+ else if (index <= 63 || index >= 128) -+ clk_parent = AHB1; -+ else if (index >= 64 && index <= 95) -+ clk_parent = APB1; -+ else if (index >= 96 && index <= 127) -+ clk_parent = APB2; -+ -+ clk_reg = reg + 4 * (index / 32); -+ clk_bit = index % 32; -+ -+ clk_data->clks[index] = clk_register_gate(NULL, clk_name, -+ parents[clk_parent], -+ 0, clk_reg, clk_bit, -+ 0, &gates_lock); -+ i++; -+ -+ if (IS_ERR(clk_data->clks[index])) { -+ WARN_ON(true); -+ continue; -+ } -+ } -+ -+ clk_data->clk_num = number + 1; -+ of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); -+ -+ return; -+ -+err_free_data: -+ kfree(clk_data); -+err_unmap: -+ iounmap(reg); -+ of_address_to_resource(node, 0, &res); -+ release_mem_region(res.start, resource_size(&res)); -+} -+ -+CLK_OF_DECLARE(sun8i_h3_bus_gates, "allwinner,sun8i-h3-bus-gates-clk", -+ sun8i_h3_bus_gates_init); ---- a/drivers/clk/sunxi/clk-sunxi.c -+++ b/drivers/clk/sunxi/clk-sunxi.c -@@ -778,6 +778,10 @@ static const struct mux_data sun6i_a31_a - .shift = 12, - }; - -+static const struct mux_data sun8i_h3_ahb2_mux_data __initconst = { -+ .shift = 0, -+}; -+ - static void __init sunxi_mux_clk_setup(struct device_node *node, - struct mux_data *data) - { -@@ -1130,6 +1134,7 @@ static const struct of_device_id clk_div - static const struct of_device_id clk_mux_match[] __initconst = { - {.compatible = "allwinner,sun4i-a10-cpu-clk", .data = &sun4i_cpu_mux_data,}, - {.compatible = "allwinner,sun6i-a31-ahb1-mux-clk", .data = &sun6i_a31_ahb1_mux_data,}, -+ {.compatible = "allwinner,sun8i-h3-ahb2-clk", .data = &sun8i_h3_ahb2_mux_data,}, - {} - }; - -@@ -1212,6 +1217,7 @@ CLK_OF_DECLARE(sun6i_a31_clk_init, "allw - CLK_OF_DECLARE(sun6i_a31s_clk_init, "allwinner,sun6i-a31s", sun6i_init_clocks); - CLK_OF_DECLARE(sun8i_a23_clk_init, "allwinner,sun8i-a23", sun6i_init_clocks); - CLK_OF_DECLARE(sun8i_a33_clk_init, "allwinner,sun8i-a33", sun6i_init_clocks); -+CLK_OF_DECLARE(sun8i_h3_clk_init, "allwinner,sun8i-h3", sun6i_init_clocks); - - static void __init sun9i_init_clocks(struct device_node *node) - { diff --git a/target/linux/sunxi/patches-4.4/104-1-dt-sunxi-add-h3-dtsi.patch b/target/linux/sunxi/patches-4.4/104-1-dt-sunxi-add-h3-dtsi.patch deleted file mode 100644 index 35a653c5fe..0000000000 --- a/target/linux/sunxi/patches-4.4/104-1-dt-sunxi-add-h3-dtsi.patch +++ /dev/null @@ -1,515 +0,0 @@ -From 318d93bc41823e86967c8251eef0444a72e4d687 Mon Sep 17 00:00:00 2001 -From: Jens Kuske -Date: Fri, 4 Dec 2015 22:24:42 +0100 -Subject: [PATCH] ARM: dts: sunxi: Add Allwinner H3 DTSI - -The Allwinner H3 is a home entertainment system oriented SoC with -four Cortex-A7 cores and a Mali-400MP2 GPU. - -Signed-off-by: Jens Kuske -Signed-off-by: Maxime Ripard ---- - arch/arm/boot/dts/sun8i-h3.dtsi | 497 ++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 497 insertions(+) - create mode 100644 arch/arm/boot/dts/sun8i-h3.dtsi - ---- /dev/null -+++ b/arch/arm/boot/dts/sun8i-h3.dtsi -@@ -0,0 +1,497 @@ -+/* -+ * Copyright (C) 2015 Jens Kuske -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file 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. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#include "skeleton.dtsi" -+ -+#include -+#include -+ -+/ { -+ interrupt-parent = <&gic>; -+ -+ cpus { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ cpu@0 { -+ compatible = "arm,cortex-a7"; -+ device_type = "cpu"; -+ reg = <0>; -+ }; -+ -+ cpu@1 { -+ compatible = "arm,cortex-a7"; -+ device_type = "cpu"; -+ reg = <1>; -+ }; -+ -+ cpu@2 { -+ compatible = "arm,cortex-a7"; -+ device_type = "cpu"; -+ reg = <2>; -+ }; -+ -+ cpu@3 { -+ compatible = "arm,cortex-a7"; -+ device_type = "cpu"; -+ reg = <3>; -+ }; -+ }; -+ -+ timer { -+ compatible = "arm,armv7-timer"; -+ interrupts = , -+ , -+ , -+ ; -+ }; -+ -+ clocks { -+ #address-cells = <1>; -+ #size-cells = <1>; -+ ranges; -+ -+ osc24M: osc24M_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-clock"; -+ clock-frequency = <24000000>; -+ clock-output-names = "osc24M"; -+ }; -+ -+ osc32k: osc32k_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-clock"; -+ clock-frequency = <32768>; -+ clock-output-names = "osc32k"; -+ }; -+ -+ pll1: clk@01c20000 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun8i-a23-pll1-clk"; -+ reg = <0x01c20000 0x4>; -+ clocks = <&osc24M>; -+ clock-output-names = "pll1"; -+ }; -+ -+ /* dummy clock until actually implemented */ -+ pll5: pll5_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-clock"; -+ clock-frequency = <0>; -+ clock-output-names = "pll5"; -+ }; -+ -+ pll6: clk@01c20028 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun6i-a31-pll6-clk"; -+ reg = <0x01c20028 0x4>; -+ clocks = <&osc24M>; -+ clock-output-names = "pll6", "pll6x2"; -+ }; -+ -+ pll6d2: pll6d2_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-factor-clock"; -+ clock-div = <2>; -+ clock-mult = <1>; -+ clocks = <&pll6 0>; -+ clock-output-names = "pll6d2"; -+ }; -+ -+ /* dummy clock until pll6 can be reused */ -+ pll8: pll8_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-clock"; -+ clock-frequency = <1>; -+ clock-output-names = "pll8"; -+ }; -+ -+ cpu: cpu_clk@01c20050 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-cpu-clk"; -+ reg = <0x01c20050 0x4>; -+ clocks = <&osc32k>, <&osc24M>, <&pll1>, <&pll1>; -+ clock-output-names = "cpu"; -+ }; -+ -+ axi: axi_clk@01c20050 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-axi-clk"; -+ reg = <0x01c20050 0x4>; -+ clocks = <&cpu>; -+ clock-output-names = "axi"; -+ }; -+ -+ ahb1: ahb1_clk@01c20054 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun6i-a31-ahb1-clk"; -+ reg = <0x01c20054 0x4>; -+ clocks = <&osc32k>, <&osc24M>, <&axi>, <&pll6 0>; -+ clock-output-names = "ahb1"; -+ }; -+ -+ ahb2: ahb2_clk@01c2005c { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun8i-h3-ahb2-clk"; -+ reg = <0x01c2005c 0x4>; -+ clocks = <&ahb1>, <&pll6d2>; -+ clock-output-names = "ahb2"; -+ }; -+ -+ apb1: apb1_clk@01c20054 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-apb0-clk"; -+ reg = <0x01c20054 0x4>; -+ clocks = <&ahb1>; -+ clock-output-names = "apb1"; -+ }; -+ -+ apb2: apb2_clk@01c20058 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-apb1-clk"; -+ reg = <0x01c20058 0x4>; -+ clocks = <&osc32k>, <&osc24M>, <&pll6 0>, <&pll6 0>; -+ clock-output-names = "apb2"; -+ }; -+ -+ bus_gates: clk@01c20060 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun8i-h3-bus-gates-clk"; -+ reg = <0x01c20060 0x14>; -+ clocks = <&ahb1>, <&ahb2>, <&apb1>, <&apb2>; -+ clock-names = "ahb1", "ahb2", "apb1", "apb2"; -+ clock-indices = <5>, <6>, <8>, -+ <9>, <10>, <13>, -+ <14>, <17>, <18>, -+ <19>, <20>, -+ <21>, <23>, -+ <24>, <25>, -+ <26>, <27>, -+ <28>, <29>, -+ <30>, <31>, <32>, -+ <35>, <36>, <37>, -+ <40>, <41>, <43>, -+ <44>, <52>, <53>, -+ <54>, <64>, -+ <65>, <69>, <72>, -+ <76>, <77>, <78>, -+ <96>, <97>, <98>, -+ <112>, <113>, -+ <114>, <115>, -+ <116>, <128>, <135>; -+ clock-output-names = "bus_ce", "bus_dma", "bus_mmc0", -+ "bus_mmc1", "bus_mmc2", "bus_nand", -+ "bus_sdram", "bus_gmac", "bus_ts", -+ "bus_hstimer", "bus_spi0", -+ "bus_spi1", "bus_otg", -+ "bus_otg_ehci0", "bus_ehci1", -+ "bus_ehci2", "bus_ehci3", -+ "bus_otg_ohci0", "bus_ohci1", -+ "bus_ohci2", "bus_ohci3", "bus_ve", -+ "bus_lcd0", "bus_lcd1", "bus_deint", -+ "bus_csi", "bus_tve", "bus_hdmi", -+ "bus_de", "bus_gpu", "bus_msgbox", -+ "bus_spinlock", "bus_codec", -+ "bus_spdif", "bus_pio", "bus_ths", -+ "bus_i2s0", "bus_i2s1", "bus_i2s2", -+ "bus_i2c0", "bus_i2c1", "bus_i2c2", -+ "bus_uart0", "bus_uart1", -+ "bus_uart2", "bus_uart3", -+ "bus_scr", "bus_ephy", "bus_dbg"; -+ }; -+ -+ mmc0_clk: clk@01c20088 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-mmc-clk"; -+ reg = <0x01c20088 0x4>; -+ clocks = <&osc24M>, <&pll6 0>, <&pll8>; -+ clock-output-names = "mmc0", -+ "mmc0_output", -+ "mmc0_sample"; -+ }; -+ -+ mmc1_clk: clk@01c2008c { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-mmc-clk"; -+ reg = <0x01c2008c 0x4>; -+ clocks = <&osc24M>, <&pll6 0>, <&pll8>; -+ clock-output-names = "mmc1", -+ "mmc1_output", -+ "mmc1_sample"; -+ }; -+ -+ mmc2_clk: clk@01c20090 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-mmc-clk"; -+ reg = <0x01c20090 0x4>; -+ clocks = <&osc24M>, <&pll6 0>, <&pll8>; -+ clock-output-names = "mmc2", -+ "mmc2_output", -+ "mmc2_sample"; -+ }; -+ -+ mbus_clk: clk@01c2015c { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun8i-a23-mbus-clk"; -+ reg = <0x01c2015c 0x4>; -+ clocks = <&osc24M>, <&pll6 1>, <&pll5>; -+ clock-output-names = "mbus"; -+ }; -+ }; -+ -+ soc { -+ compatible = "simple-bus"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ ranges; -+ -+ dma: dma-controller@01c02000 { -+ compatible = "allwinner,sun8i-h3-dma"; -+ reg = <0x01c02000 0x1000>; -+ interrupts = ; -+ clocks = <&bus_gates 6>; -+ resets = <&ahb_rst 6>; -+ #dma-cells = <1>; -+ }; -+ -+ mmc0: mmc@01c0f000 { -+ compatible = "allwinner,sun5i-a13-mmc"; -+ reg = <0x01c0f000 0x1000>; -+ clocks = <&bus_gates 8>, -+ <&mmc0_clk 0>, -+ <&mmc0_clk 1>, -+ <&mmc0_clk 2>; -+ clock-names = "ahb", -+ "mmc", -+ "output", -+ "sample"; -+ resets = <&ahb_rst 8>; -+ reset-names = "ahb"; -+ interrupts = ; -+ status = "disabled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; -+ -+ mmc1: mmc@01c10000 { -+ compatible = "allwinner,sun5i-a13-mmc"; -+ reg = <0x01c10000 0x1000>; -+ clocks = <&bus_gates 9>, -+ <&mmc1_clk 0>, -+ <&mmc1_clk 1>, -+ <&mmc1_clk 2>; -+ clock-names = "ahb", -+ "mmc", -+ "output", -+ "sample"; -+ resets = <&ahb_rst 9>; -+ reset-names = "ahb"; -+ interrupts = ; -+ status = "disabled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; -+ -+ mmc2: mmc@01c11000 { -+ compatible = "allwinner,sun5i-a13-mmc"; -+ reg = <0x01c11000 0x1000>; -+ clocks = <&bus_gates 10>, -+ <&mmc2_clk 0>, -+ <&mmc2_clk 1>, -+ <&mmc2_clk 2>; -+ clock-names = "ahb", -+ "mmc", -+ "output", -+ "sample"; -+ resets = <&ahb_rst 10>; -+ reset-names = "ahb"; -+ interrupts = ; -+ status = "disabled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; -+ -+ pio: pinctrl@01c20800 { -+ compatible = "allwinner,sun8i-h3-pinctrl"; -+ reg = <0x01c20800 0x400>; -+ interrupts = , -+ ; -+ clocks = <&bus_gates 69>; -+ gpio-controller; -+ #gpio-cells = <3>; -+ interrupt-controller; -+ #interrupt-cells = <2>; -+ -+ uart0_pins_a: uart0@0 { -+ allwinner,pins = "PA4", "PA5"; -+ allwinner,function = "uart0"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ mmc0_pins_a: mmc0@0 { -+ allwinner,pins = "PF0", "PF1", "PF2", "PF3", -+ "PF4", "PF5"; -+ allwinner,function = "mmc0"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ mmc0_cd_pin: mmc0_cd_pin@0 { -+ allwinner,pins = "PF6"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ mmc1_pins_a: mmc1@0 { -+ allwinner,pins = "PG0", "PG1", "PG2", "PG3", -+ "PG4", "PG5"; -+ allwinner,function = "mmc1"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ }; -+ -+ ahb_rst: reset@01c202c0 { -+ #reset-cells = <1>; -+ compatible = "allwinner,sun6i-a31-ahb1-reset"; -+ reg = <0x01c202c0 0xc>; -+ }; -+ -+ apb1_rst: reset@01c202d0 { -+ #reset-cells = <1>; -+ compatible = "allwinner,sun6i-a31-clock-reset"; -+ reg = <0x01c202d0 0x4>; -+ }; -+ -+ apb2_rst: reset@01c202d8 { -+ #reset-cells = <1>; -+ compatible = "allwinner,sun6i-a31-clock-reset"; -+ reg = <0x01c202d8 0x4>; -+ }; -+ -+ timer@01c20c00 { -+ compatible = "allwinner,sun4i-a10-timer"; -+ reg = <0x01c20c00 0xa0>; -+ interrupts = , -+ ; -+ clocks = <&osc24M>; -+ }; -+ -+ wdt0: watchdog@01c20ca0 { -+ compatible = "allwinner,sun6i-a31-wdt"; -+ reg = <0x01c20ca0 0x20>; -+ interrupts = ; -+ }; -+ -+ uart0: serial@01c28000 { -+ compatible = "snps,dw-apb-uart"; -+ reg = <0x01c28000 0x400>; -+ interrupts = ; -+ reg-shift = <2>; -+ reg-io-width = <4>; -+ clocks = <&bus_gates 112>; -+ resets = <&apb2_rst 16>; -+ dmas = <&dma 6>, <&dma 6>; -+ dma-names = "rx", "tx"; -+ status = "disabled"; -+ }; -+ -+ uart1: serial@01c28400 { -+ compatible = "snps,dw-apb-uart"; -+ reg = <0x01c28400 0x400>; -+ interrupts = ; -+ reg-shift = <2>; -+ reg-io-width = <4>; -+ clocks = <&bus_gates 113>; -+ resets = <&apb2_rst 17>; -+ dmas = <&dma 7>, <&dma 7>; -+ dma-names = "rx", "tx"; -+ status = "disabled"; -+ }; -+ -+ uart2: serial@01c28800 { -+ compatible = "snps,dw-apb-uart"; -+ reg = <0x01c28800 0x400>; -+ interrupts = ; -+ reg-shift = <2>; -+ reg-io-width = <4>; -+ clocks = <&bus_gates 114>; -+ resets = <&apb2_rst 18>; -+ dmas = <&dma 8>, <&dma 8>; -+ dma-names = "rx", "tx"; -+ status = "disabled"; -+ }; -+ -+ uart3: serial@01c28c00 { -+ compatible = "snps,dw-apb-uart"; -+ reg = <0x01c28c00 0x400>; -+ interrupts = ; -+ reg-shift = <2>; -+ reg-io-width = <4>; -+ clocks = <&bus_gates 115>; -+ resets = <&apb2_rst 19>; -+ dmas = <&dma 9>, <&dma 9>; -+ dma-names = "rx", "tx"; -+ status = "disabled"; -+ }; -+ -+ gic: interrupt-controller@01c81000 { -+ compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic"; -+ reg = <0x01c81000 0x1000>, -+ <0x01c82000 0x1000>, -+ <0x01c84000 0x2000>, -+ <0x01c86000 0x2000>; -+ interrupt-controller; -+ #interrupt-cells = <3>; -+ interrupts = ; -+ }; -+ -+ rtc: rtc@01f00000 { -+ compatible = "allwinner,sun6i-a31-rtc"; -+ reg = <0x01f00000 0x54>; -+ interrupts = , -+ ; -+ }; -+ }; -+}; diff --git a/target/linux/sunxi/patches-4.4/105-phy-use_of_match_node.patch b/target/linux/sunxi/patches-4.4/105-phy-use_of_match_node.patch deleted file mode 100644 index 7715b585d0..0000000000 --- a/target/linux/sunxi/patches-4.4/105-phy-use_of_match_node.patch +++ /dev/null @@ -1,218 +0,0 @@ -From 5c627d8e7660c170c591ef281184fd11d0493440 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Fri, 11 Dec 2015 16:32:17 +0100 -Subject: [PATCH] phy-sun4i-usb: Use of_match_node to get model specific config - data - -Use of_match_node instead of calling of_device_is_compatible a ton of -times to get model specific config data. - -Signed-off-by: Hans de Goede -Signed-off-by: Kishon Vijay Abraham I ---- - drivers/phy/phy-sun4i-usb.c | 121 +++++++++++++++++++++++++++++--------------- - 1 file changed, 79 insertions(+), 42 deletions(-) - ---- a/drivers/phy/phy-sun4i-usb.c -+++ b/drivers/phy/phy-sun4i-usb.c -@@ -32,6 +32,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -88,12 +89,23 @@ - #define DEBOUNCE_TIME msecs_to_jiffies(50) - #define POLL_TIME msecs_to_jiffies(250) - -+enum sun4i_usb_phy_type { -+ sun4i_a10_phy, -+ sun8i_a33_phy, -+}; -+ -+struct sun4i_usb_phy_cfg { -+ int num_phys; -+ enum sun4i_usb_phy_type type; -+ u32 disc_thresh; -+ u8 phyctl_offset; -+ bool dedicated_clocks; -+}; -+ - struct sun4i_usb_phy_data { - void __iomem *base; -+ const struct sun4i_usb_phy_cfg *cfg; - struct mutex mutex; -- int num_phys; -- u32 disc_thresh; -- bool has_a33_phyctl; - struct sun4i_usb_phy { - struct phy *phy; - void __iomem *pmu; -@@ -159,17 +171,14 @@ static void sun4i_usb_phy_write(struct s - { - struct sun4i_usb_phy_data *phy_data = to_sun4i_usb_phy_data(phy); - u32 temp, usbc_bit = BIT(phy->index * 2); -- void *phyctl; -+ void *phyctl = phy_data->base + phy_data->cfg->phyctl_offset; - int i; - - mutex_lock(&phy_data->mutex); - -- if (phy_data->has_a33_phyctl) { -- phyctl = phy_data->base + REG_PHYCTL_A33; -+ if (phy_data->cfg->type == sun8i_a33_phy) { - /* A33 needs us to set phyctl to 0 explicitly */ - writel(0, phyctl); -- } else { -- phyctl = phy_data->base + REG_PHYCTL_A10; - } - - for (i = 0; i < len; i++) { -@@ -249,7 +258,8 @@ static int sun4i_usb_phy_init(struct phy - sun4i_usb_phy_write(phy, PHY_TX_AMPLITUDE_TUNE, 0x14, 5); - - /* Disconnect threshold adjustment */ -- sun4i_usb_phy_write(phy, PHY_DISCON_TH_SEL, data->disc_thresh, 2); -+ sun4i_usb_phy_write(phy, PHY_DISCON_TH_SEL, -+ data->cfg->disc_thresh, 2); - - sun4i_usb_phy_passby(phy, 1); - -@@ -476,7 +486,7 @@ static struct phy *sun4i_usb_phy_xlate(s - { - struct sun4i_usb_phy_data *data = dev_get_drvdata(dev); - -- if (args->args[0] >= data->num_phys) -+ if (args->args[0] >= data->cfg->num_phys) - return ERR_PTR(-ENODEV); - - return data->phys[args->args[0]].phy; -@@ -511,7 +521,6 @@ static int sun4i_usb_phy_probe(struct pl - struct device *dev = &pdev->dev; - struct device_node *np = dev->of_node; - struct phy_provider *phy_provider; -- bool dedicated_clocks; - struct resource *res; - int i, ret; - -@@ -522,29 +531,9 @@ static int sun4i_usb_phy_probe(struct pl - mutex_init(&data->mutex); - INIT_DELAYED_WORK(&data->detect, sun4i_usb_phy0_id_vbus_det_scan); - dev_set_drvdata(dev, data); -- -- if (of_device_is_compatible(np, "allwinner,sun5i-a13-usb-phy") || -- of_device_is_compatible(np, "allwinner,sun8i-a23-usb-phy") || -- of_device_is_compatible(np, "allwinner,sun8i-a33-usb-phy")) -- data->num_phys = 2; -- else -- data->num_phys = 3; -- -- if (of_device_is_compatible(np, "allwinner,sun5i-a13-usb-phy") || -- of_device_is_compatible(np, "allwinner,sun7i-a20-usb-phy")) -- data->disc_thresh = 2; -- else -- data->disc_thresh = 3; -- -- if (of_device_is_compatible(np, "allwinner,sun6i-a31-usb-phy") || -- of_device_is_compatible(np, "allwinner,sun8i-a23-usb-phy") || -- of_device_is_compatible(np, "allwinner,sun8i-a33-usb-phy")) -- dedicated_clocks = true; -- else -- dedicated_clocks = false; -- -- if (of_device_is_compatible(np, "allwinner,sun8i-a33-usb-phy")) -- data->has_a33_phyctl = true; -+ data->cfg = of_device_get_match_data(dev); -+ if (!data->cfg) -+ return -EINVAL; - - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy_ctrl"); - data->base = devm_ioremap_resource(dev, res); -@@ -590,7 +579,7 @@ static int sun4i_usb_phy_probe(struct pl - } - } - -- for (i = 0; i < data->num_phys; i++) { -+ for (i = 0; i < data->cfg->num_phys; i++) { - struct sun4i_usb_phy *phy = data->phys + i; - char name[16]; - -@@ -602,7 +591,7 @@ static int sun4i_usb_phy_probe(struct pl - phy->vbus = NULL; - } - -- if (dedicated_clocks) -+ if (data->cfg->dedicated_clocks) - snprintf(name, sizeof(name), "usb%d_phy", i); - else - strlcpy(name, "usb_phy", sizeof(name)); -@@ -689,13 +678,61 @@ static int sun4i_usb_phy_probe(struct pl - return 0; - } - -+static const struct sun4i_usb_phy_cfg sun4i_a10_cfg = { -+ .num_phys = 3, -+ .type = sun4i_a10_phy, -+ .disc_thresh = 3, -+ .phyctl_offset = REG_PHYCTL_A10, -+ .dedicated_clocks = false, -+}; -+ -+static const struct sun4i_usb_phy_cfg sun5i_a13_cfg = { -+ .num_phys = 2, -+ .type = sun4i_a10_phy, -+ .disc_thresh = 2, -+ .phyctl_offset = REG_PHYCTL_A10, -+ .dedicated_clocks = false, -+}; -+ -+static const struct sun4i_usb_phy_cfg sun6i_a31_cfg = { -+ .num_phys = 3, -+ .type = sun4i_a10_phy, -+ .disc_thresh = 3, -+ .phyctl_offset = REG_PHYCTL_A10, -+ .dedicated_clocks = true, -+}; -+ -+static const struct sun4i_usb_phy_cfg sun7i_a20_cfg = { -+ .num_phys = 3, -+ .type = sun4i_a10_phy, -+ .disc_thresh = 2, -+ .phyctl_offset = REG_PHYCTL_A10, -+ .dedicated_clocks = false, -+}; -+ -+static const struct sun4i_usb_phy_cfg sun8i_a23_cfg = { -+ .num_phys = 2, -+ .type = sun4i_a10_phy, -+ .disc_thresh = 3, -+ .phyctl_offset = REG_PHYCTL_A10, -+ .dedicated_clocks = true, -+}; -+ -+static const struct sun4i_usb_phy_cfg sun8i_a33_cfg = { -+ .num_phys = 2, -+ .type = sun8i_a33_phy, -+ .disc_thresh = 3, -+ .phyctl_offset = REG_PHYCTL_A33, -+ .dedicated_clocks = true, -+}; -+ - static const struct of_device_id sun4i_usb_phy_of_match[] = { -- { .compatible = "allwinner,sun4i-a10-usb-phy" }, -- { .compatible = "allwinner,sun5i-a13-usb-phy" }, -- { .compatible = "allwinner,sun6i-a31-usb-phy" }, -- { .compatible = "allwinner,sun7i-a20-usb-phy" }, -- { .compatible = "allwinner,sun8i-a23-usb-phy" }, -- { .compatible = "allwinner,sun8i-a33-usb-phy" }, -+ { .compatible = "allwinner,sun4i-a10-usb-phy", .data = &sun4i_a10_cfg }, -+ { .compatible = "allwinner,sun5i-a13-usb-phy", .data = &sun5i_a13_cfg }, -+ { .compatible = "allwinner,sun6i-a31-usb-phy", .data = &sun6i_a31_cfg }, -+ { .compatible = "allwinner,sun7i-a20-usb-phy", .data = &sun7i_a20_cfg }, -+ { .compatible = "allwinner,sun8i-a23-usb-phy", .data = &sun8i_a23_cfg }, -+ { .compatible = "allwinner,sun8i-a33-usb-phy", .data = &sun8i_a33_cfg }, - { }, - }; - MODULE_DEVICE_TABLE(of, sun4i_usb_phy_of_match); diff --git a/target/linux/sunxi/patches-4.4/106-phy-add-h3-usbphys.patch b/target/linux/sunxi/patches-4.4/106-phy-add-h3-usbphys.patch deleted file mode 100644 index 33943230e8..0000000000 --- a/target/linux/sunxi/patches-4.4/106-phy-add-h3-usbphys.patch +++ /dev/null @@ -1,124 +0,0 @@ -From 317c5224795b41a08ba8c08573d74ba95096faa5 Mon Sep 17 00:00:00 2001 -From: Reinder de Haan -Date: Fri, 11 Dec 2015 16:32:18 +0100 -Subject: [PATCH] phy-sun4i-usb: Add support for the host usb-phys found on the - H3 SoC - -Note this commit only adds support for phys 1-3, phy 0, the otg phy, is -not yet (fully) supported after this commit. - -Signed-off-by: Reinder de Haan -Signed-off-by: Hans de Goede -Acked-by: Rob Herring -Signed-off-by: Kishon Vijay Abraham I ---- - .../devicetree/bindings/phy/sun4i-usb-phy.txt | 1 + - drivers/phy/phy-sun4i-usb.c | 41 +++++++++++++++++----- - 2 files changed, 33 insertions(+), 9 deletions(-) - ---- a/Documentation/devicetree/bindings/phy/sun4i-usb-phy.txt -+++ b/Documentation/devicetree/bindings/phy/sun4i-usb-phy.txt -@@ -9,6 +9,7 @@ Required properties: - * allwinner,sun7i-a20-usb-phy - * allwinner,sun8i-a23-usb-phy - * allwinner,sun8i-a33-usb-phy -+ * allwinner,sun8i-h3-usb-phy - - reg : a list of offset + length pairs - - reg-names : - * "phy_ctrl" ---- a/drivers/phy/phy-sun4i-usb.c -+++ b/drivers/phy/phy-sun4i-usb.c -@@ -47,6 +47,9 @@ - #define REG_PHYBIST 0x08 - #define REG_PHYTUNE 0x0c - #define REG_PHYCTL_A33 0x10 -+#define REG_PHY_UNK_H3 0x20 -+ -+#define REG_PMU_UNK_H3 0x10 - - #define PHYCTL_DATA BIT(7) - -@@ -80,7 +83,7 @@ - #define PHY_DISCON_TH_SEL 0x2a - #define PHY_SQUELCH_DETECT 0x3c - --#define MAX_PHYS 3 -+#define MAX_PHYS 4 - - /* - * Note do not raise the debounce time, we must report Vusb high within 100ms -@@ -92,6 +95,7 @@ - enum sun4i_usb_phy_type { - sun4i_a10_phy, - sun8i_a33_phy, -+ sun8i_h3_phy, - }; - - struct sun4i_usb_phy_cfg { -@@ -239,6 +243,7 @@ static int sun4i_usb_phy_init(struct phy - struct sun4i_usb_phy *phy = phy_get_drvdata(_phy); - struct sun4i_usb_phy_data *data = to_sun4i_usb_phy_data(phy); - int ret; -+ u32 val; - - ret = clk_prepare_enable(phy->clk); - if (ret) -@@ -250,16 +255,26 @@ static int sun4i_usb_phy_init(struct phy - return ret; - } - -- /* Enable USB 45 Ohm resistor calibration */ -- if (phy->index == 0) -- sun4i_usb_phy_write(phy, PHY_RES45_CAL_EN, 0x01, 1); -- -- /* Adjust PHY's magnitude and rate */ -- sun4i_usb_phy_write(phy, PHY_TX_AMPLITUDE_TUNE, 0x14, 5); -- -- /* Disconnect threshold adjustment */ -- sun4i_usb_phy_write(phy, PHY_DISCON_TH_SEL, -- data->cfg->disc_thresh, 2); -+ if (data->cfg->type == sun8i_h3_phy) { -+ if (phy->index == 0) { -+ val = readl(data->base + REG_PHY_UNK_H3); -+ writel(val & ~1, data->base + REG_PHY_UNK_H3); -+ } -+ -+ val = readl(phy->pmu + REG_PMU_UNK_H3); -+ writel(val & ~2, phy->pmu + REG_PMU_UNK_H3); -+ } else { -+ /* Enable USB 45 Ohm resistor calibration */ -+ if (phy->index == 0) -+ sun4i_usb_phy_write(phy, PHY_RES45_CAL_EN, 0x01, 1); -+ -+ /* Adjust PHY's magnitude and rate */ -+ sun4i_usb_phy_write(phy, PHY_TX_AMPLITUDE_TUNE, 0x14, 5); -+ -+ /* Disconnect threshold adjustment */ -+ sun4i_usb_phy_write(phy, PHY_DISCON_TH_SEL, -+ data->cfg->disc_thresh, 2); -+ } - - sun4i_usb_phy_passby(phy, 1); - -@@ -726,6 +741,13 @@ static const struct sun4i_usb_phy_cfg su - .dedicated_clocks = true, - }; - -+static const struct sun4i_usb_phy_cfg sun8i_h3_cfg = { -+ .num_phys = 4, -+ .type = sun8i_h3_phy, -+ .disc_thresh = 3, -+ .dedicated_clocks = true, -+}; -+ - static const struct of_device_id sun4i_usb_phy_of_match[] = { - { .compatible = "allwinner,sun4i-a10-usb-phy", .data = &sun4i_a10_cfg }, - { .compatible = "allwinner,sun5i-a13-usb-phy", .data = &sun5i_a13_cfg }, -@@ -733,6 +755,7 @@ static const struct of_device_id sun4i_u - { .compatible = "allwinner,sun7i-a20-usb-phy", .data = &sun7i_a20_cfg }, - { .compatible = "allwinner,sun8i-a23-usb-phy", .data = &sun8i_a23_cfg }, - { .compatible = "allwinner,sun8i-a33-usb-phy", .data = &sun8i_a33_cfg }, -+ { .compatible = "allwinner,sun8i-h3-usb-phy", .data = &sun8i_h3_cfg }, - { }, - }; - MODULE_DEVICE_TABLE(of, sun4i_usb_phy_of_match); diff --git a/target/linux/sunxi/patches-4.4/107-clk-sunxi-add-h3-usbphy-clocks.patch b/target/linux/sunxi/patches-4.4/107-clk-sunxi-add-h3-usbphy-clocks.patch deleted file mode 100644 index c845d512e4..0000000000 --- a/target/linux/sunxi/patches-4.4/107-clk-sunxi-add-h3-usbphy-clocks.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 7bec0200ac214b5cba44e2c2c4385815be4b9f00 Mon Sep 17 00:00:00 2001 -From: Reinder de Haan -Date: Sun, 15 Nov 2015 20:46:13 +0100 -Subject: [PATCH] clk: sunxi: Add support for the H3 usb phy clocks - -The H3 has a usb-phy clk register which is similar to that of earlier -SoCs, but with support for a larger number of phys. So we can simply add -a new set of clk-data and a new compatible and be done with it. - -Acked-by: Chen-Yu Tsai -Acked-by: Rob Herring -Signed-off-by: Reinder de Haan -Signed-off-by: Hans de Goede -Signed-off-by: Maxime Ripard ---- - Documentation/devicetree/bindings/clock/sunxi.txt | 1 + - drivers/clk/sunxi/clk-usb.c | 12 ++++++++++++ - 2 files changed, 13 insertions(+) - ---- a/Documentation/devicetree/bindings/clock/sunxi.txt -+++ b/Documentation/devicetree/bindings/clock/sunxi.txt -@@ -70,6 +70,7 @@ Required properties: - "allwinner,sun5i-a13-usb-clk" - for usb gates + resets on A13 - "allwinner,sun6i-a31-usb-clk" - for usb gates + resets on A31 - "allwinner,sun8i-a23-usb-clk" - for usb gates + resets on A23 -+ "allwinner,sun8i-h3-usb-clk" - for usb gates + resets on H3 - "allwinner,sun9i-a80-usb-mod-clk" - for usb gates + resets on A80 - "allwinner,sun9i-a80-usb-phy-clk" - for usb phy gates + resets on A80 - ---- a/drivers/clk/sunxi/clk-usb.c -+++ b/drivers/clk/sunxi/clk-usb.c -@@ -243,3 +243,15 @@ static void __init sun9i_a80_usb_phy_set - sunxi_usb_clk_setup(node, &sun9i_a80_usb_phy_data, &a80_usb_phy_lock); - } - CLK_OF_DECLARE(sun9i_a80_usb_phy, "allwinner,sun9i-a80-usb-phy-clk", sun9i_a80_usb_phy_setup); -+ -+static const struct usb_clk_data sun8i_h3_usb_clk_data __initconst = { -+ .clk_mask = BIT(19) | BIT(18) | BIT(17) | BIT(16) | -+ BIT(11) | BIT(10) | BIT(9) | BIT(8), -+ .reset_mask = BIT(3) | BIT(2) | BIT(1) | BIT(0), -+}; -+ -+static void __init sun8i_h3_usb_setup(struct device_node *node) -+{ -+ sunxi_usb_clk_setup(node, &sun8i_h3_usb_clk_data, &sun4i_a10_usb_lock); -+} -+CLK_OF_DECLARE(sun8i_h3_usb, "allwinner,sun8i-h3-usb-clk", sun8i_h3_usb_setup); diff --git a/target/linux/sunxi/patches-4.4/110-clk-sunxi-add-ve-for-sun457i.patch b/target/linux/sunxi/patches-4.4/110-clk-sunxi-add-ve-for-sun457i.patch deleted file mode 100644 index f929753d77..0000000000 --- a/target/linux/sunxi/patches-4.4/110-clk-sunxi-add-ve-for-sun457i.patch +++ /dev/null @@ -1,226 +0,0 @@ -From 3cdd9f5c4953465abb87ec757159cc0576ae6b0a Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Sat, 5 Dec 2015 21:16:43 +0800 -Subject: [PATCH] clk: sunxi: Add VE (Video Engine) module clock driver for - sun[457]i - -The video engine has its own special module clock, consisting of a clock -gate, configurable dividers, and a reset control. - -On later (sun[68]i) families, the reset control is moved out of this -piece of hardware and grouped with reset controls of other peripherals. - -Signed-off-by: Chen-Yu Tsai -Tested-by: Jens Kuske -Signed-off-by: Maxime Ripard ---- - Documentation/devicetree/bindings/clock/sunxi.txt | 4 + - drivers/clk/sunxi/Makefile | 1 + - drivers/clk/sunxi/clk-a10-ve.c | 171 ++++++++++++++++++++++ - 3 files changed, 176 insertions(+) - create mode 100644 drivers/clk/sunxi/clk-a10-ve.c - ---- a/Documentation/devicetree/bindings/clock/sunxi.txt -+++ b/Documentation/devicetree/bindings/clock/sunxi.txt -@@ -73,6 +73,7 @@ Required properties: - "allwinner,sun8i-h3-usb-clk" - for usb gates + resets on H3 - "allwinner,sun9i-a80-usb-mod-clk" - for usb gates + resets on A80 - "allwinner,sun9i-a80-usb-phy-clk" - for usb phy gates + resets on A80 -+ "allwinner,sun4i-a10-ve-clk" - for the Video Engine clock - - Required properties for all clocks: - - reg : shall be the control register address for the clock. -@@ -92,6 +93,9 @@ Required properties for all clocks: - And "allwinner,*-usb-clk" clocks also require: - - reset-cells : shall be set to 1 - -+The "allwinner,sun4i-a10-ve-clk" clock also requires: -+- reset-cells : shall be set to 0 -+ - The "allwinner,sun9i-a80-mmc-config-clk" clock also requires: - - #reset-cells : shall be set to 1 - - resets : shall be the reset control phandle for the mmc block. ---- a/drivers/clk/sunxi/Makefile -+++ b/drivers/clk/sunxi/Makefile -@@ -7,6 +7,7 @@ obj-y += clk-a10-codec.o - obj-y += clk-a10-hosc.o - obj-y += clk-a10-mod1.o - obj-y += clk-a10-pll2.o -+obj-y += clk-a10-ve.o - obj-y += clk-a20-gmac.o - obj-y += clk-mod0.o - obj-y += clk-simple-gates.o ---- /dev/null -+++ b/drivers/clk/sunxi/clk-a10-ve.c -@@ -0,0 +1,171 @@ -+/* -+ * Copyright 2015 Chen-Yu Tsai -+ * -+ * Chen-Yu Tsai -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (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. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static DEFINE_SPINLOCK(ve_lock); -+ -+#define SUN4I_VE_ENABLE 31 -+#define SUN4I_VE_DIVIDER_SHIFT 16 -+#define SUN4I_VE_DIVIDER_WIDTH 3 -+#define SUN4I_VE_RESET 0 -+ -+/** -+ * sunxi_ve_reset... - reset bit in ve clk registers handling -+ */ -+ -+struct ve_reset_data { -+ void __iomem *reg; -+ spinlock_t *lock; -+ struct reset_controller_dev rcdev; -+}; -+ -+static int sunxi_ve_reset_assert(struct reset_controller_dev *rcdev, -+ unsigned long id) -+{ -+ struct ve_reset_data *data = container_of(rcdev, -+ struct ve_reset_data, -+ rcdev); -+ unsigned long flags; -+ u32 reg; -+ -+ spin_lock_irqsave(data->lock, flags); -+ -+ reg = readl(data->reg); -+ writel(reg & ~BIT(SUN4I_VE_RESET), data->reg); -+ -+ spin_unlock_irqrestore(data->lock, flags); -+ -+ return 0; -+} -+ -+static int sunxi_ve_reset_deassert(struct reset_controller_dev *rcdev, -+ unsigned long id) -+{ -+ struct ve_reset_data *data = container_of(rcdev, -+ struct ve_reset_data, -+ rcdev); -+ unsigned long flags; -+ u32 reg; -+ -+ spin_lock_irqsave(data->lock, flags); -+ -+ reg = readl(data->reg); -+ writel(reg | BIT(SUN4I_VE_RESET), data->reg); -+ -+ spin_unlock_irqrestore(data->lock, flags); -+ -+ return 0; -+} -+ -+static int sunxi_ve_of_xlate(struct reset_controller_dev *rcdev, -+ const struct of_phandle_args *reset_spec) -+{ -+ if (WARN_ON(reset_spec->args_count != 0)) -+ return -EINVAL; -+ -+ return 0; -+} -+ -+static struct reset_control_ops sunxi_ve_reset_ops = { -+ .assert = sunxi_ve_reset_assert, -+ .deassert = sunxi_ve_reset_deassert, -+}; -+ -+static void __init sun4i_ve_clk_setup(struct device_node *node) -+{ -+ struct clk *clk; -+ struct clk_divider *div; -+ struct clk_gate *gate; -+ struct ve_reset_data *reset_data; -+ const char *parent; -+ const char *clk_name = node->name; -+ void __iomem *reg; -+ int err; -+ -+ reg = of_io_request_and_map(node, 0, of_node_full_name(node)); -+ if (IS_ERR(reg)) -+ return; -+ -+ div = kzalloc(sizeof(*div), GFP_KERNEL); -+ if (!div) -+ goto err_unmap; -+ -+ gate = kzalloc(sizeof(*gate), GFP_KERNEL); -+ if (!gate) -+ goto err_free_div; -+ -+ of_property_read_string(node, "clock-output-names", &clk_name); -+ parent = of_clk_get_parent_name(node, 0); -+ -+ gate->reg = reg; -+ gate->bit_idx = SUN4I_VE_ENABLE; -+ gate->lock = &ve_lock; -+ -+ div->reg = reg; -+ div->shift = SUN4I_VE_DIVIDER_SHIFT; -+ div->width = SUN4I_VE_DIVIDER_WIDTH; -+ div->lock = &ve_lock; -+ -+ clk = clk_register_composite(NULL, clk_name, &parent, 1, -+ NULL, NULL, -+ &div->hw, &clk_divider_ops, -+ &gate->hw, &clk_gate_ops, -+ CLK_SET_RATE_PARENT); -+ if (IS_ERR(clk)) -+ goto err_free_gate; -+ -+ err = of_clk_add_provider(node, of_clk_src_simple_get, clk); -+ if (err) -+ goto err_unregister_clk; -+ -+ reset_data = kzalloc(sizeof(*reset_data), GFP_KERNEL); -+ if (!reset_data) -+ goto err_del_provider; -+ -+ reset_data->reg = reg; -+ reset_data->lock = &ve_lock; -+ reset_data->rcdev.nr_resets = 1; -+ reset_data->rcdev.ops = &sunxi_ve_reset_ops; -+ reset_data->rcdev.of_node = node; -+ reset_data->rcdev.of_xlate = sunxi_ve_of_xlate; -+ reset_data->rcdev.of_reset_n_cells = 0; -+ err = reset_controller_register(&reset_data->rcdev); -+ if (err) -+ goto err_free_reset; -+ -+ return; -+ -+err_free_reset: -+ kfree(reset_data); -+err_del_provider: -+ of_clk_del_provider(node); -+err_unregister_clk: -+ clk_unregister(clk); -+err_free_gate: -+ kfree(gate); -+err_free_div: -+ kfree(div); -+err_unmap: -+ iounmap(reg); -+} -+CLK_OF_DECLARE(sun4i_ve, "allwinner,sun4i-a10-ve-clk", -+ sun4i_ve_clk_setup); diff --git a/target/linux/sunxi/patches-4.4/111-1-dt-sun4i-add-ve-clock-module.patch b/target/linux/sunxi/patches-4.4/111-1-dt-sun4i-add-ve-clock-module.patch deleted file mode 100644 index cfcf9bfb40..0000000000 --- a/target/linux/sunxi/patches-4.4/111-1-dt-sun4i-add-ve-clock-module.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 1ccc4939220cf815c309feddcf82dba260499194 Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Sat, 5 Dec 2015 21:16:45 +0800 -Subject: [PATCH] ARM: dts: sun4i: Add VE (Video Engine) module clock node - -The video engine has its own module clock, which also includes a -reset control for it. - -Signed-off-by: Chen-Yu Tsai -Signed-off-by: Maxime Ripard ---- - arch/arm/boot/dts/sun4i-a10.dtsi | 9 +++++++++ - 1 file changed, 9 insertions(+) - ---- a/arch/arm/boot/dts/sun4i-a10.dtsi -+++ b/arch/arm/boot/dts/sun4i-a10.dtsi -@@ -520,6 +520,15 @@ - "dram_de_mp", "dram_ace"; - }; - -+ ve_clk: clk@01c2013c { -+ #clock-cells = <0>; -+ #reset-cells = <0>; -+ compatible = "allwinner,sun4i-a10-ve-clk"; -+ reg = <0x01c2013c 0x4>; -+ clocks = <&pll4>; -+ clock-output-names = "ve"; -+ }; -+ - codec_clk: clk@01c20140 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-codec-clk"; diff --git a/target/linux/sunxi/patches-4.4/111-2-dt-sun7i-add-ve-clock-module.patch b/target/linux/sunxi/patches-4.4/111-2-dt-sun7i-add-ve-clock-module.patch deleted file mode 100644 index 85d2d31615..0000000000 --- a/target/linux/sunxi/patches-4.4/111-2-dt-sun7i-add-ve-clock-module.patch +++ /dev/null @@ -1,32 +0,0 @@ -From f0571ab140723f9a898d4a404118580534dcc468 Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Sat, 5 Dec 2015 21:16:47 +0800 -Subject: [PATCH] ARM: dts: sun7i: Add VE (Video Engine) module clock node - -The video engine has its own module clock, which also includes a -reset control for it. - -Signed-off-by: Chen-Yu Tsai -Signed-off-by: Maxime Ripard ---- - arch/arm/boot/dts/sun7i-a20.dtsi | 9 +++++++++ - 1 file changed, 9 insertions(+) - ---- a/arch/arm/boot/dts/sun7i-a20.dtsi -+++ b/arch/arm/boot/dts/sun7i-a20.dtsi -@@ -527,6 +527,15 @@ - "dram_de_mp", "dram_ace"; - }; - -+ ve_clk: clk@01c2013c { -+ #clock-cells = <0>; -+ #reset-cells = <0>; -+ compatible = "allwinner,sun4i-a10-ve-clk"; -+ reg = <0x01c2013c 0x4>; -+ clocks = <&pll4>; -+ clock-output-names = "ve"; -+ }; -+ - codec_clk: clk@01c20140 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-codec-clk"; diff --git a/target/linux/sunxi/patches-4.4/115-musb-ignore-vbus-errors.patch b/target/linux/sunxi/patches-4.4/115-musb-ignore-vbus-errors.patch deleted file mode 100644 index 49c7162a6a..0000000000 --- a/target/linux/sunxi/patches-4.4/115-musb-ignore-vbus-errors.patch +++ /dev/null @@ -1,26 +0,0 @@ -From fce20ac5d8c98f1a8ea5298051d9fa669e455f04 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Tue, 4 Aug 2015 23:22:45 +0200 -Subject: [PATCH] musb: sunxi: Ignore VBus errors in host-only mode - -For some unclear reason sometimes we get VBus errors in host-only mode, -even though we do not have any vbus-detection then. Ignore these. - -Signed-off-by: Hans de Goede ---- - drivers/usb/musb/sunxi.c | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/drivers/usb/musb/sunxi.c -+++ b/drivers/usb/musb/sunxi.c -@@ -194,6 +194,10 @@ static irqreturn_t sunxi_musb_interrupt( - musb_writeb(musb->mregs, MUSB_FADDR, 0); - } - -+ /* Ignore Vbus errors when in host only mode */ -+ if (musb->port_mode == MUSB_PORT_MODE_HOST) -+ musb->int_usb &= ~MUSB_INTR_VBUSERROR; -+ - musb->int_tx = readw(musb->mregs + SUNXI_MUSB_INTRTX); - if (musb->int_tx) - writew(musb->int_tx, musb->mregs + SUNXI_MUSB_INTRTX); diff --git a/target/linux/sunxi/patches-4.4/130-pinctrl-sunxi-add-h3-pio.patch b/target/linux/sunxi/patches-4.4/130-pinctrl-sunxi-add-h3-pio.patch deleted file mode 100644 index 47dce12a9d..0000000000 --- a/target/linux/sunxi/patches-4.4/130-pinctrl-sunxi-add-h3-pio.patch +++ /dev/null @@ -1,568 +0,0 @@ -From 03b83828e452418c18ba506e3e02b5deadbb53fa Mon Sep 17 00:00:00 2001 -From: Jens Kuske -Date: Tue, 27 Oct 2015 17:50:23 +0100 -Subject: [PATCH] pinctrl: sunxi: Add H3 PIO controller support - -The H3 uses the same pin controller as previous SoC's from Allwinner. -Add support for the pins controlled by the main PIO controller. - -Signed-off-by: Jens Kuske -Acked-by: Maxime Ripard ---- - .../bindings/pinctrl/allwinner,sunxi-pinctrl.txt | 1 + - drivers/pinctrl/sunxi/Kconfig | 4 + - drivers/pinctrl/sunxi/Makefile | 1 + - drivers/pinctrl/sunxi/pinctrl-sun8i-h3.c | 516 +++++++++++++++++++++ - 4 files changed, 522 insertions(+) - create mode 100644 drivers/pinctrl/sunxi/pinctrl-sun8i-h3.c - ---- a/Documentation/devicetree/bindings/pinctrl/allwinner,sunxi-pinctrl.txt -+++ b/Documentation/devicetree/bindings/pinctrl/allwinner,sunxi-pinctrl.txt -@@ -18,6 +18,7 @@ Required properties: - "allwinner,sun8i-a23-r-pinctrl" - "allwinner,sun8i-a33-pinctrl" - "allwinner,sun8i-a83t-pinctrl" -+ "allwinner,sun8i-h3-pinctrl" - - - reg: Should contain the register physical address and length for the - pin controller. ---- a/drivers/pinctrl/sunxi/Kconfig -+++ b/drivers/pinctrl/sunxi/Kconfig -@@ -51,6 +51,10 @@ config PINCTRL_SUN8I_A23_R - depends on RESET_CONTROLLER - select PINCTRL_SUNXI_COMMON - -+config PINCTRL_SUN8I_H3 -+ def_bool MACH_SUN8I -+ select PINCTRL_SUNXI_COMMON -+ - config PINCTRL_SUN9I_A80 - def_bool MACH_SUN9I - select PINCTRL_SUNXI_COMMON ---- a/drivers/pinctrl/sunxi/Makefile -+++ b/drivers/pinctrl/sunxi/Makefile -@@ -13,4 +13,5 @@ obj-$(CONFIG_PINCTRL_SUN8I_A23) += pinc - obj-$(CONFIG_PINCTRL_SUN8I_A23_R) += pinctrl-sun8i-a23-r.o - obj-$(CONFIG_PINCTRL_SUN8I_A33) += pinctrl-sun8i-a33.o - obj-$(CONFIG_PINCTRL_SUN8I_A83T) += pinctrl-sun8i-a83t.o -+obj-$(CONFIG_PINCTRL_SUN8I_H3) += pinctrl-sun8i-h3.o - obj-$(CONFIG_PINCTRL_SUN9I_A80) += pinctrl-sun9i-a80.o ---- /dev/null -+++ b/drivers/pinctrl/sunxi/pinctrl-sun8i-h3.c -@@ -0,0 +1,516 @@ -+/* -+ * Allwinner H3 SoCs pinctrl driver. -+ * -+ * Copyright (C) 2015 Jens Kuske -+ * -+ * Based on pinctrl-sun8i-a23.c, which is: -+ * Copyright (C) 2014 Chen-Yu Tsai -+ * Copyright (C) 2014 Maxime Ripard -+ * -+ * This file is licensed under the terms of the GNU General Public -+ * License version 2. This program is licensed "as is" without any -+ * warranty of any kind, whether express or implied. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include "pinctrl-sunxi.h" -+ -+static const struct sunxi_desc_pin sun8i_h3_pins[] = { -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 0), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "uart2"), /* TX */ -+ SUNXI_FUNCTION(0x3, "jtag"), /* MS */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)), /* PA_EINT0 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 1), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "uart2"), /* RX */ -+ SUNXI_FUNCTION(0x3, "jtag"), /* CK */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)), /* PA_EINT1 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 2), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "uart2"), /* RTS */ -+ SUNXI_FUNCTION(0x3, "jtag"), /* DO */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)), /* PA_EINT2 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 3), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "uart2"), /* CTS */ -+ SUNXI_FUNCTION(0x3, "jtag"), /* DI */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)), /* PA_EINT3 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 4), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "uart0"), /* TX */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)), /* PA_EINT4 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 5), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "uart0"), /* RX */ -+ SUNXI_FUNCTION(0x3, "pwm0"), -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)), /* PA_EINT5 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 6), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "sim"), /* PWREN */ -+ SUNXI_FUNCTION(0x3, "pwm1"), -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)), /* PA_EINT6 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 7), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "sim"), /* CLK */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)), /* PA_EINT7 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 8), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "sim"), /* DATA */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 8)), /* PA_EINT8 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 9), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "sim"), /* RST */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 9)), /* PA_EINT9 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 10), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "sim"), /* DET */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 10)), /* PA_EINT10 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 11), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "i2c0"), /* SCK */ -+ SUNXI_FUNCTION(0x3, "di"), /* TX */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 11)), /* PA_EINT11 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 12), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "i2c0"), /* SDA */ -+ SUNXI_FUNCTION(0x3, "di"), /* RX */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 12)), /* PA_EINT12 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 13), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "spi1"), /* CS */ -+ SUNXI_FUNCTION(0x3, "uart3"), /* TX */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 13)), /* PA_EINT13 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 14), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "spi1"), /* CLK */ -+ SUNXI_FUNCTION(0x3, "uart3"), /* RX */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 14)), /* PA_EINT14 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 15), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "spi1"), /* MOSI */ -+ SUNXI_FUNCTION(0x3, "uart3"), /* RTS */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 15)), /* PA_EINT15 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 16), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "spi1"), /* MISO */ -+ SUNXI_FUNCTION(0x3, "uart3"), /* CTS */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 16)), /* PA_EINT16 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 17), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "spdif"), /* OUT */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 17)), /* PA_EINT17 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 18), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "i2s0"), /* SYNC */ -+ SUNXI_FUNCTION(0x3, "i2c1"), /* SCK */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 18)), /* PA_EINT18 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 19), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "i2s0"), /* CLK */ -+ SUNXI_FUNCTION(0x3, "i2c1"), /* SDA */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 19)), /* PA_EINT19 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 20), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "i2s0"), /* DOUT */ -+ SUNXI_FUNCTION(0x3, "sim"), /* VPPEN */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 20)), /* PA_EINT20 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 21), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "i2s0"), /* DIN */ -+ SUNXI_FUNCTION(0x3, "sim"), /* VPPPP */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 21)), /* PA_EINT21 */ -+ /* Hole */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* WE */ -+ SUNXI_FUNCTION(0x3, "spi0")), /* MOSI */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* ALE */ -+ SUNXI_FUNCTION(0x3, "spi0")), /* MISO */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* CLE */ -+ SUNXI_FUNCTION(0x3, "spi0")), /* CLK */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* CE1 */ -+ SUNXI_FUNCTION(0x3, "spi0")), /* CS */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 4), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0")), /* CE0 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* RE */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* CLK */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* RB0 */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* CMD */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 7), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0")), /* RB1 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 8), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* DQ0 */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* D0 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 9), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* DQ1 */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* D1 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 10), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* DQ2 */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* D2 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 11), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* DQ3 */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* D3 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* DQ4 */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* D4 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* DQ5 */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* D5 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand"), /* DQ6 */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* D6 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 15), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand"), /* DQ7 */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* D7 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 16), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand"), /* DQS */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* RST */ -+ /* Hole */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 0), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* RXD3 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 1), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* RXD2 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 2), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* RXD1 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 3), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* RXD0 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 4), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* RXCK */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 5), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* RXCTL/RCDV */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 6), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* RXERR */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 7), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* TXD3 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 8), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* TXD2L */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 9), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* TXD1 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 10), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* TXD0 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* CRS */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* TXCK */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* TXCTL/TXEN */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* TXERR */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* CLKIN/COL */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 16), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* MDC */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 17), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* MDIO */ -+ /* Hole */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 0), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* PCLK */ -+ SUNXI_FUNCTION(0x3, "ts")), /* CLK */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 1), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* MCLK */ -+ SUNXI_FUNCTION(0x3, "ts")), /* ERR */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 2), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* HSYNC */ -+ SUNXI_FUNCTION(0x3, "ts")), /* SYNC */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 3), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* VSYNC */ -+ SUNXI_FUNCTION(0x3, "ts")), /* DVLD */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 4), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* D0 */ -+ SUNXI_FUNCTION(0x3, "ts")), /* D0 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 5), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* D1 */ -+ SUNXI_FUNCTION(0x3, "ts")), /* D1 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 6), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* D2 */ -+ SUNXI_FUNCTION(0x3, "ts")), /* D2 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 7), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* D3 */ -+ SUNXI_FUNCTION(0x3, "ts")), /* D3 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 8), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* D4 */ -+ SUNXI_FUNCTION(0x3, "ts")), /* D4 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 9), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* D5 */ -+ SUNXI_FUNCTION(0x3, "ts")), /* D5 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 10), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* D6 */ -+ SUNXI_FUNCTION(0x3, "ts")), /* D6 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 11), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* D7 */ -+ SUNXI_FUNCTION(0x3, "ts")), /* D7 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 12), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* SCK */ -+ SUNXI_FUNCTION(0x3, "i2c2")), /* SCK */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 13), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* SDA */ -+ SUNXI_FUNCTION(0x3, "i2c2")), /* SDA */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 14), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out")), -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 15), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out")), -+ /* Hole */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc0"), /* D1 */ -+ SUNXI_FUNCTION(0x3, "jtag")), /* MS */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc0"), /* D0 */ -+ SUNXI_FUNCTION(0x3, "jtag")), /* DI */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc0"), /* CLK */ -+ SUNXI_FUNCTION(0x3, "uart0")), /* TX */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc0"), /* CMD */ -+ SUNXI_FUNCTION(0x3, "jtag")), /* DO */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc0"), /* D3 */ -+ SUNXI_FUNCTION(0x3, "uart0")), /* RX */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc0"), /* D2 */ -+ SUNXI_FUNCTION(0x3, "jtag")), /* CK */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 6), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc0")), /* DET */ -+ /* Hole */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc1"), /* CLK */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 0)), /* PG_EINT0 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc1"), /* CMD */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 1)), /* PG_EINT1 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc1"), /* D0 */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 2)), /* PG_EINT2 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc1"), /* D1 */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 3)), /* PG_EINT3 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc1"), /* D2 */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 4)), /* PG_EINT4 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc1"), /* D3 */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 5)), /* PG_EINT5 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 6), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "uart1"), /* TX */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 6)), /* PG_EINT6 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 7), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "uart1"), /* RX */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 7)), /* PG_EINT7 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "uart1"), /* RTS */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 8)), /* PG_EINT8 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "uart1"), /* CTS */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 9)), /* PG_EINT9 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "i2s1"), /* SYNC */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 10)), /* PG_EINT10 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "i2s1"), /* CLK */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 11)), /* PG_EINT11 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 12), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "i2s1"), /* DOUT */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 12)), /* PG_EINT12 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 13), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "i2s1"), /* DIN */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 13)), /* PG_EINT13 */ -+}; -+ -+static const struct sunxi_pinctrl_desc sun8i_h3_pinctrl_data = { -+ .pins = sun8i_h3_pins, -+ .npins = ARRAY_SIZE(sun8i_h3_pins), -+ .irq_banks = 2, -+}; -+ -+static int sun8i_h3_pinctrl_probe(struct platform_device *pdev) -+{ -+ return sunxi_pinctrl_init(pdev, -+ &sun8i_h3_pinctrl_data); -+} -+ -+static const struct of_device_id sun8i_h3_pinctrl_match[] = { -+ { .compatible = "allwinner,sun8i-h3-pinctrl", }, -+ {} -+}; -+ -+static struct platform_driver sun8i_h3_pinctrl_driver = { -+ .probe = sun8i_h3_pinctrl_probe, -+ .driver = { -+ .name = "sun8i-h3-pinctrl", -+ .of_match_table = sun8i_h3_pinctrl_match, -+ }, -+}; -+builtin_platform_driver(sun8i_h3_pinctrl_driver); diff --git a/target/linux/sunxi/patches-4.4/131-reset-add-h3-resets.patch b/target/linux/sunxi/patches-4.4/131-reset-add-h3-resets.patch deleted file mode 100644 index f8e599fbe3..0000000000 --- a/target/linux/sunxi/patches-4.4/131-reset-add-h3-resets.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 5f0bb9d0bc545ef53a83f7bd176fdc0736eed8e5 Mon Sep 17 00:00:00 2001 -From: Jens Kuske -Date: Tue, 27 Oct 2015 17:50:24 +0100 -Subject: [PATCH] reset: sunxi: Add Allwinner H3 bus resets - -The H3 bus resets have some holes between the registers, so we add -an of_xlate() function to skip them according to the datasheet. - -Signed-off-by: Jens Kuske ---- - .../bindings/reset/allwinner,sunxi-clock-reset.txt | 1 + - drivers/reset/reset-sunxi.c | 30 +++++++++++++++++++--- - 2 files changed, 28 insertions(+), 3 deletions(-) - ---- a/Documentation/devicetree/bindings/reset/allwinner,sunxi-clock-reset.txt -+++ b/Documentation/devicetree/bindings/reset/allwinner,sunxi-clock-reset.txt -@@ -8,6 +8,7 @@ Required properties: - - compatible: Should be one of the following: - "allwinner,sun6i-a31-ahb1-reset" - "allwinner,sun6i-a31-clock-reset" -+ "allwinner,sun8i-h3-bus-reset" - - reg: should be register base and length as documented in the - datasheet - - #reset-cells: 1, see below ---- a/drivers/reset/reset-sunxi.c -+++ b/drivers/reset/reset-sunxi.c -@@ -75,7 +75,9 @@ static struct reset_control_ops sunxi_re - .deassert = sunxi_reset_deassert, - }; - --static int sunxi_reset_init(struct device_node *np) -+static int sunxi_reset_init(struct device_node *np, -+ int (*of_xlate)(struct reset_controller_dev *rcdev, -+ const struct of_phandle_args *reset_spec)) - { - struct sunxi_reset_data *data; - struct resource res; -@@ -108,6 +110,7 @@ static int sunxi_reset_init(struct devic - data->rcdev.nr_resets = size * 32; - data->rcdev.ops = &sunxi_reset_ops; - data->rcdev.of_node = np; -+ data->rcdev.of_xlate = of_xlate; - reset_controller_register(&data->rcdev); - - return 0; -@@ -117,6 +120,21 @@ err_alloc: - return ret; - }; - -+static int sun8i_h3_bus_reset_xlate(struct reset_controller_dev *rcdev, -+ const struct of_phandle_args *reset_spec) -+{ -+ unsigned int index = reset_spec->args[0]; -+ -+ if (index < 96) -+ return index; -+ else if (index < 128) -+ return index + 32; -+ else if (index < 160) -+ return index + 64; -+ else -+ return -EINVAL; -+} -+ - /* - * These are the reset controller we need to initialize early on in - * our system, before we can even think of using a regular device -@@ -124,15 +142,21 @@ err_alloc: - */ - static const struct of_device_id sunxi_early_reset_dt_ids[] __initdata = { - { .compatible = "allwinner,sun6i-a31-ahb1-reset", }, -+ { .compatible = "allwinner,sun8i-h3-bus-reset", .data = sun8i_h3_bus_reset_xlate, }, - { /* sentinel */ }, - }; - - void __init sun6i_reset_init(void) - { - struct device_node *np; -- -- for_each_matching_node(np, sunxi_early_reset_dt_ids) -- sunxi_reset_init(np); -+ const struct of_device_id *match; -+ int (*of_xlate)(struct reset_controller_dev *rcdev, -+ const struct of_phandle_args *reset_spec); -+ -+ for_each_matching_node_and_match(np, sunxi_early_reset_dt_ids, &match) { -+ of_xlate = match->data; -+ sunxi_reset_init(np, of_xlate); -+ } - } - - /* diff --git a/target/linux/sunxi/patches-4.4/132-dt-sun8i-add-h3-usbclocks.patch b/target/linux/sunxi/patches-4.4/132-dt-sun8i-add-h3-usbclocks.patch deleted file mode 100644 index 13d44e4468..0000000000 --- a/target/linux/sunxi/patches-4.4/132-dt-sun8i-add-h3-usbclocks.patch +++ /dev/null @@ -1,34 +0,0 @@ -From d6a71e3caae07fb2d98e93ee62477273abaceb27 Mon Sep 17 00:00:00 2001 -From: Reinder de Haan -Date: Tue, 3 Nov 2015 15:13:00 +0100 -Subject: [PATCH] ARM: dts: sun8i: Add support for H3 usb clocks - -Add a node describing the usb-clks found on the H3. - -Signed-off-by: Reinder de Haan -Signed-off-by: Hans de Goede ---- - arch/arm/boot/dts/sun8i-h3.dtsi | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - ---- a/arch/arm/boot/dts/sun8i-h3.dtsi -+++ b/arch/arm/boot/dts/sun8i-h3.dtsi -@@ -269,6 +269,18 @@ - "mmc2_sample"; - }; - -+ usb_clk: clk@01c200cc { -+ #clock-cells = <1>; -+ #reset-cells = <1>; -+ compatible = "allwinner,sun8i-h3-usb-clk"; -+ reg = <0x01c200cc 0x4>; -+ clocks = <&osc24M>; -+ clock-output-names = "usb_phy0", "usb_phy1", -+ "usb_phy2", "usb_phy3", -+ "usb_ohci0", "usb_ohci1", -+ "usb_ohci2", "usb_ohci3"; -+ }; -+ - mbus_clk: clk@01c2015c { - #clock-cells = <0>; - compatible = "allwinner,sun8i-a23-mbus-clk"; diff --git a/target/linux/sunxi/patches-4.4/133-dt-sun8i-add-usbphy-usbhost-ctrl-nodes.patch b/target/linux/sunxi/patches-4.4/133-dt-sun8i-add-usbphy-usbhost-ctrl-nodes.patch deleted file mode 100644 index 78dcaa9fec..0000000000 --- a/target/linux/sunxi/patches-4.4/133-dt-sun8i-add-usbphy-usbhost-ctrl-nodes.patch +++ /dev/null @@ -1,123 +0,0 @@ -From 5971a2f283d21eab36d7de24d35301f081f83418 Mon Sep 17 00:00:00 2001 -From: Reinder de Haan -Date: Tue, 3 Nov 2015 15:14:20 +0100 -Subject: [PATCH] ARM: dts: sun8i: Add usbphy and usb host controller nodes - -Add nodes describing the H3's usbphy and usb host controller nodes. - -Signed-off-by: Reinder de Haan -Signed-off-by: Hans de Goede ---- - arch/arm/boot/dts/sun8i-h3.dtsi | 101 ++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 101 insertions(+) - ---- a/arch/arm/boot/dts/sun8i-h3.dtsi -+++ b/arch/arm/boot/dts/sun8i-h3.dtsi -@@ -362,6 +362,107 @@ - #size-cells = <0>; - }; - -+ usbphy: phy@01c19400 { -+ compatible = "allwinner,sun8i-h3-usb-phy"; -+ reg = <0x01c19400 0x2c>, -+ <0x01c1a800 0x4>, -+ <0x01c1b800 0x4>, -+ <0x01c1c800 0x4>, -+ <0x01c1d800 0x4>; -+ reg-names = "phy_ctrl", -+ "pmu0", -+ "pmu1", -+ "pmu2", -+ "pmu3"; -+ clocks = <&usb_clk 8>, -+ <&usb_clk 9>, -+ <&usb_clk 10>, -+ <&usb_clk 11>; -+ clock-names = "usb0_phy", -+ "usb1_phy", -+ "usb2_phy", -+ "usb3_phy"; -+ resets = <&usb_clk 0>, -+ <&usb_clk 1>, -+ <&usb_clk 2>, -+ <&usb_clk 3>; -+ reset-names = "usb0_reset", -+ "usb1_reset", -+ "usb2_reset", -+ "usb3_reset"; -+ status = "disabled"; -+ #phy-cells = <1>; -+ }; -+ -+ ehci1: usb@01c1b000 { -+ compatible = "allwinner,sun8i-h3-ehci", "generic-ehci"; -+ reg = <0x01c1b000 0x100>; -+ interrupts = ; -+ clocks = <&bus_gates 25>, <&bus_gates 29>; -+ resets = <&ahb_rst 25>, <&ahb_rst 29>; -+ phys = <&usbphy 1>; -+ phy-names = "usb"; -+ status = "disabled"; -+ }; -+ -+ ohci1: usb@01c1b400 { -+ compatible = "allwinner,sun8i-h3-ohci", "generic-ohci"; -+ reg = <0x01c1b400 0x100>; -+ interrupts = ; -+ clocks = <&bus_gates 29>, <&bus_gates 25>, -+ <&usb_clk 17>; -+ resets = <&ahb_rst 29>, <&ahb_rst 25>; -+ phys = <&usbphy 1>; -+ phy-names = "usb"; -+ status = "disabled"; -+ }; -+ -+ ehci2: usb@01c1c000 { -+ compatible = "allwinner,sun8i-h3-ehci", "generic-ehci"; -+ reg = <0x01c1c000 0x100>; -+ interrupts = ; -+ clocks = <&bus_gates 26>, <&bus_gates 30>; -+ resets = <&ahb_rst 26>, <&ahb_rst 30>; -+ phys = <&usbphy 2>; -+ phy-names = "usb"; -+ status = "disabled"; -+ }; -+ -+ ohci2: usb@01c1c400 { -+ compatible = "allwinner,sun8i-h3-ohci", "generic-ohci"; -+ reg = <0x01c1c400 0x100>; -+ interrupts = ; -+ clocks = <&bus_gates 30>, <&bus_gates 26>, -+ <&usb_clk 18>; -+ resets = <&ahb_rst 30>, <&ahb_rst 26>; -+ phys = <&usbphy 2>; -+ phy-names = "usb"; -+ status = "disabled"; -+ }; -+ -+ ehci3: usb@01c1d000 { -+ compatible = "allwinner,sun8i-h3-ehci", "generic-ehci"; -+ reg = <0x01c1d000 0x100>; -+ interrupts = ; -+ clocks = <&bus_gates 27>, <&bus_gates 31>; -+ resets = <&ahb_rst 27>, <&ahb_rst 31>; -+ phys = <&usbphy 3>; -+ phy-names = "usb"; -+ status = "disabled"; -+ }; -+ -+ ohci3: usb@01c1d400 { -+ compatible = "allwinner,sun8i-h3-ohci", "generic-ohci"; -+ reg = <0x01c1d400 0x100>; -+ interrupts = ; -+ clocks = <&bus_gates 31>, <&bus_gates 27>, -+ <&usb_clk 19>; -+ resets = <&ahb_rst 31>, <&ahb_rst 27>; -+ phys = <&usbphy 3>; -+ phy-names = "usb"; -+ status = "disabled"; -+ }; -+ - pio: pinctrl@01c20800 { - compatible = "allwinner,sun8i-h3-pinctrl"; - reg = <0x01c20800 0x400>; diff --git a/target/linux/sunxi/patches-4.4/134-dt-sun8i-orangepiplus-enable-usbhost.patch b/target/linux/sunxi/patches-4.4/134-dt-sun8i-orangepiplus-enable-usbhost.patch deleted file mode 100644 index 733639225c..0000000000 --- a/target/linux/sunxi/patches-4.4/134-dt-sun8i-orangepiplus-enable-usbhost.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 37e04fd781d3fc6d08116d38d34ec8124d916441 Mon Sep 17 00:00:00 2001 -From: Jens Kuske -Date: Tue, 17 Nov 2015 17:12:07 +0100 -Subject: [PATCH] ARM: dts: sun8i-h3-orangepi-plus: Enable USB host controllers - -Enable the 2 USB host controllers used on the Orange Pi Plus -and add the necessary regulators. - -Signed-off-by: Reinder de Haan -Signed-off-by: Hans de Goede -Signed-off-by: Jens Kuske ---- - arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts | 44 ++++++++++++++++++++++++++++ - 1 file changed, 44 insertions(+) - ---- a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts -+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts -@@ -58,6 +58,35 @@ - chosen { - stdout-path = "serial0:115200n8"; - }; -+ -+ reg_usb3_vbus: usb3-vbus { -+ compatible = "regulator-fixed"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb3_vbus_pin_a>; -+ regulator-name = "usb3-vbus"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ regulator-boot-on; -+ enable-active-high; -+ gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>; -+ }; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&ehci3 { -+ status = "okay"; -+}; -+ -+&pio { -+ usb3_vbus_pin_a: usb3_vbus_pin@0 { -+ allwinner,pins = "PG11"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - - &mmc0 { -@@ -70,8 +99,23 @@ - status = "okay"; - }; - -+®_usb1_vbus { -+ gpio = <&pio 6 13 GPIO_ACTIVE_HIGH>; -+ status = "okay"; -+}; -+ - &uart0 { - pinctrl-names = "default"; - pinctrl-0 = <&uart0_pins_a>; - status = "okay"; - }; -+ -+&usb1_vbus_pin_a { -+ allwinner,pins = "PG13"; -+}; -+ -+&usbphy { -+ usb1_vbus-supply = <®_usb1_vbus>; -+ usb3_vbus-supply = <®_usb3_vbus>; -+ status = "okay"; -+}; diff --git a/target/linux/sunxi/patches-4.4/135-clk-sunxi-fix-signedness-bug.patch b/target/linux/sunxi/patches-4.4/135-clk-sunxi-fix-signedness-bug.patch deleted file mode 100644 index a4b2af9e5a..0000000000 --- a/target/linux/sunxi/patches-4.4/135-clk-sunxi-fix-signedness-bug.patch +++ /dev/null @@ -1,25 +0,0 @@ -From b1558f168f4ef5956913d73fe330c4da85c74349 Mon Sep 17 00:00:00 2001 -From: Dan Carpenter -Date: Sat, 12 Dec 2015 15:43:46 +0300 -Subject: [PATCH] clk: sunxi: signedness bug in sun8i_h3_bus_gates_init() - -"index" needs to be signed for the error handling to work. - -Fixes: ab6e23a4e388 ('clk: sunxi: Add H3 clocks support') -Signed-off-by: Dan Carpenter -Signed-off-by: Maxime Ripard ---- - drivers/clk/sunxi/clk-sun8i-bus-gates.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/clk/sunxi/clk-sun8i-bus-gates.c -+++ b/drivers/clk/sunxi/clk-sun8i-bus-gates.c -@@ -40,7 +40,7 @@ static void __init sun8i_h3_bus_gates_in - const __be32 *p; - int number, i; - u8 clk_bit; -- u32 index; -+ int index; - - reg = of_io_request_and_map(node, 0, of_node_full_name(node)); - if (IS_ERR(reg)) diff --git a/target/linux/sunxi/patches-4.4/140-reset-add-of_reset_control_get_by_index.patch b/target/linux/sunxi/patches-4.4/140-reset-add-of_reset_control_get_by_index.patch deleted file mode 100644 index c7e0e2bf64..0000000000 --- a/target/linux/sunxi/patches-4.4/140-reset-add-of_reset_control_get_by_index.patch +++ /dev/null @@ -1,109 +0,0 @@ -From b4faa163a7ebae9faab5d0aefe70143e3379178b Mon Sep 17 00:00:00 2001 -From: Vince Hsu -Date: Mon, 13 Jul 2015 13:39:39 +0100 -Subject: [PATCH] reset: add of_reset_control_get_by_index() - -Add of_reset_control_get_by_index() to allow the drivers to get reset -device without knowing its name. - -Signed-off-by: Vince Hsu -[jonathanh@nvidia.com: Updated stub function to return -ENOTSUPP instead - of -ENOSYS which should only be used for system calls.] -Signed-off-by: Jon Hunter -Signed-off-by: Philipp Zabel ---- - drivers/reset/core.c | 40 +++++++++++++++++++++++++++++----------- - include/linux/reset.h | 9 +++++++++ - 2 files changed, 38 insertions(+), 11 deletions(-) - ---- a/drivers/reset/core.c -+++ b/drivers/reset/core.c -@@ -141,27 +141,24 @@ int reset_control_status(struct reset_co - EXPORT_SYMBOL_GPL(reset_control_status); - - /** -- * of_reset_control_get - Lookup and obtain a reference to a reset controller. -+ * of_reset_control_get_by_index - Lookup and obtain a reference to a reset -+ * controller by index. - * @node: device to be reset by the controller -- * @id: reset line name -- * -- * Returns a struct reset_control or IS_ERR() condition containing errno. -+ * @index: index of the reset controller - * -- * Use of id names is optional. -+ * This is to be used to perform a list of resets for a device or power domain -+ * in whatever order. Returns a struct reset_control or IS_ERR() condition -+ * containing errno. - */ --struct reset_control *of_reset_control_get(struct device_node *node, -- const char *id) -+struct reset_control *of_reset_control_get_by_index(struct device_node *node, -+ int index) - { - struct reset_control *rstc = ERR_PTR(-EPROBE_DEFER); - struct reset_controller_dev *r, *rcdev; - struct of_phandle_args args; -- int index = 0; - int rstc_id; - int ret; - -- if (id) -- index = of_property_match_string(node, -- "reset-names", id); - ret = of_parse_phandle_with_args(node, "resets", "#reset-cells", - index, &args); - if (ret) -@@ -202,6 +199,27 @@ struct reset_control *of_reset_control_g - - return rstc; - } -+EXPORT_SYMBOL_GPL(of_reset_control_get_by_index); -+ -+/** -+ * of_reset_control_get - Lookup and obtain a reference to a reset controller. -+ * @node: device to be reset by the controller -+ * @id: reset line name -+ * -+ * Returns a struct reset_control or IS_ERR() condition containing errno. -+ * -+ * Use of id names is optional. -+ */ -+struct reset_control *of_reset_control_get(struct device_node *node, -+ const char *id) -+{ -+ int index = 0; -+ -+ if (id) -+ index = of_property_match_string(node, -+ "reset-names", id); -+ return of_reset_control_get_by_index(node, index); -+} - EXPORT_SYMBOL_GPL(of_reset_control_get); - - /** ---- a/include/linux/reset.h -+++ b/include/linux/reset.h -@@ -38,6 +38,9 @@ static inline struct reset_control *devm - struct reset_control *of_reset_control_get(struct device_node *node, - const char *id); - -+struct reset_control *of_reset_control_get_by_index( -+ struct device_node *node, int index); -+ - #else - - static inline int reset_control_reset(struct reset_control *rstc) -@@ -106,6 +109,12 @@ static inline struct reset_control *of_r - return ERR_PTR(-ENOSYS); - } - -+static inline struct reset_control *of_reset_control_get_by_index( -+ struct device_node *node, int index) -+{ -+ return ERR_PTR(-ENOTSUPP); -+} -+ - #endif /* CONFIG_RESET_CONTROLLER */ - - #endif diff --git a/target/linux/sunxi/patches-4.4/141-reset-fix-of_reset_control_get.patch b/target/linux/sunxi/patches-4.4/141-reset-fix-of_reset_control_get.patch deleted file mode 100644 index eeab4972ba..0000000000 --- a/target/linux/sunxi/patches-4.4/141-reset-fix-of_reset_control_get.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 7fd7a26b60090a7df15f30ba10b0d39cbbd6a94e Mon Sep 17 00:00:00 2001 -From: Alban Bedel -Date: Tue, 1 Sep 2015 17:28:31 +0200 -Subject: [PATCH] reset: Fix of_reset_control_get() for consistent return - values - -When of_reset_control_get() is called without connection ID it returns --ENOENT when the 'resets' property doesn't exists or is an empty entry. -However when a connection ID is given it returns -EINVAL when the 'resets' -property doesn't exists or the requested name can't be found. This is -because the error code returned by of_property_match_string() is just -passed down as an index to of_parse_phandle_with_args(), which then -returns -EINVAL. - -To get a consistent return value with both code paths we must return --ENOENT when of_property_match_string() fails. - -Signed-off-by: Alban Bedel -Signed-off-by: Philipp Zabel ---- - drivers/reset/core.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - ---- a/drivers/reset/core.c -+++ b/drivers/reset/core.c -@@ -215,9 +215,12 @@ struct reset_control *of_reset_control_g - { - int index = 0; - -- if (id) -+ if (id) { - index = of_property_match_string(node, - "reset-names", id); -+ if (index < 0) -+ return ERR_PTR(-ENOENT); -+ } - return of_reset_control_get_by_index(node, index); - } - EXPORT_SYMBOL_GPL(of_reset_control_get); diff --git a/target/linux/sunxi/patches-4.4/142-reset-use-ENOTSUPP-instead-of-ENOSYS.patch b/target/linux/sunxi/patches-4.4/142-reset-use-ENOTSUPP-instead-of-ENOSYS.patch deleted file mode 100644 index 665b15b00a..0000000000 --- a/target/linux/sunxi/patches-4.4/142-reset-use-ENOTSUPP-instead-of-ENOSYS.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 5a819175b911ce33f3337e1e069d4bcea1ec4788 Mon Sep 17 00:00:00 2001 -From: Philipp Zabel -Date: Thu, 29 Oct 2015 09:55:00 +0100 -Subject: [PATCH] reset: use ENOTSUPP instead of ENOSYS - -ENOSYS is reserved to report invalid syscalls to userspace. -Consistently return ENOTSUPP to indicate that the driver doesn't support -the functionality or the reset framework is not enabled at all. - -Signed-off-by: Philipp Zabel ---- - drivers/reset/core.c | 8 ++++---- - include/linux/reset.h | 8 ++++---- - 2 files changed, 8 insertions(+), 8 deletions(-) - ---- a/drivers/reset/core.c -+++ b/drivers/reset/core.c -@@ -95,7 +95,7 @@ int reset_control_reset(struct reset_con - if (rstc->rcdev->ops->reset) - return rstc->rcdev->ops->reset(rstc->rcdev, rstc->id); - -- return -ENOSYS; -+ return -ENOTSUPP; - } - EXPORT_SYMBOL_GPL(reset_control_reset); - -@@ -108,7 +108,7 @@ int reset_control_assert(struct reset_co - if (rstc->rcdev->ops->assert) - return rstc->rcdev->ops->assert(rstc->rcdev, rstc->id); - -- return -ENOSYS; -+ return -ENOTSUPP; - } - EXPORT_SYMBOL_GPL(reset_control_assert); - -@@ -121,7 +121,7 @@ int reset_control_deassert(struct reset_ - if (rstc->rcdev->ops->deassert) - return rstc->rcdev->ops->deassert(rstc->rcdev, rstc->id); - -- return -ENOSYS; -+ return -ENOTSUPP; - } - EXPORT_SYMBOL_GPL(reset_control_deassert); - -@@ -136,7 +136,7 @@ int reset_control_status(struct reset_co - if (rstc->rcdev->ops->status) - return rstc->rcdev->ops->status(rstc->rcdev, rstc->id); - -- return -ENOSYS; -+ return -ENOTSUPP; - } - EXPORT_SYMBOL_GPL(reset_control_status); - ---- a/include/linux/reset.h -+++ b/include/linux/reset.h -@@ -74,7 +74,7 @@ static inline void reset_control_put(str - - static inline int device_reset_optional(struct device *dev) - { -- return -ENOSYS; -+ return -ENOTSUPP; - } - - static inline struct reset_control *__must_check reset_control_get( -@@ -94,19 +94,19 @@ static inline struct reset_control *__mu - static inline struct reset_control *reset_control_get_optional( - struct device *dev, const char *id) - { -- return ERR_PTR(-ENOSYS); -+ return ERR_PTR(-ENOTSUPP); - } - - static inline struct reset_control *devm_reset_control_get_optional( - struct device *dev, const char *id) - { -- return ERR_PTR(-ENOSYS); -+ return ERR_PTR(-ENOTSUPP); - } - - static inline struct reset_control *of_reset_control_get( - struct device_node *node, const char *id) - { -- return ERR_PTR(-ENOSYS); -+ return ERR_PTR(-ENOTSUPP); - } - - static inline struct reset_control *of_reset_control_get_by_index( diff --git a/target/linux/sunxi/patches-4.4/143-reset-add-shared-resetcontrol-asserts.patch b/target/linux/sunxi/patches-4.4/143-reset-add-shared-resetcontrol-asserts.patch deleted file mode 100644 index e1078e9696..0000000000 --- a/target/linux/sunxi/patches-4.4/143-reset-add-shared-resetcontrol-asserts.patch +++ /dev/null @@ -1,265 +0,0 @@ -From d25cfe9b4f9663216ce4e011e3f1e7fa669ab58a Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Fri, 27 Nov 2015 21:09:05 +0100 -Subject: [PATCH] reset: Add shared reset_control_[de]assert variants - -Add reset_control_deassert_shared / reset_control_assert_shared -functions which are intended for use by drivers for hw blocks which -(may) share a reset line with another driver / hw block. - -Unlike the regular reset_control_[de]assert functions these functions -keep track of how often deassert_shared / assert_shared have been called -and keep the line deasserted as long as deassert has been called more -times than assert. - -Signed-off-by: Hans de Goede ---- -Changes in v2: --This is a new patch in v2 of this patch-set ---- - drivers/reset/core.c | 121 ++++++++++++++++++++++++++++++++++++--- - include/linux/reset-controller.h | 2 + - include/linux/reset.h | 2 + - 3 files changed, 116 insertions(+), 9 deletions(-) - ---- a/drivers/reset/core.c -+++ b/drivers/reset/core.c -@@ -22,16 +22,29 @@ static DEFINE_MUTEX(reset_controller_lis - static LIST_HEAD(reset_controller_list); - - /** -+ * struct reset_line - a reset line -+ * @list: list entry for the reset controllers reset line list -+ * @id: ID of the reset line in the reset controller device -+ * @refcnt: Number of reset_control structs referencing this device -+ * @deassert_cnt: Number of times this reset line has been deasserted -+ */ -+struct reset_line { -+ struct list_head list; -+ unsigned int id; -+ unsigned int refcnt; -+ unsigned int deassert_cnt; -+}; -+ -+/** - * struct reset_control - a reset control - * @rcdev: a pointer to the reset controller device - * this reset control belongs to -- * @id: ID of the reset controller in the reset -- * controller device -+ * @line: reset line for this reset control - */ - struct reset_control { - struct reset_controller_dev *rcdev; -+ struct reset_line *line; - struct device *dev; -- unsigned int id; - }; - - /** -@@ -66,6 +79,8 @@ int reset_controller_register(struct res - rcdev->of_xlate = of_reset_simple_xlate; - } - -+ INIT_LIST_HEAD(&rcdev->reset_line_head); -+ - mutex_lock(&reset_controller_list_mutex); - list_add(&rcdev->list, &reset_controller_list); - mutex_unlock(&reset_controller_list_mutex); -@@ -93,7 +108,7 @@ EXPORT_SYMBOL_GPL(reset_controller_unreg - int reset_control_reset(struct reset_control *rstc) - { - if (rstc->rcdev->ops->reset) -- return rstc->rcdev->ops->reset(rstc->rcdev, rstc->id); -+ return rstc->rcdev->ops->reset(rstc->rcdev, rstc->line->id); - - return -ENOTSUPP; - } -@@ -106,7 +121,7 @@ EXPORT_SYMBOL_GPL(reset_control_reset); - int reset_control_assert(struct reset_control *rstc) - { - if (rstc->rcdev->ops->assert) -- return rstc->rcdev->ops->assert(rstc->rcdev, rstc->id); -+ return rstc->rcdev->ops->assert(rstc->rcdev, rstc->line->id); - - return -ENOTSUPP; - } -@@ -119,13 +134,55 @@ EXPORT_SYMBOL_GPL(reset_control_assert); - int reset_control_deassert(struct reset_control *rstc) - { - if (rstc->rcdev->ops->deassert) -- return rstc->rcdev->ops->deassert(rstc->rcdev, rstc->id); -+ return rstc->rcdev->ops->deassert(rstc->rcdev, rstc->line->id); - - return -ENOTSUPP; - } - EXPORT_SYMBOL_GPL(reset_control_deassert); - - /** -+ * reset_control_assert_shared - asserts a shared reset line -+ * @rstc: reset controller -+ * -+ * Assert a shared reset line, this functions decreases the deassert count -+ * of the line by one and asserts it if, and only if, the deassert count -+ * reaches 0. -+ */ -+int reset_control_assert_shared(struct reset_control *rstc) -+{ -+ if (!rstc->rcdev->ops->assert) -+ return -ENOTSUPP; -+ -+ rstc->line->deassert_cnt--; -+ if (rstc->line->deassert_cnt) -+ return 0; -+ -+ return rstc->rcdev->ops->assert(rstc->rcdev, rstc->line->id); -+} -+EXPORT_SYMBOL_GPL(reset_control_assert_shared); -+ -+/** -+ * reset_control_deassert_shared - deasserts a shared reset line -+ * @rstc: reset controller -+ * -+ * Assert a shared reset line, this functions increases the deassert count -+ * of the line by one and deasserts the reset line (if it was not already -+ * deasserted). -+ */ -+int reset_control_deassert_shared(struct reset_control *rstc) -+{ -+ if (!rstc->rcdev->ops->deassert) -+ return -ENOTSUPP; -+ -+ rstc->line->deassert_cnt++; -+ if (rstc->line->deassert_cnt != 1) -+ return 0; -+ -+ return rstc->rcdev->ops->deassert(rstc->rcdev, rstc->line->id); -+} -+EXPORT_SYMBOL_GPL(reset_control_deassert_shared); -+ -+/** - * reset_control_status - returns a negative errno if not supported, a - * positive value if the reset line is asserted, or zero if the reset - * line is not asserted. -@@ -134,12 +191,47 @@ EXPORT_SYMBOL_GPL(reset_control_deassert - int reset_control_status(struct reset_control *rstc) - { - if (rstc->rcdev->ops->status) -- return rstc->rcdev->ops->status(rstc->rcdev, rstc->id); -+ return rstc->rcdev->ops->status(rstc->rcdev, rstc->line->id); - - return -ENOTSUPP; - } - EXPORT_SYMBOL_GPL(reset_control_status); - -+static struct reset_line *reset_line_get(struct reset_controller_dev *rcdev, -+ unsigned int index) -+{ -+ struct reset_line *line; -+ -+ list_for_each_entry(line, &rcdev->reset_line_head, list) { -+ if (line->id == index) { -+ line->refcnt++; -+ return line; -+ } -+ } -+ -+ line = kzalloc(sizeof(*line), GFP_KERNEL); -+ if (!line) -+ return NULL; -+ -+ list_add(&line->list, &rcdev->reset_line_head); -+ line->id = index; -+ line->refcnt = 1; -+ -+ return line; -+} -+ -+static void reset_line_put(struct reset_line *line) -+{ -+ if (!line) -+ return; -+ -+ if (--line->refcnt) -+ return; -+ -+ list_del(&line->list); -+ kfree(line); -+} -+ - /** - * of_reset_control_get_by_index - Lookup and obtain a reference to a reset - * controller by index. -@@ -155,6 +247,7 @@ struct reset_control *of_reset_control_g - { - struct reset_control *rstc = ERR_PTR(-EPROBE_DEFER); - struct reset_controller_dev *r, *rcdev; -+ struct reset_line *line; - struct of_phandle_args args; - int rstc_id; - int ret; -@@ -186,16 +279,22 @@ struct reset_control *of_reset_control_g - } - - try_module_get(rcdev->owner); -+ -+ /* reset_controller_list_mutex also protects the reset_line list */ -+ line = reset_line_get(rcdev, rstc_id); -+ - mutex_unlock(&reset_controller_list_mutex); - - rstc = kzalloc(sizeof(*rstc), GFP_KERNEL); -- if (!rstc) { -+ if (!line || !rstc) { -+ kfree(rstc); -+ reset_line_put(line); - module_put(rcdev->owner); - return ERR_PTR(-ENOMEM); - } - - rstc->rcdev = rcdev; -- rstc->id = rstc_id; -+ rstc->line = line; - - return rstc; - } -@@ -259,6 +358,10 @@ void reset_control_put(struct reset_cont - if (IS_ERR(rstc)) - return; - -+ mutex_lock(&reset_controller_list_mutex); -+ reset_line_put(rstc->line); -+ mutex_unlock(&reset_controller_list_mutex); -+ - module_put(rstc->rcdev->owner); - kfree(rstc); - } ---- a/include/linux/reset-controller.h -+++ b/include/linux/reset-controller.h -@@ -31,6 +31,7 @@ struct of_phandle_args; - * @ops: a pointer to device specific struct reset_control_ops - * @owner: kernel module of the reset controller driver - * @list: internal list of reset controller devices -+ * @reset_line_head: head of internal list of reset lines - * @of_node: corresponding device tree node as phandle target - * @of_reset_n_cells: number of cells in reset line specifiers - * @of_xlate: translation function to translate from specifier as found in the -@@ -41,6 +42,7 @@ struct reset_controller_dev { - struct reset_control_ops *ops; - struct module *owner; - struct list_head list; -+ struct list_head reset_line_head; - struct device_node *of_node; - int of_reset_n_cells; - int (*of_xlate)(struct reset_controller_dev *rcdev, ---- a/include/linux/reset.h -+++ b/include/linux/reset.h -@@ -11,6 +11,8 @@ int reset_control_reset(struct reset_con - int reset_control_assert(struct reset_control *rstc); - int reset_control_deassert(struct reset_control *rstc); - int reset_control_status(struct reset_control *rstc); -+int reset_control_assert_shared(struct reset_control *rstc); -+int reset_control_deassert_shared(struct reset_control *rstc); - - struct reset_control *reset_control_get(struct device *dev, const char *id); - void reset_control_put(struct reset_control *rstc); diff --git a/target/linux/sunxi/patches-4.4/144-usb-ehci-plat-support-multiple-reset-ctrllines.patch b/target/linux/sunxi/patches-4.4/144-usb-ehci-plat-support-multiple-reset-ctrllines.patch deleted file mode 100644 index 73cd3027bf..0000000000 --- a/target/linux/sunxi/patches-4.4/144-usb-ehci-plat-support-multiple-reset-ctrllines.patch +++ /dev/null @@ -1,127 +0,0 @@ -From 957e8f96c67052ca843ea9ffc5223662b973e5de Mon Sep 17 00:00:00 2001 -From: Reinder de Haan -Date: Sun, 15 Nov 2015 14:24:46 +0100 -Subject: [PATCH] ehci-platform: Add support for controllers with multiple - reset lines - -At least the EHCI/OHCI found on the Allwinnner H3 SoC needs multiple -reset lines, the controller will not initialize while the reset for -its companion is still asserted, which means we need to de-assert -2 resets for the controller to work. - -Signed-off-by: Reinder de Haan -Signed-off-by: Hans de Goede ---- -Changes in v2: --Use the new reset_control_[de]assert_shared reset-controller functions ---- - Documentation/devicetree/bindings/usb/usb-ehci.txt | 2 +- - drivers/usb/host/ehci-platform.c | 47 +++++++++++++--------- - 2 files changed, 30 insertions(+), 19 deletions(-) - ---- a/Documentation/devicetree/bindings/usb/usb-ehci.txt -+++ b/Documentation/devicetree/bindings/usb/usb-ehci.txt -@@ -18,7 +18,7 @@ Optional properties: - - clocks : a list of phandle + clock specifier pairs - - phys : phandle + phy specifier pair - - phy-names : "usb" -- - resets : phandle + reset specifier pair -+ - resets : a list of phandle + reset specifier pairs - - Example (Sequoia 440EPx): - ehci@e0000300 { ---- a/drivers/usb/host/ehci-platform.c -+++ b/drivers/usb/host/ehci-platform.c -@@ -39,11 +39,12 @@ - - #define DRIVER_DESC "EHCI generic platform driver" - #define EHCI_MAX_CLKS 3 -+#define EHCI_MAX_RESETS 2 - #define hcd_to_ehci_priv(h) ((struct ehci_platform_priv *)hcd_to_ehci(h)->priv) - - struct ehci_platform_priv { - struct clk *clks[EHCI_MAX_CLKS]; -- struct reset_control *rst; -+ struct reset_control *resets[EHCI_MAX_RESETS]; - struct phy **phys; - int num_phys; - bool reset_on_resume; -@@ -149,7 +150,7 @@ static int ehci_platform_probe(struct pl - struct usb_ehci_pdata *pdata = dev_get_platdata(&dev->dev); - struct ehci_platform_priv *priv; - struct ehci_hcd *ehci; -- int err, irq, phy_num, clk = 0; -+ int err, irq, phy_num, clk = 0, rst = 0; - - if (usb_disabled()) - return -ENODEV; -@@ -232,18 +233,24 @@ static int ehci_platform_probe(struct pl - break; - } - } -- } - -- priv->rst = devm_reset_control_get_optional(&dev->dev, NULL); -- if (IS_ERR(priv->rst)) { -- err = PTR_ERR(priv->rst); -- if (err == -EPROBE_DEFER) -- goto err_put_clks; -- priv->rst = NULL; -- } else { -- err = reset_control_deassert(priv->rst); -- if (err) -- goto err_put_clks; -+ for (rst = 0; rst < EHCI_MAX_RESETS; rst++) { -+ priv->resets[rst] = -+ of_reset_control_get_by_index(dev->dev.of_node, -+ rst); -+ if (IS_ERR(priv->resets[rst])) { -+ err = PTR_ERR(priv->resets[rst]); -+ if (err == -EPROBE_DEFER) -+ goto err_reset; -+ priv->resets[rst] = NULL; -+ break; -+ } -+ err = reset_control_deassert_shared(priv->resets[rst]); -+ if (err) { -+ reset_control_put(priv->resets[rst]); -+ goto err_reset; -+ } -+ } - } - - if (pdata->big_endian_desc) -@@ -302,8 +309,10 @@ err_power: - if (pdata->power_off) - pdata->power_off(dev); - err_reset: -- if (priv->rst) -- reset_control_assert(priv->rst); -+ while (--rst >= 0) { -+ reset_control_assert_shared(priv->resets[rst]); -+ reset_control_put(priv->resets[rst]); -+ } - err_put_clks: - while (--clk >= 0) - clk_put(priv->clks[clk]); -@@ -321,15 +330,17 @@ static int ehci_platform_remove(struct p - struct usb_hcd *hcd = platform_get_drvdata(dev); - struct usb_ehci_pdata *pdata = dev_get_platdata(&dev->dev); - struct ehci_platform_priv *priv = hcd_to_ehci_priv(hcd); -- int clk; -+ int clk, rst; - - usb_remove_hcd(hcd); - - if (pdata->power_off) - pdata->power_off(dev); - -- if (priv->rst) -- reset_control_assert(priv->rst); -+ for (rst = 0; rst < EHCI_MAX_RESETS && priv->resets[rst]; rst++) { -+ reset_control_assert_shared(priv->resets[rst]); -+ reset_control_put(priv->resets[rst]); -+ } - - for (clk = 0; clk < EHCI_MAX_CLKS && priv->clks[clk]; clk++) - clk_put(priv->clks[clk]); diff --git a/target/linux/sunxi/patches-4.4/145-usb-ohci-plat-support-multiple-reset-ctrllines.patch b/target/linux/sunxi/patches-4.4/145-usb-ohci-plat-support-multiple-reset-ctrllines.patch deleted file mode 100644 index a25d487aad..0000000000 --- a/target/linux/sunxi/patches-4.4/145-usb-ohci-plat-support-multiple-reset-ctrllines.patch +++ /dev/null @@ -1,128 +0,0 @@ -From 5f0c864c1f207dba1db587747a58ec6b362dadf8 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Sun, 29 Nov 2015 18:44:14 +0100 -Subject: [PATCH] ohci-platform: Add support for controllers with multiple - reset lines - -At least the EHCI/OHCI found on the Allwinnner H3 SoC needs multiple -reset lines, the controller will not initialize while the reset for -its companion is still asserted, which means we need to de-assert -2 resets for the controller to work. - -Signed-off-by: Hans de Goede ---- -Changes in v2: --New patch in v2 of this patch-set, to complement the identical patch for - the ehci-platform code ---- - Documentation/devicetree/bindings/usb/usb-ohci.txt | 2 +- - drivers/usb/host/ohci-platform.c | 49 +++++++++++++--------- - 2 files changed, 30 insertions(+), 21 deletions(-) - ---- a/Documentation/devicetree/bindings/usb/usb-ohci.txt -+++ b/Documentation/devicetree/bindings/usb/usb-ohci.txt -@@ -14,7 +14,7 @@ Optional properties: - - clocks : a list of phandle + clock specifier pairs - - phys : phandle + phy specifier pair - - phy-names : "usb" --- resets : phandle + reset specifier pair -+- resets : a list of phandle + reset specifier pairs - - Example: - ---- a/drivers/usb/host/ohci-platform.c -+++ b/drivers/usb/host/ohci-platform.c -@@ -33,11 +33,12 @@ - - #define DRIVER_DESC "OHCI generic platform driver" - #define OHCI_MAX_CLKS 3 -+#define OHCI_MAX_RESETS 2 - #define hcd_to_ohci_priv(h) ((struct ohci_platform_priv *)hcd_to_ohci(h)->priv) - - struct ohci_platform_priv { - struct clk *clks[OHCI_MAX_CLKS]; -- struct reset_control *rst; -+ struct reset_control *resets[OHCI_MAX_RESETS]; - struct phy **phys; - int num_phys; - }; -@@ -117,7 +118,7 @@ static int ohci_platform_probe(struct pl - struct usb_ohci_pdata *pdata = dev_get_platdata(&dev->dev); - struct ohci_platform_priv *priv; - struct ohci_hcd *ohci; -- int err, irq, phy_num, clk = 0; -+ int err, irq, phy_num, clk = 0, rst = 0; - - if (usb_disabled()) - return -ENODEV; -@@ -195,19 +196,23 @@ static int ohci_platform_probe(struct pl - break; - } - } -- -- } -- -- priv->rst = devm_reset_control_get_optional(&dev->dev, NULL); -- if (IS_ERR(priv->rst)) { -- err = PTR_ERR(priv->rst); -- if (err == -EPROBE_DEFER) -- goto err_put_clks; -- priv->rst = NULL; -- } else { -- err = reset_control_deassert(priv->rst); -- if (err) -- goto err_put_clks; -+ for (rst = 0; rst < OHCI_MAX_RESETS; rst++) { -+ priv->resets[rst] = -+ of_reset_control_get_by_index(dev->dev.of_node, -+ rst); -+ if (IS_ERR(priv->resets[rst])) { -+ err = PTR_ERR(priv->resets[rst]); -+ if (err == -EPROBE_DEFER) -+ goto err_reset; -+ priv->resets[rst] = NULL; -+ break; -+ } -+ err = reset_control_deassert_shared(priv->resets[rst]); -+ if (err) { -+ reset_control_put(priv->resets[rst]); -+ goto err_reset; -+ } -+ } - } - - if (pdata->big_endian_desc) -@@ -265,8 +270,10 @@ err_power: - if (pdata->power_off) - pdata->power_off(dev); - err_reset: -- if (priv->rst) -- reset_control_assert(priv->rst); -+ while (--rst >= 0) { -+ reset_control_assert_shared(priv->resets[rst]); -+ reset_control_put(priv->resets[rst]); -+ } - err_put_clks: - while (--clk >= 0) - clk_put(priv->clks[clk]); -@@ -284,15 +291,17 @@ static int ohci_platform_remove(struct p - struct usb_hcd *hcd = platform_get_drvdata(dev); - struct usb_ohci_pdata *pdata = dev_get_platdata(&dev->dev); - struct ohci_platform_priv *priv = hcd_to_ohci_priv(hcd); -- int clk; -+ int clk, rst; - - usb_remove_hcd(hcd); - - if (pdata->power_off) - pdata->power_off(dev); - -- if (priv->rst) -- reset_control_assert(priv->rst); -+ for (rst = 0; rst < OHCI_MAX_RESETS && priv->resets[rst]; rst++) { -+ reset_control_assert_shared(priv->resets[rst]); -+ reset_control_put(priv->resets[rst]); -+ } - - for (clk = 0; clk < OHCI_MAX_CLKS && priv->clks[clk]; clk++) - clk_put(priv->clks[clk]); diff --git a/target/linux/sunxi/patches-4.4/150-dt-sun7i-enable-codec-on-pcduino3.patch b/target/linux/sunxi/patches-4.4/150-dt-sun7i-enable-codec-on-pcduino3.patch deleted file mode 100644 index c967ca91a7..0000000000 --- a/target/linux/sunxi/patches-4.4/150-dt-sun7i-enable-codec-on-pcduino3.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 5296d8ff65298091758aa8d50d00539cd3781042 Mon Sep 17 00:00:00 2001 -From: Jelle van der Waa -Date: Sun, 9 Aug 2015 18:51:22 +0200 -Subject: [PATCH] ARM: dts: sun7i: Enable audio codec on pcDuino - -Enable the on-chip audio codec - -Signed-off-by: Jelle van der Waa -Signed-off-by: Hans de Goede ---- - arch/arm/boot/dts/sun7i-a20-pcduino3.dts | 5 +++++ - 1 file changed, 5 insertions(+) - ---- a/arch/arm/boot/dts/sun7i-a20-pcduino3.dts -+++ b/arch/arm/boot/dts/sun7i-a20-pcduino3.dts -@@ -111,6 +111,11 @@ - allwinner,pins = "PH2"; - }; - -+ -+&codec { -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; diff --git a/target/linux/sunxi/patches-4.4/200-dt-sun7i-add-lamobo-r1.patch b/target/linux/sunxi/patches-4.4/200-dt-sun7i-add-lamobo-r1.patch deleted file mode 100644 index b1e00b45ab..0000000000 --- a/target/linux/sunxi/patches-4.4/200-dt-sun7i-add-lamobo-r1.patch +++ /dev/null @@ -1,330 +0,0 @@ -From 46662c86b453d7098ff22d6112d0481f07d523a1 Mon Sep 17 00:00:00 2001 -From: Jelle de Jong -Date: Sun, 18 Oct 2015 16:34:39 +0200 -Subject: [PATCH] ARM: dts: sun7i: Add dts file for the lamobo-r1 board - -The lamobo-r1 board, sometimes called the BPI-R1 but not labelled as such -on the PCB, is meant as a A20 based router board. As such the board comes -with a built-in switch chip giving it 5 gigabit ethernet boards, and it -has a large empty area on the pcb with mounting holes which will fit a -2.5 inch harddisk. To complete its networking features it has a -Realtek RTL8192CU for WiFi 802.11 b/g/n. - -Signed-off-by: Jelle de Jong -Signed-off-by: Hans de Goede ---- - arch/arm/boot/dts/Makefile | 1 + - arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts | 297 ++++++++++++++++++++++++++++++ - 2 files changed, 298 insertions(+) - create mode 100644 arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts - ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -638,6 +638,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \ - sun7i-a20-cubietruck.dtb \ - sun7i-a20-hummingbird.dtb \ - sun7i-a20-i12-tvbox.dtb \ -+ sun7i-a20-lamobo-r1.dtb \ - sun7i-a20-m3.dtb \ - sun7i-a20-mk808c.dtb \ - sun7i-a20-olimex-som-evb.dtb \ ---- /dev/null -+++ b/arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts -@@ -0,0 +1,297 @@ -+/* -+ * Copyright 2015 Jelle de Jong -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file 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. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun7i-a20.dtsi" -+#include "sunxi-common-regulators.dtsi" -+ -+#include -+#include -+#include -+ -+/ { -+ model = "Lamobo R1"; -+ compatible = "lamobo,lamobo-r1", "allwinner,sun7i-a20"; -+ -+ aliases { -+ serial0 = &uart0; -+ serial1 = &uart3; -+ serial2 = &uart7; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&led_pins_lamobo_r1>; -+ -+ green { -+ label = "lamobo_r1:green:usr"; -+ gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+ -+ reg_gmac_3v3: gmac-3v3 { -+ compatible = "regulator-fixed"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&gmac_power_pin_lamobo_r1>; -+ regulator-name = "gmac-3v3"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ startup-delay-us = <100000>; -+ enable-active-high; -+ gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */ -+ }; -+}; -+ -+&ahci_pwr_pin_a { -+ allwinner,pins = "PB3"; -+}; -+ -+&ahci { -+ target-supply = <®_ahci_5v>; -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+ operating-points = < -+ /* kHz uV */ -+ 960000 1400000 -+ 912000 1400000 -+ 864000 1350000 -+ 720000 1250000 -+ 528000 1150000 -+ 312000 1100000 -+ 144000 1050000 -+ >; -+}; -+ -+&ehci0 { -+ status = "okay"; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&gmac { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&gmac_pins_rgmii_a>; -+ phy = <&phy1>; -+ phy-mode = "rgmii"; -+ phy-supply = <®_gmac_3v3>; -+ status = "okay"; -+ -+ phy1: ethernet-phy@1 { -+ reg = <1>; -+ }; -+}; -+ -+&i2c0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c0_pins_a>; -+ status = "okay"; -+ -+ axp209: pmic@34 { -+ reg = <0x34>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+&i2c2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c2_pins_a>; -+ status = "okay"; -+}; -+ -+&ir0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&ir0_rx_pins_a>; -+ status = "okay"; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_lamobo_r1>; -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&ohci0 { -+ status = "okay"; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+&otg_sram { -+ status = "okay"; -+}; -+ -+&pio { -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ mmc0_cd_pin_lamobo_r1: mmc0_cd_pin@0 { -+ allwinner,pins = "PH10"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ gmac_power_pin_lamobo_r1: gmac_power_pin@0 { -+ allwinner,pins = "PH23"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ led_pins_lamobo_r1: led_pins@0 { -+ allwinner,pins = "PH24"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+#include "axp209.dtsi" -+ -+®_ahci_5v { -+ gpio = <&pio 1 3 0>; /* PB3 */ -+ status = "okay"; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ -+®_usb0_vbus { -+ status = "okay"; -+}; -+ -+®_usb1_vbus { -+ status = "okay"; -+}; -+ -+®_usb2_vbus { -+ status = "okay"; -+}; -+ -+&spi0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&spi0_pins_a>, -+ <&spi0_cs0_pins_a>, -+ <&spi0_cs1_pins_a>; -+ status = "okay"; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ -+&uart3 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart3_pins_b>; -+ status = "okay"; -+}; -+ -+&uart7 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart7_pins_a>; -+ status = "okay"; -+}; -+ -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ -+&usb_power_supply { -+ status = "okay"; -+}; -+ -+&usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_power-supply = <&usb_power_supply>; -+ usb0_vbus-supply = <®_usb0_vbus>; -+ usb1_vbus-supply = <®_usb1_vbus>; -+ usb2_vbus-supply = <®_usb2_vbus>; -+ status = "okay"; -+}; diff --git a/target/linux/sunxi/patches-4.4/104-2-dt-sun8i-add-orangepi-plus.patch b/target/linux/sunxi/patches-4.9/0045-arm-dts-sun8i-add-common-dtsi-file-for-nanopi-SBCs.patch similarity index 59% rename from target/linux/sunxi/patches-4.4/104-2-dt-sun8i-add-orangepi-plus.patch rename to target/linux/sunxi/patches-4.9/0045-arm-dts-sun8i-add-common-dtsi-file-for-nanopi-SBCs.patch index 67094a4beb..c304f7937f 100644 --- a/target/linux/sunxi/patches-4.4/104-2-dt-sun8i-add-orangepi-plus.patch +++ b/target/linux/sunxi/patches-4.9/0045-arm-dts-sun8i-add-common-dtsi-file-for-nanopi-SBCs.patch @@ -1,39 +1,29 @@ -From dfcf8196de7411a5e7fd49795938b1bc8c56859c Mon Sep 17 00:00:00 2001 -From: Jens Kuske -Date: Fri, 4 Dec 2015 22:24:43 +0100 -Subject: [PATCH] ARM: dts: sun8i: Add Orange Pi Plus support +From 49f01c9e14b3476cbdf9623c4812c43f6485830b Mon Sep 17 00:00:00 2001 +From: Milo Kim +Date: Fri, 28 Oct 2016 15:59:01 +0900 +Subject: ARM: dts: sun8i: Add common dtsi file for NanoPi SBCs -The Orange Pi Plus is a SBC based on the Allwinner H3 SoC -with 8GB eMMC, multiple USB ports through a USB hub chip, SATA through -a USB-SATA bridge, one uSD slot, a 10/100/1000M ethernet port, -WiFi, HDMI, headphone jack, IR receiver, a microphone, a CSI connector -and a 40-pin GPIO header. +(backported from kernel 4.13) -Signed-off-by: Jens Kuske +This patch provides a common file for NanoPi M1 and Neo SBC. + +Those have common features below. + * UART0 + * 2 LEDs + * USB host (EHCI3, OHCI3) and PHY + * MicroSD + * GPIO key switch + +Cc: James Pettigrew +Signed-off-by: Milo Kim Signed-off-by: Maxime Ripard ---- - arch/arm/boot/dts/Makefile | 3 +- - arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts | 77 ++++++++++++++++++++++++++++ - 2 files changed, 79 insertions(+), 1 deletion(-) - create mode 100644 arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -660,7 +660,8 @@ dtb-$(CONFIG_MACH_SUN8I) += \ - sun8i-a33-ga10h-v1.1.dtb \ - sun8i-a33-ippo-q8h-v1.2.dtb \ - sun8i-a33-q8-tablet.dtb \ -- sun8i-a33-sinlinx-sina33.dtb -+ sun8i-a33-sinlinx-sina33.dtb \ -+ sun8i-h3-orangepi-plus.dtb - dtb-$(CONFIG_MACH_SUN9I) += \ - sun9i-a80-optimus.dtb \ - sun9i-a80-cubieboard4.dtb --- /dev/null -+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts -@@ -0,0 +1,77 @@ ++++ b/arch/arm/boot/dts/sun8i-h3-nanopi.dtsi +@@ -0,0 +1,137 @@ +/* -+ * Copyright (C) 2015 Jens Kuske ++ * Copyright (C) 2016 James Pettigrew ++ * Copyright (C) 2016 Milo Kim + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual @@ -79,12 +69,9 @@ Signed-off-by: Maxime Ripard +#include "sunxi-common-regulators.dtsi" + +#include -+#include ++#include + +/ { -+ model = "Xunlong Orange Pi Plus"; -+ compatible = "xunlong,orangepi-plus", "allwinner,sun8i-h3"; -+ + aliases { + serial0 = &uart0; + }; @@ -92,16 +79,74 @@ Signed-off-by: Maxime Ripard + chosen { + stdout-path = "serial0:115200n8"; + }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&leds_npi>, <&leds_r_npi>; ++ ++ status { ++ label = "nanopi:blue:status"; ++ gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ ++ pwr { ++ label = "nanopi:green:pwr"; ++ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; ++ default-state = "on"; ++ }; ++ }; ++ ++ r_gpio_keys { ++ compatible = "gpio-keys"; ++ input-name = "k1"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sw_r_npi>; ++ ++ k1@0 { ++ label = "k1"; ++ linux,code = ; ++ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&ehci3 { ++ status = "okay"; +}; + +&mmc0 { ++ bus-width = <4>; ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; ++ cd-inverted; + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ -+ cd-inverted; + status = "okay"; ++ vmmc-supply = <®_vcc3v3>; ++}; ++ ++&ohci3 { ++ status = "okay"; ++}; ++ ++&pio { ++ leds_npi: led_pins@0 { ++ pins = "PA10"; ++ function = "gpio_out"; ++ }; ++}; ++ ++&r_pio { ++ leds_r_npi: led_pins@0 { ++ pins = "PL10"; ++ function = "gpio_out"; ++ }; ++ ++ sw_r_npi: key_pins@0 { ++ pins = "PL3"; ++ function = "gpio_in"; ++ }; +}; + +&uart0 { @@ -109,3 +154,7 @@ Signed-off-by: Maxime Ripard + pinctrl-0 = <&uart0_pins_a>; + status = "okay"; +}; ++ ++&usbphy { ++ status = "okay"; ++}; diff --git a/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch b/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch index b88c19e256..ca2eb3ac8f 100644 --- a/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch +++ b/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch @@ -2464,7 +2464,7 @@ return ret; } } -@@ -1798,33 +1793,36 @@ static int stmmac_open(struct net_device +@@ -1799,33 +1794,36 @@ static int stmmac_open(struct net_device ret = alloc_dma_desc_resources(priv); if (ret < 0) { @@ -2508,7 +2508,7 @@ goto init_error; } -@@ -1833,8 +1831,9 @@ static int stmmac_open(struct net_device +@@ -1834,8 +1832,9 @@ static int stmmac_open(struct net_device ret = request_irq(priv->wol_irq, stmmac_interrupt, IRQF_SHARED, dev->name, dev); if (unlikely(ret < 0)) { @@ -2520,7 +2520,7 @@ goto wolirq_error; } } -@@ -1844,8 +1843,9 @@ static int stmmac_open(struct net_device +@@ -1845,8 +1844,9 @@ static int stmmac_open(struct net_device ret = request_irq(priv->lpi_irq, stmmac_interrupt, IRQF_SHARED, dev->name, dev); if (unlikely(ret < 0)) { @@ -2532,7 +2532,7 @@ goto lpiirq_error; } } -@@ -1864,8 +1864,8 @@ wolirq_error: +@@ -1865,8 +1865,8 @@ wolirq_error: init_error: free_dma_desc_resources(priv); dma_desc_error: @@ -2543,7 +2543,7 @@ return ret; } -@@ -1884,10 +1884,9 @@ static int stmmac_release(struct net_dev +@@ -1885,10 +1885,9 @@ static int stmmac_release(struct net_dev del_timer_sync(&priv->eee_ctrl_timer); /* Stop and disconnect the PHY */ @@ -2557,7 +2557,7 @@ } netif_stop_queue(dev); -@@ -1947,13 +1946,13 @@ static void stmmac_tso_allocator(struct +@@ -1948,13 +1947,13 @@ static void stmmac_tso_allocator(struct priv->cur_tx = STMMAC_GET_ENTRY(priv->cur_tx, DMA_TX_SIZE); desc = priv->dma_tx + priv->cur_tx; @@ -2573,7 +2573,7 @@ 0, 0); tmp_len -= TSO_MAX_BUFF_SIZE; -@@ -1998,8 +1997,6 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -1999,8 +1998,6 @@ static netdev_tx_t stmmac_tso_xmit(struc u8 proto_hdr_len; int i; @@ -2582,7 +2582,7 @@ /* Compute header lengths */ proto_hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); -@@ -2009,9 +2006,10 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2010,9 +2007,10 @@ static netdev_tx_t stmmac_tso_xmit(struc if (!netif_queue_stopped(dev)) { netif_stop_queue(dev); /* This is a hard error, log it. */ @@ -2595,7 +2595,7 @@ return NETDEV_TX_BUSY; } -@@ -2049,11 +2047,11 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2050,11 +2048,11 @@ static netdev_tx_t stmmac_tso_xmit(struc priv->tx_skbuff_dma[first_entry].len = skb_headlen(skb); priv->tx_skbuff[first_entry] = skb; @@ -2609,7 +2609,7 @@ /* If needed take extra descriptors to fill the remaining payload */ tmp_pay_len = pay_len - TSO_MAX_BUFF_SIZE; -@@ -2082,8 +2080,8 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2083,8 +2081,8 @@ static netdev_tx_t stmmac_tso_xmit(struc priv->cur_tx = STMMAC_GET_ENTRY(priv->cur_tx, DMA_TX_SIZE); if (unlikely(stmmac_tx_avail(priv) <= (MAX_SKB_FRAGS + 1))) { @@ -2620,7 +2620,7 @@ netif_stop_queue(dev); } -@@ -2127,7 +2125,7 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2128,7 +2126,7 @@ static netdev_tx_t stmmac_tso_xmit(struc * descriptor and then barrier is needed to make sure that * all is coherent before granting the DMA engine. */ @@ -2629,7 +2629,7 @@ if (netif_msg_pktdata(priv)) { pr_info("%s: curr=%d dirty=%d f=%d, e=%d, f_p=%p, nfrags %d\n", -@@ -2146,11 +2144,9 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2147,11 +2145,9 @@ static netdev_tx_t stmmac_tso_xmit(struc priv->hw->dma->set_tx_tail_ptr(priv->ioaddr, priv->tx_tail_addr, STMMAC_CHAN0); @@ -2641,7 +2641,7 @@ dev_err(priv->device, "Tx dma map failed\n"); dev_kfree_skb(skb); priv->dev->stats.tx_dropped++; -@@ -2182,14 +2178,13 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2183,14 +2179,13 @@ static netdev_tx_t stmmac_xmit(struct sk return stmmac_tso_xmit(skb, dev); } @@ -2659,7 +2659,7 @@ } return NETDEV_TX_BUSY; } -@@ -2242,13 +2237,11 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2243,13 +2238,11 @@ static netdev_tx_t stmmac_xmit(struct sk priv->tx_skbuff[entry] = NULL; @@ -2678,7 +2678,7 @@ priv->tx_skbuff_dma[entry].map_as_page = true; priv->tx_skbuff_dma[entry].len = len; -@@ -2266,9 +2259,10 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2267,9 +2260,10 @@ static netdev_tx_t stmmac_xmit(struct sk if (netif_msg_pktdata(priv)) { void *tx_head; @@ -2692,7 +2692,7 @@ if (priv->extend_desc) tx_head = (void *)priv->dma_etx; -@@ -2277,13 +2271,13 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2278,13 +2272,13 @@ static netdev_tx_t stmmac_xmit(struct sk priv->hw->desc->display_ring(tx_head, DMA_TX_SIZE, false); @@ -2709,7 +2709,7 @@ netif_stop_queue(dev); } -@@ -2319,13 +2313,11 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2320,13 +2314,11 @@ static netdev_tx_t stmmac_xmit(struct sk if (dma_mapping_error(priv->device, des)) goto dma_map_err; @@ -2728,7 +2728,7 @@ priv->tx_skbuff_dma[first_entry].len = nopaged_len; priv->tx_skbuff_dma[first_entry].last_segment = last_segment; -@@ -2346,7 +2338,7 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2347,7 +2339,7 @@ static netdev_tx_t stmmac_xmit(struct sk * descriptor and then barrier is needed to make sure that * all is coherent before granting the DMA engine. */ @@ -2737,7 +2737,7 @@ } netdev_sent_queue(dev, skb->len); -@@ -2357,12 +2349,10 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2358,12 +2350,10 @@ static netdev_tx_t stmmac_xmit(struct sk priv->hw->dma->set_tx_tail_ptr(priv->ioaddr, priv->tx_tail_addr, STMMAC_CHAN0); @@ -2751,7 +2751,7 @@ dev_kfree_skb(skb); priv->dev->stats.tx_dropped++; return NETDEV_TX_OK; -@@ -2433,16 +2423,16 @@ static inline void stmmac_rx_refill(stru +@@ -2434,16 +2424,16 @@ static inline void stmmac_rx_refill(stru DMA_FROM_DEVICE); if (dma_mapping_error(priv->device, priv->rx_skbuff_dma[entry])) { @@ -2771,7 +2771,7 @@ } if (priv->hw->mode->refill_desc3) priv->hw->mode->refill_desc3(priv, p); -@@ -2450,17 +2440,17 @@ static inline void stmmac_rx_refill(stru +@@ -2451,17 +2441,17 @@ static inline void stmmac_rx_refill(stru if (priv->rx_zeroc_thresh > 0) priv->rx_zeroc_thresh--; @@ -2793,7 +2793,7 @@ entry = STMMAC_GET_ENTRY(entry, DMA_RX_SIZE); } -@@ -2484,7 +2474,7 @@ static int stmmac_rx(struct stmmac_priv +@@ -2485,7 +2475,7 @@ static int stmmac_rx(struct stmmac_priv if (netif_msg_rx_status(priv)) { void *rx_head; @@ -2802,7 +2802,7 @@ if (priv->extend_desc) rx_head = (void *)priv->dma_erx; else -@@ -2546,9 +2536,9 @@ static int stmmac_rx(struct stmmac_priv +@@ -2547,9 +2537,9 @@ static int stmmac_rx(struct stmmac_priv unsigned int des; if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00)) @@ -2814,7 +2814,7 @@ frame_len = priv->hw->desc->get_rx_frame_len(p, coe); -@@ -2557,9 +2547,9 @@ static int stmmac_rx(struct stmmac_priv +@@ -2558,9 +2548,9 @@ static int stmmac_rx(struct stmmac_priv * ignored */ if (frame_len > priv->dma_buf_sz) { @@ -2827,7 +2827,7 @@ priv->dev->stats.rx_length_errors++; break; } -@@ -2571,11 +2561,11 @@ static int stmmac_rx(struct stmmac_priv +@@ -2572,11 +2562,11 @@ static int stmmac_rx(struct stmmac_priv frame_len -= ETH_FCS_LEN; if (netif_msg_rx_status(priv)) { @@ -2843,7 +2843,7 @@ } /* The zero-copy is always used for all the sizes -@@ -2612,8 +2602,9 @@ static int stmmac_rx(struct stmmac_priv +@@ -2613,8 +2603,9 @@ static int stmmac_rx(struct stmmac_priv } else { skb = priv->rx_skbuff[entry]; if (unlikely(!skb)) { @@ -2855,7 +2855,7 @@ priv->dev->stats.rx_dropped++; break; } -@@ -2629,7 +2620,8 @@ static int stmmac_rx(struct stmmac_priv +@@ -2630,7 +2621,8 @@ static int stmmac_rx(struct stmmac_priv } if (netif_msg_pktdata(priv)) { @@ -2865,7 +2865,7 @@ print_pkt(skb->data, frame_len); } -@@ -2732,7 +2724,7 @@ static int stmmac_change_mtu(struct net_ +@@ -2733,7 +2725,7 @@ static int stmmac_change_mtu(struct net_ int max_mtu; if (netif_running(dev)) { @@ -2874,7 +2874,7 @@ return -EBUSY; } -@@ -2824,7 +2816,7 @@ static irqreturn_t stmmac_interrupt(int +@@ -2825,7 +2817,7 @@ static irqreturn_t stmmac_interrupt(int pm_wakeup_event(priv->device, 0); if (unlikely(!dev)) { @@ -2883,7 +2883,7 @@ return IRQ_NONE; } -@@ -2882,7 +2874,6 @@ static void stmmac_poll_controller(struc +@@ -2883,7 +2875,6 @@ static void stmmac_poll_controller(struc */ static int stmmac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { @@ -2891,7 +2891,7 @@ int ret = -EOPNOTSUPP; if (!netif_running(dev)) -@@ -2892,9 +2883,9 @@ static int stmmac_ioctl(struct net_devic +@@ -2893,9 +2884,9 @@ static int stmmac_ioctl(struct net_devic case SIOCGMIIPHY: case SIOCGMIIREG: case SIOCSMIIREG: @@ -2903,7 +2903,7 @@ break; case SIOCSHWTSTAMP: ret = stmmac_hwtstamp_ioctl(dev, rq); -@@ -2922,14 +2913,17 @@ static void sysfs_display_ring(void *hea +@@ -2923,14 +2914,17 @@ static void sysfs_display_ring(void *hea x = *(u64 *) ep; seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", i, (unsigned int)virt_to_phys(ep), @@ -2924,7 +2924,7 @@ p++; } seq_printf(seq, "\n"); -@@ -2961,6 +2955,8 @@ static int stmmac_sysfs_ring_open(struct +@@ -2962,6 +2956,8 @@ static int stmmac_sysfs_ring_open(struct return single_open(file, stmmac_sysfs_ring_read, inode->i_private); } @@ -2933,7 +2933,7 @@ static const struct file_operations stmmac_rings_status_fops = { .owner = THIS_MODULE, .open = stmmac_sysfs_ring_open, -@@ -2983,11 +2979,11 @@ static int stmmac_sysfs_dma_cap_read(str +@@ -2984,11 +2980,11 @@ static int stmmac_sysfs_dma_cap_read(str seq_printf(seq, "\tDMA HW features\n"); seq_printf(seq, "==============================\n"); @@ -2948,7 +2948,7 @@ (priv->dma_cap.half_duplex) ? "Y" : "N"); seq_printf(seq, "\tHash Filter: %s\n", (priv->dma_cap.hash_filter) ? "Y" : "N"); -@@ -3005,9 +3001,9 @@ static int stmmac_sysfs_dma_cap_read(str +@@ -3006,9 +3002,9 @@ static int stmmac_sysfs_dma_cap_read(str (priv->dma_cap.rmon) ? "Y" : "N"); seq_printf(seq, "\tIEEE 1588-2002 Time Stamp: %s\n", (priv->dma_cap.time_stamp) ? "Y" : "N"); @@ -2960,7 +2960,7 @@ (priv->dma_cap.eee) ? "Y" : "N"); seq_printf(seq, "\tAV features: %s\n", (priv->dma_cap.av) ? "Y" : "N"); seq_printf(seq, "\tChecksum Offload in TX: %s\n", -@@ -3054,8 +3050,7 @@ static int stmmac_init_fs(struct net_dev +@@ -3055,8 +3051,7 @@ static int stmmac_init_fs(struct net_dev priv->dbgfs_dir = debugfs_create_dir(dev->name, stmmac_fs_dir); if (!priv->dbgfs_dir || IS_ERR(priv->dbgfs_dir)) { @@ -2970,7 +2970,7 @@ return -ENOMEM; } -@@ -3067,7 +3062,7 @@ static int stmmac_init_fs(struct net_dev +@@ -3068,7 +3063,7 @@ static int stmmac_init_fs(struct net_dev &stmmac_rings_status_fops); if (!priv->dbgfs_rings_status || IS_ERR(priv->dbgfs_rings_status)) { @@ -2979,7 +2979,7 @@ debugfs_remove_recursive(priv->dbgfs_dir); return -ENOMEM; -@@ -3079,7 +3074,7 @@ static int stmmac_init_fs(struct net_dev +@@ -3080,7 +3075,7 @@ static int stmmac_init_fs(struct net_dev dev, &stmmac_dma_cap_fops); if (!priv->dbgfs_dma_cap || IS_ERR(priv->dbgfs_dma_cap)) { @@ -2988,7 +2988,7 @@ debugfs_remove_recursive(priv->dbgfs_dir); return -ENOMEM; -@@ -3151,11 +3146,11 @@ static int stmmac_hw_init(struct stmmac_ +@@ -3152,11 +3147,11 @@ static int stmmac_hw_init(struct stmmac_ } else { if (chain_mode) { priv->hw->mode = &chain_mode_ops; @@ -3002,7 +3002,7 @@ priv->mode = STMMAC_RING_MODE; } } -@@ -3163,7 +3158,7 @@ static int stmmac_hw_init(struct stmmac_ +@@ -3164,7 +3159,7 @@ static int stmmac_hw_init(struct stmmac_ /* Get the HW capability (new GMAC newer than 3.50a) */ priv->hw_cap_support = stmmac_get_hw_features(priv); if (priv->hw_cap_support) { @@ -3011,7 +3011,7 @@ /* We can override some gmac/dma configuration fields: e.g. * enh_desc, tx_coe (e.g. that are passed through the -@@ -3188,8 +3183,9 @@ static int stmmac_hw_init(struct stmmac_ +@@ -3189,8 +3184,9 @@ static int stmmac_hw_init(struct stmmac_ else if (priv->dma_cap.rx_coe_type1) priv->plat->rx_coe = STMMAC_RX_COE_TYPE1; @@ -3023,7 +3023,7 @@ /* To use alternate (extended), normal or GMAC4 descriptor structures */ if (priv->synopsys_id >= DWMAC_CORE_4_00) -@@ -3199,20 +3195,20 @@ static int stmmac_hw_init(struct stmmac_ +@@ -3200,20 +3196,20 @@ static int stmmac_hw_init(struct stmmac_ if (priv->plat->rx_coe) { priv->hw->rx_csum = priv->plat->rx_coe; @@ -3049,7 +3049,7 @@ return 0; } -@@ -3271,8 +3267,8 @@ int stmmac_dvr_probe(struct device *devi +@@ -3272,8 +3268,8 @@ int stmmac_dvr_probe(struct device *devi priv->stmmac_clk = devm_clk_get(priv->device, STMMAC_RESOURCE_NAME); if (IS_ERR(priv->stmmac_clk)) { @@ -3060,7 +3060,7 @@ /* If failed to obtain stmmac_clk and specific clk_csr value * is NOT passed from the platform, probe fail. */ -@@ -3321,7 +3317,7 @@ int stmmac_dvr_probe(struct device *devi +@@ -3322,7 +3318,7 @@ int stmmac_dvr_probe(struct device *devi if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) { ndev->hw_features |= NETIF_F_TSO; priv->tso = true; @@ -3069,7 +3069,7 @@ } ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA; ndev->watchdog_timeo = msecs_to_jiffies(watchdog); -@@ -3341,13 +3337,13 @@ int stmmac_dvr_probe(struct device *devi +@@ -3342,13 +3338,13 @@ int stmmac_dvr_probe(struct device *devi */ if ((priv->synopsys_id >= DWMAC_CORE_3_50) && (!priv->plat->riwt_off)) { priv->use_riwt = 1; @@ -3085,7 +3085,7 @@ /* If a specific clk_csr value is passed from the platform * this means that the CSR Clock Range selection cannot be -@@ -3368,15 +3364,17 @@ int stmmac_dvr_probe(struct device *devi +@@ -3369,15 +3365,17 @@ int stmmac_dvr_probe(struct device *devi /* MDIO bus Registration */ ret = stmmac_mdio_register(ndev); if (ret < 0) { @@ -3107,7 +3107,7 @@ goto error_netdev_register; } -@@ -3387,7 +3385,7 @@ error_netdev_register: +@@ -3388,7 +3386,7 @@ error_netdev_register: priv->hw->pcs != STMMAC_PCS_TBI && priv->hw->pcs != STMMAC_PCS_RTBI) stmmac_mdio_unregister(ndev); @@ -3116,7 +3116,7 @@ netif_napi_del(&priv->napi); error_hw_init: clk_disable_unprepare(priv->pclk); -@@ -3411,7 +3409,7 @@ int stmmac_dvr_remove(struct device *dev +@@ -3412,7 +3410,7 @@ int stmmac_dvr_remove(struct device *dev struct net_device *ndev = dev_get_drvdata(dev); struct stmmac_priv *priv = netdev_priv(ndev); @@ -3125,7 +3125,7 @@ priv->hw->dma->stop_rx(priv->ioaddr); priv->hw->dma->stop_tx(priv->ioaddr); -@@ -3449,8 +3447,8 @@ int stmmac_suspend(struct device *dev) +@@ -3450,8 +3448,8 @@ int stmmac_suspend(struct device *dev) if (!ndev || !netif_running(ndev)) return 0; @@ -3136,7 +3136,7 @@ spin_lock_irqsave(&priv->lock, flags); -@@ -3544,8 +3542,8 @@ int stmmac_resume(struct device *dev) +@@ -3545,8 +3543,8 @@ int stmmac_resume(struct device *dev) spin_unlock_irqrestore(&priv->lock, flags); diff --git a/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch b/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch index abd1304485..fc626cbb9b 100644 --- a/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch +++ b/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch @@ -1718,7 +1718,7 @@ priv->tx_lpi_timer = STMMAC_DEFAULT_TWT_LS; if ((priv->use_riwt) && (priv->hw->dma->rx_watchdog)) { -@@ -2519,7 +2517,7 @@ static int stmmac_rx(struct stmmac_priv +@@ -2520,7 +2518,7 @@ static int stmmac_rx(struct stmmac_priv if (unlikely(status == discard_frame)) { priv->dev->stats.rx_errors++; if (priv->hwts_rx_en && !priv->extend_desc) { @@ -1727,7 +1727,7 @@ * with timestamp value, hence reinitialize * them in stmmac_rx_refill() function so that * device can reuse it. -@@ -2542,7 +2540,7 @@ static int stmmac_rx(struct stmmac_priv +@@ -2543,7 +2541,7 @@ static int stmmac_rx(struct stmmac_priv frame_len = priv->hw->desc->get_rx_frame_len(p, coe); @@ -1736,7 +1736,7 @@ * (preallocated during init) then the packet is * ignored */ -@@ -2762,7 +2760,7 @@ static netdev_features_t stmmac_fix_feat +@@ -2763,7 +2761,7 @@ static netdev_features_t stmmac_fix_feat /* Some GMAC devices have a bugged Jumbo frame support that * needs to have the Tx COE disabled for oversized frames * (due to limited buffer sizes). In this case we disable @@ -1745,7 +1745,7 @@ */ if (priv->plat->bugged_jumbo && (dev->mtu > ETH_DATA_LEN)) features &= ~NETIF_F_CSUM_MASK; -@@ -2908,9 +2906,7 @@ static void sysfs_display_ring(void *hea +@@ -2909,9 +2907,7 @@ static void sysfs_display_ring(void *hea struct dma_desc *p = (struct dma_desc *)head; for (i = 0; i < size; i++) { @@ -1755,7 +1755,7 @@ seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", i, (unsigned int)virt_to_phys(ep), le32_to_cpu(ep->basic.des0), -@@ -2919,7 +2915,6 @@ static void sysfs_display_ring(void *hea +@@ -2920,7 +2916,6 @@ static void sysfs_display_ring(void *hea le32_to_cpu(ep->basic.des3)); ep++; } else { @@ -1763,7 +1763,7 @@ seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", i, (unsigned int)virt_to_phys(ep), le32_to_cpu(p->des0), le32_to_cpu(p->des1), -@@ -2989,7 +2984,7 @@ static int stmmac_sysfs_dma_cap_read(str +@@ -2990,7 +2985,7 @@ static int stmmac_sysfs_dma_cap_read(str (priv->dma_cap.hash_filter) ? "Y" : "N"); seq_printf(seq, "\tMultiple MAC address registers: %s\n", (priv->dma_cap.multi_addr) ? "Y" : "N"); @@ -1772,7 +1772,7 @@ (priv->dma_cap.pcs) ? "Y" : "N"); seq_printf(seq, "\tSMA (MDIO) Interface: %s\n", (priv->dma_cap.sma_mdio) ? "Y" : "N"); -@@ -3265,44 +3260,8 @@ int stmmac_dvr_probe(struct device *devi +@@ -3266,44 +3261,8 @@ int stmmac_dvr_probe(struct device *devi if ((phyaddr >= 0) && (phyaddr <= 31)) priv->plat->phy_addr = phyaddr; @@ -1819,7 +1819,7 @@ /* Init MAC and get the capabilities */ ret = stmmac_hw_init(priv); -@@ -3388,10 +3347,6 @@ error_netdev_register: +@@ -3389,10 +3348,6 @@ error_netdev_register: error_mdio_register: netif_napi_del(&priv->napi); error_hw_init: @@ -1830,7 +1830,7 @@ free_netdev(ndev); return ret; -@@ -3417,10 +3372,10 @@ int stmmac_dvr_remove(struct device *dev +@@ -3418,10 +3373,10 @@ int stmmac_dvr_remove(struct device *dev stmmac_set_mac(priv->ioaddr, false); netif_carrier_off(ndev); unregister_netdev(ndev); @@ -1845,7 +1845,7 @@ if (priv->hw->pcs != STMMAC_PCS_RGMII && priv->hw->pcs != STMMAC_PCS_TBI && priv->hw->pcs != STMMAC_PCS_RTBI) -@@ -3469,14 +3424,14 @@ int stmmac_suspend(struct device *dev) +@@ -3470,14 +3425,14 @@ int stmmac_suspend(struct device *dev) stmmac_set_mac(priv->ioaddr, false); pinctrl_pm_select_sleep_state(priv->device); /* Disable clock in case of PWM is off */ @@ -1864,7 +1864,7 @@ return 0; } EXPORT_SYMBOL_GPL(stmmac_suspend); -@@ -3509,9 +3464,9 @@ int stmmac_resume(struct device *dev) +@@ -3510,9 +3465,9 @@ int stmmac_resume(struct device *dev) priv->irq_wake = 0; } else { pinctrl_pm_select_default_state(priv->device); diff --git a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch index 285e4d2762..18f58e947c 100644 --- a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch +++ b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch @@ -4523,7 +4523,7 @@ /** * stmmac_open - open entry point of the driver * @dev : pointer to the device structure. -@@ -1821,7 +2598,7 @@ static int stmmac_open(struct net_device +@@ -1822,7 +2599,7 @@ static int stmmac_open(struct net_device netdev_err(priv->dev, "%s: ERROR: allocating the IRQ %d (error: %d)\n", __func__, dev->irq, ret); @@ -4532,7 +4532,7 @@ } /* Request the Wake IRQ in case of another line is used for WoL */ -@@ -1848,8 +2625,8 @@ static int stmmac_open(struct net_device +@@ -1849,8 +2626,8 @@ static int stmmac_open(struct net_device } } @@ -4543,7 +4543,7 @@ return 0; -@@ -1858,7 +2635,12 @@ lpiirq_error: +@@ -1859,7 +2636,12 @@ lpiirq_error: free_irq(priv->wol_irq, dev); wolirq_error: free_irq(dev->irq, dev); @@ -4556,7 +4556,7 @@ init_error: free_dma_desc_resources(priv); dma_desc_error: -@@ -1887,9 +2669,9 @@ static int stmmac_release(struct net_dev +@@ -1888,9 +2670,9 @@ static int stmmac_release(struct net_dev phy_disconnect(dev->phydev); } @@ -4568,7 +4568,7 @@ del_timer_sync(&priv->txtimer); -@@ -1901,14 +2683,13 @@ static int stmmac_release(struct net_dev +@@ -1902,14 +2684,13 @@ static int stmmac_release(struct net_dev free_irq(priv->lpi_irq, dev); /* Stop TX/RX DMA and clear the descriptors */ @@ -4585,7 +4585,7 @@ netif_carrier_off(dev); -@@ -1927,22 +2708,24 @@ static int stmmac_release(struct net_dev +@@ -1928,22 +2709,24 @@ static int stmmac_release(struct net_dev * @des: buffer start address * @total_len: total length to fill in descriptors * @last_segmant: condition for the last descriptor @@ -4614,7 +4614,7 @@ desc->des0 = cpu_to_le32(des + (total_len - tmp_len)); buff_size = tmp_len >= TSO_MAX_BUFF_SIZE ? -@@ -1950,7 +2733,7 @@ static void stmmac_tso_allocator(struct +@@ -1951,7 +2734,7 @@ static void stmmac_tso_allocator(struct priv->hw->desc->prepare_tso_tx_desc(desc, 0, buff_size, 0, 1, @@ -4623,7 +4623,7 @@ 0, 0); tmp_len -= TSO_MAX_BUFF_SIZE; -@@ -1986,23 +2769,28 @@ static void stmmac_tso_allocator(struct +@@ -1987,23 +2770,28 @@ static void stmmac_tso_allocator(struct */ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev) { @@ -4658,7 +4658,7 @@ /* This is a hard error, log it. */ netdev_err(priv->dev, "%s: Tx Ring full when queue awake\n", -@@ -2017,10 +2805,10 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2018,10 +2806,10 @@ static netdev_tx_t stmmac_tso_xmit(struc /* set new MSS value if needed */ if (mss != priv->mss) { @@ -4671,7 +4671,7 @@ } if (netif_msg_tx_queued(priv)) { -@@ -2030,9 +2818,9 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2031,9 +2819,9 @@ static netdev_tx_t stmmac_tso_xmit(struc skb->data_len); } @@ -4683,7 +4683,7 @@ first = desc; /* first descriptor: fill Headers on Buf1 */ -@@ -2041,9 +2829,8 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2042,9 +2830,8 @@ static netdev_tx_t stmmac_tso_xmit(struc if (dma_mapping_error(priv->device, des)) goto dma_map_err; @@ -4695,7 +4695,7 @@ first->des0 = cpu_to_le32(des); -@@ -2054,7 +2841,7 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2055,7 +2842,7 @@ static netdev_tx_t stmmac_tso_xmit(struc /* If needed take extra descriptors to fill the remaining payload */ tmp_pay_len = pay_len - TSO_MAX_BUFF_SIZE; @@ -4704,7 +4704,7 @@ /* Prepare fragments */ for (i = 0; i < nfrags; i++) { -@@ -2063,24 +2850,34 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2064,24 +2851,34 @@ static netdev_tx_t stmmac_tso_xmit(struc des = skb_frag_dma_map(priv->device, frag, 0, skb_frag_size(frag), DMA_TO_DEVICE); @@ -4748,7 +4748,7 @@ } dev->stats.tx_bytes += skb->len; -@@ -2112,7 +2909,7 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2113,7 +2910,7 @@ static netdev_tx_t stmmac_tso_xmit(struc priv->hw->desc->prepare_tso_tx_desc(first, 1, proto_hdr_len, pay_len, @@ -4757,7 +4757,7 @@ tcp_hdrlen(skb) / 4, (skb->len - proto_hdr_len)); /* If context desc is used to change MSS */ -@@ -2127,20 +2924,20 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2128,20 +2925,20 @@ static netdev_tx_t stmmac_tso_xmit(struc if (netif_msg_pktdata(priv)) { pr_info("%s: curr=%d dirty=%d f=%d, e=%d, f_p=%p, nfrags %d\n", @@ -4784,7 +4784,7 @@ return NETDEV_TX_OK; -@@ -2164,21 +2961,27 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2165,21 +2962,27 @@ static netdev_tx_t stmmac_xmit(struct sk struct stmmac_priv *priv = netdev_priv(dev); unsigned int nopaged_len = skb_headlen(skb); int i, csum_insertion = 0, is_jumbo = 0; @@ -4816,7 +4816,7 @@ /* This is a hard error, log it. */ netdev_err(priv->dev, "%s: Tx Ring full when queue awake\n", -@@ -2190,20 +2993,18 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2191,20 +2994,18 @@ static netdev_tx_t stmmac_xmit(struct sk if (priv->tx_path_in_lpi_mode) stmmac_disable_eee_mode(priv); @@ -4840,7 +4840,7 @@ enh_desc = priv->plat->enh_desc; /* To program the descriptors according to the size of the frame */ if (enh_desc) -@@ -2211,7 +3012,7 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2212,7 +3013,7 @@ static netdev_tx_t stmmac_xmit(struct sk if (unlikely(is_jumbo) && likely(priv->synopsys_id < DWMAC_CORE_4_00)) { @@ -4849,7 +4849,7 @@ if (unlikely(entry < 0)) goto dma_map_err; } -@@ -2224,48 +3025,56 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2225,48 +3026,56 @@ static netdev_tx_t stmmac_xmit(struct sk entry = STMMAC_GET_ENTRY(entry, DMA_TX_SIZE); if (likely(priv->extend_desc)) @@ -4919,7 +4919,7 @@ priv->hw->desc->display_ring(tx_head, DMA_TX_SIZE, false); -@@ -2273,10 +3082,10 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2274,10 +3083,10 @@ static netdev_tx_t stmmac_xmit(struct sk print_pkt(skb->data, skb->len); } @@ -4932,7 +4932,7 @@ } dev->stats.tx_bytes += skb->len; -@@ -2311,14 +3120,14 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2312,14 +3121,14 @@ static netdev_tx_t stmmac_xmit(struct sk if (dma_mapping_error(priv->device, des)) goto dma_map_err; @@ -4950,7 +4950,7 @@ if (unlikely((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) && priv->hwts_tx_en)) { -@@ -2330,7 +3139,7 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2331,7 +3140,7 @@ static netdev_tx_t stmmac_xmit(struct sk /* Prepare the first descriptor setting the OWN bit too */ priv->hw->desc->prepare_tx_desc(first, 1, nopaged_len, csum_insertion, priv->mode, 1, @@ -4959,7 +4959,7 @@ /* The own bit must be the latest setting done when prepare the * descriptor and then barrier is needed to make sure that -@@ -2339,13 +3148,13 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2340,13 +3149,13 @@ static netdev_tx_t stmmac_xmit(struct sk dma_wmb(); } @@ -4976,7 +4976,7 @@ return NETDEV_TX_OK; -@@ -2373,9 +3182,9 @@ static void stmmac_rx_vlan(struct net_de +@@ -2374,9 +3183,9 @@ static void stmmac_rx_vlan(struct net_de } @@ -4988,7 +4988,7 @@ return 0; return 1; -@@ -2384,30 +3193,33 @@ static inline int stmmac_rx_threshold_co +@@ -2385,30 +3194,33 @@ static inline int stmmac_rx_threshold_co /** * stmmac_rx_refill - refill used skb preallocated buffers * @priv: driver private structure @@ -5029,7 +5029,7 @@ if (unlikely(net_ratelimit())) dev_err(priv->device, "fail to alloc skb entry %d\n", -@@ -2415,28 +3227,28 @@ static inline void stmmac_rx_refill(stru +@@ -2416,28 +3228,28 @@ static inline void stmmac_rx_refill(stru break; } @@ -5066,7 +5066,7 @@ netif_dbg(priv, rx_status, priv->dev, "refill entry #%d\n", entry); -@@ -2452,31 +3264,33 @@ static inline void stmmac_rx_refill(stru +@@ -2453,31 +3265,33 @@ static inline void stmmac_rx_refill(stru entry = STMMAC_GET_ENTRY(entry, DMA_RX_SIZE); } @@ -5107,7 +5107,7 @@ priv->hw->desc->display_ring(rx_head, DMA_RX_SIZE, true); } -@@ -2486,9 +3300,9 @@ static int stmmac_rx(struct stmmac_priv +@@ -2487,9 +3301,9 @@ static int stmmac_rx(struct stmmac_priv struct dma_desc *np; if (priv->extend_desc) @@ -5119,7 +5119,7 @@ /* read the status of the incoming frame */ status = priv->hw->desc->rx_status(&priv->dev->stats, -@@ -2499,20 +3313,20 @@ static int stmmac_rx(struct stmmac_priv +@@ -2500,20 +3314,20 @@ static int stmmac_rx(struct stmmac_priv count++; @@ -5145,7 +5145,7 @@ entry); if (unlikely(status == discard_frame)) { priv->dev->stats.rx_errors++; -@@ -2522,9 +3336,9 @@ static int stmmac_rx(struct stmmac_priv +@@ -2523,9 +3337,9 @@ static int stmmac_rx(struct stmmac_priv * them in stmmac_rx_refill() function so that * device can reuse it. */ @@ -5157,7 +5157,7 @@ priv->dma_buf_sz, DMA_FROM_DEVICE); } -@@ -2572,7 +3386,7 @@ static int stmmac_rx(struct stmmac_priv +@@ -2573,7 +3387,7 @@ static int stmmac_rx(struct stmmac_priv */ if (unlikely(!priv->plat->has_gmac4 && ((frame_len < priv->rx_copybreak) || @@ -5166,7 +5166,7 @@ skb = netdev_alloc_skb_ip_align(priv->dev, frame_len); if (unlikely(!skb)) { -@@ -2584,21 +3398,21 @@ static int stmmac_rx(struct stmmac_priv +@@ -2585,21 +3399,21 @@ static int stmmac_rx(struct stmmac_priv } dma_sync_single_for_cpu(priv->device, @@ -5192,7 +5192,7 @@ if (unlikely(!skb)) { netdev_err(priv->dev, "%s: Inconsistent Rx chain\n", -@@ -2607,12 +3421,12 @@ static int stmmac_rx(struct stmmac_priv +@@ -2608,12 +3422,12 @@ static int stmmac_rx(struct stmmac_priv break; } prefetch(skb->data - NET_IP_ALIGN); @@ -5208,7 +5208,7 @@ priv->dma_buf_sz, DMA_FROM_DEVICE); } -@@ -2634,7 +3448,7 @@ static int stmmac_rx(struct stmmac_priv +@@ -2635,7 +3449,7 @@ static int stmmac_rx(struct stmmac_priv else skb->ip_summed = CHECKSUM_UNNECESSARY; @@ -5217,7 +5217,7 @@ priv->dev->stats.rx_packets++; priv->dev->stats.rx_bytes += frame_len; -@@ -2642,7 +3456,7 @@ static int stmmac_rx(struct stmmac_priv +@@ -2643,7 +3457,7 @@ static int stmmac_rx(struct stmmac_priv entry = next_entry; } @@ -5226,7 +5226,7 @@ priv->xstats.rx_pkt_n += count; -@@ -2659,16 +3473,24 @@ static int stmmac_rx(struct stmmac_priv +@@ -2660,16 +3474,24 @@ static int stmmac_rx(struct stmmac_priv */ static int stmmac_poll(struct napi_struct *napi, int budget) { @@ -5255,7 +5255,7 @@ } return work_done; } -@@ -2684,9 +3506,12 @@ static int stmmac_poll(struct napi_struc +@@ -2685,9 +3507,12 @@ static int stmmac_poll(struct napi_struc static void stmmac_tx_timeout(struct net_device *dev) { struct stmmac_priv *priv = netdev_priv(dev); @@ -5269,7 +5269,7 @@ } /** -@@ -2809,6 +3634,12 @@ static irqreturn_t stmmac_interrupt(int +@@ -2810,6 +3635,12 @@ static irqreturn_t stmmac_interrupt(int { struct net_device *dev = (struct net_device *)dev_id; struct stmmac_priv *priv = netdev_priv(dev); @@ -5282,7 +5282,7 @@ if (priv->irq_wake) pm_wakeup_event(priv->device, 0); -@@ -2822,16 +3653,30 @@ static irqreturn_t stmmac_interrupt(int +@@ -2823,16 +3654,30 @@ static irqreturn_t stmmac_interrupt(int if ((priv->plat->has_gmac) || (priv->plat->has_gmac4)) { int status = priv->hw->mac->host_irq_status(priv->hw, &priv->xstats); @@ -5317,7 +5317,7 @@ } /* PCS link status */ -@@ -2916,7 +3761,7 @@ static void sysfs_display_ring(void *hea +@@ -2917,7 +3762,7 @@ static void sysfs_display_ring(void *hea ep++; } else { seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", @@ -5326,7 +5326,7 @@ le32_to_cpu(p->des0), le32_to_cpu(p->des1), le32_to_cpu(p->des2), le32_to_cpu(p->des3)); p++; -@@ -2929,17 +3774,40 @@ static int stmmac_sysfs_ring_read(struct +@@ -2930,17 +3775,40 @@ static int stmmac_sysfs_ring_read(struct { struct net_device *dev = seq->private; struct stmmac_priv *priv = netdev_priv(dev); @@ -5377,7 +5377,7 @@ } return 0; -@@ -3222,11 +4090,14 @@ int stmmac_dvr_probe(struct device *devi +@@ -3223,11 +4091,14 @@ int stmmac_dvr_probe(struct device *devi struct plat_stmmacenet_data *plat_dat, struct stmmac_resources *res) { @@ -5394,7 +5394,7 @@ if (!ndev) return -ENOMEM; -@@ -3268,6 +4139,10 @@ int stmmac_dvr_probe(struct device *devi +@@ -3269,6 +4140,10 @@ int stmmac_dvr_probe(struct device *devi if (ret) goto error_hw_init; @@ -5405,7 +5405,7 @@ ndev->netdev_ops = &stmmac_netdev_ops; ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | -@@ -3300,7 +4175,12 @@ int stmmac_dvr_probe(struct device *devi +@@ -3301,7 +4176,12 @@ int stmmac_dvr_probe(struct device *devi "Enable RX Mitigation via HW Watchdog Timer\n"); } @@ -5419,7 +5419,7 @@ spin_lock_init(&priv->lock); -@@ -3345,7 +4225,11 @@ error_netdev_register: +@@ -3346,7 +4226,11 @@ error_netdev_register: priv->hw->pcs != STMMAC_PCS_RTBI) stmmac_mdio_unregister(ndev); error_mdio_register: @@ -5432,7 +5432,7 @@ error_hw_init: free_netdev(ndev); -@@ -3366,10 +4250,9 @@ int stmmac_dvr_remove(struct device *dev +@@ -3367,10 +4251,9 @@ int stmmac_dvr_remove(struct device *dev netdev_info(priv->dev, "%s: removing driver", __func__); @@ -5445,7 +5445,7 @@ netif_carrier_off(ndev); unregister_netdev(ndev); if (priv->plat->stmmac_rst) -@@ -3408,20 +4291,19 @@ int stmmac_suspend(struct device *dev) +@@ -3409,20 +4292,19 @@ int stmmac_suspend(struct device *dev) spin_lock_irqsave(&priv->lock, flags); netif_device_detach(ndev); @@ -5470,7 +5470,7 @@ pinctrl_pm_select_sleep_state(priv->device); /* Disable clock in case of PWM is off */ clk_disable(priv->plat->pclk); -@@ -3437,6 +4319,31 @@ int stmmac_suspend(struct device *dev) +@@ -3438,6 +4320,31 @@ int stmmac_suspend(struct device *dev) EXPORT_SYMBOL_GPL(stmmac_suspend); /** @@ -5502,7 +5502,7 @@ * stmmac_resume - resume callback * @dev: device pointer * Description: when resume this function is invoked to setup the DMA and CORE -@@ -3476,10 +4383,8 @@ int stmmac_resume(struct device *dev) +@@ -3477,10 +4384,8 @@ int stmmac_resume(struct device *dev) spin_lock_irqsave(&priv->lock, flags); @@ -5515,7 +5515,7 @@ /* reset private mss value to force mss context settings at * next tso xmit (only used for gmac4). */ -@@ -3491,9 +4396,9 @@ int stmmac_resume(struct device *dev) +@@ -3492,9 +4397,9 @@ int stmmac_resume(struct device *dev) stmmac_init_tx_coalesce(priv); stmmac_set_rx_mode(ndev); diff --git a/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch b/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch index f829b79dc3..161e9f0e6c 100644 --- a/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch +++ b/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch @@ -1491,7 +1491,7 @@ free_dma_tx_desc_resources(priv); return ret; -@@ -2895,8 +2893,7 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2896,8 +2894,7 @@ static netdev_tx_t stmmac_tso_xmit(struc priv->xstats.tx_set_ic_bit++; } @@ -1501,7 +1501,7 @@ if (unlikely((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) && priv->hwts_tx_en)) { -@@ -2974,7 +2971,7 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2975,7 +2972,7 @@ static netdev_tx_t stmmac_xmit(struct sk /* Manage oversized TCP frames for GMAC4 device */ if (skb_is_gso(skb) && priv->tso) { @@ -1510,7 +1510,7 @@ return stmmac_tso_xmit(skb, dev); } -@@ -3105,8 +3102,7 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -3106,8 +3103,7 @@ static netdev_tx_t stmmac_xmit(struct sk priv->xstats.tx_set_ic_bit++; } @@ -1520,7 +1520,7 @@ /* Ready to fill the first descriptor and set the OWN bit w/o any * problems because all the descriptors are actually ready to be -@@ -3983,7 +3979,9 @@ static int stmmac_hw_init(struct stmmac_ +@@ -3984,7 +3980,9 @@ static int stmmac_hw_init(struct stmmac_ struct mac_device_info *mac; /* Identify the MAC HW device */ @@ -1531,7 +1531,7 @@ priv->dev->priv_flags |= IFF_UNICAST_FLT; mac = dwmac1000_setup(priv->ioaddr, priv->plat->multicast_filter_bins, -@@ -4003,6 +4001,10 @@ static int stmmac_hw_init(struct stmmac_ +@@ -4004,6 +4002,10 @@ static int stmmac_hw_init(struct stmmac_ priv->hw = mac; @@ -1542,7 +1542,7 @@ /* To use the chained or ring mode */ if (priv->synopsys_id >= DWMAC_CORE_4_00) { priv->hw->mode = &dwmac4_ring_mode_ops; -@@ -4131,8 +4133,15 @@ int stmmac_dvr_probe(struct device *devi +@@ -4132,8 +4134,15 @@ int stmmac_dvr_probe(struct device *devi if ((phyaddr >= 0) && (phyaddr <= 31)) priv->plat->phy_addr = phyaddr; @@ -1559,7 +1559,7 @@ /* Init MAC and get the capabilities */ ret = stmmac_hw_init(priv); -@@ -4149,7 +4158,7 @@ int stmmac_dvr_probe(struct device *devi +@@ -4150,7 +4159,7 @@ int stmmac_dvr_probe(struct device *devi NETIF_F_RXCSUM; if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) { @@ -1568,7 +1568,7 @@ priv->tso = true; dev_info(priv->device, "TSO feature enabled\n"); } -@@ -4311,7 +4320,7 @@ int stmmac_suspend(struct device *dev) +@@ -4312,7 +4321,7 @@ int stmmac_suspend(struct device *dev) } spin_unlock_irqrestore(&priv->lock, flags); diff --git a/target/linux/sunxi/patches-4.9/090-sunxi-mmc-from-4-13.patch b/target/linux/sunxi/patches-4.9/090-sunxi-mmc-from-4-13.patch new file mode 100644 index 0000000000..e64581ff83 --- /dev/null +++ b/target/linux/sunxi/patches-4.9/090-sunxi-mmc-from-4-13.patch @@ -0,0 +1,288 @@ +--- a/Documentation/devicetree/bindings/mmc/sunxi-mmc.txt ++++ b/Documentation/devicetree/bindings/mmc/sunxi-mmc.txt +@@ -13,6 +13,7 @@ Required properties: + * "allwinner,sun5i-a13-mmc" + * "allwinner,sun7i-a20-mmc" + * "allwinner,sun9i-a80-mmc" ++ * "allwinner,sun50i-a64-emmc" + * "allwinner,sun50i-a64-mmc" + - reg : mmc controller base registers + - clocks : a list with 4 phandle + clock specifier pairs +--- a/drivers/mmc/host/sunxi-mmc.c ++++ b/drivers/mmc/host/sunxi-mmc.c +@@ -5,6 +5,7 @@ + * (C) Copyright 2013-2014 O2S GmbH + * (C) Copyright 2013-2014 David Lanzend�rfer + * (C) Copyright 2013-2014 Hans de Goede ++ * (C) Copyright 2017 Sootech SA + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as +@@ -101,6 +102,7 @@ + (SDXC_SOFT_RESET | SDXC_FIFO_RESET | SDXC_DMA_RESET) + + /* clock control bits */ ++#define SDXC_MASK_DATA0 BIT(31) + #define SDXC_CARD_CLOCK_ON BIT(16) + #define SDXC_LOW_POWER_ON BIT(17) + +@@ -253,6 +255,11 @@ struct sunxi_mmc_cfg { + + /* does the IP block support autocalibration? */ + bool can_calibrate; ++ ++ /* Does DATA0 needs to be masked while the clock is updated */ ++ bool mask_data0; ++ ++ bool needs_new_timings; + }; + + struct sunxi_mmc_host { +@@ -482,7 +489,7 @@ static void sunxi_mmc_dump_errinfo(struc + cmd->opcode == SD_IO_RW_DIRECT)) + return; + +- dev_err(mmc_dev(host->mmc), ++ dev_dbg(mmc_dev(host->mmc), + "smc %d err, cmd %d,%s%s%s%s%s%s%s%s%s%s !!\n", + host->mmc->index, cmd->opcode, + data ? (data->flags & MMC_DATA_WRITE ? " WR" : " RD") : "", +@@ -654,11 +661,16 @@ static int sunxi_mmc_oclk_onoff(struct s + unsigned long expire = jiffies + msecs_to_jiffies(750); + u32 rval; + ++ dev_dbg(mmc_dev(host->mmc), "%sabling the clock\n", ++ oclk_en ? "en" : "dis"); ++ + rval = mmc_readl(host, REG_CLKCR); +- rval &= ~(SDXC_CARD_CLOCK_ON | SDXC_LOW_POWER_ON); ++ rval &= ~(SDXC_CARD_CLOCK_ON | SDXC_LOW_POWER_ON | SDXC_MASK_DATA0); + + if (oclk_en) + rval |= SDXC_CARD_CLOCK_ON; ++ if (host->cfg->mask_data0) ++ rval |= SDXC_MASK_DATA0; + + mmc_writel(host, REG_CLKCR, rval); + +@@ -678,46 +690,29 @@ static int sunxi_mmc_oclk_onoff(struct s + return -EIO; + } + ++ if (host->cfg->mask_data0) { ++ rval = mmc_readl(host, REG_CLKCR); ++ mmc_writel(host, REG_CLKCR, rval & ~SDXC_MASK_DATA0); ++ } ++ + return 0; + } + + static int sunxi_mmc_calibrate(struct sunxi_mmc_host *host, int reg_off) + { +- u32 reg = readl(host->reg_base + reg_off); +- u32 delay; +- unsigned long timeout; +- + if (!host->cfg->can_calibrate) + return 0; + +- reg &= ~(SDXC_CAL_DL_MASK << SDXC_CAL_DL_SW_SHIFT); +- reg &= ~SDXC_CAL_DL_SW_EN; +- +- writel(reg | SDXC_CAL_START, host->reg_base + reg_off); +- +- dev_dbg(mmc_dev(host->mmc), "calibration started\n"); +- +- timeout = jiffies + HZ * SDXC_CAL_TIMEOUT; +- +- while (!((reg = readl(host->reg_base + reg_off)) & SDXC_CAL_DONE)) { +- if (time_before(jiffies, timeout)) +- cpu_relax(); +- else { +- reg &= ~SDXC_CAL_START; +- writel(reg, host->reg_base + reg_off); +- +- return -ETIMEDOUT; +- } +- } +- +- delay = (reg >> SDXC_CAL_DL_SHIFT) & SDXC_CAL_DL_MASK; +- +- reg &= ~SDXC_CAL_START; +- reg |= (delay << SDXC_CAL_DL_SW_SHIFT) | SDXC_CAL_DL_SW_EN; +- +- writel(reg, host->reg_base + reg_off); +- +- dev_dbg(mmc_dev(host->mmc), "calibration ended, reg is 0x%x\n", reg); ++ /* ++ * FIXME: ++ * This is not clear how the calibration is supposed to work ++ * yet. The best rate have been obtained by simply setting the ++ * delay to 0, as Allwinner does in its BSP. ++ * ++ * The only mode that doesn't have such a delay is HS400, that ++ * is in itself a TODO. ++ */ ++ writel(SDXC_CAL_DL_SW_EN, host->reg_base + reg_off); + + return 0; + } +@@ -745,6 +740,7 @@ static int sunxi_mmc_clk_set_phase(struc + index = SDXC_CLK_50M_DDR; + } + } else { ++ dev_dbg(mmc_dev(host->mmc), "Invalid clock... returning\n"); + return -EINVAL; + } + +@@ -757,10 +753,21 @@ static int sunxi_mmc_clk_set_phase(struc + static int sunxi_mmc_clk_set_rate(struct sunxi_mmc_host *host, + struct mmc_ios *ios) + { ++ struct mmc_host *mmc = host->mmc; + long rate; + u32 rval, clock = ios->clock; + int ret; + ++ ret = sunxi_mmc_oclk_onoff(host, 0); ++ if (ret) ++ return ret; ++ ++ /* Our clock is gated now */ ++ mmc->actual_clock = 0; ++ ++ if (!ios->clock) ++ return 0; ++ + /* 8 bit DDR requires a higher module clock */ + if (ios->timing == MMC_TIMING_MMC_DDR52 && + ios->bus_width == MMC_BUS_WIDTH_8) +@@ -768,25 +775,21 @@ static int sunxi_mmc_clk_set_rate(struct + + rate = clk_round_rate(host->clk_mmc, clock); + if (rate < 0) { +- dev_err(mmc_dev(host->mmc), "error rounding clk to %d: %ld\n", ++ dev_err(mmc_dev(mmc), "error rounding clk to %d: %ld\n", + clock, rate); + return rate; + } +- dev_dbg(mmc_dev(host->mmc), "setting clk to %d, rounded %ld\n", ++ dev_dbg(mmc_dev(mmc), "setting clk to %d, rounded %ld\n", + clock, rate); + + /* setting clock rate */ + ret = clk_set_rate(host->clk_mmc, rate); + if (ret) { +- dev_err(mmc_dev(host->mmc), "error setting clk to %ld: %d\n", ++ dev_err(mmc_dev(mmc), "error setting clk to %ld: %d\n", + rate, ret); + return ret; + } + +- ret = sunxi_mmc_oclk_onoff(host, 0); +- if (ret) +- return ret; +- + /* clear internal divider */ + rval = mmc_readl(host, REG_CLKCR); + rval &= ~0xff; +@@ -798,6 +801,13 @@ static int sunxi_mmc_clk_set_rate(struct + } + mmc_writel(host, REG_CLKCR, rval); + ++ if (host->cfg->needs_new_timings) { ++ /* Don't touch the delay bits */ ++ rval = mmc_readl(host, REG_SD_NTSR); ++ rval |= SDXC_2X_TIMING_MODE; ++ mmc_writel(host, REG_SD_NTSR, rval); ++ } ++ + ret = sunxi_mmc_clk_set_phase(host, ios, rate); + if (ret) + return ret; +@@ -806,9 +816,22 @@ static int sunxi_mmc_clk_set_rate(struct + if (ret) + return ret; + +- /* TODO: enable calibrate on sdc2 SDXC_REG_DS_DL_REG of A64 */ ++ /* ++ * FIXME: ++ * ++ * In HS400 we'll also need to calibrate the data strobe ++ * signal. This should only happen on the MMC2 controller (at ++ * least on the A64). ++ */ ++ ++ ret = sunxi_mmc_oclk_onoff(host, 1); ++ if (ret) ++ return ret; + +- return sunxi_mmc_oclk_onoff(host, 1); ++ /* And we just enabled our clock back */ ++ mmc->actual_clock = rate; ++ ++ return 0; + } + + static void sunxi_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) +@@ -822,10 +845,13 @@ static void sunxi_mmc_set_ios(struct mmc + break; + + case MMC_POWER_UP: +- host->ferror = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, +- ios->vdd); +- if (host->ferror) +- return; ++ if (!IS_ERR(mmc->supply.vmmc)) { ++ host->ferror = mmc_regulator_set_ocr(mmc, ++ mmc->supply.vmmc, ++ ios->vdd); ++ if (host->ferror) ++ return; ++ } + + if (!IS_ERR(mmc->supply.vqmmc)) { + host->ferror = regulator_enable(mmc->supply.vqmmc); +@@ -847,7 +873,9 @@ static void sunxi_mmc_set_ios(struct mmc + case MMC_POWER_OFF: + dev_dbg(mmc_dev(mmc), "power off!\n"); + sunxi_mmc_reset_host(host); +- mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); ++ if (!IS_ERR(mmc->supply.vmmc)) ++ mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); ++ + if (!IS_ERR(mmc->supply.vqmmc) && host->vqmmc_enabled) + regulator_disable(mmc->supply.vqmmc); + host->vqmmc_enabled = false; +@@ -877,7 +905,7 @@ static void sunxi_mmc_set_ios(struct mmc + mmc_writel(host, REG_GCTRL, rval); + + /* set up clock */ +- if (ios->clock && ios->power_mode) { ++ if (ios->power_mode) { + host->ferror = sunxi_mmc_clk_set_rate(host, ios); + /* Android code had a usleep_range(50000, 55000); here */ + } +@@ -1084,6 +1112,14 @@ static const struct sunxi_mmc_cfg sun50i + .idma_des_size_bits = 16, + .clk_delays = NULL, + .can_calibrate = true, ++ .mask_data0 = true, ++ .needs_new_timings = true, ++}; ++ ++static const struct sunxi_mmc_cfg sun50i_a64_emmc_cfg = { ++ .idma_des_size_bits = 13, ++ .clk_delays = NULL, ++ .can_calibrate = true, + }; + + static const struct of_device_id sunxi_mmc_of_match[] = { +@@ -1092,6 +1128,7 @@ static const struct of_device_id sunxi_m + { .compatible = "allwinner,sun7i-a20-mmc", .data = &sun7i_a20_cfg }, + { .compatible = "allwinner,sun9i-a80-mmc", .data = &sun9i_a80_cfg }, + { .compatible = "allwinner,sun50i-a64-mmc", .data = &sun50i_a64_cfg }, ++ { .compatible = "allwinner,sun50i-a64-emmc", .data = &sun50i_a64_emmc_cfg }, + { /* sentinel */ } + }; + MODULE_DEVICE_TABLE(of, sunxi_mmc_of_match); diff --git a/target/linux/sunxi/patches-4.9/205-arm-dts-sun8i-add-support-for-nanopi-m1-plus-board.patch b/target/linux/sunxi/patches-4.9/205-arm-dts-sun8i-add-support-for-nanopi-m1-plus-board.patch new file mode 100644 index 0000000000..d0ee8edd14 --- /dev/null +++ b/target/linux/sunxi/patches-4.9/205-arm-dts-sun8i-add-support-for-nanopi-m1-plus-board.patch @@ -0,0 +1,168 @@ +From 2ed2388bc0c5b7d04c7b079d673ce61a0333c818 Mon Sep 17 00:00:00 2001 +From: Jagan Teki +Date: Tue, 30 May 2017 17:42:50 +0000 +Subject: ARM: dts: sun8i: h3: Add initial NanoPi M1 Plus support + +Backported support from kernel 4.13 with the following changes: +- Added WiFi node +- Added Ethernet node +- Added eMMC node + +Original commit message: +NanoPi M1 Plus is designed and developed by FriendlyElec +for professionals, enterprise users, makers and hobbyists +using the Allwinner H3 SOC. + +NanoPi M1 Plus key features +- Allwinner H3, Quad-core Cortex-A7@1.2GHz +- 1GB DDR3 RAM +- 8GB eMMC +- microSD slot +- 10/100/1000M Ethernet +- Serial Debug Port +- 5V 2A DC power-supply + +Signed-off-by: Jagan Teki +Signed-off-by: Maxime Ripard +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -821,6 +821,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \ + sun8i-a83t-cubietruck-plus.dtb \ + sun8i-h2-plus-orangepi-r1.dtb \ + sun8i-h3-bananapi-m2-plus.dtb \ ++ sun8i-h3-nanopi-m1-plus.dtb \ + sun8i-h3-nanopi-neo.dtb \ + sun8i-h3-orangepi-2.dtb \ + sun8i-h3-orangepi-lite.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts +@@ -0,0 +1,129 @@ ++/* ++ * Copyright (C) 2017 Jagan Teki ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file 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. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++#include "sun8i-h3-nanopi.dtsi" ++ ++/ { ++ model = "FriendlyArm NanoPi M1 Plus"; ++ compatible = "friendlyarm,nanopi-m1-plus", "allwinner,sun8i-h3"; ++ ++ aliases { ++ ethernet0 = &emac; ++ }; ++ ++ pwrseq_wifi: pwrseq0 { ++ compatible = "mmc-pwrseq-simple"; ++ pinctrl-names = "default"; ++ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */ ++ }; ++ ++ reg_gmac_3v3: gmac-3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "gmac-3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ startup-delay-us = <100000>; ++ enable-active-high; ++ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */ ++ }; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&ehci2 { ++ status = "okay"; ++}; ++ ++&emac { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emac_rgmii_pins>; ++ phy-supply = <®_gmac_3v3>; ++ phy-handle = <&ext_rgmii_phy>; ++ phy-mode = "rgmii"; ++ status = "okay"; ++}; ++ ++&mdio { ++ ext_rgmii_phy: ethernet-phy@7 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <7>; ++ }; ++}; ++ ++&mmc1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc1_pins_a>; ++ vmmc-supply = <®_vcc3v3>; ++ vqmmc-supply = <®_vcc3v3>; ++ mmc-pwrseq = <&pwrseq_wifi>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++ ++ brcmf: wifi@1 { ++ reg = <1>; ++ compatible = "brcm,bcm4329-fmac"; ++ interrupt-parent = <&pio>; ++ interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */ ++ interrupt-names = "host-wake"; ++ }; ++}; ++ ++&mmc2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc2_8bit_pins>; ++ vmmc-supply = <®_vcc3v3>; ++ vqmmc-supply = <®_vcc3v3>; ++ bus-width = <8>; ++ non-removable; ++ status = "okay"; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++&ohci2 { ++ status = "okay"; ++}; diff --git a/target/linux/uml/Makefile b/target/linux/uml/Makefile index 6967e403cb..0b46032924 100644 --- a/target/linux/uml/Makefile +++ b/target/linux/uml/Makefile @@ -22,7 +22,7 @@ BOARDNAME:=User Mode Linux FEATURES:=squashfs ext4 audio source-only MAINTAINER:=Florian Fainelli -KERNEL_PATCHVER:=4.4 +KERNEL_PATCHVER:=4.9 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/uml/README b/target/linux/uml/README index d7cba1de9c..aa7bad91ae 100644 --- a/target/linux/uml/README +++ b/target/linux/uml/README @@ -1,4 +1,4 @@ -LEDE inside a user mode linux. Why would we even want this many ask? +OpenWrt inside a user mode linux. Why would we even want this many ask? There are potentially a lot of reasons, one obvious one to me, it allows folks to 'kick the tires' without actually flashing up any hardware. It's @@ -17,7 +17,8 @@ build it all In your bin directory you will find a kernel and an ext4 root file system when it's finished. Just run it like this:- -bin/targets/uml/generic/lede-uml-vmlinux ubd0=bin/targets/uml/generic/lede-uml-ext4.img +bin/targets/uml/generic/lede-uml-vmlinux +ubd0=bin/targets/uml/generic/openwrt-uml-ext4.img The uml will start, and eventually the serial console of the uml will be at your console prompt. If you would like it in xterms, substitute con=xterm and con0=xterm. diff --git a/target/linux/uml/patches-4.9/000-um-Avoid-longjmp-setjmp-symbol-clashes-with-libpthre.patch b/target/linux/uml/patches-4.9/000-um-Avoid-longjmp-setjmp-symbol-clashes-with-libpthre.patch new file mode 100644 index 0000000000..02149eea7a --- /dev/null +++ b/target/linux/uml/patches-4.9/000-um-Avoid-longjmp-setjmp-symbol-clashes-with-libpthre.patch @@ -0,0 +1,130 @@ +From f44f1e7da7c8e3f4575d5d61c4df978496903fcc Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Tue, 23 May 2017 17:32:31 -0700 +Subject: [PATCH] um: Avoid longjmp/setjmp symbol clashes with libpthread.a + +[ Upstream commit f44f1e7da7c8e3f4575d5d61c4df978496903fcc ] + +Building a statically linked UML kernel on a Centos 6.9 host resulted in +the following linking failure (GCC 4.4, glibc-2.12): + +/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libpthread.a(libpthread.o): +In function `siglongjmp': +(.text+0x8490): multiple definition of `longjmp' +arch/x86/um/built-in.o:/local/users/fainelli/openwrt/trunk/build_dir/target-x86_64_musl/linux-uml/linux-4.4.69/arch/x86/um/setjmp_64.S:44: +first defined here +/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libpthread.a(libpthread.o): +In function `sem_open': +(.text+0x77cd): warning: the use of `mktemp' is dangerous, better use +`mkstemp' +collect2: ld returned 1 exit status +make[4]: *** [vmlinux] Error 1 + +Adopt a solution similar to the one done for vmap where we define +longjmp/setjmp to be kernel_longjmp/setjmp. In the process, make sure we +do rename the functions in arch/x86/um/setjmp_*.S accordingly. + +Fixes: a7df4716d195 ("um: link with -lpthread") +Signed-off-by: Florian Fainelli +Signed-off-by: Richard Weinberger +--- + arch/um/Makefile | 4 ++++ + arch/x86/um/setjmp_32.S | 16 ++++++++-------- + arch/x86/um/setjmp_64.S | 16 ++++++++-------- + 3 files changed, 20 insertions(+), 16 deletions(-) + +--- a/arch/um/Makefile ++++ b/arch/um/Makefile +@@ -59,10 +59,14 @@ KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_D + # Same things for in6addr_loopback and mktime - found in libc. For these two we + # only get link-time error, luckily. + # ++# -Dlongjmp=kernel_longjmp prevents anything from referencing the libpthread.a ++# embedded copy of longjmp, same thing for setjmp. ++# + # These apply to USER_CFLAGS to. + + KBUILD_CFLAGS += $(CFLAGS) $(CFLAGS-y) -D__arch_um__ \ + $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \ ++ -Dlongjmp=kernel_longjmp -Dsetjmp=kernel_setjmp \ + -Din6addr_loopback=kernel_in6addr_loopback \ + -Din6addr_any=kernel_in6addr_any -Dstrrchr=kernel_strrchr + +--- a/arch/x86/um/setjmp_32.S ++++ b/arch/x86/um/setjmp_32.S +@@ -16,9 +16,9 @@ + + .text + .align 4 +- .globl setjmp +- .type setjmp, @function +-setjmp: ++ .globl kernel_setjmp ++ .type kernel_setjmp, @function ++kernel_setjmp: + #ifdef _REGPARM + movl %eax,%edx + #else +@@ -35,13 +35,13 @@ setjmp: + movl %ecx,20(%edx) # Return address + ret + +- .size setjmp,.-setjmp ++ .size kernel_setjmp,.-kernel_setjmp + + .text + .align 4 +- .globl longjmp +- .type longjmp, @function +-longjmp: ++ .globl kernel_longjmp ++ .type kernel_longjmp, @function ++kernel_longjmp: + #ifdef _REGPARM + xchgl %eax,%edx + #else +@@ -55,4 +55,4 @@ longjmp: + movl 16(%edx),%edi + jmp *20(%edx) + +- .size longjmp,.-longjmp ++ .size kernel_longjmp,.-kernel_longjmp +--- a/arch/x86/um/setjmp_64.S ++++ b/arch/x86/um/setjmp_64.S +@@ -18,9 +18,9 @@ + + .text + .align 4 +- .globl setjmp +- .type setjmp, @function +-setjmp: ++ .globl kernel_setjmp ++ .type kernel_setjmp, @function ++kernel_setjmp: + pop %rsi # Return address, and adjust the stack + xorl %eax,%eax # Return value + movq %rbx,(%rdi) +@@ -34,13 +34,13 @@ setjmp: + movq %rsi,56(%rdi) # Return address + ret + +- .size setjmp,.-setjmp ++ .size kernel_setjmp,.-kernel_setjmp + + .text + .align 4 +- .globl longjmp +- .type longjmp, @function +-longjmp: ++ .globl kernel_longjmp ++ .type kernel_longjmp, @function ++kernel_longjmp: + movl %esi,%eax # Return value (int) + movq (%rdi),%rbx + movq 8(%rdi),%rsp +@@ -51,4 +51,4 @@ longjmp: + movq 48(%rdi),%r15 + jmp *56(%rdi) + +- .size longjmp,.-longjmp ++ .size kernel_longjmp,.-kernel_longjmp diff --git a/target/linux/uml/patches-4.9/001-um-Allow-building-and-running-on-older-hosts.patch b/target/linux/uml/patches-4.9/001-um-Allow-building-and-running-on-older-hosts.patch new file mode 100644 index 0000000000..501cca82f7 --- /dev/null +++ b/target/linux/uml/patches-4.9/001-um-Allow-building-and-running-on-older-hosts.patch @@ -0,0 +1,99 @@ +From 0a987645672ebde7844a9c0732a5a25f3d4bb6c6 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Thu, 25 May 2017 11:36:26 -0700 +Subject: [PATCH] um: Allow building and running on older hosts + +[ Upstream commit 0a987645672ebde7844a9c0732a5a25f3d4bb6c6 ] + +Commit a78ff1112263 ("um: add extended processor state save/restore +support") and b6024b21fec8 ("um: extend fpstate to _xstate to support +YMM registers") forced the use of the x86 FP _xstate and +PTRACE_GETREGSET/SETREGSET. On older hosts, we would neither be able to +build UML nor run it anymore with these two commits applied because we +don't have definitions for struct _xstate nor these two ptrace requests. + +We can determine at build time which fp context structure to check +against, just like we can keep using the old i387 fp save/restore if +PTRACE_GETRESET/SETREGSET are not defined. + +Fixes: a78ff1112263 ("um: add extended processor state save/restore support") +Fixes: b6024b21fec8 ("um: extend fpstate to _xstate to support YMM registers") +Signed-off-by: Florian Fainelli +Signed-off-by: Richard Weinberger +--- + arch/x86/um/os-Linux/registers.c | 12 ++++++++---- + arch/x86/um/user-offsets.c | 4 ++++ + 2 files changed, 12 insertions(+), 4 deletions(-) + +--- a/arch/x86/um/os-Linux/registers.c ++++ b/arch/x86/um/os-Linux/registers.c +@@ -26,6 +26,7 @@ int save_i387_registers(int pid, unsigne + + int save_fp_registers(int pid, unsigned long *fp_regs) + { ++#ifdef PTRACE_GETREGSET + struct iovec iov; + + if (have_xstate_support) { +@@ -34,9 +35,9 @@ int save_fp_registers(int pid, unsigned + if (ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov) < 0) + return -errno; + return 0; +- } else { ++ } else ++#endif + return save_i387_registers(pid, fp_regs); +- } + } + + int restore_i387_registers(int pid, unsigned long *fp_regs) +@@ -48,6 +49,7 @@ int restore_i387_registers(int pid, unsi + + int restore_fp_registers(int pid, unsigned long *fp_regs) + { ++#ifdef PTRACE_SETREGSET + struct iovec iov; + + if (have_xstate_support) { +@@ -56,9 +58,9 @@ int restore_fp_registers(int pid, unsign + if (ptrace(PTRACE_SETREGSET, pid, NT_X86_XSTATE, &iov) < 0) + return -errno; + return 0; +- } else { ++ } else ++#endif + return restore_i387_registers(pid, fp_regs); +- } + } + + #ifdef __i386__ +@@ -122,6 +124,7 @@ int put_fp_registers(int pid, unsigned l + + void arch_init_registers(int pid) + { ++#ifdef PTRACE_GETREGSET + struct _xstate fp_regs; + struct iovec iov; + +@@ -129,6 +132,7 @@ void arch_init_registers(int pid) + iov.iov_len = sizeof(struct _xstate); + if (ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov) == 0) + have_xstate_support = 1; ++#endif + } + #endif + +--- a/arch/x86/um/user-offsets.c ++++ b/arch/x86/um/user-offsets.c +@@ -50,7 +50,11 @@ void foo(void) + DEFINE(HOST_GS, GS); + DEFINE(HOST_ORIG_AX, ORIG_EAX); + #else ++#if defined(PTRACE_GETREGSET) && defined(PTRACE_SETREGSET) + DEFINE(HOST_FP_SIZE, sizeof(struct _xstate) / sizeof(unsigned long)); ++#else ++ DEFINE(HOST_FP_SIZE, sizeof(struct _fpstate) / sizeof(unsigned long)); ++#endif + DEFINE_LONGS(HOST_BX, RBX); + DEFINE_LONGS(HOST_CX, RCX); + DEFINE_LONGS(HOST_DI, RDI); diff --git a/target/linux/uml/patches-4.9/002-um-Correctly-check-for-PTRACE_GETRESET-SETREGSET.patch b/target/linux/uml/patches-4.9/002-um-Correctly-check-for-PTRACE_GETRESET-SETREGSET.patch new file mode 100644 index 0000000000..79beb823c2 --- /dev/null +++ b/target/linux/uml/patches-4.9/002-um-Correctly-check-for-PTRACE_GETRESET-SETREGSET.patch @@ -0,0 +1,29 @@ +From 61e8d462457f202bf0c6393133425ad387825e22 Mon Sep 17 00:00:00 2001 +From: Richard Weinberger +Date: Thu, 6 Jul 2017 09:35:27 +0200 +Subject: [PATCH] um: Correctly check for PTRACE_GETRESET/SETREGSET + +[ Upstream commit 61e8d462457f202bf0c6393133425ad387825e22 ] + +When checking for PTRACE_GETRESET/SETREGSET, make sure that +the correct header file is included. We need linux/ptrace.h +which contains all ptrace UAPI related defines. +Otherwise #if defined(PTRACE_GETRESET) is always false. + +Cc: Florian Fainelli +Signed-off-by: Richard Weinberger +--- + arch/x86/um/user-offsets.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/um/user-offsets.c ++++ b/arch/x86/um/user-offsets.c +@@ -5,7 +5,7 @@ + #include + #include + #define __FRAME_OFFSETS +-#include ++#include + #include + + #ifdef __i386__ diff --git a/target/linux/uml/patches-4.9/003-um-Fix-check-for-_xstate-for-older-hosts.patch b/target/linux/uml/patches-4.9/003-um-Fix-check-for-_xstate-for-older-hosts.patch new file mode 100644 index 0000000000..b31ca4191b --- /dev/null +++ b/target/linux/uml/patches-4.9/003-um-Fix-check-for-_xstate-for-older-hosts.patch @@ -0,0 +1,46 @@ +From 2fb44600fe784449404c6639de26af8361999ec7 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Tue, 18 Jul 2017 16:43:47 -0700 +Subject: [PATCH] um: Fix check for _xstate for older hosts + +Commit 0a987645672e ("um: Allow building and running on older +hosts") attempted to check for PTRACE_{GET,SET}REGSET under the premise +that these ptrace(2) parameters were directly linked with the presence +of the _xstate structure. + +After Richard's commit 61e8d462457f ("um: Correctly check for +PTRACE_GETRESET/SETREGSET") which properly included linux/ptrace.h +instead of asm/ptrace.h, we could get into the original build failure +that I reported: + +arch/x86/um/user-offsets.c: In function 'foo': +arch/x86/um/user-offsets.c:54: error: invalid application of 'sizeof' to +incomplete type 'struct _xstate' + +On this particular host, we do have PTRACE_GETREGSET and +PTRACE_SETREGSET defined in linux/ptrace.h, but not the structure +_xstate that should be pulled from the following include chain: signal.h +-> bits/sigcontext.h. + +Correctly fix this by checking for FP_XSTATE_MAGIC1 which is the correct +way to see if struct _xstate is available or not on the host. + +Fixes: 61e8d462457f ("um: Correctly check for PTRACE_GETRESET/SETREGSET") +Fixes: 0a987645672e ("um: Allow building and running on older hosts") +Signed-off-by: Florian Fainelli +Signed-off-by: Richard Weinberger +--- + arch/x86/um/user-offsets.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/um/user-offsets.c ++++ b/arch/x86/um/user-offsets.c +@@ -50,7 +50,7 @@ void foo(void) + DEFINE(HOST_GS, GS); + DEFINE(HOST_ORIG_AX, ORIG_EAX); + #else +-#if defined(PTRACE_GETREGSET) && defined(PTRACE_SETREGSET) ++#ifdef FP_XSTATE_MAGIC1 + DEFINE(HOST_FP_SIZE, sizeof(struct _xstate) / sizeof(unsigned long)); + #else + DEFINE(HOST_FP_SIZE, sizeof(struct _fpstate) / sizeof(unsigned long)); diff --git a/target/linux/uml/patches-4.9/101-mconsole-exec.patch b/target/linux/uml/patches-4.9/101-mconsole-exec.patch new file mode 100644 index 0000000000..6682338f39 --- /dev/null +++ b/target/linux/uml/patches-4.9/101-mconsole-exec.patch @@ -0,0 +1,211 @@ +# +# Minimalist mconsole exec patch +# +# 3.10 version (with bit more synchronous behavior) by fingon at iki dot fi +# Adaptation to kernel 3.3.8 made by David Fernández (david at dit.upm.es) for +# Starting point: mconsole-exec-2.6.30.patch for kernel 2.6.30 +# Author of original patch: Paolo Giarrusso, aka Blaisorblade +# (http://www.user-mode-linux.org/~blaisorblade) +# +# Known misfeatures: +# +# - If output is too long, blocks (and breaks horribly) +# (this misfeature from 3.10 patches, when minimalizing the patch; +# workaround: redirect to a shared filesystem if long output is expected) +# +# - Nothing useful is done with stdin +# +--- a/arch/um/drivers/mconsole.h ++++ b/arch/um/drivers/mconsole.h +@@ -85,6 +85,7 @@ extern void mconsole_cad(struct mc_reque + extern void mconsole_stop(struct mc_request *req); + extern void mconsole_go(struct mc_request *req); + extern void mconsole_log(struct mc_request *req); ++extern void mconsole_exec(struct mc_request *req); + extern void mconsole_proc(struct mc_request *req); + extern void mconsole_stack(struct mc_request *req); + +--- a/arch/um/drivers/mconsole_kern.c ++++ b/arch/um/drivers/mconsole_kern.c +@@ -4,6 +4,7 @@ + * Licensed under the GPL + */ + ++#include "linux/kmod.h" + #include + #include + #include +@@ -24,6 +25,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -121,6 +123,59 @@ void mconsole_log(struct mc_request *req + mconsole_reply(req, "", 0, 0); + } + ++void mconsole_exec(struct mc_request *req) ++{ ++ struct subprocess_info *sub_info; ++ int res, len; ++ struct file *out; ++ char buf[MCONSOLE_MAX_DATA]; ++ ++ char *envp[] = { ++ "HOME=/", "TERM=linux", ++ "PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin", ++ NULL ++ }; ++ char *argv[] = { ++ "/bin/sh", "-c", ++ req->request.data + strlen("exec "), ++ NULL ++ }; ++ ++ sub_info = call_usermodehelper_setup("/bin/sh", argv, envp, GFP_ATOMIC, NULL, NULL, NULL); ++ if (sub_info == NULL) { ++ mconsole_reply(req, "call_usermodehelper_setup failed", 1, 0); ++ return; ++ } ++ res = call_usermodehelper_stdoutpipe(sub_info, &out); ++ if (res < 0) { ++ kfree(sub_info); ++ mconsole_reply(req, "call_usermodehelper_stdoutpipe failed", 1, 0); ++ return; ++ } ++ ++ res = call_usermodehelper_exec(sub_info, UMH_WAIT_PROC); ++ if (res < 0) { ++ kfree(sub_info); ++ mconsole_reply(req, "call_usermodehelper_exec failed", 1, 0); ++ return; ++ } ++ ++ for (;;) { ++ len = out->f_op->read(out, buf, sizeof(buf), &out->f_pos); ++ if (len < 0) { ++ mconsole_reply(req, "reading output failed", 1, 0); ++ break; ++ } ++ if (len == 0) ++ break; ++ mconsole_reply_len(req, buf, len, 0, 1); ++ } ++ fput(out); ++ ++ mconsole_reply_len(req, NULL, 0, 0, 0); ++} ++ ++ + void mconsole_proc(struct mc_request *req) + { + struct vfsmount *mnt = task_active_pid_ns(current)->proc_mnt; +@@ -187,6 +242,7 @@ void mconsole_proc(struct mc_request *re + stop - pause the UML; it will do nothing until it receives a 'go' \n\ + go - continue the UML after a 'stop' \n\ + log - make UML enter into the kernel log\n\ ++ exec - pass to /bin/sh -c synchronously\n\ + proc - returns the contents of the UML's /proc/\n\ + stack - returns the stack of the specified pid\n\ + " +--- a/arch/um/drivers/mconsole_user.c ++++ b/arch/um/drivers/mconsole_user.c +@@ -30,6 +30,7 @@ static struct mconsole_command commands[ + { "stop", mconsole_stop, MCONSOLE_PROC }, + { "go", mconsole_go, MCONSOLE_INTR }, + { "log", mconsole_log, MCONSOLE_INTR }, ++ { "exec", mconsole_exec, MCONSOLE_PROC }, + { "proc", mconsole_proc, MCONSOLE_PROC }, + { "stack", mconsole_stack, MCONSOLE_INTR }, + }; +--- a/arch/um/os-Linux/file.c ++++ b/arch/um/os-Linux/file.c +@@ -554,6 +554,8 @@ int os_create_unix_socket(const char *fi + + addr.sun_family = AF_UNIX; + ++ if (len > sizeof(addr.sun_path)) ++ len = sizeof(addr.sun_path); + snprintf(addr.sun_path, len, "%s", file); + + err = bind(sock, (struct sockaddr *) &addr, sizeof(addr)); +--- a/include/linux/kmod.h ++++ b/include/linux/kmod.h +@@ -62,6 +62,7 @@ struct subprocess_info { + int wait; + int retval; + int (*init)(struct subprocess_info *info, struct cred *new); ++ struct file *stdout; + void (*cleanup)(struct subprocess_info *info); + void *data; + }; +@@ -102,4 +103,6 @@ extern int usermodehelper_read_trylock(v + extern long usermodehelper_read_lock_wait(long timeout); + extern void usermodehelper_read_unlock(void); + ++int call_usermodehelper_stdoutpipe(struct subprocess_info *sub_info, struct file **filp); ++ + #endif /* __LINUX_KMOD_H__ */ +--- a/kernel/kmod.c ++++ b/kernel/kmod.c +@@ -39,6 +39,7 @@ + #include + #include + #include ++#include + #include + + #include +@@ -222,6 +223,28 @@ static int call_usermodehelper_exec_asyn + flush_signal_handlers(current, 1); + spin_unlock_irq(¤t->sighand->siglock); + ++ /* Install output when needed */ ++ if (sub_info->stdout) { ++ struct files_struct *f = current->files; ++ struct fdtable *fdt; ++ ++ sys_close(1); ++ sys_close(2); ++ get_file(sub_info->stdout); ++ fd_install(1, sub_info->stdout); ++ fd_install(2, sub_info->stdout); ++ spin_lock(&f->file_lock); ++ fdt = files_fdtable(f); ++ __set_bit(1, fdt->open_fds); ++ __clear_bit(1, fdt->close_on_exec); ++ __set_bit(2, fdt->open_fds); ++ __clear_bit(2, fdt->close_on_exec); ++ spin_unlock(&f->file_lock); ++ ++ /* disallow core files */ ++ current->signal->rlim[RLIMIT_CORE] = (struct rlimit){0, 0}; ++ } ++ + /* + * Our parent (unbound workqueue) runs with elevated scheduling + * priority. Avoid propagating that into the userspace child. +@@ -540,6 +563,20 @@ struct subprocess_info *call_usermodehel + } + EXPORT_SYMBOL(call_usermodehelper_setup); + ++int call_usermodehelper_stdoutpipe(struct subprocess_info *sub_info, ++ struct file **filp) ++{ ++ struct file *f[2]; ++ ++ if (create_pipe_files(f, 0)<0) ++ return PTR_ERR(f); ++ sub_info->stdout = f[1]; ++ *filp = f[0]; ++ return 0; ++} ++EXPORT_SYMBOL(call_usermodehelper_stdoutpipe); ++ ++ + /** + * call_usermodehelper_exec - start a usermode application + * @sub_info: information about the subprocessa diff --git a/target/linux/uml/patches-4.9/102-pseudo-random-mac.patch b/target/linux/uml/patches-4.9/102-pseudo-random-mac.patch new file mode 100644 index 0000000000..a31d75ff38 --- /dev/null +++ b/target/linux/uml/patches-4.9/102-pseudo-random-mac.patch @@ -0,0 +1,131 @@ +=============================================================================== + +This patch makes MAC addresses of network interfaces predictable. In +particular, it adds a small routine that computes MAC addresses of based on +a SHA1 hash of the virtual machine name and interface ID. + +TECHNICAL INFORMATION: + +Applies to vanilla kernel 3.9.4. + +=============================================================================== +--- a/arch/um/Kconfig.net ++++ b/arch/um/Kconfig.net +@@ -21,6 +21,19 @@ config UML_NET + enable at least one of the following transport options to actually + make use of UML networking. + ++config UML_NET_RANDOM_MAC ++ bool "Use random MAC addresses for network interfaces" ++ default n ++ depends on UML_NET ++ help ++ Virtual network devices inside a User-Mode Linux instance must be ++ assigned a MAC (Ethernet) address. If none is specified on the UML ++ command line, one must be automatically computed. If this option is ++ enabled, a randomly generated address is used. Otherwise, if this ++ option is disabled, the address is generated from a SHA1 hash of ++ the umid of the UML instance and the interface name. The latter choice ++ is useful to make MAC addresses predictable. ++ + config UML_NET_ETHERTAP + bool "Ethertap transport" + depends on UML_NET +--- a/arch/um/drivers/net_kern.c ++++ b/arch/um/drivers/net_kern.c +@@ -25,6 +25,14 @@ + #include + #include + ++#include ++#include ++#include ++#include ++#include ++#include ++#include "os.h" ++ + #define DRIVER_NAME "uml-netdev" + + static DEFINE_SPINLOCK(opened_lock); +@@ -295,11 +303,53 @@ static void uml_net_user_timer_expire(un + #endif + } + ++#ifndef CONFIG_UML_NET_RANDOM_MAC ++ ++/* Compute a SHA1 hash of the UML instance's id and ++ * * an interface name. */ ++static int compute_hash(const char *umid, const char *ifname, char *hash) ++{ ++ struct ahash_request *desc; ++ struct crypto_ahash *tfm; ++ struct scatterlist sg; ++ char vmif[1024]; ++ int ret; ++ ++ strcpy (vmif, umid); ++ strcat (vmif, ifname); ++ ++ tfm = crypto_alloc_ahash("sha1", 0, CRYPTO_ALG_ASYNC); ++ if (IS_ERR(tfm)) ++ return -ENOMEM; ++ ++ desc = ahash_request_alloc(tfm, GFP_KERNEL); ++ if (!desc) { ++ ret = -ENOMEM; ++ goto out; ++ } ++ ++ crypto_ahash_clear_flags(tfm, ~0); ++ ++ sg_init_table(&sg, 1); ++ sg_set_buf(&sg, vmif, strlen(vmif)); ++ ++ ahash_request_set_crypt(desc, &sg, hash, strlen(vmif)); ++ ++ ret = crypto_ahash_digest(desc); ++out: ++ crypto_free_ahash(tfm); ++ ++ return ret; ++} ++ ++#endif ++ + static void setup_etheraddr(struct net_device *dev, char *str) + { + unsigned char *addr = dev->dev_addr; + char *end; + int i; ++ u8 hash[SHA1_DIGEST_SIZE]; + + if (str == NULL) + goto random; +@@ -340,9 +390,26 @@ static void setup_etheraddr(struct net_d + return; + + random: ++#ifdef CONFIG_UML_NET_RANDOM_MAC + printk(KERN_INFO + "Choosing a random ethernet address for device %s\n", dev->name); + eth_hw_addr_random(dev); ++#else ++ printk(KERN_INFO ++ "Computing a digest to use as ethernet address for device %s\n", dev->name); ++ if (compute_hash(get_umid(), dev->name, hash) < 0) { ++ printk(KERN_WARNING ++ "Could not compute digest to use as ethernet address for device %s. " ++ "Using random address instead.\n", dev->name); ++ random_ether_addr(addr); ++ } ++ else { ++ for (i=0; i < 6; i++) ++ addr[i] = (hash[i] + hash[i+6]) % 0x100; ++ } ++ addr [0] &= 0xfe; /* clear multicast bit */ ++ addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ ++#endif + } + + static DEFINE_SPINLOCK(devices_lock); diff --git a/target/linux/x86/64/config-default b/target/linux/x86/64/config-default index 1a3f9150c2..faaba8064e 100644 --- a/target/linux/x86/64/config-default +++ b/target/linux/x86/64/config-default @@ -6,6 +6,7 @@ CONFIG_ACPI_BATTERY=y CONFIG_ACPI_BUTTON=y # CONFIG_ACPI_CMPC is not set CONFIG_ACPI_CONTAINER=y +CONFIG_ACPI_CPPC_LIB=y CONFIG_ACPI_CPU_FREQ_PSS=y # CONFIG_ACPI_CUSTOM_DSDT is not set # CONFIG_ACPI_DEBUG is not set @@ -15,8 +16,8 @@ CONFIG_ACPI_CPU_FREQ_PSS=y CONFIG_ACPI_FAN=y CONFIG_ACPI_HOTPLUG_CPU=y CONFIG_ACPI_HOTPLUG_IOAPIC=y +# CONFIG_ACPI_I2C_OPREGION is not set CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y -# CONFIG_ACPI_NFIT is not set # CONFIG_ACPI_PCI_SLOT is not set CONFIG_ACPI_PROCESSOR=y # CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set @@ -30,9 +31,11 @@ CONFIG_ACPI_THERMAL=y # CONFIG_ACPI_WMI is not set CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig" CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y -CONFIG_ARCH_HAS_GIGANTIC_PAGE=y +CONFIG_ARCH_HAS_ADD_PAGES=y CONFIG_ARCH_HAS_KCOV=y CONFIG_ARCH_HAS_PMEM_API=y +CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE=y +CONFIG_ARCH_HAS_ZONE_DEVICE=y CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y CONFIG_ARCH_MMAP_RND_BITS=28 CONFIG_ARCH_MMAP_RND_BITS_MAX=32 @@ -41,12 +44,13 @@ CONFIG_ARCH_SPARSEMEM_DEFAULT=y CONFIG_ARCH_SUPPORTS_INT128=y CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y -CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y +CONFIG_ARCH_WANTS_THP_SWAP=y CONFIG_AUDIT_ARCH=y CONFIG_BACKLIGHT_CLASS_DEVICE=y CONFIG_BACKLIGHT_GENERIC=y CONFIG_BACKLIGHT_LCD_SUPPORT=y CONFIG_BLK_DEV_INTEGRITY=y +CONFIG_BLK_MQ_VIRTIO=y # CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set CONFIG_CALGARY_IOMMU=y CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y @@ -54,7 +58,6 @@ CONFIG_CONNECTOR=y # CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set CONFIG_CPU_RMAP=y CONFIG_CRC_T10DIF=y -CONFIG_CRYPTO_ABLK_HELPER=y CONFIG_CRYPTO_AEAD=y CONFIG_CRYPTO_AEAD2=y CONFIG_CRYPTO_AES_NI_INTEL=y @@ -70,6 +73,7 @@ CONFIG_CRYPTO_CRCT10DIF=y # CONFIG_CRYPTO_CRCT10DIF_PCLMUL is not set CONFIG_CRYPTO_CRYPTD=y # CONFIG_CRYPTO_DES3_EDE_X86_64 is not set +CONFIG_CRYPTO_ECB=y CONFIG_CRYPTO_GF128MUL=y CONFIG_CRYPTO_GLUE_HELPER_X86=y CONFIG_CRYPTO_LRW=y @@ -87,6 +91,7 @@ CONFIG_CRYPTO_NULL2=y # CONFIG_CRYPTO_SHA256_SSSE3 is not set # CONFIG_CRYPTO_SHA512_MB is not set # CONFIG_CRYPTO_SHA512_SSSE3 is not set +CONFIG_CRYPTO_SIMD=y # CONFIG_CRYPTO_SKEIN is not set # CONFIG_CRYPTO_TWOFISH_AVX_X86_64 is not set # CONFIG_CRYPTO_TWOFISH_X86_64 is not set @@ -99,6 +104,7 @@ CONFIG_EFI=y CONFIG_EFIVAR_FS=m # CONFIG_EFI_BOOTLOADER_CONTROL is not set # CONFIG_EFI_CAPSULE_LOADER is not set +# CONFIG_EFI_DEV_PATH_PARSER is not set CONFIG_EFI_ESRT=y # CONFIG_EFI_FAKE_MEMMAP is not set # CONFIG_EFI_MIXED is not set @@ -117,6 +123,7 @@ CONFIG_FB_DEFERRED_IO=y CONFIG_FB_EFI=y CONFIG_FB_HYPERV=y CONFIG_FB_MODE_HELPERS=y +# CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA is not set CONFIG_FB_SIMPLE=y CONFIG_FB_SYS_COPYAREA=y CONFIG_FB_SYS_FILLRECT=y @@ -135,21 +142,23 @@ CONFIG_FREEZER=y CONFIG_GART_IOMMU=y CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y CONFIG_GENERIC_CPU=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GENERIC_IRQ_MIGRATION=y CONFIG_GENERIC_PENDING_IRQ=y CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_ACPI=y -# CONFIG_GPIO_AMDPT is not set -# CONFIG_GPIO_F7188X is not set CONFIG_GPIO_ICH=y CONFIG_GPIO_IT87=y CONFIG_GPIO_LYNXPOINT=y CONFIG_GPIO_SCH=y CONFIG_GPIO_SYSFS=y +CONFIG_HARDLOCKUP_CHECK_TIMESTAMP=y CONFIG_HAVE_ACPI_APEI=y CONFIG_HAVE_ACPI_APEI_NMI=y # CONFIG_HAVE_AOUT is not set CONFIG_HAVE_ARCH_SOFT_DIRTY=y +CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=y CONFIG_HAVE_ARCH_VMAP_STACK=y CONFIG_HAVE_CONTEXT_TRACKING=y CONFIG_HAVE_EBPF_JIT=y @@ -179,6 +188,7 @@ CONFIG_HVC_IRQ=y CONFIG_HVC_XEN=y CONFIG_HVC_XEN_FRONTEND=y CONFIG_HWMON=y +CONFIG_HWMON_VID=y CONFIG_HW_RANDOM_AMD=y CONFIG_HW_RANDOM_INTEL=y CONFIG_HW_RANDOM_VIRTIO=y @@ -188,20 +198,29 @@ CONFIG_HYPERV_BALLOON=y CONFIG_HYPERV_KEYBOARD=y CONFIG_HYPERV_NET=y CONFIG_HYPERV_STORAGE=y +CONFIG_HYPERV_TSCPAGE=y CONFIG_HYPERV_UTILS=y +# CONFIG_HYPERV_VSOCKETS is not set +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y # CONFIG_I7300_IDLE is not set # CONFIG_IA32_EMULATION is not set CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y CONFIG_INTEL_IDLE=y +# CONFIG_INTEL_INT0002_VGPIO is not set # CONFIG_INTEL_IPS is not set # CONFIG_INTEL_MENLOW is not set # CONFIG_INTEL_MIC_BUS is not set +CONFIG_INTEL_PCH_THERMAL=y # CONFIG_INTEL_PMC_IPC is not set +CONFIG_INTEL_SOC_DTS_IOSF_CORE=y +CONFIG_INTEL_SOC_DTS_THERMAL=y +# CONFIG_INTEL_TURBO_MAX_3 is not set # CONFIG_IOMMU_DEBUG is not set +CONFIG_IOSF_MBI=y +# CONFIG_IOSF_MBI_DEBUG is not set # CONFIG_ISCSI_IBFT_FIND is not set -# CONFIG_ITCO_VENDOR_SUPPORT is not set -CONFIG_ITCO_WDT=y CONFIG_KALLSYMS_ABSOLUTE_PERCPU=y # CONFIG_KVM_DEBUG_FS is not set CONFIG_KVM_GUEST=y @@ -210,10 +229,10 @@ CONFIG_LEDS_GPIO=y # CONFIG_LEGACY_VSYSCALL_EMULATE is not set # CONFIG_LEGACY_VSYSCALL_NATIVE is not set CONFIG_LEGACY_VSYSCALL_NONE=y -# CONFIG_LIQUIDIO is not set CONFIG_LOCK_SPIN_ON_OWNER=y CONFIG_LPC_ICH=y CONFIG_LPC_SCH=y +CONFIG_MAILBOX=y # CONFIG_MAXSMP is not set CONFIG_MEMORY_BALLOON=y # CONFIG_MEMORY_HOTPLUG is not set @@ -236,6 +255,7 @@ CONFIG_NR_CPUS=8 # CONFIG_NUMA is not set CONFIG_OUTPUT_FORMAT="elf64-x86-64" CONFIG_PADATA=y +CONFIG_PAGE_TABLE_ISOLATION=y CONFIG_PARAVIRT=y CONFIG_PARAVIRT_CLOCK=y # CONFIG_PARAVIRT_DEBUG is not set @@ -246,16 +266,18 @@ CONFIG_PATA_MPIIX=y CONFIG_PATA_OLDPIIX=y CONFIG_PATA_PLATFORM=y CONFIG_PATA_VIA=y +CONFIG_PCC=y CONFIG_PCIEAER=y CONFIG_PCIEPORTBUS=y CONFIG_PCIE_PME=y -# CONFIG_PCI_HYPERV is not set +CONFIG_PCI_HYPERV=y # CONFIG_PCI_MMCONFIG is not set CONFIG_PCI_XEN=y CONFIG_PGTABLE_LEVELS=4 CONFIG_PHYSICAL_ALIGN=0x1000000 CONFIG_PM=y # CONFIG_PMIC_OPREGION is not set +CONFIG_PM_CLK=y # CONFIG_PM_DEBUG is not set CONFIG_PM_SLEEP=y CONFIG_PM_SLEEP_SMP=y @@ -268,19 +290,29 @@ CONFIG_QUEUED_RWLOCKS=y CONFIG_QUEUED_SPINLOCKS=y # CONFIG_RANDOMIZE_BASE is not set CONFIG_RAS=y +CONFIG_RCU_NEED_SEGCBLIST=y CONFIG_RCU_STALL_COMMON=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y CONFIG_RELOCATABLE=y +CONFIG_RESET_ATTACK_MITIGATION=y CONFIG_RFS_ACCEL=y CONFIG_RPS=y +CONFIG_RTC_I2C_AND_SPI=y CONFIG_RWSEM_SPIN_ON_OWNER=y # CONFIG_SAMSUNG_Q10 is not set CONFIG_SATA_AHCI=y CONFIG_SCHED_MC=y +CONFIG_SCHED_MC_PRIO=y CONFIG_SCHED_SMT=y # CONFIG_SCIF_BUS is not set CONFIG_SCSI_VIRTIO=y CONFIG_SENSORS_CORETEMP=y +CONFIG_SENSORS_FAM15H_POWER=y +CONFIG_SENSORS_I5500=y CONFIG_SENSORS_K10TEMP=y +CONFIG_SENSORS_K8TEMP=y +CONFIG_SENSORS_VIA_CPUTEMP=y CONFIG_SERIAL_8250_PNP=y CONFIG_SMP=y CONFIG_SPARSEMEM=y @@ -292,14 +324,14 @@ CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y # CONFIG_SURFACE_PRO3_BUTTON is not set CONFIG_SWIOTLB_XEN=y CONFIG_SYS_HYPERVISOR=y -# CONFIG_THUNDER_NIC_BGX is not set -# CONFIG_THUNDER_NIC_PF is not set -# CONFIG_THUNDER_NIC_RGX is not set -# CONFIG_THUNDER_NIC_VF is not set +CONFIG_THERMAL_GOV_USER_SPACE=y +CONFIG_THERMAL_HWMON=y +CONFIG_THERMAL_WRITABLE_TRIPS=y # CONFIG_TOSHIBA_BT_RFKILL is not set CONFIG_TREE_RCU=y +CONFIG_TREE_SRCU=y +# CONFIG_UNWINDER_ORC is not set CONFIG_UCS2_STRING=y -CONFIG_UCSI=y # CONFIG_UNISYSSPAR is not set CONFIG_USB_OHCI_HCD_PCI=y CONFIG_USB_STORAGE=y @@ -307,6 +339,7 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_PCI=y # CONFIG_USB_XHCI_PLATFORM is not set CONFIG_VGACON_SOFT_SCROLLBACK=y +# CONFIG_VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT is not set CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64 CONFIG_VIRTIO=y CONFIG_VIRTIO_BALLOON=y @@ -329,6 +362,7 @@ CONFIG_VMXNET3=y CONFIG_VSOCKETS=y CONFIG_VT_CONSOLE_SLEEP=y CONFIG_WATCHDOG_CORE=y +# CONFIG_X86_5LEVEL is not set CONFIG_X86_64=y CONFIG_X86_64_SMP=y CONFIG_X86_ACPI_CPUFREQ=y @@ -336,14 +370,17 @@ CONFIG_X86_ACPI_CPUFREQ=y CONFIG_X86_AMD_FREQ_SENSITIVITY=y # CONFIG_X86_AMD_PLATFORM_DEVICE is not set CONFIG_X86_CMOV=y +CONFIG_X86_CPUID=y CONFIG_X86_DEBUGCTLMSR=y CONFIG_X86_DEV_DMA_OPS=y CONFIG_X86_DIRECT_GBPAGES=y # CONFIG_X86_INTEL_LPSS is not set # CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS is not set +# CONFIG_X86_INTEL_MPX is not set +CONFIG_X86_INTEL_PSTATE=y CONFIG_X86_MINIMUM_CPU_FAMILY=64 -# CONFIG_X86_MSR is not set # CONFIG_X86_PCC_CPUFREQ is not set +CONFIG_X86_PKG_TEMP_THERMAL=y # CONFIG_X86_PMEM_LEGACY is not set CONFIG_X86_PM_TIMER=y # CONFIG_X86_POWERNOW_K8 is not set @@ -373,8 +410,11 @@ CONFIG_XEN_HAVE_VPMU=y CONFIG_XEN_NETDEV_FRONTEND=y CONFIG_XEN_PCIDEV_FRONTEND=y CONFIG_XEN_PRIVCMD=y +CONFIG_XEN_PV=y CONFIG_XEN_PVH=y CONFIG_XEN_PVHVM=y +CONFIG_XEN_PVHVM_SMP=y +CONFIG_XEN_PV_SMP=y CONFIG_XEN_SAVE_RESTORE=y CONFIG_XEN_SCRUB_PAGES=y CONFIG_XEN_SCSI_FRONTEND=y diff --git a/target/linux/x86/base-files/lib/preinit/01_sysinfo b/target/linux/x86/base-files/lib/preinit/01_sysinfo index cb63a04014..466c831e7e 100644 --- a/target/linux/x86/base-files/lib/preinit/01_sysinfo +++ b/target/linux/x86/base-files/lib/preinit/01_sysinfo @@ -1,3 +1,12 @@ +sanitize_name_x86() { + sed -e ' + y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/; + s/[^a-z0-9_-]\+/-/g; + s/^-//; + s/-$//; + ' "$@" +} + do_sysinfo_x86() { local vendor product file @@ -8,7 +17,14 @@ do_sysinfo_x86() { for file in product_name board_name; do product="$(cat /sys/devices/virtual/dmi/id/$file 2>/dev/null)" - [ -n "$product" ] && break + case "$vendor:$product" in + "Supermicro:Super Server") + continue + ;; + ?*:?*) + break + ;; + esac done [ -n "$vendor" -a -n "$product" ] || return @@ -17,12 +33,7 @@ do_sysinfo_x86() { echo "$vendor $product" > /tmp/sysinfo/model - sed -e ' - y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/; - s/[^a-z0-9_-]\+/-/g; - s/^-//; - s/-$//; - ' /tmp/sysinfo/model > /tmp/sysinfo/board_name + sanitize_name_x86 /tmp/sysinfo/model > /tmp/sysinfo/board_name } boot_hook_add preinit_main do_sysinfo_x86 diff --git a/target/linux/x86/config-4.14 b/target/linux/x86/config-4.14 new file mode 100644 index 0000000000..c742b75d1d --- /dev/null +++ b/target/linux/x86/config-4.14 @@ -0,0 +1,525 @@ +# CONFIG_60XX_WDT is not set +# CONFIG_64BIT is not set +# CONFIG_ACPI is not set +# CONFIG_ACQUIRE_WDT is not set +# CONFIG_ADVANTECH_WDT is not set +# CONFIG_ALIM1535_WDT is not set +# CONFIG_ALIX is not set +CONFIG_AMD_NB=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig" +CONFIG_ARCH_DISCARD_MEMBLOCK=y +CONFIG_ARCH_DMA_ADDR_T_64BIT=y +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y +CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y +CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y +CONFIG_ARCH_HAS_CPU_RELAX=y +CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_ARCH_HAS_FAST_MULTIPLIER=y +CONFIG_ARCH_HAS_FORTIFY_SOURCE=y +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +CONFIG_ARCH_HAS_MEM_ENCRYPT=y +CONFIG_ARCH_HAS_SET_MEMORY=y +CONFIG_ARCH_HAS_SG_CHAIN=y +CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y +CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y +CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y +# CONFIG_ARCH_OPTIONAL_KERNEL_RWX is not set +# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set +CONFIG_ARCH_PHYS_ADDR_T_64BIT=y +CONFIG_ARCH_RANDOM=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y +CONFIG_ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT=y +CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y +CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USES_PG_UNCACHED=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_USE_QUEUED_RWLOCKS=y +CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y +CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y +# CONFIG_ARCH_WANTS_THP_SWAP is not set +CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y +CONFIG_ARCH_WANT_GENERAL_HUGETLB=y +CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ATA=y +CONFIG_ATA_GENERIC=y +CONFIG_ATA_PIIX=y +CONFIG_BINFMT_MISC=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_SD=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BLK_SCSI_REQUEST=y +CONFIG_BOUNCE=y +CONFIG_BTT=y +CONFIG_CLKBLD_I8253=y +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLKEVT_I8253=y +CONFIG_CLKSRC_I8253=y +CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y +CONFIG_CLOCKSOURCE_WATCHDOG=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_COMMON_CLK=y +CONFIG_COMPAT_32=y +# CONFIG_COMPAT_VDSO is not set +CONFIG_CONSOLE_TRANSLATIONS=y +# CONFIG_CPU5_WDT is not set +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set +CONFIG_CPU_FREQ_GOV_ATTR_SET=y +CONFIG_CPU_FREQ_GOV_COMMON=y +# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set +# CONFIG_CPU_FREQ_GOV_USERSPACE is not set +CONFIG_CPU_FREQ_STAT=y +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_SUP_AMD=y +CONFIG_CPU_SUP_CENTAUR=y +CONFIG_CPU_SUP_CYRIX_32=y +CONFIG_CPU_SUP_INTEL=y +CONFIG_CPU_SUP_TRANSMETA_32=y +CONFIG_CPU_SUP_UMC_32=y +# CONFIG_CRASHLOG is not set +CONFIG_CRASH_CORE=y +CONFIG_CRC16=y +CONFIG_CRYPTO_AES_586=y +CONFIG_CRYPTO_CRC32=y +CONFIG_CRYPTO_CRC32C=y +# CONFIG_CRYPTO_CRC32_PCLMUL is not set +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_RNG2=y +# CONFIG_CRYPTO_SERPENT_SSE2_586 is not set +CONFIG_CRYPTO_WORKQUEUE=y +# CONFIG_CX_ECAT is not set +CONFIG_DCACHE_WORD_ACCESS=y +# CONFIG_DCDBAS is not set +# CONFIG_DEBUG_BOOT_PARAMS is not set +# CONFIG_DEBUG_ENTRY is not set +CONFIG_DEBUG_MEMORY_INIT=y +# CONFIG_DEBUG_NMI_SELFTEST is not set +# CONFIG_DEBUG_TLBFLUSH is not set +# CONFIG_DEBUG_VIRTUAL is not set +CONFIG_DECOMPRESS_BZIP2=y +CONFIG_DECOMPRESS_GZIP=y +CONFIG_DEFAULT_IO_DELAY_TYPE=0 +# CONFIG_DELL_RBU is not set +# CONFIG_DMA_NOOP_OPS is not set +# CONFIG_DMA_VIRT_OPS is not set +CONFIG_DMI=y +CONFIG_DMIID=y +CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y +CONFIG_DMI_SYSFS=y +CONFIG_DNOTIFY=y +# CONFIG_DRM_LIB_RANDOM is not set +CONFIG_DUMMY_CONSOLE=y +CONFIG_EARLY_PRINTK=y +# CONFIG_EARLY_PRINTK_DBGP is not set +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +# CONFIG_EDD is not set +# CONFIG_EUROTECH_WDT is not set +CONFIG_EXPORTFS=y +CONFIG_EXT4_FS=y +# CONFIG_F2FS_CHECK_FS is not set +CONFIG_F2FS_FS=y +# CONFIG_F2FS_FS_SECURITY is not set +CONFIG_F2FS_FS_XATTR=y +CONFIG_F2FS_STAT_FS=y +# CONFIG_F71808E_WDT is not set +CONFIG_FIRMWARE_IN_KERNEL=y +CONFIG_FIRMWARE_MEMMAP=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FRAME_POINTER=y +CONFIG_FS_MBCACHE=y +CONFIG_FUSION=y +# CONFIG_FUSION_CTL is not set +# CONFIG_FUSION_LOGGING is not set +CONFIG_FUSION_MAX_SGE=128 +CONFIG_FUSION_SPI=y +CONFIG_FUTEX_PI=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_FIND_FIRST_BIT=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IOMAP=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_MSI_IRQ=y +CONFIG_GENERIC_MSI_IRQ_DOMAIN=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GENERIC_TIME_VSYSCALL=y +# CONFIG_GEOS is not set +CONFIG_GLOB=y +# CONFIG_GRO_CELLS is not set +# CONFIG_HANGCHECK_TIMER is not set +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set +CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y +CONFIG_HAVE_AOUT=y +CONFIG_HAVE_ARCH_AUDITSYSCALL=y +# CONFIG_HAVE_ARCH_BITREVERSE is not set +CONFIG_HAVE_ARCH_HUGE_VMAP=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_KMEMCHECK=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y +CONFIG_HAVE_ATOMIC_IOMAP=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_CC_STACKPROTECTOR=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_HAVE_CMPXCHG_DOUBLE=y +CONFIG_HAVE_CMPXCHG_LOCAL=y +CONFIG_HAVE_COPY_THREAD_TLS=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DEBUG_STACKOVERFLOW=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y +CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_GENERIC_GUP=y +CONFIG_HAVE_HARDLOCKUP_DETECTOR_PERF=y +CONFIG_HAVE_HW_BREAKPOINT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_IOREMAP_PROT=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_KPROBES_ON_FTRACE=y +CONFIG_HAVE_KVM=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MEMBLOCK_NODE_MAP=y +CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y +CONFIG_HAVE_MMIOTRACE_SUPPORT=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_OPTPROBES=y +CONFIG_HAVE_PCSPKR_PLATFORM=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_PERF_EVENTS_NMI=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_RCU_TABLE_FREE=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_SETUP_PER_CPU_AREA=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_UID16=y +CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y +CONFIG_HAVE_USER_RETURN_NOTIFIER=y +CONFIG_HID=y +CONFIG_HIGHMEM=y +# CONFIG_HIGHMEM4G is not set +CONFIG_HIGHMEM64G=y +# CONFIG_HIGHPTE is not set +CONFIG_HPET_EMULATE_RTC=y +CONFIG_HPET_TIMER=y +# CONFIG_HP_WATCHDOG is not set +CONFIG_HT_IRQ=y +# CONFIG_HUGETLBFS is not set +CONFIG_HW_CONSOLE=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_GEODE=y +CONFIG_HW_RANDOM_VIA=y +# CONFIG_HYPERVISOR_GUEST is not set +CONFIG_HZ_PERIODIC=y +CONFIG_I8253_LOCK=y +# CONFIG_I8K is not set +# CONFIG_IB700_WDT is not set +# CONFIG_IBMASR is not set +# CONFIG_IBM_RTL is not set +# CONFIG_IE6XX_WDT is not set +CONFIG_ILLEGAL_POINTER_VALUE=0 +CONFIG_INITRAMFS_SOURCE="" +CONFIG_INPUT=y +CONFIG_INPUT_KEYBOARD=y +CONFIG_INSTRUCTION_DECODER=y +# CONFIG_INTEL_PCH_THERMAL is not set +# CONFIG_INTEL_POWERCLAMP is not set +# CONFIG_INTEL_RDT is not set +# CONFIG_INTEL_SOC_DTS_THERMAL is not set +CONFIG_IOMMU_HELPER=y +# CONFIG_IOMMU_STRESS is not set +# CONFIG_IOSF_MBI is not set +CONFIG_IO_DELAY_0X80=y +# CONFIG_IO_DELAY_0XED is not set +# CONFIG_IO_DELAY_NONE is not set +CONFIG_IO_DELAY_TYPE_0X80=0 +CONFIG_IO_DELAY_TYPE_0XED=1 +CONFIG_IO_DELAY_TYPE_NONE=3 +CONFIG_IO_DELAY_TYPE_UDELAY=2 +# CONFIG_IO_DELAY_UDELAY is not set +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +# CONFIG_ISA is not set +CONFIG_ISA_DMA_API=y +# CONFIG_IT8712F_WDT is not set +# CONFIG_IT87_WDT is not set +# CONFIG_ITCO_WDT is not set +CONFIG_JBD2=y +CONFIG_KALLSYMS=y +CONFIG_KEXEC=y +CONFIG_KEXEC_CORE=y +CONFIG_KEYBOARD_ATKBD=y +# CONFIG_LEDS_CLEVO_MAIL is not set +CONFIG_LIBNVDIMM=y +# CONFIG_M486 is not set +# CONFIG_M586 is not set +CONFIG_M586MMX=y +# CONFIG_M586TSC is not set +# CONFIG_M686 is not set +# CONFIG_MACHZ_WDT is not set +# CONFIG_MATOM is not set +# CONFIG_MCORE2 is not set +# CONFIG_MCRUSOE is not set +# CONFIG_MCYRIXIII is not set +# CONFIG_MDIO_BUS is not set +# CONFIG_MEFFICEON is not set +# CONFIG_MELAN is not set +# CONFIG_MFD_INTEL_LPSS_PCI is not set +# CONFIG_MGEODEGX1 is not set +# CONFIG_MGEODE_LX is not set +# CONFIG_MICROCODE is not set +# CONFIG_MK6 is not set +# CONFIG_MK7 is not set +# CONFIG_MK8 is not set +# CONFIG_MODIFY_LDT_SYSCALL is not set +CONFIG_MODULES_TREE_LOOKUP=y +CONFIG_MODULES_USE_ELF_REL=y +# CONFIG_MPENTIUM4 is not set +# CONFIG_MPENTIUMII is not set +# CONFIG_MPENTIUMIII is not set +# CONFIG_MPENTIUMM is not set +# CONFIG_MTD is not set +CONFIG_MTRR=y +# CONFIG_MTRR_SANITIZER is not set +# CONFIG_MVIAC3_2 is not set +# CONFIG_MVIAC7 is not set +# CONFIG_MWINCHIP3D is not set +# CONFIG_MWINCHIPC6 is not set +CONFIG_NAMESPACES=y +CONFIG_ND_BLK=y +CONFIG_ND_BTT=y +CONFIG_ND_CLAIM=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y +CONFIG_NEED_PER_CPU_KM=y +CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y +CONFIG_NEED_SG_DMA_LENGTH=y +# CONFIG_NET5501 is not set +# CONFIG_NET_NS is not set +CONFIG_NLS=y +# CONFIG_NOHIGHMEM is not set +CONFIG_NO_BOOTMEM=y +CONFIG_NR_CPUS=1 +# CONFIG_NSC_GPIO is not set +CONFIG_NVRAM=y +# CONFIG_OF is not set +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_OPROFILE_NMI_TIMER=y +# CONFIG_OPTIMIZE_INLINING is not set +CONFIG_OUTPUT_FORMAT="elf32-i386" +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PC104=y +# CONFIG_PC8736x_GPIO is not set +# CONFIG_PC87413_WDT is not set +CONFIG_PCI=y +CONFIG_PCI_BIOS=y +CONFIG_PCI_BUS_ADDR_T_64BIT=y +CONFIG_PCI_DIRECT=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_GOANY=y +# CONFIG_PCI_GOBIOS is not set +# CONFIG_PCI_GODIRECT is not set +# CONFIG_PCI_GOMMCONFIG is not set +CONFIG_PCI_LABEL=y +CONFIG_PCI_LOCKLESS_CONFIG=y +CONFIG_PCI_MSI=y +CONFIG_PCI_MSI_IRQ_DOMAIN=y +CONFIG_PCSPKR_PLATFORM=y +CONFIG_PERF_EVENTS=y +CONFIG_PERF_EVENTS_INTEL_CSTATE=y +CONFIG_PERF_EVENTS_INTEL_RAPL=y +CONFIG_PERF_EVENTS_INTEL_UNCORE=y +CONFIG_PGTABLE_LEVELS=3 +CONFIG_PHYSICAL_ALIGN=0x100000 +CONFIG_PHYSICAL_START=0x1000000 +CONFIG_PHYS_ADDR_T_64BIT=y +CONFIG_PMC_ATOM=y +CONFIG_POWER_SUPPLY=y +CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 +# CONFIG_PROCESSOR_SELECT is not set +CONFIG_PROC_PAGE_MONITOR=y +# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set +# CONFIG_PUNIT_ATOM_DEBUG is not set +CONFIG_RATIONAL=y +# CONFIG_RCU_NEED_SEGCBLIST is not set +# CONFIG_RCU_STALL_COMMON is not set +CONFIG_RD_BZIP2=y +CONFIG_RD_GZIP=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_MC146818_LIB=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +# CONFIG_SBC7240_WDT is not set +# CONFIG_SBC8360_WDT is not set +# CONFIG_SBC_EPX_C3_WATCHDOG is not set +# CONFIG_SC1200_WDT is not set +# CONFIG_SCHED_INFO is not set +CONFIG_SCSI=y +CONFIG_SCSI_SPI_ATTRS=y +CONFIG_SCx200=y +CONFIG_SCx200HR_TIMER=y +# CONFIG_SCx200_GPIO is not set +# CONFIG_SCx200_WDT is not set +# CONFIG_SERIAL_8250_FSL is not set +CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIO=y +CONFIG_SERIO_I8042=y +CONFIG_SERIO_LIBPS2=y +CONFIG_SERIO_SERPORT=y +CONFIG_SG_POOL=y +# CONFIG_SMSC37B787_WDT is not set +# CONFIG_SMSC_SCH311X_WDT is not set +CONFIG_SPARSEMEM_STATIC=y +CONFIG_SPARSE_IRQ=y +CONFIG_SRCU=y +CONFIG_STRICT_KERNEL_RWX=y +CONFIG_STRICT_MODULE_RWX=y +CONFIG_SWIOTLB=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +# CONFIG_TELCLOCK is not set +CONFIG_THERMAL=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 +CONFIG_THERMAL_GOV_STEP_WISE=y +CONFIG_THIN_ARCHIVES=y +CONFIG_THREAD_INFO_IN_TASK=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TINY_SRCU=y +# CONFIG_TOSHIBA is not set +# CONFIG_UNWINDER_GUESS is not set +CONFIG_UNWINDER_FRAME_POINTER=y +CONFIG_UP_LATE_INIT=y +CONFIG_USB=y +CONFIG_USB_COMMON=y +CONFIG_USB_EHCI_HCD=y +# CONFIG_USB_EHCI_HCD_PLATFORM is not set +CONFIG_USB_EHCI_PCI=y +CONFIG_USB_HID=y +CONFIG_USB_HIDDEV=y +CONFIG_USB_OHCI_HCD=y +# CONFIG_USB_OHCI_HCD_PLATFORM is not set +CONFIG_USB_PCI=y +CONFIG_USB_SUPPORT=y +# CONFIG_USB_UHCI_HCD is not set +# CONFIG_USERIO is not set +# CONFIG_USER_NS is not set +CONFIG_USER_STACKTRACE_SUPPORT=y +# CONFIG_VGACON_SOFT_SCROLLBACK is not set +CONFIG_VGA_CONSOLE=y +# CONFIG_VIA_WDT is not set +# CONFIG_VM86 is not set +# CONFIG_VMWARE_VMCI is not set +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +# CONFIG_WAFER_WDT is not set +CONFIG_X86=y +CONFIG_X86_32=y +# CONFIG_X86_32_IRIS is not set +CONFIG_X86_32_LAZY_GS=y +CONFIG_X86_ALIGNMENT_16=y +# CONFIG_X86_ANCIENT_MCE is not set +# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set +CONFIG_X86_CMPXCHG64=y +# CONFIG_X86_CPUFREQ_NFORCE2 is not set +# CONFIG_X86_CPUID is not set +# CONFIG_X86_DEBUG_FPU is not set +# CONFIG_X86_EXTENDED_PLATFORM is not set +CONFIG_X86_F00F_BUG=y +CONFIG_X86_FAST_FEATURE_TESTS=y +CONFIG_X86_FEATURE_NAMES=y +CONFIG_X86_GENERIC=y +# CONFIG_X86_GX_SUSPMOD is not set +# CONFIG_X86_INTEL_PSTATE is not set +CONFIG_X86_INTEL_USERCOPY=y +CONFIG_X86_INTERNODE_CACHE_SHIFT=6 +CONFIG_X86_IO_APIC=y +CONFIG_X86_L1_CACHE_SHIFT=6 +# CONFIG_X86_LEGACY_VM86 is not set +CONFIG_X86_LOCAL_APIC=y +# CONFIG_X86_LONGRUN is not set +CONFIG_X86_MCE=y +# CONFIG_X86_MCELOG_LEGACY is not set +CONFIG_X86_MCE_AMD=y +# CONFIG_X86_MCE_INJECT is not set +CONFIG_X86_MCE_INTEL=y +CONFIG_X86_MCE_THRESHOLD=y +CONFIG_X86_MINIMUM_CPU_FAMILY=5 +CONFIG_X86_MPPARSE=y +CONFIG_X86_MSR=y +# CONFIG_X86_P4_CLOCKMOD is not set +CONFIG_X86_PAE=y +CONFIG_X86_PAT=y +CONFIG_X86_PLATFORM_DEVICES=y +CONFIG_X86_PMEM_LEGACY=y +CONFIG_X86_PMEM_LEGACY_DEVICE=y +# CONFIG_X86_POWERNOW_K6 is not set +# CONFIG_X86_POWERNOW_K7 is not set +CONFIG_X86_PPRO_FENCE=y +# CONFIG_X86_PTDUMP is not set +# CONFIG_X86_PTDUMP_CORE is not set +# CONFIG_X86_REBOOTFIXUPS is not set +CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y +CONFIG_X86_RESERVE_LOW=64 +# CONFIG_X86_SMAP is not set +# CONFIG_X86_SPEEDSTEP_CENTRINO is not set +# CONFIG_X86_SPEEDSTEP_ICH is not set +# CONFIG_X86_SPEEDSTEP_LIB is not set +# CONFIG_X86_SPEEDSTEP_SMI is not set +CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y +CONFIG_X86_THERMAL_VECTOR=y +CONFIG_X86_TSC=y +CONFIG_X86_UP_APIC=y +CONFIG_X86_UP_IOAPIC=y +CONFIG_X86_VERBOSE_BOOTUP=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_XZ_DEC_X86=y +CONFIG_ZLIB_INFLATE=y +CONFIG_SATA_AHCI=y \ No newline at end of file diff --git a/target/linux/x86/config-4.9 b/target/linux/x86/config-4.9 index 1c10e57f69..e70aec6b76 100644 --- a/target/linux/x86/config-4.9 +++ b/target/linux/x86/config-4.9 @@ -1,32 +1,6 @@ # CONFIG_60XX_WDT is not set # CONFIG_64BIT is not set -CONFIG_ACPI=y -CONFIG_ACPI_AC=y -CONFIG_ACPI_BATTERY=y -# CONFIG_ACPI_CMPC is not set -# CONFIG_ACPI_CONTAINER is not set -CONFIG_ACPI_CPU_FREQ_PSS=y -# CONFIG_ACPI_CUSTOM_DSDT is not set -# CONFIG_ACPI_DEBUG is not set -# CONFIG_ACPI_DEBUGGER is not set -# CONFIG_ACPI_DOCK is not set -# CONFIG_ACPI_EC_DEBUGFS is not set -CONFIG_ACPI_FAN=y -CONFIG_ACPI_HOTPLUG_IOAPIC=y -CONFIG_ACPI_I2C_OPREGION=y -CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y -# CONFIG_ACPI_NFIT is not set -# CONFIG_ACPI_PCI_SLOT is not set -CONFIG_ACPI_PROCESSOR=y -# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set -CONFIG_ACPI_PROCESSOR_CSTATE=y -CONFIG_ACPI_PROCESSOR_IDLE=y -# CONFIG_ACPI_PROCFS_POWER is not set -CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y -# CONFIG_ACPI_SBS is not set -CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y -CONFIG_ACPI_THERMAL=y -# CONFIG_ACPI_WMI is not set +# CONFIG_ACPI is not set # CONFIG_ACQUIRE_WDT is not set # CONFIG_ADVANTECH_WDT is not set # CONFIG_ALIM1535_WDT is not set @@ -38,7 +12,6 @@ CONFIG_ARCH_DISCARD_MEMBLOCK=y CONFIG_ARCH_DMA_ADDR_T_64BIT=y CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y -CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y CONFIG_ARCH_HAS_CPU_RELAX=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y @@ -49,7 +22,6 @@ CONFIG_ARCH_HAS_SG_CHAIN=y CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y -CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y CONFIG_ARCH_PHYS_ADDR_T_64BIT=y @@ -79,7 +51,7 @@ CONFIG_ATA_PIIX=y CONFIG_BINFMT_MISC=y CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_NVME=y -CONFIG_BLK_DEV_NVME_SCSI=y +# CONFIG_BLK_DEV_NVME_SCSI is not set CONFIG_BLK_DEV_SD=y CONFIG_BLK_MQ_PCI=y CONFIG_BOUNCE=y @@ -107,7 +79,6 @@ CONFIG_CPU_FREQ_STAT=y CONFIG_CPU_FREQ_STAT_DETAILS=y CONFIG_CPU_IDLE=y CONFIG_CPU_IDLE_GOV_LADDER=y -CONFIG_CPU_RMAP=y CONFIG_CPU_SUP_AMD=y CONFIG_CPU_SUP_CENTAUR=y CONFIG_CPU_SUP_CYRIX_32=y @@ -116,17 +87,12 @@ CONFIG_CPU_SUP_TRANSMETA_32=y CONFIG_CPU_SUP_UMC_32=y # CONFIG_CRASHLOG is not set CONFIG_CRC16=y -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_AEAD2=y CONFIG_CRYPTO_AES_586=y CONFIG_CRYPTO_CRC32=y CONFIG_CRYPTO_CRC32C=y # CONFIG_CRYPTO_CRC32_PCLMUL is not set CONFIG_CRYPTO_HASH=y CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -CONFIG_CRYPTO_NULL2=y CONFIG_CRYPTO_RNG2=y # CONFIG_CRYPTO_SERPENT_SSE2_586 is not set CONFIG_CRYPTO_WORKQUEUE=y @@ -149,7 +115,6 @@ CONFIG_DMIID=y CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y CONFIG_DMI_SYSFS=y CONFIG_DNOTIFY=y -# CONFIG_DPTF_POWER is not set CONFIG_DUMMY_CONSOLE=y CONFIG_EARLY_PRINTK=y # CONFIG_EARLY_PRINTK_DBGP is not set @@ -189,8 +154,6 @@ CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_MSI_IRQ=y CONFIG_GENERIC_MSI_IRQ_DOMAIN=y CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_PENDING_IRQ=y -CONFIG_GENERIC_PHY=y CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_GENERIC_STRNCPY_FROM_USER=y CONFIG_GENERIC_STRNLEN_USER=y @@ -203,8 +166,6 @@ CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y # CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -CONFIG_HAVE_ACPI_APEI=y -CONFIG_HAVE_ACPI_APEI_NMI=y CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y CONFIG_HAVE_AOUT=y CONFIG_HAVE_ARCH_AUDITSYSCALL=y @@ -263,23 +224,17 @@ CONFIG_HIGHMEM=y # CONFIG_HIGHMEM4G is not set CONFIG_HIGHMEM64G=y # CONFIG_HIGHPTE is not set -# CONFIG_HPET is not set CONFIG_HPET_EMULATE_RTC=y CONFIG_HPET_TIMER=y -# CONFIG_HP_ACCEL is not set # CONFIG_HP_WATCHDOG is not set CONFIG_HT_IRQ=y # CONFIG_HUGETLBFS is not set -CONFIG_HWMON=y -CONFIG_HWMON_VID=y CONFIG_HW_CONSOLE=y CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_GEODE=y CONFIG_HW_RANDOM_VIA=y -CONFIG_HYPERVISOR_GUEST=y +# CONFIG_HYPERVISOR_GUEST is not set CONFIG_HZ_PERIODIC=y -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y CONFIG_I8253_LOCK=y # CONFIG_I8K is not set # CONFIG_IB700_WDT is not set @@ -291,20 +246,12 @@ CONFIG_INITRAMFS_SOURCE="" CONFIG_INPUT=y CONFIG_INPUT_KEYBOARD=y CONFIG_INSTRUCTION_DECODER=y -CONFIG_INTEL_IDLE=y -# CONFIG_INTEL_IPS is not set -CONFIG_INTEL_MEI=y -CONFIG_INTEL_MEI_WDT=y -# CONFIG_INTEL_MENLOW is not set # CONFIG_INTEL_PCH_THERMAL is not set -# CONFIG_INTEL_PMC_IPC is not set -CONFIG_INTEL_POWERCLAMP=y -CONFIG_INTEL_SOC_DTS_IOSF_CORE=y -CONFIG_INTEL_SOC_DTS_THERMAL=y +# CONFIG_INTEL_POWERCLAMP is not set +# CONFIG_INTEL_SOC_DTS_THERMAL is not set CONFIG_IOMMU_HELPER=y # CONFIG_IOMMU_STRESS is not set -CONFIG_IOSF_MBI=y -# CONFIG_IOSF_MBI_DEBUG is not set +# CONFIG_IOSF_MBI is not set CONFIG_IO_DELAY_0X80=y # CONFIG_IO_DELAY_0XED is not set # CONFIG_IO_DELAY_NONE is not set @@ -319,7 +266,6 @@ CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_WORK=y # CONFIG_ISA is not set CONFIG_ISA_DMA_API=y -# CONFIG_ISCSI_IBFT_FIND is not set # CONFIG_IT8712F_WDT is not set # CONFIG_IT87_WDT is not set # CONFIG_ITCO_WDT is not set @@ -330,7 +276,6 @@ CONFIG_KEXEC_CORE=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_LEDS_CLEVO_MAIL is not set CONFIG_LIBNVDIMM=y -CONFIG_LOCK_SPIN_ON_OWNER=y # CONFIG_M486 is not set # CONFIG_M586 is not set CONFIG_M586MMX=y @@ -343,7 +288,6 @@ CONFIG_M586MMX=y # CONFIG_MCYRIXIII is not set # CONFIG_MEFFICEON is not set # CONFIG_MELAN is not set -# CONFIG_MFD_INTEL_LPSS_ACPI is not set # CONFIG_MFD_INTEL_LPSS_PCI is not set # CONFIG_MGEODEGX1 is not set # CONFIG_MGEODE_LX is not set @@ -351,15 +295,6 @@ CONFIG_M586MMX=y # CONFIG_MK6 is not set # CONFIG_MK7 is not set # CONFIG_MK8 is not set -CONFIG_MMC=y -CONFIG_MMC_BLOCK=y -CONFIG_MMC_RICOH_MMC=y -CONFIG_MMC_SDHCI=y -CONFIG_MMC_SDHCI_ACPI=y -CONFIG_MMC_SDHCI_PCI=y -CONFIG_MMC_SDHCI_PLTFM=y -# CONFIG_MMC_TIFM_SD is not set -# CONFIG_MMC_WBSD is not set # CONFIG_MODIFY_LDT_SYSCALL is not set CONFIG_MODULES_TREE_LOOKUP=y CONFIG_MODULES_USE_ELF_REL=y @@ -370,7 +305,6 @@ CONFIG_MODULES_USE_ELF_REL=y # CONFIG_MTD is not set CONFIG_MTRR=y # CONFIG_MTRR_SANITIZER is not set -CONFIG_MUTEX_SPIN_ON_OWNER=y # CONFIG_MVIAC3_2 is not set # CONFIG_MVIAC7 is not set # CONFIG_MWINCHIP3D is not set @@ -381,15 +315,15 @@ CONFIG_ND_BTT=y CONFIG_ND_CLAIM=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y +CONFIG_NEED_PER_CPU_KM=y CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y CONFIG_NEED_SG_DMA_LENGTH=y # CONFIG_NET5501 is not set -CONFIG_NET_FLOW_LIMIT=y # CONFIG_NET_NS is not set CONFIG_NLS=y # CONFIG_NOHIGHMEM is not set CONFIG_NO_BOOTMEM=y -CONFIG_NR_CPUS=8 +CONFIG_NR_CPUS=1 # CONFIG_NSC_GPIO is not set CONFIG_NVME_CORE=y CONFIG_NVRAM=y @@ -399,10 +333,7 @@ CONFIG_OLD_SIGSUSPEND3=y CONFIG_OPROFILE_NMI_TIMER=y # CONFIG_OPTIMIZE_INLINING is not set CONFIG_OUTPUT_FORMAT="elf32-i386" -CONFIG_PADATA=y CONFIG_PAGE_OFFSET=0xC0000000 -CONFIG_PATA_MPIIX=y -CONFIG_PATA_OLDPIIX=y # CONFIG_PC8736x_GPIO is not set # CONFIG_PC87413_WDT is not set CONFIG_PCI=y @@ -415,7 +346,6 @@ CONFIG_PCI_GOANY=y # CONFIG_PCI_GODIRECT is not set # CONFIG_PCI_GOMMCONFIG is not set CONFIG_PCI_LABEL=y -CONFIG_PCI_MMCONFIG=y CONFIG_PCI_MSI=y CONFIG_PCI_MSI_IRQ_DOMAIN=y CONFIG_PCSPKR_PLATFORM=y @@ -428,115 +358,54 @@ CONFIG_PHYSICAL_ALIGN=0x100000 CONFIG_PHYSICAL_START=0x1000000 CONFIG_PHYS_ADDR_T_64BIT=y CONFIG_PMC_ATOM=y -# CONFIG_PMIC_OPREGION is not set -CONFIG_PNP=y -CONFIG_PNPACPI=y -CONFIG_PNP_DEBUG_MESSAGES=y CONFIG_POWER_SUPPLY=y # CONFIG_PROCESSOR_SELECT is not set CONFIG_PROC_PAGE_MONITOR=y # CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set # CONFIG_PUNIT_ATOM_DEBUG is not set -# CONFIG_PVPANIC is not set -CONFIG_QUEUED_RWLOCKS=y -CONFIG_QUEUED_SPINLOCKS=y -CONFIG_RCU_STALL_COMMON=y +# CONFIG_RCU_STALL_COMMON is not set CONFIG_RD_BZIP2=y CONFIG_RD_GZIP=y -CONFIG_REGMAP=y -CONFIG_REGMAP_I2C=y -CONFIG_RFS_ACCEL=y -CONFIG_RPS=y CONFIG_RTC_CLASS=y -CONFIG_RTC_I2C_AND_SPI=y CONFIG_RTC_MC146818_LIB=y -CONFIG_RWSEM_SPIN_ON_OWNER=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y -# CONFIG_SAMSUNG_Q10 is not set CONFIG_SATA_AHCI=y -CONFIG_SATA_AHCI_PLATFORM=y -CONFIG_SATA_MV=y -CONFIG_SATA_PMP=y # CONFIG_SBC7240_WDT is not set # CONFIG_SBC8360_WDT is not set # CONFIG_SBC_EPX_C3_WATCHDOG is not set # CONFIG_SC1200_WDT is not set # CONFIG_SCHED_INFO is not set -CONFIG_SCHED_MC=y -CONFIG_SCHED_SMT=y CONFIG_SCSI=y -CONFIG_SCSI_BUSLOGIC=y -CONFIG_SCSI_FLASHPOINT=y CONFIG_SCSI_SPI_ATTRS=y CONFIG_SCx200=y CONFIG_SCx200HR_TIMER=y # CONFIG_SCx200_GPIO is not set # CONFIG_SCx200_WDT is not set -CONFIG_SDIO_UART=y -CONFIG_SENSORS_CORETEMP=y -CONFIG_SENSORS_FAM15H_POWER=y -CONFIG_SENSORS_K10TEMP=y -CONFIG_SENSORS_K8TEMP=y -CONFIG_SENSORS_VIA_CPUTEMP=y # CONFIG_SERIAL_8250_FSL is not set CONFIG_SERIAL_8250_PCI=y -CONFIG_SERIAL_8250_PNP=y CONFIG_SERIO=y # CONFIG_SERIO_CT82C710 is not set CONFIG_SERIO_I8042=y CONFIG_SERIO_LIBPS2=y CONFIG_SERIO_SERPORT=y CONFIG_SG_POOL=y -CONFIG_SMP=y +# CONFIG_SHORTCUT_FE is not set # CONFIG_SMSC37B787_WDT is not set # CONFIG_SMSC_SCH311X_WDT is not set -CONFIG_SND=y -# CONFIG_SND_COMPRESS_OFFLOAD is not set -CONFIG_SND_DMA_SGBUF=y -CONFIG_SND_HDA=y -CONFIG_SND_HDA_CODEC_ANALOG=y -# CONFIG_SND_HDA_CODEC_CA0110 is not set -# CONFIG_SND_HDA_CODEC_CA0132 is not set -# CONFIG_SND_HDA_CODEC_CIRRUS is not set -# CONFIG_SND_HDA_CODEC_CMEDIA is not set -CONFIG_SND_HDA_CODEC_CONEXANT=y -# CONFIG_SND_HDA_CODEC_HDMI is not set -CONFIG_SND_HDA_CODEC_REALTEK=y -# CONFIG_SND_HDA_CODEC_SI3054 is not set -CONFIG_SND_HDA_CODEC_SIGMATEL=y -CONFIG_SND_HDA_CODEC_VIA=y -CONFIG_SND_HDA_CORE=y -CONFIG_SND_HDA_GENERIC=y -CONFIG_SND_HDA_HWDEP=y -# CONFIG_SND_HDA_INPUT_BEEP is not set -CONFIG_SND_HDA_INTEL=y -CONFIG_SND_HDA_PATCH_LOADER=y -CONFIG_SND_HDA_RECONFIG=y -CONFIG_SND_HWDEP=y -CONFIG_SND_JACK=y -CONFIG_SND_JACK_INPUT_DEV=y -CONFIG_SND_PCM=y -# CONFIG_SND_PCSP is not set -CONFIG_SND_VMASTER=y -CONFIG_SOUND=y CONFIG_SPARSEMEM_STATIC=y CONFIG_SPARSE_IRQ=y CONFIG_SRCU=y CONFIG_STRICT_DEVMEM=y -# CONFIG_SURFACE_PRO3_BUTTON is not set CONFIG_SWIOTLB=y CONFIG_SYSCTL_EXCEPTION_TRACE=y # CONFIG_TELCLOCK is not set CONFIG_THERMAL=y CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y -CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y CONFIG_THERMAL_GOV_STEP_WISE=y -CONFIG_THERMAL_WRITABLE_TRIPS=y CONFIG_THREAD_INFO_IN_TASK=y CONFIG_TICK_CPU_ACCOUNTING=y # CONFIG_TOSHIBA is not set -# CONFIG_TOSHIBA_BT_RFKILL is not set -CONFIG_TREE_RCU=y +CONFIG_UP_LATE_INIT=y CONFIG_USB=y CONFIG_USB_COMMON=y CONFIG_USB_EHCI_HCD=y @@ -546,12 +415,8 @@ CONFIG_USB_HID=y CONFIG_USB_HIDDEV=y CONFIG_USB_OHCI_HCD=y # CONFIG_USB_OHCI_HCD_PLATFORM is not set -CONFIG_USB_STORAGE=y CONFIG_USB_SUPPORT=y CONFIG_USB_UHCI_HCD=y -CONFIG_USB_XHCI_HCD=y -CONFIG_USB_XHCI_PCI=y -# CONFIG_USB_XHCI_PLATFORM is not set # CONFIG_USERIO is not set # CONFIG_USER_NS is not set CONFIG_USER_STACKTRACE_SUPPORT=y @@ -559,38 +424,29 @@ CONFIG_USER_STACKTRACE_SUPPORT=y CONFIG_VGA_CONSOLE=y # CONFIG_VIA_WDT is not set # CONFIG_VM86 is not set -CONFIG_VMWARE_BALLOON=y -CONFIG_VMWARE_PVSCSI=y -CONFIG_VMWARE_VMCI=y +# CONFIG_VMWARE_VMCI is not set CONFIG_VM_EVENT_COUNTERS=y CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_VT_HW_CONSOLE_BINDING=y # CONFIG_WAFER_WDT is not set -CONFIG_WATCHDOG_CORE=y CONFIG_X86=y CONFIG_X86_32=y # CONFIG_X86_32_IRIS is not set CONFIG_X86_32_LAZY_GS=y -CONFIG_X86_32_SMP=y -# CONFIG_X86_ACPI_CPUFREQ is not set CONFIG_X86_ALIGNMENT_16=y -# CONFIG_X86_AMD_PLATFORM_DEVICE is not set # CONFIG_X86_ANCIENT_MCE is not set -# CONFIG_X86_BIGSMP is not set # CONFIG_X86_CHECK_BIOS_CORRUPTION is not set CONFIG_X86_CMPXCHG64=y # CONFIG_X86_CPUFREQ_NFORCE2 is not set # CONFIG_X86_CPUID is not set # CONFIG_X86_DEBUG_FPU is not set # CONFIG_X86_EXTENDED_PLATFORM is not set -# CONFIG_X86_E_POWERSAVER is not set CONFIG_X86_F00F_BUG=y CONFIG_X86_FAST_FEATURE_TESTS=y CONFIG_X86_FEATURE_NAMES=y CONFIG_X86_GENERIC=y # CONFIG_X86_GX_SUSPMOD is not set -# CONFIG_X86_INTEL_LPSS is not set # CONFIG_X86_INTEL_MPX is not set # CONFIG_X86_INTEL_PSTATE is not set CONFIG_X86_INTEL_USERCOPY=y @@ -599,7 +455,6 @@ CONFIG_X86_IO_APIC=y CONFIG_X86_L1_CACHE_SHIFT=6 # CONFIG_X86_LEGACY_VM86 is not set CONFIG_X86_LOCAL_APIC=y -# CONFIG_X86_LONGHAUL is not set # CONFIG_X86_LONGRUN is not set CONFIG_X86_MCE=y CONFIG_X86_MCE_AMD=y @@ -612,11 +467,9 @@ CONFIG_X86_MSR=y # CONFIG_X86_P4_CLOCKMOD is not set CONFIG_X86_PAE=y CONFIG_X86_PAT=y -# CONFIG_X86_PCC_CPUFREQ is not set CONFIG_X86_PLATFORM_DEVICES=y CONFIG_X86_PMEM_LEGACY=y CONFIG_X86_PMEM_LEGACY_DEVICE=y -CONFIG_X86_PM_TIMER=y # CONFIG_X86_POWERNOW_K6 is not set # CONFIG_X86_POWERNOW_K7 is not set CONFIG_X86_PPRO_FENCE=y @@ -633,8 +486,9 @@ CONFIG_X86_RESERVE_LOW=64 CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y CONFIG_X86_THERMAL_VECTOR=y CONFIG_X86_TSC=y +CONFIG_X86_UP_APIC=y +CONFIG_X86_UP_IOAPIC=y CONFIG_X86_VERBOSE_BOOTUP=y -CONFIG_XPS=y CONFIG_XZ_DEC_BCJ=y CONFIG_XZ_DEC_X86=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/x86/generic/config-default b/target/linux/x86/generic/config-default index fa430cfc08..327e7c647d 100644 --- a/target/linux/x86/generic/config-default +++ b/target/linux/x86/generic/config-default @@ -1,3 +1,4 @@ +# CONFIG_104_QUAD_8 is not set # CONFIG_3C515 is not set CONFIG_ACPI=y CONFIG_ACPI_AC=y @@ -17,7 +18,6 @@ CONFIG_ACPI_HOTPLUG_CPU=y CONFIG_ACPI_HOTPLUG_IOAPIC=y # CONFIG_ACPI_I2C_OPREGION is not set CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y -# CONFIG_ACPI_NFIT is not set # CONFIG_ACPI_PCI_SLOT is not set CONFIG_ACPI_PROCESSOR=y # CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set @@ -44,15 +44,14 @@ CONFIG_AGP_INTEL=y # CONFIG_APM is not set CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y -CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y CONFIG_BACKLIGHT_CLASS_DEVICE=y CONFIG_BACKLIGHT_GENERIC=y CONFIG_BACKLIGHT_LCD_SUPPORT=y CONFIG_BLK_DEV_SR=y # CONFIG_BLK_DEV_SR_VENDOR is not set +CONFIG_BLK_MQ_VIRTIO=y # CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set -CONFIG_CLKDEV_LOOKUP=y -CONFIG_COMMON_CLK=y +CONFIG_CONNECTOR=y # CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set CONFIG_CPU_IDLE_GOV_MENU=y CONFIG_CPU_RMAP=y @@ -74,17 +73,27 @@ CONFIG_DRM_AMDGPU=y CONFIG_DRM_BOCHS=y CONFIG_DRM_BRIDGE=y CONFIG_DRM_FBDEV_EMULATION=y +CONFIG_DRM_FBDEV_OVERALLOC=100 # CONFIG_DRM_GMA500 is not set CONFIG_DRM_I915=y +# CONFIG_DRM_I915_ALPHA_SUPPORT is not set +CONFIG_DRM_I915_CAPTURE_ERROR=y +CONFIG_DRM_I915_COMPRESS_ERROR=y # CONFIG_DRM_I915_DEBUG is not set +# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set # CONFIG_DRM_I915_GVT is not set +# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set # CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT is not set +# CONFIG_DRM_I915_SELFTEST is not set +# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set +# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set CONFIG_DRM_I915_USERPTR=y # CONFIG_DRM_I915_WERROR is not set CONFIG_DRM_KMS_FB_HELPER=y CONFIG_DRM_KMS_HELPER=y CONFIG_DRM_MIPI_DSI=y CONFIG_DRM_PANEL=y +CONFIG_DRM_PANEL_BRIDGE=y CONFIG_DRM_RADEON=y # CONFIG_DRM_RADEON_USERPTR is not set CONFIG_DRM_TTM=y @@ -96,6 +105,8 @@ CONFIG_EFI=y CONFIG_EFIVAR_FS=m # CONFIG_EFI_BOOTLOADER_CONTROL is not set # CONFIG_EFI_CAPSULE_LOADER is not set +# CONFIG_EFI_CAPSULE_QUIRK_QUARK_CSH is not set +# CONFIG_EFI_DEV_PATH_PARSER is not set CONFIG_EFI_ESRT=y # CONFIG_EFI_FAKE_MEMMAP is not set # CONFIG_EFI_PGT_DUMP is not set @@ -113,7 +124,9 @@ CONFIG_FB_CFB_IMAGEBLIT=y CONFIG_FB_CMDLINE=y CONFIG_FB_DEFERRED_IO=y CONFIG_FB_EFI=y +CONFIG_FB_HYPERV=y # CONFIG_FB_I810 is not set +# CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA is not set CONFIG_FB_SYS_COPYAREA=y CONFIG_FB_SYS_FILLRECT=y CONFIG_FB_SYS_FOPS=y @@ -127,6 +140,8 @@ CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set CONFIG_FREEZER=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GENERIC_IRQ_MIGRATION=y CONFIG_GENERIC_PENDING_IRQ=y CONFIG_GENERIC_PINCONF=y CONFIG_GPIOLIB=y @@ -135,16 +150,8 @@ CONFIG_GPIOLIB_IRQCHIP=y # CONFIG_GPIO_104_IDIO_16 is not set # CONFIG_GPIO_104_IDI_48 is not set CONFIG_GPIO_ACPI=y -# CONFIG_GPIO_AMDPT is not set -# CONFIG_GPIO_F7188X is not set -# CONFIG_GPIO_GPIO_MM is not set -# CONFIG_GPIO_IT87 is not set -# CONFIG_GPIO_LYNXPOINT is not set -# CONFIG_GPIO_WS16C48 is not set CONFIG_HAVE_ACPI_APEI=y CONFIG_HAVE_ACPI_APEI_NMI=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y CONFIG_HAVE_KVM_EVENTFD=y CONFIG_HAVE_KVM_IRQCHIP=y @@ -155,7 +162,17 @@ CONFIG_HAVE_KVM_MSI=y CONFIG_HDMI=y CONFIG_HIBERNATE_CALLBACKS=y CONFIG_HID_BATTERY_STRENGTH=y +CONFIG_HID_GENERIC=y +CONFIG_HID_HYPERV_MOUSE=y CONFIG_HOTPLUG_CPU=y +CONFIG_HOTPLUG_PCI=y +CONFIG_HOTPLUG_PCI_ACPI=y +# CONFIG_HOTPLUG_PCI_ACPI_IBM is not set +# CONFIG_HOTPLUG_PCI_COMPAQ is not set +# CONFIG_HOTPLUG_PCI_CPCI is not set +# CONFIG_HOTPLUG_PCI_IBM is not set +CONFIG_HOTPLUG_PCI_PCIE=y +# CONFIG_HOTPLUG_PCI_SHPC is not set CONFIG_HPET=y CONFIG_HPET_MMAP=y # CONFIG_HP_ACCEL is not set @@ -164,8 +181,15 @@ CONFIG_HVC_IRQ=y CONFIG_HVC_XEN=y CONFIG_HVC_XEN_FRONTEND=y CONFIG_HWMON=y +CONFIG_HWMON_VID=y CONFIG_HW_RANDOM_VIRTIO=y +CONFIG_HYPERV=y CONFIG_HYPERVISOR_GUEST=y +CONFIG_HYPERV_BALLOON=y +CONFIG_HYPERV_KEYBOARD=y +CONFIG_HYPERV_NET=y +CONFIG_HYPERV_STORAGE=y +CONFIG_HYPERV_UTILS=y CONFIG_I2C=y CONFIG_I2C_ALGOBIT=y CONFIG_I2C_BOARDINFO=y @@ -177,9 +201,14 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y CONFIG_INTEL_GTT=y CONFIG_INTEL_IDLE=y +# CONFIG_INTEL_INT0002_VGPIO is not set # CONFIG_INTEL_IPS is not set # CONFIG_INTEL_MENLOW is not set +CONFIG_INTEL_PCH_THERMAL=y # CONFIG_INTEL_PMC_IPC is not set +CONFIG_INTEL_SOC_DTS_IOSF_CORE=y +CONFIG_INTEL_SOC_DTS_THERMAL=y +# CONFIG_INTEL_SOC_PMIC_CHTWC is not set CONFIG_INTERVAL_TREE=y CONFIG_IOSF_MBI=y # CONFIG_IOSF_MBI_DEBUG is not set @@ -229,7 +258,9 @@ CONFIG_MOUSE_PS2_ALPS=y # CONFIG_MOUSE_PS2_ELANTECH is not set CONFIG_MOUSE_PS2_LIFEBOOK=y CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SMBUS=y CONFIG_MOUSE_PS2_SYNAPTICS=y +CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y # CONFIG_MOUSE_PS2_TOUCHKIT is not set CONFIG_MOUSE_PS2_TRACKPOINT=y # CONFIG_MOUSE_PS2_VMMOUSE is not set @@ -261,8 +292,12 @@ CONFIG_PCI_XEN=y CONFIG_PINCTRL=y CONFIG_PINCTRL_BAYTRAIL=y CONFIG_PINCTRL_BROXTON=y +CONFIG_PINCTRL_CANNONLAKE=y CONFIG_PINCTRL_CHERRYVIEW=y +CONFIG_PINCTRL_DENVERTON=y +CONFIG_PINCTRL_GEMINILAKE=y CONFIG_PINCTRL_INTEL=y +# CONFIG_PINCTRL_LEWISBURG is not set CONFIG_PINCTRL_SUNRISEPOINT=y CONFIG_PM=y # CONFIG_PMIC_OPREGION is not set @@ -275,16 +310,19 @@ CONFIG_PNPACPI=y # CONFIG_PNPBIOS is not set CONFIG_PNP_DEBUG_MESSAGES=y CONFIG_PREEMPT_NOTIFIERS=y +CONFIG_PROC_EVENTS=y # CONFIG_PVPANIC is not set CONFIG_QUEUED_RWLOCKS=y CONFIG_QUEUED_SPINLOCKS=y # CONFIG_RANDOMIZE_BASE is not set CONFIG_RAS=y -CONFIG_RATIONAL=y +CONFIG_RCU_NEED_SEGCBLIST=y CONFIG_RCU_STALL_COMMON=y CONFIG_REGMAP=y CONFIG_REGMAP_I2C=y +# CONFIG_RELAY is not set CONFIG_RELOCATABLE=y +CONFIG_RESET_ATTACK_MITIGATION=y CONFIG_RFS_ACCEL=y CONFIG_RPS=y CONFIG_RTC_I2C_AND_SPI=y @@ -294,19 +332,32 @@ CONFIG_SATA_AHCI=y CONFIG_SATA_VIA=y CONFIG_SCHED_INFO=y CONFIG_SCSI_VIRTIO=y +CONFIG_SENSORS_CORETEMP=y +CONFIG_SENSORS_FAM15H_POWER=y +CONFIG_SENSORS_I5500=y +CONFIG_SENSORS_K10TEMP=y +CONFIG_SENSORS_K8TEMP=y +CONFIG_SENSORS_VIA_CPUTEMP=y CONFIG_SERIAL_8250_PNP=y CONFIG_SMP=y # CONFIG_SURFACE_PRO3_BUTTON is not set CONFIG_SWIOTLB_XEN=y +# CONFIG_SW_SYNC is not set +# CONFIG_SYNC_FILE is not set CONFIG_SYS_HYPERVISOR=y CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y +CONFIG_THERMAL_GOV_USER_SPACE=y +CONFIG_THERMAL_HWMON=y +CONFIG_THERMAL_WRITABLE_TRIPS=y # CONFIG_TOSHIBA_BT_RFKILL is not set CONFIG_TREE_RCU=y +CONFIG_TREE_SRCU=y CONFIG_UCS2_STRING=y CONFIG_USB_STORAGE=y CONFIG_USER_RETURN_NOTIFIER=y CONFIG_VGACON_SOFT_SCROLLBACK=y +# CONFIG_VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT is not set CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64 CONFIG_VHOST=y CONFIG_VHOST_NET=y @@ -330,6 +381,7 @@ CONFIG_X86_AMD_FREQ_SENSITIVITY=y # CONFIG_X86_AMD_PLATFORM_DEVICE is not set # CONFIG_X86_BIGSMP is not set CONFIG_X86_CMOV=y +CONFIG_X86_CPUID=y CONFIG_X86_DEBUGCTLMSR=y # CONFIG_X86_E_POWERSAVER is not set CONFIG_X86_INTEL_LPSS=y @@ -339,6 +391,7 @@ CONFIG_X86_L1_CACHE_SHIFT=7 # CONFIG_X86_LONGHAUL is not set CONFIG_X86_NEED_RELOCS=y # CONFIG_X86_PCC_CPUFREQ is not set +CONFIG_X86_PKG_TEMP_THERMAL=y # CONFIG_X86_PMEM_LEGACY is not set CONFIG_X86_PM_TIMER=y # CONFIG_X86_POWERNOW_K8 is not set @@ -363,7 +416,11 @@ CONFIG_XEN_HAVE_VPMU=y CONFIG_XEN_NETDEV_FRONTEND=y CONFIG_XEN_PCIDEV_FRONTEND=y CONFIG_XEN_PRIVCMD=y +CONFIG_XEN_PV=y +CONFIG_XEN_PVH=y CONFIG_XEN_PVHVM=y +CONFIG_XEN_PVHVM_SMP=y +CONFIG_XEN_PV_SMP=y CONFIG_XEN_SAVE_RESTORE=y CONFIG_XEN_SCRUB_PAGES=y CONFIG_XEN_SCSI_FRONTEND=y @@ -372,3 +429,4 @@ CONFIG_XEN_SYS_HYPERVISOR=y CONFIG_XEN_WDT=y CONFIG_XEN_XENBUS_FRONTEND=y CONFIG_XPS=y +CONFIG_ZLIB_DEFLATE=y diff --git a/target/linux/x86/geode/config-default b/target/linux/x86/geode/config-default index 69d31b00a5..b564b940ea 100644 --- a/target/linux/x86/geode/config-default +++ b/target/linux/x86/geode/config-default @@ -1,3 +1,4 @@ +# CONFIG_104_QUAD_8 is not set # CONFIG_3C515 is not set CONFIG_8139CP=y CONFIG_8139TOO=y @@ -40,6 +41,7 @@ CONFIG_CS5535_MFGPT=y CONFIG_CS5535_MFGPT_DEFAULT_IRQ=7 # CONFIG_DPTF_POWER is not set # CONFIG_EBC_C384_WDT is not set +# CONFIG_EFI_DEV_PATH_PARSER is not set # CONFIG_EISA is not set # CONFIG_EL3 is not set CONFIG_GEODE_WDT=y @@ -49,14 +51,8 @@ CONFIG_GPIOLIB=y # CONFIG_GPIO_104_IDIO_16 is not set # CONFIG_GPIO_104_IDI_48 is not set CONFIG_GPIO_ACPI=y -# CONFIG_GPIO_AMDPT is not set CONFIG_GPIO_CS5535=y -# CONFIG_GPIO_F7188X is not set -# CONFIG_GPIO_GPIO_MM is not set -# CONFIG_GPIO_IT87 is not set -# CONFIG_GPIO_LYNXPOINT is not set CONFIG_GPIO_SYSFS=y -# CONFIG_GPIO_WS16C48 is not set CONFIG_HAVE_ACPI_APEI=y CONFIG_HAVE_ACPI_APEI_NMI=y CONFIG_HIGHMEM4G=y @@ -69,9 +65,11 @@ CONFIG_I2C_ALGOBIT=y CONFIG_I2C_ALGOPCA=y CONFIG_I2C_ALGOPCF=y CONFIG_I2C_BOARDINFO=y +# CONFIG_INTEL_INT0002_VGPIO is not set # CONFIG_INTEL_IPS is not set # CONFIG_INTEL_MENLOW is not set # CONFIG_INTEL_PMC_IPC is not set +# CONFIG_INTEL_SOC_PMIC_CHTWC is not set CONFIG_ISA=y # CONFIG_ISAPNP is not set CONFIG_ISA_BUS_API=y @@ -116,9 +114,10 @@ CONFIG_SENSORS_LM90=y CONFIG_SERIAL_8250_PNP=y # CONFIG_SURFACE_PRO3_BUTTON is not set # CONFIG_TOSHIBA_BT_RFKILL is not set -CONFIG_USB_OHCI_HCD_PCI=y # CONFIG_USB_UHCI_HCD is not set +CONFIG_USB_OHCI_HCD_PCI=y CONFIG_VGACON_SOFT_SCROLLBACK=y +# CONFIG_VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT is not set CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64 CONFIG_VIA_RHINE=y CONFIG_VIA_RHINE_MMIO=y diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile index 3b5e642d1b..8a3cb327e3 100644 --- a/target/linux/x86/image/Makefile +++ b/target/linux/x86/image/Makefile @@ -10,9 +10,6 @@ include $(INCLUDE_DIR)/image.mk export PATH=$(TARGET_PATH):/sbin GRUB2_MODULES = biosdisk boot chain configfile ext2 linux ls part_msdos reboot serial vga -GRUB2_MODULES_LEGACY = $(GRUB2_MODULES) -GRUB2_MODULES_LEGACY += part_gpt search fat exfat -GRUB2_MODULES_EFI = boot chain configfile ext2 linux ls part_msdos reboot serial part_gpt part_msdos search fat exfat ext2 efi_gop efi_uga gfxterm GRUB2_MODULES_ISO = biosdisk boot chain configfile iso9660 linux ls part_msdos reboot serial vga GRUB_TERMINALS = GRUB_SERIAL_CONFIG = @@ -45,8 +42,6 @@ ifneq ($(GRUB_TERMINALS),) endif SIGNATURE:=$(shell perl -e 'printf("%08x", rand(0xFFFFFFFF))') -EFI_SIGNATURE:=$(shell perl -e 'printf("%08x-%04x-%04x-%04x-%06x%06x", rand(0xFFFFFFFF), rand(0xFFFF), rand(0xFFFF), rand(0xFFFF), rand(0xFFFFFF), rand(0xFFFFFF))') - ROOTPART:=$(call qstrip,$(CONFIG_TARGET_ROOTFS_PARTNAME)) ROOTPART:=$(if $(ROOTPART),$(ROOTPART),PARTUUID=$(SIGNATURE)-02) @@ -56,7 +51,7 @@ ifneq ($(CONFIG_TARGET_x86_xen_domu),) GRUB_ROOT = xen/xvda,msdos1 endif -ifneq ($(CONFIG_GRUB_IMAGES)$(CONFIG_EFI_IMAGES),) +ifneq ($(CONFIG_GRUB_IMAGES),) BOOTOPTS:=$(call qstrip,$(CONFIG_GRUB_BOOTOPTS)) @@ -68,90 +63,6 @@ ifneq ($(CONFIG_GRUB_IMAGES)$(CONFIG_EFI_IMAGES),) root=$(ROOTPART) rootfstype=squashfs rootwait endef - ifneq ($(CONFIG_EFI_IMAGES),) - - define Image/cmdline/efi - $(subst $(SIGNATURE)-02,$2,$(call Image/cmdline/$(1))) - endef - - define Image/Build/efi - # left here because the image builder doesnt need these - rm -rf $(KDIR)/root.grub/ || true - $(INSTALL_DIR) $(KDIR)/root.grub/boot/grub $(KDIR)/grub2 - $(CP) $(KDIR)/bzImage $(KDIR)/root.grub/boot/vmlinuz - echo '(hd0) $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img' > $(KDIR)/grub2/device.map - sed \ - -e 's#@SERIAL_CONFIG@#$(strip $(GRUB_SERIAL_CONFIG))#g' \ - -e 's#@TERMINAL_CONFIG@#$(strip $(GRUB_TERMINAL_CONFIG))#g' \ - -e 's#@CMDLINE@#$(strip $(call Image/cmdline/efi,$(1),$(EFI_SIGNATURE)) $(BOOTOPTS) $(GRUB_CONSOLE_CMDLINE))#g' \ - -e 's#@TIMEOUT@#$(GRUB_TIMEOUT)#g' \ - -e 's#set root.*#search --file /boot/grub/$(SIGNATURE).cfg --set=root#g' \ - ./grub.cfg > $(KDIR)/root.grub/boot/grub/grub.cfg - $(CP) $(KDIR)/root.grub/boot/grub/grub.cfg $(KDIR)/root.grub/boot/grub/$(SIGNATURE).cfg - grub-mkimage \ - -d $(STAGING_DIR_HOST)/lib/grub/i386-pc \ - -o $(KDIR)/grub2/core.img \ - -O i386-pc \ - -p '(hd0,gpt1)/boot/grub' \ - -c $(KDIR)/root.grub/boot/grub/grub.cfg \ - $(GRUB2_MODULES_LEGACY) - $(CP) $(STAGING_DIR_HOST)/lib/grub/i386-pc/*.img $(KDIR)/grub2/ - - # Build the efi grub version - rm -rf $(KDIR)/grub2.efi/ || true - $(INSTALL_DIR) $(KDIR)/grub2.efi/efi/boot/ - - # Generate the grub search root config (grub will search for the $(SIGNATURE).cfg file placed on the boot partition as grub does not support search of GPT UUID yet) - echo "search --file /boot/grub/$(SIGNATURE).cfg --set=root" > $(KDIR)/grub2.efi/efi/boot/grub.cfg - echo "configfile /boot/grub/grub.cfg" >> $(KDIR)/grub2.efi/efi/boot/grub.cfg - - # Create the EFI grub binary - grub-mkimage-efi \ - -d $(STAGING_DIR_HOST)/lib/grub/x86_64-efi \ - -o $(KDIR)/grub2.efi/efi/boot/bootx64.efi \ - -O x86_64-efi \ - -p /efi/boot \ - -c $(KDIR)/grub2.efi/efi/boot/grub.cfg \ - $(GRUB2_MODULES_EFI) - - # Generate the EFI VFAT bootfs - rm $(KDIR)/kernel.efi || true - mkfs.fat -C $(KDIR)/kernel.efi -S 512 1024 - mcopy -s -i "$(KDIR)/kernel.efi" $(KDIR)/grub2.efi/* ::/ - - SIGNATURE="$(SIGNATURE)" PATH="$(TARGET_PATH)" ./gen_image_efi.sh \ - $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img \ - $(CONFIG_TARGET_KERNEL_PARTSIZE) $(KDIR)/root.grub \ - 1 $(KDIR)/kernel.efi \ - 1 \ - $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(KDIR)/root.$(1) \ - 256 - - # Setup legacy bios for hybrid MBR (optional) - grub-bios-setup \ - --device-map="$(KDIR)/grub2/device.map" \ - -d "$(KDIR)/grub2" \ - -r "hd0,msdos1" \ - "$(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img" - - # Convert the MBR partition to GPT and set EFI ROOTFS signature - dd if=/dev/zero of="$(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img" bs=512 count=33 conv=notrunc oflag=append - sgdisk -g "$(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img" - sgdisk -t 2:EF00 "$(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img" - sgdisk -t 3:EF02 "$(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img" - sgdisk -u 4:$(EFI_SIGNATURE) "$(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img" - sgdisk -h "$(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img" - - # Setup EFI grub - grub-bios-setup-efi \ - --device-map="$(KDIR)/grub2/device.map" \ - -d "$(KDIR)/grub2" \ - -r "hd0,gpt1" \ - "$(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img" - endef - endif - - ifneq ($(CONFIG_GRUB_IMAGES),) define Image/Build/grub2 # left here because the image builder doesnt need these $(INSTALL_DIR) $(KDIR)/root.grub/boot/grub $(KDIR)/grub2 @@ -183,8 +94,6 @@ ifneq ($(CONFIG_GRUB_IMAGES)$(CONFIG_EFI_IMAGES),) -r "hd0,msdos1" \ "$(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img" endef - endif - endif define Image/Build/squashfs @@ -224,14 +133,6 @@ ifneq ($(CONFIG_VDI_IMAGES),) # XXX: VBoxManage insists on setting perms to 0600 chmod 0644 $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).vdi endef - define Image/Build/vdi_efi - rm $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).vdi || true - qemu-img convert -f raw -O vdi \ - $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img \ - $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).vdi - # XXX: VBoxManage insists on setting perms to 0600 - chmod 0644 $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).vdi - endef endif ifneq ($(CONFIG_VMDK_IMAGES),) @@ -241,22 +142,11 @@ ifneq ($(CONFIG_VMDK_IMAGES),) $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img \ $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).vmdk endef - define Image/Build/vmdk_efi - rm $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).vmdk || true - qemu-img convert -f raw -O vmdk \ - $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img \ - $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).vmdk - endef endif define Image/Build/gzip - gzip -f9n $(BIN_DIR)/$(IMG_PREFIX)-rootfs-$(1).img -ifneq ($(CONFIG_GRUB_IMAGES),) gzip -f9n $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img -endif -ifneq ($(CONFIG_EFI_IMAGES),) - gzip -f9n $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img -endif + gzip -f9n $(BIN_DIR)/$(IMG_PREFIX)-rootfs-$(1).img endef ifneq ($(CONFIG_TARGET_IMAGES_GZIP),) @@ -284,15 +174,8 @@ define Image/Build $(call Image/Build/$(1)) ifneq ($(1),iso) $(call Image/Build/grub2,$(1)) - $(call Image/Build/efi,$(1)) -ifneq ($(CONFIG_GRUB_IMAGES),) $(call Image/Build/vdi,$(1)) $(call Image/Build/vmdk,$(1)) -endif -ifneq ($(CONFIG_EFI_IMAGES),) - $(call Image/Build/vdi_efi,$(1)) - $(call Image/Build/vmdk_efi,$(1)) -endif $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-rootfs-$(1).img else $(CP) $(KDIR)/root.iso $(BIN_DIR)/$(IMG_PREFIX).iso diff --git a/target/linux/x86/image/gen_image_efi.sh b/target/linux/x86/image/gen_image_efi.sh deleted file mode 100755 index 3ecb25fed9..0000000000 --- a/target/linux/x86/image/gen_image_efi.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash -set -x -[ $# == 8 -o $# == 9 ] || { - echo "SYNTAX: $0 []" - exit 1 -} - -OUTPUT="$1" -KERNELSIZE="$2" -KERNELDIR="$3" -EFISIZE="$4" -EFIIMAGE="$5" -EFIGRUBSIZE="$6" -ROOTFSSIZE="$7" -ROOTFSIMAGE="$8" -ALIGN="$9" - -rm -f "$OUTPUT" - -head=16 -sect=63 -cyl=$(( ($KERNELSIZE + $EFISIZE + $EFIGRUBSIZE + $ROOTFSSIZE) * 1024 * 1024 / ($head * $sect * 512) )) - -# create partition table -set `ptgen -o "$OUTPUT" -h $head -s $sect -p ${KERNELSIZE}m -p ${EFISIZE}m -p ${EFIGRUBSIZE}m -p ${ROOTFSSIZE}m ${ALIGN:+-l $ALIGN} ${SIGNATURE:+-S 0x$SIGNATURE}` - -KERNELOFFSET="$(($1 / 512))" -KERNELSIZE="$2" -EFIOFFSET="$(($3 / 512))" -EFISIZE="$(($4 / 512))" -EFIGRUBOFFSET="$(($5 / 512))" -EFIGRUBSIZE="$(($6 / 512))" -ROOTFSOFFSET="$(($7 / 512))" -ROOTFSSIZE="$(($8 / 512))" - -dd if=/dev/zero of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" conv=notrunc count="$ROOTFSSIZE" -dd if="$ROOTFSIMAGE" of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" conv=notrunc -dd if="$EFIIMAGE" of="$OUTPUT" bs=512 seek="$EFIOFFSET" conv=notrunc - -[ -n "$NOGRUB" ] && exit 0 - -make_ext4fs -J -l "$KERNELSIZE" "$OUTPUT.kernel" "$KERNELDIR" -dd if="$OUTPUT.kernel" of="$OUTPUT" bs=512 seek="$KERNELOFFSET" conv=notrunc -rm -f "$OUTPUT.kernel" diff --git a/target/linux/x86/image/grub-iso.cfg b/target/linux/x86/image/grub-iso.cfg index 32ee687c68..3d47a95a4b 100644 --- a/target/linux/x86/image/grub-iso.cfg +++ b/target/linux/x86/image/grub-iso.cfg @@ -5,6 +5,6 @@ set default="0" set timeout="@TIMEOUT@" set root='(cd)' -menuentry "LEDE" { +menuentry "OpenWrt" { linux /boot/vmlinuz @CMDLINE@ noinitrd } diff --git a/target/linux/x86/image/grub.cfg b/target/linux/x86/image/grub.cfg index acca036a2e..9ec6b2d39c 100644 --- a/target/linux/x86/image/grub.cfg +++ b/target/linux/x86/image/grub.cfg @@ -5,9 +5,9 @@ set default="0" set timeout="@TIMEOUT@" set root='(@ROOT@)' -menuentry "LEDE" { +menuentry "OpenWrt" { linux /boot/vmlinuz @CMDLINE@ noinitrd } -menuentry "LEDE (failsafe)" { +menuentry "OpenWrt (failsafe)" { linux /boot/vmlinuz failsafe=true @CMDLINE@ noinitrd } diff --git a/target/linux/x86/legacy/config-default b/target/linux/x86/legacy/config-default index 3e0b065253..d1a4e81035 100644 --- a/target/linux/x86/legacy/config-default +++ b/target/linux/x86/legacy/config-default @@ -1,3 +1,4 @@ +# CONFIG_104_QUAD_8 is not set # CONFIG_3C515 is not set CONFIG_ACPI=y CONFIG_ACPI_AC=y @@ -45,8 +46,6 @@ CONFIG_BACKLIGHT_GENERIC=y CONFIG_BACKLIGHT_LCD_SUPPORT=y CONFIG_BLK_DEV_SR=y # CONFIG_BLK_DEV_SR_VENDOR is not set -CONFIG_CLKDEV_LOOKUP=y -CONFIG_COMMON_CLK=y CONFIG_CPU_IDLE_GOV_MENU=y CONFIG_DMA_SHARED_BUFFER=y # CONFIG_DPTF_POWER is not set @@ -60,22 +59,33 @@ CONFIG_DRM_AMDGPU=y CONFIG_DRM_BOCHS=y CONFIG_DRM_BRIDGE=y CONFIG_DRM_FBDEV_EMULATION=y +CONFIG_DRM_FBDEV_OVERALLOC=100 # CONFIG_DRM_GMA500 is not set CONFIG_DRM_I915=y +# CONFIG_DRM_I915_ALPHA_SUPPORT is not set +CONFIG_DRM_I915_CAPTURE_ERROR=y +CONFIG_DRM_I915_COMPRESS_ERROR=y # CONFIG_DRM_I915_DEBUG is not set +# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set # CONFIG_DRM_I915_GVT is not set +# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set +# CONFIG_DRM_I915_SELFTEST is not set # CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT is not set +# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set +# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set CONFIG_DRM_I915_USERPTR=y # CONFIG_DRM_I915_WERROR is not set CONFIG_DRM_KMS_FB_HELPER=y CONFIG_DRM_KMS_HELPER=y CONFIG_DRM_MIPI_DSI=y CONFIG_DRM_PANEL=y +CONFIG_DRM_PANEL_BRIDGE=y CONFIG_DRM_RADEON=y # CONFIG_DRM_RADEON_USERPTR is not set CONFIG_DRM_TTM=y # CONFIG_DRM_VMWGFX is not set # CONFIG_EBC_C384_WDT is not set +# CONFIG_EFI_DEV_PATH_PARSER is not set # CONFIG_EISA is not set # CONFIG_EL3 is not set CONFIG_FB=y @@ -85,6 +95,7 @@ CONFIG_FB_CFB_IMAGEBLIT=y CONFIG_FB_CMDLINE=y CONFIG_FB_DEFERRED_IO=y # CONFIG_FB_I810 is not set +# CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA is not set CONFIG_FB_SYS_COPYAREA=y CONFIG_FB_SYS_FILLRECT=y CONFIG_FB_SYS_FOPS=y @@ -99,8 +110,6 @@ CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set CONFIG_HAVE_ACPI_APEI=y CONFIG_HAVE_ACPI_APEI_NMI=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y CONFIG_HDMI=y CONFIG_HID_BATTERY_STRENGTH=y # CONFIG_HIGHMEM64G is not set @@ -121,7 +130,10 @@ CONFIG_INTEL_IDLE=y # CONFIG_INTEL_IPS is not set # CONFIG_INTEL_MENLOW is not set # CONFIG_INTEL_PMC_IPC is not set +# CONFIG_INTEL_SOC_PMIC_CHTWC is not set CONFIG_INTERVAL_TREE=y +CONFIG_IOSF_MBI=y +# CONFIG_IOSF_MBI_DEBUG is not set CONFIG_ISA=y CONFIG_ISAPNP=y CONFIG_ISA_BUS_API=y @@ -146,7 +158,9 @@ CONFIG_MOUSE_PS2_ALPS=y # CONFIG_MOUSE_PS2_ELANTECH is not set CONFIG_MOUSE_PS2_LIFEBOOK=y CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SMBUS=y CONFIG_MOUSE_PS2_SYNAPTICS=y +CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y # CONFIG_MOUSE_PS2_TOUCHKIT is not set CONFIG_MOUSE_PS2_TRACKPOINT=y # CONFIG_MOUSE_SERIAL is not set @@ -175,17 +189,20 @@ CONFIG_PNPACPI=y CONFIG_PNP_DEBUG_MESSAGES=y # CONFIG_PVPANIC is not set CONFIG_RAS=y -CONFIG_RATIONAL=y CONFIG_REGMAP=y CONFIG_REGMAP_I2C=y +CONFIG_RELAY=y CONFIG_RTC_I2C_AND_SPI=y # CONFIG_SAMSUNG_Q10 is not set CONFIG_SATA_AHCI=y CONFIG_SERIAL_8250_PNP=y # CONFIG_SURFACE_PRO3_BUTTON is not set +# CONFIG_SW_SYNC is not set +CONFIG_SYNC_FILE=y # CONFIG_TOSHIBA_BT_RFKILL is not set CONFIG_USB_STORAGE=y CONFIG_VGACON_SOFT_SCROLLBACK=y +# CONFIG_VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT is not set CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64 # CONFIG_WDT is not set CONFIG_X86_ACPI_CPUFREQ=y @@ -200,3 +217,4 @@ CONFIG_X86_MINIMUM_CPU_FAMILY=4 # CONFIG_X86_PCC_CPUFREQ is not set CONFIG_X86_PM_TIMER=y # CONFIG_X86_POWERNOW_K8 is not set +CONFIG_ZLIB_DEFLATE=y diff --git a/target/linux/x86/patches-4.14/011-tune_lzma_options.patch b/target/linux/x86/patches-4.14/011-tune_lzma_options.patch new file mode 100644 index 0000000000..daed310a13 --- /dev/null +++ b/target/linux/x86/patches-4.14/011-tune_lzma_options.patch @@ -0,0 +1,22 @@ +--- a/scripts/Makefile.lib ++++ b/scripts/Makefile.lib +@@ -348,7 +348,7 @@ cmd_bzip2 = (cat $(filter-out FORCE,$^) + + quiet_cmd_lzma = LZMA $@ + cmd_lzma = (cat $(filter-out FORCE,$^) | \ +- lzma e -d20 -lc1 -lp2 -pb2 -eos -si -so && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ ++ lzma e -lc8 -eos -si -so && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ + (rm -f $@ ; false) + + quiet_cmd_lzo = LZO $@ +--- a/arch/x86/include/asm/boot.h ++++ b/arch/x86/include/asm/boot.h +@@ -24,7 +24,7 @@ + # error "Invalid value for CONFIG_PHYSICAL_ALIGN" + #endif + +-#ifdef CONFIG_KERNEL_BZIP2 ++#if defined(CONFIG_KERNEL_BZIP2) || defined(CONFIG_KERNEL_LZMA) + # define BOOT_HEAP_SIZE 0x400000 + #else /* !CONFIG_KERNEL_BZIP2 */ + # define BOOT_HEAP_SIZE 0x10000 diff --git a/target/linux/x86/patches-4.14/100-fix_cs5535_clockevt.patch b/target/linux/x86/patches-4.14/100-fix_cs5535_clockevt.patch new file mode 100644 index 0000000000..c3a7fce9ce --- /dev/null +++ b/target/linux/x86/patches-4.14/100-fix_cs5535_clockevt.patch @@ -0,0 +1,12 @@ +--- a/drivers/clocksource/cs5535-clockevt.c ++++ b/drivers/clocksource/cs5535-clockevt.c +@@ -130,7 +130,8 @@ static irqreturn_t mfgpt_tick(int irq, v + cs5535_mfgpt_write(cs5535_event_clock, MFGPT_REG_SETUP, + MFGPT_SETUP_CNTEN | MFGPT_SETUP_CMP2); + +- cs5535_clockevent.event_handler(&cs5535_clockevent); ++ if (cs5535_clockevent.event_handler) ++ cs5535_clockevent.event_handler(&cs5535_clockevent); + return IRQ_HANDLED; + } + diff --git a/target/linux/x86/patches-4.14/200-pcengines-apu2-reboot.patch b/target/linux/x86/patches-4.14/200-pcengines-apu2-reboot.patch new file mode 100644 index 0000000000..048dfae04e --- /dev/null +++ b/target/linux/x86/patches-4.14/200-pcengines-apu2-reboot.patch @@ -0,0 +1,19 @@ +--- a/arch/x86/kernel/reboot.c ++++ b/arch/x86/kernel/reboot.c +@@ -448,6 +448,16 @@ static const struct dmi_system_id reboot + }, + }, + ++ /* PC Engines */ ++ { /* Handle problems with rebooting on PC Engines apu2 */ ++ .callback = set_pci_reboot, ++ .ident = "PC Engines apu2", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "PC Engines"), ++ DMI_MATCH(DMI_BOARD_NAME, "apu2"), ++ }, ++ }, ++ + /* Sony */ + { /* Handle problems with rebooting on Sony VGN-Z540N */ + .callback = set_bios_reboot, diff --git a/target/linux/x86/patches-4.14/800-hwmon-w83627ehf-dont-claim-nct677x.patch b/target/linux/x86/patches-4.14/800-hwmon-w83627ehf-dont-claim-nct677x.patch new file mode 100644 index 0000000000..ef2e1333e7 --- /dev/null +++ b/target/linux/x86/patches-4.14/800-hwmon-w83627ehf-dont-claim-nct677x.patch @@ -0,0 +1,30 @@ +--- a/drivers/hwmon/w83627ehf.c ++++ b/drivers/hwmon/w83627ehf.c +@@ -2717,8 +2717,8 @@ static int __init w83627ehf_find(int sio + static const char sio_name_W83627UHG[] __initconst = "W83627UHG"; + static const char sio_name_W83667HG[] __initconst = "W83667HG"; + static const char sio_name_W83667HG_B[] __initconst = "W83667HG-B"; +- static const char sio_name_NCT6775[] __initconst = "NCT6775F"; +- static const char sio_name_NCT6776[] __initconst = "NCT6776F"; ++/* static const char sio_name_NCT6775[] __initconst = "NCT6775F"; ++ static const char sio_name_NCT6776[] __initconst = "NCT6776F"; */ + + u16 val; + const char *sio_name; +@@ -2762,14 +2762,14 @@ static int __init w83627ehf_find(int sio + sio_data->kind = w83667hg_b; + sio_name = sio_name_W83667HG_B; + break; +- case SIO_NCT6775_ID: ++/* case SIO_NCT6775_ID: + sio_data->kind = nct6775; + sio_name = sio_name_NCT6775; + break; + case SIO_NCT6776_ID: + sio_data->kind = nct6776; + sio_name = sio_name_NCT6776; +- break; ++ break; */ + default: + if (val != 0xffff) + pr_debug("unsupported chip ID: 0x%04x\n", val); diff --git a/target/linux/x86/patches-4.9/100-fix_cs5535_clockevt.patch b/target/linux/x86/patches-4.9/100-fix_cs5535_clockevt.patch index c49ddca7d6..c3a7fce9ce 100644 --- a/target/linux/x86/patches-4.9/100-fix_cs5535_clockevt.patch +++ b/target/linux/x86/patches-4.9/100-fix_cs5535_clockevt.patch @@ -1,6 +1,6 @@ --- a/drivers/clocksource/cs5535-clockevt.c +++ b/drivers/clocksource/cs5535-clockevt.c -@@ -129,7 +129,8 @@ static irqreturn_t mfgpt_tick(int irq, v +@@ -130,7 +130,8 @@ static irqreturn_t mfgpt_tick(int irq, v cs5535_mfgpt_write(cs5535_event_clock, MFGPT_REG_SETUP, MFGPT_SETUP_CNTEN | MFGPT_SETUP_CMP2); diff --git a/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch b/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch new file mode 100644 index 0000000000..21a8eeff92 --- /dev/null +++ b/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch @@ -0,0 +1,19 @@ +--- a/arch/x86/kernel/reboot.c ++++ b/arch/x86/kernel/reboot.c +@@ -447,6 +447,16 @@ static struct dmi_system_id __initdata r + }, + }, + ++ /* PC Engines */ ++ { /* Handle problems with rebooting on PC Engines apu2 */ ++ .callback = set_pci_reboot, ++ .ident = "PC Engines apu2", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "PC Engines"), ++ DMI_MATCH(DMI_BOARD_NAME, "apu2"), ++ }, ++ }, ++ + /* Sony */ + { /* Handle problems with rebooting on Sony VGN-Z540N */ + .callback = set_bios_reboot, diff --git a/target/linux/xburst/config-3.18 b/target/linux/xburst/config-3.18 index e1b28d66b3..099f5b0ed6 100644 --- a/target/linux/xburst/config-3.18 +++ b/target/linux/xburst/config-3.18 @@ -251,7 +251,6 @@ CONFIG_PREEMPT_COUNT=y # CONFIG_PREEMPT_NONE is not set CONFIG_PREEMPT_RCU=y CONFIG_PRINTK_TIME=y -CONFIG_PROC_PAGE_MONITOR=y CONFIG_PWM=y CONFIG_PWM_JZ4740=y CONFIG_PWM_SYSFS=y diff --git a/target/linux/zynq/config-4.4 b/target/linux/zynq/config-4.4 index 2bab6f2193..e22f2325a8 100644 --- a/target/linux/zynq/config-4.4 +++ b/target/linux/zynq/config-4.4 @@ -544,7 +544,6 @@ CONFIG_PREEMPT_COUNT=y # CONFIG_PREEMPT_NONE is not set CONFIG_PREEMPT_RCU=y CONFIG_PROC_EVENTS=y -CONFIG_PROC_PAGE_MONITOR=y # CONFIG_PROC_STRIPPED is not set CONFIG_PTP_1588_CLOCK=y CONFIG_R8169=y diff --git a/target/sdk/Config.in b/target/sdk/Config.in index 095759d064..0c8a61d247 100644 --- a/target/sdk/Config.in +++ b/target/sdk/Config.in @@ -1,10 +1,10 @@ config SDK - bool "Build the LEDE SDK" + bool "Build the OpenWrt SDK" depends on !EXTERNAL_TOOLCHAIN default BUILDBOT help This is essentially a stripped-down version of the buildroot with a precompiled toolchain. It can be used to develop and - test packages for LEDE before including them in the buildroot + test packages for OpenWrt before including them in the buildroot diff --git a/target/sdk/Makefile b/target/sdk/Makefile index ae65fd1c8f..d3822a0df6 100644 --- a/target/sdk/Makefile +++ b/target/sdk/Makefile @@ -9,6 +9,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/version.mk +include $(INCLUDE_DIR)/download.mk override MAKEFLAGS= @@ -36,7 +37,8 @@ SDK_DIRS = \ $(STAGING_SUBDIR_HOST) \ $(STAGING_SUBDIR_TOOLCHAIN) -GIT_URL:=$(filter git://% http://% https://%,$(shell git config --get remote.origin.url 2>/dev/null)) +GIT_URL:=$(shell git config --get remote.origin.url 2>/dev/null) +GIT_URL:=$(if $(CONFIG_BUILDBOT),$(filter git://% http://% https://%,$(GIT_URL)),$(GIT_URL)) GIT_COMMIT:=$(shell git rev-parse HEAD 2>/dev/null) GIT_BRANCH:=$(filter-out master HEAD,$(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)) GIT_TAGNAME:=$(shell git show-ref --tags --dereference 2>/dev/null | sed -ne '/^$(GIT_COMMIT) / { s|^.*/||; s|\^.*||; p }') @@ -44,7 +46,7 @@ GIT_TAGNAME:=$(shell git show-ref --tags --dereference 2>/dev/null | sed -ne '/^ BASE_FEED:=$(if $(GIT_URL),src-git base $(GIT_URL)$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME)))) BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C git svn info 2>/dev/null | sed -ne 's/^URL: /src-gitsvn base /p')) BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C svn info 2>/dev/null | sed -ne 's/^URL: /src-svn base /p')) -BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),src-git base https://git.lede-project.org/source.git$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME)))) +BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),src-git base $(PROJECT_GIT)/openwrt/openwrt.git$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME)))) KDIR_BASE = $(patsubst $(TOPDIR)/%,%,$(LINUX_DIR)) diff --git a/target/sdk/files/README.SDK b/target/sdk/files/README.SDK index 6f04f94d2c..6699dffcfb 100644 --- a/target/sdk/files/README.SDK +++ b/target/sdk/files/README.SDK @@ -1,7 +1,7 @@ -This is the LEDE SDK. It contains a stripped-down version of +This is the OpenWrt SDK. It contains a stripped-down version of the buildroot. You can use it to test/develop packages without having to compile your own toolchain or any of the libraries -included with LEDE. +included with OpenWrt. To use it, just put your buildroot-compatible package directory (including its dependencies) in the subdir 'package/' and run diff --git a/target/toolchain/Config.in b/target/toolchain/Config.in index e377c20a1b..5a6ecefebb 100644 --- a/target/toolchain/Config.in +++ b/target/toolchain/Config.in @@ -1,8 +1,8 @@ config MAKE_TOOLCHAIN - bool "Package the LEDE-based Toolchain" + bool "Package the OpenWrt-based Toolchain" depends on !EXTERNAL_TOOLCHAIN help Package the created toolchain as a tarball under the bin/ directory as - LEDE-Toolchain-$(BOARD)-for-$(ARCH)$(ARCH_SUFFIX)-gcc-$(GCCV)$(DIR_SUFFIX). + OpenWrt-Toolchain-$(BOARD)-for-$(ARCH)$(ARCH_SUFFIX)-gcc-$(GCCV)$(DIR_SUFFIX). For example, a toolchain for the MIPS architecture might be named - LEDE-Toolchain-malta-for-mipsel_mips32-gcc-4.8-linaro_uClibc-0.9.33.2.tar.bz2. + OpenWrt-Toolchain-malta-for-mipsel_mips32-gcc-4.8-linaro_uClibc-0.9.33.2.tar.bz2. diff --git a/target/toolchain/files/README.TOOLCHAIN b/target/toolchain/files/README.TOOLCHAIN index 86b0189d35..7c0586b207 100644 --- a/target/toolchain/files/README.TOOLCHAIN +++ b/target/toolchain/files/README.TOOLCHAIN @@ -1,2 +1,2 @@ -This is the LEDE SDK. It contains just the toolchain created +This is the OpenWrt SDK. It contains just the toolchain created by buildroot. diff --git a/toolchain/Config.in b/toolchain/Config.in index f6753ad8ba..bf7b9c33d0 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -168,7 +168,6 @@ menuconfig EXTRA_TARGET_ARCH bool prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS depends on !sparc - default y if powerpc64 default n help Some builds may require a 'biarch' toolchain. This option @@ -178,7 +177,6 @@ menuconfig EXTRA_TARGET_ARCH config EXTRA_TARGET_ARCH_NAME string - default "powerpc64" if powerpc64 prompt "Extra architecture name" if EXTRA_TARGET_ARCH help Specify the cpu name (eg powerpc64 or x86_64) of the @@ -186,7 +184,6 @@ menuconfig EXTRA_TARGET_ARCH config EXTRA_TARGET_ARCH_OPTS string - default "-m64" if powerpc64 prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH help If you're specifying an addition target architecture, @@ -241,6 +238,7 @@ comment "C Library" choice prompt "C Library implementation" if TOOLCHAINOPTS default LIBC_USE_UCLIBC if arc + default LIBC_USE_GLIBC if powerpc64 default LIBC_USE_MUSL help Select the C library implementation. @@ -253,13 +251,13 @@ choice config LIBC_USE_UCLIBC select USE_UCLIBC bool "Use uClibc" - depends on !(aarch64 || aarch64_be) + depends on !(aarch64 || aarch64_be || powerpc64) depends on BROKEN || !(arm || armeb || i386 || x86_64 || mips || mipsel || mips64 || mips64el || powerpc) config LIBC_USE_MUSL select USE_MUSL bool "Use musl" - depends on !(arc) + depends on !(arc || powerpc64) endchoice @@ -277,6 +275,7 @@ config GDB Enable if you want to build the gdb. config USE_GLIBC + default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (powerpc64) bool config USE_UCLIBC @@ -284,7 +283,7 @@ config USE_UCLIBC bool config USE_MUSL - default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc) + default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc || powerpc64) bool config USE_EXTERNAL_LIBC diff --git a/toolchain/binutils/Config.in b/toolchain/binutils/Config.in index 8fe33fb6b7..25f721a6b5 100644 --- a/toolchain/binutils/Config.in +++ b/toolchain/binutils/Config.in @@ -22,6 +22,11 @@ choice bool "ARC binutils 2.28" select BINUTILS_VERSION_2_28_ARC + config BINUTILS_USE_VERSION_2_29_1 + depends on !arc + bool "Binutils 2.29.1" + select BINUTILS_VERSION_2_29_1 + endchoice config EXTRA_BINUTILS_CONFIG_OPTIONS diff --git a/toolchain/binutils/Config.version b/toolchain/binutils/Config.version index 1b223e4109..54df1730c7 100644 --- a/toolchain/binutils/Config.version +++ b/toolchain/binutils/Config.version @@ -9,8 +9,12 @@ config BINUTILS_VERSION_2_28_ARC default y if (!TOOLCHAINOPTS && arc) bool +config BINUTILS_VERSION_2_29_1 + bool + config BINUTILS_VERSION string default "2.27" if BINUTILS_VERSION_2_27 default "2.28" if BINUTILS_VERSION_2_28 + default "2.29.1" if BINUTILS_VERSION_2_29_1 default "arc-2017.03" if BINUTILS_VERSION_2_28_ARC diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile index 6df11fbd3c..fd4af5c25c 100644 --- a/toolchain/binutils/Makefile +++ b/toolchain/binutils/Makefile @@ -21,6 +21,10 @@ ifeq ($(PKG_VERSION),2.28) PKG_HASH:=6297433ee120b11b4b0a1c8f3512d7d73501753142ab9e2daa13c5a3edd32a72 endif +ifeq ($(PKG_VERSION),2.29.1) + PKG_HASH:=1509dff41369fb70aed23682351b663b56db894034773e6dbf7d5d6071fc55cc +endif + ifneq ($(CONFIG_BINUTILS_VERSION_2_28_ARC),) PKG_REV:=arc-2017.03-release PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/$(PKG_REV)/ diff --git a/toolchain/binutils/patches/2.29.1/300-001_ld_makefile_patch.patch b/toolchain/binutils/patches/2.29.1/300-001_ld_makefile_patch.patch new file mode 100644 index 0000000000..4365197f74 --- /dev/null +++ b/toolchain/binutils/patches/2.29.1/300-001_ld_makefile_patch.patch @@ -0,0 +1,22 @@ +--- a/ld/Makefile.am ++++ b/ld/Makefile.am +@@ -57,7 +57,7 @@ endif + # We put the scripts in the directory $(scriptdir)/ldscripts. + # We can't put the scripts in $(datadir) because the SEARCH_DIR + # directives need to be different for native and cross linkers. +-scriptdir = $(tooldir)/lib ++scriptdir = $(libdir) + + EMUL = @EMUL@ + EMULATION_OFILES = @EMULATION_OFILES@ +--- a/ld/Makefile.in ++++ b/ld/Makefile.in +@@ -446,7 +446,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) + # We put the scripts in the directory $(scriptdir)/ldscripts. + # We can't put the scripts in $(datadir) because the SEARCH_DIR + # directives need to be different for native and cross linkers. +-scriptdir = $(tooldir)/lib ++scriptdir = $(libdir) + BASEDIR = $(srcdir)/.. + BFDDIR = $(BASEDIR)/bfd + INCDIR = $(BASEDIR)/include diff --git a/toolchain/binutils/patches/2.29.1/300-012_check_ldrunpath_length.patch b/toolchain/binutils/patches/2.29.1/300-012_check_ldrunpath_length.patch new file mode 100644 index 0000000000..0b02c55978 --- /dev/null +++ b/toolchain/binutils/patches/2.29.1/300-012_check_ldrunpath_length.patch @@ -0,0 +1,20 @@ +--- a/ld/emultempl/elf32.em ++++ b/ld/emultempl/elf32.em +@@ -1463,6 +1463,8 @@ fragment <link.next) + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/toolchain/binutils/patches/2.29.1/400-mips_no_dynamic_linking_sym.patch b/toolchain/binutils/patches/2.29.1/400-mips_no_dynamic_linking_sym.patch new file mode 100644 index 0000000000..a28e9348a3 --- /dev/null +++ b/toolchain/binutils/patches/2.29.1/400-mips_no_dynamic_linking_sym.patch @@ -0,0 +1,18 @@ +--- a/bfd/elfxx-mips.c ++++ b/bfd/elfxx-mips.c +@@ -7871,6 +7871,7 @@ _bfd_mips_elf_create_dynamic_sections (b + + name = SGI_COMPAT (abfd) ? "_DYNAMIC_LINK" : "_DYNAMIC_LINKING"; + bh = NULL; ++ if (0) { + if (!(_bfd_generic_link_add_one_symbol + (info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr, 0, + NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh))) +@@ -7883,6 +7884,7 @@ _bfd_mips_elf_create_dynamic_sections (b + + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; ++ } + + if (! mips_elf_hash_table (info)->use_rld_obj_head) + { diff --git a/toolchain/binutils/patches/2.29.1/500-Change-default-emulation-for-mips64-linux.patch b/toolchain/binutils/patches/2.29.1/500-Change-default-emulation-for-mips64-linux.patch new file mode 100644 index 0000000000..53d5b5ac5a --- /dev/null +++ b/toolchain/binutils/patches/2.29.1/500-Change-default-emulation-for-mips64-linux.patch @@ -0,0 +1,37 @@ +--- a/bfd/config.bfd ++++ b/bfd/config.bfd +@@ -1186,12 +1186,12 @@ case "${targ}" in + targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec" + ;; + mips64*el-*-linux*) +- targ_defvec=mips_elf32_ntrad_le_vec +- targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec" ++ targ_defvec=mips_elf64_trad_le_vec ++ targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_be_vec" + ;; + mips64*-*-linux*) +- targ_defvec=mips_elf32_ntrad_be_vec +- targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec" ++ targ_defvec=mips_elf64_trad_be_vec ++ targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_le_vec" + ;; + mips*el-*-linux*) + targ_defvec=mips_elf32_trad_le_vec +--- a/ld/configure.tgt ++++ b/ld/configure.tgt +@@ -530,11 +530,11 @@ mips*el-*-vxworks*) targ_emul=elf32elmip + mips*-*-vxworks*) targ_emul=elf32ebmipvxworks + targ_extra_emuls="elf32elmipvxworks" ;; + mips*-*-windiss) targ_emul=elf32mipswindiss ;; +-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32 +- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" ++mips64*el-*-linux-*) targ_emul=elf64ltsmip ++ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip" + targ_extra_libpath=$targ_extra_emuls ;; +-mips64*-*-linux-*) targ_emul=elf32btsmipn32 +- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip" ++mips64*-*-linux-*) targ_emul=elf64btsmip ++ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip" + targ_extra_libpath=$targ_extra_emuls ;; + mips*el-*-linux-*) targ_emul=elf32ltsmip + targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip" diff --git a/toolchain/fortify-headers/Makefile b/toolchain/fortify-headers/Makefile index 8caf8c84ce..8550a999ca 100644 --- a/toolchain/fortify-headers/Makefile +++ b/toolchain/fortify-headers/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/target.mk PKG_NAME:=fortify-headers -PKG_VERSION:=0.8 +PKG_VERSION:=0.9 PKG_RELEASE=1 PKG_SOURCE_URL:=http://dl.2f30.org/releases PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_HASH:=afcd073d6d8d175eede2a28a7dd71b7150cb03290f99102261892c793f6b4cb1 +PKG_HASH:=cf75f1c27a95da8ebf124293e8dc534ff6a4625d703ff169998292e1a53aa1fc include $(INCLUDE_DIR)/toolchain-build.mk diff --git a/toolchain/gcc/Config.in b/toolchain/gcc/Config.in index ea33ac29c1..a54c8d12d3 100644 --- a/toolchain/gcc/Config.in +++ b/toolchain/gcc/Config.in @@ -54,14 +54,6 @@ config SJLJ_EXCEPTIONS frame unwinding exceptions handling routines. Warning: increases code size and runtime memory usage. -config INSTALL_LIBGCJ - bool - prompt "Build/install java compiler and GNU classpath ?" if TOOLCHAINOPTS - default n - help - Build/install java compiler and GNU classpath ? - - config INSTALL_GFORTRAN bool prompt "Build/install fortran compiler?" if TOOLCHAINOPTS diff --git a/toolchain/gcc/Config.version b/toolchain/gcc/Config.version index 86c723dc9a..4edf8a87a9 100644 --- a/toolchain/gcc/Config.version +++ b/toolchain/gcc/Config.version @@ -6,8 +6,8 @@ config GCC_VERSION string default "arc-2017.03-release" if GCC_VERSION_6_3_ARC default "6.3.0" if GCC_USE_VERSION_6 - default "7.1.0" if GCC_USE_VERSION_7 - default "5.4.0" + default "7.2.0" if GCC_USE_VERSION_7 + default "5.5.0" config GCC_VERSION_6_3 bool diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk index ec4d9fcc97..69214aca03 100644 --- a/toolchain/gcc/common.mk +++ b/toolchain/gcc/common.mk @@ -26,18 +26,19 @@ PKG_VERSION:=$(firstword $(subst +, ,$(GCC_VERSION))) GCC_DIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -ifeq ($(PKG_VERSION),5.4.0) - PKG_HASH:=608df76dec2d34de6558249d8af4cbee21eceddbcb580d666f7a5a583ca3303a +ifeq ($(PKG_VERSION),5.5.0) + PKG_HASH:=530cea139d82fe542b358961130c69cfde8b3d14556370b65823d2f91f0ced87 endif ifeq ($(PKG_VERSION),6.3.0) PKG_HASH:=f06ae7f3f790fbf0f018f6d40e844451e6bc3b7bc96e128e63b09825c1f8b29f + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 endif -ifeq ($(PKG_VERSION),7.1.0) - PKG_HASH:=8a8136c235f64c6fef69cac0d73a46a1a09bb250776a050aec8f9fc880bebc17 +ifeq ($(PKG_VERSION),7.2.0) + PKG_HASH:=1cf7adf8ff4b5aa49041c8734bbcf1ad18cc4c94d0029aae0f4e48841088479a endif ifneq ($(CONFIG_GCC_VERSION_6_3_ARC),) @@ -53,7 +54,7 @@ endif PATCH_DIR=../patches/$(GCC_VERSION) BUGURL=http://www.lede-project.org/bugs/ -PKGVERSION=LEDE GCC $(PKG_VERSION) $(REVISION) +PKGVERSION=OpenWrt GCC $(PKG_VERSION) $(REVISION) HOST_BUILD_PARALLEL:=1 @@ -73,14 +74,11 @@ HOST_STAMP_CONFIGURED:=$(GCC_BUILD_DIR)/.configured HOST_STAMP_INSTALLED:=$(HOST_BUILD_PREFIX)/stamp/.gcc_$(GCC_VARIANT)_installed SEP:=, -TARGET_LANGUAGES:="c,c++$(if $(CONFIG_INSTALL_LIBGCJ),$(SEP)java)$(if $(CONFIG_INSTALL_GFORTRAN),$(SEP)fortran)$(if $(CONFIG_INSTALL_GCCGO),$(SEP)go)" +TARGET_LANGUAGES:="c,c++$(if $(CONFIG_INSTALL_GFORTRAN),$(SEP)fortran)$(if $(CONFIG_INSTALL_GCCGO),$(SEP)go)" TAR_OPTIONS += \ --exclude-from='$(CURDIR)/../exclude-testsuite' --exclude=gcc/ada/*.ad* \ - -ifndef CONFIG_INSTALL_LIBGCJ - TAR_OPTIONS += --exclude=libjava -endif + --exclude=libjava export libgcc_cv_fixed_point=no ifdef CONFIG_USE_UCLIBC diff --git a/toolchain/gcc/patches/5.4.0/001-revert_register_mode_search.patch b/toolchain/gcc/patches/5.5.0/001-revert_register_mode_search.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/001-revert_register_mode_search.patch rename to toolchain/gcc/patches/5.5.0/001-revert_register_mode_search.patch diff --git a/toolchain/gcc/patches/5.4.0/002-case_insensitive.patch b/toolchain/gcc/patches/5.5.0/002-case_insensitive.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/002-case_insensitive.patch rename to toolchain/gcc/patches/5.5.0/002-case_insensitive.patch diff --git a/toolchain/gcc/patches/7.1.0/010-documentation.patch b/toolchain/gcc/patches/5.5.0/010-documentation.patch similarity index 91% rename from toolchain/gcc/patches/7.1.0/010-documentation.patch rename to toolchain/gcc/patches/5.5.0/010-documentation.patch index 46fe81f129..d7166b24e7 100644 --- a/toolchain/gcc/patches/7.1.0/010-documentation.patch +++ b/toolchain/gcc/patches/5.5.0/010-documentation.patch @@ -1,6 +1,6 @@ --- a/gcc/Makefile.in +++ b/gcc/Makefile.in -@@ -3120,18 +3120,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) +@@ -2943,18 +2943,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) doc/gccint.info: $(TEXI_GCCINT_FILES) doc/cppinternals.info: $(TEXI_CPPINT_FILES) diff --git a/toolchain/gcc/patches/5.4.0/020-no-plt-backport.patch b/toolchain/gcc/patches/5.5.0/020-no-plt-backport.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/020-no-plt-backport.patch rename to toolchain/gcc/patches/5.5.0/020-no-plt-backport.patch diff --git a/toolchain/gcc/patches/5.4.0/040-fix-mips-ICE-PR-68400.patch b/toolchain/gcc/patches/5.5.0/040-fix-mips-ICE-PR-68400.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/040-fix-mips-ICE-PR-68400.patch rename to toolchain/gcc/patches/5.5.0/040-fix-mips-ICE-PR-68400.patch diff --git a/toolchain/gcc/patches/5.4.0/200-musl_config.patch b/toolchain/gcc/patches/5.5.0/200-musl_config.patch similarity index 98% rename from toolchain/gcc/patches/5.4.0/200-musl_config.patch rename to toolchain/gcc/patches/5.5.0/200-musl_config.patch index b9a5b28274..178c25ce34 100644 --- a/toolchain/gcc/patches/5.4.0/200-musl_config.patch +++ b/toolchain/gcc/patches/5.5.0/200-musl_config.patch @@ -277,7 +277,7 @@ git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222904 138bc75d-0d04-0410-961f-8 if test x$gcc_cv_target_dl_iterate_phdr = xyes; then --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -667,7 +667,7 @@ Objective-C and Objective-C++ Dialects}. +@@ -668,7 +668,7 @@ Objective-C and Objective-C++ Dialects}. -mcpu=@var{cpu}} @emph{GNU/Linux Options} @@ -286,7 +286,7 @@ git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222904 138bc75d-0d04-0410-961f-8 -tno-android-cc -tno-android-ld} @emph{H8/300 Options} -@@ -15340,13 +15340,19 @@ These @samp{-m} options are defined for +@@ -15351,13 +15351,19 @@ These @samp{-m} options are defined for @item -mglibc @opindex mglibc Use the GNU C library. This is the default except diff --git a/toolchain/gcc/patches/5.4.0/201-musl_arm.patch b/toolchain/gcc/patches/5.5.0/201-musl_arm.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/201-musl_arm.patch rename to toolchain/gcc/patches/5.5.0/201-musl_arm.patch diff --git a/toolchain/gcc/patches/5.4.0/202-musl_mips.patch b/toolchain/gcc/patches/5.5.0/202-musl_mips.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/202-musl_mips.patch rename to toolchain/gcc/patches/5.5.0/202-musl_mips.patch diff --git a/toolchain/gcc/patches/5.4.0/203-musl_powerpc.patch b/toolchain/gcc/patches/5.5.0/203-musl_powerpc.patch similarity index 98% rename from toolchain/gcc/patches/5.4.0/203-musl_powerpc.patch rename to toolchain/gcc/patches/5.5.0/203-musl_powerpc.patch index b4f34e81ca..073c834ce1 100644 --- a/toolchain/gcc/patches/5.4.0/203-musl_powerpc.patch +++ b/toolchain/gcc/patches/5.5.0/203-musl_powerpc.patch @@ -52,7 +52,7 @@ gcc/Changelog: #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN) --- a/gcc/config/rs6000/secureplt.h +++ b/gcc/config/rs6000/secureplt.h -@@ -18,3 +18,4 @@ along with GCC; see the file COPYING3. +@@ -18,3 +18,4 @@ along with GCC; see the file COPYING3. . */ #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt" @@ -196,7 +196,7 @@ gcc/Changelog: +#define MUSL_DYNAMIC_LINKER_E ENDIAN_SELECT("","le","le") --- a/gcc/config.gcc +++ b/gcc/config.gcc -@@ -2416,6 +2416,10 @@ powerpc*-*-linux*) +@@ -2430,6 +2430,10 @@ powerpc*-*-linux*) powerpc*-*-linux*paired*) tm_file="${tm_file} rs6000/750cl.h" ;; esac diff --git a/toolchain/gcc/patches/5.4.0/204-musl_sh.patch b/toolchain/gcc/patches/5.5.0/204-musl_sh.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/204-musl_sh.patch rename to toolchain/gcc/patches/5.5.0/204-musl_sh.patch diff --git a/toolchain/gcc/patches/5.4.0/205-musl_x86.patch b/toolchain/gcc/patches/5.5.0/205-musl_x86.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/205-musl_x86.patch rename to toolchain/gcc/patches/5.5.0/205-musl_x86.patch diff --git a/toolchain/gcc/patches/5.4.0/206-musl_aarch64.patch b/toolchain/gcc/patches/5.5.0/206-musl_aarch64.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/206-musl_aarch64.patch rename to toolchain/gcc/patches/5.5.0/206-musl_aarch64.patch diff --git a/toolchain/gcc/patches/5.4.0/207-musl_fixincludes.patch b/toolchain/gcc/patches/5.5.0/207-musl_fixincludes.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/207-musl_fixincludes.patch rename to toolchain/gcc/patches/5.5.0/207-musl_fixincludes.patch diff --git a/toolchain/gcc/patches/5.4.0/209-musl_libstdc++.patch b/toolchain/gcc/patches/5.5.0/209-musl_libstdc++.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/209-musl_libstdc++.patch rename to toolchain/gcc/patches/5.5.0/209-musl_libstdc++.patch diff --git a/toolchain/gcc/patches/5.4.0/230-musl_libssp.patch b/toolchain/gcc/patches/5.5.0/230-musl_libssp.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/230-musl_libssp.patch rename to toolchain/gcc/patches/5.5.0/230-musl_libssp.patch diff --git a/toolchain/gcc/patches/5.4.0/240-musl-libitm-fixes.patch b/toolchain/gcc/patches/5.5.0/240-musl-libitm-fixes.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/240-musl-libitm-fixes.patch rename to toolchain/gcc/patches/5.5.0/240-musl-libitm-fixes.patch diff --git a/toolchain/gcc/patches/5.4.0/250-add-musl.patch b/toolchain/gcc/patches/5.5.0/250-add-musl.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/250-add-musl.patch rename to toolchain/gcc/patches/5.5.0/250-add-musl.patch diff --git a/toolchain/gcc/patches/5.4.0/260-musl-add-unwind-fix.patch b/toolchain/gcc/patches/5.5.0/260-musl-add-unwind-fix.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/260-musl-add-unwind-fix.patch rename to toolchain/gcc/patches/5.5.0/260-musl-add-unwind-fix.patch diff --git a/toolchain/gcc/patches/5.4.0/270-musl-add-powerpc-softfloat-fix.patch b/toolchain/gcc/patches/5.5.0/270-musl-add-powerpc-softfloat-fix.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/270-musl-add-powerpc-softfloat-fix.patch rename to toolchain/gcc/patches/5.5.0/270-musl-add-powerpc-softfloat-fix.patch diff --git a/toolchain/gcc/patches/5.4.0/280-musl-disable-ifunc-by-default.patch b/toolchain/gcc/patches/5.5.0/280-musl-disable-ifunc-by-default.patch similarity index 81% rename from toolchain/gcc/patches/5.4.0/280-musl-disable-ifunc-by-default.patch rename to toolchain/gcc/patches/5.5.0/280-musl-disable-ifunc-by-default.patch index af5acf8cc9..9a043eed3c 100644 --- a/toolchain/gcc/patches/5.4.0/280-musl-disable-ifunc-by-default.patch +++ b/toolchain/gcc/patches/5.5.0/280-musl-disable-ifunc-by-default.patch @@ -14,11 +14,9 @@ git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239859 138bc75d-0d04-0410-961f-8 gcc/config.gcc | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) -diff --git a/gcc/config.gcc b/gcc/config.gcc -index 8827dc8..e544d76 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc -@@ -1465,7 +1465,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-gnu* | i[34567]8 +@@ -1455,7 +1455,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfree extra_options="${extra_options} linux-android.opt" # Assume modern glibc if not targeting Android nor uclibc. case ${target} in @@ -27,7 +25,7 @@ index 8827dc8..e544d76 100644 ;; *) default_gnu_indirect_function=yes -@@ -1531,7 +1531,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu) +@@ -1524,7 +1524,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu extra_options="${extra_options} linux-android.opt" # Assume modern glibc if not targeting Android nor uclibc. case ${target} in diff --git a/toolchain/gcc/patches/5.4.0/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain/gcc/patches/5.5.0/300-mips_Os_cpu_rtx_cost_model.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/300-mips_Os_cpu_rtx_cost_model.patch rename to toolchain/gcc/patches/5.5.0/300-mips_Os_cpu_rtx_cost_model.patch diff --git a/toolchain/gcc/patches/5.4.0/800-arm_v5te_no_ldrd_strd.patch b/toolchain/gcc/patches/5.5.0/800-arm_v5te_no_ldrd_strd.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/800-arm_v5te_no_ldrd_strd.patch rename to toolchain/gcc/patches/5.5.0/800-arm_v5te_no_ldrd_strd.patch diff --git a/toolchain/gcc/patches/5.4.0/810-arm-softfloat-libgcc.patch b/toolchain/gcc/patches/5.5.0/810-arm-softfloat-libgcc.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/810-arm-softfloat-libgcc.patch rename to toolchain/gcc/patches/5.5.0/810-arm-softfloat-libgcc.patch diff --git a/toolchain/gcc/patches/5.4.0/820-libgcc_pic.patch b/toolchain/gcc/patches/5.5.0/820-libgcc_pic.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/820-libgcc_pic.patch rename to toolchain/gcc/patches/5.5.0/820-libgcc_pic.patch diff --git a/toolchain/gcc/patches/5.4.0/830-arm_unbreak_armv4t.patch b/toolchain/gcc/patches/5.5.0/830-arm_unbreak_armv4t.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/830-arm_unbreak_armv4t.patch rename to toolchain/gcc/patches/5.5.0/830-arm_unbreak_armv4t.patch diff --git a/toolchain/gcc/patches/5.4.0/840-armv4_pass_fix-v4bx_to_ld.patch b/toolchain/gcc/patches/5.5.0/840-armv4_pass_fix-v4bx_to_ld.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/840-armv4_pass_fix-v4bx_to_ld.patch rename to toolchain/gcc/patches/5.5.0/840-armv4_pass_fix-v4bx_to_ld.patch diff --git a/toolchain/gcc/patches/5.4.0/850-use_shared_libgcc.patch b/toolchain/gcc/patches/5.5.0/850-use_shared_libgcc.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/850-use_shared_libgcc.patch rename to toolchain/gcc/patches/5.5.0/850-use_shared_libgcc.patch diff --git a/toolchain/gcc/patches/5.4.0/851-libgcc_no_compat.patch b/toolchain/gcc/patches/5.5.0/851-libgcc_no_compat.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/851-libgcc_no_compat.patch rename to toolchain/gcc/patches/5.5.0/851-libgcc_no_compat.patch diff --git a/toolchain/gcc/patches/5.4.0/870-ppc_no_crtsavres.patch b/toolchain/gcc/patches/5.5.0/870-ppc_no_crtsavres.patch similarity index 84% rename from toolchain/gcc/patches/5.4.0/870-ppc_no_crtsavres.patch rename to toolchain/gcc/patches/5.5.0/870-ppc_no_crtsavres.patch index 0e64a4164b..d06673efc2 100644 --- a/toolchain/gcc/patches/5.4.0/870-ppc_no_crtsavres.patch +++ b/toolchain/gcc/patches/5.5.0/870-ppc_no_crtsavres.patch @@ -1,6 +1,6 @@ --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c -@@ -21500,7 +21500,7 @@ rs6000_savres_strategy (rs6000_stack_t * +@@ -21528,7 +21528,7 @@ rs6000_savres_strategy (rs6000_stack_t * /* Define cutoff for using out-of-line functions to save registers. */ if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) { diff --git a/toolchain/gcc/patches/5.4.0/880-no_java_section.patch b/toolchain/gcc/patches/5.5.0/880-no_java_section.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/880-no_java_section.patch rename to toolchain/gcc/patches/5.5.0/880-no_java_section.patch diff --git a/toolchain/gcc/patches/5.4.0/881-no_tm_section.patch b/toolchain/gcc/patches/5.5.0/881-no_tm_section.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/881-no_tm_section.patch rename to toolchain/gcc/patches/5.5.0/881-no_tm_section.patch diff --git a/toolchain/gcc/patches/5.4.0/900-bad-mips16-crt.patch b/toolchain/gcc/patches/5.5.0/900-bad-mips16-crt.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/900-bad-mips16-crt.patch rename to toolchain/gcc/patches/5.5.0/900-bad-mips16-crt.patch diff --git a/toolchain/gcc/patches/5.4.0/910-mbsd_multi.patch b/toolchain/gcc/patches/5.5.0/910-mbsd_multi.patch similarity index 97% rename from toolchain/gcc/patches/5.4.0/910-mbsd_multi.patch rename to toolchain/gcc/patches/5.5.0/910-mbsd_multi.patch index 2d7272ef95..88905f6f2f 100644 --- a/toolchain/gcc/patches/5.4.0/910-mbsd_multi.patch +++ b/toolchain/gcc/patches/5.5.0/910-mbsd_multi.patch @@ -39,7 +39,7 @@ case OPT_fconstant_string_class_: constant_string_class_name = arg; break; -@@ -1034,6 +1043,47 @@ c_common_init (void) +@@ -1039,6 +1048,47 @@ c_common_init (void) return false; } @@ -178,7 +178,7 @@ -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol -Wformat-security -Wformat-signedness -Wformat-y2k @gol -@@ -5382,6 +5382,22 @@ This option is only supported for C and +@@ -5388,6 +5388,22 @@ This option is only supported for C and @option{-Wall} and by @option{-Wpedantic}, which can be disabled with @option{-Wno-pointer-sign}. @@ -201,7 +201,7 @@ @item -Wstack-protector @opindex Wstack-protector @opindex Wno-stack-protector -@@ -7860,7 +7876,7 @@ so, the first branch is redirected to ei +@@ -7866,7 +7882,7 @@ so, the first branch is redirected to ei second branch or a point immediately following it, depending on whether the condition is known to be true or false. diff --git a/toolchain/gcc/patches/5.4.0/920-specs_nonfatal_getenv.patch b/toolchain/gcc/patches/5.5.0/920-specs_nonfatal_getenv.patch similarity index 86% rename from toolchain/gcc/patches/5.4.0/920-specs_nonfatal_getenv.patch rename to toolchain/gcc/patches/5.5.0/920-specs_nonfatal_getenv.patch index 3d708f24c3..4c705ad86b 100644 --- a/toolchain/gcc/patches/5.4.0/920-specs_nonfatal_getenv.patch +++ b/toolchain/gcc/patches/5.5.0/920-specs_nonfatal_getenv.patch @@ -1,6 +1,6 @@ --- a/gcc/gcc.c +++ b/gcc/gcc.c -@@ -8807,8 +8807,10 @@ getenv_spec_function (int argc, const ch +@@ -8828,8 +8828,10 @@ getenv_spec_function (int argc, const ch value = getenv (argv[0]); if (!value) diff --git a/toolchain/gcc/patches/5.4.0/930-fix-mips-noexecstack.patch b/toolchain/gcc/patches/5.5.0/930-fix-mips-noexecstack.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/930-fix-mips-noexecstack.patch rename to toolchain/gcc/patches/5.5.0/930-fix-mips-noexecstack.patch diff --git a/toolchain/gcc/patches/5.4.0/931-fix-MIPS-softfloat-build-issue.patch b/toolchain/gcc/patches/5.5.0/931-fix-MIPS-softfloat-build-issue.patch similarity index 91% rename from toolchain/gcc/patches/5.4.0/931-fix-MIPS-softfloat-build-issue.patch rename to toolchain/gcc/patches/5.5.0/931-fix-MIPS-softfloat-build-issue.patch index c8461a9618..9ac0939eb0 100644 --- a/toolchain/gcc/patches/5.4.0/931-fix-MIPS-softfloat-build-issue.patch +++ b/toolchain/gcc/patches/5.5.0/931-fix-MIPS-softfloat-build-issue.patch @@ -11,11 +11,9 @@ Signed-off-by: BangLang Huang libffi/src/mips/o32.S | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) -diff --git a/libffi/src/mips/n32.S b/libffi/src/mips/n32.S -index c6985d3..8f25994 100644 --- a/libffi/src/mips/n32.S +++ b/libffi/src/mips/n32.S -@@ -107,6 +107,16 @@ loadregs: +@@ -107,6 +107,16 @@ loadregs: REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6. @@ -32,7 +30,7 @@ index c6985d3..8f25994 100644 and t4, t6, ((1<}, otherwise just like @option{-I}. @@ -79,7 +79,7 @@ Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4 Add directory @var{dir} to the list of directories to be searched --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h -@@ -751,6 +751,9 @@ extern void cpp_set_lang (cpp_reader *, +@@ -751,6 +751,9 @@ extern void cpp_set_lang (cpp_reader *, /* Set the include paths. */ extern void cpp_set_include_chains (cpp_reader *, cpp_dir *, cpp_dir *, int); diff --git a/toolchain/gcc/patches/5.4.0/960-go_libm.patch b/toolchain/gcc/patches/5.5.0/960-go_libm.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/960-go_libm.patch rename to toolchain/gcc/patches/5.5.0/960-go_libm.patch diff --git a/toolchain/gcc/patches/5.4.0/970-warn_bug.patch b/toolchain/gcc/patches/5.5.0/970-warn_bug.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/970-warn_bug.patch rename to toolchain/gcc/patches/5.5.0/970-warn_bug.patch diff --git a/toolchain/gcc/patches/7.1.0/230-musl_libssp.patch b/toolchain/gcc/patches/7.1.0/230-musl_libssp.patch deleted file mode 100644 index 65b5710d6f..0000000000 --- a/toolchain/gcc/patches/7.1.0/230-musl_libssp.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/gcc/gcc.c -+++ b/gcc/gcc.c -@@ -861,7 +861,9 @@ proper position among the other output f - #endif - - #ifndef LINK_SSP_SPEC --#ifdef TARGET_LIBC_PROVIDES_SSP -+#if DEFAULT_LIBC == LIBC_MUSL -+#define LINK_SSP_SPEC "-lssp_nonshared" -+#elif defined(TARGET_LIBC_PROVIDES_SSP) - #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ - "|fstack-protector-strong|fstack-protector-explicit:}" - #else diff --git a/toolchain/gcc/patches/7.1.0/800-arm_v5te_no_ldrd_strd.patch b/toolchain/gcc/patches/7.1.0/800-arm_v5te_no_ldrd_strd.patch deleted file mode 100644 index 435f5715b5..0000000000 --- a/toolchain/gcc/patches/7.1.0/800-arm_v5te_no_ldrd_strd.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/config/arm/arm.h -+++ b/gcc/config/arm/arm.h -@@ -150,7 +150,7 @@ extern tree arm_fp16_type_node; - /* Thumb-1 only. */ - #define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm) - --#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN \ -+#define TARGET_LDRD (arm_arch6 && ARM_DOUBLEWORD_ALIGN \ - && !TARGET_THUMB1) - - #define TARGET_CRC32 (arm_arch_crc) diff --git a/toolchain/gcc/patches/7.1.0/870-ppc_no_crtsavres.patch b/toolchain/gcc/patches/7.1.0/870-ppc_no_crtsavres.patch deleted file mode 100644 index 332b8b62a6..0000000000 --- a/toolchain/gcc/patches/7.1.0/870-ppc_no_crtsavres.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/config/rs6000/rs6000.c -+++ b/gcc/config/rs6000/rs6000.c -@@ -26889,7 +26889,7 @@ rs6000_savres_strategy (rs6000_stack_t * - /* Define cutoff for using out-of-line functions to save registers. */ - if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) - { -- if (!optimize_size) -+ if (1) - { - strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; - strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; diff --git a/toolchain/gcc/patches/7.1.0/881-no_tm_section.patch b/toolchain/gcc/patches/7.1.0/881-no_tm_section.patch deleted file mode 100644 index fab5db3be5..0000000000 --- a/toolchain/gcc/patches/7.1.0/881-no_tm_section.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/libgcc/crtstuff.c -+++ b/libgcc/crtstuff.c -@@ -152,7 +152,7 @@ call_ ## FUNC (void) \ - #endif - - #if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) --# define USE_TM_CLONE_REGISTRY 1 -+# define USE_TM_CLONE_REGISTRY 0 - #endif - - /* We do not want to add the weak attribute to the declarations of these diff --git a/toolchain/gcc/patches/7.1.0/900-bad-mips16-crt.patch b/toolchain/gcc/patches/7.1.0/900-bad-mips16-crt.patch deleted file mode 100644 index dd6e9dc889..0000000000 --- a/toolchain/gcc/patches/7.1.0/900-bad-mips16-crt.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- a/libgcc/config/mips/t-mips16 -+++ b/libgcc/config/mips/t-mips16 -@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16 - - # Version these symbols if building libgcc.so. - SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver -+ -+CRTSTUFF_T_CFLAGS += -mno-mips16 -+CRTSTUFF_T_CFLAGS_S += -mno-mips16 diff --git a/toolchain/gcc/patches/7.1.0/940-no-clobber-stamp-bits.patch b/toolchain/gcc/patches/7.1.0/940-no-clobber-stamp-bits.patch deleted file mode 100644 index 9e5e59970e..0000000000 --- a/toolchain/gcc/patches/7.1.0/940-no-clobber-stamp-bits.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/libstdc++-v3/include/Makefile.in -+++ b/libstdc++-v3/include/Makefile.in -@@ -1475,7 +1475,7 @@ stamp-bits: ${bits_headers} - @$(STAMP) stamp-bits - - stamp-bits-sup: stamp-bits ${bits_sup_headers} -- @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null -+ @-cd ${bits_builddir} && $(LN_S) $(filter-out stamp-bits,$?) . 2>/dev/null - @$(STAMP) stamp-bits-sup - - stamp-c_base: ${c_base_headers} diff --git a/toolchain/gcc/patches/7.1.0/001-revert_register_mode_search.patch b/toolchain/gcc/patches/7.2.0/001-revert_register_mode_search.patch similarity index 87% rename from toolchain/gcc/patches/7.1.0/001-revert_register_mode_search.patch rename to toolchain/gcc/patches/7.2.0/001-revert_register_mode_search.patch index adcc7c3c54..63e3fee003 100644 --- a/toolchain/gcc/patches/7.1.0/001-revert_register_mode_search.patch +++ b/toolchain/gcc/patches/7.2.0/001-revert_register_mode_search.patch @@ -1,3 +1,15 @@ +commit 31285a20390a5e53a74a2a71d1b5c82f366ddd5a +Author: Felix Fietkau +Date: Tue May 6 11:49:05 2014 +0000 + + gcc: revert an upstream patch that is causing a regression on powerpc + + https://forum.openwrt.org/viewtopic.php?pid=232494#p232494 + + Signed-off-by: Felix Fietkau + + SVN-Revision: 40709 + Revert of: commit 275035b56823b26d5fb7e90fad945b998648edf2 diff --git a/toolchain/gcc/patches/7.1.0/002-case_insensitive.patch b/toolchain/gcc/patches/7.2.0/002-case_insensitive.patch similarity index 64% rename from toolchain/gcc/patches/7.1.0/002-case_insensitive.patch rename to toolchain/gcc/patches/7.2.0/002-case_insensitive.patch index b3d2dbe291..3442076d7d 100644 --- a/toolchain/gcc/patches/7.1.0/002-case_insensitive.patch +++ b/toolchain/gcc/patches/7.2.0/002-case_insensitive.patch @@ -1,3 +1,13 @@ +commit 81cc26c706b2bc8c8c1eb1a322e5c5157900836e +Author: Felix Fietkau +Date: Sun Oct 19 21:45:51 2014 +0000 + + gcc: do not assume that the Mac OS X filesystem is case insensitive + + Signed-off-by: Felix Fietkau + + SVN-Revision: 42973 + --- a/include/filenames.h +++ b/include/filenames.h @@ -43,11 +43,6 @@ extern "C" { diff --git a/toolchain/gcc/patches/5.4.0/010-documentation.patch b/toolchain/gcc/patches/7.2.0/010-documentation.patch similarity index 65% rename from toolchain/gcc/patches/5.4.0/010-documentation.patch rename to toolchain/gcc/patches/7.2.0/010-documentation.patch index 07064a97bc..0106814f41 100644 --- a/toolchain/gcc/patches/5.4.0/010-documentation.patch +++ b/toolchain/gcc/patches/7.2.0/010-documentation.patch @@ -1,6 +1,18 @@ +commit 098bd91f5eae625c7d2ee621e10930fc4434e5e2 +Author: Luka Perkov +Date: Tue Feb 26 16:16:33 2013 +0000 + + gcc: don't build documentation + + This closes #13039. + + Signed-off-by: Luka Perkov + + SVN-Revision: 35807 + --- a/gcc/Makefile.in +++ b/gcc/Makefile.in -@@ -2941,18 +2941,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) +@@ -3121,18 +3121,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) doc/gccint.info: $(TEXI_GCCINT_FILES) doc/cppinternals.info: $(TEXI_CPPINT_FILES) diff --git a/toolchain/gcc/patches/7.2.0/230-musl_libssp.patch b/toolchain/gcc/patches/7.2.0/230-musl_libssp.patch new file mode 100644 index 0000000000..eebee9175c --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/230-musl_libssp.patch @@ -0,0 +1,28 @@ +commit 1877bc9d8f2be143fbe530347a945850d0ecd234 +Author: Steven Barth +Date: Mon Jun 22 10:31:07 2015 +0000 + + gcc/musl: rework SSP-support + + Make musl provide libssp_nonshared.a and make GCC link it unconditionally + if musl is used. This should be a no-op if SSP is disabled and seems to be + the only reliable way of dealing with SSP over all packages due to the mess + that is linkerflags handling in packages. + + Signed-off-by: Steven Barth + + SVN-Revision: 46108 + +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -861,7 +861,9 @@ proper position among the other output f + #endif + + #ifndef LINK_SSP_SPEC +-#ifdef TARGET_LIBC_PROVIDES_SSP ++#if DEFAULT_LIBC == LIBC_MUSL ++#define LINK_SSP_SPEC "-lssp_nonshared" ++#elif defined(TARGET_LIBC_PROVIDES_SSP) + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ + "|fstack-protector-strong|fstack-protector-explicit:}" + #else diff --git a/toolchain/gcc/patches/7.1.0/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain/gcc/patches/7.2.0/300-mips_Os_cpu_rtx_cost_model.patch similarity index 55% rename from toolchain/gcc/patches/7.1.0/300-mips_Os_cpu_rtx_cost_model.patch rename to toolchain/gcc/patches/7.2.0/300-mips_Os_cpu_rtx_cost_model.patch index 21cff871c0..84c0fdab66 100644 --- a/toolchain/gcc/patches/7.1.0/300-mips_Os_cpu_rtx_cost_model.patch +++ b/toolchain/gcc/patches/7.2.0/300-mips_Os_cpu_rtx_cost_model.patch @@ -1,3 +1,13 @@ +commit ecf7671b769fe96f7b5134be442089f8bdba55d2 +Author: Felix Fietkau +Date: Thu Aug 4 20:29:45 2016 +0200 + +gcc: add a patch to generate better code with Os on mips + +Also happens to reduce compressed code size a bit + +Signed-off-by: Felix Fietkau + --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -19784,7 +19784,7 @@ mips_option_override (void) diff --git a/toolchain/gcc/patches/7.2.0/800-arm_v5te_no_ldrd_strd.patch b/toolchain/gcc/patches/7.2.0/800-arm_v5te_no_ldrd_strd.patch new file mode 100644 index 0000000000..76200a1661 --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/800-arm_v5te_no_ldrd_strd.patch @@ -0,0 +1,32 @@ +commit b050f87d13b5dc7ed82feb9a90f4529de58bdf25 +Author: Felix Fietkau +Date: Wed Feb 19 19:20:10 2014 +0000 + + gcc: prevent the use of LDRD/STRD on ARMv5TE + + These instructions are for 64-bit load/store. On ARMv5TE, the CPU + requires addresses to be aligned to 64-bit. When misaligned, behavior is + undefined (effectively either loads the same word twice on LDRD, or + corrupts surrounding memory on STRD). + + On ARMv6 and newer, unaligned access is safe. + + Removing these instructions for ARMv5TE is necessary, because GCC + ignores alignment information in pointers and does unsafe optimizations + that have shown up as bugs in various places. + + Signed-off-by: Felix Fietkau + + SVN-Revision: 39638 + +--- a/gcc/config/arm/arm.h ++++ b/gcc/config/arm/arm.h +@@ -150,7 +150,7 @@ extern tree arm_fp16_type_node; + /* Thumb-1 only. */ + #define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm) + +-#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN \ ++#define TARGET_LDRD (arm_arch6 && ARM_DOUBLEWORD_ALIGN \ + && !TARGET_THUMB1) + + #define TARGET_CRC32 (arm_arch_crc) diff --git a/toolchain/gcc/patches/7.1.0/810-arm-softfloat-libgcc.patch b/toolchain/gcc/patches/7.2.0/810-arm-softfloat-libgcc.patch similarity index 82% rename from toolchain/gcc/patches/7.1.0/810-arm-softfloat-libgcc.patch rename to toolchain/gcc/patches/7.2.0/810-arm-softfloat-libgcc.patch index a437d81511..5c9d86aead 100644 --- a/toolchain/gcc/patches/7.1.0/810-arm-softfloat-libgcc.patch +++ b/toolchain/gcc/patches/7.2.0/810-arm-softfloat-libgcc.patch @@ -1,3 +1,11 @@ +commit 8570c4be394cff7282f332f97da2ff569a927ddb +Author: Imre Kaloz +Date: Wed Feb 2 20:06:12 2011 +0000 + + fixup arm soft-float symbols + + SVN-Revision: 25325 + --- a/libgcc/config/arm/t-linux +++ b/libgcc/config/arm/t-linux @@ -1,6 +1,10 @@ diff --git a/toolchain/gcc/patches/7.1.0/820-libgcc_pic.patch b/toolchain/gcc/patches/7.2.0/820-libgcc_pic.patch similarity index 81% rename from toolchain/gcc/patches/7.1.0/820-libgcc_pic.patch rename to toolchain/gcc/patches/7.2.0/820-libgcc_pic.patch index cd539d865c..0cc1e07e2b 100644 --- a/toolchain/gcc/patches/7.1.0/820-libgcc_pic.patch +++ b/toolchain/gcc/patches/7.2.0/820-libgcc_pic.patch @@ -1,3 +1,11 @@ +commit c96312958c0621e72c9b32da5bc224ffe2161384 +Author: Felix Fietkau +Date: Mon Oct 19 23:26:09 2009 +0000 + + gcc: create a proper libgcc_pic.a static library for relinking (4.3.3+ for now, backport will follow) + + SVN-Revision: 18086 + --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in @@ -920,11 +920,12 @@ $(libgcov-driver-objects): %$(objext): $ diff --git a/toolchain/gcc/patches/7.1.0/840-armv4_pass_fix-v4bx_to_ld.patch b/toolchain/gcc/patches/7.2.0/840-armv4_pass_fix-v4bx_to_ld.patch similarity index 80% rename from toolchain/gcc/patches/7.1.0/840-armv4_pass_fix-v4bx_to_ld.patch rename to toolchain/gcc/patches/7.2.0/840-armv4_pass_fix-v4bx_to_ld.patch index 9cae1c9d1c..b9c9b161ad 100644 --- a/toolchain/gcc/patches/7.1.0/840-armv4_pass_fix-v4bx_to_ld.patch +++ b/toolchain/gcc/patches/7.2.0/840-armv4_pass_fix-v4bx_to_ld.patch @@ -1,3 +1,12 @@ +commit 7edc8ca5456d9743dd0075eb3cc5b04f4f24c8cc +Author: Imre Kaloz +Date: Wed Feb 2 19:34:36 2011 +0000 + + add armv4 fixup patches + + SVN-Revision: 25322 + + --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -88,10 +88,15 @@ diff --git a/toolchain/gcc/patches/7.1.0/850-use_shared_libgcc.patch b/toolchain/gcc/patches/7.2.0/850-use_shared_libgcc.patch similarity index 84% rename from toolchain/gcc/patches/7.1.0/850-use_shared_libgcc.patch rename to toolchain/gcc/patches/7.2.0/850-use_shared_libgcc.patch index 5d09d6e2d2..1d07efed80 100644 --- a/toolchain/gcc/patches/7.1.0/850-use_shared_libgcc.patch +++ b/toolchain/gcc/patches/7.2.0/850-use_shared_libgcc.patch @@ -1,3 +1,10 @@ +commit dcfc40358b5a3cae7320c17f8d1cebd5ad5540cd +Author: Felix Fietkau +Date: Sun Feb 12 20:25:47 2012 +0000 + + gcc 4.6: port over the missing patch 850-use_shared_libgcc.patch to prevent libgcc crap from leaking into every single binary + + SVN-Revision: 30486 --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -126,10 +126,6 @@ diff --git a/toolchain/gcc/patches/7.1.0/851-libgcc_no_compat.patch b/toolchain/gcc/patches/7.2.0/851-libgcc_no_compat.patch similarity index 63% rename from toolchain/gcc/patches/7.1.0/851-libgcc_no_compat.patch rename to toolchain/gcc/patches/7.2.0/851-libgcc_no_compat.patch index 80c3476841..d710e40717 100644 --- a/toolchain/gcc/patches/7.1.0/851-libgcc_no_compat.patch +++ b/toolchain/gcc/patches/7.2.0/851-libgcc_no_compat.patch @@ -1,3 +1,13 @@ +commit 64661de100da1ec1061ef3e5e400285dce115e6b +Author: Felix Fietkau +Date: Sun May 10 13:16:35 2015 +0000 + + gcc: add some size optimization patches + + Signed-off-by: Felix Fietkau + + SVN-Revision: 45664 + --- a/libgcc/config/t-libunwind +++ b/libgcc/config/t-libunwind @@ -2,8 +2,7 @@ diff --git a/toolchain/gcc/patches/7.2.0/870-ppc_no_crtsavres.patch b/toolchain/gcc/patches/7.2.0/870-ppc_no_crtsavres.patch new file mode 100644 index 0000000000..156468b45e --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/870-ppc_no_crtsavres.patch @@ -0,0 +1,18 @@ +commit d8c570a1531035c3e26bcd94741e5f5b9c36b5d9 +Author: Felix Fietkau +Date: Mon Mar 5 00:51:01 2012 +0000 + + gcc: do not emit references to _savegpr_* and _restgpr_* on powerpc, as they are tricky to deal with wrt. libgcc. they cannot be linked dynamically + + SVN-Revision: 30814 +--- a/gcc/config/rs6000/rs6000.c ++++ b/gcc/config/rs6000/rs6000.c +@@ -26936,7 +26936,7 @@ rs6000_savres_strategy (rs6000_stack_t * + /* Define cutoff for using out-of-line functions to save registers. */ + if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) + { +- if (!optimize_size) ++ if (1) + { + strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; + strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; diff --git a/toolchain/gcc/patches/7.2.0/881-no_tm_section.patch b/toolchain/gcc/patches/7.2.0/881-no_tm_section.patch new file mode 100644 index 0000000000..a58dc27e64 --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/881-no_tm_section.patch @@ -0,0 +1,22 @@ +commit 565988ab47bd9b96b50608564aee2104aeb4b7ae +Author: Felix Fietkau +Date: Tue Dec 13 14:20:49 2016 +0100 + + gcc: rip out transactional memory related bloat from crtbegin + + Slightly improves compression for each executable, saving about 4k from + the default ar71xx rootfs + + Signed-off-by: Felix Fietkau + +--- a/libgcc/crtstuff.c ++++ b/libgcc/crtstuff.c +@@ -152,7 +152,7 @@ call_ ## FUNC (void) \ + #endif + + #if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) +-# define USE_TM_CLONE_REGISTRY 1 ++# define USE_TM_CLONE_REGISTRY 0 + #endif + + /* We do not want to add the weak attribute to the declarations of these diff --git a/toolchain/gcc/patches/7.2.0/900-bad-mips16-crt.patch b/toolchain/gcc/patches/7.2.0/900-bad-mips16-crt.patch new file mode 100644 index 0000000000..f5cc0a74ee --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/900-bad-mips16-crt.patch @@ -0,0 +1,30 @@ +commit 9dc38e48f7a6f88b7ac7bfaced91f53660204e46 +Author: Florian Fainelli +Date: Fri Apr 5 12:36:06 2013 +0000 + + toolchain/gcc: .init and .fini need to pick one ISA + + The .init and .fini sections are built by concatenating code + fragments. Putting mips16 code in the middle of a mips32 code block + doesn't work. Make gcc built the magic crt stuff in no-mips16 mode. + + This is specific to 4.6-linaro but is probably portable to other gcc + flavors. Adding this to the t-libgcc-mips16 makefile fragment is a + hack not suitable for pushing upstream, but there is no mips/t-linux + or mips/t-uclibc and I am not going to touch gcc/configure for two + lines. + + Signed-off-by: Jay Carlson + Signed-off-by: Florian Fainelli + + SVN-Revision: 36200 + +--- a/libgcc/config/mips/t-mips16 ++++ b/libgcc/config/mips/t-mips16 +@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16 + + # Version these symbols if building libgcc.so. + SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver ++ ++CRTSTUFF_T_CFLAGS += -mno-mips16 ++CRTSTUFF_T_CFLAGS_S += -mno-mips16 diff --git a/toolchain/gcc/patches/7.1.0/910-mbsd_multi.patch b/toolchain/gcc/patches/7.2.0/910-mbsd_multi.patch similarity index 90% rename from toolchain/gcc/patches/7.1.0/910-mbsd_multi.patch rename to toolchain/gcc/patches/7.2.0/910-mbsd_multi.patch index 5b664ff227..286cfadae7 100644 --- a/toolchain/gcc/patches/7.1.0/910-mbsd_multi.patch +++ b/toolchain/gcc/patches/7.2.0/910-mbsd_multi.patch @@ -1,3 +1,10 @@ +commit 99368862e44740ff4fd33760893f04e14f9dbdf1 +Author: Felix Fietkau +Date: Tue Jul 31 00:52:27 2007 +0000 + + Port the mbsd_multi patch from freewrt, which adds -fhonour-copts. This will emit warnings in packages that don't use our target cflags properly + + SVN-Revision: 8256 This patch brings over a feature from MirBSD: * -fhonour-copts @@ -107,7 +114,7 @@ ; On SVR4 targets, it also controls whether or not to emit a --- a/gcc/opts.c +++ b/gcc/opts.c -@@ -1921,6 +1921,9 @@ common_handle_option (struct gcc_options +@@ -1928,6 +1928,9 @@ common_handle_option (struct gcc_options opts, opts_set, loc, dc); break; @@ -119,7 +126,7 @@ opts->x_warn_larger_than = value != -1; --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -6565,6 +6565,17 @@ This option is only supported for C and +@@ -6567,6 +6567,17 @@ This option is only supported for C and @option{-Wall} and by @option{-Wpedantic}, which can be disabled with @option{-Wno-pointer-sign}. @@ -137,4 +144,3 @@ @item -Wstack-protector @opindex Wstack-protector @opindex Wno-stack-protector - diff --git a/toolchain/gcc/patches/7.1.0/920-specs_nonfatal_getenv.patch b/toolchain/gcc/patches/7.2.0/920-specs_nonfatal_getenv.patch similarity index 59% rename from toolchain/gcc/patches/7.1.0/920-specs_nonfatal_getenv.patch rename to toolchain/gcc/patches/7.2.0/920-specs_nonfatal_getenv.patch index 56dbe33c39..69b40621dc 100644 --- a/toolchain/gcc/patches/7.1.0/920-specs_nonfatal_getenv.patch +++ b/toolchain/gcc/patches/7.2.0/920-specs_nonfatal_getenv.patch @@ -1,6 +1,13 @@ +Author: Jo-Philipp Wich +Date: Sat Apr 21 03:02:39 2012 +0000 + + gcc: add patch to make the getenv() spec function nonfatal if requested environment variable is unset + + SVN-Revision: 31390 + --- a/gcc/gcc.c +++ b/gcc/gcc.c -@@ -9277,8 +9277,10 @@ getenv_spec_function (int argc, const ch +@@ -9280,8 +9280,10 @@ getenv_spec_function (int argc, const ch value = varname; if (!value) diff --git a/toolchain/gcc/patches/7.1.0/930-fix-mips-noexecstack.patch b/toolchain/gcc/patches/7.2.0/930-fix-mips-noexecstack.patch similarity index 100% rename from toolchain/gcc/patches/7.1.0/930-fix-mips-noexecstack.patch rename to toolchain/gcc/patches/7.2.0/930-fix-mips-noexecstack.patch diff --git a/toolchain/gcc/patches/7.2.0/940-no-clobber-stamp-bits.patch b/toolchain/gcc/patches/7.2.0/940-no-clobber-stamp-bits.patch new file mode 100644 index 0000000000..8b88b4066d --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/940-no-clobber-stamp-bits.patch @@ -0,0 +1,33 @@ +commit 548d9a008ff265e9eaa3c7e0e6e301c6bd5645e6 +Author: Felix Fietkau +Date: Fri Dec 12 17:01:57 2014 +0000 + + gcc: don't clobber stamp-bits with a symlink to itself + + Several versions of gcc have an issue in libstdc++v3 where the build may + clobber stamp-bits with a link to itself. This doesn't manifest itself + on all systems. On several Ubuntu systems, this doesn't appear to be a + problem, but it is an issue on Fedora 16 systems. + + To fix the issue, we'll simply filter out stamp-bits from the symlinks + to be generated. + + Note: gcc 4.4.7 is unaffected by this issue, so no fix is necessary + there. + + Signed-off-by: John Szakmeister + + SVN-Revision: 43669 + + +--- a/libstdc++-v3/include/Makefile.in ++++ b/libstdc++-v3/include/Makefile.in +@@ -1476,7 +1476,7 @@ stamp-bits: ${bits_headers} + @$(STAMP) stamp-bits + + stamp-bits-sup: stamp-bits ${bits_sup_headers} +- @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null ++ @-cd ${bits_builddir} && $(LN_S) $(filter-out stamp-bits,$?) . 2>/dev/null + @$(STAMP) stamp-bits-sup + + stamp-c_base: ${c_base_headers} diff --git a/toolchain/gcc/patches/7.1.0/950-cpp_file_path_translation.patch b/toolchain/gcc/patches/7.2.0/950-cpp_file_path_translation.patch similarity index 93% rename from toolchain/gcc/patches/7.1.0/950-cpp_file_path_translation.patch rename to toolchain/gcc/patches/7.2.0/950-cpp_file_path_translation.patch index ac85c1d6aa..60729dd7fe 100644 --- a/toolchain/gcc/patches/7.1.0/950-cpp_file_path_translation.patch +++ b/toolchain/gcc/patches/7.2.0/950-cpp_file_path_translation.patch @@ -1,3 +1,13 @@ +commit 331735a357a73c7b8adc205241ac3cc6543d985e +Author: Felix Fietkau +Date: Tue Nov 17 12:38:22 2015 +0000 + + gcc: add a patch to 5.x that supports translation of __FILE__ paths + + Signed-off-by: Felix Fietkau + + SVN-Revision: 47490 + Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047 --- a/gcc/c-family/c-opts.c @@ -53,7 +63,7 @@ Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4 When preprocessing, handle directives, but do not expand macros. --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -11861,6 +11861,12 @@ by @option{-fplugin=@var{name}} instead +@@ -11863,6 +11863,12 @@ by @option{-fplugin=@var{name}} instead @option{-fplugin=@var{path}/@var{name}.so}. This option is not meant to be used by the user, but only passed by the driver. diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile index 77e24f4609..abd6d033cc 100644 --- a/toolchain/gdb/Makefile +++ b/toolchain/gdb/Makefile @@ -17,11 +17,11 @@ PKG_HASH:=f47930161e9e99c46ab018dabbf56024739dda29c51f92495eaa0d4d7e3511f6 GDB_DIR:=binutils-$(PKG_NAME)-$(PKG_VERSION) PATCH_DIR:=./patches-arc else -PKG_VERSION:=7.12.1 +PKG_VERSION:=8.0.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb -PKG_HASH:=4607680b973d3ec92c30ad029f1b7dbde3876869e6b3a117d8a7e90081113186 +PKG_HASH:=3dbd5f93e36ba2815ad0efab030dcd0c7b211d7b353a40a53f4c02d7d56295e3 GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION) endif diff --git a/toolchain/gdb/patches/110-no_testsuite.patch b/toolchain/gdb/patches/110-no_testsuite.patch index 68d1c90359..e86ba6d0cd 100644 --- a/toolchain/gdb/patches/110-no_testsuite.patch +++ b/toolchain/gdb/patches/110-no_testsuite.patch @@ -1,6 +1,6 @@ --- a/gdb/configure +++ b/gdb/configure -@@ -874,8 +874,7 @@ MAKEINFOFLAGS +@@ -869,8 +869,7 @@ MAKEINFOFLAGS YACC YFLAGS XMKMF' @@ -10,7 +10,7 @@ multi-ice gdbserver' -@@ -5617,7 +5616,7 @@ $as_echo "$with_auto_load_safe_path" >&6 +@@ -6473,7 +6472,7 @@ $as_echo "$with_auto_load_safe_path" >&6 diff --git a/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch b/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch index 562902c50f..9ce91a024b 100644 --- a/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch +++ b/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch @@ -1,6 +1,6 @@ --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure -@@ -2476,7 +2476,7 @@ $as_echo "$as_me: error: \`$ac_var' was +@@ -2469,7 +2469,7 @@ $as_echo "$as_me: error: \`$ac_var' was ac_cache_corrupted=: ;; ,);; *) diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk index 0ea166e77d..0ffeef0f6a 100644 --- a/toolchain/glibc/common.mk +++ b/toolchain/glibc/common.mk @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=glibc -PKG_VERSION:=2.25 +PKG_VERSION:=2.26 PKG_SOURCE_URL:=@GNU/libc PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_HASH:=067bd9bb3390e79aa45911537d13c3721f1d9d3769931a30c2681bfee66f23a0 +PKG_HASH:=e54e0a934cd2bc94429be79da5e9385898d2306b9eaf3c92d5a77af96190f6bd PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_SOURCE_SUBDIR) diff --git a/toolchain/kernel-headers/Makefile b/toolchain/kernel-headers/Makefile index 1bf5598d6f..e374e706e1 100644 --- a/toolchain/kernel-headers/Makefile +++ b/toolchain/kernel-headers/Makefile @@ -36,13 +36,9 @@ HOST_EXTRACFLAGS= LINUX_HAS_HEADERS_INSTALL:=y KMAKE := $(MAKE) -C $(HOST_BUILD_DIR) \ - HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \ - ARCH=$(LINUX_KARCH) \ + $(KERNEL_MAKE_FLAGS) \ CC="$(KERNEL_CC)" \ - CFLAGS="$(TARGET_CFLAGS)" \ - CROSS_COMPILE=$(TARGET_CROSS) \ - KBUILD_HAVE_NLS=no \ - CONFIG_SHELL=$(BASH) + CFLAGS="$(TARGET_CFLAGS)" define Host/Configure/all mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev diff --git a/toolchain/musl/common.mk b/toolchain/musl/common.mk index 0a45828f79..a94a475571 100644 --- a/toolchain/musl/common.mk +++ b/toolchain/musl/common.mk @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/target.mk PKG_NAME:=musl -PKG_VERSION:=1.1.16 +PKG_VERSION:=1.1.18 PKG_RELEASE=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=5f7efb87a28a311ad377dd26adf53715dedb096d -PKG_MIRROR_HASH:=da18ef24f270e5cae6bc4c440479da17bec1949ae5a1bc990352ca04f24c4378 +PKG_SOURCE_VERSION:=72656157f54c47277b01ec85a6ba7c4084fea6c8 +PKG_MIRROR_HASH:=a3d857c23c94aa96a4ad5f442aaf236e5a189a717273c4e4faf425988d98cd32 PKG_SOURCE_URL:=git://git.musl-libc.org/musl PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz diff --git a/toolchain/musl/patches/900-iconv_size_hack.patch b/toolchain/musl/patches/900-iconv_size_hack.patch index 343915fb06..41cff5b033 100644 --- a/toolchain/musl/patches/900-iconv_size_hack.patch +++ b/toolchain/musl/patches/900-iconv_size_hack.patch @@ -1,14 +1,14 @@ --- a/src/locale/iconv.c +++ b/src/locale/iconv.c -@@ -39,6 +39,7 @@ static const unsigned char charmaps[] = +@@ -42,6 +42,7 @@ static const unsigned char charmaps[] = "ucs4\0ucs4be\0utf32\0utf32be\0\0\300" "ucs4le\0utf32le\0\0\303" "ascii\0usascii\0iso646\0iso646us\0\0\307" +#ifdef FULL_ICONV "eucjp\0\0\320" "shiftjis\0sjis\0\0\321" - "gb18030\0\0\330" -@@ -46,6 +47,7 @@ static const unsigned char charmaps[] = + "iso2022jp\0\0\322" +@@ -50,6 +51,7 @@ static const unsigned char charmaps[] = "gb2312\0\0\332" "big5\0bigfive\0cp950\0big5hkscs\0\0\340" "euckr\0ksc5601\0ksx1001\0cp949\0\0\350" @@ -16,7 +16,7 @@ #include "codepages.h" ; -@@ -53,6 +55,7 @@ static const unsigned short legacy_chars +@@ -60,6 +62,7 @@ static const unsigned short legacy_chars #include "legacychars.h" }; @@ -24,45 +24,77 @@ static const unsigned short jis0208[84][94] = { #include "jis0208.h" }; -@@ -72,6 +75,7 @@ static const unsigned short hkscs[] = { +@@ -79,6 +82,7 @@ static const unsigned short hkscs[] = { static const unsigned short ksc[93][94] = { #include "ksc.h" }; +#endif - static int fuzzycmp(const unsigned char *a, const unsigned char *b) + static const unsigned short rev_jis[] = { + #include "revjis.h" +@@ -196,6 +200,7 @@ static unsigned legacy_map(const unsigne + return x < 256 ? x : legacy_chars[x-256]; + } + ++#ifdef FULL_ICONV + static unsigned uni_to_jis(unsigned c) { -@@ -216,6 +220,7 @@ size_t iconv(iconv_t cd0, char **restric + unsigned nel = sizeof rev_jis / sizeof *rev_jis; +@@ -214,6 +219,7 @@ static unsigned uni_to_jis(unsigned c) + } + } + } ++#endif + + size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restrict out, size_t *restrict outb) + { +@@ -285,6 +291,7 @@ size_t iconv(iconv_t cd, char **restrict c = ((c-0xd7c0)<<10) + (d-0xdc00); } break; +#ifdef FULL_ICONV case SHIFT_JIS: + if (c < 128) break; if (c-0xa1 <= 0xdf-0xa1) { - c += 0xff61-0xa1; -@@ -362,6 +367,7 @@ size_t iconv(iconv_t cd0, char **restric +@@ -476,6 +483,7 @@ size_t iconv(iconv_t cd, char **restrict c = ksc[c][d]; if (!c) goto ilseq; break; +#endif default: - if (c < 128+type) break; - c -= 128+type; + if (!c) break; + c = legacy_map(map, c); +@@ -516,6 +524,7 @@ size_t iconv(iconv_t cd, char **restrict + } + } + goto subst; ++#ifdef FULL_ICONV + case SHIFT_JIS: + if (c < 128) goto revout; + if (c == 0xa5) { +@@ -589,6 +598,7 @@ size_t iconv(iconv_t cd, char **restrict + *(*out)++ = 'B'; + *outb -= 8; + break; ++#endif + case UCS2BE: + case UCS2LE: + case UTF_16BE: --- a/src/locale/codepages.h +++ b/src/locale/codepages.h -@@ -118,6 +118,7 @@ - "\0\0\0\100\15\0\344\0\0\0\0\0\0\0\0\0\0\0\0\0\103\270\1\0\0\0\340\1\200\40" - "\230\0\0\0\0\0\44\341\12\0" +@@ -129,6 +129,7 @@ + "\340\204\43\316\100\344\34\144\316\71\350\244\243\316\72\354\264\343\316\73" + "\21\361\44\317\74\364\30\145\17\124\146\345\243\317\76\374\134\304\327\77" +#ifdef FULL_ICONV "cp1250\0" "windows1250\0" - "\0\0" -@@ -214,6 +215,7 @@ - "\0\0\0\0\0\0\0\0\0\15\0\0\0\0\0\0\0\0\0\0\266\0\0\0\0\102\0\220\13\0" - "\0\234\2\0\0\0\0\0\0\0\0\244\202\13\0\0\0\0\100\15\0\0\0\0\0\0\0\0\0\0" - "\267\0\0\0\0\103\0\240\13\0\0\240\2\0\0\0\0\0\0\0\0\250\62\45\0" + "\0\40" +@@ -239,6 +240,7 @@ + "\20\105\163\330\64\324\324\145\315\65\330\144\243\315\66\334\334\145\330\67" + "\340\204\43\316\100\344\224\143\316\71\350\244\243\316\72\205\265\343\316\73" + "\21\305\203\330\74\364\330\145\317\75\370\344\243\317\76\374\340\65\362\77" +#endif "koi8r\0" - "\0\0" + "\0\40" diff --git a/tools/Makefile b/tools/Makefile index a95342f50e..50bd552d75 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -29,7 +29,6 @@ tools-y += mm-macros missing-macros cmake scons bc findutils gengetopt patchelf tools-y += mtools dosfstools libressl tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2 tools-$(CONFIG_TARGET_x86) += qemu -tools-$(CONFIG_EFI_IMAGES) += popt gptfdisk tools-$(CONFIG_TARGET_mxs) += elftosb sdimage tools-$(CONFIG_TARGET_ar71xx) += lzma-old squashfs tools-$(CONFIG_USES_MINOR) += kernel2minor @@ -72,7 +71,6 @@ $(curdir)/libressl/compile := $(curdir)/pkg-config/compile $(curdir)/mkimage/compile += $(curdir)/libressl/compile $(curdir)/firmware-utils/compile += $(curdir)/libressl/compile $(curdir)/cmake/compile += $(curdir)/libressl/compile -$(curdir)/gptfdisk/compile += $(curdir)/popt/compile $(curdir)/e2fsprogs/compile ifneq ($(HOST_OS),Linux) tools-y += coreutils diff --git a/tools/automake/Makefile b/tools/automake/Makefile index 2e618f9974..c016f1d76a 100644 --- a/tools/automake/Makefile +++ b/tools/automake/Makefile @@ -7,6 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=automake +PKG_CPE_ID:=cpe:/a:gnu:automake PKG_VERSION:=1.15.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz diff --git a/tools/cmake/Makefile b/tools/cmake/Makefile index a94942f84c..22e5d3e858 100644 --- a/tools/cmake/Makefile +++ b/tools/cmake/Makefile @@ -7,12 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cmake -PKG_VERSION:=3.8.1 +PKG_VERSION:=3.9.3 +PKG_CPE_ID:=cpe:/a:kitware:cmake PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://cmake.org/files/v3.8/ \ +PKG_SOURCE_URL:=https://cmake.org/files/v3.9/ \ https://fossies.org/linux/misc/ -PKG_HASH:=ce5d9161396e06501b00e52933783150a87c33080d4bdcef461b5b7fd24ac228 +PKG_HASH:=8eaf75e1e932159aae98ab5e7491499545554be62a08cbcbc7c75c84b999f28a HOST_BUILD_PARALLEL:=1 HOST_CONFIGURE_PARALLEL:=1 diff --git a/tools/cmake/patches/010-backport-macos-fix.patch b/tools/cmake/patches/010-backport-macos-fix.patch new file mode 100644 index 0000000000..76e92dcb0e --- /dev/null +++ b/tools/cmake/patches/010-backport-macos-fix.patch @@ -0,0 +1,15 @@ +--- a/Source/kwsys/kwsysPlatformTestsCXX.cxx ++++ b/Source/kwsys/kwsysPlatformTestsCXX.cxx +@@ -265,6 +265,12 @@ int main() + #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT + #include + #include ++#if defined(__APPLE__) ++#include ++#if MAC_OS_X_VERSION_MIN_REQUIRED < 101300 ++#error "utimensat not available on macOS < 10.13" ++#endif ++#endif + int main() + { + struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } }; diff --git a/tools/cmake/patches/100-disable_qt_tests.patch b/tools/cmake/patches/100-disable_qt_tests.patch index 54a75bc776..f8baafe333 100644 --- a/tools/cmake/patches/100-disable_qt_tests.patch +++ b/tools/cmake/patches/100-disable_qt_tests.patch @@ -1,6 +1,6 @@ --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt -@@ -244,15 +244,6 @@ add_RunCMake_test(no_install_prefix) +@@ -246,15 +246,6 @@ add_RunCMake_test(no_install_prefix) add_RunCMake_test(configure_file) add_RunCMake_test(CTestTimeoutAfterMatch) @@ -18,7 +18,7 @@ add_RunCMake_test(FindPkgConfig) --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt -@@ -398,10 +398,6 @@ if(BUILD_TESTING) +@@ -403,10 +403,6 @@ if(BUILD_TESTING) list(APPEND TEST_BUILD_DIRS ${CMake_TEST_INSTALL_PREFIX}) diff --git a/tools/cmake/patches/120-alpine_musl-compat.patch b/tools/cmake/patches/110-alpine_musl-compat.patch similarity index 100% rename from tools/cmake/patches/120-alpine_musl-compat.patch rename to tools/cmake/patches/110-alpine_musl-compat.patch diff --git a/tools/cmake/patches/110-freebsd-compat.patch b/tools/cmake/patches/110-freebsd-compat.patch deleted file mode 100644 index 4f11078461..0000000000 --- a/tools/cmake/patches/110-freebsd-compat.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 6eab64c3adc7a38c322cd4d9a1a1881f2d49cb9c Mon Sep 17 00:00:00 2001 -From: Raphael Kubo da Costa -Date: Tue, 15 Oct 2013 00:10:56 +0300 -Subject: [PATCH] SystemInformation: Include backtrace-related headers on - FreeBSD - -This was probably broken for a long while, but the problem was not apparent -because the check for execinfo.h would fail by default because --I/usr/local/include was not being passed to the compiler when making the -checks for the header's existence. - -Now that very recent FreeBSD versions (ie. 10-CURRENT) have NetBSD's -libexecinfo in base (and it is thus installed into /usr), the -backtrace-related checks would pass, but the required headers were not being -included in SystemInformation.cxx. - -Change-Id: I3b91ed7ac0e6878035aee202b3336c536cc6d2ff ---- - Source/kwsys/SystemInformation.cxx | 9 +++++++++ - 1 file changed, 9 insertions(+) - ---- a/Source/kwsys/SystemInformation.cxx -+++ b/Source/kwsys/SystemInformation.cxx -@@ -82,6 +82,15 @@ typedef int siginfo_t; - #include - #define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN - #endif -+# if defined(KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE) -+# include -+# if defined(KWSYS_SYSTEMINFORMATION_HAS_CPP_DEMANGLE) -+# include -+# endif -+# if defined(KWSYS_SYSTEMINFORMATION_HAS_SYMBOL_LOOKUP) -+# include -+# endif -+# endif - #endif - - #if defined(KWSYS_SYS_HAS_MACHINE_CPU_H) diff --git a/tools/cmake/patches/130-libarchive-fix-libressl-compat.patch b/tools/cmake/patches/120-libarchive-fix-libressl-compat.patch similarity index 100% rename from tools/cmake/patches/130-libarchive-fix-libressl-compat.patch rename to tools/cmake/patches/120-libarchive-fix-libressl-compat.patch diff --git a/tools/cmake/patches/140-curl-fix-libressl-linking.patch b/tools/cmake/patches/130-curl-fix-libressl-linking.patch similarity index 69% rename from tools/cmake/patches/140-curl-fix-libressl-linking.patch rename to tools/cmake/patches/130-curl-fix-libressl-linking.patch index c16e927ff3..b5ee61b58a 100644 --- a/tools/cmake/patches/140-curl-fix-libressl-linking.patch +++ b/tools/cmake/patches/130-curl-fix-libressl-linking.patch @@ -17,16 +17,17 @@ Modify the cmcurl CMakeLists.txt to check for clock_gettime() in librt and unconditionally link the rt library when the symbol is found. Signed-off-by: Jo-Philipp Wich +--- --- a/Utilities/cmcurl/CMakeLists.txt +++ b/Utilities/cmcurl/CMakeLists.txt -@@ -374,6 +374,10 @@ set(HAVE_LIBSSL OFF) - if(CMAKE_USE_OPENSSL) - find_package(OpenSSL) - if(OPENSSL_FOUND) -+ check_library_exists("rt" clock_gettime "" HAVE_LIBRT) -+ if(HAVE_LIBRT) -+ list(APPEND OPENSSL_LIBRARIES rt) -+ endif() - list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES}) - set(USE_OPENSSL ON) - set(HAVE_LIBCRYPTO ON) +@@ -456,6 +456,10 @@ if(CMAKE_USE_OPENSSL) + set(USE_OPENSSL ON) + set(HAVE_LIBCRYPTO ON) + set(HAVE_LIBSSL ON) ++ check_library_exists("rt" clock_gettime "" HAVE_LIBRT) ++ if(HAVE_LIBRT) ++ list(APPEND OPENSSL_LIBRARIES rt) ++ endif() + list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES}) + include_directories(${OPENSSL_INCLUDE_DIR}) + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) diff --git a/tools/cmake/patches/150-bootstrap_parallel_make_flag.patch b/tools/cmake/patches/140-bootstrap_parallel_make_flag.patch similarity index 89% rename from tools/cmake/patches/150-bootstrap_parallel_make_flag.patch rename to tools/cmake/patches/140-bootstrap_parallel_make_flag.patch index 4d432dcc1e..734e8cb1cc 100644 --- a/tools/cmake/patches/150-bootstrap_parallel_make_flag.patch +++ b/tools/cmake/patches/140-bootstrap_parallel_make_flag.patch @@ -1,6 +1,6 @@ --- a/bootstrap +++ b/bootstrap -@@ -1046,7 +1046,10 @@ int main(){ printf("1%c", (char)0x0a); r +@@ -1094,7 +1094,10 @@ int main(){ printf("1%c", (char)0x0a); r ' > "test.c" cmake_original_make_flags="${cmake_make_flags}" if [ "x${cmake_parallel_make}" != "x" ]; then diff --git a/tools/coreutils/Makefile b/tools/coreutils/Makefile index 1acdfb9160..4109fd77b3 100644 --- a/tools/coreutils/Makefile +++ b/tools/coreutils/Makefile @@ -7,6 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=coreutils +PKG_CPE_ID:=cpe:/a:gnu:coreutils PKG_VERSION:=8.27 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz @@ -15,14 +16,14 @@ PKG_HASH:=8891d349ee87b9ff7870f52b6d9312a9db672d2439d289bc57084771ca21656b HOST_BUILD_PARALLEL := 1 -BUILD_PROGRAMS = date +BUILD_PROGRAMS = date readlink include $(INCLUDE_DIR)/host-build.mk BUILD_BINS = $(patsubst %,src/%,$(BUILD_PROGRAMS)) HOST_CONFIGURE_ARGS += \ - --enable-install-program=date + --enable-install-program=$(subst $(space),$(comma),$(strip $(BUILD_PROGRAMS))) HOST_MAKE_FLAGS += \ PROGRAMS="$(BUILD_BINS)" \ diff --git a/tools/dosfstools/Makefile b/tools/dosfstools/Makefile index 861dcbf1c7..e34ceaf32b 100644 --- a/tools/dosfstools/Makefile +++ b/tools/dosfstools/Makefile @@ -8,6 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dosfstools +PKG_CPE_ID:=cpe:/a:dosfstools_project:dosfstools PKG_VERSION:=4.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz diff --git a/tools/e2fsprogs/Makefile b/tools/e2fsprogs/Makefile index 04befc9c80..36f5c547b8 100644 --- a/tools/e2fsprogs/Makefile +++ b/tools/e2fsprogs/Makefile @@ -8,8 +8,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=e2fsprogs -PKG_VERSION:=1.43.5 -PKG_HASH:=261f3d9ade383fbf032a19140c9c25e998cc0f71a1ae686614fb3ae0eb955a17 +PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs +PKG_VERSION:=1.43.7 +PKG_HASH:=2a6367289047d68d9ba6a46cf89ab9a1efd0556cde02a51ebaf414ff51edded9 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz diff --git a/tools/e2fsprogs/patches/005-darwin-compat.patch b/tools/e2fsprogs/patches/004-darwin-compat.patch similarity index 100% rename from tools/e2fsprogs/patches/005-darwin-compat.patch rename to tools/e2fsprogs/patches/004-darwin-compat.patch diff --git a/tools/e2fsprogs/patches/004-freebsd-compat.patch b/tools/e2fsprogs/patches/004-freebsd-compat.patch deleted file mode 100644 index d102e1cd9c..0000000000 --- a/tools/e2fsprogs/patches/004-freebsd-compat.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/lib/ext2fs/tdb.c -+++ b/lib/ext2fs/tdb.c -@@ -58,7 +58,9 @@ Last Changed Date: 2007-06-22 13:36:10 - - #include - #endif - #include -+#ifndef __FreeBSD__ - #include -+#endif - #include - - #ifdef HAVE_SYS_MMAN_H diff --git a/tools/e2fsprogs/patches/010-old-libmagic.patch b/tools/e2fsprogs/patches/010-old-libmagic.patch deleted file mode 100644 index 11a7e180be..0000000000 --- a/tools/e2fsprogs/patches/010-old-libmagic.patch +++ /dev/null @@ -1,25 +0,0 @@ -From b482eb7af94885b6bbad9329e40702c958d5b448 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Thu, 30 Jun 2016 19:53:03 +0200 -Subject: [PATCH] fix build problem with very old libmagic - -The libmagic shipped with RedHat 5 does not define -MAGIC_NO_CHECK_ELF and MAGIC_NO_CHECK_COMPRESS. e2fsprogs should -check for that otherwise the build will fail. - -Signed-off-by: Hauke Mehrtens ---- - lib/support/plausible.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/lib/support/plausible.c -+++ b/lib/support/plausible.c -@@ -258,7 +258,7 @@ int check_plausibility(const char *devic - return 0; - } - --#ifdef HAVE_MAGIC_H -+#if defined(HAVE_MAGIC_H) && defined(MAGIC_NO_CHECK_ELF) && defined(MAGIC_NO_CHECK_COMPRESS) - if ((flags & CHECK_FS_EXIST) && - !getenv("E2FSPROGS_LIBMAGIC_SUPPRESS") && - magic_library_available()) { diff --git a/tools/expat/Makefile b/tools/expat/Makefile index 1f856c9117..fab04e011f 100644 --- a/tools/expat/Makefile +++ b/tools/expat/Makefile @@ -8,10 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=expat -PKG_VERSION:=2.2.3 +PKG_CPE_ID:=cpe:/a:libexpat:expat +PKG_VERSION:=2.2.5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_HASH:=b31890fb02f85c002a67491923f89bda5028a880fd6c374f707193ad81aace5f +PKG_HASH:=d9dc32efba7e74f788fcc4f212a43216fc37cf5f23f4c2339664d473353aedf6 PKG_SOURCE_URL:=@SF/expat HOST_BUILD_PARALLEL:=1 diff --git a/tools/findutils/Makefile b/tools/findutils/Makefile index b07c53d9f6..c1c45eeaab 100644 --- a/tools/findutils/Makefile +++ b/tools/findutils/Makefile @@ -7,6 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=findutils +PKG_CPE_ID:=cpe:/a:gnu:findutils PKG_VERSION:=4.6.0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz diff --git a/tools/findutils/patches/100-include_sysmacros.patch b/tools/findutils/patches/100-include_sysmacros.patch new file mode 100644 index 0000000000..82b1ee9a42 --- /dev/null +++ b/tools/findutils/patches/100-include_sysmacros.patch @@ -0,0 +1,13 @@ +--- a/gl/lib/mountlist.c ++++ b/gl/lib/mountlist.c +@@ -17,6 +17,10 @@ + + #include + ++#ifdef MAJOR_IN_SYSMACROS ++# include ++#endif ++ + #include "mountlist.h" + + #include diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 4f1f8d70f5..ca41387b5e 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -20,6 +20,7 @@ define Host/Compile $(call cc,addpattern) $(call cc,asustrx) $(call cc,trx) + $(call cc,otrx) $(call cc,motorola-bin) $(call cc,dgfirmware) $(call cc,mksenaofw md5) @@ -39,8 +40,8 @@ define Host/Compile $(call cc,encode_crc) $(call cc,nand_ecc) $(call cc,mkplanexfw sha1) - $(call cc,mktplinkfw md5, -Wall) - $(call cc,mktplinkfw2 md5) + $(call cc,mktplinkfw mktplinkfw-lib md5, -Wall -fgnu89-inline) + $(call cc,mktplinkfw2 mktplinkfw-lib md5, -fgnu89-inline) $(call cc,tplink-safeloader md5, -Wall) $(call cc,pc1crypt) $(call cc,osbridge-crc) diff --git a/tools/firmware-utils/src/mktplinkfw-lib.c b/tools/firmware-utils/src/mktplinkfw-lib.c new file mode 100644 index 0000000000..e3213274c1 --- /dev/null +++ b/tools/firmware-utils/src/mktplinkfw-lib.c @@ -0,0 +1,265 @@ +/* + * Copyright (C) 2009 Gabor Juhos + * + * This tool was based on: + * TP-Link WR941 V2 firmware checksum fixing tool. + * Copyright (C) 2008,2009 Wang Jian + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + */ + +#include +#include +#include +#include +#include /* for unlink() */ +#include +#include /* for getopt() */ +#include +#include +#include +#include +#include + +#include +#include + +#include "mktplinkfw-lib.h" +#include "md5.h" + +extern char *ofname; +extern char *progname; +extern uint32_t kernel_len; +extern struct file_info kernel_info; +extern struct file_info rootfs_info; +extern struct flash_layout *layout; +extern uint32_t rootfs_ofs; +extern uint32_t rootfs_align; +extern int combined; +extern int strip_padding; +extern int add_jffs2_eof; + +static unsigned char jffs2_eof_mark[4] = {0xde, 0xad, 0xc0, 0xde}; + +void fill_header(char *buf, int len); + +struct flash_layout *find_layout(struct flash_layout *layouts, const char *id) +{ + struct flash_layout *ret; + struct flash_layout *l; + + ret = NULL; + for (l = layouts; l->id != NULL; l++){ + if (strcasecmp(id, l->id) == 0) { + ret = l; + break; + } + }; + + return ret; +} + +void get_md5(const char *data, int size, uint8_t *md5) +{ + MD5_CTX ctx; + + MD5_Init(&ctx); + MD5_Update(&ctx, data, size); + MD5_Final(md5, &ctx); +} + +int get_file_stat(struct file_info *fdata) +{ + struct stat st; + int res; + + if (fdata->file_name == NULL) + return 0; + + res = stat(fdata->file_name, &st); + if (res){ + ERRS("stat failed on %s", fdata->file_name); + return res; + } + + fdata->file_size = st.st_size; + return 0; +} + +int read_to_buf(const struct file_info *fdata, char *buf) +{ + FILE *f; + int ret = EXIT_FAILURE; + + f = fopen(fdata->file_name, "r"); + if (f == NULL) { + ERRS("could not open \"%s\" for reading", fdata->file_name); + goto out; + } + + errno = 0; + fread(buf, fdata->file_size, 1, f); + if (errno != 0) { + ERRS("unable to read from file \"%s\"", fdata->file_name); + goto out_close; + } + + ret = EXIT_SUCCESS; + +out_close: + fclose(f); +out: + return ret; +} + +static int pad_jffs2(char *buf, int currlen, int maxlen) +{ + int len; + uint32_t pad_mask; + + len = currlen; + pad_mask = (4 * 1024) | (64 * 1024); /* EOF at 4KB and at 64KB */ + while ((len < maxlen) && (pad_mask != 0)) { + uint32_t mask; + int i; + + for (i = 10; i < 32; i++) { + mask = 1 << i; + if (pad_mask & mask) + break; + } + + len = ALIGN(len, mask); + + for (i = 10; i < 32; i++) { + mask = 1 << i; + if ((len & (mask - 1)) == 0) + pad_mask &= ~mask; + } + + for (i = 0; i < sizeof(jffs2_eof_mark); i++) + buf[len + i] = jffs2_eof_mark[i]; + + len += sizeof(jffs2_eof_mark); + } + + return len; +} + +int write_fw(const char *ofname, const char *data, int len) +{ + FILE *f; + int ret = EXIT_FAILURE; + + f = fopen(ofname, "w"); + if (f == NULL) { + ERRS("could not open \"%s\" for writing", ofname); + goto out; + } + + errno = 0; + fwrite(data, len, 1, f); + if (errno) { + ERRS("unable to write output file"); + goto out_flush; + } + + DBG("firmware file \"%s\" completed", ofname); + + ret = EXIT_SUCCESS; + +out_flush: + fflush(f); + fclose(f); + if (ret != EXIT_SUCCESS) { + unlink(ofname); + } +out: + return ret; +} + +/* Helper functions to inspect_fw() representing different output formats */ +inline void inspect_fw_pstr(const char *label, const char *str) +{ + printf("%-23s: %s\n", label, str); +} + +inline void inspect_fw_phex(const char *label, uint32_t val) +{ + printf("%-23s: 0x%08x\n", label, val); +} + +inline void inspect_fw_phexdec(const char *label, uint32_t val) +{ + printf("%-23s: 0x%08x / %8u bytes\n", label, val, val); +} + +inline void inspect_fw_pmd5sum(const char *label, const uint8_t *val, const char *text) +{ + int i; + + printf("%-23s:", label); + for (i=0; ifw_max_len; + + buf = malloc(buflen); + if (!buf) { + ERR("no memory for buffer\n"); + goto out; + } + + memset(buf, 0xff, buflen); + p = buf + header_size; + ret = read_to_buf(&kernel_info, p); + if (ret) + goto out_free_buf; + + if (!combined) { + p = buf + rootfs_ofs; + + ret = read_to_buf(&rootfs_info, p); + if (ret) + goto out_free_buf; + + writelen = rootfs_ofs + rootfs_info.file_size; + + if (add_jffs2_eof) + writelen = pad_jffs2(buf, writelen, layout->fw_max_len); + } + + if (!strip_padding) + writelen = buflen; + + fill_header(buf, writelen); + ret = write_fw(ofname, buf, writelen); + if (ret) + goto out_free_buf; + + ret = EXIT_SUCCESS; + +out_free_buf: + free(buf); +out: + return ret; +} diff --git a/tools/firmware-utils/src/mktplinkfw-lib.h b/tools/firmware-utils/src/mktplinkfw-lib.h new file mode 100644 index 0000000000..31e6d0b1e6 --- /dev/null +++ b/tools/firmware-utils/src/mktplinkfw-lib.h @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2009 Gabor Juhos + * + * This tool was based on: + * TP-Link WR941 V2 firmware checksum fixing tool. + * Copyright (C) 2008,2009 Wang Jian + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + */ + + +#ifndef mktplinkfw_lib_h +#define mktplinkfw_lib_h + +#define ALIGN(x,a) ({ typeof(a) __a = (a); (((x) + __a - 1) & ~(__a - 1)); }) +#define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0])) + +#define MD5SUM_LEN 16 + +/* + * Message macros + */ +#define ERR(fmt, ...) do { \ + fflush(0); \ + fprintf(stderr, "[%s] *** error: " fmt "\n", \ + progname, ## __VA_ARGS__ ); \ +} while (0) + +#define ERRS(fmt, ...) do { \ + int save = errno; \ + fflush(0); \ + fprintf(stderr, "[%s] *** error: " fmt ": %s\n", \ + progname, ## __VA_ARGS__, strerror(save)); \ +} while (0) + +#define DBG(fmt, ...) do { \ + fprintf(stderr, "[%s] " fmt "\n", progname, ## __VA_ARGS__ ); \ +} while (0) + + +struct file_info { + char *file_name; /* name of the file */ + uint32_t file_size; /* length of the file */ +}; + +struct flash_layout { + char *id; + uint32_t fw_max_len; + uint32_t kernel_la; + uint32_t kernel_ep; + uint32_t rootfs_ofs; +}; + +struct flash_layout *find_layout(struct flash_layout *layouts, const char *id); +void get_md5(const char *data, int size, uint8_t *md5); +int get_file_stat(struct file_info *fdata); +int read_to_buf(const struct file_info *fdata, char *buf); +int write_fw(const char *ofname, const char *data, int len); +inline void inspect_fw_pstr(const char *label, const char *str); +inline void inspect_fw_phex(const char *label, uint32_t val); +inline void inspect_fw_phexdec(const char *label, uint32_t val); +inline void inspect_fw_pmd5sum(const char *label, const uint8_t *val, const char *text); +int build_fw(size_t header_size); + +#endif /* mktplinkfw_lib_h */ diff --git a/tools/firmware-utils/src/mktplinkfw.c b/tools/firmware-utils/src/mktplinkfw.c index c537862050..ab5fd6d58b 100644 --- a/tools/firmware-utils/src/mktplinkfw.c +++ b/tools/firmware-utils/src/mktplinkfw.c @@ -28,20 +28,11 @@ #include #include "md5.h" - -#define ALIGN(x,a) ({ typeof(a) __a = (a); (((x) + __a - 1) & ~(__a - 1)); }) -#define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0])) +#include "mktplinkfw-lib.h" #define HEADER_VERSION_V1 0x01000000 #define HEADER_VERSION_V2 0x02000000 -#define MD5SUM_LEN 16 - -struct file_info { - char *file_name; /* name of the file */ - uint32_t file_size; /* length of the file */ -}; - struct fw_header { uint32_t version; /* header version */ char vendor_name[24]; @@ -71,14 +62,6 @@ struct fw_header { uint8_t pad2[160]; } __attribute__ ((packed)); -struct flash_layout { - char *id; - uint32_t fw_max_len; - uint32_t kernel_la; - uint32_t kernel_ep; - uint32_t rootfs_ofs; -}; - struct fw_region { char name[4]; uint32_t code; @@ -88,15 +71,15 @@ struct fw_region { /* * Globals */ -static char *ofname; -static char *progname; +char *ofname; +char *progname; static char *vendor = "TP-LINK Technologies"; static char *version = "ver. 1.0"; static char *fw_ver = "0.0.0"; static uint32_t hdr_ver = HEADER_VERSION_V1; static char *layout_id; -static struct flash_layout *layout; +struct flash_layout *layout; static char *opt_hw_id; static uint32_t hw_id; static char *opt_hw_rev; @@ -107,18 +90,17 @@ static const struct fw_region *region; static int fw_ver_lo; static int fw_ver_mid; static int fw_ver_hi; -static struct file_info kernel_info; +struct file_info kernel_info; static uint32_t kernel_la = 0; static uint32_t kernel_ep = 0; -static uint32_t kernel_len = 0; -static struct file_info rootfs_info; -static uint32_t rootfs_ofs = 0; -static uint32_t rootfs_align; +uint32_t kernel_len = 0; +struct file_info rootfs_info; +uint32_t rootfs_ofs = 0; +uint32_t rootfs_align; static struct file_info boot_info; -static int combined; -static int strip_padding; -static int add_jffs2_eof; -static unsigned char jffs2_eof_mark[4] = {0xde, 0xad, 0xc0, 0xde}; +int combined; +int strip_padding; +int add_jffs2_eof; static uint32_t fw_max_len; static uint32_t reserved_space; @@ -188,44 +170,9 @@ static const struct fw_region regions[] = { /* Default region (universal) uses code 0 as well */ {"US", 1}, {"EU", 0}, + {"BR", 0}, }; -/* - * Message macros - */ -#define ERR(fmt, ...) do { \ - fflush(0); \ - fprintf(stderr, "[%s] *** error: " fmt "\n", \ - progname, ## __VA_ARGS__ ); \ -} while (0) - -#define ERRS(fmt, ...) do { \ - int save = errno; \ - fflush(0); \ - fprintf(stderr, "[%s] *** error: " fmt ": %s\n", \ - progname, ## __VA_ARGS__, strerror(save)); \ -} while (0) - -#define DBG(fmt, ...) do { \ - fprintf(stderr, "[%s] " fmt "\n", progname, ## __VA_ARGS__ ); \ -} while (0) - -static struct flash_layout *find_layout(const char *id) -{ - struct flash_layout *ret; - struct flash_layout *l; - - ret = NULL; - for (l = layouts; l->id != NULL; l++){ - if (strcasecmp(id, l->id) == 0) { - ret = l; - break; - } - }; - - return ret; -} - static const struct fw_region * find_region(const char *country) { size_t i; @@ -271,59 +218,6 @@ static void usage(int status) exit(status); } -static void get_md5(const char *data, int size, uint8_t *md5) -{ - MD5_CTX ctx; - - MD5_Init(&ctx); - MD5_Update(&ctx, data, size); - MD5_Final(md5, &ctx); -} - -static int get_file_stat(struct file_info *fdata) -{ - struct stat st; - int res; - - if (fdata->file_name == NULL) - return 0; - - res = stat(fdata->file_name, &st); - if (res){ - ERRS("stat failed on %s", fdata->file_name); - return res; - } - - fdata->file_size = st.st_size; - return 0; -} - -static int read_to_buf(const struct file_info *fdata, char *buf) -{ - FILE *f; - int ret = EXIT_FAILURE; - - f = fopen(fdata->file_name, "r"); - if (f == NULL) { - ERRS("could not open \"%s\" for reading", fdata->file_name); - goto out; - } - - errno = 0; - fread(buf, fdata->file_size, 1, f); - if (errno != 0) { - ERRS("unable to read from file \"%s\"", fdata->file_name); - goto out_close; - } - - ret = EXIT_SUCCESS; - - out_close: - fclose(f); - out: - return ret; -} - static int check_options(void) { int ret; @@ -370,7 +264,7 @@ static int check_options(void) return -1; } } else { - layout = find_layout(layout_id); + layout = find_layout(layouts, layout_id); if (layout == NULL) { ERR("unknown flash layout \"%s\"", layout_id); return -1; @@ -414,10 +308,10 @@ static int check_options(void) if (rootfs_align) { kernel_len += sizeof(struct fw_header); - kernel_len = ALIGN(kernel_len, rootfs_align); + rootfs_ofs = ALIGN(kernel_len, rootfs_align); kernel_len -= sizeof(struct fw_header); - DBG("kernel length aligned to %u", kernel_len); + DBG("rootfs offset aligned to 0x%u", rootfs_ofs); exceed_bytes = kernel_len + rootfs_info.file_size - (fw_max_len - sizeof(struct fw_header)); if (exceed_bytes > 0) { @@ -462,7 +356,7 @@ static int check_options(void) return 0; } -static void fill_header(char *buf, int len) +void fill_header(char *buf, int len) { struct fw_header *hdr = (struct fw_header *)buf; @@ -515,161 +409,6 @@ static void fill_header(char *buf, int len) get_md5(buf, len, hdr->md5sum1); } -static int pad_jffs2(char *buf, int currlen) -{ - int len; - uint32_t pad_mask; - - len = currlen; - pad_mask = (64 * 1024); - while ((len < layout->fw_max_len) && (pad_mask != 0)) { - uint32_t mask; - int i; - - for (i = 10; i < 32; i++) { - mask = 1 << i; - if (pad_mask & mask) - break; - } - - len = ALIGN(len, mask); - - for (i = 10; i < 32; i++) { - mask = 1 << i; - if ((len & (mask - 1)) == 0) - pad_mask &= ~mask; - } - - for (i = 0; i < sizeof(jffs2_eof_mark); i++) - buf[len + i] = jffs2_eof_mark[i]; - - len += sizeof(jffs2_eof_mark); - } - - return len; -} - -static int write_fw(const char *data, int len) -{ - FILE *f; - int ret = EXIT_FAILURE; - - f = fopen(ofname, "w"); - if (f == NULL) { - ERRS("could not open \"%s\" for writing", ofname); - goto out; - } - - errno = 0; - fwrite(data, len, 1, f); - if (errno) { - ERRS("unable to write output file"); - goto out_flush; - } - - DBG("firmware file \"%s\" completed", ofname); - - ret = EXIT_SUCCESS; - - out_flush: - fflush(f); - fclose(f); - if (ret != EXIT_SUCCESS) { - unlink(ofname); - } - out: - return ret; -} - -static int build_fw(void) -{ - int buflen; - char *buf; - char *p; - int ret = EXIT_FAILURE; - int writelen = 0; - - writelen = sizeof(struct fw_header) + kernel_len; - - if (combined) - buflen = writelen; - else - buflen = layout->fw_max_len; - - buf = malloc(buflen); - if (!buf) { - ERR("no memory for buffer\n"); - goto out; - } - - memset(buf, 0xff, buflen); - p = buf + sizeof(struct fw_header); - ret = read_to_buf(&kernel_info, p); - if (ret) - goto out_free_buf; - - - if (!combined) { - if (rootfs_align) - p = buf + writelen; - else - p = buf + rootfs_ofs; - - ret = read_to_buf(&rootfs_info, p); - if (ret) - goto out_free_buf; - - if (rootfs_align) - writelen += rootfs_info.file_size; - else - writelen = rootfs_ofs + rootfs_info.file_size; - - if (add_jffs2_eof) - writelen = pad_jffs2(buf, writelen); - } - - if (!strip_padding) - writelen = buflen; - - fill_header(buf, writelen); - ret = write_fw(buf, writelen); - if (ret) - goto out_free_buf; - - ret = EXIT_SUCCESS; - - out_free_buf: - free(buf); - out: - return ret; -} - -/* Helper functions to inspect_fw() representing different output formats */ -static inline void inspect_fw_pstr(const char *label, const char *str) -{ - printf("%-23s: %s\n", label, str); -} - -static inline void inspect_fw_phex(const char *label, uint32_t val) -{ - printf("%-23s: 0x%08x\n", label, val); -} - -static inline void inspect_fw_phexdec(const char *label, uint32_t val) -{ - printf("%-23s: 0x%08x / %8u bytes\n", label, val, val); -} - -static inline void inspect_fw_pmd5sum(const char *label, const uint8_t *val, const char *text) -{ - int i; - - printf("%-23s:", label); - for (i=0; i #include "md5.h" - -#define ALIGN(x,a) ({ typeof(a) __a = (a); (((x) + __a - 1) & ~(__a - 1)); }) - -#define MD5SUM_LEN 16 - -struct file_info { - char *file_name; /* name of the file */ - uint32_t file_size; /* length of the file */ -}; +#include "mktplinkfw-lib.h" struct fw_header { uint32_t version; /* 0x00: header version */ @@ -68,14 +60,6 @@ struct fw_header { uint8_t pad[364]; } __attribute__ ((packed)); -struct flash_layout { - char *id; - uint32_t fw_max_len; - uint32_t kernel_la; - uint32_t kernel_ep; - uint32_t rootfs_ofs; -}; - #define FLAG_LE_KERNEL_LA_EP 0x00000001 /* Little-endian used for kernel load address & entry point */ struct board_info { @@ -91,8 +75,8 @@ struct board_info { /* * Globals */ -static char *ofname; -static char *progname; +char *ofname; +char *progname; static char *vendor = "TP-LINK Technologies"; static char *version = "ver. 1.0"; static char *fw_ver = "0.0.0"; @@ -101,10 +85,9 @@ static uint32_t hdr_ver = 2; static struct board_info custom_board; -static char *board_id; static struct board_info *board; static char *layout_id; -static struct flash_layout *layout; +struct flash_layout *layout; static char *opt_hw_id; static char *opt_hw_rev; static char *opt_hw_ver_add; @@ -113,18 +96,17 @@ static int fw_ver_mid; static int fw_ver_hi; static int sver_lo; static int sver_hi; -static struct file_info kernel_info; +struct file_info kernel_info; static uint32_t kernel_la = 0; static uint32_t kernel_ep = 0; -static uint32_t kernel_len = 0; -static struct file_info rootfs_info; -static uint32_t rootfs_ofs = 0; -static uint32_t rootfs_align; +uint32_t kernel_len = 0; +struct file_info rootfs_info; +uint32_t rootfs_ofs = 0; +uint32_t rootfs_align; static struct file_info boot_info; -static int combined; -static int strip_padding; -static int add_jffs2_eof; -static unsigned char jffs2_eof_mark[4] = {0xde, 0xad, 0xc0, 0xde}; +int combined; +int strip_padding; +int add_jffs2_eof; static struct file_info inspect_info; static int extract = 0; @@ -141,6 +123,12 @@ char md5salt_boot[MD5SUM_LEN] = { static struct flash_layout layouts[] = { { + .id = "4Mmtk", + .fw_max_len = 0x3c0000, + .kernel_la = 0x80000000, + .kernel_ep = 0x80000000, + .rootfs_ofs = 0x140000, + }, { .id = "8Mltq", .fw_max_len = 0x7a0000, .kernel_la = 0x80002000, @@ -169,129 +157,6 @@ static struct flash_layout layouts[] = { } }; -static struct board_info boards[] = { - { - .id = "TD-W8970v1", - .hw_id = 0x89700001, - .hw_rev = 1, - .layout_id = "8Mltq", - }, { - .id = "TD-W8980v1", - .hw_id = 0x89800001, - .hw_rev = 14, - .layout_id = "8Mltq", - }, { - .id = "ArcherC20i", - .hw_id = 0xc2000001, - .hw_rev = 58, - .layout_id = "8Mmtk", - .hdr_ver = 3, - .flags = FLAG_LE_KERNEL_LA_EP, - }, { - .id = "ArcherVR200V", - .hw_id = 0x73b70801, - .hw_rev = 0x2f, - .layout_id = "16Mltq", - .hdr_ver = 2, - }, { - .id = "ArcherC50", - .hw_id = 0xc7500001, - .hw_rev = 69, - .layout_id = "8Mmtk", - .hdr_ver = 3, - .flags = FLAG_LE_KERNEL_LA_EP, - }, { - .id = "ArcherMR200", - .hw_id = 0xd7500001, - .hw_rev = 0x4a, - .layout_id = "8MLmtk", - .hdr_ver = 3, - .flags = FLAG_LE_KERNEL_LA_EP, - }, { - .id = "TL-WR840NV4", - .hw_id = 0x08400004, - .hw_rev = 0x1, - .hw_ver_add = 0x4, - .layout_id = "8Mmtk", - .hdr_ver = 3, - .flags = FLAG_LE_KERNEL_LA_EP, - }, { - .id = "TL-WR841NV13", - .hw_id = 0x08410013, - .hw_rev = 0x268, - .hw_ver_add = 0x13, - .layout_id = "8Mmtk", - .hdr_ver = 3, - .flags = FLAG_LE_KERNEL_LA_EP, - }, { - /* terminating entry */ - } -}; - -/* - * Message macros - */ -#define ERR(fmt, ...) do { \ - fflush(0); \ - fprintf(stderr, "[%s] *** error: " fmt "\n", \ - progname, ## __VA_ARGS__ ); \ -} while (0) - -#define ERRS(fmt, ...) do { \ - int save = errno; \ - fflush(0); \ - fprintf(stderr, "[%s] *** error: " fmt ": %s\n", \ - progname, ## __VA_ARGS__, strerror(save)); \ -} while (0) - -#define DBG(fmt, ...) do { \ - fprintf(stderr, "[%s] " fmt "\n", progname, ## __VA_ARGS__ ); \ -} while (0) - -static struct board_info *find_board(char *id) -{ - struct board_info *ret; - struct board_info *board; - - ret = NULL; - for (board = boards; board->id != NULL; board++){ - if (strcasecmp(id, board->id) == 0) { - ret = board; - break; - } - }; - - return ret; -} - -static struct board_info *find_board_by_hwid(uint32_t hw_id) -{ - struct board_info *board; - - for (board = boards; board->id != NULL; board++) { - if (hw_id == board->hw_id) - return board; - }; - - return NULL; -} - -static struct flash_layout *find_layout(char *id) -{ - struct flash_layout *ret; - struct flash_layout *l; - - ret = NULL; - for (l = layouts; l->id != NULL; l++){ - if (strcasecmp(id, l->id) == 0) { - ret = l; - break; - } - }; - - return ret; -} - static void usage(int status) { FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout; @@ -301,7 +166,6 @@ static void usage(int status) fprintf(stream, "\n" "Options:\n" -" -B create image for the board specified with \n" " -c use combined kernel image\n" " -e swap endianness in kernel load address and entry point\n" " -E overwrite kernel entry point with (hexval prefixed with 0x)\n" @@ -330,59 +194,6 @@ static void usage(int status) exit(status); } -static int get_md5(char *data, int size, char *md5) -{ - MD5_CTX ctx; - - MD5_Init(&ctx); - MD5_Update(&ctx, data, size); - MD5_Final(md5, &ctx); -} - -static int get_file_stat(struct file_info *fdata) -{ - struct stat st; - int res; - - if (fdata->file_name == NULL) - return 0; - - res = stat(fdata->file_name, &st); - if (res){ - ERRS("stat failed on %s", fdata->file_name); - return res; - } - - fdata->file_size = st.st_size; - return 0; -} - -static int read_to_buf(struct file_info *fdata, char *buf) -{ - FILE *f; - int ret = EXIT_FAILURE; - - f = fopen(fdata->file_name, "r"); - if (f == NULL) { - ERRS("could not open \"%s\" for reading", fdata->file_name); - goto out; - } - - errno = 0; - fread(buf, fdata->file_size, 1, f); - if (errno != 0) { - ERRS("unable to read from file \"%s\"", fdata->file_name); - goto out_close; - } - - ret = EXIT_SUCCESS; - - out_close: - fclose(f); - out: - return ret; -} - static int check_options(void) { int ret; @@ -398,42 +209,29 @@ static int check_options(void) return -1; } - if (board_id == NULL && opt_hw_id == NULL) { - ERR("either board or hardware id must be specified"); + if (opt_hw_id == NULL) { + ERR("hardware id must be specified"); return -1; } - if (board_id) { - board = find_board(board_id); - if (board == NULL) { - ERR("unknown/unsupported board id \"%s\"", board_id); - return -1; - } - if (layout_id == NULL) - layout_id = board->layout_id; + board = &custom_board; - if (board->hdr_ver) - hdr_ver = board->hdr_ver; - } else { - board = &custom_board; - - if (layout_id == NULL) { - ERR("flash layout is not specified"); - return -1; - } - - board->hw_id = strtoul(opt_hw_id, NULL, 0); - - board->hw_rev = 1; - board->hw_ver_add = 0; + if (layout_id == NULL) { + ERR("flash layout is not specified"); + return -1; } + board->hw_id = strtoul(opt_hw_id, NULL, 0); + + board->hw_rev = 1; + board->hw_ver_add = 0; + if (opt_hw_rev) board->hw_rev = strtoul(opt_hw_rev, NULL, 0); if (opt_hw_ver_add) board->hw_ver_add = strtoul(opt_hw_ver_add, NULL, 0); - layout = find_layout(layout_id); + layout = find_layout(layouts, layout_id); if (layout == NULL) { ERR("unknown flash layout \"%s\"", layout_id); return -1; @@ -475,10 +273,10 @@ static int check_options(void) if (rootfs_align) { kernel_len += sizeof(struct fw_header); - kernel_len = ALIGN(kernel_len, rootfs_align); + rootfs_ofs = ALIGN(kernel_len, rootfs_align); kernel_len -= sizeof(struct fw_header); - DBG("kernel length aligned to %u", kernel_len); + DBG("rootfs offset aligned to 0x%u", rootfs_ofs); if (kernel_len + rootfs_info.file_size > layout->fw_max_len - sizeof(struct fw_header)) { @@ -520,7 +318,7 @@ static int check_options(void) return 0; } -static void fill_header(char *buf, int len) +void fill_header(char *buf, int len) { struct fw_header *hdr = (struct fw_header *)buf; unsigned ver_len; @@ -582,196 +380,6 @@ static void fill_header(char *buf, int len) get_md5(buf, len, hdr->md5sum1); } -static int pad_jffs2(char *buf, int currlen) -{ - int len; - uint32_t pad_mask; - - len = currlen; - pad_mask = (64 * 1024); - while ((len < layout->fw_max_len) && (pad_mask != 0)) { - uint32_t mask; - int i; - - for (i = 10; i < 32; i++) { - mask = 1 << i; - if (pad_mask & mask) - break; - } - - len = ALIGN(len, mask); - - for (i = 10; i < 32; i++) { - mask = 1 << i; - if ((len & (mask - 1)) == 0) - pad_mask &= ~mask; - } - - for (i = 0; i < sizeof(jffs2_eof_mark); i++) - buf[len + i] = jffs2_eof_mark[i]; - - len += sizeof(jffs2_eof_mark); - } - - return len; -} - -static int write_fw(char *data, int len) -{ - FILE *f; - int ret = EXIT_FAILURE; - - f = fopen(ofname, "w"); - if (f == NULL) { - ERRS("could not open \"%s\" for writing", ofname); - goto out; - } - - errno = 0; - fwrite(data, len, 1, f); - if (errno) { - ERRS("unable to write output file"); - goto out_flush; - } - - DBG("firmware file \"%s\" completed", ofname); - - ret = EXIT_SUCCESS; - - out_flush: - fflush(f); - fclose(f); - if (ret != EXIT_SUCCESS) { - unlink(ofname); - } - out: - return ret; -} - -static int build_fw(void) -{ - int buflen; - char *buf; - char *p; - int ret = EXIT_FAILURE; - int writelen = 0; - - buflen = layout->fw_max_len; - - buf = malloc(buflen); - if (!buf) { - ERR("no memory for buffer\n"); - goto out; - } - - memset(buf, 0xff, buflen); - p = buf + sizeof(struct fw_header); - ret = read_to_buf(&kernel_info, p); - if (ret) - goto out_free_buf; - - writelen = sizeof(struct fw_header) + kernel_len; - - if (!combined) { - if (rootfs_align) - p = buf + writelen; - else - p = buf + rootfs_ofs; - - ret = read_to_buf(&rootfs_info, p); - if (ret) - goto out_free_buf; - - if (rootfs_align) - writelen += rootfs_info.file_size; - else - writelen = rootfs_ofs + rootfs_info.file_size; - - if (add_jffs2_eof) - writelen = pad_jffs2(buf, writelen); - } - - if (!strip_padding) - writelen = buflen; - - fill_header(buf, writelen); - ret = write_fw(buf, writelen); - if (ret) - goto out_free_buf; - - ret = EXIT_SUCCESS; - - out_free_buf: - free(buf); - out: - return ret; -} - -/* Helper functions to inspect_fw() representing different output formats */ -static inline void inspect_fw_pstr(char *label, char *str) -{ - printf("%-23s: %s\n", label, str); -} - -static inline void inspect_fw_phex(char *label, uint32_t val) -{ - printf("%-23s: 0x%08x\n", label, val); -} - -static inline void inspect_fw_phexpost(char *label, - uint32_t val, char *post) -{ - printf("%-23s: 0x%08x (%s)\n", label, val, post); -} - -static inline void inspect_fw_phexdef(char *label, - uint32_t val, uint32_t defval) -{ - printf("%-23s: 0x%08x ", label, val); - - if (val == defval) - printf("(== OpenWrt default)\n"); - else - printf("(OpenWrt default: 0x%08x)\n", defval); -} - -static inline void inspect_fw_phexexp(char *label, - uint32_t val, uint32_t expval) -{ - printf("%-23s: 0x%08x ", label, val); - - if (val == expval) - printf("(ok)\n"); - else - printf("(expected: 0x%08x)\n", expval); -} - -static inline void inspect_fw_phexdec(char *label, uint32_t val) -{ - printf("%-23s: 0x%08x / %8u bytes\n", label, val, val); -} - -static inline void inspect_fw_phexdecdef(char *label, - uint32_t val, uint32_t defval) -{ - printf("%-23s: 0x%08x / %8u bytes ", label, val, val); - - if (val == defval) - printf("(== OpenWrt default)\n"); - else - printf("(OpenWrt default: 0x%08x)\n", defval); -} - -static inline void inspect_fw_pmd5sum(char *label, uint8_t *val, char *text) -{ - int i; - - printf("%-23s:", label); - for (i=0; ihw_id)); - if (!board) - board = &custom_board; + board = &custom_board; if (board->flags & FLAG_LE_KERNEL_LA_EP) { hdr->kernel_la = bswap_32(hdr->kernel_la); @@ -844,23 +450,11 @@ static int inspect_fw(void) printf("\n"); inspect_fw_pstr("Firmware version", hdr->fw_version); - - if (board != &custom_board) { - layout = find_layout(board->layout_id); - inspect_fw_phexpost("Hardware ID", - ntohl(hdr->hw_id), board->id); - inspect_fw_phexexp("Hardware Revision", - ntohl(hdr->hw_rev), board->hw_rev); - inspect_fw_phexexp("Additional HW Version", - ntohl(hdr->hw_ver_add), board->hw_ver_add); - } else { - inspect_fw_phexpost("Hardware ID", - ntohl(hdr->hw_id), "unknown"); - inspect_fw_phex("Hardware Revision", - ntohl(hdr->hw_rev)); - inspect_fw_phex("Additional HW Version", - ntohl(hdr->hw_ver_add)); - } + inspect_fw_phex("Hardware ID", ntohl(hdr->hw_id)); + inspect_fw_phex("Hardware Revision", + ntohl(hdr->hw_rev)); + inspect_fw_phex("Additional HW Version", + ntohl(hdr->hw_ver_add)); printf("%-23s: %d.%d.%d-%d.%d\n", "Software version", hdr->ver_hi, hdr->ver_mid, hdr->ver_lo, @@ -872,24 +466,12 @@ static int inspect_fw(void) ntohl(hdr->kernel_ofs)); inspect_fw_phexdec("Kernel data length", ntohl(hdr->kernel_len)); - if (board != &custom_board) { - inspect_fw_phexdef("Kernel load address", - ntohl(hdr->kernel_la), - layout ? layout->kernel_la : 0xffffffff); - inspect_fw_phexdef("Kernel entry point", - ntohl(hdr->kernel_ep), - layout ? layout->kernel_ep : 0xffffffff); - inspect_fw_phexdecdef("Rootfs data offset", - ntohl(hdr->rootfs_ofs), - layout ? layout->rootfs_ofs : 0xffffffff); - } else { - inspect_fw_phex("Kernel load address", - ntohl(hdr->kernel_la)); - inspect_fw_phex("Kernel entry point", - ntohl(hdr->kernel_ep)); - inspect_fw_phexdec("Rootfs data offset", - ntohl(hdr->rootfs_ofs)); - } + inspect_fw_phex("Kernel load address", + ntohl(hdr->kernel_la)); + inspect_fw_phex("Kernel entry point", + ntohl(hdr->kernel_ep)); + inspect_fw_phexdec("Rootfs data offset", + ntohl(hdr->rootfs_ofs)); inspect_fw_phexdec("Rootfs data length", ntohl(hdr->rootfs_len)); inspect_fw_phexdec("Boot loader data offset", @@ -945,16 +527,13 @@ static int inspect_fw(void) int main(int argc, char *argv[]) { int ret = EXIT_FAILURE; - int err; - - FILE *outfile; progname = basename(argv[0]); while ( 1 ) { int c; - c = getopt(argc, argv, "a:B:H:E:F:L:V:N:W:w:ci:k:r:R:o:xhsjv:y:T:e"); + c = getopt(argc, argv, "a:H:E:F:L:V:N:W:w:ci:k:r:R:o:xhsjv:y:T:e"); if (c == -1) break; @@ -962,9 +541,6 @@ int main(int argc, char *argv[]) case 'a': sscanf(optarg, "0x%x", &rootfs_align); break; - case 'B': - board_id = optarg; - break; case 'H': opt_hw_id = optarg; break; @@ -1042,7 +618,7 @@ int main(int argc, char *argv[]) goto out; if (!inspect_info.file_name) - ret = build_fw(); + ret = build_fw(sizeof(struct fw_header)); else ret = inspect_fw(); diff --git a/tools/firmware-utils/src/otrx.c b/tools/firmware-utils/src/otrx.c new file mode 100644 index 0000000000..223e032f2b --- /dev/null +++ b/tools/firmware-utils/src/otrx.c @@ -0,0 +1,592 @@ +/* + * otrx + * + * Copyright (C) 2015-2017 Rafał Miłecki + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined(__BYTE_ORDER) +#error "Unknown byte order" +#endif + +#if __BYTE_ORDER == __BIG_ENDIAN +#define cpu_to_le32(x) bswap_32(x) +#define le32_to_cpu(x) bswap_32(x) +#elif __BYTE_ORDER == __LITTLE_ENDIAN +#define cpu_to_le32(x) (x) +#define le32_to_cpu(x) (x) +#else +#error "Unsupported endianness" +#endif + +#define TRX_MAGIC 0x30524448 +#define TRX_FLAGS_OFFSET 12 +#define TRX_MAX_PARTS 3 + +struct trx_header { + uint32_t magic; + uint32_t length; + uint32_t crc32; + uint16_t flags; + uint16_t version; + uint32_t offset[3]; +}; + +char *trx_path; +size_t trx_offset = 0; +char *partition[TRX_MAX_PARTS] = {}; + +static inline size_t otrx_min(size_t x, size_t y) { + return x < y ? x : y; +} + +/************************************************** + * CRC32 + **************************************************/ + +static const uint32_t crc32_tbl[] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, + 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, + 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, + 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, + 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, + 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, + 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, + 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, + 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, + 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, + 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, + 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, + 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, + 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, + 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, + 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, + 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, + 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, +}; + +uint32_t otrx_crc32(uint32_t crc, uint8_t *buf, size_t len) { + while (len) { + crc = crc32_tbl[(crc ^ *buf) & 0xff] ^ (crc >> 8); + buf++; + len--; + } + + return crc; +} + +/************************************************** + * Check + **************************************************/ + +static void otrx_check_parse_options(int argc, char **argv) { + int c; + + while ((c = getopt(argc, argv, "o:")) != -1) { + switch (c) { + case 'o': + trx_offset = atoi(optarg); + break; + } + } +} + +static int otrx_check(int argc, char **argv) { + FILE *trx; + struct trx_header hdr; + size_t bytes, length; + uint8_t buf[1024]; + uint32_t crc32; + int err = 0; + + if (argc < 3) { + fprintf(stderr, "No TRX file passed\n"); + err = -EINVAL; + goto out; + } + trx_path = argv[2]; + + optind = 3; + otrx_check_parse_options(argc, argv); + + trx = fopen(trx_path, "r"); + if (!trx) { + fprintf(stderr, "Couldn't open %s\n", trx_path); + err = -EACCES; + goto out; + } + + fseek(trx, trx_offset, SEEK_SET); + bytes = fread(&hdr, 1, sizeof(hdr), trx); + if (bytes != sizeof(hdr)) { + fprintf(stderr, "Couldn't read %s header\n", trx_path); + err = -EIO; + goto err_close; + } + + if (le32_to_cpu(hdr.magic) != TRX_MAGIC) { + fprintf(stderr, "Invalid TRX magic: 0x%08x\n", le32_to_cpu(hdr.magic)); + err = -EINVAL; + goto err_close; + } + + length = le32_to_cpu(hdr.length); + if (length < sizeof(hdr)) { + fprintf(stderr, "Length read from TRX too low (%zu B)\n", length); + err = -EINVAL; + goto err_close; + } + + crc32 = 0xffffffff; + fseek(trx, trx_offset + TRX_FLAGS_OFFSET, SEEK_SET); + length -= TRX_FLAGS_OFFSET; + while ((bytes = fread(buf, 1, otrx_min(sizeof(buf), length), trx)) > 0) { + crc32 = otrx_crc32(crc32, buf, bytes); + length -= bytes; + } + + if (length) { + fprintf(stderr, "Couldn't read last %zd B of data from %s\n", length, trx_path); + err = -EIO; + goto err_close; + } + + if (crc32 != le32_to_cpu(hdr.crc32)) { + fprintf(stderr, "Invalid data crc32: 0x%08x instead of 0x%08x\n", crc32, le32_to_cpu(hdr.crc32)); + err = -EINVAL; + goto err_close; + } + + printf("Found a valid TRX version %d\n", le32_to_cpu(hdr.version)); + +err_close: + fclose(trx); +out: + return err; +} + +/************************************************** + * Create + **************************************************/ + +static ssize_t otrx_create_append_file(FILE *trx, const char *in_path) { + FILE *in; + size_t bytes; + ssize_t length = 0; + uint8_t buf[1024]; + + in = fopen(in_path, "r"); + if (!in) { + fprintf(stderr, "Couldn't open %s\n", in_path); + return -EACCES; + } + + while ((bytes = fread(buf, 1, sizeof(buf), in)) > 0) { + if (fwrite(buf, 1, bytes, trx) != bytes) { + fprintf(stderr, "Couldn't write %zu B to %s\n", bytes, trx_path); + length = -EIO; + break; + } + length += bytes; + } + + fclose(in); + + return length; +} + +static ssize_t otrx_create_append_zeros(FILE *trx, size_t length) { + uint8_t *buf; + + buf = malloc(length); + if (!buf) + return -ENOMEM; + memset(buf, 0, length); + + if (fwrite(buf, 1, length, trx) != length) { + fprintf(stderr, "Couldn't write %zu B to %s\n", length, trx_path); + free(buf); + return -EIO; + } + + free(buf); + + return length; +} + +static ssize_t otrx_create_align(FILE *trx, size_t curr_offset, size_t alignment) { + if (curr_offset & (alignment - 1)) { + size_t length = alignment - (curr_offset % alignment); + return otrx_create_append_zeros(trx, length); + } + + return 0; +} + +static int otrx_create_write_hdr(FILE *trx, struct trx_header *hdr) { + size_t bytes, length; + uint8_t buf[1024]; + uint32_t crc32; + + hdr->magic = cpu_to_le32(TRX_MAGIC); + hdr->version = 1; + + fseek(trx, 0, SEEK_SET); + bytes = fwrite(hdr, 1, sizeof(struct trx_header), trx); + if (bytes != sizeof(struct trx_header)) { + fprintf(stderr, "Couldn't write TRX header to %s\n", trx_path); + return -EIO; + } + + length = le32_to_cpu(hdr->length); + + crc32 = 0xffffffff; + fseek(trx, TRX_FLAGS_OFFSET, SEEK_SET); + length -= TRX_FLAGS_OFFSET; + while ((bytes = fread(buf, 1, otrx_min(sizeof(buf), length), trx)) > 0) { + crc32 = otrx_crc32(crc32, buf, bytes); + length -= bytes; + } + hdr->crc32 = cpu_to_le32(crc32); + + fseek(trx, 0, SEEK_SET); + bytes = fwrite(hdr, 1, sizeof(struct trx_header), trx); + if (bytes != sizeof(struct trx_header)) { + fprintf(stderr, "Couldn't write TRX header to %s\n", trx_path); + return -EIO; + } + + return 0; +} + +static int otrx_create(int argc, char **argv) { + FILE *trx; + struct trx_header hdr = {}; + ssize_t sbytes; + size_t curr_idx = 0; + size_t curr_offset = sizeof(hdr); + int c; + int err = 0; + + if (argc < 3) { + fprintf(stderr, "No TRX file passed\n"); + err = -EINVAL; + goto out; + } + trx_path = argv[2]; + + trx = fopen(trx_path, "w+"); + if (!trx) { + fprintf(stderr, "Couldn't open %s\n", trx_path); + err = -EACCES; + goto out; + } + fseek(trx, curr_offset, SEEK_SET); + + optind = 3; + while ((c = getopt(argc, argv, "f:A:a:b:")) != -1) { + switch (c) { + case 'f': + if (curr_idx >= TRX_MAX_PARTS) { + err = -ENOSPC; + fprintf(stderr, "Reached TRX partitions limit, no place for %s\n", optarg); + goto err_close; + } + + sbytes = otrx_create_append_file(trx, optarg); + if (sbytes < 0) { + fprintf(stderr, "Failed to append file %s\n", optarg); + } else { + hdr.offset[curr_idx++] = curr_offset; + curr_offset += sbytes; + } + + sbytes = otrx_create_align(trx, curr_offset, 4); + if (sbytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + curr_offset += sbytes; + + break; + case 'A': + sbytes = otrx_create_append_file(trx, optarg); + if (sbytes < 0) { + fprintf(stderr, "Failed to append file %s\n", optarg); + } else { + curr_offset += sbytes; + } + + sbytes = otrx_create_align(trx, curr_offset, 4); + if (sbytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + curr_offset += sbytes; + break; + case 'a': + sbytes = otrx_create_align(trx, curr_offset, strtol(optarg, NULL, 0)); + if (sbytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + curr_offset += sbytes; + break; + case 'b': + sbytes = strtol(optarg, NULL, 0) - curr_offset; + if (sbytes < 0) { + fprintf(stderr, "Current TRX length is 0x%zx, can't pad it with zeros to 0x%lx\n", curr_offset, strtol(optarg, NULL, 0)); + } else { + sbytes = otrx_create_append_zeros(trx, sbytes); + if (sbytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + curr_offset += sbytes; + } + break; + } + if (err) + break; + } + + sbytes = otrx_create_align(trx, curr_offset, 0x1000); + if (sbytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + curr_offset += sbytes; + + hdr.length = curr_offset; + otrx_create_write_hdr(trx, &hdr); +err_close: + fclose(trx); +out: + return err; +} + +/************************************************** + * Extract + **************************************************/ + +static void otrx_extract_parse_options(int argc, char **argv) { + int c; + + while ((c = getopt(argc, argv, "c:e:o:1:2:3:")) != -1) { + switch (c) { + case 'o': + trx_offset = atoi(optarg); + break; + case '1': + partition[0] = optarg; + break; + case '2': + partition[1] = optarg; + break; + case '3': + partition[2] = optarg; + break; + } + } +} + +static int otrx_extract_copy(FILE *trx, size_t offset, size_t length, char *out_path) { + FILE *out; + size_t bytes; + uint8_t *buf; + int err = 0; + + out = fopen(out_path, "w"); + if (!out) { + fprintf(stderr, "Couldn't open %s\n", out_path); + err = -EACCES; + goto out; + } + + buf = malloc(length); + if (!buf) { + fprintf(stderr, "Couldn't alloc %zu B buffer\n", length); + err = -ENOMEM; + goto err_close; + } + + fseek(trx, offset, SEEK_SET); + bytes = fread(buf, 1, length, trx); + if (bytes != length) { + fprintf(stderr, "Couldn't read %zu B of data from %s\n", length, trx_path); + err = -ENOMEM; + goto err_free_buf; + }; + + bytes = fwrite(buf, 1, length, out); + if (bytes != length) { + fprintf(stderr, "Couldn't write %zu B to %s\n", length, out_path); + err = -ENOMEM; + goto err_free_buf; + } + + printf("Extracted 0x%zx bytes into %s\n", length, out_path); + +err_free_buf: + free(buf); +err_close: + fclose(out); +out: + return err; +} + +static int otrx_extract(int argc, char **argv) { + FILE *trx; + struct trx_header hdr; + size_t bytes; + int i; + int err = 0; + + if (argc < 3) { + fprintf(stderr, "No TRX file passed\n"); + err = -EINVAL; + goto out; + } + trx_path = argv[2]; + + optind = 3; + otrx_extract_parse_options(argc, argv); + + trx = fopen(trx_path, "r"); + if (!trx) { + fprintf(stderr, "Couldn't open %s\n", trx_path); + err = -EACCES; + goto out; + } + + fseek(trx, trx_offset, SEEK_SET); + bytes = fread(&hdr, 1, sizeof(hdr), trx); + if (bytes != sizeof(hdr)) { + fprintf(stderr, "Couldn't read %s header\n", trx_path); + err = -EIO; + goto err_close; + } + + if (le32_to_cpu(hdr.magic) != TRX_MAGIC) { + fprintf(stderr, "Invalid TRX magic: 0x%08x\n", le32_to_cpu(hdr.magic)); + err = -EINVAL; + goto err_close; + } + + for (i = 0; i < TRX_MAX_PARTS; i++) { + size_t length; + + if (!partition[i]) + continue; + if (!hdr.offset[i]) { + printf("TRX doesn't contain partition %d, can't extract %s\n", i + 1, partition[i]); + continue; + } + + if (i + 1 >= TRX_MAX_PARTS || !hdr.offset[i + 1]) + length = le32_to_cpu(hdr.length) - le32_to_cpu(hdr.offset[i]); + else + length = le32_to_cpu(hdr.offset[i + 1]) - le32_to_cpu(hdr.offset[i]); + + otrx_extract_copy(trx, trx_offset + le32_to_cpu(hdr.offset[i]), length, partition[i]); + } + +err_close: + fclose(trx); +out: + return err; +} + +/************************************************** + * Start + **************************************************/ + +static void usage() { + printf("Usage:\n"); + printf("\n"); + printf("Checking TRX file:\n"); + printf("\totrx check [options]\tcheck if file is a valid TRX\n"); + printf("\t-o offset\t\t\toffset of TRX data in file (default: 0)\n"); + printf("\n"); + printf("Creating new TRX file:\n"); + printf("\totrx create [options] [partitions]\n"); + printf("\t-f file\t\t\t\t[partition] start new partition with content copied from file\n"); + printf("\t-A file\t\t\t\t[partition] append current partition with content copied from file\n"); + printf("\t-a alignment\t\t\t[partition] align current partition\n"); + printf("\t-b offset\t\t\t[partition] append zeros to partition till reaching absolute offset\n"); + printf("\n"); + printf("Extracting from TRX file:\n"); + printf("\totrx extract [options]\textract partitions from TRX file\n"); + printf("\t-o offset\t\t\toffset of TRX data in file (default: 0)\n"); + printf("\t-1 file\t\t\t\tfile to extract 1st partition to (optional)\n"); + printf("\t-2 file\t\t\t\tfile to extract 2nd partition to (optional)\n"); + printf("\t-3 file\t\t\t\tfile to extract 3rd partition to (optional)\n"); +} + +int main(int argc, char **argv) { + if (argc > 1) { + if (!strcmp(argv[1], "check")) + return otrx_check(argc, argv); + else if (!strcmp(argv[1], "create")) + return otrx_create(argc, argv); + else if (!strcmp(argv[1], "extract")) + return otrx_extract(argc, argv); + } + + usage(); + return 0; +} diff --git a/tools/firmware-utils/src/ptgen.c b/tools/firmware-utils/src/ptgen.c index 8466d35bcc..13e0eda622 100644 --- a/tools/firmware-utils/src/ptgen.c +++ b/tools/firmware-utils/src/ptgen.c @@ -1,4 +1,4 @@ -/* +/* * ptgen - partition table generator * Copyright (C) 2006 by Felix Fietkau * @@ -9,12 +9,12 @@ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -63,25 +63,26 @@ struct partinfo parts[4]; char *filename = NULL; -/* +/* * parse the size argument, which is either * a simple number (K assumed) or * K, M or G * * returns the size in KByte */ -static long to_kbytes(const char *string) { +static long to_kbytes(const char *string) +{ int exp = 0; long result; char *end; result = strtoul(string, &end, 0); switch (tolower(*end)) { - case 'k' : - case '\0' : exp = 0; break; - case 'm' : exp = 1; break; - case 'g' : exp = 2; break; - default: return 0; + case 'k' : + case '\0' : exp = 0; break; + case 'm' : exp = 1; break; + case 'g' : exp = 2; break; + default: return 0; } if (*end) @@ -99,9 +100,10 @@ static long to_kbytes(const char *string) { } /* convert the sector number into a CHS value for the partition table */ -static void to_chs(long sect, unsigned char chs[3]) { +static void to_chs(long sect, unsigned char chs[3]) +{ int c,h,s; - + s = (sect % sectors) + 1; sect = sect / sectors; h = sect % heads; @@ -116,10 +118,11 @@ static void to_chs(long sect, unsigned char chs[3]) { } /* round the sector number up to the next cylinder */ -static inline unsigned long round_to_cyl(long sect) { +static inline unsigned long round_to_cyl(long sect) +{ int cyl_size = heads * sectors; - return sect + cyl_size - (sect % cyl_size); + return sect + cyl_size - (sect % cyl_size); } /* round the sector number up to the kb_align boundary */ @@ -131,7 +134,7 @@ static inline unsigned long round_to_kb(long sect) { static int gen_ptable(uint32_t signature, int nr) { struct pte pte[4]; - unsigned long sect = 0; + unsigned long sect = 0; int i, fd, ret = -1, start, len; memset(pte, 0, sizeof(struct pte) * 4); @@ -140,22 +143,27 @@ static int gen_ptable(uint32_t signature, int nr) fprintf(stderr, "Invalid size in partition %d!\n", i); return -1; } + pte[i].active = ((i + 1) == active) ? 0x80 : 0; pte[i].type = parts[i].type; + start = sect + sectors; if (kb_align != 0) start = round_to_kb(start); pte[i].start = cpu_to_le32(start); + sect = start + parts[i].size * 2; if (kb_align == 0) sect = round_to_cyl(sect); pte[i].length = cpu_to_le32(len = sect - start); + to_chs(start, pte[i].chs_start); to_chs(start + len - 1, pte[i].chs_end); + if (verbose) - fprintf(stderr, "Partition %d: start=%ld, end=%ld, size=%ld\n", i, (long) start * 512, ((long) start + (long) len) * 512, (long) len * 512); - printf("%ld\n", ((long) start * 512)); - printf("%ld\n", ((long) len * 512)); + fprintf(stderr, "Partition %d: start=%ld, end=%ld, size=%ld\n", i, (long)start * 512, ((long)start + (long)len) * 512, (long)len * 512); + printf("%ld\n", (long)start * 512); + printf("%ld\n", (long)len * 512); } if ((fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0644)) < 0) { @@ -179,7 +187,7 @@ static int gen_ptable(uint32_t signature, int nr) fprintf(stderr, "write failed.\n"); goto fail; } - + ret = 0; fail: close(fd); @@ -188,8 +196,8 @@ fail: static void usage(char *prog) { - fprintf(stderr, "Usage: %s [-v] -h -s -o [-a 0..4] [-l ] [[-t ] -p ...] \n", prog); - exit(1); + fprintf(stderr, "Usage: %s [-v] -h -s -o [-a 0..4] [-l ] [[-t ] -p ...] \n", prog); + exit(EXIT_FAILURE); } int main (int argc, char **argv) @@ -208,29 +216,29 @@ int main (int argc, char **argv) verbose++; break; case 'h': - heads = (int) strtoul(optarg, NULL, 0); + heads = (int)strtoul(optarg, NULL, 0); break; case 's': - sectors = (int) strtoul(optarg, NULL, 0); + sectors = (int)strtoul(optarg, NULL, 0); break; case 'p': if (part > 3) { fprintf(stderr, "Too many partitions\n"); - exit(1); + exit(EXIT_FAILURE); } parts[part].size = to_kbytes(optarg); parts[part++].type = type; break; case 't': - type = (char) strtoul(optarg, NULL, 16); + type = (char)strtoul(optarg, NULL, 16); break; case 'a': - active = (int) strtoul(optarg, NULL, 0); + active = (int)strtoul(optarg, NULL, 0); if ((active < 0) || (active > 4)) active = 0; break; case 'l': - kb_align = (int) strtoul(optarg, NULL, 0) * 2; + kb_align = (int)strtoul(optarg, NULL, 0) * 2; break; case 'S': signature = strtoul(optarg, NULL, 0); @@ -241,8 +249,8 @@ int main (int argc, char **argv) } } argc -= optind; - if (argc || (heads <= 0) || (sectors <= 0) || !filename) + if (argc || (heads <= 0) || (sectors <= 0) || !filename) usage(argv[0]); - return gen_ptable(signature, part); + return gen_ptable(signature, part) ? EXIT_FAILURE : EXIT_SUCCESS; } diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c index 219d1985ac..88e2e88bdf 100644 --- a/tools/firmware-utils/src/tplink-safeloader.c +++ b/tools/firmware-utils/src/tplink-safeloader.c @@ -365,8 +365,8 @@ static struct device_info boards[] = { {"profile", 0x11700, 0x03900}, {"default-config", 0x15000, 0x04000}, {"user-config", 0x19000, 0x04000}, - {"os-image", 0x20000, 0x150000}, - {"file-system", 0x170000, 0x678000}, + {"os-image", 0x20000, 0x180000}, + {"file-system", 0x1a0000, 0x648000}, {"certyficate", 0x7e8000, 0x08000}, {"radio", 0x7f0000, 0x10000}, {NULL, 0, 0} @@ -439,8 +439,8 @@ static struct device_info boards[] = { {"profile", 0x11700, 0x03900}, {"default-config", 0x15000, 0x04000}, {"user-config", 0x19000, 0x04000}, - {"os-image", 0x20000, 0x150000}, - {"file-system", 0x170000, 0x678000}, + {"os-image", 0x20000, 0x180000}, + {"file-system", 0x1a0000, 0x648000}, {"certyficate", 0x7e8000, 0x08000}, {"radio", 0x7f0000, 0x10000}, {NULL, 0, 0} @@ -490,7 +490,14 @@ static struct device_info boards[] = { .id = "ARCHER-C7-V4", .support_list = "SupportList:\n" + "{product_name:Archer C7,product_ver:4.0.0,special_id:00000000}\n" + "{product_name:Archer C7,product_ver:4.0.0,special_id:41550000}\n" "{product_name:Archer C7,product_ver:4.0.0,special_id:45550000}\n" + "{product_name:Archer C7,product_ver:4.0.0,special_id:4B520000}\n" + "{product_name:Archer C7,product_ver:4.0.0,special_id:42520000}\n" + "{product_name:Archer C7,product_ver:4.0.0,special_id:4A500000}\n" + "{product_name:Archer C7,product_ver:4.0.0,special_id:52550000}\n" + "{product_name:Archer C7,product_ver:4.0.0,special_id:54570000}\n" "{product_name:Archer C7,product_ver:4.0.0,special_id:55530000}\n" "{product_name:Archer C7,product_ver:4.0.0,special_id:43410000}\n", .support_trail = '\x00', @@ -676,6 +683,42 @@ static struct device_info boards[] = { .last_sysupgrade_partition = "file-system" }, + /** Firmware layout for the TL-WR1043 v5 */ + { + .id = "TLWR1043NV5", + .vendor = "", + .support_list = + "SupportList:\n" + "{product_name:TL-WR1043N,product_ver:5.0.0,special_id:45550000}\n" + "{product_name:TL-WR1043N,product_ver:5.0.0,special_id:55530000}\n", + .support_trail = '\x00', + .soft_ver = "soft_ver:1.0.0\n", + .partitions = { + {"factory-boot", 0x00000, 0x20000}, + {"fs-uboot", 0x20000, 0x20000}, + {"os-image", 0x40000, 0x180000}, + {"file-system", 0x1c0000, 0xd40000}, + {"default-mac", 0xf00000, 0x00200}, + {"pin", 0xf00200, 0x00200}, + {"device-id", 0xf00400, 0x00100}, + {"product-info", 0xf00500, 0x0fb00}, + {"soft-version", 0xf10000, 0x01000}, + {"extra-para", 0xf11000, 0x01000}, + {"support-list", 0xf12000, 0x0a000}, + {"profile", 0xf1c000, 0x04000}, + {"default-config", 0xf20000, 0x10000}, + {"user-config", 0xf30000, 0x40000}, + {"qos-db", 0xf70000, 0x40000}, + {"certificate", 0xfb0000, 0x10000}, + {"partition-table", 0xfc0000, 0x10000}, + {"log", 0xfd0000, 0x20000}, + {"radio", 0xff0000, 0x10000}, + {NULL, 0, 0} + }, + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "file-system" + }, + /** Firmware layout for the TL-WR1043 v4 */ { .id = "TLWR1043NDV4", @@ -730,8 +773,8 @@ static struct device_info boards[] = { */ .partitions = { {"fs-uboot", 0x00000, 0x20000}, - {"os-image", 0x20000, 0x160000}, - {"file-system", 0x180000, 0x5d0000}, + {"os-image", 0x20000, 0x180000}, + {"file-system", 0x1a0000, 0x5b0000}, {"default-mac", 0x750000, 0x00200}, {"pin", 0x750200, 0x00200}, {"product-info", 0x750400, 0x0fc00}, @@ -763,8 +806,8 @@ static struct device_info boards[] = { .partitions = { {"fs-uboot", 0x00000, 0x20000}, - {"os-image", 0x20000, 0x150000}, - {"file-system", 0x170000, 0xcd0000}, + {"os-image", 0x20000, 0x180000}, + {"file-system", 0x1a0000, 0xca0000}, {"default-mac", 0xe40000, 0x00200}, {"pin", 0xe40200, 0x00200}, {"product-info", 0xe40400, 0x0fc00}, @@ -852,8 +895,8 @@ static struct device_info boards[] = { */ .partitions = { {"fs-uboot", 0x00000, 0x20000}, - {"os-image", 0x20000, 0x150000}, - {"file-system", 0x170000, 0x4a0000}, + {"os-image", 0x20000, 0x180000}, + {"file-system", 0x1a0000, 0x460000}, {"partition-table", 0x600000, 0x02000}, {"default-mac", 0x610000, 0x00020}, {"pin", 0x610100, 0x00020}, @@ -1254,7 +1297,9 @@ static void build_image(const char *output, parts[3] = read_file("os-image", kernel_image, false); parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof); - if (strcasecmp(info->id, "ARCHER-C25-V1") == 0) { + /* Some devices need the extra-para partition to accept the firmware */ + if (strcasecmp(info->id, "ARCHER-C25-V1") == 0 || + strcasecmp(info->id, "TLWR1043NV5") == 0) { const char mdat[11] = {0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00}; parts[5] = put_data("extra-para", mdat, 11); } else if (strcasecmp(info->id, "ARCHER-C7-V4") == 0) { diff --git a/tools/flex/Makefile b/tools/flex/Makefile index 1398b1ae51..1eff81f345 100644 --- a/tools/flex/Makefile +++ b/tools/flex/Makefile @@ -7,6 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=flex +PKG_CPE_ID:=cpe:/a:flex_project:flex PKG_VERSION:=2.6.4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz diff --git a/tools/flex/patches/200-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch b/tools/flex/patches/200-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch new file mode 100644 index 0000000000..7c3645c474 --- /dev/null +++ b/tools/flex/patches/200-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch @@ -0,0 +1,27 @@ +From 24fd0551333e7eded87b64dd36062da3df2f6380 Mon Sep 17 00:00:00 2001 +From: Explorer09 +Date: Mon, 4 Sep 2017 10:47:33 +0800 +Subject: [PATCH] build: AC_USE_SYSTEM_EXTENSIONS in configure.ac. + +This would, e.g. define _GNU_SOURCE in config.h, enabling the +reallocarray() prototype in glibc 2.26+ on Linux systems with that +version of glibc. + +Fixes #241. +--- + configure.ac | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/configure.ac ++++ b/configure.ac +@@ -25,8 +25,10 @@ + # autoconf requirements and initialization + + AC_INIT([the fast lexical analyser generator],[2.6.4],[flex-help@lists.sourceforge.net],[flex]) ++AC_PREREQ([2.60]) + AC_CONFIG_SRCDIR([src/scan.l]) + AC_CONFIG_AUX_DIR([build-aux]) ++AC_USE_SYSTEM_EXTENSIONS + LT_INIT + AM_INIT_AUTOMAKE([1.11.3 -Wno-portability foreign check-news std-options dist-lzip parallel-tests subdir-objects]) + AC_CONFIG_HEADER([src/config.h]) diff --git a/tools/gptfdisk/Makefile b/tools/gptfdisk/Makefile deleted file mode 100644 index dc5a5eb0d6..0000000000 --- a/tools/gptfdisk/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=gptfdisk -PKG_VERSION:=1.0.1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://www.rodsbooks.com/gdisk/ -PKG_HASH:=864c8aee2efdda50346804d7e6230407d5f42a8ae754df70404dd8b2fdfaeac7 - -HOST_BUILD_PARALLEL := 1 - -include $(INCLUDE_DIR)/host-build.mk - -HOST_CONFIGURE_VARS += \ - MAKEFLAGS="$(HOST_JOBS)" \ - CXXFLAGS="$(HOST_CFLAGS)" - -HOST_CONFIGURE_ARGS := \ - $(if $(MAKE_JOBSERVER),--parallel="$(MAKE_JOBSERVER)") \ - --prefix=$(STAGING_DIR_HOST) - -define Host/Compile - $(MAKE) LDFLAGS="$(HOST_LDFLAGS)" CXXFLAGS="$(HOST_CFLAGS) -I$(STAGING_DIR_HOST)/include/e2fsprogs" -C $(HOST_BUILD_DIR) sgdisk -endef - -define Host/Install - $(INSTALL_BIN) $(HOST_BUILD_DIR)/sgdisk $(STAGING_DIR_HOST)/bin/ -endef - -define Host/Clean - rm -f $(STAGING_DIR_HOST)/bin/sgdisk -endef - -HOSTCC := $(HOSTCC_NOCACHE) -HOSTCXX := $(HOSTCXX_NOCACHE) - -$(eval $(call HostBuild)) diff --git a/tools/libtool/Makefile b/tools/libtool/Makefile index 6526b28b1d..dd4a7f6380 100644 --- a/tools/libtool/Makefile +++ b/tools/libtool/Makefile @@ -7,6 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libtool +PKG_CPE_ID:=cpe:/a:gnu:libtool PKG_VERSION:=2.4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz diff --git a/tools/m4/Makefile b/tools/m4/Makefile index aa3c382f5b..a6d931b0fd 100644 --- a/tools/m4/Makefile +++ b/tools/m4/Makefile @@ -7,6 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=m4 +PKG_CPE_ID:=cpe:/a:gnu:m4 PKG_VERSION:=1.4.18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz diff --git a/tools/mm-macros/Makefile b/tools/mm-macros/Makefile index a8a7bc137f..d8f4a520b2 100644 --- a/tools/mm-macros/Makefile +++ b/tools/mm-macros/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mm-macros -PKG_VERSION:=0.9.10 +PKG_VERSION:=0.9.11 PKG_SOURCE_URL:=@GNOME/mm-common/0.9 PKG_SOURCE:=mm-common-$(PKG_VERSION).tar.xz -PKG_HASH:=16c0e2bc196b67fbc145edaecb5dbe5818386504fe5703de27002d77140fa217 +PKG_HASH:=20d1e7466ca4c83c92e29f9e8dfcc8e5721fdf1337f53157bed97be3b73b32a8 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/mm-common-$(PKG_VERSION) diff --git a/tools/mpfr/Makefile b/tools/mpfr/Makefile index 91b5986f6c..f3e337ada2 100644 --- a/tools/mpfr/Makefile +++ b/tools/mpfr/Makefile @@ -7,12 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mpfr -PKG_VERSION:=3.1.5 +PKG_VERSION:=3.1.6 +PKG_CPE_ID:=cpe:/a:mpfr:gnu_mpfr PKG_SOURCE_URL:=http://www.mpfr.org/mpfr-$(PKG_VERSION) \ @GNU/mpfr PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_HASH:=015fde82b3979fbe5f83501986d328331ba8ddf008c1ff3da3c238f49ca062bc +PKG_HASH:=7a62ac1a04408614fccdc506e4844b10cf0ad2c2b1677097f8f35d3a1344a950 HOST_BUILD_PARALLEL:=1 HOST_FIXUP:=autoreconf diff --git a/tools/mtd-utils/patches/120-include_sysmacros.patch b/tools/mtd-utils/patches/120-include_sysmacros.patch new file mode 100644 index 0000000000..81ba1cfb2b --- /dev/null +++ b/tools/mtd-utils/patches/120-include_sysmacros.patch @@ -0,0 +1,25 @@ +From 9a06f45ec71116d76ee4b268ebe1b33d45b06fc0 Mon Sep 17 00:00:00 2001 +From: Mike Frysinger +Date: Sat, 16 Apr 2016 22:10:43 -0400 +Subject: [PATCH mtd-utils] include sys/sysmacros.h for major/minor/makedev + +These functions have always been defined in sys/sysmacros.h under +Linux C libraries. For some, including sys/types.h implicitly +includes that as well, but glibc wants to deprecate that, and some +others already have. Include the header explicitly for the funcs. + +Signed-off-by: Mike Frysinger +--- + include/common.h | 1 + + 1 file changed, 1 insertion(+) + +--- a/include/common.h ++++ b/include/common.h +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include "version.h" + + #ifndef PROGRAM_NAME diff --git a/tools/mtd-utils/patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch b/tools/mtd-utils/patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch index 46014e7a32..70e6a7e360 100644 --- a/tools/mtd-utils/patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch +++ b/tools/mtd-utils/patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch @@ -1,7 +1,5 @@ -Index: mtd-utils-1.5.2/mkfs.jffs2.c -=================================================================== ---- mtd-utils-1.5.2.orig/mkfs.jffs2.c -+++ mtd-utils-1.5.2/mkfs.jffs2.c +--- a/mkfs.jffs2.c ++++ b/mkfs.jffs2.c @@ -108,7 +108,7 @@ static char *rootdir = default_rootdir; static int verbose = 0; static int squash_uids = 0; diff --git a/tools/popt/Makefile b/tools/popt/Makefile deleted file mode 100644 index 7d1a1f8ef3..0000000000 --- a/tools/popt/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=popt -PKG_VERSION:=1.16 -PKG_HASH:=e728ed296fe9f069a0e005003c3d6b2dde3d9cad453422a10d6558616d304cc8 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://rpm5.org/files/popt/ -PKG_LICENSE:=MIT - -HOST_BUILD_PARALLEL:=1 - -include $(INCLUDE_DIR)/host-build.mk - -HOST_CONFIGURE_ARGS += --disable-shared --disable-nls -HOST_CFLAGS += $(FPIC) - -$(eval $(call HostBuild)) - diff --git a/tools/qemu/Makefile b/tools/qemu/Makefile index 3eac66f01e..d63ab3482e 100644 --- a/tools/qemu/Makefile +++ b/tools/qemu/Makefile @@ -7,6 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=qemu +PKG_CPE_ID:=cpe:/a:qemu:qemu PKG_VERSION:=0.14.1 PKG_RELEASE:=1 diff --git a/tools/squashfs/Makefile b/tools/squashfs/Makefile index 87f6e8fd99..385cf69d9d 100644 --- a/tools/squashfs/Makefile +++ b/tools/squashfs/Makefile @@ -7,6 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=squashfs +PKG_CPE_ID:=cpe:/a:phillip_lougher:squashfs PKG_VERSION:=3.0 PKG_SOURCE:=$(PKG_NAME)$(PKG_VERSION).tar.gz diff --git a/tools/squashfs/patches/130-include_sysmacros.patch b/tools/squashfs/patches/130-include_sysmacros.patch new file mode 100644 index 0000000000..f0149d6f65 --- /dev/null +++ b/tools/squashfs/patches/130-include_sysmacros.patch @@ -0,0 +1,20 @@ +--- a/squashfs-tools/mksquashfs.c ++++ b/squashfs-tools/mksquashfs.c +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + #include + #include + #include +--- a/squashfs-tools/unsquashfs.c ++++ b/squashfs-tools/unsquashfs.c +@@ -25,6 +25,7 @@ + #define FALSE 0 + #include + #include ++#include + #include + #include + #include diff --git a/tools/squashfs4/Makefile b/tools/squashfs4/Makefile index e2c9fc91cc..e9e2b7ca9a 100644 --- a/tools/squashfs4/Makefile +++ b/tools/squashfs4/Makefile @@ -7,6 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=squashfs4 +PKG_CPE_ID:=cpe:/a:phillip_lougher:squashfs PKG_VERSION:=4.2 PKG_SOURCE:=squashfs$(PKG_VERSION).tar.gz diff --git a/tools/squashfs4/patches/130-include_sysmacros.patch b/tools/squashfs4/patches/130-include_sysmacros.patch new file mode 100644 index 0000000000..e8845130ef --- /dev/null +++ b/tools/squashfs4/patches/130-include_sysmacros.patch @@ -0,0 +1,20 @@ +--- a/squashfs-tools/mksquashfs.c ++++ b/squashfs-tools/mksquashfs.c +@@ -33,6 +33,7 @@ + #include + #include + #include ++#include + #include + #include + #include +--- a/squashfs-tools/unsquashfs.c ++++ b/squashfs-tools/unsquashfs.c +@@ -30,6 +30,7 @@ + #include "xattr.h" + + #include ++#include + + struct cache *fragment_cache, *data_cache; + struct queue *to_reader, *to_deflate, *to_writer, *from_writer; diff --git a/tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch b/tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch index ad69b190ea..bc7d6c7a4a 100644 --- a/tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch +++ b/tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch @@ -16,7 +16,7 @@ #define SQUASHFS_METADATA_LOG 13 --- a/squashfs-tools/unsquashfs.c +++ b/squashfs-tools/unsquashfs.c -@@ -1463,10 +1463,12 @@ int read_super(char *source) +@@ -1464,10 +1464,12 @@ int read_super(char *source) */ read_fs_bytes(fd, SQUASHFS_START, sizeof(struct squashfs_super_block), &sBlk_4); @@ -31,7 +31,7 @@ sBlk_4.s_minor == 0) { s_ops.squashfs_opendir = squashfs_opendir_4; s_ops.read_fragment = read_fragment_4; -@@ -1479,7 +1481,11 @@ int read_super(char *source) +@@ -1480,7 +1482,11 @@ int read_super(char *source) /* * Check the compression type */ @@ -44,7 +44,7 @@ return TRUE; } -@@ -1494,8 +1500,10 @@ int read_super(char *source) +@@ -1495,8 +1501,10 @@ int read_super(char *source) * Check it is a SQUASHFS superblock */ swap = 0; @@ -57,7 +57,7 @@ squashfs_super_block_3 sblk; ERROR("Reading a different endian SQUASHFS filesystem " "on %s\n", source); -@@ -1573,7 +1581,11 @@ int read_super(char *source) +@@ -1574,7 +1582,11 @@ int read_super(char *source) /* * 1.x, 2.x and 3.x filesystems use gzip compression. */ diff --git a/tools/squashfs4/patches/180-openbsd_compat.patch b/tools/squashfs4/patches/180-openbsd_compat.patch index b9c1b5925d..4f7afd89cc 100644 --- a/tools/squashfs4/patches/180-openbsd_compat.patch +++ b/tools/squashfs4/patches/180-openbsd_compat.patch @@ -8,8 +8,8 @@ +#include +#endif #include + #include #include - #include --- a/squashfs-tools/unsquashfs.h +++ b/squashfs-tools/unsquashfs.h @@ -25,6 +25,9 @@ diff --git a/tools/squashfs4/patches/190-no_nonstatic_inline.patch b/tools/squashfs4/patches/190-no_nonstatic_inline.patch index 27ebc6a263..8cab120832 100644 --- a/tools/squashfs4/patches/190-no_nonstatic_inline.patch +++ b/tools/squashfs4/patches/190-no_nonstatic_inline.patch @@ -1,6 +1,6 @@ --- a/squashfs-tools/mksquashfs.c +++ b/squashfs-tools/mksquashfs.c -@@ -735,13 +735,13 @@ void cache_block_put(struct file_buffer +@@ -736,13 +736,13 @@ void cache_block_put(struct file_buffer + (((char *)A) - data_cache))) @@ -16,7 +16,7 @@ { pthread_mutex_lock(&progress_mutex); pthread_cond_signal(&progress_wait); -@@ -749,7 +749,7 @@ inline void update_progress_bar() +@@ -750,7 +750,7 @@ inline void update_progress_bar() } @@ -25,7 +25,7 @@ { TRACE("Waiting for thread %d\n", i); while(thread[i] != 0) -@@ -3358,7 +3358,7 @@ struct inode_info *lookup_inode(struct s +@@ -3359,7 +3359,7 @@ struct inode_info *lookup_inode(struct s } diff --git a/tools/squashfs4/patches/200-add-fixed-timestamp-option.patch b/tools/squashfs4/patches/200-add-fixed-timestamp-option.patch index 5cec51f7b7..7411b97844 100644 --- a/tools/squashfs4/patches/200-add-fixed-timestamp-option.patch +++ b/tools/squashfs4/patches/200-add-fixed-timestamp-option.patch @@ -1,6 +1,6 @@ --- a/squashfs-tools/mksquashfs.c +++ b/squashfs-tools/mksquashfs.c -@@ -175,6 +175,9 @@ unsigned int cache_bytes = 0, cache_size +@@ -176,6 +176,9 @@ unsigned int cache_bytes = 0, cache_size /* inode lookup table */ squashfs_inode *inode_lookup_table = NULL; @@ -10,7 +10,7 @@ /* in memory directory data */ #define I_COUNT_SIZE 128 #define DIR_ENTRIES 32 -@@ -2452,6 +2455,8 @@ again: +@@ -2453,6 +2456,8 @@ again: restat: fstat(file, &buf2); close(file); @@ -19,7 +19,7 @@ if(read_size != buf2.st_size) { memcpy(buf, &buf2, sizeof(struct stat)); file_buffer->error = 2; -@@ -3612,7 +3617,7 @@ void dir_scan(squashfs_inode *inode, cha +@@ -3613,7 +3618,7 @@ void dir_scan(squashfs_inode *inode, cha buf.st_mode = S_IRWXU | S_IRWXG | S_IRWXO | S_IFDIR; buf.st_uid = getuid(); buf.st_gid = getgid(); @@ -28,7 +28,7 @@ buf.st_dev = 0; buf.st_ino = 0; dir_ent->inode = lookup_inode(&buf); -@@ -3623,6 +3628,8 @@ void dir_scan(squashfs_inode *inode, cha +@@ -3624,6 +3629,8 @@ void dir_scan(squashfs_inode *inode, cha pathname, strerror(errno)); return; } @@ -37,7 +37,7 @@ dir_ent->inode = lookup_inode(&buf); } -@@ -3677,6 +3684,8 @@ struct dir_info *dir_scan1(char *pathnam +@@ -3678,6 +3685,8 @@ struct dir_info *dir_scan1(char *pathnam filename, strerror(errno)); continue; } @@ -46,7 +46,7 @@ if((buf.st_mode & S_IFMT) != S_IFREG && (buf.st_mode & S_IFMT) != S_IFDIR && -@@ -3795,7 +3804,7 @@ struct dir_info *dir_scan2(struct dir_in +@@ -3796,7 +3805,7 @@ struct dir_info *dir_scan2(struct dir_in buf.st_gid = pseudo_ent->dev->gid; buf.st_rdev = makedev(pseudo_ent->dev->major, pseudo_ent->dev->minor); @@ -55,7 +55,7 @@ buf.st_ino = pseudo_ino ++; if(pseudo_ent->dev->type == 'f') { -@@ -4674,6 +4683,15 @@ int main(int argc, char *argv[]) +@@ -4675,6 +4684,15 @@ int main(int argc, char *argv[]) progress = FALSE; else if(strcmp(argv[i], "-no-exports") == 0) exportable = FALSE; @@ -71,7 +71,7 @@ else if(strcmp(argv[i], "-processors") == 0) { if((++i == argc) || (processors = strtol(argv[i], &b, 10), *b != '\0')) { -@@ -5314,7 +5332,7 @@ printOptions: +@@ -5315,7 +5333,7 @@ printOptions: sBlk.flags = SQUASHFS_MKFLAGS(noI, noD, noF, noX, no_fragments, always_use_fragments, duplicate_checking, exportable, no_xattrs, comp_opts); diff --git a/tools/sstrip/src/sstrip.c b/tools/sstrip/src/sstrip.c index 0508aaac81..12cf12e095 100644 --- a/tools/sstrip/src/sstrip.c +++ b/tools/sstrip/src/sstrip.c @@ -59,6 +59,7 @@ #include #include #include +#include #ifndef TRUE #define TRUE 1 @@ -103,7 +104,7 @@ static int do_reverse_endian; } else if (sizeof(X) == 8) { \ __res = bswap_64((X)); \ } else { \ - fprintf(stderr, "%s: %s: EGET failed for size %d\n", \ + fprintf(stderr, "%s: %s: EGET failed for size %zu\n", \ progname, filename, sizeof(X)); \ exit(EXIT_FAILURE); \ } \ @@ -124,7 +125,7 @@ static int do_reverse_endian; } else if (sizeof(Y) == 8) { \ Y = bswap_64((uint64_t)(X)); \ } else { \ - fprintf(stderr, "%s: %s: ESET failed for size %d\n", \ + fprintf(stderr, "%s: %s: ESET failed for size %zu\n", \ progname, filename, sizeof(Y)); \ exit(EXIT_FAILURE); \ } while (0) @@ -197,7 +198,7 @@ static int getmemorysize ## CLASS (Elf ## CLASS ## _Ehdr const *ehdr, \ { \ Elf ## CLASS ## _Phdr const *phdr; \ unsigned long size, n; \ - int i; \ + size_t i; \ \ /* Start by setting the size to include the ELF header and the \ * complete program segment header table. \ @@ -230,7 +231,7 @@ static int modifyheaders ## CLASS (Elf ## CLASS ## _Ehdr *ehdr, \ unsigned long newsize) \ { \ Elf ## CLASS ## _Phdr *phdr; \ - int i; \ + size_t i; \ \ /* If the section header table is gone, then remove all references \ * to it in the ELF header. \ diff --git a/tools/tar/Makefile b/tools/tar/Makefile index 5cb695f8bd..10a4a89780 100644 --- a/tools/tar/Makefile +++ b/tools/tar/Makefile @@ -7,6 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tar +PKG_CPE_ID:=cpe:/a:gnu:tar PKG_VERSION:=1.29 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2