Compare commits
	
		
			184 Commits
		
	
	
		
			v19.07.0
			...
			v18.06.0-r
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 13f64a1e59 | ||
|   | d2aa3a1b62 | ||
|   | 78abc65347 | ||
|   | 55df39e684 | ||
|   | 97b1765a45 | ||
|   | f27e0b6bc4 | ||
|   | 71825c0bd8 | ||
|   | 04353c3af8 | ||
|   | 6e4fb77f9e | ||
|   | 642acc0fb0 | ||
|   | 843e421a05 | ||
|   | c4a0c0718a | ||
|   | 2ac5800fd9 | ||
|   | 7f3121cf8a | ||
|   | c276abf061 | ||
|   | 7950e1b9f4 | ||
|   | c2da3505e2 | ||
|   | b72bced2d7 | ||
|   | 4e9fa569b0 | ||
|   | 29934e5f03 | ||
|   | 36234df96c | ||
|   | 0c4f658d58 | ||
|   | 9178dc282d | ||
|   | 1863c38643 | ||
|   | 7381ed3d01 | ||
|   | 5529e71357 | ||
|   | 615186d415 | ||
|   | 0daff7fe23 | ||
|   | eb568e0aba | ||
|   | da318f3522 | ||
|   | afe0320ffc | ||
|   | a1373bc6fc | ||
|   | 3a99b278cd | ||
|   | 2af5cfe9b7 | ||
|   | 3c4cf92f13 | ||
|   | 192866d2b8 | ||
|   | 2369c89b75 | ||
|   | a21210fbb7 | ||
|   | 637d10d91e | ||
|   | 747600e93c | ||
|   | 25eb240f63 | ||
|   | 97cb9d04ee | ||
|   | 8af649756f | ||
|   | b6c134f254 | ||
|   | b85e150182 | ||
|   | b3b81d9d2a | ||
|   | 520c656d7b | ||
|   | 370078466c | ||
|   | ae0712ae8f | ||
|   | 38eee4da94 | ||
|   | 56f66be113 | ||
|   | db969b2f30 | ||
|   | 1bb1239c28 | ||
|   | 4a571ae62b | ||
|   | 503f7f0614 | ||
|   | 697d7fd000 | ||
|   | 9fd0a2f273 | ||
|   | 29ba45bb35 | ||
|   | 0506039845 | ||
|   | 8e662b9654 | ||
|   | da8fc1511f | ||
|   | 763c0473c8 | ||
|   | b32c304be8 | ||
|   | 6f398aa762 | ||
|   | d6ee5e462c | ||
|   | 4f765922f0 | ||
|   | 6cf00dcf7d | ||
|   | 4121018b3f | ||
|   | 5881e2434f | ||
|   | be799e8c2a | ||
|   | 3b8e53f6af | ||
|   | 68598374d1 | ||
|   | e0363a7d74 | ||
|   | 18f18a2054 | ||
|   | 244fd1aac6 | ||
|   | 8e1269c29d | ||
|   | c0763f08a5 | ||
|   | e6c17aa219 | ||
|   | f18f08d9c8 | ||
|   | 21a12f4269 | ||
|   | 46e232d8a1 | ||
|   | 433fb7d2c7 | ||
|   | 48c5d6ab77 | ||
|   | b8a5fc207a | ||
|   | 9811057ed1 | ||
|   | c24c8bfd0a | ||
|   | 0c59c9c9db | ||
|   | 1199a91095 | ||
|   | 6f8eb1b50f | ||
|   | 805e59cdcc | ||
|   | aa87a5cffb | ||
|   | 9310304d1a | ||
|   | 7128fe094f | ||
|   | e5301885bc | ||
|   | 0239448532 | ||
|   | b295e3a18d | ||
|   | ba204d941c | ||
|   | 324ea1f414 | ||
|   | 82cfec057f | ||
|   | b9555a9831 | ||
|   | a973a0a38b | ||
|   | 0bfb41a55a | ||
|   | bf5829ddf9 | ||
|   | 0037b13480 | ||
|   | dd49c62611 | ||
|   | 17eb0c4872 | ||
|   | 8ccdf809c0 | ||
|   | fa0275bd90 | ||
|   | 76ba98d9b0 | ||
|   | 45456fe0c8 | ||
|   | ac24a026d2 | ||
|   | f39a7179bc | ||
|   | 63c1719988 | ||
|   | 2301bbdf88 | ||
|   | 1df8281737 | ||
|   | eac20ce427 | ||
|   | c52cd4d8c3 | ||
|   | bdddbe9718 | ||
|   | 8458febc01 | ||
|   | a64a36308c | ||
|   | 715ff75b1b | ||
|   | a6d825d735 | ||
|   | d629e013ef | ||
|   | 65de91a884 | ||
|   | e567d313b6 | ||
|   | 1b39b665c3 | ||
|   | 3ec4921c16 | ||
|   | 0882a4cf25 | ||
|   | ec7d974055 | ||
|   | 742ac017ba | ||
|   | 66871d9c62 | ||
|   | 27223c0761 | ||
|   | d805812e75 | ||
|   | 9361c359e4 | ||
|   | 0411d3f654 | ||
|   | 701a7b1c86 | ||
|   | 53507cef82 | ||
|   | 991ec8e5b2 | ||
|   | 23cdf9f246 | ||
|   | 16e0866a74 | ||
|   | 1f26cfc92b | ||
|   | 294a45adbe | ||
|   | 1deadfe3de | ||
|   | 95922e16d7 | ||
|   | 2c9e3736f4 | ||
|   | a6a5de4ef3 | ||
|   | 9e4f4e1a1f | ||
|   | 8f2ac5c085 | ||
|   | 5d3b216d21 | ||
|   | 586872da59 | ||
|   | acdac1aa55 | ||
|   | 0d6d8d71fc | ||
|   | d4cad59927 | ||
|   | 09cb0a5626 | ||
|   | 0f35193aec | ||
|   | 1780f09ee3 | ||
|   | fff02093e6 | ||
|   | efdfb253d8 | ||
|   | 644f65afe1 | ||
|   | f47b5802b5 | ||
|   | f882f4474f | ||
|   | 9373836f94 | ||
|   | d4df69697d | ||
|   | dcd68100c2 | ||
|   | e39414ed07 | ||
|   | 2b7289cd3b | ||
|   | fdeba0e0ef | ||
|   | c97189e26d | ||
|   | 8aae794e99 | ||
|   | 60522320f6 | ||
|   | 68586cf233 | ||
|   | 938908f400 | ||
|   | a88ff7bf5b | ||
|   | ff8bde5296 | ||
|   | 8948a78862 | ||
|   | 7d368e41ce | ||
|   | fc6f1fd8fe | ||
|   | 54a864d914 | ||
|   | 4dab912edb | ||
|   | 72ebcef5be | ||
|   | 617b7e9bf4 | ||
|   | 323285ac00 | ||
|   | dc7487885e | ||
|   | f93c029395 | 
| @@ -1,9 +1,4 @@ | |||||||
| src-git packages https://git.openwrt.org/feed/packages.git | src-git packages https://git.openwrt.org/feed/packages.git^d83dc7cfb81680eff063acb7343eb9d6b0c9a6ab | ||||||
| src-git luci https://git.openwrt.org/project/luci.git | src-git luci https://git.openwrt.org/project/luci.git^c379f00e86a5fc5d05a8e967c5c5daa035a72359 | ||||||
| src-git routing https://git.openwrt.org/feed/routing.git | src-git routing https://git.openwrt.org/feed/routing.git^1b9d1c419f0ecefda51922a7845ab2183d6acd76 | ||||||
| src-git telephony https://git.openwrt.org/feed/telephony.git | src-git telephony https://git.openwrt.org/feed/telephony.git^1195dafe98bca2d3a41383eb2723d0104d7f9046 | ||||||
| #src-git video https://github.com/openwrt/video.git |  | ||||||
| #src-git targets https://github.com/openwrt/targets.git |  | ||||||
| #src-git management https://github.com/openwrt-management/packages.git |  | ||||||
| #src-git oldpackages http://git.openwrt.org/packages.git |  | ||||||
| #src-link custom /usr/src/openwrt/custom-feed |  | ||||||
|   | |||||||
| @@ -60,7 +60,7 @@ endef | |||||||
|  |  | ||||||
| define Build/netgear-dni | define Build/netgear-dni | ||||||
| 	$(STAGING_DIR_HOST)/bin/mkdniimg \ | 	$(STAGING_DIR_HOST)/bin/mkdniimg \ | ||||||
| 		-B $(NETGEAR_BOARD_ID) -v $(VERSION_DIST).$(REVISION) \ | 		-B $(NETGEAR_BOARD_ID) -v $(VERSION_DIST).$(firstword $(subst -, ,$(REVISION))) \ | ||||||
| 		$(if $(NETGEAR_HW_ID),-H $(NETGEAR_HW_ID)) \ | 		$(if $(NETGEAR_HW_ID),-H $(NETGEAR_HW_ID)) \ | ||||||
| 		-r "$(1)" \ | 		-r "$(1)" \ | ||||||
| 		-i $@ -o $@.new | 		-i $@ -o $@.new | ||||||
| @@ -135,7 +135,7 @@ define Build/lzma-no-dict | |||||||
| endef | endef | ||||||
|  |  | ||||||
| define Build/gzip | define Build/gzip | ||||||
| 	gzip --force -9n -c $@ $(1) > $@.new | 	gzip -f -9n -c $@ $(1) > $@.new | ||||||
| 	@mv $@.new $@ | 	@mv $@.new $@ | ||||||
| endef | endef | ||||||
|  |  | ||||||
| @@ -186,6 +186,10 @@ define Build/append-ubi | |||||||
| 	rm $@.tmp | 	rm $@.tmp | ||||||
| endef | endef | ||||||
|  |  | ||||||
|  | define Build/append-uboot | ||||||
|  | 	dd if=$(UBOOT_PATH) >> $@ | ||||||
|  | endef | ||||||
|  |  | ||||||
| define Build/pad-to | define Build/pad-to | ||||||
| 	dd if=$@ of=$@.new bs=$(1) conv=sync | 	dd if=$@ of=$@.new bs=$(1) conv=sync | ||||||
| 	mv $@.new $@ | 	mv $@.new $@ | ||||||
|   | |||||||
| @@ -4,13 +4,13 @@ LINUX_RELEASE?=1 | |||||||
|  |  | ||||||
| LINUX_VERSION-3.18 = .71 | LINUX_VERSION-3.18 = .71 | ||||||
| LINUX_VERSION-4.4 = .121 | LINUX_VERSION-4.4 = .121 | ||||||
| LINUX_VERSION-4.9 = .96 | LINUX_VERSION-4.9 = .109 | ||||||
| LINUX_VERSION-4.14 = .37 | LINUX_VERSION-4.14 = .50 | ||||||
|  |  | ||||||
| LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240 | LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240 | ||||||
| LINUX_KERNEL_HASH-4.4.121 = 44a88268b5088dc326b30c9b9133ac35a9a200b636b7268d08f32abeae6ca729 | LINUX_KERNEL_HASH-4.4.121 = 44a88268b5088dc326b30c9b9133ac35a9a200b636b7268d08f32abeae6ca729 | ||||||
| LINUX_KERNEL_HASH-4.9.96 = 826f596eb5197f8b17304649c2990dd7b766f5c79076cae79f4261c40cea877f | LINUX_KERNEL_HASH-4.9.109 = 3dcd5654a553432119492b69e649c4ed117781bfd571edcb02346c945be359b0 | ||||||
| LINUX_KERNEL_HASH-4.14.37 = 8197e7ed3620713e412905430a7bf93e2048384042ffba189a66f0eeb6908e92 | LINUX_KERNEL_HASH-4.14.50 = 703a8d013b25dc428d936f72858fa0c702c22cb3114a040fb9bb47562e4ea2ac | ||||||
|  |  | ||||||
| remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) | remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) | ||||||
| sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) | sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) | ||||||
|   | |||||||
| @@ -228,7 +228,7 @@ define Build/CoreTargets | |||||||
|  |  | ||||||
|   ifneq ($(CONFIG_AUTOREMOVE),) |   ifneq ($(CONFIG_AUTOREMOVE),) | ||||||
|     compile: |     compile: | ||||||
| 		-touch $(PKG_BUILD_DIR)/.autoremove 2>/dev/null >/dev/null | 		-touch -r $(PKG_BUILD_DIR)/.built $(PKG_BUILD_DIR)/.autoremove 2>/dev/null >/dev/null | ||||||
| 		$(FIND) $(PKG_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir' | \ | 		$(FIND) $(PKG_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir' | \ | ||||||
| 			$(XARGS) rm -rf | 			$(XARGS) rm -rf | ||||||
|   endif |   endif | ||||||
|   | |||||||
| @@ -138,9 +138,10 @@ $(eval $(call SetupHostCommand,bzip2,Please install 'bzip2', \ | |||||||
| $(eval $(call SetupHostCommand,wget,Please install GNU 'wget', \ | $(eval $(call SetupHostCommand,wget,Please install GNU 'wget', \ | ||||||
| 	wget --version | grep GNU)) | 	wget --version | grep GNU)) | ||||||
|  |  | ||||||
| $(eval $(call SetupHostCommand,gtime,Please install GNU 'time', \ | $(eval $(call SetupHostCommand,time,Please install GNU 'time' or BusyBox 'time', \ | ||||||
| 	gtime --version 2>&1 | grep GNU, \ | 	gtime --version 2>&1 | grep GNU, \ | ||||||
| 	time --version 2>&1 | grep GNU)) | 	time --version 2>&1 | grep GNU, \ | ||||||
|  | 	busybox time 2>&1 | grep BusyBox)) | ||||||
|  |  | ||||||
| $(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \ | $(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \ | ||||||
| 	perl --version | grep "perl.*v5")) | 	perl --version | grep "perl.*v5")) | ||||||
|   | |||||||
| @@ -43,7 +43,7 @@ log_make = \ | |||||||
| 	 $(if $(BUILD_LOG), \ | 	 $(if $(BUILD_LOG), \ | ||||||
| 		set -o pipefail; \ | 		set -o pipefail; \ | ||||||
| 		mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4));) \ | 		mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4));) \ | ||||||
| 	gtime -f "time: $(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2)\#%U\#%S\#%e" -- \ | 	env time -f "time: $(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2)\#%U\#%S\#%e" -- \ | ||||||
| 	$$(SUBMAKE) $(subdir_make_opts) $(if $(3),$(3)-)$(2) \ | 	$$(SUBMAKE) $(subdir_make_opts) $(if $(3),$(3)-)$(2) \ | ||||||
| 		$(if $(BUILD_LOG),SILENT= 2>&1 | tee $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2).txt) | 		$(if $(BUILD_LOG),SILENT= 2>&1 | tee $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2).txt) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -25,13 +25,13 @@ PKG_CONFIG_DEPENDS += \ | |||||||
| sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1)))) | sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1)))) | ||||||
|  |  | ||||||
| VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER)) | VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER)) | ||||||
| VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),SNAPSHOT) | VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),18.06.0-rc1) | ||||||
|  |  | ||||||
| VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE)) | VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE)) | ||||||
| VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION)) | VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r7090-d2aa3a1b62) | ||||||
|  |  | ||||||
| VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO)) | VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO)) | ||||||
| VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/snapshots) | VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.openwrt.org/releases/18.06.0-rc1) | ||||||
|  |  | ||||||
| VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST)) | VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST)) | ||||||
| VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt) | VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt) | ||||||
|   | |||||||
| @@ -39,7 +39,7 @@ endif | |||||||
| define Package/base-files | define Package/base-files | ||||||
|   SECTION:=base |   SECTION:=base | ||||||
|   CATEGORY:=Base system |   CATEGORY:=Base system | ||||||
|   DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:lede-keyring +NAND_SUPPORT:ubi-utils +fstools +fwtool |   DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:openwrt-keyring +NAND_SUPPORT:ubi-utils +fstools +fwtool | ||||||
|   TITLE:=Base filesystem for OpenWrt |   TITLE:=Base filesystem for OpenWrt | ||||||
|   URL:=http://openwrt.org/ |   URL:=http://openwrt.org/ | ||||||
|   VERSION:=$(PKG_RELEASE)-$(REVISION) |   VERSION:=$(PKG_RELEASE)-$(REVISION) | ||||||
|   | |||||||
| @@ -78,18 +78,18 @@ rootfs_type() { | |||||||
|  |  | ||||||
| get_image() { # <source> [ <command> ] | get_image() { # <source> [ <command> ] | ||||||
| 	local from="$1" | 	local from="$1" | ||||||
| 	local cat="$2" | 	local cmd="$2" | ||||||
|  |  | ||||||
| 	if [ -z "$cat" ]; then | 	if [ -z "$cmd" ]; then | ||||||
| 		local magic="$(dd if="$from" bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')" | 		local magic="$(dd if="$from" bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')" | ||||||
| 		case "$magic" in | 		case "$magic" in | ||||||
| 			1f8b) cat="zcat";; | 			1f8b) cmd="zcat";; | ||||||
| 			425a) cat="bzcat";; | 			425a) cmd="bzcat";; | ||||||
| 			*) cat="cat";; | 			*) cmd="cat";; | ||||||
| 		esac | 		esac | ||||||
| 	fi | 	fi | ||||||
|  |  | ||||||
| 	$cat "$from" 2>/dev/null | 	cat "$from" 2>/dev/null | $cmd | ||||||
| } | } | ||||||
|  |  | ||||||
| get_magic_word() { | get_magic_word() { | ||||||
|   | |||||||
| @@ -183,7 +183,7 @@ if VERSIONOPT | |||||||
| 	config VERSION_REPO | 	config VERSION_REPO | ||||||
| 		string | 		string | ||||||
| 		prompt "Release repository" | 		prompt "Release repository" | ||||||
| 		default "http://downloads.lede-project.org/snapshots" | 		default "http://downloads.openwrt.org/releases/18.06.0-rc1" | ||||||
| 		help | 		help | ||||||
| 			This is the repository address embedded in the image, it defaults | 			This is the repository address embedded in the image, it defaults | ||||||
| 			to the trunk snapshot repo; the url may contain the following placeholders: | 			to the trunk snapshot repo; the url may contain the following placeholders: | ||||||
| @@ -253,7 +253,7 @@ if VERSIONOPT | |||||||
| 	config VERSION_CODE_FILENAMES | 	config VERSION_CODE_FILENAMES | ||||||
| 		bool | 		bool | ||||||
| 		prompt "Revision code in filenames" | 		prompt "Revision code in filenames" | ||||||
| 		default y | 		default n | ||||||
| 		help | 		help | ||||||
| 			Enable this to include the revision identifier or the configured | 			Enable this to include the revision identifier or the configured | ||||||
| 			version code into the firmware image, SDK- and Image Builder archive | 			version code into the firmware image, SDK- and Image Builder archive | ||||||
|   | |||||||
| @@ -38,6 +38,7 @@ gl-ar750|\ | |||||||
| hornet-ub|\ | hornet-ub|\ | ||||||
| hornet-ub-x2|\ | hornet-ub-x2|\ | ||||||
| jwap230|\ | jwap230|\ | ||||||
|  | koala|\ | ||||||
| mr1750|\ | mr1750|\ | ||||||
| mr1750v2|\ | mr1750v2|\ | ||||||
| mr600|\ | mr600|\ | ||||||
|   | |||||||
| @@ -15,6 +15,7 @@ PKG_HASH:=7e7477534409d5368eb1371ffde6820f0f79780a1a1f676161c48442cb303dfd | |||||||
|  |  | ||||||
| include $(INCLUDE_DIR)/u-boot.mk | include $(INCLUDE_DIR)/u-boot.mk | ||||||
| include $(INCLUDE_DIR)/package.mk | include $(INCLUDE_DIR)/package.mk | ||||||
|  | include $(INCLUDE_DIR)/host-build.mk | ||||||
|  |  | ||||||
| define U-Boot/Default | define U-Boot/Default | ||||||
|   BUILD_TARGET:=mvebu |   BUILD_TARGET:=mvebu | ||||||
| @@ -31,6 +32,8 @@ endef | |||||||
| UBOOT_TARGETS:= \ | UBOOT_TARGETS:= \ | ||||||
| 	clearfog | 	clearfog | ||||||
|  |  | ||||||
|  | Build/Exports:=$(Host/Exports) | ||||||
|  |  | ||||||
| define Build/Configure | define Build/Configure | ||||||
| 	# enable additional options beyond clearfog_defconfig | 	# enable additional options beyond clearfog_defconfig | ||||||
| 	echo CONFIG_NET_RANDOM_ETHADDR=y >> $(PKG_BUILD_DIR)/configs/$(BUILD_VARIANT)_defconfig | 	echo CONFIG_NET_RANDOM_ETHADDR=y >> $(PKG_BUILD_DIR)/configs/$(BUILD_VARIANT)_defconfig | ||||||
|   | |||||||
| @@ -15,6 +15,7 @@ PKG_HASH:=6a018fd3caf58f3dcfa23ee989a82bd35df03af71872b9dca8c6d758a0d26c05 | |||||||
|  |  | ||||||
| include $(INCLUDE_DIR)/u-boot.mk | include $(INCLUDE_DIR)/u-boot.mk | ||||||
| include $(INCLUDE_DIR)/package.mk | include $(INCLUDE_DIR)/package.mk | ||||||
|  | include $(INCLUDE_DIR)/host-build.mk | ||||||
|  |  | ||||||
| define U-Boot/Default | define U-Boot/Default | ||||||
|   BUILD_TARGET:=mxs |   BUILD_TARGET:=mxs | ||||||
| @@ -37,6 +38,8 @@ UBOOT_TARGETS := \ | |||||||
|  |  | ||||||
| UBOOT_MAKE_FLAGS += $(UBOOT_IMAGE) | UBOOT_MAKE_FLAGS += $(UBOOT_IMAGE) | ||||||
|  |  | ||||||
|  | Build/Exports:=$(Host/Exports) | ||||||
|  |  | ||||||
| define Build/InstallDev | define Build/InstallDev | ||||||
| 	$(INSTALL_DIR) $(STAGING_DIR_IMAGE) | 	$(INSTALL_DIR) $(STAGING_DIR_IMAGE) | ||||||
| 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(UBOOT_IMAGE) | 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(UBOOT_IMAGE) | ||||||
|   | |||||||
							
								
								
									
										306
									
								
								package/boot/uboot-oxnas/patches/410-gcc-6-compiler.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										306
									
								
								package/boot/uboot-oxnas/patches/410-gcc-6-compiler.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,306 @@ | |||||||
|  | From: Hans de Goede <hdegoede@redhat.com> | ||||||
|  | Date: Sat, 7 Feb 2015 21:52:40 +0000 (+0100) | ||||||
|  | Subject: Add linux/compiler-gcc6.h to fix builds with gcc6 | ||||||
|  | X-Git-Tag: v2015.04-rc2~31 | ||||||
|  | X-Git-Url: http://git.denx.de/?p=u-boot.git;a=commitdiff_plain;h=478b02f1a7043b673565075ea5016376f3293b23 | ||||||
|  |  | ||||||
|  | Add linux/compiler-gcc6.h to fix builds with gcc6 | ||||||
|  |  | ||||||
|  | Add linux/compiler-gcc6/h from the kernel sources at: | ||||||
|  |  | ||||||
|  | commit 5631b8fba640a4ab2f8a954f63a603fa34eda96b | ||||||
|  | Author: Steven Noonan <steven@uplinklabs.net> | ||||||
|  | Date:   Sat Oct 25 15:09:42 2014 -0700 | ||||||
|  |  | ||||||
|  |     compiler/gcc4+: Remove inaccurate comment about 'asm goto' miscompiles | ||||||
|  |  | ||||||
|  | Signed-off-by: Hans de Goede <hdegoede@redhat.com> | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | --- /dev/null | ||||||
|  | +++ b/include/linux/compiler-gcc6.h | ||||||
|  | @@ -0,0 +1,284 @@ | ||||||
|  | +#ifndef __LINUX_COMPILER_H | ||||||
|  | +#error "Please don't include <linux/compiler-gcc.h> directly, include <linux/compiler.h> instead." | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +/* | ||||||
|  | + * Common definitions for all gcc versions go here. | ||||||
|  | + */ | ||||||
|  | +#define GCC_VERSION (__GNUC__ * 10000		\ | ||||||
|  | +		     + __GNUC_MINOR__ * 100	\ | ||||||
|  | +		     + __GNUC_PATCHLEVEL__) | ||||||
|  | + | ||||||
|  | +/* Optimization barrier */ | ||||||
|  | + | ||||||
|  | +/* The "volatile" is due to gcc bugs */ | ||||||
|  | +#define barrier() __asm__ __volatile__("": : :"memory") | ||||||
|  | +/* | ||||||
|  | + * This version is i.e. to prevent dead stores elimination on @ptr | ||||||
|  | + * where gcc and llvm may behave differently when otherwise using | ||||||
|  | + * normal barrier(): while gcc behavior gets along with a normal | ||||||
|  | + * barrier(), llvm needs an explicit input variable to be assumed | ||||||
|  | + * clobbered. The issue is as follows: while the inline asm might | ||||||
|  | + * access any memory it wants, the compiler could have fit all of | ||||||
|  | + * @ptr into memory registers instead, and since @ptr never escaped | ||||||
|  | + * from that, it proofed that the inline asm wasn't touching any of | ||||||
|  | + * it. This version works well with both compilers, i.e. we're telling | ||||||
|  | + * the compiler that the inline asm absolutely may see the contents | ||||||
|  | + * of @ptr. See also: https://llvm.org/bugs/show_bug.cgi?id=15495 | ||||||
|  | + */ | ||||||
|  | +#define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory") | ||||||
|  | + | ||||||
|  | +/* | ||||||
|  | + * This macro obfuscates arithmetic on a variable address so that gcc | ||||||
|  | + * shouldn't recognize the original var, and make assumptions about it. | ||||||
|  | + * | ||||||
|  | + * This is needed because the C standard makes it undefined to do | ||||||
|  | + * pointer arithmetic on "objects" outside their boundaries and the | ||||||
|  | + * gcc optimizers assume this is the case. In particular they | ||||||
|  | + * assume such arithmetic does not wrap. | ||||||
|  | + * | ||||||
|  | + * A miscompilation has been observed because of this on PPC. | ||||||
|  | + * To work around it we hide the relationship of the pointer and the object | ||||||
|  | + * using this macro. | ||||||
|  | + * | ||||||
|  | + * Versions of the ppc64 compiler before 4.1 had a bug where use of | ||||||
|  | + * RELOC_HIDE could trash r30. The bug can be worked around by changing | ||||||
|  | + * the inline assembly constraint from =g to =r, in this particular | ||||||
|  | + * case either is valid. | ||||||
|  | + */ | ||||||
|  | +#define RELOC_HIDE(ptr, off)						\ | ||||||
|  | +({									\ | ||||||
|  | +	unsigned long __ptr;						\ | ||||||
|  | +	__asm__ ("" : "=r"(__ptr) : "0"(ptr));				\ | ||||||
|  | +	(typeof(ptr)) (__ptr + (off));					\ | ||||||
|  | +}) | ||||||
|  | + | ||||||
|  | +/* Make the optimizer believe the variable can be manipulated arbitrarily. */ | ||||||
|  | +#define OPTIMIZER_HIDE_VAR(var)						\ | ||||||
|  | +	__asm__ ("" : "=r" (var) : "0" (var)) | ||||||
|  | + | ||||||
|  | +#ifdef __CHECKER__ | ||||||
|  | +#define __must_be_array(a)	0 | ||||||
|  | +#else | ||||||
|  | +/* &a[0] degrades to a pointer: a different type from an array */ | ||||||
|  | +#define __must_be_array(a)	BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +/* | ||||||
|  | + * Force always-inline if the user requests it so via the .config, | ||||||
|  | + * or if gcc is too old: | ||||||
|  | + */ | ||||||
|  | +#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) ||		\ | ||||||
|  | +    !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) | ||||||
|  | +#define inline		inline		__attribute__((always_inline)) notrace | ||||||
|  | +#define __inline__	__inline__	__attribute__((always_inline)) notrace | ||||||
|  | +#define __inline	__inline	__attribute__((always_inline)) notrace | ||||||
|  | +#else | ||||||
|  | +/* A lot of inline functions can cause havoc with function tracing */ | ||||||
|  | +#define inline		inline		notrace | ||||||
|  | +#define __inline__	__inline__	notrace | ||||||
|  | +#define __inline	__inline	notrace | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +#define __always_inline	inline __attribute__((always_inline)) | ||||||
|  | +#define  noinline	__attribute__((noinline)) | ||||||
|  | + | ||||||
|  | +#define __deprecated	__attribute__((deprecated)) | ||||||
|  | +#define __packed	__attribute__((packed)) | ||||||
|  | +#define __weak		__attribute__((weak)) | ||||||
|  | +#define __alias(symbol)	__attribute__((alias(#symbol))) | ||||||
|  | + | ||||||
|  | +/* | ||||||
|  | + * it doesn't make sense on ARM (currently the only user of __naked) | ||||||
|  | + * to trace naked functions because then mcount is called without | ||||||
|  | + * stack and frame pointer being set up and there is no chance to | ||||||
|  | + * restore the lr register to the value before mcount was called. | ||||||
|  | + * | ||||||
|  | + * The asm() bodies of naked functions often depend on standard calling | ||||||
|  | + * conventions, therefore they must be noinline and noclone. | ||||||
|  | + * | ||||||
|  | + * GCC 4.[56] currently fail to enforce this, so we must do so ourselves. | ||||||
|  | + * See GCC PR44290. | ||||||
|  | + */ | ||||||
|  | +#define __naked		__attribute__((naked)) noinline __noclone notrace | ||||||
|  | + | ||||||
|  | +#define __noreturn	__attribute__((noreturn)) | ||||||
|  | + | ||||||
|  | +/* | ||||||
|  | + * From the GCC manual: | ||||||
|  | + * | ||||||
|  | + * Many functions have no effects except the return value and their | ||||||
|  | + * return value depends only on the parameters and/or global | ||||||
|  | + * variables.  Such a function can be subject to common subexpression | ||||||
|  | + * elimination and loop optimization just as an arithmetic operator | ||||||
|  | + * would be. | ||||||
|  | + * [...] | ||||||
|  | + */ | ||||||
|  | +#define __pure			__attribute__((pure)) | ||||||
|  | +#define __aligned(x)		__attribute__((aligned(x))) | ||||||
|  | +#define __printf(a, b)		__attribute__((format(printf, a, b))) | ||||||
|  | +#define __scanf(a, b)		__attribute__((format(scanf, a, b))) | ||||||
|  | +#define __attribute_const__	__attribute__((__const__)) | ||||||
|  | +#define __maybe_unused		__attribute__((unused)) | ||||||
|  | +#define __always_unused		__attribute__((unused)) | ||||||
|  | + | ||||||
|  | +/* gcc version specific checks */ | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION < 30200 | ||||||
|  | +# error Sorry, your compiler is too old - please upgrade it. | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION < 30300 | ||||||
|  | +# define __used			__attribute__((__unused__)) | ||||||
|  | +#else | ||||||
|  | +# define __used			__attribute__((__used__)) | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +#ifdef CONFIG_GCOV_KERNEL | ||||||
|  | +# if GCC_VERSION < 30400 | ||||||
|  | +#   error "GCOV profiling support for gcc versions below 3.4 not included" | ||||||
|  | +# endif /* __GNUC_MINOR__ */ | ||||||
|  | +#endif /* CONFIG_GCOV_KERNEL */ | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION >= 30400 | ||||||
|  | +#define __must_check		__attribute__((warn_unused_result)) | ||||||
|  | +#define __malloc		__attribute__((__malloc__)) | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION >= 40000 | ||||||
|  | + | ||||||
|  | +/* GCC 4.1.[01] miscompiles __weak */ | ||||||
|  | +#ifdef __KERNEL__ | ||||||
|  | +# if GCC_VERSION >= 40100 &&  GCC_VERSION <= 40101 | ||||||
|  | +#  error Your version of gcc miscompiles the __weak directive | ||||||
|  | +# endif | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +#define __used			__attribute__((__used__)) | ||||||
|  | +#define __compiler_offsetof(a, b)					\ | ||||||
|  | +	__builtin_offsetof(a, b) | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION >= 40100 && GCC_VERSION < 40600 | ||||||
|  | +# define __compiletime_object_size(obj) __builtin_object_size(obj, 0) | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION >= 40300 | ||||||
|  | +/* Mark functions as cold. gcc will assume any path leading to a call | ||||||
|  | + * to them will be unlikely.  This means a lot of manual unlikely()s | ||||||
|  | + * are unnecessary now for any paths leading to the usual suspects | ||||||
|  | + * like BUG(), printk(), panic() etc. [but let's keep them for now for | ||||||
|  | + * older compilers] | ||||||
|  | + * | ||||||
|  | + * Early snapshots of gcc 4.3 don't support this and we can't detect this | ||||||
|  | + * in the preprocessor, but we can live with this because they're unreleased. | ||||||
|  | + * Maketime probing would be overkill here. | ||||||
|  | + * | ||||||
|  | + * gcc also has a __attribute__((__hot__)) to move hot functions into | ||||||
|  | + * a special section, but I don't see any sense in this right now in | ||||||
|  | + * the kernel context | ||||||
|  | + */ | ||||||
|  | +#define __cold			__attribute__((__cold__)) | ||||||
|  | + | ||||||
|  | +#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) | ||||||
|  | + | ||||||
|  | +#ifndef __CHECKER__ | ||||||
|  | +# define __compiletime_warning(message) __attribute__((warning(message))) | ||||||
|  | +# define __compiletime_error(message) __attribute__((error(message))) | ||||||
|  | +#endif /* __CHECKER__ */ | ||||||
|  | +#endif /* GCC_VERSION >= 40300 */ | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION >= 40500 | ||||||
|  | +/* | ||||||
|  | + * Mark a position in code as unreachable.  This can be used to | ||||||
|  | + * suppress control flow warnings after asm blocks that transfer | ||||||
|  | + * control elsewhere. | ||||||
|  | + * | ||||||
|  | + * Early snapshots of gcc 4.5 don't support this and we can't detect | ||||||
|  | + * this in the preprocessor, but we can live with this because they're | ||||||
|  | + * unreleased.  Really, we need to have autoconf for the kernel. | ||||||
|  | + */ | ||||||
|  | +#define unreachable() __builtin_unreachable() | ||||||
|  | + | ||||||
|  | +/* Mark a function definition as prohibited from being cloned. */ | ||||||
|  | +#define __noclone	__attribute__((__noclone__, __optimize__("no-tracer"))) | ||||||
|  | + | ||||||
|  | +#endif /* GCC_VERSION >= 40500 */ | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION >= 40600 | ||||||
|  | +/* | ||||||
|  | + * When used with Link Time Optimization, gcc can optimize away C functions or | ||||||
|  | + * variables which are referenced only from assembly code.  __visible tells the | ||||||
|  | + * optimizer that something else uses this function or variable, thus preventing | ||||||
|  | + * this. | ||||||
|  | + */ | ||||||
|  | +#define __visible	__attribute__((externally_visible)) | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION >= 40900 && !defined(__CHECKER__) | ||||||
|  | +/* | ||||||
|  | + * __assume_aligned(n, k): Tell the optimizer that the returned | ||||||
|  | + * pointer can be assumed to be k modulo n. The second argument is | ||||||
|  | + * optional (default 0), so we use a variadic macro to make the | ||||||
|  | + * shorthand. | ||||||
|  | + * | ||||||
|  | + * Beware: Do not apply this to functions which may return | ||||||
|  | + * ERR_PTRs. Also, it is probably unwise to apply it to functions | ||||||
|  | + * returning extra information in the low bits (but in that case the | ||||||
|  | + * compiler should see some alignment anyway, when the return value is | ||||||
|  | + * massaged by 'flags = ptr & 3; ptr &= ~3;'). | ||||||
|  | + */ | ||||||
|  | +#define __assume_aligned(a, ...) __attribute__((__assume_aligned__(a, ## __VA_ARGS__))) | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +/* | ||||||
|  | + * GCC 'asm goto' miscompiles certain code sequences: | ||||||
|  | + * | ||||||
|  | + *   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 | ||||||
|  | + * | ||||||
|  | + * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. | ||||||
|  | + * | ||||||
|  | + * (asm goto is automatically volatile - the naming reflects this.) | ||||||
|  | + */ | ||||||
|  | +#define asm_volatile_goto(x...)	do { asm goto(x); asm (""); } while (0) | ||||||
|  | + | ||||||
|  | +#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP | ||||||
|  | +#if GCC_VERSION >= 40400 | ||||||
|  | +#define __HAVE_BUILTIN_BSWAP32__ | ||||||
|  | +#define __HAVE_BUILTIN_BSWAP64__ | ||||||
|  | +#endif | ||||||
|  | +#if GCC_VERSION >= 40800 | ||||||
|  | +#define __HAVE_BUILTIN_BSWAP16__ | ||||||
|  | +#endif | ||||||
|  | +#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION >= 50000 | ||||||
|  | +#define KASAN_ABI_VERSION 4 | ||||||
|  | +#elif GCC_VERSION >= 40902 | ||||||
|  | +#define KASAN_ABI_VERSION 3 | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION >= 40902 | ||||||
|  | +/* | ||||||
|  | + * Tell the compiler that address safety instrumentation (KASAN) | ||||||
|  | + * should not be applied to that function. | ||||||
|  | + * Conflicts with inlining: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 | ||||||
|  | + */ | ||||||
|  | +#define __no_sanitize_address __attribute__((no_sanitize_address)) | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +#endif	/* gcc version >= 40000 specific checks */ | ||||||
|  | + | ||||||
|  | +#if !defined(__noclone) | ||||||
|  | +#define __noclone	/* not needed */ | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +#if !defined(__no_sanitize_address) | ||||||
|  | +#define __no_sanitize_address | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +/* | ||||||
|  | + * A trick to suppress uninitialized variable warning without generating any | ||||||
|  | + * code | ||||||
|  | + */ | ||||||
|  | +#define uninitialized_var(x) x = x | ||||||
							
								
								
									
										287
									
								
								package/boot/uboot-oxnas/patches/420-gcc-7-compiler.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										287
									
								
								package/boot/uboot-oxnas/patches/420-gcc-7-compiler.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,287 @@ | |||||||
