Compare commits
	
		
			70 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 70255e3d62 | ||
|   | 5eb055306f | ||
|   | e11df1eac6 | ||
|   | 033472e1bd | ||
|   | bfc9a4401b | ||
|   | 75e4d2d18c | ||
|   | 5b1c6570ca | ||
|   | 1fe7a17aed | ||
|   | 9cc774f91a | ||
|   | 508adbd871 | ||
|   | ec1c66f53f | ||
|   | 9866622d81 | ||
|   | c448f79840 | ||
|   | 67f91dfa51 | ||
|   | e4a5750931 | ||
|   | 433c94f296 | ||
|   | 2a8d8adfb0 | ||
|   | 9fe68b4369 | ||
|   | bd451d46a6 | ||
|   | aeec1dd7ba | ||
|   | 8d903be35a | ||
|   | 1e4b5c8b1f | ||
|   | ea22e3df3e | ||
|   | 0d5a041095 | ||
|   | 69c75f076a | ||
|   | 6603a0c232 | ||
|   | ae1ae07513 | ||
|   | fb5f026160 | ||
|   | 16d89ef291 | ||
|   | ca3174e4e9 | ||
|   | 0990dfc9ce | ||
|   | be4ab7e178 | ||
|   | 6a27c2f4b1 | ||
|   | fe90d14880 | ||
|   | eb06fa6cf7 | ||
|   | 25cb85abe7 | ||
|   | 7e03be7e2e | ||
|   | 8139438fc0 | ||
|   | c3df07ab3b | ||
|   | 5a430bd13f | ||
|   | 888cc05cf5 | ||
|   | da9a7a9a51 | ||
|   | d101899395 | ||
|   | 1e5bd42d63 | ||
|   | c61f543532 | ||
|   | 4017c528ca | ||
|   | e3ab280e47 | ||
|   | 5742a2ba35 | ||
|   | 23d4f663e3 | ||
|   | cb043ad8da | ||
|   | 6c075777d5 | ||
|   | b40316c21a | ||
|   | f63463591b | ||
|   | 9ce7aa325e | ||
|   | 9e1530b2a3 | ||
|   | 8be3af93b4 | ||
|   | 2589f8589c | ||
|   | 7d15f96eaf | ||
|   | 4f3082583a | ||
|   | 5f23d0f3db | ||
|   | 5828113986 | ||
|   | f7e647ca7b | ||
|   | 9c110b97c6 | ||
|   | b5b5f5dfa6 | ||
|   | f8e57f450d | ||
|   | f7668334a8 | ||
|   | d700eb187b | ||
|   | 20c64dabb6 | ||
|   | 93782d5e8e | ||
|   | ce234299bc | 
							
								
								
									
										2
									
								
								.github/pull_request_template
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/pull_request_template
									
									
									
									
										vendored
									
									
								
							| @@ -3,6 +3,6 @@ Thanks for your contribution to OpenWrt! | ||||
| To help keep the codebase consistent and readable, | ||||
| and to help people review your contribution, | ||||
| we ask you to follow the rules you find in the wiki at this link | ||||
| https://lede-project.org/submitting-patches | ||||
| https://openwrt.org/submitting-patches | ||||
|  | ||||
| Please remove this message before posting the pull request. | ||||
|   | ||||
							
								
								
									
										37
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										37
									
								
								README
									
									
									
									
									
								
							| @@ -1,26 +1,31 @@ | ||||
