Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
commit
4ca3aeca5b
@ -541,9 +541,7 @@ define Build/zip
|
||||
rm -rf $@.tmp
|
||||
mkdir $@.tmp
|
||||
mv $@ $@.tmp/$(word 1,$(1))
|
||||
|
||||
$(STAGING_DIR_HOST)/bin/zip -j -X \
|
||||
$(if $(SOURCE_DATE_EPOCH),--mtime="$(SOURCE_DATE_EPOCH)") \
|
||||
TZ=UTC $(STAGING_DIR_HOST)/bin/zip -j -X \
|
||||
$(wordlist 2,$(words $(1)),$(1)) \
|
||||
$@ $@.tmp/$(if $(word 1,$(1)),$(word 1,$(1)),$$(basename $@))
|
||||
rm -rf $@.tmp
|
||||
|
@ -49,6 +49,7 @@ boot() {
|
||||
|
||||
/bin/config_generate
|
||||
uci_apply_defaults
|
||||
sync
|
||||
|
||||
# temporary hack until configd exists
|
||||
/sbin/reload_config
|
||||
|
48
package/boot/uboot-bcm4908/Makefile
Normal file
48
package/boot/uboot-bcm4908/Makefile
Normal file
@ -0,0 +1,48 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://git.openwrt.org/project/bcm63xx/u-boot.git
|
||||
PKG_SOURCE_DATE:=2022-03-03
|
||||
PKG_SOURCE_VERSION:=92e9eca819c9c898d9d2010e1a217726c42c8c47
|
||||
PKG_MIRROR_HASH:=11c37fe4c18d55e799153600d1cfd8ee9ca7da8326d0024c1d825f4a327c5f0d
|
||||
|
||||
include $(INCLUDE_DIR)/u-boot.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define U-Boot/Default
|
||||
BUILD_TARGET:=bcm4908
|
||||
UBOOT_IMAGE:=u-boot-nodtb.bin
|
||||
DEFAULT:=y
|
||||
endef
|
||||
|
||||
define U-Boot/bcm4908
|
||||
NAME:=Broadcom's BCM4908
|
||||
UBOOT_CONFIG:=bcm94908
|
||||
endef
|
||||
|
||||
UBOOT_TARGETS := \
|
||||
bcm4908
|
||||
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
mkdir -p $(PKG_BUILD_DIR)/include/generated/
|
||||
( cd $(PKG_BUILD_DIR)/board/broadcom/bcmbca/httpd/html/ && \
|
||||
xxd -i index.html > ../../../../../include/generated/index.h && \
|
||||
xxd -i flashing.html > ../../../../../include/generated/flashing.h && \
|
||||
xxd -i fail.html > ../../../../../include/generated/fail.h && \
|
||||
xxd -i 404.html > ../../../../../include/generated/404.h )
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)/u-boot
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/u-boot/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/u-boot.dtb $(STAGING_DIR_IMAGE)/u-boot/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/arch/arm/dts/*.dtb $(STAGING_DIR_IMAGE)/u-boot/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage/U-Boot))
|
@ -0,0 +1,40 @@
|
||||
From: Masahiro Yamada <yamada.masahiro@socionext.com>
|
||||
Date: Mon, 26 Sep 2016 13:05:02 +0900
|
||||
Subject: [PATCH] check-config: allow to complete build even with ad-hoc CONFIG
|
||||
options
|
||||
|
||||
Currently, the check-config.sh terminates the build when unknown
|
||||
ad-hoc options are detected. I think it is too much because we may
|
||||
want to patch config headers locally in a build/deployment project.
|
||||
|
||||
So, let's relax check-config.sh to just warn even if it detects
|
||||
options that are not in the whitelist. Instead, this check can be
|
||||
done at the end of build, along with other checks. It will catch
|
||||
more attention.
|
||||
|
||||
Even with this change, the Buildman tool catches new warnings,
|
||||
so Tom can give NACK to new ad-hoc options.
|
||||
|
||||
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
|
||||
---
|
||||
scripts/check-config.sh | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
--- a/scripts/check-config.sh
|
||||
+++ b/scripts/check-config.sh
|
||||
@@ -50,14 +50,13 @@ cat `find ${srctree} -name "Kconfig*"` |sed -n \
|
||||
|sort |uniq > ${ok}
|
||||
comm -23 ${suspects} ${ok} >${new_adhoc}
|
||||
if [ -s ${new_adhoc} ]; then
|
||||
- echo >&2 "Error: You must add new CONFIG options using Kconfig"
|
||||
+ echo >&2 "Warning: You must add new CONFIG options using Kconfig"
|
||||
echo >&2 "The following new ad-hoc CONFIG options were detected:"
|
||||
cat >&2 ${new_adhoc}
|
||||
echo >&2
|
||||
echo >&2 "Please add these via Kconfig instead. Find a suitable Kconfig"
|
||||
echo >&2 "file and add a 'config' or 'menuconfig' option."
|
||||
# Don't delete the temporary files in case they are useful
|
||||
- exit 1
|
||||
else
|
||||
rm ${suspects} ${ok} ${new_adhoc}
|
||||
fi
|
@ -0,0 +1,38 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Fri, 4 Mar 2022 09:21:32 +0100
|
||||
Subject: [PATCH] configs: bcm94908: unset CONFIG_SPL
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Compiling SPL is always tricky as it needs to fit limited resources.
|
||||
Fortunately in most cases there is no need to replace SPL or TPL while
|
||||
flashing a new firmware.
|
||||
|
||||
Compiling SPL for BCM4908 seems to fail with non-Broadcom toolchain:
|
||||
aarch64-openwrt-linux-musl-ld.bfd: u-boot-spl section `.u_boot_list' will not fit in region `.sram'
|
||||
aarch64-openwrt-linux-musl-ld.bfd: section .bss VMA [00000000822b9000,00000000822b93ef] overlaps section .u_boot_list VMA [00000000822b8f60,00000000822b9a87]
|
||||
aarch64-openwrt-linux-musl-ld.bfd: region `.sram' overflowed by 2696 bytes
|
||||
|
||||
It also requires hashtable.h which has to be generated using some
|
||||
Broadcom's custom perl script that isn't integrated as this point.
|
||||
|
||||
For now just disable SPL and use only last-stage U-Boot that must be
|
||||
shipped with every firmware.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
configs/bcm94908_defconfig | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/configs/bcm94908_defconfig
|
||||
+++ b/configs/bcm94908_defconfig
|
||||
@@ -21,7 +21,7 @@ CONFIG_SPL_SERIAL_SUPPORT=y
|
||||
CONFIG_TPL_LIBCOMMON_SUPPORT=y
|
||||
CONFIG_TPL_LIBGENERIC_SUPPORT=y
|
||||
CONFIG_NR_DRAM_BANKS=1
|
||||
-CONFIG_SPL=y
|
||||
+# CONFIG_SPL is not set
|
||||
CONFIG_SPL_LIBDISK_SUPPORT=y
|
||||
CONFIG_ENV_VARS_UBOOT_CONFIG=y
|
||||
CONFIG_TPL_SYS_MALLOC_F_LEN=0x11000
|
@ -0,0 +1,55 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Fri, 4 Mar 2022 09:23:34 +0100
|
||||
Subject: [PATCH] Assume TPL support for ATF when compiling U-Boot without TPL
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Broadcom's U-Boot behaviour depends on compilation time check whether
|
||||
TPL was compiled with or without ATF support. There is no proper runtime
|
||||
check.
|
||||
|
||||
When compiling just U-Boot (without SPL & TPL) there is no way to tell
|
||||
if it's going to work with TPL with or without ATF support.
|
||||
|
||||
Modify code to blindly assume ATF support in TPL in such cases. It seems
|
||||
to be always true for Broadcom and we need some assumption as we don't
|
||||
deal with compiling SPL or TPL.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
arch/arm/mach-bcmbca/bcm4908/cpu.c | 2 +-
|
||||
board/broadcom/bcmbca/board.c | 4 ++--
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/arch/arm/mach-bcmbca/bcm4908/cpu.c
|
||||
+++ b/arch/arm/mach-bcmbca/bcm4908/cpu.c
|
||||
@@ -138,7 +138,7 @@ int get_nr_cpus()
|
||||
return nr_cpus;
|
||||
}
|
||||
|
||||
-#if !defined(CONFIG_TPL_ATF)
|
||||
+#if defined(CONFIG_TPL) && !defined(CONFIG_TPL_ATF)
|
||||
void boot_secondary_cpu(unsigned long vector)
|
||||
{
|
||||
uint32_t cpu, nr_cpus = QUAD_CPUS;
|
||||
--- a/board/broadcom/bcmbca/board.c
|
||||
+++ b/board/broadcom/bcmbca/board.c
|
||||
@@ -103,7 +103,7 @@ void board_spinor_init(void)
|
||||
|
||||
int board_init(void)
|
||||
{
|
||||
-#if !defined(CONFIG_TPL_ATF)
|
||||
+#if defined(CONFIG_TPL) && !defined(CONFIG_TPL_ATF)
|
||||
unsigned long vector;
|
||||
#endif
|
||||
board_sdk_init_e();
|
||||
@@ -121,7 +121,7 @@ int board_init(void)
|
||||
printf("$Uboot: "BUILD_TAG" $\n");
|
||||
#endif
|
||||
|
||||
-#if !defined(CONFIG_TPL_ATF)
|
||||
+#if defined(CONFIG_TPL) && !defined(CONFIG_TPL_ATF)
|
||||
#if defined(CONFIG_ARM64)
|
||||
vector = (unsigned long)&_start;
|
||||
#else
|
@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=iptables
|
||||
PKG_VERSION:=1.8.7
|
||||
PKG_RELEASE:=3
|
||||
PKG_RELEASE:=4
|
||||
|
||||
PKG_SOURCE_URL:=https://netfilter.org/projects/iptables/files
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
@ -388,6 +388,19 @@ iptables extension for triggering a LED.
|
||||
|
||||
endef
|
||||
|
||||
define Package/iptables-mod-socket
|
||||
$(call Package/iptables/Module, +kmod-ipt-socket)
|
||||
TITLE:=Socket match iptables extensions
|
||||
endef
|
||||
|
||||
define Package/iptables-mod-socket/description
|
||||
Socket match iptables extensions.
|
||||
|
||||
Matches:
|
||||
- socket
|
||||
|
||||
endef
|
||||
|
||||
define Package/iptables-mod-tproxy
|
||||
$(call Package/iptables/Module, +kmod-ipt-tproxy)
|
||||
TITLE:=Transparent proxy iptables extensions
|
||||
@ -396,9 +409,6 @@ endef
|
||||
define Package/iptables-mod-tproxy/description
|
||||
Transparent proxy iptables extensions.
|
||||
|
||||
Matches:
|
||||
- socket
|
||||
|
||||
Targets:
|
||||
- TPROXY
|
||||
|
||||
@ -721,6 +731,7 @@ $(eval $(call BuildPlugin,iptables-mod-ulog,$(IPT_ULOG-m)))
|
||||
$(eval $(call BuildPlugin,iptables-mod-hashlimit,$(IPT_HASHLIMIT-m)))
|
||||
$(eval $(call BuildPlugin,iptables-mod-rpfilter,$(IPT_RPFILTER-m)))
|
||||
$(eval $(call BuildPlugin,iptables-mod-led,$(IPT_LED-m)))
|
||||
$(eval $(call BuildPlugin,iptables-mod-socket,$(IPT_SOCKET-m)))
|
||||
$(eval $(call BuildPlugin,iptables-mod-tproxy,$(IPT_TPROXY-m)))
|
||||
$(eval $(call BuildPlugin,iptables-mod-tee,$(IPT_TEE-m)))
|
||||
$(eval $(call BuildPlugin,iptables-mod-u32,$(IPT_U32-m)))
|
||||
|
@ -5,9 +5,9 @@ PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/uqmi.git
|
||||
PKG_SOURCE_DATE:=2022-02-02
|
||||
PKG_SOURCE_VERSION:=f254fc59c710d781eca3ec36e0bff2d8970370fa
|
||||
PKG_MIRROR_HASH:=350fd627150dde0601a96ff313a76f7a827b0199e7ee9ab86e4f2f96280edad5
|
||||
PKG_SOURCE_DATE:=2022-03-12
|
||||
PKG_SOURCE_VERSION:=44dd095794a5327611d0ee1a58b0a6333d397b64
|
||||
PKG_MIRROR_HASH:=1f7890c659981e1da5c6d73911c30e24722818ff52d58f41d80cc96b62d53311
|
||||
PKG_MAINTAINER:=Matti Laakso <malaakso@elisanet.fi>
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
@ -285,7 +285,7 @@ proto_qmi_setup() {
|
||||
fi
|
||||
|
||||
# Check data connection state
|
||||
connstat=$(uqmi -s -d "$device" --get-data-status)
|
||||
connstat=$(uqmi -s -d "$device" --set-client-id wds,"$cid_4" --get-data-status)
|
||||
[ "$connstat" == '"connected"' ] || {
|
||||
echo "No data link!"
|
||||
uqmi -s -d "$device" --set-client-id wds,"$cid_4" --release-client-id wds > /dev/null 2>&1
|
||||
@ -322,7 +322,7 @@ proto_qmi_setup() {
|
||||
fi
|
||||
|
||||
# Check data connection state
|
||||
connstat=$(uqmi -s -d "$device" --get-data-status)
|
||||
connstat=$(uqmi -s -d "$device" --set-client-id wds,"$cid_6" --get-data-status)
|
||||
[ "$connstat" == '"connected"' ] || {
|
||||
echo "No data link!"
|
||||
uqmi -s -d "$device" --set-client-id wds,"$cid_6" --release-client-id wds > /dev/null 2>&1
|
||||
|
@ -236,7 +236,8 @@ foreach my $mirror (@ARGV) {
|
||||
push @mirrors, "http://mirror.internode.on.net/pub/gnu/$1";
|
||||
push @mirrors, "http://mirror.navercorp.com/gnu/$1";
|
||||
push @mirrors, "ftp://mirrors.rit.edu/gnu/$1";
|
||||
push @mirrors, "ftp://download.xs4all.nl/pub/gnu/";
|
||||
push @mirrors, "ftp://download.xs4all.nl/pub/gnu/$1";
|
||||
push @mirrors, "https://ftp.gnu.org/gnu/$1";
|
||||
} elsif ($mirror =~ /^\@SAVANNAH\/(.+)$/) {
|
||||
push @mirrors, "https://mirror.netcologne.de/savannah/$1";
|
||||
push @mirrors, "https://mirror.csclub.uwaterloo.ca/nongnu/$1";
|
||||
|
@ -75,24 +75,28 @@
|
||||
compatible = "gpio-keys";
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
|
||||
usb {
|
||||
label = "usb";
|
||||
linux,code = <BTN_2>;
|
||||
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
|
||||
aoss {
|
||||
label = "aoss";
|
||||
linux,code = <KEY_WPS_BUTTON>;
|
||||
gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
|
||||
router_auto {
|
||||
label = "router_auto";
|
||||
linux,code = <BTN_6>;
|
||||
linux,input-type = <EV_SW>;
|
||||
gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
|
||||
@ -100,6 +104,7 @@
|
||||
};
|
||||
|
||||
router_off {
|
||||
label = "router_off";
|
||||
linux,code = <BTN_5>;
|
||||
linux,input-type = <EV_SW>;
|
||||
gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
|
||||
@ -107,6 +112,7 @@
|
||||
};
|
||||
|
||||
movie_engine {
|
||||
label = "movie_engine";
|
||||
linux,code = <BTN_7>;
|
||||
linux,input-type = <EV_SW>;
|
||||
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
|
||||
|
@ -0,0 +1,68 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "qca9533_mikrotik_routerboard-16m.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "mikrotik,routerboard-mapl-2nd", "qca,qca9533";
|
||||
model = "MikroTik RouterBOARD mAPL-2nD (mAP lite)";
|
||||
|
||||
aliases {
|
||||
led-boot = &led_user;
|
||||
led-failsafe = &led_user;
|
||||
led-running = &led_user;
|
||||
led-upgrade = &led_user;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&led_power_pin &led_lan_pin>;
|
||||
|
||||
power {
|
||||
label = "green:power";
|
||||
gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
|
||||
default-state = "on";
|
||||
};
|
||||
|
||||
lan {
|
||||
label = "green:lan";
|
||||
gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
wlan {
|
||||
label = "green:wlan";
|
||||
gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
|
||||
led_user: user {
|
||||
label = "green:user";
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ð0 {
|
||||
status = "okay";
|
||||
|
||||
phy-handle = <&swphy0>;
|
||||
|
||||
gmac-config {
|
||||
device = <&gmac>;
|
||||
switch-phy-swap = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
ð1 {
|
||||
compatible = "syscon", "simple-mfd";
|
||||
};
|
||||
|
||||
&pinmux {
|
||||
led_lan_pin: pinmux_led_lan_pin {
|
||||
pinctrl-single,bits = <0x4 0x0 0xff>;
|
||||
};
|
||||
|
||||
led_power_pin: pinmux_led_power_pin {
|
||||
pinctrl-single,bits = <0x10 0x0 0xff00>;
|
||||
};
|
||||
};
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/leds/common.h>
|
||||
|
||||
/ {
|
||||
model = "AirTight Networks C-75";
|
||||
@ -11,9 +12,10 @@
|
||||
|
||||
aliases {
|
||||
label-mac-device = ð0;
|
||||
led-boot = &led_power;
|
||||
led-failsafe = &led_power;
|
||||
led-upgrade = &led_power;
|
||||
led-boot = &led_power_amber;
|
||||
led-running = &led_power_green;
|
||||
led-failsafe = &led_power_amber;
|
||||
led-upgrade = &led_power_amber;
|
||||
};
|
||||
|
||||
keys {
|
||||
@ -29,10 +31,16 @@
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led_power: power {
|
||||
label = "amber:power";
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
|
||||
default-state = "on";
|
||||
led_power_amber: power-amber {
|
||||
color = <LED_COLOR_ID_AMBER>;
|
||||
function = LED_FUNCTION_POWER;
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_power_green: power-green {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_POWER;
|
||||
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
wlan2g {
|
||||
|
@ -55,6 +55,14 @@ define Device/mikrotik_routerboard-lhg-5nd
|
||||
endef
|
||||
TARGET_DEVICES += mikrotik_routerboard-lhg-5nd
|
||||
|
||||
define Device/mikrotik_routerboard-mapl-2nd
|
||||
$(Device/mikrotik_nor)
|
||||
SOC := qca9533
|
||||
DEVICE_MODEL := RouterBOARD mAPL-2nD (mAP lite)
|
||||
IMAGE_SIZE := 16256k
|
||||
endef
|
||||
TARGET_DEVICES += mikrotik_routerboard-mapl-2nd
|
||||
|
||||
define Device/mikrotik_routerboard-sxt-5nd-r2
|
||||
$(Device/mikrotik_nand)
|
||||
SOC := ar9344
|
||||
|
@ -6,7 +6,8 @@ board_config_update
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
mikrotik,routerboard-lhg-2nd)
|
||||
mikrotik,routerboard-lhg-2nd|\
|
||||
mikrotik,routerboard-mapl-2nd)
|
||||
ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0"
|
||||
;;
|
||||
mikrotik,routerboard-lhg-5nd)
|
||||
|
@ -17,6 +17,7 @@ ath79_setup_interfaces()
|
||||
mikrotik,routerboard-912uag-2hpnd|\
|
||||
mikrotik,routerboard-lhg-2nd|\
|
||||
mikrotik,routerboard-lhg-5nd|\
|
||||
mikrotik,routerboard-mapl-2nd|\
|
||||
mikrotik,routerboard-sxt-5nd-r2|\
|
||||
mikrotik,routerboard-wap-g-5hact2hnd|\
|
||||
mikrotik,routerboard-wapr-2nd)
|
||||
@ -40,6 +41,7 @@ ath79_setup_macs()
|
||||
mikrotik,routerboard-912uag-2hpnd|\
|
||||
mikrotik,routerboard-lhg-2nd|\
|
||||
mikrotik,routerboard-lhg-5nd|\
|
||||
mikrotik,routerboard-mapl-2nd|\
|
||||
mikrotik,routerboard-sxt-5nd-r2|\
|
||||
mikrotik,routerboard-wap-g-5hact2hnd|\
|
||||
mikrotik,routerboard-wapr-2nd)
|
||||
|
@ -30,6 +30,7 @@ case "$FIRMWARE" in
|
||||
mikrotik,routerboard-wapr-2nd)
|
||||
caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" 1)
|
||||
;;
|
||||
mikrotik,routerboard-mapl-2nd|\
|
||||
mikrotik,routerboard-wap-g-5hact2hnd)
|
||||
caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" 2)
|
||||
;;
|
||||
|
@ -22,6 +22,20 @@
|
||||
};
|
||||
};
|
||||
|
||||
uboot {
|
||||
description = "U-Boot";
|
||||
data = /incbin/("${images_dir}/u-boot/u-boot-nodtb.bin");
|
||||
os = "U-Boot";
|
||||
arch = "arm64";
|
||||
compression = "none";
|
||||
load = <0x1000000>;
|
||||
entry = <0x1000000>;
|
||||
|
||||
hash-1 {
|
||||
algo = "sha256";
|
||||
};
|
||||
};
|
||||
|
||||
kernel {
|
||||
description = "Linux kernel";
|
||||
data = /incbin/("${kernel}");
|
||||
@ -37,10 +51,9 @@
|
||||
};
|
||||
};
|
||||
|
||||
fdt_linux_RAX220 {
|
||||
fdt_uboot {
|
||||
description = "dtb";
|
||||
data = /incbin/("${dts_dir}/broadcom/bcm4908/bcm4908-netgear-raxe500.dtb");
|
||||
arch = "arm64";
|
||||
data = /incbin/("${images_dir}/u-boot/u-boot.dtb");
|
||||
type = "flat_dt";
|
||||
compression = "none";
|
||||
|
||||
@ -48,9 +61,25 @@
|
||||
algo = "sha256";
|
||||
};
|
||||
};
|
||||
|
||||
fdt_linux_RAX220 {
|
||||
description = "dtb";
|
||||
data = /incbin/("${dts_dir}/broadcom/bcm4908/bcm4908-netgear-raxe500.dtb");
|
||||
arch = "arm64";
|
||||
type = "flat_dt";
|
||||
compression = "none";
|
||||
};
|
||||
};
|
||||
|
||||
configurations {
|
||||
default = "conf_uboot";
|
||||
|
||||
conf_uboot {
|
||||
description = "BRCM 63xxx with uboot";
|
||||
fdt = "fdt_uboot";
|
||||
loadables = "atf", "uboot";
|
||||
};
|
||||
|
||||
conf_lx_RAX220 {
|
||||
description = "BRCM 63xxx linux";
|
||||
kernel = "kernel";
|
||||
|
@ -0,0 +1,33 @@
|
||||
--- a/drivers/net/usb/qmi_wwan.c
|
||||
+++ b/drivers/net/usb/qmi_wwan.c
|
||||
@@ -1024,6 +1024,7 @@ static const struct usb_device_id produc
|
||||
{QMI_MATCH_FF_FF_FF(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */
|
||||
{QMI_MATCH_FF_FF_FF(0x2c7c, 0x0620)}, /* Quectel EM160R-GL */
|
||||
{QMI_MATCH_FF_FF_FF(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */
|
||||
+ {QMI_MATCH_FF_FF_FF(0x05c6, 0xf601)}, /* MeigLink SLM750 */
|
||||
|
||||
/* 3. Combined interface devices matching on interface number */
|
||||
{QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */
|
||||
--- a/drivers/usb/serial/option.c
|
||||
+++ b/drivers/usb/serial/option.c
|
||||
@@ -243,6 +243,8 @@ static void option_instat_callback(struc
|
||||
#define UBLOX_PRODUCT_R6XX 0x90fa
|
||||
/* These Yuga products use Qualcomm's vendor ID */
|
||||
#define YUGA_PRODUCT_CLM920_NC5 0x9625
|
||||
+/* These MeigLink products use Qualcomm's vendor ID */
|
||||
+#define MEIGLINK_PRODUCT_SLM750 0xf601
|
||||
|
||||
#define QUECTEL_VENDOR_ID 0x2c7c
|
||||
/* These Quectel products use Quectel's vendor ID */
|
||||
@@ -1127,6 +1129,11 @@ static const struct usb_device_id option
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0, 0) },
|
||||
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96),
|
||||
.driver_info = RSVD(4) },
|
||||
+ /* Meiglink products using Qualcomm vendor ID */
|
||||
+ // Works OK. In case of some issues check macros that are used by Quectel Products
|
||||
+ { USB_DEVICE_AND_INTERFACE_INFO(QUALCOMM_VENDOR_ID, MEIGLINK_PRODUCT_SLM750, 0xff, 0xff, 0xff),
|
||||
+ .driver_info = NUMEP2 },
|
||||
+ { USB_DEVICE_AND_INTERFACE_INFO(QUALCOMM_VENDOR_ID, MEIGLINK_PRODUCT_SLM750, 0xff, 0, 0) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0xff, 0xff),
|
||||
.driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) },
|
@ -396,6 +396,7 @@ CONFIG_UNWINDER_ARM=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_CHIPIDEA=y
|
||||
CONFIG_USB_CHIPIDEA_HOST=y
|
||||
CONFIG_USB_CHIPIDEA_IMX=y
|
||||
CONFIG_USB_CHIPIDEA_UDC=y
|
||||
CONFIG_USB_COMMON=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
|
@ -304,7 +304,7 @@ define Device/netgear_r7800
|
||||
PAGESIZE := 2048
|
||||
BOARD_NAME := r7800
|
||||
SUPPORTED_DEVICES += r7800
|
||||
DEVICE_PACKAGES := ath10k-firmware-qca9984-ct
|
||||
DEVICE_PACKAGES := ath10k-firmware-qca9984-ct kmod-ramoops
|
||||
endef
|
||||
TARGET_DEVICES += netgear_r7800
|
||||
|
||||
@ -318,7 +318,7 @@ define Device/netgear_xr500
|
||||
NETGEAR_HW_ID := 29764958+0+256+512+4x4+4x4+cascade
|
||||
BLOCKSIZE := 128k
|
||||
PAGESIZE := 2048
|
||||
DEVICE_PACKAGES := ath10k-firmware-qca9984-ct
|
||||
DEVICE_PACKAGES := ath10k-firmware-qca9984-ct kmod-ramoops
|
||||
endef
|
||||
TARGET_DEVICES += netgear_xr500
|
||||
|
||||
|
@ -0,0 +1,30 @@
|
||||
From dd830aed23c6e07cd8e2a163742bf3d63c9add08 Mon Sep 17 00:00:00 2001
|
||||
From: Aleksander Jan Bajkowski <olek2@wp.pl>
|
||||
Date: Sat, 5 Mar 2022 12:20:39 +0100
|
||||
Subject: net: lantiq_xrx200: fix use after free bug
|
||||
|
||||
The skb->len field is read after the packet is sent to the network
|
||||
stack. In the meantime, skb can be freed. This patch fixes this bug.
|
||||
|
||||
Fixes: c3e6b2c35b34 ("net: lantiq_xrx200: add ingress SG DMA support")
|
||||
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
|
||||
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
|
||||
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/ethernet/lantiq_xrx200.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/ethernet/lantiq_xrx200.c
|
||||
+++ b/drivers/net/ethernet/lantiq_xrx200.c
|
||||
@@ -260,9 +260,9 @@ static int xrx200_hw_receive(struct xrx2
|
||||
|
||||
if (ctl & LTQ_DMA_EOP) {
|
||||
ch->skb_head->protocol = eth_type_trans(ch->skb_head, net_dev);
|
||||
- netif_receive_skb(ch->skb_head);
|
||||
net_dev->stats.rx_packets++;
|
||||
net_dev->stats.rx_bytes += ch->skb_head->len;
|
||||
+ netif_receive_skb(ch->skb_head);
|
||||
ch->skb_head = NULL;
|
||||
ch->skb_tail = NULL;
|
||||
ret = XRX200_DMA_PACKET_COMPLETE;
|
159
target/linux/ramips/dts/mt7621_renkforce_ws-wn530hp3-a.dts
Normal file
159
target/linux/ramips/dts/mt7621_renkforce_ws-wn530hp3-a.dts
Normal file
@ -0,0 +1,159 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "mt7621.dtsi"
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
|
||||
/ {
|
||||
compatible = "renkforce,ws-wn530hp3-a", "mediatek,mt7621-soc";
|
||||
model = "Renkforce WS-WN530HP3-A";
|
||||
|
||||
aliases {
|
||||
label-mac-device = &gmac0;
|
||||
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 18 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <KEY_RESTART>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led_power: led_1 {
|
||||
label = "red:led1";
|
||||
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_2 {
|
||||
label = "blue:led2";
|
||||
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <40000000>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "u-boot";
|
||||
reg = <0x0 0x30000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@30000 {
|
||||
label = "u-boot-env";
|
||||
reg = <0x30000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
factory: partition@40000 {
|
||||
label = "factory";
|
||||
reg = <0x40000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@50000 {
|
||||
compatible = "denx,uimage";
|
||||
label = "firmware";
|
||||
reg = <0x50000 0xf30000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pcie {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie0 {
|
||||
wifi0: wifi@0,0 {
|
||||
compatible = "mediatek,mt76";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
mediatek,mtd-eeprom = <&factory 0x0000>;
|
||||
ieee80211-freq-limit = <2400000 2500000>;
|
||||
nvmem-cells = <&macaddr_factory_4>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
};
|
||||
};
|
||||
|
||||
&pcie1 {
|
||||
wifi1: wifi@0,0 {
|
||||
compatible = "mediatek,mt76";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
mediatek,mtd-eeprom = <&factory 0x8000>;
|
||||
ieee80211-freq-limit = <5000000 6000000>;
|
||||
nvmem-cells = <&macaddr_factory_4>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
mac-address-increment = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
&gmac0 {
|
||||
nvmem-cells = <&macaddr_factory_4>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
mac-address-increment = <(-2)>;
|
||||
};
|
||||
|
||||
&switch0 {
|
||||
ports {
|
||||
port@0 {
|
||||
status = "okay";
|
||||
label = "lan2";
|
||||
};
|
||||
|
||||
port@1 {
|
||||
status = "okay";
|
||||
label = "lan1";
|
||||
};
|
||||
|
||||
port@4 {
|
||||
status = "okay";
|
||||
label = "wan";
|
||||
nvmem-cells = <&macaddr_factory_4>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
mac-address-increment = <(-1)>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&state_default {
|
||||
gpio {
|
||||
groups = "uart2", "jtag", "wdt";
|
||||
function = "gpio";
|
||||
};
|
||||
};
|
||||
|
||||
&xhci {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&factory {
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_factory_4: macaddr@4 {
|
||||
reg = <0x4 0x6>;
|
||||
};
|
||||
};
|
12
target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608-16m.dts
Normal file
12
target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608-16m.dts
Normal file
@ -0,0 +1,12 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "mt7621_zbtlink_zbt-wg1608.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "zbtlink,zbt-wg1608-16m", "zbtlink,zbt-wg1608", "mediatek,mt7621-soc";
|
||||
model = "Zbtlink ZBT-WG1608 (16M)";
|
||||
};
|
||||
|
||||
&firmware {
|
||||
reg = <0x50000 0xfb0000>;
|
||||
};
|
228
target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi
Normal file
228
target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi
Normal file
@ -0,0 +1,228 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "mt7621.dtsi"
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/leds/common.h>
|
||||
|
||||
/ {
|
||||
compatible = "zbtlink,zbt-wg1608", "mediatek,mt7621-soc";
|
||||
|
||||
aliases {
|
||||
led-boot = &led_internet;
|
||||
led-failsafe = &led_internet;
|
||||
led-running = &led_internet;
|
||||
led-upgrade = &led_internet;
|
||||
label-mac-device = &gmac0;
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyS0,115200";
|
||||
};
|
||||
|
||||
keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <KEY_RESTART>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led_internet: internet {
|
||||
label = "green:internet";
|
||||
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
wwan {
|
||||
label = "green:wwan";
|
||||
gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "usbport";
|
||||
trigger-sources = <&hub_port2>;
|
||||
};
|
||||
|
||||
wifi5g {
|
||||
label = "green:wifi5g";
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "phy1tpt";
|
||||
};
|
||||
|
||||
lan1 {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
function-enumerator = <1>;
|
||||
gpios = <&switch0 0 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
lan2 {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
function-enumerator = <2>;
|
||||
gpios = <&switch0 3 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
lan3 {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
function-enumerator = <3>;
|
||||
gpios = <&switch0 6 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
lan4 {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
function-enumerator = <4>;
|
||||
gpios = <&switch0 9 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
wan {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_WAN;
|
||||
gpios = <&switch0 12 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&sdhci {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
|
||||
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 0x30000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@30000 {
|
||||
label = "u-boot-env";
|
||||
reg = <0x30000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
factory: partition@40000 {
|
||||
label = "factory";
|
||||
reg = <0x40000 0x10000>;
|
||||
read-only;
|
||||
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_factory_e000: macaddr@e000 {
|
||||
reg = <0xe000 0x6>;
|
||||
};
|
||||
|
||||
macaddr_factory_e006: macaddr@e006 {
|
||||
reg = <0xe006 0x6>;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
firmware: partition@50000 {
|
||||
compatible = "denx,uimage";
|
||||
label = "firmware";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pcie {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie0 {
|
||||
wifi@0,0 {
|
||||
compatible = "mediatek,mt76";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
mediatek,mtd-eeprom = <&factory 0x0000>;
|
||||
};
|
||||
};
|
||||
|
||||
&pcie1 {
|
||||
wifi@0,0 {
|
||||
compatible = "mediatek,mt76";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
mediatek,mtd-eeprom = <&factory 0x8000>;
|
||||
ieee80211-freq-limit = <5000000 6000000>;
|
||||
};
|
||||
};
|
||||
|
||||
&gmac0 {
|
||||
nvmem-cells = <&macaddr_factory_e000>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
};
|
||||
|
||||
&switch0 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ports {
|
||||
port@0 {
|
||||
status = "okay";
|
||||
label = "lan1";
|
||||
};
|
||||
|
||||
port@1 {
|
||||
status = "okay";
|
||||
label = "lan2";
|
||||
};
|
||||
|
||||
port@2 {
|
||||
status = "okay";
|
||||
label = "lan3";
|
||||
};
|
||||
|
||||
port@3 {
|
||||
status = "okay";
|
||||
label = "lan4";
|
||||
};
|
||||
|
||||
port@4 {
|
||||
status = "okay";
|
||||
label = "wan";
|
||||
nvmem-cells = <&macaddr_factory_e006>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&state_default {
|
||||
gpio {
|
||||
groups = "wdt", "uart2", "jtag";
|
||||
function = "gpio";
|
||||
};
|
||||
};
|
||||
|
||||
&xhci_ehci_port1 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
hub_port2: port@2 {
|
||||
reg = <2>;
|
||||
#trigger-source-cells = <0>;
|
||||
};
|
||||
|
||||
port@4 {
|
||||
reg = <4>;
|
||||
#trigger-source-cells = <0>;
|
||||
};
|
||||
};
|
||||
|
157
target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dts
Normal file
157
target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dts
Normal file
@ -0,0 +1,157 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
// Copyright (c) 2022 Ray Wang
|
||||
// Copyright (c) 2022 Ivan Pavlov
|
||||
|
||||
#include "mt7628an.dtsi"
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
|
||||
/ {
|
||||
compatible = "asus,rt-ac1200", "mediatek,mt7628an-soc";
|
||||
model = "Asus RT-AC1200";
|
||||
|
||||
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 5 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <KEY_RESTART>;
|
||||
};
|
||||
|
||||
wps {
|
||||
label = "wps";
|
||||
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <KEY_WPS_BUTTON>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led_power: power {
|
||||
label = "blue:power";
|
||||
gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
wlan2g {
|
||||
label = "blue:wlan2g";
|
||||
gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
|
||||
usb {
|
||||
label = "blue:usb";
|
||||
gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
|
||||
trigger-sources = <&ohci_port1>, <&ehci_port1>;
|
||||
linux,default-trigger = "usbport";
|
||||
};
|
||||
};
|
||||
|
||||
gpio-export {
|
||||
compatible = "gpio-export";
|
||||
#size-cells = <0>;
|
||||
|
||||
led-all {
|
||||
gpio-export,name = "led_all";
|
||||
gpio-export,output = <0>;
|
||||
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <40000000>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "bootloader";
|
||||
reg = <0x0 0x30000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@30000 {
|
||||
label = "nvram";
|
||||
reg = <0x30000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
factory: partition@40000 {
|
||||
label = "factory";
|
||||
reg = <0x40000 0x10000>;
|
||||
read-only;
|
||||
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_factory_28: macaddr@28 {
|
||||
reg = <0x28 0x6>;
|
||||
};
|
||||
};
|
||||
|
||||
partition@50000 {
|
||||
compatible = "denx,uimage";
|
||||
label = "firmware";
|
||||
reg = <0x50000 0xfb0000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ðernet {
|
||||
nvmem-cells = <&macaddr_factory_28>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
};
|
||||
|
||||
&esw {
|
||||
mediatek,portmap = <0x3e>;
|
||||
};
|
||||
|
||||
&wmac {
|
||||
status = "okay";
|
||||
|
||||
mediatek,mtd-eeprom = <&factory 0x0>;
|
||||
};
|
||||
|
||||
&pcie {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie0 {
|
||||
wifi@0,0 {
|
||||
compatible = "mediatek,mt76";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
mediatek,mtd-eeprom = <&factory 0x8000>;
|
||||
ieee80211-freq-limit = <5000000 6000000>;
|
||||
|
||||
led {
|
||||
led-sources = <2>;
|
||||
led-active-low;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&state_default {
|
||||
gpio {
|
||||
groups = "i2c", "spi cs1", "refclk", "wled_an";
|
||||
function = "gpio";
|
||||
};
|
||||
};
|
@ -75,6 +75,17 @@
|
||||
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
gpio_export {
|
||||
compatible = "gpio-export";
|
||||
#size-cells = <0>;
|
||||
|
||||
usbpower {
|
||||
gpio-export,name = "usbpower";
|
||||
gpio-export,output = <1>;
|
||||
gpios = <&gpio 39 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
@ -120,7 +131,7 @@
|
||||
|
||||
&state_default {
|
||||
gpio {
|
||||
groups = "i2s", "refclk", "wdt", "p2led_an", "p1led_an", "p0led_an", "wled_an";
|
||||
groups = "i2s", "refclk", "wdt", "p4led_an", "p2led_an", "p1led_an", "p0led_an", "wled_an";
|
||||
function = "gpio";
|
||||
};
|
||||
};
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
/ {
|
||||
compatible = "unbranded,wr512-3gn-4m", "unbranded,wr512-3gn", "ralink,rt3052-soc";
|
||||
model = "WR512-3GN (4M)";
|
||||
model = "Unbranded WR512-3GN (4M)";
|
||||
|
||||
flash@1f000000 {
|
||||
compatible = "cfi-flash";
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
/ {
|
||||
compatible = "unbranded,wr512-3gn-8m", "unbranded,wr512-3gn", "ralink,rt3052-soc";
|
||||
model = "WR512-3GN (8M)";
|
||||
model = "Unbranded WR512-3GN (8M)";
|
||||
|
||||
flash@1f000000 {
|
||||
compatible = "cfi-flash";
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
/ {
|
||||
compatible = "unbranded,xdx-rn502j", "ralink,rt3052-soc";
|
||||
model = "XDX RN502J";
|
||||
model = "Unbranded XDX-RN502J";
|
||||
|
||||
aliases {
|
||||
led-boot = &led_power;
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
/ {
|
||||
compatible = "unbranded,a5-v11", "ralink,rt5350-soc";
|
||||
model = "A5-V11";
|
||||
model = "Unbranded A5-V11";
|
||||
|
||||
aliases {
|
||||
led-boot = &led_power;
|
||||
|
@ -1360,6 +1360,17 @@ define Device/raisecom_msg1500-x-00
|
||||
endef
|
||||
TARGET_DEVICES += raisecom_msg1500-x-00
|
||||
|
||||
define Device/renkforce_ws-wn530hp3-a
|
||||
$(Device/dsa-migration)
|
||||
DEVICE_VENDOR := Renkforce
|
||||
DEVICE_MODEL := WS-WN530HP3-A
|
||||
DEVICE_PACKAGES += kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap
|
||||
IMAGE/sysupgrade.bin := append-kernel | pad-to 65536 | append-rootfs | \
|
||||
check-size | append-metadata
|
||||
IMAGE_SIZE := 15040k
|
||||
endef
|
||||
TARGET_DEVICES += renkforce_ws-wn530hp3-a
|
||||
|
||||
define Device/samknows_whitebox-v8
|
||||
$(Device/dsa-migration)
|
||||
IMAGE_SIZE := 16064k
|
||||
@ -1901,6 +1912,18 @@ define Device/zbtlink_zbt-wg1602-16m
|
||||
endef
|
||||
TARGET_DEVICES += zbtlink_zbt-wg1602-16m
|
||||
|
||||
define Device/zbtlink_zbt-wg1608-16m
|
||||
$(Device/dsa-migration)
|
||||
$(Device/uimage-lzma-loader)
|
||||
IMAGE_SIZE := 16064k
|
||||
DEVICE_VENDOR := Zbtlink
|
||||
DEVICE_MODEL := ZBT-WG1608
|
||||
DEVICE_VARIANT := 16M
|
||||
DEVICE_PACKAGES := kmod-sdhci-mt7620 kmod-mt7603 kmod-mt7615e \
|
||||
kmod-mt7663-firmware-ap kmod-usb3 kmod-usb-ledtrig-usbport
|
||||
endef
|
||||
TARGET_DEVICES += zbtlink_zbt-wg1608-16m
|
||||
|
||||
define Device/zbtlink_zbt-wg2626
|
||||
$(Device/dsa-migration)
|
||||
$(Device/uimage-lzma-loader)
|
||||
|
@ -38,6 +38,15 @@ define Device/alfa-network_awusfree1
|
||||
endef
|
||||
TARGET_DEVICES += alfa-network_awusfree1
|
||||
|
||||
define Device/asus_rt-ac1200
|
||||
IMAGE_SIZE := 16064k
|
||||
DEVICE_VENDOR := Asus
|
||||
DEVICE_MODEL := RT-AC1200
|
||||
DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci \
|
||||
kmod-usb-ledtrig-usbport
|
||||
endef
|
||||
TARGET_DEVICES += asus_rt-ac1200
|
||||
|
||||
define Device/asus_rt-n10p-v3
|
||||
IMAGE_SIZE := 7872k
|
||||
DEVICE_VENDOR := Asus
|
||||
|
@ -1071,7 +1071,7 @@ define Device/unbranded_a5-v11
|
||||
IMAGES += factory.bin
|
||||
IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \
|
||||
poray-header -B A5-V11 -F 4M
|
||||
DEVICE_VENDOR :=
|
||||
DEVICE_VENDOR := Unbranded
|
||||
DEVICE_MODEL := A5-V11
|
||||
DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2
|
||||
SUPPORTED_DEVICES += a5-v11
|
||||
@ -1082,7 +1082,7 @@ TARGET_DEVICES += unbranded_a5-v11
|
||||
define Device/unbranded_wr512-3gn-4m
|
||||
SOC := rt3052
|
||||
IMAGE_SIZE := 3776k
|
||||
DEVICE_VENDOR := Ralink
|
||||
DEVICE_VENDOR := Unbranded
|
||||
DEVICE_MODEL := WR512-3GN
|
||||
DEVICE_VARIANT := 4M
|
||||
SUPPORTED_DEVICES += wr512-3gn-4M
|
||||
@ -1093,7 +1093,7 @@ TARGET_DEVICES += unbranded_wr512-3gn-4m
|
||||
define Device/unbranded_wr512-3gn-8m
|
||||
SOC := rt3052
|
||||
IMAGE_SIZE := 7872k
|
||||
DEVICE_VENDOR := Ralink
|
||||
DEVICE_VENDOR := Unbranded
|
||||
DEVICE_MODEL := WR512-3GN
|
||||
DEVICE_VARIANT := 8M
|
||||
SUPPORTED_DEVICES += wr512-3gn-8M
|
||||
@ -1104,8 +1104,8 @@ define Device/unbranded_xdx-rn502j
|
||||
SOC := rt3052
|
||||
BLOCKSIZE := 64k
|
||||
IMAGE_SIZE := 3776k
|
||||
DEVICE_VENDOR := XDX
|
||||
DEVICE_MODEL := RN502J
|
||||
DEVICE_VENDOR := Unbranded
|
||||
DEVICE_MODEL := XDX-RN502J
|
||||
SUPPORTED_DEVICES += xdxrn502j
|
||||
DEFAULT := n
|
||||
endef
|
||||
|
@ -134,6 +134,13 @@ xiaomi,redmi-router-ac2100)
|
||||
youhua,wr1200js)
|
||||
ucidef_set_led_netdev "internet" "INTERNET" "green:wan" "wan"
|
||||
;;
|
||||
zbtlink,zbt-wg1608-16m)
|
||||
ucidef_set_led_netdev "lan1" "LAN1" "green:lan-1" "lan1"
|
||||
ucidef_set_led_netdev "lan2" "LAN2" "green:lan-2" "lan2"
|
||||
ucidef_set_led_netdev "lan3" "LAN3" "green:lan-3" "lan3"
|
||||
ucidef_set_led_netdev "lan4" "LAN4" "green:lan-4" "lan4"
|
||||
ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
@ -43,6 +43,7 @@ ramips_setup_interfaces()
|
||||
jcg,q20|\
|
||||
lenovo,newifi-d1|\
|
||||
mikrotik,routerboard-m33g|\
|
||||
renkforce,ws-wn530hp3-a|\
|
||||
xiaomi,mi-router-3g|\
|
||||
xiaomi,mi-router-3g-v2|\
|
||||
xiaomi,mi-router-4|\
|
||||
|
@ -34,6 +34,29 @@ ramips_setup_interfaces()
|
||||
ucidef_add_switch_attr "switch0" "enable" "false"
|
||||
ucidef_set_interface_lan "eth0"
|
||||
;;
|
||||
asus,rt-ac1200|\
|
||||
hilink,hlk-7628n|\
|
||||
hilink,hlk-7688a|\
|
||||
hiwifi,hc5861b|\
|
||||
skylab,skw92a|\
|
||||
tplink,archer-c20-v4|\
|
||||
tplink,archer-c20-v5|\
|
||||
tplink,archer-c50-v3|\
|
||||
tplink,archer-c50-v4|\
|
||||
tplink,tl-mr3420-v5|\
|
||||
tplink,tl-wr840n-v4|\
|
||||
tplink,tl-wr840n-v5|\
|
||||
tplink,tl-wr841n-v13|\
|
||||
tplink,tl-wr841n-v14|\
|
||||
tplink,tl-wr842n-v5|\
|
||||
tplink,tl-wr850n-v2|\
|
||||
unielec,u7628-01-16m|\
|
||||
wrtnode,wrtnode2p|\
|
||||
wrtnode,wrtnode2r|\
|
||||
zyxel,keenetic-extra-ii)
|
||||
ucidef_add_switch "switch0" \
|
||||
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
|
||||
;;
|
||||
asus,rt-n10p-v3|\
|
||||
asus,rt-n11p-b1|\
|
||||
asus,rt-n12-vp-b1|\
|
||||
@ -69,28 +92,6 @@ ramips_setup_interfaces()
|
||||
ucidef_add_switch "switch0" \
|
||||
"1:lan" "0:wan" "6@eth0"
|
||||
;;
|
||||
hilink,hlk-7628n|\
|
||||
hilink,hlk-7688a|\
|
||||
hiwifi,hc5861b|\
|
||||
skylab,skw92a|\
|
||||
tplink,archer-c20-v4|\
|
||||
tplink,archer-c20-v5|\
|
||||
tplink,archer-c50-v3|\
|
||||
tplink,archer-c50-v4|\
|
||||
tplink,tl-mr3420-v5|\
|
||||
tplink,tl-wr840n-v4|\
|
||||
tplink,tl-wr840n-v5|\
|
||||
tplink,tl-wr841n-v13|\
|
||||
tplink,tl-wr841n-v14|\
|
||||
tplink,tl-wr842n-v5|\
|
||||
tplink,tl-wr850n-v2|\
|
||||
unielec,u7628-01-16m|\
|
||||
wrtnode,wrtnode2p|\
|
||||
wrtnode,wrtnode2r|\
|
||||
zyxel,keenetic-extra-ii)
|
||||
ucidef_add_switch "switch0" \
|
||||
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
|
||||
;;
|
||||
hiwifi,hc5761a)
|
||||
ucidef_add_switch "switch0" \
|
||||
"0:lan" "1:lan" "4:wan" "6@eth0"
|
||||
@ -176,6 +177,11 @@ ramips_setup_macs()
|
||||
local label_mac=""
|
||||
|
||||
case $board in
|
||||
asus,rt-ac1200|\
|
||||
elecom,wrc-1167fs)
|
||||
wan_mac=$(mtd_get_mac_binary factory 0x22)
|
||||
label_mac=$wan_mac
|
||||
;;
|
||||
buffalo,wcr-1166ds)
|
||||
wan_mac=$(mtd_get_mac_ascii board_data "mac")
|
||||
lan_mac=$wan_mac
|
||||
@ -198,10 +204,6 @@ ramips_setup_macs()
|
||||
zyxel,keenetic-extra-ii)
|
||||
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1)
|
||||
;;
|
||||
elecom,wrc-1167fs)
|
||||
wan_mac=$(mtd_get_mac_binary factory 0x22)
|
||||
label_mac=$wan_mac
|
||||
;;
|
||||
hiwifi,hc5661a|\
|
||||
hiwifi,hc5761a|\
|
||||
hiwifi,hc5861b)
|
||||
|
@ -173,6 +173,7 @@ CONFIG_PATA_MPIIX=y
|
||||
CONFIG_PATA_OLDPIIX=y
|
||||
CONFIG_PATA_PLATFORM=y
|
||||
CONFIG_PATA_SC1200=y
|
||||
CONFIG_PATA_SIS=y
|
||||
CONFIG_PATA_TIMINGS=y
|
||||
CONFIG_PATA_VIA=y
|
||||
CONFIG_PCIEAER=y
|
||||
|
@ -9,6 +9,10 @@ choice
|
||||
config BINUTILS_USE_VERSION_2_37
|
||||
bool "Binutils 2.37"
|
||||
select BINUTILS_VERSION_2_37
|
||||
|
||||
config BINUTILS_USE_VERSION_2_38
|
||||
bool "Binutils 2.38"
|
||||
select BINUTILS_VERSION_2_38
|
||||
endchoice
|
||||
|
||||
config EXTRA_BINUTILS_CONFIG_OPTIONS
|
||||
|
@ -3,6 +3,10 @@ config BINUTILS_VERSION_2_37
|
||||
default y if !TOOLCHAINOPTS
|
||||
bool
|
||||
|
||||
config BINUTILS_VERSION_2_38
|
||||
bool
|
||||
|
||||
config BINUTILS_VERSION
|
||||
string
|
||||
default "2.37" if BINUTILS_VERSION_2_37
|
||||
default "2.38" if BINUTILS_VERSION_2_38
|
||||
|
@ -35,6 +35,10 @@ ifeq ($(PKG_VERSION),2.37)
|
||||
PKG_HASH:=820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c
|
||||
endif
|
||||
|
||||
ifeq ($(PKG_VERSION),2.38)
|
||||
PKG_HASH:=e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024
|
||||
endif
|
||||
|
||||
HOST_BUILD_PARALLEL:=1
|
||||
|
||||
PATCH_DIR:=./patches/$(PKG_VERSION)
|
||||
|
@ -0,0 +1,22 @@
|
||||
--- a/ld/Makefile.am
|
||||
+++ b/ld/Makefile.am
|
||||
@@ -50,7 +50,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
|
||||
# We put the scripts in the directory $(scriptdir)/ldscripts.
|
||||
# We can't put the scripts in $(datadir) because the SEARCH_DIR
|
||||
# directives need to be different for native and cross linkers.
|
||||
-scriptdir = $(tooldir)/lib
|
||||
+scriptdir = $(libdir)
|
||||
|
||||
EMUL = @EMUL@
|
||||
EMULATION_OFILES = @EMULATION_OFILES@
|
||||
--- a/ld/Makefile.in
|
||||
+++ b/ld/Makefile.in
|
||||
@@ -563,7 +563,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
|
||||
# We put the scripts in the directory $(scriptdir)/ldscripts.
|
||||
# We can't put the scripts in $(datadir) because the SEARCH_DIR
|
||||
# directives need to be different for native and cross linkers.
|
||||
-scriptdir = $(tooldir)/lib
|
||||
+scriptdir = $(libdir)
|
||||
BASEDIR = $(srcdir)/..
|
||||
BFDDIR = $(BASEDIR)/bfd
|
||||
INCDIR = $(BASEDIR)/include
|
@ -0,0 +1,18 @@
|
||||
--- a/bfd/elfxx-mips.c
|
||||
+++ b/bfd/elfxx-mips.c
|
||||
@@ -8057,6 +8057,7 @@ _bfd_mips_elf_create_dynamic_sections (b
|
||||
|
||||
name = SGI_COMPAT (abfd) ? "_DYNAMIC_LINK" : "_DYNAMIC_LINKING";
|
||||
bh = NULL;
|
||||
+ if (0) {
|
||||
if (!(_bfd_generic_link_add_one_symbol
|
||||
(info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr, 0,
|
||||
NULL, false, get_elf_backend_data (abfd)->collect, &bh)))
|
||||
@@ -8069,6 +8070,7 @@ _bfd_mips_elf_create_dynamic_sections (b
|
||||
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return false;
|
||||
+ }
|
||||
|
||||
if (! mips_elf_hash_table (info)->use_rld_obj_head)
|
||||
{
|
@ -0,0 +1,38 @@
|
||||
--- a/bfd/config.bfd
|
||||
+++ b/bfd/config.bfd
|
||||
@@ -928,12 +928,12 @@ case "${targ}" in
|
||||
targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
|
||||
;;
|
||||
mips64*el-*-linux*)
|
||||
- targ_defvec=mips_elf32_ntrad_le_vec
|
||||
- targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec"
|
||||
+ targ_defvec=mips_elf64_trad_le_vec
|
||||
+ targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_be_vec"
|
||||
;;
|
||||
mips64*-*-linux*)
|
||||
- targ_defvec=mips_elf32_ntrad_be_vec
|
||||
- targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
|
||||
+ targ_defvec=mips_elf64_trad_be_vec
|
||||
+ targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_le_vec"
|
||||
;;
|
||||
mips*el-*-linux*)
|
||||
targ_defvec=mips_elf32_trad_le_vec
|
||||
--- a/ld/configure.tgt
|
||||
+++ b/ld/configure.tgt
|
||||
@@ -543,12 +543,12 @@ mips*-*-vxworks*) targ_emul=elf32ebmipvx
|
||||
;;
|
||||
mips*-*-windiss) targ_emul=elf32mipswindiss
|
||||
;;
|
||||
-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32
|
||||
- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
|
||||
+mips64*el-*-linux-*) targ_emul=elf64ltsmip
|
||||
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip"
|
||||
targ_extra_libpath=$targ_extra_emuls
|
||||
;;
|
||||
-mips64*-*-linux-*) targ_emul=elf32btsmipn32
|
||||
- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
|
||||
+mips64*-*-linux-*) targ_emul=elf64btsmip
|
||||
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip"
|
||||
targ_extra_libpath=$targ_extra_emuls
|
||||
;;
|
||||
mips*el-*-linux-*) targ_emul=elf32ltsmip
|
@ -1,145 +0,0 @@
|
||||
From 6d659fc87451c02c8777dc33f750b16834e4c715 Mon Sep 17 00:00:00 2001
|
||||
From: Mathias Kresin <dev@kresin.me>
|
||||
Date: Sat, 12 Jan 2019 19:33:33 +0100
|
||||
Subject: [PATCH] add option for reproducible archives
|
||||
|
||||
Add the option -mt/--mtime to pass a timestamp which is used as filedate
|
||||
for the containing files.
|
||||
|
||||
So far, it isn't used for anything written to the extra fields,
|
||||
therefore requires the -X (eXclude eXtra file attributes) parameter to
|
||||
be effective.
|
||||
|
||||
Signed-off-by: Mathias Kresin <dev@kresin.me>
|
||||
---
|
||||
globals.c | 1 +
|
||||
util.c | 22 ++++++++++++++++++++++
|
||||
zip.c | 6 ++++++
|
||||
zip.h | 1 +
|
||||
zipup.c | 4 +++-
|
||||
5 files changed, 33 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/globals.c
|
||||
+++ b/globals.c
|
||||
@@ -205,6 +205,7 @@ uzoff_t bytes_this_split = 0; /* byt
|
||||
int read_split_archive = 0; /* 1=scanzipf_reg detected spanning signature */
|
||||
int split_method = 0; /* 0=no splits, 1=seekable, 2=data desc, -1=no */
|
||||
uzoff_t split_size = 0; /* how big each split should be */
|
||||
+time_t timestamp = -1; /* fixed timestamp for archive content filedate */
|
||||
int split_bell = 0; /* when pause for next split ring bell */
|
||||
uzoff_t bytes_prev_splits = 0; /* total bytes written to all splits before this */
|
||||
uzoff_t bytes_this_entry = 0; /* bytes written for this entry across all splits */
|
||||
--- a/util.c
|
||||
+++ b/util.c
|
||||
@@ -1217,6 +1217,7 @@ int DisplayNumString(file, i)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+
|
||||
/* Read numbers with trailing size multiplier (like 10M) and return number.
|
||||
10/30/04 EG */
|
||||
|
||||
@@ -1279,6 +1280,29 @@ uzoff_t ReadNumString( numstring )
|
||||
}
|
||||
|
||||
|
||||
+uzoff_t ReadNumStringUL( numstring )
|
||||
+ char *numstring;
|
||||
+{
|
||||
+ zoff_t num = 0;
|
||||
+
|
||||
+ /* check if valid number (currently no negatives) */
|
||||
+ if (numstring == NULL) {
|
||||
+ zipwarn("Unable to read empty number in ReadNumString", "");
|
||||
+ return (uzoff_t)-1;
|
||||
+ }
|
||||
+ if (numstring[0] < '0' || numstring[0] > '9') {
|
||||
+ zipwarn("Unable to read number (must start with digit): ", numstring);
|
||||
+ return (uzoff_t)-1;
|
||||
+ }
|
||||
+ if (strlen(numstring) > 10) {
|
||||
+ zipwarn("Number too long to read (10 characters max): ", numstring);
|
||||
+ return (uzoff_t)-1;
|
||||
+ }
|
||||
+
|
||||
+ return (uzoff_t)atoll(numstring);
|
||||
+}
|
||||
+
|
||||
+
|
||||
/* Write the number as a string with a multiplier (like 10M) to outstring.
|
||||
Always writes no more than 3 digits followed maybe by a multiplier and
|
||||
returns the characters written or -1 if error.
|
||||
--- a/zip.c
|
||||
+++ b/zip.c
|
||||
@@ -1942,6 +1942,7 @@ int set_filetype(out_path)
|
||||
#ifdef UNICODE_TEST
|
||||
#define o_sC 0x146
|
||||
#endif
|
||||
+#define o_mt 0x255
|
||||
|
||||
|
||||
/* the below is mainly from the old main command line
|
||||
@@ -2036,6 +2037,7 @@ struct option_struct far options[] = {
|
||||
{"m", "move", o_NO_VALUE, o_NOT_NEGATABLE, 'm', "add files to archive then delete files"},
|
||||
{"mm", "", o_NO_VALUE, o_NOT_NEGATABLE, o_mm, "not used"},
|
||||
{"MM", "must-match", o_NO_VALUE, o_NOT_NEGATABLE, o_MM, "error if in file not matched/not readable"},
|
||||
+ {"mt", "mtime", o_REQUIRED_VALUE, o_NOT_NEGATABLE, o_mt, "use fixed timestamp for archive content filedate"},
|
||||
{"n", "suffixes", o_REQUIRED_VALUE, o_NOT_NEGATABLE, 'n', "suffixes to not compress: .gz:.zip"},
|
||||
{"nw", "no-wild", o_NO_VALUE, o_NOT_NEGATABLE, o_nw, "no wildcards during add or update"},
|
||||
#if defined(AMIGA) || defined(MACOS)
|
||||
@@ -2440,6 +2442,7 @@ char **argv; /* command line
|
||||
split_method = 0; /* 0=no splits, 1=update LHs, 2=data descriptors */
|
||||
split_size = 0; /* how big each split should be */
|
||||
split_bell = 0; /* when pause for next split ring bell */
|
||||
+ timestamp = -1; /* fixed timestamp for archive content filedate */
|
||||
bytes_prev_splits = 0; /* total bytes written to all splits before this */
|
||||
bytes_this_entry = 0; /* bytes written for this entry across all splits */
|
||||
noisy_splits = 0; /* be verbose about creating splits */
|
||||
@@ -2897,6 +2900,9 @@ char **argv; /* command line
|
||||
dispose = 1; break;
|
||||
case o_MM: /* Exit with error if input file can't be read */
|
||||
bad_open_is_error = 1; break;
|
||||
+ case o_mt: /* fixed timestamp for archive content filedate */
|
||||
+ timestamp = ReadNumStringUL(value);
|
||||
+ break;
|
||||
case 'n': /* Don't compress files with a special suffix */
|
||||
special = value;
|
||||
/* special = NULL; */ /* will be set at next argument */
|
||||
--- a/zip.h
|
||||
+++ b/zip.h
|
||||
@@ -502,6 +502,7 @@ extern uzoff_t bytes_this_split; /* byte
|
||||
extern int read_split_archive; /* 1=scanzipf_reg detected spanning signature */
|
||||
extern int split_method; /* 0=no splits, 1=seekable, 2=data descs, -1=no */
|
||||
extern uzoff_t split_size; /* how big each split should be */
|
||||
+extern time_t timestamp; /* fixed timestamp for archive content filedate */
|
||||
extern int split_bell; /* when pause for next split ring bell */
|
||||
extern uzoff_t bytes_prev_splits; /* total bytes written to all splits before this */
|
||||
extern uzoff_t bytes_this_entry; /* bytes written for this entry across all splits */
|
||||
@@ -789,6 +790,7 @@ char *zip_fzofft OF((zoff_t, char
|
||||
int DisplayNumString OF ((FILE *file, uzoff_t i));
|
||||
int WriteNumString OF((uzoff_t num, char *outstring));
|
||||
uzoff_t ReadNumString OF((char *numstring));
|
||||
+uzoff_t ReadNumStringUL OF((char *numstring));
|
||||
|
||||
/* returns true if abbrev is abbreviation for string */
|
||||
int abbrevmatch OF((char *, char *, int, int));
|
||||
--- a/zipup.c
|
||||
+++ b/zipup.c
|
||||
@@ -415,7 +415,6 @@ struct zlist far *z; /* zip entry to
|
||||
char *tempextra = NULL;
|
||||
char *tempcextra = NULL;
|
||||
|
||||
-
|
||||
#ifdef WINDLL
|
||||
# ifdef ZIP64_SUPPORT
|
||||
extern _int64 filesize64;
|
||||
@@ -441,6 +440,9 @@ struct zlist far *z; /* zip entry to
|
||||
if (tim == 0 || q == (zoff_t) -3)
|
||||
return ZE_OPEN;
|
||||
|
||||
+ if (timestamp > 0)
|
||||
+ tim = unix2dostime(×tamp);
|
||||
+
|
||||
/* q is set to -1 if the input file is a device, -2 for a volume label */
|
||||
if (q == (zoff_t) -2) {
|
||||
isdir = 1;
|
41
tools/zip/patches/011-reproducible-mtime.patch
Normal file
41
tools/zip/patches/011-reproducible-mtime.patch
Normal file
@ -0,0 +1,41 @@
|
||||
From 501ae4e93fd6fa2f7d20d00d1b011f9006802eae Mon Sep 17 00:00:00 2001
|
||||
From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
|
||||
Date: Fri, 3 May 2019 16:32:24 +0200
|
||||
Subject: [PATCH] Override mtime with zip -X
|
||||
|
||||
with SOURCE_DATE_EPOCH
|
||||
to allow for reproducible builds of .zip files
|
||||
|
||||
See https://reproducible-builds.org/ for why this is good
|
||||
and https://reproducible-builds.org/specs/source-date-epoch/
|
||||
for the definition of this variable.
|
||||
|
||||
Uses clamping to keep older mtimes than SOURCE_DATE_EPOCH intact.
|
||||
---
|
||||
zipup.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
--- a/zipup.c
|
||||
+++ b/zipup.c
|
||||
@@ -414,6 +414,7 @@ struct zlist far *z; /* zip entry to
|
||||
ush tempcext = 0;
|
||||
char *tempextra = NULL;
|
||||
char *tempcextra = NULL;
|
||||
+ const char *source_date_epoch;
|
||||
|
||||
|
||||
#ifdef WINDLL
|
||||
@@ -674,6 +675,13 @@ struct zlist far *z; /* zip entry to
|
||||
|
||||
} /* strcmp(z->name, "-") == 0 */
|
||||
|
||||
+ if (extra_fields == 0 && (source_date_epoch = getenv("SOURCE_DATE_EPOCH")) != NULL) {
|
||||
+ time_t epoch = strtoull(source_date_epoch, NULL, 10);
|
||||
+ if (epoch > 0) {
|
||||
+ ulg epochtim = unix2dostime(&epoch);
|
||||
+ if (z->tim > epochtim) z->tim = epochtim;
|
||||
+ }
|
||||
+ }
|
||||
if (extra_fields == 2) {
|
||||
unsigned len;
|
||||
char *p;
|
@ -0,0 +1,75 @@
|
||||
From db9165814823401d57383a8f9e82642129cf4223 Mon Sep 17 00:00:00 2001
|
||||
From: Sungbo Eo <mans0n@gorani.run>
|
||||
Date: Sat, 12 Feb 2022 16:42:14 +0900
|
||||
Subject: [PATCH] make encrypted archives reproducible
|
||||
|
||||
Zip always try to generate new encryption header depending on execution
|
||||
time and process id, which is far from being reproducible. This commit
|
||||
changes the zip srand() seed to a predictable value to generate
|
||||
reproducible random bytes for the encryption header. This will compromise
|
||||
the goal of secure archive encryption, but it would not be a big problem
|
||||
for our purpose.
|
||||
|
||||
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
|
||||
---
|
||||
crypt.c | 8 ++++++--
|
||||
globals.c | 1 +
|
||||
zip.h | 1 +
|
||||
zipup.c | 2 +-
|
||||
4 files changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/crypt.c
|
||||
+++ b/crypt.c
|
||||
@@ -29,7 +29,6 @@
|
||||
version without encryption capabilities).
|
||||
*/
|
||||
|
||||
-#define ZCRYPT_INTERNAL
|
||||
#include "zip.h"
|
||||
#include "crypt.h"
|
||||
#include "ttyio.h"
|
||||
@@ -219,7 +218,12 @@ void crypthead(passwd, crc)
|
||||
* often poorly implemented.
|
||||
*/
|
||||
if (++calls == 1) {
|
||||
- srand((unsigned)time(NULL) ^ ZCR_SEED2);
|
||||
+ unsigned zcr_seed1 = (unsigned)time(NULL);
|
||||
+#ifndef ZCRYPT_INTERNAL
|
||||
+ if (epoch > 0)
|
||||
+ zcr_seed1 = (unsigned)epoch;
|
||||
+#endif
|
||||
+ srand(zcr_seed1 ^ ZCR_SEED2);
|
||||
}
|
||||
init_keys(passwd);
|
||||
for (n = 0; n < RAND_HEAD_LEN-2; n++) {
|
||||
--- a/globals.c
|
||||
+++ b/globals.c
|
||||
@@ -206,6 +206,7 @@ int read_split_archive = 0; /* 1=s
|
||||
int split_method = 0; /* 0=no splits, 1=seekable, 2=data desc, -1=no */
|
||||
uzoff_t split_size = 0; /* how big each split should be */
|
||||
int split_bell = 0; /* when pause for next split ring bell */
|
||||
+time_t epoch = 0; /* timestamp from SOURCE_DATE_EPOCH */
|
||||
uzoff_t bytes_prev_splits = 0; /* total bytes written to all splits before this */
|
||||
uzoff_t bytes_this_entry = 0; /* bytes written for this entry across all splits */
|
||||
int noisy_splits = 0; /* note when splits are being created */
|
||||
--- a/zip.h
|
||||
+++ b/zip.h
|
||||
@@ -502,6 +502,7 @@ extern uzoff_t bytes_this_split; /* byte
|
||||
extern int read_split_archive; /* 1=scanzipf_reg detected spanning signature */
|
||||
extern int split_method; /* 0=no splits, 1=seekable, 2=data descs, -1=no */
|
||||
extern uzoff_t split_size; /* how big each split should be */
|
||||
+extern time_t epoch; /* timestamp from SOURCE_DATE_EPOCH */
|
||||
extern int split_bell; /* when pause for next split ring bell */
|
||||
extern uzoff_t bytes_prev_splits; /* total bytes written to all splits before this */
|
||||
extern uzoff_t bytes_this_entry; /* bytes written for this entry across all splits */
|
||||
--- a/zipup.c
|
||||
+++ b/zipup.c
|
||||
@@ -676,7 +676,7 @@ struct zlist far *z; /* zip entry to
|
||||
} /* strcmp(z->name, "-") == 0 */
|
||||
|
||||
if (extra_fields == 0 && (source_date_epoch = getenv("SOURCE_DATE_EPOCH")) != NULL) {
|
||||
- time_t epoch = strtoull(source_date_epoch, NULL, 10);
|
||||
+ epoch = strtoull(source_date_epoch, NULL, 10);
|
||||
if (epoch > 0) {
|
||||
ulg epochtim = unix2dostime(&epoch);
|
||||
if (z->tim > epochtim) z->tim = epochtim;
|
Loading…
x
Reference in New Issue
Block a user