diff --git a/config/Config-kernel.in b/config/Config-kernel.in index 078755df6..fa06b5044 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. @@ -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/feeds.conf.default b/feeds.conf.default index b1df8e257..040dbdc55 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,5 +1,5 @@ src-git packages https://git.lede-project.org/feed/packages.git -src-git luci https://git.lede-project.org/project/luci.git;lede-17.01 +src-git luci https://git.lede-project.org/project/luci.git src-git routing https://git.lede-project.org/feed/routing.git src-git telephony https://git.lede-project.org/feed/telephony.git #src-git video https://github.com/openwrt/video.git diff --git a/include/autotools.mk b/include/autotools.mk index 7bd400ab3..aa044aa0b 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 0a2564173..2ba8a7bdf 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)) diff --git a/include/image-commands.mk b/include/image-commands.mk index 5f0ac6164..bcc1256df 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -229,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)) \ diff --git a/include/image.mk b/include/image.mk index 605cb0667..af01951b4 100644 --- a/include/image.mk +++ b/include/image.mk @@ -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)) diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk index f0618633b..33f3a8210 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/nls.mk b/include/nls.mk index 51463b9f1..04838821b 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-dumpinfo.mk b/include/package-dumpinfo.mk index 1be7d958d..8a42be5bd 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,10 +30,7 @@ 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) @@ -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/package/Makefile b/package/Makefile index cc1e9d4b6..0aefbb802 100644 --- a/package/Makefile +++ b/package/Makefile @@ -10,8 +10,8 @@ curdir:=package include $(INCLUDE_DIR)/rootfs.mk -include $(TMP_DIR)/.packagedeps +$(curdir)/autoremove:=1 $(curdir)/builddirs:=$(sort $(package-) $(package-y) $(package-m)) -$(curdir)/builddirs-install:=. $(curdir)/builddirs-default:=. $(sort $(package-y) $(package-m)) $(curdir)/builddirs-prereq:=. $(sort $(prereq-y) $(prereq-m)) ifdef CHECK_ALL @@ -56,10 +56,14 @@ $(curdir)/merge: $(curdir)/merge-index: $(curdir)/merge (cd $(PACKAGE_DIR_ALL) && $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages; ) -$(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/compile $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index) +ifndef SDK + $(curdir)/compile: $(curdir)/system/opkg/host/compile +endif + +$(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index) - find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755 rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG) - [ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp + mkdir -p $(TARGET_DIR)/tmp $(call opkg,$(TARGET_DIR)) install \ $(call opkg_package_files,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null)) @for file in $(PACKAGE_INSTALL_FILES); do \ @@ -68,7 +72,6 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/compile $(curdir $(call opkg,$(TARGET_DIR)) flag $$flag `cat $$file`; \ done; \ done || true - @-$(MAKE) package/preconfig $(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG) @@ -92,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 a7cc4ca48..005547416 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=base-files -PKG_RELEASE:=181 +PKG_RELEASE:=183 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index bbed567de..fa148685c 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 diff --git a/package/base-files/files/etc/init.d/gpio_switch b/package/base-files/files/etc/init.d/gpio_switch index 1f1b44b21..b67950a99 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/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh index 82ac1d2a4..3126fe651 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/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index 3fd612c37..c747c4eaa 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/ diff --git a/package/boot/apex/Makefile b/package/boot/apex/Makefile index fb3c77c37..d90df8e58 100644 --- a/package/boot/apex/Makefile +++ b/package/boot/apex/Makefile @@ -56,7 +56,8 @@ define Package/apex/install endef define Build/InstallDev - $(CP) $(PKG_BUILD_DIR)/out/*.bin $(KERNEL_BUILD_DIR) + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/out/*.bin $(STAGING_DIR_IMAGE)/ endef $(eval $(call BuildPackage,apex)) diff --git a/package/boot/arm-trusted-firmware-sunxi/Makefile b/package/boot/arm-trusted-firmware-sunxi/Makefile new file mode 100644 index 000000000..88d4f6efa --- /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 000000000..e704c357d --- /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 000000000..dda5fa4e9 --- /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/Makefile b/package/boot/grub2/Makefile index b9e79e102..8cfc0dcff 100644 --- a/package/boot/grub2/Makefile +++ b/package/boot/grub2/Makefile @@ -9,6 +9,7 @@ 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 diff --git a/package/boot/kexec-tools/Config.in b/package/boot/kexec-tools/Config.in index 03bc6ee80..068c27e41 100644 --- a/package/boot/kexec-tools/Config.in +++ b/package/boot/kexec-tools/Config.in @@ -1,12 +1,5 @@ menu "Configuration" - depends on PACKAGE_kexec-tools - -config KEXEC_TOOLS_kdump - bool - prompt "kdump support" - default n - help - Include the kdump utility. + depends on PACKAGE_kexec config KEXEC_ZLIB bool diff --git a/package/boot/kexec-tools/Makefile b/package/boot/kexec-tools/Makefile index ecd2a6ea1..1c686a254 100644 --- a/package/boot/kexec-tools/Makefile +++ b/package/boot/kexec-tools/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=kexec-tools -PKG_VERSION:=2.0.14-rc1 +PKG_VERSION:=2.0.14 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec -PKG_HASH:=3fc505ff8d8a2d24c68aac5e6b4783997d5a086966ff3de8b05a0ceb27e5e23b +PKG_HASH:=ffb2e7e99d9d08754c6bc1922aed3c000094f318665d82a72ecc76c4ff1c0dc6 PKG_FIXUP:=autoreconf @@ -21,22 +21,49 @@ PKG_CONFIG_DEPENDS := CONFIG_KEXEC_ZLIB CONFIG_KEXEC_LZMA include $(INCLUDE_DIR)/package.mk -define Package/kexec-tools +define Package/kexec-tools/Default SECTION:=utils CATEGORY:=Utilities - DEPENDS:=@armeb||@arm||@i386||@x86_64||@powerpc64||@mipsel||@mips +KEXEC_ZLIB:zlib +KEXEC_LZMA:liblzma - TITLE:=Kernel boots kernel URL:=http://kernel.org/pub/linux/kernel/people/horms/kexec-tools/ MAINTAINER:=Florian Fainelli - MENU:=1 +endef + +define Package/kexec-tools + $(call Package/kexec-tools/Default) + TITLE:=kexec-tools transition meta package + DEPENDS:=+kexec endef define Package/kexec-tools/description - kexec is a set of systems call that allows you to load + kexec is a set of system calls that allows you to load another kernel from the currently executing Linux kernel. + The kexec utility allows to load and boot another kernel. endef -define Package/kexec-tools/config +define Package/kexec + $(call Package/kexec-tools/Default) + TITLE:=Kernel boots kernel + DEPENDS:=\ + @armeb||@arm||@i386||@x86_64||@powerpc64||@mipsel||@mips \ + +KEXEC_ZLIB:zlib +KEXEC_LZMA:liblzma @KERNEL_KEXEC +endef + +define Package/kexec/description + The kexec utility allows to load and boot another kernel. +endef + +define Package/kdump + $(call Package/kexec-tools/Default) + TITLE:=Kernel crash analysis + DEPENDS:=+kexec @i386||@x86_64||@arm @KERNEL_CRASH_DUMP +endef + +define Package/kdump/description + The kdump package allows to automatically boot into a + special kernel for analyzing kernel crashes using kdump. +endef + +define Package/kexec/config source "$(SOURCE)/Config.in" endef @@ -65,24 +92,45 @@ CONFIGURE_VARS += \ BUILD_CC="$(HOSTCC)" \ TARGET_CC="$(TARGET_CC)" -kexec-extra-sbin-$(CONFIG_KEXEC_TOOLS_kdump) += kdump - define Build/Compile $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install endef define Package/kexec-tools/install + : +endef + +define Package/kexec/install $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) \ - $(addprefix $(PKG_INSTALL_DIR)/usr/sbin/, \ - $(kexec-extra-sbin-y)) \ - $(kexec-extra-bin-y) \ - $(PKG_INSTALL_DIR)/usr/sbin/kexec \ - $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kexec $(1)/usr/sbin # make a link for compatability with other distros $(INSTALL_DIR) $(1)/sbin $(LN) ../usr/sbin/kexec $(1)/sbin/kexec endef +define Package/kdump/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config $(1)/etc/uci-defaults + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kdump $(PKG_INSTALL_DIR)/usr/sbin/vmcore-dmesg $(1)/usr/sbin + $(INSTALL_BIN) ./files/kdump.init $(1)/etc/init.d/kdump + $(INSTALL_BIN) ./files/kdump.defaults $(1)/etc/uci-defaults/kdump + $(INSTALL_CONF) ./files/kdump.config $(1)/etc/config/kdump +endef + +define Package/kdump/prerm +#!/bin/sh + +case $$(uname -m) in + i?86|x86_64) + if grep -q " crashkernel=" /boot/grub/grub.cfg; then + mount /boot -o remount,rw + sed -i 's/ crashkernel=[^ ]*//' /boot/grub/grub.cfg + mount /boot -o remount,ro + fi + ;; +esac +endef + $(eval $(call BuildPackage,kexec-tools)) +$(eval $(call BuildPackage,kexec)) +$(eval $(call BuildPackage,kdump)) diff --git a/package/boot/kexec-tools/files/kdump.config b/package/boot/kexec-tools/files/kdump.config new file mode 100644 index 000000000..dc6054ffd --- /dev/null +++ b/package/boot/kexec-tools/files/kdump.config @@ -0,0 +1,7 @@ + +config kdump + option enabled '1' + option save_dmesg '1' + option save_vmcore '0' +# using an external partition to store vmcore is highly recommended! +# option path '/mnt/crashdump' diff --git a/package/boot/kexec-tools/files/kdump.defaults b/package/boot/kexec-tools/files/kdump.defaults new file mode 100644 index 000000000..2f15e757b --- /dev/null +++ b/package/boot/kexec-tools/files/kdump.defaults @@ -0,0 +1,11 @@ +#!/bin/sh + +case $(uname -m) in + i?86|x86_64) + if ! grep -q crashkernel /boot/grub/grub.cfg; then + mount /boot -o remount,rw + sed -i 's/linux.*/& crashkernel=32M@32M/' /boot/grub/grub.cfg + mount /boot -o remount,ro + fi + ;; +esac diff --git a/package/boot/kexec-tools/files/kdump.init b/package/boot/kexec-tools/files/kdump.init new file mode 100755 index 000000000..057b8cc17 --- /dev/null +++ b/package/boot/kexec-tools/files/kdump.init @@ -0,0 +1,182 @@ +#!/bin/sh /etc/rc.common + +START=41 +STOP=98 + +EXTRA_COMMANDS="status" +EXTRA_HELP=" status Print crashkernel status" + +verify_kdump() { + local cfg="$1" + local enabled + local path + local save_vmcore + local save_dmesg + + config_get_bool enabled "$cfg" enabled 1 + config_get_bool save_dmesg "$cfg" save_dmesg 1 + config_get_bool save_vmcore "$cfg" save_vmcore 0 + + [ "$enabled" -gt 0 ] || return 2 + + [ "$save_dmesg" -gt 0 ] || [ "$save_vmcore" -gt 0 ] || return 2 + + config_get path "$cfg" path "/" + + [ -d "$path" ] || mkdir -p "$path" 2>/dev/null || return 1 +} + +run_kdump() { + local cfg="$1" + local enabled + local path + local save_vmcore + local save_dmesg + + config_get_bool enabled "$cfg" enabled 1 + [ "$enabled" -gt 0 ] || return + + config_get_bool save_dmesg "$cfg" save_dmesg 1 + config_get_bool save_vmcore "$cfg" save_vmcore 0 + config_get path "$cfg" path "/" + + timestamp=$(date "+%Y%m%dT%H%M%S") + + if [ "$save_vmcore" -eq 1 ]; then + # would like 'sparse' but busybox doesn't support it + dd if=/proc/vmcore of="$path/vmcore-$timestamp" conv=fsync bs=1M + fi + + if [ "$save_dmesg" -eq 1 ]; then + vmcore-dmesg /proc/vmcore > "$path/dmesg-$timestamp" + fi + + sync + reboot -f +} + +find_kernel() { + . /lib/functions.sh + local kernel + + kernel="$BOOT_IMAGE" + if [ -r "$kernel" ]; then + echo $kernel + return 0 + fi + + kernel="$(find_mtd_part kernel)" + if [ -r "$kernel" ]; then + echo $kernel + return 0 + fi + + for voldir in /sys/class/ubi/ubi*_*; do + [ ! -e "$voldir" ] && continue + if [ "$(cat "${voldir}/name")" = "kernel" ]; then + kernel="/dev/$(basename "$voldir")" + echo $kernel + return 0 + fi + done + + return 1 +} + +load_crashkernel() { + local append_cmdline + local kernel + + kernel="$(find_kernel)" + [ $? -gt 0 ] && return 1 + + case "$(uname -m)" in + i?86|x86_64) + grep -q "crashkernel=" /proc/cmdline || return 1 + append_cmdline="1 irqpoll reset_devices maxcpus=1" + ;; + arm*) + append_cmdline="1 maxcpus=1 reset_devices" + ;; + esac + kexec -p "$kernel" --reuse-cmdline --append="$append_cmdline" + return $? +} + +start() { + local retval + + if [ ! -e /sys/kernel/kexec_crash_loaded ]; then + return 1 + fi + + if [ -e /proc/vmcore ]; then + config_load kdump + config_foreach run_kdump kdump + else + config_load kdump + config_foreach verify_kdump kdump + retval=$? + [ $retval = 1 ] && return 1 + [ $retval = 0 ] && load_crashkernel + return $? + fi +} + +stop() { + [ "$(cat /sys/kernel/kexec_crash_loaded)" = "1" ] || return + + if [ -e "$BOOT_IMAGE" ]; then + kexec -p -u "$BOOT_IMAGE" + fi +} + +status() { + local retval kernel + + if [ ! -e /sys/kernel/kexec_crash_loaded ]; then + echo "crashdump not supported by kernel" + return + fi + + if [ $(cat /sys/kernel/kexec_crash_size) -eq 0 ]; then + echo "memory for crashdump kernel not reserved!" + echo "check crashkernel= kernel cmdline parameter" + echo "(a reboot is required after installing kdump)" + return + fi + + kernel="$(find_kernel)" + if [ $? -gt 0 ]; then + echo "cannot find kernel image" + return + else + echo "using kernel image $kernel" + fi + + echo -n "kdump configuration is " + config_load kdump + retval=$? + if [ $retval = 0 ]; then + if [ "$(config_foreach echo kdump)" ]; then + config_foreach verify_kdump kdump + retval=$? + else + retval=1 + fi + fi + + if [ $retval = 0 ]; then + echo "valid" + elif [ $retval = 2 ]; then + echo "disabled" + else + echo "BROKEN" + fi + + echo -n "kexec crash kernel " + if [ "$(cat /sys/kernel/kexec_crash_loaded)" = "0" ]; then + echo -n "not " + fi + echo "loaded" +} diff --git a/package/boot/kobs-ng/patches/001-compile.patch b/package/boot/kobs-ng/patches/001-compile.patch index 67da93a32..8648dc8b9 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 412f7ab11..9d9b97524 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 b7cf79ffa..2acbfbd8c 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 */ @@ -101,6 +108,10 @@ static const struct rbcfg_value rbcfg_boot_device[] = { RB_BOOT_DEVICE_ETHONCE), CFG_U32("nand", "boot from NAND only", RB_BOOT_DEVICE_NANDONLY), + CFG_U32("flash", "boot in flash configuration mode", + RB_BOOT_DEVICE_FLASHCFG), + CFG_U32("flashnand", "boot in flash configuration mode once, then NAND", + RB_BOOT_DEVICE_FLSHONCE), }; static const struct rbcfg_value rbcfg_boot_key[] = { @@ -131,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, @@ -173,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, @@ -236,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; @@ -253,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; @@ -744,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; @@ -752,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 899161a10..88acc13dc 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 @@ -59,6 +60,8 @@ #define RB_BOOT_DEVICE_CFCARD 2 #define RB_BOOT_DEVICE_ETHONCE 3 #define RB_BOOT_DEVICE_NANDONLY 5 +#define RB_BOOT_DEVICE_FLASHCFG 7 +#define RB_BOOT_DEVICE_FLSHONCE 8 #define RB_BOOT_KEY_ANY 0 #define RB_BOOT_KEY_DEL 1 @@ -69,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-ar71xx/Makefile b/package/boot/uboot-ar71xx/Makefile index 70f96713e..e6e6cbbd4 100644 --- a/package/boot/uboot-ar71xx/Makefile +++ b/package/boot/uboot-ar71xx/Makefile @@ -6,90 +6,28 @@ # include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk -PKG_NAME:=u-boot PKG_VERSION:=2010.03 PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_HASH:=902d1b2c15787df55186fae4033685fb0c5a5a12755a08383e97c4a3e255925b -PKG_SOURCE_URL:= \ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot -PKG_TARGETS:=bin - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= - CONFIG:= - IMAGE:= +define U-Boot/Default + BUILD_TARGET:=ar71xx + BUILD_SUBTARGET:=generic endef -define uboot/nbg460n_550n_550nh - TITLE:=U-boot for the NBG460N/550N/550NH routers - DEFAULT:=y if (TARGET_ar71xx_generic_DEVICE_NBG_460N_550N_550NH || TARGET_DEVICE_ar71xx_generic_DEVICE_NBG_460N_550N_550NH || TARGET_ar71xx_generic_Default) +define U-Boot/nbg460n_550n_550nh + TITLE:=NBG460N/550N/550NH routers + BUILD_DEVICES:=NBG_460N_550N_550NH + HIDDEN:=y endef -UBOOTS:=nbg460n_550n_550nh +UBOOT_MAKE_FLAGS := -define Package/uboot/template -define Package/uboot-ar71xx-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - TITLE:=$(2) - DEPENDS:=@TARGET_ar71xx_generic - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) -endef -endef +UBOOT_TARGETS:=nbg460n_550n_550nh -define BuildUbootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) -endef - - -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) -endif - -define Build/Prepare - $(call Build/Prepare/Default) - $(CP) ./files/* $(PKG_BUILD_DIR) - find $(PKG_BUILD_DIR) -name .svn | $(XARGS) rm -rf -endef - -define Build/Configure - $(MAKE) -C $(PKG_BUILD_DIR) \ - $(UBOOT_CONFIG)_config -endef - -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) -endef - -define Package/uboot/install/template -define Package/uboot-ar71xx-$(1)/install - $(INSTALL_DIR) $$(1) - $(CP) $(PKG_BUILD_DIR)/u-boot.bin $(BIN_DIR)/$(2) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),openwrt-$(BOARD)-$(SUBTARGET)-$(u)-u-boot.bin)) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUbootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-ar71xx-$(u))) \ -) +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/Makefile b/package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/Makefile similarity index 100% rename from package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/Makefile rename to package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/Makefile diff --git a/package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/config.mk b/package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/config.mk similarity index 100% rename from package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/config.mk rename to package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/config.mk diff --git a/package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/lowlevel_init.S b/package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/lowlevel_init.S similarity index 100% rename from package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/lowlevel_init.S rename to package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/lowlevel_init.S diff --git a/package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/nbg460n.c b/package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/nbg460n.c similarity index 100% rename from package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/nbg460n.c rename to package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/nbg460n.c diff --git a/package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/u-boot.lds b/package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/u-boot.lds similarity index 100% rename from package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/u-boot.lds rename to package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/u-boot.lds diff --git a/package/boot/uboot-ar71xx/files/cpu/mips/ar71xx_serial.c b/package/boot/uboot-ar71xx/src/cpu/mips/ar71xx_serial.c similarity index 100% rename from package/boot/uboot-ar71xx/files/cpu/mips/ar71xx_serial.c rename to package/boot/uboot-ar71xx/src/cpu/mips/ar71xx_serial.c diff --git a/package/boot/uboot-ar71xx/files/drivers/net/ag71xx.c b/package/boot/uboot-ar71xx/src/drivers/net/ag71xx.c similarity index 100% rename from package/boot/uboot-ar71xx/files/drivers/net/ag71xx.c rename to package/boot/uboot-ar71xx/src/drivers/net/ag71xx.c diff --git a/package/boot/uboot-ar71xx/files/drivers/net/ag71xx.h b/package/boot/uboot-ar71xx/src/drivers/net/ag71xx.h similarity index 100% rename from package/boot/uboot-ar71xx/files/drivers/net/ag71xx.h rename to package/boot/uboot-ar71xx/src/drivers/net/ag71xx.h diff --git a/package/boot/uboot-ar71xx/files/drivers/net/phy/rtl8366.h b/package/boot/uboot-ar71xx/src/drivers/net/phy/rtl8366.h similarity index 100% rename from package/boot/uboot-ar71xx/files/drivers/net/phy/rtl8366.h rename to package/boot/uboot-ar71xx/src/drivers/net/phy/rtl8366.h diff --git a/package/boot/uboot-ar71xx/files/drivers/net/phy/rtl8366_mii.c b/package/boot/uboot-ar71xx/src/drivers/net/phy/rtl8366_mii.c similarity index 100% rename from package/boot/uboot-ar71xx/files/drivers/net/phy/rtl8366_mii.c rename to package/boot/uboot-ar71xx/src/drivers/net/phy/rtl8366_mii.c diff --git a/package/boot/uboot-ar71xx/files/drivers/spi/ar71xx_spi.c b/package/boot/uboot-ar71xx/src/drivers/spi/ar71xx_spi.c similarity index 100% rename from package/boot/uboot-ar71xx/files/drivers/spi/ar71xx_spi.c rename to package/boot/uboot-ar71xx/src/drivers/spi/ar71xx_spi.c diff --git a/package/boot/uboot-ar71xx/files/include/asm-mips/ar71xx.h b/package/boot/uboot-ar71xx/src/include/asm-mips/ar71xx.h similarity index 100% rename from package/boot/uboot-ar71xx/files/include/asm-mips/ar71xx.h rename to package/boot/uboot-ar71xx/src/include/asm-mips/ar71xx.h diff --git a/package/boot/uboot-ar71xx/files/include/asm-mips/ar71xx_gpio.h b/package/boot/uboot-ar71xx/src/include/asm-mips/ar71xx_gpio.h similarity index 100% rename from package/boot/uboot-ar71xx/files/include/asm-mips/ar71xx_gpio.h rename to package/boot/uboot-ar71xx/src/include/asm-mips/ar71xx_gpio.h diff --git a/package/boot/uboot-ar71xx/files/include/configs/nbg460n.h b/package/boot/uboot-ar71xx/src/include/configs/nbg460n.h similarity index 100% rename from package/boot/uboot-ar71xx/files/include/configs/nbg460n.h rename to package/boot/uboot-ar71xx/src/include/configs/nbg460n.h diff --git a/package/boot/uboot-at91/Makefile b/package/boot/uboot-at91/Makefile index cbce85967..cad12ec2f 100644 --- a/package/boot/uboot-at91/Makefile +++ b/package/boot/uboot-at91/Makefile @@ -7,96 +7,89 @@ include $(TOPDIR)/rules.mk -PKG_NAME:=u-boot PKG_VERSION:=2016.05 PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot PKG_HASH:=87d02275615aaf0cd007b54cbe9fbadceef2bee7c79e6c323ea1ae8956dcb171 -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - -PKG_BUILD_PARALLEL:=1 - +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= +define U-Boot/Default + BUILD_TARGET:=at91 + HIDDEN:=1 + UBOOT_IMAGE:=u-boot.bin boot.bin endef -define uboot/at91sam9m10g45ek_nandflash - TITLE:=U-Boot for the AT91SAM9M10G45-EK board (NandFlash) +define U-Boot/at91sam9m10g45ek_nandflash + NAME:=AT91SAM9M10G45-EK board (NandFlash) + BUILD_SUBTARGET:=legacy + BUILD_DEVICES:=at91sam9m10g45ek endef -define uboot/at91sam9x5ek_nandflash - TITLE:=U-Boot for the AT91SAM9X5-EK board (NandFlash) +define U-Boot/at91sam9x5ek_nandflash + NAME:=AT91SAM9X5-EK board (NandFlash) + BUILD_SUBTARGET:=legacy + BUILD_DEVICES:=at91sam9g15ek at91sam9g25ek at91sam9g35ek at91sam9x25ek at91sam9x35ek endef -UBOOTS := \ +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 - -define Package/uboot/template -define Package/uboot-at91-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_at91 - TITLE:=$(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) - MAINTAINER:=Ben Whitten -endef -endef - -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) -endef - -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),lede-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) -endif - -define Build/Configure - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - $(UBOOT_CONFIG)_config -endef + 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 -define Package/uboot/install/default - $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) - - $(CP) $(PKG_BUILD_DIR)/u-boot.bin \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot.bin - - $(CP) $(PKG_BUILD_DIR)/boot.bin \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/boot.bin -endef - -define Package/uboot/install/template -define Package/uboot-at91-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-at91-$(u))) \ -) +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 784fc6423..57a2ec539 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 @@ -112,6 +112,10 @@ ifneq ($(CONFIG_TARGET_oxnas),) $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_BIN) ./files/oxnas $(1)/etc/uci-defaults/30_uboot-envtools endif +ifneq ($(CONFIG_TARGET_pistachio),) + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_DATA) ./files/pistachio $(1)/etc/uci-defaults/30_uboot-envtools +endif ifneq ($(CONFIG_TARGET_ramips),) $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_DATA) ./files/ramips $(1)/etc/uci-defaults/30_uboot-envtools diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx index 25bec7eb3..66eaeb0df 100644 --- a/package/boot/uboot-envtools/files/ar71xx +++ b/package/boot/uboot-envtools/files/ar71xx @@ -7,11 +7,10 @@ touch /etc/config/ubootenv -. /lib/ar71xx.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(ar71xx_board_name) +board=$(board_name) case "$board" in a40|\ @@ -20,6 +19,8 @@ alfa-ap120c|\ all0258n|\ ap121f|\ ap90q|\ +ap91-5g|\ +arduino-yun|\ cap324|\ cap4200ag|\ carambola2|\ @@ -28,7 +29,9 @@ cpe870|\ cr3000|\ cr5000|\ eap300v2|\ +ens202ext|\ gl-ar300m|\ +gl-ar750|\ hornet-ub|\ hornet-ub-x2|\ jwap230|\ @@ -38,11 +41,13 @@ mr600|\ mr600v2|\ mr900|\ mr900v2|\ +n5q|\ nbg6716|\ om5p|\ om5p-ac|\ om5p-acv2|\ om5p-an|\ +r36a|\ sr3200|\ tube2h|\ wndr3700|\ @@ -65,12 +70,20 @@ 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" ;; +rambutan) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" + ubootenv_add_uci_config "/dev/mtd1" "0x100000" "0x20000" "0x20000" + ;; 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/cns3xxx b/package/boot/uboot-envtools/files/cns3xxx index a56be15c5..f998de463 100644 --- a/package/boot/uboot-envtools/files/cns3xxx +++ b/package/boot/uboot-envtools/files/cns3xxx @@ -7,11 +7,10 @@ touch /etc/config/ubootenv -. /lib/cns3xxx.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(cns3xxx_board_name) +board=$(board_name) case "$board" in laguna) diff --git a/package/boot/uboot-envtools/files/imx6 b/package/boot/uboot-envtools/files/imx6 index a78c4fbe5..fec8ce0aa 100644 --- a/package/boot/uboot-envtools/files/imx6 +++ b/package/boot/uboot-envtools/files/imx6 @@ -7,11 +7,10 @@ touch /etc/config/ubootenv -. /lib/imx6.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(imx6_board_name) +board=$(board_name) case "$board" in *gw5*) diff --git a/package/boot/uboot-envtools/files/ipq b/package/boot/uboot-envtools/files/ipq index 16c7ba6bb..441ba4837 100644 --- a/package/boot/uboot-envtools/files/ipq +++ b/package/boot/uboot-envtools/files/ipq @@ -7,17 +7,41 @@ touch /etc/config/ubootenv -. /lib/ipq806x.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(ipq806x_board_name) +board=$(board_name) + +ubootenv_mtdinfo () { + UBOOTENV_PART=$(cat /proc/mtd | grep APPSBLENV) + mtd_dev=$(echo $UBOOTENV_PART | awk '{print $1}' | sed 's/:$//') + mtd_size=$(echo $UBOOTENV_PART | awk '{print "0x"$2}') + mtd_erase=$(echo $UBOOTENV_PART | awk '{print "0x"$3}') + nor_flash=$(find /sys/bus/spi/devices/*/mtd -name ${mtd_dev}) + + if [ -n "$nor_flash" ]; then + ubootenv_size=$mtd_size + else + # size is fixed to 0x40000 in u-boot + ubootenv_size=0x40000 + fi + + sectors=$(( $ubootenv_size / $mtd_erase )) + echo /dev/$mtd_dev 0x0 $ubootenv_size $mtd_erase $sectors +} case "$board" in -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 055e0eba4..16123846c 100644 --- a/package/boot/uboot-envtools/files/kirkwood +++ b/package/boot/uboot-envtools/files/kirkwood @@ -7,23 +7,22 @@ touch /etc/config/ubootenv -. /lib/kirkwood.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(kirkwood_board_name) +board=$(board_name) case "$board" in -dockstar|\ -guruplug-server-plus|\ -ib62x0|\ -linksys-viper|\ -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 d1a6668e8..f4541a559 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/mvebu b/package/boot/uboot-envtools/files/mvebu index 2bbbc2366..e33830e0a 100644 --- a/package/boot/uboot-envtools/files/mvebu +++ b/package/boot/uboot-envtools/files/mvebu @@ -8,11 +8,10 @@ touch /etc/config/ubootenv -. /lib/mvebu.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(mvebu_board_name) +board=$(board_name) case "$board" in armada-385-linksys-caiman|\ diff --git a/package/boot/uboot-envtools/files/mxs b/package/boot/uboot-envtools/files/mxs index ab8b4ef93..37d3c96ed 100644 --- a/package/boot/uboot-envtools/files/mxs +++ b/package/boot/uboot-envtools/files/mxs @@ -7,11 +7,10 @@ touch /etc/config/ubootenv -. /lib/mxs.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(mxs_board_name) +board=$(board_name) case "$board" in duckbill) diff --git a/package/boot/uboot-envtools/files/oxnas b/package/boot/uboot-envtools/files/oxnas index ac4744e3e..70b0f1663 100644 --- a/package/boot/uboot-envtools/files/oxnas +++ b/package/boot/uboot-envtools/files/oxnas @@ -7,11 +7,10 @@ touch /etc/config/ubootenv -. /lib/oxnas.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(oxnas_board_name) +board=$(board_name) case "$board" in akitio|\ diff --git a/package/boot/uboot-envtools/files/pistachio b/package/boot/uboot-envtools/files/pistachio new file mode 100644 index 000000000..e4aa7b0cd --- /dev/null +++ b/package/boot/uboot-envtools/files/pistachio @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Copyright (C) 2017 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +[ -e /etc/config/ubootenv ] && exit 0 + +touch /etc/config/ubootenv + +. /lib/uboot-envtools.sh +. /lib/functions.sh + +board=$(board_name) + +case "$board" in +img,pistachio-marduk) + ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x2000" "0x1000" + ;; +esac + +config_load ubootenv +config_foreach ubootenv_add_app_config ubootenv + +exit 0 diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 3216b300c..ce200a1ff 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -7,21 +7,19 @@ touch /etc/config/ubootenv -. /lib/ramips.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(ramips_board_name) +board=$(board_name) case "$board" in all0239-3g|\ -all0256n|\ +all0256n-4M|\ +all0256n-8M|\ all5002) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" ;; -br-6425|\ linkits7688|\ -linkits7688d|\ miwifi-nano|\ sk-wb8|\ wsr-1166|\ @@ -29,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-fritz4040/Makefile b/package/boot/uboot-fritz4040/Makefile new file mode 100644 index 000000000..9f9b4e05f --- /dev/null +++ b/package/boot/uboot-fritz4040/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2013-2014 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_SOURCE_URL:=https://github.com/chunkeey/FritzBox-4040-UBOOT +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=6946ebbaf7b12a4a092d763c8f0c87a25984f103 +PKG_SOURCE_DATE:=2017-01-29 +PKG_MIRROR_HASH:=5c2394f51a083dca2a2bf9cb36fa717f252112fc792c9eeae64f6383ad08987b + +PKG_RELEASE:=1 + +include $(INCLUDE_DIR)/u-boot.mk +include $(INCLUDE_DIR)/package.mk + +define U-Boot/Default + BUILD_TARGET:=ipq806x + UBOOT_IMAGE:=uboot-fritz4040.bin +endef + +define U-Boot/fritz4040 + NAME:=FritzBox 4040 +endef + +UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes +UBOOT_MAKE_FLAGS += USE_PRIVATE_LIBGCC=yes +export DTC + +define Build/Configure + $(Build/Configure/U-Boot) + $(HOSTCC) -o $(PKG_BUILD_DIR)/fritz/lzma2eva $(PKG_BUILD_DIR)/fritz/src/lzma2eva.c -lz + $(HOSTCC) -o $(PKG_BUILD_DIR)/fritz/tichksum $(PKG_BUILD_DIR)/fritz/src/tichksum.c + ln -sf $(STAGING_DIR_HOST)/bin/lzma $(PKG_BUILD_DIR)/fritz +endef + +define Build/Compile + $(Build/Compile/U-Boot) + (cd $(PKG_BUILD_DIR); ./fritz/fritzcreator.sh;) +endef + +define Package/u-boot/install + $(Package/u-boot/install/default) + $(INSTALL_BIN) ./files/upload-to-f4040.sh $(1)/ +endef + +UBOOT_TARGETS := fritz4040 + +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-fritz4040/files/upload-to-f4040.sh b/package/boot/uboot-fritz4040/files/upload-to-f4040.sh new file mode 100755 index 000000000..64f493190 --- /dev/null +++ b/package/boot/uboot-fritz4040/files/upload-to-f4040.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +die() { + echo $1 + exit 1 +} + +FRITZBOX='192.168.178.1' +USER='adam2' +PASSWD='adam2' +FILE='uboot-fritz4040.bin' + +ping -q -4 -w 1 -c 1 "$FRITZBOX" &> /dev/null || die "Fritzbox at $FRITZBOX is not reachable. aborting" + +cat << EOS + +This will take ages (2 minutes)! If you want a +status bar: Attach a serial to the device and look there. + +Note: If this fails, you need to use AVM\' recover +utility to get your box back. However this step +should not damage your box.... + +Also it doesn't terminate.. :/ + +(Note: Make sure that you connected the router on +the yellow LAN ports and not the blue WAN). + +EOS + +ftp -n -4 "$FRITZBOX" << END_SCRIPT +quote USER $USER +quote PASS $PASSWD +quote MEDIA FLSH +binary +passive +put $FILE mtd1 +quote check mtd1 +bye +END_SCRIPT +exit 0 diff --git a/package/boot/uboot-fritz4040/patches/100-private-libgcc.patch b/package/boot/uboot-fritz4040/patches/100-private-libgcc.patch new file mode 100644 index 000000000..6fec563da --- /dev/null +++ b/package/boot/uboot-fritz4040/patches/100-private-libgcc.patch @@ -0,0 +1,274 @@ +--- a/arch/arm/lib/Makefile ++++ b/arch/arm/lib/Makefile +@@ -26,7 +26,6 @@ include $(TOPDIR)/config.mk + LIB = $(obj)lib$(ARCH).o + LIBGCC = $(obj)libgcc.o + +-ifndef CONFIG_SPL_BUILD + GLSOBJS += _ashldi3.o + GLSOBJS += _ashrdi3.o + GLSOBJS += _divsi3.o +@@ -34,9 +33,11 @@ GLSOBJS += _lshrdi3.o + GLSOBJS += _modsi3.o + GLSOBJS += _udivsi3.o + GLSOBJS += _umodsi3.o ++GLSOBJS += uldivmod.o + + GLCOBJS += div0.o + ++ifndef CONFIG_SPL_BUILD + COBJS-y += board.o + COBJS-y += bootm.o + COBJS-$(CONFIG_SYS_L2_PL310) += cache-pl310.o +--- /dev/null ++++ b/arch/arm/lib/uldivmod.S +@@ -0,0 +1,249 @@ ++/* ++ * Copyright 2010, Google Inc. ++ * ++ * Brought in from coreboot uldivmod.S ++ * ++ * SPDX-License-Identifier: GPL-2.0 ++ */ ++ ++#include ++#include ++ ++/* ++ * A, Q = r0 + (r1 << 32) ++ * B, R = r2 + (r3 << 32) ++ * A / B = Q ... R ++ */ ++ ++#define ARM(x...) x ++#define THUMB(x...) ++ ++A_0 .req r0 ++A_1 .req r1 ++B_0 .req r2 ++B_1 .req r3 ++C_0 .req r4 ++C_1 .req r5 ++D_0 .req r6 ++D_1 .req r7 ++ ++Q_0 .req r0 ++Q_1 .req r1 ++R_0 .req r2 ++R_1 .req r3 ++ ++THUMB( ++TMP .req r8 ++) ++ ++.pushsection .text.__aeabi_uldivmod, "ax" ++ENTRY(__aeabi_uldivmod) ++ ++ stmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) lr} ++ @ Test if B == 0 ++ orrs ip, B_0, B_1 @ Z set -> B == 0 ++ beq L_div_by_0 ++ @ Test if B is power of 2: (B & (B - 1)) == 0 ++ subs C_0, B_0, #1 ++ sbc C_1, B_1, #0 ++ tst C_0, B_0 ++ tsteq B_1, C_1 ++ beq L_pow2 ++ @ Test if A_1 == B_1 == 0 ++ orrs ip, A_1, B_1 ++ beq L_div_32_32 ++ ++L_div_64_64: ++/* CLZ only exists in ARM architecture version 5 and above. */ ++#ifdef HAVE_CLZ ++ mov C_0, #1 ++ mov C_1, #0 ++ @ D_0 = clz A ++ teq A_1, #0 ++ clz D_0, A_1 ++ clzeq ip, A_0 ++ addeq D_0, D_0, ip ++ @ D_1 = clz B ++ teq B_1, #0 ++ clz D_1, B_1 ++ clzeq ip, B_0 ++ addeq D_1, D_1, ip ++ @ if clz B - clz A > 0 ++ subs D_0, D_1, D_0 ++ bls L_done_shift ++ @ B <<= (clz B - clz A) ++ subs D_1, D_0, #32 ++ rsb ip, D_0, #32 ++ movmi B_1, B_1, lsl D_0 ++ARM( orrmi B_1, B_1, B_0, lsr ip ) ++THUMB( lsrmi TMP, B_0, ip ) ++THUMB( orrmi B_1, B_1, TMP ) ++ movpl B_1, B_0, lsl D_1 ++ mov B_0, B_0, lsl D_0 ++ @ C = 1 << (clz B - clz A) ++ movmi C_1, C_1, lsl D_0 ++ARM( orrmi C_1, C_1, C_0, lsr ip ) ++THUMB( lsrmi TMP, C_0, ip ) ++THUMB( orrmi C_1, C_1, TMP ) ++ movpl C_1, C_0, lsl D_1 ++ mov C_0, C_0, lsl D_0 ++L_done_shift: ++ mov D_0, #0 ++ mov D_1, #0 ++ @ C: current bit; D: result ++#else ++ @ C: current bit; D: result ++ mov C_0, #1 ++ mov C_1, #0 ++ mov D_0, #0 ++ mov D_1, #0 ++L_lsl_4: ++ cmp B_1, #0x10000000 ++ cmpcc B_1, A_1 ++ cmpeq B_0, A_0 ++ bcs L_lsl_1 ++ @ B <<= 4 ++ mov B_1, B_1, lsl #4 ++ orr B_1, B_1, B_0, lsr #28 ++ mov B_0, B_0, lsl #4 ++ @ C <<= 4 ++ mov C_1, C_1, lsl #4 ++ orr C_1, C_1, C_0, lsr #28 ++ mov C_0, C_0, lsl #4 ++ b L_lsl_4 ++L_lsl_1: ++ cmp B_1, #0x80000000 ++ cmpcc B_1, A_1 ++ cmpeq B_0, A_0 ++ bcs L_subtract ++ @ B <<= 1 ++ mov B_1, B_1, lsl #1 ++ orr B_1, B_1, B_0, lsr #31 ++ mov B_0, B_0, lsl #1 ++ @ C <<= 1 ++ mov C_1, C_1, lsl #1 ++ orr C_1, C_1, C_0, lsr #31 ++ mov C_0, C_0, lsl #1 ++ b L_lsl_1 ++#endif ++L_subtract: ++ @ if A >= B ++ cmp A_1, B_1 ++ cmpeq A_0, B_0 ++ bcc L_update ++ @ A -= B ++ subs A_0, A_0, B_0 ++ sbc A_1, A_1, B_1 ++ @ D |= C ++ orr D_0, D_0, C_0 ++ orr D_1, D_1, C_1 ++L_update: ++ @ if A == 0: break ++ orrs ip, A_1, A_0 ++ beq L_exit ++ @ C >>= 1 ++ movs C_1, C_1, lsr #1 ++ movs C_0, C_0, rrx ++ @ if C == 0: break ++ orrs ip, C_1, C_0 ++ beq L_exit ++ @ B >>= 1 ++ movs B_1, B_1, lsr #1 ++ mov B_0, B_0, rrx ++ b L_subtract ++L_exit: ++ @ Note: A, B & Q, R are aliases ++ mov R_0, A_0 ++ mov R_1, A_1 ++ mov Q_0, D_0 ++ mov Q_1, D_1 ++ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc} ++ ++L_div_32_32: ++ @ Note: A_0 & r0 are aliases ++ @ Q_1 r1 ++ mov r1, B_0 ++ bl __aeabi_uidivmod ++ mov R_0, r1 ++ mov R_1, #0 ++ mov Q_1, #0 ++ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc} ++ ++L_pow2: ++#ifdef HAVE_CLZ ++ @ Note: A, B and Q, R are aliases ++ @ R = A & (B - 1) ++ and C_0, A_0, C_0 ++ and C_1, A_1, C_1 ++ @ Q = A >> log2(B) ++ @ Note: B must not be 0 here! ++ clz D_0, B_0 ++ add D_1, D_0, #1 ++ rsbs D_0, D_0, #31 ++ bpl L_1 ++ clz D_0, B_1 ++ rsb D_0, D_0, #31 ++ mov A_0, A_1, lsr D_0 ++ add D_0, D_0, #32 ++L_1: ++ movpl A_0, A_0, lsr D_0 ++ARM( orrpl A_0, A_0, A_1, lsl D_1 ) ++THUMB( lslpl TMP, A_1, D_1 ) ++THUMB( orrpl A_0, A_0, TMP ) ++ mov A_1, A_1, lsr D_0 ++ @ Mov back C to R ++ mov R_0, C_0 ++ mov R_1, C_1 ++ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc} ++#else ++ @ Note: A, B and Q, R are aliases ++ @ R = A & (B - 1) ++ and C_0, A_0, C_0 ++ and C_1, A_1, C_1 ++ @ Q = A >> log2(B) ++ @ Note: B must not be 0 here! ++ @ Count the leading zeroes in B. ++ mov D_0, #0 ++ orrs B_0, B_0, B_0 ++ @ If B is greater than 1 << 31, divide A and B by 1 << 32. ++ moveq A_0, A_1 ++ moveq A_1, #0 ++ moveq B_0, B_1 ++ @ Count the remaining leading zeroes in B. ++ movs B_1, B_0, lsl #16 ++ addeq D_0, #16 ++ moveq B_0, B_0, lsr #16 ++ tst B_0, #0xff ++ addeq D_0, #8 ++ moveq B_0, B_0, lsr #8 ++ tst B_0, #0xf ++ addeq D_0, #4 ++ moveq B_0, B_0, lsr #4 ++ tst B_0, #0x3 ++ addeq D_0, #2 ++ moveq B_0, B_0, lsr #2 ++ tst B_0, #0x1 ++ addeq D_0, #1 ++ @ Shift A to the right by the appropriate amount. ++ rsb D_1, D_0, #32 ++ mov Q_0, A_0, lsr D_0 ++ ARM( orr Q_0, Q_0, A_1, lsl D_1 ) ++ THUMB( lsl A_1, D_1 ) ++ THUMB( orr Q_0, A_1 ) ++ mov Q_1, A_1, lsr D_0 ++ @ Move C to R ++ mov R_0, C_0 ++ mov R_1, C_1 ++ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc} ++#endif ++ ++L_div_by_0: ++ bl __div0 ++ @ As wrong as it could be ++ mov Q_0, #0 ++ mov Q_1, #0 ++ mov R_0, #0 ++ mov R_1, #0 ++ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc} ++ENDPROC(__aeabi_uldivmod) ++.popsection diff --git a/package/boot/uboot-fritz4040/patches/110-portability.patch b/package/boot/uboot-fritz4040/patches/110-portability.patch new file mode 100644 index 000000000..08ab88912 --- /dev/null +++ b/package/boot/uboot-fritz4040/patches/110-portability.patch @@ -0,0 +1,32 @@ +Index: u-boot-2017-01-29-6946ebba/fritz/fritzcreator.sh +=================================================================== +--- u-boot-2017-01-29-6946ebba.orig/fritz/fritzcreator.sh ++++ u-boot-2017-01-29-6946ebba/fritz/fritzcreator.sh +@@ -1,4 +1,4 @@ +-#!/bin/sh -xe ++#!/bin/bash -xe + + # A helpful + # +@@ -11,6 +11,7 @@ UBOOT_FRITZ4040="uboot-fritz4040.bin" + FRITZ_DTS="fritz/fritz4040.dts" + FRITZ_DTB="fritz4040.dtb" + UBOOT_LOADADDR=0x841FFFF8 ++DTC="${DTC:-dtc}" + + rm -f "$UBOOT_FRITZ4040" + +@@ -44,11 +45,11 @@ printf "\x00\x00\x00\xea\xf8\x01\x33\xc4 + cat "$UBOOT_BIN" >> "$UBOOT_FRITZ4040" + + # Pad file to 1M +-dd if="$UBOOT_FRITZ4040" of="$UBOOT_FRITZ4040.new" bs=1M count=1 conv=sync ++dd if="$UBOOT_FRITZ4040" of="$UBOOT_FRITZ4040.new" bs=1024k count=1 conv=sync + mv "$UBOOT_FRITZ4040.new" "$UBOOT_FRITZ4040" + + # Compile DTS +-dtc "$FRITZ_DTS" -o "$FRITZ_DTB" --space 49152 ++$DTC "$FRITZ_DTS" -o "$FRITZ_DTB" --space 49152 + + # Append the compiled DTBs + cat "$FRITZ_DTB" "$FRITZ_DTB" "$FRITZ_DTB" "$FRITZ_DTB" >> $UBOOT_FRITZ4040 diff --git a/package/boot/uboot-imx6/Makefile b/package/boot/uboot-imx6/Makefile index 884d8c034..8d422758d 100644 --- a/package/boot/uboot-imx6/Makefile +++ b/package/boot/uboot-imx6/Makefile @@ -7,68 +7,63 @@ include $(TOPDIR)/rules.mk -PKG_NAME:=u-boot PKG_VERSION:=2014.04 PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot PKG_HASH:=7b6444bd23eb61068c43bd1d44ec7e7bfdbce5cadeca20c833eee186b4d3fd31 -PKG_BUILD_PARALLEL:=1 - +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= - CONFIG:= - IMAGE:= +define U-Boot/Default + BUILD_TARGET:=imx6 + UBOOT_IMAGE:=u-boot.imx endef -define uboot/mx6qsabresd - TITLE:=U-Boot for SABRE i.MX6Quad board +define U-Boot/mx6qsabresd + NAME:=SABRE i.MX6Quad board endef -define uboot/nitrogen6dl - TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 1GB board +define U-Boot/nitrogen6dl + NAME:=Nitrogen6x i.MX6Dual-Lite 1GB board endef -define uboot/nitrogen6dl2g - TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 2GB board +define U-Boot/nitrogen6dl2g + NAME:=Nitrogen6x i.MX6Dual-Lite 2GB board endef -define uboot/nitrogen6q - TITLE:=U-Boot for Nitrogen6x/SABRE Lite (MX6Q/1GB) +define U-Boot/nitrogen6q + NAME:=Nitrogen6x/SABRE Lite (MX6Q/1GB) endef -define uboot/nitrogen6q2g - TITLE:=U-Boot for Nitrogen6x i.MX6Quad 2GB board +define U-Boot/nitrogen6q2g + NAME:=Nitrogen6x i.MX6Quad 2GB board endef -define uboot/nitrogen6s - TITLE:=U-Boot for Nitrogen6x i.MX6Solo 512MB board +define U-Boot/nitrogen6s + NAME:=Nitrogen6x i.MX6Solo 512MB board endef -define uboot/nitrogen6s1g - TITLE:=U-Boot for Nitrogen6x i.MX6Solo 1GB board +define U-Boot/nitrogen6s1g + NAME:=Nitrogen6x i.MX6Solo 1GB board endef -define uboot/wandboard_dl - TITLE:=U-Boot for the Wandboard Dual Lite +define U-Boot/wandboard_dl + NAME:=Wandboard Dual Lite + BUILD_DEVICES:=wandboard endef -define uboot/wandboard_quad - TITLE:=U-Boot for the Wandboard Quad +define U-Boot/wandboard_quad + NAME:=Wandboard Quad + BUILD_DEVICES:=wandboard endef -define uboot/wandboard_solo - TITLE:=U-Boot for the Wandboard Solo +define U-Boot/wandboard_solo + NAME:=Wandboard Solo + BUILD_DEVICES:=wandboard endef -UBOOTS := \ +UBOOT_TARGETS := \ mx6qsabresd \ nitrogen6dl \ nitrogen6dl2g \ @@ -80,58 +75,4 @@ UBOOTS := \ wandboard_quad \ wandboard_solo -define Package/uboot/template -define Package/uboot-imx6-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_imx6 - TITLE:=$(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) - MAINTAINER:=Luka Perkov -endef -endef - -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) -endef - -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) -endif - -define Build/Configure - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - $(UBOOT_CONFIG)_config -endef - -define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) -endef - -define Package/uboot/install/default - $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) - $(CP) \ - $(PKG_BUILD_DIR)/u-boot.imx \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.imx -endef - -define Package/uboot/install/template -define Package/uboot-imx6-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-imx6-$(u))) \ -) +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-kirkwood/Makefile b/package/boot/uboot-kirkwood/Makefile index 74b9f0fde..f4bb87556 100644 --- a/package/boot/uboot-kirkwood/Makefile +++ b/package/boot/uboot-kirkwood/Makefile @@ -7,93 +7,87 @@ include $(TOPDIR)/rules.mk -PKG_NAME:=u-boot -PKG_VERSION:=2016.09.01 +PKG_VERSION:=2017.09 PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=\ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot -PKG_HASH:=95728e89dd476d17428f94080752ab48884be477b6a678941582aeef618b70bb -PKG_TARGETS:=bin - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - -PKG_BUILD_PARALLEL:=1 +PKG_HASH:=b2d15f2cf5f72e706025cde73d67247c6da8cd35f7e10891eefe7d9095089744 +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= +define U-Boot/Default + BUILD_TARGET:=kirkwood endef -define uboot/dockstar - TITLE:=U-Boot for Seagate DockStar +define U-Boot/dockstar + NAME:=Seagate DockStar + BUILD_DEVICES:=seagate_dockstar endef -define uboot/dockstar_second_stage - TITLE:=second stage U-Boot for Seagate DockStar +define U-Boot/dockstar_second_stage + NAME:=Seagate DockStar (second stage) + BUILD_DEVICES:=seagate_dockstar endef -define uboot/goflexhome - TITLE:=U-Boot for the Seagate GoFlexHome/GoFlexNet +define U-Boot/goflexhome + NAME:=the Seagate GoFlexHome/GoFlexNet + BUILD_DEVICES:=seagate_goflexhome seagate_goflexnet endef -define uboot/ib62x0 - TITLE:=U-Boot for RaidSonic ICY BOX NAS6210 and NAS6220 +define U-Boot/ib62x0 + NAME:=RaidSonic ICY BOX NAS6210 and NAS6220 + BUILD_DEVICES:=raidsonic_ib-nas62x0 endef -define uboot/ib62x0_second_stage - TITLE:=second stage U-Boot for RaidSonic ICY BOX NAS6210 and NAS6220 +define U-Boot/ib62x0_second_stage + NAME:=RaidSonic ICY BOX NAS6210 and NAS6220 (second stage) + BUILD_DEVICES:=raidsonic_ib-nas62x0 endef -define uboot/iconnect - TITLE:=U-Boot for Iomega iConnect Wireless +define U-Boot/iconnect + NAME:=Iomega iConnect Wireless + BUILD_DEVICES:=iom_iconnect-1.1 endef -define uboot/iconnect_second_stage - TITLE:=second stage U-Boot for Iomega iConnect Wireless +define U-Boot/iconnect_second_stage + NAME:=Iomega iConnect Wireless (second stage) + BUILD_DEVICES:=iom_iconnect-1.1 endef -define uboot/pogo_e02 - TITLE:=U-Boot for Cloud Engines Pogoplug E02 +define U-Boot/nsa310 + NAME:=Zyxel NSA310 + BUILD_DEVICES:=zyxel_nsa310b endef -define uboot/pogo_e02_second_stage - TITLE:=second stage U-Boot for Cloud Engines Pogoplug E02 +define U-Boot/nsa325 + NAME:=Zyxel NSA325v1 and v2 + BUILD_DEVICES:=zyxel_nsa325 endef -define uboot/sheevaplug - TITLE:=U-Boot for SheevaPlug +define U-Boot/pogo_e02 + NAME:=Cloud Engines Pogoplug E02 + BUILD_DEVICES:=cloudengines_pogoe02 endef -UBOOTS:= \ +define U-Boot/pogo_e02_second_stage + NAME:=Cloud Engines Pogoplug E02 (second stage) + BUILD_DEVICES:=cloudengines_pogoe02 +endef + +define U-Boot/pogoplugv4 + NAME:=Cloud Engines Pogoplug V4 + BUILD_DEVICES:=cloudengines_pogoplugv4 +endef + +UBOOT_TARGETS := \ dockstar dockstar_second_stage \ goflexhome \ ib62x0 ib62x0_second_stage \ iconnect iconnect_second_stage \ + nsa310 \ + nsa325 \ pogo_e02 pogo_e02_second_stage \ - sheevaplug - -define Package/uboot/template -define Package/uboot-kirkwood-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_kirkwood - TITLE:=$(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) -endef -endef - -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) -endef + pogoplugv4 define Build/Configure $(if $(findstring _second_stage,$(BUILD_VARIANT)), @@ -112,34 +106,21 @@ define Build/Compile CROSS_COMPILE=$(TARGET_CROSS) mkimage -A $(ARCH) -O linux -T kernel -C none \ -a 0x600000 -e 0x600000 \ - -n 'OpenWrt Das U-Boot uImage' \ + -n 'U-Boot uImage' \ -d $(PKG_BUILD_DIR)/u-boot.bin $(PKG_BUILD_DIR)/u-boot.img endef -define Package/uboot/install/default - $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) - $(CP) $(PKG_BUILD_DIR)/u-boot.bin \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin - $(CP) $(PKG_BUILD_DIR)/u-boot.kwb \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.kwb - $(CP) $(PKG_BUILD_DIR)/u-boot.img \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.img - $(INSTALL_DIR) $(BIN_DIR)/u-boot-kwboot/ - $(CP) $(PKG_BUILD_DIR)/tools/kwboot \ - $(BIN_DIR)/u-boot-kwboot/ +define Package/u-boot/install + $(CP) \ + $(PKG_BUILD_DIR)/u-boot.bin \ + $(PKG_BUILD_DIR)/u-boot.kwb \ + $(PKG_BUILD_DIR)/u-boot.img \ + $(1)/ endef -define Package/uboot/install/template -define Package/uboot-kirkwood-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/kwboot $(STAGING_DIR_HOST)/bin/ endef -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-kirkwood-$(u))) \ -) +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-kirkwood/patches/0001-kirkwood-ib62x0-add-CONFIG_SYS_GENERIC_BOARD-define.patch b/package/boot/uboot-kirkwood/patches/0001-kirkwood-ib62x0-add-CONFIG_SYS_GENERIC_BOARD-define.patch deleted file mode 100644 index 65ae63f34..000000000 --- a/package/boot/uboot-kirkwood/patches/0001-kirkwood-ib62x0-add-CONFIG_SYS_GENERIC_BOARD-define.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 280b03ba28b4287de677d4c4b097918364395b5e Mon Sep 17 00:00:00 2001 -From: Luka Perkov -Date: Wed, 2 Jul 2014 01:47:23 +0200 -Subject: [PATCH 4/9] kirkwood: ib62x0: add CONFIG_SYS_GENERIC_BOARD define - -Signed-off-by: Luka Perkov -CC: Prafulla Wadaskar -CC: Stefan Roese ---- -This is patch was sent already in July: - -http://lists.denx.de/pipermail/u-boot/2014-July/182900.html ---- - include/configs/ib62x0.h | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/include/configs/ib62x0.h -+++ b/include/configs/ib62x0.h -@@ -9,6 +9,8 @@ - #ifndef _CONFIG_IB62x0_H - #define _CONFIG_IB62x0_H - -+#define CONFIG_SYS_GENERIC_BOARD -+ - /* - * Version number information - */ diff --git a/package/boot/uboot-kirkwood/patches/0002-kirkwood-dockstar-add-CONFIG_SYS_GENERIC_BOARD-defin.patch b/package/boot/uboot-kirkwood/patches/0002-kirkwood-dockstar-add-CONFIG_SYS_GENERIC_BOARD-defin.patch deleted file mode 100644 index 6ec605229..000000000 --- a/package/boot/uboot-kirkwood/patches/0002-kirkwood-dockstar-add-CONFIG_SYS_GENERIC_BOARD-defin.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 5f9e6f640098e6963ff9b470cd5d2ab9f6a3579e Mon Sep 17 00:00:00 2001 -From: Luka Perkov -Date: Sun, 30 Nov 2014 02:40:37 +0100 -Subject: [PATCH 5/9] kirkwood: dockstar: add CONFIG_SYS_GENERIC_BOARD define - -Signed-off-by: Luka Perkov -CC: Prafulla Wadaskar -CC: Stefan Roese ---- - include/configs/dockstar.h | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/include/configs/dockstar.h -+++ b/include/configs/dockstar.h -@@ -12,6 +12,8 @@ - #ifndef _CONFIG_DOCKSTAR_H - #define _CONFIG_DOCKSTAR_H - -+#define CONFIG_SYS_GENERIC_BOARD -+ - /* - * Version number information - */ diff --git a/package/boot/uboot-kirkwood/patches/0003-kirkwood-goflexhome-add-CONFIG_SYS_GENERIC_BOARD-def.patch b/package/boot/uboot-kirkwood/patches/0003-kirkwood-goflexhome-add-CONFIG_SYS_GENERIC_BOARD-def.patch deleted file mode 100644 index ac0bc0d2a..000000000 --- a/package/boot/uboot-kirkwood/patches/0003-kirkwood-goflexhome-add-CONFIG_SYS_GENERIC_BOARD-def.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0d0a6606396f0cc1a4f2966d167ef9e85d533650 Mon Sep 17 00:00:00 2001 -From: Luka Perkov -Date: Sun, 30 Nov 2014 02:40:51 +0100 -Subject: [PATCH 6/9] kirkwood: goflexhome: add CONFIG_SYS_GENERIC_BOARD define - -Signed-off-by: Luka Perkov -CC: Prafulla Wadaskar -CC: Stefan Roese ---- - include/configs/goflexhome.h | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/include/configs/goflexhome.h -+++ b/include/configs/goflexhome.h -@@ -15,6 +15,8 @@ - #ifndef _CONFIG_GOFLEXHOME_H - #define _CONFIG_GOFLEXHOME_H - -+#define CONFIG_SYS_GENERIC_BOARD -+ - /* - * Version number information - */ diff --git a/package/boot/uboot-kirkwood/patches/0004-kirkwood-iconnect-add-CONFIG_SYS_GENERIC_BOARD-defin.patch b/package/boot/uboot-kirkwood/patches/0004-kirkwood-iconnect-add-CONFIG_SYS_GENERIC_BOARD-defin.patch deleted file mode 100644 index ab23481f7..000000000 --- a/package/boot/uboot-kirkwood/patches/0004-kirkwood-iconnect-add-CONFIG_SYS_GENERIC_BOARD-defin.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 45ba20427135e526cfa528773de0cfe215f4dc40 Mon Sep 17 00:00:00 2001 -From: Luka Perkov -Date: Sun, 30 Nov 2014 02:41:04 +0100 -Subject: [PATCH 7/9] kirkwood: iconnect: add CONFIG_SYS_GENERIC_BOARD define - -Signed-off-by: Luka Perkov -CC: Prafulla Wadaskar -CC: Stefan Roese ---- - include/configs/iconnect.h | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/include/configs/iconnect.h -+++ b/include/configs/iconnect.h -@@ -9,6 +9,8 @@ - #ifndef _CONFIG_ICONNECT_H - #define _CONFIG_ICONNECT_H - -+#define CONFIG_SYS_GENERIC_BOARD -+ - /* - * Version number information - */ diff --git a/package/boot/uboot-kirkwood/patches/0005-kirkwood-pogo_e02-add-CONFIG_SYS_GENERIC_BOARD-defin.patch b/package/boot/uboot-kirkwood/patches/0005-kirkwood-pogo_e02-add-CONFIG_SYS_GENERIC_BOARD-defin.patch deleted file mode 100644 index 40918d473..000000000 --- a/package/boot/uboot-kirkwood/patches/0005-kirkwood-pogo_e02-add-CONFIG_SYS_GENERIC_BOARD-defin.patch +++ /dev/null @@ -1,23 +0,0 @@ -From bd862f4e7a559e38763a5280e35bf7ff14b535f1 Mon Sep 17 00:00:00 2001 -From: Luka Perkov -Date: Sun, 30 Nov 2014 02:41:19 +0100 -Subject: [PATCH 8/9] kirkwood: pogo_e02: add CONFIG_SYS_GENERIC_BOARD define - -Signed-off-by: Luka Perkov -CC: Prafulla Wadaskar -CC: Stefan Roese ---- - include/configs/pogo_e02.h | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/include/configs/pogo_e02.h -+++ b/include/configs/pogo_e02.h -@@ -13,6 +13,8 @@ - #ifndef _CONFIG_POGO_E02_H - #define _CONFIG_POGO_E02_H - -+#define CONFIG_SYS_GENERIC_BOARD -+ - /* - * Machine type definition and ID - */ diff --git a/package/boot/uboot-kirkwood/patches/0006-kirkwood-sheevaplug-add-CONFIG_SYS_GENERIC_BOARD-def.patch b/package/boot/uboot-kirkwood/patches/0006-kirkwood-sheevaplug-add-CONFIG_SYS_GENERIC_BOARD-def.patch deleted file mode 100644 index d976bbc02..000000000 --- a/package/boot/uboot-kirkwood/patches/0006-kirkwood-sheevaplug-add-CONFIG_SYS_GENERIC_BOARD-def.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 787e23179708ddad7ecd9dcd6c841546689864b0 Mon Sep 17 00:00:00 2001 -From: Luka Perkov -Date: Sun, 30 Nov 2014 02:41:49 +0100 -Subject: [PATCH 9/9] kirkwood: sheevaplug: add CONFIG_SYS_GENERIC_BOARD define - -Signed-off-by: Luka Perkov -CC: Prafulla Wadaskar -CC: Stefan Roese ---- - include/configs/sheevaplug.h | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/include/configs/sheevaplug.h -+++ b/include/configs/sheevaplug.h -@@ -10,6 +10,8 @@ - #ifndef _CONFIG_SHEEVAPLUG_H - #define _CONFIG_SHEEVAPLUG_H - -+#define CONFIG_SYS_GENERIC_BOARD -+ - /* - * Version number information - */ diff --git a/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch b/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch new file mode 100644 index 000000000..10d8d4405 --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch @@ -0,0 +1,697 @@ + +arm: kirkwood: add ZyXEL NSA310 device + +This patch add ZyXEL NSA310 1-Bay Media Server + +The ZyXEL NSA310 device is a Kirkwood based NAS: + +- SoC: Marvell 88F6702 1200Mhz +- SDRAM memory: 256MB DDR2 400Mhz +- Gigabit ethernet: PHY Realtek +- Flash memory: 128MB +- 1 Power button +- 1 Power LED (blue) +- 5 Status LED (green/red) +- 1 Copy/Sync button +- 1 Reset button +- 2 SATA II port (1 internal and 1 external eSata) +- 2 USB 2.0 ports (1 front and 1 back) +- Smart fan + +Signed-off-by: Alberto Bursi + +NOTE: this patch is ready for upstream, LEDE-specific parts are in + another patch + +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 +@@ -56,6 +56,9 @@ config TARGET_GOFLEXHOME + config TARGET_NAS220 + bool "BlackArmor NAS220" + ++config TARGET_NSA310 ++ bool "Zyxel NSA310 Board" ++ + config TARGET_NSA310S + 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 +index 0000000..145ade6 +--- /dev/null ++++ b/board/zyxel/nsa310/Kconfig +@@ -0,0 +1,12 @@ ++if TARGET_NSA310 ++ ++config SYS_BOARD ++ default "nsa310" ++ ++config SYS_VENDOR ++ default "zyxel" ++ ++config SYS_CONFIG_NAME ++ default "nsa310" ++ ++endif +diff --git a/board/zyxel/nsa310/MAINTAINERS b/board/zyxel/nsa310/MAINTAINERS +new file mode 100644 +index 0000000..d09f1ab +--- /dev/null ++++ b/board/zyxel/nsa310/MAINTAINERS +@@ -0,0 +1,6 @@ ++NSA310 BOARD ++M: Alberto Bursi ++S: Maintained ++F: board/zyxel/nsa310/ ++F: include/configs/nsa310.h ++F: configs/nsa310_defconfig +diff --git a/board/zyxel/nsa310/Makefile b/board/zyxel/nsa310/Makefile +new file mode 100644 +index 0000000..dfe93cc +--- /dev/null ++++ b/board/zyxel/nsa310/Makefile +@@ -0,0 +1,12 @@ ++# ++# (C) Copyright 2015 bodhi ++# ++# Based on ++# (C) Copyright 2009 ++# Marvell Semiconductor ++# Written-by: Prafulla Wadaskar ++# ++# SPDX-License-Identifier: GPL-2.0+ ++# ++ ++obj-y := nsa310.o +diff --git a/board/zyxel/nsa310/kwbimage.cfg b/board/zyxel/nsa310/kwbimage.cfg +new file mode 100644 +index 0000000..f60e1d2 +--- /dev/null ++++ b/board/zyxel/nsa310/kwbimage.cfg +@@ -0,0 +1,166 @@ ++# ++# Copyright (C) 2013 Rafal Kazmierowski ++# ++# Based on guruplug.c originally written by ++# Siddarth Gore ++# (C) Copyright 2009 ++# Marvell Semiconductor ++# ++# 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., 51 Franklin Street, Fifth Floor, Boston, ++# MA 02110-1301 USA ++# ++# Refer docs/README.kwimage for more details about how-to configure ++# and create kirkwood boot image ++# ++ ++# Boot Media configurations ++BOOT_FROM nand ++#BOOT_FROM uart ++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 ++DATA 0xFFD100e0 0x1b1b1b9b ++ ++#Dram initalization for SINGLE x16 CL=5 @ 400MHz ++DATA 0xFFD01400 0x43010c30 # DDR Configuration register ++# bit13-0: 0xc30 (3120 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 0x37543000 # 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: 5=recommended value for CL=5 and STARTBURST_DEL disabled bit31=0 ++# bit27-24: 7= CL+2, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM ++# bit30-28: 3 required ++# bit31: 0=no additional STARTBURST delay ++ ++DATA 0xFFD01408 0x22125451 # 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 0x00000a33 # DDR Timing (High) ++# bit6-0: TRFC ++# bit8-7: TR2R ++# bit10-9: TR2W ++# bit12-11: TW2W ++# bit31-13: zero required ++ ++DATA 0xFFD01410 0x0000000c # DDR Address Control ++# bit1-0: 01, Cs0width=x8 ++# bit3-2: 10, Cs0size=1Gb ++# bit5-4: 01, Cs1width=x8 ++# bit7-6: 10, Cs1size=1Gb ++# 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 0x00000652 # DDR Mode ++# bit2-0: 2, BurstLen=2 required ++# bit3: 0, BurstType=0 required ++# bit6-4: 4, CL=5 ++# 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 0x00000004 # 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 0x0000F17F # DDR Controller Control High ++# bit2-0: 111, required ++# bit3 : 1 , MBUS Burst Chop disabled ++# bit6-4: 111, required ++# bit7 : 0 ++# bit8 : 1 , add writepath sample stage, must be 1 for DDR freq >= 300MHz ++# 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 0xFFD01504 0x0FFFFFF1 # CS[0]n Size ++#DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 ++# bit0: 1, Window enabled ++# bit1: 0, Write Protect disabled ++# bit3-2: 00, CS0 hit selected ++# bit23-4: ones, required ++# bit31-24: 0x0F, Size (i.e. 256MB) ++ ++DATA 0xFFD01508 0x10000000 # CS[1]n Base address to 256Mb ++DATA 0xFFD0150C 0x00000000 # CS[2]n Size, window disabled KAZ z 400db ++DATA 0xFFD01514 0x00000000 # CS[3]n Size, window disabled ++ ++DATA 0xFFD0151C 0x00000000 # DDR ODT Control (Low) ++DATA 0xFFD01494 0x00120012 # DDR ODT Control (High) KAZ z nowy STATIC_SDRAM_ODT_CTRL_LOW ++# bit1-0: 00, ODT0 controlled by ODT Control (low) register above ++# bit3-2: 01, ODT1 active NEVER! ++# bit31-4: zero, required ++ ++DATA 0xFFD01498 0x00000000 # CPU ODT Control KAZ STATIC_SDRAM_ODT_CTRL_HI ++DATA 0xFFD0149C 0x0000E403 # DDR Initialization Control KAZ STATIC_SDRAM_DUNIT_ODT_CTRL ++DATA 0xFFD01480 0x00000001 # DDR Initialization Control ++#bit0=1, enable DDR init upon this register write ++ ++# End of Header extension ++DATA 0x0 0x0 +diff --git a/board/zyxel/nsa310/nsa310.c b/board/zyxel/nsa310/nsa310.c +new file mode 100644 +index 0000000..eee3f1a +--- /dev/null ++++ b/board/zyxel/nsa310/nsa310.c +@@ -0,0 +1,190 @@ ++/* ++ * Copyright (C) 2013 Rafal Kazmierowski ++ * ++ * Based on NSA320.c Peter Schildmann ++ * originally written by ++ * 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, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ++ * MA 02110-1301 USA ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include "nsa310.h" ++ ++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(NSA310_VAL_LOW, NSA310_VAL_HIGH, ++ NSA310_OE_LOW, NSA310_OE_HIGH); ++ ++ /* Multi-Purpose Pins Functionality configuration */ ++ /* (all LEDs & power off active high) */ ++ static const 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, /* PCF8563 RTC chip */ ++ MPP9_TW_SCK, /* connected to TWSI */ ++ MPP10_UART0_TXD, ++ MPP11_UART0_RXD, ++ MPP12_GPO, /* SATA2 LED (green) */ ++ MPP13_GPIO, /* SATA2 LED (red) */ ++ MPP14_GPIO, /* MCU DATA pin (in) */ ++ MPP15_GPIO, /* USB LED (green) */ ++ MPP16_GPIO, /* MCU CLK pin (out) */ ++ MPP17_GPIO, /* MCU ACT pin (out) */ ++ MPP18_NF_IO0, ++ MPP19_NF_IO1, ++ MPP20_GPIO, ++ MPP21_GPIO, /* USB LED (red)-Power*/ ++ MPP22_GPIO, ++ MPP23_GPIO, ++ MPP24_GPIO, ++ MPP25_GPIO, ++ MPP26_GPIO, ++ MPP27_GPIO, ++ MPP28_GPIO, /* SYS LED (green) */ ++ MPP29_GPIO, /* SYS LED (red) */ ++ MPP30_GPIO, ++ MPP31_GPIO, ++ MPP32_GPIO, ++ MPP33_GPIO, ++ MPP34_GPIO, ++ MPP35_GPIO, ++ MPP36_GPIO, /* Reset button */ ++ MPP37_GPIO, /* Copy button */ ++ MPP38_GPIO, /* VID B0 */ ++ MPP39_GPIO, /* COPY LED (green) */ ++ MPP40_GPIO, /* COPY LED (red) */ ++ MPP41_GPIO, /* SATA1 LED (green) */ ++ MPP42_GPIO, /* SATA1 LED (red) */ ++ MPP43_GPIO, /* HTP pin */ ++ MPP44_GPIO, /* Buzzer */ ++ MPP45_GPIO, /* VID B1 */ ++ MPP46_GPIO, /* Power button */ ++ MPP47_GPIO, /* Power resume data */ ++ MPP48_GPIO, /* Power off */ ++ MPP49_GPIO, /* Power resume clock */ ++ 0 ++ }; ++ kirkwood_mpp_conf(kwmpp_config,NULL); ++ return 0; ++} ++ ++int board_init(void) ++{ ++ /* address of boot parameters */ ++ gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100; ++ ++ return 0; ++} ++ ++#ifdef CONFIG_RESET_PHY_R ++/* Configure and enable MV88E1318 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", ++ __FUNCTION__); ++ return; ++ } ++ ++ /* Set RGMII delay */ ++ miiphy_write(name, devadr, MV88E1318_PGADR_REG, 2); ++ miiphy_read(name, devadr, MV88E1318_MAC_CTRL_REG, ®); ++ reg |= (MV88E1318_RGMII_RXTM_CTRL | MV88E1318_RGMII_TXTM_CTRL); ++ miiphy_write(name, devadr, MV88E1318_MAC_CTRL_REG, reg); ++ miiphy_write(name, devadr, MV88E1318_PGADR_REG, 0); ++ ++ /* reset the phy */ ++ miiphy_reset(name, devadr); ++ ++ printf("MV88E1318 PHY initialized on %s\n", name); ++} ++#endif /* CONFIG_RESET_PHY_R */ ++ ++#ifdef CONFIG_SHOW_BOOT_PROGRESS ++void show_boot_progress(int val) ++{ ++ struct kwgpio_registers *gpio0 = (struct kwgpio_registers *)MVEBU_GPIO0_BASE; ++ u32 dout0 = readl(&gpio0->dout); ++ u32 blen0 = readl(&gpio0->blink_en); ++ ++ struct kwgpio_registers *gpio1 = (struct kwgpio_registers *)MVEBU_GPIO1_BASE; ++ u32 dout1 = readl(&gpio1->dout); ++ u32 blen1 = readl(&gpio1->blink_en); ++ ++ switch (val) { ++ case BOOTSTAGE_ID_DECOMP_IMAGE: ++ writel(blen0 & ~(SYS_GREEN_LED | SYS_RED_LED), &gpio0->blink_en); ++ writel((dout0 & ~SYS_GREEN_LED) | SYS_RED_LED, &gpio0->dout); ++ break; ++ case BOOTSTAGE_ID_RUN_OS: ++ writel(dout0 & ~SYS_RED_LED, &gpio0->dout); ++ writel(blen0 | SYS_GREEN_LED, &gpio0->blink_en); ++ break; ++ case BOOTSTAGE_ID_NET_START: ++ writel(dout1 & ~COPY_RED_LED, &gpio1->dout); ++ writel((blen1 & ~COPY_RED_LED) | COPY_GREEN_LED, &gpio1->blink_en); ++ break; ++ case BOOTSTAGE_ID_NET_LOADED: ++ writel(blen1 & ~(COPY_RED_LED | COPY_GREEN_LED), &gpio1->blink_en); ++ writel((dout1 & ~COPY_RED_LED) | COPY_GREEN_LED, &gpio1->dout); ++ break; ++ case -BOOTSTAGE_ID_NET_NETLOOP_OK: ++ case -BOOTSTAGE_ID_NET_LOADED: ++ writel(dout1 & ~COPY_GREEN_LED, &gpio1->dout); ++ writel((blen1 & ~COPY_GREEN_LED) | COPY_RED_LED, &gpio1->blink_en); ++ break; ++ default: ++ if (val < 0) { ++ /* error */ ++ printf("Error occured, error code = %d\n", -val); ++ writel(dout0 & ~SYS_GREEN_LED, &gpio0->dout); ++ writel(blen0 | SYS_RED_LED, &gpio0->blink_en); ++ } ++ break; ++ } ++} ++#endif +diff --git a/board/zyxel/nsa310/nsa310.h b/board/zyxel/nsa310/nsa310.h +new file mode 100644 +index 0000000..6634a4f +--- /dev/null ++++ b/board/zyxel/nsa310/nsa310.h +@@ -0,0 +1,56 @@ ++/* ++ * Copyright (C) 2013 Rafal Kazmierowski ++ * ++ * Based on Peter Schildmann ++ * and guruplug.h originally written by ++ * Siddarth Gore ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * ++ * 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., 51 Franklin Street, Fifth Floor, Boston, ++ * MA 02110-1301 USA ++ */ ++ ++#ifndef __NSA310_H ++#define __NSA310_H ++ ++/* GPIO's */ ++#define SYS_GREEN_LED (1 << 28) ++#define SYS_RED_LED (1 << 29) ++#define SATA1_GREEN_LED (1 << 41) ++#define SATA1_RED_LED (1 << 42) ++#define SATA2_GREEN_LED (1 << 12) ++#define SATA2_RED_LED (1 << 13) ++#define USB_GREEN_LED (1 << 15) ++#define USB_RED_LED (1 << 21) ++#define COPY_GREEN_LED (1 << 39) ++#define COPY_RED_LED (1 << 40) ++ ++#define NSA310_OE_LOW (0) ++#define NSA310_VAL_LOW (SYS_GREEN_LED) ++#define NSA310_OE_HIGH ((COPY_GREEN_LED | COPY_RED_LED | \ ++ SATA1_GREEN_LED | SATA1_RED_LED)) ++#define NSA310_VAL_HIGH (0) ++ ++/* PHY related */ ++#define MV88E1318_MAC_CTRL_REG 21 ++#define MV88E1318_PGADR_REG 22 ++#define MV88E1318_RGMII_TXTM_CTRL (1 << 4) ++#define MV88E1318_RGMII_RXTM_CTRL (1 << 5) ++ ++#endif /* __NSA310_H */ +diff --git a/configs/nsa310_defconfig b/configs/nsa310_defconfig +new file mode 100644 +index 0000000..d26ef35 +--- /dev/null ++++ b/configs/nsa310_defconfig +@@ -0,0 +1,34 @@ ++CONFIG_ARM=y ++CONFIG_KIRKWOOD=y ++CONFIG_TARGET_NSA310=y ++CONFIG_IDENT_STRING="\nZyXEL NSA310 1-Bay Power Media Server" ++CONFIG_BOOTDELAY=3 ++CONFIG_SYS_PROMPT="NSA310> " ++# 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_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,126 @@ ++/* Copyright (C) 2015-2016 bodhi ++ * ++ * Based on ++ * Copyright (C) 2012 Peter Schildmann ++ * ++ * Based on guruplug.h originally written by ++ * Siddarth Gore ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * ++ * 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., 51 Franklin Street, Fifth Floor, Boston, ++ * MA 02110-1301 USA ++ */ ++ ++#ifndef _CONFIG_NSA310_H ++#define _CONFIG_NSA310_H ++ ++/* ++ * High Level Configuration Options (easy to change) ++ */ ++#define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */ ++#define CONFIG_KW88F6281 /* SOC Name */ ++ ++#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ ++ ++/* ++ * Misc Configuration Options ++ */ ++#define CONFIG_SHOW_BOOT_PROGRESS 1 /* boot progess display (LED's) */ ++ ++/* ++ * 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 ++ ++/* max 4k env size is enough, but in case of nand ++ * it has to be rounded to sector size ++ */ ++#define CONFIG_ENV_SIZE 0x20000 /* 128k */ ++#define CONFIG_ENV_ADDR 0xc0000 ++#define CONFIG_ENV_OFFSET 0xc0000 /* env starts here */ ++ ++/* ++ * Default environment variables ++ */ ++#define CONFIG_BOOTCOMMAND \ ++ "ubi part ubi; " \ ++ "ubi read 0x800000 kernel; " \ ++ "bootm 0x800000" ++ ++#define CONFIG_MTDPARTS \ ++ "mtdparts=orion_nand:" \ ++ "0x0c0000(uboot)," \ ++ "0x80000(uboot_env)," \ ++ "0x7ec0000(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_NET_MULTI ++#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ ++#define CONFIG_PHY_BASE_ADR 0x1 ++#define CONFIG_RESET_PHY_R ++#endif /* CONFIG_CMD_NET */ ++ ++/* ++ * SATA Driver configuration ++ */ ++#ifdef CONFIG_MVSATA_IDE ++#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET ++#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET ++#endif /* CONFIG_MVSATA_IDE */ ++ ++/* ++ * File system ++ */ ++#define CONFIG_JFFS2_NAND ++#define CONFIG_JFFS2_LZO ++#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ ++#define CONFIG_MTD_PARTITIONS ++ ++/* ++ * Date Time ++ */ ++#ifdef CONFIG_CMD_DATE ++#define CONFIG_RTC_MV ++#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 new file mode 100644 index 000000000..4b4356e5d --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch @@ -0,0 +1,683 @@ +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 +@@ -62,6 +62,9 @@ config TARGET_NSA310 + config TARGET_NSA310S + bool "Zyxel NSA310S" + ++config TARGET_NSA325 ++ bool "Zyxel NSA325 board" ++ + endchoice + + config SYS_SOC +@@ -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 +index 0000000..1fe5ead +--- /dev/null ++++ b/board/zyxel/nsa325/Kconfig +@@ -0,0 +1,12 @@ ++if TARGET_NSA325 ++ ++config SYS_BOARD ++ default "nsa325" ++ ++config SYS_VENDOR ++ default "zyxel" ++ ++config SYS_CONFIG_NAME ++ default "nsa325" ++ ++endif +diff --git a/board/zyxel/nsa325/MAINTAINERS b/board/zyxel/nsa325/MAINTAINERS +new file mode 100644 +index 0000000..130b4d9 +--- /dev/null ++++ b/board/zyxel/nsa325/MAINTAINERS +@@ -0,0 +1,6 @@ ++NSA325 BOARD ++M: Alberto Bursi ++S: Maintained ++F: board/zyxel/nsa325/ ++F: include/configs/nsa325.h ++F: configs/nsa325_defconfig +diff --git a/board/zyxel/nsa325/Makefile b/board/zyxel/nsa325/Makefile +new file mode 100644 +index 0000000..4ee953b +--- /dev/null ++++ b/board/zyxel/nsa325/Makefile +@@ -0,0 +1,13 @@ ++# ++# (C) Copyright 2015 bodhi ++# ++# Based on ++# (C) Copyright 2009 ++# Marvell Semiconductor ++# Written-by: Prafulla Wadaskar ++# ++# SPDX-License-Identifier: GPL-2.0+ ++# ++ ++obj-y := nsa325.o ++ +diff --git a/board/zyxel/nsa325/kwbimage.cfg b/board/zyxel/nsa325/kwbimage.cfg +new file mode 100644 +index 0000000..5a27d38 +--- /dev/null ++++ b/board/zyxel/nsa325/kwbimage.cfg +@@ -0,0 +1,78 @@ ++# Copyright (C) 2015 bodhi ++# ++# Extracted from Zyxel GPL source for u-boot-1.1.4_NSA325v2 ++# ++# 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., 51 Franklin Street, Fifth Floor, Boston, ++# MA 02110-1301 USA ++# ++# Refer docs/README.kwimage for more details about how-to configure ++# and create kirkwood boot image ++# ++ ++# Boot Media configurations ++#BOOT_FROM uart ++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 ++DATA 0xFFD100e0 0x1b1b1b9b ++ ++#Dram initalization ++DATA 0xFFD01400 0x4301503E # DDR Configuration register ++DATA 0xFFD01404 0xB9843000 # DDR Controller Control Low ++DATA 0xFFD01408 0x33137777 # DDR Timing (Low) ++DATA 0xFFD0140C 0x16000C55 # DDR Timing (High) ++DATA 0xFFD01410 0x04000000 # DDR Address Control ++DATA 0xFFD01414 0x00000000 # DDR Open Pages Control ++DATA 0xFFD01418 0x00000000 # DDR Operation ++DATA 0xFFD0141C 0x00000672 # DDR Mode ++DATA 0xFFD01420 0x00000004 # DDR Extended Mode ++DATA 0xFFD01424 0x0000F14F # DDR Controller Control High ++DATA 0xFFD01428 0x000D6720 # DDR3 ODT Read Timing ++DATA 0xFFD0147C 0x0000B571 # DDR2 ODT Write Timing ++DATA 0xFFD01504 0x1FFFFFF1 # CS[0]n Size ++DATA 0xFFD01508 0x20000000 # CS[1]n Base address to 512Mb ++DATA 0xFFD0150C 0x1FFFFFF4 # CS[1]n Size 512Mb Window enabled for CS1 ++DATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled ++DATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled ++DATA 0xFFD01494 0x00120000 # DDR ODT Control (Low) ++DATA 0xFFD01498 0x00000000 # DDR ODT Control (High) ++DATA 0xFFD0149C 0x0000E803 # CPU ODT Control ++ ++DATA 0xFFD015D0 0x00000630 ++DATA 0xFFD015D4 0x00000046 ++DATA 0xFFD015D8 0x00000008 ++DATA 0xFFD015DC 0x00000000 ++DATA 0xFFD015E0 0x00000023 ++DATA 0xFFD015E4 0x00203C18 ++DATA 0xFFD01620 0x00384800 ++DATA 0xFFD01480 0x00000001 ++DATA 0xFFD20134 0x66666666 ++DATA 0xFFD20138 0x00066666 ++ ++#Disable nsa325 hardware watchdog to allow successful kwbooting ++DATA 0xFFD10100 0x00004000 # set GPIO 14 to high to disable the watchdog ++DATA 0xFFD10104 0xFFFFBFFF # set GPIO 14 to output (to block any other input to it) ++ ++# End of Header extension ++DATA 0x0 0x0 ++ +diff --git a/board/zyxel/nsa325/nsa325.c b/board/zyxel/nsa325/nsa325.c +new file mode 100644 +index 0000000..4cd1c0f +--- /dev/null ++++ b/board/zyxel/nsa325/nsa325.c +@@ -0,0 +1,265 @@ ++/* ++ * Copyright (C) 2015 bodhi ++ * ++ * Based on ++ * Copyright (C) 2014 Jason Plum ++ * ++ * Based on nsa320.c originall written by ++ * Copyright (C) 2012 Peter Schildmann ++ * ++ * Based on guruplug.c originally written by ++ * Siddarth Gore ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * ++ * 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., 51 Franklin Street, Fifth Floor, Boston, ++ * MA 02110-1301 USA ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "nsa325.h" ++#include ++ ++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(NSA325_VAL_LOW, NSA325_VAL_HIGH, ++ NSA325_OE_LOW, NSA325_OE_HIGH); ++ ++ /* Multi-Purpose Pins Functionality configuration */ ++ /* (all LEDs & power off active high) */ ++ 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, /* PCF8563 RTC chip */ ++ MPP9_TW_SCK, /* connected to TWSI */ ++ MPP10_UART0_TXD, ++ MPP11_UART0_RXD, ++ MPP12_GPO, /* HDD2 LED (green) */ ++ MPP13_GPIO, /* HDD2 LED (red) */ ++ MPP14_GPIO, /* MCU DATA pin (in) */ ++ MPP15_GPIO, /* USB LED (green) */ ++ MPP16_GPIO, /* MCU CLK pin (out) */ ++ MPP17_GPIO, /* MCU ACT pin (out) */ ++ MPP18_NF_IO0, ++ MPP19_NF_IO1, ++ MPP20_GPIO, ++ MPP21_GPIO, /* USB power */ ++ MPP22_GPIO, ++ MPP23_GPIO, ++ MPP24_GPIO, ++ MPP25_GPIO, ++ MPP26_GPIO, ++ MPP27_GPIO, ++ MPP28_GPIO, /* SYS LED (green) */ ++ MPP29_GPIO, /* SYS LED (orange) */ ++ MPP30_GPIO, ++ MPP31_GPIO, ++ MPP32_GPIO, ++ MPP33_GPIO, ++ MPP34_GPIO, ++ MPP35_GPIO, ++ MPP36_GPIO, /* reset button */ ++ MPP37_GPIO, /* copy button */ ++ MPP38_GPIO, /* VID B0 */ ++ MPP39_GPIO, /* COPY LED (green) */ ++ MPP40_GPIO, /* COPY LED (red) */ ++ MPP41_GPIO, /* HDD1 LED (green) */ ++ MPP42_GPIO, /* HDD1 LED (red) */ ++ MPP43_GPIO, /* HTP pin */ ++ MPP44_GPIO, /* buzzer */ ++ MPP45_GPIO, /* VID B1 */ ++ MPP46_GPIO, /* power button */ ++ MPP47_GPIO, /* HDD2 power */ ++ MPP48_GPIO, /* power off */ ++ 0 ++ }; ++ kirkwood_mpp_conf(kwmpp_config, NULL); ++ return 0; ++} ++ ++int board_init(void) ++{ ++ ++ /* address of boot parameters */ ++ gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100; ++ ++ /* This disables the hardware watchdog in the mcu on this board. */ ++ kw_gpio_set_valid(14, 1); ++ kw_gpio_direction_output(14, 0); ++ kw_gpio_set_value(14, 1); ++ ++ return 0; ++} ++ ++#ifdef CONFIG_RESET_PHY_R ++/* Configure and enable MV88E1318 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", ++ __FUNCTION__); ++ return; ++ } ++ ++ /* Set RGMII delay */ ++ miiphy_write(name, devadr, MV88E1318_PGADR_REG, MV88E1318_MAC_CTRL_PG); ++ miiphy_read(name, devadr, MV88E1318_MAC_CTRL_REG, ®); ++ reg |= (MV88E1318_RGMII_RXTM_CTRL | MV88E1318_RGMII_TXTM_CTRL); ++ miiphy_write(name, devadr, MV88E1318_MAC_CTRL_REG, reg); ++ miiphy_write(name, devadr, MV88E1318_PGADR_REG, 0); ++ ++ /* reset the phy */ ++ miiphy_reset(name, devadr); ++ ++ /* The ZyXEL NSA325 uses the 88E1310S Alaska (interface identical to 88E1318) */ ++ /* and has an MCU attached to the LED[2] via tristate interrupt */ ++ reg = 0; ++ ++ /* switch to LED register page */ ++ miiphy_write(name, devadr, MV88E1318_PGADR_REG, MV88E1318_LED_PG); ++ /* read out LED polarity register */ ++ miiphy_read(name, devadr, MV88E1318_LED_POL_REG, ®); ++ /* clear 4, set 5 - LED2 low, tri-state */ ++ reg &= ~(MV88E1318_LED2_4); ++ reg |= (MV88E1318_LED2_5); ++ /* write back LED polarity register */ ++ miiphy_write(name, devadr, MV88E1318_LED_POL_REG, reg); ++ /* jump back to page 0, per the PHY chip documenation. */ ++ miiphy_write(name, devadr, MV88E1318_PGADR_REG, 0); ++ ++ /* Set the phy back to auto-negotiation mode. Onboard mcu sets it as 10Mbits/s on poweroff for WoL function */ ++ miiphy_write(name, devadr, 0x4, 0x1e1); ++ miiphy_write(name, devadr, 0x9, 0x300); ++ /* Downshift */ ++ miiphy_write(name, devadr, 0x10, 0x3860); ++ miiphy_write(name, devadr, 0x0, 0x9140); ++ ++ printf("MV88E1318 PHY initialized on %s\n", name); ++ ++} ++#endif /* CONFIG_RESET_PHY_R */ ++ ++#ifdef CONFIG_SHOW_BOOT_PROGRESS ++void show_boot_progress(int val) ++{ ++ struct kwgpio_registers *gpio0 = (struct kwgpio_registers *)MVEBU_GPIO0_BASE; ++ u32 dout0 = readl(&gpio0->dout); ++ u32 blen0 = readl(&gpio0->blink_en); ++ ++ struct kwgpio_registers *gpio1 = (struct kwgpio_registers *)MVEBU_GPIO1_BASE; ++ u32 dout1 = readl(&gpio1->dout); ++ u32 blen1 = readl(&gpio1->blink_en); ++ ++ switch (val) { ++ case BOOTSTAGE_ID_DECOMP_IMAGE: ++ writel(blen0 & ~(SYS_GREEN_LED | SYS_ORANGE_LED), &gpio0->blink_en); ++ writel((dout0 & ~SYS_GREEN_LED) | SYS_ORANGE_LED, &gpio0->dout); ++ break; ++ case BOOTSTAGE_ID_RUN_OS: ++ writel(dout0 & ~SYS_ORANGE_LED, &gpio0->dout); ++ writel(blen0 | SYS_GREEN_LED, &gpio0->blink_en); ++ break; ++ case BOOTSTAGE_ID_NET_START: ++ writel(dout1 & ~COPY_RED_LED, &gpio1->dout); ++ writel((blen1 & ~COPY_RED_LED) | COPY_GREEN_LED, &gpio1->blink_en); ++ break; ++ case BOOTSTAGE_ID_NET_LOADED: ++ writel(blen1 & ~(COPY_RED_LED | COPY_GREEN_LED), &gpio1->blink_en); ++ writel((dout1 & ~COPY_RED_LED) | COPY_GREEN_LED, &gpio1->dout); ++ break; ++ case -BOOTSTAGE_ID_NET_NETLOOP_OK: ++ case -BOOTSTAGE_ID_NET_LOADED: ++ writel(dout1 & ~COPY_GREEN_LED, &gpio1->dout); ++ writel((blen1 & ~COPY_GREEN_LED) | COPY_RED_LED, &gpio1->blink_en); ++ break; ++ default: ++ if (val < 0) { ++ /* error */ ++ printf("Error occured, error code = %d\n", -val); ++ writel(dout0 & ~SYS_GREEN_LED, &gpio0->dout); ++ writel(blen0 | SYS_ORANGE_LED, &gpio0->blink_en); ++ } ++ break; ++ } ++} ++#endif ++ ++#if defined(CONFIG_KIRKWOOD_GPIO) ++/* Return GPIO button status */ ++/* ++un-pressed: ++ gpio-36 (Reset Button ) in hi (act lo) - IRQ edge (clear ) ++ gpio-37 (Copy Button ) in hi (act lo) - IRQ edge (clear ) ++ gpio-46 (Power Button ) in lo (act hi) - IRQ edge (clear ) ++pressed ++ gpio-36 (Reset Button ) in lo (act hi) - IRQ edge (clear ) ++ gpio-37 (Copy Button ) in lo (act hi) - IRQ edge (clear ) ++ gpio-46 (Power Button ) in hi (act lo) - IRQ edge (clear ) ++*/ ++ ++static int ++do_read_button(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ++{ ++ if (strcmp(argv[1], "power") == 0) { ++ kw_gpio_set_valid(BTN_POWER, GPIO_INPUT_OK); ++ kw_gpio_direction_input(BTN_POWER); ++ return !kw_gpio_get_value(BTN_POWER); ++ } ++ else if (strcmp(argv[1], "reset") == 0) ++ return kw_gpio_get_value(BTN_RESET); ++ else if (strcmp(argv[1], "copy") == 0) ++ return kw_gpio_get_value(BTN_COPY); ++ else ++ return -1; ++} ++ ++ ++U_BOOT_CMD(button, 2, 0, do_read_button, ++ "Return GPIO button status 0=off 1=on", ++ "- button power|reset|copy: test buttons states\n" ++); ++ ++#endif ++ +diff --git a/board/zyxel/nsa325/nsa325.h b/board/zyxel/nsa325/nsa325.h +new file mode 100644 +index 0000000..996653e +--- /dev/null ++++ b/board/zyxel/nsa325/nsa325.h +@@ -0,0 +1,77 @@ ++/* ++ * Copyright (C) 2014 Jason Plum ++ * ++ * Based on nsa320.h originall written by ++ * Copyright (C) 2012 Peter Schildmann ++ * ++ * Based on guruplug.h originally written by ++ * Siddarth Gore ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * ++ * 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., 51 Franklin Street, Fifth Floor, Boston, ++ * MA 02110-1301 USA ++ */ ++ ++#ifndef __NSA325_H ++#define __NSA325_H ++ ++/* low GPIO's */ ++#define HDD2_GREEN_LED (1 << 12) ++#define HDD2_RED_LED (1 << 13) ++#define USB_GREEN_LED (1 << 15) ++#define USB_POWER (1 << 21) ++#define SYS_GREEN_LED (1 << 28) ++#define SYS_ORANGE_LED (1 << 29) ++ ++#define PIN_USB_GREEN_LED 15 ++#define PIN_USB_POWER 21 ++ ++#define NSA325_OE_LOW (~(HDD2_GREEN_LED | HDD2_RED_LED | \ ++ USB_GREEN_LED | USB_POWER | \ ++ SYS_GREEN_LED | SYS_ORANGE_LED)) ++#define NSA325_VAL_LOW (SYS_GREEN_LED | USB_POWER) ++ ++/* high GPIO's */ ++#define COPY_GREEN_LED (1 << 7) ++#define COPY_RED_LED (1 << 8) ++#define HDD1_GREEN_LED (1 << 9) ++#define HDD1_RED_LED (1 << 10) ++#define HDD2_POWER (1 << 15) ++#define WATCHDOG_SIGNAL (1 << 14) ++ ++#define NSA325_OE_HIGH (~(COPY_GREEN_LED | COPY_RED_LED | \ ++ HDD1_GREEN_LED | HDD1_RED_LED | HDD2_POWER | WATCHDOG_SIGNAL )) ++#define NSA325_VAL_HIGH (WATCHDOG_SIGNAL | HDD2_POWER) ++ ++/* PHY related */ ++#define MV88E1318_PGADR_REG 22 ++#define MV88E1318_MAC_CTRL_PG 2 ++#define MV88E1318_MAC_CTRL_REG 21 ++#define MV88E1318_RGMII_TXTM_CTRL (1 << 4) ++#define MV88E1318_RGMII_RXTM_CTRL (1 << 5) ++#define MV88E1318_LED_PG 3 ++#define MV88E1318_LED_POL_REG 17 ++#define MV88E1318_LED2_4 (1 << 4) ++#define MV88E1318_LED2_5 (1 << 5) ++ ++#define BTN_POWER 46 ++#define BTN_RESET 36 ++#define BTN_COPY 37 ++ ++#endif /* __NSA325_H */ +diff --git a/configs/nsa325_defconfig b/configs/nsa325_defconfig +new file mode 100644 +index 0000000..48e09cc +--- /dev/null ++++ b/configs/nsa325_defconfig +@@ -0,0 +1,34 @@ ++CONFIG_ARM=y ++CONFIG_KIRKWOOD=y ++CONFIG_TARGET_NSA325=y ++CONFIG_IDENT_STRING="\nZyXEL NSA325 2-Bay Power Media Server" ++CONFIG_BOOTDELAY=3 ++CONFIG_SYS_PROMPT="NSA325> " ++# 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_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,129 @@ ++/* ++ * (C) Copyright 2016 bodhi ++ * ++ * Based on ++ * Copyright (C) 2014 Jason Plum ++ * Based on ++ * Copyright (C) 2012 Peter Schildmann ++ * ++ * Based on guruplug.h originally written by ++ * Siddarth Gore ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * ++ * 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., 51 Franklin Street, Fifth Floor, Boston, ++ * MA 02110-1301 USA ++ */ ++ ++#ifndef _CONFIG_NSA325_H ++#define _CONFIG_NSA325_H ++ ++/* ++ * High Level Configuration Options (easy to change) ++ */ ++#define CONFIG_FEROCEON_88FR131 1 /* CPU Core subversion */ ++#define CONFIG_KW88F6281 1 /* SOC Name */ ++ ++#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ ++ ++/* ++ * Misc Configuration Options ++ */ ++#define CONFIG_SHOW_BOOT_PROGRESS 1 /* boot progess display (LED's) */ ++ ++/* ++ * 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 ++/* ++ * max 4k env size is enough, but in case of nand ++ * it has to be rounded to sector size ++ */ ++#define CONFIG_ENV_SIZE 0x20000 /* 128k */ ++#define CONFIG_ENV_ADDR 0xc0000 ++#define CONFIG_ENV_OFFSET 0xc0000 /* env starts here */ ++ ++/* ++ * Default environment variables ++ */ ++#define CONFIG_BOOTCOMMAND \ ++ "ubi part ubi; " \ ++ "ubi read 0x800000 kernel; " \ ++ "bootm 0x800000" ++ ++#define CONFIG_MTDPARTS \ ++ "mtdparts=orion_nand:" \ ++ "0x0c0000(uboot)," \ ++ "0x80000(uboot_env)," \ ++ "0x7ec0000(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_MVGBE_PORTS {1, 0} /* enable port 0 only */ ++#define CONFIG_PHY_BASE_ADR 0x1 ++#define CONFIG_NETCONSOLE ++#endif /* CONFIG_CMD_NET */ ++ ++/* ++ * SATA Driver configuration ++ */ ++#ifdef CONFIG_MVSATA_IDE ++#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET ++#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET ++#endif /* CONFIG_MVSATA_IDE */ ++ ++/* ++ * File system ++ */ ++#define CONFIG_JFFS2_NAND ++#define CONFIG_JFFS2_LZO ++#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ ++#define CONFIG_MTD_PARTITIONS ++ ++/* ++ * Date Time ++ */ ++#ifdef CONFIG_CMD_DATE ++#define CONFIG_RTC_MV ++#endif /* CONFIG_CMD_DATE */ ++ ++#define CONFIG_KIRKWOOD_GPIO /* Enable GPIO Support */ ++ ++#endif /* _CONFIG_NSA325_H */ 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 000000000..d2daf0b66 --- /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 07d65de17..94d62cee8 100644 --- a/package/boot/uboot-kirkwood/patches/110-dockstar.patch +++ b/package/boot/uboot-kirkwood/patches/110-dockstar.patch @@ -1,14 +1,14 @@ --- a/include/configs/dockstar.h +++ b/include/configs/dockstar.h -@@ -31,6 +31,7 @@ - * Commands configuration - */ - #define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ +@@ -19,6 +19,7 @@ + #define CONFIG_KW88F6281 1 /* SOC Name */ + #define CONFIG_MACH_DOCKSTAR /* Machine type */ + #define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ +#define CONFIG_SYS_MVFS - #define CONFIG_CMD_ENV - #define CONFIG_CMD_NAND + /* -@@ -53,29 +54,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 */ @@ -26,11 +26,12 @@ - "ubifsload 0x800000 ${kernel}; " \ - "ubifsload 0x1100000 ${initrd}; " \ - "bootm 0x800000 0x1100000" +- +-#define CONFIG_MTDPARTS "mtdparts=orion_nand:1m(uboot),-(root)\0" + "ubi part ubi; " \ + "ubi read 0x800000 kernel; " \ + "bootm 0x800000" - --#define CONFIG_MTDPARTS "mtdparts=orion_nand:1m(uboot),-(root)\0" ++ +#define CONFIG_MTDPARTS \ + "mtdparts=orion_nand:" \ + "0xe0000@0x0(uboot)," \ diff --git a/package/boot/uboot-kirkwood/patches/120-iconnect.patch b/package/boot/uboot-kirkwood/patches/120-iconnect.patch index 102a147c2..bd1dab818 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 -@@ -59,30 +59,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 -@@ -7,6 +7,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 f2ba8137a..58db8c8c8 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 -@@ -62,27 +62,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 f80346773..5c8ff35be 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 -@@ -54,23 +54,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 46a6ab561..88b833072 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 -@@ -87,20 +87,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 37f30d0a5..04614f77c 100644 --- a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch +++ b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch @@ -1,8 +1,8 @@ --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig -@@ -74,4 +74,7 @@ source "board/Seagate/goflexhome/Kconfig - 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" @@ -10,16 +10,16 @@ endif --- a/include/configs/dockstar.h +++ b/include/configs/dockstar.h -@@ -98,4 +98,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 -@@ -108,4 +108,6 @@ +@@ -94,4 +94,6 @@ #define CONFIG_RTC_MV #endif /* CONFIG_CMD_DATE */ @@ -28,16 +28,16 @@ #endif /* _CONFIG_IB62x0_H */ --- a/include/configs/iconnect.h +++ b/include/configs/iconnect.h -@@ -103,4 +103,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,28 +71,98 @@ +#endif /* __OPENWRT_KIRKWOOD_COMMON_H */ --- a/include/configs/pogo_e02.h +++ b/include/configs/pogo_e02.h -@@ -99,4 +99,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 -@@ -109,4 +109,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 -@@ -122,4 +122,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 +@@ -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 cbebe91c2..5493737d3 100644 --- a/package/boot/uboot-lantiq/Makefile +++ b/package/boot/uboot-lantiq/Makefile @@ -11,336 +11,328 @@ PKG_NAME:=u-boot PKG_VERSION:=2013.10 PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot PKG_HASH:=0d71e62beb952b41ebafb20a7ee4df2f960db64c31b054721ceb79ff14014c55 -PKG_TARGETS:=bin - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - -PKG_BUILD_PARALLEL:=1 FIRMWARE_LANTIQ_SOURCE:=$(TOPDIR)/target/linux/lantiq/files/firmware/lantiq +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= - SOC:= +define U-Boot/Default + BUILD_TARGET:=lantiq DDR_SETTINGS:= - IMAGE:= - DEPS:= endef -define uboot/arv4519pw_ram - TITLE:=U-Boot for Arcadyan arv4519pw (RAM) - SOC:=danube +define U-Boot/arv4519pw_ram + NAME:=Arcadyan arv4519pw (RAM) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv4519pw DDR_SETTINGS:=board/arcadyan/arv4519pw/ddr_settings.h - DEPS:=@TARGET_lantiq_xway endef -define uboot/arv4519pw_nor - TITLE:=U-Boot for Arcadyan arv4519pw (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv4519pw_nor + NAME:=Arcadyan arv4519pw (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv4519pw endef -define uboot/arv4519pw_brn - TITLE:=U-Boot for Arcadyan arv4519pw (BRN) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv4519pw_brn + NAME:=Arcadyan arv4519pw (BRN) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv4519pw endef -define uboot/arv7506pw11_ram - TITLE:=U-Boot for Arcadyan ARV7506PW11 (RAM) - SOC:=danube +define U-Boot/arv7506pw11_ram + NAME:=Arcadyan ARV7506PW11 (RAM) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv7506pw11 DDR_SETTINGS:=board/arcadyan/arv7506pw11/ddr_settings.h - DEPS:=@TARGET_lantiq_xway endef -define uboot/arv7506pw11_nor - TITLE:=U-Boot for Arcadyan ARV7506PW11 (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv7506pw11_nor + NAME:=Arcadyan ARV7506PW11 (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv7506pw11 endef -define uboot/arv7506pw11_brn - TITLE:=U-Boot for Arcadyan ARV7506PW11 (BRN) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv7506pw11_brn + NAME:=Arcadyan ARV7506PW11 (BRN) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv7506pw11 endef -define uboot/arv7510pw_ram - TITLE:=U-Boot for Arcadyan arv7510pw (RAM) - SOC:=danube +define U-Boot/arv7510pw_ram + NAME:=Arcadyan arv7510pw (RAM) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv4510pw DDR_SETTINGS:=board/arcadyan/arv7510pw/ddr_settings.h - DEPS:=@TARGET_lantiq_xway endef -define uboot/arv7510pw_nor - TITLE:=U-Boot for Arcadyan arv7510pw (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv7510pw_nor + NAME:=Arcadyan arv7510pw (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv4510pw endef -define uboot/arv7510pw_brn - TITLE:=U-Boot for Arcadyan arv7510pw (BRN) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv7510pw_brn + NAME:=Arcadyan arv7510pw (BRN) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv4510pw endef -define uboot/arv7510pw22_ram - TITLE:=U-Boot for Arcadyan arv7510pw22 (RAM) - SOC:=danube +define U-Boot/arv7510pw22_ram + NAME:=Arcadyan arv7510pw22 (RAM) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv7510pw22 DDR_SETTINGS:=board/arcadyan/arv7510pw22/ddr_settings.h - DEPS:=@TARGET_lantiq_xway endef -define uboot/arv7510pw22_nor - TITLE:=U-Boot for Arcadyan arv7510pw22 (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv7510pw22_nor + NAME:=Arcadyan arv7510pw22 (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv7510pw22 endef -define uboot/arv7510pw22_brn - TITLE:=U-Boot for Arcadyan arv7510pw22 (BRN) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv7510pw22_brn + NAME:=Arcadyan arv7510pw22 (BRN) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv7510pw22 endef -define uboot/arv7518pw_ram - TITLE:=U-Boot for Arcadyan arv7518pw (RAM) - SOC:=danube +define U-Boot/arv7518pw_ram + NAME:=Arcadyan arv7518pw (RAM) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv7518pw DDR_SETTINGS:=board/arcadyan/arv7518pw/ddr_settings.h - DEPS:=@TARGET_lantiq_xway endef -define uboot/arv7518pw_nor - TITLE:=U-Boot for Arcadyan arv7518pw (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv7518pw_nor + NAME:=Arcadyan arv7518pw (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv7518pw endef -define uboot/arv7518pw_brn - TITLE:=U-Boot for Arcadyan arv7518pw (BRN) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv7518pw_brn + NAME:=Arcadyan arv7518pw (BRN) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv7518pw endef -define uboot/arv752dpw_ram - TITLE:=U-Boot for Arcadyan arv752dpw (RAM) - SOC:=danube +define U-Boot/arv752dpw_ram + NAME:=Arcadyan arv752dpw (RAM) + BUILD_SUBTARGET:=xway DDR_SETTINGS:=board/arcadyan/arv752dpw/ddr_settings.h - DEPS:=@TARGET_lantiq_xway + BUILD_DEVICES:=arcadyan_arv752dpw endef -define uboot/arv752dpw_nor - TITLE:=U-Boot for Arcadyan arv752dpw (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv752dpw_nor + NAME:=Arcadyan arv752dpw (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv752dpw endef -define uboot/arv752dpw_brn - TITLE:=U-Boot for Arcadyan arv752dpw (BRN) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv752dpw_brn + NAME:=Arcadyan arv752dpw (BRN) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv752dpw endef -define uboot/arv752dpw22_ram - TITLE:=U-Boot for Arcadyan arv752dpw22 (RAM) - SOC:=danube +define U-Boot/arv752dpw22_ram + NAME:=Arcadyan arv752dpw22 (RAM) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv752dpw22 DDR_SETTINGS:=board/arcadyan/arv752dpw22/ddr_settings.h - DEPS:=@TARGET_lantiq_xway endef -define uboot/arv752dpw22_nor - TITLE:=U-Boot for Arcadyan arv752dpw22 (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv752dpw22_nor + NAME:=Arcadyan arv752dpw22 (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv752dpw22 endef -define uboot/arv752dpw22_brn - TITLE:=U-Boot for Arcadyan arv752dpw22 (BRN) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv752dpw22_brn + NAME:=Arcadyan arv752dpw22 (BRN) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv752dpw22 endef -define uboot/arv8539pw22_ram - TITLE:=U-Boot for Speedport W 504V Typ A (RAM) - SOC:=danube +define U-Boot/arv8539pw22_ram + NAME:=Speedport W 504V Typ A (RAM) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv8539pw22 DDR_SETTINGS:=board/arcadyan/arv8539pw22/ddr_settings.h - DEPS:=@TARGET_lantiq_xway endef -define uboot/arv8539pw22_nor - TITLE:=U-Boot for Speedport W 504V Typ A (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv8539pw22_nor + NAME:=Speedport W 504V Typ A (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv8539pw22 endef -define uboot/arv8539pw22_brn - TITLE:=U-Boot for Speedport W 504V Typ A (BRN) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv8539pw22_brn + NAME:=Speedport W 504V Typ A (BRN) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv8539pw22 endef -define uboot/gigasx76x_ram - TITLE:=U-Boot for Siemens Gigaset sx76x (RAM) - SOC:=danube +define U-Boot/gigasx76x_ram + NAME:=Siemens Gigaset sx76x (RAM) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=siemens_gigaset-sx76x DDR_SETTINGS:=board/gigaset/sx76x/ddr_settings.h - DEPS:=@TARGET_lantiq_xway endef -define uboot/gigasx76x_nor - TITLE:=U-Boot for Siemens Gigaset sx76x (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/gigasx76x_nor + NAME:=Siemens Gigaset sx76x (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=siemens_gigaset-sx76x endef -define uboot/acmp252_ram - TITLE:=U-Boot for AudioCodes MP-252 (RAM) - SOC:=danube +define U-Boot/acmp252_ram + NAME:=AudioCodes MP-252 (RAM) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=audiocodes_mp-252 DDR_SETTINGS:=board/audiocodes/acmp252/ddr_settings.h - DEPS:=@TARGET_lantiq_xway endef -define uboot/acmp252_nor - TITLE:=U-Boot for AudioCodes MP-252 (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/acmp252_nor + NAME:=AudioCodes MP-252 (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=audiocodes_mp-252 endef -define uboot/bthomehubv5a_ram - TITLE:=U-Boot for BT Home Hub 5A (RAM) - SOC:=vr9 +define U-Boot/bthomehubv5a_ram + NAME:=BT Home Hub 5A (RAM) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=bt_homehub-v5a DDR_SETTINGS:=board/bt/bthomehubv5a/ddr_settings.h - DEPS:=@TARGET_lantiq_xrx200 endef -define uboot/easy50712_ram - TITLE:=U-Boot for Lantiq EASY50712 (RAM) - SOC:=danube +define U-Boot/easy50712_ram + NAME:=Lantiq EASY50712 (RAM) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=lantiq_easy50712 DDR_SETTINGS:=board/lantiq/easy50712/ddr_settings.h - DEPS:=@TARGET_lantiq_xway endef -define uboot/easy50712_nor - TITLE:=U-Boot for Lantiq EASY50712 (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/easy50712_nor + NAME:=Lantiq EASY50712 (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=lantiq_easy50712 endef -define uboot/easy50712_norspl - TITLE:=U-Boot for Lantiq EASY50712 (NOR SPL) - SOC:=danube - IMAGE:=u-boot.ltq.lzo.norspl - DEPS:=@TARGET_lantiq_xway +define U-Boot/easy50712_norspl + NAME:=Lantiq EASY50712 (NOR SPL) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=lantiq_easy50712 + UBOOT_IMAGE:=u-boot.ltq.lzo.norspl + DEPENDS+=@BROKEN endef -define uboot/easy80920_ram - TITLE:=U-Boot for Lantiq EASY80920 (RAM) - SOC:=vr9 +define U-Boot/easy80920_ram + NAME:=Lantiq EASY80920 (RAM) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand DDR_SETTINGS:=board/lantiq/easy80920/ddr_settings.h - DEPS:=@TARGET_lantiq_xrx200 endef -define uboot/easy80920_nor - TITLE:=U-Boot for Lantiq EASY80920 (NOR) - SOC:=vr9 - DEPS:=@TARGET_lantiq_xrx200 +define U-Boot/easy80920_nor + NAME:=Lantiq EASY80920 (NOR) + BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand + BUILD_SUBTARGET:=xrx200 endef -define uboot/easy80920_norspl - TITLE:=U-Boot for Lantiq EASY80920 (NOR SPL) - SOC:=vr9 - IMAGE:=u-boot.ltq.lzo.norspl - DEPS:=@TARGET_lantiq_xrx200 +define U-Boot/easy80920_norspl + NAME:=Lantiq EASY80920 (NOR SPL) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand + UBOOT_IMAGE:=u-boot.ltq.lzo.norspl + DEPENDS+=@BROKEN endef -define uboot/easy80920_sfspl - TITLE:=U-Boot for Lantiq EASY80920 (SPI SPL) - SOC:=vr9 - IMAGE:=u-boot.ltq.lzo.sfspl - DEPS:=@TARGET_lantiq_xrx200 +define U-Boot/easy80920_sfspl + NAME:=Lantiq EASY80920 (SPI SPL) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand + UBOOT_IMAGE:=u-boot.ltq.lzo.sfspl + DEPENDS+=@BROKEN endef -define uboot/fb3370_eva - TITLE:=U-Boot for AVM FRITZ3370 (EVA) - SOC:=vr9 - DEPS:=@TARGET_lantiq_xrx200 +define U-Boot/fb3370_eva + NAME:=AVM FRITZ3370 (EVA) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=avm_fritz3370 endef -define uboot/fb3370_ram - TITLE:=U-Boot for AVM FRITZ3370 (RAM) - SOC:=vr9 +define U-Boot/fb3370_ram + NAME:=AVM FRITZ3370 (RAM) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=avm_fritz3370 DDR_SETTINGS:=board/avm/fb3370/ddr_settings.h - DEPS:=@TARGET_lantiq_xrx200 endef -define uboot/fb3370_sfspl - TITLE:=U-Boot for AVM FRITZ3370 (SPI SPL) - SOC:=vr9 - IMAGE:=u-boot.ltq.lzo.sfspl - DEPS:=@TARGET_lantiq_xrx200 +define U-Boot/fb3370_sfspl + NAME:=AVM FRITZ3370 (SPI SPL) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=avm_fritz3370 + UBOOT_IMAGE:=u-boot.ltq.lzo.sfspl + DEPENDS+=@BROKEN endef -define uboot/p2812hnufx_ram - TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (RAM) - SOC:=vr9 +define U-Boot/p2812hnufx_ram + NAME:=ZyXEL P-2812HNU-Fx (RAM) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=zyxel_p-2812hnu-f1 DDR_SETTINGS:=board/zyxel/p2812hnufx/ddr_settings.h - DEPS:=@TARGET_lantiq_xrx200 endef -define uboot/p2812hnufx_nandspl - TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (NAND SPL) - SOC:=vr9 - IMAGE:=u-boot.ltq.lzo.nandspl - DEPS:=@TARGET_lantiq_xrx200 +define U-Boot/p2812hnufx_nandspl + NAME:=ZyXEL P-2812HNU-Fx (NAND SPL) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=zyxel_p-2812hnu-f1 + UBOOT_IMAGE:=u-boot.ltq.lzo.nandspl + DEPENDS+=@BROKEN endef -define uboot/vgv7510kw22_brn - TITLE:=U-Boot for Arcadyan VGV7510KW22 (BRN) - SOC:=vr9 - DEPS:=@TARGET_lantiq_xrx200 +define U-Boot/vgv7510kw22_brn + NAME:=Arcadyan VGV7510KW22 (BRN) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=arcadyan_vgv7510kw22-nor endef -define uboot/vgv7510kw22_nor - TITLE:=U-Boot for Arcadyan VGV7510KW22 (NOR) - SOC:=vr9 - DEPS:=@TARGET_lantiq_xrx200 +define U-Boot/vgv7510kw22_nor + NAME:=Arcadyan VGV7510KW22 (NOR) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=arcadyan_vgv7510kw22-nor endef -define uboot/vgv7510kw22_ram - TITLE:=U-Boot for Arcadyan VGV7510KW22 (RAM) - SOC:=vr9 +define U-Boot/vgv7510kw22_ram + NAME:=Arcadyan VGV7510KW22 (RAM) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=arcadyan_vgv7510kw22-nor DDR_SETTINGS:=board/arcadyan/vgv7510kw22/ddr_settings.h - DEPS:=@TARGET_lantiq_xrx200 endef -define uboot/vgv7519_brn - TITLE:=U-Boot for Arcadyan VGV7519 (BRN) - SOC:=vr9 - DEPS:=@TARGET_lantiq_xrx200 +define U-Boot/vgv7519_brn + NAME:=Arcadyan VGV7519 (BRN) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn endef -define uboot/vgv7519_nor - TITLE:=U-Boot for Arcadyan VGV7519 (NOR) - SOC:=vr9 - DEPS:=@TARGET_lantiq_xrx200 +define U-Boot/vgv7519_nor + NAME:=Arcadyan VGV7519 (NOR) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn endef -define uboot/vgv7519_ram - TITLE:=U-Boot for Arcadyan VGV7519 (RAM) - SOC:=vr9 +define U-Boot/vgv7519_ram + NAME:=Arcadyan VGV7519 (RAM) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn DDR_SETTINGS:=board/arcadyan/vgv7519/ddr_settings.h - DEPS:=@TARGET_lantiq_xrx200 endef -UBOOTS:= \ +UBOOT_TARGETS:= \ arv4519pw_ram arv4519pw_nor arv4519pw_brn \ arv7506pw11_ram arv7506pw11_nor arv7506pw11_brn \ arv7510pw_ram arv7510pw_nor arv7510pw_brn \ @@ -359,25 +351,6 @@ UBOOTS:= \ vgv7510kw22_brn vgv7510kw22_nor vgv7510kw22_ram \ vgv7519_brn vgv7519_nor vgv7519_ram -define Package/uboot/template -define Package/uboot-lantiq-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=$(3) @!IN_SDK - TITLE:=$(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) - MAINTAINER:=Luka Perkov -endef -endef - -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - DEPS:=$(uboot/$(1)/DEPS) - $(call Package/uboot/template,$(1),$(TITLE),$(DEPS)) -endef - define CompressVR9Firmware $(STAGING_DIR_HOST)/bin/lzma e \ $(FIRMWARE_LANTIQ_SOURCE)/vr9_phy$(1)_a$(2)x.bin \ @@ -393,40 +366,25 @@ define Build/Prepare $(call CompressVR9Firmware,22f,2) endef -define Build/Configure - $(MAKE) -C $(PKG_BUILD_DIR) $(BUILD_VARIANT)_config -endef +UBOOT_MAKE_FLAGS := -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS) -endef +ifeq ($(SUBTARGET),xway) + SOC:=danube +else + SOC:=vr9 +endif -define Package/uboot/install/default - $(CP) \ - $(PKG_BUILD_DIR)/$(2) \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.img -endef - -define Package/uboot/install/uart +define Package/u-boot/install/uart awk -f $(PKG_BUILD_DIR)/tools/lantiq_ram_init_uart.awk \ - -v soc=$(2) $(PKG_BUILD_DIR)/$(3) \ + -v soc=$(SOC) $(PKG_BUILD_DIR)/$(DDR_SETTINGS) \ > $(PKG_BUILD_DIR)/ddr_settings perl $(PKG_BUILD_DIR)/tools/gct.pl \ $(PKG_BUILD_DIR)/ddr_settings $(PKG_BUILD_DIR)/u-boot.srec \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.asc - endef - -define Package/uboot/install/template -define Package/uboot-lantiq-$(1)/install - $(call Package/uboot/install/default,$(1),$(if $(IMAGE),$(IMAGE),u-boot.bin)) - $(if $(DDR_SETTINGS), \ - $(call Package/uboot/install/uart,$(1),$(SOC),$(DDR_SETTINGS)) \ - ) -endef + $(1)/u-boot.asc endef -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call Package/uboot/install/template,$(u))) \ - $(eval $(call BuildPackage,uboot-lantiq-$(u))) \ -) +define Package/u-boot/install + $(Package/u-boot/install/$(if $(DDR_SETTINGS),uart,default)) +endef + +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-lantiq/patches/0014-MIPS-add-support-for-Lantiq-XWAY-SoCs.patch b/package/boot/uboot-lantiq/patches/0014-MIPS-add-support-for-Lantiq-XWAY-SoCs.patch index 08133bb08..cb695ffe3 100644 --- a/package/boot/uboot-lantiq/patches/0014-MIPS-add-support-for-Lantiq-XWAY-SoCs.patch +++ b/package/boot/uboot-lantiq/patches/0014-MIPS-add-support-for-Lantiq-XWAY-SoCs.patch @@ -1419,7 +1419,7 @@ Signed-off-by: Daniel Schwierzeck + +static int spl_uncompress_lzo(struct spl_image *spl, unsigned long loadaddr) +{ -+ size_t len; ++ size_t len = CONFIG_SYS_LOAD_SIZE; + int ret; + + spl_puts("SPL: decompressing U-Boot with LZO\n"); @@ -3237,7 +3237,7 @@ Signed-off-by: Daniel Schwierzeck +} --- /dev/null +++ b/arch/mips/include/asm/arch-danube/config.h -@@ -0,0 +1,163 @@ +@@ -0,0 +1,164 @@ +/* + * Copyright (C) 2007-2010 Lantiq Deutschland GmbH + * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com @@ -3296,6 +3296,7 @@ Signed-off-by: Daniel Schwierzeck +#define CONFIG_SYS_MEMTEST_START 0x81000000 +#define CONFIG_SYS_MEMTEST_END 0x82000000 +#define CONFIG_SYS_LOAD_ADDR 0x81000000 ++#define CONFIG_SYS_LOAD_SIZE (2 * 1024 * 1024) +#define CONFIG_SYS_INIT_SP_OFFSET 0x4000 + +/* SRAM */ @@ -3475,7 +3476,7 @@ Signed-off-by: Daniel Schwierzeck +#endif /* __DANUBE_SOC_H__ */ --- /dev/null +++ b/arch/mips/include/asm/arch-vrx200/config.h -@@ -0,0 +1,187 @@ +@@ -0,0 +1,188 @@ +/* + * Copyright (C) 2010 Lantiq Deutschland GmbH + * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com @@ -3546,6 +3547,7 @@ Signed-off-by: Daniel Schwierzeck +#define CONFIG_SYS_MEMTEST_START 0x81000000 +#define CONFIG_SYS_MEMTEST_END 0x82000000 +#define CONFIG_SYS_LOAD_ADDR 0x81000000 ++#define CONFIG_SYS_LOAD_SIZE (2 * 1024 * 1024) +#define CONFIG_SYS_INIT_SP_OFFSET (32 * 1024) + +/* SRAM */ @@ -7257,7 +7259,7 @@ Signed-off-by: Daniel Schwierzeck +static struct phy_driver pef7071_driver = { + .name = "Lantiq XWAY PEF7071", + .uid = 0xd565a400, -+ .mask = 0xFFFFFFFF, ++ .mask = 0xFFFFFFF8, + .features = PHY_GBIT_FEATURES, + .config = ltq_phy_config, + .startup = ltq_phy_startup, diff --git a/package/boot/uboot-lantiq/patches/0015-MIPS-lantiq-add-support-for-Lantiq-XWAY-ARX100-SoC-f.patch b/package/boot/uboot-lantiq/patches/0015-MIPS-lantiq-add-support-for-Lantiq-XWAY-ARX100-SoC-f.patch index acda83c27..a12d2ebff 100644 --- a/package/boot/uboot-lantiq/patches/0015-MIPS-lantiq-add-support-for-Lantiq-XWAY-ARX100-SoC-f.patch +++ b/package/boot/uboot-lantiq/patches/0015-MIPS-lantiq-add-support-for-Lantiq-XWAY-ARX100-SoC-f.patch @@ -903,7 +903,7 @@ Signed-off-by: Daniel Schwierzeck #define STATUS_LANTIQ (STATUS_MIPS34K | STATUS_MIPS32_64) --- /dev/null +++ b/arch/mips/include/asm/arch-arx100/config.h -@@ -0,0 +1,175 @@ +@@ -0,0 +1,176 @@ +/* + * Copyright (C) 2007-2010 Lantiq Deutschland GmbH + * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com @@ -967,6 +967,7 @@ Signed-off-by: Daniel Schwierzeck +#define CONFIG_SYS_MEMTEST_START 0x81000000 +#define CONFIG_SYS_MEMTEST_END 0x82000000 +#define CONFIG_SYS_LOAD_ADDR 0x81000000 ++#define CONFIG_SYS_LOAD_SIZE (2 * 1024 * 1024) +#define CONFIG_SYS_INIT_SP_OFFSET (32 * 1024) + +/* SRAM */ diff --git a/package/boot/uboot-lantiq/patches/0018-tools-lantiq-add-NAND-SPL-support.patch b/package/boot/uboot-lantiq/patches/0018-tools-lantiq-add-NAND-SPL-support.patch index 471c902aa..6d1b8dc69 100644 --- a/package/boot/uboot-lantiq/patches/0018-tools-lantiq-add-NAND-SPL-support.patch +++ b/package/boot/uboot-lantiq/patches/0018-tools-lantiq-add-NAND-SPL-support.patch @@ -21,7 +21,7 @@ Signed-off-by: Daniel Schwierzeck struct args { enum image_types type; __u32 entry_addr; -+ loff_t uboot_offset; ++ off_t uboot_offset; + unsigned int page_size; const char *uboot_bin; const char *spl_bin; @@ -121,10 +121,10 @@ Signed-off-by: Daniel Schwierzeck } -static int create_sfspl(const struct args *arg) -+static int pad_to_offset(int fd, loff_t offset) ++static int pad_to_offset(int fd, off_t offset) { - int out_fd, uboot_fd, spl_fd, ret; -+ loff_t pos; ++ off_t pos; + size_t size; + ssize_t n; + __u8 *buf; diff --git a/package/boot/uboot-lantiq/patches/0022-MIPS-lantiq-add-default-openwrt-config.patch b/package/boot/uboot-lantiq/patches/0022-MIPS-lantiq-add-default-openwrt-config.patch index 3b50c981c..20bff445d 100644 --- a/package/boot/uboot-lantiq/patches/0022-MIPS-lantiq-add-default-openwrt-config.patch +++ b/package/boot/uboot-lantiq/patches/0022-MIPS-lantiq-add-default-openwrt-config.patch @@ -8,7 +8,7 @@ Signed-off-by: Daniel Schwierzeck --- /dev/null +++ b/include/configs/openwrt-lantiq-common.h -@@ -0,0 +1,39 @@ +@@ -0,0 +1,40 @@ +/* + * Copyright (C) 2013 Luka Perkov + * @@ -21,6 +21,7 @@ Signed-off-by: Daniel Schwierzeck +/* Commands */ +#if defined(CONFIG_LTQ_SUPPORT_ETHERNET) +#define CONFIG_CMD_PING ++#define CONFIG_CMD_TFTPPUT +#endif + +/* Compression */ diff --git a/package/boot/uboot-lantiq/patches/100-portability.patch b/package/boot/uboot-lantiq/patches/100-portability.patch new file mode 100644 index 000000000..4539e3e88 --- /dev/null +++ b/package/boot/uboot-lantiq/patches/100-portability.patch @@ -0,0 +1,18 @@ +--- a/include/image.h ++++ b/include/image.h +@@ -17,7 +17,6 @@ + #define __IMAGE_H__ + + #include "compiler.h" +-#include + + /* Define this to avoid #ifdefs later on */ + struct lmb; +@@ -36,6 +35,7 @@ struct lmb; + + #include + #include ++#include + #include + + /* Take notice of the 'ignore' property for hashes */ diff --git a/package/boot/uboot-layerscape-32b/Makefile b/package/boot/uboot-layerscape-32b/Makefile deleted file mode 100644 index 8a338cdce..000000000 --- a/package/boot/uboot-layerscape-32b/Makefile +++ /dev/null @@ -1,98 +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 -include $(INCLUDE_DIR)/image.mk - -PKG_NAME:=uboot-layerscape-32bit -PKG_VERSION:=v1.0 -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_MIRROR_HASH:=b62f4a55882ffb6b57da24ad9eaa98237141941d273e06a2244220a3e6b82ce7 -PKG_SOURCE_URL:=https://github.com/fsl-jyt/uboot-ls-32b.git -PKG_SOURCE_VERSION:=763de09cc7265e3147e2df2e15f91c73231907f4 - -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 - -include $(INCLUDE_DIR)/package.mk - -define uboot/Default - TITLE:= - CONFIG:= -endef - -define uboot/ls1043ardb - TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 32b Dev Board - CONFIG=ls1043ardb-uboot.bin -endef - -define uboot/ls1046ardb - TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 32b Dev Board - CONFIG=ls1046ardb-uboot.bin -endef - -define uboot/ls1012ardb - TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012ardb 32b Dev Board - CONFIG=ls1012ardb-uboot.bin.swap -endef - -UBOOTS := \ - ls1043ardb \ - ls1046ardb \ - ls1012ardb - -define Package/uboot/template -define Package/uboot-layerscape-32b-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:= @TARGET_layerscape_32b - TITLE:=$(2) - URL:=https://github.com/fsl-jyt/uboot-ls-32b.git - VARIANT:=$(1) - MAINTAINER:=Jiang Yutang -endef -endef - -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) -endef - -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -endif - -define Build/Configure -endef - -define Build/Compile -endef - -define Package/uboot/install/default - $(CP) $(PKG_BUILD_DIR)/$(UBOOT_CONFIG) $(KDIR)/$(1)-32b-uboot.bin -endef - -define Package/uboot/install/template -define Package/uboot-layerscape-32b-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-layerscape-32b-$(u))) \ -) diff --git a/package/boot/uboot-layerscape-armv8_32b/Makefile b/package/boot/uboot-layerscape-armv8_32b/Makefile new file mode 100644 index 000000000..d1ca82917 --- /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 6cd35b8e8..c37b335b4 100644 --- a/package/boot/uboot-layerscape/Makefile +++ b/package/boot/uboot-layerscape/Makefile @@ -6,100 +6,71 @@ # include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/image.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:=6aba7cb32d655dacb49bd188706bf1284159ae9b1fa69056df634b90070c3768 -PKG_SOURCE_URL:=https://github.com/fsl-jyt/u-boot.git -PKG_SOURCE_VERSION:=aefcbf4c2bb36e1f0ead61181e5fe1119b5683ad - -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_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 uboot/Default - TITLE:= - CONFIG:= - IMAGE:= +define U-Boot/Default + BUILD_TARGET:=layerscape + BUILD_SUBTARGET:=armv8_64b + BUILD_DEVICES:=$(1) + UBOOT_IMAGE:=u-boot-dtb.bin + HIDDEN:=y endef -define uboot/ls1043ardb - TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 64b Dev Board - CONFIG=ls1043ardb +define U-Boot/ls1043ardb + NAME:=NXP ls1043ardb 64b Dev Board endef -define uboot/ls1046ardb - TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 64b Dev Board - CONFIG=ls1046ardb_qspi +define U-Boot/ls1046ardb + NAME:=NXP ls1046ardb 64b Dev Board + UBOOT_CONFIG:=ls1046ardb_qspi endef -define uboot/ls1012ardb - TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012ardb 64b Dev Board - CONFIG=ls1012ardb_qspi - IMAGE=u-boot-swap.bin +define U-Boot/ls1012ardb + NAME:=NXP ls1012ardb 64b Dev Board + UBOOT_CONFIG:=ls1012ardb_qspi endef -UBOOTS := \ +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 Package/uboot/template -define Package/uboot-layerscape-64b-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:= @TARGET_layerscape_64b - TITLE:=$(2) - URL:=http://git.freescale.com/git/cgit.cgi/ppc/sdk/u-boot.git/snapshot - VARIANT:=$(1) - MAINTAINER:=Jiang Yutang -endef +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(BUILD_SUBTARGET)-uboot.bin endef -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) +define Package/u-boot/install/default endef -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),u-boot-dtb.bin) -endif - -define Build/Configure - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - $(UBOOT_CONFIG)_config -endef - -define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) DTC=$(LINUX_DIR)/scripts/dtc/dtc -endef - -define Package/uboot/install/default - $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(KDIR)/$(1)-64b-uboot.bin -endef - -define Package/uboot/install/template -define Package/uboot-layerscape-64b-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-layerscape-64b-$(u))) \ -) +$(eval $(call BuildPackage/U-Boot)) 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 000000000..597383166 --- /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 000000000..418f6287f --- /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 000000000..e8bbe7faa --- /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 000000000..eaf0da283 --- /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 000000000..6da256ab0 --- /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 000000000..45010a210 --- /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 024230946..b29039cd8 100644 --- a/package/boot/uboot-mvebu/Makefile +++ b/package/boot/uboot-mvebu/Makefile @@ -8,90 +8,33 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_NAME:=u-boot -PKG_VERSION:=2016.03 +PKG_VERSION:=2017.03 PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=\ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot -PKG_HASH:=e49337262ecac44dbdeac140f2c6ebd1eba345e0162b0464172e7f05583ed7bb - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - -PKG_BUILD_PARALLEL:=1 +PKG_HASH:=f54baf3f9325bf444c7905f3a5b6f83680edb1e6e1a4d5f8a5ad80abe885113f +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= +UBOOT_MAKE_FLAGS:= + +define U-Boot/Default + BUILD_TARGET:=mvebu + HIDDEN:=1 endef -define uboot/clearfog - TITLE:=U-Boot for SolidRun ClearFog A1 - DEVICE:=armada-388-clearfog +define U-Boot/clearfog + NAME:=SolidRun ClearFog A1 + BUILD_DEVICES:=armada-388-clearfog-base armada-388-clearfog-pro + UBOOT_IMAGE:=u-boot-spl.kwb endef -UBOOTS:= \ +UBOOT_TARGETS:= \ clearfog -define Package/uboot/template -define Package/uboot-mvebu-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@(TARGET_DEVICE_mvebu_DEVICE_$(3)||TARGET_mvebu_DEVICE_$(3)||TARGET_mvebu_Default) - DEFAULT:=m - HIDDEN:=1 - TITLE:=$(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) - MAINTAINER:=Felix Fietkau -endef +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot-spl.kwb endef -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE),$(DEVICE)) -endef - -define Build/Configure - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - $(BUILD_VARIANT)_config -endef - -define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) \ - DTC_DIR=$(LINUX_DIR)/scripts/dtc/ -endef - -define Package/uboot/install/default - $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) - $(CP) $(PKG_BUILD_DIR)/u-boot-spl.kwb \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-spl.kwb - $(INSTALL_DIR) $(KERNEL_BUILD_DIR)/ - $(CP) $(PKG_BUILD_DIR)/u-boot-spl.kwb \ - $(KERNEL_BUILD_DIR)/openwrt-$(BOARD)-$(1)-u-boot-spl.kwb - $(INSTALL_DIR) $(BIN_DIR)/u-boot-kwboot/ - $(CP) $(PKG_BUILD_DIR)/tools/kwboot \ - $(BIN_DIR)/u-boot-kwboot/ -endef - -define Package/uboot/install/template -define Package/uboot-mvebu-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-mvebu-$(u))) \ -) +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-mvebu/patches/0001-clearfog-generate-random-MAC-address.patch b/package/boot/uboot-mvebu/patches/0001-clearfog-generate-random-MAC-address.patch new file mode 100644 index 000000000..c34616292 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/0001-clearfog-generate-random-MAC-address.patch @@ -0,0 +1,28 @@ +From ee16ee20205ea374613c3ac7f50209451eb29068 Mon Sep 17 00:00:00 2001 +From: Josua Mayer +Date: Sun, 23 Apr 2017 18:02:40 +0200 +Subject: [PATCH 1/4] clearfog: generate random MAC address + +The Clearfog does not come with predetermined MACs. +Falling back to random ones ensures ethernet can still operate anyway. + +Signed-off-by: Josua Mayer >josua.mayer97@gmail.com> +--- + configs/clearfog_defconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig +index 1264871e83..41e94e6daf 100644 +--- a/configs/clearfog_defconfig ++++ b/configs/clearfog_defconfig +@@ -47,6 +47,7 @@ CONFIG_DEBUG_UART=y + CONFIG_DEBUG_UART_BASE=0xd0012000 + CONFIG_DEBUG_UART_CLOCK=250000000 + CONFIG_DEBUG_UART_SHIFT=2 ++CONFIG_NET_RANDOM_ETHADDR=y + CONFIG_SYS_NS16550=y + CONFIG_USB=y + CONFIG_DM_USB=y +-- +2.12.2 + diff --git a/package/boot/uboot-mvebu/patches/200-clearfog-reset-usom-onboard-1512-phy.patch b/package/boot/uboot-mvebu/patches/0002-clearfog-reset-usom-onboard-1512-phy.patch similarity index 81% rename from package/boot/uboot-mvebu/patches/200-clearfog-reset-usom-onboard-1512-phy.patch rename to package/boot/uboot-mvebu/patches/0002-clearfog-reset-usom-onboard-1512-phy.patch index 3c470409e..164c6f3f2 100644 --- a/package/boot/uboot-mvebu/patches/200-clearfog-reset-usom-onboard-1512-phy.patch +++ b/package/boot/uboot-mvebu/patches/0002-clearfog-reset-usom-onboard-1512-phy.patch @@ -1,7 +1,7 @@ -From 15d52c4067b8d8a1d7a002aec41c5e6c0a8678cd Mon Sep 17 00:00:00 2001 +From 98848106b9558244ae36a85229caabcdb57d0f7b Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Fri, 23 Sep 2016 13:58:14 +0200 -Subject: [PATCH] clearfog: reset usom onboard 1512 phy +Subject: [PATCH 2/4] clearfog: reset usom onboard 1512 phy Use GPIO19 which is wired to the uSOM phy reset signal in order to reset the uSOM's 88E81512 gigabit Ethernet phy. @@ -15,6 +15,8 @@ Signed-off-by: Jonas Gorski board/solidrun/clearfog/clearfog.c | 4 ++++ 1 file changed, 4 insertions(+) +diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c +index 2773f5957e..3a8257cac3 100644 --- a/board/solidrun/clearfog/clearfog.c +++ b/board/solidrun/clearfog/clearfog.c @@ -131,8 +131,12 @@ int board_init(void) @@ -30,3 +32,6 @@ Signed-off-by: Jonas Gorski mdelay(10); /* Init I2C IO expanders */ +-- +2.12.2 + diff --git a/package/boot/uboot-mvebu/patches/0003-clearfog-enable-distro-boot-code.patch b/package/boot/uboot-mvebu/patches/0003-clearfog-enable-distro-boot-code.patch new file mode 100644 index 000000000..97b2d1f25 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/0003-clearfog-enable-distro-boot-code.patch @@ -0,0 +1,97 @@ +From 9653921eadd5d5268afbee6c928708158fc4e844 Mon Sep 17 00:00:00 2001 +From: Josua Mayer +Date: Tue, 22 Nov 2016 16:33:23 +0100 +Subject: [PATCH 3/4] clearfog: enable distro boot code + +load addresses start at 0x02000000, leaving enough space for fdt, +boot scripts and ramdisk at the end. +Only boot from mmc, the other options are not in working order. +Removed *_high variables in good faith. They can be re-added with sane +values when, and if required. + +Signed-off-by: Josua Mayer +--- + Kconfig | 1 + + include/configs/clearfog.h | 47 +++++++++++++++++++++++++++++++++++++++++----- + 2 files changed, 43 insertions(+), 5 deletions(-) + +diff --git a/Kconfig b/Kconfig +index 81b4226463..f7aec2255b 100644 +--- a/Kconfig ++++ b/Kconfig +@@ -59,6 +59,7 @@ config DISTRO_DEFAULTS + default y if ARCH_LS2080A + default y if ARCH_MESON + default y if ARCH_ROCKCHIP ++ default y if TARGET_CLEARFOG + default n + select CMD_BOOTZ if ARM && !ARM64 + select CMD_BOOTI if ARM64 +diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h +index 0c51d2a288..890dd84b5d 100644 +--- a/include/configs/clearfog.h ++++ b/include/configs/clearfog.h +@@ -79,11 +79,6 @@ + + #define CONFIG_SYS_ALT_MEMTEST + +-/* Keep device tree and initrd in lower memory so the kernel can access them */ +-#define CONFIG_EXTRA_ENV_SETTINGS \ +- "fdt_high=0x10000000\0" \ +- "initrd_high=0x10000000\0" +- + /* SPL */ + /* + * Select the boot device here +@@ -128,6 +123,48 @@ + #endif + #endif + ++#ifndef CONFIG_SPL_BUILD ++/* ++ * Add standard bootenv from distro boot code: ++ * Keep device tree and initrd in lower memory so the kernel can access them ++ * Set default load addresses: ++ * - 63MiB space for kernel ++ * - 1MiB space for fdt ++ * - 1MiB space for extlinux file, or boot script ++ * - remainder for ramdisk ++ * Keep device tree and initrd in lower memory so the kernel can access them ++ * Set name of fdt file (default to Clearfog Pro) ++ * specify console device ++ */ ++#define CONFIG_EXTRA_ENV_SETTINGS \ ++ "kernel_addr_r=0x02000000\0" \ ++ "fdt_addr_r=0x05f00000\0" \ ++ "pxefile_addr_r=0x06000000\0" \ ++ "scriptaddr=0x06000000\0" \ ++ "ramdisk_addr_r=0x06100000\0" \ ++ "fdt_high=0x10000000\0" \ ++ "initrd_high=0x10000000\0" \ ++ "fdtfile=armada-388-clearfog-pro.dtb\0" \ ++ "console=ttyS0," __stringify(CONFIG_BAUDRATE) "\0" \ ++ BOOTENV ++ ++/* include distro boot code defaults */ ++#include ++ ++/* ++ * specify boot order ++ * sdcard or emmc -> usb -> network ++ */ ++#define BOOT_TARGET_DEVICES(func) \ ++ func(MMC, mmc, 0) \ ++ func(USB, usb, 0) \ ++ func(PXE, pxe, na) \ ++ func(DHCP, dhcp, na) ++ ++/* include the actual distro boot code */ ++#include ++#endif ++ + /* + * mv-common.h should be defined after CMD configs since it used them + * to enable certain macros +-- +2.12.2 + 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 new file mode 100644 index 000000000..ca734660e --- /dev/null +++ b/package/boot/uboot-mvebu/patches/0004-clearfog-enable-setexpr-command-by-default.patch @@ -0,0 +1,24 @@ +From 7b53a0f5ddf0b1201a09c368b06cd5750d5fbe3a Mon Sep 17 00:00:00 2001 +From: Josua Mayer +Date: Sun, 23 Apr 2017 17:45:11 +0200 +Subject: [PATCH 4/4] clearfog: enable setexpr command by default + +Turns out this command is pretty useful in advanced boot-scripts. +-> enable + +Signed-off-by: Josua Mayer +--- + configs/clearfog_defconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/configs/clearfog_defconfig ++++ b/configs/clearfog_defconfig +@@ -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_CMD_TFTPPUT=y + CONFIG_CMD_DHCP=y + CONFIG_CMD_MII=y diff --git a/package/boot/uboot-mvebu/patches/001-use-dtc-in-kernel.patch b/package/boot/uboot-mvebu/patches/001-use-dtc-in-kernel.patch deleted file mode 100644 index 7e46084ad..000000000 --- a/package/boot/uboot-mvebu/patches/001-use-dtc-in-kernel.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -348,7 +348,7 @@ OBJDUMP = $(CROSS_COMPILE)objdump - AWK = awk - PERL = perl - PYTHON = python --DTC = dtc -+DTC = $(DTC_DIR)dtc - CHECK = sparse - - CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ 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 000000000..fbbfe462b --- /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 000000000..882969905 --- /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-mvebu/patches/002-enable_random_mac_addr.patch b/package/boot/uboot-mvebu/patches/002-enable_random_mac_addr.patch deleted file mode 100644 index 2dd9f2828..000000000 --- a/package/boot/uboot-mvebu/patches/002-enable_random_mac_addr.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/configs/clearfog_defconfig -+++ b/configs/clearfog_defconfig -@@ -14,6 +14,7 @@ CONFIG_DEBUG_UART=y - CONFIG_DEBUG_UART_BASE=0xd0012000 - CONFIG_DEBUG_UART_CLOCK=250000000 - CONFIG_DEBUG_UART_SHIFT=2 -+CONFIG_NET_RANDOM_ETHADDR=y - CONFIG_SYS_NS16550=y - CONFIG_USB=y - CONFIG_DM_USB=y diff --git a/package/boot/uboot-mvebu/patches/003-boot_script.patch b/package/boot/uboot-mvebu/patches/003-boot_script.patch deleted file mode 100644 index 2e156b7c8..000000000 --- a/package/boot/uboot-mvebu/patches/003-boot_script.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/include/configs/clearfog.h -+++ b/include/configs/clearfog.h -@@ -107,7 +107,18 @@ - /* Keep device tree and initrd in lower memory so the kernel can access them */ - #define CONFIG_EXTRA_ENV_SETTINGS \ - "fdt_high=0x10000000\0" \ -- "initrd_high=0x10000000\0" -+ "initrd_high=0x10000000\0" \ -+ "script=boot.scr\0" \ -+ "loadaddr=0x01000000\0" \ -+ "mmcdev=0\0" \ -+ "mmcpart=1\0" \ -+ "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ -+ "bootscript=echo Running bootscript from mmc ...; source ${loadaddr}\0" -+ -+#define CONFIG_BOOTCOMMAND \ -+ "if run loadbootscript; then " \ -+ "run bootscript; " \ -+ "fi" - - /* SPL */ - /* ---- a/configs/clearfog_defconfig -+++ b/configs/clearfog_defconfig -@@ -3,6 +3,7 @@ CONFIG_ARCH_MVEBU=y - CONFIG_SYS_MALLOC_F_LEN=0x2000 - CONFIG_TARGET_CLEARFOG=y - CONFIG_DEFAULT_DEVICE_TREE="armada-388-clearfog" -+CONFIG_HUSH_PARSER=y - CONFIG_SPL=y - # CONFIG_CMD_IMLS is not set - # CONFIG_CMD_FLASH is not set diff --git a/package/boot/uboot-mxs/Makefile b/package/boot/uboot-mxs/Makefile index d00940c54..92cf9e6b2 100644 --- a/package/boot/uboot-mxs/Makefile +++ b/package/boot/uboot-mxs/Makefile @@ -6,91 +6,40 @@ # include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk -PKG_NAME:=u-boot PKG_VERSION:=2016.01 PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot PKG_HASH:=e5792fba9399d9804aa2ef667f14ff771e2cdece72367d340250265bf095a5d5 -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= - CONFIG:= - IMAGE:= +define U-Boot/Default + BUILD_TARGET:=mxs + UBOOT_IMAGE:=u-boot.sb + DEFAULT:=y + HIDDEN:=1 endef -define uboot/mx23_olinuxino - TITLE:=U-Boot 2016.01 for the Olinuxino i.MX233 +define U-Boot/mx23_olinuxino + NAME:=Olinuxino i.MX233 endef -define uboot/duckbill - TITLE:=U-Boot 2016.01 for the I2SE Duckbill +define U-Boot/duckbill + NAME:=I2SE Duckbill endef -UBOOTS := \ +UBOOT_TARGETS := \ mx23_olinuxino \ duckbill -define Package/uboot/template -define Package/uboot-mxs-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_mxs - TITLE:=$(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) - MAINTAINER:=Zoltan HERPAI -endef +UBOOT_MAKE_FLAGS += $(UBOOT_IMAGE) + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(UBOOT_IMAGE) endef -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) -endef - -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),u-boot.sb) -endif - -define Build/Configure - $(MAKE) -C $(PKG_BUILD_DIR) \ - $(UBOOT_CONFIG)_config -endef - -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) $(UBOOT_IMAGE) -endef - -define Package/uboot/install/default - $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) - $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(BIN_DIR)/uboot-$(BOARD)-$(1)/uboot-$(BOARD)-$(1).sb -endef - -define Package/uboot/install/template -define Package/uboot-mxs-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-mxs-$(u))) \ -) +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-omap/Makefile b/package/boot/uboot-omap/Makefile index 547c6534c..9084f3740 100644 --- a/package/boot/uboot-omap/Makefile +++ b/package/boot/uboot-omap/Makefile @@ -6,98 +6,52 @@ # include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk -PKG_NAME:=u-boot -PKG_VERSION:=2015.10 +PKG_VERSION:=2017.01 PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot -PKG_HASH:=bdc68d5f9455ad933b059c735d983f2c8b6b552dafb062e5ff1444f623021955 - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README +PKG_HASH:=6c425175f93a4bcf2ec9faf5658ef279633dbd7856a293d95bd1ff516528ecf2 +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= - CONFIG:= - IMAGE:= +define U-Boot/Default + BUILD_TARGET:=omap + UBOOT_IMAGE:=u-boot.img MLO + UENV:=default endef -define uboot/omap4_panda - TITLE:=U-Boot for the Pandaboard +define U-Boot/omap4_panda + NAME:=Pandaboard + BUILD_DEVICES:=omap4-panda endef -define uboot/am335x_evm - TITLE:=U-Boot for the AM335x EVM +define U-Boot/am335x_boneblack + NAME:=TI AM335x BeagleBone Black + BUILD_DEVICES:=am335x-boneblack endef -define uboot/omap3_overo - TITLE:=U-Boot for the Gumstix Overo +define U-Boot/am335x_evm + NAME:=AM335x EVM + BUILD_DEVICES:=am335x-evm endef -define uboot/omap3_beagle - TITLE:=U-Boot for the BeagleBoard +define U-Boot/omap3_overo + NAME:=Gumstix Overo endef -UBOOTS:=omap4_panda am335x_evm omap3_overo omap3_beagle - -define Package/uboot/template -define Package/uboot-omap-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_omap - TITLE:=$(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) - HIDDEN:=1 -endef +define U-Boot/omap3_beagle + NAME:=BeagleBoard + BUILD_DEVICES:=omap3-beagle endef -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) +UBOOT_TARGETS:=omap4_panda am335x_evm omap3_overo omap3_beagle am335x_boneblack + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES) + $(CP) $(patsubst %,$(PKG_BUILD_DIR)/%,$(UBOOT_IMAGE)) $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)/ + $(CP) ./files/uEnv-$(UENV).txt $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)/uEnv.txt endef -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.img) -endif - -define Build/Configure - $(MAKE) -C $(PKG_BUILD_DIR) \ - USE_PRIVATE_LIBGCC=yes $(UBOOT_CONFIG)_config -endef - -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) -endef - -define Package/uboot/install/default - $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) - $(CP) $(PKG_BUILD_DIR)/u-boot.img $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot.img - $(CP) $(PKG_BUILD_DIR)/MLO $(BIN_DIR)/uboot-$(BOARD)-$(1)/MLO -endef - -define Package/uboot/install/template -define Package/uboot-omap-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-omap-$(u))) \ -) +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-omap/files/uEnv-default.txt b/package/boot/uboot-omap/files/uEnv-default.txt new file mode 100644 index 000000000..3584e4379 --- /dev/null +++ b/package/boot/uboot-omap/files/uEnv-default.txt @@ -0,0 +1,8 @@ +bootpart=0:1 +bootdir=/ +bootfile=zImage +fdtdir=/dtbs +uenvcmd=run loadfdt; run loadimage; run uenvbootargs ; bootz ${loadaddr} - ${fdtaddr} +loadfdt=load mmc ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile} +devtype=mmc +uenvbootargs=setenv bootargs console=${console} root=/dev/mmcblk0p2 diff --git a/package/boot/uboot-omap/patches/001-backport_upstream_image_c_fix_non_android_booting.patch b/package/boot/uboot-omap/patches/001-backport_upstream_image_c_fix_non_android_booting.patch deleted file mode 100644 index b8e65b500..000000000 --- a/package/boot/uboot-omap/patches/001-backport_upstream_image_c_fix_non_android_booting.patch +++ /dev/null @@ -1,33 +0,0 @@ -From c139b5ff0999ec3d44a02ebdb623a92e5782e53e Mon Sep 17 00:00:00 2001 -From: Tom Rini -Date: Tue, 27 Oct 2015 19:04:40 -0400 -Subject: [PATCH] image.c: Fix non-Android booting with ramdisk and/or device - tree - -In 1fec3c5 I added a check that if we had an Android image we default to -trying the kernel address for a ramdisk. However when we don't have an -Android image buf is NULL and we oops here. Ensure that we have 'buf' -to check first. - -Reported-by: elipe Balbi -Signed-off-by: Tom Rini ---- - common/image.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/common/image.c b/common/image.c -index e607109..85c4f39 100644 ---- a/common/image.c -+++ b/common/image.c -@@ -913,7 +913,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, - * Look for an Android boot image. - */ - buf = map_sysmem(images->os.start, 0); -- if (genimg_get_format(buf) == IMAGE_FORMAT_ANDROID) -+ if (buf && genimg_get_format(buf) == IMAGE_FORMAT_ANDROID) - select = argv[0]; - #endif - --- -1.7.10.4 - diff --git a/package/boot/uboot-omap/patches/100-disable_thumb_unknown_errata.patch b/package/boot/uboot-omap/patches/100-disable_thumb_unknown_errata.patch deleted file mode 100644 index 7b7bfa8fb..000000000 --- a/package/boot/uboot-omap/patches/100-disable_thumb_unknown_errata.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/include/configs/ti_armv7_common.h -+++ b/include/configs/ti_armv7_common.h -@@ -233,8 +233,6 @@ - #define CONFIG_SPL_EXT_SUPPORT - #endif - --#define CONFIG_SYS_THUMB_BUILD -- - /* General parts of the framework, required. */ - #define CONFIG_SPL_I2C_SUPPORT - #define CONFIG_SPL_LIBCOMMON_SUPPORT diff --git a/package/boot/uboot-omap/patches/101-disable-thumb-omap3.patch b/package/boot/uboot-omap/patches/101-disable-thumb-omap3.patch new file mode 100644 index 000000000..8a3b024fe --- /dev/null +++ b/package/boot/uboot-omap/patches/101-disable-thumb-omap3.patch @@ -0,0 +1,14 @@ +Index: u-boot-2017.01/include/configs/ti_omap3_common.h +=================================================================== +--- u-boot-2017.01.orig/include/configs/ti_omap3_common.h ++++ u-boot-2017.01/include/configs/ti_omap3_common.h +@@ -80,4 +80,9 @@ + /* Now bring in the rest of the common code. */ + #include + ++/* beagleboard doesnt boot with thumb */ ++#ifdef CONFIG_SYS_THUMB_BUILD ++#undef CONFIG_SYS_THUMB_BUILD ++#endif ++ + #endif /* __CONFIG_TI_OMAP3_COMMON_H__ */ diff --git a/package/boot/uboot-omap/patches/101-disable_ext.patch b/package/boot/uboot-omap/patches/101-disable_ext.patch deleted file mode 100644 index 9e0e47caf..000000000 --- a/package/boot/uboot-omap/patches/101-disable_ext.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/include/configs/ti_armv7_common.h -+++ b/include/configs/ti_armv7_common.h -@@ -230,7 +230,6 @@ - #define CONFIG_SPL_LIBDISK_SUPPORT - #define CONFIG_SPL_MMC_SUPPORT - #define CONFIG_SPL_FAT_SUPPORT --#define CONFIG_SPL_EXT_SUPPORT - #endif - - /* General parts of the framework, required. */ diff --git a/package/boot/uboot-omap/patches/102-minify-spl.patch b/package/boot/uboot-omap/patches/102-minify-spl.patch new file mode 100644 index 000000000..66f6b6b59 --- /dev/null +++ b/package/boot/uboot-omap/patches/102-minify-spl.patch @@ -0,0 +1,44 @@ +Index: u-boot-2017.01/configs/omap3_beagle_defconfig +=================================================================== +--- u-boot-2017.01.orig/configs/omap3_beagle_defconfig ++++ u-boot-2017.01/configs/omap3_beagle_defconfig +@@ -7,7 +7,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y + CONFIG_VERSION_VARIABLE=y + CONFIG_SPL=y + CONFIG_SPL_MTD_SUPPORT=y +-CONFIG_SPL_OS_BOOT=y ++# CONFIG_SPL_EXT_SUPPORT is not set + # CONFIG_CMD_IMLS is not set + CONFIG_CMD_ASKENV=y + # CONFIG_CMD_FLASH is not set +Index: u-boot-2017.01/common/Makefile +=================================================================== +--- u-boot-2017.01.orig/common/Makefile ++++ u-boot-2017.01/common/Makefile +@@ -174,8 +174,11 @@ obj-$(CONFIG_CMDLINE) += cli_simple.o + obj-y += cli.o + obj-$(CONFIG_CMDLINE) += cli_readline.o + obj-$(CONFIG_CMD_DFU) += dfu.o ++ ++ifndef CONFIG_SPL_BUILD + obj-y += command.o + obj-y += s_record.o + obj-y += xyzModem.o ++endif + + CFLAGS_env_embedded.o := -Wa,--no-warn -DENV_CRC=$(shell tools/envcrc 2>/dev/null) +Index: u-boot-2017.01/cmd/Makefile +=================================================================== +--- u-boot-2017.01.orig/cmd/Makefile ++++ u-boot-2017.01/cmd/Makefile +@@ -161,7 +161,10 @@ endif # !CONFIG_SPL_BUILD + + obj-$(CONFIG_CMD_BLOB) += blob.o + ++ ++# ifndef CONFIG_SPL_BUILD + # core command + obj-y += nvedit.o ++# endif # !CONFIG_SPL_BUILD + + obj-$(CONFIG_ARCH_MVEBU) += mvebu/ diff --git a/package/boot/uboot-omap/patches/103-disable-fat-write-spl.patch b/package/boot/uboot-omap/patches/103-disable-fat-write-spl.patch new file mode 100644 index 000000000..89b02044d --- /dev/null +++ b/package/boot/uboot-omap/patches/103-disable-fat-write-spl.patch @@ -0,0 +1,27 @@ +Index: u-boot-2017.01/fs/fat/Makefile +=================================================================== +--- u-boot-2017.01.orig/fs/fat/Makefile ++++ u-boot-2017.01/fs/fat/Makefile +@@ -4,8 +4,8 @@ + # + + obj-$(CONFIG_FS_FAT) := fat.o +-obj-$(CONFIG_FAT_WRITE):= fat_write.o + + ifndef CONFIG_SPL_BUILD ++obj-$(CONFIG_FAT_WRITE):= fat_write.o + obj-$(CONFIG_FS_FAT) += file.o + endif +Index: u-boot-2017.01/fs/fat/fat.c +=================================================================== +--- u-boot-2017.01.orig/fs/fat/fat.c ++++ u-boot-2017.01/fs/fat/fat.c +@@ -163,7 +163,7 @@ static void get_name(dir_entry *dirent, + } + + static int flush_dirty_fat_buffer(fsdata *mydata); +-#if !defined(CONFIG_FAT_WRITE) ++#if !defined(CONFIG_FAT_WRITE) || defined(CONFIG_SPL_BUILD) + /* Stub for read only operation */ + int flush_dirty_fat_buffer(fsdata *mydata) + { diff --git a/package/boot/uboot-omap/patches/104-omap3-overo-enable-thumb.patch b/package/boot/uboot-omap/patches/104-omap3-overo-enable-thumb.patch new file mode 100644 index 000000000..ca928c996 --- /dev/null +++ b/package/boot/uboot-omap/patches/104-omap3-overo-enable-thumb.patch @@ -0,0 +1,18 @@ +Index: u-boot-2017.01/include/configs/omap3_overo.h +=================================================================== +--- u-boot-2017.01.orig/include/configs/omap3_overo.h ++++ u-boot-2017.01/include/configs/omap3_overo.h +@@ -11,6 +11,13 @@ + #define CONFIG_NAND + + #include ++ ++/* try to enable thumb - unknown if it's working ++ * but otherwise it's too big for spl */ ++#ifndef CONFIG_SYS_THUMB_BUILD ++#define CONFIG_SYS_THUMB_BUILD ++#endif ++ + /* + * We are only ever GP parts and will utilize all of the "downloaded image" + * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB). diff --git a/package/boot/uboot-oxnas/Makefile b/package/boot/uboot-oxnas/Makefile index d76af0ac1..daa266ea8 100644 --- a/package/boot/uboot-oxnas/Makefile +++ b/package/boot/uboot-oxnas/Makefile @@ -8,95 +8,29 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_NAME:=u-boot PKG_VERSION:=2014.10 PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot - PKG_HASH:=d3b132a7a9b3f3182b7aad71c2dfbd4fc15bea83e12c76134eb3ffefc07d1c71 -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= - CONFIG:= - IMAGE:= +define U-Boot/Default + BUILD_TARGET:=oxnas + BUILD_DEVICES:=Default + HIDDEN:=y endef -define uboot/ox820 - TITLE:=U-Boot for the Oxford/PLX NAS7820 +define U-Boot/ox820 + NAME:=Oxford/PLX NAS7820 endef -UBOOTS:=ox820 +UBOOT_TARGETS:=ox820 -define Package/uboot/template -define Package/uboot-oxnas-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_oxnas - TITLE:=$(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) - MAINTAINER:=Daniel Golle -endef +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/u-boot.bin $(STAGING_DIR_IMAGE)/u-boot.bin endef -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) -endef - -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) -endif - -define Build/Prepare - $(call Build/Prepare/Default) - $(CP) ./files/* $(PKG_BUILD_DIR) - find $(PKG_BUILD_DIR) -name .svn | $(XARGS) rm -rf -endef - -define Build/Configure - $(MAKE) -C $(PKG_BUILD_DIR) \ - $(UBOOT_CONFIG)_config -endef - -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - u-boot.bin \ - CROSS_COMPILE=$(TARGET_CROSS) -endef - -define Package/uboot/install/default - $(INSTALL_DIR) $(BIN_DIR) - $(CP) $(PKG_BUILD_DIR)/u-boot.bin \ - $(BIN_DIR)/openwrt-$(BOARD)-$(1)-u-boot.bin - $(CP) $(PKG_BUILD_DIR)/u-boot.bin \ - $(KERNEL_BUILD_DIR)/u-boot.bin -endef - -define Package/uboot/install/template -define Package/uboot-oxnas-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-oxnas-$(u))) \ -) +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/Makefile b/package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/Makefile similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/Makefile rename to package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/Makefile diff --git a/package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/clock.c b/package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/clock.c similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/clock.c rename to package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/clock.c diff --git a/package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/pinmux.c b/package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/pinmux.c similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/pinmux.c rename to package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/pinmux.c diff --git a/package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/reset.c b/package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/reset.c similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/reset.c rename to package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/reset.c diff --git a/package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/timer.c b/package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/timer.c similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/timer.c rename to package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/timer.c diff --git a/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/clock.h b/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/clock.h similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/clock.h rename to package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/clock.h diff --git a/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/cpu.h b/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/cpu.h similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/cpu.h rename to package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/cpu.h diff --git a/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/hardware.h b/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/hardware.h similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/hardware.h rename to package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/hardware.h diff --git a/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/pinmux.h b/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/pinmux.h similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/pinmux.h rename to package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/pinmux.h diff --git a/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/spl.h b/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/spl.h similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/spl.h rename to package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/spl.h diff --git a/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/sysctl.h b/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/sysctl.h similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/sysctl.h rename to package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/sysctl.h diff --git a/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/timer.h b/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/timer.h similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/timer.h rename to package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/timer.h diff --git a/package/boot/uboot-oxnas/files/board/ox820/Kconfig b/package/boot/uboot-oxnas/src/board/ox820/Kconfig similarity index 100% rename from package/boot/uboot-oxnas/files/board/ox820/Kconfig rename to package/boot/uboot-oxnas/src/board/ox820/Kconfig diff --git a/package/boot/uboot-oxnas/files/board/ox820/MAINTAINERS b/package/boot/uboot-oxnas/src/board/ox820/MAINTAINERS similarity index 100% rename from package/boot/uboot-oxnas/files/board/ox820/MAINTAINERS rename to package/boot/uboot-oxnas/src/board/ox820/MAINTAINERS diff --git a/package/boot/uboot-oxnas/files/board/ox820/Makefile b/package/boot/uboot-oxnas/src/board/ox820/Makefile similarity index 100% rename from package/boot/uboot-oxnas/files/board/ox820/Makefile rename to package/boot/uboot-oxnas/src/board/ox820/Makefile diff --git a/package/boot/uboot-oxnas/files/board/ox820/ddr.c b/package/boot/uboot-oxnas/src/board/ox820/ddr.c similarity index 100% rename from package/boot/uboot-oxnas/files/board/ox820/ddr.c rename to package/boot/uboot-oxnas/src/board/ox820/ddr.c diff --git a/package/boot/uboot-oxnas/files/board/ox820/ddr.h b/package/boot/uboot-oxnas/src/board/ox820/ddr.h similarity index 100% rename from package/boot/uboot-oxnas/files/board/ox820/ddr.h rename to package/boot/uboot-oxnas/src/board/ox820/ddr.h diff --git a/package/boot/uboot-oxnas/files/board/ox820/lowlevel_init.S b/package/boot/uboot-oxnas/src/board/ox820/lowlevel_init.S similarity index 100% rename from package/boot/uboot-oxnas/files/board/ox820/lowlevel_init.S rename to package/boot/uboot-oxnas/src/board/ox820/lowlevel_init.S diff --git a/package/boot/uboot-oxnas/files/board/ox820/ox820.c b/package/boot/uboot-oxnas/src/board/ox820/ox820.c similarity index 100% rename from package/boot/uboot-oxnas/files/board/ox820/ox820.c rename to package/boot/uboot-oxnas/src/board/ox820/ox820.c diff --git a/package/boot/uboot-oxnas/files/board/ox820/spl_start.S b/package/boot/uboot-oxnas/src/board/ox820/spl_start.S similarity index 100% rename from package/boot/uboot-oxnas/files/board/ox820/spl_start.S rename to package/boot/uboot-oxnas/src/board/ox820/spl_start.S diff --git a/package/boot/uboot-oxnas/files/board/ox820/u-boot-spl.lds b/package/boot/uboot-oxnas/src/board/ox820/u-boot-spl.lds similarity index 100% rename from package/boot/uboot-oxnas/files/board/ox820/u-boot-spl.lds rename to package/boot/uboot-oxnas/src/board/ox820/u-boot-spl.lds diff --git a/package/boot/uboot-oxnas/files/common/env_ext4.c b/package/boot/uboot-oxnas/src/common/env_ext4.c similarity index 100% rename from package/boot/uboot-oxnas/files/common/env_ext4.c rename to package/boot/uboot-oxnas/src/common/env_ext4.c diff --git a/package/boot/uboot-oxnas/files/common/spl/spl_block.c b/package/boot/uboot-oxnas/src/common/spl/spl_block.c similarity index 100% rename from package/boot/uboot-oxnas/files/common/spl/spl_block.c rename to package/boot/uboot-oxnas/src/common/spl/spl_block.c diff --git a/package/boot/uboot-oxnas/files/configs/ox820_defconfig b/package/boot/uboot-oxnas/src/configs/ox820_defconfig similarity index 100% rename from package/boot/uboot-oxnas/files/configs/ox820_defconfig rename to package/boot/uboot-oxnas/src/configs/ox820_defconfig diff --git a/package/boot/uboot-oxnas/files/drivers/block/plxsata_ide.c b/package/boot/uboot-oxnas/src/drivers/block/plxsata_ide.c similarity index 100% rename from package/boot/uboot-oxnas/files/drivers/block/plxsata_ide.c rename to package/boot/uboot-oxnas/src/drivers/block/plxsata_ide.c diff --git a/package/boot/uboot-oxnas/files/drivers/usb/host/ehci-oxnas.c b/package/boot/uboot-oxnas/src/drivers/usb/host/ehci-oxnas.c similarity index 100% rename from package/boot/uboot-oxnas/files/drivers/usb/host/ehci-oxnas.c rename to package/boot/uboot-oxnas/src/drivers/usb/host/ehci-oxnas.c diff --git a/package/boot/uboot-oxnas/files/include/configs/ox820.h b/package/boot/uboot-oxnas/src/include/configs/ox820.h similarity index 100% rename from package/boot/uboot-oxnas/files/include/configs/ox820.h rename to package/boot/uboot-oxnas/src/include/configs/ox820.h diff --git a/package/boot/uboot-oxnas/files/tools/mkox820crc.c b/package/boot/uboot-oxnas/src/tools/mkox820crc.c similarity index 100% rename from package/boot/uboot-oxnas/files/tools/mkox820crc.c rename to package/boot/uboot-oxnas/src/tools/mkox820crc.c diff --git a/package/boot/uboot-pxa/Makefile b/package/boot/uboot-pxa/Makefile deleted file mode 100644 index 9c12ad7ed..000000000 --- a/package/boot/uboot-pxa/Makefile +++ /dev/null @@ -1,91 +0,0 @@ -# -# Copyright (C) 2012 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:=u-boot -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/ashcharles/verdex-uboot.git -PKG_SOURCE_DATE:=2011-08-25 -PKG_SOURCE_VERSION:=ca6bf3ef6ac5f5132a359b43dfa31e07076b74b7 -PKG_MIRROR_HASH:=7c92525b6c7bc0b6f065a9bfdf64d58a61583709cb44acb62a157ad3efc7c491 - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - -include $(INCLUDE_DIR)/package.mk - -define uboot/Default - TITLE:= - CONFIG:= - IMAGE:= -endef - -define uboot/gumstix - TITLE:=U-Boot for the Gumstix Verdex -endef - -UBOOTS:=gumstix - -define Package/uboot/template -define Package/uboot-pxa-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_pxa - TITLE:=$(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) - MAINTAINER:=Florian Fainelli -endef -endef - -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) -endef - -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) -endif - -define Build/Configure - $(MAKE) -C $(PKG_BUILD_DIR) \ - $(UBOOT_CONFIG)_config -endef - -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - u-boot.bin \ - CROSS_COMPILE=$(TARGET_CROSS) -endef - -define Package/uboot/install/default - $(INSTALL_DIR) $(BIN_DIR) - $(CP) $(PKG_BUILD_DIR)/u-boot.bin \ - $(BIN_DIR)/openwrt-$(BOARD)-$(1)-u-boot.bin -endef - -define Package/uboot/install/template -define Package/uboot-pxa-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-pxa-$(u))) \ -) diff --git a/package/boot/uboot-pxa/patches/001-squashfs_rootfstype_cmdline.patch b/package/boot/uboot-pxa/patches/001-squashfs_rootfstype_cmdline.patch deleted file mode 100644 index cfef66b8f..000000000 --- a/package/boot/uboot-pxa/patches/001-squashfs_rootfstype_cmdline.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/include/configs/gumstix.h b/include/configs/gumstix.h -index 319da63..5483993 100644 ---- a/include/configs/gumstix.h -+++ b/include/configs/gumstix.h -@@ -136,7 +136,7 @@ - #define CONFIG_MISC_INIT_R /* misc_init_r function in gumstix sets board serial number */ - - #define CONFIG_BOOTFILE boot/uImage --#define CONFIG_BOOTARGS "console=ttyS0,115200n8 root=1f01 rootfstype=jffs2 reboot=cold,hard" -+#define CONFIG_BOOTARGS "console=ttyS0,115200n8 root=1f01 rootfstype=squashfs,jffs2 reboot=cold,hard" - #define CONFIG_BOOTCOMMAND "icache on; setenv stderr nulldev; setenv stdout nulldev; if pinit on && fatload ide 0 a2000000 gumstix-factory.script; then setenv stdout serial; setenv stderr serial; echo Found gumstix-factory.script on CF...; autoscr; else if mmcinit && fatload mmc 0 a2000000 gumstix-factory.script; then setenv stdout serial; setenv stderr serial; echo Found gumstix-factory.script on MMC...; autoscr; else setenv stdout serial; setenv stderr serial; katload 100000 && bootm; fi; fi" - #define CONFIG_BOOTDELAY 2 /* in seconds */ - #define CONFIG_EXTRA_ENV_SETTINGS "verify=no" diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile index bc80dcfad..056300e18 100644 --- a/package/boot/uboot-sunxi/Makefile +++ b/package/boot/uboot-sunxi/Makefile @@ -9,90 +9,217 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_NAME:=u-boot -PKG_VERSION:=2016.03 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=ftp://ftp.denx.de/pub/u-boot -PKG_HASH:=e49337262ecac44dbdeac140f2c6ebd1eba345e0162b0464172e7f05583ed7bb +PKG_VERSION:=2017.07 + +PKG_HASH:=5374bfdc8acb9a38c025371b1ff20f45e7533668e84e685d0df5d9e7c0e4feff + PKG_MAINTAINER:=Zoltan HERPAI -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - -PKG_BUILD_PARALLEL:=1 - -PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define Package/uboot/template -define Package/uboot-sunxi-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_sunxi - TITLE:=U-Boot for $(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) +define U-Boot/Default + BUILD_TARGET:=sunxi + UBOOT_IMAGE:=u-boot-sunxi-with-spl.bin + UENV:=default + HIDDEN:=1 endef -define Package/uboot-sunxi-$(1)/install - $(CP) $(PKG_BUILD_DIR)/u-boot-sunxi-with-spl.bin \ - $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot-with-spl.bin - mkimage -C none -A arm -T script -d uEnv-$(if $(3),$(3),default).txt \ - $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-boot.scr +define U-Boot/A10-OLinuXino-Lime + BUILD_SUBTARGET:=cortexa8 + NAME:=A10 OLinuXino LIME + BUILD_DEVICES:=sun4i-a10-olinuxino-lime endef -UBOOT_SUNXI_PACKAGES += uboot-sunxi-$(1) - +define U-Boot/A13-OLinuXino + BUILD_SUBTARGET:=cortexa8 + NAME:=A13 OlinuXino + BUILD_DEVICES:=sun5i-a13-olinuxino endef -$(eval $(call Package/uboot/template,A10-OLinuXino-Lime,the A10 OLinuXino LIME)) -$(eval $(call Package/uboot/template,A13-OLinuXino,the A13 OlinuXino)) -$(eval $(call Package/uboot/template,A20-OLinuXino-Lime,the A20 OLinuXino LIME)) -$(eval $(call Package/uboot/template,A20-OLinuXino_MICRO,A20 OLinuXino MICRO)) -$(eval $(call Package/uboot/template,Bananapi,Bananapi)) -$(eval $(call Package/uboot/template,Bananapro,Bananapro)) -$(eval $(call Package/uboot/template,Cubieboard,Cubieboard)) -$(eval $(call Package/uboot/template,Cubieboard2,Cubieboard2)) -$(eval $(call Package/uboot/template,Cubietruck,Cubietruck)) -$(eval $(call Package/uboot/template,Hummingbird_A31,the Hummingbird A31 board)) -$(eval $(call Package/uboot/template,Mele_M9,the Mele M9 (A31))) -$(eval $(call Package/uboot/template,OLIMEX_A13_SOM,the Olimex A13 SOM)) -$(eval $(call Package/uboot/template,Linksprite_pcDuino,Linksprite pcDuino)) -$(eval $(call Package/uboot/template,Linksprite_pcDuino3,Linksprite pcDuino3)) -$(eval $(call Package/uboot/template,Lamobo_R1,Lamobo R1)) -$(eval $(call Package/uboot/template,orangepi_plus,Orange Pi Plus (H3))) -$(eval $(call Package/uboot/template,pangolin,Theobroma A31-yQ7 devboard,pangolin)) - -define Package/uboot-sunxi-all - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_sunxi - TITLE:=Meta package for selecting all variants of uboot-sunxi - URL:=http://www.denx.de/wiki/U-Boot - DEPENDS:=$(patsubst %,+%,$(UBOOT_SUNXI_PACKAGES)) +define U-Boot/A20-OLinuXino-Lime + BUILD_SUBTARGET:=cortexa7 + NAME:=A20 OLinuXino LIME + BUILD_DEVICES:=sun7i-a20-olinuxino-lime endef -ifdef BUILD_VARIANT -define Build/Configure - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - USE_PRIVATE_LIBGCC=yes $(BUILD_VARIANT)_defconfig +define U-Boot/A20-OLinuXino-Lime2 + BUILD_SUBTARGET:=cortexa7 + NAME:=A20 OLinuXino LIME2 + BUILD_DEVICES:=sun7i-a20-olinuxino-lime2 endef -define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) \ - DTCDIR=$(LINUX_DIR)/scripts/dtc/ +define U-Boot/A20-OLinuXino-Lime2-eMMC + BUILD_SUBTARGET:=cortexa7 + NAME:=A20 OLinuXino LIME2 eMMC + BUILD_DEVICES:=sun7i-a20-olinuxino-lime2-emmc endef -else # BUILD_VARIANT -define Build/Prepare -endef -define Build/Configure -endef -define Build/Compile -endef -endif # BUILD_VARIANT -$(foreach pkg,$(UBOOT_SUNXI_PACKAGES), \ - $(eval $(call BuildPackage,$(pkg))) \ -) -$(eval $(call BuildPackage,uboot-sunxi-all)) +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 \ + Cubieboard \ + 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 \ + 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 + +define Package/u-boot/install/default +endef + +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-sunxi/patches/001-use-dtc-in-kernel.patch b/package/boot/uboot-sunxi/patches/001-use-dtc-in-kernel.patch deleted file mode 100644 index 6471e7865..000000000 --- a/package/boot/uboot-sunxi/patches/001-use-dtc-in-kernel.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -348,7 +348,7 @@ OBJDUMP = $(CROSS_COMPILE)objdump - AWK = awk - PERL = perl - PYTHON = python --DTC = dtc -+DTC = $(DTCDIR)dtc - CHECK = sparse - - CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ 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 f29ad12b7..c19f3781d 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 e5a66d7eb..2fce04828 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 d8fa52c7e..000000000 --- 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 e36f9e3c5..000000000 --- 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 45416703a..000000000 --- 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 47f825c57..000000000 --- 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 cf511ce77..000000000 --- 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 95a77c68d..000000000 --- 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 04a2af72e..000000000 --- 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 098fe7203..000000000 --- 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 a216bc9f1..000000000 --- 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 e7b8cd73d..000000000 --- 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 d49fc9737..000000000 --- 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 000000000..a7bfdd62d --- /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 000000000..8db3e67e5 --- /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 000000000..df2300194 --- /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 a402feb3c..40d79878a 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 d200633bc..a8e03e2fb 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 bf5dc66e1..8bab22051 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 087074d0c..d140f2d53 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 ee1e3c9bf..41039796a 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 000000000..d61895a3f --- /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 000000000..25edf5104 --- /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 000000000..d40238d3a --- /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 000000000..1a5603417 --- /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 000000000..6f75259a7 --- /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 000000000..65ae63c64 --- /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 000000000..6240fe3f5 --- /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 000000000..d884173c4 --- /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 000000000..7a717fdc0 --- /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/boot/uboot-zynq/Makefile b/package/boot/uboot-zynq/Makefile index 61bb99dda..d25ecfb4b 100644 --- a/package/boot/uboot-zynq/Makefile +++ b/package/boot/uboot-zynq/Makefile @@ -6,121 +6,40 @@ # include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/image.mk -PKG_NAME:=u-boot PKG_VERSION:=2016.03 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot PKG_HASH:=e49337262ecac44dbdeac140f2c6ebd1eba345e0162b0464172e7f05583ed7bb -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - +include $(INCLUDE_DIR)/kernel.mk +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= - CONFIG:= - IMAGE:= +define U-Boot/Default + BUILD_TARGET:=zynq + UBOOT_IMAGE:=u-boot u-boot-dtb.bin u-boot.dtb u-boot-dtb.img spl/boot.bin spl/u-boot-spl spl/u-boot-spl-dtb.bin + UBOOT_CONFIG:=zynq_$(1) endef -define uboot/zc702 - TITLE:=U-Boot $(PKG_VERSION) for Xilinx ZC702 Dev Board +define U-Boot/zc702 + NAME:=Xilinx ZC702 Dev Board endef -define uboot/zc706 - TITLE:=U-Boot $(PKG_VERSION) for Xilinx ZC706 Dev Board +define U-Boot/zc706 + NAME:=Xilinx ZC706 Dev Board endef -define uboot/zed - TITLE:=U-Boot $(PKG_VERSION) for Avnet Digilent ZedBoard Dev Board +define U-Boot/zed + NAME:=Avnet Digilent ZedBoard Dev Board endef -define uboot/zybo - TITLE:=U-Boot $(PKG_VERSION) for Digilent Zybo Dev Board +define U-Boot/zybo + NAME:=Digilent Zybo Dev Board endef -UBOOTS := \ +UBOOT_TARGETS := \ zc702 \ zed \ - zybo \ + zybo -define Package/uboot/template -define Package/uboot-zynq-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_zynq - TITLE:=$(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) - MAINTAINER:=Jason Wu -endef -endef - -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) -endef - -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) -endif - -define Build/Configure - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - $(BOARD)_$(UBOOT_CONFIG)_config -endef - -define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) DTC=$(LINUX_DIR)/scripts/dtc/dtc -endef - -define Package/uboot/install/default - $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) - - $(CP) $(PKG_BUILD_DIR)/u-boot \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot.elf - - $(CP) $(PKG_BUILD_DIR)/u-boot-dtb.bin \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot-dtb.bin - - $(CP) $(PKG_BUILD_DIR)/u-boot.dtb \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot.dtb - - $(CP) $(PKG_BUILD_DIR)/u-boot-dtb.img \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot-dtb.img - - $(CP) $(PKG_BUILD_DIR)/spl/boot.bin \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/boot.bin - - $(CP) $(PKG_BUILD_DIR)/spl/u-boot-spl \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot-spl - - $(CP) $(PKG_BUILD_DIR)/spl/u-boot-spl-dtb.bin \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot-spl-dtb.bin -endef - -define Package/uboot/install/template -define Package/uboot-zynq-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-zynq-$(u))) \ -) +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/devel/binutils/Makefile b/package/devel/binutils/Makefile index 222922df2..291f45205 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-arc/Makefile b/package/devel/gdb-arc/Makefile index b19443753..6cdf6bdf5 100644 --- a/package/devel/gdb-arc/Makefile +++ b/package/devel/gdb-arc/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gdb-arc -PKG_VERSION:=arc-2016.03-gdb +PKG_VERSION:=arc-2017.03-gdb PKG_RELEASE:=1 -PKG_SOURCE:=gdb-arc-2016.03-gdb.tar.gz +PKG_SOURCE:=gdb-arc-2017.03-gdb.tar.gz PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/$(PKG_VERSION) PKG_HASH:=6a91f86cc487c1548d3f5d4f29f7226d2019c0db8a63633aeabd5914a340f3f9 -PKG_BUILD_DIR:=$(BUILD_DIR)/binutils-gdb-arc-2016.03-gdb +PKG_BUILD_DIR:=$(BUILD_DIR)/binutils-gdb-arc-2017.03-gdb PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 diff --git a/package/devel/gdb/Makefile b/package/devel/gdb/Makefile index 5d2583aad..4cf2aaa87 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.11.1 +PKG_VERSION:=8.0.1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb -PKG_HASH:=e9216da4e3755e9f414c1aa0026b626251dfc57ffe572a266e98da4f6988fc70 +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 @@ -55,11 +56,16 @@ CONFIGURE_ARGS+= \ --with-system-readline \ --without-expat \ --without-lzma \ + --disable-sim \ --disable-werror 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/001-gdb-pr14523-mips-signal-number.patch b/package/devel/gdb/patches/001-gdb-pr14523-mips-signal-number.patch index 417142419..25ac86fd9 100644 --- a/package/devel/gdb/patches/001-gdb-pr14523-mips-signal-number.patch +++ b/package/devel/gdb/patches/001-gdb-pr14523-mips-signal-number.patch @@ -2,7 +2,7 @@ See http://sourceware.org/bugzilla/show_bug.cgi?id=14523 --- --- a/gdb/common/signals.c +++ b/gdb/common/signals.c -@@ -344,6 +344,11 @@ gdb_signal_from_host (int hostsig) +@@ -348,6 +348,11 @@ gdb_signal_from_host (int hostsig) else if (64 <= hostsig && hostsig <= 127) return (enum gdb_signal) (hostsig - 64 + (int) GDB_SIGNAL_REALTIME_64); diff --git a/package/devel/gdb/patches/100-musl_fix.patch b/package/devel/gdb/patches/100-musl_fix.patch index 09146c563..b167fe6ec 100644 --- a/package/devel/gdb/patches/100-musl_fix.patch +++ b/package/devel/gdb/patches/100-musl_fix.patch @@ -50,4 +50,4 @@ +#undef pt_regs #include "nat/ppc-linux.h" - + #include "linux-ppc-tdesc.h" diff --git a/package/devel/gdb/patches/110-shared_libgcc.patch b/package/devel/gdb/patches/110-shared_libgcc.patch new file mode 100644 index 000000000..929a5ae97 --- /dev/null +++ b/package/devel/gdb/patches/110-shared_libgcc.patch @@ -0,0 +1,76 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -1300,13 +1300,13 @@ if test -z "$LD"; then + fi + fi + +-# Check whether -static-libstdc++ -static-libgcc is supported. ++# Check whether -static-libstdc++ is supported. + have_static_libs=no + if test "$GCC" = yes; then + saved_LDFLAGS="$LDFLAGS" + +- LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc" +- AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc]) ++ LDFLAGS="$LDFLAGS -static-libstdc++" ++ AC_MSG_CHECKING([whether g++ accepts -static-libstdc++]) + AC_LANG_PUSH(C++) + AC_LINK_IFELSE([ + #if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) +@@ -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 +- stage1_ldflags="-static-libstdc++ -static-libgcc" ++ stage1_ldflags="-static-libstdc++" + fi]) + AC_SUBST(stage1_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 +- poststage1_ldflags="-static-libstdc++ -static-libgcc" ++ poststage1_ldflags="-static-libstdc++" + fi]) + AC_SUBST(poststage1_ldflags) + +--- a/configure ++++ b/configure +@@ -5005,14 +5005,14 @@ if test -z "$LD"; then + fi + fi + +-# Check whether -static-libstdc++ -static-libgcc is supported. ++# Check whether -static-libstdc++ is supported. + have_static_libs=no + if test "$GCC" = yes; then + saved_LDFLAGS="$LDFLAGS" + +- LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc" +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether g++ accepts -static-libstdc++ -static-libgcc" >&5 +-$as_echo_n "checking whether g++ accepts -static-libstdc++ -static-libgcc... " >&6; } ++ LDFLAGS="$LDFLAGS -static-libstdc++" ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether g++ accepts -static-libstdc++" >&5 ++$as_echo_n "checking whether g++ accepts -static-libstdc++... " >&6; } + ac_ext=cpp + ac_cpp='$CXXCPP $CPPFLAGS' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +@@ -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 +- stage1_ldflags="-static-libstdc++ -static-libgcc" ++ stage1_ldflags="-static-libstdc++" + fi + fi + +@@ -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 +- poststage1_ldflags="-static-libstdc++ -static-libgcc" ++ poststage1_ldflags="-static-libstdc++" + fi + fi + diff --git a/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch b/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch new file mode 100644 index 000000000..8afa8ccf8 --- /dev/null +++ b/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch @@ -0,0 +1,38 @@ +From 56893a61aa4f0270fa8d1197b9848247f90fce0d Mon Sep 17 00:00:00 2001 +From: Yousong Zhou +Date: Fri, 24 Mar 2017 10:36:03 +0800 +Subject: [PATCH] Fix invalid sigprocmask call + +The POSIX document says + + The pthread_sigmask() and sigprocmask() functions shall fail if: + + [EINVAL] + The value of the how argument is not equal to one of the defined values. + +and this is how musl-libc is currently doing. Fix the call to be safe +and correct + + [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html + +gdb/ChangeLog: +2017-03-24 Yousong Zhou + + * common/signals-state-save-restore.c (save_original_signals_state): + Fix invalid sigprocmask call. +--- + gdb/ChangeLog | 5 +++++ + gdb/common/signals-state-save-restore.c | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +--- 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) + int i; + int res; + +- res = sigprocmask (0, NULL, &original_signal_mask); ++ res = sigprocmask (SIG_BLOCK, NULL, &original_signal_mask); + if (res == -1) + perror_with_name (("sigprocmask")); + diff --git a/package/devel/perf/Makefile b/package/devel/perf/Makefile index 8ff9bfa5e..5bfcaa699 100644 --- a/package/devel/perf/Makefile +++ b/package/devel/perf/Makefile @@ -26,7 +26,7 @@ include $(INCLUDE_DIR)/package.mk define Package/perf SECTION:=devel CATEGORY:=Development - DEPENDS:= +libelf1 +libdw +libpthread +librt +objdump @!LINUX_3_18 @!IN_SDK + DEPENDS:= +libelf1 +libdw +libpthread +librt +objdump @!LINUX_3_18 @!IN_SDK @!TARGET_arc770 @KERNEL_PERF_EVENTS TITLE:=Linux performance monitoring tool VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE) URL:=http://www.kernel.org @@ -51,6 +51,7 @@ MAKE_FLAGS = \ NO_GTK2=1 \ NO_LIBAUDIT=1 \ NO_LIBCRYPTO=1 \ + NO_LIBUNWIND=1 \ CROSS_COMPILE="$(TARGET_CROSS)" \ CC="$(TARGET_CC)" \ LD="$(TARGET_CROSS)ld" \ @@ -60,9 +61,11 @@ MAKE_FLAGS = \ WERROR=0 \ prefix=/usr +ifdef CONFIG_LINUX_4_4 ifdef CONFIG_USE_MUSL MAKE_FLAGS += EXTRA_CFLAGS="-I$(CURDIR)/musl-include -include $(CURDIR)/musl-compat.h -D__UCLIBC__" endif +endif define Build/Compile +$(MAKE_FLAGS) $(MAKE) $(PKG_JOBS) \ diff --git a/package/devel/strace/Makefile b/package/devel/strace/Makefile index dae6aff15..6209dc5a6 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.16 +PKG_VERSION:=4.20 PKG_RELEASE:=1 -PKG_HASH:=98487cb5178ec1259986cc9f6e2a844f50e5d1208c112cc22431a1e4d9adf0ef 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 57ab75f96..6be2f9ec1 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/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index aec8bf27c..4af364825 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -13,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 @@ -47,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 ab4d43e8c..000000000 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 000000000..9ac592120 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 379bdc8ce..000000000 Binary files a/package/firmware/ipq-wifi/board-rt-ac58u.bin and /dev/null differ diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile index 82d7664b7..fe094e76a 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:= @@ -29,7 +29,7 @@ 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 @@ -69,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 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 000000000..bdc82f006 --- /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/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c index b3803f90e..f764eba1f 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 22f1e23c4..4e10d72fe 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/linux/modules/w1.mk b/package/kernel/linux/modules/w1.mk index 15b39207e..e936a2814 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 385bea4d2..cf17c9f4f 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 PKG_VERSION:=2017-11-01 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources PKG_HASH:=8437ab7886b988c8152e7a4db30b7f41009e49a3b2cb863edd05da1ecd7eb05a @@ -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 \ @@ -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,7 +324,7 @@ 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 @@ -1571,6 +1579,7 @@ config-$(call config_package,airo) += AIRO 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 diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh index 22a00a592..354077733 100644 --- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh +++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh @@ -116,7 +116,7 @@ detect_mac80211() { set wireless.radio${devidx}.hwmode=11${mode_band} ${dev_id} ${ht_capab} - set wireless.radio${devidx}.disabled=0 + set wireless.radio${devidx}.disabled=1 set wireless.default_radio${devidx}=wifi-iface set wireless.default_radio${devidx}.device=radio${devidx} 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 000000000..703051fe1 --- /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 000000000..604a6f158 --- /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/937-ath10k-calibration-variant.patch b/package/kernel/mac80211/patches/937-ath10k-calibration-variant.patch new file mode 100644 index 000000000..f9a830c7a --- /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/lean/default-settings/Makefile b/package/lean/default-settings/Makefile index 7d7a5b34c..d8170a254 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:=32 +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 1829c279b..4b11abb7e 100755 --- a/package/lean/default-settings/files/zzz-default-settings +++ b/package/lean/default-settings/files/zzz-default-settings @@ -27,7 +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 -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 @@ -46,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.5.3 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='OpenWrt 17.01.4'" >> /etc/openwrt_release +echo "DISTRIB_DESCRIPTION='OpenWrt '" >> /etc/openwrt_release exit 0 diff --git a/package/lean/polarssl/Makefile b/package/lean/polarssl/Makefile new file mode 100644 index 000000000..57fa81e91 --- /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 000000000..56c6c4d23 --- /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 000000000..6fef1a6f5 --- /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/libs/argp-standalone/patches/001-throw-in-funcdef.patch b/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch index 4a90751e1..2dcfe9c21 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 a726691d3..07e1eb815 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 diff --git a/package/libs/libevent2/Makefile b/package/libs/libevent2/Makefile index 99034bb22..5d56f37c5 100644 --- a/package/libs/libevent2/Makefile +++ b/package/libs/libevent2/Makefile @@ -17,6 +17,7 @@ PKG_SOURCE_URL:=@SF/levent PKG_HASH:=71c2c49f0adadacfdbe6332a372c38cf9c8b7895bb73dabeaa53cdcc1d4e1fa3 PKG_MAINTAINER:=Jo-Philipp Wich 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 9776711a7..ac7bfddf5 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 87dbc4708..eeb7870f0 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 @@ -27,7 +28,7 @@ PKG_MAINTAINER:=Felix Fietkau include $(INCLUDE_DIR)/package.mk -TARGET_CFLAGS += $(FPIC) +TARGET_CFLAGS += $(FPIC) -Wno-implicit-fallthrough define Package/libjson-c SECTION:=libs diff --git a/package/libs/libnetfilter-conntrack/Makefile b/package/libs/libnetfilter-conntrack/Makefile index 399aa6ce1..be8228531 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 dd8fd9f09..8a11d0798 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 81faffe82..92e750d51 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 5b541f451..f4a1bb132 100644 --- a/package/libs/libnftnl/Makefile +++ b/package/libs/libnftnl/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnftnl -PKG_VERSION:=1.0.6 +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.6 -PKG_MIRROR_HASH:=c9e066e3fd29951cbe96d2898b4d6cdcfe802b3a4f09f8273a508e7a0a20a357 +PKG_SOURCE_VERSION:=libnftnl-1.0.7 +PKG_MIRROR_HASH:=d38a409d52074a5b20f5b7477b385506692a9a05ec6f4ac3d14a8a80aa4f81d9 PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=GPL-2.0+ diff --git a/package/libs/libnl/Makefile b/package/libs/libnl/Makefile index 7916556c0..67201cc7c 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 a31ef4772..000000000 --- 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 000000000..845a59376 --- /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 000000000..11dc75b89 --- /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 000000000..f715bb83f --- /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/libpcap/Makefile b/package/libs/libpcap/Makefile index 4d0ce4099..e702d5c05 100644 --- a/package/libs/libpcap/Makefile +++ b/package/libs/libpcap/Makefile @@ -12,7 +12,8 @@ PKG_VERSION:=1.8.1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://www.tcpdump.org/release/ +PKG_SOURCE_URL:=http://www.us.tcpdump.org/release/ \ + http://www.tcpdump.org/release/ PKG_HASH:=673dbc69fdc3f5a86fb5759ab19899039a8e5e6c631749e48dcd9c6f0c83541e PKG_FIXUP:=patch-libtool diff --git a/package/libs/librpc/Makefile b/package/libs/librpc/Makefile index 0330614c3..e8f51a23f 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 5eb521a72..8cef09f78 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 01b3a32b1..9b7d867f6 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_URL=$(PROJECT_GIT)/project/libubox.git PKG_SOURCE_DATE:=2018-01-07 -PKG_SOURCE_VERSION:=1dafcd7813f147811a6bbdb00eec603fe732aac1 -PKG_MIRROR_HASH:=0bd0f0980cdb01950da4f10bffbb8089ffd76d442fc443b5f8e1aa860b429063 +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 44f1ef256..2e655ed6f 100644 --- a/package/libs/libunwind/Makefile +++ b/package/libs/libunwind/Makefile @@ -20,6 +20,7 @@ PKG_INSTALL:=1 PKG_LICENSE:=X11 PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:libunwind_project:libunwind PKG_MAINTAINER:=Yousong Zhou diff --git a/package/libs/libusb-compat/Makefile b/package/libs/libusb-compat/Makefile index 59c5a80bd..0dc93941a 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/lzo/Makefile b/package/libs/lzo/Makefile index 8d85e4652..ef33619d8 100644 --- a/package/libs/lzo/Makefile +++ b/package/libs/lzo/Makefile @@ -42,10 +42,6 @@ CONFIGURE_ARGS += \ TARGET_CFLAGS += $(FPIC) MAKE_FLAGS += CFLAGS_O="$(TARGET_CFLAGS)" -ifeq ($(CONFIG_i386)$(CONFIG_x86_64),) - TARGET_CFLAGS += -DLZO_CFG_NO_UNALIGNED=1 -endif - define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/include/lzo $(1)/usr/include/ diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index 0e3383150..3a2b29228 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/mbedtls/patches/200-config.patch b/package/libs/mbedtls/patches/200-config.patch index ce32be76a..5fbd6b145 100644 --- a/package/libs/mbedtls/patches/200-config.patch +++ b/package/libs/mbedtls/patches/200-config.patch @@ -269,12 +269,3 @@ /* \} name SECTION: mbed TLS modules */ -@@ -2681,7 +2681,7 @@ - * recommended because of it is possible to generte SHA-1 collisions, however - * this may be safe for legacy infrastructure where additional controls apply. - */ --// #define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES -+#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES - - /** - * Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake diff --git a/package/libs/ncurses/Makefile b/package/libs/ncurses/Makefile index 60a8a176d..26fabeef7 100644 --- a/package/libs/ncurses/Makefile +++ b/package/libs/ncurses/Makefile @@ -44,6 +44,14 @@ define Package/libncurses ABI_VERSION:=$(PKG_VERSION) endef +define Package/libncurses-dev + SECTION:=devel + CATEGORY:=Development + SUBMENU:=Libraries + DEPENDS:=zlib + TITLE:=Development files for the ncurses library +endef + TARGET_CFLAGS += $(FPIC) CONFIGURE_ARGS += \ @@ -124,6 +132,17 @@ define Package/libncurses/install done endef +define Package/libncurses-dev/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.a $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/ +endef + define Build/InstallDev $(CP) $(PKG_INSTALL_DIR)/* $(1) for lib in ncurses panel menu form; do \ @@ -150,3 +169,4 @@ endef $(eval $(call HostBuild)) $(eval $(call BuildPackage,terminfo)) $(eval $(call BuildPackage,libncurses)) +$(eval $(call BuildPackage,libncurses-dev)) diff --git a/package/libs/nghttp2/Makefile b/package/libs/nghttp2/Makefile new file mode 100644 index 000000000..3cc2a5543 --- /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 b949d3beb..96d3ba3e9 100644 --- a/package/libs/openssl/Config.in +++ b/package/libs/openssl/Config.in @@ -55,6 +55,11 @@ config OPENSSL_HARDWARE_SUPPORT 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 diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 4b70bc724..b75aa45e8 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -18,15 +18,17 @@ PKG_BUILD_PARALLEL:=0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://www.openssl.org/source/ \ - ftp://ftp.openssl.org/source/ \ - http://www.openssl.org/source/old/$(PKG_BASE)/ \ - ftp://ftp.funet.fi/pub/crypt/mirrors/ftp.openssl.org/source \ - ftp://ftp.sunet.se/pub/security/tools/net/openssl/source/ +PKG_SOURCE_URL:= \ + http://ftp.fi.muni.cz/pub/openssl/source/ \ + http://ftp.linux.hr/pub/openssl/source/ \ + http://gd.tuwien.ac.at/infosys/security/openssl/source/ \ + http://www.openssl.org/source/ \ + http://www.openssl.org/source/old/$(PKG_BASE)/ 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 \ @@ -39,7 +41,8 @@ PKG_CONFIG_DEPENDS:= \ 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 @@ -153,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 @@ -160,6 +167,8 @@ else OPENSSL_OPTIONS+=no-sse2 ifeq ($(CONFIG_mips)$(CONFIG_mipsel),y) OPENSSL_TARGET:=linux-mips-openwrt + else ifeq ($(CONFIG_aarch64),y) + OPENSSL_TARGET:=linux-aarch64-openwrt else ifeq ($(CONFIG_arm)$(CONFIG_armeb),y) OPENSSL_TARGET:=linux-armv4-openwrt else @@ -181,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/110-optimize-for-size.patch b/package/libs/openssl/patches/110-optimize-for-size.patch index 0f174a346..d6d4a2111 100644 --- a/package/libs/openssl/patches/110-optimize-for-size.patch +++ b/package/libs/openssl/patches/110-optimize-for-size.patch @@ -1,11 +1,12 @@ --- a/Configure +++ b/Configure -@@ -470,6 +470,12 @@ my %table=( +@@ -470,6 +470,13 @@ my %table=( "linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", "linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", +# OpenWrt targets +"linux-armv4-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"linux-aarch64-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${aarch64_asm}:linux64:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"linux-x86_64-openwrt", "gcc:-m64 -DL_ENDIAN -DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", +"linux-mips-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"linux-generic-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", diff --git a/package/libs/openssl/patches/160-disable_doc_tests.patch b/package/libs/openssl/patches/160-disable_doc_tests.patch index 73459ff90..e38d44a76 100644 --- a/package/libs/openssl/patches/160-disable_doc_tests.patch +++ b/package/libs/openssl/patches/160-disable_doc_tests.patch @@ -36,7 +36,7 @@ build_libs: build_libcrypto build_libssl openssl.pc -@@ -534,7 +534,7 @@ dist: +@@ -542,7 +542,7 @@ dist: @$(MAKE) SDIRS='$(SDIRS)' clean @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar @@ -47,7 +47,7 @@ @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \ --- a/Makefile.org +++ b/Makefile.org -@@ -532,7 +532,7 @@ dist: +@@ -540,7 +540,7 @@ dist: @$(MAKE) SDIRS='$(SDIRS)' clean @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar diff --git a/package/libs/openssl/patches/200-parallel_build.patch b/package/libs/openssl/patches/200-parallel_build.patch index f1d9f0705..f2acc4a27 100644 --- a/package/libs/openssl/patches/200-parallel_build.patch +++ b/package/libs/openssl/patches/200-parallel_build.patch @@ -24,7 +24,7 @@ all_testapps: build_libs build_testapps build_testapps: -@@ -465,7 +465,7 @@ update: errors stacks util/libeay.num ut +@@ -473,7 +473,7 @@ update: errors stacks util/libeay.num ut @set -e; target=update; $(RECURSIVE_BUILD_CMD) depend: @@ -33,7 +33,7 @@ lint: @set -e; target=lint; $(RECURSIVE_BUILD_CMD) -@@ -527,9 +527,9 @@ dist: +@@ -535,9 +535,9 @@ dist: @$(MAKE) SDIRS='$(SDIRS)' clean @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar @@ -45,7 +45,7 @@ @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \ -@@ -538,12 +538,19 @@ install_sw: +@@ -546,12 +546,19 @@ install_sw: $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \ $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \ $(INSTALL_PREFIX)$(OPENSSLDIR)/private @@ -66,7 +66,7 @@ @set -e; liblist="$(LIBS)"; for i in $$liblist ;\ do \ if [ -f "$$i" ]; then \ -@@ -627,12 +634,7 @@ install_html_docs: +@@ -635,12 +642,7 @@ install_html_docs: done; \ done @@ -173,7 +173,7 @@ apps: @(cd ..; $(MAKE) DIRS=apps all) -@@ -577,7 +577,7 @@ $(DTLSTEST)$(EXE_EXT): $(DTLSTEST).o ssl +@@ -578,7 +578,7 @@ $(DTLSTEST)$(EXE_EXT): $(DTLSTEST).o ssl # fi dummytest$(EXE_EXT): dummytest.o $(DLIBCRYPTO) diff --git a/package/libs/libreadline/Makefile b/package/libs/readline/Makefile similarity index 95% rename from package/libs/libreadline/Makefile rename to package/libs/readline/Makefile index 3c1b048fe..ca3a46863 100644 --- a/package/libs/libreadline/Makefile +++ b/package/libs/readline/Makefile @@ -17,12 +17,14 @@ 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 PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/host-build.mk define Package/libreadline SECTION:=libs @@ -69,4 +71,5 @@ define Package/libreadline/install $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{history,readline}.{so,so.7,so.7.0} $(1)/usr/lib/ endef +$(eval $(call HostBuild)) $(eval $(call BuildPackage,libreadline)) diff --git a/package/libs/libreadline/patches/001-install_perm.patch b/package/libs/readline/patches/001-install_perm.patch similarity index 100% rename from package/libs/libreadline/patches/001-install_perm.patch rename to package/libs/readline/patches/001-install_perm.patch diff --git a/package/libs/toolchain/Makefile b/package/libs/toolchain/Makefile index 58bd06cb5..ce0acd19b 100644 --- a/package/libs/toolchain/Makefile +++ b/package/libs/toolchain/Makefile @@ -275,6 +275,32 @@ define Package/libgfortran/config endmenu endef +define Package/libgomp +$(call Package/gcc/Default) + TITLE:=OpenMP support library +endef + +define Package/libgomp/config + menu "Configuration" + depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgomp + + config LIBGOMP_ROOT_DIR + string + prompt "libgomp shared library base directory" + depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgomp + default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN + default "/" if NATIVE_TOOLCHAIN + + config LIBGOMP_FILE_SPEC + string + prompt "libgomp shared library files (use wildcards)" + depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgomp + default "./lib/libgomp.so*" + + endmenu +endef + + define Package/ldd $(call Package/libc/Default) DEPENDS:=@!USE_MUSL @@ -343,9 +369,6 @@ LIBGCC_SO=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/libgcc_s.so.*)) define Build/Compile/uClibc $(CP) \ $(TOOLCHAIN_DIR)/lib/libuClibc-*.so \ - $(TOOLCHAIN_DIR)/lib/libcrypt-*.so \ - $(TOOLCHAIN_DIR)/lib/libm-*.so \ - $(TOOLCHAIN_DIR)/lib/libpthread-*.so \ $(PKG_BUILD_DIR)/ endef ifneq ($(LIBGCC_SO),) @@ -415,17 +438,8 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) $(TOOLCHAIN_DIR)/lib/libc.so.* \ $(TOOLCHAIN_DIR)/lib/libuClibc-$(LIBC_SO_VERSION).so \ $(1)/lib/ - for file in libcrypt libdl libm libutil; do \ - $(CP) \ - $(TOOLCHAIN_DIR)/lib/$$$$file.so.* \ - $(TOOLCHAIN_DIR)/lib/$$$$file-$(LIBC_SO_VERSION).so \ - $(1)/lib/; \ - done - $(CP) \ $(PKG_BUILD_DIR)/libuClibc-* \ - $(PKG_BUILD_DIR)/libm-* \ - $(PKG_BUILD_DIR)/libcrypt-* \ $(1)/lib/ endef @@ -457,7 +471,7 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) define Package/libpthread/install $(INSTALL_DIR) $(1)/lib - ifneq ($(CONFIG_USE_MUSL),y) + ifneq ($(CONFIG_USE_MUSL)$(CONFIG_USE_UCLIBC),y) $(CP) \ $(TOOLCHAIN_DIR)/lib/libpthread.so.* \ $(TOOLCHAIN_DIR)/lib/libpthread-$(LIBC_SO_VERSION).so \ @@ -482,7 +496,7 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) define Package/librt/install $(INSTALL_DIR) $(1)/lib - ifneq ($(CONFIG_USE_MUSL),y) + ifneq ($(CONFIG_USE_MUSL)$(CONFIG_USE_UCLIBC),y) $(CP) \ $(TOOLCHAIN_DIR)/lib/librt.so.* \ $(TOOLCHAIN_DIR)/lib/librt-$(LIBC_SO_VERSION).so \ @@ -573,6 +587,14 @@ else exit 0 endef + define Package/libgomp/install + for file in $(call qstrip,$(CONFIG_LIBGOMP_FILE_SPEC)); do \ + $(INSTALL_DIR) $(1)/lib ; \ + $(CP) $(call qstrip,$(CONFIG_LIBGOMP_ROOT_DIR))/$$$$file $(1)/lib/ ; \ + done ; \ + exit 0 + endef + define Package/ldd/install for file in $(call qstrip,$(CONFIG_LDD_FILE_SPEC)); do \ dir=`dirname $$$$file` ; \ @@ -602,5 +624,6 @@ $(eval $(call BuildPackage,libpthread)) $(eval $(call BuildPackage,libthread-db)) $(eval $(call BuildPackage,librt)) $(eval $(call BuildPackage,libgfortran)) +$(eval $(call BuildPackage,libgomp)) $(eval $(call BuildPackage,ldd)) $(eval $(call BuildPackage,ldconfig)) diff --git a/package/libs/uclient/Makefile b/package/libs/uclient/Makefile index 3eefa2e01..f0c08a323 100644 --- a/package/libs/uclient/Makefile +++ b/package/libs/uclient/Makefile @@ -4,7 +4,7 @@ PKG_NAME:=uclient PKG_RELEASE=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/uclient.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/uclient.git PKG_SOURCE_DATE:=2017-11-02 PKG_SOURCE_VERSION:=4b87d83160fec70d50b7fcd736a8c538c28a016c PKG_MIRROR_HASH:=4bbb4d5f295ebdcd67fec87a6794168bea2176a42cb2907c47d8566fb33dafb3 diff --git a/package/libs/ustream-ssl/Makefile b/package/libs/ustream-ssl/Makefile index ff6c4b7d0..b5e773ba7 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 371bb564f..7e8a4b6ce 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 69% rename from package/libs/cyassl/Makefile rename to package/libs/wolfssl/Makefile index 0212ff73d..1d4b7f557 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. @@ -20,24 +20,27 @@ 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/cyassl/patches/001-CVE-2017-13099.patch b/package/libs/wolfssl/patches/001-CVE-2017-13099.patch similarity index 100% rename from package/libs/cyassl/patches/001-CVE-2017-13099.patch rename to package/libs/wolfssl/patches/001-CVE-2017-13099.patch 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 000000000..83d51b1d5 --- /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/network/config/firewall/Makefile b/package/network/config/firewall/Makefile index e5fcb8c91..1bc2c4d1f 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 9193f5c9f..b191327f8 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 3301cee00..e604bfb25 100755 --- a/package/network/config/gre/files/gre.sh +++ b/package/network/config/gre/files/gre.sh @@ -31,7 +31,16 @@ gre_generic_setup() { json_add_string local "$local" json_add_string remote "$remote" [ -n "$tunlink" ] && json_add_string link "$tunlink" - json_add_string info "${ikey:-0},${okey:-0},${icsum:-0},${ocsum:-0},${iseqno:-0},${oseqno:-0}" + + json_add_object 'data' + [ -n "$ikey" ] && json_add_int ikey "$ikey" + [ -n "$okey" ] && json_add_int okey "$okey" + [ -n "$icsum" ] && json_add_boolean icsum "$icsum" + [ -n "$ocsum" ] && json_add_boolean ocsum "$ocsum" + [ -n "$iseqno" ] && json_add_boolean iseqno "$iseqno" + [ -n "$oseqno" ] && json_add_boolean oseqno "$oseqno" + json_close_object + proto_close_tunnel proto_add_data diff --git a/package/network/config/ltq-adsl-app/Makefile b/package/network/config/ltq-adsl-app/Makefile index 6e0b47f87..3fa9f67d3 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 000000000..7bc72a63f --- /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 000000000..8a76b926f --- /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 dcde6b233..d93d47808 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,14 +47,15 @@ start() { return 1 } - esi $(printf '%012X' $((1+0x$(tr -d : +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 1ddb83a0a..fd5014957 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 @@ -28,7 +28,7 @@ define Package/ltq-vdsl-app CATEGORY:=Network TITLE:=Lantiq VDSL userland tool URL:=http://www.lantiq.com/ - DEPENDS:=@TARGET_lantiq_xrx200 +libpthread +librt +atm-esi + DEPENDS:=@TARGET_lantiq_xrx200 +libpthread +librt endef define Package/ltq-vdsl-app/description @@ -58,9 +58,10 @@ CONFIGURE_ARGS += \ #CONFIGURE_ARGS += --enable-model=debug define Package/ltq-vdsl-app/install - $(INSTALL_DIR) $(1)/etc/init.d $(1)/sbin + $(INSTALL_DIR) $(1)/etc/init.d $(1)/sbin $(1)/etc/hotplug.d/dsl $(INSTALL_BIN) ./files/dsl_control $(1)/etc/init.d/ - $(INSTALL_BIN) ./files/vdsl_cpe_control_wrapper $(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/vdsl_cpe_control $(INSTALL_BIN) ./files/dsl_cpe_pipe.sh $(1)/sbin/ diff --git a/package/network/config/ltq-vdsl-app/files/10_atm.sh b/package/network/config/ltq-vdsl-app/files/10_atm.sh new file mode 100755 index 000000000..e104a14b2 --- /dev/null +++ b/package/network/config/ltq-vdsl-app/files/10_atm.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +[ "$DSL_NOTIFICATION_TYPE" = "DSL_STATUS" ] && \ +[ "$DSL_TC_LAYER_STATUS" = "ATM" ] && \ +! grep -q "ltq_atm_vr9" /proc/modules || exit 0 + +logger -p daemon.notice -t "dsl-notify" "Switching to TC-Layer ATM" + +if grep -q "ltq_ptm_vr9" /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 + +modprobe ltq_atm_vr9 diff --git a/package/network/config/ltq-vdsl-app/files/10_ptm.sh b/package/network/config/ltq-vdsl-app/files/10_ptm.sh new file mode 100755 index 000000000..1c62617bb --- /dev/null +++ b/package/network/config/ltq-vdsl-app/files/10_ptm.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +[ "$DSL_NOTIFICATION_TYPE" = "DSL_STATUS" ] && \ +[ "$DSL_TC_LAYER_STATUS" = "EFM" ] && \ +! grep -q "ltq_ptm_vr9" /proc/modules || exit 0 + +logger -p daemon.notice -t "dsl-notify" "Switching to TC-Layer EFM/PTM" + +if grep -q "ltq_atm_vr9" /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 + +modprobe ltq_ptm_vr9 diff --git a/package/network/config/ltq-vdsl-app/files/dsl_control b/package/network/config/ltq-vdsl-app/files/dsl_control index d7980b411..818990e57 100644 --- a/package/network/config/ltq-vdsl-app/files/dsl_control +++ b/package/network/config/ltq-vdsl-app/files/dsl_control @@ -180,6 +180,7 @@ start_service() { local xtse local xfer_mode local line_mode + local tc_layer local mode local lowlevel local snr @@ -194,37 +195,44 @@ start_service() { eval "xtse=\"\${xtse_xdsl_$annex}\"" - [ -z "${xfer_mode}" ] && xfer_mode=ptm - case "${xfer_mode}" in atm) - LOAD=ltq_atm_vr9 - UNLOAD=ltq_ptm_vr9 - - # in most cases atm is used on top of adsl - [ -z "${line_mode}" ] && line_mode=adsl + tc_layer="-T1:0x1:0x1_1:0x1:0x1" ;; - *) - LOAD=ltq_ptm_vr9 - UNLOAD=ltq_atm_vr9 - - # in most cases ptm is used on top of vdsl - [ -z "${line_mode}" ] && line_mode=vdsl + ptm) + tc_layer="-T2:0x1:0x1_2:0x1:0x1" ;; esac case "${line_mode}" in adsl) - mode=1 + mode="-M1" - # mask out VDSL bits when ATM is requested + # mask out VDSL bits when ADSL is requested xtse="${xtse%_*}_00" ;; - *) - mode=2 + vdsl) + mode="-M2" + + # mask out ADSL bits when VDSL is requested + xtse="00_00_00_00_00_00_00_${xtse##*_}" ;; esac + local annexgpio="/sys/class/gpio/annex" + if [ -d "${annexgpio}a" ] && [ -d "${annexgpio}b" ]; then + case "${annex}" in + a*|l*|m*) + echo 1 > "${annexgpio}a/value" + echo 0 > "${annexgpio}b/value" + ;; + b*|j*) + echo 0 > "${annexgpio}a/value" + echo 1 > "${annexgpio}b/value" + ;; + esac + fi + if [ -z "${firmware}" ]; then # search for the firmware provided by dsl-vrx200-firmware-xdsl-* if grep -qE "system type.*: (VR9|xRX200)" /proc/cpuinfo; then @@ -287,14 +295,14 @@ start_service() { } procd_open_instance - procd_set_param command /sbin/vdsl_cpe_control_wrapper \ + procd_set_param command /sbin/vdsl_cpe_control \ -i$xtse \ -n /sbin/dsl_notify.sh \ -f ${firmware} \ $lowlevel \ - -M ${mode} \ + ${mode} \ + ${tc_layer} \ $autoboot - procd_append_param env "LOAD=$LOAD" "UNLOAD=$UNLOAD" procd_close_instance } diff --git a/package/network/config/ltq-vdsl-app/files/vdsl_cpe_control_wrapper b/package/network/config/ltq-vdsl-app/files/vdsl_cpe_control_wrapper deleted file mode 100644 index cc127f777..000000000 --- a/package/network/config/ltq-vdsl-app/files/vdsl_cpe_control_wrapper +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -for mod in $UNLOAD; do - grep -q "$mod " /proc/modules && rmmod "$mod" -done -for mod in $LOAD; do - grep -q "$mod " /proc/modules || insmod "$mod" -done - -esi $(printf '%012X' $((1+0x$(tr -d : 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 e841f9185..00604f40e 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 ea02d68bb..143e4451b 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/config/qos-scripts/Makefile b/package/network/config/qos-scripts/Makefile index 1b43ba1d3..07e68835c 100644 --- a/package/network/config/qos-scripts/Makefile +++ b/package/network/config/qos-scripts/Makefile @@ -10,6 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=qos-scripts PKG_VERSION:=1.3.0 PKG_RELEASE:=1 +PKG_LICENSE:=GPL-2.0 PKG_MAINTAINER:=Felix Fietkau diff --git a/package/network/config/vti/Makefile b/package/network/config/vti/Makefile index bda2a9ab1..0a4657c94 100644 --- a/package/network/config/vti/Makefile +++ b/package/network/config/vti/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=vti PKG_VERSION:=1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/config/vti/files/vti.sh b/package/network/config/vti/files/vti.sh index 763fd4ee3..0443800a0 100755 --- a/package/network/config/vti/files/vti.sh +++ b/package/network/config/vti/files/vti.sh @@ -26,7 +26,12 @@ vti_generic_setup() { json_add_string local "$local" json_add_string remote "$remote" [ -n "$tunlink" ] && json_add_string link "$tunlink" - json_add_string info "${ikey:-0},${okey:-0}" + + json_add_object 'data' + [ -n "$ikey" ] && json_add_int ikey "$ikey" + [ -n "$okey" ] && json_add_int okey "$okey" + json_close_object + proto_close_tunnel proto_add_data diff --git a/package/network/config/vxlan/Makefile b/package/network/config/vxlan/Makefile new file mode 100644 index 000000000..a471d4e90 --- /dev/null +++ b/package/network/config/vxlan/Makefile @@ -0,0 +1,32 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=vxlan +PKG_VERSION:=1 +PKG_LICENSE:=GPL-2.0 + +include $(INCLUDE_DIR)/package.mk + +define Package/vxlan + SECTION:=net + CATEGORY:=Network + MAINTAINER:=Matthias Schiffer + TITLE:=Virtual eXtensible LAN config support + DEPENDS:=+kmod-vxlan +endef + +define Package/vxlan/description + Virtual eXtensible LAN config support in /etc/config/network. +endef + +define Build/Compile +endef + +define Build/Configure +endef + +define Package/vxlan/install + $(INSTALL_DIR) $(1)/lib/netifd/proto + $(INSTALL_BIN) ./files/vxlan.sh $(1)/lib/netifd/proto/vxlan.sh +endef + +$(eval $(call BuildPackage,vxlan)) diff --git a/package/network/config/vxlan/files/vxlan.sh b/package/network/config/vxlan/files/vxlan.sh new file mode 100755 index 000000000..27ccd8f12 --- /dev/null +++ b/package/network/config/vxlan/files/vxlan.sh @@ -0,0 +1,148 @@ +#!/bin/sh + +[ -n "$INCLUDE_ONLY" ] || { + . /lib/functions.sh + . /lib/functions/network.sh + . ../netifd-proto.sh + init_proto "$@" +} + +vxlan_generic_setup() { + local cfg="$1" + local mode="$2" + local local="$3" + local remote="$4" + + local link="$cfg" + + local port vid ttl tos mtu macaddr zone + json_get_vars port vid ttl tos mtu macaddr zone + + + proto_init_update "$link" 1 + + proto_add_tunnel + json_add_string mode "$mode" + + [ -n "$tunlink" ] && json_add_string link "$tunlink" + [ -n "$local" ] && json_add_string local "$local" + [ -n "$remote" ] && json_add_string remote "$remote" + + [ -n "$ttl" ] && json_add_int ttl "$ttl" + [ -n "$tos" ] && json_add_string tos "$tos" + [ -n "$mtu" ] && json_add_int mtu "$mtu" + + json_add_object 'data' + [ -n "$port" ] && json_add_int port "$port" + [ -n "$vid" ] && json_add_int id "$vid" + [ -n "$macaddr" ] && json_add_string macaddr "$macaddr" + json_close_object + + proto_close_tunnel + + proto_add_data + [ -n "$zone" ] && json_add_string zone "$zone" + proto_close_data + + proto_send_update "$cfg" +} + +proto_vxlan_setup() { + local cfg="$1" + + local ipaddr peeraddr + json_get_vars ipaddr peeraddr tunlink + + [ -z "$peeraddr" ] && { + proto_notify_error "$cfg" "MISSING_ADDRESS" + proto_block_restart "$cfg" + exit + } + + ( proto_add_host_dependency "$cfg" '' "$tunlink" ) + + [ -z "$ipaddr" ] && { + local wanif="$tunlink" + if [ -z "$wanif" ] && ! network_find_wan wanif; then + proto_notify_error "$cfg" "NO_WAN_LINK" + exit + fi + + if ! network_get_ipaddr ipaddr "$wanif"; then + proto_notify_error "$cfg" "NO_WAN_LINK" + exit + fi + } + + vxlan_generic_setup "$cfg" 'vxlan' "$ipaddr" "$peeraddr" +} + +proto_vxlan6_setup() { + local cfg="$1" + + local ip6addr peer6addr + json_get_vars ip6addr peer6addr tunlink + + [ -z "$peer6addr" ] && { + proto_notify_error "$cfg" "MISSING_ADDRESS" + proto_block_restart "$cfg" + exit + } + + ( proto_add_host_dependency "$cfg" '' "$tunlink" ) + + [ -z "$ip6addr" ] && { + local wanif="$tunlink" + if [ -z "$wanif" ] && ! network_find_wan6 wanif; then + proto_notify_error "$cfg" "NO_WAN_LINK" + exit + fi + + if ! network_get_ipaddr6 ip6addr "$wanif"; then + proto_notify_error "$cfg" "NO_WAN_LINK" + exit + fi + } + + vxlan_generic_setup "$cfg" 'vxlan6' "$ip6addr" "$peer6addr" +} + +proto_vxlan_teardown() { + local cfg="$1" +} + +proto_vxlan6_teardown() { + local cfg="$1" +} + +vxlan_generic_init_config() { + no_device=1 + available=1 + + proto_config_add_string "tunlink" + proto_config_add_string "zone" + + proto_config_add_int "vid" + proto_config_add_int "port" + proto_config_add_int "ttl" + proto_config_add_int "tos" + proto_config_add_int "mtu" + proto_config_add_string "macaddr" +} + +proto_vxlan_init_config() { + vxlan_generic_init_config + proto_config_add_string "ipaddr" + proto_config_add_string "peeraddr" +} + +proto_vxlan6_init_config() { + vxlan_generic_init_config + proto_config_add_string "ip6addr" + proto_config_add_string "peer6addr" +} + +[ -n "$INCLUDE_ONLY" ] || { + add_protocol vxlan + add_protocol vxlan6 +} diff --git a/package/network/ipv6/6rd/Makefile b/package/network/ipv6/6rd/Makefile index 899c0f13f..5086fae69 100644 --- a/package/network/ipv6/6rd/Makefile +++ b/package/network/ipv6/6rd/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=6rd PKG_VERSION:=9 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/ipv6/6rd/files/6rd.sh b/package/network/ipv6/6rd/files/6rd.sh index 62d35b699..8b3441428 100644 --- a/package/network/ipv6/6rd/files/6rd.sh +++ b/package/network/ipv6/6rd/files/6rd.sh @@ -64,9 +64,13 @@ proto_6rd_setup() { json_add_int ttl "${ttl:-64}" [ -n "$tos" ] && json_add_string tos "$tos" json_add_string local "$ipaddr" - json_add_string 6rd-prefix "$ip6prefix/$ip6prefixlen" - json_add_string 6rd-relay-prefix "$ip4prefix/$ip4prefixlen" [ -n "$tunlink" ] && json_add_string link "$tunlink" + + json_add_object 'data' + json_add_string prefix "$ip6prefix/$ip6prefixlen" + json_add_string relay-prefix "$ip4prefix/$ip4prefixlen" + json_close_object + proto_close_tunnel proto_add_data diff --git a/package/network/ipv6/map/Makefile b/package/network/ipv6/map/Makefile index fd8291d68..ce04235f2 100644 --- a/package/network/ipv6/map/Makefile +++ b/package/network/ipv6/map/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=map PKG_VERSION:=4 -PKG_RELEASE:=6 +PKG_RELEASE:=9 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/ipv6/map/files/map.sh b/package/network/ipv6/map/files/map.sh index fe872828c..42050183c 100755 --- a/package/network/ipv6/map/files/map.sh +++ b/package/network/ipv6/map/files/map.sh @@ -86,15 +86,19 @@ proto_map_setup() { json_add_string link $(eval "echo \$RULE_${k}_PD6IFACE") if [ "$type" = "map-e" ]; then - json_add_array "fmrs" + json_add_object "data" + json_add_array "fmrs" for i in $(seq $RULE_COUNT); do [ "$(eval "echo \$RULE_${i}_FMR")" != 1 ] && continue - fmr="$(eval "echo \$RULE_${i}_IPV6PREFIX")/$(eval "echo \$RULE_${i}_PREFIX6LEN")" - fmr="$fmr,$(eval "echo \$RULE_${i}_IPV4PREFIX")/$(eval "echo \$RULE_${i}_PREFIX4LEN")" - fmr="$fmr,$(eval "echo \$RULE_${i}_EALEN"),$(eval "echo \$RULE_${i}_OFFSET")" - json_add_string "" "$fmr" + json_add_object "" + json_add_string prefix6 "$(eval "echo \$RULE_${i}_IPV6PREFIX")/$(eval "echo \$RULE_${i}_PREFIX6LEN")" + json_add_string prefix4 "$(eval "echo \$RULE_${i}_IPV4PREFIX")/$(eval "echo \$RULE_${i}_PREFIX4LEN")" + json_add_int ealen $(eval "echo \$RULE_${i}_EALEN") + json_add_int offset $(eval "echo \$RULE_${i}_OFFSET") + json_close_object done - json_close_array + json_close_array + json_close_object fi proto_close_tunnel @@ -216,6 +220,7 @@ proto_map_init_config() { proto_config_add_string "ip6prefix" proto_config_add_int "ip6prefixlen" proto_config_add_string "peeraddr" + proto_config_add_int "ealen" proto_config_add_int "psidlen" proto_config_add_int "psid" proto_config_add_int "offset" diff --git a/package/network/ipv6/map/src/mapcalc.c b/package/network/ipv6/map/src/mapcalc.c index 648840d9b..6233bce73 100644 --- a/package/network/ipv6/map/src/mapcalc.c +++ b/package/network/ipv6/map/src/mapcalc.c @@ -118,7 +118,7 @@ static void match_prefix(int *pdlen, struct in6_addr *pd, struct blob_attr *cur, struct blob_attr *d; unsigned drem; - if (!cur || blobmsg_type(cur) != BLOBMSG_TYPE_ARRAY || !blobmsg_check_attr(cur, NULL)) + if (!cur || blobmsg_type(cur) != BLOBMSG_TYPE_ARRAY || !blobmsg_check_attr(cur, false)) return; blobmsg_for_each_attr(d, cur, drem) { diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile index 8b97e1fb2..24cbe0b2c 100644 --- a/package/network/ipv6/odhcp6c/Makefile +++ b/package/network/ipv6/odhcp6c/Makefile @@ -8,19 +8,22 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcp6c -PKG_RELEASE:=2 +PKG_RELEASE:=4 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=$(LEDE_GIT)/project/odhcp6c.git -PKG_SOURCE_DATE:=2017-01-30 -PKG_SOURCE_VERSION:=c13b6a05dbd9174356cc4b7fd1edf39445efd982 -PKG_MIRROR_HASH:=001e58f1ab6eb8903d9e47060ae037a2e4f021f1fef5032347b767f56f4664f6 +PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git +PKG_SOURCE_DATE:=2017-09-05 +PKG_SOURCE_VERSION:=51733a6d3bfe0fb9e8c53aea22231e5b8a1f64c3 +PKG_MIRROR_HASH:=fdccfb9a6cb00d6dbf1a3160bd36622ee8e188a9d58bcd282c71a9368972e184 PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk +CMAKE_OPTIONS += \ + -DUSE_LIBUBOX=on + ifneq ($(CONFIG_PACKAGE_odhcp6c_ext_cer_id),0) CMAKE_OPTIONS += -DEXT_CER_ID=$(CONFIG_PACKAGE_odhcp6c_ext_cer_id) endif diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script index ab0b55675..03efaf721 100755 --- a/package/network/ipv6/odhcp6c/files/dhcpv6.script +++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script @@ -81,6 +81,23 @@ setup_interface () { # RFC 7278 if [ "$mask" -eq 64 -a -z "$PREFIXES" -a -n "$EXTENDPREFIX" ]; then proto_add_ipv6_prefix "$addr/$mask,$preferred,$valid" + + local raroutes="" + for route in $RA_ROUTES; do + local prefix="${route%%/*}" + local entry="${route#*/}" + local pmask="${entry%%,*}" + entry="${entry#*,}" + local gw="${entry%%,*}" + + [ -z "$gw" -a "$mask" = "$pmask" ] && { + case "$addr" in + "${prefix%*::}"*) continue;; + esac + } + raroutes="$raroutes $route" + done + RA_ROUTES="$raroutes" fi done diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh b/package/network/ipv6/odhcp6c/files/dhcpv6.sh index 9e3f66973..56f75521e 100755 --- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh +++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh @@ -31,14 +31,15 @@ proto_dhcpv6_init_config() { proto_config_add_boolean fakeroutes proto_config_add_boolean sourcefilter proto_config_add_boolean keep_ra_dnslifetime + proto_config_add_int "ra_holdoff" } proto_dhcpv6_setup() { local config="$1" local iface="$2" - local reqaddress reqprefix clientid reqopts noslaaconly forceprefix extendprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime - json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix extendprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime + local reqaddress reqprefix clientid reqopts noslaaconly forceprefix extendprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff + json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix extendprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff # Configure @@ -64,6 +65,8 @@ proto_dhcpv6_setup() { [ "$keep_ra_dnslifetime" = "1" ] && append opts "-L" + [ -n "$ra_holdoff" ] && append opts "-m$ra_holdoff" + for opt in $reqopts; do append opts "-r$opt" done diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index 1a887beba..79c228aff 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:=4 +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 \ @@ -37,6 +39,7 @@ define Package/dnsmasq/Default CATEGORY:=Base system TITLE:=DNS and DHCP server URL:=http://www.thekelleys.org.uk/dnsmasq/ + DEPENDS:=+libubus USERID:=dnsmasq=453:dnsmasq=453 endef @@ -48,14 +51,14 @@ endef define Package/dnsmasq-dhcpv6 $(call Package/dnsmasq/Default) TITLE += (with DHCPv6 support) - DEPENDS:=@IPV6 + DEPENDS+=@IPV6 VARIANT:=dhcpv6 endef define Package/dnsmasq-full $(call Package/dnsmasq/Default) TITLE += (with DNSSEC, DHCPv6, Auth DNS, IPset, Conntrack, NO_ID enabled by default) - DEPENDS:=+PACKAGE_dnsmasq_full_dnssec:libnettle \ + DEPENDS+=+PACKAGE_dnsmasq_full_dnssec:libnettle \ +PACKAGE_dnsmasq_full_ipset:kmod-ipt-ipset \ +PACKAGE_dnsmasq_full_conntrack:libnetfilter-conntrack VARIANT:=full @@ -74,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 @@ -85,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." @@ -123,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) \ @@ -150,8 +157,17 @@ define Package/dnsmasq/install $(INSTALL_DATA) ./files/dnsmasq.conf $(1)/etc/dnsmasq.conf $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/dnsmasq.init $(1)/etc/init.d/dnsmasq + $(INSTALL_DIR) $(1)/etc/hotplug.d/dhcp + $(INSTALL_DIR) $(1)/etc/hotplug.d/neigh $(INSTALL_DIR) $(1)/etc/hotplug.d/ntp + $(INSTALL_DIR) $(1)/etc/hotplug.d/tftp $(INSTALL_DATA) ./files/dnsmasqsec.hotplug $(1)/etc/hotplug.d/ntp/25-dnsmasqsec + $(INSTALL_DIR) $(1)/usr/share/dnsmasq + $(INSTALL_DATA) ./files/rfc6761.conf $(1)/usr/share/dnsmasq/ + $(INSTALL_DIR) $(1)/usr/lib/dnsmasq + $(INSTALL_BIN) ./files/dhcp-script.sh $(1)/usr/lib/dnsmasq/dhcp-script.sh + $(INSTALL_DIR) $(1)/usr/share/acl.d + $(INSTALL_DATA) ./files/dnsmasq_acl.json $(1)/usr/share/acl.d/ endef Package/dnsmasq-dhcpv6/install = $(Package/dnsmasq/install) diff --git a/package/network/services/dnsmasq/files/dhcp-script.sh b/package/network/services/dnsmasq/files/dhcp-script.sh new file mode 100755 index 000000000..86032694c --- /dev/null +++ b/package/network/services/dnsmasq/files/dhcp-script.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +[ -f "$USER_DHCPSCRIPT" ] && . "$USER_DHCPSCRIPT" "$@" + +case "$1" in + add) + export ACTION="add" + export MACADDR="$2" + export IPADDR="$3" + export HOSTNAME="$4" + exec /sbin/hotplug-call dhcp + ;; + del) + export ACTION="remove" + export MACADDR="$2" + export IPADDR="$3" + export HOSTNAME="$4" + exec /sbin/hotplug-call dhcp + ;; + old) + export ACTION="update" + export MACADDR="$2" + export IPADDR="$3" + export HOSTNAME="$4" + exec /sbin/hotplug-call dhcp + ;; + arp-add) + export ACTION="add" + export MACADDR="$2" + export IPADDR="$3" + exec /sbin/hotplug-call neigh + ;; + arp-del) + export ACTION="remove" + export MACADDR="$2" + export IPADDR="$3" + exec /sbin/hotplug-call neigh + ;; + tftp) + export ACTION="add" + export TFTP_SIZE="$2" + export TFTP_ADDR="$3" + export TFTP_PATH="$4" + exec /sbin/hotplug-call tftp + ;; +esac diff --git a/package/network/services/dnsmasq/files/dhcp.conf b/package/network/services/dnsmasq/files/dhcp.conf index 362b90a29..360c7d79e 100644 --- a/package/network/services/dnsmasq/files/dhcp.conf +++ b/package/network/services/dnsmasq/files/dhcp.conf @@ -15,7 +15,7 @@ config dnsmasq option leasefile '/tmp/dhcp.leases' option resolvfile '/tmp/resolv.conf.auto' #list server '/mycompany.local/1.2.3.4' - #option nonwildcard 1 + option nonwildcard 1 # bind to & keep track of interfaces #list interface br-lan #list notinterface lo #list bogusnxdomain '64.94.110.11' diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 34c35c2dc..dcc18e34d 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -8,13 +8,18 @@ PROG=/usr/sbin/dnsmasq ADD_LOCAL_DOMAIN=1 ADD_LOCAL_HOSTNAME=1 +ADD_WAN_FQDN=0 +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" +RFC6761FILE="/usr/share/dnsmasq/rfc6761.conf" +DHCPSCRIPT="/usr/lib/dnsmasq/dhcp-script.sh" + +DNSMASQ_DHCP_VER=4 xappend() { local value="$1" @@ -83,12 +88,24 @@ log_once() { logger -t dnsmasq "$@" } +has_handler() { + local file + + for file in /etc/hotplug.d/dhcp/* /etc/hotplug.d/tftp/* /etc/hotplug.d/neigh/*; do + [ -f "$file" ] && return 0 + done + + return 1 +} + append_bool() { local section="$1" local option="$2" local value="$3" + local default="$4" local _loctmp - config_get_bool _loctmp "$section" "$option" 0 + [ -z "$default" ] && default="0" + config_get_bool _loctmp "$section" "$option" "$default" [ $_loctmp -gt 0 ] && xappend "$value" } @@ -107,6 +124,10 @@ append_server() { xappend "--server=$1" } +append_rev_server() { + xappend "--rev-server=$1" +} + append_address() { xappend "--address=$1" } @@ -120,6 +141,10 @@ append_interface() { xappend "--interface=$ifname" } +append_listenaddress() { + xappend "--listen-address=$1" +} + append_notinterface() { network_get_device ifname "$1" || ifname="$1" xappend "--except-interface=$ifname" @@ -137,6 +162,10 @@ append_pxe_service() { xappend "--pxe-service=$1" } +append_interface_name() { + xappend "--interface-name=$1,$2" +} + filter_dnsmasq() { local cfg="$1" func="$2" match_cfg="$3" found_cfg @@ -180,6 +209,7 @@ dhcp_remoteid_add() { } dhcp_circuitid_add() { + # TODO: DHCPV6 does not have circuitid; catch "option6:" local cfg="$1" config_get networkid "$cfg" networkid @@ -212,6 +242,7 @@ dhcp_userclass_add() { } dhcp_vendorclass_add() { + # TODO: DHCPV6 vendor class has stricter definitions; catch? fixup? local cfg="$1" config_get networkid "$cfg" networkid @@ -245,6 +276,7 @@ dhcp_match_add() { dhcp_host_add() { local cfg="$1" + local hosttag nametime addrs duids macs tags config_get_bool force "$cfg" force 0 @@ -256,44 +288,113 @@ dhcp_host_add() { config_get name "$cfg" name config_get ip "$cfg" ip - [ -n "$ip" -o -n "$name" ] || return 0 + config_get hostid "$cfg" hostid + + [ -n "$ip" -o -n "$name" -o -n "$hostid" ] || return 0 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 + config_get duid "$cfg" duid + config_get tag "$cfg" tag + if [ -n "$mac" ]; then # --dhcp-host=00:20:e0:3b:13:af,192.168.0.199,lap - macs="" + # many MAC are possible to track a laptop ON/OFF dock for m in $mac; do append macs "$m" ","; done - else - # --dhcp-host=lap,192.168.0.199 + fi + + if [ $DNSMASQ_DHCP_VER -eq 6 -a -n "$duid" ]; then + # --dhcp-host=id:00:03:00:01:12:00:00:01:02:03,[::beef],lap + # one (virtual) machine gets one DUID per RFC3315 + duids="id:${duid// */}" + fi + + if [ -z "$macs" -a -z "$duids" ]; then + # --dhcp-host=lap,192.168.0.199,[::beef] [ -n "$name" ] || return 0 macs="$name" name="" fi - config_get tag "$cfg" tag + if [ -n "$hostid" ]; then + hex_to_hostid hostid "$hostid" + fi - if [ "$DHCPv6CAPABLE" -eq 1 ]; then - config_get duid "$cfg" duid - config_get hostid "$cfg" hostid - if [ -n "$hostid" ]; then - hex_to_hostid hostid "$hostid" - fi + if [ -n "$tag" ]; then + for t in $tag; do append tags "$t" ",set:"; done fi config_get_bool broadcast "$cfg" broadcast 0 - [ "$broadcast" = "0" ] && broadcast= - config_get leasetime "$cfg" leasetime - xappend "--dhcp-host=$macs${duid:+,id:$duid}${networkid:+,net:$networkid}${broadcast:+,set:needs-broadcast}${tag:+,set:$tag}${ip:+,$ip${hostid:+,[::$hostid]}}${name:+,$name}${leasetime:+,$leasetime}" + [ "$broadcast" = "0" ] && broadcast= || broadcast=",set:needs-broadcast" + + hosttag="${networkid:+,set:${networkid}}${tags:+,set:${tags}}$broadcast" + nametime="${name:+,$name}${leasetime:+,$leasetime}" + + if [ $DNSMASQ_DHCP_VER -eq 6 ]; then + addrs="${ip:+,$ip}${hostid:+,[::$hostid]}" + xappend "--dhcp-host=$macs${duids:+,$duids}$hosttag$addrs$nametime" + else + xappend "--dhcp-host=$macs$hosttag${ip:+,$ip}$nametime" + fi +} + +dhcp_this_host_add() { + local net="$1" + local ifname="$2" + local mode="$3" + local routerstub routername ifdashname + local lanaddr lanaddr6 lanaddrs6 ulaprefix + + if [ "$mode" -gt 0 ] ; then + ifdashname="${ifname//./-}" + routerstub="$( md5sum /etc/os-release )" + routerstub="router-${routerstub// */}" + routername="$( uci_get system @system[0] hostname $routerstub )" + + if [ "$mode" -gt 1 ] ; then + if [ "$mode" -gt 2 ] ; then + if [ "$mode" -gt 3 ] ; then + append_interface_name "$ifdashname.$routername.$DOMAIN" "$ifname" + fi + + append_interface_name "$routername.$DOMAIN" "$ifname" + fi + + # All IP addresses discovered by dnsmasq will be labeled (except fe80::) + append_interface_name "$routername" "$ifname" + + else + # This uses a static host file entry for only limited addresses. + # Use dnsmasq option "--expandhosts" to enable FQDN on host files. + ulaprefix="$(uci_get network @globals[0] ula_prefix)" + network_get_ipaddr lanaddr "$net" + network_get_ipaddrs6 lanaddrs6 "$net" + + if [ -n "$lanaddr" ] ; then + dhcp_domain_add "" "$routername" "$lanaddr" + fi + + if [ -n "$ulaprefix" -a -n "$lanaddrs6" ] ; then + for lanaddr6 in $lanaddrs6 ; do + case "$lanaddr6" in + "${ulaprefix%%:/*}"*) + dhcp_domain_add "" "$routername" "$lanaddr6" + ;; + esac + done + fi + fi + fi } dhcp_tag_add() { + # NOTE: dnsmasq has explicit "option6:" prefix for DHCPv6 so no collisions local cfg="$1" tag="$cfg" @@ -324,6 +425,7 @@ dhcp_mac_add() { } dhcp_boot_add() { + # TODO: BOOTURL is different between DHCPv4 and DHCPv6 local cfg="$1" config_get networkid "$cfg" networkid @@ -346,24 +448,30 @@ dhcp_boot_add() { dhcp_add() { local cfg="$1" + local dhcp6range="::" + local nettag + local tags + config_get net "$cfg" interface [ -n "$net" ] || return 0 - config_get dhcpv4 "$cfg" dhcpv4 - [ "$dhcpv4" != "disabled" ] || return 0 - config_get networkid "$cfg" networkid [ -n "$networkid" ] || networkid="$net" - network_get_subnet subnet "$net" || return 0 network_get_device ifname "$net" || return 0 - network_get_protocol proto "$net" || return 0 [ "$cachelocal" = "0" ] && network_get_dnsserver dnsserver "$net" && { DNS_SERVERS="$DNS_SERVERS $dnsserver" } - append_bool "$cfg" ignore "--no-dhcp-interface=$ifname" && return 0 + append_bool "$cfg" ignore "--no-dhcp-interface=$ifname" && { + # Many ISP do not have useful names for DHCP customers (your WAN). + dhcp_this_host_add "$net" "$ifname" "$ADD_WAN_FQDN" + return 0 + } + + network_get_subnet subnet "$net" || return 0 + network_get_protocol proto "$net" || return 0 # Do not support non-static interfaces for now [ static = "$proto" ] || return 0 @@ -375,21 +483,107 @@ dhcp_add() { config_get_bool force "$cfg" force 0 [ $force -gt 0 ] || dhcp_check "$ifname" || return 0 - config_get start "$cfg" start - config_get limit "$cfg" limit - config_get leasetime "$cfg" leasetime + config_get start "$cfg" start 100 + config_get limit "$cfg" limit 150 + config_get leasetime "$cfg" leasetime 12h config_get options "$cfg" options config_get_bool dynamicdhcp "$cfg" dynamicdhcp 1 - leasetime="${leasetime:-12h}" - start="$(dhcp_calc "${start:-100}")" - limit="${limit:-150}" - [ "$limit" -gt 0 ] && limit=$((limit-1)) - eval "$(ipcalc.sh "${subnet%%/*}" $netmask $start $limit)" - if [ "$dynamicdhcp" = "0" ]; then END="static"; fi - xappend "--dhcp-range=$networkid,$START,$END,$NETMASK,$leasetime${options:+ $options}" + config_get dhcpv4 "$cfg" dhcpv4 + config_get dhcpv6 "$cfg" dhcpv6 - dhcp_option_add "$cfg" "$networkid" + config_get ra "$cfg" ra + config_get ra_management "$cfg" ra_management + config_get ra_preference "$cfg" ra_preference + config_get dns "$cfg" dns + + config_list_foreach "$cfg" "interface_name" append_interface_name "$ifname" + + # Put the router host name on this DHCP served interface address(es) + dhcp_this_host_add "$net" "$ifname" "$ADD_LOCAL_FQDN" + + start="$( dhcp_calc "$start" )" + + add_tag() { + tags="${tags}tag:$1," + } + config_list_foreach "$cfg" tag add_tag + + nettag="${networkid:+set:${networkid},}" + + if [ "$limit" -gt 0 ] ; then + limit=$((limit-1)) + fi + + eval "$(ipcalc.sh "${subnet%%/*}" $netmask $start $limit)" + + if [ "$dynamicdhcp" = "0" ] ; then + END="static" + dhcp6range="::,static" + else + dhcp6range="::1000,::ffff" + fi + + + if [ "$dhcpv4" != "disabled" ] ; then + xappend "--dhcp-range=$tags$nettag$START,$END,$NETMASK,$leasetime${options:+ $options}" + fi + + + if [ $DNSMASQ_DHCP_VER -eq 6 -a "$ra" = "server" ] ; then + # Note: dnsmasq cannot just be a DHCPv6 server (all-in-1) + # and let some other machine(s) send RA pointing to it. + + case $ra_preference in + *high*) + xappend "--ra-param=$ifname,high,0,7200" + ;; + *low*) + xappend "--ra-param=$ifname,low,0,7200" + ;; + *) + # Send UNSOLICITED RA at default interval and live for 2 hours. + # TODO: convert flexible lease time into route life time (only seconds). + xappend "--ra-param=$ifname,0,7200" + ;; + esac + + if [ "$dhcpv6" = "disabled" ] ; then + ra_management="3" + fi + + + case $ra_management in + 0) + # SLACC with DCHP for extended options + xappend "--dhcp-range=$nettag::,constructor:$ifname,ra-stateless,ra-names" + ;; + 2) + # DHCP address and RA only for management redirection + xappend "--dhcp-range=$nettag$dhcp6range,constructor:$ifname,$leasetime" + ;; + 3) + # SLAAC only but dnsmasq attempts to link HOSTNAME, DHCPv4 MAC, and SLAAC + xappend "--dhcp-range=$nettag::,constructor:$ifname,ra-only,ra-names" + ;; + *) + # SLAAC and full DHCP + xappend "--dhcp-range=$nettag$dhcp6range,constructor:$ifname,slaac,ra-names,$leasetime" + ;; + esac + + if [ -n "$dns" ]; then + dnss="" + for d in $dns; do append dnss "[$d]" ","; done + else + dnss="[::]" + fi + + dhcp_option_append "option6:dns-server,$dnss" "$networkid" + fi + + dhcp_option_add "$cfg" "$networkid" 0 + dhcp_option_add "$cfg" "$networkid" 2 } dhcp_option_append() { @@ -401,21 +595,24 @@ dhcp_option_append() { } dhcp_option_add() { + # NOTE: dnsmasq has explicit "option6:" prefix for DHCPv6 so no collisions local cfg="$1" local networkid="$2" local force="$3" + local opt="dhcp_option" [ "$force" = "0" ] && force= + [ "$force" = "2" ] && opt="dhcp_option_force" local list_len - config_get list_len "$cfg" dhcp_option_LENGTH + config_get list_len "$cfg" "${opt}_LENGTH" if [ -n "$list_len" ]; then - config_list_foreach "$cfg" dhcp_option dhcp_option_append "$networkid" "$force" + config_list_foreach "$cfg" "$opt" dhcp_option_append "$networkid" "$force" else - config_get dhcp_option "$cfg" dhcp_option + config_get dhcp_option "$cfg" "$opt" - [ -n "$dhcp_option" ] && echo "Warning: the 'option dhcp_option' syntax is deprecated, use 'list dhcp_option'" >&2 + [ -n "$dhcp_option" ] && echo "Warning: the 'option $opt' syntax is deprecated, use 'list $opt'" >&2 local option for option in $dhcp_option; do @@ -438,7 +635,7 @@ dhcp_domain_add() { record="${record:+$record }$name" done - echo "$ip $record" >> $HOSTFILE + echo "$ip $record" >> $HOSTFILE_TMP } dhcp_srv_add() { @@ -533,7 +730,7 @@ dhcp_relay_add() { dnsmasq_start() { - local cfg="$1" disabled + local cfg="$1" disabled resolvfile user_dhcpscript config_get_bool disabled "$cfg" disabled 0 [ "$disabled" -gt 0 ] && return 0 @@ -544,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 @@ -554,10 +751,8 @@ 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 @@ -571,6 +766,41 @@ dnsmasq_start() $PROG --version | grep -osqE "^Compile time options:.* DHCPv6( |$)" && DHCPv6CAPABLE=1 || DHCPv6CAPABLE=0 + + if [ -x /usr/sbin/odhcpd -a -x /etc/init.d/odhcpd ] ; then + local odhcpd_is_main odhcpd_is_enabled + config_get odhcpd_is_main odhcpd maindhcp 0 + /etc/init.d/odhcpd enabled && odhcpd_is_enabled=1 || odhcpd_is_enabled=0 + + + if [ "$odhcpd_is_enabled" -eq 0 -a "$DHCPv6CAPABLE" -eq 1 ] ; then + # DHCP V4 and V6 in DNSMASQ + DNSMASQ_DHCP_VER=6 + elif [ "$odhcpd_is_main" -gt 0 ] ; then + # ODHCPD is doing it all + DNSMASQ_DHCP_VER=0 + else + # You have ODHCPD but use DNSMASQ for DHCPV4 + DNSMASQ_DHCP_VER=4 + fi + + elif [ "$DHCPv6CAPABLE" -eq 1 ] ; then + # DHCP V4 and V6 in DNSMASQ + DNSMASQ_DHCP_VER=6 + else + DNSMASQ_DHCP_VER=4 + fi + + # Allow DHCP/DHCPv6 to be handled by ISC DHCPD + if [ -x /usr/sbin/dhcpd ] ; then + if [ -x /etc/init.d/dhcpd ] ; then + /etc/init.d/dhcpd enabled && DNSMASQ_DHCP_VER=0 + fi + if [ -x /etc/init.d/dhcpd6 -a "$DNSMASQ_DHCP_VER" -gt 0 ] ; then + /etc/init.d/dhcpd6 enabled && DNSMASQ_DHCP_VER=4 + fi + fi + append_bool "$cfg" authoritative "--dhcp-authoritative" append_bool "$cfg" nodaemon "--no-daemon" append_bool "$cfg" domainneeded "--domain-needed" @@ -583,12 +813,11 @@ dnsmasq_start() append_bool "$cfg" localise_queries "--localise-queries" append_bool "$cfg" readethers "--read-ethers" append_bool "$cfg" dbus "--enable-dbus" - append_bool "$cfg" boguspriv "--bogus-priv" append_bool "$cfg" expandhosts "--expand-hosts" config_get tftp_root "$cfg" "tftp_root" [ -n "$tftp_root" ] && mkdir -p "$tftp_root" && append_bool "$cfg" enable_tftp "--enable-tftp" append_bool "$cfg" tftp_no_fail "--tftp-no-fail" - append_bool "$cfg" nonwildcard "--bind-dynamic" + append_bool "$cfg" nonwildcard "--bind-dynamic" 1 append_bool "$cfg" fqdn "--dhcp-fqdn" append_bool "$cfg" proxydnssec "--proxy-dnssec" append_bool "$cfg" localservice "--local-service" @@ -599,7 +828,7 @@ dnsmasq_start() append_bool "$cfg" noping "--no-ping" append_parm "$cfg" logfacility "--log-facility" - append_parm "$cfg" dhcpscript "--dhcp-script" + append_parm "$cfg" cachesize "--cache-size" append_parm "$cfg" dnsforwardmax "--dns-forward-max" append_parm "$cfg" port "--port" @@ -610,7 +839,9 @@ dnsmasq_start() append_parm "$cfg" "maxport" "--max-port" append_parm "$cfg" "domain" "--domain" append_parm "$cfg" "local" "--server" + config_list_foreach "$cfg" "listen_address" append_listenaddress config_list_foreach "$cfg" "server" append_server + config_list_foreach "$cfg" "rev_server" append_rev_server config_list_foreach "$cfg" "address" append_address config_list_foreach "$cfg" "ipset" append_ipset config_list_foreach "$cfg" "interface" append_interface @@ -618,7 +849,6 @@ dnsmasq_start() config_list_foreach "$cfg" "addnhosts" append_addnhosts config_list_foreach "$cfg" "bogusnxdomain" append_bogusnxdomain append_parm "$cfg" "leasefile" "--dhcp-leasefile" "/tmp/dhcp.leases" - append_parm "$cfg" "resolvfile" "--resolv-file" "/tmp/resolv.conf.auto" append_parm "$cfg" "serversfile" "--servers-file" append_parm "$cfg" "tftp_root" "--tftp-root" append_parm "$cfg" "dhcp_boot" "--dhcp-boot" @@ -629,12 +859,21 @@ dnsmasq_start() config_get_bool ADD_LOCAL_DOMAIN "$cfg" add_local_domain 1 config_get_bool ADD_LOCAL_HOSTNAME "$cfg" add_local_hostname 1 + config_get ADD_LOCAL_FQDN "$cfg" add_local_fqdn "" + config_get ADD_WAN_FQDN "$cfg" add_wan_fqdn 0 + + if [ -z "$ADD_LOCAL_FQDN" ] ; then + # maintain support for previous UCI + ADD_LOCAL_FQDN="$ADD_LOCAL_HOSTNAME" + fi config_get_bool readethers "$cfg" readethers [ "$readethers" = "1" -a \! -e "/etc/ethers" ] && touch /etc/ethers - config_get resolvfile $cfg resolvfile - config_get dhcpscript $cfg dhcpscript + config_get user_dhcpscript $cfg dhcpscript + if has_handler || [ -n "$user_dhcpscript" ]; then + xappend "--dhcp-script=$DHCPSCRIPT" + fi config_get leasefile $cfg leasefile "/tmp/dhcp.leases" [ -n "$leasefile" -a \! -e "$leasefile" ] && touch "$leasefile" @@ -647,6 +886,8 @@ dnsmasq_start() [ -n "$resolvfile" -a \! -e "$resolvfile" ] && touch "$resolvfile" fi + [ -n "$resolvfile" ] && xappend "--resolv-file=$resolvfile" + config_get hostsfile "$cfg" dhcphostsfile [ -e "$hostsfile" ] && xappend "--dhcp-hostsfile=$hostsfile" @@ -693,6 +934,7 @@ dnsmasq_start() } dhcp_option_add "$cfg" "" 0 + dhcp_option_add "$cfg" "" 2 xappend "--dhcp-broadcast=tag:needs-broadcast" @@ -726,43 +968,38 @@ dnsmasq_start() config_foreach filter_dnsmasq hostrecord dhcp_hostrecord_add "$cfg" config_foreach filter_dnsmasq relay dhcp_relay_add "$cfg" - # add own hostname - [ $ADD_LOCAL_HOSTNAME -eq 1 ] && { - local lanaddr lanaddr6 - local ulaprefix="$(uci_get network @globals[0] ula_prefix)" - local hostname="$(uci_get system @system[0] hostname Lede)" - - network_get_ipaddr lanaddr "lan" && { - dhcp_domain_add "" "$hostname" "$lanaddr" - } - - [ -n "$ulaprefix" ] && network_get_ipaddrs6 lanaddr6 "lan" && { - for lanaddr6 in $lanaddr6; do - case "$lanaddr6" in - "${ulaprefix%%:/*}"*) - dhcp_domain_add "" "$hostname" "$lanaddr6" - ;; - esac - done - } - } - echo >> $CONFIGFILE_TMP config_foreach filter_dnsmasq srvhost dhcp_srv_add "$cfg" config_foreach filter_dnsmasq mxhost dhcp_mx_add "$cfg" echo >> $CONFIGFILE_TMP - config_get odhcpd_is_active odhcpd maindhcp - if [ "$odhcpd_is_active" != "1" ]; then + config_get_bool boguspriv "$cfg" boguspriv 1 + [ "$boguspriv" -gt 0 ] && { + xappend "--bogus-priv" + [ -r "$RFC6761FILE" ] && xappend "--conf-file=$RFC6761FILE" + } + + if [ "$DNSMASQ_DHCP_VER" -gt 4 ] ; then + # Enable RA feature for when/if it is constructed, + # and RA is selected per interface pool (RA, DHCP, or both), + # but no one (should) want RA broadcast in syslog + config_foreach filter_dnsmasq dhcp dhcp_add "$cfg" + xappend "--enable-ra" + xappend "--quiet-ra" + append_bool "$cfg" quietdhcp "--quiet-dhcp6" + + elif [ "$DNSMASQ_DHCP_VER" -gt 0 ] ; then config_foreach filter_dnsmasq dhcp dhcp_add "$cfg" fi + echo >> $CONFIGFILE_TMP config_foreach filter_dnsmasq cname dhcp_cname_add "$cfg" echo >> $CONFIGFILE_TMP echo >> $CONFIGFILE_TMP mv -f $CONFIGFILE_TMP $CONFIGFILE + mv -f $HOSTFILE_TMP $HOSTFILE [ "$resolvfile" = "/tmp/resolv.conf.auto" ] && { rm -f /tmp/resolv.conf @@ -778,10 +1015,11 @@ dnsmasq_start() procd_open_instance $cfg procd_set_param command $PROG -C $CONFIGFILE -k -x /var/run/dnsmasq/dnsmasq."${cfg}".pid procd_set_param file $CONFIGFILE + [ -n "$user_dhcpscript" ] && procd_set_param env USER_DHCPSCRIPT="$user_dhcpscript" procd_set_param respawn procd_add_jail dnsmasq ubus log - procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE /etc/passwd /etc/group /etc/TZ /dev/null /dev/urandom $dnsmasqconffile $dnsmasqconfdir $resolvfile $dhcpscript /etc/hosts /etc/ethers $EXTRA_MOUNT + 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 procd_close_instance @@ -806,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 } @@ -846,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/files/dnsmasq_acl.json b/package/network/services/dnsmasq/files/dnsmasq_acl.json new file mode 100644 index 000000000..00ec7d0f0 --- /dev/null +++ b/package/network/services/dnsmasq/files/dnsmasq_acl.json @@ -0,0 +1,4 @@ +{ + "user": "dnsmasq", + "publish": [ "dnsmasq" ] +} diff --git a/package/network/services/dnsmasq/files/rfc6761.conf b/package/network/services/dnsmasq/files/rfc6761.conf new file mode 100644 index 000000000..ebc1a1211 --- /dev/null +++ b/package/network/services/dnsmasq/files/rfc6761.conf @@ -0,0 +1,15 @@ +# RFC6761 included configuration file for dnsmasq +# +# includes a list of domains that should not be forwarded to Internet name servers +# to reduce burden on them, asking questions that they won't know the answer to. + +server=/bind/ +server=/example/ +server=/example.com/ +server=/example.org/ +server=/example.net/ +server=/invalid/ +server=/local/ +server=/localhost/ +server=/onion/ +server=/test/ diff --git a/package/network/services/dnsmasq/patches/240-ubus.patch b/package/network/services/dnsmasq/patches/240-ubus.patch new file mode 100644 index 000000000..d21ca0dba --- /dev/null +++ b/package/network/services/dnsmasq/patches/240-ubus.patch @@ -0,0 +1,128 @@ +--- a/src/dnsmasq.c ++++ b/src/dnsmasq.c +@@ -19,6 +19,8 @@ + + #include "dnsmasq.h" + ++#include ++ + struct daemon *daemon; + + static volatile pid_t pid = 0; +@@ -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); + ++static struct ubus_context *ubus; ++static struct blob_buf b; ++ ++static struct ubus_object_type ubus_object_type = { ++ .name = "dnsmasq", ++}; ++ ++static struct ubus_object ubus_object = { ++ .name = "dnsmasq", ++ .type = &ubus_object_type, ++}; ++ ++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; ++ ++ blob_buf_init(&b, 0); ++ if (mac) ++ blobmsg_add_string(&b, "mac", mac); ++ if (ip) ++ 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); ++} ++ ++static void set_ubus_listeners(void) ++{ ++ if (!ubus) ++ return; ++ ++ poll_listen(ubus->sock.fd, POLLIN); ++ poll_listen(ubus->sock.fd, POLLERR); ++ poll_listen(ubus->sock.fd, POLLHUP); ++} ++ ++static void check_ubus_listeners() ++{ ++ if (!ubus) { ++ ubus = ubus_connect(NULL); ++ if (ubus) ++ ubus_add_object(ubus, &ubus_object); ++ else ++ return; ++ } ++ ++ if (poll_check(ubus->sock.fd, POLLIN)) ++ ubus_handle_event(ubus); ++ ++ if (poll_check(ubus->sock.fd, POLLHUP)) { ++ ubus_free(ubus); ++ ubus = NULL; ++ } ++} ++ + int main (int argc, char **argv) + { + int bind_fallback = 0; +@@ -911,6 +971,7 @@ int main (int argc, char **argv) + set_dbus_listeners(); + #endif + ++ set_ubus_listeners(); + #ifdef HAVE_DHCP + if (daemon->dhcp || daemon->relay4) + { +@@ -1041,6 +1102,8 @@ int main (int argc, char **argv) + check_dbus_listeners(); + #endif + ++ check_ubus_listeners(); ++ + check_dns_listeners(now); + + #ifdef HAVE_TFTP +--- a/Makefile ++++ b/Makefile +@@ -85,7 +85,7 @@ all : $(BUILDDIR) + @cd $(BUILDDIR) && $(MAKE) \ + top="$(top)" \ + build_cflags="$(version) $(dbus_cflags) $(idn2_cflags) $(idn_cflags) $(ct_cflags) $(lua_cflags) $(nettle_cflags)" \ +- build_libs="$(dbus_libs) $(idn2_libs) $(idn_libs) $(ct_libs) $(lua_libs) $(sunos_libs) $(nettle_libs) $(gmp_libs)" \ ++ build_libs="$(dbus_libs) $(idn2_libs) $(idn_libs) $(ct_libs) $(lua_libs) $(sunos_libs) $(nettle_libs) $(gmp_libs) -lubox -lubus" \ + -f $(top)/Makefile dnsmasq + + mostly_clean : +--- a/src/dnsmasq.h ++++ b/src/dnsmasq.h +@@ -1397,6 +1397,8 @@ void emit_dbus_signal(int action, struct + # endif + #endif + ++void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name, const char *interface); ++ + /* ipset.c */ + #ifdef HAVE_IPSET + void ipset_init(void); +--- a/src/rfc2131.c ++++ b/src/rfc2131.c +@@ -1621,6 +1621,10 @@ static void log_packet(char *type, void + daemon->namebuff, + string ? string : "", + err ? err : ""); ++ if (!strcmp(type, "DHCPACK")) ++ 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", 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/dropbear/Makefile b/package/network/services/dropbear/Makefile index 2db2f81a4..21ac09f72 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:=4 +PKG_RELEASE:=5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ @@ -19,6 +19,7 @@ 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 diff --git a/package/network/services/dropbear/patches/120-openwrt_options.patch b/package/network/services/dropbear/patches/120-openwrt_options.patch index b49a95ce9..7f47a7430 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 c9de3c05b..51f169293 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,16 +7,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=7 +PKG_RELEASE:=6 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2016-12-19 -PKG_SOURCE_VERSION:=ad02e79d12fd70ed6bd5fbaf64001a2851e5bb7b -PKG_MIRROR_HASH:=7a0983f004b156d46911765c113754a4c00f56fb889430620bbd061b3b1fcf33 +PKG_SOURCE_DATE:=2017-08-24 +PKG_SOURCE_VERSION:=c2d4f2eb5dba0b5c5a8c5805823084da958a9b52 +PKG_MIRROR_HASH:=c6ad9a73fc1ae0ba8bc48f71cf14394b274bc9c2c1d1b53c2775f08312597e74 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause +PKG_CPE_ID:=cpe:/a:w1.fi:hostapd PKG_BUILD_PARALLEL:=1 @@ -299,6 +300,7 @@ define Build/Compile/wpad $(call Build/RunMake,wpa_supplicant,-s MULTICALL=1 dump_cflags) | \ sed -e 's,-n ,,g' -e 's^$(TARGET_CFLAGS)^^' \ ` > $(PKG_BUILD_DIR)/.cflags + sed -i 's/"/\\"/g' $(PKG_BUILD_DIR)/.cflags +$(call Build/RunMake,hostapd, \ CFLAGS="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \ MULTICALL=1 \ diff --git a/package/network/services/hostapd/files/hostapd-full.config b/package/network/services/hostapd/files/hostapd-full.config index 4a2e87c2e..fe627676d 100644 --- a/package/network/services/hostapd/files/hostapd-full.config +++ b/package/network/services/hostapd/files/hostapd-full.config @@ -15,22 +15,31 @@ # Driver interface for wired authenticator CONFIG_DRIVER_WIRED=y -# Driver interface for Prism54 driver -#CONFIG_DRIVER_PRISM54=y - # Driver interface for drivers using the nl80211 kernel interface CONFIG_DRIVER_NL80211=y -# driver_nl80211.c requires a rather new libnl (version 1.1) which may not be -# shipped with your distribution yet. If that is the case, you need to build -# newer libnl version and point the hostapd build to use it. -#LIBNL=/usr/src/libnl -#CFLAGS += -I$(LIBNL)/include -#LIBS += -L$(LIBNL)/lib + +# QCA vendor extensions to nl80211 +#CONFIG_DRIVER_NL80211_QCA=y + +# driver_nl80211.c requires libnl. If you are compiling it yourself +# you may need to point hostapd to your version of libnl. +# +#CFLAGS += -I$ +#LIBS += -L$ + +# Use libnl v2.0 (or 3.0) libraries. +#CONFIG_LIBNL20=y + +# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored) +#CONFIG_LIBNL32=y + # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) #CONFIG_DRIVER_BSD=y #CFLAGS += -I/usr/local/include #LIBS += -L/usr/local/lib +#LIBS_p += -L/usr/local/lib +#LIBS_c += -L/usr/local/lib # Driver interface for no driver (e.g., RADIUS server only) #CONFIG_DRIVER_NONE=y @@ -45,16 +54,14 @@ CONFIG_RSN_PREAUTH=y CONFIG_PEERKEY=y # IEEE 802.11w (management frame protection) -# This version is an experimental implementation based on IEEE 802.11w/D1.0 -# draft and is subject to change since the standard has not yet been finalized. # Driver support is also needed for IEEE 802.11w. #CONFIG_IEEE80211W=y # Integrated EAP server CONFIG_EAP=y -# EAP-FAST for the integrated EAP server -CONFIG_EAP_FAST=y +# EAP Re-authentication Protocol (ERP) in integrated EAP server +#CONFIG_ERP=y # EAP-MD5 for the integrated EAP server CONFIG_EAP_MD5=y @@ -90,6 +97,9 @@ CONFIG_EAP_TTLS=y # EAP-PSK for the integrated EAP server (this is _not_ needed for WPA-PSK) #CONFIG_EAP_PSK=y +# EAP-pwd for the integrated EAP server (secure authentication with a password) +#CONFIG_EAP_PWD=y + # EAP-SAKE for the integrated EAP server #CONFIG_EAP_SAKE=y @@ -99,17 +109,17 @@ CONFIG_EAP_TTLS=y #CONFIG_EAP_GPSK_SHA256=y # EAP-FAST for the integrated EAP server -# Note: Default OpenSSL package does not include support for all the -# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL, -# the OpenSSL library must be patched (openssl-0.9.9-session-ticket.patch) -# to add the needed functions. -#CONFIG_EAP_FAST=y +# Note: If OpenSSL is used as the TLS library, OpenSSL 1.0 or newer is needed +# for EAP-FAST support. Older OpenSSL releases would need to be patched, e.g., +# with openssl-0.9.8x-tls-extensions.patch, to add the needed functions. +CONFIG_EAP_FAST=y # Wi-Fi Protected Setup (WPS) CONFIG_WPS=y -CONFIG_WPS2=y # Enable UPnP support for external WPS Registrars #CONFIG_WPS_UPNP=y +# Enable WPS support with NFC config method +#CONFIG_WPS_NFC=y # EAP-IKEv2 #CONFIG_EAP_IKEV2=y @@ -117,6 +127,9 @@ CONFIG_WPS2=y # Trusted Network Connect (EAP-TNC) #CONFIG_EAP_TNC=y +# EAP-EKE for the integrated EAP server +#CONFIG_EAP_EKE=y + # PKCS#12 (PFX) support (used to read private key and certificate file from # a file that usually has extension .p12 or .pfx) CONFIG_PKCS12=y @@ -132,23 +145,43 @@ CONFIG_IPV6=y CONFIG_IEEE80211R=y # Use the hostapd's IEEE 802.11 authentication (ACL), but without -# the IEEE 802.11 Management capability (e.g. FreeBSD/net80211) +# the IEEE 802.11 Management capability (e.g., FreeBSD/net80211) #CONFIG_DRIVER_RADIUS_ACL=y # IEEE 802.11n (High Throughput) support CONFIG_IEEE80211N=y +# Wireless Network Management (IEEE Std 802.11v-2011) +# Note: This is experimental and not complete implementation. +#CONFIG_WNM=y + # IEEE 802.11ac (Very High Throughput) support CONFIG_IEEE80211AC=y +# IEEE 802.11ax HE support +# Note: This is experimental and work in progress. The definitions are still +# subject to change and this should not be expected to interoperate with the +# final IEEE 802.11ax version. +#CONFIG_IEEE80211AX=y + # Remove debugging code that is printing out debug messages to stdout. # This can be used to reduce the size of the hostapd considerably if debugging # code is not needed. #CONFIG_NO_STDOUT_DEBUG=y +# Add support for writing debug log to a file: -f /tmp/hostapd.log +# Disabled by default. +#CONFIG_DEBUG_FILE=y + # Send debug messages to syslog instead of stdout CONFIG_DEBUG_SYSLOG=y +# Add support for sending all debug messages (regardless of debug verbosity) +# to the Linux kernel tracing facility. This helps debug the entire stack by +# making it easy to record everything happening from the driver up into the +# same file, e.g., using trace-cmd. +#CONFIG_DEBUG_LINUX_TRACING=y + # Remove support for RADIUS accounting #CONFIG_NO_ACCOUNTING=y @@ -158,15 +191,190 @@ CONFIG_DEBUG_SYSLOG=y # Remove support for VLANs #CONFIG_NO_VLAN=y -CONFIG_TLS=internal -CONFIG_INTERNAL_LIBTOMMATH=y -CONFIG_INTERNAL_AES=y -NEED_AES_DEC=y - -CONFIG_NO_RANDOM_POOL=y -CONFIG_NO_DUMP_STATE=y - -CONFIG_WPS=y +# Enable support for fully dynamic VLANs. This enables hostapd to +# automatically create bridge and VLAN interfaces if necessary. CONFIG_FULL_DYNAMIC_VLAN=y +# Use netlink-based kernel API for VLAN operations instead of ioctl() +# Note: This requires libnl 3.1 or newer. +#CONFIG_VLAN_NETLINK=y + +# Remove support for dumping internal state through control interface commands +# This can be used to reduce binary size at the cost of disabling a debugging +# option. +CONFIG_NO_DUMP_STATE=y + +# Enable tracing code for developer debugging +# This tracks use of memory allocations and other registrations and reports +# incorrect use with a backtrace of call (or allocation) location. +#CONFIG_WPA_TRACE=y +# For BSD, comment out these. +#LIBS += -lexecinfo +#LIBS_p += -lexecinfo +#LIBS_c += -lexecinfo + +# Use libbfd to get more details for developer debugging +# This enables use of libbfd to get more detailed symbols for the backtraces +# generated by CONFIG_WPA_TRACE=y. +#CONFIG_WPA_TRACE_BFD=y +# For BSD, comment out these. +#LIBS += -lbfd -liberty -lz +#LIBS_p += -lbfd -liberty -lz +#LIBS_c += -lbfd -liberty -lz + +# hostapd depends on strong random number generation being available from the +# operating system. os_get_random() function is used to fetch random data when +# needed, e.g., for key generation. On Linux and BSD systems, this works by +# reading /dev/urandom. It should be noted that the OS entropy pool needs to be +# properly initialized before hostapd is started. This is important especially +# on embedded devices that do not have a hardware random number generator and +# may by default start up with minimal entropy available for random number +# generation. +# +# As a safety net, hostapd is by default trying to internally collect +# additional entropy for generating random data to mix in with the data +# fetched from the OS. This by itself is not considered to be very strong, but +# it may help in cases where the system pool is not initialized properly. +# However, it is very strongly recommended that the system pool is initialized +# with enough entropy either by using hardware assisted random number +# generator or by storing state over device reboots. +# +# hostapd can be configured to maintain its own entropy store over restarts to +# enhance random number generation. This is not perfect, but it is much more +# secure than using the same sequence of random numbers after every reboot. +# This can be enabled with -e command line option. The specified +# file needs to be readable and writable by hostapd. +# +# If the os_get_random() is known to provide strong random data (e.g., on +# Linux/BSD, the board in question is known to have reliable source of random +# data from /dev/urandom), the internal hostapd random pool can be disabled. +# This will save some in binary size and CPU use. However, this should only be +# considered for builds that are known to be used on devices that meet the +# requirements described above. +CONFIG_NO_RANDOM_POOL=y + +# Should we use poll instead of select? Select is used by default. +#CONFIG_ELOOP_POLL=y + +# Should we use epoll instead of select? Select is used by default. +#CONFIG_ELOOP_EPOLL=y + +# Should we use kqueue instead of select? Select is used by default. +#CONFIG_ELOOP_KQUEUE=y + +# Select TLS implementation +# openssl = OpenSSL (default) +# gnutls = GnuTLS +# internal = Internal TLSv1 implementation (experimental) +# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental) +# none = Empty template +CONFIG_TLS=internal + +# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1) +# can be enabled to get a stronger construction of messages when block ciphers +# are used. +#CONFIG_TLSV11=y + +# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2) +# can be enabled to enable use of stronger crypto algorithms. +#CONFIG_TLSV12=y + +# Select which ciphers to use by default with OpenSSL if the user does not +# specify them. +#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW" + +# If CONFIG_TLS=internal is used, additional library and include paths are +# needed for LibTomMath. Alternatively, an integrated, minimal version of +# LibTomMath can be used. See beginning of libtommath.c for details on benefits +# and drawbacks of this option. +CONFIG_INTERNAL_LIBTOMMATH=y +#ifndef CONFIG_INTERNAL_LIBTOMMATH +#LTM_PATH=/usr/src/libtommath-0.39 +#CFLAGS += -I$(LTM_PATH) +#LIBS += -L$(LTM_PATH) +#LIBS_p += -L$(LTM_PATH) +#endif +# At the cost of about 4 kB of additional binary size, the internal LibTomMath +# can be configured to include faster routines for exptmod, sqr, and div to +# speed up DH and RSA calculation considerably +#CONFIG_INTERNAL_LIBTOMMATH_FAST=y + +# Interworking (IEEE 802.11u) +# This can be used to enable functionality to improve interworking with +# external networks. +#CONFIG_INTERWORKING=y + +# Hotspot 2.0 +#CONFIG_HS20=y + +# Enable SQLite database support in hlr_auc_gw, EAP-SIM DB, and eap_user_file +#CONFIG_SQLITE=y + +# Enable Fast Session Transfer (FST) +#CONFIG_FST=y + +# Enable CLI commands for FST testing +#CONFIG_FST_TEST=y + +# Testing options +# This can be used to enable some testing options (see also the example +# configuration file) that are really useful only for testing clients that +# connect to this hostapd. These options allow, for example, to drop a +# certain percentage of probe requests or auth/(re)assoc frames. +# +#CONFIG_TESTING_OPTIONS=y + +# Automatic Channel Selection +# This will allow hostapd to pick the channel automatically when channel is set +# to "acs_survey" or "0". Eventually, other ACS algorithms can be added in +# similar way. +# +# Automatic selection is currently only done through initialization, later on +# we hope to do background checks to keep us moving to more ideal channels as +# time goes by. ACS is currently only supported through the nl80211 driver and +# your driver must have survey dump capability that is filled by the driver +# during scanning. +# +# You can customize the ACS survey algorithm with the hostapd.conf variable +# acs_num_scans. +# +# Supported ACS drivers: +# * ath9k +# * ath5k +# * ath10k +# +# For more details refer to: +# http://wireless.kernel.org/en/users/Documentation/acs +# +#CONFIG_ACS=y + +# Multiband Operation support +# These extentions facilitate efficient use of multiple frequency bands +# available to the AP and the devices that may associate with it. +#CONFIG_MBO=y + +# Client Taxonomy +# Has the AP retain the Probe Request and (Re)Association Request frames from +# a client, from which a signature can be produced which can identify the model +# of client device like "Nexus 6P" or "iPhone 5s". +#CONFIG_TAXONOMY=y + +# Fast Initial Link Setup (FILS) (IEEE 802.11ai) +# Note: This is an experimental and not yet complete implementation. This +# should not be enabled for production use. +#CONFIG_FILS=y +# FILS shared key authentication with PFS +#CONFIG_FILS_SK_PFS=y + +# Include internal line edit mode in hostapd_cli. This can be used to provide +# limited command line editing and history support. +#CONFIG_WPA_CLI_EDIT=y + +# Opportunistic Wireless Encryption (OWE) +# Experimental implementation of draft-harkins-owe-07.txt +#CONFIG_OWE=y + +# uBus IPC/RPC System +# Services can connect to the bus and provide methods +# that can be called by other services or clients. CONFIG_UBUS=y diff --git a/package/network/services/hostapd/files/hostapd-mini.config b/package/network/services/hostapd/files/hostapd-mini.config index 2bd7d239c..661983a94 100644 --- a/package/network/services/hostapd/files/hostapd-mini.config +++ b/package/network/services/hostapd/files/hostapd-mini.config @@ -15,28 +15,37 @@ # Driver interface for wired authenticator CONFIG_DRIVER_WIRED=y -# Driver interface for Prism54 driver -#CONFIG_DRIVER_PRISM54=y - # Driver interface for drivers using the nl80211 kernel interface CONFIG_DRIVER_NL80211=y -# driver_nl80211.c requires a rather new libnl (version 1.1) which may not be -# shipped with your distribution yet. If that is the case, you need to build -# newer libnl version and point the hostapd build to use it. -#LIBNL=/usr/src/libnl -#CFLAGS += -I$(LIBNL)/include -#LIBS += -L$(LIBNL)/lib + +# QCA vendor extensions to nl80211 +#CONFIG_DRIVER_NL80211_QCA=y + +# driver_nl80211.c requires libnl. If you are compiling it yourself +# you may need to point hostapd to your version of libnl. +# +#CFLAGS += -I$ +#LIBS += -L$ + +# Use libnl v2.0 (or 3.0) libraries. +#CONFIG_LIBNL20=y + +# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored) +#CONFIG_LIBNL32=y + # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) #CONFIG_DRIVER_BSD=y #CFLAGS += -I/usr/local/include #LIBS += -L/usr/local/lib +#LIBS_p += -L/usr/local/lib +#LIBS_c += -L/usr/local/lib # Driver interface for no driver (e.g., RADIUS server only) #CONFIG_DRIVER_NONE=y # IEEE 802.11F/IAPP -# CONFIG_IAPP=y +#CONFIG_IAPP=y # WPA2/IEEE 802.11i RSN pre-authentication CONFIG_RSN_PREAUTH=y @@ -45,14 +54,15 @@ CONFIG_RSN_PREAUTH=y CONFIG_PEERKEY=y # IEEE 802.11w (management frame protection) -# This version is an experimental implementation based on IEEE 802.11w/D1.0 -# draft and is subject to change since the standard has not yet been finalized. # Driver support is also needed for IEEE 802.11w. #CONFIG_IEEE80211W=y # Integrated EAP server #CONFIG_EAP=y +# EAP Re-authentication Protocol (ERP) in integrated EAP server +#CONFIG_ERP=y + # EAP-MD5 for the integrated EAP server #CONFIG_EAP_MD5=y @@ -87,6 +97,9 @@ CONFIG_PEERKEY=y # EAP-PSK for the integrated EAP server (this is _not_ needed for WPA-PSK) #CONFIG_EAP_PSK=y +# EAP-pwd for the integrated EAP server (secure authentication with a password) +#CONFIG_EAP_PWD=y + # EAP-SAKE for the integrated EAP server #CONFIG_EAP_SAKE=y @@ -96,16 +109,17 @@ CONFIG_PEERKEY=y #CONFIG_EAP_GPSK_SHA256=y # EAP-FAST for the integrated EAP server -# Note: Default OpenSSL package does not include support for all the -# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL, -# the OpenSSL library must be patched (openssl-0.9.9-session-ticket.patch) -# to add the needed functions. +# Note: If OpenSSL is used as the TLS library, OpenSSL 1.0 or newer is needed +# for EAP-FAST support. Older OpenSSL releases would need to be patched, e.g., +# with openssl-0.9.8x-tls-extensions.patch, to add the needed functions. #CONFIG_EAP_FAST=y # Wi-Fi Protected Setup (WPS) #CONFIG_WPS=y # Enable UPnP support for external WPS Registrars #CONFIG_WPS_UPNP=y +# Enable WPS support with NFC config method +#CONFIG_WPS_NFC=y # EAP-IKEv2 #CONFIG_EAP_IKEV2=y @@ -113,6 +127,9 @@ CONFIG_PEERKEY=y # Trusted Network Connect (EAP-TNC) #CONFIG_EAP_TNC=y +# EAP-EKE for the integrated EAP server +#CONFIG_EAP_EKE=y + # PKCS#12 (PFX) support (used to read private key and certificate file from # a file that usually has extension .p12 or .pfx) #CONFIG_PKCS12=y @@ -128,23 +145,43 @@ CONFIG_PEERKEY=y #CONFIG_IEEE80211R=y # Use the hostapd's IEEE 802.11 authentication (ACL), but without -# the IEEE 802.11 Management capability (e.g. FreeBSD/net80211) +# the IEEE 802.11 Management capability (e.g., FreeBSD/net80211) #CONFIG_DRIVER_RADIUS_ACL=y # IEEE 802.11n (High Throughput) support CONFIG_IEEE80211N=y +# Wireless Network Management (IEEE Std 802.11v-2011) +# Note: This is experimental and not complete implementation. +#CONFIG_WNM=y + # IEEE 802.11ac (Very High Throughput) support CONFIG_IEEE80211AC=y +# IEEE 802.11ax HE support +# Note: This is experimental and work in progress. The definitions are still +# subject to change and this should not be expected to interoperate with the +# final IEEE 802.11ax version. +#CONFIG_IEEE80211AX=y + # Remove debugging code that is printing out debug messages to stdout. # This can be used to reduce the size of the hostapd considerably if debugging # code is not needed. #CONFIG_NO_STDOUT_DEBUG=y +# Add support for writing debug log to a file: -f /tmp/hostapd.log +# Disabled by default. +#CONFIG_DEBUG_FILE=y + # Send debug messages to syslog instead of stdout CONFIG_DEBUG_SYSLOG=y +# Add support for sending all debug messages (regardless of debug verbosity) +# to the Linux kernel tracing facility. This helps debug the entire stack by +# making it easy to record everything happening from the driver up into the +# same file, e.g., using trace-cmd. +#CONFIG_DEBUG_LINUX_TRACING=y + # Remove support for RADIUS accounting CONFIG_NO_ACCOUNTING=y @@ -154,9 +191,190 @@ CONFIG_NO_RADIUS=y # Remove support for VLANs #CONFIG_NO_VLAN=y -CONFIG_TLS=internal +# Enable support for fully dynamic VLANs. This enables hostapd to +# automatically create bridge and VLAN interfaces if necessary. +#CONFIG_FULL_DYNAMIC_VLAN=y -CONFIG_NO_RANDOM_POOL=y +# Use netlink-based kernel API for VLAN operations instead of ioctl() +# Note: This requires libnl 3.1 or newer. +#CONFIG_VLAN_NETLINK=y + +# Remove support for dumping internal state through control interface commands +# This can be used to reduce binary size at the cost of disabling a debugging +# option. CONFIG_NO_DUMP_STATE=y +# Enable tracing code for developer debugging +# This tracks use of memory allocations and other registrations and reports +# incorrect use with a backtrace of call (or allocation) location. +#CONFIG_WPA_TRACE=y +# For BSD, comment out these. +#LIBS += -lexecinfo +#LIBS_p += -lexecinfo +#LIBS_c += -lexecinfo + +# Use libbfd to get more details for developer debugging +# This enables use of libbfd to get more detailed symbols for the backtraces +# generated by CONFIG_WPA_TRACE=y. +#CONFIG_WPA_TRACE_BFD=y +# For BSD, comment out these. +#LIBS += -lbfd -liberty -lz +#LIBS_p += -lbfd -liberty -lz +#LIBS_c += -lbfd -liberty -lz + +# hostapd depends on strong random number generation being available from the +# operating system. os_get_random() function is used to fetch random data when +# needed, e.g., for key generation. On Linux and BSD systems, this works by +# reading /dev/urandom. It should be noted that the OS entropy pool needs to be +# properly initialized before hostapd is started. This is important especially +# on embedded devices that do not have a hardware random number generator and +# may by default start up with minimal entropy available for random number +# generation. +# +# As a safety net, hostapd is by default trying to internally collect +# additional entropy for generating random data to mix in with the data +# fetched from the OS. This by itself is not considered to be very strong, but +# it may help in cases where the system pool is not initialized properly. +# However, it is very strongly recommended that the system pool is initialized +# with enough entropy either by using hardware assisted random number +# generator or by storing state over device reboots. +# +# hostapd can be configured to maintain its own entropy store over restarts to +# enhance random number generation. This is not perfect, but it is much more +# secure than using the same sequence of random numbers after every reboot. +# This can be enabled with -e command line option. The specified +# file needs to be readable and writable by hostapd. +# +# If the os_get_random() is known to provide strong random data (e.g., on +# Linux/BSD, the board in question is known to have reliable source of random +# data from /dev/urandom), the internal hostapd random pool can be disabled. +# This will save some in binary size and CPU use. However, this should only be +# considered for builds that are known to be used on devices that meet the +# requirements described above. +CONFIG_NO_RANDOM_POOL=y + +# Should we use poll instead of select? Select is used by default. +#CONFIG_ELOOP_POLL=y + +# Should we use epoll instead of select? Select is used by default. +#CONFIG_ELOOP_EPOLL=y + +# Should we use kqueue instead of select? Select is used by default. +#CONFIG_ELOOP_KQUEUE=y + +# Select TLS implementation +# openssl = OpenSSL (default) +# gnutls = GnuTLS +# internal = Internal TLSv1 implementation (experimental) +# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental) +# none = Empty template +CONFIG_TLS=internal + +# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1) +# can be enabled to get a stronger construction of messages when block ciphers +# are used. +#CONFIG_TLSV11=y + +# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2) +# can be enabled to enable use of stronger crypto algorithms. +#CONFIG_TLSV12=y + +# Select which ciphers to use by default with OpenSSL if the user does not +# specify them. +#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW" + +# If CONFIG_TLS=internal is used, additional library and include paths are +# needed for LibTomMath. Alternatively, an integrated, minimal version of +# LibTomMath can be used. See beginning of libtommath.c for details on benefits +# and drawbacks of this option. +#CONFIG_INTERNAL_LIBTOMMATH=y +#ifndef CONFIG_INTERNAL_LIBTOMMATH +#LTM_PATH=/usr/src/libtommath-0.39 +#CFLAGS += -I$(LTM_PATH) +#LIBS += -L$(LTM_PATH) +#LIBS_p += -L$(LTM_PATH) +#endif +# At the cost of about 4 kB of additional binary size, the internal LibTomMath +# can be configured to include faster routines for exptmod, sqr, and div to +# speed up DH and RSA calculation considerably +#CONFIG_INTERNAL_LIBTOMMATH_FAST=y + +# Interworking (IEEE 802.11u) +# This can be used to enable functionality to improve interworking with +# external networks. +#CONFIG_INTERWORKING=y + +# Hotspot 2.0 +#CONFIG_HS20=y + +# Enable SQLite database support in hlr_auc_gw, EAP-SIM DB, and eap_user_file +#CONFIG_SQLITE=y + +# Enable Fast Session Transfer (FST) +#CONFIG_FST=y + +# Enable CLI commands for FST testing +#CONFIG_FST_TEST=y + +# Testing options +# This can be used to enable some testing options (see also the example +# configuration file) that are really useful only for testing clients that +# connect to this hostapd. These options allow, for example, to drop a +# certain percentage of probe requests or auth/(re)assoc frames. +# +#CONFIG_TESTING_OPTIONS=y + +# Automatic Channel Selection +# This will allow hostapd to pick the channel automatically when channel is set +# to "acs_survey" or "0". Eventually, other ACS algorithms can be added in +# similar way. +# +# Automatic selection is currently only done through initialization, later on +# we hope to do background checks to keep us moving to more ideal channels as +# time goes by. ACS is currently only supported through the nl80211 driver and +# your driver must have survey dump capability that is filled by the driver +# during scanning. +# +# You can customize the ACS survey algorithm with the hostapd.conf variable +# acs_num_scans. +# +# Supported ACS drivers: +# * ath9k +# * ath5k +# * ath10k +# +# For more details refer to: +# http://wireless.kernel.org/en/users/Documentation/acs +# +#CONFIG_ACS=y + +# Multiband Operation support +# These extentions facilitate efficient use of multiple frequency bands +# available to the AP and the devices that may associate with it. +#CONFIG_MBO=y + +# Client Taxonomy +# Has the AP retain the Probe Request and (Re)Association Request frames from +# a client, from which a signature can be produced which can identify the model +# of client device like "Nexus 6P" or "iPhone 5s". +#CONFIG_TAXONOMY=y + +# Fast Initial Link Setup (FILS) (IEEE 802.11ai) +# Note: This is an experimental and not yet complete implementation. This +# should not be enabled for production use. +#CONFIG_FILS=y +# FILS shared key authentication with PFS +#CONFIG_FILS_SK_PFS=y + +# Include internal line edit mode in hostapd_cli. This can be used to provide +# limited command line editing and history support. +#CONFIG_WPA_CLI_EDIT=y + +# Opportunistic Wireless Encryption (OWE) +# Experimental implementation of draft-harkins-owe-07.txt +#CONFIG_OWE=y + +# uBus IPC/RPC System +# Services can connect to the bus and provide methods +# that can be called by other services or clients. CONFIG_UBUS=y diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 1f2866111..36aee85f1 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -66,6 +66,9 @@ hostapd_common_add_device_config() { config_add_string require_mode config_add_boolean legacy_rates + config_add_string acs_chan_bias + config_add_array hostapd_options + hostapd_add_log_config } @@ -76,7 +79,7 @@ hostapd_prepare_device_config() { local base="${config%%.conf}" local base_cfg= - json_get_vars country country_ie beacon_int:100 doth require_mode legacy_rates + json_get_vars country country_ie beacon_int:100 doth require_mode legacy_rates acs_chan_bias hostapd_set_log_options base_cfg @@ -93,6 +96,8 @@ hostapd_prepare_device_config() { [ "$hwmode" = "a" -a "$doth" -gt 0 ] && append base_cfg "ieee80211h=1" "$N" } + [ -n "$acs_chan_bias" ] && append base_cfg "acs_chan_bias=$acs_chan_bias" "$N" + local brlist= br json_get_values basic_rate_list basic_rate local rlist= r @@ -123,6 +128,11 @@ hostapd_prepare_device_config() { [ -n "$brlist" ] && append base_cfg "basic_rates=$brlist" "$N" append base_cfg "beacon_int=$beacon_int" "$N" + json_get_values opts hostapd_options + for val in $opts; do + append base_cfg "$val" "$N" + done + cat > "$config" < 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" ] && \ @@ -586,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 @@ -609,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" @@ -625,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="" } @@ -721,7 +752,6 @@ wpa_supplicant_add_network() { ;; esac } - local beacon_int brates mrate [ -n "$bssid" ] && append network_data "bssid=$bssid" "$N$T" [ -n "$beacon_int" ] && append network_data "beacon_int=$beacon_int" "$N$T" diff --git a/package/network/services/hostapd/files/wpa_supplicant-full.config b/package/network/services/hostapd/files/wpa_supplicant-full.config index 18c3f9a5c..81fa8f539 100644 --- a/package/network/services/hostapd/files/wpa_supplicant-full.config +++ b/package/network/services/hostapd/files/wpa_supplicant-full.config @@ -1,9 +1,9 @@ # Example wpa_supplicant build time configuration # # This file lists the configuration options that are used when building the -# hostapd binary. All lines starting with # are ignored. Configuration option -# lines must be commented out complete, if they are not to be included, i.e., -# just setting VARIABLE=n is not disabling that variable. +# wpa_supplicant binary. All lines starting with # are ignored. Configuration +# option lines must be commented out complete, if they are not to be included, +# i.e., just setting VARIABLE=n is not disabling that variable. # # This file is included in Makefile, so variables like CFLAGS and LIBS can also # be modified from here. In most cases, these lines should use += in order not @@ -20,63 +20,33 @@ # used to fix build issues on such systems (krb5.h not found). #CFLAGS += -I/usr/include/kerberos -# Example configuration for various cross-compilation platforms - -#### sveasoft (e.g., for Linksys WRT54G) ###################################### -#CC=mipsel-uclibc-gcc -#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc -#CFLAGS += -Os -#CPPFLAGS += -I../src/include -I../../src/router/openssl/include -#LIBS += -L/opt/brcm/hndtools-mipsel-uclibc-0.9.19/lib -lssl -############################################################################### - -#### openwrt (e.g., for Linksys WRT54G) ####################################### -#CC=mipsel-uclibc-gcc -#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc -#CFLAGS += -Os -#CPPFLAGS=-I../src/include -I../openssl-0.9.7d/include \ -# -I../WRT54GS/release/src/include -#LIBS = -lssl -############################################################################### - - -# Driver interface for Host AP driver -#CONFIG_DRIVER_HOSTAP=y - -# Driver interface for Agere driver -#CONFIG_DRIVER_HERMES=y -# Change include directories to match with the local setup -#CFLAGS += -I../../hcf -I../../include -I../../include/hcf -#CFLAGS += -I../../include/wireless - -# Driver interface for ndiswrapper -# Deprecated; use CONFIG_DRIVER_WEXT=y instead. -#CONFIG_DRIVER_NDISWRAPPER=y - -# Driver interface for Atmel driver -# CONFIG_DRIVER_ATMEL=y - -# Driver interface for old Broadcom driver -# Please note that the newer Broadcom driver ("hybrid Linux driver") supports -# Linux wireless extensions and does not need (or even work) with the old -# driver wrapper. Use CONFIG_DRIVER_WEXT=y with that driver. -#CONFIG_DRIVER_BROADCOM=y -# Example path for wlioctl.h; change to match your configuration -#CFLAGS += -I/opt/WRT54GS/release/src/include - -# Driver interface for Intel ipw2100/2200 driver -# Deprecated; use CONFIG_DRIVER_WEXT=y instead. -#CONFIG_DRIVER_IPW=y - -# Driver interface for Ralink driver -#CONFIG_DRIVER_RALINK=y - # Driver interface for generic Linux wireless extensions +# Note: WEXT is deprecated in the current Linux kernel version and no new +# functionality is added to it. nl80211-based interface is the new +# replacement for WEXT and its use allows wpa_supplicant to properly control +# the driver to improve existing functionality like roaming and to support new +# functionality. CONFIG_DRIVER_WEXT=y # Driver interface for Linux drivers using the nl80211 kernel interface CONFIG_DRIVER_NL80211=y +# QCA vendor extensions to nl80211 +#CONFIG_DRIVER_NL80211_QCA=y + +# driver_nl80211.c requires libnl. If you are compiling it yourself +# you may need to point hostapd to your version of libnl. +# +#CFLAGS += -I$ +#LIBS += -L$ + +# Use libnl v2.0 (or 3.0) libraries. +#CONFIG_LIBNL20=y + +# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored) +#CONFIG_LIBNL32=y + + # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) #CONFIG_DRIVER_BSD=y #CFLAGS += -I/usr/local/include @@ -100,14 +70,6 @@ CONFIG_DRIVER_NL80211=y # wpa_supplicant. # CONFIG_USE_NDISUIO=y -# Driver interface for development testing -#CONFIG_DRIVER_TEST=y - -# Include client MLME (management frame processing) for test driver -# This can be used to test MLME operations in hostapd with the test interface. -# space. -#CONFIG_CLIENT_MLME=y - # Driver interface for wired Ethernet drivers CONFIG_DRIVER_WIRED=y @@ -117,13 +79,14 @@ CONFIG_DRIVER_WIRED=y # Driver interface for no driver (e.g., WPS ER only) #CONFIG_DRIVER_NONE=y +# Solaris libraries +#LIBS += -lsocket -ldlpi -lnsl +#LIBS_c += -lsocket + # Enable IEEE 802.1X Supplicant (automatically included if any EAP method is # included) CONFIG_IEEE8021X_EAPOL=y -# EAP-FAST -CONFIG_EAP_FAST=y - # EAP-MD5 CONFIG_EAP_MD5=y @@ -140,11 +103,10 @@ CONFIG_EAP_PEAP=y CONFIG_EAP_TTLS=y # EAP-FAST -# Note: Default OpenSSL package does not include support for all the -# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL, -# the OpenSSL library must be patched (openssl-0.9.8d-tls-extensions.patch) -# to add the needed functions. -#CONFIG_EAP_FAST=y +# Note: If OpenSSL is used as the TLS library, OpenSSL 1.0 or newer is needed +# for EAP-FAST support. Older OpenSSL releases would need to be patched, e.g., +# with openssl-0.9.8x-tls-extensions.patch, to add the needed functions. +CONFIG_EAP_FAST=y # EAP-GTC CONFIG_EAP_GTC=y @@ -158,6 +120,9 @@ CONFIG_EAP_OTP=y # EAP-PSK (experimental; this is _not_ needed for WPA-PSK) #CONFIG_EAP_PSK=y +# EAP-pwd (secure authentication using only a password) +#CONFIG_EAP_PWD=y + # EAP-PAX #CONFIG_EAP_PAX=y @@ -187,10 +152,20 @@ CONFIG_EAP_LEAP=y # Wi-Fi Protected Setup (WPS) CONFIG_WPS=y +# Enable WPS external registrar functionality +#CONFIG_WPS_ER=y +# Disable credentials for an open network by default when acting as a WPS +# registrar. +#CONFIG_WPS_REG_DISABLE_OPEN=y +# Enable WPS support with NFC config method +#CONFIG_WPS_NFC=y # EAP-IKEv2 #CONFIG_EAP_IKEV2=y +# EAP-EKE +#CONFIG_EAP_EKE=y + # PKCS#12 (PFX) support (used to read private key and certificate file from # a file that usually has extension .p12 or .pfx) CONFIG_PKCS12=y @@ -203,13 +178,22 @@ CONFIG_SMARTCARD=y # Enable this if EAP-SIM or EAP-AKA is included #CONFIG_PCSC=y +# Support HT overrides (disable HT/HT40, mask MCS rates, etc.) +CONFIG_HT_OVERRIDES=y + +# Support VHT overrides (disable VHT, mask MCS rates, etc.) +CONFIG_VHT_OVERRIDES=y + # Development testing #CONFIG_EAPOL_TEST=y # Select control interface backend for external programs, e.g, wpa_cli: # unix = UNIX domain sockets (default for Linux/*BSD) # udp = UDP sockets using localhost (127.0.0.1) +# udp6 = UDP IPv6 sockets using localhost (::1) # named_pipe = Windows Named Pipe (default for Windows) +# udp-remote = UDP sockets with remote access (only for tests systems/purpose) +# udp6-remote = UDP IPv6 sockets with remote access (only for tests purpose) # y = use default (backwards compatibility) # If this option is commented out, control interface is not included in the # build. @@ -221,6 +205,10 @@ CONFIG_CTRL_IFACE=y # the resulting binary. #CONFIG_READLINE=y +# Include internal line edit mode in wpa_cli. This can be used as a replacement +# for GNU Readline to provide limited command line editing and history support. +#CONFIG_WPA_CLI_EDIT=y + # Remove debugging code that is printing out debug message to stdout. # This can be used to reduce the size of the wpa_supplicant considerably # if debugging code is not needed. The size reduction can be around 35% @@ -231,11 +219,6 @@ CONFIG_CTRL_IFACE=y # 35-50 kB in code size. #CONFIG_NO_WPA=y -# Remove WPA2 support. This allows WPA to be used, but removes WPA2 code to -# save about 1 kB in code size when building only WPA-Personal (no EAP support) -# or 6 kB if building for WPA-Enterprise. -#CONFIG_NO_WPA2=y - # Remove IEEE 802.11i/WPA-Personal ASCII passphrase support # This option can be used to reduce code size by removing support for # converting ASCII passphrases into PSK. If this functionality is removed, the @@ -270,7 +253,7 @@ CONFIG_BACKEND=file # main_none = Very basic example (development use only) #CONFIG_MAIN=main -# Select wrapper for operatins system and C library specific functions +# Select wrapper for operating system and C library specific functions # unix = UNIX/POSIX like systems (default) # win32 = Windows systems # none = Empty template @@ -279,9 +262,17 @@ CONFIG_BACKEND=file # Select event loop implementation # eloop = select() loop (default) # eloop_win = Windows events and WaitForMultipleObject() loop -# eloop_none = Empty template #CONFIG_ELOOP=eloop +# Should we use poll instead of select? Select is used by default. +#CONFIG_ELOOP_POLL=y + +# Should we use epoll instead of select? Select is used by default. +#CONFIG_ELOOP_EPOLL=y + +# Should we use kqueue instead of select? Select is used by default. +#CONFIG_ELOOP_KQUEUE=y + # Select layer 2 packet implementation # linux = Linux packet socket (default) # pcap = libpcap/libdnet/WinPcap @@ -291,29 +282,44 @@ CONFIG_BACKEND=file # none = Empty template #CONFIG_L2_PACKET=linux +# Disable Linux packet socket workaround applicable for station interface +# in a bridge for EAPOL frames. This should be uncommented only if the kernel +# is known to not have the regression issue in packet socket behavior with +# bridge interfaces (commit 'bridge: respect RFC2863 operational state')'). +#CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y + # PeerKey handshake for Station to Station Link (IEEE 802.11e DLS) CONFIG_PEERKEY=y -# IEEE 802.11w (management frame protection) -# This version is an experimental implementation based on IEEE 802.11w/D1.0 -# draft and is subject to change since the standard has not yet been finalized. +# IEEE 802.11w (management frame protection), also known as PMF # Driver support is also needed for IEEE 802.11w. -CONFIG_IEEE80211W=y +#CONFIG_IEEE80211W=y # Select TLS implementation # openssl = OpenSSL (default) -# gnutls = GnuTLS (needed for TLS/IA, see also CONFIG_GNUTLS_EXTRA) +# gnutls = GnuTLS # internal = Internal TLSv1 implementation (experimental) +# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental) # none = Empty template CONFIG_TLS=internal -# Whether to enable TLS/IA support, which is required for EAP-TTLSv1. -# You need CONFIG_TLS=gnutls for this to have any effect. Please note that -# even though the core GnuTLS library is released under LGPL, this extra -# library uses GPL and as such, the terms of GPL apply to the combination -# of wpa_supplicant and GnuTLS if this option is enabled. BSD license may not -# apply for distribution of the resulting binary. -#CONFIG_GNUTLS_EXTRA=y +# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1) +# can be enabled to get a stronger construction of messages when block ciphers +# are used. It should be noted that some existing TLS v1.0 -based +# implementation may not be compatible with TLS v1.1 message (ClientHello is +# sent prior to negotiating which version will be used) +#CONFIG_TLSV11=y + +# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2) +# can be enabled to enable use of stronger crypto algorithms. It should be +# noted that some existing TLS v1.0 -based implementation may not be compatible +# with TLS v1.2 message (ClientHello is sent prior to negotiating which version +# will be used) +#CONFIG_TLSV12=y + +# Select which ciphers to use by default with OpenSSL if the user does not +# specify them. +#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW" # If CONFIG_TLS=internal is used, additional library and include paths are # needed for LibTomMath. Alternatively, an integrated, minimal version of @@ -369,12 +375,31 @@ CONFIG_INTERNAL_LIBTOMMATH_FAST=y # amount of memory/flash. #CONFIG_DYNAMIC_EAP_METHODS=y -# IEEE Std 802.11r-2008 (Fast BSS Transition) +# IEEE Std 802.11r-2008 (Fast BSS Transition) for station mode CONFIG_IEEE80211R=y +# IEEE Std 802.11r-2008 (Fast BSS Transition) for AP mode (implies +# CONFIG_IEEE80211R). +#CONFIG_IEEE80211R_AP=y + # Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt) #CONFIG_DEBUG_FILE=y +# Send debug messages to syslog instead of stdout +#CONFIG_DEBUG_SYSLOG=y +# Set syslog facility for debug messages +#CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON + +# Add support for sending all debug messages (regardless of debug verbosity) +# to the Linux kernel tracing facility. This helps debug the entire stack by +# making it easy to record everything happening from the driver up into the +# same file, e.g., using trace-cmd. +#CONFIG_DEBUG_LINUX_TRACING=y + +# Add support for writing debug log to Android logcat instead of standard +# output +#CONFIG_ANDROID_LOG=y + # Enable privilege separation (see README 'Privilege separation' for details) #CONFIG_PRIVSEP=y @@ -386,7 +411,7 @@ CONFIG_IEEE80211R=y # This tracks use of memory allocations and other registrations and reports # incorrect use with a backtrace of call (or allocation) location. #CONFIG_WPA_TRACE=y -# For BSD, comment out these. +# For BSD, uncomment these. #LIBS += -lexecinfo #LIBS_p += -lexecinfo #LIBS_c += -lexecinfo @@ -395,12 +420,174 @@ CONFIG_IEEE80211R=y # This enables use of libbfd to get more detailed symbols for the backtraces # generated by CONFIG_WPA_TRACE=y. #CONFIG_WPA_TRACE_BFD=y -# For BSD, comment out these. +# For BSD, uncomment these. #LIBS += -lbfd -liberty -lz #LIBS_p += -lbfd -liberty -lz #LIBS_c += -lbfd -liberty -lz +# wpa_supplicant depends on strong random number generation being available +# from the operating system. os_get_random() function is used to fetch random +# data when needed, e.g., for key generation. On Linux and BSD systems, this +# works by reading /dev/urandom. It should be noted that the OS entropy pool +# needs to be properly initialized before wpa_supplicant is started. This is +# important especially on embedded devices that do not have a hardware random +# number generator and may by default start up with minimal entropy available +# for random number generation. +# +# As a safety net, wpa_supplicant is by default trying to internally collect +# additional entropy for generating random data to mix in with the data fetched +# from the OS. This by itself is not considered to be very strong, but it may +# help in cases where the system pool is not initialized properly. However, it +# is very strongly recommended that the system pool is initialized with enough +# entropy either by using hardware assisted random number generator or by +# storing state over device reboots. +# +# wpa_supplicant can be configured to maintain its own entropy store over +# restarts to enhance random number generation. This is not perfect, but it is +# much more secure than using the same sequence of random numbers after every +# reboot. This can be enabled with -e command line option. The +# specified file needs to be readable and writable by wpa_supplicant. +# +# If the os_get_random() is known to provide strong random data (e.g., on +# Linux/BSD, the board in question is known to have reliable source of random +# data from /dev/urandom), the internal wpa_supplicant random pool can be +# disabled. This will save some in binary size and CPU use. However, this +# should only be considered for builds that are known to be used on devices +# that meet the requirements described above. CONFIG_NO_RANDOM_POOL=y -NEED_80211_COMMON=y +# IEEE 802.11n (High Throughput) support (mainly for AP mode) +#CONFIG_IEEE80211N=y + +# IEEE 802.11ac (Very High Throughput) support (mainly for AP mode) +# (depends on CONFIG_IEEE80211N) +#CONFIG_IEEE80211AC=y + +# Wireless Network Management (IEEE Std 802.11v-2011) +# Note: This is experimental and not complete implementation. +#CONFIG_WNM=y + +# Interworking (IEEE 802.11u) +# This can be used to enable functionality to improve interworking with +# external networks (GAS/ANQP to learn more about the networks and network +# selection based on available credentials). +#CONFIG_INTERWORKING=y + +# Hotspot 2.0 +#CONFIG_HS20=y + +# Enable interface matching in wpa_supplicant +#CONFIG_MATCH_IFACE=y + +# Disable roaming in wpa_supplicant +#CONFIG_NO_ROAMING=y + +# AP mode operations with wpa_supplicant +# This can be used for controlling AP mode operations with wpa_supplicant. It +# should be noted that this is mainly aimed at simple cases like +# WPA2-Personal while more complex configurations like WPA2-Enterprise with an +# external RADIUS server can be supported with hostapd. +#CONFIG_AP=y + +# P2P (Wi-Fi Direct) +# This can be used to enable P2P support in wpa_supplicant. See README-P2P for +# more information on P2P operations. +#CONFIG_P2P=y + +# Enable TDLS support +#CONFIG_TDLS=y + +# Wi-Fi Direct +# This can be used to enable Wi-Fi Direct extensions for P2P using an external +# program to control the additional information exchanges in the messages. +#CONFIG_WIFI_DISPLAY=y + +# Autoscan +# This can be used to enable automatic scan support in wpa_supplicant. +# See wpa_supplicant.conf for more information on autoscan usage. +# +# Enabling directly a module will enable autoscan support. +# For exponential module: +#CONFIG_AUTOSCAN_EXPONENTIAL=y +# For periodic module: +#CONFIG_AUTOSCAN_PERIODIC=y + +# Password (and passphrase, etc.) backend for external storage +# These optional mechanisms can be used to add support for storing passwords +# and other secrets in external (to wpa_supplicant) location. This allows, for +# example, operating system specific key storage to be used +# +# External password backend for testing purposes (developer use) +#CONFIG_EXT_PASSWORD_TEST=y + +# Enable Fast Session Transfer (FST) +#CONFIG_FST=y + +# Enable CLI commands for FST testing +#CONFIG_FST_TEST=y + +# OS X builds. This is only for building eapol_test. +#CONFIG_OSX=y + +# Automatic Channel Selection +# This will allow wpa_supplicant to pick the channel automatically when channel +# is set to "0". +# +# TODO: Extend parser to be able to parse "channel=acs_survey" as an alternative +# to "channel=0". This would enable us to eventually add other ACS algorithms in +# similar way. +# +# Automatic selection is currently only done through initialization, later on +# we hope to do background checks to keep us moving to more ideal channels as +# time goes by. ACS is currently only supported through the nl80211 driver and +# your driver must have survey dump capability that is filled by the driver +# during scanning. +# +# TODO: In analogy to hostapd be able to customize the ACS survey algorithm with +# a newly to create wpa_supplicant.conf variable acs_num_scans. +# +# Supported ACS drivers: +# * ath9k +# * ath5k +# * ath10k +# +# For more details refer to: +# http://wireless.kernel.org/en/users/Documentation/acs +#CONFIG_ACS=y + +# Support Multi Band Operation +#CONFIG_MBO=y + +# Fast Initial Link Setup (FILS) (IEEE 802.11ai) +# Note: This is an experimental and not yet complete implementation. This +# should not be enabled for production use. +#CONFIG_FILS=y +# FILS shared key authentication with PFS +#CONFIG_FILS_SK_PFS=y + +# Support RSN on IBSS networks +# This is needed to be able to use mode=1 network profile with proto=RSN and +# key_mgmt=WPA-PSK (i.e., full key management instead of WPA-None). CONFIG_IBSS_RSN=y + +# External PMKSA cache control +# This can be used to enable control interface commands that allow the current +# PMKSA cache entries to be fetched and new entries to be added. +#CONFIG_PMKSA_CACHE_EXTERNAL=y + +# Mesh Networking (IEEE 802.11s) +#CONFIG_MESH=y + +# Background scanning modules +# These can be used to request wpa_supplicant to perform background scanning +# operations for roaming within an ESS (same SSID). See the bgscan parameter in +# the wpa_supplicant.conf file for more details. +# Periodic background scans based on signal strength +#CONFIG_BGSCAN_SIMPLE=y +# Learn channels used by the network and try to avoid bgscans on other +# channels (experimental) +#CONFIG_BGSCAN_LEARN=y + +# Opportunistic Wireless Encryption (OWE) +# Experimental implementation of draft-harkins-owe-07.txt +#CONFIG_OWE=y diff --git a/package/network/services/hostapd/files/wpa_supplicant-mini.config b/package/network/services/hostapd/files/wpa_supplicant-mini.config index c272153b3..3e088715c 100644 --- a/package/network/services/hostapd/files/wpa_supplicant-mini.config +++ b/package/network/services/hostapd/files/wpa_supplicant-mini.config @@ -1,9 +1,9 @@ # Example wpa_supplicant build time configuration # # This file lists the configuration options that are used when building the -# hostapd binary. All lines starting with # are ignored. Configuration option -# lines must be commented out complete, if they are not to be included, i.e., -# just setting VARIABLE=n is not disabling that variable. +# wpa_supplicant binary. All lines starting with # are ignored. Configuration +# option lines must be commented out complete, if they are not to be included, +# i.e., just setting VARIABLE=n is not disabling that variable. # # This file is included in Makefile, so variables like CFLAGS and LIBS can also # be modified from here. In most cases, these lines should use += in order not @@ -20,63 +20,33 @@ # used to fix build issues on such systems (krb5.h not found). #CFLAGS += -I/usr/include/kerberos -# Example configuration for various cross-compilation platforms - -#### sveasoft (e.g., for Linksys WRT54G) ###################################### -#CC=mipsel-uclibc-gcc -#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc -#CFLAGS += -Os -#CPPFLAGS += -I../src/include -I../../src/router/openssl/include -#LIBS += -L/opt/brcm/hndtools-mipsel-uclibc-0.9.19/lib -lssl -############################################################################### - -#### openwrt (e.g., for Linksys WRT54G) ####################################### -#CC=mipsel-uclibc-gcc -#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc -#CFLAGS += -Os -#CPPFLAGS=-I../src/include -I../openssl-0.9.7d/include \ -# -I../WRT54GS/release/src/include -#LIBS = -lssl -############################################################################### - - -# Driver interface for Host AP driver -#CONFIG_DRIVER_HOSTAP=y - -# Driver interface for Agere driver -#CONFIG_DRIVER_HERMES=y -# Change include directories to match with the local setup -#CFLAGS += -I../../hcf -I../../include -I../../include/hcf -#CFLAGS += -I../../include/wireless - -# Driver interface for ndiswrapper -# Deprecated; use CONFIG_DRIVER_WEXT=y instead. -#CONFIG_DRIVER_NDISWRAPPER=y - -# Driver interface for Atmel driver -# CONFIG_DRIVER_ATMEL=y - -# Driver interface for old Broadcom driver -# Please note that the newer Broadcom driver ("hybrid Linux driver") supports -# Linux wireless extensions and does not need (or even work) with the old -# driver wrapper. Use CONFIG_DRIVER_WEXT=y with that driver. -#CONFIG_DRIVER_BROADCOM=y -# Example path for wlioctl.h; change to match your configuration -#CFLAGS += -I/opt/WRT54GS/release/src/include - -# Driver interface for Intel ipw2100/2200 driver -# Deprecated; use CONFIG_DRIVER_WEXT=y instead. -#CONFIG_DRIVER_IPW=y - -# Driver interface for Ralink driver -#CONFIG_DRIVER_RALINK=y - # Driver interface for generic Linux wireless extensions +# Note: WEXT is deprecated in the current Linux kernel version and no new +# functionality is added to it. nl80211-based interface is the new +# replacement for WEXT and its use allows wpa_supplicant to properly control +# the driver to improve existing functionality like roaming and to support new +# functionality. CONFIG_DRIVER_WEXT=y # Driver interface for Linux drivers using the nl80211 kernel interface CONFIG_DRIVER_NL80211=y +# QCA vendor extensions to nl80211 +#CONFIG_DRIVER_NL80211_QCA=y + +# driver_nl80211.c requires libnl. If you are compiling it yourself +# you may need to point hostapd to your version of libnl. +# +#CFLAGS += -I$ +#LIBS += -L$ + +# Use libnl v2.0 (or 3.0) libraries. +#CONFIG_LIBNL20=y + +# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored) +#CONFIG_LIBNL32=y + + # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) #CONFIG_DRIVER_BSD=y #CFLAGS += -I/usr/local/include @@ -100,14 +70,6 @@ CONFIG_DRIVER_NL80211=y # wpa_supplicant. # CONFIG_USE_NDISUIO=y -# Driver interface for development testing -#CONFIG_DRIVER_TEST=y - -# Include client MLME (management frame processing) for test driver -# This can be used to test MLME operations in hostapd with the test interface. -# space. -#CONFIG_CLIENT_MLME=y - # Driver interface for wired Ethernet drivers CONFIG_DRIVER_WIRED=y @@ -117,37 +79,40 @@ CONFIG_DRIVER_WIRED=y # Driver interface for no driver (e.g., WPS ER only) #CONFIG_DRIVER_NONE=y +# Solaris libraries +#LIBS += -lsocket -ldlpi -lnsl +#LIBS_c += -lsocket + # Enable IEEE 802.1X Supplicant (automatically included if any EAP method is # included) -# CONFIG_IEEE8021X_EAPOL=y +#CONFIG_IEEE8021X_EAPOL=y # EAP-MD5 -# CONFIG_EAP_MD5=y +#CONFIG_EAP_MD5=y # EAP-MSCHAPv2 -# CONFIG_EAP_MSCHAPV2=y +#CONFIG_EAP_MSCHAPV2=y # EAP-TLS -# CONFIG_EAP_TLS=y +#CONFIG_EAP_TLS=y # EAL-PEAP -# CONFIG_EAP_PEAP=y +#CONFIG_EAP_PEAP=y # EAP-TTLS -# CONFIG_EAP_TTLS=y +#CONFIG_EAP_TTLS=y # EAP-FAST -# Note: Default OpenSSL package does not include support for all the -# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL, -# the OpenSSL library must be patched (openssl-0.9.8d-tls-extensions.patch) -# to add the needed functions. +# Note: If OpenSSL is used as the TLS library, OpenSSL 1.0 or newer is needed +# for EAP-FAST support. Older OpenSSL releases would need to be patched, e.g., +# with openssl-0.9.8x-tls-extensions.patch, to add the needed functions. #CONFIG_EAP_FAST=y # EAP-GTC -# CONFIG_EAP_GTC=y +#CONFIG_EAP_GTC=y # EAP-OTP -# CONFIG_EAP_OTP=y +#CONFIG_EAP_OTP=y # EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used) #CONFIG_EAP_SIM=y @@ -155,11 +120,14 @@ CONFIG_DRIVER_WIRED=y # EAP-PSK (experimental; this is _not_ needed for WPA-PSK) #CONFIG_EAP_PSK=y +# EAP-pwd (secure authentication using only a password) +#CONFIG_EAP_PWD=y + # EAP-PAX #CONFIG_EAP_PAX=y # LEAP -# CONFIG_EAP_LEAP=y +#CONFIG_EAP_LEAP=y # EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used) #CONFIG_EAP_AKA=y @@ -184,29 +152,48 @@ CONFIG_DRIVER_WIRED=y # Wi-Fi Protected Setup (WPS) #CONFIG_WPS=y +# Enable WPS external registrar functionality +#CONFIG_WPS_ER=y +# Disable credentials for an open network by default when acting as a WPS +# registrar. +#CONFIG_WPS_REG_DISABLE_OPEN=y +# Enable WPS support with NFC config method +#CONFIG_WPS_NFC=y # EAP-IKEv2 #CONFIG_EAP_IKEV2=y +# EAP-EKE +#CONFIG_EAP_EKE=y + # PKCS#12 (PFX) support (used to read private key and certificate file from # a file that usually has extension .p12 or .pfx) -# CONFIG_PKCS12=y +#CONFIG_PKCS12=y # Smartcard support (i.e., private key on a smartcard), e.g., with openssl # engine. -# CONFIG_SMARTCARD=y +#CONFIG_SMARTCARD=y # PC/SC interface for smartcards (USIM, GSM SIM) # Enable this if EAP-SIM or EAP-AKA is included #CONFIG_PCSC=y +# Support HT overrides (disable HT/HT40, mask MCS rates, etc.) +CONFIG_HT_OVERRIDES=y + +# Support VHT overrides (disable VHT, mask MCS rates, etc.) +CONFIG_VHT_OVERRIDES=y + # Development testing #CONFIG_EAPOL_TEST=y # Select control interface backend for external programs, e.g, wpa_cli: # unix = UNIX domain sockets (default for Linux/*BSD) # udp = UDP sockets using localhost (127.0.0.1) +# udp6 = UDP IPv6 sockets using localhost (::1) # named_pipe = Windows Named Pipe (default for Windows) +# udp-remote = UDP sockets with remote access (only for tests systems/purpose) +# udp6-remote = UDP IPv6 sockets with remote access (only for tests purpose) # y = use default (backwards compatibility) # If this option is commented out, control interface is not included in the # build. @@ -218,6 +205,10 @@ CONFIG_CTRL_IFACE=y # the resulting binary. #CONFIG_READLINE=y +# Include internal line edit mode in wpa_cli. This can be used as a replacement +# for GNU Readline to provide limited command line editing and history support. +#CONFIG_WPA_CLI_EDIT=y + # Remove debugging code that is printing out debug message to stdout. # This can be used to reduce the size of the wpa_supplicant considerably # if debugging code is not needed. The size reduction can be around 35% @@ -228,11 +219,6 @@ CONFIG_CTRL_IFACE=y # 35-50 kB in code size. #CONFIG_NO_WPA=y -# Remove WPA2 support. This allows WPA to be used, but removes WPA2 code to -# save about 1 kB in code size when building only WPA-Personal (no EAP support) -# or 6 kB if building for WPA-Enterprise. -#CONFIG_NO_WPA2=y - # Remove IEEE 802.11i/WPA-Personal ASCII passphrase support # This option can be used to reduce code size by removing support for # converting ASCII passphrases into PSK. If this functionality is removed, the @@ -267,7 +253,7 @@ CONFIG_BACKEND=file # main_none = Very basic example (development use only) #CONFIG_MAIN=main -# Select wrapper for operatins system and C library specific functions +# Select wrapper for operating system and C library specific functions # unix = UNIX/POSIX like systems (default) # win32 = Windows systems # none = Empty template @@ -276,9 +262,17 @@ CONFIG_BACKEND=file # Select event loop implementation # eloop = select() loop (default) # eloop_win = Windows events and WaitForMultipleObject() loop -# eloop_none = Empty template #CONFIG_ELOOP=eloop +# Should we use poll instead of select? Select is used by default. +#CONFIG_ELOOP_POLL=y + +# Should we use epoll instead of select? Select is used by default. +#CONFIG_ELOOP_EPOLL=y + +# Should we use kqueue instead of select? Select is used by default. +#CONFIG_ELOOP_KQUEUE=y + # Select layer 2 packet implementation # linux = Linux packet socket (default) # pcap = libpcap/libdnet/WinPcap @@ -288,29 +282,44 @@ CONFIG_BACKEND=file # none = Empty template #CONFIG_L2_PACKET=linux -# PeerKey handshake for Station to Station Link (IEEE 802.11e DLS) -# CONFIG_PEERKEY=y +# Disable Linux packet socket workaround applicable for station interface +# in a bridge for EAPOL frames. This should be uncommented only if the kernel +# is known to not have the regression issue in packet socket behavior with +# bridge interfaces (commit 'bridge: respect RFC2863 operational state')'). +#CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y -# IEEE 802.11w (management frame protection) -# This version is an experimental implementation based on IEEE 802.11w/D1.0 -# draft and is subject to change since the standard has not yet been finalized. +# PeerKey handshake for Station to Station Link (IEEE 802.11e DLS) +#CONFIG_PEERKEY=y + +# IEEE 802.11w (management frame protection), also known as PMF # Driver support is also needed for IEEE 802.11w. #CONFIG_IEEE80211W=y # Select TLS implementation # openssl = OpenSSL (default) -# gnutls = GnuTLS (needed for TLS/IA, see also CONFIG_GNUTLS_EXTRA) +# gnutls = GnuTLS # internal = Internal TLSv1 implementation (experimental) +# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental) # none = Empty template CONFIG_TLS=internal -# Whether to enable TLS/IA support, which is required for EAP-TTLSv1. -# You need CONFIG_TLS=gnutls for this to have any effect. Please note that -# even though the core GnuTLS library is released under LGPL, this extra -# library uses GPL and as such, the terms of GPL apply to the combination -# of wpa_supplicant and GnuTLS if this option is enabled. BSD license may not -# apply for distribution of the resulting binary. -#CONFIG_GNUTLS_EXTRA=y +# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1) +# can be enabled to get a stronger construction of messages when block ciphers +# are used. It should be noted that some existing TLS v1.0 -based +# implementation may not be compatible with TLS v1.1 message (ClientHello is +# sent prior to negotiating which version will be used) +#CONFIG_TLSV11=y + +# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2) +# can be enabled to enable use of stronger crypto algorithms. It should be +# noted that some existing TLS v1.0 -based implementation may not be compatible +# with TLS v1.2 message (ClientHello is sent prior to negotiating which version +# will be used) +#CONFIG_TLSV12=y + +# Select which ciphers to use by default with OpenSSL if the user does not +# specify them. +#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW" # If CONFIG_TLS=internal is used, additional library and include paths are # needed for LibTomMath. Alternatively, an integrated, minimal version of @@ -366,12 +375,31 @@ CONFIG_TLS=internal # amount of memory/flash. #CONFIG_DYNAMIC_EAP_METHODS=y -# IEEE Std 802.11r-2008 (Fast BSS Transition) +# IEEE Std 802.11r-2008 (Fast BSS Transition) for station mode #CONFIG_IEEE80211R=y +# IEEE Std 802.11r-2008 (Fast BSS Transition) for AP mode (implies +# CONFIG_IEEE80211R). +#CONFIG_IEEE80211R_AP=y + # Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt) #CONFIG_DEBUG_FILE=y +# Send debug messages to syslog instead of stdout +#CONFIG_DEBUG_SYSLOG=y +# Set syslog facility for debug messages +#CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON + +# Add support for sending all debug messages (regardless of debug verbosity) +# to the Linux kernel tracing facility. This helps debug the entire stack by +# making it easy to record everything happening from the driver up into the +# same file, e.g., using trace-cmd. +#CONFIG_DEBUG_LINUX_TRACING=y + +# Add support for writing debug log to Android logcat instead of standard +# output +#CONFIG_ANDROID_LOG=y + # Enable privilege separation (see README 'Privilege separation' for details) #CONFIG_PRIVSEP=y @@ -383,7 +411,7 @@ CONFIG_TLS=internal # This tracks use of memory allocations and other registrations and reports # incorrect use with a backtrace of call (or allocation) location. #CONFIG_WPA_TRACE=y -# For BSD, comment out these. +# For BSD, uncomment these. #LIBS += -lexecinfo #LIBS_p += -lexecinfo #LIBS_c += -lexecinfo @@ -392,10 +420,174 @@ CONFIG_TLS=internal # This enables use of libbfd to get more detailed symbols for the backtraces # generated by CONFIG_WPA_TRACE=y. #CONFIG_WPA_TRACE_BFD=y -# For BSD, comment out these. +# For BSD, uncomment these. #LIBS += -lbfd -liberty -lz #LIBS_p += -lbfd -liberty -lz #LIBS_c += -lbfd -liberty -lz +# wpa_supplicant depends on strong random number generation being available +# from the operating system. os_get_random() function is used to fetch random +# data when needed, e.g., for key generation. On Linux and BSD systems, this +# works by reading /dev/urandom. It should be noted that the OS entropy pool +# needs to be properly initialized before wpa_supplicant is started. This is +# important especially on embedded devices that do not have a hardware random +# number generator and may by default start up with minimal entropy available +# for random number generation. +# +# As a safety net, wpa_supplicant is by default trying to internally collect +# additional entropy for generating random data to mix in with the data fetched +# from the OS. This by itself is not considered to be very strong, but it may +# help in cases where the system pool is not initialized properly. However, it +# is very strongly recommended that the system pool is initialized with enough +# entropy either by using hardware assisted random number generator or by +# storing state over device reboots. +# +# wpa_supplicant can be configured to maintain its own entropy store over +# restarts to enhance random number generation. This is not perfect, but it is +# much more secure than using the same sequence of random numbers after every +# reboot. This can be enabled with -e command line option. The +# specified file needs to be readable and writable by wpa_supplicant. +# +# If the os_get_random() is known to provide strong random data (e.g., on +# Linux/BSD, the board in question is known to have reliable source of random +# data from /dev/urandom), the internal wpa_supplicant random pool can be +# disabled. This will save some in binary size and CPU use. However, this +# should only be considered for builds that are known to be used on devices +# that meet the requirements described above. CONFIG_NO_RANDOM_POOL=y -NEED_80211_COMMON=y + +# IEEE 802.11n (High Throughput) support (mainly for AP mode) +#CONFIG_IEEE80211N=y + +# IEEE 802.11ac (Very High Throughput) support (mainly for AP mode) +# (depends on CONFIG_IEEE80211N) +#CONFIG_IEEE80211AC=y + +# Wireless Network Management (IEEE Std 802.11v-2011) +# Note: This is experimental and not complete implementation. +#CONFIG_WNM=y + +# Interworking (IEEE 802.11u) +# This can be used to enable functionality to improve interworking with +# external networks (GAS/ANQP to learn more about the networks and network +# selection based on available credentials). +#CONFIG_INTERWORKING=y + +# Hotspot 2.0 +#CONFIG_HS20=y + +# Enable interface matching in wpa_supplicant +#CONFIG_MATCH_IFACE=y + +# Disable roaming in wpa_supplicant +#CONFIG_NO_ROAMING=y + +# AP mode operations with wpa_supplicant +# This can be used for controlling AP mode operations with wpa_supplicant. It +# should be noted that this is mainly aimed at simple cases like +# WPA2-Personal while more complex configurations like WPA2-Enterprise with an +# external RADIUS server can be supported with hostapd. +#CONFIG_AP=y + +# P2P (Wi-Fi Direct) +# This can be used to enable P2P support in wpa_supplicant. See README-P2P for +# more information on P2P operations. +#CONFIG_P2P=y + +# Enable TDLS support +#CONFIG_TDLS=y + +# Wi-Fi Direct +# This can be used to enable Wi-Fi Direct extensions for P2P using an external +# program to control the additional information exchanges in the messages. +#CONFIG_WIFI_DISPLAY=y + +# Autoscan +# This can be used to enable automatic scan support in wpa_supplicant. +# See wpa_supplicant.conf for more information on autoscan usage. +# +# Enabling directly a module will enable autoscan support. +# For exponential module: +#CONFIG_AUTOSCAN_EXPONENTIAL=y +# For periodic module: +#CONFIG_AUTOSCAN_PERIODIC=y + +# Password (and passphrase, etc.) backend for external storage +# These optional mechanisms can be used to add support for storing passwords +# and other secrets in external (to wpa_supplicant) location. This allows, for +# example, operating system specific key storage to be used +# +# External password backend for testing purposes (developer use) +#CONFIG_EXT_PASSWORD_TEST=y + +# Enable Fast Session Transfer (FST) +#CONFIG_FST=y + +# Enable CLI commands for FST testing +#CONFIG_FST_TEST=y + +# OS X builds. This is only for building eapol_test. +#CONFIG_OSX=y + +# Automatic Channel Selection +# This will allow wpa_supplicant to pick the channel automatically when channel +# is set to "0". +# +# TODO: Extend parser to be able to parse "channel=acs_survey" as an alternative +# to "channel=0". This would enable us to eventually add other ACS algorithms in +# similar way. +# +# Automatic selection is currently only done through initialization, later on +# we hope to do background checks to keep us moving to more ideal channels as +# time goes by. ACS is currently only supported through the nl80211 driver and +# your driver must have survey dump capability that is filled by the driver +# during scanning. +# +# TODO: In analogy to hostapd be able to customize the ACS survey algorithm with +# a newly to create wpa_supplicant.conf variable acs_num_scans. +# +# Supported ACS drivers: +# * ath9k +# * ath5k +# * ath10k +# +# For more details refer to: +# http://wireless.kernel.org/en/users/Documentation/acs +#CONFIG_ACS=y + +# Support Multi Band Operation +#CONFIG_MBO=y + +# Fast Initial Link Setup (FILS) (IEEE 802.11ai) +# Note: This is an experimental and not yet complete implementation. This +# should not be enabled for production use. +#CONFIG_FILS=y +# FILS shared key authentication with PFS +#CONFIG_FILS_SK_PFS=y + +# Support RSN on IBSS networks +# This is needed to be able to use mode=1 network profile with proto=RSN and +# key_mgmt=WPA-PSK (i.e., full key management instead of WPA-None). +#CONFIG_IBSS_RSN=y + +# External PMKSA cache control +# This can be used to enable control interface commands that allow the current +# PMKSA cache entries to be fetched and new entries to be added. +#CONFIG_PMKSA_CACHE_EXTERNAL=y + +# Mesh Networking (IEEE 802.11s) +#CONFIG_MESH=y + +# Background scanning modules +# These can be used to request wpa_supplicant to perform background scanning +# operations for roaming within an ESS (same SSID). See the bgscan parameter in +# the wpa_supplicant.conf file for more details. +# Periodic background scans based on signal strength +#CONFIG_BGSCAN_SIMPLE=y +# Learn channels used by the network and try to avoid bgscans on other +# channels (experimental) +#CONFIG_BGSCAN_LEARN=y + +# Opportunistic Wireless Encryption (OWE) +# Experimental implementation of draft-harkins-owe-07.txt +#CONFIG_OWE=y diff --git a/package/network/services/hostapd/files/wpa_supplicant-p2p.config b/package/network/services/hostapd/files/wpa_supplicant-p2p.config index 563dace35..420aebcf9 100644 --- a/package/network/services/hostapd/files/wpa_supplicant-p2p.config +++ b/package/network/services/hostapd/files/wpa_supplicant-p2p.config @@ -1,9 +1,9 @@ # Example wpa_supplicant build time configuration # # This file lists the configuration options that are used when building the -# hostapd binary. All lines starting with # are ignored. Configuration option -# lines must be commented out complete, if they are not to be included, i.e., -# just setting VARIABLE=n is not disabling that variable. +# wpa_supplicant binary. All lines starting with # are ignored. Configuration +# option lines must be commented out complete, if they are not to be included, +# i.e., just setting VARIABLE=n is not disabling that variable. # # This file is included in Makefile, so variables like CFLAGS and LIBS can also # be modified from here. In most cases, these lines should use += in order not @@ -20,63 +20,33 @@ # used to fix build issues on such systems (krb5.h not found). #CFLAGS += -I/usr/include/kerberos -# Example configuration for various cross-compilation platforms - -#### sveasoft (e.g., for Linksys WRT54G) ###################################### -#CC=mipsel-uclibc-gcc -#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc -#CFLAGS += -Os -#CPPFLAGS += -I../src/include -I../../src/router/openssl/include -#LIBS += -L/opt/brcm/hndtools-mipsel-uclibc-0.9.19/lib -lssl -############################################################################### - -#### openwrt (e.g., for Linksys WRT54G) ####################################### -#CC=mipsel-uclibc-gcc -#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc -#CFLAGS += -Os -#CPPFLAGS=-I../src/include -I../openssl-0.9.7d/include \ -# -I../WRT54GS/release/src/include -#LIBS = -lssl -############################################################################### - - -# Driver interface for Host AP driver -#CONFIG_DRIVER_HOSTAP=y - -# Driver interface for Agere driver -#CONFIG_DRIVER_HERMES=y -# Change include directories to match with the local setup -#CFLAGS += -I../../hcf -I../../include -I../../include/hcf -#CFLAGS += -I../../include/wireless - -# Driver interface for ndiswrapper -# Deprecated; use CONFIG_DRIVER_WEXT=y instead. -#CONFIG_DRIVER_NDISWRAPPER=y - -# Driver interface for Atmel driver -# CONFIG_DRIVER_ATMEL=y - -# Driver interface for old Broadcom driver -# Please note that the newer Broadcom driver ("hybrid Linux driver") supports -# Linux wireless extensions and does not need (or even work) with the old -# driver wrapper. Use CONFIG_DRIVER_WEXT=y with that driver. -#CONFIG_DRIVER_BROADCOM=y -# Example path for wlioctl.h; change to match your configuration -#CFLAGS += -I/opt/WRT54GS/release/src/include - -# Driver interface for Intel ipw2100/2200 driver -# Deprecated; use CONFIG_DRIVER_WEXT=y instead. -#CONFIG_DRIVER_IPW=y - -# Driver interface for Ralink driver -#CONFIG_DRIVER_RALINK=y - # Driver interface for generic Linux wireless extensions +# Note: WEXT is deprecated in the current Linux kernel version and no new +# functionality is added to it. nl80211-based interface is the new +# replacement for WEXT and its use allows wpa_supplicant to properly control +# the driver to improve existing functionality like roaming and to support new +# functionality. CONFIG_DRIVER_WEXT=y # Driver interface for Linux drivers using the nl80211 kernel interface CONFIG_DRIVER_NL80211=y +# QCA vendor extensions to nl80211 +#CONFIG_DRIVER_NL80211_QCA=y + +# driver_nl80211.c requires libnl. If you are compiling it yourself +# you may need to point hostapd to your version of libnl. +# +#CFLAGS += -I$ +#LIBS += -L$ + +# Use libnl v2.0 (or 3.0) libraries. +#CONFIG_LIBNL20=y + +# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored) +#CONFIG_LIBNL32=y + + # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) #CONFIG_DRIVER_BSD=y #CFLAGS += -I/usr/local/include @@ -100,14 +70,6 @@ CONFIG_DRIVER_NL80211=y # wpa_supplicant. # CONFIG_USE_NDISUIO=y -# Driver interface for development testing -#CONFIG_DRIVER_TEST=y - -# Include client MLME (management frame processing) for test driver -# This can be used to test MLME operations in hostapd with the test interface. -# space. -#CONFIG_CLIENT_MLME=y - # Driver interface for wired Ethernet drivers CONFIG_DRIVER_WIRED=y @@ -117,6 +79,10 @@ CONFIG_DRIVER_WIRED=y # Driver interface for no driver (e.g., WPS ER only) #CONFIG_DRIVER_NONE=y +# Solaris libraries +#LIBS += -lsocket -ldlpi -lnsl +#LIBS_c += -lsocket + # Enable IEEE 802.1X Supplicant (automatically included if any EAP method is # included) CONFIG_IEEE8021X_EAPOL=y @@ -137,11 +103,10 @@ CONFIG_EAP_PEAP=y CONFIG_EAP_TTLS=y # EAP-FAST -# Note: Default OpenSSL package does not include support for all the -# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL, -# the OpenSSL library must be patched (openssl-0.9.8d-tls-extensions.patch) -# to add the needed functions. -#CONFIG_EAP_FAST=y +# Note: If OpenSSL is used as the TLS library, OpenSSL 1.0 or newer is needed +# for EAP-FAST support. Older OpenSSL releases would need to be patched, e.g., +# with openssl-0.9.8x-tls-extensions.patch, to add the needed functions. +CONFIG_EAP_FAST=y # EAP-GTC CONFIG_EAP_GTC=y @@ -155,6 +120,9 @@ CONFIG_EAP_OTP=y # EAP-PSK (experimental; this is _not_ needed for WPA-PSK) #CONFIG_EAP_PSK=y +# EAP-pwd (secure authentication using only a password) +#CONFIG_EAP_PWD=y + # EAP-PAX #CONFIG_EAP_PAX=y @@ -184,10 +152,20 @@ CONFIG_EAP_LEAP=y # Wi-Fi Protected Setup (WPS) CONFIG_WPS=y +# Enable WPS external registrar functionality +#CONFIG_WPS_ER=y +# Disable credentials for an open network by default when acting as a WPS +# registrar. +#CONFIG_WPS_REG_DISABLE_OPEN=y +# Enable WPS support with NFC config method +#CONFIG_WPS_NFC=y # EAP-IKEv2 #CONFIG_EAP_IKEV2=y +# EAP-EKE +#CONFIG_EAP_EKE=y + # PKCS#12 (PFX) support (used to read private key and certificate file from # a file that usually has extension .p12 or .pfx) CONFIG_PKCS12=y @@ -200,13 +178,22 @@ CONFIG_SMARTCARD=y # Enable this if EAP-SIM or EAP-AKA is included #CONFIG_PCSC=y +# Support HT overrides (disable HT/HT40, mask MCS rates, etc.) +CONFIG_HT_OVERRIDES=y + +# Support VHT overrides (disable VHT, mask MCS rates, etc.) +CONFIG_VHT_OVERRIDES=y + # Development testing #CONFIG_EAPOL_TEST=y # Select control interface backend for external programs, e.g, wpa_cli: # unix = UNIX domain sockets (default for Linux/*BSD) # udp = UDP sockets using localhost (127.0.0.1) +# udp6 = UDP IPv6 sockets using localhost (::1) # named_pipe = Windows Named Pipe (default for Windows) +# udp-remote = UDP sockets with remote access (only for tests systems/purpose) +# udp6-remote = UDP IPv6 sockets with remote access (only for tests purpose) # y = use default (backwards compatibility) # If this option is commented out, control interface is not included in the # build. @@ -218,6 +205,10 @@ CONFIG_CTRL_IFACE=y # the resulting binary. #CONFIG_READLINE=y +# Include internal line edit mode in wpa_cli. This can be used as a replacement +# for GNU Readline to provide limited command line editing and history support. +#CONFIG_WPA_CLI_EDIT=y + # Remove debugging code that is printing out debug message to stdout. # This can be used to reduce the size of the wpa_supplicant considerably # if debugging code is not needed. The size reduction can be around 35% @@ -228,11 +219,6 @@ CONFIG_CTRL_IFACE=y # 35-50 kB in code size. #CONFIG_NO_WPA=y -# Remove WPA2 support. This allows WPA to be used, but removes WPA2 code to -# save about 1 kB in code size when building only WPA-Personal (no EAP support) -# or 6 kB if building for WPA-Enterprise. -#CONFIG_NO_WPA2=y - # Remove IEEE 802.11i/WPA-Personal ASCII passphrase support # This option can be used to reduce code size by removing support for # converting ASCII passphrases into PSK. If this functionality is removed, the @@ -267,7 +253,7 @@ CONFIG_BACKEND=file # main_none = Very basic example (development use only) #CONFIG_MAIN=main -# Select wrapper for operatins system and C library specific functions +# Select wrapper for operating system and C library specific functions # unix = UNIX/POSIX like systems (default) # win32 = Windows systems # none = Empty template @@ -276,9 +262,17 @@ CONFIG_BACKEND=file # Select event loop implementation # eloop = select() loop (default) # eloop_win = Windows events and WaitForMultipleObject() loop -# eloop_none = Empty template #CONFIG_ELOOP=eloop +# Should we use poll instead of select? Select is used by default. +#CONFIG_ELOOP_POLL=y + +# Should we use epoll instead of select? Select is used by default. +#CONFIG_ELOOP_EPOLL=y + +# Should we use kqueue instead of select? Select is used by default. +#CONFIG_ELOOP_KQUEUE=y + # Select layer 2 packet implementation # linux = Linux packet socket (default) # pcap = libpcap/libdnet/WinPcap @@ -288,29 +282,44 @@ CONFIG_BACKEND=file # none = Empty template #CONFIG_L2_PACKET=linux +# Disable Linux packet socket workaround applicable for station interface +# in a bridge for EAPOL frames. This should be uncommented only if the kernel +# is known to not have the regression issue in packet socket behavior with +# bridge interfaces (commit 'bridge: respect RFC2863 operational state')'). +#CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y + # PeerKey handshake for Station to Station Link (IEEE 802.11e DLS) CONFIG_PEERKEY=y -# IEEE 802.11w (management frame protection) -# This version is an experimental implementation based on IEEE 802.11w/D1.0 -# draft and is subject to change since the standard has not yet been finalized. +# IEEE 802.11w (management frame protection), also known as PMF # Driver support is also needed for IEEE 802.11w. CONFIG_IEEE80211W=y # Select TLS implementation # openssl = OpenSSL (default) -# gnutls = GnuTLS (needed for TLS/IA, see also CONFIG_GNUTLS_EXTRA) +# gnutls = GnuTLS # internal = Internal TLSv1 implementation (experimental) +# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental) # none = Empty template CONFIG_TLS=internal -# Whether to enable TLS/IA support, which is required for EAP-TTLSv1. -# You need CONFIG_TLS=gnutls for this to have any effect. Please note that -# even though the core GnuTLS library is released under LGPL, this extra -# library uses GPL and as such, the terms of GPL apply to the combination -# of wpa_supplicant and GnuTLS if this option is enabled. BSD license may not -# apply for distribution of the resulting binary. -#CONFIG_GNUTLS_EXTRA=y +# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1) +# can be enabled to get a stronger construction of messages when block ciphers +# are used. It should be noted that some existing TLS v1.0 -based +# implementation may not be compatible with TLS v1.1 message (ClientHello is +# sent prior to negotiating which version will be used) +#CONFIG_TLSV11=y + +# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2) +# can be enabled to enable use of stronger crypto algorithms. It should be +# noted that some existing TLS v1.0 -based implementation may not be compatible +# with TLS v1.2 message (ClientHello is sent prior to negotiating which version +# will be used) +#CONFIG_TLSV12=y + +# Select which ciphers to use by default with OpenSSL if the user does not +# specify them. +#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW" # If CONFIG_TLS=internal is used, additional library and include paths are # needed for LibTomMath. Alternatively, an integrated, minimal version of @@ -366,12 +375,31 @@ CONFIG_INTERNAL_LIBTOMMATH_FAST=y # amount of memory/flash. #CONFIG_DYNAMIC_EAP_METHODS=y -# IEEE Std 802.11r-2008 (Fast BSS Transition) +# IEEE Std 802.11r-2008 (Fast BSS Transition) for station mode #CONFIG_IEEE80211R=y +# IEEE Std 802.11r-2008 (Fast BSS Transition) for AP mode (implies +# CONFIG_IEEE80211R). +#CONFIG_IEEE80211R_AP=y + # Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt) #CONFIG_DEBUG_FILE=y +# Send debug messages to syslog instead of stdout +#CONFIG_DEBUG_SYSLOG=y +# Set syslog facility for debug messages +#CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON + +# Add support for sending all debug messages (regardless of debug verbosity) +# to the Linux kernel tracing facility. This helps debug the entire stack by +# making it easy to record everything happening from the driver up into the +# same file, e.g., using trace-cmd. +#CONFIG_DEBUG_LINUX_TRACING=y + +# Add support for writing debug log to Android logcat instead of standard +# output +#CONFIG_ANDROID_LOG=y + # Enable privilege separation (see README 'Privilege separation' for details) #CONFIG_PRIVSEP=y @@ -383,7 +411,7 @@ CONFIG_INTERNAL_LIBTOMMATH_FAST=y # This tracks use of memory allocations and other registrations and reports # incorrect use with a backtrace of call (or allocation) location. #CONFIG_WPA_TRACE=y -# For BSD, comment out these. +# For BSD, uncomment these. #LIBS += -lexecinfo #LIBS_p += -lexecinfo #LIBS_c += -lexecinfo @@ -392,15 +420,174 @@ CONFIG_INTERNAL_LIBTOMMATH_FAST=y # This enables use of libbfd to get more detailed symbols for the backtraces # generated by CONFIG_WPA_TRACE=y. #CONFIG_WPA_TRACE_BFD=y -# For BSD, comment out these. +# For BSD, uncomment these. #LIBS += -lbfd -liberty -lz #LIBS_p += -lbfd -liberty -lz #LIBS_c += -lbfd -liberty -lz +# wpa_supplicant depends on strong random number generation being available +# from the operating system. os_get_random() function is used to fetch random +# data when needed, e.g., for key generation. On Linux and BSD systems, this +# works by reading /dev/urandom. It should be noted that the OS entropy pool +# needs to be properly initialized before wpa_supplicant is started. This is +# important especially on embedded devices that do not have a hardware random +# number generator and may by default start up with minimal entropy available +# for random number generation. +# +# As a safety net, wpa_supplicant is by default trying to internally collect +# additional entropy for generating random data to mix in with the data fetched +# from the OS. This by itself is not considered to be very strong, but it may +# help in cases where the system pool is not initialized properly. However, it +# is very strongly recommended that the system pool is initialized with enough +# entropy either by using hardware assisted random number generator or by +# storing state over device reboots. +# +# wpa_supplicant can be configured to maintain its own entropy store over +# restarts to enhance random number generation. This is not perfect, but it is +# much more secure than using the same sequence of random numbers after every +# reboot. This can be enabled with -e command line option. The +# specified file needs to be readable and writable by wpa_supplicant. +# +# If the os_get_random() is known to provide strong random data (e.g., on +# Linux/BSD, the board in question is known to have reliable source of random +# data from /dev/urandom), the internal wpa_supplicant random pool can be +# disabled. This will save some in binary size and CPU use. However, this +# should only be considered for builds that are known to be used on devices +# that meet the requirements described above. CONFIG_NO_RANDOM_POOL=y -NEED_80211_COMMON=y +# IEEE 802.11n (High Throughput) support (mainly for AP mode) +#CONFIG_IEEE80211N=y + +# IEEE 802.11ac (Very High Throughput) support (mainly for AP mode) +# (depends on CONFIG_IEEE80211N) +#CONFIG_IEEE80211AC=y + +# Wireless Network Management (IEEE Std 802.11v-2011) +# Note: This is experimental and not complete implementation. +#CONFIG_WNM=y + +# Interworking (IEEE 802.11u) +# This can be used to enable functionality to improve interworking with +# external networks (GAS/ANQP to learn more about the networks and network +# selection based on available credentials). +#CONFIG_INTERWORKING=y + +# Hotspot 2.0 +#CONFIG_HS20=y + +# Enable interface matching in wpa_supplicant +#CONFIG_MATCH_IFACE=y + +# Disable roaming in wpa_supplicant +#CONFIG_NO_ROAMING=y + +# AP mode operations with wpa_supplicant +# This can be used for controlling AP mode operations with wpa_supplicant. It +# should be noted that this is mainly aimed at simple cases like +# WPA2-Personal while more complex configurations like WPA2-Enterprise with an +# external RADIUS server can be supported with hostapd. +CONFIG_AP=y + +# P2P (Wi-Fi Direct) +# This can be used to enable P2P support in wpa_supplicant. See README-P2P for +# more information on P2P operations. +CONFIG_P2P=y + +# Enable TDLS support +#CONFIG_TDLS=y + +# Wi-Fi Direct +# This can be used to enable Wi-Fi Direct extensions for P2P using an external +# program to control the additional information exchanges in the messages. +#CONFIG_WIFI_DISPLAY=y + +# Autoscan +# This can be used to enable automatic scan support in wpa_supplicant. +# See wpa_supplicant.conf for more information on autoscan usage. +# +# Enabling directly a module will enable autoscan support. +# For exponential module: +#CONFIG_AUTOSCAN_EXPONENTIAL=y +# For periodic module: +#CONFIG_AUTOSCAN_PERIODIC=y + +# Password (and passphrase, etc.) backend for external storage +# These optional mechanisms can be used to add support for storing passwords +# and other secrets in external (to wpa_supplicant) location. This allows, for +# example, operating system specific key storage to be used +# +# External password backend for testing purposes (developer use) +#CONFIG_EXT_PASSWORD_TEST=y + +# Enable Fast Session Transfer (FST) +#CONFIG_FST=y + +# Enable CLI commands for FST testing +#CONFIG_FST_TEST=y + +# OS X builds. This is only for building eapol_test. +#CONFIG_OSX=y + +# Automatic Channel Selection +# This will allow wpa_supplicant to pick the channel automatically when channel +# is set to "0". +# +# TODO: Extend parser to be able to parse "channel=acs_survey" as an alternative +# to "channel=0". This would enable us to eventually add other ACS algorithms in +# similar way. +# +# Automatic selection is currently only done through initialization, later on +# we hope to do background checks to keep us moving to more ideal channels as +# time goes by. ACS is currently only supported through the nl80211 driver and +# your driver must have survey dump capability that is filled by the driver +# during scanning. +# +# TODO: In analogy to hostapd be able to customize the ACS survey algorithm with +# a newly to create wpa_supplicant.conf variable acs_num_scans. +# +# Supported ACS drivers: +# * ath9k +# * ath5k +# * ath10k +# +# For more details refer to: +# http://wireless.kernel.org/en/users/Documentation/acs +#CONFIG_ACS=y + +# Support Multi Band Operation +#CONFIG_MBO=y + +# Fast Initial Link Setup (FILS) (IEEE 802.11ai) +# Note: This is an experimental and not yet complete implementation. This +# should not be enabled for production use. +#CONFIG_FILS=y +# FILS shared key authentication with PFS +#CONFIG_FILS_SK_PFS=y + +# Support RSN on IBSS networks +# This is needed to be able to use mode=1 network profile with proto=RSN and +# key_mgmt=WPA-PSK (i.e., full key management instead of WPA-None). CONFIG_IBSS_RSN=y -CONFIG_P2P=y -CONFIG_AP=y +# External PMKSA cache control +# This can be used to enable control interface commands that allow the current +# PMKSA cache entries to be fetched and new entries to be added. +#CONFIG_PMKSA_CACHE_EXTERNAL=y + +# Mesh Networking (IEEE 802.11s) +#CONFIG_MESH=y + +# Background scanning modules +# These can be used to request wpa_supplicant to perform background scanning +# operations for roaming within an ESS (same SSID). See the bgscan parameter in +# the wpa_supplicant.conf file for more details. +# Periodic background scans based on signal strength +#CONFIG_BGSCAN_SIMPLE=y +# Learn channels used by the network and try to avoid bgscans on other +# channels (experimental) +#CONFIG_BGSCAN_LEARN=y + +# Opportunistic Wireless Encryption (OWE) +# Experimental implementation of draft-harkins-owe-07.txt +#CONFIG_OWE=y diff --git a/package/network/services/hostapd/patches/005-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch b/package/network/services/hostapd/patches/000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch similarity index 84% rename from package/network/services/hostapd/patches/005-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch rename to package/network/services/hostapd/patches/000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch index 2136bb9d4..14b2d7c71 100644 --- a/package/network/services/hostapd/patches/005-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch +++ b/package/network/services/hostapd/patches/000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch @@ -21,7 +21,7 @@ Signed-off-by: Mathy Vanhoef --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -2154,6 +2154,7 @@ static int add_associated_sta(struct hos +@@ -2522,6 +2522,7 @@ static int add_associated_sta(struct hos { struct ieee80211_ht_capabilities ht_cap; struct ieee80211_vht_capabilities vht_cap; @@ -29,7 +29,7 @@ Signed-off-by: Mathy Vanhoef /* * Remove the STA entry to ensure the STA PS state gets cleared and -@@ -2161,9 +2162,18 @@ static int add_associated_sta(struct hos +@@ -2529,9 +2530,18 @@ static int add_associated_sta(struct hos * FT-over-the-DS, where a station re-associates back to the same AP but * skips the authentication flow, or if working with a driver that * does not support full AP client state. @@ -49,7 +49,7 @@ Signed-off-by: Mathy Vanhoef #ifdef CONFIG_IEEE80211N if (sta->flags & WLAN_STA_HT) -@@ -2186,11 +2196,11 @@ static int add_associated_sta(struct hos +@@ -2554,11 +2564,11 @@ static int add_associated_sta(struct hos sta->flags & WLAN_STA_VHT ? &vht_cap : NULL, sta->flags | WLAN_STA_ASSOC, sta->qosinfo, sta->vht_opmode, sta->p2p_ie ? 1 : 0, @@ -65,17 +65,17 @@ Signed-off-by: Mathy Vanhoef hostapd_drv_sta_remove(hapd, sta->addr); --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -1751,6 +1751,9 @@ int wpa_auth_sm_event(struct wpa_state_m - #else /* CONFIG_IEEE80211R_AP */ +@@ -1783,6 +1783,9 @@ int wpa_auth_sm_event(struct wpa_state_m + #else /* CONFIG_FILS */ break; - #endif /* CONFIG_IEEE80211R_AP */ + #endif /* CONFIG_FILS */ + case WPA_DRV_STA_REMOVED: + sm->tk_already_set = FALSE; + return 0; } #ifdef CONFIG_IEEE80211R_AP -@@ -3725,6 +3728,14 @@ int wpa_auth_sta_wpa_version(struct wpa_ +@@ -3922,6 +3925,14 @@ int wpa_auth_sta_wpa_version(struct wpa_ } @@ -90,9 +90,28 @@ Signed-off-by: Mathy Vanhoef int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm, struct rsn_pmksa_cache_entry *entry) { +--- a/src/ap/wpa_auth.h ++++ b/src/ap/wpa_auth.h +@@ -300,7 +300,7 @@ void wpa_receive(struct wpa_authenticato + u8 *data, size_t data_len); + enum wpa_event { + WPA_AUTH, WPA_ASSOC, WPA_DISASSOC, WPA_DEAUTH, WPA_REAUTH, +- WPA_REAUTH_EAPOL, WPA_ASSOC_FT, WPA_ASSOC_FILS ++ WPA_REAUTH_EAPOL, WPA_ASSOC_FT, WPA_ASSOC_FILS, WPA_DRV_STA_REMOVED + }; + void wpa_remove_ptk(struct wpa_state_machine *sm); + int wpa_auth_sm_event(struct wpa_state_machine *sm, enum wpa_event event); +@@ -313,6 +313,7 @@ int wpa_auth_pairwise_set(struct wpa_sta + int wpa_auth_get_pairwise(struct wpa_state_machine *sm); + int wpa_auth_sta_key_mgmt(struct wpa_state_machine *sm); + int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm); ++int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm); + int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm, + struct rsn_pmksa_cache_entry *entry); + struct rsn_pmksa_cache_entry * --- a/src/ap/wpa_auth_ft.c +++ b/src/ap/wpa_auth_ft.c -@@ -794,6 +794,14 @@ void wpa_ft_install_ptk(struct wpa_state +@@ -1937,6 +1937,14 @@ void wpa_ft_install_ptk(struct wpa_state return; } @@ -107,7 +126,7 @@ Signed-off-by: Mathy Vanhoef /* FIX: add STA entry to kernel/driver here? The set_key will fail * most likely without this.. At the moment, STA entry is added only * after association has been completed. This function will be called -@@ -806,6 +814,7 @@ void wpa_ft_install_ptk(struct wpa_state +@@ -1949,6 +1957,7 @@ void wpa_ft_install_ptk(struct wpa_state /* FIX: MLME-SetProtection.Request(TA, Tx_Rx) */ sm->pairwise_set = TRUE; @@ -115,7 +134,7 @@ Signed-off-by: Mathy Vanhoef } -@@ -1002,6 +1011,7 @@ static int wpa_ft_process_auth_req(struc +@@ -2152,6 +2161,7 @@ static int wpa_ft_process_auth_req(struc sm->pairwise = pairwise; sm->PTK_valid = TRUE; @@ -123,28 +142,9 @@ Signed-off-by: Mathy Vanhoef wpa_ft_install_ptk(sm); buflen = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) + ---- a/src/ap/wpa_auth.h -+++ b/src/ap/wpa_auth.h -@@ -268,7 +268,7 @@ void wpa_receive(struct wpa_authenticato - u8 *data, size_t data_len); - enum wpa_event { - WPA_AUTH, WPA_ASSOC, WPA_DISASSOC, WPA_DEAUTH, WPA_REAUTH, -- WPA_REAUTH_EAPOL, WPA_ASSOC_FT -+ WPA_REAUTH_EAPOL, WPA_ASSOC_FT, WPA_DRV_STA_REMOVED - }; - void wpa_remove_ptk(struct wpa_state_machine *sm); - int wpa_auth_sm_event(struct wpa_state_machine *sm, enum wpa_event event); -@@ -281,6 +281,7 @@ int wpa_auth_pairwise_set(struct wpa_sta - int wpa_auth_get_pairwise(struct wpa_state_machine *sm); - int wpa_auth_sta_key_mgmt(struct wpa_state_machine *sm); - int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm); -+int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm); - int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm, - struct rsn_pmksa_cache_entry *entry); - struct rsn_pmksa_cache_entry * --- a/src/ap/wpa_auth_i.h +++ b/src/ap/wpa_auth_i.h -@@ -65,6 +65,7 @@ struct wpa_state_machine { +@@ -61,6 +61,7 @@ struct wpa_state_machine { struct wpa_ptk PTK; Boolean PTK_valid; Boolean pairwise_set; diff --git a/package/network/services/hostapd/patches/001-Fix-race-condition-between-AssocResp-callback-and-4a.patch b/package/network/services/hostapd/patches/001-Fix-race-condition-between-AssocResp-callback-and-4a.patch deleted file mode 100644 index bf54e9df3..000000000 --- a/package/network/services/hostapd/patches/001-Fix-race-condition-between-AssocResp-callback-and-4a.patch +++ /dev/null @@ -1,83 +0,0 @@ -From: Jouni Malinen -Date: Tue, 20 Dec 2016 01:30:09 +0200 -Subject: [PATCH] Fix race condition between AssocResp callback and 4addr event - -It is apparently possible for the NL80211_CMD_UNEXPECTED_4ADDR_FRAME -event to be delivered to hostapd before the NL80211_CMD_FRAME_TX_STATUS -event for (Re)Association Response frame. This resulted in the 4-address -WDS mode not getting enabled for a STA. This could occur in particular -when operating under heavy load and the STA is reconnecting to the same -AP in a sequence where Deauthentication frame is followed immediately by -Authentication frame and the driver event processing gets delayed due to -removal of the previous netdev taking time in the middle of this -sequence. - -Fix this by recording a pending item for 4-address WDS enabling if the -NL80211_CMD_UNEXPECTED_4ADDR_FRAME event would have been dropped due to -incompleted association and then process this pending item if the TX -status for the (Re)Association Response frame is received and it shows -that the frame was acknowledged. - -Signed-off-by: Jouni Malinen ---- - ---- a/src/ap/ieee802_11.c -+++ b/src/ap/ieee802_11.c -@@ -2634,6 +2634,8 @@ static void handle_assoc(struct hostapd_ - taxonomy_sta_info_assoc_req(hapd, sta, pos, left); - #endif /* CONFIG_TAXONOMY */ - -+ sta->pending_wds_enable = 0; -+ - fail: - /* - * In case of a successful response, add the station to the driver. -@@ -3248,6 +3250,14 @@ static void handle_assoc_cb(struct hosta - - hostapd_set_sta_flags(hapd, sta); - -+ if (!(sta->flags & WLAN_STA_WDS) && sta->pending_wds_enable) { -+ wpa_printf(MSG_DEBUG, "Enable 4-address WDS mode for STA " -+ MACSTR " based on pending request", -+ MAC2STR(sta->addr)); -+ sta->pending_wds_enable = 0; -+ sta->flags |= WLAN_STA_WDS; -+ } -+ - if (sta->flags & WLAN_STA_WDS) { - int ret; - char ifname_wds[IFNAMSIZ + 1]; -@@ -3512,10 +3522,22 @@ void ieee802_11_rx_from_unknown(struct h - struct sta_info *sta; - - sta = ap_get_sta(hapd, src); -- if (sta && (sta->flags & WLAN_STA_ASSOC)) { -+ if (sta && -+ ((sta->flags & WLAN_STA_ASSOC) || -+ ((sta->flags & WLAN_STA_ASSOC_REQ_OK) && wds))) { - if (!hapd->conf->wds_sta) - return; - -+ if ((sta->flags & (WLAN_STA_ASSOC | WLAN_STA_ASSOC_REQ_OK)) == -+ WLAN_STA_ASSOC_REQ_OK) { -+ wpa_printf(MSG_DEBUG, -+ "Postpone 4-address WDS mode enabling for STA " -+ MACSTR " since TX status for AssocResp is not yet known", -+ MAC2STR(sta->addr)); -+ sta->pending_wds_enable = 1; -+ return; -+ } -+ - if (wds && !(sta->flags & WLAN_STA_WDS)) { - int ret; - char ifname_wds[IFNAMSIZ + 1]; ---- a/src/ap/sta_info.h -+++ b/src/ap/sta_info.h -@@ -115,6 +115,7 @@ struct sta_info { - unsigned int radius_das_match:1; - unsigned int ecsa_supported:1; - unsigned int added_unassoc:1; -+ unsigned int pending_wds_enable:1; - - u16 auth_alg; - diff --git a/package/network/services/hostapd/patches/006-Prevent-reinstallation-of-an-already-in-use-group-ke.patch b/package/network/services/hostapd/patches/001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch similarity index 91% rename from package/network/services/hostapd/patches/006-Prevent-reinstallation-of-an-already-in-use-group-ke.patch rename to package/network/services/hostapd/patches/001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch index 71c681e29..b283bf887 100644 --- a/package/network/services/hostapd/patches/006-Prevent-reinstallation-of-an-already-in-use-group-ke.patch +++ b/package/network/services/hostapd/patches/001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch @@ -13,7 +13,7 @@ Signed-off-by: Mathy Vanhoef --- a/src/common/wpa_common.h +++ b/src/common/wpa_common.h -@@ -207,6 +207,17 @@ struct wpa_ptk { +@@ -218,6 +218,17 @@ struct wpa_ptk { size_t tk_len; }; @@ -33,7 +33,7 @@ Signed-off-by: Mathy Vanhoef * 00-50-f2:1 (OUI:OUI type) --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -785,6 +785,15 @@ static int wpa_supplicant_install_gtk(st +@@ -800,6 +800,15 @@ static int wpa_supplicant_install_gtk(st const u8 *_gtk = gd->gtk; u8 gtk_buf[32]; @@ -49,7 +49,7 @@ Signed-off-by: Mathy Vanhoef wpa_hexdump_key(MSG_DEBUG, "WPA: Group Key", gd->gtk, gd->gtk_len); wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Installing GTK to the driver (keyidx=%d tx=%d len=%d)", -@@ -819,6 +828,9 @@ static int wpa_supplicant_install_gtk(st +@@ -834,6 +843,9 @@ static int wpa_supplicant_install_gtk(st } os_memset(gtk_buf, 0, sizeof(gtk_buf)); @@ -59,7 +59,7 @@ Signed-off-by: Mathy Vanhoef return 0; } -@@ -925,6 +937,48 @@ static int wpa_supplicant_pairwise_gtk(s +@@ -940,6 +952,48 @@ static int wpa_supplicant_pairwise_gtk(s } @@ -108,7 +108,7 @@ Signed-off-by: Mathy Vanhoef static int ieee80211w_set_keys(struct wpa_sm *sm, struct wpa_eapol_ie_parse *ie) { -@@ -935,30 +989,14 @@ static int ieee80211w_set_keys(struct wp +@@ -950,30 +1004,14 @@ static int ieee80211w_set_keys(struct wp if (ie->igtk) { size_t len; const struct wpa_igtk_kde *igtk; @@ -142,7 +142,7 @@ Signed-off-by: Mathy Vanhoef } return 0; -@@ -2451,7 +2489,7 @@ void wpa_sm_deinit(struct wpa_sm *sm) +@@ -2491,7 +2529,7 @@ void wpa_sm_deinit(struct wpa_sm *sm) */ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid) { @@ -151,7 +151,7 @@ Signed-off-by: Mathy Vanhoef if (sm == NULL) return; -@@ -2477,7 +2515,7 @@ void wpa_sm_notify_assoc(struct wpa_sm * +@@ -2517,7 +2555,7 @@ void wpa_sm_notify_assoc(struct wpa_sm * /* Prepare for the next transition */ wpa_ft_prepare_auth_request(sm, NULL); @@ -160,7 +160,7 @@ Signed-off-by: Mathy Vanhoef } #endif /* CONFIG_IEEE80211R */ #ifdef CONFIG_FILS -@@ -2487,11 +2525,11 @@ void wpa_sm_notify_assoc(struct wpa_sm * +@@ -2527,11 +2565,11 @@ void wpa_sm_notify_assoc(struct wpa_sm * * AUTHENTICATED state to get the EAPOL port Authorized. */ wpa_supplicant_key_neg_complete(sm, sm->bssid, 1); @@ -174,7 +174,7 @@ Signed-off-by: Mathy Vanhoef /* * IEEE 802.11, 8.4.10: Delete PTK SA on (re)association if * this is not part of a Fast BSS Transition. -@@ -2501,6 +2539,10 @@ void wpa_sm_notify_assoc(struct wpa_sm * +@@ -2541,6 +2579,10 @@ void wpa_sm_notify_assoc(struct wpa_sm * os_memset(&sm->ptk, 0, sizeof(sm->ptk)); sm->tptk_set = 0; os_memset(&sm->tptk, 0, sizeof(sm->tptk)); @@ -185,7 +185,7 @@ Signed-off-by: Mathy Vanhoef } #ifdef CONFIG_TDLS -@@ -3052,6 +3094,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm) +@@ -3117,6 +3159,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm) os_memset(sm->pmk, 0, sizeof(sm->pmk)); os_memset(&sm->ptk, 0, sizeof(sm->ptk)); os_memset(&sm->tptk, 0, sizeof(sm->tptk)); @@ -196,7 +196,7 @@ Signed-off-by: Mathy Vanhoef #ifdef CONFIG_IEEE80211R os_memset(sm->xxkey, 0, sizeof(sm->xxkey)); os_memset(sm->pmk_r0, 0, sizeof(sm->pmk_r0)); -@@ -3124,29 +3170,11 @@ int wpa_wnmsleep_install_key(struct wpa_ +@@ -3189,29 +3235,11 @@ int wpa_wnmsleep_install_key(struct wpa_ os_memset(&gd, 0, sizeof(gd)); #ifdef CONFIG_IEEE80211W } else if (subelem_id == WNM_SLEEP_SUBELEM_IGTK) { diff --git a/package/network/services/hostapd/patches/007-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch b/package/network/services/hostapd/patches/002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch similarity index 84% rename from package/network/services/hostapd/patches/007-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch rename to package/network/services/hostapd/patches/002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch index 650bf43e9..2093d25e9 100644 --- a/package/network/services/hostapd/patches/007-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch +++ b/package/network/services/hostapd/patches/002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch @@ -14,7 +14,7 @@ Signed-off-by: Jouni Malinen --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -780,14 +780,17 @@ struct wpa_gtk_data { +@@ -795,14 +795,17 @@ struct wpa_gtk_data { static int wpa_supplicant_install_gtk(struct wpa_sm *sm, const struct wpa_gtk_data *gd, @@ -35,7 +35,7 @@ Signed-off-by: Jouni Malinen wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Not reinstalling already in-use GTK to the driver (keyidx=%d tx=%d len=%d)", gd->keyidx, gd->tx, gd->gtk_len); -@@ -828,8 +831,14 @@ static int wpa_supplicant_install_gtk(st +@@ -843,8 +846,14 @@ static int wpa_supplicant_install_gtk(st } os_memset(gtk_buf, 0, sizeof(gtk_buf)); @@ -52,7 +52,7 @@ Signed-off-by: Jouni Malinen return 0; } -@@ -923,7 +932,7 @@ static int wpa_supplicant_pairwise_gtk(s +@@ -938,7 +947,7 @@ static int wpa_supplicant_pairwise_gtk(s (wpa_supplicant_check_group_cipher(sm, sm->group_cipher, gtk_len, gtk_len, &gd.key_rsc_len, &gd.alg) || @@ -61,7 +61,7 @@ Signed-off-by: Jouni Malinen wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "RSN: Failed to install GTK"); os_memset(&gd, 0, sizeof(gd)); -@@ -939,14 +948,18 @@ static int wpa_supplicant_pairwise_gtk(s +@@ -954,14 +963,18 @@ static int wpa_supplicant_pairwise_gtk(s #ifdef CONFIG_IEEE80211W static int wpa_supplicant_install_igtk(struct wpa_sm *sm, @@ -83,7 +83,7 @@ Signed-off-by: Jouni Malinen wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Not reinstalling already in-use IGTK to the driver (keyidx=%d)", keyidx); -@@ -971,8 +984,14 @@ static int wpa_supplicant_install_igtk(s +@@ -986,8 +999,14 @@ static int wpa_supplicant_install_igtk(s return -1; } @@ -100,7 +100,7 @@ Signed-off-by: Jouni Malinen return 0; } -@@ -995,7 +1014,7 @@ static int ieee80211w_set_keys(struct wp +@@ -1010,7 +1029,7 @@ static int ieee80211w_set_keys(struct wp return -1; igtk = (const struct wpa_igtk_kde *) ie->igtk; @@ -109,7 +109,7 @@ Signed-off-by: Jouni Malinen return -1; } -@@ -1641,7 +1660,7 @@ static void wpa_supplicant_process_1_of_ +@@ -1659,7 +1678,7 @@ static void wpa_supplicant_process_1_of_ if (wpa_supplicant_rsc_relaxation(sm, key->key_rsc)) key_rsc = null_rsc; @@ -118,7 +118,7 @@ Signed-off-by: Jouni Malinen wpa_supplicant_send_2_of_2(sm, key, ver, key_info) < 0) goto failed; os_memset(&gd, 0, sizeof(gd)); -@@ -2540,8 +2559,10 @@ void wpa_sm_notify_assoc(struct wpa_sm * +@@ -2580,8 +2599,10 @@ void wpa_sm_notify_assoc(struct wpa_sm * sm->tptk_set = 0; os_memset(&sm->tptk, 0, sizeof(sm->tptk)); os_memset(&sm->gtk, 0, sizeof(sm->gtk)); @@ -129,7 +129,7 @@ Signed-off-by: Jouni Malinen #endif /* CONFIG_IEEE80211W */ } -@@ -3095,8 +3116,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm) +@@ -3160,8 +3181,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm) os_memset(&sm->ptk, 0, sizeof(sm->ptk)); os_memset(&sm->tptk, 0, sizeof(sm->tptk)); os_memset(&sm->gtk, 0, sizeof(sm->gtk)); @@ -140,7 +140,7 @@ Signed-off-by: Jouni Malinen #endif /* CONFIG_IEEE80211W */ #ifdef CONFIG_IEEE80211R os_memset(sm->xxkey, 0, sizeof(sm->xxkey)); -@@ -3161,7 +3184,7 @@ int wpa_wnmsleep_install_key(struct wpa_ +@@ -3226,7 +3249,7 @@ int wpa_wnmsleep_install_key(struct wpa_ wpa_hexdump_key(MSG_DEBUG, "Install GTK (WNM SLEEP)", gd.gtk, gd.gtk_len); @@ -149,7 +149,7 @@ Signed-off-by: Jouni Malinen os_memset(&gd, 0, sizeof(gd)); wpa_printf(MSG_DEBUG, "Failed to install the GTK in " "WNM mode"); -@@ -3173,7 +3196,7 @@ int wpa_wnmsleep_install_key(struct wpa_ +@@ -3238,7 +3261,7 @@ int wpa_wnmsleep_install_key(struct wpa_ const struct wpa_igtk_kde *igtk; igtk = (const struct wpa_igtk_kde *) (buf + 2); @@ -158,6 +158,15 @@ Signed-off-by: Jouni Malinen return -1; #endif /* CONFIG_IEEE80211W */ } else { +@@ -4121,7 +4144,7 @@ int fils_process_assoc_resp(struct wpa_s + os_memcpy(gd.gtk, kde.gtk + 2, kde.gtk_len - 2); + + wpa_printf(MSG_DEBUG, "FILS: Set GTK to driver"); +- if (wpa_supplicant_install_gtk(sm, &gd, elems.key_delivery) < 0) { ++ if (wpa_supplicant_install_gtk(sm, &gd, elems.key_delivery, 0) < 0) { + wpa_printf(MSG_DEBUG, "FILS: Failed to set GTK"); + goto fail; + } --- a/src/rsn_supp/wpa_i.h +++ b/src/rsn_supp/wpa_i.h @@ -32,8 +32,10 @@ struct wpa_sm { diff --git a/package/network/services/hostapd/patches/002-Fix-duplicate-Reassociation-Request-frame-dropping.patch b/package/network/services/hostapd/patches/002-Fix-duplicate-Reassociation-Request-frame-dropping.patch deleted file mode 100644 index 6db1e9b34..000000000 --- a/package/network/services/hostapd/patches/002-Fix-duplicate-Reassociation-Request-frame-dropping.patch +++ /dev/null @@ -1,36 +0,0 @@ -From: Jouni Malinen -Date: Sat, 14 Jan 2017 01:04:31 +0200 -Subject: [PATCH] Fix duplicate Reassociation Request frame dropping - -Relational operators (==) have higher precedence than the ternary -conditional in C. The last_subtype check for association/reassociation -was broken due to incorrect assumption about the precedence. Fix this by -adding parenthesis around the ternary conditional. - -The previous implementation worked for Association Request frames by -accident since WLAN_FC_STYPE_ASSOC_REQ happens to have value 0 and when -the last receive frame was an Association Request frame, the -sta->last_subtype == reassoc check was true and non-zero -WLAN_FC_STYPE_REASSOC_REQ was interpreted as true. However, this was -broken for Reassociation Request frame. reassoc == 1 in that case could -have matched received Association Response frame (subtype == 1), but -those are not received in AP mode and as such, this did not break other -behavior apart from not being able to drop duplicated Reassociation -Request frames. - -Signed-off-by: Jouni Malinen ---- - ---- a/src/ap/ieee802_11.c -+++ b/src/ap/ieee802_11.c -@@ -2485,8 +2485,8 @@ static void handle_assoc(struct hostapd_ - if ((fc & WLAN_FC_RETRY) && - sta->last_seq_ctrl != WLAN_INVALID_MGMT_SEQ && - sta->last_seq_ctrl == seq_ctrl && -- sta->last_subtype == reassoc ? WLAN_FC_STYPE_REASSOC_REQ : -- WLAN_FC_STYPE_ASSOC_REQ) { -+ sta->last_subtype == (reassoc ? WLAN_FC_STYPE_REASSOC_REQ : -+ WLAN_FC_STYPE_ASSOC_REQ)) { - hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, - HOSTAPD_LEVEL_DEBUG, - "Drop repeated association frame seq_ctrl=0x%x", diff --git a/package/network/services/hostapd/patches/008-Prevent-installation-of-an-all-zero-TK.patch b/package/network/services/hostapd/patches/003-Prevent-installation-of-an-all-zero-TK.patch similarity index 76% rename from package/network/services/hostapd/patches/008-Prevent-installation-of-an-all-zero-TK.patch rename to package/network/services/hostapd/patches/003-Prevent-installation-of-an-all-zero-TK.patch index e0f1773f2..30679e25c 100644 --- a/package/network/services/hostapd/patches/008-Prevent-installation-of-an-all-zero-TK.patch +++ b/package/network/services/hostapd/patches/003-Prevent-installation-of-an-all-zero-TK.patch @@ -17,7 +17,7 @@ Signed-off-by: Mathy Vanhoef --- a/src/common/wpa_common.h +++ b/src/common/wpa_common.h -@@ -205,6 +205,7 @@ struct wpa_ptk { +@@ -216,6 +216,7 @@ struct wpa_ptk { size_t kck_len; size_t kek_len; size_t tk_len; @@ -27,7 +27,7 @@ Signed-off-by: Mathy Vanhoef struct wpa_gtk { --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -581,7 +581,6 @@ static void wpa_supplicant_process_1_of_ +@@ -594,7 +594,6 @@ static void wpa_supplicant_process_1_of_ os_memset(buf, 0, sizeof(buf)); } sm->tptk_set = 1; @@ -35,7 +35,7 @@ Signed-off-by: Mathy Vanhoef kde = sm->assoc_wpa_ie; kde_len = sm->assoc_wpa_ie_len; -@@ -686,7 +685,7 @@ static int wpa_supplicant_install_ptk(st +@@ -701,7 +700,7 @@ static int wpa_supplicant_install_ptk(st enum wpa_alg alg; const u8 *key_rsc; @@ -44,7 +44,7 @@ Signed-off-by: Mathy Vanhoef wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Do not re-install same PTK to the driver"); return 0; -@@ -730,7 +729,7 @@ static int wpa_supplicant_install_ptk(st +@@ -745,7 +744,7 @@ static int wpa_supplicant_install_ptk(st /* TK is not needed anymore in supplicant */ os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN); @@ -53,6 +53,14 @@ Signed-off-by: Mathy Vanhoef if (sm->wpa_ptk_rekey) { eloop_cancel_timeout(wpa_sm_rekey_ptk, sm, NULL); +@@ -4172,6 +4171,7 @@ int fils_process_assoc_resp(struct wpa_s + * takes care of association frame encryption/decryption. */ + /* TK is not needed anymore in supplicant */ + os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN); ++ sm->ptk.installed = 1; + + /* FILS HLP Container */ + fils_process_hlp_container(sm, ie_start, end - ie_start); --- a/src/rsn_supp/wpa_i.h +++ b/src/rsn_supp/wpa_i.h @@ -24,7 +24,6 @@ struct wpa_sm { diff --git a/package/network/services/hostapd/patches/003-RSN-IBSS-Fix-TK-clearing-on-Authentication-frame-RX.patch b/package/network/services/hostapd/patches/003-RSN-IBSS-Fix-TK-clearing-on-Authentication-frame-RX.patch deleted file mode 100644 index 0a3c27f89..000000000 --- a/package/network/services/hostapd/patches/003-RSN-IBSS-Fix-TK-clearing-on-Authentication-frame-RX.patch +++ /dev/null @@ -1,40 +0,0 @@ -From: Jouni Malinen -Date: Sat, 14 Jan 2017 13:56:18 +0200 -Subject: [PATCH] RSN IBSS: Fix TK clearing on Authentication frame RX - -When wpa_supplicant was processing a received Authentication frame (seq -1) from a peer STA for which there was already a TK configured to the -driver, debug log claimed that the PTK gets cleared, but the actual -call to clear the key was actually dropped due to AUTH vs. SUPP set_key -selection. Fix this by explicitly clearing the TK in case it was set -and an Authentication frame (seq 1) is received. - -This fixes some cases where EAPOL-Key frames were sent encrypted using -the old key when a peer STA restarted itself and lost the key and had to -re-join the IBSS. Previously, that state required timing out the 4-way -handshake and Deauthentication frame exchange to recover. - -Signed-off-by: Jouni Malinen ---- - ---- a/wpa_supplicant/ibss_rsn.c -+++ b/wpa_supplicant/ibss_rsn.c -@@ -838,6 +838,18 @@ static void ibss_rsn_handle_auth_1_of_2( - MAC2STR(addr)); - - if (peer && -+ peer->authentication_status & (IBSS_RSN_SET_PTK_SUPP | -+ IBSS_RSN_SET_PTK_AUTH)) { -+ /* Clear the TK for this pair to allow recovery from the case -+ * where the peer STA has restarted and lost its key while we -+ * still have a pairwise key configured. */ -+ wpa_printf(MSG_DEBUG, "RSN: Clear pairwise key for peer " -+ MACSTR, MAC2STR(addr)); -+ wpa_drv_set_key(ibss_rsn->wpa_s, WPA_ALG_NONE, addr, 0, 0, -+ NULL, 0, NULL, 0); -+ } -+ -+ if (peer && - peer->authentication_status & IBSS_RSN_AUTH_EAPOL_BY_PEER) { - if (peer->own_auth_tx.sec) { - struct os_reltime now, diff; diff --git a/package/network/services/hostapd/patches/009-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch b/package/network/services/hostapd/patches/004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch similarity index 94% rename from package/network/services/hostapd/patches/009-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch rename to package/network/services/hostapd/patches/004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch index 8d9bd42ac..6f28e7431 100644 --- a/package/network/services/hostapd/patches/009-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch +++ b/package/network/services/hostapd/patches/004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch @@ -16,7 +16,7 @@ Signed-off-by: Jouni Malinen --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -1912,6 +1912,21 @@ SM_STATE(WPA_PTK, AUTHENTICATION2) +@@ -1951,6 +1951,21 @@ SM_STATE(WPA_PTK, AUTHENTICATION2) } @@ -38,7 +38,7 @@ Signed-off-by: Jouni Malinen SM_STATE(WPA_PTK, INITPMK) { u8 msk[2 * PMK_LEN]; -@@ -2932,9 +2947,12 @@ SM_STEP(WPA_PTK) +@@ -3116,9 +3131,12 @@ SM_STEP(WPA_PTK) SM_ENTER(WPA_PTK, AUTHENTICATION); else if (sm->ReAuthenticationRequest) SM_ENTER(WPA_PTK, AUTHENTICATION2); diff --git a/package/network/services/hostapd/patches/004-hostapd-Add-possibility-to-send-debug-messages-to-sy.patch b/package/network/services/hostapd/patches/004-hostapd-Add-possibility-to-send-debug-messages-to-sy.patch deleted file mode 100644 index 3417b5ac3..000000000 --- a/package/network/services/hostapd/patches/004-hostapd-Add-possibility-to-send-debug-messages-to-sy.patch +++ /dev/null @@ -1,145 +0,0 @@ -From cc3dae85bd694506cdea66ae532d452fb8716297 Mon Sep 17 00:00:00 2001 -From: Wojciech Dubowik -Date: Mon, 23 Jan 2017 13:55:04 +0100 -Subject: [PATCH] hostapd: Add possibility to send debug messages to syslog - -We can only send module specific messages to syslog and not debug -messages printed with wpa_printf. Add an extra command line parameter -'-s' to allow it. The feature is enabled with compile flag -CONFIG_DEBUG_SYSLOG as for wpa_supplicant and behaves in the same manner -as the wpa_supplicant -s command line argument. - -Signed-off-by: Wojciech Dubowik ---- - hostapd/Android.mk | 4 ++++ - hostapd/Makefile | 4 ++++ - hostapd/defconfig | 3 +++ - hostapd/main.c | 19 ++++++++++++++++++- - src/utils/wpa_debug.c | 2 +- - src/utils/wpa_debug.h | 3 +++ - 6 files changed, 33 insertions(+), 2 deletions(-) - ---- a/hostapd/Android.mk -+++ b/hostapd/Android.mk -@@ -952,6 +952,10 @@ ifdef CONFIG_NO_STDOUT_DEBUG - L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG - endif - -+ifdef CONFIG_DEBUG_SYSLOG -+L_CFLAGS += -DCONFIG_DEBUG_SYSLOG -+endif -+ - ifdef CONFIG_DEBUG_LINUX_TRACING - L_CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING - endif ---- a/hostapd/Makefile -+++ b/hostapd/Makefile -@@ -997,6 +997,10 @@ ifdef CONFIG_NO_STDOUT_DEBUG - CFLAGS += -DCONFIG_NO_STDOUT_DEBUG - endif - -+ifdef CONFIG_DEBUG_SYSLOG -+CFLAGS += -DCONFIG_DEBUG_SYSLOG -+endif -+ - ifdef CONFIG_DEBUG_LINUX_TRACING - CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING - endif ---- a/hostapd/defconfig -+++ b/hostapd/defconfig -@@ -166,6 +166,9 @@ CONFIG_IPV6=y - # Disabled by default. - #CONFIG_DEBUG_FILE=y - -+# Send debug messages to syslog instead of stdout -+#CONFIG_DEBUG_SYSLOG=y -+ - # Add support for sending all debug messages (regardless of debug verbosity) - # to the Linux kernel tracing facility. This helps debug the entire stack by - # making it easy to record everything happening from the driver up into the ---- a/hostapd/main.c -+++ b/hostapd/main.c -@@ -108,6 +108,10 @@ static void hostapd_logger_cb(void *ctx, - module_str ? module_str : "", - module_str ? ": " : "", txt); - -+#ifdef CONFIG_DEBUG_SYSLOG -+ if (wpa_debug_syslog) -+ conf_stdout = 0; -+#endif /* CONFIG_DEBUG_SYSLOG */ - if ((conf_stdout & module) && level >= conf_stdout_level) { - wpa_debug_print_timestamp(); - wpa_printf(MSG_INFO, "%s", format); -@@ -484,6 +488,9 @@ static void usage(void) - " (records all messages regardless of debug verbosity)\n" - #endif /* CONFIG_DEBUG_LINUX_TRACING */ - " -i list of interface names to use\n" -+#ifdef CONFIG_DEBUG_SYSLOG -+ " -s log output to syslog instead of stdout\n" -+#endif /* CONFIG_DEBUG_SYSLOG */ - " -S start all the interfaces synchronously\n" - " -t include timestamps in some debug messages\n" - " -v show hostapd version\n"); -@@ -661,7 +668,7 @@ int main(int argc, char *argv[]) - dl_list_init(&interfaces.global_ctrl_dst); - - for (;;) { -- c = getopt(argc, argv, "b:Bde:f:hi:KP:STtu:vg:G:"); -+ c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:"); - if (c < 0) - break; - switch (c) { -@@ -718,6 +725,11 @@ int main(int argc, char *argv[]) - bss_config = tmp_bss; - bss_config[num_bss_configs++] = optarg; - break; -+#ifdef CONFIG_DEBUG_SYSLOG -+ case 's': -+ wpa_debug_syslog = 1; -+ break; -+#endif /* CONFIG_DEBUG_SYSLOG */ - case 'S': - start_ifaces_in_sync = 1; - break; -@@ -746,6 +758,10 @@ int main(int argc, char *argv[]) - wpa_debug_open_file(log_file); - else - wpa_debug_setup_stdout(); -+#ifdef CONFIG_DEBUG_SYSLOG -+ if (wpa_debug_syslog) -+ wpa_debug_open_syslog(); -+#endif /* CONFIG_DEBUG_SYSLOG */ - #ifdef CONFIG_DEBUG_LINUX_TRACING - if (enable_trace_dbg) { - int tret = wpa_debug_open_linux_tracing(); -@@ -882,6 +898,7 @@ int main(int argc, char *argv[]) - hostapd_global_deinit(pid_file, interfaces.eloop_initialized); - os_free(pid_file); - -+ wpa_debug_close_syslog(); - if (log_file) - wpa_debug_close_file(); - wpa_debug_close_linux_tracing(); ---- a/src/utils/wpa_debug.c -+++ b/src/utils/wpa_debug.c -@@ -13,7 +13,7 @@ - #ifdef CONFIG_DEBUG_SYSLOG - #include - --static int wpa_debug_syslog = 0; -+int wpa_debug_syslog = 0; - #endif /* CONFIG_DEBUG_SYSLOG */ - - #ifdef CONFIG_DEBUG_LINUX_TRACING ---- a/src/utils/wpa_debug.h -+++ b/src/utils/wpa_debug.h -@@ -14,6 +14,9 @@ - extern int wpa_debug_level; - extern int wpa_debug_show_keys; - extern int wpa_debug_timestamp; -+#ifdef CONFIG_DEBUG_SYSLOG -+extern int wpa_debug_syslog; -+#endif /* CONFIG_DEBUG_SYSLOG */ - - /* Debugging function - conditional printf and hex dump. Driver wrappers can - * use these for debugging purposes. */ diff --git a/package/network/services/hostapd/patches/010-TDLS-Reject-TPK-TK-reconfiguration.patch b/package/network/services/hostapd/patches/005-TDLS-Reject-TPK-TK-reconfiguration.patch similarity index 97% rename from package/network/services/hostapd/patches/010-TDLS-Reject-TPK-TK-reconfiguration.patch rename to package/network/services/hostapd/patches/005-TDLS-Reject-TPK-TK-reconfiguration.patch index d6e500b11..2ca05dd64 100644 --- a/package/network/services/hostapd/patches/010-TDLS-Reject-TPK-TK-reconfiguration.patch +++ b/package/network/services/hostapd/patches/005-TDLS-Reject-TPK-TK-reconfiguration.patch @@ -67,7 +67,7 @@ Signed-off-by: Jouni Malinen return 0; } -@@ -696,7 +714,7 @@ static void wpa_tdls_peer_clear(struct w +@@ -695,7 +713,7 @@ static void wpa_tdls_peer_clear(struct w peer->cipher = 0; peer->qos_info = 0; peer->wmm_capable = 0; @@ -76,7 +76,7 @@ Signed-off-by: Jouni Malinen peer->chan_switch_enabled = 0; os_memset(&peer->tpk, 0, sizeof(peer->tpk)); os_memset(peer->inonce, 0, WPA_NONCE_LEN); -@@ -1159,6 +1177,7 @@ skip_rsnie: +@@ -1158,6 +1176,7 @@ skip_rsnie: wpa_tdls_peer_free(sm, peer); return -1; } diff --git a/package/network/services/hostapd/patches/011-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch b/package/network/services/hostapd/patches/006-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch similarity index 100% rename from package/network/services/hostapd/patches/011-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch rename to package/network/services/hostapd/patches/006-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch diff --git a/package/network/services/hostapd/patches/012-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch b/package/network/services/hostapd/patches/007-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch similarity index 84% rename from package/network/services/hostapd/patches/012-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch rename to package/network/services/hostapd/patches/007-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch index 12904faf1..7712ce519 100644 --- a/package/network/services/hostapd/patches/012-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch +++ b/package/network/services/hostapd/patches/007-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch @@ -15,16 +15,16 @@ Signed-off-by: Jouni Malinen --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -2568,6 +2568,9 @@ void wpa_sm_notify_assoc(struct wpa_sm * - #ifdef CONFIG_TDLS - wpa_tdls_assoc(sm); - #endif /* CONFIG_TDLS */ +@@ -2637,6 +2637,9 @@ void wpa_sm_notify_disassoc(struct wpa_s + #ifdef CONFIG_FILS + sm->fils_completed = 0; + #endif /* CONFIG_FILS */ +#ifdef CONFIG_IEEE80211R + sm->ft_reassoc_completed = 0; +#endif /* CONFIG_IEEE80211R */ - #ifdef CONFIG_P2P - os_memset(sm->p2p_ip_addr, 0, sizeof(sm->p2p_ip_addr)); + /* Keys are not needed in the WPA state machine anymore */ + wpa_sm_drop_sa(sm); --- a/src/rsn_supp/wpa_ft.c +++ b/src/rsn_supp/wpa_ft.c @@ -153,6 +153,7 @@ static u8 * wpa_ft_gen_req_ies(struct wp @@ -35,7 +35,7 @@ Signed-off-by: Jouni Malinen buf_len = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) + 2 + sm->r0kh_id_len + ric_ies_len + 100; -@@ -681,6 +682,11 @@ int wpa_ft_validate_reassoc_resp(struct +@@ -687,6 +688,11 @@ int wpa_ft_validate_reassoc_resp(struct return -1; } @@ -47,7 +47,7 @@ Signed-off-by: Jouni Malinen if (wpa_ft_parse_ies(ies, ies_len, &parse) < 0) { wpa_printf(MSG_DEBUG, "FT: Failed to parse IEs"); return -1; -@@ -781,6 +787,8 @@ int wpa_ft_validate_reassoc_resp(struct +@@ -787,6 +793,8 @@ int wpa_ft_validate_reassoc_resp(struct return -1; } diff --git a/package/network/services/hostapd/patches/014-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch b/package/network/services/hostapd/patches/008-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch similarity index 100% rename from package/network/services/hostapd/patches/014-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch rename to package/network/services/hostapd/patches/008-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch diff --git a/package/network/services/hostapd/patches/015-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch b/package/network/services/hostapd/patches/009-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch similarity index 100% rename from package/network/services/hostapd/patches/015-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch rename to package/network/services/hostapd/patches/009-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch diff --git a/package/network/services/hostapd/patches/016-Optional-AP-side-workaround-for-key-reinstallation-a.patch b/package/network/services/hostapd/patches/010-Optional-AP-side-workaround-for-key-reinstallation-a.patch similarity index 90% rename from package/network/services/hostapd/patches/016-Optional-AP-side-workaround-for-key-reinstallation-a.patch rename to package/network/services/hostapd/patches/010-Optional-AP-side-workaround-for-key-reinstallation-a.patch index e413521cd..19165cce2 100644 --- a/package/network/services/hostapd/patches/016-Optional-AP-side-workaround-for-key-reinstallation-a.patch +++ b/package/network/services/hostapd/patches/010-Optional-AP-side-workaround-for-key-reinstallation-a.patch @@ -48,7 +48,7 @@ Signed-off-by: Jouni Malinen --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2515,6 +2515,8 @@ static int hostapd_config_fill(struct ho +@@ -2542,6 +2542,8 @@ static int hostapd_config_fill(struct ho return 1; } bss->wpa_pairwise_update_count = (u32) val; @@ -59,17 +59,17 @@ Signed-off-by: Jouni Malinen if (len < 8 || len > 63) { --- a/hostapd/defconfig +++ b/hostapd/defconfig -@@ -355,3 +355,7 @@ CONFIG_IPV6=y - # Include internal line edit mode in hostapd_cli. This can be used to provide - # limited command line editing and history support. - #CONFIG_WPA_CLI_EDIT=y +@@ -372,3 +372,7 @@ CONFIG_IPV6=y + # Opportunistic Wireless Encryption (OWE) + # Experimental implementation of draft-harkins-owe-07.txt + #CONFIG_OWE=y + +# Override default value for the wpa_disable_eapol_key_retries configuration +# parameter. See that parameter in hostapd.conf for more details. +#CFLAGS += -DDEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES=1 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf -@@ -1240,6 +1240,30 @@ own_ip_addr=127.0.0.1 +@@ -1315,6 +1315,30 @@ own_ip_addr=127.0.0.1 # Range 1..4294967295; default: 4 #wpa_pairwise_update_count=4 @@ -102,7 +102,7 @@ Signed-off-by: Jouni Malinen # authentication and key handshake before actually associating with a new AP. --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c -@@ -36,6 +36,10 @@ static void hostapd_config_free_vlan(str +@@ -37,6 +37,10 @@ static void hostapd_config_free_vlan(str } @@ -113,7 +113,7 @@ Signed-off-by: Jouni Malinen void hostapd_config_defaults_bss(struct hostapd_bss_config *bss) { dl_list_init(&bss->anqp_elem); -@@ -57,6 +61,8 @@ void hostapd_config_defaults_bss(struct +@@ -58,6 +62,8 @@ void hostapd_config_defaults_bss(struct bss->wpa_gmk_rekey = 86400; bss->wpa_group_update_count = 4; bss->wpa_pairwise_update_count = 4; @@ -124,7 +124,7 @@ Signed-off-by: Jouni Malinen bss->wpa_group = WPA_CIPHER_TKIP; --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -332,6 +332,7 @@ struct hostapd_bss_config { +@@ -333,6 +333,7 @@ struct hostapd_bss_config { int wpa_ptk_rekey; u32 wpa_group_update_count; u32 wpa_pairwise_update_count; @@ -134,7 +134,7 @@ Signed-off-by: Jouni Malinen char *rsn_preauth_interfaces; --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -63,6 +63,7 @@ static u8 * ieee80211w_kde_add(struct wp +@@ -65,6 +65,7 @@ static u8 * ieee80211w_kde_add(struct wp static const u32 eapol_key_timeout_first = 100; /* ms */ static const u32 eapol_key_timeout_subseq = 1000; /* ms */ static const u32 eapol_key_timeout_first_group = 500; /* ms */ @@ -142,7 +142,7 @@ Signed-off-by: Jouni Malinen /* TODO: make these configurable */ static const int dot11RSNAConfigPMKLifetime = 43200; -@@ -1629,6 +1630,9 @@ static void wpa_send_eapol(struct wpa_au +@@ -1653,6 +1654,9 @@ static void wpa_send_eapol(struct wpa_au eapol_key_timeout_first_group; else timeout_ms = eapol_key_timeout_subseq; @@ -152,7 +152,7 @@ Signed-off-by: Jouni Malinen if (pairwise && ctr == 1 && !(key_info & WPA_KEY_INFO_MIC)) sm->pending_1_of_4_timeout = 1; wpa_printf(MSG_DEBUG, "WPA: Use EAPOL-Key timeout of %u ms (retry " -@@ -2700,6 +2704,11 @@ SM_STATE(WPA_PTK, PTKINITNEGOTIATING) +@@ -2882,6 +2886,11 @@ SM_STATE(WPA_PTK, PTKINITNEGOTIATING) sm->TimeoutEvt = FALSE; sm->TimeoutCtr++; @@ -164,7 +164,7 @@ Signed-off-by: Jouni Malinen if (sm->TimeoutCtr > sm->wpa_auth->conf.wpa_pairwise_update_count) { /* No point in sending the EAPOL-Key - we will disconnect * immediately following this. */ -@@ -3027,7 +3036,9 @@ SM_STEP(WPA_PTK) +@@ -3220,7 +3229,9 @@ SM_STEP(WPA_PTK) sm->EAPOLKeyPairwise && sm->MICVerified) SM_ENTER(WPA_PTK, PTKINITDONE); else if (sm->TimeoutCtr > @@ -175,7 +175,7 @@ Signed-off-by: Jouni Malinen wpa_auth->dot11RSNA4WayHandshakeFailures++; wpa_auth_vlogger( sm->wpa_auth, sm->addr, LOGGER_DEBUG, -@@ -3067,6 +3078,11 @@ SM_STATE(WPA_PTK_GROUP, REKEYNEGOTIATING +@@ -3260,6 +3271,11 @@ SM_STATE(WPA_PTK_GROUP, REKEYNEGOTIATING SM_ENTRY_MA(WPA_PTK_GROUP, REKEYNEGOTIATING, wpa_ptk_group); sm->GTimeoutCtr++; @@ -187,7 +187,7 @@ Signed-off-by: Jouni Malinen if (sm->GTimeoutCtr > sm->wpa_auth->conf.wpa_group_update_count) { /* No point in sending the EAPOL-Key - we will disconnect * immediately following this. */ -@@ -3165,7 +3181,9 @@ SM_STEP(WPA_PTK_GROUP) +@@ -3363,7 +3379,9 @@ SM_STEP(WPA_PTK_GROUP) !sm->EAPOLKeyPairwise && sm->MICVerified) SM_ENTER(WPA_PTK_GROUP, REKEYESTABLISHED); else if (sm->GTimeoutCtr > @@ -200,7 +200,7 @@ Signed-off-by: Jouni Malinen SM_ENTER(WPA_PTK_GROUP, REKEYNEGOTIATING); --- a/src/ap/wpa_auth.h +++ b/src/ap/wpa_auth.h -@@ -146,6 +146,7 @@ struct wpa_auth_config { +@@ -165,6 +165,7 @@ struct wpa_auth_config { int wpa_ptk_rekey; u32 wpa_group_update_count; u32 wpa_pairwise_update_count; @@ -210,7 +210,7 @@ Signed-off-by: Jouni Malinen int eapol_version; --- a/src/ap/wpa_auth_glue.c +++ b/src/ap/wpa_auth_glue.c -@@ -42,6 +42,8 @@ static void hostapd_wpa_auth_conf(struct +@@ -45,6 +45,8 @@ static void hostapd_wpa_auth_conf(struct wconf->wpa_gmk_rekey = conf->wpa_gmk_rekey; wconf->wpa_ptk_rekey = conf->wpa_ptk_rekey; wconf->wpa_group_update_count = conf->wpa_group_update_count; diff --git a/package/network/services/hostapd/patches/017-Additional-consistentcy-checks-for-PTK-component-len.patch b/package/network/services/hostapd/patches/011-Additional-consistentcy-checks-for-PTK-component-len.patch similarity index 81% rename from package/network/services/hostapd/patches/017-Additional-consistentcy-checks-for-PTK-component-len.patch rename to package/network/services/hostapd/patches/011-Additional-consistentcy-checks-for-PTK-component-len.patch index 9655b5cb1..5cc2f7b17 100644 --- a/package/network/services/hostapd/patches/017-Additional-consistentcy-checks-for-PTK-component-len.patch +++ b/package/network/services/hostapd/patches/011-Additional-consistentcy-checks-for-PTK-component-len.patch @@ -15,9 +15,9 @@ Signed-off-by: Jouni Malinen --- a/src/common/wpa_common.c +++ b/src/common/wpa_common.c -@@ -93,6 +93,12 @@ int wpa_eapol_key_mic(const u8 *key, siz +@@ -100,6 +100,12 @@ int wpa_eapol_key_mic(const u8 *key, siz { - u8 hash[SHA384_MAC_LEN]; + u8 hash[SHA512_MAC_LEN]; + if (key_len == 0) { + wpa_printf(MSG_DEBUG, @@ -30,7 +30,7 @@ Signed-off-by: Jouni Malinen case WPA_KEY_INFO_TYPE_HMAC_MD5_RC4: --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -710,6 +710,11 @@ static int wpa_supplicant_install_ptk(st +@@ -725,6 +725,11 @@ static int wpa_supplicant_install_ptk(st alg = wpa_cipher_to_alg(sm->pairwise_cipher); keylen = wpa_cipher_key_len(sm->pairwise_cipher); @@ -42,7 +42,7 @@ Signed-off-by: Jouni Malinen rsclen = wpa_cipher_rsc_len(sm->pairwise_cipher); if (sm->proto == WPA_PROTO_RSN || sm->proto == WPA_PROTO_OSEN) { -@@ -730,6 +735,7 @@ static int wpa_supplicant_install_ptk(st +@@ -745,6 +750,7 @@ static int wpa_supplicant_install_ptk(st /* TK is not needed anymore in supplicant */ os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN); @@ -50,7 +50,7 @@ Signed-off-by: Jouni Malinen sm->ptk.installed = 1; if (sm->wpa_ptk_rekey) { -@@ -1699,9 +1705,10 @@ static int wpa_supplicant_verify_eapol_k +@@ -1717,9 +1723,10 @@ static int wpa_supplicant_verify_eapol_k os_memcpy(mic, key + 1, mic_len); if (sm->tptk_set) { os_memset(key + 1, 0, mic_len); @@ -64,7 +64,7 @@ Signed-off-by: Jouni Malinen wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, "WPA: Invalid EAPOL-Key MIC " "when using TPTK - ignoring TPTK"); -@@ -1724,9 +1731,10 @@ static int wpa_supplicant_verify_eapol_k +@@ -1742,9 +1749,10 @@ static int wpa_supplicant_verify_eapol_k if (!ok && sm->ptk_set) { os_memset(key + 1, 0, mic_len); @@ -78,7 +78,7 @@ Signed-off-by: Jouni Malinen wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, "WPA: Invalid EAPOL-Key MIC - " "dropping packet"); -@@ -3689,6 +3697,11 @@ int fils_process_assoc_resp(struct wpa_s +@@ -4167,6 +4175,11 @@ int fils_process_assoc_resp(struct wpa_s alg = wpa_cipher_to_alg(sm->pairwise_cipher); keylen = wpa_cipher_key_len(sm->pairwise_cipher); @@ -90,3 +90,11 @@ Signed-off-by: Jouni Malinen rsclen = wpa_cipher_rsc_len(sm->pairwise_cipher); wpa_hexdump_key(MSG_DEBUG, "FILS: Set TK to driver", sm->ptk.tk, keylen); +@@ -4183,6 +4196,7 @@ int fils_process_assoc_resp(struct wpa_s + * takes care of association frame encryption/decryption. */ + /* TK is not needed anymore in supplicant */ + os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN); ++ sm->ptk.tk_len = 0; + sm->ptk.installed = 1; + + /* FILS HLP Container */ diff --git a/package/network/services/hostapd/patches/018-Clear-BSSID-information-in-supplicant-state-machine-.patch b/package/network/services/hostapd/patches/012-Clear-BSSID-information-in-supplicant-state-machine-.patch similarity index 100% rename from package/network/services/hostapd/patches/018-Clear-BSSID-information-in-supplicant-state-machine-.patch rename to package/network/services/hostapd/patches/012-Clear-BSSID-information-in-supplicant-state-machine-.patch diff --git a/package/network/services/hostapd/patches/013-Add-hostapd-options-wpa_group_update_count-and-wpa_p.patch b/package/network/services/hostapd/patches/013-Add-hostapd-options-wpa_group_update_count-and-wpa_p.patch deleted file mode 100644 index 623c2be34..000000000 --- a/package/network/services/hostapd/patches/013-Add-hostapd-options-wpa_group_update_count-and-wpa_p.patch +++ /dev/null @@ -1,305 +0,0 @@ -From 41f140d38617e1fd3fa88c1667c1bce0cad79224 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?G=C3=BCnther=20Kelleter?= -Date: Thu, 5 Jan 2017 17:00:33 +0100 -Subject: [PATCH] Add hostapd options wpa_group_update_count and - wpa_pairwise_update_count -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -wpa_group_update_count and wpa_pairwise_update_count can now be used to -set the GTK and PTK rekey retry limits (dot11RSNAConfigGroupUpdateCount -and dot11RSNAConfigPairwiseUpdateCount). Defaults set to current -hardcoded value (4). - -Some stations may suffer from frequent deauthentications due to GTK -rekey failures: EAPOL 1/2 frame is not answered during the total timeout -period of currently ~3.5 seconds. For example, a Galaxy S6 with Android -6.0.1 appears to go into power save mode for up to 5 seconds. Increasing -wpa_group_update_count to 6 fixed this issue. - -Signed-off-by: Günther Kelleter ---- - hostapd/config_file.c | 22 ++++++++++++++++++++++ - hostapd/hostapd.conf | 11 +++++++++++ - src/ap/ap_config.c | 2 ++ - src/ap/ap_config.h | 2 ++ - src/ap/wpa_auth.c | 37 ++++++++++++++++++------------------- - src/ap/wpa_auth.h | 2 ++ - src/ap/wpa_auth_glue.c | 2 ++ - src/ap/wpa_auth_i.h | 4 ++-- - wpa_supplicant/ibss_rsn.c | 2 ++ - wpa_supplicant/mesh_rsn.c | 2 ++ - 10 files changed, 65 insertions(+), 21 deletions(-) - -diff --git a/hostapd/config_file.c b/hostapd/config_file.c -index 8cfa198c3..02693a5b1 100644 ---- a/hostapd/config_file.c -+++ b/hostapd/config_file.c -@@ -2489,6 +2489,28 @@ static int hostapd_config_fill(struct hostapd_config *conf, - bss->wpa_gmk_rekey = atoi(pos); - } else if (os_strcmp(buf, "wpa_ptk_rekey") == 0) { - bss->wpa_ptk_rekey = atoi(pos); -+ } else if (os_strcmp(buf, "wpa_group_update_count") == 0) { -+ char *endp; -+ unsigned long val = strtoul(pos, &endp, 0); -+ -+ if (*endp || val < 1 || val > (u32) -1) { -+ wpa_printf(MSG_ERROR, -+ "Line %d: Invalid wpa_group_update_count=%lu; allowed range 1..4294967295", -+ line, val); -+ return 1; -+ } -+ bss->wpa_group_update_count = (u32) val; -+ } else if (os_strcmp(buf, "wpa_pairwise_update_count") == 0) { -+ char *endp; -+ unsigned long val = strtoul(pos, &endp, 0); -+ -+ if (*endp || val < 1 || val > (u32) -1) { -+ wpa_printf(MSG_ERROR, -+ "Line %d: Invalid wpa_pairwise_update_count=%lu; allowed range 1..4294967295", -+ line, val); -+ return 1; -+ } -+ bss->wpa_pairwise_update_count = (u32) val; - } else if (os_strcmp(buf, "wpa_passphrase") == 0) { - int len = os_strlen(pos); - if (len < 8 || len > 63) { -diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf -index 314f3842b..1fb1bd987 100644 ---- a/hostapd/hostapd.conf -+++ b/hostapd/hostapd.conf -@@ -1221,6 +1221,11 @@ own_ip_addr=127.0.0.1 - # (dot11RSNAConfigGroupRekeyStrict) - #wpa_strict_rekey=1 - -+# The number of times EAPOL-Key Message 1/2 in the RSN Group Key Handshake is -+#retried per GTK Handshake attempt. (dot11RSNAConfigGroupUpdateCount) -+# Range 1..4294967295; default: 4 -+#wpa_group_update_count=4 -+ - # Time interval for rekeying GMK (master key used internally to generate GTKs - # (in seconds). - #wpa_gmk_rekey=86400 -@@ -1229,6 +1234,12 @@ own_ip_addr=127.0.0.1 - # PTK to mitigate some attacks against TKIP deficiencies. - #wpa_ptk_rekey=600 - -+# The number of times EAPOL-Key Message 1/4 and Message 3/4 in the RSN 4-Way -+# Handshake are retried per 4-Way Handshake attempt. -+# (dot11RSNAConfigPairwiseUpdateCount) -+# Range 1..4294967295; default: 4 -+#wpa_pairwise_update_count=4 -+ - # Enable IEEE 802.11i/RSN/WPA2 pre-authentication. This is used to speed up - # roaming be pre-authenticating IEEE 802.1X/EAP part of the full RSN - # authentication and key handshake before actually associating with a new AP. -diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c -index c2b80ad97..9abcab7fb 100644 ---- a/src/ap/ap_config.c -+++ b/src/ap/ap_config.c -@@ -56,6 +56,8 @@ void hostapd_config_defaults_bss(struct hostapd_bss_config *bss) - - bss->wpa_group_rekey = 600; - bss->wpa_gmk_rekey = 86400; -+ bss->wpa_group_update_count = 4; -+ bss->wpa_pairwise_update_count = 4; - bss->wpa_key_mgmt = WPA_KEY_MGMT_PSK; - bss->wpa_pairwise = WPA_CIPHER_TKIP; - bss->wpa_group = WPA_CIPHER_TKIP; -diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h -index 31b1e7762..7495dc96f 100644 ---- a/src/ap/ap_config.h -+++ b/src/ap/ap_config.h -@@ -330,6 +330,8 @@ struct hostapd_bss_config { - int wpa_strict_rekey; - int wpa_gmk_rekey; - int wpa_ptk_rekey; -+ u32 wpa_group_update_count; -+ u32 wpa_pairwise_update_count; - int rsn_pairwise; - int rsn_preauth; - char *rsn_preauth_interfaces; -diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c -index 0bd901fbf..8c082f426 100644 ---- a/src/ap/wpa_auth.c -+++ b/src/ap/wpa_auth.c -@@ -60,8 +60,6 @@ static void wpa_group_put(struct wpa_authenticator *wpa_auth, - struct wpa_group *group); - static u8 * ieee80211w_kde_add(struct wpa_state_machine *sm, u8 *pos); - --static const u32 dot11RSNAConfigGroupUpdateCount = 4; --static const u32 dot11RSNAConfigPairwiseUpdateCount = 4; - static const u32 eapol_key_timeout_first = 100; /* ms */ - static const u32 eapol_key_timeout_subseq = 1000; /* ms */ - static const u32 eapol_key_timeout_first_group = 500; /* ms */ -@@ -1623,7 +1621,7 @@ static void wpa_send_eapol(struct wpa_authenticator *wpa_auth, - { - int timeout_ms; - int pairwise = key_info & WPA_KEY_INFO_KEY_TYPE; -- int ctr; -+ u32 ctr; - - if (sm == NULL) - return; -@@ -1640,7 +1638,7 @@ static void wpa_send_eapol(struct wpa_authenticator *wpa_auth, - if (pairwise && ctr == 1 && !(key_info & WPA_KEY_INFO_MIC)) - sm->pending_1_of_4_timeout = 1; - wpa_printf(MSG_DEBUG, "WPA: Use EAPOL-Key timeout of %u ms (retry " -- "counter %d)", timeout_ms, ctr); -+ "counter %u)", timeout_ms, ctr); - eloop_register_timeout(timeout_ms / 1000, (timeout_ms % 1000) * 1000, - wpa_send_eapol_timeout, wpa_auth, sm); - } -@@ -2002,7 +2000,7 @@ SM_STATE(WPA_PTK, PTKSTART) - sm->alt_snonce_valid = FALSE; - - sm->TimeoutCtr++; -- if (sm->TimeoutCtr > (int) dot11RSNAConfigPairwiseUpdateCount) { -+ if (sm->TimeoutCtr > sm->wpa_auth->conf.wpa_pairwise_update_count) { - /* No point in sending the EAPOL-Key - we will disconnect - * immediately following this. */ - return; -@@ -2693,7 +2691,7 @@ SM_STATE(WPA_PTK, PTKINITNEGOTIATING) - sm->TimeoutEvt = FALSE; - - sm->TimeoutCtr++; -- if (sm->TimeoutCtr > (int) dot11RSNAConfigPairwiseUpdateCount) { -+ if (sm->TimeoutCtr > sm->wpa_auth->conf.wpa_pairwise_update_count) { - /* No point in sending the EAPOL-Key - we will disconnect - * immediately following this. */ - return; -@@ -2988,11 +2986,12 @@ SM_STEP(WPA_PTK) - sm->EAPOLKeyPairwise) - SM_ENTER(WPA_PTK, PTKCALCNEGOTIATING); - else if (sm->TimeoutCtr > -- (int) dot11RSNAConfigPairwiseUpdateCount) { -+ sm->wpa_auth->conf.wpa_pairwise_update_count) { - wpa_auth->dot11RSNA4WayHandshakeFailures++; -- wpa_auth_vlogger(sm->wpa_auth, sm->addr, LOGGER_DEBUG, -- "PTKSTART: Retry limit %d reached", -- dot11RSNAConfigPairwiseUpdateCount); -+ wpa_auth_vlogger( -+ sm->wpa_auth, sm->addr, LOGGER_DEBUG, -+ "PTKSTART: Retry limit %u reached", -+ sm->wpa_auth->conf.wpa_pairwise_update_count); - SM_ENTER(WPA_PTK, DISCONNECT); - } else if (sm->TimeoutEvt) - SM_ENTER(WPA_PTK, PTKSTART); -@@ -3016,12 +3015,12 @@ SM_STEP(WPA_PTK) - sm->EAPOLKeyPairwise && sm->MICVerified) - SM_ENTER(WPA_PTK, PTKINITDONE); - else if (sm->TimeoutCtr > -- (int) dot11RSNAConfigPairwiseUpdateCount) { -+ sm->wpa_auth->conf.wpa_pairwise_update_count) { - wpa_auth->dot11RSNA4WayHandshakeFailures++; -- wpa_auth_vlogger(sm->wpa_auth, sm->addr, LOGGER_DEBUG, -- "PTKINITNEGOTIATING: Retry limit %d " -- "reached", -- dot11RSNAConfigPairwiseUpdateCount); -+ wpa_auth_vlogger( -+ sm->wpa_auth, sm->addr, LOGGER_DEBUG, -+ "PTKINITNEGOTIATING: Retry limit %u reached", -+ sm->wpa_auth->conf.wpa_pairwise_update_count); - SM_ENTER(WPA_PTK, DISCONNECT); - } else if (sm->TimeoutEvt) - SM_ENTER(WPA_PTK, PTKINITNEGOTIATING); -@@ -3056,7 +3055,7 @@ SM_STATE(WPA_PTK_GROUP, REKEYNEGOTIATING) - SM_ENTRY_MA(WPA_PTK_GROUP, REKEYNEGOTIATING, wpa_ptk_group); - - sm->GTimeoutCtr++; -- if (sm->GTimeoutCtr > (int) dot11RSNAConfigGroupUpdateCount) { -+ if (sm->GTimeoutCtr > sm->wpa_auth->conf.wpa_group_update_count) { - /* No point in sending the EAPOL-Key - we will disconnect - * immediately following this. */ - return; -@@ -3154,7 +3153,7 @@ SM_STEP(WPA_PTK_GROUP) - !sm->EAPOLKeyPairwise && sm->MICVerified) - SM_ENTER(WPA_PTK_GROUP, REKEYESTABLISHED); - else if (sm->GTimeoutCtr > -- (int) dot11RSNAConfigGroupUpdateCount) -+ sm->wpa_auth->conf.wpa_group_update_count) - SM_ENTER(WPA_PTK_GROUP, KEYERROR); - else if (sm->TimeoutEvt) - SM_ENTER(WPA_PTK_GROUP, REKEYNEGOTIATING); -@@ -3614,8 +3613,8 @@ int wpa_get_mib(struct wpa_authenticator *wpa_auth, char *buf, size_t buflen) - "dot11RSNAConfigNumberOfGTKSAReplayCounters=0\n", - RSN_VERSION, - !!wpa_auth->conf.wpa_strict_rekey, -- dot11RSNAConfigGroupUpdateCount, -- dot11RSNAConfigPairwiseUpdateCount, -+ wpa_auth->conf.wpa_group_update_count, -+ wpa_auth->conf.wpa_pairwise_update_count, - wpa_cipher_key_len(wpa_auth->conf.wpa_group) * 8, - dot11RSNAConfigPMKLifetime, - dot11RSNAConfigPMKReauthThreshold, -diff --git a/src/ap/wpa_auth.h b/src/ap/wpa_auth.h -index 9cbe3889b..0920a169d 100644 ---- a/src/ap/wpa_auth.h -+++ b/src/ap/wpa_auth.h -@@ -144,6 +144,8 @@ struct wpa_auth_config { - int wpa_strict_rekey; - int wpa_gmk_rekey; - int wpa_ptk_rekey; -+ u32 wpa_group_update_count; -+ u32 wpa_pairwise_update_count; - int rsn_pairwise; - int rsn_preauth; - int eapol_version; -diff --git a/src/ap/wpa_auth_glue.c b/src/ap/wpa_auth_glue.c -index 22518a1f1..394f77a66 100644 ---- a/src/ap/wpa_auth_glue.c -+++ b/src/ap/wpa_auth_glue.c -@@ -41,6 +41,8 @@ static void hostapd_wpa_auth_conf(struct hostapd_bss_config *conf, - wconf->wpa_strict_rekey = conf->wpa_strict_rekey; - wconf->wpa_gmk_rekey = conf->wpa_gmk_rekey; - wconf->wpa_ptk_rekey = conf->wpa_ptk_rekey; -+ wconf->wpa_group_update_count = conf->wpa_group_update_count; -+ wconf->wpa_pairwise_update_count = conf->wpa_pairwise_update_count; - wconf->rsn_pairwise = conf->rsn_pairwise; - wconf->rsn_preauth = conf->rsn_preauth; - wconf->eapol_version = conf->eapol_version; -diff --git a/src/ap/wpa_auth_i.h b/src/ap/wpa_auth_i.h -index 065a624ad..cda2c5065 100644 ---- a/src/ap/wpa_auth_i.h -+++ b/src/ap/wpa_auth_i.h -@@ -48,8 +48,8 @@ struct wpa_state_machine { - Boolean AuthenticationRequest; - Boolean ReAuthenticationRequest; - Boolean Disconnect; -- int TimeoutCtr; -- int GTimeoutCtr; -+ u32 TimeoutCtr; -+ u32 GTimeoutCtr; - Boolean TimeoutEvt; - Boolean EAPOLKeyReceived; - Boolean EAPOLKeyPairwise; -diff --git a/wpa_supplicant/ibss_rsn.c b/wpa_supplicant/ibss_rsn.c -index 521a692ba..954061ae4 100644 ---- a/wpa_supplicant/ibss_rsn.c -+++ b/wpa_supplicant/ibss_rsn.c -@@ -428,6 +428,8 @@ static int ibss_rsn_auth_init_group(struct ibss_rsn *ibss_rsn, - conf.wpa_group = WPA_CIPHER_CCMP; - conf.eapol_version = 2; - conf.wpa_group_rekey = ssid->group_rekey ? ssid->group_rekey : 600; -+ conf.wpa_group_update_count = 4; -+ conf.wpa_pairwise_update_count = 4; - - ibss_rsn->auth_group = wpa_init(own_addr, &conf, &cb, ibss_rsn); - if (ibss_rsn->auth_group == NULL) { -diff --git a/wpa_supplicant/mesh_rsn.c b/wpa_supplicant/mesh_rsn.c -index 33040f30b..628382cbf 100644 ---- a/wpa_supplicant/mesh_rsn.c -+++ b/wpa_supplicant/mesh_rsn.c -@@ -158,6 +158,8 @@ static int __mesh_rsn_auth_init(struct mesh_rsn *rsn, const u8 *addr, - conf.wpa_group = rsn->group_cipher; - conf.eapol_version = 0; - conf.wpa_group_rekey = -1; -+ conf.wpa_group_update_count = 4; -+ conf.wpa_pairwise_update_count = 4; - #ifdef CONFIG_IEEE80211W - conf.ieee80211w = ieee80211w; - if (ieee80211w != NO_MGMT_FRAME_PROTECTION) --- -2.13.6 - diff --git a/package/network/services/hostapd/patches/019-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch b/package/network/services/hostapd/patches/013-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch similarity index 100% rename from package/network/services/hostapd/patches/019-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch rename to package/network/services/hostapd/patches/013-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch diff --git a/package/network/services/hostapd/patches/100-daemonize_fix.patch b/package/network/services/hostapd/patches/100-daemonize_fix.patch index fad84669a..43057ef9f 100644 --- a/package/network/services/hostapd/patches/100-daemonize_fix.patch +++ b/package/network/services/hostapd/patches/100-daemonize_fix.patch @@ -8,7 +8,7 @@ #ifdef ANDROID #include -@@ -179,59 +180,46 @@ int os_gmtime(os_time_t t, struct os_tm +@@ -182,59 +183,46 @@ int os_gmtime(os_time_t t, struct os_tm return 0; } diff --git a/package/network/services/hostapd/patches/110-no_eapol_fix.patch b/package/network/services/hostapd/patches/110-no_eapol_fix.patch index 5181721e3..3a48a7a95 100644 --- a/package/network/services/hostapd/patches/110-no_eapol_fix.patch +++ b/package/network/services/hostapd/patches/110-no_eapol_fix.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -259,9 +259,10 @@ void wpa_supplicant_cancel_auth_timeout( +@@ -265,9 +265,10 @@ void wpa_supplicant_cancel_auth_timeout( */ void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s) { diff --git a/package/network/services/hostapd/patches/120-disable_bridge_packet_workaround.patch b/package/network/services/hostapd/patches/120-disable_bridge_packet_workaround.patch index fdd5da9bf..4a5b63716 100644 --- a/package/network/services/hostapd/patches/120-disable_bridge_packet_workaround.patch +++ b/package/network/services/hostapd/patches/120-disable_bridge_packet_workaround.patch @@ -1,6 +1,6 @@ --- a/src/l2_packet/l2_packet_linux.c +++ b/src/l2_packet/l2_packet_linux.c -@@ -337,8 +337,7 @@ struct l2_packet_data * l2_packet_init_b +@@ -340,8 +340,7 @@ struct l2_packet_data * l2_packet_init_b l2 = l2_packet_init(br_ifname, own_addr, protocol, rx_callback, rx_callback_ctx, l2_hdr); diff --git a/package/network/services/hostapd/patches/200-multicall.patch b/package/network/services/hostapd/patches/200-multicall.patch index f0348201f..0d289d53a 100644 --- a/package/network/services/hostapd/patches/200-multicall.patch +++ b/package/network/services/hostapd/patches/200-multicall.patch @@ -18,7 +18,7 @@ OBJS += ../src/ap/vlan_init.o OBJS += ../src/ap/vlan_ifconfig.o OBJS += ../src/ap/vlan.o -@@ -330,10 +332,14 @@ CFLAGS += -DCONFIG_MBO +@@ -354,10 +356,14 @@ CFLAGS += -DCONFIG_MBO OBJS += ../src/ap/mbo_ap.o endif @@ -36,7 +36,7 @@ LIBS += $(DRV_AP_LIBS) ifdef CONFIG_L2_PACKET -@@ -1077,6 +1083,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) +@@ -1204,6 +1210,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) BCHECK=../src/drivers/build.hostapd @@ -49,8 +49,8 @@ hostapd: $(BCHECK) $(OBJS) $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) @$(E) " LD " $@ -@@ -1118,6 +1130,12 @@ HOBJS += ../src/crypto/aes-internal.o - HOBJS += ../src/crypto/aes-internal-enc.o +@@ -1248,6 +1260,12 @@ ifeq ($(CONFIG_TLS), linux) + HOBJS += ../src/crypto/crypto_linux.o endif +dump_cflags: @@ -72,7 +72,7 @@ ifndef CONFIG_NO_GITVER # Add VERSION_STR postfix for builds from a git repository -@@ -329,7 +330,9 @@ endif +@@ -357,7 +358,9 @@ endif ifdef CONFIG_IBSS_RSN NEED_RSN_AUTHENTICATOR=y CFLAGS += -DCONFIG_IBSS_RSN @@ -82,7 +82,7 @@ OBJS += ibss_rsn.o endif -@@ -820,6 +823,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS +@@ -861,6 +864,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS LIBS += -ldl -rdynamic endif @@ -92,8 +92,8 @@ + endif endif - ifdef CONFIG_MACSEC -@@ -840,9 +847,11 @@ NEED_EAP_COMMON=y + ifdef CONFIG_AP +@@ -868,9 +875,11 @@ NEED_EAP_COMMON=y NEED_RSN_AUTHENTICATOR=y CFLAGS += -DCONFIG_AP OBJS += ap.o @@ -105,7 +105,7 @@ OBJS += ../src/ap/hostapd.o OBJS += ../src/ap/wpa_auth_glue.o OBJS += ../src/ap/utils.o -@@ -910,6 +919,12 @@ endif +@@ -952,6 +961,12 @@ endif ifdef CONFIG_HS20 OBJS += ../src/ap/hs20.o endif @@ -118,7 +118,7 @@ endif ifdef CONFIG_MBO -@@ -918,7 +933,9 @@ CFLAGS += -DCONFIG_MBO +@@ -960,7 +975,9 @@ CFLAGS += -DCONFIG_MBO endif ifdef NEED_RSN_AUTHENTICATOR @@ -128,7 +128,7 @@ NEED_AES_WRAP=y OBJS += ../src/ap/wpa_auth.o OBJS += ../src/ap/wpa_auth_ie.o -@@ -1706,6 +1723,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) +@@ -1835,6 +1852,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config @@ -141,7 +141,7 @@ wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) @$(E) " LD " $@ -@@ -1808,6 +1831,12 @@ endif +@@ -1937,6 +1960,12 @@ endif -e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@ @$(E) " sed" $< @@ -156,7 +156,7 @@ wpa_cli.exe: wpa_cli --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -4968,8 +4968,8 @@ union wpa_event_data { +@@ -5317,8 +5317,8 @@ union wpa_event_data { * Driver wrapper code should call this function whenever an event is received * from the driver. */ @@ -167,7 +167,7 @@ /** * wpa_supplicant_event_global - Report a driver event for wpa_supplicant -@@ -4981,7 +4981,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -5330,7 +5330,7 @@ void wpa_supplicant_event(void *ctx, enu * Same as wpa_supplicant_event(), but we search for the interface in * wpa_global. */ @@ -178,7 +178,7 @@ /* --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -1163,8 +1163,8 @@ static void hostapd_event_dfs_cac_starte +@@ -1375,8 +1375,8 @@ static void hostapd_event_dfs_cac_starte #endif /* NEED_AP_MLME */ @@ -189,7 +189,7 @@ { struct hostapd_data *hapd = ctx; #ifndef CONFIG_NO_STDOUT_DEBUG -@@ -1373,7 +1373,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -1590,7 +1590,7 @@ void wpa_supplicant_event(void *ctx, enu } @@ -231,7 +231,7 @@ os_memset(&global, 0, sizeof(global)); --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -3610,8 +3610,8 @@ static void wpa_supplicant_event_assoc_a +@@ -3709,8 +3709,8 @@ static void wpa_supplicant_event_assoc_a } @@ -242,16 +242,7 @@ { struct wpa_supplicant *wpa_s = ctx; int resched; -@@ -4315,7 +4315,7 @@ void wpa_supplicant_event(void *ctx, enu - #endif /* CONFIG_AP */ - break; - case EVENT_ACS_CHANNEL_SELECTED: --#ifdef CONFIG_ACS -+#if defined(CONFIG_ACS) && defined(CONFIG_AP) - if (!wpa_s->ap_iface) - break; - hostapd_acs_channel_selected(wpa_s->ap_iface->bss[0], -@@ -4337,7 +4337,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -4466,7 +4466,7 @@ void wpa_supplicant_event(void *ctx, enu } @@ -262,7 +253,7 @@ struct wpa_supplicant *wpa_s; --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -5136,7 +5136,6 @@ struct wpa_interface * wpa_supplicant_ma +@@ -5457,7 +5457,6 @@ struct wpa_interface * wpa_supplicant_ma return NULL; } @@ -270,7 +261,7 @@ /** * wpa_supplicant_match_existing - Match existing interfaces * @global: Pointer to global data from wpa_supplicant_init() -@@ -5173,6 +5172,11 @@ static int wpa_supplicant_match_existing +@@ -5494,6 +5493,11 @@ static int wpa_supplicant_match_existing #endif /* CONFIG_MATCH_IFACE */ @@ -282,7 +273,7 @@ /** * wpa_supplicant_add_iface - Add a new network interface -@@ -5428,6 +5432,8 @@ struct wpa_global * wpa_supplicant_init( +@@ -5750,6 +5754,8 @@ struct wpa_global * wpa_supplicant_init( #ifndef CONFIG_NO_WPA_MSG wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); #endif /* CONFIG_NO_WPA_MSG */ @@ -305,9 +296,9 @@ #ifdef CONFIG_WPS static int gen_uuid(const char *txt_addr) -@@ -667,6 +672,8 @@ int main(int argc, char *argv[]) - interfaces.global_ctrl_sock = -1; - dl_list_init(&interfaces.global_ctrl_dst); +@@ -670,6 +675,8 @@ int main(int argc, char *argv[]) + dl_list_init(&interfaces.eth_p_oui); + #endif /* CONFIG_ETH_P_OUI */ + wpa_supplicant_event = hostapd_wpa_event; + wpa_supplicant_event_global = hostapd_wpa_event_global; diff --git a/package/network/services/hostapd/patches/300-noscan.patch b/package/network/services/hostapd/patches/300-noscan.patch index 9dc0f2c39..c8ca3694c 100644 --- a/package/network/services/hostapd/patches/300-noscan.patch +++ b/package/network/services/hostapd/patches/300-noscan.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2953,6 +2953,10 @@ static int hostapd_config_fill(struct ho +@@ -3016,6 +3016,10 @@ static int hostapd_config_fill(struct ho } #endif /* CONFIG_IEEE80211W */ #ifdef CONFIG_IEEE80211N @@ -13,7 +13,7 @@ } else if (os_strcmp(buf, "ht_capab") == 0) { --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -681,6 +681,8 @@ struct hostapd_config { +@@ -735,6 +735,8 @@ struct hostapd_config { int ht_op_mode_fixed; u16 ht_capab; @@ -24,7 +24,7 @@ int no_pri_sec_switch; --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c -@@ -474,7 +474,8 @@ static int ieee80211n_check_40mhz(struct +@@ -480,7 +480,8 @@ static int ieee80211n_check_40mhz(struct int ret; /* Check that HT40 is used and PRI / SEC switch is allowed */ diff --git a/package/network/services/hostapd/patches/310-rescan_immediately.patch b/package/network/services/hostapd/patches/310-rescan_immediately.patch index ccc9781fa..6846db275 100644 --- a/package/network/services/hostapd/patches/310-rescan_immediately.patch +++ b/package/network/services/hostapd/patches/310-rescan_immediately.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -3696,7 +3696,7 @@ wpa_supplicant_alloc(struct wpa_supplica +@@ -3927,7 +3927,7 @@ wpa_supplicant_alloc(struct wpa_supplica if (wpa_s == NULL) return NULL; wpa_s->scan_req = INITIAL_SCAN_REQ; diff --git a/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch b/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch index ebb12f69f..3bc916b6b 100644 --- a/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch +++ b/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4104,7 +4104,7 @@ static int nl80211_set_channel(struct i8 +@@ -4152,7 +4152,7 @@ static int nl80211_set_channel(struct i8 freq->freq, freq->ht_enabled, freq->vht_enabled, freq->bandwidth, freq->center_freq1, freq->center_freq2); diff --git a/package/network/services/hostapd/patches/340-reload_freq_change.patch b/package/network/services/hostapd/patches/340-reload_freq_change.patch index 0dcd7c913..f05b9147b 100644 --- a/package/network/services/hostapd/patches/340-reload_freq_change.patch +++ b/package/network/services/hostapd/patches/340-reload_freq_change.patch @@ -1,6 +1,6 @@ --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -80,6 +80,25 @@ static void hostapd_reload_bss(struct ho +@@ -87,6 +87,25 @@ static void hostapd_reload_bss(struct ho #endif /* CONFIG_NO_RADIUS */ ssid = &hapd->conf->ssid; @@ -26,7 +26,7 @@ if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next && ssid->wpa_passphrase_set && ssid->wpa_passphrase) { /* -@@ -158,6 +177,7 @@ int hostapd_reload_config(struct hostapd +@@ -165,6 +184,7 @@ int hostapd_reload_config(struct hostapd struct hostapd_data *hapd = iface->bss[0]; struct hostapd_config *newconf, *oldconf; size_t j; @@ -34,7 +34,7 @@ if (iface->config_fname == NULL) { /* Only in-memory config in use - assume it has been updated */ -@@ -179,21 +199,20 @@ int hostapd_reload_config(struct hostapd +@@ -186,21 +206,20 @@ int hostapd_reload_config(struct hostapd oldconf = hapd->iconf; iface->conf = newconf; diff --git a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch index be10a413e..92e6ae9ae 100644 --- a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch +++ b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch @@ -1,72 +1,54 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -2490,13 +2490,18 @@ wpa_driver_nl80211_finish_drv_init(struc - } - - --static int wpa_driver_nl80211_del_beacon(struct wpa_driver_nl80211_data *drv) -+static int wpa_driver_nl80211_del_beacon(struct i802_bss *bss) - { -+ struct wpa_driver_nl80211_data *drv = bss->drv; +@@ -2536,10 +2536,15 @@ static int wpa_driver_nl80211_del_beacon struct nl_msg *msg; + struct wpa_driver_nl80211_data *drv = bss->drv; + if (!bss->beacon_set) + return 0; + + bss->beacon_set = 0; ++ wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)", - drv->ifindex); -- msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON); + bss->ifindex); + nl80211_put_wiphy_data_ap(bss); +- msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON); + msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_BEACON); return send_and_recv_msgs(drv, msg, NULL, NULL); } -@@ -2548,7 +2553,7 @@ static void wpa_driver_nl80211_deinit(st - nl80211_remove_monitor_interface(drv); - - if (is_ap_interface(drv->nlmode)) -- wpa_driver_nl80211_del_beacon(drv); -+ wpa_driver_nl80211_del_beacon(bss); - - if (drv->eapol_sock >= 0) { - eloop_unregister_read_sock(drv->eapol_sock); -@@ -4703,8 +4708,7 @@ static void nl80211_teardown_ap(struct i - nl80211_remove_monitor_interface(drv); - else +@@ -4753,7 +4758,7 @@ static void nl80211_teardown_ap(struct i nl80211_mgmt_unsubscribe(bss, "AP teardown"); -- + + nl80211_put_wiphy_data_ap(bss); - bss->beacon_set = 0; + wpa_driver_nl80211_del_beacon(bss); } -@@ -6728,8 +6732,6 @@ static int wpa_driver_nl80211_if_remove( +@@ -6853,8 +6858,6 @@ static int wpa_driver_nl80211_if_remove( } else { wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context"); nl80211_teardown_ap(bss); - if (!bss->added_if && !drv->first_bss->next) -- wpa_driver_nl80211_del_beacon(drv); +- wpa_driver_nl80211_del_beacon(bss); nl80211_destroy_bss(bss); if (!bss->added_if) i802_set_iface_flags(bss, 0); -@@ -7091,8 +7093,7 @@ static int wpa_driver_nl80211_deinit_ap( - struct wpa_driver_nl80211_data *drv = bss->drv; +@@ -7225,7 +7228,6 @@ static int wpa_driver_nl80211_deinit_ap( if (!is_ap_interface(drv->nlmode)) return -1; -- wpa_driver_nl80211_del_beacon(drv); + wpa_driver_nl80211_del_beacon(bss); - bss->beacon_set = 0; -+ wpa_driver_nl80211_del_beacon(bss); /* * If the P2P GO interface was dynamically added, then it is -@@ -7111,8 +7112,7 @@ static int wpa_driver_nl80211_stop_ap(vo - struct wpa_driver_nl80211_data *drv = bss->drv; +@@ -7245,7 +7247,6 @@ static int wpa_driver_nl80211_stop_ap(vo if (!is_ap_interface(drv->nlmode)) return -1; -- wpa_driver_nl80211_del_beacon(drv); + wpa_driver_nl80211_del_beacon(bss); - bss->beacon_set = 0; -+ wpa_driver_nl80211_del_beacon(bss); return 0; } diff --git a/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch b/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch index 83bec2a25..043ddbf88 100644 --- a/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch +++ b/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch @@ -1,6 +1,6 @@ --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -55,6 +55,7 @@ +@@ -56,6 +56,7 @@ #include "fst/fst_ctrl_iface.h" #include "config_file.h" #include "ctrl_iface.h" @@ -8,7 +8,7 @@ #define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256 -@@ -73,6 +74,7 @@ static void hostapd_ctrl_iface_send(stru +@@ -74,6 +75,7 @@ static void hostapd_ctrl_iface_send(stru enum wpa_msg_type type, const char *buf, size_t len); @@ -16,7 +16,7 @@ static int hostapd_ctrl_iface_attach(struct hostapd_data *hapd, struct sockaddr_storage *from, -@@ -124,6 +126,61 @@ static int hostapd_ctrl_iface_new_sta(st +@@ -125,6 +127,61 @@ static int hostapd_ctrl_iface_new_sta(st return 0; } @@ -78,7 +78,7 @@ #ifdef CONFIG_IEEE80211W #ifdef NEED_AP_MLME -@@ -2620,6 +2677,8 @@ static int hostapd_ctrl_iface_receive_pr +@@ -2607,6 +2664,8 @@ static int hostapd_ctrl_iface_receive_pr } else if (os_strncmp(buf, "VENDOR ", 7) == 0) { reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply, reply_size); diff --git a/package/network/services/hostapd/patches/370-ap_sta_support.patch b/package/network/services/hostapd/patches/370-ap_sta_support.patch index 03819b337..a37b193b6 100644 --- a/package/network/services/hostapd/patches/370-ap_sta_support.patch +++ b/package/network/services/hostapd/patches/370-ap_sta_support.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h -@@ -100,6 +100,11 @@ struct wpa_interface { +@@ -101,6 +101,11 @@ struct wpa_interface { const char *ifname; /** @@ -12,7 +12,7 @@ * bridge_ifname - Optional bridge interface name * * If the driver interface (ifname) is included in a Linux bridge -@@ -484,6 +489,8 @@ struct wpa_supplicant { +@@ -512,6 +517,8 @@ struct wpa_supplicant { #endif /* CONFIG_CTRL_IFACE_BINDER */ char bridge_ifname[16]; @@ -34,7 +34,7 @@ -include .config -include $(if $(MULTICALL),../hostapd/.config) -@@ -115,6 +119,8 @@ OBJS_c += ../src/utils/common.o +@@ -117,6 +121,8 @@ OBJS_c += ../src/utils/common.o OBJS_c += ../src/common/cli.o OBJS += wmm_ac.o @@ -45,9 +45,9 @@ CONFIG_OS=win32 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -112,6 +112,55 @@ const char *const wpa_supplicant_full_li - "\n"; - #endif /* CONFIG_NO_STDOUT_DEBUG */ +@@ -118,6 +118,55 @@ const char *const wpa_supplicant_full_li + static void wpa_bss_tmp_disallow_timeout(void *eloop_ctx, void *timeout_ctx); + +static int hostapd_stop(struct wpa_supplicant *wpa_s) +{ @@ -101,7 +101,7 @@ /* Configure default/group WEP keys for static WEP */ int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) { -@@ -819,8 +868,12 @@ void wpa_supplicant_set_state(struct wpa +@@ -883,8 +932,12 @@ void wpa_supplicant_set_state(struct wpa wpas_p2p_completed(wpa_s); sme_sched_obss_scan(wpa_s, 1); @@ -114,7 +114,7 @@ wpa_s->new_connection = 1; wpa_drv_set_operstate(wpa_s, 0); #ifndef IEEE8021X_EAPOL -@@ -4790,6 +4843,20 @@ static int wpa_supplicant_init_iface(str +@@ -5080,6 +5133,20 @@ static int wpa_supplicant_init_iface(str sizeof(wpa_s->bridge_ifname)); } @@ -135,7 +135,7 @@ /* RSNA Supplicant Key Management - INITIALIZE */ eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE); eapol_sm_notify_portValid(wpa_s->eapol, FALSE); -@@ -5083,6 +5150,11 @@ static void wpa_supplicant_deinit_iface( +@@ -5404,6 +5471,11 @@ static void wpa_supplicant_deinit_iface( if (terminate) wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING); @@ -157,7 +157,7 @@ #include "drivers/driver.h" #include "eap_peer/eap.h" #include "wpa_supplicant_i.h" -@@ -290,6 +291,10 @@ static void calculate_update_time(const +@@ -290,6 +291,10 @@ void calculate_update_time(const struct static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src, struct os_reltime *fetch_time) { diff --git a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch index b4729581c..e977f00a2 100644 --- a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch +++ b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch @@ -12,7 +12,7 @@ else --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -2471,6 +2471,7 @@ static int hostapd_ctrl_iface_receive_pr +@@ -2458,6 +2458,7 @@ static int hostapd_ctrl_iface_receive_pr reply_size); } else if (os_strcmp(buf, "STATUS-DRIVER") == 0) { reply_len = hostapd_drv_status(hapd, reply, reply_size); @@ -20,7 +20,7 @@ } else if (os_strcmp(buf, "MIB") == 0) { reply_len = ieee802_11_get_mib(hapd, reply, reply_size); if (reply_len >= 0) { -@@ -2512,6 +2513,7 @@ static int hostapd_ctrl_iface_receive_pr +@@ -2499,6 +2500,7 @@ static int hostapd_ctrl_iface_receive_pr } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply, reply_size); @@ -30,8 +30,8 @@ reply_len = -1; --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -891,6 +891,9 @@ ifdef CONFIG_MBO - OBJS += ../src/ap/mbo_ap.o +@@ -926,6 +926,9 @@ ifdef CONFIG_FILS + OBJS += ../src/ap/fils_hlp.o endif ifdef CONFIG_CTRL_IFACE +ifdef CONFIG_CTRL_IFACE_MIB @@ -42,7 +42,7 @@ --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c -@@ -1907,7 +1907,7 @@ static int wpa_supplicant_ctrl_iface_sta +@@ -2070,7 +2070,7 @@ static int wpa_supplicant_ctrl_iface_sta pos += ret; } @@ -51,7 +51,7 @@ if (wpa_s->ap_iface) { pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos, end - pos, -@@ -9032,6 +9032,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -9631,6 +9631,7 @@ char * wpa_supplicant_ctrl_iface_process reply_len = -1; } else if (os_strncmp(buf, "NOTE ", 5) == 0) { wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); @@ -59,7 +59,7 @@ } else if (os_strcmp(buf, "MIB") == 0) { reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); if (reply_len >= 0) { -@@ -9039,6 +9040,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -9638,6 +9639,7 @@ char * wpa_supplicant_ctrl_iface_process reply + reply_len, reply_size - reply_len); } @@ -67,7 +67,7 @@ } else if (os_strncmp(buf, "STATUS", 6) == 0) { reply_len = wpa_supplicant_ctrl_iface_status( wpa_s, buf + 6, reply, reply_size); -@@ -9517,6 +9519,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -10124,6 +10126,7 @@ char * wpa_supplicant_ctrl_iface_process reply_len = wpa_supplicant_ctrl_iface_bss( wpa_s, buf + 4, reply, reply_size); #ifdef CONFIG_AP @@ -75,7 +75,7 @@ } else if (os_strcmp(buf, "STA-FIRST") == 0) { reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size); } else if (os_strncmp(buf, "STA ", 4) == 0) { -@@ -9525,12 +9528,15 @@ char * wpa_supplicant_ctrl_iface_process +@@ -10132,12 +10135,15 @@ char * wpa_supplicant_ctrl_iface_process } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply, reply_size); @@ -111,7 +111,7 @@ static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype, --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c -@@ -2490,6 +2490,7 @@ static const char * bool_txt(Boolean val +@@ -2492,6 +2492,7 @@ static const char * bool_txt(Boolean val return val ? "TRUE" : "FALSE"; } @@ -119,7 +119,7 @@ int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen) { -@@ -2665,6 +2666,7 @@ int ieee802_1x_get_mib_sta(struct hostap +@@ -2667,6 +2668,7 @@ int ieee802_1x_get_mib_sta(struct hostap return len; } @@ -129,7 +129,7 @@ static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx) --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -3565,6 +3565,7 @@ static const char * wpa_bool_txt(int val +@@ -3780,6 +3780,7 @@ static const char * wpa_bool_txt(int val return val ? "TRUE" : "FALSE"; } @@ -137,7 +137,7 @@ #define RSN_SUITE "%02x-%02x-%02x-%d" #define RSN_SUITE_ARG(s) \ -@@ -3709,7 +3710,7 @@ int wpa_get_mib_sta(struct wpa_state_mac +@@ -3924,7 +3925,7 @@ int wpa_get_mib_sta(struct wpa_state_mac return len; } @@ -148,7 +148,7 @@ { --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -2308,6 +2308,8 @@ static u32 wpa_key_mgmt_suite(struct wpa +@@ -2356,6 +2356,8 @@ static u32 wpa_key_mgmt_suite(struct wpa } @@ -157,7 +157,7 @@ #define RSN_SUITE "%02x-%02x-%02x-%d" #define RSN_SUITE_ARG(s) \ ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff -@@ -2391,6 +2393,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch +@@ -2439,6 +2441,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch return (int) len; } @@ -167,7 +167,7 @@ --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c -@@ -1119,7 +1119,7 @@ int wpas_ap_wps_nfc_report_handover(stru +@@ -1139,7 +1139,7 @@ int wpas_ap_wps_nfc_report_handover(stru #endif /* CONFIG_WPS */ diff --git a/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch b/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch index 7f147aec1..8f7a6879c 100644 --- a/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch +++ b/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch @@ -1,6 +1,6 @@ --- a/src/common/wpa_common.c +++ b/src/common/wpa_common.c -@@ -1445,6 +1445,31 @@ u32 wpa_akm_to_suite(int akm) +@@ -1675,6 +1675,31 @@ u32 wpa_akm_to_suite(int akm) } @@ -32,7 +32,7 @@ int wpa_compare_rsn_ie(int ft_initial_assoc, const u8 *ie1, size_t ie1len, const u8 *ie2, size_t ie2len) -@@ -1452,8 +1477,19 @@ int wpa_compare_rsn_ie(int ft_initial_as +@@ -1682,8 +1707,19 @@ int wpa_compare_rsn_ie(int ft_initial_as if (ie1 == NULL || ie2 == NULL) return -1; diff --git a/package/network/services/hostapd/patches/420-indicate-features.patch b/package/network/services/hostapd/patches/420-indicate-features.patch index ac699f4e4..2b529ca3e 100644 --- a/package/network/services/hostapd/patches/420-indicate-features.patch +++ b/package/network/services/hostapd/patches/420-indicate-features.patch @@ -8,7 +8,7 @@ #include "crypto/random.h" #include "crypto/tls.h" #include "common/version.h" -@@ -675,7 +676,7 @@ int main(int argc, char *argv[]) +@@ -678,7 +679,7 @@ int main(int argc, char *argv[]) wpa_supplicant_event = hostapd_wpa_event; wpa_supplicant_event_global = hostapd_wpa_event_global; for (;;) { @@ -17,7 +17,7 @@ if (c < 0) break; switch (c) { -@@ -712,6 +713,8 @@ int main(int argc, char *argv[]) +@@ -715,6 +716,8 @@ int main(int argc, char *argv[]) break; #endif /* CONFIG_DEBUG_LINUX_TRACING */ case 'v': diff --git a/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch b/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch index eba79d28c..32cab7ff6 100644 --- a/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch +++ b/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch @@ -1,6 +1,6 @@ --- a/hostapd/hostapd_cli.c +++ b/hostapd/hostapd_cli.c -@@ -447,7 +447,6 @@ static int hostapd_cli_cmd_sa_query(stru +@@ -417,7 +417,6 @@ static int hostapd_cli_cmd_sa_query(stru #endif /* CONFIG_IEEE80211W */ @@ -8,7 +8,7 @@ static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc, char *argv[]) { -@@ -673,7 +672,6 @@ static int hostapd_cli_cmd_wps_config(st +@@ -643,7 +642,6 @@ static int hostapd_cli_cmd_wps_config(st ssid_hex, argv[1]); return wpa_ctrl_command(ctrl, buf); } @@ -16,19 +16,19 @@ static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc, -@@ -1367,7 +1365,6 @@ static const struct hostapd_cli_cmd host - { "sa_query", hostapd_cli_cmd_sa_query, NULL, +@@ -1476,7 +1474,6 @@ static const struct hostapd_cli_cmd host + { "sa_query", hostapd_cli_cmd_sa_query, hostapd_complete_stations, " = send SA Query to a station" }, #endif /* CONFIG_IEEE80211W */ -#ifdef CONFIG_WPS { "wps_pin", hostapd_cli_cmd_wps_pin, NULL, " [timeout] [addr] = add WPS Enrollee PIN" }, { "wps_check_pin", hostapd_cli_cmd_wps_check_pin, NULL, -@@ -1392,7 +1389,6 @@ static const struct hostapd_cli_cmd host +@@ -1501,7 +1498,6 @@ static const struct hostapd_cli_cmd host " = configure AP" }, { "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL, "= show current WPS status" }, -#endif /* CONFIG_WPS */ - { "disassoc_imminent", hostapd_cli_cmd_disassoc_imminent, NULL, NULL }, - { "ess_disassoc", hostapd_cli_cmd_ess_disassoc, NULL, NULL }, - { "bss_tm_req", hostapd_cli_cmd_bss_tm_req, NULL, NULL }, + { "disassoc_imminent", hostapd_cli_cmd_disassoc_imminent, NULL, + "= send Disassociation Imminent notification" }, + { "ess_disassoc", hostapd_cli_cmd_ess_disassoc, NULL, 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 1aeec5d05..213ee6d72 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 @@ -21,8 +21,8 @@ Signed-hostap: Antonio Quartulli +#include "ap/sta_info.h" #include "common/defs.h" #include "common/ieee802_11_defs.h" - #ifdef CONFIG_MACSEC -@@ -605,6 +606,9 @@ struct wpa_driver_associate_params { + #include "common/wpa_common.h" +@@ -762,6 +763,9 @@ struct wpa_driver_associate_params { * responsible for selecting with which BSS to associate. */ const u8 *bssid; @@ -34,7 +34,7 @@ Signed-hostap: Antonio Quartulli * --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c -@@ -16,6 +16,7 @@ +@@ -17,6 +17,7 @@ #include "eap_peer/eap.h" #include "p2p/p2p.h" #include "fst/fst.h" @@ -42,7 +42,7 @@ Signed-hostap: Antonio Quartulli #include "config.h" -@@ -1891,6 +1892,97 @@ static char * wpa_config_write_mka_ckn(c +@@ -1985,6 +1986,97 @@ static char * wpa_config_write_mka_ckn(c #endif /* CONFIG_MACSEC */ @@ -140,11 +140,10 @@ Signed-hostap: Antonio Quartulli /* Helper macros for network block parser */ #ifdef OFFSET -@@ -2123,6 +2215,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 @@ -163,7 +162,7 @@ Signed-hostap: Antonio Quartulli #define DEFAULT_EAP_WORKAROUND ((unsigned int) -1) -@@ -719,6 +721,9 @@ struct wpa_ssid { +@@ -735,6 +737,9 @@ struct wpa_ssid { */ void *parent_cred; @@ -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 -@@ -2561,6 +2561,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/461-driver_nl80211-use-new-parameters-during-ibss-join.patch b/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch index 6db61333e..11822366d 100644 --- a/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch +++ b/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch @@ -10,7 +10,7 @@ Signed-hostap: Antonio Quartulli --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4962,7 +4962,7 @@ static int wpa_driver_nl80211_ibss(struc +@@ -5012,7 +5012,7 @@ static int wpa_driver_nl80211_ibss(struc struct wpa_driver_associate_params *params) { struct nl_msg *msg; @@ -19,7 +19,7 @@ Signed-hostap: Antonio Quartulli int count = 0; wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex); -@@ -4989,6 +4989,37 @@ retry: +@@ -5039,6 +5039,37 @@ retry: nl80211_put_beacon_int(msg, params->beacon_int)) goto fail; 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 c4b48a938..000000000 --- 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 -@@ -608,6 +608,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 -@@ -5020,6 +5020,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 -@@ -1923,6 +1923,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) -@@ -2218,6 +2283,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 -@@ -723,6 +723,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 -@@ -2568,6 +2568,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 index da146ba55..9b5ee4bbb 100644 --- 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 @@ -19,7 +19,7 @@ Tested-by: Simon Wunderlich --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -1426,6 +1426,7 @@ struct wpa_driver_mesh_join_params { +@@ -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; @@ -29,7 +29,7 @@ Tested-by: Simon Wunderlich /** --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -8997,6 +8997,18 @@ static int nl80211_put_mesh_id(struct nl +@@ -8981,6 +8981,18 @@ static int nl80211_put_mesh_id(struct nl } @@ -48,7 +48,7 @@ Tested-by: Simon Wunderlich static int nl80211_put_mesh_config(struct nl_msg *msg, struct wpa_driver_mesh_bss_params *params) { -@@ -9055,6 +9067,7 @@ static int nl80211_join_mesh(struct i802 +@@ -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) || 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 000000000..383353948 --- /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/470-survey_data_fallback.patch b/package/network/services/hostapd/patches/470-survey_data_fallback.patch index 4e40a8755..1c094bed2 100644 --- a/package/network/services/hostapd/patches/470-survey_data_fallback.patch +++ b/package/network/services/hostapd/patches/470-survey_data_fallback.patch @@ -20,7 +20,7 @@ total = survey->channel_time; -@@ -395,20 +389,19 @@ static int acs_usable_vht80_chan(struct +@@ -392,20 +386,19 @@ static int acs_usable_vht80_chan(struct static int acs_survey_is_sufficient(struct freq_survey *survey) { if (!(survey->filled & SURVEY_HAS_NF)) { diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index dd962b47a..8f14f125d 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -22,7 +22,7 @@ struct wpa_ctrl_dst; struct radius_server_data; -@@ -119,6 +120,7 @@ struct hostapd_data { +@@ -122,6 +123,7 @@ struct hostapd_data { struct hostapd_iface *iface; struct hostapd_config *iconf; struct hostapd_bss_config *conf; @@ -30,7 +30,7 @@ int interface_added; /* virtual interface added for this BSS */ unsigned int started:1; unsigned int disabled:1; -@@ -328,6 +330,8 @@ struct hostapd_iface { +@@ -370,6 +372,8 @@ struct hostapd_iface { struct hostapd_config *conf; char phy[16]; /* Name of the PHY (radio) */ @@ -41,7 +41,7 @@ HAPD_IFACE_DISABLED, --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -302,6 +302,7 @@ static void hostapd_free_hapd_data(struc +@@ -309,6 +309,7 @@ static void hostapd_free_hapd_data(struc hapd->started = 0; wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface); @@ -49,7 +49,7 @@ iapp_deinit(hapd->iapp); hapd->iapp = NULL; accounting_deinit(hapd); -@@ -1160,6 +1161,8 @@ static int hostapd_setup_bss(struct host +@@ -1186,6 +1187,8 @@ static int hostapd_setup_bss(struct host if (hapd->driver && hapd->driver->set_operstate) hapd->driver->set_operstate(hapd->drv_priv, 1); @@ -58,7 +58,7 @@ return 0; } -@@ -1683,6 +1686,7 @@ static int hostapd_setup_interface_compl +@@ -1711,6 +1714,7 @@ static int hostapd_setup_interface_compl if (err) goto fail; @@ -66,7 +66,7 @@ wpa_printf(MSG_DEBUG, "Completing interface initialization"); if (iface->conf->channel) { #ifdef NEED_AP_MLME -@@ -1862,6 +1866,7 @@ dfs_offload: +@@ -1890,6 +1894,7 @@ dfs_offload: fail: wpa_printf(MSG_ERROR, "Interface initialization failed"); @@ -74,7 +74,7 @@ hostapd_set_state(iface, HAPD_IFACE_DISABLED); wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); #ifdef CONFIG_FST -@@ -2310,6 +2315,7 @@ void hostapd_interface_deinit_free(struc +@@ -2344,6 +2349,7 @@ void hostapd_interface_deinit_free(struc (unsigned int) iface->conf->num_bss); driver = iface->bss[0]->driver; drv_priv = iface->bss[0]->drv_priv; @@ -84,7 +84,7 @@ __func__, driver, drv_priv); --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -1293,7 +1293,8 @@ void ieee802_11_finish_fils_auth(struct +@@ -1587,7 +1587,8 @@ ieee802_11_set_radius_info(struct hostap static void handle_auth(struct hostapd_data *hapd, @@ -94,7 +94,7 @@ { u16 auth_alg, auth_transaction, status_code; u16 resp = WLAN_STATUS_SUCCESS; -@@ -1309,6 +1310,11 @@ static void handle_auth(struct hostapd_d +@@ -1603,6 +1604,11 @@ static void handle_auth(struct hostapd_d char *identity = NULL; char *radius_cui = NULL; u16 seq_ctrl; @@ -104,24 +104,22 @@ + .frame_info = fi, + }; - os_memset(&vlan_id, 0, sizeof(vlan_id)); - -@@ -1466,6 +1472,14 @@ static void handle_auth(struct hostapd_d + if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) { + wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)", +@@ -1757,6 +1763,12 @@ static void handle_auth(struct hostapd_d resp = WLAN_STATUS_UNSPECIFIED_FAILURE; goto fail; } -+ + if (hostapd_ubus_handle_event(hapd, &req)) { + wpa_printf(MSG_DEBUG, "Station " MACSTR " rejected by ubus handler.\n", -+ MAC2STR(mgmt->sa)); ++ MAC2STR(mgmt->sa)); + resp = WLAN_STATUS_UNSPECIFIED_FAILURE; + goto fail; + } -+ - if (res == HOSTAPD_ACL_PENDING) { - wpa_printf(MSG_DEBUG, "Authentication frame from " MACSTR - " waiting for an external authentication", -@@ -2401,7 +2415,7 @@ static u16 send_assoc_resp(struct hostap + if (res == HOSTAPD_ACL_PENDING) + return; + +@@ -2870,7 +2882,7 @@ void fils_hlp_timeout(void *eloop_ctx, v static void handle_assoc(struct hostapd_data *hapd, const struct ieee80211_mgmt *mgmt, size_t len, @@ -130,10 +128,10 @@ { u16 capab_info, listen_interval, seq_ctrl, fc; u16 resp = WLAN_STATUS_SUCCESS, reply_res; -@@ -2409,6 +2423,11 @@ static void handle_assoc(struct hostapd_ - int left, i; - struct sta_info *sta; - u8 *tmp = NULL; +@@ -2884,6 +2896,11 @@ static void handle_assoc(struct hostapd_ + #ifdef CONFIG_FILS + int delay_assoc = 0; + #endif /* CONFIG_FILS */ + struct hostapd_ubus_request req = { + .type = HOSTAPD_UBUS_ASSOC_REQ, + .mgmt_frame = mgmt, @@ -142,7 +140,7 @@ if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_req) : sizeof(mgmt->u.assoc_req))) { -@@ -2528,6 +2547,13 @@ static void handle_assoc(struct hostapd_ +@@ -3051,6 +3068,13 @@ static void handle_assoc(struct hostapd_ } #endif /* CONFIG_MBO */ @@ -156,7 +154,24 @@ /* * sta->capability is used in check_assoc_ies() for RRM enabled * capability element. -@@ -3035,7 +3061,7 @@ int ieee802_11_mgmt(struct hostapd_data +@@ -3258,6 +3282,7 @@ static void handle_disassoc(struct hosta + wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d", + MAC2STR(mgmt->sa), + le_to_host16(mgmt->u.disassoc.reason_code)); ++ hostapd_ubus_notify(hapd, "disassoc", mgmt->sa); + + sta = ap_get_sta(hapd, mgmt->sa); + if (sta == NULL) { +@@ -3323,6 +3348,8 @@ static void handle_deauth(struct hostapd + " reason_code=%d", + MAC2STR(mgmt->sa), le_to_host16(mgmt->u.deauth.reason_code)); + ++ hostapd_ubus_notify(hapd, "deauth", mgmt->sa); ++ + sta = ap_get_sta(hapd, mgmt->sa); + if (sta == NULL) { + wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying " +@@ -3637,7 +3664,7 @@ int ieee802_11_mgmt(struct hostapd_data if (stype == WLAN_FC_STYPE_PROBE_REQ) { @@ -165,7 +180,7 @@ return 1; } -@@ -3053,17 +3079,17 @@ int ieee802_11_mgmt(struct hostapd_data +@@ -3657,17 +3684,17 @@ int ieee802_11_mgmt(struct hostapd_data switch (stype) { case WLAN_FC_STYPE_AUTH: wpa_printf(MSG_DEBUG, "mgmt::auth"); @@ -188,7 +203,7 @@ case WLAN_FC_STYPE_DISASSOC: --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -702,7 +702,7 @@ void sta_track_claim_taxonomy_info(struc +@@ -716,7 +716,7 @@ void sta_track_claim_taxonomy_info(struc void handle_probe_req(struct hostapd_data *hapd, const struct ieee80211_mgmt *mgmt, size_t len, @@ -197,7 +212,7 @@ { u8 *resp; struct ieee802_11_elems elems; -@@ -711,9 +711,15 @@ void handle_probe_req(struct hostapd_dat +@@ -725,9 +725,15 @@ void handle_probe_req(struct hostapd_dat size_t i, resp_len; int noack; enum ssid_match_result res; @@ -213,7 +228,7 @@ if (len < IEEE80211_HDRLEN) return; -@@ -880,6 +886,12 @@ void handle_probe_req(struct hostapd_dat +@@ -894,6 +900,12 @@ void handle_probe_req(struct hostapd_dat } #endif /* CONFIG_P2P */ @@ -239,7 +254,7 @@ int ieee802_11_update_beacons(struct hostapd_iface *iface); --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -52,6 +52,10 @@ int hostapd_notif_assoc(struct hostapd_d +@@ -116,6 +116,10 @@ int hostapd_notif_assoc(struct hostapd_d u16 reason = WLAN_REASON_UNSPECIFIED; u16 status = WLAN_STATUS_SUCCESS; const u8 *p2p_dev_addr = NULL; @@ -250,7 +265,7 @@ if (addr == NULL) { /* -@@ -131,6 +135,12 @@ int hostapd_notif_assoc(struct hostapd_d +@@ -195,6 +199,12 @@ int hostapd_notif_assoc(struct hostapd_d goto fail; } @@ -263,3 +278,39 @@ #ifdef CONFIG_P2P if (elems.p2p) { wpabuf_free(sta->p2p_ie); +--- 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"); + ap_free_sta(hapd, sta); ++ hostapd_ubus_notify(hapd, "local-deauth", sta->addr); + return; + } + +@@ -551,6 +552,7 @@ skip_poll: + hapd, sta, + WLAN_REASON_PREV_AUTH_NOT_VALID); + ap_free_sta(hapd, sta); ++ hostapd_ubus_notify(hapd, "inactive-deauth", sta->addr); + break; + } + } +@@ -1212,6 +1214,7 @@ void ap_sta_set_authorized(struct hostap + buf, ip_addr); + } else { + wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED "%s", buf); ++ hostapd_ubus_notify(hapd, "disassoc", sta->addr); + + if (hapd->msg_ctx_parent && + hapd->msg_ctx_parent != hapd->msg_ctx) +--- 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, + MAC2STR(addr)); ++ hostapd_ubus_notify(hapd, "key-mismatch", addr); + } + + diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c index c24f63fd8..beb4388f7 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c @@ -9,8 +9,10 @@ #include "utils/includes.h" #include "utils/common.h" #include "utils/eloop.h" +#include "utils/wpabuf.h" #include "common/ieee802_11_defs.h" #include "hostapd.h" +#include "neighbor_db.h" #include "wps_hostapd.h" #include "sta_info.h" #include "ubus.h" @@ -182,6 +184,37 @@ hostapd_bss_get_clients(struct ubus_context *ctx, struct ubus_object *obj, return 0; } +enum { + NOTIFY_RESPONSE, + __NOTIFY_MAX +}; + +static const struct blobmsg_policy notify_policy[__NOTIFY_MAX] = { + [NOTIFY_RESPONSE] = { "notify_response", BLOBMSG_TYPE_INT32 }, +}; + +static int +hostapd_notify_response(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + struct blob_attr *tb[__NOTIFY_MAX]; + struct hostapd_data *hapd = get_hapd_from_object(obj); + struct wpabuf *elems; + const char *pos; + size_t len; + + blobmsg_parse(notify_policy, __NOTIFY_MAX, tb, + blob_data(msg), blob_len(msg)); + + if (!tb[NOTIFY_RESPONSE]) + return UBUS_STATUS_INVALID_ARGUMENT; + + hapd->ubus.notify_response = blobmsg_get_u32(tb[NOTIFY_RESPONSE]); + + return UBUS_STATUS_OK; +} + enum { DEL_CLIENT_ADDR, DEL_CLIENT_REASON, @@ -416,6 +449,170 @@ hostapd_vendor_elements(struct ubus_context *ctx, struct ubus_object *obj, return UBUS_STATUS_OK; } +static void +hostapd_rrm_print_nr(struct hostapd_neighbor_entry *nr) +{ + const u8 *data; + char *str; + int len; + + blobmsg_printf(&b, "", MACSTR, MAC2STR(nr->bssid)); + + str = blobmsg_alloc_string_buffer(&b, "", nr->ssid.ssid_len + 1); + memcpy(str, nr->ssid.ssid, nr->ssid.ssid_len); + str[nr->ssid.ssid_len] = 0; + blobmsg_add_string_buffer(&b); + + len = wpabuf_len(nr->nr); + str = blobmsg_alloc_string_buffer(&b, "", 2 * len + 1); + wpa_snprintf_hex(str, 2 * len + 1, wpabuf_head_u8(nr->nr), len); + blobmsg_add_string_buffer(&b); +} + +static int +hostapd_rrm_nr_get_own(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + struct hostapd_data *hapd = get_hapd_from_object(obj); + struct hostapd_neighbor_entry *nr; + void *c; + + if (!(hapd->conf->radio_measurements[0] & WLAN_RRM_CAPS_NEIGHBOR_REPORT)) + return UBUS_STATUS_NOT_SUPPORTED; + + nr = hostapd_neighbor_get(hapd, hapd->own_addr, NULL); + if (!nr) + return UBUS_STATUS_NOT_FOUND; + + blob_buf_init(&b, 0); + + c = blobmsg_open_array(&b, "value"); + hostapd_rrm_print_nr(nr); + blobmsg_close_array(&b, c); + + ubus_send_reply(ctx, req, b.head); + + return 0; +} + +static int +hostapd_rrm_nr_list(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + struct hostapd_data *hapd = get_hapd_from_object(obj); + struct hostapd_neighbor_entry *nr; + void *c; + + if (!(hapd->conf->radio_measurements[0] & WLAN_RRM_CAPS_NEIGHBOR_REPORT)) + return UBUS_STATUS_NOT_SUPPORTED; + + blob_buf_init(&b, 0); + + c = blobmsg_open_array(&b, "list"); + dl_list_for_each(nr, &hapd->nr_db, struct hostapd_neighbor_entry, list) { + void *cur; + + if (!memcmp(nr->bssid, hapd->own_addr, ETH_ALEN)) + continue; + + cur = blobmsg_open_array(&b, NULL); + hostapd_rrm_print_nr(nr); + blobmsg_close_array(&b, cur); + } + blobmsg_close_array(&b, c); + + ubus_send_reply(ctx, req, b.head); + + return 0; +} + +enum { + NR_SET_LIST, + __NR_SET_LIST_MAX +}; + +static const struct blobmsg_policy nr_set_policy[__NR_SET_LIST_MAX] = { + [NR_SET_LIST] = { "list", BLOBMSG_TYPE_ARRAY }, +}; + + +static void +hostapd_rrm_nr_clear(struct hostapd_data *hapd) +{ + struct hostapd_neighbor_entry *nr; + +restart: + dl_list_for_each(nr, &hapd->nr_db, struct hostapd_neighbor_entry, list) { + if (!memcmp(nr->bssid, hapd->own_addr, ETH_ALEN)) + continue; + + hostapd_neighbor_remove(hapd, nr->bssid, &nr->ssid); + goto restart; + } +} + +static int +hostapd_rrm_nr_set(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + static const struct blobmsg_policy nr_e_policy[] = { + { .type = BLOBMSG_TYPE_STRING }, + { .type = BLOBMSG_TYPE_STRING }, + { .type = BLOBMSG_TYPE_STRING }, + }; + struct hostapd_data *hapd = get_hapd_from_object(obj); + struct blob_attr *tb_l[__NR_SET_LIST_MAX]; + struct blob_attr *tb[ARRAY_SIZE(nr_e_policy)]; + struct blob_attr *cur; + int ret = 0; + int rem; + + if (!(hapd->conf->radio_measurements[0] & WLAN_RRM_CAPS_NEIGHBOR_REPORT)) + return UBUS_STATUS_NOT_SUPPORTED; + + blobmsg_parse(nr_set_policy, __NR_SET_LIST_MAX, tb_l, blob_data(msg), blob_len(msg)); + if (!tb_l[NR_SET_LIST]) + return UBUS_STATUS_INVALID_ARGUMENT; + + hostapd_rrm_nr_clear(hapd); + blobmsg_for_each_attr(cur, tb_l[NR_SET_LIST], rem) { + struct wpa_ssid_value ssid; + struct wpabuf *data; + u8 bssid[ETH_ALEN]; + char *s; + + blobmsg_parse_array(nr_e_policy, ARRAY_SIZE(nr_e_policy), tb, blobmsg_data(cur), blobmsg_data_len(cur)); + if (!tb[0] || !tb[1] || !tb[2]) + goto invalid; + + s = blobmsg_get_string(tb[0]); + if (hwaddr_aton(s, bssid)) + goto invalid; + + s = blobmsg_get_string(tb[1]); + ssid.ssid_len = strlen(s); + if (ssid.ssid_len > sizeof(ssid.ssid)) + goto invalid; + + memcpy(&ssid, s, ssid.ssid_len); + data = wpabuf_parse_bin(blobmsg_get_string(tb[2])); + if (!data) + goto invalid; + + hostapd_neighbor_set(hapd, bssid, &ssid, data, NULL, NULL, 0); + wpabuf_free(data); + continue; + +invalid: + ret = UBUS_STATUS_INVALID_ARGUMENT; + } + + return 0; +} + static const struct ubus_method bss_methods[] = { UBUS_METHOD_NOARG("get_clients", hostapd_bss_get_clients), UBUS_METHOD("del_client", hostapd_bss_del_client, del_policy), @@ -427,6 +624,10 @@ static const struct ubus_method bss_methods[] = { UBUS_METHOD("switch_chan", hostapd_switch_chan, csa_policy), #endif UBUS_METHOD("set_vendor_elements", hostapd_vendor_elements, ve_policy), + UBUS_METHOD("notify_response", hostapd_notify_response, notify_policy), + UBUS_METHOD_NOARG("rrm_nr_get_own", hostapd_rrm_nr_get_own), + UBUS_METHOD_NOARG("rrm_nr_list", hostapd_rrm_nr_list), + UBUS_METHOD("rrm_nr_set", hostapd_rrm_nr_set, nr_set_policy), }; static struct ubus_object_type bss_object_type = @@ -523,6 +724,11 @@ int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_req blobmsg_add_u32(&b, "signal", req->frame_info->ssi_signal); blobmsg_add_u32(&b, "freq", hapd->iface->freq); + if (!hapd->ubus.notify_response) { + ubus_notify(ctx, &hapd->ubus.obj, type, b.head, -1); + return 0; + } + if (ubus_notify_async(ctx, &hapd->ubus.obj, type, b.head, &ureq.nreq)) return 0; @@ -534,3 +740,17 @@ int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_req return 0; } + +void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *addr) +{ + if (!hapd->ubus.obj.has_subscribers) + return; + + if (!addr) + return; + + blob_buf_init(&b, 0); + blobmsg_add_macaddr(&b, "address", addr); + + ubus_notify(ctx, &hapd->ubus.obj, type, b.head, -1); +} diff --git a/package/network/services/hostapd/src/src/ap/ubus.h b/package/network/services/hostapd/src/src/ap/ubus.h index 479ddfca7..e3ff981c7 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.h +++ b/package/network/services/hostapd/src/src/ap/ubus.h @@ -37,6 +37,7 @@ struct hostapd_ubus_iface { struct hostapd_ubus_bss { struct ubus_object obj; struct avl_tree banned; + int notify_response; }; void hostapd_ubus_add_iface(struct hostapd_iface *iface); @@ -45,6 +46,7 @@ void hostapd_ubus_add_bss(struct hostapd_data *hapd); void hostapd_ubus_free_bss(struct hostapd_data *hapd); int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req); +void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *mac); #else @@ -73,6 +75,9 @@ static inline int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct ho return 0; } +static inline void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *mac) +{ +} #endif #endif diff --git a/package/network/services/ipset-dns/Makefile b/package/network/services/ipset-dns/Makefile index 2adc9fe03..3f21d04c4 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 19669a05b..000000000 --- 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 344d682ad..cdd8f99d5 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.7 +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:=b9360355c30a3c06fd5c0a6e658f2ad8bf77037d5a17c6fcabf20e62882e0db8 +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 d2b3d1545..36b43c89d 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 39bce989b..c3d9ba050 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 5ba9e7c7e..16c903db3 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -8,54 +8,95 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcpd -PKG_RELEASE:=2 +PKG_RELEASE:=1 +PKG_VERSION:=1.3 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/odhcpd.git -PKG_SOURCE_DATE:=2017-10-02 -PKG_SOURCE_VERSION:=c6f3d5d4ea5154e5971fa0b1b1e9a9c07119429f -PKG_MIRROR_HASH:=5ce8f52b5c6acea27d9733918e9c3bc8a154d516a02eef9b172c5e3d459f494c +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 175e56e9b..cecbdd4a8 100644 --- a/package/network/services/odhcpd/files/odhcpd.defaults +++ b/package/network/services/odhcpd/files/odhcpd.defaults @@ -22,6 +22,7 @@ set dhcp.odhcpd=odhcpd set dhcp.odhcpd.maindhcp=0 set dhcp.odhcpd.leasefile=/tmp/hosts/odhcpd set dhcp.odhcpd.leasetrigger=/usr/sbin/odhcpd-update +set dhcp.odhcpd.loglevel=4 set dhcp.lan.dhcpv6=$MODE set dhcp.lan.ra=$MODE commit dhcp diff --git a/package/network/services/omcproxy/Makefile b/package/network/services/omcproxy/Makefile index 473e96884..28de833a1 100644 --- a/package/network/services/omcproxy/Makefile +++ b/package/network/services/omcproxy/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=omcproxy -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE_URL:=https://github.com/sbyx/omcproxy.git PKG_SOURCE_PROTO:=git diff --git a/package/network/services/omcproxy/files/omcproxy.init b/package/network/services/omcproxy/files/omcproxy.init index a12979208..970b3a128 100644 --- a/package/network/services/omcproxy/files/omcproxy.init +++ b/package/network/services/omcproxy/files/omcproxy.init @@ -51,7 +51,7 @@ omcproxy_add_firewall() { config_get uplink $1 uplink config_get downlink $1 downlink - upzone=$(fw3 network $uplink) + upzone=$(fw3 -q network $uplink 2>/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-easy-rsa/Makefile b/package/network/services/openvpn-easy-rsa/Makefile index 5b7d9be21..f4b479986 100644 --- a/package/network/services/openvpn-easy-rsa/Makefile +++ b/package/network/services/openvpn-easy-rsa/Makefile @@ -9,19 +9,18 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openvpn-easy-rsa -PKG_RELEASE=2 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/OpenVPN/easy-rsa.git -PKG_SOURCE_DATE:=2013-01-30 -PKG_SOURCE_VERSION:=ff5bfd1dd8e548cb24d302742af3894f893ef92f -PKG_MIRROR_HASH:=c87704b3906a0c14f51c6677151a9389f698523c7ec07f7c75489ca31786f128 +PKG_VERSION:=3.0.1 +PKG_RELEASE:=1 +PKG_SOURCE_URL:=https://github.com/OpenVPN/easy-rsa/releases/download/$(PKG_VERSION)/ +PKG_SOURCE:=EasyRSA-$(PKG_VERSION).tgz +PKG_HASH:=dbdaf5b9444b99e0c5221fd4bcf15384c62380c1b63cea23d42239414d7b2d4e PKG_LICENSE:=GPL-2.0 +PKG_BUILD_DIR:=$(BUILD_DIR)/EasyRSA-$(PKG_VERSION) include $(INCLUDE_DIR)/package.mk define Package/openvpn-easy-rsa - TITLE:=Simple shell scripts to manage a Certificate Authority + TITLE:=CLI utility to build and manage a PKI CA. SECTION:=net CATEGORY:=Network URL:=http://openvpn.net @@ -30,9 +29,8 @@ define Package/openvpn-easy-rsa endef define Package/openvpn-easy-rsa/conffiles -/etc/easy-rsa/keys/serial -/etc/easy-rsa/keys/index.txt /etc/easy-rsa/vars +/etc/easy-rsa/openssl-1.0.cnf endef define Build/Configure @@ -45,13 +43,24 @@ endef define Package/openvpn-easy-rsa/install $(INSTALL_DIR) $(1)/usr/sbin - $(CP) $(PKG_BUILD_DIR)/easy-rsa/2.0/{build-*,clean-all,inherit-inter,list-crl,pkitool,revoke-full,sign-req,whichopensslcnf} $(1)/usr/sbin/ + + $(INSTALL_BIN) $(PKG_BUILD_DIR)/easyrsa $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/etc/easy-rsa - $(INSTALL_DATA) $(PKG_BUILD_DIR)/easy-rsa/2.0/openssl-1.0.0.cnf $(1)/etc/easy-rsa/openssl-1.0.0.cnf - $(INSTALL_DATA) $(PKG_BUILD_DIR)/easy-rsa/2.0/vars $(1)/etc/easy-rsa/vars - $(INSTALL_DIR) $(1)/etc/easy-rsa/keys - $(INSTALL_DATA) files/easy-rsa.index $(1)/etc/easy-rsa/keys/index.txt - $(INSTALL_DATA) files/easy-rsa.serial $(1)/etc/easy-rsa/keys/serial + $(INSTALL_DATA) $(PKG_BUILD_DIR)/openssl-1.0.cnf $(1)/etc/easy-rsa/openssl-1.0.cnf + $(INSTALL_DATA) $(PKG_BUILD_DIR)/vars.example $(1)/etc/easy-rsa/vars + + $(INSTALL_DIR) $(1)/etc/easy-rsa/pki + chmod 700 $(1)/etc/easy-rsa/pki + $(INSTALL_DIR) $(1)/etc/easy-rsa/pki/private + chmod 700 $(1)/etc/easy-rsa/pki/private + $(INSTALL_DIR) $(1)/etc/easy-rsa/pki/reqs + chmod 700 $(1)/etc/easy-rsa/pki/reqs + + $(INSTALL_DIR) $(1)/etc/easy-rsa/x509-types + $(INSTALL_DATA) $(PKG_BUILD_DIR)/x509-types/* $(1)/etc/easy-rsa/x509-types/ + + $(INSTALL_DIR) $(1)/lib/upgrade/keep.d + $(INSTALL_DATA) files/openvpn-easy-rsa.upgrade $(1)/lib/upgrade/keep.d/$(PKG_NAME) endef $(eval $(call BuildPackage,openvpn-easy-rsa)) diff --git a/package/network/services/openvpn-easy-rsa/files/easy-rsa.index b/package/network/services/openvpn-easy-rsa/files/easy-rsa.index deleted file mode 100644 index e69de29bb..000000000 diff --git a/package/network/services/openvpn-easy-rsa/files/easy-rsa.serial b/package/network/services/openvpn-easy-rsa/files/easy-rsa.serial deleted file mode 100644 index 8a0f05e16..000000000 --- a/package/network/services/openvpn-easy-rsa/files/easy-rsa.serial +++ /dev/null @@ -1 +0,0 @@ -01 diff --git a/package/network/services/openvpn-easy-rsa/files/openvpn-easy-rsa.upgrade b/package/network/services/openvpn-easy-rsa/files/openvpn-easy-rsa.upgrade new file mode 100644 index 000000000..8110b81a4 --- /dev/null +++ b/package/network/services/openvpn-easy-rsa/files/openvpn-easy-rsa.upgrade @@ -0,0 +1 @@ +/etc/easy-rsa/pki/ diff --git a/package/network/services/openvpn-easy-rsa/patches/100-run-ootb.patch b/package/network/services/openvpn-easy-rsa/patches/100-run-ootb.patch deleted file mode 100644 index 4c1b889e3..000000000 --- a/package/network/services/openvpn-easy-rsa/patches/100-run-ootb.patch +++ /dev/null @@ -1,152 +0,0 @@ ---- a/easy-rsa/2.0/build-ca -+++ b/easy-rsa/2.0/build-ca -@@ -5,4 +5,4 @@ - # - - export EASY_RSA="${EASY_RSA:-.}" --"$EASY_RSA/pkitool" --interact --initca $* -+"/usr/sbin/pkitool" --interact --initca $* ---- a/easy-rsa/2.0/build-dh -+++ b/easy-rsa/2.0/build-dh -@@ -1,5 +1,7 @@ - #!/bin/sh - -+. /etc/easy-rsa/vars -+ - # Build Diffie-Hellman parameters for the server side - # of an SSL/TLS connection. - ---- a/easy-rsa/2.0/build-inter -+++ b/easy-rsa/2.0/build-inter -@@ -4,4 +4,4 @@ - # root certificate. - - export EASY_RSA="${EASY_RSA:-.}" --"$EASY_RSA/pkitool" --interact --inter $* -+"/usr/sbin/pkitool" --interact --inter $* ---- a/easy-rsa/2.0/build-key -+++ b/easy-rsa/2.0/build-key -@@ -4,4 +4,4 @@ - # root certificate. - - export EASY_RSA="${EASY_RSA:-.}" --"$EASY_RSA/pkitool" --interact $* -+"/usr/sbin/pkitool" --interact $* ---- a/easy-rsa/2.0/build-key-pass -+++ b/easy-rsa/2.0/build-key-pass -@@ -4,4 +4,4 @@ - # with a password. - - export EASY_RSA="${EASY_RSA:-.}" --"$EASY_RSA/pkitool" --interact --pass $* -+"/usr/sbin/pkitool" --interact --pass $* ---- a/easy-rsa/2.0/build-key-pkcs12 -+++ b/easy-rsa/2.0/build-key-pkcs12 -@@ -5,4 +5,4 @@ - # the CA certificate as well. - - export EASY_RSA="${EASY_RSA:-.}" --"$EASY_RSA/pkitool" --interact --pkcs12 $* -+"/usr/sbin/pkitool" --interact --pkcs12 $* ---- a/easy-rsa/2.0/build-key-server -+++ b/easy-rsa/2.0/build-key-server -@@ -7,4 +7,4 @@ - # extension in the openssl.cnf file. - - export EASY_RSA="${EASY_RSA:-.}" --"$EASY_RSA/pkitool" --interact --server $* -+"/usr/sbin/pkitool" --interact --server $* ---- a/easy-rsa/2.0/build-req -+++ b/easy-rsa/2.0/build-req -@@ -4,4 +4,4 @@ - # when your root certificate and key is not available locally. - - export EASY_RSA="${EASY_RSA:-.}" --"$EASY_RSA/pkitool" --interact --csr $* -+"/usr/sbin/pkitool" --interact --csr $* ---- a/easy-rsa/2.0/build-req-pass -+++ b/easy-rsa/2.0/build-req-pass -@@ -4,4 +4,4 @@ - # with a password. - - export EASY_RSA="${EASY_RSA:-.}" --"$EASY_RSA/pkitool" --interact --csr --pass $* -+"/usr/sbin/pkitool" --interact --csr --pass $* ---- a/easy-rsa/2.0/clean-all -+++ b/easy-rsa/2.0/clean-all -@@ -1,5 +1,7 @@ - #!/bin/sh - -+. /etc/easy-rsa/vars -+ - # Initialize the $KEY_DIR directory. - # Note that this script does a - # rm -rf on $KEY_DIR so be careful! ---- a/easy-rsa/2.0/inherit-inter -+++ b/easy-rsa/2.0/inherit-inter -@@ -1,5 +1,7 @@ - #!/bin/sh - -+. /etc/easy-rsa/vars -+ - # Build a new PKI which is rooted on an intermediate certificate generated - # by ./build-inter or ./pkitool --inter from a parent PKI. The new PKI should - # have independent vars settings, and must use a different KEY_DIR directory ---- a/easy-rsa/2.0/list-crl -+++ b/easy-rsa/2.0/list-crl -@@ -1,5 +1,7 @@ - #!/bin/sh - -+. /etc/easy-rsa/vars -+ - # list revoked certificates - - CRL="${1:-crl.pem}" ---- a/easy-rsa/2.0/pkitool -+++ b/easy-rsa/2.0/pkitool -@@ -1,5 +1,7 @@ - #!/bin/sh - -+. /etc/easy-rsa/vars -+ - # OpenVPN -- An application to securely tunnel IP networks - # over a single TCP/UDP port, with support for SSL/TLS-based - # session authentication and key exchange, ---- a/easy-rsa/2.0/revoke-full -+++ b/easy-rsa/2.0/revoke-full -@@ -1,5 +1,7 @@ - #!/bin/sh - -+. /etc/easy-rsa/vars -+ - # revoke a certificate, regenerate CRL, - # and verify revocation - ---- a/easy-rsa/2.0/sign-req -+++ b/easy-rsa/2.0/sign-req -@@ -4,4 +4,4 @@ - # with a local root certificate and key. - - export EASY_RSA="${EASY_RSA:-.}" --"$EASY_RSA/pkitool" --interact --sign $* -+"/usr/sbin/pkitool" --interact --sign $* ---- a/easy-rsa/2.0/vars -+++ b/easy-rsa/2.0/vars -@@ -12,7 +12,7 @@ - # This variable should point to - # the top level of the easy-rsa - # tree. --export EASY_RSA="`pwd`" -+export EASY_RSA="/etc/easy-rsa" - - # - # This variable should point to -@@ -26,7 +26,7 @@ - # This variable should point to - # the openssl.cnf file included - # with easy-rsa. --export KEY_CONFIG=`$EASY_RSA/whichopensslcnf $EASY_RSA` -+export KEY_CONFIG=`/usr/sbin/whichopensslcnf $EASY_RSA` - - # Edit this variable to point to - # your soon-to-be-created key diff --git a/package/network/services/openvpn/Makefile b/package/network/services/openvpn/Makefile index fee0296ed..ec48e734f 100644 --- a/package/network/services/openvpn/Makefile +++ b/package/network/services/openvpn/Makefile @@ -25,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/relayd/Makefile b/package/network/services/relayd/Makefile index dcb69a11b..7f1c1f941 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 beb5f309c..42c23b4e8 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,19 +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 + $(call Package/samba/Default) + TITLE+= net commands DEPENDS:=+libreadline +libncurses endef @@ -51,7 +60,6 @@ define Package/samba36-server/config int "Maximum level of compiled-in debug messages" depends on PACKAGE_samba36-server || PACKAGE_samba36-client default -1 - endef define Package/samba36-server/description @@ -156,6 +164,12 @@ define Package/samba36-client/install $(INSTALL_BIN) $(PKG_BUILD_BIN)/nmblookup $(1)/usr/sbin endef +define Package/samba36-net/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_BIN)/net $(1)/usr/sbin +endef + $(eval $(call BuildPackage,samba36-client)) $(eval $(call BuildPackage,samba36-server)) +$(eval $(call BuildPackage,samba36-net)) diff --git a/package/network/services/samba36/files/samba.config b/package/network/services/samba36/files/samba.config index b34a8dcaa..c79db0d32 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 28b0064df..ae0e0e230 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/uhttpd/Makefile b/package/network/services/uhttpd/Makefile index 465e54349..648916385 100644 --- a/package/network/services/uhttpd/Makefile +++ b/package/network/services/uhttpd/Makefile @@ -11,7 +11,7 @@ PKG_NAME:=uhttpd PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/uhttpd.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git PKG_SOURCE_DATE:=2017-11-04 PKG_SOURCE_VERSION:=a235636a2687fafb9c474e4b134a59ff66425c92 PKG_MIRROR_HASH:=626392a485e8ab8085bb55d9424b176be9143529db59a820a7de71061a93a007 @@ -19,6 +19,7 @@ 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,12 +44,12 @@ 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" + default y endef - define Package/uhttpd-mod-lua $(Package/uhttpd/default) TITLE+= (Lua plugin) @@ -106,6 +107,16 @@ define Package/uhttpd-mod-ubus/install $(INSTALL_DATA) ./files/ubus.default $(1)/etc/uci-defaults/00_uhttpd_ubus endef +define Package/uhttpd-mod-lua/postinst + $(if $(CONFIG_uhttpd_lua), + #!/bin/sh + if [ -f $${IPKG_INSTROOT}/www/index.html ] + then + sed -e 's:/cgi-bin::g' -i $${IPKG_INSTROOT}/www/index.html + fi + ,) +endef + $(eval $(call BuildPackage,uhttpd)) $(eval $(call BuildPackage,uhttpd-mod-lua)) diff --git a/package/network/services/uhttpd/files/uhttpd.config b/package/network/services/uhttpd/files/uhttpd.config index 89f99aaee..a7d769e18 100644 --- a/package/network/services/uhttpd/files/uhttpd.config +++ b/package/network/services/uhttpd/files/uhttpd.config @@ -51,8 +51,8 @@ config uhttpd main # Lua url prefix and handler script. # Lua support is disabled if no prefix given. -# option lua_prefix /luci -# option lua_handler /usr/lib/lua/luci/sgi/uhttpd.lua + option lua_prefix /luci + option lua_handler /usr/lib/lua/luci/sgi/uhttpd.lua # Specify the ubus-rpc prefix and socket path. # option ubus_prefix /ubus @@ -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 6b8be1c7e..47270bcc1 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 cdafa5be1..ffbc3fed3 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/utils/adb-enablemodem/Makefile b/package/network/utils/adb-enablemodem/Makefile new file mode 100644 index 000000000..3ffc64af0 --- /dev/null +++ b/package/network/utils/adb-enablemodem/Makefile @@ -0,0 +1,26 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=adb-enablemodem +PKG_VERSION:=2017-03-05 +PKG_RELEASE:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/adb-enablemodem + SECTION:=net + CATEGORY:=Network + SUBMENU:=WWAN + TITLE:=Enable modem via adb + DEPENDS:=+adb +endef + +define Build/Compile + true +endef + +define Package/adb-enablemodem/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/adb-enablemodem $(1)/etc/init.d/adb-enablemodem +endef + +$(eval $(call BuildPackage,adb-enablemodem)) diff --git a/package/network/utils/adb-enablemodem/files/adb-enablemodem b/package/network/utils/adb-enablemodem/files/adb-enablemodem new file mode 100644 index 000000000..ddfc681a0 --- /dev/null +++ b/package/network/utils/adb-enablemodem/files/adb-enablemodem @@ -0,0 +1,64 @@ +#!/bin/sh /etc/rc.common + +START=99 + +adb_exec() { + adb -s "$serial" shell "( $1 ) >/dev/null 2>&1"'; printf "\nEXIT_CODE: %i\n" $?' | head -c 64 | grep -qx 'EXIT_CODE: 0\r\?' +} + +enablemodem_do() { + logger -t adb-enablemodem 'INFO: waiting for device' + adb wait-for-device + serial="$(adb get-serialno)" + + vendor_id="$(adb -s "$serial" shell 'uci get product.usb.vid' | head -c 16 | tr -d '\r\n')" + product_id="$(adb -s "$serial" shell 'uci get product.usb.pid' | head -c 16 | tr -d '\r\n')" + + case "$vendor_id:$product_id" in + "0x2357:0x000D") # TP-LINK LTE MODULE + case "$1" in + start) + if adb_exec ' + chmod +x /WEBSERVER/www/cgi-bin/* + fds="$(ls /proc/$$/fd | grep -v "^[012]$")" + for fd in $fds; do + eval "exec $fd>&-" + done + start-stop-daemon -x httpd -S -- -h /WEBSERVER/www/ + '; then + logger -t adb-enablemodem 'INFO: httpd on modem started' + else + logger -t adb-enablemodem 'ERROR: failed to start httpd on modem' + fi + option_newid='/sys/bus/usb-serial/drivers/option1/new_id' + if [ -e "$option_newid" ]; then + printf '%s %s' "$vendor_id" "$product_id" > "$option_newid" + fi + ;; + stop) + if adb_exec 'start-stop-daemon -x httpd -K'; then + logger -t adb-enablemodem 'INFO: httpd on modem stopped' + else + logger -t adb-enablemodem 'ERROR: failed to stop httpd on modem' + fi + ;; + esac + ;; + *) + logger -t adb-enablemodem "ERROR: unknown device $vendor_id:$product_id" + ;; + esac +} + +start() { + ( enablemodem_do start ) & +} + +stop() { + ( enablemodem_do stop ) & +} + +restart() { + ( enablemodem_do stop; enablemodem_do start ) & +} + diff --git a/package/network/utils/arptables/Makefile b/package/network/utils/arptables/Makefile index d2fd2593a..d1168ae68 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 ce99a2a68..3b7f4b902 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/ncm.json b/package/network/utils/comgt/files/ncm.json index 8f74e173d..bbdb30c5e 100644 --- a/package/network/utils/comgt/files/ncm.json +++ b/package/network/utils/comgt/files/ncm.json @@ -63,5 +63,16 @@ }, "connect": "AT*ENAP=1,${profile}", "disconnect": "AT*ENAP=0" + }, + "mtk1": { + "initialize": [ + "AT+CFUN=1" + ], + "configure": [ + "AT+CGDCONT=${profile},\\\"${pdptype}\\\",\\\"${apn}\\\",0,0" + ], + "connect": "AT+CGACT=1,${profile}", + "finalize": "AT+CGDATA=\\\"M-MBIM\\\",${profile},1", + "disconnect": "AT+CGACT=0,${profile}" } } diff --git a/package/network/utils/comgt/files/ncm.sh b/package/network/utils/comgt/files/ncm.sh index 73d1e05e3..60b39655e 100644 --- a/package/network/utils/comgt/files/ncm.sh +++ b/package/network/utils/comgt/files/ncm.sh @@ -25,7 +25,7 @@ proto_ncm_init_config() { proto_ncm_setup() { local interface="$1" - local manufacturer initialize setmode connect ifname devname devpath + local manufacturer initialize setmode connect finalize ifname devname devpath local device apn auth username password pincode delay mode pdptype profile $PROTO_DEFAULT_OPTIONS json_get_vars device apn auth username password pincode delay mode pdptype profile $PROTO_DEFAULT_OPTIONS @@ -105,9 +105,21 @@ proto_ncm_setup() { return 1 } } + + json_get_values configure configure + echo "Configuring modem" + for i in $configure; do + eval COMMAND="$i" gcom -d "$device" -s /etc/gcom/runcommand.gcom || { + echo "Failed to configure modem" + proto_notify_error "$interface" CONFIGURE_FAILED + return 1 + } + done + [ -n "$mode" ] && { json_select modes json_get_var setmode "$mode" + echo "Setting mode" eval COMMAND="$setmode" gcom -d "$device" -s /etc/gcom/runcommand.gcom || { echo "Failed to set operating mode" proto_notify_error "$interface" SETMODE_FAILED @@ -118,14 +130,16 @@ proto_ncm_setup() { echo "Starting network $interface" json_get_vars connect + echo "Connecting modem" eval COMMAND="$connect" gcom -d "$device" -s /etc/gcom/runcommand.gcom || { echo "Failed to connect" proto_notify_error "$interface" CONNECT_FAILED return 1 } + json_get_vars finalize + echo "Setting up $ifname" - proto_init_update "$ifname" 1 proto_add_data json_add_string "manufacturer" "$manufacturer" @@ -150,6 +164,15 @@ proto_ncm_setup() { proto_add_dynamic_defaults ubus call network add_dynamic "$(json_dump)" } + + [ -n "$finalize" ] && { + eval COMMAND="$finalize" gcom -d "$device" -s /etc/gcom/runcommand.gcom || { + echo "Failed to configure modem" + proto_notify_error "$interface" FINALIZE_FAILED + return 1 + } + } + } proto_ncm_teardown() { diff --git a/package/network/utils/conntrack-tools/Makefile b/package/network/utils/conntrack-tools/Makefile index 128fa9e6f..f04ac69d2 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 6fa10b678..973da3d96 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 5d829547a..17fcf704d 100644 --- a/package/network/utils/curl/Makefile +++ b/package/network/utils/curl/Makefile @@ -8,20 +8,19 @@ include $(TOPDIR)/rules.mk PKG_NAME:=curl -PKG_VERSION:=7.52.1 -PKG_RELEASE:=6 +PKG_VERSION:=7.57.0 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=http://curl.haxx.se/download/ \ - http://www.mirrorspace.org/curl/ \ - ftp://ftp.sunet.se/pub/www/utilities/curl/ \ - ftp://ftp.planetmirror.com/pub/curl/ \ - http://www.mirrormonster.com/curl/download/ \ - http://curl.mirrors.cyberservers.net/download/ -PKG_HASH:=d16185a767cb2c1ba3d5b9096ec54e5ec198b213f45864a38b3bda4bbf87389b +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:=c92fe31a348eae079121b73884065e600c533493eb50f1f6cee9c48a3f454826 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:haxx:libcurl PKG_FIXUP:=autoreconf PKG_BUILD_PARALLEL:=1 @@ -29,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 \ @@ -55,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 \ @@ -86,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 @@ -113,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) \ @@ -121,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/001-curl-https-openssl-fix.patch b/package/network/utils/curl/patches/001-curl-https-openssl-fix.patch deleted file mode 100644 index 9658ef554..000000000 --- a/package/network/utils/curl/patches/001-curl-https-openssl-fix.patch +++ /dev/null @@ -1,34 +0,0 @@ -From a7b38c9dc98481e4a5fc37e51a8690337c674dfb Mon Sep 17 00:00:00 2001 -From: Daniel Stenberg -Date: Mon, 26 Dec 2016 00:06:33 +0100 -Subject: [PATCH] vtls: s/SSLEAY/OPENSSL - -Fixed an old leftover use of the USE_SSLEAY define which would make a -socket get removed from the applications sockets to monitor when the -multi_socket API was used, leading to timeouts. - -Bug: #1174 ---- - lib/vtls/vtls.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/lib/vtls/vtls.c -+++ b/lib/vtls/vtls.c -@@ -484,7 +484,7 @@ void Curl_ssl_close_all(struct Curl_easy - curlssl_close_all(data); - } - --#if defined(USE_SSLEAY) || defined(USE_GNUTLS) || defined(USE_SCHANNEL) || \ -+#if defined(USE_OPENSSL) || defined(USE_GNUTLS) || defined(USE_SCHANNEL) || \ - defined(USE_DARWINSSL) || defined(USE_NSS) - /* This function is for OpenSSL, GnuTLS, darwinssl, and schannel only. */ - int Curl_ssl_getsock(struct connectdata *conn, curl_socket_t *socks, -@@ -518,7 +518,7 @@ int Curl_ssl_getsock(struct connectdata - (void)numsocks; - return GETSOCK_BLANK; - } --/* USE_SSLEAY || USE_GNUTLS || USE_SCHANNEL || USE_DARWINSSL || USE_NSS */ -+/* USE_OPENSSL || USE_GNUTLS || USE_SCHANNEL || USE_DARWINSSL || USE_NSS */ - #endif - - void Curl_ssl_close(struct connectdata *conn, int sockindex) diff --git a/package/network/utils/curl/patches/100-CVE-2017-2629.patch b/package/network/utils/curl/patches/100-CVE-2017-2629.patch deleted file mode 100644 index f2cd869c5..000000000 --- a/package/network/utils/curl/patches/100-CVE-2017-2629.patch +++ /dev/null @@ -1,33 +0,0 @@ -From a00a42b4abe8363a46071bb3b43b1b7138f5259b Mon Sep 17 00:00:00 2001 -From: Daniel Stenberg -Date: Sun, 22 Jan 2017 18:11:55 +0100 -Subject: [PATCH] TLS: make SSL_VERIFYSTATUS work again - -The CURLOPT_SSL_VERIFYSTATUS option was not properly handled by libcurl -and thus even if the status couldn't be verified, the connection would -be allowed and the user would not be told about the failed verification. - -Regression since cb4e2be7c6d42ca - -CVE-2017-2629 -Bug: https://curl.haxx.se/docs/adv_20170222.html - -Reported-by: Marcus Hoffmann ---- - lib/url.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/lib/url.c -+++ b/lib/url.c -@@ -4141,8 +4141,11 @@ static struct connectdata *allocate_conn - conn->bits.ftp_use_epsv = data->set.ftp_use_epsv; - conn->bits.ftp_use_eprt = data->set.ftp_use_eprt; - -+ conn->ssl_config.verifystatus = data->set.ssl.primary.verifystatus; - conn->ssl_config.verifypeer = data->set.ssl.primary.verifypeer; - conn->ssl_config.verifyhost = data->set.ssl.primary.verifyhost; -+ conn->proxy_ssl_config.verifystatus = -+ data->set.proxy_ssl.primary.verifystatus; - conn->proxy_ssl_config.verifypeer = data->set.proxy_ssl.primary.verifypeer; - conn->proxy_ssl_config.verifyhost = data->set.proxy_ssl.primary.verifyhost; - diff --git a/package/network/utils/curl/patches/101-CVE-2017-7407.patch b/package/network/utils/curl/patches/101-CVE-2017-7407.patch deleted file mode 100644 index ba8097b0e..000000000 --- a/package/network/utils/curl/patches/101-CVE-2017-7407.patch +++ /dev/null @@ -1,165 +0,0 @@ -From 6019f1795b4e3b72507b84b0e02dc8c32024f562 Mon Sep 17 00:00:00 2001 -From: Dan Fandrich -Date: Sat, 11 Mar 2017 10:59:34 +0100 -Subject: [PATCH] CVE-2017-7407: fixed - -Bug: https://curl.haxx.se/docs/adv_20170403.html - -Reported-by: Brian Carpenter ---- - src/tool_writeout.c | 6 +++--- - tests/data/Makefile.inc | 2 +- - tests/data/test1440 | 31 +++++++++++++++++++++++++++++++ - tests/data/test1441 | 31 +++++++++++++++++++++++++++++++ - tests/data/test1442 | 35 +++++++++++++++++++++++++++++++++++ - 5 files changed, 101 insertions(+), 4 deletions(-) - create mode 100644 tests/data/test1440 - create mode 100644 tests/data/test1441 - create mode 100644 tests/data/test1442 - ---- a/src/tool_writeout.c -+++ b/src/tool_writeout.c -@@ -5,7 +5,7 @@ - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * -- * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al. -+ * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms -@@ -113,7 +113,7 @@ void ourWriteOut(CURL *curl, struct OutS - double doubleinfo; - - while(ptr && *ptr) { -- if('%' == *ptr) { -+ if('%' == *ptr && ptr[1]) { - if('%' == ptr[1]) { - /* an escaped %-letter */ - fputc('%', stream); -@@ -341,7 +341,7 @@ void ourWriteOut(CURL *curl, struct OutS - } - } - } -- else if('\\' == *ptr) { -+ else if('\\' == *ptr && ptr[1]) { - switch(ptr[1]) { - case 'r': - fputc('\r', stream); ---- a/tests/data/Makefile.inc -+++ b/tests/data/Makefile.inc -@@ -150,7 +150,7 @@ test1408 test1409 test1410 test1411 test - test1416 test1417 test1418 test1419 test1420 test1421 test1422 test1423 \ - test1424 \ - test1428 test1429 test1430 test1431 test1432 test1433 test1434 test1435 \ --test1436 test1437 test1438 test1439 \ -+test1436 test1437 test1438 test1439 test1440 test1441 test1442 \ - \ - test1500 test1501 test1502 test1503 test1504 test1505 test1506 test1507 \ - test1508 test1509 test1510 test1511 test1512 test1513 test1514 test1515 \ ---- /dev/null -+++ b/tests/data/test1440 -@@ -0,0 +1,31 @@ -+ -+ -+ -+--write-out -+ -+ -+# Server-side -+ -+ -+ -+# Client-side -+ -+ -+file -+ -+ -+ -+Check --write-out with trailing %{ -+ -+ -+file://localhost/%PWD/log/ --write-out '%{' -+ -+ -+ -+# Verify data -+ -+ -+%{ -+ -+ -+ ---- /dev/null -+++ b/tests/data/test1441 -@@ -0,0 +1,31 @@ -+ -+ -+ -+--write-out -+ -+ -+# Server-side -+ -+ -+ -+# Client-side -+ -+ -+file -+ -+ -+ -+Check --write-out with trailing % -+ -+ -+file://localhost/%PWD/log/ --write-out '%' -+ -+ -+ -+# Verify data -+ -+ -+% -+ -+ -+ ---- /dev/null -+++ b/tests/data/test1442 -@@ -0,0 +1,35 @@ -+ -+ -+ -+--write-out -+FILE -+ -+ -+# Server-side -+ -+ -+ -+# Client-side -+ -+ -+file -+ -+ -+ -+Check --write-out with trailing \ -+ -+ -+file://localhost/%PWD/log/non-existent-file.txt --write-out '\' -+ -+ -+ -+# Verify data -+ -+ -+37 -+ -+ -+\ -+ -+ -+ diff --git a/package/network/utils/curl/patches/102-CVE-2017-7468.patch b/package/network/utils/curl/patches/102-CVE-2017-7468.patch deleted file mode 100644 index 72f51455d..000000000 --- a/package/network/utils/curl/patches/102-CVE-2017-7468.patch +++ /dev/null @@ -1,264 +0,0 @@ -From 8166b637bce299f4ac64d371c20cd5afea72c364 Mon Sep 17 00:00:00 2001 -From: Jay Satiro -Date: Wed, 22 Mar 2017 01:59:49 -0400 -Subject: [PATCH] TLS: Fix switching off SSL session id when client cert is - used - -- Move the sessionid flag to ssl_primary_config so that ssl and - proxy_ssl will each have their own sessionid flag. - -Regression since HTTPS-Proxy support was added in cb4e2be. Prior to that -this issue had been fixed in 247d890, CVE-2016-5419. - -Bug: https://github.com/curl/curl/issues/1341 -Reported-by: lijian996@users.noreply.github.com ---- - lib/url.c | 5 +++-- - lib/urldata.h | 2 +- - lib/vtls/axtls.c | 4 ++-- - lib/vtls/cyassl.c | 4 ++-- - lib/vtls/darwinssl.c | 2 +- - lib/vtls/gtls.c | 4 ++-- - lib/vtls/mbedtls.c | 4 ++-- - lib/vtls/nss.c | 2 +- - lib/vtls/openssl.c | 4 ++-- - lib/vtls/polarssl.c | 4 ++-- - lib/vtls/schannel.c | 4 ++-- - lib/vtls/vtls.c | 9 ++++++--- - 12 files changed, 26 insertions(+), 22 deletions(-) - ---- a/lib/url.c -+++ b/lib/url.c -@@ -548,7 +548,7 @@ CURLcode Curl_init_userdefined(struct Us - #endif - set->ssh_auth_types = CURLSSH_AUTH_DEFAULT; /* defaults to any auth - type */ -- set->general_ssl.sessionid = TRUE; /* session ID caching enabled by -+ set->ssl.primary.sessionid = TRUE; /* session ID caching enabled by - default */ - set->proxy_ssl = set->ssl; - -@@ -2470,8 +2470,9 @@ CURLcode Curl_setopt(struct Curl_easy *d - break; - - case CURLOPT_SSL_SESSIONID_CACHE: -- data->set.general_ssl.sessionid = (0 != va_arg(param, long)) ? -+ data->set.ssl.primary.sessionid = (0 != va_arg(param, long)) ? - TRUE : FALSE; -+ data->set.proxy_ssl.primary.sessionid = data->set.ssl.primary.sessionid; - break; - - #ifdef USE_LIBSSH2 ---- a/lib/urldata.h -+++ b/lib/urldata.h -@@ -354,6 +354,7 @@ struct ssl_primary_config { - char *random_file; /* path to file containing "random" data */ - char *egdsocket; /* path to file containing the EGD daemon socket */ - char *cipher_list; /* list of ciphers to use */ -+ bool sessionid; /* cache session IDs or not */ - }; - - struct ssl_config_data { -@@ -383,7 +384,6 @@ struct ssl_config_data { - }; - - struct ssl_general_config { -- bool sessionid; /* cache session IDs or not */ - size_t max_ssl_sessions; /* SSL session id cache size */ - }; - ---- a/lib/vtls/axtls.c -+++ b/lib/vtls/axtls.c -@@ -256,7 +256,7 @@ static CURLcode connect_prep(struct conn - * 2) setting up callbacks. these seem gnutls specific - */ - -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - const uint8_t *ssl_sessionid; - size_t ssl_idsize; - -@@ -386,7 +386,7 @@ static CURLcode connect_finish(struct co - conn->send[sockindex] = axtls_send; - - /* Put our freshly minted SSL session in cache */ -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - const uint8_t *ssl_sessionid = ssl_get_session_id_size(ssl); - size_t ssl_idsize = ssl_get_session_id(ssl); - Curl_ssl_sessionid_lock(conn); ---- a/lib/vtls/cyassl.c -+++ b/lib/vtls/cyassl.c -@@ -383,7 +383,7 @@ cyassl_connect_step1(struct connectdata - #endif /* HAVE_ALPN */ - - /* Check if there's a cached ID we can/should use here! */ -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - void *ssl_sessionid = NULL; - - Curl_ssl_sessionid_lock(conn); -@@ -597,7 +597,7 @@ cyassl_connect_step3(struct connectdata - - DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); - -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - bool incache; - SSL_SESSION *our_ssl_sessionid; - void *old_ssl_sessionid = NULL; ---- a/lib/vtls/darwinssl.c -+++ b/lib/vtls/darwinssl.c -@@ -1541,7 +1541,7 @@ static CURLcode darwinssl_connect_step1( - #endif /* CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7 */ - - /* Check if there's a cached ID we can/should use here! */ -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - char *ssl_sessionid; - size_t ssl_sessionid_len; - ---- a/lib/vtls/gtls.c -+++ b/lib/vtls/gtls.c -@@ -782,7 +782,7 @@ gtls_connect_step1(struct connectdata *c - - /* This might be a reconnect, so we check for a session ID in the cache - to speed up things */ -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - void *ssl_sessionid; - size_t ssl_idsize; - -@@ -1311,7 +1311,7 @@ gtls_connect_step3(struct connectdata *c - conn->recv[sockindex] = gtls_recv; - conn->send[sockindex] = gtls_send; - -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - /* we always unconditionally get the session id here, as even if we - already got it from the cache and asked to use it in the connection, it - might've been rejected and then a new one is in use now and we need to ---- a/lib/vtls/mbedtls.c -+++ b/lib/vtls/mbedtls.c -@@ -374,7 +374,7 @@ mbed_connect_step1(struct connectdata *c - mbedtls_ssl_list_ciphersuites()); - - /* Check if there's a cached ID we can/should use here! */ -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - void *old_session = NULL; - - Curl_ssl_sessionid_lock(conn); -@@ -618,7 +618,7 @@ mbed_connect_step3(struct connectdata *c - - DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); - -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - int ret; - mbedtls_ssl_session *our_ssl_sessionid; - void *old_ssl_sessionid = NULL; ---- a/lib/vtls/nss.c -+++ b/lib/vtls/nss.c -@@ -1696,7 +1696,7 @@ static CURLcode nss_setup_connect(struct - goto error; - - /* do not use SSL cache if disabled or we are not going to verify peer */ -- ssl_no_cache = (data->set.general_ssl.sessionid -+ ssl_no_cache = (SSL_SET_OPTION(primary.sessionid) - && SSL_CONN_CONFIG(verifypeer)) ? PR_FALSE : PR_TRUE; - if(SSL_OptionSet(model, SSL_NO_CACHE, ssl_no_cache) != SECSuccess) - goto error; ---- a/lib/vtls/openssl.c -+++ b/lib/vtls/openssl.c -@@ -2161,7 +2161,7 @@ static CURLcode ossl_connect_step1(struc - #endif - - /* Check if there's a cached ID we can/should use here! */ -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - void *ssl_sessionid = NULL; - - Curl_ssl_sessionid_lock(conn); -@@ -2915,7 +2915,7 @@ static CURLcode ossl_connect_step3(struc - - DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); - -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - bool incache; - SSL_SESSION *our_ssl_sessionid; - void *old_ssl_sessionid = NULL; ---- a/lib/vtls/polarssl.c -+++ b/lib/vtls/polarssl.c -@@ -327,7 +327,7 @@ polarssl_connect_step1(struct connectdat - ssl_set_ciphersuites(&connssl->ssl, ssl_list_ciphersuites()); - - /* Check if there's a cached ID we can/should use here! */ -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - void *old_session = NULL; - - Curl_ssl_sessionid_lock(conn); -@@ -555,7 +555,7 @@ polarssl_connect_step3(struct connectdat - - DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); - -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - int ret; - ssl_session *our_ssl_sessionid; - void *old_ssl_sessionid = NULL; ---- a/lib/vtls/schannel.c -+++ b/lib/vtls/schannel.c -@@ -145,7 +145,7 @@ schannel_connect_step1(struct connectdat - connssl->cred = NULL; - - /* check for an existing re-usable credential handle */ -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - Curl_ssl_sessionid_lock(conn); - if(!Curl_ssl_getsessionid(conn, (void **)&old_cred, NULL, sockindex)) { - connssl->cred = old_cred; -@@ -714,7 +714,7 @@ schannel_connect_step3(struct connectdat - #endif - - /* save the current session data for possible re-use */ -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - bool incache; - struct curl_schannel_cred *old_cred = NULL; - ---- a/lib/vtls/vtls.c -+++ b/lib/vtls/vtls.c -@@ -120,6 +120,9 @@ Curl_clone_primary_ssl_config(struct ssl - CLONE_STRING(egdsocket); - CLONE_STRING(random_file); - CLONE_STRING(clientcert); -+ -+ /* Disable dest sessionid cache if a client cert is used, CVE-2016-5419. */ -+ dest->sessionid = (dest->clientcert ? false : source->sessionid); - return TRUE; - } - -@@ -293,9 +296,9 @@ bool Curl_ssl_getsessionid(struct connec - int port = isProxy ? (int)conn->port : conn->remote_port; - *ssl_sessionid = NULL; - -- DEBUGASSERT(data->set.general_ssl.sessionid); -+ DEBUGASSERT(SSL_SET_OPTION(primary.sessionid)); - -- if(!data->set.general_ssl.sessionid) -+ if(!SSL_SET_OPTION(primary.sessionid)) - /* session ID re-use is disabled */ - return TRUE; - -@@ -397,7 +400,7 @@ CURLcode Curl_ssl_addsessionid(struct co - &conn->proxy_ssl_config : - &conn->ssl_config; - -- DEBUGASSERT(data->set.general_ssl.sessionid); -+ DEBUGASSERT(SSL_SET_OPTION(primary.sessionid)); - - clone_host = strdup(isProxy ? conn->http_proxy.host.name : conn->host.name); - if(!clone_host) diff --git a/package/network/utils/curl/patches/103-CVE-2017-1000100.patch b/package/network/utils/curl/patches/103-CVE-2017-1000100.patch deleted file mode 100644 index 93ab97bd1..000000000 --- a/package/network/utils/curl/patches/103-CVE-2017-1000100.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 358b2b131ad6c095696f20dcfa62b8305263f898 Mon Sep 17 00:00:00 2001 -From: Daniel Stenberg -Date: Tue, 1 Aug 2017 17:16:46 +0200 -Subject: [PATCH] tftp: reject file name lengths that don't fit - -... and thereby avoid telling send() to send off more bytes than the -size of the buffer! - -CVE-2017-1000100 - -Bug: https://curl.haxx.se/docs/adv_20170809B.html -Reported-by: Even Rouault - -Credit to OSS-Fuzz for the discovery ---- - lib/tftp.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - ---- a/lib/tftp.c -+++ b/lib/tftp.c -@@ -5,7 +5,7 @@ - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * -- * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al. -+ * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms -@@ -490,6 +490,11 @@ static CURLcode tftp_send_first(tftp_sta - if(result) - return result; - -+ if(strlen(filename) > (state->blksize - strlen(mode) - 4)) { -+ failf(data, "TFTP file name too long\n"); -+ return CURLE_TFTP_ILLEGAL; /* too long file name field */ -+ } -+ - snprintf((char *)state->spacket.data+2, - state->blksize, - "%s%c%s%c", filename, '\0', mode, '\0'); diff --git a/package/network/utils/curl/patches/104-CVE-2017-1000101.patch b/package/network/utils/curl/patches/104-CVE-2017-1000101.patch deleted file mode 100644 index 835b73eef..000000000 --- a/package/network/utils/curl/patches/104-CVE-2017-1000101.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 453e7a7a03a2cec749abd3878a48e728c515cca7 Mon Sep 17 00:00:00 2001 -From: Daniel Stenberg -Date: Tue, 1 Aug 2017 17:16:07 +0200 -Subject: [PATCH] glob: do not continue parsing after a strtoul() overflow - range - -Added test 1289 to verify. - -CVE-2017-1000101 - -Bug: https://curl.haxx.se/docs/adv_20170809A.html -Reported-by: Brian Carpenter ---- - src/tool_urlglob.c | 5 ++++- - tests/data/Makefile.inc | 2 +- - tests/data/test1289 | 35 +++++++++++++++++++++++++++++++++++ - 3 files changed, 40 insertions(+), 2 deletions(-) - create mode 100644 tests/data/test1289 - ---- a/src/tool_urlglob.c -+++ b/src/tool_urlglob.c -@@ -272,7 +272,10 @@ static CURLcode glob_range(URLGlob *glob - } - errno = 0; - max_n = strtoul(pattern, &endp, 10); -- if(errno || (*endp == ':')) { -+ if(errno) -+ /* overflow */ -+ endp = NULL; -+ else if(*endp == ':') { - pattern = endp+1; - errno = 0; - step_n = strtoul(pattern, &endp, 10); diff --git a/package/network/utils/curl/patches/105-CVE-2017-8816.patch b/package/network/utils/curl/patches/105-CVE-2017-8816.patch deleted file mode 100644 index 4d2b3162a..000000000 --- a/package/network/utils/curl/patches/105-CVE-2017-8816.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 7947c50bcd09cf471c95511739bc66d2cb506ee2 Mon Sep 17 00:00:00 2001 -From: Daniel Stenberg -Date: Mon, 6 Nov 2017 23:51:52 +0100 -Subject: [PATCH] ntlm: avoid integer overflow for malloc size - -Reported-by: Alex Nichols -Assisted-by: Kamil Dudka and Max Dymond - -CVE-2017-8816 - -Bug: https://curl.haxx.se/docs/adv_2017-11e7.html ---- - lib/curl_ntlm_core.c | 23 +++++++++++++++++++++-- - 1 file changed, 21 insertions(+), 2 deletions(-) - -diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c -index 1309bf0d9..e8962769c 100644 ---- a/lib/curl_ntlm_core.c -+++ b/lib/curl_ntlm_core.c -@@ -616,23 +616,42 @@ CURLcode Curl_hmac_md5(const unsigned char *key, unsigned int keylen, - Curl_HMAC_final(ctxt, output); - - return CURLE_OK; - } - -+#ifndef SIZE_T_MAX -+/* some limits.h headers have this defined, some don't */ -+#if defined(_LP64) || defined(_I32LPx) -+#define SIZE_T_MAX 18446744073709551615U -+#else -+#define SIZE_T_MAX 4294967295U -+#endif -+#endif -+ - /* This creates the NTLMv2 hash by using NTLM hash as the key and Unicode - * (uppercase UserName + Domain) as the data - */ - CURLcode Curl_ntlm_core_mk_ntlmv2_hash(const char *user, size_t userlen, - const char *domain, size_t domlen, - unsigned char *ntlmhash, - unsigned char *ntlmv2hash) - { - /* Unicode representation */ -- size_t identity_len = (userlen + domlen) * 2; -- unsigned char *identity = malloc(identity_len); -+ size_t identity_len; -+ unsigned char *identity; - CURLcode result = CURLE_OK; - -+ /* we do the length checks below separately to avoid integer overflow risk -+ on extreme data lengths */ -+ if((userlen > SIZE_T_MAX/2) || -+ (domlen > SIZE_T_MAX/2) || -+ ((userlen + domlen) > SIZE_T_MAX/2)) -+ return CURLE_OUT_OF_MEMORY; -+ -+ identity_len = (userlen + domlen) * 2; -+ identity = malloc(identity_len); -+ - if(!identity) - return CURLE_OUT_OF_MEMORY; - - ascii_uppercase_to_unicode_le(identity, user, userlen); - ascii_to_unicode_le(identity + (userlen << 1), domain, domlen); --- -2.15.0 - diff --git a/package/network/utils/curl/patches/106-CVE-2017-8817.patch b/package/network/utils/curl/patches/106-CVE-2017-8817.patch deleted file mode 100644 index 9e904f0b4..000000000 --- a/package/network/utils/curl/patches/106-CVE-2017-8817.patch +++ /dev/null @@ -1,141 +0,0 @@ -From 0acc0c7c120afa6d60bfc7932c04361720b6e74d Mon Sep 17 00:00:00 2001 -From: Daniel Stenberg -Date: Fri, 10 Nov 2017 08:52:45 +0100 -Subject: [PATCH] wildcardmatch: fix heap buffer overflow in setcharset - -The code would previous read beyond the end of the pattern string if the -match pattern ends with an open bracket when the default pattern -matching function is used. - -Detected by OSS-Fuzz: -https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4161 - -CVE-2017-8817 - -Bug: https://curl.haxx.se/docs/adv_2017-ae72.html ---- - lib/curl_fnmatch.c | 9 +++------ - tests/data/Makefile.inc | 2 +- - tests/data/test1163 | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 56 insertions(+), 7 deletions(-) - create mode 100644 tests/data/test1163 - -diff --git a/lib/curl_fnmatch.c b/lib/curl_fnmatch.c -index da83393b4..8a1e106c4 100644 ---- a/lib/curl_fnmatch.c -+++ b/lib/curl_fnmatch.c -@@ -131,10 +131,13 @@ static int setcharset(unsigned char **p, unsigned char *charset) - unsigned char lastchar = 0; - bool something_found = FALSE; - unsigned char c; - for(;;) { - c = **p; -+ if(!c) -+ return SETCHARSET_FAIL; -+ - switch(state) { - case CURLFNM_SCHS_DEFAULT: - if(ISALNUM(c)) { /* ASCII value */ - rangestart = c; - charset[c] = 1; -@@ -195,13 +198,10 @@ static int setcharset(unsigned char **p, unsigned char *charset) - (*p)++; - } - else - return SETCHARSET_FAIL; - } -- else if(c == '\0') { -- return SETCHARSET_FAIL; -- } - else { - charset[c] = 1; - (*p)++; - something_found = TRUE; - } -@@ -276,13 +276,10 @@ static int setcharset(unsigned char **p, unsigned char *charset) - (*p)++; - } - else if(c == ']') { - return SETCHARSET_OK; - } -- else if(c == '\0') { -- return SETCHARSET_FAIL; -- } - else if(ISPRINT(c)) { - charset[c] = 1; - (*p)++; - state = CURLFNM_SCHS_DEFAULT; - } -diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc -index dc1cc03bc..6eb37d81d 100644 ---- a/tests/data/Makefile.inc.1 2017-11-29 20:00:26.126452486 +0000 -+++ b/tests/data/Makefile.inc 2017-11-29 20:01:13.057783732 +0000 -@@ -121,6 +121,7 @@ - test1128 test1129 test1130 test1131 test1132 test1133 test1134 test1135 \ - test1136 test1137 test1138 test1139 test1140 test1141 test1142 test1143 \ - test1144 \ -+test1163 \ - test1200 test1201 test1202 test1203 test1204 test1205 test1206 test1207 \ - test1208 test1209 test1210 test1211 test1212 test1213 test1214 test1215 \ - test1216 test1217 test1218 test1219 \ -diff --git a/tests/data/test1163 b/tests/data/test1163 -new file mode 100644 -index 000000000..a109b511b ---- /dev/null -+++ b/tests/data/test1163 -@@ -0,0 +1,52 @@ -+ -+ -+ -+FTP -+RETR -+LIST -+wildcardmatch -+ftplistparser -+flaky -+ -+ -+ -+# -+# Server-side -+ -+ -+ -+ -+ -+# Client-side -+ -+ -+ftp -+ -+ -+lib576 -+ -+ -+FTP wildcard with pattern ending with an open-bracket -+ -+ -+"ftp://%HOSTIP:%FTPPORT/fully_simulated/DOS/*[][" -+ -+ -+ -+ -+USER anonymous -+PASS ftp@example.com -+PWD -+CWD fully_simulated -+CWD DOS -+EPSV -+TYPE A -+LIST -+QUIT -+ -+# 78 == CURLE_REMOTE_FILE_NOT_FOUND -+ -+78 -+ -+ -+ --- -2.15.0 - 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 139c05e64..a2a685125 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 -@@ -153,7 +153,7 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) +@@ -156,7 +156,7 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) bin_SCRIPTS = curl-config - SUBDIRS = lib src include --DIST_SUBDIRS = $(SUBDIRS) tests packages docs scripts -+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 ---- a/Makefile.in -+++ b/Makefile.in -@@ -613,7 +613,7 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) +@@ -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/libcurl && $(MAKE) install ++ #cd docs && $(MAKE) install ++ #cd docs/libcurl && $(MAKE) install - bin_SCRIPTS = curl-config - SUBDIRS = lib src include --DIST_SUBDIRS = $(SUBDIRS) tests packages docs scripts -+DIST_SUBDIRS = $(SUBDIRS) packages - pkgconfigdir = $(libdir)/pkgconfig - pkgconfig_DATA = libcurl.pc - LIB_VAUTH_CFILES = vauth/vauth.c vauth/cleartext.c vauth/cram.c \ + # 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 22b838daa..aabf274ac 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 -@@ -724,7 +724,7 @@ void Curl_mbedtls_session_free(void *ptr +@@ -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 da7b7416a..693b4d8f0 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 ea8f02631..2f420a2e2 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 56782ea52..a64d7396a 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.1.4 +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:=db61d70ac62003ebe0bf15496bd8c4b3c4b728578a44d0a1a88fcf8afc0e8f76 +PKG_HASH:=6f596271251056bffc11bbb8f17d4244ad9a7d4a317c2459fdbb853ae51284d8 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause @@ -21,18 +21,40 @@ PKG_LICENSE:=BSD-3-Clause PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf + include $(INCLUDE_DIR)/package.mk -define Package/iperf3 +DISABLE_NLS:= + +define Package/iperf3/default SECTION:=net CATEGORY:=Network TITLE:=Internet Protocol bandwidth measuring tool URL:=https://github.com/esnet/iperf endef +define Package/iperf3 +$(call Package/iperf3/default) + VARIANT:=nossl +endef + +define Package/iperf3-ssl +$(call Package/iperf3/default) + TITLE+= with iperf_auth support + VARIANT:=ssl + DEPENDS:= +libopenssl +endef + TARGET_CFLAGS += -D_GNU_SOURCE CONFIGURE_ARGS += --disable-shared +ifeq ($(BUILD_VARIANT),ssl) + CONFIGURE_ARGS += --with-openssl="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS += --without-openssl +endif + MAKE_FLAGS += noinst_PROGRAMS= define Package/iperf3/description @@ -41,9 +63,21 @@ define Package/iperf3/description characteristics. endef +# autoreconf fails if the README file isn't present +define Build/Prepare + $(call Build/Prepare/Default) + touch $(PKG_BUILD_DIR)/README +endef + define Package/iperf3/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/iperf3 $(1)/usr/bin/ endef +define Package/iperf3-ssl/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/iperf3 $(1)/usr/bin/ +endef + $(eval $(call BuildPackage,iperf3)) +$(eval $(call BuildPackage,iperf3-ssl)) 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 000000000..d617ba9f4 --- /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/iproute2/Makefile b/package/network/utils/iproute2/Makefile index 1f566f0c4..5f718748d 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -8,87 +8,122 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iproute2 -PKG_VERSION:=4.4.0 -PKG_RELEASE:=10 +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:=bc91c367288a19f78ef800cd6840363be1f22da8436fbae88e1a7250490d6514 +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 - TITLE:=Routing control utility ($(2)) SECTION:=net CATEGORY:=Network URL:=http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2 SUBMENU:=Routing and Redirection MAINTAINER:=Russell Senior - DEPENDS:= +libnl-tiny - VARIANT:=$(1) - PROVIDES:=$(3) endef define Package/ip-tiny -$(call Package/iproute2/Default,tiny,Minimal,ip) - CONFLICTS:=ip-full +$(call Package/iproute2/Default) + TITLE:=Routing control utility (Minimal) + VARIANT:=tiny + PROVIDES:=ip + ALTERNATIVES:=200:/sbin/ip:/sbin/ip-tiny + DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef -Package/ip-full:=$(call Package/iproute2/Default,full,Full,ip) +define Package/ip-full +$(call Package/iproute2/Default) + TITLE:=Routing control utility (Full) + 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 +$(call Package/iproute2/Default) + TITLE:=Network devlink utility + 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 -TARGET_CFLAGS += -DHAVE_SETNS TARGET_CFLAGS += -ffunction-sections -fdata-sections MAKE_FLAGS += \ - EXTRA_CCOPTS="$(TARGET_CFLAGS) -I../include -I$(STAGING_DIR)/usr/include/libnl-tiny" \ + EXTRA_CCOPTS="-I$(STAGING_DIR)/usr/include/libnl-tiny" \ KERNEL_INCLUDE="$(LINUX_DIR)/include" \ 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)" define Build/Compile @@ -103,13 +138,13 @@ define Build/InstallDev endef define Package/ip-tiny/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/sbin/ip-tiny endef define Package/ip-full/install - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/sbin/ip-full endef define Package/tc/install @@ -139,6 +174,16 @@ define Package/nstat/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc/nstat $(1)/usr/sbin/ endef +define Package/devlink/install + $(INSTALL_DIR) $(1)/usr/sbin + $(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)) @@ -146,3 +191,5 @@ $(eval $(call BuildPackage,genl)) $(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 ece865299..7f23cfc35 100644 --- a/package/network/utils/iproute2/patches/001-config.patch +++ b/package/network/utils/iproute2/patches/001-config.patch @@ -2,6 +2,6 @@ +++ b/Config @@ -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_ACTION_GACT=y -+TC_CONFIG_ACTION_PROB=y ++TC_CONFIG_XT:=y diff --git a/package/network/utils/iproute2/patches/004-darwin_fixes.patch b/package/network/utils/iproute2/patches/004-darwin_fixes.patch index e1a5e9756..1f3eb101e 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 6805468d8..e23fbcd77 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 -@@ -470,7 +470,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) -@@ -1341,7 +1340,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 94fb197a4..ac216ba82 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 fce16e02d..2e088f199 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 -@@ -41,7 +41,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 man -+SUBDIRS=lib ip tc bridge misc genl tipc 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 000000000..7a5a70223 --- /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/010-type_fixes.patch b/package/network/utils/iproute2/patches/010-type_fixes.patch deleted file mode 100644 index e0055fce7..000000000 --- a/package/network/utils/iproute2/patches/010-type_fixes.patch +++ /dev/null @@ -1,396 +0,0 @@ ---- a/include/iptables_common.h -+++ b/include/iptables_common.h -@@ -2,6 +2,8 @@ - #define _IPTABLES_COMMON_H - /* Shared definitions between ipv4 and ipv6. */ - -+#include -+ - enum exittype { - OTHER_PROBLEM = 1, - PARAMETER_PROBLEM, -@@ -43,9 +45,9 @@ extern char *lib_dir; - extern void init_extensions(void); - #endif - --#define __be32 u_int32_t --#define __le32 u_int32_t --#define __be16 u_int16_t --#define __le16 u_int16_t -+#define __be32 uint32_t -+#define __le32 uint32_t -+#define __be16 uint16_t -+#define __le16 uint16_t - - #endif /*_IPTABLES_COMMON_H*/ ---- a/include/netinet/tcp.h -+++ /dev/null -@@ -1,231 +0,0 @@ --/* -- * Copyright (c) 1982, 1986, 1993 -- * The Regents of the University of California. 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. -- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. -- * -- * @(#)tcp.h 8.1 (Berkeley) 6/10/93 -- */ -- --#ifndef _NETINET_TCP_H --#define _NETINET_TCP_H 1 -- --#include -- --/* -- * User-settable options (used with setsockopt). -- */ --#define TCP_NODELAY 1 /* Don't delay send to coalesce packets */ --#define TCP_MAXSEG 2 /* Set maximum segment size */ --#define TCP_CORK 3 /* Control sending of partial frames */ --#define TCP_KEEPIDLE 4 /* Start keeplives after this period */ --#define TCP_KEEPINTVL 5 /* Interval between keepalives */ --#define TCP_KEEPCNT 6 /* Number of keepalives before death */ --#define TCP_SYNCNT 7 /* Number of SYN retransmits */ --#define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */ --#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */ --#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */ --#define TCP_INFO 11 /* Information about this connection. */ --#define TCP_QUICKACK 12 /* Bock/reenable quick ACKs. */ --#define TCP_CONGESTION 13 /* Congestion control algorithm. */ -- --#ifdef __USE_MISC --# include -- --# ifdef __FAVOR_BSD --typedef u_int32_t tcp_seq; --/* -- * TCP header. -- * Per RFC 793, September, 1981. -- */ --struct tcphdr -- { -- u_int16_t th_sport; /* source port */ -- u_int16_t th_dport; /* destination port */ -- tcp_seq th_seq; /* sequence number */ -- tcp_seq th_ack; /* acknowledgement number */ --# if __BYTE_ORDER == __LITTLE_ENDIAN -- u_int8_t th_x2:4; /* (unused) */ -- u_int8_t th_off:4; /* data offset */ --# endif --# if __BYTE_ORDER == __BIG_ENDIAN -- u_int8_t th_off:4; /* data offset */ -- u_int8_t th_x2:4; /* (unused) */ --# endif -- u_int8_t th_flags; --# define TH_FIN 0x01 --# define TH_SYN 0x02 --# define TH_RST 0x04 --# define TH_PUSH 0x08 --# define TH_ACK 0x10 --# define TH_URG 0x20 -- u_int16_t th_win; /* window */ -- u_int16_t th_sum; /* checksum */ -- u_int16_t th_urp; /* urgent pointer */ --}; -- --# else /* !__FAVOR_BSD */ --struct tcphdr -- { -- u_int16_t source; -- u_int16_t dest; -- u_int32_t seq; -- u_int32_t ack_seq; --# if __BYTE_ORDER == __LITTLE_ENDIAN -- u_int16_t res1:4; -- u_int16_t doff:4; -- u_int16_t fin:1; -- u_int16_t syn:1; -- u_int16_t rst:1; -- u_int16_t psh:1; -- u_int16_t ack:1; -- u_int16_t urg:1; -- u_int16_t res2:2; --# elif __BYTE_ORDER == __BIG_ENDIAN -- u_int16_t doff:4; -- u_int16_t res1:4; -- u_int16_t res2:2; -- u_int16_t urg:1; -- u_int16_t ack:1; -- u_int16_t psh:1; -- u_int16_t rst:1; -- u_int16_t syn:1; -- u_int16_t fin:1; --# else --# error "Adjust your defines" --# endif -- u_int16_t window; -- u_int16_t check; -- u_int16_t urg_ptr; --}; --# endif /* __FAVOR_BSD */ -- --enum --{ -- TCP_ESTABLISHED = 1, -- TCP_SYN_SENT, -- TCP_SYN_RECV, -- TCP_FIN_WAIT1, -- TCP_FIN_WAIT2, -- TCP_TIME_WAIT, -- TCP_CLOSE, -- TCP_CLOSE_WAIT, -- TCP_LAST_ACK, -- TCP_LISTEN, -- TCP_CLOSING /* now a valid state */ --}; -- --# define TCPOPT_EOL 0 --# define TCPOPT_NOP 1 --# define TCPOPT_MAXSEG 2 --# define TCPOLEN_MAXSEG 4 --# define TCPOPT_WINDOW 3 --# define TCPOLEN_WINDOW 3 --# define TCPOPT_SACK_PERMITTED 4 /* Experimental */ --# define TCPOLEN_SACK_PERMITTED 2 --# define TCPOPT_SACK 5 /* Experimental */ --# define TCPOPT_TIMESTAMP 8 --# define TCPOLEN_TIMESTAMP 10 --# define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */ -- --# define TCPOPT_TSTAMP_HDR \ -- (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) -- --/* -- * Default maximum segment size for TCP. -- * With an IP MSS of 576, this is 536, -- * but 512 is probably more convenient. -- * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)). -- */ --# define TCP_MSS 512 -- --# define TCP_MAXWIN 65535 /* largest value for (unscaled) window */ -- --# define TCP_MAX_WINSHIFT 14 /* maximum window shift */ -- --# define SOL_TCP 6 /* TCP level */ -- -- --# define TCPI_OPT_TIMESTAMPS 1 --# define TCPI_OPT_SACK 2 --# define TCPI_OPT_WSCALE 4 --# define TCPI_OPT_ECN 8 --# define TCPI_OPT_ECN_SEEN 16 -- --/* Values for tcpi_state. */ --enum tcp_ca_state --{ -- TCP_CA_Open = 0, -- TCP_CA_Disorder = 1, -- TCP_CA_CWR = 2, -- TCP_CA_Recovery = 3, -- TCP_CA_Loss = 4 --}; -- --struct tcp_info --{ -- u_int8_t tcpi_state; -- u_int8_t tcpi_ca_state; -- u_int8_t tcpi_retransmits; -- u_int8_t tcpi_probes; -- u_int8_t tcpi_backoff; -- u_int8_t tcpi_options; -- u_int8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4; -- -- u_int32_t tcpi_rto; -- u_int32_t tcpi_ato; -- u_int32_t tcpi_snd_mss; -- u_int32_t tcpi_rcv_mss; -- -- u_int32_t tcpi_unacked; -- u_int32_t tcpi_sacked; -- u_int32_t tcpi_lost; -- u_int32_t tcpi_retrans; -- u_int32_t tcpi_fackets; -- -- /* Times. */ -- u_int32_t tcpi_last_data_sent; -- u_int32_t tcpi_last_ack_sent; /* Not remembered, sorry. */ -- u_int32_t tcpi_last_data_recv; -- u_int32_t tcpi_last_ack_recv; -- -- /* Metrics. */ -- u_int32_t tcpi_pmtu; -- u_int32_t tcpi_rcv_ssthresh; -- u_int32_t tcpi_rtt; -- u_int32_t tcpi_rttvar; -- u_int32_t tcpi_snd_ssthresh; -- u_int32_t tcpi_snd_cwnd; -- u_int32_t tcpi_advmss; -- u_int32_t tcpi_reordering; -- u_int32_t tcpi_rcv_rtt; -- u_int32_t tcpi_rcv_space; -- u_int32_t tcpi_total_retrans; -- --}; -- --#endif /* Misc. */ -- --#endif /* netinet/tcp.h */ ---- a/include/iptables.h -+++ b/include/iptables.h -@@ -20,7 +20,7 @@ struct ipt_get_revision - { - char name[IPT_FUNCTION_MAXNAMELEN-1]; - -- u_int8_t revision; -+ uint8_t revision; - }; - #endif /* IPT_SO_GET_REVISION_MATCH Old kernel source */ - -@@ -39,7 +39,7 @@ struct iptables_match - ipt_chainlabel name; - - /* Revision of match (0 by default). */ -- u_int8_t revision; -+ uint8_t revision; - - const char *version; - -@@ -92,7 +92,7 @@ struct iptables_target - ipt_chainlabel name; - - /* Revision of target (0 by default). */ -- u_int8_t revision; -+ uint8_t revision; - - const char *version; - -@@ -153,7 +153,7 @@ extern char *mask_to_dotted(const struct - - extern void parse_hostnetworkmask(const char *name, struct in_addr **addrpp, - struct in_addr *maskp, unsigned int *naddrs); --extern u_int16_t parse_protocol(const char *s); -+extern uint16_t parse_protocol(const char *s); - - extern int do_command(int argc, char *argv[], char **table, - iptc_handle_t *handle); ---- a/lib/dnet_ntop.c -+++ b/lib/dnet_ntop.c -@@ -1,24 +1,25 @@ - #include - #include -+#include - #include - #include - - #include "utils.h" - --static __inline__ u_int16_t dn_ntohs(u_int16_t addr) -+static __inline__ uint16_t dn_ntohs(uint16_t addr) - { - union { -- u_int8_t byte[2]; -- u_int16_t word; -+ uint8_t byte[2]; -+ uint16_t word; - } u; - - u.word = addr; -- return ((u_int16_t)u.byte[0]) | (((u_int16_t)u.byte[1]) << 8); -+ return ((uint16_t)u.byte[0]) | (((uint16_t)u.byte[1]) << 8); - } - --static __inline__ int do_digit(char *str, u_int16_t *addr, u_int16_t scale, size_t *pos, size_t len, int *started) -+static __inline__ int do_digit(char *str, uint16_t *addr, uint16_t scale, size_t *pos, size_t len, int *started) - { -- u_int16_t tmp = *addr / scale; -+ uint16_t tmp = *addr / scale; - - if (*pos == len) - return 1; -@@ -36,7 +37,7 @@ static __inline__ int do_digit(char *str - - static const char *dnet_ntop1(const struct dn_naddr *dna, char *str, size_t len) - { -- u_int16_t addr, area; -+ uint16_t addr, area; - size_t pos = 0; - int started = 0; - ---- a/lib/dnet_pton.c -+++ b/lib/dnet_pton.c -@@ -1,23 +1,24 @@ - #include - #include -+#include - #include - #include - - #include "utils.h" - --static __inline__ u_int16_t dn_htons(u_int16_t addr) -+static __inline__ uint16_t dn_htons(uint16_t addr) - { - union { -- u_int8_t byte[2]; -- u_int16_t word; -+ uint8_t byte[2]; -+ uint16_t word; - } u; - - u.word = addr; -- return ((u_int16_t)u.byte[0]) | (((u_int16_t)u.byte[1]) << 8); -+ return ((uint16_t)u.byte[0]) | (((uint16_t)u.byte[1]) << 8); - } - - --static int dnet_num(const char *src, u_int16_t * dst) -+static int dnet_num(const char *src, uint16_t * dst) - { - int rv = 0; - int tmp; -@@ -38,9 +39,9 @@ static int dnet_num(const char *src, u_i - - static int dnet_pton1(const char *src, struct dn_naddr *dna) - { -- u_int16_t addr; -- u_int16_t area = 0; -- u_int16_t node = 0; -+ uint16_t addr; -+ uint16_t area = 0; -+ uint16_t node = 0; - int pos; - - pos = dnet_num(src, &area); ---- a/include/libiptc/ipt_kernel_headers.h -+++ b/include/libiptc/ipt_kernel_headers.h -@@ -5,7 +5,7 @@ - - #include - --#if defined(__GLIBC__) && __GLIBC__ == 2 -+#if 1 - #include - #include - #include diff --git a/package/network/utils/iproute2/patches/100-allow_pfifo_fast.patch b/package/network/utils/iproute2/patches/100-allow_pfifo_fast.patch index ce958a934..caf889e12 100644 --- a/package/network/utils/iproute2/patches/100-allow_pfifo_fast.patch +++ b/package/network/utils/iproute2/patches/100-allow_pfifo_fast.patch @@ -1,6 +1,6 @@ --- a/tc/q_fifo.c +++ b/tc/q_fifo.c -@@ -98,5 +98,6 @@ struct qdisc_util pfifo_head_drop_qdisc_ +@@ -97,5 +97,6 @@ struct qdisc_util pfifo_head_drop_qdisc_ extern int prio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt); struct qdisc_util pfifo_fast_qdisc_util = { .id = "pfifo_fast", diff --git a/package/network/utils/iproute2/patches/110-extra-ccopts.patch b/package/network/utils/iproute2/patches/110-extra-ccopts.patch index 3cb5a7940..e779934d7 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 -@@ -34,7 +34,7 @@ HOSTCC = gcc +@@ -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 1f397f71b..83ce66d97 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/130-missing_include.patch b/package/network/utils/iproute2/patches/130-missing_include.patch deleted file mode 100644 index 8759a6259..000000000 --- a/package/network/utils/iproute2/patches/130-missing_include.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/lib/namespace.c -+++ b/lib/namespace.c -@@ -10,6 +10,7 @@ - #include - #include - #include -+#include - - #include "utils.h" - #include "namespace.h" ---- a/lib/rt_names.c -+++ b/lib/rt_names.c -@@ -18,6 +18,7 @@ - #include - #include - #include -+#include - - #include - #include 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 new file mode 100644 index 000000000..e3364ad05 --- /dev/null +++ b/package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch @@ -0,0 +1,107 @@ +From f972afc2509eebcb00d370256c55b112a3b5ffca Mon Sep 17 00:00:00 2001 +From: David Heidelberger +Date: Mon, 29 Jun 2015 16:50:40 +0200 +Subject: [PATCH 2/3] 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 _LIBC_COMPAT_H + #define _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 /* _LIBC_COMPAT_H */ 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 new file mode 100644 index 000000000..abd1f7eac --- /dev/null +++ b/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch @@ -0,0 +1,67 @@ +From fcbb6fed85ea9ff4feb4f1ebd4f0f235fdaf06b6 Mon Sep 17 00:00:00 2001 +From: David Heidelberger +Date: Mon, 29 Jun 2015 16:53:03 +0200 +Subject: [PATCH 3/3] 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 _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 /* _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/package/network/utils/iproute2/patches/300-ip_tiny.patch b/package/network/utils/iproute2/patches/300-ip_tiny.patch index 290adbe5f..35b588f7e 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 -@@ -17,6 +17,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) @@ -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 -@@ -73,30 +73,42 @@ 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 }, @@ -46,6 +63,8 @@ { "l2tp", do_ipl2tp }, { "fou", do_ipfou }, +#endif + { "ila", do_ipila }, + { "macsec", do_ipmacsec }, { "tunnel", do_iptunnel }, { "tunl", do_iptunnel }, +#ifndef IPROUTE2_TINY @@ -65,12 +84,12 @@ +#ifndef IPROUTE2_TINY { "netconf", do_ipnetconf }, +#endif + { "vrf", do_ipvrf}, + { "sr", do_seg6 }, { "help", do_help }, - { 0 } - }; --- a/lib/utils.c +++ b/lib/utils.c -@@ -710,6 +710,7 @@ const char *rt_addr_n2a(int af, int len, +@@ -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); @@ -78,7 +97,7 @@ case AF_IPX: return ipx_ntop(af, addr, buf, buflen); case AF_DECnet: -@@ -718,6 +719,7 @@ const char *rt_addr_n2a(int af, int len, +@@ -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); } @@ -88,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 ff2e0aa1e..1980f8710 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 -@@ -64,6 +64,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 -@@ -210,6 +210,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/910-sanitize_headers_for_musl.patch b/package/network/utils/iproute2/patches/910-sanitize_headers_for_musl.patch deleted file mode 100644 index ca1125d1d..000000000 --- a/package/network/utils/iproute2/patches/910-sanitize_headers_for_musl.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/include/linux/if_bridge.h -+++ b/include/linux/if_bridge.h -@@ -15,7 +15,6 @@ - - #include - #include --#include - - #define SYSFS_BRIDGE_ATTR "bridge" - #define SYSFS_BRIDGE_FDB "brforward" diff --git a/package/network/utils/iproute2/patches/911-fix_in_h_include.patch b/package/network/utils/iproute2/patches/911-fix_in_h_include.patch deleted file mode 100644 index 42a7b24bb..000000000 --- a/package/network/utils/iproute2/patches/911-fix_in_h_include.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- a/include/linux/in.h -+++ b/include/linux/in.h -@@ -15,6 +15,7 @@ - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -+#ifndef _NETINET_IN_H - #ifndef _LINUX_IN_H - #define _LINUX_IN_H - -@@ -297,3 +298,4 @@ struct sockaddr_in { - - - #endif /* _LINUX_IN_H */ -+#endif /* _NETINET_IN_H */ ---- a/include/linux/in6.h -+++ b/include/linux/in6.h -@@ -18,6 +18,7 @@ - * 2 of the License, or (at your option) any later version. - */ - -+#ifndef _NETINET_IN_H - #ifndef _LINUX_IN6_H - #define _LINUX_IN6_H - -@@ -291,3 +292,4 @@ struct in6_flowlabel_req { - * MRT6_MAX - */ - #endif /* _LINUX_IN6_H */ -+#endif /* _NETINET_IN_H */ 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 882db8af1..5e91cd7ed 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 -@@ -850,4 +850,63 @@ 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*/ }; @@ -66,14 +66,14 @@ #endif --- a/tc/Makefile +++ b/tc/Makefile -@@ -63,6 +63,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 +TCMODULES += q_cake.o TCMODULES += q_hhf.o + TCMODULES += q_clsact.o TCMODULES += e_bpf.o - --- /dev/null +++ b/tc/q_cake.c @@ -0,0 +1,771 @@ diff --git a/package/network/utils/iproute2/patches/960-ipmonitor-fix-ip-monitor-can-t-work-when-NET_NS-is-n.patch b/package/network/utils/iproute2/patches/960-ipmonitor-fix-ip-monitor-can-t-work-when-NET_NS-is-n.patch deleted file mode 100644 index 610fb525a..000000000 --- a/package/network/utils/iproute2/patches/960-ipmonitor-fix-ip-monitor-can-t-work-when-NET_NS-is-n.patch +++ /dev/null @@ -1,35 +0,0 @@ -From c44003f7e7254ac972eaa1b22a686471ea4ce2d7 Mon Sep 17 00:00:00 2001 -From: Liping Zhang -Date: Tue, 20 Sep 2016 02:09:02 -0700 -Subject: [PATCH] ipmonitor: fix ip monitor can't work when NET_NS is not - enabled - -In ip monitor, netns_map_init will check getnsid is supported or not. -But when /proc/self/ns/net does not exist, we just print out error -messages and exit. So user cannot use ip monitor anymore when -CONFIG_NET_NS is disabled: - # ip monitor - open("/proc/self/ns/net"): No such file or directory - -If open "/proc/self/ns/net" failed, set have_rtnl_getnsid to false. - -Fixes: d652ccbf8195 ("netns: allow to dump and monitor nsid") -Signed-off-by: Liping Zhang -Acked-by: Nicolas Dichtel ---- - ip/ipnetns.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/ip/ipnetns.c -+++ b/ip/ipnetns.c -@@ -73,8 +73,8 @@ static int ipnetns_have_nsid(void) - - fd = open("/proc/self/ns/net", O_RDONLY); - if (fd < 0) { -- perror("open(\"/proc/self/ns/net\")"); -- exit(1); -+ have_rtnl_getnsid = 0; -+ return 0; - } - - addattr32(&req.n, 1024, NETNSA_FD, fd); diff --git a/package/network/utils/ipset/Makefile b/package/network/utils/ipset/Makefile index f44c1de23..55b7c493d 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_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 @@ -24,7 +24,7 @@ PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk -define Package/ipset +define Package/ipset/Default SECTION:=net CATEGORY:=Network DEPENDS+= +kmod-ipt-ipset +libmnl @@ -32,6 +32,15 @@ define Package/ipset URL:=http://ipset.netfilter.org/ endef +define Package/ipset +$(call Package/ipset/Default) + DEPENDS+= +libipset +endef + +define Package/libipset +$(call Package/ipset/Default) +endef + CONFIGURE_ARGS += \ --with-kbuild="$(LINUX_DIR)" @@ -39,10 +48,6 @@ MAKE_FLAGS += \ ARCH="$(LINUX_KARCH)" \ SHELL="$(BASH)" -define Build/Compile - $(call Build/Compile/Default) -endef - define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig $(CP) $(PKG_INSTALL_DIR)/usr/include/libipset $(1)/usr/include/ @@ -53,8 +58,12 @@ endef define Package/ipset/install $(INSTALL_DIR) $(1)/usr/sbin $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ipset $(1)/usr/sbin/ +endef + +define Package/libipset/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libipset*.so* $(1)/usr/lib/ endef $(eval $(call BuildPackage,ipset)) +$(eval $(call BuildPackage,libipset)) 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 000000000..745e9fa3b --- /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 bf1a792c0..e09c35c69 100644 --- a/package/network/utils/iptables/Makefile +++ b/package/network/utils/iptables/Makefile @@ -9,20 +9,20 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=iptables -PKG_VERSION:=1.4.21 -PKG_RELEASE:=2 +PKG_VERSION:=1.6.1 +PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=http://www.netfilter.org/projects/iptables/files \ - ftp://ftp.be.netfilter.org/pub/netfilter/iptables/ \ - ftp://ftp.de.netfilter.org/pub/netfilter/iptables/ \ - ftp://ftp.no.netfilter.org/pub/netfilter/iptables/ -PKG_HASH:=52004c68021da9a599feed27f65defcfb22128f7da2c0531c0f75de0f479d3e0 +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://git.netfilter.org/iptables +PKG_SOURCE_VERSION:=7df66f1c13563cfbab75246b009ce36f69ee4487 +PKG_MIRROR_HASH:=22f15ef41fd8e3724bedcee666b7b6a3491d2d038d580ef1fb032718dcb73f14 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),) @@ -51,6 +51,20 @@ $(call Package/iptables/Default) DEPENDS+= +kmod-ipt-core +libip4tc +IPV6:libip6tc +libxtables endef +define Package/iptables/config + config IPTABLES_CONNLABEL + bool "Enable Connlabel support" + default n + help + This enable connlabel support in iptables. + + config IPTABLES_NFTABLES + bool "Enable Nftables support" + default n + help + This enable nftables support in iptables. +endef + define Package/iptables/description IP firewall administration tool. @@ -203,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 @@ -368,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 @@ -402,6 +439,7 @@ $(call Package/iptables/Default) SECTION:=libs CATEGORY:=Libraries DEPENDS:=+libip4tc +libip6tc +libxtables + ABI_VERSION:=$(PKG_VERSION) TITLE:=IPv4/IPv6 firewall - shared libiptc library (compatibility stub) endef @@ -410,6 +448,7 @@ $(call Package/iptables/Default) SECTION:=libs CATEGORY:=Libraries TITLE:=IPv4 firewall - shared libiptc library + ABI_VERSION:=$(PKG_VERSION) DEPENDS:=+libxtables endef @@ -418,6 +457,7 @@ $(call Package/iptables/Default) SECTION:=libs CATEGORY:=Libraries TITLE:=IPv6 firewall - shared libiptc library + ABI_VERSION:=$(PKG_VERSION) DEPENDS:=+libxtables endef @@ -426,6 +466,10 @@ define Package/libxtables SECTION:=libs CATEGORY:=Libraries TITLE:=IPv4/IPv6 firewall - shared xtables library + ABI_VERSION:=$(PKG_VERSION) + DEPENDS:= \ + +IPTABLES_CONNLABEL:libnetfilter-conntrack \ + +IPTABLES_NFTABLES:libnftnl endef TARGET_CPPFLAGS := \ @@ -444,10 +488,12 @@ TARGET_LDFLAGS += \ CONFIGURE_ARGS += \ --enable-shared \ + --enable-static \ --enable-devel \ --with-kernel="$(LINUX_DIR)/user_headers" \ --with-xtlibdir=/usr/lib/iptables \ - --enable-static \ + $(if $(CONFIG_IPTABLES_CONNLABEL),,--disable-connlabel) \ + $(if $(CONFIG_IPTABLES_NFTABLES),,--disable-nftables) \ $(if $(CONFIG_IPV6),,--disable-ipv6) MAKE_FLAGS := \ @@ -562,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/020-iptables-disable-modprobe.patch b/package/network/utils/iptables/patches/020-iptables-disable-modprobe.patch index 2b6c57ec9..4add4ea5f 100644 --- a/package/network/utils/iptables/patches/020-iptables-disable-modprobe.patch +++ b/package/network/utils/iptables/patches/020-iptables-disable-modprobe.patch @@ -1,6 +1,6 @@ --- a/libxtables/xtables.c +++ b/libxtables/xtables.c -@@ -336,6 +336,7 @@ static char *get_modprobe(void) +@@ -355,6 +355,7 @@ static char *get_modprobe(void) int xtables_insmod(const char *modname, const char *modprobe, bool quiet) { @@ -8,7 +8,7 @@ char *buf = NULL; char *argv[4]; int status; -@@ -380,6 +381,7 @@ int xtables_insmod(const char *modname, +@@ -395,6 +396,7 @@ int xtables_insmod(const char *modname, free(buf); if (WIFEXITED(status) && WEXITSTATUS(status) == 0) return 0; diff --git a/package/network/utils/iptables/patches/030-no-libnfnetlink.patch b/package/network/utils/iptables/patches/030-no-libnfnetlink.patch deleted file mode 100644 index 50542ac0b..000000000 --- a/package/network/utils/iptables/patches/030-no-libnfnetlink.patch +++ /dev/null @@ -1,94 +0,0 @@ ---- a/configure -+++ b/configure -@@ -12367,77 +12367,7 @@ fi - fi - - --pkg_failed=no --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libnfnetlink" >&5 --$as_echo_n "checking for libnfnetlink... " >&6; } -- --if test -n "$libnfnetlink_CFLAGS"; then -- pkg_cv_libnfnetlink_CFLAGS="$libnfnetlink_CFLAGS" -- elif test -n "$PKG_CONFIG"; then -- if test -n "$PKG_CONFIG" && \ -- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnfnetlink >= 1.0\""; } >&5 -- ($PKG_CONFIG --exists --print-errors "libnfnetlink >= 1.0") 2>&5 -- ac_status=$? -- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -- test $ac_status = 0; }; then -- pkg_cv_libnfnetlink_CFLAGS=`$PKG_CONFIG --cflags "libnfnetlink >= 1.0" 2>/dev/null` -- test "x$?" != "x0" && pkg_failed=yes --else -- pkg_failed=yes --fi -- else -- pkg_failed=untried --fi --if test -n "$libnfnetlink_LIBS"; then -- pkg_cv_libnfnetlink_LIBS="$libnfnetlink_LIBS" -- elif test -n "$PKG_CONFIG"; then -- if test -n "$PKG_CONFIG" && \ -- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnfnetlink >= 1.0\""; } >&5 -- ($PKG_CONFIG --exists --print-errors "libnfnetlink >= 1.0") 2>&5 -- ac_status=$? -- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -- test $ac_status = 0; }; then -- pkg_cv_libnfnetlink_LIBS=`$PKG_CONFIG --libs "libnfnetlink >= 1.0" 2>/dev/null` -- test "x$?" != "x0" && pkg_failed=yes --else -- pkg_failed=yes --fi -- else -- pkg_failed=untried --fi -- -- -- --if test $pkg_failed = yes; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } -- --if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then -- _pkg_short_errors_supported=yes --else -- _pkg_short_errors_supported=no --fi -- if test $_pkg_short_errors_supported = yes; then -- libnfnetlink_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libnfnetlink >= 1.0" 2>&1` -- else -- libnfnetlink_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libnfnetlink >= 1.0" 2>&1` -- fi -- # Put the nasty error message in config.log where it belongs -- echo "$libnfnetlink_PKG_ERRORS" >&5 -- -- nfnetlink=0 --elif test $pkg_failed = untried; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } -- nfnetlink=0 --else -- libnfnetlink_CFLAGS=$pkg_cv_libnfnetlink_CFLAGS -- libnfnetlink_LIBS=$pkg_cv_libnfnetlink_LIBS -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 --$as_echo "yes" >&6; } -- nfnetlink=1 --fi -- if test "$nfnetlink" = 1; then -+if false; then - HAVE_LIBNFNETLINK_TRUE= - HAVE_LIBNFNETLINK_FALSE='#' - else ---- a/configure.ac -+++ b/configure.ac -@@ -111,9 +111,7 @@ if test "x$enable_bpfc" = "xyes" || test - AC_CHECK_LIB(pcap, pcap_compile,, AC_MSG_ERROR(missing libpcap library required by bpf compiler or nfsynproxy tool)) - fi - --PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0], -- [nfnetlink=1], [nfnetlink=0]) --AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1]) -+AM_CONDITIONAL([HAVE_LIBNFNETLINK], [false]) - - regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \ - -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \ diff --git a/package/network/utils/iptables/patches/050-optional-xml.patch b/package/network/utils/iptables/patches/050-optional-xml.patch index 11311ddb4..b782bbf13 100644 --- a/package/network/utils/iptables/patches/050-optional-xml.patch +++ b/package/network/utils/iptables/patches/050-optional-xml.patch @@ -1,6 +1,6 @@ --- a/iptables/xtables-multi.c +++ b/iptables/xtables-multi.c -@@ -22,8 +22,10 @@ static const struct subcommand multi_sub +@@ -26,8 +26,10 @@ static const struct subcommand multi_sub {"iptables-restore", iptables_restore_main}, {"restore4", iptables_restore_main}, #endif diff --git a/package/network/utils/iptables/patches/100-bash-location.patch b/package/network/utils/iptables/patches/100-bash-location.patch deleted file mode 100644 index 02ee45ba1..000000000 --- a/package/network/utils/iptables/patches/100-bash-location.patch +++ /dev/null @@ -1,8 +0,0 @@ ---- a/iptables/iptables-apply -+++ b/iptables/iptables-apply -@@ -1,4 +1,4 @@ --#!/bin/bash -+#!/usr/bin/env bash - # - # iptables-apply -- a safer way to update iptables remotely - # diff --git a/package/network/utils/iptables/patches/200-configurable_builtin.patch b/package/network/utils/iptables/patches/200-configurable_builtin.patch index d35bc5a85..9c53c2bfe 100644 --- a/package/network/utils/iptables/patches/200-configurable_builtin.patch +++ b/package/network/utils/iptables/patches/200-configurable_builtin.patch @@ -1,58 +1,75 @@ --- a/extensions/GNUmakefile.in +++ b/extensions/GNUmakefile.in -@@ -45,9 +45,24 @@ pfx_symlinks := NOTRACK state - pfx_build_mod := $(filter-out @blacklist_modules@,${pfx_build_mod}) - pf4_build_mod := $(filter-out @blacklist_modules@,${pf4_build_mod}) - pf6_build_mod := $(filter-out @blacklist_modules@,${pf6_build_mod}) +@@ -50,11 +50,31 @@ pfb_build_mod := $(filter-out @blacklist + pfa_build_mod := $(filter-out @blacklist_modules@ @blacklist_a_modules@,${pfa_build_mod}) + pf4_build_mod := $(filter-out @blacklist_modules@ @blacklist_4_modules@,${pf4_build_mod}) + pf6_build_mod := $(filter-out @blacklist_modules@ @blacklist_6_modules@,${pf6_build_mod}) -pfx_objs := $(patsubst %,libxt_%.o,${pfx_build_mod}) +-pfb_objs := $(patsubst %,libebt_%.o,${pfb_build_mod}) +-pfa_objs := $(patsubst %,libarpt_%.o,${pfa_build_mod}) -pf4_objs := $(patsubst %,libipt_%.o,${pf4_build_mod}) -pf6_objs := $(patsubst %,libip6t_%.o,${pf6_build_mod}) -+ +ifdef BUILTIN_MODULES +pfx_build_static := $(filter $(BUILTIN_MODULES),${pfx_build_mod}) ++pfb_build_static := $(filter $(BUILTIN_MODULES),${pfb_build_mod}) ++pfa_build_static := $(filter $(BUILTIN_MODULES),${pfa_build_mod}) +pf4_build_static := $(filter $(BUILTIN_MODULES),${pf4_build_mod}) +pf6_build_static := $(filter $(BUILTIN_MODULES),${pf6_build_mod}) +else +@ENABLE_STATIC_TRUE@ pfx_build_static := $(pfx_build_mod) ++@ENABLE_STATIC_TRUE@ pfb_build_static := $(pfb_build_mod) ++@ENABLE_STATIC_TRUE@ pfa_build_static := $(pfa_build_mod) +@ENABLE_STATIC_TRUE@ pf4_build_static := $(pf4_build_mod) +@ENABLE_STATIC_TRUE@ pf6_build_static := $(pf6_build_mod) +endif + +pfx_build_mod := $(filter-out $(pfx_build_static),$(pfx_build_mod)) ++pfb_build_mod := $(filter-out $(pfb_build_static),$(pfb_build_mod)) ++pfa_build_mod := $(filter-out $(pfa_build_static),$(pfa_build_mod)) +pf4_build_mod := $(filter-out $(pf4_build_static),$(pf4_build_mod)) +pf6_build_mod := $(filter-out $(pf6_build_static),$(pf6_build_mod)) + +pfx_objs := $(patsubst %,libxt_%.o,${pfx_build_static}) ++pfb_objs := $(patsubst %,libebt_%.o,${pfb_build_static}) ++pfa_objs := $(patsubst %,libarpt_%.o,${pfa_build_static}) +pf4_objs := $(patsubst %,libipt_%.o,${pf4_build_static}) +pf6_objs := $(patsubst %,libip6t_%.o,${pf6_build_static}) pfx_solibs := $(patsubst %,libxt_%.so,${pfx_build_mod} ${pfx_symlinks}) - pf4_solibs := $(patsubst %,libipt_%.so,${pf4_build_mod}) - pf6_solibs := $(patsubst %,libip6t_%.so,${pf6_build_mod}) -@@ -58,11 +73,11 @@ pf6_solibs := $(patsubst %,libip6t_%. + pfb_solibs := $(patsubst %,libebt_%.so,${pfb_build_mod}) + pfa_solibs := $(patsubst %,libarpt_%.so,${pfa_build_mod}) +@@ -67,13 +87,13 @@ pf6_solibs := $(patsubst %,libip6t_%. # - targets := libext.a libext4.a libext6.a matches.man targets.man + targets := libext.a libext4.a libext6.a libext_ebt.a libext_arpt.a matches.man targets.man targets_install := -@ENABLE_STATIC_TRUE@ libext_objs := ${pfx_objs} +-@ENABLE_STATIC_TRUE@ libext_ebt_objs := ${pfb_objs} +-@ENABLE_STATIC_TRUE@ libext_arpt_objs := ${pfa_objs} -@ENABLE_STATIC_TRUE@ libext4_objs := ${pf4_objs} -@ENABLE_STATIC_TRUE@ libext6_objs := ${pf6_objs} --@ENABLE_STATIC_FALSE@ targets += ${pfx_solibs} ${pf4_solibs} ${pf6_solibs} --@ENABLE_STATIC_FALSE@ targets_install += ${pfx_solibs} ${pf4_solibs} ${pf6_solibs} +-@ENABLE_STATIC_FALSE@ targets += ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs} +-@ENABLE_STATIC_FALSE@ targets_install += ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs} +libext_objs := ${pfx_objs} ++libext_ebt_objs := ${pfb_objs} ++libext_arpt_objs := ${pfa_objs} +libext4_objs := ${pf4_objs} +libext6_objs := ${pf6_objs} -+targets += ${pfx_solibs} ${pf4_solibs} ${pf6_solibs} -+targets_install := $(strip ${targets_install} ${pfx_solibs} ${pf4_solibs} ${pf6_solibs}) ++targets += ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs} ++targets_install := $(strip ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs}) .SECONDARY: -@@ -126,9 +141,9 @@ libext4.a: initext4.o ${libext4_objs} +@@ -141,11 +161,11 @@ libext4.a: initext4.o ${libext4_objs} libext6.a: initext6.o ${libext6_objs} ${AM_VERBOSE_AR} ${AR} crs $@ $^; -initext_func := $(addprefix xt_,${pfx_build_mod}) +-initextb_func := $(addprefix ebt_,${pfb_build_mod}) +-initexta_func := $(addprefix arpt_,${pfa_build_mod}) -initext4_func := $(addprefix ipt_,${pf4_build_mod}) -initext6_func := $(addprefix ip6t_,${pf6_build_mod}) +initext_func := $(addprefix xt_,${pfx_build_static}) ++initextb_func := $(addprefix ebt_,${pfb_build_static}) ++initexta_func := $(addprefix arpt_,${pfa_build_static}) +initext4_func := $(addprefix ipt_,${pf4_build_static}) +initext6_func := $(addprefix ip6t_,${pf6_build_static}) diff --git a/package/network/utils/iptables/patches/300-musl_fixes.patch b/package/network/utils/iptables/patches/300-musl_fixes.patch deleted file mode 100644 index a78eda775..000000000 --- a/package/network/utils/iptables/patches/300-musl_fixes.patch +++ /dev/null @@ -1,127 +0,0 @@ ---- a/extensions/libip6t_ipv6header.c -+++ b/extensions/libip6t_ipv6header.c -@@ -10,6 +10,9 @@ on whether they contain certain headers - #include - #include - #include -+#ifndef IPPROTO_HOPOPTS -+# define IPPROTO_HOPOPTS 0 -+#endif - - enum { - O_HEADER = 0, ---- a/extensions/libxt_TCPOPTSTRIP.c -+++ b/extensions/libxt_TCPOPTSTRIP.c -@@ -12,6 +12,21 @@ - #ifndef TCPOPT_MD5SIG - # define TCPOPT_MD5SIG 19 - #endif -+#ifndef TCPOPT_MAXSEG -+# define TCPOPT_MAXSEG 2 -+#endif -+#ifndef TCPOPT_WINDOW -+# define TCPOPT_WINDOW 3 -+#endif -+#ifndef TCPOPT_SACK_PERMITTED -+# define TCPOPT_SACK_PERMITTED 4 -+#endif -+#ifndef TCPOPT_SACK -+# define TCPOPT_SACK 5 -+#endif -+#ifndef TCPOPT_TIMESTAMP -+# define TCPOPT_TIMESTAMP 8 -+#endif - - enum { - O_STRIP_OPTION = 0, ---- a/include/libiptc/ipt_kernel_headers.h -+++ b/include/libiptc/ipt_kernel_headers.h -@@ -5,7 +5,6 @@ - - #include - --#if defined(__GLIBC__) && __GLIBC__ == 2 - #include - #include - #include -@@ -13,15 +12,4 @@ - #include - #include - #include --#else /* libc5 */ --#include --#include --#include --#include --#include --#include --#include --#include --#include --#endif - #endif ---- a/include/linux/netfilter_ipv4/ip_tables.h -+++ b/include/linux/netfilter_ipv4/ip_tables.h -@@ -16,6 +16,7 @@ - #define _IPTABLES_H - - #include -+#include - - #include - ---- a/iptables/ip6tables-restore.c -+++ b/iptables/ip6tables-restore.c -@@ -9,7 +9,7 @@ - */ - - #include --#include -+#include - #include - #include - #include ---- a/iptables/ip6tables-save.c -+++ b/iptables/ip6tables-save.c -@@ -6,7 +6,7 @@ - * This code is distributed under the terms of GNU GPL v2 - */ - #include --#include -+#include - #include - #include - #include ---- a/iptables/iptables-restore.c -+++ b/iptables/iptables-restore.c -@@ -6,7 +6,7 @@ - */ - - #include --#include -+#include - #include - #include - #include ---- a/iptables/iptables-save.c -+++ b/iptables/iptables-save.c -@@ -6,7 +6,7 @@ - * - */ - #include --#include -+#include - #include - #include - #include ---- a/iptables/iptables-xml.c -+++ b/iptables/iptables-xml.c -@@ -7,7 +7,7 @@ - */ - - #include --#include -+#include - #include - #include - #include diff --git a/package/network/utils/iptables/patches/600-shared-libext.patch b/package/network/utils/iptables/patches/600-shared-libext.patch index 92f548539..a906d4060 100644 --- a/package/network/utils/iptables/patches/600-shared-libext.patch +++ b/package/network/utils/iptables/patches/600-shared-libext.patch @@ -1,17 +1,15 @@ -Index: iptables-1.4.21/extensions/GNUmakefile.in -=================================================================== ---- iptables-1.4.21.orig/extensions/GNUmakefile.in -+++ iptables-1.4.21/extensions/GNUmakefile.in -@@ -71,7 +71,7 @@ pf6_solibs := $(patsubst %,libip6t_%. +--- a/extensions/GNUmakefile.in ++++ b/extensions/GNUmakefile.in +@@ -85,7 +85,7 @@ pf6_solibs := $(patsubst %,libip6t_%. # # Building blocks # --targets := libext.a libext4.a libext6.a matches.man targets.man -+targets := libiptext.so libiptext4.so libiptext6.so matches.man targets.man +-targets := libext.a libext4.a libext6.a libext_ebt.a libext_arpt.a matches.man targets.man ++targets := libiptext.so libiptext4.so libiptext6.so libiptext_ebt.so libiptext_arpt.so matches.man targets.man targets_install := libext_objs := ${pfx_objs} - libext4_objs := ${pf4_objs} -@@ -96,7 +96,7 @@ clean: + libext_ebt_objs := ${pfb_objs} +@@ -112,7 +112,7 @@ clean: distclean: clean init%.o: init%.c @@ -20,7 +18,7 @@ Index: iptables-1.4.21/extensions/GNUmakefile.in -include .*.d -@@ -130,16 +130,16 @@ xt_statistic_LIBADD = -lm +@@ -144,22 +144,22 @@ xt_connlabel_LIBADD = @libnetfilter_conn # handling code in the Makefiles. # lib%.o: ${srcdir}/lib%.c @@ -32,6 +30,16 @@ Index: iptables-1.4.21/extensions/GNUmakefile.in +libiptext.so: initext.o ${libext_objs} + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables ${$*_LIBADD}; +-libext_ebt.a: initextb.o ${libext_ebt_objs} +- ${AM_VERBOSE_AR} ${AR} crs $@ $^; ++libiptext_ebt.so: initextb.o ${libext_ebt_objs} ++ ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables ${$*_LIBADD}; + +-libext_arpt.a: initexta.o ${libext_arpt_objs} +- ${AM_VERBOSE_AR} ${AR} crs $@ $^; ++libiptext_arpt.so: initexta.o ${libext_arpt_objs} ++ ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables ${$*_LIBADD}; + -libext4.a: initext4.o ${libext4_objs} - ${AM_VERBOSE_AR} ${AR} crs $@ $^; +libiptext4.so: initext4.o ${libext4_objs} @@ -43,12 +51,10 @@ Index: iptables-1.4.21/extensions/GNUmakefile.in + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables ${$*_LIBADD}; initext_func := $(addprefix xt_,${pfx_build_static}) - initext4_func := $(addprefix ipt_,${pf4_build_static}) -Index: iptables-1.4.21/iptables/Makefile.am -=================================================================== ---- iptables-1.4.21.orig/iptables/Makefile.am -+++ iptables-1.4.21/iptables/Makefile.am -@@ -5,7 +5,8 @@ AM_CPPFLAGS = ${regular_CPPFLAGS} - + initextb_func := $(addprefix ebt_,${pfb_build_static}) +--- a/iptables/Makefile.am ++++ b/iptables/Makefile.am +@@ -8,7 +8,8 @@ BUILT_SOURCES = xtables_multi_SOURCES = xtables-multi.c iptables-xml.c xtables_multi_CFLAGS = ${AM_CFLAGS} @@ -58,7 +64,7 @@ Index: iptables-1.4.21/iptables/Makefile.am if ENABLE_STATIC xtables_multi_CFLAGS += -DALL_INCLUSIVE endif -@@ -13,13 +14,15 @@ if ENABLE_IPV4 +@@ -16,13 +17,15 @@ if ENABLE_IPV4 xtables_multi_SOURCES += iptables-save.c iptables-restore.c \ iptables-standalone.c iptables.c xtables_multi_CFLAGS += -DENABLE_IPV4 @@ -76,3 +82,23 @@ Index: iptables-1.4.21/iptables/Makefile.am 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/iptables/patches/700-disable-legacy-revisions.patch b/package/network/utils/iptables/patches/700-disable-legacy-revisions.patch index 342c3b013..6800ca5ec 100644 --- a/package/network/utils/iptables/patches/700-disable-legacy-revisions.patch +++ b/package/network/utils/iptables/patches/700-disable-legacy-revisions.patch @@ -1,8 +1,6 @@ -Index: iptables-1.4.21/extensions/libxt_conntrack.c -=================================================================== ---- iptables-1.4.21.orig/extensions/libxt_conntrack.c -+++ iptables-1.4.21/extensions/libxt_conntrack.c -@@ -1157,6 +1157,7 @@ static void state_save(const void *ip, c +--- a/extensions/libxt_conntrack.c ++++ b/extensions/libxt_conntrack.c +@@ -1397,6 +1397,7 @@ static int conntrack3_mt6_xlate(struct x } static struct xtables_match conntrack_mt_reg[] = { @@ -10,7 +8,7 @@ Index: iptables-1.4.21/extensions/libxt_conntrack.c { .version = XTABLES_VERSION, .name = "conntrack", -@@ -1232,6 +1233,7 @@ static struct xtables_match conntrack_mt +@@ -1472,6 +1473,7 @@ static struct xtables_match conntrack_mt .alias = conntrack_print_name_alias, .x6_options = conntrack2_mt_opts, }, @@ -18,31 +16,24 @@ Index: iptables-1.4.21/extensions/libxt_conntrack.c { .version = XTABLES_VERSION, .name = "conntrack", -@@ -1262,6 +1264,7 @@ static struct xtables_match conntrack_mt - .alias = conntrack_print_name_alias, +@@ -1504,6 +1506,7 @@ static struct xtables_match conntrack_mt .x6_options = conntrack3_mt_opts, + .xlate = conntrack3_mt6_xlate, }, +#ifndef NO_LEGACY { .family = NFPROTO_UNSPEC, .name = "state", -@@ -1292,6 +1295,7 @@ static struct xtables_match conntrack_mt +@@ -1534,6 +1537,8 @@ static struct xtables_match conntrack_mt .x6_parse = state_ct23_parse, .x6_options = state_opts, }, +#endif - { - .family = NFPROTO_UNSPEC, - .name = "state", -@@ -1307,6 +1311,7 @@ static struct xtables_match conntrack_mt - .x6_parse = state_ct23_parse, - .x6_options = state_opts, - }, +#ifndef NO_LEGACY { .family = NFPROTO_UNSPEC, .name = "state", -@@ -1320,6 +1325,7 @@ static struct xtables_match conntrack_mt +@@ -1563,6 +1568,7 @@ static struct xtables_match conntrack_mt .x6_parse = state_parse, .x6_options = state_opts, }, @@ -50,11 +41,9 @@ Index: iptables-1.4.21/extensions/libxt_conntrack.c }; void _init(void) -Index: iptables-1.4.21/extensions/libxt_CT.c -=================================================================== ---- iptables-1.4.21.orig/extensions/libxt_CT.c -+++ iptables-1.4.21/extensions/libxt_CT.c -@@ -290,6 +290,7 @@ static void notrack_ct2_tg_init(struct x +--- a/extensions/libxt_CT.c ++++ b/extensions/libxt_CT.c +@@ -349,6 +349,7 @@ static void notrack_ct2_tg_init(struct x } static struct xtables_target ct_target_reg[] = { @@ -62,7 +51,7 @@ Index: iptables-1.4.21/extensions/libxt_CT.c { .family = NFPROTO_UNSPEC, .name = "CT", -@@ -315,6 +316,7 @@ static struct xtables_target ct_target_r +@@ -374,6 +375,7 @@ static struct xtables_target ct_target_r .x6_parse = ct_parse_v1, .x6_options = ct_opts_v1, }, @@ -70,7 +59,7 @@ Index: iptables-1.4.21/extensions/libxt_CT.c { .family = NFPROTO_UNSPEC, .name = "CT", -@@ -329,6 +331,7 @@ static struct xtables_target ct_target_r +@@ -388,6 +390,7 @@ static struct xtables_target ct_target_r .x6_parse = ct_parse_v1, .x6_options = ct_opts_v1, }, @@ -78,7 +67,7 @@ Index: iptables-1.4.21/extensions/libxt_CT.c { .family = NFPROTO_UNSPEC, .name = "NOTRACK", -@@ -366,6 +369,7 @@ static struct xtables_target ct_target_r +@@ -425,6 +428,7 @@ static struct xtables_target ct_target_r .revision = 0, .version = XTABLES_VERSION, }, @@ -86,11 +75,9 @@ Index: iptables-1.4.21/extensions/libxt_CT.c }; void _init(void) -Index: iptables-1.4.21/extensions/libxt_multiport.c -=================================================================== ---- iptables-1.4.21.orig/extensions/libxt_multiport.c -+++ iptables-1.4.21/extensions/libxt_multiport.c -@@ -469,6 +469,7 @@ static void multiport_save6_v1(const voi +--- a/extensions/libxt_multiport.c ++++ b/extensions/libxt_multiport.c +@@ -571,6 +571,7 @@ static int multiport_xlate6_v1(struct xt } static struct xtables_match multiport_mt_reg[] = { @@ -98,9 +85,9 @@ Index: iptables-1.4.21/extensions/libxt_multiport.c { .family = NFPROTO_IPV4, .name = "multiport", -@@ -497,6 +498,7 @@ static struct xtables_match multiport_mt - .save = multiport_save6, +@@ -601,6 +602,7 @@ static struct xtables_match multiport_mt .x6_options = multiport_opts, + .xlate = multiport_xlate6, }, +#endif { diff --git a/package/network/utils/iputils/Makefile b/package/network/utils/iputils/Makefile index b6799e68b..344af07af 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 a578ddc98..9b3c12bec 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/iw/patches/001-nl80211_h_sync.patch b/package/network/utils/iw/patches/001-nl80211_h_sync.patch index 88e47cce8..25ec1263a 100644 --- a/package/network/utils/iw/patches/001-nl80211_h_sync.patch +++ b/package/network/utils/iw/patches/001-nl80211_h_sync.patch @@ -1,6 +1,81 @@ --- a/nl80211.h +++ b/nl80211.h -@@ -323,7 +323,7 @@ +@@ -10,7 +10,7 @@ + * Copyright 2008, 2009 Luis R. Rodriguez + * Copyright 2008 Jouni Malinen + * Copyright 2008 Colin McCabe +- * Copyright 2015 Intel Deutschland GmbH ++ * Copyright 2015-2017 Intel Deutschland GmbH + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above +@@ -173,6 +173,65 @@ + */ + + /** ++ * DOC: WPA/WPA2 EAPOL handshake offload ++ * ++ * By setting @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK flag drivers ++ * can indicate they support offloading EAPOL handshakes for WPA/WPA2 ++ * preshared key authentication. In %NL80211_CMD_CONNECT the preshared ++ * key should be specified using %NL80211_ATTR_PMK. Drivers supporting ++ * this offload may reject the %NL80211_CMD_CONNECT when no preshared ++ * key material is provided, for example when that driver does not ++ * support setting the temporal keys through %CMD_NEW_KEY. ++ * ++ * Similarly @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X flag can be ++ * set by drivers indicating offload support of the PTK/GTK EAPOL ++ * handshakes during 802.1X authentication. In order to use the offload ++ * the %NL80211_CMD_CONNECT should have %NL80211_ATTR_WANT_1X_4WAY_HS ++ * attribute flag. Drivers supporting this offload may reject the ++ * %NL80211_CMD_CONNECT when the attribute flag is not present. ++ * ++ * For 802.1X the PMK or PMK-R0 are set by providing %NL80211_ATTR_PMK ++ * using %NL80211_CMD_SET_PMK. For offloaded FT support also ++ * %NL80211_ATTR_PMKR0_NAME must be provided. ++ */ ++ ++/** ++ * DOC: FILS shared key authentication offload ++ * ++ * FILS shared key authentication offload can be advertized by drivers by ++ * setting @NL80211_EXT_FEATURE_FILS_SK_OFFLOAD flag. The drivers that support ++ * FILS shared key authentication offload should be able to construct the ++ * authentication and association frames for FILS shared key authentication and ++ * eventually do a key derivation as per IEEE 802.11ai. The below additional ++ * parameters should be given to driver in %NL80211_CMD_CONNECT. ++ * %NL80211_ATTR_FILS_ERP_USERNAME - used to construct keyname_nai ++ * %NL80211_ATTR_FILS_ERP_REALM - used to construct keyname_nai ++ * %NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM - used to construct erp message ++ * %NL80211_ATTR_FILS_ERP_RRK - used to generate the rIK and rMSK ++ * rIK should be used to generate an authentication tag on the ERP message and ++ * rMSK should be used to derive a PMKSA. ++ * rIK, rMSK should be generated and keyname_nai, sequence number should be used ++ * as specified in IETF RFC 6696. ++ * ++ * When FILS shared key authentication is completed, driver needs to provide the ++ * below additional parameters to userspace. ++ * %NL80211_ATTR_FILS_KEK - used for key renewal ++ * %NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM - used in further EAP-RP exchanges ++ * %NL80211_ATTR_PMKID - used to identify the PMKSA used/generated ++ * %Nl80211_ATTR_PMK - used to update PMKSA cache in userspace ++ * The PMKSA can be maintained in userspace persistently so that it can be used ++ * later after reboots or wifi turn off/on also. ++ * ++ * %NL80211_ATTR_FILS_CACHE_ID is the cache identifier advertized by a FILS ++ * capable AP supporting PMK caching. It specifies the scope within which the ++ * PMKSAs are cached in an ESS. %NL80211_CMD_SET_PMKSA and ++ * %NL80211_CMD_DEL_PMKSA are enhanced to allow support for PMKSA caching based ++ * on FILS cache identifier. Additionally %NL80211_ATTR_PMK is used with ++ * %NL80211_SET_PMKSA to specify the PMK corresponding to a PMKSA for driver to ++ * use in a FILS shared key connection with PMKSA caching. ++ */ ++ ++/** + * enum nl80211_commands - supported nl80211 commands + * + * @NL80211_CMD_UNSPEC: unspecified command to catch errors +@@ -323,7 +382,7 @@ * @NL80211_CMD_GET_SCAN: get scan results * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the @@ -9,7 +84,56 @@ * specify a BSSID to scan for; if not included, the wildcard BSSID will * be used. * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to -@@ -600,6 +600,20 @@ +@@ -351,7 +410,9 @@ + * are used. Extra IEs can also be passed from the userspace by + * using the %NL80211_ATTR_IE attribute. The first cycle of the + * scheduled scan can be delayed by %NL80211_ATTR_SCHED_SCAN_DELAY +- * is supplied. ++ * is supplied. If the device supports multiple concurrent scheduled ++ * scans, it will allow such when the caller provides the flag attribute ++ * %NL80211_ATTR_SCHED_SCAN_MULTI to indicate user-space support for it. + * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT if + * scheduled scan is not running. The caller may assume that as soon + * as the call returns, it is safe to start a new scheduled scan again. +@@ -370,10 +431,18 @@ + * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to + * NL80211_CMD_GET_SURVEY and on the "scan" multicast group) + * +- * @NL80211_CMD_SET_PMKSA: Add a PMKSA cache entry, using %NL80211_ATTR_MAC +- * (for the BSSID) and %NL80211_ATTR_PMKID. ++ * @NL80211_CMD_SET_PMKSA: Add a PMKSA cache entry using %NL80211_ATTR_MAC ++ * (for the BSSID), %NL80211_ATTR_PMKID, and optionally %NL80211_ATTR_PMK ++ * (PMK is used for PTKSA derivation in case of FILS shared key offload) or ++ * using %NL80211_ATTR_SSID, %NL80211_ATTR_FILS_CACHE_ID, ++ * %NL80211_ATTR_PMKID, and %NL80211_ATTR_PMK in case of FILS ++ * authentication where %NL80211_ATTR_FILS_CACHE_ID is the identifier ++ * advertized by a FILS capable AP identifying the scope of PMKSA in an ++ * ESS. + * @NL80211_CMD_DEL_PMKSA: Delete a PMKSA cache entry, using %NL80211_ATTR_MAC +- * (for the BSSID) and %NL80211_ATTR_PMKID. ++ * (for the BSSID) and %NL80211_ATTR_PMKID or using %NL80211_ATTR_SSID, ++ * %NL80211_ATTR_FILS_CACHE_ID, and %NL80211_ATTR_PMKID in case of FILS ++ * authentication. + * @NL80211_CMD_FLUSH_PMKSA: Flush all PMKSA cache entries. + * + * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain +@@ -500,8 +569,13 @@ + * authentication/association or not receiving a response from the AP. + * Non-zero %NL80211_ATTR_STATUS_CODE value is indicated in that case as + * well to remain backwards compatible. +- * @NL80211_CMD_ROAM: request that the card roam (currently not implemented), +- * sent as an event when the card/driver roamed by itself. ++ * @NL80211_CMD_ROAM: notifcation indicating the card/driver roamed by itself. ++ * When the driver roamed in a network that requires 802.1X authentication, ++ * %NL80211_ATTR_PORT_AUTHORIZED should be set if the 802.1X authentication ++ * was done by the driver or if roaming was done using Fast Transition ++ * protocol (in which case 802.1X authentication is not needed). If ++ * %NL80211_ATTR_PORT_AUTHORIZED is not set, user space is responsible for ++ * the 802.1X authentication. + * @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify + * userspace that a connection was dropped by the AP or due to other + * reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and +@@ -600,6 +674,20 @@ * * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface. * @@ -30,7 +154,45 @@ * @NL80211_CMD_JOIN_MESH: Join a mesh. The mesh ID must be given, and initial * mesh config parameters may be given. * @NL80211_CMD_LEAVE_MESH: Leave the mesh network -- no special arguments, the -@@ -874,6 +888,12 @@ +@@ -840,12 +928,15 @@ + * cfg80211_scan_done(). + * + * @NL80211_CMD_START_NAN: Start NAN operation, identified by its +- * %NL80211_ATTR_WDEV interface. This interface must have been previously +- * created with %NL80211_CMD_NEW_INTERFACE. After it has been started, the +- * NAN interface will create or join a cluster. This command must have a +- * valid %NL80211_ATTR_NAN_MASTER_PREF attribute and optional +- * %NL80211_ATTR_NAN_DUAL attributes. +- * After this command NAN functions can be added. ++ * %NL80211_ATTR_WDEV interface. This interface must have been ++ * previously created with %NL80211_CMD_NEW_INTERFACE. After it ++ * has been started, the NAN interface will create or join a ++ * cluster. This command must have a valid ++ * %NL80211_ATTR_NAN_MASTER_PREF attribute and optional ++ * %NL80211_ATTR_BANDS attributes. If %NL80211_ATTR_BANDS is ++ * omitted or set to 0, it means don't-care and the device will ++ * decide what to use. After this command NAN functions can be ++ * added. + * @NL80211_CMD_STOP_NAN: Stop the NAN operation, identified by + * its %NL80211_ATTR_WDEV interface. + * @NL80211_CMD_ADD_NAN_FUNCTION: Add a NAN function. The function is defined +@@ -866,14 +957,32 @@ + * This command is also used as a notification sent when a NAN function is + * terminated. This will contain a %NL80211_ATTR_NAN_FUNC_INST_ID + * and %NL80211_ATTR_COOKIE attributes. +- * @NL80211_CMD_CHANGE_NAN_CONFIG: Change current NAN configuration. NAN +- * must be operational (%NL80211_CMD_START_NAN was executed). +- * It must contain at least one of the following attributes: +- * %NL80211_ATTR_NAN_MASTER_PREF, %NL80211_ATTR_NAN_DUAL. ++ * @NL80211_CMD_CHANGE_NAN_CONFIG: Change current NAN ++ * configuration. NAN must be operational (%NL80211_CMD_START_NAN ++ * was executed). It must contain at least one of the following ++ * attributes: %NL80211_ATTR_NAN_MASTER_PREF, ++ * %NL80211_ATTR_BANDS. If %NL80211_ATTR_BANDS is omitted, the ++ * current configuration is not changed. If it is present but ++ * set to zero, the configuration is changed to don't-care ++ * (i.e. the device can decide what to do). + * @NL80211_CMD_NAN_FUNC_MATCH: Notification sent when a match is reported. * This will contain a %NL80211_ATTR_NAN_MATCH nested attribute and * %NL80211_ATTR_COOKIE. * @@ -39,22 +201,33 @@ + * BSS selection. This command can be issued only while connected and it + * does not result in a change for the current association. Currently, + * only the %NL80211_ATTR_IE data is used and updated with this command. ++ * ++ * @NL80211_CMD_SET_PMK: For offloaded 4-Way handshake, set the PMK or PMK-R0 ++ * for the given authenticator address (specified with &NL80211_ATTR_MAC). ++ * When &NL80211_ATTR_PMKR0_NAME is set, &NL80211_ATTR_PMK specifies the ++ * PMK-R0, otherwise it specifies the PMK. ++ * @NL80211_CMD_DEL_PMK: For offloaded 4-Way handshake, delete the previously ++ * configured PMK for the authenticator address identified by ++ * &NL80211_ATTR_MAC. + * * @NL80211_CMD_MAX: highest used command number * @__NL80211_CMD_AFTER_LAST: internal use */ -@@ -1069,6 +1089,10 @@ enum nl80211_commands { +@@ -1069,6 +1178,13 @@ enum nl80211_commands { NL80211_CMD_CHANGE_NAN_CONFIG, NL80211_CMD_NAN_MATCH, + NL80211_CMD_SET_MULTICAST_TO_UNICAST, + + NL80211_CMD_UPDATE_CONNECT_PARAMS, ++ ++ NL80211_CMD_SET_PMK, ++ NL80211_CMD_DEL_PMK, + /* add new commands above here */ /* used to define NL80211_CMD_MAX below */ -@@ -1638,8 +1662,16 @@ enum nl80211_commands { +@@ -1638,8 +1754,16 @@ enum nl80211_commands { * the connection request from a station. nl80211_connect_failed_reason * enum has different reasons of connection failure. * @@ -73,7 +246,7 @@ * * @NL80211_ATTR_VHT_CAPABILITY: VHT Capability information element (from * association request when used with NL80211_CMD_NEW_STATION) -@@ -1740,7 +1772,9 @@ enum nl80211_commands { +@@ -1740,7 +1864,9 @@ enum nl80211_commands { * * @NL80211_ATTR_OPMODE_NOTIF: Operating mode field from Operating Mode * Notification Element based on association request when used with @@ -84,16 +257,41 @@ * * @NL80211_ATTR_VENDOR_ID: The vendor ID, either a 24-bit OUI or, if * %NL80211_VENDOR_ID_IS_LINUX is set, a special Linux ID (not used yet) -@@ -1788,6 +1822,8 @@ enum nl80211_commands { - * and remove functions. NAN notifications will be sent in unicast to that - * socket. Without this attribute, any socket can add functions and the - * notifications will be sent to the %NL80211_MCGRP_NAN multicast group. +@@ -1783,11 +1909,12 @@ enum nl80211_commands { + * that configured the indoor setting, and the indoor operation would be + * cleared when the socket is closed. + * If set during NAN interface creation, the interface will be destroyed +- * if the socket is closed just like any other interface. Moreover, only +- * the netlink socket that created the interface will be allowed to add +- * and remove functions. NAN notifications will be sent in unicast to that +- * socket. Without this attribute, any socket can add functions and the +- * notifications will be sent to the %NL80211_MCGRP_NAN multicast group. ++ * if the socket is closed just like any other interface. Moreover, NAN ++ * notifications will be sent in unicast to that socket. Without this ++ * attribute, the notifications will be sent to the %NL80211_MCGRP_NAN ++ * multicast group. + * If set during %NL80211_CMD_ASSOCIATE or %NL80211_CMD_CONNECT the + * station will deauthenticate when the socket is closed. * * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is * the TDLS link initiator. -@@ -1936,6 +1972,38 @@ enum nl80211_commands { +@@ -1927,15 +2054,93 @@ enum nl80211_commands { + * %NL80211_CMD_CHANGE_NAN_CONFIG. Its type is u8 and it can't be 0. + * Also, values 1 and 255 are reserved for certification purposes and + * should not be used during a normal device operation. +- * @NL80211_ATTR_NAN_DUAL: NAN dual band operation config (see +- * &enum nl80211_nan_dual_band_conf). This attribute is used with +- * %NL80211_CMD_START_NAN and optionally with +- * %NL80211_CMD_CHANGE_NAN_CONFIG. ++ * @NL80211_ATTR_BANDS: operating bands configuration. This is a u32 ++ * bitmask of BIT(NL80211_BAND_*) as described in %enum ++ * nl80211_band. For instance, for NL80211_BAND_2GHZ, bit 0 ++ * would be set. This attribute is used with ++ * %NL80211_CMD_START_NAN and %NL80211_CMD_CHANGE_NAN_CONFIG, and ++ * it is optional. If no bands are set, it means don't-care and ++ * the device will decide what to use. + * @NL80211_ATTR_NAN_FUNC: a function that can be added to NAN. See + * &enum nl80211_nan_func_attributes for description of this nested * attribute. * @NL80211_ATTR_NAN_MATCH: used to report a match. This is a nested attribute. * See &enum nl80211_nan_match_attributes. @@ -127,12 +325,55 @@ + * u32 attribute with an &enum nl80211_timeout_reason value. This is used, + * e.g., with %NL80211_CMD_CONNECT event. + * ++ * @NL80211_ATTR_FILS_ERP_USERNAME: EAP Re-authentication Protocol (ERP) ++ * username part of NAI used to refer keys rRK and rIK. This is used with ++ * %NL80211_CMD_CONNECT. ++ * ++ * @NL80211_ATTR_FILS_ERP_REALM: EAP Re-authentication Protocol (ERP) realm part ++ * of NAI specifying the domain name of the ER server. This is used with ++ * %NL80211_CMD_CONNECT. ++ * ++ * @NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM: Unsigned 16-bit ERP next sequence number ++ * to use in ERP messages. This is used in generating the FILS wrapped data ++ * for FILS authentication and is used with %NL80211_CMD_CONNECT. ++ * ++ * @NL80211_ATTR_FILS_ERP_RRK: ERP re-authentication Root Key (rRK) for the ++ * NAI specified by %NL80211_ATTR_FILS_ERP_USERNAME and ++ * %NL80211_ATTR_FILS_ERP_REALM. This is used for generating rIK and rMSK ++ * from successful FILS authentication and is used with ++ * %NL80211_CMD_CONNECT. ++ * ++ * @NL80211_ATTR_FILS_CACHE_ID: A 2-octet identifier advertized by a FILS AP ++ * identifying the scope of PMKSAs. This is used with ++ * @NL80211_CMD_SET_PMKSA and @NL80211_CMD_DEL_PMKSA. ++ * ++ * @NL80211_ATTR_PMK: attribute for passing PMK key material. Used with ++ * %NL80211_CMD_SET_PMKSA for the PMKSA identified by %NL80211_ATTR_PMKID. ++ * For %NL80211_CMD_CONNECT it is used to provide PSK for offloading 4-way ++ * handshake for WPA/WPA2-PSK networks. For 802.1X authentication it is ++ * used with %NL80211_CMD_SET_PMK. For offloaded FT support this attribute ++ * specifies the PMK-R0 if NL80211_ATTR_PMKR0_NAME is included as well. ++ * ++ * @NL80211_ATTR_SCHED_SCAN_MULTI: flag attribute which user-space shall use to ++ * indicate that it supports multiple active scheduled scan requests. ++ * @NL80211_ATTR_SCHED_SCAN_MAX_REQS: indicates maximum number of scheduled ++ * scan request that may be active for the device (u32). ++ * ++ * @NL80211_ATTR_WANT_1X_4WAY_HS: flag attribute which user-space can include ++ * in %NL80211_CMD_CONNECT to indicate that for 802.1X authentication it ++ * wants to use the supported offload of the 4-way handshake. ++ * @NL80211_ATTR_PMKR0_NAME: PMK-R0 Name for offloaded FT. ++ * @NL80211_ATTR_PORT_AUTHORIZED: flag attribute used in %NL80211_CMD_ROAMED ++ * notification indicating that that 802.1X authentication was done by ++ * the driver or is not needed (because roaming used the Fast Transition ++ * protocol). ++ * + * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce + * transmit power to stay within regulatory limits. u32, dBi. * * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined -@@ -2195,7 +2263,7 @@ enum nl80211_attrs { +@@ -2195,7 +2400,7 @@ enum nl80211_attrs { NL80211_ATTR_CONN_FAILED_REASON, @@ -141,7 +382,12 @@ NL80211_ATTR_VHT_CAPABILITY, -@@ -2336,6 +2404,20 @@ enum nl80211_attrs { +@@ -2332,10 +2537,39 @@ enum nl80211_attrs { + NL80211_ATTR_MESH_PEER_AID, + + NL80211_ATTR_NAN_MASTER_PREF, +- NL80211_ATTR_NAN_DUAL, ++ NL80211_ATTR_BANDS, NL80211_ATTR_NAN_FUNC, NL80211_ATTR_NAN_MATCH, @@ -157,12 +403,27 @@ + + NL80211_ATTR_TIMEOUT_REASON, + ++ NL80211_ATTR_FILS_ERP_USERNAME, ++ NL80211_ATTR_FILS_ERP_REALM, ++ NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM, ++ NL80211_ATTR_FILS_ERP_RRK, ++ NL80211_ATTR_FILS_CACHE_ID, ++ ++ NL80211_ATTR_PMK, ++ ++ NL80211_ATTR_SCHED_SCAN_MULTI, ++ NL80211_ATTR_SCHED_SCAN_MAX_REQS, ++ ++ NL80211_ATTR_WANT_1X_4WAY_HS, ++ NL80211_ATTR_PMKR0_NAME, ++ NL80211_ATTR_PORT_AUTHORIZED, ++ + NL80211_ATTR_WIPHY_ANTENNA_GAIN, + /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, -@@ -2347,6 +2429,7 @@ enum nl80211_attrs { +@@ -2347,6 +2581,7 @@ enum nl80211_attrs { #define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION #define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG #define NL80211_ATTR_IFACE_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER @@ -170,7 +431,15 @@ /* * Allow user space programs to use #ifdef on new attributes by defining them -@@ -3027,6 +3110,13 @@ enum nl80211_reg_rule_attr { +@@ -3019,6 +3254,7 @@ enum nl80211_reg_rule_attr { + * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved + * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching, + * only report BSS with matching SSID. ++ * (This cannot be used together with BSSID.) + * @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI: RSSI threshold (in dBm) for reporting a + * BSS in scan results. Filtering is turned off if not specified. Note that + * if this attribute is in a match set of its own, then it is treated as +@@ -3027,6 +3263,15 @@ enum nl80211_reg_rule_attr { * how this API was implemented in the past. Also, due to the same problem, * the only way to create a matchset with only an RSSI filter (with this * attribute) is if there's only a single matchset with the RSSI attribute. @@ -181,19 +450,22 @@ + * BSS-es in the specified band is to be adjusted before doing + * RSSI-based BSS selection. The attribute value is a packed structure + * value as specified by &struct nl80211_bss_select_rssi_adjust. ++ * @NL80211_SCHED_SCAN_MATCH_ATTR_BSSID: BSSID to be used for matching ++ * (this cannot be used together with SSID). * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter * attribute number currently defined * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use -@@ -3036,6 +3126,8 @@ enum nl80211_sched_scan_match_attr { +@@ -3036,6 +3281,9 @@ enum nl80211_sched_scan_match_attr { NL80211_SCHED_SCAN_MATCH_ATTR_SSID, NL80211_SCHED_SCAN_MATCH_ATTR_RSSI, + NL80211_SCHED_SCAN_MATCH_ATTR_RELATIVE_RSSI, + NL80211_SCHED_SCAN_MATCH_ATTR_RSSI_ADJUST, ++ NL80211_SCHED_SCAN_MATCH_ATTR_BSSID, /* keep last */ __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST, -@@ -3660,6 +3752,9 @@ enum nl80211_bss_status { +@@ -3660,6 +3908,9 @@ enum nl80211_bss_status { * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) * @NL80211_AUTHTYPE_SAE: Simultaneous authentication of equals @@ -203,7 +475,7 @@ * @__NL80211_AUTHTYPE_NUM: internal * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by -@@ -3672,6 +3767,9 @@ enum nl80211_auth_type { +@@ -3672,6 +3923,9 @@ enum nl80211_auth_type { NL80211_AUTHTYPE_FT, NL80211_AUTHTYPE_NETWORK_EAP, NL80211_AUTHTYPE_SAE, @@ -213,7 +485,36 @@ /* keep last */ __NL80211_AUTHTYPE_NUM, -@@ -4280,6 +4378,9 @@ enum nl80211_iface_limit_attrs { +@@ -3839,7 +4093,10 @@ enum nl80211_ps_state { + * @__NL80211_ATTR_CQM_INVALID: invalid + * @NL80211_ATTR_CQM_RSSI_THOLD: RSSI threshold in dBm. This value specifies + * the threshold for the RSSI level at which an event will be sent. Zero +- * to disable. ++ * to disable. Alternatively, if %NL80211_EXT_FEATURE_CQM_RSSI_LIST is ++ * set, multiple values can be supplied as a low-to-high sorted array of ++ * threshold values in dBm. Events will be sent when the RSSI value ++ * crosses any of the thresholds. + * @NL80211_ATTR_CQM_RSSI_HYST: RSSI hysteresis in dBm. This value specifies + * the minimum amount the RSSI level must change after an event before a + * new event may be issued (to reduce effects of RSSI oscillation). +@@ -3859,6 +4116,8 @@ enum nl80211_ps_state { + * %NL80211_CMD_NOTIFY_CQM. Set to 0 to turn off TX error reporting. + * @NL80211_ATTR_CQM_BEACON_LOSS_EVENT: flag attribute that's set in a beacon + * loss event ++ * @NL80211_ATTR_CQM_RSSI_LEVEL: the RSSI value in dBm that triggered the ++ * RSSI threshold event. + * @__NL80211_ATTR_CQM_AFTER_LAST: internal + * @NL80211_ATTR_CQM_MAX: highest key attribute + */ +@@ -3872,6 +4131,7 @@ enum nl80211_attr_cqm { + NL80211_ATTR_CQM_TXE_PKTS, + NL80211_ATTR_CQM_TXE_INTVL, + NL80211_ATTR_CQM_BEACON_LOSS_EVENT, ++ NL80211_ATTR_CQM_RSSI_LEVEL, + + /* keep last */ + __NL80211_ATTR_CQM_AFTER_LAST, +@@ -4280,6 +4540,9 @@ enum nl80211_iface_limit_attrs { * of supported channel widths for radar detection. * @NL80211_IFACE_COMB_RADAR_DETECT_REGIONS: u32 attribute containing the bitmap * of supported regulatory regions for radar detection. @@ -223,7 +524,7 @@ * @NUM_NL80211_IFACE_COMB: number of attributes * @MAX_NL80211_IFACE_COMB: highest attribute number * -@@ -4287,8 +4388,8 @@ enum nl80211_iface_limit_attrs { +@@ -4287,8 +4550,8 @@ enum nl80211_iface_limit_attrs { * limits = [ #{STA} <= 1, #{AP} <= 1 ], matching BI, channels = 1, max = 2 * => allows an AP and a STA that must match BIs * @@ -234,7 +535,7 @@ * * numbers = [ #{STA} <= 2 ], channels = 2, max = 2 * => allows two STAs on different channels -@@ -4314,6 +4415,7 @@ enum nl80211_if_combination_attrs { +@@ -4314,6 +4577,7 @@ enum nl80211_if_combination_attrs { NL80211_IFACE_COMB_NUM_CHANNELS, NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS, NL80211_IFACE_COMB_RADAR_DETECT_REGIONS, @@ -242,7 +543,7 @@ /* keep last */ NUM_NL80211_IFACE_COMB, -@@ -4634,6 +4736,15 @@ enum nl80211_feature_flags { +@@ -4634,6 +4898,27 @@ enum nl80211_feature_flags { * configuration (AP/mesh) with HT rates. * @NL80211_EXT_FEATURE_BEACON_RATE_VHT: Driver supports beacon rate * configuration (AP/mesh) with VHT rates. @@ -255,10 +556,22 @@ + * @NL80211_EXT_FEATURE_SCHED_SCAN_RELATIVE_RSSI: The driver supports sched_scan + * for reporting BSSs with better RSSI than the current connected BSS + * (%NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI). ++ * @NL80211_EXT_FEATURE_CQM_RSSI_LIST: With this driver the ++ * %NL80211_ATTR_CQM_RSSI_THOLD attribute accepts a list of zero or more ++ * RSSI threshold values to monitor rather than exactly one threshold. ++ * @NL80211_EXT_FEATURE_FILS_SK_OFFLOAD: Driver SME supports FILS shared key ++ * authentication with %NL80211_CMD_CONNECT. ++ * @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK: Device wants to do 4-way ++ * handshake with PSK in station mode (PSK is passed as part of the connect ++ * and associate commands), doing it in the host might not be supported. ++ * @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X: Device wants to do doing 4-way ++ * handshake with 802.1X in station mode (will pass EAP frames to the host ++ * and accept the set_pmk/del_pmk commands), doing it in the host might not ++ * be supported. * * @NUM_NL80211_EXT_FEATURES: number of extended features. * @MAX_NL80211_EXT_FEATURES: highest extended feature index. -@@ -4648,6 +4759,10 @@ enum nl80211_ext_feature_index { +@@ -4648,6 +4933,14 @@ enum nl80211_ext_feature_index { NL80211_EXT_FEATURE_BEACON_RATE_LEGACY, NL80211_EXT_FEATURE_BEACON_RATE_HT, NL80211_EXT_FEATURE_BEACON_RATE_VHT, @@ -266,10 +579,14 @@ + NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA, + NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA_CONNECTED, + NL80211_EXT_FEATURE_SCHED_SCAN_RELATIVE_RSSI, ++ NL80211_EXT_FEATURE_CQM_RSSI_LIST, ++ NL80211_EXT_FEATURE_FILS_SK_OFFLOAD, ++ NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK, ++ NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X, /* add new features before the definition below */ NUM_NL80211_EXT_FEATURES, -@@ -4687,6 +4802,21 @@ enum nl80211_connect_failed_reason { +@@ -4687,6 +4980,21 @@ enum nl80211_connect_failed_reason { }; /** @@ -291,7 +608,25 @@ * enum nl80211_scan_flags - scan request control flags * * Scan request control flags are used to control the handling -@@ -4900,8 +5030,9 @@ enum nl80211_sched_scan_plan { +@@ -4768,12 +5076,17 @@ enum nl80211_smps_mode { + * change to the channel status. + * @NL80211_RADAR_NOP_FINISHED: The Non-Occupancy Period for this channel is + * over, channel becomes usable. ++ * @NL80211_RADAR_PRE_CAC_EXPIRED: Channel Availability Check done on this ++ * non-operating channel is expired and no longer valid. New CAC must ++ * be done on this channel before starting the operation. This is not ++ * applicable for ETSI dfs domain where pre-CAC is valid for ever. + */ + enum nl80211_radar_event { + NL80211_RADAR_DETECTED, + NL80211_RADAR_CAC_FINISHED, + NL80211_RADAR_CAC_ABORTED, + NL80211_RADAR_NOP_FINISHED, ++ NL80211_RADAR_PRE_CAC_EXPIRED, + }; + + /** +@@ -4900,8 +5213,9 @@ enum nl80211_sched_scan_plan { /** * struct nl80211_bss_select_rssi_adjust - RSSI adjustment parameters. * @@ -303,3 +638,25 @@ */ struct nl80211_bss_select_rssi_adjust { __u8 band; +@@ -4942,21 +5256,6 @@ enum nl80211_bss_select_attr { + }; + + /** +- * enum nl80211_nan_dual_band_conf - NAN dual band configuration +- * +- * Defines the NAN dual band mode of operation +- * +- * @NL80211_NAN_BAND_DEFAULT: device default mode +- * @NL80211_NAN_BAND_2GHZ: 2.4GHz mode +- * @NL80211_NAN_BAND_5GHZ: 5GHz mode +- */ +-enum nl80211_nan_dual_band_conf { +- NL80211_NAN_BAND_DEFAULT = 1 << 0, +- NL80211_NAN_BAND_2GHZ = 1 << 1, +- NL80211_NAN_BAND_5GHZ = 1 << 2, +-}; +- +-/** + * enum nl80211_nan_function_type - NAN function type + * + * Defines the function type of a NAN function diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile index 00332b035..453978eb9 100644 --- a/package/network/utils/iwinfo/Makefile +++ b/package/network/utils/iwinfo/Makefile @@ -10,10 +10,10 @@ PKG_NAME:=libiwinfo PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/iwinfo.git -PKG_SOURCE_DATE:=2016-09-21 -PKG_SOURCE_VERSION:=fd9e17be0c43bd6b8df5371f0b353747bc563874 -PKG_MIRROR_HASH:=c58490d9b5c2179f6a3edc67aae2f00ae6007daee0d52fa7e5b4c0ea923f1e37 +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 000000000..988bc8075 --- /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 000000000..691e3bba5 --- /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 000000000..0e39ef724 --- /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 000000000..c846fbab5 --- /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 000000000..e1cc38f48 --- /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 000000000..b34c6a31a --- /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 000000000..a1217668f --- /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 000000000..ed9d76d45 --- /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 000000000..4921f63c9 --- /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 000000000..c642afcaf --- /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 000000000..9945cd438 --- /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 000000000..1b6cc46a3 --- /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 000000000..3acb3b5d8 --- /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 3d3662264..532a02821 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 0fa86bdef..6513dd38a 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 000000000..839b395fe --- /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 4fdd58265..5aaa1cbf4 100644 --- a/package/network/utils/nftables/Makefile +++ b/package/network/utils/nftables/Makefile @@ -7,13 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nftables -PKG_VERSION:=0.4+2015-04-09 +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:=3ed296118a065caff5600e60d4f7ef18e137f9a0 -PKG_MIRROR_HASH:=7f6f6162592c848b8047e75374f01a93d2d269dabe013a0150767027049b1e41 +PKG_SOURCE_VERSION:=79cbd19e7437680561b26109bbf4f48cb2e8e0a7 +PKG_MIRROR_HASH:=2c0af691948519556952097673ad1b57f888c8314b8eb15e83066951de01fc82 PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/nftables/patches/101-nftables-statement-fix-print-of-ip-dnat-address.patch b/package/network/utils/nftables/patches/101-nftables-statement-fix-print-of-ip-dnat-address.patch new file mode 100644 index 000000000..99f968435 --- /dev/null +++ b/package/network/utils/nftables/patches/101-nftables-statement-fix-print-of-ip-dnat-address.patch @@ -0,0 +1,76 @@ +From patchwork Fri Feb 3 14:25:45 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [nftables] statement: fix print of ip dnat address +From: Florian Westphal +X-Patchwork-Id: 723692 +X-Patchwork-Delegate: pablo@netfilter.org +Message-Id: <20170203142545.13724-1-fw@strlen.de> +To: +Cc: Florian Westphal +Date: Fri, 3 Feb 2017 15:25:45 +0100 + +the change causes non-ipv6 addresses to not be printed at all in case +a nfproto was given. + +Also add a test case to catch this. + +Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1117 +Fixes: 5ab0e10fc6e2c22363a ("src: support for RFC2732 IPv6 address format with brackets") +Signed-off-by: Florian Westphal +Acked-by: Pablo Neira Ayuso +--- + src/statement.c | 2 ++ + tests/py/ip/dnat.t | 1 + + tests/py/ip/dnat.t.payload.ip | 12 ++++++++++++ + 3 files changed, 15 insertions(+) + +diff --git a/src/statement.c b/src/statement.c +index 9cdabbb979e8..3beb86ab4263 100644 +--- a/src/statement.c ++++ b/src/statement.c +@@ -508,6 +508,8 @@ static void nat_stmt_print(const struct stmt *stmt) + printf("]-["); + expr_print(stmt->nat.addr->right); + printf("]"); ++ } else { ++ expr_print(stmt->nat.addr); + } + } else { + expr_print(stmt->nat.addr); +diff --git a/tests/py/ip/dnat.t b/tests/py/ip/dnat.t +index da00106edbb4..089017c84704 100644 +--- a/tests/py/ip/dnat.t ++++ b/tests/py/ip/dnat.t +@@ -7,6 +7,7 @@ iifname "eth0" tcp dport != 80-90 dnat to 192.168.3.2;ok + iifname "eth0" tcp dport {80, 90, 23} dnat to 192.168.3.2;ok + iifname "eth0" tcp dport != {80, 90, 23} dnat to 192.168.3.2;ok + iifname "eth0" tcp dport != 23-34 dnat to 192.168.3.2;ok ++iifname "eth0" tcp dport 81 dnat to 192.168.3.2:8080;ok + + dnat to ct mark map { 0x00000014 : 1.2.3.4};ok + dnat to ct mark . ip daddr map { 0x00000014 . 1.1.1.1 : 1.2.3.4};ok +diff --git a/tests/py/ip/dnat.t.payload.ip b/tests/py/ip/dnat.t.payload.ip +index 66926990d880..7a7f5a82dd5a 100644 +--- a/tests/py/ip/dnat.t.payload.ip ++++ b/tests/py/ip/dnat.t.payload.ip +@@ -60,6 +60,18 @@ ip test-ip4 prerouting + [ immediate reg 1 0x0203a8c0 ] + [ nat dnat ip addr_min reg 1 addr_max reg 0 ] + ++# iifname "eth0" tcp dport 81 dnat to 192.168.3.2:8080 ++ip test-ip4 prerouting ++ [ meta load iifname => reg 1 ] ++ [ cmp eq reg 1 0x30687465 0x00000000 0x00000000 0x00000000 ] ++ [ payload load 1b @ network header + 9 => reg 1 ] ++ [ cmp eq reg 1 0x00000006 ] ++ [ payload load 2b @ transport header + 2 => reg 1 ] ++ [ cmp eq reg 1 0x00005100 ] ++ [ immediate reg 1 0x0203a8c0 ] ++ [ immediate reg 2 0x0000901f ] ++ [ nat dnat ip addr_min reg 1 addr_max reg 0 proto_min reg 2 proto_max reg 0 ] ++ + # dnat to ct mark map { 0x00000014 : 1.2.3.4} + __map%d test-ip4 b + __map%d test-ip4 0 diff --git a/package/network/utils/tcpdump/Makefile b/package/network/utils/tcpdump/Makefile index bb04369b5..50919819b 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 diff --git a/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch b/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch index 593d42894..48cc470bf 100644 --- a/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch +++ b/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch @@ -1,15 +1,13 @@ --- a/Makefile.in +++ b/Makefile.in -@@ -70,6 +70,82 @@ DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@ - @rm -f $@ - $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c +@@ -72,6 +72,80 @@ DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@ + + CSRC = setsignal.c tcpdump.c +ifdef TCPDUMP_MINI + -+CSRC=\ -+ tcpdump.c \ ++LIBNETDISSECT_SRC=\ + netdissect.c \ -+ setsignal.c \ + addrtoname.c \ + addrtostr.c \ + af.c \ @@ -80,10 +78,10 @@ + +else + - CSRC = setsignal.c tcpdump.c - LIBNETDISSECT_SRC=\ -@@ -237,12 +313,16 @@ LIBNETDISSECT_SRC=\ + addrtoname.c \ + addrtostr.c \ +@@ -237,6 +311,8 @@ LIBNETDISSECT_SRC=\ strtoaddr.c \ util-print.c @@ -92,27 +90,6 @@ LOCALSRC = @LOCALSRC@ GENSRC = version.c LIBOBJS = @LIBOBJS@ - -+ifndef TCPDUMP_MINI - LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) ${LOCALSRC:.c=.o} ${LIBOBJS} - LIBNETDISSECT=libnetdissect.a -+endif - - - SRC = $(CSRC) $(GENSRC) $(LOCALSRC) $(LIBNETDISSECT_SRC) -@@ -373,10 +453,12 @@ $(PROG): $(OBJ) @V_PCAPDEP@ - @rm -f $@ - $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) - -+ifndef TCPDUMP_MINI - $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ) - @rm -f $@ - $(AR) cr $@ $(LIBNETDISSECT_OBJ) - $(RANLIB) $@ -+endif - - datalinks.o: $(srcdir)/missing/datalinks.c - $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c --- a/addrtoname.c +++ b/addrtoname.c @@ -578,8 +578,10 @@ linkaddr_string(netdissect_options *ndo, diff --git a/package/network/utils/umbim/Makefile b/package/network/utils/umbim/Makefile index 616a02367..4faa5acf9 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 2102490f6..9c8dadabe 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 6f11933a9..9c953ea69 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -65,6 +65,7 @@ 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 @@ -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 diff --git a/package/network/utils/wpan-tools/Makefile b/package/network/utils/wpan-tools/Makefile index ff6537572..e57223dee 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 000000000..1370854b6 --- /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/wwan.sh b/package/network/utils/wwan/files/wwan.sh index 6b33600b3..2e9d73f1e 100755 --- a/package/network/utils/wwan/files/wwan.sh +++ b/package/network/utils/wwan/files/wwan.sh @@ -66,15 +66,15 @@ proto_wwan_setup() { } } - [ -z "$ctl_device" ] && for net in $(ls /sys/class/net/ | grep wwan); do + [ -z "$ctl_device" ] && for net in $(ls /sys/class/net/ | grep -e wwan -e usb); do [ -z "$ctl_device" ] || continue driver=$(grep DRIVER /sys/class/net/$net/device/uevent | cut -d= -f2) case "$driver" in qmi_wwan|cdc_mbim) ctl_device=/dev/$(ls /sys/class/net/$net/device/usbmisc) ;; - sierra_net|*cdc_ncm) - ctl_device=/dev/$(cd /sys/class/net/$net/; find ../../../ -name ttyUSB* |xargs basename | head -n1) + sierra_net|cdc_ether|*cdc_ncm) + ctl_device=/dev/$(cd /sys/class/net/$net/; find ../../../ -name ttyUSB* |xargs -n1 basename | head -n1) ;; *) continue;; esac @@ -93,11 +93,11 @@ proto_wwan_setup() { uci_set_state network $interface dat_device "$dat_device" case $driver in - qmi_wwan) proto_qmi_setup $@ ;; - cdc_mbim) proto_mbim_setup $@ ;; - sierra_net) proto_directip_setup $@ ;; - comgt) proto_3g_setup $@ ;; - *cdc_ncm) proto_ncm_setup $@ ;; + qmi_wwan) proto_qmi_setup $@ ;; + cdc_mbim) proto_mbim_setup $@ ;; + sierra_net) proto_directip_setup $@ ;; + comgt) proto_3g_setup $@ ;; + cdc_ether|*cdc_ncm) proto_ncm_setup $@ ;; esac } @@ -108,11 +108,11 @@ proto_wwan_teardown() { dat_device=$(uci_get_state network $interface dat_device) case $driver in - qmi_wwan) proto_qmi_teardown $@ ;; - cdc_mbim) proto_mbim_teardown $@ ;; - sierra_net) proto_mbim_teardown $@ ;; - comgt) proto_3g_teardown $@ ;; - *cdc_ncm) proto_ncm_teardown $@ ;; + qmi_wwan) proto_qmi_teardown $@ ;; + cdc_mbim) proto_mbim_teardown $@ ;; + sierra_net) proto_mbim_teardown $@ ;; + comgt) proto_3g_teardown $@ ;; + cdc_ether|*cdc_ncm) proto_ncm_teardown $@ ;; esac } diff --git a/package/network/utils/xtables-addons/Makefile b/package/network/utils/xtables-addons/Makefile index 50d1287ba..0c12d7464 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.11 +PKG_VERSION:=2.14 PKG_RELEASE:=1 -PKG_HASH:=f14f8953a9d3a70157a82883886ff6ec866c61dbea1585edb421478107279921 +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 02250ec20..a9fb796d0 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. */ @@ -105,3 +114,14 @@ #endif #if defined(__cplusplus) +--- a/extensions/LUA/lua/llex.h ++++ b/extensions/LUA/lua/llex.h +@@ -10,6 +10,8 @@ + #include "lobject.h" + #include "lzio.h" + ++/* prevent conflict with definition from asm/current.h */ ++#undef current + + #define FIRST_RESERVED 257 + diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile index 16f2f7e77..e26e39b54 100644 --- a/package/system/fstools/Makefile +++ b/package/system/fstools/Makefile @@ -11,11 +11,10 @@ PKG_NAME:=fstools PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/fstools.git -PKG_SOURCE_DATE:=2018-01-04 -PKG_SOURCE_VERSION:=37762ff488752c1686b359816aec75831b49c55f -PKG_MIRROR_HASH:=fe619019e0fd680ea32786cad80305250b776d51969de57a8f0feb729f7639e5 -PKG_RELEASE:=1 +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 @@ -67,6 +66,13 @@ define Package/block-mount DEPENDS:=+ubox +libubox +libuci endef +define Package/blockd + SECTION:=base + CATEGORY:=Base system + TITLE:=Block device automounting + DEPENDS:=+block-mount +fstools +libubus +kmod-fs-autofs4 +endef + define Package/fstools/install $(INSTALL_DIR) $(1)/sbin $(1)/lib @@ -96,6 +102,12 @@ define Package/block-mount/install endef +define Package/blockd/install + $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/blockd $(1)/sbin/ + $(INSTALL_BIN) ./files/blockd.init $(1)/etc/init.d/blockd +endef + define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ @@ -106,3 +118,4 @@ endef $(eval $(call BuildPackage,fstools)) $(eval $(call BuildPackage,snapshot-tool)) $(eval $(call BuildPackage,block-mount)) +$(eval $(call BuildPackage,blockd)) diff --git a/package/system/fstools/files/blockd.init b/package/system/fstools/files/blockd.init new file mode 100755 index 000000000..a4ce57d40 --- /dev/null +++ b/package/system/fstools/files/blockd.init @@ -0,0 +1,21 @@ +#!/bin/sh /etc/rc.common + +START=80 + +USE_PROCD=1 +PROG=/sbin/blockd + +service_triggers() { + procd_add_reload_trigger "fstab" +} + +reload_service() { + block autofs start +} + +start_service() { + procd_open_instance + procd_set_param command "$PROG" + procd_set_param respawn + procd_close_instance +} diff --git a/package/system/fstools/files/snapshot b/package/system/fstools/files/snapshot index c1a5b733f..a495e3434 100644 --- a/package/system/fstools/files/snapshot +++ b/package/system/fstools/files/snapshot @@ -42,7 +42,7 @@ do_snapshot_upgrade() { opkg list-upgradable [ $? -eq 0 ] || exit 2 - + UPDATES=`opkg list-upgradable | cut -d" " -f1` [ -z "${UPDATES}" ] && exit 0 @@ -64,14 +64,16 @@ do_convert_jffs2() { do_convert() { . /lib/functions.sh . /lib/upgrade/common.sh - ubus call system upgrade - touch /tmp/sysupgrade + cd /overlay/upper tar czf /tmp/snapshot.tar.gz * - kill_remaining TERM - sleep 3 - kill_remaining KILL - run_ramfs '. /sbin/snapshot; do_convert_jffs2' + + install_bin /sbin/upgraded + ubus call system sysupgrade "{ + \"prefix\": \"$RAM_ROOT\", + \"path\": \"\", + \"command\": \". /sbin/snapshot; do_convert_jffs2\" + }" } [ -n "$(cat /proc/mounts|grep /overlay|grep jffs2)" ] && { diff --git a/package/system/lede-keyring/Makefile b/package/system/lede-keyring/Makefile index fb5752a54..d0961b162 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/mountd/Makefile b/package/system/mountd/Makefile deleted file mode 100644 index 37367abd0..000000000 --- a/package/system/mountd/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (C) 2009-2012 OpenWrt.org -# All rights reserved. - -include $(TOPDIR)/rules.mk - -PKG_NAME:=mountd -PKG_RELEASE:=3 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/mountd.git -PKG_SOURCE_DATE:=2017-11-09 -PKG_SOURCE_VERSION:=7826ca5d6aca691dcb6f98ab203a090d42e79337 -PKG_MIRROR_HASH:=6fda7666a99974ac9179b102f6e8027f6c4091be9b49e1eed49dee7442d83206 -CMAKE_INSTALL:=1 - -PKG_MAINTAINER:=John Crispin -PKG_LICENSE:=GPL-2.0 - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/cmake.mk - -define Package/mountd - SECTION:=utils - CATEGORY:=Utilities - TITLE:=OpenWrt automount daemon - DEPENDS:=+uci +kmod-fs-autofs4 - URL:=http://www.openwrt.org -endef - -define Package/mountd/description - openwrt automount daemon -endef - -define Package/mountd/conffiles -/etc/config/mountd -endef - -define Package/mountd/install - $(INSTALL_DIR) $(1)/sbin/ $(1)/etc/config/ $(1)/etc/init.d/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/mountd $(1)/sbin/ - $(INSTALL_DATA) ./files/mountd.config $(1)/etc/config/mountd - $(INSTALL_BIN) ./files/mountd.init $(1)/etc/init.d/mountd -endef - -$(eval $(call BuildPackage,mountd)) diff --git a/package/system/mountd/files/mountd.config b/package/system/mountd/files/mountd.config deleted file mode 100644 index 561012950..000000000 --- a/package/system/mountd/files/mountd.config +++ /dev/null @@ -1,3 +0,0 @@ -config mountd mountd - option timeout 60 - option path /tmp/mounts/ diff --git a/package/system/mountd/files/mountd.init b/package/system/mountd/files/mountd.init deleted file mode 100755 index 772bd6ed5..000000000 --- a/package/system/mountd/files/mountd.init +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=80 - -SERVICE_DAEMONIZE=1 -SERVICE_WRITE_PID=1 -SERVICE_PID_FILE=/var/run/mountd.pid - -MOUNTD_BIN=/sbin/mountd - -start() -{ - P="$(uci get mountd.mountd.path)" - [ -n "$P" -a ! -f "$P" ] && mkdir -p $P - - service_start $MOUNTD_BIN -f -} - -stop() -{ - service_stop $MOUNTD_BIN -} diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index 7c8a1669b..d615dd01d 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -11,7 +11,7 @@ PKG_NAME:=procd PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/procd.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git PKG_SOURCE_DATE:=2018-12-02 PKG_SOURCE_VERSION:=a5954cf302fe46d8e29770c818336763112b9a6e PKG_MIRROR_HASH:=1afa1f0160dd8ffac310e75519601c1f9a6107d818f405bb3fe9ef3e7143c2e3 diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh index 5093a911e..3c81928bb 100644 --- a/package/system/procd/files/procd.sh +++ b/package/system/procd/files/procd.sh @@ -41,6 +41,7 @@ _PROCD_SERVICE= procd_lock() { local basescript=$(readlink "$initscript") local service_name="$(basename ${basescript:-$initscript})" + } _procd_call() { diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile index dc4bbb982..2dc960e48 100644 --- a/package/system/rpcd/Makefile +++ b/package/system/rpcd/Makefile @@ -11,7 +11,7 @@ PKG_NAME:=rpcd PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/rpcd.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git PKG_SOURCE_DATE:=2017-12-07 PKG_SOURCE_VERSION:=cfe1e75c91bc1bac82e6caab3e652b0ebee59524 PKG_MAINTAINER:=Jo-Philipp Wich diff --git a/package/system/ubox/Makefile b/package/system/ubox/Makefile index 3c9b4aa51..299872ed4 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-03-10 -PKG_SOURCE_VERSION:=16f7e16181e2f3e9cf3e2ce56a7e291844900d09 -PKG_MIRROR_HASH:=5f10f3df134eb8a69d281a73d39f5d2e2fc96af531a2f3960b0c6116ff11a707 +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 @@ -41,11 +41,11 @@ define Package/ubox/install $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/getrandom $(1)/usr/bin/ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libvalidate.so $(1)/lib - $(LN) ../../sbin/kmodloader $(1)/usr/sbin/rmmod - $(LN) ../../sbin/kmodloader $(1)/usr/sbin/insmod - $(LN) ../../sbin/kmodloader $(1)/usr/sbin/lsmod - $(LN) ../../sbin/kmodloader $(1)/usr/sbin/modinfo - $(LN) ../../sbin/kmodloader $(1)/usr/sbin/modprobe + $(LN) kmodloader $(1)/sbin/rmmod + $(LN) kmodloader $(1)/sbin/insmod + $(LN) kmodloader $(1)/sbin/lsmod + $(LN) kmodloader $(1)/sbin/modinfo + $(LN) kmodloader $(1)/sbin/modprobe endef define Package/logd/install diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile index 4f3d4e830..39854f48f 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 04dfd8335..d5b4eac4a 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=2018-01-01 -PKG_SOURCE_VERSION:=141b64ef84f43c954e665865b1bbf216fbf7c05f -PKG_MIRROR_HASH:=fbd837a16cfa6b0d80f5a4b332b86a105a2b9d37480bcc777931fdea7ce601c9 +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 50891a64e..78ec27766 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 84adccb4a..63f9f0995 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 086169652..c42c94d3a 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 1977e7ff4..afb7d48f8 100644 --- a/package/utils/busybox/Config-defaults.in +++ b/package/utils/busybox/Config-defaults.in @@ -7,6 +7,9 @@ config BUSYBOX_DEFAULT_DESKTOP config BUSYBOX_DEFAULT_EXTRA_COMPAT bool default n +config BUSYBOX_DEFAULT_FEDORA_COMPAT + bool + default n config BUSYBOX_DEFAULT_INCLUDE_SUSv2 bool default y @@ -16,15 +19,6 @@ config BUSYBOX_DEFAULT_USE_PORTABLE_CODE config BUSYBOX_DEFAULT_PLATFORM_LINUX bool default y -config BUSYBOX_DEFAULT_FEATURE_BUFFERS_USE_MALLOC - bool - default n -config BUSYBOX_DEFAULT_FEATURE_BUFFERS_GO_ON_STACK - bool - default y -config BUSYBOX_DEFAULT_FEATURE_BUFFERS_GO_IN_BSS - bool - default n config BUSYBOX_DEFAULT_SHOW_USAGE bool default y @@ -43,45 +37,9 @@ config BUSYBOX_DEFAULT_FEATURE_INSTALLER config BUSYBOX_DEFAULT_INSTALL_NO_USR bool default n -config BUSYBOX_DEFAULT_LOCALE_SUPPORT - bool - default n -config BUSYBOX_DEFAULT_UNICODE_SUPPORT - bool - default n -config BUSYBOX_DEFAULT_UNICODE_USING_LOCALE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_CHECK_UNICODE_IN_ENV - bool - default n -config BUSYBOX_DEFAULT_SUBST_WCHAR - int - default 0 -config BUSYBOX_DEFAULT_LAST_SUPPORTED_WCHAR - int - default 0 -config BUSYBOX_DEFAULT_UNICODE_COMBINING_WCHARS - bool - default n -config BUSYBOX_DEFAULT_UNICODE_WIDE_WCHARS - bool - default n -config BUSYBOX_DEFAULT_UNICODE_BIDI_SUPPORT - bool - default n -config BUSYBOX_DEFAULT_UNICODE_NEUTRAL_TABLE - bool - default n -config BUSYBOX_DEFAULT_UNICODE_PRESERVE_BROKEN - bool - default n config BUSYBOX_DEFAULT_PAM bool default n -config BUSYBOX_DEFAULT_FEATURE_USE_SENDFILE - bool - default n config BUSYBOX_DEFAULT_LONG_OPTS bool default y @@ -163,30 +121,6 @@ config BUSYBOX_DEFAULT_EXTRA_LDFLAGS config BUSYBOX_DEFAULT_EXTRA_LDLIBS string default "" -config BUSYBOX_DEFAULT_DEBUG - bool - default n -config BUSYBOX_DEFAULT_DEBUG_PESSIMIZE - bool - default n -config BUSYBOX_DEFAULT_DEBUG_SANITIZE - bool - default n -config BUSYBOX_DEFAULT_UNIT_TEST - bool - default n -config BUSYBOX_DEFAULT_WERROR - bool - default n -config BUSYBOX_DEFAULT_NO_DEBUG_LIB - bool - default y -config BUSYBOX_DEFAULT_DMALLOC - bool - default n -config BUSYBOX_DEFAULT_EFENCE - bool - default n config BUSYBOX_DEFAULT_INSTALL_APPLET_SYMLINKS bool default y @@ -211,12 +145,45 @@ config BUSYBOX_DEFAULT_INSTALL_SH_APPLET_SCRIPT_WRAPPER config BUSYBOX_DEFAULT_PREFIX string default "./_install" +config BUSYBOX_DEFAULT_DEBUG + bool + default n +config BUSYBOX_DEFAULT_DEBUG_PESSIMIZE + bool + default n +config BUSYBOX_DEFAULT_DEBUG_SANITIZE + bool + default n +config BUSYBOX_DEFAULT_UNIT_TEST + bool + default n +config BUSYBOX_DEFAULT_WERROR + bool + default n +config BUSYBOX_DEFAULT_NO_DEBUG_LIB + bool + default y +config BUSYBOX_DEFAULT_DMALLOC + bool + default n +config BUSYBOX_DEFAULT_EFENCE + bool + default n config BUSYBOX_DEFAULT_FEATURE_USE_BSS_TAIL bool default n config BUSYBOX_DEFAULT_FEATURE_RTMINMAX bool default n +config BUSYBOX_DEFAULT_FEATURE_BUFFERS_USE_MALLOC + bool + default n +config BUSYBOX_DEFAULT_FEATURE_BUFFERS_GO_ON_STACK + bool + default y +config BUSYBOX_DEFAULT_FEATURE_BUFFERS_GO_IN_BSS + bool + default n config BUSYBOX_DEFAULT_PASSWORD_MINLEN int default 6 @@ -232,9 +199,6 @@ config BUSYBOX_DEFAULT_FEATURE_FAST_TOP config BUSYBOX_DEFAULT_FEATURE_ETC_NETWORKS bool default n -config BUSYBOX_DEFAULT_FEATURE_USE_TERMIOS - bool - default n config BUSYBOX_DEFAULT_FEATURE_EDITING bool default y @@ -268,12 +232,48 @@ config BUSYBOX_DEFAULT_FEATURE_EDITING_FANCY_PROMPT config BUSYBOX_DEFAULT_FEATURE_EDITING_ASK_TERMINAL bool default n +config BUSYBOX_DEFAULT_LOCALE_SUPPORT + bool + default n +config BUSYBOX_DEFAULT_UNICODE_SUPPORT + bool + default n +config BUSYBOX_DEFAULT_UNICODE_USING_LOCALE + bool + default n +config BUSYBOX_DEFAULT_FEATURE_CHECK_UNICODE_IN_ENV + bool + default n +config BUSYBOX_DEFAULT_SUBST_WCHAR + int + default 0 +config BUSYBOX_DEFAULT_LAST_SUPPORTED_WCHAR + int + default 0 +config BUSYBOX_DEFAULT_UNICODE_COMBINING_WCHARS + bool + default n +config BUSYBOX_DEFAULT_UNICODE_WIDE_WCHARS + bool + default n +config BUSYBOX_DEFAULT_UNICODE_BIDI_SUPPORT + bool + default n +config BUSYBOX_DEFAULT_UNICODE_NEUTRAL_TABLE + bool + default n +config BUSYBOX_DEFAULT_UNICODE_PRESERVE_BROKEN + bool + default n config BUSYBOX_DEFAULT_FEATURE_NON_POSIX_CP bool default y config BUSYBOX_DEFAULT_FEATURE_VERBOSE_CP_MESSAGE bool default n +config BUSYBOX_DEFAULT_FEATURE_USE_SENDFILE + bool + default y config BUSYBOX_DEFAULT_FEATURE_COPYBUF_KB int default 4 @@ -319,30 +319,45 @@ config BUSYBOX_DEFAULT_UNCOMPRESS config BUSYBOX_DEFAULT_GUNZIP bool default y +config BUSYBOX_DEFAULT_ZCAT + bool + default y config BUSYBOX_DEFAULT_FEATURE_GUNZIP_LONG_OPTIONS bool default n config BUSYBOX_DEFAULT_BUNZIP2 bool default y +config BUSYBOX_DEFAULT_BZCAT + bool + default y config BUSYBOX_DEFAULT_UNLZMA bool default n -config BUSYBOX_DEFAULT_FEATURE_LZMA_FAST +config BUSYBOX_DEFAULT_LZCAT bool default n config BUSYBOX_DEFAULT_LZMA bool default n +config BUSYBOX_DEFAULT_FEATURE_LZMA_FAST + bool + default n config BUSYBOX_DEFAULT_UNXZ bool default n +config BUSYBOX_DEFAULT_XZCAT + bool + default n config BUSYBOX_DEFAULT_XZ bool default n config BUSYBOX_DEFAULT_BZIP2 bool default n +config BUSYBOX_DEFAULT_FEATURE_BZIP2_DECOMPRESS + bool + default y config BUSYBOX_DEFAULT_CPIO bool default n @@ -358,9 +373,6 @@ config BUSYBOX_DEFAULT_DPKG config BUSYBOX_DEFAULT_DPKG_DEB bool default n -config BUSYBOX_DEFAULT_FEATURE_DPKG_DEB_EXTRACT_ONLY - bool - default n config BUSYBOX_DEFAULT_GZIP bool default y @@ -373,9 +385,18 @@ config BUSYBOX_DEFAULT_GZIP_FAST config BUSYBOX_DEFAULT_FEATURE_GZIP_LEVELS bool default n +config BUSYBOX_DEFAULT_FEATURE_GZIP_DECOMPRESS + bool + default y config BUSYBOX_DEFAULT_LZOP bool default n +config BUSYBOX_DEFAULT_UNLZOP + bool + default n +config BUSYBOX_DEFAULT_LZOPCAT + bool + default n config BUSYBOX_DEFAULT_LZOP_COMPR_HIGH bool default n @@ -424,109 +445,25 @@ config BUSYBOX_DEFAULT_FEATURE_TAR_SELINUX config BUSYBOX_DEFAULT_UNZIP bool default n +config BUSYBOX_DEFAULT_FEATURE_UNZIP_CDF + bool + default n +config BUSYBOX_DEFAULT_FEATURE_UNZIP_BZIP2 + bool + default n +config BUSYBOX_DEFAULT_FEATURE_UNZIP_LZMA + bool + default n +config BUSYBOX_DEFAULT_FEATURE_UNZIP_XZ + bool + default n config BUSYBOX_DEFAULT_BASENAME bool default y config BUSYBOX_DEFAULT_CAT bool default y -config BUSYBOX_DEFAULT_DATE - bool - default y -config BUSYBOX_DEFAULT_FEATURE_DATE_ISOFMT - bool - default y -config BUSYBOX_DEFAULT_FEATURE_DATE_NANO - bool - default n -config BUSYBOX_DEFAULT_FEATURE_DATE_COMPAT - bool - default n -config BUSYBOX_DEFAULT_DD - bool - default y -config BUSYBOX_DEFAULT_FEATURE_DD_SIGNAL_HANDLING - bool - default y -config BUSYBOX_DEFAULT_FEATURE_DD_THIRD_STATUS_LINE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_DD_IBS_OBS - bool - default y -config BUSYBOX_DEFAULT_FEATURE_DD_STATUS - bool - default n -config BUSYBOX_DEFAULT_HOSTID - bool - default n -config BUSYBOX_DEFAULT_ID - bool - default y -config BUSYBOX_DEFAULT_GROUPS - bool - default n -config BUSYBOX_DEFAULT_SHUF - bool - default n -config BUSYBOX_DEFAULT_STAT - bool - default n -config BUSYBOX_DEFAULT_FEATURE_STAT_FORMAT - bool - default n -config BUSYBOX_DEFAULT_FEATURE_STAT_FILESYSTEM - bool - default n -config BUSYBOX_DEFAULT_SYNC - bool - default y -config BUSYBOX_DEFAULT_FEATURE_SYNC_FANCY - bool - default n -config BUSYBOX_DEFAULT_TEST - bool - default y -config BUSYBOX_DEFAULT_FEATURE_TEST_64 - bool - default y -config BUSYBOX_DEFAULT_TOUCH - bool - default y -config BUSYBOX_DEFAULT_FEATURE_TOUCH_NODEREF - bool - default n -config BUSYBOX_DEFAULT_FEATURE_TOUCH_SUSV3 - bool - default y -config BUSYBOX_DEFAULT_TR - bool - default y -config BUSYBOX_DEFAULT_FEATURE_TR_CLASSES - bool - default n -config BUSYBOX_DEFAULT_FEATURE_TR_EQUIV - bool - default n -config BUSYBOX_DEFAULT_TRUNCATE - bool - default n -config BUSYBOX_DEFAULT_UNLINK - bool - default n -config BUSYBOX_DEFAULT_BASE64 - bool - default n -config BUSYBOX_DEFAULT_WHO - bool - default n -config BUSYBOX_DEFAULT_USERS - bool - default n -config BUSYBOX_DEFAULT_CAL - bool - default n -config BUSYBOX_DEFAULT_CATV +config BUSYBOX_DEFAULT_FEATURE_CATV bool default n config BUSYBOX_DEFAULT_CHGRP @@ -559,6 +496,33 @@ config BUSYBOX_DEFAULT_FEATURE_CP_LONG_OPTIONS config BUSYBOX_DEFAULT_CUT bool default y +config BUSYBOX_DEFAULT_DATE + bool + default y +config BUSYBOX_DEFAULT_FEATURE_DATE_ISOFMT + bool + default y +config BUSYBOX_DEFAULT_FEATURE_DATE_NANO + bool + default n +config BUSYBOX_DEFAULT_FEATURE_DATE_COMPAT + bool + default n +config BUSYBOX_DEFAULT_DD + bool + default y +config BUSYBOX_DEFAULT_FEATURE_DD_SIGNAL_HANDLING + bool + default y +config BUSYBOX_DEFAULT_FEATURE_DD_THIRD_STATUS_LINE + bool + default n +config BUSYBOX_DEFAULT_FEATURE_DD_IBS_OBS + bool + default y +config BUSYBOX_DEFAULT_FEATURE_DD_STATUS + bool + default n config BUSYBOX_DEFAULT_DF bool default y @@ -598,12 +562,21 @@ config BUSYBOX_DEFAULT_EXPAND config BUSYBOX_DEFAULT_FEATURE_EXPAND_LONG_OPTIONS bool default n +config BUSYBOX_DEFAULT_UNEXPAND + bool + default n +config BUSYBOX_DEFAULT_FEATURE_UNEXPAND_LONG_OPTIONS + bool + default n config BUSYBOX_DEFAULT_EXPR bool default y config BUSYBOX_DEFAULT_EXPR_MATH_SUPPORT_64 bool default y +config BUSYBOX_DEFAULT_FACTOR + bool + default n config BUSYBOX_DEFAULT_FALSE bool default y @@ -619,12 +592,24 @@ config BUSYBOX_DEFAULT_HEAD config BUSYBOX_DEFAULT_FEATURE_FANCY_HEAD bool default y +config BUSYBOX_DEFAULT_HOSTID + bool + default n +config BUSYBOX_DEFAULT_ID + bool + default y +config BUSYBOX_DEFAULT_GROUPS + bool + default n config BUSYBOX_DEFAULT_INSTALL bool default n config BUSYBOX_DEFAULT_FEATURE_INSTALL_LONG_OPTIONS bool default n +config BUSYBOX_DEFAULT_LINK + bool + default n config BUSYBOX_DEFAULT_LN bool default y @@ -643,6 +628,9 @@ config BUSYBOX_DEFAULT_FEATURE_LS_FOLLOWLINKS config BUSYBOX_DEFAULT_FEATURE_LS_RECURSIVE bool default y +config BUSYBOX_DEFAULT_FEATURE_LS_WIDTH + bool + default y config BUSYBOX_DEFAULT_FEATURE_LS_SORTFILES bool default y @@ -661,6 +649,21 @@ config BUSYBOX_DEFAULT_FEATURE_LS_COLOR_IS_DEFAULT config BUSYBOX_DEFAULT_MD5SUM bool default y +config BUSYBOX_DEFAULT_SHA1SUM + bool + default n +config BUSYBOX_DEFAULT_SHA256SUM + bool + default y +config BUSYBOX_DEFAULT_SHA512SUM + bool + default n +config BUSYBOX_DEFAULT_SHA3SUM + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MD5_SHA1_SUM_CHECK + bool + default y config BUSYBOX_DEFAULT_MKDIR bool default y @@ -682,12 +685,21 @@ config BUSYBOX_DEFAULT_FEATURE_MV_LONG_OPTIONS config BUSYBOX_DEFAULT_NICE bool default y +config BUSYBOX_DEFAULT_NL + bool + default n config BUSYBOX_DEFAULT_NOHUP bool default n +config BUSYBOX_DEFAULT_NPROC + bool + default n config BUSYBOX_DEFAULT_OD bool default n +config BUSYBOX_DEFAULT_PASTE + bool + default n config BUSYBOX_DEFAULT_PRINTENV bool default n @@ -718,16 +730,10 @@ config BUSYBOX_DEFAULT_FEATURE_RMDIR_LONG_OPTIONS config BUSYBOX_DEFAULT_SEQ bool default y -config BUSYBOX_DEFAULT_SHA1SUM +config BUSYBOX_DEFAULT_SHRED bool default n -config BUSYBOX_DEFAULT_SHA256SUM - bool - default y -config BUSYBOX_DEFAULT_SHA512SUM - bool - default n -config BUSYBOX_DEFAULT_SHA3SUM +config BUSYBOX_DEFAULT_SHUF bool default n config BUSYBOX_DEFAULT_SLEEP @@ -751,12 +757,27 @@ config BUSYBOX_DEFAULT_SPLIT config BUSYBOX_DEFAULT_FEATURE_SPLIT_FANCY bool default n +config BUSYBOX_DEFAULT_STAT + bool + default n +config BUSYBOX_DEFAULT_FEATURE_STAT_FORMAT + bool + default n +config BUSYBOX_DEFAULT_FEATURE_STAT_FILESYSTEM + bool + default n config BUSYBOX_DEFAULT_STTY bool default n config BUSYBOX_DEFAULT_SUM bool default n +config BUSYBOX_DEFAULT_SYNC + bool + default y +config BUSYBOX_DEFAULT_FEATURE_SYNC_FANCY + bool + default n config BUSYBOX_DEFAULT_TAC bool default n @@ -772,9 +793,42 @@ config BUSYBOX_DEFAULT_TEE config BUSYBOX_DEFAULT_FEATURE_TEE_USE_BLOCK_IO bool default y +config BUSYBOX_DEFAULT_TEST + bool + default y +config BUSYBOX_DEFAULT_TEST1 + bool + default y +config BUSYBOX_DEFAULT_TEST2 + bool + default y +config BUSYBOX_DEFAULT_FEATURE_TEST_64 + bool + default y +config BUSYBOX_DEFAULT_TOUCH + bool + default y +config BUSYBOX_DEFAULT_FEATURE_TOUCH_NODEREF + bool + default n +config BUSYBOX_DEFAULT_FEATURE_TOUCH_SUSV3 + bool + default y +config BUSYBOX_DEFAULT_TR + bool + default y +config BUSYBOX_DEFAULT_FEATURE_TR_CLASSES + bool + default n +config BUSYBOX_DEFAULT_FEATURE_TR_EQUIV + bool + default n config BUSYBOX_DEFAULT_TRUE bool default y +config BUSYBOX_DEFAULT_TRUNCATE + bool + default n config BUSYBOX_DEFAULT_TTY bool default n @@ -784,21 +838,21 @@ config BUSYBOX_DEFAULT_UNAME config BUSYBOX_DEFAULT_UNAME_OSNAME string default "GNU/Linux" -config BUSYBOX_DEFAULT_UNEXPAND - bool - default n -config BUSYBOX_DEFAULT_FEATURE_UNEXPAND_LONG_OPTIONS - bool - default n config BUSYBOX_DEFAULT_UNIQ bool default y +config BUSYBOX_DEFAULT_UNLINK + bool + default n config BUSYBOX_DEFAULT_USLEEP bool default n config BUSYBOX_DEFAULT_UUDECODE bool default n +config BUSYBOX_DEFAULT_BASE64 + bool + default n config BUSYBOX_DEFAULT_UUENCODE bool default n @@ -808,6 +862,15 @@ config BUSYBOX_DEFAULT_WC config BUSYBOX_DEFAULT_FEATURE_WC_LARGE bool default n +config BUSYBOX_DEFAULT_WHO + bool + default n +config BUSYBOX_DEFAULT_W + bool + default n +config BUSYBOX_DEFAULT_USERS + bool + default n config BUSYBOX_DEFAULT_WHOAMI bool default n @@ -820,21 +883,12 @@ config BUSYBOX_DEFAULT_FEATURE_VERBOSE config BUSYBOX_DEFAULT_FEATURE_PRESERVE_HARDLINKS bool default y -config BUSYBOX_DEFAULT_FEATURE_AUTOWIDTH - bool - default y config BUSYBOX_DEFAULT_FEATURE_HUMAN_READABLE bool default y -config BUSYBOX_DEFAULT_FEATURE_MD5_SHA1_SUM_CHECK - bool - default y config BUSYBOX_DEFAULT_CHVT bool default n -config BUSYBOX_DEFAULT_FGCONSOLE - bool - default n config BUSYBOX_DEFAULT_CLEAR bool default y @@ -844,12 +898,30 @@ config BUSYBOX_DEFAULT_DEALLOCVT config BUSYBOX_DEFAULT_DUMPKMAP bool default n +config BUSYBOX_DEFAULT_FGCONSOLE + bool + default n config BUSYBOX_DEFAULT_KBD_MODE bool default n config BUSYBOX_DEFAULT_LOADFONT bool default n +config BUSYBOX_DEFAULT_SETFONT + bool + default n +config BUSYBOX_DEFAULT_FEATURE_SETFONT_TEXTUAL_MAP + bool + default n +config BUSYBOX_DEFAULT_DEFAULT_SETFONT_DIR + string + default "" +config BUSYBOX_DEFAULT_FEATURE_LOADFONT_PSF2 + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LOADFONT_RAW + bool + default n config BUSYBOX_DEFAULT_LOADKMAP bool default n @@ -871,15 +943,6 @@ config BUSYBOX_DEFAULT_SETCONSOLE config BUSYBOX_DEFAULT_FEATURE_SETCONSOLE_LONG_OPTIONS bool default n -config BUSYBOX_DEFAULT_SETFONT - bool - default n -config BUSYBOX_DEFAULT_FEATURE_SETFONT_TEXTUAL_MAP - bool - default n -config BUSYBOX_DEFAULT_DEFAULT_SETFONT_DIR - string - default "" config BUSYBOX_DEFAULT_SETKEYCODES bool default n @@ -889,12 +952,6 @@ config BUSYBOX_DEFAULT_SETLOGCONS config BUSYBOX_DEFAULT_SHOWKEY bool default n -config BUSYBOX_DEFAULT_FEATURE_LOADFONT_PSF2 - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LOADFONT_RAW - bool - default n config BUSYBOX_DEFAULT_MKTEMP bool default y @@ -1032,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 @@ -1081,10 +1138,10 @@ config BUSYBOX_DEFAULT_FEATURE_FIND_LINKS config BUSYBOX_DEFAULT_GREP bool default y -config BUSYBOX_DEFAULT_FEATURE_GREP_EGREP_ALIAS +config BUSYBOX_DEFAULT_EGREP bool default y -config BUSYBOX_DEFAULT_FEATURE_GREP_FGREP_ALIAS +config BUSYBOX_DEFAULT_FGREP bool default y config BUSYBOX_DEFAULT_FEATURE_GREP_CONTEXT @@ -1120,6 +1177,12 @@ config BUSYBOX_DEFAULT_FEATURE_BOOTCHARTD_CONFIG_FILE config BUSYBOX_DEFAULT_HALT bool default y +config BUSYBOX_DEFAULT_POWEROFF + bool + default y +config BUSYBOX_DEFAULT_REBOOT + bool + default y config BUSYBOX_DEFAULT_FEATURE_CALL_TELINIT bool default n @@ -1147,7 +1210,7 @@ config BUSYBOX_DEFAULT_FEATURE_INIT_SCTTY config BUSYBOX_DEFAULT_FEATURE_INIT_SYSLOG bool default n -config BUSYBOX_DEFAULT_FEATURE_EXTRA_QUIET +config BUSYBOX_DEFAULT_FEATURE_INIT_QUIET bool default n config BUSYBOX_DEFAULT_FEATURE_INIT_COREDUMPS @@ -1267,6 +1330,9 @@ config BUSYBOX_DEFAULT_FEATURE_SU_SYSLOG config BUSYBOX_DEFAULT_FEATURE_SU_CHECKS_SHELLS bool default n +config BUSYBOX_DEFAULT_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY + bool + default n config BUSYBOX_DEFAULT_SULOGIN bool default n @@ -1285,45 +1351,42 @@ config BUSYBOX_DEFAULT_LSATTR config BUSYBOX_DEFAULT_TUNE2FS bool default n -config BUSYBOX_DEFAULT_MODINFO - bool - default n config BUSYBOX_DEFAULT_MODPROBE_SMALL bool default n -config BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED +config BUSYBOX_DEFAULT_DEPMOD bool default n config BUSYBOX_DEFAULT_INSMOD bool default n -config BUSYBOX_DEFAULT_RMMOD - bool - default n config BUSYBOX_DEFAULT_LSMOD bool default n config BUSYBOX_DEFAULT_FEATURE_LSMOD_PRETTY_2_6_OUTPUT bool default n +config BUSYBOX_DEFAULT_MODINFO + bool + default n config BUSYBOX_DEFAULT_MODPROBE bool default n config BUSYBOX_DEFAULT_FEATURE_MODPROBE_BLACKLIST bool default n -config BUSYBOX_DEFAULT_DEPMOD +config BUSYBOX_DEFAULT_RMMOD + bool + default n +config BUSYBOX_DEFAULT_FEATURE_CMDLINE_MODULE_OPTIONS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED bool default n config BUSYBOX_DEFAULT_FEATURE_2_4_MODULES bool default n -config BUSYBOX_DEFAULT_FEATURE_INSMOD_TRY_MMAP - bool - default n config BUSYBOX_DEFAULT_FEATURE_INSMOD_VERSION_CHECKING bool default n @@ -1342,6 +1405,9 @@ config BUSYBOX_DEFAULT_FEATURE_INSMOD_LOAD_MAP_FULL config BUSYBOX_DEFAULT_FEATURE_CHECK_TAINTED_MODULE bool default n +config BUSYBOX_DEFAULT_FEATURE_INSMOD_TRY_MMAP + bool + default n config BUSYBOX_DEFAULT_FEATURE_MODUTILS_ALIAS bool default n @@ -1354,102 +1420,39 @@ config BUSYBOX_DEFAULT_DEFAULT_MODULES_DIR config BUSYBOX_DEFAULT_DEFAULT_DEPMOD_FILE string default "" -config BUSYBOX_DEFAULT_BLKDISCARD - bool - default n -config BUSYBOX_DEFAULT_BLOCKDEV - bool - default n -config BUSYBOX_DEFAULT_FATATTR - bool - default n -config BUSYBOX_DEFAULT_FSTRIM - bool - default n -config BUSYBOX_DEFAULT_MDEV - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MDEV_CONF - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MDEV_RENAME - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MDEV_RENAME_REGEXP - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MDEV_EXEC - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MDEV_LOAD_FIRMWARE - bool - default n -config BUSYBOX_DEFAULT_MOUNT - bool - default y -config BUSYBOX_DEFAULT_FEATURE_MOUNT_FAKE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MOUNT_VERBOSE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MOUNT_HELPERS - bool - default y -config BUSYBOX_DEFAULT_FEATURE_MOUNT_LABEL - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MOUNT_NFS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MOUNT_CIFS - bool - default y -config BUSYBOX_DEFAULT_FEATURE_MOUNT_FLAGS - bool - default y -config BUSYBOX_DEFAULT_FEATURE_MOUNT_FSTAB - bool - default y -config BUSYBOX_DEFAULT_FEATURE_MOUNT_OTHERTAB - bool - default n -config BUSYBOX_DEFAULT_NSENTER - bool - default n -config BUSYBOX_DEFAULT_FEATURE_NSENTER_LONG_OPTS - bool - default n -config BUSYBOX_DEFAULT_REV - bool - default n -config BUSYBOX_DEFAULT_SETARCH - bool - default n -config BUSYBOX_DEFAULT_UEVENT - bool - default n -config BUSYBOX_DEFAULT_UNSHARE - bool - default n config BUSYBOX_DEFAULT_ACPID bool default n config BUSYBOX_DEFAULT_FEATURE_ACPID_COMPAT bool default n +config BUSYBOX_DEFAULT_BLKDISCARD + bool + default n config BUSYBOX_DEFAULT_BLKID bool default n config BUSYBOX_DEFAULT_FEATURE_BLKID_TYPE bool default n +config BUSYBOX_DEFAULT_BLOCKDEV + bool + default n +config BUSYBOX_DEFAULT_CAL + bool + default n config BUSYBOX_DEFAULT_DMESG bool default y config BUSYBOX_DEFAULT_FEATURE_DMESG_PRETTY bool default y +config BUSYBOX_DEFAULT_FALLOCATE + bool + default n +config BUSYBOX_DEFAULT_FATATTR + bool + default n config BUSYBOX_DEFAULT_FBSET bool default n @@ -1459,9 +1462,6 @@ config BUSYBOX_DEFAULT_FEATURE_FBSET_FANCY config BUSYBOX_DEFAULT_FEATURE_FBSET_READMODE bool default n -config BUSYBOX_DEFAULT_FDFLUSH - bool - default n config BUSYBOX_DEFAULT_FDFORMAT bool default n @@ -1498,25 +1498,19 @@ config BUSYBOX_DEFAULT_FINDFS config BUSYBOX_DEFAULT_FLOCK bool default n +config BUSYBOX_DEFAULT_FDFLUSH + bool + default n config BUSYBOX_DEFAULT_FREERAMDISK bool default n config BUSYBOX_DEFAULT_FSCK_MINIX bool default n -config BUSYBOX_DEFAULT_MKFS_EXT2 +config BUSYBOX_DEFAULT_FSFREEZE bool default n -config BUSYBOX_DEFAULT_MKFS_MINIX - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MINIX2 - bool - default n -config BUSYBOX_DEFAULT_MKFS_REISER - bool - default n -config BUSYBOX_DEFAULT_MKFS_VFAT +config BUSYBOX_DEFAULT_FSTRIM bool default n config BUSYBOX_DEFAULT_GETOPT @@ -1534,6 +1528,9 @@ config BUSYBOX_DEFAULT_FEATURE_HEXDUMP_REVERSE config BUSYBOX_DEFAULT_HD bool default n +config BUSYBOX_DEFAULT_XXD + bool + default n config BUSYBOX_DEFAULT_HWCLOCK bool default y @@ -1558,6 +1555,45 @@ config BUSYBOX_DEFAULT_LSPCI config BUSYBOX_DEFAULT_LSUSB bool default n +config BUSYBOX_DEFAULT_MDEV + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MDEV_CONF + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MDEV_RENAME + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MDEV_RENAME_REGEXP + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MDEV_EXEC + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MDEV_LOAD_FIRMWARE + bool + default n +config BUSYBOX_DEFAULT_MKE2FS + bool + default n +config BUSYBOX_DEFAULT_MKFS_EXT2 + bool + default n +config BUSYBOX_DEFAULT_MKFS_MINIX + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MINIX2 + bool + default n +config BUSYBOX_DEFAULT_MKFS_REISER + bool + default n +config BUSYBOX_DEFAULT_MKDOSFS + bool + default n +config BUSYBOX_DEFAULT_MKFS_VFAT + bool + default n config BUSYBOX_DEFAULT_MKSWAP bool default y @@ -1567,6 +1603,42 @@ config BUSYBOX_DEFAULT_FEATURE_MKSWAP_UUID config BUSYBOX_DEFAULT_MORE bool default n +config BUSYBOX_DEFAULT_MOUNT + bool + default y +config BUSYBOX_DEFAULT_FEATURE_MOUNT_FAKE + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MOUNT_VERBOSE + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MOUNT_HELPERS + bool + default y +config BUSYBOX_DEFAULT_FEATURE_MOUNT_LABEL + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MOUNT_NFS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MOUNT_CIFS + bool + default y +config BUSYBOX_DEFAULT_FEATURE_MOUNT_FLAGS + bool + default y +config BUSYBOX_DEFAULT_FEATURE_MOUNT_FSTAB + bool + default y +config BUSYBOX_DEFAULT_FEATURE_MOUNT_OTHERTAB + bool + default n +config BUSYBOX_DEFAULT_NSENTER + bool + default n +config BUSYBOX_DEFAULT_FEATURE_NSENTER_LONG_OPTS + bool + default n config BUSYBOX_DEFAULT_PIVOT_ROOT bool default y @@ -1579,6 +1651,9 @@ config BUSYBOX_DEFAULT_RDEV config BUSYBOX_DEFAULT_READPROFILE bool default n +config BUSYBOX_DEFAULT_REV + bool + default n config BUSYBOX_DEFAULT_RTCWAKE bool default n @@ -1588,7 +1663,19 @@ config BUSYBOX_DEFAULT_SCRIPT config BUSYBOX_DEFAULT_SCRIPTREPLAY bool default n -config BUSYBOX_DEFAULT_SWAPONOFF +config BUSYBOX_DEFAULT_SETARCH + bool + default n +config BUSYBOX_DEFAULT_LINUX32 + bool + default n +config BUSYBOX_DEFAULT_LINUX64 + bool + default n +config BUSYBOX_DEFAULT_SETPRIV + bool + default n +config BUSYBOX_DEFAULT_SWAPON bool default n config BUSYBOX_DEFAULT_FEATURE_SWAPON_DISCARD @@ -1597,15 +1684,24 @@ config BUSYBOX_DEFAULT_FEATURE_SWAPON_DISCARD config BUSYBOX_DEFAULT_FEATURE_SWAPON_PRI bool default n +config BUSYBOX_DEFAULT_SWAPOFF + bool + default n config BUSYBOX_DEFAULT_SWITCH_ROOT bool default y +config BUSYBOX_DEFAULT_UEVENT + bool + default n config BUSYBOX_DEFAULT_UMOUNT bool default y config BUSYBOX_DEFAULT_FEATURE_UMOUNT_ALL bool default y +config BUSYBOX_DEFAULT_UNSHARE + bool + default n config BUSYBOX_DEFAULT_FEATURE_MOUNT_LOOP bool default y @@ -1678,114 +1774,15 @@ config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_SQUASHFS config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_SYSV bool default n +config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_UBIFS + bool + default n config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_UDF bool default n config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_XFS bool default n -config BUSYBOX_DEFAULT_CONSPY - bool - default n -config BUSYBOX_DEFAULT_CROND - bool - default y -config BUSYBOX_DEFAULT_FEATURE_CROND_D - bool - default n -config BUSYBOX_DEFAULT_FEATURE_CROND_CALL_SENDMAIL - bool - default n -config BUSYBOX_DEFAULT_FEATURE_CROND_DIR - string - default "/etc" -config BUSYBOX_DEFAULT_I2CGET - bool - default n -config BUSYBOX_DEFAULT_I2CSET - bool - default n -config BUSYBOX_DEFAULT_I2CDUMP - bool - default n -config BUSYBOX_DEFAULT_I2CDETECT - bool - default n -config BUSYBOX_DEFAULT_LESS - bool - default y -config BUSYBOX_DEFAULT_FEATURE_LESS_MAXLINES - int - default 9999999 -config BUSYBOX_DEFAULT_FEATURE_LESS_BRACKETS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_FLAGS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_TRUNCATE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_MARKS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_REGEXP - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_WINCH - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_ASK_TERMINAL - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_DASHCMD - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_LINENUMS - bool - default n -config BUSYBOX_DEFAULT_NANDWRITE - bool - default n -config BUSYBOX_DEFAULT_NANDDUMP - bool - default n -config BUSYBOX_DEFAULT_RFKILL - bool - default n -config BUSYBOX_DEFAULT_SETSERIAL - bool - default n -config BUSYBOX_DEFAULT_TASKSET - bool - default n -config BUSYBOX_DEFAULT_FEATURE_TASKSET_FANCY - bool - default n -config BUSYBOX_DEFAULT_UBIATTACH - bool - default n -config BUSYBOX_DEFAULT_UBIDETACH - bool - default n -config BUSYBOX_DEFAULT_UBIMKVOL - bool - default n -config BUSYBOX_DEFAULT_UBIRMVOL - bool - default n -config BUSYBOX_DEFAULT_UBIRSVOL - bool - default n -config BUSYBOX_DEFAULT_UBIUPDATEVOL - bool - default n -config BUSYBOX_DEFAULT_UBIRENAME - bool - default n -config BUSYBOX_DEFAULT_WALL - bool - default n config BUSYBOX_DEFAULT_ADJTIMEX bool default n @@ -1831,6 +1828,21 @@ config BUSYBOX_DEFAULT_FEATURE_CHAT_CLR_ABORT config BUSYBOX_DEFAULT_CHRT bool default n +config BUSYBOX_DEFAULT_CONSPY + bool + default n +config BUSYBOX_DEFAULT_CROND + bool + default y +config BUSYBOX_DEFAULT_FEATURE_CROND_D + bool + default n +config BUSYBOX_DEFAULT_FEATURE_CROND_CALL_SENDMAIL + bool + default n +config BUSYBOX_DEFAULT_FEATURE_CROND_DIR + string + default "/etc" config BUSYBOX_DEFAULT_CRONTAB bool default y @@ -1867,7 +1879,7 @@ config BUSYBOX_DEFAULT_FEATURE_EJECT_SCSI config BUSYBOX_DEFAULT_FBSPLASH bool default n -config BUSYBOX_DEFAULT_FLASHCP +config BUSYBOX_DEFAULT_FLASH_ERASEALL bool default n config BUSYBOX_DEFAULT_FLASH_LOCK @@ -1876,19 +1888,7 @@ config BUSYBOX_DEFAULT_FLASH_LOCK config BUSYBOX_DEFAULT_FLASH_UNLOCK bool default n -config BUSYBOX_DEFAULT_FLASH_ERASEALL - bool - default n -config BUSYBOX_DEFAULT_IONICE - bool - default n -config BUSYBOX_DEFAULT_INOTIFYD - bool - default n -config BUSYBOX_DEFAULT_LAST - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LAST_FANCY +config BUSYBOX_DEFAULT_FLASHCP bool default n config BUSYBOX_DEFAULT_HDPARM @@ -1912,9 +1912,69 @@ config BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_TRISTATE_HWIF config BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_GETSET_DMA bool default n +config BUSYBOX_DEFAULT_I2CGET + bool + default n +config BUSYBOX_DEFAULT_I2CSET + bool + default n +config BUSYBOX_DEFAULT_I2CDUMP + bool + default n +config BUSYBOX_DEFAULT_I2CDETECT + bool + default n +config BUSYBOX_DEFAULT_INOTIFYD + bool + default n +config BUSYBOX_DEFAULT_IONICE + bool + default n +config BUSYBOX_DEFAULT_LAST + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LAST_FANCY + bool + default n +config BUSYBOX_DEFAULT_LESS + bool + default y +config BUSYBOX_DEFAULT_FEATURE_LESS_MAXLINES + int + default 9999999 +config BUSYBOX_DEFAULT_FEATURE_LESS_BRACKETS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_FLAGS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_TRUNCATE + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_MARKS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_REGEXP + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_WINCH + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_ASK_TERMINAL + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_DASHCMD + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_LINENUMS + bool + default n config BUSYBOX_DEFAULT_LOCK bool default y +config BUSYBOX_DEFAULT_LSSCSI + bool + default n config BUSYBOX_DEFAULT_MAKEDEVS bool default n @@ -1936,24 +1996,45 @@ config BUSYBOX_DEFAULT_MOUNTPOINT config BUSYBOX_DEFAULT_MT bool default n +config BUSYBOX_DEFAULT_NANDWRITE + bool + default n +config BUSYBOX_DEFAULT_NANDDUMP + bool + default n +config BUSYBOX_DEFAULT_PARTPROBE + bool + default n config BUSYBOX_DEFAULT_RAIDAUTORUN bool default n config BUSYBOX_DEFAULT_READAHEAD bool default n +config BUSYBOX_DEFAULT_RFKILL + bool + default n config BUSYBOX_DEFAULT_RUNLEVEL bool default n config BUSYBOX_DEFAULT_RX bool default n +config BUSYBOX_DEFAULT_SETSERIAL + bool + default n config BUSYBOX_DEFAULT_SETSID bool default n config BUSYBOX_DEFAULT_STRINGS bool default y +config BUSYBOX_DEFAULT_TASKSET + bool + default n +config BUSYBOX_DEFAULT_FEATURE_TASKSET_FANCY + bool + default n config BUSYBOX_DEFAULT_TIME bool default y @@ -1963,66 +2044,36 @@ config BUSYBOX_DEFAULT_TIMEOUT config BUSYBOX_DEFAULT_TTYSIZE bool default n +config BUSYBOX_DEFAULT_UBIATTACH + bool + default n +config BUSYBOX_DEFAULT_UBIDETACH + bool + default n +config BUSYBOX_DEFAULT_UBIMKVOL + bool + default n +config BUSYBOX_DEFAULT_UBIRMVOL + bool + default n +config BUSYBOX_DEFAULT_UBIRSVOL + bool + default n +config BUSYBOX_DEFAULT_UBIUPDATEVOL + bool + default n +config BUSYBOX_DEFAULT_UBIRENAME + bool + default n config BUSYBOX_DEFAULT_VOLNAME bool default n +config BUSYBOX_DEFAULT_WALL + bool + default n config BUSYBOX_DEFAULT_WATCHDOG bool default n -config BUSYBOX_DEFAULT_NAMEIF - bool - default n -config BUSYBOX_DEFAULT_FEATURE_NAMEIF_EXTENDED - bool - default n -config BUSYBOX_DEFAULT_NBDCLIENT - bool - default n -config BUSYBOX_DEFAULT_NC - bool - default y -config BUSYBOX_DEFAULT_NC_SERVER - bool - default n -config BUSYBOX_DEFAULT_NC_EXTRA - bool - default n -config BUSYBOX_DEFAULT_NC_110_COMPAT - bool - default n -config BUSYBOX_DEFAULT_PING - bool - default y -config BUSYBOX_DEFAULT_PING6 - bool - default y -config BUSYBOX_DEFAULT_FEATURE_FANCY_PING - bool - default y -config BUSYBOX_DEFAULT_WGET - bool - default n -config BUSYBOX_DEFAULT_FEATURE_WGET_STATUSBAR - bool - default n -config BUSYBOX_DEFAULT_FEATURE_WGET_AUTHENTICATION - bool - default n -config BUSYBOX_DEFAULT_FEATURE_WGET_LONG_OPTIONS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_WGET_TIMEOUT - bool - default n -config BUSYBOX_DEFAULT_FEATURE_WGET_OPENSSL - bool - default n -config BUSYBOX_DEFAULT_FEATURE_WGET_SSL_HELPER - bool - default n -config BUSYBOX_DEFAULT_WHOIS - bool - default n config BUSYBOX_DEFAULT_FEATURE_IPV6 bool default y @@ -2056,19 +2107,16 @@ config BUSYBOX_DEFAULT_DNSD config BUSYBOX_DEFAULT_ETHER_WAKE bool default n -config BUSYBOX_DEFAULT_FAKEIDENTD - bool - default n config BUSYBOX_DEFAULT_FTPD bool default n -config BUSYBOX_DEFAULT_FEATURE_FTP_WRITE +config BUSYBOX_DEFAULT_FEATURE_FTPD_WRITE bool default n config BUSYBOX_DEFAULT_FEATURE_FTPD_ACCEPT_BROKEN_LIST bool default n -config BUSYBOX_DEFAULT_FEATURE_FTP_AUTHENTICATION +config BUSYBOX_DEFAULT_FEATURE_FTPD_AUTHENTICATION bool default n config BUSYBOX_DEFAULT_FTPGET @@ -2083,6 +2131,9 @@ config BUSYBOX_DEFAULT_FEATURE_FTPGETPUT_LONG_OPTIONS config BUSYBOX_DEFAULT_HOSTNAME bool default n +config BUSYBOX_DEFAULT_DNSDOMAINNAME + bool + default n config BUSYBOX_DEFAULT_HTTPD bool default n @@ -2143,7 +2194,10 @@ config BUSYBOX_DEFAULT_IFENSLAVE config BUSYBOX_DEFAULT_IFPLUGD bool default n -config BUSYBOX_DEFAULT_IFUPDOWN +config BUSYBOX_DEFAULT_IFUP + bool + default n +config BUSYBOX_DEFAULT_IFDOWN bool default n config BUSYBOX_DEFAULT_IFUPDOWN_IFSTATE_PATH @@ -2152,12 +2206,6 @@ config BUSYBOX_DEFAULT_IFUPDOWN_IFSTATE_PATH config BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IP bool default n -config BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IP_BUILTIN - bool - default n -config BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN - bool - default n config BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IPV4 bool default n @@ -2194,6 +2242,24 @@ config BUSYBOX_DEFAULT_FEATURE_INETD_RPC config BUSYBOX_DEFAULT_IP bool default y +config BUSYBOX_DEFAULT_IPADDR + bool + default n +config BUSYBOX_DEFAULT_IPLINK + bool + default n +config BUSYBOX_DEFAULT_IPROUTE + bool + default n +config BUSYBOX_DEFAULT_IPTUNNEL + bool + default n +config BUSYBOX_DEFAULT_IPRULE + bool + default n +config BUSYBOX_DEFAULT_IPNEIGH + bool + default n config BUSYBOX_DEFAULT_FEATURE_IP_ADDRESS bool default y @@ -2214,31 +2280,10 @@ config BUSYBOX_DEFAULT_FEATURE_IP_RULE default y config BUSYBOX_DEFAULT_FEATURE_IP_NEIGH bool - default n -config BUSYBOX_DEFAULT_FEATURE_IP_SHORT_FORMS - bool - default n + default y config BUSYBOX_DEFAULT_FEATURE_IP_RARE_PROTOCOLS bool default n -config BUSYBOX_DEFAULT_IPADDR - bool - default n -config BUSYBOX_DEFAULT_IPLINK - bool - default n -config BUSYBOX_DEFAULT_IPROUTE - bool - default n -config BUSYBOX_DEFAULT_IPTUNNEL - bool - default n -config BUSYBOX_DEFAULT_IPRULE - bool - default n -config BUSYBOX_DEFAULT_IPNEIGH - bool - default n config BUSYBOX_DEFAULT_IPCALC bool default n @@ -2248,6 +2293,30 @@ config BUSYBOX_DEFAULT_FEATURE_IPCALC_FANCY config BUSYBOX_DEFAULT_FEATURE_IPCALC_LONG_OPTIONS bool default n +config BUSYBOX_DEFAULT_FAKEIDENTD + bool + default n +config BUSYBOX_DEFAULT_NAMEIF + bool + default n +config BUSYBOX_DEFAULT_FEATURE_NAMEIF_EXTENDED + bool + default n +config BUSYBOX_DEFAULT_NBDCLIENT + bool + default n +config BUSYBOX_DEFAULT_NC + bool + default y +config BUSYBOX_DEFAULT_NC_SERVER + bool + default n +config BUSYBOX_DEFAULT_NC_EXTRA + bool + default n +config BUSYBOX_DEFAULT_NC_110_COMPAT + bool + default n config BUSYBOX_DEFAULT_NETMSG bool default y @@ -2263,9 +2332,12 @@ 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_OPENWRT_LONG_OPTIONS + bool + default n config BUSYBOX_DEFAULT_NTPD bool default y @@ -2275,6 +2347,15 @@ config BUSYBOX_DEFAULT_FEATURE_NTPD_SERVER config BUSYBOX_DEFAULT_FEATURE_NTPD_CONF bool default n +config BUSYBOX_DEFAULT_PING + bool + default y +config BUSYBOX_DEFAULT_PING6 + bool + default y +config BUSYBOX_DEFAULT_FEATURE_FANCY_PING + bool + default y config BUSYBOX_DEFAULT_PSCAN bool default n @@ -2284,9 +2365,15 @@ config BUSYBOX_DEFAULT_ROUTE config BUSYBOX_DEFAULT_SLATTACH bool default n +config BUSYBOX_DEFAULT_SSL_CLIENT + bool + default n config BUSYBOX_DEFAULT_TCPSVD bool default n +config BUSYBOX_DEFAULT_UDPSVD + bool + default n config BUSYBOX_DEFAULT_TELNET bool default n @@ -2296,6 +2383,9 @@ config BUSYBOX_DEFAULT_FEATURE_TELNET_TTYPE config BUSYBOX_DEFAULT_FEATURE_TELNET_AUTOLOGIN bool default n +config BUSYBOX_DEFAULT_FEATURE_TELNET_WIDTH + bool + default n config BUSYBOX_DEFAULT_TELNETD bool default n @@ -2326,6 +2416,9 @@ config BUSYBOX_DEFAULT_FEATURE_TFTP_PROGRESS_BAR config BUSYBOX_DEFAULT_TFTP_DEBUG bool default n +config BUSYBOX_DEFAULT_TLS + bool + default n config BUSYBOX_DEFAULT_TRACEROUTE bool default y @@ -2335,9 +2428,6 @@ config BUSYBOX_DEFAULT_TRACEROUTE6 config BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_VERBOSE bool default y -config BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_SOURCE_ROUTE - bool - default n config BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_USE_ICMP bool default n @@ -2347,18 +2437,51 @@ config BUSYBOX_DEFAULT_TUNCTL config BUSYBOX_DEFAULT_FEATURE_TUNCTL_UG bool default n +config BUSYBOX_DEFAULT_VCONFIG + bool + default n +config BUSYBOX_DEFAULT_WGET + bool + default n +config BUSYBOX_DEFAULT_FEATURE_WGET_STATUSBAR + bool + default n +config BUSYBOX_DEFAULT_FEATURE_WGET_AUTHENTICATION + bool + default n +config BUSYBOX_DEFAULT_FEATURE_WGET_LONG_OPTIONS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_WGET_TIMEOUT + bool + default n +config BUSYBOX_DEFAULT_FEATURE_WGET_HTTPS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_WGET_OPENSSL + bool + default n +config BUSYBOX_DEFAULT_WHOIS + bool + default n +config BUSYBOX_DEFAULT_ZCIP + bool + default n config BUSYBOX_DEFAULT_UDHCPC6 bool default n +config BUSYBOX_DEFAULT_FEATURE_UDHCPC6_RFC3646 + bool + default n +config BUSYBOX_DEFAULT_FEATURE_UDHCPC6_RFC4704 + bool + default n +config BUSYBOX_DEFAULT_FEATURE_UDHCPC6_RFC4833 + bool + default n config BUSYBOX_DEFAULT_UDHCPD bool default n -config BUSYBOX_DEFAULT_DHCPRELAY - bool - default n -config BUSYBOX_DEFAULT_DUMPLEASES - bool - default n config BUSYBOX_DEFAULT_FEATURE_UDHCPD_WRITE_LEASES_EARLY bool default n @@ -2368,6 +2491,12 @@ config BUSYBOX_DEFAULT_FEATURE_UDHCPD_BASE_IP_ON_MAC config BUSYBOX_DEFAULT_DHCPD_LEASES_FILE string default "" +config BUSYBOX_DEFAULT_DUMPLEASES + bool + default n +config BUSYBOX_DEFAULT_DHCPRELAY + bool + default n config BUSYBOX_DEFAULT_UDHCPC bool default y @@ -2398,15 +2527,6 @@ config BUSYBOX_DEFAULT_UDHCPC_SLACK_FOR_BUGGY_SERVERS config BUSYBOX_DEFAULT_IFUPDOWN_UDHCPC_CMD_OPTIONS string default "" -config BUSYBOX_DEFAULT_UDPSVD - bool - default n -config BUSYBOX_DEFAULT_VCONFIG - bool - default n -config BUSYBOX_DEFAULT_ZCIP - bool - default n config BUSYBOX_DEFAULT_LPD bool default n @@ -2419,9 +2539,6 @@ config BUSYBOX_DEFAULT_LPQ config BUSYBOX_DEFAULT_MAKEMIME bool default n -config BUSYBOX_DEFAULT_FEATURE_MIME_CHARSET - string - default "" config BUSYBOX_DEFAULT_POPMAILDIR bool default n @@ -2437,9 +2554,27 @@ config BUSYBOX_DEFAULT_FEATURE_REFORMIME_COMPAT config BUSYBOX_DEFAULT_SENDMAIL bool default n +config BUSYBOX_DEFAULT_FEATURE_MIME_CHARSET + string + default "" +config BUSYBOX_DEFAULT_FREE + bool + default y +config BUSYBOX_DEFAULT_FUSER + bool + default n config BUSYBOX_DEFAULT_IOSTAT bool default n +config BUSYBOX_DEFAULT_KILL + bool + default y +config BUSYBOX_DEFAULT_KILLALL + bool + default y +config BUSYBOX_DEFAULT_KILLALL5 + bool + default n config BUSYBOX_DEFAULT_LSOF bool default n @@ -2449,24 +2584,69 @@ config BUSYBOX_DEFAULT_MPSTAT config BUSYBOX_DEFAULT_NMETER bool default n +config BUSYBOX_DEFAULT_PGREP + bool + default y +config BUSYBOX_DEFAULT_PKILL + bool + default n +config BUSYBOX_DEFAULT_PIDOF + bool + default y +config BUSYBOX_DEFAULT_FEATURE_PIDOF_SINGLE + bool + default n +config BUSYBOX_DEFAULT_FEATURE_PIDOF_OMIT + bool + default n config BUSYBOX_DEFAULT_PMAP bool default n config BUSYBOX_DEFAULT_POWERTOP bool default n +config BUSYBOX_DEFAULT_FEATURE_POWERTOP_INTERACTIVE + bool + default n +config BUSYBOX_DEFAULT_PS + bool + default y +config BUSYBOX_DEFAULT_FEATURE_PS_WIDE + bool + default y +config BUSYBOX_DEFAULT_FEATURE_PS_LONG + bool + default n +config BUSYBOX_DEFAULT_FEATURE_PS_TIME + bool + default n +config BUSYBOX_DEFAULT_FEATURE_PS_ADDITIONAL_COLUMNS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_PS_UNUSUAL_SYSTEMS + bool + default n config BUSYBOX_DEFAULT_PSTREE bool default n config BUSYBOX_DEFAULT_PWDX bool default n +config BUSYBOX_DEFAULT_RENICE + bool + default n config BUSYBOX_DEFAULT_SMEMCAP bool default n +config BUSYBOX_DEFAULT_BB_SYSCTL + bool + default y config BUSYBOX_DEFAULT_TOP bool default y +config BUSYBOX_DEFAULT_FEATURE_TOP_INTERACTIVE + bool + default n config BUSYBOX_DEFAULT_FEATURE_TOP_CPU_USAGE_PERCENTAGE bool default y @@ -2491,66 +2671,12 @@ config BUSYBOX_DEFAULT_UPTIME config BUSYBOX_DEFAULT_FEATURE_UPTIME_UTMP_SUPPORT bool default n -config BUSYBOX_DEFAULT_FREE - bool - default y -config BUSYBOX_DEFAULT_FUSER - bool - default n -config BUSYBOX_DEFAULT_KILL - bool - default y -config BUSYBOX_DEFAULT_KILLALL - bool - default y -config BUSYBOX_DEFAULT_KILLALL5 - bool - default n -config BUSYBOX_DEFAULT_PGREP - bool - default y -config BUSYBOX_DEFAULT_PIDOF - bool - default y -config BUSYBOX_DEFAULT_FEATURE_PIDOF_SINGLE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_PIDOF_OMIT - bool - default n -config BUSYBOX_DEFAULT_PKILL - bool - default n -config BUSYBOX_DEFAULT_PS - bool - default y -config BUSYBOX_DEFAULT_FEATURE_PS_WIDE - bool - default y -config BUSYBOX_DEFAULT_FEATURE_PS_LONG - bool - default n -config BUSYBOX_DEFAULT_FEATURE_PS_TIME - bool - default n -config BUSYBOX_DEFAULT_FEATURE_PS_ADDITIONAL_COLUMNS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_PS_UNUSUAL_SYSTEMS - bool - default n -config BUSYBOX_DEFAULT_RENICE - bool - default n -config BUSYBOX_DEFAULT_BB_SYSCTL - bool - default y -config BUSYBOX_DEFAULT_FEATURE_SHOW_THREADS - bool - default n config BUSYBOX_DEFAULT_WATCH bool default n +config BUSYBOX_DEFAULT_FEATURE_SHOW_THREADS + bool + default n config BUSYBOX_DEFAULT_CHPST bool default n @@ -2581,6 +2707,9 @@ config BUSYBOX_DEFAULT_SV config BUSYBOX_DEFAULT_SV_DEFAULT_SERVICE_DIR string default "" +config BUSYBOX_DEFAULT_SVC + bool + default n config BUSYBOX_DEFAULT_SVLOGD bool default n @@ -2602,9 +2731,6 @@ config BUSYBOX_DEFAULT_LOAD_POLICY config BUSYBOX_DEFAULT_MATCHPATHCON bool default n -config BUSYBOX_DEFAULT_RESTORECON - bool - default n config BUSYBOX_DEFAULT_RUNCON bool default n @@ -2614,6 +2740,9 @@ config BUSYBOX_DEFAULT_FEATURE_RUNCON_LONG_OPTIONS config BUSYBOX_DEFAULT_SELINUXENABLED bool default n +config BUSYBOX_DEFAULT_SESTATUS + bool + default n config BUSYBOX_DEFAULT_SETENFORCE bool default n @@ -2623,55 +2752,76 @@ config BUSYBOX_DEFAULT_SETFILES config BUSYBOX_DEFAULT_FEATURE_SETFILES_CHECK_OPTION bool default n +config BUSYBOX_DEFAULT_RESTORECON + bool + default n config BUSYBOX_DEFAULT_SETSEBOOL bool default n -config BUSYBOX_DEFAULT_SESTATUS +config BUSYBOX_DEFAULT_SH_IS_ASH + bool + default y +config BUSYBOX_DEFAULT_SH_IS_HUSH bool default n +config BUSYBOX_DEFAULT_SH_IS_NONE + bool + default n +config BUSYBOX_DEFAULT_BASH_IS_ASH + bool + default n +config BUSYBOX_DEFAULT_BASH_IS_HUSH + bool + default n +config BUSYBOX_DEFAULT_BASH_IS_NONE + bool + default y config BUSYBOX_DEFAULT_ASH bool default y +config BUSYBOX_DEFAULT_ASH_OPTIMIZE_FOR_SIZE + bool + default n +config BUSYBOX_DEFAULT_ASH_INTERNAL_GLOB + bool + default y config BUSYBOX_DEFAULT_ASH_BASH_COMPAT bool default y -config BUSYBOX_DEFAULT_ASH_IDLE_TIMEOUT - bool - default n config BUSYBOX_DEFAULT_ASH_JOB_CONTROL bool default y config BUSYBOX_DEFAULT_ASH_ALIAS bool default y -config BUSYBOX_DEFAULT_ASH_GETOPTS +config BUSYBOX_DEFAULT_ASH_RANDOM_SUPPORT + bool + default n +config BUSYBOX_DEFAULT_ASH_EXPAND_PRMT bool default y -config BUSYBOX_DEFAULT_ASH_BUILTIN_ECHO +config BUSYBOX_DEFAULT_ASH_IDLE_TIMEOUT + bool + default n +config BUSYBOX_DEFAULT_ASH_MAIL + bool + default n +config BUSYBOX_DEFAULT_ASH_ECHO bool default y -config BUSYBOX_DEFAULT_ASH_BUILTIN_PRINTF +config BUSYBOX_DEFAULT_ASH_PRINTF bool default y -config BUSYBOX_DEFAULT_ASH_BUILTIN_TEST +config BUSYBOX_DEFAULT_ASH_TEST bool default y config BUSYBOX_DEFAULT_ASH_HELP bool default n -config BUSYBOX_DEFAULT_ASH_CMDCMD +config BUSYBOX_DEFAULT_ASH_GETOPTS bool default y -config BUSYBOX_DEFAULT_ASH_MAIL - bool - default n -config BUSYBOX_DEFAULT_ASH_OPTIMIZE_FOR_SIZE - bool - default n -config BUSYBOX_DEFAULT_ASH_RANDOM_SUPPORT - bool - default n -config BUSYBOX_DEFAULT_ASH_EXPAND_PRMT +config BUSYBOX_DEFAULT_ASH_CMDCMD bool default y config BUSYBOX_DEFAULT_CTTYHACK @@ -2719,37 +2869,61 @@ config BUSYBOX_DEFAULT_HUSH_LOCAL config BUSYBOX_DEFAULT_HUSH_RANDOM_SUPPORT bool default n +config BUSYBOX_DEFAULT_HUSH_MODE_X + bool + default n +config BUSYBOX_DEFAULT_HUSH_ECHO + bool + default n +config BUSYBOX_DEFAULT_HUSH_PRINTF + bool + default n +config BUSYBOX_DEFAULT_HUSH_TEST + bool + default n +config BUSYBOX_DEFAULT_HUSH_EXPORT + bool + default n config BUSYBOX_DEFAULT_HUSH_EXPORT_N bool default n -config BUSYBOX_DEFAULT_HUSH_MODE_X +config BUSYBOX_DEFAULT_HUSH_KILL + bool + default n +config BUSYBOX_DEFAULT_HUSH_WAIT + bool + default n +config BUSYBOX_DEFAULT_HUSH_TRAP + bool + default n +config BUSYBOX_DEFAULT_HUSH_TYPE + bool + default n +config BUSYBOX_DEFAULT_HUSH_READ + bool + default n +config BUSYBOX_DEFAULT_HUSH_SET + bool + default n +config BUSYBOX_DEFAULT_HUSH_UNSET + bool + default n +config BUSYBOX_DEFAULT_HUSH_ULIMIT + bool + default n +config BUSYBOX_DEFAULT_HUSH_UMASK + bool + default n +config BUSYBOX_DEFAULT_HUSH_MEMLEAK bool default n config BUSYBOX_DEFAULT_MSH bool default n -config BUSYBOX_DEFAULT_FEATURE_SH_IS_ASH +config BUSYBOX_DEFAULT_FEATURE_SH_MATH bool default y -config BUSYBOX_DEFAULT_FEATURE_SH_IS_HUSH - bool - default n -config BUSYBOX_DEFAULT_FEATURE_SH_IS_NONE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_BASH_IS_ASH - bool - default n -config BUSYBOX_DEFAULT_FEATURE_BASH_IS_HUSH - bool - default n -config BUSYBOX_DEFAULT_FEATURE_BASH_IS_NONE - bool - default y -config BUSYBOX_DEFAULT_SH_MATH_SUPPORT - bool - default y -config BUSYBOX_DEFAULT_SH_MATH_SUPPORT_64 +config BUSYBOX_DEFAULT_FEATURE_SH_MATH_64 bool default y config BUSYBOX_DEFAULT_FEATURE_SH_EXTRA_QUIET diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index 0d3708636..8866756ae 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -8,21 +8,23 @@ include $(TOPDIR)/rules.mk PKG_NAME:=busybox -PKG_VERSION:=1.25.1 -PKG_RELEASE:=4 +PKG_VERSION:=1.27.2 +PKG_RELEASE:=3 PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://www.busybox.net/downloads \ http://sources.buildroot.net -PKG_HASH:=27667e0f2328fdbd79cfd622e4453e5c57e58f781c5da97c9be337d93aa2a02e +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,11 +32,8 @@ 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)) define Package/busybox SECTION:=base @@ -44,6 +43,20 @@ 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) \ + $(call BUSYBOX_IF_ENABLED,WATCH, 100:/bin/watch:/bin/busybox) \ + $(call BUSYBOX_IF_ENABLED,IP, 100:/sbin/ip:/bin/busybox) \ + $(call BUSYBOX_IF_ENABLED,FREE, 100:/usr/bin/free:/bin/busybox) \ + $(call BUSYBOX_IF_ENABLED,PGREP, 100:/usr/bin/pgrep:/bin/busybox) \ + $(call BUSYBOX_IF_ENABLED,PKILL, 100:/usr/bin/pkill:/bin/busybox) \ + $(call BUSYBOX_IF_ENABLED,PMAP, 100:/usr/bin/pmap:/bin/busybox) \ + $(call BUSYBOX_IF_ENABLED,PWDX, 100:/usr/bin/pwdx:/bin/busybox) \ + $(call BUSYBOX_IF_ENABLED,TOP, 100:/usr/bin/top:/bin/busybox) \ + $(call BUSYBOX_IF_ENABLED,UPTIME, 100:/usr/bin/uptime:/bin/busybox) \ + endef define Package/busybox/description @@ -55,64 +68,35 @@ define Package/busybox/config source "$(SOURCE)/Config.in" endef -BUSYBOX_SYM=$(if $(CONFIG_BUSYBOX_CUSTOM),CONFIG,DEFAULT) - # 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/Config.in b/package/utils/busybox/config/Config.in index 3bf67c5cf..c66aa08e7 100644 --- a/package/utils/busybox/config/Config.in +++ b/package/utils/busybox/config/Config.in @@ -10,15 +10,18 @@ config BUSYBOX_CONFIG_HAVE_DOT_CONFIG menu "Busybox Settings" -menu "General Configuration" - config BUSYBOX_CONFIG_DESKTOP bool "Enable options for full-blown desktop systems" default BUSYBOX_DEFAULT_DESKTOP help Enable options and features which are not essential. - Select this only if you plan to use busybox on full-blown - desktop machine with common Linux distro, not on an embedded box. + Select this if you plan to use busybox on full-blown desktop machine + with common Linux distro, which needs higher level of command-line + compatibility. + + If you are preparing your build to be used on an embedded box + where you have tighter control over the entire set of userspace + tools, you can unselect this option for smaller code size. config BUSYBOX_CONFIG_EXTRA_COMPAT bool "Provide compatible behavior for rare corner cases (bigger code)" @@ -29,6 +32,19 @@ config BUSYBOX_CONFIG_EXTRA_COMPAT some GNU extensions in libc. You probably only need this option if you plan to run busybox on desktop. +config BUSYBOX_CONFIG_FEDORA_COMPAT + bool "Building for Fedora distribution" + default BUSYBOX_DEFAULT_FEDORA_COMPAT + help + This option makes some tools behave like they do on Fedora. + + At the time of this writing (2017-08) this only affects uname: + normally, uname -p (processor) and uname -i (platform) + are shown as "unknown", but with this option uname -p + shows the same string as uname -m (machine type), + and so does uname -i unless machine type is i486/i586/i686 - + then uname -i shows "i386". + config BUSYBOX_CONFIG_INCLUDE_SUSv2 bool "Enable obsolete features removed before SUSv3" default BUSYBOX_DEFAULT_INCLUDE_SUSv2 @@ -46,41 +62,6 @@ config BUSYBOX_CONFIG_USE_PORTABLE_CODE compiler other than gcc. If you do use gcc, this option may needlessly increase code size. -config BUSYBOX_CONFIG_PLATFORM_LINUX - bool "Enable Linux-specific applets and features" - default BUSYBOX_DEFAULT_PLATFORM_LINUX - help - For the most part, busybox requires only POSIX compatibility - from the target system, but some applets and features use - Linux-specific interfaces. - - Answering 'N' here will disable such applets and hide the - corresponding configuration options. - -choice - prompt "Buffer allocation policy" - default BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_ON_STACK - help - There are 3 ways BusyBox can handle buffer allocations: - - Use malloc. This costs code size for the call to xmalloc. - - Put them on stack. For some very small machines with limited stack - space, this can be deadly. For most folks, this works just fine. - - Put them in BSS. This works beautifully for computers with a real - MMU (and OS support), but wastes runtime RAM for uCLinux. This - behavior was the only one available for BusyBox versions 0.48 and - earlier. - -config BUSYBOX_CONFIG_FEATURE_BUFFERS_USE_MALLOC - bool "Allocate with Malloc" - -config BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_ON_STACK - bool "Allocate on the Stack" - -config BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_IN_BSS - bool "Allocate in the .bss section" - -endchoice - config BUSYBOX_CONFIG_SHOW_USAGE bool "Show applet usage messages" default BUSYBOX_DEFAULT_SHOW_USAGE @@ -143,153 +124,15 @@ config BUSYBOX_CONFIG_INSTALL_NO_USR will install applets only to /bin and /sbin, never to /usr/bin or /usr/sbin. -config BUSYBOX_CONFIG_LOCALE_SUPPORT - bool "Enable locale support (system needs locale for this to work)" - default BUSYBOX_DEFAULT_LOCALE_SUPPORT - help - Enable this if your system has locale support and you would like - busybox to support locale settings. - -config BUSYBOX_CONFIG_UNICODE_SUPPORT - bool "Support Unicode" - default BUSYBOX_DEFAULT_UNICODE_SUPPORT - help - This makes various applets aware that one byte is not - one character on screen. - - Busybox aims to eventually work correctly with Unicode displays. - Any older encodings are not guaranteed to work. - Probably by the time when busybox will be fully Unicode-clean, - other encodings will be mainly of historic interest. - -config BUSYBOX_CONFIG_UNICODE_USING_LOCALE - bool "Use libc routines for Unicode (else uses internal ones)" - default BUSYBOX_DEFAULT_UNICODE_USING_LOCALE - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT && BUSYBOX_CONFIG_LOCALE_SUPPORT - help - With this option on, Unicode support is implemented using libc - routines. Otherwise, internal implementation is used. - Internal implementation is smaller. - -config BUSYBOX_CONFIG_FEATURE_CHECK_UNICODE_IN_ENV - bool "Check $LC_ALL, $LC_CTYPE and $LANG environment variables" - default BUSYBOX_DEFAULT_FEATURE_CHECK_UNICODE_IN_ENV - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT && !BUSYBOX_CONFIG_UNICODE_USING_LOCALE - help - With this option on, Unicode support is activated - only if locale-related variables have the value of the form - "xxxx.utf8" - - Otherwise, Unicode support will be always enabled and active. - -config BUSYBOX_CONFIG_SUBST_WCHAR - int "Character code to substitute unprintable characters with" - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT - default BUSYBOX_DEFAULT_SUBST_WCHAR - help - Typical values are 63 for '?' (works with any output device), - 30 for ASCII substitute control code, - 65533 (0xfffd) for Unicode replacement character. - -config BUSYBOX_CONFIG_LAST_SUPPORTED_WCHAR - int "Range of supported Unicode characters" - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT - default BUSYBOX_DEFAULT_LAST_SUPPORTED_WCHAR - help - Any character with Unicode value bigger than this is assumed - to be non-printable on output device. Many applets replace - such chars with substitution character. - - The idea is that many valid printable Unicode chars are - nevertheless are not displayed correctly. Think about - combining charachers, double-wide hieroglyphs, obscure - characters in dozens of ancient scripts... - Many terminals, terminal emulators, xterms etc will fail - to handle them correctly. Choose the smallest value - which suits your needs. - - Typical values are: - 126 - ASCII only - 767 (0x2ff) - there are no combining chars in [0..767] range - (the range includes Latin 1, Latin Ext. A and B), - code is ~700 bytes smaller for this case. - 4351 (0x10ff) - there are no double-wide chars in [0..4351] range, - code is ~300 bytes smaller for this case. - 12799 (0x31ff) - nearly all non-ideographic characters are - available in [0..12799] range, including - East Asian scripts like katakana, hiragana, hangul, - bopomofo... - 0 - off, any valid printable Unicode character will be printed. - -config BUSYBOX_CONFIG_UNICODE_COMBINING_WCHARS - bool "Allow zero-width Unicode characters on output" - default BUSYBOX_DEFAULT_UNICODE_COMBINING_WCHARS - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT - help - With this option off, any Unicode char with width of 0 - is substituted on output. - -config BUSYBOX_CONFIG_UNICODE_WIDE_WCHARS - bool "Allow wide Unicode characters on output" - default BUSYBOX_DEFAULT_UNICODE_WIDE_WCHARS - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT - help - With this option off, any Unicode char with width > 1 - is substituted on output. - -config BUSYBOX_CONFIG_UNICODE_BIDI_SUPPORT - bool "Bidirectional character-aware line input" - default BUSYBOX_DEFAULT_UNICODE_BIDI_SUPPORT - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT && !BUSYBOX_CONFIG_UNICODE_USING_LOCALE - help - With this option on, right-to-left Unicode characters - are treated differently on input (e.g. cursor movement). - -config BUSYBOX_CONFIG_UNICODE_NEUTRAL_TABLE - bool "In bidi input, support non-ASCII neutral chars too" - default BUSYBOX_DEFAULT_UNICODE_NEUTRAL_TABLE - depends on BUSYBOX_CONFIG_UNICODE_BIDI_SUPPORT - help - In most cases it's enough to treat only ASCII non-letters - (i.e. punctuation, numbers and space) as characters - with neutral directionality. - With this option on, more extensive (and bigger) table - of neutral chars will be used. - -config BUSYBOX_CONFIG_UNICODE_PRESERVE_BROKEN - bool "Make it possible to enter sequences of chars which are not Unicode" - default BUSYBOX_DEFAULT_UNICODE_PRESERVE_BROKEN - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT - help - With this option on, on line-editing input (such as used by shells) - invalid UTF-8 bytes are not substituted with the selected - substitution character. - For example, this means that entering 'l', 's', ' ', 0xff, [Enter] - at shell prompt will list file named 0xff (single char name - with char value 255), not file named '?'. - config BUSYBOX_CONFIG_PAM - bool "Support for PAM (Pluggable Authentication Modules)" + bool "Support PAM (Pluggable Authentication Modules)" default BUSYBOX_DEFAULT_PAM help Use PAM in some busybox applets (currently login and httpd) instead of direct access to password database. -config BUSYBOX_CONFIG_FEATURE_USE_SENDFILE - bool "Use sendfile system call" - default BUSYBOX_DEFAULT_FEATURE_USE_SENDFILE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - When enabled, busybox will use the kernel sendfile() function - instead of read/write loops to copy data between file descriptors - (for example, cp command does this a lot). - If sendfile() doesn't work, copying code falls back to read/write - loop. sendfile() was originally implemented for faster I/O - from files to sockets, but since Linux 2.6.33 it was extended - to work for many more file types. - config BUSYBOX_CONFIG_LONG_OPTS - bool "Support for --long-options" + bool "Support --long-options" default BUSYBOX_DEFAULT_LONG_OPTS help Enable this if you want busybox applets to use the gnu --long-option @@ -356,7 +199,7 @@ config BUSYBOX_CONFIG_PID_FILE_PATH specify a pidfile path. config BUSYBOX_CONFIG_FEATURE_SUID - bool "Support for SUID/SGID handling" + bool "Support SUID/SGID handling" default BUSYBOX_DEFAULT_FEATURE_SUID help With this option you can install the busybox binary belonging @@ -496,9 +339,18 @@ config BUSYBOX_CONFIG_FEATURE_HAVE_RPC # This is automatically selected if any of enabled applets need it. # You do not need to select it manually. -endmenu +config BUSYBOX_CONFIG_PLATFORM_LINUX + bool #No description makes it a hidden option + default BUSYBOX_DEFAULT_PLATFORM_LINUX + #help + # For the most part, busybox requires only POSIX compatibility + # from the target system, but some applets and features use + # Linux-specific interfaces. + # + # This is automatically selected if any applet or feature requires + # Linux-specific interfaces. You do not need to select it manually. -menu 'Build Options' +comment 'Build Options' config BUSYBOX_CONFIG_STATIC bool "Build BusyBox as a static binary (no shared libs)" @@ -673,103 +525,7 @@ config BUSYBOX_CONFIG_EXTRA_LDLIBS help Additional LDLIBS to pass to the linker with -l. -endmenu - -menu 'Debugging Options' - -config BUSYBOX_CONFIG_DEBUG - bool "Build BusyBox with extra Debugging symbols" - default BUSYBOX_DEFAULT_DEBUG - help - Say Y here if you wish to examine BusyBox internals while applets are - running. This increases the size of the binary considerably, and - should only be used when doing development. If you are doing - development and want to debug BusyBox, answer Y. - - Most people should answer N. - -config BUSYBOX_CONFIG_DEBUG_PESSIMIZE - bool "Disable compiler optimizations" - default BUSYBOX_DEFAULT_DEBUG_PESSIMIZE - depends on BUSYBOX_CONFIG_DEBUG - help - The compiler's optimization of source code can eliminate and reorder - code, resulting in an executable that's hard to understand when - stepping through it with a debugger. This switches it off, resulting - in a much bigger executable that more closely matches the source - code. - -config BUSYBOX_CONFIG_DEBUG_SANITIZE - bool "Enable runtime sanitizers (ASAN/LSAN/USAN/etc...)" - default BUSYBOX_DEFAULT_DEBUG_SANITIZE - help - Say Y here if you want to enable runtime sanitizers. These help - catch bad memory accesses (e.g. buffer overflows), but will make - the executable larger and slow down runtime a bit. - - If you aren't developing/testing busybox, say N here. - -config BUSYBOX_CONFIG_UNIT_TEST - bool "Build unit tests" - default BUSYBOX_DEFAULT_UNIT_TEST - help - Say Y here if you want to build unit tests (both the framework and - test cases) as a Busybox applet. This results in bigger code, so you - probably don't want this option in production builds. - -config BUSYBOX_CONFIG_WERROR - bool "Abort compilation on any warning" - default BUSYBOX_DEFAULT_WERROR - help - Selecting this will add -Werror to gcc command line. - - Most people should answer N. - -choice - prompt "Additional debugging library" - default BUSYBOX_CONFIG_NO_DEBUG_LIB - help - Using an additional debugging library will make BusyBox become - considerable larger and will cause it to run more slowly. You - should always leave this option disabled for production use. - - dmalloc support: - ---------------- - This enables compiling with dmalloc ( http://dmalloc.com/ ) - which is an excellent public domain mem leak and malloc problem - detector. To enable dmalloc, before running busybox you will - want to properly set your environment, for example: - export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile - The 'debug=' value is generated using the following command - dmalloc -p log-stats -p log-non-free -p log-bad-space \ - -p log-elapsed-time -p check-fence -p check-heap \ - -p check-lists -p check-blank -p check-funcs -p realloc-copy \ - -p allow-free-null - - Electric-fence support: - ----------------------- - This enables compiling with Electric-fence support. Electric - fence is another very useful malloc debugging library which uses - your computer's virtual memory hardware to detect illegal memory - accesses. This support will make BusyBox be considerable larger - and run slower, so you should leave this option disabled unless - you are hunting a hard to find memory problem. - - -config BUSYBOX_CONFIG_NO_DEBUG_LIB - bool "None" - -config BUSYBOX_CONFIG_DMALLOC - bool "Dmalloc" - -config BUSYBOX_CONFIG_EFENCE - bool "Electric-fence" - -endchoice - -endmenu - -menu 'Installation Options ("make install" behavior)' +comment 'Installation Options ("make install" behavior)' choice prompt "What kind of applet links to install" @@ -835,12 +591,104 @@ config BUSYBOX_CONFIG_PREFIX help Define your directory to install BusyBox files/subdirs in. +comment 'Debugging Options' + +config BUSYBOX_CONFIG_DEBUG + bool "Build BusyBox with extra Debugging symbols" + default BUSYBOX_DEFAULT_DEBUG + help + Say Y here if you wish to examine BusyBox internals while applets are + running. This increases the size of the binary considerably, and + should only be used when doing development. If you are doing + development and want to debug BusyBox, answer Y. + + Most people should answer N. + +config BUSYBOX_CONFIG_DEBUG_PESSIMIZE + bool "Disable compiler optimizations" + default BUSYBOX_DEFAULT_DEBUG_PESSIMIZE + depends on BUSYBOX_CONFIG_DEBUG + help + The compiler's optimization of source code can eliminate and reorder + code, resulting in an executable that's hard to understand when + stepping through it with a debugger. This switches it off, resulting + in a much bigger executable that more closely matches the source + code. + +config BUSYBOX_CONFIG_DEBUG_SANITIZE + bool "Enable runtime sanitizers (ASAN/LSAN/USAN/etc...)" + default BUSYBOX_DEFAULT_DEBUG_SANITIZE + help + Say Y here if you want to enable runtime sanitizers. These help + catch bad memory accesses (e.g. buffer overflows), but will make + the executable larger and slow down runtime a bit. + + This adds -fsanitize=foo options to gcc command line. + + If you aren't developing/testing busybox, say N here. + +config BUSYBOX_CONFIG_UNIT_TEST + bool "Build unit tests" + default BUSYBOX_DEFAULT_UNIT_TEST + help + Say Y here if you want to build unit tests (both the framework and + test cases) as a Busybox applet. This results in bigger code, so you + probably don't want this option in production builds. + +config BUSYBOX_CONFIG_WERROR + bool "Abort compilation on any warning" + default BUSYBOX_DEFAULT_WERROR + help + This adds -Werror to gcc command line. + + Most people should answer N. + +choice + prompt "Additional debugging library" + default BUSYBOX_CONFIG_NO_DEBUG_LIB + help + Using an additional debugging library will make BusyBox become + considerable larger and will cause it to run more slowly. You + should always leave this option disabled for production use. + + dmalloc support: + ---------------- + This enables compiling with dmalloc ( http://dmalloc.com/ ) + which is an excellent public domain mem leak and malloc problem + detector. To enable dmalloc, before running busybox you will + want to properly set your environment, for example: + export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile + The 'debug=' value is generated using the following command + dmalloc -p log-stats -p log-non-free -p log-bad-space \ + -p log-elapsed-time -p check-fence -p check-heap \ + -p check-lists -p check-blank -p check-funcs -p realloc-copy \ + -p allow-free-null + + Electric-fence support: + ----------------------- + This enables compiling with Electric-fence support. Electric + fence is another very useful malloc debugging library which uses + your computer's virtual memory hardware to detect illegal memory + accesses. This support will make BusyBox be considerable larger + and run slower, so you should leave this option disabled unless + you are hunting a hard to find memory problem. + + +config BUSYBOX_CONFIG_NO_DEBUG_LIB + bool "None" + +config BUSYBOX_CONFIG_DMALLOC + bool "Dmalloc" + +config BUSYBOX_CONFIG_EFENCE + bool "Electric-fence" + +endchoice + endmenu source libbb/Config.in -endmenu - comment "Applets" source archival/Config.in diff --git a/package/utils/busybox/config/archival/Config.in b/package/utils/busybox/config/archival/Config.in index ff4c2cf6b..ccfb828a8 100644 --- a/package/utils/busybox/config/archival/Config.in +++ b/package/utils/busybox/config/archival/Config.in @@ -9,32 +9,22 @@ menu "Archival Utilities" config BUSYBOX_CONFIG_FEATURE_SEAMLESS_XZ bool "Make tar, rpm, modprobe etc understand .xz data" default BUSYBOX_DEFAULT_FEATURE_SEAMLESS_XZ - help - Make tar, rpm, modprobe etc understand .xz data. config BUSYBOX_CONFIG_FEATURE_SEAMLESS_LZMA bool "Make tar, rpm, modprobe etc understand .lzma data" default BUSYBOX_DEFAULT_FEATURE_SEAMLESS_LZMA - help - Make tar, rpm, modprobe etc understand .lzma data. config BUSYBOX_CONFIG_FEATURE_SEAMLESS_BZ2 bool "Make tar, rpm, modprobe etc understand .bz2 data" default BUSYBOX_DEFAULT_FEATURE_SEAMLESS_BZ2 - help - Make tar, rpm, modprobe etc understand .bz2 data. config BUSYBOX_CONFIG_FEATURE_SEAMLESS_GZ bool "Make tar, rpm, modprobe etc understand .gz data" default BUSYBOX_DEFAULT_FEATURE_SEAMLESS_GZ - help - Make tar, rpm, modprobe etc understand .gz data. config BUSYBOX_CONFIG_FEATURE_SEAMLESS_Z - bool "tar, rpm, modprobe etc understand .Z data" + bool "Make tar, rpm, modprobe etc understand .Z data" default BUSYBOX_DEFAULT_FEATURE_SEAMLESS_Z # it is ancient - help - Make tar, rpm, modprobe etc understand .Z data. config BUSYBOX_CONFIG_AR bool "ar" @@ -50,7 +40,7 @@ config BUSYBOX_CONFIG_AR probably say N here: most compilers come with their own ar utility. config BUSYBOX_CONFIG_FEATURE_AR_LONG_FILENAMES - bool "Support for long filenames (not needed for debs)" + bool "Support long filenames (not needed for debs)" default BUSYBOX_DEFAULT_FEATURE_AR_LONG_FILENAMES depends on BUSYBOX_CONFIG_AR help @@ -74,20 +64,27 @@ config BUSYBOX_CONFIG_UNCOMPRESS config BUSYBOX_CONFIG_GUNZIP bool "gunzip" default BUSYBOX_DEFAULT_GUNZIP + select BUSYBOX_CONFIG_FEATURE_GZIP_DECOMPRESS help gunzip is used to decompress archives created by gzip. You can use the `-t' option to test the integrity of an archive, without decompressing it. +config BUSYBOX_CONFIG_ZCAT + bool "zcat" + default BUSYBOX_DEFAULT_ZCAT + select BUSYBOX_CONFIG_FEATURE_GZIP_DECOMPRESS + help + Alias to "gunzip -c". + config BUSYBOX_CONFIG_FEATURE_GUNZIP_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_GUNZIP_LONG_OPTIONS - depends on BUSYBOX_CONFIG_GUNZIP && BUSYBOX_CONFIG_LONG_OPTS - help - Enable use of long options. + depends on (BUSYBOX_CONFIG_GUNZIP || BUSYBOX_CONFIG_ZCAT) && BUSYBOX_CONFIG_LONG_OPTS config BUSYBOX_CONFIG_BUNZIP2 bool "bunzip2" default BUSYBOX_DEFAULT_BUNZIP2 + select BUSYBOX_CONFIG_FEATURE_BZIP2_DECOMPRESS help bunzip2 is a compression utility using the Burrows-Wheeler block sorting text compression algorithm, and Huffman coding. Compression @@ -97,6 +94,13 @@ config BUSYBOX_CONFIG_BUNZIP2 Unless you have a specific application which requires bunzip2, you should probably say N here. + +config BUSYBOX_CONFIG_BZCAT + bool "bzcat" + default BUSYBOX_DEFAULT_BZCAT + select BUSYBOX_CONFIG_FEATURE_BZIP2_DECOMPRESS + help + Alias to "bunzip2 -c". config BUSYBOX_CONFIG_UNLZMA bool "unlzma" default BUSYBOX_DEFAULT_UNLZMA @@ -109,31 +113,47 @@ config BUSYBOX_CONFIG_UNLZMA The BusyBox unlzma applet is limited to decompression only. On an x86 system, this applet adds about 4K. -config BUSYBOX_CONFIG_FEATURE_LZMA_FAST - bool "Optimize unlzma for speed" - default BUSYBOX_DEFAULT_FEATURE_LZMA_FAST - depends on BUSYBOX_CONFIG_UNLZMA +config BUSYBOX_CONFIG_LZCAT + bool "lzcat" + default BUSYBOX_DEFAULT_LZCAT help - This option reduces decompression time by about 25% at the cost of - a 1K bigger binary. + unlzma is a compression utility using the Lempel-Ziv-Markov chain + compression algorithm, and range coding. Compression + is generally considerably better than that achieved by the bzip2 + compressors. + + The BusyBox unlzma applet is limited to decompression only. + On an x86 system, this applet adds about 4K. config BUSYBOX_CONFIG_LZMA - bool "Provide lzma alias which supports only unpacking" + bool "lzma -d" default BUSYBOX_DEFAULT_LZMA - depends on BUSYBOX_CONFIG_UNLZMA help Enable this option if you want commands like "lzma -d" to work. IOW: you'll get lzma applet, but it will always require -d option. + +config BUSYBOX_CONFIG_FEATURE_LZMA_FAST + bool "Optimize for speed" + default BUSYBOX_DEFAULT_FEATURE_LZMA_FAST + depends on BUSYBOX_CONFIG_UNLZMA || BUSYBOX_CONFIG_LZCAT || BUSYBOX_CONFIG_LZMA + help + This option reduces decompression time by about 25% at the cost of + a 1K bigger binary. config BUSYBOX_CONFIG_UNXZ bool "unxz" default BUSYBOX_DEFAULT_UNXZ help unxz is a unlzma successor. +config BUSYBOX_CONFIG_XZCAT + bool "xzcat" + default BUSYBOX_DEFAULT_XZCAT + help + Alias to "unxz -c". + config BUSYBOX_CONFIG_XZ - bool "Provide xz alias which supports only unpacking" + bool "xz -d" default BUSYBOX_DEFAULT_XZ - depends on BUSYBOX_CONFIG_UNXZ help Enable this option if you want commands like "xz -d" to work. IOW: you'll get xz applet, but it will always require -d option. @@ -149,6 +169,15 @@ config BUSYBOX_CONFIG_BZIP2 Unless you have a specific application which requires bzip2, you should probably say N here. + +config BUSYBOX_CONFIG_FEATURE_BZIP2_DECOMPRESS + bool "Enable decompression" + default BUSYBOX_DEFAULT_FEATURE_BZIP2_DECOMPRESS + depends on BUSYBOX_CONFIG_BZIP2 || BUSYBOX_CONFIG_BUNZIP2 || BUSYBOX_CONFIG_BZCAT + help + Enable -d (--decompress) and -t (--test) options for bzip2. + This will be automatically selected if bunzip2 or bzcat is + enabled. config BUSYBOX_CONFIG_CPIO bool "cpio" default BUSYBOX_DEFAULT_CPIO @@ -158,13 +187,13 @@ config BUSYBOX_CONFIG_CPIO cpio has 110 bytes of overheads for every stored file. This implementation of cpio can extract cpio archives created in the - "newc" or "crc" format, it cannot create or modify them. + "newc" or "crc" format. Unless you have a specific application which requires cpio, you should probably say N here. config BUSYBOX_CONFIG_FEATURE_CPIO_O - bool "Support for archive creation" + bool "Support archive creation" default BUSYBOX_DEFAULT_FEATURE_CPIO_O depends on BUSYBOX_CONFIG_CPIO help @@ -172,7 +201,7 @@ config BUSYBOX_CONFIG_FEATURE_CPIO_O format only. config BUSYBOX_CONFIG_FEATURE_CPIO_P - bool "Support for passthrough mode" + bool "Support passthrough mode" default BUSYBOX_DEFAULT_FEATURE_CPIO_P depends on BUSYBOX_CONFIG_FEATURE_CPIO_O help @@ -198,16 +227,6 @@ config BUSYBOX_CONFIG_DPKG_DEB Unless you have a specific application which requires dpkg-deb, say N here. - -config BUSYBOX_CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY - bool "Extract only (-x)" - default BUSYBOX_DEFAULT_FEATURE_DPKG_DEB_EXTRACT_ONLY - depends on BUSYBOX_CONFIG_DPKG_DEB - help - This reduces dpkg-deb to the equivalent of - "ar -p data.tar.gz | tar -zx". However it saves space as none - of the extra dpkg-deb, ar or tar options are needed, they are linked - to internally. config BUSYBOX_CONFIG_GZIP bool "gzip" default BUSYBOX_DEFAULT_GZIP @@ -219,11 +238,9 @@ config BUSYBOX_CONFIG_FEATURE_GZIP_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_GZIP_LONG_OPTIONS depends on BUSYBOX_CONFIG_GZIP && BUSYBOX_CONFIG_LONG_OPTS - help - Enable use of long options, increases size by about 106 Bytes config BUSYBOX_CONFIG_GZIP_FAST - int "Trade memory for gzip speed (0:small,slow - 2:fast,big)" + int "Trade memory for speed (0:small,slow - 2:fast,big)" default BUSYBOX_DEFAULT_GZIP_FAST range 0 2 depends on BUSYBOX_CONFIG_GZIP @@ -243,16 +260,37 @@ config BUSYBOX_CONFIG_FEATURE_GZIP_LEVELS is 6. If levels 1-3 are specified, 4 is used. If this option is not selected, -N options are ignored and -9 is used. + +config BUSYBOX_CONFIG_FEATURE_GZIP_DECOMPRESS + bool "Enable decompression" + default BUSYBOX_DEFAULT_FEATURE_GZIP_DECOMPRESS + depends on BUSYBOX_CONFIG_GZIP || BUSYBOX_CONFIG_GUNZIP || BUSYBOX_CONFIG_ZCAT + help + Enable -d (--decompress) and -t (--test) options for gzip. + This will be automatically selected if gunzip or zcat is + enabled. config BUSYBOX_CONFIG_LZOP bool "lzop" default BUSYBOX_DEFAULT_LZOP help Lzop compression/decompresion. +config BUSYBOX_CONFIG_UNLZOP + bool "unlzop" + default BUSYBOX_DEFAULT_UNLZOP # INCOMPAT: upstream lzop does not provide such tool + help + Lzop decompresion. + +config BUSYBOX_CONFIG_LZOPCAT + bool "lzopcat" + default BUSYBOX_DEFAULT_LZOPCAT # INCOMPAT: upstream lzop does not provide such tool + help + Alias to "unlzop -c". + config BUSYBOX_CONFIG_LZOP_COMPR_HIGH bool "lzop compression levels 7,8,9 (not very useful)" default BUSYBOX_DEFAULT_LZOP_COMPR_HIGH - depends on BUSYBOX_CONFIG_LZOP + depends on BUSYBOX_CONFIG_LZOP || BUSYBOX_CONFIG_UNLZOP || BUSYBOX_CONFIG_LZOPCAT help High levels (7,8,9) of lzop compression. These levels are actually slower than gzip at equivalent compression ratios @@ -275,13 +313,15 @@ config BUSYBOX_CONFIG_TAR create compressed archives. It's probably the most widely used UNIX archive program. +config BUSYBOX_CONFIG_FEATURE_TAR_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_TAR_LONG_OPTIONS + depends on BUSYBOX_CONFIG_TAR && BUSYBOX_CONFIG_LONG_OPTS + config BUSYBOX_CONFIG_FEATURE_TAR_CREATE - bool "Enable archive creation" + bool "Enable -c (archive creation)" default BUSYBOX_DEFAULT_FEATURE_TAR_CREATE depends on BUSYBOX_CONFIG_TAR - help - If you enable this option you'll be able to create - tar archives using the `-c' option. config BUSYBOX_CONFIG_FEATURE_TAR_AUTODETECT bool "Autodetect compressed tarballs" @@ -300,7 +340,7 @@ config BUSYBOX_CONFIG_FEATURE_TAR_FROM a list of files to include or exclude from an archive. config BUSYBOX_CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY - bool "Support for old tar header format" + bool "Support old tar header format" default BUSYBOX_DEFAULT_FEATURE_TAR_OLDGNU_COMPATIBILITY depends on BUSYBOX_CONFIG_TAR || BUSYBOX_CONFIG_DPKG help @@ -319,22 +359,12 @@ config BUSYBOX_CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY tarballs still exist. config BUSYBOX_CONFIG_FEATURE_TAR_GNU_EXTENSIONS - bool "Support for GNU tar extensions (long filenames)" + bool "Support GNU tar extensions (long filenames)" default BUSYBOX_DEFAULT_FEATURE_TAR_GNU_EXTENSIONS depends on BUSYBOX_CONFIG_TAR || BUSYBOX_CONFIG_DPKG - help - With this option busybox supports GNU long filenames and - linknames. - -config BUSYBOX_CONFIG_FEATURE_TAR_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_TAR_LONG_OPTIONS - depends on BUSYBOX_CONFIG_TAR && BUSYBOX_CONFIG_LONG_OPTS - help - Enable use of long options, increases size by about 400 Bytes config BUSYBOX_CONFIG_FEATURE_TAR_TO_COMMAND - bool "Support for writing to an external program" + bool "Support writing to an external program (--to-command)" default BUSYBOX_DEFAULT_FEATURE_TAR_TO_COMMAND depends on BUSYBOX_CONFIG_TAR && BUSYBOX_CONFIG_FEATURE_TAR_LONG_OPTIONS help @@ -347,20 +377,17 @@ config BUSYBOX_CONFIG_FEATURE_TAR_UNAME_GNAME default BUSYBOX_DEFAULT_FEATURE_TAR_UNAME_GNAME depends on BUSYBOX_CONFIG_TAR help - Enables use of user and group names in tar. This affects contents + Enable use of user and group names in tar. This affects contents listings (-t) and preserving permissions when unpacking (-p). +200 bytes. config BUSYBOX_CONFIG_FEATURE_TAR_NOPRESERVE_TIME - bool "Enable -m (do not preserve time) option" + bool "Enable -m (do not preserve time) GNU option" default BUSYBOX_DEFAULT_FEATURE_TAR_NOPRESERVE_TIME depends on BUSYBOX_CONFIG_TAR - help - With this option busybox supports GNU tar -m - (do not preserve time) option. config BUSYBOX_CONFIG_FEATURE_TAR_SELINUX - bool "Support for extracting SELinux labels" + bool "Support extracting SELinux labels" default BUSYBOX_DEFAULT_FEATURE_TAR_SELINUX depends on BUSYBOX_CONFIG_TAR && BUSYBOX_CONFIG_SELINUX help @@ -373,7 +400,31 @@ config BUSYBOX_CONFIG_UNZIP unzip will list or extract files from a ZIP archive, commonly found on DOS/WIN systems. The default behavior (with no options) is to extract the archive into the - current directory. Use the `-d' option to extract to a - directory of your choice. + current directory. + +config BUSYBOX_CONFIG_FEATURE_UNZIP_CDF + bool "Read and use Central Directory data" + default BUSYBOX_DEFAULT_FEATURE_UNZIP_CDF + depends on BUSYBOX_CONFIG_UNZIP + help + If you know that you only need to deal with simple + ZIP files without deleted/updated files, SFX archives etc, + you can reduce code size by unselecting this option. + To support less trivial ZIPs, say Y. + +config BUSYBOX_CONFIG_FEATURE_UNZIP_BZIP2 + bool "Support compression method 12 (bzip2)" + default BUSYBOX_DEFAULT_FEATURE_UNZIP_BZIP2 + depends on BUSYBOX_CONFIG_FEATURE_UNZIP_CDF && BUSYBOX_CONFIG_DESKTOP + +config BUSYBOX_CONFIG_FEATURE_UNZIP_LZMA + bool "Support compression method 14 (lzma)" + default BUSYBOX_DEFAULT_FEATURE_UNZIP_LZMA + depends on BUSYBOX_CONFIG_FEATURE_UNZIP_CDF && BUSYBOX_CONFIG_DESKTOP + +config BUSYBOX_CONFIG_FEATURE_UNZIP_XZ + bool "Support compression method 95 (xz)" + default BUSYBOX_DEFAULT_FEATURE_UNZIP_XZ + depends on BUSYBOX_CONFIG_FEATURE_UNZIP_CDF && BUSYBOX_CONFIG_DESKTOP endmenu diff --git a/package/utils/busybox/config/console-tools/Config.in b/package/utils/busybox/config/console-tools/Config.in index 53937d2b5..dcc19a567 100644 --- a/package/utils/busybox/config/console-tools/Config.in +++ b/package/utils/busybox/config/console-tools/Config.in @@ -6,7 +6,6 @@ menu "Console Utilities" - config BUSYBOX_CONFIG_CHVT bool "chvt" default BUSYBOX_DEFAULT_CHVT @@ -14,27 +13,17 @@ config BUSYBOX_CONFIG_CHVT help This program is used to change to another terminal. Example: chvt 4 (change to terminal /dev/tty4) - -config BUSYBOX_CONFIG_FGCONSOLE - bool "fgconsole" - default BUSYBOX_DEFAULT_FGCONSOLE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - This program prints active (foreground) console number. - config BUSYBOX_CONFIG_CLEAR bool "clear" default BUSYBOX_DEFAULT_CLEAR help This program clears the terminal screen. - config BUSYBOX_CONFIG_DEALLOCVT bool "deallocvt" default BUSYBOX_DEFAULT_DEALLOCVT select BUSYBOX_CONFIG_PLATFORM_LINUX help This program deallocates unused virtual consoles. - config BUSYBOX_CONFIG_DUMPKMAP bool "dumpkmap" default BUSYBOX_DEFAULT_DUMPKMAP @@ -42,14 +31,18 @@ config BUSYBOX_CONFIG_DUMPKMAP help This program dumps the kernel's keyboard translation table to stdout, in binary format. You can then use loadkmap to load it. - +config BUSYBOX_CONFIG_FGCONSOLE + bool "fgconsole" + default BUSYBOX_DEFAULT_FGCONSOLE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + This program prints active (foreground) console number. config BUSYBOX_CONFIG_KBD_MODE bool "kbd_mode" default BUSYBOX_DEFAULT_KBD_MODE select BUSYBOX_CONFIG_PLATFORM_LINUX help This program reports and sets keyboard mode. - config BUSYBOX_CONFIG_LOADFONT bool "loadfont" default BUSYBOX_DEFAULT_LOADFONT @@ -57,61 +50,6 @@ config BUSYBOX_CONFIG_LOADFONT help This program loads a console font from standard input. -config BUSYBOX_CONFIG_LOADKMAP - bool "loadkmap" - default BUSYBOX_DEFAULT_LOADKMAP - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - This program loads a keyboard translation table from - standard input. - -config BUSYBOX_CONFIG_OPENVT - bool "openvt" - default BUSYBOX_DEFAULT_OPENVT - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - This program is used to start a command on an unused - virtual terminal. - -config BUSYBOX_CONFIG_RESET - bool "reset" - default BUSYBOX_DEFAULT_RESET - help - This program is used to reset the terminal screen, if it - gets messed up. - -config BUSYBOX_CONFIG_RESIZE - bool "resize" - default BUSYBOX_DEFAULT_RESIZE - help - This program is used to (re)set the width and height of your current - terminal. - -config BUSYBOX_CONFIG_FEATURE_RESIZE_PRINT - bool "Print environment variables" - default BUSYBOX_DEFAULT_FEATURE_RESIZE_PRINT - depends on BUSYBOX_CONFIG_RESIZE - help - Prints the newly set size (number of columns and rows) of - the terminal. - E.g.: - COLUMNS=80;LINES=44;export COLUMNS LINES; - -config BUSYBOX_CONFIG_SETCONSOLE - bool "setconsole" - default BUSYBOX_DEFAULT_SETCONSOLE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - This program redirects the system console to another device, - like the current tty while logged in via telnet. - -config BUSYBOX_CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_SETCONSOLE_LONG_OPTIONS - depends on BUSYBOX_CONFIG_SETCONSOLE && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the setconsole applet. - config BUSYBOX_CONFIG_SETFONT bool "setfont" default BUSYBOX_DEFAULT_SETFONT @@ -134,6 +72,66 @@ config BUSYBOX_CONFIG_DEFAULT_SETFONT_DIR Directory to use if setfont's params are simple filenames (not /path/to/file or ./file). Default is "" (no default directory). +comment "Common options for loadfont and setfont" + depends on BUSYBOX_CONFIG_LOADFONT || BUSYBOX_CONFIG_SETFONT + +config BUSYBOX_CONFIG_FEATURE_LOADFONT_PSF2 + bool "Support PSF2 console fonts" + default BUSYBOX_DEFAULT_FEATURE_LOADFONT_PSF2 + depends on BUSYBOX_CONFIG_LOADFONT || BUSYBOX_CONFIG_SETFONT + +config BUSYBOX_CONFIG_FEATURE_LOADFONT_RAW + bool "Support old (raw) console fonts" + default BUSYBOX_DEFAULT_FEATURE_LOADFONT_RAW + depends on BUSYBOX_CONFIG_LOADFONT || BUSYBOX_CONFIG_SETFONT +config BUSYBOX_CONFIG_LOADKMAP + bool "loadkmap" + default BUSYBOX_DEFAULT_LOADKMAP + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + This program loads a keyboard translation table from + standard input. +config BUSYBOX_CONFIG_OPENVT + bool "openvt" + default BUSYBOX_DEFAULT_OPENVT + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + This program is used to start a command on an unused + virtual terminal. +config BUSYBOX_CONFIG_RESET + bool "reset" + default BUSYBOX_DEFAULT_RESET + help + This program is used to reset the terminal screen, if it + gets messed up. +config BUSYBOX_CONFIG_RESIZE + bool "resize" + default BUSYBOX_DEFAULT_RESIZE + help + This program is used to (re)set the width and height of your current + terminal. + +config BUSYBOX_CONFIG_FEATURE_RESIZE_PRINT + bool "Print environment variables" + default BUSYBOX_DEFAULT_FEATURE_RESIZE_PRINT + depends on BUSYBOX_CONFIG_RESIZE + help + Prints the newly set size (number of columns and rows) of + the terminal. + E.g.: + COLUMNS=80;LINES=44;export COLUMNS LINES; +config BUSYBOX_CONFIG_SETCONSOLE + bool "setconsole" + default BUSYBOX_DEFAULT_SETCONSOLE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + This program redirects the system console to another device, + like the current tty while logged in via telnet. + +config BUSYBOX_CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_SETCONSOLE_LONG_OPTIONS + depends on BUSYBOX_CONFIG_SETCONSOLE && BUSYBOX_CONFIG_LONG_OPTS config BUSYBOX_CONFIG_SETKEYCODES bool "setkeycodes" default BUSYBOX_DEFAULT_SETKEYCODES @@ -141,14 +139,12 @@ config BUSYBOX_CONFIG_SETKEYCODES help This program loads entries into the kernel's scancode-to-keycode map, allowing unusual keyboards to generate usable keycodes. - config BUSYBOX_CONFIG_SETLOGCONS bool "setlogcons" default BUSYBOX_DEFAULT_SETLOGCONS select BUSYBOX_CONFIG_PLATFORM_LINUX help This program redirects the output console of kernel messages. - config BUSYBOX_CONFIG_SHOWKEY bool "showkey" default BUSYBOX_DEFAULT_SHOWKEY @@ -156,21 +152,4 @@ config BUSYBOX_CONFIG_SHOWKEY help Shows keys pressed. -comment "Common options for loadfont and setfont" - depends on BUSYBOX_CONFIG_LOADFONT || BUSYBOX_CONFIG_SETFONT - -config BUSYBOX_CONFIG_FEATURE_LOADFONT_PSF2 - bool "Support for PSF2 console fonts" - default BUSYBOX_DEFAULT_FEATURE_LOADFONT_PSF2 - depends on BUSYBOX_CONFIG_LOADFONT || BUSYBOX_CONFIG_SETFONT - help - Support PSF2 console fonts. - -config BUSYBOX_CONFIG_FEATURE_LOADFONT_RAW - bool "Support for old (raw) console fonts" - default BUSYBOX_DEFAULT_FEATURE_LOADFONT_RAW - depends on BUSYBOX_CONFIG_LOADFONT || BUSYBOX_CONFIG_SETFONT - help - Support old (raw) console fonts. - endmenu diff --git a/package/utils/busybox/config/coreutils/Config.in b/package/utils/busybox/config/coreutils/Config.in index ec5611bdf..c4ef1f4fb 100644 --- a/package/utils/busybox/config/coreutils/Config.in +++ b/package/utils/busybox/config/coreutils/Config.in @@ -19,6 +19,70 @@ config BUSYBOX_CONFIG_CAT help cat is used to concatenate files and print them to the standard output. Enable this option if you wish to enable the 'cat' utility. + +config BUSYBOX_CONFIG_FEATURE_CATV + bool "cat -v[etA]" + default BUSYBOX_DEFAULT_FEATURE_CATV + depends on BUSYBOX_CONFIG_CAT + help + Display nonprinting characters as escape sequences +config BUSYBOX_CONFIG_CHGRP + bool "chgrp" + default BUSYBOX_DEFAULT_CHGRP + help + chgrp is used to change the group ownership of files. +config BUSYBOX_CONFIG_CHMOD + bool "chmod" + default BUSYBOX_DEFAULT_CHMOD + help + chmod is used to change the access permission of files. +config BUSYBOX_CONFIG_CHOWN + bool "chown" + default BUSYBOX_DEFAULT_CHOWN + help + chown is used to change the user and/or group ownership + of files. + +config BUSYBOX_CONFIG_FEATURE_CHOWN_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_CHOWN_LONG_OPTIONS + depends on BUSYBOX_CONFIG_CHOWN && BUSYBOX_CONFIG_LONG_OPTS +config BUSYBOX_CONFIG_CHROOT + bool "chroot" + default BUSYBOX_DEFAULT_CHROOT + help + chroot is used to change the root directory and run a command. + The default command is `/bin/sh'. +config BUSYBOX_CONFIG_CKSUM + bool "cksum" + default BUSYBOX_DEFAULT_CKSUM + help + cksum is used to calculate the CRC32 checksum of a file. +config BUSYBOX_CONFIG_COMM + bool "comm" + default BUSYBOX_DEFAULT_COMM + help + comm is used to compare two files line by line and return + a three-column output. +config BUSYBOX_CONFIG_CP + bool "cp" + default BUSYBOX_DEFAULT_CP + help + cp is used to copy files and directories. + +config BUSYBOX_CONFIG_FEATURE_CP_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_CP_LONG_OPTIONS + depends on BUSYBOX_CONFIG_CP && BUSYBOX_CONFIG_LONG_OPTS + help + Enable long options. + Also add support for --parents option. +config BUSYBOX_CONFIG_CUT + bool "cut" + default BUSYBOX_DEFAULT_CUT + help + cut is used to print selected parts of lines from + each file to stdout. config BUSYBOX_CONFIG_DATE bool "date" default BUSYBOX_DEFAULT_DATE @@ -93,7 +157,7 @@ config BUSYBOX_CONFIG_FEATURE_DD_IBS_OBS default BUSYBOX_DEFAULT_FEATURE_DD_IBS_OBS depends on BUSYBOX_CONFIG_DD help - Enables support for writing a certain number of bytes in and out, + Enable support for writing a certain number of bytes in and out, at a time, and performing conversions on the data stream. config BUSYBOX_CONFIG_FEATURE_DD_STATUS @@ -101,7 +165,144 @@ config BUSYBOX_CONFIG_FEATURE_DD_STATUS default BUSYBOX_DEFAULT_FEATURE_DD_STATUS depends on BUSYBOX_CONFIG_DD help - Enables support for status=noxfer/none option. + Enable support for status=noxfer/none option. +config BUSYBOX_CONFIG_DF + bool "df" + default BUSYBOX_DEFAULT_DF + help + df reports the amount of disk space used and available + on filesystems. + +config BUSYBOX_CONFIG_FEATURE_DF_FANCY + bool "Enable -a, -i, -B" + default BUSYBOX_DEFAULT_FEATURE_DF_FANCY + depends on BUSYBOX_CONFIG_DF + help + -a Show all filesystems + -i Inodes + -B Blocksize +config BUSYBOX_CONFIG_DIRNAME + bool "dirname" + default BUSYBOX_DEFAULT_DIRNAME + help + dirname is used to strip a non-directory suffix from + a file name. +config BUSYBOX_CONFIG_DOS2UNIX + bool "dos2unix" + default BUSYBOX_DEFAULT_DOS2UNIX + help + dos2unix is used to convert a text file from DOS format to + UNIX format, and vice versa. + +config BUSYBOX_CONFIG_UNIX2DOS + bool "unix2dos" + default BUSYBOX_DEFAULT_UNIX2DOS + help + unix2dos is used to convert a text file from UNIX format to + DOS format, and vice versa. +config BUSYBOX_CONFIG_DU + bool "du (default blocksize of 512 bytes)" + default BUSYBOX_DEFAULT_DU + help + du is used to report the amount of disk space used + for specified files. + +config BUSYBOX_CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K + bool "Use a default blocksize of 1024 bytes (1K)" + default BUSYBOX_DEFAULT_FEATURE_DU_DEFAULT_BLOCKSIZE_1K + depends on BUSYBOX_CONFIG_DU + help + Use a blocksize of (1K) instead of the default 512b. +config BUSYBOX_CONFIG_ECHO + bool "echo (basic SuSv3 version taking no options)" + default BUSYBOX_DEFAULT_ECHO + help + echo is used to print a specified string to stdout. + +# this entry also appears in shell/Config.in, next to the echo builtin +config BUSYBOX_CONFIG_FEATURE_FANCY_ECHO + bool "Enable -n and -e options" + default BUSYBOX_DEFAULT_FEATURE_FANCY_ECHO + depends on BUSYBOX_CONFIG_ECHO || BUSYBOX_CONFIG_ASH_ECHO || BUSYBOX_CONFIG_HUSH_ECHO +config BUSYBOX_CONFIG_ENV + bool "env" + default BUSYBOX_DEFAULT_ENV + help + env is used to set an environment variable and run + a command; without options it displays the current + environment. + +config BUSYBOX_CONFIG_FEATURE_ENV_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_ENV_LONG_OPTIONS + depends on BUSYBOX_CONFIG_ENV && BUSYBOX_CONFIG_LONG_OPTS +config BUSYBOX_CONFIG_EXPAND + bool "expand" + default BUSYBOX_DEFAULT_EXPAND + help + By default, convert all tabs to spaces. + +config BUSYBOX_CONFIG_FEATURE_EXPAND_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_EXPAND_LONG_OPTIONS + depends on BUSYBOX_CONFIG_EXPAND && BUSYBOX_CONFIG_LONG_OPTS + +config BUSYBOX_CONFIG_UNEXPAND + bool "unexpand" + default BUSYBOX_DEFAULT_UNEXPAND + help + By default, convert only leading sequences of blanks to tabs. + +config BUSYBOX_CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_UNEXPAND_LONG_OPTIONS + depends on BUSYBOX_CONFIG_UNEXPAND && BUSYBOX_CONFIG_LONG_OPTS +config BUSYBOX_CONFIG_EXPR + bool "expr" + default BUSYBOX_DEFAULT_EXPR + help + expr is used to calculate numbers and print the result + to standard output. + +config BUSYBOX_CONFIG_EXPR_MATH_SUPPORT_64 + bool "Extend Posix numbers support to 64 bit" + default BUSYBOX_DEFAULT_EXPR_MATH_SUPPORT_64 + depends on BUSYBOX_CONFIG_EXPR + help + Enable 64-bit math support in the expr applet. This will make + the applet slightly larger, but will allow computation with very + large numbers. +config BUSYBOX_CONFIG_FACTOR + bool "factor" + default BUSYBOX_DEFAULT_FACTOR + help + factor factorizes integers +config BUSYBOX_CONFIG_FALSE + bool "false" + default BUSYBOX_DEFAULT_FALSE + help + false returns an exit code of FALSE (1). +config BUSYBOX_CONFIG_FOLD + bool "fold" + default BUSYBOX_DEFAULT_FOLD + help + Wrap text to fit a specific width. +config BUSYBOX_CONFIG_FSYNC + bool "fsync" + default BUSYBOX_DEFAULT_FSYNC + help + fsync is used to flush file-related cached blocks to disk. +config BUSYBOX_CONFIG_HEAD + bool "head" + default BUSYBOX_DEFAULT_HEAD + help + head is used to print the first specified number of lines + from files. + +config BUSYBOX_CONFIG_FEATURE_FANCY_HEAD + bool "Enable -c, -q, and -v" + default BUSYBOX_DEFAULT_FEATURE_FANCY_HEAD + depends on BUSYBOX_CONFIG_HEAD config BUSYBOX_CONFIG_HOSTID bool "hostid" default BUSYBOX_DEFAULT_HOSTID @@ -113,16 +314,336 @@ config BUSYBOX_CONFIG_ID default BUSYBOX_DEFAULT_ID help id displays the current user and group ID names. + config BUSYBOX_CONFIG_GROUPS bool "groups" default BUSYBOX_DEFAULT_GROUPS help Print the group names associated with current user id. +config BUSYBOX_CONFIG_INSTALL + bool "install" + default BUSYBOX_DEFAULT_INSTALL + help + Copy files and set attributes. + +config BUSYBOX_CONFIG_FEATURE_INSTALL_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_INSTALL_LONG_OPTIONS + depends on BUSYBOX_CONFIG_INSTALL && BUSYBOX_CONFIG_LONG_OPTS +config BUSYBOX_CONFIG_LINK + bool "link" + default BUSYBOX_DEFAULT_LINK + help + link creates hard links between files. +config BUSYBOX_CONFIG_LN + bool "ln" + default BUSYBOX_DEFAULT_LN + help + ln is used to create hard or soft links between files. +config BUSYBOX_CONFIG_LOGNAME + bool "logname" + default BUSYBOX_DEFAULT_LOGNAME + help + logname is used to print the current user's login name. +config BUSYBOX_CONFIG_LS + bool "ls" + default BUSYBOX_DEFAULT_LS + help + ls is used to list the contents of directories. + +config BUSYBOX_CONFIG_FEATURE_LS_FILETYPES + bool "Enable filetyping options (-p and -F)" + default BUSYBOX_DEFAULT_FEATURE_LS_FILETYPES + depends on BUSYBOX_CONFIG_LS + +config BUSYBOX_CONFIG_FEATURE_LS_FOLLOWLINKS + bool "Enable symlinks dereferencing (-L)" + default BUSYBOX_DEFAULT_FEATURE_LS_FOLLOWLINKS + depends on BUSYBOX_CONFIG_LS + +config BUSYBOX_CONFIG_FEATURE_LS_RECURSIVE + bool "Enable recursion (-R)" + default BUSYBOX_DEFAULT_FEATURE_LS_RECURSIVE + depends on BUSYBOX_CONFIG_LS + +config BUSYBOX_CONFIG_FEATURE_LS_WIDTH + bool "Enable -w WIDTH and window size autodetection" + default BUSYBOX_DEFAULT_FEATURE_LS_WIDTH + depends on BUSYBOX_CONFIG_LS + +config BUSYBOX_CONFIG_FEATURE_LS_SORTFILES + bool "Sort the file names" + default BUSYBOX_DEFAULT_FEATURE_LS_SORTFILES + depends on BUSYBOX_CONFIG_LS + help + Allow ls to sort file names alphabetically. + +config BUSYBOX_CONFIG_FEATURE_LS_TIMESTAMPS + bool "Show file timestamps" + default BUSYBOX_DEFAULT_FEATURE_LS_TIMESTAMPS + depends on BUSYBOX_CONFIG_LS + help + Allow ls to display timestamps for files. + +config BUSYBOX_CONFIG_FEATURE_LS_USERNAME + bool "Show username/groupnames" + default BUSYBOX_DEFAULT_FEATURE_LS_USERNAME + depends on BUSYBOX_CONFIG_LS + help + Allow ls to display username/groupname for files. + +config BUSYBOX_CONFIG_FEATURE_LS_COLOR + bool "Allow use of color to identify file types" + default BUSYBOX_DEFAULT_FEATURE_LS_COLOR + depends on BUSYBOX_CONFIG_LS && BUSYBOX_CONFIG_LONG_OPTS + help + This enables the --color option to ls. + +config BUSYBOX_CONFIG_FEATURE_LS_COLOR_IS_DEFAULT + bool "Produce colored ls output by default" + default BUSYBOX_DEFAULT_FEATURE_LS_COLOR_IS_DEFAULT + depends on BUSYBOX_CONFIG_FEATURE_LS_COLOR + help + Saying yes here will turn coloring on by default, + even if no "--color" option is given to the ls command. + This is not recommended, since the colors are not + configurable, and the output may not be legible on + many output screens. +config BUSYBOX_CONFIG_MD5SUM + bool "md5sum" + default BUSYBOX_DEFAULT_MD5SUM + help + md5sum is used to print or check MD5 checksums. + +config BUSYBOX_CONFIG_SHA1SUM + bool "sha1sum" + default BUSYBOX_DEFAULT_SHA1SUM + help + Compute and check SHA1 message digest + +config BUSYBOX_CONFIG_SHA256SUM + bool "sha256sum" + default BUSYBOX_DEFAULT_SHA256SUM + help + Compute and check SHA256 message digest + +config BUSYBOX_CONFIG_SHA512SUM + bool "sha512sum" + default BUSYBOX_DEFAULT_SHA512SUM + help + Compute and check SHA512 message digest + +config BUSYBOX_CONFIG_SHA3SUM + bool "sha3sum" + default BUSYBOX_DEFAULT_SHA3SUM + help + Compute and check SHA3 message digest + +comment "Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum" + depends on BUSYBOX_CONFIG_MD5SUM || BUSYBOX_CONFIG_SHA1SUM || BUSYBOX_CONFIG_SHA256SUM || BUSYBOX_CONFIG_SHA512SUM || BUSYBOX_CONFIG_SHA3SUM + +config BUSYBOX_CONFIG_FEATURE_MD5_SHA1_SUM_CHECK + bool "Enable -c, -s and -w options" + default BUSYBOX_DEFAULT_FEATURE_MD5_SHA1_SUM_CHECK + depends on BUSYBOX_CONFIG_MD5SUM || BUSYBOX_CONFIG_SHA1SUM || BUSYBOX_CONFIG_SHA256SUM || BUSYBOX_CONFIG_SHA512SUM || BUSYBOX_CONFIG_SHA3SUM + help + Enabling the -c options allows files to be checked + against pre-calculated hash values. + -s and -w are useful options when verifying checksums. +config BUSYBOX_CONFIG_MKDIR + bool "mkdir" + default BUSYBOX_DEFAULT_MKDIR + help + mkdir is used to create directories with the specified names. + +config BUSYBOX_CONFIG_FEATURE_MKDIR_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_MKDIR_LONG_OPTIONS + depends on BUSYBOX_CONFIG_MKDIR && BUSYBOX_CONFIG_LONG_OPTS +config BUSYBOX_CONFIG_MKFIFO + bool "mkfifo" + default BUSYBOX_DEFAULT_MKFIFO + help + mkfifo is used to create FIFOs (named pipes). + The 'mknod' program can also create FIFOs. +config BUSYBOX_CONFIG_MKNOD + bool "mknod" + default BUSYBOX_DEFAULT_MKNOD + help + mknod is used to create FIFOs or block/character special + files with the specified names. +config BUSYBOX_CONFIG_MKTEMP + bool "mktemp" + default BUSYBOX_DEFAULT_MKTEMP + help + mktemp is used to create unique temporary files +config BUSYBOX_CONFIG_MV + bool "mv" + default BUSYBOX_DEFAULT_MV + help + mv is used to move or rename files or directories. + +config BUSYBOX_CONFIG_FEATURE_MV_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_MV_LONG_OPTIONS + depends on BUSYBOX_CONFIG_MV && BUSYBOX_CONFIG_LONG_OPTS +config BUSYBOX_CONFIG_NICE + bool "nice" + default BUSYBOX_DEFAULT_NICE + help + nice runs a program with modified scheduling priority. +config BUSYBOX_CONFIG_NL + bool "nl" + default BUSYBOX_DEFAULT_NL + help + nl is used to number lines of files. +config BUSYBOX_CONFIG_NOHUP + bool "nohup" + default BUSYBOX_DEFAULT_NOHUP + help + run a command immune to hangups, with output to a non-tty. +config BUSYBOX_CONFIG_NPROC + bool "nproc" + default BUSYBOX_DEFAULT_NPROC + help + Print number of CPUs +config BUSYBOX_CONFIG_OD + bool "od" + default BUSYBOX_DEFAULT_OD + help + od is used to dump binary files in octal and other formats. +config BUSYBOX_CONFIG_PASTE + bool "paste" + default BUSYBOX_DEFAULT_PASTE + help + paste is used to paste lines of different files together + and write the result to stdout +config BUSYBOX_CONFIG_PRINTENV + bool "printenv" + default BUSYBOX_DEFAULT_PRINTENV + help + printenv is used to print all or part of environment. +config BUSYBOX_CONFIG_PRINTF + bool "printf" + default BUSYBOX_DEFAULT_PRINTF + help + printf is used to format and print specified strings. + It's similar to `echo' except it has more options. +config BUSYBOX_CONFIG_PWD + bool "pwd" + default BUSYBOX_DEFAULT_PWD + help + pwd is used to print the current directory. +config BUSYBOX_CONFIG_READLINK + bool "readlink" + default BUSYBOX_DEFAULT_READLINK + help + This program reads a symbolic link and returns the name + of the file it points to + +config BUSYBOX_CONFIG_FEATURE_READLINK_FOLLOW + bool "Enable canonicalization by following all symlinks (-f)" + default BUSYBOX_DEFAULT_FEATURE_READLINK_FOLLOW + depends on BUSYBOX_CONFIG_READLINK + help + Enable the readlink option (-f). +config BUSYBOX_CONFIG_REALPATH + bool "realpath" + default BUSYBOX_DEFAULT_REALPATH + help + Return the canonicalized absolute pathname. + This isn't provided by GNU shellutils, but where else does it belong. +config BUSYBOX_CONFIG_RM + bool "rm" + default BUSYBOX_DEFAULT_RM + help + rm is used to remove files or directories. +config BUSYBOX_CONFIG_RMDIR + bool "rmdir" + default BUSYBOX_DEFAULT_RMDIR + help + rmdir is used to remove empty directories. + +config BUSYBOX_CONFIG_FEATURE_RMDIR_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_RMDIR_LONG_OPTIONS + depends on BUSYBOX_CONFIG_RMDIR && BUSYBOX_CONFIG_LONG_OPTS + help + Support long options for the rmdir applet, including + --ignore-fail-on-non-empty for compatibility with GNU rmdir. +config BUSYBOX_CONFIG_SEQ + bool "seq" + default BUSYBOX_DEFAULT_SEQ + help + print a sequence of numbers +config BUSYBOX_CONFIG_SHRED + bool "shred" + default BUSYBOX_DEFAULT_SHRED + help + Overwrite a file to hide its contents, and optionally delete it config BUSYBOX_CONFIG_SHUF bool "shuf" default BUSYBOX_DEFAULT_SHUF help Generate random permutations +config BUSYBOX_CONFIG_SLEEP + bool "sleep" + default BUSYBOX_DEFAULT_SLEEP + help + sleep is used to pause for a specified number of seconds. + It comes in 3 versions: + - small: takes one integer parameter + - fancy: takes multiple integer arguments with suffixes: + sleep 1d 2h 3m 15s + - fancy with fractional numbers: + sleep 2.3s 4.5h sleeps for 16202.3 seconds + Last one is "the most compatible" with coreutils sleep, + but it adds around 1k of code. + +config BUSYBOX_CONFIG_FEATURE_FANCY_SLEEP + bool "Enable multiple arguments and s/m/h/d suffixes" + default BUSYBOX_DEFAULT_FEATURE_FANCY_SLEEP + depends on BUSYBOX_CONFIG_SLEEP + help + Allow sleep to pause for specified minutes, hours, and days. + +config BUSYBOX_CONFIG_FEATURE_FLOAT_SLEEP + bool "Enable fractional arguments" + default BUSYBOX_DEFAULT_FEATURE_FLOAT_SLEEP + depends on BUSYBOX_CONFIG_FEATURE_FANCY_SLEEP + help + Allow for fractional numeric parameters. +config BUSYBOX_CONFIG_SORT + bool "sort" + default BUSYBOX_DEFAULT_SORT + help + sort is used to sort lines of text in specified files. + +config BUSYBOX_CONFIG_FEATURE_SORT_BIG + bool "Full SuSv3 compliant sort (support -ktcsbdfiozgM)" + default BUSYBOX_DEFAULT_FEATURE_SORT_BIG + depends on BUSYBOX_CONFIG_SORT + help + Without this, sort only supports -r, -u, and an integer version + of -n. Selecting this adds sort keys, floating point support, and + more. This adds a little over 3k to a nonstatic build on x86. + + The SuSv3 sort standard is available at: + http://www.opengroup.org/onlinepubs/007904975/utilities/sort.html +config BUSYBOX_CONFIG_SPLIT + bool "split" + default BUSYBOX_DEFAULT_SPLIT + help + Split a file into pieces. + +config BUSYBOX_CONFIG_FEATURE_SPLIT_FANCY + bool "Fancy extensions" + default BUSYBOX_DEFAULT_FEATURE_SPLIT_FANCY + depends on BUSYBOX_CONFIG_SPLIT + help + Add support for features not required by SUSv3. + Supports additional suffixes 'b' for 512 bytes, + 'g' for 1GiB for the -b option. config BUSYBOX_CONFIG_STAT bool "stat" default BUSYBOX_DEFAULT_STAT @@ -146,18 +667,64 @@ config BUSYBOX_CONFIG_FEATURE_STAT_FILESYSTEM help Without this, stat will not support the '-f' option to display information about filesystem status. +config BUSYBOX_CONFIG_STTY + bool "stty" + default BUSYBOX_DEFAULT_STTY + help + stty is used to change and print terminal line settings. +config BUSYBOX_CONFIG_SUM + bool "sum" + default BUSYBOX_DEFAULT_SUM + help + checksum and count the blocks in a file config BUSYBOX_CONFIG_SYNC bool "sync" default BUSYBOX_DEFAULT_SYNC help sync is used to flush filesystem buffers. config BUSYBOX_CONFIG_FEATURE_SYNC_FANCY - bool "Enable -d and -f flags (requres syncfs(2) in libc)" + bool "Enable -d and -f flags (requires syncfs(2) in libc)" default BUSYBOX_DEFAULT_FEATURE_SYNC_FANCY depends on BUSYBOX_CONFIG_SYNC help sync -d FILE... executes fdatasync() on each FILE. sync -f FILE... executes syncfs() on each FILE. +config BUSYBOX_CONFIG_TAC + bool "tac" + default BUSYBOX_DEFAULT_TAC + help + tac is used to concatenate and print files in reverse. +config BUSYBOX_CONFIG_TAIL + bool "tail" + default BUSYBOX_DEFAULT_TAIL + help + tail is used to print the last specified number of lines + from files. + +config BUSYBOX_CONFIG_FEATURE_FANCY_TAIL + bool "Enable -q, -s, -v, and -F options" + default BUSYBOX_DEFAULT_FEATURE_FANCY_TAIL + depends on BUSYBOX_CONFIG_TAIL + help + These options are provided by GNU tail, but + are not specific in the SUSv3 standard: + -q Never output headers giving file names + -s SEC Wait SEC seconds between reads with -f + -v Always output headers giving file names + -F Same as -f, but keep retrying +config BUSYBOX_CONFIG_TEE + bool "tee" + default BUSYBOX_DEFAULT_TEE + help + tee is used to read from standard input and write + to standard output and files. + +config BUSYBOX_CONFIG_FEATURE_TEE_USE_BLOCK_IO + bool "Enable block I/O (larger/faster) instead of byte I/O" + default BUSYBOX_DEFAULT_FEATURE_TEE_USE_BLOCK_IO + depends on BUSYBOX_CONFIG_TEE + help + Enable this option for a faster tee, at expense of size. config BUSYBOX_CONFIG_TEST bool "test" default BUSYBOX_DEFAULT_TEST @@ -166,12 +733,30 @@ config BUSYBOX_CONFIG_TEST returning an appropriate exit code. The bash shell has test built in, ash can build it in optionally. +config BUSYBOX_CONFIG_TEST1 + bool "test as [" + default BUSYBOX_DEFAULT_TEST1 + help + Provide test command in the "[ EXPR ]" form + +config BUSYBOX_CONFIG_TEST2 + bool "test as [[" + default BUSYBOX_DEFAULT_TEST2 + help + Provide test command in the "[[ EXPR ]]" form + config BUSYBOX_CONFIG_FEATURE_TEST_64 bool "Extend test to 64 bit" default BUSYBOX_DEFAULT_FEATURE_TEST_64 - depends on BUSYBOX_CONFIG_TEST || BUSYBOX_CONFIG_ASH_BUILTIN_TEST || BUSYBOX_CONFIG_HUSH + depends on BUSYBOX_CONFIG_TEST || BUSYBOX_CONFIG_TEST1 || BUSYBOX_CONFIG_TEST2 || BUSYBOX_CONFIG_ASH_TEST || BUSYBOX_CONFIG_HUSH_TEST help Enable 64-bit support in test. +config BUSYBOX_CONFIG_TIMEOUT + bool "timeout" + default BUSYBOX_DEFAULT_TIMEOUT + help + Runs a program and watches it. If it does not terminate in + specified number of seconds, it is sent a signal. config BUSYBOX_CONFIG_TOUCH bool "touch" default BUSYBOX_DEFAULT_TOUCH @@ -218,636 +803,23 @@ config BUSYBOX_CONFIG_FEATURE_TR_EQUIV replace all instances of 'a' with 'xyz'. This option is mainly useful for cases when no other way of expressing a character is possible. +config BUSYBOX_CONFIG_TRUE + bool "true" + default BUSYBOX_DEFAULT_TRUE + help + true returns an exit code of TRUE (0). config BUSYBOX_CONFIG_TRUNCATE bool "truncate" default BUSYBOX_DEFAULT_TRUNCATE help truncate truncates files to a given size. If a file does not exist, it is created unless told otherwise. -config BUSYBOX_CONFIG_UNLINK - bool "unlink" - default BUSYBOX_DEFAULT_UNLINK - help - unlink deletes a file by calling unlink() -config BUSYBOX_CONFIG_BASE64 - bool "base64" - default BUSYBOX_DEFAULT_BASE64 - help - Base64 encode and decode -config BUSYBOX_CONFIG_WHO - bool "who" - default BUSYBOX_DEFAULT_WHO - depends on BUSYBOX_CONFIG_FEATURE_UTMP - help - who is used to show who is logged on. -config BUSYBOX_CONFIG_USERS - bool "users" - default BUSYBOX_DEFAULT_USERS - depends on BUSYBOX_CONFIG_FEATURE_UTMP - help - Print users currently logged on. - -config BUSYBOX_CONFIG_CAL - bool "cal" - default BUSYBOX_DEFAULT_CAL - help - cal is used to display a monthly calendar. - -config BUSYBOX_CONFIG_CATV - bool "catv" - default BUSYBOX_DEFAULT_CATV - help - Display nonprinting characters as escape sequences (like some - implementations' cat -v option). - -config BUSYBOX_CONFIG_CHGRP - bool "chgrp" - default BUSYBOX_DEFAULT_CHGRP - help - chgrp is used to change the group ownership of files. - -config BUSYBOX_CONFIG_CHMOD - bool "chmod" - default BUSYBOX_DEFAULT_CHMOD - help - chmod is used to change the access permission of files. - -config BUSYBOX_CONFIG_CHOWN - bool "chown" - default BUSYBOX_DEFAULT_CHOWN - help - chown is used to change the user and/or group ownership - of files. - -config BUSYBOX_CONFIG_FEATURE_CHOWN_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_CHOWN_LONG_OPTIONS - depends on BUSYBOX_CONFIG_CHOWN && BUSYBOX_CONFIG_LONG_OPTS - help - Enable use of long options - -config BUSYBOX_CONFIG_CHROOT - bool "chroot" - default BUSYBOX_DEFAULT_CHROOT - help - chroot is used to change the root directory and run a command. - The default command is `/bin/sh'. - -config BUSYBOX_CONFIG_CKSUM - bool "cksum" - default BUSYBOX_DEFAULT_CKSUM - help - cksum is used to calculate the CRC32 checksum of a file. - -config BUSYBOX_CONFIG_COMM - bool "comm" - default BUSYBOX_DEFAULT_COMM - help - comm is used to compare two files line by line and return - a three-column output. - -config BUSYBOX_CONFIG_CP - bool "cp" - default BUSYBOX_DEFAULT_CP - help - cp is used to copy files and directories. - -config BUSYBOX_CONFIG_FEATURE_CP_LONG_OPTIONS - bool "Enable long options for cp" - default BUSYBOX_DEFAULT_FEATURE_CP_LONG_OPTIONS - depends on BUSYBOX_CONFIG_CP && BUSYBOX_CONFIG_LONG_OPTS - help - Enable long options for cp. - Also add support for --parents option. - -config BUSYBOX_CONFIG_CUT - bool "cut" - default BUSYBOX_DEFAULT_CUT - help - cut is used to print selected parts of lines from - each file to stdout. - -config BUSYBOX_CONFIG_DF - bool "df" - default BUSYBOX_DEFAULT_DF - help - df reports the amount of disk space used and available - on filesystems. - -config BUSYBOX_CONFIG_FEATURE_DF_FANCY - bool "Enable -a, -i, -B" - default BUSYBOX_DEFAULT_FEATURE_DF_FANCY - depends on BUSYBOX_CONFIG_DF - help - This option enables -a, -i and -B. - - -a Show all filesystems - -i Inodes - -B Blocksize - -config BUSYBOX_CONFIG_DIRNAME - bool "dirname" - default BUSYBOX_DEFAULT_DIRNAME - help - dirname is used to strip a non-directory suffix from - a file name. - -config BUSYBOX_CONFIG_DOS2UNIX - bool "dos2unix/unix2dos" - default BUSYBOX_DEFAULT_DOS2UNIX - help - dos2unix is used to convert a text file from DOS format to - UNIX format, and vice versa. - -config BUSYBOX_CONFIG_UNIX2DOS - bool - default BUSYBOX_DEFAULT_UNIX2DOS - depends on BUSYBOX_CONFIG_DOS2UNIX - help - unix2dos is used to convert a text file from UNIX format to - DOS format, and vice versa. - -config BUSYBOX_CONFIG_DU - bool "du (default blocksize of 512 bytes)" - default BUSYBOX_DEFAULT_DU - help - du is used to report the amount of disk space used - for specified files. - -config BUSYBOX_CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K - bool "Use a default blocksize of 1024 bytes (1K)" - default BUSYBOX_DEFAULT_FEATURE_DU_DEFAULT_BLOCKSIZE_1K - depends on BUSYBOX_CONFIG_DU - help - Use a blocksize of (1K) instead of the default 512b. - -config BUSYBOX_CONFIG_ECHO - bool "echo (basic SuSv3 version taking no options)" - default BUSYBOX_DEFAULT_ECHO - help - echo is used to print a specified string to stdout. - -# this entry also appears in shell/Config.in, next to the echo builtin -config BUSYBOX_CONFIG_FEATURE_FANCY_ECHO - bool "Enable echo options (-n and -e)" - default BUSYBOX_DEFAULT_FEATURE_FANCY_ECHO - depends on BUSYBOX_CONFIG_ECHO || BUSYBOX_CONFIG_ASH_BUILTIN_ECHO || BUSYBOX_CONFIG_HUSH - help - This adds options (-n and -e) to echo. - -config BUSYBOX_CONFIG_ENV - bool "env" - default BUSYBOX_DEFAULT_ENV - help - env is used to set an environment variable and run - a command; without options it displays the current - environment. - -config BUSYBOX_CONFIG_FEATURE_ENV_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_ENV_LONG_OPTIONS - depends on BUSYBOX_CONFIG_ENV && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the env applet. - -config BUSYBOX_CONFIG_EXPAND - bool "expand" - default BUSYBOX_DEFAULT_EXPAND - help - By default, convert all tabs to spaces. - -config BUSYBOX_CONFIG_FEATURE_EXPAND_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_EXPAND_LONG_OPTIONS - depends on BUSYBOX_CONFIG_EXPAND && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the expand applet. - -config BUSYBOX_CONFIG_EXPR - bool "expr" - default BUSYBOX_DEFAULT_EXPR - help - expr is used to calculate numbers and print the result - to standard output. - -config BUSYBOX_CONFIG_EXPR_MATH_SUPPORT_64 - bool "Extend Posix numbers support to 64 bit" - default BUSYBOX_DEFAULT_EXPR_MATH_SUPPORT_64 - depends on BUSYBOX_CONFIG_EXPR - help - Enable 64-bit math support in the expr applet. This will make - the applet slightly larger, but will allow computation with very - large numbers. - -config BUSYBOX_CONFIG_FALSE - bool "false" - default BUSYBOX_DEFAULT_FALSE - help - false returns an exit code of FALSE (1). - -config BUSYBOX_CONFIG_FOLD - bool "fold" - default BUSYBOX_DEFAULT_FOLD - help - Wrap text to fit a specific width. - -config BUSYBOX_CONFIG_FSYNC - bool "fsync" - default BUSYBOX_DEFAULT_FSYNC - help - fsync is used to flush file-related cached blocks to disk. - -config BUSYBOX_CONFIG_HEAD - bool "head" - default BUSYBOX_DEFAULT_HEAD - help - head is used to print the first specified number of lines - from files. - -config BUSYBOX_CONFIG_FEATURE_FANCY_HEAD - bool "Enable head options (-c, -q, and -v)" - default BUSYBOX_DEFAULT_FEATURE_FANCY_HEAD - depends on BUSYBOX_CONFIG_HEAD - help - This enables the head options (-c, -q, and -v). - -config BUSYBOX_CONFIG_INSTALL - bool "install" - default BUSYBOX_DEFAULT_INSTALL - help - Copy files and set attributes. - -config BUSYBOX_CONFIG_FEATURE_INSTALL_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_INSTALL_LONG_OPTIONS - depends on BUSYBOX_CONFIG_INSTALL && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the install applet. - -####config LENGTH -#### bool "length" -#### default y -#### help -#### length is used to print out the length of a specified string. - -config BUSYBOX_CONFIG_LN - bool "ln" - default BUSYBOX_DEFAULT_LN - help - ln is used to create hard or soft links between files. - -config BUSYBOX_CONFIG_LOGNAME - bool "logname" - default BUSYBOX_DEFAULT_LOGNAME - help - logname is used to print the current user's login name. - -config BUSYBOX_CONFIG_LS - bool "ls" - default BUSYBOX_DEFAULT_LS - help - ls is used to list the contents of directories. - -config BUSYBOX_CONFIG_FEATURE_LS_FILETYPES - bool "Enable filetyping options (-p and -F)" - default BUSYBOX_DEFAULT_FEATURE_LS_FILETYPES - depends on BUSYBOX_CONFIG_LS - help - Enable the ls options (-p and -F). - -config BUSYBOX_CONFIG_FEATURE_LS_FOLLOWLINKS - bool "Enable symlinks dereferencing (-L)" - default BUSYBOX_DEFAULT_FEATURE_LS_FOLLOWLINKS - depends on BUSYBOX_CONFIG_LS - help - Enable the ls option (-L). - -config BUSYBOX_CONFIG_FEATURE_LS_RECURSIVE - bool "Enable recursion (-R)" - default BUSYBOX_DEFAULT_FEATURE_LS_RECURSIVE - depends on BUSYBOX_CONFIG_LS - help - Enable the ls option (-R). - -config BUSYBOX_CONFIG_FEATURE_LS_SORTFILES - bool "Sort the file names" - default BUSYBOX_DEFAULT_FEATURE_LS_SORTFILES - depends on BUSYBOX_CONFIG_LS - help - Allow ls to sort file names alphabetically. - -config BUSYBOX_CONFIG_FEATURE_LS_TIMESTAMPS - bool "Show file timestamps" - default BUSYBOX_DEFAULT_FEATURE_LS_TIMESTAMPS - depends on BUSYBOX_CONFIG_LS - help - Allow ls to display timestamps for files. - -config BUSYBOX_CONFIG_FEATURE_LS_USERNAME - bool "Show username/groupnames" - default BUSYBOX_DEFAULT_FEATURE_LS_USERNAME - depends on BUSYBOX_CONFIG_LS - help - Allow ls to display username/groupname for files. - -config BUSYBOX_CONFIG_FEATURE_LS_COLOR - bool "Allow use of color to identify file types" - default BUSYBOX_DEFAULT_FEATURE_LS_COLOR - depends on BUSYBOX_CONFIG_LS && BUSYBOX_CONFIG_LONG_OPTS - help - This enables the --color option to ls. - -config BUSYBOX_CONFIG_FEATURE_LS_COLOR_IS_DEFAULT - bool "Produce colored ls output by default" - default BUSYBOX_DEFAULT_FEATURE_LS_COLOR_IS_DEFAULT - depends on BUSYBOX_CONFIG_FEATURE_LS_COLOR - help - Saying yes here will turn coloring on by default, - even if no "--color" option is given to the ls command. - This is not recommended, since the colors are not - configurable, and the output may not be legible on - many output screens. - -config BUSYBOX_CONFIG_MD5SUM - bool "md5sum" - default BUSYBOX_DEFAULT_MD5SUM - help - md5sum is used to print or check MD5 checksums. - -config BUSYBOX_CONFIG_MKDIR - bool "mkdir" - default BUSYBOX_DEFAULT_MKDIR - help - mkdir is used to create directories with the specified names. - -config BUSYBOX_CONFIG_FEATURE_MKDIR_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_MKDIR_LONG_OPTIONS - depends on BUSYBOX_CONFIG_MKDIR && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the mkdir applet. - -config BUSYBOX_CONFIG_MKFIFO - bool "mkfifo" - default BUSYBOX_DEFAULT_MKFIFO - help - mkfifo is used to create FIFOs (named pipes). - The `mknod' program can also create FIFOs. - -config BUSYBOX_CONFIG_MKNOD - bool "mknod" - default BUSYBOX_DEFAULT_MKNOD - help - mknod is used to create FIFOs or block/character special - files with the specified names. - -config BUSYBOX_CONFIG_MV - bool "mv" - default BUSYBOX_DEFAULT_MV - help - mv is used to move or rename files or directories. - -config BUSYBOX_CONFIG_FEATURE_MV_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_MV_LONG_OPTIONS - depends on BUSYBOX_CONFIG_MV && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the mv applet. - -config BUSYBOX_CONFIG_NICE - bool "nice" - default BUSYBOX_DEFAULT_NICE - help - nice runs a program with modified scheduling priority. - -config BUSYBOX_CONFIG_NOHUP - bool "nohup" - default BUSYBOX_DEFAULT_NOHUP - help - run a command immune to hangups, with output to a non-tty. - -config BUSYBOX_CONFIG_OD - bool "od" - default BUSYBOX_DEFAULT_OD - help - od is used to dump binary files in octal and other formats. - -config BUSYBOX_CONFIG_PRINTENV - bool "printenv" - default BUSYBOX_DEFAULT_PRINTENV - help - printenv is used to print all or part of environment. - -config BUSYBOX_CONFIG_PRINTF - bool "printf" - default BUSYBOX_DEFAULT_PRINTF - help - printf is used to format and print specified strings. - It's similar to `echo' except it has more options. - -config BUSYBOX_CONFIG_PWD - bool "pwd" - default BUSYBOX_DEFAULT_PWD - help - pwd is used to print the current directory. - -config BUSYBOX_CONFIG_READLINK - bool "readlink" - default BUSYBOX_DEFAULT_READLINK - help - This program reads a symbolic link and returns the name - of the file it points to - -config BUSYBOX_CONFIG_FEATURE_READLINK_FOLLOW - bool "Enable canonicalization by following all symlinks (-f)" - default BUSYBOX_DEFAULT_FEATURE_READLINK_FOLLOW - depends on BUSYBOX_CONFIG_READLINK - help - Enable the readlink option (-f). - -config BUSYBOX_CONFIG_REALPATH - bool "realpath" - default BUSYBOX_DEFAULT_REALPATH - help - Return the canonicalized absolute pathname. - This isn't provided by GNU shellutils, but where else does it belong. - -config BUSYBOX_CONFIG_RM - bool "rm" - default BUSYBOX_DEFAULT_RM - help - rm is used to remove files or directories. - -config BUSYBOX_CONFIG_RMDIR - bool "rmdir" - default BUSYBOX_DEFAULT_RMDIR - help - rmdir is used to remove empty directories. - -config BUSYBOX_CONFIG_FEATURE_RMDIR_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_RMDIR_LONG_OPTIONS - depends on BUSYBOX_CONFIG_RMDIR && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the rmdir applet, including - --ignore-fail-on-non-empty for compatibility with GNU rmdir. - -config BUSYBOX_CONFIG_SEQ - bool "seq" - default BUSYBOX_DEFAULT_SEQ - help - print a sequence of numbers - -config BUSYBOX_CONFIG_SHA1SUM - bool "sha1sum" - default BUSYBOX_DEFAULT_SHA1SUM - help - Compute and check SHA1 message digest - -config BUSYBOX_CONFIG_SHA256SUM - bool "sha256sum" - default BUSYBOX_DEFAULT_SHA256SUM - help - Compute and check SHA256 message digest - -config BUSYBOX_CONFIG_SHA512SUM - bool "sha512sum" - default BUSYBOX_DEFAULT_SHA512SUM - help - Compute and check SHA512 message digest - -config BUSYBOX_CONFIG_SHA3SUM - bool "sha3sum" - default BUSYBOX_DEFAULT_SHA3SUM - help - Compute and check SHA3 (512-bit) message digest - -config BUSYBOX_CONFIG_SLEEP - bool "sleep" - default BUSYBOX_DEFAULT_SLEEP - help - sleep is used to pause for a specified number of seconds. - It comes in 3 versions: - - small: takes one integer parameter - - fancy: takes multiple integer arguments with suffixes: - sleep 1d 2h 3m 15s - - fancy with fractional numbers: - sleep 2.3s 4.5h sleeps for 16202.3 seconds - Last one is "the most compatible" with coreutils sleep, - but it adds around 1k of code. - -config BUSYBOX_CONFIG_FEATURE_FANCY_SLEEP - bool "Enable multiple arguments and s/m/h/d suffixes" - default BUSYBOX_DEFAULT_FEATURE_FANCY_SLEEP - depends on BUSYBOX_CONFIG_SLEEP - help - Allow sleep to pause for specified minutes, hours, and days. - -config BUSYBOX_CONFIG_FEATURE_FLOAT_SLEEP - bool "Enable fractional arguments" - default BUSYBOX_DEFAULT_FEATURE_FLOAT_SLEEP - depends on BUSYBOX_CONFIG_FEATURE_FANCY_SLEEP - help - Allow for fractional numeric parameters. - -config BUSYBOX_CONFIG_SORT - bool "sort" - default BUSYBOX_DEFAULT_SORT - help - sort is used to sort lines of text in specified files. - -config BUSYBOX_CONFIG_FEATURE_SORT_BIG - bool "Full SuSv3 compliant sort (support -ktcsbdfiozgM)" - default BUSYBOX_DEFAULT_FEATURE_SORT_BIG - depends on BUSYBOX_CONFIG_SORT - help - Without this, sort only supports -r, -u, and an integer version - of -n. Selecting this adds sort keys, floating point support, and - more. This adds a little over 3k to a nonstatic build on x86. - - The SuSv3 sort standard is available at: - http://www.opengroup.org/onlinepubs/007904975/utilities/sort.html - -config BUSYBOX_CONFIG_SPLIT - bool "split" - default BUSYBOX_DEFAULT_SPLIT - help - split a file into pieces. - -config BUSYBOX_CONFIG_FEATURE_SPLIT_FANCY - bool "Fancy extensions" - default BUSYBOX_DEFAULT_FEATURE_SPLIT_FANCY - depends on BUSYBOX_CONFIG_SPLIT - help - Add support for features not required by SUSv3. - Supports additional suffixes 'b' for 512 bytes, - 'g' for 1GiB for the -b option. - -config BUSYBOX_CONFIG_STTY - bool "stty" - default BUSYBOX_DEFAULT_STTY - help - stty is used to change and print terminal line settings. - -config BUSYBOX_CONFIG_SUM - bool "sum" - default BUSYBOX_DEFAULT_SUM - help - checksum and count the blocks in a file - -config BUSYBOX_CONFIG_TAC - bool "tac" - default BUSYBOX_DEFAULT_TAC - help - tac is used to concatenate and print files in reverse. - -config BUSYBOX_CONFIG_TAIL - bool "tail" - default BUSYBOX_DEFAULT_TAIL - help - tail is used to print the last specified number of lines - from files. - -config BUSYBOX_CONFIG_FEATURE_FANCY_TAIL - bool "Enable extra tail options (-q, -s, -v, and -F)" - default BUSYBOX_DEFAULT_FEATURE_FANCY_TAIL - depends on BUSYBOX_CONFIG_TAIL - help - The options (-q, -s, -v and -F) are provided by GNU tail, but - are not specific in the SUSv3 standard. - - -q Never output headers giving file names - -s SEC Wait SEC seconds between reads with -f - -v Always output headers giving file names - -F Same as -f, but keep retrying - -config BUSYBOX_CONFIG_TEE - bool "tee" - default BUSYBOX_DEFAULT_TEE - help - tee is used to read from standard input and write - to standard output and files. - -config BUSYBOX_CONFIG_FEATURE_TEE_USE_BLOCK_IO - bool "Enable block I/O (larger/faster) instead of byte I/O" - default BUSYBOX_DEFAULT_FEATURE_TEE_USE_BLOCK_IO - depends on BUSYBOX_CONFIG_TEE - help - Enable this option for a faster tee, at expense of size. - -config BUSYBOX_CONFIG_TRUE - bool "true" - default BUSYBOX_DEFAULT_TRUE - help - true returns an exit code of TRUE (0). - config BUSYBOX_CONFIG_TTY bool "tty" default BUSYBOX_DEFAULT_TTY help tty is used to print the name of the current terminal to standard output. - config BUSYBOX_CONFIG_UNAME bool "uname" default BUSYBOX_DEFAULT_UNAME @@ -861,44 +833,36 @@ config BUSYBOX_CONFIG_UNAME_OSNAME help Sets the operating system name reported by uname -o. The default BUSYBOX_DEFAULT_UNAME_OSNAME "GNU/Linux". - -config BUSYBOX_CONFIG_UNEXPAND - bool "unexpand" - default BUSYBOX_DEFAULT_UNEXPAND - help - By default, convert only leading sequences of blanks to tabs. - -config BUSYBOX_CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_UNEXPAND_LONG_OPTIONS - depends on BUSYBOX_CONFIG_UNEXPAND && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the unexpand applet. - config BUSYBOX_CONFIG_UNIQ bool "uniq" default BUSYBOX_DEFAULT_UNIQ help uniq is used to remove duplicate lines from a sorted file. - +config BUSYBOX_CONFIG_UNLINK + bool "unlink" + default BUSYBOX_DEFAULT_UNLINK + help + unlink deletes a file by calling unlink() config BUSYBOX_CONFIG_USLEEP bool "usleep" default BUSYBOX_DEFAULT_USLEEP help usleep is used to pause for a specified number of microseconds. - config BUSYBOX_CONFIG_UUDECODE bool "uudecode" default BUSYBOX_DEFAULT_UUDECODE help uudecode is used to decode a uuencoded file. - +config BUSYBOX_CONFIG_BASE64 + bool "base64" + default BUSYBOX_DEFAULT_BASE64 + help + Base64 encode and decode config BUSYBOX_CONFIG_UUENCODE bool "uuencode" default BUSYBOX_DEFAULT_UUENCODE help uuencode is used to uuencode a file. - config BUSYBOX_CONFIG_WC bool "wc" default BUSYBOX_DEFAULT_WC @@ -907,19 +871,37 @@ config BUSYBOX_CONFIG_WC in specified files. config BUSYBOX_CONFIG_FEATURE_WC_LARGE - bool "Support very large files in wc" + bool "Support very large counts" default BUSYBOX_DEFAULT_FEATURE_WC_LARGE depends on BUSYBOX_CONFIG_WC help - Use "unsigned long long" in wc for counter variables. + Use "unsigned long long" for counter variables. +config BUSYBOX_CONFIG_WHO + bool "who" + default BUSYBOX_DEFAULT_WHO + depends on BUSYBOX_CONFIG_FEATURE_UTMP + help + who is used to show who is logged on. +config BUSYBOX_CONFIG_W + bool "w" + default BUSYBOX_DEFAULT_W + depends on BUSYBOX_CONFIG_FEATURE_UTMP + help + w is used to show who is logged on. + +config BUSYBOX_CONFIG_USERS + bool "users" + default BUSYBOX_DEFAULT_USERS + depends on BUSYBOX_CONFIG_FEATURE_UTMP + help + Print users currently logged on. config BUSYBOX_CONFIG_WHOAMI bool "whoami" default BUSYBOX_DEFAULT_WHOAMI help whoami is used to print the username of the current user id (same as id -un). - config BUSYBOX_CONFIG_YES bool "yes" default BUSYBOX_DEFAULT_YES @@ -947,41 +929,14 @@ config BUSYBOX_CONFIG_FEATURE_PRESERVE_HARDLINKS help Allow cp and mv to preserve hard links. -comment "Common options for ls, more and telnet" - depends on BUSYBOX_CONFIG_LS || BUSYBOX_CONFIG_MORE || BUSYBOX_CONFIG_TELNET - -config BUSYBOX_CONFIG_FEATURE_AUTOWIDTH - bool "Calculate terminal & column widths" - default BUSYBOX_DEFAULT_FEATURE_AUTOWIDTH - depends on BUSYBOX_CONFIG_LS || BUSYBOX_CONFIG_MORE || BUSYBOX_CONFIG_TELNET - help - This option allows utilities such as 'ls', 'more' and 'telnet' - to determine the width of the screen, which can allow them to - display additional text or avoid wrapping text onto the next line. - If you leave this disabled, your utilities will be especially - primitive and will be unable to determine the current screen width. - comment "Common options for df, du, ls" depends on BUSYBOX_CONFIG_DF || BUSYBOX_CONFIG_DU || BUSYBOX_CONFIG_LS config BUSYBOX_CONFIG_FEATURE_HUMAN_READABLE - bool "Support for human readable output (example 13k, 23M, 235G)" + bool "Support human readable output (example 13k, 23M, 235G)" default BUSYBOX_DEFAULT_FEATURE_HUMAN_READABLE depends on BUSYBOX_CONFIG_DF || BUSYBOX_CONFIG_DU || BUSYBOX_CONFIG_LS help Allow df, du, and ls to have human readable output. -comment "Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum" - depends on BUSYBOX_CONFIG_MD5SUM || BUSYBOX_CONFIG_SHA1SUM || BUSYBOX_CONFIG_SHA256SUM || BUSYBOX_CONFIG_SHA512SUM || BUSYBOX_CONFIG_SHA3SUM - -config BUSYBOX_CONFIG_FEATURE_MD5_SHA1_SUM_CHECK - bool "Enable -c, -s and -w options" - default BUSYBOX_DEFAULT_FEATURE_MD5_SHA1_SUM_CHECK - depends on BUSYBOX_CONFIG_MD5SUM || BUSYBOX_CONFIG_SHA1SUM || BUSYBOX_CONFIG_SHA256SUM || BUSYBOX_CONFIG_SHA512SUM || BUSYBOX_CONFIG_SHA3SUM - help - Enabling the -c options allows files to be checked - against pre-calculated hash values. - - -s and -w are useful options when verifying checksums. - endmenu diff --git a/package/utils/busybox/config/debianutils/Config.in b/package/utils/busybox/config/debianutils/Config.in index d39c60f43..6b9de0de5 100644 --- a/package/utils/busybox/config/debianutils/Config.in +++ b/package/utils/busybox/config/debianutils/Config.in @@ -6,11 +6,6 @@ menu "Debian Utilities" -config BUSYBOX_CONFIG_MKTEMP - bool "mktemp" - default BUSYBOX_DEFAULT_MKTEMP - help - mktemp is used to create unique temporary files config BUSYBOX_CONFIG_PIPE_PROGRESS bool "pipe_progress" default BUSYBOX_DEFAULT_PIPE_PROGRESS @@ -35,8 +30,6 @@ config BUSYBOX_CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_RUN_PARTS_LONG_OPTIONS depends on BUSYBOX_CONFIG_RUN_PARTS && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the run-parts applet. config BUSYBOX_CONFIG_FEATURE_RUN_PARTS_FANCY bool "Support additional arguments" @@ -54,22 +47,19 @@ config BUSYBOX_CONFIG_START_STOP_DAEMON termination of system-level processes, usually the ones started during the startup of the system. +config BUSYBOX_CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_START_STOP_DAEMON_LONG_OPTIONS + depends on BUSYBOX_CONFIG_START_STOP_DAEMON && BUSYBOX_CONFIG_LONG_OPTS + config BUSYBOX_CONFIG_FEATURE_START_STOP_DAEMON_FANCY bool "Support additional arguments" default BUSYBOX_DEFAULT_FEATURE_START_STOP_DAEMON_FANCY depends on BUSYBOX_CONFIG_START_STOP_DAEMON help - Support additional arguments. -o|--oknodo ignored since we exit with 0 anyway -v|--verbose -N|--nicelevel N - -config BUSYBOX_CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_START_STOP_DAEMON_LONG_OPTIONS - depends on BUSYBOX_CONFIG_START_STOP_DAEMON && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the start-stop-daemon applet. config BUSYBOX_CONFIG_WHICH bool "which" default BUSYBOX_DEFAULT_WHICH diff --git a/package/utils/busybox/config/editors/Config.in b/package/utils/busybox/config/editors/Config.in index 6ae361f7f..da4eaedd7 100644 --- a/package/utils/busybox/config/editors/Config.in +++ b/package/utils/busybox/config/editors/Config.in @@ -49,8 +49,6 @@ config BUSYBOX_CONFIG_FEATURE_DIFF_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_DIFF_LONG_OPTIONS depends on BUSYBOX_CONFIG_DIFF && BUSYBOX_CONFIG_LONG_OPTS - help - Enable use of long options. config BUSYBOX_CONFIG_FEATURE_DIFF_DIR bool "Enable directory support" @@ -87,7 +85,7 @@ config BUSYBOX_CONFIG_VI you may wish to use something else. config BUSYBOX_CONFIG_FEATURE_VI_MAX_LEN - int "Maximum screen width in vi" + int "Maximum screen width" range 256 16384 default BUSYBOX_DEFAULT_FEATURE_VI_MAX_LEN depends on BUSYBOX_CONFIG_VI @@ -96,7 +94,7 @@ config BUSYBOX_CONFIG_FEATURE_VI_MAX_LEN Make it smaller than 4k only if you are very limited on memory. config BUSYBOX_CONFIG_FEATURE_VI_8BIT - bool "Allow vi to display 8-bit chars (otherwise shows dots)" + bool "Allow to display 8-bit chars (otherwise shows dots)" default BUSYBOX_DEFAULT_FEATURE_VI_8BIT depends on BUSYBOX_CONFIG_VI help @@ -110,7 +108,7 @@ config BUSYBOX_CONFIG_FEATURE_VI_COLON default BUSYBOX_DEFAULT_FEATURE_VI_COLON depends on BUSYBOX_CONFIG_VI help - Enable a limited set of colon commands for vi. This does not + Enable a limited set of colon commands. This does not provide an "ex" mode. config BUSYBOX_CONFIG_FEATURE_VI_YANKMARK @@ -118,16 +116,14 @@ config BUSYBOX_CONFIG_FEATURE_VI_YANKMARK default BUSYBOX_DEFAULT_FEATURE_VI_YANKMARK depends on BUSYBOX_CONFIG_VI help - This will enable you to use yank and put, as well as mark in - busybox vi. + This will enable you to use yank and put, as well as mark. config BUSYBOX_CONFIG_FEATURE_VI_SEARCH bool "Enable search and replace cmds" default BUSYBOX_DEFAULT_FEATURE_VI_SEARCH depends on BUSYBOX_CONFIG_VI help - Select this if you wish to be able to do search and replace in - busybox vi. + Select this if you wish to be able to do search and replace. config BUSYBOX_CONFIG_FEATURE_VI_REGEX_SEARCH bool "Enable regex in search and replace" @@ -141,16 +137,15 @@ config BUSYBOX_CONFIG_FEATURE_VI_USE_SIGNALS default BUSYBOX_DEFAULT_FEATURE_VI_USE_SIGNALS depends on BUSYBOX_CONFIG_VI help - Selecting this option will make busybox vi signal aware. This will - make busybox vi support SIGWINCH to deal with Window Changes, catch - Ctrl-Z and Ctrl-C and alarms. + Selecting this option will make vi signal aware. This will support + SIGWINCH to deal with Window Changes, catch ^Z and ^C and alarms. config BUSYBOX_CONFIG_FEATURE_VI_DOT_CMD bool "Remember previous cmd and \".\" cmd" default BUSYBOX_DEFAULT_FEATURE_VI_DOT_CMD depends on BUSYBOX_CONFIG_VI help - Make busybox vi remember the last command and be able to repeat it. + Make vi remember the last command and be able to repeat it. config BUSYBOX_CONFIG_FEATURE_VI_READONLY bool "Enable -R option and \"view\" mode" @@ -161,25 +156,23 @@ config BUSYBOX_CONFIG_FEATURE_VI_READONLY open a file in read-only mode. config BUSYBOX_CONFIG_FEATURE_VI_SETOPTS - bool "Enable set-able options, ai ic showmatch" + bool "Enable settable options, ai ic showmatch" default BUSYBOX_DEFAULT_FEATURE_VI_SETOPTS depends on BUSYBOX_CONFIG_VI help Enable the editor to set some (ai, ic, showmatch) options. config BUSYBOX_CONFIG_FEATURE_VI_SET - bool "Support for :set" + bool "Support :set" default BUSYBOX_DEFAULT_FEATURE_VI_SET depends on BUSYBOX_CONFIG_VI - help - Support for ":set". config BUSYBOX_CONFIG_FEATURE_VI_WIN_RESIZE bool "Handle window resize" default BUSYBOX_DEFAULT_FEATURE_VI_WIN_RESIZE depends on BUSYBOX_CONFIG_VI help - Make busybox vi behave nicely with terminals that get resized. + Behave nicely with terminals that get resized. config BUSYBOX_CONFIG_FEATURE_VI_ASK_TERMINAL bool "Use 'tell me cursor position' ESC sequence to measure window" @@ -190,15 +183,16 @@ config BUSYBOX_CONFIG_FEATURE_VI_ASK_TERMINAL this option makes vi perform a last-ditch effort to find it: position cursor to 999,999 and ask terminal to report real cursor position using "ESC [ 6 n" escape sequence, then read stdin. - This is not clean but helps a lot on serial lines and such. + config BUSYBOX_CONFIG_FEATURE_VI_UNDO - bool "Support undo command 'u'" + bool "Support undo command \"u\"" default BUSYBOX_DEFAULT_FEATURE_VI_UNDO depends on BUSYBOX_CONFIG_VI help Support the 'u' command to undo insertion, deletion, and replacement of text. + config BUSYBOX_CONFIG_FEATURE_VI_UNDO_QUEUE bool "Enable undo operation queuing" default BUSYBOX_DEFAULT_FEATURE_VI_UNDO_QUEUE @@ -209,6 +203,7 @@ config BUSYBOX_CONFIG_FEATURE_VI_UNDO_QUEUE reached, the contents of the queue are committed to the undo stack. This increases the size of the undo code and allows some undo operations (especially un-typing/backspacing) to be far more useful. + config BUSYBOX_CONFIG_FEATURE_VI_UNDO_QUEUE_MAX int "Maximum undo character queue size" default BUSYBOX_DEFAULT_FEATURE_VI_UNDO_QUEUE_MAX @@ -228,7 +223,7 @@ config BUSYBOX_CONFIG_FEATURE_ALLOW_EXEC default BUSYBOX_DEFAULT_FEATURE_ALLOW_EXEC depends on BUSYBOX_CONFIG_VI || BUSYBOX_CONFIG_AWK help - Enables vi and awk features which allows user to execute + Enables vi and awk features which allow user to execute shell commands (using system() C call). endmenu diff --git a/package/utils/busybox/config/findutils/Config.in b/package/utils/busybox/config/findutils/Config.in index 85ee1db2c..3393adbe3 100644 --- a/package/utils/busybox/config/findutils/Config.in +++ b/package/utils/busybox/config/findutils/Config.in @@ -42,8 +42,6 @@ config BUSYBOX_CONFIG_FEATURE_FIND_PERM bool "Enable -perm: permissions matching" default BUSYBOX_DEFAULT_FEATURE_FIND_PERM depends on BUSYBOX_CONFIG_FIND - help - Enable searching based on file permissions. config BUSYBOX_CONFIG_FEATURE_FIND_TYPE bool "Enable -type: file type matching (file/dir/link/...)" @@ -57,15 +55,11 @@ config BUSYBOX_CONFIG_FEATURE_FIND_XDEV bool "Enable -xdev: 'stay in filesystem'" default BUSYBOX_DEFAULT_FEATURE_FIND_XDEV depends on BUSYBOX_CONFIG_FIND - help - This option allows find to restrict searches to a single filesystem. config BUSYBOX_CONFIG_FEATURE_FIND_MAXDEPTH bool "Enable -mindepth N and -maxdepth N" default BUSYBOX_DEFAULT_FEATURE_FIND_MAXDEPTH depends on BUSYBOX_CONFIG_FIND - help - This option enables -mindepth N and -maxdepth N option. config BUSYBOX_CONFIG_FEATURE_FIND_NEWER bool "Enable -newer: compare file modification times" @@ -79,8 +73,6 @@ config BUSYBOX_CONFIG_FEATURE_FIND_INUM bool "Enable -inum: inode number matching" default BUSYBOX_DEFAULT_FEATURE_FIND_INUM depends on BUSYBOX_CONFIG_FIND - help - Support the 'find -inum' option for searching by inode number. config BUSYBOX_CONFIG_FEATURE_FIND_EXEC bool "Enable -exec: execute commands" @@ -104,15 +96,11 @@ config BUSYBOX_CONFIG_FEATURE_FIND_USER bool "Enable -user: username/uid matching" default BUSYBOX_DEFAULT_FEATURE_FIND_USER depends on BUSYBOX_CONFIG_FIND - help - Support the 'find -user' option for searching by username or uid. config BUSYBOX_CONFIG_FEATURE_FIND_GROUP bool "Enable -group: group/gid matching" default BUSYBOX_DEFAULT_FEATURE_FIND_GROUP depends on BUSYBOX_CONFIG_FIND - help - Support the 'find -group' option for searching by group name or gid. config BUSYBOX_CONFIG_FEATURE_FIND_NOT bool "Enable the 'not' (!) operator" @@ -141,15 +129,13 @@ config BUSYBOX_CONFIG_FEATURE_FIND_SIZE bool "Enable -size: file size matching" default BUSYBOX_DEFAULT_FEATURE_FIND_SIZE depends on BUSYBOX_CONFIG_FIND - help - Support the 'find -size' option for searching by file size. config BUSYBOX_CONFIG_FEATURE_FIND_PRUNE bool "Enable -prune: exclude subdirectories" default BUSYBOX_DEFAULT_FEATURE_FIND_PRUNE depends on BUSYBOX_CONFIG_FIND help - If the file is a directory, dont descend into it. Useful for + If the file is a directory, don't descend into it. Useful for exclusion .svn and CVS directories. config BUSYBOX_CONFIG_FEATURE_FIND_DELETE @@ -194,28 +180,22 @@ config BUSYBOX_CONFIG_GREP help grep is used to search files for a specified pattern. -config BUSYBOX_CONFIG_FEATURE_GREP_EGREP_ALIAS - bool "Enable extended regular expressions (egrep & grep -E)" - default BUSYBOX_DEFAULT_FEATURE_GREP_EGREP_ALIAS - depends on BUSYBOX_CONFIG_GREP +config BUSYBOX_CONFIG_EGREP + bool "egrep" + default BUSYBOX_DEFAULT_EGREP help - Enabled support for extended regular expressions. Extended - regular expressions allow for alternation (foo|bar), grouping, - and various repetition operators. + Alias to "grep -E" -config BUSYBOX_CONFIG_FEATURE_GREP_FGREP_ALIAS - bool "Alias fgrep to grep -F" - default BUSYBOX_DEFAULT_FEATURE_GREP_FGREP_ALIAS - depends on BUSYBOX_CONFIG_GREP +config BUSYBOX_CONFIG_FGREP + bool "fgrep" + default BUSYBOX_DEFAULT_FGREP help - fgrep sees the search pattern as a normal string rather than - regular expressions. - grep -F always works, this just creates the fgrep alias. + Alias to "grep -F" config BUSYBOX_CONFIG_FEATURE_GREP_CONTEXT bool "Enable before and after context flags (-A, -B and -C)" default BUSYBOX_DEFAULT_FEATURE_GREP_CONTEXT - depends on BUSYBOX_CONFIG_GREP + depends on BUSYBOX_CONFIG_GREP || BUSYBOX_CONFIG_EGREP || BUSYBOX_CONFIG_FGREP help Print the specified number of leading (-B) and/or trailing (-A) context surrounding our matching lines. diff --git a/package/utils/busybox/config/init/Config.in b/package/utils/busybox/config/init/Config.in index 021656d3f..072df3389 100644 --- a/package/utils/busybox/config/init/Config.in +++ b/package/utils/busybox/config/init/Config.in @@ -45,15 +45,27 @@ config BUSYBOX_CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE Enable reading and parsing of $PWD/bootchartd.conf and /etc/bootchartd.conf files. config BUSYBOX_CONFIG_HALT - bool "poweroff, halt, and reboot" + bool "halt" default BUSYBOX_DEFAULT_HALT help - Stop all processes and either halt, reboot, or power off the system. + Stop all processes and halt the system. + +config BUSYBOX_CONFIG_POWEROFF + bool "poweroff" + default BUSYBOX_DEFAULT_POWEROFF + help + Stop all processes and power off the system. + +config BUSYBOX_CONFIG_REBOOT + bool "reboot" + default BUSYBOX_DEFAULT_REBOOT + help + Stop all processes and reboot the system. config BUSYBOX_CONFIG_FEATURE_CALL_TELINIT bool "Call telinit on shutdown and reboot" default BUSYBOX_DEFAULT_FEATURE_CALL_TELINIT - depends on BUSYBOX_CONFIG_HALT && !BUSYBOX_CONFIG_INIT + depends on (BUSYBOX_CONFIG_HALT || BUSYBOX_CONFIG_POWEROFF || BUSYBOX_CONFIG_REBOOT) && !BUSYBOX_CONFIG_INIT help Call an external program (normally telinit) to facilitate a switch to a proper runlevel. @@ -77,7 +89,7 @@ config BUSYBOX_CONFIG_INIT init is the first program run when the system boots. config BUSYBOX_CONFIG_LINUXRC - bool "Support running init from within an initrd (not initramfs)" + bool "linuxrc: support running init from initrd (not initramfs)" default BUSYBOX_DEFAULT_LINUXRC select BUSYBOX_CONFIG_FEATURE_SYSLOG help @@ -133,17 +145,19 @@ config BUSYBOX_CONFIG_FEATURE_INIT_SYSLOG bool "Enable init to write to syslog" default BUSYBOX_DEFAULT_FEATURE_INIT_SYSLOG depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC - -config BUSYBOX_CONFIG_FEATURE_EXTRA_QUIET - bool "Be _extra_ quiet on boot" - default BUSYBOX_DEFAULT_FEATURE_EXTRA_QUIET - depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC help - Prevent init from logging some messages to the console during boot. + If selected, some init messages are sent to syslog. + Otherwise, they are sent to VT #5 if linux virtual tty is detected + (if not, no separate logging is done). + +config BUSYBOX_CONFIG_FEATURE_INIT_QUIET + bool "Be quiet on boot (no 'init started:' message)" + default BUSYBOX_DEFAULT_FEATURE_INIT_QUIET + depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC config BUSYBOX_CONFIG_FEATURE_INIT_COREDUMPS bool "Support dumping core for child processes (debugging only)" - default BUSYBOX_DEFAULT_FEATURE_INIT_COREDUMPS + default BUSYBOX_DEFAULT_FEATURE_INIT_COREDUMPS # not Y because this is a debug option depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC help If this option is enabled and the file /.init_enable_core @@ -164,36 +178,18 @@ config BUSYBOX_CONFIG_INIT_TERMINAL_TYPE sets TERM to "vt102" if one is found. config BUSYBOX_CONFIG_FEATURE_INIT_MODIFY_CMDLINE - bool "Modify the command-line to \"init\"" + bool "Clear init's command line" default BUSYBOX_DEFAULT_FEATURE_INIT_MODIFY_CMDLINE depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC help When launched as PID 1 and after parsing its arguments, init wipes all the arguments but argv[0] and rewrites argv[0] to - contain only "init", so that its command-line appears solely as + contain only "init", so that its command line appears solely as "init" in tools such as ps. If this option is set to Y, init will keep its original behavior, otherwise, all the arguments including argv[0] will be preserved, be they parsed or ignored by init. The original command-line used to launch init can then be retrieved in /proc/1/cmdline on Linux, for example. -config BUSYBOX_CONFIG_MESG - bool "mesg" - default BUSYBOX_DEFAULT_MESG - help - Mesg controls access to your terminal by others. It is typically - used to allow or disallow other users to write to your terminal - -config BUSYBOX_CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP - bool "Enable writing to tty only by group, not by everybody" - default BUSYBOX_DEFAULT_FEATURE_MESG_ENABLE_ONLY_GROUP - depends on BUSYBOX_CONFIG_MESG - help - Usually, ttys are owned by group "tty", and "write" tool is - setgid to this group. This way, "mesg y" only needs to enable - "write by owning group" bit in tty mode. - - If you set this option to N, "mesg y" will enable writing - by anybody at all. This is not recommended. endmenu diff --git a/package/utils/busybox/config/libbb/Config.in b/package/utils/busybox/config/libbb/Config.in index 0695f9ba3..1687ed5c7 100644 --- a/package/utils/busybox/config/libbb/Config.in +++ b/package/utils/busybox/config/libbb/Config.in @@ -45,6 +45,30 @@ config BUSYBOX_CONFIG_FEATURE_RTMINMAX Support RTMIN[+n] and RTMAX[-n] signal names in kill, killall etc. This costs ~250 bytes. +choice + prompt "Buffer allocation policy" + default BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_ON_STACK + help + There are 3 ways BusyBox can handle buffer allocations: + - Use malloc. This costs code size for the call to xmalloc. + - Put them on stack. For some very small machines with limited stack + space, this can be deadly. For most folks, this works just fine. + - Put them in BSS. This works beautifully for computers with a real + MMU (and OS support), but wastes runtime RAM for uCLinux. This + behavior was the only one available for BusyBox versions 0.48 and + earlier. + +config BUSYBOX_CONFIG_FEATURE_BUFFERS_USE_MALLOC + bool "Allocate with Malloc" + +config BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_ON_STACK + bool "Allocate on the Stack" + +config BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_IN_BSS + bool "Allocate in the .bss section" + +endchoice + config BUSYBOX_CONFIG_PASSWORD_MINLEN int "Minimum password length" default BUSYBOX_DEFAULT_PASSWORD_MINLEN @@ -84,24 +108,13 @@ config BUSYBOX_CONFIG_FEATURE_FAST_TOP but code size is slightly bigger. config BUSYBOX_CONFIG_FEATURE_ETC_NETWORKS - bool "Support for /etc/networks" + bool "Support /etc/networks" default BUSYBOX_DEFAULT_FEATURE_ETC_NETWORKS help Enable support for network names in /etc/networks. This is a rarely used feature which allows you to use names instead of IP/mask pairs in route command. -config BUSYBOX_CONFIG_FEATURE_USE_TERMIOS - bool "Use termios to manipulate the screen" - default BUSYBOX_DEFAULT_FEATURE_USE_TERMIOS - depends on BUSYBOX_CONFIG_MORE || BUSYBOX_CONFIG_TOP || BUSYBOX_CONFIG_POWERTOP - help - This option allows utilities such as 'more' and 'top' to determine - the size of the screen. If you leave this disabled, your utilities - that display things on the screen will be especially primitive and - will be unable to determine the current screen size, and will be - unable to move the cursor. - config BUSYBOX_CONFIG_FEATURE_EDITING bool "Command line editing" default BUSYBOX_DEFAULT_FEATURE_EDITING @@ -161,15 +174,11 @@ config BUSYBOX_CONFIG_FEATURE_TAB_COMPLETION bool "Tab completion" default BUSYBOX_DEFAULT_FEATURE_TAB_COMPLETION depends on BUSYBOX_CONFIG_FEATURE_EDITING - help - Enable tab completion. config BUSYBOX_CONFIG_FEATURE_USERNAME_COMPLETION bool "Username completion" default BUSYBOX_DEFAULT_FEATURE_USERNAME_COMPLETION depends on BUSYBOX_CONFIG_FEATURE_TAB_COMPLETION - help - Enable username completion. config BUSYBOX_CONFIG_FEATURE_EDITING_FANCY_PROMPT bool "Fancy shell prompts" @@ -191,6 +200,131 @@ config BUSYBOX_CONFIG_FEATURE_EDITING_ASK_TERMINAL correctly, or want to save on code size (about 400 bytes), then do not turn this option on. +config BUSYBOX_CONFIG_LOCALE_SUPPORT + bool "Enable locale support (system needs locale for this to work)" + default BUSYBOX_DEFAULT_LOCALE_SUPPORT + help + Enable this if your system has locale support and you would like + busybox to support locale settings. + +config BUSYBOX_CONFIG_UNICODE_SUPPORT + bool "Support Unicode" + default BUSYBOX_DEFAULT_UNICODE_SUPPORT + help + This makes various applets aware that one byte is not + one character on screen. + + Busybox aims to eventually work correctly with Unicode displays. + Any older encodings are not guaranteed to work. + Probably by the time when busybox will be fully Unicode-clean, + other encodings will be mainly of historic interest. + +config BUSYBOX_CONFIG_UNICODE_USING_LOCALE + bool "Use libc routines for Unicode (else uses internal ones)" + default BUSYBOX_DEFAULT_UNICODE_USING_LOCALE + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT && BUSYBOX_CONFIG_LOCALE_SUPPORT + help + With this option on, Unicode support is implemented using libc + routines. Otherwise, internal implementation is used. + Internal implementation is smaller. + +config BUSYBOX_CONFIG_FEATURE_CHECK_UNICODE_IN_ENV + bool "Check $LC_ALL, $LC_CTYPE and $LANG environment variables" + default BUSYBOX_DEFAULT_FEATURE_CHECK_UNICODE_IN_ENV + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT && !BUSYBOX_CONFIG_UNICODE_USING_LOCALE + help + With this option on, Unicode support is activated + only if locale-related variables have the value of the form + "xxxx.utf8" + + Otherwise, Unicode support will be always enabled and active. + +config BUSYBOX_CONFIG_SUBST_WCHAR + int "Character code to substitute unprintable characters with" + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT + default BUSYBOX_DEFAULT_SUBST_WCHAR + help + Typical values are 63 for '?' (works with any output device), + 30 for ASCII substitute control code, + 65533 (0xfffd) for Unicode replacement character. + +config BUSYBOX_CONFIG_LAST_SUPPORTED_WCHAR + int "Range of supported Unicode characters" + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT + default BUSYBOX_DEFAULT_LAST_SUPPORTED_WCHAR + help + Any character with Unicode value bigger than this is assumed + to be non-printable on output device. Many applets replace + such characters with substitution character. + + The idea is that many valid printable Unicode chars + nevertheless are not displayed correctly. Think about + combining charachers, double-wide hieroglyphs, obscure + characters in dozens of ancient scripts... + Many terminals, terminal emulators, xterms etc will fail + to handle them correctly. Choose the smallest value + which suits your needs. + + Typical values are: + 126 - ASCII only + 767 (0x2ff) - there are no combining chars in [0..767] range + (the range includes Latin 1, Latin Ext. A and B), + code is ~700 bytes smaller for this case. + 4351 (0x10ff) - there are no double-wide chars in [0..4351] range, + code is ~300 bytes smaller for this case. + 12799 (0x31ff) - nearly all non-ideographic characters are + available in [0..12799] range, including + East Asian scripts like katakana, hiragana, hangul, + bopomofo... + 0 - off, any valid printable Unicode character will be printed. + +config BUSYBOX_CONFIG_UNICODE_COMBINING_WCHARS + bool "Allow zero-width Unicode characters on output" + default BUSYBOX_DEFAULT_UNICODE_COMBINING_WCHARS + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT + help + With this option off, any Unicode char with width of 0 + is substituted on output. + +config BUSYBOX_CONFIG_UNICODE_WIDE_WCHARS + bool "Allow wide Unicode characters on output" + default BUSYBOX_DEFAULT_UNICODE_WIDE_WCHARS + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT + help + With this option off, any Unicode char with width > 1 + is substituted on output. + +config BUSYBOX_CONFIG_UNICODE_BIDI_SUPPORT + bool "Bidirectional character-aware line input" + default BUSYBOX_DEFAULT_UNICODE_BIDI_SUPPORT + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT && !BUSYBOX_CONFIG_UNICODE_USING_LOCALE + help + With this option on, right-to-left Unicode characters + are treated differently on input (e.g. cursor movement). + +config BUSYBOX_CONFIG_UNICODE_NEUTRAL_TABLE + bool "In bidi input, support non-ASCII neutral chars too" + default BUSYBOX_DEFAULT_UNICODE_NEUTRAL_TABLE + depends on BUSYBOX_CONFIG_UNICODE_BIDI_SUPPORT + help + In most cases it's enough to treat only ASCII non-letters + (i.e. punctuation, numbers and space) as characters + with neutral directionality. + With this option on, more extensive (and bigger) table + of neutral chars will be used. + +config BUSYBOX_CONFIG_UNICODE_PRESERVE_BROKEN + bool "Make it possible to enter sequences of chars which are not Unicode" + default BUSYBOX_DEFAULT_UNICODE_PRESERVE_BROKEN + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT + help + With this option on, on line-editing input (such as used by shells) + invalid UTF-8 bytes are not substituted with the selected + substitution character. + For example, this means that entering 'l', 's', ' ', 0xff, [Enter] + at shell prompt will list file named 0xff (single char name + with char value 255), not file named '?'. + config BUSYBOX_CONFIG_FEATURE_NON_POSIX_CP bool "Non-POSIX, but safer, copying to special nodes" default BUSYBOX_DEFAULT_FEATURE_NON_POSIX_CP @@ -215,6 +349,19 @@ config BUSYBOX_CONFIG_FEATURE_VERBOSE_CP_MESSAGE cp: cannot stat '/vmlinuz/file': Not a directory This will cost you ~60 bytes. +config BUSYBOX_CONFIG_FEATURE_USE_SENDFILE + bool "Use sendfile system call" + default BUSYBOX_DEFAULT_FEATURE_USE_SENDFILE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + When enabled, busybox will use the kernel sendfile() function + instead of read/write loops to copy data between file descriptors + (for example, cp command does this a lot). + If sendfile() doesn't work, copying code falls back to read/write + loop. sendfile() was originally implemented for faster I/O + from files to sockets, but since Linux 2.6.33 it was extended + to work for many more file types. + config BUSYBOX_CONFIG_FEATURE_COPYBUF_KB int "Copy buffer size, in kilobytes" range 1 1024 diff --git a/package/utils/busybox/config/loginutils/Config.in b/package/utils/busybox/config/loginutils/Config.in index 956115c7f..fa0059587 100644 --- a/package/utils/busybox/config/loginutils/Config.in +++ b/package/utils/busybox/config/loginutils/Config.in @@ -7,7 +7,7 @@ menu "Login/Password Management Utilities" config BUSYBOX_CONFIG_FEATURE_SHADOWPASSWDS - bool "Support for shadow passwords" + bool "Support shadow passwords" default BUSYBOX_DEFAULT_FEATURE_SHADOWPASSWDS help Build support for shadow password in /etc/shadow. This file is only @@ -113,15 +113,13 @@ config BUSYBOX_CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_ADDGROUP_LONG_OPTIONS depends on BUSYBOX_CONFIG_ADDGROUP && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the addgroup applet. config BUSYBOX_CONFIG_FEATURE_ADDUSER_TO_GROUP - bool "Support for adding users to groups" + bool "Support adding users to groups" default BUSYBOX_DEFAULT_FEATURE_ADDUSER_TO_GROUP depends on BUSYBOX_CONFIG_ADDGROUP help - If called with two non-option arguments, + If called with two non-option arguments, addgroup will add an existing user to an existing group. config BUSYBOX_CONFIG_ADDUSER @@ -134,8 +132,6 @@ config BUSYBOX_CONFIG_FEATURE_ADDUSER_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_ADDUSER_LONG_OPTIONS depends on BUSYBOX_CONFIG_ADDUSER && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the adduser applet. config BUSYBOX_CONFIG_FEATURE_CHECK_NAMES bool "Enable sanity check on user/group names in adduser and addgroup" @@ -179,9 +175,9 @@ config BUSYBOX_CONFIG_CHPASSWD and uses this information to update a group of existing users. config BUSYBOX_CONFIG_FEATURE_DEFAULT_PASSWD_ALGO - string "Default password encryption method (passwd -a, cryptpw -m parameter)" + string "Default encryption method (passwd -a, cryptpw -m, chpasswd -c ALG)" default BUSYBOX_DEFAULT_FEATURE_DEFAULT_PASSWD_ALGO - depends on BUSYBOX_CONFIG_PASSWD || BUSYBOX_CONFIG_CRYPTPW + depends on BUSYBOX_CONFIG_PASSWD || BUSYBOX_CONFIG_CRYPTPW || BUSYBOX_CONFIG_CHPASSWD help Possible choices are "d[es]", "m[d5]", "s[ha256]" or "sha512". config BUSYBOX_CONFIG_CRYPTPW @@ -211,7 +207,7 @@ config BUSYBOX_CONFIG_DELGROUP Utility for deleting a group account. config BUSYBOX_CONFIG_FEATURE_DEL_USER_FROM_GROUP - bool "Support for removing users from groups" + bool "Support removing users from groups" default BUSYBOX_DEFAULT_FEATURE_DEL_USER_FROM_GROUP depends on BUSYBOX_CONFIG_DELGROUP help @@ -257,7 +253,7 @@ config BUSYBOX_CONFIG_LOGIN_SESSION_AS_CHILD will not be cleaned up. config BUSYBOX_CONFIG_LOGIN_SCRIPTS - bool "Support for login scripts" + bool "Support login scripts" depends on BUSYBOX_CONFIG_LOGIN default BUSYBOX_DEFAULT_LOGIN_SCRIPTS help @@ -265,7 +261,7 @@ config BUSYBOX_CONFIG_LOGIN_SCRIPTS just prior to switching from root to logged-in user. config BUSYBOX_CONFIG_FEATURE_NOLOGIN - bool "Support for /etc/nologin" + bool "Support /etc/nologin" default BUSYBOX_DEFAULT_FEATURE_NOLOGIN depends on BUSYBOX_CONFIG_LOGIN help @@ -273,7 +269,7 @@ config BUSYBOX_CONFIG_FEATURE_NOLOGIN If it exists, non-root logins are prohibited. config BUSYBOX_CONFIG_FEATURE_SECURETTY - bool "Support for /etc/securetty" + bool "Support /etc/securetty" default BUSYBOX_DEFAULT_FEATURE_SECURETTY depends on BUSYBOX_CONFIG_LOGIN help @@ -306,19 +302,23 @@ config BUSYBOX_CONFIG_SU help su is used to become another user during a login session. Invoked without a username, su defaults to becoming the super user. - - Note that Busybox binary must be setuid root for this applet to + Note that busybox binary must be setuid root for this applet to work properly. config BUSYBOX_CONFIG_FEATURE_SU_SYSLOG - bool "Enable su to write to syslog" + bool "Log to syslog all attempts to use su" default BUSYBOX_DEFAULT_FEATURE_SU_SYSLOG depends on BUSYBOX_CONFIG_SU config BUSYBOX_CONFIG_FEATURE_SU_CHECKS_SHELLS - bool "Enable su to check user's shell to be listed in /etc/shells" - depends on BUSYBOX_CONFIG_SU + bool "If user's shell is not in /etc/shells, disallow -s PROG" default BUSYBOX_DEFAULT_FEATURE_SU_CHECKS_SHELLS + depends on BUSYBOX_CONFIG_SU + +config BUSYBOX_CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY + bool "Allow blank passwords only on TTYs in /etc/securetty" + default BUSYBOX_DEFAULT_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY + depends on BUSYBOX_CONFIG_SU config BUSYBOX_CONFIG_SULOGIN bool "sulogin" default BUSYBOX_DEFAULT_SULOGIN diff --git a/package/utils/busybox/config/mailutils/Config.in b/package/utils/busybox/config/mailutils/Config.in index 64b9a2baa..7e7740786 100644 --- a/package/utils/busybox/config/mailutils/Config.in +++ b/package/utils/busybox/config/mailutils/Config.in @@ -1,20 +1,11 @@ # DO NOT EDIT. This file is generated from Config.src menu "Mail Utilities" - config BUSYBOX_CONFIG_MAKEMIME bool "makemime" default BUSYBOX_DEFAULT_MAKEMIME help Create MIME-formatted messages. - -config BUSYBOX_CONFIG_FEATURE_MIME_CHARSET - string "Default charset" - default BUSYBOX_DEFAULT_FEATURE_MIME_CHARSET - depends on BUSYBOX_CONFIG_MAKEMIME || BUSYBOX_CONFIG_REFORMIME || BUSYBOX_CONFIG_SENDMAIL - help - Default charset of the message. - config BUSYBOX_CONFIG_POPMAILDIR bool "popmaildir" default BUSYBOX_DEFAULT_POPMAILDIR @@ -31,7 +22,6 @@ config BUSYBOX_CONFIG_FEATURE_POPMAILDIR_DELIVERY of the message before actual delivery (-F "prog [args...]"). Allow to use a custom program for message actual delivery (-M "prog [args...]"). - config BUSYBOX_CONFIG_REFORMIME bool "reformime" default BUSYBOX_DEFAULT_REFORMIME @@ -45,11 +35,17 @@ config BUSYBOX_CONFIG_FEATURE_REFORMIME_COMPAT help Accept (for compatibility only) and ignore options other than -x and -X. - config BUSYBOX_CONFIG_SENDMAIL bool "sendmail" default BUSYBOX_DEFAULT_SENDMAIL help Barebones sendmail. +config BUSYBOX_CONFIG_FEATURE_MIME_CHARSET + string "Default charset" + default BUSYBOX_DEFAULT_FEATURE_MIME_CHARSET + depends on BUSYBOX_CONFIG_MAKEMIME || BUSYBOX_CONFIG_REFORMIME || BUSYBOX_CONFIG_SENDMAIL + help + Default charset of the message. + endmenu diff --git a/package/utils/busybox/config/miscutils/Config.in b/package/utils/busybox/config/miscutils/Config.in index 3465df40a..61c5458b6 100644 --- a/package/utils/busybox/config/miscutils/Config.in +++ b/package/utils/busybox/config/miscutils/Config.in @@ -6,259 +6,6 @@ menu "Miscellaneous Utilities" -config BUSYBOX_CONFIG_CONSPY - bool "conspy" - default BUSYBOX_DEFAULT_CONSPY - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - A text-mode VNC like program for Linux virtual terminals. - example: conspy NUM shared access to console num - or conspy -nd NUM screenshot of console num - or conspy -cs NUM poor man's GNU screen like -config BUSYBOX_CONFIG_CROND - bool "crond" - default BUSYBOX_DEFAULT_CROND - select BUSYBOX_CONFIG_FEATURE_SYSLOG - help - Crond is a background daemon that parses individual crontab - files and executes commands on behalf of the users in question. - This is a port of dcron from slackware. It uses files of the - format /var/spool/cron/crontabs/ files, for example: - $ cat /var/spool/cron/crontabs/root - # Run daily cron jobs at 4:40 every day: - 40 4 * * * /etc/cron/daily > /dev/null 2>&1 - -config BUSYBOX_CONFIG_FEATURE_CROND_D - bool "Support option -d to redirect output to stderr" - depends on BUSYBOX_CONFIG_CROND - default BUSYBOX_DEFAULT_FEATURE_CROND_D - help - -d N sets loglevel (0:most verbose) and directs all output to stderr. - -config BUSYBOX_CONFIG_FEATURE_CROND_CALL_SENDMAIL - bool "Report command output via email (using sendmail)" - default BUSYBOX_DEFAULT_FEATURE_CROND_CALL_SENDMAIL - depends on BUSYBOX_CONFIG_CROND - help - Command output will be sent to corresponding user via email. - -config BUSYBOX_CONFIG_FEATURE_CROND_DIR - string "crond spool directory" - default BUSYBOX_DEFAULT_FEATURE_CROND_DIR - depends on BUSYBOX_CONFIG_CROND || BUSYBOX_CONFIG_CRONTAB - help - Location of crond spool. -config BUSYBOX_CONFIG_I2CGET - bool "i2cget" - default BUSYBOX_DEFAULT_I2CGET - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Read from I2C/SMBus chip registers. - -config BUSYBOX_CONFIG_I2CSET - bool "i2cset" - default BUSYBOX_DEFAULT_I2CSET - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Set I2C registers. - -config BUSYBOX_CONFIG_I2CDUMP - bool "i2cdump" - default BUSYBOX_DEFAULT_I2CDUMP - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Examine I2C registers. - -config BUSYBOX_CONFIG_I2CDETECT - bool "i2cdetect" - default BUSYBOX_DEFAULT_I2CDETECT - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Detect I2C chips. - -config BUSYBOX_CONFIG_LESS - bool "less" - default BUSYBOX_DEFAULT_LESS - help - 'less' is a pager, meaning that it displays text files. It possesses - a wide array of features, and is an improvement over 'more'. - -config BUSYBOX_CONFIG_FEATURE_LESS_MAXLINES - int "Max number of input lines less will try to eat" - default BUSYBOX_DEFAULT_FEATURE_LESS_MAXLINES - depends on BUSYBOX_CONFIG_LESS - -config BUSYBOX_CONFIG_FEATURE_LESS_BRACKETS - bool "Enable bracket searching" - default BUSYBOX_DEFAULT_FEATURE_LESS_BRACKETS - depends on BUSYBOX_CONFIG_LESS - help - This option adds the capability to search for matching left and right - brackets, facilitating programming. - -config BUSYBOX_CONFIG_FEATURE_LESS_FLAGS - bool "Enable -m/-M" - default BUSYBOX_DEFAULT_FEATURE_LESS_FLAGS - depends on BUSYBOX_CONFIG_LESS - help - The -M/-m flag enables a more sophisticated status line. - -config BUSYBOX_CONFIG_FEATURE_LESS_TRUNCATE - bool "Enable -S" - default BUSYBOX_DEFAULT_FEATURE_LESS_TRUNCATE - depends on BUSYBOX_CONFIG_LESS - help - The -S flag causes long lines to be truncated rather than - wrapped. - -config BUSYBOX_CONFIG_FEATURE_LESS_MARKS - bool "Enable marks" - default BUSYBOX_DEFAULT_FEATURE_LESS_MARKS - depends on BUSYBOX_CONFIG_LESS - help - Marks enable positions in a file to be stored for easy reference. - -config BUSYBOX_CONFIG_FEATURE_LESS_REGEXP - bool "Enable regular expressions" - default BUSYBOX_DEFAULT_FEATURE_LESS_REGEXP - depends on BUSYBOX_CONFIG_LESS - help - Enable regular expressions, allowing complex file searches. - -config BUSYBOX_CONFIG_FEATURE_LESS_WINCH - bool "Enable automatic resizing on window size changes" - default BUSYBOX_DEFAULT_FEATURE_LESS_WINCH - depends on BUSYBOX_CONFIG_LESS - help - Makes less track window size changes. - -config BUSYBOX_CONFIG_FEATURE_LESS_ASK_TERMINAL - bool "Use 'tell me cursor position' ESC sequence to measure window" - default BUSYBOX_DEFAULT_FEATURE_LESS_ASK_TERMINAL - depends on BUSYBOX_CONFIG_FEATURE_LESS_WINCH - help - Makes less track window size changes. - If terminal size can't be retrieved and $LINES/$COLUMNS are not set, - this option makes less perform a last-ditch effort to find it: - position cursor to 999,999 and ask terminal to report real - cursor position using "ESC [ 6 n" escape sequence, then read stdin. - - This is not clean but helps a lot on serial lines and such. - -config BUSYBOX_CONFIG_FEATURE_LESS_DASHCMD - bool "Enable flag changes ('-' command)" - default BUSYBOX_DEFAULT_FEATURE_LESS_DASHCMD - depends on BUSYBOX_CONFIG_LESS - help - This enables the ability to change command-line flags within - less itself ('-' keyboard command). - -config BUSYBOX_CONFIG_FEATURE_LESS_LINENUMS - bool "Enable dynamic switching of line numbers" - default BUSYBOX_DEFAULT_FEATURE_LESS_LINENUMS - depends on BUSYBOX_CONFIG_FEATURE_LESS_DASHCMD - help - Enables "-N" command. -config BUSYBOX_CONFIG_NANDWRITE - bool "nandwrite" - default BUSYBOX_DEFAULT_NANDWRITE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Write to the specified MTD device, with bad blocks awareness - -config BUSYBOX_CONFIG_NANDDUMP - bool "nanddump" - default BUSYBOX_DEFAULT_NANDDUMP - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Dump the content of raw NAND chip -config BUSYBOX_CONFIG_RFKILL - bool "rfkill" - default BUSYBOX_DEFAULT_RFKILL # doesn't build on Ubuntu 9.04 - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Enable/disable wireless devices. - - rfkill list : list all wireless devices - rfkill list bluetooth : list all bluetooth devices - rfkill list 1 : list device corresponding to the given index - rfkill block|unblock wlan : block/unblock all wlan(wifi) devices - -config BUSYBOX_CONFIG_SETSERIAL - bool "setserial" - default BUSYBOX_DEFAULT_SETSERIAL - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Retrieve or set Linux serial port. -config BUSYBOX_CONFIG_TASKSET - bool "taskset" - default BUSYBOX_DEFAULT_TASKSET # doesn't build on some non-x86 targets (m68k) - help - Retrieve or set a processes's CPU affinity. - This requires sched_{g,s}etaffinity support in your libc. - -config BUSYBOX_CONFIG_FEATURE_TASKSET_FANCY - bool "Fancy output" - default BUSYBOX_DEFAULT_FEATURE_TASKSET_FANCY - depends on BUSYBOX_CONFIG_TASKSET - help - Add code for fancy output. This merely silences a compiler-warning - and adds about 135 Bytes. May be needed for machines with alot - of CPUs. -config BUSYBOX_CONFIG_UBIATTACH - bool "ubiattach" - default BUSYBOX_DEFAULT_UBIATTACH - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Attach MTD device to an UBI device. - -config BUSYBOX_CONFIG_UBIDETACH - bool "ubidetach" - default BUSYBOX_DEFAULT_UBIDETACH - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Detach MTD device from an UBI device. - -config BUSYBOX_CONFIG_UBIMKVOL - bool "ubimkvol" - default BUSYBOX_DEFAULT_UBIMKVOL - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Create a UBI volume. - -config BUSYBOX_CONFIG_UBIRMVOL - bool "ubirmvol" - default BUSYBOX_DEFAULT_UBIRMVOL - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Delete a UBI volume. - -config BUSYBOX_CONFIG_UBIRSVOL - bool "ubirsvol" - default BUSYBOX_DEFAULT_UBIRSVOL - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Resize a UBI volume. - -config BUSYBOX_CONFIG_UBIUPDATEVOL - bool "ubiupdatevol" - default BUSYBOX_DEFAULT_UBIUPDATEVOL - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Update a UBI volume. -config BUSYBOX_CONFIG_UBIRENAME - bool "ubirename" - default BUSYBOX_DEFAULT_UBIRENAME - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Utility to rename UBI volumes -config BUSYBOX_CONFIG_WALL - bool "wall" - default BUSYBOX_DEFAULT_WALL - depends on BUSYBOX_CONFIG_FEATURE_UTMP - help - Write a message to all users that are logged in. - config BUSYBOX_CONFIG_ADJTIMEX bool "adjtimex" default BUSYBOX_DEFAULT_ADJTIMEX @@ -266,7 +13,6 @@ config BUSYBOX_CONFIG_ADJTIMEX help Adjtimex reads and optionally sets adjustment parameters for the Linux clock adjustment algorithm. - config BUSYBOX_CONFIG_BBCONFIG bool "bbconfig" default BUSYBOX_DEFAULT_BBCONFIG @@ -287,7 +33,6 @@ config BUSYBOX_CONFIG_FEATURE_COMPRESS_BBCONFIG be noticeable. Also, if you run executables directly from ROM and have very little memory, this might not be a win. Otherwise, you probably want this. - config BUSYBOX_CONFIG_BEEP bool "beep" default BUSYBOX_DEFAULT_BEEP @@ -297,7 +42,7 @@ config BUSYBOX_CONFIG_BEEP config BUSYBOX_CONFIG_FEATURE_BEEP_FREQ int "default frequency" - range 0 2147483647 + range 20 50000 # allowing 0 here breaks the build default BUSYBOX_DEFAULT_FEATURE_BEEP_FREQ depends on BUSYBOX_CONFIG_BEEP help @@ -310,7 +55,6 @@ config BUSYBOX_CONFIG_FEATURE_BEEP_LENGTH_MS depends on BUSYBOX_CONFIG_BEEP help Length in ms for default beep. - config BUSYBOX_CONFIG_CHAT bool "chat" default BUSYBOX_DEFAULT_CHAT @@ -377,14 +121,48 @@ config BUSYBOX_CONFIG_FEATURE_CHAT_CLR_ABORT default BUSYBOX_DEFAULT_FEATURE_CHAT_CLR_ABORT help Support CLR_ABORT directive. - -config BUSYBOX_CONFIG_CHRT - bool "chrt" - default BUSYBOX_DEFAULT_CHRT +config BUSYBOX_CONFIG_CONSPY + bool "conspy" + default BUSYBOX_DEFAULT_CONSPY + select BUSYBOX_CONFIG_PLATFORM_LINUX help - manipulate real-time attributes of a process. - This requires sched_{g,s}etparam support in your libc. + A text-mode VNC like program for Linux virtual terminals. + example: conspy NUM shared access to console num + or conspy -nd NUM screenshot of console num + or conspy -cs NUM poor man's GNU screen like +config BUSYBOX_CONFIG_CROND + bool "crond" + default BUSYBOX_DEFAULT_CROND + select BUSYBOX_CONFIG_FEATURE_SYSLOG + help + Crond is a background daemon that parses individual crontab + files and executes commands on behalf of the users in question. + This is a port of dcron from slackware. It uses files of the + format /var/spool/cron/crontabs/ files, for example: + $ cat /var/spool/cron/crontabs/root + # Run daily cron jobs at 4:40 every day: + 40 4 * * * /etc/cron/daily > /dev/null 2>&1 +config BUSYBOX_CONFIG_FEATURE_CROND_D + bool "Support option -d to redirect output to stderr" + depends on BUSYBOX_CONFIG_CROND + default BUSYBOX_DEFAULT_FEATURE_CROND_D + help + -d N sets loglevel (0:most verbose) and directs all output to stderr. + +config BUSYBOX_CONFIG_FEATURE_CROND_CALL_SENDMAIL + bool "Report command output via email (using sendmail)" + default BUSYBOX_DEFAULT_FEATURE_CROND_CALL_SENDMAIL + depends on BUSYBOX_CONFIG_CROND + help + Command output will be sent to corresponding user via email. + +config BUSYBOX_CONFIG_FEATURE_CROND_DIR + string "crond spool directory" + default BUSYBOX_DEFAULT_FEATURE_CROND_DIR + depends on BUSYBOX_CONFIG_CROND || BUSYBOX_CONFIG_CRONTAB + help + Location of crond spool. config BUSYBOX_CONFIG_CRONTAB bool "crontab" default BUSYBOX_DEFAULT_CRONTAB @@ -393,7 +171,6 @@ config BUSYBOX_CONFIG_CRONTAB the superuser may specify a different user and/or crontab directory. Note that Busybox binary must be setuid root for this applet to work properly. - config BUSYBOX_CONFIG_DC bool "dc" default BUSYBOX_DEFAULT_DC @@ -408,7 +185,6 @@ config BUSYBOX_CONFIG_FEATURE_DC_LIBM help Enable power and exp functions. NOTE: This will require libm to be present for linking. - config BUSYBOX_CONFIG_DEVFSD bool "devfsd (obsolete)" default BUSYBOX_DEFAULT_DEVFSD @@ -438,7 +214,7 @@ config BUSYBOX_CONFIG_DEVFSD_MODLOAD the external modutils. config BUSYBOX_CONFIG_DEVFSD_FG_NP - bool "Enables the -fg and -np options" + bool "Enable the -fg and -np options" default BUSYBOX_DEFAULT_DEVFSD_FG_NP depends on BUSYBOX_CONFIG_DEVFSD help @@ -465,29 +241,12 @@ config BUSYBOX_CONFIG_FEATURE_DEVFS tells busybox to look for names like /dev/loop/0 instead of /dev/loop0. If your /dev directory has normal names instead of devfs names, you don't want this. - config BUSYBOX_CONFIG_DEVMEM bool "devmem" default BUSYBOX_DEFAULT_DEVMEM help devmem is a small program that reads and writes from physical memory using /dev/mem. - -config BUSYBOX_CONFIG_EJECT - bool "eject" - default BUSYBOX_DEFAULT_EJECT - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Used to eject cdroms. (defaults to /dev/cdrom) - -config BUSYBOX_CONFIG_FEATURE_EJECT_SCSI - bool "SCSI support" - default BUSYBOX_DEFAULT_FEATURE_EJECT_SCSI - depends on BUSYBOX_CONFIG_EJECT - help - Add the -s option to eject, this allows to eject SCSI-Devices and - usb-storage devices. - config BUSYBOX_CONFIG_FBSPLASH bool "fbsplash" default BUSYBOX_DEFAULT_FBSPLASH @@ -509,14 +268,12 @@ config BUSYBOX_CONFIG_FBSPLASH - commands for fifo: "NN" (ASCII decimal number) - percentage to show on progress bar "exit" - well you guessed it - -config BUSYBOX_CONFIG_FLASHCP - bool "flashcp" - default BUSYBOX_DEFAULT_FLASHCP # doesn't build on Ubuntu 8.04 +config BUSYBOX_CONFIG_FLASH_ERASEALL + bool "flash_eraseall" + default BUSYBOX_DEFAULT_FLASH_ERASEALL # doesn't build on Ubuntu 8.04 help - The flashcp binary, inspired by mtd-utils as of git head 5eceb74f7. - This utility is used to copy images into a MTD device. - + The flash_eraseall binary from mtd-utils as of git head c4c6a59eb. + This utility is used to erase the whole MTD device. config BUSYBOX_CONFIG_FLASH_LOCK bool "flash_lock" default BUSYBOX_DEFAULT_FLASH_LOCK # doesn't build on Ubuntu 8.04 @@ -530,44 +287,12 @@ config BUSYBOX_CONFIG_FLASH_UNLOCK help The flash_unlock binary from mtd-utils as of git head 5ec0c10d0. This utility unlocks part or all of the flash device. - -config BUSYBOX_CONFIG_FLASH_ERASEALL - bool "flash_eraseall" - default BUSYBOX_DEFAULT_FLASH_ERASEALL # doesn't build on Ubuntu 8.04 +config BUSYBOX_CONFIG_FLASHCP + bool "flashcp" + default BUSYBOX_DEFAULT_FLASHCP # doesn't build on Ubuntu 8.04 help - The flash_eraseall binary from mtd-utils as of git head c4c6a59eb. - This utility is used to erase the whole MTD device. - -config BUSYBOX_CONFIG_IONICE - bool "ionice" - default BUSYBOX_DEFAULT_IONICE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Set/set program io scheduling class and priority - Requires kernel >= 2.6.13 - -config BUSYBOX_CONFIG_INOTIFYD - bool "inotifyd" - default BUSYBOX_DEFAULT_INOTIFYD # doesn't build on Knoppix 5 - help - Simple inotify daemon. Reports filesystem changes. Requires - kernel >= 2.6.13 - -config BUSYBOX_CONFIG_LAST - bool "last" - default BUSYBOX_DEFAULT_LAST - depends on BUSYBOX_CONFIG_FEATURE_WTMP - help - 'last' displays a list of the last users that logged into the system. - -config BUSYBOX_CONFIG_FEATURE_LAST_FANCY - bool "Turn on output of extra information" - default BUSYBOX_DEFAULT_FEATURE_LAST_FANCY - depends on BUSYBOX_CONFIG_LAST - help - 'last' displays detailed information about the last users that - logged into the system (mimics sysvinit last). +900 bytes. - + The flashcp binary, inspired by mtd-utils as of git head 5eceb74f7. + This utility is used to copy images into a MTD device. config BUSYBOX_CONFIG_HDPARM bool "hdparm" default BUSYBOX_DEFAULT_HDPARM @@ -582,7 +307,7 @@ config BUSYBOX_CONFIG_FEATURE_HDPARM_GET_IDENTITY default BUSYBOX_DEFAULT_FEATURE_HDPARM_GET_IDENTITY depends on BUSYBOX_CONFIG_HDPARM help - Enables the -I and -i options to obtain detailed information + Enable the -I and -i options to obtain detailed information directly from drives about their capabilities and supported ATA feature set. If no device name is specified, hdparm will read identify data from stdin. Enabling this option will add about 16k... @@ -592,7 +317,7 @@ config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF default BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_SCAN_HWIF depends on BUSYBOX_CONFIG_HDPARM help - Enables the 'hdparm -R' option to register an IDE interface. + Enable the 'hdparm -R' option to register an IDE interface. This is dangerous stuff, so you should probably say N. config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF @@ -600,7 +325,7 @@ config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF default BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF depends on BUSYBOX_CONFIG_HDPARM help - Enables the 'hdparm -U' option to un-register an IDE interface. + Enable the 'hdparm -U' option to un-register an IDE interface. This is dangerous stuff, so you should probably say N. config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET @@ -608,7 +333,7 @@ config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET default BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_DRIVE_RESET depends on BUSYBOX_CONFIG_HDPARM help - Enables the 'hdparm -w' option to perform a device reset. + Enable the 'hdparm -w' option to perform a device reset. This is dangerous stuff, so you should probably say N. config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF @@ -616,7 +341,7 @@ config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF default BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_TRISTATE_HWIF depends on BUSYBOX_CONFIG_HDPARM help - Enables the 'hdparm -x' option to tristate device for hotswap, + Enable the 'hdparm -x' option to tristate device for hotswap, and the '-b' option to get/set bus state. This is dangerous stuff, so you should probably say N. @@ -625,14 +350,135 @@ config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA default BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_GETSET_DMA depends on BUSYBOX_CONFIG_HDPARM help - Enables the 'hdparm -d' option to get/set using_dma flag. + Enable the 'hdparm -d' option to get/set using_dma flag. +config BUSYBOX_CONFIG_I2CGET + bool "i2cget" + default BUSYBOX_DEFAULT_I2CGET + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Read from I2C/SMBus chip registers. +config BUSYBOX_CONFIG_I2CSET + bool "i2cset" + default BUSYBOX_DEFAULT_I2CSET + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Set I2C registers. + +config BUSYBOX_CONFIG_I2CDUMP + bool "i2cdump" + default BUSYBOX_DEFAULT_I2CDUMP + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Examine I2C registers. + +config BUSYBOX_CONFIG_I2CDETECT + bool "i2cdetect" + default BUSYBOX_DEFAULT_I2CDETECT + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Detect I2C chips. + +config BUSYBOX_CONFIG_INOTIFYD + bool "inotifyd" + default BUSYBOX_DEFAULT_INOTIFYD # doesn't build on Knoppix 5 + help + Simple inotify daemon. Reports filesystem changes. Requires + kernel >= 2.6.13 +config BUSYBOX_CONFIG_LESS + bool "less" + default BUSYBOX_DEFAULT_LESS + help + 'less' is a pager, meaning that it displays text files. It possesses + a wide array of features, and is an improvement over 'more'. + +config BUSYBOX_CONFIG_FEATURE_LESS_MAXLINES + int "Max number of input lines less will try to eat" + default BUSYBOX_DEFAULT_FEATURE_LESS_MAXLINES + depends on BUSYBOX_CONFIG_LESS + +config BUSYBOX_CONFIG_FEATURE_LESS_BRACKETS + bool "Enable bracket searching" + default BUSYBOX_DEFAULT_FEATURE_LESS_BRACKETS + depends on BUSYBOX_CONFIG_LESS + help + This option adds the capability to search for matching left and right + brackets, facilitating programming. + +config BUSYBOX_CONFIG_FEATURE_LESS_FLAGS + bool "Enable -m/-M" + default BUSYBOX_DEFAULT_FEATURE_LESS_FLAGS + depends on BUSYBOX_CONFIG_LESS + help + The -M/-m flag enables a more sophisticated status line. + +config BUSYBOX_CONFIG_FEATURE_LESS_TRUNCATE + bool "Enable -S" + default BUSYBOX_DEFAULT_FEATURE_LESS_TRUNCATE + depends on BUSYBOX_CONFIG_LESS + help + The -S flag causes long lines to be truncated rather than + wrapped. + +config BUSYBOX_CONFIG_FEATURE_LESS_MARKS + bool "Enable marks" + default BUSYBOX_DEFAULT_FEATURE_LESS_MARKS + depends on BUSYBOX_CONFIG_LESS + help + Marks enable positions in a file to be stored for easy reference. + +config BUSYBOX_CONFIG_FEATURE_LESS_REGEXP + bool "Enable regular expressions" + default BUSYBOX_DEFAULT_FEATURE_LESS_REGEXP + depends on BUSYBOX_CONFIG_LESS + help + Enable regular expressions, allowing complex file searches. + +config BUSYBOX_CONFIG_FEATURE_LESS_WINCH + bool "Enable automatic resizing on window size changes" + default BUSYBOX_DEFAULT_FEATURE_LESS_WINCH + depends on BUSYBOX_CONFIG_LESS + help + Makes less track window size changes. + +config BUSYBOX_CONFIG_FEATURE_LESS_ASK_TERMINAL + bool "Use 'tell me cursor position' ESC sequence to measure window" + default BUSYBOX_DEFAULT_FEATURE_LESS_ASK_TERMINAL + depends on BUSYBOX_CONFIG_FEATURE_LESS_WINCH + help + Makes less track window size changes. + If terminal size can't be retrieved and $LINES/$COLUMNS are not set, + this option makes less perform a last-ditch effort to find it: + position cursor to 999,999 and ask terminal to report real + cursor position using "ESC [ 6 n" escape sequence, then read stdin. + This is not clean but helps a lot on serial lines and such. + +config BUSYBOX_CONFIG_FEATURE_LESS_DASHCMD + bool "Enable flag changes ('-' command)" + default BUSYBOX_DEFAULT_FEATURE_LESS_DASHCMD + depends on BUSYBOX_CONFIG_LESS + help + This enables the ability to change command-line flags within + less itself ('-' keyboard command). + +config BUSYBOX_CONFIG_FEATURE_LESS_LINENUMS + bool "Enable -N (dynamic switching of line numbers)" + default BUSYBOX_DEFAULT_FEATURE_LESS_LINENUMS + depends on BUSYBOX_CONFIG_FEATURE_LESS_DASHCMD config BUSYBOX_CONFIG_LOCK bool "lock" default BUSYBOX_DEFAULT_LOCK help Small utility for using locks in scripts +config BUSYBOX_CONFIG_LSSCSI + bool "lsscsi" + default BUSYBOX_DEFAULT_LSSCSI + #select PLATFORM_LINUX + help + lsscsi is a utility for displaying information about SCSI buses in the + system and devices connected to them. + This version uses sysfs (/sys/bus/scsi/devices) only. config BUSYBOX_CONFIG_MAKEDEVS bool "makedevs" default BUSYBOX_DEFAULT_MAKEDEVS @@ -664,25 +510,16 @@ config BUSYBOX_CONFIG_FEATURE_MAKEDEVS_TABLE bool "table" endchoice - config BUSYBOX_CONFIG_MAN bool "man" default BUSYBOX_DEFAULT_MAN help Format and display manual pages. - config BUSYBOX_CONFIG_MICROCOM bool "microcom" default BUSYBOX_DEFAULT_MICROCOM help The poor man's minicom utility for chatting with serial port devices. - -config BUSYBOX_CONFIG_MOUNTPOINT - bool "mountpoint" - default BUSYBOX_DEFAULT_MOUNTPOINT - help - mountpoint checks if the directory is a mountpoint. - config BUSYBOX_CONFIG_MT bool "mt" default BUSYBOX_DEFAULT_MT @@ -690,7 +527,25 @@ config BUSYBOX_CONFIG_MT mt is used to control tape devices. You can use the mt utility to advance or rewind a tape past a specified number of archive files on the tape. +config BUSYBOX_CONFIG_NANDWRITE + bool "nandwrite" + default BUSYBOX_DEFAULT_NANDWRITE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Write to the specified MTD device, with bad blocks awareness +config BUSYBOX_CONFIG_NANDDUMP + bool "nanddump" + default BUSYBOX_DEFAULT_NANDDUMP + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Dump the content of raw NAND chip +config BUSYBOX_CONFIG_PARTPROBE + bool "partprobe" + default BUSYBOX_DEFAULT_PARTPROBE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Ask kernel to rescan partition table. config BUSYBOX_CONFIG_RAIDAUTORUN bool "raidautorun" default BUSYBOX_DEFAULT_RAIDAUTORUN @@ -698,7 +553,6 @@ config BUSYBOX_CONFIG_RAIDAUTORUN help raidautorun tells the kernel md driver to search and start RAID arrays. - config BUSYBOX_CONFIG_READAHEAD bool "readahead" default BUSYBOX_DEFAULT_READAHEAD @@ -716,6 +570,17 @@ config BUSYBOX_CONFIG_READAHEAD As readahead(2) blocks until each file has been read, it is best to run this applet as a background job. +config BUSYBOX_CONFIG_RFKILL + bool "rfkill" + default BUSYBOX_DEFAULT_RFKILL # doesn't build on Ubuntu 9.04 + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Enable/disable wireless devices. + + rfkill list : list all wireless devices + rfkill list bluetooth : list all bluetooth devices + rfkill list 1 : list device corresponding to the given index + rfkill block|unblock wlan : block/unblock all wlan(wifi) devices config BUSYBOX_CONFIG_RUNLEVEL bool "runlevel" @@ -726,27 +591,24 @@ config BUSYBOX_CONFIG_RUNLEVEL This applet uses utmp but does not rely on busybox supporing utmp on purpose. It is used by e.g. emdebian via /etc/init.d/rc. - config BUSYBOX_CONFIG_RX bool "rx" default BUSYBOX_DEFAULT_RX select BUSYBOX_CONFIG_PLATFORM_LINUX help Receive files using the Xmodem protocol. - -config BUSYBOX_CONFIG_SETSID - bool "setsid" - default BUSYBOX_DEFAULT_SETSID +config BUSYBOX_CONFIG_SETSERIAL + bool "setserial" + default BUSYBOX_DEFAULT_SETSERIAL + select BUSYBOX_CONFIG_PLATFORM_LINUX help - setsid runs a program in a new session - + Retrieve or set Linux serial port. config BUSYBOX_CONFIG_STRINGS bool "strings" default BUSYBOX_DEFAULT_STRINGS help strings prints the printable character sequences for each file specified. - config BUSYBOX_CONFIG_TIME bool "time" default BUSYBOX_DEFAULT_TIME @@ -754,14 +616,6 @@ config BUSYBOX_CONFIG_TIME The time command runs the specified program with the given arguments. When the command finishes, time writes a message to standard output giving timing statistics about this program run. - -config BUSYBOX_CONFIG_TIMEOUT - bool "timeout" - default BUSYBOX_DEFAULT_TIMEOUT - help - Runs a program and watches it. If it does not terminate in - specified number of seconds, it is sent a signal. - config BUSYBOX_CONFIG_TTYSIZE bool "ttysize" default BUSYBOX_DEFAULT_TTYSIZE @@ -770,13 +624,58 @@ config BUSYBOX_CONFIG_TTYSIZE only height, or both, in any order. It also does not complain on error, but returns default 80x24. Usage in shell scripts: width=`ttysize w`. +config BUSYBOX_CONFIG_UBIATTACH + bool "ubiattach" + default BUSYBOX_DEFAULT_UBIATTACH + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Attach MTD device to an UBI device. +config BUSYBOX_CONFIG_UBIDETACH + bool "ubidetach" + default BUSYBOX_DEFAULT_UBIDETACH + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Detach MTD device from an UBI device. + +config BUSYBOX_CONFIG_UBIMKVOL + bool "ubimkvol" + default BUSYBOX_DEFAULT_UBIMKVOL + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Create a UBI volume. + +config BUSYBOX_CONFIG_UBIRMVOL + bool "ubirmvol" + default BUSYBOX_DEFAULT_UBIRMVOL + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Delete a UBI volume. + +config BUSYBOX_CONFIG_UBIRSVOL + bool "ubirsvol" + default BUSYBOX_DEFAULT_UBIRSVOL + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Resize a UBI volume. + +config BUSYBOX_CONFIG_UBIUPDATEVOL + bool "ubiupdatevol" + default BUSYBOX_DEFAULT_UBIUPDATEVOL + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Update a UBI volume. +config BUSYBOX_CONFIG_UBIRENAME + bool "ubirename" + default BUSYBOX_DEFAULT_UBIRENAME + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Utility to rename UBI volumes config BUSYBOX_CONFIG_VOLNAME bool "volname" default BUSYBOX_DEFAULT_VOLNAME help Prints a CD-ROM volume name. - config BUSYBOX_CONFIG_WATCHDOG bool "watchdog" default BUSYBOX_DEFAULT_WATCHDOG diff --git a/package/utils/busybox/config/modutils/Config.in b/package/utils/busybox/config/modutils/Config.in index 8e0e2af9e..9791af65a 100644 --- a/package/utils/busybox/config/modutils/Config.in +++ b/package/utils/busybox/config/modutils/Config.in @@ -6,19 +6,14 @@ menu "Linux Module Utilities" -config BUSYBOX_CONFIG_MODINFO - bool "modinfo" - default BUSYBOX_DEFAULT_MODINFO - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Show information about a Linux Kernel module - config BUSYBOX_CONFIG_MODPROBE_SMALL bool "Simplified modutils" default BUSYBOX_DEFAULT_MODPROBE_SMALL - select BUSYBOX_CONFIG_PLATFORM_LINUX help - Simplified modutils. + Build smaller (~1.5 kbytes), simplified module tools. + + This option by itself does not enable any applets - + you need to select applets individually below. With this option modprobe does not require modules.dep file and does not use /etc/modules.conf file. @@ -39,46 +34,23 @@ config BUSYBOX_CONFIG_MODPROBE_SMALL Additional module parameters can be stored in /etc/modules/$module_name files. - Apart from modprobe, other utilities are also provided: - - insmod is an alias to modprobe - - rmmod is an alias to modprobe -r - - depmod generates modules.dep.bb - -config BUSYBOX_CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE - bool "Accept module options on modprobe command line" - default BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE - depends on BUSYBOX_CONFIG_MODPROBE_SMALL +config BUSYBOX_CONFIG_DEPMOD + bool "depmod" + default BUSYBOX_DEFAULT_DEPMOD select BUSYBOX_CONFIG_PLATFORM_LINUX help - Allow insmod and modprobe take module options from command line. - -config BUSYBOX_CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED - bool "Skip loading of already loaded modules" - default BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED - depends on BUSYBOX_CONFIG_MODPROBE_SMALL - help - Check if the module is already loaded. - + depmod generates modules.dep (and potentially modules.alias + and modules.symbols) that contain dependency information + for modprobe. config BUSYBOX_CONFIG_INSMOD bool "insmod" default BUSYBOX_DEFAULT_INSMOD - depends on !BUSYBOX_CONFIG_MODPROBE_SMALL select BUSYBOX_CONFIG_PLATFORM_LINUX help insmod is used to load specified modules in the running kernel. - -config BUSYBOX_CONFIG_RMMOD - bool "rmmod" - default BUSYBOX_DEFAULT_RMMOD - depends on !BUSYBOX_CONFIG_MODPROBE_SMALL - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - rmmod is used to unload specified modules from the kernel. - config BUSYBOX_CONFIG_LSMOD bool "lsmod" default BUSYBOX_DEFAULT_LSMOD - depends on !BUSYBOX_CONFIG_MODPROBE_SMALL select BUSYBOX_CONFIG_PLATFORM_LINUX help lsmod is used to display a list of loaded modules. @@ -86,17 +58,20 @@ config BUSYBOX_CONFIG_LSMOD config BUSYBOX_CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT bool "Pretty output" default BUSYBOX_DEFAULT_FEATURE_LSMOD_PRETTY_2_6_OUTPUT - depends on BUSYBOX_CONFIG_LSMOD - select BUSYBOX_CONFIG_PLATFORM_LINUX + depends on BUSYBOX_CONFIG_LSMOD && !BUSYBOX_CONFIG_MODPROBE_SMALL help This option makes output format of lsmod adjusted to the format of module-init-tools for Linux kernel 2.6. Increases size somewhat. - +config BUSYBOX_CONFIG_MODINFO + bool "modinfo" + default BUSYBOX_DEFAULT_MODINFO + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Show information about a Linux Kernel module config BUSYBOX_CONFIG_MODPROBE bool "modprobe" default BUSYBOX_DEFAULT_MODPROBE - depends on !BUSYBOX_CONFIG_MODPROBE_SMALL select BUSYBOX_CONFIG_PLATFORM_LINUX help Handle the loading of modules, and their dependencies on a high @@ -105,42 +80,109 @@ config BUSYBOX_CONFIG_MODPROBE config BUSYBOX_CONFIG_FEATURE_MODPROBE_BLACKLIST bool "Blacklist support" default BUSYBOX_DEFAULT_FEATURE_MODPROBE_BLACKLIST - depends on BUSYBOX_CONFIG_MODPROBE - select BUSYBOX_CONFIG_PLATFORM_LINUX + depends on BUSYBOX_CONFIG_MODPROBE && !BUSYBOX_CONFIG_MODPROBE_SMALL help Say 'y' here to enable support for the 'blacklist' command in modprobe.conf. This prevents the alias resolver to resolve blacklisted modules. This is useful if you want to prevent your hardware autodetection scripts to load modules like evdev, frame buffer drivers etc. - -config BUSYBOX_CONFIG_DEPMOD - bool "depmod" - default BUSYBOX_DEFAULT_DEPMOD - depends on !BUSYBOX_CONFIG_MODPROBE_SMALL +config BUSYBOX_CONFIG_RMMOD + bool "rmmod" + default BUSYBOX_DEFAULT_RMMOD select BUSYBOX_CONFIG_PLATFORM_LINUX help - depmod generates modules.dep (and potentially modules.alias - and modules.symbols) that contain dependency information - for modprobe. + rmmod is used to unload specified modules from the kernel. comment "Options common to multiple modutils" +config BUSYBOX_CONFIG_FEATURE_CMDLINE_MODULE_OPTIONS + bool "Accept module options on modprobe command line" + default BUSYBOX_DEFAULT_FEATURE_CMDLINE_MODULE_OPTIONS + depends on BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE + help + Allow insmod and modprobe take module options from the applets' + command line. + +config BUSYBOX_CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED + bool "Skip loading of already loaded modules" + default BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED + depends on BUSYBOX_CONFIG_MODPROBE_SMALL && (BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) + help + Check if the module is already loaded. + config BUSYBOX_CONFIG_FEATURE_2_4_MODULES bool "Support version 2.2/2.4 Linux kernels" default BUSYBOX_DEFAULT_FEATURE_2_4_MODULES - depends on BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_RMMOD || BUSYBOX_CONFIG_LSMOD - select BUSYBOX_CONFIG_PLATFORM_LINUX + depends on (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_LSMOD || BUSYBOX_CONFIG_MODPROBE || BUSYBOX_CONFIG_RMMOD) && !BUSYBOX_CONFIG_MODPROBE_SMALL help Support module loading for 2.2.x and 2.4.x Linux kernels. This increases size considerably. Say N unless you plan to run ancient kernels. +config BUSYBOX_CONFIG_FEATURE_INSMOD_VERSION_CHECKING + bool "Enable module version checking" + default BUSYBOX_DEFAULT_FEATURE_INSMOD_VERSION_CHECKING + depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) + help + Support checking of versions for modules. This is used to + ensure that the kernel and module are made for each other. + +config BUSYBOX_CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS + bool "Add module symbols to kernel symbol table" + default BUSYBOX_DEFAULT_FEATURE_INSMOD_KSYMOOPS_SYMBOLS + depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) + help + By adding module symbols to the kernel symbol table, Oops messages + occurring within kernel modules can be properly debugged. By enabling + this feature, module symbols will always be added to the kernel symbol + table for proper debugging support. If you are not interested in + Oops messages from kernel modules, say N. + +config BUSYBOX_CONFIG_FEATURE_INSMOD_LOADINKMEM + bool "In kernel memory optimization (uClinux only)" + default BUSYBOX_DEFAULT_FEATURE_INSMOD_LOADINKMEM + depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) + help + This is a special uClinux only memory optimization that lets insmod + load the specified kernel module directly into kernel space, reducing + memory usage by preventing the need for two copies of the module + being loaded into memory. + +config BUSYBOX_CONFIG_FEATURE_INSMOD_LOAD_MAP + bool "Enable insmod load map (-m) option" + default BUSYBOX_DEFAULT_FEATURE_INSMOD_LOAD_MAP + depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && BUSYBOX_CONFIG_INSMOD + help + Enabling this, one would be able to get a load map + output on stdout. This makes kernel module debugging + easier. + If you don't plan to debug kernel modules, you + don't need this option. + +config BUSYBOX_CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL + bool "Symbols in load map" + default BUSYBOX_DEFAULT_FEATURE_INSMOD_LOAD_MAP_FULL + depends on BUSYBOX_CONFIG_FEATURE_INSMOD_LOAD_MAP + help + Without this option, -m will only output section + load map. With this option, -m will also output + symbols load map. + +config BUSYBOX_CONFIG_FEATURE_CHECK_TAINTED_MODULE + bool "Support tainted module checking with new kernels" + default BUSYBOX_DEFAULT_FEATURE_CHECK_TAINTED_MODULE + depends on (BUSYBOX_CONFIG_LSMOD || BUSYBOX_CONFIG_FEATURE_2_4_MODULES) && !BUSYBOX_CONFIG_MODPROBE_SMALL + help + Support checking for tainted modules. These are usually binary + only modules that will make the linux-kernel list ignore your + support request. + This option is required to support GPLONLY modules. + config BUSYBOX_CONFIG_FEATURE_INSMOD_TRY_MMAP bool "Try to load module from a mmap'ed area" default BUSYBOX_DEFAULT_FEATURE_INSMOD_TRY_MMAP - depends on BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE_SMALL - select BUSYBOX_CONFIG_PLATFORM_LINUX + depends on (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) && !BUSYBOX_CONFIG_MODPROBE_SMALL help This option causes module loading code to try to mmap module first. If it does not work (for example, @@ -153,76 +195,10 @@ config BUSYBOX_CONFIG_FEATURE_INSMOD_TRY_MMAP Choosing N saves about 250 bytes of code (on 32-bit x86). -config BUSYBOX_CONFIG_FEATURE_INSMOD_VERSION_CHECKING - bool "Enable module version checking" - default BUSYBOX_DEFAULT_FEATURE_INSMOD_VERSION_CHECKING - depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Support checking of versions for modules. This is used to - ensure that the kernel and module are made for each other. - -config BUSYBOX_CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS - bool "Add module symbols to kernel symbol table" - default BUSYBOX_DEFAULT_FEATURE_INSMOD_KSYMOOPS_SYMBOLS - depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - By adding module symbols to the kernel symbol table, Oops messages - occuring within kernel modules can be properly debugged. By enabling - this feature, module symbols will always be added to the kernel symbol - table for proper debugging support. If you are not interested in - Oops messages from kernel modules, say N. - -config BUSYBOX_CONFIG_FEATURE_INSMOD_LOADINKMEM - bool "In kernel memory optimization (uClinux only)" - default BUSYBOX_DEFAULT_FEATURE_INSMOD_LOADINKMEM - depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - This is a special uClinux only memory optimization that lets insmod - load the specified kernel module directly into kernel space, reducing - memory usage by preventing the need for two copies of the module - being loaded into memory. - -config BUSYBOX_CONFIG_FEATURE_INSMOD_LOAD_MAP - bool "Enable insmod load map (-m) option" - default BUSYBOX_DEFAULT_FEATURE_INSMOD_LOAD_MAP - depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && BUSYBOX_CONFIG_INSMOD - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Enabling this, one would be able to get a load map - output on stdout. This makes kernel module debugging - easier. - If you don't plan to debug kernel modules, you - don't need this option. - -config BUSYBOX_CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL - bool "Symbols in load map" - default BUSYBOX_DEFAULT_FEATURE_INSMOD_LOAD_MAP_FULL - depends on BUSYBOX_CONFIG_FEATURE_INSMOD_LOAD_MAP && !BUSYBOX_CONFIG_MODPROBE_SMALL - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Without this option, -m will only output section - load map. With this option, -m will also output - symbols load map. - -config BUSYBOX_CONFIG_FEATURE_CHECK_TAINTED_MODULE - bool "Support tainted module checking with new kernels" - default BUSYBOX_DEFAULT_FEATURE_CHECK_TAINTED_MODULE - depends on (BUSYBOX_CONFIG_LSMOD || BUSYBOX_CONFIG_FEATURE_2_4_MODULES) && !BUSYBOX_CONFIG_MODPROBE_SMALL - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Support checking for tainted modules. These are usually binary - only modules that will make the linux-kernel list ignore your - support request. - This option is required to support GPLONLY modules. - config BUSYBOX_CONFIG_FEATURE_MODUTILS_ALIAS - bool "Support for module.aliases file" + bool "Support module.aliases file" default BUSYBOX_DEFAULT_FEATURE_MODUTILS_ALIAS - depends on BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE - select BUSYBOX_CONFIG_PLATFORM_LINUX + depends on (BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE) && !BUSYBOX_CONFIG_MODPROBE_SMALL help Generate and parse modules.alias containing aliases for bus identifiers: @@ -236,10 +212,9 @@ config BUSYBOX_CONFIG_FEATURE_MODUTILS_ALIAS Say Y if unsure. config BUSYBOX_CONFIG_FEATURE_MODUTILS_SYMBOLS - bool "Support for module.symbols file" + bool "Support module.symbols file" default BUSYBOX_DEFAULT_FEATURE_MODUTILS_SYMBOLS - depends on BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE - select BUSYBOX_CONFIG_PLATFORM_LINUX + depends on (BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE) && !BUSYBOX_CONFIG_MODPROBE_SMALL help Generate and parse modules.symbols containing aliases for symbol_request() kernel calls, such as: @@ -250,7 +225,7 @@ config BUSYBOX_CONFIG_FEATURE_MODUTILS_SYMBOLS config BUSYBOX_CONFIG_DEFAULT_MODULES_DIR string "Default directory containing modules" default BUSYBOX_DEFAULT_DEFAULT_MODULES_DIR - depends on BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE || BUSYBOX_CONFIG_MODPROBE_SMALL || BUSYBOX_CONFIG_MODINFO + depends on BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE || BUSYBOX_CONFIG_MODINFO help Directory that contains kernel modules. Defaults to "/lib/modules" @@ -258,9 +233,13 @@ config BUSYBOX_CONFIG_DEFAULT_MODULES_DIR config BUSYBOX_CONFIG_DEFAULT_DEPMOD_FILE string "Default name of modules.dep" default BUSYBOX_DEFAULT_DEFAULT_DEPMOD_FILE - depends on BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE || BUSYBOX_CONFIG_MODPROBE_SMALL || BUSYBOX_CONFIG_MODINFO + depends on BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE || BUSYBOX_CONFIG_MODINFO help Filename that contains kernel modules dependencies. - Defaults to "modules.dep" + Defaults to "modules.dep". + If you configured the "simplified modutils" (MODPROBE_SMALL), a + ".bb" suffix will be added after this name. Do not specify ".bb" + here unless you intend your depmod or modprobe to work on + "modules.dep.bb.bb" or such. endmenu diff --git a/package/utils/busybox/config/networking/Config.in b/package/utils/busybox/config/networking/Config.in index e58746bdd..2d2a1c4a9 100644 --- a/package/utils/busybox/config/networking/Config.in +++ b/package/utils/busybox/config/networking/Config.in @@ -6,6 +6,602 @@ menu "Networking Utilities" +config BUSYBOX_CONFIG_FEATURE_IPV6 + bool "Enable IPv6 support" + default BUSYBOX_DEFAULT_FEATURE_IPV6 + help + Enable IPv6 support in busybox. + This adds IPv6 support in the networking applets. + +config BUSYBOX_CONFIG_FEATURE_UNIX_LOCAL + bool "Enable Unix domain socket support (usually not needed)" + default BUSYBOX_DEFAULT_FEATURE_UNIX_LOCAL + help + Enable Unix domain socket support in all busybox networking + applets. Address of the form local:/path/to/unix/socket + will be recognized. + + This extension is almost never used in real world usage. + You most likely want to say N. + +config BUSYBOX_CONFIG_FEATURE_PREFER_IPV4_ADDRESS + bool "Prefer IPv4 addresses from DNS queries" + default BUSYBOX_DEFAULT_FEATURE_PREFER_IPV4_ADDRESS + depends on BUSYBOX_CONFIG_FEATURE_IPV6 + help + Use IPv4 address of network host if it has one. + + If this option is off, the first returned address will be used. + This may cause problems when your DNS server is IPv6-capable and + is returning IPv6 host addresses too. If IPv6 address + precedes IPv4 one in DNS reply, busybox network applets + (e.g. wget) will use IPv6 address. On an IPv6-incapable host + or network applets will fail to connect to the host + using IPv6 address. + +config BUSYBOX_CONFIG_VERBOSE_RESOLUTION_ERRORS + bool "Verbose resolution errors" + default BUSYBOX_DEFAULT_VERBOSE_RESOLUTION_ERRORS + help + Enable if you are not satisfied with simplistic + "can't resolve 'hostname.com'" and want to know more. + This may increase size of your executable a bit. + +config BUSYBOX_CONFIG_ARP + bool "arp" + default BUSYBOX_DEFAULT_ARP + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Manipulate the system ARP cache. +config BUSYBOX_CONFIG_ARPING + bool "arping" + default BUSYBOX_DEFAULT_ARPING + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Ping hosts by ARP packets. + +config BUSYBOX_CONFIG_BRCTL + bool "brctl" + default BUSYBOX_DEFAULT_BRCTL + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Manage ethernet bridges. + Supports addbr/delbr and addif/delif. + +config BUSYBOX_CONFIG_FEATURE_BRCTL_FANCY + bool "Fancy options" + default BUSYBOX_DEFAULT_FEATURE_BRCTL_FANCY + depends on BUSYBOX_CONFIG_BRCTL + help + Add support for extended option like: + setageing, setfd, sethello, setmaxage, + setpathcost, setportprio, setbridgeprio, + stp + This adds about 600 bytes. + +config BUSYBOX_CONFIG_FEATURE_BRCTL_SHOW + bool "Support show" + default BUSYBOX_DEFAULT_FEATURE_BRCTL_SHOW + depends on BUSYBOX_CONFIG_BRCTL && BUSYBOX_CONFIG_FEATURE_BRCTL_FANCY + help + Add support for option which prints the current config: + show +config BUSYBOX_CONFIG_DNSD + bool "dnsd" + default BUSYBOX_DEFAULT_DNSD + help + Small and static DNS server daemon. +config BUSYBOX_CONFIG_ETHER_WAKE + bool "ether-wake" + default BUSYBOX_DEFAULT_ETHER_WAKE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Send a magic packet to wake up sleeping machines. +config BUSYBOX_CONFIG_FTPD + bool "ftpd" + default BUSYBOX_DEFAULT_FTPD + help + Simple FTP daemon. You have to run it via inetd. + +config BUSYBOX_CONFIG_FEATURE_FTPD_WRITE + bool "Enable upload commands" + default BUSYBOX_DEFAULT_FEATURE_FTPD_WRITE + depends on BUSYBOX_CONFIG_FTPD + help + Enable all kinds of FTP upload commands (-w option) + +config BUSYBOX_CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST + bool "Enable workaround for RFC-violating clients" + default BUSYBOX_DEFAULT_FEATURE_FTPD_ACCEPT_BROKEN_LIST + depends on BUSYBOX_CONFIG_FTPD + help + Some ftp clients (among them KDE's Konqueror) issue illegal + "LIST -l" requests. This option works around such problems. + It might prevent you from listing files starting with "-" and + it increases the code size by ~40 bytes. + Most other ftp servers seem to behave similar to this. + +config BUSYBOX_CONFIG_FEATURE_FTPD_AUTHENTICATION + bool "Enable authentication" + default BUSYBOX_DEFAULT_FEATURE_FTPD_AUTHENTICATION + depends on BUSYBOX_CONFIG_FTPD + help + Enable basic system login as seen in telnet etc. +config BUSYBOX_CONFIG_FTPGET + bool "ftpget" + default BUSYBOX_DEFAULT_FTPGET + help + Retrieve a remote file via FTP. + +config BUSYBOX_CONFIG_FTPPUT + bool "ftpput" + default BUSYBOX_DEFAULT_FTPPUT + help + Store a remote file via FTP. + +config BUSYBOX_CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS + bool "Enable long options in ftpget/ftpput" + default BUSYBOX_DEFAULT_FEATURE_FTPGETPUT_LONG_OPTIONS + depends on BUSYBOX_CONFIG_LONG_OPTS && (BUSYBOX_CONFIG_FTPGET || BUSYBOX_CONFIG_FTPPUT) +config BUSYBOX_CONFIG_HOSTNAME + bool "hostname" + default BUSYBOX_DEFAULT_HOSTNAME + help + Show or set the system's host name. + +config BUSYBOX_CONFIG_DNSDOMAINNAME + bool "dnsdomainname" + default BUSYBOX_DEFAULT_DNSDOMAINNAME + help + Alias to "hostname -d". +config BUSYBOX_CONFIG_HTTPD + bool "httpd" + default BUSYBOX_DEFAULT_HTTPD + help + HTTP server. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_RANGES + bool "Support 'Ranges:' header" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_RANGES + depends on BUSYBOX_CONFIG_HTTPD + help + Makes httpd emit "Accept-Ranges: bytes" header and understand + "Range: bytes=NNN-[MMM]" header. Allows for resuming interrupted + downloads, seeking in multimedia players etc. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_SETUID + bool "Enable -u option" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_SETUID + depends on BUSYBOX_CONFIG_HTTPD + help + This option allows the server to run as a specific user + rather than defaulting to the user that starts the server. + Use of this option requires special privileges to change to a + different user. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_BASIC_AUTH + bool "Enable Basic http Authentication" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_BASIC_AUTH + depends on BUSYBOX_CONFIG_HTTPD + help + Utilizes password settings from /etc/httpd.conf for basic + authentication on a per url basis. + Example for httpd.conf file: + /adm:toor:PaSsWd + +config BUSYBOX_CONFIG_FEATURE_HTTPD_AUTH_MD5 + bool "Support MD5 crypted passwords for http Authentication" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_AUTH_MD5 + depends on BUSYBOX_CONFIG_FEATURE_HTTPD_BASIC_AUTH + help + Enables encrypted passwords, and wildcard user/passwords + in httpd.conf file. + User '*' means 'any system user name is ok', + password of '*' means 'use system password for this user' + Examples: + /adm:toor:$1$P/eKnWXS$aI1aPGxT.dJD5SzqAKWrF0 + /adm:root:* + /wiki:*:* + +config BUSYBOX_CONFIG_FEATURE_HTTPD_CGI + bool "Support Common Gateway Interface (CGI)" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_CGI + depends on BUSYBOX_CONFIG_HTTPD + help + This option allows scripts and executables to be invoked + when specific URLs are requested. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR + bool "Support running scripts through an interpreter" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR + depends on BUSYBOX_CONFIG_FEATURE_HTTPD_CGI + help + This option enables support for running scripts through an + interpreter. Turn this on if you want PHP scripts to work + properly. You need to supply an additional line in your + httpd.conf file: + *.php:/path/to/your/php + +config BUSYBOX_CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV + bool "Set REMOTE_PORT environment variable for CGI" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV + depends on BUSYBOX_CONFIG_FEATURE_HTTPD_CGI + help + Use of this option can assist scripts in generating + references that contain a unique port number. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_ENCODE_URL_STR + bool "Enable -e option (useful for CGIs written as shell scripts)" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_ENCODE_URL_STR + depends on BUSYBOX_CONFIG_HTTPD + help + This option allows html encoding of arbitrary strings for display + by the browser. Output goes to stdout. + For example, httpd -e "" produces + "<Hello World>". + +config BUSYBOX_CONFIG_FEATURE_HTTPD_ERROR_PAGES + bool "Support custom error pages" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_ERROR_PAGES + depends on BUSYBOX_CONFIG_HTTPD + help + This option allows you to define custom error pages in + the configuration file instead of the default HTTP status + error pages. For instance, if you add the line: + E404:/path/e404.html + in the config file, the server will respond the specified + '/path/e404.html' file instead of the terse '404 NOT FOUND' + message. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_PROXY + bool "Support reverse proxy" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_PROXY + depends on BUSYBOX_CONFIG_HTTPD + help + This option allows you to define URLs that will be forwarded + to another HTTP server. To setup add the following line to the + configuration file + P:/url/:http://hostname[:port]/new/path/ + Then a request to /url/myfile will be forwarded to + http://hostname[:port]/new/path/myfile. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_GZIP + bool "Support GZIP content encoding" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_GZIP + depends on BUSYBOX_CONFIG_HTTPD + help + Makes httpd send files using GZIP content encoding if the + client supports it and a pre-compressed .gz exists. +config BUSYBOX_CONFIG_IFCONFIG + bool "ifconfig" + default BUSYBOX_DEFAULT_IFCONFIG + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Ifconfig is used to configure the kernel-resident network interfaces. + +config BUSYBOX_CONFIG_FEATURE_IFCONFIG_STATUS + bool "Enable status reporting output (+7k)" + default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_STATUS + depends on BUSYBOX_CONFIG_IFCONFIG + help + If ifconfig is called with no arguments it will display the status + of the currently active interfaces. + +config BUSYBOX_CONFIG_FEATURE_IFCONFIG_SLIP + bool "Enable slip-specific options \"keepalive\" and \"outfill\"" + default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_SLIP + depends on BUSYBOX_CONFIG_IFCONFIG + help + Allow "keepalive" and "outfill" support for SLIP. If you're not + planning on using serial lines, leave this unchecked. + +config BUSYBOX_CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ + bool "Enable options \"mem_start\", \"io_addr\", and \"irq\"" + default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ + depends on BUSYBOX_CONFIG_IFCONFIG + help + Allow the start address for shared memory, start address for I/O, + and/or the interrupt line used by the specified device. + +config BUSYBOX_CONFIG_FEATURE_IFCONFIG_HW + bool "Enable option \"hw\" (ether only)" + default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_HW + depends on BUSYBOX_CONFIG_IFCONFIG + help + Set the hardware address of this interface, if the device driver + supports this operation. Currently, we only support the 'ether' + class. + +config BUSYBOX_CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS + bool "Set the broadcast automatically" + default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_BROADCAST_PLUS + depends on BUSYBOX_CONFIG_IFCONFIG + help + Setting this will make ifconfig attempt to find the broadcast + automatically if the value '+' is used. +config BUSYBOX_CONFIG_IFENSLAVE + bool "ifenslave" + default BUSYBOX_DEFAULT_IFENSLAVE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Userspace application to bind several interfaces + to a logical interface (use with kernel bonding driver). +config BUSYBOX_CONFIG_IFPLUGD + bool "ifplugd" + default BUSYBOX_DEFAULT_IFPLUGD + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Network interface plug detection daemon. +config BUSYBOX_CONFIG_IFUP + bool "ifup" + default BUSYBOX_DEFAULT_IFUP + help + Activate the specified interfaces. This applet makes use + of either "ifconfig" and "route" or the "ip" command to actually + configure network interfaces. Therefore, you will probably also want + to enable either IFCONFIG and ROUTE, or enable + FEATURE_IFUPDOWN_IP and the various IP options. Of + course you could use non-busybox versions of these programs, so + against my better judgement (since this will surely result in plenty + of support questions on the mailing list), I do not force you to + enable these additional options. It is up to you to supply either + "ifconfig", "route" and "run-parts" or the "ip" command, either + via busybox or via standalone utilities. + +config BUSYBOX_CONFIG_IFDOWN + bool "ifdown" + default BUSYBOX_DEFAULT_IFDOWN + help + Deactivate the specified interfaces. + +config BUSYBOX_CONFIG_IFUPDOWN_IFSTATE_PATH + string "Absolute path to ifstate file" + default BUSYBOX_DEFAULT_IFUPDOWN_IFSTATE_PATH + depends on BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN + help + ifupdown keeps state information in a file called ifstate. + Typically it is located in /var/run/ifstate, however + some distributions tend to put it in other places + (debian, for example, uses /etc/network/run/ifstate). + This config option defines location of ifstate. + +config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IP + bool "Use ip tool (else ifconfig/route is used)" + default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IP + depends on BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN + help + Use the iproute "ip" command to implement "ifup" and "ifdown", rather + than the default of using the older "ifconfig" and "route" utilities. + + If Y: you must install either the full-blown iproute2 package + or enable "ip" applet in Busybox, or the "ifup" and "ifdown" applets + will not work. + + If N: you must install either the full-blown ifconfig and route + utilities, or enable these applets in Busybox. + +config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IPV4 + bool "Support IPv4" + default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IPV4 + depends on BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN + help + If you want ifup/ifdown to talk IPv4, leave this on. + +config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IPV6 + bool "Support IPv6" + default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IPV6 + depends on (BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN) && BUSYBOX_CONFIG_FEATURE_IPV6 + help + If you need support for IPv6, turn this option on. + + +config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_MAPPING + bool "Enable mapping support" + default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_MAPPING + depends on BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN + help + This enables support for the "mapping" stanza, unless you have + a weird network setup you don't need it. + +config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP + bool "Support external DHCP clients" + default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_EXTERNAL_DHCP + depends on BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN + help + This enables support for the external dhcp clients. Clients are + tried in the following order: dhcpcd, dhclient, pump and udhcpc. + Otherwise, if udhcpc applet is enabled, it is used. + Otherwise, ifup/ifdown will have no support for DHCP. +config BUSYBOX_CONFIG_INETD + bool "inetd" + default BUSYBOX_DEFAULT_INETD + select BUSYBOX_CONFIG_FEATURE_SYSLOG + help + Internet superserver daemon + +config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO + bool "Support echo service" + default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_ECHO + depends on BUSYBOX_CONFIG_INETD + help + Echo received data internal inetd service + +config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD + bool "Support discard service" + default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD + depends on BUSYBOX_CONFIG_INETD + help + Internet /dev/null internal inetd service + +config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME + bool "Support time service" + default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_TIME + depends on BUSYBOX_CONFIG_INETD + help + Return 32 bit time since 1900 internal inetd service + +config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME + bool "Support daytime service" + default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME + depends on BUSYBOX_CONFIG_INETD + help + Return human-readable time internal inetd service + +config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN + bool "Support chargen service" + default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN + depends on BUSYBOX_CONFIG_INETD + help + Familiar character generator internal inetd service + +config BUSYBOX_CONFIG_FEATURE_INETD_RPC + bool "Support RPC services" + default BUSYBOX_DEFAULT_FEATURE_INETD_RPC # very rarely used, and needs Sun RPC support in libc + depends on BUSYBOX_CONFIG_INETD + select BUSYBOX_CONFIG_FEATURE_HAVE_RPC + help + Support Sun-RPC based services +config BUSYBOX_CONFIG_IP + bool "ip" + default BUSYBOX_DEFAULT_IP + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + The "ip" applet is a TCP/IP interface configuration and routing + utility. You generally don't need "ip" to use busybox with + TCP/IP. + +config BUSYBOX_CONFIG_IPADDR + bool "ipaddr" + default BUSYBOX_DEFAULT_IPADDR + select BUSYBOX_CONFIG_FEATURE_IP_ADDRESS + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Support short form of ip addr: ipaddr + +config BUSYBOX_CONFIG_IPLINK + bool "iplink" + default BUSYBOX_DEFAULT_IPLINK + select BUSYBOX_CONFIG_FEATURE_IP_LINK + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Support short form of ip link: iplink + +config BUSYBOX_CONFIG_IPROUTE + bool "iproute" + default BUSYBOX_DEFAULT_IPROUTE + select BUSYBOX_CONFIG_FEATURE_IP_ROUTE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Support short form of ip route: iproute + +config BUSYBOX_CONFIG_IPTUNNEL + bool "iptunnel" + default BUSYBOX_DEFAULT_IPTUNNEL + select BUSYBOX_CONFIG_FEATURE_IP_TUNNEL + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Support short form of ip tunnel: iptunnel + +config BUSYBOX_CONFIG_IPRULE + bool "iprule" + default BUSYBOX_DEFAULT_IPRULE + select BUSYBOX_CONFIG_FEATURE_IP_RULE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Support short form of ip rule: iprule + +config BUSYBOX_CONFIG_IPNEIGH + bool "ipneigh" + default BUSYBOX_DEFAULT_IPNEIGH + select BUSYBOX_CONFIG_FEATURE_IP_NEIGH + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Support short form of ip neigh: ipneigh + +config BUSYBOX_CONFIG_FEATURE_IP_ADDRESS + bool "ip address" + default BUSYBOX_DEFAULT_FEATURE_IP_ADDRESS + depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPADDR + help + Address manipulation support for the "ip" applet. + +config BUSYBOX_CONFIG_FEATURE_IP_LINK + bool "ip link" + default BUSYBOX_DEFAULT_FEATURE_IP_LINK + depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPLINK + help + Configure network devices with "ip". + +config BUSYBOX_CONFIG_FEATURE_IP_ROUTE + bool "ip route" + default BUSYBOX_DEFAULT_FEATURE_IP_ROUTE + depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPROUTE + help + Add support for routing table management to "ip". + +config BUSYBOX_CONFIG_FEATURE_IP_ROUTE_DIR + string "ip route configuration directory" + default BUSYBOX_DEFAULT_FEATURE_IP_ROUTE_DIR + depends on BUSYBOX_CONFIG_FEATURE_IP_ROUTE + help + Location of the "ip" applet routing configuration. + +config BUSYBOX_CONFIG_FEATURE_IP_TUNNEL + bool "ip tunnel" + default BUSYBOX_DEFAULT_FEATURE_IP_TUNNEL + depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPTUNNEL + help + Add support for tunneling commands to "ip". + +config BUSYBOX_CONFIG_FEATURE_IP_RULE + bool "ip rule" + default BUSYBOX_DEFAULT_FEATURE_IP_RULE + depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPRULE + help + Add support for rule commands to "ip". + +config BUSYBOX_CONFIG_FEATURE_IP_NEIGH + bool "ip neighbor" + default BUSYBOX_DEFAULT_FEATURE_IP_NEIGH + depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPNEIGH + help + Add support for neighbor commands to "ip". + +config BUSYBOX_CONFIG_FEATURE_IP_RARE_PROTOCOLS + bool "Support displaying rarely used link types" + default BUSYBOX_DEFAULT_FEATURE_IP_RARE_PROTOCOLS + depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPADDR || BUSYBOX_CONFIG_IPLINK || BUSYBOX_CONFIG_IPROUTE || BUSYBOX_CONFIG_IPTUNNEL || BUSYBOX_CONFIG_IPRULE || BUSYBOX_CONFIG_IPNEIGH + help + If you are not going to use links of type "frad", "econet", + "bif" etc, you probably don't need to enable this. + Ethernet, wireless, infrared, ppp/slip, ip tunnelling + link types are supported without this option selected. +config BUSYBOX_CONFIG_IPCALC + bool "ipcalc" + default BUSYBOX_DEFAULT_IPCALC + help + ipcalc takes an IP address and netmask and calculates the + resulting broadcast, network, and host range. + +config BUSYBOX_CONFIG_FEATURE_IPCALC_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_IPCALC_LONG_OPTIONS + depends on BUSYBOX_CONFIG_IPCALC && BUSYBOX_CONFIG_LONG_OPTS + +config BUSYBOX_CONFIG_FEATURE_IPCALC_FANCY + bool "Fancy IPCALC, more options, adds 1 kbyte" + default BUSYBOX_DEFAULT_FEATURE_IPCALC_FANCY + depends on BUSYBOX_CONFIG_IPCALC + help + Adds the options hostname, prefix and silent to the output of + "ipcalc". +config BUSYBOX_CONFIG_FAKEIDENTD + bool "fakeidentd" + default BUSYBOX_DEFAULT_FAKEIDENTD + select BUSYBOX_CONFIG_FEATURE_SYSLOG + help + fakeidentd listens on the ident port and returns a predefined + fake value on any query. config BUSYBOX_CONFIG_NAMEIF bool "nameif" default BUSYBOX_DEFAULT_NAMEIF @@ -72,755 +668,11 @@ config BUSYBOX_CONFIG_NC_110_COMPAT The code is about 2.5k bigger. It enables -s ADDR, -n, -u, -v, -o FILE, -z options, but loses busybox-specific extensions: -f FILE. -config BUSYBOX_CONFIG_PING - bool "ping" - default BUSYBOX_DEFAULT_PING - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to - elicit an ICMP ECHO_RESPONSE from a host or gateway. - -config BUSYBOX_CONFIG_PING6 - bool "ping6" - default BUSYBOX_DEFAULT_PING6 - depends on BUSYBOX_CONFIG_FEATURE_IPV6 && BUSYBOX_CONFIG_PING - help - This will give you a ping that can talk IPv6. - -config BUSYBOX_CONFIG_FEATURE_FANCY_PING - bool "Enable fancy ping output" - default BUSYBOX_DEFAULT_FEATURE_FANCY_PING - depends on BUSYBOX_CONFIG_PING - help - Make the output from the ping applet include statistics, and at the - same time provide full support for ICMP packets. -config BUSYBOX_CONFIG_WGET - bool "wget" - default BUSYBOX_DEFAULT_WGET - help - wget is a utility for non-interactive download of files from HTTP - and FTP servers. - -config BUSYBOX_CONFIG_FEATURE_WGET_STATUSBAR - bool "Enable a nifty process meter (+2k)" - default BUSYBOX_DEFAULT_FEATURE_WGET_STATUSBAR - depends on BUSYBOX_CONFIG_WGET - help - Enable the transfer progress bar for wget transfers. - -config BUSYBOX_CONFIG_FEATURE_WGET_AUTHENTICATION - bool "Enable HTTP authentication" - default BUSYBOX_DEFAULT_FEATURE_WGET_AUTHENTICATION - depends on BUSYBOX_CONFIG_WGET - help - Support authenticated HTTP transfers. - -config BUSYBOX_CONFIG_FEATURE_WGET_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_WGET_LONG_OPTIONS - depends on BUSYBOX_CONFIG_WGET && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the wget applet. - -config BUSYBOX_CONFIG_FEATURE_WGET_TIMEOUT - bool "Enable timeout option -T SEC" - default BUSYBOX_DEFAULT_FEATURE_WGET_TIMEOUT - depends on BUSYBOX_CONFIG_WGET - help - Supports network read and connect timeouts for wget, - so that wget will give up and timeout, through the -T - command line option. - - Currently only connect and network data read timeout are - supported (i.e., timeout is not applied to the DNS query). When - FEATURE_WGET_LONG_OPTIONS is also enabled, the --timeout option - will work in addition to -T. - -config BUSYBOX_CONFIG_FEATURE_WGET_OPENSSL - bool "Try to connect to HTTPS using openssl" - default BUSYBOX_DEFAULT_FEATURE_WGET_OPENSSL - depends on BUSYBOX_CONFIG_WGET - help - Choose how wget establishes SSL connection for https:// URLs. - - Busybox itself contains no SSL code. wget will spawn - a helper program to talk over HTTPS. - - OpenSSL has a simple SSL client for debug purposes. - If you select "openssl" helper, wget will effectively call - "openssl s_client -quiet -connect IP:443 2>/dev/null" - and pipe its data through it. - Note inconvenient API: host resolution is done twice, - and there is no guarantee openssl's idea of IPv6 address - format is the same as ours. - Another problem is that s_client prints debug information - to stderr, and it needs to be suppressed. This means - all error messages get suppressed too. - openssl is also a big binary, often dynamically linked - against ~15 libraries. - -config BUSYBOX_CONFIG_FEATURE_WGET_SSL_HELPER - bool "Try to connect to HTTPS using ssl_helper" - default BUSYBOX_DEFAULT_FEATURE_WGET_SSL_HELPER - depends on BUSYBOX_CONFIG_WGET - help - Choose how wget establishes SSL connection for https:// URLs. - - Busybox itself contains no SSL code. wget will spawn - a helper program to talk over HTTPS. - - ssl_helper is a tool which can be built statically - from busybox sources against a small embedded SSL library. - Please see networking/ssl_helper/README. - It does not require double host resolution and emits - error messages to stderr. - - Precompiled static binary may be available at - http://busybox.net/downloads/binaries/ -config BUSYBOX_CONFIG_WHOIS - bool "whois" - default BUSYBOX_DEFAULT_WHOIS - help - whois is a client for the whois directory service - -config BUSYBOX_CONFIG_FEATURE_IPV6 - bool "Enable IPv6 support" - default BUSYBOX_DEFAULT_FEATURE_IPV6 - help - Enable IPv6 support in busybox. - This adds IPv6 support in the networking applets. - -config BUSYBOX_CONFIG_FEATURE_UNIX_LOCAL - bool "Enable Unix domain socket support (usually not needed)" - default BUSYBOX_DEFAULT_FEATURE_UNIX_LOCAL - help - Enable Unix domain socket support in all busybox networking - applets. Address of the form local:/path/to/unix/socket - will be recognized. - - This extension is almost never used in real world usage. - You most likely want to say N. - -config BUSYBOX_CONFIG_FEATURE_PREFER_IPV4_ADDRESS - bool "Prefer IPv4 addresses from DNS queries" - default BUSYBOX_DEFAULT_FEATURE_PREFER_IPV4_ADDRESS - depends on BUSYBOX_CONFIG_FEATURE_IPV6 - help - Use IPv4 address of network host if it has one. - - If this option is off, the first returned address will be used. - This may cause problems when your DNS server is IPv6-capable and - is returning IPv6 host addresses too. If IPv6 address - precedes IPv4 one in DNS reply, busybox network applets - (e.g. wget) will use IPv6 address. On an IPv6-incapable host - or network applets will fail to connect to the host - using IPv6 address. - -config BUSYBOX_CONFIG_VERBOSE_RESOLUTION_ERRORS - bool "Verbose resolution errors" - default BUSYBOX_DEFAULT_VERBOSE_RESOLUTION_ERRORS - help - Enable if you are not satisfied with simplistic - "can't resolve 'hostname.com'" and want to know more. - This may increase size of your executable a bit. - -config BUSYBOX_CONFIG_ARP - bool "arp" - default BUSYBOX_DEFAULT_ARP - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Manipulate the system ARP cache. - -config BUSYBOX_CONFIG_ARPING - bool "arping" - default BUSYBOX_DEFAULT_ARPING - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Ping hosts by ARP packets. - -config BUSYBOX_CONFIG_BRCTL - bool "brctl" - default BUSYBOX_DEFAULT_BRCTL - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Manage ethernet bridges. - Supports addbr/delbr and addif/delif. - -config BUSYBOX_CONFIG_FEATURE_BRCTL_FANCY - bool "Fancy options" - default BUSYBOX_DEFAULT_FEATURE_BRCTL_FANCY - depends on BUSYBOX_CONFIG_BRCTL - help - Add support for extended option like: - setageing, setfd, sethello, setmaxage, - setpathcost, setportprio, setbridgeprio, - stp - This adds about 600 bytes. - -config BUSYBOX_CONFIG_FEATURE_BRCTL_SHOW - bool "Support show" - default BUSYBOX_DEFAULT_FEATURE_BRCTL_SHOW - depends on BUSYBOX_CONFIG_BRCTL && BUSYBOX_CONFIG_FEATURE_BRCTL_FANCY - help - Add support for option which prints the current config: - show - -config BUSYBOX_CONFIG_DNSD - bool "dnsd" - default BUSYBOX_DEFAULT_DNSD - help - Small and static DNS server daemon. - -config BUSYBOX_CONFIG_ETHER_WAKE - bool "ether-wake" - default BUSYBOX_DEFAULT_ETHER_WAKE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Send a magic packet to wake up sleeping machines. - -config BUSYBOX_CONFIG_FAKEIDENTD - bool "fakeidentd" - default BUSYBOX_DEFAULT_FAKEIDENTD - select BUSYBOX_CONFIG_FEATURE_SYSLOG - help - fakeidentd listens on the ident port and returns a predefined - fake value on any query. - -config BUSYBOX_CONFIG_FTPD - bool "ftpd" - default BUSYBOX_DEFAULT_FTPD - help - simple FTP daemon. You have to run it via inetd. - -config BUSYBOX_CONFIG_FEATURE_FTP_WRITE - bool "Enable upload commands" - default BUSYBOX_DEFAULT_FEATURE_FTP_WRITE - depends on BUSYBOX_CONFIG_FTPD - help - Enable all kinds of FTP upload commands (-w option) - -config BUSYBOX_CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST - bool "Enable workaround for RFC-violating clients" - default BUSYBOX_DEFAULT_FEATURE_FTPD_ACCEPT_BROKEN_LIST - depends on BUSYBOX_CONFIG_FTPD - help - Some ftp clients (among them KDE's Konqueror) issue illegal - "LIST -l" requests. This option works around such problems. - It might prevent you from listing files starting with "-" and - it increases the code size by ~40 bytes. - Most other ftp servers seem to behave similar to this. - -config BUSYBOX_CONFIG_FEATURE_FTP_AUTHENTICATION - bool "Enable authentication" - default BUSYBOX_DEFAULT_FEATURE_FTP_AUTHENTICATION - depends on BUSYBOX_CONFIG_FTPD - help - Enable basic system login as seen in telnet etc. - -config BUSYBOX_CONFIG_FTPGET - bool "ftpget" - default BUSYBOX_DEFAULT_FTPGET - help - Retrieve a remote file via FTP. - -config BUSYBOX_CONFIG_FTPPUT - bool "ftpput" - default BUSYBOX_DEFAULT_FTPPUT - help - Store a remote file via FTP. - -config BUSYBOX_CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS - bool "Enable long options in ftpget/ftpput" - default BUSYBOX_DEFAULT_FEATURE_FTPGETPUT_LONG_OPTIONS - depends on BUSYBOX_CONFIG_LONG_OPTS && (BUSYBOX_CONFIG_FTPGET || BUSYBOX_CONFIG_FTPPUT) - help - Support long options for the ftpget/ftpput applet. - -config BUSYBOX_CONFIG_HOSTNAME - bool "hostname" - default BUSYBOX_DEFAULT_HOSTNAME - help - Show or set the system's host name. - -config BUSYBOX_CONFIG_HTTPD - bool "httpd" - default BUSYBOX_DEFAULT_HTTPD - help - Serve web pages via an HTTP server. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_RANGES - bool "Support 'Ranges:' header" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_RANGES - depends on BUSYBOX_CONFIG_HTTPD - help - Makes httpd emit "Accept-Ranges: bytes" header and understand - "Range: bytes=NNN-[MMM]" header. Allows for resuming interrupted - downloads, seeking in multimedia players etc. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_SETUID - bool "Enable -u option" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_SETUID - depends on BUSYBOX_CONFIG_HTTPD - help - This option allows the server to run as a specific user - rather than defaulting to the user that starts the server. - Use of this option requires special privileges to change to a - different user. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_BASIC_AUTH - bool "Enable Basic http Authentication" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_BASIC_AUTH - depends on BUSYBOX_CONFIG_HTTPD - help - Utilizes password settings from /etc/httpd.conf for basic - authentication on a per url basis. - Example for httpd.conf file: - /adm:toor:PaSsWd - -config BUSYBOX_CONFIG_FEATURE_HTTPD_AUTH_MD5 - bool "Support MD5 crypted passwords for http Authentication" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_AUTH_MD5 - depends on BUSYBOX_CONFIG_FEATURE_HTTPD_BASIC_AUTH - help - Enables encrypted passwords, and wildcard user/passwords - in httpd.conf file. - User '*' means 'any system user name is ok', - password of '*' means 'use system password for this user' - Examples: - /adm:toor:$1$P/eKnWXS$aI1aPGxT.dJD5SzqAKWrF0 - /adm:root:* - /wiki:*:* - -config BUSYBOX_CONFIG_FEATURE_HTTPD_CGI - bool "Support Common Gateway Interface (CGI)" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_CGI - depends on BUSYBOX_CONFIG_HTTPD - help - This option allows scripts and executables to be invoked - when specific URLs are requested. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR - bool "Support for running scripts through an interpreter" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR - depends on BUSYBOX_CONFIG_FEATURE_HTTPD_CGI - help - This option enables support for running scripts through an - interpreter. Turn this on if you want PHP scripts to work - properly. You need to supply an additional line in your - httpd.conf file: - *.php:/path/to/your/php - -config BUSYBOX_CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV - bool "Set REMOTE_PORT environment variable for CGI" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV - depends on BUSYBOX_CONFIG_FEATURE_HTTPD_CGI - help - Use of this option can assist scripts in generating - references that contain a unique port number. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_ENCODE_URL_STR - bool "Enable -e option (useful for CGIs written as shell scripts)" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_ENCODE_URL_STR - depends on BUSYBOX_CONFIG_HTTPD - help - This option allows html encoding of arbitrary strings for display - by the browser. Output goes to stdout. - For example, httpd -e "" produces - "<Hello World>". - -config BUSYBOX_CONFIG_FEATURE_HTTPD_ERROR_PAGES - bool "Support for custom error pages" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_ERROR_PAGES - depends on BUSYBOX_CONFIG_HTTPD - help - This option allows you to define custom error pages in - the configuration file instead of the default HTTP status - error pages. For instance, if you add the line: - E404:/path/e404.html - in the config file, the server will respond the specified - '/path/e404.html' file instead of the terse '404 NOT FOUND' - message. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_PROXY - bool "Support for reverse proxy" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_PROXY - depends on BUSYBOX_CONFIG_HTTPD - help - This option allows you to define URLs that will be forwarded - to another HTTP server. To setup add the following line to the - configuration file - P:/url/:http://hostname[:port]/new/path/ - Then a request to /url/myfile will be forwarded to - http://hostname[:port]/new/path/myfile. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_GZIP - bool "Support for GZIP content encoding" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_GZIP - depends on BUSYBOX_CONFIG_HTTPD - help - Makes httpd send files using GZIP content encoding if the - client supports it and a pre-compressed .gz exists. - -config BUSYBOX_CONFIG_IFCONFIG - bool "ifconfig" - default BUSYBOX_DEFAULT_IFCONFIG - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Ifconfig is used to configure the kernel-resident network interfaces. - -config BUSYBOX_CONFIG_FEATURE_IFCONFIG_STATUS - bool "Enable status reporting output (+7k)" - default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_STATUS - depends on BUSYBOX_CONFIG_IFCONFIG - help - If ifconfig is called with no arguments it will display the status - of the currently active interfaces. - -config BUSYBOX_CONFIG_FEATURE_IFCONFIG_SLIP - bool "Enable slip-specific options \"keepalive\" and \"outfill\"" - default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_SLIP - depends on BUSYBOX_CONFIG_IFCONFIG - help - Allow "keepalive" and "outfill" support for SLIP. If you're not - planning on using serial lines, leave this unchecked. - -config BUSYBOX_CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ - bool "Enable options \"mem_start\", \"io_addr\", and \"irq\"" - default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ - depends on BUSYBOX_CONFIG_IFCONFIG - help - Allow the start address for shared memory, start address for I/O, - and/or the interrupt line used by the specified device. - -config BUSYBOX_CONFIG_FEATURE_IFCONFIG_HW - bool "Enable option \"hw\" (ether only)" - default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_HW - depends on BUSYBOX_CONFIG_IFCONFIG - help - Set the hardware address of this interface, if the device driver - supports this operation. Currently, we only support the 'ether' - class. - -config BUSYBOX_CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS - bool "Set the broadcast automatically" - default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_BROADCAST_PLUS - depends on BUSYBOX_CONFIG_IFCONFIG - help - Setting this will make ifconfig attempt to find the broadcast - automatically if the value '+' is used. - -config BUSYBOX_CONFIG_IFENSLAVE - bool "ifenslave" - default BUSYBOX_DEFAULT_IFENSLAVE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Userspace application to bind several interfaces - to a logical interface (use with kernel bonding driver). - -config BUSYBOX_CONFIG_IFPLUGD - bool "ifplugd" - default BUSYBOX_DEFAULT_IFPLUGD - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Network interface plug detection daemon. - -config BUSYBOX_CONFIG_IFUPDOWN - bool "ifupdown" - default BUSYBOX_DEFAULT_IFUPDOWN - help - Activate or deactivate the specified interfaces. This applet makes - use of either "ifconfig" and "route" or the "ip" command to actually - configure network interfaces. Therefore, you will probably also want - to enable either IFCONFIG and ROUTE, or enable - FEATURE_IFUPDOWN_IP and the various IP options. Of - course you could use non-busybox versions of these programs, so - against my better judgement (since this will surely result in plenty - of support questions on the mailing list), I do not force you to - enable these additional options. It is up to you to supply either - "ifconfig", "route" and "run-parts" or the "ip" command, either - via busybox or via standalone utilities. - -config BUSYBOX_CONFIG_IFUPDOWN_IFSTATE_PATH - string "Absolute path to ifstate file" - default BUSYBOX_DEFAULT_IFUPDOWN_IFSTATE_PATH - depends on BUSYBOX_CONFIG_IFUPDOWN - help - ifupdown keeps state information in a file called ifstate. - Typically it is located in /var/run/ifstate, however - some distributions tend to put it in other places - (debian, for example, uses /etc/network/run/ifstate). - This config option defines location of ifstate. - -config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IP - bool "Use ip applet" - default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IP - depends on BUSYBOX_CONFIG_IFUPDOWN - help - Use the iproute "ip" command to implement "ifup" and "ifdown", rather - than the default of using the older 'ifconfig' and 'route' utilities. - -config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN - bool "Use busybox ip applet" - default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IP_BUILTIN - depends on BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IP - select BUSYBOX_CONFIG_PLATFORM_LINUX - select BUSYBOX_CONFIG_IP - select BUSYBOX_CONFIG_FEATURE_IP_ADDRESS - select BUSYBOX_CONFIG_FEATURE_IP_LINK - select BUSYBOX_CONFIG_FEATURE_IP_ROUTE - help - Use the busybox iproute "ip" applet to implement "ifupdown". - - If left disabled, you must install the full-blown iproute2 - utility or the "ifup" and "ifdown" applets will not work. - -config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN - bool "Use busybox ifconfig and route applets" - default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN - depends on BUSYBOX_CONFIG_IFUPDOWN && !BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IP - select BUSYBOX_CONFIG_IFCONFIG - select BUSYBOX_CONFIG_ROUTE - help - Use the busybox iproute "ifconfig" and "route" applets to - implement the "ifup" and "ifdown" utilities. - - If left disabled, you must install the full-blown ifconfig - and route utilities, or the "ifup" and "ifdown" applets will not - work. - -config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IPV4 - bool "Support for IPv4" - default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IPV4 - depends on BUSYBOX_CONFIG_IFUPDOWN - help - If you want ifup/ifdown to talk IPv4, leave this on. - -config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IPV6 - bool "Support for IPv6" - default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IPV6 - depends on BUSYBOX_CONFIG_IFUPDOWN && BUSYBOX_CONFIG_FEATURE_IPV6 - help - If you need support for IPv6, turn this option on. - -### UNUSED -###config FEATURE_IFUPDOWN_IPX -### bool "Support for IPX" -### default y -### depends on IFUPDOWN -### help -### If this option is selected you can use busybox to work with IPX -### networks. - -config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_MAPPING - bool "Enable mapping support" - default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_MAPPING - depends on BUSYBOX_CONFIG_IFUPDOWN - help - This enables support for the "mapping" stanza, unless you have - a weird network setup you don't need it. - -config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP - bool "Support for external dhcp clients" - default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_EXTERNAL_DHCP - depends on BUSYBOX_CONFIG_IFUPDOWN - help - This enables support for the external dhcp clients. Clients are - tried in the following order: dhcpcd, dhclient, pump and udhcpc. - Otherwise, if udhcpc applet is enabled, it is used. - Otherwise, ifup/ifdown will have no support for DHCP. - -config BUSYBOX_CONFIG_INETD - bool "inetd" - default BUSYBOX_DEFAULT_INETD - select BUSYBOX_CONFIG_FEATURE_SYSLOG - help - Internet superserver daemon - -config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO - bool "Support echo service" - default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_ECHO - depends on BUSYBOX_CONFIG_INETD - help - Echo received data internal inetd service - -config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD - bool "Support discard service" - default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD - depends on BUSYBOX_CONFIG_INETD - help - Internet /dev/null internal inetd service - -config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME - bool "Support time service" - default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_TIME - depends on BUSYBOX_CONFIG_INETD - help - Return 32 bit time since 1900 internal inetd service - -config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME - bool "Support daytime service" - default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME - depends on BUSYBOX_CONFIG_INETD - help - Return human-readable time internal inetd service - -config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN - bool "Support chargen service" - default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN - depends on BUSYBOX_CONFIG_INETD - help - Familiar character generator internal inetd service - -config BUSYBOX_CONFIG_FEATURE_INETD_RPC - bool "Support RPC services" - default BUSYBOX_DEFAULT_FEATURE_INETD_RPC # very rarely used, and needs Sun RPC support in libc - depends on BUSYBOX_CONFIG_INETD - select BUSYBOX_CONFIG_FEATURE_HAVE_RPC - help - Support Sun-RPC based services - -config BUSYBOX_CONFIG_IP - bool "ip" - default BUSYBOX_DEFAULT_IP - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - The "ip" applet is a TCP/IP interface configuration and routing - utility. You generally don't need "ip" to use busybox with - TCP/IP. - -config BUSYBOX_CONFIG_FEATURE_IP_ADDRESS - bool "ip address" - default BUSYBOX_DEFAULT_FEATURE_IP_ADDRESS - depends on BUSYBOX_CONFIG_IP - help - Address manipulation support for the "ip" applet. - -config BUSYBOX_CONFIG_FEATURE_IP_LINK - bool "ip link" - default BUSYBOX_DEFAULT_FEATURE_IP_LINK - depends on BUSYBOX_CONFIG_IP - help - Configure network devices with "ip". - -config BUSYBOX_CONFIG_FEATURE_IP_ROUTE - bool "ip route" - default BUSYBOX_DEFAULT_FEATURE_IP_ROUTE - depends on BUSYBOX_CONFIG_IP - help - Add support for routing table management to "ip". - -config BUSYBOX_CONFIG_FEATURE_IP_ROUTE_DIR - string "ip route configuration directory" - default BUSYBOX_DEFAULT_FEATURE_IP_ROUTE_DIR - depends on BUSYBOX_CONFIG_FEATURE_IP_ROUTE - help - Location of the "ip" applet routing configuration. - -config BUSYBOX_CONFIG_FEATURE_IP_TUNNEL - bool "ip tunnel" - default BUSYBOX_DEFAULT_FEATURE_IP_TUNNEL - depends on BUSYBOX_CONFIG_IP - help - Add support for tunneling commands to "ip". - -config BUSYBOX_CONFIG_FEATURE_IP_RULE - bool "ip rule" - default BUSYBOX_DEFAULT_FEATURE_IP_RULE - depends on BUSYBOX_CONFIG_IP - help - Add support for rule commands to "ip". - -config BUSYBOX_CONFIG_FEATURE_IP_NEIGH - bool "ip neighbor" - default BUSYBOX_DEFAULT_FEATURE_IP_NEIGH - depends on BUSYBOX_CONFIG_IP - help - Add support for neighbor commands to "ip". - -config BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS - bool "Support short forms of ip commands" - default BUSYBOX_DEFAULT_FEATURE_IP_SHORT_FORMS - depends on BUSYBOX_CONFIG_IP - help - Also support short-form of ip commands: - ip addr -> ipaddr - ip link -> iplink - ip route -> iproute - ip tunnel -> iptunnel - ip rule -> iprule - ip neigh -> ipneigh - - Say N unless you desparately need the short form of the ip - object commands. - -config BUSYBOX_CONFIG_FEATURE_IP_RARE_PROTOCOLS - bool "Support displaying rarely used link types" - default BUSYBOX_DEFAULT_FEATURE_IP_RARE_PROTOCOLS - depends on BUSYBOX_CONFIG_IP - help - If you are not going to use links of type "frad", "econet", - "bif" etc, you probably don't need to enable this. - Ethernet, wireless, infrared, ppp/slip, ip tunnelling - link types are supported without this option selected. - -config BUSYBOX_CONFIG_IPADDR - bool - default BUSYBOX_DEFAULT_IPADDR - depends on BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS && BUSYBOX_CONFIG_FEATURE_IP_ADDRESS - -config BUSYBOX_CONFIG_IPLINK - bool - default BUSYBOX_DEFAULT_IPLINK - depends on BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS && BUSYBOX_CONFIG_FEATURE_IP_LINK - -config BUSYBOX_CONFIG_IPROUTE - bool - default BUSYBOX_DEFAULT_IPROUTE - depends on BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS && BUSYBOX_CONFIG_FEATURE_IP_ROUTE - -config BUSYBOX_CONFIG_IPTUNNEL - bool - default BUSYBOX_DEFAULT_IPTUNNEL - depends on BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS && BUSYBOX_CONFIG_FEATURE_IP_TUNNEL - -config BUSYBOX_CONFIG_IPRULE - bool - default BUSYBOX_DEFAULT_IPRULE - depends on BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS && BUSYBOX_CONFIG_FEATURE_IP_RULE - -config BUSYBOX_CONFIG_IPNEIGH - bool - default BUSYBOX_DEFAULT_IPNEIGH - depends on BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS && BUSYBOX_CONFIG_FEATURE_IP_NEIGH - -config BUSYBOX_CONFIG_IPCALC - bool "ipcalc" - default BUSYBOX_DEFAULT_IPCALC - help - ipcalc takes an IP address and netmask and calculates the - resulting broadcast, network, and host range. - -config BUSYBOX_CONFIG_FEATURE_IPCALC_FANCY - bool "Fancy IPCALC, more options, adds 1 kbyte" - default BUSYBOX_DEFAULT_FEATURE_IPCALC_FANCY - depends on BUSYBOX_CONFIG_IPCALC - help - Adds the options hostname, prefix and silent to the output of - "ipcalc". - -config BUSYBOX_CONFIG_FEATURE_IPCALC_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_IPCALC_LONG_OPTIONS - depends on BUSYBOX_CONFIG_IPCALC && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the ipcalc applet. - config BUSYBOX_CONFIG_NETMSG bool "netmsg" default BUSYBOX_DEFAULT_NETMSG help simple program for sending udp broadcast messages - config BUSYBOX_CONFIG_NETSTAT bool "netstat" default BUSYBOX_DEFAULT_NETSTAT @@ -829,7 +681,7 @@ config BUSYBOX_CONFIG_NETSTAT netstat prints information about the Linux networking subsystem. config BUSYBOX_CONFIG_FEATURE_NETSTAT_WIDE - bool "Enable wide netstat output" + bool "Enable wide output" default BUSYBOX_DEFAULT_FEATURE_NETSTAT_WIDE depends on BUSYBOX_CONFIG_NETSTAT help @@ -843,27 +695,24 @@ config BUSYBOX_CONFIG_FEATURE_NETSTAT_PRG help Add support for -p flag to print out PID and program name. +700 bytes of code. - config BUSYBOX_CONFIG_NSLOOKUP bool "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 bool "ntpd" default BUSYBOX_DEFAULT_NTPD @@ -886,20 +735,39 @@ config BUSYBOX_CONFIG_FEATURE_NTPD_CONF help Make ntpd look in /etc/ntp.conf for peers. Only "server address" is supported. +config BUSYBOX_CONFIG_PING + bool "ping" + default BUSYBOX_DEFAULT_PING + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to + elicit an ICMP ECHO_RESPONSE from a host or gateway. +config BUSYBOX_CONFIG_PING6 + bool "ping6" + default BUSYBOX_DEFAULT_PING6 + depends on BUSYBOX_CONFIG_FEATURE_IPV6 + help + This will give you a ping that can talk IPv6. + +config BUSYBOX_CONFIG_FEATURE_FANCY_PING + bool "Enable fancy ping output" + default BUSYBOX_DEFAULT_FEATURE_FANCY_PING + depends on BUSYBOX_CONFIG_PING || BUSYBOX_CONFIG_PING6 + help + Make the output from the ping applet include statistics, and at the + same time provide full support for ICMP packets. config BUSYBOX_CONFIG_PSCAN bool "pscan" default BUSYBOX_DEFAULT_PSCAN help Simple network port scanner. - config BUSYBOX_CONFIG_ROUTE bool "route" default BUSYBOX_DEFAULT_ROUTE select BUSYBOX_CONFIG_PLATFORM_LINUX help Route displays or manipulates the kernel's IP routing tables. - config BUSYBOX_CONFIG_SLATTACH bool "slattach" default BUSYBOX_DEFAULT_SLATTACH @@ -907,17 +775,12 @@ config BUSYBOX_CONFIG_SLATTACH help slattach is a small utility to attach network interfaces to serial lines. - -#config TC -# bool "tc" -# default y -# help -# show / manipulate traffic control settings -# -#config FEATURE_TC_INGRESS -# def_bool n -# depends on TC - +config BUSYBOX_CONFIG_SSL_CLIENT + bool "ssl_client" + default BUSYBOX_DEFAULT_SSL_CLIENT + select BUSYBOX_CONFIG_TLS + help + This tool pipes data to/from a socket, TLS-encrypting it. config BUSYBOX_CONFIG_TCPSVD bool "tcpsvd" default BUSYBOX_DEFAULT_TCPSVD @@ -925,6 +788,12 @@ config BUSYBOX_CONFIG_TCPSVD tcpsvd listens on a TCP port and runs a program for each new connection. +config BUSYBOX_CONFIG_UDPSVD + bool "udpsvd" + default BUSYBOX_DEFAULT_UDPSVD + help + udpsvd listens on an UDP port and runs a program for each new + connection. config BUSYBOX_CONFIG_TELNET bool "telnet" default BUSYBOX_DEFAULT_TELNET @@ -951,6 +820,10 @@ config BUSYBOX_CONFIG_FEATURE_TELNET_AUTOLOGIN log into a machine without telling the username (autologin). This option enables `-a' and `-l USER' arguments. +config BUSYBOX_CONFIG_FEATURE_TELNET_WIDTH + bool "Enable window size autodetection" + default BUSYBOX_DEFAULT_FEATURE_TELNET_WIDTH + depends on BUSYBOX_CONFIG_TELNET config BUSYBOX_CONFIG_TELNETD bool "telnetd" default BUSYBOX_DEFAULT_TELNETD @@ -992,7 +865,6 @@ config BUSYBOX_CONFIG_TELNETD with all that done, telnetd _should_ work.... - config BUSYBOX_CONFIG_FEATURE_TELNETD_STANDALONE bool "Support standalone telnetd (not inetd only)" default BUSYBOX_DEFAULT_FEATURE_TELNETD_STANDALONE @@ -1020,7 +892,6 @@ config BUSYBOX_CONFIG_FEATURE_TELNETD_INETD_WAIT This option is rarely used. "tcp nowait" is much more usual way of running tcp services, including telnetd. You most probably want to say N here. - config BUSYBOX_CONFIG_TFTP bool "tftp" default BUSYBOX_DEFAULT_TFTP @@ -1072,11 +943,9 @@ config BUSYBOX_CONFIG_FEATURE_TFTP_BLOCKSIZE "blksize" and "tsize" options. config BUSYBOX_CONFIG_FEATURE_TFTP_PROGRESS_BAR - bool "Enable tftp progress meter" + bool "Enable progress bar" default BUSYBOX_DEFAULT_FEATURE_TFTP_PROGRESS_BAR depends on BUSYBOX_CONFIG_TFTP && BUSYBOX_CONFIG_FEATURE_TFTP_BLOCKSIZE - help - Show progress bar. config BUSYBOX_CONFIG_TFTP_DEBUG bool "Enable debug" @@ -1085,7 +954,9 @@ config BUSYBOX_CONFIG_TFTP_DEBUG help Make tftp[d] print debugging messages on stderr. This is useful if you are diagnosing a bug in tftp[d]. - +config BUSYBOX_CONFIG_TLS + bool #No description makes it a hidden option + default BUSYBOX_DEFAULT_TLS config BUSYBOX_CONFIG_TRACEROUTE bool "traceroute" default BUSYBOX_DEFAULT_TRACEROUTE @@ -1096,33 +967,22 @@ config BUSYBOX_CONFIG_TRACEROUTE config BUSYBOX_CONFIG_TRACEROUTE6 bool "traceroute6" default BUSYBOX_DEFAULT_TRACEROUTE6 - depends on BUSYBOX_CONFIG_FEATURE_IPV6 && BUSYBOX_CONFIG_TRACEROUTE + depends on BUSYBOX_CONFIG_FEATURE_IPV6 help Utility to trace the route of IPv6 packets. config BUSYBOX_CONFIG_FEATURE_TRACEROUTE_VERBOSE bool "Enable verbose output" default BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_VERBOSE - depends on BUSYBOX_CONFIG_TRACEROUTE + depends on BUSYBOX_CONFIG_TRACEROUTE || BUSYBOX_CONFIG_TRACEROUTE6 help Add some verbosity to traceroute. This includes among other things hostnames and ICMP response types. -config BUSYBOX_CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE - bool "Enable loose source route" - default BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_SOURCE_ROUTE - depends on BUSYBOX_CONFIG_TRACEROUTE - help - Add option to specify a loose source route gateway - (8 maximum). - config BUSYBOX_CONFIG_FEATURE_TRACEROUTE_USE_ICMP - bool "Use ICMP instead of UDP" + bool "Enable -I option (use ICMP instead of UDP)" default BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_USE_ICMP - depends on BUSYBOX_CONFIG_TRACEROUTE - help - Add option -I to use ICMP ECHO instead of UDP datagrams. - + depends on BUSYBOX_CONFIG_TRACEROUTE || BUSYBOX_CONFIG_TRACEROUTE6 config BUSYBOX_CONFIG_TUNCTL bool "tunctl" default BUSYBOX_DEFAULT_TUNCTL @@ -1137,32 +997,123 @@ config BUSYBOX_CONFIG_FEATURE_TUNCTL_UG help Allow to specify owner and group of newly created interface. 340 bytes of pure bloat. Say no here. - -source udhcp/Config.in - -config BUSYBOX_CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS - string "ifup udhcpc command line options" - default BUSYBOX_DEFAULT_IFUPDOWN_UDHCPC_CMD_OPTIONS - depends on BUSYBOX_CONFIG_IFUPDOWN && BUSYBOX_CONFIG_UDHCPC - help - Command line options to pass to udhcpc from ifup. - Intended to alter options not available in /etc/network/interfaces. - (IE: --syslog --background etc...) - -config BUSYBOX_CONFIG_UDPSVD - bool "udpsvd" - default BUSYBOX_DEFAULT_UDPSVD - help - udpsvd listens on an UDP port and runs a program for each new - connection. - config BUSYBOX_CONFIG_VCONFIG bool "vconfig" default BUSYBOX_DEFAULT_VCONFIG select BUSYBOX_CONFIG_PLATFORM_LINUX help Creates, removes, and configures VLAN interfaces +config BUSYBOX_CONFIG_WGET + bool "wget" + default BUSYBOX_DEFAULT_WGET + help + wget is a utility for non-interactive download of files from HTTP + and FTP servers. +config BUSYBOX_CONFIG_FEATURE_WGET_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_WGET_LONG_OPTIONS + depends on BUSYBOX_CONFIG_WGET && BUSYBOX_CONFIG_LONG_OPTS + +config BUSYBOX_CONFIG_FEATURE_WGET_STATUSBAR + bool "Enable progress bar (+2k)" + default BUSYBOX_DEFAULT_FEATURE_WGET_STATUSBAR + depends on BUSYBOX_CONFIG_WGET + +config BUSYBOX_CONFIG_FEATURE_WGET_AUTHENTICATION + bool "Enable HTTP authentication" + default BUSYBOX_DEFAULT_FEATURE_WGET_AUTHENTICATION + depends on BUSYBOX_CONFIG_WGET + help + Support authenticated HTTP transfers. + +config BUSYBOX_CONFIG_FEATURE_WGET_TIMEOUT + bool "Enable timeout option -T SEC" + default BUSYBOX_DEFAULT_FEATURE_WGET_TIMEOUT + depends on BUSYBOX_CONFIG_WGET + help + Supports network read and connect timeouts for wget, + so that wget will give up and timeout, through the -T + command line option. + + Currently only connect and network data read timeout are + supported (i.e., timeout is not applied to the DNS query). When + FEATURE_WGET_LONG_OPTIONS is also enabled, the --timeout option + will work in addition to -T. + +config BUSYBOX_CONFIG_FEATURE_WGET_HTTPS + bool "Support HTTPS using internal TLS code" + default BUSYBOX_DEFAULT_FEATURE_WGET_HTTPS + depends on BUSYBOX_CONFIG_WGET + select BUSYBOX_CONFIG_TLS + help + wget will use internal TLS code to connect to https:// URLs. + Note: + On NOMMU machines, ssl_helper applet should be available + in the $PATH for this to work. Make sure to select that applet. + + Note: currently, TLS code only makes TLS I/O work, it + does *not* check that the peer is who it claims to be, etc. + IOW: it uses peer-supplied public keys to establish encryption + and signing keys, then encrypts and signs outgoing data and + decrypts incoming data. + It does not check signature hashes on the incoming data: + this means that attackers manipulating TCP packets can + send altered data and we unknowingly receive garbage. + (This check might be relatively easy to add). + It does not check public key's certificate: + this means that the peer may be an attacker impersonating + the server we think we are talking to. + + If you think this is unacceptable, consider this. As more and more + servers switch to HTTPS-only operation, without such "crippled" + TLS code it is *impossible* to simply download a kernel source + from kernel.org. Which can in real world translate into + "my small automatic tooling to build cross-compilers from sources + no longer works, I need to additionally keep a local copy + of ~4 megabyte source tarball of a SSL library and ~2 megabyte + source of wget, need to compile and built both before I can + download anything. All this despite the fact that the build + is done in a QEMU sandbox on a machine with absolutely nothing + worth stealing, so I don't care if someone would go to a lot + of trouble to intercept my HTTPS download to send me an altered + kernel tarball". + + If you still think this is unacceptable, send patches. + + If you still think this is unacceptable, do not want to send + patches, but do want to waste bandwidth expaining how wrong + it is, you will be ignored. + +config BUSYBOX_CONFIG_FEATURE_WGET_OPENSSL + bool "Try to connect to HTTPS using openssl" + default BUSYBOX_DEFAULT_FEATURE_WGET_OPENSSL + depends on BUSYBOX_CONFIG_WGET + help + Try to use openssl to handle HTTPS. + + OpenSSL has a simple SSL client for debug purposes. + If you select this option, wget will effectively run: + "openssl s_client -quiet -connect hostname:443 + -servername hostname 2>/dev/null" and pipe its data + through it. -servername is not used if hostname is numeric. + Note inconvenient API: host resolution is done twice, + and there is no guarantee openssl's idea of IPv6 address + format is the same as ours. + Another problem is that s_client prints debug information + to stderr, and it needs to be suppressed. This means + all error messages get suppressed too. + openssl is also a big binary, often dynamically linked + against ~15 libraries. + + If openssl can't be executed, internal TLS code will be used + (if you enabled it); if openssl can be executed but fails later, + wget can't detect this, and download will fail. +config BUSYBOX_CONFIG_WHOIS + bool "whois" + default BUSYBOX_DEFAULT_WHOIS + help + whois is a client for the whois directory service config BUSYBOX_CONFIG_ZCIP bool "zcip" default BUSYBOX_DEFAULT_ZCIP @@ -1176,4 +1127,15 @@ config BUSYBOX_CONFIG_ZCIP See http://www.zeroconf.org for further details, and "zcip.script" in the busybox examples. +source udhcp/Config.in + +config BUSYBOX_CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS + string "ifup udhcpc command line options" + default BUSYBOX_DEFAULT_IFUPDOWN_UDHCPC_CMD_OPTIONS + depends on BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN + help + Command line options to pass to udhcpc from ifup. + Intended to alter options not available in /etc/network/interfaces. + (IE: --syslog --background etc...) + endmenu diff --git a/package/utils/busybox/config/networking/udhcp/Config.in b/package/utils/busybox/config/networking/udhcp/Config.in index 4f4840022..e7a98750d 100644 --- a/package/utils/busybox/config/networking/udhcp/Config.in +++ b/package/utils/busybox/config/networking/udhcp/Config.in @@ -5,38 +5,44 @@ # config BUSYBOX_CONFIG_UDHCPC6 - bool "udhcp client for DHCPv6 (udhcpc6)" + bool "udhcpc6 (DHCPv6 client, EXPERIMENTAL)" default BUSYBOX_DEFAULT_UDHCPC6 # not yet ready depends on BUSYBOX_CONFIG_FEATURE_IPV6 help udhcpc6 is a DHCPv6 client +config BUSYBOX_CONFIG_FEATURE_UDHCPC6_RFC3646 + bool "Support RFC 3646 (DNS server and search list)" + default BUSYBOX_DEFAULT_FEATURE_UDHCPC6_RFC3646 + depends on BUSYBOX_CONFIG_UDHCPC6 + help + List of DNS servers and domain search list can be requested with + "-O dns" and "-O search". If server gives these values, + they will be set in environment variables "dns" and "search". + +config BUSYBOX_CONFIG_FEATURE_UDHCPC6_RFC4704 + bool "Support RFC 4704 (Client FQDN)" + default BUSYBOX_DEFAULT_FEATURE_UDHCPC6_RFC4704 + depends on BUSYBOX_CONFIG_UDHCPC6 + help + You can request FQDN to be given by server using "-O fqdn". + +config BUSYBOX_CONFIG_FEATURE_UDHCPC6_RFC4833 + bool "Support RFC 4833 (Timezones)" + default BUSYBOX_DEFAULT_FEATURE_UDHCPC6_RFC4833 + depends on BUSYBOX_CONFIG_UDHCPC6 + help + You can request POSIX timezone with "-O tz" and timezone name + with "-O timezone". + config BUSYBOX_CONFIG_UDHCPD - bool "udhcp server (udhcpd)" + bool "udhcpd (DHCP server)" default BUSYBOX_DEFAULT_UDHCPD select BUSYBOX_CONFIG_PLATFORM_LINUX help udhcpd is a DHCP server geared primarily toward embedded systems, while striving to be fully functional and RFC compliant. -config BUSYBOX_CONFIG_DHCPRELAY - bool "dhcprelay" - default BUSYBOX_DEFAULT_DHCPRELAY - depends on BUSYBOX_CONFIG_UDHCPD - help - dhcprelay listens for dhcp requests on one or more interfaces - and forwards these requests to a different interface or dhcp - server. - -config BUSYBOX_CONFIG_DUMPLEASES - bool "Lease display utility (dumpleases)" - default BUSYBOX_DEFAULT_DUMPLEASES - depends on BUSYBOX_CONFIG_UDHCPD - help - dumpleases displays the leases written out by the udhcpd server. - Lease times are stored in the file by time remaining in lease, or - by the absolute time that it expires in seconds from epoch. - config BUSYBOX_CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY bool "Rewrite the lease file at every new acknowledge" default BUSYBOX_DEFAULT_FEATURE_UDHCPD_WRITE_LEASES_EARLY @@ -69,8 +75,24 @@ config BUSYBOX_CONFIG_DHCPD_LEASES_FILE udhcpd stores addresses in a lease file. This is the absolute path of the file. Normally it is safe to leave it untouched. +config BUSYBOX_CONFIG_DUMPLEASES + bool "dumpleases" + default BUSYBOX_DEFAULT_DUMPLEASES + help + dumpleases displays the leases written out by the udhcpd. + Lease times are stored in the file by time remaining in lease, or + by the absolute time that it expires in seconds from epoch. + +config BUSYBOX_CONFIG_DHCPRELAY + bool "dhcprelay" + default BUSYBOX_DEFAULT_DHCPRELAY + help + dhcprelay listens for dhcp requests on one or more interfaces + and forwards these requests to a different interface or dhcp + server. + config BUSYBOX_CONFIG_UDHCPC - bool "udhcp client (udhcpc)" + bool "udhcpc (DHCP client)" default BUSYBOX_DEFAULT_UDHCPC select BUSYBOX_CONFIG_PLATFORM_LINUX help @@ -101,6 +123,15 @@ config BUSYBOX_CONFIG_FEATURE_UDHCPC_SANITIZEOPT they will be replaced with string "bad" when exporting to the environment. +config BUSYBOX_CONFIG_UDHCPC_DEFAULT_SCRIPT + string "Absolute path to config script" + default BUSYBOX_DEFAULT_UDHCPC_DEFAULT_SCRIPT + depends on BUSYBOX_CONFIG_UDHCPC + help + This script is called after udhcpc receives an answer. See + examples/udhcp for a working example. Normally it is safe + to leave this untouched. + config BUSYBOX_CONFIG_FEATURE_UDHCP_PORT bool "Enable '-P port' option for udhcpd and udhcpc" default BUSYBOX_DEFAULT_FEATURE_UDHCP_PORT @@ -122,7 +153,7 @@ config BUSYBOX_CONFIG_UDHCP_DEBUG are very verbose and useful for debugging only. config BUSYBOX_CONFIG_FEATURE_UDHCP_RFC3397 - bool "Support for RFC3397 domain search (experimental)" + bool "Support RFC3397 domain search (experimental)" default BUSYBOX_DEFAULT_FEATURE_UDHCP_RFC3397 depends on BUSYBOX_CONFIG_UDHCPD || BUSYBOX_CONFIG_UDHCPC help @@ -131,22 +162,13 @@ config BUSYBOX_CONFIG_FEATURE_UDHCP_RFC3397 and SIP servers option 120, specified in RFC 3361. config BUSYBOX_CONFIG_FEATURE_UDHCP_8021Q - bool "Support for 802.1Q VLAN parameters" + bool "Support 802.1Q VLAN parameters" default BUSYBOX_DEFAULT_FEATURE_UDHCP_8021Q depends on BUSYBOX_CONFIG_UDHCPD || BUSYBOX_CONFIG_UDHCPC help If selected, both client and server will support passing of VLAN ID and priority via options 132 and 133 as per 802.1Q. -config BUSYBOX_CONFIG_UDHCPC_DEFAULT_SCRIPT - string "Absolute path to config script" - default BUSYBOX_DEFAULT_UDHCPC_DEFAULT_SCRIPT - depends on BUSYBOX_CONFIG_UDHCPC - help - This script is called after udhcpc receives an answer. See - examples/udhcp for a working example. Normally it is safe - to leave this untouched. - config BUSYBOX_CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS int "DHCP options slack buffer size" default BUSYBOX_DEFAULT_UDHCPC_SLACK_FOR_BUGGY_SERVERS diff --git a/package/utils/busybox/config/procps/Config.in b/package/utils/busybox/config/procps/Config.in index 6eafbda0f..acd4ed882 100644 --- a/package/utils/busybox/config/procps/Config.in +++ b/package/utils/busybox/config/procps/Config.in @@ -6,11 +6,50 @@ menu "Process Utilities" +config BUSYBOX_CONFIG_FREE + bool "free" + default BUSYBOX_DEFAULT_FREE + select BUSYBOX_CONFIG_PLATFORM_LINUX #sysinfo() + help + free displays the total amount of free and used physical and swap + memory in the system, as well as the buffers used by the kernel. + The shared memory column should be ignored; it is obsolete. +config BUSYBOX_CONFIG_FUSER + bool "fuser" + default BUSYBOX_DEFAULT_FUSER + help + fuser lists all PIDs (Process IDs) that currently have a given + file open. fuser can also list all PIDs that have a given network + (TCP or UDP) port open. config BUSYBOX_CONFIG_IOSTAT bool "iostat" default BUSYBOX_DEFAULT_IOSTAT help Report CPU and I/O statistics +config BUSYBOX_CONFIG_KILL + bool "kill" + default BUSYBOX_DEFAULT_KILL + help + The command kill sends the specified signal to the specified + process or process group. If no signal is specified, the TERM + signal is sent. + +config BUSYBOX_CONFIG_KILLALL + bool "killall" + default BUSYBOX_DEFAULT_KILLALL + help + killall sends a signal to all processes running any of the + specified commands. If no signal name is specified, SIGTERM is + sent. + +config BUSYBOX_CONFIG_KILLALL5 + bool "killall5" + default BUSYBOX_DEFAULT_KILLALL5 + help + The SystemV killall command. killall5 sends a signal + to all processes except kernel threads and the processes + in its own session, so it won't kill the shell that is running + the script it was called from. config BUSYBOX_CONFIG_LSOF bool "lsof" default BUSYBOX_DEFAULT_LSOF @@ -27,6 +66,39 @@ config BUSYBOX_CONFIG_NMETER default BUSYBOX_DEFAULT_NMETER help Prints selected system stats continuously, one line per update. +config BUSYBOX_CONFIG_PGREP + bool "pgrep" + default BUSYBOX_DEFAULT_PGREP + help + Look for processes by name. + +config BUSYBOX_CONFIG_PKILL + bool "pkill" + default BUSYBOX_DEFAULT_PKILL + help + Send signals to processes by name. +config BUSYBOX_CONFIG_PIDOF + bool "pidof" + default BUSYBOX_DEFAULT_PIDOF + help + Pidof finds the process id's (pids) of the named programs. It prints + those id's on the standard output. + +config BUSYBOX_CONFIG_FEATURE_PIDOF_SINGLE + bool "Enable single shot (-s)" + default BUSYBOX_DEFAULT_FEATURE_PIDOF_SINGLE + depends on BUSYBOX_CONFIG_PIDOF + help + Support '-s' for returning only the first pid found. + +config BUSYBOX_CONFIG_FEATURE_PIDOF_OMIT + bool "Enable omitting pids (-o PID)" + default BUSYBOX_DEFAULT_FEATURE_PIDOF_OMIT + depends on BUSYBOX_CONFIG_PIDOF + help + Support '-o PID' for omitting the given pid(s) in output. + The special pid %PPID can be used to name the parent process + of the pidof, in other words the calling shell or shell script. config BUSYBOX_CONFIG_PMAP bool "pmap" default BUSYBOX_DEFAULT_PMAP @@ -37,6 +109,55 @@ config BUSYBOX_CONFIG_POWERTOP default BUSYBOX_DEFAULT_POWERTOP help Analyze power consumption on Intel-based laptops + +config BUSYBOX_CONFIG_FEATURE_POWERTOP_INTERACTIVE + bool "Accept keyboard commands" + default BUSYBOX_DEFAULT_FEATURE_POWERTOP_INTERACTIVE + depends on BUSYBOX_CONFIG_POWERTOP + help + Without this, powertop will only refresh display every 10 seconds. + No keyboard commands will work, only ^C to terminate. +config BUSYBOX_CONFIG_PS + bool "ps" + default BUSYBOX_DEFAULT_PS + help + ps gives a snapshot of the current processes. + +config BUSYBOX_CONFIG_FEATURE_PS_WIDE + bool "Enable wide output option (-w)" + default BUSYBOX_DEFAULT_FEATURE_PS_WIDE + depends on BUSYBOX_CONFIG_PS && !BUSYBOX_CONFIG_DESKTOP + help + Support argument 'w' for wide output. + If given once, 132 chars are printed, and if given more + than once, the length is unlimited. + +config BUSYBOX_CONFIG_FEATURE_PS_LONG + bool "Enable long output option (-l)" + default BUSYBOX_DEFAULT_FEATURE_PS_LONG + depends on BUSYBOX_CONFIG_PS && !BUSYBOX_CONFIG_DESKTOP + help + Support argument 'l' for long output. + Adds fields PPID, RSS, START, TIME & TTY + +config BUSYBOX_CONFIG_FEATURE_PS_TIME + bool "Support -o time and -o etime output specifiers" + default BUSYBOX_DEFAULT_FEATURE_PS_TIME + depends on BUSYBOX_CONFIG_PS && BUSYBOX_CONFIG_DESKTOP + select BUSYBOX_CONFIG_PLATFORM_LINUX + +config BUSYBOX_CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS + bool "Support Linux prior to 2.4.0 and non-ELF systems" + default BUSYBOX_DEFAULT_FEATURE_PS_UNUSUAL_SYSTEMS + depends on BUSYBOX_CONFIG_FEATURE_PS_TIME + help + Include support for measuring HZ on old kernels and non-ELF systems + (if you are on Linux 2.4.0+ and use ELF, you don't need this) + +config BUSYBOX_CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS + bool "Support -o rgroup, -o ruser, -o nice specifiers" + default BUSYBOX_DEFAULT_FEATURE_PS_ADDITIONAL_COLUMNS + depends on BUSYBOX_CONFIG_PS && BUSYBOX_CONFIG_DESKTOP config BUSYBOX_CONFIG_PSTREE bool "pstree" default BUSYBOX_DEFAULT_PSTREE @@ -53,6 +174,11 @@ config BUSYBOX_CONFIG_SMEMCAP help smemcap is a tool for capturing process data for smem, a memory usage statistic tool. +config BUSYBOX_CONFIG_BB_SYSCTL + bool "sysctl" + default BUSYBOX_DEFAULT_BB_SYSCTL + help + Configure kernel parameters at runtime. config BUSYBOX_CONFIG_TOP bool "top" default BUSYBOX_DEFAULT_TOP @@ -60,6 +186,14 @@ config BUSYBOX_CONFIG_TOP The top program provides a dynamic real-time view of a running system. +config BUSYBOX_CONFIG_FEATURE_TOP_INTERACTIVE + bool "Accept keyboard commands" + default BUSYBOX_DEFAULT_FEATURE_TOP_INTERACTIVE + depends on BUSYBOX_CONFIG_TOP + help + Without this, top will only refresh display every 5 seconds. + No keyboard commands will work, only ^C to terminate. + config BUSYBOX_CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE bool "Show CPU per-process usage percentage" default BUSYBOX_DEFAULT_FEATURE_TOP_CPU_USAGE_PERCENTAGE @@ -116,153 +250,11 @@ config BUSYBOX_CONFIG_UPTIME on, and the system load averages for the past 1, 5, and 15 minutes. config BUSYBOX_CONFIG_FEATURE_UPTIME_UTMP_SUPPORT - bool "Support for showing the number of users" + bool "Show the number of users" default BUSYBOX_DEFAULT_FEATURE_UPTIME_UTMP_SUPPORT depends on BUSYBOX_CONFIG_UPTIME && BUSYBOX_CONFIG_FEATURE_UTMP help - Makes uptime display the number of users currently logged on. - -config BUSYBOX_CONFIG_FREE - bool "free" - default BUSYBOX_DEFAULT_FREE - select BUSYBOX_CONFIG_PLATFORM_LINUX #sysinfo() - help - free displays the total amount of free and used physical and swap - memory in the system, as well as the buffers used by the kernel. - The shared memory column should be ignored; it is obsolete. - -config BUSYBOX_CONFIG_FUSER - bool "fuser" - default BUSYBOX_DEFAULT_FUSER - help - fuser lists all PIDs (Process IDs) that currently have a given - file open. fuser can also list all PIDs that have a given network - (TCP or UDP) port open. - -config BUSYBOX_CONFIG_KILL - bool "kill" - default BUSYBOX_DEFAULT_KILL - help - The command kill sends the specified signal to the specified - process or process group. If no signal is specified, the TERM - signal is sent. - -config BUSYBOX_CONFIG_KILLALL - bool "killall" - default BUSYBOX_DEFAULT_KILLALL - depends on BUSYBOX_CONFIG_KILL - help - killall sends a signal to all processes running any of the - specified commands. If no signal name is specified, SIGTERM is - sent. - -config BUSYBOX_CONFIG_KILLALL5 - bool "killall5" - default BUSYBOX_DEFAULT_KILLALL5 - depends on BUSYBOX_CONFIG_KILL - -config BUSYBOX_CONFIG_PGREP - bool "pgrep" - default BUSYBOX_DEFAULT_PGREP - help - Look for processes by name. - -config BUSYBOX_CONFIG_PIDOF - bool "pidof" - default BUSYBOX_DEFAULT_PIDOF - help - Pidof finds the process id's (pids) of the named programs. It prints - those id's on the standard output. - -config BUSYBOX_CONFIG_FEATURE_PIDOF_SINGLE - bool "Enable argument for single shot (-s)" - default BUSYBOX_DEFAULT_FEATURE_PIDOF_SINGLE - depends on BUSYBOX_CONFIG_PIDOF - help - Support argument '-s' for returning only the first pid found. - -config BUSYBOX_CONFIG_FEATURE_PIDOF_OMIT - bool "Enable argument for omitting pids (-o)" - default BUSYBOX_DEFAULT_FEATURE_PIDOF_OMIT - depends on BUSYBOX_CONFIG_PIDOF - help - Support argument '-o' for omitting the given pids in output. - The special pid %PPID can be used to name the parent process - of the pidof, in other words the calling shell or shell script. - -config BUSYBOX_CONFIG_PKILL - bool "pkill" - default BUSYBOX_DEFAULT_PKILL - help - Send signals to processes by name. - -config BUSYBOX_CONFIG_PS - bool "ps" - default BUSYBOX_DEFAULT_PS - help - ps gives a snapshot of the current processes. - -config BUSYBOX_CONFIG_FEATURE_PS_WIDE - bool "Enable wide output option (-w)" - default BUSYBOX_DEFAULT_FEATURE_PS_WIDE - depends on BUSYBOX_CONFIG_PS && !BUSYBOX_CONFIG_DESKTOP - help - Support argument 'w' for wide output. - If given once, 132 chars are printed, and if given more - than once, the length is unlimited. - -config BUSYBOX_CONFIG_FEATURE_PS_LONG - bool "Enable long output option (-l)" - default BUSYBOX_DEFAULT_FEATURE_PS_LONG - depends on BUSYBOX_CONFIG_PS && !BUSYBOX_CONFIG_DESKTOP - help - Support argument 'l' for long output. - Adds fields PPID, RSS, START, TIME & TTY - -config BUSYBOX_CONFIG_FEATURE_PS_TIME - bool "Enable time and elapsed time output" - default BUSYBOX_DEFAULT_FEATURE_PS_TIME - depends on BUSYBOX_CONFIG_PS && BUSYBOX_CONFIG_DESKTOP - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Support -o time and -o etime output specifiers. - -config BUSYBOX_CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS - bool "Enable additional ps columns" - default BUSYBOX_DEFAULT_FEATURE_PS_ADDITIONAL_COLUMNS - depends on BUSYBOX_CONFIG_PS && BUSYBOX_CONFIG_DESKTOP - help - Support -o rgroup, -o ruser, -o nice output specifiers. - -config BUSYBOX_CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS - bool "Support Linux prior to 2.4.0 and non-ELF systems" - default BUSYBOX_DEFAULT_FEATURE_PS_UNUSUAL_SYSTEMS - depends on BUSYBOX_CONFIG_FEATURE_PS_TIME - help - Include support for measuring HZ on old kernels and non-ELF systems - (if you are on Linux 2.4.0+ and use ELF, you don't need this) - -config BUSYBOX_CONFIG_RENICE - bool "renice" - default BUSYBOX_DEFAULT_RENICE - help - Renice alters the scheduling priority of one or more running - processes. - -config BUSYBOX_CONFIG_BB_SYSCTL - bool "sysctl" - default BUSYBOX_DEFAULT_BB_SYSCTL - help - Configure kernel parameters at runtime. - -config BUSYBOX_CONFIG_FEATURE_SHOW_THREADS - bool "Support for showing threads in ps/pstree/top" - default BUSYBOX_DEFAULT_FEATURE_SHOW_THREADS - depends on BUSYBOX_CONFIG_PS || BUSYBOX_CONFIG_TOP || BUSYBOX_CONFIG_PSTREE - help - Enables the ps -T option, showing of threads in pstree, - and 'h' command in top. - + Display the number of users currently logged on. config BUSYBOX_CONFIG_WATCH bool "watch" default BUSYBOX_DEFAULT_WATCH @@ -270,4 +262,12 @@ config BUSYBOX_CONFIG_WATCH watch is used to execute a program periodically, showing output to the screen. +config BUSYBOX_CONFIG_FEATURE_SHOW_THREADS + bool "Support thread display in ps/pstree/top" + default BUSYBOX_DEFAULT_FEATURE_SHOW_THREADS + depends on BUSYBOX_CONFIG_PS || BUSYBOX_CONFIG_TOP || BUSYBOX_CONFIG_PSTREE + help + Enables the ps -T option, showing of threads in pstree, + and 'h' command in top. + endmenu diff --git a/package/utils/busybox/config/runit/Config.in b/package/utils/busybox/config/runit/Config.in index a322a2cd8..8750b597e 100644 --- a/package/utils/busybox/config/runit/Config.in +++ b/package/utils/busybox/config/runit/Config.in @@ -73,6 +73,13 @@ config BUSYBOX_CONFIG_SV_DEFAULT_SERVICE_DIR help Default directory for services. Defaults to "/var/service" + +config BUSYBOX_CONFIG_SVC + bool "svc" + default BUSYBOX_DEFAULT_SVC + help + svc controls the state of services monitored by the runsv supervisor. + It is comaptible with daemontools command with the same name. config BUSYBOX_CONFIG_SVLOGD bool "svlogd" default BUSYBOX_DEFAULT_SVLOGD diff --git a/package/utils/busybox/config/selinux/Config.in b/package/utils/busybox/config/selinux/Config.in index 1d23f7de4..71eb0dcd7 100644 --- a/package/utils/busybox/config/selinux/Config.in +++ b/package/utils/busybox/config/selinux/Config.in @@ -7,7 +7,6 @@ menu "SELinux Utilities" depends on BUSYBOX_CONFIG_SELINUX - config BUSYBOX_CONFIG_CHCON bool "chcon" default BUSYBOX_DEFAULT_CHCON @@ -19,30 +18,24 @@ config BUSYBOX_CONFIG_FEATURE_CHCON_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_CHCON_LONG_OPTIONS depends on BUSYBOX_CONFIG_CHCON && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the chcon applet. - config BUSYBOX_CONFIG_GETENFORCE bool "getenforce" default BUSYBOX_DEFAULT_GETENFORCE depends on BUSYBOX_CONFIG_SELINUX help Enable support to get the current mode of SELinux. - config BUSYBOX_CONFIG_GETSEBOOL bool "getsebool" default BUSYBOX_DEFAULT_GETSEBOOL depends on BUSYBOX_CONFIG_SELINUX help Enable support to get SELinux boolean values. - config BUSYBOX_CONFIG_LOAD_POLICY bool "load_policy" default BUSYBOX_DEFAULT_LOAD_POLICY depends on BUSYBOX_CONFIG_SELINUX help Enable support to load SELinux policy. - config BUSYBOX_CONFIG_MATCHPATHCON bool "matchpathcon" default BUSYBOX_DEFAULT_MATCHPATHCON @@ -50,15 +43,6 @@ config BUSYBOX_CONFIG_MATCHPATHCON help Enable support to get default security context of the specified path from the file contexts configuration. - -config BUSYBOX_CONFIG_RESTORECON - bool "restorecon" - default BUSYBOX_DEFAULT_RESTORECON - depends on BUSYBOX_CONFIG_SELINUX - help - Enable support to relabel files. The feature is almost - the same as setfiles, but usage is a little different. - config BUSYBOX_CONFIG_RUNCON bool "runcon" default BUSYBOX_DEFAULT_RUNCON @@ -70,9 +54,6 @@ config BUSYBOX_CONFIG_FEATURE_RUNCON_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_RUNCON_LONG_OPTIONS depends on BUSYBOX_CONFIG_RUNCON && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the runcon applet. - config BUSYBOX_CONFIG_SELINUXENABLED bool "selinuxenabled" default BUSYBOX_DEFAULT_SELINUXENABLED @@ -80,14 +61,18 @@ config BUSYBOX_CONFIG_SELINUXENABLED help Enable support for this command to be used within shell scripts to determine if selinux is enabled. - +config BUSYBOX_CONFIG_SESTATUS + bool "sestatus" + default BUSYBOX_DEFAULT_SESTATUS + depends on BUSYBOX_CONFIG_SELINUX + help + Displays the status of SELinux. config BUSYBOX_CONFIG_SETENFORCE bool "setenforce" default BUSYBOX_DEFAULT_SETENFORCE depends on BUSYBOX_CONFIG_SELINUX help Enable support to modify the mode SELinux is running in. - config BUSYBOX_CONFIG_SETFILES bool "setfiles" default BUSYBOX_DEFAULT_SETFILES @@ -106,6 +91,13 @@ config BUSYBOX_CONFIG_FEATURE_SETFILES_CHECK_OPTION Support "-c" option (check the validity of the contexts against the specified binary policy) for setfiles. Requires libsepol. +config BUSYBOX_CONFIG_RESTORECON + bool "restorecon" + default BUSYBOX_DEFAULT_RESTORECON + depends on BUSYBOX_CONFIG_SELINUX + help + Enable support to relabel files. The feature is almost + the same as setfiles, but usage is a little different. config BUSYBOX_CONFIG_SETSEBOOL bool "setsebool" default BUSYBOX_DEFAULT_SETSEBOOL @@ -114,11 +106,4 @@ config BUSYBOX_CONFIG_SETSEBOOL Enable support for change boolean. semanage and -P option is not supported yet. -config BUSYBOX_CONFIG_SESTATUS - bool "sestatus" - default BUSYBOX_DEFAULT_SESTATUS - depends on BUSYBOX_CONFIG_SELINUX - help - Displays the status of SELinux. - endmenu diff --git a/package/utils/busybox/config/shell/Config.in b/package/utils/busybox/config/shell/Config.in index 69ecf145e..e455d3832 100644 --- a/package/utils/busybox/config/shell/Config.in +++ b/package/utils/busybox/config/shell/Config.in @@ -6,6 +6,78 @@ menu "Shells" + +choice + prompt "Choose which shell is aliased to 'sh' name" + default BUSYBOX_CONFIG_SH_IS_ASH + help + Choose which shell you want to be executed by 'sh' alias. + The ash shell is the most bash compatible and full featured one. + +# note: cannot use "select ASH" here, it breaks "make allnoconfig" +config BUSYBOX_CONFIG_SH_IS_ASH + depends on !BUSYBOX_CONFIG_NOMMU + bool "ash" + help + Choose ash to be the shell executed by 'sh' name. + The ash code will be built into busybox. If you don't select + "ash" choice (CONFIG_ASH), this shell may only be invoked by + the name 'sh' (and not 'ash'). + +config BUSYBOX_CONFIG_SH_IS_HUSH + bool "hush" + help + Choose hush to be the shell executed by 'sh' name. + The hush code will be built into busybox. If you don't select + "hush" choice (CONFIG_HUSH), this shell may only be invoked by + the name 'sh' (and not 'hush'). + +config BUSYBOX_CONFIG_SH_IS_NONE + bool "none" + +endchoice + +choice + prompt "Choose which shell is aliased to 'bash' name" + default BUSYBOX_CONFIG_BASH_IS_NONE + help + Choose which shell you want to be executed by 'bash' alias. + The ash shell is the most bash compatible and full featured one, + although compatibility is far from being complete. + + Note that selecting this option does not switch on any bash + compatibility code. It merely makes it possible to install + /bin/bash (sym)link and run scripts which start with + #!/bin/bash line. + + Many systems use it in scripts which use bash-specific features, + even simple ones like $RANDOM. Without this option, busybox + can't be used for running them because it won't recongnize + "bash" as a supported applet name. + +config BUSYBOX_CONFIG_BASH_IS_ASH + depends on !BUSYBOX_CONFIG_NOMMU + bool "ash" + help + Choose ash to be the shell executed by 'bash' name. + The ash code will be built into busybox. If you don't select + "ash" choice (CONFIG_ASH), this shell may only be invoked by + the name 'bash' (and not 'ash'). + +config BUSYBOX_CONFIG_BASH_IS_HUSH + bool "hush" + help + Choose hush to be the shell executed by 'bash' name. + The hush code will be built into busybox. If you don't select + "hush" choice (CONFIG_HUSH), this shell may only be invoked by + the name 'bash' (and not 'hush'). + +config BUSYBOX_CONFIG_BASH_IS_NONE + bool "none" + +endchoice + + config BUSYBOX_CONFIG_ASH bool "ash" default BUSYBOX_DEFAULT_ASH @@ -17,96 +89,46 @@ config BUSYBOX_CONFIG_ASH shell (by Herbert Xu), which was created by porting the 'ash' shell (written by Kenneth Almquist) from NetBSD. -config BUSYBOX_CONFIG_ASH_BASH_COMPAT - bool "bash-compatible extensions" - default BUSYBOX_DEFAULT_ASH_BASH_COMPAT - depends on BUSYBOX_CONFIG_ASH - help - Enable bash-compatible extensions. - -config BUSYBOX_CONFIG_ASH_IDLE_TIMEOUT - bool "Idle timeout variable" - default BUSYBOX_DEFAULT_ASH_IDLE_TIMEOUT - depends on BUSYBOX_CONFIG_ASH - help - Enables bash-like auto-logout after $TMOUT seconds of idle time. - -config BUSYBOX_CONFIG_ASH_JOB_CONTROL - bool "Job control" - default BUSYBOX_DEFAULT_ASH_JOB_CONTROL - depends on BUSYBOX_CONFIG_ASH - help - Enable job control in the ash shell. - -config BUSYBOX_CONFIG_ASH_ALIAS - bool "Alias support" - default BUSYBOX_DEFAULT_ASH_ALIAS - depends on BUSYBOX_CONFIG_ASH - help - Enable alias support in the ash shell. - -config BUSYBOX_CONFIG_ASH_GETOPTS - bool "Builtin getopt to parse positional parameters" - default BUSYBOX_DEFAULT_ASH_GETOPTS - depends on BUSYBOX_CONFIG_ASH - help - Enable support for getopts builtin in ash. - -config BUSYBOX_CONFIG_ASH_BUILTIN_ECHO - bool "Builtin version of 'echo'" - default BUSYBOX_DEFAULT_ASH_BUILTIN_ECHO - depends on BUSYBOX_CONFIG_ASH - help - Enable support for echo builtin in ash. - -config BUSYBOX_CONFIG_ASH_BUILTIN_PRINTF - bool "Builtin version of 'printf'" - default BUSYBOX_DEFAULT_ASH_BUILTIN_PRINTF - depends on BUSYBOX_CONFIG_ASH - help - Enable support for printf builtin in ash. - -config BUSYBOX_CONFIG_ASH_BUILTIN_TEST - bool "Builtin version of 'test'" - default BUSYBOX_DEFAULT_ASH_BUILTIN_TEST - depends on BUSYBOX_CONFIG_ASH - help - Enable support for test builtin in ash. - -config BUSYBOX_CONFIG_ASH_HELP - bool "help builtin" - default BUSYBOX_DEFAULT_ASH_HELP - depends on BUSYBOX_CONFIG_ASH - help - Enable help builtin in ash. - -config BUSYBOX_CONFIG_ASH_CMDCMD - bool "'command' command to override shell builtins" - default BUSYBOX_DEFAULT_ASH_CMDCMD - depends on BUSYBOX_CONFIG_ASH - help - Enable support for the ash 'command' builtin, which allows - you to run the specified command with the specified arguments, - even when there is an ash builtin command with the same name. - -config BUSYBOX_CONFIG_ASH_MAIL - bool "Check for new mail on interactive shells" - default BUSYBOX_DEFAULT_ASH_MAIL - depends on BUSYBOX_CONFIG_ASH - help - Enable "check for new mail" function in the ash shell. +# ash options +# note: Don't remove !NOMMU part in the next line; it would break +# menuconfig's indenting. +if !NOMMU && (BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH) config BUSYBOX_CONFIG_ASH_OPTIMIZE_FOR_SIZE bool "Optimize for size instead of speed" default BUSYBOX_DEFAULT_ASH_OPTIMIZE_FOR_SIZE - depends on BUSYBOX_CONFIG_ASH + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + +config BUSYBOX_CONFIG_ASH_INTERNAL_GLOB + bool "Use internal glob() implementation" + default BUSYBOX_DEFAULT_ASH_INTERNAL_GLOB # Y is bigger, but because of uclibc glob() bug, let Y be default for now + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH help - Compile ash for reduced size at the price of speed. + Do not use glob() function from libc, use internal implementation. + Use this if you are getting "glob.h: No such file or directory" + or similar build errors. + Note that as of now (2017-01), uclibc and musl glob() both have bugs + which would break ash if you select N here. + +config BUSYBOX_CONFIG_ASH_BASH_COMPAT + bool "bash-compatible extensions" + default BUSYBOX_DEFAULT_ASH_BASH_COMPAT + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + +config BUSYBOX_CONFIG_ASH_JOB_CONTROL + bool "Job control" + default BUSYBOX_DEFAULT_ASH_JOB_CONTROL + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + +config BUSYBOX_CONFIG_ASH_ALIAS + bool "Alias support" + default BUSYBOX_DEFAULT_ASH_ALIAS + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH config BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT bool "Pseudorandom generator and $RANDOM variable" default BUSYBOX_DEFAULT_ASH_RANDOM_SUPPORT - depends on BUSYBOX_CONFIG_ASH + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH help Enable pseudorandom generator and dynamic variable "$RANDOM". Each read of "$RANDOM" will generate a new pseudorandom value. @@ -117,12 +139,64 @@ config BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT config BUSYBOX_CONFIG_ASH_EXPAND_PRMT bool "Expand prompt string" default BUSYBOX_DEFAULT_ASH_EXPAND_PRMT - depends on BUSYBOX_CONFIG_ASH + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH help - "PS#" may contain volatile content, such as backquote commands. + $PS# may contain volatile content, such as backquote commands. This option recreates the prompt string from the environment variable each time it is displayed. +config BUSYBOX_CONFIG_ASH_IDLE_TIMEOUT + bool "Idle timeout variable $TMOUT" + default BUSYBOX_DEFAULT_ASH_IDLE_TIMEOUT + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + help + Enable bash-like auto-logout after $TMOUT seconds of idle time. + +config BUSYBOX_CONFIG_ASH_MAIL + bool "Check for new mail in interactive shell" + default BUSYBOX_DEFAULT_ASH_MAIL + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + help + Enable "check for new mail" function: + if set, $MAIL file and $MAILPATH list of files + are checked for mtime changes, and "you have mail" + message is printed if change is detected. + +config BUSYBOX_CONFIG_ASH_ECHO + bool "echo builtin" + default BUSYBOX_DEFAULT_ASH_ECHO + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + +config BUSYBOX_CONFIG_ASH_PRINTF + bool "printf builtin" + default BUSYBOX_DEFAULT_ASH_PRINTF + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + +config BUSYBOX_CONFIG_ASH_TEST + bool "test builtin" + default BUSYBOX_DEFAULT_ASH_TEST + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + +config BUSYBOX_CONFIG_ASH_HELP + bool "help builtin" + default BUSYBOX_DEFAULT_ASH_HELP + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + +config BUSYBOX_CONFIG_ASH_GETOPTS + bool "getopts builtin" + default BUSYBOX_DEFAULT_ASH_GETOPTS + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + +config BUSYBOX_CONFIG_ASH_CMDCMD + bool "command builtin" + default BUSYBOX_DEFAULT_ASH_CMDCMD + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + help + Enable support for the 'command' builtin, which allows + you to run the specified command or builtin, + even when there is a function with the same name. + +endif # ash options config BUSYBOX_CONFIG_CTTYHACK bool "cttyhack" default BUSYBOX_DEFAULT_CTTYHACK @@ -183,9 +257,7 @@ config BUSYBOX_CONFIG_HUSH config BUSYBOX_CONFIG_HUSH_BASH_COMPAT bool "bash-compatible extensions" default BUSYBOX_DEFAULT_HUSH_BASH_COMPAT - depends on BUSYBOX_CONFIG_HUSH - help - Enable bash-compatible extensions. + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH config BUSYBOX_CONFIG_HUSH_BRACE_EXPANSION bool "Brace expansion" @@ -194,17 +266,10 @@ config BUSYBOX_CONFIG_HUSH_BRACE_EXPANSION help Enable {abc,def} extension. -config BUSYBOX_CONFIG_HUSH_HELP - bool "help builtin" - default BUSYBOX_DEFAULT_HUSH_HELP - depends on BUSYBOX_CONFIG_HUSH - help - Enable help builtin in hush. Code size + ~1 kbyte. - config BUSYBOX_CONFIG_HUSH_INTERACTIVE bool "Interactive mode" default BUSYBOX_DEFAULT_HUSH_INTERACTIVE - depends on BUSYBOX_CONFIG_HUSH + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help Enable interactive mode (prompt and command editing). Without this, hush simply reads and executes commands @@ -215,8 +280,6 @@ config BUSYBOX_CONFIG_HUSH_SAVEHISTORY bool "Save command history to .hush_history" default BUSYBOX_DEFAULT_HUSH_SAVEHISTORY depends on BUSYBOX_CONFIG_HUSH_INTERACTIVE && BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY - help - Enable history saving in hush. config BUSYBOX_CONFIG_HUSH_JOB bool "Job control" @@ -230,42 +293,38 @@ config BUSYBOX_CONFIG_HUSH_JOB but no separate process group is formed. config BUSYBOX_CONFIG_HUSH_TICK - bool "Process substitution" + bool "Support process substitution" default BUSYBOX_DEFAULT_HUSH_TICK - depends on BUSYBOX_CONFIG_HUSH + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help - Enable process substitution `command` and $(command) in hush. + Enable `command` and $(command). config BUSYBOX_CONFIG_HUSH_IF bool "Support if/then/elif/else/fi" default BUSYBOX_DEFAULT_HUSH_IF - depends on BUSYBOX_CONFIG_HUSH - help - Enable if/then/elif/else/fi in hush. + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH config BUSYBOX_CONFIG_HUSH_LOOPS bool "Support for, while and until loops" default BUSYBOX_DEFAULT_HUSH_LOOPS - depends on BUSYBOX_CONFIG_HUSH - help - Enable for, while and until loops in hush. + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH config BUSYBOX_CONFIG_HUSH_CASE bool "Support case ... esac statement" default BUSYBOX_DEFAULT_HUSH_CASE - depends on BUSYBOX_CONFIG_HUSH + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help - Enable case ... esac statement in hush. +400 bytes. + Enable case ... esac statement. +400 bytes. config BUSYBOX_CONFIG_HUSH_FUNCTIONS bool "Support funcname() { commands; } syntax" default BUSYBOX_DEFAULT_HUSH_FUNCTIONS - depends on BUSYBOX_CONFIG_HUSH + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help - Enable support for shell functions in hush. +800 bytes. + Enable support for shell functions. +800 bytes. config BUSYBOX_CONFIG_HUSH_LOCAL - bool "Support local builtin" + bool "local builtin" default BUSYBOX_DEFAULT_HUSH_LOCAL depends on BUSYBOX_CONFIG_HUSH_FUNCTIONS help @@ -274,26 +333,101 @@ config BUSYBOX_CONFIG_HUSH_LOCAL config BUSYBOX_CONFIG_HUSH_RANDOM_SUPPORT bool "Pseudorandom generator and $RANDOM variable" default BUSYBOX_DEFAULT_HUSH_RANDOM_SUPPORT - depends on BUSYBOX_CONFIG_HUSH + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help Enable pseudorandom generator and dynamic variable "$RANDOM". Each read of "$RANDOM" will generate a new pseudorandom value. -config BUSYBOX_CONFIG_HUSH_EXPORT_N - bool "Support 'export -n' option" - default BUSYBOX_DEFAULT_HUSH_EXPORT_N - depends on BUSYBOX_CONFIG_HUSH - help - export -n unexports variables. It is a bash extension. - config BUSYBOX_CONFIG_HUSH_MODE_X bool "Support 'hush -x' option and 'set -x' command" default BUSYBOX_DEFAULT_HUSH_MODE_X - depends on BUSYBOX_CONFIG_HUSH + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help This instructs hush to print commands before execution. Adds ~300 bytes. +config BUSYBOX_CONFIG_HUSH_ECHO + bool "echo builtin" + default BUSYBOX_DEFAULT_HUSH_ECHO + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_PRINTF + bool "printf builtin" + default BUSYBOX_DEFAULT_HUSH_PRINTF + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_TEST + bool "test builtin" + default BUSYBOX_DEFAULT_HUSH_TEST + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_HELP + bool "help builtin" + default BUSYBOX_DEFAULT_HUSH_HELP + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_EXPORT + bool "export builtin" + default BUSYBOX_DEFAULT_HUSH_EXPORT + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_EXPORT_N + bool "Support 'export -n' option" + default BUSYBOX_DEFAULT_HUSH_EXPORT_N + depends on BUSYBOX_CONFIG_HUSH_EXPORT + help + export -n unexports variables. It is a bash extension. + +config BUSYBOX_CONFIG_HUSH_KILL + bool "kill builtin (supports kill %jobspec)" + default BUSYBOX_DEFAULT_HUSH_KILL + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_WAIT + bool "wait builtin" + default BUSYBOX_DEFAULT_HUSH_WAIT + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_TRAP + bool "trap builtin" + default BUSYBOX_DEFAULT_HUSH_TRAP + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_TYPE + bool "type builtin" + default BUSYBOX_DEFAULT_HUSH_TYPE + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_READ + bool "read builtin" + default BUSYBOX_DEFAULT_HUSH_READ + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_SET + bool "set builtin" + default BUSYBOX_DEFAULT_HUSH_SET + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_UNSET + bool "unset builtin" + default BUSYBOX_DEFAULT_HUSH_UNSET + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_ULIMIT + bool "ulimit builtin" + default BUSYBOX_DEFAULT_HUSH_ULIMIT + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_UMASK + bool "umask builtin" + default BUSYBOX_DEFAULT_HUSH_UMASK + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_MEMLEAK + bool "memleak builtin (debugging)" + default BUSYBOX_DEFAULT_HUSH_MEMLEAK + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + config BUSYBOX_CONFIG_MSH bool "msh (deprecated: aliased to hush)" default BUSYBOX_DEFAULT_MSH @@ -302,72 +436,20 @@ config BUSYBOX_CONFIG_MSH msh is deprecated and will be removed, please migrate to hush. +comment "Options common to all shells" +if ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH -choice - prompt "Choose which shell is aliased to 'sh' name" - default BUSYBOX_CONFIG_FEATURE_SH_IS_ASH - help - Choose which shell you want to be executed by 'sh' alias. - The ash shell is the most bash compatible and full featured one. - -# note: cannot use "select ASH" here, it breaks "make allnoconfig" -config BUSYBOX_CONFIG_FEATURE_SH_IS_ASH - depends on BUSYBOX_CONFIG_ASH - bool "ash" - depends on !BUSYBOX_CONFIG_NOMMU - -config BUSYBOX_CONFIG_FEATURE_SH_IS_HUSH - depends on BUSYBOX_CONFIG_HUSH - bool "hush" - -config BUSYBOX_CONFIG_FEATURE_SH_IS_NONE - bool "none" - -endchoice - -choice - prompt "Choose which shell is aliased to 'bash' name" - default BUSYBOX_CONFIG_FEATURE_BASH_IS_NONE - help - Choose which shell you want to be executed by 'bash' alias. - The ash shell is the most bash compatible and full featured one. - - Note that selecting this option does not switch on any bash - compatibility code. It merely makes it possible to install - /bin/bash (sym)link and run scripts which start with - #!/bin/bash line. - - Many systems use it in scripts which use bash-specific features, - even simple ones like $RANDOM. Without this option, busybox - can't be used for running them because it won't recongnize - "bash" as a supported applet name. - -config BUSYBOX_CONFIG_FEATURE_BASH_IS_ASH - depends on BUSYBOX_CONFIG_ASH - bool "ash" - depends on !BUSYBOX_CONFIG_NOMMU - -config BUSYBOX_CONFIG_FEATURE_BASH_IS_HUSH - depends on BUSYBOX_CONFIG_HUSH - bool "hush" - -config BUSYBOX_CONFIG_FEATURE_BASH_IS_NONE - bool "none" - -endchoice - - -config BUSYBOX_CONFIG_SH_MATH_SUPPORT +config BUSYBOX_CONFIG_FEATURE_SH_MATH bool "POSIX math support" - default BUSYBOX_DEFAULT_SH_MATH_SUPPORT - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH + default BUSYBOX_DEFAULT_FEATURE_SH_MATH + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help Enable math support in the shell via $((...)) syntax. -config BUSYBOX_CONFIG_SH_MATH_SUPPORT_64 +config BUSYBOX_CONFIG_FEATURE_SH_MATH_64 bool "Extend POSIX math support to 64 bit" - default BUSYBOX_DEFAULT_SH_MATH_SUPPORT_64 - depends on BUSYBOX_CONFIG_SH_MATH_SUPPORT + default BUSYBOX_DEFAULT_FEATURE_SH_MATH_64 + depends on BUSYBOX_CONFIG_FEATURE_SH_MATH help Enable 64-bit math support in the shell. This will make the shell slightly larger, but will allow computation with very large numbers. @@ -376,14 +458,14 @@ config BUSYBOX_CONFIG_SH_MATH_SUPPORT_64 config BUSYBOX_CONFIG_FEATURE_SH_EXTRA_QUIET bool "Hide message on interactive shell startup" default BUSYBOX_DEFAULT_FEATURE_SH_EXTRA_QUIET - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_ASH + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help Remove the busybox introduction when starting a shell. config BUSYBOX_CONFIG_FEATURE_SH_STANDALONE bool "Standalone shell" default BUSYBOX_DEFAULT_FEATURE_SH_STANDALONE - depends on (BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_ASH) && BUSYBOX_CONFIG_FEATURE_PREFER_APPLETS + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help This option causes busybox shells to use busybox applets in preference to executables in the PATH whenever possible. For @@ -395,28 +477,16 @@ config BUSYBOX_CONFIG_FEATURE_SH_STANDALONE for use as a rescue shell, in the event that you screw up your system. This is implemented by re-execing /proc/self/exe (typically) - with right parameters. Some selected applets ("NOFORK" applets) - can even be executed without creating new process. - Instead, busybox will call _main() internally. + with right parameters. - However, this causes problems in chroot jails without mounted /proc - and with ps/top (command name can be shown as 'exe' for applets - started this way). -# untrue? -# Note that this will *also* cause applets to take precedence -# over shell builtins of the same name. So turning this on will -# eliminate any performance gained by turning on the builtin "echo" -# and "test" commands in ash. -# untrue? -# Note that when using this option, the shell will attempt to directly -# run '/bin/busybox'. If you do not have the busybox binary sitting in -# that exact location with that exact name, this option will not work at -# all. + However, there are drawbacks: it is problematic in chroot jails + without mounted /proc, and ps/top may show command name as 'exe' + for applets started this way. config BUSYBOX_CONFIG_FEATURE_SH_NOFORK bool "Run 'nofork' applets directly" default BUSYBOX_DEFAULT_FEATURE_SH_NOFORK - depends on (BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_ASH) && BUSYBOX_CONFIG_FEATURE_PREFER_APPLETS + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help This option causes busybox shells to not execute typical fork/exec/wait sequence, but call _main directly, @@ -434,11 +504,12 @@ config BUSYBOX_CONFIG_FEATURE_SH_NOFORK config BUSYBOX_CONFIG_FEATURE_SH_HISTFILESIZE bool "Use $HISTFILESIZE" default BUSYBOX_DEFAULT_FEATURE_SH_HISTFILESIZE - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_ASH + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help This option makes busybox shells to use $HISTFILESIZE variable to set shell history size. Note that its max value is capped by "History size" setting in library tuning section. +endif # Options common to all shells endmenu diff --git a/package/utils/busybox/config/sysklogd/Config.in b/package/utils/busybox/config/sysklogd/Config.in index 5fcee2c7f..2045a7ae3 100644 --- a/package/utils/busybox/config/sysklogd/Config.in +++ b/package/utils/busybox/config/sysklogd/Config.in @@ -47,7 +47,6 @@ config BUSYBOX_CONFIG_LOGGER config BUSYBOX_CONFIG_LOGREAD bool "logread" default BUSYBOX_DEFAULT_LOGREAD - depends on BUSYBOX_CONFIG_FEATURE_IPC_SYSLOG help If you enabled Circular Buffer support, you almost certainly want to enable this feature as well. This @@ -59,7 +58,7 @@ config BUSYBOX_CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING default BUSYBOX_DEFAULT_FEATURE_LOGREAD_REDUCED_LOCKING depends on BUSYBOX_CONFIG_LOGREAD help - 'logread' ouput to slow serial terminals can have + 'logread' output to slow serial terminals can have side effects on syslog because of the semaphore. This option make logread to double buffer copy from circular buffer, minimizing semaphore diff --git a/package/utils/busybox/config/util-linux/Config.in b/package/utils/busybox/config/util-linux/Config.in index 08bddf819..74a49d00c 100644 --- a/package/utils/busybox/config/util-linux/Config.in +++ b/package/utils/busybox/config/util-linux/Config.in @@ -6,28 +6,424 @@ menu "Linux System Utilities" +config BUSYBOX_CONFIG_ACPID + bool "acpid" + default BUSYBOX_DEFAULT_ACPID + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + acpid listens to ACPI events coming either in textual form from + /proc/acpi/event (though it is marked deprecated it is still widely + used and _is_ a standard) or in binary form from specified evdevs + (just use /dev/input/event*). + + It parses the event to retrieve ACTION and a possible PARAMETER. + It then spawns /etc/acpi/[/] either via run-parts + (if the resulting path is a directory) or directly as an executable. + + N.B. acpid relies on run-parts so have the latter installed. + +config BUSYBOX_CONFIG_FEATURE_ACPID_COMPAT + bool "Accept and ignore redundant options" + default BUSYBOX_DEFAULT_FEATURE_ACPID_COMPAT + depends on BUSYBOX_CONFIG_ACPID + help + Accept and ignore compatibility options -g -m -s -S -v. config BUSYBOX_CONFIG_BLKDISCARD bool "blkdiscard" default BUSYBOX_DEFAULT_BLKDISCARD help blkdiscard discards sectors on a given device. +config BUSYBOX_CONFIG_BLKID + bool "blkid" + default BUSYBOX_DEFAULT_BLKID + select BUSYBOX_CONFIG_PLATFORM_LINUX + select BUSYBOX_CONFIG_VOLUMEID + help + Lists labels and UUIDs of all filesystems. + WARNING: + With all submodules selected, it will add ~8k to busybox. + +config BUSYBOX_CONFIG_FEATURE_BLKID_TYPE + bool "Print filesystem type" + default BUSYBOX_DEFAULT_FEATURE_BLKID_TYPE + depends on BUSYBOX_CONFIG_BLKID + help + Show TYPE="filesystem type" config BUSYBOX_CONFIG_BLOCKDEV bool "blockdev" default BUSYBOX_DEFAULT_BLOCKDEV help Performs some ioctls with block devices. +config BUSYBOX_CONFIG_CAL + bool "cal" + default BUSYBOX_DEFAULT_CAL + help + cal is used to display a monthly calendar. +config BUSYBOX_CONFIG_CHRT + bool "chrt" + default BUSYBOX_DEFAULT_CHRT + help + manipulate real-time attributes of a process. + This requires sched_{g,s}etparam support in your libc. +config BUSYBOX_CONFIG_DMESG + bool "dmesg" + default BUSYBOX_DEFAULT_DMESG + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + dmesg is used to examine or control the kernel ring buffer. When the + Linux kernel prints messages to the system log, they are stored in + the kernel ring buffer. You can use dmesg to print the kernel's ring + buffer, clear the kernel ring buffer, change the size of the kernel + ring buffer, and change the priority level at which kernel messages + are also logged to the system console. Enable this option if you + wish to enable the 'dmesg' utility. + +config BUSYBOX_CONFIG_FEATURE_DMESG_PRETTY + bool "Pretty output" + default BUSYBOX_DEFAULT_FEATURE_DMESG_PRETTY + depends on BUSYBOX_CONFIG_DMESG + help + If you wish to scrub the syslog level from the output, say 'Y' here. + The syslog level is a string prefixed to every line with the form + "<#>". + + With this option you will see: + # dmesg + Linux version 2.6.17.4 ..... + BIOS-provided physical RAM map: + BIOS-e820: 0000000000000000 - 000000000009f000 (usable) + + Without this option you will see: + # dmesg + <5>Linux version 2.6.17.4 ..... + <6>BIOS-provided physical RAM map: + <6> BIOS-e820: 0000000000000000 - 000000000009f000 (usable) +config BUSYBOX_CONFIG_EJECT + bool "eject" + default BUSYBOX_DEFAULT_EJECT + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Used to eject cdroms. (defaults to /dev/cdrom) + +config BUSYBOX_CONFIG_FEATURE_EJECT_SCSI + bool "SCSI support" + default BUSYBOX_DEFAULT_FEATURE_EJECT_SCSI + depends on BUSYBOX_CONFIG_EJECT + help + Add the -s option to eject, this allows to eject SCSI-Devices and + usb-storage devices. +config BUSYBOX_CONFIG_FALLOCATE + bool "fallocate" + default BUSYBOX_DEFAULT_FALLOCATE + help + Preallocate space for files. config BUSYBOX_CONFIG_FATATTR bool "fatattr" default BUSYBOX_DEFAULT_FATATTR select BUSYBOX_CONFIG_PLATFORM_LINUX help fatattr lists or changes the file attributes on a fat file system. +config BUSYBOX_CONFIG_FBSET + bool "fbset" + default BUSYBOX_DEFAULT_FBSET + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + fbset is used to show or change the settings of a Linux frame buffer + device. The frame buffer device provides a simple and unique + interface to access a graphics display. Enable this option + if you wish to enable the 'fbset' utility. + +config BUSYBOX_CONFIG_FEATURE_FBSET_FANCY + bool "Enable extra options" + default BUSYBOX_DEFAULT_FEATURE_FBSET_FANCY + depends on BUSYBOX_CONFIG_FBSET + help + This option enables extended fbset options, allowing one to set the + framebuffer size, color depth, etc. interface to access a graphics + display. Enable this option if you wish to enable extended fbset + options. + +config BUSYBOX_CONFIG_FEATURE_FBSET_READMODE + bool "Enable readmode support" + default BUSYBOX_DEFAULT_FEATURE_FBSET_READMODE + depends on BUSYBOX_CONFIG_FBSET + help + This option allows fbset to read the video mode database stored by + default BUSYBOX_DEFAULT_FEATURE_FBSET_READMODE /etc/fb.modes, which can be used to set frame buffer + device to pre-defined video modes. +config BUSYBOX_CONFIG_FDFORMAT + bool "fdformat" + default BUSYBOX_DEFAULT_FDFORMAT + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + fdformat is used to low-level format a floppy disk. +config BUSYBOX_CONFIG_FDISK + bool "fdisk" + default BUSYBOX_DEFAULT_FDISK + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + The fdisk utility is used to divide hard disks into one or more + logical disks, which are generally called partitions. This utility + can be used to list and edit the set of partitions or BSD style + 'disk slices' that are defined on a hard drive. + +config BUSYBOX_CONFIG_FDISK_SUPPORT_LARGE_DISKS + bool "Support over 4GB disks" + default BUSYBOX_DEFAULT_FDISK_SUPPORT_LARGE_DISKS + depends on BUSYBOX_CONFIG_FDISK + depends on !BUSYBOX_CONFIG_LFS # with LFS no special code is needed + +config BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + bool "Write support" + default BUSYBOX_DEFAULT_FEATURE_FDISK_WRITABLE + depends on BUSYBOX_CONFIG_FDISK + help + Enabling this option allows you to create or change a partition table + and write those changes out to disk. If you leave this option + disabled, you will only be able to view the partition table. + +config BUSYBOX_CONFIG_FEATURE_AIX_LABEL + bool "Support AIX disklabels" + default BUSYBOX_DEFAULT_FEATURE_AIX_LABEL + depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + help + Enabling this option allows you to create or change AIX disklabels. + Most people can safely leave this option disabled. + +config BUSYBOX_CONFIG_FEATURE_SGI_LABEL + bool "Support SGI disklabels" + default BUSYBOX_DEFAULT_FEATURE_SGI_LABEL + depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + help + Enabling this option allows you to create or change SGI disklabels. + Most people can safely leave this option disabled. + +config BUSYBOX_CONFIG_FEATURE_SUN_LABEL + bool "Support SUN disklabels" + default BUSYBOX_DEFAULT_FEATURE_SUN_LABEL + depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + help + Enabling this option allows you to create or change SUN disklabels. + Most people can safely leave this option disabled. + +config BUSYBOX_CONFIG_FEATURE_OSF_LABEL + bool "Support BSD disklabels" + default BUSYBOX_DEFAULT_FEATURE_OSF_LABEL + depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + help + Enabling this option allows you to create or change BSD disklabels + and define and edit BSD disk slices. + +config BUSYBOX_CONFIG_FEATURE_GPT_LABEL + bool "Support GPT disklabels" + default BUSYBOX_DEFAULT_FEATURE_GPT_LABEL + depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + help + Enabling this option allows you to view GUID Partition Table + disklabels. + +config BUSYBOX_CONFIG_FEATURE_FDISK_ADVANCED + bool "Support expert mode" + default BUSYBOX_DEFAULT_FEATURE_FDISK_ADVANCED + depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + help + Enabling this option allows you to do terribly unsafe things like + define arbitrary drive geometry, move the beginning of data in a + partition, and similarly evil things. Unless you have a very good + reason you would be wise to leave this disabled. +config BUSYBOX_CONFIG_FINDFS + bool "findfs" + default BUSYBOX_DEFAULT_FINDFS + select BUSYBOX_CONFIG_PLATFORM_LINUX + select BUSYBOX_CONFIG_VOLUMEID + help + Prints the name of a filesystem with given label or UUID. + WARNING: + With all submodules selected, it will add ~8k to busybox. +config BUSYBOX_CONFIG_FLOCK + bool "flock" + default BUSYBOX_DEFAULT_FLOCK + help + Manage locks from shell scripts +config BUSYBOX_CONFIG_FDFLUSH + bool "fdflush" + default BUSYBOX_DEFAULT_FDFLUSH + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + fdflush is only needed when changing media on slightly-broken + removable media drives. It is used to make Linux believe that a + hardware disk-change switch has been actuated, which causes Linux to + forget anything it has cached from the previous media. If you have + such a slightly-broken drive, you will need to run fdflush every time + you change a disk. Most people have working hardware and can safely + leave this disabled. + +config BUSYBOX_CONFIG_FREERAMDISK + bool "freeramdisk" + default BUSYBOX_DEFAULT_FREERAMDISK + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Linux allows you to create ramdisks. This utility allows you to + delete them and completely free all memory that was used for the + ramdisk. For example, if you boot Linux into a ramdisk and later + pivot_root, you may want to free the memory that is allocated to the + ramdisk. If you have no use for freeing memory from a ramdisk, leave + this disabled. +config BUSYBOX_CONFIG_FSCK_MINIX + bool "fsck_minix" + default BUSYBOX_DEFAULT_FSCK_MINIX + help + The minix filesystem is a nice, small, compact, read-write filesystem + with little overhead. It is not a journaling filesystem however and + can experience corruption if it is not properly unmounted or if the + power goes off in the middle of a write. This utility allows you to + check for and attempt to repair any corruption that occurs to a minix + filesystem. +config BUSYBOX_CONFIG_FSFREEZE + bool "fsfreeze" + default BUSYBOX_DEFAULT_FSFREEZE + select BUSYBOX_CONFIG_PLATFORM_LINUX + select BUSYBOX_CONFIG_LONG_OPTS + help + Halt new accesses and flush writes on a mounted filesystem. config BUSYBOX_CONFIG_FSTRIM bool "fstrim" default BUSYBOX_DEFAULT_FSTRIM select BUSYBOX_CONFIG_PLATFORM_LINUX help Discard unused blocks on a mounted filesystem. +config BUSYBOX_CONFIG_GETOPT + bool "getopt" + default BUSYBOX_DEFAULT_GETOPT + help + The getopt utility is used to break up (parse) options in command + lines to make it easy to write complex shell scripts that also check + for legal (and illegal) options. If you want to write horribly + complex shell scripts, or use some horribly complex shell script + written by others, this utility may be for you. Most people will + wisely leave this disabled. + +config BUSYBOX_CONFIG_FEATURE_GETOPT_LONG + bool "Support option -l" + default BUSYBOX_DEFAULT_FEATURE_GETOPT_LONG if BUSYBOX_CONFIG_LONG_OPTS + depends on BUSYBOX_CONFIG_GETOPT + help + Enable support for long options (option -l). +config BUSYBOX_CONFIG_HEXDUMP + bool "hexdump" + default BUSYBOX_DEFAULT_HEXDUMP + help + The hexdump utility is used to display binary data in a readable + way that is comparable to the output from most hex editors. + +config BUSYBOX_CONFIG_FEATURE_HEXDUMP_REVERSE + bool "Support -R, reverse of 'hexdump -Cv'" + default BUSYBOX_DEFAULT_FEATURE_HEXDUMP_REVERSE + depends on BUSYBOX_CONFIG_HEXDUMP + help + The hexdump utility is used to display binary data in an ascii + readable way. This option creates binary data from an ascii input. + NB: this option is non-standard. It's unwise to use it in scripts + aimed to be portable. + +config BUSYBOX_CONFIG_HD + bool "hd" + default BUSYBOX_DEFAULT_HD + help + hd is an alias to hexdump -C. +config BUSYBOX_CONFIG_XXD + bool "xxd" + default BUSYBOX_DEFAULT_XXD + help + The xxd utility is used to display binary data in a readable + way that is comparable to the output from most hex editors. +config BUSYBOX_CONFIG_HWCLOCK + bool "hwclock" + default BUSYBOX_DEFAULT_HWCLOCK + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + The hwclock utility is used to read and set the hardware clock + on a system. This is primarily used to set the current time on + shutdown in the hardware clock, so the hardware will keep the + correct time when Linux is _not_ running. + +config BUSYBOX_CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS + bool "Support long options (--hctosys,...)" + default BUSYBOX_DEFAULT_FEATURE_HWCLOCK_LONG_OPTIONS + depends on BUSYBOX_CONFIG_HWCLOCK && BUSYBOX_CONFIG_LONG_OPTS + +config BUSYBOX_CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS + bool "Use FHS /var/lib/hwclock/adjtime" + default BUSYBOX_DEFAULT_FEATURE_HWCLOCK_ADJTIME_FHS # util-linux-ng in Fedora 13 still uses /etc/adjtime + depends on BUSYBOX_CONFIG_HWCLOCK + help + Starting with FHS 2.3, the adjtime state file is supposed to exist + at /var/lib/hwclock/adjtime instead of /etc/adjtime. If you wish + to use the FHS behavior, answer Y here, otherwise answer N for the + classic /etc/adjtime path. + + pathname.com/fhs/pub/fhs-2.3.html#VARLIBHWCLOCKSTATEDIRECTORYFORHWCLO +config BUSYBOX_CONFIG_IONICE + bool "ionice" + default BUSYBOX_DEFAULT_IONICE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Set/set program io scheduling class and priority + Requires kernel >= 2.6.13 +config BUSYBOX_CONFIG_IPCRM + bool "ipcrm" + default BUSYBOX_DEFAULT_IPCRM + help + The ipcrm utility allows the removal of System V interprocess + communication (IPC) objects and the associated data structures + from the system. +config BUSYBOX_CONFIG_IPCS + bool "ipcs" + default BUSYBOX_DEFAULT_IPCS + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + The ipcs utility is used to provide information on the currently + allocated System V interprocess (IPC) objects in the system. +config BUSYBOX_CONFIG_LAST + bool "last" + default BUSYBOX_DEFAULT_LAST + depends on BUSYBOX_CONFIG_FEATURE_WTMP + help + 'last' displays a list of the last users that logged into the system. + +config BUSYBOX_CONFIG_FEATURE_LAST_FANCY + bool "Output extra information" + default BUSYBOX_DEFAULT_FEATURE_LAST_FANCY + depends on BUSYBOX_CONFIG_LAST + help + 'last' displays detailed information about the last users that + logged into the system (mimics sysvinit last). +900 bytes. +config BUSYBOX_CONFIG_LOSETUP + bool "losetup" + default BUSYBOX_DEFAULT_LOSETUP + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + losetup is used to associate or detach a loop device with a regular + file or block device, and to query the status of a loop device. This + version does not currently support enabling data encryption. +config BUSYBOX_CONFIG_LSPCI + bool "lspci" + default BUSYBOX_DEFAULT_LSPCI + #select PLATFORM_LINUX + help + lspci is a utility for displaying information about PCI buses in the + system and devices connected to them. + + This version uses sysfs (/sys/bus/pci/devices) only. +config BUSYBOX_CONFIG_LSUSB + bool "lsusb" + default BUSYBOX_DEFAULT_LSUSB + #select PLATFORM_LINUX + help + lsusb is a utility for displaying information about USB buses in the + system and devices connected to them. + + This version uses sysfs (/sys/bus/usb/devices) only. config BUSYBOX_CONFIG_MDEV bool "mdev" default BUSYBOX_DEFAULT_MDEV @@ -85,6 +481,102 @@ config BUSYBOX_CONFIG_FEATURE_MDEV_LOAD_FIRMWARE These devices will request userspace look up the files in /lib/firmware/ and if it exists, send it to the kernel for loading into the hardware. +config BUSYBOX_CONFIG_MESG + bool "mesg" + default BUSYBOX_DEFAULT_MESG + help + Mesg controls access to your terminal by others. It is typically + used to allow or disallow other users to write to your terminal + +config BUSYBOX_CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP + bool "Enable writing to tty only by group, not by everybody" + default BUSYBOX_DEFAULT_FEATURE_MESG_ENABLE_ONLY_GROUP + depends on BUSYBOX_CONFIG_MESG + help + Usually, ttys are owned by group "tty", and "write" tool is + setgid to this group. This way, "mesg y" only needs to enable + "write by owning group" bit in tty mode. + + If you set this option to N, "mesg y" will enable writing + by anybody at all. This is not recommended. +config BUSYBOX_CONFIG_MKE2FS + bool "mke2fs" + default BUSYBOX_DEFAULT_MKE2FS + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Utility to create EXT2 filesystems. + +config BUSYBOX_CONFIG_MKFS_EXT2 + bool "mkfs.ext2" + default BUSYBOX_DEFAULT_MKFS_EXT2 + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Alias to "mke2fs". +config BUSYBOX_CONFIG_MKFS_MINIX + bool "mkfs_minix" + default BUSYBOX_DEFAULT_MKFS_MINIX + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + The minix filesystem is a nice, small, compact, read-write filesystem + with little overhead. If you wish to be able to create minix + filesystems this utility will do the job for you. + +config BUSYBOX_CONFIG_FEATURE_MINIX2 + bool "Support Minix fs v2 (fsck_minix/mkfs_minix)" + default BUSYBOX_DEFAULT_FEATURE_MINIX2 + depends on BUSYBOX_CONFIG_FSCK_MINIX || BUSYBOX_CONFIG_MKFS_MINIX + help + If you wish to be able to create version 2 minix filesystems, enable + this. If you enabled 'mkfs_minix' then you almost certainly want to + be using the version 2 filesystem support. +config BUSYBOX_CONFIG_MKFS_REISER + bool "mkfs_reiser" + default BUSYBOX_DEFAULT_MKFS_REISER + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Utility to create ReiserFS filesystems. + Note: this applet needs a lot of testing and polishing. +config BUSYBOX_CONFIG_MKDOSFS + bool "mkdosfs" + default BUSYBOX_DEFAULT_MKDOSFS + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Utility to create FAT32 filesystems. + +config BUSYBOX_CONFIG_MKFS_VFAT + bool "mkfs.vfat" + default BUSYBOX_DEFAULT_MKFS_VFAT + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Alias to "mkdosfs". +config BUSYBOX_CONFIG_MKSWAP + bool "mkswap" + default BUSYBOX_DEFAULT_MKSWAP + help + The mkswap utility is used to configure a file or disk partition as + Linux swap space. This allows Linux to use the entire file or + partition as if it were additional RAM, which can greatly increase + the capability of low-memory machines. This additional memory is + much slower than real RAM, but can be very helpful at preventing your + applications being killed by the Linux out of memory (OOM) killer. + Once you have created swap space using 'mkswap' you need to enable + the swap space using the 'swapon' utility. + +config BUSYBOX_CONFIG_FEATURE_MKSWAP_UUID + bool "UUID support" + default BUSYBOX_DEFAULT_FEATURE_MKSWAP_UUID + depends on BUSYBOX_CONFIG_MKSWAP + help + Generate swap spaces with universally unique identifiers. +config BUSYBOX_CONFIG_MORE + bool "more" + default BUSYBOX_DEFAULT_MORE + help + more is a simple utility which allows you to read text one screen + sized page at a time. If you want to read text that is larger than + the screen, and you are using anything faster than a 300 baud modem, + you will probably find this utility very helpful. If you don't have + any need to reading text files, you can leave this disabled. config BUSYBOX_CONFIG_MOUNT bool "mount" default BUSYBOX_DEFAULT_MOUNT @@ -158,7 +650,7 @@ config BUSYBOX_CONFIG_FEATURE_MOUNT_CIFS config BUSYBOX_CONFIG_FEATURE_MOUNT_FLAGS depends on BUSYBOX_CONFIG_MOUNT - bool "Support lots of -o flags in mount" + bool "Support lots of -o flags" default BUSYBOX_DEFAULT_FEATURE_MOUNT_FLAGS help Without this, mount only supports ro/rw/remount. With this, it @@ -179,6 +671,11 @@ config BUSYBOX_CONFIG_FEATURE_MOUNT_OTHERTAB default BUSYBOX_DEFAULT_FEATURE_MOUNT_OTHERTAB help Support mount -T (specifying an alternate fstab) +config BUSYBOX_CONFIG_MOUNTPOINT + bool "mountpoint" + default BUSYBOX_DEFAULT_MOUNTPOINT + help + mountpoint checks if the directory is a mountpoint. config BUSYBOX_CONFIG_NSENTER bool "nsenter" default BUSYBOX_DEFAULT_NSENTER @@ -193,462 +690,6 @@ config BUSYBOX_CONFIG_FEATURE_NSENTER_LONG_OPTS help Support long options for the nsenter applet. This makes the busybox implementation more compatible with upstream. -config BUSYBOX_CONFIG_REV - bool "rev" - default BUSYBOX_DEFAULT_REV - help - Reverse lines of a file or files. -config BUSYBOX_CONFIG_SETARCH - bool "setarch" - default BUSYBOX_DEFAULT_SETARCH - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - The linux32 utility is used to create a 32bit environment for the - specified program (usually a shell). It only makes sense to have - this util on a system that supports both 64bit and 32bit userland - (like amd64/x86, ppc64/ppc, sparc64/sparc, etc...). -config BUSYBOX_CONFIG_UEVENT - bool "uevent" - default BUSYBOX_DEFAULT_UEVENT - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - uevent is a netlink listener for kernel uevent notifications - sent via netlink. It is usually used for dynamic device creation. -config BUSYBOX_CONFIG_UNSHARE - bool "unshare" - default BUSYBOX_DEFAULT_UNSHARE - depends on BUSYBOX_CONFIG_LONG_OPTS && !BUSYBOX_CONFIG_NOMMU - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Run program with some namespaces unshared from parent. - -config BUSYBOX_CONFIG_ACPID - bool "acpid" - default BUSYBOX_DEFAULT_ACPID - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - acpid listens to ACPI events coming either in textual form from - /proc/acpi/event (though it is marked deprecated it is still widely - used and _is_ a standard) or in binary form from specified evdevs - (just use /dev/input/event*). - - It parses the event to retrieve ACTION and a possible PARAMETER. - It then spawns /etc/acpi/[/] either via run-parts - (if the resulting path is a directory) or directly as an executable. - - N.B. acpid relies on run-parts so have the latter installed. - -config BUSYBOX_CONFIG_FEATURE_ACPID_COMPAT - bool "Accept and ignore redundant options" - default BUSYBOX_DEFAULT_FEATURE_ACPID_COMPAT - depends on BUSYBOX_CONFIG_ACPID - help - Accept and ignore compatibility options -g -m -s -S -v. - -config BUSYBOX_CONFIG_BLKID - bool "blkid" - default BUSYBOX_DEFAULT_BLKID - select BUSYBOX_CONFIG_PLATFORM_LINUX - select BUSYBOX_CONFIG_VOLUMEID - help - Lists labels and UUIDs of all filesystems. - WARNING: - With all submodules selected, it will add ~8k to busybox. - -config BUSYBOX_CONFIG_FEATURE_BLKID_TYPE - bool "Print filesystem type" - default BUSYBOX_DEFAULT_FEATURE_BLKID_TYPE - depends on BUSYBOX_CONFIG_BLKID - help - Show TYPE="filesystem type" - -config BUSYBOX_CONFIG_DMESG - bool "dmesg" - default BUSYBOX_DEFAULT_DMESG - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - dmesg is used to examine or control the kernel ring buffer. When the - Linux kernel prints messages to the system log, they are stored in - the kernel ring buffer. You can use dmesg to print the kernel's ring - buffer, clear the kernel ring buffer, change the size of the kernel - ring buffer, and change the priority level at which kernel messages - are also logged to the system console. Enable this option if you - wish to enable the 'dmesg' utility. - -config BUSYBOX_CONFIG_FEATURE_DMESG_PRETTY - bool "Pretty dmesg output" - default BUSYBOX_DEFAULT_FEATURE_DMESG_PRETTY - depends on BUSYBOX_CONFIG_DMESG - help - If you wish to scrub the syslog level from the output, say 'Y' here. - The syslog level is a string prefixed to every line with the form - "<#>". - - With this option you will see: - # dmesg - Linux version 2.6.17.4 ..... - BIOS-provided physical RAM map: - BIOS-e820: 0000000000000000 - 000000000009f000 (usable) - - Without this option you will see: - # dmesg - <5>Linux version 2.6.17.4 ..... - <6>BIOS-provided physical RAM map: - <6> BIOS-e820: 0000000000000000 - 000000000009f000 (usable) - -config BUSYBOX_CONFIG_FBSET - bool "fbset" - default BUSYBOX_DEFAULT_FBSET - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - fbset is used to show or change the settings of a Linux frame buffer - device. The frame buffer device provides a simple and unique - interface to access a graphics display. Enable this option - if you wish to enable the 'fbset' utility. - -config BUSYBOX_CONFIG_FEATURE_FBSET_FANCY - bool "Turn on extra fbset options" - default BUSYBOX_DEFAULT_FEATURE_FBSET_FANCY - depends on BUSYBOX_CONFIG_FBSET - help - This option enables extended fbset options, allowing one to set the - framebuffer size, color depth, etc. interface to access a graphics - display. Enable this option if you wish to enable extended fbset - options. - -config BUSYBOX_CONFIG_FEATURE_FBSET_READMODE - bool "Turn on fbset readmode support" - default BUSYBOX_DEFAULT_FEATURE_FBSET_READMODE - depends on BUSYBOX_CONFIG_FBSET - help - This option allows fbset to read the video mode database stored by - default BUSYBOX_DEFAULT_FEATURE_FBSET_READMODE /etc/fb.modes, which can be used to set frame buffer - device to pre-defined video modes. - -config BUSYBOX_CONFIG_FDFLUSH - bool "fdflush" - default BUSYBOX_DEFAULT_FDFLUSH - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - fdflush is only needed when changing media on slightly-broken - removable media drives. It is used to make Linux believe that a - hardware disk-change switch has been actuated, which causes Linux to - forget anything it has cached from the previous media. If you have - such a slightly-broken drive, you will need to run fdflush every time - you change a disk. Most people have working hardware and can safely - leave this disabled. - -config BUSYBOX_CONFIG_FDFORMAT - bool "fdformat" - default BUSYBOX_DEFAULT_FDFORMAT - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - fdformat is used to low-level format a floppy disk. - -config BUSYBOX_CONFIG_FDISK - bool "fdisk" - default BUSYBOX_DEFAULT_FDISK - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - The fdisk utility is used to divide hard disks into one or more - logical disks, which are generally called partitions. This utility - can be used to list and edit the set of partitions or BSD style - 'disk slices' that are defined on a hard drive. - -config BUSYBOX_CONFIG_FDISK_SUPPORT_LARGE_DISKS - bool "Support over 4GB disks" - default BUSYBOX_DEFAULT_FDISK_SUPPORT_LARGE_DISKS - depends on BUSYBOX_CONFIG_FDISK - depends on !BUSYBOX_CONFIG_LFS # with LFS no special code is needed - help - Enable this option to support large disks > 4GB. - -config BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - bool "Write support" - default BUSYBOX_DEFAULT_FEATURE_FDISK_WRITABLE - depends on BUSYBOX_CONFIG_FDISK - help - Enabling this option allows you to create or change a partition table - and write those changes out to disk. If you leave this option - disabled, you will only be able to view the partition table. - -config BUSYBOX_CONFIG_FEATURE_AIX_LABEL - bool "Support AIX disklabels" - default BUSYBOX_DEFAULT_FEATURE_AIX_LABEL - depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to create or change AIX disklabels. - Most people can safely leave this option disabled. - -config BUSYBOX_CONFIG_FEATURE_SGI_LABEL - bool "Support SGI disklabels" - default BUSYBOX_DEFAULT_FEATURE_SGI_LABEL - depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to create or change SGI disklabels. - Most people can safely leave this option disabled. - -config BUSYBOX_CONFIG_FEATURE_SUN_LABEL - bool "Support SUN disklabels" - default BUSYBOX_DEFAULT_FEATURE_SUN_LABEL - depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to create or change SUN disklabels. - Most people can safely leave this option disabled. - -config BUSYBOX_CONFIG_FEATURE_OSF_LABEL - bool "Support BSD disklabels" - default BUSYBOX_DEFAULT_FEATURE_OSF_LABEL - depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to create or change BSD disklabels - and define and edit BSD disk slices. - -config BUSYBOX_CONFIG_FEATURE_GPT_LABEL - bool "Support GPT disklabels" - default BUSYBOX_DEFAULT_FEATURE_GPT_LABEL - depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to view GUID Partition Table - disklabels. - -config BUSYBOX_CONFIG_FEATURE_FDISK_ADVANCED - bool "Support expert mode" - default BUSYBOX_DEFAULT_FEATURE_FDISK_ADVANCED - depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to do terribly unsafe things like - define arbitrary drive geometry, move the beginning of data in a - partition, and similarly evil things. Unless you have a very good - reason you would be wise to leave this disabled. - -config BUSYBOX_CONFIG_FINDFS - bool "findfs" - default BUSYBOX_DEFAULT_FINDFS - select BUSYBOX_CONFIG_PLATFORM_LINUX - select BUSYBOX_CONFIG_VOLUMEID - help - Prints the name of a filesystem with given label or UUID. - WARNING: - With all submodules selected, it will add ~8k to busybox. - -config BUSYBOX_CONFIG_FLOCK - bool "flock" - default BUSYBOX_DEFAULT_FLOCK - help - Manage locks from shell scripts - -config BUSYBOX_CONFIG_FREERAMDISK - bool "freeramdisk" - default BUSYBOX_DEFAULT_FREERAMDISK - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Linux allows you to create ramdisks. This utility allows you to - delete them and completely free all memory that was used for the - ramdisk. For example, if you boot Linux into a ramdisk and later - pivot_root, you may want to free the memory that is allocated to the - ramdisk. If you have no use for freeing memory from a ramdisk, leave - this disabled. - -config BUSYBOX_CONFIG_FSCK_MINIX - bool "fsck_minix" - default BUSYBOX_DEFAULT_FSCK_MINIX - help - The minix filesystem is a nice, small, compact, read-write filesystem - with little overhead. It is not a journaling filesystem however and - can experience corruption if it is not properly unmounted or if the - power goes off in the middle of a write. This utility allows you to - check for and attempt to repair any corruption that occurs to a minix - filesystem. - -config BUSYBOX_CONFIG_MKFS_EXT2 - bool "mkfs_ext2" - default BUSYBOX_DEFAULT_MKFS_EXT2 - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Utility to create EXT2 filesystems. - -config BUSYBOX_CONFIG_MKFS_MINIX - bool "mkfs_minix" - default BUSYBOX_DEFAULT_MKFS_MINIX - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - The minix filesystem is a nice, small, compact, read-write filesystem - with little overhead. If you wish to be able to create minix - filesystems this utility will do the job for you. - -config BUSYBOX_CONFIG_FEATURE_MINIX2 - bool "Support Minix fs v2 (fsck_minix/mkfs_minix)" - default BUSYBOX_DEFAULT_FEATURE_MINIX2 - depends on BUSYBOX_CONFIG_FSCK_MINIX || BUSYBOX_CONFIG_MKFS_MINIX - help - If you wish to be able to create version 2 minix filesystems, enable - this. If you enabled 'mkfs_minix' then you almost certainly want to - be using the version 2 filesystem support. - -config BUSYBOX_CONFIG_MKFS_REISER - bool "mkfs_reiser" - default BUSYBOX_DEFAULT_MKFS_REISER - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Utility to create ReiserFS filesystems. - Note: this applet needs a lot of testing and polishing. - -config BUSYBOX_CONFIG_MKFS_VFAT - bool "mkfs_vfat" - default BUSYBOX_DEFAULT_MKFS_VFAT - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Utility to create FAT32 filesystems. - -config BUSYBOX_CONFIG_GETOPT - bool "getopt" - default BUSYBOX_DEFAULT_GETOPT - help - The getopt utility is used to break up (parse) options in command - lines to make it easy to write complex shell scripts that also check - for legal (and illegal) options. If you want to write horribly - complex shell scripts, or use some horribly complex shell script - written by others, this utility may be for you. Most people will - wisely leave this disabled. - -config BUSYBOX_CONFIG_FEATURE_GETOPT_LONG - bool "Support option -l" - default BUSYBOX_DEFAULT_FEATURE_GETOPT_LONG if BUSYBOX_CONFIG_LONG_OPTS - depends on BUSYBOX_CONFIG_GETOPT - help - Enable support for long options (option -l). - -config BUSYBOX_CONFIG_HEXDUMP - bool "hexdump" - default BUSYBOX_DEFAULT_HEXDUMP - help - The hexdump utility is used to display binary data in a readable - way that is comparable to the output from most hex editors. - -config BUSYBOX_CONFIG_FEATURE_HEXDUMP_REVERSE - bool "Support -R, reverse of 'hexdump -Cv'" - default BUSYBOX_DEFAULT_FEATURE_HEXDUMP_REVERSE - depends on BUSYBOX_CONFIG_HEXDUMP - help - The hexdump utility is used to display binary data in an ascii - readable way. This option creates binary data from an ascii input. - NB: this option is non-standard. It's unwise to use it in scripts - aimed to be portable. - -config BUSYBOX_CONFIG_HD - bool "hd" - default BUSYBOX_DEFAULT_HD - depends on BUSYBOX_CONFIG_HEXDUMP - help - hd is an alias to hexdump -C. - -config BUSYBOX_CONFIG_HWCLOCK - bool "hwclock" - default BUSYBOX_DEFAULT_HWCLOCK - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - The hwclock utility is used to read and set the hardware clock - on a system. This is primarily used to set the current time on - shutdown in the hardware clock, so the hardware will keep the - correct time when Linux is _not_ running. - -config BUSYBOX_CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS - bool "Support long options (--hctosys,...)" - default BUSYBOX_DEFAULT_FEATURE_HWCLOCK_LONG_OPTIONS - depends on BUSYBOX_CONFIG_HWCLOCK && BUSYBOX_CONFIG_LONG_OPTS - help - By default, the hwclock utility only uses short options. If you - are overly fond of its long options, such as --hctosys, --utc, etc) - then enable this option. - -config BUSYBOX_CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS - bool "Use FHS /var/lib/hwclock/adjtime" - default BUSYBOX_DEFAULT_FEATURE_HWCLOCK_ADJTIME_FHS # util-linux-ng in Fedora 13 still uses /etc/adjtime - depends on BUSYBOX_CONFIG_HWCLOCK - help - Starting with FHS 2.3, the adjtime state file is supposed to exist - at /var/lib/hwclock/adjtime instead of /etc/adjtime. If you wish - to use the FHS behavior, answer Y here, otherwise answer N for the - classic /etc/adjtime path. - - pathname.com/fhs/pub/fhs-2.3.html#VARLIBHWCLOCKSTATEDIRECTORYFORHWCLO - -config BUSYBOX_CONFIG_IPCRM - bool "ipcrm" - default BUSYBOX_DEFAULT_IPCRM - help - The ipcrm utility allows the removal of System V interprocess - communication (IPC) objects and the associated data structures - from the system. - -config BUSYBOX_CONFIG_IPCS - bool "ipcs" - default BUSYBOX_DEFAULT_IPCS - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - The ipcs utility is used to provide information on the currently - allocated System V interprocess (IPC) objects in the system. - -config BUSYBOX_CONFIG_LOSETUP - bool "losetup" - default BUSYBOX_DEFAULT_LOSETUP - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - losetup is used to associate or detach a loop device with a regular - file or block device, and to query the status of a loop device. This - version does not currently support enabling data encryption. - -config BUSYBOX_CONFIG_LSPCI - bool "lspci" - default BUSYBOX_DEFAULT_LSPCI - #select PLATFORM_LINUX - help - lspci is a utility for displaying information about PCI buses in the - system and devices connected to them. - - This version uses sysfs (/sys/bus/pci/devices) only. - -config BUSYBOX_CONFIG_LSUSB - bool "lsusb" - default BUSYBOX_DEFAULT_LSUSB - #select PLATFORM_LINUX - help - lsusb is a utility for displaying information about USB buses in the - system and devices connected to them. - - This version uses sysfs (/sys/bus/usb/devices) only. - -config BUSYBOX_CONFIG_MKSWAP - bool "mkswap" - default BUSYBOX_DEFAULT_MKSWAP - help - The mkswap utility is used to configure a file or disk partition as - Linux swap space. This allows Linux to use the entire file or - partition as if it were additional RAM, which can greatly increase - the capability of low-memory machines. This additional memory is - much slower than real RAM, but can be very helpful at preventing your - applications being killed by the Linux out of memory (OOM) killer. - Once you have created swap space using 'mkswap' you need to enable - the swap space using the 'swapon' utility. - -config BUSYBOX_CONFIG_FEATURE_MKSWAP_UUID - bool "UUID support" - default BUSYBOX_DEFAULT_FEATURE_MKSWAP_UUID - depends on BUSYBOX_CONFIG_MKSWAP - help - Generate swap spaces with universally unique identifiers. - -config BUSYBOX_CONFIG_MORE - bool "more" - default BUSYBOX_DEFAULT_MORE - help - more is a simple utility which allows you to read text one screen - sized page at a time. If you want to read text that is larger than - the screen, and you are using anything faster than a 300 baud modem, - you will probably find this utility very helpful. If you don't have - any need to reading text files, you can leave this disabled. - config BUSYBOX_CONFIG_PIVOT_ROOT bool "pivot_root" default BUSYBOX_DEFAULT_PIVOT_ROOT @@ -661,7 +702,6 @@ config BUSYBOX_CONFIG_PIVOT_ROOT Note: This is for initrd in linux 2.4. Under initramfs (introduced in linux 2.6) use switch_root instead. - config BUSYBOX_CONFIG_RDATE bool "rdate" default BUSYBOX_DEFAULT_RDATE @@ -670,46 +710,87 @@ config BUSYBOX_CONFIG_RDATE system clock with the date and time of a remote networked system using the RFC868 protocol, which is built into the inetd daemon on most systems. - config BUSYBOX_CONFIG_RDEV bool "rdev" default BUSYBOX_DEFAULT_RDEV help Print the device node associated with the filesystem mounted at '/'. - config BUSYBOX_CONFIG_READPROFILE bool "readprofile" default BUSYBOX_DEFAULT_READPROFILE #select PLATFORM_LINUX help This allows you to parse /proc/profile for basic profiling. - +config BUSYBOX_CONFIG_RENICE + bool "renice" + default BUSYBOX_DEFAULT_RENICE + help + Renice alters the scheduling priority of one or more running + processes. +config BUSYBOX_CONFIG_REV + bool "rev" + default BUSYBOX_DEFAULT_REV + help + Reverse lines of a file or files. config BUSYBOX_CONFIG_RTCWAKE bool "rtcwake" default BUSYBOX_DEFAULT_RTCWAKE select BUSYBOX_CONFIG_PLATFORM_LINUX help Enter a system sleep state until specified wakeup time. - config BUSYBOX_CONFIG_SCRIPT bool "script" default BUSYBOX_DEFAULT_SCRIPT help The script makes typescript of terminal session. - config BUSYBOX_CONFIG_SCRIPTREPLAY bool "scriptreplay" default BUSYBOX_DEFAULT_SCRIPTREPLAY help This program replays a typescript, using timing information given by script -t. - -config BUSYBOX_CONFIG_SWAPONOFF - bool "swaponoff" - default BUSYBOX_DEFAULT_SWAPONOFF +config BUSYBOX_CONFIG_SETARCH + bool "setarch" + default BUSYBOX_DEFAULT_SETARCH select BUSYBOX_CONFIG_PLATFORM_LINUX help - This option enables both the 'swapon' and the 'swapoff' utilities. + The linux32 utility is used to create a 32bit environment for the + specified program (usually a shell). It only makes sense to have + this util on a system that supports both 64bit and 32bit userland + (like amd64/x86, ppc64/ppc, sparc64/sparc, etc...). + +config BUSYBOX_CONFIG_LINUX32 + bool "linux32" + default BUSYBOX_DEFAULT_LINUX32 + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Alias to "setarch linux32". + +config BUSYBOX_CONFIG_LINUX64 + bool "linux64" + default BUSYBOX_DEFAULT_LINUX64 + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Alias to "setarch linux64". +config BUSYBOX_CONFIG_SETPRIV + bool "setpriv" + default BUSYBOX_DEFAULT_SETPRIV + select BUSYBOX_CONFIG_PLATFORM_LINUX + select BUSYBOX_CONFIG_LONG_OPTS + help + Run a program with different Linux privilege settings. + Requires kernel >= 3.5 +config BUSYBOX_CONFIG_SETSID + bool "setsid" + default BUSYBOX_DEFAULT_SETSID + help + setsid runs a program in a new session +config BUSYBOX_CONFIG_SWAPON + bool "swapon" + default BUSYBOX_DEFAULT_SWAPON + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + This option enables the 'swapon' utility. Once you have created some swap space using 'mkswap', you also need to enable your swap space with the 'swapon' utility. The 'swapoff' utility is used, typically at system shutdown, to disable any swap @@ -719,7 +800,7 @@ config BUSYBOX_CONFIG_SWAPONOFF config BUSYBOX_CONFIG_FEATURE_SWAPON_DISCARD bool "Support discard option -d" default BUSYBOX_DEFAULT_FEATURE_SWAPON_DISCARD - depends on BUSYBOX_CONFIG_SWAPONOFF + depends on BUSYBOX_CONFIG_SWAPON help Enable support for discarding swap area blocks at swapon and/or as the kernel frees them. This option enables both the -d option on @@ -728,10 +809,16 @@ config BUSYBOX_CONFIG_FEATURE_SWAPON_DISCARD config BUSYBOX_CONFIG_FEATURE_SWAPON_PRI bool "Support priority option -p" default BUSYBOX_DEFAULT_FEATURE_SWAPON_PRI - depends on BUSYBOX_CONFIG_SWAPONOFF + depends on BUSYBOX_CONFIG_SWAPON help Enable support for setting swap device priority in swapon. +config BUSYBOX_CONFIG_SWAPOFF + bool "swapoff" + default BUSYBOX_DEFAULT_SWAPOFF + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + This option enables the 'swapoff' utility. config BUSYBOX_CONFIG_SWITCH_ROOT bool "switch_root" default BUSYBOX_DEFAULT_SWITCH_ROOT @@ -751,7 +838,28 @@ config BUSYBOX_CONFIG_SWITCH_ROOT * Because the Linux kernel uses rootfs internally as the starting and ending point for searching through the kernel's doubly linked list of active mount points. That's why. +config BUSYBOX_CONFIG_TASKSET + bool "taskset" + default BUSYBOX_DEFAULT_TASKSET + help + Retrieve or set a processes's CPU affinity. + This requires sched_{g,s}etaffinity support in your libc. +config BUSYBOX_CONFIG_FEATURE_TASKSET_FANCY + bool "Fancy output" + default BUSYBOX_DEFAULT_FEATURE_TASKSET_FANCY + depends on BUSYBOX_CONFIG_TASKSET + help + Needed for machines with more than 32-64 CPUs: + affinity parameter 0xHHHHHHHHHHHHHHHHHHHH can be arbitrarily long + in this case. Otherwise, it is limited to sizeof(long). +config BUSYBOX_CONFIG_UEVENT + bool "uevent" + default BUSYBOX_DEFAULT_UEVENT + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + uevent is a netlink listener for kernel uevent notifications + sent via netlink. It is usually used for dynamic device creation. config BUSYBOX_CONFIG_UMOUNT bool "umount" default BUSYBOX_DEFAULT_UMOUNT @@ -768,6 +876,20 @@ config BUSYBOX_CONFIG_FEATURE_UMOUNT_ALL depends on BUSYBOX_CONFIG_UMOUNT help Support -a option to unmount all currently mounted filesystems. +config BUSYBOX_CONFIG_UNSHARE + bool "unshare" + default BUSYBOX_DEFAULT_UNSHARE + depends on !BUSYBOX_CONFIG_NOMMU + select BUSYBOX_CONFIG_PLATFORM_LINUX + select BUSYBOX_CONFIG_LONG_OPTS + help + Run program with some namespaces unshared from parent. +config BUSYBOX_CONFIG_WALL + bool "wall" + default BUSYBOX_DEFAULT_WALL + depends on BUSYBOX_CONFIG_FEATURE_UTMP + help + Write a message to all users that are logged in. comment "Common options for mount/umount" depends on BUSYBOX_CONFIG_MOUNT || BUSYBOX_CONFIG_UMOUNT @@ -802,7 +924,7 @@ config BUSYBOX_CONFIG_FEATURE_MOUNT_LOOP_CREATE if it does not find a free one. config BUSYBOX_CONFIG_FEATURE_MTAB_SUPPORT - bool "Support for the old /etc/mtab file" + bool "Support old /etc/mtab file" default BUSYBOX_DEFAULT_FEATURE_MTAB_SUPPORT depends on BUSYBOX_CONFIG_MOUNT || BUSYBOX_CONFIG_UMOUNT select BUSYBOX_CONFIG_FEATURE_MOUNT_FAKE diff --git a/package/utils/busybox/config/util-linux/volume_id/Config.in b/package/utils/busybox/config/util-linux/volume_id/Config.in index 6153314d6..afbfa4ae5 100644 --- a/package/utils/busybox/config/util-linux/volume_id/Config.in +++ b/package/utils/busybox/config/util-linux/volume_id/Config.in @@ -11,31 +11,18 @@ config BUSYBOX_CONFIG_VOLUMEID menu "Filesystem/Volume identification" depends on BUSYBOX_CONFIG_VOLUMEID - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_BCACHE bool "bcache filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_BCACHE depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_BTRFS bool "btrfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_BTRFS depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_CRAMFS bool "cramfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_CRAMFS depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_EXFAT bool "exFAT filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_EXFAT @@ -44,16 +31,10 @@ config BUSYBOX_CONFIG_FEATURE_VOLUMEID_EXFAT exFAT (extended FAT) is a proprietary file system designed especially for flash drives. It has many features from NTFS, but with less overhead. exFAT is used on most SDXC cards for consumer electronics. - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_EXT bool "Ext filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_EXT depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_F2FS bool "f2fs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_F2FS @@ -63,64 +44,34 @@ config BUSYBOX_CONFIG_FEATURE_VOLUMEID_F2FS which is adapted to newer forms of storage. F2FS also remedies some known issues of the older log structured file systems, such as high cleaning overhead. - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_FAT bool "fat filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_FAT depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_HFS bool "hfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_HFS depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_ISO9660 bool "iso9660 filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_ISO9660 depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_JFS bool "jfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_JFS depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_LINUXRAID bool "linuxraid" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_LINUXRAID depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_LINUXSWAP bool "linux swap filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_LINUXSWAP depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_LUKS bool "luks filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_LUKS depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_NILFS bool "nilfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_NILFS @@ -136,40 +87,22 @@ config BUSYBOX_CONFIG_FEATURE_VOLUMEID_NILFS SOX compliance logging, and so forth. It can serve as an alternative filesystem for Linux desktop environment, or as a basis of advanced storage appliances. - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_NTFS bool "ntfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_NTFS depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_OCFS2 bool "ocfs2 filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_OCFS2 depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_REISERFS bool "Reiser filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_REISERFS depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_ROMFS bool "romfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_ROMFS depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_SQUASHFS bool "SquashFS filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_SQUASHFS @@ -179,134 +112,76 @@ config BUSYBOX_CONFIG_FEATURE_VOLUMEID_SQUASHFS intended for general read-only filesystem use and in constrained block device/memory systems (e.g. embedded systems) where low overhead is needed. - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_SYSV bool "sysv filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_SYSV depends on BUSYBOX_CONFIG_VOLUMEID +config BUSYBOX_CONFIG_FEATURE_VOLUMEID_UBIFS + bool "UBIFS filesystem" + default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_UBIFS + depends on BUSYBOX_CONFIG_VOLUMEID help - TODO - - + UBIFS (Unsorted Block Image File System) is a file + system for use with raw flash memory media. config BUSYBOX_CONFIG_FEATURE_VOLUMEID_UDF bool "udf filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_UDF depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - ### config FEATURE_VOLUMEID_HIGHPOINTRAID ### bool "highpoint raid" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_HPFS ### bool "hpfs filesystem" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_ISWRAID ### bool "intel raid" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_LSIRAID ### bool "lsi raid" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_LVM ### bool "lvm" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_MAC ### bool "mac filesystem" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_MINIX ### bool "minix filesystem" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_MSDOS ### bool "msdos filesystem" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_NVIDIARAID ### bool "nvidia raid" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_PROMISERAID ### bool "promise raid" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_SILICONRAID ### bool "silicon raid" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_UFS ### bool "ufs filesystem" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_VIARAID ### bool "via raid" ### default y ### depends on VOLUMEID -### help -### TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_XFS bool "xfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_XFS depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - endmenu diff --git a/package/utils/busybox/patches/002-libbb-send_to_from-do-not-require-that-to-should-hav.patch b/package/utils/busybox/patches/002-libbb-send_to_from-do-not-require-that-to-should-hav.patch deleted file mode 100644 index f33c3b22e..000000000 --- a/package/utils/busybox/patches/002-libbb-send_to_from-do-not-require-that-to-should-hav.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 7cef4817d6d6d61a1166ed7dfc13537b95c65970 Mon Sep 17 00:00:00 2001 -From: Denys Vlasenko -Date: Thu, 15 Sep 2016 13:20:51 +0200 -Subject: [PATCH] libbb:/send_to_from: do not require that "to" should have the - same AF. Closes 9146 - -Signed-off-by: Denys Vlasenko ---- - libbb/udp_io.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - ---- a/libbb/udp_io.c -+++ b/libbb/udp_io.c -@@ -70,7 +70,13 @@ send_to_from(int fd, void *buf, size_t l - msg.msg_flags = flags; - - cmsgptr = CMSG_FIRSTHDR(&msg); -- if (to->sa_family == AF_INET && from->sa_family == AF_INET) { -+ /* -+ * Users report that to->sa_family can be AF_INET6 too, -+ * if "to" was acquired by recv_from_to(). IOW: recv_from_to() -+ * was seen showing IPv6 "from" even when the destination -+ * of received packet (our local address) was IPv4. -+ */ -+ if (/* to->sa_family == AF_INET && */ from->sa_family == AF_INET) { - struct in_pktinfo *pktptr; - cmsgptr->cmsg_level = IPPROTO_IP; - cmsgptr->cmsg_type = IP_PKTINFO; -@@ -86,7 +92,7 @@ send_to_from(int fd, void *buf, size_t l - pktptr->ipi_spec_dst = ((struct sockaddr_in*)from)->sin_addr; - } - # if ENABLE_FEATURE_IPV6 && defined(IPV6_PKTINFO) -- else if (to->sa_family == AF_INET6 && from->sa_family == AF_INET6) { -+ else if (/* to->sa_family == AF_INET6 && */ from->sa_family == AF_INET6) { - struct in6_pktinfo *pktptr; - cmsgptr->cmsg_level = IPPROTO_IPV6; - cmsgptr->cmsg_type = IPV6_PKTINFO; diff --git a/package/utils/busybox/patches/102-trylink_mktemp_fix.patch b/package/utils/busybox/patches/102-trylink_mktemp_fix.patch deleted file mode 100644 index ed1dcbb66..000000000 --- a/package/utils/busybox/patches/102-trylink_mktemp_fix.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/scripts/trylink -+++ b/scripts/trylink -@@ -46,7 +46,7 @@ try() { - } - - check_cc() { -- local tempname="$(mktemp)" -+ local tempname="$(mktemp /tmp/tmp.XXXXXXXXXX)" - local r - echo "int main(int argc,char**argv){return argv?argc:0;}" >"$tempname".c - # Can use "-o /dev/null", but older gcc tend to *unlink it* on failure! :( -@@ -61,7 +61,7 @@ check_cc() { - } - - check_libc_is_glibc() { -- local tempname="$(mktemp)" -+ local tempname="$(mktemp /tmp/tmp.XXXXXXXXXX)" - local r - echo "\ - #include diff --git a/package/utils/busybox/patches/120-remove_uclibc_rpc_check.patch b/package/utils/busybox/patches/120-remove_uclibc_rpc_check.patch deleted file mode 100644 index 4825bc8a6..000000000 --- a/package/utils/busybox/patches/120-remove_uclibc_rpc_check.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/util-linux/mount.c -+++ b/util-linux/mount.c -@@ -237,9 +237,6 @@ - #if ENABLE_FEATURE_MOUNT_NFS - /* This is just a warning of a common mistake. Possibly this should be a - * uclibc faq entry rather than in busybox... */ --# if defined(__UCLIBC__) && ! defined(__UCLIBC_HAS_RPC__) --# error "You need to build uClibc with UCLIBC_HAS_RPC for NFS support" --# endif - # include - # include - # include diff --git a/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch b/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch index 0fdaed502..5f64c19d0 100644 --- a/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch +++ b/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch @@ -1,6 +1,6 @@ --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c -@@ -697,6 +697,7 @@ static int bcast_or_ucast(struct dhcp_pa +@@ -706,6 +706,7 @@ static int bcast_or_ucast(struct dhcp_pa static NOINLINE int send_discover(uint32_t xid, uint32_t requested) { struct dhcp_packet packet; @@ -8,7 +8,7 @@ /* Fill in: op, htype, hlen, cookie, chaddr fields, * random xid field (we override it below), -@@ -714,6 +715,7 @@ static NOINLINE int send_discover(uint32 +@@ -723,6 +724,7 @@ static NOINLINE int send_discover(uint32 */ add_client_options(&packet); diff --git a/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch b/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch index 4a9ae9813..727f69409 100644 --- a/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch +++ b/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch @@ -1,6 +1,6 @@ --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c -@@ -1422,6 +1422,12 @@ int udhcpc_main(int argc UNUSED_PARAM, c +@@ -1442,6 +1442,12 @@ int udhcpc_main(int argc UNUSED_PARAM, c /* silence "uninitialized!" warning */ unsigned timestamp_before_wait = timestamp_before_wait; diff --git a/package/utils/busybox/patches/203-udhcpc_renew_no_deconfig.patch b/package/utils/busybox/patches/203-udhcpc_renew_no_deconfig.patch index 1e44552c1..7b77d2970 100644 --- a/package/utils/busybox/patches/203-udhcpc_renew_no_deconfig.patch +++ b/package/utils/busybox/patches/203-udhcpc_renew_no_deconfig.patch @@ -1,6 +1,6 @@ --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c -@@ -1103,7 +1103,6 @@ static void perform_renew(void) +@@ -1112,7 +1112,6 @@ static void perform_renew(void) state = RENEW_REQUESTED; break; case RENEW_REQUESTED: /* impatient are we? fine, square 1 */ diff --git a/package/utils/busybox/patches/210-add_netmsg_util.patch b/package/utils/busybox/patches/210-add_netmsg_util.patch index 2382698d0..d7b2ae7c4 100644 --- a/package/utils/busybox/patches/210-add_netmsg_util.patch +++ b/package/utils/busybox/patches/210-add_netmsg_util.patch @@ -1,46 +1,25 @@ ---- a/include/applets.src.h -+++ b/include/applets.src.h -@@ -229,6 +229,7 @@ IF_MT(APPLET(mt, BB_DIR_BIN, BB_SUID_DRO - IF_MV(APPLET(mv, BB_DIR_BIN, BB_SUID_DROP)) - IF_NAMEIF(APPLET(nameif, BB_DIR_SBIN, BB_SUID_DROP)) - IF_NC(APPLET(nc, BB_DIR_USR_BIN, BB_SUID_DROP)) -+IF_NETMSG(APPLET(netmsg, BB_DIR_BIN, BB_SUID_REQUIRE)) - IF_NETSTAT(APPLET(netstat, BB_DIR_BIN, BB_SUID_DROP)) - IF_NICE(APPLET(nice, BB_DIR_BIN, BB_SUID_DROP)) - IF_NOHUP(APPLET(nohup, BB_DIR_USR_BIN, BB_SUID_DROP)) ---- a/networking/Config.src -+++ b/networking/Config.src -@@ -639,6 +639,12 @@ config FEATURE_IPCALC_LONG_OPTIONS - help - Support long options for the ipcalc applet. - -+config NETMSG -+ bool "netmsg" -+ default n -+ help -+ simple program for sending udp broadcast messages -+ - config NETSTAT - bool "netstat" - default y ---- a/networking/Kbuild.src -+++ b/networking/Kbuild.src -@@ -27,6 +27,7 @@ lib-$(CONFIG_IP) += ip.o - lib-$(CONFIG_IPCALC) += ipcalc.o - lib-$(CONFIG_NAMEIF) += nameif.o - lib-$(CONFIG_NC) += nc.o -+lib-$(CONFIG_NETMSG) += netmsg.o - lib-$(CONFIG_NETSTAT) += netstat.o - lib-$(CONFIG_NSLOOKUP) += nslookup.o - lib-$(CONFIG_NTPD) += ntpd.o --- /dev/null +++ b/networking/netmsg.c -@@ -0,0 +1,65 @@ +@@ -0,0 +1,76 @@ +/* + * Copyright (C) 2006 Felix Fietkau + * + * This is free software, licensed under the GNU General Public License v2. + */ ++ ++//config:config NETMSG ++//config: bool "netmsg" ++//config: default n ++//config: help ++//config: simple program for sending udp broadcast messages ++ ++//applet:IF_NETMSG(APPLET(netmsg, BB_DIR_BIN, BB_SUID_REQUIRE)) ++ ++//kbuild:lib-$(CONFIG_NETMSG) += netmsg.o ++ ++//usage:#define netmsg_trivial_usage NOUSAGE_STR ++//usage:#define netmsg_full_usage "" ++ +#include +#include +#include @@ -50,9 +29,6 @@ +#include +#include "busybox.h" + -+//usage:#define netmsg_trivial_usage NOUSAGE_STR -+//usage:#define netmsg_full_usage "" -+ +#ifndef CONFIG_NETMSG +int main(int argc, char **argv) +#else diff --git a/package/utils/busybox/patches/220-add_lock_util.patch b/package/utils/busybox/patches/220-add_lock_util.patch index c60f5db39..4e46b74f0 100644 --- a/package/utils/busybox/patches/220-add_lock_util.patch +++ b/package/utils/busybox/patches/220-add_lock_util.patch @@ -1,46 +1,25 @@ ---- a/include/applets.src.h -+++ b/include/applets.src.h -@@ -196,6 +196,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, - IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP)) - IF_LOADFONT(APPLET(loadfont, BB_DIR_USR_SBIN, BB_SUID_DROP)) - IF_LOADKMAP(APPLET(loadkmap, BB_DIR_SBIN, BB_SUID_DROP)) -+IF_LOCK(APPLET(lock, BB_DIR_BIN, BB_SUID_DROP)) - IF_LOGNAME(APPLET_NOFORK(logname, logname, BB_DIR_USR_BIN, BB_SUID_DROP, logname)) - IF_LOSETUP(APPLET(losetup, BB_DIR_SBIN, BB_SUID_DROP)) - IF_LS(APPLET_NOEXEC(ls, ls, BB_DIR_BIN, BB_SUID_DROP, ls)) ---- a/miscutils/Config.src -+++ b/miscutils/Config.src -@@ -375,6 +375,12 @@ config FEATURE_HDPARM_HDIO_GETSET_DMA - help - Enables the 'hdparm -d' option to get/set using_dma flag. - -+config LOCK -+ bool "lock" -+ default n -+ help -+ Small utility for using locks in scripts -+ - config MAKEDEVS - bool "makedevs" - default y ---- a/miscutils/Kbuild.src -+++ b/miscutils/Kbuild.src -@@ -33,6 +33,7 @@ lib-$(CONFIG_LAST) += last.o - endif - - lib-$(CONFIG_LESS) += less.o -+lib-$(CONFIG_LOCK) += lock.o - lib-$(CONFIG_MAKEDEVS) += makedevs.o - lib-$(CONFIG_MAN) += man.o - lib-$(CONFIG_MICROCOM) += microcom.o --- /dev/null +++ b/miscutils/lock.c -@@ -0,0 +1,144 @@ +@@ -0,0 +1,155 @@ +/* + * Copyright (C) 2006 Felix Fietkau + * + * This is free software, licensed under the GNU General Public License v2. + */ ++ ++//config:config LOCK ++//config: bool "lock" ++//config: default n ++//config: help ++//config: Small utility for using locks in scripts ++ ++//applet:IF_LOCK(APPLET(lock, BB_DIR_BIN, BB_SUID_DROP)) ++ ++//kbuild:lib-$(CONFIG_LOCK) += lock.o ++ ++//usage:#define lock_trivial_usage NOUSAGE_STR ++//usage:#define lock_full_usage "" ++ +#include +#include +#include @@ -50,9 +29,6 @@ +#include +#include "busybox.h" + -+//usage:#define lock_trivial_usage NOUSAGE_STR -+//usage:#define lock_full_usage "" -+ +static int unlock = 0; +static int shared = 0; +static int waitonly = 0; diff --git a/package/utils/busybox/patches/230-add_nslookup_lede.patch b/package/utils/busybox/patches/230-add_nslookup_lede.patch index 976960cf1..14c0e87b3 100644 --- a/package/utils/busybox/patches/230-add_nslookup_lede.patch +++ b/package/utils/busybox/patches/230-add_nslookup_lede.patch @@ -17,8 +17,6 @@ Signed-off-by: Jo-Philipp Wich 2 files changed, 921 insertions(+) create mode 100644 networking/nslookup_lede.c -diff --git a/Makefile.flags b/Makefile.flags -index 65021de25..096ab7756 100644 --- a/Makefile.flags +++ b/Makefile.flags @@ -134,6 +134,12 @@ else @@ -34,9 +32,6 @@ index 65021de25..096ab7756 100644 # libpam may use libpthread, libdl and/or libaudit. # On some platforms that requires an explicit -lpthread, -ldl, -laudit. # However, on *other platforms* it fails when some of those flags -diff --git a/networking/nslookup_lede.c b/networking/nslookup_lede.c -new file mode 100644 -index 000000000..c6c90ddf3 --- /dev/null +++ b/networking/nslookup_lede.c @@ -0,0 +1,915 @@ @@ -58,23 +53,23 @@ index 000000000..c6c90ddf3 + * 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]" @@ -758,7 +753,7 @@ index 000000000..c6c90ddf3 +} + + -+#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" @@ -783,7 +778,7 @@ index 000000000..c6c90ddf3 + 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 + @@ -955,6 +950,3 @@ index 000000000..c6c90ddf3 + + return rc; +} --- -2.11.0 - diff --git a/package/utils/busybox/patches/240-telnetd_intr.patch b/package/utils/busybox/patches/240-telnetd_intr.patch index d52ea3fcc..fec2a3a5d 100644 --- a/package/utils/busybox/patches/240-telnetd_intr.patch +++ b/package/utils/busybox/patches/240-telnetd_intr.patch @@ -1,6 +1,6 @@ --- a/networking/telnetd.c +++ b/networking/telnetd.c -@@ -333,6 +333,7 @@ make_new_session( +@@ -497,6 +497,7 @@ make_new_session( /* Restore default signal handling ASAP */ bb_signals((1 << SIGCHLD) + (1 << SIGPIPE), SIG_DFL); diff --git a/package/utils/busybox/patches/250-date-k-flag.patch b/package/utils/busybox/patches/250-date-k-flag.patch index b2681a17f..476440f62 100644 --- a/package/utils/busybox/patches/250-date-k-flag.patch +++ b/package/utils/busybox/patches/250-date-k-flag.patch @@ -1,6 +1,6 @@ --- a/coreutils/date.c +++ b/coreutils/date.c -@@ -123,6 +123,7 @@ +@@ -122,6 +122,7 @@ //usage: IF_FEATURE_DATE_ISOFMT( //usage: "\n -D FMT Use FMT for -d TIME conversion" //usage: ) @@ -8,7 +8,7 @@ //usage: "\n" //usage: "\nRecognized TIME formats:" //usage: "\n hh:mm[:ss]" -@@ -139,9 +140,8 @@ +@@ -138,9 +139,8 @@ #include "libbb.h" #include "common_bufsiz.h" @@ -20,7 +20,7 @@ enum { OPT_RFC2822 = (1 << 0), /* R */ -@@ -149,8 +149,9 @@ enum { +@@ -148,8 +148,9 @@ enum { OPT_UTC = (1 << 2), /* u */ OPT_DATE = (1 << 3), /* d */ OPT_REFERENCE = (1 << 4), /* r */ @@ -32,7 +32,7 @@ }; static void maybe_set_utc(int opt) -@@ -168,12 +169,15 @@ static const char date_longopts[] ALIGN1 +@@ -167,12 +168,15 @@ static const char date_longopts[] ALIGN1 /* "universal\0" No_argument "u" */ "date\0" Required_argument "d" "reference\0" Required_argument "r" @@ -48,7 +48,7 @@ struct timespec ts; struct tm tm_time; char buf_fmt_dt2str[64]; -@@ -188,7 +192,7 @@ int date_main(int argc UNUSED_PARAM, cha +@@ -187,7 +191,7 @@ int date_main(int argc UNUSED_PARAM, cha opt_complementary = "d--s:s--d" IF_FEATURE_DATE_ISOFMT(":R--I:I--R"); IF_LONG_OPTS(applet_long_options = date_longopts;) @@ -57,7 +57,7 @@ IF_FEATURE_DATE_ISOFMT("I::D:"), &date_str, &date_str, &filename IF_FEATURE_DATE_ISOFMT(, &isofmt_arg, &fmt_str2dt)); -@@ -245,6 +249,31 @@ int date_main(int argc UNUSED_PARAM, cha +@@ -244,6 +248,31 @@ int date_main(int argc UNUSED_PARAM, cha if (*argv) bb_show_usage(); diff --git a/package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch b/package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch index 360324bf7..ca76c44cc 100644 --- a/package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch +++ b/package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch @@ -1,6 +1,6 @@ --- a/networking/libiproute/iplink.c +++ b/networking/libiproute/iplink.c -@@ -470,7 +470,7 @@ static int do_add_or_delete(char **argv, +@@ -598,7 +598,7 @@ static int do_add_or_delete(char **argv, } xrtnl_open(&rth); ll_init_map(&rth); diff --git a/package/utils/busybox/patches/302-ip-rule-add-suppress-prefixlength.patch b/package/utils/busybox/patches/302-ip-rule-add-suppress-prefixlength.patch deleted file mode 100644 index 7b4797505..000000000 --- a/package/utils/busybox/patches/302-ip-rule-add-suppress-prefixlength.patch +++ /dev/null @@ -1,145 +0,0 @@ -From dbac30c3784c267bbe44a2a3ebed4e827c8fe82a Mon Sep 17 00:00:00 2001 -From: Stefan Tomanek -Date: Tue, 13 Jun 2017 19:06:09 +0200 -Subject: [PATCH] ip rule: add suppress_{prefixlength,ifgroup} options - -(cherry-picked from 192dce4b84fb32346ebc5194de7daa5da3b8d1b4) - -function old new delta -iprule_modify 816 887 +71 -print_rule 610 680 +70 ------------------------------------------------------------------------------- -(add/remove: 0/0 grow/shrink: 2/0 up/down: 141/0) Total: 141 bytes - -Signed-off-by: Stefan Tomanek -Signed-off-by: Denys Vlasenko ---- - networking/libiproute/iprule.c | 73 ++++++++++++++++++++++++++---------------- - 1 file changed, 46 insertions(+), 27 deletions(-) - ---- a/networking/libiproute/iprule.c -+++ b/networking/libiproute/iprule.c -@@ -17,25 +17,32 @@ - #include - #include - -+/* from : */ -+#define FRA_SUPPRESS_IFGROUP 13 -+#define FRA_SUPPRESS_PREFIXLEN 14 -+ - #include "ip_common.h" /* #include "libbb.h" is inside */ - #include "rt_names.h" - #include "utils.h" - --/* --static void usage(void) __attribute__((noreturn)); -- --static void usage(void) --{ -- fprintf(stderr, "Usage: ip rule [ list | add | del ] SELECTOR ACTION\n"); -- fprintf(stderr, "SELECTOR := [ from PREFIX ] [ to PREFIX ] [ tos TOS ] [ fwmark FWMARK ]\n"); -- fprintf(stderr, " [ dev STRING ] [ pref NUMBER ]\n"); -- fprintf(stderr, "ACTION := [ table TABLE_ID ] [ nat ADDRESS ]\n"); -- fprintf(stderr, " [ prohibit | reject | unreachable ]\n"); -- fprintf(stderr, " [ realms [SRCREALM/]DSTREALM ]\n"); -- fprintf(stderr, "TABLE_ID := [ local | main | default | NUMBER ]\n"); -- exit(-1); --} --*/ -+/* If you add stuff here, update iprule_full_usage */ -+static const char keywords[] ALIGN1 = -+ "from\0""to\0""preference\0""order\0""priority\0" -+ "tos\0""fwmark\0""realms\0""table\0""lookup\0" -+ "suppress_prefixlength\0""suppress_ifgroup\0" -+ "dev\0""iif\0""nat\0""map-to\0""type\0""help\0" -+ ; -+#define keyword_preference (keywords + sizeof("from") + sizeof("to")) -+#define keyword_fwmark (keyword_preference + sizeof("preference") + sizeof("order") + sizeof("priority") + sizeof("tos")) -+#define keyword_realms (keyword_fwmark + sizeof("fwmark")) -+#define keyword_suppress_prefixlength (keyword_realms + sizeof("realms") + sizeof("table") + sizeof("lookup")) -+#define keyword_suppress_ifgroup (keyword_suppress_prefixlength + sizeof("suppress_prefixlength")) -+enum { -+ ARG_from = 1, ARG_to, ARG_preference, ARG_order, ARG_priority, -+ ARG_tos, ARG_fwmark, ARG_realms, ARG_table, ARG_lookup, -+ ARG_suppress_prefixlength, ARG_suppress_ifgroup, -+ ARG_dev, ARG_iif, ARG_nat, ARG_map_to, ARG_type, ARG_help, -+}; - - static int FAST_FUNC print_rule(const struct sockaddr_nl *who UNUSED_PARAM, - struct nlmsghdr *n, void *arg UNUSED_PARAM) -@@ -119,6 +126,17 @@ static int FAST_FUNC print_rule(const st - else if (r->rtm_table) - printf("lookup %s ", rtnl_rttable_n2a(r->rtm_table)); - -+ if (tb[FRA_SUPPRESS_PREFIXLEN]) { -+ int pl = *(uint32_t*)RTA_DATA(tb[FRA_SUPPRESS_PREFIXLEN]); -+ if (pl != -1) -+ printf("%s %d ", keyword_suppress_prefixlength, pl); -+ } -+ if (tb[FRA_SUPPRESS_IFGROUP]) { -+ int grp = *(uint32_t*)RTA_DATA(tb[FRA_SUPPRESS_IFGROUP]); -+ if (grp != -1) -+ printf("%s %d ", keyword_suppress_ifgroup, grp); -+ } -+ - if (tb[RTA_FLOW]) { - uint32_t to = *(uint32_t*)RTA_DATA(tb[RTA_FLOW]); - uint32_t from = to>>16; -@@ -174,15 +192,6 @@ static int iprule_list(char **argv) - /* Return value becomes exitcode. It's okay to not return at all */ - static int iprule_modify(int cmd, char **argv) - { -- static const char keywords[] ALIGN1 = -- "from\0""to\0""preference\0""order\0""priority\0" -- "tos\0""fwmark\0""realms\0""table\0""lookup\0""dev\0" -- "iif\0""nat\0""map-to\0""type\0""help\0"; -- enum { -- ARG_from = 1, ARG_to, ARG_preference, ARG_order, ARG_priority, -- ARG_tos, ARG_fwmark, ARG_realms, ARG_table, ARG_lookup, ARG_dev, -- ARG_iif, ARG_nat, ARG_map_to, ARG_type, ARG_help -- }; - bool table_ok = 0; - struct rtnl_handle rth; - struct { -@@ -232,7 +241,7 @@ static int iprule_modify(int cmd, char * - ) { - uint32_t pref; - NEXT_ARG(); -- pref = get_u32(*argv, "preference"); -+ pref = get_u32(*argv, keyword_preference); - addattr32(&req.n, sizeof(req), RTA_PRIORITY, pref); - } else if (key == ARG_tos) { - uint32_t tos; -@@ -243,13 +252,13 @@ static int iprule_modify(int cmd, char * - } else if (key == ARG_fwmark) { - uint32_t fwmark; - NEXT_ARG(); -- fwmark = get_u32(*argv, "fwmark"); -+ fwmark = get_u32(*argv, keyword_fwmark); - addattr32(&req.n, sizeof(req), RTA_PROTOINFO, fwmark); - } else if (key == ARG_realms) { - uint32_t realm; - NEXT_ARG(); - if (get_rt_realms(&realm, *argv)) -- invarg_1_to_2(*argv, "realms"); -+ invarg_1_to_2(*argv, keyword_realms); - addattr32(&req.n, sizeof(req), RTA_FLOW, realm); - } else if (key == ARG_table || - key == ARG_lookup -@@ -265,6 +274,16 @@ static int iprule_modify(int cmd, char * - addattr32(&req.n, sizeof(req), RTA_TABLE, tid); - } - table_ok = 1; -+ } else if (key == ARG_suppress_prefixlength) { -+ int prefix_length; -+ NEXT_ARG(); -+ prefix_length = get_u32(*argv, keyword_suppress_prefixlength); -+ addattr32(&req.n, sizeof(req), FRA_SUPPRESS_PREFIXLEN, prefix_length); -+ } else if (key == ARG_suppress_ifgroup) { -+ int grp; -+ NEXT_ARG(); -+ grp = get_u32(*argv, keyword_suppress_ifgroup); -+ addattr32(&req.n, sizeof(req), FRA_SUPPRESS_IFGROUP, grp); - } else if (key == ARG_dev || - key == ARG_iif - ) { diff --git a/package/utils/busybox/patches/302-netlink-alignment.patch b/package/utils/busybox/patches/302-netlink-alignment.patch deleted file mode 100644 index 4cd25b187..000000000 --- a/package/utils/busybox/patches/302-netlink-alignment.patch +++ /dev/null @@ -1,100 +0,0 @@ -From a843f09a4d4428cf11ca02307e60058251b05743 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Fri, 16 Sep 2016 21:52:03 +0200 -Subject: [PATCH] libnetlink: fix alignment of netlink messages - -An padding to align a message should not only be added between -different attributes of a netlink message, but also at the end of the -message to pad it to the correct size. - -Without this patch the following command does not work and returns an -error code: -ip link add type nlmon - -Without this ip from busybox sends this: -sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base={{len=45, type=0x10 /* NLMSG_??? */, flags=NLM_F_REQUEST|NLM_F_ACK|0x600, seq=1474057401, pid=0}, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\22\0\t\0\1nlmon"}, iov_len=45}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 45 -return value: 2 - -The normal ip utile from iproute2 sends this: -sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base={{len=48, type=0x10 /* NLMSG_??? */, flags=NLM_F_REQUEST|NLM_F_ACK|0x600, seq=1473716938, pid=0}, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\22\0\t\0\1nlmon\0\0\0"}, iov_len=48}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 48 -return value: 0 - -With this patch ip from busybox sends this: -sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base={{len=48, type=0x10 /* NLMSG_??? */, flags=NLM_F_REQUEST|NLM_F_ACK|0x600, seq=1473716908, pid=0}, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\22\0\t\0\1nlmon\0\0\0"}, iov_len=48}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 48 -return value: 0 - -Signed-off-by: Hauke Mehrtens ---- - networking/libiproute/libnetlink.c | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - ---- a/networking/libiproute/libnetlink.c -+++ b/networking/libiproute/libnetlink.c -@@ -338,14 +338,14 @@ int FAST_FUNC addattr32(struct nlmsghdr - int len = RTA_LENGTH(4); - struct rtattr *rta; - -- if ((int)(NLMSG_ALIGN(n->nlmsg_len) + len) > maxlen) { -+ if ((int)(NLMSG_ALIGN(n->nlmsg_len + len)) > maxlen) { - return -1; - } - rta = (struct rtattr*)(((char*)n) + NLMSG_ALIGN(n->nlmsg_len)); - rta->rta_type = type; - rta->rta_len = len; - move_to_unaligned32(RTA_DATA(rta), data); -- n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + len; -+ n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len + len); - return 0; - } - -@@ -354,14 +354,14 @@ int FAST_FUNC addattr_l(struct nlmsghdr - int len = RTA_LENGTH(alen); - struct rtattr *rta; - -- if ((int)(NLMSG_ALIGN(n->nlmsg_len) + len) > maxlen) { -+ if ((int)(NLMSG_ALIGN(n->nlmsg_len + len)) > maxlen) { - return -1; - } - rta = (struct rtattr*)(((char*)n) + NLMSG_ALIGN(n->nlmsg_len)); - rta->rta_type = type; - rta->rta_len = len; - memcpy(RTA_DATA(rta), data, alen); -- n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + len; -+ n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len + len); - return 0; - } - -@@ -370,14 +370,14 @@ int FAST_FUNC rta_addattr32(struct rtatt - int len = RTA_LENGTH(4); - struct rtattr *subrta; - -- if (RTA_ALIGN(rta->rta_len) + len > maxlen) { -+ if (RTA_ALIGN(rta->rta_len + len) > maxlen) { - return -1; - } - subrta = (struct rtattr*)(((char*)rta) + RTA_ALIGN(rta->rta_len)); - subrta->rta_type = type; - subrta->rta_len = len; - move_to_unaligned32(RTA_DATA(subrta), data); -- rta->rta_len = NLMSG_ALIGN(rta->rta_len) + len; -+ rta->rta_len = NLMSG_ALIGN(rta->rta_len + len); - return 0; - } - -@@ -386,14 +386,14 @@ int FAST_FUNC rta_addattr_l(struct rtatt - struct rtattr *subrta; - int len = RTA_LENGTH(alen); - -- if (RTA_ALIGN(rta->rta_len) + len > maxlen) { -+ if (RTA_ALIGN(rta->rta_len + len) > maxlen) { - return -1; - } - subrta = (struct rtattr*)(((char*)rta) + RTA_ALIGN(rta->rta_len)); - subrta->rta_type = type; - subrta->rta_len = len; - memcpy(RTA_DATA(subrta), data, alen); -- rta->rta_len = NLMSG_ALIGN(rta->rta_len) + len; -+ rta->rta_len = NLMSG_ALIGN(rta->rta_len + len); - return 0; - } - diff --git a/package/utils/busybox/patches/303-ip-route-fix-high-table-ids.patch b/package/utils/busybox/patches/303-ip-route-fix-high-table-ids.patch deleted file mode 100644 index d7a38f632..000000000 --- a/package/utils/busybox/patches/303-ip-route-fix-high-table-ids.patch +++ /dev/null @@ -1,486 +0,0 @@ -From 485fcc89b99eae9cc7501eaff344b104e52ab7bf Mon Sep 17 00:00:00 2001 -From: Jo-Philipp Wich -Date: Mon, 26 Sep 2016 17:48:22 +0200 -Subject: [PATCH] iproute: properly support high routing table IDs - -The Linux kernel uses two distinct fields to denote the routing table ID in -use by network routes; the 8 bit `rtm_table` member of `struct rtmsg` and the -32 bit `RTA_TABLE` netlink attribute. - -If a routing table ID is larger than 255, the `RT_TABLE` attribute must be used -and the `rtm_table` field has to be set to the special `RT_TABLE_UNSPEC` value. - -This commit ... - - switches the *_n2a() and *_a2n() functions of rt_names.c to use dynamically - sized, name-sorted arrays instead of fixed arrays limited to 1024 slots in - order to support IDs up to 65535 - - adds proper handling of high table IDs to iprule.c and iproute.c when - adding, removing and dumping ip rules and network routes - -After this change, the Busybox ip applet fully supports IP rules with high ID -numbers, using the same logic as the full iproute2. - -Signed-off-by: Jo-Philipp Wich ---- - networking/libiproute/iproute.c | 75 ++++++++------ - networking/libiproute/iprule.c | 4 +- - networking/libiproute/rt_names.c | 204 +++++++++++++++++++++++---------------- - 3 files changed, 169 insertions(+), 114 deletions(-) - ---- a/networking/libiproute/iproute.c -+++ b/networking/libiproute/iproute.c -@@ -66,6 +66,7 @@ static int FAST_FUNC print_route(const s - inet_prefix dst; - inet_prefix src; - int host_len = -1; -+ uint32_t rtable; - - if (n->nlmsg_type != RTM_NEWROUTE && n->nlmsg_type != RTM_DELROUTE) { - fprintf(stderr, "Not a route: %08x %08x %08x\n", -@@ -83,34 +84,6 @@ static int FAST_FUNC print_route(const s - else if (r->rtm_family == AF_INET) - host_len = 32; - -- if (r->rtm_family == AF_INET6) { -- if (G_filter.tb) { -- if (G_filter.tb < 0) { -- if (!(r->rtm_flags & RTM_F_CLONED)) { -- return 0; -- } -- } else { -- if (r->rtm_flags & RTM_F_CLONED) { -- return 0; -- } -- if (G_filter.tb == RT_TABLE_LOCAL) { -- if (r->rtm_type != RTN_LOCAL) { -- return 0; -- } -- } else if (G_filter.tb == RT_TABLE_MAIN) { -- if (r->rtm_type == RTN_LOCAL) { -- return 0; -- } -- } else { -- return 0; -- } -- } -- } -- } else { -- if (G_filter.tb > 0 && G_filter.tb != r->rtm_table) { -- return 0; -- } -- } - if (G_filter.rdst.family - && (r->rtm_family != G_filter.rdst.family || G_filter.rdst.bitlen > r->rtm_dst_len) - ) { -@@ -141,6 +114,37 @@ static int FAST_FUNC print_route(const s - memset(&dst, 0, sizeof(dst)); - parse_rtattr(tb, RTA_MAX, RTM_RTA(r), len); - -+ rtable = tb[RTA_TABLE] ? *(uint32_t*)RTA_DATA(tb[RTA_TABLE]) : r->rtm_table; -+ -+ if (G_filter.tb) { -+ if (r->rtm_family == AF_INET6) { -+ if (G_filter.tb < 0) { -+ if (!(r->rtm_flags & RTM_F_CLONED)) { -+ return 0; -+ } -+ } else { -+ if (r->rtm_flags & RTM_F_CLONED) { -+ return 0; -+ } -+ if (G_filter.tb == RT_TABLE_LOCAL) { -+ if (r->rtm_type != RTN_LOCAL) { -+ return 0; -+ } -+ } else if (G_filter.tb == RT_TABLE_MAIN) { -+ if (r->rtm_type == RTN_LOCAL) { -+ return 0; -+ } -+ } else if (G_filter.tb != rtable) { -+ return 0; -+ } -+ } -+ } else { -+ if (G_filter.tb != rtable) { -+ return 0; -+ } -+ } -+ } -+ - if (tb[RTA_SRC]) { - src.bitlen = r->rtm_src_len; - src.bytelen = (r->rtm_family == AF_INET6 ? 16 : 4); -@@ -349,7 +353,9 @@ IF_FEATURE_IP_RULE(ARG_table,) - smalluint ok = 0; - smalluint scope_ok = 0; - int arg; -- -+#if ENABLE_FEATURE_IP_RULE -+ uint32_t rtable = 0; -+#endif - memset(&req, 0, sizeof(req)); - - req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg)); -@@ -419,7 +425,7 @@ IF_FEATURE_IP_RULE(ARG_table,) - NEXT_ARG(); - if (rtnl_rttable_a2n(&tid, *argv)) - invarg_1_to_2(*argv, "table"); -- req.r.rtm_table = tid; -+ rtable = tid; - #endif - } else if (arg == ARG_dev || arg == ARG_oif) { - NEXT_ARG(); -@@ -475,6 +481,15 @@ IF_FEATURE_IP_RULE(ARG_table,) - } - } - -+#if ENABLE_FEATURE_IP_RULE -+ if (rtable >= 256) { -+ addattr32(&req.n, sizeof(req), RTA_TABLE, rtable); -+ req.r.rtm_table = RT_TABLE_UNSPEC; -+ } else if (rtable > 0) { -+ req.r.rtm_table = rtable; -+ } -+#endif -+ - if (mxrta->rta_len > RTA_LENGTH(0)) { - if (mxlock) { - rta_addattr32(mxrta, sizeof(mxbuf), RTAX_LOCK, mxlock); ---- a/networking/libiproute/iprule.c -+++ b/networking/libiproute/iprule.c -@@ -114,7 +114,9 @@ static int FAST_FUNC print_rule(const st - printf("iif %s ", (char*)RTA_DATA(tb[RTA_IIF])); - } - -- if (r->rtm_table) -+ if (tb[RTA_TABLE]) -+ printf("lookup %s ", rtnl_rttable_n2a(*(uint32_t*)RTA_DATA(tb[RTA_TABLE]))); -+ else if (r->rtm_table) - printf("lookup %s ", rtnl_rttable_n2a(r->rtm_table)); - - if (tb[RTA_FLOW]) { ---- a/networking/libiproute/rt_names.c -+++ b/networking/libiproute/rt_names.c -@@ -11,21 +11,26 @@ - #include "rt_names.h" - - #define CONFDIR CONFIG_FEATURE_IP_ROUTE_DIR -+#define RT_TABLE_MAX 65535 -+ -+struct rtnl_tab_entry { -+ unsigned int id; -+ const char *name; -+}; - - typedef struct rtnl_tab_t { -- const char *cached_str; -- unsigned cached_result; -- /* upstream version switched to a hash table and removed -- * id < 256 limit. For now bbox bumps this array size from 256 -- * to 1024. If you plan to change this to a hash table, -- * consider merging several hash tables we have (for example, -- * awk has resizable one! -- */ --#define RT_TABLE_MAX 1023 -- const char *tab[RT_TABLE_MAX+1]; -+ struct rtnl_tab_entry *tab; -+ size_t length; - } rtnl_tab_t; - --static void rtnl_tab_initialize(const char *file, const char **tab) -+static int tabcmp(const void *p1, const void *p2) -+{ -+ const struct rtnl_tab_entry *e1 = p1; -+ const struct rtnl_tab_entry *e2 = p2; -+ return strcmp(e1->name, e2->name); -+} -+ -+static void rtnl_tab_initialize(const char *file, rtnl_tab_t *tab) - { - char *token[2]; - char fullname[sizeof(CONFDIR"/rt_dsfield") + 8]; -@@ -40,34 +45,42 @@ static void rtnl_tab_initialize(const ch - file, parser->lineno); - break; - } -- tab[id] = xstrdup(token[1]); -+ -+ tab->tab = xrealloc(tab->tab, (tab->length + 1) * sizeof(*tab->tab)); -+ tab->tab[tab->length].id = id; -+ tab->tab[tab->length].name = xstrdup(token[1]); -+ tab->length++; - } - config_close(parser); -+ qsort(tab->tab, tab->length, sizeof(*tab->tab), tabcmp); - } - - static int rtnl_a2n(rtnl_tab_t *tab, uint32_t *id, const char *arg, int base) - { -- unsigned i; -- -- if (tab->cached_str && strcmp(tab->cached_str, arg) == 0) { -- *id = tab->cached_result; -- return 0; -- } -+ int delta; -+ ssize_t l = 0; -+ ssize_t r = tab->length - 1; -+ ssize_t m; -+ uint32_t i; -+ -+ while (l <= r) { -+ m = l + (r - l) / 2; -+ delta = strcmp(tab->tab[m].name, arg); - -- for (i = 0; i <= RT_TABLE_MAX; i++) { -- if (tab->tab[i] -- && strcmp(tab->tab[i], arg) == 0 -- ) { -- tab->cached_str = tab->tab[i]; -- tab->cached_result = i; -- *id = i; -+ if (delta == 0) { -+ *id = tab->tab[m].id; - return 0; -+ } else if (delta < 0) { -+ l = m + 1; -+ } else { -+ r = m - 1; - } - } - - i = bb_strtou(arg, NULL, base); - if (i > RT_TABLE_MAX) - return -1; -+ - *id = i; - return 0; - } -@@ -77,40 +90,39 @@ static rtnl_tab_t *rtnl_rtprot_tab; - - static void rtnl_rtprot_initialize(void) - { -- static const char *const init_tab[] = { -- "none", -- "redirect", -- "kernel", -- "boot", -- "static", -- NULL, -- NULL, -- NULL, -- "gated", -- "ra", -- "mrt", -- "zebra", -- "bird", -+ static const struct rtnl_tab_entry init_tab[] = { -+ { 0, "none" }, -+ { 1, "redirect" }, -+ { 2, "kernel" }, -+ { 3, "boot" }, -+ { 4, "static" }, -+ { 8, "gated" }, -+ { 9, "ra" }, -+ { 10, "mrt" }, -+ { 11, "zebra" }, -+ { 12, "bird" } - }; - - if (rtnl_rtprot_tab) - return; - rtnl_rtprot_tab = xzalloc(sizeof(*rtnl_rtprot_tab)); -+ rtnl_rtprot_tab->tab = xzalloc(sizeof(init_tab)); -+ rtnl_rtprot_tab->length = sizeof(init_tab) / sizeof(init_tab[0]); - memcpy(rtnl_rtprot_tab->tab, init_tab, sizeof(init_tab)); -- rtnl_tab_initialize("protos", rtnl_rtprot_tab->tab); -+ rtnl_tab_initialize("protos", rtnl_rtprot_tab); - } - - #if 0 /* UNUSED */ - const char* FAST_FUNC rtnl_rtprot_n2a(int id) - { -- if (id < 0 || id > RT_TABLE_MAX) { -- return itoa(id); -- } -+ size_t i; - - rtnl_rtprot_initialize(); - -- if (rtnl_rtprot_tab->tab[id]) -- return rtnl_rtprot_tab->tab[id]; -+ for (i = 0; i < rtnl_rtprot_tab->length; i++) -+ if (rtnl_rtprot_tab->tab[i].id == id) -+ return rtnl_rtprot_tab->tab[i].name; -+ - return itoa(id); - } - #endif -@@ -126,27 +138,33 @@ static rtnl_tab_t *rtnl_rtscope_tab; - - static void rtnl_rtscope_initialize(void) - { -+ static const struct rtnl_tab_entry init_tab[] = { -+ { 0, "global" }, -+ { 200, "site" }, -+ { 253, "link" }, -+ { 254, "host" }, -+ { 255, "nowhere" } -+ }; -+ - if (rtnl_rtscope_tab) - return; - rtnl_rtscope_tab = xzalloc(sizeof(*rtnl_rtscope_tab)); -- rtnl_rtscope_tab->tab[0] = "global"; -- rtnl_rtscope_tab->tab[255] = "nowhere"; -- rtnl_rtscope_tab->tab[254] = "host"; -- rtnl_rtscope_tab->tab[253] = "link"; -- rtnl_rtscope_tab->tab[200] = "site"; -- rtnl_tab_initialize("scopes", rtnl_rtscope_tab->tab); -+ rtnl_rtscope_tab->tab = xzalloc(sizeof(init_tab)); -+ rtnl_rtscope_tab->length = sizeof(init_tab) / sizeof(init_tab[0]); -+ memcpy(rtnl_rtscope_tab->tab, init_tab, sizeof(init_tab)); -+ rtnl_tab_initialize("scopes", rtnl_rtscope_tab); - } - - const char* FAST_FUNC rtnl_rtscope_n2a(int id) - { -- if (id < 0 || id > RT_TABLE_MAX) { -- return itoa(id); -- } -+ size_t i; - - rtnl_rtscope_initialize(); - -- if (rtnl_rtscope_tab->tab[id]) -- return rtnl_rtscope_tab->tab[id]; -+ for (i = 0; i < rtnl_rtscope_tab->length; i++) -+ if (rtnl_rtscope_tab->tab[i].id == id) -+ return rtnl_rtscope_tab->tab[i].name; -+ - return itoa(id); - } - -@@ -161,10 +179,17 @@ static rtnl_tab_t *rtnl_rtrealm_tab; - - static void rtnl_rtrealm_initialize(void) - { -- if (rtnl_rtrealm_tab) return; -+ static const struct rtnl_tab_entry init_tab[] = { -+ { 0, "unknown" } -+ }; -+ -+ if (rtnl_rtrealm_tab) -+ return; - rtnl_rtrealm_tab = xzalloc(sizeof(*rtnl_rtrealm_tab)); -- rtnl_rtrealm_tab->tab[0] = "unknown"; -- rtnl_tab_initialize("realms", rtnl_rtrealm_tab->tab); -+ rtnl_rtrealm_tab->tab = xzalloc(sizeof(init_tab)); -+ rtnl_rtrealm_tab->length = sizeof(init_tab) / sizeof(init_tab[0]); -+ memcpy(rtnl_rtrealm_tab->tab, init_tab, sizeof(init_tab)); -+ rtnl_tab_initialize("realms", rtnl_rtrealm_tab); - } - - int FAST_FUNC rtnl_rtrealm_a2n(uint32_t *id, char *arg) -@@ -176,14 +201,14 @@ int FAST_FUNC rtnl_rtrealm_a2n(uint32_t - #if ENABLE_FEATURE_IP_RULE - const char* FAST_FUNC rtnl_rtrealm_n2a(int id) - { -- if (id < 0 || id > RT_TABLE_MAX) { -- return itoa(id); -- } -+ size_t i; - - rtnl_rtrealm_initialize(); - -- if (rtnl_rtrealm_tab->tab[id]) -- return rtnl_rtrealm_tab->tab[id]; -+ for (i = 0; i < rtnl_rtrealm_tab->length; i++) -+ if (rtnl_rtrealm_tab->tab[i].id == id) -+ return rtnl_rtrealm_tab->tab[i].name; -+ - return itoa(id); - } - #endif -@@ -193,22 +218,29 @@ static rtnl_tab_t *rtnl_rtdsfield_tab; - - static void rtnl_rtdsfield_initialize(void) - { -- if (rtnl_rtdsfield_tab) return; -+ static const struct rtnl_tab_entry init_tab[] = { -+ { 0, "0" } -+ }; -+ -+ if (rtnl_rtdsfield_tab) -+ return; - rtnl_rtdsfield_tab = xzalloc(sizeof(*rtnl_rtdsfield_tab)); -- rtnl_rtdsfield_tab->tab[0] = "0"; -- rtnl_tab_initialize("dsfield", rtnl_rtdsfield_tab->tab); -+ rtnl_rtdsfield_tab->tab = xzalloc(sizeof(init_tab)); -+ rtnl_rtdsfield_tab->length = sizeof(init_tab) / sizeof(init_tab[0]); -+ memcpy(rtnl_rtdsfield_tab->tab, init_tab, sizeof(init_tab)); -+ rtnl_tab_initialize("dsfield", rtnl_rtdsfield_tab); - } - - const char* FAST_FUNC rtnl_dsfield_n2a(int id) - { -- if (id < 0 || id > RT_TABLE_MAX) { -- return itoa(id); -- } -+ size_t i; - - rtnl_rtdsfield_initialize(); - -- if (rtnl_rtdsfield_tab->tab[id]) -- return rtnl_rtdsfield_tab->tab[id]; -+ for (i = 0; i < rtnl_rtdsfield_tab->length; i++) -+ if (rtnl_rtdsfield_tab->tab[i].id == id) -+ return rtnl_rtdsfield_tab->tab[i].name; -+ - return itoa(id); - } - -@@ -224,27 +256,33 @@ static rtnl_tab_t *rtnl_rttable_tab; - - static void rtnl_rttable_initialize(void) - { -+ static const struct rtnl_tab_entry tab_init[] = { -+ { 0, "unspec" }, -+ { 253, "default" }, -+ { 254, "main" }, -+ { 255, "local" } -+ }; -+ - if (rtnl_rttable_tab) - return; - - rtnl_rttable_tab = xzalloc(sizeof(*rtnl_rttable_tab)); -- rtnl_rttable_tab->tab[0] = "unspec"; -- rtnl_rttable_tab->tab[255] = "local"; -- rtnl_rttable_tab->tab[254] = "main"; -- rtnl_rttable_tab->tab[253] = "default"; -- rtnl_tab_initialize("tables", rtnl_rttable_tab->tab); -+ rtnl_rttable_tab->tab = xzalloc(sizeof(tab_init)); -+ rtnl_rttable_tab->length = sizeof(tab_init) / sizeof(tab_init[0]); -+ memcpy(rtnl_rttable_tab->tab, tab_init, sizeof(tab_init)); -+ rtnl_tab_initialize("tables", rtnl_rttable_tab); - } - - const char* FAST_FUNC rtnl_rttable_n2a(int id) - { -- if (id < 0 || id > RT_TABLE_MAX) { -- return itoa(id); -- } -+ size_t i; - - rtnl_rttable_initialize(); - -- if (rtnl_rttable_tab->tab[id]) -- return rtnl_rttable_tab->tab[id]; -+ for (i = 0; i < rtnl_rttable_tab->length; i++) -+ if (rtnl_rttable_tab->tab[i].id == id) -+ return rtnl_rttable_tab->tab[i].name; -+ - return itoa(id); - } - diff --git a/package/utils/busybox/patches/401-vi-don-t-touch-file-with-x-when-modified_count-0.patch b/package/utils/busybox/patches/401-vi-don-t-touch-file-with-x-when-modified_count-0.patch deleted file mode 100644 index e83999d30..000000000 --- a/package/utils/busybox/patches/401-vi-don-t-touch-file-with-x-when-modified_count-0.patch +++ /dev/null @@ -1,100 +0,0 @@ -From e88608eae24ae5934034e1ecb6c494fefbf1b9ae Mon Sep 17 00:00:00 2001 -From: Denys Vlasenko -Date: Mon, 13 Mar 2017 20:50:42 +0100 -Subject: [PATCH 1/2] vi: don't touch file with :x when modified_count == 0 - -Along with it, there are other changes - - - Check for uppercase X is removed as the expression will be always false and - :X itself is another totally different command in standard vim - - The status line will show number of written lines instead of lines requested - by the colon command. This is also how the standard vim is doing, though - the difference is that '!' has to be explicitly specified in vim to allow - partial writes - -Signed-off-by: Yousong Zhou -Signed-off-by: Denys Vlasenko ---- - editors/vi.c | 43 ++++++++++++++++++++++++++----------------- - 1 file changed, 26 insertions(+), 17 deletions(-) - ---- a/editors/vi.c -+++ b/editors/vi.c -@@ -1038,7 +1038,9 @@ static void colon(char *buf) - || strncmp(p, "wn", cnt) == 0 - || (p[0] == 'x' && !p[1]) - ) { -- cnt = file_write(current_filename, text, end - 1); -+ if (modified_count != 0 || p[0] != 'x') { -+ cnt = file_write(current_filename, text, end - 1); -+ } - if (cnt < 0) { - if (cnt == -1) - status_line_bold("Write error: %s", strerror(errno)); -@@ -1049,8 +1051,9 @@ static void colon(char *buf) - current_filename, - count_lines(text, end - 1), cnt - ); -- if (p[0] == 'x' || p[1] == 'q' || p[1] == 'n' -- || p[0] == 'X' || p[1] == 'Q' || p[1] == 'N' -+ if (p[0] == 'x' -+ || p[1] == 'q' || p[1] == 'n' -+ || p[1] == 'Q' || p[1] == 'N' - ) { - editing = 0; - } -@@ -1480,16 +1483,19 @@ static void colon(char *buf) - goto ret; - } - #endif -- // how many lines in text[]? -- li = count_lines(q, r); -- size = r - q + 1; - //if (useforce) { - // if "fn" is not write-able, chmod u+w - // sprintf(syscmd, "chmod u+w %s", fn); - // system(syscmd); - // forced = TRUE; - //} -- l = file_write(fn, q, r); -+ if (modified_count != 0 || cmd[0] != 'x') { -+ size = r - q + 1; -+ l = file_write(fn, q, r); -+ } else { -+ size = 0; -+ l = 0; -+ } - //if (useforce && forced) { - // chmod u-w - // sprintf(syscmd, "chmod u-w %s", fn); -@@ -1500,17 +1506,20 @@ static void colon(char *buf) - if (l == -1) - status_line_bold_errno(fn); - } else { -+ // how many lines written -+ li = count_lines(q, q + l - 1); - status_line("'%s' %dL, %dC", fn, li, l); -- if (q == text && r == end - 1 && l == size) { -- modified_count = 0; -- last_modified_count = -1; -- } -- if ((cmd[0] == 'x' || cmd[1] == 'q' || cmd[1] == 'n' -- || cmd[0] == 'X' || cmd[1] == 'Q' || cmd[1] == 'N' -- ) -- && l == size -- ) { -- editing = 0; -+ if (l == size) { -+ if (q == text && q + l == end) { -+ modified_count = 0; -+ last_modified_count = -1; -+ } -+ if (cmd[0] == 'x' -+ || cmd[1] == 'q' || cmd[1] == 'n' -+ || cmd[1] == 'Q' || cmd[1] == 'N' -+ ) { -+ editing = 0; -+ } - } - } - #if ENABLE_FEATURE_VI_YANKMARK diff --git a/package/utils/busybox/patches/402-vi-avoid-touching-a-new-file-with-ZZ-when-no-editing.patch b/package/utils/busybox/patches/402-vi-avoid-touching-a-new-file-with-ZZ-when-no-editing.patch deleted file mode 100644 index b56cf735c..000000000 --- a/package/utils/busybox/patches/402-vi-avoid-touching-a-new-file-with-ZZ-when-no-editing.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 8f3bf4f0d3605b50a8e4c48c89aeabc455f04884 Mon Sep 17 00:00:00 2001 -From: Yousong Zhou -Date: Fri, 24 Mar 2017 21:13:10 +0100 -Subject: [PATCH 2/2] vi: avoid touching a new file with ZZ when no editing has - been done - -This is the behaviour observed with standard vim and busybox vi of at -least 1.22.1. It was changed with commit "32afd3a vi: some -simplifications" which happened before 1.23.0. - -Mistyping filename on command line happens fairly often and it's better -we restore the old behaviour to avoid a few unnecessary flash writes and -sometimes efforts of debugging bugs caused by those unneeded stray -files. - -Signed-off-by: Yousong Zhou -Signed-off-by: Denys Vlasenko ---- - editors/vi.c | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - ---- a/editors/vi.c -+++ b/editors/vi.c -@@ -719,14 +719,6 @@ static int init_text_buffer(char *fn) - { - int rc; - -- flush_undo_data(); -- modified_count = 0; -- last_modified_count = -1; --#if ENABLE_FEATURE_VI_YANKMARK -- /* init the marks */ -- memset(mark, 0, sizeof(mark)); --#endif -- - /* allocate/reallocate text buffer */ - free(text); - text_size = 10240; -@@ -741,6 +733,14 @@ static int init_text_buffer(char *fn) - // file doesnt exist. Start empty buf with dummy line - char_insert(text, '\n', NO_UNDO); - } -+ -+ flush_undo_data(); -+ modified_count = 0; -+ last_modified_count = -1; -+#if ENABLE_FEATURE_VI_YANKMARK -+ /* init the marks */ -+ memset(mark, 0, sizeof(mark)); -+#endif - return rc; - } - 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 new file mode 100644 index 000000000..3741e25c3 --- /dev/null +++ b/package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch @@ -0,0 +1,13 @@ +--- a/networking/traceroute.c ++++ b/networking/traceroute.c +@@ -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)) +-//applet:IF_TRACEROUTE6(APPLET(traceroute6, BB_DIR_USR_BIN, BB_SUID_MAYBE)) ++//applet:IF_TRACEROUTE(APPLET(traceroute, BB_DIR_BIN, BB_SUID_MAYBE)) ++//applet:IF_TRACEROUTE6(APPLET(traceroute6, BB_DIR_BIN, BB_SUID_MAYBE)) + + //kbuild:lib-$(CONFIG_TRACEROUTE) += traceroute.o + //kbuild:lib-$(CONFIG_TRACEROUTE6) += traceroute.o diff --git a/package/utils/busybox/patches/510-move-passwd-applet-to-bin.patch b/package/utils/busybox/patches/510-move-passwd-applet-to-bin.patch new file mode 100644 index 000000000..b19d1c9a3 --- /dev/null +++ b/package/utils/busybox/patches/510-move-passwd-applet-to-bin.patch @@ -0,0 +1,11 @@ +--- a/loginutils/passwd.c ++++ b/loginutils/passwd.c +@@ -23,7 +23,7 @@ + //config: With this option passwd will refuse new passwords which are "weak". + + //applet:/* Needs to be run by root or be suid root - needs to change /etc/{passwd,shadow}: */ +-//applet:IF_PASSWD(APPLET(passwd, BB_DIR_USR_BIN, BB_SUID_REQUIRE)) ++//applet:IF_PASSWD(APPLET(passwd, BB_DIR_BIN, BB_SUID_REQUIRE)) + + //kbuild:lib-$(CONFIG_PASSWD) += passwd.o + 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 000000000..3b142bdd6 --- /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 62c255a90..4c8b360de 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 85f70c5e7..389e10ccf 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 8c003639a..068ce3ede 100644 --- a/package/utils/e2fsprogs/Makefile +++ b/package/utils/e2fsprogs/Makefile @@ -8,12 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=e2fsprogs -PKG_VERSION:=1.43.3 -PKG_HASH:=ce8ef1bbb0d4730f170167284fda156ac9d6bf18db2750eb94af619a81b19927 -PKG_RELEASE:=2 +PKG_VERSION:=1.43.7 +PKG_HASH:=2a6367289047d68d9ba6a46cf89ab9a1efd0556cde02a51ebaf414ff51edded9 +PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=@SF/e2fsprogs +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 @@ -44,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 @@ -108,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) @@ -138,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 8a27c47ad..3e8bf63f0 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 d4e25397a..000000000 --- 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/fritz-tools/Makefile b/package/utils/fritz-tools/Makefile new file mode 100644 index 000000000..7c547e6f9 --- /dev/null +++ b/package/utils/fritz-tools/Makefile @@ -0,0 +1,45 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=fritz-tools +PKG_RELEASE:=1 +CMAKE_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/fritz-tools/Default + SECTION:=utils + CATEGORY:=Utilities +endef + +define Package/fritz-tffs + $(call Package/fritz-tools/Default) + TITLE:=Utility to partially read the TFFS filesystems +endef + +define Package/fritz-tffs/description + Utility to partially read the TFFS filesystems. +endef + +define Package/fritz-caldata + $(call Package/fritz-tools/Default) + DEPENDS:=+zlib + TITLE:=Utility to extract WLAN calibration data +endef + +define Package/fritz-caldata/description + Utility to extract the zlib compress calibration data from flash. +endef + +define Package/fritz-tffs/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/fritz_tffs_read $(1)/usr/bin/fritz_tffs +endef + +define Package/fritz-caldata/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/fritz_cal_extract $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,fritz-tffs)) +$(eval $(call BuildPackage,fritz-caldata)) diff --git a/package/utils/fritz-tools/README.md b/package/utils/fritz-tools/README.md new file mode 100644 index 000000000..def237b17 --- /dev/null +++ b/package/utils/fritz-tools/README.md @@ -0,0 +1,50 @@ +Userspace utilties for accessing TFFS (a name-value storage usually found in AVM Fritz!Box based devices) + +## Building + +``` +mkdir build +cd build +cmake /path/to/fritz_tffs_tools +make +``` + +## Usage + +All command line parameters are documented: +``` +fritz_tffs_read -h +``` + +Show all entries from a TFFS partition dump (in the format: name=value): +``` +fritz_tffs_read -i /path/to/tffs.dump -a +``` + +Read a TFFS partition and show all entries (in the format: name=value): +``` +fritz_tffs_read -i /dev/mtdX -a +``` + +Output only the value of a specific key (this will only show the value): +``` +fritz_tffs_read -i /dev/mtdX -n my_ipaddress +``` + +## LICENSE + +See `LICENSE`: + + 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. diff --git a/package/utils/fritz-tools/src/CMakeLists.txt b/package/utils/fritz-tools/src/CMakeLists.txt new file mode 100644 index 000000000..021dc7733 --- /dev/null +++ b/package/utils/fritz-tools/src/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 2.6) + +PROJECT(fritz-tools C) +ADD_DEFINITIONS(-Wall -Werror --std=gnu99 -Wmissing-declarations) + +SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") + +FIND_PATH(zlib_include_dir zlib.h) +INCLUDE_DIRECTORIES(${zlib_include_dir}) + +ADD_EXECUTABLE(fritz_tffs_read fritz_tffs_read.c) +ADD_EXECUTABLE(fritz_cal_extract fritz_cal_extract.c) +TARGET_LINK_LIBRARIES(fritz_cal_extract z) + +INSTALL(TARGETS fritz_tffs_read fritz_cal_extract RUNTIME DESTINATION bin) diff --git a/package/utils/fritz-tools/src/fritz_cal_extract.c b/package/utils/fritz-tools/src/fritz_cal_extract.c new file mode 100644 index 000000000..8156dfd1a --- /dev/null +++ b/package/utils/fritz-tools/src/fritz_cal_extract.c @@ -0,0 +1,259 @@ +/* + * A tool for reading the zlib compressed calibration data + * found in AVM Fritz!Box based devices). + * + * Copyright (c) 2017 Christian Lamparter + * + * Based on zpipe, which is an example of proper use of zlib's inflate(). + * that is Not copyrighted -- provided to the public domain + * Version 1.4 11 December 2005 Mark Adler + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "zlib.h" + +#define CHUNK 1024 + +static inline size_t special_min(size_t a, size_t b) +{ + return a == 0 ? b : (a < b ? a : b); +} + +/* Decompress from file source to file dest until stream ends or EOF. + inf() returns Z_OK on success, Z_MEM_ERROR if memory could not be + allocated for processing, Z_DATA_ERROR if the deflate data is + invalid or incomplete, Z_VERSION_ERROR if the version of zlib.h and + the version of the library linked do not match, or Z_ERRNO if there + is an error reading or writing the files. */ +static int inf(FILE *source, FILE *dest, size_t limit, size_t skip) +{ + int ret; + size_t have; + z_stream strm; + unsigned char in[CHUNK]; + unsigned char out[CHUNK]; + + /* allocate inflate state */ + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + strm.avail_in = 0; + strm.next_in = Z_NULL; + ret = inflateInit(&strm); + if (ret != Z_OK) + return ret; + + /* decompress until deflate stream ends or end of file */ + do { + strm.avail_in = fread(in, 1, CHUNK, source); + if (ferror(source)) { + (void)inflateEnd(&strm); + return Z_ERRNO; + } + if (strm.avail_in == 0) + break; + strm.next_in = in; + + /* run inflate() on input until output buffer not full */ + do { + strm.avail_out = CHUNK; + strm.next_out = out; + ret = inflate(&strm, Z_NO_FLUSH); + assert(ret != Z_STREAM_ERROR); /* state not clobbered */ + switch (ret) { + case Z_NEED_DICT: + ret = Z_DATA_ERROR; /* and fall through */ + case Z_DATA_ERROR: + case Z_MEM_ERROR: + (void)inflateEnd(&strm); + return ret; + } + have = special_min(limit, CHUNK - strm.avail_out) - skip; + if (fwrite(&out[skip], have, 1, dest) != 1 || ferror(dest)) { + (void)inflateEnd(&strm); + return Z_ERRNO; + } + skip = 0; + limit -= have; + } while (strm.avail_out == 0 && limit > 0); + + /* done when inflate() says it's done */ + } while (ret != Z_STREAM_END && limit > 0); + + /* clean up and return */ + (void)inflateEnd(&strm); + return (limit == 0 ? Z_OK : (ret == Z_STREAM_END ? Z_OK : Z_DATA_ERROR)); +} + +/* report a zlib or i/o error */ +static void zerr(int ret) +{ + switch (ret) { + case Z_ERRNO: + if (ferror(stdin)) + fputs("error reading stdin\n", stderr); + if (ferror(stdout)) + fputs("error writing stdout\n", stderr); + break; + case Z_STREAM_ERROR: + fputs("invalid compression level\n", stderr); + break; + case Z_DATA_ERROR: + fputs("invalid or incomplete deflate data\n", stderr); + break; + case Z_MEM_ERROR: + fputs("out of memory\n", stderr); + break; + case Z_VERSION_ERROR: + fputs("zlib version mismatch!\n", stderr); + } +} + +static unsigned int get_num(char *str) +{ + if (!strncmp("0x", str, 2)) + return strtoul(str+2, NULL, 16); + else + return strtoul(str, NULL, 10); +} + +static void usage(void) +{ + fprintf(stderr, "Usage: fritz_cal_extract [-s seek offset] [-i skip] [-o output file] [-l limit] [infile] -e entry_id\n" + "Finds and extracts zlib compressed calibration data in the EVA loader\n"); + exit(EXIT_FAILURE); +} + +struct cal_entry { + uint16_t id; + uint16_t len; +} __attribute__((packed)); + +/* compress or decompress from stdin to stdout */ +int main(int argc, char **argv) +{ + struct cal_entry cal = { .len = 0 }; + FILE *in = stdin; + FILE *out = stdout; + size_t limit = 0, skip = 0; + int initial_offset = 0; + int entry = -1; + int ret; + int opt; + + while ((opt = getopt(argc, argv, "s:e:o:l:i:")) != -1) { + switch (opt) { + case 's': + initial_offset = (int)get_num(optarg); + if (errno) { + perror("Failed to parse seek offset"); + goto out_bad; + } + break; + case 'e': + entry = (int) htobe16(get_num(optarg)); + if (errno) { + perror("Failed to entry id"); + goto out_bad; + } + break; + case 'o': + out = fopen(optarg, "w"); + if (!out) { + perror("Failed to create output file"); + goto out_bad; + } + break; + case 'l': + limit = (size_t)get_num(optarg); + if (errno) { + perror("Failed to parse limit"); + goto out_bad; + } + break; + case 'i': + skip = (size_t)get_num(optarg); + if (errno) { + perror("Failed to parse skip"); + goto out_bad; + } + break; + default: /* '?' */ + usage(); + } + } + + if (entry == -1) + usage(); + + if (argc > 1 && optind <= argc) { + in = fopen(argv[optind], "r"); + if (!in) { + perror("Failed to create output file"); + goto out_bad; + } + } + + if (initial_offset) { + ret = fseek(in, initial_offset, SEEK_CUR); + if (ret) { + perror("Failed to seek to calibration table"); + goto out_bad; + } + } + + do { + ret = fseek(in, be16toh(cal.len), SEEK_CUR); + if (feof(in)) { + fprintf(stderr, "Reached end of file, but didn't find the matching entry\n"); + goto out_bad; + } else if (ferror(in)) { + perror("Failure during seek"); + goto out_bad; + } + + ret = fread(&cal, 1, sizeof cal, in); + if (ret != sizeof cal) + goto out_bad; + } while (entry != cal.id || cal.id == 0xffff); + + if (cal.id == 0xffff) { + fprintf(stderr, "Reached end of filesystem, but didn't find the matching entry\n"); + goto out_bad; + } + + ret = inf(in, out, limit, skip); + if (ret == Z_OK) + goto out; + + zerr(ret); + +out_bad: + ret = EXIT_FAILURE; + +out: + fclose(in); + fclose(out); + return ret; +} diff --git a/package/utils/fritz-tools/src/fritz_tffs_read.c b/package/utils/fritz-tools/src/fritz_tffs_read.c new file mode 100644 index 000000000..d1b3038e6 --- /dev/null +++ b/package/utils/fritz-tools/src/fritz_tffs_read.c @@ -0,0 +1,379 @@ +/* + * A tool for reading the TFFS partitions (a name-value storage usually + * found in AVM Fritz!Box based devices). + * + * Copyright (c) 2015-2016 Martin Blumenstingl + * + * Based on the TFFS 2.0 kernel driver from AVM: + * Copyright (c) 2004-2007 AVM GmbH + * and the OpenWrt TFFS kernel driver: + * Copyright (c) 2013 John Crispin + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define TFFS_ID_END 0xffff +#define TFFS_ID_TABLE_NAME 0x01ff + +static char *progname; +static char *input_file; +static unsigned long tffs_size; +static char *name_filter = NULL; +static bool show_all = false; +static bool print_all_key_names = false; +static bool swap_bytes = false; + +struct tffs_entry_header { + uint16_t id; + uint16_t len; +}; + +struct tffs_entry { + const struct tffs_entry_header *header; + char *name; + uint8_t *val; +}; + +struct tffs_name_table_entry { + const uint32_t *id; + const char *val; +}; + +struct tffs_key_name_table { + uint32_t size; + struct tffs_name_table_entry *entries; +}; + +static inline uint16_t get_header_len(const struct tffs_entry_header *header) +{ + if (swap_bytes) + return ntohs(header->len); + + return header->len; +} + +static inline uint16_t get_header_id(const struct tffs_entry_header *header) +{ + if (swap_bytes) + return ntohs(header->id); + + return header->id; +} + +static inline uint16_t to_entry_header_id(uint32_t name_id) +{ + if (swap_bytes) + return ntohl(name_id) & 0xffff; + + return name_id & 0xffff; +} + +static inline uint32_t get_walk_size(uint32_t entry_len) +{ + return (entry_len + 3) & ~0x03; +} + +static void print_entry_value(const struct tffs_entry *entry) +{ + int i; + + /* These are NOT NULL terminated. */ + for (i = 0; i < get_header_len(entry->header); i++) + fprintf(stdout, "%c", entry->val[i]); +} + +static void parse_entry(uint8_t *buffer, uint32_t pos, + struct tffs_entry *entry) +{ + entry->header = (struct tffs_entry_header *) &buffer[pos]; + entry->val = &buffer[pos + sizeof(struct tffs_entry_header)]; +} + +static int find_entry(uint8_t *buffer, uint16_t id, struct tffs_entry *entry) +{ + uint32_t pos = 0; + + do { + parse_entry(buffer, pos, entry); + + if (get_header_id(entry->header) == id) + return 1; + + pos += sizeof(struct tffs_entry_header); + pos += get_walk_size(get_header_len(entry->header)); + } while (pos < tffs_size && entry->header->id != TFFS_ID_END); + + return 0; +} + +static void parse_key_names(struct tffs_entry *names_entry, + struct tffs_key_name_table *key_names) +{ + uint32_t pos = 0, i = 0; + struct tffs_name_table_entry *name_item; + + key_names->entries = calloc(sizeof(*name_item), 1); + + do { + name_item = &key_names->entries[i]; + + name_item->id = (uint32_t *) &names_entry->val[pos]; + pos += sizeof(*name_item->id); + name_item->val = (const char *) &names_entry->val[pos]; + + /* + * There is no "length" field because the string values are + * simply NULL-terminated -> strlen() gives us the size. + */ + pos += get_walk_size(strlen(name_item->val) + 1); + + ++i; + key_names->entries = realloc(key_names->entries, + sizeof(*name_item) * (i + 1)); + } while (pos < get_header_len(names_entry->header)); + + key_names->size = i; +} + +static void show_all_key_names(struct tffs_key_name_table *key_names) +{ + int i; + + for (i = 0; i < key_names->size; i++) + printf("%s\n", key_names->entries[i].val); +} + +static int show_all_key_value_pairs(uint8_t *buffer, + struct tffs_key_name_table *key_names) +{ + int i, has_value = 0; + uint16_t id; + struct tffs_entry tmp; + + for (i = 0; i < key_names->size; i++) { + id = to_entry_header_id(*key_names->entries[i].id); + + if (find_entry(buffer, id, &tmp)) { + printf("%s=", key_names->entries[i].val); + print_entry_value(&tmp); + printf("\n"); + has_value++; + } + } + + if (!has_value) { + fprintf(stderr, "ERROR: no values found!\n"); + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} + +static int show_matching_key_value(uint8_t *buffer, + struct tffs_key_name_table *key_names) +{ + int i; + uint16_t id; + struct tffs_entry tmp; + const char *name; + + for (i = 0; i < key_names->size; i++) { + name = key_names->entries[i].val; + + if (strncmp(name, name_filter, strlen(name)) == 0) { + id = to_entry_header_id(*key_names->entries[i].id); + + if (find_entry(buffer, id, &tmp)) { + print_entry_value(&tmp); + printf("\n"); + return EXIT_SUCCESS; + } else { + fprintf(stderr, + "ERROR: no value found for name %s!\n", + name); + return EXIT_FAILURE; + } + } + } + + fprintf(stderr, "ERROR: Unknown key name %s!\n", name_filter); + return EXIT_FAILURE; +} + +static void usage(int status) +{ + FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout; + + fprintf(stream, "Usage: %s [OPTIONS...]\n", progname); + fprintf(stream, + "\n" + "Options:\n" + " -a list all key value pairs found in the TFFS file/device\n" + " -b swap bytes while parsing the TFFS file/device\n" + " -h show this screen\n" + " -i inspect the given TFFS file/device \n" + " -l list all supported keys\n" + " -n display the value of the given key\n" + " -s the (max) size of the TFFS file/device \n" + ); + + exit(status); +} + +static int file_exist(char *filename) +{ + struct stat buffer; + + return stat(filename, &buffer) == 0; +} + +static void parse_options(int argc, char *argv[]) +{ + while (1) + { + int c; + + c = getopt(argc, argv, "abhi:ln:s:"); + if (c == -1) + break; + + switch (c) { + case 'a': + show_all = true; + name_filter = NULL; + print_all_key_names = false; + break; + case 'b': + swap_bytes = 1; + break; + case 'h': + usage(EXIT_SUCCESS); + break; + case 'i': + input_file = optarg; + break; + case 'l': + print_all_key_names = true; + show_all = false; + name_filter = NULL; + break; + case 'n': + name_filter = optarg; + show_all = false; + print_all_key_names = false; + break; + case 's': + tffs_size = strtoul(optarg, NULL, 0); + break; + default: + usage(EXIT_FAILURE); + break; + } + } + + if (!input_file) { + fprintf(stderr, "ERROR: No input file (-i ) given!\n"); + exit(EXIT_FAILURE); + } + + if (!file_exist(input_file)) { + fprintf(stderr, "ERROR: %s does not exist\n", input_file); + exit(EXIT_FAILURE); + } + + if (!show_all && !name_filter && !print_all_key_names) { + fprintf(stderr, + "ERROR: either -l, -a or -n is required!\n"); + exit(EXIT_FAILURE); + } +} + +int main(int argc, char *argv[]) +{ + int ret = EXIT_FAILURE; + uint8_t *buffer; + FILE *fp; + struct tffs_entry name_table; + struct tffs_key_name_table key_names; + + progname = basename(argv[0]); + + parse_options(argc, argv); + + fp = fopen(input_file, "r"); + + if (!fp) { + fprintf(stderr, "ERROR: Failed to open tffs input file %s\n", + input_file); + goto out; + } + + if (tffs_size == 0) { + fseek(fp, 0L, SEEK_END); + tffs_size = ftell(fp); + fseek(fp, 0L, SEEK_SET); + } + + buffer = malloc(tffs_size); + + if (fread(buffer, 1, tffs_size, fp) != tffs_size) { + fprintf(stderr, "ERROR: Failed read tffs file %s\n", + input_file); + goto out_free; + } + + if (!find_entry(buffer, TFFS_ID_TABLE_NAME, &name_table)) { + fprintf(stderr,"ERROR: No name table found in tffs file %s\n", + input_file); + fprintf(stderr," Is byte-swapping (-b) required?\n"); + goto out_free; + } + + parse_key_names(&name_table, &key_names); + if (key_names.size < 1) { + fprintf(stderr, "ERROR: No name table found in tffs file %s\n", + input_file); + goto out_free_names; + } + + if (print_all_key_names) { + show_all_key_names(&key_names); + ret = EXIT_SUCCESS; + } else if (show_all) { + ret = show_all_key_value_pairs(buffer, &key_names); + } else { + ret = show_matching_key_value(buffer, &key_names); + } + +out_free_names: + free(key_names.entries); +out_free: + fclose(fp); + free(buffer); +out: + return ret; +} diff --git a/package/utils/fuse/Makefile b/package/utils/fuse/Makefile index d0cefff1a..e853a8e04 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 b70928ba5..32be1adb9 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 74b8c6f8f..ac0722c70 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 937fc137e..3d3d6850e 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 bcd410f69..64f683ddb 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 dd6579148..d221c4ee9 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 5fbb87388..b971e0975 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/otrx/src/otrx.c b/package/utils/otrx/src/otrx.c index 101a31004..223e032f2 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 0243b773e..3a972f54d 100644 --- a/package/utils/ugps/Makefile +++ b/package/utils/ugps/Makefile @@ -10,11 +10,11 @@ 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:=2016-10-24 -PKG_SOURCE_VERSION:=32a6b2b702c3b9f8c425f3d9dc9f4273e276029c -PKG_MIRROR_HASH:=41d24ef335e9b2847895b04cee4d1c7efa56fc207798f5858e7a1f229a33c5eb +PKG_SOURCE_DATE:=2017-02-11 +PKG_SOURCE_VERSION:=c30055a685bca1e81ccc8f4bd3bb08d780a7d762 +PKG_MIRROR_HASH:=a618f9a15d3a585453550190eed2bb0a308ddba0ab37f2f6b76dd3c87fd80e8b PKG_MAINTAINER:=John Crispin PKG_LICENSE:=GPL-2.0+ diff --git a/package/utils/usbmode/Makefile b/package/utils/usbmode/Makefile index 1b1ef147b..e229c791c 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/util-linux/Makefile b/package/utils/util-linux/Makefile index aea13ac8d..88cb31477 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.29.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.29 -PKG_HASH:=accea4d678209f97f634f40a93b7e9fcad5915d1f4749f6c47bee6bf110fe8e3 +PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.30 +PKG_HASH:=7b5be5489e9b5b7177832836467aba1c87bf0e9bcbcb5a6f35d76cd4782589dc +PKG_CPE_ID:=cpe:/a:kernel:util-linux PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:= COPYING \ @@ -30,6 +31,8 @@ PKG_BUILD_PARALLEL:=1 PKG_FIXUP:=autoreconf PKG_INSTALL:=1 +DISABLE_NLS:=--disable-nls + include $(INCLUDE_DIR)/package.mk define Package/util-linux/Default @@ -163,6 +166,7 @@ endef define Package/dmesg $(call Package/util-linux/Default) TITLE:=print or control the kernel ring buffer + DEPENDS:= +libncursesw endef define Package/dmesg/description @@ -172,7 +176,7 @@ endef define Package/fdisk $(call Package/util-linux/Default) TITLE:=manipulate disk partition table - DEPENDS:= +libblkid +libsmartcols +libfdisk + DEPENDS:= +libblkid +libsmartcols +libfdisk +libncursesw SUBMENU=Disc endef @@ -349,7 +353,7 @@ define Package/sfdisk $(call Package/util-linux/Default) TITLE:=partition table manipulator for Linux SUBMENU=Disc - DEPENDS:= +libblkid +libfdisk +libsmartcols + DEPENDS:= +libblkid +libfdisk +libsmartcols +libncursesw endef define Package/sfdisk/description diff --git a/package/utils/util-linux/patches/001-uclibc_add_libm_to_scriptreplay.patch b/package/utils/util-linux/patches/001-uclibc_add_libm_to_scriptreplay.patch deleted file mode 100644 index a291f6ac8..000000000 --- a/package/utils/util-linux/patches/001-uclibc_add_libm_to_scriptreplay.patch +++ /dev/null @@ -1,24 +0,0 @@ -From feda4342df1ced25df3d200ed23469e740196c86 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Wed, 18 Jan 2017 13:17:21 +0100 -Subject: build-sys: use -lm for scriptreplay if necessary - -Reported-by: Bert van Hall -Addresses: https://github.com/karelzak/util-linux/pull/397 -Signed-off-by: Karel Zak ---- - configure.ac | 7 +++++++ - term-utils/Makemodule.am | 2 +- - 2 files changed, 8 insertions(+), 1 deletion(-) - ---- a/term-utils/Makemodule.am -+++ b/term-utils/Makemodule.am -@@ -21,7 +21,7 @@ if BUILD_SCRIPTREPLAY - usrbin_exec_PROGRAMS += scriptreplay - dist_man_MANS += term-utils/scriptreplay.1 - scriptreplay_SOURCES = term-utils/scriptreplay.c --scriptreplay_LDADD = $(LDADD) libcommon.la -+scriptreplay_LDADD = $(LDADD) libcommon.la $(MATH_LIBS) - endif # BUILD_SCRIPTREPLAY - - diff --git a/package/utils/util-linux/patches/003-fix_pkgconfig_files.patch b/package/utils/util-linux/patches/003-fix_pkgconfig_files.patch index 16ba14ae3..c79813b1b 100644 --- a/package/utils/util-linux/patches/003-fix_pkgconfig_files.patch +++ b/package/utils/util-linux/patches/003-fix_pkgconfig_files.patch @@ -10,7 +10,7 @@ endif # BUILD_LIBUUID --- a/configure.ac +++ b/configure.ac -@@ -2165,18 +2165,23 @@ AC_CONFIG_HEADERS([config.h]) +@@ -2255,18 +2255,23 @@ AC_CONFIG_HEADERS([config.h]) # AC_CONFIG_FILES([ Makefile @@ -66,7 +66,7 @@ endif # BUILD_LIBSMARTCOLS --- a/libfdisk/Makemodule.am +++ b/libfdisk/Makemodule.am -@@ -8,7 +8,6 @@ SUBDIRS += libfdisk/docs +@@ -9,7 +9,6 @@ SUBDIRS += libfdisk/docs endif pkgconfig_DATA += libfdisk/fdisk.pc 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 000000000..848f2f40c --- /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 fb350993f..5cf1da240 100644 --- a/package/utils/xfsprogs/Makefile +++ b/package/utils/xfsprogs/Makefile @@ -8,17 +8,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xfsprogs +PKG_CPE_ID:=cpe:/a:sgi:xfsprogs PKG_RELEASE:=1 -PKG_VERSION:=3.1.7 -PKG_SOURCE_URL:=ftp://oss.sgi.com/projects/xfs/previous/ -PKG_HASH:=e150914210ac5fd29c098ef0fd94bdec51d2fb231cf9faa765c16ec6d75c8eaa +PKG_VERSION:=4.11.0 +PKG_SOURCE_URL:=@KERNEL/linux/utils/fs/xfs/xfsprogs +PKG_HASH:=c3a6d87b564d7738243c507df82276bed982265e345363a95f2c764e8a5f5bb2 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_INSTALL:=1 -PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/nls.mk define Package/xfsprogs/default SECTION:=utils @@ -58,15 +58,12 @@ MAKE_FLAGS += \ DEBUG= Q= \ PCFLAGS="-Wall" \ PKG_PLATFORM=linux \ - ENABLE_GETTEXT=no \ - prefix=$(PKG_INSTALL_DIR)/usr \ - exec_prefix=$(PKG_INSTALL_DIR)/usr \ - PKG_SBIN_DIR=$(PKG_INSTALL_DIR)/usr/sbin \ - PKG_ROOT_SBIN_DIR=$(PKG_INSTALL_DIR)/sbin \ - PKG_MAN_DIR=$(PKG_INSTALL_DIR)/usr/man \ - PKG_LOCALE_DIR=$(PKG_INSTALL_DIR)/usr/share/locale \ - PKG_ROOT_LIB_DIR=$(PKG_INSTALL_DIR)/lib \ - PKG_DOC_DIR=$(PKG_INSTALL_DIR)/usr/share/doc/xfsprogs + ENABLE_GETTEXT=no + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/libxfs crc32table.h CFLAGS="$(HOST_CFLAGS) -I$(PKG_BUILD_DIR)/include" + $(call Build/Compile/Default) +endef define Package/xfs-mkfs/install mkdir -p $(1)/usr/sbin diff --git a/package/utils/xfsprogs/patches/001-automake-compat.patch b/package/utils/xfsprogs/patches/001-automake-compat.patch deleted file mode 100644 index ce9289a4a..000000000 --- a/package/utils/xfsprogs/patches/001-automake-compat.patch +++ /dev/null @@ -1,78 +0,0 @@ -commit 2222aa77e11b959e0e5a0ded3482e56799593bc2 -Author: Jens Muecke -Date: Thu Jan 26 00:34:15 2012 +0100 - - 001-automake-compat - ---- a/configure.in -+++ b/configure.in -@@ -2,7 +2,8 @@ AC_INIT(include/libxfs.h) - AC_PREREQ(2.50) - AC_CONFIG_AUX_DIR([.]) - AC_CONFIG_MACRO_DIR([m4]) --AC_CONFIG_HEADER(include/platform_defs.h) -+# Put a dummy here (http://www.mail-archive.com/automake@gnu.org/msg09241.html) -+AC_CONFIG_HEADERS([doesnotexist.h include/platform_defs.h]) - AC_PREFIX_DEFAULT(/usr) - - AC_PROG_LIBTOOL ---- a/include/builddefs.in -+++ b/include/builddefs.in -@@ -20,6 +20,8 @@ - ifndef _BUILDDEFS_INCLUDED_ - _BUILDDEFS_INCLUDED_ = 1 - -+SHELL = @SHELL@ -+ - DEBUG = @debug_build@ - OPTIMIZER = @opt_build@ - MALLOCLIB = @malloc_lib@ ---- a/m4/package_types.m4 -+++ b/m4/package_types.m4 -@@ -9,7 +9,7 @@ AC_DEFUN([AC_TYPE_PSINT], - #include - ], [ - __psint_t psint; -- ], AC_DEFINE(HAVE___PSINT_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no)) -+ ], AC_DEFINE([HAVE___PSINT_T], [1], [Define if __psint_t exists]) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no)) - ]) - - # -@@ -23,7 +23,7 @@ AC_DEFUN([AC_TYPE_PSUNSIGNED], - #include - ], [ - __psunsigned_t psuint; -- ], AC_DEFINE(HAVE___PSUNSIGNED_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no)) -+ ], AC_DEFINE([HAVE___PSUNSIGNED_T], [1], [Define if __psunsigned_t exists]) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no)) - ]) - - # -@@ -37,7 +37,7 @@ AC_DEFUN([AC_TYPE_U32], - #include - ], [ - __u32 u32; -- ], AC_DEFINE(HAVE___U32) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no)) -+ ], AC_DEFINE([HAVE___U32], [1], [Define if __u32 exists]) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no)) - ]) - - # -@@ -50,15 +50,15 @@ AC_DEFUN([AC_SIZEOF_POINTERS_AND_LONG], - AC_CHECK_SIZEOF(long, 4) - AC_CHECK_SIZEOF(char *, 4) - if test $ac_cv_sizeof_long -eq 4 -o $ac_cv_sizeof_long -eq 0; then -- AC_DEFINE(HAVE_32BIT_LONG) -+ AC_DEFINE([HAVE_32BIT_LONG], [1], [Define if long is 32bit]) - fi - if test $ac_cv_sizeof_long -eq 8; then -- AC_DEFINE(HAVE_64BIT_LONG) -+ AC_DEFINE([HAVE_64BIT_LONG], [1], [Define if long is 64bit]) - fi - if test $ac_cv_sizeof_char_p -eq 4 -o $ac_cv_sizeof_char_p -eq 0; then -- AC_DEFINE(HAVE_32BIT_PTR) -+ AC_DEFINE([HAVE_32BIT_PTR], [1], [Define if char* is 32bit]) - fi - if test $ac_cv_sizeof_char_p -eq 8; then -- AC_DEFINE(HAVE_64BIT_PTR) -+ AC_DEFINE([HAVE_64BIT_PTR], [1], [Define if char* is 64bit]) - fi - ]) diff --git a/package/utils/xfsprogs/patches/100-no-selftest.patch b/package/utils/xfsprogs/patches/100-no-selftest.patch new file mode 100644 index 000000000..227016675 --- /dev/null +++ b/package/utils/xfsprogs/patches/100-no-selftest.patch @@ -0,0 +1,14 @@ +--- a/libxfs/Makefile ++++ b/libxfs/Makefile +@@ -118,9 +118,9 @@ LTLIBS = $(LIBPTHREAD) $(LIBRT) + # don't try linking xfs_repair with a debug libxfs. + DEBUG = -DNDEBUG + +-LDIRT = gen_crc32table crc32table.h crc32selftest ++LDIRT = gen_crc32table crc32table.h + +-default: crc32selftest ltdepend $(LTLIBRARY) ++default: ltdepend $(LTLIBRARY) + + crc32table.h: gen_crc32table.c + @echo " [CC] gen_crc32table" diff --git a/package/utils/xfsprogs/patches/100-no_aio.patch b/package/utils/xfsprogs/patches/100-no_aio.patch deleted file mode 100644 index 4cc85d7de..000000000 --- a/package/utils/xfsprogs/patches/100-no_aio.patch +++ /dev/null @@ -1,19 +0,0 @@ -commit e72b7bd12fdef06c3494b919376bfe886aa8bb4d -Author: Jens Muecke -Date: Thu Jan 26 00:35:43 2012 +0100 - - 100-no_aio - ---- a/configure.in -+++ b/configure.in -@@ -92,8 +92,8 @@ AC_PACKAGE_GLOBALS(xfsprogs) - AC_PACKAGE_UTILITIES(xfsprogs) - AC_MULTILIB($enable_lib64) - --AC_PACKAGE_NEED_AIO_H --AC_PACKAGE_NEED_LIO_LISTIO -+librt="-lrt" -+AC_SUBST(librt) - - AC_PACKAGE_NEED_UUID_H - AC_PACKAGE_NEED_UUIDCOMPARE diff --git a/package/utils/xfsprogs/patches/110-subdirs.patch b/package/utils/xfsprogs/patches/110-subdirs.patch new file mode 100644 index 000000000..53a6b09ce --- /dev/null +++ b/package/utils/xfsprogs/patches/110-subdirs.patch @@ -0,0 +1,12 @@ +--- a/Makefile ++++ b/Makefile +@@ -46,8 +46,7 @@ HDR_SUBDIRS = include libxfs + + DLIB_SUBDIRS = libxlog libxcmd libhandle + LIB_SUBDIRS = libxfs $(DLIB_SUBDIRS) +-TOOL_SUBDIRS = copy db estimate fsck growfs io logprint mkfs quota \ +- mdrestore repair rtcp m4 man doc debian ++TOOL_SUBDIRS = db fsck growfs io mkfs repair + + ifneq ("$(PKG_PLATFORM)","darwin") + TOOL_SUBDIRS += fsr diff --git a/package/utils/xfsprogs/patches/110-uclibc_no_ustat.patch b/package/utils/xfsprogs/patches/110-uclibc_no_ustat.patch deleted file mode 100644 index 5d5d08c8d..000000000 --- a/package/utils/xfsprogs/patches/110-uclibc_no_ustat.patch +++ /dev/null @@ -1,32 +0,0 @@ -commit 7b1d0a98e779170232c0a81b4749ab934ec67a7e -Author: Jens Muecke -Date: Thu Jan 26 00:36:42 2012 +0100 - - 110-uclibc_no_ustat - ---- a/libxfs/linux.c -+++ b/libxfs/linux.c -@@ -21,7 +21,6 @@ - #include - #include - #undef ustat --#include - #include - #include - #include -@@ -49,6 +48,7 @@ static int max_block_alignment; - int - platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose) - { -+#if 0 - /* Pad ust; pre-2.6.28 linux copies out too much in 32bit compat mode */ - struct ustat ust[2]; - struct stat64 st; -@@ -68,6 +68,7 @@ platform_check_ismounted(char *name, cha - progname, name); - return 1; - } -+#endif - return 0; - } - diff --git a/package/utils/xfsprogs/patches/120-disable_assert.patch b/package/utils/xfsprogs/patches/120-disable_assert.patch new file mode 100644 index 000000000..9a970d27a --- /dev/null +++ b/package/utils/xfsprogs/patches/120-disable_assert.patch @@ -0,0 +1,12 @@ +--- a/libxfs/libxfs_priv.h ++++ b/libxfs/libxfs_priv.h +@@ -84,9 +84,6 @@ extern uint32_t crc32c_le(uint32_t crc, + /* for all the support code that uses progname in error messages */ + extern char *progname; + +-#undef ASSERT +-#define ASSERT(ex) assert(ex) +- + #ifndef EWRONGFS + #define EWRONGFS EINVAL + #endif diff --git a/package/utils/xfsprogs/patches/120-portability.patch b/package/utils/xfsprogs/patches/120-portability.patch deleted file mode 100644 index 1d5905a67..000000000 --- a/package/utils/xfsprogs/patches/120-portability.patch +++ /dev/null @@ -1,45 +0,0 @@ -commit d2aef8b3967e53fe58178f5af50fef488ee0faed -Author: Jens Muecke -Date: Thu Jan 26 00:37:52 2012 +0100 - - 120-portability - ---- a/copy/xfs_copy.c -+++ b/copy/xfs_copy.c -@@ -463,6 +463,15 @@ read_ag_header(int fd, xfs_agnumber_t ag - } - - -+static void sig_mask(int type) -+{ -+ sigset_t mask; -+ sigemptyset(&mask); -+ sigaddset(&mask, SIGCHLD); -+ sigprocmask(type, &mask, NULL); -+} -+ -+ - void - write_wbuf(void) - { -@@ -478,9 +487,9 @@ write_wbuf(void) - if (target[i].state != INACTIVE) - pthread_mutex_unlock(&targ[i].wait); /* wake up */ - -- sigrelse(SIGCHLD); -+ sig_mask(SIG_UNBLOCK); - pthread_mutex_lock(&mainwait); -- sighold(SIGCHLD); -+ sig_mask(SIG_BLOCK); - } - - -@@ -847,7 +856,7 @@ main(int argc, char **argv) - /* set up sigchild signal handler */ - - signal(SIGCHLD, handler); -- sighold(SIGCHLD); -+ sig_mask(SIG_BLOCK); - - /* make children */ - diff --git a/package/utils/xfsprogs/patches/130-uclibc_no_xattr.patch b/package/utils/xfsprogs/patches/130-uclibc_no_xattr.patch deleted file mode 100644 index c5c4a2a2a..000000000 --- a/package/utils/xfsprogs/patches/130-uclibc_no_xattr.patch +++ /dev/null @@ -1,32 +0,0 @@ -commit 10d6058b24f18cb31889154f830b191849f45106 -Author: Jens Muecke -Date: Thu Jan 26 00:38:27 2012 +0100 - - 130-uclibc_no_xattr - ---- a/fsr/xfs_fsr.c -+++ b/fsr/xfs_fsr.c -@@ -35,7 +35,6 @@ - #include - #include - #include --#include - - - #ifndef XFS_XFLAG_NODEFRAG -@@ -990,6 +989,7 @@ fsr_setup_attr_fork( - int tfd, - xfs_bstat_t *bstatp) - { -+#if 0 - struct stat64 tstatbuf; - int i; - int last_forkoff = 0; -@@ -1108,6 +1108,7 @@ fsr_setup_attr_fork( - out: - if (dflag) - fsrprintf(_("set temp attr\n")); -+#endif - return 0; - } - diff --git a/package/utils/xfsprogs/patches/140-no_po.patch b/package/utils/xfsprogs/patches/140-no_po.patch deleted file mode 100644 index 640774453..000000000 --- a/package/utils/xfsprogs/patches/140-no_po.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -41,7 +41,7 @@ endif - - LIB_SUBDIRS = libxfs libxlog libxcmd libhandle libdisk - TOOL_SUBDIRS = copy db estimate fsck fsr growfs io logprint mkfs quota \ -- mdrestore repair rtcp m4 man doc po debian -+ mdrestore repair rtcp m4 man doc debian - - SUBDIRS = include $(LIB_SUBDIRS) $(TOOL_SUBDIRS) - -@@ -135,7 +135,6 @@ ifeq ($(HAVE_BUILDDEFS), no) - $(Q)$(MAKE) $(MAKEOPTS) -C . $@ - else - $(Q)$(MAKE) $(MAKEOPTS) $(SRCDIR) -- $(Q)$(MAKE) $(MAKEOPTS) -C po - $(Q)$(MAKE) $(MAKEOPTS) source-link - $(Q)cd $(SRCDIR) && dpkg-buildpackage - endif diff --git a/package/utils/xfsprogs/patches/150-include_fixes.patch b/package/utils/xfsprogs/patches/150-include_fixes.patch deleted file mode 100644 index 793622a16..000000000 --- a/package/utils/xfsprogs/patches/150-include_fixes.patch +++ /dev/null @@ -1,72 +0,0 @@ ---- a/libhandle/handle.c -+++ b/libhandle/handle.c -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include - - /* just pick a value we know is more than big enough */ - #define MAXHANSIZ 64 ---- a/libhandle/jdm.c -+++ b/libhandle/jdm.c -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include - - /* internal fshandle - typecast to a void for external use */ - #define FSHANDLE_SZ 8 ---- a/libdisk/evms.c -+++ b/libdisk/evms.c -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - #include - #include "evms.h" - ---- a/libdisk/evms.h -+++ b/libdisk/evms.h -@@ -16,6 +16,8 @@ - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -+#include -+ - #define EVMS_MAJOR 117 - #define EVMS_GET_VOL_STRIPE_INFO \ - _IOR(EVMS_MAJOR, 0xF0, struct evms_vol_stripe_info_s) ---- a/libdisk/fstype.h -+++ b/libdisk/fstype.h -@@ -192,7 +192,7 @@ struct adfs_super_block { - char s_dummy2[62]; - char s_checksum[1]; - }; --#define adfsblksize(s) ((uint) s.s_blksize[0]) -+#define adfsblksize(s) ((unsigned int) s.s_blksize[0]) - - /* found in first 4 bytes of block 1 */ - struct vxfs_super_block { ---- a/fsr/xfs_fsr.c -+++ b/fsr/xfs_fsr.c -@@ -25,6 +25,7 @@ - #include - #include - -+#include - #include - #include - #include ---- a/libdisk/xvm.c -+++ b/libdisk/xvm.c -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - #include - #include "xvm.h" - diff --git a/package/utils/xfsprogs/patches/160-format-security.patch b/package/utils/xfsprogs/patches/160-format-security.patch deleted file mode 100644 index 5ae627d4a..000000000 --- a/package/utils/xfsprogs/patches/160-format-security.patch +++ /dev/null @@ -1,29 +0,0 @@ -From: Ben Myers -Date: Fri, 1 Feb 2013 21:50:22 +0000 (-0600) -Subject: xfsprogs: fix warning in libxcmd/input.c -X-Git-Tag: v3.1.11~25 -X-Git-Url: http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs%2Fcmds%2Fxfsprogs.git;a=commitdiff_plain;h=50a3aa8977821ad072f3aa5b63645827f9b8ca1d - -xfsprogs: fix warning in libxcmd/input.c - -Fix an error when building with -Werror=format-security. - -input.c: In function 'fetchline': -input.c:91:2: error: format not a string literal and no format arguments [-Werror=format-security] - -Signed-off-by: Ben Myers -Reported by: Arkadiusz MiÅ›kiewicz -Reviewed-by: Mark Tinguely ---- - ---- a/libxcmd/input.c -+++ b/libxcmd/input.c -@@ -88,7 +88,7 @@ fetchline(void) - - if (!line) - return NULL; -- printf(get_prompt()); -+ printf("%s", get_prompt()); - fflush(stdout); - if (!fgets(line, MAXREADLINESZ, stdin)) { - free(line); diff --git a/scripts/combined-ext-image.sh b/scripts/combined-ext-image.sh index 0c7b1d993..7ff287bde 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/feeds b/scripts/feeds index 55c294ad0..f49cdb3e4 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 d446892e2..ea3873538 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 4960149f1..38e8e3ff3 100755 --- a/scripts/om-fwupgradecfg-gen.sh +++ b/scripts/om-fwupgradecfg-gen.sh @@ -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 fbd458bf2..53bb45a62 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,131 +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; - } - $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() { @@ -633,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/target/linux/apm821xx/Makefile b/target/linux/apm821xx/Makefile index 6d711543c..c3253322f 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/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 c1c47a7bd..feaba21eb 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/meraki-mr24.dts b/target/linux/apm821xx/dts/meraki-mr24.dts index 2c2f8d281..e06d37cbb 100644 --- a/target/linux/apm821xx/dts/meraki-mr24.dts +++ b/target/linux/apm821xx/dts/meraki-mr24.dts @@ -89,6 +89,18 @@ &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 { diff --git a/target/linux/apm821xx/dts/netgear-wndr4700.dts b/target/linux/apm821xx/dts/netgear-wndr4700.dts index 2e0addf74..96cf97c45 100644 --- a/target/linux/apm821xx/dts/netgear-wndr4700.dts +++ b/target/linux/apm821xx/dts/netgear-wndr4700.dts @@ -99,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 { diff --git a/target/linux/apm821xx/nand/config-default b/target/linux/apm821xx/nand/config-default index d6bdbd74e..ca6af461c 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 000000000..6f0cc6015 --- /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 000000000..8df0937e4 --- /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 000000000..598324634 --- /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 000000000..e50a41828 --- /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 000000000..cd61ac719 --- /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 000000000..4fc361757 --- /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 000000000..84063d303 --- /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 000000000..c7c32e5d3 --- /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 000000000..9977c60d2 --- /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 000000000..c6ccade8c --- /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 000000000..90a6dab2d --- /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 000000000..837fbdc54 --- /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 000000000..ee7ee1191 --- /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 000000000..9ddfcb95f --- /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 000000000..acded24bb --- /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 000000000..f0f1d0ea5 --- /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 000000000..046dd9c25 --- /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 000000000..22d2a317f --- /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 000000000..7b739c68c --- /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 000000000..8847d1fcc --- /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 000000000..aa621c52c --- /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 000000000..06ab798f5 --- /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 000000000..ff19c4f54 --- /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 000000000..73283f650 --- /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 000000000..3a2ed310b --- /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 000000000..28969a7b4 --- /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 000000000..e4a722646 --- /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 000000000..16074c7ee --- /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 000000000..fc8df3886 --- /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 000000000..1adad96fe --- /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 000000000..a295fa461 --- /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 000000000..4ee99f44c --- /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 000000000..0dbd924e3 --- /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 000000000..0475fdaf8 --- /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 018bcf21a..e9f6c5cfc 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 0581a43e3..18982392d 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 6b6db1ddd..77294a8cb 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 8c072387d..c3931c980 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 0b1affcfe..110726d25 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 d6a100617..6eb04b2c2 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 457c5e378..7f630a3c2 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 b30511d75..144a06970 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" -@@ -239,6 +241,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) { -@@ -278,6 +732,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 */ -@@ -335,6 +805,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 91% 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 354857105..ec97f16e2 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 @@ -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 000000000..f8b30ae1b --- /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 000000000..18ed8aecc --- /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 4e53fdfa2..000000000 --- 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 8acde84ec..000000000 --- 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 3dd2ed573..000000000 --- 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 ceacde9dd..000000000 --- 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/ar71xx/Makefile b/target/linux/ar71xx/Makefile index 1c66d7e76..104961929 100644 --- a/target/linux/ar71xx/Makefile +++ b/target/linux/ar71xx/Makefile @@ -13,7 +13,7 @@ FEATURES:=usbgadget CPU_TYPE:=24kc SUBTARGETS:=generic tiny nand mikrotik -KERNEL_PATCHVER:=4.4 +KERNEL_PATCHVER:=4.9 include $(INCLUDE_DIR)/target.mk 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 0fec36847..fac9dfa7a 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" @@ -391,6 +407,10 @@ 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" @@ -564,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" @@ -579,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" @@ -714,7 +746,6 @@ tl-wa901nd) ;; tl-wa901nd-v2|\ tl-wr941nd|\ -tl-wr941n-v7|\ tl-wr1041n-v2) ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "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 6dffb54e9..5a10a9f48 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -64,6 +64,7 @@ ar71xx_setup_interfaces() antminer-s3|\ antrouter-r1|\ ap121f|\ + ap91-5g|\ aw-nr580|\ bullet-m|\ c-55|\ @@ -103,6 +104,7 @@ ar71xx_setup_interfaces() rb-sxt2n|\ rb-sxt5n|\ rb-wap-2nd|\ + rb-wapg-5hact2hnd|\ re450|\ rocket-m-xw|\ sc300m |\ @@ -389,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" \ @@ -401,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" \ @@ -427,6 +430,11 @@ ar71xx_setup_interfaces() 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" ucidef_set_interface_raw "wlan" "wlan0" "dhcp" @@ -442,7 +450,6 @@ ar71xx_setup_interfaces() ;; archer-c7-v4|\ tl-wdr4300|\ - tl-wr941n-v7|\ tl-wr1041n-v2) ucidef_add_switch "switch0" \ "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan" @@ -558,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 6cbb3576d..2720288e3 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -40,6 +40,7 @@ get_status_led() { db120|\ dr342|\ dr344|\ + rut900|\ tew-632brp|\ tl-wr942n-v1|\ wpj344|\ @@ -80,6 +81,10 @@ get_status_led() { gl-mifi) status_led="$board:green:lan" ;; + ap91-5g|\ + n5q) + status_led="$board:green:signal4" + ;; ap96) status_led="$board:green:led2" ;; @@ -176,7 +181,8 @@ get_status_led() { oolite) status_led="$board:red:system" ;; - dw33d) + dw33d|\ + r36a) status_led="$board:blue:status" ;; eap300v2) @@ -204,6 +210,7 @@ get_status_led() { esr1750) status_led="$board:amber:power" ;; + gl-ar750|\ hiveap-121|\ nbg6716) status_led="$board:white:power" @@ -521,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 f9520b302..41ab43f7c 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 bc8972c2c..ccb041028 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 @@ -89,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) @@ -97,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|\ @@ -105,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 @@ -139,6 +141,10 @@ case "$FIRMWARE" in 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") diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index c3059eab2..b6642495d 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -263,9 +263,6 @@ tplink_board_detect() { "120000"*) model="MERCURY MAC1200R" ;; - "204100"*) - model="TP-Link TL-WR2041N" - ;; "254300"*) model="TP-Link TL-WR2543N/ND" ;; @@ -449,6 +446,9 @@ ar71xx_board_detect() { *"AP90Q") name="ap90q" ;; + *"AP91-5G") + name="ap91-5g" + ;; *"Archer C25 v1") name="archer-c25-v1" ;; @@ -673,6 +673,9 @@ ar71xx_board_detect() { *"GL-AR300M") name="gl-ar300m" ;; + *"GL-AR750") + name="gl-ar750" + ;; *"GL-CONNECT INET v1") name="gl-inet" @@ -768,6 +771,9 @@ ar71xx_board_detect() { *"MZK-W300NH") name="mzk-w300nh" ;; + *"N5Q") + name="n5q" + ;; *"Nanostation M") name="nanostation-m" ubnt_xm_board_detect @@ -844,6 +850,9 @@ ar71xx_board_detect() { *"Qihoo 360 C301") name="qihoo-c301" ;; + *"R36A") + name="r36a" + ;; *"R602N") name="r602n" ;; @@ -986,12 +995,18 @@ ar71xx_board_detect() { *"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" ;; @@ -1148,12 +1163,6 @@ ar71xx_board_detect() { *"TL-WR1043ND v4") name="tl-wr1043nd-v4" ;; - *"TL-WR2041N v1") - name="tl-wr2041n-v1" - ;; - *"TL-WR2041N v2") - name="tl-wr2041n-v2" - ;; *"TL-WR2543N"*) name="tl-wr2543n" ;; @@ -1226,9 +1235,6 @@ ar71xx_board_detect() { *"TL-WR941N/ND v6") name="tl-wr941nd-v6" ;; - *"TL-WR941N v7") - name="tl-wr941n-v7" - ;; *"TL-WR941ND") name="tl-wr941nd" ;; 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 df653f2e4..7d3e82813 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 4b2fb6c41..909e61509 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-wr940n-v4 |\ - tl-wr941nd-v6 |\ - 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 c9aa4b1eb..cc3dc42c9 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 1322fb8a9..3d7b1593e 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -242,6 +242,7 @@ platform_check_image() { gl-ar150|\ gl-ar300m|\ gl-ar300|\ + gl-ar750|\ gl-domino|\ gl-mifi|\ gl-usb150|\ @@ -252,10 +253,12 @@ platform_check_image() { loco-m-xw|\ mzk-w04nu|\ mzk-w300nh|\ + n5q|\ nanostation-m|\ nanostation-m-xw|\ nbg460n_550n_550nh|\ pqi-air-pen|\ + r36a|\ r602n|\ rocket-m|\ rocket-m-ti|\ @@ -310,6 +313,7 @@ platform_check_image() { ap136-020|\ ap147-010|\ ap152|\ + ap91-5g|\ ap96|\ arduino-yun|\ bhr-4grv2|\ @@ -385,6 +389,7 @@ platform_check_image() { onion-omega|\ oolite|\ re450|\ + rut900|\ smart-300|\ som9331|\ tellstick-znet-lite|\ @@ -450,8 +455,7 @@ platform_check_image() { tl-wr940n-v4|\ tl-wr941nd|\ tl-wr941nd-v5|\ - tl-wr941nd-v6|\ - tl-wr941n-v7) + tl-wr941nd-v6) local magic_ver="0100" case "$board" in @@ -663,7 +667,8 @@ platform_check_image() { rb-lhg-5nd|\ rb-map-2nd|\ rb-mapl-2nd|\ - rb-wap-2nd) + rb-wap-2nd|\ + rb-wapg-5hact2hnd) return 0 ;; esac @@ -725,7 +730,8 @@ platform_pre_upgrade() { rb-lhg-5nd|\ rb-map-2nd|\ rb-mapl-2nd|\ - rb-wap-2nd) + rb-wap-2nd|\ + rb-wapg-5hact2hnd) # erase firmware if booted from initramfs [ -z "$(rootfs_type)" ] && mtd erase firmware ;; diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index 847836806..8ecf7e135 100644 --- a/target/linux/ar71xx/config-4.4 +++ b/target/linux/ar71xx/config-4.4 @@ -49,6 +49,7 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_AP531B0 is not set # CONFIG_ATH79_MACH_AP81 is not set # 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 @@ -113,6 +114,7 @@ CONFIG_ATH79=y # 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 @@ -138,6 +140,7 @@ CONFIG_ATH79=y # 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 @@ -151,6 +154,7 @@ CONFIG_ATH79=y # 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 @@ -163,6 +167,7 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_RBSPI is not set # CONFIG_ATH79_MACH_RBSXTLITE is not set # 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 diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9 index 2c20b5839..0e224ae1c 100644 --- a/target/linux/ar71xx/config-4.9 +++ b/target/linux/ar71xx/config-4.9 @@ -47,6 +47,7 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_AP531B0 is not set # CONFIG_ATH79_MACH_AP81 is not set # 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 @@ -111,6 +112,7 @@ CONFIG_ATH79=y # 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 @@ -136,6 +138,7 @@ CONFIG_ATH79=y # 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 @@ -149,6 +152,7 @@ CONFIG_ATH79=y # 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 @@ -161,6 +165,7 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_RBSPI is not set # CONFIG_ATH79_MACH_RBSXTLITE is not set # 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 @@ -456,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_KERNEL_KALLSYMS=n \ No newline at end of file diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt index 1198fcb74..3ca77550b 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 @@ -761,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 @@ -925,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 @@ -1272,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 @@ -1999,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 455af762e..e9f4d9852 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 @@ -121,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 @@ -146,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 @@ -160,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 @@ -172,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 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 000000000..64b943038 --- /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-gl-ar750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750.c new file mode 100644 index 000000000..9ee6e29c0 --- /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 000000000..895fc3293 --- /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 000000000..b3493e2c4 --- /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-rbspi.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c index cfd737316..8d8dd40e8 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c @@ -12,6 +12,7 @@ * - 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 cAP2nD @@ -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", @@ -485,6 +500,40 @@ 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, @@ -538,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) @@ -641,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 @@ -958,6 +1007,47 @@ static void __init rbmap_setup(void) 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); @@ -968,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 000000000..43a2a78c6 --- /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-wr941n-v7.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c deleted file mode 100755 index 8afdb4723..000000000 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c +++ /dev/null @@ -1,279 +0,0 @@ -/* - * TP-LINK TL-WR941N v7 board support - * - * Copyright (C) 2012 Gabor Juhos - * Copyright (C) 2014 Weijie Gao - * - * 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-ap9x-pci.h" -#include "dev-eth.h" -#include "dev-gpio-buttons.h" -#include "dev-leds-gpio.h" -#include "dev-m25p80.h" -#include "dev-spi.h" -#include "dev-usb.h" -#include "dev-wmac.h" -#include "machtypes.h" - -#define WR941NV7_GPIO_LED_WLAN 12 -#define WR941NV7_GPIO_LED_SYSTEM 19 -#define WR941NV7_GPIO_LED_QSS 15 - -#define WR941NV7_GPIO_BTN_RESET 16 - -#define WR941NV7_KEYS_POLL_INTERVAL 20 /* msecs */ -#define WR941NV7_KEYS_DEBOUNCE_INTERVAL (3 * WR941NV7_KEYS_POLL_INTERVAL) - -#define ATH_MII_MGMT_CMD 0x24 -#define ATH_MGMT_CMD_READ 0x1 - -#define ATH_MII_MGMT_ADDRESS 0x28 -#define ATH_ADDR_SHIFT 8 - -#define ATH_MII_MGMT_CTRL 0x2c -#define ATH_MII_MGMT_STATUS 0x30 - -#define ATH_MII_MGMT_IND 0x34 -#define ATH_MGMT_IND_BUSY (1 << 0) -#define ATH_MGMT_IND_INVALID (1 << 2) - -static const char *wr941nv7_part_probes[] = { - "tp-link", - NULL, -}; - -static struct flash_platform_data wr941nv7_flash_data = { - .part_probes = wr941nv7_part_probes, -}; - -static struct gpio_led wr941nv7_leds_gpio[] __initdata = { - { - .name = "tp-link:green:qss", - .gpio = WR941NV7_GPIO_LED_QSS, - .active_low = 1, - }, - { - .name = "tp-link:green:system", - .gpio = WR941NV7_GPIO_LED_SYSTEM, - .active_low = 1, - }, - { - .name = "tp-link:green:wlan", - .gpio = WR941NV7_GPIO_LED_WLAN, - .active_low = 1, - }, -}; - -static struct gpio_keys_button wr941nv7_gpio_keys[] __initdata = { - { - .desc = "reset", - .type = EV_KEY, - .code = KEY_RESTART, - .debounce_interval = WR941NV7_KEYS_DEBOUNCE_INTERVAL, - .gpio = WR941NV7_GPIO_BTN_RESET, - .active_low = 1, - }, -}; - -static struct mdio_board_info wr941nv7_mdio0_info[] = { - { - .bus_id = "ag71xx-mdio.0", - .phy_addr = 0, - .platform_data = NULL, - }, -}; - -static unsigned long __init ath_gmac_reg_rd(unsigned long reg) -{ - void __iomem *base; - unsigned long t; - - base = ioremap(AR71XX_GE0_BASE, AR71XX_GE0_SIZE); - - t = __raw_readl(base + reg); - - iounmap(base); - - return t; -} - -static void __init ath_gmac_reg_wr(unsigned long reg, unsigned long value) -{ - void __iomem *base; - unsigned long t = value; - - base = ioremap(AR71XX_GE0_BASE, AR71XX_GE0_SIZE); - - __raw_writel(t, base + reg); - - iounmap(base); -} - -static void __init phy_reg_write(unsigned char phy_addr, unsigned char reg, unsigned short data) -{ - unsigned short addr = (phy_addr << ATH_ADDR_SHIFT) | reg; - volatile int rddata; - unsigned short ii = 0xFFFF; - - do - { - udelay(5); - rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; - } while (rddata && --ii); - - ath_gmac_reg_wr(ATH_MII_MGMT_ADDRESS, addr); - ath_gmac_reg_wr(ATH_MII_MGMT_CTRL, data); - - do - { - udelay(5); - rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; - } while (rddata && --ii); -} - -static unsigned short __init phy_reg_read(unsigned char phy_addr, unsigned char reg) -{ - unsigned short addr = (phy_addr << ATH_ADDR_SHIFT) | reg, val; - volatile int rddata; - unsigned short ii = 0xffff; - - do - { - udelay(5); - rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; - } while (rddata && --ii); - - ath_gmac_reg_wr(ATH_MII_MGMT_CMD, 0x0); - ath_gmac_reg_wr(ATH_MII_MGMT_ADDRESS, addr); - ath_gmac_reg_wr(ATH_MII_MGMT_CMD, ATH_MGMT_CMD_READ); - - do - { - udelay(5); - rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; - } while (rddata && --ii); - - val = ath_gmac_reg_rd(ATH_MII_MGMT_STATUS); - ath_gmac_reg_wr(ATH_MII_MGMT_CMD, 0x0); - - return val; -} - -static void __init athrs27_reg_write(unsigned int s27_addr, unsigned int s27_write_data) -{ - unsigned int addr_temp; - unsigned int data; - unsigned char phy_address, reg_address; - - addr_temp = (s27_addr) >> 2; - data = addr_temp >> 7; - - phy_address = 0x1f; - reg_address = 0x10; - - phy_reg_write(phy_address, reg_address, data); - - phy_address = (0x17 & ((addr_temp >> 4) | 0x10)); - - reg_address = (((addr_temp << 1) & 0x1e) | 0x1); - data = (s27_write_data >> 16) & 0xffff; - phy_reg_write(phy_address, reg_address, data); - - reg_address = ((addr_temp << 1) & 0x1e); - data = s27_write_data & 0xffff; - phy_reg_write(phy_address, reg_address, data); -} - -static unsigned int __init athrs27_reg_read(unsigned int s27_addr) -{ - unsigned int addr_temp; - unsigned int s27_rd_csr_low, s27_rd_csr_high, s27_rd_csr; - unsigned int data; - unsigned char phy_address, reg_address; - - addr_temp = s27_addr >>2; - data = addr_temp >> 7; - - phy_address = 0x1f; - reg_address = 0x10; - - phy_reg_write(phy_address, reg_address, data); - - phy_address = (0x17 & ((addr_temp >> 4) | 0x10)); - reg_address = ((addr_temp << 1) & 0x1e); - s27_rd_csr_low = (unsigned int) phy_reg_read(phy_address, reg_address); - - reg_address = reg_address | 0x1; - s27_rd_csr_high = (unsigned int) phy_reg_read(phy_address, reg_address); - s27_rd_csr = (s27_rd_csr_high << 16) | s27_rd_csr_low ; - - return (s27_rd_csr); -} - -static void __init ar8236_reset(void) -{ - unsigned short i = 60; - - athrs27_reg_write(0x0, athrs27_reg_read(0x0) | 0x80000000); - while (i--) - { - mdelay(100); - if (!(athrs27_reg_read(0x0) & 0x80000000)) - break; - } -} - -static void __init wr941nv7_setup(void) -{ - u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); - u8 *art = (u8 *) KSEG1ADDR(0x1fff1000); - - ath79_register_m25p80(&wr941nv7_flash_data); - ath79_register_leds_gpio(-1, ARRAY_SIZE(wr941nv7_leds_gpio), - wr941nv7_leds_gpio); - ath79_register_gpio_keys_polled(-1, WR941NV7_KEYS_POLL_INTERVAL, - ARRAY_SIZE(wr941nv7_gpio_keys), - wr941nv7_gpio_keys); - - ath79_register_wmac(art, mac); - - ar8236_reset(); - - ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_MII_GE0 | - QCA955X_ETH_CFG_MII_GE0_SLAVE); - - mdiobus_register_board_info(wr941nv7_mdio0_info, - ARRAY_SIZE(wr941nv7_mdio0_info)); - ath79_register_mdio(0, 0x0); - - ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); - - /* GMAC0 is connected to an AR8236 switch */ - ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; - ath79_eth0_data.speed = SPEED_100; - 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); - - ath79_register_usb(); -} - -MIPS_MACHINE(ATH79_MACH_TL_WR941N_V7, "TL-WR941N-v7", - "TP-LINK TL-WR941N v7", - wr941nv7_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 88022e753..2374c4539 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/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index 0f536f0ec..a621fe2c9 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 */ @@ -113,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 */ @@ -142,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 */ @@ -164,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 */ @@ -197,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 */ diff --git a/target/linux/ar71xx/generic/config-default b/target/linux/ar71xx/generic/config-default index d5b59b594..cac1a27c3 100644 --- a/target/linux/ar71xx/generic/config-default +++ b/target/linux/ar71xx/generic/config-default @@ -25,6 +25,7 @@ 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 @@ -84,6 +85,7 @@ 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 @@ -107,6 +109,7 @@ 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 @@ -118,8 +121,10 @@ 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 @@ -181,6 +186,8 @@ 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 diff --git a/target/linux/ar71xx/image/generic-legacy-devices.mk b/target/linux/ar71xx/image/generic-legacy-devices.mk index 70e32748b..7692e802d 100644 --- a/target/linux/ar71xx/image/generic-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 \ diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk index 89ab1f029..88b9f930b 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)))) \ @@ -61,6 +77,17 @@ 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) \ @@ -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 @@ -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 @@ -588,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 @@ -597,6 +665,28 @@ define Device/r602n endef TARGET_DEVICES += r602n +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 += rut900 + define Device/mc-mac1200r $(Device/tplink-8mlzma) DEVICE_TITLE := Mercury MAC1200R @@ -734,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 @@ -891,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 diff --git a/target/linux/ar71xx/image/legacy.mk b/target/linux/ar71xx/image/legacy.mk index 3c484713d..bd8ca2cef 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 @@ -897,7 +896,6 @@ $(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)) diff --git a/target/linux/ar71xx/image/mikrotik.mk b/target/linux/ar71xx/image/mikrotik.mk index fd6ca2793..403bcb08b 100644 --- a/target/linux/ar71xx/image/mikrotik.mk +++ b/target/linux/ar71xx/image/mikrotik.mk @@ -50,5 +50,6 @@ 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-ac diff --git a/target/linux/ar71xx/image/tiny-tp-link.mk b/target/linux/ar71xx/image/tiny-tp-link.mk index 6700ade52..092d8aa11 100644 --- a/target/linux/ar71xx/image/tiny-tp-link.mk +++ b/target/linux/ar71xx/image/tiny-tp-link.mk @@ -682,32 +682,3 @@ define Device/tl-wr941nd-v6-cn TPLINK_HWID := 0x09410006 endef TARGET_DEVICES += tl-wr941nd-v6-cn - -define Device/tl-wr941n-v7 - $(Device/tplink-4mlzma) - DEVICE_TITLE := TP-LINK TL-WR941N/ND v7 - BOARDNAME := TL-WR941N-v7 - DEVICE_PROFILE := TLWR941 - TPLINK_HWID := 0x09410007 -endef -TARGET_DEVICES += tl-wr941n-v7 - -define Device/tl-wr2041n-v1 - $(Device/tplink-4mlzma) - DEVICE_TITLE := TP-LINK TL-WR2041N v1 - BOARDNAME := TL-WDR3500 - DEVICE_PROFILE := TLWR2041 - TPLINK_HWID := 0x20410001 -endef -TARGET_DEVICES += tl-wr2041n-v1 - -define Device/tl-wr2041n-v2 - $(Device/tplink-4mlzma) - DEVICE_TITLE := TP-LINK TL-WR2041N v2 - BOARDNAME := TL-WR941N-v7 - DEVICE_PROFILE := TLWR2041 - TPLINK_HWID := 0x20410002 -endef -TARGET_DEVICES += tl-wr2041n-v2 - - 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 1ad5fa68a..1d9d761d7 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,29 @@ void __init prom_init(void) +@@ -136,6 +136,30 @@ void __init prom_init(void) initrd_end = initrd_start + fw_getenvl("initrd_size"); } #endif @@ -22,11 +22,12 @@ + 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/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 000000000..3a6438ee8 --- /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.9/701-MIPS-ath79-add-routerboard-detection.patch b/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch index 1ad5fa68a..1d9d761d7 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,29 @@ void __init prom_init(void) +@@ -136,6 +136,30 @@ void __init prom_init(void) initrd_end = initrd_start + fw_getenvl("initrd_size"); } #endif @@ -22,11 +22,12 @@ + 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/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 000000000..3a6438ee8 --- /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/armvirt/64/config-default b/target/linux/armvirt/64/config-default index c58863dc8..4e63668f5 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 @@ -71,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 @@ -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 2cf382063..107f8607c 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/config-4.14 b/target/linux/armvirt/config-4.14 new file mode 100644 index 000000000..64444d72f --- /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/image/sama5.mk b/target/linux/at91/image/sama5.mk index d33a39865..b251d714d 100644 --- a/target/linux/at91/image/sama5.mk +++ b/target/linux/at91/image/sama5.mk @@ -20,16 +20,16 @@ define Build/at91-sdcard mcopy -i $@.boot $(BIN_DIR)/BOOT.bin ::BOOT.bin;) ./gen_at91_sdcard_img.sh \ - $(dir $@)$(IMG_PREFIX)-$(PROFILE_SANITIZED)-sdcard.img \ + $(dir $@)$(IMG_PREFIX)-$(DEVICE_NAME)-sdcard.img \ $@.boot \ $(KDIR)/root.ext4 \ $(AT91_SD_BOOT_PARTSIZE) \ $(CONFIG_TARGET_ROOTFS_PARTSIZE) - gzip -nc9 $(dir $@)$(IMG_PREFIX)-$(PROFILE_SANITIZED)-sdcard.img \ - > $(dir $@)$(IMG_PREFIX)-$(PROFILE_SANITIZED)-sdcard.img.gz + gzip -nc9 $(dir $@)$(IMG_PREFIX)-$(DEVICE_NAME)-sdcard.img \ + > $(dir $@)$(IMG_PREFIX)-$(DEVICE_NAME)-sdcard.img.gz - $(CP) $(dir $@)$(IMG_PREFIX)-$(PROFILE_SANITIZED)-sdcard.img.gz \ + $(CP) $(dir $@)$(IMG_PREFIX)-$(DEVICE_NAME)-sdcard.img.gz \ $(BIN_DIR)/ rm -f $(BIN_DIR)/BOOT.bin diff --git a/target/linux/brcm2708/bcm2708/config-4.9 b/target/linux/brcm2708/bcm2708/config-4.9 index 0ab238c91..dccf85fac 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 5c0ab7ea7..71884a5fa 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 af69f080b..d402f4b57 100644 --- a/target/linux/brcm2708/bcm2710/config-4.9 +++ b/target/linux/brcm2708/bcm2710/config-4.9 @@ -353,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/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 000000000..d698821f3 --- /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 000000000..2092cc28f --- /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.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 000000000..06931ce2a --- /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 000000000..2092cc28f --- /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/config-3.18 b/target/linux/generic/config-3.18 index 4909fa0cd..7df43be97 100644 --- a/target/linux/generic/config-3.18 +++ b/target/linux/generic/config-3.18 @@ -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 index f156cda85..fa389bf8c 100644 --- a/target/linux/generic/config-4.14 +++ b/target/linux/generic/config-4.14 @@ -146,8 +146,8 @@ CONFIG_ANON_INODES=y # CONFIG_APPLE_GMUX is not set # CONFIG_APPLE_PROPERTIES is not set # CONFIG_APPLICOM is not set -# CONFIG_AQUANTIA_PHY 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 @@ -231,8 +231,8 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARCH_PRIMA2 is not set # CONFIG_ARCH_PXA is not set # CONFIG_ARCH_QCOM is not set -# CONFIG_ARCH_REALVIEW 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 @@ -272,14 +272,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_ARM64_ERRATUM_858921 is not set # CONFIG_ARM64_RELOC_TEST is not set # CONFIG_ARM_APPENDED_DTB is not set @@ -324,6 +324,7 @@ CONFIG_ARM_GIC_MAX_NR=1 # 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 @@ -993,6 +994,7 @@ CONFIG_CRYPTO_PCRYPT=y # 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 @@ -1137,23 +1139,29 @@ CONFIG_DQL=y # 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_KIRIN 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 @@ -1166,12 +1174,16 @@ CONFIG_DQL=y # 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 @@ -1259,11 +1271,11 @@ CONFIG_EXT4_USE_FOR_EXT2=y # 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_EXTCON_MAX3355 is not set CONFIG_EXTRA_FIRMWARE="" CONFIG_EXTRA_TARGETS="" # CONFIG_EXYNOS_ADC is not set @@ -1637,11 +1649,12 @@ CONFIG_HIGH_RES_TIMERS=y # CONFIG_HINIC is not set # CONFIG_HIP04_ETH is not set # CONFIG_HIPPI is not set -# CONFIG_HISI_FEMAC 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 @@ -1662,8 +1675,8 @@ CONFIG_HPET_MMAP_DEFAULT=y # CONFIG_HTC_EGPIO is not set # CONFIG_HTC_I2CPLD is not set # CONFIG_HTC_PASIC3 is not set -# CONFIG_HTU21 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 @@ -2032,7 +2045,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 @@ -2161,6 +2174,7 @@ 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 @@ -2237,7 +2251,6 @@ CONFIG_LBDAF=y # CONFIG_LCD_VGG2432A4 is not set # CONFIG_LDM_PARTITION is not set CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y -# CONFIG_LED_TRIGGER_PHY is not set # CONFIG_LEDS_BCM6328 is not set # CONFIG_LEDS_BCM6358 is not set # CONFIG_LEDS_BD2802 is not set @@ -2289,6 +2302,7 @@ CONFIG_LEDS_TRIGGER_NETDEV=y 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 @@ -2410,11 +2424,11 @@ CONFIG_MAY_USE_DEVLINK=y # CONFIG_MCP4922 is not set # CONFIG_MCPM is not set # CONFIG_MD is not set -# CONFIG_MDIO_DEVICE 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 @@ -3385,6 +3399,7 @@ CONFIG_PARTITION_ADVANCED=y # 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 @@ -3521,6 +3536,7 @@ CONFIG_PREEMPT_NONE=y 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 @@ -3986,8 +4002,8 @@ CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_SENSORS_APDS990X is not set # CONFIG_SENSORS_APPLESMC is not set # CONFIG_SENSORS_ASB100 is not set -# CONFIG_SENSORS_ASPEED 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 @@ -4422,8 +4438,8 @@ CONFIG_SND_PROC_FS=y # 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_CS4349 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 @@ -4448,13 +4464,13 @@ 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_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_BYTCR_RT5640_MACH is not set -# CONFIG_SND_SOC_INTEL_BYTCR_RT5651_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 @@ -4570,8 +4586,8 @@ CONFIG_SND_X86=y # CONFIG_SOC_HAS_OMAP2_SDRC is not set # CONFIG_SOC_OMAP5 is not set # CONFIG_SOC_TI is not set -# CONFIG_SOFT_WATCHDOG 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 @@ -4768,6 +4784,7 @@ CONFIG_TCP_CONG_CUBIC=y # 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 @@ -4809,11 +4826,11 @@ CONFIG_TEXTSEARCH=y # 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_THUNDERBOLT is not set # CONFIG_TICK_CPU_ACCOUNTING is not set CONFIG_TICK_ONESHOT=y # CONFIG_TIFM_CORE is not set diff --git a/target/linux/generic/config-4.4 b/target/linux/generic/config-4.4 index a343fa23b..050756933 100644 --- a/target/linux/generic/config-4.4 +++ b/target/linux/generic/config-4.4 @@ -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 @@ -3860,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 @@ -4854,5 +4854,3 @@ CONFIG_ZONE_DMA_FLAG=1 # CONFIG_ZPOOL is not set # CONFIG_ZRAM is not set # CONFIG_ZSMALLOC is not set -# CONFIG_NF_CONNTRACK_CHAIN_EVENTS is not set -# CONFIG_SHORTCUT_FE is not set \ No newline at end of file diff --git a/target/linux/generic/config-4.9 b/target/linux/generic/config-4.9 index 15b64d794..4ebcfb636 100644 --- a/target/linux/generic/config-4.9 +++ b/target/linux/generic/config-4.9 @@ -260,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 @@ -1194,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 @@ -1931,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 @@ -4226,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 @@ -4559,11 +4559,11 @@ CONFIG_TEXTSEARCH=y # 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_THUNDERBOLT is not set # CONFIG_TICK_CPU_ACCOUNTING is not set CONFIG_TICK_ONESHOT=y # CONFIG_TIFM_CORE is not set @@ -5315,5 +5315,3 @@ CONFIG_ZONE_DMA=y # CONFIG_ZPOOL is not set # CONFIG_ZRAM is not set # CONFIG_ZSMALLOC is not set -# CONFIG_NF_CONNTRACK_CHAIN_EVENTS is not set -# CONFIG_SHORTCUT_FE is not set \ No newline at end of file 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 index 2706f13dc..e57214ba0 100644 --- 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 @@ -102,9 +102,9 @@ Signed-off-by: Hauke Mehrtens #include +#include #include + #include - #include "mtdcore.h" -@@ -863,6 +864,32 @@ void deregister_mtd_parser(struct mtd_pa +@@ -864,6 +865,32 @@ void deregister_mtd_parser(struct mtd_pa EXPORT_SYMBOL_GPL(deregister_mtd_parser); /* @@ -137,9 +137,9 @@ Signed-off-by: Hauke Mehrtens * Do not forget to update 'parse_mtd_partitions()' kerneldoc comment if you * are changing this array! */ -@@ -920,6 +947,13 @@ int parse_mtd_partitions(struct mtd_info - { - struct mtd_part_parser *parser; +@@ -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; + @@ -149,9 +149,9 @@ Signed-off-by: Hauke Mehrtens + types = types_of; + } - if (!types) - types = default_mtd_part_types; -@@ -945,6 +979,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) { +@@ -1004,6 +1038,7 @@ int parse_mtd_partitions(struct mtd_info if (ret < 0 && !err) err = ret; } 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 index f0c852a69..e722d8ca9 100644 --- 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 @@ -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. -@@ -686,6 +690,7 @@ int mtd_add_partition(struct mtd_info *p +@@ -687,6 +691,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); -@@ -764,6 +769,35 @@ int mtd_del_partition(struct mtd_info *m +@@ -765,6 +770,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 -@@ -795,6 +829,7 @@ int add_mtd_partitions(struct mtd_info * +@@ -796,6 +830,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.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 index 77ee85a8c..7481225be 100644 --- 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 @@ -9,7 +9,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -1034,6 +1034,62 @@ void mtd_part_parser_cleanup(struct mtd_ +@@ -1093,6 +1093,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.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 index dff9c3166..26a19b82f 100644 --- 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 @@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -769,6 +769,36 @@ int mtd_del_partition(struct mtd_info *m +@@ -770,6 +770,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 -@@ -777,6 +807,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition); +@@ -778,6 +808,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, -@@ -791,6 +822,12 @@ static void mtd_partition_split(struct m +@@ -792,6 +823,12 @@ static void mtd_partition_split(struct m if (rootfs_found) return; 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 index 97bd7730c..a4fb15586 100644 --- 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 @@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -799,6 +799,17 @@ run_parsers_by_type(struct mtd_part *sla +@@ -800,6 +800,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 -@@ -1144,6 +1155,24 @@ int mtd_is_partition(const struct mtd_in +@@ -1203,6 +1214,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.14/411-mtd-partial_eraseblock_write.patch b/target/linux/generic/pending-4.14/411-mtd-partial_eraseblock_write.patch index 096d6a4e7..9de5fd263 100644 --- 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 @@ -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; -@@ -598,19 +667,22 @@ static struct mtd_part *allocate_partiti +@@ -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 */ 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 index fd6ffc6fa..2ffff4ecf 100644 --- 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 @@ -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.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 000000000..b7877297a --- /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.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 5e9ad8cf0..6c2e2602e 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/400-mtd-add-rootfs-split-support.patch b/target/linux/generic/pending-4.9/400-mtd-add-rootfs-split-support.patch index cf8a54ff5..ef7a6df3e 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 c11245349..66c499d3e 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 b78ff526f..9b406d468 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 8e9604fb7..0ec5540d0 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 6c03a2984..9a585214e 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 fd6ffc6fa..2ffff4ecf 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 000000000..e032b08f4 --- /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/kirkwood/base-files/etc/board.d/01_leds b/target/linux/kirkwood/base-files/etc/board.d/01_leds index 0d8975918..4e72e344a 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 85049d296..5d66e0ffe 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 71a1639c2..0667ad29f 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 ba7e4bb39..8fd2f387a 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 4073c2d55..10eb5aa73 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 f1229fa97..000000000 --- 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 d45fc92ec..000000000 --- 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 b28ee873b..27012bd21 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 77ef89679..39d93275f 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -5,126 +5,135 @@ # See /LICENSE for more information. # -NAND_BLOCKSIZE := 2048-128k - include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk KERNEL_LOADADDR:=0x8000 -UBI_OPTS := -m 2048 -p 128KiB -s 512 -UBIFS_OPTS := -m 2048 -e 126KiB -c 4096 - define Device/Default PROFILES := Default KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts) 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 -TARGET_DEVICES += dockstar -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 += goflexnet +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 += goflexhome +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 +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 +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 += iconnect +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 += nsa310b +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 -TARGET_DEVICES += nsa325 - -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 -TARGET_DEVICES += on100 - -define Device/pogo_e02 -$(Device/dockstar) - DEVICE_TITLE := Cloud Engines Pogoplug E02 - DEVICE_DTS := kirkwood-pogo_e02 -endef -TARGET_DEVICES += pogo_e02 - -define Device/ib62x0 -$(Device/dockstar) - DEVICE_TITLE := RaidSonic ICY BOX IB-NAS62x0 - DEVICE_DTS := kirkwood-ib62x0 -endef -TARGET_DEVICES += ib62x0 +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 d6d10d814..f4e694737 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 711022293..faf8d891a 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 0e69f0cfa..000000000 --- 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 28c3e535d..3cab70aaa 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 000000000..dff1966d5 --- /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/base-files/etc/board.d/02_network b/target/linux/lantiq/base-files/etc/board.d/02_network index efe631c99..ca974b071 100755 --- a/target/linux/lantiq/base-files/etc/board.d/02_network +++ b/target/linux/lantiq/base-files/etc/board.d/02_network @@ -229,7 +229,7 @@ buffalo,wbmr-300hpd) 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 ucidef_add_vdsl_modem "$annex" "$tone" "$xfer_mode" 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 index 292d407c3..3b0313d1a 100644 --- 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 @@ -29,6 +29,17 @@ rename_xdsl_ifname() 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 @@ -42,6 +53,7 @@ migrate_led_xdsl_ifname() config_load network config_foreach migrate_network_xdsl_ifname +config_foreach add_atm_bridge_nameprefix atm-bridge [ "$IFNAME_CHANGED" = "1" ] && uci commit network diff --git a/target/linux/layerscape/armv8_32b/config-4.9 b/target/linux/layerscape/armv8_32b/config-4.9 index 9e5b33b88..0d98e8a13 100644 --- a/target/linux/layerscape/armv8_32b/config-4.9 +++ b/target/linux/layerscape/armv8_32b/config-4.9 @@ -990,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 diff --git a/target/linux/layerscape/armv8_64b/config-4.9 b/target/linux/layerscape/armv8_64b/config-4.9 index 546e589be..bb7443431 100644 --- a/target/linux/layerscape/armv8_64b/config-4.9 +++ b/target/linux/layerscape/armv8_64b/config-4.9 @@ -941,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 diff --git a/target/linux/malta/Makefile b/target/linux/malta/Makefile index c2b50f55b..1833f95ba 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.9 +KERNEL_PATCHVER:=4.14 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/malta/README b/target/linux/malta/README index e48665909..0bb1a1e35 100644 --- a/target/linux/malta/README +++ b/target/linux/malta/README @@ -5,15 +5,15 @@ troubleshoot MIPS applications without access to real hardware. To use the images built by OpenWrt with qemu, use the following commands: For the 32 bit little-endian image: -qemu-system-mipsel -kernel bin/targets/malta/le/lede-malta-le-vmlinux-initramfs.elf -nographic -m 256 +qemu-system-mipsel -kernel bin/targets/malta/le/openwrt-malta-le-vmlinux-initramfs.elf -nographic -m 256 For the 32 bit big-endian image: -qemu-system-mips -kernel bin/targets/malta/be/lede-malta-be-vmlinux-initramfs.elf -nographic -m 256 +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/lede-malta-le64-vmlinux-initramfs.elf -nographic -m 256 +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/lede-malta-be64-vmlinux-initramfs.elf -nographic -m 256 +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/config-4.14 b/target/linux/malta/config-4.14 new file mode 100644 index 000000000..61684be9a --- /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/mpc85xx/config-4.9 b/target/linux/mpc85xx/config-4.9 index f8114215f..68568c4a6 100644 --- a/target/linux/mpc85xx/config-4.9 +++ b/target/linux/mpc85xx/config-4.9 @@ -290,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 diff --git a/target/linux/octeon/config-4.14 b/target/linux/octeon/config-4.14 index 687b37f3c..24cba2b80 100644 --- a/target/linux/octeon/config-4.14 +++ b/target/linux/octeon/config-4.14 @@ -259,7 +259,6 @@ CONFIG_PHYS_ADDR_T_64BIT=y CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE_SYSCTL=y CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 -CONFIG_PROC_PAGE_MONITOR=y CONFIG_QUEUED_RWLOCKS=y CONFIG_QUEUED_SPINLOCKS=y CONFIG_RCU_NEED_SEGCBLIST=y diff --git a/target/linux/octeon/config-4.9 b/target/linux/octeon/config-4.9 index 280244669..5599b2407 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/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds index 03d084f17..3e26493e5 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -56,6 +56,10 @@ air3gii) 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) ucidef_set_rssimon "wlan0" "200000" "1" @@ -453,8 +457,7 @@ y1) 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_netdev "lan" "LAN" "$boardname:blue:lan" "eth0.1" "tx rx" - ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:internet" "eth0.2" "tx rx" + ucidef_set_led_switch "lan" "LAN" "$boardname:blue:lan" "switch0" "0x03" ;; y1s) set_usb_led "$boardname:blue:usb" 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 b8116c773..105f5e9e3 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -71,6 +71,7 @@ ramips_setup_interfaces() ;; 3g-6200n|\ ai-br100|\ + alfa-network,ac1200rm|\ d240|\ db-wrt01|\ dir-300-b7|\ @@ -111,7 +112,6 @@ ramips_setup_interfaces() wndr3700v5|\ wt1520-4M|\ wt1520-8M|\ - y1|\ youku-yk1|\ zbt-ape522ii|\ zbt-we1326|\ @@ -348,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 diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index d7cc4173a..e1d29152f 100644 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -25,6 +25,7 @@ get_status_led() { ex2700|\ ex3700|\ fonera20n|\ + firewrt|\ hg255d|\ kn|\ kn_rc|\ @@ -68,6 +69,13 @@ get_status_led() { ht-tm02) status_led="$boardname:blue:wlan" ;; + alfa-network,ac1200rm|\ + awapn2403|\ + dir-645|\ + sk-wb8|\ + wrh-300cr) + status_led="$boardname:green:wps" + ;; all0239-3g|\ dcs-930|\ dir-300-b1|\ @@ -101,12 +109,6 @@ get_status_led() { ip2202) status_led="$boardname:green:run" ;; - awapn2403|\ - dir-645|\ - sk-wb8|\ - wrh-300cr) - status_led="$boardname:green:wps" - ;; c108) status_led="$boardname:green:lan" ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 8160f5d38..cd2100132 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|\ diff --git a/target/linux/ramips/dts/AC1200RM.dts b/target/linux/ramips/dts/AC1200RM.dts new file mode 100644 index 000000000..9305cb00e --- /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/GB-PC1.dts b/target/linux/ramips/dts/GB-PC1.dts index df7caa910..664dfa1ef 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/UBNT-ER-e50.dtsi b/target/linux/ramips/dts/UBNT-ER-e50.dtsi index b38c71949..0947dd610 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 ca26d8172..7de37804a 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/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 902677f3a..6f9aa1aa6 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -27,6 +27,15 @@ define Device/ai-br100 endef TARGET_DEVICES += ai-br100 +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 diff --git a/target/linux/sunxi/config-4.9 b/target/linux/sunxi/config-4.9 index e961c8ad8..bf2111dc0 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/x86/config-4.9 b/target/linux/x86/config-4.9 index b5003546c..76366a7d7 100644 --- a/target/linux/x86/config-4.9 +++ b/target/linux/x86/config-4.9 @@ -272,6 +272,7 @@ CONFIG_JBD2=y CONFIG_KALLSYMS=y CONFIG_KEXEC=y CONFIG_KEXEC_CORE=y +# CONFIG_KEXEC_FILE is not set CONFIG_KEYBOARD_ATKBD=y # CONFIG_LEDS_CLEVO_MAIL is not set CONFIG_LIBNVDIMM=y diff --git a/target/linux/x86/generic/config-default b/target/linux/x86/generic/config-default index c7e7ed366..327e7c647 100644 --- a/target/linux/x86/generic/config-default +++ b/target/linux/x86/generic/config-default @@ -72,8 +72,6 @@ CONFIG_DRM_AMDGPU=y # CONFIG_DRM_AMD_ACP is not set CONFIG_DRM_BOCHS=y CONFIG_DRM_BRIDGE=y -# CONFIG_DRM_DEBUG_MM is not set -# CONFIG_DRM_DEBUG_MM_SELFTEST is not set CONFIG_DRM_FBDEV_EMULATION=y CONFIG_DRM_FBDEV_OVERALLOC=100 # CONFIG_DRM_GMA500 is not set diff --git a/target/linux/x86/legacy/config-default b/target/linux/x86/legacy/config-default index a438eedd8..d1a4e8103 100644 --- a/target/linux/x86/legacy/config-default +++ b/target/linux/x86/legacy/config-default @@ -58,8 +58,6 @@ CONFIG_DRM_AMDGPU=y # CONFIG_DRM_AMD_ACP is not set CONFIG_DRM_BOCHS=y CONFIG_DRM_BRIDGE=y -# CONFIG_DRM_DEBUG_MM is not set -# CONFIG_DRM_DEBUG_MM_SELFTEST is not set CONFIG_DRM_FBDEV_EMULATION=y CONFIG_DRM_FBDEV_OVERALLOC=100 # CONFIG_DRM_GMA500 is not set diff --git a/target/linux/xburst/config-3.18 b/target/linux/xburst/config-3.18 index e1b28d66b..099f5b0ed 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 2bab6f219..e22f2325a 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/Makefile b/target/sdk/Makefile index ba2867406..d3822a0df 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= @@ -45,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.openwrt.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))