|  | --- /dev/null | ||||||
|  | +++ b/include/linux/compiler-gcc7.h | ||||||
|  | @@ -0,0 +1,284 @@ | ||||||
|  | +#ifndef __LINUX_COMPILER_H | ||||||
|  | +#error "Please don't include <linux/compiler-gcc.h> directly, include <linux/compiler.h> instead." | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +/* | ||||||
|  | + * Common definitions for all gcc versions go here. | ||||||
|  | + */ | ||||||
|  | +#define GCC_VERSION (__GNUC__ * 10000		\ | ||||||
|  | +		     + __GNUC_MINOR__ * 100	\ | ||||||
|  | +		     + __GNUC_PATCHLEVEL__) | ||||||
|  | + | ||||||
|  | +/* Optimization barrier */ | ||||||
|  | + | ||||||
|  | +/* The "volatile" is due to gcc bugs */ | ||||||
|  | +#define barrier() __asm__ __volatile__("": : :"memory") | ||||||
|  | +/* | ||||||
|  | + * This version is i.e. to prevent dead stores elimination on @ptr | ||||||
|  | + * where gcc and llvm may behave differently when otherwise using | ||||||
|  | + * normal barrier(): while gcc behavior gets along with a normal | ||||||
|  | + * barrier(), llvm needs an explicit input variable to be assumed | ||||||
|  | + * clobbered. The issue is as follows: while the inline asm might | ||||||
|  | + * access any memory it wants, the compiler could have fit all of | ||||||
|  | + * @ptr into memory registers instead, and since @ptr never escaped | ||||||
|  | + * from that, it proofed that the inline asm wasn't touching any of | ||||||
|  | + * it. This version works well with both compilers, i.e. we're telling | ||||||
|  | + * the compiler that the inline asm absolutely may see the contents | ||||||
|  | + * of @ptr. See also: https://llvm.org/bugs/show_bug.cgi?id=15495 | ||||||
|  | + */ | ||||||
|  | +#define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory") | ||||||
|  | + | ||||||
|  | +/* | ||||||
|  | + * This macro obfuscates arithmetic on a variable address so that gcc | ||||||
|  | + * shouldn't recognize the original var, and make assumptions about it. | ||||||
|  | + * | ||||||
|  | + * This is needed because the C standard makes it undefined to do | ||||||
|  | + * pointer arithmetic on "objects" outside their boundaries and the | ||||||
|  | + * gcc optimizers assume this is the case. In particular they | ||||||
|  | + * assume such arithmetic does not wrap. | ||||||
|  | + * | ||||||
|  | + * A miscompilation has been observed because of this on PPC. | ||||||
|  | + * To work around it we hide the relationship of the pointer and the object | ||||||
|  | + * using this macro. | ||||||
|  | + * | ||||||
|  | + * Versions of the ppc64 compiler before 4.1 had a bug where use of | ||||||
|  | + * RELOC_HIDE could trash r30. The bug can be worked around by changing | ||||||
|  | + * the inline assembly constraint from =g to =r, in this particular | ||||||
|  | + * case either is valid. | ||||||
|  | + */ | ||||||
|  | +#define RELOC_HIDE(ptr, off)						\ | ||||||
|  | +({									\ | ||||||
|  | +	unsigned long __ptr;						\ | ||||||
|  | +	__asm__ ("" : "=r"(__ptr) : "0"(ptr));				\ | ||||||
|  | +	(typeof(ptr)) (__ptr + (off));					\ | ||||||
|  | +}) | ||||||
|  | + | ||||||
|  | +/* Make the optimizer believe the variable can be manipulated arbitrarily. */ | ||||||
|  | +#define OPTIMIZER_HIDE_VAR(var)						\ | ||||||
|  | +	__asm__ ("" : "=r" (var) : "0" (var)) | ||||||
|  | + | ||||||
|  | +#ifdef __CHECKER__ | ||||||
|  | +#define __must_be_array(a)	0 | ||||||
|  | +#else | ||||||
|  | +/* &a[0] degrades to a pointer: a different type from an array */ | ||||||
|  | +#define __must_be_array(a)	BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +/* | ||||||
|  | + * Force always-inline if the user requests it so via the .config, | ||||||
|  | + * or if gcc is too old: | ||||||
|  | + */ | ||||||
|  | +#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) ||		\ | ||||||
|  | +    !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) | ||||||
|  | +#define inline		inline		__attribute__((always_inline)) notrace | ||||||
|  | +#define __inline__	__inline__	__attribute__((always_inline)) notrace | ||||||
|  | +#define __inline	__inline	__attribute__((always_inline)) notrace | ||||||
|  | +#else | ||||||
|  | +/* A lot of inline functions can cause havoc with function tracing */ | ||||||
|  | +#define inline		inline		notrace | ||||||
|  | +#define __inline__	__inline__	notrace | ||||||
|  | +#define __inline	__inline	notrace | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +#define __always_inline	inline __attribute__((always_inline)) | ||||||
|  | +#define  noinline	__attribute__((noinline)) | ||||||
|  | + | ||||||
|  | +#define __deprecated	__attribute__((deprecated)) | ||||||
|  | +#define __packed	__attribute__((packed)) | ||||||
|  | +#define __weak		__attribute__((weak)) | ||||||
|  | +#define __alias(symbol)	__attribute__((alias(#symbol))) | ||||||
|  | + | ||||||
|  | +/* | ||||||
|  | + * it doesn't make sense on ARM (currently the only user of __naked) | ||||||
|  | + * to trace naked functions because then mcount is called without | ||||||
|  | + * stack and frame pointer being set up and there is no chance to | ||||||
|  | + * restore the lr register to the value before mcount was called. | ||||||
|  | + * | ||||||
|  | + * The asm() bodies of naked functions often depend on standard calling | ||||||
|  | + * conventions, therefore they must be noinline and noclone. | ||||||
|  | + * | ||||||
|  | + * GCC 4.[56] currently fail to enforce this, so we must do so ourselves. | ||||||
|  | + * See GCC PR44290. | ||||||
|  | + */ | ||||||
|  | +#define __naked		__attribute__((naked)) noinline __noclone notrace | ||||||
|  | + | ||||||
|  | +#define __noreturn	__attribute__((noreturn)) | ||||||
|  | + | ||||||
|  | +/* | ||||||
|  | + * From the GCC manual: | ||||||
|  | + * | ||||||
|  | + * Many functions have no effects except the return value and their | ||||||
|  | + * return value depends only on the parameters and/or global | ||||||
|  | + * variables.  Such a function can be subject to common subexpression | ||||||
|  | + * elimination and loop optimization just as an arithmetic operator | ||||||
|  | + * would be. | ||||||
|  | + * [...] | ||||||
|  | + */ | ||||||
|  | +#define __pure			__attribute__((pure)) | ||||||
|  | +#define __aligned(x)		__attribute__((aligned(x))) | ||||||
|  | +#define __printf(a, b)		__attribute__((format(printf, a, b))) | ||||||
|  | +#define __scanf(a, b)		__attribute__((format(scanf, a, b))) | ||||||
|  | +#define __attribute_const__	__attribute__((__const__)) | ||||||
|  | +#define __maybe_unused		__attribute__((unused)) | ||||||
|  | +#define __always_unused		__attribute__((unused)) | ||||||
|  | + | ||||||
|  | +/* gcc version specific checks */ | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION < 30200 | ||||||
|  | +# error Sorry, your compiler is too old - please upgrade it. | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION < 30300 | ||||||
|  | +# define __used			__attribute__((__unused__)) | ||||||
|  | +#else | ||||||
|  | +# define __used			__attribute__((__used__)) | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +#ifdef CONFIG_GCOV_KERNEL | ||||||
|  | +# if GCC_VERSION < 30400 | ||||||
|  | +#   error "GCOV profiling support for gcc versions below 3.4 not included" | ||||||
|  | +# endif /* __GNUC_MINOR__ */ | ||||||
|  | +#endif /* CONFIG_GCOV_KERNEL */ | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION >= 30400 | ||||||
|  | +#define __must_check		__attribute__((warn_unused_result)) | ||||||
|  | +#define __malloc		__attribute__((__malloc__)) | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION >= 40000 | ||||||
|  | + | ||||||
|  | +/* GCC 4.1.[01] miscompiles __weak */ | ||||||
|  | +#ifdef __KERNEL__ | ||||||
|  | +# if GCC_VERSION >= 40100 &&  GCC_VERSION <= 40101 | ||||||
|  | +#  error Your version of gcc miscompiles the __weak directive | ||||||
|  | +# endif | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +#define __used			__attribute__((__used__)) | ||||||
|  | +#define __compiler_offsetof(a, b)					\ | ||||||
|  | +	__builtin_offsetof(a, b) | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION >= 40100 && GCC_VERSION < 40600 | ||||||
|  | +# define __compiletime_object_size(obj) __builtin_object_size(obj, 0) | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION >= 40300 | ||||||
|  | +/* Mark functions as cold. gcc will assume any path leading to a call | ||||||
|  | + * to them will be unlikely.  This means a lot of manual unlikely()s | ||||||
|  | + * are unnecessary now for any paths leading to the usual suspects | ||||||
|  | + * like BUG(), printk(), panic() etc. [but let's keep them for now for | ||||||
|  | + * older compilers] | ||||||
|  | + * | ||||||
|  | + * Early snapshots of gcc 4.3 don't support this and we can't detect this | ||||||
|  | + * in the preprocessor, but we can live with this because they're unreleased. | ||||||
|  | + * Maketime probing would be overkill here. | ||||||
|  | + * | ||||||
|  | + * gcc also has a __attribute__((__hot__)) to move hot functions into | ||||||
|  | + * a special section, but I don't see any sense in this right now in | ||||||
|  | + * the kernel context | ||||||
|  | + */ | ||||||
|  | +#define __cold			__attribute__((__cold__)) | ||||||
|  | + | ||||||
|  | +#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) | ||||||
|  | + | ||||||
|  | +#ifndef __CHECKER__ | ||||||
|  | +# define __compiletime_warning(message) __attribute__((warning(message))) | ||||||
|  | +# define __compiletime_error(message) __attribute__((error(message))) | ||||||
|  | +#endif /* __CHECKER__ */ | ||||||
|  | +#endif /* GCC_VERSION >= 40300 */ | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION >= 40500 | ||||||
|  | +/* | ||||||
|  | + * Mark a position in code as unreachable.  This can be used to | ||||||
|  | + * suppress control flow warnings after asm blocks that transfer | ||||||
|  | + * control elsewhere. | ||||||
|  | + * | ||||||
|  | + * Early snapshots of gcc 4.5 don't support this and we can't detect | ||||||
|  | + * this in the preprocessor, but we can live with this because they're | ||||||
|  | + * unreleased.  Really, we need to have autoconf for the kernel. | ||||||
|  | + */ | ||||||
|  | +#define unreachable() __builtin_unreachable() | ||||||
|  | + | ||||||
|  | +/* Mark a function definition as prohibited from being cloned. */ | ||||||
|  | +#define __noclone	__attribute__((__noclone__, __optimize__("no-tracer"))) | ||||||
|  | + | ||||||
|  | +#endif /* GCC_VERSION >= 40500 */ | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION >= 40600 | ||||||
|  | +/* | ||||||
|  | + * When used with Link Time Optimization, gcc can optimize away C functions or | ||||||
|  | + * variables which are referenced only from assembly code.  __visible tells the | ||||||
|  | + * optimizer that something else uses this function or variable, thus preventing | ||||||
|  | + * this. | ||||||
|  | + */ | ||||||
|  | +#define __visible	__attribute__((externally_visible)) | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION >= 40900 && !defined(__CHECKER__) | ||||||
|  | +/* | ||||||
|  | + * __assume_aligned(n, k): Tell the optimizer that the returned | ||||||
|  | + * pointer can be assumed to be k modulo n. The second argument is | ||||||
|  | + * optional (default 0), so we use a variadic macro to make the | ||||||
|  | + * shorthand. | ||||||
|  | + * | ||||||
|  | + * Beware: Do not apply this to functions which may return | ||||||
|  | + * ERR_PTRs. Also, it is probably unwise to apply it to functions | ||||||
|  | + * returning extra information in the low bits (but in that case the | ||||||
|  | + * compiler should see some alignment anyway, when the return value is | ||||||
|  | + * massaged by 'flags = ptr & 3; ptr &= ~3;'). | ||||||
|  | + */ | ||||||
|  | +#define __assume_aligned(a, ...) __attribute__((__assume_aligned__(a, ## __VA_ARGS__))) | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +/* | ||||||
|  | + * GCC 'asm goto' miscompiles certain code sequences: | ||||||
|  | + * | ||||||
|  | + *   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 | ||||||
|  | + * | ||||||
|  | + * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. | ||||||
|  | + * | ||||||
|  | + * (asm goto is automatically volatile - the naming reflects this.) | ||||||
|  | + */ | ||||||
|  | +#define asm_volatile_goto(x...)	do { asm goto(x); asm (""); } while (0) | ||||||
|  | + | ||||||
|  | +#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP | ||||||
|  | +#if GCC_VERSION >= 40400 | ||||||
|  | +#define __HAVE_BUILTIN_BSWAP32__ | ||||||
|  | +#define __HAVE_BUILTIN_BSWAP64__ | ||||||
|  | +#endif | ||||||
|  | +#if GCC_VERSION >= 40800 | ||||||
|  | +#define __HAVE_BUILTIN_BSWAP16__ | ||||||
|  | +#endif | ||||||
|  | +#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION >= 50000 | ||||||
|  | +#define KASAN_ABI_VERSION 4 | ||||||
|  | +#elif GCC_VERSION >= 40902 | ||||||
|  | +#define KASAN_ABI_VERSION 3 | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +#if GCC_VERSION >= 40902 | ||||||
|  | +/* | ||||||
|  | + * Tell the compiler that address safety instrumentation (KASAN) | ||||||
|  | + * should not be applied to that function. | ||||||
|  | + * Conflicts with inlining: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 | ||||||
|  | + */ | ||||||
|  | +#define __no_sanitize_address __attribute__((no_sanitize_address)) | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +#endif	/* gcc version >= 40000 specific checks */ | ||||||
|  | + | ||||||
|  | +#if !defined(__noclone) | ||||||
|  | +#define __noclone	/* not needed */ | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +#if !defined(__no_sanitize_address) | ||||||
|  | +#define __no_sanitize_address | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  | +/* | ||||||
|  | + * A trick to suppress uninitialized variable warning without generating any | ||||||
|  | + * code | ||||||
|  | + */ | ||||||
|  | +#define uninitialized_var(x) x = x | ||||||
| @@ -350,6 +350,7 @@ | |||||||
| #define CONFIG_CMD_GETTIME | #define CONFIG_CMD_GETTIME | ||||||
| #define CONFIG_CMD_BOOTMENU | #define CONFIG_CMD_BOOTMENU | ||||||
| #define CONFIG_CMD_ELF | #define CONFIG_CMD_ELF | ||||||
|  | #define CONFIG_CMD_BOOTZ | ||||||
|  |  | ||||||
| #define CONFIG_DOS_PARTITION | #define CONFIG_DOS_PARTITION | ||||||
| #define CONFIG_EFI_PARTITION | #define CONFIG_EFI_PARTITION | ||||||
|   | |||||||
| @@ -14,6 +14,7 @@ PKG_HASH:=e49337262ecac44dbdeac140f2c6ebd1eba345e0162b0464172e7f05583ed7bb | |||||||
| include $(INCLUDE_DIR)/kernel.mk | include $(INCLUDE_DIR)/kernel.mk | ||||||
| include $(INCLUDE_DIR)/u-boot.mk | include $(INCLUDE_DIR)/u-boot.mk | ||||||
| include $(INCLUDE_DIR)/package.mk | include $(INCLUDE_DIR)/package.mk | ||||||
|  | include $(INCLUDE_DIR)/host-build.mk | ||||||
|  |  | ||||||
| define U-Boot/Default | define U-Boot/Default | ||||||
|   BUILD_TARGET:=zynq |   BUILD_TARGET:=zynq | ||||||
| @@ -42,4 +43,6 @@ UBOOT_TARGETS := \ | |||||||
| 	zed \ | 	zed \ | ||||||
| 	zybo | 	zybo | ||||||
|  |  | ||||||
|  | Build/Exports:=$(Host/Exports) | ||||||
|  |  | ||||||
| $(eval $(call BuildPackage/U-Boot)) | $(eval $(call BuildPackage/U-Boot)) | ||||||
|   | |||||||
| @@ -14,7 +14,7 @@ define Build/Compile | |||||||
| endef | endef | ||||||
|  |  | ||||||
| #ALLWIFIBOARDS:=<devicename> | #ALLWIFIBOARDS:=<devicename> | ||||||
| ALLWIFIBOARDS:= | ALLWIFIBOARDS:=zyxel_wre6606 | ||||||
| ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD)) | ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD)) | ||||||
|  |  | ||||||
| define Package/ipq-wifi-default | define Package/ipq-wifi-default | ||||||
| @@ -48,6 +48,7 @@ Don't install it for any other device! | |||||||
|   PREV_BOARD+=ipq-wifi-$(1) |   PREV_BOARD+=ipq-wifi-$(1) | ||||||
| endef | endef | ||||||
|  |  | ||||||
|  | $(eval $(call generate-ipq-wifi-package,zyxel_wre6606,board-zyxel_wre6606.bin,ZyXEL WRE6606)) | ||||||
| #$(eval $(call generate-ipq-wifi-package,<devicename>,<filename>,<displayname>)) | #$(eval $(call generate-ipq-wifi-package,<devicename>,<filename>,<displayname>)) | ||||||
|  |  | ||||||
| $(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE)))) | $(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE)))) | ||||||
|   | |||||||
							
								
								
									
										
											BIN
										
									
								
								package/firmware/ipq-wifi/board-zyxel_wre6606.bin
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								package/firmware/ipq-wifi/board-zyxel_wre6606.bin
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -13,9 +13,9 @@ PKG_RELEASE:=1 | |||||||
|  |  | ||||||
| PKG_SOURCE_PROTO:=git | PKG_SOURCE_PROTO:=git | ||||||
| PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git | PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git | ||||||
| PKG_SOURCE_DATE:=2018-05-07 | PKG_SOURCE_DATE:=2018-05-15 | ||||||
| PKG_SOURCE_VERSION:=735eaf21e980117e171de9fe7ce046ab8e9f16db | PKG_SOURCE_VERSION:=779e91a91e803cf2b95a6a46de721d3a4fd4dfe6 | ||||||
| PKG_MIRROR_HASH:=4dd90cf152e876371d363f2442154464cffcee5d64b916a7f4a9fb897ff0d1d9 | PKG_MIRROR_HASH:=2bd1e9aee6d53a2a140ad5ece6d8eeccbfb8ae8c788e84f9dd946e29abb64010 | ||||||
| PKG_MAINTAINER:=Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk> | PKG_MAINTAINER:=Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk> | ||||||
|  |  | ||||||
| include $(INCLUDE_DIR)/package.mk | include $(INCLUDE_DIR)/package.mk | ||||||
|   | |||||||
| @@ -0,0 +1,12 @@ | |||||||
|  | --- a/src/drv_mei_cpe_api_atm_ptm_intern.c | ||||||
|  | +++ b/src/drv_mei_cpe_api_atm_ptm_intern.c | ||||||
|  | @@ -124,6 +124,9 @@ IFX_int32_t MEI_InternalXtmSwhowtimeExit | ||||||
|  |     /* Get line number*/ | ||||||
|  |     dslLineNum = pMeiDynCntrl->pMeiDev->meiDrvCntrl.dslLineNum; | ||||||
|  |   | ||||||
|  | +   g_tx_link_rate[dslLineNum][0] = 0; | ||||||
|  | +   g_tx_link_rate[dslLineNum][1] = 0; | ||||||
|  | + | ||||||
|  |     /* get NULL or function pointer */ | ||||||
|  |     mei_showtime_exit = | ||||||
|  |          (ltq_mei_atm_showtime_exit_t)ppa_callback_get(LTQ_MEI_SHOWTIME_EXIT); | ||||||
| @@ -568,5 +568,3 @@ define KernelPackage/fuse/description | |||||||
| endef | endef | ||||||
|  |  | ||||||
| $(eval $(call KernelPackage,fuse)) | $(eval $(call KernelPackage,fuse)) | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -411,7 +411,8 @@ $(eval $(call KernelPackage,rfkill)) | |||||||
| define KernelPackage/softdog | define KernelPackage/softdog | ||||||
|   SUBMENU:=$(OTHER_MENU) |   SUBMENU:=$(OTHER_MENU) | ||||||
|   TITLE:=Software watchdog driver |   TITLE:=Software watchdog driver | ||||||
|   KCONFIG:=CONFIG_SOFT_WATCHDOG |   KCONFIG:=CONFIG_SOFT_WATCHDOG \ | ||||||
|  |   	CONFIG_SOFT_WATCHDOG_PRETIMEOUT=n | ||||||
|   FILES:=$(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/softdog.ko |   FILES:=$(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/softdog.ko | ||||||
|   AUTOLOAD:=$(call AutoLoad,50,softdog,1) |   AUTOLOAD:=$(call AutoLoad,50,softdog,1) | ||||||
| endef | endef | ||||||
|   | |||||||
| @@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk | |||||||
| PKG_NAME:=mac80211 | PKG_NAME:=mac80211 | ||||||
|  |  | ||||||
| PKG_VERSION:=2017-11-01 | PKG_VERSION:=2017-11-01 | ||||||
| PKG_RELEASE:=8 | PKG_RELEASE:=9 | ||||||
| PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources | PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources | ||||||
| PKG_HASH:=8437ab7886b988c8152e7a4db30b7f41009e49a3b2cb863edd05da1ecd7eb05a | PKG_HASH:=8437ab7886b988c8152e7a4db30b7f41009e49a3b2cb863edd05da1ecd7eb05a | ||||||
|  |  | ||||||
|   | |||||||
| @@ -0,0 +1,43 @@ | |||||||
|  | From 52a192362932f333a7ebafd581c4d9b81da2fec8 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: Stanislaw Gruszka <sgruszka@redhat.com> | ||||||
|  | Date: Mon, 28 May 2018 13:25:06 +0200 | ||||||
|  | Subject: [PATCH] Revert "rt2800: use TXOP_BACKOFF for probe frames" | ||||||
|  |  | ||||||
|  | This reverts commit fb47ada8dc3c30c8e7b415da155742b49536c61e. | ||||||
|  |  | ||||||
|  | In some situations when we set TXOP_BACKOFF, the probe frame is | ||||||
|  | not sent at all. What it worse then sending probe frame as part | ||||||
|  | of AMPDU and can degrade 11n performance to 11g rates. | ||||||
|  |  | ||||||
|  | Cc: stable@vger.kernel.org | ||||||
|  | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> | ||||||
|  | Signed-off-by: Kalle Valo <kvalo@codeaurora.org> | ||||||
|  | --- | ||||||
|  |  drivers/net/wireless/ralink/rt2x00/rt2x00queue.c | 7 +++---- | ||||||
|  |  1 file changed, 3 insertions(+), 4 deletions(-) | ||||||
|  |  | ||||||
|  | --- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c | ||||||
|  | +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c | ||||||
|  | @@ -372,16 +372,15 @@ static void rt2x00queue_create_tx_descri | ||||||
|  |   | ||||||
|  |  	/* | ||||||
|  |  	 * Determine IFS values | ||||||
|  | -	 * - Use TXOP_BACKOFF for probe and management frames except beacons | ||||||
|  | +	 * - Use TXOP_BACKOFF for management frames except beacons | ||||||
|  |  	 * - Use TXOP_SIFS for fragment bursts | ||||||
|  |  	 * - Use TXOP_HTTXOP for everything else | ||||||
|  |  	 * | ||||||
|  |  	 * Note: rt2800 devices won't use CTS protection (if used) | ||||||
|  |  	 * for frames not transmitted with TXOP_HTTXOP | ||||||
|  |  	 */ | ||||||
|  | -	if ((ieee80211_is_mgmt(hdr->frame_control) && | ||||||
|  | -	     !ieee80211_is_beacon(hdr->frame_control)) || | ||||||
|  | -	    (tx_info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE)) | ||||||
|  | +	if (ieee80211_is_mgmt(hdr->frame_control) && | ||||||
|  | +	    !ieee80211_is_beacon(hdr->frame_control)) | ||||||
|  |  		txdesc->u.ht.txop = TXOP_BACKOFF; | ||||||
|  |  	else if (!(tx_info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)) | ||||||
|  |  		txdesc->u.ht.txop = TXOP_SIFS; | ||||||
|  | --  | ||||||
|  | 2.17.1 | ||||||
|  |  | ||||||
| @@ -173,7 +173,8 @@ | |||||||
|  #define AES_CCM_H |  #define AES_CCM_H | ||||||
|   |   | ||||||
| -#include "aead_api.h" | -#include "aead_api.h" | ||||||
| - | +#include <linux/crypto.h> | ||||||
|  |   | ||||||
| -#define CCM_AAD_LEN	32 | -#define CCM_AAD_LEN	32 | ||||||
| - | - | ||||||
| -static inline struct crypto_aead * | -static inline struct crypto_aead * | ||||||
| @@ -201,8 +202,7 @@ | |||||||
| -			    be16_to_cpup((__be16 *)aad), | -			    be16_to_cpup((__be16 *)aad), | ||||||
| -			    data, data_len, mic); | -			    data, data_len, mic); | ||||||
| -} | -} | ||||||
| +#include <linux/crypto.h> | - | ||||||
|   |  | ||||||
| -static inline void ieee80211_aes_key_free(struct crypto_aead *tfm) | -static inline void ieee80211_aes_key_free(struct crypto_aead *tfm) | ||||||
| -{ | -{ | ||||||
| -	return aead_key_free(tfm); | -	return aead_key_free(tfm); | ||||||
| @@ -338,10 +338,10 @@ | |||||||
|  #define AES_GCM_H |  #define AES_GCM_H | ||||||
|   |   | ||||||
| -#include "aead_api.h" | -#include "aead_api.h" | ||||||
| - |  | ||||||
| -#define GCM_AAD_LEN	32 |  | ||||||
| +#include <linux/crypto.h> | +#include <linux/crypto.h> | ||||||
|   |   | ||||||
|  | -#define GCM_AAD_LEN	32 | ||||||
|  | - | ||||||
| -static inline int ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, | -static inline int ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, | ||||||
| -					    u8 *j_0, u8 *aad,  u8 *data, | -					    u8 *j_0, u8 *aad,  u8 *data, | ||||||
| -					    size_t data_len, u8 *mic) | -					    size_t data_len, u8 *mic) | ||||||
|   | |||||||
| @@ -20,12 +20,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
| -void ieee80211_aes_cmac(struct crypto_shash *tfm, const u8 *aad, | -void ieee80211_aes_cmac(struct crypto_shash *tfm, const u8 *aad, | ||||||
| -			const u8 *data, size_t data_len, u8 *mic) | -			const u8 *data, size_t data_len, u8 *mic) | ||||||
| +void gf_mulx(u8 *pad) | +void gf_mulx(u8 *pad) | ||||||
|  { | +{ | ||||||
| -	SHASH_DESC_ON_STACK(desc, tfm); |  | ||||||
| -	u8 out[AES_BLOCK_SIZE]; |  | ||||||
| +	int i, carry; | +	int i, carry; | ||||||
|   | + | ||||||
| -	desc->tfm = tfm; |  | ||||||
| +	carry = pad[0] & 0x80; | +	carry = pad[0] & 0x80; | ||||||
| +	for (i = 0; i < AES_BLOCK_SIZE - 1; i++) | +	for (i = 0; i < AES_BLOCK_SIZE - 1; i++) | ||||||
| +		pad[i] = (pad[i] << 1) | (pad[i + 1] >> 7); | +		pad[i] = (pad[i] << 1) | (pad[i + 1] >> 7); | ||||||
| @@ -33,20 +30,17 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
| +	if (carry) | +	if (carry) | ||||||
| +		pad[AES_BLOCK_SIZE - 1] ^= 0x87; | +		pad[AES_BLOCK_SIZE - 1] ^= 0x87; | ||||||
| +} | +} | ||||||
|   | + | ||||||
| -	crypto_shash_init(desc); |  | ||||||
| -	crypto_shash_update(desc, aad, AAD_LEN); |  | ||||||
| -	crypto_shash_update(desc, data, data_len - CMAC_TLEN); |  | ||||||
| -	crypto_shash_finup(desc, zero, CMAC_TLEN, out); |  | ||||||
| +void aes_cmac_vector(struct crypto_cipher *tfm, size_t num_elem, | +void aes_cmac_vector(struct crypto_cipher *tfm, size_t num_elem, | ||||||
| +		     const u8 *addr[], const size_t *len, u8 *mac, | +		     const u8 *addr[], const size_t *len, u8 *mac, | ||||||
| +		     size_t mac_len) | +		     size_t mac_len) | ||||||
| +{ |  { | ||||||
|  | -	SHASH_DESC_ON_STACK(desc, tfm); | ||||||
|  | -	u8 out[AES_BLOCK_SIZE]; | ||||||
| +	u8 cbc[AES_BLOCK_SIZE], pad[AES_BLOCK_SIZE]; | +	u8 cbc[AES_BLOCK_SIZE], pad[AES_BLOCK_SIZE]; | ||||||
| +	const u8 *pos, *end; | +	const u8 *pos, *end; | ||||||
| +	size_t i, e, left, total_len; | +	size_t i, e, left, total_len; | ||||||
|   | + | ||||||
| -	memcpy(mic, out, CMAC_TLEN); |  | ||||||
| +	memset(cbc, 0, AES_BLOCK_SIZE); | +	memset(cbc, 0, AES_BLOCK_SIZE); | ||||||
| + | + | ||||||
| +	total_len = 0; | +	total_len = 0; | ||||||
| @@ -93,10 +87,14 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
| +		pad[i] ^= cbc[i]; | +		pad[i] ^= cbc[i]; | ||||||
| +	crypto_cipher_encrypt_one(tfm, pad, pad); | +	crypto_cipher_encrypt_one(tfm, pad, pad); | ||||||
| +	memcpy(mac, pad, mac_len); | +	memcpy(mac, pad, mac_len); | ||||||
|  } | +} | ||||||
|   |   | ||||||
| -void ieee80211_aes_cmac_256(struct crypto_shash *tfm, const u8 *aad, | -	desc->tfm = tfm; | ||||||
| + |   | ||||||
|  | -	crypto_shash_init(desc); | ||||||
|  | -	crypto_shash_update(desc, aad, AAD_LEN); | ||||||
|  | -	crypto_shash_update(desc, data, data_len - CMAC_TLEN); | ||||||
|  | -	crypto_shash_finup(desc, zero, CMAC_TLEN, out); | ||||||
| +void ieee80211_aes_cmac(struct crypto_cipher *tfm, const u8 *aad, | +void ieee80211_aes_cmac(struct crypto_cipher *tfm, const u8 *aad, | ||||||
| +			const u8 *data, size_t data_len, u8 *mic) | +			const u8 *data, size_t data_len, u8 *mic) | ||||||
| +{ | +{ | ||||||
| @@ -111,10 +109,12 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
| +	len[1] = data_len - CMAC_TLEN; | +	len[1] = data_len - CMAC_TLEN; | ||||||
| +	addr[2] = zero; | +	addr[2] = zero; | ||||||
| +	len[2] = CMAC_TLEN; | +	len[2] = CMAC_TLEN; | ||||||
| + |   | ||||||
|  | -	memcpy(mic, out, CMAC_TLEN); | ||||||
| +	aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN); | +	aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN); | ||||||
| +} |  } | ||||||
| + |   | ||||||
|  | -void ieee80211_aes_cmac_256(struct crypto_shash *tfm, const u8 *aad, | ||||||
| +void ieee80211_aes_cmac_256(struct crypto_cipher *tfm, const u8 *aad, | +void ieee80211_aes_cmac_256(struct crypto_cipher *tfm, const u8 *aad, | ||||||
|  			    const u8 *data, size_t data_len, u8 *mic) |  			    const u8 *data, size_t data_len, u8 *mic) | ||||||
|  { |  { | ||||||
| @@ -122,8 +122,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
| +	const u8 *addr[3]; | +	const u8 *addr[3]; | ||||||
| +	size_t len[3]; | +	size_t len[3]; | ||||||
| +	u8 zero[CMAC_TLEN_256]; | +	u8 zero[CMAC_TLEN_256]; | ||||||
|   | + | ||||||
| -	desc->tfm = tfm; |  | ||||||
| +	memset(zero, 0, CMAC_TLEN_256); | +	memset(zero, 0, CMAC_TLEN_256); | ||||||
| +	addr[0] = aad; | +	addr[0] = aad; | ||||||
| +	len[0] = AAD_LEN; | +	len[0] = AAD_LEN; | ||||||
| @@ -132,6 +131,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
| +	addr[2] = zero; | +	addr[2] = zero; | ||||||
| +	len[2] = CMAC_TLEN_256; | +	len[2] = CMAC_TLEN_256; | ||||||
|   |   | ||||||
|  | -	desc->tfm = tfm; | ||||||
|  | - | ||||||
| -	crypto_shash_init(desc); | -	crypto_shash_init(desc); | ||||||
| -	crypto_shash_update(desc, aad, AAD_LEN); | -	crypto_shash_update(desc, aad, AAD_LEN); | ||||||
| -	crypto_shash_update(desc, data, data_len - CMAC_TLEN_256); | -	crypto_shash_update(desc, data, data_len - CMAC_TLEN_256); | ||||||
|   | |||||||
| @@ -88,7 +88,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org> | |||||||
| -			spec_scan = true; | -			spec_scan = true; | ||||||
| -		} else | -		} else | ||||||
| -			brcmf_dbg(SCAN, "Broadcast scan\n"); | -			brcmf_dbg(SCAN, "Broadcast scan\n"); | ||||||
|   | - | ||||||
| -		passive_scan = cfg->active_scan ? 0 : 1; | -		passive_scan = cfg->active_scan ? 0 : 1; | ||||||
| -		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PASSIVE_SCAN, | -		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PASSIVE_SCAN, | ||||||
| -					    passive_scan); | -					    passive_scan); | ||||||
| @@ -105,15 +105,17 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org> | |||||||
| -					  ssid_le.SSID); | -					  ssid_le.SSID); | ||||||
| -			else | -			else | ||||||
| -				brcmf_err("WLC_SCAN error (%d)\n", err); | -				brcmf_err("WLC_SCAN error (%d)\n", err); | ||||||
| +	cfg->escan_info.run = brcmf_run_escan; | - | ||||||
| +	err = brcmf_p2p_scan_prep(wiphy, request, vif); |  | ||||||
| +	if (err) |  | ||||||
| +		goto scan_out; |  | ||||||
|   |  | ||||||
| -			brcmf_scan_config_mpc(ifp, 1); | -			brcmf_scan_config_mpc(ifp, 1); | ||||||
| -			goto scan_out; | -			goto scan_out; | ||||||
| -		} | -		} | ||||||
| -	} | -	} | ||||||
|  | + | ||||||
|  | +	cfg->escan_info.run = brcmf_run_escan; | ||||||
|  | +	err = brcmf_p2p_scan_prep(wiphy, request, vif); | ||||||
|  | +	if (err) | ||||||
|  | +		goto scan_out; | ||||||
|  | + | ||||||
| +	err = brcmf_do_escan(vif->ifp, request); | +	err = brcmf_do_escan(vif->ifp, request); | ||||||
| +	if (err) | +	if (err) | ||||||
| +		goto scan_out; | +		goto scan_out; | ||||||
|   | |||||||
| @@ -141,12 +141,12 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org> | |||||||
| -		func = SDIO_FUNC_0; | -		func = SDIO_FUNC_0; | ||||||
| -	else | -	else | ||||||
| -		func = SDIO_FUNC_1; | -		func = SDIO_FUNC_1; | ||||||
|   | - | ||||||
| -	do { | -	do { | ||||||
| -		/* for retry wait for 1 ms till bus get settled down */ | -		/* for retry wait for 1 ms till bus get settled down */ | ||||||
| -		if (retry) | -		if (retry) | ||||||
| -			usleep_range(1000, 2000); | -			usleep_range(1000, 2000); | ||||||
| - |   | ||||||
| -		ret = brcmf_sdiod_request_data(sdiodev, func, addr, regsz, | -		ret = brcmf_sdiod_request_data(sdiodev, func, addr, regsz, | ||||||
| -					       data, true); | -					       data, true); | ||||||
| - | - | ||||||
|   | |||||||
| @@ -198,14 +198,14 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org> | |||||||
|  	int retval; |  	int retval; | ||||||
|   |   | ||||||
| -	retval = brcmf_sdiod_reg_read(sdiodev, addr, 1, &data); | -	retval = brcmf_sdiod_reg_read(sdiodev, addr, 1, &data); | ||||||
| +	retval = brcmf_sdiod_addrprep(sdiodev, &addr); | - | ||||||
|   |  | ||||||
| -	if (ret) | -	if (ret) | ||||||
| -		*ret = retval; | -		*ret = retval; | ||||||
| - | - | ||||||
| -	return data; | -	return data; | ||||||
| -} | -} | ||||||
| - | +	retval = brcmf_sdiod_addrprep(sdiodev, &addr); | ||||||
|  |   | ||||||
| -u32 brcmf_sdiod_regrl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret) | -u32 brcmf_sdiod_regrl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret) | ||||||
| -{ | -{ | ||||||
| -	u32 data; | -	u32 data; | ||||||
|   | |||||||
| @@ -62,10 +62,10 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org> | |||||||
| +	if (!err) | +	if (!err) | ||||||
|  		sdiodev->sbwad = bar0; |  		sdiodev->sbwad = bar0; | ||||||
| -	} | -	} | ||||||
| - |   | ||||||
| -	*addr &= SBSDIO_SB_OFT_ADDR_MASK; | -	*addr &= SBSDIO_SB_OFT_ADDR_MASK; | ||||||
| -	*addr |= SBSDIO_SB_ACCESS_2_4B_FLAG; | -	*addr |= SBSDIO_SB_ACCESS_2_4B_FLAG; | ||||||
|   | - | ||||||
| -	return 0; | -	return 0; | ||||||
| +	return err; | +	return err; | ||||||
|  } |  } | ||||||
| @@ -99,14 +99,14 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org> | |||||||
| +	retval = brcmf_sdiod_set_backplane_window(sdiodev, addr); | +	retval = brcmf_sdiod_set_backplane_window(sdiodev, addr); | ||||||
| +	if (retval) | +	if (retval) | ||||||
| +		goto out; | +		goto out; | ||||||
| + |  | ||||||
| +	addr &= SBSDIO_SB_OFT_ADDR_MASK; |  | ||||||
| +	addr |= SBSDIO_SB_ACCESS_2_4B_FLAG; |  | ||||||
|   |   | ||||||
| -	if (!retval) | -	if (!retval) | ||||||
| -		sdio_writel(sdiodev->func[1], data, addr, &retval); | -		sdio_writel(sdiodev->func[1], data, addr, &retval); | ||||||
| +	sdio_writel(sdiodev->func[1], data, addr, &retval); | +	addr &= SBSDIO_SB_OFT_ADDR_MASK; | ||||||
|  | +	addr |= SBSDIO_SB_ACCESS_2_4B_FLAG; | ||||||
|   |   | ||||||
|  | +	sdio_writel(sdiodev->func[1], data, addr, &retval); | ||||||
|  | + | ||||||
| +out: | +out: | ||||||
|  	if (ret) |  	if (ret) | ||||||
|  		*ret = retval; |  		*ret = retval; | ||||||
|   | |||||||
| @@ -29,6 +29,21 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
| -		npend = ath9k_hw_numtxpending(ah, i); | -		npend = ath9k_hw_numtxpending(ah, i); | ||||||
| -		if (npend) | -		if (npend) | ||||||
| -			break; | -			break; | ||||||
|  | -	} | ||||||
|  | - | ||||||
|  | -	if (ah->external_reset && | ||||||
|  | -	    (npend || type == ATH9K_RESET_COLD)) { | ||||||
|  | -		int reset_err = 0; | ||||||
|  | - | ||||||
|  | -		ath_dbg(ath9k_hw_common(ah), RESET, | ||||||
|  | -			"reset MAC via external reset\n"); | ||||||
|  | - | ||||||
|  | -		reset_err = ah->external_reset(); | ||||||
|  | -		if (reset_err) { | ||||||
|  | -			ath_err(ath9k_hw_common(ah), | ||||||
|  | -				"External reset failed, err=%d\n", | ||||||
|  | -				reset_err); | ||||||
|  | -			return false; | ||||||
| +	if (type == ATH9K_RESET_COLD) | +	if (type == ATH9K_RESET_COLD) | ||||||
| +		return true; | +		return true; | ||||||
| + | + | ||||||
| @@ -44,47 +59,35 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
| +		for (i = 0; i < AR_NUM_QCU; i++) { | +		for (i = 0; i < AR_NUM_QCU; i++) { | ||||||
| +			if (ath9k_hw_numtxpending(ah, i)) | +			if (ath9k_hw_numtxpending(ah, i)) | ||||||
| +				return true; | +				return true; | ||||||
| +		} |  | ||||||
|  		} |  		} | ||||||
|   | +	} | ||||||
| -	if (ah->external_reset && | + | ||||||
| -	    (npend || type == ATH9K_RESET_COLD)) { |  | ||||||
| -		int reset_err = 0; |  | ||||||
| +	return false; | +	return false; | ||||||
| +} | +} | ||||||
|   | + | ||||||
| -		ath_dbg(ath9k_hw_common(ah), RESET, |  | ||||||
| -			"reset MAC via external reset\n"); |  | ||||||
| +static bool ath9k_hw_external_reset(struct ath_hw *ah, int type) | +static bool ath9k_hw_external_reset(struct ath_hw *ah, int type) | ||||||
| +{ | +{ | ||||||
| +	int err; | +	int err; | ||||||
|   | + | ||||||
| -		reset_err = ah->external_reset(); |  | ||||||
| -		if (reset_err) { |  | ||||||
| -			ath_err(ath9k_hw_common(ah), |  | ||||||
| -				"External reset failed, err=%d\n", |  | ||||||
| -				reset_err); |  | ||||||
| -			return false; |  | ||||||
| -		} |  | ||||||
| +	if (!ah->external_reset || !ath9k_hw_need_external_reset(ah, type)) | +	if (!ah->external_reset || !ath9k_hw_need_external_reset(ah, type)) | ||||||
| +		return true; | +		return true; | ||||||
|   | + | ||||||
| -		REG_WRITE(ah, AR_RTC_RESET, 1); |  | ||||||
| +	ath_dbg(ath9k_hw_common(ah), RESET, | +	ath_dbg(ath9k_hw_common(ah), RESET, | ||||||
| +		"reset MAC via external reset\n"); | +		"reset MAC via external reset\n"); | ||||||
| + |   | ||||||
|  | -		REG_WRITE(ah, AR_RTC_RESET, 1); | ||||||
| +	err = ah->external_reset(); | +	err = ah->external_reset(); | ||||||
| +	if (err) { | +	if (err) { | ||||||
| +		ath_err(ath9k_hw_common(ah), | +		ath_err(ath9k_hw_common(ah), | ||||||
| +			"External reset failed, err=%d\n", err); | +			"External reset failed, err=%d\n", err); | ||||||
| +		return false; | +		return false; | ||||||
| +	} |  	} | ||||||
| + |   | ||||||
| +	if (AR_SREV_9550(ah)) { | +	if (AR_SREV_9550(ah)) { | ||||||
| +		REG_WRITE(ah, AR_RTC_RESET, 0); | +		REG_WRITE(ah, AR_RTC_RESET, 0); | ||||||
| +		udelay(10); | +		udelay(10); | ||||||
|  	} | +	} | ||||||
|   | + | ||||||
| +	REG_WRITE(ah, AR_RTC_RESET, 1); | +	REG_WRITE(ah, AR_RTC_RESET, 1); | ||||||
| +	udelay(10); | +	udelay(10); | ||||||
| + | + | ||||||
|   | |||||||
| @@ -1,96 +0,0 @@ | |||||||
| From: Felix Fietkau <nbd@openwrt.org> |  | ||||||
| Date: Thu, 2 Jul 2015 15:20:56 +0200 |  | ||||||
| Subject: [PATCH] ath9k: limit retries for powersave response frames |  | ||||||
|  |  | ||||||
| In some cases, the channel might be busy enough that an ath9k AP's |  | ||||||
| response to PS-Poll frames might be too slow and the station has already |  | ||||||
| gone to sleep. To avoid wasting too much airtime on this, limit the |  | ||||||
| number of retries on such frames and ensure that no sample rate gets |  | ||||||
| used. |  | ||||||
|  |  | ||||||
| Signed-off-by: Felix Fietkau <nbd@openwrt.org> |  | ||||||
| --- |  | ||||||
|  |  | ||||||
| --- a/drivers/net/wireless/ath/ath9k/xmit.c |  | ||||||
| +++ b/drivers/net/wireless/ath/ath9k/xmit.c |  | ||||||
| @@ -188,10 +188,25 @@ static void ath_send_bar(struct ath_atx_ |  | ||||||
|  } |  | ||||||
|   |  | ||||||
|  static void ath_set_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta, |  | ||||||
| -			  struct ath_buf *bf) |  | ||||||
| +			  struct ath_buf *bf, bool ps) |  | ||||||
|  { |  | ||||||
| +	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(bf->bf_mpdu); |  | ||||||
| + |  | ||||||
| +	if (ps) { |  | ||||||
| +		/* Clear the first rate to avoid using a sample rate for PS frames */ |  | ||||||
| +		info->control.rates[0].idx = -1; |  | ||||||
| +		info->control.rates[0].count = 0; |  | ||||||
| +	} |  | ||||||
| + |  | ||||||
|  	ieee80211_get_tx_rates(vif, sta, bf->bf_mpdu, bf->rates, |  | ||||||
|  			       ARRAY_SIZE(bf->rates)); |  | ||||||
| +	if (!ps) |  | ||||||
| +		return; |  | ||||||
| + |  | ||||||
| +	if (bf->rates[0].count > 2) |  | ||||||
| +		bf->rates[0].count = 2; |  | ||||||
| + |  | ||||||
| +	bf->rates[1].idx = -1; |  | ||||||
|  } |  | ||||||
|   |  | ||||||
|  static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq, |  | ||||||
| @@ -1502,7 +1517,7 @@ ath_tx_form_burst(struct ath_softc *sc, |  | ||||||
|  			break; |  | ||||||
|  		} |  | ||||||
|   |  | ||||||
| -		ath_set_rates(tid->an->vif, tid->an->sta, bf); |  | ||||||
| +		ath_set_rates(tid->an->vif, tid->an->sta, bf, false); |  | ||||||
|  	} while (1); |  | ||||||
|  } |  | ||||||
|   |  | ||||||
| @@ -1532,7 +1547,7 @@ static bool ath_tx_sched_aggr(struct ath |  | ||||||
|  		return false; |  | ||||||
|  	} |  | ||||||
|   |  | ||||||
| -	ath_set_rates(tid->an->vif, tid->an->sta, bf); |  | ||||||
| +	ath_set_rates(tid->an->vif, tid->an->sta, bf, false); |  | ||||||
|  	if (aggr) |  | ||||||
|  		aggr_len = ath_tx_form_aggr(sc, txq, tid, &bf_q, bf); |  | ||||||
|  	else |  | ||||||
| @@ -1690,7 +1705,7 @@ void ath9k_release_buffered_frames(struc |  | ||||||
|  				break; |  | ||||||
|   |  | ||||||
|  			list_add_tail(&bf->list, &bf_q); |  | ||||||
| -			ath_set_rates(tid->an->vif, tid->an->sta, bf); |  | ||||||
| +			ath_set_rates(tid->an->vif, tid->an->sta, bf, true); |  | ||||||
|  			if (bf_isampdu(bf)) { |  | ||||||
|  				ath_tx_addto_baw(sc, tid, bf); |  | ||||||
|  				bf->bf_state.bf_type &= ~BUF_AGGR; |  | ||||||
| @@ -2390,7 +2405,7 @@ int ath_tx_start(struct ieee80211_hw *hw |  | ||||||
|  	if (txctl->paprd) |  | ||||||
|  		bf->bf_state.bfs_paprd_timestamp = jiffies; |  | ||||||
|   |  | ||||||
| -	ath_set_rates(vif, sta, bf); |  | ||||||
| +	ath_set_rates(vif, sta, bf, ps_resp); |  | ||||||
|  	ath_tx_send_normal(sc, txq, tid, skb); |  | ||||||
|   |  | ||||||
|  out: |  | ||||||
| @@ -2429,7 +2444,7 @@ void ath_tx_cabq(struct ieee80211_hw *hw |  | ||||||
|  			break; |  | ||||||
|   |  | ||||||
|  		bf->bf_lastbf = bf; |  | ||||||
| -		ath_set_rates(vif, NULL, bf); |  | ||||||
| +		ath_set_rates(vif, NULL, bf, false); |  | ||||||
|  		ath_buf_set_rate(sc, bf, &info, fi->framelen, false); |  | ||||||
|  		duration += info.rates[0].PktDuration; |  | ||||||
|  		if (bf_tail) |  | ||||||
| @@ -2946,7 +2961,7 @@ int ath9k_tx99_send(struct ath_softc *sc |  | ||||||
|  		return -EINVAL; |  | ||||||
|  	} |  | ||||||
|   |  | ||||||
| -	ath_set_rates(sc->tx99_vif, NULL, bf); |  | ||||||
| +	ath_set_rates(sc->tx99_vif, NULL, bf, false); |  | ||||||
|   |  | ||||||
|  	ath9k_hw_set_desc_link(sc->sc_ah, bf->bf_desc, bf->bf_daddr); |  | ||||||
|  	ath9k_hw_tx99_start(sc->sc_ah, txctl->txq->axq_qnum); |  | ||||||
| @@ -7,7 +7,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  |  | ||||||
| --- a/drivers/net/wireless/ath/ath9k/xmit.c | --- a/drivers/net/wireless/ath/ath9k/xmit.c | ||||||
| +++ b/drivers/net/wireless/ath/ath9k/xmit.c | +++ b/drivers/net/wireless/ath/ath9k/xmit.c | ||||||
| @@ -1674,6 +1674,22 @@ void ath_tx_aggr_wakeup(struct ath_softc | @@ -1659,6 +1659,22 @@ void ath_tx_aggr_wakeup(struct ath_softc | ||||||
|  	} |  	} | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -30,15 +30,15 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  void ath9k_release_buffered_frames(struct ieee80211_hw *hw, |  void ath9k_release_buffered_frames(struct ieee80211_hw *hw, | ||||||
|  				   struct ieee80211_sta *sta, |  				   struct ieee80211_sta *sta, | ||||||
|  				   u16 tids, int nframes, |  				   u16 tids, int nframes, | ||||||
| @@ -1704,6 +1720,7 @@ void ath9k_release_buffered_frames(struc | @@ -1689,6 +1705,7 @@ void ath9k_release_buffered_frames(struc | ||||||
|  			if (!bf) |  			if (!bf) | ||||||
|  				break; |  				break; | ||||||
|   |   | ||||||
| +			ath9k_set_moredata(sc, bf, true); | +			ath9k_set_moredata(sc, bf, true); | ||||||
|  			list_add_tail(&bf->list, &bf_q); |  			list_add_tail(&bf->list, &bf_q); | ||||||
|  			ath_set_rates(tid->an->vif, tid->an->sta, bf, true); |  			ath_set_rates(tid->an->vif, tid->an->sta, bf); | ||||||
|  			if (bf_isampdu(bf)) { |  			if (bf_isampdu(bf)) { | ||||||
| @@ -1727,6 +1744,9 @@ void ath9k_release_buffered_frames(struc | @@ -1712,6 +1729,9 @@ void ath9k_release_buffered_frames(struc | ||||||
|  	if (list_empty(&bf_q)) |  	if (list_empty(&bf_q)) | ||||||
|  		return; |  		return; | ||||||
|   |   | ||||||
|   | |||||||
| @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  |  | ||||||
| --- a/drivers/net/wireless/ath/ath9k/xmit.c | --- a/drivers/net/wireless/ath/ath9k/xmit.c | ||||||
| +++ b/drivers/net/wireless/ath/ath9k/xmit.c | +++ b/drivers/net/wireless/ath/ath9k/xmit.c | ||||||
| @@ -984,7 +984,8 @@ ath_tx_get_tid_subframe(struct ath_softc | @@ -969,7 +969,8 @@ ath_tx_get_tid_subframe(struct ath_softc | ||||||
|  		bf->bf_lastbf = bf; |  		bf->bf_lastbf = bf; | ||||||
|   |   | ||||||
|  		tx_info = IEEE80211_SKB_CB(skb); |  		tx_info = IEEE80211_SKB_CB(skb); | ||||||
|   | |||||||
| @@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, |  static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, | ||||||
|  					   struct ath_txq *txq, |  					   struct ath_txq *txq, | ||||||
|  					   struct ath_atx_tid *tid, |  					   struct ath_atx_tid *tid, | ||||||
| @@ -311,7 +311,7 @@ static void ath_tx_flush_tid(struct ath_ | @@ -296,7 +296,7 @@ static void ath_tx_flush_tid(struct ath_ | ||||||
|  		} |  		} | ||||||
|   |   | ||||||
|  		if (fi->baw_tracked) { |  		if (fi->baw_tracked) { | ||||||
| @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  			sendbar = true; |  			sendbar = true; | ||||||
|  		} |  		} | ||||||
|   |   | ||||||
| @@ -327,10 +327,15 @@ static void ath_tx_flush_tid(struct ath_ | @@ -312,10 +312,15 @@ static void ath_tx_flush_tid(struct ath_ | ||||||
|  } |  } | ||||||
|   |   | ||||||
|  static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid, |  static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid, | ||||||
| @@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  	index  = ATH_BA_INDEX(tid->seq_start, seqno); |  	index  = ATH_BA_INDEX(tid->seq_start, seqno); | ||||||
|  	cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1); |  	cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1); | ||||||
|   |   | ||||||
| @@ -351,6 +356,9 @@ static void ath_tx_addto_baw(struct ath_ | @@ -336,6 +341,9 @@ static void ath_tx_addto_baw(struct ath_ | ||||||
|  	u16 seqno = bf->bf_state.seqno; |  	u16 seqno = bf->bf_state.seqno; | ||||||
|  	int index, cindex; |  	int index, cindex; | ||||||
|   |   | ||||||
| @@ -57,7 +57,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  	index  = ATH_BA_INDEX(tid->seq_start, seqno); |  	index  = ATH_BA_INDEX(tid->seq_start, seqno); | ||||||
|  	cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1); |  	cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1); | ||||||
|  	__set_bit(cindex, tid->tx_buf); |  	__set_bit(cindex, tid->tx_buf); | ||||||
| @@ -627,7 +635,7 @@ static void ath_tx_complete_aggr(struct | @@ -612,7 +620,7 @@ static void ath_tx_complete_aggr(struct | ||||||
|  			 * complete the acked-ones/xretried ones; update |  			 * complete the acked-ones/xretried ones; update | ||||||
|  			 * block-ack window |  			 * block-ack window | ||||||
|  			 */ |  			 */ | ||||||
| @@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|   |   | ||||||
|  			if (rc_update && (acked_cnt == 1 || txfail_cnt == 1)) { |  			if (rc_update && (acked_cnt == 1 || txfail_cnt == 1)) { | ||||||
|  				memcpy(tx_info->control.rates, rates, sizeof(rates)); |  				memcpy(tx_info->control.rates, rates, sizeof(rates)); | ||||||
| @@ -657,7 +665,7 @@ static void ath_tx_complete_aggr(struct | @@ -642,7 +650,7 @@ static void ath_tx_complete_aggr(struct | ||||||
|  				 * run out of tx buf. |  				 * run out of tx buf. | ||||||
|  				 */ |  				 */ | ||||||
|  				if (!tbf) { |  				if (!tbf) { | ||||||
| @@ -75,7 +75,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|   |   | ||||||
|  					ath_tx_complete_buf(sc, bf, txq, |  					ath_tx_complete_buf(sc, bf, txq, | ||||||
|  							    &bf_head, NULL, ts, |  							    &bf_head, NULL, ts, | ||||||
| @@ -1026,11 +1034,14 @@ ath_tx_get_tid_subframe(struct ath_softc | @@ -1011,11 +1019,14 @@ ath_tx_get_tid_subframe(struct ath_softc | ||||||
|   |   | ||||||
|  			INIT_LIST_HEAD(&bf_head); |  			INIT_LIST_HEAD(&bf_head); | ||||||
|  			list_add(&bf->list, &bf_head); |  			list_add(&bf->list, &bf_head); | ||||||
| @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  		return bf; |  		return bf; | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
| @@ -1088,8 +1099,6 @@ ath_tx_form_aggr(struct ath_softc *sc, s | @@ -1073,8 +1084,6 @@ ath_tx_form_aggr(struct ath_softc *sc, s | ||||||
|  		bf->bf_next = NULL; |  		bf->bf_next = NULL; | ||||||
|   |   | ||||||
|  		/* link buffers of this frame to the aggregate */ |  		/* link buffers of this frame to the aggregate */ | ||||||
| @@ -100,10 +100,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  		bf->bf_state.ndelim = ndelim; |  		bf->bf_state.ndelim = ndelim; | ||||||
|   |   | ||||||
|  		list_add_tail(&bf->list, bf_q); |  		list_add_tail(&bf->list, bf_q); | ||||||
| @@ -1725,10 +1734,8 @@ void ath9k_release_buffered_frames(struc | @@ -1710,10 +1719,8 @@ void ath9k_release_buffered_frames(struc | ||||||
|  			ath9k_set_moredata(sc, bf, true); |  			ath9k_set_moredata(sc, bf, true); | ||||||
|  			list_add_tail(&bf->list, &bf_q); |  			list_add_tail(&bf->list, &bf_q); | ||||||
|  			ath_set_rates(tid->an->vif, tid->an->sta, bf, true); |  			ath_set_rates(tid->an->vif, tid->an->sta, bf); | ||||||
| -			if (bf_isampdu(bf)) { | -			if (bf_isampdu(bf)) { | ||||||
| -				ath_tx_addto_baw(sc, tid, bf); | -				ath_tx_addto_baw(sc, tid, bf); | ||||||
| +			if (bf_isampdu(bf)) | +			if (bf_isampdu(bf)) | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  |  | ||||||
| --- a/drivers/net/wireless/ath/ath9k/xmit.c | --- a/drivers/net/wireless/ath/ath9k/xmit.c | ||||||
| +++ b/drivers/net/wireless/ath/ath9k/xmit.c | +++ b/drivers/net/wireless/ath/ath9k/xmit.c | ||||||
| @@ -2451,7 +2451,6 @@ void ath_tx_cabq(struct ieee80211_hw *hw | @@ -2436,7 +2436,6 @@ void ath_tx_cabq(struct ieee80211_hw *hw | ||||||
|  		.txq = sc->beacon.cabq |  		.txq = sc->beacon.cabq | ||||||
|  	}; |  	}; | ||||||
|  	struct ath_tx_info info = {}; |  	struct ath_tx_info info = {}; | ||||||
| @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  	struct ath_buf *bf_tail = NULL; |  	struct ath_buf *bf_tail = NULL; | ||||||
|  	struct ath_buf *bf; |  	struct ath_buf *bf; | ||||||
|  	LIST_HEAD(bf_q); |  	LIST_HEAD(bf_q); | ||||||
| @@ -2495,15 +2494,10 @@ void ath_tx_cabq(struct ieee80211_hw *hw | @@ -2480,15 +2479,10 @@ void ath_tx_cabq(struct ieee80211_hw *hw | ||||||
|  	if (list_empty(&bf_q)) |  	if (list_empty(&bf_q)) | ||||||
|  		return; |  		return; | ||||||
|   |   | ||||||
|   | |||||||
| @@ -136,72 +136,82 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
| -	MCS_GROUP(1, 0, BW_20), | -	MCS_GROUP(1, 0, BW_20), | ||||||
| -	MCS_GROUP(2, 0, BW_20), | -	MCS_GROUP(2, 0, BW_20), | ||||||
| -	MCS_GROUP(3, 0, BW_20), | -	MCS_GROUP(3, 0, BW_20), | ||||||
| +	MCS_GROUP(1, 0, BW_20, 5), | - | ||||||
| +	MCS_GROUP(2, 0, BW_20, 4), |  | ||||||
| +	MCS_GROUP(3, 0, BW_20, 4), |  | ||||||
|   |  | ||||||
| -	MCS_GROUP(1, 1, BW_20), | -	MCS_GROUP(1, 1, BW_20), | ||||||
| -	MCS_GROUP(2, 1, BW_20), | -	MCS_GROUP(2, 1, BW_20), | ||||||
| -	MCS_GROUP(3, 1, BW_20), | -	MCS_GROUP(3, 1, BW_20), | ||||||
| +	MCS_GROUP(1, 1, BW_20, 5), | - | ||||||
| +	MCS_GROUP(2, 1, BW_20, 4), |  | ||||||
| +	MCS_GROUP(3, 1, BW_20, 4), |  | ||||||
|   |  | ||||||
| -	MCS_GROUP(1, 0, BW_40), | -	MCS_GROUP(1, 0, BW_40), | ||||||
| -	MCS_GROUP(2, 0, BW_40), | -	MCS_GROUP(2, 0, BW_40), | ||||||
| -	MCS_GROUP(3, 0, BW_40), | -	MCS_GROUP(3, 0, BW_40), | ||||||
| +	MCS_GROUP(1, 0, BW_40, 4), | - | ||||||
| +	MCS_GROUP(2, 0, BW_40, 4), |  | ||||||
| +	MCS_GROUP(3, 0, BW_40, 4), |  | ||||||
|   |  | ||||||
| -	MCS_GROUP(1, 1, BW_40), | -	MCS_GROUP(1, 1, BW_40), | ||||||
| -	MCS_GROUP(2, 1, BW_40), | -	MCS_GROUP(2, 1, BW_40), | ||||||
| -	MCS_GROUP(3, 1, BW_40), | -	MCS_GROUP(3, 1, BW_40), | ||||||
| +	MCS_GROUP(1, 1, BW_40, 4), | - | ||||||
| +	MCS_GROUP(2, 1, BW_40, 4), |  | ||||||
| +	MCS_GROUP(3, 1, BW_40, 4), |  | ||||||
|   |  | ||||||
| -	CCK_GROUP, | -	CCK_GROUP, | ||||||
| +	CCK_GROUP(8), | - | ||||||
|   |  | ||||||
| -	VHT_GROUP(1, 0, BW_20), | -	VHT_GROUP(1, 0, BW_20), | ||||||
| -	VHT_GROUP(2, 0, BW_20), | -	VHT_GROUP(2, 0, BW_20), | ||||||
| -	VHT_GROUP(3, 0, BW_20), | -	VHT_GROUP(3, 0, BW_20), | ||||||
| +	VHT_GROUP(1, 0, BW_20, 5), | - | ||||||
| +	VHT_GROUP(2, 0, BW_20, 4), |  | ||||||
| +	VHT_GROUP(3, 0, BW_20, 4), |  | ||||||
|   |  | ||||||
| -	VHT_GROUP(1, 1, BW_20), | -	VHT_GROUP(1, 1, BW_20), | ||||||
| -	VHT_GROUP(2, 1, BW_20), | -	VHT_GROUP(2, 1, BW_20), | ||||||
| -	VHT_GROUP(3, 1, BW_20), | -	VHT_GROUP(3, 1, BW_20), | ||||||
| +	VHT_GROUP(1, 1, BW_20, 5), | - | ||||||
| +	VHT_GROUP(2, 1, BW_20, 4), |  | ||||||
| +	VHT_GROUP(3, 1, BW_20, 4), |  | ||||||
|   |  | ||||||
| -	VHT_GROUP(1, 0, BW_40), | -	VHT_GROUP(1, 0, BW_40), | ||||||
| -	VHT_GROUP(2, 0, BW_40), | -	VHT_GROUP(2, 0, BW_40), | ||||||
| -	VHT_GROUP(3, 0, BW_40), | -	VHT_GROUP(3, 0, BW_40), | ||||||
| +	VHT_GROUP(1, 0, BW_40, 4), | - | ||||||
| +	VHT_GROUP(2, 0, BW_40, 4), |  | ||||||
| +	VHT_GROUP(3, 0, BW_40, 4), |  | ||||||
|   |  | ||||||
| -	VHT_GROUP(1, 1, BW_40), | -	VHT_GROUP(1, 1, BW_40), | ||||||
| -	VHT_GROUP(2, 1, BW_40), | -	VHT_GROUP(2, 1, BW_40), | ||||||
| -	VHT_GROUP(3, 1, BW_40), | -	VHT_GROUP(3, 1, BW_40), | ||||||
| +	VHT_GROUP(1, 1, BW_40, 4), | - | ||||||
| +	VHT_GROUP(2, 1, BW_40, 4), |  | ||||||
| +	VHT_GROUP(3, 1, BW_40, 4), |  | ||||||
|   |  | ||||||
| -	VHT_GROUP(1, 0, BW_80), | -	VHT_GROUP(1, 0, BW_80), | ||||||
| -	VHT_GROUP(2, 0, BW_80), | -	VHT_GROUP(2, 0, BW_80), | ||||||
| -	VHT_GROUP(3, 0, BW_80), | -	VHT_GROUP(3, 0, BW_80), | ||||||
| +	VHT_GROUP(1, 0, BW_80, 4), | - | ||||||
| +	VHT_GROUP(2, 0, BW_80, 4), |  | ||||||
| +	VHT_GROUP(3, 0, BW_80, 4), |  | ||||||
|   |  | ||||||
| -	VHT_GROUP(1, 1, BW_80), | -	VHT_GROUP(1, 1, BW_80), | ||||||
| -	VHT_GROUP(2, 1, BW_80), | -	VHT_GROUP(2, 1, BW_80), | ||||||
| -	VHT_GROUP(3, 1, BW_80), | -	VHT_GROUP(3, 1, BW_80), | ||||||
|  | +	MCS_GROUP(1, 0, BW_20, 5), | ||||||
|  | +	MCS_GROUP(2, 0, BW_20, 4), | ||||||
|  | +	MCS_GROUP(3, 0, BW_20, 4), | ||||||
|  | + | ||||||
|  | +	MCS_GROUP(1, 1, BW_20, 5), | ||||||
|  | +	MCS_GROUP(2, 1, BW_20, 4), | ||||||
|  | +	MCS_GROUP(3, 1, BW_20, 4), | ||||||
|  | + | ||||||
|  | +	MCS_GROUP(1, 0, BW_40, 4), | ||||||
|  | +	MCS_GROUP(2, 0, BW_40, 4), | ||||||
|  | +	MCS_GROUP(3, 0, BW_40, 4), | ||||||
|  | + | ||||||
|  | +	MCS_GROUP(1, 1, BW_40, 4), | ||||||
|  | +	MCS_GROUP(2, 1, BW_40, 4), | ||||||
|  | +	MCS_GROUP(3, 1, BW_40, 4), | ||||||
|  | + | ||||||
|  | +	CCK_GROUP(8), | ||||||
|  | + | ||||||
|  | +	VHT_GROUP(1, 0, BW_20, 5), | ||||||
|  | +	VHT_GROUP(2, 0, BW_20, 4), | ||||||
|  | +	VHT_GROUP(3, 0, BW_20, 4), | ||||||
|  | + | ||||||
|  | +	VHT_GROUP(1, 1, BW_20, 5), | ||||||
|  | +	VHT_GROUP(2, 1, BW_20, 4), | ||||||
|  | +	VHT_GROUP(3, 1, BW_20, 4), | ||||||
|  | + | ||||||
|  | +	VHT_GROUP(1, 0, BW_40, 4), | ||||||
|  | +	VHT_GROUP(2, 0, BW_40, 4), | ||||||
|  | +	VHT_GROUP(3, 0, BW_40, 4), | ||||||
|  | + | ||||||
|  | +	VHT_GROUP(1, 1, BW_40, 4), | ||||||
|  | +	VHT_GROUP(2, 1, BW_40, 4), | ||||||
|  | +	VHT_GROUP(3, 1, BW_40, 4), | ||||||
|  | + | ||||||
|  | +	VHT_GROUP(1, 0, BW_80, 4), | ||||||
|  | +	VHT_GROUP(2, 0, BW_80, 4), | ||||||
|  | +	VHT_GROUP(3, 0, BW_80, 4), | ||||||
|  | + | ||||||
| +	VHT_GROUP(1, 1, BW_80, 4), | +	VHT_GROUP(1, 1, BW_80, 4), | ||||||
| +	VHT_GROUP(2, 1, BW_80, 4), | +	VHT_GROUP(2, 1, BW_80, 4), | ||||||
| +	VHT_GROUP(3, 1, BW_80, 4), | +	VHT_GROUP(3, 1, BW_80, 4), | ||||||
|   | |||||||
| @@ -23,7 +23,7 @@ Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk> | |||||||
|  |  | ||||||
| --- a/drivers/net/wireless/ath/ath9k/xmit.c | --- a/drivers/net/wireless/ath/ath9k/xmit.c | ||||||
| +++ b/drivers/net/wireless/ath/ath9k/xmit.c | +++ b/drivers/net/wireless/ath/ath9k/xmit.c | ||||||
| @@ -2930,6 +2930,8 @@ void ath_tx_node_cleanup(struct ath_soft | @@ -2915,6 +2915,8 @@ void ath_tx_node_cleanup(struct ath_soft | ||||||
|  	struct ath_txq *txq; |  	struct ath_txq *txq; | ||||||
|  	int tidno; |  	int tidno; | ||||||
|   |   | ||||||
| @@ -32,7 +32,7 @@ Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk> | |||||||
|  	for (tidno = 0; tidno < IEEE80211_NUM_TIDS; tidno++) { |  	for (tidno = 0; tidno < IEEE80211_NUM_TIDS; tidno++) { | ||||||
|  		tid = ath_node_to_tid(an, tidno); |  		tid = ath_node_to_tid(an, tidno); | ||||||
|  		txq = tid->txq; |  		txq = tid->txq; | ||||||
| @@ -2947,6 +2949,8 @@ void ath_tx_node_cleanup(struct ath_soft | @@ -2932,6 +2934,8 @@ void ath_tx_node_cleanup(struct ath_soft | ||||||
|  		if (!an->sta) |  		if (!an->sta) | ||||||
|  			break; /* just one multicast ath_atx_tid */ |  			break; /* just one multicast ath_atx_tid */ | ||||||
|  	} |  	} | ||||||
|   | |||||||
| @@ -103,8 +103,7 @@ | |||||||
| +		      GFP_KERNEL); | +		      GFP_KERNEL); | ||||||
| +	if (!led) | +	if (!led) | ||||||
| +		return -ENOMEM; | +		return -ENOMEM; | ||||||
|   | + | ||||||
| -	ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, val); |  | ||||||
| +	led->gpio = gpio = (struct gpio_led *) (led + 1); | +	led->gpio = gpio = (struct gpio_led *) (led + 1); | ||||||
| +	_name = (char *) (led->gpio + 1); | +	_name = (char *) (led->gpio + 1); | ||||||
| + | + | ||||||
| @@ -117,7 +116,8 @@ | |||||||
| +	ret = ath_add_led(sc, led); | +	ret = ath_add_led(sc, led); | ||||||
| +	if (unlikely(ret < 0)) | +	if (unlikely(ret < 0)) | ||||||
| +		kfree(led); | +		kfree(led); | ||||||
| + |   | ||||||
|  | -	ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, val); | ||||||
| +	return ret; | +	return ret; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -125,11 +125,11 @@ | |||||||
|  { |  { | ||||||
| -	if (!sc->led_registered) | -	if (!sc->led_registered) | ||||||
| -		return; | -		return; | ||||||
| - |  | ||||||
| -	ath_led_brightness(&sc->led_cdev, LED_OFF); |  | ||||||
| -	led_classdev_unregister(&sc->led_cdev); |  | ||||||
| +	struct ath_led *led; | +	struct ath_led *led; | ||||||
|   |   | ||||||
|  | -	ath_led_brightness(&sc->led_cdev, LED_OFF); | ||||||
|  | -	led_classdev_unregister(&sc->led_cdev); | ||||||
|  | - | ||||||
| -	ath9k_hw_gpio_free(sc->sc_ah, sc->sc_ah->led_pin); | -	ath9k_hw_gpio_free(sc->sc_ah, sc->sc_ah->led_pin); | ||||||
| +	while (!list_empty(&sc->leds)) { | +	while (!list_empty(&sc->leds)) { | ||||||
| +		led = list_first_entry(&sc->leds, struct ath_led, list); | +		led = list_first_entry(&sc->leds, struct ath_led, list); | ||||||
|   | |||||||
| @@ -0,0 +1,132 @@ | |||||||
|  | From: Sebastian Gottschall <s.gottsch...@dd-wrt.com> | ||||||
|  |  | ||||||
|  | current handling of peer_bw_rxnss_override parameter is based on guessing the  | ||||||
|  | VHT160/8080 capability by rx rate. this is wrong and may lead | ||||||
|  | to a non initialized peer_bw_rxnss_override parameter which is required since  | ||||||
|  | VHT160 operation mode only supports 2x2 chainmasks in addition the original code | ||||||
|  | initialized the parameter with wrong masked values. | ||||||
|  | This patch uses the peer phymode and peer nss information for correct  | ||||||
|  | initialisation of the peer_bw_rxnss_override parameter. | ||||||
|  | if this peer information is not available, we initialize the parameter by  | ||||||
|  | minimum nss which is suggested by QCA as temporary workaround according | ||||||
|  | to the QCA sourcecodes. | ||||||
|  |  | ||||||
|  | Signed-off-by: Sebastian Gottschall <s.gottsch...@dd-wrt.com> | ||||||
|  |  | ||||||
|  | v2: remove debug messages | ||||||
|  | v3: apply some cosmetics, update documentation | ||||||
|  | v4: fix compile warning and truncate nss to maximum of 2x2 since current  | ||||||
|  | chipsets only support 2x2 at vht160 | ||||||
|  | v5: handle maximum nss for chipsets supportig vht160 with 1x1 only | ||||||
|  | v7: use more simple code variant and take care about hw/sw chainmask  | ||||||
|  | configuration | ||||||
|  | --- | ||||||
|  |  drivers/net/wireless/ath/ath10k/mac.c | 40 +++++++++++++++------------ | ||||||
|  |  drivers/net/wireless/ath/ath10k/wmi.c |  7 +---- | ||||||
|  |  drivers/net/wireless/ath/ath10k/wmi.h | 14 +++++++++- | ||||||
|  |  3 files changed, 36 insertions(+), 25 deletions(-) | ||||||
|  |  | ||||||
|  | --- a/drivers/net/wireless/ath/ath10k/mac.c | ||||||
|  | +++ b/drivers/net/wireless/ath/ath10k/mac.c | ||||||
|  | @@ -2466,7 +2466,7 @@ static void ath10k_peer_assoc_h_vht(stru | ||||||
|  |  	const u16 *vht_mcs_mask; | ||||||
|  |  	u8 ampdu_factor; | ||||||
|  |  	u8 max_nss, vht_mcs; | ||||||
|  | -	int i; | ||||||
|  | +	int i, nss160; | ||||||
|  |   | ||||||
|  |  	if (WARN_ON(ath10k_mac_vif_chan(vif, &def))) | ||||||
|  |  		return; | ||||||
|  | @@ -2526,23 +2526,27 @@ static void ath10k_peer_assoc_h_vht(stru | ||||||
|  |  		__le16_to_cpu(vht_cap->vht_mcs.tx_highest); | ||||||
|  |  	arg->peer_vht_rates.tx_mcs_set = ath10k_peer_assoc_h_vht_limit( | ||||||
|  |  		__le16_to_cpu(vht_cap->vht_mcs.tx_mcs_map), vht_mcs_mask); | ||||||
|  | +	arg->peer_bw_rxnss_override = 0; | ||||||
|  | +	nss160 = 1; /* 1x1 default config for VHT160 */ | ||||||
|  |   | ||||||
|  | -	ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vht peer %pM max_mpdu %d flags 0x%x\n", | ||||||
|  | -		   sta->addr, arg->peer_max_mpdu, arg->peer_flags); | ||||||
|  | - | ||||||
|  | -	if (arg->peer_vht_rates.rx_max_rate && | ||||||
|  | -	    (sta->vht_cap.cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK)) { | ||||||
|  | -		switch (arg->peer_vht_rates.rx_max_rate) { | ||||||
|  | -		case 1560: | ||||||
|  | -			/* Must be 2x2 at 160Mhz is all it can do. */ | ||||||
|  | -			arg->peer_bw_rxnss_override = 2; | ||||||
|  | -			break; | ||||||
|  | -		case 780: | ||||||
|  | -			/* Can only do 1x1 at 160Mhz (Long Guard Interval) */ | ||||||
|  | -			arg->peer_bw_rxnss_override = 1; | ||||||
|  | -			break; | ||||||
|  | -		} | ||||||
|  | +	/* only 4x4 configuration do support 2x2 for VHT160, everything else must use 1x1 */ | ||||||
|  | +	if (ar->cfg_rx_chainmask == 15) | ||||||
|  | +		nss160 = arg->peer_num_spatial_streams <= 2 ? arg->peer_num_spatial_streams : 2; | ||||||
|  | + | ||||||
|  | +	/* in case if peer is connected with vht160 or vht80+80, we need to properly adjust rxnss parameters otherwise firmware will raise a assert */ | ||||||
|  | +	switch(arg->peer_phymode) { | ||||||
|  | +	case MODE_11AC_VHT80_80: | ||||||
|  | +		arg->peer_bw_rxnss_override = BW_NSS_FWCONF_80_80(nss160); | ||||||
|  | +	/* fall through */ | ||||||
|  | +	case MODE_11AC_VHT160: | ||||||
|  | +		arg->peer_bw_rxnss_override |= BW_NSS_FWCONF_160(nss160); | ||||||
|  | +	break; | ||||||
|  | +	default: | ||||||
|  | +	break; | ||||||
|  |  	} | ||||||
|  | + | ||||||
|  | +	ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vht peer %pM max_mpdu %d flags 0x%x peer_bw_rxnss_override 0x%x\n", | ||||||
|  | +		   sta->addr, arg->peer_max_mpdu, arg->peer_flags, arg->peer_bw_rxnss_override); | ||||||
|  |  } | ||||||
|  |   | ||||||
|  |  static void ath10k_peer_assoc_h_qos(struct ath10k *ar, | ||||||
|  | @@ -2694,9 +2698,9 @@ static int ath10k_peer_assoc_prepare(str | ||||||
|  |  	ath10k_peer_assoc_h_crypto(ar, vif, sta, arg); | ||||||
|  |  	ath10k_peer_assoc_h_rates(ar, vif, sta, arg); | ||||||
|  |  	ath10k_peer_assoc_h_ht(ar, vif, sta, arg); | ||||||
|  | +	ath10k_peer_assoc_h_phymode(ar, vif, sta, arg); | ||||||
|  |  	ath10k_peer_assoc_h_vht(ar, vif, sta, arg); | ||||||
|  |  	ath10k_peer_assoc_h_qos(ar, vif, sta, arg); | ||||||
|  | -	ath10k_peer_assoc_h_phymode(ar, vif, sta, arg); | ||||||
|  |   | ||||||
|  |  	return 0; | ||||||
|  |  } | ||||||
|  | --- a/drivers/net/wireless/ath/ath10k/wmi.c | ||||||
|  | +++ b/drivers/net/wireless/ath/ath10k/wmi.c | ||||||
|  | @@ -6760,12 +6760,7 @@ ath10k_wmi_peer_assoc_fill_10_4(struct a | ||||||
|  |  	struct wmi_10_4_peer_assoc_complete_cmd *cmd = buf; | ||||||
|  |   | ||||||
|  |  	ath10k_wmi_peer_assoc_fill_10_2(ar, buf, arg); | ||||||
|  | -	if (arg->peer_bw_rxnss_override) | ||||||
|  | -		cmd->peer_bw_rxnss_override = | ||||||
|  | -			__cpu_to_le32((arg->peer_bw_rxnss_override - 1) | | ||||||
|  | -				      BIT(PEER_BW_RXNSS_OVERRIDE_OFFSET)); | ||||||
|  | -	else | ||||||
|  | -		cmd->peer_bw_rxnss_override = 0; | ||||||
|  | +	cmd->peer_bw_rxnss_override = __cpu_to_le32(arg->peer_bw_rxnss_override); | ||||||
|  |  } | ||||||
|  |   | ||||||
|  |  static int | ||||||
|  | --- a/drivers/net/wireless/ath/ath10k/wmi.h | ||||||
|  | +++ b/drivers/net/wireless/ath/ath10k/wmi.h | ||||||
|  | @@ -6209,7 +6209,19 @@ struct wmi_10_2_peer_assoc_complete_cmd | ||||||
|  |  	__le32 info0; /* WMI_PEER_ASSOC_INFO0_ */ | ||||||
|  |  } __packed; | ||||||
|  |   | ||||||
|  | -#define PEER_BW_RXNSS_OVERRIDE_OFFSET  31 | ||||||
|  | +#define BW_NSS_FWCONF_MAP_ENABLE             (1 << 31) | ||||||
|  | +#define BW_NSS_FWCONF_MAP_160MHZ_S           (0) | ||||||
|  | +#define BW_NSS_FWCONF_MAP_160MHZ_M           (0x00000007) | ||||||
|  | +#define BW_NSS_FWCONF_MAP_80_80MHZ_S         (3) | ||||||
|  | +#define BW_NSS_FWCONF_MAP_80_80MHZ_M         (0x00000038) | ||||||
|  | +#define BW_NSS_FWCONF_MAP_M                  (0x0000003F) | ||||||
|  | + | ||||||
|  | +#define GET_BW_NSS_FWCONF_160(x)             ((((x) & BW_NSS_FWCONF_MAP_160MHZ_M) >> BW_NSS_FWCONF_MAP_160MHZ_S) + 1) | ||||||
|  | +#define GET_BW_NSS_FWCONF_80_80(x)           ((((x) & BW_NSS_FWCONF_MAP_80_80MHZ_M) >> BW_NSS_FWCONF_MAP_80_80MHZ_S) + 1) | ||||||
|  | + | ||||||
|  | +/* Values defined to set 160 MHz Bandwidth NSS Mapping into FW*/ | ||||||
|  | +#define BW_NSS_FWCONF_160(x)          (BW_NSS_FWCONF_MAP_ENABLE | (((x - 1) << BW_NSS_FWCONF_MAP_160MHZ_S) & BW_NSS_FWCONF_MAP_160MHZ_M)) | ||||||
|  | +#define BW_NSS_FWCONF_80_80(x)        (BW_NSS_FWCONF_MAP_ENABLE | (((x - 1) << BW_NSS_FWCONF_MAP_80_80MHZ_S) & BW_NSS_FWCONF_MAP_80_80MHZ_M)) | ||||||
|  |   | ||||||
|  |  struct wmi_10_4_peer_assoc_complete_cmd { | ||||||
|  |  	struct wmi_10_2_peer_assoc_complete_cmd cmd; | ||||||
| @@ -0,0 +1,50 @@ | |||||||
|  | From: Sebastian Gottschall <s.gottschall@dd-wrt.com> | ||||||
|  |  | ||||||
|  | starting with firmware 10.4.3.4.x series QCA changed the handling of the channel property band_center_freq1 and band_center_freq2 in vht160 operation mode | ||||||
|  | likelly for backward compatiblity with vht80 only capable clients. | ||||||
|  | this patch adjusts the handling to get vht160 to work again with official qca firmwares newer than 3.3 | ||||||
|  | consider that this patch will not work with older firmwares anymore. to avoid undefined behaviour this we disable vht160 capability for outdated firmwares | ||||||
|  | --- | ||||||
|  |  drivers/net/wireless/ath/ath10k/mac.c |  7 ------- | ||||||
|  |  drivers/net/wireless/ath/ath10k/wmi.c | 11 ++++++++--- | ||||||
|  |  2 files changed, 8 insertions(+), 10 deletions(-) | ||||||
|  | --- a/drivers/net/wireless/ath/ath10k/mac.c | ||||||
|  | +++ b/drivers/net/wireless/ath/ath10k/mac.c | ||||||
|  | @@ -4415,13 +4415,6 @@ static struct ieee80211_sta_vht_cap ath1 | ||||||
|  |  		vht_cap.cap |= val; | ||||||
|  |  	} | ||||||
|  |   | ||||||
|  | -	/* Currently the firmware seems to be buggy, don't enable 80+80 | ||||||
|  | -	 * mode until that's resolved. | ||||||
|  | -	 */ | ||||||
|  | -	if ((ar->vht_cap_info & IEEE80211_VHT_CAP_SHORT_GI_160) && | ||||||
|  | -	    (ar->vht_cap_info & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK) == 0) | ||||||
|  | -		vht_cap.cap |= IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ; | ||||||
|  | - | ||||||
|  |  	mcs_map = 0; | ||||||
|  |  	for (i = 0; i < 8; i++) { | ||||||
|  |  		if ((i < ar->num_rf_chains) && (ar->cfg_tx_chainmask & BIT(i))) | ||||||
|  | --- a/drivers/net/wireless/ath/ath10k/wmi.c | ||||||
|  | +++ b/drivers/net/wireless/ath/ath10k/wmi.c | ||||||
|  | @@ -1660,13 +1660,18 @@ void ath10k_wmi_put_wmi_channel(struct w | ||||||
|  |  		flags |= WMI_CHAN_FLAG_HT40_PLUS; | ||||||
|  |  	if (arg->chan_radar) | ||||||
|  |  		flags |= WMI_CHAN_FLAG_DFS; | ||||||
|  | - | ||||||
|  | +	ch->band_center_freq2 = 0; | ||||||
|  |  	ch->mhz = __cpu_to_le32(arg->freq); | ||||||
|  |  	ch->band_center_freq1 = __cpu_to_le32(arg->band_center_freq1); | ||||||
|  |  	if (arg->mode == MODE_11AC_VHT80_80) | ||||||
|  |  		ch->band_center_freq2 = __cpu_to_le32(arg->band_center_freq2); | ||||||
|  | -	else | ||||||
|  | -		ch->band_center_freq2 = 0; | ||||||
|  | +	if (arg->mode == MODE_11AC_VHT160)  { | ||||||
|  | +		if (arg->freq < arg->band_center_freq1) | ||||||
|  | +			ch->band_center_freq1 = __cpu_to_le32(arg->band_center_freq1 - 40); | ||||||
|  | +		else | ||||||
|  | +			ch->band_center_freq1 = __cpu_to_le32(arg->band_center_freq1 + 40);		 | ||||||
|  | +		ch->band_center_freq2 = __cpu_to_le32(arg->band_center_freq1); | ||||||
|  | +	} | ||||||
|  |  	ch->min_power = arg->min_power; | ||||||
|  |  	ch->max_power = arg->max_power; | ||||||
|  |  	ch->reg_power = arg->max_reg_power; | ||||||
| @@ -0,0 +1,643 @@ | |||||||
|  | From: Sebastian Gottschall <s.gottschall@newmedia-net.de> | ||||||
|  |  | ||||||
|  | Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984 based | ||||||
|  | chipsets with on chipset connected led's using WMI Firmware API.  The LED | ||||||
|  | device will get available named as "ath10k-phyX" at sysfs and can be controlled | ||||||
|  | with various triggers.  adds also debugfs interface for gpio control. | ||||||
|  |  | ||||||
|  | This patch is specific for OpenWRt base, as is use old backported package | ||||||
|  | with old wireless source. Support for QCA9984 is removed and a simbol | ||||||
|  | is added to local-simbol file to export the actually compile the code  | ||||||
|  | with the ATH10K_LEDS simbol. | ||||||
|  |  | ||||||
|  |  | ||||||
|  | Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> | ||||||
|  | Reviewed-by: Steve deRosier <derosier@cal-sierra.com> | ||||||
|  | [kvalo: major reorg and cleanup] | ||||||
|  | Signed-off-by: Kalle Valo <kvalo@codeaurora.org> | ||||||
|  | Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | v13: | ||||||
|  |  | ||||||
|  | * only compile tested! | ||||||
|  |  | ||||||
|  | * fix all checkpatch warnings | ||||||
|  |  | ||||||
|  | * fix commit log | ||||||
|  |  | ||||||
|  | * sizeof(struct ath10k_gpiocontrol) -> sizeof(*gpio) | ||||||
|  |  | ||||||
|  | * unsigned -> unsigned int | ||||||
|  |  | ||||||
|  | * remove GPIOLIB code, that should be added in a separate patch | ||||||
|  |  | ||||||
|  | * rename gpio.c to leds.c | ||||||
|  |  | ||||||
|  | * add leds.h | ||||||
|  |  | ||||||
|  | * rename some functions: | ||||||
|  |  | ||||||
|  |   ath10k_attach_led() -> ath10k_leds_register() | ||||||
|  |   ath10k_unregister_led() -> ath10k_leds_unregister() | ||||||
|  |   ath10k_reset_led_pin() -> ath10k_leds_start() | ||||||
|  |  | ||||||
|  | * call ath10k_leds_unregister() before ath10k_thermal_unregister() to preserve ordering | ||||||
|  |  | ||||||
|  | * call ath10k_leds_start() only from ath10k_core_start() and not from mac.c | ||||||
|  |  | ||||||
|  | * rename struct ath10k_gpiocontrol as anonymous function under struct | ||||||
|  |   ath10k::leds, no need for memory allocation | ||||||
|  |  | ||||||
|  | * merge ath10k_add_led() to ath10k_attach_led(), which is it's only caller | ||||||
|  |  | ||||||
|  | * remove #if IS_ENABLED() checks from most of places, memory savings from those were not worth it | ||||||
|  |  | ||||||
|  | * Kconfig help text improvement and move it lower in the menu, also don't enable it by default | ||||||
|  |  | ||||||
|  | * switch to set_brightness_blocking() so that the callback can sleep, | ||||||
|  |   then no need to use ath10k_wmi_cmd_send_nowait() and can take mutex | ||||||
|  |   to access ar->state | ||||||
|  |  | ||||||
|  | * don't touch ath10k_wmi_pdev_get_temperature() | ||||||
|  |  | ||||||
|  | * as QCA6174/QCA9377 are not (yet) supported don't add the command to WMI-TLV interface | ||||||
|  |  | ||||||
|  | * remove debugfs interface, that should be added in another patch | ||||||
|  |  | ||||||
|  | * cleanup includes | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  drivers/net/wireless/ath/ath10k/Kconfig   |  10 +++ | ||||||
|  |  drivers/net/wireless/ath/ath10k/Makefile  |   1 + | ||||||
|  |  drivers/net/wireless/ath/ath10k/core.c    |  22 +++++++ | ||||||
|  |  drivers/net/wireless/ath/ath10k/core.h    |   9 ++- | ||||||
|  |  drivers/net/wireless/ath/ath10k/hw.h      |   1 + | ||||||
|  |  drivers/net/wireless/ath/ath10k/leds.c    | 103 ++++++++++++++++++++++++++++++ | ||||||
|  |  drivers/net/wireless/ath/ath10k/leds.h    |  45 +++++++++++++ | ||||||
|  |  drivers/net/wireless/ath/ath10k/mac.c     |   1 + | ||||||
|  |  drivers/net/wireless/ath/ath10k/wmi-ops.h |  32 ++++++++++ | ||||||
|  |  drivers/net/wireless/ath/ath10k/wmi-tlv.c |   2 + | ||||||
|  |  drivers/net/wireless/ath/ath10k/wmi.c     |  54 ++++++++++++++++ | ||||||
|  |  drivers/net/wireless/ath/ath10k/wmi.h     |  35 ++++++++++ | ||||||
|  |  12 files changed, 314 insertions(+), 1 deletion(-) | ||||||
|  |  create mode 100644 drivers/net/wireless/ath/ath10k/leds.c | ||||||
|  |  create mode 100644 drivers/net/wireless/ath/ath10k/leds.h | ||||||
|  | Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/Kconfig | ||||||
|  | =================================================================== | ||||||
|  | --- backports-2017-11-01.orig/drivers/net/wireless/ath/ath10k/Kconfig | ||||||
|  | +++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/Kconfig | ||||||
|  | @@ -56,6 +56,16 @@ config ATH10K_DEBUGFS | ||||||
|  |   | ||||||
|  |  	  If unsure, say Y to make it easier to debug problems. | ||||||
|  |   | ||||||
|  | +config ATH10K_LEDS | ||||||
|  | +	bool "Atheros ath10k LED support" | ||||||
|  | +	depends on ATH10K | ||||||
|  | +	select MAC80211_LEDS | ||||||
|  | +	select LEDS_CLASS | ||||||
|  | +	select NEW_LEDS | ||||||
|  | +	default y | ||||||
|  | +	---help--- | ||||||
|  | +	  This option is necessary, if you want LED support for chipset connected led pins. If unsure, say N. | ||||||
|  | + | ||||||
|  |  config ATH10K_SPECTRAL | ||||||
|  |  	bool "Atheros ath10k spectral scan support" | ||||||
|  |  	depends on ATH10K_DEBUGFS | ||||||
|  | Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/Makefile | ||||||
|  | =================================================================== | ||||||
|  | --- backports-2017-11-01.orig/drivers/net/wireless/ath/ath10k/Makefile | ||||||
|  | +++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/Makefile | ||||||
|  | @@ -18,6 +18,7 @@ ath10k_core-$(CPTCFG_ATH10K_SPECTRAL) += | ||||||
|  |  ath10k_core-$(CPTCFG_NL80211_TESTMODE) += testmode.o | ||||||
|  |  ath10k_core-$(CPTCFG_ATH10K_TRACING) += trace.o | ||||||
|  |  ath10k_core-$(CPTCFG_ATH10K_THERMAL) += thermal.o | ||||||
|  | +ath10k_core-$(CPTCFG_ATH10K_LEDS) += leds.o | ||||||
|  |  ath10k_core-$(CPTCFG_MAC80211_DEBUGFS) += debugfs_sta.o | ||||||
|  |  ath10k_core-$(CONFIG_PM) += wow.o | ||||||
|  |   | ||||||
|  | Index: backports-2017-11-01/local-symbols | ||||||
|  | =================================================================== | ||||||
|  | --- backports-2017-11-01.orig/local-symbols | ||||||
|  | +++ backports-2017-11-01/local-symbols | ||||||
|  | @@ -143,6 +143,7 @@ ATH10K_USB= | ||||||
|  |  ATH10K_DEBUG= | ||||||
|  |  ATH10K_DEBUGFS= | ||||||
|  |  ATH10K_SPECTRAL= | ||||||
|  | +ATH10K_LEDS= | ||||||
|  |  ATH10K_TRACING= | ||||||
|  |  ATH10K_DFS_CERTIFIED= | ||||||
|  |  WCN36XX= | ||||||
|  | Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/core.c | ||||||
|  | =================================================================== | ||||||
|  | --- backports-2017-11-01.orig/drivers/net/wireless/ath/ath10k/core.c | ||||||
|  | +++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/core.c | ||||||
|  | @@ -32,6 +32,7 @@ | ||||||
|  |  #include "htt.h" | ||||||
|  |  #include "testmode.h" | ||||||
|  |  #include "wmi-ops.h" | ||||||
|  | +#include "leds.h" | ||||||
|  |   | ||||||
|  |  unsigned int ath10k_debug_mask; | ||||||
|  |  static unsigned int ath10k_cryptmode_param; | ||||||
|  | @@ -56,6 +57,7 @@ static const struct ath10k_hw_params ath | ||||||
|  |  		.id = QCA988X_HW_2_0_VERSION, | ||||||
|  |  		.dev_id = QCA988X_2_0_DEVICE_ID, | ||||||
|  |  		.name = "qca988x hw2.0", | ||||||
|  | +		.led_pin = 1, | ||||||
|  |  		.patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, | ||||||
|  |  		.uart_pin = 7, | ||||||
|  |  		.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, | ||||||
|  | @@ -80,6 +82,7 @@ static const struct ath10k_hw_params ath | ||||||
|  |  		.id = QCA9887_HW_1_0_VERSION, | ||||||
|  |  		.dev_id = QCA9887_1_0_DEVICE_ID, | ||||||
|  |  		.name = "qca9887 hw1.0", | ||||||
|  | +		.led_pin = 1, | ||||||
|  |  		.patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR, | ||||||
|  |  		.uart_pin = 7, | ||||||
|  |  		.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, | ||||||
|  | @@ -199,6 +202,7 @@ static const struct ath10k_hw_params ath | ||||||
|  |  		.id = QCA99X0_HW_2_0_DEV_VERSION, | ||||||
|  |  		.dev_id = QCA99X0_2_0_DEVICE_ID, | ||||||
|  |  		.name = "qca99x0 hw2.0", | ||||||
|  | +		.led_pin = 17, | ||||||
|  |  		.patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR, | ||||||
|  |  		.uart_pin = 7, | ||||||
|  |  		.otp_exe_param = 0x00000700, | ||||||
|  | @@ -228,6 +232,7 @@ static const struct ath10k_hw_params ath | ||||||
|  |  		.id = QCA9984_HW_1_0_DEV_VERSION, | ||||||
|  |  		.dev_id = QCA9984_1_0_DEVICE_ID, | ||||||
|  |  		.name = "qca9984/qca9994 hw1.0", | ||||||
|  | +		.led_pin = 17, | ||||||
|  |  		.patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR, | ||||||
|  |  		.uart_pin = 7, | ||||||
|  |  		.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, | ||||||
|  | @@ -262,6 +267,7 @@ static const struct ath10k_hw_params ath | ||||||
|  |  		.id = QCA9888_HW_2_0_DEV_VERSION, | ||||||
|  |  		.dev_id = QCA9888_2_0_DEVICE_ID, | ||||||
|  |  		.name = "qca9888 hw2.0", | ||||||
|  | +		.led_pin = 17, | ||||||
|  |  		.patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, | ||||||
|  |  		.uart_pin = 7, | ||||||
|  |  		.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, | ||||||
|  | @@ -2254,6 +2260,10 @@ int ath10k_core_start(struct ath10k *ar, | ||||||
|  |  	if (status) | ||||||
|  |  		goto err_hif_stop; | ||||||
|  |   | ||||||
|  | +	status = ath10k_leds_start(ar); | ||||||
|  | +	if (status) | ||||||
|  | +		goto err_hif_stop; | ||||||
|  | + | ||||||
|  |  	return 0; | ||||||
|  |   | ||||||
|  |  err_hif_stop: | ||||||
|  | @@ -2471,9 +2481,18 @@ static void ath10k_core_register_work(st | ||||||
|  |  		goto err_spectral_destroy; | ||||||
|  |  	} | ||||||
|  |   | ||||||
|  | +	status = ath10k_leds_register(ar); | ||||||
|  | +	if (status) { | ||||||
|  | +		ath10k_err(ar, "could not register leds: %d\n", | ||||||
|  | +			   status); | ||||||
|  | +		goto err_thermal_unregister; | ||||||
|  | +	} | ||||||
|  | + | ||||||
|  |  	set_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags); | ||||||
|  |  	return; | ||||||
|  |   | ||||||
|  | +err_thermal_unregister: | ||||||
|  | +	ath10k_thermal_unregister(ar); | ||||||
|  |  err_spectral_destroy: | ||||||
|  |  	ath10k_spectral_destroy(ar); | ||||||
|  |  err_debug_destroy: | ||||||
|  | @@ -2515,6 +2534,8 @@ void ath10k_core_unregister(struct ath10 | ||||||
|  |  	if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags)) | ||||||
|  |  		return; | ||||||
|  |   | ||||||
|  | +	ath10k_leds_unregister(ar); | ||||||
|  | + | ||||||
|  |  	ath10k_thermal_unregister(ar); | ||||||
|  |  	/* Stop spectral before unregistering from mac80211 to remove the | ||||||
|  |  	 * relayfs debugfs file cleanly. Otherwise the parent debugfs tree | ||||||
|  | Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/core.h | ||||||
|  | =================================================================== | ||||||
|  | --- backports-2017-11-01.orig/drivers/net/wireless/ath/ath10k/core.h | ||||||
|  | +++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/core.h | ||||||
|  | @@ -24,6 +24,7 @@ | ||||||
|  |  #include <linux/pci.h> | ||||||
|  |  #include <linux/uuid.h> | ||||||
|  |  #include <linux/time.h> | ||||||
|  | +#include <linux/leds.h> | ||||||
|  |   | ||||||
|  |  #include "htt.h" | ||||||
|  |  #include "htc.h" | ||||||
|  | @@ -789,7 +790,6 @@ struct ath10k { | ||||||
|  |  	u32 low_5ghz_chan; | ||||||
|  |  	u32 high_5ghz_chan; | ||||||
|  |  	bool ani_enabled; | ||||||
|  | - | ||||||
|  |  	bool p2p; | ||||||
|  |   | ||||||
|  |  	struct { | ||||||
|  | @@ -972,6 +972,13 @@ struct ath10k { | ||||||
|  |  	} testmode; | ||||||
|  |   | ||||||
|  |  	struct { | ||||||
|  | +		struct gpio_led wifi_led; | ||||||
|  | +		struct led_classdev cdev; | ||||||
|  | +		char label[48]; | ||||||
|  | +		u32 gpio_state_pin; | ||||||
|  | +	} leds; | ||||||
|  | + | ||||||
|  | +	struct { | ||||||
|  |  		/* protected by data_lock */ | ||||||
|  |  		u32 fw_crash_counter; | ||||||
|  |  		u32 fw_warm_reset_counter; | ||||||
|  | Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/hw.h | ||||||
|  | =================================================================== | ||||||
|  | --- backports-2017-11-01.orig/drivers/net/wireless/ath/ath10k/hw.h | ||||||
|  | +++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/hw.h | ||||||
|  | @@ -490,6 +490,7 @@ struct ath10k_hw_params { | ||||||
|  |  	const char *name; | ||||||
|  |  	u32 patch_load_addr; | ||||||
|  |  	int uart_pin; | ||||||
|  | +	int led_pin; | ||||||
|  |  	u32 otp_exe_param; | ||||||
|  |   | ||||||
|  |  	/* Type of hw cycle counter wraparound logic, for more info | ||||||
|  | Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/leds.c | ||||||
|  | =================================================================== | ||||||
|  | --- /dev/null | ||||||
|  | +++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/leds.c | ||||||
|  | @@ -0,0 +1,103 @@ | ||||||
|  | +/* | ||||||
|  | + * Copyright (c) 2005-2011 Atheros Communications Inc. | ||||||
|  | + * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. | ||||||
|  | + * Copyright (c) 2018 Sebastian Gottschall <s.gottschall@dd-wrt.com> | ||||||
|  | + * Copyright (c) 2018, The Linux Foundation. All rights reserved. | ||||||
|  | + * | ||||||
|  | + * Permission to use, copy, modify, and/or distribute this software for any | ||||||
|  | + * purpose with or without fee is hereby granted, provided that the above | ||||||
|  | + * copyright notice and this permission notice appear in all copies. | ||||||
|  | + * | ||||||
|  | + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||||||
|  | + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||||||
|  | + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||||||
|  | + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||||||
|  | + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||||||
|  | + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||||||
|  | + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||||||
|  | + */ | ||||||
|  | + | ||||||
|  | +#include <linux/leds.h> | ||||||
|  | + | ||||||
|  | +#include "core.h" | ||||||
|  | +#include "wmi.h" | ||||||
|  | +#include "wmi-ops.h" | ||||||
|  | + | ||||||
|  | +#include "leds.h" | ||||||
|  | + | ||||||
|  | +static int ath10k_leds_set_brightness_blocking(struct led_classdev *led_cdev, | ||||||
|  | +					       enum led_brightness brightness) | ||||||
|  | +{ | ||||||
|  | +	struct ath10k *ar = container_of(led_cdev, struct ath10k, | ||||||
|  | +					 leds.cdev); | ||||||
|  | +	struct gpio_led *led = &ar->leds.wifi_led; | ||||||
|  | + | ||||||
|  | +	mutex_lock(&ar->conf_mutex); | ||||||
|  | + | ||||||
|  | +	if (ar->state != ATH10K_STATE_ON) | ||||||
|  | +		goto out; | ||||||
|  | + | ||||||
|  | +	ar->leds.gpio_state_pin = (brightness != LED_OFF) ^ led->active_low; | ||||||
|  | +	ath10k_wmi_gpio_output(ar, led->gpio, ar->leds.gpio_state_pin); | ||||||
|  | + | ||||||
|  | +out: | ||||||
|  | +	mutex_unlock(&ar->conf_mutex); | ||||||
|  | + | ||||||
|  | +	return 0; | ||||||
|  | +} | ||||||
|  | + | ||||||
|  | +int ath10k_leds_start(struct ath10k *ar) | ||||||
|  | +{ | ||||||
|  | +	if (ar->hw_params.led_pin == 0) | ||||||
|  | +		/* leds not supported */ | ||||||
|  | +		return 0; | ||||||
|  | + | ||||||
|  | +	/* under some circumstances, the gpio pin gets reconfigured | ||||||
|  | +	 * to default state by the firmware, so we need to | ||||||
|  | +	 * reconfigure it this behaviour has only ben seen on | ||||||
|  | +	 * QCA9984 and QCA99XX devices so far | ||||||
|  | +	 */ | ||||||
|  | +	ath10k_wmi_gpio_config(ar, ar->hw_params.led_pin, 0, | ||||||
|  | +			       WMI_GPIO_PULL_NONE, WMI_GPIO_INTTYPE_DISABLE); | ||||||
|  | +	ath10k_wmi_gpio_output(ar, ar->hw_params.led_pin, 1); | ||||||
|  | + | ||||||
|  | +	return 0; | ||||||
|  | +} | ||||||
|  | + | ||||||
|  | +int ath10k_leds_register(struct ath10k *ar) | ||||||
|  | +{ | ||||||
|  | +	int ret; | ||||||
|  | + | ||||||
|  | +	if (ar->hw_params.led_pin == 0) | ||||||
|  | +		/* leds not supported */ | ||||||
|  | +		return 0; | ||||||
|  | + | ||||||
|  | +	snprintf(ar->leds.label, sizeof(ar->leds.label), "ath10k-%s", | ||||||
|  | +		 wiphy_name(ar->hw->wiphy)); | ||||||
|  | +	ar->leds.wifi_led.active_low = 1; | ||||||
|  | +	ar->leds.wifi_led.gpio = ar->hw_params.led_pin; | ||||||
|  | +	ar->leds.wifi_led.name = ar->leds.label; | ||||||
|  | +	ar->leds.wifi_led.default_state = LEDS_GPIO_DEFSTATE_KEEP; | ||||||
|  | + | ||||||
|  | +	ar->leds.cdev.name = ar->leds.label; | ||||||
|  | +	ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking; | ||||||
|  | + | ||||||
|  | +	/* FIXME: this assignment doesn't make sense as it's NULL, remove it? */ | ||||||
|  | +	ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger; | ||||||
|  | + | ||||||
|  | +	ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev); | ||||||
|  | +	if (ret) | ||||||
|  | +		return ret; | ||||||
|  | + | ||||||
|  | +	return 0; | ||||||
|  | +} | ||||||
|  | + | ||||||
|  | +void ath10k_leds_unregister(struct ath10k *ar) | ||||||
|  | +{ | ||||||
|  | +	if (ar->hw_params.led_pin == 0) | ||||||
|  | +		/* leds not supported */ | ||||||
|  | +		return; | ||||||
|  | + | ||||||
|  | +	led_classdev_unregister(&ar->leds.cdev); | ||||||
|  | +} | ||||||
|  | + | ||||||
|  | Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/leds.h | ||||||
|  | =================================================================== | ||||||
|  | --- /dev/null | ||||||
|  | +++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/leds.h | ||||||
|  | @@ -0,0 +1,41 @@ | ||||||
|  | +/* | ||||||
|  | + * Copyright (c) 2018, The Linux Foundation. All rights reserved. | ||||||
|  | + * | ||||||
|  | + * Permission to use, copy, modify, and/or distribute this software for any | ||||||
|  | + * purpose with or without fee is hereby granted, provided that the above | ||||||
|  | + * copyright notice and this permission notice appear in all copies. | ||||||
|  | + * | ||||||
|  | + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||||||
|  | + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||||||
|  | + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||||||
|  | + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||||||
|  | + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||||||
|  | + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||||||
|  | + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||||||
|  | + */ | ||||||
|  | +#ifndef _LEDS_H_ | ||||||
|  | +#define _LEDS_H_ | ||||||
|  | + | ||||||
|  | +#include "core.h" | ||||||
|  | + | ||||||
|  | +#ifdef CPTCFG_ATH10K_LEDS | ||||||
|  | +void ath10k_leds_unregister(struct ath10k *ar); | ||||||
|  | +int ath10k_leds_start(struct ath10k *ar); | ||||||
|  | +int ath10k_leds_register(struct ath10k *ar); | ||||||
|  | +#else | ||||||
|  | +static inline void ath10k_leds_unregister(struct ath10k *ar) | ||||||
|  | +{ | ||||||
|  | +} | ||||||
|  | + | ||||||
|  | +static inline int ath10k_leds_start(struct ath10k *ar) | ||||||
|  | +{ | ||||||
|  | +	return 0; | ||||||
|  | +} | ||||||
|  | + | ||||||
|  | +static inline int ath10k_leds_register(struct ath10k *ar) | ||||||
|  | +{ | ||||||
|  | +	return 0; | ||||||
|  | +} | ||||||
|  | + | ||||||
|  | +#endif | ||||||
|  | +#endif /* _LEDS_H_ */ | ||||||
|  | Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/mac.c | ||||||
|  | =================================================================== | ||||||
|  | --- backports-2017-11-01.orig/drivers/net/wireless/ath/ath10k/mac.c | ||||||
|  | +++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/mac.c | ||||||
|  | @@ -32,6 +32,7 @@ | ||||||
|  |  #include "wmi-tlv.h" | ||||||
|  |  #include "wmi-ops.h" | ||||||
|  |  #include "wow.h" | ||||||
|  | +#include "leds.h" | ||||||
|  |   | ||||||
|  |  /*********/ | ||||||
|  |  /* Rates */ | ||||||
|  | Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/wmi-ops.h | ||||||
|  | =================================================================== | ||||||
|  | --- backports-2017-11-01.orig/drivers/net/wireless/ath/ath10k/wmi-ops.h | ||||||
|  | +++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/wmi-ops.h | ||||||
|  | @@ -197,6 +197,10 @@ struct wmi_ops { | ||||||
|  |  					(struct ath10k *ar, | ||||||
|  |  					 enum wmi_bss_survey_req_type type); | ||||||
|  |  	struct sk_buff *(*gen_echo)(struct ath10k *ar, u32 value); | ||||||
|  | +	struct sk_buff *(*gen_gpio_config)(struct ath10k *ar, u32 gpio_num, | ||||||
|  | +					   u32 input, u32 pull_type, u32 intr_mode); | ||||||
|  | +  | ||||||
|  | +	struct sk_buff *(*gen_gpio_output)(struct ath10k *ar, u32 gpio_num, u32 set); | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  |  int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id); | ||||||
|  | @@ -951,6 +955,35 @@ ath10k_wmi_force_fw_hang(struct ath10k * | ||||||
|  |  	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid); | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | +static inline int ath10k_wmi_gpio_config(struct ath10k *ar, u32 gpio_num, | ||||||
|  | +					 u32 input, u32 pull_type, u32 intr_mode) | ||||||
|  | +{ | ||||||
|  | +	struct sk_buff *skb; | ||||||
|  | + | ||||||
|  | +	if (!ar->wmi.ops->gen_gpio_config) | ||||||
|  | +		return -EOPNOTSUPP; | ||||||
|  | + | ||||||
|  | +	skb = ar->wmi.ops->gen_gpio_config(ar, gpio_num, input, pull_type, intr_mode); | ||||||
|  | +	if (IS_ERR(skb)) | ||||||
|  | +		return PTR_ERR(skb); | ||||||
|  | + | ||||||
|  | +	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_config_cmdid); | ||||||
|  | +} | ||||||
|  | + | ||||||
|  | +static inline int ath10k_wmi_gpio_output(struct ath10k *ar, u32 gpio_num, u32 set) | ||||||
|  | +{ | ||||||
|  | +	struct sk_buff *skb; | ||||||
|  | + | ||||||
|  | +	if (!ar->wmi.ops->gen_gpio_config) | ||||||
|  | +		return -EOPNOTSUPP; | ||||||
|  | + | ||||||
|  | +	skb = ar->wmi.ops->gen_gpio_output(ar, gpio_num, set); | ||||||
|  | +	if (IS_ERR(skb)) | ||||||
|  | +		return PTR_ERR(skb); | ||||||
|  | + | ||||||
|  | +	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_output_cmdid); | ||||||
|  | +} | ||||||
|  | + | ||||||
|  |  static inline int | ||||||
|  |  ath10k_wmi_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level) | ||||||
|  |  { | ||||||
|  | Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/wmi-tlv.c | ||||||
|  | =================================================================== | ||||||
|  | --- backports-2017-11-01.orig/drivers/net/wireless/ath/ath10k/wmi-tlv.c | ||||||
|  | +++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/wmi-tlv.c | ||||||
|  | @@ -3619,6 +3619,8 @@ static const struct wmi_ops wmi_tlv_ops | ||||||
|  |  	.gen_echo = ath10k_wmi_tlv_op_gen_echo, | ||||||
|  |  	.gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf, | ||||||
|  |  	.gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable, | ||||||
|  | +	/* .gen_gpio_config not implemented */ | ||||||
|  | +	/* .gen_gpio_output not implemented */ | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  |  static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = { | ||||||
|  | Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/wmi.c | ||||||
|  | =================================================================== | ||||||
|  | --- backports-2017-11-01.orig/drivers/net/wireless/ath/ath10k/wmi.c | ||||||
|  | +++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/wmi.c | ||||||
|  | @@ -6580,6 +6580,49 @@ ath10k_wmi_op_gen_peer_set_param(struct | ||||||
|  |  	return skb; | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | +static struct sk_buff *ath10k_wmi_op_gen_gpio_config(struct ath10k *ar, | ||||||
|  | +						     u32 gpio_num, u32 input, | ||||||
|  | +						     u32 pull_type, u32 intr_mode) | ||||||
|  | +{ | ||||||
|  | +	struct wmi_gpio_config_cmd *cmd; | ||||||
|  | +	struct sk_buff *skb; | ||||||
|  | + | ||||||
|  | +	skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); | ||||||
|  | +	if (!skb) | ||||||
|  | +		return ERR_PTR(-ENOMEM); | ||||||
|  | + | ||||||
|  | +	cmd = (struct wmi_gpio_config_cmd *)skb->data; | ||||||
|  | +	cmd->pull_type = __cpu_to_le32(pull_type); | ||||||
|  | +	cmd->gpio_num = __cpu_to_le32(gpio_num); | ||||||
|  | +	cmd->input = __cpu_to_le32(input); | ||||||
|  | +	cmd->intr_mode = __cpu_to_le32(intr_mode); | ||||||
|  | + | ||||||
|  | +	ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_config gpio_num 0x%08x input 0x%08x pull_type 0x%08x intr_mode 0x%08x\n", | ||||||
|  | +		   gpio_num, input, pull_type, intr_mode); | ||||||
|  | + | ||||||
|  | +	return skb; | ||||||
|  | +} | ||||||
|  | + | ||||||
|  | +static struct sk_buff *ath10k_wmi_op_gen_gpio_output(struct ath10k *ar, | ||||||
|  | +						     u32 gpio_num, u32 set) | ||||||
|  | +{ | ||||||
|  | +	struct wmi_gpio_output_cmd *cmd; | ||||||
|  | +	struct sk_buff *skb; | ||||||
|  | + | ||||||
|  | +	skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); | ||||||
|  | +	if (!skb) | ||||||
|  | +		return ERR_PTR(-ENOMEM); | ||||||
|  | + | ||||||
|  | +	cmd = (struct wmi_gpio_output_cmd *)skb->data; | ||||||
|  | +	cmd->gpio_num = __cpu_to_le32(gpio_num); | ||||||
|  | +	cmd->set = __cpu_to_le32(set); | ||||||
|  | + | ||||||
|  | +	ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_output gpio_num 0x%08x set 0x%08x\n", | ||||||
|  | +		   gpio_num, set); | ||||||
|  | + | ||||||
|  | +	return skb; | ||||||
|  | +} | ||||||
|  | + | ||||||
|  |  static struct sk_buff * | ||||||
|  |  ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id, | ||||||
|  |  			     enum wmi_sta_ps_mode psmode) | ||||||
|  | @@ -8081,6 +8124,9 @@ static const struct wmi_ops wmi_ops = { | ||||||
|  |  	.fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill, | ||||||
|  |  	.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, | ||||||
|  |  	.gen_echo = ath10k_wmi_op_gen_echo, | ||||||
|  | +	.gen_gpio_config = ath10k_wmi_op_gen_gpio_config, | ||||||
|  | +	.gen_gpio_output = ath10k_wmi_op_gen_gpio_output, | ||||||
|  | + | ||||||
|  |  	/* .gen_bcn_tmpl not implemented */ | ||||||
|  |  	/* .gen_prb_tmpl not implemented */ | ||||||
|  |  	/* .gen_p2p_go_bcn_ie not implemented */ | ||||||
|  | @@ -8151,6 +8197,8 @@ static const struct wmi_ops wmi_10_1_ops | ||||||
|  |  	.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, | ||||||
|  |  	.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, | ||||||
|  |  	.gen_echo = ath10k_wmi_op_gen_echo, | ||||||
|  | +	.gen_gpio_config = ath10k_wmi_op_gen_gpio_config, | ||||||
|  | +	.gen_gpio_output = ath10k_wmi_op_gen_gpio_output, | ||||||
|  |  	/* .gen_bcn_tmpl not implemented */ | ||||||
|  |  	/* .gen_prb_tmpl not implemented */ | ||||||
|  |  	/* .gen_p2p_go_bcn_ie not implemented */ | ||||||
|  | @@ -8222,6 +8270,8 @@ static const struct wmi_ops wmi_10_2_ops | ||||||
|  |  	.gen_delba_send = ath10k_wmi_op_gen_delba_send, | ||||||
|  |  	.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, | ||||||
|  |  	.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, | ||||||
|  | +	.gen_gpio_config = ath10k_wmi_op_gen_gpio_config, | ||||||
|  | +	.gen_gpio_output = ath10k_wmi_op_gen_gpio_output, | ||||||
|  |  	/* .gen_pdev_enable_adaptive_cca not implemented */ | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  | @@ -8292,6 +8342,8 @@ static const struct wmi_ops wmi_10_2_4_o | ||||||
|  |  	.gen_pdev_enable_adaptive_cca = | ||||||
|  |  		ath10k_wmi_op_gen_pdev_enable_adaptive_cca, | ||||||
|  |  	.get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype, | ||||||
|  | +	.gen_gpio_config = ath10k_wmi_op_gen_gpio_config, | ||||||
|  | +	.gen_gpio_output = ath10k_wmi_op_gen_gpio_output, | ||||||
|  |  	/* .gen_bcn_tmpl not implemented */ | ||||||
|  |  	/* .gen_prb_tmpl not implemented */ | ||||||
|  |  	/* .gen_p2p_go_bcn_ie not implemented */ | ||||||
|  | @@ -8367,6 +8419,8 @@ static const struct wmi_ops wmi_10_4_ops | ||||||
|  |  	.gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info, | ||||||
|  |  	.gen_echo = ath10k_wmi_op_gen_echo, | ||||||
|  |  	.gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config, | ||||||
|  | +	.gen_gpio_config = ath10k_wmi_op_gen_gpio_config, | ||||||
|  | +	.gen_gpio_output = ath10k_wmi_op_gen_gpio_output, | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  |  int ath10k_wmi_attach(struct ath10k *ar) | ||||||
|  | Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/wmi.h | ||||||
|  | =================================================================== | ||||||
|  | --- backports-2017-11-01.orig/drivers/net/wireless/ath/ath10k/wmi.h | ||||||
|  | +++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/wmi.h | ||||||
|  | @@ -2899,6 +2899,41 @@ enum wmi_10_4_feature_mask { | ||||||
|  |   | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  | +/* WMI_GPIO_CONFIG_CMDID */ | ||||||
|  | +enum { | ||||||
|  | +	WMI_GPIO_PULL_NONE, | ||||||
|  | +	WMI_GPIO_PULL_UP, | ||||||
|  | +	WMI_GPIO_PULL_DOWN, | ||||||
|  | +}; | ||||||
|  | + | ||||||
|  | +enum { | ||||||
|  | +	WMI_GPIO_INTTYPE_DISABLE, | ||||||
|  | +	WMI_GPIO_INTTYPE_RISING_EDGE, | ||||||
|  | +	WMI_GPIO_INTTYPE_FALLING_EDGE, | ||||||
|  | +	WMI_GPIO_INTTYPE_BOTH_EDGE, | ||||||
|  | +	WMI_GPIO_INTTYPE_LEVEL_LOW, | ||||||
|  | +	WMI_GPIO_INTTYPE_LEVEL_HIGH | ||||||
|  | +}; | ||||||
|  | + | ||||||
|  | +/* WMI_GPIO_CONFIG_CMDID */ | ||||||
|  | +struct wmi_gpio_config_cmd { | ||||||
|  | +	__le32 gpio_num;             /* GPIO number to be setup */ | ||||||
|  | +	__le32 input;                /* 0 - Output/ 1 - Input */ | ||||||
|  | +	__le32 pull_type;            /* Pull type defined above */ | ||||||
|  | +	__le32 intr_mode;            /* Interrupt mode defined above (Input) */ | ||||||
|  | +} __packed; | ||||||
|  | + | ||||||
|  | +/* WMI_GPIO_OUTPUT_CMDID */ | ||||||
|  | +struct wmi_gpio_output_cmd { | ||||||
|  | +	__le32 gpio_num;    /* GPIO number to be setup */ | ||||||
|  | +	__le32 set;         /* Set the GPIO pin*/ | ||||||
|  | +} __packed; | ||||||
|  | + | ||||||
|  | +/* WMI_GPIO_INPUT_EVENTID */ | ||||||
|  | +struct wmi_gpio_input_event { | ||||||
|  | +	__le32 gpio_num;    /* GPIO number which changed state */ | ||||||
|  | +} __packed; | ||||||
|  | + | ||||||
|  |  struct wmi_ext_resource_config_10_4_cmd { | ||||||
|  |  	/* contains enum wmi_host_platform_type */ | ||||||
|  |  	__le32 host_platform_config; | ||||||
| @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= | |||||||
|  |  | ||||||
| PKG_SOURCE_URL:=https://github.com/openwrt/mt76 | PKG_SOURCE_URL:=https://github.com/openwrt/mt76 | ||||||
| PKG_SOURCE_PROTO:=git | PKG_SOURCE_PROTO:=git | ||||||
| PKG_SOURCE_DATE:=2018-04-18 | PKG_SOURCE_DATE:=2018-06-19 | ||||||
| PKG_SOURCE_VERSION:=e2eedc9229dad9b9d653ad0abb4f3571d1676148 | PKG_SOURCE_VERSION:=1d4ca10a562b6d9eaec3aaa5f3905804070ae743 | ||||||
| PKG_MIRROR_HASH:=5bf8879814ffb498228a070e5f8ebedd06cbf4c286a7875e8616d26f154be6ac | PKG_MIRROR_HASH:=5906436e8fecd2d7d70328a9aa27c6598c242ea3bc8922ed4ec7245a3ff861cd | ||||||
|  |  | ||||||
| PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name> | PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name> | ||||||
| PKG_BUILD_PARALLEL:=1 | PKG_BUILD_PARALLEL:=1 | ||||||
|   | |||||||
| @@ -14,8 +14,7 @@ PKG_RELEASE:=1 | |||||||
| PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 | ||||||
| PKG_SOURCE_URL:= \ | PKG_SOURCE_URL:= \ | ||||||
| 	http://www.netfilter.org/projects/libnfnetlink/files/ \ | 	http://www.netfilter.org/projects/libnfnetlink/files/ \ | ||||||
| 	ftp://ftp.netfilter.org/pub/libnfnetlink/ \ | 	ftp://ftp.netfilter.org/pub/libnfnetlink/ | ||||||
| 	http://mirrors.evolva.ro/netfilter.org/libnfnetlink/ |  | ||||||
| PKG_HASH:=f270e19de9127642d2a11589ef2ec97ef90a649a74f56cf9a96306b04817b51a | PKG_HASH:=f270e19de9127642d2a11589ef2ec97ef90a649a74f56cf9a96306b04817b51a | ||||||
| PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io> | PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io> | ||||||
| PKG_LICENSE:=GPL-2.0+ | PKG_LICENSE:=GPL-2.0+ | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| #!/bin/sh /etc/rc.common | #!/bin/sh /etc/rc.common | ||||||
| # Copyright (C) 2012 OpenWrt.org | # Copyright (C) 2012 OpenWrt.org | ||||||
|  |  | ||||||
| START=49 | START=97 | ||||||
| USE_PROCD=1 | USE_PROCD=1 | ||||||
|  |  | ||||||
| EXTRA_COMMANDS="status lucistat" | EXTRA_COMMANDS="status lucistat" | ||||||
|   | |||||||
| @@ -1,8 +1,7 @@ | |||||||
| #!/bin/sh /etc/rc.common | #!/bin/sh /etc/rc.common | ||||||
| # Copyright (C) 2012 OpenWrt.org | # Copyright (C) 2012 OpenWrt.org | ||||||
|  |  | ||||||
| # needs to start before the atm layer which starts at 50 | START=97 | ||||||
| START=48 |  | ||||||
| USE_PROCD=1 | USE_PROCD=1 | ||||||
|  |  | ||||||
| EXTRA_COMMANDS="status lucistat" | EXTRA_COMMANDS="status lucistat" | ||||||
|   | |||||||
| @@ -5,9 +5,9 @@ PKG_RELEASE:=1 | |||||||
|  |  | ||||||
| PKG_SOURCE_PROTO:=git | PKG_SOURCE_PROTO:=git | ||||||
| PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git | PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git | ||||||
| PKG_SOURCE_DATE:=2018-04-26 | PKG_SOURCE_DATE:=2018-05-30 | ||||||
| PKG_SOURCE_VERSION:=56cecedb261808f5ea700b92b97590f7fa16de9c | PKG_SOURCE_VERSION:=a580028dae5b7bebcc14c240fe7dac31cbd89355 | ||||||
| PKG_MIRROR_HASH:=65c3950122778489a5825bcf384251f7271fd6537a7245ae6909bb8347a32b9e | PKG_MIRROR_HASH:=41a645bc322c6a444bcc74cd099af6aead30924594aecf4e433204f8524a470e | ||||||
| PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name> | PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name> | ||||||
|  |  | ||||||
| PKG_LICENSE:=GPL-2.0 | PKG_LICENSE:=GPL-2.0 | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk | |||||||
|  |  | ||||||
| PKG_NAME:=ds-lite | PKG_NAME:=ds-lite | ||||||
| PKG_VERSION:=7 | PKG_VERSION:=7 | ||||||
| PKG_RELEASE:=2 | PKG_RELEASE:=3 | ||||||
| PKG_LICENSE:=GPL-2.0 | PKG_LICENSE:=GPL-2.0 | ||||||
|  |  | ||||||
| include $(INCLUDE_DIR)/package.mk | include $(INCLUDE_DIR)/package.mk | ||||||
|   | |||||||
							
								
								
									
										8
									
								
								package/network/ipv6/ds-lite/files/dslite.sh
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										8
									
								
								package/network/ipv6/ds-lite/files/dslite.sh
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							| @@ -15,8 +15,8 @@ proto_dslite_setup() { | |||||||
| 	local link="ds-$cfg" | 	local link="ds-$cfg" | ||||||
| 	local remoteip6 | 	local remoteip6 | ||||||
|  |  | ||||||
| 	local mtu ttl peeraddr ip6addr tunlink zone weakif | 	local mtu ttl peeraddr ip6addr tunlink zone weakif encaplimit | ||||||
| 	json_get_vars mtu ttl peeraddr ip6addr tunlink zone weakif | 	json_get_vars mtu ttl peeraddr ip6addr tunlink zone weakif encaplimit | ||||||
|  |  | ||||||
| 	[ -z "$peeraddr" ] && { | 	[ -z "$peeraddr" ] && { | ||||||
| 		proto_notify_error "$cfg" "MISSING_ADDRESS" | 		proto_notify_error "$cfg" "MISSING_ADDRESS" | ||||||
| @@ -68,6 +68,9 @@ proto_dslite_setup() { | |||||||
| 	json_add_string local "$ip6addr" | 	json_add_string local "$ip6addr" | ||||||
| 	json_add_string remote "$peeraddr" | 	json_add_string remote "$peeraddr" | ||||||
| 	[ -n "$tunlink" ] && json_add_string link "$tunlink" | 	[ -n "$tunlink" ] && json_add_string link "$tunlink" | ||||||
|  | 	json_add_object "data" | ||||||
|  | 	  json_add_string encaplimit "${encaplimit:-4}" | ||||||
|  | 	json_close_object | ||||||
| 	proto_close_tunnel | 	proto_close_tunnel | ||||||
|  |  | ||||||
| 	proto_add_data | 	proto_add_data | ||||||
| @@ -97,6 +100,7 @@ proto_dslite_init_config() { | |||||||
| 	proto_config_add_string "tunlink" | 	proto_config_add_string "tunlink" | ||||||
| 	proto_config_add_int "mtu" | 	proto_config_add_int "mtu" | ||||||
| 	proto_config_add_int "ttl" | 	proto_config_add_int "ttl" | ||||||
|  | 	proto_config_add_string "encaplimit" | ||||||
| 	proto_config_add_string "zone" | 	proto_config_add_string "zone" | ||||||
| 	proto_config_add_string "weakif" | 	proto_config_add_string "weakif" | ||||||
| } | } | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk | |||||||
|  |  | ||||||
| PKG_NAME:=map | PKG_NAME:=map | ||||||
| PKG_VERSION:=4 | PKG_VERSION:=4 | ||||||
| PKG_RELEASE:=10 | PKG_RELEASE:=11 | ||||||
| PKG_LICENSE:=GPL-2.0 | PKG_LICENSE:=GPL-2.0 | ||||||
|  |  | ||||||
| include $(INCLUDE_DIR)/package.mk | include $(INCLUDE_DIR)/package.mk | ||||||
|   | |||||||
| @@ -28,9 +28,9 @@ proto_map_setup() { | |||||||
| 	# uncomment for legacy MAP0 mode | 	# uncomment for legacy MAP0 mode | ||||||
| 	#export LEGACY=1 | 	#export LEGACY=1 | ||||||
|  |  | ||||||
| 	local type mtu ttl tunlink zone | 	local type mtu ttl tunlink zone encaplimit | ||||||
| 	local rule ipaddr ip4prefixlen ip6prefix ip6prefixlen peeraddr ealen psidlen psid offset | 	local rule ipaddr ip4prefixlen ip6prefix ip6prefixlen peeraddr ealen psidlen psid offset | ||||||
| 	json_get_vars type mtu ttl tunlink zone | 	json_get_vars type mtu ttl tunlink zone encaplimit | ||||||
| 	json_get_vars rule ipaddr ip4prefixlen ip6prefix ip6prefixlen peeraddr ealen psidlen psid offset | 	json_get_vars rule ipaddr ip4prefixlen ip6prefix ip6prefixlen peeraddr ealen psidlen psid offset | ||||||
|  |  | ||||||
| 	[ -z "$zone" ] && zone="wan" | 	[ -z "$zone" ] && zone="wan" | ||||||
| @@ -84,9 +84,9 @@ proto_map_setup() { | |||||||
| 		json_add_string local $(eval "echo \$RULE_${k}_IPV6ADDR") | 		json_add_string local $(eval "echo \$RULE_${k}_IPV6ADDR") | ||||||
| 		json_add_string remote $(eval "echo \$RULE_${k}_BR") | 		json_add_string remote $(eval "echo \$RULE_${k}_BR") | ||||||
| 		json_add_string link $(eval "echo \$RULE_${k}_PD6IFACE") | 		json_add_string link $(eval "echo \$RULE_${k}_PD6IFACE") | ||||||
|  |  | ||||||
| 		if [ "$type" = "map-e" ]; then |  | ||||||
| 		json_add_object "data" | 		json_add_object "data" | ||||||
|  | 			json_add_string encaplimit "${encaplimit:-4}" | ||||||
|  | 			if [ "$type" = "map-e" ]; then | ||||||
| 				json_add_array "fmrs" | 				json_add_array "fmrs" | ||||||
| 				for i in $(seq $RULE_COUNT); do | 				for i in $(seq $RULE_COUNT); do | ||||||
| 					[ "$(eval "echo \$RULE_${i}_FMR")" != 1 ] && continue | 					[ "$(eval "echo \$RULE_${i}_FMR")" != 1 ] && continue | ||||||
| @@ -98,8 +98,9 @@ proto_map_setup() { | |||||||
| 					json_close_object | 					json_close_object | ||||||
| 				done | 				done | ||||||
| 				json_close_array | 				json_close_array | ||||||
| 			json_close_object |  | ||||||
| 			fi | 			fi | ||||||
|  | 		json_close_object | ||||||
|  |  | ||||||
|  |  | ||||||
| 		proto_close_tunnel | 		proto_close_tunnel | ||||||
| 	elif [ "$type" = "map-t" -a -f "/proc/net/nat46/control" ]; then | 	elif [ "$type" = "map-t" -a -f "/proc/net/nat46/control" ]; then | ||||||
| @@ -229,6 +230,7 @@ proto_map_init_config() { | |||||||
| 	proto_config_add_int "mtu" | 	proto_config_add_int "mtu" | ||||||
| 	proto_config_add_int "ttl" | 	proto_config_add_int "ttl" | ||||||
| 	proto_config_add_string "zone" | 	proto_config_add_string "zone" | ||||||
|  | 	proto_config_add_string "encaplimit" | ||||||
| } | } | ||||||
|  |  | ||||||
| [ -n "$INCLUDE_ONLY" ] || { | [ -n "$INCLUDE_ONLY" ] || { | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
| include $(TOPDIR)/rules.mk | include $(TOPDIR)/rules.mk | ||||||
|  |  | ||||||
| PKG_NAME:=odhcp6c | PKG_NAME:=odhcp6c | ||||||
| PKG_RELEASE:=11 | PKG_RELEASE:=12 | ||||||
|  |  | ||||||
| PKG_SOURCE_PROTO:=git | PKG_SOURCE_PROTO:=git | ||||||
| PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git | PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git | ||||||
|   | |||||||
| @@ -170,6 +170,7 @@ setup_interface () { | |||||||
| 		json_add_string tunlink "$INTERFACE" | 		json_add_string tunlink "$INTERFACE" | ||||||
| 		[ -n "$ZONE_MAP" ] || ZONE_MAP=$ZONE | 		[ -n "$ZONE_MAP" ] || ZONE_MAP=$ZONE | ||||||
| 		[ -n "$ZONE_MAP" ] && json_add_string zone "$ZONE_MAP" | 		[ -n "$ZONE_MAP" ] && json_add_string zone "$ZONE_MAP" | ||||||
|  | 		[ -n "$ENCAPLIMIT_MAP" ] && json_add_string encaplimit "$ENCAPLIMIT_MAP" | ||||||
| 		[ -n "$IFACE_MAP_DELEGATE" ] && json_add_boolean delegate "$IFACE_MAP_DELEGATE" | 		[ -n "$IFACE_MAP_DELEGATE" ] && json_add_boolean delegate "$IFACE_MAP_DELEGATE" | ||||||
| 		json_close_object | 		json_close_object | ||||||
| 		ubus call network add_dynamic "$(json_dump)" | 		ubus call network add_dynamic "$(json_dump)" | ||||||
| @@ -183,6 +184,7 @@ setup_interface () { | |||||||
| 		json_add_string tunlink "$INTERFACE" | 		json_add_string tunlink "$INTERFACE" | ||||||
| 		[ -n "$ZONE_DSLITE" ] || ZONE_DSLITE=$ZONE | 		[ -n "$ZONE_DSLITE" ] || ZONE_DSLITE=$ZONE | ||||||
| 		[ -n "$ZONE_DSLITE" ] && json_add_string zone "$ZONE_DSLITE" | 		[ -n "$ZONE_DSLITE" ] && json_add_string zone "$ZONE_DSLITE" | ||||||
|  | 		[ -n "$ENCAPLIMIT_DSLITE" ] && json_add_string encaplimit "$ENCAPLIMIT_DSLITE" | ||||||
| 		[ -n "$IFACE_DSLITE_DELEGATE" ] && json_add_boolean delegate "$IFACE_DSLITE_DELEGATE" | 		[ -n "$IFACE_DSLITE_DELEGATE" ] && json_add_boolean delegate "$IFACE_DSLITE_DELEGATE" | ||||||
| 		json_close_object | 		json_close_object | ||||||
| 		ubus call network add_dynamic "$(json_dump)" | 		ubus call network add_dynamic "$(json_dump)" | ||||||
|   | |||||||
| @@ -19,8 +19,10 @@ proto_dhcpv6_init_config() { | |||||||
| 	proto_config_add_array 'ip6prefix:list(ip6addr)' | 	proto_config_add_array 'ip6prefix:list(ip6addr)' | ||||||
| 	proto_config_add_string iface_dslite | 	proto_config_add_string iface_dslite | ||||||
| 	proto_config_add_string zone_dslite | 	proto_config_add_string zone_dslite | ||||||
|  | 	proto_config_add_string encaplimit_dslite | ||||||
| 	proto_config_add_string iface_map | 	proto_config_add_string iface_map | ||||||
| 	proto_config_add_string zone_map | 	proto_config_add_string zone_map | ||||||
|  | 	proto_config_add_string encaplimit_map | ||||||
| 	proto_config_add_string iface_464xlat | 	proto_config_add_string iface_464xlat | ||||||
| 	proto_config_add_string zone_464xlat | 	proto_config_add_string zone_464xlat | ||||||
| 	proto_config_add_string zone | 	proto_config_add_string zone | ||||||
| @@ -48,8 +50,8 @@ proto_dhcpv6_setup() { | |||||||
| 	local config="$1" | 	local config="$1" | ||||||
| 	local iface="$2" | 	local iface="$2" | ||||||
|  |  | ||||||
| 	local reqaddress reqprefix clientid reqopts defaultreqopts noslaaconly forceprefix extendprefix norelease ip6prefix ip6prefixes iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass sendopts delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff | 	local reqaddress reqprefix clientid reqopts defaultreqopts noslaaconly forceprefix extendprefix norelease ip6prefix ip6prefixes iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass sendopts delegate zone_dslite zone_map zone_464xlat zone encaplimit_dslite encaplimit_map soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff | ||||||
| 	json_get_vars reqaddress reqprefix clientid reqopts defaultreqopts noslaaconly forceprefix extendprefix norelease 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 defaultreqopts noslaaconly forceprefix extendprefix norelease iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone encaplimit_dslite encaplimit_map soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff | ||||||
| 	json_for_each_item proto_dhcpv6_add_prefix ip6prefix ip6prefixes | 	json_for_each_item proto_dhcpv6_add_prefix ip6prefix ip6prefixes | ||||||
|  |  | ||||||
| 	# Configure | 	# Configure | ||||||
| @@ -98,6 +100,8 @@ proto_dhcpv6_setup() { | |||||||
| 	[ -n "$zone_map" ] && proto_export "ZONE_MAP=$zone_map" | 	[ -n "$zone_map" ] && proto_export "ZONE_MAP=$zone_map" | ||||||
| 	[ -n "$zone_464xlat" ] && proto_export "ZONE_464XLAT=$zone_464xlat" | 	[ -n "$zone_464xlat" ] && proto_export "ZONE_464XLAT=$zone_464xlat" | ||||||
| 	[ -n "$zone" ] && proto_export "ZONE=$zone" | 	[ -n "$zone" ] && proto_export "ZONE=$zone" | ||||||
|  | 	[ -n "$encaplimit_dslite" ] && proto_export "ENCAPLIMIT_DSLITE=$encaplimit_dslite" | ||||||
|  | 	[ -n "$encaplimit_map" ] && proto_export "ENCAPLIMIT_MAP=$encaplimit_map" | ||||||
| 	[ "$fakeroutes" != "0" ] && proto_export "FAKE_ROUTES=1" | 	[ "$fakeroutes" != "0" ] && proto_export "FAKE_ROUTES=1" | ||||||
| 	[ "$sourcefilter" = "0" ] && proto_export "NOSOURCEFILTER=1" | 	[ "$sourcefilter" = "0" ] && proto_export "NOSOURCEFILTER=1" | ||||||
| 	[ "$extendprefix" = "1" ] && proto_export "EXTENDPREFIX=1" | 	[ "$extendprefix" = "1" ] && proto_export "EXTENDPREFIX=1" | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk | |||||||
|  |  | ||||||
| PKG_NAME:=dnsmasq | PKG_NAME:=dnsmasq | ||||||
| PKG_VERSION:=2.80test2 | PKG_VERSION:=2.80test2 | ||||||
| PKG_RELEASE:=1 | PKG_RELEASE:=3 | ||||||
|  |  | ||||||
| PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz | ||||||
| PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/test-releases | PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/test-releases | ||||||
|   | |||||||
| @@ -941,8 +941,9 @@ dnsmasq_start() | |||||||
| 	xappend "--addn-hosts=$(dirname $HOSTFILE)" | 	xappend "--addn-hosts=$(dirname $HOSTFILE)" | ||||||
|  |  | ||||||
| 	config_get dnsmasqconfdir "$cfg" confdir "/tmp/dnsmasq.d" | 	config_get dnsmasqconfdir "$cfg" confdir "/tmp/dnsmasq.d" | ||||||
| 	[ ! -d "$dnsmasqconfdir" ] && mkdir -p $dnsmasqconfdir |  | ||||||
| 	xappend "--conf-dir=$dnsmasqconfdir" | 	xappend "--conf-dir=$dnsmasqconfdir" | ||||||
|  | 	dnsmasqconfdir="${dnsmasqconfdir%%,*}" | ||||||
|  | 	[ ! -d "$dnsmasqconfdir" ] && mkdir -p $dnsmasqconfdir | ||||||
| 	xappend "--user=dnsmasq" | 	xappend "--user=dnsmasq" | ||||||
| 	xappend "--group=dnsmasq" | 	xappend "--group=dnsmasq" | ||||||
| 	echo >> $CONFIGFILE_TMP | 	echo >> $CONFIGFILE_TMP | ||||||
| @@ -1060,18 +1061,10 @@ service_triggers() | |||||||
| 	config_foreach add_interface_trigger dhcp | 	config_foreach add_interface_trigger dhcp | ||||||
| } | } | ||||||
|  |  | ||||||
| boot() |  | ||||||
| { |  | ||||||
| 	BOOT=1 |  | ||||||
| 	start "$@" |  | ||||||
| } |  | ||||||
|  |  | ||||||
| start_service() { | start_service() { | ||||||
| 	local instance="$1" | 	local instance="$1" | ||||||
| 	local instance_found=0 | 	local instance_found=0 | ||||||
|  |  | ||||||
| 	[ -n "$BOOT" ] && return |  | ||||||
|  |  | ||||||
| 	. /lib/functions/network.sh | 	. /lib/functions/network.sh | ||||||
|  |  | ||||||
| 	config_cb() { | 	config_cb() { | ||||||
|   | |||||||
| @@ -422,25 +422,30 @@ hostapd_set_bss_options() { | |||||||
| 		set_default ieee80211r 0 | 		set_default ieee80211r 0 | ||||||
|  |  | ||||||
| 		if [ "$ieee80211r" -gt "0" ]; then | 		if [ "$ieee80211r" -gt "0" ]; then | ||||||
| 			json_get_vars mobility_domain r0_key_lifetime r1_key_holder \ | 			json_get_vars mobility_domain ft_psk_generate_local ft_over_ds reassociation_deadline | ||||||
| 				reassociation_deadline pmk_r1_push ft_psk_generate_local ft_over_ds | 			 | ||||||
|  | 			set_default mobility_domain "$(echo "$ssid" | md5sum | head -c 4)" | ||||||
|  | 			set_default ft_psk_generate_local 1 | ||||||
|  | 			set_default ft_over_ds 1 | ||||||
|  | 			set_default reassociation_deadline 1000 | ||||||
|  |  | ||||||
|  | 			append bss_conf "mobility_domain=$mobility_domain" "$N" | ||||||
|  | 			append bss_conf "ft_psk_generate_local=$ft_psk_generate_local" "$N" | ||||||
|  | 			append bss_conf "ft_over_ds=$ft_over_ds" "$N" | ||||||
|  | 			append bss_conf "reassociation_deadline=$reassociation_deadline" "$N" | ||||||
|  | 			[ -n "$nasid" ] || append bss_conf "nas_identifier=${macaddr//\:}" "$N" | ||||||
|  |  | ||||||
|  | 			if [ "$ft_psk_generate_local" -eq "0" ]; then | ||||||
|  | 				json_get_vars r0_key_lifetime r1_key_holder pmk_r1_push | ||||||
| 				json_get_values r0kh r0kh | 				json_get_values r0kh r0kh | ||||||
| 				json_get_values r1kh r1kh | 				json_get_values r1kh r1kh | ||||||
|  |  | ||||||
| 			set_default mobility_domain "4f57" |  | ||||||
| 				set_default r0_key_lifetime 10000 | 				set_default r0_key_lifetime 10000 | ||||||
| 			set_default reassociation_deadline 1000 |  | ||||||
| 				set_default pmk_r1_push 0 | 				set_default pmk_r1_push 0 | ||||||
| 			set_default ft_psk_generate_local 0 |  | ||||||
| 			set_default ft_over_ds 1 |  | ||||||
|  |  | ||||||
| 			append bss_conf "mobility_domain=$mobility_domain" "$N" |  | ||||||
| 			append bss_conf "r0_key_lifetime=$r0_key_lifetime" "$N" |  | ||||||
| 				[ -n "$r1_key_holder" ] && append bss_conf "r1_key_holder=$r1_key_holder" "$N" | 				[ -n "$r1_key_holder" ] && append bss_conf "r1_key_holder=$r1_key_holder" "$N" | ||||||
| 			append bss_conf "reassociation_deadline=$reassociation_deadline" "$N" | 				append bss_conf "r0_key_lifetime=$r0_key_lifetime" "$N" | ||||||
| 				append bss_conf "pmk_r1_push=$pmk_r1_push" "$N" | 				append bss_conf "pmk_r1_push=$pmk_r1_push" "$N" | ||||||
| 			append bss_conf "ft_psk_generate_local=$ft_psk_generate_local" "$N" |  | ||||||
| 			append bss_conf "ft_over_ds=$ft_over_ds" "$N" |  | ||||||
|  |  | ||||||
| 				for kh in $r0kh; do | 				for kh in $r0kh; do | ||||||
| 					append bss_conf "r0kh=${kh//,/ }" "$N" | 					append bss_conf "r0kh=${kh//,/ }" "$N" | ||||||
| @@ -449,6 +454,7 @@ hostapd_set_bss_options() { | |||||||
| 					append bss_conf "r1kh=${kh//,/ }" "$N" | 					append bss_conf "r1kh=${kh//,/ }" "$N" | ||||||
| 				done | 				done | ||||||
| 			fi | 			fi | ||||||
|  | 		fi | ||||||
|  |  | ||||||
| 		append bss_conf "wpa_disable_eapol_key_retries=$wpa_disable_eapol_key_retries" "$N" | 		append bss_conf "wpa_disable_eapol_key_retries=$wpa_disable_eapol_key_retries" "$N" | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| # | # | ||||||
| # Copyright (C) 2016-2017 Jason A. Donenfeld <Jason@zx2c4.com> | # Copyright (C) 2016-2018 Jason A. Donenfeld <Jason@zx2c4.com> | ||||||
| # Copyright (C) 2016 Baptiste Jonglez <openwrt@bitsofnetworks.org> | # Copyright (C) 2016 Baptiste Jonglez <openwrt@bitsofnetworks.org> | ||||||
| # Copyright (C) 2016-2017 Dan Luedtke <mail@danrl.com> | # Copyright (C) 2016-2017 Dan Luedtke <mail@danrl.com> | ||||||
| # | # | ||||||
| @@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk | |||||||
|  |  | ||||||
| PKG_NAME:=wireguard | PKG_NAME:=wireguard | ||||||
|  |  | ||||||
| PKG_VERSION:=0.0.20180513 | PKG_VERSION:=0.0.20180620 | ||||||
| PKG_RELEASE:=1 | PKG_RELEASE:=1 | ||||||
|  |  | ||||||
| PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz | PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz | ||||||
| PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/ | PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/ | ||||||
| PKG_HASH:=28a15c59f6710851587ebca76a335f1aaaa077aad052732e0959f2bae9ba8d5c | PKG_HASH:=b4db98ea751c8e667454f98ea1c15d704a784fe1bc093b03bd64575418a7c242 | ||||||
|  |  | ||||||
| PKG_LICENSE:=GPL-2.0 Apache-2.0 | PKG_LICENSE:=GPL-2.0 Apache-2.0 | ||||||
| PKG_LICENSE_FILES:=COPYING | PKG_LICENSE_FILES:=COPYING | ||||||
| @@ -35,9 +35,8 @@ define Package/wireguard/Default | |||||||
|   CATEGORY:=Network |   CATEGORY:=Network | ||||||
|   SUBMENU:=VPN |   SUBMENU:=VPN | ||||||
|   URL:=https://www.wireguard.com |   URL:=https://www.wireguard.com | ||||||
|   MAINTAINER:=Baptiste Jonglez <openwrt@bitsofnetworks.org>, \ |   MAINTAINER:=Jason A. Donenfeld <Jason@zx2c4.com> \ | ||||||
|               Dan Luedtke <mail@danrl.com>, \ |               Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk> | ||||||
|               Jason A. Donenfeld <Jason@zx2c4.com> |  | ||||||
| endef | endef | ||||||
|  |  | ||||||
| define Package/wireguard/Default/description | define Package/wireguard/Default/description | ||||||
| @@ -60,6 +59,7 @@ include $(INCLUDE_DIR)/package-defaults.mk | |||||||
|  |  | ||||||
| # Used by Build/Compile/Default | # Used by Build/Compile/Default | ||||||
| MAKE_PATH:=src/tools | MAKE_PATH:=src/tools | ||||||
|  | MAKE_VARS += PLATFORM=linux | ||||||
|  |  | ||||||
| define Build/Compile | define Build/Compile | ||||||
| 	$(MAKE) $(KERNEL_MAKEOPTS) M="$(PKG_BUILD_DIR)/src" modules | 	$(MAKE) $(KERNEL_MAKEOPTS) M="$(PKG_BUILD_DIR)/src" modules | ||||||
|   | |||||||
| @@ -1,18 +0,0 @@ | |||||||
| tools: fix portability issue |  | ||||||
|  |  | ||||||
| Check if the compiler defines __linux__, instead of assuming that the |  | ||||||
| host OS is the same as the target OS. |  | ||||||
|  |  | ||||||
| Signed-off-by: Felix Fietkau <nbd@nbd.name> |  | ||||||
| --- |  | ||||||
| --- a/src/tools/Makefile |  | ||||||
| +++ b/src/tools/Makefile |  | ||||||
| @@ -43,7 +43,7 @@ CFLAGS += -DRUNSTATEDIR="\"$(RUNSTATEDIR |  | ||||||
|  ifeq ($(DEBUG_TOOLS),y) |  | ||||||
|  CFLAGS += -g |  | ||||||
|  endif |  | ||||||
| -ifeq ($(shell uname -s),Linux) |  | ||||||
| +ifeq ($(strip $(shell echo __linux__ | $(CC) -E - | grep -v '^\#')),1) |  | ||||||
|  LIBMNL_CFLAGS := $(shell $(PKG_CONFIG) --cflags libmnl 2>/dev/null) |  | ||||||
|  LIBMNL_LDLIBS := $(shell $(PKG_CONFIG) --libs libmnl 2>/dev/null || echo -lmnl) |  | ||||||
|  CFLAGS += $(LIBMNL_CFLAGS) |  | ||||||
| @@ -8,15 +8,15 @@ | |||||||
| include $(TOPDIR)/rules.mk | include $(TOPDIR)/rules.mk | ||||||
|  |  | ||||||
| PKG_NAME:=curl | PKG_NAME:=curl | ||||||
| PKG_VERSION:=7.59.0 | PKG_VERSION:=7.60.0 | ||||||
| PKG_RELEASE:=2 | PKG_RELEASE:=1 | ||||||
|  |  | ||||||
| PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz | ||||||
| PKG_SOURCE_URL:=https://dl.uxnr.de/mirror/curl/ \ | PKG_SOURCE_URL:=https://dl.uxnr.de/mirror/curl/ \ | ||||||
| 	http://curl.mirror.anstey.ca/ \ | 	http://curl.mirror.anstey.ca/ \ | ||||||
| 	http://curl.askapache.com/download/ \ | 	http://curl.askapache.com/download/ \ | ||||||
| 	https://curl.haxx.se/download/ | 	https://curl.haxx.se/download/ | ||||||
| PKG_HASH:=e44eaabdf916407585bf5c7939ff1161e6242b6b015d3f2f5b758b2a330461fc | PKG_HASH:=8736ff8ded89ddf7e926eec7b16f82597d029fc1469f3a551f1fafaac164e6a0 | ||||||
|  |  | ||||||
| PKG_LICENSE:=MIT | PKG_LICENSE:=MIT | ||||||
| PKG_LICENSE_FILES:=COPYING | PKG_LICENSE_FILES:=COPYING | ||||||
|   | |||||||
| @@ -6,6 +6,6 @@ | |||||||
|  { |  { | ||||||
| -  unsigned int version = mbedtls_version_get_number(); | -  unsigned int version = mbedtls_version_get_number(); | ||||||
| +  unsigned int version = MBEDTLS_VERSION_NUMBER; | +  unsigned int version = MBEDTLS_VERSION_NUMBER; | ||||||
|    return snprintf(buffer, size, "mbedTLS/%d.%d.%d", version>>24, |    return snprintf(buffer, size, "mbedTLS/%u.%u.%u", version>>24, | ||||||
|                    (version>>16)&0xff, (version>>8)&0xff); |                    (version>>16)&0xff, (version>>8)&0xff); | ||||||
|  } |  } | ||||||
|   | |||||||
| @@ -1,11 +0,0 @@ | |||||||
| --- a/lib/vtls/mbedtls.c |  | ||||||
| +++ b/lib/vtls/mbedtls.c |  | ||||||
| @@ -1029,7 +1029,7 @@ static void Curl_mbedtls_sha256sum(const |  | ||||||
|                                      size_t sha256len UNUSED_PARAM) |  | ||||||
|  { |  | ||||||
|    (void)sha256len; |  | ||||||
| -  mbedtls_sha256(input, inputlen, sha256sum, 0); |  | ||||||
| +  mbedtls_sha256_ret(input, inputlen, sha256sum, 0); |  | ||||||
|  } |  | ||||||
|   |  | ||||||
|  static void *Curl_mbedtls_get_internals(struct ssl_connect_data *connssl, |  | ||||||
| @@ -18,6 +18,7 @@ PKG_SOURCE_VERSION:=c16bdec15137b241586310d0e61bc88cc3726004 | |||||||
| PKG_MIRROR_HASH:=72e4bec94a56dd600097846c773e1074ff705e38f800ef221db646c064371a53 | PKG_MIRROR_HASH:=72e4bec94a56dd600097846c773e1074ff705e38f800ef221db646c064371a53 | ||||||
|  |  | ||||||
| PKG_FIXUP:=autoreconf | PKG_FIXUP:=autoreconf | ||||||
|  | PKG_FLAGS:=nonshared | ||||||
|  |  | ||||||
| PKG_INSTALL:=1 | PKG_INSTALL:=1 | ||||||
| PKG_BUILD_PARALLEL:=1 | PKG_BUILD_PARALLEL:=1 | ||||||
|   | |||||||
							
								
								
									
										6
									
								
								package/network/utils/wwan/files/data/1e2d-0053
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								package/network/utils/wwan/files/data/1e2d-0053
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | |||||||
|  | { | ||||||
|  | 	"desc": "Cinterion PH8", | ||||||
|  | 	"control": 2, | ||||||
|  | 	"data": 3 | ||||||
|  | } | ||||||
|  |  | ||||||
							
								
								
									
										5
									
								
								package/network/utils/wwan/files/data/1e2d-005b
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								package/network/utils/wwan/files/data/1e2d-005b
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | |||||||
|  | { | ||||||
|  | 	"desc": "Cinterion ELS61", | ||||||
|  | 	"control": 1, | ||||||
|  | 	"data": 0 | ||||||
|  | } | ||||||
| @@ -59,7 +59,7 @@ proto_wwan_setup() { | |||||||
| 		json_set_namespace $old_cb | 		json_set_namespace $old_cb | ||||||
|  |  | ||||||
| 		[ -n "$control" -a -n "$data" ] && { | 		[ -n "$control" -a -n "$data" ] && { | ||||||
| 			ttys=$(ls -d /sys/bus/usb/devices/$devicename/${devicename}*/tty* | sed "s/.*\///g" | tr "\n" " ") | 			ttys=$(ls -d /sys/bus/usb/devices/$devicename/${devicename}*/tty?* /sys/bus/usb/devices/$devicename/${devicename}*/tty/tty?* | sed "s/.*\///g" | tr "\n" " ") | ||||||
| 			ctl_device=/dev/$(echo $ttys | cut -d" " -f $((control + 1))) | 			ctl_device=/dev/$(echo $ttys | cut -d" " -f $((control + 1))) | ||||||
| 			dat_device=/dev/$(echo $ttys | cut -d" " -f $((data + 1))) | 			dat_device=/dev/$(echo $ttys | cut -d" " -f $((data + 1))) | ||||||
| 			driver=comgt | 			driver=comgt | ||||||
|   | |||||||
| @@ -1,5 +1,10 @@ | |||||||
|  | #!/bin/sh | ||||||
|  |  | ||||||
| [ "$ACTION" = add -a "$DEVTYPE" = usb_device ] || exit 0 | [ "$ACTION" = add -a "$DEVTYPE" = usb_device ] || exit 0 | ||||||
|  |  | ||||||
|  | . /lib/functions.sh | ||||||
|  | . /lib/netifd/netifd-proto.sh | ||||||
|  |  | ||||||
| vid=$(cat /sys$DEVPATH/idVendor) | vid=$(cat /sys$DEVPATH/idVendor) | ||||||
| pid=$(cat /sys$DEVPATH/idProduct) | pid=$(cat /sys$DEVPATH/idProduct) | ||||||
| [ -f "/lib/network/wwan/$vid:$pid" ] || exit 0 | [ -f "/lib/network/wwan/$vid:$pid" ] || exit 0 | ||||||
|   | |||||||
| @@ -17,6 +17,8 @@ STAMP_PREPARED := $(STAMP_PREPARED)_$(call confvar,CONFIG_MTD_REDBOOT_PARTS) | |||||||
| PKG_LICENSE:=GPL-2.0+ | PKG_LICENSE:=GPL-2.0+ | ||||||
| PKG_LICENSE_FILES:= | PKG_LICENSE_FILES:= | ||||||
|  |  | ||||||
|  | PKG_FLAGS:=nonshared | ||||||
|  |  | ||||||
| include $(INCLUDE_DIR)/package.mk | include $(INCLUDE_DIR)/package.mk | ||||||
|  |  | ||||||
| define Package/mtd | define Package/mtd | ||||||
|   | |||||||
| @@ -2,36 +2,37 @@ | |||||||
| 
 | 
 | ||||||
| include $(TOPDIR)/rules.mk | include $(TOPDIR)/rules.mk | ||||||
| 
 | 
 | ||||||
| PKG_NAME:=lede-keyring | PKG_NAME:=openwrt-keyring | ||||||
| PKG_RELEASE:=1 | PKG_RELEASE:=1 | ||||||
| 
 | 
 | ||||||
| PKG_SOURCE_PROTO:=git | PKG_SOURCE_PROTO:=git | ||||||
| PKG_SOURCE_URL=$(PROJECT_GIT)/keyring.git | PKG_SOURCE_URL=$(PROJECT_GIT)/keyring.git | ||||||
| PKG_SOURCE_DATE:=2017-01-20 | PKG_SOURCE_DATE:=2018-05-18 | ||||||
| PKG_SOURCE_VERSION:=a50b7529880988ca96e72dede0279ff139a8ab1a | PKG_SOURCE_VERSION:=103a32e9f52fd35a428dc08ddbca86fe41dfb918 | ||||||
| PKG_MIRROR_HASH:=811ba79ba71925e949d2c690db7d7b031ac1dd965aa831ca9b6d9d70f5657254 | PKG_MIRROR_HASH:=58f42796396fee0e4f008d6f5a970a421d023d6c98e71bf53c2778734fa3480b | ||||||
| 
 | 
 | ||||||
| PKG_MAINTAINER:=John Crispin <john@phrozen.org> | PKG_MAINTAINER:=John Crispin <john@phrozen.org> | ||||||
| PKG_LICENSE:=GPL-2.0 | PKG_LICENSE:=GPL-2.0 | ||||||
| 
 | 
 | ||||||
| include $(INCLUDE_DIR)/package.mk | include $(INCLUDE_DIR)/package.mk | ||||||
| 
 | 
 | ||||||
| define Package/lede-keyring | define Package/openwrt-keyring | ||||||
|   SECTION:=base |   SECTION:=base | ||||||
|   CATEGORY:=Base system |   CATEGORY:=Base system | ||||||
|   TITLE:=LEDE Developer Keyring |   PROVIDES:=lede-keyring | ||||||
|   URL:=http://www.lede-project.org |   TITLE:=OpenWrt Developer Keyring | ||||||
|  |   URL:=https://openwrt.org/docs/guide-user/security/signatures | ||||||
| endef | endef | ||||||
| 
 | 
 | ||||||
| define Package/lede-keyring/description | define Package/openwrt-keyring/description | ||||||
|   The keyring of with the developer using and gpg public keys. |   The keyring of with the developer using and gpg public keys. | ||||||
| endef | endef | ||||||
| 
 | 
 | ||||||
| Build/Compile= | Build/Compile= | ||||||
| 
 | 
 | ||||||
| define Package/lede-keyring/install | define Package/openwrt-keyring/install | ||||||
| 	$(INSTALL_DIR) $(1)/etc/opkg/keys/ | 	$(INSTALL_DIR) $(1)/etc/opkg/keys/ | ||||||
| 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/usign/* $(1)/etc/opkg/keys/ | 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/usign/* $(1)/etc/opkg/keys/ | ||||||
| endef | endef | ||||||
| 
 | 
 | ||||||
| $(eval $(call BuildPackage,lede-keyring)) | $(eval $(call BuildPackage,openwrt-keyring)) | ||||||
| @@ -1,7 +1,7 @@ | |||||||
| include $(TOPDIR)/rules.mk | include $(TOPDIR)/rules.mk | ||||||
|  |  | ||||||
| PKG_NAME:=ubox | PKG_NAME:=ubox | ||||||
| PKG_RELEASE:=1 | PKG_RELEASE:=2 | ||||||
|  |  | ||||||
| PKG_SOURCE_PROTO:=git | PKG_SOURCE_PROTO:=git | ||||||
| PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubox.git | PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubox.git | ||||||
|   | |||||||
| @@ -55,6 +55,8 @@ start_service_file() | |||||||
| 	} | 	} | ||||||
| 	[ -z "${log_file}" ] && return | 	[ -z "${log_file}" ] && return | ||||||
|  |  | ||||||
|  | 	mkdir -p "$(dirname "${log_file}")" | ||||||
|  |  | ||||||
| 	procd_open_instance | 	procd_open_instance | ||||||
| 	procd_set_param command "$PROG" -f -F "$log_file" -p "$pid_file" | 	procd_set_param command "$PROG" -f -F "$log_file" -p "$pid_file" | ||||||
| 	[ -n "${log_size}" ] && procd_append_param command -S "$log_size" | 	[ -n "${log_size}" ] && procd_append_param command -S "$log_size" | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk | |||||||
|  |  | ||||||
| PKG_NAME:=busybox | PKG_NAME:=busybox | ||||||
| PKG_VERSION:=1.28.3 | PKG_VERSION:=1.28.3 | ||||||
| PKG_RELEASE:=2 | PKG_RELEASE:=4 | ||||||
| PKG_FLAGS:=essential | PKG_FLAGS:=essential | ||||||
|  |  | ||||||
| PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 | ||||||
|   | |||||||
| @@ -11,7 +11,7 @@ validate_cron_section() { | |||||||
| 		'cronloglevel:uinteger' | 		'cronloglevel:uinteger' | ||||||
| } | } | ||||||
|  |  | ||||||
| start_service () { | start_service() { | ||||||
| 	[ -z "$(ls /etc/crontabs/)" ] && return 1 | 	[ -z "$(ls /etc/crontabs/)" ] && return 1 | ||||||
|  |  | ||||||
| 	loglevel="$(uci_get "system.@system[0].cronloglevel")" | 	loglevel="$(uci_get "system.@system[0].cronloglevel")" | ||||||
| @@ -29,10 +29,12 @@ start_service () { | |||||||
|  |  | ||||||
| 	procd_open_instance | 	procd_open_instance | ||||||
| 	procd_set_param command "$PROG" -f -c /etc/crontabs -l "${loglevel:-5}" | 	procd_set_param command "$PROG" -f -c /etc/crontabs -l "${loglevel:-5}" | ||||||
|  | 	for crontab in /etc/crontabs/*; do | ||||||
|  | 		 procd_set_param file "$crontab" | ||||||
|  | 	done | ||||||
| 	procd_close_instance | 	procd_close_instance | ||||||
| } | } | ||||||
|  |  | ||||||
| service_triggers() | service_triggers() { | ||||||
| { |  | ||||||
| 	procd_add_validation validate_cron_section | 	procd_add_validation validate_cron_section | ||||||
| } | } | ||||||
|   | |||||||
| @@ -0,0 +1,117 @@ | |||||||
|  | From 148788eb0ee96026105755cf3fd1ad3d94f49cd2 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: Denys Vlasenko <vda.linux@googlemail.com> | ||||||
|  | Date: Thu, 21 Jun 2018 17:36:22 +0200 | ||||||
|  | Subject: [PATCH] udhcpc: remove code which requires server ID to be on local | ||||||
|  |  network | ||||||
|  |  | ||||||
|  | This reverts "udhcpc: paranoia when using kernel UDP mode | ||||||
|  | for sending renew: server ID may be bogus". | ||||||
|  |  | ||||||
|  | Users complain that they do have servers behind routers | ||||||
|  | (with DHCP relays). | ||||||
|  |  | ||||||
|  | function                                             old     new   delta | ||||||
|  | send_packet                                          168     166      -2 | ||||||
|  | bcast_or_ucast                                        25      23      -2 | ||||||
|  | udhcp_send_kernel_packet                             301     295      -6 | ||||||
|  | ------------------------------------------------------------------------------ | ||||||
|  | (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-10)             Total: -10 bytes | ||||||
|  |  | ||||||
|  | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> | ||||||
|  | --- | ||||||
|  |  networking/udhcp/common.h   |  4 +--- | ||||||
|  |  networking/udhcp/d6_dhcpc.c |  4 +--- | ||||||
|  |  networking/udhcp/dhcpc.c    | 10 ++-------- | ||||||
|  |  networking/udhcp/dhcpd.c    |  4 +--- | ||||||
|  |  networking/udhcp/packet.c   |  7 +++---- | ||||||
|  |  5 files changed, 8 insertions(+), 21 deletions(-) | ||||||
|  |  | ||||||
|  | --- a/networking/udhcp/common.h | ||||||
|  | +++ b/networking/udhcp/common.h | ||||||
|  | @@ -308,9 +308,7 @@ int udhcp_send_raw_packet(struct dhcp_pa | ||||||
|  |   | ||||||
|  |  int udhcp_send_kernel_packet(struct dhcp_packet *dhcp_pkt, | ||||||
|  |  		uint32_t source_nip, int source_port, | ||||||
|  | -		uint32_t dest_nip, int dest_port, | ||||||
|  | -		int send_flags | ||||||
|  | -) FAST_FUNC; | ||||||
|  | +		uint32_t dest_nip, int dest_port) FAST_FUNC; | ||||||
|  |   | ||||||
|  |  void udhcp_sp_setup(void) FAST_FUNC; | ||||||
|  |  void udhcp_sp_fd_set(struct pollfd *pfds, int extra_fd) FAST_FUNC; | ||||||
|  | --- a/networking/udhcp/d6_dhcpc.c | ||||||
|  | +++ b/networking/udhcp/d6_dhcpc.c | ||||||
|  | @@ -702,15 +702,13 @@ static NOINLINE int send_d6_renew(uint32 | ||||||
|  |  	opt_ptr = add_d6_client_options(opt_ptr); | ||||||
|  |   | ||||||
|  |  	bb_error_msg("sending %s", "renew"); | ||||||
|  | -	if (server_ipv6) { | ||||||
|  | +	if (server_ipv6) | ||||||
|  |  		return d6_send_kernel_packet( | ||||||
|  |  			&packet, (opt_ptr - (uint8_t*) &packet), | ||||||
|  |  			our_cur_ipv6, CLIENT_PORT6, | ||||||
|  |  			server_ipv6, SERVER_PORT6, | ||||||
|  |  			client_config.ifindex | ||||||
|  | -			/* TODO? send_flags: MSG_DONTROUTE (see IPv4 code for reason why) */ | ||||||
|  |  		); | ||||||
|  | -	} | ||||||
|  |  	return d6_mcast_from_client_config_ifindex(&packet, opt_ptr); | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | --- a/networking/udhcp/dhcpc.c | ||||||
|  | +++ b/networking/udhcp/dhcpc.c | ||||||
|  | @@ -693,16 +693,10 @@ static int raw_bcast_from_client_config_ | ||||||
|  |   | ||||||
|  |  static int bcast_or_ucast(struct dhcp_packet *packet, uint32_t ciaddr, uint32_t server) | ||||||
|  |  { | ||||||
|  | -	if (server) { | ||||||
|  | -		/* Without MSG_DONTROUTE, the packet was seen routed over | ||||||
|  | -		 * _other interface_ if server ID is bogus (example: 1.1.1.1). | ||||||
|  | -		 */ | ||||||
|  | +	if (server) | ||||||
|  |  		return udhcp_send_kernel_packet(packet, | ||||||
|  |  			ciaddr, CLIENT_PORT, | ||||||
|  | -			server, SERVER_PORT, | ||||||
|  | -			/*send_flags: "to hosts only on directly connected networks" */ MSG_DONTROUTE | ||||||
|  | -		); | ||||||
|  | -	} | ||||||
|  | +			server, SERVER_PORT); | ||||||
|  |  	return raw_bcast_from_client_config_ifindex(packet, ciaddr); | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | --- a/networking/udhcp/dhcpd.c | ||||||
|  | +++ b/networking/udhcp/dhcpd.c | ||||||
|  | @@ -588,9 +588,7 @@ static void send_packet_to_relay(struct | ||||||
|  |   | ||||||
|  |  	udhcp_send_kernel_packet(dhcp_pkt, | ||||||
|  |  			server_config.server_nip, SERVER_PORT, | ||||||
|  | -			dhcp_pkt->gateway_nip, SERVER_PORT, | ||||||
|  | -			/*send_flags:*/ 0 | ||||||
|  | -	); | ||||||
|  | +			dhcp_pkt->gateway_nip, SERVER_PORT); | ||||||
|  |  } | ||||||
|  |   | ||||||
|  |  static void send_packet(struct dhcp_packet *dhcp_pkt, int force_broadcast) | ||||||
|  | --- a/networking/udhcp/packet.c | ||||||
|  | +++ b/networking/udhcp/packet.c | ||||||
|  | @@ -189,8 +189,7 @@ int FAST_FUNC udhcp_send_raw_packet(stru | ||||||
|  |  /* Let the kernel do all the work for packet generation */ | ||||||
|  |  int FAST_FUNC udhcp_send_kernel_packet(struct dhcp_packet *dhcp_pkt, | ||||||
|  |  		uint32_t source_nip, int source_port, | ||||||
|  | -		uint32_t dest_nip, int dest_port, | ||||||
|  | -		int send_flags) | ||||||
|  | +		uint32_t dest_nip, int dest_port) | ||||||
|  |  { | ||||||
|  |  	struct sockaddr_in sa; | ||||||
|  |  	unsigned padding; | ||||||
|  | @@ -227,8 +226,8 @@ int FAST_FUNC udhcp_send_kernel_packet(s | ||||||
|  |  	padding = DHCP_OPTIONS_BUFSIZE - 1 - udhcp_end_option(dhcp_pkt->options); | ||||||
|  |  	if (padding > DHCP_SIZE - 300) | ||||||
|  |  		padding = DHCP_SIZE - 300; | ||||||
|  | -	result = send(fd, dhcp_pkt, DHCP_SIZE - padding, send_flags); | ||||||
|  | -	msg = "send"; | ||||||
|  | +	result = safe_write(fd, dhcp_pkt, DHCP_SIZE - padding); | ||||||
|  | +	msg = "write"; | ||||||
|  |   ret_close: | ||||||
|  |  	close(fd); | ||||||
|  |  	if (result < 0) { | ||||||
| @@ -0,0 +1,30 @@ | |||||||
|  | From 7d27becbb355853ba778e8b83fe171eecb8195d2 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: Christian Lamparter <chunkeey@gmail.com> | ||||||
|  | Date: Thu, 7 Jun 2018 22:36:19 +0200 | ||||||
|  | Subject: [PATCH] Revert "Return correct error number in ubi_get_vol_info1" | ||||||
|  |  | ||||||
|  | This reverts commit dede98ffb706676309488d7cc660f569548d5930. | ||||||
|  | --- | ||||||
|  |  lib/libubi.c | 5 +---- | ||||||
|  |  1 file changed, 1 insertion(+), 4 deletions(-) | ||||||
|  |  | ||||||
|  | diff --git a/lib/libubi.c b/lib/libubi.c | ||||||
|  | index b50e68a..978b433 100644 | ||||||
|  | --- a/lib/libubi.c | ||||||
|  | +++ b/lib/libubi.c | ||||||
|  | @@ -1240,11 +1240,8 @@ int ubi_get_vol_info1(libubi_t desc, int dev_num, int vol_id, | ||||||
|  |  	info->dev_num = dev_num; | ||||||
|  |  	info->vol_id = vol_id; | ||||||
|  |   | ||||||
|  | -	if (vol_get_major(lib, dev_num, vol_id, &info->major, &info->minor)) { | ||||||
|  | -		if (errno == ENOENT) | ||||||
|  | -			errno = ENODEV; | ||||||
|  | +	if (vol_get_major(lib, dev_num, vol_id, &info->major, &info->minor)) | ||||||
|  |  		return -1; | ||||||
|  | -	} | ||||||
|  |   | ||||||
|  |  	ret = vol_read_data(lib->vol_type, dev_num, vol_id, buf, 50); | ||||||
|  |  	if (ret < 0) | ||||||
|  | --  | ||||||
|  | 2.17.1 | ||||||
|  |  | ||||||
| @@ -1,24 +0,0 @@ | |||||||
| # |  | ||||||
| # Copyright (C) 2007-2011 OpenWrt.org |  | ||||||
| # |  | ||||||
| # This is free software, licensed under the GNU General Public License v2. |  | ||||||
| # See /LICENSE for more information. |  | ||||||
| # |  | ||||||
|  |  | ||||||
| include $(TOPDIR)/rules.mk |  | ||||||
|  |  | ||||||
| BOARD:=adm5120 |  | ||||||
| BOARDNAME:=Infineon/ADMtek ADM5120 |  | ||||||
| FEATURES:=low_mem |  | ||||||
| SUBTARGETS:=router_le router_be rb1xx |  | ||||||
| INITRAMFS_EXTRA_FILES:= |  | ||||||
|  |  | ||||||
| KERNEL_PATCHVER:=3.18 |  | ||||||
|  |  | ||||||
| include $(INCLUDE_DIR)/target.mk |  | ||||||
|  |  | ||||||
| DEFAULT_PACKAGES += admswconfig wpad-mini kmod-input-core \ |  | ||||||
| 		    kmod-input-polldev kmod-input-gpio-keys-polled kmod-button-hotplug \ |  | ||||||
| 		    kmod-leds-gpio kmod-ledtrig-adm5120-switch |  | ||||||
|  |  | ||||||
| $(eval $(call BuildTarget)) |  | ||||||
| @@ -1,17 +0,0 @@ | |||||||
| #!/bin/sh |  | ||||||
|  |  | ||||||
| . /lib/functions/uci-defaults.sh |  | ||||||
|  |  | ||||||
| board_config_update |  | ||||||
|  |  | ||||||
| ucidef_set_led_portstate "lan1" "LAN1" "lan1" "link_act" |  | ||||||
| ucidef_set_led_portstate "lan2" "LAN2" "lan2" "link_act" |  | ||||||
| ucidef_set_led_portstate "lan3" "LAN3" "lan3" "link_act" |  | ||||||
| ucidef_set_led_portstate "lan4" "LAN4" "lan4" "link_act" |  | ||||||
| ucidef_set_led_portstate "wan"  "WAN"  "wan"  "link_act" |  | ||||||
|  |  | ||||||
| ucidef_set_led_netdev "wlan" "WLAN" "wlan" "wlan0" |  | ||||||
|  |  | ||||||
| board_config_flush |  | ||||||
|  |  | ||||||
| exit 0 |  | ||||||
| @@ -1,39 +0,0 @@ | |||||||
| #### VLAN configuration  |  | ||||||
| config switch |  | ||||||
| 	option eth0	"0 1 2 3" |  | ||||||
| 	option eth1	"4" |  | ||||||
|  |  | ||||||
|  |  | ||||||
| #### Loopback configuration |  | ||||||
| config interface loopback |  | ||||||
| 	option ifname	"lo" |  | ||||||
| 	option proto	static |  | ||||||
| 	option ipaddr	127.0.0.1 |  | ||||||
| 	option netmask	255.0.0.0 |  | ||||||
|  |  | ||||||
|  |  | ||||||
| #### LAN configuration |  | ||||||
| config interface lan |  | ||||||
| 	option type 	bridge |  | ||||||
| 	option ifname	"eth0" |  | ||||||
| 	option proto	static |  | ||||||
| 	option ipaddr	192.168.1.1 |  | ||||||
| 	option netmask	255.255.255.0 |  | ||||||
| 	option ip6assign 60 |  | ||||||
|  |  | ||||||
|  |  | ||||||
| #### WAN configuration |  | ||||||
| config interface	wan |  | ||||||
| 	option ifname	"eth1" |  | ||||||
| 	option proto	dhcp |  | ||||||
|  |  | ||||||
|  |  | ||||||
| #### WAN6 configuration |  | ||||||
| config interface	wan6 |  | ||||||
| 	option ifname	"eth1" |  | ||||||
| 	option proto	dhcpv6 |  | ||||||
|  |  | ||||||
|  |  | ||||||
| #### Network global configuration |  | ||||||
| config globals		globals |  | ||||||
| 	option ula_prefix auto |  | ||||||
| @@ -1,22 +0,0 @@ | |||||||
| #!/bin/sh |  | ||||||
| # Copyright (C) 2007-2013 OpenWrt.org |  | ||||||
|  |  | ||||||
| . /lib/functions/leds.sh |  | ||||||
| . /lib/adm5120.sh |  | ||||||
|  |  | ||||||
| set_state() { |  | ||||||
| 	case "$1" in |  | ||||||
| 	preinit) |  | ||||||
| 		status_led_blink_preinit |  | ||||||
| 		;; |  | ||||||
| 	failsafe) |  | ||||||
| 		status_led_blink_failsafe |  | ||||||
| 		;; |  | ||||||
| 	preinit_regular) |  | ||||||
| 		status_led_blink_preinit_regular |  | ||||||
| 		;; |  | ||||||
| 	done) |  | ||||||
| 		status_led_on |  | ||||||
| 		;; |  | ||||||
| 	esac |  | ||||||
| } |  | ||||||
| @@ -1,5 +0,0 @@ | |||||||
| ::sysinit:/etc/init.d/rcS S boot |  | ||||||
| ::shutdown:/etc/init.d/rcS K shutdown |  | ||||||
| tts/0::askfirst:/usr/libexec/login.sh |  | ||||||
| ttyAM0::askfirst:/usr/libexec/login.sh |  | ||||||
| tty1::askfirst:/usr/libexec/login.sh |  | ||||||
| @@ -1,53 +0,0 @@ | |||||||
| #!/bin/sh |  | ||||||
| # |  | ||||||
| # Copyright (C) 2007 OpenWrt.org |  | ||||||
| # |  | ||||||
| # |  | ||||||
|  |  | ||||||
| board_name="" |  | ||||||
| status_led="" |  | ||||||
| sys_mtd_part="" |  | ||||||
|  |  | ||||||
| adm5120_detect() { |  | ||||||
| 	board_name=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo) |  | ||||||
|  |  | ||||||
| 	case "$board_name" in |  | ||||||
| 	"Cellvision"*) |  | ||||||
| 		status_led="status" |  | ||||||
| 		sys_mtd_part="firmware" |  | ||||||
| 		;; |  | ||||||
| 	"Compex"*) |  | ||||||
| 		status_led="diag" |  | ||||||
| 		case "$board_name" in |  | ||||||
| 		*-WRT) |  | ||||||
| 			sys_mtd_part="trx" |  | ||||||
| 			;; |  | ||||||
| 		*) |  | ||||||
| 			sys_mtd_part="partition1" |  | ||||||
| 			;; |  | ||||||
| 		esac |  | ||||||
| 		;; |  | ||||||
| 	"Edimax"*) |  | ||||||
| 		status_led="power" |  | ||||||
| 		sys_mtd_part="firmware" |  | ||||||
| 		;; |  | ||||||
| 	"Infineon"*) |  | ||||||
| 		sys_mtd_part="firmware" |  | ||||||
| 		;; |  | ||||||
| 	"Mikrotik"*) |  | ||||||
| 		status_led="power" |  | ||||||
| 		;; |  | ||||||
| 	"ZyXEL"*) |  | ||||||
| 		status_led="power" |  | ||||||
| 		sys_mtd_part="trx" |  | ||||||
| 		;; |  | ||||||
| 	"EB-214A"*) |  | ||||||
| 		status_led="power" |  | ||||||
| 		sys_mtd_part="firmware" |  | ||||||
| 		;; |  | ||||||
| 	*) |  | ||||||
| 		;; |  | ||||||
| 	esac |  | ||||||
| } |  | ||||||
|  |  | ||||||
| adm5120_detect |  | ||||||
| @@ -1,7 +0,0 @@ | |||||||
| #!/bin/sh |  | ||||||
|  |  | ||||||
| do_adm5120() { |  | ||||||
| 	. /lib/adm5120.sh |  | ||||||
| } |  | ||||||
|  |  | ||||||
| boot_hook_add preinit_main do_adm5120 |  | ||||||
| @@ -1,9 +0,0 @@ | |||||||
| #!/bin/sh |  | ||||||
|  |  | ||||||
| set_preinit_ifname() { |  | ||||||
| 	ifname=eth0 |  | ||||||
| } |  | ||||||
|  |  | ||||||
| boot_hook_add preinit_main set_preinit_ifname |  | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -1,35 +0,0 @@ | |||||||
| # |  | ||||||
| # Copyright (C) 2009-2010 OpenWrt.org |  | ||||||
| # |  | ||||||
|  |  | ||||||
| . /lib/adm5120.sh |  | ||||||
|  |  | ||||||
| PART_NAME="firmware" |  | ||||||
| RAMFS_COPY_DATA=/lib/adm5120.sh |  | ||||||
|  |  | ||||||
| platform_check_image() { |  | ||||||
| 	local magic="$(get_magic_word "$1")" |  | ||||||
|  |  | ||||||
| 	[ "$#" -gt 1 ] && return 1 |  | ||||||
|  |  | ||||||
| 	case "$board_name" in |  | ||||||
| 	"ZyXEL"*|"Compex WP54 family") |  | ||||||
| 		# .trx files |  | ||||||
| 		[ "$magic" != "4844" ] && { |  | ||||||
| 			echo "Invalid image type." |  | ||||||
| 			return 1 |  | ||||||
| 		} |  | ||||||
| 		return 0 |  | ||||||
| 		;; |  | ||||||
| 	*) |  | ||||||
| 		;; |  | ||||||
| 	esac |  | ||||||
|  |  | ||||||
| 	echo "Sysupgrade is not yet supported on $board_name." |  | ||||||
| 	return 1 |  | ||||||
| } |  | ||||||
|  |  | ||||||
| platform_do_upgrade() { |  | ||||||
| 	PART_NAME="$sys_mtd_part" |  | ||||||
| 	default_do_upgrade "$ARGV" |  | ||||||
| } |  | ||||||
| @@ -1,176 +0,0 @@ | |||||||
| CONFIG_ADM5120=y |  | ||||||
| CONFIG_ADM5120_ENET=y |  | ||||||
| CONFIG_ADM5120_MACH_5GXI=y |  | ||||||
| CONFIG_ADM5120_MACH_BR_6104K=y |  | ||||||
| CONFIG_ADM5120_MACH_BR_6104KP=y |  | ||||||
| CONFIG_ADM5120_MACH_BR_61X4WG=y |  | ||||||
| CONFIG_ADM5120_MACH_CAS_771=y |  | ||||||
| CONFIG_ADM5120_MACH_EASY5120P_ATA=y |  | ||||||
| CONFIG_ADM5120_MACH_EASY5120_RT=y |  | ||||||
| CONFIG_ADM5120_MACH_EASY5120_WVOIP=y |  | ||||||
| CONFIG_ADM5120_MACH_EASY83000=y |  | ||||||
| CONFIG_ADM5120_MACH_EB_214A=y |  | ||||||
| CONFIG_ADM5120_MACH_NFS_101=y |  | ||||||
| CONFIG_ADM5120_MACH_NP27G=y |  | ||||||
| CONFIG_ADM5120_MACH_NP28G=y |  | ||||||
| CONFIG_ADM5120_MACH_PMUGW=y |  | ||||||
| # CONFIG_ADM5120_MACH_RB_11X is not set |  | ||||||
| # CONFIG_ADM5120_MACH_RB_133 is not set |  | ||||||
| # CONFIG_ADM5120_MACH_RB_133C is not set |  | ||||||
| # CONFIG_ADM5120_MACH_RB_150 is not set |  | ||||||
| # CONFIG_ADM5120_MACH_RB_153 is not set |  | ||||||
| # CONFIG_ADM5120_MACH_RB_192 is not set |  | ||||||
| CONFIG_ADM5120_MACH_WP54=y |  | ||||||
| CONFIG_ADM5120_OEM_CELLVISION=y |  | ||||||
| CONFIG_ADM5120_OEM_COMPEX=y |  | ||||||
| CONFIG_ADM5120_OEM_EDIMAX=y |  | ||||||
| CONFIG_ADM5120_OEM_GENERIC=y |  | ||||||
| CONFIG_ADM5120_OEM_INFINEON=y |  | ||||||
| # CONFIG_ADM5120_OEM_MIKROTIK is not set |  | ||||||
| CONFIG_ADM5120_OEM_MOTOROLA=y |  | ||||||
| CONFIG_ADM5120_OEM_OSBRIDGE=y |  | ||||||
| # CONFIG_ADM5120_OEM_ZYXEL is not set |  | ||||||
| CONFIG_ADM5120_SOC_BGA=y |  | ||||||
| CONFIG_ADM5120_WDT=y |  | ||||||
| CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y |  | ||||||
| CONFIG_ARCH_DISCARD_MEMBLOCK=y |  | ||||||
| CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y |  | ||||||
| # CONFIG_ARCH_HAS_SG_CHAIN is not set |  | ||||||
| CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y |  | ||||||
| CONFIG_ARCH_HIBERNATION_POSSIBLE=y |  | ||||||
| CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y |  | ||||||
| CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y |  | ||||||
| CONFIG_ARCH_REQUIRE_GPIOLIB=y |  | ||||||
| CONFIG_ARCH_SUSPEND_POSSIBLE=y |  | ||||||
| CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y |  | ||||||
| CONFIG_ARM_AMBA=y |  | ||||||
| CONFIG_BUILD_BIN2C=y |  | ||||||
| CONFIG_CC_OPTIMIZE_FOR_SIZE=y |  | ||||||
| CONFIG_CEVT_R4K=y |  | ||||||
| CONFIG_CLONE_BACKWARDS=y |  | ||||||
| CONFIG_CMDLINE="console=ttyAM0,115200 rootfstype=squashfs,jffs2" |  | ||||||
| CONFIG_CMDLINE_BOOL=y |  | ||||||
| # CONFIG_CMDLINE_OVERRIDE is not set |  | ||||||
| # CONFIG_CPU_BIG_ENDIAN is not set |  | ||||||
| CONFIG_CPU_GENERIC_DUMP_TLB=y |  | ||||||
| CONFIG_CPU_HAS_PREFETCH=y |  | ||||||
| CONFIG_CPU_HAS_SYNC=y |  | ||||||
| CONFIG_CPU_LITTLE_ENDIAN=y |  | ||||||
| CONFIG_CPU_MIPS32=y |  | ||||||
| CONFIG_CPU_MIPS32_R1=y |  | ||||||
| CONFIG_CPU_MIPSR1=y |  | ||||||
| CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y |  | ||||||
| CONFIG_CPU_R4K_CACHE_TLB=y |  | ||||||
| CONFIG_CPU_R4K_FPU=y |  | ||||||
| CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y |  | ||||||
| CONFIG_CPU_SUPPORTS_HIGHMEM=y |  | ||||||
| CONFIG_CSRC_R4K=y |  | ||||||
| CONFIG_DMA_NONCOHERENT=y |  | ||||||
| CONFIG_EARLY_PRINTK=y |  | ||||||
| CONFIG_FIRMWARE_IN_KERNEL=y |  | ||||||
| CONFIG_GENERIC_ATOMIC64=y |  | ||||||
| CONFIG_GENERIC_CLOCKEVENTS=y |  | ||||||
| CONFIG_GENERIC_CLOCKEVENTS_BUILD=y |  | ||||||
| CONFIG_GENERIC_CMOS_UPDATE=y |  | ||||||
| CONFIG_GENERIC_IO=y |  | ||||||
| CONFIG_GENERIC_IRQ_SHOW=y |  | ||||||
| CONFIG_GENERIC_PCI_IOMAP=y |  | ||||||
| CONFIG_GENERIC_SMP_IDLE_THREAD=y |  | ||||||
| CONFIG_GPIOLIB=y |  | ||||||
| CONFIG_GPIO_DEVRES=y |  | ||||||
| CONFIG_GPIO_SYSFS=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_JUMP_LABEL=y |  | ||||||
| CONFIG_HAVE_ARCH_KGDB=y |  | ||||||
| CONFIG_HAVE_ARCH_SECCOMP_FILTER=y |  | ||||||
| CONFIG_HAVE_ARCH_TRACEHOOK=y |  | ||||||
| # CONFIG_HAVE_BOOTMEM_INFO_NODE is not set |  | ||||||
| CONFIG_HAVE_BPF_JIT=y |  | ||||||
| CONFIG_HAVE_CC_STACKPROTECTOR=y |  | ||||||
| CONFIG_HAVE_CLK=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_ATTRS=y |  | ||||||
| CONFIG_HAVE_DMA_CONTIGUOUS=y |  | ||||||
| CONFIG_HAVE_DYNAMIC_FTRACE=y |  | ||||||
| CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y |  | ||||||
| CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y |  | ||||||
| CONFIG_HAVE_FUNCTION_TRACER=y |  | ||||||
| CONFIG_HAVE_GENERIC_DMA_COHERENT=y |  | ||||||
| CONFIG_HAVE_IDE=y |  | ||||||
| CONFIG_HAVE_MEMBLOCK=y |  | ||||||
| CONFIG_HAVE_MEMBLOCK_NODE_MAP=y |  | ||||||
| CONFIG_HAVE_MOD_ARCH_SPECIFIC=y |  | ||||||
| CONFIG_HAVE_NET_DSA=y |  | ||||||
| CONFIG_HAVE_OPROFILE=y |  | ||||||
| CONFIG_HAVE_PERF_EVENTS=y |  | ||||||
| CONFIG_HAVE_SYSCALL_TRACEPOINTS=y |  | ||||||
| CONFIG_HW_HAS_PCI=y |  | ||||||
| CONFIG_HW_RANDOM=y |  | ||||||
| CONFIG_HZ=250 |  | ||||||
| # CONFIG_HZ_100 is not set |  | ||||||
| CONFIG_HZ_250=y |  | ||||||
| CONFIG_IKCONFIG=y |  | ||||||
| CONFIG_IKCONFIG_PROC=y |  | ||||||
| CONFIG_INITRAMFS_SOURCE="" |  | ||||||
| # CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set |  | ||||||
| CONFIG_IRQ_CPU=y |  | ||||||
| CONFIG_IRQ_FORCED_THREADING=y |  | ||||||
| CONFIG_IRQ_WORK=y |  | ||||||
| # CONFIG_LEDS_TRIGGER_ADM5120_SWITCH is not set |  | ||||||
| CONFIG_LEGACY_PTYS=y |  | ||||||
| CONFIG_LEGACY_PTY_COUNT=256 |  | ||||||
| CONFIG_MIPS=y |  | ||||||
| # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set |  | ||||||
| CONFIG_MIPS_L1_CACHE_SHIFT=5 |  | ||||||
| CONFIG_MIPS_MACHINE=y |  | ||||||
| CONFIG_MODULES_USE_ELF_REL=y |  | ||||||
| CONFIG_MTD_ADM5120=y |  | ||||||
| CONFIG_MTD_CFI_FIXUP_MACRONIX_BOOTLOC=y |  | ||||||
| # CONFIG_MTD_CFI_INTELEXT is not set |  | ||||||
| CONFIG_MTD_CMDLINE_PARTS=y |  | ||||||
| CONFIG_MTD_JEDECPROBE=y |  | ||||||
| CONFIG_MTD_MYLOADER_PARTS=y |  | ||||||
| CONFIG_MTD_TRXSPLIT=y |  | ||||||
| CONFIG_NEED_DMA_MAP_STATE=y |  | ||||||
| CONFIG_NEED_PER_CPU_KM=y |  | ||||||
| CONFIG_NO_EXCEPT_FILL=y |  | ||||||
| CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y |  | ||||||
| CONFIG_NO_HZ=y |  | ||||||
| CONFIG_NO_HZ_COMMON=y |  | ||||||
| CONFIG_NO_HZ_IDLE=y |  | ||||||
| # CONFIG_NO_IOPORT_MAP is not set |  | ||||||
| CONFIG_PAGEFLAGS_EXTENDED=y |  | ||||||
| # CONFIG_PARTITION_ADVANCED is not set |  | ||||||
| CONFIG_PCI=y |  | ||||||
| CONFIG_PCI_DISABLE_COMMON_QUIRKS=y |  | ||||||
| CONFIG_PCI_DOMAINS=y |  | ||||||
| CONFIG_PERF_USE_VMALLOC=y |  | ||||||
| # CONFIG_PREEMPT_RCU is not set |  | ||||||
| # CONFIG_RCU_STALL_COMMON is not set |  | ||||||
| # CONFIG_SCSI_DMA is not set |  | ||||||
| # CONFIG_SERIAL_8250 is not set |  | ||||||
| CONFIG_SERIAL_AMBA_PL010=y |  | ||||||
| CONFIG_SERIAL_AMBA_PL010_CONSOLE=y |  | ||||||
| CONFIG_SERIAL_AMBA_PL010_NUMPORTS=2 |  | ||||||
| # CONFIG_SERIAL_AMBA_PL011 is not set |  | ||||||
| CONFIG_SERIO=y |  | ||||||
| CONFIG_SERIO_SERPORT=y |  | ||||||
| # CONFIG_SWAP is not set |  | ||||||
| CONFIG_SYS_HAS_CPU_MIPS32_R1=y |  | ||||||
| CONFIG_SYS_HAS_EARLY_PRINTK=y |  | ||||||
| CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y |  | ||||||
| CONFIG_SYS_SUPPORTS_ARBIT_HZ=y |  | ||||||
| CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y |  | ||||||
| CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y |  | ||||||
| CONFIG_TICK_CPU_ACCOUNTING=y |  | ||||||
| CONFIG_USB_SUPPORT=y |  | ||||||
| CONFIG_WATCHDOG_CORE=y |  | ||||||
| CONFIG_ZONE_DMA_FLAG=0 |  | ||||||
| @@ -1,197 +0,0 @@ | |||||||
| if ADM5120 |  | ||||||
|  |  | ||||||
| menu "ADM5120 Board selection" |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_CAS_771 |  | ||||||
| 	bool "Cellvision CAS-771/771W support" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_SOC_BGA |  | ||||||
| 	select ADM5120_OEM_CELLVISION |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_NFS_101 |  | ||||||
| 	bool "Cellvision NFS-101U/101WU support" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_SOC_BGA |  | ||||||
| 	select ADM5120_OEM_CELLVISION |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_NP27G |  | ||||||
| 	bool "Compex NP27G support" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_SOC_BGA |  | ||||||
| 	select ADM5120_OEM_COMPEX |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_NP28G |  | ||||||
| 	bool "Compex NP28G support" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_SOC_BGA |  | ||||||
| 	select ADM5120_OEM_COMPEX |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_WP54 |  | ||||||
| 	bool "Compex WP54 family support" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_SOC_BGA |  | ||||||
| 	select ADM5120_OEM_COMPEX |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_EB_214A |  | ||||||
| 	bool "EB-214A support" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_SOC_BGA |  | ||||||
| 	select ADM5120_OEM_GENERIC |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_BR_6104K |  | ||||||
| 	bool "Edimax BR-6104K support" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_OEM_EDIMAX |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_BR_6104KP |  | ||||||
| 	bool "Edimax BR-6104KP support" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_OEM_EDIMAX |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_BR_61X4WG |  | ||||||
| 	bool "Edimax BR-6104WG/6114WG support" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_SOC_BGA |  | ||||||
| 	select ADM5120_OEM_EDIMAX |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_EASY5120_RT |  | ||||||
| 	bool "Infineon EASY 5120-RT Reference Board support" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_SOC_BGA |  | ||||||
| 	select ADM5120_OEM_INFINEON |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_EASY5120_WVOIP |  | ||||||
| 	bool "Infineon EASY 5120-WVoIP Reference Board support" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_SOC_BGA |  | ||||||
| 	select ADM5120_OEM_INFINEON |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_EASY5120P_ATA |  | ||||||
| 	bool "Infineon EASY 5120P-ATA Reference Board support" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_OEM_INFINEON |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_EASY83000 |  | ||||||
| 	bool "Infineon EASY 83000 Reference Board support" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_OEM_INFINEON |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_RB_11X |  | ||||||
| 	bool "MikroTik RouterBOARD 111/112 support" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_SOC_BGA |  | ||||||
| 	select ADM5120_OEM_MIKROTIK |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_RB_133 |  | ||||||
| 	bool "MikroTik RouterBOARD 133 support" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_SOC_BGA |  | ||||||
| 	select ADM5120_OEM_MIKROTIK |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_RB_133C |  | ||||||
| 	bool "MikroTik RouterBOARD 133C support" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_SOC_BGA |  | ||||||
| 	select ADM5120_OEM_MIKROTIK |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_RB_150 |  | ||||||
| 	bool "MikroTik RouterBOARD 150 support" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_OEM_MIKROTIK |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_RB_153 |  | ||||||
| 	bool "MikroTik RouterBOARD 153 support" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_SOC_BGA |  | ||||||
| 	select ADM5120_OEM_MIKROTIK |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_RB_192 |  | ||||||
| 	bool "MikroTik RouterBOARD 192 support" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_SOC_BGA |  | ||||||
| 	select ADM5120_OEM_MIKROTIK |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_PMUGW |  | ||||||
| 	bool "Motorola Powerline MU Gateway" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_SOC_BGA |  | ||||||
| 	select ADM5120_OEM_MOTOROLA |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_5GXI |  | ||||||
| 	bool "OSBRiDGE 5GXi/5XLi support" |  | ||||||
| 	depends on CPU_LITTLE_ENDIAN |  | ||||||
| 	select ADM5120_SOC_BGA |  | ||||||
| 	select ADM5120_OEM_OSBRIDGE |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_P_334WT |  | ||||||
| 	bool "ZyXEL Prestige 334WT" |  | ||||||
| 	depends on CPU_BIG_ENDIAN |  | ||||||
| 	select ADM5120_SOC_BGA |  | ||||||
| 	select ADM5120_OEM_ZYXEL |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| config ADM5120_MACH_P_335 |  | ||||||
| 	bool "ZyXEL Prestige 335/335WT" |  | ||||||
| 	depends on CPU_BIG_ENDIAN |  | ||||||
| 	select ADM5120_SOC_BGA |  | ||||||
| 	select ADM5120_OEM_ZYXEL |  | ||||||
| 	default y |  | ||||||
|  |  | ||||||
| endmenu |  | ||||||
|  |  | ||||||
| config ADM5120_SOC_BGA |  | ||||||
| 	select HW_HAS_PCI |  | ||||||
| 	def_bool n |  | ||||||
|  |  | ||||||
| config ADM5120_OEM_CELLVISION |  | ||||||
| 	def_bool n |  | ||||||
|  |  | ||||||
| config ADM5120_OEM_COMPEX |  | ||||||
| 	def_bool n |  | ||||||
|  |  | ||||||
| config ADM5120_OEM_EDIMAX |  | ||||||
| 	def_bool n |  | ||||||
|  |  | ||||||
| config ADM5120_OEM_GENERIC |  | ||||||
| 	def_bool n |  | ||||||
|  |  | ||||||
| config ADM5120_OEM_INFINEON |  | ||||||
| 	def_bool n |  | ||||||
|  |  | ||||||
| config ADM5120_OEM_MIKROTIK |  | ||||||
| 	def_bool n |  | ||||||
|  |  | ||||||
| config ADM5120_OEM_MOTOROLA |  | ||||||
| 	def_bool n |  | ||||||
|  |  | ||||||
| config ADM5120_OEM_OSBRIDGE |  | ||||||
| 	def_bool n |  | ||||||
|  |  | ||||||
| config ADM5120_OEM_ZYXEL |  | ||||||
| 	def_bool n |  | ||||||
|  |  | ||||||
| config ARM_AMBA |  | ||||||
| 	def_bool y |  | ||||||
|  |  | ||||||
| endif |  | ||||||
| @@ -1,19 +0,0 @@ | |||||||
| # |  | ||||||
| # Infineon/ADMtek ADM5120 |  | ||||||
| # |  | ||||||
|  |  | ||||||
| platform-$(CONFIG_ADM5120)			+= adm5120/common/ |  | ||||||
|  |  | ||||||
| platform-$(CONFIG_ADM5120_OEM_CELLVISION)	+= adm5120/cellvision/ |  | ||||||
| platform-$(CONFIG_ADM5120_OEM_COMPEX)		+= adm5120/compex/ |  | ||||||
| platform-$(CONFIG_ADM5120_OEM_EDIMAX)		+= adm5120/edimax/ |  | ||||||
| platform-$(CONFIG_ADM5120_OEM_GENERIC)		+= adm5120/generic/ |  | ||||||
| platform-$(CONFIG_ADM5120_OEM_INFINEON)		+= adm5120/infineon/ |  | ||||||
| platform-$(CONFIG_ADM5120_OEM_MIKROTIK)		+= adm5120/mikrotik/ |  | ||||||
| platform-$(CONFIG_ADM5120_OEM_MOTOROLA)		+= adm5120/motorola/ |  | ||||||
| platform-$(CONFIG_ADM5120_OEM_OSBRIDGE)		+= adm5120/osbridge/ |  | ||||||
| platform-$(CONFIG_ADM5120_OEM_ZYXEL)		+= adm5120/zyxel/ |  | ||||||
|  |  | ||||||
| cflags-$(CONFIG_ADM5120)			+= -I$(srctree)/arch/mips/include/asm/mach-adm5120 |  | ||||||
| libs-$(CONFIG_ADM5120)				+= arch/mips/adm5120/prom/ |  | ||||||
| load-$(CONFIG_ADM5120)				+= 0xffffffff80001000 |  | ||||||
| @@ -1,4 +0,0 @@ | |||||||
| obj-y	+= cellvision.o |  | ||||||
|  |  | ||||||
| obj-$(CONFIG_ADM5120_MACH_CAS_771)	+= cas-771.o |  | ||||||
| obj-$(CONFIG_ADM5120_MACH_NFS_101)	+= nfs-101.o |  | ||||||
| @@ -1,37 +0,0 @@ | |||||||
| /* |  | ||||||
|  *  Cellvision/SparkLAN CAS-771/771W support |  | ||||||
|  * |  | ||||||
|  *  Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org> |  | ||||||
|  * |  | ||||||
|  *  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 "cellvision.h" |  | ||||||
|  |  | ||||||
| static struct adm5120_pci_irq cas771_pci_irqs[] __initdata = { |  | ||||||
| 	PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0), |  | ||||||
| 	PCIIRQ(3, 0, 1, ADM5120_IRQ_PCI1), |  | ||||||
| 	PCIIRQ(3, 2, 3, ADM5120_IRQ_PCI2) |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| static struct gpio_led cas771_gpio_leds[] __initdata = { |  | ||||||
| 	GPIO_LED_STD(ADM5120_GPIO_PIN0, "cam_flash",	NULL), |  | ||||||
| 	/* GPIO PIN3 is the reset */ |  | ||||||
| 	GPIO_LED_STD(ADM5120_GPIO_PIN6, "access",	NULL), |  | ||||||
| 	GPIO_LED_STD(ADM5120_GPIO_P0L1, "status",	NULL), |  | ||||||
| 	GPIO_LED_STD(ADM5120_GPIO_P0L2, "diag",		NULL), |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| static void __init cas771_setup(void) |  | ||||||
| { |  | ||||||
| 	cas7xx_setup(); |  | ||||||
| 	adm5120_add_device_gpio_leds(ARRAY_SIZE(cas771_gpio_leds), |  | ||||||
| 					cas771_gpio_leds); |  | ||||||
| 	adm5120_pci_set_irq_map(ARRAY_SIZE(cas771_pci_irqs), cas771_pci_irqs); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| MIPS_MACHINE(MACH_ADM5120_CAS771, "CAS-771", "Cellvision CAS-771/771W", |  | ||||||
| 	     cas771_setup); |  | ||||||
| @@ -1,147 +0,0 @@ | |||||||
| /* |  | ||||||
|  *  Cellvision/SparkLAN boards |  | ||||||
|  * |  | ||||||
|  *  Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org> |  | ||||||
|  * |  | ||||||
|  *  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 "cellvision.h" |  | ||||||
|  |  | ||||||
| #include <prom/admboot.h> |  | ||||||
|  |  | ||||||
| #define CELLVISION_GPIO_FLASH_A20	ADM5120_GPIO_PIN5 |  | ||||||
| #define CELLVISION_GPIO_DEV_MASK	(1 << CELLVISION_GPIO_FLASH_A20) |  | ||||||
|  |  | ||||||
| #define CELLVISION_CONFIG_OFFSET	0x8000 |  | ||||||
| #define CELLVISION_CONFIG_SIZE		0x1000 |  | ||||||
|  |  | ||||||
| static struct mtd_partition cas6xx_partitions[] = { |  | ||||||
| 	{ |  | ||||||
| 		.name	= "admboot", |  | ||||||
| 		.offset	= 0, |  | ||||||
| 		.size	= 32*1024, |  | ||||||
| 		.mask_flags = MTD_WRITEABLE, |  | ||||||
| 	} , { |  | ||||||
| 		.name	= "config", |  | ||||||
| 		.offset	= MTDPART_OFS_APPEND, |  | ||||||
| 		.size	= 32*1024, |  | ||||||
| 	} , { |  | ||||||
| 		.name	= "nvfs1", |  | ||||||
| 		.offset	= MTDPART_OFS_APPEND, |  | ||||||
| 		.size	= 64*1024, |  | ||||||
| 	} , { |  | ||||||
| 		.name	= "nvfs2", |  | ||||||
| 		.offset	= MTDPART_OFS_APPEND, |  | ||||||
| 		.size	= 64*1024, |  | ||||||
| 	} , { |  | ||||||
| 		.name	= "firmware", |  | ||||||
| 		.offset	= MTDPART_OFS_APPEND, |  | ||||||
| 		.size	= MTDPART_SIZ_FULL, |  | ||||||
| 	} |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| static struct mtd_partition cas7xx_partitions[] = { |  | ||||||
| 	{ |  | ||||||
| 		.name	= "admboot", |  | ||||||
| 		.offset	= 0, |  | ||||||
| 		.size	= 32*1024, |  | ||||||
| 		.mask_flags = MTD_WRITEABLE, |  | ||||||
| 	} , { |  | ||||||
| 		.name	= "config", |  | ||||||
| 		.offset	= MTDPART_OFS_APPEND, |  | ||||||
| 		.size	= 32*1024, |  | ||||||
| 	} , { |  | ||||||
| 		.name	= "nvfs", |  | ||||||
| 		.offset	= MTDPART_OFS_APPEND, |  | ||||||
| 		.size	= 128*1024, |  | ||||||
| 	} , { |  | ||||||
| 		.name	= "firmware", |  | ||||||
| 		.offset	= MTDPART_OFS_APPEND, |  | ||||||
| 		.size	= MTDPART_SIZ_FULL, |  | ||||||
| 	} |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| static void switch_bank_gpio5(unsigned bank) |  | ||||||
| { |  | ||||||
| 	switch (bank) { |  | ||||||
| 	case 0: |  | ||||||
| 		gpio_set_value(CELLVISION_GPIO_FLASH_A20, 0); |  | ||||||
| 		break; |  | ||||||
| 	case 1: |  | ||||||
| 		gpio_set_value(CELLVISION_GPIO_FLASH_A20, 1); |  | ||||||
| 		break; |  | ||||||
| 	} |  | ||||||
| } |  | ||||||
|  |  | ||||||
| static void __init cellvision_flash_setup(void) |  | ||||||
| { |  | ||||||
| 	/* setup flash A20 line */ |  | ||||||
| 	gpio_request(CELLVISION_GPIO_FLASH_A20, NULL); |  | ||||||
| 	gpio_direction_output(CELLVISION_GPIO_FLASH_A20, 0); |  | ||||||
|  |  | ||||||
| 	adm5120_flash0_data.switch_bank = switch_bank_gpio5; |  | ||||||
| 	adm5120_add_device_flash(0); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void __init cellvision_mac_setup(void) |  | ||||||
| { |  | ||||||
| 	u8 mac_base[6]; |  | ||||||
| 	int err; |  | ||||||
|  |  | ||||||
| 	err = admboot_get_mac_base(CELLVISION_CONFIG_OFFSET, |  | ||||||
| 				   CELLVISION_CONFIG_SIZE, mac_base); |  | ||||||
|  |  | ||||||
| 	if ((err) || !is_valid_ether_addr(mac_base)) |  | ||||||
| 		random_ether_addr(mac_base); |  | ||||||
|  |  | ||||||
| 	adm5120_setup_eth_macs(mac_base); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void __init cas6xx_flash_setup(void) |  | ||||||
| { |  | ||||||
| 	adm5120_flash0_data.nr_parts = ARRAY_SIZE(cas6xx_partitions); |  | ||||||
| 	adm5120_flash0_data.parts = cas6xx_partitions; |  | ||||||
|  |  | ||||||
| 	cellvision_flash_setup(); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void __init cas7xx_flash_setup(void) |  | ||||||
| { |  | ||||||
| 	adm5120_flash0_data.nr_parts = ARRAY_SIZE(cas7xx_partitions); |  | ||||||
| 	adm5120_flash0_data.parts = cas7xx_partitions; |  | ||||||
|  |  | ||||||
| 	cellvision_flash_setup(); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void __init cas6xx_setup(void) |  | ||||||
| { |  | ||||||
| 	cas6xx_flash_setup(); |  | ||||||
| 	adm5120_add_device_uart(0); |  | ||||||
| 	adm5120_add_device_uart(1); |  | ||||||
| 	adm5120_add_device_switch(1, NULL); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| MIPS_MACHINE(MACH_ADM5120_CAS630, "CAS-630", "Cellvision CAS-630/630W", |  | ||||||
| 	     cas6xx_setup); |  | ||||||
| MIPS_MACHINE(MACH_ADM5120_CAS670, "CAS-670", "Cellvision CAS-670/670W", |  | ||||||
| 	     cas6xx_setup); |  | ||||||
|  |  | ||||||
| void __init cas7xx_setup(void) |  | ||||||
| { |  | ||||||
| 	cas7xx_flash_setup(); |  | ||||||
| 	cellvision_mac_setup(); |  | ||||||
| 	adm5120_add_device_uart(0); |  | ||||||
| 	adm5120_add_device_uart(1); |  | ||||||
| 	adm5120_add_device_switch(1, NULL); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| MIPS_MACHINE(MACH_ADM5120_CAS700, "CAS-700", "Cellvision CAS-700/700W", |  | ||||||
| 	     cas7xx_setup); |  | ||||||
| MIPS_MACHINE(MACH_ADM5120_CAS790, "CAS-790", "Cellvision CAS-790", |  | ||||||
| 	     cas7xx_setup); |  | ||||||
| MIPS_MACHINE(MACH_ADM5120_CAS861, "CAS-861", "Cellvision CAS-861/861W", |  | ||||||
| 	     cas7xx_setup); |  | ||||||
| @@ -1,28 +0,0 @@ | |||||||
| /* |  | ||||||
|  *  Cellvision/SparkLAN boards |  | ||||||
|  * |  | ||||||
|  *  Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org> |  | ||||||
|  * |  | ||||||
|  *  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 <linux/kernel.h> |  | ||||||
| #include <linux/init.h> |  | ||||||
| #include <linux/gpio.h> |  | ||||||
| #include <linux/irq.h> |  | ||||||
| #include <linux/etherdevice.h> |  | ||||||
|  |  | ||||||
| #include <asm/mips_machine.h> |  | ||||||
|  |  | ||||||
| #include <asm/mach-adm5120/adm5120_info.h> |  | ||||||
| #include <asm/mach-adm5120/adm5120_platform.h> |  | ||||||
|  |  | ||||||
| extern void cellvision_mac_setup(void) __init; |  | ||||||
|  |  | ||||||
| extern void cas6xx_flash_setup(void) __init; |  | ||||||
| extern void cas7xx_flash_setup(void) __init; |  | ||||||
| extern void cas6xx_setup(void) __init; |  | ||||||
| extern void cas7xx_setup(void) __init; |  | ||||||
| @@ -1,47 +0,0 @@ | |||||||
| /* |  | ||||||
|  *  Cellvision/SparkLAN NFS-101U/WU support |  | ||||||
|  * |  | ||||||
|  *  Copyright (C) 2007-2009 Gabor Juhos <juhosg@openwrt.org> |  | ||||||
|  * |  | ||||||
|  *  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 "cellvision.h" |  | ||||||
|  |  | ||||||
| static struct adm5120_pci_irq nfs101_pci_irqs[] __initdata = { |  | ||||||
| 	/* miniPCI slot */ |  | ||||||
| 	PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0), |  | ||||||
|  |  | ||||||
| 	/* ALi USB controller */ |  | ||||||
| 	PCIIRQ(3, 0, 2, ADM5120_IRQ_PCI2), |  | ||||||
| 	PCIIRQ(3, 3, 1, ADM5120_IRQ_PCI1), |  | ||||||
|  |  | ||||||
| 	/* NEC USB controller */ |  | ||||||
| 	PCIIRQ(3, 0, 1, ADM5120_IRQ_PCI1), |  | ||||||
| 	PCIIRQ(3, 1, 2, ADM5120_IRQ_PCI2), |  | ||||||
| 	PCIIRQ(3, 2, 3, ADM5120_IRQ_PCI2), |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| static u8 nfs101_vlans[6] __initdata = { |  | ||||||
| 	/* FIXME: not tested */ |  | ||||||
| 	0x5f, 0x00, 0x00, 0x00, 0x00, 0x00 |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| static void __init nfs101_setup(void) |  | ||||||
| { |  | ||||||
| 	cas6xx_flash_setup(); |  | ||||||
| 	cellvision_mac_setup(); |  | ||||||
|  |  | ||||||
| 	adm5120_add_device_uart(0); |  | ||||||
| 	adm5120_add_device_uart(1); |  | ||||||
| 	adm5120_add_device_switch(1, nfs101_vlans); |  | ||||||
|  |  | ||||||
| 	adm5120_pci_set_irq_map(ARRAY_SIZE(nfs101_pci_irqs), |  | ||||||
| 				nfs101_pci_irqs); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| MIPS_MACHINE(MACH_ADM5120_NFS101U, "NFS-101U", "Cellvision NFS-101U/101WU", |  | ||||||
| 	     nfs101_setup); |  | ||||||
| @@ -1,8 +0,0 @@ | |||||||
| # |  | ||||||
| # Makefile for the Infineon/ADMtek ADM5120 SoC specific parts of the kernel |  | ||||||
| # |  | ||||||
|  |  | ||||||
| obj-y	:= adm5120.o setup.o prom.o irq.o memory.o clock.o \ |  | ||||||
| 	   gpio.o platform.o |  | ||||||
|  |  | ||||||
| obj-$(CONFIG_EARLY_PRINTK)	+= early-printk.o |  | ||||||
| @@ -1,76 +0,0 @@ | |||||||
| /* |  | ||||||
|  *  Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org> |  | ||||||
|  * |  | ||||||
|  *  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 <linux/types.h> |  | ||||||
| #include <linux/kernel.h> |  | ||||||
| #include <linux/init.h> |  | ||||||
| #include <linux/io.h> |  | ||||||
|  |  | ||||||
| #include <asm/addrspace.h> |  | ||||||
|  |  | ||||||
| #include <asm/mach-adm5120/adm5120_info.h> |  | ||||||
| #include <asm/mach-adm5120/adm5120_defs.h> |  | ||||||
| #include <asm/mach-adm5120/adm5120_switch.h> |  | ||||||
|  |  | ||||||
| unsigned int adm5120_product_code; |  | ||||||
| unsigned int adm5120_revision; |  | ||||||
| unsigned int adm5120_package; |  | ||||||
| unsigned int adm5120_nand_boot; |  | ||||||
| unsigned long adm5120_speed; |  | ||||||
|  |  | ||||||
| /* |  | ||||||
|  * CPU settings detection |  | ||||||
|  */ |  | ||||||
| #define CODE_GET_PC(c)		((c) & CODE_PC_MASK) |  | ||||||
| #define CODE_GET_REV(c)		(((c) >> CODE_REV_SHIFT) & CODE_REV_MASK) |  | ||||||
| #define CODE_GET_PK(c)		(((c) >> CODE_PK_SHIFT) & CODE_PK_MASK) |  | ||||||
| #define CODE_GET_CLKS(c)	(((c) >> CODE_CLKS_SHIFT) & CODE_CLKS_MASK) |  | ||||||
| #define CODE_GET_NAB(c)		(((c) & CODE_NAB) != 0) |  | ||||||
|  |  | ||||||
| void adm5120_ndelay(u32 ns) |  | ||||||
| { |  | ||||||
| 	u32	t; |  | ||||||
|  |  | ||||||
| 	SW_WRITE_REG(SWITCH_REG_TIMER, TIMER_PERIOD_DEFAULT); |  | ||||||
| 	SW_WRITE_REG(SWITCH_REG_TIMER_INT, (TIMER_INT_TOS | TIMER_INT_TOM)); |  | ||||||
|  |  | ||||||
| 	t = (ns+640) / 640; |  | ||||||
| 	t &= TIMER_PERIOD_MASK; |  | ||||||
| 	SW_WRITE_REG(SWITCH_REG_TIMER, t | TIMER_TE); |  | ||||||
|  |  | ||||||
| 	/* wait until the timer expires */ |  | ||||||
| 	do { |  | ||||||
| 		t = SW_READ_REG(SWITCH_REG_TIMER_INT); |  | ||||||
| 	} while ((t & TIMER_INT_TOS) == 0); |  | ||||||
|  |  | ||||||
| 	/* leave the timer disabled */ |  | ||||||
| 	SW_WRITE_REG(SWITCH_REG_TIMER, TIMER_PERIOD_DEFAULT); |  | ||||||
| 	SW_WRITE_REG(SWITCH_REG_TIMER_INT, (TIMER_INT_TOS | TIMER_INT_TOM)); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void __init adm5120_soc_init(void) |  | ||||||
| { |  | ||||||
| 	u32 code; |  | ||||||
| 	u32 clks; |  | ||||||
|  |  | ||||||
| 	code = SW_READ_REG(SWITCH_REG_CODE); |  | ||||||
|  |  | ||||||
| 	adm5120_product_code = CODE_GET_PC(code); |  | ||||||
| 	adm5120_revision = CODE_GET_REV(code); |  | ||||||
| 	adm5120_package = (CODE_GET_PK(code) == CODE_PK_BGA) ? |  | ||||||
| 		ADM5120_PACKAGE_BGA : ADM5120_PACKAGE_PQFP; |  | ||||||
| 	adm5120_nand_boot = CODE_GET_NAB(code); |  | ||||||
|  |  | ||||||
| 	clks = CODE_GET_CLKS(code); |  | ||||||
| 	adm5120_speed = ADM5120_SPEED_175; |  | ||||||
| 	if (clks & 1) |  | ||||||
| 		adm5120_speed += 25000000; |  | ||||||
| 	if (clks & 2) |  | ||||||
| 		adm5120_speed += 50000000; |  | ||||||
| } |  | ||||||
| @@ -1,65 +0,0 @@ | |||||||
| /* |  | ||||||
|  *  ADM5120 minimal CLK API implementation |  | ||||||
|  * |  | ||||||
|  *  Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org> |  | ||||||
|  * |  | ||||||
|  *  This file was based on the CLK API implementation in: |  | ||||||
|  *	arch/mips/tx4938/toshiba_rbtx4938/setup.c |  | ||||||
|  *	Copyright (C) 2000-2001 Toshiba Corporation |  | ||||||
|  *	2003-2005 (c) MontaVista Software, Inc. |  | ||||||
|  * |  | ||||||
|  *  This program is free software; you can redistribute it and/or modify it |  | ||||||
|  *  under the terms of the GNU General Public License version 2 as published |  | ||||||
|  *  by the Free Software Foundation. |  | ||||||
|  * |  | ||||||
|  */ |  | ||||||
|  |  | ||||||
| #include <linux/kernel.h> |  | ||||||
| #include <linux/string.h> |  | ||||||
| #include <linux/module.h> |  | ||||||
| #include <linux/err.h> |  | ||||||
| #include <linux/clk.h> |  | ||||||
| #include <linux/device.h> |  | ||||||
|  |  | ||||||
| #include <asm/mach-adm5120/adm5120_defs.h> |  | ||||||
|  |  | ||||||
| struct clk { |  | ||||||
| 	unsigned long rate; |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| static struct clk uart_clk = { |  | ||||||
| 	.rate = ADM5120_UART_CLOCK |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| struct clk *clk_get(struct device *dev, const char *id) |  | ||||||
| { |  | ||||||
| 	const char *name = dev_name(dev); |  | ||||||
|  |  | ||||||
| 	if (!strcmp(name, "apb:uart0") || !strcmp(name, "apb:uart1")) |  | ||||||
| 		return &uart_clk; |  | ||||||
|  |  | ||||||
| 	return ERR_PTR(-ENOENT); |  | ||||||
| } |  | ||||||
| EXPORT_SYMBOL(clk_get); |  | ||||||
|  |  | ||||||
| int clk_enable(struct clk *clk) |  | ||||||
| { |  | ||||||
| 	return 0; |  | ||||||
| } |  | ||||||
| EXPORT_SYMBOL(clk_enable); |  | ||||||
|  |  | ||||||
| void clk_disable(struct clk *clk) |  | ||||||
| { |  | ||||||
| } |  | ||||||
| EXPORT_SYMBOL(clk_disable); |  | ||||||
|  |  | ||||||
| unsigned long clk_get_rate(struct clk *clk) |  | ||||||
| { |  | ||||||
| 	return clk->rate; |  | ||||||
| } |  | ||||||
| EXPORT_SYMBOL(clk_get_rate); |  | ||||||
|  |  | ||||||
| void clk_put(struct clk *clk) |  | ||||||
| { |  | ||||||
| } |  | ||||||
| EXPORT_SYMBOL(clk_put); |  | ||||||
| @@ -1,31 +0,0 @@ | |||||||
| /* |  | ||||||
|  *  ADM5120 specific early printk support |  | ||||||
|  * |  | ||||||
|  *  Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org> |  | ||||||
|  * |  | ||||||
|  *  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 <linux/init.h> |  | ||||||
| #include <linux/io.h> |  | ||||||
|  |  | ||||||
| #include <asm/addrspace.h> |  | ||||||
| #include <asm/mach-adm5120/adm5120_defs.h> |  | ||||||
| #include <asm/mach-adm5120/adm5120_uart.h> |  | ||||||
|  |  | ||||||
| #define UART_READ(r) \ |  | ||||||
| 	__raw_readl((void __iomem *)(KSEG1ADDR(ADM5120_UART0_BASE)+(r))) |  | ||||||
| #define UART_WRITE(r, v) \ |  | ||||||
| 	__raw_writel((v), (void __iomem *)(KSEG1ADDR(ADM5120_UART0_BASE)+(r))) |  | ||||||
|  |  | ||||||
| void __init prom_putchar(char ch) |  | ||||||
| { |  | ||||||
| 	while ((UART_READ(UART_REG_FLAG) & UART_FLAG_TXFE) == 0) |  | ||||||
| 		; |  | ||||||
| 	UART_WRITE(UART_REG_DATA, ch); |  | ||||||
| 	while ((UART_READ(UART_REG_FLAG) & UART_FLAG_TXFE) == 0) |  | ||||||
| 		; |  | ||||||
| } |  | ||||||
| @@ -1,328 +0,0 @@ | |||||||
| /* |  | ||||||
|  *  ADM5120 generic GPIO API support via GPIOLIB |  | ||||||
|  * |  | ||||||
|  *  Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org> |  | ||||||
|  * |  | ||||||
|  *  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 <linux/init.h> |  | ||||||
| #include <linux/types.h> |  | ||||||
| #include <linux/module.h> |  | ||||||
| #include <linux/irq.h> |  | ||||||
| #include <linux/delay.h> |  | ||||||
| #include <linux/platform_device.h> |  | ||||||
| #include <linux/io.h> |  | ||||||
| #include <linux/gpio.h> |  | ||||||
|  |  | ||||||
| #include <asm/addrspace.h> |  | ||||||
|  |  | ||||||
| #include <asm/mach-adm5120/adm5120_defs.h> |  | ||||||
| #include <asm/mach-adm5120/adm5120_info.h> |  | ||||||
| #include <asm/mach-adm5120/adm5120_switch.h> |  | ||||||
|  |  | ||||||
| #define GPIO_REG(r)	(void __iomem *)(KSEG1ADDR(ADM5120_SWITCH_BASE) + r) |  | ||||||
|  |  | ||||||
| struct gpio1_desc { |  | ||||||
| 	void __iomem	*reg;		/* register address */ |  | ||||||
| 	u8		iv_shift;	/* shift amount for input bit */ |  | ||||||
| 	u8		mode_shift;	/* shift amount for mode bits */ |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| #define GPIO1_DESC(p, l) {						\ |  | ||||||
| 		.reg = GPIO_REG(SWITCH_REG_PORT0_LED + ((p) * 4)),	\ |  | ||||||
| 		.iv_shift = LED0_IV_SHIFT + (l),			\ |  | ||||||
| 		.mode_shift = (l) * 4					\ |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| static struct gpio1_desc gpio1_table[15] = { |  | ||||||
| 	GPIO1_DESC(0, 0), GPIO1_DESC(0, 1), GPIO1_DESC(0, 2), |  | ||||||
| 	GPIO1_DESC(1, 0), GPIO1_DESC(1, 1), GPIO1_DESC(1, 2), |  | ||||||
| 	GPIO1_DESC(2, 0), GPIO1_DESC(2, 1), GPIO1_DESC(2, 2), |  | ||||||
| 	GPIO1_DESC(3, 0), GPIO1_DESC(3, 1), GPIO1_DESC(3, 2), |  | ||||||
| 	GPIO1_DESC(4, 0), GPIO1_DESC(4, 1), GPIO1_DESC(4, 2) |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| static u32 gpio_conf2; |  | ||||||
|  |  | ||||||
| int adm5120_gpio_to_irq(unsigned gpio) |  | ||||||
| { |  | ||||||
| 	int ret; |  | ||||||
|  |  | ||||||
| 	switch (gpio) { |  | ||||||
| 	case ADM5120_GPIO_PIN2: |  | ||||||
| 		ret = ADM5120_IRQ_GPIO2; |  | ||||||
| 		break; |  | ||||||
| 	case ADM5120_GPIO_PIN4: |  | ||||||
| 		ret = ADM5120_IRQ_GPIO4; |  | ||||||
| 		break; |  | ||||||
| 	default: |  | ||||||
| 		ret = -EINVAL; |  | ||||||
| 		break; |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	return ret; |  | ||||||
| } |  | ||||||
| EXPORT_SYMBOL(adm5120_gpio_to_irq); |  | ||||||
|  |  | ||||||
| int adm5120_irq_to_gpio(unsigned irq) |  | ||||||
| { |  | ||||||
| 	int ret; |  | ||||||
|  |  | ||||||
| 	switch (irq) { |  | ||||||
| 	case ADM5120_IRQ_GPIO2: |  | ||||||
| 		ret = ADM5120_GPIO_PIN2; |  | ||||||
| 		break; |  | ||||||
| 	case ADM5120_IRQ_GPIO4: |  | ||||||
| 		ret = ADM5120_GPIO_PIN4; |  | ||||||
| 		break; |  | ||||||
| 	default: |  | ||||||
| 		ret = -EINVAL; |  | ||||||
| 		break; |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	return ret; |  | ||||||
| } |  | ||||||
| EXPORT_SYMBOL(adm5120_irq_to_gpio); |  | ||||||
|  |  | ||||||
| /* |  | ||||||
|  * Helpers for GPIO lines in GPIO_CONF0 register |  | ||||||
|  */ |  | ||||||
| #define PIN_IM(p)	((1 << GPIO_CONF0_IM_SHIFT) << p) |  | ||||||
| #define PIN_IV(p)	((1 << GPIO_CONF0_IV_SHIFT) << p) |  | ||||||
| #define PIN_OE(p)	((1 << GPIO_CONF0_OE_SHIFT) << p) |  | ||||||
| #define PIN_OV(p)	((1 << GPIO_CONF0_OV_SHIFT) << p) |  | ||||||
|  |  | ||||||
| int __adm5120_gpio0_get_value(unsigned offset) |  | ||||||
| { |  | ||||||
| 	void __iomem **reg; |  | ||||||
| 	u32 t; |  | ||||||
|  |  | ||||||
| 	reg = GPIO_REG(SWITCH_REG_GPIO_CONF0); |  | ||||||
|  |  | ||||||
| 	t = __raw_readl(reg); |  | ||||||
| 	if ((t & PIN_IM(offset)) != 0) |  | ||||||
| 		t &= PIN_IV(offset); |  | ||||||
| 	else |  | ||||||
| 		t &= PIN_OV(offset); |  | ||||||
|  |  | ||||||
| 	return (t) ? 1 : 0; |  | ||||||
| } |  | ||||||
| EXPORT_SYMBOL(__adm5120_gpio0_get_value); |  | ||||||
|  |  | ||||||
| void __adm5120_gpio0_set_value(unsigned offset, int value) |  | ||||||
| { |  | ||||||
| 	void __iomem **reg; |  | ||||||
| 	u32 t; |  | ||||||
|  |  | ||||||
| 	reg = GPIO_REG(SWITCH_REG_GPIO_CONF0); |  | ||||||
|  |  | ||||||
| 	t = __raw_readl(reg); |  | ||||||
| 	if (value == 0) |  | ||||||
| 		t &= ~(PIN_OV(offset)); |  | ||||||
| 	else |  | ||||||
| 		t |= PIN_OV(offset); |  | ||||||
|  |  | ||||||
| 	__raw_writel(t, reg); |  | ||||||
| } |  | ||||||
| EXPORT_SYMBOL(__adm5120_gpio0_set_value); |  | ||||||
|  |  | ||||||
| static int adm5120_gpio0_get_value(struct gpio_chip *chip, unsigned offset) |  | ||||||
| { |  | ||||||
| 	return __adm5120_gpio0_get_value(offset); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| static void adm5120_gpio0_set_value(struct gpio_chip *chip, |  | ||||||
| 				    unsigned offset, int value) |  | ||||||
| { |  | ||||||
| 	__adm5120_gpio0_set_value(offset, value); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| static int adm5120_gpio0_direction_input(struct gpio_chip *chip, |  | ||||||
| 					 unsigned offset) |  | ||||||
| { |  | ||||||
| 	void __iomem **reg; |  | ||||||
| 	u32 t; |  | ||||||
|  |  | ||||||
| 	reg = GPIO_REG(SWITCH_REG_GPIO_CONF0); |  | ||||||
|  |  | ||||||
| 	t = __raw_readl(reg); |  | ||||||
| 	t &= ~(PIN_OE(offset)); |  | ||||||
| 	t |= PIN_IM(offset); |  | ||||||
| 	__raw_writel(t, reg); |  | ||||||
|  |  | ||||||
| 	return 0; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| static int adm5120_gpio0_direction_output(struct gpio_chip *chip, |  | ||||||
| 					  unsigned offset, int value) |  | ||||||
| { |  | ||||||
| 	void __iomem **reg; |  | ||||||
| 	u32 t; |  | ||||||
|  |  | ||||||
| 	reg = GPIO_REG(SWITCH_REG_GPIO_CONF0); |  | ||||||
|  |  | ||||||
| 	t = __raw_readl(reg); |  | ||||||
| 	t &= ~(PIN_IM(offset) | PIN_OV(offset)); |  | ||||||
| 	t |= PIN_OE(offset); |  | ||||||
|  |  | ||||||
| 	if (value) |  | ||||||
| 		t |= PIN_OV(offset); |  | ||||||
|  |  | ||||||
| 	__raw_writel(t, reg); |  | ||||||
|  |  | ||||||
| 	return 0; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| static struct gpio_chip adm5120_gpio0_chip = { |  | ||||||
| 	.label			= "adm5120 gpio0", |  | ||||||
| 	.get			= adm5120_gpio0_get_value, |  | ||||||
| 	.set			= adm5120_gpio0_set_value, |  | ||||||
| 	.direction_input	= adm5120_gpio0_direction_input, |  | ||||||
| 	.direction_output	= adm5120_gpio0_direction_output, |  | ||||||
| 	.base			= ADM5120_GPIO_PIN0, |  | ||||||
| 	.ngpio			= ADM5120_GPIO_PIN7 - ADM5120_GPIO_PIN0 + 1, |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| int __adm5120_gpio1_get_value(unsigned offset) |  | ||||||
| { |  | ||||||
| 	void __iomem **reg; |  | ||||||
| 	u32 t, m; |  | ||||||
|  |  | ||||||
| 	reg = gpio1_table[offset].reg; |  | ||||||
|  |  | ||||||
| 	t = __raw_readl(reg); |  | ||||||
| 	m = (t >> gpio1_table[offset].mode_shift) & LED_MODE_MASK; |  | ||||||
| 	if (m == LED_MODE_INPUT) |  | ||||||
| 		return (t >> gpio1_table[offset].iv_shift) & 1; |  | ||||||
|  |  | ||||||
| 	if (m == LED_MODE_OUT_LOW) |  | ||||||
| 		return 0; |  | ||||||
|  |  | ||||||
| 	return 1; |  | ||||||
| } |  | ||||||
| EXPORT_SYMBOL(__adm5120_gpio1_get_value); |  | ||||||
|  |  | ||||||
| void __adm5120_gpio1_set_value(unsigned offset, int value) |  | ||||||
| { |  | ||||||
| 	void __iomem **reg; |  | ||||||
| 	u32 t, s; |  | ||||||
|  |  | ||||||
| 	reg = gpio1_table[offset].reg; |  | ||||||
| 	s = gpio1_table[offset].mode_shift; |  | ||||||
|  |  | ||||||
| 	t = __raw_readl(reg); |  | ||||||
| 	t &= ~(LED_MODE_MASK << s); |  | ||||||
|  |  | ||||||
| 	switch (value) { |  | ||||||
| 	case ADM5120_GPIO_LOW: |  | ||||||
| 		t |= (LED_MODE_OUT_LOW << s); |  | ||||||
| 		break; |  | ||||||
| 	case ADM5120_GPIO_FLASH: |  | ||||||
| 	case ADM5120_GPIO_LINK: |  | ||||||
| 	case ADM5120_GPIO_SPEED: |  | ||||||
| 	case ADM5120_GPIO_DUPLEX: |  | ||||||
| 	case ADM5120_GPIO_ACT: |  | ||||||
| 	case ADM5120_GPIO_COLL: |  | ||||||
| 	case ADM5120_GPIO_LINK_ACT: |  | ||||||
| 	case ADM5120_GPIO_DUPLEX_COLL: |  | ||||||
| 	case ADM5120_GPIO_10M_ACT: |  | ||||||
| 	case ADM5120_GPIO_100M_ACT: |  | ||||||
| 		t |= ((value & LED_MODE_MASK) << s); |  | ||||||
| 		break; |  | ||||||
| 	default: |  | ||||||
| 		t |= (LED_MODE_OUT_HIGH << s); |  | ||||||
| 		break; |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	__raw_writel(t, reg); |  | ||||||
| } |  | ||||||
| EXPORT_SYMBOL(__adm5120_gpio1_set_value); |  | ||||||
|  |  | ||||||
| static int adm5120_gpio1_get_value(struct gpio_chip *chip, unsigned offset) |  | ||||||
| { |  | ||||||
| 	return __adm5120_gpio1_get_value(offset); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| static void adm5120_gpio1_set_value(struct gpio_chip *chip, |  | ||||||
| 				    unsigned offset, int value) |  | ||||||
| { |  | ||||||
| 	__adm5120_gpio1_set_value(offset, value); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| static int adm5120_gpio1_direction_input(struct gpio_chip *chip, |  | ||||||
| 					 unsigned offset) |  | ||||||
| { |  | ||||||
| 	void __iomem **reg; |  | ||||||
| 	u32 t; |  | ||||||
|  |  | ||||||
| 	reg = gpio1_table[offset].reg; |  | ||||||
| 	t = __raw_readl(reg); |  | ||||||
| 	t &= ~(LED_MODE_MASK << gpio1_table[offset].mode_shift); |  | ||||||
| 	__raw_writel(t, reg); |  | ||||||
|  |  | ||||||
| 	return 0; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| static int adm5120_gpio1_direction_output(struct gpio_chip *chip, |  | ||||||
| 					  unsigned offset, int value) |  | ||||||
| { |  | ||||||
| 	__adm5120_gpio1_set_value(offset, value); |  | ||||||
| 	return 0; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| static struct gpio_chip adm5120_gpio1_chip = { |  | ||||||
| 	.label			= "adm5120 gpio1", |  | ||||||
| 	.get			= adm5120_gpio1_get_value, |  | ||||||
| 	.set			= adm5120_gpio1_set_value, |  | ||||||
| 	.direction_input	= adm5120_gpio1_direction_input, |  | ||||||
| 	.direction_output	= adm5120_gpio1_direction_output, |  | ||||||
| 	.base			= ADM5120_GPIO_P0L0, |  | ||||||
| 	.ngpio			= ADM5120_GPIO_P4L2 - ADM5120_GPIO_P0L0 + 1, |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| void __init adm5120_gpio_csx0_enable(void) |  | ||||||
| { |  | ||||||
| 	gpio_conf2 |= GPIO_CONF2_CSX0; |  | ||||||
| 	SW_WRITE_REG(SWITCH_REG_GPIO_CONF2, gpio_conf2); |  | ||||||
|  |  | ||||||
| 	gpio_request(ADM5120_GPIO_PIN1, "CSX0"); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void __init adm5120_gpio_csx1_enable(void) |  | ||||||
| { |  | ||||||
| 	gpio_conf2 |= GPIO_CONF2_CSX1; |  | ||||||
| 	SW_WRITE_REG(SWITCH_REG_GPIO_CONF2, gpio_conf2); |  | ||||||
|  |  | ||||||
| 	gpio_request(ADM5120_GPIO_PIN3, "CSX1"); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void __init adm5120_gpio_ew_enable(void) |  | ||||||
| { |  | ||||||
| 	gpio_conf2 |= GPIO_CONF2_EW; |  | ||||||
| 	SW_WRITE_REG(SWITCH_REG_GPIO_CONF2, gpio_conf2); |  | ||||||
|  |  | ||||||
| 	gpio_request(ADM5120_GPIO_PIN0, "EW"); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void __init adm5120_gpio_init(void) |  | ||||||
| { |  | ||||||
| 	int err; |  | ||||||
|  |  | ||||||
| 	SW_WRITE_REG(SWITCH_REG_GPIO_CONF2, gpio_conf2); |  | ||||||
|  |  | ||||||
| 	if (adm5120_package_pqfp()) |  | ||||||
| 		adm5120_gpio0_chip.ngpio = 4; |  | ||||||
|  |  | ||||||
| 	err = gpiochip_add(&adm5120_gpio0_chip); |  | ||||||
| 	if (err) |  | ||||||
| 		panic("cannot add ADM5120 GPIO0 chip, error=%d", err); |  | ||||||
|  |  | ||||||
| 	err = gpiochip_add(&adm5120_gpio1_chip); |  | ||||||
| 	if (err) |  | ||||||
| 		panic("cannot add ADM5120 GPIO1 chip, error=%d", err); |  | ||||||
|  |  | ||||||
| } |  | ||||||
| @@ -1,171 +0,0 @@ | |||||||
| /* |  | ||||||
|  *  ADM5120 specific interrupt handlers |  | ||||||
|  * |  | ||||||
|  *  Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org> |  | ||||||
|  * |  | ||||||
|  *  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 <linux/init.h> |  | ||||||
| #include <linux/kernel.h> |  | ||||||
| #include <linux/version.h> |  | ||||||
| #include <linux/irq.h> |  | ||||||
| #include <linux/interrupt.h> |  | ||||||
| #include <linux/ioport.h> |  | ||||||
| #include <linux/io.h> |  | ||||||
| #include <linux/bitops.h> |  | ||||||
|  |  | ||||||
| #include <asm/irq_cpu.h> |  | ||||||
| #include <asm/mipsregs.h> |  | ||||||
|  |  | ||||||
| #include <asm/mach-adm5120/adm5120_defs.h> |  | ||||||
|  |  | ||||||
| static void adm5120_intc_irq_unmask(struct irq_data *d); |  | ||||||
| static void adm5120_intc_irq_mask(struct irq_data *d); |  | ||||||
| static int  adm5120_intc_irq_set_type(struct irq_data *d, unsigned int flow_type); |  | ||||||
|  |  | ||||||
| static inline void intc_write_reg(unsigned int reg, u32 val) |  | ||||||
| { |  | ||||||
| 	void __iomem *base = (void __iomem *)KSEG1ADDR(ADM5120_INTC_BASE); |  | ||||||
|  |  | ||||||
| 	__raw_writel(val, base + reg); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| static inline u32 intc_read_reg(unsigned int reg) |  | ||||||
| { |  | ||||||
| 	void __iomem *base = (void __iomem *)KSEG1ADDR(ADM5120_INTC_BASE); |  | ||||||
|  |  | ||||||
| 	return __raw_readl(base + reg); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| static struct irq_chip adm5120_intc_irq_chip = { |  | ||||||
| 	.name		= "INTC", |  | ||||||
| 	.irq_unmask	= adm5120_intc_irq_unmask, |  | ||||||
| 	.irq_mask	= adm5120_intc_irq_mask, |  | ||||||
| 	.irq_mask_ack	= adm5120_intc_irq_mask, |  | ||||||
| 	.irq_set_type	= adm5120_intc_irq_set_type |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| static struct irqaction adm5120_intc_irq_action = { |  | ||||||
| 	.handler	= no_action, |  | ||||||
| 	.name		= "cascade [INTC]" |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| static void adm5120_intc_irq_unmask(struct irq_data *d) |  | ||||||
| { |  | ||||||
| 	intc_write_reg(INTC_REG_IRQ_ENABLE, 1 << (d->irq - ADM5120_INTC_IRQ_BASE)); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| static void adm5120_intc_irq_mask(struct irq_data *d) |  | ||||||
| { |  | ||||||
| 	intc_write_reg(INTC_REG_IRQ_DISABLE, 1 << (d->irq - ADM5120_INTC_IRQ_BASE)); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| static int adm5120_intc_irq_set_type(struct irq_data *d, unsigned int flow_type) |  | ||||||
| { |  | ||||||
| 	unsigned int irq = d->irq; |  | ||||||
| 	unsigned int sense; |  | ||||||
| 	unsigned long mode; |  | ||||||
| 	int err = 0; |  | ||||||
|  |  | ||||||
| 	sense = flow_type & (IRQ_TYPE_SENSE_MASK); |  | ||||||
| 	switch (sense) { |  | ||||||
| 	case IRQ_TYPE_NONE: |  | ||||||
| 	case IRQ_TYPE_LEVEL_HIGH: |  | ||||||
| 		break; |  | ||||||
| 	case IRQ_TYPE_LEVEL_LOW: |  | ||||||
| 		switch (irq) { |  | ||||||
| 		case ADM5120_IRQ_GPIO2: |  | ||||||
| 		case ADM5120_IRQ_GPIO4: |  | ||||||
| 			break; |  | ||||||
| 		default: |  | ||||||
| 			err = -EINVAL; |  | ||||||
| 			break; |  | ||||||
| 		} |  | ||||||
| 		break; |  | ||||||
| 	default: |  | ||||||
| 		err = -EINVAL; |  | ||||||
| 		break; |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	if (err) |  | ||||||
| 		return err; |  | ||||||
|  |  | ||||||
| 	switch (irq) { |  | ||||||
| 	case ADM5120_IRQ_GPIO2: |  | ||||||
| 	case ADM5120_IRQ_GPIO4: |  | ||||||
| 		mode = intc_read_reg(INTC_REG_INT_MODE); |  | ||||||
| 		if (sense == IRQ_TYPE_LEVEL_LOW) |  | ||||||
| 			mode |= (1 << (irq - ADM5120_INTC_IRQ_BASE)); |  | ||||||
| 		else |  | ||||||
| 			mode &= ~(1 << (irq - ADM5120_INTC_IRQ_BASE)); |  | ||||||
|  |  | ||||||
| 		intc_write_reg(INTC_REG_INT_MODE, mode); |  | ||||||
| 		break; |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	return 0; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| static void adm5120_intc_irq_dispatch(void) |  | ||||||
| { |  | ||||||
| 	unsigned long status; |  | ||||||
| 	int irq; |  | ||||||
|  |  | ||||||
| 	status = intc_read_reg(INTC_REG_IRQ_STATUS) & INTC_INT_ALL; |  | ||||||
| 	if (status) { |  | ||||||
| 		irq = ADM5120_INTC_IRQ_BASE + fls(status) - 1; |  | ||||||
| 		do_IRQ(irq); |  | ||||||
| 	} else |  | ||||||
| 		spurious_interrupt(); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| asmlinkage void plat_irq_dispatch(void) |  | ||||||
| { |  | ||||||
| 	unsigned long pending; |  | ||||||
|  |  | ||||||
| 	pending = read_c0_status() & read_c0_cause() & ST0_IM; |  | ||||||
|  |  | ||||||
| 	if (pending & STATUSF_IP7) |  | ||||||
| 		do_IRQ(ADM5120_IRQ_COUNTER); |  | ||||||
| 	else if (pending & STATUSF_IP2) |  | ||||||
| 		adm5120_intc_irq_dispatch(); |  | ||||||
| 	else |  | ||||||
| 		spurious_interrupt(); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| #define INTC_IRQ_STATUS (IRQ_LEVEL | IRQ_TYPE_LEVEL_HIGH | IRQ_DISABLED) |  | ||||||
| static void __init adm5120_intc_irq_init(void) |  | ||||||
| { |  | ||||||
| 	int i; |  | ||||||
|  |  | ||||||
| 	/* disable all interrupts */ |  | ||||||
| 	intc_write_reg(INTC_REG_IRQ_DISABLE, INTC_INT_ALL); |  | ||||||
|  |  | ||||||
| 	/* setup all interrupts to generate IRQ instead of FIQ */ |  | ||||||
| 	intc_write_reg(INTC_REG_INT_MODE, 0); |  | ||||||
|  |  | ||||||
| 	/* set active level for all external interrupts to HIGH */ |  | ||||||
| 	intc_write_reg(INTC_REG_INT_LEVEL, 0); |  | ||||||
|  |  | ||||||
| 	/* disable usage of the TEST_SOURCE register */ |  | ||||||
| 	intc_write_reg(INTC_REG_IRQ_SOURCE_SELECT, 0); |  | ||||||
|  |  | ||||||
| 	for (i = ADM5120_INTC_IRQ_BASE; |  | ||||||
| 		i <= ADM5120_INTC_IRQ_BASE + INTC_IRQ_LAST; |  | ||||||
| 		i++) { |  | ||||||
| 		irq_set_chip_and_handler(i, &adm5120_intc_irq_chip, |  | ||||||
| 			handle_level_irq); |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	setup_irq(ADM5120_IRQ_INTC, &adm5120_intc_irq_action); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void __init arch_init_irq(void) |  | ||||||
| { |  | ||||||
| 	mips_cpu_irq_init(); |  | ||||||
| 	adm5120_intc_irq_init(); |  | ||||||
| } |  | ||||||
| @@ -1,149 +0,0 @@ | |||||||
| /* |  | ||||||
|  *  Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org> |  | ||||||
|  * |  | ||||||
|  *  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 <linux/init.h> |  | ||||||
| #include <linux/types.h> |  | ||||||
| #include <linux/kernel.h> |  | ||||||
| #include <linux/io.h> |  | ||||||
|  |  | ||||||
| #include <asm/bootinfo.h> |  | ||||||
| #include <asm/addrspace.h> |  | ||||||
|  |  | ||||||
| #include <asm/mach-adm5120/adm5120_info.h> |  | ||||||
| #include <asm/mach-adm5120/adm5120_defs.h> |  | ||||||
| #include <asm/mach-adm5120/adm5120_switch.h> |  | ||||||
| #include <asm/mach-adm5120/adm5120_mpmc.h> |  | ||||||
|  |  | ||||||
| #ifdef DEBUG |  | ||||||
| #  define mem_dbg(f, a...)	printk(KERN_INFO "mem_detect: " f, ## a) |  | ||||||
| #else |  | ||||||
| #  define mem_dbg(f, a...) |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
| unsigned long adm5120_memsize; |  | ||||||
|  |  | ||||||
| #define MEM_READL(a)		__raw_readl((void __iomem *)(a)) |  | ||||||
| #define MEM_WRITEL(a, v)	__raw_writel((v), (void __iomem *)(a)) |  | ||||||
|  |  | ||||||
| static int __init mem_check_pattern(u8 *addr, unsigned long offs) |  | ||||||
| { |  | ||||||
| 	u32 *p1 = (u32 *)addr; |  | ||||||
| 	u32 *p2 = (u32 *)(addr+offs); |  | ||||||
| 	u32 t, u, v; |  | ||||||
|  |  | ||||||
| 	/* save original value */ |  | ||||||
| 	t = MEM_READL(p1); |  | ||||||
|  |  | ||||||
| 	u = MEM_READL(p2); |  | ||||||
| 	if (t != u) |  | ||||||
| 		return 0; |  | ||||||
|  |  | ||||||
| 	v = 0x55555555; |  | ||||||
| 	if (u == v) |  | ||||||
| 		v = 0xAAAAAAAA; |  | ||||||
|  |  | ||||||
| 	mem_dbg("write 0x%08X to 0x%08lX\n", v, (unsigned long)p1); |  | ||||||
|  |  | ||||||
| 	MEM_WRITEL(p1, v); |  | ||||||
| 	adm5120_ndelay(1000); |  | ||||||
| 	u = MEM_READL(p2); |  | ||||||
|  |  | ||||||
| 	mem_dbg("pattern at 0x%08lX is 0x%08X\n", (unsigned long)p2, u); |  | ||||||
|  |  | ||||||
| 	/* restore original value */ |  | ||||||
| 	MEM_WRITEL(p1, t); |  | ||||||
|  |  | ||||||
| 	return (v == u); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| static void __init adm5120_detect_memsize(void) |  | ||||||
| { |  | ||||||
| 	u32	memctrl; |  | ||||||
| 	u32	size, maxsize; |  | ||||||
| 	u8	*p; |  | ||||||
|  |  | ||||||
| 	memctrl = SW_READ_REG(SWITCH_REG_MEMCTRL); |  | ||||||
| 	switch (memctrl & MEMCTRL_SDRS_MASK) { |  | ||||||
| 	case MEMCTRL_SDRS_4M: |  | ||||||
| 		maxsize = 4 << 20; |  | ||||||
| 		break; |  | ||||||
| 	case MEMCTRL_SDRS_8M: |  | ||||||
| 		maxsize = 8 << 20; |  | ||||||
| 		break; |  | ||||||
| 	case MEMCTRL_SDRS_16M: |  | ||||||
| 		maxsize = 16 << 20; |  | ||||||
| 		break; |  | ||||||
| 	default: |  | ||||||
| 		maxsize = 64 << 20; |  | ||||||
| 		break; |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	mem_dbg("checking for %uMB chip in 1st bank\n", maxsize >> 20); |  | ||||||
|  |  | ||||||
| 	/* detect size of the 1st SDRAM bank */ |  | ||||||
| 	p = (u8 *)KSEG1ADDR(0); |  | ||||||
| 	for (size = 2<<20; size <= (maxsize >> 1); size <<= 1) { |  | ||||||
| 		if (mem_check_pattern(p, size)) { |  | ||||||
| 			/* mirrored address */ |  | ||||||
| 			mem_dbg("mirrored data found at offset 0x%08X\n", size); |  | ||||||
| 			break; |  | ||||||
| 		} |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	mem_dbg("chip size in 1st bank is %uMB\n", size >> 20); |  | ||||||
| 	adm5120_memsize = size; |  | ||||||
|  |  | ||||||
| 	if (size != maxsize) |  | ||||||
| 		/* 2nd bank is not supported */ |  | ||||||
| 		goto out; |  | ||||||
|  |  | ||||||
| 	if ((memctrl & MEMCTRL_SDR1_ENABLE) == 0) |  | ||||||
| 		/* 2nd bank is disabled */ |  | ||||||
| 		goto out; |  | ||||||
|  |  | ||||||
| 	/* |  | ||||||
| 	 * some bootloaders enable 2nd bank, even if the 2nd SDRAM chip |  | ||||||
| 	 * are missing. |  | ||||||
| 	 */ |  | ||||||
| 	mem_dbg("check presence of 2nd bank\n"); |  | ||||||
|  |  | ||||||
| 	p = (u8 *)KSEG1ADDR(maxsize+size-4); |  | ||||||
| 	if (mem_check_pattern(p, 0)) |  | ||||||
| 		adm5120_memsize += size; |  | ||||||
|  |  | ||||||
| 	if (maxsize != size) { |  | ||||||
| 		/* adjusting MECTRL register */ |  | ||||||
| 		memctrl &= ~(MEMCTRL_SDRS_MASK); |  | ||||||
| 		switch (size>>20) { |  | ||||||
| 		case 4: |  | ||||||
| 			memctrl |= MEMCTRL_SDRS_4M; |  | ||||||
| 			break; |  | ||||||
| 		case 8: |  | ||||||
| 			memctrl |= MEMCTRL_SDRS_8M; |  | ||||||
| 			break; |  | ||||||
| 		case 16: |  | ||||||
| 			memctrl |= MEMCTRL_SDRS_16M; |  | ||||||
| 			break; |  | ||||||
| 		default: |  | ||||||
| 			memctrl |= MEMCTRL_SDRS_64M; |  | ||||||
| 			break; |  | ||||||
| 		} |  | ||||||
| 		SW_WRITE_REG(SWITCH_REG_MEMCTRL, memctrl); |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| out: |  | ||||||
| 	mem_dbg("%dx%uMB memory found\n", (adm5120_memsize == size) ? 1 : 2 , |  | ||||||
| 		size>>20); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void __init adm5120_mem_init(void) |  | ||||||
| { |  | ||||||
| 	adm5120_detect_memsize(); |  | ||||||
| 	add_memory_region(0, adm5120_memsize, BOOT_MEM_RAM); |  | ||||||
| } |  | ||||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user