diff --git a/.gitignore b/.gitignore index 6549af83be..b6bfe1a525 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ TAGS*~ git-src .project .cproject +.ccache diff --git a/Makefile b/Makefile index 32c050bb48..24f5955c90 100644 --- a/Makefile +++ b/Makefile @@ -62,6 +62,11 @@ dirclean: clean rm -rf $(TMP_DIR) $(MAKE) -C $(TOPDIR)/scripts/config clean +cacheclean: +ifneq ($(CONFIG_CCACHE),) + rm -rf $(if $(call qstrip,$(CONFIG_CCACHE_DIR)),$(call qstrip,$(CONFIG_CCACHE_DIR)),$(TOPDIR)/.ccache) +endif + ifndef DUMP_TARGET_DB $(BUILD_DIR)/.prepared: Makefile @mkdir -p $$(dirname $@) @@ -119,6 +124,9 @@ world: prepare $(target/stamp-compile) $(package/stamp-compile) $(package/stamp- $(_SINGLE)$(SUBMAKE) -r package/index $(_SINGLE)$(SUBMAKE) -r json_overview_image_info $(_SINGLE)$(SUBMAKE) -r checksum +ifneq ($(CONFIG_CCACHE),) + $(STAGING_DIR_HOST)/bin/ccache -s +endif .PHONY: clean dirclean prereq prepare world package/symlinks package/symlinks-install package/symlinks-clean diff --git a/config/Config-devel.in b/config/Config-devel.in index 70ec0ce9a7..11741c7070 100644 --- a/config/Config-devel.in +++ b/config/Config-devel.in @@ -69,6 +69,13 @@ menuconfig DEVEL help Compiler cache; see https://ccache.samba.org/ + config CCACHE_DIR + string "Set ccache directory" if CCACHE + default "" + help + Store ccache in this directory. + If not set, uses './.ccache' + config EXTERNAL_KERNEL_TREE string "Use external kernel tree" if DEVEL default "" diff --git a/include/host-build.mk b/include/host-build.mk index 9fc14241c6..7d84ab0f5f 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -132,7 +132,9 @@ define Host/Exports/Default $(1) : export STAGING_PREFIX=$$(HOST_BUILD_PREFIX) $(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig $(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig - $(if $(CONFIG_CCACHE),$(1) : export CCACHE_DIR:=$(STAGING_DIR_HOST)/ccache) + $(if $(CONFIG_CCACHE),$(1) : export CCACHE_BASEDIR:=$(TOPDIR)) + $(if $(CONFIG_CCACHE),$(1) : export CCACHE_DIR:=$(if $(call qstrip,$(CONFIG_CCACHE_DIR)),$(call qstrip,$(CONFIG_CCACHE_DIR)),$(TOPDIR)/.ccache)) + $(if $(CONFIG_CCACHE),$(1) : export CCACHE_COMPILERCHECK:=%compiler% -dumpmachine; %compiler% -dumpversion) $(if $(HOST_CONFIG_SITE),$(1) : export CONFIG_SITE:=$(HOST_CONFIG_SITE)) $(if $(IS_PACKAGE_BUILD),$(1) : export PATH=$$(TARGET_PATH_PKG)) endef diff --git a/include/kernel-version.mk b/include/kernel-version.mk index b99ab180ab..624c31590d 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -8,11 +8,11 @@ endif LINUX_VERSION-4.14 = .187 LINUX_VERSION-4.19 = .131 -LINUX_VERSION-5.4 = .50 +LINUX_VERSION-5.4 = .51 LINUX_KERNEL_HASH-4.14.187 = 5b223475eaeea196aa7e127d3f253bca5c35d8afdc72ca75230ce1ecdd1454bd LINUX_KERNEL_HASH-4.19.131 = 19dfb9f6cc4ba30104b65dcce7d78240a4ae188cb366747d5f8eae35e98964ba -LINUX_KERNEL_HASH-5.4.50 = ad10f4c1e900f4e3eb4903b65dbcb4ca74250de63aa9fa7105b9b3c3f9a8a6e2 +LINUX_KERNEL_HASH-5.4.51 = 9e8bea8b4cd636726b7e495a3b467c8ffe96f8eddc159a45fe4a7e6e07a2069d remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index 569edcbf03..622cbf3223 100644 --- a/include/package-ipkg.mk +++ b/include/package-ipkg.mk @@ -18,6 +18,18 @@ IPKG_REMOVE:= \ IPKG_STATE_DIR:=$(TARGET_DIR)/usr/lib/opkg +# Generates a make statement to return a wildcard for candidate ipkg files +# 1: package name +define gen_ipkg_wildcard + $(1)$$(if $$(filter -%,$$(ABIV_$(1))),,[^a-z-])* +endef + +# 1: package name +# 2: candidate ipk files +define remove_ipkg_files + $(if $(strip $(2)),$(IPKG_REMOVE) $(1) $(2)) +endef + # 1: package name # 2: variable name # 3: variable suffix @@ -185,7 +197,8 @@ $(_endef) $$(IPKG_$(1)) : export DESCRIPTION=$$(Package/$(1)/description) $$(IPKG_$(1)) : export PATH=$$(TARGET_PATH_PKG) $(PKG_INFO_DIR)/$(1).provides $$(IPKG_$(1)): $(STAMP_BUILT) $(INCLUDE_DIR)/package-ipkg.mk - @rm -rf $$(IDIR_$(1)) $$(if $$(call opkg_package_files,$(1)*),; $$(IPKG_REMOVE) $(1) $$(call opkg_package_files,$(1)*)) + @rm -rf $$(IDIR_$(1)); \ + $$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(call gen_ipkg_wildcard,$(1)))) mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/CONTROL $(PKG_INFO_DIR) $(call Package/$(1)/install,$$(IDIR_$(1))) $(if $(Package/$(1)/install-overlay),mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/rootfs-overlay) @@ -253,7 +266,7 @@ $(_endef) @[ -f $$(IPKG_$(1)) ] $(1)-clean: - $$(if $$(call opkg_package_files,$(1)*),$$(IPKG_REMOVE) $(1) $$(call opkg_package_files,$(1)*)) + $$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(call gen_ipkg_wildcard,$(1)))) clean: $(1)-clean diff --git a/include/package.mk b/include/package.mk index 0575692742..a93d6b78f3 100644 --- a/include/package.mk +++ b/include/package.mk @@ -173,7 +173,9 @@ define Build/Exports/Default $(1) : export CONFIG_SITE:=$$(CONFIG_SITE) $(1) : export PKG_CONFIG_PATH:=$$(PKG_CONFIG_PATH) $(1) : export PKG_CONFIG_LIBDIR:=$$(PKG_CONFIG_PATH) - $(if $(CONFIG_CCACHE),$(1) : export CCACHE_DIR:=$(STAGING_DIR)/ccache) + $(if $(CONFIG_CCACHE),$(1) : export CCACHE_BASEDIR:=$(TOPDIR)) + $(if $(CONFIG_CCACHE),$(1) : export CCACHE_DIR:=$(if $(call qstrip,$(CONFIG_CCACHE_DIR)),$(call qstrip,$(CONFIG_CCACHE_DIR)),$(TOPDIR)/.ccache)) + $(if $(CONFIG_CCACHE),$(1) : export CCACHE_COMPILERCHECK:=%compiler% -dumpmachine; %compiler% -dumpversion) endef Build/Exports=$(Build/Exports/Default) diff --git a/include/toplevel.mk b/include/toplevel.mk index 8564a4de73..0a64afe153 100644 --- a/include/toplevel.mk +++ b/include/toplevel.mk @@ -262,7 +262,7 @@ package/symlinks-clean: help: cat README -distclean: +distclean: cacheclean rm -rf bin build_dir .config* dl feeds key-build* logs package/feeds package/openwrt-packages staging_dir tmp @$(_SINGLE)$(SUBMAKE) -C scripts/config clean diff --git a/package/base-files/files/bin/board_detect b/package/base-files/files/bin/board_detect index 441db6a08f..840bd0178d 100755 --- a/package/base-files/files/bin/board_detect +++ b/package/base-files/files/bin/board_detect @@ -5,7 +5,7 @@ CFG=$1 [ -n "$CFG" ] || CFG=/etc/board.json [ -d "/etc/board.d/" -a ! -s "$CFG" ] && { - for a in `ls /etc/board.d/*`; do + for a in $(ls /etc/board.d/*); do [ -x $a ] || continue; $(. $a) done diff --git a/package/base-files/files/etc/uci-defaults/13_fix-group-user b/package/base-files/files/etc/uci-defaults/13_fix-group-user index bf9febdfe4..74f501e8f7 100644 --- a/package/base-files/files/etc/uci-defaults/13_fix-group-user +++ b/package/base-files/files/etc/uci-defaults/13_fix-group-user @@ -1,6 +1,6 @@ . /lib/functions.sh -for file in `grep -sl Require-User /usr/lib/opkg/info/*.control`; do +for file in $(grep -sl Require-User /usr/lib/opkg/info/*.control); do file="${file##*/}" file="${file%.control}" add_group_and_user "${file}" diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index a77b669709..323e057451 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -176,7 +176,7 @@ default_prerm() { ret=$? fi - local shell="$(which bash)" + local shell="$(command -v bash)" for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do if [ -n "$root" ]; then ${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" disable @@ -264,7 +264,7 @@ default_postinst() { rm -f /tmp/luci-indexcache fi - local shell="$(which bash)" + local shell="$(command -v bash)" for i in $(grep -s "^/etc/init.d/" "$root$filelist"); do if [ -n "$root" ]; then ${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" enable diff --git a/package/base-files/files/lib/preinit/30_failsafe_wait b/package/base-files/files/lib/preinit/30_failsafe_wait index 85dca398fa..a2c2c386aa 100644 --- a/package/base-files/files/lib/preinit/30_failsafe_wait +++ b/package/base-files/files/lib/preinit/30_failsafe_wait @@ -91,7 +91,7 @@ failsafe_wait() { grep -q 'failsafe=' /proc/cmdline && FAILSAFE=true && export FAILSAFE if [ "$FAILSAFE" != "true" ]; then fs_wait_for_key f 'to enter failsafe mode' $fs_failsafe_wait_timeout && FAILSAFE=true - [ -f "/tmp/failsafe_button" ] && FAILSAFE=true && echo "- failsafe button "`cat /tmp/failsafe_button`" was pressed -" + [ -f "/tmp/failsafe_button" ] && FAILSAFE=true && echo "- failsafe button "$(cat /tmp/failsafe_button)" was pressed -" [ "$FAILSAFE" = "true" ] && export FAILSAFE && touch /tmp/failsafe fi } diff --git a/package/base-files/files/sbin/pkg_check b/package/base-files/files/sbin/pkg_check index 9968c9b78e..28e87925ae 100755 --- a/package/base-files/files/sbin/pkg_check +++ b/package/base-files/files/sbin/pkg_check @@ -72,14 +72,14 @@ while [ "$1" ]; do fi [ $QUIET = yes ] || echo " * Checking package $1:" ERR="" - CHECK="`sha256sum -c /usr/lib/opkg/info/$1.files-sha256sum 2> /dev/null`" + CHECK="$(sha256sum -c /usr/lib/opkg/info/$1.files-sha256sum 2> /dev/null)" # Are the changed files config files? - if [ $? -ne 0 ] && [ "`cat "/usr/lib/opkg/info/$1.files-sha256sum"`" ]; then - NEWCHECK="`echo "$CHECK" | grep '^.*: OK$'`" - for i in `echo "$CHECK" | sed -n 's|^\(.*\): FAILED$|\1|p'`; do - if [ "`grep "^$i\$" "/usr/lib/opkg/info/$1.conffiles" 2> /dev/null`" ] || \ - [ "`echo "$i" | grep "^/etc/uci-defaults/"`" ]; then + if [ $? -ne 0 ] && [ "$(cat "/usr/lib/opkg/info/$1.files-sha256sum")" ]; then + NEWCHECK="$(echo "$CHECK" | grep '^.*: OK$')" + for i in $(echo "$CHECK" | sed -n 's|^\(.*\): FAILED$|\1|p'); do + if [ "$(grep "^$i\$" "/usr/lib/opkg/info/$1.conffiles" 2> /dev/null)" ] || \ + [ "$(echo "$i" | grep "^/etc/uci-defaults/")" ]; then NEWCHECK="${NEWCHECK}${NL}${i}: CONFIGURED" else NEWCHECK="${NEWCHECK}${NL}${i}: FAILED" @@ -91,7 +91,7 @@ while [ "$1" ]; do # Do we have changed files or not? if [ -z "$ERR" ]; then - [ $QUIET = yes ] || [ -z "`cat "/usr/lib/opkg/info/$1.files-sha256sum"`" ] || echo "$CHECK" | sed 's|^| - |' + [ $QUIET = yes ] || [ ! -s "/usr/lib/opkg/info/$1.files-sha256sum" ] || echo "$CHECK" | sed 's|^| - |' [ $QUIET = yes ] || echo " * Package $1 is ok" [ $QUIET = yes ] || echo else @@ -107,7 +107,7 @@ while [ "$1" ]; do echo "Exiting on first change found!" exit 1 fi - for i in `echo "$CHECK" | sed -n 's|^\(.*\): FAILED$|\1|p'`; do + for i in $(echo "$CHECK" | sed -n 's|^\(.*\): FAILED$|\1|p'); do SUMMARY="${SUMMARY}${NL} - $1: $i" done echo diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 5f5a448861..5cd64f4ffd 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -19,10 +19,6 @@ buffalo,bhr-4grv2|\ devolo,magic-2-wifi|\ engenius,ecb1750|\ etactica,eg200|\ -glinet,gl-ar300m-lite|\ -glinet,gl-ar300m-nand|\ -glinet,gl-ar300m-nor|\ -glinet,gl-ar300m16|\ glinet,gl-ar750s-nor|\ glinet,gl-ar750s-nor-nand|\ librerouter,librerouter-v1|\ @@ -52,6 +48,14 @@ domywifi,dw33d) glinet,gl-ar150) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000" ;; +glinet,gl-ar300m-lite|\ +glinet,gl-ar300m-nand|\ +glinet,gl-ar300m-nor|\ +glinet,gl-ar300m16) + idx="$(find_mtd_index u-boot-env)" + [ -n "$idx" ] && \ + ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" + ;; netgear,wndr3700|\ netgear,wndr3700-v2|\ netgear,wndrmac-v1) diff --git a/package/boot/uboot-envtools/files/kirkwood b/package/boot/uboot-envtools/files/kirkwood index 5e87dd1d62..a099c925ea 100644 --- a/package/boot/uboot-envtools/files/kirkwood +++ b/package/boot/uboot-envtools/files/kirkwood @@ -13,6 +13,7 @@ touch /etc/config/ubootenv board=$(board_name) case "$board" in +checkpoint,l-50|\ cloudengines,pogoe02|\ cloudengines,pogoplugv4|\ iom,ix2-200|\ diff --git a/package/boot/uboot-envtools/files/mvebu b/package/boot/uboot-envtools/files/mvebu index 72e2df5d19..8ed1f87ead 100644 --- a/package/boot/uboot-envtools/files/mvebu +++ b/package/boot/uboot-envtools/files/mvebu @@ -24,7 +24,8 @@ globalscale,espressobin|\ globalscale,espressobin-emmc|\ globalscale,espressobin-v7|\ globalscale,espressobin-v7-emmc|\ -marvell,armada8040-mcbin) +marvell,armada8040-mcbin-doubleshot|\ +marvell,armada8040-mcbin-singleshot) ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1" ;; linksys,wrt1200ac|\ diff --git a/package/boot/uboot-kirkwood/Makefile b/package/boot/uboot-kirkwood/Makefile index d2cbc1041b..e1493bf0e8 100644 --- a/package/boot/uboot-kirkwood/Makefile +++ b/package/boot/uboot-kirkwood/Makefile @@ -54,6 +54,11 @@ define U-Boot/iconnect_second_stage BUILD_DEVICES:=iom_iconnect-1.1 endef +define U-Boot/l-50 + NAME:=CheckPoint L-50 + BUILD_DEVICES:=checkpoint_l-50 +endef + define U-Boot/nsa310 NAME:=Zyxel NSA310 BUILD_DEVICES:=zyxel_nsa310b @@ -89,6 +94,7 @@ UBOOT_TARGETS := \ goflexhome \ ib62x0 ib62x0_second_stage \ iconnect iconnect_second_stage \ + l-50 \ nsa310 \ nsa310s \ nsa325 \ diff --git a/package/boot/uboot-kirkwood/patches/151-arm-kirkwood-add-CheckPoint-L-50-device.patch b/package/boot/uboot-kirkwood/patches/151-arm-kirkwood-add-CheckPoint-L-50-device.patch new file mode 100644 index 0000000000..b228be6aa6 --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/151-arm-kirkwood-add-CheckPoint-L-50-device.patch @@ -0,0 +1,928 @@ +From 742f780f62ace452b83e2463f1f1afdda4b724ea Mon Sep 17 00:00:00 2001 +From: Pawel Dembicki +Date: Sun, 26 Jan 2020 07:27:24 +0100 +Subject: [PATCH] arm: kirkwood: add CheckPoint L-50 device + +This patch adds support for the Check Point L-50 from 600/1100 series +routers. + +Specification: +-CPU: Marvell Kirkwood 88F6821 1200MHz +-RAM: 512MB +-Flash: NAND 512MB +-WiFi: mPCIe card based on Atheros AR9287 b/g/n +-WAN: 1 Gigabit Port (Marvell 88E1116R PHY) +-LAN: 9 Gigabit Ports (2x Marvell 88E6171(5+4)) +-USB: 2x USB2.0 +-Express card slot +-SD card slot +-Serial console: RJ-45 115200 8n1 +-Unsupported DSL + +Known limitations: +- In board is used two switches in chain. Second Marvell is not used + in u-Boot. + +Signed-off-by: Pawel Dembicki +--- + arch/arm/dts/Makefile | 1 + + arch/arm/dts/kirkwood-l-50.dts | 439 +++++++++++++++++++++++++++++ + arch/arm/mach-kirkwood/Kconfig | 4 + + board/checkpoint/l-50/Kconfig | 12 + + board/checkpoint/l-50/MAINTAINERS | 6 + + board/checkpoint/l-50/Makefile | 11 + + board/checkpoint/l-50/kwbimage.cfg | 36 +++ + board/checkpoint/l-50/l-50.c | 172 +++++++++++ + board/checkpoint/l-50/l-50.h | 29 ++ + configs/l-50_defconfig | 59 ++++ + include/configs/l-50.h | 59 ++++ + 11 files changed, 828 insertions(+) + create mode 100644 arch/arm/dts/kirkwood-l-50.dts + create mode 100644 board/checkpoint/l-50/Kconfig + create mode 100644 board/checkpoint/l-50/MAINTAINERS + create mode 100644 board/checkpoint/l-50/Makefile + create mode 100644 board/checkpoint/l-50/kwbimage.cfg + create mode 100644 board/checkpoint/l-50/l-50.c + create mode 100644 board/checkpoint/l-50/l-50.h + create mode 100644 configs/l-50_defconfig + create mode 100644 include/configs/l-50.h + +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -51,6 +51,7 @@ dtb-$(CONFIG_KIRKWOOD) += \ + kirkwood-iconnect.dtb \ + kirkwood-is2.dtb \ + kirkwood-km_kirkwood.dtb \ ++ kirkwood-l-50.dtb \ + kirkwood-lsxhl.dtb \ + kirkwood-lschlv2.dtb \ + kirkwood-net2big.dtb \ +--- /dev/null ++++ b/arch/arm/dts/kirkwood-l-50.dts +@@ -0,0 +1,439 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Check Point L-50 Board Description ++ * Copyright 2020 Pawel Dembicki ++ */ ++ ++/dts-v1/; ++ ++#include "kirkwood.dtsi" ++#include "kirkwood-6281.dtsi" ++ ++/ { ++ model = "Check Point L-50"; ++ compatible = "checkpoint,l-50", "marvell,kirkwood-88f6281", "marvell,kirkwood"; ++ ++ memory { ++ device_type = "memory"; ++ reg = <0x00000000 0x20000000>; ++ }; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200n8"; ++ stdout-path = &uart0; ++ }; ++ ++ ocp@f1000000 { ++ pinctrl: pin-controller@10000 { ++ pinctrl-0 = <&pmx_led38 &pmx_sysrst &pmx_button29>; ++ pinctrl-names = "default"; ++ ++ pmx_sysrst: pmx-sysrst { ++ marvell,pins = "mpp6"; ++ marvell,function = "sysrst"; ++ }; ++ ++ pmx_button29: pmx_button29 { ++ marvell,pins = "mpp29"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_led38: pmx_led38 { ++ marvell,pins = "mpp38"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_sdio_cd: pmx-sdio-cd { ++ marvell,pins = "mpp46"; ++ marvell,function = "gpio"; ++ }; ++ }; ++ ++ serial@12000 { ++ status = "okay"; ++ }; ++ ++ mvsdio@90000 { ++ status = "okay"; ++ cd-gpios = <&gpio1 14 9>; ++ }; ++ ++ i2c@11000 { ++ status = "okay"; ++ clock-frequency = <400000>; ++ ++ gpio2: gpio-expander@20{ ++ #gpio-cells = <2>; ++ #interrupt-cells = <2>; ++ compatible = "semtech,sx1505q"; ++ reg = <0x20>; ++ ++ gpio-controller; ++ }; ++ ++ /* Three GPIOs from 0x21 exp. are undescribed in dts: ++ * 1: DSL module reset (active low) ++ * 5: mPCIE reset (active low) ++ * 6: Express card reset (active low) ++ */ ++ gpio3: gpio-expander@21{ ++ #gpio-cells = <2>; ++ #interrupt-cells = <2>; ++ compatible = "semtech,sx1505q"; ++ reg = <0x21>; ++ ++ gpio-controller; ++ }; ++ ++ rtc@30 { ++ compatible = "s35390a"; ++ reg = <0x30>; ++ }; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ status_green { ++ label = "l-50:green:status"; ++ gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; ++ }; ++ ++ status_red { ++ label = "l-50:red:status"; ++ gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wifi { ++ label = "l-50:green:wifi"; ++ gpios = <&gpio2 7 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "phy0tpt"; ++ }; ++ ++ internet_green { ++ label = "l-50:green:internet"; ++ gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; ++ }; ++ ++ internet_red { ++ label = "l-50:red:internet"; ++ gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; ++ }; ++ ++ usb1_green { ++ label = "l-50:green:usb1"; ++ gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "usbport"; ++ trigger-sources = <&hub_port3>; ++ }; ++ ++ usb1_red { ++ label = "l-50:red:usb1"; ++ gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; ++ }; ++ ++ usb2_green { ++ label = "l-50:green:usb2"; ++ gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "usbport"; ++ trigger-sources = <&hub_port1>; ++ }; ++ ++ usb2_red { ++ label = "l-50:red:usb2"; ++ gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ usb2_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb2_pwr"; ++ ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ gpio = <&gpio3 3 GPIO_ACTIVE_LOW>; ++ regulator-always-on; ++ }; ++ ++ usb1_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb1_pwr"; ++ ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ gpio = <&gpio3 4 GPIO_ACTIVE_LOW>; ++ regulator-always-on; ++ }; ++ ++ mpcie_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "mpcie_pwr"; ++ ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ gpio = <&gpio3 5 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-always-on; ++ }; ++ ++ express_card_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "express_card_pwr"; ++ ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ gpio = <&gpio3 7 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-always-on; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ factory_defaults { ++ label = "factory_defaults"; ++ gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; ++ linux,code = ; ++ }; ++ }; ++}; ++ ++&mdio { ++ status = "okay"; ++ ++ ethphy8: ethernet-phy@8 { ++ reg = <0x08>; ++ }; ++ ++ switch0: switch@10 { ++ compatible = "marvell,mv88e6085"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x10>; ++ dsa,member = <0 0>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan5"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan6"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan2"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan7"; ++ }; ++ ++ switch0port5: port@5 { ++ reg = <5>; ++ phy-mode = "rgmii-txid"; ++ link = <&switch1port5>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ label = "cpu"; ++ phy-mode = "rgmii-id"; ++ ethernet = <ð1port>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++ }; ++ ++ switch@11 { ++ compatible = "marvell,mv88e6085"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x11>; ++ dsa,member = <0 1>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan3"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan8"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan4"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "dmz"; ++ }; ++ ++ switch1port5: port@5 { ++ reg = <5>; ++ phy-mode = "rgmii-txid"; ++ link = <&switch0port5>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ label = "dsl"; ++ fixed-link { ++ speed = <100>; ++ full-duplex; ++ }; ++ }; ++ }; ++ }; ++}; ++ ++ð0 { ++ status = "okay"; ++ ethernet0-port@0 { ++ phy-handle = <ðphy8>; ++ }; ++}; ++ ++ð1 { ++ status = "okay"; ++ ethernet1-port@0 { ++ speed = <1000>; ++ duplex = <1>; ++ phy-handle = <&switch0>; ++ }; ++}; ++ ++&nand { ++ status = "okay"; ++ pinctrl-0 = <&pmx_nand>; ++ pinctrl-names = "default"; ++ ++ partition@0 { ++ label = "u-boot"; ++ reg = <0x00000000 0x000c0000>; ++ }; ++ ++ partition@a0000 { ++ label = "bootldr-env"; ++ reg = <0x000c0000 0x00040000>; ++ }; ++ ++ partition@100000 { ++ label = "kernel-1"; ++ reg = <0x00100000 0x00800000>; ++ }; ++ ++ partition@900000 { ++ label = "rootfs-1"; ++ reg = <0x00900000 0x07100000>; ++ }; ++ ++ partition@7a00000 { ++ label = "kernel-2"; ++ reg = <0x07a00000 0x00800000>; ++ }; ++ ++ partition@8200000 { ++ label = "rootfs-2"; ++ reg = <0x08200000 0x07100000>; ++ }; ++ ++ partition@f300000 { ++ label = "default_sw"; ++ reg = <0x0f300000 0x07900000>; ++ }; ++ ++ partition@16c00000 { ++ label = "logs"; ++ reg = <0x16c00000 0x01800000>; ++ }; ++ ++ partition@18400000 { ++ label = "preset_cfg"; ++ reg = <0x18400000 0x00100000>; ++ }; ++ ++ partition@18500000 { ++ label = "adsl"; ++ reg = <0x18500000 0x00100000>; ++ }; ++ ++ partition@18600000 { ++ label = "storage"; ++ reg = <0x18600000 0x07a00000>; ++ }; ++}; ++ ++&rtc { ++ status = "disabled"; ++}; ++ ++&pciec { ++ status = "okay"; ++}; ++ ++&pcie0 { ++ status = "okay"; ++}; ++ ++&sata_phy0 { ++ status = "disabled"; ++}; ++ ++&sata_phy1 { ++ status = "disabled"; ++}; ++ ++&usb0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ port@1 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <1>; ++ #trigger-source-cells = <0>; ++ ++ hub_port1: port@1 { ++ reg = <1>; ++ #trigger-source-cells = <0>; ++ }; ++ ++ hub_port3: port@3 { ++ reg = <3>; ++ #trigger-source-cells = <0>; ++ }; ++ }; ++}; +--- a/arch/arm/mach-kirkwood/Kconfig ++++ b/arch/arm/mach-kirkwood/Kconfig +@@ -74,6 +74,9 @@ config TARGET_DB_88F6281_BP + config TARGET_NSA325 + bool "Zyxel NSA325 board" + ++config TARGET_L50 ++ bool "Check Point L-50" ++ + endchoice + + config SYS_SOC +@@ -102,5 +105,6 @@ source "board/zyxel/nsa325/Kconfig" + source "board/alliedtelesis/SBx81LIFKW/Kconfig" + source "board/alliedtelesis/SBx81LIFXCAT/Kconfig" + source "board/Marvell/db-88f6281-bp/Kconfig" ++source "board/checkpoint/l-50/Kconfig" + + endif +--- /dev/null ++++ b/board/checkpoint/l-50/Kconfig +@@ -0,0 +1,12 @@ ++if TARGET_L50 ++ ++config SYS_BOARD ++ default "l-50" ++ ++config SYS_VENDOR ++ default "checkpoint" ++ ++config SYS_CONFIG_NAME ++ default "l-50" ++ ++endif +--- /dev/null ++++ b/board/checkpoint/l-50/MAINTAINERS +@@ -0,0 +1,6 @@ ++L50 BOARD ++M: Pawel Dembicki ++S: Maintained ++F: board/checkpoint/l-50/ ++F: include/configs/l-50.h ++F: configs/l-50_defconfig +--- /dev/null ++++ b/board/checkpoint/l-50/Makefile +@@ -0,0 +1,11 @@ ++# SPDX-License-Identifier: GPL-2.0+ ++# ++# (C) Copyright 2020 ++# Pawel Dembicki ++# ++# Based on Kirkwood support: ++# (C) Copyright 2009 ++# Marvell Semiconductor ++# Written-by: Prafulla Wadaskar ++ ++obj-y := l-50.o +--- /dev/null ++++ b/board/checkpoint/l-50/kwbimage.cfg +@@ -0,0 +1,36 @@ ++# SPDX-License-Identifier: GPL-2.0+ ++# ++# Values taken from original bootloader source. ++# Based on: ++# dramregs_seattle_400rd_A.txt from uboot_src_CP600_1100. ++ ++# Boot Media configurations ++BOOT_FROM nand ++NAND_ECC_MODE default ++NAND_PAGE_SIZE 0x0800 ++ ++DATA 0xFFD100e0 0x1b1b1b9b ++DATA 0xFFD01400 0x43000c30 ++DATA 0xFFD01404 0x39543000 ++DATA 0xFFD01408 0x22125451 ++DATA 0xFFD0140C 0x00000833 ++DATA 0xFFD01410 0x000000cc ++DATA 0xFFD01414 0x00000000 ++DATA 0xFFD01418 0x00000000 ++DATA 0xFFD0141C 0x00000C52 ++DATA 0xFFD01420 0x00000004 ++DATA 0xFFD01424 0x0000F17F ++DATA 0xFFD01428 0x00085520 ++DATA 0xFFD0147C 0x00008552 ++DATA 0xFFD01504 0x0FFFFFF1 ++DATA 0xFFD01508 0x10000000 ++DATA 0xFFD0150C 0x0FFFFFF5 ++DATA 0xFFD01514 0x00000000 ++DATA 0xFFD0151C 0x00000000 ++DATA 0xFFD01494 0x00120012 ++DATA 0xFFD01498 0x00000000 ++DATA 0xFFD0149C 0x0000E40F ++DATA 0xFFD01480 0x00000001 ++DATA 0xFFD20134 0x66666666 ++DATA 0xFFD20138 0x66666666 ++DATA 0x0 0x0 +--- /dev/null ++++ b/board/checkpoint/l-50/l-50.c +@@ -0,0 +1,172 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright (C) 2020 ++ * Pawel Dembicki ++ * ++ * Based on Kirkwood support: ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * Written-by: Prafulla Wadaskar ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "l-50.h" ++ ++DECLARE_GLOBAL_DATA_PTR; ++ ++int board_early_init_f(void) ++{ ++ /* Gpio configuration */ ++ mvebu_config_gpio(L50_OE_VAL_LOW, L50_OE_VAL_HIGH, ++ L50_OE_LOW, L50_OE_HIGH); ++ ++ /* Multi-Purpose Pins Functionality configuration */ ++ static const u32 kwmpp_config[] = { ++ MPP0_NF_IO2, ++ MPP1_NF_IO3, ++ MPP2_NF_IO4, ++ MPP3_NF_IO5, ++ MPP4_NF_IO6, ++ MPP5_NF_IO7, ++ MPP6_SYSRST_OUTn, ++ MPP7_SPI_SCn, ++ MPP8_TW_SDA, ++ MPP9_TW_SCK, ++ MPP10_UART0_TXD, ++ MPP11_UART0_RXD, ++ MPP12_SD_CLK, ++ MPP13_SD_CMD, ++ MPP14_SD_D0, ++ MPP15_SD_D1, ++ MPP16_SD_D2, ++ MPP17_SD_D3, ++ MPP18_NF_IO0, ++ MPP19_NF_IO1, ++ MPP20_GE1_0, ++ MPP21_GE1_1, ++ MPP22_GE1_2, ++ MPP23_GE1_3, ++ MPP24_GE1_4, ++ MPP25_GE1_5, ++ MPP26_GE1_6, ++ MPP27_GE1_7, ++ MPP28_GPIO, ++ MPP29_GPIO, ++ MPP30_GE1_10, ++ MPP31_GE1_11, ++ MPP32_GE1_12, ++ MPP33_GE1_13, ++ MPP34_GPIO, ++ MPP35_GPIO, ++ MPP36_AUDIO_SPDIFI, /* value from stock u-boot */ ++ MPP37_GPIO, ++ MPP38_GPIO, ++ MPP39_TDM_SPI_CS0, ++ MPP40_GPIO, ++ MPP41_GPIO, ++ MPP42_TDM_SPI_MOSI, ++ MPP43_TDM_CODEC_INTn, ++ MPP44_GPIO, ++ MPP45_TDM_PCLK, ++ MPP46_GPIO, ++ MPP47_TDM_DRX, ++ MPP48_GPIO, ++ MPP49_GPIO, ++ 0 ++ }; ++ kirkwood_mpp_conf(kwmpp_config, NULL); ++ ++ return 0; ++} ++ ++void board_gpio_expander_init(void) ++{ ++ struct udevice *dev0, *dev1; ++ uchar data_buffer; ++ int ret; ++ ++ ret = i2c_get_chip_for_busnum(0, L50_GPIO0_I2C_ADDRESS, 1, &dev0); ++ if (ret) { ++ debug("%s: Cannot find I2C GPIO expander chip 0x02%X\n", ++ __func__, L50_GPIO0_I2C_ADDRESS); ++ return; ++ } ++ ++ ret = i2c_get_chip_for_busnum(0, L50_GPIO1_I2C_ADDRESS, 1, &dev1); ++ if (ret) { ++ debug("%s: Cannot find I2C GPIO expander chip 0x02%X\n", ++ __func__, L50_GPIO1_I2C_ADDRESS); ++ return; ++ } ++ ++ /* Set IO as output */ ++ data_buffer = 0x0; ++ dm_i2c_write(dev0, 1, &data_buffer, 1); ++ dm_i2c_write(dev1, 1, &data_buffer, 1); ++ ++ /* Set all leds off, reset asserted, pwr off */ ++ data_buffer = 0xbf; ++ dm_i2c_write(dev0, 0, &data_buffer, 1); ++ data_buffer = 0x1c; ++ dm_i2c_write(dev1, 0, &data_buffer, 1); ++ ++ mdelay(100); ++ ++ /* Set pwr on */ ++ data_buffer = 0xa5; ++ dm_i2c_write(dev1, 0, &data_buffer, 1); ++ ++ mdelay(100); ++ ++ /* Set reset deasserted, status red led enabled*/ ++ data_buffer = 0xff; ++ dm_i2c_write(dev0, 0, &data_buffer, 1); ++ data_buffer = 0xe3; ++ dm_i2c_write(dev1, 0, &data_buffer, 1); ++} ++ ++int board_init(void) ++{ ++ /* Boot parameters address */ ++ gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100; ++ ++ board_gpio_expander_init(); ++ ++ return 0; ++} ++ ++#ifdef CONFIG_RESET_PHY_R ++/* Configure and initialize PHY */ ++void reset_phy(void) ++{ ++ u16 devadr; ++ char *name = "ethernet-controller@72000"; ++ ++ if (miiphy_set_current_dev(name)) ++ return; ++ ++ /* command to read PHY dev address */ ++ if (miiphy_read(name, 0xEE, 0xEE, (u16 *)&devadr)) { ++ printf("Err..(%s) could not read PHY dev address\n", __func__); ++ return; ++ } ++ ++ /* ++ * Fix PHY led configuration ++ */ ++ miiphy_write(name, devadr, MV88E1116_PGADR_REG, 3); ++ miiphy_write(name, devadr, 0x10, 0x1177); ++ miiphy_write(name, devadr, 0x11, 0x4417); ++ miiphy_write(name, devadr, MV88E1116_PGADR_REG, 0); ++ ++ debug("88E1116 Initialized on %s\n", name); ++} ++#endif /* CONFIG_RESET_PHY_R */ +--- /dev/null ++++ b/board/checkpoint/l-50/l-50.h +@@ -0,0 +1,29 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright (C) 2020 ++ * Pawel Dembicki ++ * ++ * Based on Kirkwood support: ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * Written-by: Prafulla Wadaskar ++ */ ++ ++#ifndef __L50_H ++#define __L50_H ++ ++/* GPIO configuration */ ++#define L50_OE_LOW 0x30000000 ++#define L50_OE_HIGH 0x0000004c ++#define L50_OE_VAL_LOW 0x00000000 ++#define L50_OE_VAL_HIGH 0x00000000 ++ ++/* Expander GPIO addresses */ ++ ++#define L50_GPIO0_I2C_ADDRESS 0x20 ++#define L50_GPIO1_I2C_ADDRESS 0x21 ++ ++/* PHY register */ ++#define MV88E1116_PGADR_REG 22 ++ ++#endif /* __L50_H */ +--- /dev/null ++++ b/configs/l-50_defconfig +@@ -0,0 +1,59 @@ ++CONFIG_ARM=y ++CONFIG_SYS_DCACHE_OFF=y ++CONFIG_ARCH_CPU_INIT=y ++CONFIG_KIRKWOOD=y ++CONFIG_SYS_TEXT_BASE=0x600000 ++CONFIG_TARGET_L50=y ++CONFIG_ENV_SIZE=0x20000 ++CONFIG_ENV_OFFSET=0xC0000 ++CONFIG_ENV_SECT_SIZE=0x20000 ++CONFIG_ENV_ADDR=0xC0000 ++CONFIG_IDENT_STRING="\nCheck Point L-50" ++CONFIG_NR_DRAM_BANKS=2 ++# CONFIG_SYS_MALLOC_F is not set ++CONFIG_BOOTDELAY=1 ++CONFIG_CONSOLE_MUX=y ++CONFIG_DISPLAY_BOARDINFO=y ++CONFIG_HUSH_PARSER=y ++# CONFIG_CMD_FLASH is not set ++#CONFIG_CMD_IDE=y ++CONFIG_CMD_I2C=y ++CONFIG_CMD_NAND=y ++CONFIG_CMD_USB=y ++# CONFIG_CMD_SETEXPR is not set ++CONFIG_CMD_DHCP=y ++CONFIG_CMD_MII=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_EXT2=y ++CONFIG_CMD_FAT=y ++CONFIG_CMD_JFFS2=y ++CONFIG_CMD_MTDPARTS=y ++CONFIG_MTD=y ++CONFIG_MTD_RAW_NAND=y ++CONFIG_MTDIDS_DEFAULT="nand0=orion_nand" ++CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xc0000@0x0(u-boot)ro,0x40000@0xc0000(bootldr-env),0x7900000@0x100000(ubi),0x800000@0x7a00000(kernel-2),0x7100000@0x8200000(rootfs-2),0x7900000@0xf300000(default_sw),0x1800000@0x16c00000(logs),0x100000@0x18400000(preset_cfg),0x100000@0x18500000(adsl),-@0x18600000(storage)" ++CONFIG_CMD_UBI=y ++CONFIG_ISO_PARTITION=y ++CONFIG_OF_CONTROL=y ++CONFIG_DEFAULT_DEVICE_TREE="kirkwood-l-50" ++CONFIG_ENV_IS_IN_NAND=y ++CONFIG_DM=y ++CONFIG_DM_ETH=y ++#CONFIG_MVSATA_IDE=y ++CONFIG_MMC=y ++CONFIG_MVGBE=y ++CONFIG_MII=y ++CONFIG_PHYLIB=y ++CONFIG_PHY_MARVELL=y ++CONFIG_MV88E61XX_SWITCH=y ++CONFIG_MV88E61XX_CPU_PORT=6 ++CONFIG_MV88E61XX_PHY_PORTS=0x01f ++CONFIG_MV88E61XX_FIXED_PORTS=0 ++#CONFIG_DM_RTC=y ++#CONFIG_RTC_MV=y ++CONFIG_SYS_NS16550=y ++CONFIG_DM_I2C=y ++CONFIG_SYS_I2C_MVTWSI=y ++CONFIG_USB=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_STORAGE=y +--- /dev/null ++++ b/include/configs/l-50.h +@@ -0,0 +1,59 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright (C) 2020 ++ * Pawel Dembicki ++ * ++ * Based on Kirkwood support: ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * Written-by: Prafulla Wadaskar ++ */ ++ ++#ifndef _CONFIG_L50_H ++#define _CONFIG_L50_H ++ ++/* ++ * High Level Configuration Options (easy to change) ++ */ ++#define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */ ++#define CONFIG_KW88F6281 /* SOC Name */ ++#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ ++ ++/* ++ * mv-common.h should be defined after CMD configs since it used them ++ * to enable certain macros ++ */ ++#include "mv-common.h" ++ ++/* Remove or override few declarations from mv-common.h */ ++ ++/* ++ * Ethernet Driver configuration ++ */ ++#ifdef CONFIG_CMD_NET ++#define CONFIG_MVGBE_PORTS {1, 1} /* enable port 0 only */ ++#define CONFIG_NETCONSOLE ++#endif ++ ++#define CONFIG_MV88E61XX_CPU_PORT_RX_DELAY ++#define CONFIG_MV88E61XX_CPU_PORT_TX_DELAY ++ ++/* ++ * Enable GPI0 support ++ */ ++#define CONFIG_KIRKWOOD_GPIO ++ ++/* ++ * Default environment variables ++ */ ++#define CONFIG_BOOTCOMMAND \ ++ "ubi part ubi; " \ ++ "ubi read 0x800000 kernel; " \ ++ "bootm 0x800000" ++ ++#define CONFIG_EXTRA_ENV_SETTINGS \ ++ "bootargs=console=ttyS0,115200\0" \ ++ "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \ ++ "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \ ++ "bootargs_root=\0" ++#endif /* _CONFIG_L50_H */ diff --git a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch index c7c811cee1..83eb0f9d2c 100644 --- a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch +++ b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch @@ -1,8 +1,8 @@ --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig -@@ -103,4 +103,7 @@ source "board/alliedtelesis/SBx81LIFKW/K - source "board/alliedtelesis/SBx81LIFXCAT/Kconfig" +@@ -107,4 +107,7 @@ source "board/alliedtelesis/SBx81LIFXCAT source "board/Marvell/db-88f6281-bp/Kconfig" + source "board/checkpoint/l-50/Kconfig" +config SECOND_STAGE + bool "OpenWrt second stage hack" @@ -35,6 +35,17 @@ +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_ICONNECT_H */ +--- a/include/configs/l-50.h ++++ b/include/configs/l-50.h +@@ -12,6 +12,8 @@ + #ifndef _CONFIG_L50_H + #define _CONFIG_L50_H + ++#include "openwrt-kirkwood-common.h" ++ + /* + * High Level Configuration Options (easy to change) + */ --- /dev/null +++ b/include/configs/openwrt-kirkwood-common.h @@ -0,0 +1,31 @@ @@ -139,6 +150,17 @@ +CONFIG_FIT_VERBOSE=y CONFIG_LZMA=y +CONFIG_LZO=y +--- a/configs/l-50_defconfig ++++ b/configs/l-50_defconfig +@@ -57,3 +57,8 @@ CONFIG_SYS_I2C_MVTWSI=y + CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y --- a/configs/nsa310_defconfig +++ b/configs/nsa310_defconfig @@ -43,6 +43,9 @@ CONFIG_CMD_UBI=y diff --git a/package/boot/uboot-kirkwood/patches/701-phy-mv88e61xx-add-support-for-RGMII-TX-RX-delay.patch b/package/boot/uboot-kirkwood/patches/701-phy-mv88e61xx-add-support-for-RGMII-TX-RX-delay.patch new file mode 100644 index 0000000000..6e358857b7 --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/701-phy-mv88e61xx-add-support-for-RGMII-TX-RX-delay.patch @@ -0,0 +1,53 @@ +From 940e9a5828480e4185c9a276ad7f35a4069a2393 Mon Sep 17 00:00:00 2001 +From: Pawel Dembicki +Date: Thu, 23 Jan 2020 22:04:15 +0100 +Subject: [PATCH 1/2] phy: mv88e61xx: add support for RGMII TX/RX delay + +Clock delay in RGMII is required for some boards. +This patch introduce CONFIG_MV88E61XX_CPU_PORT_TX_DELAY and +CONFIG_MV88E61XX_CPU_PORT_RX_DELAY defines, which are setting +proper bits in PORT_REG_PHYS_CTRL register. + +Cc: Chris Packham +Cc: Joe Hershberger +Cc: Anatolij Gustschin +Cc: Tim Harvey +Signed-off-by: Pawel Dembicki +--- + drivers/net/phy/mv88e61xx.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c +index 5aff7ed397..889327639d 100644 +--- a/drivers/net/phy/mv88e61xx.c ++++ b/drivers/net/phy/mv88e61xx.c +@@ -94,6 +94,8 @@ + #define PORT_REG_STATUS_CMODE_1000BASE_X 0x9 + #define PORT_REG_STATUS_CMODE_SGMII 0xa + ++#define PORT_REG_PHYS_CTRL_RGMII_RX_DELAY BIT(15) ++#define PORT_REG_PHYS_CTRL_RGMII_TX_DELAY BIT(14) + #define PORT_REG_PHYS_CTRL_PCS_AN_EN BIT(10) + #define PORT_REG_PHYS_CTRL_PCS_AN_RST BIT(9) + #define PORT_REG_PHYS_CTRL_FC_VALUE BIT(7) +@@ -747,9 +749,16 @@ static int mv88e61xx_fixed_port_setup(struct phy_device *phydev, u8 port) + PORT_REG_PHYS_CTRL_SPD1000; + } + +- if (port == CONFIG_MV88E61XX_CPU_PORT) ++ if (port == CONFIG_MV88E61XX_CPU_PORT) { + val |= PORT_REG_PHYS_CTRL_LINK_VALUE | + PORT_REG_PHYS_CTRL_LINK_FORCE; ++#if defined(CONFIG_MV88E61XX_CPU_PORT_RX_DELAY) ++ val |= PORT_REG_PHYS_CTRL_RGMII_RX_DELAY; ++#endif ++#if defined(CONFIG_MV88E61XX_CPU_PORT_TX_DELAY) ++ val |= PORT_REG_PHYS_CTRL_RGMII_TX_DELAY; ++#endif ++ } + + return mv88e61xx_port_write(phydev, port, PORT_REG_PHYS_CTRL, + val); +-- +2.20.1 + diff --git a/package/boot/uboot-kirkwood/patches/702-phy-mv88e61xx-add-support-for-MV88E6171.patch b/package/boot/uboot-kirkwood/patches/702-phy-mv88e61xx-add-support-for-MV88E6171.patch new file mode 100644 index 0000000000..c91a06cbed --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/702-phy-mv88e61xx-add-support-for-MV88E6171.patch @@ -0,0 +1,67 @@ +From 7ffab66a99831ce5e3037b608d73565c9d1abd20 Mon Sep 17 00:00:00 2001 +From: Pawel Dembicki +Date: Thu, 23 Jan 2020 22:09:51 +0100 +Subject: [PATCH 2/2] phy: mv88e61xx: add support for MV88E6171 + +This patch add MV88E6171 id to driver data. + +Tested on Checkpoint L-50 board. + +Cc: Chris Packham +Cc: Joe Hershberger +Cc: Anatolij Gustschin +Cc: Tim Harvey +Signed-off-by: Pawel Dembicki +--- + drivers/net/phy/mv88e61xx.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c +index 889327639d..e0b648a54e 100644 +--- a/drivers/net/phy/mv88e61xx.c ++++ b/drivers/net/phy/mv88e61xx.c +@@ -180,6 +180,7 @@ + #define PORT_SWITCH_ID_6071 0x0710 + #define PORT_SWITCH_ID_6096 0x0980 + #define PORT_SWITCH_ID_6097 0x0990 ++#define PORT_SWITCH_ID_6171 0x1710 + #define PORT_SWITCH_ID_6172 0x1720 + #define PORT_SWITCH_ID_6176 0x1760 + #define PORT_SWITCH_ID_6220 0x2200 +@@ -997,6 +998,7 @@ static int mv88e61xx_probe(struct phy_device *phydev) + switch (priv->id) { + case PORT_SWITCH_ID_6096: + case PORT_SWITCH_ID_6097: ++ case PORT_SWITCH_ID_6171: + case PORT_SWITCH_ID_6172: + case PORT_SWITCH_ID_6176: + case PORT_SWITCH_ID_6240: +@@ -1152,6 +1154,17 @@ static struct phy_driver mv88e61xx_driver = { + .shutdown = &genphy_shutdown, + }; + ++static struct phy_driver mv88e617x_driver = { ++ .name = "Marvell MV88E617x", ++ .uid = 0x01410e70, ++ .mask = 0xfffffff0, ++ .features = PHY_GBIT_FEATURES, ++ .probe = mv88e61xx_probe, ++ .config = mv88e61xx_phy_config, ++ .startup = mv88e61xx_phy_startup, ++ .shutdown = &genphy_shutdown, ++}; ++ + static struct phy_driver mv88e609x_driver = { + .name = "Marvell MV88E609x", + .uid = 0x1410c89, +@@ -1177,6 +1190,7 @@ static struct phy_driver mv88e6071_driver = { + int phy_mv88e61xx_init(void) + { + phy_register(&mv88e61xx_driver); ++ phy_register(&mv88e617x_driver); + phy_register(&mv88e609x_driver); + phy_register(&mv88e6071_driver); + +-- +2.20.1 + diff --git a/package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt b/package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt index 99e61ff119..f109a98b85 100644 --- a/package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt @@ -3,6 +3,6 @@ loadaddr=0x81000000 fdt_high=0xffffffffffffffff initrd_high=0xffffffffffffffff qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr -bootargs=ubi.mtd=8 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(pfe),2m(reserved-2),1m(dtb),16m(kernel),32m(ubifs) +bootargs=root=/dev/mtdblock8 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(pfe),2m(reserved-2),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware) bootcmd=echo starting openwrt ...;pfe stop;run qspi_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls1021atwr-uEnv.txt b/package/boot/uboot-layerscape/files/ls1021atwr-uEnv.txt index 387cfeb9ff..d6c5f56fd9 100644 --- a/package/boot/uboot-layerscape/files/ls1021atwr-uEnv.txt +++ b/package/boot/uboot-layerscape/files/ls1021atwr-uEnv.txt @@ -3,6 +3,6 @@ loadaddr=0x81000000 fdt_high=0xffffffff initrd_high=0xffffffff nor_boot=cp.b 60f00000 $fdtaddr 100000;cp.b 61000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr -bootargs=root=/dev/mtdblock6 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(rcw),2m(u-boot),1m(u-boot-env),11m(reserved-1),1m(dtb),16m(kernel),32m(rootfs) cma=64M@0x0-0xb0000000 +bootargs=root=/dev/mtdblock6 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(rcw),2m(u-boot),1m(u-boot-env),11m(reserved-1),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware) cma=64M@0x0-0xb0000000 bootcmd=echo starting openwrt ...;run nor_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls1043ardb-uEnv.txt b/package/boot/uboot-layerscape/files/ls1043ardb-uEnv.txt index b040cffdbf..1214bf40c2 100644 --- a/package/boot/uboot-layerscape/files/ls1043ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/ls1043ardb-uEnv.txt @@ -4,6 +4,6 @@ fdt_high=0xffffffffffffffff initrd_high=0xffffffffffffffff hwconfig=fsl_ddr:bank_intlv=auto nor_boot=cp.b 60f00000 $fdtaddr 100000;cp.b 61000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr -bootargs=root=/dev/mtdblock8 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs) +bootargs=root=/dev/mtdblock8 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware) bootcmd=echo starting openwrt ...;run nor_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt b/package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt index 7bc7e2c972..975b1c1e7f 100644 --- a/package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt @@ -4,6 +4,6 @@ fdt_high=0xffffffffffffffff initrd_high=0xffffffffffffffff hwconfig=fsl_ddr:bank_intlv=auto qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr -bootargs=ubi.mtd=9 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(ubifs) +bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware) bootcmd=echo starting openwrt ...;run qspi_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt b/package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt index 89004d2475..7ab5550405 100644 --- a/package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt @@ -5,6 +5,6 @@ initrd_high=0xffffffffffffffff hwconfig=fsl_ddr:bank_intlv=auto mc_init=sf probe 0:0;sf read 80000000 a00000 300000;sf read 80300000 e00000 100000;fsl_mc start mc 80000000 80300000;sf read 80400000 d00000 100000;fsl_mc apply dpl 80400000 qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr -bootargs=ubi.mtd=10 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=20c0000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(ubifs) +bootargs=root=/dev/mtdblock10 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=20c0000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware) bootcmd=echo starting openwrt ...;run mc_init;run qspi_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls2088ardb-uEnv.txt b/package/boot/uboot-layerscape/files/ls2088ardb-uEnv.txt index 31e937ffcb..fe2febd2ce 100644 --- a/package/boot/uboot-layerscape/files/ls2088ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/ls2088ardb-uEnv.txt @@ -5,6 +5,6 @@ initrd_high=0xffffffffffffffff hwconfig=fsl_ddr:bank_intlv=auto mc_init=fsl_mc start mc 580a00000 580e00000;fsl_mc apply dpl 580d00000 nor_boot=cp.b 580f00000 $fdtaddr 100000;cp.b 581000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr -bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS1,115200 mtdparts=580000000.nor:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs) +bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS1,115200 mtdparts=580000000.nor:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware) bootcmd=echo starting openwrt ...;run mc_init;run nor_boot bootdelay=3 diff --git a/package/ctcgfw/duktape/Makefile b/package/ctcgfw/duktape/Makefile new file mode 100644 index 0000000000..a85f72df50 --- /dev/null +++ b/package/ctcgfw/duktape/Makefile @@ -0,0 +1,92 @@ +# +# Copyright (C) 2019 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=duktape +PKG_VERSION:=2.99.99-65f1e02 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/svaarala/duktape.git +PKG_SOURCE_VERSION:=65f1e02e580796929e92e91ba4776d4b0131beb5 +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz + +PKG_LICENSE:=GPLv3 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=CN_SZTL + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_BUILD_DEPENDS:=python2 + +PKG_FIXUP:=autoreconf +PKG_USE_MIPS16:=0 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/duktape + SECTION:=utils + CATEGORY:=Utilities + URL:=https://github.com/svaarala/duktape + TITLE:=Duktape is an embeddable Javascript engine, with a focus on portability and compact footprint. +endef + +define Package/libduktape + $(call Package/duktape) + SECTION:=lib + CATEGORY:=Libraries + TITLE+= (Libraries) + VARIANT:=lib +endef + +define Package/duktape/description + Duktape is easy to integrate into a C/C++ project: add duktape.c, + duktape.h, and duk_config.h to your build, and use the Duktape API + to call ECMAScript functions from C code and vice versa. +endef + +define Package/libduktape/description + $(call Package/duktape/description) +endef + +define Build/Compile +( \ + cd $(PKG_BUILD_DIR); \ + mkdir dist; \ + $(STAGING_DIR_HOSTPKG)/bin/pip2 install PyYAML; \ + $(STAGING_DIR_HOSTPKG)/bin/python2 util/dist.py; \ + cd dist/source/src; \ + $(TARGET_CC) -c -O3 -o duktape.o duktape.c; \ + $(TARGET_CC) -c -O3 -o duk_module_node.o -I. ../extras/module-node/duk_module_node.c; \ + $(TARGET_AR) cr libduktape.a duktape.o; \ + $(TARGET_AR) cr libduktape_module.a duk_module_node.o; \ + cd ../../../..; \ + env $(call Build/Compile/Default) \ +) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/include + $(INSTALL_DATA) $(PKG_BUILD_DIR)/dist/source/src/*.a $(1)/usr/lib/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/dist/source/src/duk*.h $(1)/usr/include/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/dist/source/extras/module-node/duk_module_node.h $(1)/usr/include/ +endef + +define Package/duktape/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/duk $(1)/usr/bin/duk +endef + +define Package/libduktape/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DATA) $(PKG_BUILD_DIR)/dist/source/src/*.a $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,duktape)) +$(eval $(call BuildPackage,libduktape)) diff --git a/package/ctcgfw/subconverter/Makefile b/package/ctcgfw/subconverter/Makefile index ff1a97340a..38e62f6a8b 100644 --- a/package/ctcgfw/subconverter/Makefile +++ b/package/ctcgfw/subconverter/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=subconverter -PKG_VERSION:=0.5.2-8385792 +PKG_VERSION:=0.6.1-081b5ad PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/tindy2013/subconverter.git -PKG_SOURCE_VERSION:=8385792fec9c07fb38b594b2dba285bff237ee3f +PKG_SOURCE_VERSION:=081b5adb71f9dee918dc0a026d350efe6ff392b5 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz @@ -26,7 +26,7 @@ PKG_INSTALL:=1 PKG_FIXUP:=autoreconf PKG_USE_MIPS16:=0 PKG_BUILD_PARALLEL:=1 -PKG_BUILD_DEPENDS:=jpcre2 rapidjson +PKG_BUILD_DEPENDS:=duktape jpcre2 rapidjson include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -43,6 +43,8 @@ define Package/$(PKG_NAME)/description Utility to convert between various subscription format. endef +# CMAKE_OPTIONS += -DCMAKE_BUILD_TYPE=Release + define Package/$(PKG_NAME)/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/subconverter $(1)/usr/bin/subconverter diff --git a/package/firmware/linux-firmware/misc.mk b/package/firmware/linux-firmware/misc.mk new file mode 100644 index 0000000000..d0956f77b3 --- /dev/null +++ b/package/firmware/linux-firmware/misc.mk @@ -0,0 +1,9 @@ +Package/eip197-mini-firmware = $(call Package/firmware-default,Inside Secure EIP197 mini firmware) +define Package/eip197-mini-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/inside-secure/eip197_minifw + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/inside-secure/eip197_minifw/ifpp.bin \ + $(PKG_BUILD_DIR)/inside-secure/eip197_minifw/ipue.bin \ + $(1)/lib/firmware/inside-secure/eip197_minifw +endef +$(eval $(call BuildPackage,eip197-mini-firmware)) diff --git a/package/kernel/lantiq/ltq-vmmc/Makefile b/package/kernel/lantiq/ltq-vmmc/Makefile index 99263cce43..def676b833 100644 --- a/package/kernel/lantiq/ltq-vmmc/Makefile +++ b/package/kernel/lantiq/ltq-vmmc/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=drv_vmmc PKG_VERSION:=1.9.0 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_HASH:=707f515eb727c032418c4da67d7e86884bb56cdc2a606e8f6ded6057d8767e57 @@ -170,7 +170,7 @@ endef define KernelPackage/ltq-vmmc/install $(INSTALL_DIR) $(1)/etc/init.d $(1)/$(FW_DIR) $(INSTALL_BIN) ./files/vmmc.init $(1)/etc/init.d/vmmc - $(CP) $(PKG_BUILD_DIR)/firmware/$(FW_SOURCE) $(1)/$(FW_DIR)/$(FW_TARGET) + $(INSTALL_DATA) $(PKG_BUILD_DIR)/firmware/$(FW_SOURCE) $(1)/$(FW_DIR)/$(FW_TARGET) ln -s /$(FW_DIR)/$(FW_TARGET) $(1)/$(FW_DIR)/$(FW_TARGET_GENERIC) $(CP) $(PKG_BUILD_DIR)/coef/$(COEF_SRC) $(1)/$(FW_DIR)/$(COEF_TARGET) $(CP) $(PKG_BUILD_DIR)/coef/$(COEF_SRC_FXO) $(1)/$(FW_DIR)/$(COEF_TARGET_FXO) diff --git a/package/kernel/lantiq/ltq-vmmc/files/vmmc.init b/package/kernel/lantiq/ltq-vmmc/files/vmmc.init index 100a97dc45..402376e294 100644 --- a/package/kernel/lantiq/ltq-vmmc/files/vmmc.init +++ b/package/kernel/lantiq/ltq-vmmc/files/vmmc.init @@ -5,15 +5,9 @@ START=31 start() { - [ ! -c /dev/vmmc10 ] && { - mknod /dev/vmmc10 c 122 10 - mknod /dev/vmmc11 c 122 11 - mknod /dev/vmmc12 c 122 12 - mknod /dev/vmmc13 c 122 13 - mknod /dev/vmmc14 c 122 14 - mknod /dev/vmmc15 c 122 15 - mknod /dev/vmmc16 c 122 16 - mknod /dev/vmmc17 c 122 17 - mknod /dev/vmmc18 c 122 18 - } + for i in 10 11 12 13 14 15 16 17 18; do + if ! [ -e /dev/vmmc$i ]; then + mknod -m 664 /dev/vmmc$i c 122 $i + fi + done } diff --git a/package/kernel/linux/modules/block.mk b/package/kernel/linux/modules/block.mk index faea5cc34e..fbd3c81911 100644 --- a/package/kernel/linux/modules/block.mk +++ b/package/kernel/linux/modules/block.mk @@ -276,9 +276,9 @@ define KernelPackage/iscsi-initiator DEPENDS:=+kmod-scsi-core +kmod-crypto-hash KCONFIG:= \ CONFIG_INET \ - CONFIG_SCSI_LOWLEVEL \ + CONFIG_SCSI_LOWLEVEL=y \ CONFIG_ISCSI_TCP \ - CONFIG_SCSI_ISCSI_ATTRS + CONFIG_SCSI_ISCSI_ATTRS=y FILES:= \ $(LINUX_DIR)/drivers/scsi/iscsi_tcp.ko \ $(LINUX_DIR)/drivers/scsi/libiscsi.ko \ diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index 9001721792..48777764a8 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -377,7 +377,7 @@ $(eval $(call KernelPackage,crypto-hw-padlock)) define KernelPackage/crypto-hw-safexcel TITLE:= MVEBU SafeXcel Crypto Engine module - DEPENDS:=@!LINUX_4_14 @(TARGET_mvebu_cortexa53||TARGET_mvebu_cortexa72) \ + DEPENDS:=@!LINUX_4_14 @(TARGET_mvebu_cortexa53||TARGET_mvebu_cortexa72) +eip197-mini-firmware \ +kmod-crypto-authenc +kmod-crypto-md5 +kmod-crypto-hmac +kmod-crypto-sha256 +kmod-crypto-sha512 KCONFIG:= \ CONFIG_CRYPTO_HW=y \ @@ -392,9 +392,11 @@ MVEBU's EIP97 and EIP197 Cryptographic Engine driver designed by Inside Secure. This is found on Marvell Armada 37xx/7k/8k SoCs. Particular version of these IP (EIP197B and EIP197D) require firmware. -Unfortunately it's not freely available and needs signed Non-Disclosure -Agreement (NDA) with Marvell. For those who have signed NDA the firmware can be -obtained at https://extranet.marvell.com. +The mini firmware package provides limited functionality, for most operations +a full-featured firmware is required. Unfortunately the "full" firmware is not +freely available and needs signed Non-Disclosure Agreement (NDA) with Marvell. +For those who have signed NDA the firmware can be obtained at +https://extranet.marvell.com. endef $(eval $(call KernelPackage,crypto-hw-safexcel)) diff --git a/package/kernel/linux/modules/lib.mk b/package/kernel/linux/modules/lib.mk index e14c6b31c0..1289cc1f25 100644 --- a/package/kernel/linux/modules/lib.mk +++ b/package/kernel/linux/modules/lib.mk @@ -147,7 +147,6 @@ define KernelPackage/lib-lz4 SUBMENU:=$(LIB_MENU) TITLE:=LZ4 support DEPENDS:=+kmod-crypto-acompress - HIDDEN:=1 KCONFIG:= \ CONFIG_CRYPTO_LZ4 \ CONFIG_LZ4_COMPRESS \ diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index 15d67b4679..6eb9404837 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -732,6 +732,23 @@ endef $(eval $(call KernelPackage,rtc-rx8025)) +define KernelPackage/rtc-s35390a + SUBMENU:=$(OTHER_MENU) + TITLE:=Seico S-35390A + DEFAULT:=m if ALL_KMODS && RTC_SUPPORT + DEPENDS:=+kmod-i2c-core + KCONFIG:=CONFIG_RTC_DRV_S35390A \ + CONFIG_RTC_CLASS=y + FILES:=$(LINUX_DIR)/drivers/rtc/rtc-s35390a.ko + AUTOLOAD:=$(call AutoLoad,50,rtc-s35390a,1) +endef + +define KernelPackage/rtc-s35390a/description + Kernel module for Seiko Instruments S-35390A I2C RTC chip +endef + +$(eval $(call KernelPackage,rtc-s35390a)) + define KernelPackage/mtdtests SUBMENU:=$(OTHER_MENU) @@ -913,15 +930,14 @@ $(eval $(call KernelPackage,ikconfig)) define KernelPackage/zram SUBMENU:=$(OTHER_MENU) TITLE:=ZRAM - DEPENDS:=+kmod-lib-lzo +kmod-lib-lz4 + DEPENDS:=+kmod-lib-lzo KCONFIG:= \ CONFIG_ZSMALLOC \ CONFIG_ZRAM \ CONFIG_ZRAM_DEBUG=n \ CONFIG_PGTABLE_MAPPING=n \ CONFIG_ZRAM_WRITEBACK=n \ - CONFIG_ZSMALLOC_STAT=n \ - CONFIG_ZRAM_LZ4_COMPRESS=y + CONFIG_ZSMALLOC_STAT=n FILES:= \ $(LINUX_DIR)/mm/zsmalloc.ko \ $(LINUX_DIR)/drivers/block/zram/zram.ko diff --git a/package/kernel/mac80211/patches/rt2x00/002-rt2x00-define-RF5592-in-init_eeprom-routine.patch b/package/kernel/mac80211/patches/rt2x00/002-rt2x00-define-RF5592-in-init_eeprom-routine.patch new file mode 100644 index 0000000000..a50a195285 --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/002-rt2x00-define-RF5592-in-init_eeprom-routine.patch @@ -0,0 +1,51 @@ +From patchwork Thu Dec 27 14:05:26 2018 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 8bit +X-Patchwork-Submitter: Tom Psyborg +X-Patchwork-Id: 10743707 +X-Patchwork-Delegate: kvalo@adurom.com +From: =?utf-8?q?Tomislav_Po=C5=BEega?= +To: linux-wireless@vger.kernel.org +Cc: kvalo@codeaurora.org, hauke@hauke-m.de, nbd@nbd.name, + john@phrozen.org, sgruszka@redhat.com, daniel@makrotopia.org +Subject: [PATCH 2/2] rt2x00: define RF5592 in init_eeprom routine +Date: Thu, 27 Dec 2018 15:05:26 +0100 +Message-Id: <1545919526-4074-2-git-send-email-pozega.tomislav@gmail.com> +X-Mailer: git-send-email 1.7.0.4 +In-Reply-To: <1545919526-4074-1-git-send-email-pozega.tomislav@gmail.com> +References: <1545919526-4074-1-git-send-email-pozega.tomislav@gmail.com> +MIME-Version: 1.0 +Sender: linux-wireless-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-wireless@vger.kernel.org +X-Virus-Scanned: ClamAV using ClamSMTP + +This patch fixes following crash on Linksys EA2750 during 5GHz wifi +init: + +[ 7.955153] rt2800pci 0000:01:00.0: card - bus=0x1, slot = 0x0 irq=4 +[ 7.962259] rt2800pci 0000:01:00.0: loaded eeprom from mtd device "Factory" +[ 7.969435] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 5592, rev 0222 detected +[ 7.977348] ieee80211 phy0: rt2800_init_eeprom: Error - Invalid RF chipset 0x0000 detected +[ 7.985793] ieee80211 phy0: rt2x00lib_probe_dev: Error - Failed to allocate device +[ 7.993569] CPU 0 Unable to handle kernel paging request at virtual address 00000024, epc == 800c8f54, ra == 80249ff8 +[ 8.004408] Oops[#1]: + +Signed-off-by: Tomislav Požega +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -9416,6 +9416,8 @@ static int rt2800_init_eeprom(struct rt2 + rf = RF3853; + else if (rt2x00_rt(rt2x00dev, RT5350)) + rf = RF5350; ++ else if (rt2x00_rt(rt2x00dev, RT5592)) ++ rf = RF5592; + else + rf = rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RF_TYPE); + diff --git a/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch b/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch index 5f60b60d95..039c6f6afc 100644 --- a/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch +++ b/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch @@ -8,7 +8,7 @@ #include "rt2x00.h" #include "rt2800lib.h" -@@ -9528,6 +9529,17 @@ static int rt2800_init_eeprom(struct rt2 +@@ -9530,6 +9531,17 @@ static int rt2800_init_eeprom(struct rt2 rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC); rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY); diff --git a/package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch index 88ce5ec529..20452cd8a7 100644 --- a/package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch +++ b/package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch @@ -76,7 +76,7 @@ Signed-off-by: Tomislav Po=C5=BEega bbp = rt2800_bbp_read(rt2x00dev, 4); rt2x00_set_field8(&bbp, BBP4_BANDWIDTH, 2 * conf_is_ht40(conf)); rt2800_bbp_write(rt2x00dev, 4, bbp); -@@ -9557,7 +9596,8 @@ static int rt2800_init_eeprom(struct rt2 +@@ -9559,7 +9598,8 @@ static int rt2800_init_eeprom(struct rt2 */ eeprom = rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1); @@ -86,7 +86,7 @@ Signed-off-by: Tomislav Po=C5=BEega if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_TX0_PA_3352)) __set_bit(CAPABILITY_EXTERNAL_PA_TX0, -@@ -9568,6 +9608,18 @@ static int rt2800_init_eeprom(struct rt2 +@@ -9570,6 +9610,18 @@ static int rt2800_init_eeprom(struct rt2 &rt2x00dev->cap_flags); } diff --git a/package/lean/mt-drivers/mt7615d/config.in b/package/lean/mt-drivers/mt7615d/config.in index 4e25a0d658..e23296c780 100644 --- a/package/lean/mt-drivers/mt7615d/config.in +++ b/package/lean/mt-drivers/mt7615d/config.in @@ -744,7 +744,7 @@ config MTK_BAND_STEERING config MTK_LED_CONTROL_SUPPORT bool "LED Control Support" - default n + default y config MTK_WLAN_HOOK bool "WLAN hook Support" diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile index 49bf583742..025f6489e7 100644 --- a/package/libs/libubox/Makefile +++ b/package/libs/libubox/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git -PKG_MIRROR_HASH:=3d58def8e415ceda8aacfd8453813d8bf2a05991c0df0c074744639ab04321ba -PKG_SOURCE_DATE:=2020-05-25 -PKG_SOURCE_VERSION:=66195aee50424cbda0c2d858014e4cc58a2dc029 +PKG_MIRROR_HASH:=cb941cd33f43b38ef1a1f2b4fd212e0bb21c100dcdd2ab1976f8cc2071566d32 +PKG_SOURCE_DATE:=2020-07-11 +PKG_SOURCE_VERSION:=f4e9bf73ac5c0ee6b8f240e2a2100e70ca56d705 CMAKE_INSTALL:=1 PKG_LICENSE:=ISC diff --git a/package/libs/lzo/Makefile b/package/libs/lzo/Makefile index 1ae2f3ce05..3ce5f53349 100644 --- a/package/libs/lzo/Makefile +++ b/package/libs/lzo/Makefile @@ -9,19 +9,20 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lzo PKG_VERSION:=2.10 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.oberhumer.com/opensource/lzo/download/ PKG_HASH:=c0f892943208266f9b6543b3ae308fab6284c5c90e627931446fb49b4221a072 -PKG_FIXUP:=autoreconf -PKG_INSTALL:=1 -PKG_LICENSE:=GPL-2.0+ +PKG_LICENSE:=GPL-2.0-or-later +PKG_LICENSE_FILES:=COPYING PKG_BUILD_PARALLEL:=1 +CMAKE_BINARY_SUBDIR:=openwrt-build include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk define Package/liblzo SECTION:=libs @@ -36,17 +37,18 @@ define Package/liblzo/description in real-time. This means it favours speed over compression ratio. endef -CONFIGURE_ARGS += \ - --enable-shared \ - --enable-static \ - -TARGET_CFLAGS += $(FPIC) -MAKE_FLAGS += CFLAGS_O="$(TARGET_CFLAGS)" +CMAKE_OPTIONS += \ + -DENABLE_SHARED=ON \ + -DENABLE_STATIC=ON \ + \ + -DBUILD_TESTING=OFF \ + -DCMAKE_SKIP_INSTALL_RPATH=ON define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig $(CP) $(PKG_INSTALL_DIR)/usr/include/lzo $(1)/usr/include/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzo2.{a,so*} $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lzo2.pc $(1)/usr/lib/pkgconfig endef define Package/liblzo/install diff --git a/package/network/utils/wireguard-tools/files/wireguard_watchdog b/package/network/utils/wireguard-tools/files/wireguard_watchdog index 5fbbeafec1..c0a5a0aa33 100644 --- a/package/network/utils/wireguard-tools/files/wireguard_watchdog +++ b/package/network/utils/wireguard-tools/files/wireguard_watchdog @@ -27,7 +27,7 @@ check_peer_activity() { config_get public_key "${cfg}" "public_key" config_get endpoint_host "${cfg}" "endpoint_host" config_get endpoint_port "${cfg}" "endpoint_port" - persistent_keepalive=`wg show ${iface} persistent-keepalive | grep ${public_key} | awk '{print $2}'` + persistent_keepalive=$(wg show ${iface} persistent-keepalive | grep ${public_key} | awk '{print $2}') # only process peers with endpoints and keepalive set [ -z ${endpoint_host} ] && return 0; @@ -42,16 +42,16 @@ check_peer_activity() { [ -n "${IPV4}" -o -n "${IPV6}" ] && return 0; # re-resolve endpoint hostname if not responding for too long - last_handshake=`wg show ${iface} latest-handshakes | grep ${public_key} | awk '{print $2}'` + last_handshake=$(wg show ${iface} latest-handshakes | grep ${public_key} | awk '{print $2}') [ -z ${last_handshake} ] && return 0; - idle_seconds=$((`date +%s`-${last_handshake})) + idle_seconds=$(($(date +%s)-${last_handshake})) [ ${idle_seconds} -lt 150 ] && return 0; logger -t "wireguard_monitor" "${iface} endpoint ${endpoint_host}:${endpoint_port} is not responding for ${idle_seconds} seconds, trying to re-resolve hostname" wg set ${iface} peer ${public_key} endpoint "${endpoint_host}:${endpoint_port}" } # query ubus for all active wireguard interfaces -wg_ifaces=`ubus -S call network.interface dump | jsonfilter -e '@.interface[@.up=true]' | jsonfilter -a -e '@[@.proto="wireguard"].interface' | tr "\n" " "` +wg_ifaces=$(ubus -S call network.interface dump | jsonfilter -e '@.interface[@.up=true]' | jsonfilter -a -e '@[@.proto="wireguard"].interface' | tr "\n" " ") # check every peer in every active wireguard interface config_load network diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index 5647a47326..3b88c76144 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=procd -PKG_RELEASE:=1 +PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git -PKG_SOURCE_DATE:=2020-05-28 -PKG_SOURCE_VERSION:=b9b39e2061d7035a9d84eecbb4a4613deaf6d03f -PKG_MIRROR_HASH:=0d6a96a2fb38f72c72b457a2a8638bee22f91009f9686152fcf4aee97846fc84 +PKG_SOURCE_DATE:=2020-07-11 +PKG_SOURCE_VERSION:=3034eaf5ceebc3b8d8461680a2cd3c61e796fc7d +PKG_MIRROR_HASH:=2f8f84c273bda817dcb0513c0d3304af98662c3eb26c9bf266da4508db04011d CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 @@ -70,6 +70,14 @@ define Package/procd-seccomp TITLE:=OpenWrt process seccomp helper + utrace endef +define Package/uxc + SECTION:=base + CATEGORY:=Base system + DEPENDS:=+procd-ujail +libubus +libubox +libblobmsg-json + TITLE:=OpenWrt container management + MAINTAINER:=Daniel Golle +endef + define Package/procd/config menu "Configuration" depends on PACKAGE_procd @@ -130,7 +138,19 @@ define Package/procd-seccomp/install $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-trace.so $(1)/lib endef +define Package/uxc/conffiles +/etc/uxc +endef + +define Package/uxc/install + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/uxc $(1)/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/uxc.init $(1)/etc/init.d/uxc +endef + $(eval $(call BuildPackage,procd)) $(eval $(call BuildPackage,procd-ujail)) $(eval $(call BuildPackage,procd-ujail-console)) $(eval $(call BuildPackage,procd-seccomp)) +$(eval $(call BuildPackage,uxc)) diff --git a/package/system/procd/files/uxc.init b/package/system/procd/files/uxc.init new file mode 100644 index 0000000000..035c8b0b9e --- /dev/null +++ b/package/system/procd/files/uxc.init @@ -0,0 +1,18 @@ +#!/bin/sh /etc/rc.common + +START=99 +USE_PROCD=1 +NAME=uxc +PROG=/sbin/uxc + +start_service() { + [ "${__BOOT_UXC}" = "1" ] || return 0 + procd_open_instance "uxc" + procd_set_param command "$PROG" boot + procd_close_instance +} + +boot() { + __BOOT_UXC=1 + start +} diff --git a/package/system/zram-swap/Makefile b/package/system/zram-swap/Makefile index ee5e85927f..a6661ce5e9 100644 --- a/package/system/zram-swap/Makefile +++ b/package/system/zram-swap/Makefile @@ -18,7 +18,7 @@ include $(INCLUDE_DIR)/package.mk define Package/zram-swap SECTION:=utils CATEGORY:=Base system - DEPENDS:=+kmod-zram +!(BUSYBOX_DEFAULT_MKSWAP||BUSYBOX_CONFIG_MKSWAP):swap-utils +!((BUSYBOX_DEFAULT_SWAPON||BUSYBOX_CONFIG_SWAPON)&&(BUSYBOX_DEFAULT_SWAPOFF||BUSYBOX_CONFIG_SWAPOFF)):block-mount + DEPENDS:=+kmod-zram +!(BUSYBOX_CONFIG_MKSWAP&&BUSYBOX_CONFIG_SWAPON&&BUSYBOX_CONFIG_SWAPOFF):swap-utils TITLE:=ZRAM swap scripts PKGARCH:=all endef diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init index c855bbc087..a6126e578f 100755 --- a/package/system/zram-swap/files/zram.init +++ b/package/system/zram-swap/files/zram.init @@ -182,7 +182,7 @@ start() zram_comp_streams "$zram_dev" echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename "$zram_dev" )/disksize" mkswap "$zram_dev" - swapon $zram_priority "$zram_dev" + swapon -d $zram_priority "$zram_dev" } stop() diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in index 91c9b9b5b9..29724041f4 100644 --- a/package/utils/busybox/Config-defaults.in +++ b/package/utils/busybox/Config-defaults.in @@ -24,7 +24,7 @@ config BUSYBOX_DEFAULT_FEATURE_VERBOSE_USAGE default y config BUSYBOX_DEFAULT_FEATURE_COMPRESS_USAGE bool - default y + default n config BUSYBOX_DEFAULT_LFS bool default y @@ -303,7 +303,7 @@ config BUSYBOX_DEFAULT_FEATURE_SKIP_ROOTFS default n config BUSYBOX_DEFAULT_MONOTONIC_SYSCALL bool - default n + default y config BUSYBOX_DEFAULT_IOCTL_HEX2STR_ERROR bool default y diff --git a/rules.mk b/rules.mk index 66ddea2883..e734b4a582 100644 --- a/rules.mk +++ b/rules.mk @@ -298,6 +298,9 @@ ifneq ($(CONFIG_CCACHE),) TARGET_CXX:= ccache_cxx HOSTCC:= ccache $(HOSTCC) HOSTCXX:= ccache $(HOSTCXX) + export CCACHE_BASEDIR:=$(TOPDIR) + export CCACHE_DIR:=$(if $(call qstrip,$(CONFIG_CCACHE_DIR)),$(call qstrip,$(CONFIG_CCACHE_DIR)),$(TOPDIR)/.ccache) + export CCACHE_COMPILERCHECK:=%compiler% -dumpmachine; %compiler% -dumpversion endif TARGET_CONFIGURE_OPTS = \ diff --git a/scripts/env b/scripts/env index 7bfca58c5d..726a354b57 100755 --- a/scripts/env +++ b/scripts/env @@ -22,7 +22,7 @@ Commands: Options: EOF - exit ${1:-1} + exit "${1:-1}" } error() { @@ -42,7 +42,7 @@ ask_bool() { local VAL echo -n "$* ($defstr): " - read VAL + read -r VAL case "$VAL" in y*|Y*) val=0;; n*|N*) val=1;; @@ -57,7 +57,7 @@ env_init() { if [ -z "$CREATE" ]; then [ -d "$ENVDIR" ] || exit 0 fi - [ -x "$(which git 2>/dev/null)" ] || error "Git is not installed" + command -v git || error "Git is not installed" mkdir -p "$ENVDIR" || error "Failed to create the environment directory" cd "$ENVDIR" || error "Failed to switch to the environment directory" [ -d .git ] || { @@ -73,7 +73,7 @@ env_init() { } env_sync_data() { - [ \! -L "$BASEDIR/.config" ] && [ -f "$BASEDIR/.config" ] && mv "$BASEDIR/.config" "$ENVDIR" + [ ! -L "$BASEDIR/.config" ] && [ -f "$BASEDIR/.config" ] && mv "$BASEDIR/.config" "$ENVDIR" git add . git add -u } @@ -147,7 +147,7 @@ env_clear() { else rm -rf "$BASEDIR/files" "$BASEDIR/.config" fi - cd "$BASEDIR" + cd "$BASEDIR" || exit 1 rm -rf "$ENVDIR" } @@ -195,7 +195,7 @@ env_new() { git checkout -b "$1" "$from" if [ -f "$BASEDIR/.config" ] || [ -d "$BASEDIR/files" ]; then if ask_bool 1 "Do you want to start your configuration repository with the current configuration?"; then - if [ -d "$BASEDIR/files" ] && [ \! -L "$BASEDIR/files" ]; then + if [ -d "$BASEDIR/files" ] && [ ! -L "$BASEDIR/files" ]; then mkdir -p "$ENVDIR/files" shopt -s dotglob mv "$BASEDIR/files/"* "$ENVDIR/files/" 2>/dev/null diff --git a/scripts/gen_image_generic.sh b/scripts/gen_image_generic.sh index 53f73dc6e1..17888eac60 100755 --- a/scripts/gen_image_generic.sh +++ b/scripts/gen_image_generic.sh @@ -1,10 +1,10 @@ -#!/usr/bin/env bash +#!/bin/sh # Copyright (C) 2006-2012 OpenWrt.org set -e -x -[ $# == 5 -o $# == 6 ] || { +if [ $# -ne 5 ] && [ $# -ne 6 ]; then echo "SYNTAX: $0 []" exit 1 -} +fi OUTPUT="$1" KERNELSIZE="$2" @@ -17,10 +17,9 @@ rm -f "$OUTPUT" head=16 sect=63 -cyl=$(( (KERNELSIZE + ROOTFSSIZE) * 1024 * 1024 / (head * sect * 512))) # create partition table -set $(ptgen -o "$OUTPUT" -h $head -s $sect ${GUID:+-g} -p ${KERNELSIZE}m -p ${ROOTFSSIZE}m ${ALIGN:+-l $ALIGN} ${SIGNATURE:+-S 0x$SIGNATURE} ${GUID:+-G $GUID}) +set $(ptgen -o "$OUTPUT" -h $head -s $sect ${GUID:+-g} -p "${KERNELSIZE}m" -p "${ROOTFSSIZE}m" ${ALIGN:+-l $ALIGN} ${SIGNATURE:+-S 0x$SIGNATURE} ${GUID:+-G $GUID}) KERNELOFFSET="$(($1 / 512))" KERNELSIZE="$2" @@ -31,8 +30,8 @@ ROOTFSSIZE="$(($4 / 512))" dd if="$ROOTFSIMAGE" of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" conv=notrunc if [ -n "$GUID" ]; then - [ -n "$PADDING" ] && dd if=/dev/zero of="$OUTPUT" bs=512 seek="$(($ROOTFSOFFSET + $ROOTFSSIZE))" conv=notrunc count="$sect" - mkfs.fat -n kernel -C "$OUTPUT.kernel" -S 512 "$(($KERNELSIZE / 1024))" + [ -n "$PADDING" ] && dd if=/dev/zero of="$OUTPUT" bs=512 seek="$((ROOTFSOFFSET + ROOTFSSIZE))" conv=notrunc count="$sect" + mkfs.fat -n kernel -C "$OUTPUT.kernel" -S 512 "$((KERNELSIZE / 1024))" mcopy -s -i "$OUTPUT.kernel" "$KERNELDIR"/* ::/ else make_ext4fs -J -L kernel -l "$KERNELSIZE" "$OUTPUT.kernel" "$KERNELDIR" diff --git a/scripts/mkits.sh b/scripts/mkits.sh index 32a978e18d..468ef670e6 100755 --- a/scripts/mkits.sh +++ b/scripts/mkits.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # # Licensed under the terms of the GNU GPL License version 2 or later. # @@ -15,18 +15,19 @@ # usage() { - echo "Usage: $(basename $0) -A arch -C comp -a addr -e entry" \ - "-v version -k kernel [-D name -d dtb] -o its_file" - echo -e "\t-A ==> set architecture to 'arch'" - echo -e "\t-C ==> set compression type 'comp'" - echo -e "\t-c ==> set config name 'config'" - echo -e "\t-a ==> set load address to 'addr' (hex)" - echo -e "\t-e ==> set entry point to 'entry' (hex)" - echo -e "\t-v ==> set kernel version to 'version'" - echo -e "\t-k ==> include kernel image 'kernel'" - echo -e "\t-D ==> human friendly Device Tree Blob 'name'" - echo -e "\t-d ==> include Device Tree Blob 'dtb'" - echo -e "\t-o ==> create output file 'its_file'" + printf "Usage: %s -A arch -C comp -a addr -e entry" "$(basename "$0")" + printf " -v version -k kernel [-D name -d dtb] -o its_file" + + printf "\n\t-A ==> set architecture to 'arch'" + printf "\n\t-C ==> set compression type 'comp'" + printf "\n\t-c ==> set config name 'config'" + printf "\n\t-a ==> set load address to 'addr' (hex)" + printf "\n\t-e ==> set entry point to 'entry' (hex)" + printf "\n\t-v ==> set kernel version to 'version'" + printf "\n\t-k ==> include kernel image 'kernel'" + printf "\n\t-D ==> human friendly Device Tree Blob 'name'" + printf "\n\t-d ==> include Device Tree Blob 'dtb'" + printf "\n\t-o ==> create output file 'its_file'\n" exit 1 } @@ -43,7 +44,7 @@ do k ) KERNEL=$OPTARG;; o ) OUTPUT=$OPTARG;; v ) VERSION=$OPTARG;; - * ) echo "Invalid option passed to '$0' (options:$@)" + * ) echo "Invalid option passed to '$0' (options:$*)" usage;; esac done @@ -55,7 +56,7 @@ if [ -z "${ARCH}" ] || [ -z "${COMPRESS}" ] || [ -z "${LOAD_ADDR}" ] || \ usage fi -ARCH_UPPER=$(echo $ARCH | tr '[:lower:]' '[:upper:]') +ARCH_UPPER=$(echo "$ARCH" | tr '[:lower:]' '[:upper:]') # Conditionally create fdt information if [ -n "${DTB}" ]; then @@ -115,4 +116,4 @@ ${FDT_NODE} };" # Write .its file to disk -echo "$DATA" > ${OUTPUT} +echo "$DATA" > "${OUTPUT}" diff --git a/target/linux/ath79/dts/qca9533_dlink_dap-1330-a1.dts b/target/linux/ath79/dts/qca9533_dlink_dap-1330-a1.dts new file mode 100644 index 0000000000..3ec36ad9dd --- /dev/null +++ b/target/linux/ath79/dts/qca9533_dlink_dap-1330-a1.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9533_dlink_dap-13xx.dtsi" + +/ { + compatible = "dlink,dap-1330-a1", "qca,qca9533"; + model = "D-Link DAP-1330 A1"; +}; diff --git a/target/linux/ath79/dts/qca9533_dlink_dap-1365-a1.dts b/target/linux/ath79/dts/qca9533_dlink_dap-1365-a1.dts new file mode 100644 index 0000000000..3b153740c6 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_dlink_dap-1365-a1.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9533_dlink_dap-13xx.dtsi" + +/ { + compatible = "dlink,dap-1365-a1", "qca,qca9533"; + model = "D-Link DAP-1365 A1"; +}; diff --git a/target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi b/target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi new file mode 100644 index 0000000000..8823312d08 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi @@ -0,0 +1,127 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include + +#include "qca953x.dtsi" + +/ { + aliases { + led-boot = &led_power; + led-failsafe = &led_status; + led-running = &led_power; + led-upgrade = &led_status; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "d-link:green:power"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + led_status: status { + label = "d-link:red:status"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + rssilow { + label = "d-link:red:rssilow"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + rssimediumlow { + label = "d-link:green:rssimediumlow"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + rssimediumhigh { + label = "d-link:green:rssimediumhigh"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + rssihigh { + label = "d-link:green:rssihigh"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x10000>; + read-only; + }; + + art: partition@10000 { + label = "art"; + reg = <0x10000 0x10000>; + read-only; + }; + + partition@20000 { + label = "mp"; + reg = <0x20000 0x10000>; + read-only; + }; + + partition@30000 { + label = "config"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "firmware"; + reg = <0x40000 0x7c0000>; + compatible = "denx,uimage"; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +ð0 { + status = "okay"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index f3e3b758b5..f3f8742560 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -132,6 +132,14 @@ compex,wpj531-16m) devolo,magic-2-wifi) ucidef_set_led_netdev "plcw" "dLAN" "devolo:white:dlan" "eth0.1" "rx" ;; +dlink,dap-1330-a1|\ +dlink,dap-1365-a1) + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "rssilow" "RSSILOW" "d-link:red:rssilow" "wlan0" "1" "25" + ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "d-link:green:rssimediumlow" "wlan0" "1" "100" + ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "d-link:green:rssimediumhigh" "wlan0" "51" "100" + ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "d-link:green:rssihigh" "wlan0" "76" "100" + ;; dlink,dir-859-a1) ucidef_set_led_switch "internet" "WAN" "$boardname:green:internet" "switch0" "0x20" ;; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index eb43788fce..f93d914374 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -23,6 +23,8 @@ ath79_setup_interfaces() devolo,dvl1750c|\ devolo,dvl1750i|\ devolo,dvl1750x|\ + dlink,dap-1330-a1|\ + dlink,dap-1365-a1|\ dlink,dir-505|\ engenius,ecb1750|\ enterasys,ws-ap3705i|\ @@ -386,13 +388,15 @@ ath79_setup_macs() devolo,magic-2-wifi) label_mac=$(macaddr_add "$(mtd_get_mac_binary art 0x1002)" 3) ;; - dlink,dap-2695-a1) - label_mac=$(mtd_get_mac_ascii bdcfg "wlanmac") - ;; + dlink,dap-1330-a1|\ + dlink,dap-1365-a1|\ dlink,dch-g020-a1) lan_mac=$(mtd_get_mac_text "mp" 0x1) label_mac=$lan_mac ;; + dlink,dap-2695-a1) + label_mac=$(mtd_get_mac_ascii bdcfg "wlanmac") + ;; dlink,dir-825-b1) lan_mac=$(mtd_get_mac_text "caldata" 0xffa0) wan_mac=$(mtd_get_mac_text "caldata" 0xffb4) diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index cf582b8465..8ea23a8ac6 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -17,6 +17,8 @@ case "$board" in adtran,bsap1840) macaddr_add "$(mtd_get_mac_binary 'Board data' 2)" $(($PHYNBR * 8 + 1)) > /sys${DEVPATH}/macaddress ;; + dlink,dap-1330-a1|\ + dlink,dap-1365-a1|\ dlink,dch-g020-a1) mtd_get_mac_text "mp" 0x13 > /sys${DEVPATH}/macaddress ;; diff --git a/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration b/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration index 23a9c8282f..0f68209c9b 100644 --- a/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration +++ b/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration @@ -8,6 +8,13 @@ case "$board" in arduino,yun) migrate_leds "arduino:=yun:" ;; +dlink,dap-1330-a1) + migrate_leds ":red:power=:red:status" \ + ":red:wifi=:red:rssilow" \ + ":green:wifi=:green:rssimediumlow" \ + ":green:signal1=:green:rssimediumhigh" \ + ":green:signal2=:green:rssihigh" + ;; engenius,epg5000) migrate_leds ":wlan-2g=:wlan2g" ":wlan-5g=:wlan5g" ;; diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 46a8705b85..8dc16983e1 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -565,6 +565,33 @@ define Device/devolo_magic-2-wifi endef TARGET_DEVICES += devolo_magic-2-wifi +define Device/dlink_dap-13xx + SOC := qca9533 + DEVICE_VENDOR := D-Link + DEVICE_PACKAGES += rssileds + IMAGE_SIZE := 7936k + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | check-size | mkdapimg2 0xE0000 +endef + +define Device/dlink_dap-1330-a1 + $(Device/dlink_dap-13xx) + DEVICE_MODEL := DAP-1330 + DEVICE_VARIANT := A1 + DAP_SIGNATURE := HONEYBEE-FIRMWARE-DAP-1330 + SUPPORTED_DEVICES += dap-1330-a1 +endef +TARGET_DEVICES += dlink_dap-1330-a1 + +define Device/dlink_dap-1365-a1 + $(Device/dlink_dap-13xx) + DEVICE_MODEL := DAP-1365 + DEVICE_VARIANT := A1 + DAP_SIGNATURE := HONEYBEE-FIRMWARE-DAP-1365 +endef +TARGET_DEVICES += dlink_dap-1365-a1 + define Device/dlink_dap-2695-a1 SOC := qca9558 DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct diff --git a/target/linux/ath79/image/tiny-tp-link.mk b/target/linux/ath79/image/tiny-tp-link.mk index 0da712c5d4..128ed9882e 100644 --- a/target/linux/ath79/image/tiny-tp-link.mk +++ b/target/linux/ath79/image/tiny-tp-link.mk @@ -443,7 +443,7 @@ define Device/tplink_tl-wr941-v2 TPLINK_HWREV := 2 SUPPORTED_DEVICES += tl-wr941nd endef -TARGET_DEVICES += tplink_tl-wr941-v2 +#TARGET_DEVICES += tplink_tl-wr941-v2 define Device/tplink_tl-wr941-v4 $(Device/tplink-4m) diff --git a/target/linux/bcm27xx/bcm2708/config-5.4 b/target/linux/bcm27xx/bcm2708/config-5.4 index df69d191ce..1f3fbbdf3a 100644 --- a/target/linux/bcm27xx/bcm2708/config-5.4 +++ b/target/linux/bcm27xx/bcm2708/config-5.4 @@ -393,7 +393,6 @@ CONFIG_USB=y CONFIG_USB_ANNOUNCE_NEW_DEVICES=y CONFIG_USB_COMMON=y CONFIG_USB_DWCOTG=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_NET_DRIVERS=y CONFIG_USB_NET_SMSC95XX=y CONFIG_USB_STORAGE=y diff --git a/target/linux/bcm27xx/bcm2709/config-5.4 b/target/linux/bcm27xx/bcm2709/config-5.4 index 0e3170746c..2d4e438ced 100644 --- a/target/linux/bcm27xx/bcm2709/config-5.4 +++ b/target/linux/bcm27xx/bcm2709/config-5.4 @@ -501,7 +501,6 @@ CONFIG_USB=y CONFIG_USB_ANNOUNCE_NEW_DEVICES=y CONFIG_USB_COMMON=y CONFIG_USB_DWCOTG=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_LAN78XX=y CONFIG_USB_NET_DRIVERS=y CONFIG_USB_NET_SMSC95XX=y diff --git a/target/linux/bcm27xx/bcm2710/config-5.4 b/target/linux/bcm27xx/bcm2710/config-5.4 index 60bdd25901..aa9be56ca2 100644 --- a/target/linux/bcm27xx/bcm2710/config-5.4 +++ b/target/linux/bcm27xx/bcm2710/config-5.4 @@ -578,7 +578,6 @@ CONFIG_USB=y CONFIG_USB_ANNOUNCE_NEW_DEVICES=y CONFIG_USB_COMMON=y CONFIG_USB_DWCOTG=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_LAN78XX=y CONFIG_USB_NET_DRIVERS=y CONFIG_USB_NET_SMSC95XX=y diff --git a/target/linux/bcm27xx/bcm2711/config-5.4 b/target/linux/bcm27xx/bcm2711/config-5.4 index 0463dcdebf..935a06fb72 100644 --- a/target/linux/bcm27xx/bcm2711/config-5.4 +++ b/target/linux/bcm27xx/bcm2711/config-5.4 @@ -588,7 +588,6 @@ CONFIG_USB=y CONFIG_USB_ANNOUNCE_NEW_DEVICES=y CONFIG_USB_COMMON=y CONFIG_USB_DWCOTG=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_PCI=y CONFIG_USB_STORAGE=y CONFIG_USB_SUPPORT=y diff --git a/target/linux/bcm63xx/dts/bcm6328-nucom-r5010un-v2.dts b/target/linux/bcm63xx/dts/bcm6328-nucom-r5010un-v2.dts index 639cef3a7e..365a4552f2 100644 --- a/target/linux/bcm63xx/dts/bcm6328-nucom-r5010un-v2.dts +++ b/target/linux/bcm63xx/dts/bcm6328-nucom-r5010un-v2.dts @@ -94,20 +94,20 @@ #address-cells = <1>; #size-cells = <1>; - cfe@0 { + partition@0 { reg = <0x000000 0x010000>; label = "cfe"; read-only; }; - linux@10000 { - reg = <0x010000 0x7e0000>; + partition@10000 { + reg = <0x010000 0xfe0000>; label = "linux"; compatible = "brcm,bcm963xx-imagetag"; }; - nvram@7f0000 { - reg = <0x7f0000 0x010000>; + partition@ff0000 { + reg = <0xff0000 0x010000>; label = "nvram"; }; }; diff --git a/target/linux/generic/hack-5.4/902-debloat_proc.patch b/target/linux/generic/hack-5.4/902-debloat_proc.patch index 07ee52af44..a05822cbdd 100644 --- a/target/linux/generic/hack-5.4/902-debloat_proc.patch +++ b/target/linux/generic/hack-5.4/902-debloat_proc.patch @@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau --- a/fs/locks.c +++ b/fs/locks.c -@@ -2989,6 +2989,8 @@ static const struct seq_operations locks +@@ -2992,6 +2992,8 @@ static const struct seq_operations locks static int __init proc_locks_init(void) { diff --git a/target/linux/generic/hack-5.4/904-debloat_dma_buf.patch b/target/linux/generic/hack-5.4/904-debloat_dma_buf.patch index 4221e6a035..9c7c3c2c24 100644 --- a/target/linux/generic/hack-5.4/904-debloat_dma_buf.patch +++ b/target/linux/generic/hack-5.4/904-debloat_dma_buf.patch @@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau selftest.o \ --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c -@@ -1299,4 +1299,5 @@ static void __exit dma_buf_deinit(void) +@@ -1295,4 +1295,5 @@ static void __exit dma_buf_deinit(void) dma_buf_uninit_debugfs(); kern_unmount(dma_buf_mnt); } diff --git a/target/linux/generic/pending-5.4/350-MIPS-Add-missing-EHB-in-mtc0-mfc0-sequence-for-DSPen.patch b/target/linux/generic/pending-5.4/350-MIPS-Add-missing-EHB-in-mtc0-mfc0-sequence-for-DSPen.patch deleted file mode 100644 index 063ec0e9fb..0000000000 --- a/target/linux/generic/pending-5.4/350-MIPS-Add-missing-EHB-in-mtc0-mfc0-sequence-for-DSPen.patch +++ /dev/null @@ -1,61 +0,0 @@ -From db4603e30effd74d4adb6bcdf73072b2c06fafcd Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Fri, 3 Jul 2020 00:07:15 +0200 -Subject: [PATCH] MIPS: Add missing EHB in mtc0 -> mfc0 sequence for DSPen - -This resolves the hazard between the mtc0 in the change_c0_status() and -the mfc0 in configure_exception_vector(). Without resolving this hazard -configure_exception_vector() could read an old value and would restore -this old value again. This would revert the changes change_c0_status() -did. I checked this by printing out the read_c0_status() at the end of -per_cpu_trap_init() and the ST0_MX is not set without this patch. - -The hazard is documented in the MIPS Architecture Reference Manual Vol. -III: MIPS32/microMIPS32 Privileged Resource Architecture (MD00088), rev -6.03 table 8.1 which includes: - - Producer | Consumer | Hazard - ----------|----------|---------------------------- - mtc0 | mfc0 | any coprocessor 0 register - -I saw this hazard on an Atheros AR9344 rev 2 SoC with a MIPS 74Kc CPU. -There the change_c0_status() function would activate the DSPen by -setting ST0_MX in the c0_status register. This was reverted and then the -system got a DSP exception when the DSP registers were saved in -save_dsp() in the first process switch. The crash looks like this: - -[ 0.089999] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) -[ 0.097796] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) -[ 0.107070] Kernel panic - not syncing: Unexpected DSP exception -[ 0.113470] Rebooting in 1 seconds.. - -We saw this problem in OpenWrt only on the MIPS 74Kc based Atheros SoCs, -not on the 24Kc based SoCs. We only saw it with kernel 5.4 not with -kernel 4.19, in addition we had to use GCC 8.4 or 9.X, with GCC 8.3 it -did not happen. - -In the kernel I bisected this problem to commit 9012d011660e ("compiler: -allow all arches to enable CONFIG_OPTIMIZE_INLINING"), but when this was -reverted it also happened after commit 172dcd935c34b ("MIPS: Always -allocate exception vector for MIPSr2+"). - -Commit 0b24cae4d535 ("MIPS: Add missing EHB in mtc0 -> mfc0 sequence.") -does similar changes to a different file. I am not sure if there are -more places affected by this problem. - -Signed-off-by: Hauke Mehrtens -Cc: ---- - arch/mips/kernel/traps.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/arch/mips/kernel/traps.c -+++ b/arch/mips/kernel/traps.c -@@ -2126,6 +2126,7 @@ static void configure_status(void) - - change_c0_status(ST0_CU|ST0_MX|ST0_RE|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX, - status_set); -+ back_to_back_c0_hazard(); - } - - unsigned int hwrena; diff --git a/target/linux/ipq40xx/config-4.19 b/target/linux/ipq40xx/config-4.19 index 43c363be6b..0459372941 100644 --- a/target/linux/ipq40xx/config-4.19 +++ b/target/linux/ipq40xx/config-4.19 @@ -497,7 +497,6 @@ CONFIG_UEVENT_HELPER_PATH="" CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y CONFIG_VDSO=y diff --git a/target/linux/ipq40xx/config-5.4 b/target/linux/ipq40xx/config-5.4 index 33551a95e7..7900c9c04c 100644 --- a/target/linux/ipq40xx/config-5.4 +++ b/target/linux/ipq40xx/config-5.4 @@ -530,7 +530,6 @@ CONFIG_UNWINDER_ARM=y # CONFIG_UNWINDER_FRAME_POINTER is not set CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y CONFIG_VDSO=y diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index 65946d7ac5..529a8d9f39 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -37,7 +37,7 @@ linksys,ea7500-v1) linksys,ea8500) hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr) ucidef_add_switch "switch0" \ - "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" + "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0" ucidef_set_interface_macaddr "lan" "$hw_mac_addr" ucidef_set_interface_macaddr "wan" "$hw_mac_addr" ;; diff --git a/target/linux/ipq806x/config-4.19 b/target/linux/ipq806x/config-4.19 index 750057fd34..bdbfca1501 100644 --- a/target/linux/ipq806x/config-4.19 +++ b/target/linux/ipq806x/config-4.19 @@ -493,7 +493,6 @@ CONFIG_UEVENT_HELPER_PATH="" CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y CONFIG_VDSO=y diff --git a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts index b052ca6fcb..fc4d64453f 100644 --- a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts +++ b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts @@ -292,6 +292,7 @@ 0x00004 0x7600000 /* PAD0_MODE */ 0x00008 0x1000000 /* PAD5_MODE */ 0x0000c 0x80 /* PAD6_MODE */ + 0x00010 0x2613a0 /* PWS_REG */ 0x000e4 0x6a545 /* MAC_POWER_SEL */ 0x000e0 0xc74164de /* SGMII_CTRL */ 0x0007c 0x4e /* PORT0_STATUS */ diff --git a/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts b/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts index 0e4563a961..7110f8943a 100644 --- a/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts +++ b/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts @@ -279,6 +279,7 @@ 0x00004 0x7600000 /* PAD0_MODE */ 0x00008 0x1000000 /* PAD5_MODE */ 0x0000c 0x80 /* PAD6_MODE */ + 0x00010 0x2613a0 /* PWS_REG */ 0x000e4 0x6a545 /* MAC_POWER_SEL */ 0x000e0 0xc74164de /* SGMII_CTRL */ 0x0007c 0x4e /* PORT0_STATUS */ diff --git a/target/linux/kirkwood/base-files/etc/board.d/02_network b/target/linux/kirkwood/base-files/etc/board.d/02_network index a86c57117d..658ce13346 100755 --- a/target/linux/kirkwood/base-files/etc/board.d/02_network +++ b/target/linux/kirkwood/base-files/etc/board.d/02_network @@ -11,6 +11,9 @@ board_config_update board=$(board_name) case "$board" in +"checkpoint,l-50") + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5 lan6 lan7 lan8 dmz" "eth0" + ;; "cisco,on100") ucidef_set_interface_lan "eth0 eth1" ;; diff --git a/target/linux/kirkwood/base-files/etc/board.d/03_gpio_switches b/target/linux/kirkwood/base-files/etc/board.d/03_gpio_switches new file mode 100755 index 0000000000..046f8d4d20 --- /dev/null +++ b/target/linux/kirkwood/base-files/etc/board.d/03_gpio_switches @@ -0,0 +1,18 @@ +#!/bin/sh + +. /lib/functions/uci-defaults.sh + +board_config_update + +board=$(board_name) + +case "$board" in +checkpoint,l-50) + ucidef_add_gpio_switch "mpcie-rst" "mPCIE Card reset" "502" "1" + ucidef_add_gpio_switch "exp-card-rst" "Express Card reset" "497" "1" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/kirkwood/base-files/lib/preinit/07_set_iface_mac b/target/linux/kirkwood/base-files/lib/preinit/07_set_iface_mac new file mode 100644 index 0000000000..75e9e886d9 --- /dev/null +++ b/target/linux/kirkwood/base-files/lib/preinit/07_set_iface_mac @@ -0,0 +1,25 @@ +. /lib/functions.sh +. /lib/functions/system.sh + +preinit_set_mac_address() { + local mac + + case $(board_name) in + checkpoint,l-50) + mac=$(mtd_get_mac_ascii bootldr-env lan1_mac_addr) + + ip link set dev lan1 address $mac 2>/dev/null + ip link set dev lan2 address $(macaddr_add $mac 1) 2>/dev/null + ip link set dev lan3 address $(macaddr_add $mac 2) 2>/dev/null + ip link set dev lan4 address $(macaddr_add $mac 3) 2>/dev/null + ip link set dev lan5 address $(macaddr_add $mac 4) 2>/dev/null + ip link set dev lan6 address $(macaddr_add $mac 5) 2>/dev/null + ip link set dev lan7 address $(macaddr_add $mac 6) 2>/dev/null + ip link set dev lan8 address $(macaddr_add $mac 7) 2>/dev/null + ip link set dev dmz address $(macaddr_add $mac 8) 2>/dev/null + ip link set dev dsl address $(macaddr_add $mac 9) 2>/dev/null + ;; + esac +} + +boot_hook_add preinit_main preinit_set_mac_address diff --git a/target/linux/kirkwood/config-5.4 b/target/linux/kirkwood/config-5.4 index 5529bf89df..61efa07d91 100644 --- a/target/linux/kirkwood/config-5.4 +++ b/target/linux/kirkwood/config-5.4 @@ -282,6 +282,7 @@ CONFIG_PINCTRL=y CONFIG_PINCTRL_KIRKWOOD=y CONFIG_PINCTRL_MVEBU=y # CONFIG_PINCTRL_SINGLE is not set +CONFIG_PINCTRL_SX150X=y CONFIG_PLAT_ORION=y CONFIG_POWER_RESET=y CONFIG_POWER_RESET_GPIO=y diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index 8cc69195b4..ba93fffeb2 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -28,6 +28,16 @@ define Device/Default SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) $$(BOARD_NAME) endef +define Device/checkpoint_l-50 + DEVICE_VENDOR := Check Point + DEVICE_MODEL := L-50 + DEVICE_DTS := kirkwood-l-50 + DEVICE_PACKAGES := kmod-ath9k kmod-gpio-button-hotplug kmod-mvsdio \ + kmod-rtc-s35390a kmod-usb-ledtrig-usbport wpad-basic + IMAGES := sysupgrade.bin +endef +TARGET_DEVICES += checkpoint_l-50 + define Device/cisco_on100 DEVICE_VENDOR := Cisco Systems DEVICE_MODEL := ON100 diff --git a/target/linux/kirkwood/patches-5.4/001-ARM-dts-kirkwood-Add-Check-Point-L-50-board.patch b/target/linux/kirkwood/patches-5.4/001-ARM-dts-kirkwood-Add-Check-Point-L-50-board.patch new file mode 100644 index 0000000000..52caee7b40 --- /dev/null +++ b/target/linux/kirkwood/patches-5.4/001-ARM-dts-kirkwood-Add-Check-Point-L-50-board.patch @@ -0,0 +1,485 @@ +From efa968c18abab78c5e0c40a853caf286c3629a59 Mon Sep 17 00:00:00 2001 +From: Pawel Dembicki +Date: Tue, 17 Mar 2020 21:28:01 +0100 +Subject: [PATCH v3] ARM: dts: kirkwood: Add Check Point L-50 board + +This patch adds dts for the Check Point L-50 from 600/1100 series +routers. + +Specification: +-CPU: Marvell Kirkwood 88F6821 1200MHz +-RAM: 512MB +-Flash: NAND 512MB +-WiFi: mPCIe card based on Atheros AR9287 b/g/n +-WAN: 1 Gigabit Port (Marvell 88E1116R PHY) +-LAN: 9 Gigabit Ports (2x Marvell 88E6171(5+3)) +-USB: 2x USB2.0 +-Express card slot +-SD card slot +-Serial console: RJ-45 115200 8n1 +-Unsupported DSL + +Reviewed-by: Andrew Lunn +Signed-off-by: Pawel Dembicki +--- +Changes in v3: +- fix typo and code style issues pointed by OpenWrt guys +Changes in v2: +- none + + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/kirkwood-l-50.dts | 438 ++++++++++++++++++++++++++++ + 2 files changed, 439 insertions(+) + create mode 100644 arch/arm/boot/dts/kirkwood-l-50.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -270,6 +270,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ + kirkwood-iomega_ix2_200.dtb \ + kirkwood-is2.dtb \ + kirkwood-km_kirkwood.dtb \ ++ kirkwood-l-50.dtb \ + kirkwood-laplug.dtb \ + kirkwood-linkstation-lsqvl.dtb \ + kirkwood-linkstation-lsvl.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/kirkwood-l-50.dts +@@ -0,0 +1,438 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Check Point L-50 Board Description ++ * Copyright 2020 Pawel Dembicki ++ */ ++ ++/dts-v1/; ++ ++#include "kirkwood.dtsi" ++#include "kirkwood-6281.dtsi" ++ ++/ { ++ model = "Check Point L-50"; ++ compatible = "checkpoint,l-50", "marvell,kirkwood-88f6281", "marvell,kirkwood"; ++ ++ memory { ++ device_type = "memory"; ++ reg = <0x00000000 0x20000000>; ++ }; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200n8"; ++ stdout-path = &uart0; ++ }; ++ ++ ocp@f1000000 { ++ pinctrl: pin-controller@10000 { ++ pinctrl-0 = <&pmx_led38 &pmx_sysrst &pmx_button29>; ++ pinctrl-names = "default"; ++ ++ pmx_sysrst: pmx-sysrst { ++ marvell,pins = "mpp6"; ++ marvell,function = "sysrst"; ++ }; ++ ++ pmx_button29: pmx_button29 { ++ marvell,pins = "mpp29"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_led38: pmx_led38 { ++ marvell,pins = "mpp38"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_sdio_cd: pmx-sdio-cd { ++ marvell,pins = "mpp46"; ++ marvell,function = "gpio"; ++ }; ++ }; ++ ++ serial@12000 { ++ status = "okay"; ++ }; ++ ++ mvsdio@90000 { ++ status = "okay"; ++ cd-gpios = <&gpio1 14 9>; ++ }; ++ ++ i2c@11000 { ++ status = "okay"; ++ clock-frequency = <400000>; ++ ++ gpio2: gpio-expander@20{ ++ #gpio-cells = <2>; ++ #interrupt-cells = <2>; ++ compatible = "semtech,sx1505q"; ++ reg = <0x20>; ++ ++ gpio-controller; ++ }; ++ ++ /* Three GPIOs from 0x21 exp. are undescribed in dts: ++ * 1: DSL module reset (active low) ++ * 5: mPCIE reset (active low) ++ * 6: Express card reset (active low) ++ */ ++ gpio3: gpio-expander@21{ ++ #gpio-cells = <2>; ++ #interrupt-cells = <2>; ++ compatible = "semtech,sx1505q"; ++ reg = <0x21>; ++ ++ gpio-controller; ++ }; ++ ++ rtc@30 { ++ compatible = "s35390a"; ++ reg = <0x30>; ++ }; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ status_green { ++ label = "l-50:green:status"; ++ gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; ++ }; ++ ++ status_red { ++ label = "l-50:red:status"; ++ gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wifi { ++ label = "l-50:green:wifi"; ++ gpios = <&gpio2 7 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "phy0tpt"; ++ }; ++ ++ internet_green { ++ label = "l-50:green:internet"; ++ gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; ++ }; ++ ++ internet_red { ++ label = "l-50:red:internet"; ++ gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; ++ }; ++ ++ usb1_green { ++ label = "l-50:green:usb1"; ++ gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "usbport"; ++ trigger-sources = <&hub_port3>; ++ }; ++ ++ usb1_red { ++ label = "l-50:red:usb1"; ++ gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; ++ }; ++ ++ usb2_green { ++ label = "l-50:green:usb2"; ++ gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "usbport"; ++ trigger-sources = <&hub_port1>; ++ }; ++ ++ usb2_red { ++ label = "l-50:red:usb2"; ++ gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ usb2_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb2_pwr"; ++ ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ gpio = <&gpio3 3 GPIO_ACTIVE_LOW>; ++ regulator-always-on; ++ }; ++ ++ usb1_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb1_pwr"; ++ ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ gpio = <&gpio3 4 GPIO_ACTIVE_LOW>; ++ regulator-always-on; ++ }; ++ ++ mpcie_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "mpcie_pwr"; ++ ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ gpio = <&gpio3 5 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-always-on; ++ }; ++ ++ express_card_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "express_card_pwr"; ++ ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ gpio = <&gpio3 7 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-always-on; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ factory_defaults { ++ label = "factory_defaults"; ++ gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; ++ linux,code = ; ++ }; ++ }; ++}; ++ ++&mdio { ++ status = "okay"; ++ ++ ethphy8: ethernet-phy@8 { ++ reg = <0x08>; ++ }; ++ ++ switch0: switch@10 { ++ compatible = "marvell,mv88e6085"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x10>; ++ dsa,member = <0 0>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan5"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan6"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan2"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan7"; ++ }; ++ ++ switch0port5: port@5 { ++ reg = <5>; ++ phy-mode = "rgmii-txid"; ++ link = <&switch1port5>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ label = "cpu"; ++ phy-mode = "rgmii-id"; ++ ethernet = <ð1port>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++ }; ++ ++ switch@11 { ++ compatible = "marvell,mv88e6085"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x11>; ++ dsa,member = <0 1>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan3"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan8"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan4"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "dmz"; ++ }; ++ ++ switch1port5: port@5 { ++ reg = <5>; ++ phy-mode = "rgmii-txid"; ++ link = <&switch0port5>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ label = "dsl"; ++ fixed-link { ++ speed = <100>; ++ full-duplex; ++ }; ++ }; ++ }; ++ }; ++}; ++ ++ð0 { ++ status = "okay"; ++ ethernet0-port@0 { ++ phy-handle = <ðphy8>; ++ }; ++}; ++ ++ð1 { ++ status = "okay"; ++ ethernet1-port@0 { ++ speed = <1000>; ++ duplex = <1>; ++ }; ++}; ++ ++&nand { ++ status = "okay"; ++ pinctrl-0 = <&pmx_nand>; ++ pinctrl-names = "default"; ++ ++ partition@0 { ++ label = "u-boot"; ++ reg = <0x00000000 0x000c0000>; ++ }; ++ ++ partition@a0000 { ++ label = "bootldr-env"; ++ reg = <0x000c0000 0x00040000>; ++ }; ++ ++ partition@100000 { ++ label = "kernel-1"; ++ reg = <0x00100000 0x00800000>; ++ }; ++ ++ partition@900000 { ++ label = "rootfs-1"; ++ reg = <0x00900000 0x07100000>; ++ }; ++ ++ partition@7a00000 { ++ label = "kernel-2"; ++ reg = <0x07a00000 0x00800000>; ++ }; ++ ++ partition@8200000 { ++ label = "rootfs-2"; ++ reg = <0x08200000 0x07100000>; ++ }; ++ ++ partition@f300000 { ++ label = "default_sw"; ++ reg = <0x0f300000 0x07900000>; ++ }; ++ ++ partition@16c00000 { ++ label = "logs"; ++ reg = <0x16c00000 0x01800000>; ++ }; ++ ++ partition@18400000 { ++ label = "preset_cfg"; ++ reg = <0x18400000 0x00100000>; ++ }; ++ ++ partition@18500000 { ++ label = "adsl"; ++ reg = <0x18500000 0x00100000>; ++ }; ++ ++ partition@18600000 { ++ label = "storage"; ++ reg = <0x18600000 0x07a00000>; ++ }; ++}; ++ ++&rtc { ++ status = "disabled"; ++}; ++ ++&pciec { ++ status = "okay"; ++}; ++ ++&pcie0 { ++ status = "okay"; ++}; ++ ++&sata_phy0 { ++ status = "disabled"; ++}; ++ ++&sata_phy1 { ++ status = "disabled"; ++}; ++ ++&usb0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ port@1 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <1>; ++ #trigger-source-cells = <0>; ++ ++ hub_port1: port@1 { ++ reg = <1>; ++ #trigger-source-cells = <0>; ++ }; ++ ++ hub_port3: port@3 { ++ reg = <3>; ++ #trigger-source-cells = <0>; ++ }; ++ }; ++}; diff --git a/target/linux/kirkwood/patches-5.4/111-l-50.patch b/target/linux/kirkwood/patches-5.4/111-l-50.patch new file mode 100644 index 0000000000..b1679885ad --- /dev/null +++ b/target/linux/kirkwood/patches-5.4/111-l-50.patch @@ -0,0 +1,47 @@ +--- a/arch/arm/boot/dts/kirkwood-l-50.dts ++++ b/arch/arm/boot/dts/kirkwood-l-50.dts +@@ -18,6 +18,13 @@ + reg = <0x00000000 0x20000000>; + }; + ++ aliases { ++ led-boot = &led_status_green; ++ led-failsafe = &led_status_red; ++ led-running = &led_status_green; ++ led-upgrade = &led_status_red; ++ }; ++ + chosen { + bootargs = "console=ttyS0,115200n8"; + stdout-path = &uart0; +@@ -95,12 +102,12 @@ + leds { + compatible = "gpio-leds"; + +- status_green { ++ led_status_green: status_green { + label = "l-50:green:status"; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + }; + +- status_red { ++ led_status_red: status_red { + label = "l-50:red:status"; + gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; + }; +@@ -349,13 +356,8 @@ + }; + + partition@100000 { +- label = "kernel-1"; +- reg = <0x00100000 0x00800000>; +- }; +- +- partition@900000 { +- label = "rootfs-1"; +- reg = <0x00900000 0x07100000>; ++ label = "ubi"; ++ reg = <0x00100000 0x07900000>; + }; + + partition@7a00000 { diff --git a/target/linux/lantiq/ase/config-4.19 b/target/linux/lantiq/ase/config-4.19 index 0c211847d2..da9c1bc294 100644 --- a/target/linux/lantiq/ase/config-4.19 +++ b/target/linux/lantiq/ase/config-4.19 @@ -19,7 +19,6 @@ CONFIG_SOC_AMAZON_SE=y # CONFIG_SOC_XWAY is not set CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/lantiq/ase/config-5.4 b/target/linux/lantiq/ase/config-5.4 index 455cd54d10..9b6dd41a14 100644 --- a/target/linux/lantiq/ase/config-5.4 +++ b/target/linux/lantiq/ase/config-5.4 @@ -22,7 +22,6 @@ CONFIG_SOC_AMAZON_SE=y CONFIG_TARGET_ISA_REV=1 CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi index 5f8392ca44..6c30a91553 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi @@ -112,7 +112,7 @@ ð0 { pinctrl-0 = <&mdio_pins>, - <&gphy0_led0_pins>, <&gphy0_led2_pins>, + <&gphy0_led1_pins>, <&gphy0_led2_pins>, <&gphy1_led1_pins>, <&gphy1_led2_pins>; pinctrl-names = "default"; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi index 5f8392ca44..6c30a91553 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi @@ -112,7 +112,7 @@ ð0 { pinctrl-0 = <&mdio_pins>, - <&gphy0_led0_pins>, <&gphy0_led2_pins>, + <&gphy0_led1_pins>, <&gphy0_led2_pins>, <&gphy1_led1_pins>, <&gphy1_led2_pins>; pinctrl-names = "default"; diff --git a/target/linux/lantiq/patches-5.4/0024-MIPS-lantiq-revert-DSA-switch-driver-PMU-clock-chang.patch b/target/linux/lantiq/patches-5.4/0024-MIPS-lantiq-revert-DSA-switch-driver-PMU-clock-chang.patch index a364d6d67b..9b326c50d1 100644 --- a/target/linux/lantiq/patches-5.4/0024-MIPS-lantiq-revert-DSA-switch-driver-PMU-clock-chang.patch +++ b/target/linux/lantiq/patches-5.4/0024-MIPS-lantiq-revert-DSA-switch-driver-PMU-clock-chang.patch @@ -30,8 +30,8 @@ Signed-off-by: Mathias Kresin + clkdev_add_pmu("1e108000.eth", NULL, 0, 0, PMU_SWITCH | PMU_PPE_DP | PMU_PPE_TC); clkdev_add_pmu("1da00000.usif", "NULL", 1, 0, PMU_USIF); -- clkdev_add_pmu("1e108000.gswip", "gphy0", 0, 0, PMU_GPHY); -- clkdev_add_pmu("1e108000.gswip", "gphy1", 0, 0, PMU_GPHY); +- clkdev_add_pmu("1e108000.switch", "gphy0", 0, 0, PMU_GPHY); +- clkdev_add_pmu("1e108000.switch", "gphy1", 0, 0, PMU_GPHY); + clkdev_add_pmu("1f203020.gphy", NULL, 1, 0, PMU_GPHY); + clkdev_add_pmu("1f203068.gphy", NULL, 1, 0, PMU_GPHY); clkdev_add_pmu("1e103100.deu", NULL, 1, 0, PMU_DEU); @@ -46,8 +46,8 @@ Signed-off-by: Mathias Kresin PMU_SWITCH | PMU_PPE_DPLUS | PMU_PPE_DPLUM | PMU_PPE_EMA | PMU_PPE_TC | PMU_PPE_SLL01 | PMU_PPE_QSB | PMU_PPE_TOP); -- clkdev_add_pmu("1e108000.gswip", "gphy0", 0, 0, PMU_GPHY); -- clkdev_add_pmu("1e108000.gswip", "gphy1", 0, 0, PMU_GPHY); +- clkdev_add_pmu("1e108000.switch", "gphy0", 0, 0, PMU_GPHY); +- clkdev_add_pmu("1e108000.switch", "gphy1", 0, 0, PMU_GPHY); + clkdev_add_pmu("1f203020.gphy", NULL, 0, 0, PMU_GPHY); + clkdev_add_pmu("1f203068.gphy", NULL, 0, 0, PMU_GPHY); clkdev_add_pmu("1e103000.sdio", NULL, 1, 0, PMU_SDIO); diff --git a/target/linux/lantiq/xrx200/config-4.19 b/target/linux/lantiq/xrx200/config-4.19 index c9451ec363..1c506f8ae7 100644 --- a/target/linux/lantiq/xrx200/config-4.19 +++ b/target/linux/lantiq/xrx200/config-4.19 @@ -83,7 +83,6 @@ CONFIG_UBIFS_FS_LZO=y CONFIG_UBIFS_FS_ZLIB=y CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_XPS=y CONFIG_XRX200_PHY_FW=y diff --git a/target/linux/lantiq/xrx200/config-5.4 b/target/linux/lantiq/xrx200/config-5.4 index b3749b927a..7fc008b5c5 100644 --- a/target/linux/lantiq/xrx200/config-5.4 +++ b/target/linux/lantiq/xrx200/config-5.4 @@ -89,7 +89,6 @@ CONFIG_UBIFS_FS_ZLIB=y CONFIG_UBIFS_FS_ZSTD=y CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_XPS=y CONFIG_XRX200_PHY_FW=y diff --git a/target/linux/lantiq/xway/config-4.19 b/target/linux/lantiq/xway/config-4.19 index 6075cec522..34cd84267a 100644 --- a/target/linux/lantiq/xway/config-4.19 +++ b/target/linux/lantiq/xway/config-4.19 @@ -41,7 +41,6 @@ CONFIG_UBIFS_FS_LZO=y CONFIG_UBIFS_FS_ZLIB=y CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/lantiq/xway/config-5.4 b/target/linux/lantiq/xway/config-5.4 index 16e9de8f95..b0ce4a9043 100644 --- a/target/linux/lantiq/xway/config-5.4 +++ b/target/linux/lantiq/xway/config-5.4 @@ -43,5 +43,4 @@ CONFIG_UBIFS_FS_LZO=y # CONFIG_UBIFS_FS_ZSTD is not set CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y diff --git a/target/linux/lantiq/xway_legacy/config-4.19 b/target/linux/lantiq/xway_legacy/config-4.19 index c4042f147f..ad949bdf8b 100644 --- a/target/linux/lantiq/xway_legacy/config-4.19 +++ b/target/linux/lantiq/xway_legacy/config-4.19 @@ -29,7 +29,6 @@ CONFIG_RTL8367B_PHY=y CONFIG_RTL8367_PHY=y CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/lantiq/xway_legacy/config-5.4 b/target/linux/lantiq/xway_legacy/config-5.4 index 1d1c2f187c..2ce37051de 100644 --- a/target/linux/lantiq/xway_legacy/config-5.4 +++ b/target/linux/lantiq/xway_legacy/config-5.4 @@ -31,7 +31,6 @@ CONFIG_RTL8367_PHY=y CONFIG_SGL_ALLOC=y CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/layerscape/Makefile b/target/linux/layerscape/Makefile index 476297a678..c5b27ad0c7 100644 --- a/target/linux/layerscape/Makefile +++ b/target/linux/layerscape/Makefile @@ -18,6 +18,7 @@ endef include $(INCLUDE_DIR)/target.mk -DEFAULT_PACKAGES += kmod-usb3 kmod-usb-dwc3 kmod-usb-storage +DEFAULT_PACKAGES += kmod-usb3 kmod-usb-dwc3 kmod-usb-storage \ + partx-utils $(eval $(call BuildTarget)) diff --git a/target/linux/layerscape/base-files/lib/preinit/02_sysinfo_fixup b/target/linux/layerscape/base-files/lib/preinit/02_sysinfo_fixup new file mode 100644 index 0000000000..1bbd8efbc6 --- /dev/null +++ b/target/linux/layerscape/base-files/lib/preinit/02_sysinfo_fixup @@ -0,0 +1,13 @@ +do_sysinfo_layerscape_fixup() { + [ -e /tmp/sysinfo/board_name ] || return + [ -e /proc/cmdline ] || return + cmdline=$(strings /proc/cmdline) + case "${cmdline}" in + *root=/dev/mmcblk*) + board="$(strings /tmp/sysinfo/board_name)-sdboot" + echo ${board} > /tmp/sysinfo/board_name + ;; + esac +} + +boot_hook_add preinit_main do_sysinfo_layerscape_fixup diff --git a/target/linux/layerscape/base-files/lib/upgrade/platform.sh b/target/linux/layerscape/base-files/lib/upgrade/platform.sh index 1e1e28987b..8a136d9439 100644 --- a/target/linux/layerscape/base-files/lib/upgrade/platform.sh +++ b/target/linux/layerscape/base-files/lib/upgrade/platform.sh @@ -1,5 +1,6 @@ # # Copyright 2015-2019 Traverse Technologies +# Copyright 2020 NXP # RAMFS_COPY_BIN="/usr/sbin/fw_printenv /usr/sbin/fw_setenv /usr/sbin/ubinfo /bin/echo" @@ -7,6 +8,85 @@ RAMFS_COPY_DATA="/etc/fw_env.config /var/lock/fw_printenv.lock" REQUIRE_IMAGE_METADATA=1 +platform_check_image_sdboot() { + local diskdev partdev diff + + export_bootdevice && export_partdevice diskdev 0 || { + echo "Unable to determine upgrade device" + return 1 + } + + # get partitions table from boot device + get_partitions "/dev/$diskdev" bootdisk + + # get partitions table from sysupgrade.bin + dd if="$1" of=/tmp/image.bs bs=512b count=1 > /dev/null 2>&1 + sync + get_partitions /tmp/image.bs image + + # compare tables + diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.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." + ask_bool 0 "Abort" && exit 1 + return 0 + fi +} +platform_do_upgrade_sdboot() { + local diskdev partdev diff + + export_bootdevice && export_partdevice diskdev 0 || { + echo "Unable to determine upgrade device" + return 1 + } + + if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then + # get partitions table from boot device + get_partitions "/dev/$diskdev" bootdisk + + # get partitions table from sysupgrade.bin + dd if="$1" of=/tmp/image.bs bs=512b count=1 > /dev/null 2>&1 + sync + get_partitions /tmp/image.bs image + + # compare tables + diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)" + else + diff=1 + fi + + if [ -n "$diff" ]; then + dd if="$1" of="/dev/$diskdev" bs=1024 count=4 > /dev/null 2>&1 + dd if="$1" of="$diskdev" bs=1024 skip=4 seek=16384 > /dev/null 2>&1 + sync + + # Separate removal and addtion is necessary; otherwise, partition 1 + # will be missing if it overlaps with the old partition 2 + partx -d - "/dev/$diskdev" + partx -a - "/dev/$diskdev" + + return 0 + fi + + # write kernel image + dd if="$1" of="$diskdev" bs=1024 skip=4 seek=16384 count=16384 > /dev/null 2>&1 + sync + + # 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..." + dd if="$1" of="/dev/$partdev" bs=512 skip="$start" count="$size" > /dev/null 2>&1 + sync + else + echo "Unable to find partition $part device, skipped." + fi + done < /tmp/partmap.image + +} platform_do_upgrade_traverse_nandubi() { bootsys=$(fw_printenv bootsys | awk -F= '{{print $2}}') newbootsys=2 @@ -24,6 +104,15 @@ platform_do_upgrade_traverse_nandubi() { nand_do_upgrade "$1" || (echo "Upgrade failed, setting bootsys ${bootsys}" && fw_setenv bootsys $bootsys) } +platform_copy_config() { + local partdev parttype=ext4 + + if export_partdevice partdev 1; then + mount -t $parttype -o rw,noatime "/dev/$partdev" /mnt + cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE" + umount /mnt + fi +} platform_check_image() { local board=$(board_name) @@ -33,7 +122,21 @@ platform_check_image() { nand_do_platform_check "traverse-ls1043" $1 return $? ;; - fsl,ls1012a-frdm) + fsl,ls1012a-frdm | \ + fsl,ls1012a-rdb | \ + fsl,ls1021a-twr | \ + fsl,ls1043a-rdb | \ + fsl,ls1046a-rdb | \ + fsl,ls1088a-rdb | \ + fsl,ls2088a-rdb) + return 0 + ;; + fsl,ls1012a-frwy-sdboot | \ + fsl,ls1021a-twr-sdboot | \ + fsl,ls1043a-rdb-sdboot | \ + fsl,ls1046a-rdb-sdboot | \ + fsl,ls1088a-rdb-sdboot) + platform_check_image_sdboot "$1" return 0 ;; *) @@ -55,10 +158,24 @@ platform_do_upgrade() { traverse,ls1043s) platform_do_upgrade_traverse_nandubi "$1" ;; - fsl,ls1012a-frdm) + fsl,ls1012a-frdm | \ + fsl,ls1012a-rdb | \ + fsl,ls1021a-twr | \ + fsl,ls1043a-rdb | \ + fsl,ls1046a-rdb | \ + fsl,ls1088a-rdb | \ + fsl,ls2088a-rdb) PART_NAME=firmware default_do_upgrade "$1" ;; + fsl,ls1012a-frwy-sdboot | \ + fsl,ls1021a-twr-sdboot | \ + fsl,ls1043a-rdb-sdboot | \ + fsl,ls1046a-rdb-sdboot | \ + fsl,ls1088a-rdb-sdboot) + platform_do_upgrade_sdboot "$1" + return 0 + ;; *) echo "Sysupgrade is not currently supported on $board" ;; diff --git a/target/linux/layerscape/image/Makefile b/target/linux/layerscape/image/Makefile index f5a5ad9980..8a38a25041 100644 --- a/target/linux/layerscape/image/Makefile +++ b/target/linux/layerscape/image/Makefile @@ -11,6 +11,9 @@ LS_SD_ROOTFSPART_OFFSET = 64 LS_SD_IMAGE_SIZE = $(shell echo $$((($(LS_SD_ROOTFSPART_OFFSET) + \ $(CONFIG_TARGET_ROOTFS_PARTSIZE)) * 1024 * 1024))) +# The limitation of flash sysupgrade.bin is 16MB kernel + 32MB rootfs +LS_SYSUPGRADE_IMAGE_SIZE = 48m + define Build/ls-clean rm -f $@ endef diff --git a/target/linux/layerscape/image/armv7.mk b/target/linux/layerscape/image/armv7.mk index e1a9efb8b6..e06c99c338 100644 --- a/target/linux/layerscape/image/armv7.mk +++ b/target/linux/layerscape/image/armv7.mk @@ -1,5 +1,5 @@ # -# Copyright 2018 NXP +# Copyright 2018-2020 NXP # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,11 +8,15 @@ define Device/Default PROFILES := Default FILESYSTEMS := squashfs - IMAGES := firmware.bin + IMAGES := firmware.bin sysupgrade.bin KERNEL := kernel-bin | uImage none KERNEL_NAME := zImage KERNEL_LOADADDR := 0x80008000 KERNEL_ENTRY_POINT := 0x80008000 + IMAGE_SIZE := 64m + IMAGE/sysupgrade.bin := append-kernel | pad-to 16M | \ + append-rootfs | pad-rootfs | \ + check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata endef define Device/ls1021atwr @@ -28,7 +32,8 @@ define Device/ls1021atwr ls-append $(1)-uboot-env.bin | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size + SUPPORTED_DEVICES := fsl,ls1021a-twr endef TARGET_DEVICES += ls1021atwr @@ -38,7 +43,7 @@ define Device/ls1021atwr-sdboot DEVICE_VARIANT := SD Card Boot DEVICE_DTS := ls1021a-twr FILESYSTEMS := ext4 - IMAGES := sdcard.img + IMAGES := sdcard.img sysupgrade.bin IMAGE/sdcard.img := \ ls-clean | \ ls-append-sdhead $(1) | pad-to 4K | \ @@ -47,6 +52,12 @@ define Device/ls1021atwr-sdboot ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) + IMAGE/sysupgrade.bin := \ + ls-clean | \ + ls-append-sdhead $(1) | pad-to 16M | \ + append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ + append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata + SUPPORTED_DEVICES := fsl,ls1021a-twr-sdboot endef TARGET_DEVICES += ls1021atwr-sdboot diff --git a/target/linux/layerscape/image/armv8_64b.mk b/target/linux/layerscape/image/armv8_64b.mk index ffc8346d24..ea17e02c52 100644 --- a/target/linux/layerscape/image/armv8_64b.mk +++ b/target/linux/layerscape/image/armv8_64b.mk @@ -1,5 +1,5 @@ # -# Copyright 2018 NXP +# Copyright 2018-2020 NXP # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -7,12 +7,15 @@ define Device/Default PROFILES := Default - IMAGES := firmware.bin - FILESYSTEMS := ubifs - MKUBIFS_OPTS := -m 1 -e 262016 -c 128 + IMAGES := firmware.bin sysupgrade.bin + FILESYSTEMS := squashfs KERNEL := kernel-bin | gzip | uImage gzip KERNEL_LOADADDR := 0x80080000 KERNEL_ENTRY_POINT := 0x80080000 + IMAGE_SIZE := 64m + IMAGE/sysupgrade.bin := append-kernel | pad-to 16M | \ + append-rootfs | pad-rootfs | \ + check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata endef define Device/ls1012afrdm @@ -24,8 +27,6 @@ define Device/ls1012afrdm kmod-ppfe DEVICE_DTS := freescale/fsl-ls1012a-frdm BLOCKSIZE := 256KiB - FILESYSTEMS := squashfs - IMAGES += sysupgrade.bin IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -34,9 +35,10 @@ define Device/ls1012afrdm ls-append pfe.itb | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $$(BLOCKSIZE) | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size IMAGE/sysupgrade.bin := append-kernel | pad-to $$(BLOCKSIZE) | \ - append-rootfs | pad-rootfs | check-size 50331648 | append-metadata + append-rootfs | pad-rootfs | \ + check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata KERNEL := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb KERNEL_INITRAMFS := kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb SUPPORTED_DEVICES := fsl,ls1012a-frdm @@ -51,9 +53,6 @@ define Device/ls1012ardb tfa-ls1012ardb \ kmod-ppfe DEVICE_DTS := freescale/fsl-ls1012a-rdb - UBINIZE_OPTS := -E 5 - BLOCKSIZE := 256KiB - PAGESIZE := 1 IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -62,7 +61,8 @@ define Device/ls1012ardb ls-append pfe.itb | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-ubi | check-size 67108865 + append-rootfs | pad-rootfs | check-size + SUPPORTED_DEVICES := fsl,ls1012a-rdb endef TARGET_DEVICES += ls1012ardb @@ -75,7 +75,7 @@ define Device/ls1012afrwy kmod-ppfe DEVICE_DTS := freescale/fsl-ls1012a-frwy FILESYSTEMS := ext4 - IMAGES := firmware.bin sdcard.img + IMAGES := firmware.bin sdcard.img sysupgrade.bin IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 128K | \ @@ -89,6 +89,12 @@ define Device/ls1012afrwy ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) + IMAGE/sysupgrade.bin := \ + ls-clean | \ + ls-append-sdhead $(1) | pad-to 16M | \ + append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ + append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata + SUPPORTED_DEVICES := fsl,ls1012a-frwy-sdboot endef TARGET_DEVICES += ls1012afrwy @@ -101,7 +107,6 @@ define Device/ls1043ardb tfa-ls1043ardb \ fmc fmc-eth-config DEVICE_DTS := freescale/fsl-ls1043a-rdb-sdk - FILESYSTEMS := squashfs IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -110,7 +115,8 @@ define Device/ls1043ardb ls-append $(1)-fman.bin | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size + SUPPORTED_DEVICES := fsl,ls1043a-rdb endef TARGET_DEVICES += ls1043ardb @@ -124,7 +130,7 @@ define Device/ls1043ardb-sdboot fmc fmc-eth-config DEVICE_DTS := freescale/fsl-ls1043a-rdb-sdk FILESYSTEMS := ext4 - IMAGES := sdcard.img + IMAGES := sdcard.img sysupgrade.bin IMAGE/sdcard.img := \ ls-clean | \ ls-append-sdhead $(1) | pad-to 4K | \ @@ -135,6 +141,12 @@ define Device/ls1043ardb-sdboot ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) + IMAGE/sysupgrade.bin := \ + ls-clean | \ + ls-append-sdhead $(1) | pad-to 16M | \ + append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ + append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata + SUPPORTED_DEVICES := fsl,ls1043a-rdb-sdboot endef TARGET_DEVICES += ls1043ardb-sdboot @@ -147,9 +159,6 @@ define Device/ls1046ardb tfa-ls1046ardb \ fmc fmc-eth-config DEVICE_DTS := freescale/fsl-ls1046a-rdb-sdk - UBINIZE_OPTS := -E 5 - BLOCKSIZE := 256KiB - PAGESIZE := 1 IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -158,7 +167,8 @@ define Device/ls1046ardb ls-append $(1)-fman.bin | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-ubi | check-size 67108865 + append-rootfs | pad-rootfs | check-size + SUPPORTED_DEVICES := fsl,ls1046a-rdb endef TARGET_DEVICES += ls1046ardb @@ -172,7 +182,7 @@ define Device/ls1046ardb-sdboot fmc fmc-eth-config DEVICE_DTS := freescale/fsl-ls1046a-rdb-sdk FILESYSTEMS := ext4 - IMAGES := sdcard.img + IMAGES := sdcard.img sysupgrade.bin IMAGE/sdcard.img := \ ls-clean | \ ls-append-sdhead $(1) | pad-to 4K | \ @@ -183,6 +193,12 @@ define Device/ls1046ardb-sdboot ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) + IMAGE/sysupgrade.bin := \ + ls-clean | \ + ls-append-sdhead $(1) | pad-to 16M | \ + append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ + append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata + SUPPORTED_DEVICES := fsl,ls1046a-rdb-sdboot endef TARGET_DEVICES += ls1046ardb-sdboot @@ -196,9 +212,6 @@ define Device/ls1088ardb tfa-ls1088ardb \ restool DEVICE_DTS := freescale/fsl-ls1088a-rdb - UBINIZE_OPTS := -E 5 - BLOCKSIZE := 256KiB - PAGESIZE := 1 IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -209,7 +222,8 @@ define Device/ls1088ardb ls-append $(1)-dpc.dtb | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-ubi | check-size 67108865 + append-rootfs | pad-rootfs | check-size + SUPPORTED_DEVICES := fsl,ls1088a-rdb endef TARGET_DEVICES += ls1088ardb @@ -224,7 +238,7 @@ define Device/ls1088ardb-sdboot restool DEVICE_DTS := freescale/fsl-ls1088a-rdb FILESYSTEMS := ext4 - IMAGES := sdcard.img + IMAGES := sdcard.img sysupgrade.bin IMAGE/sdcard.img := \ ls-clean | \ ls-append-sdhead $(1) | pad-to 4K | \ @@ -237,6 +251,12 @@ define Device/ls1088ardb-sdboot ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) + IMAGE/sysupgrade.bin := \ + ls-clean | \ + ls-append-sdhead $(1) | pad-to 16M | \ + append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ + append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata + SUPPORTED_DEVICES := fsl,ls1088a-rdb-sdboot endef TARGET_DEVICES += ls1088ardb-sdboot @@ -249,7 +269,6 @@ define Device/ls2088ardb tfa-ls2088ardb \ restool DEVICE_DTS := freescale/fsl-ls2088a-rdb - FILESYSTEMS := squashfs IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -260,7 +279,8 @@ define Device/ls2088ardb ls-append $(1)-dpc.dtb | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size + SUPPORTED_DEVICES := fsl,ls2088a-rdb endef TARGET_DEVICES += ls2088ardb @@ -272,6 +292,7 @@ define Device/traverse-ls1043 KERNEL_INSTALL := 1 FDT_LOADADDR = 0x90000000 FILESYSTEMS := ubifs + MKUBIFS_OPTS := -m 1 -e 262016 -c 128 DEVICE_PACKAGES += \ layerscape-fman \ uboot-envtools \ diff --git a/target/linux/layerscape/patches-5.4/302-v5.7-dts-0119-arm64-dts-ls1043a-rdb-add-compatible-for-board.patch b/target/linux/layerscape/patches-5.4/302-v5.7-dts-0119-arm64-dts-ls1043a-rdb-add-compatible-for-board.patch new file mode 100644 index 0000000000..3de20a1f3d --- /dev/null +++ b/target/linux/layerscape/patches-5.4/302-v5.7-dts-0119-arm64-dts-ls1043a-rdb-add-compatible-for-board.patch @@ -0,0 +1,28 @@ +From fa578d4e9fbef8928a45edd904dafb1e3334417e Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Thu, 30 Apr 2020 10:56:46 +0800 +Subject: [PATCH] arm64: dts: ls1043a-rdb: add compatible for board + +Add compatible for board to identify. + +Signed-off-by: Yangbo Lu +Signed-off-by: Shawn Guo +--- + arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts +index dde50c8..9a93e9a 100644 +--- a/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts ++++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts +@@ -13,6 +13,7 @@ + + / { + model = "LS1043A RDB Board"; ++ compatible = "fsl,ls1043a-rdb", "fsl,ls1043a"; + + aliases { + serial0 = &duart0; +-- +2.7.4 + diff --git a/target/linux/mediatek/base-files/etc/uci-defaults/99-net-ps b/target/linux/mediatek/base-files/etc/uci-defaults/99-net-ps index 596b33c5b4..15e9ef32a3 100755 --- a/target/linux/mediatek/base-files/etc/uci-defaults/99-net-ps +++ b/target/linux/mediatek/base-files/etc/uci-defaults/99-net-ps @@ -1,16 +1,5 @@ -uci set network.globals='globals' -uci set network.globals.packet_steering=1 -uci set network.eth0=device -uci set network.eth0.name=eth0 -uci set network.lan0=device -uci set network.lan0.name=lan0 -uci set network.lan1=device -uci set network.lan1.name=lan1 -uci set network.lan2=device -uci set network.lan2.name=lan2 -uci set network.lan3=device -uci set network.lan3.name=lan3 - -uci commit network - -exit 0 +uci -q get network.globals.packet_steering >/dev/null || { + uci set network.globals='globals' + uci set network.globals.packet_steering=1 + uci commit network +} diff --git a/target/linux/mediatek/image/gen_banana_pi_img.sh b/target/linux/mediatek/image/gen_banana_pi_img.sh index 26fbca1388..d46e92fa42 100755 --- a/target/linux/mediatek/image/gen_banana_pi_img.sh +++ b/target/linux/mediatek/image/gen_banana_pi_img.sh @@ -78,7 +78,7 @@ # The contents of the main eMMC are identical to the SD card layout, # with the preloader loading 512KiB of U-Boot starting at 0x50000. -function usage() { +usage() { echo "SYNTAX: $0 sd " echo " OR: $0 emmc " exit 1 diff --git a/target/linux/mediatek/mt7622/config-4.19 b/target/linux/mediatek/mt7622/config-4.19 index e102308a98..e72bff61e4 100644 --- a/target/linux/mediatek/mt7622/config-4.19 +++ b/target/linux/mediatek/mt7622/config-4.19 @@ -577,7 +577,6 @@ CONFIG_TREE_SRCU=y # CONFIG_UNMAP_KERNEL_AT_EL0 is not set CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_MTK=y diff --git a/target/linux/mediatek/mt7622/config-5.4 b/target/linux/mediatek/mt7622/config-5.4 index 1a00636968..02a8d5eaeb 100755 --- a/target/linux/mediatek/mt7622/config-5.4 +++ b/target/linux/mediatek/mt7622/config-5.4 @@ -557,7 +557,6 @@ CONFIG_TREE_SRCU=y # CONFIG_UNMAP_KERNEL_AT_EL0 is not set CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_MTK=y diff --git a/target/linux/mediatek/mt7623/config-4.19 b/target/linux/mediatek/mt7623/config-4.19 index 57c0148199..994768bb64 100644 --- a/target/linux/mediatek/mt7623/config-4.19 +++ b/target/linux/mediatek/mt7623/config-4.19 @@ -496,7 +496,6 @@ CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" CONFIG_UNINLINE_SPIN_UNLOCK=y CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_MTK=y diff --git a/target/linux/mediatek/mt7629/config-4.19 b/target/linux/mediatek/mt7629/config-4.19 index 98d67a0fbd..7bf014d151 100644 --- a/target/linux/mediatek/mt7629/config-4.19 +++ b/target/linux/mediatek/mt7629/config-4.19 @@ -357,7 +357,6 @@ CONFIG_UBIFS_FS_ZLIB=y CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_MTK=y diff --git a/target/linux/mediatek/mt7629/config-5.4 b/target/linux/mediatek/mt7629/config-5.4 index 3805eba40e..1dbf1787cb 100644 --- a/target/linux/mediatek/mt7629/config-5.4 +++ b/target/linux/mediatek/mt7629/config-5.4 @@ -362,7 +362,6 @@ CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" CONFIG_UNWINDER_ARM=y CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_MTK=y diff --git a/target/linux/mediatek/patches-5.4/0226-phy-phy-mtk-tphy-Add-hifsys-support.patch b/target/linux/mediatek/patches-5.4/0226-phy-phy-mtk-tphy-Add-hifsys-support.patch new file mode 100644 index 0000000000..f2647e8ffe --- /dev/null +++ b/target/linux/mediatek/patches-5.4/0226-phy-phy-mtk-tphy-Add-hifsys-support.patch @@ -0,0 +1,66 @@ +From 28f9a5e2a3f5441ab5594669ed82da11e32277a9 Mon Sep 17 00:00:00 2001 +From: Kristian Evensen +Date: Mon, 30 Apr 2018 14:38:01 +0200 +Subject: [PATCH] phy: phy-mtk-tphy: Add hifsys-support + +--- + drivers/phy/mediatek/phy-mtk-tphy.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +--- a/drivers/phy/mediatek/phy-mtk-tphy.c ++++ b/drivers/phy/mediatek/phy-mtk-tphy.c +@@ -15,6 +15,8 @@ + #include + #include + #include ++#include ++#include + + /* version V1 sub-banks offset base address */ + /* banks shared by multiple phys */ +@@ -263,6 +265,9 @@ + #define RG_CDR_BIRLTD0_GEN3_MSK GENMASK(4, 0) + #define RG_CDR_BIRLTD0_GEN3_VAL(x) (0x1f & (x)) + ++#define HIF_SYSCFG1 0x14 ++#define HIF_SYSCFG1_PHY2_MASK (0x3 << 20) ++ + enum mtk_phy_version { + MTK_PHY_V1 = 1, + MTK_PHY_V2, +@@ -310,6 +315,7 @@ struct mtk_tphy { + struct clk *u3phya_ref; /* reference clock of usb3 anolog phy */ + const struct mtk_phy_pdata *pdata; + struct mtk_phy_instance **phys; ++ struct regmap *hif; + int nphys; + int src_ref_clk; /* MHZ, reference clock for slew rate calibrate */ + int src_coef; /* coefficient for slew rate calibrate */ +@@ -629,6 +635,10 @@ static void pcie_phy_instance_init(struc + if (tphy->pdata->version != MTK_PHY_V1) + return; + ++ if (tphy->hif) ++ regmap_update_bits(tphy->hif, HIF_SYSCFG1, ++ HIF_SYSCFG1_PHY2_MASK, 0); ++ + tmp = readl(u3_banks->phya + U3P_U3_PHYA_DA_REG0); + tmp &= ~(P3A_RG_XTAL_EXT_PE1H | P3A_RG_XTAL_EXT_PE2H); + tmp |= P3A_RG_XTAL_EXT_PE1H_VAL(0x2) | P3A_RG_XTAL_EXT_PE2H_VAL(0x2); +@@ -1114,6 +1124,16 @@ static int mtk_tphy_probe(struct platfor + &tphy->src_ref_clk); + device_property_read_u32(dev, "mediatek,src-coef", &tphy->src_coef); + ++ if (of_find_property(np, "mediatek,phy-switch", NULL)) { ++ tphy->hif = syscon_regmap_lookup_by_phandle(np, ++ "mediatek,phy-switch"); ++ if (IS_ERR(tphy->hif)) { ++ dev_err(&pdev->dev, ++ "missing \"mediatek,phy-switch\" phandle\n"); ++ return PTR_ERR(tphy->hif); ++ } ++ } ++ + port = 0; + for_each_child_of_node(np, child_np) { + struct mtk_phy_instance *instance; diff --git a/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network b/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network index 080e32ada3..9ab3c8174d 100755 --- a/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network +++ b/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network @@ -11,7 +11,8 @@ board_config_update board=$(board_name) case "$board" in -marvell,armada8040-mcbin) +marvell,armada8040-mcbin-doubleshot|\ +marvell,armada8040-mcbin-singleshot) ucidef_set_interfaces_lan_wan "eth0 eth1 eth3" "eth2" ;; marvell,armada8040-db) diff --git a/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh index 2428de08c4..04ea634097 100755 --- a/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh +++ b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh @@ -9,7 +9,8 @@ REQUIRE_IMAGE_METADATA=1 platform_check_image() { case "$(board_name)" in - marvell,armada8040-mcbin) + marvell,armada8040-mcbin-doubleshot|\ + marvell,armada8040-mcbin-singleshot) platform_check_image_sdcard "$1" ;; *) @@ -20,7 +21,8 @@ platform_check_image() { platform_do_upgrade() { case "$(board_name)" in - marvell,armada8040-mcbin) + marvell,armada8040-mcbin-doubleshot|\ + marvell,armada8040-mcbin-singleshot) platform_do_upgrade_sdcard "$1" ;; *) @@ -30,7 +32,8 @@ platform_do_upgrade() { } platform_copy_config() { case "$(board_name)" in - marvell,armada8040-mcbin) + marvell,armada8040-mcbin-doubleshot|\ + marvell,armada8040-mcbin-singleshot) platform_copy_config_sdcard ;; esac diff --git a/target/linux/mvebu/image/cortexa72.mk b/target/linux/mvebu/image/cortexa72.mk index 50233540ed..1440c07a0b 100644 --- a/target/linux/mvebu/image/cortexa72.mk +++ b/target/linux/mvebu/image/cortexa72.mk @@ -16,14 +16,30 @@ define Device/marvell_armada8040-db endef TARGET_DEVICES += marvell_armada8040-db -define Device/marvell_macchiatobin +define Device/marvell_macchiatobin-doubleshot $(call Device/Default-arm64) DEVICE_VENDOR := SolidRun DEVICE_MODEL := MACCHIATObin + DEVICE_VARIANT := Double Shot DEVICE_ALT0_VENDOR := SolidRun DEVICE_ALT0_MODEL := Armada 8040 Community Board + DEVICE_ALT0_VARIANT := Double Shot DEVICE_PACKAGES += kmod-i2c-mux-pca954x DEVICE_DTS := armada-8040-mcbin - SUPPORTED_DEVICES := marvell,armada8040-mcbin + SUPPORTED_DEVICES := marvell,armada8040-mcbin-doubleshot marvell,armada8040-mcbin endef -TARGET_DEVICES += marvell_macchiatobin +TARGET_DEVICES += marvell_macchiatobin-doubleshot + +define Device/marvell_macchiatobin-singleshot + $(call Device/Default-arm64) + DEVICE_VENDOR := SolidRun + DEVICE_MODEL := MACCHIATObin + DEVICE_VARIANT := Single Shot + DEVICE_ALT0_VENDOR := SolidRun + DEVICE_ALT0_MODEL := Armada 8040 Community Board + DEVICE_ALT0_VARIANT := Single Shot + DEVICE_PACKAGES += kmod-i2c-mux-pca954x + DEVICE_DTS := armada-8040-mcbin-singleshot + SUPPORTED_DEVICES := marvell,armada8040-mcbin-singleshot +endef +TARGET_DEVICES += marvell_macchiatobin-singleshot diff --git a/target/linux/mvebu/patches-4.19/260-align-mcbin-compatible-with-5.4.patch b/target/linux/mvebu/patches-4.19/260-align-mcbin-compatible-with-5.4.patch new file mode 100644 index 0000000000..53e34300db --- /dev/null +++ b/target/linux/mvebu/patches-4.19/260-align-mcbin-compatible-with-5.4.patch @@ -0,0 +1,14 @@ +--- a/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts ++++ b/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts +@@ -10,8 +10,9 @@ + #include + + / { +- model = "Marvell 8040 MACCHIATOBin"; +- compatible = "marvell,armada8040-mcbin", "marvell,armada8040", ++ model = "Marvell 8040 MACCHIATOBin Double-shot"; ++ compatible = "marvell,armada8040-mcbin-doubleshot", ++ "marvell,armada8040-mcbin", "marvell,armada8040", + "marvell,armada-ap806-quad", "marvell,armada-ap806"; + + chosen { diff --git a/target/linux/octeontx/config-5.4 b/target/linux/octeontx/config-5.4 index cfb8b19e4e..bc7b46b879 100644 --- a/target/linux/octeontx/config-5.4 +++ b/target/linux/octeontx/config-5.4 @@ -577,7 +577,6 @@ CONFIG_TREE_SRCU=y CONFIG_UNMAP_KERNEL_AT_EL0=y CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_PCI=y CONFIG_USB_SUPPORT=y # CONFIG_USB_UHCI_HCD is not set diff --git a/target/linux/ramips/dts/mt7628an_netgear_r6020.dts b/target/linux/ramips/dts/mt7628an_netgear_r6020.dts new file mode 100644 index 0000000000..83a751c2f7 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_netgear_r6020.dts @@ -0,0 +1,172 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7628an.dtsi" + +#include +#include + +/ { + compatible = "netgear,r6020", "mediatek,mt7628an-soc"; + model = "Netgear R6020"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + lan { + label = "r6020:green:lan"; + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + }; + + led_power: power { + label = "r6020:green:power"; + gpios = <&gpio 43 GPIO_ACTIVE_LOW>; + }; + + wlan2g_green { + label = "r6020:green:wlan2g"; + gpios = <&gpio 42 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wlan2g_orange { + label = "r6020:orange:wlan2g"; + gpios = <&gpio 41 GPIO_ACTIVE_LOW>; + }; + + wan_green { + label = "r6020:green:wan"; + gpios = <&gpio 40 GPIO_ACTIVE_LOW>; + }; + + wan_orange { + label = "r6020:orange:wan"; + gpios = <&gpio 39 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&state_default { + gpio { + groups = "p0led_an", "p1led_an", "p2led_an", + "p3led_an", "p4led_an", "wdt", + "wled_an"; + function = "gpio"; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <86000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x20000>; + read-only; + }; + + partition@60000 { + label = "nvram"; + reg = <0x60000 0x30000>; + read-only; + }; + + partition@90000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x90000 0x6f0000>; + }; + + partition@780000 { + label = "ML"; + reg = <0x780000 0x20000>; + read-only; + }; + + partition@7a0000 { + label = "ML1"; + reg = <0x7a0000 0x20000>; + read-only; + }; + + partition@7c0000 { + label = "ML2"; + reg = <0x7c0000 0x20000>; + read-only; + }; + + partition@7e0000 { + label = "POT"; + reg = <0x7e0000 0x10000>; + read-only; + }; + + partition@7f0000 { + label = "reserved"; + reg = <0x7f0000 0x10000>; + read-only; + }; + }; + }; +}; + +&wmac { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x4>; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index 93ce59e262..3ee9828a64 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -51,11 +51,6 @@ define Build/elx-header rm -rf $(KDIR)/tmp/$(DEVICE_NAME).header endef -define Build/fonfxcimage - uimage_padhdr -i $@ -o $@.new - mv $@.new $@ -endef - define Build/jcg-header $(STAGING_DIR_HOST)/bin/jcgimage -v $(1) \ $(if $(JCG_MAXSIZE), -m $$(($(subst k, * 1024,$(JCG_MAXSIZE)))),) \ @@ -151,6 +146,11 @@ define Build/trx -a 4 -f $(IMAGE_ROOTFS) endef +define Build/uimage-padhdr + uimage_padhdr $(if $(1),-l $(1)) -i $@ -o $@.new + mv $@.new $@ +endef + define Build/umedia-header fix-u-media-header -T 0x46 -B $(1) -i $@ -o $@.new && mv $@.new $@ endef diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 9e81b81418..52c555e9a3 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -400,8 +400,8 @@ define Device/fon_fon2601 DEVICE_VENDOR := Fon DEVICE_MODEL := FON2601 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci - KERNEL_INITRAMFS := $$(KERNEL) | fonfxcimage - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | fonfxcimage | \ + KERNEL_INITRAMFS := $$(KERNEL) | uimage-padhdr + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | uimage-padhdr | \ pad-rootfs | append-metadata | check-size endef TARGET_DEVICES += fon_fon2601 diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 083b9acfcf..380d71935e 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -81,11 +81,6 @@ define Build/iodata-mstc-header ) endef -define Build/mitrastarimage - uimage_padhdr -l 160 -i $@ -o $@.new - mv $@.new $@ -endef - define Build/ubnt-erx-factory-image if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(KERNEL_SIZE)" ]; then \ echo '21001:7' > $(1).compat; \ @@ -1144,7 +1139,7 @@ define Device/zyxel_wap6805 DEVICE_VENDOR := ZyXEL DEVICE_MODEL := WAP6805 DEVICE_PACKAGES := kmod-mt7603 wpad-basic kmod-mt7621-qtn-rgmii - KERNEL := $(KERNEL_DTB) | uImage lzma | mitrastarimage + KERNEL := $(KERNEL_DTB) | uImage lzma | uimage-padhdr 160 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef TARGET_DEVICES += zyxel_wap6805 diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 310772932b..de92c982cc 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -189,6 +189,25 @@ define Device/mercury_mac1200r-v2 endef TARGET_DEVICES += mercury_mac1200r-v2 +define Device/netgear_r6020 + BLOCKSIZE := 64k + IMAGE_SIZE := 7104k + DEVICE_VENDOR := NETGEAR + DEVICE_MODEL := R6020 + DEVICE_PACKAGES := kmod-mt76x2 + SERCOMM_HWID := CFR + SERCOMM_HWVER := A001 + SERCOMM_SWVER := 0x0040 + IMAGES += factory.img + IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \ + pad-rootfs + IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | check-size + IMAGE/factory.img := pad-extra 576k | $$(IMAGE/default) | \ + pad-to $$$$(BLOCKSIZE) | sercom-footer | pad-to 128 | zip R6020.bin | \ + sercom-seal +endef +TARGET_DEVICES += netgear_r6020 + define Device/netgear_r6080 BLOCKSIZE := 64k IMAGE_SIZE := 7552k diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/set-irq-affinity b/target/linux/ramips/mt7621/base-files/etc/init.d/set-irq-affinity index 9a3afefa5a..c118d928a7 100755 --- a/target/linux/ramips/mt7621/base-files/etc/init.d/set-irq-affinity +++ b/target/linux/ramips/mt7621/base-files/etc/init.d/set-irq-affinity @@ -2,30 +2,18 @@ START=99 -get_irq() { - local name="$1" - grep -m 1 "$name" /proc/interrupts | cut -d: -f1 | sed 's, *,,' -} - -set_irq_affinity() { - local name="$1" - local val="$2" - local irq="$(get_irq "$name")" - [ -n "$irq" ] || return - echo "$val" > "/proc/irq/$irq/smp_affinity" -} - start() { if grep -q 'processor.*: 2' /proc/cpuinfo; then - mask1=4 - mask2=8 + mask=4 elif grep -q 'processor.*: 1' /proc/cpuinfo; then - mask1=2 - mask2=2 + mask=2 else return fi - set_irq_affinity mt76x2e $mask1 - set_irq_affinity mt7603e $mask2 + for irq in $(grep "mt76..e" /proc/interrupts | cut -d: -f1 | sed 's, *,,') + do + echo "$mask" > "/proc/irq/$irq/smp_affinity" + [ $mask = 4 ] && mask=8 + done } diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds index fcc6516c8d..1e478df4ef 100755 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds @@ -23,6 +23,7 @@ alfa-network,awusfree1) asus,rt-n10p-v3|\ asus,rt-n11p-b1|\ asus,rt-n12-vp-b1|\ +netgear,r6020|\ netgear,r6080|\ netgear,r6120) ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0xf" diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index ecba0ccb17..e3d18b5fba 100755 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -95,6 +95,7 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0" ;; + netgear,r6020|\ netgear,r6080|\ netgear,r6120) ucidef_add_switch "switch0" \ @@ -151,6 +152,7 @@ ramips_setup_macs() label_mac=$(mtd_get_mac_binary factory 0x4) ;; duzun,dm06|\ + netgear,r6020|\ netgear,r6080|\ netgear,r6120|\ wrtnode,wrtnode2p|\ diff --git a/target/linux/ramips/patches-5.4/0069-awake-rt305x-dwc2-controller.patch b/target/linux/ramips/patches-5.4/0069-awake-rt305x-dwc2-controller.patch index 1ce8fac682..1ce7102a4e 100644 --- a/target/linux/ramips/patches-5.4/0069-awake-rt305x-dwc2-controller.patch +++ b/target/linux/ramips/patches-5.4/0069-awake-rt305x-dwc2-controller.patch @@ -1,15 +1,15 @@ --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c -@@ -432,6 +432,12 @@ static int dwc2_driver_probe(struct plat - - hsotg->needs_byte_swap = dwc2_check_core_endianness(hsotg); +@@ -430,6 +430,12 @@ static int dwc2_driver_probe(struct plat + if (retval) + return retval; + /* Enable USB port before any regs access */ -+ if (dwc2_readl(hsotg, PCGCTL) & 0x0f) { -+ dwc2_writel(0x00, hsotg, PCGCTL); ++ if (readl(hsotg->regs + PCGCTL) & 0x0f) { ++ writel(0x00, hsotg->regs + PCGCTL); + /* TODO: mdelay(25) here? vendor driver don't use it */ + } + + hsotg->needs_byte_swap = dwc2_check_core_endianness(hsotg); + retval = dwc2_get_dr_mode(hsotg); - if (retval) - goto error; diff --git a/target/sdk/Makefile b/target/sdk/Makefile index 6d81834720..d3552b47eb 100644 --- a/target/sdk/Makefile +++ b/target/sdk/Makefile @@ -20,7 +20,7 @@ STAGING_SUBDIR_HOST := staging_dir/host STAGING_SUBDIR_TARGET := staging_dir/$(TARGET_DIR_NAME) STAGING_SUBDIR_TOOLCHAIN := staging_dir/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)_$(LIBC)$(if $(CONFIG_arm),_eabi) -EXCLUDE_DIRS:=*/ccache/* \ +EXCLUDE_DIRS:= \ */stamp \ */stampfiles \ */man \ @@ -135,11 +135,7 @@ $(BIN_DIR)/$(SDK_NAME).tar.xz: clean $(TOPDIR)/package/kernel/linux \ $(SDK_BUILD_DIR)/package/ - -rm -rf \ - $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST)/ccache \ - $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_TARGET)/ccache \ - $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_TOOLCHAIN)/ccache \ - $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST)/.prereq-build + -rm -rf $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST)/.prereq-build -rm -f $(SDK_BUILD_DIR)/feeds.conf.default $(if $(BASE_FEED),echo "$(BASE_FEED)" > $(SDK_BUILD_DIR)/feeds.conf.default) diff --git a/target/toolchain/Makefile b/target/toolchain/Makefile index ef2dc68a97..5002ff7835 100644 --- a/target/toolchain/Makefile +++ b/target/toolchain/Makefile @@ -15,7 +15,7 @@ override MAKEFLAGS= TOOLCHAIN_NAME:=$(VERSION_DIST_SANITIZED)-toolchain-$(if $(CONFIG_VERSION_FILENAMES),$(VERSION_NUMBER)-)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))_gcc-$(GCCV)$(DIR_SUFFIX).$(HOST_OS)-$(HOST_ARCH) TOOLCHAIN_BUILD_DIR:=$(BUILD_DIR)/$(TOOLCHAIN_NAME) -EXCLUDE_DIRS:=*/ccache \ +EXCLUDE_DIRS:= \ */initial \ */stamp \ */stampfiles \ diff --git a/target/toolchain/files/wrapper.sh b/target/toolchain/files/wrapper.sh index 2cbcc8c1e6..6a0cdfff6c 100755 --- a/target/toolchain/files/wrapper.sh +++ b/target/toolchain/files/wrapper.sh @@ -15,10 +15,10 @@ # PROGNAME=$0 -REALNAME=$(readlink -f $0) +REALNAME=$(readlink -f "$0") -REALNAME_BASE=$(basename $REALNAME) -REALNAME_DIR=$(dirname $REALNAME) +REALNAME_BASE=$(basename "$REALNAME") +REALNAME_DIR=$(dirname "$REALNAME") TARGET_FUNDAMENTAL_ASFLAGS='' TARGET_FUNDAMENTAL_CFLAGS='' @@ -30,7 +30,7 @@ TARGET_TOOLCHAIN_TRIPLET=${REALNAME_BASE%-*} BINARY=${PROGNAME##*-} # Parse our tool name, splitting it at '-' characters. -IFS=- read TOOLCHAIN_ARCH TOOLCHAIN_BUILDROOT TOOLCHAIN_OS TOOLCHAIN_PLATFORM PROGNAME << EOF +IFS=- read -r _ _ _ TOOLCHAIN_PLATFORM PROGNAME << EOF $REALNAME_BASE EOF @@ -71,16 +71,16 @@ esac # case $BINARY in cc|gcc|g++|c++|cpp) - exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin $GCC_SYSROOT_FLAGS $TARGET_FUNDAMENTAL_CFLAGS $TARGET_ROOTFS_CFLAGS "$@" + exec "$TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin" $GCC_SYSROOT_FLAGS $TARGET_FUNDAMENTAL_CFLAGS $TARGET_ROOTFS_CFLAGS "$@" ;; ld) - exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin $LD_SYSROOT_FLAGS $TARGET_FUNDAMENTAL_LDFLAGS "$@" + exec "$TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin" $LD_SYSROOT_FLAGS $TARGET_FUNDAMENTAL_LDFLAGS "$@" ;; as) - exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin $TARGET_FUNDAMENTAL_ASFLAGS "$@" + exec "$TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin" $TARGET_FUNDAMENTAL_ASFLAGS "$@" ;; *) - exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin "$@" + exec "$TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin" "$@" ;; esac diff --git a/toolchain/gcc/Config.in b/toolchain/gcc/Config.in index 4b2ba7aaae..1aadae6839 100644 --- a/toolchain/gcc/Config.in +++ b/toolchain/gcc/Config.in @@ -19,6 +19,9 @@ choice config GCC_USE_VERSION_9 bool "gcc 9.x" + + config GCC_USE_VERSION_10 + bool "gcc 10.x" endchoice config GCC_USE_GRAPHITE diff --git a/toolchain/gcc/Config.version b/toolchain/gcc/Config.version index 6fbc6d9804..ccc7b273fa 100644 --- a/toolchain/gcc/Config.version +++ b/toolchain/gcc/Config.version @@ -10,11 +10,16 @@ config GCC_VERSION_9 default y if GCC_USE_VERSION_9 bool +config GCC_VERSION_10 + default y if GCC_USE_VERSION_10 + bool + config GCC_VERSION string default "5.5.0" if GCC_VERSION_5 default "7.5.0" if GCC_VERSION_7 default "9.3.0" if GCC_VERSION_9 + default "10.1.0" if GCC_VERSION_10 default "8.4.0" config GCC_USE_IREMAP diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk index ec3ea8fff1..eb0ddbf2d9 100644 --- a/toolchain/gcc/common.mk +++ b/toolchain/gcc/common.mk @@ -44,6 +44,10 @@ ifeq ($(PKG_VERSION),9.3.0) PKG_HASH:=71e197867611f6054aa1119b13a0c0abac12834765fe2d81f35ac57f84f742d1 endif +ifeq ($(PKG_VERSION),10.1.0) + PKG_HASH:=b6898a23844b656f1b68691c5c012036c2e694ac4b53a8918d4712ad876e7ea2 +endif + PATCH_DIR=../patches/$(GCC_VERSION) BUGURL=http://bugs.openwrt.org/ diff --git a/toolchain/gcc/patches/10.1.0/002-case_insensitive.patch b/toolchain/gcc/patches/10.1.0/002-case_insensitive.patch new file mode 100644 index 0000000000..409497e5a3 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/002-case_insensitive.patch @@ -0,0 +1,24 @@ +commit 81cc26c706b2bc8c8c1eb1a322e5c5157900836e +Author: Felix Fietkau +Date: Sun Oct 19 21:45:51 2014 +0000 + + gcc: do not assume that the Mac OS X filesystem is case insensitive + + Signed-off-by: Felix Fietkau + + SVN-Revision: 42973 + +--- a/include/filenames.h ++++ b/include/filenames.h +@@ -44,11 +44,6 @@ extern "C" { + # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c) + # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) + #else /* not DOSish */ +-# if defined(__APPLE__) +-# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM +-# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 +-# endif +-# endif /* __APPLE__ */ + # define HAS_DRIVE_SPEC(f) (0) + # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) + # define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f) diff --git a/toolchain/gcc/patches/10.1.0/010-documentation.patch b/toolchain/gcc/patches/10.1.0/010-documentation.patch new file mode 100644 index 0000000000..9783ff1ef0 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/010-documentation.patch @@ -0,0 +1,35 @@ +commit 098bd91f5eae625c7d2ee621e10930fc4434e5e2 +Author: Luka Perkov +Date: Tue Feb 26 16:16:33 2013 +0000 + + gcc: don't build documentation + + This closes #13039. + + Signed-off-by: Luka Perkov + + SVN-Revision: 35807 + +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -3283,18 +3283,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) + doc/gccint.info: $(TEXI_GCCINT_FILES) + doc/cppinternals.info: $(TEXI_CPPINT_FILES) + +-doc/%.info: %.texi +- if [ x$(BUILD_INFO) = xinfo ]; then \ +- $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \ +- -I $(gcc_docdir)/include -o $@ $<; \ +- fi ++doc/%.info: + + # Duplicate entry to handle renaming of gccinstall.info +-doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES) +- if [ x$(BUILD_INFO) = xinfo ]; then \ +- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ +- -I $(gcc_docdir)/include -o $@ $<; \ +- fi ++doc/gccinstall.info: + + doc/cpp.dvi: $(TEXI_CPP_FILES) + doc/gcc.dvi: $(TEXI_GCC_FILES) diff --git a/toolchain/gcc/patches/10.1.0/110-Fix-MIPS-PR-84790.patch b/toolchain/gcc/patches/10.1.0/110-Fix-MIPS-PR-84790.patch new file mode 100644 index 0000000000..82ac013d30 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/110-Fix-MIPS-PR-84790.patch @@ -0,0 +1,20 @@ +Fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790. +MIPS16 functions have a static assembler prologue which clobbers +registers v0 and v1. Add these register clobbers to function call +instructions. + +--- a/gcc/config/mips/mips.c ++++ b/gcc/config/mips/mips.c +@@ -3132,6 +3132,12 @@ mips_emit_call_insn (rtx pattern, rtx or + emit_insn (gen_update_got_version ()); + } + ++ if (TARGET_MIPS16 && TARGET_USE_GOT) ++ { ++ clobber_reg (&CALL_INSN_FUNCTION_USAGE (insn), MIPS16_PIC_TEMP); ++ clobber_reg (&CALL_INSN_FUNCTION_USAGE (insn), MIPS_PROLOGUE_TEMP (word_mode)); ++ } ++ + if (TARGET_MIPS16 + && TARGET_EXPLICIT_RELOCS + && TARGET_CALL_CLOBBERED_GP) diff --git a/toolchain/gcc/patches/10.1.0/230-musl_libssp.patch b/toolchain/gcc/patches/10.1.0/230-musl_libssp.patch new file mode 100644 index 0000000000..63f37662f4 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/230-musl_libssp.patch @@ -0,0 +1,13 @@ +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -875,7 +875,9 @@ proper position among the other output f + #endif + + #ifndef LINK_SSP_SPEC +-#ifdef TARGET_LIBC_PROVIDES_SSP ++#if DEFAULT_LIBC == LIBC_MUSL ++#define LINK_SSP_SPEC "-lssp_nonshared" ++#elif defined(TARGET_LIBC_PROVIDES_SSP) + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ + "|fstack-protector-strong|fstack-protector-explicit:}" + #else diff --git a/toolchain/gcc/patches/10.1.0/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain/gcc/patches/10.1.0/300-mips_Os_cpu_rtx_cost_model.patch new file mode 100644 index 0000000000..8c4a5fce19 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/300-mips_Os_cpu_rtx_cost_model.patch @@ -0,0 +1,21 @@ +commit ecf7671b769fe96f7b5134be442089f8bdba55d2 +Author: Felix Fietkau +Date: Thu Aug 4 20:29:45 2016 +0200 + +gcc: add a patch to generate better code with Os on mips + +Also happens to reduce compressed code size a bit + +Signed-off-by: Felix Fietkau + +--- a/gcc/config/mips/mips.c ++++ b/gcc/config/mips/mips.c +@@ -20041,7 +20041,7 @@ mips_option_override (void) + flag_pcc_struct_return = 0; + + /* Decide which rtx_costs structure to use. */ +- if (optimize_size) ++ if (0 && optimize_size) + mips_cost = &mips_rtx_cost_optimize_size; + else + mips_cost = &mips_rtx_cost_data[mips_tune]; diff --git a/toolchain/gcc/patches/10.1.0/810-arm-softfloat-libgcc.patch b/toolchain/gcc/patches/10.1.0/810-arm-softfloat-libgcc.patch new file mode 100644 index 0000000000..5c9d86aead --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/810-arm-softfloat-libgcc.patch @@ -0,0 +1,33 @@ +commit 8570c4be394cff7282f332f97da2ff569a927ddb +Author: Imre Kaloz +Date: Wed Feb 2 20:06:12 2011 +0000 + + fixup arm soft-float symbols + + SVN-Revision: 25325 + +--- a/libgcc/config/arm/t-linux ++++ b/libgcc/config/arm/t-linux +@@ -1,6 +1,10 @@ + LIB1ASMSRC = arm/lib1funcs.S + LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ +- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 ++ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ ++ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ ++ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ ++ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ ++ _arm_fixsfsi _arm_fixunssfsi + + # Just for these, we omit the frame pointer since it makes such a big + # difference. +--- a/gcc/config/arm/linux-elf.h ++++ b/gcc/config/arm/linux-elf.h +@@ -58,8 +58,6 @@ + %{shared:-lc} \ + %{!shared:%{profile:-lc_p}%{!profile:-lc}}" + +-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" +- + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" + + #define LINUX_TARGET_LINK_SPEC "%{h*} \ diff --git a/toolchain/gcc/patches/10.1.0/820-libgcc_pic.patch b/toolchain/gcc/patches/10.1.0/820-libgcc_pic.patch new file mode 100644 index 0000000000..ddd6cf8732 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/820-libgcc_pic.patch @@ -0,0 +1,44 @@ +commit c96312958c0621e72c9b32da5bc224ffe2161384 +Author: Felix Fietkau +Date: Mon Oct 19 23:26:09 2009 +0000 + + gcc: create a proper libgcc_pic.a static library for relinking (4.3.3+ for now, backport will follow) + + SVN-Revision: 18086 + +--- a/libgcc/Makefile.in ++++ b/libgcc/Makefile.in +@@ -929,11 +929,12 @@ $(libgcov-driver-objects): %$(objext): $ + + # Static libraries. + libgcc.a: $(libgcc-objects) ++libgcc_pic.a: $(libgcc-s-objects) + libgcov.a: $(libgcov-objects) + libunwind.a: $(libunwind-objects) + libgcc_eh.a: $(libgcc-eh-objects) + +-libgcc.a libgcov.a libunwind.a libgcc_eh.a: ++libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a: + -rm -f $@ + + objects="$(objects)"; \ +@@ -957,7 +958,7 @@ all: libunwind.a + endif + + ifeq ($(enable_shared),yes) +-all: libgcc_eh.a libgcc_s$(SHLIB_EXT) ++all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT) + ifneq ($(LIBUNWIND),) + all: libunwind$(SHLIB_EXT) + libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) +@@ -1163,6 +1164,10 @@ install-shared: + chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a + $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a + ++ $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/ ++ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a ++ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a ++ + $(subst @multilib_dir@,$(MULTIDIR),$(subst \ + @shlib_base_name@,libgcc_s,$(subst \ + @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) diff --git a/toolchain/gcc/patches/10.1.0/840-armv4_pass_fix-v4bx_to_ld.patch b/toolchain/gcc/patches/10.1.0/840-armv4_pass_fix-v4bx_to_ld.patch new file mode 100644 index 0000000000..e3cb616c4e --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/840-armv4_pass_fix-v4bx_to_ld.patch @@ -0,0 +1,28 @@ +commit 7edc8ca5456d9743dd0075eb3cc5b04f4f24c8cc +Author: Imre Kaloz +Date: Wed Feb 2 19:34:36 2011 +0000 + + add armv4 fixup patches + + SVN-Revision: 25322 + + +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -91,10 +91,15 @@ + #define MUSL_DYNAMIC_LINKER \ + "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}%{mfdpic:-fdpic}.so.1" + ++/* For armv4 we pass --fix-v4bx to linker to support EABI */ ++#undef TARGET_FIX_V4BX_SPEC ++#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\ ++ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}" ++ + /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to + use the GNU/Linux version, not the generic BPABI version. */ + #undef LINK_SPEC +-#define LINK_SPEC EABI_LINK_SPEC \ ++#define LINK_SPEC EABI_LINK_SPEC TARGET_FIX_V4BX_SPEC \ + LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ + LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) + diff --git a/toolchain/gcc/patches/10.1.0/850-use_shared_libgcc.patch b/toolchain/gcc/patches/10.1.0/850-use_shared_libgcc.patch new file mode 100644 index 0000000000..8b17f1374f --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/850-use_shared_libgcc.patch @@ -0,0 +1,54 @@ +commit dcfc40358b5a3cae7320c17f8d1cebd5ad5540cd +Author: Felix Fietkau +Date: Sun Feb 12 20:25:47 2012 +0000 + + gcc 4.6: port over the missing patch 850-use_shared_libgcc.patch to prevent libgcc crap from leaking into every single binary + + SVN-Revision: 30486 +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -132,10 +132,6 @@ + "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \ + LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) + +-/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we +- do not use -lfloat. */ +-#undef LIBGCC_SPEC +- + /* Clear the instruction cache from `beg' to `end'. This is + implemented in lib1funcs.S, so ensure an error if this definition + is used. */ +--- a/gcc/config/linux.h ++++ b/gcc/config/linux.h +@@ -66,6 +66,10 @@ see the files COPYING3 and COPYING.RUNTI + builtin_version ("CRuntime_Musl"); \ + } while (0) + ++#ifndef LIBGCC_SPEC ++#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}" ++#endif ++ + /* Determine which dynamic linker to use depending on whether GLIBC or + uClibc or Bionic or musl is the default C library and whether + -muclibc or -mglibc or -mbionic or -mmusl has been passed to change +--- a/libgcc/mkmap-symver.awk ++++ b/libgcc/mkmap-symver.awk +@@ -136,5 +136,5 @@ function output(lib) { + else if (inherit[lib]) + printf("} %s;\n", inherit[lib]); + else +- printf ("\n local:\n\t*;\n};\n"); ++ printf ("\n\t*;\n};\n"); + } +--- a/gcc/config/rs6000/linux.h ++++ b/gcc/config/rs6000/linux.h +@@ -62,6 +62,9 @@ + #undef CPP_OS_DEFAULT_SPEC + #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)" + ++#undef LIBGCC_SPEC ++#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc" ++ + #undef LINK_SHLIB_SPEC + #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}} \ + %{static-pie:-static -pie --no-dynamic-linker -z text}" diff --git a/toolchain/gcc/patches/10.1.0/851-libgcc_no_compat.patch b/toolchain/gcc/patches/10.1.0/851-libgcc_no_compat.patch new file mode 100644 index 0000000000..d710e40717 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/851-libgcc_no_compat.patch @@ -0,0 +1,22 @@ +commit 64661de100da1ec1061ef3e5e400285dce115e6b +Author: Felix Fietkau +Date: Sun May 10 13:16:35 2015 +0000 + + gcc: add some size optimization patches + + Signed-off-by: Felix Fietkau + + SVN-Revision: 45664 + +--- a/libgcc/config/t-libunwind ++++ b/libgcc/config/t-libunwind +@@ -2,8 +2,7 @@ + + HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER + +-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \ +- $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c ++LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c + LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c + + # Override the default value from t-slibgcc-elf-ver and mention -lunwind diff --git a/toolchain/gcc/patches/10.1.0/870-ppc_no_crtsavres.patch b/toolchain/gcc/patches/10.1.0/870-ppc_no_crtsavres.patch new file mode 100644 index 0000000000..bc182f0cec --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/870-ppc_no_crtsavres.patch @@ -0,0 +1,11 @@ +--- a/gcc/config/rs6000/rs6000-logue.c ++++ b/gcc/config/rs6000/rs6000-logue.c +@@ -348,7 +348,7 @@ rs6000_savres_strategy (rs6000_stack_t * + /* Define cutoff for using out-of-line functions to save registers. */ + if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) + { +- if (!optimize_size) ++ if (1) + { + strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; + strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; diff --git a/toolchain/gcc/patches/10.1.0/881-no_tm_section.patch b/toolchain/gcc/patches/10.1.0/881-no_tm_section.patch new file mode 100644 index 0000000000..2029910fd0 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/881-no_tm_section.patch @@ -0,0 +1,11 @@ +--- a/libgcc/crtstuff.c ++++ b/libgcc/crtstuff.c +@@ -152,7 +152,7 @@ call_ ## FUNC (void) \ + #endif + + #if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) +-# define USE_TM_CLONE_REGISTRY 1 ++# define USE_TM_CLONE_REGISTRY 0 + #elif !defined(USE_TM_CLONE_REGISTRY) + # define USE_TM_CLONE_REGISTRY 0 + #endif diff --git a/toolchain/gcc/patches/10.1.0/900-bad-mips16-crt.patch b/toolchain/gcc/patches/10.1.0/900-bad-mips16-crt.patch new file mode 100644 index 0000000000..dd6e9dc889 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/900-bad-mips16-crt.patch @@ -0,0 +1,9 @@ +--- a/libgcc/config/mips/t-mips16 ++++ b/libgcc/config/mips/t-mips16 +@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16 + + # Version these symbols if building libgcc.so. + SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver ++ ++CRTSTUFF_T_CFLAGS += -mno-mips16 ++CRTSTUFF_T_CFLAGS_S += -mno-mips16 diff --git a/toolchain/gcc/patches/10.1.0/910-mbsd_multi.patch b/toolchain/gcc/patches/10.1.0/910-mbsd_multi.patch new file mode 100644 index 0000000000..452cc1cb4e --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/910-mbsd_multi.patch @@ -0,0 +1,146 @@ +commit 99368862e44740ff4fd33760893f04e14f9dbdf1 +Author: Felix Fietkau +Date: Tue Jul 31 00:52:27 2007 +0000 + + Port the mbsd_multi patch from freewrt, which adds -fhonour-copts. This will emit warnings in packages that don't use our target cflags properly + + SVN-Revision: 8256 + + This patch brings over a feature from MirBSD: + * -fhonour-copts + If this option is not given, it's warned (depending + on environment variables). This is to catch errors + of misbuilt packages which override CFLAGS themselves. + + This patch was authored by Thorsten Glaser + with copyright assignment to the FSF in effect. + +--- a/gcc/c-family/c-opts.c ++++ b/gcc/c-family/c-opts.c +@@ -107,6 +107,9 @@ static dump_flags_t original_dump_flags; + /* Whether any standard preincluded header has been preincluded. */ + static bool done_preinclude; + ++/* Check if a port honours COPTS. */ ++static int honour_copts = 0; ++ + static void handle_OPT_d (const char *); + static void set_std_cxx98 (int); + static void set_std_cxx11 (int); +@@ -455,6 +458,12 @@ c_common_handle_option (size_t scode, co + flag_no_builtin = !value; + break; + ++ case OPT_fhonour_copts: ++ if (c_language == clk_c) { ++ honour_copts++; ++ } ++ break; ++ + case OPT_fconstant_string_class_: + constant_string_class_name = arg; + break; +@@ -1168,6 +1177,47 @@ c_common_init (void) + return false; + } + ++ if (c_language == clk_c) { ++ char *ev = getenv ("GCC_HONOUR_COPTS"); ++ int evv; ++ if (ev == NULL) ++ evv = -1; ++ else if ((*ev == '0') || (*ev == '\0')) ++ evv = 0; ++ else if (*ev == '1') ++ evv = 1; ++ else if (*ev == '2') ++ evv = 2; ++ else if (*ev == 's') ++ evv = -1; ++ else { ++ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1"); ++ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */ ++ } ++ if (evv == 1) { ++ if (honour_copts == 0) { ++ error ("someone does not honour COPTS at all in lenient mode"); ++ return false; ++ } else if (honour_copts != 1) { ++ warning (0, "someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ } ++ } else if (evv == 2) { ++ if (honour_copts == 0) { ++ error ("someone does not honour COPTS at all in strict mode"); ++ return false; ++ } else if (honour_copts != 1) { ++ error ("someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ return false; ++ } ++ } else if (evv == 0) { ++ if (honour_copts != 1) ++ inform (UNKNOWN_LOCATION, "someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ } ++ } ++ + return true; + } + +--- a/gcc/c-family/c.opt ++++ b/gcc/c-family/c.opt +@@ -1590,6 +1590,9 @@ C++ ObjC++ Optimization Alias(fexception + fhonor-std + C++ ObjC++ WarnRemoved + ++fhonour-copts ++C ObjC C++ ObjC++ RejectNegative ++ + fhosted + C ObjC + Assume normal C execution environment. +--- a/gcc/common.opt ++++ b/gcc/common.opt +@@ -1657,6 +1657,9 @@ fguess-branch-probability + Common Report Var(flag_guess_branch_prob) Optimization + Enable guessing of branch probabilities. + ++fhonour-copts ++Common RejectNegative ++ + ; Nonzero means ignore `#ident' directives. 0 means handle them. + ; Generate position-independent code for executables if possible + ; On SVR4 targets, it also controls whether or not to emit a +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -8169,6 +8169,17 @@ This option is only supported for C and + @option{-Wall} and by @option{-Wpedantic}, which can be disabled with + @option{-Wno-pointer-sign}. + ++@item -fhonour-copts ++@opindex fhonour-copts ++If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not ++given at least once, and warn if it is given more than once. ++If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not ++given exactly once. ++If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option ++is not given exactly once. ++The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}. ++This flag and environment variable only affect the C language. ++ + @item -Wstack-protector + @opindex Wstack-protector + @opindex Wno-stack-protector +--- a/gcc/opts.c ++++ b/gcc/opts.c +@@ -2308,6 +2308,9 @@ common_handle_option (struct gcc_options + /* Currently handled in a prescan. */ + break; + ++ case OPT_fhonour_copts: ++ break; ++ + case OPT_Werror: + dc->warning_as_error_requested = value; + break; diff --git a/toolchain/gcc/patches/10.1.0/920-specs_nonfatal_getenv.patch b/toolchain/gcc/patches/10.1.0/920-specs_nonfatal_getenv.patch new file mode 100644 index 0000000000..487b9e47cb --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/920-specs_nonfatal_getenv.patch @@ -0,0 +1,22 @@ +Author: Jo-Philipp Wich +Date: Sat Apr 21 03:02:39 2012 +0000 + + gcc: add patch to make the getenv() spec function nonfatal if requested environment variable is unset + + SVN-Revision: 31390 + +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -9396,8 +9396,10 @@ getenv_spec_function (int argc, const ch + } + + if (!value) +- fatal_error (input_location, +- "environment variable %qs not defined", varname); ++ { ++ warning (input_location, "environment variable %qs not defined", varname); ++ value = ""; ++ } + + /* We have to escape every character of the environment variable so + they are not interpreted as active spec characters. A diff --git a/toolchain/gcc/patches/10.1.0/930-fix-mips-noexecstack.patch b/toolchain/gcc/patches/10.1.0/930-fix-mips-noexecstack.patch new file mode 100644 index 0000000000..e795acd1de --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/930-fix-mips-noexecstack.patch @@ -0,0 +1,111 @@ +From da45b3fde60095756f5f6030f6012c23a3d34429 Mon Sep 17 00:00:00 2001 +From: Andrew McDonnell +Date: Fri, 3 Oct 2014 19:09:00 +0930 +Subject: Add .note.GNU-stack section + +See http://lists.busybox.net/pipermail/uclibc/2014-October/048671.html +Below copied from https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02430.html + +Re: [Patch, MIPS] Add .note.GNU-stack section + + From: Steve Ellcey + +On Wed, 2014-09-10 at 10:15 -0700, Eric Christopher wrote: +> +> +> On Wed, Sep 10, 2014 at 9:27 AM, wrote: + +> This works except you did not update the assembly files in +> libgcc or glibc. We (Cavium) have the same patch in our tree +> for a few released versions. + +> Mind just checking yours in then Andrew? + +> Thanks! +> -eric + +I talked to Andrew about what files he changed in GCC and created and +tested this new patch. Andrew also mentioned changing some assembly +files in glibc but I don't see any use of '.section .note.GNU-stack' in +any assembly files in glibc (for any platform) so I wasn't planning on +creating a glibc to add them to mips glibc assembly language files. + +OK to check in this patch? + +Steve Ellcey +sellcey@mips.com + + + +2014-09-26 Steve Ellcey +--- + gcc/config/mips/mips.c | 3 +++ + libgcc/config/mips/crti.S | 4 ++++ + libgcc/config/mips/crtn.S | 3 +++ + libgcc/config/mips/mips16.S | 4 ++++ + libgcc/config/mips/vr4120-div.S | 4 ++++ + 5 files changed, 18 insertions(+) + +--- a/gcc/config/mips/mips.c ++++ b/gcc/config/mips/mips.c +@@ -22881,6 +22881,9 @@ mips_asm_file_end (void) + #define TARGET_ASM_FILE_END mips_asm_file_end + + ++#undef TARGET_ASM_FILE_END ++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack ++ + struct gcc_target targetm = TARGET_INITIALIZER; + + #include "gt-mips.h" +--- a/libgcc/config/mips/crti.S ++++ b/libgcc/config/mips/crti.S +@@ -24,6 +24,10 @@ see the files COPYING3 and COPYING.RUNTI + /* An executable stack is *not* required for these functions. */ + #include "gnustack.h" + ++ ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ + /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. + Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ + +--- a/libgcc/config/mips/crtn.S ++++ b/libgcc/config/mips/crtn.S +@@ -24,6 +24,9 @@ see the files COPYING3 and COPYING.RUNTI + /* An executable stack is *not* required for these functions. */ + #include "gnustack.h" + ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ + /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. + Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ + +--- a/libgcc/config/mips/mips16.S ++++ b/libgcc/config/mips/mips16.S +@@ -51,6 +51,10 @@ see the files COPYING3 and COPYING.RUNTI + values using the soft-float calling convention, but do the actual + operation using the hard floating point instructions. */ + ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ .previous ++ + #if defined _MIPS_SIM && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64) + + /* This file contains 32-bit assembly code. */ +--- a/libgcc/config/mips/vr4120-div.S ++++ b/libgcc/config/mips/vr4120-div.S +@@ -29,6 +29,10 @@ see the files COPYING3 and COPYING.RUNTI + -mfix-vr4120. div and ddiv do not give the correct result when one + of the operands is negative. */ + ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ .previous ++ + .set nomips16 + + #define DIV \ diff --git a/toolchain/gcc/patches/10.1.0/931-libffi-fix-MIPS-softfloat-build-issue.patch b/toolchain/gcc/patches/10.1.0/931-libffi-fix-MIPS-softfloat-build-issue.patch new file mode 100644 index 0000000000..fb4cb1533a --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/931-libffi-fix-MIPS-softfloat-build-issue.patch @@ -0,0 +1,168 @@ +From c0c62fa4256f805389f16ebfc4a60cf789129b50 Mon Sep 17 00:00:00 2001 +From: BangLang Huang +Date: Wed, 9 Nov 2016 10:36:49 +0800 +Subject: [PATCH] libffi: fix MIPS softfloat build issue + +Backported from github.com/libffi/libffi#272 + +Signed-off-by: BangLang Huang +Signed-off-by: Yousong Zhou +--- + libffi/src/mips/n32.S | 17 +++++++++++++++++ + libffi/src/mips/o32.S | 17 +++++++++++++++++ + 2 files changed, 34 insertions(+) + +--- a/libffi/src/mips/n32.S ++++ b/libffi/src/mips/n32.S +@@ -107,6 +107,16 @@ loadregs: + + REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6. + ++#ifdef __mips_soft_float ++ REG_L a0, 0*FFI_SIZEOF_ARG(t9) ++ REG_L a1, 1*FFI_SIZEOF_ARG(t9) ++ REG_L a2, 2*FFI_SIZEOF_ARG(t9) ++ REG_L a3, 3*FFI_SIZEOF_ARG(t9) ++ REG_L a4, 4*FFI_SIZEOF_ARG(t9) ++ REG_L a5, 5*FFI_SIZEOF_ARG(t9) ++ REG_L a6, 6*FFI_SIZEOF_ARG(t9) ++ REG_L a7, 7*FFI_SIZEOF_ARG(t9) ++#else + and t4, t6, ((1< +Date: Fri, 4 May 2018 18:20:53 +0800 +Subject: [PATCH] gotools: fix compilation when making cross compiler + +libgo is "the runtime support library for the Go programming language. +This library is intended for use with the Go frontend." + +gccgo will link target files with libgo.so which depends on libgcc_s.so.1, but +the linker will complain that it cannot find it. That's because shared libgcc +is not present in the install directory yet. libgo.so was made without problem +because gcc will emit -lgcc_s when compiled with -shared option. When gotools +were being made, it was supplied with -static-libgcc thus no link option was +provided. Check LIBGO in gcc/go/gcc-spec.c for how gccgo make a builtin spec +for linking with libgo.so + +- GccgoCrossCompilation, https://github.com/golang/go/wiki/GccgoCrossCompilation +- Cross-building instructions, http://www.eglibc.org/archives/patches/msg00078.html + +When 3-pass GCC compilation is used, shared libgcc runtime libraries will be +available after gcc pass2 completed and will meet the gotools link requirement +at gcc pass3 +--- + gotools/Makefile.am | 4 +++- + gotools/Makefile.in | 4 +++- + 2 files changed, 6 insertions(+), 2 deletions(-) + +--- a/gotools/Makefile.am ++++ b/gotools/Makefile.am +@@ -26,6 +26,7 @@ PWD_COMMAND = $${PWDCMD-pwd} + STAMP = echo timestamp > + + libgodir = ../$(target_noncanonical)/libgo ++libgccdir = ../$(target_noncanonical)/libgcc + LIBGODEP = $(libgodir)/libgo.la + + LIBGOTOOL = $(libgodir)/libgotool.a +@@ -41,7 +42,8 @@ GOCFLAGS = $(CFLAGS_FOR_TARGET) + GOCOMPILE = $(GOCOMPILER) $(GOCFLAGS) + + AM_GOCFLAGS = -I $(libgodir) +-AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs ++AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs \ ++ -L $(libgccdir) -L $(libgccdir)/.libs -lgcc_s + GOLINK = $(GOCOMPILER) $(GOCFLAGS) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@ + + libgosrcdir = $(srcdir)/../libgo/go +--- a/gotools/Makefile.in ++++ b/gotools/Makefile.in +@@ -337,6 +337,7 @@ mkinstalldirs = $(SHELL) $(toplevel_srcd + PWD_COMMAND = $${PWDCMD-pwd} + STAMP = echo timestamp > + libgodir = ../$(target_noncanonical)/libgo ++libgccdir = ../$(target_noncanonical)/libgcc + LIBGODEP = $(libgodir)/libgo.la + LIBGOTOOL = $(libgodir)/libgotool.a + @NATIVE_FALSE@GOCOMPILER = $(GOC) +@@ -346,7 +347,8 @@ LIBGOTOOL = $(libgodir)/libgotool.a + GOCFLAGS = $(CFLAGS_FOR_TARGET) + GOCOMPILE = $(GOCOMPILER) $(GOCFLAGS) + AM_GOCFLAGS = -I $(libgodir) +-AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs ++AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs \ ++ -L $(libgccdir) -L $(libgccdir)/.libs -lgcc_s + GOLINK = $(GOCOMPILER) $(GOCFLAGS) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@ + libgosrcdir = $(srcdir)/../libgo/go + cmdsrcdir = $(libgosrcdir)/cmd diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile index 41ba9853fd..c25d181990 100644 --- a/toolchain/gdb/Makefile +++ b/toolchain/gdb/Makefile @@ -7,23 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gdb - -ifeq ($(CONFIG_arc),y) -PKG_VERSION:=arc-2017.09-gdb - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/arc-2017.09-gdb -PKG_HASH:=7e3c2a763bf500a40c5c4591a7e22c591dafc1f214b1d514895c1096e85c883a -GDB_DIR:=binutils-$(PKG_NAME)-$(PKG_VERSION) -PATCH_DIR:=./patches-arc -else PKG_VERSION:=8.3.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb PKG_HASH:=1e55b4d7cdca7b34be12f4ceae651623aa73b2fd640152313f9f66a7149757c4 GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION) -endif HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(GDB_DIR) diff --git a/tools/firmware-utils/src/fw.h b/tools/firmware-utils/src/fw.h index 53a92a573c..778143d2c4 100644 --- a/tools/firmware-utils/src/fw.h +++ b/tools/firmware-utils/src/fw.h @@ -19,6 +19,7 @@ #ifndef FW_INCLUDED #define FW_INCLUDED +#include #include #define MAGIC_HEADER "OPEN" @@ -30,16 +31,16 @@ #define PART_NAME_LENGTH 16 typedef struct header { - char magic[MAGIC_LENGTH]; - char version[256]; + uint8_t magic[MAGIC_LENGTH]; + uint8_t version[256]; u_int32_t crc; u_int32_t pad; } __attribute__ ((packed)) header_t; typedef struct part { - char magic[MAGIC_LENGTH]; - char name[PART_NAME_LENGTH]; - char pad[12]; + uint8_t magic[MAGIC_LENGTH]; + uint8_t name[PART_NAME_LENGTH]; + uint8_t pad[12]; u_int32_t memaddr; u_int32_t index; u_int32_t baseaddr; @@ -54,13 +55,13 @@ typedef struct part_crc { } __attribute__ ((packed)) part_crc_t; typedef struct signature { - char magic[MAGIC_LENGTH]; + uint8_t magic[MAGIC_LENGTH]; u_int32_t crc; u_int32_t pad; } __attribute__ ((packed)) signature_t; typedef struct signature_rsa { - char magic[MAGIC_LENGTH]; + uint8_t magic[MAGIC_LENGTH]; // u_int32_t crc; unsigned char rsa_signature[256]; u_int32_t pad; diff --git a/tools/firmware-utils/src/mkfwimage.c b/tools/firmware-utils/src/mkfwimage.c index ff9011a0c4..591ce44a78 100644 --- a/tools/firmware-utils/src/mkfwimage.c +++ b/tools/firmware-utils/src/mkfwimage.c @@ -32,6 +32,7 @@ #include #include #include "fw.h" +#include "utils.h" typedef struct fw_layout_data { u_int32_t kern_start; @@ -204,21 +205,20 @@ static void write_header(void* mem, const char *magic, const char* version) header_t* header = mem; memset(header, 0, sizeof(header_t)); - memcpy(header->magic, magic, MAGIC_LENGTH); - strncpy(header->version, version, sizeof(header->version)); - header->crc = htonl(crc32(0L, (unsigned char *)header, - sizeof(header_t) - 2 * sizeof(u_int32_t))); + FW_MEMCPY_STR(header->magic, magic); + FW_MEMCPY_STR(header->version, version); + header->crc = htonl(crc32(0L, (uint8_t*) header, + sizeof(header_t) - 2 * sizeof(u_int32_t))); header->pad = 0L; } - static void write_signature(void* mem, u_int32_t sig_offset) { /* write signature */ signature_t* sign = (signature_t*)(mem + sig_offset); memset(sign, 0, sizeof(signature_t)); - memcpy(sign->magic, MAGIC_END, MAGIC_LENGTH); + FW_MEMCPY_STR(sign->magic, MAGIC_END); sign->crc = htonl(crc32(0L,(unsigned char *)mem, sig_offset)); sign->pad = 0L; } @@ -229,7 +229,7 @@ static void write_signature_rsa(void* mem, u_int32_t sig_offset) signature_rsa_t* sign = (signature_rsa_t*)(mem + sig_offset); memset(sign, 0, sizeof(signature_rsa_t)); - memcpy(sign->magic, MAGIC_ENDS, MAGIC_LENGTH); + FW_MEMCPY_STR(sign->magic, MAGIC_ENDS); // sign->crc = htonl(crc32(0L,(unsigned char *)mem, sig_offset)); sign->pad = 0L; } @@ -259,8 +259,8 @@ static int write_part(void* mem, part_data_t* d) munmap(addr, d->stats.st_size); memset(p->name, 0, PART_NAME_LENGTH); - memcpy(p->magic, MAGIC_PART, MAGIC_LENGTH); - memcpy(p->name, d->partition_name, PART_NAME_LENGTH); + FW_MEMCPY_STR(p->magic, MAGIC_PART); + FW_MEMCPY_STR(p->name, d->partition_name); p->index = htonl(d->partition_index); p->data_size = htonl(d->stats.st_size); diff --git a/tools/firmware-utils/src/utils.h b/tools/firmware-utils/src/utils.h new file mode 100644 index 0000000000..11ec740069 --- /dev/null +++ b/tools/firmware-utils/src/utils.h @@ -0,0 +1,11 @@ +#include +#include + +#pragma once + +#define FW_MEMCPY_STR(dst, src) \ + do { \ + size_t slen = strlen(src); \ + size_t dlen = sizeof(dst); \ + memcpy(dst, src, slen > dlen ? dlen : slen); \ + } while (0);