|   _______                     ________        __ | ||||
|  |       |.-----.-----.-----.|  |  |  |.----.|  |_ | ||||
|  |   -   ||  _  |  -__|     ||  |  |  ||   _||   _| | ||||
|  |_______||   __|_____|__|__||________||__|  |____| | ||||
|           |__| W I R E L E S S   F R E E D O M | ||||
|  ----------------------------------------------------- | ||||
|  | ||||
| This is the buildsystem for the OpenWrt Linux distribution. | ||||
|  | ||||
| Please use "make menuconfig" to choose your preferred | ||||
| configuration for the toolchain and firmware. | ||||
| To build your own firmware you need a Linux, BSD or MacOSX system (case | ||||
| sensitive filesystem required). Cygwin is unsupported because of the lack | ||||
| of a case sensitive file system. | ||||
|  | ||||
| You need to have installed gcc, binutils, bzip2, flex, python, perl, make, | ||||
| find, grep, diff, unzip, gawk, getopt, subversion, libz-dev and libc headers. | ||||
| You need gcc, binutils, bzip2, flex, python, perl, make, find, grep, diff, | ||||
| unzip, gawk, getopt, subversion, libz-dev and libc headers installed. | ||||
|  | ||||
| Run "./scripts/feeds update -a" to get all the latest package definitions | ||||
| defined in feeds.conf / feeds.conf.default respectively | ||||
| and "./scripts/feeds install -a" to install symlinks of all of them into | ||||
| package/feeds/. | ||||
| 1. Run "./scripts/feeds update -a" to obtain all the latest package definitions | ||||
| defined in feeds.conf / feeds.conf.default | ||||
|  | ||||
| Use "make menuconfig" to configure your image. | ||||
| 2. Run "./scripts/feeds install -a" to install symlinks for all obtained | ||||
| packages into package/feeds/ | ||||
|  | ||||
| Simply running "make" will build your firmware. | ||||
| It will download all sources, build the cross-compile toolchain,  | ||||
| the kernel and all choosen applications. | ||||
|  | ||||
| To build your own firmware you need to have access to a Linux, BSD or MacOSX system | ||||
| (case-sensitive filesystem required). Cygwin will not be supported because of | ||||
| the lack of case sensitiveness in the file system. | ||||
| 3. Run "make menuconfig" to select your preferred configuration for the | ||||
| toolchain, target system & firmware packages. | ||||
|  | ||||
| 4. Run "make" to build your firmware. This will download all sources, build | ||||
| the cross-compile toolchain and then cross-compile the Linux kernel & all | ||||
| chosen applications for your target system. | ||||
|  | ||||
| Sunshine! | ||||
| 	Your OpenWrt Community | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| src-git packages https://git.openwrt.org/feed/packages.git^8bf5fc17db6072549a4e3bd8230d7962364f2043 | ||||
| src-git luci https://git.openwrt.org/project/luci.git^6df9a57ef0773c7158dadbb5054a58cb3d70c621 | ||||
| src-git packages https://git.openwrt.org/feed/packages.git^35e0b737ab496f5b51e80079b0d8c9b442e223f5 | ||||
| src-git luci https://git.openwrt.org/project/luci.git^f64b1523447547032d5280fb0bcdde570f2ca913 | ||||
| src-git routing https://git.openwrt.org/feed/routing.git^1b9d1c419f0ecefda51922a7845ab2183d6acd76 | ||||
| src-git telephony https://git.openwrt.org/feed/telephony.git^88b12368f11f3feeefcd4dcbe54f21159b8356c1 | ||||
| src-git telephony https://git.openwrt.org/feed/telephony.git^b9d7b321d15a44c5abb9e5d43a4ec78abfd9031b | ||||
|   | ||||
| @@ -34,8 +34,8 @@ endef | ||||
| define FeedSourcesAppend | ||||
| ( \ | ||||
|   echo 'src/gz %d_core %U/targets/%S/packages'; \ | ||||
|   echo 'src/gz %d_base %U/packages/%A/base'; \ | ||||
|   $(strip $(if $(CONFIG_PER_FEED_REPO), \ | ||||
| 	echo 'src/gz %d_base %U/packages/%A/base'; \ | ||||
| 	$(foreach feed,$(FEEDS_AVAILABLE), \ | ||||
| 		$(if $(CONFIG_FEED_$(feed)), \ | ||||
| 			echo '$(if $(filter m,$(CONFIG_FEED_$(feed))),# )src/gz %d_$(feed) %U/packages/%A/$(feed)';)))) \ | ||||
|   | ||||
| @@ -2,15 +2,11 @@ | ||||
|  | ||||
| LINUX_RELEASE?=1 | ||||
|  | ||||
| LINUX_VERSION-3.18 = .71 | ||||
| LINUX_VERSION-4.4 = .121 | ||||
| LINUX_VERSION-4.9 = .111 | ||||
| LINUX_VERSION-4.14 = .54 | ||||
| LINUX_VERSION-4.9 = .120 | ||||
| LINUX_VERSION-4.14 = .63 | ||||
|  | ||||
| LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240 | ||||
| LINUX_KERNEL_HASH-4.4.121 = 44a88268b5088dc326b30c9b9133ac35a9a200b636b7268d08f32abeae6ca729 | ||||
| LINUX_KERNEL_HASH-4.9.111 = 5966558959dc580f163766f3fdefd7e57c01b2b45d51202d00b3807c253759dd | ||||
| LINUX_KERNEL_HASH-4.14.54 = 451642ac28c539a91072f1fb83b1c061d6d44df870ddf5562400ade5e1c4b6c6 | ||||
| LINUX_KERNEL_HASH-4.9.120 = d75af506865edc8145a344c4e73c3bb1000e6c9f1c3489b8dae47ca8f033fd91 | ||||
| LINUX_KERNEL_HASH-4.14.63 = cd2e52f0e7ba861afa91cf487b2f45e5174115870f256a1d65996647b7bcc6d3 | ||||
|  | ||||
| remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) | ||||
| sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) | ||||
|   | ||||
| @@ -51,7 +51,7 @@ else | ||||
|   endif | ||||
| endif | ||||
|  | ||||
| ifneq ($(filter 3.18 4.4 4.9,$(KERNEL_PATCHVER)),) | ||||
| ifneq ($(filter 4.9,$(KERNEL_PATCHVER)),) | ||||
|   DEFAULT_PACKAGES.router:=$(filter-out kmod-ipt-offload,$(DEFAULT_PACKAGES.router)) | ||||
| endif | ||||
|  | ||||
|   | ||||
| @@ -25,13 +25,13 @@ PKG_CONFIG_DEPENDS += \ | ||||
| sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1)))) | ||||
|  | ||||
| VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER)) | ||||
| VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),18.06.0) | ||||
| VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),18.06.1) | ||||
|  | ||||
| VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE)) | ||||
| VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r7188-b0b5c64c22) | ||||
| VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r7258-5eb055306f) | ||||
|  | ||||
| VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO)) | ||||
| VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.openwrt.org/releases/18.06.0) | ||||
| VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.openwrt.org/releases/18.06.1) | ||||
|  | ||||
| VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST)) | ||||
| VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt) | ||||
|   | ||||
| @@ -1,7 +1,3 @@ | ||||
| fwtool_pre_upgrade() { | ||||
| 	fwtool -q -i /dev/null "$1" | ||||
| } | ||||
|  | ||||
| fwtool_check_image() { | ||||
| 	[ $# -gt 1 ] && return 1 | ||||
|  | ||||
|   | ||||
| @@ -137,7 +137,6 @@ add_overlayfiles() { | ||||
|  | ||||
| # hooks | ||||
| sysupgrade_image_check="fwtool_check_image platform_check_image" | ||||
| sysupgrade_pre_upgrade="fwtool_pre_upgrade" | ||||
|  | ||||
| if [ $SAVE_OVERLAY = 1 ]; then | ||||
| 	[ ! -d /overlay/upper/etc ] && { | ||||
| @@ -264,10 +263,8 @@ else | ||||
| 	rm -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap | ||||
| fi | ||||
|  | ||||
| run_hooks "" $sysupgrade_pre_upgrade | ||||
|  | ||||
| install_bin /sbin/upgraded | ||||
| v "Commencing upgrade. All shell sessions will be closed now." | ||||
| v "Commencing upgrade. Closing all shell sessions." | ||||
|  | ||||
| COMMAND='. /lib/functions.sh; include /lib/upgrade; do_upgrade_stage2' | ||||
|  | ||||
|   | ||||
| @@ -183,7 +183,7 @@ if VERSIONOPT | ||||
| 	config VERSION_REPO | ||||
| 		string | ||||
| 		prompt "Release repository" | ||||
| 		default "http://downloads.openwrt.org/releases/18.06.0" | ||||
| 		default "http://downloads.openwrt.org/releases/18.06.1" | ||||
| 		help | ||||
| 			This is the repository address embedded in the image, it defaults | ||||
| 			to the trunk snapshot repo; the url may contain the following placeholders: | ||||
|   | ||||
| @@ -8,12 +8,12 @@ | ||||
| include $(TOPDIR)/rules.mk | ||||
|  | ||||
| PKG_NAME:=amd64-microcode | ||||
| PKG_VERSION:=20171205 | ||||
| PKG_VERSION:=20180524 | ||||
| PKG_RELEASE:=1 | ||||
|  | ||||
| PKG_SOURCE:=amd64-microcode_3.$(PKG_VERSION).$(PKG_RELEASE).tar.xz | ||||
| PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/non-free/a/amd64-microcode/ | ||||
| PKG_HASH:=a38bc072f535a3d3c1bf4e9e545197aa5114e979e94ef7e4a67e615df2f853a7 | ||||
| PKG_HASH:=7c389c357c242e7161f6872bf4e12011a71e4c0683f06fb1bcfad650a78bf0a9 | ||||
| PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-3.$(PKG_VERSION).$(PKG_RELEASE) | ||||
|  | ||||
| PKG_LICENSE_FILE:=LICENSE.amd-ucode | ||||
|   | ||||
| @@ -8,12 +8,12 @@ | ||||
| include $(TOPDIR)/rules.mk | ||||
|  | ||||
| PKG_NAME:=intel-microcode | ||||
| PKG_VERSION:=20180312 | ||||
| PKG_RELEASE:=1 | ||||
| PKG_VERSION:=20180703 | ||||
| PKG_RELEASE:=2 | ||||
|  | ||||
| PKG_SOURCE:=intel-microcode_3.$(PKG_VERSION).$(PKG_RELEASE).tar.xz | ||||
| PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/non-free/i/intel-microcode/ | ||||
| PKG_HASH:=6ccb295d23961c7b96a69280e30fdce939e1d905147b22b8428886b173812d52 | ||||
| PKG_HASH:=26dfaa47100ce3d06f968edefa7539da10de7b96d5d8e26ee8174a040ee5cdae | ||||
| PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-3.$(PKG_VERSION).$(PKG_RELEASE) | ||||
|  | ||||
| PKG_BUILD_DEPENDS:=iucode-tool/host | ||||
| @@ -36,14 +36,14 @@ endef | ||||
|  | ||||
| define Build/Compile | ||||
| 	IUCODE_TOOL=$(STAGING_DIR)/../host/bin/iucode_tool $(MAKE) -C $(PKG_BUILD_DIR) | ||||
| 	mkdir $(PKG_BUILD_DIR)/intel-ucode | ||||
| 	mkdir $(PKG_BUILD_DIR)/intel-ucode-ipkg | ||||
| 	$(STAGING_DIR)/../host/bin/iucode_tool -q \ | ||||
| 		--write-firmware=$(PKG_BUILD_DIR)/intel-ucode $(PKG_BUILD_DIR)/$(MICROCODE).bin | ||||
| 		--write-firmware=$(PKG_BUILD_DIR)/intel-ucode-ipkg $(PKG_BUILD_DIR)/$(MICROCODE).bin | ||||
| endef | ||||
|  | ||||
| define Package/intel-microcode/install | ||||
| 	$(INSTALL_DIR) $(1)/lib/firmware/intel-ucode | ||||
| 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/intel-ucode/* $(1)/lib/firmware/intel-ucode | ||||
| 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/intel-ucode-ipkg/* $(1)/lib/firmware/intel-ucode | ||||
| endef | ||||
|  | ||||
| $(eval $(call BuildPackage,intel-microcode)) | ||||
|   | ||||
| @@ -434,11 +434,6 @@ static int __init nct5104d_gpio_init(void) | ||||
| 	const char *board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR); | ||||
| 	const char *board_name = dmi_get_system_info(DMI_BOARD_NAME); | ||||
|  | ||||
|  	/* Make sure we only run on PC Engine APU boards */ | ||||
| 	if (!board_name || !board_vendor || strcasecmp(board_vendor, "PC Engines") || strncasecmp(board_name, "apu", 3)) { | ||||
| 		return -ENODEV; | ||||
| 	} | ||||
|  | ||||
| 	if (nct5104d_find(0x2e, &sio) && | ||||
| 	    nct5104d_find(0x4e, &sio)) | ||||
| 		return -ENODEV; | ||||
|   | ||||
| @@ -331,18 +331,6 @@ static int __init gpio_apu2_init (void) | ||||
| 	const char *board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR); | ||||
| 	const char *board_name = dmi_get_system_info(DMI_BOARD_NAME); | ||||
|  | ||||
| 	/* Match the device name/model */ | ||||
| 	if (!board_name \ | ||||
| 			|| !board_vendor \ | ||||
| 			|| strcasecmp(board_vendor, "PC Engines") \ | ||||
| 			|| (strcasecmp(board_name, "apu2") \ | ||||
| 				&& strcasecmp(board_name, "apu3") \ | ||||
| 				&& strcasecmp(board_name, "PC Engines apu2") \ | ||||
| 				&& strcasecmp(board_name, "PC Engines apu3"))) { | ||||
| 		err = -ENODEV; | ||||
| 		goto exit; | ||||
| 	} | ||||
|  | ||||
| 	pr_info ("%s: load APU2/LED GPIO driver module\n", DEVNAME); | ||||
|  | ||||
| 	err = platform_driver_register (&gpio_apu2_driver); | ||||
|   | ||||
| @@ -14,7 +14,7 @@ PKG_FLAGS:=hold | ||||
| PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/packages | ||||
| SCAN_DEPS=modules/*.mk $(TOPDIR)/target/linux/*/modules.mk $(TOPDIR)/include/netfilter.mk | ||||
|  | ||||
| PKG_LICENSE:=GPLv2 | ||||
| PKG_LICENSE:=GPL-2.0 | ||||
| PKG_LICENSE_FILES:= | ||||
|  | ||||
| export SHELL:=/bin/sh | ||||
|   | ||||
| @@ -15,9 +15,9 @@ PKG_LICENSE_FILES:= | ||||
|  | ||||
| PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi | ||||
| PKG_SOURCE_PROTO:=git | ||||
| PKG_SOURCE_DATE:=2018-03-30 | ||||
| PKG_SOURCE_VERSION:=fcaea79ad33d6ae3c381d9e96bf77d6870ca8e79 | ||||
| PKG_MIRROR_HASH:=1c0fa04ca80939038139dd50a50d9dc0d879b7cb594770282e3ec0008a479452 | ||||
| PKG_SOURCE_DATE:=2018-06-15 | ||||
| PKG_SOURCE_VERSION:=8683de8e97a31fe01cfd4e63ef6e9867b50aadae | ||||
| PKG_MIRROR_HASH:=69cd9f7c79564e444edf423133b13dcfbba9f66c051516606049087fa1973a20 | ||||
|  | ||||
| PKG_MAINTAINER:=Imre Kaloz <kaloz@openwrt.org> | ||||
| PKG_BUILD_PARALLEL:=1 | ||||
| @@ -27,7 +27,7 @@ include $(INCLUDE_DIR)/package.mk | ||||
|  | ||||
| define KernelPackage/mwlwifi | ||||
|   SUBMENU:=Wireless Drivers | ||||
|   TITLE:=Marvell 88W8864/88W8897/88W8964 wireless driver | ||||
|   TITLE:=Marvell 88W8864/88W8897/88W8964/88W8997 wireless driver | ||||
|   DEPENDS:=+kmod-mac80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT @PCI_SUPPORT @TARGET_mvebu | ||||
|   FILES:=$(PKG_BUILD_DIR)/mwlwifi.ko | ||||
|   AUTOLOAD:=$(call AutoLoad,50,mwlwifi) | ||||
| @@ -87,7 +87,16 @@ define Package/mwlwifi-firmware-88w8964/install | ||||
| 	$(call Package/mwlwifi-firmware/install,$(1),88W8964.bin) | ||||
| endef | ||||
|  | ||||
| define Package/mwlwifi-firmware-88w8997 | ||||
| $(call Package/mwlwifi-firmware-default,88W8997) | ||||
| endef | ||||
|  | ||||
| define Package/mwlwifi-firmware-88w8997/install | ||||
| 	$(call Package/mwlwifi-firmware/install,$(1),88W8997.bin) | ||||
| endef | ||||
|  | ||||
| $(eval $(call KernelPackage,mwlwifi)) | ||||
| $(eval $(call BuildPackage,mwlwifi-firmware-88w8864)) | ||||
| $(eval $(call BuildPackage,mwlwifi-firmware-88w8897)) | ||||
| $(eval $(call BuildPackage,mwlwifi-firmware-88w8964)) | ||||
| $(eval $(call BuildPackage,mwlwifi-firmware-88w8997)) | ||||
|   | ||||
| @@ -7,7 +7,7 @@ PKG_SOURCE_PROTO:=git | ||||
| PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git | ||||
| PKG_SOURCE_DATE:=2018-07-25 | ||||
| PKG_SOURCE_VERSION:=c83a84afbef2b24f960ddeda0b5e2ab01fba6981 | ||||
| PKG_MIRROR_HASH:=9ab6dc6e300cb56ed503425c9fe060a154bcab8067da5615c0428c968947484f | ||||
| PKG_MIRROR_HASH:=4a9594d2ae3706174d182a21fe815f1d18c20beca6593707cc757994975dc670 | ||||
| CMAKE_INSTALL:=1 | ||||
|  | ||||
| PKG_LICENSE:=ISC | ||||
|   | ||||
| @@ -8,13 +8,13 @@ | ||||
| include $(TOPDIR)/rules.mk | ||||
|  | ||||
| PKG_NAME:=mbedtls | ||||
| PKG_VERSION:=2.8.0 | ||||
| PKG_VERSION:=2.12.0 | ||||
| PKG_RELEASE:=1 | ||||
| PKG_USE_MIPS16:=0 | ||||
|  | ||||
| PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-gpl.tgz | ||||
| PKG_SOURCE_URL:=https://tls.mbed.org/download/ | ||||
| PKG_HASH:=649eb27187154590edda52943a7f468e740ec08807e5bf68ff45f4e8ffd68923 | ||||
| PKG_HASH:=8661d19a896a5a7a232ed01ac7f05cf0ec3514798f18076c2c9ef965fbeb5a28 | ||||
|  | ||||
| PKG_BUILD_PARALLEL:=1 | ||||
| PKG_LICENSE:=GPL-2.0+ | ||||
|   | ||||
| @@ -1,6 +1,23 @@ | ||||
| --- a/include/mbedtls/config.h | ||||
| +++ b/include/mbedtls/config.h | ||||
| @@ -566,17 +566,17 @@ | ||||
| @@ -548,14 +548,14 @@ | ||||
|   * | ||||
|   * Enable Output Feedback mode (OFB) for symmetric ciphers. | ||||
|   */ | ||||
| -#define MBEDTLS_CIPHER_MODE_OFB | ||||
| +//#define MBEDTLS_CIPHER_MODE_OFB | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_CIPHER_MODE_XTS | ||||
|   * | ||||
|   * Enable Xor-encrypt-xor with ciphertext stealing mode (XTS) for AES. | ||||
|   */ | ||||
| -#define MBEDTLS_CIPHER_MODE_XTS | ||||
| +//#define MBEDTLS_CIPHER_MODE_XTS | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_CIPHER_NULL_CIPHER | ||||
| @@ -645,19 +645,19 @@ | ||||
|   * | ||||
|   * Comment macros to disable the curve and functions for it | ||||
|   */ | ||||
| @@ -24,19 +41,21 @@ | ||||
| +//#define MBEDTLS_ECP_DP_BP384R1_ENABLED | ||||
| +//#define MBEDTLS_ECP_DP_BP512R1_ENABLED | ||||
|  #define MBEDTLS_ECP_DP_CURVE25519_ENABLED | ||||
| -#define MBEDTLS_ECP_DP_CURVE448_ENABLED | ||||
| +//#define MBEDTLS_ECP_DP_CURVE448_ENABLED | ||||
|   | ||||
|  /** | ||||
| @@ -601,8 +601,8 @@ | ||||
|   * Requires: MBEDTLS_HMAC_DRBG_C | ||||
|   * \def MBEDTLS_ECP_NIST_OPTIM | ||||
| @@ -682,7 +682,7 @@ | ||||
|   * | ||||
|   * Comment this macro to disable deterministic ECDSA. | ||||
| - */ | ||||
|  #define MBEDTLS_ECDSA_DETERMINISTIC | ||||
| + */ | ||||
|   */ | ||||
| -#define MBEDTLS_ECDSA_DETERMINISTIC | ||||
| +//#define MBEDTLS_ECDSA_DETERMINISTIC | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED | ||||
| @@ -655,7 +655,7 @@ | ||||
| @@ -735,7 +735,7 @@ | ||||
|   *             See dhm.h for more details. | ||||
|   * | ||||
|   */ | ||||
| @@ -45,17 +64,16 @@ | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED | ||||
| @@ -674,8 +674,8 @@ | ||||
|   *      MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 | ||||
| @@ -755,7 +755,7 @@ | ||||
|   *      MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA | ||||
|   *      MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA | ||||
| - */ | ||||
|  #define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED | ||||
| + */ | ||||
|   */ | ||||
| -#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED | ||||
| +//#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED | ||||
| @@ -700,7 +700,7 @@ | ||||
| @@ -780,7 +780,7 @@ | ||||
|   *      MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA | ||||
|   *      MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA | ||||
|   */ | ||||
| @@ -64,7 +82,7 @@ | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED | ||||
| @@ -834,7 +834,7 @@ | ||||
| @@ -914,7 +914,7 @@ | ||||
|   *      MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 | ||||
|   *      MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 | ||||
|   */ | ||||
| @@ -73,7 +91,7 @@ | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED | ||||
| @@ -858,7 +858,7 @@ | ||||
| @@ -938,7 +938,7 @@ | ||||
|   *      MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 | ||||
|   *      MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 | ||||
|   */ | ||||
| @@ -82,7 +100,7 @@ | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | ||||
| @@ -962,7 +962,7 @@ | ||||
| @@ -1042,7 +1042,7 @@ | ||||
|   * This option is only useful if both MBEDTLS_SHA256_C and | ||||
|   * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used. | ||||
|   */ | ||||
| @@ -91,7 +109,7 @@ | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_ENTROPY_NV_SEED | ||||
| @@ -1057,14 +1057,14 @@ | ||||
| @@ -1137,14 +1137,14 @@ | ||||
|   * Uncomment this macro to disable the use of CRT in RSA. | ||||
|   * | ||||
|   */ | ||||
| @@ -108,7 +126,7 @@ | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_SHA256_SMALLER | ||||
| @@ -1080,7 +1080,7 @@ | ||||
| @@ -1160,7 +1160,7 @@ | ||||
|   * | ||||
|   * Uncomment to enable the smaller implementation of SHA256. | ||||
|   */ | ||||
| @@ -117,7 +135,7 @@ | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES | ||||
| @@ -1207,7 +1207,7 @@ | ||||
| @@ -1298,7 +1298,7 @@ | ||||
|   *          configuration of this extension). | ||||
|   * | ||||
|   */ | ||||
| @@ -126,17 +144,16 @@ | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO | ||||
| @@ -1381,8 +1381,8 @@ | ||||
|   * callbacks are provided by MBEDTLS_SSL_TICKET_C. | ||||
| @@ -1473,7 +1473,7 @@ | ||||
|   * | ||||
|   * Comment this macro to disable support for SSL session tickets | ||||
| - */ | ||||
|  #define MBEDTLS_SSL_SESSION_TICKETS | ||||
| + */ | ||||
|   */ | ||||
| -#define MBEDTLS_SSL_SESSION_TICKETS | ||||
| +//#define MBEDTLS_SSL_SESSION_TICKETS | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_SSL_EXPORT_KEYS | ||||
| @@ -1412,7 +1412,7 @@ | ||||
| @@ -1503,7 +1503,7 @@ | ||||
|   * | ||||
|   * Comment this macro to disable support for truncated HMAC in SSL | ||||
|   */ | ||||
| @@ -145,17 +162,16 @@ | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT | ||||
| @@ -1470,8 +1470,8 @@ | ||||
|   * Requires: MBEDTLS_VERSION_C | ||||
| @@ -1562,7 +1562,7 @@ | ||||
|   * | ||||
|   * Comment this to disable run-time checking and save ROM space | ||||
| - */ | ||||
|  #define MBEDTLS_VERSION_FEATURES | ||||
| + */ | ||||
|   */ | ||||
| -#define MBEDTLS_VERSION_FEATURES | ||||
| +//#define MBEDTLS_VERSION_FEATURES | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 | ||||
| @@ -1801,7 +1801,7 @@ | ||||
| @@ -1892,7 +1892,7 @@ | ||||
|   *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 | ||||
|   *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 | ||||
|   */ | ||||
| @@ -163,8 +179,8 @@ | ||||
| +//#define MBEDTLS_CAMELLIA_C | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_CCM_C | ||||
| @@ -1815,7 +1815,7 @@ | ||||
|   * \def MBEDTLS_ARIA_C | ||||
| @@ -1958,7 +1958,7 @@ | ||||
|   * This module enables the AES-CCM ciphersuites, if other requisites are | ||||
|   * enabled as well. | ||||
|   */ | ||||
| @@ -173,16 +189,34 @@ | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_CERTS_C | ||||
| @@ -1827,7 +1827,7 @@ | ||||
| @@ -1970,7 +1970,7 @@ | ||||
|   * | ||||
|   * This module is used for testing (ssl_client/server). | ||||
|   */ | ||||
| -#define MBEDTLS_CERTS_C | ||||
| +//#define MBEDTLS_CERTS_C | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_CHACHA20_C | ||||
| @@ -1979,7 +1979,7 @@ | ||||
|   * | ||||
|   * Module:  library/chacha20.c | ||||
|   */ | ||||
| -#define MBEDTLS_CHACHA20_C | ||||
| +//#define MBEDTLS_CHACHA20_C | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_CHACHAPOLY_C | ||||
| @@ -1990,7 +1990,7 @@ | ||||
|   * | ||||
|   * This module requires: MBEDTLS_CHACHA20_C, MBEDTLS_POLY1305_C | ||||
|   */ | ||||
| -#define MBEDTLS_CHACHAPOLY_C | ||||
| +//#define MBEDTLS_CHACHAPOLY_C | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_CIPHER_C | ||||
| @@ -1880,7 +1880,7 @@ | ||||
| @@ -2043,7 +2043,7 @@ | ||||
|   * | ||||
|   * This module provides debugging functions. | ||||
|   */ | ||||
| @@ -191,7 +225,7 @@ | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_DES_C | ||||
| @@ -1909,7 +1909,7 @@ | ||||
| @@ -2072,7 +2072,7 @@ | ||||
|   * \warning   DES is considered a weak cipher and its use constitutes a | ||||
|   *            security risk. We recommend considering stronger ciphers instead. | ||||
|   */ | ||||
| @@ -200,17 +234,43 @@ | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_DHM_C | ||||
| @@ -2070,8 +2070,8 @@ | ||||
|   * Requires: MBEDTLS_MD_C | ||||
|   * | ||||
|   * Uncomment to enable the HMAC_DRBG random number geerator. | ||||
| - */ | ||||
|  #define MBEDTLS_HMAC_DRBG_C | ||||
| + */ | ||||
| @@ -2235,7 +2235,7 @@ | ||||
|   * This module adds support for the Hashed Message Authentication Code | ||||
|   * (HMAC)-based key derivation function (HKDF). | ||||
|   */ | ||||
| -#define MBEDTLS_HKDF_C | ||||
| +//#define MBEDTLS_HKDF_C | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_MD_C | ||||
| @@ -2365,7 +2365,7 @@ | ||||
|   * \def MBEDTLS_HMAC_DRBG_C | ||||
| @@ -2249,7 +2249,7 @@ | ||||
|   * | ||||
|   * Uncomment to enable the HMAC_DRBG random number geerator. | ||||
|   */ | ||||
| -#define MBEDTLS_HMAC_DRBG_C | ||||
| +//#define MBEDTLS_HMAC_DRBG_C | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_NIST_KW_C | ||||
| @@ -2545,7 +2545,7 @@ | ||||
|   * | ||||
|   * This module enables abstraction of common (libc) functions. | ||||
|   */ | ||||
| -#define MBEDTLS_PLATFORM_C | ||||
| +//#define MBEDTLS_PLATFORM_C | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_POLY1305_C | ||||
| @@ -2555,7 +2555,7 @@ | ||||
|   * Module:  library/poly1305.c | ||||
|   * Caller:  library/chachapoly.c | ||||
|   */ | ||||
| -#define MBEDTLS_POLY1305_C | ||||
| +//#define MBEDTLS_POLY1305_C | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_RIPEMD160_C | ||||
| @@ -2566,7 +2566,7 @@ | ||||
|   * Caller:  library/md.c | ||||
|   * | ||||
|   */ | ||||
| @@ -219,37 +279,25 @@ | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_RSA_C | ||||
| @@ -2449,8 +2449,8 @@ | ||||
|   * Caller: | ||||
|   * | ||||
|   * Requires: MBEDTLS_SSL_CACHE_C | ||||
| - */ | ||||
|  #define MBEDTLS_SSL_CACHE_C | ||||
| + */ | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_SSL_COOKIE_C | ||||
| @@ -2471,8 +2471,8 @@ | ||||
|   * Caller: | ||||
| @@ -2673,7 +2673,7 @@ | ||||
|   * | ||||
|   * Requires: MBEDTLS_CIPHER_C | ||||
| - */ | ||||
|  #define MBEDTLS_SSL_TICKET_C | ||||
| + */ | ||||
|   */ | ||||
| -#define MBEDTLS_SSL_TICKET_C | ||||
| +//#define MBEDTLS_SSL_TICKET_C | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_SSL_CLI_C | ||||
| @@ -2571,8 +2571,8 @@ | ||||
|   * Module:  library/version.c | ||||
| @@ -2773,7 +2773,7 @@ | ||||
|   * | ||||
|   * This module provides run-time version information. | ||||
| - */ | ||||
|  #define MBEDTLS_VERSION_C | ||||
| + */ | ||||
|   */ | ||||
| -#define MBEDTLS_VERSION_C | ||||
| +//#define MBEDTLS_VERSION_C | ||||
|   | ||||
|  /** | ||||
|   * \def MBEDTLS_X509_USE_C | ||||
| @@ -2682,7 +2682,7 @@ | ||||
| @@ -2883,7 +2883,7 @@ | ||||
|   * Module:  library/xtea.c | ||||
|   * Caller: | ||||
|   */ | ||||
|   | ||||
| @@ -0,0 +1,34 @@ | ||||
| --- a/library/CMakeLists.txt | ||||
| +++ b/library/CMakeLists.txt | ||||
| @@ -159,7 +159,7 @@ endif(USE_STATIC_MBEDTLS_LIBRARY) | ||||
|   | ||||
|  if(USE_SHARED_MBEDTLS_LIBRARY) | ||||
|      add_library(mbedcrypto SHARED ${src_crypto}) | ||||
| -    set_target_properties(mbedcrypto PROPERTIES VERSION 2.12.0 SOVERSION 3) | ||||
| +    set_target_properties(mbedcrypto PROPERTIES VERSION 2.12.0 SOVERSION 1) | ||||
|      target_link_libraries(mbedcrypto ${libs}) | ||||
|   | ||||
|      add_library(mbedx509 SHARED ${src_x509}) | ||||
| @@ -167,7 +167,7 @@ if(USE_SHARED_MBEDTLS_LIBRARY) | ||||
|      target_link_libraries(mbedx509 ${libs} mbedcrypto) | ||||
|   | ||||
|      add_library(mbedtls SHARED ${src_tls}) | ||||
| -    set_target_properties(mbedtls PROPERTIES VERSION 2.12.0 SOVERSION 11) | ||||
| +    set_target_properties(mbedtls PROPERTIES VERSION 2.12.0 SOVERSION 10) | ||||
|      target_link_libraries(mbedtls ${libs} mbedx509) | ||||
|   | ||||
|      install(TARGETS mbedtls mbedx509 mbedcrypto | ||||
| --- a/library/Makefile | ||||
| +++ b/library/Makefile | ||||
| @@ -35,9 +35,9 @@ LOCAL_CFLAGS += -fPIC -fpic | ||||
|  endif | ||||
|  endif | ||||
|   | ||||
| -SOEXT_TLS=so.11 | ||||
| +SOEXT_TLS=so.10 | ||||
|  SOEXT_X509=so.0 | ||||
| -SOEXT_CRYPTO=so.3 | ||||
| +SOEXT_CRYPTO=so.1 | ||||
|   | ||||
|  # Set AR_DASH= (empty string) to use an ar implentation that does not accept | ||||
|  # the - prefix for command line options (e.g. llvm-ar) | ||||
| @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk | ||||
|  | ||||
| PKG_NAME:=openssl | ||||
| PKG_BASE:=1.0.2 | ||||
| PKG_BUGFIX:=o | ||||
| PKG_BUGFIX:=p | ||||
| PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX) | ||||
| PKG_RELEASE:=1 | ||||
| PKG_USE_MIPS16:=0 | ||||
| @@ -24,7 +24,7 @@ PKG_SOURCE_URL:= \ | ||||
| 	http://gd.tuwien.ac.at/infosys/security/openssl/source/ \ | ||||
| 	http://www.openssl.org/source/ \ | ||||
| 	http://www.openssl.org/source/old/$(PKG_BASE)/ | ||||
| PKG_HASH:=ec3f5c9714ba0fd45cb4e087301eb1336c317e0d20b575a125050470e8089e4d | ||||
| PKG_HASH:=50a98e07b1a89eb8f6a99477f262df71c6fa7bef77df4dc83025a2845c827d00 | ||||
|  | ||||
| PKG_LICENSE:=OpenSSL | ||||
| PKG_LICENSE_FILES:=LICENSE | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| --- a/Configure | ||||
| +++ b/Configure | ||||
| @@ -2136,6 +2136,11 @@ EOF | ||||
| @@ -2144,6 +2144,11 @@ EOF | ||||
|  	close(OUT); | ||||
|    } | ||||
|     | ||||
|   | ||||
| @@ -173,7 +173,7 @@ | ||||
|   | ||||
|  apps: | ||||
|  	@(cd ..; $(MAKE) DIRS=apps all) | ||||
| @@ -586,7 +586,7 @@ $(DTLSTEST)$(EXE_EXT): $(DTLSTEST).o ssl | ||||
| @@ -593,7 +593,7 @@ $(DTLSTEST)$(EXE_EXT): $(DTLSTEST).o ssl | ||||
|  #	fi | ||||
|   | ||||
|  dummytest$(EXE_EXT): dummytest.o $(DLIBCRYPTO) | ||||
|   | ||||
| @@ -5,9 +5,9 @@ PKG_RELEASE=1 | ||||
|  | ||||
| PKG_SOURCE_PROTO:=git | ||||
| PKG_SOURCE_URL=$(PROJECT_GIT)/project/uclient.git | ||||
| PKG_SOURCE_DATE:=2017-11-02 | ||||
| PKG_SOURCE_VERSION:=4b87d83160fec70d50b7fcd736a8c538c28a016c | ||||
| PKG_MIRROR_HASH:=4bbb4d5f295ebdcd67fec87a6794168bea2176a42cb2907c47d8566fb33dafb3 | ||||
| PKG_SOURCE_DATE:=2018-08-03 | ||||
| PKG_SOURCE_VERSION:=ae1c656ff041c6f1ccb37b070fa261e0d71f2b12 | ||||
| PKG_MIRROR_HASH:=e88c92f880d3c1cf4162f62c4eeb8986baa8d73772e51eed3a60a8346aeb1b7c | ||||
| CMAKE_INSTALL:=1 | ||||
|  | ||||
| PKG_BUILD_DEPENDS:=ustream-ssl | ||||
|   | ||||
| @@ -1,13 +1,13 @@ | ||||
| include $(TOPDIR)/rules.mk | ||||
|  | ||||
| PKG_NAME:=ustream-ssl | ||||
| PKG_RELEASE:=3 | ||||
| PKG_RELEASE:=1 | ||||
|  | ||||
| PKG_SOURCE_PROTO:=git | ||||
| PKG_SOURCE_URL=$(PROJECT_GIT)/project/ustream-ssl.git | ||||
| PKG_SOURCE_DATE:=2018-04-30 | ||||
| PKG_SOURCE_VERSION:=527e7002d0429465bd49c0c0d416ef22fbf5ae86 | ||||
| PKG_MIRROR_HASH:=b0b4219730a369741a192a67d4fbf7328bd62df8ae4f0d0e3084461e3bbaba54 | ||||
| PKG_SOURCE_DATE:=2018-05-22 | ||||
| PKG_SOURCE_VERSION:=5322f9db23b69fdc2b4760a6cfd67848a11818a4 | ||||
| PKG_MIRROR_HASH:=c943f6e603b1309b33fd276acddffb33a171b6370455b6c21200897012e42d05 | ||||
| CMAKE_INSTALL:=1 | ||||
|  | ||||
| PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR) | ||||
|   | ||||
| @@ -5,9 +5,9 @@ PKG_RELEASE:=1 | ||||
|  | ||||
| PKG_SOURCE_PROTO:=git | ||||
| PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git | ||||
| PKG_SOURCE_DATE:=2018-05-30 | ||||
| PKG_SOURCE_VERSION:=a580028dae5b7bebcc14c240fe7dac31cbd89355 | ||||
| PKG_MIRROR_HASH:=41a645bc322c6a444bcc74cd099af6aead30924594aecf4e433204f8524a470e | ||||
| PKG_SOURCE_DATE:=2018-07-30 | ||||
| PKG_SOURCE_VERSION:=a0a1e52eb300b574098ae18fc7e6849ff50c2e5e | ||||
| PKG_MIRROR_HASH:=f2a556e0de1e04d4e7b6ca30d3e7c65710659201fc81efb10420cd895d72a307 | ||||
| PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name> | ||||
|  | ||||
| PKG_LICENSE:=GPL-2.0 | ||||
|   | ||||
| @@ -148,6 +148,11 @@ service_triggers() | ||||
| 	procd_add_validation validate_section_dropbear | ||||
| } | ||||
|  | ||||
| shutdown() { | ||||
| 	# close all open connections | ||||
| 	killall dropbear | ||||
| } | ||||
|  | ||||
| killclients() | ||||
| { | ||||
| 	local ignore='' | ||||
|   | ||||
| @@ -0,0 +1,48 @@ | ||||
| From 3e34cfdff6b192fe337c6fb3f487f73e96582961 Mon Sep 17 00:00:00 2001 | ||||
| From: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be> | ||||
| Date: Sun, 15 Jul 2018 01:25:53 +0200 | ||||
| Subject: [PATCH] WPA: Ignore unauthenticated encrypted EAPOL-Key data | ||||
|  | ||||
| Ignore unauthenticated encrypted EAPOL-Key data in supplicant | ||||
| processing. When using WPA2, these are frames that have the Encrypted | ||||
| flag set, but not the MIC flag. | ||||
|  | ||||
| When using WPA2, EAPOL-Key frames that had the Encrypted flag set but | ||||
| not the MIC flag, had their data field decrypted without first verifying | ||||
| the MIC. In case the data field was encrypted using RC4 (i.e., when | ||||
| negotiating TKIP as the pairwise cipher), this meant that | ||||
| unauthenticated but decrypted data would then be processed. An adversary | ||||
| could abuse this as a decryption oracle to recover sensitive information | ||||
| in the data field of EAPOL-Key messages (e.g., the group key). | ||||
| (CVE-2018-14526) | ||||
|  | ||||
| Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be> | ||||
| --- | ||||
|  src/rsn_supp/wpa.c | 11 +++++++++++ | ||||
|  1 file changed, 11 insertions(+) | ||||
|  | ||||
| diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c | ||||
| index 56f3af7..db94a49 100644 | ||||
| --- a/src/rsn_supp/wpa.c | ||||
| +++ b/src/rsn_supp/wpa.c | ||||
| @@ -2215,6 +2215,17 @@ int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_addr, | ||||
|   | ||||
|  	if ((sm->proto == WPA_PROTO_RSN || sm->proto == WPA_PROTO_OSEN) && | ||||
|  	    (key_info & WPA_KEY_INFO_ENCR_KEY_DATA) && mic_len) { | ||||
| +		/* | ||||
| +		 * Only decrypt the Key Data field if the frame's authenticity | ||||
| +		 * was verified. When using AES-SIV (FILS), the MIC flag is not | ||||
| +		 * set, so this check should only be performed if mic_len != 0 | ||||
| +		 * which is the case in this code branch. | ||||
| +		 */ | ||||
| +		if (!(key_info & WPA_KEY_INFO_MIC)) { | ||||
| +			wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, | ||||
| +				"WPA: Ignore EAPOL-Key with encrypted but unauthenticated data"); | ||||
| +			goto out; | ||||
| +		} | ||||
|  		if (wpa_supplicant_decrypt_key_data(sm, key, mic_len, | ||||
|  						    ver, key_data, | ||||
|  						    &key_data_len)) | ||||
| --  | ||||
| 2.7.4 | ||||
|  | ||||
| @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk | ||||
| PKG_NAME:=openvpn | ||||
|  | ||||
| PKG_VERSION:=2.4.5 | ||||
| PKG_RELEASE:=3 | ||||
| PKG_RELEASE:=4 | ||||
|  | ||||
| PKG_SOURCE_URL:=\ | ||||
| 	https://build.openvpn.net/downloads/releases/ \ | ||||
|   | ||||
| @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk | ||||
|  | ||||
| PKG_NAME:=curl | ||||
| PKG_VERSION:=7.60.0 | ||||
| PKG_RELEASE:=1 | ||||
| PKG_RELEASE:=3 | ||||
|  | ||||
| PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz | ||||
| PKG_SOURCE_URL:=https://dl.uxnr.de/mirror/curl/ \ | ||||
|   | ||||
							
								
								
									
										32
									
								
								package/network/utils/curl/patches/400-CVE-2018-0500.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								package/network/utils/curl/patches/400-CVE-2018-0500.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,32 @@ | ||||
| From ba1dbd78e5f1ed67c1b8d37ac89d90e5e330b628 Mon Sep 17 00:00:00 2001 | ||||
| From: Daniel Stenberg <daniel@haxx.se> | ||||
| Date: Wed, 13 Jun 2018 12:24:40 +0200 | ||||
| Subject: [PATCH] smtp: use the upload buffer size for scratch buffer malloc | ||||
|  | ||||
| ... not the read buffer size, as that can be set smaller and thus cause | ||||
| a buffer overflow! CVE-2018-0500 | ||||
|  | ||||
| Reported-by: Peter Wu | ||||
| Bug: https://curl.haxx.se/docs/adv_2018-70a2.html | ||||
| --- | ||||
|  lib/smtp.c | 3 ++- | ||||
|  1 file changed, 2 insertions(+), 1 deletion(-) | ||||
|  | ||||
| --- a/lib/smtp.c | ||||
| +++ b/lib/smtp.c | ||||
| @@ -1563,13 +1563,14 @@ CURLcode Curl_smtp_escape_eob(struct con | ||||
|    if(!scratch || data->set.crlf) { | ||||
|      oldscratch = scratch; | ||||
|   | ||||
| -    scratch = newscratch = malloc(2 * data->set.buffer_size); | ||||
| +    scratch = newscratch = malloc(2 * UPLOAD_BUFSIZE); | ||||
|      if(!newscratch) { | ||||
|        failf(data, "Failed to alloc scratch buffer!"); | ||||
|   | ||||
|        return CURLE_OUT_OF_MEMORY; | ||||
|      } | ||||
|    } | ||||
| +  DEBUGASSERT(UPLOAD_BUFSIZE >= nread); | ||||
|   | ||||
|    /* Have we already sent part of the EOB? */ | ||||
|    eob_sent = smtp->eob; | ||||
| @@ -8,11 +8,11 @@ | ||||
| include $(TOPDIR)/rules.mk | ||||
|  | ||||
| PKG_NAME:=iperf | ||||
| PKG_VERSION:=2.0.10 | ||||
| PKG_VERSION:=2.0.12 | ||||
| PKG_RELEASE:=1 | ||||
|  | ||||
| PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz | ||||
| PKG_HASH:=7fe4348dcca313b74e0aa9c34a8ccd713b84a5615b8578f4aa94cedce9891ef2 | ||||
| PKG_HASH:=367f651fb1264b13f6518e41b8a7e08ce3e41b2a1c80e99ff0347561eed32646 | ||||
| PKG_SOURCE_URL:=@SF/iperf2 | ||||
|  | ||||
| PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name> | ||||
|   | ||||
| @@ -110,7 +110,7 @@ proto_wwan_teardown() { | ||||
| 	case $driver in | ||||
| 	qmi_wwan)		proto_qmi_teardown $@ ;; | ||||
| 	cdc_mbim)		proto_mbim_teardown $@ ;; | ||||
| 	sierra_net)		proto_mbim_teardown $@ ;; | ||||
| 	sierra_net)		proto_directip_teardown $@ ;; | ||||
| 	comgt)			proto_3g_teardown $@ ;; | ||||
| 	cdc_ether|*cdc_ncm)	proto_ncm_teardown $@ ;; | ||||
| 	esac | ||||
|   | ||||
| @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk | ||||
|  | ||||
| PKG_NAME:=ca-certificates | ||||
| PKG_VERSION:=20180409 | ||||
| PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com> | ||||
| PKG_MAINTAINER:= | ||||
|  | ||||
| PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.xz | ||||
| PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/c/ca-certificates | ||||
|   | ||||
| @@ -12,10 +12,10 @@ PKG_RELEASE:=1 | ||||
|  | ||||
| PKG_SOURCE_PROTO:=git | ||||
| PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git | ||||
| PKG_SOURCE_DATE:=2018-05-13 | ||||
| PKG_SOURCE_VERSION:=820621952d537c49deba470c6f61c40df93f4ba8 | ||||
| PKG_SOURCE_DATE:=2018-08-16 | ||||
| PKG_SOURCE_VERSION:=41333abee4c57e3de2bcfa08972954e2af20705a | ||||
| PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io> | ||||
| PKG_MIRROR_HASH:=24322b547cb062e9676da51d09de19d1cb9fb07df9e82b2b63fc0f714ec1c14b | ||||
| PKG_MIRROR_HASH:=a6d3c2228836a738919dfbd57a9e3ae5d427d5f94607b7e78b92b03f09f59731 | ||||
|  | ||||
| PKG_LICENSE:=ISC | ||||
| PKG_LICENSE_FILES:= | ||||
|   | ||||
| @@ -13,9 +13,9 @@ PKG_RELEASE:=1 | ||||
|  | ||||
| PKG_SOURCE_URL=$(PROJECT_GIT)/project/uci.git | ||||
| PKG_SOURCE_PROTO:=git | ||||
| PKG_SOURCE_DATE=2018-03-24 | ||||
| PKG_SOURCE_VERSION:=5d2bf09ec594d97eb9284b8c721dbfe10b81a6f6 | ||||
| PKG_MIRROR_HASH:=61f8cf52950edae851892ed0914dea8e1ab796bcefc095aa5dab28f672dc3301 | ||||
| PKG_SOURCE_DATE=2018-08-11 | ||||
| PKG_SOURCE_VERSION:=4c8b4d6efc8302b508d261573351fffb75bd98c2 | ||||
| PKG_MIRROR_HASH:=c1f0f565921c71ff9231508c7c249baacad4c3ae1a3fade25c37bcb2bf7a7b5f | ||||
|  | ||||
| PKG_LICENSE:=LGPL-2.1 | ||||
| PKG_LICENSE_FILES:= | ||||
|   | ||||
| @@ -8,7 +8,7 @@ | ||||
| include $(TOPDIR)/rules.mk | ||||
|  | ||||
| PKG_NAME:=px5g | ||||
| PKG_RELEASE:=5 | ||||
| PKG_RELEASE:=6 | ||||
| PKG_LICENSE:=LGPL-2.1 | ||||
| PKG_BUILD_DIR:=$(BUILD_DIR)/px5g-$(BUILD_VARIANT) | ||||
|  | ||||
|   | ||||
| @@ -1,32 +0,0 @@ | ||||
| From a728a196d253530f17da5c86dc7dfbe58c5f7094 Mon Sep 17 00:00:00 2001 | ||||
| From: Christian Lamparter <chunkeey@googlemail.com> | ||||
| Date: Fri, 25 Aug 2017 15:47:14 +0200 | ||||
| Subject: [PATCH 01/25] crypto: crypto4xx - remove bad list_del | ||||
|  | ||||
| alg entries are only added to the list, after the registration | ||||
| was successful. If the registration failed, it was never added | ||||
| to the list in the first place. | ||||
|  | ||||
| Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> | ||||
| Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> | ||||
| --- | ||||
|  drivers/crypto/amcc/crypto4xx_core.c | 6 ++---- | ||||
|  1 file changed, 2 insertions(+), 4 deletions(-) | ||||
|  | ||||
| --- a/drivers/crypto/amcc/crypto4xx_core.c | ||||
| +++ b/drivers/crypto/amcc/crypto4xx_core.c | ||||
| @@ -1033,12 +1033,10 @@ int crypto4xx_register_alg(struct crypto | ||||
|  			break; | ||||
|  		} | ||||
|   | ||||
| -		if (rc) { | ||||
| -			list_del(&alg->entry); | ||||
| +		if (rc) | ||||
|  			kfree(alg); | ||||
| -		} else { | ||||
| +		else | ||||
|  			list_add_tail(&alg->entry, &sec_dev->alg_list); | ||||
| -		} | ||||
|  	} | ||||
|   | ||||
|  	return 0; | ||||
| @@ -67,7 +67,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> | ||||
|   | ||||
| --- a/drivers/crypto/amcc/crypto4xx_core.c | ||||
| +++ b/drivers/crypto/amcc/crypto4xx_core.c | ||||
| @@ -962,7 +962,7 @@ u32 crypto4xx_build_pd(struct crypto_asy | ||||
| @@ -964,7 +964,7 @@ u32 crypto4xx_build_pd(struct crypto_asy | ||||
|   | ||||
|  	sa->sa_command_1.bf.hash_crypto_offset = 0; | ||||
|  	pd->pd_ctl.w = ctx->pd_ctl; | ||||
|   | ||||
| @@ -18,7 +18,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> | ||||
|  | ||||
| --- a/drivers/crypto/amcc/crypto4xx_core.c | ||||
| +++ b/drivers/crypto/amcc/crypto4xx_core.c | ||||
| @@ -1114,7 +1114,9 @@ struct crypto4xx_alg_common crypto4xx_al | ||||
| @@ -1116,7 +1116,9 @@ struct crypto4xx_alg_common crypto4xx_al | ||||
|  		.cra_name 	= "cbc(aes)", | ||||
|  		.cra_driver_name = "cbc-aes-ppc4xx", | ||||
|  		.cra_priority 	= CRYPTO4XX_CRYPTO_PRIORITY, | ||||
|   | ||||
| @@ -14,7 +14,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> | ||||
|  | ||||
| --- a/drivers/crypto/amcc/crypto4xx_core.c | ||||
| +++ b/drivers/crypto/amcc/crypto4xx_core.c | ||||
| @@ -1079,7 +1079,6 @@ static void crypto4xx_bh_tasklet_cb(unsi | ||||
| @@ -1081,7 +1081,6 @@ static void crypto4xx_bh_tasklet_cb(unsi | ||||
|  			pd->pd_ctl.bf.pe_done = 0; | ||||
|  			crypto4xx_pd_done(core_dev->dev, tail); | ||||
|  			crypto4xx_put_pd_to_pdr(core_dev->dev, tail); | ||||
|   | ||||
| @@ -109,7 +109,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> | ||||
|  #include <crypto/sha.h> | ||||
|  #include "crypto4xx_reg_def.h" | ||||
|  #include "crypto4xx_core.h" | ||||
| @@ -1133,6 +1134,103 @@ struct crypto4xx_alg_common crypto4xx_al | ||||
| @@ -1135,6 +1136,103 @@ struct crypto4xx_alg_common crypto4xx_al | ||||
|  			} | ||||
|  		} | ||||
|  	}}, | ||||
|   | ||||
| @@ -27,7 +27,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> | ||||
|  #include "crypto4xx_reg_def.h" | ||||
|  #include "crypto4xx_core.h" | ||||
|  #include "crypto4xx_sa.h" | ||||
| @@ -481,111 +482,44 @@ static inline struct ce_sd *crypto4xx_ge | ||||
| @@ -483,111 +484,44 @@ static inline struct ce_sd *crypto4xx_ge | ||||
|  	return  (struct ce_sd *)(dev->sdr + sizeof(struct ce_sd) * idx); | ||||
|  } | ||||
|   | ||||
|   | ||||
| @@ -17,7 +17,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> | ||||
|  | ||||
| --- a/drivers/crypto/amcc/crypto4xx_core.c | ||||
| +++ b/drivers/crypto/amcc/crypto4xx_core.c | ||||
| @@ -394,10 +394,9 @@ static u32 crypto4xx_build_sdr(struct cr | ||||
| @@ -396,10 +396,9 @@ static u32 crypto4xx_build_sdr(struct cr | ||||
|  	if (!dev->sdr) | ||||
|  		return -ENOMEM; | ||||
|   | ||||
| @@ -29,7 +29,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> | ||||
|  			&dev->scatter_buffer_pa, GFP_ATOMIC); | ||||
|  	if (!dev->scatter_buffer_va) { | ||||
|  		dma_free_coherent(dev->core_dev->device, | ||||
| @@ -410,7 +409,7 @@ static u32 crypto4xx_build_sdr(struct cr | ||||
| @@ -412,7 +411,7 @@ static u32 crypto4xx_build_sdr(struct cr | ||||
|   | ||||
|  	for (i = 0; i < PPC4XX_NUM_SD; i++) { | ||||
|  		sd_array[i].ptr = dev->scatter_buffer_pa + | ||||
| @@ -38,9 +38,9 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> | ||||
|  	} | ||||
|   | ||||
|  	return 0; | ||||
| @@ -425,7 +424,7 @@ static void crypto4xx_destroy_sdr(struct | ||||
| @@ -427,7 +426,7 @@ static void crypto4xx_destroy_sdr(struct | ||||
|   | ||||
|  	if (dev->scatter_buffer_va != NULL) | ||||
|  	if (dev->scatter_buffer_va) | ||||
|  		dma_free_coherent(dev->core_dev->device, | ||||
| -				  dev->scatter_buffer_size * PPC4XX_NUM_SD, | ||||
| +				  PPC4XX_SD_BUFFER_SIZE * PPC4XX_NUM_SD, | ||||
|   | ||||
| @@ -1,84 +0,0 @@ | ||||
| From 5d59ad6eea82ef8df92b4109615a0dde9d8093e9 Mon Sep 17 00:00:00 2001 | ||||
| From: Christian Lamparter <chunkeey@googlemail.com> | ||||
| Date: Fri, 25 Aug 2017 15:47:24 +0200 | ||||
| Subject: [PATCH 11/25] crypto: crypto4xx - fix crypto4xx_build_pdr, | ||||
|  crypto4xx_build_sdr leak | ||||
|  | ||||
| If one of the later memory allocations in rypto4xx_build_pdr() | ||||
| fails: dev->pdr (and/or) dev->pdr_uinfo wouldn't be freed. | ||||
|  | ||||
| crypto4xx_build_sdr() has the same issue with dev->sdr. | ||||
|  | ||||
| Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> | ||||
| Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> | ||||
| --- | ||||
|  drivers/crypto/amcc/crypto4xx_core.c | 17 +++++++++-------- | ||||
|  1 file changed, 9 insertions(+), 8 deletions(-) | ||||
|  | ||||
| --- a/drivers/crypto/amcc/crypto4xx_core.c | ||||
| +++ b/drivers/crypto/amcc/crypto4xx_core.c | ||||
| @@ -209,7 +209,7 @@ static u32 crypto4xx_build_pdr(struct cr | ||||
|  				  dev->pdr_pa); | ||||
|  		return -ENOMEM; | ||||
|  	} | ||||
| -	memset(dev->pdr, 0,  sizeof(struct ce_pd) * PPC4XX_NUM_PD); | ||||
| +	memset(dev->pdr, 0, sizeof(struct ce_pd) * PPC4XX_NUM_PD); | ||||
|  	dev->shadow_sa_pool = dma_alloc_coherent(dev->core_dev->device, | ||||
|  				   256 * PPC4XX_NUM_PD, | ||||
|  				   &dev->shadow_sa_pool_pa, | ||||
| @@ -242,13 +242,15 @@ static u32 crypto4xx_build_pdr(struct cr | ||||
|   | ||||
|  static void crypto4xx_destroy_pdr(struct crypto4xx_device *dev) | ||||
|  { | ||||
| -	if (dev->pdr != NULL) | ||||
| +	if (dev->pdr) | ||||
|  		dma_free_coherent(dev->core_dev->device, | ||||
|  				  sizeof(struct ce_pd) * PPC4XX_NUM_PD, | ||||
|  				  dev->pdr, dev->pdr_pa); | ||||
| + | ||||
|  	if (dev->shadow_sa_pool) | ||||
|  		dma_free_coherent(dev->core_dev->device, 256 * PPC4XX_NUM_PD, | ||||
|  				  dev->shadow_sa_pool, dev->shadow_sa_pool_pa); | ||||
| + | ||||
|  	if (dev->shadow_sr_pool) | ||||
|  		dma_free_coherent(dev->core_dev->device, | ||||
|  			sizeof(struct sa_state_record) * PPC4XX_NUM_PD, | ||||
| @@ -417,12 +419,12 @@ static u32 crypto4xx_build_sdr(struct cr | ||||
|   | ||||
|  static void crypto4xx_destroy_sdr(struct crypto4xx_device *dev) | ||||
|  { | ||||
| -	if (dev->sdr != NULL) | ||||
| +	if (dev->sdr) | ||||
|  		dma_free_coherent(dev->core_dev->device, | ||||
|  				  sizeof(struct ce_sd) * PPC4XX_NUM_SD, | ||||
|  				  dev->sdr, dev->sdr_pa); | ||||
|   | ||||
| -	if (dev->scatter_buffer_va != NULL) | ||||
| +	if (dev->scatter_buffer_va) | ||||
|  		dma_free_coherent(dev->core_dev->device, | ||||
|  				  PPC4XX_SD_BUFFER_SIZE * PPC4XX_NUM_SD, | ||||
|  				  dev->scatter_buffer_va, | ||||
| @@ -1223,7 +1225,7 @@ static int crypto4xx_probe(struct platfo | ||||
|   | ||||
|  	rc = crypto4xx_build_gdr(core_dev->dev); | ||||
|  	if (rc) | ||||
| -		goto err_build_gdr; | ||||
| +		goto err_build_pdr; | ||||
|   | ||||
|  	rc = crypto4xx_build_sdr(core_dev->dev); | ||||
|  	if (rc) | ||||
| @@ -1266,12 +1268,11 @@ err_iomap: | ||||
|  err_request_irq: | ||||
|  	irq_dispose_mapping(core_dev->irq); | ||||
|  	tasklet_kill(&core_dev->tasklet); | ||||
| -	crypto4xx_destroy_sdr(core_dev->dev); | ||||
|  err_build_sdr: | ||||
| +	crypto4xx_destroy_sdr(core_dev->dev); | ||||
|  	crypto4xx_destroy_gdr(core_dev->dev); | ||||
| -err_build_gdr: | ||||
| -	crypto4xx_destroy_pdr(core_dev->dev); | ||||
|  err_build_pdr: | ||||
| +	crypto4xx_destroy_pdr(core_dev->dev); | ||||
|  	kfree(core_dev->dev); | ||||
|  err_alloc_dev: | ||||
|  	kfree(core_dev); | ||||
| @@ -44,7 +44,7 @@ produce a noisy warning. | ||||
|  		hcd->msi_enabled = 1; | ||||
| --- a/drivers/usb/host/xhci.h | ||||
| +++ b/drivers/usb/host/xhci.h | ||||
| @@ -1850,6 +1850,7 @@ struct xhci_hcd { | ||||
| @@ -1854,6 +1854,7 @@ struct xhci_hcd { | ||||
|  	/* support xHCI 0.96 spec USB2 software LPM */ | ||||
|  	unsigned		sw_lpm_support:1; | ||||
|  	/* support xHCI 1.0 spec USB2 hardware LPM */ | ||||
|   | ||||
| @@ -1,129 +0,0 @@ | ||||
| CONFIG_ADM6996_PHY=y | ||||
| CONFIG_AR7=y | ||||
| CONFIG_AR7_TI=y | ||||
| # CONFIG_AR7_TYPE_AC49X is not set | ||||
| CONFIG_AR7_TYPE_TI=y | ||||
| CONFIG_AR7_WDT=y | ||||
| CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y | ||||
| CONFIG_ARCH_DISCARD_MEMBLOCK=y | ||||
| CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y | ||||
| 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_BOOT_ELF32=y | ||||
| CONFIG_CEVT_R4K=y | ||||
| CONFIG_CLONE_BACKWARDS=y | ||||
| CONFIG_CMDLINE="rootfstype=squashfs,jffs2" | ||||
| CONFIG_CMDLINE_BOOL=y | ||||
| # CONFIG_CMDLINE_OVERRIDE is not set | ||||
| CONFIG_CPMAC=y | ||||
| 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_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_ETHERNET_PACKET_MANGLE=y | ||||
| CONFIG_FIXED_PHY=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_HARDWARE_WATCHPOINTS=y | ||||
| CONFIG_HAS_DMA=y | ||||
| CONFIG_HAS_IOMEM=y | ||||
| CONFIG_HAS_IOPORT=y | ||||
| # CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set | ||||
| CONFIG_HAVE_ARCH_JUMP_LABEL=y | ||||
| CONFIG_HAVE_ARCH_KGDB=y | ||||
| CONFIG_HAVE_ARCH_TRACEHOOK=y | ||||
| # CONFIG_HAVE_BOOTMEM_INFO_NODE is not set | ||||
| 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_DYNAMIC_FTRACE=y | ||||
| CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y | ||||
| CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y | ||||
| CONFIG_HAVE_FUNCTION_TRACER=y | ||||
| CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y | ||||
| CONFIG_HAVE_GENERIC_DMA_COHERENT=y | ||||
| CONFIG_HAVE_IDE=y | ||||
| CONFIG_HAVE_KERNEL_BZIP2=y | ||||
| CONFIG_HAVE_KERNEL_GZIP=y | ||||
| CONFIG_HAVE_KERNEL_LZ4=y | ||||
| CONFIG_HAVE_KERNEL_LZMA=y | ||||
| CONFIG_HAVE_KERNEL_LZO=y | ||||
| CONFIG_HAVE_KERNEL_XZ=y | ||||
| CONFIG_HAVE_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_RANDOM=y | ||||
| CONFIG_HZ_PERIODIC=y | ||||
| CONFIG_INITRAMFS_SOURCE="" | ||||
| CONFIG_IP17XX_PHY=y | ||||
| CONFIG_IRQ_CPU=y | ||||
| CONFIG_IRQ_FORCED_THREADING=y | ||||
| CONFIG_IRQ_WORK=y | ||||
| CONFIG_KALLSYMS=y | ||||
| CONFIG_LEDS_GPIO=y | ||||
| CONFIG_LEDS_TRIGGER_HEARTBEAT=y | ||||
| CONFIG_MDIO_BOARDINFO=y | ||||
| CONFIG_MIPS=y | ||||
| # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set | ||||
| CONFIG_MIPS_L1_CACHE_SHIFT=5 | ||||
| # CONFIG_MIPS_MACHINE is not set | ||||
| CONFIG_MIPS_MT_DISABLED=y | ||||
| CONFIG_MODULES_USE_ELF_REL=y | ||||
| # CONFIG_MTD_AC49X_PARTS is not set | ||||
| CONFIG_MTD_CFI_STAA=y | ||||
| CONFIG_MTD_PHYSMAP=y | ||||
| CONFIG_MVSWITCH_PHY=y | ||||
| CONFIG_NEED_DMA_MAP_STATE=y | ||||
| CONFIG_NEED_PER_CPU_KM=y | ||||
| CONFIG_NO_EXCEPT_FILL=y | ||||
| CONFIG_PAGEFLAGS_EXTENDED=y | ||||
| CONFIG_PERF_USE_VMALLOC=y | ||||
| CONFIG_PHYLIB=y | ||||
| # CONFIG_PREEMPT_RCU is not set | ||||
| # CONFIG_RCU_STALL_COMMON is not set | ||||
| # CONFIG_SCSI_DMA is not set | ||||
| CONFIG_SWAP_IO_SPACE=y | ||||
| CONFIG_SWCONFIG=y | ||||
| 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_LITTLE_ENDIAN=y | ||||
| CONFIG_SYS_SUPPORTS_ZBOOT=y | ||||
| CONFIG_SYS_SUPPORTS_ZBOOT_UART16550=y | ||||
| CONFIG_TICK_CPU_ACCOUNTING=y | ||||
| CONFIG_VLYNQ=y | ||||
| # CONFIG_VLYNQ_DEBUG is not set | ||||
| CONFIG_ZONE_DMA_FLAG=0 | ||||
| @@ -1,23 +0,0 @@ | ||||
| From 443ab715a40881d6c9ba11b027ba154bac904cb0 Mon Sep 17 00:00:00 2001 | ||||
| From: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> | ||||
| Date: Sat, 10 May 2014 23:19:08 +0200 | ||||
| Subject: [PATCH] MIPS/AR7: ensure that serial ports are properly set up | ||||
|  | ||||
| without UPF_FIXED_TYPE, the data from the PORT_AR7 uart_config entry is | ||||
| never copied, resulting in a dead port. | ||||
|  | ||||
| Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> | ||||
| --- | ||||
|  arch/mips/ar7/platform.c | 1 + | ||||
|  1 file changed, 1 insertion(+) | ||||
|  | ||||
| --- a/arch/mips/ar7/platform.c | ||||
| +++ b/arch/mips/ar7/platform.c | ||||
| @@ -581,6 +581,7 @@ static int __init ar7_register_uarts(voi | ||||
|  	uart_port.type		= PORT_AR7; | ||||
|  	uart_port.uartclk	= clk_get_rate(bus_clk) / 2; | ||||
|  	uart_port.iotype	= UPIO_MEM32; | ||||
| +	uart_port.flags		= UPF_FIXED_TYPE; | ||||
|  	uart_port.regshift	= 2; | ||||
|   | ||||
|  	uart_port.line		= 0; | ||||
| @@ -1,48 +0,0 @@ | ||||
| From ee6c9d41de084b2cefd90e5e0c9f30a35f6d3967 Mon Sep 17 00:00:00 2001 | ||||
| From: Jonas Gorski <jonas.gorski@gmail.com> | ||||
| Date: Sun, 29 Oct 2017 15:50:42 +0100 | ||||
| Subject: [PATCH RFC 3/3] MIPS: AR7: ensure the port type's FCR value is used | ||||
|  | ||||
| Since commit aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt | ||||
| trigger I/F of FIFO buffers"), the port's default FCR value isn't used | ||||
| in serial8250_do_set_termios anymore, but copied over once in | ||||
| serial8250_config_port and then modified as needed. | ||||
|  | ||||
| Unfortunately, serial8250_config_port will never be called if the port | ||||
| is shared between kernel and userspace, and the port's flag doesn't have | ||||
| UPF_BOOT_AUTOCONF, which would trigger a serial8250_config_port as well. | ||||
|  | ||||
| This causes garbled output from userspace: | ||||
|  | ||||
| [    5.220000] random: procd urandom read with 49 bits of entropy available | ||||
| ers | ||||
|    [kee | ||||
|  | ||||
| Fix this by forcing it to be configured on boot, resulting in the | ||||
| expected output: | ||||
|  | ||||
| [    5.250000] random: procd urandom read with 50 bits of entropy available | ||||
| Press the [f] key and hit [enter] to enter failsafe mode | ||||
| Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level | ||||
|  | ||||
| Fixes: aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt trigger I/F of FIFO buffers") | ||||
| Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> | ||||
| --- | ||||
| I'm not sure if this is just AR7's issue, or if this points to a general | ||||
| issue for UARTs used as kernel console and login console with the "fixed" | ||||
| commit. | ||||
|  | ||||
|  arch/mips/ar7/platform.c | 2 +- | ||||
|  1 file changed, 1 insertion(+), 1 deletion(-) | ||||
|  | ||||
| --- a/arch/mips/ar7/platform.c | ||||
| +++ b/arch/mips/ar7/platform.c | ||||
| @@ -581,7 +581,7 @@ static int __init ar7_register_uarts(voi | ||||
|  	uart_port.type		= PORT_AR7; | ||||
|  	uart_port.uartclk	= clk_get_rate(bus_clk) / 2; | ||||
|  	uart_port.iotype	= UPIO_MEM32; | ||||
| -	uart_port.flags		= UPF_FIXED_TYPE; | ||||
| +	uart_port.flags		= UPF_FIXED_TYPE | UPF_BOOT_AUTOCONF; | ||||
|  	uart_port.regshift	= 2; | ||||
|   | ||||
|  	uart_port.line		= 0; | ||||
| @@ -1,11 +0,0 @@ | ||||
| --- a/arch/mips/include/asm/mach-ar7/spaces.h | ||||
| +++ b/arch/mips/include/asm/mach-ar7/spaces.h | ||||
| @@ -20,6 +20,8 @@ | ||||
|  #define UNCAC_BASE	_AC(0xb4000000, UL)	/* 0xa0000000 + PHYS_OFFSET */ | ||||
|  #define IO_BASE		UNCAC_BASE | ||||
|   | ||||
| +#define HIGHMEM_START	_AC(0x20000000, UL) | ||||
| + | ||||
|  #include <asm/mach-generic/spaces.h> | ||||
|   | ||||
|  #endif /* __ASM_AR7_SPACES_H */ | ||||
| @@ -1,45 +0,0 @@ | ||||
| From patchwork Tue Jul 18 10:17:26 2017 | ||||
| Content-Type: text/plain; charset="utf-8" | ||||
| MIME-Version: 1.0 | ||||
| Content-Transfer-Encoding: 7bit | ||||
| Subject: [5/9] MIPS: AR7: allow NULL clock for clk_get_rate | ||||
| X-Patchwork-Submitter: Jonas Gorski <jonas.gorski@gmail.com> | ||||
| X-Patchwork-Id: 16775 | ||||
| Message-Id: <20170718101730.2541-6-jonas.gorski@gmail.com> | ||||
| To: unlisted-recipients:; (no To-header on input) | ||||
| Cc: Ralf Baechle <ralf@linux-mips.org>, | ||||
|  Paul Gortmaker <paul.gortmaker@windriver.com>, | ||||
|  James Hogan <james.hogan@imgtec.com>, | ||||
|  linux-mips@linux-mips.org, linux-kernel@vger.kernel.org | ||||
| Date: Tue, 18 Jul 2017 12:17:26 +0200 | ||||
| From: Jonas Gorski <jonas.gorski@gmail.com> | ||||
| List-Id: linux-mips <linux-mips.eddie.linux-mips.org> | ||||
|  | ||||
| Make the behaviour of clk_get_rate consistent with common clk's | ||||
| clk_get_rate by accepting NULL clocks as parameter. Some device | ||||
| drivers rely on this, and will cause an OOPS otherwise. | ||||
|  | ||||
| Fixes: 780019ddf02f ("MIPS: AR7: Implement clock API") | ||||
| Cc: Ralf Baechle <ralf@linux-mips.org> | ||||
| Cc: Paul Gortmaker <paul.gortmaker@windriver.com> | ||||
| Cc: James Hogan <james.hogan@imgtec.com> | ||||
| Cc: linux-mips@linux-mips.org | ||||
| Cc: linux-kernel@vger.kernel.org | ||||
| Reported-by: Mathias Kresin <dev@kresin.me> | ||||
| Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> | ||||
| --- | ||||
|  arch/mips/ar7/clock.c | 3 +++ | ||||
|  1 file changed, 3 insertions(+) | ||||
|  | ||||
| --- a/arch/mips/ar7/clock.c | ||||
| +++ b/arch/mips/ar7/clock.c | ||||
| @@ -430,6 +430,9 @@ EXPORT_SYMBOL(clk_disable); | ||||
|   | ||||
|  unsigned long clk_get_rate(struct clk *clk) | ||||
|  { | ||||
| +	if (!clk) | ||||
| +		return 0; | ||||
| + | ||||
|  	return clk->rate; | ||||
|  } | ||||
|  EXPORT_SYMBOL(clk_get_rate); | ||||
| @@ -1,22 +0,0 @@ | ||||
| --- a/drivers/mtd/Makefile | ||||
| +++ b/drivers/mtd/Makefile | ||||
| @@ -12,7 +12,7 @@ obj-$(CONFIG_MTD_OF_PARTS)	+= ofpart.o | ||||
|  obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o | ||||
|  obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o | ||||
|  obj-$(CONFIG_MTD_AFS_PARTS)	+= afs.o | ||||
| -obj-$(CONFIG_MTD_AR7_PARTS)	+= ar7part.o | ||||
| +obj-$(CONFIG_MTD_AR7_PARTS)	+= ar7part.o titanpart.o | ||||
|  obj-$(CONFIG_MTD_BCM63XX_PARTS)	+= bcm63xxpart.o | ||||
|  obj-$(CONFIG_MTD_BCM47XX_PARTS)	+= bcm47xxpart.o | ||||
|  obj-$(CONFIG_MTD_MYLOADER_PARTS) += myloader.o | ||||
| --- a/arch/mips/ar7/platform.c | ||||
| +++ b/arch/mips/ar7/platform.c | ||||
| @@ -199,7 +199,7 @@ static struct resource physmap_flash_res | ||||
|  	.name	= "mem", | ||||
|  	.flags	= IORESOURCE_MEM, | ||||
|  	.start	= 0x10000000, | ||||
| -	.end	= 0x107fffff, | ||||
| +	.end	= 0x11ffffff, | ||||
|  }; | ||||
|   | ||||
|  static const char *ar7_probe_types[] = { "ar7part", NULL }; | ||||
| @@ -1,300 +0,0 @@ | ||||
| --- a/drivers/vlynq/vlynq.c | ||||
| +++ b/drivers/vlynq/vlynq.c | ||||
| @@ -119,20 +119,40 @@ static int vlynq_linked(struct vlynq_dev | ||||
|  	return 0; | ||||
|  } | ||||
|   | ||||
| +static volatile int vlynq_delay_value_new = 0; | ||||
| + | ||||
| +static void vlynq_delay_wait(u32 count) | ||||
| +{ | ||||
| +	/* Code adopted from original vlynq driver */ | ||||
| +	int i = 0; | ||||
| +	volatile int *ptr = &vlynq_delay_value_new; | ||||
| +	*ptr = 0; | ||||
| + | ||||
| +	/* We are assuming that the each cycle takes about | ||||
| +	 * 23 assembly instructions. */ | ||||
| +	for(i = 0; i < (count + 23)/23; i++) | ||||
| +		*ptr = *ptr + 1; | ||||
| +} | ||||
| + | ||||
|  static void vlynq_reset(struct vlynq_device *dev) | ||||
|  { | ||||
| +	u32 rtm = readl(&dev->local->revision); | ||||
| + | ||||
| +	rtm = rtm < 0x00010205 || readl(&dev->local->status) & 0x800 == 0 ? | ||||
| +			0 : 0x600000; | ||||
| + | ||||
|  	writel(readl(&dev->local->control) | VLYNQ_CTRL_RESET, | ||||
|  			&dev->local->control); | ||||
|   | ||||
|  	/* Wait for the devices to finish resetting */ | ||||
| -	msleep(5); | ||||
| +	vlynq_delay_wait(0xffffff); | ||||
|   | ||||
|  	/* Remove reset bit */ | ||||
| -	writel(readl(&dev->local->control) & ~VLYNQ_CTRL_RESET, | ||||
| +	writel(readl(&dev->local->control) & ~VLYNQ_CTRL_RESET | rtm, | ||||
|  			&dev->local->control); | ||||
|   | ||||
|  	/* Give some time for the devices to settle */ | ||||
| -	msleep(5); | ||||
| +	vlynq_delay_wait(0xffffff); | ||||
|  } | ||||
|   | ||||
|  static void vlynq_irq_unmask(struct irq_data *d) | ||||
| @@ -379,6 +399,61 @@ void vlynq_unregister_driver(struct vlyn | ||||
|  } | ||||
|  EXPORT_SYMBOL(vlynq_unregister_driver); | ||||
|   | ||||
| +enum vlynq_clk_src { | ||||
| +	vlynq_clk_external, | ||||
| +	vlynq_clk_local, | ||||
| +	vlynq_clk_remote, | ||||
| +	vlynq_clk_invalid, | ||||
| +}; | ||||
| + | ||||
| +static int __vlynq_set_clocks(struct vlynq_device *dev, | ||||
| +				enum vlynq_clk_src clk_dir, | ||||
| +				int lclk_div, int rclk_div) | ||||
| +{ | ||||
| +	u32 reg; | ||||
| + | ||||
| +	if (clk_dir == vlynq_clk_invalid) { | ||||
| +		printk(KERN_ERR "%s: attempt to set invalid clocking\n", | ||||
| +				dev_name(&dev->dev)); | ||||
| +		return -EINVAL; | ||||
| +	} | ||||
| + | ||||
| +	reg = readl(&dev->local->control); | ||||
| +	if (readl(&dev->local->revision) < 0x00010205) { | ||||
| +		if (clk_dir & vlynq_clk_local) | ||||
| +			reg |= VLYNQ_CTRL_CLOCK_INT; | ||||
| +		else | ||||
| +			reg &= ~VLYNQ_CTRL_CLOCK_INT; | ||||
| +	} | ||||
| +	reg &= ~VLYNQ_CTRL_CLOCK_MASK; | ||||
| +	reg |= VLYNQ_CTRL_CLOCK_DIV(lclk_div); | ||||
| +	writel(reg, &dev->local->control); | ||||
| + | ||||
| +	if (!vlynq_linked(dev)) | ||||
| +		return -ENODEV; | ||||
| + | ||||
| +	printk(KERN_INFO "%s: local VLYNQ protocol rev. is 0x%08x\n", | ||||
| +			dev_name(&dev->dev), readl(&dev->local->revision)); | ||||
| +	printk(KERN_INFO "%s: remote VLYNQ protocol rev. is 0x%08x\n", | ||||
| +			dev_name(&dev->dev), readl(&dev->remote->revision)); | ||||
| + | ||||
| +	reg = readl(&dev->remote->control); | ||||
| +	if (readl(&dev->remote->revision) < 0x00010205) { | ||||
| +		if (clk_dir & vlynq_clk_remote) | ||||
| +			reg |= VLYNQ_CTRL_CLOCK_INT; | ||||
| +		else | ||||
| +			reg &= ~VLYNQ_CTRL_CLOCK_INT; | ||||
| +	} | ||||
| +	reg &= ~VLYNQ_CTRL_CLOCK_MASK; | ||||
| +	reg |= VLYNQ_CTRL_CLOCK_DIV(rclk_div); | ||||
| +	writel(reg, &dev->remote->control); | ||||
| + | ||||
| +	if (!vlynq_linked(dev)) | ||||
| +		return -ENODEV; | ||||
| + | ||||
| +	return 0; | ||||
| +} | ||||
| + | ||||
|  /* | ||||
|   * A VLYNQ remote device can clock the VLYNQ bus master | ||||
|   * using a dedicated clock line. In that case, both the | ||||
| @@ -392,29 +467,16 @@ static int __vlynq_try_remote(struct vly | ||||
|  	int i; | ||||
|   | ||||
|  	vlynq_reset(dev); | ||||
| -	for (i = dev->dev_id ? vlynq_rdiv2 : vlynq_rdiv8; dev->dev_id ? | ||||
| -			i <= vlynq_rdiv8 : i >= vlynq_rdiv2; | ||||
| -		dev->dev_id ? i++ : i--) { | ||||
| +	for (i = 0; i <= 7; i++) { | ||||
|   | ||||
|  		if (!vlynq_linked(dev)) | ||||
|  			break; | ||||
|   | ||||
| -		writel((readl(&dev->remote->control) & | ||||
| -				~VLYNQ_CTRL_CLOCK_MASK) | | ||||
| -				VLYNQ_CTRL_CLOCK_INT | | ||||
| -				VLYNQ_CTRL_CLOCK_DIV(i - vlynq_rdiv1), | ||||
| -				&dev->remote->control); | ||||
| -		writel((readl(&dev->local->control) | ||||
| -				& ~(VLYNQ_CTRL_CLOCK_INT | | ||||
| -				VLYNQ_CTRL_CLOCK_MASK)) | | ||||
| -				VLYNQ_CTRL_CLOCK_DIV(i - vlynq_rdiv1), | ||||
| -				&dev->local->control); | ||||
| - | ||||
| -		if (vlynq_linked(dev)) { | ||||
| -			printk(KERN_DEBUG | ||||
| -				"%s: using remote clock divisor %d\n", | ||||
| -				dev_name(&dev->dev), i - vlynq_rdiv1 + 1); | ||||
| -			dev->divisor = i; | ||||
| +		if (!__vlynq_set_clocks(dev, vlynq_clk_remote, i, i)) { | ||||
| +			printk(KERN_INFO | ||||
| +					"%s: using remote clock divisor %d\n", | ||||
| +					dev_name(&dev->dev), i + 1); | ||||
| +			dev->divisor = i + vlynq_rdiv1; | ||||
|  			return 0; | ||||
|  		} else { | ||||
|  			vlynq_reset(dev); | ||||
| @@ -433,25 +495,17 @@ static int __vlynq_try_remote(struct vly | ||||
|   */ | ||||
|  static int __vlynq_try_local(struct vlynq_device *dev) | ||||
|  { | ||||
| -	int i; | ||||
| +	int i, dir = !dev->dev_id; | ||||
|   | ||||
|  	vlynq_reset(dev); | ||||
|   | ||||
| -	for (i = dev->dev_id ? vlynq_ldiv2 : vlynq_ldiv8; dev->dev_id ? | ||||
| -			i <= vlynq_ldiv8 : i >= vlynq_ldiv2; | ||||
| -		dev->dev_id ? i++ : i--) { | ||||
| - | ||||
| -		writel((readl(&dev->local->control) & | ||||
| -				~VLYNQ_CTRL_CLOCK_MASK) | | ||||
| -				VLYNQ_CTRL_CLOCK_INT | | ||||
| -				VLYNQ_CTRL_CLOCK_DIV(i - vlynq_ldiv1), | ||||
| -				&dev->local->control); | ||||
| - | ||||
| -		if (vlynq_linked(dev)) { | ||||
| -			printk(KERN_DEBUG | ||||
| -				"%s: using local clock divisor %d\n", | ||||
| -				dev_name(&dev->dev), i - vlynq_ldiv1 + 1); | ||||
| -			dev->divisor = i; | ||||
| +	for (i = dir ? 7 : 0; dir ? i >= 0 : i <= 7; dir ? i-- : i++) { | ||||
| + | ||||
| +		if (!__vlynq_set_clocks(dev, vlynq_clk_local, i, 0)) { | ||||
| +			printk(KERN_INFO | ||||
| +					"%s: using local clock divisor %d\n", | ||||
| +					dev_name(&dev->dev), i + 1); | ||||
| +			dev->divisor = i + vlynq_ldiv1; | ||||
|  			return 0; | ||||
|  		} else { | ||||
|  			vlynq_reset(dev); | ||||
| @@ -473,18 +527,10 @@ static int __vlynq_try_external(struct v | ||||
|  	if (!vlynq_linked(dev)) | ||||
|  		return -ENODEV; | ||||
|   | ||||
| -	writel((readl(&dev->remote->control) & | ||||
| -			~VLYNQ_CTRL_CLOCK_INT), | ||||
| -			&dev->remote->control); | ||||
| - | ||||
| -	writel((readl(&dev->local->control) & | ||||
| -			~VLYNQ_CTRL_CLOCK_INT), | ||||
| -			&dev->local->control); | ||||
| - | ||||
| -	if (vlynq_linked(dev)) { | ||||
| -		printk(KERN_DEBUG "%s: using external clock\n", | ||||
| -			dev_name(&dev->dev)); | ||||
| -			dev->divisor = vlynq_div_external; | ||||
| +	if (!__vlynq_set_clocks(dev, vlynq_clk_external, 0, 0)) { | ||||
| +		printk(KERN_INFO "%s: using external clock\n", | ||||
| +				dev_name(&dev->dev)); | ||||
| +				dev->divisor = vlynq_div_external; | ||||
|  		return 0; | ||||
|  	} | ||||
|   | ||||
| @@ -501,24 +547,16 @@ static int __vlynq_enable_device(struct | ||||
|  		return result; | ||||
|   | ||||
|  	switch (dev->divisor) { | ||||
| -	case vlynq_div_external: | ||||
|  	case vlynq_div_auto: | ||||
|  		/* When the device is brought from reset it should have clock | ||||
|  		 * generation negotiated by hardware. | ||||
|  		 * Check which device is generating clocks and perform setup | ||||
|  		 * accordingly */ | ||||
| -		if (vlynq_linked(dev) && readl(&dev->remote->control) & | ||||
| -		   VLYNQ_CTRL_CLOCK_INT) { | ||||
| -			if (!__vlynq_try_remote(dev) || | ||||
| -				!__vlynq_try_local(dev)  || | ||||
| -				!__vlynq_try_external(dev)) | ||||
| -				return 0; | ||||
| -		} else { | ||||
| -			if (!__vlynq_try_external(dev) || | ||||
| -				!__vlynq_try_local(dev)    || | ||||
| -				!__vlynq_try_remote(dev)) | ||||
| -				return 0; | ||||
| -		} | ||||
| +		if (!__vlynq_try_remote(dev) || !__vlynq_try_local(dev)) | ||||
| +			return 0; | ||||
| +	case vlynq_div_external: | ||||
| +		if (!__vlynq_try_external(dev)) | ||||
| +			return 0; | ||||
|  		break; | ||||
|  	case vlynq_ldiv1: | ||||
|  	case vlynq_ldiv2: | ||||
| @@ -528,15 +566,12 @@ static int __vlynq_enable_device(struct | ||||
|  	case vlynq_ldiv6: | ||||
|  	case vlynq_ldiv7: | ||||
|  	case vlynq_ldiv8: | ||||
| -		writel(VLYNQ_CTRL_CLOCK_INT | | ||||
| -			VLYNQ_CTRL_CLOCK_DIV(dev->divisor - | ||||
| -			vlynq_ldiv1), &dev->local->control); | ||||
| -		writel(0, &dev->remote->control); | ||||
| -		if (vlynq_linked(dev)) { | ||||
| -			printk(KERN_DEBUG | ||||
| -				"%s: using local clock divisor %d\n", | ||||
| -				dev_name(&dev->dev), | ||||
| -				dev->divisor - vlynq_ldiv1 + 1); | ||||
| +		if (!__vlynq_set_clocks(dev, vlynq_clk_local, dev->divisor - | ||||
| +				vlynq_ldiv1, 0)) { | ||||
| +			printk(KERN_INFO | ||||
| +					"%s: using local clock divisor %d\n", | ||||
| +					dev_name(&dev->dev), | ||||
| +					dev->divisor - vlynq_ldiv1 + 1); | ||||
|  			return 0; | ||||
|  		} | ||||
|  		break; | ||||
| @@ -548,20 +583,17 @@ static int __vlynq_enable_device(struct | ||||
|  	case vlynq_rdiv6: | ||||
|  	case vlynq_rdiv7: | ||||
|  	case vlynq_rdiv8: | ||||
| -		writel(0, &dev->local->control); | ||||
| -		writel(VLYNQ_CTRL_CLOCK_INT | | ||||
| -			VLYNQ_CTRL_CLOCK_DIV(dev->divisor - | ||||
| -			vlynq_rdiv1), &dev->remote->control); | ||||
| -		if (vlynq_linked(dev)) { | ||||
| -			printk(KERN_DEBUG | ||||
| -				"%s: using remote clock divisor %d\n", | ||||
| -				dev_name(&dev->dev), | ||||
| -				dev->divisor - vlynq_rdiv1 + 1); | ||||
| +		if (!__vlynq_set_clocks(dev, vlynq_clk_remote, 0, | ||||
| +				dev->divisor - vlynq_rdiv1)) { | ||||
| +			printk(KERN_INFO | ||||
| +					"%s: using remote clock divisor %d\n", | ||||
| +					dev_name(&dev->dev), | ||||
| +					dev->divisor - vlynq_rdiv1 + 1); | ||||
|  			return 0; | ||||
|  		} | ||||
|  		break; | ||||
|  	} | ||||
| - | ||||
| +	vlynq_reset(dev); | ||||
|  	ops->off(dev); | ||||
|  	return -ENODEV; | ||||
|  } | ||||
| @@ -732,14 +764,14 @@ static int vlynq_probe(struct platform_d | ||||
|  	platform_set_drvdata(pdev, dev); | ||||
|   | ||||
|  	printk(KERN_INFO "%s: regs 0x%p, irq %d, mem 0x%p\n", | ||||
| -	       dev_name(&dev->dev), (void *)dev->regs_start, dev->irq, | ||||
| -	       (void *)dev->mem_start); | ||||
| +			dev_name(&dev->dev), (void *)dev->regs_start, | ||||
| +			dev->irq, (void *)dev->mem_start); | ||||
|   | ||||
|  	dev->dev_id = 0; | ||||
|  	dev->divisor = vlynq_div_auto; | ||||
| -	result = __vlynq_enable_device(dev); | ||||
| -	if (result == 0) { | ||||
| +	if (!__vlynq_enable_device(dev)) { | ||||
|  		dev->dev_id = readl(&dev->remote->chip); | ||||
| +		vlynq_reset(dev); | ||||
|  		((struct plat_vlynq_ops *)(dev->dev.platform_data))->off(dev); | ||||
|  	} | ||||
|  	if (dev->dev_id) | ||||
| @@ -1,15 +0,0 @@ | ||||
| --- a/arch/mips/ar7/memory.c | ||||
| +++ b/arch/mips/ar7/memory.c | ||||
| @@ -66,5 +66,11 @@ void __init prom_meminit(void) | ||||
|   | ||||
|  void __init prom_free_prom_memory(void) | ||||
|  { | ||||
| -	/* Nothing to free */ | ||||
| +	/* adapted from arch/mips/txx9/generic/setup.c */ | ||||
| +	unsigned long saddr = PHYS_OFFSET + PAGE_SIZE; | ||||
| +	unsigned long eaddr = __pa_symbol(&_text); | ||||
| + | ||||
| +	/* free memory between prom-record and kernel _text base */ | ||||
| +	if (saddr < eaddr) | ||||
| +		free_init_pages("prom memory", saddr, eaddr); | ||||
|  } | ||||
| @@ -1,85 +0,0 @@ | ||||
| --- a/arch/mips/ar7/Platform | ||||
| +++ b/arch/mips/ar7/Platform | ||||
| @@ -3,4 +3,9 @@ | ||||
|  # | ||||
|  platform-$(CONFIG_AR7)		+= ar7/ | ||||
|  cflags-$(CONFIG_AR7)		+= -I$(srctree)/arch/mips/include/asm/mach-ar7 | ||||
| -load-$(CONFIG_AR7)		+= 0xffffffff94100000 | ||||
| +load-$(CONFIG_AR7_TI)		+= 0xffffffff94100000 | ||||
| + | ||||
| +# | ||||
| +# AudioCodes AC49x | ||||
| +# | ||||
| +load-$(CONFIG_AR7_AC49X)	+= 0xffffffff945ca000 | ||||
| --- a/arch/mips/ar7/setup.c | ||||
| +++ b/arch/mips/ar7/setup.c | ||||
| @@ -69,6 +69,10 @@ const char *get_system_type(void) | ||||
|  			return "TI AR7 (TNETV1056)"; | ||||
|  		case TITAN_CHIP_1060: | ||||
|  			return "TI AR7 (TNETV1060)"; | ||||
| +		case TITAN_CHIP_AC495: | ||||
| +			return "AudioCodes AC495"; | ||||
| +		case TITAN_CHIP_AC496: | ||||
| +			return "AudioCodes AC496"; | ||||
|  		} | ||||
|  	default: | ||||
|  		return "TI AR7 (unknown)"; | ||||
| --- a/arch/mips/include/asm/mach-ar7/ar7.h | ||||
| +++ b/arch/mips/include/asm/mach-ar7/ar7.h | ||||
| @@ -92,6 +92,8 @@ | ||||
|  #define TITAN_CHIP_1055 0x0e | ||||
|  #define TITAN_CHIP_1056 0x0d | ||||
|  #define TITAN_CHIP_1060 0x07 | ||||
| +#define TITAN_CHIP_AC495	0x00 | ||||
| +#define TITAN_CHIP_AC496	0x02 | ||||
|   | ||||
|  /* Interrupts */ | ||||
|  #define AR7_IRQ_UART0	15 | ||||
| --- a/arch/mips/Kconfig | ||||
| +++ b/arch/mips/Kconfig | ||||
| @@ -94,7 +94,7 @@ config AR7 | ||||
|  	select HAVE_CLK | ||||
|  	help | ||||
|  	  Support for the Texas Instruments AR7 System-on-a-Chip | ||||
| -	  family: TNETD7100, 7200 and 7300. | ||||
| +	  family: TI TNETD7100, 7200, 7300 and AudioCodes AC49x. | ||||
|   | ||||
|  config ATH79 | ||||
|  	bool "Atheros AR71XX/AR724X/AR913X based boards" | ||||
| @@ -835,6 +835,7 @@ config MIPS_PARAVIRT | ||||
|  endchoice | ||||
|   | ||||
|  source "arch/mips/alchemy/Kconfig" | ||||
| +source "arch/mips/ar7/Kconfig" | ||||
|  source "arch/mips/ath79/Kconfig" | ||||
|  source "arch/mips/bcm47xx/Kconfig" | ||||
|  source "arch/mips/bcm63xx/Kconfig" | ||||
| --- /dev/null | ||||
| +++ b/arch/mips/ar7/Kconfig | ||||
| @@ -0,0 +1,26 @@ | ||||
| +if AR7 | ||||
| + | ||||
| +config AR7_TI | ||||
| +	bool | ||||
| + | ||||
| +config AR7_AC49X | ||||
| +	bool | ||||
| + | ||||
| +choice | ||||
| +	prompt "AR7 SoC family selection" | ||||
| +	default AR7_TYPE_TI | ||||
| +	depends on AR7 | ||||
| +	help | ||||
| +	  Select AR7 MIPS SoC implementation. | ||||
| + | ||||
| +	config AR7_TYPE_TI | ||||
| +		bool "Texas Instruments AR7" | ||||
| +		select AR7_TI | ||||
| + | ||||
| +	config AR7_TYPE_AC49X | ||||
| +		bool "AudioCodes AC49X" | ||||
| +		select AR7_AC49X | ||||
| + | ||||
| +endchoice | ||||
| + | ||||
| +endif | ||||
| @@ -1,20 +0,0 @@ | ||||
| --- a/arch/mips/ar7/prom.c | ||||
| +++ b/arch/mips/ar7/prom.c | ||||
| @@ -70,6 +70,7 @@ struct psbl_rec { | ||||
|  }; | ||||
|   | ||||
|  static const char psp_env_version[] __initconst = "TIENV0.8"; | ||||
| +static const char psp_env_version_ac49x[] __initconst = "MaxENV0.2"; | ||||
|   | ||||
|  struct psp_env_chunk { | ||||
|  	u8	num; | ||||
| @@ -186,7 +187,8 @@ static void __init ar7_init_env(struct e | ||||
|  	struct psbl_rec *psbl = (struct psbl_rec *)(KSEG1ADDR(0x14000300)); | ||||
|  	void *psp_env = (void *)KSEG1ADDR(psbl->env_base); | ||||
|   | ||||
| -	if (strcmp(psp_env, psp_env_version) == 0) { | ||||
| +	if (strcmp(psp_env, psp_env_version) == 0 || | ||||
| +	    strcmp(psp_env, psp_env_version_ac49x) == 0) { | ||||
|  		parse_psp_env(psp_env); | ||||
|  	} else { | ||||
|  		for (i = 0; i < MAX_ENTRY; i++, env++) | ||||
| @@ -1,35 +0,0 @@ | ||||
| --- a/drivers/mtd/Kconfig | ||||
| +++ b/drivers/mtd/Kconfig | ||||
| @@ -164,6 +164,11 @@ config MTD_OF_PARTS | ||||
|  	  the partition map from the children of the flash node, | ||||
|  	  as described in Documentation/devicetree/booting-without-of.txt. | ||||
|   | ||||
| +config MTD_AC49X_PARTS | ||||
| +	tristate "AudioCodes AC49X partitioning support" | ||||
| +	---help--- | ||||
| +	  AudioCodes AC49X partitioning support | ||||
| + | ||||
|  config MTD_AR7_PARTS | ||||
|  	tristate "TI AR7 partitioning support" | ||||
|  	---help--- | ||||
| --- a/drivers/mtd/Makefile | ||||
| +++ b/drivers/mtd/Makefile | ||||
| @@ -11,6 +11,7 @@ obj-$(CONFIG_MTD_SPLIT)		+= mtdsplit/ | ||||
|  obj-$(CONFIG_MTD_OF_PARTS)	+= ofpart.o | ||||
|  obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o | ||||
|  obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o | ||||
| +obj-$(CONFIG_MTD_AC49X_PARTS)	+= ac49xpart.o | ||||
|  obj-$(CONFIG_MTD_AFS_PARTS)	+= afs.o | ||||
|  obj-$(CONFIG_MTD_AR7_PARTS)	+= ar7part.o titanpart.o | ||||
|  obj-$(CONFIG_MTD_BCM63XX_PARTS)	+= bcm63xxpart.o | ||||
| --- a/arch/mips/ar7/platform.c | ||||
| +++ b/arch/mips/ar7/platform.c | ||||
| @@ -202,7 +202,7 @@ static struct resource physmap_flash_res | ||||
|  	.end	= 0x11ffffff, | ||||
|  }; | ||||
|   | ||||
| -static const char *ar7_probe_types[] = { "ar7part", NULL }; | ||||
| +static const char *ar7_probe_types[] = { "ac49xpart", "ar7part", NULL }; | ||||
|   | ||||
|  static struct physmap_flash_data physmap_flash_data = { | ||||
|  	.width	= 2, | ||||
| @@ -1,118 +0,0 @@ | ||||
| --- a/drivers/mtd/ar7part.c | ||||
| +++ b/drivers/mtd/ar7part.c | ||||
| @@ -30,11 +30,14 @@ | ||||
|   | ||||
|  #include <uapi/linux/magic.h> | ||||
|   | ||||
| +#include <asm/mach-ar7/prom.h> | ||||
| + | ||||
|  #define AR7_PARTS	4 | ||||
|  #define ROOT_OFFSET	0xe0000 | ||||
|   | ||||
|  #define LOADER_MAGIC1	le32_to_cpu(0xfeedfa42) | ||||
|  #define LOADER_MAGIC2	le32_to_cpu(0xfeed1281) | ||||
| +#define LOADER_MAGIC3	le32_to_cpu(0x434d4d4c) | ||||
|   | ||||
|  struct ar7_bin_rec { | ||||
|  	unsigned int checksum; | ||||
| @@ -42,12 +45,16 @@ struct ar7_bin_rec { | ||||
|  	unsigned int address; | ||||
|  }; | ||||
|   | ||||
| +int create_titan_partitions(struct mtd_info *master, | ||||
| +        struct mtd_partition **pparts, | ||||
| +        struct mtd_part_parser_data *data); | ||||
| + | ||||
|  static int create_mtd_partitions(struct mtd_info *master, | ||||
|  				 struct mtd_partition **pparts, | ||||
|  				 struct mtd_part_parser_data *data) | ||||
|  { | ||||
|  	struct ar7_bin_rec header; | ||||
| -	unsigned int offset; | ||||
| +	unsigned int offset, mtd_start, mtd_end; | ||||
|  	size_t len; | ||||
|  	unsigned int pre_size = master->erasesize, post_size = 0; | ||||
|  	unsigned int root_offset = ROOT_OFFSET; | ||||
| @@ -55,6 +62,16 @@ static int create_mtd_partitions(struct | ||||
|  	int retries = 10; | ||||
|  	struct mtd_partition *ar7_parts; | ||||
|   | ||||
| +	const char *prom_str = prom_getenv("ProductID"); | ||||
| +	char mtd_name[] = "mtd1"; | ||||
| +	if(prom_str && | ||||
| +		(strcmp(prom_str, "CYWL")==0 || | ||||
| +		strcmp(prom_str, "CYWM")==0 || | ||||
| +		strcmp(prom_str, "CYLM")==0 || | ||||
| +		strcmp(prom_str, "CYLL")==0)){ | ||||
| +		return create_titan_partitions(master, pparts, data); | ||||
| +	} | ||||
| + | ||||
|  	ar7_parts = kzalloc(sizeof(*ar7_parts) * AR7_PARTS, GFP_KERNEL); | ||||
|  	if (!ar7_parts) | ||||
|  		return -ENOMEM; | ||||
| @@ -83,34 +100,39 @@ static int create_mtd_partitions(struct | ||||
|   | ||||
|  	pre_size = offset; | ||||
|   | ||||
| -	if (!ar7_parts[1].offset) { | ||||
| -		ar7_parts[1].offset = master->size - master->erasesize; | ||||
| -		post_size = master->erasesize; | ||||
| -	} | ||||
| - | ||||
|  	switch (header.checksum) { | ||||
| -	case LOADER_MAGIC1: | ||||
| -		while (header.length) { | ||||
| -			offset += sizeof(header) + header.length; | ||||
| -			mtd_read(master, offset, sizeof(header), &len, | ||||
| -				 (uint8_t *)&header); | ||||
| -		} | ||||
| -		root_offset = offset + sizeof(header) + 4; | ||||
| -		break; | ||||
|  	case LOADER_MAGIC2: | ||||
| +		for (retries = 0; retries <= 9; retries++) { | ||||
| +			mtd_name[3] = '0' + retries; | ||||
| +			prom_str = prom_getenv(mtd_name); | ||||
| +			if (prom_str == NULL) | ||||
| +				continue; | ||||
| +			sscanf(prom_str, "%i,%i", &mtd_start, &mtd_end); | ||||
| +			if (pre_size == (mtd_start & 0x1ffffff)) { | ||||
| +				ar7_parts[1].offset = mtd_end &= 0x1ffffff; | ||||
| +				ar7_parts[1].size = post_size = master->size - mtd_end; | ||||
| +				break; | ||||
| +			} | ||||
| +		} | ||||
| +	case LOADER_MAGIC1: | ||||
| +		root_offset = (header.checksum == LOADER_MAGIC1) ? 4 : 0; | ||||
|  		while (header.length) { | ||||
|  			offset += sizeof(header) + header.length; | ||||
|  			mtd_read(master, offset, sizeof(header), &len, | ||||
|  				 (uint8_t *)&header); | ||||
|  		} | ||||
| -		root_offset = offset + sizeof(header) + 4 + 0xff; | ||||
| -		root_offset &= ~(uint32_t)0xff; | ||||
| +		root_offset += offset + sizeof(header); | ||||
|  		break; | ||||
|  	default: | ||||
|  		printk(KERN_WARNING "Unknown magic: %08x\n", header.checksum); | ||||
|  		break; | ||||
|  	} | ||||
|   | ||||
| +	if (!ar7_parts[1].offset) { | ||||
| +		post_size = master->erasesize; | ||||
| +		ar7_parts[1].offset = master->size - post_size; | ||||
| +	} | ||||
| + | ||||
|  	mtd_read(master, root_offset, sizeof(header), &len, (u8 *)&header); | ||||
|  	if (header.checksum != SQUASHFS_MAGIC) { | ||||
|  		root_offset += master->erasesize - 1; | ||||
| --- a/drivers/mtd/titanpart.c | ||||
| +++ b/drivers/mtd/titanpart.c | ||||
| @@ -149,7 +149,7 @@ static void titan_add_partition(char * e | ||||
|  } | ||||
|  int create_titan_partitions(struct mtd_info *master, | ||||
|  	struct mtd_partition **pparts, | ||||
| -	unsigned long origin) | ||||
| +	struct mtd_part_parser_data *data) | ||||
|  { | ||||
|  	struct nsp_img_hdr_head		hdr; | ||||
|  	struct nsp_img_hdr_section_info	sect_info; | ||||
| @@ -1,95 +0,0 @@ | ||||
| --- a/arch/mips/ar7/platform.c | ||||
| +++ b/arch/mips/ar7/platform.c | ||||
| @@ -465,31 +465,22 @@ static struct gpio_led fb_fon_leds[] = { | ||||
|  	}, | ||||
|  }; | ||||
|   | ||||
| -static struct gpio_led gt701_leds[] = { | ||||
| +static struct gpio_led actiontec_leds[] = { | ||||
|  	{ | ||||
|  		.name			= "inet:green", | ||||
|  		.gpio			= 13, | ||||
| -		.active_low		= 1, | ||||
| -	}, | ||||
| -	{ | ||||
| -		.name			= "usb", | ||||
| -		.gpio			= 12, | ||||
| -		.active_low		= 1, | ||||
|  	}, | ||||
|  	{ | ||||
|  		.name			= "inet:red", | ||||
|  		.gpio			= 9, | ||||
| -		.active_low		= 1, | ||||
|  	}, | ||||
|  	{ | ||||
| -		.name			= "power:red", | ||||
| +		.name			= "power:green", | ||||
|  		.gpio			= 7, | ||||
| -		.active_low		= 1, | ||||
|  	}, | ||||
|  	{ | ||||
| -		.name			= "power:green", | ||||
| +		.name			= "power:red", | ||||
|  		.gpio			= 8, | ||||
| -		.active_low		= 1, | ||||
|  		.default_trigger	= "default-on", | ||||
|  	}, | ||||
|  	{ | ||||
| @@ -497,6 +488,44 @@ static struct gpio_led gt701_leds[] = { | ||||
|  		.gpio			= 10, | ||||
|  		.active_low		= 1, | ||||
|  	}, | ||||
| +	{ | ||||
| +		.name			= "wifi", | ||||
| +		.gpio			= 6, | ||||
| +		.active_low		= 1, | ||||
| +	}, | ||||
| +	{ | ||||
| +		.name			= "wifi:red", | ||||
| +		.gpio			= 3, | ||||
| +	}, | ||||
| +	{ | ||||
| +		.name			= "standby", | ||||
| +		.gpio			= 4, | ||||
| +	}, | ||||
| +	{ | ||||
| +		.name			= "wps", | ||||
| +		.gpio			= 16, | ||||
| +		.active_low		= 1, | ||||
| +	}, | ||||
| +	{ | ||||
| +		.name			= "usb", | ||||
| +		.gpio			= 12, | ||||
| +		.active_low		= 1, | ||||
| +	}, | ||||
| +	{ | ||||
| +		.name			= "voip", | ||||
| +		.gpio			= 15, | ||||
| +		.active_low		= 1, | ||||
| +        }, | ||||
| +        { | ||||
| +                .name			= "line1", | ||||
| +                .gpio			= 23, | ||||
| +                .active_low		= 1, | ||||
| +	}, | ||||
| +	{ | ||||
| +		.name			= "line2", | ||||
| +		.gpio			= 25, | ||||
| +		.active_low		= 1, | ||||
| +	}, | ||||
|  }; | ||||
|   | ||||
|  static struct gpio_led_platform_data ar7_led_data; | ||||
| @@ -540,9 +569,9 @@ static void __init detect_leds(void) | ||||
|  	} else if (strstr(prid, "CYWM") || strstr(prid, "CYWL")) { | ||||
|  		ar7_led_data.num_leds = ARRAY_SIZE(titan_leds); | ||||
|  		ar7_led_data.leds = titan_leds; | ||||
| -	} else if (strstr(prid, "GT701")) { | ||||
| -		ar7_led_data.num_leds = ARRAY_SIZE(gt701_leds); | ||||
| -		ar7_led_data.leds = gt701_leds; | ||||
| +	} else if (strstr(prid, "GT7") || strstr(prid, "PK5000")) { | ||||
| +		ar7_led_data.num_leds = ARRAY_SIZE(actiontec_leds); | ||||
| +		ar7_led_data.leds = actiontec_leds; | ||||
|  	} | ||||
|  } | ||||
|   | ||||
| @@ -1,52 +0,0 @@ | ||||
| --- a/drivers/net/ethernet/ti/cpmac.c | ||||
| +++ b/drivers/net/ethernet/ti/cpmac.c | ||||
| @@ -1147,6 +1147,8 @@ static int cpmac_probe(struct platform_d | ||||
|  		goto out; | ||||
|  	} | ||||
|   | ||||
| +	ar7_device_reset(pdata->reset_bit); | ||||
| + | ||||
|  	dev->irq = platform_get_irq_byname(pdev, "irq"); | ||||
|   | ||||
|  	dev->netdev_ops = &cpmac_netdev_ops; | ||||
| @@ -1228,7 +1230,7 @@ int cpmac_init(void) | ||||
|  	cpmac_mii->reset = cpmac_mdio_reset; | ||||
|  	cpmac_mii->irq = mii_irqs; | ||||
|   | ||||
| -	cpmac_mii->priv = ioremap(AR7_REGS_MDIO, 256); | ||||
| +	cpmac_mii->priv = ioremap(ar7_is_titan() ? TITAN_REGS_MDIO : AR7_REGS_MDIO, 256); | ||||
|   | ||||
|  	if (!cpmac_mii->priv) { | ||||
|  		pr_err("Can't ioremap mdio registers\n"); | ||||
| @@ -1239,10 +1241,16 @@ int cpmac_init(void) | ||||
|  	/* FIXME: unhardcode gpio&reset bits */ | ||||
|  	ar7_gpio_disable(26); | ||||
|  	ar7_gpio_disable(27); | ||||
| -	ar7_device_reset(AR7_RESET_BIT_CPMAC_LO); | ||||
| -	ar7_device_reset(AR7_RESET_BIT_CPMAC_HI); | ||||
| + | ||||
| +	if (!ar7_is_titan()) { | ||||
| +		ar7_device_reset(AR7_RESET_BIT_CPMAC_LO); | ||||
| +		ar7_device_reset(AR7_RESET_BIT_CPMAC_HI); | ||||
| +	} | ||||
|  	ar7_device_reset(AR7_RESET_BIT_EPHY); | ||||
|   | ||||
| +	if (ar7_is_titan()) | ||||
| +		ar7_device_reset(TITAN_RESET_BIT_EPHY1); | ||||
| + | ||||
|  	cpmac_mii->reset(cpmac_mii); | ||||
|   | ||||
|  	for (i = 0; i < 300; i++) { | ||||
| @@ -1259,7 +1267,11 @@ int cpmac_init(void) | ||||
|  		mask = 0; | ||||
|  	} | ||||
|   | ||||
| -	cpmac_mii->phy_mask = ~(mask | 0x80000000); | ||||
| +	if (ar7_is_titan()) | ||||
| +		cpmac_mii->phy_mask = ~(mask | 0x80000000 | 0x40000000); | ||||
| +	else | ||||
| +		cpmac_mii->phy_mask = ~(mask | 0x80000000); | ||||
| + | ||||
|  	snprintf(cpmac_mii->id, MII_BUS_ID_SIZE, "cpmac-1"); | ||||
|   | ||||
|  	res = mdiobus_register(cpmac_mii); | ||||
| @@ -1,23 +0,0 @@ | ||||
| From: Felix Fietkau <nbd@nbd.name> | ||||
| Date: Wed, 18 May 2016 18:03:31 +0200 | ||||
| Subject: [PATCH] MIPS: ath79: fix register address in ath79_ddr_wb_flush() | ||||
|  | ||||
| ath79_ddr_wb_flush_base has the type void __iomem *, so register offsets | ||||
| need to be a multiple of 4. | ||||
|  | ||||
| Cc: Alban Bedel <albeu@free.fr> | ||||
| Fixes: 24b0e3e84fbf ("MIPS: ath79: Improve the DDR controller interface") | ||||
| Signed-off-by: Felix Fietkau <nbd@nbd.name> | ||||
| --- | ||||
|  | ||||
| --- a/arch/mips/ath79/common.c | ||||
| +++ b/arch/mips/ath79/common.c | ||||
| @@ -58,7 +58,7 @@ EXPORT_SYMBOL_GPL(ath79_ddr_ctrl_init); | ||||
|   | ||||
|  void ath79_ddr_wb_flush(u32 reg) | ||||
|  { | ||||
| -	void __iomem *flush_reg = ath79_ddr_wb_flush_base + reg; | ||||
| +	void __iomem *flush_reg = ath79_ddr_wb_flush_base + reg * 4; | ||||
|   | ||||
|  	/* Flush the DDR write buffer. */ | ||||
|  	__raw_writel(0x1, flush_reg); | ||||
| @@ -1,69 +0,0 @@ | ||||
| --- a/drivers/mtd/chips/cfi_cmdset_0002.c | ||||
| +++ b/drivers/mtd/chips/cfi_cmdset_0002.c | ||||
| @@ -1631,8 +1631,8 @@ static int __xipram do_write_oneword(str | ||||
|  			break; | ||||
|  		} | ||||
|   | ||||
| -		if (chip_ready(map, adr)) | ||||
| -			break; | ||||
| +		if (chip_good(map, adr, datum)) | ||||
| +			goto enable_xip; | ||||
|   | ||||
|  		/* Latency issues. Drop the lock, wait a while and retry */ | ||||
|  		UDELAY(map, chip, adr, 1); | ||||
| @@ -1648,6 +1648,8 @@ static int __xipram do_write_oneword(str | ||||
|   | ||||
|  		ret = -EIO; | ||||
|  	} | ||||
| + | ||||
| + enable_xip: | ||||
|  	xip_enable(map, chip, adr); | ||||
|   op_done: | ||||
|  	if (mode == FL_OTP_WRITE) | ||||
| @@ -2226,7 +2228,6 @@ static int cfi_amdstd_panic_write(struct | ||||
|  	return 0; | ||||
|  } | ||||
|   | ||||
| - | ||||
|  /* | ||||
|   * Handle devices with one erase region, that only implement | ||||
|   * the chip erase command. | ||||
| @@ -2291,8 +2292,8 @@ static int __xipram do_erase_chip(struct | ||||
|  			chip->erase_suspended = 0; | ||||
|  		} | ||||
|   | ||||
| -		if (chip_ready(map, adr)) | ||||
| -			break; | ||||
| +		if (chip_good(map, adr, map_word_ff(map))) | ||||
| +			goto op_done; | ||||
|   | ||||
|  		if (time_after(jiffies, timeo)) { | ||||
|  			printk(KERN_WARNING "MTD %s(): software timeout\n", | ||||
| @@ -2312,6 +2313,7 @@ static int __xipram do_erase_chip(struct | ||||
|  		ret = -EIO; | ||||
|  	} | ||||
|   | ||||
| + op_done: | ||||
|  	chip->state = FL_READY; | ||||
|  	xip_enable(map, chip, adr); | ||||
|  	DISABLE_VPP(map); | ||||
| @@ -2381,9 +2383,9 @@ static int __xipram do_erase_oneblock(st | ||||
|  			chip->erase_suspended = 0; | ||||
|  		} | ||||
|   | ||||
| -		if (chip_ready(map, adr)) { | ||||
| +		if (chip_good(map, adr, map_word_ff(map))) { | ||||
|  			xip_enable(map, chip, adr); | ||||
| -			break; | ||||
| +			goto op_done; | ||||
|  		} | ||||
|   | ||||
|  		if (time_after(jiffies, timeo)) { | ||||
| @@ -2405,6 +2407,7 @@ static int __xipram do_erase_oneblock(st | ||||
|  		ret = -EIO; | ||||
|  	} | ||||
|   | ||||
| + op_done: | ||||
|  	chip->state = FL_READY; | ||||
|  	DISABLE_VPP(map); | ||||
|  	put_chip(map, chip, adr); | ||||
| @@ -1,6 +1,6 @@ | ||||
| --- a/drivers/mtd/devices/m25p80.c | ||||
| +++ b/drivers/mtd/devices/m25p80.c | ||||
| @@ -194,6 +194,7 @@ static ssize_t m25p80_read(struct spi_no | ||||
| @@ -195,6 +195,7 @@ static ssize_t m25p80_read(struct spi_no | ||||
|   */ | ||||
|  static int m25p_probe(struct spi_device *spi) | ||||
|  { | ||||
| @@ -8,7 +8,7 @@ | ||||
|  	struct flash_platform_data	*data; | ||||
|  	struct m25p *flash; | ||||
|  	struct spi_nor *nor; | ||||
| @@ -246,8 +247,11 @@ static int m25p_probe(struct spi_device | ||||
| @@ -247,8 +248,11 @@ static int m25p_probe(struct spi_device | ||||
|  	if (ret) | ||||
|  		return ret; | ||||
|   | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
| -#define FORCE_WORD_WRITE 0 | ||||
| +#define FORCE_WORD_WRITE 1 | ||||
|   | ||||
|  #define MAX_WORD_RETRIES 3 | ||||
|  #define MAX_RETRIES 3 | ||||
|   | ||||
| @@ -51,7 +51,9 @@ | ||||
|   | ||||
| @@ -35,7 +35,7 @@ | ||||
|   | ||||
|  /* Atmel chips don't use the same PRI format as AMD chips */ | ||||
|  static void fixup_convert_atmel_pri(struct mtd_info *mtd) | ||||
| @@ -1790,6 +1794,7 @@ static int cfi_amdstd_write_words(struct | ||||
| @@ -1788,6 +1792,7 @@ static int cfi_amdstd_write_words(struct | ||||
|  /* | ||||
|   * FIXME: interleaved mode not tested, and probably not supported! | ||||
|   */ | ||||
| @@ -43,7 +43,7 @@ | ||||
|  static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, | ||||
|  				    unsigned long adr, const u_char *buf, | ||||
|  				    int len) | ||||
| @@ -1918,7 +1923,6 @@ static int __xipram do_write_buffer(stru | ||||
| @@ -1916,7 +1921,6 @@ static int __xipram do_write_buffer(stru | ||||
|  	return ret; | ||||
|  } | ||||
|   | ||||
| @@ -51,7 +51,7 @@ | ||||
|  static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len, | ||||
|  				    size_t *retlen, const u_char *buf) | ||||
|  { | ||||
| @@ -1993,6 +1997,7 @@ static int cfi_amdstd_write_buffers(stru | ||||
| @@ -1991,6 +1995,7 @@ static int cfi_amdstd_write_buffers(stru | ||||
|   | ||||
|  	return 0; | ||||
|  } | ||||
|   | ||||
| @@ -16,7 +16,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | ||||
|  #endif /* _PHY_AT803X_PDATA_H */ | ||||
| --- a/drivers/net/phy/at803x.c | ||||
| +++ b/drivers/net/phy/at803x.c | ||||
| @@ -263,6 +263,7 @@ static int at803x_resume(struct phy_devi | ||||
| @@ -261,6 +261,7 @@ static int at803x_resume(struct phy_devi | ||||
|   | ||||
|  static int at803x_probe(struct phy_device *phydev) | ||||
|  { | ||||
| @@ -24,8 +24,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | ||||
|  	struct device *dev = &phydev->mdio.dev; | ||||
|  	struct at803x_priv *priv; | ||||
|  	struct gpio_desc *gpiod_reset; | ||||
| @@ -274,6 +275,12 @@ static int at803x_probe(struct phy_devic | ||||
|  	if (phydev->drv->phy_id != ATH8030_PHY_ID) | ||||
| @@ -273,6 +274,12 @@ static int at803x_probe(struct phy_devic | ||||
|  	    phydev->drv->phy_id != ATH8032_PHY_ID) | ||||
|  		goto does_not_require_reset_workaround; | ||||
|   | ||||
| +	pdata = dev_get_platdata(dev); | ||||
| @@ -37,7 +37,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | ||||
|  	gpiod_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); | ||||
|  	if (IS_ERR(gpiod_reset)) | ||||
|  		return PTR_ERR(gpiod_reset); | ||||
| @@ -405,15 +412,23 @@ static void at803x_link_change_notify(st | ||||
| @@ -404,15 +411,23 @@ static void at803x_link_change_notify(st | ||||
|  	 * cannot recover from by software. | ||||
|  	 */ | ||||
|  	if (phydev->state == PHY_NOLINK) { | ||||
|   | ||||
| @@ -250,7 +250,7 @@ | ||||
|  					       &sin->sin6_addr); | ||||
|  			sin->sin6_scope_id = 0; | ||||
|  		} | ||||
| @@ -814,12 +814,12 @@ int ip6_datagram_send_ctl(struct net *ne | ||||
| @@ -817,12 +817,12 @@ int ip6_datagram_send_ctl(struct net *ne | ||||
|  			} | ||||
|   | ||||
|  			if (fl6->flowlabel&IPV6_FLOWINFO_MASK) { | ||||
| @@ -327,7 +327,7 @@ | ||||
|  	return neigh_create(&arp_tbl, pkey, dev); | ||||
| --- a/net/ipv4/tcp_output.c | ||||
| +++ b/net/ipv4/tcp_output.c | ||||
| @@ -448,48 +448,53 @@ static void tcp_options_write(__be32 *pt | ||||
| @@ -453,48 +453,53 @@ static void tcp_options_write(__be32 *pt | ||||
|  	u16 options = opts->options;	/* mungable copy */ | ||||
|   | ||||
|  	if (unlikely(OPTION_MD5 & options)) { | ||||
| @@ -404,7 +404,7 @@ | ||||
|  	} | ||||
|   | ||||
|  	if (unlikely(opts->num_sack_blocks)) { | ||||
| @@ -497,16 +502,17 @@ static void tcp_options_write(__be32 *pt | ||||
| @@ -502,16 +507,17 @@ static void tcp_options_write(__be32 *pt | ||||
|  			tp->duplicate_sack : tp->selective_acks; | ||||
|  		int this_sack; | ||||
|   | ||||
| @@ -428,7 +428,7 @@ | ||||
|  		} | ||||
|   | ||||
|  		tp->rx_opt.dsack = 0; | ||||
| @@ -519,13 +525,14 @@ static void tcp_options_write(__be32 *pt | ||||
| @@ -524,13 +530,14 @@ static void tcp_options_write(__be32 *pt | ||||
|   | ||||
|  		if (foc->exp) { | ||||
|  			len = TCPOLEN_EXP_FASTOPEN_BASE + foc->len; | ||||
| @@ -795,7 +795,7 @@ | ||||
|   | ||||
| --- a/net/ipv4/tcp_input.c | ||||
| +++ b/net/ipv4/tcp_input.c | ||||
| @@ -3896,14 +3896,16 @@ static bool tcp_parse_aligned_timestamp( | ||||
| @@ -3910,14 +3910,16 @@ static bool tcp_parse_aligned_timestamp( | ||||
|  { | ||||
|  	const __be32 *ptr = (const __be32 *)(th + 1); | ||||
|   | ||||
|   | ||||
| @@ -42,6 +42,7 @@ CONFIG_ARM64_PAN=y | ||||
| # CONFIG_ARM64_PTDUMP is not set | ||||
| # CONFIG_ARM64_PTDUMP_DEBUGFS is not set | ||||
| # CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET is not set | ||||
| CONFIG_ARM64_SSBD=y | ||||
| # CONFIG_ARM64_SW_TTBR0_PAN is not set | ||||
| CONFIG_ARM64_UAO=y | ||||
| CONFIG_ARM64_VA_BITS=39 | ||||
|   | ||||
| @@ -115,7 +115,7 @@ define Device/at91-q5xr5 | ||||
|   DEVICE_TITLE := Exegin Q5XR5 | ||||
|   KERNEL_SIZE := 2048k | ||||
| endef | ||||
| TARGET_DEVICES += at91-q5xr5 | ||||
| #TARGET_DEVICES += at91-q5xr5 | ||||
|  | ||||
| define Device/wb45n | ||||
|   $(Device/evaluation-fit) | ||||
|   | ||||
| @@ -82,13 +82,13 @@ define Device/ubnt2 | ||||
|   DEVICE_TITLE := Ubiquiti XS2 | ||||
|   IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | mkfwimage XS2 -v XS2.ar2316 | ||||
| endef | ||||
| TARGET_DEVICES += ubnt2 | ||||
| #TARGET_DEVICES += ubnt2 | ||||
|  | ||||
| define Device/ubnt5 | ||||
|   DEVICE_TITLE := Ubiquiti XS5 | ||||
|   IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | mkfwimage XS5 -v XS5.ar2313 | ||||
| endef | ||||
| TARGET_DEVICES += ubnt5 | ||||
| #TARGET_DEVICES += ubnt5 | ||||
|  | ||||
| define Device/np25g | ||||
|   DEVICE_TITLE := np25g | ||||
|   | ||||
| @@ -327,7 +327,7 @@ platform_do_upgrade() { | ||||
| 	case "$file_type" in | ||||
| 		"chk")		cmd=$(platform_trx_from_chk_cmd "$trx");; | ||||
| 		"cybertan")	cmd=$(platform_trx_from_cybertan_cmd "$trx");; | ||||
| 		"safeloader")	trx=$(platform_img_from_safeloader "$trx");; | ||||
| 		"safeloader")	trx=$(platform_img_from_safeloader "$trx"); PART_NAME=os-image;; | ||||
| 		"seama")	trx=$(platform_img_from_seama "$trx");; | ||||
| 	esac | ||||
|  | ||||
|   | ||||
| @@ -227,9 +227,11 @@ CONFIG_LIBFDT=y | ||||
| CONFIG_LOCK_SPIN_ON_OWNER=y | ||||
| CONFIG_LZO_COMPRESS=y | ||||
| CONFIG_LZO_DECOMPRESS=y | ||||
| # CONFIG_MDIO_BCM_IPROC is not set | ||||
| CONFIG_MDIO_BCM_IPROC=y | ||||
| CONFIG_MDIO_BUS=y | ||||
| CONFIG_MDIO_BUS_MUX=y | ||||
| # CONFIG_MDIO_BUS_MUX_BCM_IPROC is not set | ||||
| CONFIG_MDIO_BUS_MUX_MMIOREG=y | ||||
| CONFIG_MDIO_DEVICE=y | ||||
| CONFIG_MFD_SYSCON=y | ||||
| CONFIG_MIGHT_HAVE_CACHE_L2X0=y | ||||
|   | ||||
| @@ -0,0 +1,24 @@ | ||||
| From a0a8338e905734518ab9b10b06e7fd0201228f8b Mon Sep 17 00:00:00 2001 | ||||
| From: Florian Fainelli <f.fainelli@gmail.com> | ||||
| Date: Mon, 11 Jun 2018 15:53:40 -0700 | ||||
| Subject: [PATCH] ARM: dts: BCM5301x: Fix i2c controller interrupt type | ||||
|  | ||||
| The i2c controller should be using IRQ_TYPE_LEVEL_HIGH, fix that. | ||||
|  | ||||
| Fixes: bb097e3e0045 ("ARM: dts: BCM5301X: Add I2C support to the DT") | ||||
| Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> | ||||
| --- | ||||
|  arch/arm/boot/dts/bcm5301x.dtsi | 2 +- | ||||
|  1 file changed, 1 insertion(+), 1 deletion(-) | ||||
|  | ||||
| --- a/arch/arm/boot/dts/bcm5301x.dtsi | ||||
| +++ b/arch/arm/boot/dts/bcm5301x.dtsi | ||||
| @@ -365,7 +365,7 @@ | ||||
|  	i2c0: i2c@18009000 { | ||||
|  		compatible = "brcm,iproc-i2c"; | ||||
|  		reg = <0x18009000 0x50>; | ||||
| -		interrupts = <GIC_SPI 121 IRQ_TYPE_NONE>; | ||||
| +		interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>; | ||||
|  		#address-cells = <1>; | ||||
|  		#size-cells = <0>; | ||||
|  		clock-frequency = <100000>; | ||||
| @@ -0,0 +1,456 @@ | ||||
| From 37f6130ec39fe14e923d472746a51e6f06f761b7 Mon Sep 17 00:00:00 2001 | ||||
| From: Vivek Unune <npcomplete13@gmail.com> | ||||
| Date: Mon, 9 Apr 2018 18:31:53 -0400 | ||||
| Subject: [PATCH] ARM: dts: BCM5301X: Make USB 3.0 PHY use MDIO PHY driver | ||||
| MIME-Version: 1.0 | ||||
| Content-Type: text/plain; charset=UTF-8 | ||||
| Content-Transfer-Encoding: 8bit | ||||
|  | ||||
| Currently, the USB 3.0 PHY in bcm5301x.dtsi uses platform driver which | ||||
| requires register range "ccb-mii" <0x18003000 0x1000>. This range | ||||
| overlaps with MDIO cmd and param registers (<0x18003000 0x8>). | ||||
| Essentially, the platform driver partly acts like a MDIO bus driver, | ||||
| hence to use of this register range. | ||||
|  | ||||
| In some Northstar devices like Linksys EA9500, secondary switch is | ||||
| connected via external MDIO. The only way to access and configure the | ||||
| external switch is via MDIO bus. When we enable the MDIO bus in it's | ||||
| current state, the MDIO bus and any child buses fail to register because | ||||
| of the register range overlap. | ||||
|  | ||||
| On Northstar, the USB 3.0 PHY is connected at address 0x10 on the | ||||
| internal MDIO bus. This change moves the usb3_phy node and makes it a | ||||
| child node of internal MDIO bus. | ||||
|  | ||||
| Thanks to Rafał Miłecki's commit af850e14a7ae ("phy: bcm-ns-usb3: add | ||||
| MDIO driver using proper bus layer") the same USB 3.0 platform driver | ||||
| can now act as USB 3.0 PHY MDIO driver. | ||||
|  | ||||
| Tested on Linksys Panamera (EA9500) | ||||
|  | ||||
| Signed-off-by: Vivek Unune <npcomplete13@gmail.com> | ||||
| Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> | ||||
| --- | ||||
|  arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts        |  4 +++ | ||||
|  arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts        |  4 +++ | ||||
|  arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts  |  4 +++ | ||||
|  arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts    |  4 +++ | ||||
|  arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts       |  4 +++ | ||||
|  arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts       |  4 +++ | ||||
|  arch/arm/boot/dts/bcm4708-netgear-r6250.dts        |  4 +++ | ||||
|  arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts     |  4 +++ | ||||
|  arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts      |  4 +++ | ||||
|  arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts        |  4 +++ | ||||
|  arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts |  4 +++ | ||||
|  arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts  |  4 +++ | ||||
|  arch/arm/boot/dts/bcm47081-luxul-xap-1410.dts      |  4 +++ | ||||
|  arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts      |  4 +++ | ||||
|  arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts |  4 +++ | ||||
|  arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts        |  4 +++ | ||||
|  arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts  |  4 +++ | ||||
|  arch/arm/boot/dts/bcm4709-linksys-ea9200.dts       |  4 +++ | ||||
|  arch/arm/boot/dts/bcm4709-netgear-r7000.dts        |  4 +++ | ||||
|  arch/arm/boot/dts/bcm4709-netgear-r8000.dts        |  4 +++ | ||||
|  arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts  |  4 +++ | ||||
|  arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts      |  4 +++ | ||||
|  arch/arm/boot/dts/bcm47094-linksys-panamera.dts    |  4 +++ | ||||
|  arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts      |  4 +++ | ||||
|  arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts      |  4 +++ | ||||
|  arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts      |  4 +++ | ||||
|  arch/arm/boot/dts/bcm47094-netgear-r8500.dts       |  4 +++ | ||||
|  arch/arm/boot/dts/bcm47094.dtsi                    |  7 +++-- | ||||
|  arch/arm/boot/dts/bcm5301x.dtsi                    | 35 +++++++++++++++++----- | ||||
|  arch/arm/boot/dts/bcm94708.dts                     |  4 +++ | ||||
|  arch/arm/boot/dts/bcm94709.dts                     |  4 +++ | ||||
|  arch/arm/boot/dts/bcm953012er.dts                  |  4 +++ | ||||
|  arch/arm/boot/dts/bcm953012hr.dts                  |  4 +++ | ||||
|  arch/arm/boot/dts/bcm953012k.dts                   |  4 +++ | ||||
|  34 files changed, 159 insertions(+), 11 deletions(-) | ||||
|  | ||||
| --- a/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts | ||||
| +++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts | ||||
| @@ -90,3 +90,7 @@ | ||||
|  		}; | ||||
|  	}; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts | ||||
| +++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts | ||||
| @@ -80,3 +80,7 @@ | ||||
|  		}; | ||||
|  	}; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts | ||||
| +++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts | ||||
| @@ -146,3 +146,7 @@ | ||||
|  &spi_nor { | ||||
|  	status = "okay"; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts | ||||
| +++ b/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts | ||||
| @@ -38,3 +38,7 @@ | ||||
|  		}; | ||||
|  	}; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts | ||||
| +++ b/arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts | ||||
| @@ -57,3 +57,7 @@ | ||||
|  &spi_nor { | ||||
|  	status = "okay"; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts | ||||
| +++ b/arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts | ||||
| @@ -64,3 +64,7 @@ | ||||
|  &spi_nor { | ||||
|  	status = "okay"; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm4708-netgear-r6250.dts | ||||
| +++ b/arch/arm/boot/dts/bcm4708-netgear-r6250.dts | ||||
| @@ -91,3 +91,7 @@ | ||||
|  &spi_nor { | ||||
|  	status = "okay"; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts | ||||
| +++ b/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts | ||||
| @@ -83,3 +83,7 @@ | ||||
|  &spi_nor { | ||||
|  	status = "okay"; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts | ||||
| +++ b/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts | ||||
| @@ -158,3 +158,7 @@ | ||||
|  		}; | ||||
|  	}; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts | ||||
| +++ b/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts | ||||
| @@ -74,3 +74,7 @@ | ||||
|  		}; | ||||
|  	}; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts | ||||
| +++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts | ||||
| @@ -118,3 +118,7 @@ | ||||
|  		}; | ||||
|  	}; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts | ||||
| +++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts | ||||
| @@ -104,3 +104,7 @@ | ||||
|  		}; | ||||
|  	}; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm47081-luxul-xap-1410.dts | ||||
| +++ b/arch/arm/boot/dts/bcm47081-luxul-xap-1410.dts | ||||
| @@ -57,3 +57,7 @@ | ||||
|  &spi_nor { | ||||
|  	status = "okay"; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts | ||||
| +++ b/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts | ||||
| @@ -105,3 +105,7 @@ | ||||
|  &spi_nor { | ||||
|  	status = "okay"; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts | ||||
| +++ b/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts | ||||
| @@ -99,3 +99,7 @@ | ||||
|  &usb2 { | ||||
|  	vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts | ||||
| +++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts | ||||
| @@ -62,3 +62,7 @@ | ||||
|  		}; | ||||
|  	}; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts | ||||
| +++ b/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts | ||||
| @@ -127,3 +127,7 @@ | ||||
|  &spi_nor { | ||||
|  	status = "okay"; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts | ||||
| +++ b/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts | ||||
| @@ -39,3 +39,7 @@ | ||||
|  		}; | ||||
|  	}; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm4709-netgear-r7000.dts | ||||
| +++ b/arch/arm/boot/dts/bcm4709-netgear-r7000.dts | ||||
| @@ -101,3 +101,7 @@ | ||||
|  &usb3 { | ||||
|  	vcc-gpio = <&chipcommon 0 GPIO_ACTIVE_HIGH>; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm4709-netgear-r8000.dts | ||||
| +++ b/arch/arm/boot/dts/bcm4709-netgear-r8000.dts | ||||
| @@ -182,3 +182,7 @@ | ||||
|  &usb3 { | ||||
|  	vcc-gpio = <&chipcommon 0 GPIO_ACTIVE_HIGH>; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts | ||||
| +++ b/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts | ||||
| @@ -104,3 +104,7 @@ | ||||
|  &spi_nor { | ||||
|  	status = "okay"; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts | ||||
| +++ b/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts | ||||
| @@ -115,3 +115,7 @@ | ||||
|  &spi_nor { | ||||
|  	status = "okay"; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm47094-linksys-panamera.dts | ||||
| +++ b/arch/arm/boot/dts/bcm47094-linksys-panamera.dts | ||||
| @@ -33,3 +33,7 @@ | ||||
|  		}; | ||||
|  	}; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts | ||||
| +++ b/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts | ||||
| @@ -60,3 +60,7 @@ | ||||
|  &spi_nor { | ||||
|  	status = "okay"; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts | ||||
| +++ b/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts | ||||
| @@ -60,3 +60,7 @@ | ||||
|  &spi_nor { | ||||
|  	status = "okay"; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts | ||||
| +++ b/arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts | ||||
| @@ -100,3 +100,7 @@ | ||||
|  &spi_nor { | ||||
|  	status = "okay"; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm47094-netgear-r8500.dts | ||||
| +++ b/arch/arm/boot/dts/bcm47094-netgear-r8500.dts | ||||
| @@ -91,3 +91,7 @@ | ||||
|  		}; | ||||
|  	}; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm47094.dtsi | ||||
| +++ b/arch/arm/boot/dts/bcm47094.dtsi | ||||
| @@ -7,9 +7,10 @@ | ||||
|  #include "bcm4708.dtsi" | ||||
|   | ||||
|  / { | ||||
| -	usb3_phy: usb3-phy { | ||||
| -		compatible = "brcm,ns-bx-usb3-phy"; | ||||
| -	}; | ||||
| +}; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	compatible = "brcm,ns-bx-usb3-phy"; | ||||
|  }; | ||||
|   | ||||
|  &uart0 { | ||||
| --- a/arch/arm/boot/dts/bcm5301x.dtsi | ||||
| +++ b/arch/arm/boot/dts/bcm5301x.dtsi | ||||
| @@ -154,13 +154,6 @@ | ||||
|  		clock-names = "phy-ref-clk"; | ||||
|  	}; | ||||
|   | ||||
| -	usb3_phy: usb3-phy { | ||||
| -		compatible = "brcm,ns-ax-usb3-phy"; | ||||
| -		reg = <0x18105000 0x1000>, <0x18003000 0x1000>; | ||||
| -		reg-names = "dmp", "ccb-mii"; | ||||
| -		#phy-cells = <0>; | ||||
| -	}; | ||||
| - | ||||
|  	axi@18000000 { | ||||
|  		compatible = "brcm,bus-axi"; | ||||
|  		reg = <0x18000000 0x1000>; | ||||
| @@ -359,7 +352,33 @@ | ||||
|  		reg = <0x18003000 0x8>; | ||||
|  		#size-cells = <1>; | ||||
|  		#address-cells = <0>; | ||||
| -		status = "disabled"; | ||||
| +	}; | ||||
| + | ||||
| +	mdio-bus-mux { | ||||
| +		compatible = "mdio-mux-mmioreg"; | ||||
| +		mdio-parent-bus = <&mdio>; | ||||
| +		#address-cells = <1>; | ||||
| +		#size-cells = <0>; | ||||
| +		reg = <0x18003000 0x4>; | ||||
| +		mux-mask = <0x200>; | ||||
| + | ||||
| +		mdio@0 { | ||||
| +			reg = <0x0>; | ||||
| +			#address-cells = <1>; | ||||
| +			#size-cells = <0>; | ||||
| + | ||||
| +			usb3_phy: usb3-phy@10 { | ||||
| +				compatible = "brcm,ns-ax-usb3-phy"; | ||||
| +				reg = <0x10>; | ||||
| +				usb3-dmp-syscon = <&usb3_dmp>; | ||||
| +				#phy-cells = <0>; | ||||
| +				status = "disabled"; | ||||
| +			}; | ||||
| +		}; | ||||
| +	}; | ||||
| + | ||||
| +	usb3_dmp: syscon@18105000 { | ||||
| +		reg = <0x18105000 0x1000>; | ||||
|  	}; | ||||
|   | ||||
|  	i2c0: i2c@18009000 { | ||||
| --- a/arch/arm/boot/dts/bcm94708.dts | ||||
| +++ b/arch/arm/boot/dts/bcm94708.dts | ||||
| @@ -42,3 +42,7 @@ | ||||
|  		reg = <0x00000000 0x08000000>; | ||||
|  	}; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm94709.dts | ||||
| +++ b/arch/arm/boot/dts/bcm94709.dts | ||||
| @@ -42,3 +42,7 @@ | ||||
|  		reg = <0x00000000 0x08000000>; | ||||
|  	}; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm953012er.dts | ||||
| +++ b/arch/arm/boot/dts/bcm953012er.dts | ||||
| @@ -90,3 +90,7 @@ | ||||
|  		}; | ||||
|  	}; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm953012hr.dts | ||||
| +++ b/arch/arm/boot/dts/bcm953012hr.dts | ||||
| @@ -95,3 +95,7 @@ | ||||
|  		reg = <0x00700000 0x00900000>; | ||||
|  	}; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm953012k.dts | ||||
| +++ b/arch/arm/boot/dts/bcm953012k.dts | ||||
| @@ -113,3 +113,7 @@ | ||||
|  &uart1 { | ||||
|  	status = "okay"; | ||||
|  }; | ||||
| + | ||||
| +&usb3_phy { | ||||
| +	status = "okay"; | ||||
| +}; | ||||
| @@ -0,0 +1,34 @@ | ||||
| From a21e7548438f3a8f59f9b9f3a8bc973613d3726a Mon Sep 17 00:00:00 2001 | ||||
| From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl> | ||||
| Date: Thu, 14 Jun 2018 18:41:47 +0200 | ||||
| Subject: [PATCH] ARM: dts: BCM53573: Add architected timer | ||||
| MIME-Version: 1.0 | ||||
| Content-Type: text/plain; charset=UTF-8 | ||||
| Content-Transfer-Encoding: 8bit | ||||
|  | ||||
| It's a standard ARM architected timer that was simply missed when | ||||
| initially adding this .dtsi file. | ||||
|  | ||||
| Signed-off-by: Rafał Miłecki <rafal@milecki.pl> | ||||
| Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> | ||||
| --- | ||||
|  arch/arm/boot/dts/bcm53573.dtsi | 8 ++++++++ | ||||
|  1 file changed, 8 insertions(+) | ||||
|  | ||||
| --- a/arch/arm/boot/dts/bcm53573.dtsi | ||||
| +++ b/arch/arm/boot/dts/bcm53573.dtsi | ||||
| @@ -48,6 +48,14 @@ | ||||
|  		}; | ||||
|  	}; | ||||
|   | ||||
| +	timer { | ||||
| +		compatible = "arm,armv7-timer"; | ||||
| +		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>, | ||||
| +			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>, | ||||
| +			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>, | ||||
| +			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>; | ||||
| +	}; | ||||
| + | ||||
|  	clocks { | ||||
|  		#address-cells = <1>; | ||||
|  		#size-cells = <1>; | ||||
| @@ -0,0 +1,269 @@ | ||||
| From 2bebdfcdcd0feb58d5df419532a2cedc78a336d7 Mon Sep 17 00:00:00 2001 | ||||
| From: Vivek Unune <npcomplete13@gmail.com> | ||||
| Date: Mon, 18 Jun 2018 13:41:59 -0400 | ||||
| Subject: [PATCH] ARM: dts: BCM5301X: Add support for Linksys EA9500 | ||||
| MIME-Version: 1.0 | ||||
| Content-Type: text/plain; charset=UTF-8 | ||||
| Content-Transfer-Encoding: 8bit | ||||
|  | ||||
| Hardware Info | ||||
| ------------- | ||||
|  | ||||
| Processor	- Broadcom BCM4709C0KFEBG dual-core @ 1.4 GHz | ||||
| Switch		- BCM53012 in BCM4709C0KFEBG & external BCM53125 | ||||
| DDR3 RAM	- 256 MB | ||||
| Flash		- 128 MB (Toshiba TC58BVG0S3HTA00) | ||||
| 2.4GHz		- BCM4366 4×4 2.4/5G single chip 802.11ac SoC | ||||
| Power Amp	- Skyworks SE2623L 2.4 GHz power amp (x4) | ||||
| 5GHz x 2	- BCM4366 4×4 2.4/5G single chip 802.11ac SoC | ||||
| Power Amp	- PLX Technology PEX8603 3-lane, 3-port PCIe switch | ||||
| Ports		- 8 Ports, 1 WAN Ports | ||||
| Antennas	- 8 Antennas | ||||
| Serial Port	- @J6 [GND,TX,RX] (VCC NC)    115200 8n1 | ||||
|  | ||||
| Tested with OpenWrt built with DSA driver and Kernel v4.14 | ||||
|  | ||||
| Signed-off-by: Vivek Unune <npcomplete13@gmail.com> | ||||
| Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> | ||||
| --- | ||||
|  arch/arm/boot/dts/bcm47094-linksys-panamera.dts | 229 ++++++++++++++++++++++++ | ||||
|  1 file changed, 229 insertions(+) | ||||
|  | ||||
| --- a/arch/arm/boot/dts/bcm47094-linksys-panamera.dts | ||||
| +++ b/arch/arm/boot/dts/bcm47094-linksys-panamera.dts | ||||
| @@ -31,6 +31,235 @@ | ||||
|  			linux,code = <KEY_WPS_BUTTON>; | ||||
|  			gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>; | ||||
|  		}; | ||||
| + | ||||
| +		rfkill { | ||||
| +				label = "WiFi"; | ||||
| +				linux,code = <KEY_RFKILL>; | ||||
| +				gpios = <&chipcommon 16 GPIO_ACTIVE_LOW>; | ||||
| +		}; | ||||
| + | ||||
| +		reset { | ||||
| +				label = "Reset"; | ||||
| +				linux,code = <KEY_RESTART>; | ||||
| +				gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; | ||||
| +		}; | ||||
| +	}; | ||||
| + | ||||
| +	leds { | ||||
| +		compatible = "gpio-leds"; | ||||
| + | ||||
| +		wps { | ||||
| +			label = "bcm53xx:white:wps"; | ||||
| +			gpios = <&chipcommon 22 GPIO_ACTIVE_LOW>; | ||||
| +		}; | ||||
| + | ||||
| +		usb2 { | ||||
| +			label = "bcm53xx:green:usb2"; | ||||
| +			gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>; | ||||
| +			trigger-sources = <&ohci_port2>, <&ehci_port2>; | ||||
| +			linux,default-trigger = "usbport"; | ||||
| +		}; | ||||
| + | ||||
| +		usb3 { | ||||
| +			label = "bcm53xx:green:usb3"; | ||||
| +			gpios = <&chipcommon 2 GPIO_ACTIVE_LOW>; | ||||
| +			trigger-sources = <&ohci_port1>, <&ehci_port1>, | ||||
| +					  <&xhci_port1>; | ||||
| +			linux,default-trigger = "usbport"; | ||||
| +		}; | ||||
| + | ||||
| +		power { | ||||
| +			label = "bcm53xx:white:power"; | ||||
| +			gpios = <&chipcommon 4 GPIO_ACTIVE_HIGH>; | ||||
| +		}; | ||||
| + | ||||
| +		wifi-disabled { | ||||
| +			label = "bcm53xx:amber:wifi-disabled"; | ||||
| +			gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>; | ||||
| +		}; | ||||
| + | ||||
| +		wifi-enabled { | ||||
| +			label = "bcm53xx:white:wifi-enabled"; | ||||
| +			gpios = <&chipcommon 5 GPIO_ACTIVE_HIGH>; | ||||
| +		}; | ||||
| + | ||||
| +		bluebar1 { | ||||
| +			label = "bcm53xx:white:bluebar1"; | ||||
| +			gpios = <&chipcommon 11 GPIO_ACTIVE_HIGH>; | ||||
| +		}; | ||||
| + | ||||
| +		bluebar2 { | ||||
| +			label = "bcm53xx:white:bluebar2"; | ||||
| +			gpios = <&chipcommon 12 GPIO_ACTIVE_HIGH>; | ||||
| +		}; | ||||
| + | ||||
| +		bluebar3 { | ||||
| +			label = "bcm53xx:white:bluebar3"; | ||||
| +			gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; | ||||
| +		}; | ||||
| + | ||||
| +		bluebar4 { | ||||
| +			label = "bcm53xx:white:bluebar4"; | ||||
| +			gpios = <&chipcommon 18 GPIO_ACTIVE_HIGH>; | ||||
| +		}; | ||||
| + | ||||
| +		bluebar5 { | ||||
| +			label = "bcm53xx:white:bluebar5"; | ||||
| +			gpios = <&chipcommon 19 GPIO_ACTIVE_HIGH>; | ||||
| +		}; | ||||
| + | ||||
| +		bluebar6 { | ||||
| +			label = "bcm53xx:white:bluebar6"; | ||||
| +			gpios = <&chipcommon 20 GPIO_ACTIVE_HIGH>; | ||||
| +		}; | ||||
| + | ||||
| +		bluebar7 { | ||||
| +			label = "bcm53xx:white:bluebar7"; | ||||
| +			gpios = <&chipcommon 21 GPIO_ACTIVE_HIGH>; | ||||
| +		}; | ||||
| + | ||||
| +		bluebar8 { | ||||
| +			label = "bcm53xx:white:bluebar8"; | ||||
| +			gpios = <&chipcommon 8 GPIO_ACTIVE_HIGH>; | ||||
| +		}; | ||||
| +	}; | ||||
| + | ||||
| +	mdio-bus-mux { | ||||
| +		/* BIT(9) = 1 => external mdio */ | ||||
| +		mdio_ext: mdio@200 { | ||||
| +			reg = <0x200>; | ||||
| +			#address-cells = <1>; | ||||
| +			#size-cells = <0>; | ||||
| +		}; | ||||
| +	}; | ||||
| + | ||||
| +	mdio-mii-mux { | ||||
| +		compatible = "mdio-mux-mmioreg"; | ||||
| +		mdio-parent-bus = <&mdio_ext>; | ||||
| +		#address-cells = <1>; | ||||
| +		#size-cells = <0>; | ||||
| +		reg = <0x1800c1c0 0x4>; | ||||
| + | ||||
| +		/* BIT(6) = mdc, BIT(7) = mdio */ | ||||
| +		mux-mask = <0xc0>; | ||||
| + | ||||
| +		mdio-mii@0 { | ||||
| +			/* Enable MII function */ | ||||
| +			reg = <0x0>; | ||||
| +			#address-cells = <1>; | ||||
| +			#size-cells = <0>; | ||||
| + | ||||
| +			switch@0  { | ||||
| +				compatible = "brcm,bcm53125"; | ||||
| +				#address-cells = <1>; | ||||
| +				#size-cells = <0>; | ||||
| +				reset-gpios = <&chipcommon 10 GPIO_ACTIVE_LOW>; | ||||
| +				reset-names = "robo_reset"; | ||||
| +				reg = <0>; | ||||
| +				dsa,member = <1 0>; | ||||
| + | ||||
| +				ports { | ||||
| +					#address-cells = <1>; | ||||
| +					#size-cells = <0>; | ||||
| + | ||||
| +					port@0 { | ||||
| +						reg = <0>; | ||||
| +						label = "lan1"; | ||||
| +					}; | ||||
| + | ||||
| +					port@1 { | ||||
| +						reg = <1>; | ||||
| +						label = "lan5"; | ||||
| +					}; | ||||
| + | ||||
| +					port@2 { | ||||
| +						reg = <2>; | ||||
| +						label = "lan2"; | ||||
| +					}; | ||||
| + | ||||
| +					port@3 { | ||||
| +						reg = <3>; | ||||
| +						label = "lan6"; | ||||
| +					}; | ||||
| + | ||||
| +					port@4 { | ||||
| +						reg = <4>; | ||||
| +						label = "lan3"; | ||||
| +					}; | ||||
| + | ||||
| +					sw1_p8: port@8 { | ||||
| +						reg = <8>; | ||||
| +						ethernet = <&sw0_p0>; | ||||
| +						label = "cpu"; | ||||
| + | ||||
| +						fixed-link { | ||||
| +							speed = <1000>; | ||||
| +							full-duplex; | ||||
| +						}; | ||||
| +					}; | ||||
| +				}; | ||||
| +			}; | ||||
| +		}; | ||||
| +	}; | ||||
| +}; | ||||
| + | ||||
| +&usb2 { | ||||
| +	vcc-gpio = <&chipcommon 13 GPIO_ACTIVE_HIGH>; | ||||
| +}; | ||||
| + | ||||
| +&usb3 { | ||||
| +	vcc-gpio = <&chipcommon 14 GPIO_ACTIVE_HIGH>; | ||||
| +}; | ||||
| + | ||||
| +&srab { | ||||
| +	compatible = "brcm,bcm53012-srab", "brcm,bcm5301x-srab"; | ||||
| +	status = "okay"; | ||||
| +	dsa,member = <0 0>; | ||||
| + | ||||
| +	ports { | ||||
| +		#address-cells = <1>; | ||||
| +		#size-cells = <0>; | ||||
| + | ||||
| +		port@1 { | ||||
| +			reg = <1>; | ||||
| +			label = "lan7"; | ||||
| +		}; | ||||
| + | ||||
| +		port@2 { | ||||
| +			reg = <2>; | ||||
| +			label = "lan4"; | ||||
| +		}; | ||||
| + | ||||
| +		port@3 { | ||||
| +			reg = <3>; | ||||
| +			label = "lan8"; | ||||
| +		}; | ||||
| + | ||||
| +		port@4 { | ||||
| +			reg = <4>; | ||||
| +			label = "wan"; | ||||
| +		}; | ||||
| + | ||||
| +		port@8 { | ||||
| +			reg = <8>; | ||||
| +			ethernet = <&gmac2>; | ||||
| +			label = "cpu"; | ||||
| + | ||||
| +			fixed-link { | ||||
| +				speed = <1000>; | ||||
| +				full-duplex; | ||||
| +			}; | ||||
| +		}; | ||||
| + | ||||
| +		sw0_p0: port@0 { | ||||
| +			reg = <0>; | ||||
| +			label = "extsw"; | ||||
| + | ||||
| +			fixed-link { | ||||
| +				speed = <1000>; | ||||
| +				full-duplex; | ||||
| +			}; | ||||
| +		}; | ||||
|  	}; | ||||
|  }; | ||||
|   | ||||
| @@ -0,0 +1,166 @@ | ||||
| From ed4728d9fa0b19687caa964cf5c2082b80208167 Mon Sep 17 00:00:00 2001 | ||||
| From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl> | ||||
| Date: Sat, 28 Jul 2018 13:25:48 +0200 | ||||
| Subject: [PATCH] ARM: dts: BCM5301X: Specify flash partitions | ||||
| MIME-Version: 1.0 | ||||
| Content-Type: text/plain; charset=UTF-8 | ||||
| Content-Transfer-Encoding: 8bit | ||||
|  | ||||
| Most devices use Broadcom standard partitions which allows them to be | ||||
| described with the "brcm,bcm947xx-cfe-partitions". Exceptions are: | ||||
| 1) TP-LINK devices which use "os-image" partition with TRX containing | ||||
|    kernel only + separated rootfs partition. | ||||
| 2) Asus RT-AC87U with custom "asus" partition. | ||||
|  | ||||
| This commit also removes undocumented and unsupported linux,part-probe | ||||
| binding which got accidentally upstreamed while describing SPI | ||||
| controller. | ||||
|  | ||||
| Signed-off-by: Rafał Miłecki <rafal@milecki.pl> | ||||
| --- | ||||
|  arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts | 28 +++++++++++++++++++ | ||||
|  arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts        | 31 ++++++++++++++++++++++ | ||||
|  arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts  | 28 +++++++++++++++++++ | ||||
|  arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi           |  4 +++ | ||||
|  arch/arm/boot/dts/bcm5301x.dtsi                    |  5 +++- | ||||
|  5 files changed, 95 insertions(+), 1 deletion(-) | ||||
|  | ||||
| --- a/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts | ||||
| +++ b/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts | ||||
| @@ -94,6 +94,34 @@ | ||||
|   | ||||
|  &spi_nor { | ||||
|  	status = "okay"; | ||||
| + | ||||
| +	partitions { | ||||
| +		compatible = "fixed-partitions"; | ||||
| +		#address-cells = <1>; | ||||
| +		#size-cells = <1>; | ||||
| + | ||||
| +		boot@0 { | ||||
| +			label = "boot"; | ||||
| +			reg = <0x000000 0x040000>; | ||||
| +			read-only; | ||||
| +		}; | ||||
| + | ||||
| +		os-image@100000 { | ||||
| +			label = "os-image"; | ||||
| +			reg = <0x040000 0x200000>; | ||||
| +			compatible = "brcm,trx"; | ||||
| +		}; | ||||
| + | ||||
| +		rootfs@240000 { | ||||
| +			label = "rootfs"; | ||||
| +			reg = <0x240000 0xc00000>; | ||||
| +		}; | ||||
| + | ||||
| +		nvram@ff0000 { | ||||
| +			label = "nvram"; | ||||
| +			reg = <0xff0000 0x010000>; | ||||
| +		}; | ||||
| +	}; | ||||
|  }; | ||||
|   | ||||
|  &usb2 { | ||||
| --- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts | ||||
| +++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts | ||||
| @@ -66,3 +66,34 @@ | ||||
|  &usb3_phy { | ||||
|  	status = "okay"; | ||||
|  }; | ||||
| + | ||||
| +&nandcs { | ||||
| +	partitions { | ||||
| +		compatible = "fixed-partitions"; | ||||
| +		#address-cells = <1>; | ||||
| +		#size-cells = <1>; | ||||
| + | ||||
| +		boot@0 { | ||||
| +			label = "boot"; | ||||
| +			reg = <0x00000000 0x00080000>; | ||||
| +			read-only; | ||||
| +		}; | ||||
| + | ||||
| +		nvram@80000 { | ||||
| +			label = "nvram"; | ||||
| +			reg = <0x00080000 0x00180000>; | ||||
| +		}; | ||||
| + | ||||
| +		firmware@200000 { | ||||
| +			label = "firmware"; | ||||
| +			reg = <0x00200000 0x07cc0000>; | ||||
| +			compatible = "brcm,trx"; | ||||
| +		}; | ||||
| + | ||||
| +		asus@7ec0000 { | ||||
| +			label = "asus"; | ||||
| +			reg = <0x07ec0000 0x00140000>; | ||||
| +			read-only; | ||||
| +		}; | ||||
| +	}; | ||||
| +}; | ||||
| --- a/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts | ||||
| +++ b/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts | ||||
| @@ -103,6 +103,34 @@ | ||||
|   | ||||
|  &spi_nor { | ||||
|  	status = "okay"; | ||||
| + | ||||
| +	partitions { | ||||
| +		compatible = "fixed-partitions"; | ||||
| +		#address-cells = <1>; | ||||
| +		#size-cells = <1>; | ||||
| + | ||||
| +		boot@0 { | ||||
| +			label = "boot"; | ||||
| +			reg = <0x000000 0x040000>; | ||||
| +			read-only; | ||||
| +		}; | ||||
| + | ||||
| +		os-image@100000 { | ||||
| +			label = "os-image"; | ||||
| +			reg = <0x040000 0x200000>; | ||||
| +			compatible = "brcm,trx"; | ||||
| +		}; | ||||
| + | ||||
| +		rootfs@240000 { | ||||
| +			label = "rootfs"; | ||||
| +			reg = <0x240000 0xc00000>; | ||||
| +		}; | ||||
| + | ||||
| +		nvram@ff0000 { | ||||
| +			label = "nvram"; | ||||
| +			reg = <0xff0000 0x010000>; | ||||
| +		}; | ||||
| +	}; | ||||
|  }; | ||||
|   | ||||
|  &usb3_phy { | ||||
| --- a/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi | ||||
| +++ b/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi | ||||
| @@ -12,6 +12,10 @@ | ||||
|  			reg = <0>; | ||||
|  			#address-cells = <1>; | ||||
|  			#size-cells = <1>; | ||||
| + | ||||
| +			partitions { | ||||
| +				compatible = "brcm,bcm947xx-cfe-partitions"; | ||||
| +			}; | ||||
|  		}; | ||||
|  	}; | ||||
|  }; | ||||
| --- a/arch/arm/boot/dts/bcm5301x.dtsi | ||||
| +++ b/arch/arm/boot/dts/bcm5301x.dtsi | ||||
| @@ -475,8 +475,11 @@ | ||||
|  			compatible = "jedec,spi-nor"; | ||||
|  			reg = <0>; | ||||
|  			spi-max-frequency = <20000000>; | ||||
| -			linux,part-probe = "ofpart", "bcm47xxpart"; | ||||
|  			status = "disabled"; | ||||
| + | ||||
| +			partitions { | ||||
| +				compatible = "brcm,bcm947xx-cfe-partitions"; | ||||
| +			}; | ||||
|  		}; | ||||
|  	}; | ||||
|   | ||||
| @@ -127,7 +127,7 @@ it on BCM4708 family. | ||||
|  /* | ||||
| --- a/drivers/usb/host/xhci.h | ||||
| +++ b/drivers/usb/host/xhci.h | ||||
| @@ -1831,6 +1831,7 @@ struct xhci_hcd { | ||||
| @@ -1835,6 +1835,7 @@ struct xhci_hcd { | ||||
|  #define XHCI_LIMIT_ENDPOINT_INTERVAL_7	(1 << 26) | ||||
|  #define XHCI_U2_DISABLE_WAKE	(1 << 27) | ||||
|  #define XHCI_ASMEDIA_MODIFY_FLOWCONTROL	(1 << 28) | ||||
|   | ||||
| @@ -1,53 +0,0 @@ | ||||
| From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl> | ||||
| Subject: [PATCH] Use "brcm,bcm947xx-cfe-partitions" binding for Broadcom | ||||
|  partitions | ||||
|  | ||||
| --- | ||||
|  | ||||
| --- a/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi | ||||
| +++ b/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi | ||||
| @@ -12,6 +12,10 @@ | ||||
|  			reg = <0>; | ||||
|  			#address-cells = <1>; | ||||
|  			#size-cells = <1>; | ||||
| + | ||||
| +			partitions { | ||||
| +				compatible = "brcm,bcm947xx-cfe-partitions"; | ||||
| +			}; | ||||
|  		}; | ||||
|  	}; | ||||
|  }; | ||||
| --- a/arch/arm/boot/dts/bcm5301x.dtsi | ||||
| +++ b/arch/arm/boot/dts/bcm5301x.dtsi | ||||
| @@ -456,8 +456,11 @@ | ||||
|  			compatible = "jedec,spi-nor"; | ||||
|  			reg = <0>; | ||||
|  			spi-max-frequency = <20000000>; | ||||
| -			linux,part-probe = "ofpart", "bcm47xxpart"; | ||||
|  			status = "disabled"; | ||||
| + | ||||
| +			partitions { | ||||
| +				compatible = "brcm,bcm947xx-cfe-partitions"; | ||||
| +			}; | ||||
|  		}; | ||||
|  	}; | ||||
|   | ||||
| --- a/drivers/mtd/bcm47xxpart.c | ||||
| +++ b/drivers/mtd/bcm47xxpart.c | ||||
| @@ -314,9 +314,16 @@ static int bcm47xxpart_parse(struct mtd_ | ||||
|  	return curr_part; | ||||
|  }; | ||||
|   | ||||
| +static const struct of_device_id bcm47xxpart_of_match_table[] = { | ||||
| +	{ .compatible = "brcm,bcm947xx-cfe-partitions" }, | ||||
| +	{}, | ||||
| +}; | ||||
| +MODULE_DEVICE_TABLE(of, bcm47xxpart_of_match_table); | ||||
| + | ||||
|  static struct mtd_part_parser bcm47xxpart_mtd_parser = { | ||||
|  	.parse_fn = bcm47xxpart_parse, | ||||
|  	.name = "bcm47xxpart", | ||||
| +	.of_match_table = bcm47xxpart_of_match_table, | ||||
|  }; | ||||
|  module_mtd_part_parser(bcm47xxpart_mtd_parser); | ||||
|   | ||||
| @@ -1,56 +0,0 @@ | ||||
| From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl> | ||||
| Subject: [PATCH] mtd: bcm47xxpart: add device specific workarounds | ||||
| MIME-Version: 1.0 | ||||
| Content-Type: text/plain; charset=UTF-8 | ||||
| Content-Transfer-Encoding: 8bit | ||||
|  | ||||
| Signed-off-by: Rafał Miłecki <rafal@milecki.pl> | ||||
| --- | ||||
|  | ||||
| --- a/drivers/mtd/bcm47xxpart.c | ||||
| +++ b/drivers/mtd/bcm47xxpart.c | ||||
| @@ -15,6 +15,7 @@ | ||||
|  #include <linux/slab.h> | ||||
|  #include <linux/mtd/mtd.h> | ||||
|  #include <linux/mtd/partitions.h> | ||||
| +#include <linux/of.h> | ||||
|   | ||||
|  #include <uapi/linux/magic.h> | ||||
|   | ||||
| @@ -134,6 +135,36 @@ static int bcm47xxpart_parse(struct mtd_ | ||||
|  			break; | ||||
|  		} | ||||
|   | ||||
| +		/* | ||||
| +		 * Device specific workarounds (hacks). We should use DT to | ||||
| +		 * define partitions but we need a working TRX firmware splitter | ||||
| +		 * first. | ||||
| +		 */ | ||||
| +		if (of_machine_is_compatible("asus,rt-ac87u") && offset == 0x7ec0000) { | ||||
| +			/* | ||||
| +			 * "asus" partition uses JFFS2 which we don't detect and | ||||
| +			 * we don't want to as this could affect other devices. | ||||
| +			 */ | ||||
| +			bcm47xxpart_add_part(&parts[curr_part++], "asus", offset, MTD_WRITEABLE); | ||||
| +			continue; | ||||
| +		} else  if (of_machine_is_compatible("tplink,archer-c5-v2") && offset == 0xe40000) { | ||||
| +			/* | ||||
| +			 * There is a whole set of partitions (not even listed | ||||
| +			 * by original firmware): "default-mac", "pin", | ||||
| +			 * "partition-table", etc. | ||||
| +			 */ | ||||
| +			bcm47xxpart_add_part(&parts[curr_part++], "tplink", offset, MTD_WRITEABLE); | ||||
| +			continue; | ||||
| +		} else  if (of_machine_is_compatible("tplink,archer-c9-v1") && offset == 0xe40000) { | ||||
| +			/* | ||||
| +			 * There is a whole set of partitions (not even listed | ||||
| +			 * by original firmware): "default-mac", "pin", | ||||
| +			 * "partition-table", etc. | ||||
| +			 */ | ||||
| +			bcm47xxpart_add_part(&parts[curr_part++], "tplink", offset, MTD_WRITEABLE); | ||||
| +			continue; | ||||
| +		} | ||||
| + | ||||
|  		/* Read beginning of the block */ | ||||
|  		err = mtd_read(master, offset, BCM47XXPART_BYTES_TO_READ, | ||||
|  			       &bytes_read, (uint8_t *)buf); | ||||
| @@ -11,22 +11,14 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl> | ||||
|  | ||||
| --- a/arch/arm/boot/dts/bcm53573.dtsi | ||||
| +++ b/arch/arm/boot/dts/bcm53573.dtsi | ||||
| @@ -48,6 +48,15 @@ | ||||
|  		}; | ||||
| @@ -54,6 +54,7 @@ | ||||
|  			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>, | ||||
|  			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>, | ||||
|  			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>; | ||||
| +		clocks = <&ilp>; | ||||
|  	}; | ||||
|   | ||||
| +	timer { | ||||
| +		compatible = "arm,armv7-timer"; | ||||
| +		interrupts = <GIC_PPI 13 0>, | ||||
| +			     <GIC_PPI 14 0>, | ||||
| +			     <GIC_PPI 11 0>, | ||||
| +			     <GIC_PPI 10 0>; | ||||
| +		clocks = <&ilp>; | ||||
| +	}; | ||||
| + | ||||
|  	clocks { | ||||
|  		#address-cells = <1>; | ||||
|  		#size-cells = <1>; | ||||
| --- a/drivers/bcma/main.c | ||||
| +++ b/drivers/bcma/main.c | ||||
| @@ -348,14 +348,6 @@ static int bcma_register_devices(struct | ||||
|   | ||||
| @@ -47,6 +47,7 @@ CONFIG_ARM64_PAGE_SHIFT=12 | ||||
| CONFIG_ARM64_PAN=y | ||||
| # CONFIG_ARM64_PTDUMP is not set | ||||
| # CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET is not set | ||||
| CONFIG_ARM64_SSBD=y | ||||
| CONFIG_ARM64_UAO=y | ||||
| CONFIG_ARM64_VA_BITS=39 | ||||
| CONFIG_ARM64_VA_BITS_39=y | ||||
|   | ||||
| @@ -9,7 +9,7 @@ Subject: [PATCH] kbuild: Ignore dtco targets when filtering symbols | ||||
|  | ||||
| --- a/scripts/Kbuild.include | ||||
| +++ b/scripts/Kbuild.include | ||||
| @@ -284,7 +284,7 @@ ksym_dep_filter = | ||||
| @@ -285,7 +285,7 @@ ksym_dep_filter = | ||||
|  	    $(CPP) $(call flags_nodeps,c_flags) -D__KSYM_DEPS__ $< ;;        \ | ||||
|  	  as_*_S|cpp_s_S)                                                    \ | ||||
|  	    $(CPP) $(call flags_nodeps,a_flags) -D__KSYM_DEPS__ $< ;;        \ | ||||
|   | ||||
| @@ -696,7 +696,7 @@ Signed-off-by: Noralf Trønnes <noralf@tronnes.org> | ||||
|  } | ||||
| --- a/drivers/usb/core/hub.c
 | ||||
| +++ b/drivers/usb/core/hub.c
 | ||||
| @@ -5064,7 +5064,7 @@ static void port_event(struct usb_hub *h
 | ||||
| @@ -5072,7 +5072,7 @@ static void port_event(struct usb_hub *h
 | ||||
|  	if (portchange & USB_PORT_STAT_C_OVERCURRENT) { | ||||
|  		u16 status = 0, unused; | ||||
|   | ||||
|   | ||||
| @@ -94,28 +94,7 @@ w1-gpio: Sort out the pullup/parasitic power tangle | ||||
|   | ||||
|  	pdev->dev.platform_data = pdata; | ||||
|   | ||||
| @@ -113,13 +140,15 @@ static int w1_gpio_probe_dt(struct platf | ||||
|  static int w1_gpio_probe(struct platform_device *pdev) | ||||
|  { | ||||
|  	struct w1_bus_master *master; | ||||
| -	struct w1_gpio_platform_data *pdata; | ||||
| +	struct w1_gpio_platform_data *pdata = pdev->dev.platform_data; | ||||
|  	int err; | ||||
|   | ||||
| -	if (of_have_populated_dt()) { | ||||
| -		err = w1_gpio_probe_dt(pdev); | ||||
| -		if (err < 0) | ||||
| -			return err; | ||||
| +	if(pdata == NULL) { | ||||
| +		if (of_have_populated_dt()) { | ||||
| +			err = w1_gpio_probe_dt(pdev); | ||||
| +			if (err < 0) | ||||
| +				return err; | ||||
| +		} | ||||
|  	} | ||||
|   | ||||
|  	pdata = dev_get_platdata(&pdev->dev); | ||||
| @@ -136,6 +165,22 @@ static int w1_gpio_probe(struct platform | ||||
| @@ -135,6 +162,22 @@ static int w1_gpio_probe(struct platform | ||||
|  		return -ENOMEM; | ||||
|  	} | ||||
|   | ||||
| @@ -138,7 +117,7 @@ w1-gpio: Sort out the pullup/parasitic power tangle | ||||
|  	err = devm_gpio_request(&pdev->dev, pdata->pin, "w1"); | ||||
|  	if (err) { | ||||
|  		dev_err(&pdev->dev, "gpio_request (pin) failed\n"); | ||||
| @@ -165,6 +210,14 @@ static int w1_gpio_probe(struct platform | ||||
| @@ -164,6 +207,14 @@ static int w1_gpio_probe(struct platform | ||||
|  		master->set_pullup = w1_gpio_set_pullup; | ||||
|  	} | ||||
|   | ||||
| @@ -153,7 +132,7 @@ w1-gpio: Sort out the pullup/parasitic power tangle | ||||
|  	err = w1_add_master_device(master); | ||||
|  	if (err) { | ||||
|  		dev_err(&pdev->dev, "w1_add_master device failed\n"); | ||||
| @@ -195,6 +248,10 @@ static int w1_gpio_remove(struct platfor | ||||
| @@ -194,6 +245,10 @@ static int w1_gpio_remove(struct platfor | ||||
|   | ||||
|  	w1_remove_master_device(master); | ||||
|   | ||||
|   | ||||
| @@ -39,7 +39,7 @@ Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> | ||||
|  | ||||
| --- a/drivers/usb/dwc2/hcd.c | ||||
| +++ b/drivers/usb/dwc2/hcd.c | ||||
| @@ -4381,6 +4381,9 @@ static int _dwc2_hcd_suspend(struct usb_ | ||||
| @@ -4383,6 +4383,9 @@ static int _dwc2_hcd_suspend(struct usb_ | ||||
|  	if (!HCD_HW_ACCESSIBLE(hcd)) | ||||
|  		goto unlock; | ||||
|   | ||||
|   | ||||
| @@ -39,7 +39,7 @@ configure_by_vlanports() { | ||||
| 			"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0" | ||||
|  | ||||
| 	else | ||||
| 		logger -t "01_detect" "Unable to determine network configuration" | ||||
| 		logger -t "01_network" "Unable to determine network configuration" | ||||
| 		ucidef_set_interface_lan "eth0" | ||||
| 	fi | ||||
| } | ||||
|   | ||||
| @@ -8,7 +8,7 @@ | ||||
|  #include <asm/bootinfo.h> | ||||
|  #include <asm/idle.h> | ||||
|  #include <asm/prom.h> | ||||
| @@ -231,6 +232,33 @@ static struct fixed_phy_status bcm47xx_f | ||||
| @@ -225,6 +226,33 @@ static struct fixed_phy_status bcm47xx_f | ||||
|  	.duplex	= DUPLEX_FULL, | ||||
|  }; | ||||
|   | ||||
| @@ -42,7 +42,7 @@ | ||||
|  static int __init bcm47xx_register_bus_complete(void) | ||||
|  { | ||||
|  	switch (bcm47xx_bus_type) { | ||||
| @@ -250,6 +278,7 @@ static int __init bcm47xx_register_bus_c | ||||
| @@ -244,6 +272,7 @@ static int __init bcm47xx_register_bus_c | ||||
|  	bcm47xx_workarounds(); | ||||
|   | ||||
|  	fixed_phy_add(PHY_POLL, 0, &bcm47xx_fixed_phy_status, -1); | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| --- a/drivers/mtd/bcm47xxpart.c | ||||
| +++ b/drivers/mtd/bcm47xxpart.c | ||||
| @@ -102,6 +102,7 @@ static int bcm47xxpart_parse(struct mtd_ | ||||
| @@ -103,6 +103,7 @@ static int bcm47xxpart_parse(struct mtd_ | ||||
|  	int trx_num = 0; /* Number of found TRX partitions */ | ||||
|  	int possible_nvram_sizes[] = { 0x8000, 0xF000, 0x10000, }; | ||||
|  	int err; | ||||
| @@ -8,7 +8,7 @@ | ||||
|   | ||||
|  	/* | ||||
|  	 * Some really old flashes (like AT45DB*) had smaller erasesize-s, but | ||||
| @@ -283,12 +284,23 @@ static int bcm47xxpart_parse(struct mtd_ | ||||
| @@ -284,12 +285,23 @@ static int bcm47xxpart_parse(struct mtd_ | ||||
|  		if (buf[0] == NVRAM_HEADER) { | ||||
|  			bcm47xxpart_add_part(&parts[curr_part++], "nvram", | ||||
|  					     master->size - blocksize, 0); | ||||
|   | ||||
| @@ -1,101 +0,0 @@ | ||||
| From d0423d3e4fa7ae305729cb50369427f075ccb279 Mon Sep 17 00:00:00 2001 | ||||
| From: Jonas Gorski <jonas.gorski@gmail.com> | ||||
| Date: Sat, 25 Feb 2017 12:41:28 +0100 | ||||
| Subject: [PATCH 1/6] bcm63xx_enet: correct clock usage | ||||
|  | ||||
| Check the return code of prepare_enable and change one last instance of | ||||
| enable only to prepare_enable. Also properly disable and release the | ||||
| clock in error paths and on remove for enetsw. | ||||
|  | ||||
| Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> | ||||
| --- | ||||
|  drivers/net/ethernet/broadcom/bcm63xx_enet.c | 31 +++++++++++++++++++++------- | ||||
|  1 file changed, 23 insertions(+), 8 deletions(-) | ||||
|  | ||||
| --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c | ||||
| +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c | ||||
| @@ -1773,7 +1773,9 @@ static int bcm_enet_probe(struct platfor | ||||
|  		ret = PTR_ERR(priv->mac_clk); | ||||
|  		goto out; | ||||
|  	} | ||||
| -	clk_prepare_enable(priv->mac_clk); | ||||
| +	ret = clk_prepare_enable(priv->mac_clk); | ||||
| +	if (ret) | ||||
| +		goto out_put_clk_mac; | ||||
|   | ||||
|  	/* initialize default and fetch platform data */ | ||||
|  	priv->rx_ring_size = BCMENET_DEF_RX_DESC; | ||||
| @@ -1805,9 +1807,11 @@ static int bcm_enet_probe(struct platfor | ||||
|  		if (IS_ERR(priv->phy_clk)) { | ||||
|  			ret = PTR_ERR(priv->phy_clk); | ||||
|  			priv->phy_clk = NULL; | ||||
| -			goto out_put_clk_mac; | ||||
| +			goto out_disable_clk_mac; | ||||
|  		} | ||||
| -		clk_prepare_enable(priv->phy_clk); | ||||
| +		ret = clk_prepare_enable(priv->phy_clk); | ||||
| +		if (ret) | ||||
| +			goto out_put_clk_phy; | ||||
|  	} | ||||
|   | ||||
|  	/* do minimal hardware init to be able to probe mii bus */ | ||||
| @@ -1901,13 +1905,16 @@ out_free_mdio: | ||||
|  out_uninit_hw: | ||||
|  	/* turn off mdc clock */ | ||||
|  	enet_writel(priv, 0, ENET_MIISC_REG); | ||||
| -	if (priv->phy_clk) { | ||||
| +	if (priv->phy_clk) | ||||
|  		clk_disable_unprepare(priv->phy_clk); | ||||
| + | ||||
| +out_put_clk_phy: | ||||
| +	if (priv->phy_clk) | ||||
|  		clk_put(priv->phy_clk); | ||||
| -	} | ||||
|   | ||||
| -out_put_clk_mac: | ||||
| +out_disable_clk_mac: | ||||
|  	clk_disable_unprepare(priv->mac_clk); | ||||
| +out_put_clk_mac: | ||||
|  	clk_put(priv->mac_clk); | ||||
|  out: | ||||
|  	free_netdev(dev); | ||||
| @@ -2752,7 +2759,9 @@ static int bcm_enetsw_probe(struct platf | ||||
|  		ret = PTR_ERR(priv->mac_clk); | ||||
|  		goto out_unmap; | ||||
|  	} | ||||
| -	clk_enable(priv->mac_clk); | ||||
| +	ret = clk_prepare_enable(priv->mac_clk); | ||||
| +	if (ret) | ||||
| +		goto out_put_clk; | ||||
|   | ||||
|  	priv->rx_chan = 0; | ||||
|  	priv->tx_chan = 1; | ||||
| @@ -2773,7 +2782,7 @@ static int bcm_enetsw_probe(struct platf | ||||
|   | ||||
|  	ret = register_netdev(dev); | ||||
|  	if (ret) | ||||
| -		goto out_put_clk; | ||||
| +		goto out_disable_clk; | ||||
|   | ||||
|  	netif_carrier_off(dev); | ||||
|  	platform_set_drvdata(pdev, dev); | ||||
| @@ -2782,6 +2791,9 @@ static int bcm_enetsw_probe(struct platf | ||||
|   | ||||
|  	return 0; | ||||
|   | ||||
| +out_disable_clk: | ||||
| +	clk_disable_unprepare(priv->mac_clk); | ||||
| + | ||||
|  out_put_clk: | ||||
|  	clk_put(priv->mac_clk); | ||||
|   | ||||
| @@ -2813,6 +2825,9 @@ static int bcm_enetsw_remove(struct plat | ||||
|  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||||
|  	release_mem_region(res->start, resource_size(res)); | ||||
|   | ||||
| +	clk_disable_unprepare(priv->mac_clk); | ||||
| +	clk_put(priv->mac_clk); | ||||
| + | ||||
|  	free_netdev(dev); | ||||
|  	return 0; | ||||
|  } | ||||
| @@ -1,29 +0,0 @@ | ||||
| From 23d94cb855b6f4f0ee1c01679224472104ac6440 Mon Sep 17 00:00:00 2001 | ||||
| From: Jonas Gorski <jonas.gorski@gmail.com> | ||||
| Date: Sat, 30 Sep 2017 14:10:18 +0200 | ||||
| Subject: [PATCH 2/6] bcm63xx_enet: do not write to random DMA channel on | ||||
|  BCM6345 | ||||
|  | ||||
| The DMA controller regs actually point to DMA channel 0, so the write to | ||||
| ENETDMA_CFG_REG will actually modify a random DMA channel. | ||||
|  | ||||
| Since DMA controller registers do not exist on BCM6345, guard the write | ||||
| with the usual check for dma_has_sram. | ||||
|  | ||||
| Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> | ||||
| --- | ||||
|  drivers/net/ethernet/broadcom/bcm63xx_enet.c | 3 ++- | ||||
|  1 file changed, 2 insertions(+), 1 deletion(-) | ||||
|  | ||||
| --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c | ||||
| +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c | ||||
| @@ -1062,7 +1062,8 @@ static int bcm_enet_open(struct net_devi | ||||
|  	val = enet_readl(priv, ENET_CTL_REG); | ||||
|  	val |= ENET_CTL_ENABLE_MASK; | ||||
|  	enet_writel(priv, val, ENET_CTL_REG); | ||||
| -	enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG); | ||||
| +	if (priv->dma_has_sram) | ||||
| +		enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG); | ||||
|  	enet_dmac_writel(priv, priv->dma_chan_en_mask, | ||||
|  			 ENETDMAC_CHANCFG, priv->rx_chan); | ||||
|   | ||||
| @@ -0,0 +1,81 @@ | ||||
| From e62ff8f02eb3ae35ae7ece7c5272a689fd8b0bcd Mon Sep 17 00:00:00 2001 | ||||
| From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl> | ||||
| Date: Fri, 27 Jul 2018 21:37:48 +0200 | ||||
| Subject: [PATCH] Revert "mtd: partitions: use DT info for parsing partitions | ||||
|  with "compatible" prop" | ||||
|  | ||||
| This reverts commit 76a832254ab05502c9394cc51ded6f0abe0e0bee. | ||||
| --- | ||||
|  drivers/mtd/mtdpart.c | 33 ++++++++++++++++++++------------- | ||||
|  1 file changed, 20 insertions(+), 13 deletions(-) | ||||
|  | ||||
| --- a/drivers/mtd/mtdpart.c | ||||
| +++ b/drivers/mtd/mtdpart.c | ||||
| @@ -453,6 +453,22 @@ static inline void free_partition(struct | ||||
|  	kfree(p); | ||||
|  } | ||||
|   | ||||
| +/** | ||||
| + * mtd_parse_part - parse MTD partition looking for subpartitions | ||||
| + * | ||||
| + * @slave: part that is supposed to be a container and should be parsed | ||||
| + * @types: NULL-terminated array with names of partition parsers to try | ||||
| + * | ||||
| + * Some partitions are kind of containers with extra subpartitions (volumes). | ||||
| + * There can be various formats of such containers. This function tries to use | ||||
| + * specified parsers to analyze given partition and registers found | ||||
| + * subpartitions on success. | ||||
| + */ | ||||
| +static int mtd_parse_part(struct mtd_part *slave, const char *const *types) | ||||
| +{ | ||||
| +	return parse_mtd_partitions(&slave->mtd, types, NULL); | ||||
| +} | ||||
| + | ||||
|  static struct mtd_part *allocate_partition(struct mtd_info *parent, | ||||
|  			const struct mtd_partition *part, int partno, | ||||
|  			uint64_t cur_offset) | ||||
| @@ -932,8 +948,8 @@ int add_mtd_partitions(struct mtd_info * | ||||
|  		add_mtd_device(&slave->mtd); | ||||
|  		mtd_partition_split(master, slave); | ||||
|  		mtd_add_partition_attrs(slave); | ||||
| -		/* Look for subpartitions */ | ||||
| -		parse_mtd_partitions(&slave->mtd, parts[i].types, NULL); | ||||
| +		if (parts[i].types) | ||||
| +			mtd_parse_part(slave, parts[i].types); | ||||
|   | ||||
|  		cur_offset = slave->offset + slave->mtd.size; | ||||
|  	} | ||||
| @@ -1035,12 +1051,6 @@ static const char * const default_mtd_pa | ||||
|  	NULL | ||||
|  }; | ||||
|   | ||||
| -/* Check DT only when looking for subpartitions. */ | ||||
| -static const char * const default_subpartition_types[] = { | ||||
| -	"ofpart", | ||||
| -	NULL | ||||
| -}; | ||||
| - | ||||
|  static int mtd_part_do_parse(struct mtd_part_parser *parser, | ||||
|  			     struct mtd_info *master, | ||||
|  			     struct mtd_partitions *pparts, | ||||
| @@ -1111,9 +1121,7 @@ static int mtd_part_of_parse(struct mtd_ | ||||
|  	const char *fixed = "fixed-partitions"; | ||||
|  	int ret, err = 0; | ||||
|   | ||||
| -	np = mtd_get_of_node(master); | ||||
| -	if (!mtd_is_partition(master)) | ||||
| -		np = of_get_child_by_name(np, "partitions"); | ||||
| +	np = of_get_child_by_name(mtd_get_of_node(master), "partitions"); | ||||
|  	of_property_for_each_string(np, "compatible", prop, compat) { | ||||
|  		parser = mtd_part_get_compatible_parser(compat); | ||||
|  		if (!parser) | ||||
| @@ -1183,8 +1191,7 @@ int parse_mtd_partitions(struct mtd_info | ||||
|  	} | ||||
|   | ||||
|  	if (!types) | ||||
| -		types = mtd_is_partition(master) ? default_subpartition_types : | ||||
| -			default_mtd_part_types; | ||||
| +		types = default_mtd_part_types; | ||||
|   | ||||
|  	for ( ; *types; types++) { | ||||
|  		/* | ||||
| @@ -1,30 +0,0 @@ | ||||
| From 80a79a889ce5df16c5261ab2f1e8e63b94b78102 Mon Sep 17 00:00:00 2001 | ||||
| From: Heiner Kallweit <hkallweit1@gmail.com> | ||||
| Date: Fri, 28 Oct 2016 07:58:46 +0200 | ||||
| Subject: [PATCH 1/8] mtd: m25p80: consider max message size in m25p80_read | ||||
|  | ||||
| Consider a message size limit when calculating the maximum amount | ||||
| of data that can be read. | ||||
|  | ||||
| The message size limit has been introduced with 4.9, so cc it | ||||
| to stable. | ||||
|  | ||||
| Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> | ||||
| Cc: <stable@vger.kernel.org> # 4.9.x | ||||
| Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com> | ||||
| --- | ||||
|  drivers/mtd/devices/m25p80.c | 3 ++- | ||||
|  1 file changed, 2 insertions(+), 1 deletion(-) | ||||
|  | ||||
| --- a/drivers/mtd/devices/m25p80.c | ||||
| +++ b/drivers/mtd/devices/m25p80.c | ||||
| @@ -174,7 +174,8 @@ static ssize_t m25p80_read(struct spi_no | ||||
|   | ||||
|  	t[1].rx_buf = buf; | ||||
|  	t[1].rx_nbits = m25p80_rx_nbits(nor); | ||||
| -	t[1].len = min(len, spi_max_transfer_size(spi)); | ||||
| +	t[1].len = min3(len, spi_max_transfer_size(spi), | ||||
| +			spi_max_message_size(spi) - t[0].len); | ||||
|  	spi_message_add_tail(&t[1], &m); | ||||
|   | ||||
|  	ret = spi_sync(spi, &m); | ||||
| @@ -1,101 +0,0 @@ | ||||
| From d0423d3e4fa7ae305729cb50369427f075ccb279 Mon Sep 17 00:00:00 2001 | ||||
| From: Jonas Gorski <jonas.gorski@gmail.com> | ||||
| Date: Sat, 25 Feb 2017 12:41:28 +0100 | ||||
| Subject: [PATCH 1/6] bcm63xx_enet: correct clock usage | ||||
|  | ||||
| Check the return code of prepare_enable and change one last instance of | ||||
| enable only to prepare_enable. Also properly disable and release the | ||||
| clock in error paths and on remove for enetsw. | ||||
|  | ||||
| Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> | ||||
| --- | ||||
|  drivers/net/ethernet/broadcom/bcm63xx_enet.c | 31 +++++++++++++++++++++------- | ||||
|  1 file changed, 23 insertions(+), 8 deletions(-) | ||||
|  | ||||
| --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c | ||||
| +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c | ||||
| @@ -1790,7 +1790,9 @@ static int bcm_enet_probe(struct platfor | ||||
|  		ret = PTR_ERR(priv->mac_clk); | ||||
|  		goto out; | ||||
|  	} | ||||
| -	clk_prepare_enable(priv->mac_clk); | ||||
| +	ret = clk_prepare_enable(priv->mac_clk); | ||||
| +	if (ret) | ||||
| +		goto out_put_clk_mac; | ||||
|   | ||||
|  	/* initialize default and fetch platform data */ | ||||
|  	priv->rx_ring_size = BCMENET_DEF_RX_DESC; | ||||
| @@ -1822,9 +1824,11 @@ static int bcm_enet_probe(struct platfor | ||||
|  		if (IS_ERR(priv->phy_clk)) { | ||||
|  			ret = PTR_ERR(priv->phy_clk); | ||||
|  			priv->phy_clk = NULL; | ||||
| -			goto out_put_clk_mac; | ||||
| +			goto out_disable_clk_mac; | ||||
|  		} | ||||
| -		clk_prepare_enable(priv->phy_clk); | ||||
| +		ret = clk_prepare_enable(priv->phy_clk); | ||||
| +		if (ret) | ||||
| +			goto out_put_clk_phy; | ||||
|  	} | ||||
|   | ||||
|  	/* do minimal hardware init to be able to probe mii bus */ | ||||
| @@ -1915,13 +1919,16 @@ out_free_mdio: | ||||
|  out_uninit_hw: | ||||
|  	/* turn off mdc clock */ | ||||
|  	enet_writel(priv, 0, ENET_MIISC_REG); | ||||
| -	if (priv->phy_clk) { | ||||
| +	if (priv->phy_clk) | ||||
|  		clk_disable_unprepare(priv->phy_clk); | ||||
| + | ||||
| +out_put_clk_phy: | ||||
| +	if (priv->phy_clk) | ||||
|  		clk_put(priv->phy_clk); | ||||
| -	} | ||||
|   | ||||
| -out_put_clk_mac: | ||||
| +out_disable_clk_mac: | ||||
|  	clk_disable_unprepare(priv->mac_clk); | ||||
| +out_put_clk_mac: | ||||
|  	clk_put(priv->mac_clk); | ||||
|  out: | ||||
|  	free_netdev(dev); | ||||
| @@ -2766,7 +2773,9 @@ static int bcm_enetsw_probe(struct platf | ||||
|  		ret = PTR_ERR(priv->mac_clk); | ||||
|  		goto out_unmap; | ||||
|  	} | ||||
| -	clk_enable(priv->mac_clk); | ||||
| +	ret = clk_prepare_enable(priv->mac_clk); | ||||
| +	if (ret) | ||||
| +		goto out_put_clk; | ||||
|   | ||||
|  	priv->rx_chan = 0; | ||||
|  	priv->tx_chan = 1; | ||||
| @@ -2787,7 +2796,7 @@ static int bcm_enetsw_probe(struct platf | ||||
|   | ||||
|  	ret = register_netdev(dev); | ||||
|  	if (ret) | ||||
| -		goto out_put_clk; | ||||
| +		goto out_disable_clk; | ||||
|   | ||||
|  	netif_carrier_off(dev); | ||||
|  	platform_set_drvdata(pdev, dev); | ||||
| @@ -2796,6 +2805,9 @@ static int bcm_enetsw_probe(struct platf | ||||
|   | ||||
|  	return 0; | ||||
|   | ||||
| +out_disable_clk: | ||||
| +	clk_disable_unprepare(priv->mac_clk); | ||||
| + | ||||
|  out_put_clk: | ||||
|  	clk_put(priv->mac_clk); | ||||
|   | ||||
| @@ -2827,6 +2839,9 @@ static int bcm_enetsw_remove(struct plat | ||||
|  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||||
|  	release_mem_region(res->start, resource_size(res)); | ||||
|   | ||||
| +	clk_disable_unprepare(priv->mac_clk); | ||||
| +	clk_put(priv->mac_clk); | ||||
| + | ||||
|  	free_netdev(dev); | ||||
|  	return 0; | ||||
|  } | ||||
| @@ -1,29 +0,0 @@ | ||||
| From 23d94cb855b6f4f0ee1c01679224472104ac6440 Mon Sep 17 00:00:00 2001 | ||||
| From: Jonas Gorski <jonas.gorski@gmail.com> | ||||
| Date: Sat, 30 Sep 2017 14:10:18 +0200 | ||||
| Subject: [PATCH 2/6] bcm63xx_enet: do not write to random DMA channel on | ||||
|  BCM6345 | ||||
|  | ||||
| The DMA controller regs actually point to DMA channel 0, so the write to | ||||
| ENETDMA_CFG_REG will actually modify a random DMA channel. | ||||
|  | ||||
| Since DMA controller registers do not exist on BCM6345, guard the write | ||||
| with the usual check for dma_has_sram. | ||||
|  | ||||
| Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> | ||||
| --- | ||||
|  drivers/net/ethernet/broadcom/bcm63xx_enet.c | 3 ++- | ||||
|  1 file changed, 2 insertions(+), 1 deletion(-) | ||||
|  | ||||
| --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c | ||||
| +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c | ||||
| @@ -1063,7 +1063,8 @@ static int bcm_enet_open(struct net_devi | ||||
|  	val = enet_readl(priv, ENET_CTL_REG); | ||||
|  	val |= ENET_CTL_ENABLE_MASK; | ||||
|  	enet_writel(priv, val, ENET_CTL_REG); | ||||
| -	enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG); | ||||
| +	if (priv->dma_has_sram) | ||||
| +		enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG); | ||||
|  	enet_dmac_writel(priv, priv->dma_chan_en_mask, | ||||
|  			 ENETDMAC_CHANCFG, priv->rx_chan); | ||||
|   | ||||
| @@ -0,0 +1,81 @@ | ||||
| From e62ff8f02eb3ae35ae7ece7c5272a689fd8b0bcd Mon Sep 17 00:00:00 2001 | ||||
| From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl> | ||||
| Date: Fri, 27 Jul 2018 21:37:48 +0200 | ||||
| Subject: [PATCH] Revert "mtd: partitions: use DT info for parsing partitions | ||||
|  with "compatible" prop" | ||||
|  | ||||
| This reverts commit 76a832254ab05502c9394cc51ded6f0abe0e0bee. | ||||
| --- | ||||
|  drivers/mtd/mtdpart.c | 33 ++++++++++++++++++++------------- | ||||
|  1 file changed, 20 insertions(+), 13 deletions(-) | ||||
|  | ||||
| --- a/drivers/mtd/mtdpart.c | ||||
| +++ b/drivers/mtd/mtdpart.c | ||||
| @@ -453,6 +453,22 @@ static inline void free_partition(struct | ||||
|  	kfree(p); | ||||
|  } | ||||
|   | ||||
| +/** | ||||
| + * mtd_parse_part - parse MTD partition looking for subpartitions | ||||
| + * | ||||
| + * @slave: part that is supposed to be a container and should be parsed | ||||
| + * @types: NULL-terminated array with names of partition parsers to try | ||||
| + * | ||||
| + * Some partitions are kind of containers with extra subpartitions (volumes). | ||||
| + * There can be various formats of such containers. This function tries to use | ||||
| + * specified parsers to analyze given partition and registers found | ||||
| + * subpartitions on success. | ||||
| + */ | ||||
| +static int mtd_parse_part(struct mtd_part *slave, const char *const *types) | ||||
| +{ | ||||
| +	return parse_mtd_partitions(&slave->mtd, types, NULL); | ||||
| +} | ||||
| + | ||||
|  static struct mtd_part *allocate_partition(struct mtd_info *parent, | ||||
|  			const struct mtd_partition *part, int partno, | ||||
|  			uint64_t cur_offset) | ||||
| @@ -924,8 +940,8 @@ int add_mtd_partitions(struct mtd_info * | ||||
|  		add_mtd_device(&slave->mtd); | ||||
|  		mtd_partition_split(master, slave); | ||||
|  		mtd_add_partition_attrs(slave); | ||||
| -		/* Look for subpartitions */ | ||||
| -		parse_mtd_partitions(&slave->mtd, parts[i].types, NULL); | ||||
| +		if (parts[i].types) | ||||
| +			mtd_parse_part(slave, parts[i].types); | ||||
|   | ||||
|  		cur_offset = slave->offset + slave->mtd.size; | ||||
|  	} | ||||
| @@ -1037,12 +1053,6 @@ static const char * const default_mtd_pa | ||||
|  	NULL | ||||
|  }; | ||||
|   | ||||
| -/* Check DT only when looking for subpartitions. */ | ||||
| -static const char * const default_subpartition_types[] = { | ||||
| -	"ofpart", | ||||
| -	NULL | ||||
| -}; | ||||
| - | ||||
|  static int mtd_part_do_parse(struct mtd_part_parser *parser, | ||||
|  			     struct mtd_info *master, | ||||
|  			     struct mtd_partitions *pparts, | ||||
| @@ -1113,9 +1123,7 @@ static int mtd_part_of_parse(struct mtd_ | ||||
|  	const char *fixed = "fixed-partitions"; | ||||
|  	int ret, err = 0; | ||||
|   | ||||
| -	np = mtd_get_of_node(master); | ||||
| -	if (!mtd_is_partition(master)) | ||||
| -		np = of_get_child_by_name(np, "partitions"); | ||||
| +	np = of_get_child_by_name(mtd_get_of_node(master), "partitions"); | ||||
|  	of_property_for_each_string(np, "compatible", prop, compat) { | ||||
|  		parser = mtd_part_get_compatible_parser(compat); | ||||
|  		if (!parser) | ||||
| @@ -1185,8 +1193,7 @@ int parse_mtd_partitions(struct mtd_info | ||||
|  	} | ||||
|   | ||||
|  	if (!types) | ||||
| -		types = mtd_is_partition(master) ? default_subpartition_types : | ||||
| -			default_mtd_part_types; | ||||
| +		types = default_mtd_part_types; | ||||
|   | ||||
|  	for ( ; *types; types++) { | ||||
|  		/* | ||||
| @@ -1,6 +1,6 @@ | ||||
| --- a/drivers/pci/probe.c | ||||
| +++ b/drivers/pci/probe.c | ||||
| @@ -2303,7 +2303,8 @@ static void pcie_write_mrrs(struct pci_d | ||||
| @@ -2305,7 +2305,8 @@ static void pcie_write_mrrs(struct pci_d | ||||
|  	/* In the "safe" case, do not configure the MRRS.  There appear to be | ||||
|  	 * issues with setting MRRS to 0 on a number of devices. | ||||
|  	 */ | ||||
|   | ||||
| @@ -65,7 +65,7 @@ Cc: Kir Kolyshkin <kir@openvz.org> | ||||
|  	 * Before updating sk_refcnt, we must commit prior changes to memory | ||||
| --- a/net/ipv4/tcp_output.c | ||||
| +++ b/net/ipv4/tcp_output.c | ||||
| @@ -1671,7 +1671,7 @@ u32 tcp_tso_autosize(const struct sock * | ||||
| @@ -1683,7 +1683,7 @@ u32 tcp_tso_autosize(const struct sock * | ||||
|  { | ||||
|  	u32 bytes, segs; | ||||
|   | ||||
| @@ -74,7 +74,7 @@ Cc: Kir Kolyshkin <kir@openvz.org> | ||||
|  		    sk->sk_gso_max_size - 1 - MAX_TCP_HEADER); | ||||
|   | ||||
|  	/* Goal is to send at least one packet per ms, | ||||
| @@ -2172,7 +2172,7 @@ static bool tcp_small_queue_check(struct | ||||
| @@ -2184,7 +2184,7 @@ static bool tcp_small_queue_check(struct | ||||
|  { | ||||
|  	unsigned int limit; | ||||
|   | ||||
|   | ||||
| @@ -0,0 +1,39 @@ | ||||
| From cf589ce71e84d3b8811c65740645af254c5248c0 Mon Sep 17 00:00:00 2001 | ||||
| From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl> | ||||
| Date: Wed, 9 May 2018 10:17:29 +0200 | ||||
| Subject: [PATCH] mtd: bcm47xxpart: add of_match_table with a new DT binding | ||||
| MIME-Version: 1.0 | ||||
| Content-Type: text/plain; charset=UTF-8 | ||||
| Content-Transfer-Encoding: 8bit | ||||
|  | ||||
| This allows using bcm47xxpart parser to find partitions on flash | ||||
| described in DT using the "brcm,bcm947xx-cfe-partitions" compatible | ||||
| property. It means this parser doesn't have to be explicitly selected by | ||||
| a flash driver anymore. It can be used e.g. together with a generic | ||||
| m25p80 / spi-nor if device is just properly described. | ||||
|  | ||||
| Signed-off-by: Rafał Miłecki <rafal@milecki.pl> | ||||
| Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> | ||||
| --- | ||||
|  drivers/mtd/bcm47xxpart.c | 7 +++++++ | ||||
|  1 file changed, 7 insertions(+) | ||||
|  | ||||
| --- a/drivers/mtd/bcm47xxpart.c | ||||
| +++ b/drivers/mtd/bcm47xxpart.c | ||||
| @@ -304,9 +304,16 @@ static int bcm47xxpart_parse(struct mtd_ | ||||
|  	return curr_part; | ||||
|  }; | ||||
|   | ||||
| +static const struct of_device_id bcm47xxpart_of_match_table[] = { | ||||
| +	{ .compatible = "brcm,bcm947xx-cfe-partitions" }, | ||||
| +	{}, | ||||
| +}; | ||||
| +MODULE_DEVICE_TABLE(of, bcm47xxpart_of_match_table); | ||||
| + | ||||
|  static struct mtd_part_parser bcm47xxpart_mtd_parser = { | ||||
|  	.parse_fn = bcm47xxpart_parse, | ||||
|  	.name = "bcm47xxpart", | ||||
| +	.of_match_table = bcm47xxpart_of_match_table, | ||||
|  }; | ||||
|  module_mtd_part_parser(bcm47xxpart_mtd_parser); | ||||
|   | ||||
| @@ -0,0 +1,37 @@ | ||||
| From 98534a58c8a40cdc9e3bcb04d74719fbcedfeb52 Mon Sep 17 00:00:00 2001 | ||||
| From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl> | ||||
| Date: Tue, 26 Jun 2018 00:05:08 +0200 | ||||
| Subject: [PATCH] mtd: parsers: trx: add of_match_table with the new DT binding | ||||
| MIME-Version: 1.0 | ||||
| Content-Type: text/plain; charset=UTF-8 | ||||
| Content-Transfer-Encoding: 8bit | ||||
|  | ||||
| This allows using TRX parser to find TRX partitions on flash device | ||||
| described in DT using a proper binding. It's useful for devices storing | ||||
| firmware on a separated flash and having rootfs partition in it. | ||||
|  | ||||
| Signed-off-by: Rafał Miłecki <rafal@milecki.pl> | ||||
| Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> | ||||
| --- | ||||
|  drivers/mtd/parsers/parser_trx.c | 7 +++++++ | ||||
|  1 file changed, 7 insertions(+) | ||||
|  | ||||
| --- a/drivers/mtd/parsers/parser_trx.c | ||||
| +++ b/drivers/mtd/parsers/parser_trx.c | ||||
| @@ -116,9 +116,16 @@ static int parser_trx_parse(struct mtd_i | ||||
|  	return i; | ||||
|  }; | ||||
|   | ||||
| +static const struct of_device_id mtd_parser_trx_of_match_table[] = { | ||||
| +	{ .compatible = "brcm,trx" }, | ||||
| +	{}, | ||||
| +}; | ||||
| +MODULE_DEVICE_TABLE(of, mtd_parser_trx_of_match_table); | ||||
| + | ||||
|  static struct mtd_part_parser mtd_parser_trx = { | ||||
|  	.parse_fn = parser_trx_parse, | ||||
|  	.name = "trx", | ||||
| +	.of_match_table = mtd_parser_trx_of_match_table, | ||||
|  }; | ||||
|  module_mtd_part_parser(mtd_parser_trx); | ||||
|   | ||||
| @@ -0,0 +1,102 @@ | ||||
| From 76a832254ab05502c9394cc51ded6f0abe0e0bee Mon Sep 17 00:00:00 2001 | ||||
| From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl> | ||||
| Date: Fri, 13 Jul 2018 16:32:21 +0200 | ||||
| Subject: [PATCH] mtd: partitions: use DT info for parsing partitions with | ||||
|  "compatible" prop | ||||
| MIME-Version: 1.0 | ||||
| Content-Type: text/plain; charset=UTF-8 | ||||
| Content-Transfer-Encoding: 8bit | ||||
|  | ||||
| So far only flash devices could be described in DT regarding partitions | ||||
| parsing. That could be done with "partitions" subnode and a proper | ||||
| "compatible" string. | ||||
|  | ||||
| Some devices may use hierarchical (multi-level) layouts and may mix used | ||||
| layouts (fixed and dynamic). Describing that in DT is done by specifying | ||||
| "compatible" for DT-represented partition plus optionally more | ||||
| properties and/or subnodes. | ||||
|  | ||||
| To support such layouts each DT partition has to be checked for | ||||
| additional description. | ||||
|  | ||||
| Please note this implementation will work in parallel with support for | ||||
| partition type specified for non-DT setups. That already works since | ||||
| commit 1a0915be1926 ("mtd: partitions: add support for partition | ||||
| parsers"). | ||||
|  | ||||
| Signed-off-by: Rafał Miłecki <rafal@milecki.pl> | ||||
| Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> | ||||
| --- | ||||
|  drivers/mtd/mtdpart.c | 33 +++++++++++++-------------------- | ||||
|  1 file changed, 13 insertions(+), 20 deletions(-) | ||||
|  | ||||
| --- a/drivers/mtd/mtdpart.c | ||||
| +++ b/drivers/mtd/mtdpart.c | ||||
| @@ -370,22 +370,6 @@ static inline void free_partition(struct | ||||
|  	kfree(p); | ||||
|  } | ||||
|   | ||||
| -/** | ||||
| - * mtd_parse_part - parse MTD partition looking for subpartitions | ||||
| - * | ||||
| - * @slave: part that is supposed to be a container and should be parsed | ||||
| - * @types: NULL-terminated array with names of partition parsers to try | ||||
| - * | ||||
| - * Some partitions are kind of containers with extra subpartitions (volumes). | ||||
| - * There can be various formats of such containers. This function tries to use | ||||
| - * specified parsers to analyze given partition and registers found | ||||
| - * subpartitions on success. | ||||
| - */ | ||||
| -static int mtd_parse_part(struct mtd_part *slave, const char *const *types) | ||||
| -{ | ||||
| -	return parse_mtd_partitions(&slave->mtd, types, NULL); | ||||
| -} | ||||
| - | ||||
|  static struct mtd_part *allocate_partition(struct mtd_info *parent, | ||||
|  			const struct mtd_partition *part, int partno, | ||||
|  			uint64_t cur_offset) | ||||
| @@ -783,8 +767,8 @@ int add_mtd_partitions(struct mtd_info * | ||||
|   | ||||
|  		add_mtd_device(&slave->mtd); | ||||
|  		mtd_add_partition_attrs(slave); | ||||
| -		if (parts[i].types) | ||||
| -			mtd_parse_part(slave, parts[i].types); | ||||
| +		/* Look for subpartitions */ | ||||
| +		parse_mtd_partitions(&slave->mtd, parts[i].types, NULL); | ||||
|   | ||||
|  		cur_offset = slave->offset + slave->mtd.size; | ||||
|  	} | ||||
| @@ -860,6 +844,12 @@ static const char * const default_mtd_pa | ||||
|  	NULL | ||||
|  }; | ||||
|   | ||||
| +/* Check DT only when looking for subpartitions. */ | ||||
| +static const char * const default_subpartition_types[] = { | ||||
| +	"ofpart", | ||||
| +	NULL | ||||
| +}; | ||||
| + | ||||
|  static int mtd_part_do_parse(struct mtd_part_parser *parser, | ||||
|  			     struct mtd_info *master, | ||||
|  			     struct mtd_partitions *pparts, | ||||
| @@ -930,7 +920,9 @@ static int mtd_part_of_parse(struct mtd_ | ||||
|  	const char *fixed = "fixed-partitions"; | ||||
|  	int ret, err = 0; | ||||
|   | ||||
| -	np = of_get_child_by_name(mtd_get_of_node(master), "partitions"); | ||||
| +	np = mtd_get_of_node(master); | ||||
| +	if (!mtd_is_partition(master)) | ||||
| +		np = of_get_child_by_name(np, "partitions"); | ||||
|  	of_property_for_each_string(np, "compatible", prop, compat) { | ||||
|  		parser = mtd_part_get_compatible_parser(compat); | ||||
|  		if (!parser) | ||||
| @@ -993,7 +985,8 @@ int parse_mtd_partitions(struct mtd_info | ||||
|  	int ret, err = 0; | ||||
|   | ||||
|  	if (!types) | ||||
| -		types = default_mtd_part_types; | ||||
| +		types = mtd_is_partition(master) ? default_subpartition_types : | ||||
| +			default_mtd_part_types; | ||||
|   | ||||
|  	for ( ; *types; types++) { | ||||
|  		/* | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user