mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-18 17:33:31 +00:00
This commit is contained in:
commit
a8c233486a
@ -184,22 +184,31 @@ menu "Target Images"
|
||||
depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_ISO || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
|
||||
select PACKAGE_grub2
|
||||
default y
|
||||
|
||||
config EFI_IMAGES
|
||||
bool "Build EFI GRUB images (Linux x86 or x86_64 host only)"
|
||||
depends on TARGET_x86
|
||||
depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_ISO || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
|
||||
select PACKAGE_grub2
|
||||
select PACKAGE_grub2-efi
|
||||
default n
|
||||
|
||||
|
||||
config GRUB_CONSOLE
|
||||
bool "Use Console Terminal (in addition to Serial)"
|
||||
depends on GRUB_IMAGES
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
default n if (TARGET_x86_generic_Soekris45xx || TARGET_x86_generic_Soekris48xx || TARGET_x86_net5501 || TARGET_x86_geos || TARGET_x86_alix2)
|
||||
default y
|
||||
|
||||
config GRUB_SERIAL
|
||||
string "Serial port device"
|
||||
depends on GRUB_IMAGES
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
default "hvc0" if TARGET_x86_xen_domu
|
||||
default "ttyS0" if ! TARGET_x86_xen_domu
|
||||
|
||||
config GRUB_BAUDRATE
|
||||
int "Serial port baud rate"
|
||||
depends on GRUB_IMAGES
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
default 38400 if TARGET_x86_generic
|
||||
default 115200
|
||||
|
||||
@ -210,14 +219,14 @@ menu "Target Images"
|
||||
|
||||
config GRUB_BOOTOPTS
|
||||
string "Extra kernel boot options"
|
||||
depends on GRUB_IMAGES
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
default "xencons=hvc" if TARGET_x86_xen_domu
|
||||
help
|
||||
If you don't know, just leave it blank.
|
||||
|
||||
config GRUB_TIMEOUT
|
||||
string "Seconds to wait before booting the default entry"
|
||||
depends on GRUB_IMAGES
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
default "0"
|
||||
help
|
||||
If you don't know, 5 seconds is a reasonable default.
|
||||
@ -225,21 +234,21 @@ menu "Target Images"
|
||||
config VDI_IMAGES
|
||||
bool "Build VirtualBox image files (VDI)"
|
||||
depends on TARGET_x86 || TARGET_x86_64
|
||||
select GRUB_IMAGES
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
select TARGET_IMAGES_PAD
|
||||
select PACKAGE_kmod-e1000
|
||||
|
||||
config VMDK_IMAGES
|
||||
bool "Build VMware image files (VMDK)"
|
||||
depends on TARGET_x86 || TARGET_x86_64
|
||||
select GRUB_IMAGES
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
select TARGET_IMAGES_PAD
|
||||
select PACKAGE_kmod-e1000
|
||||
default y
|
||||
|
||||
config TARGET_IMAGES_PAD
|
||||
bool "Pad images to filesystem size (for JFFS2)"
|
||||
depends on GRUB_IMAGES
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
|
||||
config TARGET_IMAGES_GZIP
|
||||
bool "GZip images"
|
||||
@ -252,19 +261,19 @@ menu "Target Images"
|
||||
|
||||
config TARGET_KERNEL_PARTSIZE
|
||||
int "Kernel partition size (in MB)"
|
||||
depends on GRUB_IMAGES
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
default 8
|
||||
|
||||
config TARGET_ROOTFS_PARTSIZE
|
||||
int "Root filesystem partition size (in MB)"
|
||||
depends on GRUB_IMAGES || TARGET_ROOTFS_EXT4FS || TARGET_rb532 || TARGET_mvebu || TARGET_uml
|
||||
depends on GRUB_IMAGES || EFI_IMAGES || TARGET_ROOTFS_EXT4FS || TARGET_rb532 || TARGET_mvebu || TARGET_uml
|
||||
default 96
|
||||
help
|
||||
Select the root filesystem partition size.
|
||||
|
||||
config TARGET_ROOTFS_PARTNAME
|
||||
string "Root partition on target device"
|
||||
depends on GRUB_IMAGES
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
help
|
||||
Override the root partition on the final device. If left empty,
|
||||
it will be mounted by PARTUUID which makes the kernel find the
|
||||
|
@ -3,12 +3,12 @@
|
||||
LINUX_RELEASE?=1
|
||||
|
||||
LINUX_VERSION-3.18 = .71
|
||||
LINUX_VERSION-4.4 = .92
|
||||
LINUX_VERSION-4.9 = .54
|
||||
LINUX_VERSION-4.4 = .93
|
||||
LINUX_VERSION-4.9 = .57
|
||||
|
||||
LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
|
||||
LINUX_KERNEL_HASH-4.4.92 = 53f8cd8b024444df0f242f8e6ab5147b0b009d7a30e8b2ed3854e8d17937460d
|
||||
LINUX_KERNEL_HASH-4.9.54 = 651005db6efbce4fcd607415ebd697dd8d2f5a2abc2c632b11ece03a1a210fc5
|
||||
LINUX_KERNEL_HASH-4.4.93 = ed349314f16e78a6571b5f8884f6452782aef6c26b81bcc7ccdac44ecd917c36
|
||||
LINUX_KERNEL_HASH-4.9.57 = 09230554ec6a34a12e2d2a6b32733aed3c9bc90b1662cc1b06dd67bf726c96a6
|
||||
|
||||
ifdef KERNEL_PATCHVER
|
||||
LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
|
||||
|
@ -190,7 +190,7 @@ ifeq ($(DUMP),1)
|
||||
CPU_CFLAGS_cortex-a7 = -mcpu=cortex-a7
|
||||
CPU_CFLAGS_cortex-a8 = -mcpu=cortex-a8
|
||||
CPU_CFLAGS_cortex-a9 = -mcpu=cortex-a9
|
||||
CPU_CFLAGS_cortex-a15 = -mcpu=cortex-a15
|
||||
CPU_CFLAGS_cortex-a15 = -mcpu=cortex-a15 -mtune=cortex-a15
|
||||
CPU_CFLAGS_cortex-a53 = -mcpu=cortex-a53
|
||||
CPU_CFLAGS_fa526 = -mcpu=fa526
|
||||
CPU_CFLAGS_mpcore = -mcpu=mpcore
|
||||
|
@ -40,7 +40,7 @@ VERSION_NICK:=$(call qstrip_escape,$(CONFIG_VERSION_NICK))
|
||||
VERSION_NICK:=$(if $(VERSION_NICK),$(VERSION_NICK),$(RELEASE))
|
||||
|
||||
VERSION_REPO:=$(call qstrip_escape,$(CONFIG_VERSION_REPO))
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/releases/17.01.3)
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/releases/17.01.4)
|
||||
|
||||
VERSION_DIST:=$(call qstrip_escape,$(CONFIG_VERSION_DIST))
|
||||
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),LEDE)
|
||||
|
@ -117,6 +117,24 @@ export_bootdevice() {
|
||||
esac
|
||||
|
||||
case "$disk" in
|
||||
PARTUUID=[A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9]-[A-F0-9][A-F0-9][A-F0-9][A-F0-9]-[A-F0-9][A-F0-9][A-F0-9][A-F0-9]-[A-F0-9][A-F0-9][A-F0-9][A-F0-9]-[A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9]0002)
|
||||
uuid="${disk#PARTUUID=}"
|
||||
uuid="${uuid%0002}0002"
|
||||
for disk in $(find /dev -type b); do
|
||||
set -- $(dd if=$disk bs=1 skip=$((2*512+256+128+16)) count=16 2>/dev/null | hexdump -v -e '4/1 "%02x"' | awk '{ \
|
||||
for(i=1;i<9;i=i+2) first=substr($0,i,1) substr($0,i+1,1) first; \
|
||||
for(i=9;i<13;i=i+2) second=substr($0,i,1) substr($0,i+1,1) second; \
|
||||
for(i=13;i<16;i=i+2) third=substr($0,i,1) substr($0,i+1,1) third; \
|
||||
fourth = substr($0,17,4); \
|
||||
five = substr($0,21,12); \
|
||||
} END { print toupper(first"-"second"-"third"-"fourth"-"five) }')
|
||||
if [ "$1" = "$uuid" ]; then
|
||||
uevent="/sys/class/block/${disk##*/}/uevent"
|
||||
export SAVE_PARTITIONS=0
|
||||
break
|
||||
fi
|
||||
done
|
||||
;;
|
||||
PARTUUID=[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]-02)
|
||||
uuid="${disk#PARTUUID=}"
|
||||
uuid="${uuid%-02}"
|
||||
|
@ -1,33 +1,24 @@
|
||||
#
|
||||
# Copyright (C) 2006-2015 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=grub
|
||||
PKG_VERSION:=2.02
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE:=grub-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@GNU/grub
|
||||
PKG_HASH:=810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
HOST_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_DEPENDS:=grub2/host
|
||||
|
||||
PKG_SSP:=0
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
PATCH_DIR := ../patches
|
||||
HOST_PATCH_DIR := ../patches
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/grub2
|
||||
define Package/grub2/Default
|
||||
CATEGORY:=Boot Loaders
|
||||
SECTION:=boot
|
||||
TITLE:=GRand Unified Bootloader
|
||||
@ -35,19 +26,6 @@ define Package/grub2
|
||||
DEPENDS:=@TARGET_x86||TARGET_x86_64
|
||||
endef
|
||||
|
||||
define Package/grub2-editenv
|
||||
CATEGORY:=Utilities
|
||||
SECTION:=utils
|
||||
SUBMENU:=Boot Loaders
|
||||
TITLE:=Grub2 Environment editor
|
||||
URL:=http://www.gnu.org/software/grub/
|
||||
DEPENDS:=@TARGET_x86||TARGET_x86_64
|
||||
endef
|
||||
|
||||
define Package/grub2-editenv/description
|
||||
Edit grub2 environment files.
|
||||
endef
|
||||
|
||||
HOST_BUILD_PREFIX := $(STAGING_DIR_HOST)
|
||||
|
||||
CONFIGURE_VARS += \
|
||||
@ -81,11 +59,3 @@ define Host/Configure
|
||||
$(Host/Configure/Default)
|
||||
endef
|
||||
|
||||
define Package/grub2-editenv/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-editenv $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
$(eval $(call BuildPackage,grub2))
|
||||
$(eval $(call BuildPackage,grub2-editenv))
|
22
package/boot/grub2/grub2-efi/Makefile
Normal file
22
package/boot/grub2/grub2-efi/Makefile
Normal file
@ -0,0 +1,22 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=grub-efi
|
||||
|
||||
include ../common.mk
|
||||
|
||||
TAR_OPTIONS:= --transform 's/grub-${PKG_VERSION}/${PKG_NAME}-${PKG_VERSION}/' $(TAR_OPTIONS)
|
||||
|
||||
PKG_BUILD_DEPENDS:=grub2-efi/host
|
||||
|
||||
CONFIGURE_ARGS += --with-platform=efi
|
||||
HOST_CONFIGURE_ARGS += --with-platform=efi --program-suffix=-efi
|
||||
|
||||
define Package/grub2-efi
|
||||
$(call Package/grub2/Default)
|
||||
HIDDEN:=1
|
||||
TITLE += (with EFI support)
|
||||
endef
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
$(eval $(call BuildPackage,grub2-efi))
|
33
package/boot/grub2/grub2/Makefile
Normal file
33
package/boot/grub2/grub2/Makefile
Normal file
@ -0,0 +1,33 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=grub
|
||||
|
||||
include ../common.mk
|
||||
|
||||
PKG_BUILD_DEPENDS:=grub2/host
|
||||
|
||||
define Package/grub2
|
||||
$(call Package/grub2/Default)
|
||||
endef
|
||||
|
||||
define Package/grub2-editenv
|
||||
CATEGORY:=Utilities
|
||||
SECTION:=utils
|
||||
TITLE:=Grub2 Environment editor
|
||||
URL:=http://www.gnu.org/software/grub/
|
||||
DEPENDS:=@TARGET_x86||TARGET_x86_64
|
||||
endef
|
||||
|
||||
define Package/grub2-editenv/description
|
||||
Edit grub2 environment files.
|
||||
endef
|
||||
|
||||
define Package/grub2-editenv/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-editenv $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
$(eval $(call BuildPackage,grub2))
|
||||
$(eval $(call BuildPackage,grub2-editenv))
|
@ -1,14 +1,15 @@
|
||||
--- a/driver/nvram_stub.c
|
||||
+++ b/driver/nvram_stub.c
|
||||
@@ -5,6 +5,7 @@
|
||||
@@ -5,6 +5,8 @@
|
||||
#include <siutils.h>
|
||||
#include <bcmendian.h>
|
||||
#include <bcmnvram.h>
|
||||
+#include <proto/ethernet.h>
|
||||
+#include <linux/errno.h>
|
||||
|
||||
#ifdef BCMDBG_ERR
|
||||
#define NVR_MSG(x) printf x
|
||||
@@ -24,6 +25,7 @@ typedef struct _vars {
|
||||
@@ -24,6 +26,7 @@ typedef struct _vars {
|
||||
static vars_t *vars = NULL;
|
||||
static int nvram_init_done = 0;
|
||||
extern char *nvram_buf[];
|
||||
@ -16,7 +17,7 @@
|
||||
|
||||
int
|
||||
BCMATTACHFN(nvram_init)(void *si)
|
||||
@@ -55,6 +57,7 @@ BCMATTACHFN(nvram_init)(void *si)
|
||||
@@ -55,6 +58,7 @@ BCMATTACHFN(nvram_init)(void *si)
|
||||
vars = new;
|
||||
|
||||
bcopy((char *)(&nvh[1]), new->vars, nvs);
|
||||
@ -24,7 +25,7 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -164,3 +167,65 @@ nvram_getall(char *buf, int count)
|
||||
@@ -164,3 +168,65 @@ nvram_getall(char *buf, int count)
|
||||
*buf = '\0';
|
||||
return 0;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=default-settings
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=22
|
||||
PKG_RELEASE:=23
|
||||
PKG_LICENSE:=GPLv3
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
|
@ -47,9 +47,9 @@ sed -i '/set wireless.radio${devidx}.disabled/d' /lib/wifi/mac80211.sh
|
||||
wifi up
|
||||
|
||||
sed -i '/DISTRIB_REVISION/d' /etc/openwrt_release
|
||||
echo "DISTRIB_REVISION='R7.4.2 By Lean'" >> /etc/openwrt_release
|
||||
echo "DISTRIB_REVISION='R7.4.3 By Lean'" >> /etc/openwrt_release
|
||||
sed -i '/DISTRIB_DESCRIPTION/d' /etc/openwrt_release
|
||||
echo "DISTRIB_DESCRIPTION='LEDE 17.01.3'" >> /etc/openwrt_release
|
||||
echo "DISTRIB_DESCRIPTION='LEDE 17.01.4'" >> /etc/openwrt_release
|
||||
|
||||
exit 0
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ipset-lists
|
||||
PKG_VERSION:=20161112
|
||||
PKG_RELEASE:=
|
||||
PKG_VERSION:=20171019
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
@ -17,7 +17,7 @@ define Package/ipset-lists
|
||||
CATEGORY:=Network
|
||||
TITLE:=Service for IPSET address tables
|
||||
MAINTAINER:=Justin Liu <rssnsj@gmail.com>
|
||||
DEPENDS:=+ipset +luci
|
||||
DEPENDS:=+ipset
|
||||
endef
|
||||
|
||||
define Package/ipset-lists/conffiles
|
||||
|
@ -7,7 +7,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostapd
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_SOURCE_URL:=http://w1.fi/hostap.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
|
@ -149,6 +149,7 @@ hostapd_common_add_bss_config() {
|
||||
config_add_int \
|
||||
wep_rekey eap_reauth_period \
|
||||
wpa_group_rekey wpa_pair_rekey wpa_master_rekey
|
||||
config_add_boolean wpa_disable_eapol_key_retries
|
||||
|
||||
config_add_boolean rsn_preauth auth_cache
|
||||
config_add_int ieee80211w
|
||||
@ -214,6 +215,7 @@ hostapd_set_bss_options() {
|
||||
|
||||
json_get_vars \
|
||||
wep_rekey wpa_group_rekey wpa_pair_rekey wpa_master_rekey \
|
||||
wpa_disable_eapol_key_retries \
|
||||
maxassoc max_inactivity disassoc_low_ack isolate auth_cache \
|
||||
wps_pushbutton wps_label ext_registrar wps_pbc_in_m1 wps_ap_setup_locked \
|
||||
wps_independent wps_device_type wps_device_name wps_manufacturer wps_pin \
|
||||
@ -229,6 +231,7 @@ hostapd_set_bss_options() {
|
||||
set_default hidden 0
|
||||
set_default wmm 1
|
||||
set_default uapsd 1
|
||||
set_default wpa_disable_eapol_key_retries 0
|
||||
set_default eapol_version 0
|
||||
set_default acct_port 1813
|
||||
|
||||
@ -416,6 +419,8 @@ hostapd_set_bss_options() {
|
||||
done
|
||||
fi
|
||||
|
||||
append bss_conf "wpa_disable_eapol_key_retries=$wpa_disable_eapol_key_retries" "$N"
|
||||
|
||||
hostapd_append_wpa_key_mgmt
|
||||
[ -n "$wpa_key_mgmt" ] && append bss_conf "wpa_key_mgmt=$wpa_key_mgmt" "$N"
|
||||
fi
|
||||
|
@ -0,0 +1,34 @@
|
||||
From a00e946c1c9a1f9cc65c72900d2a444ceb1f872e Mon Sep 17 00:00:00 2001
|
||||
From: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
|
||||
Date: Thu, 5 Oct 2017 23:53:01 +0200
|
||||
Subject: [PATCH] WPA: Extra defense against PTK reinstalls in 4-way handshake
|
||||
|
||||
Currently, reinstallations of the PTK are prevented by (1) assuring the
|
||||
same TPTK is only set once as the PTK, and (2) that one particular PTK
|
||||
is only installed once. This patch makes it more explicit that point (1)
|
||||
is required to prevent key reinstallations. At the same time, this patch
|
||||
hardens wpa_supplicant such that future changes do not accidentally
|
||||
break this property.
|
||||
|
||||
Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
|
||||
---
|
||||
src/rsn_supp/wpa.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
--- a/src/rsn_supp/wpa.c
|
||||
+++ b/src/rsn_supp/wpa.c
|
||||
@@ -1728,6 +1728,14 @@ static int wpa_supplicant_verify_eapol_k
|
||||
sm->ptk_set = 1;
|
||||
os_memcpy(&sm->ptk, &sm->tptk, sizeof(sm->ptk));
|
||||
os_memset(&sm->tptk, 0, sizeof(sm->tptk));
|
||||
+ /*
|
||||
+ * This assures the same TPTK in sm->tptk can never be
|
||||
+ * copied twice to sm->pkt as the new PTK. In
|
||||
+ * combination with the installed flag in the wpa_ptk
|
||||
+ * struct, this assures the same PTK is only installed
|
||||
+ * once.
|
||||
+ */
|
||||
+ sm->renew_snonce = 1;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,53 @@
|
||||
From b488a12948751f57871f09baa345e59b23959a41 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Sun, 8 Oct 2017 13:18:02 +0300
|
||||
Subject: [PATCH] Clear PMK length and check for this when deriving PTK
|
||||
|
||||
Instead of setting the default PMK length for the cleared PMK, set the
|
||||
length to 0 and explicitly check for this when deriving PTK to avoid
|
||||
unexpected key derivation with an all-zeroes key should it be possible
|
||||
to somehow trigger PTK derivation to happen before PMK derivation.
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
---
|
||||
src/common/wpa_common.c | 5 +++++
|
||||
src/rsn_supp/wpa.c | 7 ++++---
|
||||
2 files changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/src/common/wpa_common.c
|
||||
+++ b/src/common/wpa_common.c
|
||||
@@ -225,6 +225,11 @@ int wpa_pmk_to_ptk(const u8 *pmk, size_t
|
||||
u8 tmp[WPA_KCK_MAX_LEN + WPA_KEK_MAX_LEN + WPA_TK_MAX_LEN];
|
||||
size_t ptk_len;
|
||||
|
||||
+ if (pmk_len == 0) {
|
||||
+ wpa_printf(MSG_ERROR, "WPA: No PMK set for PT derivation");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
if (os_memcmp(addr1, addr2, ETH_ALEN) < 0) {
|
||||
os_memcpy(data, addr1, ETH_ALEN);
|
||||
os_memcpy(data + ETH_ALEN, addr2, ETH_ALEN);
|
||||
--- a/src/rsn_supp/wpa.c
|
||||
+++ b/src/rsn_supp/wpa.c
|
||||
@@ -584,7 +584,8 @@ static void wpa_supplicant_process_1_of_
|
||||
/* Calculate PTK which will be stored as a temporary PTK until it has
|
||||
* been verified when processing message 3/4. */
|
||||
ptk = &sm->tptk;
|
||||
- wpa_derive_ptk(sm, src_addr, key, ptk);
|
||||
+ if (wpa_derive_ptk(sm, src_addr, key, ptk) < 0)
|
||||
+ goto failed;
|
||||
if (sm->pairwise_cipher == WPA_CIPHER_TKIP) {
|
||||
u8 buf[8];
|
||||
/* Supplicant: swap tx/rx Mic keys */
|
||||
@@ -2705,8 +2706,8 @@ void wpa_sm_set_pmk_from_pmksa(struct wp
|
||||
sm->pmk_len = sm->cur_pmksa->pmk_len;
|
||||
os_memcpy(sm->pmk, sm->cur_pmksa->pmk, sm->pmk_len);
|
||||
} else {
|
||||
- sm->pmk_len = PMK_LEN;
|
||||
- os_memset(sm->pmk, 0, PMK_LEN);
|
||||
+ sm->pmk_len = 0;
|
||||
+ os_memset(sm->pmk, 0, PMK_LEN_MAX);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,221 @@
|
||||
From 6f234c1e2ee1ede29f2412b7012b3345ed8e52d3 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Mon, 16 Oct 2017 18:37:43 +0300
|
||||
Subject: [PATCH] Optional AP side workaround for key reinstallation attacks
|
||||
|
||||
This adds a new hostapd configuration parameter
|
||||
wpa_disable_eapol_key_retries=1 that can be used to disable
|
||||
retransmission of EAPOL-Key frames that are used to install
|
||||
keys (EAPOL-Key message 3/4 and group message 1/2). This is
|
||||
similar to setting wpa_group_update_count=1 and
|
||||
wpa_pairwise_update_count=1, but with no impact to message 1/4
|
||||
retries and with extended timeout for messages 4/4 and group
|
||||
message 2/2 to avoid causing issues with stations that may use
|
||||
aggressive power saving have very long time in replying to the
|
||||
EAPOL-Key messages.
|
||||
|
||||
This option can be used to work around key reinstallation attacks
|
||||
on the station (supplicant) side in cases those station devices
|
||||
cannot be updated for some reason. By removing the
|
||||
retransmissions the attacker cannot cause key reinstallation with
|
||||
a delayed frame transmission. This is related to the station side
|
||||
vulnerabilities CVE-2017-13077, CVE-2017-13078, CVE-2017-13079,
|
||||
CVE-2017-13080, and CVE-2017-13081.
|
||||
|
||||
This workaround might cause interoperability issues and reduced
|
||||
robustness of key negotiation especially in environments with
|
||||
heavy traffic load due to the number of attempts to perform the
|
||||
key exchange is reduced significantly. As such, this workaround
|
||||
is disabled by default (unless overridden in build
|
||||
configuration). To enable this, set the parameter to 1.
|
||||
|
||||
It is also possible to enable this in the build by default by
|
||||
adding the following to the build configuration:
|
||||
|
||||
CFLAGS += -DDEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES=1
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
---
|
||||
hostapd/config_file.c | 2 ++
|
||||
hostapd/defconfig | 4 ++++
|
||||
hostapd/hostapd.conf | 24 ++++++++++++++++++++++++
|
||||
src/ap/ap_config.c | 6 ++++++
|
||||
src/ap/ap_config.h | 1 +
|
||||
src/ap/wpa_auth.c | 22 ++++++++++++++++++++--
|
||||
src/ap/wpa_auth.h | 1 +
|
||||
src/ap/wpa_auth_glue.c | 2 ++
|
||||
8 files changed, 60 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -2542,6 +2542,8 @@ static int hostapd_config_fill(struct ho
|
||||
return 1;
|
||||
}
|
||||
bss->wpa_pairwise_update_count = (u32) val;
|
||||
+ } else if (os_strcmp(buf, "wpa_disable_eapol_key_retries") == 0) {
|
||||
+ bss->wpa_disable_eapol_key_retries = atoi(pos);
|
||||
} else if (os_strcmp(buf, "wpa_passphrase") == 0) {
|
||||
int len = os_strlen(pos);
|
||||
if (len < 8 || len > 63) {
|
||||
--- a/hostapd/defconfig
|
||||
+++ b/hostapd/defconfig
|
||||
@@ -372,3 +372,7 @@ CONFIG_IPV6=y
|
||||
# Opportunistic Wireless Encryption (OWE)
|
||||
# Experimental implementation of draft-harkins-owe-07.txt
|
||||
#CONFIG_OWE=y
|
||||
+
|
||||
+# Override default value for the wpa_disable_eapol_key_retries configuration
|
||||
+# parameter. See that parameter in hostapd.conf for more details.
|
||||
+#CFLAGS += -DDEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES=1
|
||||
--- a/hostapd/hostapd.conf
|
||||
+++ b/hostapd/hostapd.conf
|
||||
@@ -1315,6 +1315,30 @@ own_ip_addr=127.0.0.1
|
||||
# Range 1..4294967295; default: 4
|
||||
#wpa_pairwise_update_count=4
|
||||
|
||||
+# Workaround for key reinstallation attacks
|
||||
+#
|
||||
+# This parameter can be used to disable retransmission of EAPOL-Key frames that
|
||||
+# are used to install keys (EAPOL-Key message 3/4 and group message 1/2). This
|
||||
+# is similar to setting wpa_group_update_count=1 and
|
||||
+# wpa_pairwise_update_count=1, but with no impact to message 1/4 and with
|
||||
+# extended timeout on the response to avoid causing issues with stations that
|
||||
+# may use aggressive power saving have very long time in replying to the
|
||||
+# EAPOL-Key messages.
|
||||
+#
|
||||
+# This option can be used to work around key reinstallation attacks on the
|
||||
+# station (supplicant) side in cases those station devices cannot be updated
|
||||
+# for some reason. By removing the retransmissions the attacker cannot cause
|
||||
+# key reinstallation with a delayed frame transmission. This is related to the
|
||||
+# station side vulnerabilities CVE-2017-13077, CVE-2017-13078, CVE-2017-13079,
|
||||
+# CVE-2017-13080, and CVE-2017-13081.
|
||||
+#
|
||||
+# This workaround might cause interoperability issues and reduced robustness of
|
||||
+# key negotiation especially in environments with heavy traffic load due to the
|
||||
+# number of attempts to perform the key exchange is reduced significantly. As
|
||||
+# such, this workaround is disabled by default (unless overridden in build
|
||||
+# configuration). To enable this, set the parameter to 1.
|
||||
+#wpa_disable_eapol_key_retries=1
|
||||
+
|
||||
# Enable IEEE 802.11i/RSN/WPA2 pre-authentication. This is used to speed up
|
||||
# roaming be pre-authenticating IEEE 802.1X/EAP part of the full RSN
|
||||
# authentication and key handshake before actually associating with a new AP.
|
||||
--- a/src/ap/ap_config.c
|
||||
+++ b/src/ap/ap_config.c
|
||||
@@ -37,6 +37,10 @@ static void hostapd_config_free_vlan(str
|
||||
}
|
||||
|
||||
|
||||
+#ifndef DEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES
|
||||
+#define DEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES 0
|
||||
+#endif /* DEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES */
|
||||
+
|
||||
void hostapd_config_defaults_bss(struct hostapd_bss_config *bss)
|
||||
{
|
||||
dl_list_init(&bss->anqp_elem);
|
||||
@@ -58,6 +62,8 @@ void hostapd_config_defaults_bss(struct
|
||||
bss->wpa_gmk_rekey = 86400;
|
||||
bss->wpa_group_update_count = 4;
|
||||
bss->wpa_pairwise_update_count = 4;
|
||||
+ bss->wpa_disable_eapol_key_retries =
|
||||
+ DEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES;
|
||||
bss->wpa_key_mgmt = WPA_KEY_MGMT_PSK;
|
||||
bss->wpa_pairwise = WPA_CIPHER_TKIP;
|
||||
bss->wpa_group = WPA_CIPHER_TKIP;
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -333,6 +333,7 @@ struct hostapd_bss_config {
|
||||
int wpa_ptk_rekey;
|
||||
u32 wpa_group_update_count;
|
||||
u32 wpa_pairwise_update_count;
|
||||
+ int wpa_disable_eapol_key_retries;
|
||||
int rsn_pairwise;
|
||||
int rsn_preauth;
|
||||
char *rsn_preauth_interfaces;
|
||||
--- a/src/ap/wpa_auth.c
|
||||
+++ b/src/ap/wpa_auth.c
|
||||
@@ -65,6 +65,7 @@ static u8 * ieee80211w_kde_add(struct wp
|
||||
static const u32 eapol_key_timeout_first = 100; /* ms */
|
||||
static const u32 eapol_key_timeout_subseq = 1000; /* ms */
|
||||
static const u32 eapol_key_timeout_first_group = 500; /* ms */
|
||||
+static const u32 eapol_key_timeout_no_retrans = 4000; /* ms */
|
||||
|
||||
/* TODO: make these configurable */
|
||||
static const int dot11RSNAConfigPMKLifetime = 43200;
|
||||
@@ -1653,6 +1654,9 @@ static void wpa_send_eapol(struct wpa_au
|
||||
eapol_key_timeout_first_group;
|
||||
else
|
||||
timeout_ms = eapol_key_timeout_subseq;
|
||||
+ if (wpa_auth->conf.wpa_disable_eapol_key_retries &&
|
||||
+ (!pairwise || (key_info & WPA_KEY_INFO_MIC)))
|
||||
+ timeout_ms = eapol_key_timeout_no_retrans;
|
||||
if (pairwise && ctr == 1 && !(key_info & WPA_KEY_INFO_MIC))
|
||||
sm->pending_1_of_4_timeout = 1;
|
||||
wpa_printf(MSG_DEBUG, "WPA: Use EAPOL-Key timeout of %u ms (retry "
|
||||
@@ -2882,6 +2886,11 @@ SM_STATE(WPA_PTK, PTKINITNEGOTIATING)
|
||||
sm->TimeoutEvt = FALSE;
|
||||
|
||||
sm->TimeoutCtr++;
|
||||
+ if (sm->wpa_auth->conf.wpa_disable_eapol_key_retries &&
|
||||
+ sm->TimeoutCtr > 1) {
|
||||
+ /* Do not allow retransmission of EAPOL-Key msg 3/4 */
|
||||
+ return;
|
||||
+ }
|
||||
if (sm->TimeoutCtr > sm->wpa_auth->conf.wpa_pairwise_update_count) {
|
||||
/* No point in sending the EAPOL-Key - we will disconnect
|
||||
* immediately following this. */
|
||||
@@ -3220,7 +3229,9 @@ SM_STEP(WPA_PTK)
|
||||
sm->EAPOLKeyPairwise && sm->MICVerified)
|
||||
SM_ENTER(WPA_PTK, PTKINITDONE);
|
||||
else if (sm->TimeoutCtr >
|
||||
- sm->wpa_auth->conf.wpa_pairwise_update_count) {
|
||||
+ sm->wpa_auth->conf.wpa_pairwise_update_count ||
|
||||
+ (sm->wpa_auth->conf.wpa_disable_eapol_key_retries &&
|
||||
+ sm->TimeoutCtr > 1)) {
|
||||
wpa_auth->dot11RSNA4WayHandshakeFailures++;
|
||||
wpa_auth_vlogger(
|
||||
sm->wpa_auth, sm->addr, LOGGER_DEBUG,
|
||||
@@ -3260,6 +3271,11 @@ SM_STATE(WPA_PTK_GROUP, REKEYNEGOTIATING
|
||||
SM_ENTRY_MA(WPA_PTK_GROUP, REKEYNEGOTIATING, wpa_ptk_group);
|
||||
|
||||
sm->GTimeoutCtr++;
|
||||
+ if (sm->wpa_auth->conf.wpa_disable_eapol_key_retries &&
|
||||
+ sm->GTimeoutCtr > 1) {
|
||||
+ /* Do not allow retransmission of EAPOL-Key group msg 1/2 */
|
||||
+ return;
|
||||
+ }
|
||||
if (sm->GTimeoutCtr > sm->wpa_auth->conf.wpa_group_update_count) {
|
||||
/* No point in sending the EAPOL-Key - we will disconnect
|
||||
* immediately following this. */
|
||||
@@ -3363,7 +3379,9 @@ SM_STEP(WPA_PTK_GROUP)
|
||||
!sm->EAPOLKeyPairwise && sm->MICVerified)
|
||||
SM_ENTER(WPA_PTK_GROUP, REKEYESTABLISHED);
|
||||
else if (sm->GTimeoutCtr >
|
||||
- sm->wpa_auth->conf.wpa_group_update_count)
|
||||
+ sm->wpa_auth->conf.wpa_group_update_count ||
|
||||
+ (sm->wpa_auth->conf.wpa_disable_eapol_key_retries &&
|
||||
+ sm->GTimeoutCtr > 1))
|
||||
SM_ENTER(WPA_PTK_GROUP, KEYERROR);
|
||||
else if (sm->TimeoutEvt)
|
||||
SM_ENTER(WPA_PTK_GROUP, REKEYNEGOTIATING);
|
||||
--- a/src/ap/wpa_auth.h
|
||||
+++ b/src/ap/wpa_auth.h
|
||||
@@ -165,6 +165,7 @@ struct wpa_auth_config {
|
||||
int wpa_ptk_rekey;
|
||||
u32 wpa_group_update_count;
|
||||
u32 wpa_pairwise_update_count;
|
||||
+ int wpa_disable_eapol_key_retries;
|
||||
int rsn_pairwise;
|
||||
int rsn_preauth;
|
||||
int eapol_version;
|
||||
--- a/src/ap/wpa_auth_glue.c
|
||||
+++ b/src/ap/wpa_auth_glue.c
|
||||
@@ -45,6 +45,8 @@ static void hostapd_wpa_auth_conf(struct
|
||||
wconf->wpa_gmk_rekey = conf->wpa_gmk_rekey;
|
||||
wconf->wpa_ptk_rekey = conf->wpa_ptk_rekey;
|
||||
wconf->wpa_group_update_count = conf->wpa_group_update_count;
|
||||
+ wconf->wpa_disable_eapol_key_retries =
|
||||
+ conf->wpa_disable_eapol_key_retries;
|
||||
wconf->wpa_pairwise_update_count = conf->wpa_pairwise_update_count;
|
||||
wconf->rsn_pairwise = conf->rsn_pairwise;
|
||||
wconf->rsn_preauth = conf->rsn_preauth;
|
@ -0,0 +1,100 @@
|
||||
From a6ea665300919d6a3af22b1f4237203647fda93a Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Tue, 17 Oct 2017 00:01:11 +0300
|
||||
Subject: [PATCH] Additional consistentcy checks for PTK component lengths
|
||||
|
||||
Verify that TK, KCK, and KEK lengths are set to consistent values within
|
||||
struct wpa_ptk before using them in supplicant. This is an additional
|
||||
layer of protection against unexpected states.
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
---
|
||||
src/common/wpa_common.c | 6 ++++++
|
||||
src/rsn_supp/wpa.c | 26 ++++++++++++++++++++------
|
||||
2 files changed, 26 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/src/common/wpa_common.c
|
||||
+++ b/src/common/wpa_common.c
|
||||
@@ -100,6 +100,12 @@ int wpa_eapol_key_mic(const u8 *key, siz
|
||||
{
|
||||
u8 hash[SHA512_MAC_LEN];
|
||||
|
||||
+ if (key_len == 0) {
|
||||
+ wpa_printf(MSG_DEBUG,
|
||||
+ "WPA: KCK not set - cannot calculate MIC");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
switch (ver) {
|
||||
#ifndef CONFIG_FIPS
|
||||
case WPA_KEY_INFO_TYPE_HMAC_MD5_RC4:
|
||||
--- a/src/rsn_supp/wpa.c
|
||||
+++ b/src/rsn_supp/wpa.c
|
||||
@@ -725,6 +725,11 @@ static int wpa_supplicant_install_ptk(st
|
||||
|
||||
alg = wpa_cipher_to_alg(sm->pairwise_cipher);
|
||||
keylen = wpa_cipher_key_len(sm->pairwise_cipher);
|
||||
+ if (keylen <= 0 || (unsigned int) keylen != sm->ptk.tk_len) {
|
||||
+ wpa_printf(MSG_DEBUG, "WPA: TK length mismatch: %d != %lu",
|
||||
+ keylen, (long unsigned int) sm->ptk.tk_len);
|
||||
+ return -1;
|
||||
+ }
|
||||
rsclen = wpa_cipher_rsc_len(sm->pairwise_cipher);
|
||||
|
||||
if (sm->proto == WPA_PROTO_RSN || sm->proto == WPA_PROTO_OSEN) {
|
||||
@@ -745,6 +750,7 @@ static int wpa_supplicant_install_ptk(st
|
||||
|
||||
/* TK is not needed anymore in supplicant */
|
||||
os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN);
|
||||
+ sm->ptk.tk_len = 0;
|
||||
sm->ptk.installed = 1;
|
||||
|
||||
if (sm->wpa_ptk_rekey) {
|
||||
@@ -1717,9 +1723,10 @@ static int wpa_supplicant_verify_eapol_k
|
||||
os_memcpy(mic, key + 1, mic_len);
|
||||
if (sm->tptk_set) {
|
||||
os_memset(key + 1, 0, mic_len);
|
||||
- wpa_eapol_key_mic(sm->tptk.kck, sm->tptk.kck_len, sm->key_mgmt,
|
||||
- ver, buf, len, (u8 *) (key + 1));
|
||||
- if (os_memcmp_const(mic, key + 1, mic_len) != 0) {
|
||||
+ if (wpa_eapol_key_mic(sm->tptk.kck, sm->tptk.kck_len,
|
||||
+ sm->key_mgmt,
|
||||
+ ver, buf, len, (u8 *) (key + 1)) < 0 ||
|
||||
+ os_memcmp_const(mic, key + 1, mic_len) != 0) {
|
||||
wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
|
||||
"WPA: Invalid EAPOL-Key MIC "
|
||||
"when using TPTK - ignoring TPTK");
|
||||
@@ -1742,9 +1749,10 @@ static int wpa_supplicant_verify_eapol_k
|
||||
|
||||
if (!ok && sm->ptk_set) {
|
||||
os_memset(key + 1, 0, mic_len);
|
||||
- wpa_eapol_key_mic(sm->ptk.kck, sm->ptk.kck_len, sm->key_mgmt,
|
||||
- ver, buf, len, (u8 *) (key + 1));
|
||||
- if (os_memcmp_const(mic, key + 1, mic_len) != 0) {
|
||||
+ if (wpa_eapol_key_mic(sm->ptk.kck, sm->ptk.kck_len,
|
||||
+ sm->key_mgmt,
|
||||
+ ver, buf, len, (u8 *) (key + 1)) < 0 ||
|
||||
+ os_memcmp_const(mic, key + 1, mic_len) != 0) {
|
||||
wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
|
||||
"WPA: Invalid EAPOL-Key MIC - "
|
||||
"dropping packet");
|
||||
@@ -4167,6 +4175,11 @@ int fils_process_assoc_resp(struct wpa_s
|
||||
|
||||
alg = wpa_cipher_to_alg(sm->pairwise_cipher);
|
||||
keylen = wpa_cipher_key_len(sm->pairwise_cipher);
|
||||
+ if (keylen <= 0 || (unsigned int) keylen != sm->ptk.tk_len) {
|
||||
+ wpa_printf(MSG_DEBUG, "FILS: TK length mismatch: %u != %lu",
|
||||
+ keylen, (long unsigned int) sm->ptk.tk_len);
|
||||
+ goto fail;
|
||||
+ }
|
||||
rsclen = wpa_cipher_rsc_len(sm->pairwise_cipher);
|
||||
wpa_hexdump_key(MSG_DEBUG, "FILS: Set TK to driver",
|
||||
sm->ptk.tk, keylen);
|
||||
@@ -4183,6 +4196,7 @@ int fils_process_assoc_resp(struct wpa_s
|
||||
* takes care of association frame encryption/decryption. */
|
||||
/* TK is not needed anymore in supplicant */
|
||||
os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN);
|
||||
+ sm->ptk.tk_len = 0;
|
||||
sm->ptk.installed = 1;
|
||||
|
||||
/* FILS HLP Container */
|
@ -0,0 +1,25 @@
|
||||
From c0fe5f125a9d4a6564e1f4956ccc3809bf2fd69d Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Tue, 17 Oct 2017 01:15:24 +0300
|
||||
Subject: [PATCH] Clear BSSID information in supplicant state machine on
|
||||
disconnection
|
||||
|
||||
This fixes a corner case where RSN pre-authentication candidate from
|
||||
scan results was ignored if the station was associated with that BSS
|
||||
just before running the new scan for the connection.
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
---
|
||||
src/rsn_supp/wpa.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/src/rsn_supp/wpa.c
|
||||
+++ b/src/rsn_supp/wpa.c
|
||||
@@ -2662,6 +2662,7 @@ void wpa_sm_notify_disassoc(struct wpa_s
|
||||
wpa_sm_drop_sa(sm);
|
||||
|
||||
sm->msg_3_of_4_ok = 0;
|
||||
+ os_memset(sm->bssid, 0, ETH_ALEN);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -3014,6 +3014,10 @@ static int hostapd_config_fill(struct ho
|
||||
@@ -3016,6 +3016,10 @@ static int hostapd_config_fill(struct ho
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
#ifdef CONFIG_IEEE80211N
|
||||
@ -13,7 +13,7 @@
|
||||
} else if (os_strcmp(buf, "ht_capab") == 0) {
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -734,6 +734,8 @@ struct hostapd_config {
|
||||
@@ -735,6 +735,8 @@ struct hostapd_config {
|
||||
|
||||
int ht_op_mode_fixed;
|
||||
u16 ht_capab;
|
||||
|
@ -129,7 +129,7 @@
|
||||
static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx)
|
||||
--- a/src/ap/wpa_auth.c
|
||||
+++ b/src/ap/wpa_auth.c
|
||||
@@ -3762,6 +3762,7 @@ static const char * wpa_bool_txt(int val
|
||||
@@ -3780,6 +3780,7 @@ static const char * wpa_bool_txt(int val
|
||||
return val ? "TRUE" : "FALSE";
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@
|
||||
|
||||
#define RSN_SUITE "%02x-%02x-%02x-%d"
|
||||
#define RSN_SUITE_ARG(s) \
|
||||
@@ -3906,7 +3907,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
|
||||
@@ -3924,7 +3925,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
|
||||
|
||||
return len;
|
||||
}
|
||||
@ -148,7 +148,7 @@
|
||||
{
|
||||
--- a/src/rsn_supp/wpa.c
|
||||
+++ b/src/rsn_supp/wpa.c
|
||||
@@ -2339,6 +2339,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
|
||||
@@ -2356,6 +2356,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
|
||||
}
|
||||
|
||||
|
||||
@ -157,7 +157,7 @@
|
||||
#define RSN_SUITE "%02x-%02x-%02x-%d"
|
||||
#define RSN_SUITE_ARG(s) \
|
||||
((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
|
||||
@@ -2422,6 +2424,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
|
||||
@@ -2439,6 +2441,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
|
||||
|
||||
return (int) len;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/src/common/wpa_common.c
|
||||
+++ b/src/common/wpa_common.c
|
||||
@@ -1664,6 +1664,31 @@ u32 wpa_akm_to_suite(int akm)
|
||||
@@ -1675,6 +1675,31 @@ u32 wpa_akm_to_suite(int akm)
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
int wpa_compare_rsn_ie(int ft_initial_assoc,
|
||||
const u8 *ie1, size_t ie1len,
|
||||
const u8 *ie2, size_t ie2len)
|
||||
@@ -1671,8 +1696,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
|
||||
@@ -1682,8 +1707,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
|
||||
if (ie1 == NULL || ie2 == NULL)
|
||||
return -1;
|
||||
|
||||
|
@ -298,7 +298,7 @@
|
||||
}
|
||||
--- a/src/ap/wpa_auth_glue.c
|
||||
+++ b/src/ap/wpa_auth_glue.c
|
||||
@@ -173,6 +173,7 @@ static void hostapd_wpa_auth_psk_failure
|
||||
@@ -175,6 +175,7 @@ static void hostapd_wpa_auth_psk_failure
|
||||
struct hostapd_data *hapd = ctx;
|
||||
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR,
|
||||
MAC2STR(addr));
|
||||
|
@ -44,7 +44,7 @@ Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
|
||||
|
||||
#include "xhci.h"
|
||||
#include "xhci-trace.h"
|
||||
@@ -248,6 +250,458 @@ static void xhci_pme_acpi_rtd3_enable(st
|
||||
@@ -236,6 +238,458 @@ static void xhci_pme_acpi_rtd3_enable(st
|
||||
static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { }
|
||||
#endif /* CONFIG_ACPI */
|
||||
|
||||
@ -503,7 +503,7 @@ Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
|
||||
/* called during probe() after chip reset completes */
|
||||
static int xhci_pci_setup(struct usb_hcd *hcd)
|
||||
{
|
||||
@@ -287,6 +741,22 @@ static int xhci_pci_probe(struct pci_dev
|
||||
@@ -275,6 +729,22 @@ static int xhci_pci_probe(struct pci_dev
|
||||
struct hc_driver *driver;
|
||||
struct usb_hcd *hcd;
|
||||
|
||||
@ -526,7 +526,7 @@ Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
|
||||
driver = (struct hc_driver *)id->driver_data;
|
||||
|
||||
/* Prevent runtime suspending between USB-2 and USB-3 initialization */
|
||||
@@ -344,6 +814,16 @@ static void xhci_pci_remove(struct pci_d
|
||||
@@ -332,6 +802,16 @@ static void xhci_pci_remove(struct pci_d
|
||||
{
|
||||
struct xhci_hcd *xhci;
|
||||
|
||||
|
@ -13,7 +13,7 @@ produce a noisy warning.
|
||||
|
||||
--- a/drivers/usb/host/xhci-pci.c
|
||||
+++ b/drivers/usb/host/xhci-pci.c
|
||||
@@ -205,7 +205,7 @@ static void xhci_pci_quirks(struct devic
|
||||
@@ -193,7 +193,7 @@ static void xhci_pci_quirks(struct devic
|
||||
}
|
||||
if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
|
||||
pdev->device == 0x0015)
|
||||
|
@ -58,7 +58,8 @@ sc1750|\
|
||||
sc450)
|
||||
ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
|
||||
;;
|
||||
archer-c25-v1)
|
||||
archer-c25-v1|\
|
||||
archer-c7-v4)
|
||||
ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
|
||||
ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan2g" "phy1tpt"
|
||||
ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:green:wlan5g" "phy0tpt"
|
||||
@ -66,6 +67,12 @@ archer-c25-v1)
|
||||
ucidef_set_led_switch "lan2" "LAN2" "$board:green:lan2" "switch0" "0x08"
|
||||
ucidef_set_led_switch "lan3" "LAN3" "$board:green:lan3" "switch0" "0x04"
|
||||
ucidef_set_led_switch "lan4" "LAN4" "$board:green:lan4" "switch0" "0x02"
|
||||
case "$board" in
|
||||
archer-c7-v4)
|
||||
ucidef_set_led_usbdev "usb1" "USB1" "$board:green:usb1" "1-1"
|
||||
ucidef_set_led_usbdev "usb2" "USB2" "$board:green:usb2" "2-1"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
archer-c58-v1|\
|
||||
archer-c59-v1|\
|
||||
@ -267,6 +274,7 @@ rb-750)
|
||||
ucidef_set_led_switch "port5" "port5" "rb750:green:port5" "switch0" "0x02"
|
||||
;;
|
||||
rb-750-r2|\
|
||||
rb-750p-pbr2|\
|
||||
rb-750up-r2)
|
||||
ucidef_set_led_timer "user" "USER" "rb:green:user" "1000" "1000"
|
||||
ucidef_set_led_netdev "port1" "port1" "rb:green:port1" "eth0"
|
||||
@ -823,6 +831,12 @@ r6100)
|
||||
ucidef_set_led_usbdev "usb" "USB" "netgear:blue:usb" "1-1"
|
||||
ucidef_set_led_wlan "wlan" "WLAN" "netgear:blue:wlan" "phy1tpt"
|
||||
;;
|
||||
wi2a-ac200i)
|
||||
ucidef_set_led_default "power" "Power (green)" "nokia:green:power" "1"
|
||||
ucidef_set_led_default "wan" "Ethernet LED (green)" "nokia:green:wan" "1"
|
||||
ucidef_set_led_wlan "wlan5g" "WLAN" "nokia:green:wlan-5g" "phy0tpt"
|
||||
ucidef_set_led_wlan "wlan2g" "WLAN" "nokia:green:wlan-2g" "phy1tpt"
|
||||
;;
|
||||
wndr3700v4|\
|
||||
wndr4300)
|
||||
ucidef_set_led_switch "wan-green" "WAN (green)" "netgear:green:wan" "switch0" "0x20" "0x08"
|
||||
|
@ -128,6 +128,7 @@ ar71xx_setup_interfaces()
|
||||
tl-wr902ac-v1|\
|
||||
tube2h|\
|
||||
unifiac-lite|\
|
||||
wi2a-ac200i|\
|
||||
wndap360|\
|
||||
wp543)
|
||||
ucidef_set_interface_lan "eth0"
|
||||
@ -160,6 +161,7 @@ ar71xx_setup_interfaces()
|
||||
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
||||
;;
|
||||
rb-750-r2|\
|
||||
rb-750p-pbr2|\
|
||||
rb-750up-r2)
|
||||
ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
|
||||
ucidef_add_switch "switch0" \
|
||||
@ -426,6 +428,7 @@ ar71xx_setup_interfaces()
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
|
||||
;;
|
||||
archer-c7-v4|\
|
||||
tl-wdr4300|\
|
||||
tl-wr1041n-v2)
|
||||
ucidef_add_switch "switch0" \
|
||||
|
@ -32,6 +32,9 @@ rb-952ui-5ac2nd)
|
||||
ucidef_add_gpio_switch "usb_power_switch" "USB Power Switch" "45" "1"
|
||||
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "14"
|
||||
;;
|
||||
rb-750p-pbr2)
|
||||
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "14"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
@ -58,6 +58,7 @@ get_status_led() {
|
||||
archer-c58-v1|\
|
||||
archer-c59-v1|\
|
||||
archer-c60-v1|\
|
||||
archer-c7-v4|\
|
||||
fritz300e|\
|
||||
gl-usb150|\
|
||||
mr12|\
|
||||
@ -316,6 +317,7 @@ get_status_led() {
|
||||
status_led="rb750:green:act"
|
||||
;;
|
||||
rb-750-r2|\
|
||||
rb-750p-pbr2|\
|
||||
rb-750up-r2|\
|
||||
rb-911g-2hpnd|\
|
||||
rb-911g-5hpacd|\
|
||||
@ -458,6 +460,9 @@ get_status_led() {
|
||||
airgatewaypro)
|
||||
status_led="ubnt:white:status"
|
||||
;;
|
||||
wi2a-ac200i)
|
||||
status_led="nokia:green:ctrl"
|
||||
;;
|
||||
whr-g301n|\
|
||||
whr-hp-g300n|\
|
||||
whr-hp-gn|\
|
||||
@ -528,6 +533,9 @@ set_state() {
|
||||
local n=$(fw_printenv activeregion | cut -d = -f 2)
|
||||
fw_setenv "image${n}trynum" 0
|
||||
;;
|
||||
wi2a-ac200i)
|
||||
fw_setenv PKRstCnt 0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
@ -54,6 +54,7 @@ case "$FIRMWARE" in
|
||||
ath10kcal_extract "ART" 20480 2116
|
||||
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16)
|
||||
;;
|
||||
archer-c7-v4|\
|
||||
archer-c25-v1|\
|
||||
archer-c59-v1|\
|
||||
archer-c60-v1|\
|
||||
@ -111,6 +112,9 @@ case "$FIRMWARE" in
|
||||
unifiac-pro)
|
||||
ath10kcal_extract "EEPROM" 20480 2116
|
||||
;;
|
||||
wi2a-ac200i)
|
||||
ath10kcal_extract "ART" 20480 2116
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"ath10k/cal-pci-0000:01:00.0.bin")
|
||||
|
@ -452,6 +452,9 @@ ar71xx_board_detect() {
|
||||
*"Archer C5")
|
||||
name="archer-c5"
|
||||
;;
|
||||
*"Archer C7 v4")
|
||||
name="archer-c7-v4"
|
||||
;;
|
||||
*"Archer C58 v1")
|
||||
name="archer-c58-v1"
|
||||
;;
|
||||
@ -911,6 +914,9 @@ ar71xx_board_detect() {
|
||||
*"RouterBOARD 750GL")
|
||||
name="rb-750gl"
|
||||
;;
|
||||
*"RouterBOARD 750P r2")
|
||||
name="rb-750p-pbr2"
|
||||
;;
|
||||
*"RouterBOARD 750UP r2")
|
||||
name="rb-750up-r2"
|
||||
;;
|
||||
@ -1228,6 +1234,9 @@ ar71xx_board_detect() {
|
||||
"WeIO"*)
|
||||
name="weio"
|
||||
;;
|
||||
*"WI2A-AC200i")
|
||||
name="wi2a-ac200i"
|
||||
;;
|
||||
*"WHR-G301N")
|
||||
name="whr-g301n"
|
||||
;;
|
||||
|
@ -211,6 +211,7 @@ platform_check_image() {
|
||||
archer-c58-v1|\
|
||||
archer-c59-v1|\
|
||||
archer-c60-v1|\
|
||||
archer-c7-v4|\
|
||||
bullet-m|\
|
||||
c-55|\
|
||||
carambola2|\
|
||||
@ -534,6 +535,7 @@ platform_check_image() {
|
||||
nbg6716|\
|
||||
r6100|\
|
||||
rambutan|\
|
||||
wi2a-ac200i|\
|
||||
wndr3700v4|\
|
||||
wndr4300)
|
||||
nand_do_platform_check $board $1
|
||||
@ -655,6 +657,7 @@ platform_check_image() {
|
||||
# these boards use metadata images
|
||||
fritz300e|\
|
||||
rb-750-r2|\
|
||||
rb-750p-pbr2|\
|
||||
rb-750up-r2|\
|
||||
rb-941-2nd|\
|
||||
rb-951ui-2nd|\
|
||||
@ -707,11 +710,13 @@ platform_pre_upgrade() {
|
||||
rb-2011uias-2hnd|\
|
||||
rb-sxt2n|\
|
||||
rb-sxt5n|\
|
||||
wi2a-ac200i|\
|
||||
wndr3700v4|\
|
||||
wndr4300)
|
||||
nand_do_upgrade "$1"
|
||||
;;
|
||||
rb-750-r2|\
|
||||
rb-750p-pbr2|\
|
||||
rb-750up-r2|\
|
||||
rb-941-2nd|\
|
||||
rb-951ui-2nd|\
|
||||
@ -741,6 +746,23 @@ platform_nand_pre_upgrade() {
|
||||
mtd erase kernel
|
||||
tar xf "$1" sysupgrade-routerboard/kernel -O | nandwrite -o "$fw_mtd" -
|
||||
;;
|
||||
wi2a-ac200i)
|
||||
case "$(fw_printenv -n dualPartition)" in
|
||||
imgA)
|
||||
fw_setenv dualPartition imgB
|
||||
fw_setenv ActImg NokiaImageB
|
||||
;;
|
||||
imgB)
|
||||
fw_setenv dualPartition imgA
|
||||
fw_setenv ActImg NokiaImageA
|
||||
;;
|
||||
esac
|
||||
ubiblock -r /dev/ubiblock0_0 2>/dev/null >/dev/null
|
||||
rm -f /dev/ubiblock0_0
|
||||
ubidetach -d 0 2>/dev/null >/dev/null
|
||||
CI_UBIPART=ubi_alt
|
||||
CI_KERNPART=kernel_alt
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
@ -223,6 +223,7 @@ CONFIG_ATH79_MACH_UBNT=y
|
||||
CONFIG_ATH79_MACH_UBNT_UNIFIAC=y
|
||||
CONFIG_ATH79_MACH_UBNT_XM=y
|
||||
CONFIG_ATH79_MACH_WEIO=y
|
||||
# CONFIG_ATH79_MACH_WI2A_AC200I is not set
|
||||
CONFIG_ATH79_MACH_WHR_HP_G300N=y
|
||||
CONFIG_ATH79_MACH_WLAE_AG300N=y
|
||||
CONFIG_ATH79_MACH_WLR8100=y
|
||||
|
@ -221,6 +221,7 @@ CONFIG_ATH79_MACH_UBNT=y
|
||||
CONFIG_ATH79_MACH_UBNT_UNIFIAC=y
|
||||
CONFIG_ATH79_MACH_UBNT_XM=y
|
||||
CONFIG_ATH79_MACH_WEIO=y
|
||||
# CONFIG_ATH79_MACH_WI2A_AC200I is not set
|
||||
CONFIG_ATH79_MACH_WHR_HP_G300N=y
|
||||
CONFIG_ATH79_MACH_WLAE_AG300N=y
|
||||
CONFIG_ATH79_MACH_WLR8100=y
|
||||
@ -378,7 +379,6 @@ CONFIG_MIPS_CLOCK_VSYSCALL=y
|
||||
CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y
|
||||
# CONFIG_MIPS_CMDLINE_FROM_DTB is not set
|
||||
# CONFIG_MIPS_ELF_APPENDED_DTB is not set
|
||||
CONFIG_MIPS_FPU_EMULATOR=y
|
||||
# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
|
||||
CONFIG_MIPS_L1_CACHE_SHIFT=5
|
||||
CONFIG_MIPS_MACHINE=y
|
||||
|
@ -8,6 +8,17 @@ config ATH79_MACH_A60
|
||||
select ATH79_DEV_WMAC
|
||||
select ATH79_DEV_USB
|
||||
|
||||
config ATH79_MACH_WI2A_AC200I
|
||||
bool "Nokia WI2A-AC200i support"
|
||||
select SOC_QCA955X
|
||||
select ATH79_DEV_ETH
|
||||
select ATH79_DEV_GPIO_BUTTONS
|
||||
select ATH79_DEV_LEDS_GPIO
|
||||
select ATH79_DEV_M25P80
|
||||
select ATH79_DEV_NFC
|
||||
select ATH79_DEV_WMAC
|
||||
select ATH79_DEV_USB
|
||||
|
||||
config ATH79_MACH_ALFA_AP120C
|
||||
bool "ALFA Network AP120C board support"
|
||||
select ATH79_DEV_AP9X_PCI if PCI
|
||||
@ -1008,6 +1019,7 @@ config ATH79_MACH_RBSPI
|
||||
MikroTik RouterBOARD hAP ac lite
|
||||
MikroTik RouterBOARD hEX PoE lite
|
||||
MikroTik RouterBOARD hEX lite
|
||||
MikroTik RouterBOARD Powerbox
|
||||
MikroTik RouterBOARD LHG 5
|
||||
MikroTik RouterBOARD cAP (EXPERIMENTAL)
|
||||
MikroTik RouterBOARD mAP (EXPERIMENTAL)
|
||||
@ -1381,6 +1393,7 @@ config ATH79_MACH_ARCHER_C60_V1
|
||||
config ATH79_MACH_ARCHER_C7
|
||||
bool "TP-LINK Archer C5/C7/TL-WDR4900 v2 board support"
|
||||
select SOC_QCA955X
|
||||
select SOC_QCA956X
|
||||
select ATH79_DEV_AP9X_PCI if PCI
|
||||
select ATH79_DEV_ETH
|
||||
select ATH79_DEV_GPIO_BUTTONS
|
||||
|
@ -39,6 +39,7 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += routerboot.o
|
||||
# Machines
|
||||
#
|
||||
obj-$(CONFIG_ATH79_MACH_A60) += mach-a60.o
|
||||
obj-$(CONFIG_ATH79_MACH_WI2A_AC200I) += mach-wi2a-ac200i.o
|
||||
obj-$(CONFIG_ATH79_MACH_ALFA_AP120C) += mach-alfa-ap120c.o
|
||||
obj-$(CONFIG_ATH79_MACH_ALFA_AP96) += mach-alfa-ap96.o
|
||||
obj-$(CONFIG_ATH79_MACH_ALFA_NX) += mach-alfa-nx.o
|
||||
@ -62,6 +63,7 @@ obj-$(CONFIG_ATH79_MACH_ARCHER_C58_V1) += mach-archer-c59-v1.o
|
||||
obj-$(CONFIG_ATH79_MACH_ARCHER_C59_V1) += mach-archer-c59-v1.o
|
||||
obj-$(CONFIG_ATH79_MACH_ARCHER_C60_V1) += mach-archer-c60-v1.o
|
||||
obj-$(CONFIG_ATH79_MACH_ARCHER_C7) += mach-archer-c7.o
|
||||
obj-$(CONFIG_ATH79_MACH_ARCHER_C7) += mach-archer-c7-v4.o
|
||||
obj-$(CONFIG_ATH79_MACH_ARDUINO_YUN) += mach-arduino-yun.o
|
||||
obj-$(CONFIG_ATH79_MACH_AW_NR580) += mach-aw-nr580.o
|
||||
obj-$(CONFIG_ATH79_MACH_BHR_4GRV2) += mach-bhr-4grv2.o
|
||||
|
260
target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c
Normal file
260
target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c
Normal file
@ -0,0 +1,260 @@
|
||||
|
||||
/*
|
||||
* Atheros ARCHER_C7 reference board support
|
||||
*
|
||||
* Copyright (c) 2017 Felix Fietkau <nbd@nbd.name>
|
||||
* Copyright (c) 2014 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2012 Gabor Juhos <juhosg@openwrt.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/ath9k_platform.h>
|
||||
#include <linux/ar8216_platform.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/spi/spi_gpio.h>
|
||||
#include <linux/spi/74x164.h>
|
||||
|
||||
#include <asm/mach-ath79/ar71xx_regs.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "dev-m25p80.h"
|
||||
#include "machtypes.h"
|
||||
#include "pci.h"
|
||||
#include "dev-eth.h"
|
||||
#include "dev-gpio-buttons.h"
|
||||
#include "dev-leds-gpio.h"
|
||||
#include "dev-spi.h"
|
||||
#include "dev-usb.h"
|
||||
#include "dev-wmac.h"
|
||||
|
||||
|
||||
#define ARCHER_C7_GPIO_SHIFT_OE 1
|
||||
#define ARCHER_C7_GPIO_SHIFT_SER 14
|
||||
#define ARCHER_C7_GPIO_SHIFT_SRCLK 15
|
||||
#define ARCHER_C7_GPIO_SHIFT_RCLK 16
|
||||
#define ARCHER_C7_GPIO_SHIFT_SRCLR 21
|
||||
|
||||
#define ARCHER_C7_GPIO_BTN_RESET 5
|
||||
#define ARCHER_C7_GPIO_BTN_WPS_WIFI 2
|
||||
|
||||
#define ARCHER_C7_GPIO_LED_WLAN5 9
|
||||
#define ARCHER_C7_GPIO_LED_POWER 6
|
||||
#define ARCHER_C7_GPIO_LED_USB1 7
|
||||
#define ARCHER_C7_GPIO_LED_USB2 8
|
||||
|
||||
#define ARCHER_C7_74HC_GPIO_BASE QCA956X_GPIO_COUNT
|
||||
#define ARCHER_C7_GPIO_LED_WPS (ARCHER_C7_74HC_GPIO_BASE + 0)
|
||||
#define ARCHER_C7_GPIO_LED_LAN1 (ARCHER_C7_74HC_GPIO_BASE + 1)
|
||||
#define ARCHER_C7_GPIO_LED_LAN2 (ARCHER_C7_74HC_GPIO_BASE + 2)
|
||||
#define ARCHER_C7_GPIO_LED_LAN3 (ARCHER_C7_74HC_GPIO_BASE + 3)
|
||||
#define ARCHER_C7_GPIO_LED_LAN4 (ARCHER_C7_74HC_GPIO_BASE + 4)
|
||||
#define ARCHER_C7_GPIO_LED_WAN_GREEN (ARCHER_C7_74HC_GPIO_BASE + 5)
|
||||
#define ARCHER_C7_GPIO_LED_WAN_AMBER (ARCHER_C7_74HC_GPIO_BASE + 6)
|
||||
#define ARCHER_C7_GPIO_LED_WLAN2 (ARCHER_C7_74HC_GPIO_BASE + 7)
|
||||
|
||||
#define ARCHER_C7_KEYS_POLL_INTERVAL 20 /* msecs */
|
||||
#define ARCHER_C7_KEYS_DEBOUNCE_INTERVAL (3 * ARCHER_C7_KEYS_POLL_INTERVAL)
|
||||
|
||||
#define ARCHER_C7_MAC0_OFFSET 0
|
||||
#define ARCHER_C7_MAC1_OFFSET 6
|
||||
#define ARCHER_C7_WMAC_CALDATA_OFFSET 0x1000
|
||||
|
||||
#define ARCHER_C7_GPIO_MDC 3
|
||||
#define ARCHER_C7_GPIO_MDIO 4
|
||||
|
||||
static struct spi_gpio_platform_data archer_c7_v4_spi_data = {
|
||||
.sck = ARCHER_C7_GPIO_SHIFT_SRCLK,
|
||||
.miso = SPI_GPIO_NO_MISO,
|
||||
.mosi = ARCHER_C7_GPIO_SHIFT_SER,
|
||||
.num_chipselect = 1,
|
||||
};
|
||||
|
||||
static u8 archer_c7_v4_ssr_initdata __initdata = 0xff;
|
||||
|
||||
static struct gen_74x164_chip_platform_data archer_c7_v4_ssr_data = {
|
||||
.base = ARCHER_C7_74HC_GPIO_BASE,
|
||||
.num_registers = 1,
|
||||
.init_data = &archer_c7_v4_ssr_initdata,
|
||||
};
|
||||
|
||||
static struct platform_device archer_c7_v4_spi_device = {
|
||||
.name = "spi_gpio",
|
||||
.id = 1,
|
||||
.dev = {
|
||||
.platform_data = &archer_c7_v4_spi_data,
|
||||
},
|
||||
};
|
||||
|
||||
static struct spi_board_info archer_c7_v4_spi_info[] = {
|
||||
{
|
||||
.bus_num = 1,
|
||||
.chip_select = 0,
|
||||
.max_speed_hz = 10000000,
|
||||
.modalias = "74x164",
|
||||
.platform_data = &archer_c7_v4_ssr_data,
|
||||
.controller_data = (void *) ARCHER_C7_GPIO_SHIFT_RCLK,
|
||||
},
|
||||
};
|
||||
|
||||
static struct gpio_led archer_c7_v4_leds_gpio[] __initdata = {
|
||||
{
|
||||
.name = "archer-c7-v4:green:power",
|
||||
.gpio = ARCHER_C7_GPIO_LED_POWER,
|
||||
.active_low = 1,
|
||||
}, {
|
||||
.name = "archer-c7-v4:green:wps",
|
||||
.gpio = ARCHER_C7_GPIO_LED_WPS,
|
||||
.active_low = 1,
|
||||
}, {
|
||||
.name = "archer-c7-v4:green:wlan2g",
|
||||
.gpio = ARCHER_C7_GPIO_LED_WLAN2,
|
||||
.active_low = 1,
|
||||
}, {
|
||||
.name = "archer-c7-v4:green:wlan5g",
|
||||
.gpio = ARCHER_C7_GPIO_LED_WLAN5,
|
||||
.active_low = 1,
|
||||
}, {
|
||||
.name = "archer-c7-v4:green:lan1",
|
||||
.gpio = ARCHER_C7_GPIO_LED_LAN1,
|
||||
.active_low = 1,
|
||||
}, {
|
||||
.name = "archer-c7-v4:green:lan2",
|
||||
.gpio = ARCHER_C7_GPIO_LED_LAN2,
|
||||
.active_low = 1,
|
||||
}, {
|
||||
.name = "archer-c7-v4:green:lan3",
|
||||
.gpio = ARCHER_C7_GPIO_LED_LAN3,
|
||||
.active_low = 1,
|
||||
}, {
|
||||
.name = "archer-c7-v4:green:lan4",
|
||||
.gpio = ARCHER_C7_GPIO_LED_LAN4,
|
||||
.active_low = 1,
|
||||
}, {
|
||||
.name = "archer-c7-v4:green:wan",
|
||||
.gpio = ARCHER_C7_GPIO_LED_WAN_GREEN,
|
||||
.active_low = 1,
|
||||
}, {
|
||||
.name = "archer-c7-v4:amber:wan",
|
||||
.gpio = ARCHER_C7_GPIO_LED_WAN_AMBER,
|
||||
.active_low = 1,
|
||||
}, {
|
||||
.name = "archer-c7-v4:green:usb1",
|
||||
.gpio = ARCHER_C7_GPIO_LED_USB1,
|
||||
.active_low = 1,
|
||||
}, {
|
||||
.name = "archer-c7-v4:green:usb2",
|
||||
.gpio = ARCHER_C7_GPIO_LED_USB2,
|
||||
.active_low = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct gpio_keys_button archer_c7_v4_gpio_keys[] __initdata = {
|
||||
{
|
||||
.desc = "WPS and WIFI button",
|
||||
.type = EV_KEY,
|
||||
.code = KEY_WPS_BUTTON,
|
||||
.debounce_interval = ARCHER_C7_KEYS_DEBOUNCE_INTERVAL,
|
||||
.gpio = ARCHER_C7_GPIO_BTN_WPS_WIFI,
|
||||
.active_low = 1,
|
||||
},
|
||||
{
|
||||
.desc = "Reset button",
|
||||
.type = EV_KEY,
|
||||
.code = KEY_RESTART,
|
||||
.debounce_interval = ARCHER_C7_KEYS_DEBOUNCE_INTERVAL,
|
||||
.gpio = ARCHER_C7_GPIO_BTN_RESET,
|
||||
.active_low = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct ar8327_pad_cfg archer_c7_v4_ar8337_pad0_cfg = {
|
||||
.mode = AR8327_PAD_MAC_SGMII,
|
||||
.sgmii_delay_en = true,
|
||||
};
|
||||
|
||||
static struct ar8327_platform_data archer_c7_v4_ar8337_data = {
|
||||
.pad0_cfg = &archer_c7_v4_ar8337_pad0_cfg,
|
||||
.port0_cfg = {
|
||||
.force_link = 1,
|
||||
.speed = AR8327_PORT_SPEED_1000,
|
||||
.duplex = 1,
|
||||
.txpause = 1,
|
||||
.rxpause = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct mdio_board_info archer_c7_v4_mdio0_info[] = {
|
||||
{
|
||||
.bus_id = "ag71xx-mdio.0",
|
||||
.phy_addr = 0,
|
||||
.platform_data = &archer_c7_v4_ar8337_data,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
static void __init archer_c7_v4_setup(void)
|
||||
{
|
||||
u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
|
||||
u8 *mac = (u8 *) KSEG1ADDR(0x1ff00008);
|
||||
|
||||
ath79_register_m25p80(NULL);
|
||||
|
||||
spi_register_board_info(archer_c7_v4_spi_info,
|
||||
ARRAY_SIZE(archer_c7_v4_spi_info));
|
||||
|
||||
platform_device_register(&archer_c7_v4_spi_device);
|
||||
|
||||
gpio_request_one(ARCHER_C7_GPIO_SHIFT_OE,
|
||||
GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED,
|
||||
"LED control");
|
||||
|
||||
gpio_request_one(ARCHER_C7_GPIO_SHIFT_SRCLR,
|
||||
GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
|
||||
"LED reset");
|
||||
|
||||
ath79_register_leds_gpio(-1, ARRAY_SIZE(archer_c7_v4_leds_gpio),
|
||||
archer_c7_v4_leds_gpio);
|
||||
|
||||
ath79_register_gpio_keys_polled(-1, ARCHER_C7_KEYS_POLL_INTERVAL,
|
||||
ARRAY_SIZE(archer_c7_v4_gpio_keys),
|
||||
archer_c7_v4_gpio_keys);
|
||||
|
||||
ath79_register_usb();
|
||||
|
||||
ath79_gpio_output_select(ARCHER_C7_GPIO_MDC, QCA956X_GPIO_OUT_MUX_GE0_MDC);
|
||||
ath79_gpio_output_select(ARCHER_C7_GPIO_MDIO, QCA956X_GPIO_OUT_MUX_GE0_MDO);
|
||||
|
||||
ath79_register_mdio(0, 0x0);
|
||||
|
||||
mdiobus_register_board_info(archer_c7_v4_mdio0_info,
|
||||
ARRAY_SIZE(archer_c7_v4_mdio0_info));
|
||||
|
||||
ath79_register_wmac(art + ARCHER_C7_WMAC_CALDATA_OFFSET, mac);
|
||||
ath79_register_pci();
|
||||
|
||||
/* GMAC0 is connected to an AR8337 switch */
|
||||
ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
|
||||
ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII;
|
||||
ath79_eth0_data.speed = SPEED_1000;
|
||||
ath79_eth0_data.duplex = DUPLEX_FULL;
|
||||
ath79_eth0_data.phy_mask = BIT(0);
|
||||
ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
|
||||
ath79_register_eth(0);
|
||||
}
|
||||
|
||||
MIPS_MACHINE(ATH79_MACH_ARCHER_C7_V4, "ARCHER-C7-V4", "TP-LINK Archer C7 v4",
|
||||
archer_c7_v4_setup);
|
@ -7,6 +7,7 @@
|
||||
* - MikroTik RouterBOARD 952Ui-5ac2nD
|
||||
* - MikroTik RouterBOARD 962UiGS-5HacT2HnT
|
||||
* - MikroTik RouterBOARD 750UP r2
|
||||
* - MikroTik RouterBOARD 750P-PBr2
|
||||
* - MikroTik RouterBOARD 750 r2
|
||||
* - MikroTik RouterBOARD LHG 5nD
|
||||
*
|
||||
@ -763,7 +764,8 @@ static void __init rb952_setup(void)
|
||||
* Init the hEX (PoE) lite hardware (QCA953x).
|
||||
* The 750UP r2 (hEX PoE lite) is nearly identical to the hAP, only without
|
||||
* WLAN. The 750 r2 (hEX lite) is nearly identical to the 750UP r2, only
|
||||
* without USB and POE. It shares the same bootloader board identifier.
|
||||
* without USB and POE. The 750P Pbr2 (Powerbox) is nearly identical to hEX PoE
|
||||
* lite, only without USB. It shares the same bootloader board identifier.
|
||||
*/
|
||||
static void __init rb750upr2_setup(void)
|
||||
{
|
||||
@ -776,6 +778,10 @@ static void __init rb750upr2_setup(void)
|
||||
if (strstr(mips_get_machine_name(), "750UP r2"))
|
||||
flags |= RBSPI_HAS_USB | RBSPI_HAS_POE;
|
||||
|
||||
/* differentiate the Powerbox from the hEX lite */
|
||||
else if (strstr(mips_get_machine_name(), "750P r2"))
|
||||
flags |= RBSPI_HAS_POE;
|
||||
|
||||
rbspi_952_750r2_setup(flags);
|
||||
}
|
||||
|
||||
|
217
target/linux/ar71xx/files/arch/mips/ath79/mach-wi2a-ac200i.c
Normal file
217
target/linux/ar71xx/files/arch/mips/ath79/mach-wi2a-ac200i.c
Normal file
@ -0,0 +1,217 @@
|
||||
/*
|
||||
* Nokia WI2A-AC200i support
|
||||
*
|
||||
* Copyright (c) 2012 Qualcomm Atheros
|
||||
* Copyright (c) 2012-2013 Gabor Juhos <juhosg@openwrt.org>
|
||||
* Copyright (c) 2017 Felix Fietkau <nbd@nbd.name>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
#include <linux/platform/ar934x_nfc.h>
|
||||
|
||||
#include <asm/mach-ath79/ar71xx_regs.h>
|
||||
#include <asm/fw/fw.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "pci.h"
|
||||
#include "dev-ap9x-pci.h"
|
||||
#include "dev-gpio-buttons.h"
|
||||
#include "dev-eth.h"
|
||||
#include "dev-leds-gpio.h"
|
||||
#include "dev-m25p80.h"
|
||||
#include "dev-nfc.h"
|
||||
#include "dev-usb.h"
|
||||
#include "dev-wmac.h"
|
||||
#include "machtypes.h"
|
||||
|
||||
#define AC200I_GPIO_BTN_RESET 17
|
||||
|
||||
#define AC200I_KEYS_POLL_INTERVAL 20 /* msecs */
|
||||
#define AC200I_KEYS_DEBOUNCE_INTERVAL (3 * AC200I_KEYS_POLL_INTERVAL)
|
||||
|
||||
#define AC200I_MAC_ADDR 0x1f040249
|
||||
#define AC200I_MAC1_OFFSET 6
|
||||
#define AC200I_WMAC_CALDATA_ADDR 0x1f061000
|
||||
|
||||
static struct gpio_led ac200i_leds_gpio[] __initdata = {
|
||||
{
|
||||
.name = "nokia:red:wlan-2g",
|
||||
.gpio = 0,
|
||||
.active_low = 1,
|
||||
},
|
||||
{
|
||||
.name = "nokia:green:power",
|
||||
.gpio = 1,
|
||||
.active_low = 1,
|
||||
},
|
||||
{
|
||||
.name = "nokia:green:wlan-2g",
|
||||
.gpio = 2,
|
||||
.active_low = 1,
|
||||
},
|
||||
{
|
||||
.name = "nokia:green:ctrl",
|
||||
.gpio = 3,
|
||||
.active_low = 1,
|
||||
},
|
||||
{
|
||||
.name = "nokia:green:eth",
|
||||
.gpio = 4,
|
||||
.active_low = 1,
|
||||
},
|
||||
{
|
||||
.name = "nokia:red:power",
|
||||
.gpio = 13,
|
||||
.active_low = 1,
|
||||
},
|
||||
{
|
||||
.name = "nokia:red:eth",
|
||||
.gpio = 14,
|
||||
.active_low = 1,
|
||||
},
|
||||
{
|
||||
.name = "nokia:red:wlan-5g",
|
||||
.gpio = 18,
|
||||
.active_low = 1,
|
||||
},
|
||||
{
|
||||
.name = "nokia:green:wlan-5g",
|
||||
.gpio = 19,
|
||||
.active_low = 1,
|
||||
},
|
||||
{
|
||||
.name = "nokia:red:ctrl",
|
||||
.gpio = 20,
|
||||
.active_low = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct gpio_keys_button ac200i_gpio_keys[] __initdata = {
|
||||
{
|
||||
.desc = "Reset button",
|
||||
.type = EV_KEY,
|
||||
.code = KEY_RESTART,
|
||||
.debounce_interval = AC200I_KEYS_DEBOUNCE_INTERVAL,
|
||||
.gpio = AC200I_GPIO_BTN_RESET,
|
||||
.active_low = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct mtd_partition ac200i_nand_partitions[] = {
|
||||
{
|
||||
.name = "cfg",
|
||||
.offset = 0x0100000,
|
||||
.size = 0x1800000,
|
||||
.mask_flags = MTD_WRITEABLE,
|
||||
},
|
||||
{
|
||||
.name = "kernel",
|
||||
.offset = 0x2000000,
|
||||
.size = 0x0400000,
|
||||
},
|
||||
{
|
||||
.name = "ubi",
|
||||
.offset = 0x2400000,
|
||||
.size = 0x2000000,
|
||||
},
|
||||
{
|
||||
.name = "kernel",
|
||||
.offset = 0x5000000,
|
||||
.size = 0x0400000,
|
||||
},
|
||||
{
|
||||
.name = "ubi",
|
||||
.offset = 0x5400000,
|
||||
.size = 0x2000000,
|
||||
},
|
||||
};
|
||||
|
||||
static const char *boot_getenv(const char *key)
|
||||
{
|
||||
const char *start = (const char *) KSEG1ADDR(0x1f070000);
|
||||
const char *end = start + 0x20000;
|
||||
const char *addr;
|
||||
|
||||
for (addr = start + 4;
|
||||
*addr && *addr != 0xff && addr < end &&
|
||||
strnlen(addr, end - addr) < end - addr;
|
||||
addr += strnlen(addr, end - addr) + 1) {
|
||||
const char *val;
|
||||
|
||||
val = strchr(addr, '=');
|
||||
if (!val)
|
||||
continue;
|
||||
|
||||
if (strncmp(addr, key, val - addr))
|
||||
continue;
|
||||
|
||||
return val + 1;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void __init ac200i_setup(void)
|
||||
{
|
||||
const char *img;
|
||||
u8 *wmac = (u8 *) KSEG1ADDR(AC200I_WMAC_CALDATA_ADDR);
|
||||
u8 *mac_addr = (u8 *) KSEG1ADDR(AC200I_MAC_ADDR);
|
||||
|
||||
ath79_register_m25p80(NULL);
|
||||
|
||||
ath79_register_leds_gpio(-1, ARRAY_SIZE(ac200i_leds_gpio),
|
||||
ac200i_leds_gpio);
|
||||
ath79_register_gpio_keys_polled(-1, AC200I_KEYS_POLL_INTERVAL,
|
||||
ARRAY_SIZE(ac200i_gpio_keys),
|
||||
ac200i_gpio_keys);
|
||||
|
||||
ath79_register_usb();
|
||||
ath79_nfc_set_parts(ac200i_nand_partitions,
|
||||
ARRAY_SIZE(ac200i_nand_partitions));
|
||||
ath79_nfc_set_ecc_mode(AR934X_NFC_ECC_HW);
|
||||
ath79_register_nfc();
|
||||
|
||||
ath79_register_wmac(wmac, NULL);
|
||||
|
||||
ath79_register_mdio(0, 0x0);
|
||||
ath79_init_mac(ath79_eth0_data.mac_addr, mac_addr, 0);
|
||||
|
||||
/* GMAC0 is connected to the SGMII interface */
|
||||
ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII;
|
||||
ath79_eth0_data.phy_mask = BIT(4);
|
||||
ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
|
||||
ath79_eth0_pll_data.pll_1000 = 0x03000101;
|
||||
ath79_eth0_pll_data.pll_100 = 0x80000101;
|
||||
ath79_eth0_pll_data.pll_10 = 0x80001313;
|
||||
|
||||
img = boot_getenv("dualPartition");
|
||||
if (img && !strcmp(img, "imgA")) {
|
||||
ac200i_nand_partitions[3].name = "kernel_alt";
|
||||
ac200i_nand_partitions[4].name = "ubi_alt";
|
||||
} else {
|
||||
ac200i_nand_partitions[1].name = "kernel_alt";
|
||||
ac200i_nand_partitions[2].name = "ubi_alt";
|
||||
}
|
||||
|
||||
ath79_register_eth(0);
|
||||
|
||||
ath79_register_pci();
|
||||
}
|
||||
|
||||
MIPS_MACHINE(ATH79_MACH_WI2A_AC200I, "WI2A-AC200i",
|
||||
"Nokia WI2A-AC200i",
|
||||
ac200i_setup);
|
@ -19,6 +19,7 @@ enum ath79_mach_type {
|
||||
ATH79_MACH_GENERIC = 0,
|
||||
ATH79_MACH_A40, /* OpenMesh A40 */
|
||||
ATH79_MACH_A60, /* OpenMesh A60 */
|
||||
ATH79_MACH_WI2A_AC200I, /* Nokia WI2A-AC200i */
|
||||
ATH79_MACH_ALFA_AP120C, /* ALFA Network AP120C board */
|
||||
ATH79_MACH_ALFA_AP96, /* ALFA Network AP96 board */
|
||||
ATH79_MACH_ALFA_NX, /* ALFA Network N2/N5 board */
|
||||
@ -48,6 +49,7 @@ enum ath79_mach_type {
|
||||
ATH79_MACH_ARCHER_C60_V1, /* TP-LINK Archer C60 V1 board */
|
||||
ATH79_MACH_ARCHER_C7, /* TP-LINK Archer C7 board */
|
||||
ATH79_MACH_ARCHER_C7_V2, /* TP-LINK Archer C7 V2 board */
|
||||
ATH79_MACH_ARCHER_C7_V4, /* TP-LINK Archer C7 V4 board */
|
||||
ATH79_MACH_ARDUINO_YUN, /* Yun */
|
||||
ATH79_MACH_AW_NR580, /* AzureWave AW-NR580 */
|
||||
ATH79_MACH_BHR_4GRV2, /* Buffalo BHR-4GRV2 */
|
||||
|
@ -1089,7 +1089,7 @@ next:
|
||||
|
||||
while ((skb = __skb_dequeue(&queue)) != NULL) {
|
||||
skb->protocol = eth_type_trans(skb, dev);
|
||||
napi_gro_receive(&ag->napi, skb);
|
||||
netif_receive_skb(skb);
|
||||
}
|
||||
|
||||
DBG("%s: rx finish, curr=%u, dirty=%u, done=%d\n",
|
||||
@ -1141,7 +1141,7 @@ static int ag71xx_poll(struct napi_struct *napi, int limit)
|
||||
DBG("%s: disable polling mode, rx=%d, tx=%d,limit=%d\n",
|
||||
dev->name, rx_done, tx_done, limit);
|
||||
|
||||
napi_complete_done(napi, rx_done);
|
||||
napi_complete(napi);
|
||||
|
||||
/* enable interrupts */
|
||||
spin_lock_irqsave(&ag->lock, flags);
|
||||
@ -1160,7 +1160,7 @@ oom:
|
||||
pr_info("%s: out of memory\n", dev->name);
|
||||
|
||||
mod_timer(&ag->oom_timer, jiffies + AG71XX_OOM_REFILL);
|
||||
napi_complete_done(napi, rx_done);
|
||||
napi_complete(napi);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ define Device/rb-nor-flash-16M
|
||||
LOADER_TYPE := elf
|
||||
KERNEL_INSTALL := 1
|
||||
KERNEL := kernel-bin | lzma | loader-kernel
|
||||
SUPPORTED_DEVICES := rb-750-r2 rb-750up-r2 rb-941-2nd rb-951ui-2nd rb-952ui-5ac2nd rb-962uigs-5hact2hnt rb-lhg-5nd rb-mapl-2nd
|
||||
SUPPORTED_DEVICES := rb-750-r2 rb-750up-r2 rb-750p-pbr2 rb-941-2nd rb-951ui-2nd rb-952ui-5ac2nd rb-962uigs-5hact2hnt rb-lhg-5nd rb-mapl-2nd
|
||||
IMAGE/sysupgrade.bin := append-kernel | kernel2minor -s 1024 -e | pad-to $$$$(BLOCKSIZE) | \
|
||||
append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
|
||||
endef
|
||||
|
@ -34,8 +34,8 @@ define Device/domywifi-dw33d
|
||||
DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x
|
||||
BOARDNAME := DW33D
|
||||
IMAGE_SIZE := 16000k
|
||||
MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware);ar934x-nfc:96m(rootfs_data),32m(backup)ro
|
||||
IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 14528k | append-kernel | check-size $$$$(IMAGE_SIZE)
|
||||
MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,13952k(rootfs),2048k(kernel),64k(art)ro,16000k@0x50000(firmware);ar934x-nfc:96m(rootfs_data),32m(backup)ro
|
||||
IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 13952k | append-kernel | check-size $$$$(IMAGE_SIZE)
|
||||
endef
|
||||
TARGET_DEVICES += domywifi-dw33d
|
||||
|
||||
@ -84,6 +84,21 @@ define Device/rambutan
|
||||
endef
|
||||
TARGET_DEVICES += rambutan
|
||||
|
||||
define Device/wi2a-ac200i
|
||||
SUPPORTED_DEVICES = $(1)
|
||||
DEVICE_TITLE := Nokia WI2A-AC200i
|
||||
DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ath9k kmod-ath10k ath10k-firmware-qca988x
|
||||
BOARDNAME := WI2A-AC200i
|
||||
BLOCKSIZE := 64k
|
||||
KERNEL_SIZE := 3648k
|
||||
IMAGE_SIZE := 32m
|
||||
IMAGES := sysupgrade.tar
|
||||
MTDPARTS := spi0.0:256k(u-boot)ro,64k(envFacA)ro,64k(envFacB)ro,64k(ART)ro,128k(u-boot-env)
|
||||
KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma
|
||||
IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
|
||||
endef
|
||||
TARGET_DEVICES += wi2a-ac200i
|
||||
|
||||
define Device/z1
|
||||
DEVICE_TITLE := Meraki Z1
|
||||
DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-spi-gpio kmod-ath9k kmod-owl-loader
|
||||
|
@ -200,7 +200,20 @@ define Device/tl-wdr7500-v3
|
||||
DEVICE_PROFILE := ARCHERC7
|
||||
TPLINK_HWID := 0x75000003
|
||||
endef
|
||||
TARGET_DEVICES += archer-c5-v1 archer-c7-v1 archer-c7-v2 archer-c7-v2-il tl-wdr7500-v3
|
||||
|
||||
define Device/archer-c7-v4
|
||||
$(Device/archer-cxx)
|
||||
DEVICE_TITLE := TP-LINK Archer C7 v4
|
||||
DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x
|
||||
BOARDNAME := ARCHER-C7-V4
|
||||
TPLINK_BOARD_ID := ARCHER-C7-V4
|
||||
IMAGE_SIZE := 15104k
|
||||
LOADER_TYPE := elf
|
||||
MTDPARTS := spi0.0:128k(factory-uboot)ro,128k(u-boot)ro,1536k(kernel),13568k(rootfs),960k(config)ro,64k(art)ro,15104k@0x40000(firmware)
|
||||
SUPPORTED_DEVICES := archer-c7-v4
|
||||
endef
|
||||
|
||||
TARGET_DEVICES += archer-c5-v1 archer-c7-v1 archer-c7-v2 archer-c7-v2-il tl-wdr7500-v3 archer-c7-v4
|
||||
|
||||
define Device/cpe510-520-v1
|
||||
DEVICE_TITLE := TP-LINK CPE510/520 v1
|
||||
|
@ -180,6 +180,7 @@ CONFIG_ATH79_MACH_RAMBUTAN=y
|
||||
# CONFIG_ATH79_MACH_UBNT_XM is not set
|
||||
# CONFIG_ATH79_MACH_WEIO is not set
|
||||
# CONFIG_ATH79_MACH_WHR_HP_G300N is not set
|
||||
CONFIG_ATH79_MACH_WI2A_AC200I=y
|
||||
# CONFIG_ATH79_MACH_WLAE_AG300N is not set
|
||||
# CONFIG_ATH79_MACH_WLR8100 is not set
|
||||
# CONFIG_ATH79_MACH_WNDAP360 is not set
|
||||
|
@ -129,7 +129,7 @@ it on BCM4708 family.
|
||||
+++ b/drivers/usb/host/xhci.h
|
||||
@@ -1662,6 +1662,7 @@ struct xhci_hcd {
|
||||
#define XHCI_LIMIT_ENDPOINT_INTERVAL_7 (1 << 26)
|
||||
#define XHCI_U2_DISABLE_WAKE (1 << 27)
|
||||
/* Reserved. It was XHCI_U2_DISABLE_WAKE */
|
||||
#define XHCI_ASMEDIA_MODIFY_FLOWCONTROL (1 << 28)
|
||||
+#define XHCI_FAKE_DOORBELL (1 << 29)
|
||||
|
||||
|
@ -19,7 +19,7 @@ Reduces overhead when using X
|
||||
module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644);
|
||||
MODULE_PARM_DESC(mousepoll, "Polling interval of mice");
|
||||
|
||||
@@ -1083,8 +1083,12 @@ static int usbhid_start(struct hid_devic
|
||||
@@ -1093,8 +1093,12 @@ static int usbhid_start(struct hid_devic
|
||||
}
|
||||
|
||||
/* Change the polling interval of mice. */
|
||||
|
@ -21,7 +21,7 @@ Signed-off-by: Eric Anholt <eric@anholt.net>
|
||||
}
|
||||
kfree(pagelist);
|
||||
if (actual_pages == 0)
|
||||
@@ -577,7 +577,7 @@ free_pagelist(PAGELIST_T *pagelist, int
|
||||
@@ -579,7 +579,7 @@ free_pagelist(PAGELIST_T *pagelist, int
|
||||
offset = 0;
|
||||
set_page_dirty(pg);
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ FEATURES:=squashfs usb
|
||||
SUBTARGETS:=generic mips74k legacy
|
||||
MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
|
||||
|
||||
KERNEL_PATCHVER:=4.4
|
||||
KERNEL_PATCHVER:=4.9
|
||||
|
||||
define Target/Description
|
||||
Build firmware images for Broadcom based BCM47xx/53xx routers with MIPS CPU, *not* ARM.
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/phy/broadcom.c
|
||||
+++ b/drivers/net/phy/broadcom.c
|
||||
@@ -414,6 +414,11 @@ static int bcm5481_config_aneg(struct ph
|
||||
@@ -420,6 +420,11 @@ static int bcm5481_config_aneg(struct ph
|
||||
/* Write bits 14:0. */
|
||||
reg |= (1 << 15);
|
||||
phy_write(phydev, 0x18, reg);
|
||||
|
@ -0,0 +1,90 @@
|
||||
From 40fc3423b983b864bf70b03199191260ae9b2ea6 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Dumazet <edumazet@google.com>
|
||||
Date: Sat, 3 Dec 2016 11:14:50 -0800
|
||||
Subject: [PATCH 01/10] tcp: tsq: add tsq_flags / tsq_enum
|
||||
|
||||
This is a cleanup, to ease code review of following patches.
|
||||
|
||||
Old 'enum tsq_flags' is renamed, and a new enumeration is added
|
||||
with the flags used in cmpxchg() operations as opposed to
|
||||
single bit operations.
|
||||
|
||||
Signed-off-by: Eric Dumazet <edumazet@google.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
include/linux/tcp.h | 11 ++++++++++-
|
||||
net/ipv4/tcp_output.c | 16 ++++++++--------
|
||||
2 files changed, 18 insertions(+), 9 deletions(-)
|
||||
|
||||
--- a/include/linux/tcp.h
|
||||
+++ b/include/linux/tcp.h
|
||||
@@ -367,7 +367,7 @@ struct tcp_sock {
|
||||
u32 *saved_syn;
|
||||
};
|
||||
|
||||
-enum tsq_flags {
|
||||
+enum tsq_enum {
|
||||
TSQ_THROTTLED,
|
||||
TSQ_QUEUED,
|
||||
TCP_TSQ_DEFERRED, /* tcp_tasklet_func() found socket was owned */
|
||||
@@ -378,6 +378,15 @@ enum tsq_flags {
|
||||
*/
|
||||
};
|
||||
|
||||
+enum tsq_flags {
|
||||
+ TSQF_THROTTLED = (1UL << TSQ_THROTTLED),
|
||||
+ TSQF_QUEUED = (1UL << TSQ_QUEUED),
|
||||
+ TCPF_TSQ_DEFERRED = (1UL << TCP_TSQ_DEFERRED),
|
||||
+ TCPF_WRITE_TIMER_DEFERRED = (1UL << TCP_WRITE_TIMER_DEFERRED),
|
||||
+ TCPF_DELACK_TIMER_DEFERRED = (1UL << TCP_DELACK_TIMER_DEFERRED),
|
||||
+ TCPF_MTU_REDUCED_DEFERRED = (1UL << TCP_MTU_REDUCED_DEFERRED),
|
||||
+};
|
||||
+
|
||||
static inline struct tcp_sock *tcp_sk(const struct sock *sk)
|
||||
{
|
||||
return (struct tcp_sock *)sk;
|
||||
--- a/net/ipv4/tcp_output.c
|
||||
+++ b/net/ipv4/tcp_output.c
|
||||
@@ -784,10 +784,10 @@ static void tcp_tasklet_func(unsigned lo
|
||||
}
|
||||
}
|
||||
|
||||
-#define TCP_DEFERRED_ALL ((1UL << TCP_TSQ_DEFERRED) | \
|
||||
- (1UL << TCP_WRITE_TIMER_DEFERRED) | \
|
||||
- (1UL << TCP_DELACK_TIMER_DEFERRED) | \
|
||||
- (1UL << TCP_MTU_REDUCED_DEFERRED))
|
||||
+#define TCP_DEFERRED_ALL (TCPF_TSQ_DEFERRED | \
|
||||
+ TCPF_WRITE_TIMER_DEFERRED | \
|
||||
+ TCPF_DELACK_TIMER_DEFERRED | \
|
||||
+ TCPF_MTU_REDUCED_DEFERRED)
|
||||
/**
|
||||
* tcp_release_cb - tcp release_sock() callback
|
||||
* @sk: socket
|
||||
@@ -808,7 +808,7 @@ void tcp_release_cb(struct sock *sk)
|
||||
nflags = flags & ~TCP_DEFERRED_ALL;
|
||||
} while (cmpxchg(&tp->tsq_flags, flags, nflags) != flags);
|
||||
|
||||
- if (flags & (1UL << TCP_TSQ_DEFERRED))
|
||||
+ if (flags & TCPF_TSQ_DEFERRED)
|
||||
tcp_tsq_handler(sk);
|
||||
|
||||
/* Here begins the tricky part :
|
||||
@@ -822,15 +822,15 @@ void tcp_release_cb(struct sock *sk)
|
||||
*/
|
||||
sock_release_ownership(sk);
|
||||
|
||||
- if (flags & (1UL << TCP_WRITE_TIMER_DEFERRED)) {
|
||||
+ if (flags & TCPF_WRITE_TIMER_DEFERRED) {
|
||||
tcp_write_timer_handler(sk);
|
||||
__sock_put(sk);
|
||||
}
|
||||
- if (flags & (1UL << TCP_DELACK_TIMER_DEFERRED)) {
|
||||
+ if (flags & TCPF_DELACK_TIMER_DEFERRED) {
|
||||
tcp_delack_timer_handler(sk);
|
||||
__sock_put(sk);
|
||||
}
|
||||
- if (flags & (1UL << TCP_MTU_REDUCED_DEFERRED)) {
|
||||
+ if (flags & TCPF_MTU_REDUCED_DEFERRED) {
|
||||
inet_csk(sk)->icsk_af_ops->mtu_reduced(sk);
|
||||
__sock_put(sk);
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
From 408f0a6c21e124cc4f6c7aa370b38aa47e55428d Mon Sep 17 00:00:00 2001
|
||||
From: Eric Dumazet <edumazet@google.com>
|
||||
Date: Sat, 3 Dec 2016 11:14:51 -0800
|
||||
Subject: [PATCH 02/10] tcp: tsq: remove one locked operation in tcp_wfree()
|
||||
|
||||
Instead of atomically clear TSQ_THROTTLED and atomically set TSQ_QUEUED
|
||||
bits, use one cmpxchg() to perform a single locked operation.
|
||||
|
||||
Since the following patch will also set TCP_TSQ_DEFERRED here,
|
||||
this cmpxchg() will make this addition free.
|
||||
|
||||
Signed-off-by: Eric Dumazet <edumazet@google.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
net/ipv4/tcp_output.c | 13 ++++++++++---
|
||||
1 file changed, 10 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/net/ipv4/tcp_output.c
|
||||
+++ b/net/ipv4/tcp_output.c
|
||||
@@ -860,6 +860,7 @@ void tcp_wfree(struct sk_buff *skb)
|
||||
{
|
||||
struct sock *sk = skb->sk;
|
||||
struct tcp_sock *tp = tcp_sk(sk);
|
||||
+ unsigned long flags, nval, oval;
|
||||
int wmem;
|
||||
|
||||
/* Keep one reference on sk_wmem_alloc.
|
||||
@@ -877,11 +878,17 @@ void tcp_wfree(struct sk_buff *skb)
|
||||
if (wmem >= SKB_TRUESIZE(1) && this_cpu_ksoftirqd() == current)
|
||||
goto out;
|
||||
|
||||
- if (test_and_clear_bit(TSQ_THROTTLED, &tp->tsq_flags) &&
|
||||
- !test_and_set_bit(TSQ_QUEUED, &tp->tsq_flags)) {
|
||||
- unsigned long flags;
|
||||
+ for (oval = READ_ONCE(tp->tsq_flags);; oval = nval) {
|
||||
struct tsq_tasklet *tsq;
|
||||
|
||||
+ if (!(oval & TSQF_THROTTLED) || (oval & TSQF_QUEUED))
|
||||
+ goto out;
|
||||
+
|
||||
+ nval = (oval & ~TSQF_THROTTLED) | TSQF_QUEUED;
|
||||
+ nval = cmpxchg(&tp->tsq_flags, oval, nval);
|
||||
+ if (nval != oval)
|
||||
+ continue;
|
||||
+
|
||||
/* queue this socket to tasklet queue */
|
||||
local_irq_save(flags);
|
||||
tsq = this_cpu_ptr(&tsq_tasklet);
|
@ -0,0 +1,71 @@
|
||||
From b223feb9de2a65c533ff95c08e834fa732906ea5 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Dumazet <edumazet@google.com>
|
||||
Date: Sat, 3 Dec 2016 11:14:52 -0800
|
||||
Subject: [PATCH 03/10] tcp: tsq: add shortcut in tcp_tasklet_func()
|
||||
|
||||
Under high stress, I've seen tcp_tasklet_func() consuming
|
||||
~700 usec, handling ~150 tcp sockets.
|
||||
|
||||
By setting TCP_TSQ_DEFERRED in tcp_wfree(), we give a chance
|
||||
for other cpus/threads entering tcp_write_xmit() to grab it,
|
||||
allowing tcp_tasklet_func() to skip sockets that already did
|
||||
an xmit cycle.
|
||||
|
||||
In the future, we might give to ACK processing an increased
|
||||
budget to reduce even more tcp_tasklet_func() amount of work.
|
||||
|
||||
Signed-off-by: Eric Dumazet <edumazet@google.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
net/ipv4/tcp_output.c | 22 ++++++++++++----------
|
||||
1 file changed, 12 insertions(+), 10 deletions(-)
|
||||
|
||||
--- a/net/ipv4/tcp_output.c
|
||||
+++ b/net/ipv4/tcp_output.c
|
||||
@@ -767,19 +767,19 @@ static void tcp_tasklet_func(unsigned lo
|
||||
list_for_each_safe(q, n, &list) {
|
||||
tp = list_entry(q, struct tcp_sock, tsq_node);
|
||||
list_del(&tp->tsq_node);
|
||||
+ clear_bit(TSQ_QUEUED, &tp->tsq_flags);
|
||||
|
||||
sk = (struct sock *)tp;
|
||||
- bh_lock_sock(sk);
|
||||
-
|
||||
- if (!sock_owned_by_user(sk)) {
|
||||
- tcp_tsq_handler(sk);
|
||||
- } else {
|
||||
- /* defer the work to tcp_release_cb() */
|
||||
- set_bit(TCP_TSQ_DEFERRED, &tp->tsq_flags);
|
||||
+ if (!sk->sk_lock.owned &&
|
||||
+ test_bit(TCP_TSQ_DEFERRED, &tp->tsq_flags)) {
|
||||
+ bh_lock_sock(sk);
|
||||
+ if (!sock_owned_by_user(sk)) {
|
||||
+ clear_bit(TCP_TSQ_DEFERRED, &tp->tsq_flags);
|
||||
+ tcp_tsq_handler(sk);
|
||||
+ }
|
||||
+ bh_unlock_sock(sk);
|
||||
}
|
||||
- bh_unlock_sock(sk);
|
||||
|
||||
- clear_bit(TSQ_QUEUED, &tp->tsq_flags);
|
||||
sk_free(sk);
|
||||
}
|
||||
}
|
||||
@@ -884,7 +884,7 @@ void tcp_wfree(struct sk_buff *skb)
|
||||
if (!(oval & TSQF_THROTTLED) || (oval & TSQF_QUEUED))
|
||||
goto out;
|
||||
|
||||
- nval = (oval & ~TSQF_THROTTLED) | TSQF_QUEUED;
|
||||
+ nval = (oval & ~TSQF_THROTTLED) | TSQF_QUEUED | TCPF_TSQ_DEFERRED;
|
||||
nval = cmpxchg(&tp->tsq_flags, oval, nval);
|
||||
if (nval != oval)
|
||||
continue;
|
||||
@@ -2182,6 +2182,8 @@ static bool tcp_write_xmit(struct sock *
|
||||
unlikely(tso_fragment(sk, skb, limit, mss_now, gfp)))
|
||||
break;
|
||||
|
||||
+ if (test_bit(TCP_TSQ_DEFERRED, &tp->tsq_flags))
|
||||
+ clear_bit(TCP_TSQ_DEFERRED, &tp->tsq_flags);
|
||||
if (tcp_small_queue_check(sk, skb, 0))
|
||||
break;
|
||||
|
@ -0,0 +1,38 @@
|
||||
From a9b204d1564702b704ad6fe74f10a102c7b87ba3 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Dumazet <edumazet@google.com>
|
||||
Date: Sat, 3 Dec 2016 11:14:53 -0800
|
||||
Subject: [PATCH 04/10] tcp: tsq: avoid one atomic in tcp_wfree()
|
||||
|
||||
Under high load, tcp_wfree() has an atomic operation trying
|
||||
to schedule a tasklet over and over.
|
||||
|
||||
We can schedule it only if our per cpu list was empty.
|
||||
|
||||
Signed-off-by: Eric Dumazet <edumazet@google.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
net/ipv4/tcp_output.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/net/ipv4/tcp_output.c
|
||||
+++ b/net/ipv4/tcp_output.c
|
||||
@@ -880,6 +880,7 @@ void tcp_wfree(struct sk_buff *skb)
|
||||
|
||||
for (oval = READ_ONCE(tp->tsq_flags);; oval = nval) {
|
||||
struct tsq_tasklet *tsq;
|
||||
+ bool empty;
|
||||
|
||||
if (!(oval & TSQF_THROTTLED) || (oval & TSQF_QUEUED))
|
||||
goto out;
|
||||
@@ -892,8 +893,10 @@ void tcp_wfree(struct sk_buff *skb)
|
||||
/* queue this socket to tasklet queue */
|
||||
local_irq_save(flags);
|
||||
tsq = this_cpu_ptr(&tsq_tasklet);
|
||||
+ empty = list_empty(&tsq->head);
|
||||
list_add(&tp->tsq_node, &tsq->head);
|
||||
- tasklet_schedule(&tsq->tasklet);
|
||||
+ if (empty)
|
||||
+ tasklet_schedule(&tsq->tasklet);
|
||||
local_irq_restore(flags);
|
||||
return;
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
From 75eefc6c59fd2c5f1ab95a3a113c217237d12a31 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Dumazet <edumazet@google.com>
|
||||
Date: Sat, 3 Dec 2016 11:14:54 -0800
|
||||
Subject: [PATCH 05/10] tcp: tsq: add a shortcut in tcp_small_queue_check()
|
||||
|
||||
Always allow the two first skbs in write queue to be sent,
|
||||
regardless of sk_wmem_alloc/sk_pacing_rate values.
|
||||
|
||||
This helps a lot in situations where TX completions are delayed either
|
||||
because of driver latencies or softirq latencies.
|
||||
|
||||
Test is done with no cache line misses.
|
||||
|
||||
Signed-off-by: Eric Dumazet <edumazet@google.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
net/ipv4/tcp_output.c | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
--- a/net/ipv4/tcp_output.c
|
||||
+++ b/net/ipv4/tcp_output.c
|
||||
@@ -2087,6 +2087,15 @@ static bool tcp_small_queue_check(struct
|
||||
limit <<= factor;
|
||||
|
||||
if (atomic_read(&sk->sk_wmem_alloc) > limit) {
|
||||
+ /* Always send the 1st or 2nd skb in write queue.
|
||||
+ * No need to wait for TX completion to call us back,
|
||||
+ * after softirq/tasklet schedule.
|
||||
+ * This helps when TX completions are delayed too much.
|
||||
+ */
|
||||
+ if (skb == sk->sk_write_queue.next ||
|
||||
+ skb->prev == sk->sk_write_queue.next)
|
||||
+ return false;
|
||||
+
|
||||
set_bit(TSQ_THROTTLED, &tcp_sk(sk)->tsq_flags);
|
||||
/* It is possible TX completion already happened
|
||||
* before we set TSQ_THROTTLED, so we must
|
@ -0,0 +1,55 @@
|
||||
From 12a59abc22d6664f7d3944f625ceefee92de8820 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Dumazet <edumazet@google.com>
|
||||
Date: Sat, 3 Dec 2016 11:14:55 -0800
|
||||
Subject: [PATCH 06/10] tcp: tcp_mtu_probe() is likely to exit early
|
||||
|
||||
Adding a likely() in tcp_mtu_probe() moves its code which used to
|
||||
be inlined in front of tcp_write_xmit()
|
||||
|
||||
We still have a cache line miss to access icsk->icsk_mtup.enabled,
|
||||
we will probably have to reorganize fields to help data locality.
|
||||
|
||||
Signed-off-by: Eric Dumazet <edumazet@google.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
net/ipv4/tcp_output.c | 18 +++++++++---------
|
||||
1 file changed, 9 insertions(+), 9 deletions(-)
|
||||
|
||||
--- a/net/ipv4/tcp_output.c
|
||||
+++ b/net/ipv4/tcp_output.c
|
||||
@@ -1928,26 +1928,26 @@ static inline void tcp_mtu_check_reprobe
|
||||
*/
|
||||
static int tcp_mtu_probe(struct sock *sk)
|
||||
{
|
||||
- struct tcp_sock *tp = tcp_sk(sk);
|
||||
struct inet_connection_sock *icsk = inet_csk(sk);
|
||||
+ struct tcp_sock *tp = tcp_sk(sk);
|
||||
struct sk_buff *skb, *nskb, *next;
|
||||
struct net *net = sock_net(sk);
|
||||
- int len;
|
||||
int probe_size;
|
||||
int size_needed;
|
||||
- int copy;
|
||||
+ int copy, len;
|
||||
int mss_now;
|
||||
int interval;
|
||||
|
||||
/* Not currently probing/verifying,
|
||||
* not in recovery,
|
||||
* have enough cwnd, and
|
||||
- * not SACKing (the variable headers throw things off) */
|
||||
- if (!icsk->icsk_mtup.enabled ||
|
||||
- icsk->icsk_mtup.probe_size ||
|
||||
- inet_csk(sk)->icsk_ca_state != TCP_CA_Open ||
|
||||
- tp->snd_cwnd < 11 ||
|
||||
- tp->rx_opt.num_sacks || tp->rx_opt.dsack)
|
||||
+ * not SACKing (the variable headers throw things off)
|
||||
+ */
|
||||
+ if (likely(!icsk->icsk_mtup.enabled ||
|
||||
+ icsk->icsk_mtup.probe_size ||
|
||||
+ inet_csk(sk)->icsk_ca_state != TCP_CA_Open ||
|
||||
+ tp->snd_cwnd < 11 ||
|
||||
+ tp->rx_opt.num_sacks || tp->rx_opt.dsack))
|
||||
return -1;
|
||||
|
||||
/* Use binary search for probe_size between tcp_mss_base,
|
@ -0,0 +1,157 @@
|
||||
From 9115e8cd2a0c6eaaa900c462721f12e1d45f326c Mon Sep 17 00:00:00 2001
|
||||
From: Eric Dumazet <edumazet@google.com>
|
||||
Date: Sat, 3 Dec 2016 11:14:56 -0800
|
||||
Subject: [PATCH 07/10] net: reorganize struct sock for better data locality
|
||||
|
||||
Group fields used in TX path, and keep some cache lines mostly read
|
||||
to permit sharing among cpus.
|
||||
|
||||
Gained two 4 bytes holes on 64bit arches.
|
||||
|
||||
Added a place holder for tcp tsq_flags, next to sk_wmem_alloc
|
||||
to speed up tcp_wfree() in the following patch.
|
||||
|
||||
I have not added ____cacheline_aligned_in_smp, this might be done later.
|
||||
I prefer doing this once inet and tcp/udp sockets reorg is also done.
|
||||
|
||||
Tested with both TCP and UDP.
|
||||
|
||||
UDP receiver performance under flood increased by ~20 % :
|
||||
Accessing sk_filter/sk_wq/sk_napi_id no longer stalls because sk_drops
|
||||
was moved away from a critical cache line, now mostly read and shared.
|
||||
|
||||
/* --- cacheline 4 boundary (256 bytes) --- */
|
||||
unsigned int sk_napi_id; /* 0x100 0x4 */
|
||||
int sk_rcvbuf; /* 0x104 0x4 */
|
||||
struct sk_filter * sk_filter; /* 0x108 0x8 */
|
||||
union {
|
||||
struct socket_wq * sk_wq; /* 0x8 */
|
||||
struct socket_wq * sk_wq_raw; /* 0x8 */
|
||||
}; /* 0x110 0x8 */
|
||||
struct xfrm_policy * sk_policy[2]; /* 0x118 0x10 */
|
||||
struct dst_entry * sk_rx_dst; /* 0x128 0x8 */
|
||||
struct dst_entry * sk_dst_cache; /* 0x130 0x8 */
|
||||
atomic_t sk_omem_alloc; /* 0x138 0x4 */
|
||||
int sk_sndbuf; /* 0x13c 0x4 */
|
||||
/* --- cacheline 5 boundary (320 bytes) --- */
|
||||
int sk_wmem_queued; /* 0x140 0x4 */
|
||||
atomic_t sk_wmem_alloc; /* 0x144 0x4 */
|
||||
long unsigned int sk_tsq_flags; /* 0x148 0x8 */
|
||||
struct sk_buff * sk_send_head; /* 0x150 0x8 */
|
||||
struct sk_buff_head sk_write_queue; /* 0x158 0x18 */
|
||||
__s32 sk_peek_off; /* 0x170 0x4 */
|
||||
int sk_write_pending; /* 0x174 0x4 */
|
||||
long int sk_sndtimeo; /* 0x178 0x8 */
|
||||
|
||||
Signed-off-by: Eric Dumazet <edumazet@google.com>
|
||||
Tested-by: Paolo Abeni <pabeni@redhat.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
include/net/sock.h | 51 +++++++++++++++++++++++++++------------------------
|
||||
1 file changed, 27 insertions(+), 24 deletions(-)
|
||||
|
||||
--- a/include/net/sock.h
|
||||
+++ b/include/net/sock.h
|
||||
@@ -343,6 +343,9 @@ struct sock {
|
||||
#define sk_rxhash __sk_common.skc_rxhash
|
||||
|
||||
socket_lock_t sk_lock;
|
||||
+ atomic_t sk_drops;
|
||||
+ int sk_rcvlowat;
|
||||
+ struct sk_buff_head sk_error_queue;
|
||||
struct sk_buff_head sk_receive_queue;
|
||||
/*
|
||||
* The backlog queue is special, it is always used with
|
||||
@@ -359,14 +362,13 @@ struct sock {
|
||||
struct sk_buff *tail;
|
||||
} sk_backlog;
|
||||
#define sk_rmem_alloc sk_backlog.rmem_alloc
|
||||
- int sk_forward_alloc;
|
||||
|
||||
- __u32 sk_txhash;
|
||||
+ int sk_forward_alloc;
|
||||
#ifdef CONFIG_NET_RX_BUSY_POLL
|
||||
- unsigned int sk_napi_id;
|
||||
unsigned int sk_ll_usec;
|
||||
+ /* ===== mostly read cache line ===== */
|
||||
+ unsigned int sk_napi_id;
|
||||
#endif
|
||||
- atomic_t sk_drops;
|
||||
int sk_rcvbuf;
|
||||
|
||||
struct sk_filter __rcu *sk_filter;
|
||||
@@ -379,11 +381,30 @@ struct sock {
|
||||
#endif
|
||||
struct dst_entry *sk_rx_dst;
|
||||
struct dst_entry __rcu *sk_dst_cache;
|
||||
- /* Note: 32bit hole on 64bit arches */
|
||||
- atomic_t sk_wmem_alloc;
|
||||
atomic_t sk_omem_alloc;
|
||||
int sk_sndbuf;
|
||||
+
|
||||
+ /* ===== cache line for TX ===== */
|
||||
+ int sk_wmem_queued;
|
||||
+ atomic_t sk_wmem_alloc;
|
||||
+ unsigned long sk_tsq_flags;
|
||||
+ struct sk_buff *sk_send_head;
|
||||
struct sk_buff_head sk_write_queue;
|
||||
+ __s32 sk_peek_off;
|
||||
+ int sk_write_pending;
|
||||
+ long sk_sndtimeo;
|
||||
+ struct timer_list sk_timer;
|
||||
+ __u32 sk_priority;
|
||||
+ __u32 sk_mark;
|
||||
+ u32 sk_pacing_rate; /* bytes per second */
|
||||
+ u32 sk_max_pacing_rate;
|
||||
+ struct page_frag sk_frag;
|
||||
+ netdev_features_t sk_route_caps;
|
||||
+ netdev_features_t sk_route_nocaps;
|
||||
+ int sk_gso_type;
|
||||
+ unsigned int sk_gso_max_size;
|
||||
+ gfp_t sk_allocation;
|
||||
+ __u32 sk_txhash;
|
||||
|
||||
/*
|
||||
* Because of non atomicity rules, all
|
||||
@@ -399,41 +420,23 @@ struct sock {
|
||||
#define SK_PROTOCOL_MAX U8_MAX
|
||||
kmemcheck_bitfield_end(flags);
|
||||
|
||||
- int sk_wmem_queued;
|
||||
- gfp_t sk_allocation;
|
||||
- u32 sk_pacing_rate; /* bytes per second */
|
||||
- u32 sk_max_pacing_rate;
|
||||
- netdev_features_t sk_route_caps;
|
||||
- netdev_features_t sk_route_nocaps;
|
||||
- int sk_gso_type;
|
||||
- unsigned int sk_gso_max_size;
|
||||
u16 sk_gso_max_segs;
|
||||
- int sk_rcvlowat;
|
||||
unsigned long sk_lingertime;
|
||||
- struct sk_buff_head sk_error_queue;
|
||||
struct proto *sk_prot_creator;
|
||||
rwlock_t sk_callback_lock;
|
||||
int sk_err,
|
||||
sk_err_soft;
|
||||
u32 sk_ack_backlog;
|
||||
u32 sk_max_ack_backlog;
|
||||
- __u32 sk_priority;
|
||||
- __u32 sk_mark;
|
||||
struct pid *sk_peer_pid;
|
||||
const struct cred *sk_peer_cred;
|
||||
long sk_rcvtimeo;
|
||||
- long sk_sndtimeo;
|
||||
- struct timer_list sk_timer;
|
||||
ktime_t sk_stamp;
|
||||
u16 sk_tsflags;
|
||||
u8 sk_shutdown;
|
||||
u32 sk_tskey;
|
||||
struct socket *sk_socket;
|
||||
void *sk_user_data;
|
||||
- struct page_frag sk_frag;
|
||||
- struct sk_buff *sk_send_head;
|
||||
- __s32 sk_peek_off;
|
||||
- int sk_write_pending;
|
||||
#ifdef CONFIG_SECURITY
|
||||
void *sk_security;
|
||||
#endif
|
@ -0,0 +1,176 @@
|
||||
From 7aa5470c2c09265902b5e4289afa82e4e7c2987e Mon Sep 17 00:00:00 2001
|
||||
From: Eric Dumazet <edumazet@google.com>
|
||||
Date: Sat, 3 Dec 2016 11:14:57 -0800
|
||||
Subject: [PATCH 08/10] tcp: tsq: move tsq_flags close to sk_wmem_alloc
|
||||
|
||||
tsq_flags being in the same cache line than sk_wmem_alloc
|
||||
makes a lot of sense. Both fields are changed from tcp_wfree()
|
||||
and more generally by various TSQ related functions.
|
||||
|
||||
Prior patch made room in struct sock and added sk_tsq_flags,
|
||||
this patch deletes tsq_flags from struct tcp_sock.
|
||||
|
||||
Signed-off-by: Eric Dumazet <edumazet@google.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
include/linux/tcp.h | 1 -
|
||||
net/ipv4/tcp.c | 4 ++--
|
||||
net/ipv4/tcp_ipv4.c | 2 +-
|
||||
net/ipv4/tcp_output.c | 24 +++++++++++-------------
|
||||
net/ipv4/tcp_timer.c | 4 ++--
|
||||
net/ipv6/tcp_ipv6.c | 2 +-
|
||||
6 files changed, 17 insertions(+), 20 deletions(-)
|
||||
|
||||
--- a/include/linux/tcp.h
|
||||
+++ b/include/linux/tcp.h
|
||||
@@ -192,7 +192,6 @@ struct tcp_sock {
|
||||
u32 tsoffset; /* timestamp offset */
|
||||
|
||||
struct list_head tsq_node; /* anchor in tsq_tasklet.head list */
|
||||
- unsigned long tsq_flags;
|
||||
|
||||
/* Data for direct copy to user */
|
||||
struct {
|
||||
--- a/net/ipv4/tcp.c
|
||||
+++ b/net/ipv4/tcp.c
|
||||
@@ -665,9 +665,9 @@ static void tcp_push(struct sock *sk, in
|
||||
if (tcp_should_autocork(sk, skb, size_goal)) {
|
||||
|
||||
/* avoid atomic op if TSQ_THROTTLED bit is already set */
|
||||
- if (!test_bit(TSQ_THROTTLED, &tp->tsq_flags)) {
|
||||
+ if (!test_bit(TSQ_THROTTLED, &sk->sk_tsq_flags)) {
|
||||
NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPAUTOCORKING);
|
||||
- set_bit(TSQ_THROTTLED, &tp->tsq_flags);
|
||||
+ set_bit(TSQ_THROTTLED, &sk->sk_tsq_flags);
|
||||
}
|
||||
/* It is possible TX completion already happened
|
||||
* before we set TSQ_THROTTLED.
|
||||
--- a/net/ipv4/tcp_ipv4.c
|
||||
+++ b/net/ipv4/tcp_ipv4.c
|
||||
@@ -446,7 +446,7 @@ void tcp_v4_err(struct sk_buff *icmp_skb
|
||||
if (!sock_owned_by_user(sk)) {
|
||||
tcp_v4_mtu_reduced(sk);
|
||||
} else {
|
||||
- if (!test_and_set_bit(TCP_MTU_REDUCED_DEFERRED, &tp->tsq_flags))
|
||||
+ if (!test_and_set_bit(TCP_MTU_REDUCED_DEFERRED, &sk->sk_tsq_flags))
|
||||
sock_hold(sk);
|
||||
}
|
||||
goto out;
|
||||
--- a/net/ipv4/tcp_output.c
|
||||
+++ b/net/ipv4/tcp_output.c
|
||||
@@ -767,14 +767,15 @@ static void tcp_tasklet_func(unsigned lo
|
||||
list_for_each_safe(q, n, &list) {
|
||||
tp = list_entry(q, struct tcp_sock, tsq_node);
|
||||
list_del(&tp->tsq_node);
|
||||
- clear_bit(TSQ_QUEUED, &tp->tsq_flags);
|
||||
|
||||
sk = (struct sock *)tp;
|
||||
+ clear_bit(TSQ_QUEUED, &sk->sk_tsq_flags);
|
||||
+
|
||||
if (!sk->sk_lock.owned &&
|
||||
- test_bit(TCP_TSQ_DEFERRED, &tp->tsq_flags)) {
|
||||
+ test_bit(TCP_TSQ_DEFERRED, &sk->sk_tsq_flags)) {
|
||||
bh_lock_sock(sk);
|
||||
if (!sock_owned_by_user(sk)) {
|
||||
- clear_bit(TCP_TSQ_DEFERRED, &tp->tsq_flags);
|
||||
+ clear_bit(TCP_TSQ_DEFERRED, &sk->sk_tsq_flags);
|
||||
tcp_tsq_handler(sk);
|
||||
}
|
||||
bh_unlock_sock(sk);
|
||||
@@ -797,16 +798,15 @@ static void tcp_tasklet_func(unsigned lo
|
||||
*/
|
||||
void tcp_release_cb(struct sock *sk)
|
||||
{
|
||||
- struct tcp_sock *tp = tcp_sk(sk);
|
||||
unsigned long flags, nflags;
|
||||
|
||||
/* perform an atomic operation only if at least one flag is set */
|
||||
do {
|
||||
- flags = tp->tsq_flags;
|
||||
+ flags = sk->sk_tsq_flags;
|
||||
if (!(flags & TCP_DEFERRED_ALL))
|
||||
return;
|
||||
nflags = flags & ~TCP_DEFERRED_ALL;
|
||||
- } while (cmpxchg(&tp->tsq_flags, flags, nflags) != flags);
|
||||
+ } while (cmpxchg(&sk->sk_tsq_flags, flags, nflags) != flags);
|
||||
|
||||
if (flags & TCPF_TSQ_DEFERRED)
|
||||
tcp_tsq_handler(sk);
|
||||
@@ -878,7 +878,7 @@ void tcp_wfree(struct sk_buff *skb)
|
||||
if (wmem >= SKB_TRUESIZE(1) && this_cpu_ksoftirqd() == current)
|
||||
goto out;
|
||||
|
||||
- for (oval = READ_ONCE(tp->tsq_flags);; oval = nval) {
|
||||
+ for (oval = READ_ONCE(sk->sk_tsq_flags);; oval = nval) {
|
||||
struct tsq_tasklet *tsq;
|
||||
bool empty;
|
||||
|
||||
@@ -886,7 +886,7 @@ void tcp_wfree(struct sk_buff *skb)
|
||||
goto out;
|
||||
|
||||
nval = (oval & ~TSQF_THROTTLED) | TSQF_QUEUED | TCPF_TSQ_DEFERRED;
|
||||
- nval = cmpxchg(&tp->tsq_flags, oval, nval);
|
||||
+ nval = cmpxchg(&sk->sk_tsq_flags, oval, nval);
|
||||
if (nval != oval)
|
||||
continue;
|
||||
|
||||
@@ -2096,7 +2096,7 @@ static bool tcp_small_queue_check(struct
|
||||
skb->prev == sk->sk_write_queue.next)
|
||||
return false;
|
||||
|
||||
- set_bit(TSQ_THROTTLED, &tcp_sk(sk)->tsq_flags);
|
||||
+ set_bit(TSQ_THROTTLED, &sk->sk_tsq_flags);
|
||||
/* It is possible TX completion already happened
|
||||
* before we set TSQ_THROTTLED, so we must
|
||||
* test again the condition.
|
||||
@@ -2194,8 +2194,8 @@ static bool tcp_write_xmit(struct sock *
|
||||
unlikely(tso_fragment(sk, skb, limit, mss_now, gfp)))
|
||||
break;
|
||||
|
||||
- if (test_bit(TCP_TSQ_DEFERRED, &tp->tsq_flags))
|
||||
- clear_bit(TCP_TSQ_DEFERRED, &tp->tsq_flags);
|
||||
+ if (test_bit(TCP_TSQ_DEFERRED, &sk->sk_tsq_flags))
|
||||
+ clear_bit(TCP_TSQ_DEFERRED, &sk->sk_tsq_flags);
|
||||
if (tcp_small_queue_check(sk, skb, 0))
|
||||
break;
|
||||
|
||||
@@ -3508,8 +3508,6 @@ void tcp_send_ack(struct sock *sk)
|
||||
/* We do not want pure acks influencing TCP Small Queues or fq/pacing
|
||||
* too much.
|
||||
* SKB_TRUESIZE(max(1 .. 66, MAX_TCP_HEADER)) is unfortunately ~784
|
||||
- * We also avoid tcp_wfree() overhead (cache line miss accessing
|
||||
- * tp->tsq_flags) by using regular sock_wfree()
|
||||
*/
|
||||
skb_set_tcp_pure_ack(buff);
|
||||
|
||||
--- a/net/ipv4/tcp_timer.c
|
||||
+++ b/net/ipv4/tcp_timer.c
|
||||
@@ -311,7 +311,7 @@ static void tcp_delack_timer(unsigned lo
|
||||
inet_csk(sk)->icsk_ack.blocked = 1;
|
||||
__NET_INC_STATS(sock_net(sk), LINUX_MIB_DELAYEDACKLOCKED);
|
||||
/* deleguate our work to tcp_release_cb() */
|
||||
- if (!test_and_set_bit(TCP_DELACK_TIMER_DEFERRED, &tcp_sk(sk)->tsq_flags))
|
||||
+ if (!test_and_set_bit(TCP_DELACK_TIMER_DEFERRED, &sk->sk_tsq_flags))
|
||||
sock_hold(sk);
|
||||
}
|
||||
bh_unlock_sock(sk);
|
||||
@@ -594,7 +594,7 @@ static void tcp_write_timer(unsigned lon
|
||||
tcp_write_timer_handler(sk);
|
||||
} else {
|
||||
/* delegate our work to tcp_release_cb() */
|
||||
- if (!test_and_set_bit(TCP_WRITE_TIMER_DEFERRED, &tcp_sk(sk)->tsq_flags))
|
||||
+ if (!test_and_set_bit(TCP_WRITE_TIMER_DEFERRED, &sk->sk_tsq_flags))
|
||||
sock_hold(sk);
|
||||
}
|
||||
bh_unlock_sock(sk);
|
||||
--- a/net/ipv6/tcp_ipv6.c
|
||||
+++ b/net/ipv6/tcp_ipv6.c
|
||||
@@ -404,7 +404,7 @@ static void tcp_v6_err(struct sk_buff *s
|
||||
if (!sock_owned_by_user(sk))
|
||||
tcp_v6_mtu_reduced(sk);
|
||||
else if (!test_and_set_bit(TCP_MTU_REDUCED_DEFERRED,
|
||||
- &tp->tsq_flags))
|
||||
+ &sk->sk_tsq_flags))
|
||||
sock_hold(sk);
|
||||
goto out;
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
From 0a9648f1293966c838dc570da73c15a76f4c89d6 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Dumazet <edumazet@google.com>
|
||||
Date: Wed, 21 Dec 2016 05:42:43 -0800
|
||||
Subject: [PATCH 09/10] tcp: add a missing barrier in tcp_tasklet_func()
|
||||
|
||||
Madalin reported crashes happening in tcp_tasklet_func() on powerpc64
|
||||
|
||||
Before TSQ_QUEUED bit is cleared, we must ensure the changes done
|
||||
by list_del(&tp->tsq_node); are committed to memory, otherwise
|
||||
corruption might happen, as an other cpu could catch TSQ_QUEUED
|
||||
clearance too soon.
|
||||
|
||||
We can notice that old kernels were immune to this bug, because
|
||||
TSQ_QUEUED was cleared after a bh_lock_sock(sk)/bh_unlock_sock(sk)
|
||||
section, but they could have missed a kick to write additional bytes,
|
||||
when NIC interrupts for a given flow are spread to multiple cpus.
|
||||
|
||||
Affected TCP flows would need an incoming ACK or RTO timer to add more
|
||||
packets to the pipe. So overall situation should be better now.
|
||||
|
||||
Fixes: b223feb9de2a ("tcp: tsq: add shortcut in tcp_tasklet_func()")
|
||||
Signed-off-by: Eric Dumazet <edumazet@google.com>
|
||||
Reported-by: Madalin Bucur <madalin.bucur@nxp.com>
|
||||
Tested-by: Madalin Bucur <madalin.bucur@nxp.com>
|
||||
Tested-by: Xing Lei <xing.lei@nxp.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
net/ipv4/tcp_output.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/net/ipv4/tcp_output.c
|
||||
+++ b/net/ipv4/tcp_output.c
|
||||
@@ -769,6 +769,7 @@ static void tcp_tasklet_func(unsigned lo
|
||||
list_del(&tp->tsq_node);
|
||||
|
||||
sk = (struct sock *)tp;
|
||||
+ smp_mb__before_atomic();
|
||||
clear_bit(TSQ_QUEUED, &sk->sk_tsq_flags);
|
||||
|
||||
if (!sk->sk_lock.owned &&
|
File diff suppressed because it is too large
Load Diff
@ -201,6 +201,33 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||
|
||||
--- a/include/asm-generic/vmlinux.lds.h
|
||||
+++ b/include/asm-generic/vmlinux.lds.h
|
||||
@@ -105,7 +105,7 @@
|
||||
#ifdef CONFIG_FTRACE_MCOUNT_RECORD
|
||||
#define MCOUNT_REC() . = ALIGN(8); \
|
||||
VMLINUX_SYMBOL(__start_mcount_loc) = .; \
|
||||
- *(__mcount_loc) \
|
||||
+ KEEP(*(__mcount_loc)) \
|
||||
VMLINUX_SYMBOL(__stop_mcount_loc) = .;
|
||||
#else
|
||||
#define MCOUNT_REC()
|
||||
@@ -113,7 +113,7 @@
|
||||
|
||||
#ifdef CONFIG_TRACE_BRANCH_PROFILING
|
||||
#define LIKELY_PROFILE() VMLINUX_SYMBOL(__start_annotated_branch_profile) = .; \
|
||||
- *(_ftrace_annotated_branch) \
|
||||
+ KEEP(*(_ftrace_annotated_branch)) \
|
||||
VMLINUX_SYMBOL(__stop_annotated_branch_profile) = .;
|
||||
#else
|
||||
#define LIKELY_PROFILE()
|
||||
@@ -121,7 +121,7 @@
|
||||
|
||||
#ifdef CONFIG_PROFILE_ALL_BRANCHES
|
||||
#define BRANCH_PROFILE() VMLINUX_SYMBOL(__start_branch_profile) = .; \
|
||||
- *(_ftrace_branch) \
|
||||
+ KEEP(*(_ftrace_branch)) \
|
||||
VMLINUX_SYMBOL(__stop_branch_profile) = .;
|
||||
#else
|
||||
#define BRANCH_PROFILE()
|
||||
@@ -130,7 +130,7 @@
|
||||
#ifdef CONFIG_KPROBES
|
||||
#define KPROBE_BLACKLIST() . = ALIGN(8); \
|
||||
|
@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
EXPORT_SYMBOL(default_qdisc_ops);
|
||||
|
||||
/* Main transmission queue. */
|
||||
@@ -759,7 +759,7 @@ static void attach_one_default_qdisc(str
|
||||
@@ -760,7 +760,7 @@ static void attach_one_default_qdisc(str
|
||||
void *_unused)
|
||||
{
|
||||
struct Qdisc *qdisc;
|
||||
|
@ -327,7 +327,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/core/sock.c
|
||||
+++ b/net/core/sock.c
|
||||
@@ -3082,6 +3082,8 @@ static __net_initdata struct pernet_oper
|
||||
@@ -3084,6 +3084,8 @@ static __net_initdata struct pernet_oper
|
||||
|
||||
static int __init proto_init(void)
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
#define PACKET_FANOUT_LB 1
|
||||
--- a/net/packet/af_packet.c
|
||||
+++ b/net/packet/af_packet.c
|
||||
@@ -1772,6 +1772,7 @@ static int packet_rcv_spkt(struct sk_buf
|
||||
@@ -1778,6 +1778,7 @@ static int packet_rcv_spkt(struct sk_buf
|
||||
{
|
||||
struct sock *sk;
|
||||
struct sockaddr_pkt *spkt;
|
||||
@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
/*
|
||||
* When we registered the protocol we saved the socket in the data
|
||||
@@ -1779,6 +1780,7 @@ static int packet_rcv_spkt(struct sk_buf
|
||||
@@ -1785,6 +1786,7 @@ static int packet_rcv_spkt(struct sk_buf
|
||||
*/
|
||||
|
||||
sk = pt->af_packet_priv;
|
||||
@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
/*
|
||||
* Yank back the headers [hope the device set this
|
||||
@@ -1791,7 +1793,7 @@ static int packet_rcv_spkt(struct sk_buf
|
||||
@@ -1797,7 +1799,7 @@ static int packet_rcv_spkt(struct sk_buf
|
||||
* so that this procedure is noop.
|
||||
*/
|
||||
|
||||
@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
goto out;
|
||||
|
||||
if (!net_eq(dev_net(dev), sock_net(sk)))
|
||||
@@ -2029,12 +2031,12 @@ static int packet_rcv(struct sk_buff *sk
|
||||
@@ -2035,12 +2037,12 @@ static int packet_rcv(struct sk_buff *sk
|
||||
unsigned int snaplen, res;
|
||||
bool is_drop_n_account = false;
|
||||
|
||||
@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
if (!net_eq(dev_net(dev), sock_net(sk)))
|
||||
goto drop;
|
||||
|
||||
@@ -2160,12 +2162,12 @@ static int tpacket_rcv(struct sk_buff *s
|
||||
@@ -2166,12 +2168,12 @@ static int tpacket_rcv(struct sk_buff *s
|
||||
BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32);
|
||||
BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48);
|
||||
|
||||
@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
if (!net_eq(dev_net(dev), sock_net(sk)))
|
||||
goto drop;
|
||||
|
||||
@@ -3240,6 +3242,7 @@ static int packet_create(struct net *net
|
||||
@@ -3250,6 +3252,7 @@ static int packet_create(struct net *net
|
||||
mutex_init(&po->pg_vec_lock);
|
||||
po->rollover = NULL;
|
||||
po->prot_hook.func = packet_rcv;
|
||||
@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
if (sock->type == SOCK_PACKET)
|
||||
po->prot_hook.func = packet_rcv_spkt;
|
||||
@@ -3826,6 +3829,16 @@ packet_setsockopt(struct socket *sock, i
|
||||
@@ -3836,6 +3839,16 @@ packet_setsockopt(struct socket *sock, i
|
||||
po->xmit = val ? packet_direct_xmit : dev_queue_xmit;
|
||||
return 0;
|
||||
}
|
||||
@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
default:
|
||||
return -ENOPROTOOPT;
|
||||
}
|
||||
@@ -3878,6 +3891,13 @@ static int packet_getsockopt(struct sock
|
||||
@@ -3888,6 +3901,13 @@ static int packet_getsockopt(struct sock
|
||||
case PACKET_VNET_HDR:
|
||||
val = po->has_vnet_hdr;
|
||||
break;
|
||||
|
@ -300,7 +300,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
|
||||
/**
|
||||
* ip6_tnl_addr_conflict - compare packet addresses to tunnel's own
|
||||
* @t: the outgoing tunnel device
|
||||
@@ -1285,6 +1425,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
|
||||
@@ -1286,6 +1426,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
|
||||
{
|
||||
struct ip6_tnl *t = netdev_priv(dev);
|
||||
struct ipv6hdr *ipv6h = ipv6_hdr(skb);
|
||||
@ -308,7 +308,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
|
||||
int encap_limit = -1;
|
||||
__u16 offset;
|
||||
struct flowi6 fl6;
|
||||
@@ -1343,6 +1484,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
|
||||
@@ -1344,6 +1485,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
|
||||
fl6.flowi6_mark = skb->mark;
|
||||
}
|
||||
|
||||
@ -327,7 +327,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
|
||||
if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6))
|
||||
return -1;
|
||||
|
||||
@@ -1470,6 +1623,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
|
||||
@@ -1471,6 +1624,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
|
||||
t->parms.flowinfo = p->flowinfo;
|
||||
t->parms.link = p->link;
|
||||
t->parms.proto = p->proto;
|
||||
@ -342,7 +342,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
|
||||
dst_cache_reset(&t->dst_cache);
|
||||
ip6_tnl_link_config(t);
|
||||
return 0;
|
||||
@@ -1508,6 +1669,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
|
||||
@@ -1509,6 +1670,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
|
||||
p->flowinfo = u->flowinfo;
|
||||
p->link = u->link;
|
||||
p->proto = u->proto;
|
||||
@ -350,7 +350,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
|
||||
memcpy(p->name, u->name, sizeof(u->name));
|
||||
}
|
||||
|
||||
@@ -1885,6 +2047,15 @@ static int ip6_tnl_validate(struct nlatt
|
||||
@@ -1886,6 +2048,15 @@ static int ip6_tnl_validate(struct nlatt
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -366,7 +366,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
|
||||
static void ip6_tnl_netlink_parms(struct nlattr *data[],
|
||||
struct __ip6_tnl_parm *parms)
|
||||
{
|
||||
@@ -1919,6 +2090,46 @@ static void ip6_tnl_netlink_parms(struct
|
||||
@@ -1920,6 +2091,46 @@ static void ip6_tnl_netlink_parms(struct
|
||||
|
||||
if (data[IFLA_IPTUN_COLLECT_METADATA])
|
||||
parms->collect_md = true;
|
||||
@ -413,7 +413,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
|
||||
}
|
||||
|
||||
static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[],
|
||||
@@ -2028,6 +2239,12 @@ static void ip6_tnl_dellink(struct net_d
|
||||
@@ -2029,6 +2240,12 @@ static void ip6_tnl_dellink(struct net_d
|
||||
|
||||
static size_t ip6_tnl_get_size(const struct net_device *dev)
|
||||
{
|
||||
@ -426,7 +426,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
|
||||
return
|
||||
/* IFLA_IPTUN_LINK */
|
||||
nla_total_size(4) +
|
||||
@@ -2055,6 +2272,24 @@ static size_t ip6_tnl_get_size(const str
|
||||
@@ -2056,6 +2273,24 @@ static size_t ip6_tnl_get_size(const str
|
||||
nla_total_size(2) +
|
||||
/* IFLA_IPTUN_COLLECT_METADATA */
|
||||
nla_total_size(0) +
|
||||
@ -451,7 +451,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
|
||||
0;
|
||||
}
|
||||
|
||||
@@ -2062,6 +2297,9 @@ static int ip6_tnl_fill_info(struct sk_b
|
||||
@@ -2063,6 +2298,9 @@ static int ip6_tnl_fill_info(struct sk_b
|
||||
{
|
||||
struct ip6_tnl *tunnel = netdev_priv(dev);
|
||||
struct __ip6_tnl_parm *parm = &tunnel->parms;
|
||||
@ -461,7 +461,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
|
||||
|
||||
if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) ||
|
||||
nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) ||
|
||||
@@ -2070,9 +2308,27 @@ static int ip6_tnl_fill_info(struct sk_b
|
||||
@@ -2071,9 +2309,27 @@ static int ip6_tnl_fill_info(struct sk_b
|
||||
nla_put_u8(skb, IFLA_IPTUN_ENCAP_LIMIT, parm->encap_limit) ||
|
||||
nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) ||
|
||||
nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) ||
|
||||
@ -490,7 +490,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
|
||||
if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) ||
|
||||
nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) ||
|
||||
nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) ||
|
||||
@@ -2110,6 +2366,7 @@ static const struct nla_policy ip6_tnl_p
|
||||
@@ -2111,6 +2367,7 @@ static const struct nla_policy ip6_tnl_p
|
||||
[IFLA_IPTUN_ENCAP_SPORT] = { .type = NLA_U16 },
|
||||
[IFLA_IPTUN_ENCAP_DPORT] = { .type = NLA_U16 },
|
||||
[IFLA_IPTUN_COLLECT_METADATA] = { .type = NLA_FLAG },
|
||||
|
@ -15,7 +15,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
|
||||
# testing for a specific architecture or later rather impossible.
|
||||
arch-$(CONFIG_CPU_32v7M) =-D__LINUX_ARM_ARCH__=7 -march=armv7-m -Wa,-march=armv7-m
|
||||
-arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
|
||||
+arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 -mcpu=cortex-a15
|
||||
+arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 -mcpu=cortex-a15 -mtune=cortex-a15
|
||||
arch-$(CONFIG_CPU_32v6) =-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
|
||||
# Only override the compiler option if ARMv6. The ARMv6K extensions are
|
||||
# always available in ARMv7
|
||||
|
@ -1,152 +0,0 @@
|
||||
CONFIG_ALIGNMENT_TRAP=y
|
||||
# CONFIG_ARCH_AXXIA is not set
|
||||
CONFIG_ARCH_HAS_RESET_CONTROLLER=y
|
||||
CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
|
||||
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
|
||||
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
|
||||
CONFIG_ARCH_MULTIPLATFORM=y
|
||||
# CONFIG_ARCH_MULTI_CPU_AUTO is not set
|
||||
CONFIG_ARCH_MULTI_V6_V7=y
|
||||
CONFIG_ARCH_MULTI_V7=y
|
||||
CONFIG_ARCH_MXC=y
|
||||
CONFIG_ARCH_NR_GPIO=0
|
||||
CONFIG_ARCH_REQUIRE_GPIOLIB=y
|
||||
# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
|
||||
# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
|
||||
CONFIG_ARCH_SUPPORTS_UPROBES=y
|
||||
CONFIG_ARCH_USE_BUILTIN_BSWAP=y
|
||||
CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
|
||||
CONFIG_ARM=y
|
||||
# CONFIG_ARM_CPU_SUSPEND is not set
|
||||
CONFIG_ARM_ERRATA_754322=y
|
||||
CONFIG_ARM_ERRATA_764369=y
|
||||
CONFIG_ARM_ERRATA_775420=y
|
||||
CONFIG_ARM_HAS_SG_CHAIN=y
|
||||
CONFIG_ARM_HEAVY_MB=y
|
||||
CONFIG_ARM_L1_CACHE_SHIFT=6
|
||||
CONFIG_ARM_L1_CACHE_SHIFT_6=y
|
||||
CONFIG_ARM_LPAE=y
|
||||
CONFIG_ARM_PATCH_PHYS_VIRT=y
|
||||
CONFIG_ARM_PMU=y
|
||||
CONFIG_ARM_THUMB=y
|
||||
# CONFIG_ARM_THUMBEE is not set
|
||||
CONFIG_ARM_VIRT_EXT=y
|
||||
CONFIG_ATAGS=y
|
||||
CONFIG_AUTO_ZRELADDR=y
|
||||
CONFIG_CACHE_L2X0=y
|
||||
CONFIG_CLKSRC_IMX_GPT=y
|
||||
CONFIG_CPUFREQ_DT=y
|
||||
CONFIG_CPU_32v6K=y
|
||||
CONFIG_CPU_32v7=y
|
||||
CONFIG_CPU_ABRT_EV7=y
|
||||
# CONFIG_CPU_BPREDICT_DISABLE is not set
|
||||
CONFIG_CPU_CACHE_V7=y
|
||||
CONFIG_CPU_CACHE_VIPT=y
|
||||
CONFIG_CPU_COPY_V6=y
|
||||
CONFIG_CPU_CP15=y
|
||||
CONFIG_CPU_CP15_MMU=y
|
||||
CONFIG_CPU_FREQ=y
|
||||
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
|
||||
CONFIG_CPU_FREQ_GOV_COMMON=y
|
||||
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
|
||||
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
|
||||
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
|
||||
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
|
||||
CONFIG_CPU_FREQ_GOV_USERSPACE=y
|
||||
CONFIG_CPU_FREQ_STAT=y
|
||||
CONFIG_CPU_FREQ_STAT_DETAILS=y
|
||||
CONFIG_CPU_HAS_ASID=y
|
||||
# CONFIG_CPU_ICACHE_DISABLE is not set
|
||||
CONFIG_CPU_PABRT_V7=y
|
||||
# CONFIG_CPU_THERMAL is not set
|
||||
CONFIG_CPU_TLB_V7=y
|
||||
CONFIG_CPU_V7=y
|
||||
CONFIG_CRYPTO_DEFLATE=y
|
||||
CONFIG_CRYPTO_LZO=y
|
||||
CONFIG_DEBUG_IMX_UART_PORT=1
|
||||
CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
|
||||
# CONFIG_DEBUG_UART_8250 is not set
|
||||
# CONFIG_DEBUG_USER is not set
|
||||
CONFIG_EDAC_ATOMIC_SCRUB=y
|
||||
# CONFIG_ENABLE_DEFAULT_TRACERS is not set
|
||||
CONFIG_EXTCON=y
|
||||
CONFIG_FEC=y
|
||||
# CONFIG_FSL_QMAN_FQ_LOOKUP is not set
|
||||
# CONFIG_FTRACE_SYSCALLS is not set
|
||||
CONFIG_GENERIC_IRQ_CHIP=y
|
||||
CONFIG_GPIO_MXC=y
|
||||
CONFIG_HAVE_ARM_ARCH_TIMER=y
|
||||
CONFIG_HAVE_HW_BREAKPOINT=y
|
||||
CONFIG_HAVE_IDE=y
|
||||
CONFIG_HAVE_IMX_SRC=y
|
||||
CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
|
||||
CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
|
||||
CONFIG_HAVE_OPROFILE=y
|
||||
CONFIG_HAVE_OPTPROBES=y
|
||||
CONFIG_HAVE_PROC_CPU=y
|
||||
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
|
||||
CONFIG_HAVE_SMP=y
|
||||
CONFIG_HZ_FIXED=0
|
||||
# CONFIG_IMX_WEIM is not set
|
||||
CONFIG_MICREL_PHY=y
|
||||
CONFIG_MIGHT_HAVE_CACHE_L2X0=y
|
||||
CONFIG_MIGHT_HAVE_PCI=y
|
||||
# CONFIG_MMC_SDHCI_ESDHC_IMX is not set
|
||||
# CONFIG_MMC_MXC is not set
|
||||
CONFIG_MODULES_TREE_LOOKUP=y
|
||||
CONFIG_MODULES_USE_ELF_REL=y
|
||||
CONFIG_MULTI_IRQ_HANDLER=y
|
||||
CONFIG_NEON=y
|
||||
CONFIG_NET_PTP_CLASSIFY=y
|
||||
CONFIG_OLD_SIGACTION=y
|
||||
CONFIG_OUTER_CACHE=y
|
||||
CONFIG_OUTER_CACHE_SYNC=y
|
||||
CONFIG_PAGE_OFFSET=0x80000000
|
||||
# CONFIG_PATA_IMX is not set
|
||||
CONFIG_PERF_EVENTS=y
|
||||
CONFIG_PINCTRL=y
|
||||
# CONFIG_PINCTRL_SINGLE is not set
|
||||
CONFIG_PL310_ERRATA_588369=y
|
||||
CONFIG_PL310_ERRATA_727915=y
|
||||
# CONFIG_PL310_ERRATA_753970 is not set
|
||||
CONFIG_PL310_ERRATA_769419=y
|
||||
CONFIG_PM_OPP=y
|
||||
CONFIG_PPS=y
|
||||
# CONFIG_PROBE_EVENTS is not set
|
||||
CONFIG_PTP_1588_CLOCK=y
|
||||
CONFIG_RTC_CLASS=y
|
||||
# CONFIG_RTC_DRV_IMXDI is not set
|
||||
# CONFIG_RTC_DRV_MXC is not set
|
||||
# CONFIG_SERIAL_IMX is not set
|
||||
CONFIG_SMP_ON_UP=y
|
||||
CONFIG_SOC_BUS=y
|
||||
# CONFIG_SOC_IMX50 is not set
|
||||
# CONFIG_SOC_IMX51 is not set
|
||||
# CONFIG_SOC_IMX53 is not set
|
||||
# CONFIG_SOC_IMX6Q is not set
|
||||
# CONFIG_SOC_IMX6SL is not set
|
||||
# CONFIG_SOC_IMX6SX is not set
|
||||
# CONFIG_SOC_IMX6UL is not set
|
||||
# CONFIG_SOC_IMX7D is not set
|
||||
# CONFIG_SOC_LS1021A is not set
|
||||
# CONFIG_SOC_VF610 is not set
|
||||
# CONFIG_SPI_IMX is not set
|
||||
CONFIG_SRAM=y
|
||||
CONFIG_SWP_EMULATE=y
|
||||
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
|
||||
CONFIG_THERMAL_WRITABLE_TRIPS=y
|
||||
# CONFIG_THUMB2_KERNEL is not set
|
||||
CONFIG_TRACING_EVENTS_GPIO=y
|
||||
CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
|
||||
# CONFIG_USB_IMX21_HCD is not set
|
||||
CONFIG_USE_OF=y
|
||||
CONFIG_VECTORS_BASE=0xffff0000
|
||||
CONFIG_VFP=y
|
||||
CONFIG_VFPv3=y
|
||||
CONFIG_WATCHDOG_CORE=y
|
||||
CONFIG_XZ_DEC_ARM=y
|
||||
CONFIG_XZ_DEC_BCJ=y
|
||||
CONFIG_ZBOOT_ROM_BSS=0x0
|
||||
CONFIG_ZBOOT_ROM_TEXT=0x0
|
||||
CONFIG_ZLIB_DEFLATE=y
|
||||
CONFIG_ZONE_DMA_FLAG=0
|
@ -1 +0,0 @@
|
||||
../../64b/profiles/00-default.mk
|
@ -1,183 +0,0 @@
|
||||
CONFIG_64BIT=y
|
||||
CONFIG_ACPI=y
|
||||
CONFIG_ACPI_CCA_REQUIRED=y
|
||||
# CONFIG_ACPI_CONTAINER is not set
|
||||
# CONFIG_ACPI_CUSTOM_DSDT is not set
|
||||
# CONFIG_ACPI_DEBUG is not set
|
||||
# CONFIG_ACPI_DEBUGGER is not set
|
||||
# CONFIG_ACPI_DOCK is not set
|
||||
# CONFIG_ACPI_EC_DEBUGFS is not set
|
||||
CONFIG_ACPI_FAN=y
|
||||
CONFIG_ACPI_GENERIC_GSI=y
|
||||
# CONFIG_ACPI_PCI_SLOT is not set
|
||||
CONFIG_ACPI_PROCESSOR=y
|
||||
CONFIG_ACPI_REDUCED_HARDWARE_ONLY=y
|
||||
CONFIG_ACPI_THERMAL=y
|
||||
# CONFIG_ARCH_BCM_IPROC is not set
|
||||
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
|
||||
# CONFIG_ARCH_EXYNOS7 is not set
|
||||
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
|
||||
CONFIG_ARCH_HAS_HOLES_MEMORYMODEL=y
|
||||
# CONFIG_ARCH_SEATTLE is not set
|
||||
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
|
||||
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
|
||||
CONFIG_ARCH_SPARSEMEM_ENABLE=y
|
||||
# CONFIG_ARCH_SPRD is not set
|
||||
# CONFIG_ARCH_STRATIX10 is not set
|
||||
# CONFIG_ARCH_THUNDER is not set
|
||||
CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
|
||||
CONFIG_ARCH_WANT_FRAME_POINTERS=y
|
||||
CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
|
||||
# CONFIG_ARCH_XGENE is not set
|
||||
# CONFIG_ARCH_ZYNQMP is not set
|
||||
CONFIG_ARM64=y
|
||||
# CONFIG_ARM64_16K_PAGES is not set
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
# CONFIG_ARM64_64K_PAGES is not set
|
||||
# CONFIG_ARM64_CRYPTO is not set
|
||||
CONFIG_ARM64_ERRATUM_819472=y
|
||||
CONFIG_ARM64_ERRATUM_824069=y
|
||||
CONFIG_ARM64_ERRATUM_826319=y
|
||||
CONFIG_ARM64_ERRATUM_827319=y
|
||||
CONFIG_ARM64_ERRATUM_832075=y
|
||||
CONFIG_ARM64_ERRATUM_843419=y
|
||||
CONFIG_ARM64_ERRATUM_845719=y
|
||||
CONFIG_ARM64_HW_AFDBM=y
|
||||
# CONFIG_ARM64_LSE_ATOMICS is not set
|
||||
CONFIG_ARM64_PAN=y
|
||||
# CONFIG_ARM64_PTDUMP is not set
|
||||
# CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET is not set
|
||||
CONFIG_ARM64_VA_BITS=39
|
||||
CONFIG_ARM64_VA_BITS_39=y
|
||||
# CONFIG_ARM64_VA_BITS_48 is not set
|
||||
# CONFIG_ARMV8_DEPRECATED is not set
|
||||
CONFIG_ARM_AMBA=y
|
||||
CONFIG_ARM_GIC_V2M=y
|
||||
CONFIG_ARM_GIC_V3=y
|
||||
CONFIG_ARM_GIC_V3_ITS=y
|
||||
# CONFIG_ARM_PL172_MPMC is not set
|
||||
CONFIG_ARM_PSCI_FW=y
|
||||
# CONFIG_ARM_SP805_WATCHDOG is not set
|
||||
CONFIG_ATOMIC64_SELFTEST=y
|
||||
CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y
|
||||
CONFIG_BLOCK_COMPAT=y
|
||||
CONFIG_BOUNCE=y
|
||||
CONFIG_BSD_PROCESS_ACCT=y
|
||||
CONFIG_BSD_PROCESS_ACCT_V3=y
|
||||
CONFIG_BUILD_BIN2C=y
|
||||
# CONFIG_CAVIUM_ERRATUM_22375 is not set
|
||||
# CONFIG_CAVIUM_ERRATUM_23154 is not set
|
||||
CONFIG_CLKSRC_ACPI=y
|
||||
CONFIG_CLK_SP810=y
|
||||
CONFIG_CLK_VEXPRESS_OSC=y
|
||||
CONFIG_CMDLINE="console=ttyAMA0"
|
||||
CONFIG_COMMON_CLK_VERSATILE=y
|
||||
CONFIG_COMMON_CLK_XGENE=y
|
||||
CONFIG_COMPAT=y
|
||||
CONFIG_COMPAT_BINFMT_ELF=y
|
||||
CONFIG_COMPAT_NETLINK_MESSAGES=y
|
||||
CONFIG_COMPAT_OLD_SIGACTION=y
|
||||
# CONFIG_CPU_BIG_ENDIAN is not set
|
||||
CONFIG_CUSE=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_DEFAULT_IOSCHED="noop"
|
||||
CONFIG_DEFAULT_NOOP=y
|
||||
CONFIG_DMI=y
|
||||
CONFIG_DMIID=y
|
||||
# CONFIG_DMI_SYSFS is not set
|
||||
CONFIG_EFI=y
|
||||
# CONFIG_EFIVAR_FS is not set
|
||||
CONFIG_EFI_ARMSTUB=y
|
||||
CONFIG_EFI_ESRT=y
|
||||
CONFIG_EFI_PARAMS_FROM_FDT=y
|
||||
CONFIG_EFI_RUNTIME_WRAPPERS=y
|
||||
CONFIG_EFI_STUB=y
|
||||
# CONFIG_EFI_VARS is not set
|
||||
CONFIG_FSL_MC_BUS=y
|
||||
CONFIG_FSL_QMAN_FQ_LOOKUP=y
|
||||
CONFIG_FS_MBCACHE=y
|
||||
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
|
||||
CONFIG_GENERIC_CPU_AUTOPROBE=y
|
||||
CONFIG_GENERIC_CSUM=y
|
||||
CONFIG_GENERIC_EARLY_IOREMAP=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIO_ACPI=y
|
||||
# CONFIG_GPIO_AMDPT is not set
|
||||
# CONFIG_GPIO_XGENE is not set
|
||||
CONFIG_GRACE_PERIOD=y
|
||||
CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
|
||||
CONFIG_HAVE_ARCH_KASAN=y
|
||||
CONFIG_HAVE_CMPXCHG_DOUBLE=y
|
||||
CONFIG_HAVE_CMPXCHG_LOCAL=y
|
||||
CONFIG_HAVE_DEBUG_BUGVERBOSE=y
|
||||
CONFIG_HAVE_MEMORY_PRESENT=y
|
||||
CONFIG_HAVE_PATA_PLATFORM=y
|
||||
# CONFIG_HPET is not set
|
||||
CONFIG_HW_RANDOM=y
|
||||
CONFIG_HW_RANDOM_VIRTIO=y
|
||||
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
|
||||
# CONFIG_IOSCHED_DEADLINE is not set
|
||||
CONFIG_IP_PNP=y
|
||||
CONFIG_IP_PNP_BOOTP=y
|
||||
CONFIG_IP_PNP_DHCP=y
|
||||
# CONFIG_IP_PNP_RARP is not set
|
||||
CONFIG_JBD2=y
|
||||
# CONFIG_LIQUIDIO is not set
|
||||
CONFIG_LOCKD=y
|
||||
CONFIG_LOGO=y
|
||||
CONFIG_LOGO_LINUX_CLUT224=y
|
||||
# CONFIG_LOGO_LINUX_MONO is not set
|
||||
# CONFIG_LOGO_LINUX_VGA16 is not set
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_MFD_CORE=y
|
||||
CONFIG_MFD_VEXPRESS_SYSREG=y
|
||||
CONFIG_MODULES_USE_ELF_RELA=y
|
||||
CONFIG_NEED_SG_DMA_LENGTH=y
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
CONFIG_NO_HZ=y
|
||||
CONFIG_PCI_BUS_ADDR_T_64BIT=y
|
||||
# CONFIG_PCI_HISI is not set
|
||||
CONFIG_PCI_LABEL=y
|
||||
# CONFIG_PHY_XGENE is not set
|
||||
# CONFIG_PMIC_OPREGION is not set
|
||||
CONFIG_PNP=y
|
||||
CONFIG_PNPACPI=y
|
||||
CONFIG_PNP_DEBUG_MESSAGES=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
CONFIG_POSIX_MQUEUE_SYSCTL=y
|
||||
# CONFIG_PREEMPT_NONE is not set
|
||||
CONFIG_PREEMPT_VOLUNTARY=y
|
||||
CONFIG_PROFILING=y
|
||||
# CONFIG_POWER_RESET_VEXPRESS is not set
|
||||
CONFIG_ROOT_NFS=y
|
||||
# CONFIG_SCSI_LOWLEVEL is not set
|
||||
# CONFIG_SCSI_PROC_FS is not set
|
||||
CONFIG_SERIAL_8250_PNP=y
|
||||
# CONFIG_SERIAL_AMBA_PL010 is not set
|
||||
CONFIG_SERIAL_AMBA_PL011=y
|
||||
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
|
||||
CONFIG_SMC91X=y
|
||||
CONFIG_SPARSEMEM=y
|
||||
CONFIG_SPARSEMEM_EXTREME=y
|
||||
CONFIG_SPARSEMEM_MANUAL=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
|
||||
CONFIG_SUNRPC=y
|
||||
# CONFIG_SWAP is not set
|
||||
CONFIG_SYSCTL_EXCEPTION_TRACE=y
|
||||
CONFIG_SYSVIPC_COMPAT=y
|
||||
# CONFIG_THUNDER_NIC_BGX is not set
|
||||
# CONFIG_THUNDER_NIC_PF is not set
|
||||
# CONFIG_THUNDER_NIC_VF is not set
|
||||
CONFIG_UCS2_STRING=y
|
||||
CONFIG_VEXPRESS_CONFIG=y
|
||||
CONFIG_VEXPRESS_SYSCFG=y
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_VIDEOMODE_HELPERS=y
|
||||
CONFIG_VIRTIO=y
|
||||
CONFIG_VIRTIO_BLK=y
|
||||
# CONFIG_VIRTIO_CONSOLE is not set
|
||||
CONFIG_VIRTIO_MMIO=y
|
||||
# CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES is not set
|
||||
CONFIG_VIRTIO_NET=y
|
@ -9,18 +9,17 @@ include $(TOPDIR)/rules.mk
|
||||
BOARD:=layerscape
|
||||
BOARDNAME:=NXP Layerscape
|
||||
DEVICE_TYPE:=developerboard
|
||||
KERNEL_PATCHVER:=4.4
|
||||
KERNELNAME:=Image dtbs
|
||||
KERNEL_PATCHVER:=4.9
|
||||
FEATURES:=squashfs nand usb pcie gpio
|
||||
SUBTARGETS:=64b 32b
|
||||
MAINTAINER:=Jiang Yutang <jiangyutang1978@gmail.com>
|
||||
|
||||
include $(INCLUDE_DIR)/target.mk
|
||||
SUBTARGETS:=armv8_64b armv8_32b
|
||||
MAINTAINER:=Yangbo Lu <yangbo.lu@nxp.com>
|
||||
|
||||
define Target/Description
|
||||
Build firmware images for $(BOARDNAME) SoC devices.
|
||||
Build firmware images for NXP Layerscape based boards.
|
||||
endef
|
||||
|
||||
include $(INCLUDE_DIR)/target.mk
|
||||
|
||||
DEFAULT_PACKAGES += kmod-usb3 kmod-usb-dwc3 kmod-usb-storage
|
||||
|
||||
$(eval $(call BuildTarget))
|
||||
|
1444
target/linux/layerscape/armv8_32b/config-4.9
Normal file
1444
target/linux/layerscape/armv8_32b/config-4.9
Normal file
File diff suppressed because it is too large
Load Diff
@ -6,9 +6,11 @@
|
||||
#
|
||||
|
||||
ARCH:=arm
|
||||
BOARDNAME:=layerscape 32b boards
|
||||
CPU_TYPE:=cortex-a9
|
||||
BOARDNAME:=ARMv8 32-bit based boards
|
||||
CPU_TYPE:=cortex-a15
|
||||
CPU_SUBTYPE:=neon-vfpv4
|
||||
KERNELNAME:=zImage dtbs
|
||||
|
||||
define Target/Description
|
||||
Build firmware images for $(BOARDNAME) SoC devices.
|
||||
Build firmware images for NXP Layerscape ARMv8 32-bit based boards.
|
||||
endef
|
1346
target/linux/layerscape/armv8_64b/config-4.9
Normal file
1346
target/linux/layerscape/armv8_64b/config-4.9
Normal file
File diff suppressed because it is too large
Load Diff
18
target/linux/layerscape/armv8_64b/profiles/00-default.mk
Normal file
18
target/linux/layerscape/armv8_64b/profiles/00-default.mk
Normal file
@ -0,0 +1,18 @@
|
||||
define Profile/Default
|
||||
NAME:=Default Profile
|
||||
PRIORITY:=1
|
||||
endef
|
||||
|
||||
define Profile/Default/Description
|
||||
Default package set compatible with most boards.
|
||||
endef
|
||||
|
||||
DEFAULT_PACKAGES+= \
|
||||
rcw-layerscape-ls1043ardb uboot-layerscape-$(SUBTARGET)-ls1043ardb \
|
||||
fman-layerscape-ls1043ardb \
|
||||
rcw-layerscape-ls1046ardb uboot-layerscape-$(SUBTARGET)-ls1046ardb \
|
||||
fman-layerscape-ls1046ardb \
|
||||
rcw-layerscape-ls1012ardb uboot-layerscape-$(SUBTARGET)-ls1012ardb \
|
||||
kmod-ppfe ppfe-ls1012ardb
|
||||
|
||||
$(eval $(call Profile,Default))
|
@ -6,9 +6,9 @@
|
||||
#
|
||||
|
||||
ARCH:=aarch64
|
||||
BOARDNAME:=layerscape 64b boards
|
||||
BOARDNAME:=ARMv8 64-bit based boards
|
||||
KERNELNAME:=Image dtbs
|
||||
|
||||
define Target/Description
|
||||
Build firmware images for $(BOARDNAME) SoC devices.
|
||||
Build firmware images for NXP Layerscape ARMv8 64-bit based boards.
|
||||
endef
|
||||
|
@ -1,310 +0,0 @@
|
||||
CONFIG_AQUANTIA_PHY=y
|
||||
CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
|
||||
CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
|
||||
CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
|
||||
CONFIG_ARCH_HAS_SG_CHAIN=y
|
||||
CONFIG_ARCH_HAS_TICK_BROADCAST=y
|
||||
CONFIG_ARCH_LAYERSCAPE=y
|
||||
CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
|
||||
CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
|
||||
CONFIG_ARCH_SUSPEND_POSSIBLE=y
|
||||
CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
|
||||
CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
|
||||
CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
|
||||
CONFIG_ARM_ARCH_TIMER=y
|
||||
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
|
||||
CONFIG_ARM_GIC=y
|
||||
CONFIG_BLK_DEV_LOOP=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
# CONFIG_CAVIUM_ERRATUM_27456 is not set
|
||||
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
|
||||
CONFIG_CLKDEV_LOOKUP=y
|
||||
CONFIG_CLKSRC_MMIO=y
|
||||
CONFIG_CLKSRC_OF=y
|
||||
CONFIG_CLKSRC_PROBE=y
|
||||
CONFIG_CLK_QORIQ=y
|
||||
CONFIG_CLONE_BACKWARDS=y
|
||||
CONFIG_COMMON_CLK=y
|
||||
CONFIG_CPU_RMAP=y
|
||||
CONFIG_CRC16=y
|
||||
CONFIG_CRYPTO_CRC32C=y
|
||||
CONFIG_CRYPTO_HASH=y
|
||||
CONFIG_CRYPTO_HASH2=y
|
||||
CONFIG_CRYPTO_RNG2=y
|
||||
CONFIG_CRYPTO_WORKQUEUE=y
|
||||
CONFIG_DCACHE_WORD_ACCESS=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_EDAC_SUPPORT=y
|
||||
CONFIG_EXT4_FS=y
|
||||
CONFIG_FAT_FS=y
|
||||
CONFIG_FIXED_PHY=y
|
||||
CONFIG_FIX_EARLYCON_MEM=y
|
||||
CONFIG_FMAN_ARM=y
|
||||
# CONFIG_FMAN_MIB_CNT_OVF_IRQ_EN is not set
|
||||
# CONFIG_FMAN_P1023 is not set
|
||||
# CONFIG_FMAN_P3040_P4080_P5020 is not set
|
||||
# CONFIG_FMAN_PFC is not set
|
||||
# CONFIG_FMAN_V3H is not set
|
||||
# CONFIG_FMAN_V3L is not set
|
||||
CONFIG_FRAME_POINTER=y
|
||||
CONFIG_FSL_BMAN=y
|
||||
CONFIG_FSL_BMAN_CONFIG=y
|
||||
CONFIG_FSL_BMAN_DEBUGFS=y
|
||||
# CONFIG_FSL_BMAN_TEST is not set
|
||||
CONFIG_FSL_DPA=y
|
||||
# CONFIG_FSL_DPAA_1588 is not set
|
||||
CONFIG_FSL_DPAA_ADVANCED_DRIVERS=y
|
||||
# CONFIG_FSL_DPAA_CEETM is not set
|
||||
CONFIG_FSL_DPAA_CS_THRESHOLD_10G=0x10000000
|
||||
CONFIG_FSL_DPAA_CS_THRESHOLD_1G=0x06000000
|
||||
# CONFIG_FSL_DPAA_DBG_LOOP is not set
|
||||
# CONFIG_FSL_DPAA_ETH_DEBUG is not set
|
||||
CONFIG_FSL_DPAA_ETH_DEBUGFS=y
|
||||
CONFIG_FSL_DPAA_ETH_MAX_BUF_COUNT=128
|
||||
CONFIG_FSL_DPAA_ETH_REFILL_THRESHOLD=80
|
||||
CONFIG_FSL_DPAA_ETH_USE_NDO_SELECT_QUEUE=y
|
||||
CONFIG_FSL_DPAA_GENERIC_DRIVER=y
|
||||
# CONFIG_FSL_DPAA_HOOKS is not set
|
||||
CONFIG_FSL_DPAA_INGRESS_CS_THRESHOLD=0x10000000
|
||||
# CONFIG_FSL_DPAA_MACSEC is not set
|
||||
CONFIG_FSL_DPAA_OFFLINE_PORTS=y
|
||||
# CONFIG_FSL_DPAA_TS is not set
|
||||
CONFIG_FSL_DPA_CAN_WAIT=y
|
||||
CONFIG_FSL_DPA_CAN_WAIT_SYNC=y
|
||||
# CONFIG_FSL_DPA_CHECKING is not set
|
||||
CONFIG_FSL_DPA_PIRQ_FAST=y
|
||||
CONFIG_FSL_DPA_PIRQ_SLOW=y
|
||||
CONFIG_FSL_DPA_PORTAL_SHARE=y
|
||||
CONFIG_FSL_FM_MAX_FRAME_SIZE=1522
|
||||
CONFIG_FSL_FM_RX_EXTRA_HEADROOM=64
|
||||
CONFIG_FSL_IFC=y
|
||||
CONFIG_FSL_QMAN=y
|
||||
CONFIG_FSL_QMAN_CI_SCHED_CFG_BMAN_W=2
|
||||
CONFIG_FSL_QMAN_CI_SCHED_CFG_RW_W=2
|
||||
CONFIG_FSL_QMAN_CI_SCHED_CFG_SRCCIV=4
|
||||
CONFIG_FSL_QMAN_CI_SCHED_CFG_SRQ_W=3
|
||||
CONFIG_FSL_QMAN_CONFIG=y
|
||||
CONFIG_FSL_QMAN_DEBUGFS=y
|
||||
CONFIG_FSL_QMAN_FQD_SZ=10
|
||||
CONFIG_FSL_QMAN_INIT_TIMEOUT=10
|
||||
CONFIG_FSL_QMAN_PFDR_SZ=13
|
||||
CONFIG_FSL_QMAN_PIRQ_DQRR_ITHRESH=12
|
||||
CONFIG_FSL_QMAN_PIRQ_IPERIOD=100
|
||||
CONFIG_FSL_QMAN_PIRQ_MR_ITHRESH=4
|
||||
CONFIG_FSL_QMAN_POLL_LIMIT=32
|
||||
# CONFIG_FSL_QMAN_TEST is not set
|
||||
CONFIG_FSL_SDK_DPAA_ETH=y
|
||||
CONFIG_FSL_SDK_FMAN=y
|
||||
# CONFIG_FSL_SDK_FMAN_TEST is not set
|
||||
CONFIG_FSL_USDPAA=y
|
||||
CONFIG_FSL_XGMAC_MDIO=y
|
||||
# CONFIG_FTL is not set
|
||||
CONFIG_GENERIC_ALLOCATOR=y
|
||||
CONFIG_GENERIC_BUG=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
|
||||
CONFIG_GENERIC_IDLE_POLL_SETUP=y
|
||||
CONFIG_GENERIC_IO=y
|
||||
CONFIG_GENERIC_IRQ_SHOW=y
|
||||
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
|
||||
CONFIG_GENERIC_MSI_IRQ=y
|
||||
CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
|
||||
CONFIG_GENERIC_PCI_IOMAP=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
# CONFIG_GIANFAR is not set
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIO_DEVRES=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_GPIO_GENERIC_PLATFORM=y
|
||||
CONFIG_GPIO_MPC8XXX=y
|
||||
CONFIG_GPIO_SYSFS=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
CONFIG_HARDIRQS_SW_RESEND=y
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_FSL_QBMAN=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HAS_IOPORT_MAP=y
|
||||
# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
|
||||
CONFIG_HAVE_ARCH_AUDITSYSCALL=y
|
||||
CONFIG_HAVE_ARCH_BITREVERSE=y
|
||||
CONFIG_HAVE_ARCH_JUMP_LABEL=y
|
||||
CONFIG_HAVE_ARCH_KGDB=y
|
||||
CONFIG_HAVE_ARCH_PFN_VALID=y
|
||||
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
|
||||
CONFIG_HAVE_ARCH_TRACEHOOK=y
|
||||
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
|
||||
# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
|
||||
CONFIG_HAVE_BPF_JIT=y
|
||||
CONFIG_HAVE_CC_STACKPROTECTOR=y
|
||||
CONFIG_HAVE_CLK=y
|
||||
CONFIG_HAVE_CLK_PREPARE=y
|
||||
CONFIG_HAVE_CONTEXT_TRACKING=y
|
||||
CONFIG_HAVE_C_RECORDMCOUNT=y
|
||||
CONFIG_HAVE_DEBUG_KMEMLEAK=y
|
||||
CONFIG_HAVE_DMA_API_DEBUG=y
|
||||
CONFIG_HAVE_DMA_ATTRS=y
|
||||
CONFIG_HAVE_DMA_CONTIGUOUS=y
|
||||
CONFIG_HAVE_DYNAMIC_FTRACE=y
|
||||
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
|
||||
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
|
||||
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
|
||||
CONFIG_HAVE_FUNCTION_TRACER=y
|
||||
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
|
||||
CONFIG_HAVE_GENERIC_RCU_GUP=y
|
||||
CONFIG_HAVE_MEMBLOCK=y
|
||||
CONFIG_HAVE_NET_DSA=y
|
||||
CONFIG_HAVE_PERF_EVENTS=y
|
||||
CONFIG_HAVE_PERF_REGS=y
|
||||
CONFIG_HAVE_PERF_USER_STACK_DUMP=y
|
||||
CONFIG_HAVE_RCU_TABLE_FREE=y
|
||||
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
|
||||
CONFIG_HAVE_UID16=y
|
||||
CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
|
||||
# CONFIG_HUGETLBFS is not set
|
||||
CONFIG_I2C=y
|
||||
# CONFIG_ACPI_I2C_OPREGION is not set
|
||||
CONFIG_I2C_BOARDINFO=y
|
||||
CONFIG_I2C_CHARDEV=y
|
||||
CONFIG_I2C_IMX=y
|
||||
CONFIG_I2C_MUX=y
|
||||
CONFIG_I2C_MUX_PCA954x=y
|
||||
# CONFIG_IMX2_WDT is not set
|
||||
CONFIG_INITRAMFS_SOURCE=""
|
||||
CONFIG_IOMMU_HELPER=y
|
||||
CONFIG_IRQCHIP=y
|
||||
CONFIG_IRQ_DOMAIN=y
|
||||
CONFIG_IRQ_DOMAIN_HIERARCHY=y
|
||||
CONFIG_IRQ_FORCED_THREADING=y
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_LIBFDT=y
|
||||
CONFIG_LOCK_SPIN_ON_OWNER=y
|
||||
CONFIG_LS_SCFG_MSI=y
|
||||
CONFIG_LZO_COMPRESS=y
|
||||
CONFIG_LZO_DECOMPRESS=y
|
||||
CONFIG_MDIO_BOARDINFO=y
|
||||
CONFIG_MEMORY=y
|
||||
CONFIG_MFD_SYSCON=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_BLOCK=y
|
||||
CONFIG_MMC_BLOCK_MINORS=8
|
||||
CONFIG_MMC_BLOCK_BOUNCE=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_PLTFM=y
|
||||
CONFIG_MMC_SDHCI_OF_ESDHC=y
|
||||
# CONFIG_MMC_SDHCI_PCI is not set
|
||||
# CONFIG_MMC_TIFM_SD is not set
|
||||
CONFIG_MTD_CFI_ADV_OPTIONS=y
|
||||
CONFIG_MTD_CFI_BE_BYTE_SWAP=y
|
||||
# CONFIG_MTD_CFI_GEOMETRY is not set
|
||||
# CONFIG_MTD_CFI_NOSWAP is not set
|
||||
CONFIG_MTD_CFI_STAA=y
|
||||
CONFIG_MTD_CMDLINE_PARTS=y
|
||||
CONFIG_MTD_NAND=y
|
||||
CONFIG_MTD_NAND_ECC=y
|
||||
CONFIG_MTD_NAND_FSL_IFC=y
|
||||
CONFIG_MUTEX_SPIN_ON_OWNER=y
|
||||
CONFIG_NEED_DMA_MAP_STATE=y
|
||||
CONFIG_NET_FLOW_LIMIT=y
|
||||
CONFIG_NLS=y
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NO_BOOTMEM=y
|
||||
CONFIG_NO_HZ_COMMON=y
|
||||
CONFIG_NO_HZ_IDLE=y
|
||||
CONFIG_NR_CPUS=4
|
||||
CONFIG_OF=y
|
||||
CONFIG_OF_ADDRESS=y
|
||||
CONFIG_OF_ADDRESS_PCI=y
|
||||
CONFIG_OF_EARLY_FLATTREE=y
|
||||
CONFIG_OF_FLATTREE=y
|
||||
CONFIG_OF_GPIO=y
|
||||
CONFIG_OF_IRQ=y
|
||||
CONFIG_OF_MDIO=y
|
||||
CONFIG_OF_MTD=y
|
||||
CONFIG_OF_NET=y
|
||||
CONFIG_OF_PCI=y
|
||||
CONFIG_OF_PCI_IRQ=y
|
||||
CONFIG_OF_RESERVED_MEM=y
|
||||
CONFIG_OLD_SIGSUSPEND3=y
|
||||
CONFIG_PCI=y
|
||||
CONFIG_PCIEAER=y
|
||||
CONFIG_PCIEASPM=y
|
||||
# CONFIG_PCIEASPM_DEBUG is not set
|
||||
CONFIG_PCIEASPM_DEFAULT=y
|
||||
# CONFIG_PCIEASPM_PERFORMANCE is not set
|
||||
# CONFIG_PCIEASPM_POWERSAVE is not set
|
||||
CONFIG_PCIEPORTBUS=y
|
||||
CONFIG_PCIE_DW=y
|
||||
CONFIG_PCI_DOMAINS=y
|
||||
CONFIG_PCI_DOMAINS_GENERIC=y
|
||||
CONFIG_PCI_LAYERSCAPE=y
|
||||
CONFIG_PCI_MSI=y
|
||||
CONFIG_PCI_MSI_IRQ_DOMAIN=y
|
||||
CONFIG_PERF_USE_VMALLOC=y
|
||||
CONFIG_PGTABLE_LEVELS=3
|
||||
CONFIG_PHYLIB=y
|
||||
CONFIG_PHYS_ADDR_T_64BIT=y
|
||||
CONFIG_POWER_RESET=y
|
||||
CONFIG_POWER_RESET_LAYERSCAPE=y
|
||||
# CONFIG_POWER_RESET_XGENE is not set
|
||||
CONFIG_POWER_SUPPLY=y
|
||||
CONFIG_QMAN_CEETM_UPDATE_PERIOD=1000
|
||||
CONFIG_RAS=y
|
||||
CONFIG_RATIONAL=y
|
||||
CONFIG_RCU_STALL_COMMON=y
|
||||
CONFIG_REALTEK_PHY=y
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_REGMAP_MMIO=y
|
||||
CONFIG_RFS_ACCEL=y
|
||||
CONFIG_RPS=y
|
||||
CONFIG_RWSEM_SPIN_ON_OWNER=y
|
||||
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
|
||||
# CONFIG_SCHED_INFO is not set
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_SERIAL_8250_FSL=y
|
||||
CONFIG_SERIAL_OF_PLATFORM=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_SPARSE_IRQ=y
|
||||
CONFIG_SQUASHFS=y
|
||||
# CONFIG_SQUASHFS_FILE_CACHE is not set
|
||||
CONFIG_SQUASHFS_FILE_DIRECT=y
|
||||
# CONFIG_SQUASHFS_DECOMP_SINGLE is not set
|
||||
# CONFIG_SQUASHFS_DECOMP_MULTI is not set
|
||||
CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y
|
||||
# CONFIG_SQUASHFS_XATTR is not set
|
||||
# CONFIG_SQUASHFS_ZLIB is not set
|
||||
# CONFIG_SQUASHFS_LZ4 is not set
|
||||
# CONFIG_SQUASHFS_LZO is not set
|
||||
CONFIG_SQUASHFS_XZ=y
|
||||
# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set
|
||||
# CONFIG_SQUASHFS_EMBEDDED is not set
|
||||
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
|
||||
CONFIG_SRCU=y
|
||||
CONFIG_SWIOTLB=y
|
||||
CONFIG_SYS_SUPPORTS_HUGETLBFS=y
|
||||
CONFIG_THERMAL=y
|
||||
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_OF=y
|
||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
||||
CONFIG_TREE_RCU=y
|
||||
CONFIG_USB_SUPPORT=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_VITESSE_PHY=y
|
||||
CONFIG_XPS=y
|
||||
CONFIG_ZLIB_INFLATE=y
|
||||
CONFIG_MTD_SPI_NOR=y
|
||||
CONFIG_SPI_FSL_QUADSPI=y
|
||||
CONFIG_FSL_MC_BUS=y
|
||||
CONFIG_FSL_MC_RESTOOL=y
|
||||
CONFIG_FSL_MC_DPIO=y
|
||||
# CONFIG_FSL_QBMAN_DEBUG is not set
|
||||
CONFIG_FSL_DPAA2=y
|
||||
CONFIG_FSL_DPAA2_ETH=y
|
||||
# CONFIG_FSL_DPAA2_ETH_USE_ERR_QUEUE is not set
|
||||
CONFIG_FSL_DPAA2_MAC=y
|
||||
# CONFIG_FSL_DPAA2_MAC_NETDEVS is not set
|
||||
CONFIG_FSL_DPAA2_EVB=y
|
||||
CONFIG_FSL_DPAA2_ETHSW=y
|
@ -33,15 +33,17 @@ endef
|
||||
define Device/Default
|
||||
PROFILES = Default
|
||||
FILESYSTEMS := squashfs
|
||||
KERNEL := kernel-bin | gzip | uImage gzip
|
||||
DEVICE_DTS :=
|
||||
IMAGES = firmware.bin
|
||||
|
||||
ifeq ($(SUBTARGET),64b)
|
||||
ifeq ($(SUBTARGET),armv8_64b)
|
||||
KERNEL := kernel-bin | gzip | uImage gzip
|
||||
KERNEL_LOADADDR = 0x80080000
|
||||
KERNEL_ENTRY_POINT = 0x80080000
|
||||
endif
|
||||
ifeq ($(SUBTARGET),32b)
|
||||
ifeq ($(SUBTARGET),armv8_32b)
|
||||
KERNEL := kernel-bin | uImage none
|
||||
KERNEL_NAME := zImage
|
||||
KERNEL_LOADADDR = 0x80008000
|
||||
KERNEL_ENTRY_POINT = 0x80008000
|
||||
endif
|
||||
@ -50,74 +52,61 @@ endef
|
||||
define Device/ls1043ardb
|
||||
DEVICE_TITLE := ls1043ardb-$(SUBTARGET)
|
||||
DEVICE_PACKAGES += rcw-layerscape-ls1043ardb uboot-layerscape-$(SUBTARGET)-ls1043ardb fman-layerscape-ls1043ardb
|
||||
ifeq ($(SUBTARGET),64b)
|
||||
DEVICE_DTS = freescale/fsl-ls1043a-rdb
|
||||
endif
|
||||
ifeq ($(SUBTARGET),32b)
|
||||
DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1043a-rdb
|
||||
endif
|
||||
IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | append-ls-uboot $(1) | pad-to 3M | \
|
||||
append-ls-fman $(1) | pad-to 4M | append-ls-dtb $$(DEVICE_DTS) | pad-to 5M | \
|
||||
append-kernel | pad-to 10M | append-rootfs | pad-rootfs | check-size 67108865
|
||||
DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1043a-rdb-sdk
|
||||
IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
|
||||
append-ls-uboot $(1) | pad-to 9M | \
|
||||
append-ls-fman $(1) | pad-to 15M | \
|
||||
append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
|
||||
append-kernel | pad-to 32M | \
|
||||
append-rootfs | pad-rootfs | check-size 67108865
|
||||
endef
|
||||
TARGET_DEVICES += ls1043ardb
|
||||
|
||||
define Device/ls1046ardb
|
||||
DEVICE_TITLE := ls1046ardb-$(SUBTARGET)
|
||||
DEVICE_PACKAGES += rcw-layerscape-ls1046ardb uboot-layerscape-$(SUBTARGET)-ls1046ardb fman-layerscape-ls1046ardb
|
||||
ifeq ($(SUBTARGET),64b)
|
||||
DEVICE_DTS = freescale/fsl-ls1046a-rdb
|
||||
endif
|
||||
ifeq ($(SUBTARGET),32b)
|
||||
DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1046a-rdb
|
||||
endif
|
||||
IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | append-ls-uboot $(1) | pad-to 3M | \
|
||||
append-ls-fman $(1) | pad-to 4M | append-ls-dtb $$(DEVICE_DTS) | pad-to 5M | \
|
||||
append-kernel | pad-to 10M | append-ls-rootfs-ext4 $(1) 22M | check-size 33554433
|
||||
DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1046a-rdb-sdk
|
||||
IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
|
||||
append-ls-uboot $(1) | pad-to 9M | \
|
||||
append-ls-fman $(1) | pad-to 15M | \
|
||||
append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
|
||||
append-kernel | pad-to 32M | \
|
||||
append-ls-rootfs-ext4 $(1) 22M | check-size 67108865
|
||||
endef
|
||||
TARGET_DEVICES += ls1046ardb
|
||||
|
||||
define Device/ls1012ardb
|
||||
DEVICE_TITLE := ls1012ardb-$(SUBTARGET)
|
||||
DEVICE_PACKAGES += rcw-layerscape-ls1012ardb uboot-layerscape-$(SUBTARGET)-ls1012ardb kmod-ppfe ppfe-ls1012ardb
|
||||
ifeq ($(SUBTARGET),64b)
|
||||
DEVICE_DTS = freescale/fsl-ls1012a-rdb
|
||||
endif
|
||||
ifeq ($(SUBTARGET),32b)
|
||||
DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1012a-rdb
|
||||
endif
|
||||
IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | append-ls-uboot $(1) | pad-to 3M | \
|
||||
append-ls-dtb $$(DEVICE_DTS) | pad-to 4M | append-kernel | pad-to 9M | \
|
||||
append-ls-rootfs-ext4 $(1) 23M | check-size 33554433
|
||||
IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
|
||||
append-ls-uboot $(1) | pad-to 15M | \
|
||||
append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
|
||||
append-kernel | pad-to 32M | \
|
||||
append-ls-rootfs-ext4 $(1) 23M | check-size 67108865
|
||||
endef
|
||||
TARGET_DEVICES += ls1012ardb
|
||||
|
||||
ifeq ($(SUBTARGET),armv8_64b)
|
||||
define Device/ls1088ardb
|
||||
DEVICE_TITLE := ls1088ardb-$(SUBTARGET)
|
||||
DEVICE_PACKAGES += rcw-layerscape-ls1088ardb uboot-layerscape-$(SUBTARGET)-ls1088ardb mc-binary-ls1088ardb
|
||||
ifeq ($(SUBTARGET),64b)
|
||||
DEVICE_DTS = freescale/fsl-ls1088a-rdb
|
||||
endif
|
||||
ifeq ($(SUBTARGET),32b)
|
||||
DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1088a-rdb
|
||||
endif
|
||||
IMAGE/firmware.bin = append-ls-dtb $$(DEVICE_DTS) | pad-to 1M | append-kernel | pad-to 6M | \
|
||||
append-ls-rootfs-ext4 $(1) 17M | check-size 24117249
|
||||
IMAGE/firmware.bin = append-ls-dtb $$(DEVICE_DTS) | pad-to 1M | \
|
||||
append-kernel | pad-to 17M | \
|
||||
append-ls-rootfs-ext4 $(1) 17M | check-size 51380225
|
||||
endef
|
||||
TARGET_DEVICES += ls1088ardb
|
||||
|
||||
define Device/ls2088ardb
|
||||
DEVICE_TITLE := ls2088ardb-$(SUBTARGET)
|
||||
DEVICE_PACKAGES += rcw-layerscape-ls2088ardb uboot-layerscape-$(SUBTARGET)-ls2088ardb mc-binary-ls2088ardb
|
||||
ifeq ($(SUBTARGET),64b)
|
||||
DEVICE_DTS = freescale/fsl-ls2088a-rdb
|
||||
endif
|
||||
ifeq ($(SUBTARGET),32b)
|
||||
DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls2088a-rdb
|
||||
endif
|
||||
IMAGE/firmware.bin = append-ls-dtb $$(DEVICE_DTS) | pad-to 1M | append-kernel | pad-to 6M | \
|
||||
append-rootfs | pad-rootfs | check-size 24117249
|
||||
IMAGE/firmware.bin = append-ls-dtb $$(DEVICE_DTS) | pad-to 1M | \
|
||||
append-kernel | pad-to 17M | \
|
||||
append-rootfs | pad-rootfs | check-size 51380225
|
||||
endef
|
||||
TARGET_DEVICES += ls2088ardb
|
||||
endif
|
||||
|
||||
$(eval $(call BuildImage))
|
||||
|
@ -1,43 +0,0 @@
|
||||
From 7f434723cdb6823443330cd4847d5c3b8dd30bd7 Mon Sep 17 00:00:00 2001
|
||||
From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
|
||||
Date: Fri, 18 Dec 2015 14:38:55 +0200
|
||||
Subject: [PATCH 51/70] PCI: designware: Ensure ATU is enabled before IO/conf
|
||||
space accesses
|
||||
|
||||
Read back the ATU CR2 register to ensure ATU programming is effective
|
||||
before any subsequent I/O or config space accesses.
|
||||
|
||||
Without this, PCI device enumeration is unreliable.
|
||||
|
||||
[bhelgaas: changelog, comment]
|
||||
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
|
||||
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
|
||||
Acked-by: Pratyush Anand <pratyush.anand@gmail.com>
|
||||
---
|
||||
drivers/pci/host/pcie-designware.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
--- a/drivers/pci/host/pcie-designware.c
|
||||
+++ b/drivers/pci/host/pcie-designware.c
|
||||
@@ -154,6 +154,8 @@ static int dw_pcie_wr_own_conf(struct pc
|
||||
static void dw_pcie_prog_outbound_atu(struct pcie_port *pp, int index,
|
||||
int type, u64 cpu_addr, u64 pci_addr, u32 size)
|
||||
{
|
||||
+ u32 val;
|
||||
+
|
||||
dw_pcie_writel_rc(pp, PCIE_ATU_REGION_OUTBOUND | index,
|
||||
PCIE_ATU_VIEWPORT);
|
||||
dw_pcie_writel_rc(pp, lower_32_bits(cpu_addr), PCIE_ATU_LOWER_BASE);
|
||||
@@ -164,6 +166,12 @@ static void dw_pcie_prog_outbound_atu(st
|
||||
dw_pcie_writel_rc(pp, upper_32_bits(pci_addr), PCIE_ATU_UPPER_TARGET);
|
||||
dw_pcie_writel_rc(pp, type, PCIE_ATU_CR1);
|
||||
dw_pcie_writel_rc(pp, PCIE_ATU_ENABLE, PCIE_ATU_CR2);
|
||||
+
|
||||
+ /*
|
||||
+ * Make sure ATU enable takes effect before any subsequent config
|
||||
+ * and I/O accesses.
|
||||
+ */
|
||||
+ dw_pcie_readl_rc(pp, PCIE_ATU_CR2, &val);
|
||||
}
|
||||
|
||||
static struct irq_chip dw_msi_irq_chip = {
|
@ -1,121 +0,0 @@
|
||||
From 610b32220391c9d271290bdf8f2b8fe1cf8da9a0 Mon Sep 17 00:00:00 2001
|
||||
From: Bjorn Helgaas <bhelgaas@google.com>
|
||||
Date: Tue, 5 Jan 2016 15:48:11 -0600
|
||||
Subject: [PATCH 52/70] PCI: designware: Simplify control flow
|
||||
|
||||
Return values immediately when possible to simplify the control flow.
|
||||
|
||||
No functional change intended. Folded in unused variable removal as
|
||||
pointed out by Fabio Estevam <fabio.estevam@nxp.com>, Arnd Bergmann
|
||||
<arnd@arndb.de>, and Thierry Reding <thierry.reding@gmail.com>.
|
||||
|
||||
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
|
||||
Acked-by: Pratyush Anand <pratyush.anand@gmail.com>
|
||||
---
|
||||
drivers/pci/host/pcie-designware.c | 54 ++++++++++++------------------------
|
||||
1 file changed, 18 insertions(+), 36 deletions(-)
|
||||
|
||||
--- a/drivers/pci/host/pcie-designware.c
|
||||
+++ b/drivers/pci/host/pcie-designware.c
|
||||
@@ -128,27 +128,19 @@ static inline void dw_pcie_writel_rc(str
|
||||
static int dw_pcie_rd_own_conf(struct pcie_port *pp, int where, int size,
|
||||
u32 *val)
|
||||
{
|
||||
- int ret;
|
||||
-
|
||||
if (pp->ops->rd_own_conf)
|
||||
- ret = pp->ops->rd_own_conf(pp, where, size, val);
|
||||
- else
|
||||
- ret = dw_pcie_cfg_read(pp->dbi_base + where, size, val);
|
||||
+ return pp->ops->rd_own_conf(pp, where, size, val);
|
||||
|
||||
- return ret;
|
||||
+ return dw_pcie_cfg_read(pp->dbi_base + where, size, val);
|
||||
}
|
||||
|
||||
static int dw_pcie_wr_own_conf(struct pcie_port *pp, int where, int size,
|
||||
u32 val)
|
||||
{
|
||||
- int ret;
|
||||
-
|
||||
if (pp->ops->wr_own_conf)
|
||||
- ret = pp->ops->wr_own_conf(pp, where, size, val);
|
||||
- else
|
||||
- ret = dw_pcie_cfg_write(pp->dbi_base + where, size, val);
|
||||
+ return pp->ops->wr_own_conf(pp, where, size, val);
|
||||
|
||||
- return ret;
|
||||
+ return dw_pcie_cfg_write(pp->dbi_base + where, size, val);
|
||||
}
|
||||
|
||||
static void dw_pcie_prog_outbound_atu(struct pcie_port *pp, int index,
|
||||
@@ -392,8 +384,8 @@ int dw_pcie_link_up(struct pcie_port *pp
|
||||
{
|
||||
if (pp->ops->link_up)
|
||||
return pp->ops->link_up(pp);
|
||||
- else
|
||||
- return 0;
|
||||
+
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static int dw_pcie_msi_map(struct irq_domain *domain, unsigned int irq,
|
||||
@@ -666,46 +658,36 @@ static int dw_pcie_rd_conf(struct pci_bu
|
||||
int size, u32 *val)
|
||||
{
|
||||
struct pcie_port *pp = bus->sysdata;
|
||||
- int ret;
|
||||
|
||||
if (dw_pcie_valid_config(pp, bus, PCI_SLOT(devfn)) == 0) {
|
||||
*val = 0xffffffff;
|
||||
return PCIBIOS_DEVICE_NOT_FOUND;
|
||||
}
|
||||
|
||||
- if (bus->number != pp->root_bus_nr)
|
||||
- if (pp->ops->rd_other_conf)
|
||||
- ret = pp->ops->rd_other_conf(pp, bus, devfn,
|
||||
- where, size, val);
|
||||
- else
|
||||
- ret = dw_pcie_rd_other_conf(pp, bus, devfn,
|
||||
- where, size, val);
|
||||
- else
|
||||
- ret = dw_pcie_rd_own_conf(pp, where, size, val);
|
||||
+ if (bus->number == pp->root_bus_nr)
|
||||
+ return dw_pcie_rd_own_conf(pp, where, size, val);
|
||||
|
||||
- return ret;
|
||||
+ if (pp->ops->rd_other_conf)
|
||||
+ return pp->ops->rd_other_conf(pp, bus, devfn, where, size, val);
|
||||
+
|
||||
+ return dw_pcie_rd_other_conf(pp, bus, devfn, where, size, val);
|
||||
}
|
||||
|
||||
static int dw_pcie_wr_conf(struct pci_bus *bus, u32 devfn,
|
||||
int where, int size, u32 val)
|
||||
{
|
||||
struct pcie_port *pp = bus->sysdata;
|
||||
- int ret;
|
||||
|
||||
if (dw_pcie_valid_config(pp, bus, PCI_SLOT(devfn)) == 0)
|
||||
return PCIBIOS_DEVICE_NOT_FOUND;
|
||||
|
||||
- if (bus->number != pp->root_bus_nr)
|
||||
- if (pp->ops->wr_other_conf)
|
||||
- ret = pp->ops->wr_other_conf(pp, bus, devfn,
|
||||
- where, size, val);
|
||||
- else
|
||||
- ret = dw_pcie_wr_other_conf(pp, bus, devfn,
|
||||
- where, size, val);
|
||||
- else
|
||||
- ret = dw_pcie_wr_own_conf(pp, where, size, val);
|
||||
+ if (bus->number == pp->root_bus_nr)
|
||||
+ return dw_pcie_wr_own_conf(pp, where, size, val);
|
||||
|
||||
- return ret;
|
||||
+ if (pp->ops->wr_other_conf)
|
||||
+ return pp->ops->wr_other_conf(pp, bus, devfn, where, size, val);
|
||||
+
|
||||
+ return dw_pcie_wr_other_conf(pp, bus, devfn, where, size, val);
|
||||
}
|
||||
|
||||
static struct pci_ops dw_pcie_ops = {
|
@ -1,71 +0,0 @@
|
||||
From 6882f9eef932e6f5cc3c57115e3d7d4b5bc19662 Mon Sep 17 00:00:00 2001
|
||||
From: Bjorn Helgaas <bhelgaas@google.com>
|
||||
Date: Tue, 5 Jan 2016 15:56:30 -0600
|
||||
Subject: [PATCH 53/70] PCI: designware: Make config accessor override
|
||||
checking symmetric
|
||||
|
||||
Drivers based on the DesignWare core can override the config read accessors
|
||||
by supplying rd_own_conf() and rd_other_conf() function pointers.
|
||||
dw_pcie_rd_conf() calls dw_pcie_rd_own_conf() (for accesses to the root
|
||||
bus) or dw_pcie_rd_other_conf():
|
||||
|
||||
dw_pcie_rd_conf
|
||||
dw_pcie_rd_own_conf # if on root bus
|
||||
dw_pcie_rd_other_conf # if not on root bus
|
||||
|
||||
Previously we checked for rd_other_conf() directly in dw_pcie_rd_conf(),
|
||||
but we checked for rd_own_conf() in dw_pcie_rd_own_conf().
|
||||
|
||||
Check for rd_other_conf() in dw_pcie_rd_other_conf() to make this symmetric
|
||||
with the rd_own_conf() checking, and similarly for the write path.
|
||||
|
||||
No functional change intended.
|
||||
|
||||
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
|
||||
Acked-by: Pratyush Anand <pratyush.anand@gmail.com>
|
||||
---
|
||||
drivers/pci/host/pcie-designware.c | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/pci/host/pcie-designware.c
|
||||
+++ b/drivers/pci/host/pcie-designware.c
|
||||
@@ -571,6 +571,9 @@ static int dw_pcie_rd_other_conf(struct
|
||||
u64 cpu_addr;
|
||||
void __iomem *va_cfg_base;
|
||||
|
||||
+ if (pp->ops->rd_other_conf)
|
||||
+ return pp->ops->rd_other_conf(pp, bus, devfn, where, size, val);
|
||||
+
|
||||
busdev = PCIE_ATU_BUS(bus->number) | PCIE_ATU_DEV(PCI_SLOT(devfn)) |
|
||||
PCIE_ATU_FUNC(PCI_FUNC(devfn));
|
||||
|
||||
@@ -605,6 +608,9 @@ static int dw_pcie_wr_other_conf(struct
|
||||
u64 cpu_addr;
|
||||
void __iomem *va_cfg_base;
|
||||
|
||||
+ if (pp->ops->wr_other_conf)
|
||||
+ return pp->ops->wr_other_conf(pp, bus, devfn, where, size, val);
|
||||
+
|
||||
busdev = PCIE_ATU_BUS(bus->number) | PCIE_ATU_DEV(PCI_SLOT(devfn)) |
|
||||
PCIE_ATU_FUNC(PCI_FUNC(devfn));
|
||||
|
||||
@@ -667,9 +673,6 @@ static int dw_pcie_rd_conf(struct pci_bu
|
||||
if (bus->number == pp->root_bus_nr)
|
||||
return dw_pcie_rd_own_conf(pp, where, size, val);
|
||||
|
||||
- if (pp->ops->rd_other_conf)
|
||||
- return pp->ops->rd_other_conf(pp, bus, devfn, where, size, val);
|
||||
-
|
||||
return dw_pcie_rd_other_conf(pp, bus, devfn, where, size, val);
|
||||
}
|
||||
|
||||
@@ -684,9 +687,6 @@ static int dw_pcie_wr_conf(struct pci_bu
|
||||
if (bus->number == pp->root_bus_nr)
|
||||
return dw_pcie_wr_own_conf(pp, where, size, val);
|
||||
|
||||
- if (pp->ops->wr_other_conf)
|
||||
- return pp->ops->wr_other_conf(pp, bus, devfn, where, size, val);
|
||||
-
|
||||
return dw_pcie_wr_other_conf(pp, bus, devfn, where, size, val);
|
||||
}
|
||||
|
@ -1,34 +0,0 @@
|
||||
From 481b1bc4ce0d58107887558342e50d6323a9601d Mon Sep 17 00:00:00 2001
|
||||
From: Jisheng Zhang <jszhang@marvell.com>
|
||||
Date: Thu, 7 Jan 2016 14:12:38 +0800
|
||||
Subject: [PATCH 54/70] PCI: designware: Explain why we don't program ATU for
|
||||
some platforms
|
||||
|
||||
Some platforms don't support ATU, e.g., pci-keystone.c. These platforms
|
||||
use their own address translation component rather than ATU, and they
|
||||
provide the rd_other_conf and wr_other_conf methods to program the
|
||||
translation component and perform the access.
|
||||
|
||||
Add a comment to explain why we don't program the ATU for these platforms.
|
||||
|
||||
[bhelgaas: changelog]
|
||||
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
|
||||
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
|
||||
---
|
||||
drivers/pci/host/pcie-designware.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
--- a/drivers/pci/host/pcie-designware.c
|
||||
+++ b/drivers/pci/host/pcie-designware.c
|
||||
@@ -517,6 +517,11 @@ int dw_pcie_host_init(struct pcie_port *
|
||||
if (pp->ops->host_init)
|
||||
pp->ops->host_init(pp);
|
||||
|
||||
+ /*
|
||||
+ * If the platform provides ->rd_other_conf, it means the platform
|
||||
+ * uses its own address translation component rather than ATU, so
|
||||
+ * we should not program the ATU here.
|
||||
+ */
|
||||
if (!pp->ops->rd_other_conf)
|
||||
dw_pcie_prog_outbound_atu(pp, PCIE_ATU_REGION_INDEX1,
|
||||
PCIE_ATU_TYPE_MEM, pp->mem_base,
|
@ -1,41 +0,0 @@
|
||||
From ee2a430c1691d0bac3098e8db3c29d8f023b04c2 Mon Sep 17 00:00:00 2001
|
||||
From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
|
||||
Date: Fri, 29 Jan 2016 11:29:32 +0000
|
||||
Subject: [PATCH 55/70] PCI: designware: Remove PCI_PROBE_ONLY handling
|
||||
|
||||
The PCIe designware host driver is not used in system configurations
|
||||
requiring the PCI_PROBE_ONLY flag to be set to prevent resources
|
||||
assignment, therefore the driver code handling the flag can be removed
|
||||
from the kernel.
|
||||
|
||||
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
|
||||
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
|
||||
Acked-by: Pratyush Anand <pratyush.anand@gmail.com>
|
||||
Acked-by: Jingoo Han Jingoo Han <jingoohan1@gmail.com>
|
||||
Cc: Arnd Bergmann <arnd@arndb.de>
|
||||
Cc: Gabriele Paoloni <gabriele.paoloni@huawei.com>
|
||||
Cc: Zhou Wang <wangzhou1@hisilicon.com>
|
||||
---
|
||||
drivers/pci/host/pcie-designware.c | 10 ++++------
|
||||
1 file changed, 4 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/pci/host/pcie-designware.c
|
||||
+++ b/drivers/pci/host/pcie-designware.c
|
||||
@@ -556,13 +556,11 @@ int dw_pcie_host_init(struct pcie_port *
|
||||
pci_fixup_irqs(pci_common_swizzle, of_irq_parse_and_map_pci);
|
||||
#endif
|
||||
|
||||
- if (!pci_has_flag(PCI_PROBE_ONLY)) {
|
||||
- pci_bus_size_bridges(bus);
|
||||
- pci_bus_assign_resources(bus);
|
||||
+ pci_bus_size_bridges(bus);
|
||||
+ pci_bus_assign_resources(bus);
|
||||
|
||||
- list_for_each_entry(child, &bus->children, node)
|
||||
- pcie_bus_configure_settings(child);
|
||||
- }
|
||||
+ list_for_each_entry(child, &bus->children, node)
|
||||
+ pcie_bus_configure_settings(child);
|
||||
|
||||
pci_bus_add_devices(bus);
|
||||
return 0;
|
@ -1,249 +0,0 @@
|
||||
From f0c3f31a8bd81b8e7354a187c49200f3ce52740d Mon Sep 17 00:00:00 2001
|
||||
From: Joao Pinto <Joao.Pinto@synopsys.com>
|
||||
Date: Thu, 10 Mar 2016 14:44:35 -0600
|
||||
Subject: [PATCH 56/70] PCI: designware: Add generic dw_pcie_wait_for_link()
|
||||
|
||||
commit 886bc5ceb5cc3ad4b219502d72b277e3c3255a32 upstream
|
||||
[context adjustment]
|
||||
[remove drivers/pci/host/pcie-qcom.c related changes]
|
||||
|
||||
Several DesignWare-based drivers (dra7xx, exynos, imx6, keystone, qcom, and
|
||||
spear13xx) had similar loops waiting for the link to come up.
|
||||
|
||||
Add a generic dw_pcie_wait_for_link() for use by all these drivers so the
|
||||
waiting is done consistently, e.g., always using usleep_range() rather than
|
||||
mdelay() and using similar timeouts and retry counts.
|
||||
|
||||
Note that this changes the Keystone link training/wait for link strategy,
|
||||
so we initiate link training, then wait longer for the link to come up
|
||||
before re-initiating link training.
|
||||
|
||||
[bhelgaas: changelog, split into its own patch, update pci-keystone.c, pcie-qcom.c]
|
||||
Signed-off-by: Joao Pinto <jpinto@synopsys.com>
|
||||
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
|
||||
Acked-by: Pratyush Anand <pratyush.anand@gmail.com>
|
||||
Integrated-by: Jiang Yutang <yutang.jiang@nxp.com>
|
||||
---
|
||||
drivers/pci/host/pci-dra7xx.c | 11 +----------
|
||||
drivers/pci/host/pci-exynos.c | 13 +++----------
|
||||
drivers/pci/host/pci-imx6.c | 13 ++++---------
|
||||
drivers/pci/host/pci-keystone.c | 10 ++++------
|
||||
drivers/pci/host/pcie-designware.c | 19 +++++++++++++++++++
|
||||
drivers/pci/host/pcie-designware.h | 6 ++++++
|
||||
drivers/pci/host/pcie-spear13xx.c | 14 +-------------
|
||||
7 files changed, 38 insertions(+), 48 deletions(-)
|
||||
|
||||
--- a/drivers/pci/host/pci-dra7xx.c
|
||||
+++ b/drivers/pci/host/pci-dra7xx.c
|
||||
@@ -10,7 +10,6 @@
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
-#include <linux/delay.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
@@ -108,7 +107,6 @@ static int dra7xx_pcie_establish_link(st
|
||||
{
|
||||
struct dra7xx_pcie *dra7xx = to_dra7xx_pcie(pp);
|
||||
u32 reg;
|
||||
- unsigned int retries;
|
||||
|
||||
if (dw_pcie_link_up(pp)) {
|
||||
dev_err(pp->dev, "link is already up\n");
|
||||
@@ -119,14 +117,7 @@ static int dra7xx_pcie_establish_link(st
|
||||
reg |= LTSSM_EN;
|
||||
dra7xx_pcie_writel(dra7xx, PCIECTRL_DRA7XX_CONF_DEVICE_CMD, reg);
|
||||
|
||||
- for (retries = 0; retries < 1000; retries++) {
|
||||
- if (dw_pcie_link_up(pp))
|
||||
- return 0;
|
||||
- usleep_range(10, 20);
|
||||
- }
|
||||
-
|
||||
- dev_err(pp->dev, "link is not up\n");
|
||||
- return -EINVAL;
|
||||
+ return dw_pcie_wait_for_link(pp);
|
||||
}
|
||||
|
||||
static void dra7xx_pcie_enable_interrupts(struct pcie_port *pp)
|
||||
--- a/drivers/pci/host/pci-exynos.c
|
||||
+++ b/drivers/pci/host/pci-exynos.c
|
||||
@@ -318,7 +318,6 @@ static int exynos_pcie_establish_link(st
|
||||
{
|
||||
struct exynos_pcie *exynos_pcie = to_exynos_pcie(pp);
|
||||
u32 val;
|
||||
- unsigned int retries;
|
||||
|
||||
if (dw_pcie_link_up(pp)) {
|
||||
dev_err(pp->dev, "Link already up\n");
|
||||
@@ -357,13 +356,8 @@ static int exynos_pcie_establish_link(st
|
||||
PCIE_APP_LTSSM_ENABLE);
|
||||
|
||||
/* check if the link is up or not */
|
||||
- for (retries = 0; retries < 10; retries++) {
|
||||
- if (dw_pcie_link_up(pp)) {
|
||||
- dev_info(pp->dev, "Link up\n");
|
||||
- return 0;
|
||||
- }
|
||||
- mdelay(100);
|
||||
- }
|
||||
+ if (!dw_pcie_wait_for_link(pp))
|
||||
+ return 0;
|
||||
|
||||
while (exynos_phy_readl(exynos_pcie, PCIE_PHY_PLL_LOCKED) == 0) {
|
||||
val = exynos_blk_readl(exynos_pcie, PCIE_PHY_PLL_LOCKED);
|
||||
@@ -372,8 +366,7 @@ static int exynos_pcie_establish_link(st
|
||||
/* power off phy */
|
||||
exynos_pcie_power_off_phy(pp);
|
||||
|
||||
- dev_err(pp->dev, "PCIe Link Fail\n");
|
||||
- return -EINVAL;
|
||||
+ return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
static void exynos_pcie_clear_irq_pulse(struct pcie_port *pp)
|
||||
--- a/drivers/pci/host/pci-imx6.c
|
||||
+++ b/drivers/pci/host/pci-imx6.c
|
||||
@@ -330,19 +330,14 @@ static void imx6_pcie_init_phy(struct pc
|
||||
|
||||
static int imx6_pcie_wait_for_link(struct pcie_port *pp)
|
||||
{
|
||||
- unsigned int retries;
|
||||
+ /* check if the link is up or not */
|
||||
+ if (!dw_pcie_wait_for_link(pp))
|
||||
+ return 0;
|
||||
|
||||
- for (retries = 0; retries < 200; retries++) {
|
||||
- if (dw_pcie_link_up(pp))
|
||||
- return 0;
|
||||
- usleep_range(100, 1000);
|
||||
- }
|
||||
-
|
||||
- dev_err(pp->dev, "phy link never came up\n");
|
||||
dev_dbg(pp->dev, "DEBUG_R0: 0x%08x, DEBUG_R1: 0x%08x\n",
|
||||
readl(pp->dbi_base + PCIE_PHY_DEBUG_R0),
|
||||
readl(pp->dbi_base + PCIE_PHY_DEBUG_R1));
|
||||
- return -EINVAL;
|
||||
+ return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
static int imx6_pcie_wait_for_speed_change(struct pcie_port *pp)
|
||||
--- a/drivers/pci/host/pci-keystone.c
|
||||
+++ b/drivers/pci/host/pci-keystone.c
|
||||
@@ -97,17 +97,15 @@ static int ks_pcie_establish_link(struct
|
||||
return 0;
|
||||
}
|
||||
|
||||
- ks_dw_pcie_initiate_link_train(ks_pcie);
|
||||
/* check if the link is up or not */
|
||||
- for (retries = 0; retries < 200; retries++) {
|
||||
- if (dw_pcie_link_up(pp))
|
||||
- return 0;
|
||||
- usleep_range(100, 1000);
|
||||
+ for (retries = 0; retries < 5; retries++) {
|
||||
ks_dw_pcie_initiate_link_train(ks_pcie);
|
||||
+ if (!dw_pcie_wait_for_link(pp))
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
dev_err(pp->dev, "phy link never came up\n");
|
||||
- return -EINVAL;
|
||||
+ return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
static void ks_pcie_msi_irq_handler(struct irq_desc *desc)
|
||||
--- a/drivers/pci/host/pcie-designware.c
|
||||
+++ b/drivers/pci/host/pcie-designware.c
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <linux/pci_regs.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/types.h>
|
||||
+#include <linux/delay.h>
|
||||
|
||||
#include "pcie-designware.h"
|
||||
|
||||
@@ -380,6 +381,24 @@ static struct msi_controller dw_pcie_msi
|
||||
.teardown_irq = dw_msi_teardown_irq,
|
||||
};
|
||||
|
||||
+int dw_pcie_wait_for_link(struct pcie_port *pp)
|
||||
+{
|
||||
+ int retries;
|
||||
+
|
||||
+ /* check if the link is up or not */
|
||||
+ for (retries = 0; retries < LINK_WAIT_MAX_RETRIES; retries++) {
|
||||
+ if (dw_pcie_link_up(pp)) {
|
||||
+ dev_info(pp->dev, "link up\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
+ usleep_range(LINK_WAIT_USLEEP_MIN, LINK_WAIT_USLEEP_MAX);
|
||||
+ }
|
||||
+
|
||||
+ dev_err(pp->dev, "phy link never came up\n");
|
||||
+
|
||||
+ return -ETIMEDOUT;
|
||||
+}
|
||||
+
|
||||
int dw_pcie_link_up(struct pcie_port *pp)
|
||||
{
|
||||
if (pp->ops->link_up)
|
||||
--- a/drivers/pci/host/pcie-designware.h
|
||||
+++ b/drivers/pci/host/pcie-designware.h
|
||||
@@ -22,6 +22,11 @@
|
||||
#define MAX_MSI_IRQS 32
|
||||
#define MAX_MSI_CTRLS (MAX_MSI_IRQS / 32)
|
||||
|
||||
+/* Parameters for the waiting for link up routine */
|
||||
+#define LINK_WAIT_MAX_RETRIES 10
|
||||
+#define LINK_WAIT_USLEEP_MIN 90000
|
||||
+#define LINK_WAIT_USLEEP_MAX 100000
|
||||
+
|
||||
struct pcie_port {
|
||||
struct device *dev;
|
||||
u8 root_bus_nr;
|
||||
@@ -76,6 +81,7 @@ int dw_pcie_cfg_read(void __iomem *addr,
|
||||
int dw_pcie_cfg_write(void __iomem *addr, int size, u32 val);
|
||||
irqreturn_t dw_handle_msi_irq(struct pcie_port *pp);
|
||||
void dw_pcie_msi_init(struct pcie_port *pp);
|
||||
+int dw_pcie_wait_for_link(struct pcie_port *pp);
|
||||
int dw_pcie_link_up(struct pcie_port *pp);
|
||||
void dw_pcie_setup_rc(struct pcie_port *pp);
|
||||
int dw_pcie_host_init(struct pcie_port *pp);
|
||||
--- a/drivers/pci/host/pcie-spear13xx.c
|
||||
+++ b/drivers/pci/host/pcie-spear13xx.c
|
||||
@@ -13,7 +13,6 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk.h>
|
||||
-#include <linux/delay.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
@@ -149,7 +148,6 @@ static int spear13xx_pcie_establish_link
|
||||
struct spear13xx_pcie *spear13xx_pcie = to_spear13xx_pcie(pp);
|
||||
struct pcie_app_reg *app_reg = spear13xx_pcie->app_base;
|
||||
u32 exp_cap_off = EXP_CAP_ID_OFFSET;
|
||||
- unsigned int retries;
|
||||
|
||||
if (dw_pcie_link_up(pp)) {
|
||||
dev_err(pp->dev, "link already up\n");
|
||||
@@ -200,17 +198,7 @@ static int spear13xx_pcie_establish_link
|
||||
| ((u32)1 << REG_TRANSLATION_ENABLE),
|
||||
&app_reg->app_ctrl_0);
|
||||
|
||||
- /* check if the link is up or not */
|
||||
- for (retries = 0; retries < 10; retries++) {
|
||||
- if (dw_pcie_link_up(pp)) {
|
||||
- dev_info(pp->dev, "link up\n");
|
||||
- return 0;
|
||||
- }
|
||||
- mdelay(100);
|
||||
- }
|
||||
-
|
||||
- dev_err(pp->dev, "link Fail\n");
|
||||
- return -EINVAL;
|
||||
+ return dw_pcie_wait_for_link(pp);
|
||||
}
|
||||
|
||||
static irqreturn_t spear13xx_pcie_irq_handler(int irq, void *arg)
|
@ -1,46 +0,0 @@
|
||||
From a0a4f406c7e90b2be66e88ea8b21699940c0823f Mon Sep 17 00:00:00 2001
|
||||
From: Joao Pinto <Joao.Pinto@synopsys.com>
|
||||
Date: Thu, 10 Mar 2016 14:44:44 -0600
|
||||
Subject: [PATCH 57/70] PCI: designware: Add default link up check if
|
||||
sub-driver doesn't override
|
||||
|
||||
Add a default DesignWare "link_up" test for use when a sub-driver doesn't
|
||||
supply its own pcie_host_ops.link_up() method.
|
||||
|
||||
[bhelgaas: changelog, split into its own patch]
|
||||
Signed-off-by: Joao Pinto <jpinto@synopsys.com>
|
||||
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
|
||||
Acked-by: Pratyush Anand <pratyush.anand@gmail.com>
|
||||
---
|
||||
drivers/pci/host/pcie-designware.c | 10 +++++++++-
|
||||
1 file changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/pci/host/pcie-designware.c
|
||||
+++ b/drivers/pci/host/pcie-designware.c
|
||||
@@ -70,6 +70,11 @@
|
||||
#define PCIE_ATU_FUNC(x) (((x) & 0x7) << 16)
|
||||
#define PCIE_ATU_UPPER_TARGET 0x91C
|
||||
|
||||
+/* PCIe Port Logic registers */
|
||||
+#define PLR_OFFSET 0x700
|
||||
+#define PCIE_PHY_DEBUG_R1 (PLR_OFFSET + 0x2c)
|
||||
+#define PCIE_PHY_DEBUG_R1_LINK_UP 0x00000010
|
||||
+
|
||||
static struct pci_ops dw_pcie_ops;
|
||||
|
||||
int dw_pcie_cfg_read(void __iomem *addr, int size, u32 *val)
|
||||
@@ -401,10 +406,13 @@ int dw_pcie_wait_for_link(struct pcie_po
|
||||
|
||||
int dw_pcie_link_up(struct pcie_port *pp)
|
||||
{
|
||||
+ u32 val;
|
||||
+
|
||||
if (pp->ops->link_up)
|
||||
return pp->ops->link_up(pp);
|
||||
|
||||
- return 0;
|
||||
+ val = readl(pp->dbi_base + PCIE_PHY_DEBUG_R1);
|
||||
+ return val & PCIE_PHY_DEBUG_R1_LINK_UP;
|
||||
}
|
||||
|
||||
static int dw_pcie_msi_map(struct irq_domain *domain, unsigned int irq,
|
@ -1,109 +0,0 @@
|
||||
From 892a427f8a2b25b561298941cf1fc0373a98b269 Mon Sep 17 00:00:00 2001
|
||||
From: Jisheng Zhang <jszhang@marvell.com>
|
||||
Date: Wed, 16 Mar 2016 19:40:33 +0800
|
||||
Subject: [PATCH 58/70] PCI: designware: Move Root Complex setup code to
|
||||
dw_pcie_setup_rc()
|
||||
|
||||
dw_pcie_host_init() looks up host bridge resources, ioremaps them, creates
|
||||
IRQ domains, and enumerates devices below the bridge. dw_pcie_setup_rc()
|
||||
programs the Root Complex registers. The Root Complex may lose power
|
||||
during suspend-to-RAM, and when we resume, we want to redo the latter but
|
||||
not the former.
|
||||
|
||||
Move some Root Complex programming from dw_pcie_host_init() to
|
||||
dw_pcie_setup_rc() where it belongs. DesignWare-based drivers can call
|
||||
dw_pcie_setup_rc() in their resume paths.
|
||||
|
||||
[Niklas Cassel <niklas.cassel@axis.com>: This change moves outbound ATU
|
||||
programming, which uses pp->mem_base, to dw_pcie_setup_rc(). Apply the
|
||||
dra7xx pp->mem_base update before calling dw_pcie_setup_rc().]
|
||||
|
||||
[bhelgaas: changelog, fold in dra7xx fix from Niklas]
|
||||
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
|
||||
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
|
||||
Acked-by: Pratyush Anand <pratyush.anand@gmail.com>
|
||||
---
|
||||
drivers/pci/host/pci-dra7xx.c | 4 ++--
|
||||
drivers/pci/host/pcie-designware.c | 39 ++++++++++++++++++------------------
|
||||
2 files changed, 21 insertions(+), 22 deletions(-)
|
||||
|
||||
--- a/drivers/pci/host/pci-dra7xx.c
|
||||
+++ b/drivers/pci/host/pci-dra7xx.c
|
||||
@@ -142,13 +142,13 @@ static void dra7xx_pcie_enable_interrupt
|
||||
|
||||
static void dra7xx_pcie_host_init(struct pcie_port *pp)
|
||||
{
|
||||
- dw_pcie_setup_rc(pp);
|
||||
-
|
||||
pp->io_base &= DRA7XX_CPU_TO_BUS_ADDR;
|
||||
pp->mem_base &= DRA7XX_CPU_TO_BUS_ADDR;
|
||||
pp->cfg0_base &= DRA7XX_CPU_TO_BUS_ADDR;
|
||||
pp->cfg1_base &= DRA7XX_CPU_TO_BUS_ADDR;
|
||||
|
||||
+ dw_pcie_setup_rc(pp);
|
||||
+
|
||||
dra7xx_pcie_establish_link(pp);
|
||||
if (IS_ENABLED(CONFIG_PCI_MSI))
|
||||
dw_pcie_msi_init(pp);
|
||||
--- a/drivers/pci/host/pcie-designware.c
|
||||
+++ b/drivers/pci/host/pcie-designware.c
|
||||
@@ -434,7 +434,6 @@ int dw_pcie_host_init(struct pcie_port *
|
||||
struct platform_device *pdev = to_platform_device(pp->dev);
|
||||
struct pci_bus *bus, *child;
|
||||
struct resource *cfg_res;
|
||||
- u32 val;
|
||||
int i, ret;
|
||||
LIST_HEAD(res);
|
||||
struct resource_entry *win;
|
||||
@@ -544,25 +543,6 @@ int dw_pcie_host_init(struct pcie_port *
|
||||
if (pp->ops->host_init)
|
||||
pp->ops->host_init(pp);
|
||||
|
||||
- /*
|
||||
- * If the platform provides ->rd_other_conf, it means the platform
|
||||
- * uses its own address translation component rather than ATU, so
|
||||
- * we should not program the ATU here.
|
||||
- */
|
||||
- if (!pp->ops->rd_other_conf)
|
||||
- dw_pcie_prog_outbound_atu(pp, PCIE_ATU_REGION_INDEX1,
|
||||
- PCIE_ATU_TYPE_MEM, pp->mem_base,
|
||||
- pp->mem_bus_addr, pp->mem_size);
|
||||
-
|
||||
- dw_pcie_wr_own_conf(pp, PCI_BASE_ADDRESS_0, 4, 0);
|
||||
-
|
||||
- /* program correct class for RC */
|
||||
- dw_pcie_wr_own_conf(pp, PCI_CLASS_DEVICE, 2, PCI_CLASS_BRIDGE_PCI);
|
||||
-
|
||||
- dw_pcie_rd_own_conf(pp, PCIE_LINK_WIDTH_SPEED_CONTROL, 4, &val);
|
||||
- val |= PORT_LOGIC_SPEED_CHANGE;
|
||||
- dw_pcie_wr_own_conf(pp, PCIE_LINK_WIDTH_SPEED_CONTROL, 4, val);
|
||||
-
|
||||
pp->root_bus_nr = pp->busn->start;
|
||||
if (IS_ENABLED(CONFIG_PCI_MSI)) {
|
||||
bus = pci_scan_root_bus_msi(pp->dev, pp->root_bus_nr,
|
||||
@@ -800,6 +780,25 @@ void dw_pcie_setup_rc(struct pcie_port *
|
||||
val |= PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
|
||||
PCI_COMMAND_MASTER | PCI_COMMAND_SERR;
|
||||
dw_pcie_writel_rc(pp, val, PCI_COMMAND);
|
||||
+
|
||||
+ /*
|
||||
+ * If the platform provides ->rd_other_conf, it means the platform
|
||||
+ * uses its own address translation component rather than ATU, so
|
||||
+ * we should not program the ATU here.
|
||||
+ */
|
||||
+ if (!pp->ops->rd_other_conf)
|
||||
+ dw_pcie_prog_outbound_atu(pp, PCIE_ATU_REGION_INDEX1,
|
||||
+ PCIE_ATU_TYPE_MEM, pp->mem_base,
|
||||
+ pp->mem_bus_addr, pp->mem_size);
|
||||
+
|
||||
+ dw_pcie_wr_own_conf(pp, PCI_BASE_ADDRESS_0, 4, 0);
|
||||
+
|
||||
+ /* program correct class for RC */
|
||||
+ dw_pcie_wr_own_conf(pp, PCI_CLASS_DEVICE, 2, PCI_CLASS_BRIDGE_PCI);
|
||||
+
|
||||
+ dw_pcie_rd_own_conf(pp, PCIE_LINK_WIDTH_SPEED_CONTROL, 4, &val);
|
||||
+ val |= PORT_LOGIC_SPEED_CHANGE;
|
||||
+ dw_pcie_wr_own_conf(pp, PCIE_LINK_WIDTH_SPEED_CONTROL, 4, val);
|
||||
}
|
||||
|
||||
MODULE_AUTHOR("Jingoo Han <jg1.han@samsung.com>");
|
@ -1,45 +0,0 @@
|
||||
From ae717a9744a3e18f2ed0a6aa44e279c89ad5052c Mon Sep 17 00:00:00 2001
|
||||
From: Gabriele Paoloni <gabriele.paoloni@huawei.com>
|
||||
Date: Sat, 16 Apr 2016 12:03:39 +0100
|
||||
Subject: [PATCH 59/70] PCI: designware: Remove incorrect RC memory base/limit
|
||||
configuration
|
||||
|
||||
Currently dw_pcie_setup_rc() configures memory base and memory limit in the
|
||||
type1 configuration header for the root complex. In doing so it uses the
|
||||
CPU address (pp->mem_base) rather than the bus address (pp->mem_bus_addr).
|
||||
This is wrong and it is useless since the configuration is overwritten
|
||||
later on when pci_bus_assign_resources() is called.
|
||||
|
||||
Remove this configuration from dw_pcie_setup_rc().
|
||||
|
||||
Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
|
||||
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
|
||||
Acked-by: Pratyush Anand <pratyush.anand@gmail.com>
|
||||
---
|
||||
drivers/pci/host/pcie-designware.c | 8 --------
|
||||
1 file changed, 8 deletions(-)
|
||||
|
||||
--- a/drivers/pci/host/pcie-designware.c
|
||||
+++ b/drivers/pci/host/pcie-designware.c
|
||||
@@ -708,8 +708,6 @@ static struct pci_ops dw_pcie_ops = {
|
||||
void dw_pcie_setup_rc(struct pcie_port *pp)
|
||||
{
|
||||
u32 val;
|
||||
- u32 membase;
|
||||
- u32 memlimit;
|
||||
|
||||
/* set the number of lanes */
|
||||
dw_pcie_readl_rc(pp, PCIE_PORT_LINK_CONTROL, &val);
|
||||
@@ -768,12 +766,6 @@ void dw_pcie_setup_rc(struct pcie_port *
|
||||
val |= 0x00010100;
|
||||
dw_pcie_writel_rc(pp, val, PCI_PRIMARY_BUS);
|
||||
|
||||
- /* setup memory base, memory limit */
|
||||
- membase = ((u32)pp->mem_base & 0xfff00000) >> 16;
|
||||
- memlimit = (pp->mem_size + (u32)pp->mem_base) & 0xfff00000;
|
||||
- val = memlimit | membase;
|
||||
- dw_pcie_writel_rc(pp, val, PCI_MEMORY_BASE);
|
||||
-
|
||||
/* setup command register */
|
||||
dw_pcie_readl_rc(pp, PCI_COMMAND, &val);
|
||||
val &= 0xffff0000;
|
@ -1,148 +0,0 @@
|
||||
From 880b7aa2e2c62e54245fb77d92db502175232d86 Mon Sep 17 00:00:00 2001
|
||||
From: Zhao Qiang <qiang.zhao@nxp.com>
|
||||
Date: Wed, 12 Oct 2016 11:01:17 +0800
|
||||
Subject: [PATCH 140/141] config: add freescale config for amr64
|
||||
|
||||
Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
|
||||
---
|
||||
arch/arm64/configs/freescale.config | 134 +++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 134 insertions(+)
|
||||
create mode 100644 arch/arm64/configs/freescale.config
|
||||
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/configs/freescale.config
|
||||
@@ -0,0 +1,134 @@
|
||||
+# general options
|
||||
+CONFIG_LOCALVERSION_AUTO=y
|
||||
+CONFIG_SLAB=y
|
||||
+CONFIG_MODULE_FORCE_LOAD=y
|
||||
+CONFIG_MODVERSIONS=y
|
||||
+CONFIG_ARM64_VA_BITS_48=y
|
||||
+CONFIG_BLK_DEV_RAM=y
|
||||
+CONFIG_BLK_DEV_RAM_SIZE=262144
|
||||
+CONFIG_PRINTK_TIME=y
|
||||
+CONFIG_PID_IN_CONTEXTIDR=y
|
||||
+CONFIG_IPV6=y
|
||||
+# iommu
|
||||
+CONFIG_IOMMU_SUPPORT=y
|
||||
+CONFIG_ARM_SMMU=y
|
||||
+# dpaa2
|
||||
+CONFIG_STAGING=y
|
||||
+CONFIG_FSL_MC_BUS=y
|
||||
+CONFIG_FSL_MC_RESTOOL=y
|
||||
+CONFIG_FSL_MC_DPIO=y
|
||||
+CONFIG_FSL_DPAA2=y
|
||||
+CONFIG_NET_NS=y
|
||||
+CONFIG_FSL_DPAA2_DCE=y
|
||||
+CONFIG_FSL_DCE_FLOW_LIMIT=65536
|
||||
+CONFIG_FSL_DCE_API_TIME_TRIAL=m
|
||||
+CONFIG_LS_SOC_DRIVERS=y
|
||||
+# mdio
|
||||
+CONFIG_FSL_XGMAC_MDIO=y
|
||||
+CONFIG_MDIO_BUS_MUX_MMIOREG=y
|
||||
+# phy
|
||||
+CONFIG_AQUANTIA_PHY=y
|
||||
+CONFIG_VITESSE_PHY=y
|
||||
+CONFIG_REALTEK_PHY=y
|
||||
+CONFIG_FIXED_PHY=y
|
||||
+# reset support
|
||||
+CONFIG_POWER_RESET_LAYERSCAPE=y
|
||||
+# pci
|
||||
+CONFIG_PCI_LAYERSCAPE=y
|
||||
+CONFIG_PCI_HOST_GENERIC=y
|
||||
+CONFIG_E1000=y
|
||||
+CONFIG_E1000E=y
|
||||
+# clock driver
|
||||
+CONFIG_CLK_QORIQ=y
|
||||
+# usb
|
||||
+CONFIG_USB_XHCI_HCD=y
|
||||
+CONFIG_USB_DWC3=y
|
||||
+CONFIG_DMADEVICES=y
|
||||
+# ahci/sata
|
||||
+CONFIG_AHCI_QORIQ=y
|
||||
+# esdhc
|
||||
+CONFIG_MMC_SDHCI_OF_ESDHC=y
|
||||
+# virtualization
|
||||
+CONFIG_VHOST_NET=y
|
||||
+CONFIG_KVM_ARM_MAX_VCPUS=8
|
||||
+# I2C
|
||||
+CONFIG_I2C=y
|
||||
+CONFIG_I2C_CHARDEV=y
|
||||
+CONFIG_I2C_MUX=y
|
||||
+CONFIG_I2C_MUX_PCA954x=y
|
||||
+CONFIG_I2C_IMX=y
|
||||
+# hardware monitor
|
||||
+CONFIG_SENSORS_LM90=y
|
||||
+CONFIG_SENSORS_INA2XX=y
|
||||
+# DPAA 1
|
||||
+CONFIG_HAS_FSL_QBMAN=y
|
||||
+CONFIG_CRYPTO_DEV_FSL_CAAM=y
|
||||
+# network
|
||||
+CONFIG_BRIDGE=m
|
||||
+CONFIG_MACVLAN=y
|
||||
+CONFIG_FSL_SDK_FMAN=y
|
||||
+CONFIG_FMAN_ARM=y
|
||||
+CONFIG_FSL_SDK_DPAA_ETH=y
|
||||
+CONFIG_INET_ESP=y
|
||||
+CONFIG_XFRM_USER=y
|
||||
+CONFIG_NET_KEY=y
|
||||
+# vfio
|
||||
+CONFIG_VFIO=y
|
||||
+CONFIG_VFIO_PCI=y
|
||||
+CONFIG_VFIO_FSL_MC=y
|
||||
+# CPU Frequency scaling
|
||||
+CONFIG_CPU_FREQ=y
|
||||
+CONFIG_CPU_FREQ_GOV_COMMON=y
|
||||
+CONFIG_CPU_FREQ_STAT=y
|
||||
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
|
||||
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
|
||||
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
|
||||
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
|
||||
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
|
||||
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
|
||||
+CONFIG_QORIQ_CPUFREQ=y
|
||||
+#ifc
|
||||
+CONFIG_MTD_OF_PARTS=y
|
||||
+CONFIG_MTD_GEN_PROBE=y
|
||||
+CONFIG_MTD=y
|
||||
+CONFIG_MTD_CMDLINE_PARTS=y
|
||||
+CONFIG_MTD_BLOCK=y
|
||||
+CONFIG_MTD_CFI=y
|
||||
+CONFIG_MTD_CFI_ADV_OPTIONS=y
|
||||
+CONFIG_MTD_CFI_INTELEXT=y
|
||||
+CONFIG_MTD_CFI_AMDSTD=y
|
||||
+CONFIG_MTD_CFI_STAA=y
|
||||
+CONFIG_MTD_PHYSMAP_OF=y
|
||||
+CONFIG_MTD_NAND=y
|
||||
+CONFIG_MTD_NAND_FSL_IFC=y
|
||||
+#spi
|
||||
+CONFIG_SPI_FSL_DSPI=y
|
||||
+CONFIG_MTD_SPI_NOR=y
|
||||
+CONFIG_MTD_DATAFLASH=y
|
||||
+CONFIG_MTD_M25P80=y
|
||||
+CONFIG_MTD_SST25L=y
|
||||
+#RTC
|
||||
+CONFIG_RTC_DRV_DS3232=y
|
||||
+#CryptoAPI
|
||||
+CONFIG_CRYPTO_SHA256=y
|
||||
+CONFIG_CRYPTO_SHA512=y
|
||||
+# ls1046a
|
||||
+CONFIG_MTD_CFI_BE_BYTE_SWAP=y
|
||||
+CONFIG_SPI_FSL_QUADSPI=y
|
||||
+CONFIG_RTC_DRV_PCF2127=y
|
||||
+CONFIG_WATCHDOG=y
|
||||
+CONFIG_IMX2_WDT=y
|
||||
+CONFIG_HWMON=y
|
||||
+CONFIG_SENSORS_LM90=y
|
||||
+CONFIG_SENSORS_INA2XX=y
|
||||
+CONFIG_EEPROM_AT24=y
|
||||
+# lpuart
|
||||
+CONFIG_SERIAL_FSL_LPUART=y
|
||||
+CONFIG_SERIAL_FSL_LPUART_CONSOLE=y
|
||||
+# ftm
|
||||
+CONFIG_FTM_ALARM=y
|
||||
+# qDMA
|
||||
+CONFIG_FSL_QDMA=y
|
||||
+CONFIG_DMATEST=y
|
||||
+#NVMe
|
||||
+CONFIG_BLK_DEV_NVME=y
|
@ -1,24 +0,0 @@
|
||||
From fbc31a61b7bcfbc9ae1a8acda547de891f4b8ee4 Mon Sep 17 00:00:00 2001
|
||||
From: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
Date: Mon, 31 Oct 2016 17:50:03 +0800
|
||||
Subject: [PATCH 238/238] arm64: disable CONFIG_EEPROM_AT24 for
|
||||
freescale.config
|
||||
|
||||
Disable CONFIG_EEPROM_AT24 in freescale.config. Otherwise, i2cdump
|
||||
for EEPROM will get resource busy issue.
|
||||
|
||||
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
---
|
||||
arch/arm64/configs/freescale.config | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
--- a/arch/arm64/configs/freescale.config
|
||||
+++ b/arch/arm64/configs/freescale.config
|
||||
@@ -121,7 +121,6 @@ CONFIG_IMX2_WDT=y
|
||||
CONFIG_HWMON=y
|
||||
CONFIG_SENSORS_LM90=y
|
||||
CONFIG_SENSORS_INA2XX=y
|
||||
-CONFIG_EEPROM_AT24=y
|
||||
# lpuart
|
||||
CONFIG_SERIAL_FSL_LPUART=y
|
||||
CONFIG_SERIAL_FSL_LPUART_CONSOLE=y
|
@ -1,68 +0,0 @@
|
||||
From 1f58043afef0dca3d12dc23ac3a35d7074412939 Mon Sep 17 00:00:00 2001
|
||||
From: Minghuan Lian <Minghuan.Lian@nxp.com>
|
||||
Date: Tue, 2 Feb 2016 16:30:07 +0800
|
||||
Subject: [PATCH 01/13] ARM: dts: ls1021a: add PCIe dts node
|
||||
|
||||
Cherry-pick upstream patch.
|
||||
|
||||
LS1021a contains two PCIe controllers. The patch adds their node to
|
||||
dts file.
|
||||
|
||||
Signed-off-by: Minghuan Lian <Minghuan.Lian@nxp.com>
|
||||
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
---
|
||||
arch/arm/boot/dts/ls1021a.dtsi | 44 ++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 44 insertions(+)
|
||||
|
||||
--- a/arch/arm/boot/dts/ls1021a.dtsi
|
||||
+++ b/arch/arm/boot/dts/ls1021a.dtsi
|
||||
@@ -539,5 +539,49 @@
|
||||
dr_mode = "host";
|
||||
snps,quirk-frame-length-adjustment = <0x20>;
|
||||
};
|
||||
+
|
||||
+ pcie@3400000 {
|
||||
+ compatible = "fsl,ls1021a-pcie", "snps,dw-pcie";
|
||||
+ reg = <0x00 0x03400000 0x0 0x00010000 /* controller registers */
|
||||
+ 0x40 0x00000000 0x0 0x00002000>; /* configuration space */
|
||||
+ reg-names = "regs", "config";
|
||||
+ interrupts = <GIC_SPI 177 IRQ_TYPE_LEVEL_HIGH>; /* controller interrupt */
|
||||
+ fsl,pcie-scfg = <&scfg 0>;
|
||||
+ #address-cells = <3>;
|
||||
+ #size-cells = <2>;
|
||||
+ device_type = "pci";
|
||||
+ num-lanes = <4>;
|
||||
+ bus-range = <0x0 0xff>;
|
||||
+ ranges = <0x81000000 0x0 0x00000000 0x40 0x00010000 0x0 0x00010000 /* downstream I/O */
|
||||
+ 0x82000000 0x0 0x40000000 0x40 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
|
||||
+ #interrupt-cells = <1>;
|
||||
+ interrupt-map-mask = <0 0 0 7>;
|
||||
+ interrupt-map = <0000 0 0 1 &gic GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>,
|
||||
+ <0000 0 0 2 &gic GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>,
|
||||
+ <0000 0 0 3 &gic GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>,
|
||||
+ <0000 0 0 4 &gic GIC_SPI 192 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ pcie@3500000 {
|
||||
+ compatible = "fsl,ls1021a-pcie", "snps,dw-pcie";
|
||||
+ reg = <0x00 0x03500000 0x0 0x00010000 /* controller registers */
|
||||
+ 0x48 0x00000000 0x0 0x00002000>; /* configuration space */
|
||||
+ reg-names = "regs", "config";
|
||||
+ interrupts = <GIC_SPI 178 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ fsl,pcie-scfg = <&scfg 1>;
|
||||
+ #address-cells = <3>;
|
||||
+ #size-cells = <2>;
|
||||
+ device_type = "pci";
|
||||
+ num-lanes = <4>;
|
||||
+ bus-range = <0x0 0xff>;
|
||||
+ ranges = <0x81000000 0x0 0x00000000 0x48 0x00010000 0x0 0x00010000 /* downstream I/O */
|
||||
+ 0x82000000 0x0 0x40000000 0x48 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
|
||||
+ #interrupt-cells = <1>;
|
||||
+ interrupt-map-mask = <0 0 0 7>;
|
||||
+ interrupt-map = <0000 0 0 1 &gic GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>,
|
||||
+ <0000 0 0 2 &gic GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>,
|
||||
+ <0000 0 0 3 &gic GIC_SPI 191 IRQ_TYPE_LEVEL_HIGH>,
|
||||
+ <0000 0 0 4 &gic GIC_SPI 193 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ };
|
||||
};
|
||||
};
|
@ -1,56 +0,0 @@
|
||||
From b57dcab78fdc76a6c56c2df71518fb022429e244 Mon Sep 17 00:00:00 2001
|
||||
From: Minghuan Lian <Minghuan.Lian@nxp.com>
|
||||
Date: Wed, 6 Apr 2016 19:02:07 +0800
|
||||
Subject: [PATCH 02/13] ARM: dts: ls1021a: add SCFG MSI dts node
|
||||
|
||||
Cherry-pick upstream patch.
|
||||
|
||||
Add SCFG MSI dts node and add msi-parent property to PCIe dts node
|
||||
that points to the corresponding MSI node.
|
||||
|
||||
Signed-off-by: Minghuan Lian <Minghuan.Lian@nxp.com>
|
||||
Tested-by: Alexander Stein <alexander.stein@systec-electronic.com>
|
||||
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
---
|
||||
arch/arm/boot/dts/ls1021a.dtsi | 16 ++++++++++++++++
|
||||
1 file changed, 16 insertions(+)
|
||||
|
||||
--- a/arch/arm/boot/dts/ls1021a.dtsi
|
||||
+++ b/arch/arm/boot/dts/ls1021a.dtsi
|
||||
@@ -119,6 +119,20 @@
|
||||
|
||||
};
|
||||
|
||||
+ msi1: msi-controller@1570e00 {
|
||||
+ compatible = "fsl,1s1021a-msi";
|
||||
+ reg = <0x0 0x1570e00 0x0 0x8>;
|
||||
+ msi-controller;
|
||||
+ interrupts = <GIC_SPI 179 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ msi2: msi-controller@1570e08 {
|
||||
+ compatible = "fsl,1s1021a-msi";
|
||||
+ reg = <0x0 0x1570e08 0x0 0x8>;
|
||||
+ msi-controller;
|
||||
+ interrupts = <GIC_SPI 180 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ };
|
||||
+
|
||||
ifc: ifc@1530000 {
|
||||
compatible = "fsl,ifc", "simple-bus";
|
||||
reg = <0x0 0x1530000 0x0 0x10000>;
|
||||
@@ -554,6 +568,7 @@
|
||||
bus-range = <0x0 0xff>;
|
||||
ranges = <0x81000000 0x0 0x00000000 0x40 0x00010000 0x0 0x00010000 /* downstream I/O */
|
||||
0x82000000 0x0 0x40000000 0x40 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
|
||||
+ msi-parent = <&msi1>;
|
||||
#interrupt-cells = <1>;
|
||||
interrupt-map-mask = <0 0 0 7>;
|
||||
interrupt-map = <0000 0 0 1 &gic GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>,
|
||||
@@ -576,6 +591,7 @@
|
||||
bus-range = <0x0 0xff>;
|
||||
ranges = <0x81000000 0x0 0x00000000 0x48 0x00010000 0x0 0x00010000 /* downstream I/O */
|
||||
0x82000000 0x0 0x40000000 0x48 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
|
||||
+ msi-parent = <&msi2>;
|
||||
#interrupt-cells = <1>;
|
||||
interrupt-map-mask = <0 0 0 7>;
|
||||
interrupt-map = <0000 0 0 1 &gic GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>,
|
@ -1,53 +0,0 @@
|
||||
From 066320dd0643e66bc5afe0d0984e77b2e938a6f4 Mon Sep 17 00:00:00 2001
|
||||
From: Minghuan Lian <Minghuan.Lian@nxp.com>
|
||||
Date: Wed, 23 Mar 2016 19:08:19 +0800
|
||||
Subject: [PATCH 03/13] dt/bindings: Add bindings for Layerscape SCFG MSI
|
||||
|
||||
Cherry-pick upstream patch.
|
||||
|
||||
Some Layerscape SoCs use a simple MSI controller implementation.
|
||||
It contains only two SCFG register to trigger and describe a
|
||||
group 32 MSI interrupts. The patch adds bindings to describe
|
||||
the controller.
|
||||
|
||||
Signed-off-by: Minghuan Lian <Minghuan.Lian@nxp.com>
|
||||
Acked-by: Rob Herring <robh@kernel.org>
|
||||
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
---
|
||||
.../interrupt-controller/fsl,ls-scfg-msi.txt | 30 ++++++++++++++++++++++
|
||||
1 file changed, 30 insertions(+)
|
||||
create mode 100644 Documentation/devicetree/bindings/interrupt-controller/fsl,ls-scfg-msi.txt
|
||||
|
||||
--- /dev/null
|
||||
+++ b/Documentation/devicetree/bindings/interrupt-controller/fsl,ls-scfg-msi.txt
|
||||
@@ -0,0 +1,30 @@
|
||||
+* Freescale Layerscape SCFG PCIe MSI controller
|
||||
+
|
||||
+Required properties:
|
||||
+
|
||||
+- compatible: should be "fsl,<soc-name>-msi" to identify
|
||||
+ Layerscape PCIe MSI controller block such as:
|
||||
+ "fsl,1s1021a-msi"
|
||||
+ "fsl,1s1043a-msi"
|
||||
+- msi-controller: indicates that this is a PCIe MSI controller node
|
||||
+- reg: physical base address of the controller and length of memory mapped.
|
||||
+- interrupts: an interrupt to the parent interrupt controller.
|
||||
+
|
||||
+Optional properties:
|
||||
+- interrupt-parent: the phandle to the parent interrupt controller.
|
||||
+
|
||||
+This interrupt controller hardware is a second level interrupt controller that
|
||||
+is hooked to a parent interrupt controller: e.g: ARM GIC for ARM-based
|
||||
+platforms. If interrupt-parent is not provided, the default parent interrupt
|
||||
+controller will be used.
|
||||
+Each PCIe node needs to have property msi-parent that points to
|
||||
+MSI controller node
|
||||
+
|
||||
+Examples:
|
||||
+
|
||||
+ msi1: msi-controller@1571000 {
|
||||
+ compatible = "fsl,1s1043a-msi";
|
||||
+ reg = <0x0 0x1571000 0x0 0x8>,
|
||||
+ msi-controller;
|
||||
+ interrupts = <0 116 0x4>;
|
||||
+ };
|
@ -1,31 +0,0 @@
|
||||
From f560fdb9d71aaf3adc54341a1650577c78495df9 Mon Sep 17 00:00:00 2001
|
||||
From: Brian Norris <computersforpeace@gmail.com>
|
||||
Date: Fri, 30 Oct 2015 20:33:22 -0700
|
||||
Subject: [PATCH 074/113] mtd: {nand,spi-nor}: assign MTD of_node
|
||||
|
||||
We should pass along our flash DT node to the MTD layer, so it can set
|
||||
up ofpart for us.
|
||||
|
||||
cherry-pick{
|
||||
remove the code:
|
||||
drivers/mtd/nand/nand_base.c | 3 +
|
||||
commit:3e63b26bdd4069c3df2cd7ce7217a21d06801b41
|
||||
}
|
||||
|
||||
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
|
||||
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
|
||||
Signed-off-by: Yuan Yao <yao.yuan@nxp.com>
|
||||
---
|
||||
drivers/mtd/spi-nor/spi-nor.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/drivers/mtd/spi-nor/spi-nor.c
|
||||
+++ b/drivers/mtd/spi-nor/spi-nor.c
|
||||
@@ -1228,6 +1228,7 @@ int spi_nor_scan(struct spi_nor *nor, co
|
||||
mtd->flags |= MTD_NO_ERASE;
|
||||
|
||||
mtd->dev.parent = dev;
|
||||
+ mtd_set_of_node(mtd, np);
|
||||
nor->page_size = info->page_size;
|
||||
mtd->writebufsize = nor->page_size;
|
||||
|
@ -1,80 +0,0 @@
|
||||
From f906ec330da9aa83de5382653436be36273c63d3 Mon Sep 17 00:00:00 2001
|
||||
From: Brian Norris <computersforpeace@gmail.com>
|
||||
Date: Fri, 30 Oct 2015 20:33:24 -0700
|
||||
Subject: [PATCH 075/113] mtd: spi-nor: convert to spi_nor_{get,
|
||||
set}_flash_node()
|
||||
|
||||
Used semantic patch with 'make coccicheck MODE=patch COCCI=script.cocci':
|
||||
|
||||
---8<----
|
||||
virtual patch
|
||||
|
||||
@@
|
||||
struct spi_nor b;
|
||||
struct spi_nor *c;
|
||||
expression d;
|
||||
@@
|
||||
(
|
||||
-(b).flash_node = (d)
|
||||
+spi_nor_set_flash_node(&b, d)
|
||||
|
|
||||
-(c)->flash_node = (d)
|
||||
+spi_nor_set_flash_node(c, d)
|
||||
)
|
||||
---8<----
|
||||
|
||||
And a manual conversion for the one use of spi_nor_get_flash_node().
|
||||
|
||||
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
|
||||
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
|
||||
---
|
||||
drivers/mtd/devices/m25p80.c | 2 +-
|
||||
drivers/mtd/spi-nor/fsl-quadspi.c | 2 +-
|
||||
drivers/mtd/spi-nor/nxp-spifi.c | 2 +-
|
||||
drivers/mtd/spi-nor/spi-nor.c | 2 +-
|
||||
4 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/mtd/devices/m25p80.c
|
||||
+++ b/drivers/mtd/devices/m25p80.c
|
||||
@@ -221,7 +221,7 @@ static int m25p_probe(struct spi_device
|
||||
nor->read_reg = m25p80_read_reg;
|
||||
|
||||
nor->dev = &spi->dev;
|
||||
- nor->flash_node = spi->dev.of_node;
|
||||
+ spi_nor_set_flash_node(nor, spi->dev.of_node);
|
||||
nor->priv = flash;
|
||||
|
||||
spi_set_drvdata(spi, flash);
|
||||
--- a/drivers/mtd/spi-nor/fsl-quadspi.c
|
||||
+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
|
||||
@@ -1013,7 +1013,7 @@ static int fsl_qspi_probe(struct platfor
|
||||
mtd = &nor->mtd;
|
||||
|
||||
nor->dev = dev;
|
||||
- nor->flash_node = np;
|
||||
+ spi_nor_set_flash_node(nor, np);
|
||||
nor->priv = q;
|
||||
|
||||
/* fill the hooks */
|
||||
--- a/drivers/mtd/spi-nor/nxp-spifi.c
|
||||
+++ b/drivers/mtd/spi-nor/nxp-spifi.c
|
||||
@@ -330,7 +330,7 @@ static int nxp_spifi_setup_flash(struct
|
||||
writel(ctrl, spifi->io_base + SPIFI_CTRL);
|
||||
|
||||
spifi->nor.dev = spifi->dev;
|
||||
- spifi->nor.flash_node = np;
|
||||
+ spi_nor_set_flash_node(&spifi->nor, np);
|
||||
spifi->nor.priv = spifi;
|
||||
spifi->nor.read = nxp_spifi_read;
|
||||
spifi->nor.write = nxp_spifi_write;
|
||||
--- a/drivers/mtd/spi-nor/spi-nor.c
|
||||
+++ b/drivers/mtd/spi-nor/spi-nor.c
|
||||
@@ -1120,7 +1120,7 @@ int spi_nor_scan(struct spi_nor *nor, co
|
||||
const struct flash_info *info = NULL;
|
||||
struct device *dev = nor->dev;
|
||||
struct mtd_info *mtd = &nor->mtd;
|
||||
- struct device_node *np = nor->flash_node;
|
||||
+ struct device_node *np = spi_nor_get_flash_node(nor);
|
||||
int ret;
|
||||
int i;
|
||||
|
@ -1,83 +0,0 @@
|
||||
From e36da6d0a0841ea3a75d5189057bd020d737e71a Mon Sep 17 00:00:00 2001
|
||||
From: Brian Norris <computersforpeace@gmail.com>
|
||||
Date: Fri, 30 Oct 2015 20:33:26 -0700
|
||||
Subject: [PATCH 076/113] mtd: spi-nor: drop unnecessary partition parser data
|
||||
|
||||
Now that the SPI-NOR/MTD framework pass the 'flash_node' through to the
|
||||
partition parsing code, we don't have to do it ourselves.
|
||||
|
||||
Also convert to mtd_device_register(), since we don't need the 2nd and
|
||||
3rd parameters anymore.
|
||||
|
||||
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
|
||||
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
|
||||
---
|
||||
drivers/mtd/devices/m25p80.c | 8 ++------
|
||||
drivers/mtd/spi-nor/fsl-quadspi.c | 4 +---
|
||||
drivers/mtd/spi-nor/nxp-spifi.c | 4 +---
|
||||
3 files changed, 4 insertions(+), 12 deletions(-)
|
||||
|
||||
--- a/drivers/mtd/devices/m25p80.c
|
||||
+++ b/drivers/mtd/devices/m25p80.c
|
||||
@@ -197,7 +197,6 @@ static int m25p80_erase(struct spi_nor *
|
||||
*/
|
||||
static int m25p_probe(struct spi_device *spi)
|
||||
{
|
||||
- struct mtd_part_parser_data ppdata;
|
||||
struct flash_platform_data *data;
|
||||
struct m25p *flash;
|
||||
struct spi_nor *nor;
|
||||
@@ -249,11 +248,8 @@ static int m25p_probe(struct spi_device
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
- ppdata.of_node = spi->dev.of_node;
|
||||
-
|
||||
- return mtd_device_parse_register(&nor->mtd, NULL, &ppdata,
|
||||
- data ? data->parts : NULL,
|
||||
- data ? data->nr_parts : 0);
|
||||
+ return mtd_device_register(&nor->mtd, data ? data->parts : NULL,
|
||||
+ data ? data->nr_parts : 0);
|
||||
}
|
||||
|
||||
|
||||
--- a/drivers/mtd/spi-nor/fsl-quadspi.c
|
||||
+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
|
||||
@@ -927,7 +927,6 @@ static void fsl_qspi_unprep(struct spi_n
|
||||
static int fsl_qspi_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
- struct mtd_part_parser_data ppdata;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct fsl_qspi *q;
|
||||
struct resource *res;
|
||||
@@ -1038,8 +1037,7 @@ static int fsl_qspi_probe(struct platfor
|
||||
if (ret)
|
||||
goto mutex_failed;
|
||||
|
||||
- ppdata.of_node = np;
|
||||
- ret = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
|
||||
+ ret = mtd_device_register(mtd, NULL, 0);
|
||||
if (ret)
|
||||
goto mutex_failed;
|
||||
|
||||
--- a/drivers/mtd/spi-nor/nxp-spifi.c
|
||||
+++ b/drivers/mtd/spi-nor/nxp-spifi.c
|
||||
@@ -271,7 +271,6 @@ static void nxp_spifi_dummy_id_read(stru
|
||||
static int nxp_spifi_setup_flash(struct nxp_spifi *spifi,
|
||||
struct device_node *np)
|
||||
{
|
||||
- struct mtd_part_parser_data ppdata;
|
||||
enum read_mode flash_read;
|
||||
u32 ctrl, property;
|
||||
u16 mode = 0;
|
||||
@@ -361,8 +360,7 @@ static int nxp_spifi_setup_flash(struct
|
||||
return ret;
|
||||
}
|
||||
|
||||
- ppdata.of_node = np;
|
||||
- ret = mtd_device_parse_register(&spifi->nor.mtd, NULL, &ppdata, NULL, 0);
|
||||
+ ret = mtd_device_register(&spifi->nor.mtd, NULL, 0);
|
||||
if (ret) {
|
||||
dev_err(spifi->dev, "mtd device parse failed\n");
|
||||
return ret;
|
@ -1,62 +0,0 @@
|
||||
From a2f87e7df641b482e217f5b0efbaf41f6b8a0cf6 Mon Sep 17 00:00:00 2001
|
||||
From: Brian Norris <computersforpeace@gmail.com>
|
||||
Date: Fri, 30 Oct 2015 20:33:20 -0700
|
||||
Subject: [PATCH 077/113] mtd: add get/set of_node/flash_node helpers
|
||||
|
||||
We are going to begin using the mtd->dev.of_node field for MTD device
|
||||
nodes, so let's add helpers for it. Also, we'll be making some
|
||||
conversions on spi_nor (and nand_chip eventually) too, so get that ready
|
||||
with their own helpers.
|
||||
|
||||
commit:28b8b26b308e656edfa9467867d5f79212da2ec3
|
||||
delete the include/linux/mtd/nand.h
|
||||
just upgrade the code about spi.
|
||||
|
||||
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
|
||||
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
|
||||
Signed-off-by: Yuan Yao <yao.yuan@nxp.com>
|
||||
---
|
||||
include/linux/mtd/mtd.h | 11 +++++++++++
|
||||
include/linux/mtd/spi-nor.h | 11 +++++++++++
|
||||
2 files changed, 22 insertions(+)
|
||||
|
||||
--- a/include/linux/mtd/mtd.h
|
||||
+++ b/include/linux/mtd/mtd.h
|
||||
@@ -258,6 +258,17 @@ struct mtd_info {
|
||||
int usecount;
|
||||
};
|
||||
|
||||
+static inline void mtd_set_of_node(struct mtd_info *mtd,
|
||||
+ struct device_node *np)
|
||||
+{
|
||||
+ mtd->dev.of_node = np;
|
||||
+}
|
||||
+
|
||||
+static inline struct device_node *mtd_get_of_node(struct mtd_info *mtd)
|
||||
+{
|
||||
+ return mtd->dev.of_node;
|
||||
+}
|
||||
+
|
||||
int mtd_erase(struct mtd_info *mtd, struct erase_info *instr);
|
||||
int mtd_point(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen,
|
||||
void **virt, resource_size_t *phys);
|
||||
--- a/include/linux/mtd/spi-nor.h
|
||||
+++ b/include/linux/mtd/spi-nor.h
|
||||
@@ -184,6 +184,17 @@ struct spi_nor {
|
||||
void *priv;
|
||||
};
|
||||
|
||||
+static inline void spi_nor_set_flash_node(struct spi_nor *nor,
|
||||
+ struct device_node *np)
|
||||
+{
|
||||
+ nor->flash_node = np;
|
||||
+}
|
||||
+
|
||||
+static inline struct device_node *spi_nor_get_flash_node(struct spi_nor *nor)
|
||||
+{
|
||||
+ return nor->flash_node;
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* spi_nor_scan() - scan the SPI NOR
|
||||
* @nor: the spi_nor structure
|
@ -1,57 +0,0 @@
|
||||
From df36b4601bc9f84684249a26eb39b818d6785fb8 Mon Sep 17 00:00:00 2001
|
||||
From: Brian Norris <computersforpeace@gmail.com>
|
||||
Date: Fri, 30 Oct 2015 20:33:27 -0700
|
||||
Subject: [PATCH 078/113] mtd: spi-nor: drop flash_node field
|
||||
|
||||
We can just alias to the MTD of_node.
|
||||
|
||||
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
|
||||
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
|
||||
---
|
||||
drivers/mtd/spi-nor/spi-nor.c | 1 -
|
||||
include/linux/mtd/spi-nor.h | 6 ++----
|
||||
2 files changed, 2 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/drivers/mtd/spi-nor/spi-nor.c
|
||||
+++ b/drivers/mtd/spi-nor/spi-nor.c
|
||||
@@ -1228,7 +1228,6 @@ int spi_nor_scan(struct spi_nor *nor, co
|
||||
mtd->flags |= MTD_NO_ERASE;
|
||||
|
||||
mtd->dev.parent = dev;
|
||||
- mtd_set_of_node(mtd, np);
|
||||
nor->page_size = info->page_size;
|
||||
mtd->writebufsize = nor->page_size;
|
||||
|
||||
--- a/include/linux/mtd/spi-nor.h
|
||||
+++ b/include/linux/mtd/spi-nor.h
|
||||
@@ -123,7 +123,6 @@ enum spi_nor_option_flags {
|
||||
* @mtd: point to a mtd_info structure
|
||||
* @lock: the lock for the read/write/erase/lock/unlock operations
|
||||
* @dev: point to a spi device, or a spi nor controller device.
|
||||
- * @flash_node: point to a device node describing this flash instance.
|
||||
* @page_size: the page size of the SPI NOR
|
||||
* @addr_width: number of address bytes
|
||||
* @erase_opcode: the opcode for erasing a sector
|
||||
@@ -154,7 +153,6 @@ struct spi_nor {
|
||||
struct mtd_info mtd;
|
||||
struct mutex lock;
|
||||
struct device *dev;
|
||||
- struct device_node *flash_node;
|
||||
u32 page_size;
|
||||
u8 addr_width;
|
||||
u8 erase_opcode;
|
||||
@@ -187,12 +185,12 @@ struct spi_nor {
|
||||
static inline void spi_nor_set_flash_node(struct spi_nor *nor,
|
||||
struct device_node *np)
|
||||
{
|
||||
- nor->flash_node = np;
|
||||
+ mtd_set_of_node(&nor->mtd, np);
|
||||
}
|
||||
|
||||
static inline struct device_node *spi_nor_get_flash_node(struct spi_nor *nor)
|
||||
{
|
||||
- return nor->flash_node;
|
||||
+ return mtd_get_of_node(&nor->mtd);
|
||||
}
|
||||
|
||||
/**
|
@ -1,27 +0,0 @@
|
||||
From 3ea419cf269832f5743d9b5ad75ece5178b02b09 Mon Sep 17 00:00:00 2001
|
||||
From: Brian Norris <computersforpeace@gmail.com>
|
||||
Date: Fri, 30 Oct 2015 12:56:22 -0700
|
||||
Subject: [PATCH 079/113] mtd: spi-nor: remove unnecessary leading space from
|
||||
dbg print
|
||||
|
||||
As Cyrille noted [1], this line is wrong.
|
||||
|
||||
[1] http://lists.infradead.org/pipermail/linux-mtd/2015-September/061725.html
|
||||
|
||||
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
|
||||
Cc: Cyrille Pitchen <cyrille.pitchen@atmel.com>
|
||||
---
|
||||
drivers/mtd/spi-nor/spi-nor.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/mtd/spi-nor/spi-nor.c
|
||||
+++ b/drivers/mtd/spi-nor/spi-nor.c
|
||||
@@ -862,7 +862,7 @@ static const struct flash_info *spi_nor_
|
||||
|
||||
tmp = nor->read_reg(nor, SPINOR_OP_RDID, id, SPI_NOR_MAX_ID_LEN);
|
||||
if (tmp < 0) {
|
||||
- dev_dbg(nor->dev, " error %d reading JEDEC ID\n", tmp);
|
||||
+ dev_dbg(nor->dev, "error %d reading JEDEC ID\n", tmp);
|
||||
return ERR_PTR(tmp);
|
||||
}
|
||||
|
@ -1,50 +0,0 @@
|
||||
From bd02decd1ad7cc883ce388e769a34a3c402b90c4 Mon Sep 17 00:00:00 2001
|
||||
From: Brian Norris <computersforpeace@gmail.com>
|
||||
Date: Mon, 16 Nov 2015 10:45:30 -0800
|
||||
Subject: [PATCH 080/113] mtd: fsl-quadspi: possible NULL dereference
|
||||
|
||||
It is theoretically possible to probe this driver without a matching
|
||||
device tree, so let's guard against this.
|
||||
|
||||
Also, use the of_device_get_match_data() helper to make this a bit
|
||||
simpler.
|
||||
|
||||
Coverity complained about this one.
|
||||
|
||||
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
|
||||
Acked-by: Han xu <han.xu@freescale.com>
|
||||
---
|
||||
drivers/mtd/spi-nor/fsl-quadspi.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/mtd/spi-nor/fsl-quadspi.c
|
||||
+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
|
||||
@@ -269,7 +269,7 @@ struct fsl_qspi {
|
||||
struct clk *clk, *clk_en;
|
||||
struct device *dev;
|
||||
struct completion c;
|
||||
- struct fsl_qspi_devtype_data *devtype_data;
|
||||
+ const struct fsl_qspi_devtype_data *devtype_data;
|
||||
u32 nor_size;
|
||||
u32 nor_num;
|
||||
u32 clk_rate;
|
||||
@@ -933,8 +933,6 @@ static int fsl_qspi_probe(struct platfor
|
||||
struct spi_nor *nor;
|
||||
struct mtd_info *mtd;
|
||||
int ret, i = 0;
|
||||
- const struct of_device_id *of_id =
|
||||
- of_match_device(fsl_qspi_dt_ids, &pdev->dev);
|
||||
|
||||
q = devm_kzalloc(dev, sizeof(*q), GFP_KERNEL);
|
||||
if (!q)
|
||||
@@ -945,7 +943,9 @@ static int fsl_qspi_probe(struct platfor
|
||||
return -ENODEV;
|
||||
|
||||
q->dev = dev;
|
||||
- q->devtype_data = (struct fsl_qspi_devtype_data *)of_id->data;
|
||||
+ q->devtype_data = of_device_get_match_data(dev);
|
||||
+ if (!q->devtype_data)
|
||||
+ return -ENODEV;
|
||||
platform_set_drvdata(pdev, q);
|
||||
|
||||
/* find the resources */
|
@ -1,105 +0,0 @@
|
||||
From 56bd0e13d8bc3b4486251b10ac9d2ba7434c21ee Mon Sep 17 00:00:00 2001
|
||||
From: Brian Norris <computersforpeace@gmail.com>
|
||||
Date: Tue, 10 Nov 2015 12:15:27 -0800
|
||||
Subject: [PATCH 081/113] mtd: spi-nor: provide default erase_sector
|
||||
implementation
|
||||
|
||||
Some spi-nor drivers perform sector erase by duplicating their
|
||||
write_reg() command. Let's not require that the driver fill this out,
|
||||
and provide a default instead.
|
||||
|
||||
Tested on m25p80.c and Medatek's MT8173 SPI NOR flash driver.
|
||||
|
||||
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
|
||||
---
|
||||
drivers/mtd/spi-nor/spi-nor.c | 37 +++++++++++++++++++++++++++++++++----
|
||||
include/linux/mtd/spi-nor.h | 3 ++-
|
||||
2 files changed, 35 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/drivers/mtd/spi-nor/spi-nor.c
|
||||
+++ b/drivers/mtd/spi-nor/spi-nor.c
|
||||
@@ -38,6 +38,7 @@
|
||||
#define CHIP_ERASE_2MB_READY_WAIT_JIFFIES (40UL * HZ)
|
||||
|
||||
#define SPI_NOR_MAX_ID_LEN 6
|
||||
+#define SPI_NOR_MAX_ADDR_WIDTH 4
|
||||
|
||||
struct flash_info {
|
||||
char *name;
|
||||
@@ -314,6 +315,29 @@ static void spi_nor_unlock_and_unprep(st
|
||||
}
|
||||
|
||||
/*
|
||||
+ * Initiate the erasure of a single sector
|
||||
+ */
|
||||
+static int spi_nor_erase_sector(struct spi_nor *nor, u32 addr)
|
||||
+{
|
||||
+ u8 buf[SPI_NOR_MAX_ADDR_WIDTH];
|
||||
+ int i;
|
||||
+
|
||||
+ if (nor->erase)
|
||||
+ return nor->erase(nor, addr);
|
||||
+
|
||||
+ /*
|
||||
+ * Default implementation, if driver doesn't have a specialized HW
|
||||
+ * control
|
||||
+ */
|
||||
+ for (i = nor->addr_width - 1; i >= 0; i--) {
|
||||
+ buf[i] = addr & 0xff;
|
||||
+ addr >>= 8;
|
||||
+ }
|
||||
+
|
||||
+ return nor->write_reg(nor, nor->erase_opcode, buf, nor->addr_width);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
* Erase an address range on the nor chip. The address range may extend
|
||||
* one or more erase sectors. Return an error is there is a problem erasing.
|
||||
*/
|
||||
@@ -372,10 +396,9 @@ static int spi_nor_erase(struct mtd_info
|
||||
while (len) {
|
||||
write_enable(nor);
|
||||
|
||||
- if (nor->erase(nor, addr)) {
|
||||
- ret = -EIO;
|
||||
+ ret = spi_nor_erase_sector(nor, addr);
|
||||
+ if (ret)
|
||||
goto erase_err;
|
||||
- }
|
||||
|
||||
addr += mtd->erasesize;
|
||||
len -= mtd->erasesize;
|
||||
@@ -1107,7 +1130,7 @@ static int set_quad_mode(struct spi_nor
|
||||
static int spi_nor_check(struct spi_nor *nor)
|
||||
{
|
||||
if (!nor->dev || !nor->read || !nor->write ||
|
||||
- !nor->read_reg || !nor->write_reg || !nor->erase) {
|
||||
+ !nor->read_reg || !nor->write_reg) {
|
||||
pr_err("spi-nor: please fill all the necessary fields!\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1310,6 +1333,12 @@ int spi_nor_scan(struct spi_nor *nor, co
|
||||
nor->addr_width = 3;
|
||||
}
|
||||
|
||||
+ if (nor->addr_width > SPI_NOR_MAX_ADDR_WIDTH) {
|
||||
+ dev_err(dev, "address width is too large: %u\n",
|
||||
+ nor->addr_width);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
nor->read_dummy = spi_nor_read_dummy_cycles(nor);
|
||||
|
||||
dev_info(dev, "%s (%lld Kbytes)\n", info->name,
|
||||
--- a/include/linux/mtd/spi-nor.h
|
||||
+++ b/include/linux/mtd/spi-nor.h
|
||||
@@ -142,7 +142,8 @@ enum spi_nor_option_flags {
|
||||
* @read: [DRIVER-SPECIFIC] read data from the SPI NOR
|
||||
* @write: [DRIVER-SPECIFIC] write data to the SPI NOR
|
||||
* @erase: [DRIVER-SPECIFIC] erase a sector of the SPI NOR
|
||||
- * at the offset @offs
|
||||
+ * at the offset @offs; if not provided by the driver,
|
||||
+ * spi-nor will send the erase opcode via write_reg()
|
||||
* @flash_lock: [FLASH-SPECIFIC] lock a region of the SPI NOR
|
||||
* @flash_unlock: [FLASH-SPECIFIC] unlock a region of the SPI NOR
|
||||
* @flash_is_locked: [FLASH-SPECIFIC] check if a region of the SPI NOR is
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user