Merge Official Source

This commit is contained in:
AmadeusGhost 2020-06-03 11:38:02 +08:00
commit f00fd9bf13
28 changed files with 679 additions and 187 deletions

View File

@ -8,11 +8,11 @@ endif
LINUX_VERSION-4.14 = .180
LINUX_VERSION-4.19 = .123
LINUX_VERSION-5.4 = .42
LINUX_VERSION-5.4 = .43
LINUX_KERNEL_HASH-4.14.180 = 444ef973d9b6a6ea174e4a9086f0aea980d8575d13302e431ad688f22e27ed0e
LINUX_KERNEL_HASH-4.19.123 = a79914d31a8d8c6b0e2bb0f2b143d615fe8a6c4dd2e0f36e97aa20efd69a993f
LINUX_KERNEL_HASH-5.4.42 = 4e431b7c0266a07b76fdb77f8917ad681f0fa34ffba0eb8a172b67f7ef57bc31
LINUX_KERNEL_HASH-5.4.43 = 2667b90a42d42557aca9e3d37bba1b4e71809b9523958e6870ada311c4790744
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))

View File

@ -6,23 +6,15 @@ PKG_RELEASE:=beta
PKG_MAINTAINER:=lisaac <https://github.com/lisaac/luci-app-diskman>
PKG_LICENSE:=AGPL-3.0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/lisaac/luci-app-diskman.git
PKG_SOURCE_VERSION:=$(PKG_VERSION)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)/config
config PACKAGE_$(PKG_NAME)_INCLUDE_btrfs_progs
bool "Include btrfs-progs"
default y
default n
config PACKAGE_$(PKG_NAME)_INCLUDE_lsblk
bool "Include lsblk"
default y
default n
config PACKAGE_$(PKG_NAME)_INCLUDE_mdadm
bool "Include mdadm"
default n
@ -57,7 +49,6 @@ define Package/$(PKG_NAME)/description
endef
define Build/Prepare
tar -xzvf $(DL_DIR)/$(PKG_SOURCE) -C $(BUILD_DIR)
endef
define Build/Compile
@ -69,17 +60,10 @@ rm -fr /tmp/luci-indexcache /tmp/luci-modulecache
endef
define Package/$(PKG_NAME)/install
# $(INSTALL_DIR) $(1)/
# cp -pR $(PKG_BUILD_DIR)/root/* $(1)/
# $(INSTALL_DIR) $(1)/www
# cp -pR $(PKG_BUILD_DIR)/htdoc/* $(1)/www
$(INSTALL_DIR) $(1)/usr/lib/lua/luci
cp -pR $(PKG_BUILD_DIR)/luasrc/* $(1)/usr/lib/lua/luci/
cp -pR ./luasrc/* $(1)/usr/lib/lua/luci/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
$$(foreach po,$$(shell find $(PKG_BUILD_DIR)/po/*/*.po), \
po2lmo $$(po) \
$(1)/usr/lib/lua/luci/i18n/diskman.$$(shell echo $$(po) | awk -F'/' '{print $$$$(NF-1)}').lmo;)
#po2lmo $(PKG_BUILD_DIR)/po/zh-cn/diskman.po $(1)/usr/lib/lua/luci/i18n/diskman.zh-cn.lmo
po2lmo ./po/zh_Hans/diskman.po $(1)/usr/lib/lua/luci/i18n/diskman.zh-cn.lmo
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -6,14 +6,6 @@ PKG_RELEASE:=beta
PKG_MAINTAINER:=lisaac <https://github.com/lisaac/luci-app-dockerman>
PKG_LICENSE:=AGPL-3.0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/lisaac/luci-app-dockerman.git
PKG_SOURCE_VERSION:=$(PKG_VERSION)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)/config
@ -41,7 +33,6 @@ define Package/$(PKG_NAME)/description
endef
define Build/Prepare
tar -xzvf $(DL_DIR)/$(PKG_SOURCE) -C $(BUILD_DIR)
endef
define Build/Compile
@ -57,22 +48,19 @@ endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr
cp -pR $(PKG_BUILD_DIR)/root/usr/* $(1)/usr/
cp -pR ./root/usr/* $(1)/usr/
$(INSTALL_DIR) $(1)/etc/config
cp -pR $(PKG_BUILD_DIR)/root/etc/config/* $(1)/etc/config/
cp -pR ./root/etc/config/* $(1)/etc/config/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/root/etc/init.d/* $(1)/etc/init.d/
$(INSTALL_BIN) ./root/etc/init.d/* $(1)/etc/init.d/
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) $(PKG_BUILD_DIR)/root/etc/uci-defaults/* $(1)/etc/uci-defaults/
# $(INSTALL_DIR) $(1)/www
# cp -pR $(PKG_BUILD_DIR)/htdoc/* $(1)/www
$(INSTALL_BIN) ./root/etc/uci-defaults/* $(1)/etc/uci-defaults/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci
cp -pR $(PKG_BUILD_DIR)/luasrc/* $(1)/usr/lib/lua/luci/
cp -pR ./luasrc/* $(1)/usr/lib/lua/luci/
$(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d
$(INSTALL_DATA) ./root/usr/share/rpcd/acl.d/*.json $(1)/usr/share/rpcd/acl.d/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
$$(foreach po,$$(shell find $(PKG_BUILD_DIR)/po/*/*.po), \
po2lmo $$(po) \
$(1)/usr/lib/lua/luci/i18n/dockerman.$$(shell echo $$(po) | awk -F'/' '{print $$$$(NF-1)}').lmo;)
#po2lmo $(PKG_BUILD_DIR)/po/zh_Hans/dockerman.po $(1)/usr/lib/lua/luci/i18n/dockerman.zh-cn.lmo
po2lmo ./po/zh_Hans/dockerman.po $(1)/usr/lib/lua/luci/i18n/dockerman.zh-cn.lmo
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -1,11 +1,11 @@
{
"luci-app-dockerman": {
"description": "Grant UCI access for luci-app-dockerman",
"read": {
"uci": [ "dockerman" ]
},
"write": {
"uci": [ "dockerman" ]
}
}
}
"luci-app-dockerman": {
"description": "Grant UCI access for luci-app-dockerman",
"read": {
"uci": [ "dockerman" ]
},
"write": {
"uci": [ "dockerman" ]
}
}
}

