Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
commit
30628eed16
@ -1,45 +0,0 @@
|
||||
--- a/math_compat.h
|
||||
+++ b/math_compat.h
|
||||
@@ -6,38 +6,9 @@
|
||||
* @brief Do not use, json-c internal, may be changed or removed at any time.
|
||||
*/
|
||||
|
||||
-/* Define isnan, isinf, infinity and nan on Windows/MSVC */
|
||||
-
|
||||
-#ifndef HAVE_DECL_ISNAN
|
||||
-#ifdef HAVE_DECL__ISNAN
|
||||
-#include <float.h>
|
||||
-#define isnan(x) _isnan(x)
|
||||
-#else
|
||||
-/* On platforms like AIX and "IBM i" we need to provide our own isnan */
|
||||
-#define isnan(x) ((x) != (x))
|
||||
-#endif
|
||||
-#endif
|
||||
-
|
||||
-#ifndef HAVE_DECL_ISINF
|
||||
-#ifdef HAVE_DECL__FINITE
|
||||
-#include <float.h>
|
||||
-#define isinf(x) (!_finite(x))
|
||||
-#else
|
||||
-#include <float.h>
|
||||
-/* On platforms like AIX and "IBM i" we need to provide our own isinf */
|
||||
-#define isinf(x) ((x) < -DBL_MAX || (x) > DBL_MAX)
|
||||
-#endif
|
||||
-#endif
|
||||
-
|
||||
-#ifndef HAVE_DECL_INFINITY
|
||||
-#include <float.h>
|
||||
-#define INFINITY (DBL_MAX + DBL_MAX)
|
||||
-#define HAVE_DECL_INFINITY
|
||||
-#endif
|
||||
-
|
||||
-#ifndef HAVE_DECL_NAN
|
||||
-#define NAN (INFINITY - INFINITY)
|
||||
-#define HAVE_DECL_NAN
|
||||
-#endif
|
||||
+#undef isnan
|
||||
+#define isnan(x) __builtin_isnan(x)
|
||||
+#undef isinf
|
||||
+#define isinf(x) __builtin_isinf(x)
|
||||
|
||||
#endif
|
||||
11
package/libs/libjson-c/patches/010-clang.patch
Normal file
11
package/libs/libjson-c/patches/010-clang.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -265,7 +265,7 @@ message(STATUS "Wrote ${PROJECT_BINARY_D
|
||||
configure_file(${PROJECT_SOURCE_DIR}/cmake/json_config.h.in ${PROJECT_BINARY_DIR}/json_config.h)
|
||||
message(STATUS "Wrote ${PROJECT_BINARY_DIR}/json_config.h")
|
||||
|
||||
-if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
|
||||
+if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections")
|
||||
if ("${DISABLE_WERROR}" STREQUAL "OFF")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
|
||||
@ -9,9 +9,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall4.git
|
||||
PKG_SOURCE_DATE:=2021-03-31
|
||||
PKG_SOURCE_VERSION:=29fba840201287b9265888adba6298779b750af5
|
||||
PKG_MIRROR_HASH:=1d26a611aeecdf37f09e4cdee6b192e5da087abf6e0fc7a9ca97a80e58d14222
|
||||
PKG_SOURCE_DATE:=2021-09-01
|
||||
PKG_SOURCE_VERSION:=cf835cecc8a449b2d2019f1ef4f085e535d5c1c1
|
||||
PKG_MIRROR_HASH:=5798b76846107dde69a2a1ff3467f735b9a91a74106fbd6299d8a26eff70b9c2
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
PKG_LICENSE:=ISC
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ethtool
|
||||
PKG_VERSION:=5.13
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
@ -31,6 +31,7 @@ define Package/ethtool
|
||||
TITLE:=Display or change ethernet card settings
|
||||
URL:=http://www.kernel.org/pub/software/network/ethtool/
|
||||
VARIANT:=tiny
|
||||
CONFLICTS:=ethtool-full
|
||||
endef
|
||||
|
||||
define Package/ethtool-full
|
||||
@ -38,8 +39,8 @@ define Package/ethtool-full
|
||||
TITLE += (full)
|
||||
VARIANT:=full
|
||||
PROVIDES:=ethtool
|
||||
CONFLICTS:=ethtool
|
||||
DEPENDS:=+libmnl
|
||||
CONFLICTS:=
|
||||
endef
|
||||
|
||||
define Package/ethtool/description
|
||||
|
||||
@ -12,9 +12,9 @@ PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git
|
||||
PKG_SOURCE_DATE:=2021-08-23
|
||||
PKG_SOURCE_VERSION:=167dc249b0a55fdb973afbd797059a3880bb7aea
|
||||
PKG_MIRROR_HASH:=fdb5206f41a8e74710abaca3a26bb2276a5eb0e9fb14672c6685950d18ba3775
|
||||
PKG_SOURCE_DATE:=2021-08-31
|
||||
PKG_SOURCE_VERSION:=773e8da41532b23888511cd864fbd251ecadc577
|
||||
PKG_MIRROR_HASH:=2b7c91427861f23fcd444fc05c033ed0f348ff353097a98d583f38a79ce294dd
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
@ -12,15 +12,19 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=https://github.com/jow-/ucode.git
|
||||
PKG_SOURCE_DATE:=2021-03-31
|
||||
PKG_SOURCE_VERSION:=973cc6c865dcf6075c493125313058b650b08234
|
||||
PKG_MIRROR_HASH:=fb4d3e231c79a9122743f0ced7fd4fdcf81903de5c721d3c18d5779e44d50bdf
|
||||
PKG_SOURCE_DATE:=2021-07-30
|
||||
PKG_SOURCE_VERSION:=929c8627cf077c3e348fb12b02553d4a444c5e48
|
||||
PKG_MIRROR_HASH:=
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
PKG_LICENSE:=ISC
|
||||
|
||||
PKG_ABI_VERSION:=20210730
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
CMAKE_OPTIONS += -DSOVERSION=$(PKG_ABI_VERSION)
|
||||
|
||||
define Package/ucode/default
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
@ -29,7 +33,7 @@ endef
|
||||
|
||||
define Package/ucode
|
||||
$(Package/ucode/default)
|
||||
DEPENDS:=+libjson-c
|
||||
DEPENDS:=+libucode
|
||||
endef
|
||||
|
||||
define Package/ucode/description
|
||||
@ -38,6 +42,18 @@ define Package/ucode/description
|
||||
endef
|
||||
|
||||
|
||||
define Package/libucode
|
||||
$(Package/ucode/default)
|
||||
TITLE+= - runtime library
|
||||
ABI_VERSION:=$(PKG_ABI_VERSION)
|
||||
DEPENDS:=+libjson-c
|
||||
endef
|
||||
|
||||
define Package/libucode/description
|
||||
The libucode package provides the shared runtime library for the ucode interpreter.
|
||||
endef
|
||||
|
||||
|
||||
define Package/ucode-mod-fs
|
||||
$(Package/ucode/default)
|
||||
TITLE+= (filesystem module)
|
||||
@ -83,33 +99,46 @@ define Package/ucode-mod-uci/description
|
||||
endef
|
||||
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/lib $(1)/usr/include/ucode
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/ucode/*.h $(1)/usr/include/ucode/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libucode.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
define Package/ucode/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ucode $(1)/usr/bin/ucode
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ucode $(1)/usr/bin/ucode
|
||||
endef
|
||||
|
||||
define Package/libucode/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libucode.so.* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/ucode-mod-fs/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ucode
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/fs.so $(1)/usr/lib/ucode/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/fs.so $(1)/usr/lib/ucode/
|
||||
endef
|
||||
|
||||
define Package/ucode-mod-math/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ucode
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/math.so $(1)/usr/lib/ucode/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/math.so $(1)/usr/lib/ucode/
|
||||
endef
|
||||
|
||||
define Package/ucode-mod-ubus/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ucode
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/ubus.so $(1)/usr/lib/ucode/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/ubus.so $(1)/usr/lib/ucode/
|
||||
endef
|
||||
|
||||
define Package/ucode-mod-uci/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ucode
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/uci.so $(1)/usr/lib/ucode/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/uci.so $(1)/usr/lib/ucode/
|
||||
endef
|
||||
|
||||
|
||||
$(eval $(call BuildPackage,ucode))
|
||||
$(eval $(call BuildPackage,libucode))
|
||||
$(eval $(call BuildPackage,ucode-mod-fs))
|
||||
$(eval $(call BuildPackage,ucode-mod-math))
|
||||
$(eval $(call BuildPackage,ucode-mod-ubus))
|
||||
|
||||
@ -11,7 +11,7 @@ FEATURES:=squashfs nand usb pci pcie gpio pwm
|
||||
CPU_TYPE:=cortex-a9
|
||||
SUBTARGETS:=generic
|
||||
|
||||
KERNEL_PATCHVER:=5.4
|
||||
KERNEL_PATCHVER:=5.10
|
||||
KERNEL_TESTING_PATCHVER:=5.10
|
||||
|
||||
define Target/Description
|
||||
|
||||
@ -36,7 +36,9 @@ $(eval $(call KernelPackage,phy-bcm-ns-usb3))
|
||||
|
||||
define KernelPackage/i2c-bcm-iproc
|
||||
TITLE:=Broadcom iProc I2C controller
|
||||
KCONFIG:=CONFIG_I2C_BCM_IPROC
|
||||
KCONFIG:= \
|
||||
CONFIG_I2C_BCM_IPROC \
|
||||
CONFIG_I2C_SLAVE_TESTUNIT=n
|
||||
DEPENDS:=@TARGET_bcm53xx +kmod-i2c-core
|
||||
SUBMENU:=$(I2C_MENU)
|
||||
FILES:=$(LINUX_DIR)/drivers/i2c/busses/i2c-bcm-iproc.ko
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Tue, 31 Aug 2021 08:40:49 +0200
|
||||
Subject: [PATCH fix] Revert "USB: bcma: Add a check for devm_gpiod_get"
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This reverts commit f3de5d857bb2362b00e2a8d4bc886cd49dcb66db.
|
||||
|
||||
That commit broke USB on all routers that have USB always powered on and
|
||||
don't require toggling any GPIO. It's a majority of devices actually.
|
||||
|
||||
The original code worked and seemed safe: vcc GPIO is optional and
|
||||
bcma_hci_platform_power_gpio() takes care of checking the pointer before
|
||||
using it.
|
||||
|
||||
This revert fixes:
|
||||
[ 10.801127] bcma_hcd: probe of bcma0:11 failed with error -2
|
||||
|
||||
Cc: Chuhong Yuan <hslester96@gmail.com>
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
drivers/usb/host/bcma-hcd.c | 5 +----
|
||||
1 file changed, 1 insertion(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/usb/host/bcma-hcd.c
|
||||
+++ b/drivers/usb/host/bcma-hcd.c
|
||||
@@ -406,12 +406,9 @@ static int bcma_hcd_probe(struct bcma_de
|
||||
return -ENOMEM;
|
||||
usb_dev->core = core;
|
||||
|
||||
- if (core->dev.of_node) {
|
||||
+ if (core->dev.of_node)
|
||||
usb_dev->gpio_desc = devm_gpiod_get(&core->dev, "vcc",
|
||||
GPIOD_OUT_HIGH);
|
||||
- if (IS_ERR(usb_dev->gpio_desc))
|
||||
- return PTR_ERR(usb_dev->gpio_desc);
|
||||
- }
|
||||
|
||||
switch (core->id.id) {
|
||||
case BCMA_CORE_USB20_HOST:
|
||||
@ -5035,6 +5035,7 @@ CONFIG_SECTION_MISMATCH_WARN_ONLY=y
|
||||
CONFIG_SECURITY_DMESG_RESTRICT=y
|
||||
# CONFIG_SECURITY_LOADPIN is not set
|
||||
# CONFIG_SECURITY_LOCKDOWN_LSM is not set
|
||||
# CONFIG_SECURITY_NETWORK_XFRM is not set
|
||||
# CONFIG_SECURITY_PATH is not set
|
||||
# CONFIG_SECURITY_SAFESETID is not set
|
||||
# CONFIG_SECURITY_SELINUX_AVC_STATS is not set
|
||||
|
||||
@ -4662,6 +4662,7 @@ CONFIG_SECTION_MISMATCH_WARN_ONLY=y
|
||||
CONFIG_SECURITY_DMESG_RESTRICT=y
|
||||
# CONFIG_SECURITY_LOADPIN is not set
|
||||
# CONFIG_SECURITY_LOCKDOWN_LSM is not set
|
||||
# CONFIG_SECURITY_NETWORK_XFRM is not set
|
||||
# CONFIG_SECURITY_PATH is not set
|
||||
# CONFIG_SECURITY_SAFESETID is not set
|
||||
# CONFIG_SECURITY_SELINUX_AVC_STATS is not set
|
||||
|
||||
@ -15,6 +15,7 @@ ramips_setup_interfaces()
|
||||
glinet,vixmini|\
|
||||
hak5,wifi-pineapple-mk7|\
|
||||
mediatek,linkit-smart-7688|\
|
||||
minew,g1-c|\
|
||||
onion,omega2p|\
|
||||
onion,omega2|\
|
||||
ravpower,rp-wd009|\
|
||||
@ -33,11 +34,6 @@ ramips_setup_interfaces()
|
||||
ucidef_add_switch_attr "switch0" "enable" "false"
|
||||
ucidef_set_interface_lan "eth0"
|
||||
;;
|
||||
minew,g1-c)
|
||||
ucidef_add_switch "switch0"
|
||||
ucidef_add_switch_attr "switch0" "enable" "false"
|
||||
ucidef_set_interface_lan "eth0" "dhcp"
|
||||
;;
|
||||
asus,rt-n10p-v3|\
|
||||
asus,rt-n11p-b1|\
|
||||
asus,rt-n12-vp-b1|\
|
||||
|
||||
@ -44,6 +44,7 @@ struct board_info {
|
||||
uint32_t imagelen;
|
||||
uint32_t load_addr;
|
||||
uint32_t entry;
|
||||
bool le32;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -62,7 +63,16 @@ static const struct board_info boards[] = {
|
||||
.magic = 0x4d495053,
|
||||
.imagelen = 0x007e0000,
|
||||
.load_addr = 0x80060000,
|
||||
.entry = 0x80060000
|
||||
.entry = 0x80060000,
|
||||
.le32 = 0,
|
||||
}, {
|
||||
.id = "mx64",
|
||||
.description = "Meraki MX64/MX65",
|
||||
.magic = 0x4d495053,
|
||||
.imagelen = 0x00000000,
|
||||
.load_addr = 0x60008000,
|
||||
.entry = 0x60008000,
|
||||
.le32 = 1,
|
||||
}, {
|
||||
/* terminating entry */
|
||||
}
|
||||
@ -123,9 +133,11 @@ static void usage(int status)
|
||||
exit(status);
|
||||
}
|
||||
|
||||
static void writel(unsigned char *buf, size_t offset, uint32_t value)
|
||||
static void writel(unsigned char *buf, size_t offset, uint32_t value, bool le32)
|
||||
{
|
||||
value = htonl(value);
|
||||
if (!le32)
|
||||
value = htonl(value);
|
||||
|
||||
memcpy(buf + offset, &value, sizeof(uint32_t));
|
||||
}
|
||||
|
||||
@ -201,21 +213,25 @@ static inline uint32_t crc32_accumulate_8(const uint32_t crc, const uint8_t ch)
|
||||
return crc32_table[(crc ^ ch) & 0xff] ^ (crc >> 8);
|
||||
}
|
||||
|
||||
static void crc32_csum(uint8_t *buf, const size_t len)
|
||||
static void crc32_csum(uint8_t *buf, const size_t len, bool le32)
|
||||
{
|
||||
int j, k, l, m;
|
||||
uint32_t crc;
|
||||
size_t i;
|
||||
|
||||
crc = ~0;
|
||||
k = le32 * 3;
|
||||
l = le32 * -2 + 1;
|
||||
|
||||
for (i = 0; i < len; i += 4) {
|
||||
crc = crc32_accumulate_8(crc, buf[i + 3]);
|
||||
crc = crc32_accumulate_8(crc, buf[i + 2]);
|
||||
crc = crc32_accumulate_8(crc, buf[i + 1]);
|
||||
crc = crc32_accumulate_8(crc, buf[i]);
|
||||
for (j = 3; j >= 0; j -= 1) {
|
||||
m = (j - k) * l;
|
||||
crc = crc32_accumulate_8(crc, buf[i + m]);
|
||||
}
|
||||
}
|
||||
crc = ~crc;
|
||||
|
||||
writel(buf, HDR_OFF_CHECKSUM, crc);
|
||||
writel(buf, HDR_OFF_CHECKSUM, crc, le32);
|
||||
}
|
||||
|
||||
|
||||
@ -229,11 +245,14 @@ static int meraki_build_hdr(const struct board_info *board, const size_t klen,
|
||||
|
||||
size_t rc;
|
||||
buflen = board->imagelen;
|
||||
kspace = buflen - HDR_LENGTH;
|
||||
|
||||
if (klen > kspace) {
|
||||
ERR("kernel file is too big - max size: 0x%08lX\n", kspace);
|
||||
return EXIT_FAILURE;
|
||||
if (buflen > 0) {
|
||||
kspace = buflen - HDR_LENGTH;
|
||||
|
||||
if (klen > kspace) {
|
||||
ERR("kernel file is too big - max size: 0x%08lX\n", kspace);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
/* If requested, resize buffer to remove padding */
|
||||
@ -253,23 +272,23 @@ static int meraki_build_hdr(const struct board_info *board, const size_t klen,
|
||||
fread(kernel, klen, 1, in);
|
||||
|
||||
/* Write magic values and filler */
|
||||
writel(buf, HDR_OFF_MAGIC1, board->magic);
|
||||
writel(buf, HDR_OFF_FILLER0, 0);
|
||||
writel(buf, HDR_OFF_FILLER1, 0);
|
||||
writel(buf, HDR_OFF_FILLER2, 0);
|
||||
writel(buf, HDR_OFF_MAGIC1, board->magic, board->le32);
|
||||
writel(buf, HDR_OFF_FILLER0, 0, board->le32);
|
||||
writel(buf, HDR_OFF_FILLER1, 0, board->le32);
|
||||
writel(buf, HDR_OFF_FILLER2, 0, board->le32);
|
||||
|
||||
/* Write load and kernel entry point address */
|
||||
writel(buf, HDR_OFF_LOAD_ADDR, board->load_addr);
|
||||
writel(buf, HDR_OFF_ENTRY, board->entry);
|
||||
writel(buf, HDR_OFF_LOAD_ADDR, board->load_addr, board->le32);
|
||||
writel(buf, HDR_OFF_ENTRY, board->entry, board->le32);
|
||||
|
||||
/* Write header and image length */
|
||||
writel(buf, HDR_OFF_IMAGELEN, klen);
|
||||
writel(buf, HDR_OFF_IMAGELEN, klen, board->le32);
|
||||
|
||||
/* this gets replaced later, after the checksum has been calculated */
|
||||
writel(buf, HDR_OFF_CHECKSUM, 0);
|
||||
writel(buf, HDR_OFF_CHECKSUM, 0, board->le32);
|
||||
|
||||
/* Write checksum */
|
||||
crc32_csum(buf, klen + HDR_LENGTH);
|
||||
crc32_csum(buf, klen + HDR_LENGTH, board->le32);
|
||||
|
||||
rc = fwrite(buf, buflen, 1, out);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user