Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
commit
35bf918edf
|
@ -58,8 +58,14 @@ linksys,wrt3200acm|\
|
|||
linksys,wrt32x)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
|
||||
;;
|
||||
methode,udpu)
|
||||
methode,udpu|\
|
||||
methode,edpu)
|
||||
idx="$(find_mtd_index u-boot-env)"
|
||||
if [ -n "$idx" ]; then
|
||||
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" "1"
|
||||
else
|
||||
ubootenv_add_uci_config "/dev/mtd0" "0x180000" "0x10000" "0x10000"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
|
@ -260,7 +260,8 @@ define KernelPackage/ath10k
|
|||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_pci.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ath10k_pci)
|
||||
AUTOLOAD:=$(call AutoProbe,ath10k_core ath10k_pci)
|
||||
MODPARAMS.ath10k_core:=frame_mode=2
|
||||
VARIANT:=regular
|
||||
endef
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@ drv_mac80211_init_device_config() {
|
|||
config_add_string tx_burst
|
||||
config_add_string distance
|
||||
config_add_int beacon_int chanbw frag rts
|
||||
config_add_int rxantenna txantenna antenna_gain txpower
|
||||
config_add_boolean noscan ht_coex acs_exclude_dfs
|
||||
config_add_int rxantenna txantenna antenna_gain txpower min_tx_power
|
||||
config_add_boolean noscan ht_coex acs_exclude_dfs background_radar
|
||||
config_add_array ht_capab
|
||||
config_add_array channels
|
||||
config_add_array scan_list
|
||||
|
@ -137,13 +137,15 @@ mac80211_hostapd_setup_base() {
|
|||
[ -n "$acs_exclude_dfs" ] && [ "$acs_exclude_dfs" -gt 0 ] &&
|
||||
append base_cfg "acs_exclude_dfs=1" "$N"
|
||||
|
||||
json_get_vars noscan ht_coex vendor_vht
|
||||
json_get_vars noscan ht_coex min_tx_power:0 vendor_vht
|
||||
json_get_values ht_capab_list ht_capab tx_burst
|
||||
json_get_values channel_list channels
|
||||
|
||||
[ "$auto_channel" = 0 ] && [ -z "$channel_list" ] && \
|
||||
channel_list="$channel"
|
||||
|
||||
[ "$min_tx_power" -gt 0 ] && append base_cfg "min_tx_power=$min_tx_power"
|
||||
|
||||
set_default noscan 0
|
||||
|
||||
[ "$noscan" -gt 0 ] && hostapd_noscan=1
|
||||
|
@ -273,6 +275,11 @@ mac80211_hostapd_setup_base() {
|
|||
vht_center_seg0=$idx
|
||||
;;
|
||||
esac
|
||||
[ "$band" = "5g" ] && {
|
||||
json_get_vars background_radar:0
|
||||
|
||||
[ "$background_radar" -eq 1 ] && append base_cfg "enable_background_radar=1" "$N"
|
||||
}
|
||||
[ "$band" = "6g" ] && {
|
||||
op_class=
|
||||
case "$htmode" in
|
||||
|
|
|
@ -78,6 +78,7 @@ config DRIVER_11AC_SUPPORT
|
|||
config DRIVER_11AX_SUPPORT
|
||||
bool
|
||||
default n
|
||||
select WPA_MBO_SUPPORT
|
||||
|
||||
config WPA_ENABLE_WEP
|
||||
bool "Enable support for unsecure and obsolete WEP"
|
||||
|
@ -87,3 +88,17 @@ config WPA_ENABLE_WEP
|
|||
for anything anymore. The functionality needed to use WEP is available in the
|
||||
current hostapd release under this optional build parameter and completely
|
||||
removed in a future release.
|
||||
|
||||
config WPA_MBO_SUPPORT
|
||||
bool "Multi Band Operation (Agile Multiband)"
|
||||
default PACKAGE_wpa-supplicant || \
|
||||
PACKAGE_wpa-supplicant-openssl || \
|
||||
PACKAGE_wpa-supplicant-wolfssl || \
|
||||
PACKAGE_wpad || \
|
||||
PACKAGE_wpad-openssl || \
|
||||
PACKAGE_wpad-wolfssl
|
||||
help
|
||||
Multi Band Operation aka (Agile Multiband) enables features
|
||||
that facilitate efficient use of multiple frequency bands.
|
||||
Enabling MBO on an AP using RSN requires 802.11w to be enabled.
|
||||
Hostapd will refuse to start if MBO and RSN are enabled without 11w.
|
||||
|
|
|
@ -91,6 +91,7 @@ DRIVER_MAKEOPTS= \
|
|||
CONFIG_IEEE80211AC=$(HOSTAPD_IEEE80211AC) \
|
||||
CONFIG_IEEE80211AX=$(HOSTAPD_IEEE80211AX) \
|
||||
CONFIG_DRIVER_WEXT=$(CONFIG_DRIVER_WEXT_SUPPORT) \
|
||||
CONFIG_MBO=$(CONFIG_WPA_MBO_SUPPORT)
|
||||
|
||||
ifeq ($(SSL_VARIANT),openssl)
|
||||
DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_SAE=y
|
||||
|
|
|
@ -29,6 +29,9 @@ Initiate an 802.11v transition request.
|
|||
| neighbors | array | no | BSS Transition Candidate List |
|
||||
| abridged | bool | no | prefer APs in the BSS Transition Candidate List |
|
||||
| dialog_token | int32 | no | identifier for the request/report transaction |
|
||||
| mbo_reason | int32 | no | MBO Transition Reason Code Attribute |
|
||||
| cell_pref | int32 | no | MBO Cellular Data Connection Preference Attribute |
|
||||
| reassoc_delay | int32 | no | MBO Re-association retry delay |
|
||||
|
||||
### example
|
||||
`ubus call hostapd.wl5-fb bss_transition_request '{ "addr": "68:2F:67:8B:98:ED", "disassociation_imminent": false, "disassociation_timer": 0, "validity_period": 30, "neighbors": ["b6a7b9cbeebabf5900008064090603026a00"], "abridged": 1 }'`
|
||||
|
|
|
@ -307,7 +307,7 @@ hostapd_common_add_bss_config() {
|
|||
config_add_string wps_device_type wps_device_name wps_manufacturer wps_pin
|
||||
config_add_string multi_ap_backhaul_ssid multi_ap_backhaul_key
|
||||
|
||||
config_add_boolean wnm_sleep_mode wnm_sleep_mode_no_keys bss_transition
|
||||
config_add_boolean wnm_sleep_mode wnm_sleep_mode_no_keys bss_transition mbo
|
||||
config_add_int time_advertisement
|
||||
config_add_string time_zone
|
||||
config_add_string vendor_elements
|
||||
|
@ -828,10 +828,11 @@ hostapd_set_bss_options() {
|
|||
append bss_conf "iapp_interface=$ifname" "$N"
|
||||
}
|
||||
|
||||
json_get_vars time_advertisement time_zone wnm_sleep_mode wnm_sleep_mode_no_keys bss_transition
|
||||
json_get_vars time_advertisement time_zone wnm_sleep_mode wnm_sleep_mode_no_keys bss_transition mbo
|
||||
set_default bss_transition 0
|
||||
set_default wnm_sleep_mode 0
|
||||
set_default wnm_sleep_mode_no_keys 0
|
||||
set_default mbo 0
|
||||
|
||||
[ -n "$time_advertisement" ] && append bss_conf "time_advertisement=$time_advertisement" "$N"
|
||||
[ -n "$time_zone" ] && append bss_conf "time_zone=$time_zone" "$N"
|
||||
|
@ -840,6 +841,7 @@ hostapd_set_bss_options() {
|
|||
[ "$wnm_sleep_mode_no_keys" -eq "1" ] && append bss_conf "wnm_sleep_mode_no_keys=1" "$N"
|
||||
fi
|
||||
[ "$bss_transition" -eq "1" ] && append bss_conf "bss_transition=1" "$N"
|
||||
[ "$mbo" -eq 1 ] && append bss_conf "mbo=1" "$N"
|
||||
|
||||
json_get_vars ieee80211k rrm_neighbor_report rrm_beacon_report
|
||||
set_default ieee80211k 0
|
||||
|
|
|
@ -1454,7 +1454,7 @@ void hostapd_ubus_handle_link_measurement(struct hostapd_data *hapd, const u8 *d
|
|||
static int
|
||||
hostapd_bss_tr_send(struct hostapd_data *hapd, u8 *addr, bool disassoc_imminent, bool abridged,
|
||||
u16 disassoc_timer, u8 validity_period, u8 dialog_token,
|
||||
struct blob_attr *neighbors)
|
||||
struct blob_attr *neighbors, u8 mbo_reason, u8 cell_pref, u8 reassoc_delay)
|
||||
{
|
||||
struct blob_attr *cur;
|
||||
struct sta_info *sta;
|
||||
|
@ -1462,6 +1462,8 @@ hostapd_bss_tr_send(struct hostapd_data *hapd, u8 *addr, bool disassoc_imminent,
|
|||
int rem;
|
||||
u8 *nr = NULL;
|
||||
u8 req_mode = 0;
|
||||
u8 mbo[10];
|
||||
size_t mbo_len = 0;
|
||||
|
||||
sta = ap_get_sta(hapd, addr);
|
||||
if (!sta)
|
||||
|
@ -1513,8 +1515,37 @@ hostapd_bss_tr_send(struct hostapd_data *hapd, u8 *addr, bool disassoc_imminent,
|
|||
if (disassoc_imminent)
|
||||
req_mode |= WNM_BSS_TM_REQ_DISASSOC_IMMINENT;
|
||||
|
||||
#ifdef CONFIG_MBO
|
||||
u8 *mbo_pos = mbo;
|
||||
|
||||
if (mbo_reason > MBO_TRANSITION_REASON_PREMIUM_AP)
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
if (cell_pref != 0 && cell_pref != 1 && cell_pref != 255)
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
if (reassoc_delay > 65535 || (reassoc_delay && !disassoc_imminent))
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
*mbo_pos++ = MBO_ATTR_ID_TRANSITION_REASON;
|
||||
*mbo_pos++ = 1;
|
||||
*mbo_pos++ = mbo_reason;
|
||||
*mbo_pos++ = MBO_ATTR_ID_CELL_DATA_PREF;
|
||||
*mbo_pos++ = 1;
|
||||
*mbo_pos++ = cell_pref;
|
||||
|
||||
if (reassoc_delay) {
|
||||
*mbo_pos++ = MBO_ATTR_ID_ASSOC_RETRY_DELAY;
|
||||
*mbo_pos++ = 2;
|
||||
WPA_PUT_LE16(mbo_pos, reassoc_delay);
|
||||
mbo_pos += 2;
|
||||
}
|
||||
|
||||
mbo_len = mbo_pos - mbo;
|
||||
#endif
|
||||
|
||||
if (wnm_send_bss_tm_req(hapd, sta, req_mode, disassoc_timer, validity_period, NULL,
|
||||
dialog_token, NULL, nr, nr_len, NULL, 0))
|
||||
dialog_token, NULL, nr, nr_len, mbo_len ? mbo : NULL, mbo_len))
|
||||
return UBUS_STATUS_UNKNOWN_ERROR;
|
||||
|
||||
return 0;
|
||||
|
@ -1528,6 +1559,11 @@ enum {
|
|||
BSS_TR_NEIGHBORS,
|
||||
BSS_TR_ABRIDGED,
|
||||
BSS_TR_DIALOG_TOKEN,
|
||||
#ifdef CONFIG_MBO
|
||||
BSS_TR_MBO_REASON,
|
||||
BSS_TR_CELL_PREF,
|
||||
BSS_TR_REASSOC_DELAY,
|
||||
#endif
|
||||
__BSS_TR_DISASSOC_MAX
|
||||
};
|
||||
|
||||
|
@ -1539,6 +1575,11 @@ static const struct blobmsg_policy bss_tr_policy[__BSS_TR_DISASSOC_MAX] = {
|
|||
[BSS_TR_NEIGHBORS] = { "neighbors", BLOBMSG_TYPE_ARRAY },
|
||||
[BSS_TR_ABRIDGED] = { "abridged", BLOBMSG_TYPE_BOOL },
|
||||
[BSS_TR_DIALOG_TOKEN] = { "dialog_token", BLOBMSG_TYPE_INT32 },
|
||||
#ifdef CONFIG_MBO
|
||||
[BSS_TR_MBO_REASON] = { "mbo_reason", BLOBMSG_TYPE_INT32 },
|
||||
[BSS_TR_CELL_PREF] = { "cell_pref", BLOBMSG_TYPE_INT32 },
|
||||
[BSS_TR_REASSOC_DELAY] = { "reassoc_delay", BLOBMSG_TYPE_INT32 },
|
||||
#endif
|
||||
};
|
||||
|
||||
static int
|
||||
|
@ -1555,6 +1596,9 @@ hostapd_bss_transition_request(struct ubus_context *ctx, struct ubus_object *obj
|
|||
u32 dialog_token = 1;
|
||||
bool abridged;
|
||||
bool da_imminent;
|
||||
u8 mbo_reason;
|
||||
u8 cell_pref;
|
||||
u8 reassoc_delay;
|
||||
|
||||
blobmsg_parse(bss_tr_policy, __BSS_TR_DISASSOC_MAX, tb, blob_data(msg), blob_len(msg));
|
||||
|
||||
|
@ -1576,8 +1620,19 @@ hostapd_bss_transition_request(struct ubus_context *ctx, struct ubus_object *obj
|
|||
da_imminent = !!(tb[BSS_TR_DA_IMMINENT] && blobmsg_get_bool(tb[BSS_TR_DA_IMMINENT]));
|
||||
abridged = !!(tb[BSS_TR_ABRIDGED] && blobmsg_get_bool(tb[BSS_TR_ABRIDGED]));
|
||||
|
||||
#ifdef CONFIG_MBO
|
||||
if (tb[BSS_TR_MBO_REASON])
|
||||
mbo_reason = blobmsg_get_u32(tb[BSS_TR_MBO_REASON]);
|
||||
|
||||
if (tb[BSS_TR_CELL_PREF])
|
||||
cell_pref = blobmsg_get_u32(tb[BSS_TR_CELL_PREF]);
|
||||
|
||||
if (tb[BSS_TR_REASSOC_DELAY])
|
||||
reassoc_delay = blobmsg_get_u32(tb[BSS_TR_REASSOC_DELAY]);
|
||||
#endif
|
||||
|
||||
return hostapd_bss_tr_send(hapd, addr, da_imminent, abridged, da_timer, valid_period,
|
||||
dialog_token, tb[BSS_TR_NEIGHBORS]);
|
||||
dialog_token, tb[BSS_TR_NEIGHBORS], mbo_reason, cell_pref, reassoc_delay);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
|||
|
||||
PKG_NAME:=iptables
|
||||
PKG_VERSION:=1.8.7
|
||||
PKG_RELEASE:=6
|
||||
PKG_RELEASE:=7
|
||||
|
||||
PKG_SOURCE_URL:=https://netfilter.org/projects/iptables/files
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
|
@ -50,18 +50,18 @@ $(call Package/iptables/Default)
|
|||
DEPENDS+= +kmod-ipt-core +libip4tc +IPV6:libip6tc +libiptext +IPV6:libiptext6 +libxtables
|
||||
endef
|
||||
|
||||
define Package/iptables-legacy
|
||||
define Package/iptables-zz-legacy
|
||||
$(call Package/iptables/Default)
|
||||
TITLE:=IP firewall administration tool
|
||||
DEPENDS+= +xtables-legacy
|
||||
PROVIDES:=iptables
|
||||
PROVIDES:=iptables iptables-legacy
|
||||
ALTERNATIVES:=\
|
||||
200:/usr/sbin/iptables:/usr/sbin/xtables-legacy-multi \
|
||||
200:/usr/sbin/iptables-restore:/usr/sbin/xtables-legacy-multi \
|
||||
200:/usr/sbin/iptables-save:/usr/sbin/xtables-legacy-multi
|
||||
endef
|
||||
|
||||
define Package/iptables-legacy/description
|
||||
define Package/iptables-zz-legacy/description
|
||||
IP firewall administration tool.
|
||||
|
||||
Matches:
|
||||
|
@ -104,7 +104,7 @@ endef
|
|||
define Package/xtables-nft
|
||||
$(call Package/iptables/Default)
|
||||
TITLE:=IP firewall administration tool nft
|
||||
DEPENDS:=@IPTABLES_NFTABLES +libnftnl +libiptext +IPV6:libiptext6 +libiptext-nft +kmod-nft-compat
|
||||
DEPENDS:=+libnftnl +libiptext +IPV6:libiptext6 +libiptext-nft +kmod-nft-compat
|
||||
endef
|
||||
|
||||
define Package/arptables-nft
|
||||
|
@ -483,12 +483,12 @@ define Package/iptables-mod-checksum/description
|
|||
iptables extension for the CHECKSUM calculation target
|
||||
endef
|
||||
|
||||
define Package/ip6tables-legacy
|
||||
define Package/ip6tables-zz-legacy
|
||||
$(call Package/iptables/Default)
|
||||
DEPENDS:=@IPV6 +kmod-ip6tables +xtables-legacy
|
||||
CATEGORY:=Network
|
||||
TITLE:=IPv6 firewall administration tool
|
||||
PROVIDES:=ip6tables
|
||||
PROVIDES:=ip6tables ip6tables-legacy
|
||||
ALTERNATIVES:=\
|
||||
200:/usr/sbin/ip6tables:/usr/sbin/xtables-legacy-multi \
|
||||
200:/usr/sbin/ip6tables-restore:/usr/sbin/xtables-legacy-multi \
|
||||
|
@ -575,7 +575,7 @@ define Package/libiptext-nft
|
|||
CATEGORY:=Libraries
|
||||
TITLE:=IPv4/IPv6 firewall - shared libiptext nft library
|
||||
ABI_VERSION:=0
|
||||
DEPENDS:=@IPTABLES_NFTABLES +libxtables
|
||||
DEPENDS:=+libxtables
|
||||
endef
|
||||
|
||||
define Package/libxtables
|
||||
|
@ -594,12 +594,6 @@ define Package/libxtables/config
|
|||
default n
|
||||
help
|
||||
This enable connlabel support in iptables.
|
||||
|
||||
config IPTABLES_NFTABLES
|
||||
bool "Enable Nftables support"
|
||||
default y
|
||||
help
|
||||
This enable nftables support in iptables.
|
||||
endef
|
||||
|
||||
TARGET_CPPFLAGS := \
|
||||
|
@ -624,7 +618,6 @@ CONFIGURE_ARGS += \
|
|||
--with-xtlibdir=/usr/lib/iptables \
|
||||
--with-xt-lock-name=/var/run/xtables.lock \
|
||||
$(if $(CONFIG_IPTABLES_CONNLABEL),,--disable-connlabel) \
|
||||
$(if $(CONFIG_IPTABLES_NFTABLES),,--disable-nftables) \
|
||||
$(if $(CONFIG_IPV6),,--disable-ipv6)
|
||||
|
||||
MAKE_FLAGS := \
|
||||
|
@ -677,7 +670,7 @@ define Package/xtables-legacy/install
|
|||
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/xtables-legacy-multi $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/iptables-legacy/install
|
||||
define Package/iptables-zz-legacy/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/iptables-legacy{,-restore,-save} $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/iptables
|
||||
|
@ -708,7 +701,7 @@ define Package/iptables-nft/install
|
|||
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/iptables{,-restore}-translate $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/ip6tables-legacy/install
|
||||
define Package/ip6tables-zz-legacy/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/ip6tables-legacy{,-restore,-save} $(1)/usr/sbin/
|
||||
endef
|
||||
|
@ -771,7 +764,7 @@ $(eval $(call BuildPackage,libiptext))
|
|||
$(eval $(call BuildPackage,libiptext6))
|
||||
$(eval $(call BuildPackage,libiptext-nft))
|
||||
$(eval $(call BuildPackage,xtables-legacy))
|
||||
$(eval $(call BuildPackage,iptables-legacy))
|
||||
$(eval $(call BuildPackage,iptables-zz-legacy))
|
||||
$(eval $(call BuildPackage,xtables-nft))
|
||||
$(eval $(call BuildPackage,arptables-nft))
|
||||
$(eval $(call BuildPackage,ebtables-nft))
|
||||
|
@ -799,7 +792,7 @@ $(eval $(call BuildPlugin,iptables-mod-nflog,$(IPT_NFLOG-m)))
|
|||
$(eval $(call BuildPlugin,iptables-mod-trace,$(IPT_DEBUG-m)))
|
||||
$(eval $(call BuildPlugin,iptables-mod-nfqueue,$(IPT_NFQUEUE-m)))
|
||||
$(eval $(call BuildPlugin,iptables-mod-checksum,$(IPT_CHECKSUM-m)))
|
||||
$(eval $(call BuildPackage,ip6tables-legacy))
|
||||
$(eval $(call BuildPackage,ip6tables-zz-legacy))
|
||||
$(eval $(call BuildPackage,ip6tables-nft))
|
||||
$(eval $(call BuildPlugin,ip6tables-extra,$(IPT_IPV6_EXTRA-m)))
|
||||
$(eval $(call BuildPlugin,ip6tables-mod-nat,$(IPT_NAT6-m)))
|
||||
|
|
86
scripts/cameo-imghdr.py
Executable file
86
scripts/cameo-imghdr.py
Executable file
|
@ -0,0 +1,86 @@
|
|||
#!/usr/bin/python3
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#
|
||||
# Copyright (C) 2022 Luiz Angelo Daros de Luca <luizluca@gmail.com>
|
||||
#
|
||||
# Cameo Image header geneator, used by some D-Link DGS-1210 switches
|
||||
# and APRESIA ApresiaLightGS series
|
||||
#
|
||||
import argparse
|
||||
import pathlib
|
||||
import socket
|
||||
import struct
|
||||
|
||||
MODEL_LEN = 20
|
||||
SIGNATURE_LEN = 16
|
||||
LINUXLOAD_LEN = 10
|
||||
BUFSIZE = 4096
|
||||
|
||||
parser = argparse.ArgumentParser(description='Generate Cameo firmware header.')
|
||||
parser.add_argument('source_file', type=argparse.FileType('rb'))
|
||||
parser.add_argument('dest_file', type=argparse.FileType('wb'))
|
||||
parser.add_argument('model')
|
||||
parser.add_argument('signature')
|
||||
parser.add_argument('partition', type=int, choices=range(0,10),
|
||||
metavar="partition=[0-9]",help="partition id")
|
||||
parser.add_argument('customer_signature', type=int, choices=range(0,10),
|
||||
metavar="customer_signature=[0-9]",
|
||||
help="customer signature")
|
||||
parser.add_argument('board_version', type=int, choices=range(0,2**32),
|
||||
metavar="board_version=[0-4294967295]",
|
||||
help="board version")
|
||||
parser.add_argument('linux_loadaddr', nargs='?',
|
||||
help="Kernel start address in 0xFFFFFFFF format")
|
||||
args = parser.parse_args()
|
||||
|
||||
if len(args.model) > MODEL_LEN:
|
||||
raise ValueError(f"Model '{args.model}' is greater than {MODEL_LEN} bytes")
|
||||
|
||||
if len(args.signature) > SIGNATURE_LEN:
|
||||
raise ValueError(f"Signature '{args.signature}' is greater than"
|
||||
f"{SIGNATURE_LEN} bytes")
|
||||
|
||||
if args.signature == "os":
|
||||
if args.linux_loadaddr:
|
||||
if len(args.linux_loadaddr) > LINUXLOAD_LEN:
|
||||
raise ValueError(f"linux_loadaddr '{args.linux_loadaddr}' is greater"
|
||||
f"than {LINUXLOAD_LEN} bytes")
|
||||
if (args.linux_loadaddr[0:2] != "0x"):
|
||||
raise ValueError(f"linux_loadaddr '{args.linux_loadaddr}' must use"
|
||||
f"the 0x789ABCDE format")
|
||||
int(args.linux_loadaddr[2:],16)
|
||||
else:
|
||||
raise ValueError(f"linux_loadaddr is required for signature 'os'")
|
||||
else:
|
||||
args.linux_loadaddr = ""
|
||||
|
||||
checksum = 0
|
||||
size = 0
|
||||
while True:
|
||||
buf = args.source_file.read(BUFSIZE)
|
||||
if not buf:
|
||||
break
|
||||
checksum = sum(iter(buf),checksum) % (1<<32)
|
||||
size += len(buf)
|
||||
|
||||
args.dest_file.write(struct.pack('!I', checksum))
|
||||
args.dest_file.write(struct.pack(f'{MODEL_LEN}s',
|
||||
args.model.encode("ascii")))
|
||||
args.dest_file.write(struct.pack(f'{SIGNATURE_LEN}s',
|
||||
args.signature.encode("ascii")))
|
||||
args.dest_file.write(struct.pack('!B', args.partition))
|
||||
args.dest_file.write(struct.pack('!B', 0x40)) # ??? This header size?
|
||||
args.dest_file.write(struct.pack('!B', 0x00)) # ??? Encrypted?
|
||||
args.dest_file.write(struct.pack('!B', args.customer_signature))
|
||||
args.dest_file.write(struct.pack('!I', args.board_version))
|
||||
args.dest_file.write(struct.pack('!I', size))
|
||||
args.dest_file.write(struct.pack(f'{LINUXLOAD_LEN}s',
|
||||
args.linux_loadaddr.encode("ascii")))
|
||||
args.dest_file.write(struct.pack('!2x'))
|
||||
|
||||
args.source_file.seek(0)
|
||||
while True:
|
||||
buf = args.source_file.read(BUFSIZE)
|
||||
if not buf:
|
||||
break
|
||||
args.dest_file.write(buf)
|
|
@ -18,7 +18,6 @@
|
|||
partition@0 {
|
||||
label = "RouterBoot";
|
||||
reg = <0x0 0x20000>;
|
||||
read-only;
|
||||
compatible = "mikrotik,routerboot-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
|
113
target/linux/ath79/dts/qca9533_mikrotik_routerboard-map-2nd.dts
Normal file
113
target/linux/ath79/dts/qca9533_mikrotik_routerboard-map-2nd.dts
Normal file
|
@ -0,0 +1,113 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "qca9533_mikrotik_routerboard-16m.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "mikrotik,routerboard-map-2nd", "qca,qca9533";
|
||||
model = "MikroTik RouterBOARD mAP-2nD (mAP)";
|
||||
|
||||
aliases {
|
||||
led-boot = &led_user;
|
||||
led-failsafe = &led_user;
|
||||
led-running = &led_user;
|
||||
led-upgrade = &led_user;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
power {
|
||||
label = "green:power";
|
||||
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
|
||||
default-state = "on";
|
||||
};
|
||||
|
||||
eth_1 {
|
||||
label = "green:eth_1";
|
||||
gpios = <&gpio_ext 0 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
eth_2 {
|
||||
label = "green:eth_2";
|
||||
gpios = <&gpio_ext 1 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
poe_out {
|
||||
label = "red:poe_out";
|
||||
gpios = <&gpio_ext 2 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_user: user {
|
||||
label = "green:user";
|
||||
gpios = <&gpio_ext 3 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
wlan {
|
||||
label = "green:wlan";
|
||||
gpios = <&gpio_ext 4 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
|
||||
ap_cap {
|
||||
label = "green:ap_cap";
|
||||
gpios = <&gpio_ext 6 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
gpio-export {
|
||||
compatible = "gpio-export";
|
||||
|
||||
usb_power {
|
||||
gpio-export,name = "usb-power";
|
||||
gpio-export,output = <1>;
|
||||
gpios = <&gpio_ext 5 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
enable_poe_port5 {
|
||||
gpio-export,name = "enable-poe";
|
||||
gpio-export,output = <0>;
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pin_spi_cs1>;
|
||||
|
||||
gpio_ext: gpio_ext@1 {
|
||||
compatible = "fairchild,74hc595";
|
||||
reg = <1>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
registers-number = <1>;
|
||||
spi-max-frequency = <25000000>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
&pinmux {
|
||||
pin_spi_cs1: pinmux_spi_cs1 {
|
||||
pinctrl-single,bits = <0x8 0x0a000000 0xff000000>;
|
||||
};
|
||||
};
|
||||
|
||||
ð0 {
|
||||
status = "okay";
|
||||
|
||||
phy-handle = <&swphy0>;
|
||||
|
||||
gmac-config {
|
||||
device = <&gmac>;
|
||||
switch-phy-swap = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
&usb0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_phy {
|
||||
status = "okay";
|
||||
};
|
|
@ -88,7 +88,6 @@
|
|||
partition@0 {
|
||||
label = "RouterBoot";
|
||||
reg = <0x0 0x20000>;
|
||||
read-only;
|
||||
compatible = "mikrotik,routerboot-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
|
59
target/linux/ath79/dts/qca9563_tplink_eap225-v4.dts
Normal file
59
target/linux/ath79/dts/qca9563_tplink_eap225-v4.dts
Normal file
|
@ -0,0 +1,59 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "qca9563_tplink_eap2x5-1port.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "tplink,eap225-v4", "qca,qca9563";
|
||||
model = "TP-Link EAP225 v4";
|
||||
|
||||
aliases {
|
||||
led-boot = &led_status_green;
|
||||
led-failsafe = &led_status_amber;
|
||||
led-running = &led_status_green;
|
||||
led-upgrade = &led_status_amber;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led_status_green: status_green {
|
||||
label = "green:status";
|
||||
gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
|
||||
default-state = "on";
|
||||
};
|
||||
|
||||
led_status_amber: status_amber {
|
||||
label = "amber:status";
|
||||
gpios = <&gpio 9 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&art {
|
||||
precalibration_ath10k: pre-calibration@5000 {
|
||||
reg = <0x5000 0x2f20>;
|
||||
};
|
||||
};
|
||||
|
||||
ð0 {
|
||||
phy-handle = <&phy6>;
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
&mdio0 {
|
||||
phy6: ethernet-phy@6 {
|
||||
reg = <6>;
|
||||
};
|
||||
};
|
||||
|
||||
&pcie {
|
||||
wifi@0,0 {
|
||||
compatible = "qcom,ath10k";
|
||||
reg = <0 0 0 0 0>;
|
||||
|
||||
mac-address-increment = <1>;
|
||||
|
||||
nvmem-cells = <&macaddr_info_8>, <&precalibration_ath10k>;
|
||||
nvmem-cell-names = "mac-address", "pre-calibration";
|
||||
};
|
||||
};
|
|
@ -79,6 +79,7 @@ ath79_setup_interfaces()
|
|||
tplink,eap225-outdoor-v3|\
|
||||
tplink,eap225-v1|\
|
||||
tplink,eap225-v3|\
|
||||
tplink,eap225-v4|\
|
||||
tplink,eap245-v1|\
|
||||
tplink,re350k-v1|\
|
||||
tplink,re355-v1|\
|
||||
|
|
|
@ -434,6 +434,17 @@ define Device/tplink_eap225-v3
|
|||
endef
|
||||
TARGET_DEVICES += tplink_eap225-v3
|
||||
|
||||
define Device/tplink_eap225-v4
|
||||
$(Device/tplink-eap2x5)
|
||||
SOC := qca9563
|
||||
IMAGE_SIZE := 13824k
|
||||
DEVICE_MODEL := EAP225
|
||||
DEVICE_VARIANT := v4
|
||||
DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct
|
||||
TPLINK_BOARD_ID := EAP225-V3
|
||||
endef
|
||||
TARGET_DEVICES += tplink_eap225-v4
|
||||
|
||||
define Device/tplink_eap225-wall-v2
|
||||
$(Device/tplink-eap2x5)
|
||||
SOC := qca9561
|
||||
|
|
|
@ -85,6 +85,15 @@ define Device/mikrotik_routerboard-lhg-5nd
|
|||
endef
|
||||
TARGET_DEVICES += mikrotik_routerboard-lhg-5nd
|
||||
|
||||
define Device/mikrotik_routerboard-map-2nd
|
||||
$(Device/mikrotik_nor)
|
||||
SOC := qca9533
|
||||
DEVICE_MODEL := RouterBOARD mAP-2nD (mAP)
|
||||
DEVICE_PACKAGES += kmod-usb2 kmod-ledtrig-gpio
|
||||
IMAGE_SIZE := 16256k
|
||||
endef
|
||||
TARGET_DEVICES += mikrotik_routerboard-map-2nd
|
||||
|
||||
define Device/mikrotik_routerboard-mapl-2nd
|
||||
$(Device/mikrotik_nor)
|
||||
SOC := qca9533
|
||||
|
|
|
@ -28,6 +28,11 @@ mikrotik,routerboard-lhg-5nd)
|
|||
ucidef_set_led_rssi "rssimediumhigh" "rssimediumhigh" "green:rssimediumhigh" "wlan0" "60" "100"
|
||||
ucidef_set_led_rssi "rssihigh" "rssihigh" "green:rssihigh" "wlan0" "80" "100"
|
||||
;;
|
||||
mikrotik,routerboard-map-2nd)
|
||||
ucidef_set_led_netdev "eth_1" "eth_1" "green:eth_1" "eth1"
|
||||
ucidef_set_led_switch "eth_2" "eth_2" "green:eth_2" "switch0" "0x4"
|
||||
ucidef_set_led_gpio "poe" "poe" "red:poe_out" "14" "0"
|
||||
;;
|
||||
mikrotik,routerboard-wapr-2nd)
|
||||
ucidef_set_rssimon "wlan0" "200000" "1"
|
||||
ucidef_set_led_rssi "rssilow" "rssilow" "green:rssilow" "wlan0" "1" "100"
|
||||
|
|
|
@ -30,6 +30,9 @@ ath79_setup_interfaces()
|
|||
ucidef_add_switch "switch0" \
|
||||
"0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
|
||||
;;
|
||||
mikrotik,routerboard-map-2nd)
|
||||
ucidef_set_interface_lan "eth0 eth1"
|
||||
;;
|
||||
mikrotik,routerboard-962uigs-5hact2hnt)
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
|
||||
|
@ -52,6 +55,7 @@ ath79_setup_macs()
|
|||
mikrotik,routerboard-912uag-2hpnd|\
|
||||
mikrotik,routerboard-lhg-2nd|\
|
||||
mikrotik,routerboard-lhg-5nd|\
|
||||
mikrotik,routerboard-map-2nd|\
|
||||
mikrotik,routerboard-mapl-2nd|\
|
||||
mikrotik,routerboard-sxt-5nd-r2|\
|
||||
mikrotik,routerboard-wap-2nd|\
|
||||
|
|
|
@ -31,6 +31,9 @@ case "$FIRMWARE" in
|
|||
mikrotik,routerboard-wapr-2nd)
|
||||
caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" 1)
|
||||
;;
|
||||
mikrotik,routerboard-map-2nd)
|
||||
caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" 3)
|
||||
;;
|
||||
mikrotik,routerboard-mapl-2nd|\
|
||||
mikrotik,routerboard-wap-g-5hact2hnd)
|
||||
caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" 2)
|
||||
|
|
|
@ -0,0 +1,119 @@
|
|||
From 0a4355c2b7f8ecd5e61cc262ecdbd4a2cce1ea7e Mon Sep 17 00:00:00 2001
|
||||
From: Joakim Zhang <qiangqing.zhang@nxp.com>
|
||||
Date: Tue, 8 Jun 2021 11:15:33 +0800
|
||||
Subject: [PATCH] net: phy: realtek: add dt property to disable CLKOUT clock
|
||||
|
||||
CLKOUT is enabled by default after PHY hardware reset, this patch adds
|
||||
"realtek,clkout-disable" property for user to disable CLKOUT clock
|
||||
to save PHY power.
|
||||
|
||||
Per RTL8211F guide, a PHY reset should be issued after setting these
|
||||
bits in PHYCR2 register. After this patch, CLKOUT clock output to be
|
||||
disabled.
|
||||
|
||||
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/phy/realtek.c | 42 ++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 41 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/phy/realtek.c
|
||||
+++ b/drivers/net/phy/realtek.c
|
||||
@@ -8,6 +8,7 @@
|
||||
* Copyright (c) 2004 Freescale Semiconductor, Inc.
|
||||
*/
|
||||
#include <linux/bitops.h>
|
||||
+#include <linux/of.h>
|
||||
#include <linux/phy.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/delay.h>
|
||||
@@ -27,6 +28,7 @@
|
||||
#define RTL821x_PAGE_SELECT 0x1f
|
||||
|
||||
#define RTL8211F_PHYCR1 0x18
|
||||
+#define RTL8211F_PHYCR2 0x19
|
||||
#define RTL8211F_INSR 0x1d
|
||||
|
||||
#define RTL8211F_TX_DELAY BIT(8)
|
||||
@@ -40,6 +42,8 @@
|
||||
#define RTL8211E_TX_DELAY BIT(12)
|
||||
#define RTL8211E_RX_DELAY BIT(11)
|
||||
|
||||
+#define RTL8211F_CLKOUT_EN BIT(0)
|
||||
+
|
||||
#define RTL8201F_ISR 0x1e
|
||||
#define RTL8201F_IER 0x13
|
||||
|
||||
@@ -62,6 +66,10 @@ MODULE_DESCRIPTION("Realtek PHY driver")
|
||||
MODULE_AUTHOR("Johnson Leung");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
+struct rtl821x_priv {
|
||||
+ u16 phycr2;
|
||||
+};
|
||||
+
|
||||
static int rtl821x_read_page(struct phy_device *phydev)
|
||||
{
|
||||
return __phy_read(phydev, RTL821x_PAGE_SELECT);
|
||||
@@ -72,6 +80,28 @@ static int rtl821x_write_page(struct phy
|
||||
return __phy_write(phydev, RTL821x_PAGE_SELECT, page);
|
||||
}
|
||||
|
||||
+static int rtl821x_probe(struct phy_device *phydev)
|
||||
+{
|
||||
+ struct device *dev = &phydev->mdio.dev;
|
||||
+ struct rtl821x_priv *priv;
|
||||
+
|
||||
+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
|
||||
+ if (!priv)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ priv->phycr2 = phy_read_paged(phydev, 0xa43, RTL8211F_PHYCR2);
|
||||
+ if (priv->phycr2 < 0)
|
||||
+ return priv->phycr2;
|
||||
+
|
||||
+ priv->phycr2 &= RTL8211F_CLKOUT_EN;
|
||||
+ if (of_property_read_bool(dev->of_node, "realtek,clkout-disable"))
|
||||
+ priv->phycr2 &= ~RTL8211F_CLKOUT_EN;
|
||||
+
|
||||
+ phydev->priv = priv;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int rtl8201_ack_interrupt(struct phy_device *phydev)
|
||||
{
|
||||
int err;
|
||||
@@ -180,6 +210,7 @@ static int rtl8211c_config_init(struct p
|
||||
|
||||
static int rtl8211f_config_init(struct phy_device *phydev)
|
||||
{
|
||||
+ struct rtl821x_priv *priv = phydev->priv;
|
||||
struct device *dev = &phydev->mdio.dev;
|
||||
u16 val_txdly, val_rxdly;
|
||||
u16 val;
|
||||
@@ -243,7 +274,15 @@ static int rtl8211f_config_init(struct p
|
||||
val_rxdly ? "enabled" : "disabled");
|
||||
}
|
||||
|
||||
- return 0;
|
||||
+ ret = phy_modify_paged(phydev, 0xa43, RTL8211F_PHYCR2,
|
||||
+ RTL8211F_CLKOUT_EN, priv->phycr2);
|
||||
+ if (ret < 0) {
|
||||
+ dev_err(dev, "clkout configuration failed: %pe\n",
|
||||
+ ERR_PTR(ret));
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ return genphy_soft_reset(phydev);
|
||||
}
|
||||
|
||||
static int rtl821x_resume(struct phy_device *phydev)
|
||||
@@ -633,6 +672,7 @@ static struct phy_driver realtek_drvs[]
|
||||
}, {
|
||||
PHY_ID_MATCH_EXACT(0x001cc916),
|
||||
.name = "RTL8211F Gigabit Ethernet",
|
||||
+ .probe = rtl821x_probe,
|
||||
.config_init = &rtl8211f_config_init,
|
||||
.ack_interrupt = &rtl8211f_ack_interrupt,
|
||||
.config_intr = &rtl8211f_config_intr,
|
|
@ -3076,6 +3076,7 @@ CONFIG_LEDS_TRIGGER_TIMER=y
|
|||
# CONFIG_LIBFCOE is not set
|
||||
# CONFIG_LIBIPW_DEBUG is not set
|
||||
# CONFIG_LIBNVDIMM is not set
|
||||
CONFIG_LIB_MEMNEQ=y
|
||||
# CONFIG_LIDAR_LITE_V2 is not set
|
||||
CONFIG_LINEAR_RANGES=y
|
||||
# CONFIG_LIQUIDIO is not set
|
||||
|
@ -3690,7 +3691,6 @@ CONFIG_MTD_ROOTFS_ROOT_DEV=y
|
|||
# CONFIG_MTD_SPI_NAND is not set
|
||||
# CONFIG_MTD_SPI_NOR is not set
|
||||
# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
|
||||
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=4096
|
||||
# CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE is not set
|
||||
CONFIG_MTD_SPLIT=y
|
||||
# CONFIG_MTD_SPLIT_BCM63XX_FW is not set
|
||||
|
|
|
@ -3172,6 +3172,7 @@ CONFIG_LEDS_TRIGGER_TIMER=y
|
|||
# CONFIG_LIBFCOE is not set
|
||||
# CONFIG_LIBIPW_DEBUG is not set
|
||||
# CONFIG_LIBNVDIMM is not set
|
||||
CONFIG_LIB_MEMNEQ=y
|
||||
# CONFIG_LIDAR_LITE_V2 is not set
|
||||
CONFIG_LINEAR_RANGES=y
|
||||
# CONFIG_LIQUIDIO is not set
|
||||
|
@ -3833,7 +3834,6 @@ CONFIG_MTD_ROOTFS_ROOT_DEV=y
|
|||
CONFIG_MTD_SPI_NOR_SWP_DISABLE_ON_VOLATILE=y
|
||||
# CONFIG_MTD_SPI_NOR_SWP_KEEP is not set
|
||||
# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
|
||||
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=4096
|
||||
# CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE is not set
|
||||
CONFIG_MTD_SPLIT=y
|
||||
# CONFIG_MTD_SPLIT_BCM63XX_FW is not set
|
||||
|
|
|
@ -1,159 +1,10 @@
|
|||
From patchwork Tue Jun 8 04:07:19 2021
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: John Thomson <git@johnthomson.fastmail.com.au>
|
||||
X-Patchwork-Id: 1489105
|
||||
X-Patchwork-Delegate: tudor.ambarus@gmail.com
|
||||
Return-Path:
|
||||
<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>
|
||||
X-Original-To: incoming@patchwork.ozlabs.org
|
||||
Delivered-To: patchwork-incoming@bilbo.ozlabs.org
|
||||
Authentication-Results: ozlabs.org;
|
||||
spf=none (no SPF record) smtp.mailfrom=lists.infradead.org
|
||||
(client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org;
|
||||
envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;
|
||||
receiver=<UNKNOWN>)
|
||||
Authentication-Results: ozlabs.org;
|
||||
dkim=pass (2048-bit key;
|
||||
secure) header.d=lists.infradead.org header.i=@lists.infradead.org
|
||||
header.a=rsa-sha256 header.s=bombadil.20210309 header.b=EMabhVoR;
|
||||
dkim=fail reason="signature verification failed" (2048-bit key;
|
||||
unprotected) header.d=fastmail.com.au header.i=@fastmail.com.au
|
||||
header.a=rsa-sha256 header.s=fm3 header.b=dLzuZ6dB;
|
||||
dkim=fail reason="signature verification failed" (2048-bit key;
|
||||
unprotected) header.d=messagingengine.com header.i=@messagingengine.com
|
||||
header.a=rsa-sha256 header.s=fm3 header.b=nSRGsW+C;
|
||||
dkim-atps=neutral
|
||||
Received: from bombadil.infradead.org (bombadil.infradead.org
|
||||
[IPv6:2607:7c80:54:e::133])
|
||||
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
|
||||
key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest
|
||||
SHA256)
|
||||
(No client certificate requested)
|
||||
by ozlabs.org (Postfix) with ESMTPS id 4FzcFN1j1nz9sW8
|
||||
for <incoming@patchwork.ozlabs.org>; Tue, 8 Jun 2021 14:09:28 +1000 (AEST)
|
||||
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
|
||||
d=lists.infradead.org; s=bombadil.20210309; h=Sender:
|
||||
Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:
|
||||
List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc
|
||||
:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:
|
||||
Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:
|
||||
List-Owner; bh=6mUWQd71FwsINycGYY1qOhKz+ecWJVNtwDkTebG3XkA=; b=EMabhVoRE3ad89
|
||||
o3L2AgyKrs+blSofUC3hoSsQe7gi3m4si8S9HW8Z+8SsS5TufUsvGwDl80qSYGlQOytQF+1yRUWvE
|
||||
6FJ/+bqv+TwjqZFibgJ6+9OVsQN9dZ/no1R0bBXIpmrf8ORUmv58QK4ZQquaFKbyXKpFeWOC2MSv4
|
||||
H2MAhyhTU8a3gtooH6G8+KvsJEfVgh6C+aDbwxyh2UY3chHKuw1kvL6AktbfUE2xl4zxi3x3kc70B
|
||||
Wi3LiJBFokxVdgnROXxTU5tI0XboWYkQV64gLuQNV4XKClcuhVpzloDK8Iok6NTd7b32a7TdEFlCS
|
||||
lGKsEKmxtUlW2FpfoduA==;
|
||||
Received: from localhost ([::1] helo=bombadil.infradead.org)
|
||||
by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux))
|
||||
id 1lqT1r-006OAW-DX; Tue, 08 Jun 2021 04:07:51 +0000
|
||||
Received: from new1-smtp.messagingengine.com ([66.111.4.221])
|
||||
by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux))
|
||||
id 1lqT1l-006O9b-Fq
|
||||
for linux-mtd@lists.infradead.org; Tue, 08 Jun 2021 04:07:50 +0000
|
||||
Received: from compute2.internal (compute2.nyi.internal [10.202.2.42])
|
||||
by mailnew.nyi.internal (Postfix) with ESMTP id 4456B580622;
|
||||
Tue, 8 Jun 2021 00:07:42 -0400 (EDT)
|
||||
Received: from mailfrontend2 ([10.202.2.163])
|
||||
by compute2.internal (MEProxy); Tue, 08 Jun 2021 00:07:42 -0400
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com.au;
|
||||
h=from:to:cc:subject:date:message-id:mime-version
|
||||
:content-transfer-encoding; s=fm3; bh=ZXRH+YluM1mHCS1EWUiCY/Sg8O
|
||||
LccfHe1oW5iAay6y8=; b=dLzuZ6dBYf7ZA8tWLOBFZYLi7ERsGe/4vnMXG+ovvb
|
||||
dNBO0+SaFGwoqYSFrfq/TeyHfKyvxrA7+LCdopIuT4abpLHxtRwtRiafQcDYCPat
|
||||
qJIqOZO+wCZC5S9Jc1OP7+t1FviGpgevqIMotci37P+RWc5u3AweMzFljZk90E8C
|
||||
uorV6rXagD+OssJQzllRnAIK88+rOAC9ZyXv2gWxy4d1HSCwSWgzx2vnV9CNp918
|
||||
YC/3tiHas9krbrPIaAsdBROr7Bvoe/ShRRzruKRuvZVgg5NN90vX+/5ZjI8u04GM
|
||||
p2bWCbC62CP6wlcgDaz+c/Sgr5ITd2GPENJsHfqmLRBA==
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
|
||||
messagingengine.com; h=cc:content-transfer-encoding:date:from
|
||||
:message-id:mime-version:subject:to:x-me-proxy:x-me-proxy
|
||||
:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=ZXRH+YluM1mHCS1EW
|
||||
UiCY/Sg8OLccfHe1oW5iAay6y8=; b=nSRGsW+CQ2Zx1RVpIUu8W/VD/k5P+32BW
|
||||
5k2ltd+UhI3dfldBPzHrYiOP/IJqGkNW+V+rHASacW/vFygnaZoxNjRYKnOsu+26
|
||||
wb2yK3jpl6lsNTg3N1Z4XJrYY2lf9H29DMFbhC67l0PTc050rcZk4XsKTLAlv14Q
|
||||
VA4WREYSaX/4IN4O+ES4TMq0a/3gKZh6nvbbJXbsXfK0WlSHTGZtZmW3fyrqvbXa
|
||||
t+R7L8vvqWvwls0pV+Sn8LeQqb7+A69w0UOnuznjkcA3sCc2YehcHbxcUEnMH+9N
|
||||
bxOjmIDeg9/4X/829tUWUJiLhE5SFmQZ1P6oFtmbWoLrDz0ZJIVBw==
|
||||
X-ME-Sender: <xms:C-2-YD2uka4HsA6gcdsV2Ia7vebY4Yjp9E8q7KBMb54jnAzGL7-67Q>
|
||||
<xme:C-2-YCEaxASy5VlcrvNO_jLFpMDGkFCRsuVNuZGEQsiRZygk8jPHWq7unPjeT6uYS
|
||||
2pUP6PrTQ2rggjEIg>
|
||||
X-ME-Received:
|
||||
<xmr:C-2-YD4exeK49N_YZWWf2BWDhVyCbCY3wwvjTyDOFxeugx7Jg08pzMUToo9oJjrBpcVTaA3kbfk>
|
||||
X-ME-Proxy-Cause:
|
||||
gggruggvucftvghtrhhoucdtuddrgeduledrfedtkedgjeduucetufdoteggodetrfdotf
|
||||
fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
|
||||
uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
|
||||
cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpeflohhhnhcuvfhh
|
||||
ohhmshhonhcuoehgihhtsehjohhhnhhthhhomhhsohhnrdhfrghsthhmrghilhdrtghomh
|
||||
drrghuqeenucggtffrrghtthgvrhhnpefffeeihfdukedtuedufeetieeuudfhhefhkefh
|
||||
tefgtdeuffekffelleetveduieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh
|
||||
epmhgrihhlfhhrohhmpehgihhtsehjohhhnhhthhhomhhsohhnrdhfrghsthhmrghilhdr
|
||||
tghomhdrrghu
|
||||
X-ME-Proxy: <xmx:C-2-YI0AJZGjcB3wIbI9BoC9X8VNl4i9A7cQnBkvwZ25czWJlkKCLw>
|
||||
<xmx:C-2-YGGufw99T-O81-FeiSyEruv6_Pr0IHFhspQdxjv5k1VFTZ0lzQ>
|
||||
<xmx:C-2-YJ8BW7DhSDSCEAPSJWrwh_hHP79qreTZtWh_kOUwSh1c0MMlAg>
|
||||
<xmx:Du2-YJBeX2Fg9oFZVXGwEJ1ZrZnXHiAqNON8tbpzquYgcm2o_LM48g>
|
||||
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
|
||||
8 Jun 2021 00:07:35 -0400 (EDT)
|
||||
From cd13e2cd28bf7313b6ad6986bb8d63ea98b37a48 Mon Sep 17 00:00:00 2001
|
||||
From: John Thomson <git@johnthomson.fastmail.com.au>
|
||||
To: Miquel Raynal <miquel.raynal@bootlin.com>,
|
||||
Richard Weinberger <richard@nod.at>, Vignesh Raghavendra <vigneshr@ti.com>,
|
||||
Tudor Ambarus <tudor.ambarus@microchip.com>,
|
||||
Michael Walle <michael@walle.cc>, Pratyush Yadav <p.yadav@ti.com>,
|
||||
linux-mtd@lists.infradead.org
|
||||
Cc: linux-kernel@vger.kernel.org,
|
||||
John Thomson <git@johnthomson.fastmail.com.au>,
|
||||
kernel test robot <lkp@intel.com>, Dan Carpenter <dan.carpenter@oracle.com>
|
||||
Date: Fri, 25 Dec 2020 18:50:08 +1000
|
||||
Subject: [PATCH] mtd: spi-nor: write support for minor aligned partitions
|
||||
Date: Tue, 8 Jun 2021 14:07:19 +1000
|
||||
Message-Id: <20210608040719.14431-1-git@johnthomson.fastmail.com.au>
|
||||
X-Mailer: git-send-email 2.31.1
|
||||
MIME-Version: 1.0
|
||||
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
|
||||
X-CRM114-CacheID: sfid-20210607_210745_712053_67A7D864
|
||||
X-CRM114-Status: GOOD ( 26.99 )
|
||||
X-Spam-Score: -0.8 (/)
|
||||
X-Spam-Report: Spam detection software,
|
||||
running on the system "bombadil.infradead.org",
|
||||
has NOT identified this incoming email as spam. The original
|
||||
message has been attached to this so you can view it or label
|
||||
similar future email. If you have any questions, see
|
||||
the administrator of that system for details.
|
||||
Content preview: Do not prevent writing to mtd partitions where a partition
|
||||
boundary sits on a minor erasesize boundary. This addresses a FIXME that
|
||||
has been present since the start of the linux git history: /* Doesn' [...]
|
||||
Content analysis details: (-0.8 points, 5.0 required)
|
||||
pts rule name description
|
||||
---- ----------------------
|
||||
--------------------------------------------------
|
||||
-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/,
|
||||
low trust [66.111.4.221 listed in list.dnswl.org]
|
||||
-0.0 SPF_PASS SPF: sender matches SPF record
|
||||
-0.0 SPF_HELO_PASS SPF: HELO matches SPF record
|
||||
0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3)
|
||||
[66.111.4.221 listed in wl.mailspike.net]
|
||||
-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
|
||||
0.1 DKIM_SIGNED Message has a DKIM or DK signature,
|
||||
not necessarily
|
||||
valid
|
||||
-0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from
|
||||
envelope-from domain
|
||||
0.0 RCVD_IN_MSPIKE_WL Mailspike good senders
|
||||
X-BeenThere: linux-mtd@lists.infradead.org
|
||||
X-Mailman-Version: 2.1.34
|
||||
Precedence: list
|
||||
List-Id: Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>
|
||||
List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-mtd>,
|
||||
<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>
|
||||
List-Archive: <http://lists.infradead.org/pipermail/linux-mtd/>
|
||||
List-Post: <mailto:linux-mtd@lists.infradead.org>
|
||||
List-Help: <mailto:linux-mtd-request@lists.infradead.org?subject=help>
|
||||
List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-mtd>,
|
||||
<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>
|
||||
Sender: "linux-mtd" <linux-mtd-bounces@lists.infradead.org>
|
||||
Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Do not prevent writing to mtd partitions where a partition boundary sits
|
||||
on a minor erasesize boundary.
|
||||
|
@ -197,26 +48,65 @@ user 0m 0.00s |0m 0.00s |0m 0.01s
|
|||
sys 0m 46.94s |0m 50.38s |2m 12.46s
|
||||
|
||||
Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
|
||||
Signed-off-by: Thibaut VARÈNE <hacks+kernel@slashdirt.org>
|
||||
|
||||
---
|
||||
Have not tested on variable erase regions device.
|
||||
|
||||
checkpatch does not like the printk(KERN_WARNING
|
||||
these should be changed separately beforehand?
|
||||
|
||||
Changes v1 -> v2:
|
||||
Added mtdcore sysfs for erasesize_minor
|
||||
Removed finding minor erasesize for variable erase regions device,
|
||||
as untested and no responses regarding it.
|
||||
Moved IF_ENABLED for SPINOR variable erase to guard setting
|
||||
erasesize_minor in spi-nor/core.c
|
||||
Removed setting erasesize to minor where partition boundaries require
|
||||
minor erase to be writable
|
||||
Simplified minor boundary check by relying on minor being a factor of
|
||||
major
|
||||
|
||||
Changes RFC -> v1:
|
||||
Fix uninitialized variable smatch warning
|
||||
Reported-by: kernel test robot <lkp@intel.com>
|
||||
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
|
||||
---
|
||||
drivers/mtd/mtdpart.c | 52 ++++++++++++++++++++++++++++---------
|
||||
drivers/mtd/spi-nor/Kconfig | 10 +++++++
|
||||
drivers/mtd/spi-nor/core.c | 10 +++++--
|
||||
drivers/mtd/mtdcore.c | 10 ++++++++++
|
||||
drivers/mtd/mtdpart.c | 35 +++++++++++++++++++++++++----------
|
||||
drivers/mtd/spi-nor/Kconfig | 10 ++++++++++
|
||||
drivers/mtd/spi-nor/core.c | 11 +++++++++--
|
||||
include/linux/mtd/mtd.h | 2 ++
|
||||
4 files changed, 60 insertions(+), 14 deletions(-)
|
||||
5 files changed, 56 insertions(+), 12 deletions(-)
|
||||
|
||||
--- a/drivers/mtd/mtdcore.c
|
||||
+++ b/drivers/mtd/mtdcore.c
|
||||
@@ -163,6 +163,15 @@ static ssize_t mtd_erasesize_show(struct
|
||||
}
|
||||
static DEVICE_ATTR(erasesize, S_IRUGO, mtd_erasesize_show, NULL);
|
||||
|
||||
+static ssize_t mtd_erasesize_minor_show(struct device *dev,
|
||||
+ struct device_attribute *attr, char *buf)
|
||||
+{
|
||||
+ struct mtd_info *mtd = dev_get_drvdata(dev);
|
||||
+
|
||||
+ return snprintf(buf, PAGE_SIZE, "%lu\n", (unsigned long)mtd->erasesize_minor);
|
||||
+}
|
||||
+static DEVICE_ATTR(erasesize_minor, S_IRUGO, mtd_erasesize_minor_show, NULL);
|
||||
+
|
||||
static ssize_t mtd_writesize_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
@@ -312,6 +321,7 @@ static struct attribute *mtd_attrs[] = {
|
||||
&dev_attr_flags.attr,
|
||||
&dev_attr_size.attr,
|
||||
&dev_attr_erasesize.attr,
|
||||
+ &dev_attr_erasesize_minor.attr,
|
||||
&dev_attr_writesize.attr,
|
||||
&dev_attr_subpagesize.attr,
|
||||
&dev_attr_oobsize.attr,
|
||||
--- a/drivers/mtd/mtdpart.c
|
||||
+++ b/drivers/mtd/mtdpart.c
|
||||
@@ -40,10 +40,11 @@ static struct mtd_info *allocate_partiti
|
||||
@@ -40,6 +40,7 @@ static struct mtd_info *allocate_partiti
|
||||
struct mtd_info *master = mtd_get_master(parent);
|
||||
int wr_alignment = (parent->flags & MTD_NO_ERASE) ?
|
||||
master->writesize : master->erasesize;
|
||||
|
@ -224,54 +114,22 @@ Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
|
|||
u64 parent_size = mtd_is_partition(parent) ?
|
||||
parent->part.size : parent->size;
|
||||
struct mtd_info *child;
|
||||
- u32 remainder;
|
||||
+ u32 remainder, remainder_minor;
|
||||
char *name;
|
||||
u64 tmp;
|
||||
|
||||
@@ -145,6 +146,7 @@ static struct mtd_info *allocate_partiti
|
||||
int i, max = parent->numeraseregions;
|
||||
u64 end = child->part.offset + child->part.size;
|
||||
struct mtd_erase_region_info *regions = parent->eraseregions;
|
||||
+ uint32_t erasesize_minor = child->erasesize;
|
||||
|
||||
/* Find the first erase regions which is part of this
|
||||
* partition. */
|
||||
@@ -155,15 +157,24 @@ static struct mtd_info *allocate_partiti
|
||||
if (i > 0)
|
||||
i--;
|
||||
|
||||
- /* Pick biggest erasesize */
|
||||
for (; i < max && regions[i].offset < end; i++) {
|
||||
+ /* Pick biggest erasesize */
|
||||
if (child->erasesize < regions[i].erasesize)
|
||||
child->erasesize = regions[i].erasesize;
|
||||
+ /* Pick smallest non-zero erasesize */
|
||||
+ if ((erasesize_minor > regions[i].erasesize) && (regions[i].erasesize > 0))
|
||||
+ erasesize_minor = regions[i].erasesize;
|
||||
}
|
||||
+
|
||||
+ if (erasesize_minor < child->erasesize)
|
||||
+ child->erasesize_minor = erasesize_minor;
|
||||
+
|
||||
BUG_ON(child->erasesize == 0);
|
||||
@@ -164,6 +165,7 @@ static struct mtd_info *allocate_partiti
|
||||
} else {
|
||||
/* Single erase size */
|
||||
child->erasesize = master->erasesize;
|
||||
+ if (master->erasesize_minor)
|
||||
+ child->erasesize_minor = master->erasesize_minor;
|
||||
+ child->erasesize_minor = master->erasesize_minor;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -171,26 +182,43 @@ static struct mtd_info *allocate_partiti
|
||||
@@ -171,26 +173,39 @@ static struct mtd_info *allocate_partiti
|
||||
* exposes several regions with different erasesize. Adjust
|
||||
* wr_alignment accordingly.
|
||||
*/
|
||||
- if (!(child->flags & MTD_NO_ERASE))
|
||||
+ if (!(child->flags & MTD_NO_ERASE)) {
|
||||
wr_alignment = child->erasesize;
|
||||
+ if (IS_ENABLED(CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE) && child->erasesize_minor)
|
||||
+ wr_alignment_minor = child->erasesize_minor;
|
||||
+ wr_alignment_minor = child->erasesize_minor;
|
||||
+ }
|
||||
|
||||
tmp = mtd_get_master_ofs(child, 0);
|
||||
|
@ -284,13 +142,11 @@ Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
|
|||
- printk(KERN_WARNING"mtd: partition \"%s\" doesn't start on an erase/write block boundary -- force read-only\n",
|
||||
- part->name);
|
||||
+ if (wr_alignment_minor) {
|
||||
+ tmp = mtd_get_master_ofs(child, 0);
|
||||
+ remainder_minor = do_div(tmp, wr_alignment_minor);
|
||||
+ if (remainder_minor == 0)
|
||||
+ child->erasesize = child->erasesize_minor;
|
||||
+ /* rely on minor being a factor of major erasesize */
|
||||
+ tmp = remainder;
|
||||
+ remainder = do_div(tmp, wr_alignment_minor);
|
||||
+ }
|
||||
+
|
||||
+ if ((!wr_alignment_minor) || (wr_alignment_minor && remainder_minor != 0)) {
|
||||
+ if (remainder) {
|
||||
+ child->flags &= ~MTD_WRITEABLE;
|
||||
+ printk(KERN_WARNING"mtd: partition \"%s\" doesn't start on an erase/write block boundary -- force read-only\n",
|
||||
+ part->name);
|
||||
|
@ -304,12 +160,11 @@ Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
|
|||
- printk(KERN_WARNING"mtd: partition \"%s\" doesn't end on an erase/write block -- force read-only\n",
|
||||
- part->name);
|
||||
+ if (wr_alignment_minor) {
|
||||
+ tmp = mtd_get_master_ofs(child, 0) + child->part.size;
|
||||
+ remainder_minor = do_div(tmp, wr_alignment_minor);
|
||||
+ if (remainder_minor == 0)
|
||||
+ child->erasesize = child->erasesize_minor;
|
||||
+ tmp = remainder;
|
||||
+ remainder = do_div(tmp, wr_alignment_minor);
|
||||
+ }
|
||||
+ if ((!wr_alignment_minor) || (wr_alignment_minor && remainder_minor != 0)) {
|
||||
+
|
||||
+ if (remainder) {
|
||||
+ child->flags &= ~MTD_WRITEABLE;
|
||||
+ printk(KERN_WARNING"mtd: partition \"%s\" doesn't end on an erase/write block -- force read-only\n",
|
||||
+ part->name);
|
||||
|
@ -367,11 +222,12 @@ Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
|
|||
}
|
||||
}
|
||||
|
||||
@@ -2610,6 +2614,8 @@ static int spi_nor_select_erase(struct s
|
||||
@@ -2610,6 +2614,9 @@ static int spi_nor_select_erase(struct s
|
||||
return -EINVAL;
|
||||
|
||||
mtd->erasesize = erase->size;
|
||||
+ if (erase_minor && erase_minor->size < erase->size)
|
||||
+ if (IS_ENABLED(CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE) &&
|
||||
+ erase_minor && erase_minor->size < erase->size)
|
||||
+ mtd->erasesize_minor = erase_minor->size;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Sat, 4 Nov 2017 07:40:23 +0100
|
||||
Subject: [PATCH] mtd: spi-nor: support limiting 4K sectors support based on
|
||||
flash size
|
||||
|
||||
Some devices need 4K sectors to be able to deal with small flash chips.
|
||||
For instance, w25x05 is 64 KiB in size, and without 4K sectors, the
|
||||
entire chip is just one erase block.
|
||||
On bigger flash chip sizes, using 4K sectors can significantly slow down
|
||||
many operations, including using a writable filesystem. There are several
|
||||
platforms where it makes sense to use a single kernel on both kinds of
|
||||
devices.
|
||||
|
||||
To support this properly, allow configuring an upper flash chip size
|
||||
limit for 4K sectors support.
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/drivers/mtd/spi-nor/Kconfig
|
||||
+++ b/drivers/mtd/spi-nor/Kconfig
|
||||
@@ -34,6 +34,17 @@ config MTD_SPI_NOR_USE_4K_SECTORS
|
||||
Please note that some tools/drivers/filesystems may not work with
|
||||
4096 B erase size (e.g. UBIFS requires 15 KiB as a minimum).
|
||||
|
||||
+config MTD_SPI_NOR_USE_4K_SECTORS_LIMIT
|
||||
+ int "Maximum flash chip size to use 4K sectors on (in KiB)"
|
||||
+ depends on MTD_SPI_NOR_USE_4K_SECTORS
|
||||
+ default "4096"
|
||||
+ help
|
||||
+ There are many flash chips that support 4K sectors, but are so large
|
||||
+ that using them significantly slows down writing large amounts of
|
||||
+ data or using a writable filesystem.
|
||||
+ Any flash chip larger than the size specified in this option will
|
||||
+ not use 4K sectors.
|
||||
+
|
||||
source "drivers/mtd/spi-nor/controllers/Kconfig"
|
||||
|
||||
endif # MTD_SPI_NOR
|
||||
--- a/drivers/mtd/spi-nor/core.c
|
||||
+++ b/drivers/mtd/spi-nor/core.c
|
||||
@@ -2801,6 +2801,21 @@ static void spi_nor_info_init_params(str
|
||||
*/
|
||||
erase_mask = 0;
|
||||
i = 0;
|
||||
+#ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
|
||||
+ if ((info->flags & SECT_4K_PMC) && (params->size <=
|
||||
+ CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT * 1024)) {
|
||||
+ erase_mask |= BIT(i);
|
||||
+ spi_nor_set_erase_type(&map->erase_type[i], 4096u,
|
||||
+ SPINOR_OP_BE_4K_PMC);
|
||||
+ i++;
|
||||
+ } else if ((info->flags & SECT_4K) && (params->size <=
|
||||
+ CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT * 1024)) {
|
||||
+ erase_mask |= BIT(i);
|
||||
+ spi_nor_set_erase_type(&map->erase_type[i], 4096u,
|
||||
+ SPINOR_OP_BE_4K);
|
||||
+ i++;
|
||||
+ }
|
||||
+#else
|
||||
if (info->flags & SECT_4K_PMC) {
|
||||
erase_mask |= BIT(i);
|
||||
spi_nor_set_erase_type(&map->erase_type[i], 4096u,
|
||||
@@ -2812,6 +2827,7 @@ static void spi_nor_info_init_params(str
|
||||
SPINOR_OP_BE_4K);
|
||||
i++;
|
||||
}
|
||||
+#endif
|
||||
erase_mask |= BIT(i);
|
||||
spi_nor_set_erase_type(&map->erase_type[i], info->sector_size,
|
||||
SPINOR_OP_SE);
|
|
@ -1,159 +1,10 @@
|
|||
From patchwork Tue Jun 8 04:07:19 2021
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: John Thomson <git@johnthomson.fastmail.com.au>
|
||||
X-Patchwork-Id: 1489105
|
||||
X-Patchwork-Delegate: tudor.ambarus@gmail.com
|
||||
Return-Path:
|
||||
<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>
|
||||
X-Original-To: incoming@patchwork.ozlabs.org
|
||||
Delivered-To: patchwork-incoming@bilbo.ozlabs.org
|
||||
Authentication-Results: ozlabs.org;
|
||||
spf=none (no SPF record) smtp.mailfrom=lists.infradead.org
|
||||
(client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org;
|
||||
envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;
|
||||
receiver=<UNKNOWN>)
|
||||
Authentication-Results: ozlabs.org;
|
||||
dkim=pass (2048-bit key;
|
||||
secure) header.d=lists.infradead.org header.i=@lists.infradead.org
|
||||
header.a=rsa-sha256 header.s=bombadil.20210309 header.b=EMabhVoR;
|
||||
dkim=fail reason="signature verification failed" (2048-bit key;
|
||||
unprotected) header.d=fastmail.com.au header.i=@fastmail.com.au
|
||||
header.a=rsa-sha256 header.s=fm3 header.b=dLzuZ6dB;
|
||||
dkim=fail reason="signature verification failed" (2048-bit key;
|
||||
unprotected) header.d=messagingengine.com header.i=@messagingengine.com
|
||||
header.a=rsa-sha256 header.s=fm3 header.b=nSRGsW+C;
|
||||
dkim-atps=neutral
|
||||
Received: from bombadil.infradead.org (bombadil.infradead.org
|
||||
[IPv6:2607:7c80:54:e::133])
|
||||
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
|
||||
key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest
|
||||
SHA256)
|
||||
(No client certificate requested)
|
||||
by ozlabs.org (Postfix) with ESMTPS id 4FzcFN1j1nz9sW8
|
||||
for <incoming@patchwork.ozlabs.org>; Tue, 8 Jun 2021 14:09:28 +1000 (AEST)
|
||||
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
|
||||
d=lists.infradead.org; s=bombadil.20210309; h=Sender:
|
||||
Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:
|
||||
List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc
|
||||
:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:
|
||||
Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:
|
||||
List-Owner; bh=6mUWQd71FwsINycGYY1qOhKz+ecWJVNtwDkTebG3XkA=; b=EMabhVoRE3ad89
|
||||
o3L2AgyKrs+blSofUC3hoSsQe7gi3m4si8S9HW8Z+8SsS5TufUsvGwDl80qSYGlQOytQF+1yRUWvE
|
||||
6FJ/+bqv+TwjqZFibgJ6+9OVsQN9dZ/no1R0bBXIpmrf8ORUmv58QK4ZQquaFKbyXKpFeWOC2MSv4
|
||||
H2MAhyhTU8a3gtooH6G8+KvsJEfVgh6C+aDbwxyh2UY3chHKuw1kvL6AktbfUE2xl4zxi3x3kc70B
|
||||
Wi3LiJBFokxVdgnROXxTU5tI0XboWYkQV64gLuQNV4XKClcuhVpzloDK8Iok6NTd7b32a7TdEFlCS
|
||||
lGKsEKmxtUlW2FpfoduA==;
|
||||
Received: from localhost ([::1] helo=bombadil.infradead.org)
|
||||
by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux))
|
||||
id 1lqT1r-006OAW-DX; Tue, 08 Jun 2021 04:07:51 +0000
|
||||
Received: from new1-smtp.messagingengine.com ([66.111.4.221])
|
||||
by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux))
|
||||
id 1lqT1l-006O9b-Fq
|
||||
for linux-mtd@lists.infradead.org; Tue, 08 Jun 2021 04:07:50 +0000
|
||||
Received: from compute2.internal (compute2.nyi.internal [10.202.2.42])
|
||||
by mailnew.nyi.internal (Postfix) with ESMTP id 4456B580622;
|
||||
Tue, 8 Jun 2021 00:07:42 -0400 (EDT)
|
||||
Received: from mailfrontend2 ([10.202.2.163])
|
||||
by compute2.internal (MEProxy); Tue, 08 Jun 2021 00:07:42 -0400
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com.au;
|
||||
h=from:to:cc:subject:date:message-id:mime-version
|
||||
:content-transfer-encoding; s=fm3; bh=ZXRH+YluM1mHCS1EWUiCY/Sg8O
|
||||
LccfHe1oW5iAay6y8=; b=dLzuZ6dBYf7ZA8tWLOBFZYLi7ERsGe/4vnMXG+ovvb
|
||||
dNBO0+SaFGwoqYSFrfq/TeyHfKyvxrA7+LCdopIuT4abpLHxtRwtRiafQcDYCPat
|
||||
qJIqOZO+wCZC5S9Jc1OP7+t1FviGpgevqIMotci37P+RWc5u3AweMzFljZk90E8C
|
||||
uorV6rXagD+OssJQzllRnAIK88+rOAC9ZyXv2gWxy4d1HSCwSWgzx2vnV9CNp918
|
||||
YC/3tiHas9krbrPIaAsdBROr7Bvoe/ShRRzruKRuvZVgg5NN90vX+/5ZjI8u04GM
|
||||
p2bWCbC62CP6wlcgDaz+c/Sgr5ITd2GPENJsHfqmLRBA==
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
|
||||
messagingengine.com; h=cc:content-transfer-encoding:date:from
|
||||
:message-id:mime-version:subject:to:x-me-proxy:x-me-proxy
|
||||
:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=ZXRH+YluM1mHCS1EW
|
||||
UiCY/Sg8OLccfHe1oW5iAay6y8=; b=nSRGsW+CQ2Zx1RVpIUu8W/VD/k5P+32BW
|
||||
5k2ltd+UhI3dfldBPzHrYiOP/IJqGkNW+V+rHASacW/vFygnaZoxNjRYKnOsu+26
|
||||
wb2yK3jpl6lsNTg3N1Z4XJrYY2lf9H29DMFbhC67l0PTc050rcZk4XsKTLAlv14Q
|
||||
VA4WREYSaX/4IN4O+ES4TMq0a/3gKZh6nvbbJXbsXfK0WlSHTGZtZmW3fyrqvbXa
|
||||
t+R7L8vvqWvwls0pV+Sn8LeQqb7+A69w0UOnuznjkcA3sCc2YehcHbxcUEnMH+9N
|
||||
bxOjmIDeg9/4X/829tUWUJiLhE5SFmQZ1P6oFtmbWoLrDz0ZJIVBw==
|
||||
X-ME-Sender: <xms:C-2-YD2uka4HsA6gcdsV2Ia7vebY4Yjp9E8q7KBMb54jnAzGL7-67Q>
|
||||
<xme:C-2-YCEaxASy5VlcrvNO_jLFpMDGkFCRsuVNuZGEQsiRZygk8jPHWq7unPjeT6uYS
|
||||
2pUP6PrTQ2rggjEIg>
|
||||
X-ME-Received:
|
||||
<xmr:C-2-YD4exeK49N_YZWWf2BWDhVyCbCY3wwvjTyDOFxeugx7Jg08pzMUToo9oJjrBpcVTaA3kbfk>
|
||||
X-ME-Proxy-Cause:
|
||||
gggruggvucftvghtrhhoucdtuddrgeduledrfedtkedgjeduucetufdoteggodetrfdotf
|
||||
fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
|
||||
uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
|
||||
cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpeflohhhnhcuvfhh
|
||||
ohhmshhonhcuoehgihhtsehjohhhnhhthhhomhhsohhnrdhfrghsthhmrghilhdrtghomh
|
||||
drrghuqeenucggtffrrghtthgvrhhnpefffeeihfdukedtuedufeetieeuudfhhefhkefh
|
||||
tefgtdeuffekffelleetveduieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh
|
||||
epmhgrihhlfhhrohhmpehgihhtsehjohhhnhhthhhomhhsohhnrdhfrghsthhmrghilhdr
|
||||
tghomhdrrghu
|
||||
X-ME-Proxy: <xmx:C-2-YI0AJZGjcB3wIbI9BoC9X8VNl4i9A7cQnBkvwZ25czWJlkKCLw>
|
||||
<xmx:C-2-YGGufw99T-O81-FeiSyEruv6_Pr0IHFhspQdxjv5k1VFTZ0lzQ>
|
||||
<xmx:C-2-YJ8BW7DhSDSCEAPSJWrwh_hHP79qreTZtWh_kOUwSh1c0MMlAg>
|
||||
<xmx:Du2-YJBeX2Fg9oFZVXGwEJ1ZrZnXHiAqNON8tbpzquYgcm2o_LM48g>
|
||||
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
|
||||
8 Jun 2021 00:07:35 -0400 (EDT)
|
||||
From acacdac272927ae1d96e0bca51eb82899671eaea Mon Sep 17 00:00:00 2001
|
||||
From: John Thomson <git@johnthomson.fastmail.com.au>
|
||||
To: Miquel Raynal <miquel.raynal@bootlin.com>,
|
||||
Richard Weinberger <richard@nod.at>, Vignesh Raghavendra <vigneshr@ti.com>,
|
||||
Tudor Ambarus <tudor.ambarus@microchip.com>,
|
||||
Michael Walle <michael@walle.cc>, Pratyush Yadav <p.yadav@ti.com>,
|
||||
linux-mtd@lists.infradead.org
|
||||
Cc: linux-kernel@vger.kernel.org,
|
||||
John Thomson <git@johnthomson.fastmail.com.au>,
|
||||
kernel test robot <lkp@intel.com>, Dan Carpenter <dan.carpenter@oracle.com>
|
||||
Date: Fri, 25 Dec 2020 18:50:08 +1000
|
||||
Subject: [PATCH] mtd: spi-nor: write support for minor aligned partitions
|
||||
Date: Tue, 8 Jun 2021 14:07:19 +1000
|
||||
Message-Id: <20210608040719.14431-1-git@johnthomson.fastmail.com.au>
|
||||
X-Mailer: git-send-email 2.31.1
|
||||
MIME-Version: 1.0
|
||||
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
|
||||
X-CRM114-CacheID: sfid-20210607_210745_712053_67A7D864
|
||||
X-CRM114-Status: GOOD ( 26.99 )
|
||||
X-Spam-Score: -0.8 (/)
|
||||
X-Spam-Report: Spam detection software,
|
||||
running on the system "bombadil.infradead.org",
|
||||
has NOT identified this incoming email as spam. The original
|
||||
message has been attached to this so you can view it or label
|
||||
similar future email. If you have any questions, see
|
||||
the administrator of that system for details.
|
||||
Content preview: Do not prevent writing to mtd partitions where a partition
|
||||
boundary sits on a minor erasesize boundary. This addresses a FIXME that
|
||||
has been present since the start of the linux git history: /* Doesn' [...]
|
||||
Content analysis details: (-0.8 points, 5.0 required)
|
||||
pts rule name description
|
||||
---- ----------------------
|
||||
--------------------------------------------------
|
||||
-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/,
|
||||
low trust [66.111.4.221 listed in list.dnswl.org]
|
||||
-0.0 SPF_PASS SPF: sender matches SPF record
|
||||
-0.0 SPF_HELO_PASS SPF: HELO matches SPF record
|
||||
0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3)
|
||||
[66.111.4.221 listed in wl.mailspike.net]
|
||||
-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
|
||||
0.1 DKIM_SIGNED Message has a DKIM or DK signature,
|
||||
not necessarily
|
||||
valid
|
||||
-0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from
|
||||
envelope-from domain
|
||||
0.0 RCVD_IN_MSPIKE_WL Mailspike good senders
|
||||
X-BeenThere: linux-mtd@lists.infradead.org
|
||||
X-Mailman-Version: 2.1.34
|
||||
Precedence: list
|
||||
List-Id: Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>
|
||||
List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-mtd>,
|
||||
<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>
|
||||
List-Archive: <http://lists.infradead.org/pipermail/linux-mtd/>
|
||||
List-Post: <mailto:linux-mtd@lists.infradead.org>
|
||||
List-Help: <mailto:linux-mtd-request@lists.infradead.org?subject=help>
|
||||
List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-mtd>,
|
||||
<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>
|
||||
Sender: "linux-mtd" <linux-mtd-bounces@lists.infradead.org>
|
||||
Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Do not prevent writing to mtd partitions where a partition boundary sits
|
||||
on a minor erasesize boundary.
|
||||
|
@ -197,26 +48,65 @@ user 0m 0.00s |0m 0.00s |0m 0.01s
|
|||
sys 0m 46.94s |0m 50.38s |2m 12.46s
|
||||
|
||||
Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
|
||||
Signed-off-by: Thibaut VARÈNE <hacks+kernel@slashdirt.org>
|
||||
|
||||
---
|
||||
Have not tested on variable erase regions device.
|
||||
|
||||
checkpatch does not like the printk(KERN_WARNING
|
||||
these should be changed separately beforehand?
|
||||
|
||||
Changes v1 -> v2:
|
||||
Added mtdcore sysfs for erasesize_minor
|
||||
Removed finding minor erasesize for variable erase regions device,
|
||||
as untested and no responses regarding it.
|
||||
Moved IF_ENABLED for SPINOR variable erase to guard setting
|
||||
erasesize_minor in spi-nor/core.c
|
||||
Removed setting erasesize to minor where partition boundaries require
|
||||
minor erase to be writable
|
||||
Simplified minor boundary check by relying on minor being a factor of
|
||||
major
|
||||
|
||||
Changes RFC -> v1:
|
||||
Fix uninitialized variable smatch warning
|
||||
Reported-by: kernel test robot <lkp@intel.com>
|
||||
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
|
||||
---
|
||||
drivers/mtd/mtdpart.c | 52 ++++++++++++++++++++++++++++---------
|
||||
drivers/mtd/spi-nor/Kconfig | 10 +++++++
|
||||
drivers/mtd/spi-nor/core.c | 10 +++++--
|
||||
drivers/mtd/mtdcore.c | 10 ++++++++++
|
||||
drivers/mtd/mtdpart.c | 35 +++++++++++++++++++++++++----------
|
||||
drivers/mtd/spi-nor/Kconfig | 10 ++++++++++
|
||||
drivers/mtd/spi-nor/core.c | 11 +++++++++--
|
||||
include/linux/mtd/mtd.h | 2 ++
|
||||
4 files changed, 60 insertions(+), 14 deletions(-)
|
||||
5 files changed, 56 insertions(+), 12 deletions(-)
|
||||
|
||||
--- a/drivers/mtd/mtdcore.c
|
||||
+++ b/drivers/mtd/mtdcore.c
|
||||
@@ -168,6 +168,15 @@ static ssize_t mtd_erasesize_show(struct
|
||||
}
|
||||
MTD_DEVICE_ATTR_RO(erasesize);
|
||||
|
||||
+static ssize_t mtd_erasesize_minor_show(struct device *dev,
|
||||
+ struct device_attribute *attr, char *buf)
|
||||
+{
|
||||
+ struct mtd_info *mtd = dev_get_drvdata(dev);
|
||||
+
|
||||
+ return sysfs_emit(buf, "%lu\n", (unsigned long)mtd->erasesize_minor);
|
||||
+}
|
||||
+MTD_DEVICE_ATTR_RO(erasesize_minor);
|
||||
+
|
||||
static ssize_t mtd_writesize_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
@@ -313,6 +322,7 @@ static struct attribute *mtd_attrs[] = {
|
||||
&dev_attr_flags.attr,
|
||||
&dev_attr_size.attr,
|
||||
&dev_attr_erasesize.attr,
|
||||
+ &dev_attr_erasesize_minor.attr,
|
||||
&dev_attr_writesize.attr,
|
||||
&dev_attr_subpagesize.attr,
|
||||
&dev_attr_oobsize.attr,
|
||||
--- a/drivers/mtd/mtdpart.c
|
||||
+++ b/drivers/mtd/mtdpart.c
|
||||
@@ -40,10 +40,11 @@ static struct mtd_info *allocate_partiti
|
||||
@@ -40,6 +40,7 @@ static struct mtd_info *allocate_partiti
|
||||
struct mtd_info *master = mtd_get_master(parent);
|
||||
int wr_alignment = (parent->flags & MTD_NO_ERASE) ?
|
||||
master->writesize : master->erasesize;
|
||||
|
@ -224,54 +114,22 @@ Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
|
|||
u64 parent_size = mtd_is_partition(parent) ?
|
||||
parent->part.size : parent->size;
|
||||
struct mtd_info *child;
|
||||
- u32 remainder;
|
||||
+ u32 remainder, remainder_minor;
|
||||
char *name;
|
||||
u64 tmp;
|
||||
|
||||
@@ -145,6 +146,7 @@ static struct mtd_info *allocate_partiti
|
||||
int i, max = parent->numeraseregions;
|
||||
u64 end = child->part.offset + child->part.size;
|
||||
struct mtd_erase_region_info *regions = parent->eraseregions;
|
||||
+ uint32_t erasesize_minor = child->erasesize;
|
||||
|
||||
/* Find the first erase regions which is part of this
|
||||
* partition. */
|
||||
@@ -155,15 +157,24 @@ static struct mtd_info *allocate_partiti
|
||||
if (i > 0)
|
||||
i--;
|
||||
|
||||
- /* Pick biggest erasesize */
|
||||
for (; i < max && regions[i].offset < end; i++) {
|
||||
+ /* Pick biggest erasesize */
|
||||
if (child->erasesize < regions[i].erasesize)
|
||||
child->erasesize = regions[i].erasesize;
|
||||
+ /* Pick smallest non-zero erasesize */
|
||||
+ if ((erasesize_minor > regions[i].erasesize) && (regions[i].erasesize > 0))
|
||||
+ erasesize_minor = regions[i].erasesize;
|
||||
}
|
||||
+
|
||||
+ if (erasesize_minor < child->erasesize)
|
||||
+ child->erasesize_minor = erasesize_minor;
|
||||
+
|
||||
BUG_ON(child->erasesize == 0);
|
||||
@@ -164,6 +165,7 @@ static struct mtd_info *allocate_partiti
|
||||
} else {
|
||||
/* Single erase size */
|
||||
child->erasesize = master->erasesize;
|
||||
+ if (master->erasesize_minor)
|
||||
+ child->erasesize_minor = master->erasesize_minor;
|
||||
+ child->erasesize_minor = master->erasesize_minor;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -171,26 +182,43 @@ static struct mtd_info *allocate_partiti
|
||||
@@ -171,26 +173,39 @@ static struct mtd_info *allocate_partiti
|
||||
* exposes several regions with different erasesize. Adjust
|
||||
* wr_alignment accordingly.
|
||||
*/
|
||||
- if (!(child->flags & MTD_NO_ERASE))
|
||||
+ if (!(child->flags & MTD_NO_ERASE)) {
|
||||
wr_alignment = child->erasesize;
|
||||
+ if (IS_ENABLED(CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE) && child->erasesize_minor)
|
||||
+ wr_alignment_minor = child->erasesize_minor;
|
||||
+ wr_alignment_minor = child->erasesize_minor;
|
||||
+ }
|
||||
|
||||
tmp = mtd_get_master_ofs(child, 0);
|
||||
|
@ -284,13 +142,11 @@ Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
|
|||
- printk(KERN_WARNING"mtd: partition \"%s\" doesn't start on an erase/write block boundary -- force read-only\n",
|
||||
- part->name);
|
||||
+ if (wr_alignment_minor) {
|
||||
+ tmp = mtd_get_master_ofs(child, 0);
|
||||
+ remainder_minor = do_div(tmp, wr_alignment_minor);
|
||||
+ if (remainder_minor == 0)
|
||||
+ child->erasesize = child->erasesize_minor;
|
||||
+ /* rely on minor being a factor of major erasesize */
|
||||
+ tmp = remainder;
|
||||
+ remainder = do_div(tmp, wr_alignment_minor);
|
||||
+ }
|
||||
+
|
||||
+ if ((!wr_alignment_minor) || (wr_alignment_minor && remainder_minor != 0)) {
|
||||
+ if (remainder) {
|
||||
+ child->flags &= ~MTD_WRITEABLE;
|
||||
+ printk(KERN_WARNING"mtd: partition \"%s\" doesn't start on an erase/write block boundary -- force read-only\n",
|
||||
+ part->name);
|
||||
|
@ -304,12 +160,11 @@ Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
|
|||
- printk(KERN_WARNING"mtd: partition \"%s\" doesn't end on an erase/write block -- force read-only\n",
|
||||
- part->name);
|
||||
+ if (wr_alignment_minor) {
|
||||
+ tmp = mtd_get_master_ofs(child, 0) + child->part.size;
|
||||
+ remainder_minor = do_div(tmp, wr_alignment_minor);
|
||||
+ if (remainder_minor == 0)
|
||||
+ child->erasesize = child->erasesize_minor;
|
||||
+ tmp = remainder;
|
||||
+ remainder = do_div(tmp, wr_alignment_minor);
|
||||
+ }
|
||||
+ if ((!wr_alignment_minor) || (wr_alignment_minor && remainder_minor != 0)) {
|
||||
+
|
||||
+ if (remainder) {
|
||||
+ child->flags &= ~MTD_WRITEABLE;
|
||||
+ printk(KERN_WARNING"mtd: partition \"%s\" doesn't end on an erase/write block -- force read-only\n",
|
||||
+ part->name);
|
||||
|
@ -367,11 +222,12 @@ Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
|
|||
}
|
||||
}
|
||||
|
||||
@@ -2429,6 +2433,8 @@ static int spi_nor_select_erase(struct s
|
||||
@@ -2429,6 +2433,9 @@ static int spi_nor_select_erase(struct s
|
||||
return -EINVAL;
|
||||
|
||||
mtd->erasesize = erase->size;
|
||||
+ if (erase_minor && erase_minor->size < erase->size)
|
||||
+ if (IS_ENABLED(CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE) &&
|
||||
+ erase_minor && erase_minor->size < erase->size)
|
||||
+ mtd->erasesize_minor = erase_minor->size;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Sat, 4 Nov 2017 07:40:23 +0100
|
||||
Subject: [PATCH] mtd: spi-nor: support limiting 4K sectors support based on
|
||||
flash size
|
||||
|
||||
Some devices need 4K sectors to be able to deal with small flash chips.
|
||||
For instance, w25x05 is 64 KiB in size, and without 4K sectors, the
|
||||
entire chip is just one erase block.
|
||||
On bigger flash chip sizes, using 4K sectors can significantly slow down
|
||||
many operations, including using a writable filesystem. There are several
|
||||
platforms where it makes sense to use a single kernel on both kinds of
|
||||
devices.
|
||||
|
||||
To support this properly, allow configuring an upper flash chip size
|
||||
limit for 4K sectors support.
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/drivers/mtd/spi-nor/Kconfig
|
||||
+++ b/drivers/mtd/spi-nor/Kconfig
|
||||
@@ -78,6 +78,17 @@ config MTD_SPI_NOR_SWP_KEEP
|
||||
|
||||
endchoice
|
||||
|
||||
+config MTD_SPI_NOR_USE_4K_SECTORS_LIMIT
|
||||
+ int "Maximum flash chip size to use 4K sectors on (in KiB)"
|
||||
+ depends on MTD_SPI_NOR_USE_4K_SECTORS
|
||||
+ default "4096"
|
||||
+ help
|
||||
+ There are many flash chips that support 4K sectors, but are so large
|
||||
+ that using them significantly slows down writing large amounts of
|
||||
+ data or using a writable filesystem.
|
||||
+ Any flash chip larger than the size specified in this option will
|
||||
+ not use 4K sectors.
|
||||
+
|
||||
source "drivers/mtd/spi-nor/controllers/Kconfig"
|
||||
|
||||
endif # MTD_SPI_NOR
|
||||
--- a/drivers/mtd/spi-nor/core.c
|
||||
+++ b/drivers/mtd/spi-nor/core.c
|
||||
@@ -2640,6 +2640,21 @@ static void spi_nor_info_init_params(str
|
||||
*/
|
||||
erase_mask = 0;
|
||||
i = 0;
|
||||
+#ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
|
||||
+ if ((info->flags & SECT_4K_PMC) && (params->size <=
|
||||
+ CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT * 1024)) {
|
||||
+ erase_mask |= BIT(i);
|
||||
+ spi_nor_set_erase_type(&map->erase_type[i], 4096u,
|
||||
+ SPINOR_OP_BE_4K_PMC);
|
||||
+ i++;
|
||||
+ } else if ((info->flags & SECT_4K) && (params->size <=
|
||||
+ CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT * 1024)) {
|
||||
+ erase_mask |= BIT(i);
|
||||
+ spi_nor_set_erase_type(&map->erase_type[i], 4096u,
|
||||
+ SPINOR_OP_BE_4K);
|
||||
+ i++;
|
||||
+ }
|
||||
+#else
|
||||
if (info->flags & SECT_4K_PMC) {
|
||||
erase_mask |= BIT(i);
|
||||
spi_nor_set_erase_type(&map->erase_type[i], 4096u,
|
||||
@@ -2651,6 +2666,7 @@ static void spi_nor_info_init_params(str
|
||||
SPINOR_OP_BE_4K);
|
||||
i++;
|
||||
}
|
||||
+#endif
|
||||
erase_mask |= BIT(i);
|
||||
spi_nor_set_erase_type(&map->erase_type[i], info->sector_size,
|
||||
SPINOR_OP_SE);
|
|
@ -185,7 +185,6 @@
|
|||
#size-cells = <1>;
|
||||
label = "RouterBoot";
|
||||
reg = <0x80000 0x80000>;
|
||||
read-only;
|
||||
|
||||
hard_config {
|
||||
read-only;
|
||||
|
|
|
@ -187,7 +187,6 @@
|
|||
#size-cells = <1>;
|
||||
label = "RouterBoot";
|
||||
reg = <0x80000 0x80000>;
|
||||
read-only;
|
||||
|
||||
hard_config {
|
||||
read-only;
|
||||
|
|
|
@ -189,7 +189,6 @@
|
|||
#size-cells = <1>;
|
||||
label = "RouterBoot";
|
||||
reg = <0x80000 0x80000>;
|
||||
read-only;
|
||||
|
||||
hard_config {
|
||||
read-only;
|
||||
|
|
|
@ -249,7 +249,6 @@
|
|||
#size-cells = <1>;
|
||||
label = "RouterBoot";
|
||||
reg = <0x80000 0x80000>;
|
||||
read-only;
|
||||
|
||||
hard_config {
|
||||
read-only;
|
||||
|
|
|
@ -209,7 +209,6 @@
|
|||
#size-cells = <1>;
|
||||
label = "RouterBoot";
|
||||
reg = <0x80000 0x80000>;
|
||||
read-only;
|
||||
|
||||
hard_config {
|
||||
read-only;
|
||||
|
|
|
@ -511,7 +511,6 @@ CONFIG_MTD_PHYSMAP=y
|
|||
CONFIG_MTD_RAW_NAND=y
|
||||
CONFIG_MTD_SPI_NOR=y
|
||||
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
|
||||
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384
|
||||
CONFIG_MTD_SPLIT_FIRMWARE=y
|
||||
CONFIG_MTD_SPLIT_FIT_FW=y
|
||||
CONFIG_MTD_SST25L=y
|
||||
|
|
|
@ -21,7 +21,8 @@ globalscale,espressobin-ultra)
|
|||
ucidef_set_interfaces_lan_wan "lan0 lan1 lan2 lan3" "wan"
|
||||
;;
|
||||
marvell,armada-3720-db|\
|
||||
methode,udpu)
|
||||
methode,udpu|\
|
||||
methode,edpu)
|
||||
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
||||
;;
|
||||
*)
|
||||
|
|
|
@ -8,7 +8,8 @@ preinit_mount_udpu() {
|
|||
. /lib/upgrade/common.sh
|
||||
|
||||
case $(board_name) in
|
||||
methode,udpu)
|
||||
methode,udpu|\
|
||||
methode,edpu)
|
||||
# Check which device is detected
|
||||
[ -b "/dev/mmcblk0" ] && mmcdev="/dev/mmcblk0" || mmcdev="/dev/mmcblk1"
|
||||
|
||||
|
|
|
@ -33,7 +33,8 @@ platform_do_upgrade() {
|
|||
globalscale,espressobin-v7-emmc)
|
||||
legacy_sdcard_do_upgrade "$1"
|
||||
;;
|
||||
methode,udpu)
|
||||
methode,udpu|\
|
||||
methode,edpu)
|
||||
platform_do_upgrade_uDPU "$1"
|
||||
;;
|
||||
*)
|
||||
|
@ -51,7 +52,8 @@ platform_copy_config() {
|
|||
globalscale,espressobin-v7-emmc)
|
||||
legacy_sdcard_copy_config
|
||||
;;
|
||||
methode,udpu)
|
||||
methode,udpu|\
|
||||
methode,edpu)
|
||||
platform_copy_config_uDPU
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include "armada-3720-uDPU.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Methode eDPU Board";
|
||||
compatible = "methode,edpu", "marvell,armada3720", "marvell,armada3710";
|
||||
};
|
||||
|
||||
/* PHY mode is set to 1000Base-X despite Maxlinear IC being capable of
|
||||
* 2500Base-X since until 5.15 support for mvebu is available trying to
|
||||
* use 2500Base-X will cause buffer overruns for which the fix is not
|
||||
* easily backportable.
|
||||
*/
|
||||
ð0 {
|
||||
phy-mode = "1000base-x";
|
||||
};
|
|
@ -0,0 +1,46 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include "armada-3720-uDPU.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Methode uDPU Board";
|
||||
compatible = "methode,udpu", "marvell,armada3720", "marvell,armada3710";
|
||||
|
||||
sfp_eth0: sfp-eth0 {
|
||||
compatible = "sff,sfp";
|
||||
i2c-bus = <&i2c0>;
|
||||
los-gpio = <&gpiosb 2 GPIO_ACTIVE_HIGH>;
|
||||
mod-def0-gpio = <&gpiosb 3 GPIO_ACTIVE_LOW>;
|
||||
tx-disable-gpio = <&gpiosb 4 GPIO_ACTIVE_HIGH>;
|
||||
tx-fault-gpio = <&gpiosb 5 GPIO_ACTIVE_HIGH>;
|
||||
maximum-power-milliwatt = <3000>;
|
||||
};
|
||||
};
|
||||
|
||||
&pinctrl_nb {
|
||||
i2c1_recovery_pins: i2c1-recovery-pins {
|
||||
groups = "i2c1";
|
||||
function = "gpio";
|
||||
};
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
status = "okay";
|
||||
pinctrl-names = "default", "recovery";
|
||||
pinctrl-0 = <&i2c1_pins>;
|
||||
pinctrl-1 = <&i2c1_recovery_pins>;
|
||||
/delete-property/mrvl,i2c-fast-mode;
|
||||
scl-gpios = <&gpionb 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
|
||||
sda-gpios = <&gpionb 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
|
||||
};
|
||||
|
||||
ð0 {
|
||||
phy-mode = "2500base-x";
|
||||
sfp = <&sfp_eth0>;
|
||||
};
|
||||
|
||||
ð1 {
|
||||
phy-mode = "2500base-x";
|
||||
};
|
|
@ -0,0 +1,165 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
||||
/*
|
||||
* Device tree for the uDPU board.
|
||||
* Based on Marvell Armada 3720 development board (DB-88F3720-DDR3)
|
||||
* Copyright (C) 2016 Marvell
|
||||
* Copyright (C) 2019 Methode Electronics
|
||||
* Copyright (C) 2019 Telus
|
||||
*
|
||||
* Vladimir Vid <vladimir.vid@sartura.hr>
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include "armada-372x.dtsi"
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
memory@0 {
|
||||
device_type = "memory";
|
||||
reg = <0x00000000 0x00000000 0x00000000 0x20000000>;
|
||||
};
|
||||
|
||||
aliases {
|
||||
ethernet0 = ð0;
|
||||
ethernet1 = ð1;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led-power1 {
|
||||
label = "udpu:green:power";
|
||||
gpios = <&gpionb 11 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led-power2 {
|
||||
label = "udpu:red:power";
|
||||
gpios = <&gpionb 12 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led-network1 {
|
||||
label = "udpu:green:network";
|
||||
gpios = <&gpionb 13 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led-network2 {
|
||||
label = "udpu:red:network";
|
||||
gpios = <&gpionb 14 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led-alarm1 {
|
||||
label = "udpu:green:alarm";
|
||||
gpios = <&gpionb 15 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led-alarm2 {
|
||||
label = "udpu:red:alarm";
|
||||
gpios = <&gpionb 16 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
sfp_eth1: sfp-eth1 {
|
||||
compatible = "sff,sfp";
|
||||
i2c-bus = <&i2c1>;
|
||||
los-gpio = <&gpiosb 7 GPIO_ACTIVE_HIGH>;
|
||||
mod-def0-gpio = <&gpiosb 8 GPIO_ACTIVE_LOW>;
|
||||
tx-disable-gpio = <&gpiosb 9 GPIO_ACTIVE_HIGH>;
|
||||
tx-fault-gpio = <&gpiosb 10 GPIO_ACTIVE_HIGH>;
|
||||
maximum-power-milliwatt = <3000>;
|
||||
};
|
||||
};
|
||||
|
||||
&sdhci0 {
|
||||
status = "okay";
|
||||
bus-width = <8>;
|
||||
mmc-ddr-1_8v;
|
||||
mmc-hs400-1_8v;
|
||||
marvell,pad-type = "fixed-1-8v";
|
||||
non-removable;
|
||||
no-sd;
|
||||
no-sdio;
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi_quad_pins>;
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <54000000>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "firmware";
|
||||
reg = <0x0 0x180000>;
|
||||
};
|
||||
|
||||
partition@180000 {
|
||||
label = "u-boot-env";
|
||||
reg = <0x180000 0x10000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pinctrl_nb {
|
||||
i2c2_recovery_pins: i2c2-recovery-pins {
|
||||
groups = "i2c2";
|
||||
function = "gpio";
|
||||
};
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
status = "okay";
|
||||
pinctrl-names = "default", "recovery";
|
||||
pinctrl-0 = <&i2c2_pins>;
|
||||
pinctrl-1 = <&i2c2_recovery_pins>;
|
||||
/delete-property/mrvl,i2c-fast-mode;
|
||||
scl-gpios = <&gpionb 2 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
|
||||
sda-gpios = <&gpionb 3 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
|
||||
|
||||
temp-sensor@48 {
|
||||
compatible = "ti,tmp75c";
|
||||
reg = <0x48>;
|
||||
};
|
||||
|
||||
temp-sensor@49 {
|
||||
compatible = "ti,tmp75c";
|
||||
reg = <0x49>;
|
||||
};
|
||||
};
|
||||
|
||||
ð0 {
|
||||
status = "okay";
|
||||
managed = "in-band-status";
|
||||
phys = <&comphy1 0>;
|
||||
};
|
||||
|
||||
ð1 {
|
||||
phy-mode = "sgmii";
|
||||
status = "okay";
|
||||
managed = "in-band-status";
|
||||
phys = <&comphy0 1>;
|
||||
sfp = <&sfp_eth1>;
|
||||
};
|
||||
|
||||
&usb3 {
|
||||
status = "okay";
|
||||
phys = <&usb2_utmi_otg_phy>;
|
||||
phy-names = "usb2-utmi-otg-phy";
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
status = "okay";
|
||||
};
|
|
@ -92,3 +92,11 @@ define Device/methode_udpu
|
|||
BOOT_SCRIPT := udpu
|
||||
endef
|
||||
TARGET_DEVICES += methode_udpu
|
||||
|
||||
define Device/methode_edpu
|
||||
$(call Device/methode_udpu)
|
||||
DEVICE_MODEL := eDPU
|
||||
DEVICE_DTS := armada-3720-eDPU
|
||||
KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(DEVICE_DTS).dtb
|
||||
endef
|
||||
TARGET_DEVICES += methode_edpu
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
Certain SFP modules (most notably Nokia GPON ones) first check
|
||||
connectivity on 1000base-x, and switch to 2500base-x afterwards. This
|
||||
is considered a quirk so the phylink switches the interface to
|
||||
2500base-x as well.
|
||||
|
||||
However, after power-cycling the uDPU device, network interface/SFP module
|
||||
will not work correctly until the module is re-seated. This patch
|
||||
resolves this issue by forcing the interface to be brought up in
|
||||
2500base-x mode by default.
|
||||
|
||||
Signed-off-by: Jakov Petrina <jakov.petrina@sartura.hr>
|
||||
Signed-off-by: Vladimir Vid <vladimir.vid@sartura.hr>
|
||||
Cc: Luka Perkov <luka.perkov@sartura.hr>
|
||||
|
||||
--- a/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts
|
||||
+++ b/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts
|
||||
@@ -162,7 +162,7 @@
|
||||
};
|
||||
|
||||
ð0 {
|
||||
- phy-mode = "sgmii";
|
||||
+ phy-mode = "2500base-x";
|
||||
status = "okay";
|
||||
managed = "in-band-status";
|
||||
phys = <&comphy1 0>;
|
||||
@@ -170,7 +170,7 @@
|
||||
};
|
||||
|
||||
ð1 {
|
||||
- phy-mode = "sgmii";
|
||||
+ phy-mode = "2500base-x";
|
||||
status = "okay";
|
||||
managed = "in-band-status";
|
||||
phys = <&comphy0 1>;
|
|
@ -178,7 +178,6 @@ CONFIG_MTD_NAND_CORE=y
|
|||
CONFIG_MTD_SPI_NAND=y
|
||||
CONFIG_MTD_SPI_NOR=y
|
||||
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
|
||||
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384
|
||||
CONFIG_MTD_UBI=y
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
|
|
|
@ -12,6 +12,7 @@ FEATURES:=boot-part ext4 fpu legacy-sdcard powerpc64 ramdisk root-part rtc sourc
|
|||
SUBTARGETS:=generic
|
||||
|
||||
KERNEL_PATCHVER:=5.10
|
||||
KERNEL_TESTING_PATCHVER:=5.15
|
||||
|
||||
KERNELNAME:=zImage
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ watchguard,firebox-m300)
|
|||
|
||||
sweth_mac_offset=0x186d
|
||||
|
||||
for sweth in /sys/class/net/sweth*; do
|
||||
for sweth in $(find /sys/class/net/ -name 'sweth*' -print); do
|
||||
device="$(basename "$sweth")"
|
||||
mac="$(mtd_get_mac_text wg_cfg0 "$sweth_mac_offset")"
|
||||
switchports="$switchports $device"
|
||||
|
|
|
@ -9,7 +9,6 @@ CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
|
|||
CONFIG_ARCH_MMAP_RND_BITS=18
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MAX=32
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MIN=18
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS=11
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=17
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
|
||||
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
|
||||
|
@ -23,18 +22,13 @@ CONFIG_BLK_DEV_SD=y
|
|||
CONFIG_BLK_MQ_PCI=y
|
||||
CONFIG_BLK_PM=y
|
||||
CONFIG_BLK_SCSI_REQUEST=y
|
||||
CONFIG_BLOCK_COMPAT=y
|
||||
CONFIG_BOOKE=y
|
||||
CONFIG_CLKDEV_LOOKUP=y
|
||||
CONFIG_CLK_QORIQ=y
|
||||
CONFIG_CLONE_BACKWARDS=y
|
||||
CONFIG_CLZ_TAB=y
|
||||
CONFIG_COMMON_CLK=y
|
||||
CONFIG_COMPAT=y
|
||||
# CONFIG_COMPAT_32BIT_TIME is not set
|
||||
CONFIG_COMPAT_BINFMT_ELF=y
|
||||
CONFIG_COMPAT_NETLINK_MESSAGES=y
|
||||
CONFIG_COMPAT_OLD_SIGACTION=y
|
||||
CONFIG_CONSOLE_TRANSLATIONS=y
|
||||
CONFIG_CORENET_GENERIC=y
|
||||
# CONFIG_CPUFREQ_DT is not set
|
||||
|
@ -169,7 +163,6 @@ CONFIG_GPIO_GENERIC=y
|
|||
CONFIG_GPIO_MPC8XXX=y
|
||||
CONFIG_GRO_CELLS=y
|
||||
# CONFIG_HANGCHECK_TIMER is not set
|
||||
# CONFIG_HARDENED_USERCOPY is not set
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HAS_IOPORT_MAP=y
|
||||
|
@ -360,7 +353,6 @@ CONFIG_SRCU=y
|
|||
CONFIG_SWIOTLB=y
|
||||
CONFIG_SWPHY=y
|
||||
CONFIG_SYSCTL_EXCEPTION_TRACE=y
|
||||
CONFIG_SYSVIPC_COMPAT=y
|
||||
CONFIG_SYS_SUPPORTS_HUGETLBFS=y
|
||||
CONFIG_TARGET_CPU_BOOL=y
|
||||
CONFIG_THERMAL=y
|
||||
|
@ -382,7 +374,6 @@ CONFIG_USB_EHCI_HCD=y
|
|||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_USB_SUPPORT=y
|
||||
CONFIG_USB_UAS=y
|
||||
CONFIG_VDSO32=y
|
||||
CONFIG_VGA_CONSOLE=y
|
||||
CONFIG_VIRT_CPU_ACCOUNTING=y
|
||||
CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y
|
||||
|
|
402
target/linux/qoriq/config-5.15
Normal file
402
target/linux/qoriq/config-5.15
Normal file
|
@ -0,0 +1,402 @@
|
|||
CONFIG_64BIT=y
|
||||
CONFIG_ALTIVEC=y
|
||||
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
|
||||
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
|
||||
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
||||
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
|
||||
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
|
||||
CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
|
||||
CONFIG_ARCH_MMAP_RND_BITS=18
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MAX=32
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MIN=18
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=17
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
|
||||
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
|
||||
CONFIG_ARCH_SPARSEMEM_ENABLE=y
|
||||
CONFIG_ARCH_STACKWALK=y
|
||||
CONFIG_ARCH_WEAK_RELEASE_ACQUIRE=y
|
||||
CONFIG_ASN1=y
|
||||
CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y
|
||||
CONFIG_AUDIT_ARCH=y
|
||||
CONFIG_BLK_DEV_LOOP=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_BLK_MQ_PCI=y
|
||||
CONFIG_BLK_PM=y
|
||||
CONFIG_BOOKE=y
|
||||
CONFIG_CLK_QORIQ=y
|
||||
CONFIG_CLONE_BACKWARDS=y
|
||||
CONFIG_CLZ_TAB=y
|
||||
CONFIG_COMMON_CLK=y
|
||||
# CONFIG_COMPAT_32BIT_TIME is not set
|
||||
CONFIG_CONSOLE_TRANSLATIONS=y
|
||||
CONFIG_CORENET_GENERIC=y
|
||||
# CONFIG_CPUFREQ_DT is not set
|
||||
CONFIG_CPU_BIG_ENDIAN=y
|
||||
CONFIG_CPU_FREQ=y
|
||||
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
|
||||
CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y
|
||||
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
|
||||
CONFIG_CPU_FREQ_GOV_COMMON=y
|
||||
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
|
||||
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
|
||||
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
|
||||
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
|
||||
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
|
||||
CONFIG_CPU_FREQ_GOV_USERSPACE=y
|
||||
# CONFIG_CPU_FREQ_STAT is not set
|
||||
CONFIG_CPU_IDLE=y
|
||||
CONFIG_CPU_IDLE_GOV_TEO=y
|
||||
CONFIG_CPU_ISOLATION=y
|
||||
CONFIG_CPU_RMAP=y
|
||||
CONFIG_CRC16=y
|
||||
CONFIG_CRYPTO_AUTHENC=y
|
||||
CONFIG_CRYPTO_CRC32=y
|
||||
CONFIG_CRYPTO_CRC32C=y
|
||||
# CONFIG_CRYPTO_CRC32C_VPMSUM is not set
|
||||
CONFIG_CRYPTO_DES=y
|
||||
CONFIG_CRYPTO_DEV_FSL_CAAM=y
|
||||
CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API=y
|
||||
CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API_DESC=y
|
||||
CONFIG_CRYPTO_DEV_FSL_CAAM_COMMON=y
|
||||
CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API=y
|
||||
CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_DESC=y
|
||||
CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI=y
|
||||
# CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG is not set
|
||||
# CONFIG_CRYPTO_DEV_FSL_CAAM_INTC is not set
|
||||
CONFIG_CRYPTO_DEV_FSL_CAAM_JR=y
|
||||
CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API=y
|
||||
CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9
|
||||
CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API=y
|
||||
# CONFIG_CRYPTO_DEV_NX is not set
|
||||
CONFIG_CRYPTO_ECB=y
|
||||
CONFIG_CRYPTO_ENGINE=y
|
||||
CONFIG_CRYPTO_HW=y
|
||||
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
||||
CONFIG_CRYPTO_LIB_DES=y
|
||||
CONFIG_CRYPTO_LIB_POLY1305_RSIZE=1
|
||||
# CONFIG_CRYPTO_MD5_PPC is not set
|
||||
CONFIG_CRYPTO_RNG=y
|
||||
CONFIG_CRYPTO_RNG2=y
|
||||
CONFIG_CRYPTO_RSA=y
|
||||
# CONFIG_CRYPTO_SHA1_PPC is not set
|
||||
CONFIG_CRYPTO_XTS=y
|
||||
CONFIG_DATA_SHIFT=12
|
||||
CONFIG_DEBUG_INFO=y
|
||||
# CONFIG_DEBUG_INFO_REDUCED is not set
|
||||
CONFIG_DEFAULT_UIMAGE=y
|
||||
CONFIG_DMADEVICES=y
|
||||
CONFIG_DMA_ENGINE=y
|
||||
CONFIG_DMA_OF=y
|
||||
CONFIG_DMA_OPS=y
|
||||
CONFIG_DMA_OPS_BYPASS=y
|
||||
CONFIG_DPAA_ERRATUM_A050385=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_DUMMY_CONSOLE=y
|
||||
CONFIG_DYNAMIC_DEBUG=y
|
||||
CONFIG_E500=y
|
||||
# CONFIG_E5500_CPU is not set
|
||||
CONFIG_E6500_CPU=y
|
||||
CONFIG_EARLY_PRINTK=y
|
||||
CONFIG_EDAC=y
|
||||
CONFIG_EDAC_ATOMIC_SCRUB=y
|
||||
# CONFIG_EDAC_CPC925 is not set
|
||||
# CONFIG_EDAC_DEBUG is not set
|
||||
CONFIG_EDAC_LEGACY_SYSFS=y
|
||||
CONFIG_EDAC_MPC85XX=y
|
||||
CONFIG_EDAC_SUPPORT=y
|
||||
CONFIG_EPAPR_PARAVIRT=y
|
||||
CONFIG_EXT4_FS=y
|
||||
CONFIG_EXT4_FS_POSIX_ACL=y
|
||||
CONFIG_F2FS_FS=y
|
||||
CONFIG_FIXED_PHY=y
|
||||
CONFIG_FORCE_MAX_ZONEORDER=13
|
||||
# CONFIG_FSL_BMAN_TEST is not set
|
||||
CONFIG_FSL_CORENET_CF=y
|
||||
CONFIG_FSL_CORENET_RCPM=y
|
||||
CONFIG_FSL_DMA=y
|
||||
CONFIG_FSL_DPAA=y
|
||||
# CONFIG_FSL_DPAA2_SWITCH is not set
|
||||
# CONFIG_FSL_DPAA_CHECKING is not set
|
||||
CONFIG_FSL_DPAA_ETH=y
|
||||
CONFIG_FSL_EMB_PERFMON=y
|
||||
CONFIG_FSL_FMAN=y
|
||||
CONFIG_FSL_GUTS=y
|
||||
CONFIG_FSL_IFC=y
|
||||
CONFIG_FSL_LBC=y
|
||||
CONFIG_FSL_MPIC_TIMER_WAKEUP=y
|
||||
CONFIG_FSL_PAMU=y
|
||||
CONFIG_FSL_PCI=y
|
||||
# CONFIG_FSL_QMAN_TEST is not set
|
||||
CONFIG_FSL_SOC=y
|
||||
CONFIG_FSL_SOC_BOOKE=y
|
||||
CONFIG_FSL_XGMAC_MDIO=y
|
||||
CONFIG_FS_IOMAP=y
|
||||
CONFIG_FS_MBCACHE=y
|
||||
CONFIG_FS_POSIX_ACL=y
|
||||
CONFIG_FTL=y
|
||||
CONFIG_FUNCTION_ERROR_INJECTION=y
|
||||
CONFIG_FWNODE_MDIO=y
|
||||
CONFIG_FW_LOADER_PAGED_BUF=y
|
||||
CONFIG_GENERIC_ALLOCATOR=y
|
||||
CONFIG_GENERIC_BUG=y
|
||||
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
|
||||
CONFIG_GENERIC_CMOS_UPDATE=y
|
||||
# CONFIG_GENERIC_CPU is not set
|
||||
CONFIG_GENERIC_CPU_AUTOPROBE=y
|
||||
CONFIG_GENERIC_CPU_VULNERABILITIES=y
|
||||
CONFIG_GENERIC_EARLY_IOREMAP=y
|
||||
CONFIG_GENERIC_GETTIMEOFDAY=y
|
||||
CONFIG_GENERIC_IRQ_MIGRATION=y
|
||||
CONFIG_GENERIC_IRQ_SHOW=y
|
||||
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
|
||||
CONFIG_GENERIC_ISA_DMA=y
|
||||
CONFIG_GENERIC_MSI_IRQ=y
|
||||
CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
|
||||
CONFIG_GENERIC_PCI_IOMAP=y
|
||||
CONFIG_GENERIC_PHY=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
# CONFIG_GEN_RTC is not set
|
||||
# CONFIG_GIANFAR is not set
|
||||
CONFIG_GLOB=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_GPIO_MPC8XXX=y
|
||||
CONFIG_GRO_CELLS=y
|
||||
# CONFIG_HANGCHECK_TIMER is not set
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HAS_IOPORT_MAP=y
|
||||
CONFIG_HWMON=y
|
||||
CONFIG_HW_CONSOLE=y
|
||||
CONFIG_HW_RANDOM=y
|
||||
CONFIG_I2C=y
|
||||
CONFIG_I2C_BOARDINFO=y
|
||||
CONFIG_I2C_MPC=y
|
||||
CONFIG_ILLEGAL_POINTER_VALUE=0x5deadbeef0000000
|
||||
CONFIG_INITRAMFS_SOURCE=""
|
||||
CONFIG_INPUT=y
|
||||
CONFIG_IOMMU_API=y
|
||||
# CONFIG_IOMMU_DEBUGFS is not set
|
||||
# CONFIG_IOMMU_DEFAULT_DMA_LAZY is not set
|
||||
CONFIG_IOMMU_DEFAULT_DMA_STRICT=y
|
||||
# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set
|
||||
CONFIG_IOMMU_HELPER=y
|
||||
CONFIG_IOMMU_SUPPORT=y
|
||||
CONFIG_IRQCHIP=y
|
||||
CONFIG_IRQ_DOMAIN=y
|
||||
CONFIG_IRQ_DOMAIN_HIERARCHY=y
|
||||
CONFIG_IRQ_FORCED_THREADING=y
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_ISA_DMA_API=y
|
||||
CONFIG_JBD2=y
|
||||
CONFIG_JUMP_LABEL=y
|
||||
CONFIG_JUMP_LABEL_FEATURE_CHECKS=y
|
||||
# CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG is not set
|
||||
CONFIG_KALLSYMS=y
|
||||
CONFIG_KERNEL_GZIP=y
|
||||
CONFIG_KERNEL_START=0xc000000000000000
|
||||
CONFIG_KPROBES=y
|
||||
CONFIG_KRETPROBES=y
|
||||
# CONFIG_LD_HEAD_STUB_CATCH is not set
|
||||
CONFIG_LIBFDT=y
|
||||
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
||||
CONFIG_LOCK_SPIN_ON_OWNER=y
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_MARVELL_PHY=y
|
||||
CONFIG_MATH_EMULATION=y
|
||||
# CONFIG_MATH_EMULATION_FULL is not set
|
||||
CONFIG_MATH_EMULATION_HW_UNIMPLEMENTED=y
|
||||
CONFIG_MDIO_BUS=y
|
||||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
CONFIG_MEMFD_CREATE=y
|
||||
CONFIG_MEMORY=y
|
||||
CONFIG_MIGRATION=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_BLOCK=y
|
||||
CONFIG_MMC_DEBUG=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_IO_ACCESSORS=y
|
||||
CONFIG_MMC_SDHCI_OF_ESDHC=y
|
||||
# CONFIG_MMC_SDHCI_PCI is not set
|
||||
CONFIG_MMC_SDHCI_PLTFM=y
|
||||
# CONFIG_MMC_WBSD is not set
|
||||
CONFIG_MMIOWB=y
|
||||
CONFIG_MMU_GATHER_PAGE_SIZE=y
|
||||
CONFIG_MODULES_USE_ELF_RELA=y
|
||||
CONFIG_MPIC=y
|
||||
CONFIG_MPIC_MSGR=y
|
||||
CONFIG_MPIC_TIMER=y
|
||||
CONFIG_MPILIB=y
|
||||
CONFIG_MTD_NAND_CORE=y
|
||||
CONFIG_MTD_NAND_ECC=y
|
||||
CONFIG_MTD_NAND_ECC_SW_HAMMING=y
|
||||
CONFIG_MTD_NAND_FSL_IFC=y
|
||||
CONFIG_MTD_PHYSMAP=y
|
||||
CONFIG_MTD_RAW_NAND=y
|
||||
CONFIG_MUTEX_SPIN_ON_OWNER=y
|
||||
CONFIG_NEED_DMA_MAP_STATE=y
|
||||
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
|
||||
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
|
||||
CONFIG_NEED_SG_DMA_LENGTH=y
|
||||
CONFIG_NET_DEVLINK=y
|
||||
CONFIG_NET_DSA=y
|
||||
CONFIG_NET_DSA_MV88E6XXX=y
|
||||
CONFIG_NET_DSA_TAG_DSA=y
|
||||
CONFIG_NET_DSA_TAG_DSA_COMMON=y
|
||||
CONFIG_NET_DSA_TAG_EDSA=y
|
||||
CONFIG_NET_DSA_TAG_OCELOT=y
|
||||
CONFIG_NET_DSA_TAG_TRAILER=y
|
||||
CONFIG_NET_FLOW_LIMIT=y
|
||||
CONFIG_NET_PTP_CLASSIFY=y
|
||||
CONFIG_NET_SELFTESTS=y
|
||||
CONFIG_NET_SWITCHDEV=y
|
||||
CONFIG_NLS=y
|
||||
CONFIG_NONSTATIC_KERNEL=y
|
||||
CONFIG_NO_HZ_COMMON=y
|
||||
CONFIG_NO_HZ_IDLE=y
|
||||
CONFIG_NR_CPUS=24
|
||||
CONFIG_NR_IRQS=512
|
||||
CONFIG_OF=y
|
||||
CONFIG_OF_ADDRESS=y
|
||||
CONFIG_OF_DMA_DEFAULT_COHERENT=y
|
||||
CONFIG_OF_EARLY_FLATTREE=y
|
||||
CONFIG_OF_FLATTREE=y
|
||||
CONFIG_OF_GPIO=y
|
||||
CONFIG_OF_IOMMU=y
|
||||
CONFIG_OF_IRQ=y
|
||||
CONFIG_OF_KOBJ=y
|
||||
CONFIG_OF_MDIO=y
|
||||
CONFIG_OLD_SIGSUSPEND=y
|
||||
CONFIG_OPTPROBES=y
|
||||
CONFIG_PACKING=y
|
||||
CONFIG_PADATA=y
|
||||
CONFIG_PAGE_OFFSET=0xc000000000000000
|
||||
CONFIG_PAHOLE_HAS_SPLIT_BTF=y
|
||||
CONFIG_PCI=y
|
||||
CONFIG_PCI_DOMAINS=y
|
||||
CONFIG_PCI_MSI=y
|
||||
CONFIG_PCI_MSI_ARCH_FALLBACKS=y
|
||||
CONFIG_PCI_MSI_IRQ_DOMAIN=y
|
||||
CONFIG_PGTABLE_LEVELS=4
|
||||
CONFIG_PHYLIB=y
|
||||
CONFIG_PHYLINK=y
|
||||
CONFIG_PHYSICAL_START=0x00000000
|
||||
CONFIG_PHYS_64BIT=y
|
||||
CONFIG_PHYS_ADDR_T_64BIT=y
|
||||
CONFIG_PM=y
|
||||
# CONFIG_PMU_SYSFS is not set
|
||||
CONFIG_PM_CLK=y
|
||||
CONFIG_PPC=y
|
||||
CONFIG_PPC64=y
|
||||
CONFIG_PPC_ADV_DEBUG_DACS=2
|
||||
CONFIG_PPC_ADV_DEBUG_DVCS=0
|
||||
CONFIG_PPC_ADV_DEBUG_IACS=2
|
||||
CONFIG_PPC_ADV_DEBUG_REGS=y
|
||||
CONFIG_PPC_BARRIER_NOSPEC=y
|
||||
CONFIG_PPC_BOOK3E=y
|
||||
CONFIG_PPC_BOOK3E_64=y
|
||||
CONFIG_PPC_BOOK3E_MMU=y
|
||||
# CONFIG_PPC_BOOK3S_64 is not set
|
||||
CONFIG_PPC_DAWR=y
|
||||
CONFIG_PPC_DOORBELL=y
|
||||
CONFIG_PPC_E500MC=y
|
||||
# CONFIG_PPC_EARLY_DEBUG is not set
|
||||
CONFIG_PPC_EPAPR_HV_PIC=y
|
||||
CONFIG_PPC_FPU=y
|
||||
CONFIG_PPC_FPU_REGS=y
|
||||
CONFIG_PPC_FSL_BOOK3E=y
|
||||
CONFIG_PPC_INDIRECT_PCI=y
|
||||
# CONFIG_PPC_IRQ_SOFT_MASK_DEBUG is not set
|
||||
CONFIG_PPC_MMU_NOHASH=y
|
||||
CONFIG_PPC_MSI_BITMAP=y
|
||||
CONFIG_PPC_OF_BOOT_TRAMPOLINE=y
|
||||
CONFIG_PPC_PAGE_SHIFT=12
|
||||
# CONFIG_PPC_QEMU_E500 is not set
|
||||
CONFIG_PPC_QUEUED_SPINLOCKS=y
|
||||
CONFIG_PPC_SMP_MUXED_IPI=y
|
||||
CONFIG_PPC_UDBG_16550=y
|
||||
CONFIG_PPC_WERROR=y
|
||||
CONFIG_PPS=y
|
||||
CONFIG_PTE_64BIT=y
|
||||
CONFIG_PTP_1588_CLOCK=y
|
||||
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
|
||||
CONFIG_PTP_1588_CLOCK_QORIQ=y
|
||||
CONFIG_QORIQ_CPUFREQ=y
|
||||
CONFIG_QORIQ_THERMAL=y
|
||||
CONFIG_QUEUED_RWLOCKS=y
|
||||
CONFIG_QUEUED_SPINLOCKS=y
|
||||
CONFIG_RAS=y
|
||||
CONFIG_RATIONAL=y
|
||||
# CONFIG_RAVE_SP_CORE is not set
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_REGMAP_MMIO=y
|
||||
CONFIG_RELOCATABLE=y
|
||||
# CONFIG_RELOCATABLE_TEST is not set
|
||||
CONFIG_RFS_ACCEL=y
|
||||
CONFIG_RPS=y
|
||||
CONFIG_RWSEM_SPIN_ON_OWNER=y
|
||||
# CONFIG_SCOM_DEBUGFS is not set
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_SCSI_COMMON=y
|
||||
CONFIG_SERIAL_8250_EXTENDED=y
|
||||
CONFIG_SERIAL_8250_FSL=y
|
||||
CONFIG_SERIAL_8250_NR_UARTS=4
|
||||
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
|
||||
CONFIG_SERIAL_8250_SHARE_IRQ=y
|
||||
CONFIG_SERIAL_DEV_BUS=y
|
||||
CONFIG_SERIAL_DEV_CTRL_TTYPORT=y
|
||||
CONFIG_SERIAL_FSL_LINFLEXUART=y
|
||||
CONFIG_SERIAL_FSL_LINFLEXUART_CONSOLE=y
|
||||
CONFIG_SERIAL_FSL_LPUART=y
|
||||
CONFIG_SERIAL_FSL_LPUART_CONSOLE=y
|
||||
CONFIG_SERIAL_MCTRL_GPIO=y
|
||||
CONFIG_SG_POOL=y
|
||||
CONFIG_SLUB_DEBUG=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_SOCK_RX_QUEUE_MAPPING=y
|
||||
CONFIG_SOC_BUS=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
|
||||
CONFIG_SPARSE_IRQ=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_SPI_FSL_ESPI=y
|
||||
CONFIG_SPI_MASTER=y
|
||||
CONFIG_SRCU=y
|
||||
CONFIG_SWIOTLB=y
|
||||
CONFIG_SWPHY=y
|
||||
CONFIG_SYSCTL_EXCEPTION_TRACE=y
|
||||
CONFIG_TARGET_CPU_BOOL=y
|
||||
CONFIG_THERMAL=y
|
||||
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
|
||||
CONFIG_THERMAL_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_OF=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
CONFIG_THREAD_SHIFT=14
|
||||
CONFIG_TREE_RCU=y
|
||||
CONFIG_TREE_SRCU=y
|
||||
# CONFIG_UACCE is not set
|
||||
# CONFIG_UCLAMP_TASK is not set
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_COMMON=y
|
||||
CONFIG_USB_EHCI_FSL=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
# CONFIG_USB_EHCI_HCD_PLATFORM is not set
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_USB_SUPPORT=y
|
||||
CONFIG_USB_UAS=y
|
||||
CONFIG_VGA_CONSOLE=y
|
||||
CONFIG_VIRT_CPU_ACCOUNTING=y
|
||||
CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y
|
||||
CONFIG_VT=y
|
||||
CONFIG_VT_CONSOLE=y
|
||||
# CONFIG_VT_HW_CONSOLE_BINDING is not set
|
||||
# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
|
||||
CONFIG_XPS=y
|
||||
CONFIG_ZLIB_DEFLATE=y
|
|
@ -7,6 +7,9 @@
|
|||
* Copyright 2020 - 2021 Stijn Tintel <stijn@linux-ipv6.be>
|
||||
*/
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
|
||||
/include/ "t208xsi-pre.dtsi"
|
||||
/include/ "t208xqds.dtsi"
|
||||
|
||||
|
@ -31,6 +34,11 @@
|
|||
ethernet2 = &enet1;
|
||||
ethernet3 = &enet2;
|
||||
ethernet4 = &enet3;
|
||||
|
||||
led-boot = &led_shield;
|
||||
led-failsafe = &led_shield;
|
||||
led-running = &led_shield;
|
||||
led-upgrade = &led_shield;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -325,4 +333,28 @@
|
|||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
reset {
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
shield-red {
|
||||
label = "red:shield";
|
||||
gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led_shield: shield-green {
|
||||
label = "green:shield";
|
||||
gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -6,7 +6,8 @@ define Device/watchguard_firebox-m300
|
|||
DEVICE_COMPAT_VERSION := 1.1
|
||||
DEVICE_DTS_DIR := $(DTS_DIR)/fsl
|
||||
DEVICE_PACKAGES := \
|
||||
kmod-hwmon-w83793 kmod-ptp-qoriq kmod-rtc-rs5c372a kmod-tpm-i2c-atmel
|
||||
kmod-gpio-button-hotplug kmod-hwmon-w83793 kmod-leds-gpio kmod-ptp-qoriq \
|
||||
kmod-rtc-rs5c372a kmod-tpm-i2c-atmel
|
||||
KERNEL := kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
||||
KERNEL_SUFFIX := -fit-uImage.itb
|
||||
IMAGES := sdcard.img.gz sysupgrade.img.gz
|
||||
|
|
173
target/linux/ramips/dts/mt7621_asus_rp-ac87.dts
Normal file
173
target/linux/ramips/dts/mt7621_asus_rp-ac87.dts
Normal file
|
@ -0,0 +1,173 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "mt7621.dtsi"
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
|
||||
/ {
|
||||
compatible = "asus,rp-ac87", "mediatek,mt7621-soc";
|
||||
model = "ASUS RP-AC87";
|
||||
|
||||
aliases {
|
||||
led-boot = &led_wps;
|
||||
led-failsafe = &led_wps;
|
||||
led-running = &led_wps;
|
||||
led-upgrade = &led_wps;
|
||||
label-mac-device = &gmac0;
|
||||
};
|
||||
|
||||
keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <KEY_RESTART>;
|
||||
};
|
||||
|
||||
wps {
|
||||
label = "wps";
|
||||
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <KEY_WPS_BUTTON>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led_wps: wps {
|
||||
label = "green:wps";
|
||||
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
rssilow-wlan0 {
|
||||
label = "green:rssilow-wlan0";
|
||||
gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
rssimedlow-wlan0 {
|
||||
label = "green:rssimedlow-wlan0";
|
||||
gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
rssimed-wlan0 {
|
||||
label = "green:rssimed-wlan0";
|
||||
gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
rssihigh-wlan0 {
|
||||
label = "green:rssihigh-wlan0";
|
||||
gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
rssilow-wlan1 {
|
||||
label = "green:rssilow-wlan1";
|
||||
gpios = <&gpio 45 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
rssimedlow-wlan1 {
|
||||
label = "green:rssimedlow-wlan1";
|
||||
gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
rssimed-wlan1 {
|
||||
label = "green:rssimed-wlan1";
|
||||
gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
rssihigh-wlan1 {
|
||||
label = "green:rssihigh-wlan1";
|
||||
gpios = <&gpio 48 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <50000000>;
|
||||
m25p,fast-read;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "u-boot";
|
||||
reg = <0x0 0x30000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@30000 {
|
||||
label = "u-boot-env";
|
||||
reg = <0x30000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
factory: partition@40000 {
|
||||
label = "factory";
|
||||
reg = <0x40000 0x10000>;
|
||||
read-only;
|
||||
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_factory_8004: macaddr@8004 {
|
||||
reg = <0x8004 0x6>;
|
||||
};
|
||||
};
|
||||
|
||||
partition@50000 {
|
||||
compatible = "denx,uimage";
|
||||
label = "firmware";
|
||||
reg = <0x50000 0xfb0000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pcie {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie0 {
|
||||
wifi@0,0 {
|
||||
compatible = "mediatek,mt76";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
mediatek,mtd-eeprom = <&factory 0x0>;
|
||||
ieee80211-freq-limit = <2400000 2500000>;
|
||||
};
|
||||
};
|
||||
|
||||
&pcie1 {
|
||||
wifi@0,0 {
|
||||
compatible = "mediatek,mt76";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
mediatek,mtd-eeprom = <&factory 0x8000>;
|
||||
ieee80211-freq-limit = <5000000 6000000>;
|
||||
};
|
||||
};
|
||||
|
||||
&gmac0 {
|
||||
nvmem-cells = <&macaddr_factory_8004>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
};
|
||||
|
||||
&switch0 {
|
||||
ports {
|
||||
port@4 {
|
||||
status = "okay";
|
||||
label = "lan";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&xhci {
|
||||
status = "disabled";
|
||||
};
|
|
@ -175,6 +175,20 @@ define Device/asiarf_ap7621-nv1
|
|||
endef
|
||||
TARGET_DEVICES += asiarf_ap7621-nv1
|
||||
|
||||
define Device/asus_rp-ac87
|
||||
$(Device/dsa-migration)
|
||||
$(Device/uimage-lzma-loader)
|
||||
IMAGE_SIZE := 16064k
|
||||
DEVICE_VENDOR := ASUS
|
||||
DEVICE_MODEL := RP-AC87
|
||||
IMAGES += factory.bin
|
||||
IMAGE/factory.bin := append-kernel | append-rootfs | pad-rootfs | check-size
|
||||
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \
|
||||
check-size | append-metadata
|
||||
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware rssileds
|
||||
endef
|
||||
TARGET_DEVICES += asus_rp-ac87
|
||||
|
||||
define Device/asus_rt-ac57u
|
||||
$(Device/dsa-migration)
|
||||
DEVICE_VENDOR := ASUS
|
||||
|
|
|
@ -116,7 +116,6 @@ CONFIG_MTD_CMDLINE_PARTS=y
|
|||
CONFIG_MTD_PHYSMAP=y
|
||||
CONFIG_MTD_SPI_NOR=y
|
||||
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
|
||||
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384
|
||||
CONFIG_MTD_SPLIT_JIMAGE_FW=y
|
||||
CONFIG_MTD_SPLIT_SEAMA_FW=y
|
||||
CONFIG_MTD_SPLIT_TPLINK_FW=y
|
||||
|
|
|
@ -7,6 +7,18 @@ board=$(board_name)
|
|||
board_config_update
|
||||
|
||||
case $board in
|
||||
asus,rp-ac87)
|
||||
ucidef_set_rssimon "wlan0" "200000" "1"
|
||||
ucidef_set_rssimon "wlan1" "200000" "1"
|
||||
ucidef_set_led_rssi "rssilow-wlan0" "RSSILOW" "green:rssilow-wlan0" "wlan0" "1" "100"
|
||||
ucidef_set_led_rssi "rssimedlow-wlan0" "RSSIMEDLOW" "green:rssimedlow-wlan0" "wlan0" "20" "100"
|
||||
ucidef_set_led_rssi "rssimed-wlan0" "RSSIMED" "green:rssimed-wlan0" "wlan0" "40" "100"
|
||||
ucidef_set_led_rssi "rssihigh-wlan0" "RSSIHIGH" "green:rssihigh-wlan0" "wlan0" "70" "100"
|
||||
ucidef_set_led_rssi "rssilow-wlan1" "RSSILOW" "green:rssilow-wlan1" "wlan1" "1" "100"
|
||||
ucidef_set_led_rssi "rssimedlow-wlan1" "RSSIMEDLOW" "green:rssimedlow-wlan1" "wlan1" "20" "100"
|
||||
ucidef_set_led_rssi "rssimed-wlan1" "RSSIMED" "green:rssimed-wlan1" "wlan1" "40" "100"
|
||||
ucidef_set_led_rssi "rssihigh-wlan1" "RSSIHIGH" "green:rssihigh-wlan1" "wlan1" "70" "100"
|
||||
;;
|
||||
asus,rt-n56u-b1)
|
||||
ucidef_set_led_netdev "lan" "LAN link" "blue:lan" "br-lan"
|
||||
ucidef_set_led_netdev "wan" "WAN link" "blue:wan" "wan"
|
||||
|
|
|
@ -9,6 +9,7 @@ ramips_setup_interfaces()
|
|||
|
||||
case $board in
|
||||
ampedwireless,ally-00x19k|\
|
||||
asus,rp-ac87|\
|
||||
edimax,re23s|\
|
||||
mikrotik,routerboard-m11g|\
|
||||
netgear,ex6150|\
|
||||
|
|
|
@ -106,7 +106,6 @@ CONFIG_MTD_CMDLINE_PARTS=y
|
|||
CONFIG_MTD_PHYSMAP=y
|
||||
CONFIG_MTD_SPI_NOR=y
|
||||
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
|
||||
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384
|
||||
CONFIG_MTD_SPLIT_JIMAGE_FW=y
|
||||
CONFIG_MTD_SPLIT_SEAMA_FW=y
|
||||
CONFIG_MTD_SPLIT_UIMAGE_FW=y
|
||||
|
|
|
@ -104,7 +104,6 @@ CONFIG_MTD_CMDLINE_PARTS=y
|
|||
CONFIG_MTD_PHYSMAP=y
|
||||
CONFIG_MTD_SPI_NOR=y
|
||||
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
|
||||
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384
|
||||
CONFIG_MTD_SPLIT_SEAMA_FW=y
|
||||
CONFIG_MTD_SPLIT_UIMAGE_FW=y
|
||||
CONFIG_NEED_DMA_MAP_STATE=y
|
||||
|
|
|
@ -6,7 +6,8 @@ include $(INCLUDE_DIR)/image.mk
|
|||
KERNEL_LOADADDR = 0x80000000
|
||||
KERNEL_ENTRY = 0x80000400
|
||||
|
||||
DEVICE_VARS += ZYXEL_VERS
|
||||
DEVICE_VARS += ZYXEL_VERS DLINK_KERNEL_PART_SIZE
|
||||
DEVICE_VARS += CAMEO_KERNEL_PART CAMEO_ROOTFS_PART CAMEO_CUSTOMER_SIGNATURE CAMEO_BOARD_VERSION
|
||||
|
||||
define Build/zyxel-vers
|
||||
( echo VERS;\
|
||||
|
@ -16,6 +17,21 @@ define Build/zyxel-vers
|
|||
done ) >> $@
|
||||
endef
|
||||
|
||||
define Build/dlink-headers
|
||||
dd if=$@ bs=$(DLINK_KERNEL_PART_SIZE) count=1 of=$@.kernel_part; \
|
||||
dd if=$@ bs=$(DLINK_KERNEL_PART_SIZE) skip=1 of=$@.rootfs_part; \
|
||||
$(SCRIPT_DIR)/cameo-imghdr.py $@.kernel_part $@.kernel_part.hex \
|
||||
"$(DEVICE_MODEL)" os $(CAMEO_KERNEL_PART) \
|
||||
$(CAMEO_CUSTOMER_SIGNATURE) \
|
||||
$(CAMEO_BOARD_VERSION) \
|
||||
$(KERNEL_LOADADDR); \
|
||||
$(SCRIPT_DIR)/cameo-imghdr.py $@.rootfs_part $@.rootfs_part.hex \
|
||||
"$(DEVICE_MODEL)" squashfs $(CAMEO_ROOTFS_PART) \
|
||||
$(CAMEO_CUSTOMER_SIGNATURE) \
|
||||
$(CAMEO_BOARD_VERSION); \
|
||||
cat $@.kernel_part.hex $@.rootfs_part.hex > $@
|
||||
endef
|
||||
|
||||
define Device/Default
|
||||
PROFILES = Default
|
||||
KERNEL := kernel-bin | append-dtb | gzip | uImage gzip
|
||||
|
|
|
@ -15,6 +15,7 @@ define Device/d-link_dgs-1210
|
|||
SOC := rtl8382
|
||||
IMAGE_SIZE := 13824k
|
||||
DEVICE_VENDOR := D-Link
|
||||
DLINK_KERNEL_PART_SIZE := 1572864
|
||||
endef
|
||||
|
||||
define Device/d-link_dgs-1210-10p
|
||||
|
@ -39,6 +40,13 @@ TARGET_DEVICES += d-link_dgs-1210-20
|
|||
define Device/d-link_dgs-1210-28
|
||||
$(Device/d-link_dgs-1210)
|
||||
DEVICE_MODEL := DGS-1210-28
|
||||
CAMEO_KERNEL_PART := 2
|
||||
CAMEO_ROOTFS_PART := 3
|
||||
CAMEO_CUSTOMER_SIGNATURE := 2
|
||||
CAMEO_BOARD_VERSION := 32
|
||||
IMAGES += factory_image1.bin
|
||||
IMAGE/factory_image1.bin := append-kernel | pad-to 64k | \
|
||||
append-rootfs | pad-rootfs | pad-to 16 | check-size | dlink-headers
|
||||
endef
|
||||
TARGET_DEVICES += d-link_dgs-1210-28
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@ PKG_RELEASE:=1
|
|||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware-utils.git
|
||||
PKG_SOURCE_DATE:=2022-04-25
|
||||
PKG_SOURCE_VERSION:=1e3d47292b2efbe2665072fa8322f44bd063be39
|
||||
PKG_MIRROR_HASH:=b1f8e89df4265fa65680a6e10bdd228aaa3dc736b0ee48e12c2debce6ab87c1b
|
||||
PKG_SOURCE_VERSION:=e609c5d751868ae823c236332c76ce3c50acdd2e
|
||||
PKG_MIRROR_HASH:=f1a5af565bff50ccc99471a2be71636ed685dd15bfb9b162be9acf8ee28033a6
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
|
Loading…
Reference in New Issue
Block a user