View File

@ -34,6 +34,8 @@ define Package/$(PKG_NAME)/install
$(INSTALL_BIN) ./root/etc/init.d/serverchan $(1)/etc/init.d
$(INSTALL_BIN) ./root/etc/uci-defaults/luci-serverchan $(1)/etc/uci-defaults/luci-serverchan
$(INSTALL_BIN) ./root/usr/bin/serverchan/serverchan $(1)/usr/bin/serverchan
$(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d
$(INSTALL_DATA) ./root/usr/share/rpcd/acl.d/*.json $(1)/usr/share/rpcd/acl.d/
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for Flow Offload
LUCI_DEPENDS:=+kmod-ipt-offload +pdnsd-alt +kmod-tcp-bbr @!LINUX_3_18 @!LINUX_4_9
LUCI_DEPENDS:=+kmod-ipt-offload +pdnsd-alt +kmod-tcp-bbr @!LINUX_4_9
LUCI_PKGARCH:=all
PKG_VERSION:=1.0
PKG_RELEASE:=15

View File

@ -3,6 +3,7 @@
#
*.moc
*conf-cfg
mconf_check
#
# configuration programs

86
scripts/sercomm-crypto.py Executable file
View File

@ -0,0 +1,86 @@
#!/usr/bin/env python3
import argparse
import binascii
import hashlib
import os
import struct
def create_header(key, version, iv, random, size):
header = struct.pack('32s32s32s32s32s', key, version, iv, random, size)
return header
def create_output(args):
in_st = os.stat(args.input_file)
in_size = in_st.st_size
key = "".encode('ascii')
version = args.version.encode('ascii')
iv = "".encode('ascii')
random = "".encode('ascii')
size = str(in_size).encode('ascii')
header = create_header(key, version, iv, random, size)
out_f = open(args.output_file, 'w+b')
out_f.write(header)
out_f.close()
md5 = hashlib.md5()
md5.update(header[0x60:0x80])
md5.update(header[0x20:0x40])
md5_1 = md5.digest()
md5 = hashlib.md5()
md5.update(header[0x80:0xA0])
md5.update(header[0x20:0x40])
md5_2 = md5.digest()
key = md5_1 + md5_2
key_f = open(args.key_file, 'w+b')
key_f.write(binascii.hexlify(bytearray(key)))
key_f.close()
print("AES 256 CBC Key:", binascii.hexlify(bytearray(key)))
def main():
global args
parser = argparse.ArgumentParser(description='')
parser.add_argument('--input-file',
dest='input_file',
action='store',
type=str,
help='Input file')
parser.add_argument('--key-file',
dest='key_file',
action='store',
type=str,
help='AES 256 CBC Key File')
parser.add_argument('--output-file',
dest='output_file',
action='store',
type=str,
help='Output file')
parser.add_argument('--version',
dest='version',
action='store',
type=str,
help='Version')
args = parser.parse_args()
if ((not args.input_file) or
(not args.key_file) or
(not args.output_file) or
(not args.version)):
parser.print_help()
create_output(args)
main()

View File

@ -0,0 +1,81 @@
#!/usr/bin/env python3
import argparse
import os
import struct
def create_header(args, size):
header = struct.pack('32s32s32s32s32s',
args.part_name.encode('ascii'),
str(size).encode('ascii'),
args.part_version.encode('ascii'),
"".encode('ascii'),
args.rootfs_version.encode('ascii'))
return header
def create_output(args):
in_st = os.stat(args.input_file)
in_size = in_st.st_size
header = create_header(args, in_size)
print(header)
in_f = open(args.input_file, 'r+b')
in_bytes = in_f.read(in_size)
in_f.close()
out_f = open(args.output_file, 'w+b')
out_f.write(header)
out_f.write(in_bytes)
out_f.close()
def main():
global args
parser = argparse.ArgumentParser(description='')
parser.add_argument('--input-file',
dest='input_file',
action='store',
type=str,
help='Input file')
parser.add_argument('--output-file',
dest='output_file',
action='store',
type=str,
help='Output file')
parser.add_argument('--part-name',
dest='part_name',
action='store',
type=str,
help='Partition Name')
parser.add_argument('--part-version',
dest='part_version',
action='store',
type=str,
help='Partition Version')
parser.add_argument('--rootfs-version',
dest='rootfs_version',
action='store',
type=str,
help='RootFS lib version')
args = parser.parse_args()
if not args.rootfs_version:
args.rootfs_version = ""
if ((not args.input_file) or
(not args.output_file) or
(not args.part_name) or
(not args.part_version)):
parser.print_help()
create_output(args)
main()

56
scripts/sercomm-payload.py Executable file
View File

@ -0,0 +1,56 @@
#!/usr/bin/env python3
import argparse
import hashlib
import os
def create_output(args):
in_st = os.stat(args.input_file)
in_size = in_st.st_size
in_f = open(args.input_file, 'r+b')
in_bytes = in_f.read(in_size)
in_f.close()
sha256 = hashlib.sha256()
sha256.update(in_bytes)
out_f = open(args.output_file, 'w+b')
out_f.write(bytes.fromhex(args.pid))
out_f.write(sha256.digest())
out_f.write(in_bytes)
out_f.close()
def main():
global args
parser = argparse.ArgumentParser(description='')
parser.add_argument('--input-file',
dest='input_file',
action='store',
type=str,
help='Input file')
parser.add_argument('--output-file',
dest='output_file',
action='store',
type=str,
help='Output file')
parser.add_argument('--pid',
dest='pid',
action='store',
type=str,
help='Sercomm PID')
args = parser.parse_args()
if ((not args.input_file) or
(not args.output_file) or
(not args.pid)):
parser.print_help()
create_output(args)
main()

View File

@ -464,7 +464,7 @@
#define IGMP_HOST_MEMBERSHIP_REPORT 0x12 /* Ditto */
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -196,7 +196,7 @@ __be32 __skb_flow_get_ports(const struct
@@ -212,7 +212,7 @@ __be32 __skb_flow_get_ports(const struct
ports = __skb_header_pointer(skb, thoff + poff,
sizeof(_ports), data, hlen, &_ports);
if (ports)

View File

@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
#define USB_VENDOR_ID_BELKIN 0x050d
#define USB_DEVICE_ID_FLIP_KVM 0x3201
@@ -1226,6 +1229,9 @@
@@ -1231,6 +1234,9 @@
#define USB_VENDOR_ID_XAT 0x2505
#define USB_DEVICE_ID_XAT_CSR 0x0220
@ -53,7 +53,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_MULTI_TOUCH), HID_QUIRK_MULTI_INPUT },
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL },
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE2), HID_QUIRK_ALWAYS_POLL },
@@ -176,6 +177,7 @@ static const struct hid_device_id hid_qu
@@ -177,6 +178,7 @@ static const struct hid_device_id hid_qu
{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD2, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
{ HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_XIN_MO_DUAL_ARCADE), HID_QUIRK_MULTI_INPUT },

