diff --git a/config/Config-build.in b/config/Config-build.in index 8e12199cbd..178afbdb94 100644 --- a/config/Config-build.in +++ b/config/Config-build.in @@ -362,6 +362,12 @@ menu "Global build settings" help SELinux Reference Policy (refpolicy) + config SELINUXTYPE_targeted-modular + bool "targeted-modular" + select PACKAGE_refpolicy-modular + help + Modular SELinux Reference Policy (refpolicy-modular) + config SELINUXTYPE_dssp bool "dssp" select PACKAGE_selinux-policy diff --git a/include/kernel-version.mk b/include/kernel-version.mk index f03295e901..69dfaa5476 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,9 +6,9 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-5.4 = .74 +LINUX_VERSION-5.4 = .75 -LINUX_KERNEL_HASH-5.4.74 = ec04f4ade1146a3b458a1ac3dc2059188cbb62cd51d2e66fcd8397fcec153ab7 +LINUX_KERNEL_HASH-5.4.75 = d2466fd6eb5433e7bf287b617b11b2640c65a7ea93a57eb7a80d7f537cbc1470 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index f63c4db533..b546eb7e0b 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=base-files -PKG_RELEASE:=235 +PKG_RELEASE:=236 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 2eb26ba44b..a5c27dc2fb 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -63,8 +63,20 @@ ask_bool() { [ "$answer" -gt 0 ] } +_v() { + [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$*" >&2 +} + +_vn() { + [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo -n "$*" >&2 +} + v() { - [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$@" + _v "$(date) upgrade: $@" +} + +vn() { + _vn "$(date) upgrade: $@" } json_string() { @@ -91,7 +103,18 @@ get_image() { # [ ] esac fi - cat "$from" 2>/dev/null | $cmd + $cmd <"$from" +} + +get_image_dd() { + local from="$1"; shift + + ( + exec 3>&2 + ( exec 3>&2; get_image "$from" 2>&1 1>&3 | grep -v -F ' Broken pipe' ) 2>&1 1>&3 \ + | ( exec 3>&2; dd "$@" 2>&1 1>&3 | grep -v -E ' records (in|out)') 2>&1 1>&3 + exec 3>&- + ) } get_magic_word() { diff --git a/package/base-files/files/lib/upgrade/fwtool.sh b/package/base-files/files/lib/upgrade/fwtool.sh index 3a74c72bba..3826bf5c30 100644 --- a/package/base-files/files/lib/upgrade/fwtool.sh +++ b/package/base-files/files/lib/upgrade/fwtool.sh @@ -10,9 +10,9 @@ fwtool_check_signature() { } if ! fwtool -q -s /tmp/sysupgrade.ucert "$1"; then - echo "Image signature not found" + v "Image signature not present" [ "$REQUIRE_IMAGE_SIGNATURE" = 1 -a "$FORCE" != 1 ] && { - echo "Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware" + v "Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware" } [ "$REQUIRE_IMAGE_SIGNATURE" = 1 ] && return 1 return 0 @@ -30,16 +30,16 @@ fwtool_check_image() { . /usr/share/libubox/jshn.sh if ! fwtool -q -i /tmp/sysupgrade.meta "$1"; then - echo "Image metadata not found" + v "Image metadata not present" [ "$REQUIRE_IMAGE_METADATA" = 1 -a "$FORCE" != 1 ] && { - echo "Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware" + v "Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware" } [ "$REQUIRE_IMAGE_METADATA" = 1 ] && return 1 return 0 fi json_load "$(cat /tmp/sysupgrade.meta)" || { - echo "Invalid image metadata" + v "Invalid image metadata" return 1 } @@ -64,15 +64,15 @@ fwtool_check_image() { if [ "$dev" = "$device" ]; then # major compat version -> no sysupgrade if [ "${devicecompat%.*}" != "${imagecompat%.*}" ]; then - echo "The device is supported, but this image is incompatible for sysupgrade based on the image version ($devicecompat->$imagecompat)." - [ -n "$compatmessage" ] && echo "$compatmessage" + v "The device is supported, but this image is incompatible for sysupgrade based on the image version ($devicecompat->$imagecompat)." + [ -n "$compatmessage" ] && v "$compatmessage" return 1 fi # minor compat version -> sysupgrade with -n required if [ "${devicecompat#.*}" != "${imagecompat#.*}" ] && [ "$SAVE_CONFIG" = "1" ]; then - echo "The device is supported, but the config is incompatible to the new image ($devicecompat->$imagecompat). Please upgrade without keeping config (sysupgrade -n)." - [ -n "$compatmessage" ] && echo "$compatmessage" + v "The device is supported, but the config is incompatible to the new image ($devicecompat->$imagecompat). Please upgrade without keeping config (sysupgrade -n)." + [ -n "$compatmessage" ] && v "$compatmessage" return 1 fi @@ -80,13 +80,13 @@ fwtool_check_image() { fi done - echo "Device $device not supported by this image" - echo -n "Supported devices:" + v "Device $device not supported by this image" + vn "Supported devices:" for k in $dev_keys; do json_get_var dev "$k" - echo -n " $dev" + _vn " $dev" done - echo + _v return 1 } diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2 index a4fef42134..c7629c383f 100755 --- a/package/base-files/files/lib/upgrade/stage2 +++ b/package/base-files/files/lib/upgrade/stage2 @@ -42,7 +42,7 @@ switch_to_ramfs() { mtd partx losetup mkfs.ext4 nandwrite flash_erase \ ubiupdatevol ubiattach ubiblock ubiformat \ ubidetach ubirsvol ubirmvol ubimkvol \ - snapshot snapshot_tool \ + snapshot snapshot_tool date \ $RAMFS_COPY_BIN do local file="$(command -v "$binary" 2>/dev/null)" @@ -53,7 +53,7 @@ switch_to_ramfs() { [ -L "/lib64" ] && ln -s /lib $RAM_ROOT/lib64 supivot $RAM_ROOT /mnt || { - echo "Failed to switch over to ramfs. Please reboot." + v "Failed to switch over to ramfs. Please reboot." exit 1 } @@ -75,7 +75,7 @@ kill_remaining() { # [ [ ] ] local stat local proc_ppid=$(cut -d' ' -f4 /proc/$$/stat) - echo -n "Sending $sig to remaining processes ... " + vn "Sending $sig to remaining processes ..." while $run; do run=false @@ -95,7 +95,7 @@ kill_remaining() { # [ [ ] ] # Skip kernel threads [ -n "$cmdline" ] || continue - echo -n "$name " + _vn " $name" kill -$sig $pid 2>/dev/null [ $loop -eq 1 ] && run=true @@ -103,12 +103,12 @@ kill_remaining() { # [ [ ] ] let loop_limit-- [ $loop_limit -eq 0 ] && { - echo - echo "Failed to kill all processes." + _v + v "Failed to kill all processes." exit 1 } done - echo + _v } indicate_upgrade @@ -129,7 +129,7 @@ if [ -n "$IMAGE" ] && type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then fi if [ -n "$(rootfs_type)" ]; then - echo "Switching to ramdisk..." + v "Switching to ramdisk..." switch_to_ramfs fi diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index cbbbad7b87..ba10ded333 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_UPSTREAM_VERSION:=2.82 PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION))) -PKG_RELEASE:=8 +PKG_RELEASE:=10 PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq diff --git a/package/network/services/dnsmasq/files/dhcp.conf b/package/network/services/dnsmasq/files/dhcp.conf index cc28a08bd6..57d6c9576d 100644 --- a/package/network/services/dnsmasq/files/dhcp.conf +++ b/package/network/services/dnsmasq/files/dhcp.conf @@ -22,6 +22,7 @@ config dnsmasq option localservice 1 # disable to allow DNS requests from non-local subnets option filter_aaaa 0 option dns_redirect 1 + option ednspacket_max 1232 config dhcp lan option interface lan diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 64f16ff998..9dc17cfeb2 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -769,6 +769,29 @@ dhcp_relay_add() { fi } +dnsmasq_ipset_add() { + local cfg="$1" + local ipsets domains + + add_ipset() { + ipsets="${ipsets:+$ipsets,}$1" + } + + add_domain() { + # leading '/' is expected + domains="$domains/$1" + } + + config_list_foreach "$cfg" "name" add_ipset + config_list_foreach "$cfg" "domain" add_domain + + if [ -z "$ipsets" ] || [ -z "$domains" ]; then + return 0 + fi + + xappend "--ipset=$domains/$ipsets" +} + dnsmasq_start() { local cfg="$1" @@ -1060,6 +1083,10 @@ dnsmasq_start() config_foreach filter_dnsmasq cname dhcp_cname_add "$cfg" echo >> $CONFIGFILE_TMP + echo >> $CONFIGFILE_TMP + config_foreach filter_dnsmasq ipset dnsmasq_ipset_add "$cfg" + echo >> $CONFIGFILE_TMP + echo >> $CONFIGFILE_TMP mv -f $CONFIGFILE_TMP $CONFIGFILE mv -f $HOSTFILE_TMP $HOSTFILE diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index f076eba88f..8c884386f2 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -204,6 +204,17 @@ define Package/hostapd-basic-openssl/description This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support. endef +define Package/hostapd-basic-wolfssl +$(call Package/hostapd/Default,$(1)) + TITLE+= (WPA-PSK, 11r and 11w) + VARIANT:=basic-wolfssl + DEPENDS+=+libwolfssl +endef + +define Package/hostapd-basic-wolfssl/description + This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support. +endef + define Package/hostapd-mini $(call Package/hostapd/Default,$(1)) TITLE+= (WPA-PSK only) @@ -598,6 +609,7 @@ define Package/hostapd/install endef Package/hostapd-basic/install = $(Package/hostapd/install) Package/hostapd-basic-openssl/install = $(Package/hostapd/install) +Package/hostapd-basic-wolfssl/install = $(Package/hostapd/install) Package/hostapd-mini/install = $(Package/hostapd/install) Package/hostapd-openssl/install = $(Package/hostapd/install) Package/hostapd-wolfssl/install = $(Package/hostapd/install) @@ -668,6 +680,7 @@ endif $(eval $(call BuildPackage,hostapd)) $(eval $(call BuildPackage,hostapd-basic)) $(eval $(call BuildPackage,hostapd-basic-openssl)) +$(eval $(call BuildPackage,hostapd-basic-wolfssl)) $(eval $(call BuildPackage,hostapd-mini)) $(eval $(call BuildPackage,hostapd-openssl)) $(eval $(call BuildPackage,hostapd-wolfssl)) diff --git a/package/network/services/uhttpd/files/uhttpd.config b/package/network/services/uhttpd/files/uhttpd.config index 0904b01ca7..9e6ff70a93 100644 --- a/package/network/services/uhttpd/files/uhttpd.config +++ b/package/network/services/uhttpd/files/uhttpd.config @@ -125,7 +125,7 @@ config cert defaults option bits 256 # EC curve name - # Curve names vary between mbedtls/px5g and openssl + # Curve names vary between px5g-{wolfssl,mbedtls} and openssl # P-256 or P-384 are guaranteed to work option ec_curve P-256 diff --git a/package/system/refpolicy/Makefile b/package/system/refpolicy/Makefile index a431770955..d9c8c90208 100644 --- a/package/system/refpolicy/Makefile +++ b/package/system/refpolicy/Makefile @@ -24,7 +24,7 @@ TAR_OPTIONS:=--transform='s%^refpolicy%$(PKG_NAME)-$(PKG_VERSION)%' -xf - include $(INCLUDE_DIR)/package.mk -define Package/refpolicy +define Package/refpolicy/Default SECTION:=system CATEGORY:=Base system TITLE:=SELinux reference policy @@ -32,6 +32,19 @@ define Package/refpolicy PKGARCH:=all endef +define Package/refpolicy + $(call Package/refpolicy/Default) + CONFLICTS:=refpolicy-modular + VARIANT:=default +endef + +define Package/refpolicy-modular + $(call Package/refpolicy/Default) + TITLE += (modular) + VARIANT:=modular + PROVIDES:=refpolicy +endef + define Package/refpolicy/description The SELinux Reference Policy project (refpolicy) is a complete SELinux policy that can be used as the system @@ -56,25 +69,43 @@ endef # builds is a small host tool that gets run as part of the build # process. MAKE_FLAGS += \ + DESTDIR="$(PKG_INSTALL_DIR)" SETFILES="$(STAGING_DIR_HOST)/bin/setfiles" \ CHECKPOLICY="$(STAGING_DIR_HOSTPKG)/bin/checkpolicy" \ CC="$(HOSTCC)" \ CFLAGS="$(HOST_CFLAGS)" define Build/Configure - $(SED) "/MONOLITHIC/c\MONOLITHIC = y" $(PKG_BUILD_DIR)/build.conf $(SED) "/NAME/c\NAME = targeted" $(PKG_BUILD_DIR)/build.conf +ifneq ($(BUILD_VARIANT),modular) + $(SED) "/MONOLITHIC/c\MONOLITHIC = y" $(PKG_BUILD_DIR)/build.conf +endif $(call Build/Compile/Default,conf) endef +ifeq ($(BUILD_VARIANT),modular) +define Build/Install + $(call Build/Compile/Default,install install-headers) +endef +endif + define Package/refpolicy/conffiles /etc/selinux/config endef +Package/refpolicy-modular/conffiles = $(Package/refpolicy/conffiles) + define Package/refpolicy/install $(INSTALL_DIR) $(1)/etc/selinux $(CP) $(PKG_INSTALL_DIR)/etc/selinux/* $(1)/etc/selinux/ $(CP) ./files/selinux-config $(1)/etc/selinux/config +ifeq ($(BUILD_VARIANT),modular) + $(INSTALL_DIR) $(1)/usr/share/selinux + $(CP) $(PKG_INSTALL_DIR)/usr/share/selinux/* $(1)/usr/share/selinux/ +endif endef +Package/refpolicy-modular/install = $(Package/refpolicy/install) + $(eval $(call BuildPackage,refpolicy)) +$(eval $(call BuildPackage,refpolicy-modular)) diff --git a/scripts/mkhash.c b/scripts/mkhash.c index 0f5815f242..ced4f3c34a 100644 --- a/scripts/mkhash.c +++ b/scripts/mkhash.c @@ -85,6 +85,7 @@ #include #include #include +#include #define ARRAY_SIZE(_n) (sizeof(_n) / sizeof((_n)[0])) @@ -736,7 +737,10 @@ static int usage(const char *progname) { int i; - fprintf(stderr, "Usage: %s [...]\n" + fprintf(stderr, "Usage: %s [options] [...]\n" + "Options:\n" + " -n Print filename(s)\n" + "\n" "Supported hash types:", progname); for (i = 0; i < ARRAY_SIZE(types); i++) @@ -767,6 +771,13 @@ static int hash_file(struct hash_type *t, const char *filename, bool add_filenam if (!filename || !strcmp(filename, "-")) { str = t->func(stdin); } else { + struct stat path_stat; + stat(filename, &path_stat); + if (S_ISDIR(path_stat.st_mode)) { + fprintf(stderr, "Failed to open '%s': Is a directory\n", filename); + return 1; + } + FILE *f = fopen(filename, "r"); if (!f) { @@ -820,8 +831,11 @@ int main(int argc, char **argv) if (argc < 2) return hash_file(t, NULL, add_filename); - for (i = 0; i < argc - 1; i++) - hash_file(t, argv[1 + i], add_filename); + for (i = 0; i < argc - 1; i++) { + int ret = hash_file(t, argv[1 + i], add_filename); + if (ret) + return ret; + } return 0; } diff --git a/target/imagebuilder/Makefile b/target/imagebuilder/Makefile index 1575f59b61..8b2f4e5af6 100644 --- a/target/imagebuilder/Makefile +++ b/target/imagebuilder/Makefile @@ -90,7 +90,7 @@ endif (cd $(PKG_BUILD_DIR); find staging_dir/host/bin/ $(IB_LDIR)/scripts/dtc/ -type f | \ $(XARGS) $(SCRIPT_DIR)/bundle-libraries.sh $(PKG_BUILD_DIR)/staging_dir/host) $(CP) $(TOPDIR)/staging_dir/host/lib/libfakeroot* $(PKG_BUILD_DIR)/staging_dir/host/lib - STRIP=sstrip $(SCRIPT_DIR)/rstrip.sh $(PKG_BUILD_DIR)/staging_dir/host/bin/ + STRIP=$(STAGING_DIR_HOST)/bin/sstrip $(SCRIPT_DIR)/rstrip.sh $(PKG_BUILD_DIR)/staging_dir/host/bin/ (cd $(BUILD_DIR); \ tar -I '$(STAGING_DIR_HOST)/bin/xz -7e -T$(if $(filter 1,$(NPROC)),2,0)' -cf $@ $(IB_NAME) \ --mtime="$(shell date --date=@$(SOURCE_DATE_EPOCH))"; \ diff --git a/target/linux/apm821xx/patches-5.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-5.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch index 937382fdf5..eb216aeb69 100644 --- a/target/linux/apm821xx/patches-5.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch +++ b/target/linux/apm821xx/patches-5.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch @@ -48,7 +48,7 @@ Signed-off-by: Vinod Koul #include "xhci.h" #include "xhci-trace.h" -@@ -60,6 +62,44 @@ +@@ -62,6 +64,44 @@ #define PCI_DEVICE_ID_ASMEDIA_1142_XHCI 0x1242 #define PCI_DEVICE_ID_ASMEDIA_2142_XHCI 0x2142 @@ -93,7 +93,7 @@ Signed-off-by: Vinod Koul static const char hcd_name[] = "xhci_hcd"; static struct hc_driver __read_mostly xhci_pci_hc_driver; -@@ -291,6 +331,873 @@ static void xhci_pme_acpi_rtd3_enable(st +@@ -296,6 +336,873 @@ static void xhci_pme_acpi_rtd3_enable(st static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { } #endif /* CONFIG_ACPI */ @@ -967,7 +967,7 @@ Signed-off-by: Vinod Koul /* called during probe() after chip reset completes */ static int xhci_pci_setup(struct usb_hcd *hcd) { -@@ -332,6 +1239,27 @@ static int xhci_pci_probe(struct pci_dev +@@ -337,6 +1244,27 @@ static int xhci_pci_probe(struct pci_dev struct hc_driver *driver; struct usb_hcd *hcd; @@ -995,7 +995,7 @@ Signed-off-by: Vinod Koul driver = (struct hc_driver *)id->driver_data; /* Prevent runtime suspending between USB-2 and USB-3 initialization */ -@@ -393,6 +1321,16 @@ static void xhci_pci_remove(struct pci_d +@@ -398,6 +1326,16 @@ static void xhci_pci_remove(struct pci_d { struct xhci_hcd *xhci; @@ -1012,7 +1012,7 @@ Signed-off-by: Vinod Koul xhci = hcd_to_xhci(pci_get_drvdata(dev)); xhci->xhc_state |= XHCI_STATE_REMOVING; -@@ -520,6 +1458,11 @@ static int xhci_pci_resume(struct usb_hc +@@ -537,6 +1475,11 @@ static int xhci_pci_resume(struct usb_hc if (pdev->vendor == PCI_VENDOR_ID_INTEL) usb_enable_intel_xhci_ports(pdev); diff --git a/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch index 02c9bcb2bf..be32823fee 100644 --- a/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch +++ b/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch @@ -13,7 +13,7 @@ produce a noisy warning. --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -278,6 +278,7 @@ static void xhci_pci_quirks(struct devic +@@ -283,6 +283,7 @@ static void xhci_pci_quirks(struct devic pdev->device == 0x0015) { xhci->quirks |= XHCI_RESET_ON_RESUME; xhci->quirks |= XHCI_ZERO_64B_REGS; @@ -43,7 +43,7 @@ produce a noisy warning. hcd->msi_enabled = 1; --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1880,6 +1880,7 @@ struct xhci_hcd { +@@ -1881,6 +1881,7 @@ struct xhci_hcd { struct xhci_hub usb2_rhub; struct xhci_hub usb3_rhub; /* support xHCI 1.0 spec USB2 hardware LPM */ diff --git a/target/linux/bcm27xx/patches-5.4/950-0214-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch b/target/linux/bcm27xx/patches-5.4/950-0214-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch index 7a1c2991f5..754a639853 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0214-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0214-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch @@ -10,7 +10,7 @@ Signed-off-by: Phil Elwell --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -247,6 +247,10 @@ static void xhci_pci_quirks(struct devic +@@ -252,6 +252,10 @@ static void xhci_pci_quirks(struct devic pdev->device == 0x3432) xhci->quirks |= XHCI_BROKEN_STREAMS; diff --git a/target/linux/bcm27xx/patches-5.4/950-0222-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch b/target/linux/bcm27xx/patches-5.4/950-0222-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch index 0bb08a56fa..5c241536dd 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0222-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0222-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch @@ -15,7 +15,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -1453,6 +1453,103 @@ command_cleanup: +@@ -1456,6 +1456,103 @@ command_cleanup: } /* @@ -119,7 +119,7 @@ Signed-off-by: Jonathan Bell * non-error returns are a promise to giveback() the urb later * we drop ownership so next owner (or urb unlink) can get it */ -@@ -5334,6 +5431,7 @@ static const struct hc_driver xhci_hc_dr +@@ -5337,6 +5434,7 @@ static const struct hc_driver xhci_hc_dr .endpoint_reset = xhci_endpoint_reset, .check_bandwidth = xhci_check_bandwidth, .reset_bandwidth = xhci_reset_bandwidth, diff --git a/target/linux/bcm27xx/patches-5.4/950-0267-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch b/target/linux/bcm27xx/patches-5.4/950-0267-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch index 83c86f6168..45a03fd81a 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0267-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0267-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch @@ -23,7 +23,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -248,8 +248,10 @@ static void xhci_pci_quirks(struct devic +@@ -253,8 +253,10 @@ static void xhci_pci_quirks(struct devic xhci->quirks |= XHCI_BROKEN_STREAMS; if (pdev->vendor == PCI_VENDOR_ID_VIA && @@ -85,6 +85,6 @@ Signed-off-by: Jonathan Bell #define XHCI_RESET_PLL_ON_DISCONNECT BIT_ULL(34) #define XHCI_SNPS_BROKEN_SUSPEND BIT_ULL(35) +#define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(36) + #define XHCI_DISABLE_SPARSE BIT_ULL(38) unsigned int num_active_eps; - unsigned int limit_active_eps; diff --git a/target/linux/bcm27xx/patches-5.4/950-0488-media-add-V4L2_CTRL_TYPE_AREA-control-type.patch b/target/linux/bcm27xx/patches-5.4/950-0488-media-add-V4L2_CTRL_TYPE_AREA-control-type.patch index 265533eb3a..d82c3196b8 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0488-media-add-V4L2_CTRL_TYPE_AREA-control-type.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0488-media-add-V4L2_CTRL_TYPE_AREA-control-type.patch @@ -135,7 +135,7 @@ Signed-off-by: Mauro Carvalho Chehab /* Internal helper functions that deal with control events. */ --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h -@@ -427,6 +427,11 @@ struct v4l2_fract { +@@ -426,6 +426,11 @@ struct v4l2_fract { __u32 denominator; }; @@ -147,7 +147,7 @@ Signed-off-by: Mauro Carvalho Chehab /** * struct v4l2_capability - Describes V4L2 device caps returned by VIDIOC_QUERYCAP * -@@ -1725,6 +1730,7 @@ enum v4l2_ctrl_type { +@@ -1724,6 +1729,7 @@ enum v4l2_ctrl_type { V4L2_CTRL_TYPE_U8 = 0x0100, V4L2_CTRL_TYPE_U16 = 0x0101, V4L2_CTRL_TYPE_U32 = 0x0102, diff --git a/target/linux/bcm27xx/patches-5.4/950-0492-media-vb2-add-V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF.patch b/target/linux/bcm27xx/patches-5.4/950-0492-media-vb2-add-V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF.patch index b114aefacc..b05c34ccbe 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0492-media-vb2-add-V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0492-media-vb2-add-V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF.patch @@ -155,7 +155,7 @@ Signed-off-by: Mauro Carvalho Chehab */ --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h -@@ -925,11 +925,12 @@ struct v4l2_requestbuffers { +@@ -924,11 +924,12 @@ struct v4l2_requestbuffers { }; /* capabilities for struct v4l2_requestbuffers and v4l2_create_buffers */ @@ -173,7 +173,7 @@ Signed-off-by: Mauro Carvalho Chehab /** * struct v4l2_plane - plane info for multi-planar buffers -@@ -1051,6 +1052,8 @@ static inline __u64 v4l2_timeval_to_ns(c +@@ -1050,6 +1051,8 @@ static inline __u64 v4l2_timeval_to_ns(c #define V4L2_BUF_FLAG_IN_REQUEST 0x00000080 /* timecode field is valid */ #define V4L2_BUF_FLAG_TIMECODE 0x00000100 diff --git a/target/linux/bcm27xx/patches-5.4/950-0494-media-videodev2.h-add-V4L2_DEC_CMD_FLUSH.patch b/target/linux/bcm27xx/patches-5.4/950-0494-media-videodev2.h-add-V4L2_DEC_CMD_FLUSH.patch index ef075fdb22..56fee1e029 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0494-media-videodev2.h-add-V4L2_DEC_CMD_FLUSH.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0494-media-videodev2.h-add-V4L2_DEC_CMD_FLUSH.patch @@ -47,7 +47,7 @@ Signed-off-by: Mauro Carvalho Chehab replace define V4L2_DEC_CMD_PAUSE_TO_BLACK decoder-cmds --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h -@@ -1989,6 +1989,7 @@ struct v4l2_encoder_cmd { +@@ -1988,6 +1988,7 @@ struct v4l2_encoder_cmd { #define V4L2_DEC_CMD_STOP (1) #define V4L2_DEC_CMD_PAUSE (2) #define V4L2_DEC_CMD_RESUME (3) diff --git a/target/linux/bcm27xx/patches-5.4/950-0505-media-videodev2.h-Add-a-format-for-column-YUV4-2-0-m.patch b/target/linux/bcm27xx/patches-5.4/950-0505-media-videodev2.h-Add-a-format-for-column-YUV4-2-0-m.patch index 840541cd2e..5a309827e2 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0505-media-videodev2.h-Add-a-format-for-column-YUV4-2-0-m.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0505-media-videodev2.h-Add-a-format-for-column-YUV4-2-0-m.patch @@ -289,7 +289,7 @@ Signed-off-by: Dave Stevenson case V4L2_PIX_FMT_YUV422M: descr = "Planar YUV 4:2:2 (N-C)"; break; --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h -@@ -737,6 +737,10 @@ struct v4l2_pix_format { +@@ -736,6 +736,10 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */ #define V4L2_PIX_FMT_SUNXI_TILED_NV12 v4l2_fourcc('S', 'T', '1', '2') /* Sunxi Tiled NV12 Format */ #define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit packed depth confidence information */ diff --git a/target/linux/bcm27xx/patches-5.4/950-0510-mmc-sdhci-Silence-MMC-warnings.patch b/target/linux/bcm27xx/patches-5.4/950-0510-mmc-sdhci-Silence-MMC-warnings.patch index 41fa6cb3d2..38349280bb 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0510-mmc-sdhci-Silence-MMC-warnings.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0510-mmc-sdhci-Silence-MMC-warnings.patch @@ -22,7 +22,7 @@ Signed-off-by: Maxime Ripard #define MAX_TUNING_LOOP 40 -@@ -2754,7 +2754,7 @@ static void sdhci_timeout_timer(struct t +@@ -2756,7 +2756,7 @@ static void sdhci_timeout_timer(struct t spin_lock_irqsave(&host->lock, flags); if (host->cmd && !sdhci_data_line_cmd(host->cmd)) { @@ -31,7 +31,7 @@ Signed-off-by: Maxime Ripard mmc_hostname(host->mmc)); sdhci_dumpregs(host); -@@ -2776,7 +2776,7 @@ static void sdhci_timeout_data_timer(str +@@ -2778,7 +2778,7 @@ static void sdhci_timeout_data_timer(str if (host->data || host->data_cmd || (host->cmd && sdhci_data_line_cmd(host->cmd))) { diff --git a/target/linux/bcm27xx/patches-5.4/950-0648-media-uapi-v4l2-core-Add-sensor-ancillary-data-V4L2-.patch b/target/linux/bcm27xx/patches-5.4/950-0648-media-uapi-v4l2-core-Add-sensor-ancillary-data-V4L2-.patch index de8f1d209a..69414e381c 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0648-media-uapi-v4l2-core-Add-sensor-ancillary-data-V4L2-.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0648-media-uapi-v4l2-core-Add-sensor-ancillary-data-V4L2-.patch @@ -75,7 +75,7 @@ Signed-off-by: Naushir Patuck /* Compressed formats */ --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h -@@ -769,6 +769,7 @@ struct v4l2_pix_format { +@@ -768,6 +768,7 @@ struct v4l2_pix_format { #define V4L2_META_FMT_VSP1_HGT v4l2_fourcc('V', 'S', 'P', 'T') /* R-Car VSP1 2-D Histogram */ #define V4L2_META_FMT_UVC v4l2_fourcc('U', 'V', 'C', 'H') /* UVC Payload Header metadata */ #define V4L2_META_FMT_D4XX v4l2_fourcc('D', '4', 'X', 'X') /* D4XX Payload Header metadata */ diff --git a/target/linux/bcm27xx/patches-5.4/950-0676-media-uapi-v4l2-core-Add-ISP-statistics-output-V4L2-.patch b/target/linux/bcm27xx/patches-5.4/950-0676-media-uapi-v4l2-core-Add-ISP-statistics-output-V4L2-.patch index 1af97e8351..082dff510c 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0676-media-uapi-v4l2-core-Add-ISP-statistics-output-V4L2-.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0676-media-uapi-v4l2-core-Add-ISP-statistics-output-V4L2-.patch @@ -84,7 +84,7 @@ Signed-off-by: Naushir Patuck /* Compressed formats */ --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h -@@ -770,6 +770,7 @@ struct v4l2_pix_format { +@@ -769,6 +769,7 @@ struct v4l2_pix_format { #define V4L2_META_FMT_UVC v4l2_fourcc('U', 'V', 'C', 'H') /* UVC Payload Header metadata */ #define V4L2_META_FMT_D4XX v4l2_fourcc('D', '4', 'X', 'X') /* D4XX Payload Header metadata */ #define V4L2_META_FMT_SENSOR_DATA v4l2_fourcc('S', 'E', 'N', 'S') /* Sensor Ancillary metadata */ diff --git a/target/linux/bcm53xx/patches-5.4/180-usb-xhci-add-support-for-performing-fake-doorbell.patch b/target/linux/bcm53xx/patches-5.4/180-usb-xhci-add-support-for-performing-fake-doorbell.patch index 4c4db76b01..b27cbcad9f 100644 --- a/target/linux/bcm53xx/patches-5.4/180-usb-xhci-add-support-for-performing-fake-doorbell.patch +++ b/target/linux/bcm53xx/patches-5.4/180-usb-xhci-add-support-for-performing-fake-doorbell.patch @@ -132,6 +132,6 @@ it on BCM4708 family. #define XHCI_RESET_PLL_ON_DISCONNECT BIT_ULL(34) #define XHCI_SNPS_BROKEN_SUSPEND BIT_ULL(35) +#define XHCI_FAKE_DOORBELL BIT_ULL(36) + #define XHCI_DISABLE_SPARSE BIT_ULL(38) unsigned int num_active_eps; - unsigned int limit_active_eps; diff --git a/target/linux/generic/hack-5.4/204-module_strip.patch b/target/linux/generic/hack-5.4/204-module_strip.patch index 0ed5f44697..f311b176f3 100644 --- a/target/linux/generic/hack-5.4/204-module_strip.patch +++ b/target/linux/generic/hack-5.4/204-module_strip.patch @@ -96,7 +96,7 @@ Signed-off-by: Felix Fietkau --- a/init/Kconfig +++ b/init/Kconfig -@@ -2195,6 +2195,13 @@ config TRIM_UNUSED_KSYMS +@@ -2196,6 +2196,13 @@ config TRIM_UNUSED_KSYMS If unsure, or if you need to build out-of-tree modules, say N. diff --git a/target/linux/generic/hack-5.4/703-add_vsc8504_support.patch b/target/linux/generic/hack-5.4/703-add_vsc8504_support.patch index e7265eba86..afb6ca6cf3 100644 --- a/target/linux/generic/hack-5.4/703-add_vsc8504_support.patch +++ b/target/linux/generic/hack-5.4/703-add_vsc8504_support.patch @@ -23,7 +23,7 @@ Signed-off-by: Roman Kuzmitskii #define PHY_ID_VSC8572 0x000704d0 #define PHY_ID_VSC8601 0x00070420 #define PHY_ID_VSC7385 0x00070450 -@@ -292,6 +293,7 @@ +@@ -292,6 +293,7 @@ static int vsc82xx_config_intr(struct ph err = phy_write(phydev, MII_VSC8244_IMASK, (phydev->drv->phy_id == PHY_ID_VSC8234 || phydev->drv->phy_id == PHY_ID_VSC8244 || @@ -31,7 +31,7 @@ Signed-off-by: Roman Kuzmitskii phydev->drv->phy_id == PHY_ID_VSC8572 || phydev->drv->phy_id == PHY_ID_VSC8601) ? MII_VSC8244_IMASK_MASK : -@@ -402,6 +404,15 @@ +@@ -402,6 +404,15 @@ static struct phy_driver vsc82xx_driver[ .ack_interrupt = &vsc824x_ack_interrupt, .config_intr = &vsc82xx_config_intr, }, { @@ -47,7 +47,7 @@ Signed-off-by: Roman Kuzmitskii .phy_id = PHY_ID_VSC8572, .name = "Vitesse VSC8572", .phy_id_mask = 0x000ffff0, -@@ -488,6 +499,7 @@ +@@ -488,6 +499,7 @@ module_phy_driver(vsc82xx_driver); static struct mdio_device_id __maybe_unused vitesse_tbl[] = { { PHY_ID_VSC8234, 0x000ffff0 }, { PHY_ID_VSC8244, 0x000fffc0 }, diff --git a/target/linux/generic/pending-5.4/203-kallsyms_uncompressed.patch b/target/linux/generic/pending-5.4/203-kallsyms_uncompressed.patch index c4c13b9695..1f0c017680 100644 --- a/target/linux/generic/pending-5.4/203-kallsyms_uncompressed.patch +++ b/target/linux/generic/pending-5.4/203-kallsyms_uncompressed.patch @@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau --- a/init/Kconfig +++ b/init/Kconfig -@@ -1277,6 +1277,17 @@ config SYSCTL_ARCH_UNALIGN_ALLOW +@@ -1278,6 +1278,17 @@ config SYSCTL_ARCH_UNALIGN_ALLOW the unaligned access emulation. see arch/parisc/kernel/unaligned.c for reference diff --git a/target/linux/generic/pending-5.4/342-powerpc-Enable-kernel-XZ-compression-option-on-PPC_8.patch b/target/linux/generic/pending-5.4/342-powerpc-Enable-kernel-XZ-compression-option-on-PPC_8.patch index 26b8a8ce17..8d4c74219f 100644 --- a/target/linux/generic/pending-5.4/342-powerpc-Enable-kernel-XZ-compression-option-on-PPC_8.patch +++ b/target/linux/generic/pending-5.4/342-powerpc-Enable-kernel-XZ-compression-option-on-PPC_8.patch @@ -14,7 +14,7 @@ Signed-off-by: Pawel Dembicki --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig -@@ -204,7 +204,7 @@ config PPC +@@ -205,7 +205,7 @@ config PPC select HAVE_KERNEL_GZIP select HAVE_KERNEL_LZMA if DEFAULT_UIMAGE select HAVE_KERNEL_LZO if DEFAULT_UIMAGE diff --git a/target/linux/generic/pending-5.4/920-mangle_bootargs.patch b/target/linux/generic/pending-5.4/920-mangle_bootargs.patch index 7523b396ba..45eabbd10a 100644 --- a/target/linux/generic/pending-5.4/920-mangle_bootargs.patch +++ b/target/linux/generic/pending-5.4/920-mangle_bootargs.patch @@ -13,7 +13,7 @@ Signed-off-by: Imre Kaloz --- a/init/Kconfig +++ b/init/Kconfig -@@ -1662,6 +1662,15 @@ config EMBEDDED +@@ -1663,6 +1663,15 @@ config EMBEDDED an embedded system so certain expert options are available for configuration. diff --git a/target/linux/ipq806x/patches-5.4/0067-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/ipq806x/patches-5.4/0067-generic-Mangle-bootloader-s-kernel-arguments.patch index 0ca2c5f806..751ac10a19 100644 --- a/target/linux/ipq806x/patches-5.4/0067-generic-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/ipq806x/patches-5.4/0067-generic-Mangle-bootloader-s-kernel-arguments.patch @@ -22,7 +22,7 @@ Signed-off-by: Adrian Panella --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -1825,6 +1825,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN +@@ -1827,6 +1827,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN The command-line arguments provided by the boot loader will be appended to the the device tree bootargs property. diff --git a/target/linux/layerscape/patches-5.4/701-net-0147-bus-fsl-mc-Allocate-mc-portal-from-root-dprc-contain.patch b/target/linux/layerscape/patches-5.4/701-net-0147-bus-fsl-mc-Allocate-mc-portal-from-root-dprc-contain.patch index 655c4780d2..8fd2bb2738 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0147-bus-fsl-mc-Allocate-mc-portal-from-root-dprc-contain.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0147-bus-fsl-mc-Allocate-mc-portal-from-root-dprc-contain.patch @@ -22,7 +22,7 @@ Signed-off-by: Bharat Bhushan --- a/drivers/bus/fsl-mc/mc-io.c +++ b/drivers/bus/fsl-mc/mc-io.c -@@ -169,14 +169,16 @@ int __must_check fsl_mc_portal_allocate( +@@ -174,14 +174,16 @@ int __must_check fsl_mc_portal_allocate( int error = -EINVAL; struct fsl_mc_resource *resource = NULL; struct fsl_mc_io *mc_io = NULL; diff --git a/target/linux/layerscape/patches-5.4/802-can-0025-can-flexcan-add-LPSR-mode-support-for-i.MX7D.patch b/target/linux/layerscape/patches-5.4/802-can-0025-can-flexcan-add-LPSR-mode-support-for-i.MX7D.patch index 96c25e5cd9..806a020303 100644 --- a/target/linux/layerscape/patches-5.4/802-can-0025-can-flexcan-add-LPSR-mode-support-for-i.MX7D.patch +++ b/target/linux/layerscape/patches-5.4/802-can-0025-can-flexcan-add-LPSR-mode-support-for-i.MX7D.patch @@ -28,57 +28,21 @@ Signed-off-by: Joakim Zhang #include #define DRV_NAME "flexcan" -@@ -1942,7 +1943,7 @@ static int __maybe_unused flexcan_suspen - { - struct net_device *dev = dev_get_drvdata(device); - struct flexcan_priv *priv = netdev_priv(dev); -- int err = 0; -+ int err; - - if (netif_running(dev)) { - /* if wakeup is enabled, enter stop mode -@@ -1954,25 +1955,27 @@ static int __maybe_unused flexcan_suspen +@@ -1954,9 +1955,7 @@ static int __maybe_unused flexcan_suspen if (err) return err; } else { - err = flexcan_chip_disable(priv); +- if (err) +- return err; + flexcan_chip_stop(dev); -+ -+ err = pm_runtime_force_suspend(device); - if (err) - return err; - -- err = pm_runtime_force_suspend(device); -+ pinctrl_pm_select_sleep_state(device); } netif_stop_queue(dev); netif_device_detach(dev); - } - priv->can.state = CAN_STATE_SLEEPING; - -- return err; -+ return 0; - } - - static int __maybe_unused flexcan_resume(struct device *device) - { - struct net_device *dev = dev_get_drvdata(device); - struct flexcan_priv *priv = netdev_priv(dev); -- int err = 0; -+ int err; - - priv->can.state = CAN_STATE_ERROR_ACTIVE; - if (netif_running(dev)) { -@@ -1984,15 +1987,19 @@ static int __maybe_unused flexcan_resume +@@ -1982,7 +1981,9 @@ static int __maybe_unused flexcan_resume if (err) return err; } else { -+ pinctrl_pm_select_default_state(device); -+ - err = pm_runtime_force_resume(device); - if (err) - return err; - - err = flexcan_chip_enable(priv); + err = flexcan_chip_start(dev); + if (err) @@ -86,8 +50,3 @@ Signed-off-by: Joakim Zhang } } -- return err; -+ return 0; - } - - static int __maybe_unused flexcan_runtime_suspend(struct device *device) diff --git a/target/linux/layerscape/patches-5.4/808-i2c-0002-MLK-10893-i2c-imx-add-irqf_no_suspend.patch b/target/linux/layerscape/patches-5.4/808-i2c-0002-MLK-10893-i2c-imx-add-irqf_no_suspend.patch index 08f44e795e..48432e1ec1 100644 --- a/target/linux/layerscape/patches-5.4/808-i2c-0002-MLK-10893-i2c-imx-add-irqf_no_suspend.patch +++ b/target/linux/layerscape/patches-5.4/808-i2c-0002-MLK-10893-i2c-imx-add-irqf_no_suspend.patch @@ -17,13 +17,13 @@ Signed-off-by: Vipul Kumar --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c -@@ -1113,7 +1113,8 @@ static int i2c_imx_probe(struct platform - } +@@ -1131,7 +1131,8 @@ static int i2c_imx_probe(struct platform + goto rpm_disable; /* Request IRQ */ -- ret = devm_request_irq(&pdev->dev, irq, i2c_imx_isr, IRQF_SHARED, -+ ret = devm_request_irq(&pdev->dev, irq, i2c_imx_isr, -+ IRQF_SHARED | IRQF_NO_SUSPEND, - pdev->name, i2c_imx); +- ret = request_threaded_irq(irq, i2c_imx_isr, NULL, IRQF_SHARED, ++ ret = request_threaded_irq(irq, i2c_imx_isr, NULL, ++ IRQF_SHARED | IRQF_NO_SUSPEND, + pdev->name, i2c_imx); if (ret) { dev_err(&pdev->dev, "can't claim irq %d\n", irq); diff --git a/target/linux/layerscape/patches-5.4/808-i2c-0003-MLK-11403-I2C-imx-restore-pin-setting-for-i2c.patch b/target/linux/layerscape/patches-5.4/808-i2c-0003-MLK-11403-I2C-imx-restore-pin-setting-for-i2c.patch index 0c7c644330..a017e09930 100644 --- a/target/linux/layerscape/patches-5.4/808-i2c-0003-MLK-11403-I2C-imx-restore-pin-setting-for-i2c.patch +++ b/target/linux/layerscape/patches-5.4/808-i2c-0003-MLK-11403-I2C-imx-restore-pin-setting-for-i2c.patch @@ -15,7 +15,7 @@ Signed-off-by: Vipul Kumar --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c -@@ -1227,7 +1227,8 @@ static int __maybe_unused i2c_imx_runtim +@@ -1229,7 +1229,8 @@ static int __maybe_unused i2c_imx_runtim { struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev); @@ -25,7 +25,7 @@ Signed-off-by: Vipul Kumar return 0; } -@@ -1237,14 +1238,28 @@ static int __maybe_unused i2c_imx_runtim +@@ -1239,14 +1240,28 @@ static int __maybe_unused i2c_imx_runtim struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev); int ret; diff --git a/target/linux/layerscape/patches-5.4/808-i2c-0004-MLK-16203-enable-runtime-pm-of-i2c-temporary-when-do.patch b/target/linux/layerscape/patches-5.4/808-i2c-0004-MLK-16203-enable-runtime-pm-of-i2c-temporary-when-do.patch index 3157750f3f..16ac77c6f0 100644 --- a/target/linux/layerscape/patches-5.4/808-i2c-0004-MLK-16203-enable-runtime-pm-of-i2c-temporary-when-do.patch +++ b/target/linux/layerscape/patches-5.4/808-i2c-0004-MLK-16203-enable-runtime-pm-of-i2c-temporary-when-do.patch @@ -47,7 +47,7 @@ Signed-off-by: Vipul Kumar dev_dbg(&i2c_imx->adapter.dev, "<%s> exit with: %s: %d\n", __func__, (result < 0) ? "error" : "success msg", (result < 0) ? result : num); -@@ -1259,7 +1269,7 @@ static int i2c_imx_resume(struct device +@@ -1261,7 +1271,7 @@ static int i2c_imx_resume(struct device } static const struct dev_pm_ops i2c_imx_pm_ops = { diff --git a/target/linux/layerscape/patches-5.4/808-i2c-0016-LF-162-i2c-imx-Defer-probing-if-EDMA-not-available.patch b/target/linux/layerscape/patches-5.4/808-i2c-0016-LF-162-i2c-imx-Defer-probing-if-EDMA-not-available.patch index ce19d0b98b..53440f896b 100644 --- a/target/linux/layerscape/patches-5.4/808-i2c-0016-LF-162-i2c-imx-Defer-probing-if-EDMA-not-available.patch +++ b/target/linux/layerscape/patches-5.4/808-i2c-0016-LF-162-i2c-imx-Defer-probing-if-EDMA-not-available.patch @@ -67,4 +67,4 @@ Signed-off-by: Peng Ma + i2c_del_adapter(&i2c_imx->adapter); clk_notifier_unregister: clk_notifier_unregister(i2c_imx->clk, &i2c_imx->clk_change_nb); - rpm_disable: + free_irq(irq, i2c_imx); diff --git a/target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch b/target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch index 1d2e9386c9..4a16dbd505 100644 --- a/target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch +++ b/target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch @@ -68,7 +68,7 @@ Acked-by: Adrian Hunter *window_start = 8 * esdhc->div_ratio; *window_end = 4 * esdhc->div_ratio; } else { -@@ -1050,6 +1050,19 @@ static int esdhc_execute_tuning(struct m +@@ -1061,6 +1061,19 @@ static int esdhc_execute_tuning(struct m if (ret) break; diff --git a/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch b/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch index 2a224d1171..8a8486b36f 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch @@ -36,7 +36,7 @@ Signed-off-by: Peter Chen dwc->sysdev_is_parent = device_property_read_bool(dev, --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h -@@ -953,6 +953,7 @@ struct dwc3_scratchpad_array { +@@ -954,6 +954,7 @@ struct dwc3_scratchpad_array { * @nr_scratch: number of scratch buffers * @u1u2: only used on revisions <1.83a for workaround * @maximum_speed: maximum speed requested (mainly for testing purposes) @@ -44,7 +44,7 @@ Signed-off-by: Peter Chen * @revision: revision register contents * @version_type: VERSIONTYPE register contents, a sub release of a revision * @dr_mode: requested mode of operation -@@ -1109,6 +1110,7 @@ struct dwc3 { +@@ -1110,6 +1111,7 @@ struct dwc3 { u32 nr_scratch; u32 u1u2; u32 maximum_speed; @@ -54,7 +54,7 @@ Signed-off-by: Peter Chen * All 3.1 IP version constants are greater than the 3.0 IP --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c -@@ -3495,6 +3495,10 @@ int dwc3_gadget_init(struct dwc3 *dwc) +@@ -3525,6 +3525,10 @@ int dwc3_gadget_init(struct dwc3 *dwc) dwc->gadget.sg_supported = true; dwc->gadget.name = "dwc3-gadget"; dwc->gadget.lpm_capable = true; diff --git a/target/linux/layerscape/patches-5.4/820-usb-0006-usb-dwc3-drd-add-usb-role-switch-class-support-for-d.patch b/target/linux/layerscape/patches-5.4/820-usb-0006-usb-dwc3-drd-add-usb-role-switch-class-support-for-d.patch index 95785792ac..b8f0c6a2cc 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0006-usb-dwc3-drd-add-usb-role-switch-class-support-for-d.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0006-usb-dwc3-drd-add-usb-role-switch-class-support-for-d.patch @@ -23,7 +23,7 @@ Signed-off-by: Li Jun #include #include -@@ -1094,6 +1095,7 @@ struct dwc3 { +@@ -1095,6 +1096,7 @@ struct dwc3 { void __iomem *regs; size_t regs_size; diff --git a/target/linux/layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch b/target/linux/layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch index 8cb1779fb4..a8d23623be 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch @@ -44,7 +44,7 @@ Reviewed-by: Peter Chen --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h -@@ -1046,6 +1046,8 @@ struct dwc3_scratchpad_array { +@@ -1047,6 +1047,8 @@ struct dwc3_scratchpad_array { * 3 - Reserved * @dis_metastability_quirk: set to disable metastability quirk. * @dis_split_quirk: set to disable split boundary. @@ -53,7 +53,7 @@ Reviewed-by: Peter Chen * @imod_interval: set the interrupt moderation interval in 250ns * increments or 0 to disable. */ -@@ -1241,6 +1243,8 @@ struct dwc3 { +@@ -1242,6 +1244,8 @@ struct dwc3 { unsigned dis_split_quirk:1; diff --git a/target/linux/layerscape/patches-5.4/820-usb-0011-usb-dwc3-Add-cache-type-configuration-support.patch b/target/linux/layerscape/patches-5.4/820-usb-0011-usb-dwc3-Add-cache-type-configuration-support.patch index c40af8c5c7..3357acc76d 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0011-usb-dwc3-Add-cache-type-configuration-support.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0011-usb-dwc3-Add-cache-type-configuration-support.patch @@ -109,7 +109,7 @@ Reviewed-by: Jun Li usb_phy_set_suspend(dwc->usb2_phy, 0); usb_phy_set_suspend(dwc->usb3_phy, 0); ret = phy_power_on(dwc->usb2_generic_phy); -@@ -1920,12 +1972,9 @@ static const struct dev_pm_ops dwc3_dev_ +@@ -1931,12 +1983,9 @@ static const struct dev_pm_ops dwc3_dev_ #ifdef CONFIG_OF static const struct of_device_id of_dwc3_match[] = { diff --git a/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch b/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch index 43d3d7d9e5..d57fb7c01f 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch @@ -174,7 +174,7 @@ Signed-off-by: Peter Chen * bursts that are required to move all packets in this TD. Only SuperSpeed --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -5361,6 +5361,7 @@ static const struct hc_driver xhci_hc_dr +@@ -5364,6 +5364,7 @@ static const struct hc_driver xhci_hc_dr .disable_usb3_lpm_timeout = xhci_disable_usb3_lpm_timeout, .find_raw_port_number = xhci_find_raw_port_number, .clear_tt_buffer_complete = xhci_clear_tt_buffer_complete, @@ -184,7 +184,7 @@ Signed-off-by: Peter Chen void xhci_init_driver(struct hc_driver *drv, --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -2143,6 +2143,16 @@ int xhci_find_raw_port_number(struct usb +@@ -2144,6 +2144,16 @@ int xhci_find_raw_port_number(struct usb struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd); void xhci_hc_died(struct xhci_hcd *xhci); diff --git a/target/linux/layerscape/patches-5.4/820-usb-0016-MLK-16735-usb-host-add-XHCI_CDNS_HOST-flag.patch b/target/linux/layerscape/patches-5.4/820-usb-0016-MLK-16735-usb-host-add-XHCI_CDNS_HOST-flag.patch index 23e5094707..a934f289d8 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0016-MLK-16735-usb-host-add-XHCI_CDNS_HOST-flag.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0016-MLK-16735-usb-host-add-XHCI_CDNS_HOST-flag.patch @@ -37,6 +37,6 @@ Signed-off-by: Peter Chen #define XHCI_RESET_PLL_ON_DISCONNECT BIT_ULL(34) #define XHCI_SNPS_BROKEN_SUSPEND BIT_ULL(35) +#define XHCI_CDNS_HOST BIT_ULL(36) + #define XHCI_DISABLE_SPARSE BIT_ULL(38) unsigned int num_active_eps; - unsigned int limit_active_eps; diff --git a/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch b/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch index 57818b1136..c74b2460b4 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch @@ -24,7 +24,7 @@ Signed-off-by: Peter Chen --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -5378,6 +5378,8 @@ void xhci_init_driver(struct hc_driver * +@@ -5381,6 +5381,8 @@ void xhci_init_driver(struct hc_driver * drv->reset = over->reset; if (over->start) drv->start = over->start; @@ -35,7 +35,7 @@ Signed-off-by: Peter Chen EXPORT_SYMBOL_GPL(xhci_init_driver); --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1911,6 +1911,7 @@ struct xhci_driver_overrides { +@@ -1912,6 +1912,7 @@ struct xhci_driver_overrides { size_t extra_priv_size; int (*reset)(struct usb_hcd *hcd); int (*start)(struct usb_hcd *hcd); diff --git a/target/linux/layerscape/patches-5.4/820-usb-0024-LF-387-1-Revert-usb-dwc3-Add-cache-type-configuratio.patch b/target/linux/layerscape/patches-5.4/820-usb-0024-LF-387-1-Revert-usb-dwc3-Add-cache-type-configuratio.patch index 8b31ae897e..4bc9f4d465 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0024-LF-387-1-Revert-usb-dwc3-Add-cache-type-configuratio.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0024-LF-387-1-Revert-usb-dwc3-Add-cache-type-configuratio.patch @@ -81,7 +81,7 @@ Signed-off-by: Ran Wang usb_phy_set_suspend(dwc->usb2_phy, 0); usb_phy_set_suspend(dwc->usb3_phy, 0); ret = phy_power_on(dwc->usb2_generic_phy); -@@ -1972,9 +1920,12 @@ static const struct dev_pm_ops dwc3_dev_ +@@ -1983,9 +1931,12 @@ static const struct dev_pm_ops dwc3_dev_ #ifdef CONFIG_OF static const struct of_device_id of_dwc3_match[] = { diff --git a/target/linux/layerscape/patches-5.4/820-usb-0025-LF-387-4-usb-dwc3-Add-cache-type-configuration-suppo.patch b/target/linux/layerscape/patches-5.4/820-usb-0025-LF-387-4-usb-dwc3-Add-cache-type-configuration-suppo.patch index 8fde037eaa..9c5818c268 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0025-LF-387-4-usb-dwc3-Add-cache-type-configuration-suppo.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0025-LF-387-4-usb-dwc3-Add-cache-type-configuration-suppo.patch @@ -108,7 +108,7 @@ Reviewed-by: Jun Li usb_phy_set_suspend(dwc->usb2_phy, 0); usb_phy_set_suspend(dwc->usb3_phy, 0); ret = phy_power_on(dwc->usb2_generic_phy); -@@ -1920,12 +1971,16 @@ static const struct dev_pm_ops dwc3_dev_ +@@ -1931,12 +1982,16 @@ static const struct dev_pm_ops dwc3_dev_ #ifdef CONFIG_OF static const struct of_device_id of_dwc3_match[] = { diff --git a/target/linux/mediatek/patches-5.4/0700-arm-dts-mt7623-add-missing-pause-for-switchport.patch b/target/linux/mediatek/patches-5.4/0700-arm-dts-mt7623-add-missing-pause-for-switchport.patch deleted file mode 100644 index 94d5bbfb0d..0000000000 --- a/target/linux/mediatek/patches-5.4/0700-arm-dts-mt7623-add-missing-pause-for-switchport.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Frank Wunderlich -Date: Mon, 7 Sep 2020 09:05:17 +0200 - -port6 of mt7530 switch (= cpu port 0) on bananapi-r2 misses pause option -which causes rx drops on running iperf. - -Cc: stable@vger.kernel.org -Fixes: f4ff257cd160 ("arm: dts: mt7623: add support for Bananapi R2 (BPI-R2) board") -Signed-off-by: Frank Wunderlich ---- - arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts | 1 + - 1 file changed, 1 insertion(+) - ---- a/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts -+++ b/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts -@@ -193,6 +193,7 @@ - fixed-link { - speed = <1000>; - full-duplex; -+ pause; - }; - }; - }; diff --git a/target/linux/mpc85xx/patches-5.4/102-powerpc-add-cmdline-override.patch b/target/linux/mpc85xx/patches-5.4/102-powerpc-add-cmdline-override.patch index 19bbf9f2f4..924ce9307e 100644 --- a/target/linux/mpc85xx/patches-5.4/102-powerpc-add-cmdline-override.patch +++ b/target/linux/mpc85xx/patches-5.4/102-powerpc-add-cmdline-override.patch @@ -1,6 +1,6 @@ --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig -@@ -884,6 +884,14 @@ config CMDLINE_FORCE +@@ -885,6 +885,14 @@ config CMDLINE_FORCE This is useful if you cannot or don't want to change the command-line options your boot loader passes to the kernel. diff --git a/target/linux/mvebu/patches-5.4/006-mvebu-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/mvebu/patches-5.4/006-mvebu-Mangle-bootloader-s-kernel-arguments.patch index ed92476302..fd60cdb322 100644 --- a/target/linux/mvebu/patches-5.4/006-mvebu-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/mvebu/patches-5.4/006-mvebu-Mangle-bootloader-s-kernel-arguments.patch @@ -28,7 +28,7 @@ Signed-off-by: Michael Gray --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -1825,6 +1825,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN +@@ -1827,6 +1827,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN The command-line arguments provided by the boot loader will be appended to the the device tree bootargs property. diff --git a/target/linux/octeon/patches-5.4/110-er200-ethernet_probe_order.patch b/target/linux/octeon/patches-5.4/110-er200-ethernet_probe_order.patch index c1b6f73a30..7afa292757 100644 --- a/target/linux/octeon/patches-5.4/110-er200-ethernet_probe_order.patch +++ b/target/linux/octeon/patches-5.4/110-er200-ethernet_probe_order.patch @@ -1,6 +1,6 @@ --- a/drivers/staging/octeon/ethernet.c +++ b/drivers/staging/octeon/ethernet.c -@@ -682,6 +682,7 @@ static int cvm_oct_probe(struct platform +@@ -683,6 +683,7 @@ static int cvm_oct_probe(struct platform int interface; int fau = FAU_NUM_PACKET_BUFFERS_TO_FREE; int qos; @@ -8,7 +8,7 @@ struct device_node *pip; int mtu_overhead = ETH_HLEN + ETH_FCS_LEN; -@@ -805,13 +806,19 @@ static int cvm_oct_probe(struct platform +@@ -806,13 +807,19 @@ static int cvm_oct_probe(struct platform } num_interfaces = cvmx_helper_get_number_of_interfaces(); diff --git a/target/linux/octeon/patches-5.4/140-octeon_e300_support.patch b/target/linux/octeon/patches-5.4/140-octeon_e300_support.patch index 36b5d6abb5..7fe56a47d1 100644 --- a/target/linux/octeon/patches-5.4/140-octeon_e300_support.patch +++ b/target/linux/octeon/patches-5.4/140-octeon_e300_support.patch @@ -1,16 +1,16 @@ --- a/arch/mips/include/asm/octeon/cvmx-bootinfo.h +++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h -@@ -296,6 +296,7 @@ - CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001, - CVMX_BOARD_TYPE_UBNT_E100 = 20002, +@@ -298,6 +298,7 @@ enum cvmx_board_types_enum { + CVMX_BOARD_TYPE_UBNT_E200 = 20003, + CVMX_BOARD_TYPE_UBNT_E220 = 20005, CVMX_BOARD_TYPE_ITUS_SHIELD = 20006, + CVMX_BOARD_TYPE_UBNT_E300 = 20300, CVMX_BOARD_TYPE_KONTRON_S1901 = 21901, CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000, -@@ -397,6 +398,7 @@ - ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN) - ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E100) +@@ -401,6 +402,7 @@ static inline const char *cvmx_board_typ + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E200) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E220) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_ITUS_SHIELD) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E300) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_KONTRON_S1901) diff --git a/target/linux/octeon/patches-5.4/700-allocate_interface_by_label.patch b/target/linux/octeon/patches-5.4/700-allocate_interface_by_label.patch index 0aef899a96..3a9b2eb7cd 100644 --- a/target/linux/octeon/patches-5.4/700-allocate_interface_by_label.patch +++ b/target/linux/octeon/patches-5.4/700-allocate_interface_by_label.patch @@ -12,7 +12,7 @@ Tested-by: Johannes Kimmel Signed-off-by: Roman Kuzmitskii --- a/drivers/staging/octeon/ethernet.c +++ b/drivers/staging/octeon/ethernet.c -@@ -407,9 +407,12 @@ +@@ -408,9 +408,12 @@ int cvm_oct_common_init(struct net_devic { struct octeon_ethernet *priv = netdev_priv(dev); const u8 *mac = NULL; @@ -26,7 +26,7 @@ Signed-off-by: Roman Kuzmitskii if (!IS_ERR_OR_NULL(mac)) ether_addr_copy(dev->dev_addr, mac); -@@ -444,6 +447,9 @@ +@@ -445,6 +448,9 @@ int cvm_oct_common_init(struct net_devic if (dev->netdev_ops->ndo_stop) dev->netdev_ops->ndo_stop(dev); diff --git a/target/linux/octeon/patches-5.4/701-honor_sgmii_node_device_tree_status.patch b/target/linux/octeon/patches-5.4/701-honor_sgmii_node_device_tree_status.patch index af223dc314..9fb0c2f0a3 100644 --- a/target/linux/octeon/patches-5.4/701-honor_sgmii_node_device_tree_status.patch +++ b/target/linux/octeon/patches-5.4/701-honor_sgmii_node_device_tree_status.patch @@ -12,7 +12,7 @@ Tested-by: Johannes Kimmel Signed-off-by: Roman Kuzmitskii --- a/drivers/staging/octeon/ethernet.c +++ b/drivers/staging/octeon/ethernet.c -@@ -884,8 +884,10 @@ +@@ -885,8 +885,10 @@ static int cvm_oct_probe(struct platform case CVMX_HELPER_INTERFACE_MODE_SGMII: priv->phy_mode = PHY_INTERFACE_MODE_SGMII; diff --git a/target/linux/oxnas/patches-5.4/996-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/oxnas/patches-5.4/996-generic-Mangle-bootloader-s-kernel-arguments.patch index 699d131c9f..8c83d55b6c 100644 --- a/target/linux/oxnas/patches-5.4/996-generic-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/oxnas/patches-5.4/996-generic-Mangle-bootloader-s-kernel-arguments.patch @@ -22,7 +22,7 @@ Signed-off-by: Adrian Panella --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -1825,6 +1825,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN +@@ -1827,6 +1827,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN The command-line arguments provided by the boot loader will be appended to the the device tree bootargs property. diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts new file mode 100644 index 0000000000..323a790600 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_dlink_dir-xx60-a1.dtsi" + +/ { + compatible = "dlink,dir-2640-a1", "mediatek,mt7621-soc"; + model = "D-Link DIR-2640 A1"; +}; + +&leds { + usb2_white { + label = "white:usb2"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + trigger-sources = <&ehci_port2>; + linux,default-trigger = "usbport"; + }; + + usb3_white { + label = "white:usb3"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + trigger-sources = <&xhci_ehci_port1>; + linux,default-trigger = "usbport"; + }; +}; + +&wifi0 { + mtd-mac-address = <&factory 0xe000>; + mtd-mac-address-increment = <1>; +}; + +&wifi1 { + mtd-mac-address = <&factory 0xe000>; + mtd-mac-address-increment = <2>; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 237b1d8c81..d15af01588 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -274,6 +274,13 @@ define Device/dlink_dir-1960-a1 endef TARGET_DEVICES += dlink_dir-1960-a1 +define Device/dlink_dir-2640-a1 + $(Device/dlink_dir-xx60-a1) + DEVICE_MODEL := DIR-2640 + DEVICE_VARIANT := A1 +endef +TARGET_DEVICES += dlink_dir-2640-a1 + define Device/dlink_dir-2660-a1 $(Device/dlink_dir-xx60-a1) DEVICE_MODEL := DIR-2660 diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index a492132c79..3dd2a218b9 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -19,6 +19,7 @@ xzwifi,creativebox-v1) ucidef_set_led_netdev "internet" "internet" "blue:internet" "wan" ;; dlink,dir-1960-a1|\ +dlink,dir-2640-a1|\ dlink,dir-2660-a1) ucidef_set_led_netdev "wan" "wan" "white:net" "wan" ;; diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index 442e78df3c..b4d07f8146 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -46,6 +46,7 @@ platform_do_upgrade() { asus,rt-ac65p|\ asus,rt-ac85p|\ dlink,dir-1960-a1|\ + dlink,dir-2640-a1|\ dlink,dir-2660-a1|\ hiwifi,hc5962|\ linksys,ea7300-v1|\ diff --git a/target/linux/rtl838x/Makefile b/target/linux/rtl838x/Makefile index 83cb074b89..a4e203718d 100644 --- a/target/linux/rtl838x/Makefile +++ b/target/linux/rtl838x/Makefile @@ -21,6 +21,7 @@ include $(INCLUDE_DIR)/target.mk FEATURES := $(filter-out mips16,$(FEATURES)) -DEFAULT_PACKAGES += swconfig uboot-envtools ethtool kmod-gpio-button-hotplug +DEFAULT_PACKAGES += uboot-envtools ethtool kmod-gpio-button-hotplug \ + dnsmasq firewall ip6tables iptables odhcp6c odhcpd-ipv6only $(eval $(call BuildTarget)) diff --git a/target/linux/rtl838x/dts/rtl8382_allnet_all-sg8208m.dts b/target/linux/rtl838x/dts/rtl8382_allnet_all-sg8208m.dts index 5433b7f372..a5dd3be0a4 100644 --- a/target/linux/rtl838x/dts/rtl8382_allnet_all-sg8208m.dts +++ b/target/linux/rtl838x/dts/rtl8382_allnet_all-sg8208m.dts @@ -103,46 +103,14 @@ #address-cells = <1>; #size-cells = <0>; - /* Internal phy */ - phy8: ethernet-phy@8 { - reg = <8>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy9: ethernet-phy@9 { - reg = <9>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy10: ethernet-phy@10 { - reg = <10>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy11: ethernet-phy@11 { - reg = <11>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy12: ethernet-phy@12 { - reg = <12>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy13: ethernet-phy@13 { - reg = <13>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy14: ethernet-phy@14 { - reg = <14>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy15: ethernet-phy@15 { - reg = <15>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; + INTERNAL_PHY(8) + INTERNAL_PHY(9) + INTERNAL_PHY(10) + INTERNAL_PHY(11) + INTERNAL_PHY(12) + INTERNAL_PHY(13) + INTERNAL_PHY(14) + INTERNAL_PHY(15) }; }; @@ -151,61 +119,14 @@ #address-cells = <1>; #size-cells = <0>; - port@0 { - reg = <8>; - label = "lan1"; - phy-handle = <&phy8>; - phy-mode = "internal"; - }; - - port@1 { - reg = <9>; - label = "lan2"; - phy-handle = <&phy9>; - phy-mode = "internal"; - }; - - port@2 { - reg = <10>; - label = "lan3"; - phy-handle = <&phy10>; - phy-mode = "internal"; - }; - - port@3 { - reg = <11>; - label = "lan4"; - phy-handle = <&phy11>; - phy-mode = "internal"; - }; - - port@4 { - reg = <12>; - label = "lan5"; - phy-handle = <&phy12>; - phy-mode = "internal"; - }; - - port@5 { - reg = <13>; - label = "lan6"; - phy-handle = <&phy13>; - phy-mode = "internal"; - }; - - port@6 { - reg = <14>; - label = "lan7"; - phy-handle = <&phy14>; - phy-mode = "internal"; - }; - - port@7 { - reg = <15>; - label = "lan8"; - phy-handle = <&phy15>; - phy-mode = "internal"; - }; + SWITCH_PORT(8, 1, internal) + SWITCH_PORT(9, 2, internal) + SWITCH_PORT(10, 3, internal) + SWITCH_PORT(11, 4, internal) + SWITCH_PORT(12, 5, internal) + SWITCH_PORT(13, 6, internal) + SWITCH_PORT(14, 7, internal) + SWITCH_PORT(15, 8, internal) port@28 { ethernet = <ðernet0>; diff --git a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-10p.dts b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-10p.dts index d7c6cbfc7c..9987316c21 100644 --- a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-10p.dts +++ b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-10p.dts @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + #include "rtl838x.dtsi" #include @@ -97,8 +99,6 @@ }; }; - - ðernet0 { mdio: mdio-bus { compatible = "realtek,rtl838x-mdio"; @@ -106,49 +106,16 @@ #address-cells = <1>; #size-cells = <0>; - /* Internal phy */ - phy8: ethernet-phy@8 { - reg = <8>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy9: ethernet-phy@9 { - reg = <9>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy10: ethernet-phy@10 { - reg = <10>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy11: ethernet-phy@11 { - reg = <11>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy12: ethernet-phy@12 { - reg = <12>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy13: ethernet-phy@13 { - reg = <13>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy14: ethernet-phy@14 { - reg = <14>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy15: ethernet-phy@15 { - reg = <15>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy24: ethernet-phy@24 { - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - reg = <24>; - }; - phy26: ethernet-phy@26 { - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - reg = <26>; - }; + INTERNAL_PHY(8) + INTERNAL_PHY(9) + INTERNAL_PHY(10) + INTERNAL_PHY(11) + INTERNAL_PHY(12) + INTERNAL_PHY(13) + INTERNAL_PHY(14) + INTERNAL_PHY(15) + INTERNAL_PHY(24) + INTERNAL_PHY(26) }; }; @@ -157,67 +124,17 @@ #address-cells = <1>; #size-cells = <0>; - port@0 { - reg = <8>; - label = "lan1"; - phy-handle = <&phy8>; - phy-mode = "internal"; - }; - port@1 { - reg = <9>; - label = "lan2"; - phy-handle = <&phy9>; - phy-mode = "internal"; - }; - port@2 { - reg = <10>; - label = "lan3"; - phy-handle = <&phy10>; - phy-mode = "internal"; - }; - port@3 { - reg = <11>; - label = "lan4"; - phy-handle = <&phy11>; - phy-mode = "internal"; - }; - port@4 { - reg = <12>; - label = "lan5"; - phy-handle = <&phy12>; - phy-mode = "internal"; - }; - port@5 { - reg = <13>; - label = "lan6"; - phy-handle = <&phy13>; - phy-mode = "internal"; - }; - port@6 { - reg = <14>; - label = "lan7"; - phy-handle = <&phy14>; - phy-mode = "internal"; - }; - port@7 { - reg = <15>; - label = "lan8"; - phy-handle = <&phy15>; - phy-mode = "internal"; - }; + SWITCH_PORT(8, 1, internal) + SWITCH_PORT(9, 2, internal) + SWITCH_PORT(10, 3, internal) + SWITCH_PORT(11, 4, internal) + SWITCH_PORT(12, 5, internal) + SWITCH_PORT(13, 6, internal) + SWITCH_PORT(14, 7, internal) + SWITCH_PORT(15, 8, internal) + SWITCH_PORT(24, 9, internal) + SWITCH_PORT(26, 10, internal) - port@24 { - reg = <24>; - label = "lan9"; - phy-mode = "internal"; - phy-handle = <&phy24>; - }; - port@26 { - reg = <26>; - label = "lan10"; - phy-mode = "internal"; - phy-handle = <&phy26>; - }; port@28 { ethernet = <ðernet0>; reg = <28>; diff --git a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts index 2d7abc00db..ac51185ed0 100644 --- a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts +++ b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts @@ -1,87 +1,10 @@ -#include "rtl838x.dtsi" +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include -#include +#include "rtl8382_d-link_dgs-1210.dtsi" / { compatible = "d-link,dgs-1210-16", "realtek,rtl838x-soc"; model = "D-Link DGS-1210-16"; - - aliases { - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyS0,115200"; - }; - - leds { - compatible = "gpio-leds"; - - led_power: power { - label = "green:power"; - gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; - }; - }; -}; - -&gpio0 { - indirect-access-bus-id = <0>; -}; - -&spi0 { - status = "okay"; - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x00000000 0x80000>; - read-only; - }; - partition@80000 { - label = "u-boot-env"; - reg = <0x00080000 0x40000>; - read-only; - }; - partition@c0000 { - label = "u-boot-env2"; - reg = <0x000c0000 0x40000>; - read-only; - }; - partition@280000 { - label = "firmware"; - compatible = "denx,uimage"; - reg = <0x00100000 0xd80000>; - }; - partition@be80000 { - label = "kernel2"; - reg = <0x00e80000 0x180000>; - }; - partition@1000000 { - label = "sysinfo"; - reg = <0x01000000 0x40000>; - }; - partition@1040000 { - label = "rootfs2"; - reg = <0x01040000 0xc00000>; - }; - partition@1c40000 { - label = "jffs2"; - reg = <0x01c40000 0x3c0000>; - }; - }; - }; }; ðernet0 { @@ -90,108 +13,29 @@ regmap = <ðernet0>; #address-cells = <1>; #size-cells = <0>; - - /* External phy RTL8218B */ - phy0: ethernet-phy@0 { - reg = <0>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy1: ethernet-phy@1 { - reg = <1>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy2: ethernet-phy@2 { - reg = <2>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy3: ethernet-phy@3 { - reg = <3>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy4: ethernet-phy@4 { - reg = <4>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy5: ethernet-phy@5 { - reg = <5>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy6: ethernet-phy@6 { - reg = <6>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy7: ethernet-phy@7 { - reg = <7>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - /* Internal phy RTL8218B */ - phy8: ethernet-phy@8 { - reg = <8>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy9: ethernet-phy@9 { - reg = <9>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy10: ethernet-phy@10 { - reg = <10>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy11: ethernet-phy@11 { - reg = <11>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy12: ethernet-phy@12 { - reg = <12>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy13: ethernet-phy@13 { - reg = <13>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy14: ethernet-phy@14 { - reg = <14>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy15: ethernet-phy@15 { - reg = <15>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - - /* External phy: RTL8214FC */ - phy24: ethernet-phy@24 { - compatible = "ethernet-phy-ieee802.3-c22"; - sfp; - media = "fibre"; - reg = <24>; - }; - phy25: ethernet-phy@25 { - compatible = "ethernet-phy-ieee802.3-c22"; - sfp; - media = "fibre"; - reg = <25>; - }; - phy26: ethernet-phy@26 { - compatible = "ethernet-phy-ieee802.3-c22"; - sfp; - media = "fibre"; - reg = <26>; - }; - phy27: ethernet-phy@27 { - compatible = "ethernet-phy-ieee802.3-c22"; - sfp; - media = "fibre"; - reg = <27>; - }; + EXTERNAL_PHY(0) + EXTERNAL_PHY(1) + EXTERNAL_PHY(2) + EXTERNAL_PHY(3) + EXTERNAL_PHY(4) + EXTERNAL_PHY(5) + EXTERNAL_PHY(6) + EXTERNAL_PHY(7) + + INTERNAL_PHY(8) + INTERNAL_PHY(9) + INTERNAL_PHY(10) + INTERNAL_PHY(11) + INTERNAL_PHY(12) + INTERNAL_PHY(13) + INTERNAL_PHY(14) + INTERNAL_PHY(15) + + EXTERNAL_SFP_PHY(24) + EXTERNAL_SFP_PHY(25) + EXTERNAL_SFP_PHY(26) + EXTERNAL_SFP_PHY(27) }; }; @@ -200,128 +44,29 @@ #address-cells = <1>; #size-cells = <0>; - port@0 { - reg = <0>; - label = "lan1"; - phy-handle = <&phy0>; - phy-mode = "qsgmii"; - }; - port@1 { - reg = <1>; - label = "lan2"; - phy-handle = <&phy1>; - phy-mode = "qsgmii"; - }; - port@2 { - reg = <2>; - label = "lan3"; - phy-handle = <&phy2>; - phy-mode = "qsgmii"; - }; - port@3 { - reg = <3>; - label = "lan4"; - phy-handle = <&phy3>; - phy-mode = "qsgmii"; - }; - port@4 { - reg = <4>; - label = "lan5"; - phy-handle = <&phy4>; - phy-mode = "qsgmii"; - }; - port@5 { - reg = <5>; - label = "lan6"; - phy-handle = <&phy5>; - phy-mode = "qsgmii"; - }; - port@6 { - reg = <6>; - label = "lan7"; - phy-handle = <&phy6>; - phy-mode = "qsgmii"; - }; - port@7 { - reg = <7>; - label = "lan8"; - phy-handle = <&phy7>; - phy-mode = "qsgmii"; - }; - - port@8 { - reg = <8>; - label = "lan9"; - phy-handle = <&phy8>; - phy-mode = "internal"; - }; - port@9 { - reg = <9>; - label = "lan10"; - phy-handle = <&phy9>; - phy-mode = "internal"; - }; - port@10 { - reg = <10>; - label = "lan11"; - phy-handle = <&phy10>; - phy-mode = "internal"; - }; - port@11 { - reg = <11>; - label = "lan12"; - phy-handle = <&phy11>; - phy-mode = "internal"; - }; - port@12 { - reg = <12>; - label = "lan13"; - phy-handle = <&phy12>; - phy-mode = "internal"; - }; - port@13 { - reg = <13>; - label = "lan14"; - phy-handle = <&phy13>; - phy-mode = "internal"; - }; - port@14 { - reg = <14>; - label = "lan15"; - phy-handle = <&phy14>; - phy-mode = "internal"; - }; - port@15 { - reg = <15>; - label = "lan16"; - phy-handle = <&phy15>; - phy-mode = "internal"; - }; + SWITCH_PORT(0, 1, qsgmii) + SWITCH_PORT(1, 2, qsgmii) + SWITCH_PORT(2, 3, qsgmii) + SWITCH_PORT(3, 4, qsgmii) + SWITCH_PORT(4, 5, qsgmii) + SWITCH_PORT(5, 6, qsgmii) + SWITCH_PORT(6, 7, qsgmii) + SWITCH_PORT(7, 8, qsgmii) + + SWITCH_PORT(8, 9, internal) + SWITCH_PORT(9, 10, internal) + SWITCH_PORT(10, 11, internal) + SWITCH_PORT(11, 12, internal) + SWITCH_PORT(12, 13, internal) + SWITCH_PORT(13, 14, internal) + SWITCH_PORT(14, 15, internal) + SWITCH_PORT(15, 16, internal) + + SWITCH_PORT(24, 17, qsgmii) + SWITCH_PORT(25, 18, qsgmii) + SWITCH_PORT(26, 19, qsgmii) + SWITCH_PORT(27, 20, qsgmii) - port@24 { - reg = <24>; - label = "lan17"; - phy-handle = <&phy24>; - phy-mode = "qsgmii"; - }; - port@25 { - reg = <25>; - label = "lan18"; - phy-handle = <&phy25>; - phy-mode = "qsgmii"; - }; - port@26 { - reg = <26>; - label = "lan19"; - phy-handle = <&phy26>; - phy-mode = "qsgmii"; - }; - port@27 { - reg = <27>; - label = "lan20"; - phy-handle = <&phy27>; - phy-mode = "qsgmii"; - }; port@28 { ethernet = <ðernet0>; reg = <28>; diff --git a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-28.dts b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-28.dts new file mode 100644 index 0000000000..edd4fb140f --- /dev/null +++ b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-28.dts @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rtl8382_d-link_dgs-1210.dtsi" + +/ { + compatible = "d-link,dgs-1210-28", "realtek,rtl838x-soc"; + model = "D-Link DGS-1210-28"; +}; + +ðernet0 { + mdio: mdio-bus { + compatible = "realtek,rtl838x-mdio"; + regmap = <ðernet0>; + #address-cells = <1>; + #size-cells = <0>; + + EXTERNAL_PHY(0) + EXTERNAL_PHY(1) + EXTERNAL_PHY(2) + EXTERNAL_PHY(3) + EXTERNAL_PHY(4) + EXTERNAL_PHY(5) + EXTERNAL_PHY(6) + EXTERNAL_PHY(7) + + INTERNAL_PHY(8) + INTERNAL_PHY(9) + INTERNAL_PHY(10) + INTERNAL_PHY(11) + INTERNAL_PHY(12) + INTERNAL_PHY(13) + INTERNAL_PHY(14) + INTERNAL_PHY(15) + + EXTERNAL_PHY(16) + EXTERNAL_PHY(17) + EXTERNAL_PHY(18) + EXTERNAL_PHY(19) + EXTERNAL_PHY(20) + EXTERNAL_PHY(21) + EXTERNAL_PHY(22) + EXTERNAL_PHY(23) + + EXTERNAL_SFP_PHY(24) + EXTERNAL_SFP_PHY(25) + EXTERNAL_SFP_PHY(26) + EXTERNAL_SFP_PHY(27) + }; +}; + +&switch0 { + ports { + #address-cells = <1>; + #size-cells = <0>; + + SWITCH_PORT(0, 1, qsgmii) + SWITCH_PORT(1, 2, qsgmii) + SWITCH_PORT(2, 3, qsgmii) + SWITCH_PORT(3, 4, qsgmii) + SWITCH_PORT(4, 5, qsgmii) + SWITCH_PORT(5, 6, qsgmii) + SWITCH_PORT(6, 7, qsgmii) + SWITCH_PORT(7, 8, qsgmii) + + SWITCH_PORT(8, 9, internal) + SWITCH_PORT(9, 10, internal) + SWITCH_PORT(10, 11, internal) + SWITCH_PORT(11, 12, internal) + SWITCH_PORT(12, 13, internal) + SWITCH_PORT(13, 14, internal) + SWITCH_PORT(14, 15, internal) + SWITCH_PORT(15, 16, internal) + + SWITCH_PORT(16, 17, qsgmii) + SWITCH_PORT(17, 18, qsgmii) + SWITCH_PORT(18, 19, qsgmii) + SWITCH_PORT(19, 20, qsgmii) + SWITCH_PORT(20, 21, qsgmii) + SWITCH_PORT(21, 22, qsgmii) + SWITCH_PORT(22, 23, qsgmii) + SWITCH_PORT(23, 24, qsgmii) + + SWITCH_PORT(24, 25, qsgmii) + SWITCH_PORT(25, 26, qsgmii) + SWITCH_PORT(26, 27, qsgmii) + SWITCH_PORT(27, 28, qsgmii) + + port@28 { + ethernet = <ðernet0>; + reg = <28>; + phy-mode = "internal"; + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; +}; diff --git a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210.dtsi b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210.dtsi new file mode 100644 index 0000000000..74043c097a --- /dev/null +++ b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210.dtsi @@ -0,0 +1,84 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rtl838x.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "green:power"; + gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&gpio0 { + indirect-access-bus-id = <0>; +}; + +&spi0 { + status = "okay"; + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x00000000 0x80000>; + read-only; + }; + partition@80000 { + label = "u-boot-env"; + reg = <0x00080000 0x40000>; + read-only; + }; + partition@c0000 { + label = "u-boot-env2"; + reg = <0x000c0000 0x40000>; + read-only; + }; + partition@280000 { + label = "firmware"; + compatible = "denx,uimage"; + reg = <0x00100000 0xd80000>; + }; + partition@be80000 { + label = "kernel2"; + reg = <0x00e80000 0x180000>; + }; + partition@1000000 { + label = "sysinfo"; + reg = <0x01000000 0x40000>; + }; + partition@1040000 { + label = "rootfs2"; + reg = <0x01040000 0xc00000>; + }; + partition@1c40000 { + label = "jffs2"; + reg = <0x01c40000 0x3c0000>; + }; + }; + }; +}; diff --git a/target/linux/rtl838x/dts/rtl838x.dtsi b/target/linux/rtl838x/dts/rtl838x.dtsi index 5d562063ea..37bbcefd44 100644 --- a/target/linux/rtl838x/dts/rtl838x.dtsi +++ b/target/linux/rtl838x/dts/rtl838x.dtsi @@ -2,12 +2,44 @@ /dts-v1/; +#define STRINGIZE(s) #s +#define LAN_LABEL(p, s) STRINGIZE(p ## s) +#define SWITCH_PORT_LABEL(n) LAN_LABEL(lan, n) + +#define INTERNAL_PHY(n) \ + phy##n: ethernet-phy@##n { \ + reg = <##n>; \ + compatible = "ethernet-phy-ieee802.3-c22"; \ + phy-is-integrated; \ + }; + +#define EXTERNAL_PHY(n) \ + phy##n: ethernet-phy@##n { \ + reg = <##n>; \ + compatible = "ethernet-phy-ieee802.3-c22"; \ + }; + +#define EXTERNAL_SFP_PHY(n) \ + phy##n: ethernet-phy@##n { \ + compatible = "ethernet-phy-ieee802.3-c22"; \ + sfp; \ + media = "fibre"; \ + reg = <##n>; \ + }; + +#define SWITCH_PORT(n, s, m) \ + port@##n { \ + reg = <##n>; \ + label = SWITCH_PORT_LABEL(s) ; \ + phy-handle = <&phy##n>; \ + phy-mode = #m ; \ + }; + / { #address-cells = <1>; #size-cells = <1>; compatible = "realtek,rtl838x-soc"; - reg = <0xbb000000 0xa000>; cpus { #address-cells = <1>; @@ -54,6 +86,8 @@ reg = <0xb8002000 0x100>; clock-frequency = <200000000>; + + interrupt-parent = <&cpuintc>; interrupts = <31>; reg-io-width = <1>; diff --git a/target/linux/rtl838x/image/Makefile b/target/linux/rtl838x/image/Makefile index f490fa7ffe..51acd41c76 100644 --- a/target/linux/rtl838x/image/Makefile +++ b/target/linux/rtl838x/image/Makefile @@ -41,22 +41,29 @@ define Device/allnet_all-sg8208m endef TARGET_DEVICES += allnet_all-sg8208m -define Device/d-link_dgs-1210-16 +define Device/d-link_dgs-1210 SOC := rtl8382 IMAGE_SIZE := 13824k DEVICE_VENDOR := D-Link - DEVICE_MODEL := DGS-1210-16 DEVICE_PACKAGES := ip-full ip-bridge ethtool tc endef -TARGET_DEVICES += d-link_dgs-1210-16 define Device/d-link_dgs-1210-10p - SOC := rtl8382 - IMAGE_SIZE := 13824k - DEVICE_VENDOR := D-Link + $(Device/d-link_dgs-1210) DEVICE_MODEL := DGS-1210-10P - DEVICE_PACKAGES := ip-full ip-bridge ethtool tc lua-rs232 + DEVICE_PACKAGES += lua-rs232 endef TARGET_DEVICES += d-link_dgs-1210-10p +define Device/d-link_dgs-1210-16 + $(Device/d-link_dgs-1210) + DEVICE_MODEL := DGS-1210-16 +endef +TARGET_DEVICES += d-link_dgs-1210-16 + +define Device/d-link_dgs-1210-28 + $(Device/d-link_dgs-1210) + DEVICE_MODEL := DGS-1210-28 +endef +TARGET_DEVICES += d-link_dgs-1210-28 $(eval $(call BuildImage)) diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh b/target/linux/x86/base-files/lib/upgrade/platform.sh index 1bcd492dd7..d8f2eba97e 100644 --- a/target/linux/x86/base-files/lib/upgrade/platform.sh +++ b/target/linux/x86/base-files/lib/upgrade/platform.sh @@ -7,20 +7,20 @@ platform_check_image() { case "$(get_magic_word "$1")" in eb48|eb63) ;; *) - echo "Invalid image type" + v "Invalid image type" return 1 ;; esac export_bootdevice && export_partdevice diskdev 0 || { - echo "Unable to determine upgrade device" + v "Unable to determine upgrade device" return 1 } get_partitions "/dev/$diskdev" bootdisk - #extract the boot sector from the image - get_image "$@" | dd of=/tmp/image.bs count=63 bs=512b 2>/dev/null + v "Extract boot sector from the image" + get_image_dd "$1" of=/tmp/image.bs count=63 bs=512b get_partitions /tmp/image.bs image @@ -30,7 +30,7 @@ platform_check_image() { rm -f /tmp/image.bs /tmp/partmap.bootdisk /tmp/partmap.image if [ -n "$diff" ]; then - echo "Partition layout has changed. Full image will be written." + v "Partition layout has changed. Full image will be written." ask_bool 0 "Abort" && exit 1 return 0 fi @@ -57,7 +57,7 @@ platform_do_bootloader_upgrade() { echo "(hd0) /dev/$diskdev" > /tmp/device.map part_magic_efi "/dev/$diskdev" && parttable=gpt - echo "Upgrading bootloader on /dev/$diskdev..." + v "Upgrading bootloader on /dev/$diskdev..." grub-bios-setup \ -m "/tmp/device.map" \ -d "/tmp/boot/boot/grub" \ @@ -73,7 +73,7 @@ platform_do_upgrade() { local diskdev partdev diff export_bootdevice && export_partdevice diskdev 0 || { - echo "Unable to determine upgrade device" + v "Unable to determine upgrade device" return 1 } @@ -82,8 +82,8 @@ platform_do_upgrade() { if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then get_partitions "/dev/$diskdev" bootdisk - #extract the boot sector from the image - get_image "$@" | dd of=/tmp/image.bs count=63 bs=512b >/dev/null + v "Extract boot sector from the image" + get_image_dd "$1" of=/tmp/image.bs count=63 bs=512b get_partitions /tmp/image.bs image @@ -94,7 +94,7 @@ platform_do_upgrade() { fi if [ -n "$diff" ]; then - get_image "$@" | dd of="/dev/$diskdev" bs=4096 conv=fsync + get_image_dd "$1" of="/dev/$diskdev" bs=4096 conv=fsync # Separate removal and addtion is necessary; otherwise, partition 1 # will be missing if it overlaps with the old partition 2 @@ -107,16 +107,15 @@ platform_do_upgrade() { #iterate over each partition from the image and write it to the boot disk while read part start size; do if export_partdevice partdev $part; then - echo "Writing image to /dev/$partdev..." - get_image "$@" | dd of="/dev/$partdev" ibs=512 obs=1M skip="$start" count="$size" conv=fsync + v "Writing image to /dev/$partdev..." + get_image_dd "$1" of="/dev/$partdev" ibs=512 obs=1M skip="$start" count="$size" conv=fsync else - echo "Unable to find partition $part device, skipped." + v "Unable to find partition $part device, skipped." fi done < /tmp/partmap.image - #copy partition uuid - echo "Writing new UUID to /dev/$diskdev..." - get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync + v "Writing new UUID to /dev/$diskdev..." + get_image_dd "$1" of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync platform_do_bootloader_upgrade "$diskdev" local parttype=ext4 @@ -129,5 +128,4 @@ platform_do_upgrade() { sed -i "s/\(PARTUUID=\)[a-f0-9-]\+/\1$4$3$2$1-$6$5-$8$7-$9/ig" /mnt/boot/grub/grub.cfg umount /mnt fi - } diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk index ad4b324374..90a22c31e8 100644 --- a/toolchain/glibc/common.mk +++ b/toolchain/glibc/common.mk @@ -7,13 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=glibc -PKG_VERSION:=2.31 +PKG_VERSION:=2.32 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=4bc9918c998085800ecf5bbb3c863e66ea6252a0 -PKG_MIRROR_HASH:=51877ffff6819b5ccc004a842de755c6c203996d673d94d7013927712e252c17 +PKG_SOURCE_VERSION:=70ee5e8b573f76745760dd6b75f705590fc1923a +PKG_MIRROR_HASH:=d816dc7658446c2969d307730b58df5f8a65853b4e57a655895feb685590d63b PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz diff --git a/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch b/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch index 4e3e2eebb2..002e7a1770 100644 --- a/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch +++ b/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch @@ -1,11 +1,11 @@ -From cfc93329e00cd23c226f34b3ffd5552a93c35bd7 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Mon, 23 Mar 2020 22:33:46 +0100 +From 08f5e0df46ce1ad617bcde1fd5542545397630b9 Mon Sep 17 00:00:00 2001 +From: Hans Dedecker +Date: Sat, 24 Oct 2020 21:13:30 +0200 Subject: Revert "Disallow use of DES encryption functions in new programs." This reverts commit b10a0accee709a5efff2fadf0b0bbb79ff0ad759. -ppp still uses the encrypt functions from the libc. musl libc also +ppp still uses the encrypt functions from the libc while musl libc also provides them. --- conform/data/stdlib.h-data | 3 + @@ -15,18 +15,19 @@ provides them. crypt/crypt.h | 16 +++ crypt/crypt_util.c | 9 -- manual/conf.texi | 2 - - manual/crypt.texi | 201 +++++++++++++++++++++++++++++++++++++ + manual/crypt.texi | 204 +++++++++++++++++++++++++++++++++++++ manual/string.texi | 82 +++++++-------- - posix/unistd.h | 22 ++-- + posix/unistd.h | 17 +++- stdlib/stdlib.h | 6 ++ - sunrpc/Makefile | 2 +- sunrpc/des_crypt.c | 7 +- sunrpc/des_soft.c | 2 +- - 14 files changed, 303 insertions(+), 96 deletions(-) + 13 files changed, 305 insertions(+), 90 deletions(-) +diff --git a/conform/data/stdlib.h-data b/conform/data/stdlib.h-data +index 6913828196..d8fcccc2fb 100644 --- a/conform/data/stdlib.h-data +++ b/conform/data/stdlib.h-data -@@ -149,6 +149,9 @@ function {unsigned short int*} seed48 (u +@@ -149,6 +149,9 @@ function {unsigned short int*} seed48 (unsigned short int[3]) #if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 function int setenv (const char*, const char*, int) #endif @@ -36,6 +37,8 @@ provides them. #if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined POSIX && !defined POSIX2008 function {char*} setstate (char*) #endif +diff --git a/conform/data/unistd.h-data b/conform/data/unistd.h-data +index aa070528e8..ddf4f25132 100644 --- a/conform/data/unistd.h-data +++ b/conform/data/unistd.h-data @@ -437,6 +437,9 @@ function int chroot (const char*) @@ -58,6 +61,8 @@ provides them. function int execl (const char*, const char*, ...) function int execle (const char*, const char*, ...) function int execlp (const char*, const char*, ...) +diff --git a/crypt/cert.c b/crypt/cert.c +index e070ca398d..80029e9078 100644 --- a/crypt/cert.c +++ b/crypt/cert.c @@ -10,22 +10,6 @@ @@ -97,6 +102,8 @@ provides them. -} - -#endif +diff --git a/crypt/crypt-entry.c b/crypt/crypt-entry.c +index 502b5846f0..09332c690a 100644 --- a/crypt/crypt-entry.c +++ b/crypt/crypt-entry.c @@ -35,7 +35,6 @@ @@ -107,7 +114,7 @@ provides them. /* Prototypes for local functions. */ #ifndef __GNU_LIBRARY__ -@@ -177,7 +176,17 @@ crypt (const char *key, const char *salt +@@ -177,7 +176,17 @@ crypt (const char *key, const char *salt) return __crypt_r (key, salt, &_ufc_foobar); } @@ -127,6 +134,8 @@ provides them. + return crypt (key, salt); +} #endif +diff --git a/crypt/crypt.h b/crypt/crypt.h +index ca8ad456cc..7d0de95018 100644 --- a/crypt/crypt.h +++ b/crypt/crypt.h @@ -36,6 +36,14 @@ __BEGIN_DECLS @@ -159,6 +168,8 @@ provides them. #endif __END_DECLS +diff --git a/crypt/crypt_util.c b/crypt/crypt_util.c +index 4b2f0a89cb..b012cde6bd 100644 --- a/crypt/crypt_util.c +++ b/crypt/crypt_util.c @@ -34,7 +34,6 @@ @@ -185,7 +196,7 @@ provides them. /* * This is the final -@@ -788,7 +785,6 @@ _ufc_output_conversion_r (ufc_long v1, u +@@ -788,7 +785,6 @@ _ufc_output_conversion_r (ufc_long v1, ufc_long v2, const char *salt, __data->crypt_3_buf[13] = 0; } @@ -193,7 +204,7 @@ provides them. /* * UNIX encrypt function. Takes a bitvector -@@ -889,14 +885,12 @@ __encrypt_r (char *__block, int __edflag +@@ -889,14 +885,12 @@ __encrypt_r (char *__block, int __edflag, } } weak_alias (__encrypt_r, encrypt_r) @@ -208,7 +219,7 @@ provides them. /* -@@ -921,15 +915,12 @@ __setkey_r (const char *__key, struct cr +@@ -921,15 +915,12 @@ __setkey_r (const char *__key, struct crypt_data * __restrict __data) _ufc_mk_keytab_r((char *) ktab, __data); } weak_alias (__setkey_r, setkey_r) @@ -224,9 +235,11 @@ provides them. void __b64_from_24bit (char **cp, int *buflen, +diff --git a/manual/conf.texi b/manual/conf.texi +index f959b00bb6..51fb2f5aa1 100644 --- a/manual/conf.texi +++ b/manual/conf.texi -@@ -780,8 +780,6 @@ Inquire about the parameter correspondin +@@ -780,8 +780,6 @@ Inquire about the parameter corresponding to @code{_XOPEN_LEGACY}. @item _SC_XOPEN_CRYPT @standards{X/Open, unistd.h} Inquire about the parameter corresponding to @code{_XOPEN_CRYPT}. @@ -235,9 +248,11 @@ provides them. @item _SC_XOPEN_ENH_I18N @standards{X/Open, unistd.h} +diff --git a/manual/crypt.texi b/manual/crypt.texi +index af23dd7847..1b151f2d74 100644 --- a/manual/crypt.texi +++ b/manual/crypt.texi -@@ -16,8 +16,19 @@ subject to them, even if you do not use +@@ -16,8 +16,19 @@ subject to them, even if you do not use the functions in this chapter yourself. The restrictions vary from place to place and are changed often, so we cannot give any more specific advice than this warning. @@ -253,12 +268,12 @@ provides them. + @menu * Passphrase Storage:: One-way hashing for passphrases. -+* DES Encryption:: Routines for DES encryption. ++* crypt:: A one-way function for passwords. * Unpredictable Bytes:: Randomness for cryptographic purposes. @end menu -@@ -200,6 +211,196 @@ hashes for the same passphrase. - @include testpass.c.texi +@@ -190,6 +201,199 @@ unpredictable as possible; @pxref{Unpredictable Bytes}. + @include genpass.c.texi @end smallexample +@node DES Encryption @@ -451,9 +466,14 @@ provides them. +functions and their accompanying macros are all defined in the header +@file{rpc/des_crypt.h}. + - @node Unpredictable Bytes - @section Generating Unpredictable Bytes - @cindex randomness source ++@node Unpredictable Bytes ++@section Generating Unpredictable Bytes ++ + The next program demonstrates how to verify a passphrase. It checks a + hash hardcoded into the program, because looking up real users' hashed + passphrases may require special privileges (@pxref{User Database}). +diff --git a/manual/string.texi b/manual/string.texi +index 23f516439a..5586b52dee 100644 --- a/manual/string.texi +++ b/manual/string.texi @@ -36,8 +36,8 @@ too. @@ -467,7 +487,7 @@ provides them. * Encode Binary Data:: Encoding and Decoding of Binary Data. * Argz and Envz Vectors:: Null-separated string vectors. @end menu -@@ -2426,73 +2426,73 @@ functionality under a different name, su +@@ -2426,73 +2426,73 @@ functionality under a different name, such as @code{explicit_memset}, systems it may be in @file{strings.h} instead. @end deftypefun @@ -518,19 +538,10 @@ provides them. -@node Obfuscating Data -@section Obfuscating Data +-@cindex Rot13 +@node Trivial Encryption +@section Trivial Encryption +@cindex encryption -+ -+ -+The @code{memfrob} function converts an array of data to something -+unrecognizable and back again. It is not encryption in its usual sense -+since it is easy for someone to convert the encrypted data back to clear -+text. The transformation is analogous to Usenet's ``Rot13'' encryption -+method for obscuring offensive jokes from sensitive eyes and such. -+Unlike Rot13, @code{memfrob} works on arbitrary binary data, not just -+text. - @cindex Rot13 -The @code{memfrob} function reversibly obfuscates an array of binary -data. This is not true encryption; the obfuscated data still bears a @@ -538,12 +549,20 @@ provides them. -undo the obfuscation. It is analogous to the ``Rot13'' cipher used on -Usenet for obscuring offensive jokes, spoilers for works of fiction, -and so on, but it can be applied to arbitrary binary data. -- + -Programs that need true encryption---a transformation that completely -obscures the original and cannot be reversed without knowledge of a -secret key---should use a dedicated cryptography library, such as -@uref{https://www.gnu.org/software/libgcrypt/,,libgcrypt}. -- ++The @code{memfrob} function converts an array of data to something ++unrecognizable and back again. It is not encryption in its usual sense ++since it is easy for someone to convert the encrypted data back to clear ++text. The transformation is analogous to Usenet's ``Rot13'' encryption ++method for obscuring offensive jokes from sensitive eyes and such. ++Unlike Rot13, @code{memfrob} works on arbitrary binary data, not just ++text. ++@cindex Rot13 + -Programs that need to @emph{destroy} data should use -@code{explicit_bzero} (@pxref{Erasing Sensitive Data}), or possibly -@code{strfry} (@pxref{Shuffling Bytes}). @@ -560,14 +579,13 @@ provides them. -beginning at @var{mem}, in place. Each byte is bitwise xor-ed with -the binary pattern 00101010 (hexadecimal 0x2A). The return value is -always @var{mem}. -- --@code{memfrob} a second time on the same data returns it to --its original state. +@code{memfrob} transforms (frobnicates) each byte of the data structure +at @var{mem}, which is @var{length} bytes long, by bitwise exclusive +oring it with binary 00101010. It does the transformation in place and +its return value is always @var{mem}. -+ + +-@code{memfrob} a second time on the same data returns it to +-its original state. +Note that @code{memfrob} a second time on the same data structure +returns it to its original state. + @@ -582,6 +600,8 @@ provides them. @end deftypefun @node Encode Binary Data +diff --git a/posix/unistd.h b/posix/unistd.h +index 32b8161619..6fac59999f 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -107,6 +107,9 @@ __BEGIN_DECLS @@ -594,20 +614,20 @@ provides them. /* The enhanced internationalization capabilities according to XPG4.2 are present. */ #define _XOPEN_ENH_I18N 1 -@@ -1115,17 +1118,20 @@ ssize_t copy_file_range (int __infd, __o +@@ -1129,17 +1132,25 @@ ssize_t copy_file_range (int __infd, __off64_t *__pinoff, extern int fdatasync (int __fildes); #endif /* Use POSIX199309 */ -#ifdef __USE_MISC --/* One-way hash PHRASE, returning a string suitable for storage in the -- user database. SALT selects the one-way function to use, and -- ensures that no two users' hashes are the same, even if they use -- the same passphrase. The return value points to static storage -- which will be overwritten by the next call to crypt. */ -+ +/* XPG4.2 specifies that prototypes for the encryption functions must + be defined here. */ +#ifdef __USE_XOPEN + /* One-way hash PHRASE, returning a string suitable for storage in the + user database. SALT selects the one-way function to use, and + ensures that no two users' hashes are the same, even if they use + the same passphrase. The return value points to static storage + which will be overwritten by the next call to crypt. */ ++ +/* Encrypt at most 8 characters from KEY using salt to perturb DES. */ extern char *crypt (const char *__key, const char *__salt) __THROW __nonnull ((1, 2)); @@ -623,9 +643,11 @@ provides them. /* Swab pairs bytes in the first N bytes of the area pointed to by FROM and copy the result to TO. The value of TO must not be in the range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM +diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h +index 3aa27a9d25..67e5e66f94 100644 --- a/stdlib/stdlib.h +++ b/stdlib/stdlib.h -@@ -961,6 +961,12 @@ extern int getsubopt (char **__restrict +@@ -962,6 +962,12 @@ extern int getsubopt (char **__restrict __optionp, #endif @@ -638,20 +660,11 @@ provides them. /* X/Open pseudo terminal handling. */ #ifdef __USE_XOPEN2KXSI ---- a/sunrpc/Makefile -+++ b/sunrpc/Makefile -@@ -51,7 +51,7 @@ rpcsvc = bootparam_prot.x nlm_prot.x rst - headers-sunrpc = $(addprefix rpc/,auth.h auth_unix.h clnt.h pmap_clnt.h \ - pmap_prot.h pmap_rmt.h rpc.h rpc_msg.h \ - svc.h svc_auth.h types.h xdr.h auth_des.h \ -- key_prot.h) \ -+ des_crypt.h key_prot.h rpc_des.h) \ - $(rpcsvc:%=rpcsvc/%) rpcsvc/bootparam.h - headers = rpc/netdb.h - install-others = $(inst_sysconfdir)/rpc +diff --git a/sunrpc/des_crypt.c b/sunrpc/des_crypt.c +index 9b4bd2d5dd..a4d8b2936b 100644 --- a/sunrpc/des_crypt.c +++ b/sunrpc/des_crypt.c -@@ -86,9 +86,6 @@ common_crypt (char *key, char *buf, regi +@@ -86,9 +86,6 @@ common_crypt (char *key, char *buf, register unsigned len, return desdev == DES_SW ? DESERR_NONE : DESERR_NOHWDEVICE; } @@ -661,7 +674,7 @@ provides them. /* * CBC mode encryption */ -@@ -105,7 +102,7 @@ cbc_crypt (char *key, char *buf, unsigne +@@ -105,7 +102,7 @@ cbc_crypt (char *key, char *buf, unsigned int len, unsigned int mode, COPY8 (dp.des_ivec, ivec); return err; } @@ -670,12 +683,14 @@ provides them. /* * ECB mode encryption -@@ -118,4 +115,4 @@ ecb_crypt (char *key, char *buf, unsigne +@@ -118,4 +115,4 @@ ecb_crypt (char *key, char *buf, unsigned int len, unsigned int mode) dp.des_mode = ECB; return common_crypt (key, buf, len, mode, &dp); } -hidden_nolink (ecb_crypt, libc, GLIBC_2_1) +libc_hidden_nolink_sunrpc (ecb_crypt, GLIBC_2_1) +diff --git a/sunrpc/des_soft.c b/sunrpc/des_soft.c +index a87de96cc7..f884f8f21b 100644 --- a/sunrpc/des_soft.c +++ b/sunrpc/des_soft.c @@ -71,4 +71,4 @@ des_setparity (char *p) @@ -684,3 +699,6 @@ provides them. } -hidden_nolink (des_setparity, libc, GLIBC_2_1) +libc_hidden_nolink_sunrpc (des_setparity, GLIBC_2_1) +-- +2.25.1 + diff --git a/toolchain/glibc/patches/100-fix_cross_rpcgen.patch b/toolchain/glibc/patches/100-fix_cross_rpcgen.patch index f10efcc5d6..6ee1e80424 100644 --- a/toolchain/glibc/patches/100-fix_cross_rpcgen.patch +++ b/toolchain/glibc/patches/100-fix_cross_rpcgen.patch @@ -33,20 +33,3 @@ +typedef char *caddr_t; # define __daddr_t_defined #endif - ---- a/sunrpc/rpc_main.c -+++ b/sunrpc/rpc_main.c -@@ -958,9 +958,10 @@ mkfile_output (struct commandline *cmd) - abort (); - temp = strrchr (cmd->infile, '.'); - cp = stpcpy (mkfilename, "Makefile."); -- if (temp != NULL) -- *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0'; -- else -+ if (temp != NULL) { -+ strncpy(cp, cmd->infile, temp - cmd->infile); -+ cp[temp - cmd->infile - 1] = 0; -+ } else - stpcpy (cp, cmd->infile); - - } diff --git a/tools/fakeroot/patches/000-relocatable.patch b/tools/fakeroot/patches/000-relocatable.patch index 9f6915bfe8..0408acfa25 100644 --- a/tools/fakeroot/patches/000-relocatable.patch +++ b/tools/fakeroot/patches/000-relocatable.patch @@ -1,25 +1,29 @@ --- a/scripts/fakeroot.in +++ b/scripts/fakeroot.in -@@ -30,12 +30,19 @@ fatal () +@@ -30,13 +30,20 @@ fatal () } # strip /bin/fakeroot to find install prefix -FAKEROOT_PREFIX=@prefix@ -FAKEROOT_BINDIR=@bindir@ +if [ -n "$STAGING_DIR_HOST" ]; then -+ FAKEROOT_PREFIX="${STAGING_DIR_HOST}" -+ FAKEROOT_BINDIR="${STAGING_DIR_HOST}/bin" -+ FAKEROOT_LIBDIR="${STAGING_DIR_HOST}/lib" ++ USEABSLIBPATH=1 ++ LIB=${STAGING_DIR_HOST}/lib/lib@fakeroot_transformed@@DLSUFFIX@ ++ FAKED=${STAGING_DIR_HOST}/bin/faked ++ PATHS= +else + FAKEROOT_PREFIX=@prefix@ + FAKEROOT_BINDIR=@bindir@ -+ FAKEROOT_LIBDIR=@libdir@ + +-USEABSLIBPATH=@LDPRELOADABS@ +-LIB=lib@fakeroot_transformed@@DLSUFFIX@ +-PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot +-FAKED=${FAKEROOT_BINDIR}/@faked_transformed@ ++ USEABSLIBPATH=@LDPRELOADABS@ ++ LIB=lib@fakeroot_transformed@@DLSUFFIX@ ++ PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot ++ FAKED=${FAKEROOT_BINDIR}/@faked_transformed@ +fi - USEABSLIBPATH=@LDPRELOADABS@ - LIB=lib@fakeroot_transformed@@DLSUFFIX@ --PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot -+PATHS=${FAKEROOT_LIBDIR}:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot - FAKED=${FAKEROOT_BINDIR}/@faked_transformed@ - FAKED_MODE="unknown-is-root" + export FAKED_MODE