Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
commit
d97b735f52
@ -200,6 +200,7 @@ menu "Target Images"
|
||||
depends on TARGET_x86
|
||||
depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
|
||||
select PACKAGE_grub2
|
||||
select PACKAGE_grub2-bios-setup
|
||||
default y
|
||||
|
||||
config GRUB_EFI_IMAGES
|
||||
@ -208,6 +209,7 @@ menu "Target Images"
|
||||
depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
|
||||
select PACKAGE_grub2
|
||||
select PACKAGE_grub2-efi
|
||||
select PACKAGE_grub2-bios-setup
|
||||
select PACKAGE_kmod-fs-vfat
|
||||
default y
|
||||
|
||||
@ -280,14 +282,14 @@ menu "Target Images"
|
||||
source "target/linux/*/image/Config.in"
|
||||
|
||||
config TARGET_KERNEL_PARTSIZE
|
||||
int "Kernel partition size (in MB)"
|
||||
int "Kernel partition size (in MiB)"
|
||||
depends on USES_BOOT_PART
|
||||
default 8 if TARGET_apm821xx_sata
|
||||
default 64 if TARGET_bcm27xx
|
||||
default 16
|
||||
|
||||
config TARGET_ROOTFS_PARTSIZE
|
||||
int "Root filesystem partition size (in MB)"
|
||||
int "Root filesystem partition size (in MiB)"
|
||||
depends on USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || TARGET_omap || TARGET_sunxi || TARGET_uml
|
||||
default 160
|
||||
help
|
||||
|
@ -65,16 +65,9 @@ _v() {
|
||||
[ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$*" >&2
|
||||
}
|
||||
|
||||
_vn() {
|
||||
[ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo -n "$*" >&2
|
||||
}
|
||||
|
||||
v() {
|
||||
_v "$(date) upgrade: $@"
|
||||
}
|
||||
|
||||
vn() {
|
||||
_vn "$(date) upgrade: $@"
|
||||
logger -p info -t upgrade "$@"
|
||||
}
|
||||
|
||||
json_string() {
|
||||
@ -95,8 +88,7 @@ get_image() { # <source> [ <command> ]
|
||||
if [ -z "$cmd" ]; then
|
||||
local magic="$(dd if="$from" bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')"
|
||||
case "$magic" in
|
||||
1f8b) cmd="zcat";;
|
||||
425a) cmd="bzcat";;
|
||||
1f8b) cmd="busybox zcat";;
|
||||
*) cmd="cat";;
|
||||
esac
|
||||
fi
|
||||
|
@ -39,13 +39,13 @@ switch_to_ramfs() {
|
||||
for binary in \
|
||||
/bin/busybox /bin/ash /bin/sh /bin/mount /bin/umount \
|
||||
pivot_root mount_root reboot sync kill sleep \
|
||||
md5sum hexdump cat zcat bzcat dd tar \
|
||||
md5sum hexdump cat zcat dd tar \
|
||||
ls basename find cp mv rm mkdir rmdir mknod touch chmod \
|
||||
'[' printf wc grep awk sed cut \
|
||||
mtd partx losetup mkfs.ext4 nandwrite flash_erase \
|
||||
ubiupdatevol ubiattach ubiblock ubiformat \
|
||||
ubidetach ubirsvol ubirmvol ubimkvol \
|
||||
snapshot snapshot_tool date \
|
||||
snapshot snapshot_tool date logger \
|
||||
$RAMFS_COPY_LOSETUP $RAMFS_COPY_LVM \
|
||||
$RAMFS_COPY_BIN
|
||||
do
|
||||
@ -85,7 +85,7 @@ kill_remaining() { # [ <signal> [ <loop> ] ]
|
||||
local stat
|
||||
local proc_ppid=$(cut -d' ' -f4 /proc/$$/stat)
|
||||
|
||||
vn "Sending $sig to remaining processes ..."
|
||||
v "Sending $sig to remaining processes ..."
|
||||
|
||||
while $run; do
|
||||
run=false
|
||||
@ -105,7 +105,7 @@ kill_remaining() { # [ <signal> [ <loop> ] ]
|
||||
# Skip kernel threads
|
||||
[ -n "$cmdline" ] || continue
|
||||
|
||||
_vn " $name"
|
||||
v "Sending signal $sig to $name ($pid)"
|
||||
kill -$sig $pid 2>/dev/null
|
||||
|
||||
[ $loop -eq 1 ] && run=true
|
||||
@ -113,12 +113,10 @@ kill_remaining() { # [ <signal> [ <loop> ] ]
|
||||
|
||||
let loop_limit--
|
||||
[ $loop_limit -eq 0 ] && {
|
||||
_v
|
||||
v "Failed to kill all processes."
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
_v
|
||||
}
|
||||
|
||||
indicate_upgrade
|
||||
@ -139,9 +137,9 @@ for service in /etc/init.d/*; do
|
||||
ubus call service delete '{ "name": "'"$service"'" }' 2>/dev/null
|
||||
done
|
||||
|
||||
killall -9 telnetd
|
||||
killall -9 dropbear
|
||||
killall -9 ash
|
||||
killall -9 telnetd 2>/dev/null
|
||||
killall -9 dropbear 2>/dev/null
|
||||
killall -9 ash 2>/dev/null
|
||||
|
||||
kill_remaining TERM
|
||||
sleep 4
|
||||
|
@ -1,9 +1,6 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# Copyright (C) 2006-2015 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
# Copyright (C) 2006-2021 OpenWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
@ -11,7 +8,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
PKG_NAME:=grub
|
||||
PKG_CPE_ID:=cpe:/a:gnu:grub2
|
||||
PKG_VERSION:=2.06~rc1
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://alpha.gnu.org/gnu/grub
|
||||
@ -20,8 +17,10 @@ PKG_HASH:=2c87f1f21e2ab50043e6cd9163c08f1b6c3a6171556bf23ff9ed65b074145484
|
||||
HOST_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_DEPENDS:=grub2/host
|
||||
|
||||
PKG_ASLR_PIE:=0
|
||||
PKG_SSP:=0
|
||||
ifneq ($(BUILD_VARIANT),none)
|
||||
PKG_ASLR_PIE:=0
|
||||
PKG_SSP:=0
|
||||
endif
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
@ -47,13 +46,27 @@ define Package/grub2-editenv
|
||||
TITLE:=Grub2 Environment editor
|
||||
URL:=http://www.gnu.org/software/grub/
|
||||
DEPENDS:=@TARGET_x86
|
||||
VARIANT:=pc
|
||||
VARIANT:=none
|
||||
endef
|
||||
|
||||
define Package/grub2-editenv/description
|
||||
Edit grub2 environment files.
|
||||
endef
|
||||
|
||||
define Package/grub2-bios-setup
|
||||
CATEGORY:=Utilities
|
||||
SECTION:=utils
|
||||
SUBMENU:=Boot Loaders
|
||||
TITLE:=Grub2 BIOS boot setup tool
|
||||
URL:=http://www.gnu.org/software/grub/
|
||||
DEPENDS:=@TARGET_x86
|
||||
VARIANT:=none
|
||||
endef
|
||||
|
||||
define Package/grub2-bios-setup/description
|
||||
Set up images to bootable.
|
||||
endef
|
||||
|
||||
HOST_BUILD_PREFIX := $(STAGING_DIR_HOST)
|
||||
|
||||
CONFIGURE_VARS += \
|
||||
@ -85,7 +98,11 @@ HOST_MAKE_FLAGS += \
|
||||
TARGET_RANLIB=$(TARGET_RANLIB) \
|
||||
LIBLZMA=$(STAGING_DIR_HOST)/lib/liblzma.a
|
||||
|
||||
TARGET_CFLAGS := $(filter-out -O2 -O3 -fno-plt,$(TARGET_CFLAGS))
|
||||
|
||||
ifneq ($(BUILD_VARIANT),none)
|
||||
TARGET_CFLAGS := $(filter-out -O2 -O3 -fno-plt,$(TARGET_CFLAGS))
|
||||
MAKE_PATH := grub-core
|
||||
endif
|
||||
|
||||
define Host/Configure
|
||||
$(SED) 's,(RANLIB),(TARGET_RANLIB),' $(HOST_BUILD_DIR)/grub-core/Makefile.in
|
||||
@ -93,8 +110,6 @@ define Host/Configure
|
||||
endef
|
||||
|
||||
define Package/grub2/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-bios-setup $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)/grub2
|
||||
$(CP) $(PKG_BUILD_DIR)/grub-core/boot.img $(STAGING_DIR_IMAGE)/grub2/
|
||||
$(CP) $(PKG_BUILD_DIR)/grub-core/cdboot.img $(STAGING_DIR_IMAGE)/grub2/
|
||||
@ -152,7 +167,13 @@ define Package/grub2-editenv/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-editenv $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/grub2-bios-setup/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-bios-setup $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
$(eval $(call BuildPackage,grub2))
|
||||
$(eval $(call BuildPackage,grub2-efi))
|
||||
$(eval $(call BuildPackage,grub2-editenv))
|
||||
$(eval $(call BuildPackage,grub2-bios-setup))
|
||||
|
@ -0,0 +1,51 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Sat, 19 Jun 2021 12:10:14 +0200
|
||||
Subject: [PATCH] mac80211: remove iwlwifi specific workaround that broke sta
|
||||
NDP tx
|
||||
|
||||
Sending nulldata packets is important for sw AP link probing and detecting
|
||||
4-address mode links. The checks that dropped these packets were apparently
|
||||
added to work around an iwlwifi firmware bug with multi-TID aggregation.
|
||||
|
||||
Fixes: 41cbb0f5a295 ("mac80211: add support for HE")
|
||||
Cc: stable@vger.kernel.org
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
|
||||
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
|
||||
@@ -1085,6 +1085,9 @@ static int iwl_mvm_tx_mpdu(struct iwl_mv
|
||||
if (WARN_ON_ONCE(mvmsta->sta_id == IWL_MVM_INVALID_STA))
|
||||
return -1;
|
||||
|
||||
+ if (unlikely(ieee80211_is_any_nullfunc(fc)) && sta->he_cap.has_he)
|
||||
+ return -1;
|
||||
+
|
||||
if (unlikely(ieee80211_is_probe_resp(fc)))
|
||||
iwl_mvm_probe_resp_set_noa(mvm, skb);
|
||||
|
||||
--- a/net/mac80211/mlme.c
|
||||
+++ b/net/mac80211/mlme.c
|
||||
@@ -1094,11 +1094,6 @@ void ieee80211_send_nullfunc(struct ieee
|
||||
struct ieee80211_hdr_3addr *nullfunc;
|
||||
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
|
||||
|
||||
- /* Don't send NDPs when STA is connected HE */
|
||||
- if (sdata->vif.type == NL80211_IFTYPE_STATION &&
|
||||
- !(ifmgd->flags & IEEE80211_STA_DISABLE_HE))
|
||||
- return;
|
||||
-
|
||||
skb = ieee80211_nullfunc_get(&local->hw, &sdata->vif,
|
||||
!ieee80211_hw_check(&local->hw, DOESNT_SUPPORT_QOS_NDP));
|
||||
if (!skb)
|
||||
@@ -1130,10 +1125,6 @@ static void ieee80211_send_4addr_nullfun
|
||||
if (WARN_ON(sdata->vif.type != NL80211_IFTYPE_STATION))
|
||||
return;
|
||||
|
||||
- /* Don't send NDPs when connected HE */
|
||||
- if (!(sdata->u.mgd.flags & IEEE80211_STA_DISABLE_HE))
|
||||
- return;
|
||||
-
|
||||
skb = dev_alloc_skb(local->hw.extra_tx_headroom + 30);
|
||||
if (!skb)
|
||||
return;
|
@ -21,7 +21,6 @@ PKG_LICENSE_FILES:=COPYING
|
||||
PKG_CPE_ID:=cpe:/a:json-c_project:json-c
|
||||
|
||||
PKG_FLAGS := nonshared
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
@ -21,7 +21,6 @@ PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_ASLR_PIE_REGULAR:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
@ -16,7 +16,6 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/ARMmbed/mbedtls/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=96257bb03b30300b2f35f861ffe204ed957e9fd0329d80646fe57fc49f589b29
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
PKG_LICENSE_FILES:=gpl-2.0.txt
|
||||
PKG_CPE_ID:=cpe:/a:arm:mbed_tls
|
||||
@ -118,8 +117,6 @@ This package contains mbedtls helper programs for private key and
|
||||
CSR generation (gen_key, cert_req)
|
||||
endef
|
||||
|
||||
PKG_INSTALL:=1
|
||||
|
||||
TARGET_CFLAGS += -ffunction-sections -fdata-sections
|
||||
TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS))
|
||||
ifneq ($(CONFIG_LIBMBEDTLS_HAVE_ARMV8CE_AES),)
|
||||
|
@ -13,8 +13,6 @@ PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=qos-scripts
|
||||
PKG_VERSION:=1.3.1
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
@ -326,7 +326,8 @@ start_interface() {
|
||||
append cstr "$classnr:$prio:$avgrate:$pktsize:$pktdelay:$maxrate:$qdisc:$filter" "$N"
|
||||
done
|
||||
append ${prefix}q "$(tcrules)" "$N"
|
||||
export dev_${dir}="ip link set $dev up >&- 2>&-
|
||||
export dev_${dir}="ip link add ${dev} type ifb >&- 2>&-
|
||||
ip link set $dev up >&- 2>&-
|
||||
tc qdisc del dev $dev root >&- 2>&-
|
||||
tc qdisc add dev $dev root handle 1: hfsc default ${class_default}0
|
||||
tc class add dev $dev parent 1: classid 1:1 hfsc sc rate ${rate}kbit ul rate ${rate}kbit"
|
||||
|
@ -1,8 +1,6 @@
|
||||
# Copyright (C) 2006-2014 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# Copyright (C) 2006-2021 OpenWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
|
@ -322,6 +322,7 @@ hostapd_common_add_bss_config() {
|
||||
config_add_array supported_rates
|
||||
|
||||
config_add_boolean sae_require_mfp
|
||||
config_add_int sae_pwe
|
||||
|
||||
config_add_string 'owe_transition_bssid:macaddr' 'owe_transition_ssid:string'
|
||||
|
||||
@ -523,7 +524,7 @@ hostapd_set_bss_options() {
|
||||
macfilter ssid utf8_ssid wmm uapsd hidden short_preamble rsn_preauth \
|
||||
iapp_interface eapol_version dynamic_vlan ieee80211w nasid \
|
||||
acct_server acct_secret acct_port acct_interval \
|
||||
bss_load_update_period chan_util_avg_period sae_require_mfp \
|
||||
bss_load_update_period chan_util_avg_period sae_require_mfp sae_pwe \
|
||||
multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key skip_inactivity_poll \
|
||||
airtime_bss_weight airtime_bss_limit airtime_sta_weight \
|
||||
multicast_to_unicast proxy_arp per_sta_vif \
|
||||
@ -607,6 +608,7 @@ hostapd_set_bss_options() {
|
||||
;;
|
||||
esac
|
||||
[ -n "$sae_require_mfp" ] && append bss_conf "sae_require_mfp=$sae_require_mfp" "$N"
|
||||
[ -n "$sae_pwe" ] && append bss_conf "sae_pwe=$sae_pwe" "$N"
|
||||
|
||||
local vlan_possible=""
|
||||
|
||||
|
@ -23,8 +23,6 @@ static inline int has_feature(const char *feat)
|
||||
if (!strcmp(feat, "11r"))
|
||||
return 1;
|
||||
#endif
|
||||
if (!strcmp(feat, "11w"))
|
||||
return 1;
|
||||
#ifdef CONFIG_ACS
|
||||
if (!strcmp(feat, "acs"))
|
||||
return 1;
|
||||
|
@ -19,7 +19,6 @@ PKG_MIRROR_HASH:=a0644d31f99f20e5c2cee74153b81a0c2eae9ebeb644662cc76b0984b44dd49
|
||||
PKG_MAINTAINER:=Hans Dedecker <dedeckeh@gmail.com>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
PKG_INSTALL:=1
|
||||
PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_odhcpd_$(BUILD_VARIANT)_ext_cer_id
|
||||
PKG_ASLR_PIE_REGULAR:=1
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=uhttpd
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git
|
||||
|
@ -35,13 +35,14 @@ generate_keys() {
|
||||
local cfg="$1"
|
||||
local key="$2"
|
||||
local crt="$3"
|
||||
local days bits country state location commonname
|
||||
local days bits country state location organization commonname
|
||||
|
||||
config_get days "$cfg" days
|
||||
config_get bits "$cfg" bits
|
||||
config_get country "$cfg" country
|
||||
config_get state "$cfg" state
|
||||
config_get location "$cfg" location
|
||||
config_get organization "$cfg" organization
|
||||
config_get commonname "$cfg" commonname
|
||||
config_get key_type "$cfg" key_type
|
||||
config_get ec_curve "$cfg" ec_curve
|
||||
@ -56,7 +57,7 @@ generate_keys() {
|
||||
[ -n "$GENKEY_CMD" ] && {
|
||||
$GENKEY_CMD \
|
||||
-days ${days:-730} -newkey ${KEY_OPTS} -keyout "${UHTTPD_KEY}.new" -out "${UHTTPD_CERT}.new" \
|
||||
-subj /C="${country:-ZZ}"/ST="${state:-Somewhere}"/L="${location:-Unknown}"/O="${commonname:-OpenWrt}$UNIQUEID"/CN="${commonname:-OpenWrt}"
|
||||
-subj /C="${country:-ZZ}"/ST="${state:-Somewhere}"/L="${location:-Unknown}"/O="${organization:-OpenWrt$UNIQUEID}"/CN="${commonname:-OpenWrt}"
|
||||
sync
|
||||
mv "${UHTTPD_KEY}.new" "${UHTTPD_KEY}"
|
||||
mv "${UHTTPD_CERT}.new" "${UHTTPD_CERT}"
|
||||
|
@ -13,8 +13,6 @@ PKG_MAINTAINER:=John Crispin <john@phrozen.org>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
@ -13,8 +13,6 @@ PKG_MAINTAINER:=Matti Laakso <malaakso@elisanet.fi>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
@ -26,10 +26,6 @@ PKG_CONFIG_DEPENDS += \
|
||||
CONFIG_SIGNATURE_CHECK \
|
||||
CONFIG_TARGET_INIT_PATH
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
HOST_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
HOST_BUILD_DEPENDS:=libubox/host
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
@ -20,7 +20,6 @@ PKG_MIRROR_HASH:=69d9588a5a910676252eabcd2815af318806cae8316777e8b6eb00b26bdc42c
|
||||
PKG_LICENSE:=ISC
|
||||
PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_ASLR_PIE_REGULAR:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
@ -22,7 +22,6 @@ PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
PKG_BUILD_PARALLEL:=0
|
||||
PKG_FLAGS := nonshared
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
@ -12,8 +12,6 @@ PKG_MIRROR_HASH:=2d31025b79fe130c579d6c3f4bf4dc12abc43a7319b20a5cdca24ae363ec70f
|
||||
PKG_LICENSE:=GPL-2.0 BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
|
@ -351,10 +351,10 @@ config BUSYBOX_DEFAULT_FEATURE_GUNZIP_LONG_OPTIONS
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_BUNZIP2
|
||||
bool
|
||||
default y
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_BZCAT
|
||||
bool
|
||||
default y
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_UNLZMA
|
||||
bool
|
||||
default n
|
||||
|
@ -42,7 +42,7 @@ for json_file in work_dir.glob("*.json"):
|
||||
output["profiles"][device_id]["images"].extend(profile["images"])
|
||||
|
||||
# make image lists unique by name, keep last/latest
|
||||
for device_id, profile in output["profiles"].items():
|
||||
for device_id, profile in output.get("profiles", {}).items():
|
||||
profile["images"] = list({e["name"]: e for e in profile["images"]}.values())
|
||||
|
||||
|
||||
|
@ -0,0 +1,212 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "ar9344.dtsi"
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
|
||||
/ {
|
||||
compatible = "mikrotik,routerboard-912uag-2hpnd", "qca,ar9342";
|
||||
model = "MikroTik RouterBOARD 912UAG-2HPnD";
|
||||
|
||||
aliases {
|
||||
led-boot = &led_power;
|
||||
led-failsafe = &led_power;
|
||||
led-running = &led_power;
|
||||
led-upgrade = &led_power;
|
||||
};
|
||||
|
||||
gpio_latch: gpio_latch {
|
||||
compatible = "gpio-latch";
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
gpios = <&gpio 0 GPIO_ACTIVE_HIGH>,
|
||||
<&gpio 1 GPIO_ACTIVE_HIGH>,
|
||||
<&gpio 2 GPIO_ACTIVE_HIGH>,
|
||||
<&gpio 3 GPIO_ACTIVE_HIGH>,
|
||||
<0>, /* Not connected */
|
||||
<&gpio 13 GPIO_ACTIVE_HIGH>,
|
||||
<&gpio 14 GPIO_ACTIVE_HIGH>,
|
||||
<&gpio 15 GPIO_ACTIVE_HIGH>,
|
||||
<&gpio 11 GPIO_ACTIVE_LOW>; /* Latch Enable */
|
||||
};
|
||||
|
||||
nand_gpio {
|
||||
compatible = "mikrotik,rb91x-nand";
|
||||
|
||||
gpios = <&gpio_latch 3 GPIO_ACTIVE_HIGH>, /* Read */
|
||||
<&gpio 4 GPIO_ACTIVE_HIGH>, /* Ready (RDY) */
|
||||
<&gpio_latch 5 GPIO_ACTIVE_LOW>, /* Chip Enable (nCE) */
|
||||
<&gpio_latch 6 GPIO_ACTIVE_HIGH>, /* Command Latch Enable (CLE) */
|
||||
<&gpio_latch 7 GPIO_ACTIVE_HIGH>, /* Address Latch Enable (ALE) */
|
||||
<&gpio 12 GPIO_ACTIVE_LOW>, /* Read/Write Enable (nRW) */
|
||||
<&gpio_latch 8 GPIO_ACTIVE_LOW>; /* Latch Enable (nLE) */
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "booter";
|
||||
reg = <0x0 0x0040000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@40000 {
|
||||
label = "kernel";
|
||||
reg = <0x0040000 0x03c0000>;
|
||||
};
|
||||
|
||||
partition@400000 {
|
||||
label = "ubi";
|
||||
reg = <0x0400000 0x7c00000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led_power: power {
|
||||
label = "green:power";
|
||||
gpios = <&gpio_latch 1 GPIO_ACTIVE_HIGH>;
|
||||
default-state = "on";
|
||||
};
|
||||
|
||||
user {
|
||||
label = "green:user";
|
||||
gpios = <&gpio_latch 2 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led1 {
|
||||
label = "green:led1";
|
||||
gpios = <&ssr 0 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led2 {
|
||||
label = "green:led2";
|
||||
gpios = <&ssr 1 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led3 {
|
||||
label = "green:led3";
|
||||
gpios = <&ssr 2 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led4 {
|
||||
label = "green:led4";
|
||||
gpios = <&ssr 3 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led5 {
|
||||
label = "green:led5";
|
||||
gpios = <&ssr 4 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
|
||||
gpio-export {
|
||||
compatible = "gpio-export";
|
||||
|
||||
usb_power {
|
||||
gpio-export,name = "power-usb";
|
||||
gpio-export,output = <1>;
|
||||
gpios = <&ssr 6 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
pcie_power {
|
||||
gpio-export,name = "power-pcie";
|
||||
gpio-export,output = <0>;
|
||||
gpios = <&ssr 7 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi {
|
||||
status = "okay";
|
||||
|
||||
compatible = "qca,ar7100-spi";
|
||||
|
||||
cs-gpios = <0>, <&gpio_latch 0 GPIO_ACTIVE_LOW>;
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <50000000>;
|
||||
|
||||
partitions {
|
||||
compatible = "mikrotik,routerboot-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "routerboot";
|
||||
reg = <0x0 0x0>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
hard_config: hard_config {
|
||||
read-only;
|
||||
};
|
||||
|
||||
bios {
|
||||
size = <0x1000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
soft_config {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ssr: ssr@1 {
|
||||
compatible = "fairchild,74hc595";
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
registers-number = <1>;
|
||||
reg = <1>;
|
||||
spi-max-frequency = <50000000>;
|
||||
};
|
||||
};
|
||||
|
||||
&mdio0 {
|
||||
status = "okay";
|
||||
|
||||
phy-mask = <0>;
|
||||
|
||||
phy0: ethernet-phy@0 {
|
||||
reg = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
ð0 {
|
||||
status = "okay";
|
||||
|
||||
phy-mode = "rgmii-id";
|
||||
phy-handle = <&phy0>;
|
||||
pll-data = <0x02000000 0x00000101 0x00001313>;
|
||||
|
||||
gmac-config {
|
||||
device = <&gmac>;
|
||||
rgmii-gmac0 = <1>;
|
||||
rgmii-enabled = <1>;
|
||||
rxd-delay = <1>;
|
||||
txd-delay = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
&wmac {
|
||||
status = "okay";
|
||||
qca,no-eeprom;
|
||||
};
|
||||
|
||||
&pcie {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_phy {
|
||||
status = "okay";
|
||||
};
|
203
target/linux/ath79/files/drivers/gpio/gpio-latch.c
Normal file
203
target/linux/ath79/files/drivers/gpio/gpio-latch.c
Normal file
@ -0,0 +1,203 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* GPIO latch driver
|
||||
*
|
||||
* Copyright (C) 2014 Gabor Juhos <juhosg@openwrt.org>
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
#include <linux/gpio/driver.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/of_gpio.h>
|
||||
|
||||
#define GPIO_LATCH_DRIVER_NAME "gpio-latch"
|
||||
#define GPIO_LATCH_LINES 9
|
||||
|
||||
struct gpio_latch_chip {
|
||||
struct gpio_chip gc;
|
||||
struct mutex mutex;
|
||||
struct mutex latch_mutex;
|
||||
bool latch_enabled;
|
||||
int le_gpio;
|
||||
bool le_active_low;
|
||||
struct gpio_desc *gpios[GPIO_LATCH_LINES];
|
||||
};
|
||||
|
||||
static inline struct gpio_latch_chip *to_gpio_latch_chip(struct gpio_chip *gc)
|
||||
{
|
||||
return container_of(gc, struct gpio_latch_chip, gc);
|
||||
}
|
||||
|
||||
static void gpio_latch_lock(struct gpio_latch_chip *glc, bool enable)
|
||||
{
|
||||
mutex_lock(&glc->mutex);
|
||||
|
||||
if (enable)
|
||||
glc->latch_enabled = true;
|
||||
|
||||
if (glc->latch_enabled)
|
||||
mutex_lock(&glc->latch_mutex);
|
||||
}
|
||||
|
||||
static void gpio_latch_unlock(struct gpio_latch_chip *glc, bool disable)
|
||||
{
|
||||
if (glc->latch_enabled)
|
||||
mutex_unlock(&glc->latch_mutex);
|
||||
|
||||
if (disable)
|
||||
glc->latch_enabled = true;
|
||||
|
||||
mutex_unlock(&glc->mutex);
|
||||
}
|
||||
|
||||
static int
|
||||
gpio_latch_get(struct gpio_chip *gc, unsigned offset)
|
||||
{
|
||||
struct gpio_latch_chip *glc = to_gpio_latch_chip(gc);
|
||||
int ret;
|
||||
|
||||
gpio_latch_lock(glc, false);
|
||||
ret = gpiod_get_value(glc->gpios[offset]);
|
||||
gpio_latch_unlock(glc, false);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
gpio_latch_set(struct gpio_chip *gc, unsigned offset, int value)
|
||||
{
|
||||
struct gpio_latch_chip *glc = to_gpio_latch_chip(gc);
|
||||
bool enable_latch = false;
|
||||
bool disable_latch = false;
|
||||
|
||||
if (offset == glc->le_gpio) {
|
||||
enable_latch = value ^ glc->le_active_low;
|
||||
disable_latch = !enable_latch;
|
||||
}
|
||||
|
||||
gpio_latch_lock(glc, enable_latch);
|
||||
gpiod_set_raw_value(glc->gpios[offset], value);
|
||||
gpio_latch_unlock(glc, disable_latch);
|
||||
}
|
||||
|
||||
static int
|
||||
gpio_latch_direction_output(struct gpio_chip *gc, unsigned offset, int value)
|
||||
{
|
||||
struct gpio_latch_chip *glc = to_gpio_latch_chip(gc);
|
||||
bool enable_latch = false;
|
||||
bool disable_latch = false;
|
||||
int ret;
|
||||
|
||||
if (offset == glc->le_gpio) {
|
||||
enable_latch = value ^ glc->le_active_low;
|
||||
disable_latch = !enable_latch;
|
||||
}
|
||||
|
||||
gpio_latch_lock(glc, enable_latch);
|
||||
ret = gpiod_direction_output_raw(glc->gpios[offset], value);
|
||||
gpio_latch_unlock(glc, disable_latch);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int gpio_latch_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct gpio_latch_chip *glc;
|
||||
struct gpio_chip *gc;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct device_node *of_node = dev->of_node;
|
||||
int i, n;
|
||||
|
||||
glc = devm_kzalloc(dev, sizeof(*glc), GFP_KERNEL);
|
||||
if (!glc)
|
||||
return -ENOMEM;
|
||||
|
||||
mutex_init(&glc->mutex);
|
||||
mutex_init(&glc->latch_mutex);
|
||||
|
||||
n = gpiod_count(dev, NULL);
|
||||
if (n <= 0) {
|
||||
dev_err(dev, "failed to get gpios: %d\n", n);
|
||||
return n;
|
||||
} else if (n != GPIO_LATCH_LINES) {
|
||||
dev_err(dev, "expected %d gpios\n", GPIO_LATCH_LINES);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
glc->gpios[i] = devm_gpiod_get_index_optional(dev, NULL, i,
|
||||
GPIOD_OUT_LOW);
|
||||
if (IS_ERR(glc->gpios[i])) {
|
||||
dev_err(dev, "failed to get gpio %d: %d\n", i,
|
||||
PTR_ERR(glc->gpios[i]));
|
||||
return PTR_ERR(glc->gpios[i]);
|
||||
}
|
||||
}
|
||||
|
||||
glc->le_gpio = 8;
|
||||
glc->le_active_low = gpiod_is_active_low(glc->gpios[glc->le_gpio]);
|
||||
|
||||
if (!glc->gpios[glc->le_gpio]) {
|
||||
dev_err(dev, "missing required latch-enable gpio %d\n",
|
||||
glc->le_gpio);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
gc = &glc->gc;
|
||||
gc->label = GPIO_LATCH_DRIVER_NAME;
|
||||
gc->can_sleep = true;
|
||||
gc->base = -1;
|
||||
gc->ngpio = GPIO_LATCH_LINES;
|
||||
gc->get = gpio_latch_get;
|
||||
gc->set = gpio_latch_set;
|
||||
gc->direction_output = gpio_latch_direction_output;
|
||||
gc->of_node = of_node;
|
||||
|
||||
platform_set_drvdata(pdev, glc);
|
||||
|
||||
i = gpiochip_add(&glc->gc);
|
||||
if (i) {
|
||||
dev_err(dev, "gpiochip_add() failed: %d\n", i);
|
||||
return i;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gpio_latch_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct gpio_latch_chip *glc = platform_get_drvdata(pdev);
|
||||
|
||||
gpiochip_remove(&glc->gc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id gpio_latch_match[] = {
|
||||
{ .compatible = GPIO_LATCH_DRIVER_NAME },
|
||||
{},
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(of, gpio_latch_match);
|
||||
|
||||
static struct platform_driver gpio_latch_driver = {
|
||||
.probe = gpio_latch_probe,
|
||||
.remove = gpio_latch_remove,
|
||||
.driver = {
|
||||
.name = GPIO_LATCH_DRIVER_NAME,
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = gpio_latch_match,
|
||||
},
|
||||
};
|
||||
|
||||
module_platform_driver(gpio_latch_driver);
|
||||
|
||||
MODULE_DESCRIPTION("GPIO latch driver");
|
||||
MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org>");
|
||||
MODULE_AUTHOR("Denis Kalashnikov <denis281089@gmail.com>");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_ALIAS("platform:" GPIO_LATCH_DRIVER_NAME);
|
@ -1273,7 +1273,6 @@ static int ar934x_nfc_setup_hwecc(struct ar934x_nfc *nfc)
|
||||
* Writing a subpage separately is not supported, because
|
||||
* the controller only does ECC on full-page accesses.
|
||||
*/
|
||||
nand->options = NAND_NO_SUBPAGE_WRITE;
|
||||
|
||||
nand->ecc.size = 512;
|
||||
nand->ecc.bytes = 7;
|
||||
@ -1332,6 +1331,9 @@ static int ar934x_nfc_attach_chip(struct nand_chip *nand)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (mtd->writesize == 2048)
|
||||
nand->options |= NAND_NO_SUBPAGE_WRITE;
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0)
|
||||
if (nand->ecc.engine_type == NAND_ECC_ENGINE_TYPE_ON_HOST) {
|
||||
#else
|
||||
|
375
target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c
Normal file
375
target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c
Normal file
@ -0,0 +1,375 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* MikroTik RB91x NAND flash driver
|
||||
*
|
||||
* Main part is copied from original driver written by Gabor Juhos.
|
||||
*
|
||||
* Copyright (C) 2013-2014 Gabor Juhos <juhosg@openwrt.org>
|
||||
*/
|
||||
|
||||
/*
|
||||
* WARNING: to speed up NAND reading/writing we are working with SoC GPIO
|
||||
* controller registers directly -- not through standard GPIO API.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/mtd/rawnand.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/of_platform.h>
|
||||
|
||||
#include <asm/mach-ath79/ar71xx_regs.h>
|
||||
|
||||
/* Bit masks for NAND data lines in ath79 gpio 32-bit register */
|
||||
#define RB91X_NAND_NRW_BIT BIT(12)
|
||||
#define RB91X_NAND_DATA_BITS (BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) \
|
||||
| BIT(13) | BIT(14) | BIT(15))
|
||||
#define RB91X_NAND_LOW_DATA_MASK 0x1f
|
||||
#define RB91X_NAND_HIGH_DATA_MASK 0xe0
|
||||
#define RB91X_NAND_HIGH_DATA_SHIFT 8
|
||||
|
||||
enum rb91x_nand_gpios {
|
||||
RB91X_NAND_READ,/* Read */
|
||||
RB91X_NAND_RDY, /* NAND Ready */
|
||||
RB91X_NAND_NCE, /* Chip Enable. Active low */
|
||||
RB91X_NAND_CLE, /* Command Latch Enable */
|
||||
RB91X_NAND_ALE, /* Address Latch Enable */
|
||||
RB91X_NAND_NRW, /* Read/Write. Active low */
|
||||
RB91X_NAND_NLE, /* Latch Enable. Active low */
|
||||
|
||||
RB91X_NAND_GPIOS,
|
||||
};
|
||||
|
||||
struct rb91x_nand_drvdata {
|
||||
struct nand_chip chip;
|
||||
struct device *dev;
|
||||
struct gpio_desc **gpio;
|
||||
void __iomem *ath79_gpio_base;
|
||||
};
|
||||
|
||||
static inline void rb91x_nand_latch_lock(struct rb91x_nand_drvdata *drvdata,
|
||||
int lock)
|
||||
{
|
||||
gpiod_set_value_cansleep(drvdata->gpio[RB91X_NAND_NLE], lock);
|
||||
}
|
||||
|
||||
static int rb91x_ooblayout_ecc(struct mtd_info *mtd, int section,
|
||||
struct mtd_oob_region *oobregion)
|
||||
{
|
||||
switch (section) {
|
||||
case 0:
|
||||
oobregion->offset = 8;
|
||||
oobregion->length = 3;
|
||||
return 0;
|
||||
case 1:
|
||||
oobregion->offset = 13;
|
||||
oobregion->length = 3;
|
||||
return 0;
|
||||
default:
|
||||
return -ERANGE;
|
||||
}
|
||||
}
|
||||
|
||||
static int rb91x_ooblayout_free(struct mtd_info *mtd, int section,
|
||||
struct mtd_oob_region *oobregion)
|
||||
{
|
||||
switch (section) {
|
||||
case 0:
|
||||
oobregion->offset = 0;
|
||||
oobregion->length = 4;
|
||||
return 0;
|
||||
case 1:
|
||||
oobregion->offset = 4;
|
||||
oobregion->length = 1;
|
||||
return 0;
|
||||
case 2:
|
||||
oobregion->offset = 6;
|
||||
oobregion->length = 2;
|
||||
return 0;
|
||||
case 3:
|
||||
oobregion->offset = 11;
|
||||
oobregion->length = 2;
|
||||
return 0;
|
||||
default:
|
||||
return -ERANGE;
|
||||
}
|
||||
}
|
||||
|
||||
static const struct mtd_ooblayout_ops rb91x_nand_ecclayout_ops = {
|
||||
.ecc = rb91x_ooblayout_ecc,
|
||||
.free = rb91x_ooblayout_free,
|
||||
};
|
||||
|
||||
static void rb91x_nand_write(struct rb91x_nand_drvdata *drvdata,
|
||||
const u8 *buf,
|
||||
unsigned len)
|
||||
{
|
||||
void __iomem *base = drvdata->ath79_gpio_base;
|
||||
u32 oe_reg;
|
||||
u32 out_reg;
|
||||
u32 out;
|
||||
unsigned i;
|
||||
|
||||
rb91x_nand_latch_lock(drvdata, 1);
|
||||
|
||||
oe_reg = __raw_readl(base + AR71XX_GPIO_REG_OE);
|
||||
out_reg = __raw_readl(base + AR71XX_GPIO_REG_OUT);
|
||||
|
||||
/* Set data lines to output mode */
|
||||
__raw_writel(oe_reg & ~(RB91X_NAND_DATA_BITS | RB91X_NAND_NRW_BIT),
|
||||
base + AR71XX_GPIO_REG_OE);
|
||||
|
||||
out = out_reg & ~(RB91X_NAND_DATA_BITS | RB91X_NAND_NRW_BIT);
|
||||
for (i = 0; i != len; i++) {
|
||||
u32 data;
|
||||
|
||||
data = (buf[i] & RB91X_NAND_HIGH_DATA_MASK) <<
|
||||
RB91X_NAND_HIGH_DATA_SHIFT;
|
||||
data |= buf[i] & RB91X_NAND_LOW_DATA_MASK;
|
||||
data |= out;
|
||||
__raw_writel(data, base + AR71XX_GPIO_REG_OUT);
|
||||
|
||||
/* Deactivate WE line */
|
||||
data |= RB91X_NAND_NRW_BIT;
|
||||
__raw_writel(data, base + AR71XX_GPIO_REG_OUT);
|
||||
/* Flush write */
|
||||
__raw_readl(base + AR71XX_GPIO_REG_OUT);
|
||||
}
|
||||
|
||||
/* Restore registers */
|
||||
__raw_writel(out_reg, base + AR71XX_GPIO_REG_OUT);
|
||||
__raw_writel(oe_reg, base + AR71XX_GPIO_REG_OE);
|
||||
/* Flush write */
|
||||
__raw_readl(base + AR71XX_GPIO_REG_OUT);
|
||||
|
||||
rb91x_nand_latch_lock(drvdata, 0);
|
||||
}
|
||||
|
||||
static void rb91x_nand_read(struct rb91x_nand_drvdata *drvdata,
|
||||
u8 *read_buf,
|
||||
unsigned len)
|
||||
{
|
||||
void __iomem *base = drvdata->ath79_gpio_base;
|
||||
u32 oe_reg;
|
||||
u32 out_reg;
|
||||
unsigned i;
|
||||
|
||||
/* Enable read mode */
|
||||
gpiod_set_value_cansleep(drvdata->gpio[RB91X_NAND_READ], 1);
|
||||
|
||||
rb91x_nand_latch_lock(drvdata, 1);
|
||||
|
||||
/* Save registers */
|
||||
oe_reg = __raw_readl(base + AR71XX_GPIO_REG_OE);
|
||||
out_reg = __raw_readl(base + AR71XX_GPIO_REG_OUT);
|
||||
|
||||
/* Set data lines to input mode */
|
||||
__raw_writel(oe_reg | RB91X_NAND_DATA_BITS,
|
||||
base + AR71XX_GPIO_REG_OE);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
u32 in;
|
||||
u8 data;
|
||||
|
||||
/* Activate RE line */
|
||||
__raw_writel(RB91X_NAND_NRW_BIT, base + AR71XX_GPIO_REG_CLEAR);
|
||||
/* Flush write */
|
||||
__raw_readl(base + AR71XX_GPIO_REG_CLEAR);
|
||||
|
||||
/* Read input lines */
|
||||
in = __raw_readl(base + AR71XX_GPIO_REG_IN);
|
||||
|
||||
/* Deactivate RE line */
|
||||
__raw_writel(RB91X_NAND_NRW_BIT, base + AR71XX_GPIO_REG_SET);
|
||||
|
||||
data = (in & RB91X_NAND_LOW_DATA_MASK);
|
||||
data |= (in >> RB91X_NAND_HIGH_DATA_SHIFT) &
|
||||
RB91X_NAND_HIGH_DATA_MASK;
|
||||
|
||||
read_buf[i] = data;
|
||||
}
|
||||
|
||||
/* Restore registers */
|
||||
__raw_writel(out_reg, base + AR71XX_GPIO_REG_OUT);
|
||||
__raw_writel(oe_reg, base + AR71XX_GPIO_REG_OE);
|
||||
/* Flush write */
|
||||
__raw_readl(base + AR71XX_GPIO_REG_OUT);
|
||||
|
||||
rb91x_nand_latch_lock(drvdata, 0);
|
||||
|
||||
/* Disable read mode */
|
||||
gpiod_set_value_cansleep(drvdata->gpio[RB91X_NAND_READ], 0);
|
||||
}
|
||||
|
||||
static int rb91x_nand_dev_ready(struct nand_chip *chip)
|
||||
{
|
||||
struct rb91x_nand_drvdata *drvdata = (struct rb91x_nand_drvdata *)(chip->priv);
|
||||
|
||||
return gpiod_get_value_cansleep(drvdata->gpio[RB91X_NAND_RDY]);
|
||||
}
|
||||
|
||||
static void rb91x_nand_cmd_ctrl(struct nand_chip *chip, int cmd,
|
||||
unsigned int ctrl)
|
||||
{
|
||||
struct rb91x_nand_drvdata *drvdata = chip->priv;
|
||||
|
||||
if (ctrl & NAND_CTRL_CHANGE) {
|
||||
gpiod_set_value_cansleep(drvdata->gpio[RB91X_NAND_CLE],
|
||||
(ctrl & NAND_CLE) ? 1 : 0);
|
||||
gpiod_set_value_cansleep(drvdata->gpio[RB91X_NAND_ALE],
|
||||
(ctrl & NAND_ALE) ? 1 : 0);
|
||||
gpiod_set_value_cansleep(drvdata->gpio[RB91X_NAND_NCE],
|
||||
(ctrl & NAND_NCE) ? 1 : 0);
|
||||
}
|
||||
|
||||
if (cmd != NAND_CMD_NONE) {
|
||||
u8 t = cmd;
|
||||
|
||||
rb91x_nand_write(drvdata, &t, 1);
|
||||
}
|
||||
}
|
||||
|
||||
static u8 rb91x_nand_read_byte(struct nand_chip *chip)
|
||||
{
|
||||
u8 data = 0xff;
|
||||
|
||||
rb91x_nand_read(chip->priv, &data, 1);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
static void rb91x_nand_read_buf(struct nand_chip *chip, u8 *buf, int len)
|
||||
{
|
||||
rb91x_nand_read(chip->priv, buf, len);
|
||||
}
|
||||
|
||||
static void rb91x_nand_write_buf(struct nand_chip *chip, const u8 *buf, int len)
|
||||
{
|
||||
rb91x_nand_write(chip->priv, buf, len);
|
||||
}
|
||||
|
||||
static void rb91x_nand_release(struct rb91x_nand_drvdata *drvdata)
|
||||
{
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0)
|
||||
mtd_device_unregister(nand_to_mtd(&drvdata->chip));
|
||||
nand_cleanup(&drvdata->chip);
|
||||
#else
|
||||
nand_release(&drvdata->chip);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int rb91x_nand_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct rb91x_nand_drvdata *drvdata;
|
||||
struct mtd_info *mtd;
|
||||
int r;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct gpio_descs *gpios;
|
||||
|
||||
drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
|
||||
if (!drvdata)
|
||||
return -ENOMEM;
|
||||
|
||||
platform_set_drvdata(pdev, drvdata);
|
||||
|
||||
gpios = gpiod_get_array(dev, NULL, GPIOD_OUT_LOW);
|
||||
if (IS_ERR(gpios)) {
|
||||
dev_err(dev, "failed to get gpios: %d\n", (int)gpios);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (gpios->ndescs != RB91X_NAND_GPIOS) {
|
||||
dev_err(dev, "expected %d gpios\n", RB91X_NAND_GPIOS);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
drvdata->gpio = gpios->desc;
|
||||
|
||||
gpiod_direction_input(drvdata->gpio[RB91X_NAND_RDY]);
|
||||
|
||||
drvdata->ath79_gpio_base = ioremap(AR71XX_GPIO_BASE, AR71XX_GPIO_SIZE);
|
||||
|
||||
drvdata->dev = dev;
|
||||
|
||||
drvdata->chip.priv = drvdata;
|
||||
|
||||
drvdata->chip.legacy.cmd_ctrl = rb91x_nand_cmd_ctrl;
|
||||
drvdata->chip.legacy.dev_ready = rb91x_nand_dev_ready;
|
||||
drvdata->chip.legacy.read_byte = rb91x_nand_read_byte;
|
||||
drvdata->chip.legacy.write_buf = rb91x_nand_write_buf;
|
||||
drvdata->chip.legacy.read_buf = rb91x_nand_read_buf;
|
||||
|
||||
drvdata->chip.legacy.chip_delay = 25;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0)
|
||||
drvdata->chip.ecc.engine_type = NAND_ECC_ENGINE_TYPE_SOFT;
|
||||
drvdata->chip.ecc.algo = NAND_ECC_ALGO_HAMMING;
|
||||
#else
|
||||
drvdata->chip.ecc.mode = NAND_ECC_SOFT;
|
||||
drvdata->chip.ecc.algo = NAND_ECC_HAMMING;
|
||||
#endif
|
||||
drvdata->chip.options = NAND_NO_SUBPAGE_WRITE;
|
||||
|
||||
r = nand_scan(&drvdata->chip, 1);
|
||||
if (r) {
|
||||
dev_err(dev, "nand_scan() failed: %d\n", r);
|
||||
return r;
|
||||
}
|
||||
|
||||
mtd = nand_to_mtd(&drvdata->chip);
|
||||
mtd->dev.parent = dev;
|
||||
mtd_set_of_node(mtd, dev->of_node);
|
||||
mtd->owner = THIS_MODULE;
|
||||
if (mtd->writesize == 512)
|
||||
mtd_set_ooblayout(mtd, &rb91x_nand_ecclayout_ops);
|
||||
|
||||
r = mtd_device_register(mtd, NULL, 0);
|
||||
if (r) {
|
||||
dev_err(dev, "mtd_device_register() failed: %d\n",
|
||||
r);
|
||||
goto err_release_nand;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_release_nand:
|
||||
rb91x_nand_release(drvdata);
|
||||
return r;
|
||||
}
|
||||
|
||||
static int rb91x_nand_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct rb91x_nand_drvdata *drvdata = platform_get_drvdata(pdev);
|
||||
|
||||
rb91x_nand_release(drvdata);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id rb91x_nand_match[] = {
|
||||
{ .compatible = "mikrotik,rb91x-nand" },
|
||||
{},
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(of, rb91x_nand_match);
|
||||
|
||||
static struct platform_driver rb91x_nand_driver = {
|
||||
.probe = rb91x_nand_probe,
|
||||
.remove = rb91x_nand_remove,
|
||||
.driver = {
|
||||
.name = "rb91x-nand",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = rb91x_nand_match,
|
||||
},
|
||||
};
|
||||
|
||||
module_platform_driver(rb91x_nand_driver);
|
||||
|
||||
MODULE_DESCRIPTION("MikrotTik RB91x NAND flash driver");
|
||||
MODULE_VERSION(DRV_VERSION);
|
||||
MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org>");
|
||||
MODULE_AUTHOR("Denis Kalashnikov <denis281089@gmail.com>");
|
||||
MODULE_LICENSE("GPL v2");
|
@ -9,6 +9,15 @@ define Device/mikrotik_routerboard-493g
|
||||
endef
|
||||
TARGET_DEVICES += mikrotik_routerboard-493g
|
||||
|
||||
define Device/mikrotik_routerboard-912uag-2hpnd
|
||||
$(Device/mikrotik_nand)
|
||||
SOC := ar9342
|
||||
DEVICE_MODEL := RouterBOARD 912UAG-2HPnD
|
||||
DEVICE_PACKAGES += kmod-usb-ehci kmod-usb2 kmod-gpio-beeper
|
||||
SUPPORTED_DEVICES += rb-912uag-2hpnd
|
||||
endef
|
||||
TARGET_DEVICES += mikrotik_routerboard-912uag-2hpnd
|
||||
|
||||
define Device/mikrotik_routerboard-921gs-5hpacd-15s
|
||||
$(Device/mikrotik_nand)
|
||||
SOC := qca9558
|
||||
|
@ -14,6 +14,7 @@ ath79_setup_interfaces()
|
||||
ucidef_add_switch "switch1" \
|
||||
"0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
|
||||
;;
|
||||
mikrotik,routerboard-912uag-2hpnd|\
|
||||
mikrotik,routerboard-921gs-5hpacd-15s|\
|
||||
mikrotik,routerboard-lhg-2nd|\
|
||||
mikrotik,routerboard-sxt-5nd-r2|\
|
||||
@ -36,6 +37,7 @@ ath79_setup_macs()
|
||||
local mac_base="$(cat /sys/firmware/mikrotik/hard_config/mac_base)"
|
||||
|
||||
case "$board" in
|
||||
mikrotik,routerboard-912uag-2hpnd|\
|
||||
mikrotik,routerboard-921gs-5hpacd-15s|\
|
||||
mikrotik,routerboard-lhg-2nd|\
|
||||
mikrotik,routerboard-sxt-5nd-r2|\
|
||||
|
@ -23,6 +23,7 @@ board=$(board_name)
|
||||
case "$FIRMWARE" in
|
||||
"ath9k-eeprom-ahb-18100000.wmac.bin")
|
||||
case $board in
|
||||
mikrotik,routerboard-912uag-2hpnd|\
|
||||
mikrotik,routerboard-lhg-2nd|\
|
||||
mikrotik,routerboard-sxt-5nd-r2|\
|
||||
mikrotik,routerboard-wapr-2nd)
|
||||
|
@ -32,6 +32,7 @@ platform_do_upgrade() {
|
||||
|
||||
case "$board" in
|
||||
mikrotik,routerboard-493g|\
|
||||
mikrotik,routerboard-912uag-2hpnd|\
|
||||
mikrotik,routerboard-921gs-5hpacd-15s|\
|
||||
mikrotik,routerboard-922uags-5hpacd|\
|
||||
mikrotik,routerboard-sxt-5nd-r2)
|
||||
|
@ -15,6 +15,7 @@ CONFIG_MTD_NAND_AR934X=y
|
||||
CONFIG_MTD_NAND_CORE=y
|
||||
CONFIG_MTD_NAND_ECC=y
|
||||
CONFIG_MTD_NAND_RB4XX=y
|
||||
CONFIG_MTD_NAND_RB91X=y
|
||||
CONFIG_MTD_RAW_NAND=y
|
||||
CONFIG_MTD_ROUTERBOOT_PARTS=y
|
||||
CONFIG_MTD_SPI_NAND=y
|
||||
|
49
target/linux/ath79/patches-5.10/939-mikrotik-rb91x.patch
Normal file
49
target/linux/ath79/patches-5.10/939-mikrotik-rb91x.patch
Normal file
@ -0,0 +1,49 @@
|
||||
--- a/drivers/gpio/Kconfig
|
||||
+++ b/drivers/gpio/Kconfig
|
||||
@@ -341,6 +341,13 @@ config GPIO_IXP4XX
|
||||
IXP4xx series of chips.
|
||||
|
||||
If unsure, say N.
|
||||
+
|
||||
+config GPIO_LATCH
|
||||
+ tristate "MikroTik RouterBOARD GPIO latch support"
|
||||
+ depends on ATH79
|
||||
+ help
|
||||
+ GPIO driver for latch on some MikroTik RouterBOARDs.
|
||||
+
|
||||
config GPIO_LOGICVC
|
||||
tristate "Xylon LogiCVC GPIO support"
|
||||
depends on MFD_SYSCON && OF
|
||||
--- a/drivers/gpio/Makefile
|
||||
+++ b/drivers/gpio/Makefile
|
||||
@@ -72,6 +72,7 @@ obj-$(CONFIG_GPIO_IT87) += gpio-it87.o
|
||||
obj-$(CONFIG_GPIO_IXP4XX) += gpio-ixp4xx.o
|
||||
obj-$(CONFIG_GPIO_JANZ_TTL) += gpio-janz-ttl.o
|
||||
obj-$(CONFIG_GPIO_KEMPLD) += gpio-kempld.o
|
||||
+obj-$(CONFIG_GPIO_LATCH) += gpio-latch.o
|
||||
obj-$(CONFIG_GPIO_LOGICVC) += gpio-logicvc.o
|
||||
obj-$(CONFIG_GPIO_LOONGSON1) += gpio-loongson1.o
|
||||
obj-$(CONFIG_GPIO_LOONGSON) += gpio-loongson.o
|
||||
--- a/drivers/mtd/nand/raw/Kconfig
|
||||
+++ b/drivers/mtd/nand/raw/Kconfig
|
||||
@@ -571,4 +571,10 @@ config MTD_NAND_RB4XX
|
||||
Enables support for the NAND flash chip on Mikrotik Routerboard
|
||||
RB4xx series.
|
||||
|
||||
+config MTD_NAND_RB91X
|
||||
+ tristate "MikroTik RB91x NAND driver support"
|
||||
+ depends on ATH79 && MTD_RAW_NAND
|
||||
+ help
|
||||
+ Enables support for the NAND flash chip on MikroTik RB91x series.
|
||||
+
|
||||
endif # MTD_RAW_NAND
|
||||
--- a/drivers/mtd/nand/raw/Makefile
|
||||
+++ b/drivers/mtd/nand/raw/Makefile
|
||||
@@ -60,6 +60,7 @@ obj-$(CONFIG_MTD_NAND_CADENCE) += caden
|
||||
obj-$(CONFIG_MTD_NAND_ARASAN) += arasan-nand-controller.o
|
||||
obj-$(CONFIG_MTD_NAND_AR934X) += ar934x_nand.o
|
||||
obj-$(CONFIG_MTD_NAND_RB4XX) += nand_rb4xx.o
|
||||
+obj-$(CONFIG_MTD_NAND_RB91X) += rb91x_nand.o
|
||||
|
||||
nand-objs := nand_base.o nand_legacy.o nand_bbt.o nand_timings.o nand_ids.o
|
||||
nand-objs += nand_onfi.o
|
44
target/linux/ath79/patches-5.4/939-mikrotik-rb91x.patch
Normal file
44
target/linux/ath79/patches-5.4/939-mikrotik-rb91x.patch
Normal file
@ -0,0 +1,44 @@
|
||||
--- a/drivers/mtd/nand/raw/Kconfig
|
||||
+++ b/drivers/mtd/nand/raw/Kconfig
|
||||
@@ -559,4 +559,8 @@ config MTD_NAND_RB4XX
|
||||
Enables support for the NAND flash chip on Mikrotik Routerboard
|
||||
RB4xx series.
|
||||
|
||||
+config MTD_NAND_RB91X
|
||||
+ tristate "MikroTik RB91x NAND driver support"
|
||||
+ depends on ATH79 && MTD_RAW_NAND
|
||||
+
|
||||
endif # MTD_RAW_NAND
|
||||
--- a/drivers/mtd/nand/raw/Makefile
|
||||
+++ b/drivers/mtd/nand/raw/Makefile
|
||||
@@ -59,6 +59,7 @@ obj-$(CONFIG_MTD_NAND_STM32_FMC2) += stm
|
||||
obj-$(CONFIG_MTD_NAND_MESON) += meson_nand.o
|
||||
obj-$(CONFIG_MTD_NAND_AR934X) += ar934x_nand.o
|
||||
obj-$(CONFIG_MTD_NAND_RB4XX) += nand_rb4xx.o
|
||||
+obj-$(CONFIG_MTD_NAND_RB91X) += rb91x_nand.o
|
||||
|
||||
nand-objs := nand_base.o nand_legacy.o nand_bbt.o nand_timings.o nand_ids.o
|
||||
nand-objs += nand_onfi.o
|
||||
--- a/drivers/gpio/Kconfig
|
||||
+++ b/drivers/gpio/Kconfig
|
||||
@@ -130,6 +130,10 @@ config GPIO_ATH79
|
||||
Select this option to enable GPIO driver for
|
||||
Atheros AR71XX/AR724X/AR913X SoC devices.
|
||||
|
||||
+config GPIO_LATCH
|
||||
+ tristate "MikroTik RouterBOARD GPIO latch support"
|
||||
+ depends on ATH79
|
||||
+
|
||||
config GPIO_RASPBERRYPI_EXP
|
||||
tristate "Raspberry Pi 3 GPIO Expander"
|
||||
default RASPBERRYPI_FIRMWARE
|
||||
--- a/drivers/gpio/Makefile
|
||||
+++ b/drivers/gpio/Makefile
|
||||
@@ -67,6 +67,7 @@ obj-$(CONFIG_GPIO_IT87) += gpio-it87.o
|
||||
obj-$(CONFIG_GPIO_IXP4XX) += gpio-ixp4xx.o
|
||||
obj-$(CONFIG_GPIO_JANZ_TTL) += gpio-janz-ttl.o
|
||||
obj-$(CONFIG_GPIO_KEMPLD) += gpio-kempld.o
|
||||
+obj-$(CONFIG_GPIO_LATCH) += gpio-latch.o
|
||||
obj-$(CONFIG_GPIO_LOONGSON1) += gpio-loongson1.o
|
||||
obj-$(CONFIG_GPIO_LOONGSON) += gpio-loongson.o
|
||||
obj-$(CONFIG_GPIO_LP3943) += gpio-lp3943.o
|
@ -22,6 +22,7 @@ KERNELNAME:=Image dtbs
|
||||
|
||||
DEFAULT_PACKAGES += \
|
||||
bcm4908img \
|
||||
kmod-gpio-button-hotplug \
|
||||
kmod-usb-ohci kmod-usb2 kmod-usb3
|
||||
|
||||
$(eval $(call BuildTarget))
|
||||
|
@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "mt7621_dlink_dir-8xx-a1.dtsi"
|
||||
#include "mt7621_dlink_dir-8xx.dtsi"
|
||||
#include "mt7621_dlink_flash-16m-a1.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "dlink,dir-867-a1", "mediatek,mt7621-soc";
|
||||
|
@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "mt7621_dlink_dir-8xx-a1.dtsi"
|
||||
#include "mt7621_dlink_dir-8xx.dtsi"
|
||||
#include "mt7621_dlink_flash-16m-a1.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "dlink,dir-878-a1", "mediatek,mt7621-soc";
|
||||
|
@ -1,9 +1,25 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "mt7621_dlink_dir-8xx-a1.dtsi"
|
||||
#include "mt7621_dlink_dir-882-x1.dtsi"
|
||||
#include "mt7621_dlink_dir-8xx.dtsi"
|
||||
#include "mt7621_dlink_flash-16m-a1.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "dlink,dir-882-a1", "mediatek,mt7621-soc";
|
||||
model = "D-Link DIR-882 A1";
|
||||
};
|
||||
|
||||
&leds {
|
||||
usb2 {
|
||||
label = "green:usb2";
|
||||
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
|
||||
trigger-sources = <&ehci_port2>;
|
||||
linux,default-trigger = "usbport";
|
||||
};
|
||||
|
||||
usb3 {
|
||||
label = "green:usb3";
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
|
||||
trigger-sources = <&xhci_ehci_port1>;
|
||||
linux,default-trigger = "usbport";
|
||||
};
|
||||
};
|
||||
|
@ -1,9 +1,25 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "mt7621_dlink_dir-8xx-r1.dtsi"
|
||||
#include "mt7621_dlink_dir-882-x1.dtsi"
|
||||
#include "mt7621_dlink_dir-8xx.dtsi"
|
||||
#include "mt7621_dlink_flash-16m-r1.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "dlink,dir-882-r1", "mediatek,mt7621-soc";
|
||||
model = "D-Link DIR-882 R1";
|
||||
};
|
||||
|
||||
&leds {
|
||||
usb2 {
|
||||
label = "green:usb2";
|
||||
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
|
||||
trigger-sources = <&ehci_port2>;
|
||||
linux,default-trigger = "usbport";
|
||||
};
|
||||
|
||||
usb3 {
|
||||
label = "green:usb3";
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
|
||||
trigger-sources = <&xhci_ehci_port1>;
|
||||
linux,default-trigger = "usbport";
|
||||
};
|
||||
};
|
||||
|
@ -1,17 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
&leds {
|
||||
usb2 {
|
||||
label = "green:usb2";
|
||||
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
|
||||
trigger-sources = <&ehci_port2>;
|
||||
linux,default-trigger = "usbport";
|
||||
};
|
||||
|
||||
usb3 {
|
||||
label = "green:usb3";
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
|
||||
trigger-sources = <&xhci_ehci_port1>;
|
||||
linux,default-trigger = "usbport";
|
||||
};
|
||||
};
|
@ -1,7 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "mt7621_dlink_dir-8xx-x1.dtsi"
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
|
@ -1,7 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "mt7621_dlink_dir-8xx-x1.dtsi"
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
|
@ -300,9 +300,8 @@ define Device/dlink_dir-8xx-r1
|
||||
DEVICE_VENDOR := D-Link
|
||||
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware
|
||||
KERNEL_INITRAMFS := $$(KERNEL)
|
||||
IMAGES += factory.bin
|
||||
IMAGE/sysupgrade.bin := append-kernel | append-rootfs |\
|
||||
pad-rootfs | append-metadata | check-size
|
||||
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \
|
||||
check-size | append-metadata
|
||||
endef
|
||||
|
||||
define Device/dlink_dir-xx60-a1
|
||||
@ -387,9 +386,10 @@ define Device/dlink_dir-882-r1
|
||||
DEVICE_MODEL := DIR-882
|
||||
DEVICE_VARIANT := R1
|
||||
DEVICE_PACKAGES += kmod-usb3 kmod-usb-ledtrig-usbport
|
||||
IMAGES += factory.bin
|
||||
IMAGE/factory.bin := append-kernel | append-rootfs | check-size | \
|
||||
sign-dlink-ru 57c5375741c30ca9ebcb36713db4ba51 \
|
||||
ab0dff19af8842cdb70a86b4b68d23f7
|
||||
sign-dlink-ru 57c5375741c30ca9ebcb36713db4ba51 \
|
||||
ab0dff19af8842cdb70a86b4b68d23f7
|
||||
endef
|
||||
TARGET_DEVICES += dlink_dir-882-r1
|
||||
|
||||
|
@ -8,13 +8,11 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/target.mk
|
||||
|
||||
PKG_NAME:=ccache
|
||||
PKG_VERSION:=4.2.1
|
||||
PKG_VERSION:=4.3
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://github.com/ccache/ccache/releases/download/v$(PKG_VERSION)
|
||||
PKG_HASH:=9d6ba1cdefdc690401f404b747d81a9a1802b17af4235815866b7620d980477e
|
||||
|
||||
HOST_BUILD_PARALLEL:=1
|
||||
PKG_HASH:=504a0f2184465c306826f035b4bc00bae7500308d6af4abbfb50e33a694989b4
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
@ -7,14 +7,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=cmake
|
||||
PKG_VERSION:=3.19.1
|
||||
PKG_VERSION:=3.20.3
|
||||
PKG_RELEASE:=1
|
||||
PKG_CPE_ID:=cpe:/a:kitware:cmake
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/Kitware/CMake/releases/download/v$(PKG_VERSION)/ \
|
||||
https://cmake.org/files/v3.19/
|
||||
PKG_HASH:=1d266ea3a76ef650cdcf16c782a317cb4a7aa461617ee941e389cb48738a3aba
|
||||
PKG_HASH:=4d008ac3461e271fcfac26a05936f77fc7ab64402156fb371d41284851a651b8
|
||||
|
||||
HOST_BUILD_PARALLEL:=1
|
||||
HOST_CONFIGURE_PARALLEL:=1
|
||||
@ -29,7 +29,20 @@ HOST_CONFIGURE_VARS += \
|
||||
|
||||
HOST_CONFIGURE_ARGS := \
|
||||
$(if $(MAKE_JOBSERVER),--parallel="$(MAKE_JOBSERVER)") \
|
||||
--prefix=$(STAGING_DIR_HOST)
|
||||
--prefix="$(STAGING_DIR_HOST)" \
|
||||
--generator=Ninja
|
||||
|
||||
define Host/Compile/Default
|
||||
+$(NINJA) -C $(HOST_BUILD_DIR) $(1)
|
||||
endef
|
||||
|
||||
define Host/Install/Default
|
||||
+$(NINJA) -C $(HOST_BUILD_DIR) install
|
||||
endef
|
||||
|
||||
define Host/Uninstall/Default
|
||||
+$(NINJA) -C $(HOST_BUILD_DIR) uninstall
|
||||
endef
|
||||
|
||||
ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
|
||||
HOST_MAKE_FLAGS += VERBOSE=1
|
||||
|
@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=e2fsprogs
|
||||
PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs
|
||||
PKG_VERSION:=1.45.6
|
||||
PKG_HASH:=ffa7ae6954395abdc50d0f8605d8be84736465afc53b8938ef473fcf7ff44256
|
||||
PKG_VERSION:=1.46.2
|
||||
PKG_HASH:=23aa093295c94e71ef1be490c4004871c5b01d216a8cb4d111fa6c0aac354168
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
@ -23,7 +23,7 @@ include $(INCLUDE_DIR)/host-build.mk
|
||||
ifneq ($(shell $(HOSTCC) --version | grep clang),)
|
||||
HOST_CFLAGS += -D__GNUC_PREREQ\(...\)=0 -Dloff_t=off_t
|
||||
endif
|
||||
HOST_CFLAGS += $(FPIC)
|
||||
HOST_CFLAGS += $(HOST_FPIC)
|
||||
|
||||
HOST_CONFIGURE_ARGS += \
|
||||
--disable-elf-shlibs \
|
||||
|
@ -1097,6 +1097,7 @@ static struct device_info boards[] = {
|
||||
.vendor = "",
|
||||
.support_list =
|
||||
"SupportList:\n"
|
||||
"{product_name:Archer A6,product_ver:3.0.0,special_id:43410000}\n"
|
||||
"{product_name:Archer A6,product_ver:3.0.0,special_id:55530000}\n"
|
||||
"{product_name:Archer A6,product_ver:3.0.0,special_id:54570000}\n",
|
||||
.part_trail = 0x00,
|
||||
|
@ -8,8 +8,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libressl
|
||||
PKG_VERSION:=3.3.1
|
||||
PKG_HASH:=a6d331865e0164a13ac85a228e52517f7cf8f8488f2f95f34e7857302f97cfdb
|
||||
PKG_VERSION:=3.3.3
|
||||
PKG_HASH:=a471565b36ccd1a70d0bd7d37c6e95c43a26a62829b487d9d2cdebfe58be3066
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_CPE_ID:=cpe:/a:openbsd:libressl
|
||||
@ -25,7 +25,7 @@ include $(INCLUDE_DIR)/host-build.mk
|
||||
|
||||
HOSTCC := $(HOSTCC_NOCACHE)
|
||||
HOST_CONFIGURE_ARGS += --enable-static --disable-shared --disable-tests
|
||||
HOST_CFLAGS += $(FPIC)
|
||||
HOST_CFLAGS += $(HOST_FPIC)
|
||||
|
||||
ifeq ($(GNU_HOST_NAME),x86_64-linux-gnux32)
|
||||
HOST_CONFIGURE_ARGS += --disable-asm
|
||||
|
@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=squashfskit4
|
||||
PKG_VERSION:=4.14
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=3
|
||||
PKG_SOURCE:=squashfskit-v$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://github.com/squashfskit/squashfskit/releases/download/v$(PKG_VERSION)/
|
||||
PKG_HASH:=5761aaa3aedc4f7112b708367d891c9abdc1ffea972e3fe47923ddba23984d95
|
||||
|
@ -28,16 +28,14 @@ Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
|
||||
squashfs-tools/mksquashfs.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/squashfs-tools/mksquashfs.h b/squashfs-tools/mksquashfs.h
|
||||
index 1beefef7..b6503063 100644
|
||||
--- a/squashfs-tools/mksquashfs.h
|
||||
+++ b/squashfs-tools/mksquashfs.h
|
||||
@@ -143,7 +143,7 @@ struct append_file {
|
||||
#endif
|
||||
@@ -133,7 +133,7 @@ struct append_file {
|
||||
#define BLOCK_OFFSET 2
|
||||
|
||||
extern struct cache *reader_buffer, *fragment_buffer, *reserve_cache;
|
||||
-struct cache *bwriter_buffer, *fwriter_buffer;
|
||||
+extern struct cache *bwriter_buffer, *fwriter_buffer;
|
||||
extern struct queue *to_reader, *to_deflate, *to_writer, *from_writer,
|
||||
*to_frag, *locked_fragment, *to_process_frag;
|
||||
*locked_fragment, *to_process_frag;
|
||||
extern struct append_file **file_mapping;
|
||||
|
14
tools/squashfskit4/patches/0020-big-endian.patch
Normal file
14
tools/squashfskit4/patches/0020-big-endian.patch
Normal file
@ -0,0 +1,14 @@
|
||||
--- a/squashfs-tools/xz_wrapper.c
|
||||
+++ b/squashfs-tools/xz_wrapper.c
|
||||
@@ -192,7 +192,10 @@ static void xz_display_options(void *buf
|
||||
if(size != sizeof(struct comp_opts))
|
||||
goto failed;
|
||||
|
||||
- SQUASHFS_INSWAP_LZMA_COMP_OPTS(comp_opts);
|
||||
+#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
+ comp_opts->dictionary_size = inswap_le32(comp_opts->dictionary_size);
|
||||
+ comp_opts->flags = inswap_le32(comp_opts->flags);
|
||||
+#endif
|
||||
|
||||
dictionary_size = comp_opts->dictionary_size;
|
||||
flags = comp_opts->flags;
|
@ -12,7 +12,6 @@ PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_CPE_ID:=cpe:/a:facebook:zstandard
|
||||
|
||||
CMAKE_SOURCE_SUBDIR:=build/cmake
|
||||
HOST_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
Loading…
x
Reference in New Issue
Block a user