View File

@ -32,5 +32,5 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
+ $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
+
PHONY += dtbs dtbs_install dtbs_check
dtbs dtbs_check: include/config/kernel.release scripts_dtc
dtbs: include/config/kernel.release scripts_dtc
$(Q)$(MAKE) $(build)=$(dtstree)

View File

@ -1,41 +0,0 @@
From 8695764265eb6e749c9fdc901e98c2e7b4d2adfc Mon Sep 17 00:00:00 2001
From: James Hilliard <james.hilliard1@gmail.com>
Date: Fri, 10 Apr 2020 20:23:13 -0600
Subject: [PATCH] component: Silence bind error on -EPROBE_DEFER
If a component fails to bind due to -EPROBE_DEFER we should not log an
error as this is not a real failure.
Fixes:
vc4-drm soc:gpu: failed to bind 3f902000.hdmi (ops vc4_hdmi_ops): -517
vc4-drm soc:gpu: master bind failed: -517
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
drivers/base/component.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--- a/drivers/base/component.c
+++ b/drivers/base/component.c
@@ -257,7 +257,8 @@ static int try_to_bring_up_master(struct
ret = master->ops->bind(master->dev);
if (ret < 0) {
devres_release_group(master->dev, NULL);
- dev_info(master->dev, "master bind failed: %d\n", ret);
+ if (ret != -EPROBE_DEFER)
+ dev_info(master->dev, "master bind failed: %d\n", ret);
return ret;
}
@@ -611,8 +612,9 @@ static int component_bind(struct compone
devres_release_group(component->dev, NULL);
devres_release_group(master->dev, NULL);
- dev_err(master->dev, "failed to bind %s (ops %ps): %d\n",
- dev_name(component->dev), component->ops, ret);
+ if (ret != -EPROBE_DEFER)
+ dev_err(master->dev, "failed to bind %s (ops %ps): %d\n",
+ dev_name(component->dev), component->ops, ret);
}
return ret;

View File

@ -41,7 +41,4 @@ case "$(board_name)" in
zyxel,p870hw-51a-v2)
do_fixcrc
;;
sercomm,ad1018)
mtd erase bootflag2
;;
esac

View File

@ -172,9 +172,9 @@
};
partition@20000 {
compatible = "brcm,wfi";
compatible = "brcm,wfi-split";
label = "wfi";
reg = <0x0020000 0x7ee0000>;
reg = <0x0020000 0x7a80000>;
};
};
};

View File

@ -107,7 +107,7 @@
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_hsspi_cs5>;
switch@0 {
switch@5 {
compatible = "brcm,bcm53125";
reg = <5>;
spi-max-frequency = <781000>;
@ -178,16 +178,16 @@
#address-cells = <1>;
#size-cells = <1>;
cferom@0 {
partition@0 {
label = "cferom";
reg = <0x0000000 0x0020000>;
read-only;
};
wfi@20000 {
compatible = "brcm,wfi";
partition@20000 {
compatible = "brcm,wfi-split";
label = "wfi";
reg = <0x0020000 0x7ee0000>;
reg = <0x0020000 0x7a80000>;
};
};
};

View File

@ -167,12 +167,6 @@
read-only;
};
partition@520000 {
compatible = "brcm,wfi-sercomm";
label = "wfi";
reg = <0x0520000 0x6400000>;
};
partition@6920000 {
label = "bootflag1";
reg = <0x6920000 0x0140000>;
@ -183,6 +177,12 @@
reg = <0x6a60000 0x0140000>;
};
partition@520000 {
compatible = "sercomm,wfi";
label = "wfi";
reg = <0x0520000 0x6400000>;
};
partition@6ba0000 {
label = "xml_cfg";
reg = <0x6ba0000 0x0280000>;

View File

@ -223,6 +223,65 @@ define Build/cfe-part-tag
dd if=$@.part >> $@
endef
define Build/cfe-sercomm-part
$(TOPDIR)/scripts/sercomm-partition-tag.py \
--input-file $@ \
--output-file $@.kernel_rootfs \
--part-name kernel_rootfs \
--part-version OpenWrt \
--rootfs-version $(SERCOMM_VERSION)
rm -rf $@-rootfs_lib
mkdir -p $@-rootfs_lib
echo $(SERCOMM_VERSION) > $@-rootfs_lib/lib_ver
$(call Build/cfe-jffs2,$@-rootfs_lib)
$(call Build/pad-to,$(BLOCKSIZE))
$(TOPDIR)/scripts/sercomm-partition-tag.py \
--input-file $@ \
--output-file $@.rootfs_lib \
--part-name rootfs_lib \
--part-version $(SERCOMM_VERSION)
rm -rf $@-bootloader
mkdir -p $@-bootloader
cp $(KDIR)/bcm63xx-cfe/$(CFE_RAM_FILE) $@-bootloader/$(CFE_RAM_JFFS2_NAME)
$(call Build/cfe-jffs2,$@-bootloader)
$(call Build/pad-to,$(BLOCKSIZE))
$(TOPDIR)/scripts/sercomm-partition-tag.py \
--input-file $@ \
--output-file $@.bootloader \
--part-name bootloader \
--part-version $(SERCOMM_VERSION)
mv $@.kernel_rootfs $@
dd if=$@.rootfs_lib >> $@
dd if=$@.bootloader >> $@
endef
define Build/cfe-sercomm-load
$(TOPDIR)/scripts/sercomm-payload.py \
--input-file $@ \
--output-file $@.new \
--pid "$(SERCOMM_PID)"
mv $@.new $@
endef
define Build/cfe-sercomm-crypto
$(TOPDIR)/scripts/sercomm-crypto.py \
--input-file $@ \
--key-file $@.key \
--output-file $@.ser \
--version OpenWrt
$(STAGING_DIR_HOST)/bin/openssl enc -md md5 -aes-256-cbc \
-in $@ -out $@.enc \
-K `cat $@.key` \
-iv 00000000000000000000000000000000
dd if=$@.enc >> $@.ser
mv $@.ser $@
rm -f $@.enc $@.key
endef
define Build/cfe-old-bin
$(TOPDIR)/scripts/brcmImage.pl -t -p \
-o $@ -b $(CFE_BOARD_ID) -c $(CHIP_ID) \

View File

@ -7,6 +7,7 @@ DEVICE_VARS += CFE_RAM_FILE
DEVICE_VARS += CFE_RAM_JFFS2_NAME CFE_RAM_JFFS2_PAD
DEVICE_VARS += CFE_WFI_CHIP_ID CFE_WFI_FLASH_TYPE
DEVICE_VARS += CFE_WFI_FLAGS CFE_WFI_VERSION
DEVICE_VARS += SERCOMM_PID SERCOMM_VERSION
# CFE expects a single JFFS2 partition with cferam and kernel. However,
# it's possible to fool CFE into properly loading both cferam and kernel
@ -27,7 +28,7 @@ define Device/bcm63xx-nand
CFE_RAM_FILE :=
CFE_RAM_JFFS2_NAME :=
CFE_RAM_JFFS2_PAD :=
CFE_WFI_VERSION := 0x5731
CFE_WFI_VERSION :=
CFE_WFI_CHIP_ID = 0x$$(CHIP_ID)
CFE_WFI_FLASH_TYPE :=
CFE_WFI_FLAGS :=
@ -36,24 +37,15 @@ define Device/bcm63xx-nand
SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
endef
### Comtrend ###
define Device/comtrend_vr-3032u
define Device/sercomm-nand
$(Device/bcm63xx-nand)
DEVICE_VENDOR := Comtrend
DEVICE_MODEL := VR-3032u
CHIP_ID := 63268
SOC := bcm63168
CFE_RAM_FILE := comtrend,vr-3032u/cferam.000
CFE_RAM_JFFS2_NAME := cferam.000
BLOCKSIZE := 128k
PAGESIZE := 2048
SUBPAGESIZE := 512
VID_HDR_OFFSET := 2048
DEVICE_PACKAGES += $(USB2_PACKAGES)
CFE_WFI_FLASH_TYPE := 3
IMAGES += factory.img
IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | cfe-sercomm-part | gzip | cfe-sercomm-load | cfe-sercomm-crypto
SERCOM_PID :=
SERCOMM_VERSION :=
endef
TARGET_DEVICES += comtrend_vr-3032u
### Comtrend ###
define Device/comtrend_vg-8050
$(Device/bcm63xx-nand)
DEVICE_VENDOR := Comtrend
@ -67,10 +59,29 @@ define Device/comtrend_vg-8050
SUBPAGESIZE := 512
VID_HDR_OFFSET := 2048
DEVICE_PACKAGES += $(USB2_PACKAGES)
CFE_WFI_VERSION := 0x5732
CFE_WFI_FLASH_TYPE := 3
endef
TARGET_DEVICES += comtrend_vg-8050
define Device/comtrend_vr-3032u
$(Device/bcm63xx-nand)
DEVICE_VENDOR := Comtrend
DEVICE_MODEL := VR-3032u
CHIP_ID := 63268
SOC := bcm63168
CFE_RAM_FILE := comtrend,vr-3032u/cferam.000
CFE_RAM_JFFS2_NAME := cferam.000
BLOCKSIZE := 128k
PAGESIZE := 2048
SUBPAGESIZE := 512
VID_HDR_OFFSET := 2048
DEVICE_PACKAGES += $(USB2_PACKAGES)
CFE_WFI_VERSION := 0x5732
CFE_WFI_FLASH_TYPE := 3
endef
TARGET_DEVICES += comtrend_vr-3032u
### Huawei ###
define Device/huawei_hg253s-v2
$(Device/bcm63xx-nand)
@ -106,13 +117,14 @@ define Device/netgear_dgnd3700-v2
BLOCKSIZE := 16k
PAGESIZE := 512
DEVICE_PACKAGES += $(B43_PACKAGES) $(USB2_PACKAGES)
CFE_WFI_VERSION := 0x5731
CFE_WFI_FLASH_TYPE := 2
endef
TARGET_DEVICES += netgear_dgnd3700-v2
### Sercomm ###
define Device/sercomm_ad1018
$(Device/bcm63xx-nand)
$(Device/sercomm-nand)
IMAGE/cfe.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | ad1018-jffs2-cferam | append-ubi | cfe-wfi-tag
DEVICE_VENDOR := Sercomm
DEVICE_MODEL := AD1018
@ -125,5 +137,16 @@ define Device/sercomm_ad1018
VID_HDR_OFFSET := 2048
DEVICE_PACKAGES += $(B43_PACKAGES) $(USB2_PACKAGES)
CFE_WFI_FLASH_TYPE := 3
CFE_WFI_VERSION := 0x5731
SERCOMM_PID := \
30 30 30 30 30 30 30 31 34 31 35 31 35 33 30 30 \
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 \
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 \
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 \
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 \
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 \
30 30 30 30 33 30 31 33 30 30 30 30 30 30 30 30 \
0D 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SERCOMM_VERSION := 1001
endef
TARGET_DEVICES += sercomm_ad1018

View File

@ -24,6 +24,8 @@
#include "mtdsplit.h"
#define char_to_num(c) ((c >= '0' && c <= '9') ? (c - '0') : (0))
#define BCM_WFI_PARTS 3
#define CFERAM_NAME "cferam"
@ -35,6 +37,15 @@
#define UBI_MAGIC 0x55424923
#define CFE_MAGIC_PFX "cferam."
#define CFE_MAGIC_PFX_LEN (sizeof(CFE_MAGIC_PFX) - 1)
#define CFE_MAGIC "cferam.000"
#define CFE_MAGIC_LEN (sizeof(CFE_MAGIC) - 1)
#define SERCOMM_MAGIC_PFX "eRcOmM."
#define SERCOMM_MAGIC_PFX_LEN (sizeof(SERCOMM_MAGIC_PFX) - 1)
#define SERCOMM_MAGIC "eRcOmM.000"
#define SERCOMM_MAGIC_LEN (sizeof(SERCOMM_MAGIC) - 1)
static u32 jffs2_dirent_crc(struct jffs2_raw_dirent *node)
{
return crc32(0, node, sizeof(struct jffs2_raw_dirent) - 8);
@ -48,21 +59,23 @@ static bool jffs2_dirent_valid(struct jffs2_raw_dirent *node)
je32_to_cpu(node->node_crc) == jffs2_dirent_crc(node));
}
static int jffs2_find_file(struct mtd_info *master, uint8_t *buf,
static int jffs2_find_file(struct mtd_info *mtd, uint8_t *buf,
const char *name, size_t name_len,
loff_t *offs)
loff_t *offs, loff_t size,
char **out_name, size_t *out_name_len)
{
const loff_t end = *offs + size;
struct jffs2_raw_dirent *node;
bool valid = false;
size_t retlen;
uint16_t magic;
int rc;
for (; *offs < master->size; *offs += master->erasesize) {
for (; *offs < end; *offs += mtd->erasesize) {
unsigned int block_offs = 0;
/* Skip CFE erased blocks */
rc = mtd_read(master, *offs, sizeof(magic), &retlen,
rc = mtd_read(mtd, *offs, sizeof(magic), &retlen,
(void *) &magic);
if (rc || retlen != sizeof(magic)) {
continue;
@ -73,14 +86,14 @@ static int jffs2_find_file(struct mtd_info *master, uint8_t *buf,
continue;
/* Read full block */
rc = mtd_read(master, *offs, master->erasesize, &retlen,
rc = mtd_read(mtd, *offs, mtd->erasesize, &retlen,
(void *) buf);
if (rc)
return rc;
if (retlen != master->erasesize)
if (retlen != mtd->erasesize)
return -EINVAL;
while (block_offs < master->erasesize) {
while (block_offs < mtd->erasesize) {
node = (struct jffs2_raw_dirent *) &buf[block_offs];
if (!jffs2_dirent_valid(node)) {
@ -89,10 +102,22 @@ static int jffs2_find_file(struct mtd_info *master, uint8_t *buf,
}
if (!memcmp(node->name, OPENWRT_NAME,
OPENWRT_NAME_LEN))
OPENWRT_NAME_LEN)) {
valid = true;
else if (!memcmp(node->name, name, name_len))
return valid ? 0 : -EINVAL;
} else if (!memcmp(node->name, name, name_len)) {
if (!valid)
return -EINVAL;
if (out_name)
*out_name = kstrndup(node->name,
node->nsize,
GFP_KERNEL);
if (out_name_len)
*out_name_len = node->nsize;
return 0;
}
block_offs += je32_to_cpu(node->totlen);
block_offs = (block_offs + 0x3) & ~0x3;
@ -102,14 +127,15 @@ static int jffs2_find_file(struct mtd_info *master, uint8_t *buf,
return -ENOENT;
}
static int ubifs_find(struct mtd_info *master, loff_t *offs)
static int ubifs_find(struct mtd_info *mtd, loff_t *offs, loff_t size)
{
const loff_t end = *offs + size;
uint32_t magic;
size_t retlen;
int rc;
for (; *offs < master->size; *offs += master->erasesize) {
rc = mtd_read(master, *offs, sizeof(magic), &retlen,
for (; *offs < end; *offs += mtd->erasesize) {
rc = mtd_read(mtd, *offs, sizeof(magic), &retlen,
(unsigned char *) &magic);
if (rc || retlen != sizeof(magic))
continue;
@ -121,53 +147,38 @@ static int ubifs_find(struct mtd_info *master, loff_t *offs)
return -ENOENT;
}
static int mtdsplit_parse_bcm_wfi(struct mtd_info *master,
const struct mtd_partition **pparts,
struct mtd_part_parser_data *data)
static int parse_bcm_wfi(struct mtd_info *master,
const struct mtd_partition **pparts,
uint8_t *buf, loff_t off, loff_t size, bool cfe_part)
{
struct mtd_partition *parts;
struct device_node *mtd_node;
loff_t cfe_off, kernel_off, rootfs_off;
bool cfe_part = true;
unsigned int num_parts = BCM_WFI_PARTS, cur_part = 0;
uint8_t *buf;
int ret;
buf = kzalloc(master->erasesize, GFP_KERNEL);
if (!buf)
return -ENOMEM;
mtd_node = mtd_get_of_node(master);
if (!mtd_node)
return -EINVAL;
if (of_device_is_compatible(mtd_node, "brcm,wfi-sercomm"))
cfe_part = false;
if (cfe_part) {
num_parts++;
cfe_off = 0;
cfe_off = off;
ret = jffs2_find_file(master, buf, CFERAM_NAME,
CFERAM_NAME_LEN, &cfe_off);
if (ret) {
kfree(buf);
CFERAM_NAME_LEN, &cfe_off,
size - (cfe_off - off), NULL, NULL);
if (ret)
return ret;
}
kernel_off = cfe_off + master->erasesize;
} else {
kernel_off = 0;
kernel_off = off;
}
ret = jffs2_find_file(master, buf, KERNEL_NAME, KERNEL_NAME_LEN,
&kernel_off);
kfree(buf);
&kernel_off, size - (kernel_off - off),
NULL, NULL);
if (ret)
return ret;
rootfs_off = kernel_off + master->erasesize;
ret = ubifs_find(master, &rootfs_off);
ret = ubifs_find(master, &rootfs_off, size - (rootfs_off - off));
if (ret)
return ret;
@ -178,14 +189,14 @@ static int mtdsplit_parse_bcm_wfi(struct mtd_info *master,
if (cfe_part) {
parts[cur_part].name = "cferam";
parts[cur_part].mask_flags = MTD_WRITEABLE;
parts[cur_part].offset = 0;
parts[cur_part].size = kernel_off;
parts[cur_part].offset = cfe_off;
parts[cur_part].size = kernel_off - cfe_off;
cur_part++;
}
parts[cur_part].name = "firmware";
parts[cur_part].offset = kernel_off;
parts[cur_part].size = master->size - kernel_off;
parts[cur_part].size = size - (kernel_off - off);
cur_part++;
parts[cur_part].name = KERNEL_PART_NAME;
@ -195,7 +206,7 @@ static int mtdsplit_parse_bcm_wfi(struct mtd_info *master,
parts[cur_part].name = UBI_PART_NAME;
parts[cur_part].offset = rootfs_off;
parts[cur_part].size = master->size - rootfs_off;
parts[cur_part].size = size - (rootfs_off - off);
cur_part++;
*pparts = parts;
@ -203,23 +214,273 @@ static int mtdsplit_parse_bcm_wfi(struct mtd_info *master,
return num_parts;
}
static const struct of_device_id mtdsplit_fit_of_match_table[] = {
static int mtdsplit_parse_bcm_wfi(struct mtd_info *master,
const struct mtd_partition **pparts,
struct mtd_part_parser_data *data)
{
struct device_node *mtd_node;
bool cfe_part = true;
uint8_t *buf;
int ret;
mtd_node = mtd_get_of_node(master);
if (!mtd_node)
return -EINVAL;
buf = kzalloc(master->erasesize, GFP_KERNEL);
if (!buf)
return -ENOMEM;
if (of_property_read_bool(mtd_node, "brcm,no-cferam"))
cfe_part = false;
ret = parse_bcm_wfi(master, pparts, buf, 0, master->size, cfe_part);
kfree(buf);
return ret;
}
static const struct of_device_id mtdsplit_bcm_wfi_of_match[] = {
{ .compatible = "brcm,wfi" },
{ .compatible = "brcm,wfi-sercomm" },
{ },
};
static struct mtd_part_parser mtdsplit_bcm_wfi_parser = {
.owner = THIS_MODULE,
.name = "bcm-wfi-fw",
.of_match_table = mtdsplit_fit_of_match_table,
.of_match_table = mtdsplit_bcm_wfi_of_match,
.parse_fn = mtdsplit_parse_bcm_wfi,
.type = MTD_PARSER_TYPE_FIRMWARE,
};
static int cferam_bootflag_value(const char *name, size_t name_len)
{
int rc = -ENOENT;
if (name &&
(name_len >= CFE_MAGIC_LEN) &&
!memcmp(name, CFE_MAGIC_PFX, CFE_MAGIC_PFX_LEN)) {
rc = char_to_num(name[CFE_MAGIC_PFX_LEN + 0]) * 100;
rc += char_to_num(name[CFE_MAGIC_PFX_LEN + 1]) * 10;
rc += char_to_num(name[CFE_MAGIC_PFX_LEN + 2]) * 1;
}
return rc;
}
static int mtdsplit_parse_bcm_wfi_split(struct mtd_info *master,
const struct mtd_partition **pparts,
struct mtd_part_parser_data *data)
{
loff_t cfe_off;
loff_t img1_off = 0;
loff_t img2_off = master->size / 2;
loff_t img1_size = (img2_off - img1_off);
loff_t img2_size = (master->size - img2_off);
loff_t active_off, inactive_off;
loff_t active_size, inactive_size;
uint8_t *buf;
char *cfe1_name = NULL, *cfe2_name = NULL;
size_t cfe1_size = 0, cfe2_size = 0;
int ret;
int bf1, bf2;
buf = kzalloc(master->erasesize, GFP_KERNEL);
if (!buf)
return -ENOMEM;
cfe_off = img1_off;
ret = jffs2_find_file(master, buf, CFERAM_NAME, CFERAM_NAME_LEN,
&cfe_off, img1_size, &cfe1_name, &cfe1_size);
cfe_off = img2_off;
ret = jffs2_find_file(master, buf, CFERAM_NAME, CFERAM_NAME_LEN,
&cfe_off, img2_size, &cfe2_name, &cfe2_size);
bf1 = cferam_bootflag_value(cfe1_name, cfe1_size);
if (bf1 >= 0)
printk("cferam: bootflag1=%d\n", bf1);
bf2 = cferam_bootflag_value(cfe2_name, cfe2_size);
if (bf2 >= 0)
printk("cferam: bootflag2=%d\n", bf2);
kfree(cfe1_name);
kfree(cfe2_name);
if (bf1 >= bf2) {
active_off = img1_off;
active_size = img1_size;
inactive_off = img2_off;
inactive_size = img2_size;
} else {
active_off = img2_off;
active_size = img2_size;
inactive_off = img1_off;
inactive_size = img1_size;
}
ret = parse_bcm_wfi(master, pparts, buf, active_off, active_size, true);
kfree(buf);
if (ret > 0) {
struct mtd_partition *parts;
parts = kzalloc((ret + 1) * sizeof(*parts), GFP_KERNEL);
if (!parts)
return -ENOMEM;
memcpy(parts, *pparts, ret * sizeof(*parts));
kfree(*pparts);
parts[ret].name = "img2";
parts[ret].offset = inactive_off;
parts[ret].size = inactive_size;
ret++;
*pparts = parts;
}
return ret;
}
static const struct of_device_id mtdsplit_bcm_wfi_split_of_match[] = {
{ .compatible = "brcm,wfi-split" },
{ },
};
static struct mtd_part_parser mtdsplit_bcm_wfi_split_parser = {
.owner = THIS_MODULE,
.name = "bcm-wfi-split-fw",
.of_match_table = mtdsplit_bcm_wfi_split_of_match,
.parse_fn = mtdsplit_parse_bcm_wfi_split,
.type = MTD_PARSER_TYPE_FIRMWARE,
};
static int sercomm_bootflag_value(struct mtd_info *mtd, uint8_t *buf)
{
size_t retlen;
loff_t offs;
int rc;
for (offs = 0; offs < mtd->size; offs += mtd->erasesize) {
rc = mtd_read(mtd, offs, SERCOMM_MAGIC_LEN, &retlen, buf);
if (rc || retlen != SERCOMM_MAGIC_LEN)
continue;
if (memcmp(buf, SERCOMM_MAGIC_PFX, SERCOMM_MAGIC_PFX_LEN))
continue;
rc = char_to_num(buf[SERCOMM_MAGIC_PFX_LEN + 0]) * 100;
rc += char_to_num(buf[SERCOMM_MAGIC_PFX_LEN + 1]) * 10;
rc += char_to_num(buf[SERCOMM_MAGIC_PFX_LEN + 2]) * 1;
return rc;
}
return -ENOENT;
}
static int mtdsplit_parse_ser_wfi(struct mtd_info *master,
const struct mtd_partition **pparts,
struct mtd_part_parser_data *data)
{
struct mtd_info *mtd_bf1, *mtd_bf2;
struct erase_info bf_erase;
loff_t img1_off = 0;
loff_t img2_off = master->size / 2;
loff_t img1_size = (img2_off - img1_off);
loff_t img2_size = (master->size - img2_off);
loff_t active_off, inactive_off;
loff_t active_size, inactive_size;
uint8_t *buf;
int bf1, bf2;
int ret;
mtd_bf1 = get_mtd_device_nm("bootflag1");
if (IS_ERR(mtd_bf1))
return -ENOENT;
mtd_bf2 = get_mtd_device_nm("bootflag2");
if (IS_ERR(mtd_bf2))
return -ENOENT;
buf = kzalloc(master->erasesize, GFP_KERNEL);
if (!buf)
return -ENOMEM;
bf1 = sercomm_bootflag_value(mtd_bf1, buf);
if (bf1 >= 0)
printk("sercomm: bootflag1=%d\n", bf1);
bf2 = sercomm_bootflag_value(mtd_bf2, buf);
if (bf2 >= 0)
printk("sercomm: bootflag2=%d\n", bf2);
if (bf1 == bf2 && bf2 >= 0) {
bf2 = -ENOENT;
bf_erase.addr = 0;
bf_erase.len = mtd_bf2->size;
mtd_erase(mtd_bf2, &bf_erase);
}
if (bf1 >= bf2) {
active_off = img1_off;
active_size = img1_size;
inactive_off = img2_off;
inactive_size = img2_size;
} else {
active_off = img2_off;
active_size = img2_size;
inactive_off = img1_off;
inactive_size = img1_size;
}
ret = parse_bcm_wfi(master, pparts, buf, active_off, active_size, false);
kfree(buf);
if (ret > 0) {
struct mtd_partition *parts;
parts = kzalloc((ret + 1) * sizeof(*parts), GFP_KERNEL);
if (!parts)
return -ENOMEM;
memcpy(parts, *pparts, ret * sizeof(*parts));
kfree(*pparts);
parts[ret].name = "img2";
parts[ret].offset = inactive_off;
parts[ret].size = inactive_size;
ret++;
*pparts = parts;
}
return ret;
}
static const struct of_device_id mtdsplit_ser_wfi_of_match[] = {
{ .compatible = "sercomm,wfi" },
{ },
};
static struct mtd_part_parser mtdsplit_ser_wfi_parser = {
.owner = THIS_MODULE,
.name = "ser-wfi-fw",
.of_match_table = mtdsplit_ser_wfi_of_match,
.parse_fn = mtdsplit_parse_ser_wfi,
.type = MTD_PARSER_TYPE_FIRMWARE,
};
static int __init mtdsplit_bcm_wfi_init(void)
{
register_mtd_parser(&mtdsplit_bcm_wfi_parser);
register_mtd_parser(&mtdsplit_bcm_wfi_split_parser);
register_mtd_parser(&mtdsplit_ser_wfi_parser);
return 0;
}

View File

@ -106,7 +106,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -152,6 +152,10 @@ kallsyms()
@@ -164,6 +164,10 @@ kallsyms()
kallsymopt="${kallsymopt} --base-relative"
fi

View File

@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -907,8 +907,10 @@ char *symbol_string(char *buf, char *end
@@ -914,8 +914,10 @@ char *symbol_string(char *buf, char *end
struct printf_spec spec, const char *fmt)
{
unsigned long value;
@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#endif
if (fmt[1] == 'R')
@@ -925,8 +927,14 @@ char *symbol_string(char *buf, char *end
@@ -932,8 +934,14 @@ char *symbol_string(char *buf, char *end
return string_nocheck(buf, end, sym, spec);
#else

View File

@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -4644,6 +4644,14 @@ static int mvneta_ethtool_set_eee(struct
@@ -4652,6 +4652,14 @@ static int mvneta_ethtool_set_eee(struct
return phylink_ethtool_set_eee(pp->phylink, eee);
}
@ -24,7 +24,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static const struct net_device_ops mvneta_netdev_ops = {
.ndo_open = mvneta_open,
.ndo_stop = mvneta_stop,
@@ -4654,6 +4662,7 @@ static const struct net_device_ops mvnet
@@ -4662,6 +4670,7 @@ static const struct net_device_ops mvnet
.ndo_fix_features = mvneta_fix_features,
.ndo_get_stats64 = mvneta_get_stats64,
.ndo_do_ioctl = mvneta_ioctl,

View File

@ -12,8 +12,6 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
.../boot/dts/marvell/armada-3720-uDPU.dts | 22 +++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts b/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts
index 7eb6c1796cef..95d46e8d081c 100644
--- a/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts
+++ b/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts
@@ -117,18 +117,36 @@
@ -55,6 +53,3 @@ index 7eb6c1796cef..95d46e8d081c 100644
lm75@48 {
status = "okay";
--
2.20.1