Merge Offcial Source
This commit is contained in:
commit
eb3b23bd4f
@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-5.10 = .104
|
||||
LINUX_KERNEL_HASH-5.10.104 = 394a9267ea8e24d0f0cfaad3439bf43abe7bcf6479dc9548e485b48a0ac562f1
|
||||
LINUX_VERSION-5.10 = .107
|
||||
LINUX_KERNEL_HASH-5.10.107 = c467c3077946370fb26c9277313b601d6c48bb557abc889f4892caf627fcdfea
|
||||
|
||||
@ -1,2 +0,0 @@
|
||||
LINUX_VERSION-5.4 = .175
|
||||
LINUX_KERNEL_HASH-5.4.175 = ac901bdffb1488d6c730ca7ab42322163dd331b240e2f06ad83d199e251a4840
|
||||
@ -116,7 +116,7 @@ define Quilt/RefreshDir
|
||||
endef
|
||||
|
||||
define Quilt/Refresh/Host
|
||||
$(call Quilt/RefreshDir,$(HOST_BUILD_DIR),$(PATCH_DIR))
|
||||
$(call Quilt/RefreshDir,$(HOST_BUILD_DIR),$(HOST_PATCH_DIR))
|
||||
endef
|
||||
|
||||
define Quilt/Refresh/Package
|
||||
|
||||
@ -126,6 +126,7 @@ extra_command "enabled" "Check if service is started on boot"
|
||||
extra_command "running" "Check if service is running"
|
||||
extra_command "status" "Service status"
|
||||
extra_command "trace" "Start with syscall trace"
|
||||
extra_command "info" "Dump procd service info"
|
||||
|
||||
. $IPKG_INSTROOT/lib/functions/procd.sh
|
||||
basescript=$(readlink "$initscript")
|
||||
@ -149,6 +150,13 @@ extra_command "enabled" "Check if service is started on boot"
|
||||
start "$@"
|
||||
}
|
||||
|
||||
info() {
|
||||
json_init
|
||||
json_add_string name "$(basename ${basescript:-$initscript})"
|
||||
json_add_boolean verbose "1"
|
||||
_procd_ubus_call list
|
||||
}
|
||||
|
||||
stop() {
|
||||
procd_lock
|
||||
stop_service "$@"
|
||||
|
||||
@ -8,26 +8,5 @@ alias ll='ls -alF --color=auto'
|
||||
[ -x /usr/bin/arp -o -x /sbin/arp ] || arp() { cat /proc/net/arp; }
|
||||
[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
|
||||
|
||||
service() {
|
||||
if [ -f "/etc/init.d/$1" ]; then
|
||||
/etc/init.d/$@
|
||||
else
|
||||
echo "Usage: service <service> [command]"
|
||||
if [ -n "$1" ]; then
|
||||
echo "Service "'"'"$1"'"'" not found, the following services are available:"
|
||||
else
|
||||
echo "The following services are available:"
|
||||
fi
|
||||
for F in /etc/init.d/* ; do
|
||||
printf "%-30s\t%10s\t%10s\n" "$F" \
|
||||
$( $($F enabled) && echo "enabled" || echo "disabled" ) \
|
||||
$( [ "$(ubus call service list "{ 'verbose': true, 'name': '$(basename $F)' }" \
|
||||
| jsonfilter -q -e "@['$(basename $F)'].instances[*].running" | uniq)" = "true" ] \
|
||||
&& echo "running" || echo "stopped" )
|
||||
done;
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
[ -n "$KSH_VERSION" -o \! -s "$HOME/.shinit" ] || . "$HOME/.shinit"
|
||||
[ -z "$KSH_VERSION" -o \! -s "$HOME/.mkshrc" ] || . "$HOME/.mkshrc"
|
||||
|
||||
@ -41,6 +41,9 @@ ruijie,rg-ew3200gx-pro)
|
||||
ubnt,unifi-6-lr-ubootmod)
|
||||
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x10000"
|
||||
;;
|
||||
xiaomi,redmi-router-ax6s)
|
||||
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x40000"
|
||||
;;
|
||||
esac
|
||||
|
||||
config_load ubootenv
|
||||
|
||||
@ -52,6 +52,7 @@ ravpower,rp-wd03)
|
||||
jcg,q20)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
|
||||
;;
|
||||
beeline,smartbox-flash|\
|
||||
linksys,ea6350-v4|\
|
||||
linksys,ea7300-v1|\
|
||||
linksys,ea7300-v2|\
|
||||
|
||||
@ -7,25 +7,24 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
UNPACK_CMD=unzip -q -p $(DL_DIR)/$(PKG_SOURCE) $(PKG_SOURCE_UNZIP) | gzip -dc | $(HOST_TAR) -C $(1) $(TAR_OPTIONS)
|
||||
|
||||
PKG_NAME:=cypress-firmware
|
||||
PKG_VERSION:=v5.4.18-2021_0527
|
||||
PKG_VERSION:=5.4.18-2021_0812
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_UNZIP:=cypress-firmware-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE:=cypress-fmac-$(PKG_VERSION).zip
|
||||
PKG_SOURCE_URL:=https://community.cypress.com/gfawx74859/attachments/gfawx74859/WiFiBluetoothLinux/1911/2/
|
||||
PKG_HASH:=6dd1fe42791cb56fa4162d0a384cdca4052a428a259200afdc1eb2caa53543aa
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/Infineon/ifx-linux-firmware/
|
||||
PKG_MIRROR_HASH:=ac882b482dd401b53cdecc6004cd2bd3d65e888c19206dcf10931a28033ada4d
|
||||
PKG_SOURCE_VERSION:=release-v$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
PKG_LICENSE_FILES:=LICENCE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/cypress-firmware-default
|
||||
SECTION:=firmware
|
||||
CATEGORY:=Firmware
|
||||
URL:=https://community.cypress.com/community/linux
|
||||
URL:=https://community.infineon.com/
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
|
||||
@ -0,0 +1,144 @@
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Wed, 15 Sep 2021 19:54:35 -0700
|
||||
Subject: [PATCH] mac80211: MBSSID support in interface handling
|
||||
|
||||
Configure multiple BSSID and enhanced multi-BSSID advertisement (EMA)
|
||||
parameters in mac80211 for AP mode.
|
||||
|
||||
For each interface, 'mbssid_tx_vif' points to the transmitting interface of
|
||||
the MBSSID set. The pointer is set to NULL if MBSSID is disabled.
|
||||
|
||||
Function ieee80211_stop() is modified to always bring down all the
|
||||
non-transmitting interfaces first and the transmitting interface last.
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
Co-developed-by: Aloka Dixit <alokad@codeaurora.org>
|
||||
Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
|
||||
Link: https://lore.kernel.org/r/20210916025437.29138-3-alokad@codeaurora.org
|
||||
[slightly change logic to be more obvious]
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/include/net/mac80211.h
|
||||
+++ b/include/net/mac80211.h
|
||||
@@ -1719,6 +1719,7 @@ enum ieee80211_offload_flags {
|
||||
* write-protected by sdata_lock and local->mtx so holding either is fine
|
||||
* for read access.
|
||||
* @color_change_color: the bss color that will be used after the change.
|
||||
+ * @mbssid_tx_vif: Pointer to the transmitting interface if MBSSID is enabled.
|
||||
*/
|
||||
struct ieee80211_vif {
|
||||
enum nl80211_iftype type;
|
||||
@@ -1750,6 +1751,8 @@ struct ieee80211_vif {
|
||||
bool color_change_active;
|
||||
u8 color_change_color;
|
||||
|
||||
+ struct ieee80211_vif *mbssid_tx_vif;
|
||||
+
|
||||
/* must be last */
|
||||
u8 drv_priv[] __aligned(sizeof(void *));
|
||||
};
|
||||
--- a/net/mac80211/cfg.c
|
||||
+++ b/net/mac80211/cfg.c
|
||||
@@ -112,6 +112,36 @@ static int ieee80211_set_mon_options(str
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int ieee80211_set_ap_mbssid_options(struct ieee80211_sub_if_data *sdata,
|
||||
+ struct cfg80211_mbssid_config params)
|
||||
+{
|
||||
+ struct ieee80211_sub_if_data *tx_sdata;
|
||||
+
|
||||
+ sdata->vif.mbssid_tx_vif = NULL;
|
||||
+ sdata->vif.bss_conf.bssid_index = 0;
|
||||
+ sdata->vif.bss_conf.nontransmitted = false;
|
||||
+ sdata->vif.bss_conf.ema_ap = false;
|
||||
+
|
||||
+ if (sdata->vif.type != NL80211_IFTYPE_AP || !params.tx_wdev)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ tx_sdata = IEEE80211_WDEV_TO_SUB_IF(params.tx_wdev);
|
||||
+ if (!tx_sdata)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ if (tx_sdata == sdata) {
|
||||
+ sdata->vif.mbssid_tx_vif = &sdata->vif;
|
||||
+ } else {
|
||||
+ sdata->vif.mbssid_tx_vif = &tx_sdata->vif;
|
||||
+ sdata->vif.bss_conf.nontransmitted = true;
|
||||
+ sdata->vif.bss_conf.bssid_index = params.index;
|
||||
+ }
|
||||
+ if (params.ema)
|
||||
+ sdata->vif.bss_conf.ema_ap = true;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static struct wireless_dev *ieee80211_add_iface(struct wiphy *wiphy,
|
||||
const char *name,
|
||||
unsigned char name_assign_type,
|
||||
@@ -1107,6 +1137,14 @@ static int ieee80211_start_ap(struct wip
|
||||
changed |= BSS_CHANGED_HE_BSS_COLOR;
|
||||
}
|
||||
|
||||
+ if (sdata->vif.type == NL80211_IFTYPE_AP &&
|
||||
+ params->mbssid_config.tx_wdev) {
|
||||
+ err = ieee80211_set_ap_mbssid_options(sdata,
|
||||
+ params->mbssid_config);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+ }
|
||||
+
|
||||
mutex_lock(&local->mtx);
|
||||
err = ieee80211_vif_use_channel(sdata, ¶ms->chandef,
|
||||
IEEE80211_CHANCTX_SHARED);
|
||||
--- a/net/mac80211/iface.c
|
||||
+++ b/net/mac80211/iface.c
|
||||
@@ -632,17 +632,46 @@ static void ieee80211_do_stop(struct iee
|
||||
ieee80211_add_virtual_monitor(local);
|
||||
}
|
||||
|
||||
+static void ieee80211_stop_mbssid(struct ieee80211_sub_if_data *sdata)
|
||||
+{
|
||||
+ struct ieee80211_sub_if_data *tx_sdata, *non_tx_sdata, *tmp_sdata;
|
||||
+ struct ieee80211_vif *tx_vif = sdata->vif.mbssid_tx_vif;
|
||||
+
|
||||
+ if (!tx_vif)
|
||||
+ return;
|
||||
+
|
||||
+ tx_sdata = vif_to_sdata(tx_vif);
|
||||
+ sdata->vif.mbssid_tx_vif = NULL;
|
||||
+
|
||||
+ list_for_each_entry_safe(non_tx_sdata, tmp_sdata,
|
||||
+ &tx_sdata->local->interfaces, list) {
|
||||
+ if (non_tx_sdata != sdata && non_tx_sdata != tx_sdata &&
|
||||
+ non_tx_sdata->vif.mbssid_tx_vif == tx_vif &&
|
||||
+ ieee80211_sdata_running(non_tx_sdata)) {
|
||||
+ non_tx_sdata->vif.mbssid_tx_vif = NULL;
|
||||
+ dev_close(non_tx_sdata->wdev.netdev);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (sdata != tx_sdata && ieee80211_sdata_running(tx_sdata)) {
|
||||
+ tx_sdata->vif.mbssid_tx_vif = NULL;
|
||||
+ dev_close(tx_sdata->wdev.netdev);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static int ieee80211_stop(struct net_device *dev)
|
||||
{
|
||||
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
|
||||
|
||||
- /* close all dependent VLAN interfaces before locking wiphy */
|
||||
+ /* close dependent VLAN and MBSSID interfaces before locking wiphy */
|
||||
if (sdata->vif.type == NL80211_IFTYPE_AP) {
|
||||
struct ieee80211_sub_if_data *vlan, *tmpsdata;
|
||||
|
||||
list_for_each_entry_safe(vlan, tmpsdata, &sdata->u.ap.vlans,
|
||||
u.vlan.list)
|
||||
dev_close(vlan->dev);
|
||||
+
|
||||
+ ieee80211_stop_mbssid(sdata);
|
||||
}
|
||||
|
||||
wiphy_lock(sdata->local->hw.wiphy);
|
||||
@ -0,0 +1,326 @@
|
||||
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Date: Thu, 24 Feb 2022 12:54:58 +0100
|
||||
Subject: [PATCH] mac80211: MBSSID beacon handling in AP mode
|
||||
|
||||
Add new fields in struct beacon_data to store all MBSSID elements.
|
||||
Generate a beacon template which includes all MBSSID elements.
|
||||
Move CSA offset to reflect the MBSSID element length.
|
||||
|
||||
Co-developed-by: Aloka Dixit <alokad@codeaurora.org>
|
||||
Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
|
||||
Co-developed-by: John Crispin <john@phrozen.org>
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Tested-by: Money Wang <money.wang@mediatek.com>
|
||||
Link: https://lore.kernel.org/r/5322db3c303f431adaf191ab31c45e151dde5465.1645702516.git.lorenzo@kernel.org
|
||||
[small cleanups]
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/include/net/mac80211.h
|
||||
+++ b/include/net/mac80211.h
|
||||
@@ -4938,12 +4938,14 @@ void ieee80211_report_low_ack(struct iee
|
||||
* @cntdwn_counter_offs: array of IEEE80211_MAX_CNTDWN_COUNTERS_NUM offsets
|
||||
* to countdown counters. This array can contain zero values which
|
||||
* should be ignored.
|
||||
+ * @mbssid_off: position of the multiple bssid element
|
||||
*/
|
||||
struct ieee80211_mutable_offsets {
|
||||
u16 tim_offset;
|
||||
u16 tim_length;
|
||||
|
||||
u16 cntdwn_counter_offs[IEEE80211_MAX_CNTDWN_COUNTERS_NUM];
|
||||
+ u16 mbssid_off;
|
||||
};
|
||||
|
||||
/**
|
||||
--- a/net/mac80211/cfg.c
|
||||
+++ b/net/mac80211/cfg.c
|
||||
@@ -989,11 +989,29 @@ static int ieee80211_set_ftm_responder_p
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int
|
||||
+ieee80211_copy_mbssid_beacon(u8 *pos, struct cfg80211_mbssid_elems *dst,
|
||||
+ struct cfg80211_mbssid_elems *src)
|
||||
+{
|
||||
+ int i, offset = 0;
|
||||
+
|
||||
+ for (i = 0; i < src->cnt; i++) {
|
||||
+ memcpy(pos + offset, src->elem[i].data, src->elem[i].len);
|
||||
+ dst->elem[i].len = src->elem[i].len;
|
||||
+ dst->elem[i].data = pos + offset;
|
||||
+ offset += dst->elem[i].len;
|
||||
+ }
|
||||
+ dst->cnt = src->cnt;
|
||||
+
|
||||
+ return offset;
|
||||
+}
|
||||
+
|
||||
static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
|
||||
struct cfg80211_beacon_data *params,
|
||||
const struct ieee80211_csa_settings *csa,
|
||||
const struct ieee80211_color_change_settings *cca)
|
||||
{
|
||||
+ struct cfg80211_mbssid_elems *mbssid = NULL;
|
||||
struct beacon_data *new, *old;
|
||||
int new_head_len, new_tail_len;
|
||||
int size, err;
|
||||
@@ -1021,6 +1039,17 @@ static int ieee80211_assign_beacon(struc
|
||||
|
||||
size = sizeof(*new) + new_head_len + new_tail_len;
|
||||
|
||||
+ /* new or old multiple BSSID elements? */
|
||||
+ if (params->mbssid_ies) {
|
||||
+ mbssid = params->mbssid_ies;
|
||||
+ size += struct_size(new->mbssid_ies, elem, mbssid->cnt);
|
||||
+ size += ieee80211_get_mbssid_beacon_len(mbssid);
|
||||
+ } else if (old && old->mbssid_ies) {
|
||||
+ mbssid = old->mbssid_ies;
|
||||
+ size += struct_size(new->mbssid_ies, elem, mbssid->cnt);
|
||||
+ size += ieee80211_get_mbssid_beacon_len(mbssid);
|
||||
+ }
|
||||
+
|
||||
new = kzalloc(size, GFP_KERNEL);
|
||||
if (!new)
|
||||
return -ENOMEM;
|
||||
@@ -1029,12 +1058,20 @@ static int ieee80211_assign_beacon(struc
|
||||
|
||||
/*
|
||||
* pointers go into the block we allocated,
|
||||
- * memory is | beacon_data | head | tail |
|
||||
+ * memory is | beacon_data | head | tail | mbssid_ies
|
||||
*/
|
||||
new->head = ((u8 *) new) + sizeof(*new);
|
||||
new->tail = new->head + new_head_len;
|
||||
new->head_len = new_head_len;
|
||||
new->tail_len = new_tail_len;
|
||||
+ /* copy in optional mbssid_ies */
|
||||
+ if (mbssid) {
|
||||
+ u8 *pos = new->tail + new->tail_len;
|
||||
+
|
||||
+ new->mbssid_ies = (void *)pos;
|
||||
+ pos += struct_size(new->mbssid_ies, elem, mbssid->cnt);
|
||||
+ ieee80211_copy_mbssid_beacon(pos, new->mbssid_ies, mbssid);
|
||||
+ }
|
||||
|
||||
if (csa) {
|
||||
new->cntdwn_current_counter = csa->count;
|
||||
@@ -1329,8 +1366,11 @@ static int ieee80211_stop_ap(struct wiph
|
||||
|
||||
mutex_unlock(&local->mtx);
|
||||
|
||||
- kfree(sdata->u.ap.next_beacon);
|
||||
- sdata->u.ap.next_beacon = NULL;
|
||||
+ if (sdata->u.ap.next_beacon) {
|
||||
+ kfree(sdata->u.ap.next_beacon->mbssid_ies);
|
||||
+ kfree(sdata->u.ap.next_beacon);
|
||||
+ sdata->u.ap.next_beacon = NULL;
|
||||
+ }
|
||||
|
||||
/* turn off carrier for this interface and dependent VLANs */
|
||||
list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list)
|
||||
@@ -3126,12 +3166,24 @@ cfg80211_beacon_dup(struct cfg80211_beac
|
||||
|
||||
len = beacon->head_len + beacon->tail_len + beacon->beacon_ies_len +
|
||||
beacon->proberesp_ies_len + beacon->assocresp_ies_len +
|
||||
- beacon->probe_resp_len + beacon->lci_len + beacon->civicloc_len;
|
||||
+ beacon->probe_resp_len + beacon->lci_len + beacon->civicloc_len +
|
||||
+ ieee80211_get_mbssid_beacon_len(beacon->mbssid_ies);
|
||||
|
||||
new_beacon = kzalloc(sizeof(*new_beacon) + len, GFP_KERNEL);
|
||||
if (!new_beacon)
|
||||
return NULL;
|
||||
|
||||
+ if (beacon->mbssid_ies && beacon->mbssid_ies->cnt) {
|
||||
+ new_beacon->mbssid_ies =
|
||||
+ kzalloc(struct_size(new_beacon->mbssid_ies,
|
||||
+ elem, beacon->mbssid_ies->cnt),
|
||||
+ GFP_KERNEL);
|
||||
+ if (!new_beacon->mbssid_ies) {
|
||||
+ kfree(new_beacon);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
pos = (u8 *)(new_beacon + 1);
|
||||
if (beacon->head_len) {
|
||||
new_beacon->head_len = beacon->head_len;
|
||||
@@ -3169,6 +3221,10 @@ cfg80211_beacon_dup(struct cfg80211_beac
|
||||
memcpy(pos, beacon->probe_resp, beacon->probe_resp_len);
|
||||
pos += beacon->probe_resp_len;
|
||||
}
|
||||
+ if (beacon->mbssid_ies && beacon->mbssid_ies->cnt)
|
||||
+ pos += ieee80211_copy_mbssid_beacon(pos,
|
||||
+ new_beacon->mbssid_ies,
|
||||
+ beacon->mbssid_ies);
|
||||
|
||||
/* might copy -1, meaning no changes requested */
|
||||
new_beacon->ftm_responder = beacon->ftm_responder;
|
||||
@@ -3206,8 +3262,11 @@ static int ieee80211_set_after_csa_beaco
|
||||
case NL80211_IFTYPE_AP:
|
||||
err = ieee80211_assign_beacon(sdata, sdata->u.ap.next_beacon,
|
||||
NULL, NULL);
|
||||
- kfree(sdata->u.ap.next_beacon);
|
||||
- sdata->u.ap.next_beacon = NULL;
|
||||
+ if (sdata->u.ap.next_beacon) {
|
||||
+ kfree(sdata->u.ap.next_beacon->mbssid_ies);
|
||||
+ kfree(sdata->u.ap.next_beacon);
|
||||
+ sdata->u.ap.next_beacon = NULL;
|
||||
+ }
|
||||
|
||||
if (err < 0)
|
||||
return err;
|
||||
@@ -3362,8 +3421,12 @@ static int ieee80211_set_csa_beacon(stru
|
||||
if ((params->n_counter_offsets_beacon >
|
||||
IEEE80211_MAX_CNTDWN_COUNTERS_NUM) ||
|
||||
(params->n_counter_offsets_presp >
|
||||
- IEEE80211_MAX_CNTDWN_COUNTERS_NUM))
|
||||
+ IEEE80211_MAX_CNTDWN_COUNTERS_NUM)) {
|
||||
+ kfree(sdata->u.ap.next_beacon->mbssid_ies);
|
||||
+ kfree(sdata->u.ap.next_beacon);
|
||||
+ sdata->u.ap.next_beacon = NULL;
|
||||
return -EINVAL;
|
||||
+ }
|
||||
|
||||
csa.counter_offsets_beacon = params->counter_offsets_beacon;
|
||||
csa.counter_offsets_presp = params->counter_offsets_presp;
|
||||
@@ -3373,7 +3436,9 @@ static int ieee80211_set_csa_beacon(stru
|
||||
|
||||
err = ieee80211_assign_beacon(sdata, ¶ms->beacon_csa, &csa, NULL);
|
||||
if (err < 0) {
|
||||
+ kfree(sdata->u.ap.next_beacon->mbssid_ies);
|
||||
kfree(sdata->u.ap.next_beacon);
|
||||
+ sdata->u.ap.next_beacon = NULL;
|
||||
return err;
|
||||
}
|
||||
*changed |= err;
|
||||
@@ -3463,8 +3528,11 @@ static int ieee80211_set_csa_beacon(stru
|
||||
static void ieee80211_color_change_abort(struct ieee80211_sub_if_data *sdata)
|
||||
{
|
||||
sdata->vif.color_change_active = false;
|
||||
- kfree(sdata->u.ap.next_beacon);
|
||||
- sdata->u.ap.next_beacon = NULL;
|
||||
+ if (sdata->u.ap.next_beacon) {
|
||||
+ kfree(sdata->u.ap.next_beacon->mbssid_ies);
|
||||
+ kfree(sdata->u.ap.next_beacon);
|
||||
+ sdata->u.ap.next_beacon = NULL;
|
||||
+ }
|
||||
|
||||
cfg80211_color_change_aborted_notify(sdata->dev);
|
||||
}
|
||||
@@ -4202,8 +4270,11 @@ ieee80211_set_after_color_change_beacon(
|
||||
|
||||
ret = ieee80211_assign_beacon(sdata, sdata->u.ap.next_beacon,
|
||||
NULL, NULL);
|
||||
- kfree(sdata->u.ap.next_beacon);
|
||||
- sdata->u.ap.next_beacon = NULL;
|
||||
+ if (sdata->u.ap.next_beacon) {
|
||||
+ kfree(sdata->u.ap.next_beacon->mbssid_ies);
|
||||
+ kfree(sdata->u.ap.next_beacon);
|
||||
+ sdata->u.ap.next_beacon = NULL;
|
||||
+ }
|
||||
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
@@ -4246,7 +4317,11 @@ ieee80211_set_color_change_beacon(struct
|
||||
err = ieee80211_assign_beacon(sdata, ¶ms->beacon_color_change,
|
||||
NULL, &color_change);
|
||||
if (err < 0) {
|
||||
- kfree(sdata->u.ap.next_beacon);
|
||||
+ if (sdata->u.ap.next_beacon) {
|
||||
+ kfree(sdata->u.ap.next_beacon->mbssid_ies);
|
||||
+ kfree(sdata->u.ap.next_beacon);
|
||||
+ sdata->u.ap.next_beacon = NULL;
|
||||
+ }
|
||||
return err;
|
||||
}
|
||||
*changed |= err;
|
||||
--- a/net/mac80211/ieee80211_i.h
|
||||
+++ b/net/mac80211/ieee80211_i.h
|
||||
@@ -261,6 +261,7 @@ struct beacon_data {
|
||||
struct ieee80211_meshconf_ie *meshconf;
|
||||
u16 cntdwn_counter_offsets[IEEE80211_MAX_CNTDWN_COUNTERS_NUM];
|
||||
u8 cntdwn_current_counter;
|
||||
+ struct cfg80211_mbssid_elems *mbssid_ies;
|
||||
struct rcu_head rcu_head;
|
||||
};
|
||||
|
||||
@@ -1063,6 +1064,20 @@ ieee80211_vif_get_shift(struct ieee80211
|
||||
return shift;
|
||||
}
|
||||
|
||||
+static inline int
|
||||
+ieee80211_get_mbssid_beacon_len(struct cfg80211_mbssid_elems *elems)
|
||||
+{
|
||||
+ int i, len = 0;
|
||||
+
|
||||
+ if (!elems)
|
||||
+ return 0;
|
||||
+
|
||||
+ for (i = 0; i < elems->cnt; i++)
|
||||
+ len += elems->elem[i].len;
|
||||
+
|
||||
+ return len;
|
||||
+}
|
||||
+
|
||||
enum {
|
||||
IEEE80211_RX_MSG = 1,
|
||||
IEEE80211_TX_STATUS_MSG = 2,
|
||||
--- a/net/mac80211/tx.c
|
||||
+++ b/net/mac80211/tx.c
|
||||
@@ -5041,6 +5041,19 @@ ieee80211_beacon_get_finish(struct ieee8
|
||||
IEEE80211_TX_CTL_FIRST_FRAGMENT;
|
||||
}
|
||||
|
||||
+static void
|
||||
+ieee80211_beacon_add_mbssid(struct sk_buff *skb, struct beacon_data *beacon)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ if (!beacon->mbssid_ies)
|
||||
+ return;
|
||||
+
|
||||
+ for (i = 0; i < beacon->mbssid_ies->cnt; i++)
|
||||
+ skb_put_data(skb, beacon->mbssid_ies->elem[i].data,
|
||||
+ beacon->mbssid_ies->elem[i].len);
|
||||
+}
|
||||
+
|
||||
static struct sk_buff *
|
||||
ieee80211_beacon_get_ap(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif,
|
||||
@@ -5054,6 +5067,7 @@ ieee80211_beacon_get_ap(struct ieee80211
|
||||
struct ieee80211_if_ap *ap = &sdata->u.ap;
|
||||
struct sk_buff *skb = NULL;
|
||||
u16 csa_off_base = 0;
|
||||
+ int mbssid_len;
|
||||
|
||||
if (beacon->cntdwn_counter_offsets[0]) {
|
||||
if (!is_template)
|
||||
@@ -5063,11 +5077,12 @@ ieee80211_beacon_get_ap(struct ieee80211
|
||||
}
|
||||
|
||||
/* headroom, head length,
|
||||
- * tail length and maximum TIM length
|
||||
+ * tail length, maximum TIM length and multiple BSSID length
|
||||
*/
|
||||
+ mbssid_len = ieee80211_get_mbssid_beacon_len(beacon->mbssid_ies);
|
||||
skb = dev_alloc_skb(local->tx_headroom + beacon->head_len +
|
||||
beacon->tail_len + 256 +
|
||||
- local->hw.extra_beacon_tailroom);
|
||||
+ local->hw.extra_beacon_tailroom + mbssid_len);
|
||||
if (!skb)
|
||||
return NULL;
|
||||
|
||||
@@ -5081,6 +5096,11 @@ ieee80211_beacon_get_ap(struct ieee80211
|
||||
offs->tim_length = skb->len - beacon->head_len;
|
||||
offs->cntdwn_counter_offs[0] = beacon->cntdwn_counter_offsets[0];
|
||||
|
||||
+ if (mbssid_len) {
|
||||
+ ieee80211_beacon_add_mbssid(skb, beacon);
|
||||
+ offs->mbssid_off = skb->len - mbssid_len;
|
||||
+ }
|
||||
+
|
||||
/* for AP the csa offsets are from tail */
|
||||
csa_off_base = skb->len;
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Thu, 24 Feb 2022 12:54:59 +0100
|
||||
Subject: [PATCH] mac80211: MBSSID channel switch
|
||||
|
||||
Trigger ieee80211_csa_finish() on the non-transmitting interfaces
|
||||
when channel switch concludes on the transmitting interface.
|
||||
|
||||
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Co-developed-by: Aloka Dixit <alokad@codeaurora.org>
|
||||
Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
Link: https://lore.kernel.org/r/6fde4d7f9fa387494f46a7aa4a584478dcda06f1.1645702516.git.lorenzo@kernel.org
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/net/mac80211/cfg.c
|
||||
+++ b/net/mac80211/cfg.c
|
||||
@@ -3247,9 +3247,31 @@ cfg80211_beacon_dup(struct cfg80211_beac
|
||||
void ieee80211_csa_finish(struct ieee80211_vif *vif)
|
||||
{
|
||||
struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
|
||||
+ struct ieee80211_local *local = sdata->local;
|
||||
|
||||
- ieee80211_queue_work(&sdata->local->hw,
|
||||
- &sdata->csa_finalize_work);
|
||||
+ rcu_read_lock();
|
||||
+
|
||||
+ if (vif->mbssid_tx_vif == vif) {
|
||||
+ /* Trigger ieee80211_csa_finish() on the non-transmitting
|
||||
+ * interfaces when channel switch is received on
|
||||
+ * transmitting interface
|
||||
+ */
|
||||
+ struct ieee80211_sub_if_data *iter;
|
||||
+
|
||||
+ list_for_each_entry_rcu(iter, &local->interfaces, list) {
|
||||
+ if (!ieee80211_sdata_running(iter))
|
||||
+ continue;
|
||||
+
|
||||
+ if (iter == sdata || iter->vif.mbssid_tx_vif != vif)
|
||||
+ continue;
|
||||
+
|
||||
+ ieee80211_queue_work(&iter->local->hw,
|
||||
+ &iter->csa_finalize_work);
|
||||
+ }
|
||||
+ }
|
||||
+ ieee80211_queue_work(&local->hw, &sdata->csa_finalize_work);
|
||||
+
|
||||
+ rcu_read_unlock();
|
||||
}
|
||||
EXPORT_SYMBOL(ieee80211_csa_finish);
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Date: Thu, 24 Feb 2022 12:55:00 +0100
|
||||
Subject: [PATCH] mac80211: update bssid_indicator in
|
||||
ieee80211_assign_beacon
|
||||
|
||||
Update bssid_indicator in ieee80211_bss_conf according to the
|
||||
number of bssid in the set.
|
||||
|
||||
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Link: https://lore.kernel.org/r/f92317e002fca9933f05a445fcefb4f53291d601.1645702516.git.lorenzo@kernel.org
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/net/mac80211/cfg.c
|
||||
+++ b/net/mac80211/cfg.c
|
||||
@@ -1071,6 +1071,9 @@ static int ieee80211_assign_beacon(struc
|
||||
new->mbssid_ies = (void *)pos;
|
||||
pos += struct_size(new->mbssid_ies, elem, mbssid->cnt);
|
||||
ieee80211_copy_mbssid_beacon(pos, new->mbssid_ies, mbssid);
|
||||
+ /* update bssid_indicator */
|
||||
+ sdata->vif.bss_conf.bssid_indicator =
|
||||
+ ilog2(__roundup_pow_of_two(mbssid->cnt + 1));
|
||||
}
|
||||
|
||||
if (csa) {
|
||||
@ -57,7 +57,7 @@
|
||||
__NL80211_ATTR_AFTER_LAST,
|
||||
--- a/net/mac80211/cfg.c
|
||||
+++ b/net/mac80211/cfg.c
|
||||
@@ -2764,6 +2764,19 @@ static int ieee80211_get_tx_power(struct
|
||||
@@ -2845,6 +2845,19 @@ static int ieee80211_get_tx_power(struct
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@
|
||||
static void ieee80211_rfkill_poll(struct wiphy *wiphy)
|
||||
{
|
||||
struct ieee80211_local *local = wiphy_priv(wiphy);
|
||||
@@ -4411,6 +4424,7 @@ const struct cfg80211_ops mac80211_confi
|
||||
@@ -4549,6 +4562,7 @@ const struct cfg80211_ops mac80211_confi
|
||||
.set_wiphy_params = ieee80211_set_wiphy_params,
|
||||
.set_tx_power = ieee80211_set_tx_power,
|
||||
.get_tx_power = ieee80211_get_tx_power,
|
||||
@ -87,7 +87,7 @@
|
||||
CFG80211_TESTMODE_DUMP(ieee80211_testmode_dump)
|
||||
--- a/net/mac80211/ieee80211_i.h
|
||||
+++ b/net/mac80211/ieee80211_i.h
|
||||
@@ -1429,6 +1429,7 @@ struct ieee80211_local {
|
||||
@@ -1444,6 +1444,7 @@ struct ieee80211_local {
|
||||
int dynamic_ps_forced_timeout;
|
||||
|
||||
int user_power_level; /* in dBm, for all interfaces */
|
||||
@ -137,10 +137,11 @@
|
||||
};
|
||||
|
||||
/* policy for the key attributes */
|
||||
@@ -3375,6 +3376,22 @@ static int nl80211_set_wiphy(struct sk_b
|
||||
@@ -3374,6 +3375,22 @@ static int nl80211_set_wiphy(struct sk_b
|
||||
if (result)
|
||||
goto out;
|
||||
}
|
||||
|
||||
+
|
||||
+ if (info->attrs[NL80211_ATTR_WIPHY_ANTENNA_GAIN]) {
|
||||
+ int idx, dbi = 0;
|
||||
+
|
||||
@ -156,7 +157,6 @@
|
||||
+ if (result)
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
|
||||
if (info->attrs[NL80211_ATTR_WIPHY_TX_POWER_SETTING]) {
|
||||
struct wireless_dev *txp_wdev = wdev;
|
||||
enum nl80211_tx_power_setting type;
|
||||
|
||||
@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ncurses
|
||||
PKG_VERSION:=6.2
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=6.3
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
|
||||
PKG_HASH:=30306e0c76e0f9f1f0de987cf1c82a5c21e1ce6568b9227f7da5b71cbea86c9d
|
||||
PKG_HASH:=97fc51ac2b085d4cde31ef4d2c3122c21abc217e9090a43a30fc5ec21684e059
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=README
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/misc/terminfo.src
|
||||
+++ b/misc/terminfo.src
|
||||
@@ -6145,6 +6145,172 @@ rxvt-cygwin-native|rxvt terminal emulato
|
||||
@@ -6616,6 +6616,172 @@ rxvt-cygwin-native|rxvt terminal emulato
|
||||
rxvt-16color|rxvt with 16 colors like aixterm,
|
||||
ncv#32, use=ibm+16color, use=rxvt,
|
||||
|
||||
|
||||
@ -1,22 +1,22 @@
|
||||
--- a/misc/terminfo.src
|
||||
+++ b/misc/terminfo.src
|
||||
@@ -4513,6 +4513,7 @@ xterm-xfree86|xterm terminal emulator (X
|
||||
@@ -4815,6 +4815,7 @@ xterm+nofkeys|building block for xterm f
|
||||
# This version reflects the current xterm features.
|
||||
xterm-new|modern xterm terminal emulator,
|
||||
npc,
|
||||
+ kbs=\177,
|
||||
kcbt=\E[Z, kent=\EOM, use=ecma+index, use=ansi+rep,
|
||||
use=ecma+strikeout, use=xterm+keypad, use=vt420+lrmm,
|
||||
use=xterm+sm+1006, use=xterm+pcfkeys, use=xterm+tmux,
|
||||
@@ -5943,6 +5944,7 @@ mlterm-256color|mlterm 3.0 with xterm 25
|
||||
kcbt=\E[Z, kent=\EOM, nel=\EE, use=ecma+index,
|
||||
use=ansi+rep, use=ecma+strikeout, use=xterm+pcfkeys,
|
||||
use=xterm+nofkeys,
|
||||
@@ -6416,6 +6417,7 @@ mlterm-256color|mlterm 3.0 with xterm 25
|
||||
rxvt-basic|rxvt terminal base (X Window System),
|
||||
OTbs, am, bce, eo, mir, msgr, xenl, xon, XT,
|
||||
cols#80, it#8, lines#24,
|
||||
+ kbs=\177,
|
||||
acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
|
||||
bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l,
|
||||
clear=\E[H\E[2J, cnorm=\E[?25h, cr=\r,
|
||||
@@ -5953,7 +5955,7 @@ rxvt-basic|rxvt terminal base (X Window
|
||||
bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[2J, cr=\r,
|
||||
csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
|
||||
@@ -6425,7 +6427,7 @@ rxvt-basic|rxvt terminal base (X Window
|
||||
enacs=\E(B\E)0, flash=\E[?5h$<100/>\E[?5l, home=\E[H,
|
||||
ht=^I, hts=\EH, ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L,
|
||||
ind=\n, is1=\E[?47l\E=\E[?1l,
|
||||
@ -25,7 +25,7 @@
|
||||
kcbt=\E[Z, kmous=\E[M, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O,
|
||||
rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E>, rmso=\E[27m,
|
||||
rmul=\E[24m,
|
||||
@@ -7454,6 +7456,7 @@ dumb-emacs-ansi|Emacs dumb terminal with
|
||||
@@ -8060,6 +8062,7 @@ dumb-emacs-ansi|Emacs dumb terminal with
|
||||
screen|VT 100/ANSI X3.64 virtual terminal,
|
||||
OTbs, OTpt, am, km, mir, msgr, xenl, G0,
|
||||
colors#8, cols#80, it#8, lines#24, ncv@, pairs#64, U8#1,
|
||||
@ -33,16 +33,16 @@
|
||||
acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxy
|
||||
yzz{{||}}~~,
|
||||
bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
|
||||
@@ -7465,7 +7468,7 @@ screen|VT 100/ANSI X3.64 virtual termina
|
||||
@@ -8071,7 +8074,7 @@ screen|VT 100/ANSI X3.64 virtual termina
|
||||
dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K,
|
||||
enacs=\E(B\E)0, flash=\Eg, home=\E[H, hpa=\E[%i%p1%dG,
|
||||
ht=^I, hts=\EH, ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L,
|
||||
- ind=\n, indn=\E[%p1%dS, is2=\E)0, kbs=^H, kcbt=\E[Z,
|
||||
+ ind=\n, indn=\E[%p1%dS, is2=\E)0, kcbt=\E[Z,
|
||||
kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
|
||||
kdch1=\E[3~, kend=\E[4~, kf1=\EOP, kf10=\E[21~,
|
||||
kf11=\E[23~, kf12=\E[24~, kf2=\EOQ, kf3=\EOR, kf4=\EOS,
|
||||
@@ -7594,6 +7597,7 @@ screen.xterm-r6|screen customized for X1
|
||||
kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kf1=\EOP,
|
||||
kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf2=\EOQ, kf3=\EOR,
|
||||
kf4=\EOS, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~,
|
||||
@@ -8199,6 +8202,7 @@ screen.xterm-r6|screen customized for X1
|
||||
# on Solaris because Sun's curses implementation gets confused.
|
||||
screen.teraterm|disable ncv in teraterm,
|
||||
ncv#127,
|
||||
|
||||
@ -15,7 +15,7 @@ Subject: [PATCH] ncurses 5.9 - patch 20141206
|
||||
|
||||
--- a/ncurses/base/MKlib_gen.sh
|
||||
+++ b/ncurses/base/MKlib_gen.sh
|
||||
@@ -502,11 +502,22 @@ sed -n -f $ED1 \
|
||||
@@ -511,11 +511,22 @@ sed -n -f $ED1 \
|
||||
-e 's/gen_$//' \
|
||||
-e 's/ / /g' >>$TMP
|
||||
|
||||
@ -39,6 +39,6 @@ Subject: [PATCH] ncurses 5.9 - patch 20141206
|
||||
- -e 's/^ //' \
|
||||
- -e 's/_Bool/NCURSES_BOOL/g' \
|
||||
+| sed -f $ED1 \
|
||||
| $AWK -f $AW2 \
|
||||
| "$AWK" -f $AW2 \
|
||||
| sed -f $ED3 \
|
||||
| sed \
|
||||
|
||||
@ -1,22 +1,22 @@
|
||||
--- a/aclocal.m4
|
||||
+++ b/aclocal.m4
|
||||
@@ -454,7 +454,7 @@ AC_REQUIRE([CF_PROG_AR])
|
||||
@@ -505,7 +505,7 @@ AC_CACHE_CHECK(for options to update arc
|
||||
;;
|
||||
(*)
|
||||
cf_cv_ar_flags=unknown
|
||||
- for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
|
||||
+ for cf_ar_flags in -curvD -curv curv -crv crv -cqv cqv -rv rv
|
||||
do
|
||||
|
||||
AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[
|
||||
cf_cv_ar_flags=unknown
|
||||
- for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
|
||||
+ for cf_ar_flags in -curvD -curv curv -crv crv -cqv cqv -rv rv
|
||||
do
|
||||
|
||||
# check if $ARFLAGS already contains this choice
|
||||
# check if $ARFLAGS already contains this choice
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -4751,7 +4751,7 @@ if test "${cf_cv_ar_flags+set}" = set; t
|
||||
else
|
||||
@@ -5072,7 +5072,7 @@ else
|
||||
;;
|
||||
(*)
|
||||
cf_cv_ar_flags=unknown
|
||||
- for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
|
||||
+ for cf_ar_flags in -curvD -curv curv -crv crv -cqv cqv -rv rv
|
||||
do
|
||||
|
||||
cf_cv_ar_flags=unknown
|
||||
- for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
|
||||
+ for cf_ar_flags in -curvD -curv curv -crv crv -cqv cqv -rv rv
|
||||
do
|
||||
|
||||
# check if $ARFLAGS already contains this choice
|
||||
# check if $ARFLAGS already contains this choice
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/misc/terminfo.src
|
||||
+++ b/misc/terminfo.src
|
||||
@@ -5802,12 +5802,11 @@ konsole-xf3x|KDE console window with key
|
||||
@@ -6240,12 +6240,11 @@ konsole-xf3x|KDE console window with key
|
||||
# The value for kbs (see konsole-vt100) reflects local customization rather
|
||||
# than the settings used for XFree86 xterm.
|
||||
konsole-xf4x|KDE console window with keyboard for XFree86 4.x xterm,
|
||||
|
||||
@ -34,6 +34,8 @@ define Package/qosify
|
||||
DEPENDS:=+libbpf +libubox +libubus +kmod-sched-cake +kmod-sched-bpf +kmod-ifb +tc-full $(BPF_DEPENDS)
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += -Wno-error=deprecated-declarations
|
||||
|
||||
define Build/Compile
|
||||
$(call CompileBPF,$(PKG_BUILD_DIR)/qosify-bpf.c)
|
||||
$(Build/Compile/Default)
|
||||
|
||||
@ -19,22 +19,25 @@ PKG_LICENSE:=GPL-2.0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/arptables
|
||||
define Package/arptables-legacy
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Firewall
|
||||
TITLE:=ARP firewalling software
|
||||
DEPENDS:=+kmod-arptables
|
||||
URL:=https://git.netfilter.org/arptables/
|
||||
PROVIDES:=arptables
|
||||
ALTERNATIVES:=\
|
||||
200:/usr/sbin/arptables:/usr/sbin/arptables-legacy
|
||||
endef
|
||||
|
||||
MAKE_FLAGS += \
|
||||
COPT_FLAGS="$(TARGET_CFLAGS) -D__OPTIMIZE__=1" \
|
||||
KERNEL_DIR="$(LINUX_DIR)"
|
||||
|
||||
define Package/arptables/install
|
||||
define Package/arptables-legacy/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/arptables $(1)/usr/sbin/arptables-legacy
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,arptables))
|
||||
$(eval $(call BuildPackage,arptables-legacy))
|
||||
|
||||
@ -8,12 +8,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bpftools
|
||||
PKG_VERSION:=5.11.16
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=linux-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/kernel/v5.x
|
||||
PKG_HASH:=21163681d130cbce5a6be39019e2c69e44f284855ddd70b1a3bd039249540f43
|
||||
PKG_SOURCE_URL:=https://github.com/libbpf/bpftool
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2022-03-08
|
||||
PKG_SOURCE_VERSION:=04c465fd1f561f67796dc68bbfe1aa7cfa956c3c
|
||||
PKG_MIRROR_HASH:=e22a954cd186f43228a96586bbdc120b11e6c87360ab88ae96ba37afb9c7cb58
|
||||
PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
|
||||
|
||||
PKG_MAINTAINER:=Tony Ambardar <itugrok@yahoo.com>
|
||||
|
||||
@ -21,16 +23,6 @@ PKG_USE_MIPS16:=0
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
LINUX_VERSION:=$(PKG_VERSION)
|
||||
LINUX_TLD:=linux-$(LINUX_VERSION)
|
||||
|
||||
BPF_FILES:= \
|
||||
kernel/bpf scripts tools/Makefile tools/bpf tools/perf/perf-sys.h \
|
||||
tools/arch tools/build tools/include tools/lib tools/scripts
|
||||
TAR_OPTIONS+= \
|
||||
--transform="s;$(LINUX_TLD)/;$(PKG_NAME)-$(PKG_VERSION)/;" \
|
||||
$(addprefix $(LINUX_TLD)/,$(BPF_FILES))
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
@ -77,7 +69,7 @@ define Package/libbpf
|
||||
TITLE:=libbpf - eBPF helper library
|
||||
VARIANT:=lib
|
||||
LICENSE:=LGPL-2.1 OR BSD-2-Clause
|
||||
ABI_VERSION:=0
|
||||
ABI_VERSION:=$(PKG_ABI_VERSION)
|
||||
URL:=http://www.kernel.org
|
||||
DEPENDS:=+libelf
|
||||
endef
|
||||
@ -93,55 +85,43 @@ ifneq ($(BUILD_VARIANT),lib)
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),full)
|
||||
full:=1
|
||||
else
|
||||
full:=0
|
||||
endif
|
||||
|
||||
MAKE_VARS = \
|
||||
EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)"
|
||||
|
||||
MAKE_FLAGS += \
|
||||
BPFTOOL_VERSION="$(LINUX_VERSION)" \
|
||||
FEATURES_DUMP="$(PKG_BUILD_DIR)/FEATURE-DUMP.openwrt" \
|
||||
OUTPUT="$(PKG_BUILD_DIR)/" \
|
||||
prefix="/usr" \
|
||||
$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='')
|
||||
$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
|
||||
LIBSUBDIR=lib \
|
||||
check_feat=0 \
|
||||
feature-clang-bpf-co-re=0 \
|
||||
feature-reallocarray=1 \
|
||||
feature-zlib=1 \
|
||||
feature-libbfd=$(full) \
|
||||
feature-libcap=0 \
|
||||
feature-disassembler-four-args=$(full)
|
||||
|
||||
ifeq ($(BUILD_VARIANT),full)
|
||||
HAVE_LIBBFD:=1
|
||||
HAVE_LIBCAP:=0
|
||||
HAVE_CLANG:=0
|
||||
MAKE_PATH:=tools/bpf/bpftool
|
||||
else ifeq ($(BUILD_VARIANT),minimal)
|
||||
HAVE_LIBBFD:=0
|
||||
HAVE_LIBCAP:=0
|
||||
HAVE_CLANG:=0
|
||||
MAKE_PATH:=tools/bpf/bpftool
|
||||
else ifeq ($(BUILD_VARIANT),lib)
|
||||
HAVE_LIBBFD:=0
|
||||
HAVE_LIBCAP:=0
|
||||
HAVE_CLANG:=0
|
||||
MAKE_PATH:=tools/lib/bpf
|
||||
ifeq ($(BUILD_VARIANT),lib)
|
||||
MAKE_PATH = libbpf/src
|
||||
else
|
||||
MAKE_PATH = src
|
||||
endif
|
||||
|
||||
# Perform a "throw-away" make to create a FEATURE-DUMP.* file to edit later.
|
||||
# The "//" in the make target is actually needed, very unPOSIXly.
|
||||
define Build/Configure
|
||||
+$(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/tools/bpf/bpftool \
|
||||
$(MAKE_FLAGS) FEATURES_DUMP= $(PKG_BUILD_DIR)//libbpf/libbpf.a
|
||||
(cd $(PKG_BUILD_DIR); cat FEATURE-DUMP.bpftool libbpf/FEATURE-DUMP.libbpf \
|
||||
| sort | uniq > FEATURE-DUMP.openwrt)
|
||||
$(SED) 's/feature-libbfd=1/feature-libbfd=$(HAVE_LIBBFD)/' \
|
||||
-e 's/feature-libcap=1/feature-libcap=$(HAVE_LIBCAP)/' \
|
||||
-e 's/feature-clang-bpf-co-re=1/feature-clang-bpf-co-re=$(HAVE_CLANG)/' \
|
||||
$(PKG_BUILD_DIR)/FEATURE-DUMP.openwrt
|
||||
endef
|
||||
|
||||
define Build/InstallDev/libbpf
|
||||
$(INSTALL_DIR) $(1)/usr/include/bpf
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/bpf/*.h $(1)/usr/include/bpf/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib$(LIB_SUFFIX)/libbpf.{a,so*} \
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbpf.{a,so*} \
|
||||
$(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib$(LIB_SUFFIX)/pkgconfig/libbpf.pc \
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libbpf.pc \
|
||||
$(1)/usr/lib/pkgconfig/
|
||||
$(SED) 's,/usr/include,$$$${prefix}/include,g' \
|
||||
$(1)/usr/lib/pkgconfig/libbpf.pc
|
||||
@ -161,7 +141,7 @@ endef
|
||||
|
||||
define Package/libbpf/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib$(LIB_SUFFIX)/libbpf.so.* $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbpf.so.* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libbpf))
|
||||
|
||||
10
package/network/utils/bpftools/patches/001-cflags.patch
Normal file
10
package/network/utils/bpftools/patches/001-cflags.patch
Normal file
@ -0,0 +1,10 @@
|
||||
--- a/libbpf/src/Makefile
|
||||
+++ b/libbpf/src/Makefile
|
||||
@@ -25,6 +25,7 @@ ALL_CFLAGS := $(INCLUDES)
|
||||
|
||||
SHARED_CFLAGS += -fPIC -fvisibility=hidden -DSHARED
|
||||
|
||||
+CFLAGS = $(EXTRA_CFLAGS)
|
||||
CFLAGS ?= -g -O2 -Werror -Wall -std=gnu89
|
||||
ALL_CFLAGS += $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
|
||||
ALL_LDFLAGS += $(LDFLAGS)
|
||||
26
package/network/utils/bpftools/patches/002-includes.patch
Normal file
26
package/network/utils/bpftools/patches/002-includes.patch
Normal file
@ -0,0 +1,26 @@
|
||||
--- a/libbpf/include/linux/list.h
|
||||
+++ b/libbpf/include/linux/list.h
|
||||
@@ -3,6 +3,8 @@
|
||||
#ifndef __LINUX_LIST_H
|
||||
#define __LINUX_LIST_H
|
||||
|
||||
+#include <linux/types.h>
|
||||
+
|
||||
#define LIST_HEAD_INIT(name) { &(name), &(name) }
|
||||
#define LIST_HEAD(name) \
|
||||
struct list_head name = LIST_HEAD_INIT(name)
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -73,10 +73,10 @@ CFLAGS += -W -Wall -Wextra -Wno-unused-p
|
||||
CFLAGS += $(filter-out -Wswitch-enum -Wnested-externs,$(EXTRA_WARNINGS))
|
||||
CFLAGS += -DPACKAGE='"bpftool"' -D__EXPORTED_HEADERS__ \
|
||||
-I$(if $(OUTPUT),$(OUTPUT),.) \
|
||||
- -I$(LIBBPF_INCLUDE) \
|
||||
-I$(srctree)/src/kernel/bpf/ \
|
||||
-I$(srctree)/include \
|
||||
- -I$(srctree)/include/uapi
|
||||
+ -I$(srctree)/include/uapi \
|
||||
+ -I$(LIBBPF_INCLUDE)
|
||||
ifneq ($(BPFTOOL_VERSION),)
|
||||
CFLAGS += -DBPFTOOL_VERSION='"$(BPFTOOL_VERSION)"'
|
||||
endif
|
||||
@ -1,51 +0,0 @@
|
||||
From afe3f4c765b17ced23811fe652c7f7adf7a0c0cf Mon Sep 17 00:00:00 2001
|
||||
From: Tony Ambardar <Tony.Ambardar@gmail.com>
|
||||
Date: Mon, 14 Sep 2020 23:05:26 -0700
|
||||
Subject: [PATCH] tools/arch/powerpc: fix EDEADLOCK redefinition errors in
|
||||
errno.h
|
||||
|
||||
A few archs like powerpc have different errno.h values for macros
|
||||
EDEADLOCK and EDEADLK. In code including both libc and linux versions of
|
||||
errno.h, this can result in multiple definitions of EDEADLOCK in the
|
||||
include chain. Definitions to the same value (e.g. seen with mips) do
|
||||
not raise warnings, but on powerpc there are redefinitions changing the
|
||||
value, which raise warnings and errors (with "-Werror").
|
||||
|
||||
Guard against these redefinitions to avoid build errors like the following,
|
||||
first seen cross-compiling libbpf v5.8.9 for powerpc using GCC 8.4.0 with
|
||||
musl 1.1.24:
|
||||
|
||||
In file included from ../../arch/powerpc/include/uapi/asm/errno.h:5,
|
||||
from ../../include/linux/err.h:8,
|
||||
from libbpf.c:29:
|
||||
../../include/uapi/asm-generic/errno.h:40: error: "EDEADLOCK" redefined [-Werror]
|
||||
#define EDEADLOCK EDEADLK
|
||||
|
||||
In file included from toolchain-powerpc_8540_gcc-8.4.0_musl/include/errno.h:10,
|
||||
from libbpf.c:26:
|
||||
toolchain-powerpc_8540_gcc-8.4.0_musl/include/bits/errno.h:58: note: this is the location of the previous definition
|
||||
#define EDEADLOCK 58
|
||||
|
||||
cc1: all warnings being treated as errors
|
||||
make[5]: *** [target-powerpc_8540_musl/bpftools-5.8.9/tools/build/Makefile.build:97: /home/kodidev/openwrt-project/build_dir/target-powerpc_8540_musl/bpftools-minimal/bpftools-5.8.9//libbpf/staticobjs/libbpf.o] Error 1
|
||||
|
||||
Fixes: 95f28190aa01 ("tools include arch: Grab a copy of errno.h for arch's
|
||||
supported by perf")
|
||||
Fixes: c3617f72036c ("UAPI: (Scripted) Disintegrate arch/powerpc/include/asm")
|
||||
|
||||
Reported-by: Rosen Penev <rosenp@gmail.com>
|
||||
Signed-off-by: Tony Ambardar <Tony.Ambardar@gmail.com>
|
||||
---
|
||||
tools/arch/powerpc/include/uapi/asm/errno.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/tools/arch/powerpc/include/uapi/asm/errno.h
|
||||
+++ b/tools/arch/powerpc/include/uapi/asm/errno.h
|
||||
@@ -2,6 +2,7 @@
|
||||
#ifndef _ASM_POWERPC_ERRNO_H
|
||||
#define _ASM_POWERPC_ERRNO_H
|
||||
|
||||
+#undef EDEADLOCK
|
||||
#include <asm-generic/errno.h>
|
||||
|
||||
#undef EDEADLOCK
|
||||
@ -1,20 +0,0 @@
|
||||
--- a/tools/bpf/bpftool/btf_dumper.c
|
||||
+++ b/tools/bpf/bpftool/btf_dumper.c
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <stdio.h> /* for (FILE *) used by json_writer */
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
+#include <linux/compiler.h>
|
||||
#include <asm/byteorder.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/btf.h>
|
||||
--- a/tools/bpf/bpftool/map_perf_ring.c
|
||||
+++ b/tools/bpf/bpftool/map_perf_ring.c
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <linux/bpf.h>
|
||||
+#include <linux/compiler.h>
|
||||
#include <linux/perf_event.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mman.h>
|
||||
@ -20,30 +20,36 @@ PKG_LICENSE:=GPL-2.0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ebtables
|
||||
define Package/ebtables-legacy
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Firewall
|
||||
DEPENDS:=+kmod-ebtables
|
||||
TITLE:=Ethernet bridge firewall administration utility
|
||||
URL:=http://ebtables.sourceforge.net/
|
||||
PROVIDES:=ebtables
|
||||
ALTERNATIVES:=\
|
||||
200:/usr/sbin/ebtables:/usr/sbin/ebtables-legacy
|
||||
endef
|
||||
|
||||
define Package/ebtables-utils
|
||||
$(call Package/ebtables)
|
||||
DEPENDS += ebtables
|
||||
define Package/ebtables-legacy-utils
|
||||
$(call Package/ebtables-legacy)
|
||||
DEPENDS:=ebtables-legacy
|
||||
TITLE:=ebtables save/restore utilities
|
||||
PROVIDES:=ebtables-utils
|
||||
ALTERNATIVES:=\
|
||||
200:/usr/sbin/ebtables-restore:/usr/sbin/ebtables-legacy-restore
|
||||
endef
|
||||
|
||||
define Package/ebtables/description
|
||||
define Package/ebtables-legacy/description
|
||||
The ebtables program is a filtering tool for a bridging firewall. The
|
||||
filtering is focussed on the Link Layer Ethernet frame fields. Apart
|
||||
from filtering, it also gives the ability to alter the Ethernet MAC
|
||||
addresses and implement a brouter.
|
||||
endef
|
||||
|
||||
define Package/ebtables-utils/description
|
||||
$(call Package/ebtables/description)
|
||||
define Package/ebtables-legacy-utils/description
|
||||
$(call Package/ebtables-legacy/description)
|
||||
endef
|
||||
|
||||
MAKE_VARS += EXT_LIBSI="$(LIBGCC_S)"
|
||||
@ -52,21 +58,22 @@ MAKE_FLAGS += \
|
||||
CFLAGS="$(TARGET_CFLAGS)" \
|
||||
LIBDIR="/usr/lib/ebtables"
|
||||
|
||||
define Package/ebtables/install
|
||||
define Package/ebtables-legacy/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/ethertypes $(1)/etc/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ebtables
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib*.so $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/extensions/*.so $(1)/usr/lib/ebtables/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ebtables $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ebtables $(1)/usr/sbin/ebtables-legacy
|
||||
endef
|
||||
|
||||
define Package/ebtables-utils/install
|
||||
define Package/ebtables-legacy-utils/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ebtables-save $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ebtables-restore $(1)/usr/sbin/
|
||||
#ebtables-save depends on perl and is just broken
|
||||
#$(INSTALL_BIN) $(PKG_BUILD_DIR)/ebtables-save $(1)/usr/sbin/ebtables-legacy-save
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ebtables-restore $(1)/usr/sbin/ebtables-legacy-restore
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ebtables))
|
||||
$(eval $(call BuildPackage,ebtables-utils))
|
||||
$(eval $(call BuildPackage,ebtables-legacy))
|
||||
$(eval $(call BuildPackage,ebtables-legacy-utils))
|
||||
|
||||
@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=iptables
|
||||
PKG_VERSION:=1.8.7
|
||||
PKG_RELEASE:=5
|
||||
PKG_RELEASE:=6
|
||||
|
||||
PKG_SOURCE_URL:=https://netfilter.org/projects/iptables/files
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
@ -44,10 +44,16 @@ $(call Package/iptables/Default)
|
||||
DEPENDS:=+libxtables $(1)
|
||||
endef
|
||||
|
||||
define Package/iptables-legacy
|
||||
define Package/xtables-legacy
|
||||
$(call Package/iptables/Default)
|
||||
TITLE:=IP firewall administration tool
|
||||
DEPENDS+= +kmod-ipt-core +libip4tc +IPV6:libip6tc +libiptext +IPV6:libiptext6 +libxtables
|
||||
endef
|
||||
|
||||
define Package/iptables-legacy
|
||||
$(call Package/iptables/Default)
|
||||
TITLE:=IP firewall administration tool
|
||||
DEPENDS+= +xtables-legacy
|
||||
PROVIDES:=iptables
|
||||
ALTERNATIVES:=\
|
||||
200:/usr/sbin/iptables:/usr/sbin/xtables-legacy-multi \
|
||||
@ -95,10 +101,38 @@ IP firewall administration tool.
|
||||
|
||||
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
|
||||
endef
|
||||
|
||||
define Package/arptables-nft
|
||||
$(call Package/iptables/Default)
|
||||
DEPENDS:=+kmod-nft-arp +xtables-nft +kmod-arptables
|
||||
TITLE:=ARP firewall administration tool nft
|
||||
PROVIDES:=arptables
|
||||
ALTERNATIVES:=\
|
||||
300:/usr/sbin/arptables:/usr/sbin/xtables-nft-multi \
|
||||
300:/usr/sbin/arptables-restore:/usr/sbin/xtables-nft-multi \
|
||||
300:/usr/sbin/arptables-save:/usr/sbin/xtables-nft-multi
|
||||
endef
|
||||
|
||||
define Package/ebtables-nft
|
||||
$(call Package/iptables/Default)
|
||||
DEPENDS:=+kmod-nft-bridge +xtables-nft +kmod-ebtables
|
||||
TITLE:=Bridge firewall administration tool nft
|
||||
PROVIDES:=ebtables
|
||||
ALTERNATIVES:=\
|
||||
300:/usr/sbin/ebtables:/usr/sbin/xtables-nft-multi \
|
||||
300:/usr/sbin/ebtables-restore:/usr/sbin/xtables-nft-multi \
|
||||
300:/usr/sbin/ebtables-save:/usr/sbin/xtables-nft-multi
|
||||
endef
|
||||
|
||||
define Package/iptables-nft
|
||||
$(call Package/iptables/Default)
|
||||
TITLE:=IP firewall administration tool nft
|
||||
DEPENDS:=@IPTABLES_NFTABLES +libnftnl +libiptext +IPV6:libiptext6 +libiptext-nft +kmod-ipt-core +kmod-nft-compat
|
||||
DEPENDS:=+kmod-ipt-core +xtables-nft
|
||||
PROVIDES:=iptables
|
||||
ALTERNATIVES:=\
|
||||
300:/usr/sbin/iptables:/usr/sbin/xtables-nft-multi \
|
||||
@ -451,7 +485,7 @@ endef
|
||||
|
||||
define Package/ip6tables-legacy
|
||||
$(call Package/iptables/Default)
|
||||
DEPENDS:=@IPV6 +kmod-ip6tables +iptables-legacy
|
||||
DEPENDS:=@IPV6 +kmod-ip6tables +xtables-legacy
|
||||
CATEGORY:=Network
|
||||
TITLE:=IPv6 firewall administration tool
|
||||
PROVIDES:=ip6tables
|
||||
@ -463,7 +497,7 @@ endef
|
||||
|
||||
define Package/ip6tables-nft
|
||||
$(call Package/iptables/Default)
|
||||
DEPENDS:=@IPV6 +kmod-ip6tables +iptables-nft
|
||||
DEPENDS:=@IPV6 +kmod-ip6tables +xtables-nft
|
||||
TITLE:=IP firewall administration tool nft
|
||||
PROVIDES:=ip6tables
|
||||
ALTERNATIVES:=\
|
||||
@ -638,16 +672,38 @@ define Build/InstallDev
|
||||
$(CP) $(PKG_BUILD_DIR)/extensions/libiptext*.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/iptables-legacy/install
|
||||
define Package/xtables-legacy/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/xtables-legacy-multi $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/iptables-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
|
||||
endef
|
||||
|
||||
define Package/iptables-nft/install
|
||||
define Package/xtables-nft/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/xtables-nft-multi $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/arptables-nft/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/arptables-nft{,-restore,-save} $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/iptables
|
||||
$(CP) $(PKG_BUILD_DIR)/extensions/libarpt_*.so $(1)/usr/lib/iptables/
|
||||
endef
|
||||
|
||||
define Package/ebtables-nft/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/ebtables-nft{,-restore,-save} $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/iptables
|
||||
$(CP) $(PKG_BUILD_DIR)/extensions/libebt_*.so $(1)/usr/lib/iptables/
|
||||
endef
|
||||
|
||||
define Package/iptables-nft/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/iptables-nft{,-restore,-save} $(1)/usr/sbin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/iptables{,-restore}-translate $(1)/usr/sbin/
|
||||
endef
|
||||
@ -714,7 +770,11 @@ $(eval $(call BuildPackage,libip6tc))
|
||||
$(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,xtables-nft))
|
||||
$(eval $(call BuildPackage,arptables-nft))
|
||||
$(eval $(call BuildPackage,ebtables-nft))
|
||||
$(eval $(call BuildPackage,iptables-nft))
|
||||
$(eval $(call BuildPlugin,iptables-mod-conntrack-extra,$(IPT_CONNTRACK_EXTRA-m)))
|
||||
$(eval $(call BuildPlugin,iptables-mod-conntrack-label,$(IPT_CONNTRACK_LABEL-m)))
|
||||
|
||||
@ -0,0 +1,107 @@
|
||||
A modified version of this patch was commited upstream
|
||||
as part of a fixup series
|
||||
https://bugzilla.netfilter.org/show_bug.cgi?id=1593
|
||||
https://git.netfilter.org/iptables/commit/?id=0836524f093c0fd9c39604a46a949e43d9b47ef2
|
||||
|
||||
--- a/iptables/xtables-monitor.c
|
||||
+++ b/iptables/xtables-monitor.c
|
||||
@@ -629,6 +629,8 @@ int xtables_monitor_main(int argc, char
|
||||
init_extensions();
|
||||
init_extensions4();
|
||||
init_extensions6();
|
||||
+ init_extensionsa();
|
||||
+ init_extensionsb();
|
||||
#endif
|
||||
|
||||
if (nft_init(&h, AF_INET, xtables_ipv4)) {
|
||||
--- a/iptables/xtables-restore.c
|
||||
+++ b/iptables/xtables-restore.c
|
||||
@@ -368,9 +368,17 @@ xtables_restore_main(int family, const c
|
||||
#endif
|
||||
break;
|
||||
case NFPROTO_ARP:
|
||||
+#if defined(ALL_INCLUSIVE) || defined(NO_SHARED_LIBS)
|
||||
+ init_extensions();
|
||||
+ init_extensionsa();
|
||||
+#endif
|
||||
tables = xtables_arp;
|
||||
break;
|
||||
case NFPROTO_BRIDGE:
|
||||
+#if defined(ALL_INCLUSIVE) || defined(NO_SHARED_LIBS)
|
||||
+ init_extensions();
|
||||
+ init_extensionsb();
|
||||
+#endif
|
||||
tables = xtables_bridge;
|
||||
break;
|
||||
default:
|
||||
--- a/iptables/xtables-save.c
|
||||
+++ b/iptables/xtables-save.c
|
||||
@@ -208,9 +208,17 @@ xtables_save_main(int family, int argc,
|
||||
d.commit = true;
|
||||
break;
|
||||
case NFPROTO_ARP:
|
||||
+#if defined(ALL_INCLUSIVE) || defined(NO_SHARED_LIBS)
|
||||
+ init_extensions();
|
||||
+ init_extensionsa();
|
||||
+#endif
|
||||
tables = xtables_arp;
|
||||
break;
|
||||
case NFPROTO_BRIDGE: {
|
||||
+#if defined(ALL_INCLUSIVE) || defined(NO_SHARED_LIBS)
|
||||
+ init_extensions();
|
||||
+ init_extensionsb();
|
||||
+#endif
|
||||
const char *ctr = getenv("EBTABLES_SAVE_COUNTER");
|
||||
|
||||
if (!(d.format & FMT_NOCOUNTS)) {
|
||||
--- a/iptables/xtables-standalone.c
|
||||
+++ b/iptables/xtables-standalone.c
|
||||
@@ -58,6 +58,8 @@ xtables_main(int family, const char *pro
|
||||
init_extensions();
|
||||
init_extensions4();
|
||||
init_extensions6();
|
||||
+ init_extensionsa();
|
||||
+ init_extensionsb();
|
||||
#endif
|
||||
|
||||
if (nft_init(&h, family, xtables_ipv4) < 0) {
|
||||
--- a/iptables/xtables-translate.c
|
||||
+++ b/iptables/xtables-translate.c
|
||||
@@ -474,9 +474,17 @@ static int xtables_xlate_main_common(str
|
||||
tables = xtables_ipv4;
|
||||
break;
|
||||
case NFPROTO_ARP:
|
||||
+#if defined(ALL_INCLUSIVE) || defined(NO_SHARED_LIBS)
|
||||
+ init_extensions();
|
||||
+ init_extensionsa();
|
||||
+#endif
|
||||
tables = xtables_arp;
|
||||
break;
|
||||
case NFPROTO_BRIDGE:
|
||||
+#if defined(ALL_INCLUSIVE) || defined(NO_SHARED_LIBS)
|
||||
+ init_extensions();
|
||||
+ init_extensionsb();
|
||||
+#endif
|
||||
tables = xtables_bridge;
|
||||
break;
|
||||
default:
|
||||
--- a/iptables/xtables-arp.c
|
||||
+++ b/iptables/xtables-arp.c
|
||||
@@ -438,6 +438,7 @@ int nft_init_arp(struct nft_handle *h, c
|
||||
}
|
||||
|
||||
#if defined(ALL_INCLUSIVE) || defined(NO_SHARED_LIBS)
|
||||
+ init_extensions();
|
||||
init_extensionsa();
|
||||
#endif
|
||||
|
||||
--- a/iptables/xtables-eb.c
|
||||
+++ b/iptables/xtables-eb.c
|
||||
@@ -685,6 +685,7 @@ int nft_init_eb(struct nft_handle *h, co
|
||||
}
|
||||
|
||||
#if defined(ALL_INCLUSIVE) || defined(NO_SHARED_LIBS)
|
||||
+ init_extensions();
|
||||
init_extensionsb();
|
||||
#endif
|
||||
|
||||
@ -11,9 +11,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git
|
||||
PKG_SOURCE_DATE:=2021-07-11
|
||||
PKG_SOURCE_VERSION:=a0a0e02dd91d14a50155390d5fd3b95d6ec87bf4
|
||||
PKG_MIRROR_HASH:=7b4f745c2cace836e57bd116399973d9ac32cee7f98d4628a17395caa3d0cebc
|
||||
PKG_SOURCE_DATE:=2022-03-01
|
||||
PKG_SOURCE_VERSION:=90bfbb9a3ac39e41c59a9802d0730560eb7d0f83
|
||||
PKG_MIRROR_HASH:=31cae75dbe1cf347a8c768769bb7a772eeff4970c9b1ba3ab5d260ac056a1161
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
|
||||
@ -121,6 +121,7 @@ define Package/procd/install
|
||||
$(INSTALL_BIN) ./files/reload_config $(1)/sbin/
|
||||
$(INSTALL_CONF) ./files/hotplug*.json $(1)/etc/
|
||||
$(INSTALL_DATA) ./files/procd.sh $(1)/lib/functions/
|
||||
$(INSTALL_BIN) ./files/service $(1)/sbin/service
|
||||
endef
|
||||
|
||||
Package/procd-selinux/install = $(Package/procd/install)
|
||||
|
||||
30
package/system/procd/files/service
Normal file
30
package/system/procd/files/service
Normal file
@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
main() {
|
||||
local service="$1"
|
||||
local cmd="$2"
|
||||
|
||||
local boot status
|
||||
|
||||
if [ -f "/etc/init.d/${service}" ]; then
|
||||
/etc/init.d/"${service}" "${cmd}"
|
||||
exit "$?"
|
||||
fi
|
||||
|
||||
if [ -n "$service" ]; then
|
||||
echo "Service \"$1\" not found:"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Usage: $(basename "$0") <service> [command]"
|
||||
for service in /etc/init.d/* ; do
|
||||
boot="$($service enabled && echo "enabled" || echo "disabled" )"
|
||||
status="$( [ "$(ubus call service list "{ 'verbose': true, 'name': '$(basename "$service")' }" \
|
||||
| jsonfilter -q -e "@['$(basename "$service")'].instances[*].running" | uniq)" = "true" ] \
|
||||
&& echo "running" || echo "stopped" )"
|
||||
|
||||
printf "%-30s\\t%10s\\t%10s\\n" "$service" "$boot" "$status"
|
||||
done
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@ -1,277 +0,0 @@
|
||||
# CONFIG_16KSTACKS is not set
|
||||
CONFIG_ARC=y
|
||||
CONFIG_ARCH_32BIT_OFF_T=y
|
||||
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
|
||||
CONFIG_ARCH_HAS_DMA_COHERENT_TO_PFN=y
|
||||
CONFIG_ARCH_HAS_DMA_PREP_COHERENT=y
|
||||
CONFIG_ARCH_HAS_PTE_SPECIAL=y
|
||||
CONFIG_ARCH_HAS_SETUP_DMA_OPS=y
|
||||
CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU=y
|
||||
CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y
|
||||
CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
|
||||
CONFIG_ARC_BUILTIN_DTB_NAME=""
|
||||
CONFIG_ARC_CACHE=y
|
||||
CONFIG_ARC_CACHE_LINE_SHIFT=6
|
||||
CONFIG_ARC_CACHE_PAGES=y
|
||||
CONFIG_ARC_CPU_HS=y
|
||||
CONFIG_ARC_CURR_IN_REG=y
|
||||
CONFIG_ARC_DBG=y
|
||||
# CONFIG_ARC_DBG_TLB_PARANOIA is not set
|
||||
CONFIG_ARC_DW2_UNWIND=y
|
||||
CONFIG_ARC_HAS_ACCL_REGS=y
|
||||
CONFIG_ARC_HAS_DCACHE=y
|
||||
# CONFIG_ARC_HAS_DCCM is not set
|
||||
CONFIG_ARC_HAS_DIV_REM=y
|
||||
CONFIG_ARC_HAS_ICACHE=y
|
||||
# CONFIG_ARC_HAS_ICCM is not set
|
||||
CONFIG_ARC_HAS_LL64=y
|
||||
CONFIG_ARC_HAS_LLSC=y
|
||||
# CONFIG_ARC_HAS_PAE40 is not set
|
||||
CONFIG_ARC_HAS_SWAPE=y
|
||||
CONFIG_ARC_IRQ_NO_AUTOSAVE=y
|
||||
CONFIG_ARC_KVADDR_SIZE=256
|
||||
CONFIG_ARC_MCIP=y
|
||||
# CONFIG_ARC_METAWARE_HLINK is not set
|
||||
CONFIG_ARC_MMU_V4=y
|
||||
# CONFIG_ARC_PAGE_SIZE_16K is not set
|
||||
# CONFIG_ARC_PAGE_SIZE_4K is not set
|
||||
CONFIG_ARC_PAGE_SIZE_8K=y
|
||||
CONFIG_ARC_PLAT_AXS10X=y
|
||||
# CONFIG_ARC_PLAT_EZNPS is not set
|
||||
# CONFIG_ARC_PLAT_TB10X is not set
|
||||
# CONFIG_ARC_SMP_HALT_ON_RESET is not set
|
||||
CONFIG_ARC_SOC_HSDK=y
|
||||
CONFIG_ARC_TIMERS=y
|
||||
CONFIG_ARC_TIMERS_64BIT=y
|
||||
CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS=y
|
||||
CONFIG_AXS103=y
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
CONFIG_BLK_DEV_RAM_COUNT=16
|
||||
CONFIG_BLK_DEV_RAM_SIZE=4096
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_BLK_SCSI_REQUEST=y
|
||||
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
|
||||
CONFIG_CC_DISABLE_WARN_MAYBE_UNINITIALIZED=y
|
||||
CONFIG_CC_HAS_KASAN_GENERIC=y
|
||||
# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set
|
||||
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
|
||||
CONFIG_CLKDEV_LOOKUP=y
|
||||
CONFIG_CLK_HSDK=y
|
||||
CONFIG_CLONE_BACKWARDS=y
|
||||
CONFIG_COMMON_CLK=y
|
||||
CONFIG_COMPAT_32BIT_TIME=y
|
||||
CONFIG_CPU_RMAP=y
|
||||
CONFIG_CRC16=y
|
||||
CONFIG_CRYPTO_AEAD=y
|
||||
CONFIG_CRYPTO_AEAD2=y
|
||||
CONFIG_CRYPTO_CRC32C=y
|
||||
CONFIG_CRYPTO_DRBG=y
|
||||
CONFIG_CRYPTO_DRBG_HMAC=y
|
||||
CONFIG_CRYPTO_DRBG_MENU=y
|
||||
CONFIG_CRYPTO_ECHAINIV=y
|
||||
CONFIG_CRYPTO_HASH=y
|
||||
CONFIG_CRYPTO_HASH2=y
|
||||
CONFIG_CRYPTO_HMAC=y
|
||||
CONFIG_CRYPTO_JITTERENTROPY=y
|
||||
CONFIG_CRYPTO_LIB_SHA256=y
|
||||
CONFIG_CRYPTO_MANAGER=y
|
||||
CONFIG_CRYPTO_MANAGER2=y
|
||||
CONFIG_CRYPTO_NULL=y
|
||||
CONFIG_CRYPTO_NULL2=y
|
||||
CONFIG_CRYPTO_RNG=y
|
||||
CONFIG_CRYPTO_RNG2=y
|
||||
CONFIG_CRYPTO_RNG_DEFAULT=y
|
||||
CONFIG_CRYPTO_SHA256=y
|
||||
CONFIG_DEVTMPFS=y
|
||||
CONFIG_DMADEVICES=y
|
||||
CONFIG_DMA_DIRECT_REMAP=y
|
||||
CONFIG_DMA_ENGINE=y
|
||||
CONFIG_DMA_OF=y
|
||||
CONFIG_DMA_REMAP=y
|
||||
CONFIG_DMA_VIRTUAL_CHANNELS=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_DWMAC_ANARION=y
|
||||
CONFIG_DWMAC_GENERIC=y
|
||||
CONFIG_DW_APB_ICTL=y
|
||||
CONFIG_DW_AXI_DMAC=y
|
||||
CONFIG_EXT4_FS=y
|
||||
# CONFIG_EZNPS_GIC is not set
|
||||
CONFIG_FAT_FS=y
|
||||
CONFIG_FB=y
|
||||
CONFIG_FB_CMDLINE=y
|
||||
CONFIG_FIXED_PHY=y
|
||||
CONFIG_FS_IOMAP=y
|
||||
CONFIG_FS_MBCACHE=y
|
||||
CONFIG_FS_POSIX_ACL=y
|
||||
CONFIG_FW_LOADER_PAGED_BUF=y
|
||||
CONFIG_GENERIC_ALLOCATOR=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS=y
|
||||
CONFIG_GENERIC_CSUM=y
|
||||
CONFIG_GENERIC_FIND_FIRST_BIT=y
|
||||
CONFIG_GENERIC_IRQ_CHIP=y
|
||||
CONFIG_GENERIC_IRQ_SHOW=y
|
||||
CONFIG_GENERIC_PCI_IOMAP=y
|
||||
CONFIG_GENERIC_PENDING_IRQ=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIO_DWAPB=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_GPIO_SNPS_CREG=y
|
||||
CONFIG_GRACE_PERIOD=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HAVE_ARCH_KGDB=y
|
||||
CONFIG_HAVE_ARCH_TRACEHOOK=y
|
||||
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
|
||||
CONFIG_HAVE_CLK=y
|
||||
CONFIG_HAVE_CLK_PREPARE=y
|
||||
CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
|
||||
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
|
||||
CONFIG_HAVE_FUTEX_CMPXCHG=y
|
||||
CONFIG_HAVE_IOREMAP_PROT=y
|
||||
CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
|
||||
CONFIG_HAVE_NET_DSA=y
|
||||
CONFIG_HAVE_OPROFILE=y
|
||||
CONFIG_HAVE_PCI=y
|
||||
CONFIG_HAVE_PERF_EVENTS=y
|
||||
CONFIG_HZ_PERIODIC=y
|
||||
CONFIG_I2C=y
|
||||
CONFIG_I2C_BOARDINFO=y
|
||||
CONFIG_IIO=y
|
||||
CONFIG_IIO_BUFFER=y
|
||||
CONFIG_IIO_KFIFO_BUF=y
|
||||
CONFIG_IIO_ST_PRESS=y
|
||||
CONFIG_IIO_ST_PRESS_I2C=y
|
||||
CONFIG_IIO_ST_PRESS_SPI=y
|
||||
CONFIG_IIO_ST_SENSORS_CORE=y
|
||||
CONFIG_IIO_ST_SENSORS_I2C=y
|
||||
CONFIG_IIO_ST_SENSORS_SPI=y
|
||||
CONFIG_IIO_TRIGGER=y
|
||||
CONFIG_IIO_TRIGGERED_BUFFER=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_INITRAMFS_SOURCE=""
|
||||
CONFIG_IRQCHIP=y
|
||||
CONFIG_IRQ_DOMAIN=y
|
||||
CONFIG_IRQ_WORK=y
|
||||
# CONFIG_ISA_ARCOMPACT is not set
|
||||
CONFIG_ISA_ARCV2=y
|
||||
CONFIG_JBD2=y
|
||||
CONFIG_KALLSYMS=y
|
||||
CONFIG_KERNEL_GZIP=y
|
||||
CONFIG_LIBFDT=y
|
||||
CONFIG_LINUX_LINK_BASE=0x90000000
|
||||
CONFIG_LINUX_RAM_BASE=0x80000000
|
||||
CONFIG_LOCKD=y
|
||||
CONFIG_LOCKUP_DETECTOR=y
|
||||
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
||||
CONFIG_LOCK_SPIN_ON_OWNER=y
|
||||
CONFIG_MDIO_BUS=y
|
||||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MEMFD_CREATE=y
|
||||
CONFIG_MFD_SYSCON=y
|
||||
CONFIG_MICREL_PHY=y
|
||||
CONFIG_MIGRATION=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_BLOCK=y
|
||||
CONFIG_MMC_DW=y
|
||||
# CONFIG_MMC_DW_BLUEFIELD is not set
|
||||
# CONFIG_MMC_DW_EXYNOS is not set
|
||||
# CONFIG_MMC_DW_HI3798CV200 is not set
|
||||
# CONFIG_MMC_DW_K3 is not set
|
||||
CONFIG_MMC_DW_PLTFM=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_PLTFM=y
|
||||
CONFIG_MODULES_TREE_LOOKUP=y
|
||||
CONFIG_MODULES_USE_ELF_RELA=y
|
||||
CONFIG_MTD_SPI_NOR=y
|
||||
CONFIG_MUTEX_SPIN_ON_OWNER=y
|
||||
CONFIG_NAMESPACES=y
|
||||
CONFIG_NATIONAL_PHY=y
|
||||
CONFIG_NEED_DMA_MAP_STATE=y
|
||||
CONFIG_NET_FLOW_LIMIT=y
|
||||
CONFIG_NET_NS=y
|
||||
CONFIG_NET_PTP_CLASSIFY=y
|
||||
CONFIG_NFS_ACL_SUPPORT=y
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NFS_V3_ACL=y
|
||||
CONFIG_NLS=y
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
CONFIG_NO_IOPORT_MAP=y
|
||||
CONFIG_NR_CPUS=4
|
||||
CONFIG_OF=y
|
||||
CONFIG_OF_ADDRESS=y
|
||||
CONFIG_OF_EARLY_FLATTREE=y
|
||||
CONFIG_OF_FLATTREE=y
|
||||
CONFIG_OF_GPIO=y
|
||||
CONFIG_OF_IRQ=y
|
||||
CONFIG_OF_KOBJ=y
|
||||
CONFIG_OF_MDIO=y
|
||||
CONFIG_OF_NET=y
|
||||
CONFIG_PADATA=y
|
||||
CONFIG_PAGE_POOL=y
|
||||
CONFIG_PGTABLE_LEVELS=2
|
||||
CONFIG_PHYLIB=y
|
||||
CONFIG_PHYLINK=y
|
||||
CONFIG_PPS=y
|
||||
CONFIG_PREEMPT=y
|
||||
CONFIG_PREEMPTION=y
|
||||
CONFIG_PREEMPT_COUNT=y
|
||||
# CONFIG_PREEMPT_NONE is not set
|
||||
CONFIG_PREEMPT_RCU=y
|
||||
# CONFIG_PREVENT_FIRMWARE_BUILD is not set
|
||||
CONFIG_PTP_1588_CLOCK=y
|
||||
CONFIG_RATIONAL=y
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_REGMAP_I2C=y
|
||||
CONFIG_REGMAP_MMIO=y
|
||||
CONFIG_REGMAP_SPI=y
|
||||
CONFIG_RESET_AXS10X=y
|
||||
CONFIG_RESET_CONTROLLER=y
|
||||
CONFIG_RESET_HSDK=y
|
||||
CONFIG_RESET_SIMPLE=y
|
||||
CONFIG_RFS_ACCEL=y
|
||||
CONFIG_RPS=y
|
||||
CONFIG_RWSEM_SPIN_ON_OWNER=y
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
|
||||
CONFIG_SERIAL_8250_DW=y
|
||||
CONFIG_SERIAL_8250_DWLIB=y
|
||||
CONFIG_SERIAL_8250_NR_UARTS=4
|
||||
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
|
||||
CONFIG_SERIAL_ARC=y
|
||||
CONFIG_SERIAL_ARC_CONSOLE=y
|
||||
CONFIG_SERIAL_ARC_NR_PORTS=1
|
||||
CONFIG_SERIAL_MCTRL_GPIO=y
|
||||
CONFIG_SERIAL_OF_PLATFORM=y
|
||||
CONFIG_SG_POOL=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_SOFTLOCKUP_DETECTOR=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_SPI_DESIGNWARE=y
|
||||
CONFIG_SPI_DW_MMIO=y
|
||||
CONFIG_SPI_MASTER=y
|
||||
CONFIG_SPI_MEM=y
|
||||
CONFIG_SRCU=y
|
||||
CONFIG_STACKTRACE=y
|
||||
# CONFIG_STANDALONE is not set
|
||||
CONFIG_STMMAC_ETH=y
|
||||
CONFIG_STMMAC_PLATFORM=y
|
||||
# CONFIG_STMMAC_SELFTESTS is not set
|
||||
CONFIG_SUNRPC=y
|
||||
CONFIG_SWPHY=y
|
||||
CONFIG_TASKS_RCU=y
|
||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
||||
CONFIG_TIMER_OF=y
|
||||
CONFIG_TIMER_PROBE=y
|
||||
CONFIG_TI_ADC108S102=y
|
||||
CONFIG_TREE_SRCU=y
|
||||
CONFIG_UNINLINE_SPIN_UNLOCK=y
|
||||
CONFIG_USB_SUPPORT=y
|
||||
# CONFIG_USER_NS is not set
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_WATCHDOG_CORE=y
|
||||
CONFIG_XPS=y
|
||||
@ -1,21 +0,0 @@
|
||||
From 2e2b3aeda9af9c029bf347c974911fe96cd79c43 Mon Sep 17 00:00:00 2001
|
||||
From: Evgeniy Didin <didin@synopsys.com>
|
||||
Date: Mon, 23 Mar 2020 15:57:18 +0300
|
||||
Subject: [PATCH] arch/arc: Add compiler option for gcc8.4
|
||||
|
||||
Signed-off-by: Evgeniy Didin <didin@synopsys.com>
|
||||
---
|
||||
arch/arc/Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/arc/Makefile
|
||||
+++ b/arch/arc/Makefile
|
||||
@@ -11,7 +11,7 @@ endif
|
||||
|
||||
cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__
|
||||
cflags-$(CONFIG_ISA_ARCOMPACT) += -mA7
|
||||
-cflags-$(CONFIG_ISA_ARCV2) += -mcpu=hs38
|
||||
+cflags-$(CONFIG_ISA_ARCV2) += -mcpu=hs38 -mmpy-option=2
|
||||
|
||||
ifdef CONFIG_ARC_CURR_IN_REG
|
||||
# For a global register defintion, make sure it gets passed to every file
|
||||
@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
#ifdef CONFIG_MACB_USE_HWSTAMP
|
||||
--- a/drivers/net/ethernet/cadence/macb_main.c
|
||||
+++ b/drivers/net/ethernet/cadence/macb_main.c
|
||||
@@ -3800,15 +3800,15 @@ static int macb_init(struct platform_dev
|
||||
@@ -3823,15 +3823,15 @@ static int macb_init(struct platform_dev
|
||||
if (!(bp->caps & MACB_CAPS_USRIO_DISABLED)) {
|
||||
val = 0;
|
||||
if (phy_interface_mode_is_rgmii(bp->phy_interface))
|
||||
@ -69,7 +69,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
macb_or_gem_writel(bp, USRIO, val);
|
||||
}
|
||||
@@ -4326,6 +4326,13 @@ static int fu540_c000_init(struct platfo
|
||||
@@ -4349,6 +4349,13 @@ static int fu540_c000_init(struct platfo
|
||||
return macb_init(pdev);
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
static const struct macb_config fu540_c000_config = {
|
||||
.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO |
|
||||
MACB_CAPS_GEM_HAS_PTP,
|
||||
@@ -4333,12 +4340,14 @@ static const struct macb_config fu540_c0
|
||||
@@ -4356,12 +4363,14 @@ static const struct macb_config fu540_c0
|
||||
.clk_init = fu540_c000_clk_init,
|
||||
.init = fu540_c000_init,
|
||||
.jumbo_max_len = 10240,
|
||||
@ -98,7 +98,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
};
|
||||
|
||||
static const struct macb_config sama5d3macb_config = {
|
||||
@@ -4346,6 +4355,7 @@ static const struct macb_config sama5d3m
|
||||
@@ -4369,6 +4378,7 @@ static const struct macb_config sama5d3m
|
||||
| MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII,
|
||||
.clk_init = macb_clk_init,
|
||||
.init = macb_init,
|
||||
@ -106,7 +106,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
};
|
||||
|
||||
static const struct macb_config pc302gem_config = {
|
||||
@@ -4353,6 +4363,7 @@ static const struct macb_config pc302gem
|
||||
@@ -4376,6 +4386,7 @@ static const struct macb_config pc302gem
|
||||
.dma_burst_length = 16,
|
||||
.clk_init = macb_clk_init,
|
||||
.init = macb_init,
|
||||
@ -114,7 +114,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
};
|
||||
|
||||
static const struct macb_config sama5d2_config = {
|
||||
@@ -4360,6 +4371,7 @@ static const struct macb_config sama5d2_
|
||||
@@ -4383,6 +4394,7 @@ static const struct macb_config sama5d2_
|
||||
.dma_burst_length = 16,
|
||||
.clk_init = macb_clk_init,
|
||||
.init = macb_init,
|
||||
@ -122,7 +122,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
};
|
||||
|
||||
static const struct macb_config sama5d3_config = {
|
||||
@@ -4369,6 +4381,7 @@ static const struct macb_config sama5d3_
|
||||
@@ -4392,6 +4404,7 @@ static const struct macb_config sama5d3_
|
||||
.clk_init = macb_clk_init,
|
||||
.init = macb_init,
|
||||
.jumbo_max_len = 10240,
|
||||
@ -130,7 +130,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
};
|
||||
|
||||
static const struct macb_config sama5d4_config = {
|
||||
@@ -4376,18 +4389,21 @@ static const struct macb_config sama5d4_
|
||||
@@ -4399,18 +4412,21 @@ static const struct macb_config sama5d4_
|
||||
.dma_burst_length = 4,
|
||||
.clk_init = macb_clk_init,
|
||||
.init = macb_init,
|
||||
@ -152,7 +152,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
};
|
||||
|
||||
static const struct macb_config zynqmp_config = {
|
||||
@@ -4398,6 +4414,7 @@ static const struct macb_config zynqmp_c
|
||||
@@ -4421,6 +4437,7 @@ static const struct macb_config zynqmp_c
|
||||
.clk_init = macb_clk_init,
|
||||
.init = macb_init,
|
||||
.jumbo_max_len = 10240,
|
||||
@ -160,7 +160,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
};
|
||||
|
||||
static const struct macb_config zynq_config = {
|
||||
@@ -4406,6 +4423,7 @@ static const struct macb_config zynq_con
|
||||
@@ -4429,6 +4446,7 @@ static const struct macb_config zynq_con
|
||||
.dma_burst_length = 16,
|
||||
.clk_init = macb_clk_init,
|
||||
.init = macb_init,
|
||||
@ -168,7 +168,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
};
|
||||
|
||||
static const struct of_device_id macb_dt_ids[] = {
|
||||
@@ -4526,6 +4544,8 @@ static int macb_probe(struct platform_de
|
||||
@@ -4549,6 +4567,8 @@ static int macb_probe(struct platform_de
|
||||
bp->wol |= MACB_WOL_HAS_MAGIC_PACKET;
|
||||
device_set_wakeup_capable(&pdev->dev, bp->wol & MACB_WOL_HAS_MAGIC_PACKET);
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/cadence/macb_main.c
|
||||
+++ b/drivers/net/ethernet/cadence/macb_main.c
|
||||
@@ -3575,6 +3575,20 @@ static void macb_probe_queues(void __iom
|
||||
@@ -3598,6 +3598,20 @@ static void macb_probe_queues(void __iom
|
||||
*num_queues = hweight32(*queue_mask);
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
static int macb_clk_init(struct platform_device *pdev, struct clk **pclk,
|
||||
struct clk **hclk, struct clk **tx_clk,
|
||||
struct clk **rx_clk, struct clk **tsu_clk)
|
||||
@@ -4637,11 +4651,7 @@ err_out_free_netdev:
|
||||
@@ -4660,11 +4674,7 @@ err_out_free_netdev:
|
||||
free_netdev(dev);
|
||||
|
||||
err_disable_clocks:
|
||||
@ -48,7 +48,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
pm_runtime_set_suspended(&pdev->dev);
|
||||
pm_runtime_dont_use_autosuspend(&pdev->dev);
|
||||
@@ -4666,11 +4676,8 @@ static int macb_remove(struct platform_d
|
||||
@@ -4689,11 +4699,8 @@ static int macb_remove(struct platform_d
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
pm_runtime_dont_use_autosuspend(&pdev->dev);
|
||||
if (!pm_runtime_suspended(&pdev->dev)) {
|
||||
@ -62,7 +62,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
pm_runtime_set_suspended(&pdev->dev);
|
||||
}
|
||||
phylink_destroy(bp->phylink);
|
||||
@@ -4849,13 +4856,10 @@ static int __maybe_unused macb_runtime_s
|
||||
@@ -4872,13 +4879,10 @@ static int __maybe_unused macb_runtime_s
|
||||
struct net_device *netdev = dev_get_drvdata(dev);
|
||||
struct macb *bp = netdev_priv(netdev);
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/cadence/macb_main.c
|
||||
+++ b/drivers/net/ethernet/cadence/macb_main.c
|
||||
@@ -4307,8 +4307,10 @@ static int fu540_c000_clk_init(struct pl
|
||||
@@ -4330,8 +4330,10 @@ static int fu540_c000_clk_init(struct pl
|
||||
return err;
|
||||
|
||||
mgmt = devm_kzalloc(&pdev->dev, sizeof(*mgmt), GFP_KERNEL);
|
||||
@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
init.name = "sifive-gemgxl-mgmt";
|
||||
init.ops = &fu540_c000_ops;
|
||||
@@ -4319,16 +4321,26 @@ static int fu540_c000_clk_init(struct pl
|
||||
@@ -4342,16 +4344,26 @@ static int fu540_c000_clk_init(struct pl
|
||||
mgmt->hw.init = &init;
|
||||
|
||||
*tx_clk = devm_clk_register(&pdev->dev, &mgmt->hw);
|
||||
|
||||
@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/cadence/macb_main.c
|
||||
+++ b/drivers/net/ethernet/cadence/macb_main.c
|
||||
@@ -4359,6 +4359,14 @@ static const struct macb_usrio_config ma
|
||||
@@ -4382,6 +4382,14 @@ static const struct macb_usrio_config ma
|
||||
.refclk = MACB_BIT(CLKEN),
|
||||
};
|
||||
|
||||
@ -29,7 +29,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
static const struct macb_config fu540_c000_config = {
|
||||
.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO |
|
||||
MACB_CAPS_GEM_HAS_PTP,
|
||||
@@ -4452,6 +4460,14 @@ static const struct macb_config zynq_con
|
||||
@@ -4475,6 +4483,14 @@ static const struct macb_config zynq_con
|
||||
.usrio = &macb_default_usrio,
|
||||
};
|
||||
|
||||
@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
static const struct of_device_id macb_dt_ids[] = {
|
||||
{ .compatible = "cdns,at32ap7000-macb" },
|
||||
{ .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },
|
||||
@@ -4469,6 +4485,7 @@ static const struct of_device_id macb_dt
|
||||
@@ -4492,6 +4508,7 @@ static const struct of_device_id macb_dt
|
||||
{ .compatible = "cdns,zynqmp-gem", .data = &zynqmp_config},
|
||||
{ .compatible = "cdns,zynq-gem", .data = &zynq_config },
|
||||
{ .compatible = "sifive,fu540-c000-gem", .data = &fu540_c000_config },
|
||||
|
||||
@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/cadence/macb_main.c
|
||||
+++ b/drivers/net/ethernet/cadence/macb_main.c
|
||||
@@ -4468,6 +4468,14 @@ static const struct macb_config sama7g5_
|
||||
@@ -4491,6 +4491,14 @@ static const struct macb_config sama7g5_
|
||||
.usrio = &sama7g5_usrio,
|
||||
};
|
||||
|
||||
@ -29,7 +29,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
static const struct of_device_id macb_dt_ids[] = {
|
||||
{ .compatible = "cdns,at32ap7000-macb" },
|
||||
{ .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },
|
||||
@@ -4486,6 +4494,7 @@ static const struct of_device_id macb_dt
|
||||
@@ -4509,6 +4517,7 @@ static const struct of_device_id macb_dt
|
||||
{ .compatible = "cdns,zynq-gem", .data = &zynq_config },
|
||||
{ .compatible = "sifive,fu540-c000-gem", .data = &fu540_c000_config },
|
||||
{ .compatible = "microchip,sama7g5-gem", .data = &sama7g5_gem_config },
|
||||
|
||||
@ -20,7 +20,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/cadence/macb_main.c
|
||||
+++ b/drivers/net/ethernet/cadence/macb_main.c
|
||||
@@ -3837,6 +3837,13 @@ static int macb_init(struct platform_dev
|
||||
@@ -3860,6 +3860,13 @@ static int macb_init(struct platform_dev
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
#if defined(CONFIG_OF)
|
||||
/* 1518 rounded up */
|
||||
#define AT91ETHER_MAX_RBUFF_SZ 0x600
|
||||
@@ -4352,13 +4359,6 @@ static int fu540_c000_init(struct platfo
|
||||
@@ -4375,13 +4382,6 @@ static int fu540_c000_init(struct platfo
|
||||
return macb_init(pdev);
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
static const struct macb_usrio_config sama7g5_usrio = {
|
||||
.mii = 0,
|
||||
.rmii = 1,
|
||||
@@ -4507,6 +4507,7 @@ static const struct macb_config default_
|
||||
@@ -4530,6 +4530,7 @@ static const struct macb_config default_
|
||||
.dma_burst_length = 16,
|
||||
.clk_init = macb_clk_init,
|
||||
.init = macb_init,
|
||||
|
||||
@ -143,12 +143,12 @@
|
||||
|
||||
nvmem-cells = <&macaddr_art_0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
mac-address-increment = <1>;
|
||||
};
|
||||
|
||||
ð1 {
|
||||
nvmem-cells = <&macaddr_art_0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
mac-address-increment = <1>;
|
||||
};
|
||||
|
||||
&wmac {
|
||||
|
||||
@ -14,6 +14,10 @@ glinet,gl-ar300m-nand|\
|
||||
glinet,gl-ar300m-nor)
|
||||
ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0"
|
||||
;;
|
||||
glinet,gl-xe300)
|
||||
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
|
||||
ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x10"
|
||||
;;
|
||||
netgear,r6100)
|
||||
ucidef_set_led_netdev "wan-green" "WAN (green)" "green:wan" "eth1"
|
||||
;;
|
||||
|
||||
@ -25,6 +25,11 @@ ath79_setup_interfaces()
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth0" "2:lan:2" "3:lan:1" "1:wan"
|
||||
;;
|
||||
glinet,gl-xe300)
|
||||
ucidef_set_interface_wan "eth1"
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth0" "4:lan"
|
||||
;;
|
||||
netgear,r6100)
|
||||
ucidef_set_interface_wan "eth1"
|
||||
ucidef_add_switch "switch0" \
|
||||
|
||||
@ -158,7 +158,8 @@ define Device/rpi-4
|
||||
DEVICE_PACKAGES := \
|
||||
cypress-firmware-43455-sdio \
|
||||
cypress-nvram-43455-sdio-rpi-4b \
|
||||
kmod-brcmfmac wpad-basic-wolfssl
|
||||
kmod-brcmfmac wpad-basic-wolfssl \
|
||||
kmod-usb-net-lan78xx
|
||||
IMAGE/sysupgrade.img.gz := boot-common | boot-2711 | sdcard-img | gzip | append-metadata
|
||||
IMAGE/factory.img.gz := boot-common | boot-2711 | sdcard-img | gzip
|
||||
endef
|
||||
|
||||
@ -18,7 +18,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
#include <linux/personality.h>
|
||||
#include <linux/preempt.h>
|
||||
#include <linux/printk.h>
|
||||
@@ -137,6 +138,10 @@ static int c_show(struct seq_file *m, vo
|
||||
@@ -140,6 +141,10 @@ static int c_show(struct seq_file *m, vo
|
||||
{
|
||||
int i, j;
|
||||
bool compat = personality(current->personality) == PER_LINUX32;
|
||||
@ -29,7 +29,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
|
||||
for_each_online_cpu(i) {
|
||||
struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, i);
|
||||
@@ -197,6 +202,26 @@ static int c_show(struct seq_file *m, vo
|
||||
@@ -200,6 +205,26 @@ static int c_show(struct seq_file *m, vo
|
||||
seq_printf(m, "CPU revision\t: %d\n\n", MIDR_REVISION(midr));
|
||||
}
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
gpiod_err(desc,
|
||||
"%s: tried to set a GPIO tied to an IRQ as output\n",
|
||||
__func__);
|
||||
@@ -3250,8 +3252,8 @@ int gpiochip_lock_as_irq(struct gpio_chi
|
||||
@@ -3260,8 +3262,8 @@ int gpiochip_lock_as_irq(struct gpio_chi
|
||||
}
|
||||
|
||||
/* To be valid for IRQ the line needs to be input or open drain */
|
||||
|
||||
@ -17,7 +17,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
|
||||
--- a/arch/arm/boot/dts/bcm2711.dtsi
|
||||
+++ b/arch/arm/boot/dts/bcm2711.dtsi
|
||||
@@ -509,8 +509,8 @@
|
||||
@@ -510,8 +510,8 @@
|
||||
msi-controller;
|
||||
msi-parent = <&pcie0>;
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
|
||||
--- a/arch/arm/boot/dts/bcm2711.dtsi
|
||||
+++ b/arch/arm/boot/dts/bcm2711.dtsi
|
||||
@@ -560,6 +560,7 @@
|
||||
@@ -561,6 +561,7 @@
|
||||
|
||||
&dsi1 {
|
||||
interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
|
||||
|
||||
@ -17,7 +17,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
|
||||
--- a/arch/arm/boot/dts/bcm2711.dtsi
|
||||
+++ b/arch/arm/boot/dts/bcm2711.dtsi
|
||||
@@ -308,6 +308,14 @@
|
||||
@@ -309,6 +309,14 @@
|
||||
#reset-cells = <1>;
|
||||
};
|
||||
|
||||
@ -32,7 +32,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
hdmi0: hdmi@7ef00700 {
|
||||
compatible = "brcm,bcm2711-hdmi0";
|
||||
reg = <0x7ef00700 0x300>,
|
||||
@@ -336,6 +344,11 @@
|
||||
@@ -337,6 +345,11 @@
|
||||
<&clk_27MHz>;
|
||||
clock-names = "hdmi", "bvb", "audio", "cec";
|
||||
resets = <&dvp 0>;
|
||||
@ -44,7 +44,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
ddc = <&ddc0>;
|
||||
dmas = <&dma 10>;
|
||||
dma-names = "audio-rx";
|
||||
@@ -380,6 +393,11 @@
|
||||
@@ -381,6 +394,11 @@
|
||||
<&dvp 0>,
|
||||
<&clk_27MHz>;
|
||||
resets = <&dvp 1>;
|
||||
|
||||
@ -12,7 +12,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
|
||||
|
||||
--- a/arch/arm/boot/dts/bcm2711.dtsi
|
||||
+++ b/arch/arm/boot/dts/bcm2711.dtsi
|
||||
@@ -314,6 +314,7 @@
|
||||
@@ -315,6 +315,7 @@
|
||||
interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <1>;
|
||||
|
||||
@ -12,7 +12,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
|
||||
|
||||
--- a/arch/arm/boot/dts/bcm2711.dtsi
|
||||
+++ b/arch/arm/boot/dts/bcm2711.dtsi
|
||||
@@ -353,7 +353,6 @@
|
||||
@@ -354,7 +354,6 @@
|
||||
ddc = <&ddc0>;
|
||||
dmas = <&dma 10>;
|
||||
dma-names = "audio-rx";
|
||||
@ -20,7 +20,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -401,7 +400,6 @@
|
||||
@@ -402,7 +401,6 @@
|
||||
"wakeup", "hpd-connected", "hpd-removed";
|
||||
dmas = <&dma 17>;
|
||||
dma-names = "audio-rx";
|
||||
|
||||
@ -21,7 +21,7 @@ Signed-off-by: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
|
||||
|
||||
--- a/arch/arm/boot/dts/bcm2711.dtsi
|
||||
+++ b/arch/arm/boot/dts/bcm2711.dtsi
|
||||
@@ -300,6 +300,14 @@
|
||||
@@ -301,6 +301,14 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ Signed-off-by: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
|
||||
maxItems: 1
|
||||
--- a/arch/arm/boot/dts/bcm2711.dtsi
|
||||
+++ b/arch/arm/boot/dts/bcm2711.dtsi
|
||||
@@ -301,7 +301,7 @@
|
||||
@@ -302,7 +302,7 @@
|
||||
};
|
||||
|
||||
vec: vec@7ec13000 {
|
||||
|
||||
@ -15,7 +15,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
|
||||
--- a/arch/arm/boot/dts/bcm2711.dtsi
|
||||
+++ b/arch/arm/boot/dts/bcm2711.dtsi
|
||||
@@ -359,7 +359,7 @@
|
||||
@@ -360,7 +360,7 @@
|
||||
interrupt-names = "cec-tx", "cec-rx", "cec-low",
|
||||
"wakeup", "hpd-connected", "hpd-removed";
|
||||
ddc = <&ddc0>;
|
||||
@ -24,7 +24,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
dma-names = "audio-rx";
|
||||
status = "disabled";
|
||||
};
|
||||
@@ -406,7 +406,7 @@
|
||||
@@ -407,7 +407,7 @@
|
||||
<9>, <10>, <11>;
|
||||
interrupt-names = "cec-tx", "cec-rx", "cec-low",
|
||||
"wakeup", "hpd-connected", "hpd-removed";
|
||||
|
||||
@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
|
||||
--- a/arch/arm/boot/dts/bcm2711.dtsi
|
||||
+++ b/arch/arm/boot/dts/bcm2711.dtsi
|
||||
@@ -304,7 +304,7 @@
|
||||
@@ -305,7 +305,7 @@
|
||||
compatible = "brcm,bcm2711-vec";
|
||||
reg = <0x7ec13000 0x1000>;
|
||||
clocks = <&clocks BCM2835_CLOCK_VEC>;
|
||||
@ -23,7 +23,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -1114,7 +1114,3 @@
|
||||
@@ -1115,7 +1115,3 @@
|
||||
&usb {
|
||||
interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
|
||||
};
|
||||
|
||||
@ -1,208 +0,0 @@
|
||||
CONFIG_ADM6996_PHY=y
|
||||
CONFIG_ARCH_BINFMT_ELF_STATE=y
|
||||
CONFIG_ARCH_CLOCKSOURCE_DATA=y
|
||||
CONFIG_ARCH_DISCARD_MEMBLOCK=y
|
||||
CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
|
||||
CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y
|
||||
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MAX=15
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15
|
||||
CONFIG_ARCH_SUPPORTS_UPROBES=y
|
||||
CONFIG_ARCH_SUSPEND_POSSIBLE=y
|
||||
CONFIG_ARCH_USE_BUILTIN_BSWAP=y
|
||||
CONFIG_ARCH_USE_QUEUED_RWLOCKS=y
|
||||
CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y
|
||||
CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
|
||||
CONFIG_BCM47XX=y
|
||||
CONFIG_BCM47XX_BCMA=y
|
||||
CONFIG_BCM47XX_NVRAM=y
|
||||
CONFIG_BCM47XX_SPROM=y
|
||||
CONFIG_BCM47XX_SSB=y
|
||||
CONFIG_BCM47XX_WDT=y
|
||||
CONFIG_BCMA=y
|
||||
CONFIG_BCMA_BLOCKIO=y
|
||||
CONFIG_BCMA_DEBUG=y
|
||||
CONFIG_BCMA_DRIVER_GMAC_CMN=y
|
||||
CONFIG_BCMA_DRIVER_GPIO=y
|
||||
CONFIG_BCMA_DRIVER_MIPS=y
|
||||
CONFIG_BCMA_DRIVER_PCI=y
|
||||
CONFIG_BCMA_DRIVER_PCI_HOSTMODE=y
|
||||
CONFIG_BCMA_HOST_PCI=y
|
||||
CONFIG_BCMA_HOST_PCI_POSSIBLE=y
|
||||
CONFIG_BCMA_HOST_SOC=y
|
||||
CONFIG_BCMA_NFLASH=y
|
||||
CONFIG_BCMA_PFLASH=y
|
||||
CONFIG_BCMA_SFLASH=y
|
||||
# CONFIG_BGMAC_BCMA is not set
|
||||
CONFIG_BLK_MQ_PCI=y
|
||||
CONFIG_CEVT_R4K=y
|
||||
CONFIG_CLONE_BACKWARDS=y
|
||||
CONFIG_CMDLINE="noinitrd console=ttyS0,115200"
|
||||
CONFIG_CMDLINE_BOOL=y
|
||||
# CONFIG_CMDLINE_OVERRIDE is not set
|
||||
# CONFIG_CPU_BMIPS is not set
|
||||
CONFIG_CPU_GENERIC_DUMP_TLB=y
|
||||
CONFIG_CPU_HAS_PREFETCH=y
|
||||
CONFIG_CPU_HAS_SYNC=y
|
||||
CONFIG_CPU_LITTLE_ENDIAN=y
|
||||
CONFIG_CPU_MIPS32=y
|
||||
CONFIG_CPU_MIPS32_R1=y
|
||||
# CONFIG_CPU_MIPS32_R2 is not set
|
||||
CONFIG_CPU_MIPSR1=y
|
||||
CONFIG_CPU_MIPSR2_IRQ_VI=y
|
||||
CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y
|
||||
CONFIG_CPU_R4K_CACHE_TLB=y
|
||||
CONFIG_CPU_R4K_FPU=y
|
||||
CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
|
||||
CONFIG_CPU_SUPPORTS_HIGHMEM=y
|
||||
CONFIG_CRYPTO_RNG2=y
|
||||
CONFIG_CRYPTO_WORKQUEUE=y
|
||||
CONFIG_CSRC_R4K=y
|
||||
CONFIG_DMA_DIRECT_OPS=y
|
||||
CONFIG_DMA_NONCOHERENT=y
|
||||
CONFIG_DMA_NONCOHERENT_CACHE_SYNC=y
|
||||
CONFIG_DMA_NONCOHERENT_MMAP=y
|
||||
CONFIG_DMA_NONCOHERENT_OPS=y
|
||||
# CONFIG_EARLY_PRINTK is not set
|
||||
CONFIG_FIXED_PHY=y
|
||||
CONFIG_GENERIC_ATOMIC64=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS=y
|
||||
CONFIG_GENERIC_CMOS_UPDATE=y
|
||||
CONFIG_GENERIC_CPU_AUTOPROBE=y
|
||||
CONFIG_GENERIC_IRQ_CHIP=y
|
||||
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
|
||||
CONFIG_GENERIC_IRQ_SHOW=y
|
||||
CONFIG_GENERIC_LIB_ASHLDI3=y
|
||||
CONFIG_GENERIC_LIB_ASHRDI3=y
|
||||
CONFIG_GENERIC_LIB_CMPDI2=y
|
||||
CONFIG_GENERIC_LIB_LSHRDI3=y
|
||||
CONFIG_GENERIC_LIB_UCMPDI2=y
|
||||
CONFIG_GENERIC_PCI_IOMAP=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_WDT=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
CONFIG_HARDWARE_WATCHPOINTS=y
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HAS_IOPORT_MAP=y
|
||||
CONFIG_HAVE_ARCH_COMPILER_H=y
|
||||
CONFIG_HAVE_ARCH_JUMP_LABEL=y
|
||||
CONFIG_HAVE_ARCH_KGDB=y
|
||||
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
|
||||
CONFIG_HAVE_ARCH_TRACEHOOK=y
|
||||
CONFIG_HAVE_CBPF_JIT=y
|
||||
CONFIG_HAVE_CONTEXT_TRACKING=y
|
||||
CONFIG_HAVE_COPY_THREAD_TLS=y
|
||||
CONFIG_HAVE_C_RECORDMCOUNT=y
|
||||
CONFIG_HAVE_DEBUG_KMEMLEAK=y
|
||||
CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
|
||||
CONFIG_HAVE_DMA_CONTIGUOUS=y
|
||||
CONFIG_HAVE_DYNAMIC_FTRACE=y
|
||||
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
|
||||
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
|
||||
CONFIG_HAVE_FUNCTION_TRACER=y
|
||||
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
|
||||
CONFIG_HAVE_IDE=y
|
||||
CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
|
||||
CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
|
||||
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
|
||||
CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y
|
||||
CONFIG_HAVE_MEMBLOCK=y
|
||||
CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
|
||||
CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
|
||||
CONFIG_HAVE_NET_DSA=y
|
||||
CONFIG_HAVE_OPROFILE=y
|
||||
CONFIG_HAVE_PERF_EVENTS=y
|
||||
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
|
||||
CONFIG_HAVE_RSEQ=y
|
||||
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
|
||||
CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
|
||||
CONFIG_HW_HAS_PCI=y
|
||||
CONFIG_HW_RANDOM=y
|
||||
CONFIG_HZ_PERIODIC=y
|
||||
CONFIG_INITRAMFS_SOURCE=""
|
||||
CONFIG_IRQ_DOMAIN=y
|
||||
CONFIG_IRQ_FORCED_THREADING=y
|
||||
CONFIG_IRQ_MIPS_CPU=y
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_LEDS_GPIO_REGISTER=y
|
||||
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
||||
CONFIG_MDIO_BUS=y
|
||||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MEMFD_CREATE=y
|
||||
CONFIG_MIGRATION=y
|
||||
CONFIG_MIPS=y
|
||||
CONFIG_MIPS_ASID_BITS=8
|
||||
CONFIG_MIPS_ASID_SHIFT=0
|
||||
CONFIG_MIPS_CLOCK_VSYSCALL=y
|
||||
# CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set
|
||||
CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y
|
||||
CONFIG_MIPS_L1_CACHE_SHIFT=5
|
||||
CONFIG_MODULES_USE_ELF_REL=y
|
||||
CONFIG_MTD_BCM47XXSFLASH=y
|
||||
CONFIG_MTD_BCM47XX_PARTS=y
|
||||
CONFIG_MTD_NAND=y
|
||||
CONFIG_MTD_NAND_BCM47XXNFLASH=y
|
||||
CONFIG_MTD_NAND_ECC=y
|
||||
CONFIG_MTD_PARSER_TRX=y
|
||||
CONFIG_MTD_PHYSMAP=y
|
||||
CONFIG_NEED_DMA_MAP_STATE=y
|
||||
CONFIG_NEED_PER_CPU_KM=y
|
||||
CONFIG_NO_EXCEPT_FILL=y
|
||||
CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
|
||||
# CONFIG_OF is not set
|
||||
CONFIG_PCI=y
|
||||
CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
|
||||
CONFIG_PCI_DOMAINS=y
|
||||
CONFIG_PCI_DRIVERS_LEGACY=y
|
||||
CONFIG_PERF_USE_VMALLOC=y
|
||||
CONFIG_PGTABLE_LEVELS=2
|
||||
CONFIG_PHYLIB=y
|
||||
CONFIG_SERIAL_8250_EXTENDED=y
|
||||
CONFIG_SERIAL_8250_SHARE_IRQ=y
|
||||
CONFIG_SRCU=y
|
||||
CONFIG_SSB=y
|
||||
CONFIG_SSB_B43_PCI_BRIDGE=y
|
||||
CONFIG_SSB_BLOCKIO=y
|
||||
CONFIG_SSB_DRIVER_EXTIF=y
|
||||
CONFIG_SSB_DRIVER_GIGE=y
|
||||
CONFIG_SSB_DRIVER_GPIO=y
|
||||
CONFIG_SSB_DRIVER_MIPS=y
|
||||
CONFIG_SSB_DRIVER_PCICORE=y
|
||||
CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
|
||||
CONFIG_SSB_EMBEDDED=y
|
||||
CONFIG_SSB_HOST_SOC=y
|
||||
CONFIG_SSB_PCICORE_HOSTMODE=y
|
||||
CONFIG_SSB_PCIHOST=y
|
||||
CONFIG_SSB_PCIHOST_POSSIBLE=y
|
||||
CONFIG_SSB_SERIAL=y
|
||||
CONFIG_SSB_SFLASH=y
|
||||
CONFIG_SSB_SPROM=y
|
||||
CONFIG_SWCONFIG=y
|
||||
CONFIG_SWCONFIG_B53=y
|
||||
# CONFIG_SWCONFIG_B53_MMAP_DRIVER is not set
|
||||
CONFIG_SWCONFIG_B53_PHY_DRIVER=y
|
||||
CONFIG_SWCONFIG_B53_PHY_FIXUP=y
|
||||
# CONFIG_SWCONFIG_B53_SRAB_DRIVER is not set
|
||||
CONFIG_SWPHY=y
|
||||
CONFIG_SYSCTL_EXCEPTION_TRACE=y
|
||||
CONFIG_SYS_HAS_CPU_BMIPS=y
|
||||
CONFIG_SYS_HAS_CPU_BMIPS32_3300=y
|
||||
CONFIG_SYS_HAS_CPU_MIPS32_R1=y
|
||||
CONFIG_SYS_HAS_CPU_MIPS32_R2=y
|
||||
CONFIG_SYS_HAS_EARLY_PRINTK=y
|
||||
CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
|
||||
CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
|
||||
CONFIG_SYS_SUPPORTS_HIGHMEM=y
|
||||
CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
|
||||
CONFIG_SYS_SUPPORTS_MIPS16=y
|
||||
CONFIG_SYS_SUPPORTS_ZBOOT=y
|
||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
||||
CONFIG_TINY_SRCU=y
|
||||
CONFIG_USB_SUPPORT=y
|
||||
CONFIG_USE_GENERIC_EARLY_PRINTK_8250=y
|
||||
CONFIG_WATCHDOG_CORE=y
|
||||
@ -1,492 +0,0 @@
|
||||
--- a/arch/mips/include/asm/r4kcache.h
|
||||
+++ b/arch/mips/include/asm/r4kcache.h
|
||||
@@ -26,6 +26,38 @@
|
||||
extern void (*r4k_blast_dcache)(void);
|
||||
extern void (*r4k_blast_icache)(void);
|
||||
|
||||
+#if defined(CONFIG_BCM47XX) && !defined(CONFIG_CPU_MIPS32_R2)
|
||||
+#include <asm/paccess.h>
|
||||
+#include <linux/ssb/ssb.h>
|
||||
+#define BCM4710_DUMMY_RREG() bcm4710_dummy_rreg()
|
||||
+
|
||||
+static inline unsigned long bcm4710_dummy_rreg(void)
|
||||
+{
|
||||
+ return *(volatile unsigned long *)(KSEG1ADDR(SSB_ENUM_BASE));
|
||||
+}
|
||||
+
|
||||
+#define BCM4710_FILL_TLB(addr) bcm4710_fill_tlb((void *)(addr))
|
||||
+
|
||||
+static inline unsigned long bcm4710_fill_tlb(void *addr)
|
||||
+{
|
||||
+ return *(unsigned long *)addr;
|
||||
+}
|
||||
+
|
||||
+#define BCM4710_PROTECTED_FILL_TLB(addr) bcm4710_protected_fill_tlb((void *)(addr))
|
||||
+
|
||||
+static inline void bcm4710_protected_fill_tlb(void *addr)
|
||||
+{
|
||||
+ unsigned long x;
|
||||
+ get_dbe(x, (unsigned long *)addr);;
|
||||
+}
|
||||
+
|
||||
+#else
|
||||
+#define BCM4710_DUMMY_RREG()
|
||||
+
|
||||
+#define BCM4710_FILL_TLB(addr)
|
||||
+#define BCM4710_PROTECTED_FILL_TLB(addr)
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* This macro return a properly sign-extended address suitable as base address
|
||||
* for indexed cache operations. Two issues here:
|
||||
@@ -56,6 +88,7 @@ static inline void flush_icache_line_ind
|
||||
|
||||
static inline void flush_dcache_line_indexed(unsigned long addr)
|
||||
{
|
||||
+ BCM4710_DUMMY_RREG();
|
||||
cache_op(Index_Writeback_Inv_D, addr);
|
||||
}
|
||||
|
||||
@@ -79,11 +112,13 @@ static inline void flush_icache_line(uns
|
||||
|
||||
static inline void flush_dcache_line(unsigned long addr)
|
||||
{
|
||||
+ BCM4710_DUMMY_RREG();
|
||||
cache_op(Hit_Writeback_Inv_D, addr);
|
||||
}
|
||||
|
||||
static inline void invalidate_dcache_line(unsigned long addr)
|
||||
{
|
||||
+ BCM4710_DUMMY_RREG();
|
||||
cache_op(Hit_Invalidate_D, addr);
|
||||
}
|
||||
|
||||
@@ -156,6 +191,7 @@ static inline int protected_flush_icache
|
||||
#ifdef CONFIG_EVA
|
||||
return protected_cachee_op(Hit_Invalidate_I, addr);
|
||||
#else
|
||||
+ BCM4710_DUMMY_RREG();
|
||||
return protected_cache_op(Hit_Invalidate_I, addr);
|
||||
#endif
|
||||
}
|
||||
@@ -169,6 +205,7 @@ static inline int protected_flush_icache
|
||||
*/
|
||||
static inline int protected_writeback_dcache_line(unsigned long addr)
|
||||
{
|
||||
+ BCM4710_DUMMY_RREG();
|
||||
#ifdef CONFIG_EVA
|
||||
return protected_cachee_op(Hit_Writeback_Inv_D, addr);
|
||||
#else
|
||||
@@ -526,8 +563,51 @@ static inline void invalidate_tcache_pag
|
||||
: "r" (base), \
|
||||
"i" (op));
|
||||
|
||||
+static inline void blast_dcache(void)
|
||||
+{
|
||||
+ unsigned long start = KSEG0;
|
||||
+ unsigned long dcache_size = current_cpu_data.dcache.waysize * current_cpu_data.dcache.ways;
|
||||
+ unsigned long end = (start + dcache_size);
|
||||
+
|
||||
+ do {
|
||||
+ BCM4710_DUMMY_RREG();
|
||||
+ cache_op(Index_Writeback_Inv_D, start);
|
||||
+ start += current_cpu_data.dcache.linesz;
|
||||
+ } while(start < end);
|
||||
+}
|
||||
+
|
||||
+static inline void blast_dcache_page(unsigned long page)
|
||||
+{
|
||||
+ unsigned long start = page;
|
||||
+ unsigned long end = start + PAGE_SIZE;
|
||||
+
|
||||
+ BCM4710_FILL_TLB(start);
|
||||
+ do {
|
||||
+ BCM4710_DUMMY_RREG();
|
||||
+ cache_op(Hit_Writeback_Inv_D, start);
|
||||
+ start += current_cpu_data.dcache.linesz;
|
||||
+ } while(start < end);
|
||||
+}
|
||||
+
|
||||
+static inline void blast_dcache_page_indexed(unsigned long page)
|
||||
+{
|
||||
+ unsigned long start = page;
|
||||
+ unsigned long end = start + PAGE_SIZE;
|
||||
+ unsigned long ws_inc = 1UL << current_cpu_data.dcache.waybit;
|
||||
+ unsigned long ws_end = current_cpu_data.dcache.ways <<
|
||||
+ current_cpu_data.dcache.waybit;
|
||||
+ unsigned long ws, addr;
|
||||
+ for (ws = 0; ws < ws_end; ws += ws_inc) {
|
||||
+ start = page + ws;
|
||||
+ for (addr = start; addr < end; addr += current_cpu_data.dcache.linesz) {
|
||||
+ BCM4710_DUMMY_RREG();
|
||||
+ cache_op(Index_Writeback_Inv_D, addr);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/* build blast_xxx, blast_xxx_page, blast_xxx_page_indexed */
|
||||
-#define __BUILD_BLAST_CACHE(pfx, desc, indexop, hitop, lsize, extra) \
|
||||
+#define __BUILD_BLAST_CACHE(pfx, desc, indexop, hitop, lsize, extra, war) \
|
||||
static inline void extra##blast_##pfx##cache##lsize(void) \
|
||||
{ \
|
||||
unsigned long start = INDEX_BASE; \
|
||||
@@ -537,6 +617,7 @@ static inline void extra##blast_##pfx##c
|
||||
current_cpu_data.desc.waybit; \
|
||||
unsigned long ws, addr; \
|
||||
\
|
||||
+ war \
|
||||
for (ws = 0; ws < ws_end; ws += ws_inc) \
|
||||
for (addr = start; addr < end; addr += lsize * 32) \
|
||||
cache##lsize##_unroll32(addr|ws, indexop); \
|
||||
@@ -547,6 +628,7 @@ static inline void extra##blast_##pfx##c
|
||||
unsigned long start = page; \
|
||||
unsigned long end = page + PAGE_SIZE; \
|
||||
\
|
||||
+ war \
|
||||
do { \
|
||||
cache##lsize##_unroll32(start, hitop); \
|
||||
start += lsize * 32; \
|
||||
@@ -563,31 +645,32 @@ static inline void extra##blast_##pfx##c
|
||||
current_cpu_data.desc.waybit; \
|
||||
unsigned long ws, addr; \
|
||||
\
|
||||
+ war \
|
||||
for (ws = 0; ws < ws_end; ws += ws_inc) \
|
||||
for (addr = start; addr < end; addr += lsize * 32) \
|
||||
cache##lsize##_unroll32(addr|ws, indexop); \
|
||||
}
|
||||
|
||||
-__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16, )
|
||||
-__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 16, )
|
||||
-__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 16, )
|
||||
-__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32, )
|
||||
-__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32, )
|
||||
-__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I_Loongson2, 32, loongson2_)
|
||||
-__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32, )
|
||||
-__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 64, )
|
||||
-__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64, )
|
||||
-__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64, )
|
||||
-__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 128, )
|
||||
-__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 128, )
|
||||
-__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128, )
|
||||
-
|
||||
-__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 16, )
|
||||
-__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 32, )
|
||||
-__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 16, )
|
||||
-__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 32, )
|
||||
-__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64, )
|
||||
-__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128, )
|
||||
+__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16, , )
|
||||
+__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 16, , BCM4710_FILL_TLB(start);)
|
||||
+__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 16, , )
|
||||
+__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32, , )
|
||||
+__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32, , BCM4710_FILL_TLB(start);)
|
||||
+__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I_Loongson2, 32, loongson2_, BCM4710_FILL_TLB(start);)
|
||||
+__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32, , )
|
||||
+__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 64, , )
|
||||
+__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64, , BCM4710_FILL_TLB(start);)
|
||||
+__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64, , )
|
||||
+__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 128, , )
|
||||
+__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 128, , )
|
||||
+__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128, , )
|
||||
+
|
||||
+__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 16, , )
|
||||
+__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 32, , )
|
||||
+__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 16, , )
|
||||
+__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 32, , )
|
||||
+__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64, , )
|
||||
+__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128, , )
|
||||
|
||||
#define __BUILD_BLAST_USER_CACHE(pfx, desc, indexop, hitop, lsize) \
|
||||
static inline void blast_##pfx##cache##lsize##_user_page(unsigned long page) \
|
||||
@@ -612,58 +695,29 @@ __BUILD_BLAST_USER_CACHE(d, dcache, Inde
|
||||
__BUILD_BLAST_USER_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64)
|
||||
|
||||
/* build blast_xxx_range, protected_blast_xxx_range */
|
||||
-#define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot, extra) \
|
||||
+#define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot, extra, war, war2) \
|
||||
static inline void prot##extra##blast_##pfx##cache##_range(unsigned long start, \
|
||||
unsigned long end) \
|
||||
{ \
|
||||
unsigned long lsize = cpu_##desc##_line_size(); \
|
||||
- unsigned long lsize_2 = lsize * 2; \
|
||||
- unsigned long lsize_3 = lsize * 3; \
|
||||
- unsigned long lsize_4 = lsize * 4; \
|
||||
- unsigned long lsize_5 = lsize * 5; \
|
||||
- unsigned long lsize_6 = lsize * 6; \
|
||||
- unsigned long lsize_7 = lsize * 7; \
|
||||
- unsigned long lsize_8 = lsize * 8; \
|
||||
unsigned long addr = start & ~(lsize - 1); \
|
||||
- unsigned long aend = (end + lsize - 1) & ~(lsize - 1); \
|
||||
- int lines = (aend - addr) / lsize; \
|
||||
- \
|
||||
- while (lines >= 8) { \
|
||||
- prot##cache_op(hitop, addr); \
|
||||
- prot##cache_op(hitop, addr + lsize); \
|
||||
- prot##cache_op(hitop, addr + lsize_2); \
|
||||
- prot##cache_op(hitop, addr + lsize_3); \
|
||||
- prot##cache_op(hitop, addr + lsize_4); \
|
||||
- prot##cache_op(hitop, addr + lsize_5); \
|
||||
- prot##cache_op(hitop, addr + lsize_6); \
|
||||
- prot##cache_op(hitop, addr + lsize_7); \
|
||||
- addr += lsize_8; \
|
||||
- lines -= 8; \
|
||||
- } \
|
||||
- \
|
||||
- if (lines & 0x4) { \
|
||||
- prot##cache_op(hitop, addr); \
|
||||
- prot##cache_op(hitop, addr + lsize); \
|
||||
- prot##cache_op(hitop, addr + lsize_2); \
|
||||
- prot##cache_op(hitop, addr + lsize_3); \
|
||||
- addr += lsize_4; \
|
||||
- } \
|
||||
+ unsigned long aend = (end - 1) & ~(lsize - 1); \
|
||||
\
|
||||
- if (lines & 0x2) { \
|
||||
- prot##cache_op(hitop, addr); \
|
||||
- prot##cache_op(hitop, addr + lsize); \
|
||||
- addr += lsize_2; \
|
||||
- } \
|
||||
+ war \
|
||||
\
|
||||
- if (lines & 0x1) { \
|
||||
+ while (1) { \
|
||||
+ war2 \
|
||||
prot##cache_op(hitop, addr); \
|
||||
+ if (addr == aend) \
|
||||
+ break; \
|
||||
+ addr += lsize; \
|
||||
} \
|
||||
}
|
||||
|
||||
#ifndef CONFIG_EVA
|
||||
|
||||
-__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_, )
|
||||
-__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_, )
|
||||
+__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_, , BCM4710_PROTECTED_FILL_TLB(addr); BCM4710_PROTECTED_FILL_TLB(aend);, BCM4710_DUMMY_RREG();)
|
||||
+__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_, , , )
|
||||
|
||||
#else
|
||||
|
||||
@@ -697,15 +751,15 @@ __BUILD_PROT_BLAST_CACHE_RANGE(d, dcache
|
||||
__BUILD_PROT_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I)
|
||||
|
||||
#endif
|
||||
-__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_, )
|
||||
+__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_, , , )
|
||||
__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I_Loongson2, \
|
||||
- protected_, loongson2_)
|
||||
-__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, , )
|
||||
-__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, , )
|
||||
-__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, , )
|
||||
+ protected_, loongson2_, , )
|
||||
+__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, , , BCM4710_FILL_TLB(addr); BCM4710_FILL_TLB(aend);, BCM4710_DUMMY_RREG();)
|
||||
+__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, , , , )
|
||||
+__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, , , , )
|
||||
/* blast_inv_dcache_range */
|
||||
-__BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, , )
|
||||
-__BUILD_BLAST_CACHE_RANGE(inv_s, scache, Hit_Invalidate_SD, , )
|
||||
+__BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, , , , BCM4710_DUMMY_RREG();)
|
||||
+__BUILD_BLAST_CACHE_RANGE(inv_s, scache, Hit_Invalidate_SD, , , , )
|
||||
|
||||
/* Currently, this is very specific to Loongson-3 */
|
||||
#define __BUILD_BLAST_CACHE_NODE(pfx, desc, indexop, hitop, lsize) \
|
||||
--- a/arch/mips/include/asm/stackframe.h
|
||||
+++ b/arch/mips/include/asm/stackframe.h
|
||||
@@ -429,6 +429,10 @@
|
||||
#else
|
||||
.set push
|
||||
.set arch=r4000
|
||||
+#ifdef CONFIG_BCM47XX
|
||||
+ nop
|
||||
+ nop
|
||||
+#endif
|
||||
eret
|
||||
.set pop
|
||||
#endif
|
||||
--- a/arch/mips/kernel/genex.S
|
||||
+++ b/arch/mips/kernel/genex.S
|
||||
@@ -21,6 +21,19 @@
|
||||
#include <asm/war.h>
|
||||
#include <asm/thread_info.h>
|
||||
|
||||
+#ifdef CONFIG_BCM47XX
|
||||
+# ifdef eret
|
||||
+# undef eret
|
||||
+# endif
|
||||
+# define eret \
|
||||
+ .set push; \
|
||||
+ .set noreorder; \
|
||||
+ nop; \
|
||||
+ nop; \
|
||||
+ eret; \
|
||||
+ .set pop;
|
||||
+#endif
|
||||
+
|
||||
__INIT
|
||||
|
||||
/*
|
||||
@@ -32,6 +45,9 @@
|
||||
NESTED(except_vec3_generic, 0, sp)
|
||||
.set push
|
||||
.set noat
|
||||
+#ifdef CONFIG_BCM47XX
|
||||
+ nop
|
||||
+#endif
|
||||
mfc0 k1, CP0_CAUSE
|
||||
andi k1, k1, 0x7c
|
||||
#ifdef CONFIG_64BIT
|
||||
@@ -52,6 +68,9 @@ NESTED(except_vec3_r4000, 0, sp)
|
||||
.set push
|
||||
.set arch=r4000
|
||||
.set noat
|
||||
+#ifdef CONFIG_BCM47XX
|
||||
+ nop
|
||||
+#endif
|
||||
mfc0 k1, CP0_CAUSE
|
||||
li k0, 31<<2
|
||||
andi k1, k1, 0x7c
|
||||
--- a/arch/mips/mm/c-r4k.c
|
||||
+++ b/arch/mips/mm/c-r4k.c
|
||||
@@ -39,6 +39,9 @@
|
||||
#include <asm/dma-coherence.h>
|
||||
#include <asm/mips-cps.h>
|
||||
|
||||
+/* For enabling BCM4710 cache workarounds */
|
||||
+static int bcm4710 = 0;
|
||||
+
|
||||
/*
|
||||
* Bits describing what cache ops an SMP callback function may perform.
|
||||
*
|
||||
@@ -190,6 +193,9 @@ static void r4k_blast_dcache_user_page_s
|
||||
{
|
||||
unsigned long dc_lsize = cpu_dcache_line_size();
|
||||
|
||||
+ if (bcm4710)
|
||||
+ r4k_blast_dcache_page = blast_dcache_page;
|
||||
+ else
|
||||
if (dc_lsize == 0)
|
||||
r4k_blast_dcache_user_page = (void *)cache_noop;
|
||||
else if (dc_lsize == 16)
|
||||
@@ -208,6 +214,9 @@ static void r4k_blast_dcache_page_indexe
|
||||
{
|
||||
unsigned long dc_lsize = cpu_dcache_line_size();
|
||||
|
||||
+ if (bcm4710)
|
||||
+ r4k_blast_dcache_page_indexed = blast_dcache_page_indexed;
|
||||
+ else
|
||||
if (dc_lsize == 0)
|
||||
r4k_blast_dcache_page_indexed = (void *)cache_noop;
|
||||
else if (dc_lsize == 16)
|
||||
@@ -227,6 +236,9 @@ static void r4k_blast_dcache_setup(void)
|
||||
{
|
||||
unsigned long dc_lsize = cpu_dcache_line_size();
|
||||
|
||||
+ if (bcm4710)
|
||||
+ r4k_blast_dcache = blast_dcache;
|
||||
+ else
|
||||
if (dc_lsize == 0)
|
||||
r4k_blast_dcache = (void *)cache_noop;
|
||||
else if (dc_lsize == 16)
|
||||
@@ -1779,6 +1791,17 @@ static void coherency_setup(void)
|
||||
* silly idea of putting something else there ...
|
||||
*/
|
||||
switch (current_cpu_type()) {
|
||||
+ case CPU_BMIPS3300:
|
||||
+ {
|
||||
+ u32 cm;
|
||||
+ cm = read_c0_diag();
|
||||
+ /* Enable icache */
|
||||
+ cm |= (1 << 31);
|
||||
+ /* Enable dcache */
|
||||
+ cm |= (1 << 30);
|
||||
+ write_c0_diag(cm);
|
||||
+ }
|
||||
+ break;
|
||||
case CPU_R4000PC:
|
||||
case CPU_R4000SC:
|
||||
case CPU_R4000MC:
|
||||
@@ -1825,6 +1848,15 @@ void r4k_cache_init(void)
|
||||
extern void build_copy_page(void);
|
||||
struct cpuinfo_mips *c = ¤t_cpu_data;
|
||||
|
||||
+ /* Check if special workarounds are required */
|
||||
+#if defined(CONFIG_BCM47XX) && !defined(CONFIG_CPU_MIPS32_R2)
|
||||
+ if (current_cpu_data.cputype == CPU_BMIPS32 && (current_cpu_data.processor_id & 0xff) == 0) {
|
||||
+ printk("Enabling BCM4710A0 cache workarounds.\n");
|
||||
+ bcm4710 = 1;
|
||||
+ } else
|
||||
+#endif
|
||||
+ bcm4710 = 0;
|
||||
+
|
||||
probe_pcache();
|
||||
probe_vcache();
|
||||
setup_scache();
|
||||
@@ -1901,7 +1933,15 @@ void r4k_cache_init(void)
|
||||
*/
|
||||
local_r4k___flush_cache_all(NULL);
|
||||
|
||||
+#ifdef CONFIG_BCM47XX
|
||||
+ {
|
||||
+ static void (*_coherency_setup)(void);
|
||||
+ _coherency_setup = (void (*)(void)) KSEG1ADDR(coherency_setup);
|
||||
+ _coherency_setup();
|
||||
+ }
|
||||
+#else
|
||||
coherency_setup();
|
||||
+#endif
|
||||
board_cache_error_setup = r4k_cache_error_setup;
|
||||
|
||||
/*
|
||||
--- a/arch/mips/mm/tlbex.c
|
||||
+++ b/arch/mips/mm/tlbex.c
|
||||
@@ -980,6 +980,9 @@ void build_get_pgde32(u32 **p, unsigned
|
||||
uasm_i_srl(p, ptr, ptr, SMP_CPUID_PTRSHIFT);
|
||||
uasm_i_addu(p, ptr, tmp, ptr);
|
||||
#else
|
||||
+#ifdef CONFIG_BCM47XX
|
||||
+ uasm_i_nop(p);
|
||||
+#endif
|
||||
UASM_i_LA_mostly(p, ptr, pgdc);
|
||||
#endif
|
||||
uasm_i_mfc0(p, tmp, C0_BADVADDR); /* get faulting address */
|
||||
@@ -1341,6 +1344,9 @@ static void build_r4000_tlb_refill_handl
|
||||
#ifdef CONFIG_64BIT
|
||||
build_get_pmde64(&p, &l, &r, K0, K1); /* get pmd in K1 */
|
||||
#else
|
||||
+# ifdef CONFIG_BCM47XX
|
||||
+ uasm_i_nop(&p);
|
||||
+# endif
|
||||
build_get_pgde32(&p, K0, K1); /* get pgd in K1 */
|
||||
#endif
|
||||
|
||||
@@ -1352,6 +1358,9 @@ static void build_r4000_tlb_refill_handl
|
||||
build_update_entries(&p, K0, K1);
|
||||
build_tlb_write_entry(&p, &l, &r, tlb_random);
|
||||
uasm_l_leave(&l, p);
|
||||
+#ifdef CONFIG_BCM47XX
|
||||
+ uasm_i_nop(&p);
|
||||
+#endif
|
||||
uasm_i_eret(&p); /* return from trap */
|
||||
}
|
||||
#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
|
||||
@@ -2052,6 +2061,9 @@ build_r4000_tlbchange_handler_head(u32 *
|
||||
#ifdef CONFIG_64BIT
|
||||
build_get_pmde64(p, l, r, wr.r1, wr.r2); /* get pmd in ptr */
|
||||
#else
|
||||
+# ifdef CONFIG_BCM47XX
|
||||
+ uasm_i_nop(p);
|
||||
+# endif
|
||||
build_get_pgde32(p, wr.r1, wr.r2); /* get pgd in ptr */
|
||||
#endif
|
||||
|
||||
@@ -2098,6 +2110,9 @@ build_r4000_tlbchange_handler_tail(u32 *
|
||||
build_tlb_write_entry(p, l, r, tlb_indexed);
|
||||
uasm_l_leave(l, *p);
|
||||
build_restore_work_registers(p);
|
||||
+#ifdef CONFIG_BCM47XX
|
||||
+ uasm_i_nop(p);
|
||||
+#endif
|
||||
uasm_i_eret(p); /* return from trap */
|
||||
|
||||
#ifdef CONFIG_64BIT
|
||||
@ -1,78 +0,0 @@
|
||||
From: Jeff Hansen <jhansen@cardaccess-inc.com>
|
||||
Subject: [PATCH] kmap_coherent
|
||||
|
||||
On ASUS WL-500gP there are some "Data bus error"s when executing simple
|
||||
commands liks "ps" or "cat /proc/1/cmdline".
|
||||
|
||||
This fixes OpenWrt ticket #1485: https://dev.openwrt.org/ticket/1485
|
||||
---
|
||||
--- a/arch/mips/include/asm/cpu-features.h
|
||||
+++ b/arch/mips/include/asm/cpu-features.h
|
||||
@@ -243,6 +243,9 @@
|
||||
#ifndef cpu_has_pindexed_dcache
|
||||
#define cpu_has_pindexed_dcache (cpu_data[0].dcache.flags & MIPS_CACHE_PINDEX)
|
||||
#endif
|
||||
+#ifndef cpu_use_kmap_coherent
|
||||
+#define cpu_use_kmap_coherent 1
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* I-Cache snoops remote store. This only matters on SMP. Some multiprocessors
|
||||
--- a/arch/mips/include/asm/mach-bcm47xx/cpu-feature-overrides.h
|
||||
+++ b/arch/mips/include/asm/mach-bcm47xx/cpu-feature-overrides.h
|
||||
@@ -80,4 +80,6 @@
|
||||
#define cpu_scache_line_size() 0
|
||||
#define cpu_has_vz 0
|
||||
|
||||
+#define cpu_use_kmap_coherent 0
|
||||
+
|
||||
#endif /* __ASM_MACH_BCM47XX_CPU_FEATURE_OVERRIDES_H */
|
||||
--- a/arch/mips/mm/c-r4k.c
|
||||
+++ b/arch/mips/mm/c-r4k.c
|
||||
@@ -697,7 +697,7 @@ static inline void local_r4k_flush_cache
|
||||
map_coherent = (cpu_has_dc_aliases &&
|
||||
page_mapcount(page) &&
|
||||
!Page_dcache_dirty(page));
|
||||
- if (map_coherent)
|
||||
+ if (map_coherent && cpu_use_kmap_coherent)
|
||||
vaddr = kmap_coherent(page, addr);
|
||||
else
|
||||
vaddr = kmap_atomic(page);
|
||||
@@ -719,7 +719,7 @@ static inline void local_r4k_flush_cache
|
||||
}
|
||||
|
||||
if (vaddr) {
|
||||
- if (map_coherent)
|
||||
+ if (map_coherent && cpu_use_kmap_coherent)
|
||||
kunmap_coherent();
|
||||
else
|
||||
kunmap_atomic(vaddr);
|
||||
--- a/arch/mips/mm/init.c
|
||||
+++ b/arch/mips/mm/init.c
|
||||
@@ -174,7 +174,7 @@ void copy_user_highpage(struct page *to,
|
||||
void *vfrom, *vto;
|
||||
|
||||
vto = kmap_atomic(to);
|
||||
- if (cpu_has_dc_aliases &&
|
||||
+ if (cpu_has_dc_aliases && cpu_use_kmap_coherent &&
|
||||
page_mapcount(from) && !Page_dcache_dirty(from)) {
|
||||
vfrom = kmap_coherent(from, vaddr);
|
||||
copy_page(vto, vfrom);
|
||||
@@ -196,7 +196,7 @@ void copy_to_user_page(struct vm_area_st
|
||||
struct page *page, unsigned long vaddr, void *dst, const void *src,
|
||||
unsigned long len)
|
||||
{
|
||||
- if (cpu_has_dc_aliases &&
|
||||
+ if (cpu_has_dc_aliases && cpu_use_kmap_coherent &&
|
||||
page_mapcount(page) && !Page_dcache_dirty(page)) {
|
||||
void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
|
||||
memcpy(vto, src, len);
|
||||
@@ -214,7 +214,7 @@ void copy_from_user_page(struct vm_area_
|
||||
struct page *page, unsigned long vaddr, void *dst, const void *src,
|
||||
unsigned long len)
|
||||
{
|
||||
- if (cpu_has_dc_aliases &&
|
||||
+ if (cpu_has_dc_aliases && cpu_use_kmap_coherent &&
|
||||
page_mapcount(page) && !Page_dcache_dirty(page)) {
|
||||
void *vfrom = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
|
||||
memcpy(dst, vfrom, len);
|
||||
@ -1,121 +0,0 @@
|
||||
From b36f694256f41bc71571f467646d015dda128d14 Mon Sep 17 00:00:00 2001
|
||||
From: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
Date: Sat, 9 Nov 2013 17:03:59 +0100
|
||||
Subject: [PATCH 210/210] b44: register adm switch
|
||||
|
||||
---
|
||||
drivers/net/ethernet/broadcom/b44.c | 57 +++++++++++++++++++++++++++++++++++
|
||||
drivers/net/ethernet/broadcom/b44.h | 3 ++
|
||||
2 files changed, 60 insertions(+)
|
||||
|
||||
--- a/drivers/net/ethernet/broadcom/b44.c
|
||||
+++ b/drivers/net/ethernet/broadcom/b44.c
|
||||
@@ -31,6 +31,8 @@
|
||||
#include <linux/ssb/ssb.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/phy.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/platform_data/adm6996-gpio.h>
|
||||
|
||||
#include <linux/uaccess.h>
|
||||
#include <asm/io.h>
|
||||
@@ -2249,6 +2251,69 @@ static void b44_adjust_link(struct net_d
|
||||
}
|
||||
}
|
||||
|
||||
+#ifdef CONFIG_BCM47XX
|
||||
+static int b44_register_adm_switch(struct b44 *bp)
|
||||
+{
|
||||
+ int gpio;
|
||||
+ struct platform_device *pdev;
|
||||
+ struct adm6996_gpio_platform_data adm_data = {0};
|
||||
+ struct platform_device_info info = {0};
|
||||
+
|
||||
+ adm_data.model = ADM6996L;
|
||||
+ gpio = bcm47xx_nvram_gpio_pin("adm_eecs");
|
||||
+ if (gpio >= 0)
|
||||
+ adm_data.eecs = gpio;
|
||||
+ else
|
||||
+ adm_data.eecs = 2;
|
||||
+
|
||||
+ gpio = bcm47xx_nvram_gpio_pin("adm_eesk");
|
||||
+ if (gpio >= 0)
|
||||
+ adm_data.eesk = gpio;
|
||||
+ else
|
||||
+ adm_data.eesk = 3;
|
||||
+
|
||||
+ gpio = bcm47xx_nvram_gpio_pin("adm_eedi");
|
||||
+ if (gpio >= 0)
|
||||
+ adm_data.eedi = gpio;
|
||||
+ else
|
||||
+ adm_data.eedi = 4;
|
||||
+
|
||||
+ /*
|
||||
+ * We ignore the "adm_rc" GPIO here. The driver does not use it,
|
||||
+ * and it conflicts with the Reset button GPIO on the Linksys WRT54GSv1.
|
||||
+ */
|
||||
+
|
||||
+ info.parent = bp->sdev->dev;
|
||||
+ info.name = "adm6996_gpio";
|
||||
+ info.id = -1;
|
||||
+ info.data = &adm_data;
|
||||
+ info.size_data = sizeof(adm_data);
|
||||
+
|
||||
+ if (!bp->adm_switch) {
|
||||
+ pdev = platform_device_register_full(&info);
|
||||
+ if (IS_ERR(pdev))
|
||||
+ return PTR_ERR(pdev);
|
||||
+
|
||||
+ bp->adm_switch = pdev;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+static void b44_unregister_adm_switch(struct b44 *bp)
|
||||
+{
|
||||
+ if (bp->adm_switch)
|
||||
+ platform_device_unregister(bp->adm_switch);
|
||||
+}
|
||||
+#else
|
||||
+static int b44_register_adm_switch(struct b44 *bp)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+static void b44_unregister_adm_switch(struct b44 *bp)
|
||||
+{
|
||||
+
|
||||
+}
|
||||
+#endif /* CONFIG_BCM47XX */
|
||||
+
|
||||
static int b44_register_phy_one(struct b44 *bp)
|
||||
{
|
||||
__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
|
||||
@@ -2285,6 +2350,9 @@ static int b44_register_phy_one(struct b
|
||||
if (!mdiobus_is_registered_device(bp->mii_bus, bp->phy_addr) &&
|
||||
(sprom->boardflags_lo & (B44_BOARDFLAG_ROBO | B44_BOARDFLAG_ADM))) {
|
||||
|
||||
+ if (sprom->boardflags_lo & B44_BOARDFLAG_ADM)
|
||||
+ b44_register_adm_switch(bp);
|
||||
+
|
||||
dev_info(sdev->dev,
|
||||
"could not find PHY at %i, use fixed one\n",
|
||||
bp->phy_addr);
|
||||
@@ -2481,6 +2549,7 @@ static void b44_remove_one(struct ssb_de
|
||||
unregister_netdev(dev);
|
||||
if (bp->flags & B44_FLAG_EXTERNAL_PHY)
|
||||
b44_unregister_phy_one(bp);
|
||||
+ b44_unregister_adm_switch(bp);
|
||||
ssb_device_disable(sdev, 0);
|
||||
ssb_bus_may_powerdown(sdev->bus);
|
||||
netif_napi_del(&bp->napi);
|
||||
--- a/drivers/net/ethernet/broadcom/b44.h
|
||||
+++ b/drivers/net/ethernet/broadcom/b44.h
|
||||
@@ -408,6 +408,9 @@ struct b44 {
|
||||
struct mii_bus *mii_bus;
|
||||
int old_link;
|
||||
struct mii_if_info mii_if;
|
||||
+
|
||||
+ /* platform device for associated switch */
|
||||
+ struct platform_device *adm_switch;
|
||||
};
|
||||
|
||||
#endif /* _B44_H */
|
||||
@ -1,54 +0,0 @@
|
||||
--- a/drivers/net/ethernet/broadcom/b44.c
|
||||
+++ b/drivers/net/ethernet/broadcom/b44.c
|
||||
@@ -431,10 +431,34 @@ static void b44_wap54g10_workaround(stru
|
||||
error:
|
||||
pr_warn("PHY: cannot reset MII transceiver isolate bit\n");
|
||||
}
|
||||
+
|
||||
+static void b44_bcm47xx_workarounds(struct b44 *bp)
|
||||
+{
|
||||
+ char buf[20];
|
||||
+ struct ssb_device *sdev = bp->sdev;
|
||||
+
|
||||
+ /* Toshiba WRC-1000, Siemens SE505 v1, Askey RT-210W, RT-220W */
|
||||
+ if (sdev->bus->sprom.board_num == 100) {
|
||||
+ bp->phy_addr = B44_PHY_ADDR_NO_LOCAL_PHY;
|
||||
+ } else {
|
||||
+ /* WL-HDD */
|
||||
+ if (bcm47xx_nvram_getenv("hardware_version", buf, sizeof(buf)) >= 0 &&
|
||||
+ !strncmp(buf, "WL300-", strlen("WL300-"))) {
|
||||
+ if (sdev->bus->sprom.et0phyaddr == 0 &&
|
||||
+ sdev->bus->sprom.et1phyaddr == 1)
|
||||
+ bp->phy_addr = B44_PHY_ADDR_NO_LOCAL_PHY;
|
||||
+ }
|
||||
+ }
|
||||
+ return;
|
||||
+}
|
||||
#else
|
||||
static inline void b44_wap54g10_workaround(struct b44 *bp)
|
||||
{
|
||||
}
|
||||
+
|
||||
+static inline void b44_bcm47xx_workarounds(struct b44 *bp)
|
||||
+{
|
||||
+}
|
||||
#endif
|
||||
|
||||
static int b44_setup_phy(struct b44 *bp)
|
||||
@@ -443,6 +467,7 @@ static int b44_setup_phy(struct b44 *bp)
|
||||
int err;
|
||||
|
||||
b44_wap54g10_workaround(bp);
|
||||
+ b44_bcm47xx_workarounds(bp);
|
||||
|
||||
if (bp->flags & B44_FLAG_EXTERNAL_PHY)
|
||||
return 0;
|
||||
@@ -2179,6 +2204,8 @@ static int b44_get_invariants(struct b44
|
||||
* valid PHY address. */
|
||||
bp->phy_addr &= 0x1F;
|
||||
|
||||
+ b44_bcm47xx_workarounds(bp);
|
||||
+
|
||||
memcpy(bp->dev->dev_addr, addr, ETH_ALEN);
|
||||
|
||||
if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){
|
||||
@ -1,25 +0,0 @@
|
||||
This prevents the options from being delete with make kernel_oldconfig.
|
||||
---
|
||||
drivers/ssb/Kconfig | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
--- a/drivers/bcma/Kconfig
|
||||
+++ b/drivers/bcma/Kconfig
|
||||
@@ -32,6 +32,7 @@ config BCMA_HOST_PCI
|
||||
config BCMA_HOST_SOC
|
||||
bool "Support for BCMA in a SoC"
|
||||
depends on HAS_IOMEM
|
||||
+ select USB_HCD_BCMA if USB_EHCI_HCD || USB_OHCI_HCD
|
||||
help
|
||||
Host interface for a Broadcom AIX bus directly mapped into
|
||||
the memory. This only works with the Broadcom SoCs from the
|
||||
--- a/drivers/ssb/Kconfig
|
||||
+++ b/drivers/ssb/Kconfig
|
||||
@@ -136,6 +136,7 @@ config SSB_SFLASH
|
||||
config SSB_EMBEDDED
|
||||
bool
|
||||
depends on SSB_DRIVER_MIPS && SSB_PCICORE_HOSTMODE
|
||||
+ select USB_HCD_SSB if USB_EHCI_HCD || USB_OHCI_HCD
|
||||
default y
|
||||
|
||||
config SSB_DRIVER_EXTIF
|
||||
@ -1,21 +0,0 @@
|
||||
From: Wolfram Joost <dbox2@frokaschwei.de>
|
||||
Subject: [PATCH] fork_cacheflush
|
||||
|
||||
On ASUS WL-500gP there are many unexpected "Segmentation fault"s that
|
||||
seem to be caused by a kernel. They can be avoided by:
|
||||
1) Disabling highpage
|
||||
2) Using flush_cache_mm in flush_cache_dup_mm
|
||||
|
||||
For details see OpenWrt ticket #2035 https://dev.openwrt.org/ticket/2035
|
||||
---
|
||||
--- a/arch/mips/include/asm/cacheflush.h
|
||||
+++ b/arch/mips/include/asm/cacheflush.h
|
||||
@@ -46,7 +46,7 @@
|
||||
extern void (*flush_cache_all)(void);
|
||||
extern void (*__flush_cache_all)(void);
|
||||
extern void (*flush_cache_mm)(struct mm_struct *mm);
|
||||
-#define flush_cache_dup_mm(mm) do { (void) (mm); } while (0)
|
||||
+#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
|
||||
extern void (*flush_cache_range)(struct vm_area_struct *vma,
|
||||
unsigned long start, unsigned long end);
|
||||
extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, unsigned long pfn);
|
||||
@ -1,74 +0,0 @@
|
||||
From: Jeff Hansen <jhansen@cardaccess-inc.com>
|
||||
Subject: [PATCH] no highpage
|
||||
|
||||
On ASUS WL-500gP there are many unexpected "Segmentation fault"s that
|
||||
seem to be caused by a kernel. They can be avoided by:
|
||||
1) Disabling highpage
|
||||
2) Using flush_cache_mm in flush_cache_dup_mm
|
||||
|
||||
For details see OpenWrt ticket #2035 https://dev.openwrt.org/ticket/2035
|
||||
---
|
||||
--- a/arch/mips/include/asm/page.h
|
||||
+++ b/arch/mips/include/asm/page.h
|
||||
@@ -71,6 +71,7 @@ static inline unsigned int page_size_ftl
|
||||
#endif /* CONFIG_MIPS_HUGE_TLB_SUPPORT */
|
||||
|
||||
#include <linux/pfn.h>
|
||||
+#include <asm/cpu-features.h>
|
||||
|
||||
extern void build_clear_page(void);
|
||||
extern void build_copy_page(void);
|
||||
@@ -110,11 +111,16 @@ static inline void clear_user_page(void
|
||||
flush_data_cache_page((unsigned long)addr);
|
||||
}
|
||||
|
||||
-struct vm_area_struct;
|
||||
-extern void copy_user_highpage(struct page *to, struct page *from,
|
||||
- unsigned long vaddr, struct vm_area_struct *vma);
|
||||
+static inline void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
|
||||
+ struct page *to)
|
||||
+{
|
||||
+ extern void (*flush_data_cache_page)(unsigned long addr);
|
||||
|
||||
-#define __HAVE_ARCH_COPY_USER_HIGHPAGE
|
||||
+ copy_page(vto, vfrom);
|
||||
+ if (!cpu_has_ic_fills_f_dc ||
|
||||
+ pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK))
|
||||
+ flush_data_cache_page((unsigned long)vto);
|
||||
+}
|
||||
|
||||
/*
|
||||
* These are used to make use of C type-checking..
|
||||
--- a/arch/mips/mm/init.c
|
||||
+++ b/arch/mips/mm/init.c
|
||||
@@ -168,30 +168,6 @@ void kunmap_coherent(void)
|
||||
preempt_enable();
|
||||
}
|
||||
|
||||
-void copy_user_highpage(struct page *to, struct page *from,
|
||||
- unsigned long vaddr, struct vm_area_struct *vma)
|
||||
-{
|
||||
- void *vfrom, *vto;
|
||||
-
|
||||
- vto = kmap_atomic(to);
|
||||
- if (cpu_has_dc_aliases && cpu_use_kmap_coherent &&
|
||||
- page_mapcount(from) && !Page_dcache_dirty(from)) {
|
||||
- vfrom = kmap_coherent(from, vaddr);
|
||||
- copy_page(vto, vfrom);
|
||||
- kunmap_coherent();
|
||||
- } else {
|
||||
- vfrom = kmap_atomic(from);
|
||||
- copy_page(vto, vfrom);
|
||||
- kunmap_atomic(vfrom);
|
||||
- }
|
||||
- if ((!cpu_has_ic_fills_f_dc) ||
|
||||
- pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK))
|
||||
- flush_data_cache_page((unsigned long)vto);
|
||||
- kunmap_atomic(vto);
|
||||
- /* Make sure this page is cleared on other CPU's too before using it */
|
||||
- smp_wmb();
|
||||
-}
|
||||
-
|
||||
void copy_to_user_page(struct vm_area_struct *vma,
|
||||
struct page *page, unsigned long vaddr, void *dst, const void *src,
|
||||
unsigned long len)
|
||||
@ -1,185 +0,0 @@
|
||||
--- a/arch/mips/bcm47xx/board.c
|
||||
+++ b/arch/mips/bcm47xx/board.c
|
||||
@@ -141,6 +141,7 @@ struct bcm47xx_board_type_list2 bcm47xx_
|
||||
{{BCM47XX_BOARD_LINKSYS_WRT300NV11, "Linksys WRT300N V1.1"}, "WRT300N", "1.1"},
|
||||
{{BCM47XX_BOARD_LINKSYS_WRT310NV1, "Linksys WRT310N V1"}, "WRT310N", "1.0"},
|
||||
{{BCM47XX_BOARD_LINKSYS_WRT310NV2, "Linksys WRT310N V2"}, "WRT310N", "2.0"},
|
||||
+ {{BCM47XX_BOARD_LINKSYS_WRT320N_V1, "Linksys WRT320N V1"}, "WRT320N", "1.0"},
|
||||
{{BCM47XX_BOARD_LINKSYS_WRT54G3GV2, "Linksys WRT54G3GV2-VF"}, "WRT54G3GV2-VF", "1.0"},
|
||||
{{BCM47XX_BOARD_LINKSYS_WRT610NV1, "Linksys WRT610N V1"}, "WRT610N", "1.0"},
|
||||
{{BCM47XX_BOARD_LINKSYS_WRT610NV2, "Linksys WRT610N V2"}, "WRT610N", "2.0"},
|
||||
@@ -161,9 +162,12 @@ struct bcm47xx_board_type_list1 bcm47xx_
|
||||
{{BCM47XX_BOARD_LUXUL_XWR_600_V1, "Luxul XWR-600 V1"}, "luxul_xwr600_v1"},
|
||||
{{BCM47XX_BOARD_LUXUL_XWR_1750_V1, "Luxul XWR-1750 V1"}, "luxul_xwr1750_v1"},
|
||||
{{BCM47XX_BOARD_NETGEAR_R6200_V1, "Netgear R6200 V1"}, "U12H192T00_NETGEAR"},
|
||||
+ {{BCM47XX_BOARD_NETGEAR_R6300_V1, "Netgear R6300 V1"}, "U12H218T00_NETGEAR"},
|
||||
{{BCM47XX_BOARD_NETGEAR_WGR614V8, "Netgear WGR614 V8"}, "U12H072T00_NETGEAR"},
|
||||
{{BCM47XX_BOARD_NETGEAR_WGR614V9, "Netgear WGR614 V9"}, "U12H094T00_NETGEAR"},
|
||||
{{BCM47XX_BOARD_NETGEAR_WGR614_V10, "Netgear WGR614 V10"}, "U12H139T01_NETGEAR"},
|
||||
+ {{BCM47XX_BOARD_NETGEAR_WN2500RP_V1, "Netgear WN2500RP V1"}, "U12H197T00_NETGEAR"},
|
||||
+ {{BCM47XX_BOARD_NETGEAR_WN2500RP_V2, "Netgear WN2500RP V2"}, "U12H294T00_NETGEAR"},
|
||||
{{BCM47XX_BOARD_NETGEAR_WNDR3300, "Netgear WNDR3300"}, "U12H093T00_NETGEAR"},
|
||||
{{BCM47XX_BOARD_NETGEAR_WNDR3400V1, "Netgear WNDR3400 V1"}, "U12H155T00_NETGEAR"},
|
||||
{{BCM47XX_BOARD_NETGEAR_WNDR3400V2, "Netgear WNDR3400 V2"}, "U12H187T00_NETGEAR"},
|
||||
--- a/arch/mips/bcm47xx/buttons.c
|
||||
+++ b/arch/mips/bcm47xx/buttons.c
|
||||
@@ -27,6 +27,12 @@
|
||||
/* Asus */
|
||||
|
||||
static const struct gpio_keys_button
|
||||
+bcm47xx_buttons_asus_rtn10u[] __initconst = {
|
||||
+ BCM47XX_GPIO_KEY(20, KEY_WPS_BUTTON),
|
||||
+ BCM47XX_GPIO_KEY(21, KEY_RESTART),
|
||||
+};
|
||||
+
|
||||
+static const struct gpio_keys_button
|
||||
bcm47xx_buttons_asus_rtn12[] __initconst = {
|
||||
BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
|
||||
BCM47XX_GPIO_KEY(1, KEY_RESTART),
|
||||
@@ -277,6 +283,18 @@ bcm47xx_buttons_linksys_wrt310nv1[] __in
|
||||
};
|
||||
|
||||
static const struct gpio_keys_button
|
||||
+bcm47xx_buttons_linksys_wrt310n_v2[] __initconst = {
|
||||
+ BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON),
|
||||
+ BCM47XX_GPIO_KEY(6, KEY_RESTART),
|
||||
+};
|
||||
+
|
||||
+static const struct gpio_keys_button
|
||||
+bcm47xx_buttons_linksys_wrt320n_v1[] __initconst = {
|
||||
+ BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON),
|
||||
+ BCM47XX_GPIO_KEY(8, KEY_RESTART),
|
||||
+};
|
||||
+
|
||||
+static const struct gpio_keys_button
|
||||
bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
|
||||
BCM47XX_GPIO_KEY(5, KEY_WIMAX),
|
||||
BCM47XX_GPIO_KEY(6, KEY_RESTART),
|
||||
@@ -392,6 +410,17 @@ bcm47xx_buttons_netgear_r6200_v1[] __ini
|
||||
};
|
||||
|
||||
static const struct gpio_keys_button
|
||||
+bcm47xx_buttons_netgear_r6300_v1[] __initconst = {
|
||||
+ BCM47XX_GPIO_KEY(6, KEY_RESTART),
|
||||
+};
|
||||
+
|
||||
+static const struct gpio_keys_button
|
||||
+bcm47xx_buttons_netgear_wn2500rp_v1[] __initconst = {
|
||||
+ BCM47XX_GPIO_KEY(12, KEY_RESTART),
|
||||
+ BCM47XX_GPIO_KEY(31, KEY_WPS_BUTTON),
|
||||
+};
|
||||
+
|
||||
+static const struct gpio_keys_button
|
||||
bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
|
||||
BCM47XX_GPIO_KEY(4, KEY_RESTART),
|
||||
BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
|
||||
@@ -478,6 +507,9 @@ int __init bcm47xx_buttons_register(void
|
||||
int err;
|
||||
|
||||
switch (board) {
|
||||
+ case BCM47XX_BOARD_ASUS_RTN10U:
|
||||
+ err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn10u);
|
||||
+ break;
|
||||
case BCM47XX_BOARD_ASUS_RTN12:
|
||||
err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn12);
|
||||
break;
|
||||
@@ -608,6 +640,12 @@ int __init bcm47xx_buttons_register(void
|
||||
case BCM47XX_BOARD_LINKSYS_WRT310NV1:
|
||||
err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1);
|
||||
break;
|
||||
+ case BCM47XX_BOARD_LINKSYS_WRT310NV2:
|
||||
+ err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310n_v2);
|
||||
+ break;
|
||||
+ case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
|
||||
+ err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt320n_v1);
|
||||
+ break;
|
||||
case BCM47XX_BOARD_LINKSYS_WRT54G3GV2:
|
||||
err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54g3gv2);
|
||||
break;
|
||||
@@ -674,6 +712,12 @@ int __init bcm47xx_buttons_register(void
|
||||
case BCM47XX_BOARD_NETGEAR_R6200_V1:
|
||||
err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6200_v1);
|
||||
break;
|
||||
+ case BCM47XX_BOARD_NETGEAR_R6300_V1:
|
||||
+ err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6300_v1);
|
||||
+ break;
|
||||
+ case BCM47XX_BOARD_NETGEAR_WN2500RP_V1:
|
||||
+ err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wn2500rp_v1);
|
||||
+ break;
|
||||
case BCM47XX_BOARD_NETGEAR_WNDR3400V1:
|
||||
err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3400v1);
|
||||
break;
|
||||
--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
|
||||
+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
|
||||
@@ -72,6 +72,7 @@ enum bcm47xx_board {
|
||||
BCM47XX_BOARD_LINKSYS_WRT300NV11,
|
||||
BCM47XX_BOARD_LINKSYS_WRT310NV1,
|
||||
BCM47XX_BOARD_LINKSYS_WRT310NV2,
|
||||
+ BCM47XX_BOARD_LINKSYS_WRT320N_V1,
|
||||
BCM47XX_BOARD_LINKSYS_WRT54G3GV2,
|
||||
BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0101,
|
||||
BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0467,
|
||||
@@ -99,9 +100,12 @@ enum bcm47xx_board {
|
||||
BCM47XX_BOARD_MOTOROLA_WR850GV2V3,
|
||||
|
||||
BCM47XX_BOARD_NETGEAR_R6200_V1,
|
||||
+ BCM47XX_BOARD_NETGEAR_R6300_V1,
|
||||
BCM47XX_BOARD_NETGEAR_WGR614V8,
|
||||
BCM47XX_BOARD_NETGEAR_WGR614V9,
|
||||
BCM47XX_BOARD_NETGEAR_WGR614_V10,
|
||||
+ BCM47XX_BOARD_NETGEAR_WN2500RP_V1,
|
||||
+ BCM47XX_BOARD_NETGEAR_WN2500RP_V2,
|
||||
BCM47XX_BOARD_NETGEAR_WNDR3300,
|
||||
BCM47XX_BOARD_NETGEAR_WNDR3400V1,
|
||||
BCM47XX_BOARD_NETGEAR_WNDR3400V2,
|
||||
--- a/arch/mips/bcm47xx/leds.c
|
||||
+++ b/arch/mips/bcm47xx/leds.c
|
||||
@@ -30,6 +30,14 @@
|
||||
/* Asus */
|
||||
|
||||
static const struct gpio_led
|
||||
+bcm47xx_leds_asus_rtn10u[] __initconst = {
|
||||
+ BCM47XX_GPIO_LED(5, "green", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
|
||||
+ BCM47XX_GPIO_LED(6, "green", "power", 1, LEDS_GPIO_DEFSTATE_ON),
|
||||
+ BCM47XX_GPIO_LED(7, "green", "wps", 0, LEDS_GPIO_DEFSTATE_OFF),
|
||||
+ BCM47XX_GPIO_LED(8, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
|
||||
+};
|
||||
+
|
||||
+static const struct gpio_led
|
||||
bcm47xx_leds_asus_rtn12[] __initconst = {
|
||||
BCM47XX_GPIO_LED(2, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
|
||||
BCM47XX_GPIO_LED(7, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
|
||||
@@ -314,6 +322,13 @@ bcm47xx_leds_linksys_wrt310nv1[] __initc
|
||||
};
|
||||
|
||||
static const struct gpio_led
|
||||
+bcm47xx_leds_linksys_wrt320n_v1[] __initconst = {
|
||||
+ BCM47XX_GPIO_LED(1, "blue", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
|
||||
+ BCM47XX_GPIO_LED(2, "blue", "power", 0, LEDS_GPIO_DEFSTATE_ON),
|
||||
+ BCM47XX_GPIO_LED(4, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
|
||||
+};
|
||||
+
|
||||
+static const struct gpio_led
|
||||
bcm47xx_leds_linksys_wrt54g_generic[] __initconst = {
|
||||
BCM47XX_GPIO_LED(0, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF),
|
||||
BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
|
||||
@@ -556,6 +571,9 @@ void __init bcm47xx_leds_register(void)
|
||||
enum bcm47xx_board board = bcm47xx_board_get();
|
||||
|
||||
switch (board) {
|
||||
+ case BCM47XX_BOARD_ASUS_RTN10U:
|
||||
+ bcm47xx_set_pdata(bcm47xx_leds_asus_rtn10u);
|
||||
+ break;
|
||||
case BCM47XX_BOARD_ASUS_RTN12:
|
||||
bcm47xx_set_pdata(bcm47xx_leds_asus_rtn12);
|
||||
break;
|
||||
@@ -689,6 +707,9 @@ void __init bcm47xx_leds_register(void)
|
||||
case BCM47XX_BOARD_LINKSYS_WRT310NV1:
|
||||
bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt310nv1);
|
||||
break;
|
||||
+ case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
|
||||
+ bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt320n_v1);
|
||||
+ break;
|
||||
case BCM47XX_BOARD_LINKSYS_WRT54G3GV2:
|
||||
bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54g3gv2);
|
||||
break;
|
||||
@ -1,34 +0,0 @@
|
||||
--- a/drivers/mtd/parsers/bcm47xxpart.c
|
||||
+++ b/drivers/mtd/parsers/bcm47xxpart.c
|
||||
@@ -98,6 +98,7 @@ static int bcm47xxpart_parse(struct mtd_
|
||||
int trx_num = 0; /* Number of found TRX partitions */
|
||||
int possible_nvram_sizes[] = { 0x8000, 0xF000, 0x10000, };
|
||||
int err;
|
||||
+ bool found_nvram = false;
|
||||
|
||||
/*
|
||||
* Some really old flashes (like AT45DB*) had smaller erasesize-s, but
|
||||
@@ -279,12 +280,23 @@ static int bcm47xxpart_parse(struct mtd_
|
||||
if (buf[0] == NVRAM_HEADER) {
|
||||
bcm47xxpart_add_part(&parts[curr_part++], "nvram",
|
||||
master->size - blocksize, 0);
|
||||
+ found_nvram = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
kfree(buf);
|
||||
|
||||
+ if (!found_nvram) {
|
||||
+ pr_err("can not find a nvram partition reserve last block\n");
|
||||
+ bcm47xxpart_add_part(&parts[curr_part++], "nvram_guess",
|
||||
+ master->size - blocksize * 2, MTD_WRITEABLE);
|
||||
+ for (i = 0; i < curr_part; i++) {
|
||||
+ if (parts[i].size + parts[i].offset == master->size)
|
||||
+ parts[i].offset -= blocksize * 2;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Assume that partitions end at the beginning of the one they are
|
||||
* followed by.
|
||||
@ -1,41 +0,0 @@
|
||||
From: b.sander
|
||||
Subject: [PATCH] pci: IDE fix
|
||||
|
||||
These are standard probing messages when using pdc202xx_old:
|
||||
pdc202xx_old 0000:00:01.0: IDE controller (0x105a:0x0d30 rev 0x02)
|
||||
PCI: Enabling device 0000:00:01.0 (0004 -> 0007)
|
||||
PCI: Fixing up device 0000:00:01.0
|
||||
0000:00:01.0: (U)DMA Burst Bit DISABLED Primary PCI Mode Secondary PCI Mode.
|
||||
0000:00:01.0: FORCING BURST BIT 0x00->0x01 ACTIVE
|
||||
pdc202xx_old 0000:00:01.0: 100% native mode on irq 6
|
||||
|
||||
With the default MAX_HWIFS value after above we get:
|
||||
ide2: BM-DMA at 0x0400-0x0407
|
||||
ide3: BM-DMA at 0x0408-0x040f
|
||||
Probing IDE interface ide2...
|
||||
hde: CF500, CFA DISK drive
|
||||
|
||||
As you can see it's ide2 + ide3 and hde.
|
||||
|
||||
With this patch applied we get:
|
||||
ide0: BM-DMA at 0x0400-0x0407
|
||||
ide1: BM-DMA at 0x0408-0x040f
|
||||
Probing IDE interface ide0...
|
||||
hda: CF500, CFA DISK drive
|
||||
|
||||
This fixes OpenWrt ticket #7061: https://dev.openwrt.org/ticket/7061
|
||||
---
|
||||
--- a/include/linux/ide.h
|
||||
+++ b/include/linux/ide.h
|
||||
@@ -236,7 +236,11 @@ static inline void ide_std_init_ports(st
|
||||
hw->io_ports.ctl_addr = ctl_addr;
|
||||
}
|
||||
|
||||
+#if defined CONFIG_BCM47XX
|
||||
+# define MAX_HWIFS 2
|
||||
+#else
|
||||
#define MAX_HWIFS 10
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* Now for the data we need to maintain per-drive: ide_drive_t
|
||||
@ -1,17 +0,0 @@
|
||||
When the Ethernet controller is powered down and someone wants to
|
||||
access the mdio bus like the witch driver (b53) the system crashed if
|
||||
PCI_D3hot was set before. This patch deactivates this power sawing mode
|
||||
when a switch driver is in use.
|
||||
|
||||
--- a/drivers/net/ethernet/broadcom/tg3.c
|
||||
+++ b/drivers/net/ethernet/broadcom/tg3.c
|
||||
@@ -4279,7 +4279,8 @@ static int tg3_power_down_prepare(struct
|
||||
static void tg3_power_down(struct tg3 *tp)
|
||||
{
|
||||
pci_wake_from_d3(tp->pdev, tg3_flag(tp, WOL_ENABLE));
|
||||
- pci_set_power_state(tp->pdev, PCI_D3hot);
|
||||
+ if (!tg3_flag(tp, ROBOSWITCH))
|
||||
+ pci_set_power_state(tp->pdev, PCI_D3hot);
|
||||
}
|
||||
|
||||
static void tg3_aux_stat_to_speed_duplex(struct tg3 *tp, u32 val, u32 *speed, u8 *duplex)
|
||||
@ -1,73 +0,0 @@
|
||||
From 597715c61ae75a05ab3310a34ff3857a006f0f63 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
|
||||
Date: Thu, 20 Nov 2014 21:32:42 +0100
|
||||
Subject: [PATCH] bcma: add table of serial flashes with smaller blocks
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
||||
---
|
||||
drivers/bcma/driver_chipcommon_sflash.c | 29 +++++++++++++++++++++++++++++
|
||||
1 file changed, 29 insertions(+)
|
||||
|
||||
--- a/drivers/bcma/driver_chipcommon_sflash.c
|
||||
+++ b/drivers/bcma/driver_chipcommon_sflash.c
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/bcma/bcma.h>
|
||||
+#include <bcm47xx_board.h>
|
||||
|
||||
static struct resource bcma_sflash_resource = {
|
||||
.name = "bcma_sflash",
|
||||
@@ -42,6 +43,13 @@ static const struct bcma_sflash_tbl_e bc
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
+/* Some devices use smaller blocks (and have more of them) */
|
||||
+static const struct bcma_sflash_tbl_e bcma_sflash_st_shrink_tbl[] = {
|
||||
+ { "M25P16", 0x14, 0x1000, 512, },
|
||||
+ { "M25P32", 0x15, 0x1000, 1024, },
|
||||
+ { NULL },
|
||||
+};
|
||||
+
|
||||
static const struct bcma_sflash_tbl_e bcma_sflash_sst_tbl[] = {
|
||||
{ "SST25WF512", 1, 0x1000, 16, },
|
||||
{ "SST25VF512", 0x48, 0x1000, 16, },
|
||||
@@ -85,6 +93,24 @@ static void bcma_sflash_cmd(struct bcma_
|
||||
bcma_err(cc->core->bus, "SFLASH control command failed (timeout)!\n");
|
||||
}
|
||||
|
||||
+const struct bcma_sflash_tbl_e *bcma_sflash_shrink_flash(u32 id)
|
||||
+{
|
||||
+ enum bcm47xx_board board = bcm47xx_board_get();
|
||||
+ const struct bcma_sflash_tbl_e *e;
|
||||
+
|
||||
+ switch (board) {
|
||||
+ case BCM47XX_BOARD_NETGEAR_WGR614_V10:
|
||||
+ case BCM47XX_BOARD_NETGEAR_WNR1000_V3:
|
||||
+ for (e = bcma_sflash_st_shrink_tbl; e->name; e++) {
|
||||
+ if (e->id == id)
|
||||
+ return e;
|
||||
+ }
|
||||
+ return NULL;
|
||||
+ default:
|
||||
+ return NULL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/* Initialize serial flash access */
|
||||
int bcma_sflash_init(struct bcma_drv_cc *cc)
|
||||
{
|
||||
@@ -115,6 +141,10 @@ int bcma_sflash_init(struct bcma_drv_cc
|
||||
case 0x13:
|
||||
return -ENOTSUPP;
|
||||
default:
|
||||
+ e = bcma_sflash_shrink_flash(id);
|
||||
+ if (e)
|
||||
+ break;
|
||||
+
|
||||
for (e = bcma_sflash_st_tbl; e->name; e++) {
|
||||
if (e->id == id)
|
||||
break;
|
||||
@ -1,295 +0,0 @@
|
||||
The Netgear wgt634u uses a different format for storing the
|
||||
configuration. This patch is needed to read out the correct
|
||||
configuration. The cfe_env.c file uses a different method way to read
|
||||
out the configuration than the in kernel cfe config reader.
|
||||
|
||||
--- a/drivers/firmware/broadcom/Makefile
|
||||
+++ b/drivers/firmware/broadcom/Makefile
|
||||
@@ -1,3 +1,3 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
-obj-$(CONFIG_BCM47XX_NVRAM) += bcm47xx_nvram.o
|
||||
+obj-$(CONFIG_BCM47XX_NVRAM) += bcm47xx_nvram.o cfe_env.o
|
||||
obj-$(CONFIG_BCM47XX_SPROM) += bcm47xx_sprom.o
|
||||
--- /dev/null
|
||||
+++ b/drivers/firmware/broadcom/cfe_env.c
|
||||
@@ -0,0 +1,228 @@
|
||||
+/*
|
||||
+ * CFE environment variable access
|
||||
+ *
|
||||
+ * Copyright 2001-2003, Broadcom Corporation
|
||||
+ * Copyright 2006, Felix Fietkau <nbd@nbd.name>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify it
|
||||
+ * under the terms of the GNU General Public License as published by the
|
||||
+ * Free Software Foundation; either version 2 of the License, or (at your
|
||||
+ * option) any later version.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/string.h>
|
||||
+#include <asm/io.h>
|
||||
+#include <linux/uaccess.h>
|
||||
+
|
||||
+#define NVRAM_SIZE (0x1ff0)
|
||||
+static char _nvdata[NVRAM_SIZE];
|
||||
+static char _valuestr[256];
|
||||
+
|
||||
+/*
|
||||
+ * TLV types. These codes are used in the "type-length-value"
|
||||
+ * encoding of the items stored in the NVRAM device (flash or EEPROM)
|
||||
+ *
|
||||
+ * The layout of the flash/nvram is as follows:
|
||||
+ *
|
||||
+ * <type> <length> <data ...> <type> <length> <data ...> <type_end>
|
||||
+ *
|
||||
+ * The type code of "ENV_TLV_TYPE_END" marks the end of the list.
|
||||
+ * The "length" field marks the length of the data section, not
|
||||
+ * including the type and length fields.
|
||||
+ *
|
||||
+ * Environment variables are stored as follows:
|
||||
+ *
|
||||
+ * <type_env> <length> <flags> <name> = <value>
|
||||
+ *
|
||||
+ * If bit 0 (low bit) is set, the length is an 8-bit value.
|
||||
+ * If bit 0 (low bit) is clear, the length is a 16-bit value
|
||||
+ *
|
||||
+ * Bit 7 set indicates "user" TLVs. In this case, bit 0 still
|
||||
+ * indicates the size of the length field.
|
||||
+ *
|
||||
+ * Flags are from the constants below:
|
||||
+ *
|
||||
+ */
|
||||
+#define ENV_LENGTH_16BITS 0x00 /* for low bit */
|
||||
+#define ENV_LENGTH_8BITS 0x01
|
||||
+
|
||||
+#define ENV_TYPE_USER 0x80
|
||||
+
|
||||
+#define ENV_CODE_SYS(n,l) (((n)<<1)|(l))
|
||||
+#define ENV_CODE_USER(n,l) ((((n)<<1)|(l)) | ENV_TYPE_USER)
|
||||
+
|
||||
+/*
|
||||
+ * The actual TLV types we support
|
||||
+ */
|
||||
+
|
||||
+#define ENV_TLV_TYPE_END 0x00
|
||||
+#define ENV_TLV_TYPE_ENV ENV_CODE_SYS(0,ENV_LENGTH_8BITS)
|
||||
+
|
||||
+/*
|
||||
+ * Environment variable flags
|
||||
+ */
|
||||
+
|
||||
+#define ENV_FLG_NORMAL 0x00 /* normal read/write */
|
||||
+#define ENV_FLG_BUILTIN 0x01 /* builtin - not stored in flash */
|
||||
+#define ENV_FLG_READONLY 0x02 /* read-only - cannot be changed */
|
||||
+
|
||||
+#define ENV_FLG_MASK 0xFF /* mask of attributes we keep */
|
||||
+#define ENV_FLG_ADMIN 0x100 /* lets us internally override permissions */
|
||||
+
|
||||
+
|
||||
+/* *********************************************************************
|
||||
+ * _nvram_read(buffer,offset,length)
|
||||
+ *
|
||||
+ * Read data from the NVRAM device
|
||||
+ *
|
||||
+ * Input parameters:
|
||||
+ * buffer - destination buffer
|
||||
+ * offset - offset of data to read
|
||||
+ * length - number of bytes to read
|
||||
+ *
|
||||
+ * Return value:
|
||||
+ * number of bytes read, or <0 if error occured
|
||||
+ ********************************************************************* */
|
||||
+static int
|
||||
+_nvram_read(unsigned char *nv_buf, unsigned char *buffer, int offset, int length)
|
||||
+{
|
||||
+ int i;
|
||||
+ if (offset > NVRAM_SIZE)
|
||||
+ return -1;
|
||||
+
|
||||
+ for ( i = 0; i < length; i++) {
|
||||
+ buffer[i] = ((volatile unsigned char*)nv_buf)[offset + i];
|
||||
+ }
|
||||
+ return length;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static char*
|
||||
+_strnchr(const char *dest,int c,size_t cnt)
|
||||
+{
|
||||
+ while (*dest && (cnt > 0)) {
|
||||
+ if (*dest == c) return (char *) dest;
|
||||
+ dest++;
|
||||
+ cnt--;
|
||||
+ }
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * Core support API: Externally visible.
|
||||
+ */
|
||||
+
|
||||
+/*
|
||||
+ * Get the value of an NVRAM variable
|
||||
+ * @param name name of variable to get
|
||||
+ * @return value of variable or NULL if undefined
|
||||
+ */
|
||||
+
|
||||
+char *cfe_env_get(unsigned char *nv_buf, const char *name)
|
||||
+{
|
||||
+ int size;
|
||||
+ unsigned char *buffer;
|
||||
+ unsigned char *ptr;
|
||||
+ unsigned char *envval;
|
||||
+ unsigned int reclen;
|
||||
+ unsigned int rectype;
|
||||
+ int offset;
|
||||
+ int flg;
|
||||
+
|
||||
+ if (!strcmp(name, "nvram_type"))
|
||||
+ return "cfe";
|
||||
+
|
||||
+ size = NVRAM_SIZE;
|
||||
+ buffer = &_nvdata[0];
|
||||
+
|
||||
+ ptr = buffer;
|
||||
+ offset = 0;
|
||||
+
|
||||
+ /* Read the record type and length */
|
||||
+ if (_nvram_read(nv_buf, ptr,offset,1) != 1) {
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ while ((*ptr != ENV_TLV_TYPE_END) && (size > 1)) {
|
||||
+
|
||||
+ /* Adjust pointer for TLV type */
|
||||
+ rectype = *(ptr);
|
||||
+ offset++;
|
||||
+ size--;
|
||||
+
|
||||
+ /*
|
||||
+ * Read the length. It can be either 1 or 2 bytes
|
||||
+ * depending on the code
|
||||
+ */
|
||||
+ if (rectype & ENV_LENGTH_8BITS) {
|
||||
+ /* Read the record type and length - 8 bits */
|
||||
+ if (_nvram_read(nv_buf, ptr,offset,1) != 1) {
|
||||
+ goto error;
|
||||
+ }
|
||||
+ reclen = *(ptr);
|
||||
+ size--;
|
||||
+ offset++;
|
||||
+ }
|
||||
+ else {
|
||||
+ /* Read the record type and length - 16 bits, MSB first */
|
||||
+ if (_nvram_read(nv_buf, ptr,offset,2) != 2) {
|
||||
+ goto error;
|
||||
+ }
|
||||
+ reclen = (((unsigned int) *(ptr)) << 8) + (unsigned int) *(ptr+1);
|
||||
+ size -= 2;
|
||||
+ offset += 2;
|
||||
+ }
|
||||
+
|
||||
+ if (reclen > size)
|
||||
+ break; /* should not happen, bad NVRAM */
|
||||
+
|
||||
+ switch (rectype) {
|
||||
+ case ENV_TLV_TYPE_ENV:
|
||||
+ /* Read the TLV data */
|
||||
+ if (_nvram_read(nv_buf, ptr,offset,reclen) != reclen)
|
||||
+ goto error;
|
||||
+ flg = *ptr++;
|
||||
+ envval = (unsigned char *) _strnchr(ptr,'=',(reclen-1));
|
||||
+ if (envval) {
|
||||
+ *envval++ = '\0';
|
||||
+ memcpy(_valuestr,envval,(reclen-1)-(envval-ptr));
|
||||
+ _valuestr[(reclen-1)-(envval-ptr)] = '\0';
|
||||
+#if 0
|
||||
+ printk(KERN_INFO "NVRAM:%s=%s\n", ptr, _valuestr);
|
||||
+#endif
|
||||
+ if(!strcmp(ptr, name)){
|
||||
+ return _valuestr;
|
||||
+ }
|
||||
+ if((strlen(ptr) > 1) && !strcmp(&ptr[1], name))
|
||||
+ return _valuestr;
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ /* Unknown TLV type, skip it. */
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Advance to next TLV
|
||||
+ */
|
||||
+
|
||||
+ size -= (int)reclen;
|
||||
+ offset += reclen;
|
||||
+
|
||||
+ /* Read the next record type */
|
||||
+ ptr = buffer;
|
||||
+ if (_nvram_read(nv_buf, ptr,offset,1) != 1)
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+error:
|
||||
+ return NULL;
|
||||
+
|
||||
+}
|
||||
+
|
||||
--- a/drivers/firmware/broadcom/bcm47xx_nvram.c
|
||||
+++ b/drivers/firmware/broadcom/bcm47xx_nvram.c
|
||||
@@ -33,6 +33,8 @@ struct nvram_header {
|
||||
static char nvram_buf[NVRAM_SPACE];
|
||||
static size_t nvram_len;
|
||||
static const u32 nvram_sizes[] = {0x6000, 0x8000, 0xF000, 0x10000};
|
||||
+static int cfe_env;
|
||||
+extern char *cfe_env_get(char *nv_buf, const char *name);
|
||||
|
||||
/**
|
||||
* bcm47xx_nvram_is_valid - check for a valid NVRAM at specified memory
|
||||
@@ -80,6 +82,26 @@ static int bcm47xx_nvram_find_and_copy(v
|
||||
return -EEXIST;
|
||||
}
|
||||
|
||||
+ cfe_env = 0;
|
||||
+
|
||||
+ /* XXX: hack for supporting the CFE environment stuff on WGT634U */
|
||||
+ if (res_size >= 8 * 1024 * 1024) {
|
||||
+ u32 *src = (u32 *)(flash_start + 8 * 1024 * 1024 - 0x2000);
|
||||
+ u32 *dst = (u32 *)nvram_buf;
|
||||
+
|
||||
+ if ((*src & 0xff00ff) == 0x000001) {
|
||||
+ printk("early_nvram_init: WGT634U NVRAM found.\n");
|
||||
+
|
||||
+ for (i = 0; i < 0x1ff0; i++) {
|
||||
+ if (*src == 0xFFFFFFFF)
|
||||
+ break;
|
||||
+ *dst++ = *src++;
|
||||
+ }
|
||||
+ cfe_env = 1;
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* TODO: when nvram is on nand flash check for bad blocks first. */
|
||||
|
||||
/* Try every possible flash size and check for NVRAM at its end */
|
||||
@@ -172,6 +194,13 @@ int bcm47xx_nvram_getenv(const char *nam
|
||||
if (!name)
|
||||
return -EINVAL;
|
||||
|
||||
+ if (cfe_env) {
|
||||
+ value = cfe_env_get(nvram_buf, name);
|
||||
+ if (!value)
|
||||
+ return -ENOENT;
|
||||
+ return snprintf(val, val_len, "%s", value);
|
||||
+ }
|
||||
+
|
||||
if (!nvram_len) {
|
||||
err = nvram_init();
|
||||
if (err)
|
||||
@ -1,101 +0,0 @@
|
||||
--- a/arch/mips/bcm47xx/setup.c
|
||||
+++ b/arch/mips/bcm47xx/setup.c
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <linux/ssb/ssb.h>
|
||||
#include <linux/ssb/ssb_embedded.h>
|
||||
#include <linux/bcma/bcma_soc.h>
|
||||
+#include <linux/old_gpio_wdt.h>
|
||||
#include <asm/bootinfo.h>
|
||||
#include <asm/idle.h>
|
||||
#include <asm/prom.h>
|
||||
@@ -254,6 +255,33 @@ static struct fixed_phy_status bcm47xx_f
|
||||
.duplex = DUPLEX_FULL,
|
||||
};
|
||||
|
||||
+static struct gpio_wdt_platform_data gpio_wdt_data;
|
||||
+
|
||||
+static struct platform_device gpio_wdt_device = {
|
||||
+ .name = "gpio-wdt",
|
||||
+ .id = 0,
|
||||
+ .dev = {
|
||||
+ .platform_data = &gpio_wdt_data,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static int __init bcm47xx_register_gpio_watchdog(void)
|
||||
+{
|
||||
+ enum bcm47xx_board board = bcm47xx_board_get();
|
||||
+
|
||||
+ switch (board) {
|
||||
+ case BCM47XX_BOARD_HUAWEI_E970:
|
||||
+ pr_info("bcm47xx: detected Huawei E970 or similar, starting early gpio_wdt timer\n");
|
||||
+ gpio_wdt_data.gpio = 7;
|
||||
+ gpio_wdt_data.interval = HZ;
|
||||
+ gpio_wdt_data.first_interval = HZ / 5;
|
||||
+ return platform_device_register(&gpio_wdt_device);
|
||||
+ default:
|
||||
+ /* Nothing to do */
|
||||
+ return 0;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static int __init bcm47xx_register_bus_complete(void)
|
||||
{
|
||||
switch (bcm47xx_bus_type) {
|
||||
@@ -275,6 +303,7 @@ static int __init bcm47xx_register_bus_c
|
||||
bcm47xx_workarounds();
|
||||
|
||||
fixed_phy_add(PHY_POLL, 0, &bcm47xx_fixed_phy_status);
|
||||
+ bcm47xx_register_gpio_watchdog();
|
||||
return 0;
|
||||
}
|
||||
device_initcall(bcm47xx_register_bus_complete);
|
||||
--- a/arch/mips/configs/bcm47xx_defconfig
|
||||
+++ b/arch/mips/configs/bcm47xx_defconfig
|
||||
@@ -63,6 +63,7 @@ CONFIG_HW_RANDOM=y
|
||||
CONFIG_GPIO_SYSFS=y
|
||||
CONFIG_WATCHDOG=y
|
||||
CONFIG_BCM47XX_WDT=y
|
||||
+CONFIG_GPIO_WDT=y
|
||||
CONFIG_SSB_DRIVER_GIGE=y
|
||||
CONFIG_BCMA_DRIVER_GMAC_CMN=y
|
||||
CONFIG_USB=y
|
||||
--- a/drivers/ssb/embedded.c
|
||||
+++ b/drivers/ssb/embedded.c
|
||||
@@ -34,11 +34,36 @@ int ssb_watchdog_timer_set(struct ssb_bu
|
||||
}
|
||||
EXPORT_SYMBOL(ssb_watchdog_timer_set);
|
||||
|
||||
+#ifdef CONFIG_BCM47XX
|
||||
+#include <bcm47xx_board.h>
|
||||
+
|
||||
+static bool ssb_watchdog_supported(void)
|
||||
+{
|
||||
+ enum bcm47xx_board board = bcm47xx_board_get();
|
||||
+
|
||||
+ /* The Huawei E970 has a hardware watchdog using a GPIO */
|
||||
+ switch (board) {
|
||||
+ case BCM47XX_BOARD_HUAWEI_E970:
|
||||
+ return false;
|
||||
+ default:
|
||||
+ return true;
|
||||
+ }
|
||||
+}
|
||||
+#else
|
||||
+static bool ssb_watchdog_supported(void)
|
||||
+{
|
||||
+ return true;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
int ssb_watchdog_register(struct ssb_bus *bus)
|
||||
{
|
||||
struct bcm47xx_wdt wdt = {};
|
||||
struct platform_device *pdev;
|
||||
|
||||
+ if (!ssb_watchdog_supported())
|
||||
+ return 0;
|
||||
+
|
||||
if (ssb_chipco_available(&bus->chipco)) {
|
||||
wdt.driver_data = &bus->chipco;
|
||||
wdt.timer_set = ssb_chipco_watchdog_timer_set_wdt;
|
||||
@ -1,360 +0,0 @@
|
||||
This generic GPIO watchdog is used on Huawei E970 (bcm47xx)
|
||||
|
||||
Signed-off-by: Mathias Adam <m.adam--openwrt@adamis.de>
|
||||
|
||||
--- a/drivers/watchdog/Kconfig
|
||||
+++ b/drivers/watchdog/Kconfig
|
||||
@@ -1657,6 +1657,15 @@ config WDT_MTX1
|
||||
Hardware driver for the MTX-1 boards. This is a watchdog timer that
|
||||
will reboot the machine after a 100 seconds timer expired.
|
||||
|
||||
+config GPIO_WDT
|
||||
+ tristate "GPIO Hardware Watchdog"
|
||||
+ help
|
||||
+ Hardware driver for GPIO-controlled watchdogs. GPIO pin and
|
||||
+ toggle interval settings are platform-specific. The driver
|
||||
+ will stop toggling the GPIO (i.e. machine reboots) after a
|
||||
+ 100 second timer expired and no process has written to
|
||||
+ /dev/watchdog during that time.
|
||||
+
|
||||
config PNX833X_WDT
|
||||
tristate "PNX833x Hardware Watchdog"
|
||||
depends on SOC_PNX8335
|
||||
--- a/drivers/watchdog/Makefile
|
||||
+++ b/drivers/watchdog/Makefile
|
||||
@@ -158,6 +158,7 @@ obj-$(CONFIG_RC32434_WDT) += rc32434_wdt
|
||||
obj-$(CONFIG_INDYDOG) += indydog.o
|
||||
obj-$(CONFIG_JZ4740_WDT) += jz4740_wdt.o
|
||||
obj-$(CONFIG_WDT_MTX1) += mtx-1_wdt.o
|
||||
+obj-$(CONFIG_GPIO_WDT) += old_gpio_wdt.o
|
||||
obj-$(CONFIG_PNX833X_WDT) += pnx833x_wdt.o
|
||||
obj-$(CONFIG_SIBYTE_WDOG) += sb_wdog.o
|
||||
obj-$(CONFIG_AR7_WDT) += ar7_wdt.o
|
||||
--- /dev/null
|
||||
+++ b/drivers/watchdog/old_gpio_wdt.c
|
||||
@@ -0,0 +1,301 @@
|
||||
+/*
|
||||
+ * Driver for GPIO-controlled Hardware Watchdogs.
|
||||
+ *
|
||||
+ * Copyright (C) 2013 Mathias Adam <m.adam--linux@adamis.de>
|
||||
+ *
|
||||
+ * Replaces mtx1_wdt (driver for the MTX-1 Watchdog):
|
||||
+ *
|
||||
+ * (C) Copyright 2005 4G Systems <info@4g-systems.biz>,
|
||||
+ * All Rights Reserved.
|
||||
+ * http://www.4g-systems.biz
|
||||
+ *
|
||||
+ * (C) Copyright 2007 OpenWrt.org, Florian Fainelli <florian@openwrt.org>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License
|
||||
+ * as published by the Free Software Foundation; either version
|
||||
+ * 2 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * Neither Michael Stickel nor 4G Systems admit liability nor provide
|
||||
+ * warranty for any of this software. This material is provided
|
||||
+ * "AS-IS" and at no charge.
|
||||
+ *
|
||||
+ * (c) Copyright 2005 4G Systems <info@4g-systems.biz>
|
||||
+ *
|
||||
+ * Release 0.01.
|
||||
+ * Author: Michael Stickel michael.stickel@4g-systems.biz
|
||||
+ *
|
||||
+ * Release 0.02.
|
||||
+ * Author: Florian Fainelli florian@openwrt.org
|
||||
+ * use the Linux watchdog/timer APIs
|
||||
+ *
|
||||
+ * Release 0.03.
|
||||
+ * Author: Mathias Adam <m.adam--linux@adamis.de>
|
||||
+ * make it a generic gpio watchdog driver
|
||||
+ *
|
||||
+ * The Watchdog is configured to reset the MTX-1
|
||||
+ * if it is not triggered for 100 seconds.
|
||||
+ * It should not be triggered more often than 1.6 seconds.
|
||||
+ *
|
||||
+ * A timer triggers the watchdog every 5 seconds, until
|
||||
+ * it is opened for the first time. After the first open
|
||||
+ * it MUST be triggered every 2..95 seconds.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/moduleparam.h>
|
||||
+#include <linux/types.h>
|
||||
+#include <linux/errno.h>
|
||||
+#include <linux/miscdevice.h>
|
||||
+#include <linux/fs.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/ioport.h>
|
||||
+#include <linux/timer.h>
|
||||
+#include <linux/completion.h>
|
||||
+#include <linux/jiffies.h>
|
||||
+#include <linux/watchdog.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/uaccess.h>
|
||||
+#include <linux/gpio.h>
|
||||
+#include <linux/old_gpio_wdt.h>
|
||||
+
|
||||
+static int ticks = 100 * HZ;
|
||||
+
|
||||
+static struct {
|
||||
+ struct completion stop;
|
||||
+ spinlock_t lock;
|
||||
+ int running;
|
||||
+ struct timer_list timer;
|
||||
+ int queue;
|
||||
+ int default_ticks;
|
||||
+ unsigned long inuse;
|
||||
+ unsigned gpio;
|
||||
+ unsigned int gstate;
|
||||
+ int interval;
|
||||
+ int first_interval;
|
||||
+} gpio_wdt_device;
|
||||
+
|
||||
+static void gpio_wdt_trigger(struct timer_list *unused)
|
||||
+{
|
||||
+ spin_lock(&gpio_wdt_device.lock);
|
||||
+ if (gpio_wdt_device.running && ticks > 0)
|
||||
+ ticks -= gpio_wdt_device.interval;
|
||||
+
|
||||
+ /* toggle wdt gpio */
|
||||
+ gpio_wdt_device.gstate = !gpio_wdt_device.gstate;
|
||||
+ gpio_set_value(gpio_wdt_device.gpio, gpio_wdt_device.gstate);
|
||||
+
|
||||
+ if (gpio_wdt_device.queue && ticks > 0)
|
||||
+ mod_timer(&gpio_wdt_device.timer, jiffies + gpio_wdt_device.interval);
|
||||
+ else
|
||||
+ complete(&gpio_wdt_device.stop);
|
||||
+ spin_unlock(&gpio_wdt_device.lock);
|
||||
+}
|
||||
+
|
||||
+static void gpio_wdt_reset(void)
|
||||
+{
|
||||
+ ticks = gpio_wdt_device.default_ticks;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static void gpio_wdt_start(void)
|
||||
+{
|
||||
+ unsigned long flags;
|
||||
+
|
||||
+ spin_lock_irqsave(&gpio_wdt_device.lock, flags);
|
||||
+ if (!gpio_wdt_device.queue) {
|
||||
+ gpio_wdt_device.queue = 1;
|
||||
+ gpio_wdt_device.gstate = 1;
|
||||
+ gpio_set_value(gpio_wdt_device.gpio, 1);
|
||||
+ mod_timer(&gpio_wdt_device.timer, jiffies + gpio_wdt_device.first_interval);
|
||||
+ }
|
||||
+ gpio_wdt_device.running++;
|
||||
+ spin_unlock_irqrestore(&gpio_wdt_device.lock, flags);
|
||||
+}
|
||||
+
|
||||
+static int gpio_wdt_stop(void)
|
||||
+{
|
||||
+ unsigned long flags;
|
||||
+
|
||||
+ spin_lock_irqsave(&gpio_wdt_device.lock, flags);
|
||||
+ if (gpio_wdt_device.queue) {
|
||||
+ gpio_wdt_device.queue = 0;
|
||||
+ gpio_wdt_device.gstate = 0;
|
||||
+ gpio_set_value(gpio_wdt_device.gpio, 0);
|
||||
+ }
|
||||
+ ticks = gpio_wdt_device.default_ticks;
|
||||
+ spin_unlock_irqrestore(&gpio_wdt_device.lock, flags);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/* Filesystem functions */
|
||||
+
|
||||
+static int gpio_wdt_open(struct inode *inode, struct file *file)
|
||||
+{
|
||||
+ if (test_and_set_bit(0, &gpio_wdt_device.inuse))
|
||||
+ return -EBUSY;
|
||||
+ return nonseekable_open(inode, file);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int gpio_wdt_release(struct inode *inode, struct file *file)
|
||||
+{
|
||||
+ clear_bit(0, &gpio_wdt_device.inuse);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static long gpio_wdt_ioctl(struct file *file, unsigned int cmd,
|
||||
+ unsigned long arg)
|
||||
+{
|
||||
+ void __user *argp = (void __user *)arg;
|
||||
+ int __user *p = (int __user *)argp;
|
||||
+ unsigned int value;
|
||||
+ static const struct watchdog_info ident = {
|
||||
+ .options = WDIOF_CARDRESET,
|
||||
+ .identity = "GPIO WDT",
|
||||
+ };
|
||||
+
|
||||
+ switch (cmd) {
|
||||
+ case WDIOC_GETSUPPORT:
|
||||
+ if (copy_to_user(argp, &ident, sizeof(ident)))
|
||||
+ return -EFAULT;
|
||||
+ break;
|
||||
+ case WDIOC_GETSTATUS:
|
||||
+ case WDIOC_GETBOOTSTATUS:
|
||||
+ put_user(0, p);
|
||||
+ break;
|
||||
+ case WDIOC_SETOPTIONS:
|
||||
+ if (get_user(value, p))
|
||||
+ return -EFAULT;
|
||||
+ if (value & WDIOS_ENABLECARD)
|
||||
+ gpio_wdt_start();
|
||||
+ else if (value & WDIOS_DISABLECARD)
|
||||
+ gpio_wdt_stop();
|
||||
+ else
|
||||
+ return -EINVAL;
|
||||
+ return 0;
|
||||
+ case WDIOC_KEEPALIVE:
|
||||
+ gpio_wdt_reset();
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -ENOTTY;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static ssize_t gpio_wdt_write(struct file *file, const char *buf,
|
||||
+ size_t count, loff_t *ppos)
|
||||
+{
|
||||
+ if (!count)
|
||||
+ return -EIO;
|
||||
+ gpio_wdt_reset();
|
||||
+ return count;
|
||||
+}
|
||||
+
|
||||
+static const struct file_operations gpio_wdt_fops = {
|
||||
+ .owner = THIS_MODULE,
|
||||
+ .llseek = no_llseek,
|
||||
+ .unlocked_ioctl = gpio_wdt_ioctl,
|
||||
+ .open = gpio_wdt_open,
|
||||
+ .write = gpio_wdt_write,
|
||||
+ .release = gpio_wdt_release,
|
||||
+};
|
||||
+
|
||||
+
|
||||
+static struct miscdevice gpio_wdt_misc = {
|
||||
+ .minor = WATCHDOG_MINOR,
|
||||
+ .name = "watchdog",
|
||||
+ .fops = &gpio_wdt_fops,
|
||||
+};
|
||||
+
|
||||
+
|
||||
+static int gpio_wdt_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ int ret;
|
||||
+ struct gpio_wdt_platform_data *gpio_wdt_data = pdev->dev.platform_data;
|
||||
+
|
||||
+ gpio_wdt_device.gpio = gpio_wdt_data->gpio;
|
||||
+ gpio_wdt_device.interval = gpio_wdt_data->interval;
|
||||
+ gpio_wdt_device.first_interval = gpio_wdt_data->first_interval;
|
||||
+ if (gpio_wdt_device.first_interval <= 0) {
|
||||
+ gpio_wdt_device.first_interval = gpio_wdt_device.interval;
|
||||
+ }
|
||||
+
|
||||
+ ret = gpio_request(gpio_wdt_device.gpio, "gpio-wdt");
|
||||
+ if (ret < 0) {
|
||||
+ dev_err(&pdev->dev, "failed to request gpio");
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ spin_lock_init(&gpio_wdt_device.lock);
|
||||
+ init_completion(&gpio_wdt_device.stop);
|
||||
+ gpio_wdt_device.queue = 0;
|
||||
+ clear_bit(0, &gpio_wdt_device.inuse);
|
||||
+ timer_setup(&gpio_wdt_device.timer, gpio_wdt_trigger, 0L);
|
||||
+ gpio_wdt_device.default_ticks = ticks;
|
||||
+
|
||||
+ gpio_wdt_start();
|
||||
+ dev_info(&pdev->dev, "GPIO Hardware Watchdog driver (gpio=%i interval=%i/%i)\n",
|
||||
+ gpio_wdt_data->gpio, gpio_wdt_data->first_interval, gpio_wdt_data->interval);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int gpio_wdt_remove(struct platform_device *pdev)
|
||||
+{
|
||||
+ /* FIXME: do we need to lock this test ? */
|
||||
+ if (gpio_wdt_device.queue) {
|
||||
+ gpio_wdt_device.queue = 0;
|
||||
+ wait_for_completion(&gpio_wdt_device.stop);
|
||||
+ }
|
||||
+
|
||||
+ gpio_free(gpio_wdt_device.gpio);
|
||||
+ misc_deregister(&gpio_wdt_misc);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static struct platform_driver gpio_wdt_driver = {
|
||||
+ .probe = gpio_wdt_probe,
|
||||
+ .remove = gpio_wdt_remove,
|
||||
+ .driver.name = "gpio-wdt",
|
||||
+ .driver.owner = THIS_MODULE,
|
||||
+};
|
||||
+
|
||||
+static int __init gpio_wdt_init(void)
|
||||
+{
|
||||
+ return platform_driver_register(&gpio_wdt_driver);
|
||||
+}
|
||||
+arch_initcall(gpio_wdt_init);
|
||||
+
|
||||
+/*
|
||||
+ * We do wdt initialization in two steps: arch_initcall probes the wdt
|
||||
+ * very early to start pinging the watchdog (misc devices are not yet
|
||||
+ * available), and later module_init() just registers the misc device.
|
||||
+ */
|
||||
+static int gpio_wdt_init_late(void)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = misc_register(&gpio_wdt_misc);
|
||||
+ if (ret < 0) {
|
||||
+ pr_err("GPIO_WDT: failed to register misc device\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+#ifndef MODULE
|
||||
+module_init(gpio_wdt_init_late);
|
||||
+#endif
|
||||
+
|
||||
+static void __exit gpio_wdt_exit(void)
|
||||
+{
|
||||
+ platform_driver_unregister(&gpio_wdt_driver);
|
||||
+}
|
||||
+module_exit(gpio_wdt_exit);
|
||||
+
|
||||
+MODULE_AUTHOR("Michael Stickel, Florian Fainelli, Mathias Adam");
|
||||
+MODULE_DESCRIPTION("Driver for GPIO hardware watchdogs");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
|
||||
+MODULE_ALIAS("platform:gpio-wdt");
|
||||
--- /dev/null
|
||||
+++ b/include/linux/old_gpio_wdt.h
|
||||
@@ -0,0 +1,21 @@
|
||||
+/*
|
||||
+ * Definitions for the GPIO watchdog driver
|
||||
+ *
|
||||
+ * Copyright (C) 2013 Mathias Adam <m.adam--linux@adamis.de>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License version 2 as
|
||||
+ * published by the Free Software Foundation.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#ifndef _GPIO_WDT_H_
|
||||
+#define _GPIO_WDT_H_
|
||||
+
|
||||
+struct gpio_wdt_platform_data {
|
||||
+ int gpio; /* GPIO line number */
|
||||
+ int interval; /* watchdog reset interval in system ticks */
|
||||
+ int first_interval; /* first wd reset interval in system ticks */
|
||||
+};
|
||||
+
|
||||
+#endif /* _GPIO_WDT_H_ */
|
||||
@ -1,30 +0,0 @@
|
||||
From 5c81397a0147ea59c778d1de14ef54e2268221f6 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
|
||||
Date: Wed, 8 Apr 2015 06:58:11 +0200
|
||||
Subject: [PATCH] ssb: reject PCI writes setting CardBus bridge resources
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
If SoC has a CardBus we can set resources of device at slot 1 only. It's
|
||||
impossigle to set bridge resources as it simply overwrites device 1
|
||||
configuration and usually results in Data bus error-s.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
||||
---
|
||||
drivers/ssb/driver_pcicore.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
--- a/drivers/ssb/driver_pcicore.c
|
||||
+++ b/drivers/ssb/driver_pcicore.c
|
||||
@@ -164,6 +164,10 @@ static int ssb_extpci_write_config(struc
|
||||
WARN_ON(!pc->hostmode);
|
||||
if (unlikely(len != 1 && len != 2 && len != 4))
|
||||
goto out;
|
||||
+ /* CardBus SoCs allow configuring dev 1 resources only */
|
||||
+ if (extpci_core->cardbusmode && dev != 1 &&
|
||||
+ off >= PCI_BASE_ADDRESS_0 && off <= PCI_BASE_ADDRESS_5)
|
||||
+ goto out;
|
||||
addr = get_cfgspace_addr(pc, bus, dev, func, off);
|
||||
if (unlikely(!addr))
|
||||
goto out;
|
||||
@ -1,46 +0,0 @@
|
||||
--- a/drivers/pcmcia/yenta_socket.c
|
||||
+++ b/drivers/pcmcia/yenta_socket.c
|
||||
@@ -921,6 +921,8 @@ static unsigned int yenta_probe_irq(stru
|
||||
* Probe for usable interrupts using the force
|
||||
* register to generate bogus card status events.
|
||||
*/
|
||||
+#ifndef CONFIG_BCM47XX
|
||||
+ /* WRT54G3G does not like this */
|
||||
cb_writel(socket, CB_SOCKET_EVENT, -1);
|
||||
cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK);
|
||||
reg = exca_readb(socket, I365_CSCINT);
|
||||
@@ -936,6 +938,7 @@ static unsigned int yenta_probe_irq(stru
|
||||
}
|
||||
cb_writel(socket, CB_SOCKET_MASK, 0);
|
||||
exca_writeb(socket, I365_CSCINT, reg);
|
||||
+#endif
|
||||
|
||||
mask = probe_irq_mask(val) & 0xffff;
|
||||
|
||||
@@ -1020,6 +1023,10 @@ static void yenta_get_socket_capabilitie
|
||||
else
|
||||
socket->socket.irq_mask = 0;
|
||||
|
||||
+ /* irq mask probing is broken for the WRT54G3G */
|
||||
+ if (socket->socket.irq_mask == 0)
|
||||
+ socket->socket.irq_mask = 0x6f8;
|
||||
+
|
||||
dev_info(&socket->dev->dev, "ISA IRQ mask 0x%04x, PCI irq %d\n",
|
||||
socket->socket.irq_mask, socket->cb_irq);
|
||||
}
|
||||
@@ -1251,6 +1258,15 @@ static int yenta_probe(struct pci_dev *d
|
||||
dev_info(&dev->dev, "Socket status: %08x\n",
|
||||
cb_readl(socket, CB_SOCKET_STATE));
|
||||
|
||||
+ /* Generate an interrupt on card insert/remove */
|
||||
+ config_writew(socket, CB_SOCKET_MASK, CB_CSTSMASK | CB_CDMASK);
|
||||
+
|
||||
+ /* Set up Multifunction Routing Status Register */
|
||||
+ config_writew(socket, 0x8C, 0x1000 /* MFUNC3 to GPIO3 */ | 0x2 /* MFUNC0 to INTA */);
|
||||
+
|
||||
+ /* Switch interrupts to parallelized */
|
||||
+ config_writeb(socket, 0x92, 0x64);
|
||||
+
|
||||
yenta_fixup_parent_bridge(dev->subordinate);
|
||||
|
||||
/* Register it with the pcmcia layer.. */
|
||||
@ -1,11 +0,0 @@
|
||||
--- a/drivers/ssb/driver_pcicore.c
|
||||
+++ b/drivers/ssb/driver_pcicore.c
|
||||
@@ -390,7 +390,7 @@ static void ssb_pcicore_init_hostmode(st
|
||||
set_io_port_base(ssb_pcicore_controller.io_map_base);
|
||||
/* Give some time to the PCI controller to configure itself with the new
|
||||
* values. Not waiting at this point causes crashes of the machine. */
|
||||
- mdelay(10);
|
||||
+ mdelay(300);
|
||||
register_pci_controller(&ssb_pcicore_controller);
|
||||
}
|
||||
|
||||
@ -1,24 +0,0 @@
|
||||
--- a/drivers/firmware/broadcom/bcm47xx_nvram.c
|
||||
+++ b/drivers/firmware/broadcom/bcm47xx_nvram.c
|
||||
@@ -30,7 +30,8 @@ struct nvram_header {
|
||||
u32 config_ncdl; /* ncdl values for memc */
|
||||
};
|
||||
|
||||
-static char nvram_buf[NVRAM_SPACE];
|
||||
+char nvram_buf[NVRAM_SPACE];
|
||||
+EXPORT_SYMBOL(nvram_buf);
|
||||
static size_t nvram_len;
|
||||
static const u32 nvram_sizes[] = {0x6000, 0x8000, 0xF000, 0x10000};
|
||||
static int cfe_env;
|
||||
--- a/arch/mips/mm/cache.c
|
||||
+++ b/arch/mips/mm/cache.c
|
||||
@@ -62,6 +62,9 @@ void (*_dma_cache_wback_inv)(unsigned lo
|
||||
void (*_dma_cache_wback)(unsigned long start, unsigned long size);
|
||||
void (*_dma_cache_inv)(unsigned long start, unsigned long size);
|
||||
|
||||
+EXPORT_SYMBOL(_dma_cache_wback_inv);
|
||||
+EXPORT_SYMBOL(_dma_cache_inv);
|
||||
+
|
||||
#endif /* CONFIG_DMA_NONCOHERENT */
|
||||
|
||||
/*
|
||||
@ -1,225 +0,0 @@
|
||||
CONFIG_64BIT=y
|
||||
CONFIG_ARCH_BCM4908=y
|
||||
CONFIG_ARCH_CLOCKSOURCE_DATA=y
|
||||
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
|
||||
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
||||
CONFIG_ARCH_MMAP_RND_BITS=18
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MAX=24
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MIN=18
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
|
||||
CONFIG_ARCH_PROC_KCORE_TEXT=y
|
||||
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
|
||||
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
|
||||
CONFIG_ARCH_SPARSEMEM_ENABLE=y
|
||||
CONFIG_ARCH_SUSPEND_POSSIBLE=y
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
CONFIG_ARM64_CONT_SHIFT=4
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
CONFIG_ARM64_PA_BITS_48=y
|
||||
CONFIG_ARM64_PTR_AUTH=y
|
||||
CONFIG_ARM64_SSBD=y
|
||||
CONFIG_ARM64_SVE=y
|
||||
CONFIG_ARM64_TAGGED_ADDR_ABI=y
|
||||
CONFIG_ARM64_VA_BITS=39
|
||||
CONFIG_ARM64_VA_BITS_39=y
|
||||
CONFIG_ARM_AMBA=y
|
||||
CONFIG_ARM_ARCH_TIMER=y
|
||||
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
|
||||
CONFIG_ARM_GIC=y
|
||||
CONFIG_ARM_GIC_V3=y
|
||||
CONFIG_ARM_GIC_V3_ITS=y
|
||||
CONFIG_ARM_PSCI_FW=y
|
||||
CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y
|
||||
CONFIG_B53=y
|
||||
CONFIG_BCM4908_ENET=y
|
||||
CONFIG_BCM7038_WDT=y
|
||||
CONFIG_BCM7XXX_PHY=y
|
||||
CONFIG_BCM_NET_PHYLIB=y
|
||||
CONFIG_BCM_PMB=y
|
||||
# CONFIG_BLK_DEV_INITRD is not set
|
||||
CONFIG_BLK_PM=y
|
||||
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
|
||||
CONFIG_CLKDEV_LOOKUP=y
|
||||
CONFIG_CLONE_BACKWARDS=y
|
||||
CONFIG_CMDLINE="earlycon=bcm63xx_uart,0xff800640 console=ttyS0,115200"
|
||||
CONFIG_CMDLINE_FORCE=y
|
||||
CONFIG_COMMON_CLK=y
|
||||
CONFIG_CPU_RMAP=y
|
||||
CONFIG_CRC16=y
|
||||
CONFIG_CRYPTO_ACOMP2=y
|
||||
CONFIG_CRYPTO_AEAD=y
|
||||
CONFIG_CRYPTO_AEAD2=y
|
||||
CONFIG_CRYPTO_DEFLATE=y
|
||||
CONFIG_CRYPTO_HASH2=y
|
||||
CONFIG_CRYPTO_HASH_INFO=y
|
||||
CONFIG_CRYPTO_LZO=y
|
||||
CONFIG_CRYPTO_MANAGER=y
|
||||
CONFIG_CRYPTO_MANAGER2=y
|
||||
CONFIG_CRYPTO_NULL2=y
|
||||
CONFIG_CRYPTO_RNG2=y
|
||||
CONFIG_CRYPTO_ZSTD=y
|
||||
CONFIG_DCACHE_WORD_ACCESS=y
|
||||
CONFIG_DMA_DIRECT_REMAP=y
|
||||
CONFIG_DMA_REMAP=y
|
||||
CONFIG_DRM_RCAR_WRITEBACK=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_EDAC_SUPPORT=y
|
||||
CONFIG_FIXED_PHY=y
|
||||
CONFIG_FIX_EARLYCON_MEM=y
|
||||
CONFIG_FRAME_POINTER=y
|
||||
CONFIG_FW_LOADER_PAGED_BUF=y
|
||||
CONFIG_GENERIC_ALLOCATOR=y
|
||||
CONFIG_GENERIC_ARCH_TOPOLOGY=y
|
||||
CONFIG_GENERIC_BUG=y
|
||||
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
|
||||
CONFIG_GENERIC_CPU_AUTOPROBE=y
|
||||
CONFIG_GENERIC_CPU_VULNERABILITIES=y
|
||||
CONFIG_GENERIC_CSUM=y
|
||||
CONFIG_GENERIC_EARLY_IOREMAP=y
|
||||
CONFIG_GENERIC_GETTIMEOFDAY=y
|
||||
CONFIG_GENERIC_IDLE_POLL_SETUP=y
|
||||
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
|
||||
CONFIG_GENERIC_IRQ_MULTI_HANDLER=y
|
||||
CONFIG_GENERIC_IRQ_SHOW=y
|
||||
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
|
||||
CONFIG_GENERIC_MSI_IRQ=y
|
||||
CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
|
||||
CONFIG_GENERIC_PCI_IOMAP=y
|
||||
CONFIG_GENERIC_PHY=y
|
||||
CONFIG_GENERIC_PINCONF=y
|
||||
CONFIG_GENERIC_PINCTRL_GROUPS=y
|
||||
CONFIG_GENERIC_PINMUX_FUNCTIONS=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_GPIO_GENERIC_PLATFORM=y
|
||||
CONFIG_GRO_CELLS=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
CONFIG_HARDEN_BRANCH_PREDICTOR=y
|
||||
CONFIG_HARDIRQS_SW_RESEND=y
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HOLES_IN_ZONE=y
|
||||
CONFIG_HZ_PERIODIC=y
|
||||
CONFIG_I2C=y
|
||||
CONFIG_I2C_BOARDINFO=y
|
||||
CONFIG_I2C_BRCMSTB=y
|
||||
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
|
||||
CONFIG_IRQCHIP=y
|
||||
CONFIG_IRQ_DOMAIN=y
|
||||
CONFIG_IRQ_DOMAIN_HIERARCHY=y
|
||||
CONFIG_IRQ_FORCED_THREADING=y
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_LEDS_GPIO=y
|
||||
CONFIG_LIBFDT=y
|
||||
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
||||
CONFIG_LOCK_SPIN_ON_OWNER=y
|
||||
CONFIG_LZO_COMPRESS=y
|
||||
CONFIG_LZO_DECOMPRESS=y
|
||||
CONFIG_MDIO_BCM_UNIMAC=y
|
||||
CONFIG_MDIO_BUS=y
|
||||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MEMFD_CREATE=y
|
||||
CONFIG_MFD_SYSCON=y
|
||||
CONFIG_MIGRATION=y
|
||||
CONFIG_MODULES_USE_ELF_RELA=y
|
||||
CONFIG_MTD_CMDLINE_PARTS=y
|
||||
CONFIG_MTD_NAND_BRCMNAND=y
|
||||
CONFIG_MTD_NAND_CORE=y
|
||||
CONFIG_MTD_NAND_ECC_SW_HAMMING=y
|
||||
CONFIG_MTD_OF_PARTS_BCM4908=y
|
||||
# CONFIG_MTD_OF_PARTS_LINKSYS_NS is not set
|
||||
CONFIG_MTD_RAW_NAND=y
|
||||
CONFIG_MTD_SPLIT_CFE_BOOTFS=y
|
||||
# CONFIG_MTD_SPLIT_SQUASHFS_ROOT is not set
|
||||
CONFIG_MTD_UBI=y
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
CONFIG_MUTEX_SPIN_ON_OWNER=y
|
||||
CONFIG_NEED_DMA_MAP_STATE=y
|
||||
CONFIG_NEED_SG_DMA_LENGTH=y
|
||||
CONFIG_NET_DEVLINK=y
|
||||
CONFIG_NET_DSA=y
|
||||
CONFIG_NET_DSA_BCM_SF2=y
|
||||
CONFIG_NET_DSA_TAG_BRCM=y
|
||||
CONFIG_NET_DSA_TAG_BRCM_COMMON=y
|
||||
CONFIG_NET_DSA_TAG_BRCM_PREPEND=y
|
||||
CONFIG_NET_FLOW_LIMIT=y
|
||||
CONFIG_NET_SWITCHDEV=y
|
||||
CONFIG_NO_IOPORT_MAP=y
|
||||
CONFIG_NR_CPUS=4
|
||||
CONFIG_OF=y
|
||||
CONFIG_OF_ADDRESS=y
|
||||
CONFIG_OF_EARLY_FLATTREE=y
|
||||
CONFIG_OF_FLATTREE=y
|
||||
CONFIG_OF_GPIO=y
|
||||
CONFIG_OF_IRQ=y
|
||||
CONFIG_OF_KOBJ=y
|
||||
CONFIG_OF_MDIO=y
|
||||
CONFIG_OF_NET=y
|
||||
CONFIG_PADATA=y
|
||||
CONFIG_PARTITION_PERCPU=y
|
||||
CONFIG_PGTABLE_LEVELS=3
|
||||
CONFIG_PHYLIB=y
|
||||
CONFIG_PHYLINK=y
|
||||
CONFIG_PHYS_ADDR_T_64BIT=y
|
||||
CONFIG_PHY_BRCM_USB=y
|
||||
CONFIG_PINCTRL=y
|
||||
CONFIG_PINCTRL_BCM4908=y
|
||||
# CONFIG_PINCTRL_SINGLE is not set
|
||||
CONFIG_PM=y
|
||||
CONFIG_PM_CLK=y
|
||||
CONFIG_PM_GENERIC_DOMAINS=y
|
||||
CONFIG_PM_GENERIC_DOMAINS_OF=y
|
||||
CONFIG_POWER_RESET=y
|
||||
CONFIG_POWER_RESET_SYSCON=y
|
||||
CONFIG_POWER_SUPPLY=y
|
||||
CONFIG_QUEUED_RWLOCKS=y
|
||||
CONFIG_QUEUED_SPINLOCKS=y
|
||||
CONFIG_RATIONAL=y
|
||||
CONFIG_REFCOUNT_FULL=y
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_REGMAP_MMIO=y
|
||||
CONFIG_RFS_ACCEL=y
|
||||
CONFIG_RODATA_FULL_DEFAULT_ENABLED=y
|
||||
CONFIG_RPS=y
|
||||
CONFIG_RWSEM_SPIN_ON_OWNER=y
|
||||
# CONFIG_SERIAL_8250 is not set
|
||||
CONFIG_SERIAL_BCM63XX=y
|
||||
CONFIG_SERIAL_BCM63XX_CONSOLE=y
|
||||
CONFIG_SGL_ALLOC=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
|
||||
CONFIG_SPARSE_IRQ=y
|
||||
CONFIG_SRCU=y
|
||||
CONFIG_SWIOTLB=y
|
||||
CONFIG_SWPHY=y
|
||||
CONFIG_SYSCTL_EXCEPTION_TRACE=y
|
||||
CONFIG_SYS_SUPPORTS_HUGETLBFS=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
||||
CONFIG_TIMER_OF=y
|
||||
CONFIG_TIMER_PROBE=y
|
||||
CONFIG_TREE_RCU=y
|
||||
CONFIG_TREE_SRCU=y
|
||||
CONFIG_UBIFS_FS=y
|
||||
CONFIG_UNMAP_KERNEL_AT_EL0=y
|
||||
CONFIG_USB_SUPPORT=y
|
||||
CONFIG_VMAP_STACK=y
|
||||
CONFIG_WATCHDOG_CORE=y
|
||||
CONFIG_XPS=y
|
||||
CONFIG_XXHASH=y
|
||||
CONFIG_ZLIB_DEFLATE=y
|
||||
CONFIG_ZLIB_INFLATE=y
|
||||
CONFIG_ZONE_DMA32=y
|
||||
CONFIG_ZSTD_COMPRESS=y
|
||||
CONFIG_ZSTD_DECOMPRESS=y
|
||||
@ -1,68 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef __UNIMAC_H
|
||||
#define __UNIMAC_H
|
||||
|
||||
#define UMAC_HD_BKP_CTRL 0x004
|
||||
#define HD_FC_EN (1 << 0)
|
||||
#define HD_FC_BKOFF_OK (1 << 1)
|
||||
#define IPG_CONFIG_RX_SHIFT 2
|
||||
#define IPG_CONFIG_RX_MASK 0x1F
|
||||
#define UMAC_CMD 0x008
|
||||
#define CMD_TX_EN (1 << 0)
|
||||
#define CMD_RX_EN (1 << 1)
|
||||
#define CMD_SPEED_10 0
|
||||
#define CMD_SPEED_100 1
|
||||
#define CMD_SPEED_1000 2
|
||||
#define CMD_SPEED_2500 3
|
||||
#define CMD_SPEED_SHIFT 2
|
||||
#define CMD_SPEED_MASK 3
|
||||
#define CMD_PROMISC (1 << 4)
|
||||
#define CMD_PAD_EN (1 << 5)
|
||||
#define CMD_CRC_FWD (1 << 6)
|
||||
#define CMD_PAUSE_FWD (1 << 7)
|
||||
#define CMD_RX_PAUSE_IGNORE (1 << 8)
|
||||
#define CMD_TX_ADDR_INS (1 << 9)
|
||||
#define CMD_HD_EN (1 << 10)
|
||||
#define CMD_SW_RESET_OLD (1 << 11)
|
||||
#define CMD_SW_RESET (1 << 13)
|
||||
#define CMD_LCL_LOOP_EN (1 << 15)
|
||||
#define CMD_AUTO_CONFIG (1 << 22)
|
||||
#define CMD_CNTL_FRM_EN (1 << 23)
|
||||
#define CMD_NO_LEN_CHK (1 << 24)
|
||||
#define CMD_RMT_LOOP_EN (1 << 25)
|
||||
#define CMD_RX_ERR_DISC (1 << 26)
|
||||
#define CMD_PRBL_EN (1 << 27)
|
||||
#define CMD_TX_PAUSE_IGNORE (1 << 28)
|
||||
#define CMD_TX_RX_EN (1 << 29)
|
||||
#define CMD_RUNT_FILTER_DIS (1 << 30)
|
||||
#define UMAC_MAC0 0x00c
|
||||
#define UMAC_MAC1 0x010
|
||||
#define UMAC_MAX_FRAME_LEN 0x014
|
||||
#define UMAC_PAUSE_QUANTA 0x018
|
||||
#define UMAC_MODE 0x044
|
||||
#define MODE_LINK_STATUS (1 << 5)
|
||||
#define UMAC_FRM_TAG0 0x048 /* outer tag */
|
||||
#define UMAC_FRM_TAG1 0x04c /* inner tag */
|
||||
#define UMAC_TX_IPG_LEN 0x05c
|
||||
#define UMAC_EEE_CTRL 0x064
|
||||
#define EN_LPI_RX_PAUSE (1 << 0)
|
||||
#define EN_LPI_TX_PFC (1 << 1)
|
||||
#define EN_LPI_TX_PAUSE (1 << 2)
|
||||
#define EEE_EN (1 << 3)
|
||||
#define RX_FIFO_CHECK (1 << 4)
|
||||
#define EEE_TX_CLK_DIS (1 << 5)
|
||||
#define DIS_EEE_10M (1 << 6)
|
||||
#define LP_IDLE_PREDICTION_MODE (1 << 7)
|
||||
#define UMAC_EEE_LPI_TIMER 0x068
|
||||
#define UMAC_EEE_WAKE_TIMER 0x06C
|
||||
#define UMAC_EEE_REF_COUNT 0x070
|
||||
#define EEE_REFERENCE_COUNT_MASK 0xffff
|
||||
#define UMAC_RX_IPG_INV 0x078
|
||||
#define UMAC_MACSEC_PROG_TX_CRC 0x310
|
||||
#define UMAC_MACSEC_CTRL 0x314
|
||||
#define UMAC_PAUSE_CTRL 0x330
|
||||
#define UMAC_TX_FLUSH 0x334
|
||||
#define UMAC_RX_FIFO_STATUS 0x338
|
||||
#define UMAC_TX_FIFO_STATUS 0x33c
|
||||
|
||||
#endif
|
||||
@ -1,60 +0,0 @@
|
||||
From 2f8913a7b17efd3a116825160a2d3a6610444587 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Thu, 12 Nov 2020 16:08:31 +0100
|
||||
Subject: [PATCH] dt-bindings: arm: bcm: document BCM4908 bindings
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
BCM4908 is a new family that includes BCM4906, BCM4908 and BCM49408.
|
||||
It's mostly used in home routers and often replaces Northstar in vendors
|
||||
portfolio.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
.../bindings/arm/bcm/brcm,bcm4908.yaml | 38 +++++++++++++++++++
|
||||
1 file changed, 38 insertions(+)
|
||||
create mode 100644 Documentation/devicetree/bindings/arm/bcm/brcm,bcm4908.yaml
|
||||
|
||||
--- /dev/null
|
||||
+++ b/Documentation/devicetree/bindings/arm/bcm/brcm,bcm4908.yaml
|
||||
@@ -0,0 +1,38 @@
|
||||
+# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
|
||||
+%YAML 1.2
|
||||
+---
|
||||
+$id: http://devicetree.org/schemas/arm/bcm/brcm,bcm4908.yaml#
|
||||
+$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
+
|
||||
+title: Broadcom BCM4908 device tree bindings
|
||||
+
|
||||
+description:
|
||||
+ Broadcom BCM4906 / BCM4908 / BCM49408 Wi-Fi/network SoCs with Brahma CPUs.
|
||||
+
|
||||
+maintainers:
|
||||
+ - Rafał Miłecki <rafal@milecki.pl>
|
||||
+
|
||||
+properties:
|
||||
+ $nodename:
|
||||
+ const: '/'
|
||||
+ compatible:
|
||||
+ oneOf:
|
||||
+ - description: BCM4906 based boards
|
||||
+ items:
|
||||
+ - const: brcm,bcm4906
|
||||
+ - const: brcm,bcm4908
|
||||
+
|
||||
+ - description: BCM4908 based boards
|
||||
+ items:
|
||||
+ - enum:
|
||||
+ - asus,gt-ac5300
|
||||
+ - const: brcm,bcm4908
|
||||
+
|
||||
+ - description: BCM49408 based boards
|
||||
+ items:
|
||||
+ - const: brcm,bcm49408
|
||||
+ - const: brcm,bcm4908
|
||||
+
|
||||
+additionalProperties: true
|
||||
+
|
||||
+...
|
||||
@ -1,307 +0,0 @@
|
||||
From 2961f69f151c0a6771f55cef46398fe49ca20902 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Thu, 12 Nov 2020 16:08:32 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: add BCM4908 and Asus GT-AC5300 early
|
||||
DTS files
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
They don't descibe hardware fully yet but it's enough to boot a system.
|
||||
|
||||
Some missing blocks:
|
||||
1. PMC (Power Management Controller?)
|
||||
2. Ethernet
|
||||
3. Crypto
|
||||
4. Thermal
|
||||
|
||||
Asus DTS is missing defining full NAND partitions layout and buttons.
|
||||
|
||||
Further changes will fill those gaps as soon as required bindings will
|
||||
be found / tested / added.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/broadcom/Makefile | 1 +
|
||||
arch/arm64/boot/dts/broadcom/bcm4908/Makefile | 2 +
|
||||
.../bcm4908/bcm4908-asus-gt-ac5300.dts | 66 +++++++
|
||||
.../boot/dts/broadcom/bcm4908/bcm4908.dtsi | 187 ++++++++++++++++++
|
||||
4 files changed, 256 insertions(+)
|
||||
create mode 100644 arch/arm64/boot/dts/broadcom/bcm4908/Makefile
|
||||
create mode 100644 arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts
|
||||
create mode 100644 arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/Makefile
|
||||
+++ b/arch/arm64/boot/dts/broadcom/Makefile
|
||||
@@ -4,5 +4,6 @@ dtb-$(CONFIG_ARCH_BCM2835) += bcm2837-rp
|
||||
bcm2837-rpi-3-b-plus.dtb \
|
||||
bcm2837-rpi-cm3-io3.dtb
|
||||
|
||||
+subdir-y += bcm4908
|
||||
subdir-y += northstar2
|
||||
subdir-y += stingray
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/Makefile
|
||||
@@ -0,0 +1,2 @@
|
||||
+# SPDX-License-Identifier: GPL-2.0
|
||||
+dtb-$(CONFIG_ARCH_BCM4908) += bcm4908-asus-gt-ac5300.dtb
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts
|
||||
@@ -0,0 +1,66 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
+
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/input/input.h>
|
||||
+
|
||||
+#include "bcm4908.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ compatible = "asus,gt-ac5300", "brcm,bcm4908";
|
||||
+ model = "Asus GT-AC5300";
|
||||
+
|
||||
+ memory@0 {
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x00 0x00 0x00 0x40000000>;
|
||||
+ };
|
||||
+
|
||||
+ gpio-keys-polled {
|
||||
+ compatible = "gpio-keys-polled";
|
||||
+ poll-interval = <100>;
|
||||
+
|
||||
+ wifi {
|
||||
+ label = "WiFi";
|
||||
+ linux,code = <KEY_RFKILL>;
|
||||
+ gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ wps {
|
||||
+ label = "WPS";
|
||||
+ linux,code = <KEY_WPS_BUTTON>;
|
||||
+ gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ restart {
|
||||
+ label = "Reset";
|
||||
+ linux,code = <KEY_RESTART>;
|
||||
+ gpios = <&gpio0 30 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ brightness {
|
||||
+ label = "LEDs";
|
||||
+ linux,code = <KEY_BRIGHTNESS_ZERO>;
|
||||
+ gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&nandcs {
|
||||
+ nand-ecc-strength = <4>;
|
||||
+ nand-ecc-step-size = <512>;
|
||||
+ nand-on-flash-bbt;
|
||||
+ brcm,nand-has-wp;
|
||||
+
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+
|
||||
+ partitions {
|
||||
+ compatible = "fixed-partitions";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ partition@0 {
|
||||
+ label = "cferom";
|
||||
+ reg = <0x0 0x100000>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
@@ -0,0 +1,187 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
+
|
||||
+#include <dt-bindings/interrupt-controller/irq.h>
|
||||
+#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
+
|
||||
+/dts-v1/;
|
||||
+
|
||||
+/ {
|
||||
+ interrupt-parent = <&gic>;
|
||||
+
|
||||
+ #address-cells = <2>;
|
||||
+ #size-cells = <2>;
|
||||
+
|
||||
+ aliases {
|
||||
+ serial0 = &uart0;
|
||||
+ };
|
||||
+
|
||||
+ chosen {
|
||||
+ stdout-path = "serial0:115200n8";
|
||||
+ };
|
||||
+
|
||||
+ cpus {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+
|
||||
+ cpu0: cpu@0 {
|
||||
+ device_type = "cpu";
|
||||
+ compatible = "brcm,brahma-b53";
|
||||
+ reg = <0x0>;
|
||||
+ next-level-cache = <&l2>;
|
||||
+ };
|
||||
+
|
||||
+ cpu1: cpu@1 {
|
||||
+ device_type = "cpu";
|
||||
+ compatible = "brcm,brahma-b53";
|
||||
+ reg = <0x1>;
|
||||
+ enable-method = "spin-table";
|
||||
+ cpu-release-addr = <0x0 0xfff8>;
|
||||
+ next-level-cache = <&l2>;
|
||||
+ };
|
||||
+
|
||||
+ cpu2: cpu@2 {
|
||||
+ device_type = "cpu";
|
||||
+ compatible = "brcm,brahma-b53";
|
||||
+ reg = <0x2>;
|
||||
+ enable-method = "spin-table";
|
||||
+ cpu-release-addr = <0x0 0xfff8>;
|
||||
+ next-level-cache = <&l2>;
|
||||
+ };
|
||||
+
|
||||
+ cpu3: cpu@3 {
|
||||
+ device_type = "cpu";
|
||||
+ compatible = "brcm,brahma-b53";
|
||||
+ reg = <0x3>;
|
||||
+ enable-method = "spin-table";
|
||||
+ cpu-release-addr = <0x0 0xfff8>;
|
||||
+ next-level-cache = <&l2>;
|
||||
+ };
|
||||
+
|
||||
+ l2: l2-cache0 {
|
||||
+ compatible = "cache";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ axi@81000000 {
|
||||
+ compatible = "simple-bus";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ ranges = <0x00 0x00 0x81000000 0x4000>;
|
||||
+
|
||||
+ gic: interrupt-controller@1000 {
|
||||
+ compatible = "arm,gic-400";
|
||||
+ #interrupt-cells = <3>;
|
||||
+ #address-cells = <0>;
|
||||
+ interrupt-controller;
|
||||
+ reg = <0x1000 0x1000>,
|
||||
+ <0x2000 0x2000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ timer {
|
||||
+ compatible = "arm,armv8-timer";
|
||||
+ interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
|
||||
+ <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
|
||||
+ <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
|
||||
+ <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
|
||||
+ };
|
||||
+
|
||||
+ pmu {
|
||||
+ compatible = "arm,cortex-a53-pmu";
|
||||
+ interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
|
||||
+ <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
|
||||
+ <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
|
||||
+ <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>;
|
||||
+ };
|
||||
+
|
||||
+ clocks {
|
||||
+ periph_clk: periph_clk {
|
||||
+ compatible = "fixed-clock";
|
||||
+ #clock-cells = <0>;
|
||||
+ clock-frequency = <50000000>;
|
||||
+ clock-output-names = "periph";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ soc {
|
||||
+ compatible = "simple-bus";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ ranges = <0x00 0x00 0x80000000 0x10000>;
|
||||
+
|
||||
+ usb@c300 {
|
||||
+ compatible = "generic-ehci";
|
||||
+ reg = <0xc300 0x100>;
|
||||
+ interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+
|
||||
+ usb@c400 {
|
||||
+ compatible = "generic-ohci";
|
||||
+ reg = <0xc400 0x100>;
|
||||
+ interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+
|
||||
+ usb@d000 {
|
||||
+ compatible = "generic-xhci";
|
||||
+ reg = <0xd000 0x8c8>;
|
||||
+ interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ bus@ff800000 {
|
||||
+ compatible = "simple-bus";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ ranges = <0x00 0x00 0xff800000 0x3000>;
|
||||
+
|
||||
+ timer: timer@400 {
|
||||
+ compatible = "brcm,bcm6328-timer", "syscon";
|
||||
+ reg = <0x400 0x3c>;
|
||||
+ };
|
||||
+
|
||||
+ gpio0: gpio-controller@500 {
|
||||
+ compatible = "brcm,bcm6345-gpio";
|
||||
+ reg-names = "dirout", "dat";
|
||||
+ reg = <0x500 0x28>, <0x528 0x28>;
|
||||
+
|
||||
+ #gpio-cells = <2>;
|
||||
+ gpio-controller;
|
||||
+ };
|
||||
+
|
||||
+ uart0: serial@640 {
|
||||
+ compatible = "brcm,bcm6345-uart";
|
||||
+ reg = <0x640 0x18>;
|
||||
+ interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ clocks = <&periph_clk>;
|
||||
+ clock-names = "periph";
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+
|
||||
+ nand@1800 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ compatible = "brcm,brcmnand-v7.1", "brcm,brcmnand";
|
||||
+ reg = <0x1800 0x600>, <0x2000 0x10>;
|
||||
+ reg-names = "nand", "nand-int-base";
|
||||
+ interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ interrupt-names = "nand";
|
||||
+ status = "okay";
|
||||
+
|
||||
+ nandcs: nandcs@0 {
|
||||
+ compatible = "brcm,nandcs";
|
||||
+ reg = <0>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ reboot {
|
||||
+ compatible = "syscon-reboot";
|
||||
+ regmap = <&timer>;
|
||||
+ offset = <0x34>;
|
||||
+ mask = <1>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
@ -1,44 +0,0 @@
|
||||
From dccb22d078ebd098115e4f66bde1ee2249c8640b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Thu, 12 Nov 2020 16:08:30 +0100
|
||||
Subject: [PATCH] arm64: add config for Broadcom BCM4908 SoCs
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Add ARCH_BCM4908 config that can be used for compiling DTS files.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
arch/arm64/Kconfig.platforms | 8 ++++++++
|
||||
arch/arm64/configs/defconfig | 1 +
|
||||
2 files changed, 9 insertions(+)
|
||||
|
||||
--- a/arch/arm64/Kconfig.platforms
|
||||
+++ b/arch/arm64/Kconfig.platforms
|
||||
@@ -43,6 +43,14 @@ config ARCH_BCM2835
|
||||
This enables support for the Broadcom BCM2837 SoC.
|
||||
This SoC is used in the Raspberry Pi 3 device.
|
||||
|
||||
+config ARCH_BCM4908
|
||||
+ bool "Broadcom BCM4908 family"
|
||||
+ select GPIOLIB
|
||||
+ help
|
||||
+ This enables support for the Broadcom BCM4906, BCM4908 and
|
||||
+ BCM49408 SoCs. These SoCs use Brahma-B53 cores and can be
|
||||
+ found in home routers.
|
||||
+
|
||||
config ARCH_BCM_IPROC
|
||||
bool "Broadcom iProc SoC Family"
|
||||
select COMMON_CLK_IPROC
|
||||
--- a/arch/arm64/configs/defconfig
|
||||
+++ b/arch/arm64/configs/defconfig
|
||||
@@ -33,6 +33,7 @@ CONFIG_ARCH_AGILEX=y
|
||||
CONFIG_ARCH_SUNXI=y
|
||||
CONFIG_ARCH_ALPINE=y
|
||||
CONFIG_ARCH_BCM2835=y
|
||||
+CONFIG_ARCH_BCM4908=y
|
||||
CONFIG_ARCH_BCM_IPROC=y
|
||||
CONFIG_ARCH_BERLIN=y
|
||||
CONFIG_ARCH_BRCMSTB=y
|
||||
@ -1,28 +0,0 @@
|
||||
From 3a5da4f54801ac42837a0b3151fa8285e01e8b0e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Tue, 8 Dec 2020 08:03:03 +0100
|
||||
Subject: [PATCH] dt-bindings: arm: bcm: document Netgear R8000P binding
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
It's a BCM4906 based device.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Acked-by: Rob Herring <robh@kernel.org>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
Documentation/devicetree/bindings/arm/bcm/brcm,bcm4908.yaml | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
--- a/Documentation/devicetree/bindings/arm/bcm/brcm,bcm4908.yaml
|
||||
+++ b/Documentation/devicetree/bindings/arm/bcm/brcm,bcm4908.yaml
|
||||
@@ -19,6 +19,8 @@ properties:
|
||||
oneOf:
|
||||
- description: BCM4906 based boards
|
||||
items:
|
||||
+ - enum:
|
||||
+ - netgear,r8000p
|
||||
- const: brcm,bcm4906
|
||||
- const: brcm,bcm4908
|
||||
|
||||
@ -1,104 +0,0 @@
|
||||
From c8b404fb05dcfadff477e49b7ea6b500e015f101 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Tue, 8 Dec 2020 08:03:04 +0100
|
||||
Subject: [PATCH 2/4] arm64: dts: broadcom: bcm4908: add BCM4906 Netgear R8000P
|
||||
DTS files
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Netgear R8000P is home router based on BCM4906 that is a cheaper variant
|
||||
of BCM4908 (e.g. 2 cores instead of 4).
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/broadcom/bcm4908/Makefile | 1 +
|
||||
.../bcm4908/bcm4906-netgear-r8000p.dts | 52 +++++++++++++++++++
|
||||
.../boot/dts/broadcom/bcm4908/bcm4906.dtsi | 18 +++++++
|
||||
3 files changed, 71 insertions(+)
|
||||
create mode 100644 arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts
|
||||
create mode 100644 arch/arm64/boot/dts/broadcom/bcm4908/bcm4906.dtsi
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/Makefile
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/Makefile
|
||||
@@ -1,2 +1,3 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
+dtb-$(CONFIG_ARCH_BCM4908) += bcm4906-netgear-r8000p.dtb
|
||||
dtb-$(CONFIG_ARCH_BCM4908) += bcm4908-asus-gt-ac5300.dtb
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts
|
||||
@@ -0,0 +1,52 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
+
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/input/input.h>
|
||||
+#include <dt-bindings/leds/common.h>
|
||||
+
|
||||
+#include "bcm4906.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ compatible = "netgear,r8000p", "brcm,bcm4906", "brcm,bcm4908";
|
||||
+ model = "Netgear R8000P";
|
||||
+
|
||||
+ memory@0 {
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x00 0x00 0x00 0x20000000>;
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+
|
||||
+ wps {
|
||||
+ function = LED_FUNCTION_WPS;
|
||||
+ color = <LED_COLOR_ID_WHITE>;
|
||||
+ gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&nandcs {
|
||||
+ nand-ecc-strength = <4>;
|
||||
+ nand-ecc-step-size = <512>;
|
||||
+ nand-on-flash-bbt;
|
||||
+
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+
|
||||
+ partitions {
|
||||
+ compatible = "fixed-partitions";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ partition@0 {
|
||||
+ label = "cferom";
|
||||
+ reg = <0x0 0x100000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@100000 {
|
||||
+ label = "firmware";
|
||||
+ reg = <0x100000 0x4400000>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906.dtsi
|
||||
@@ -0,0 +1,18 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
+
|
||||
+#include "bcm4908.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ cpus {
|
||||
+ /delete-node/ cpu@2;
|
||||
+
|
||||
+ /delete-node/ cpu@3;
|
||||
+ };
|
||||
+
|
||||
+ pmu {
|
||||
+ compatible = "arm,cortex-a53-pmu";
|
||||
+ interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
|
||||
+ <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ interrupt-affinity = <&cpu0>, <&cpu1>;
|
||||
+ };
|
||||
+};
|
||||
@ -1,32 +0,0 @@
|
||||
From 56098be85d19cd56b59d7b3854ea035cc8cb9e95 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Tue, 8 Dec 2020 11:49:50 +0100
|
||||
Subject: [PATCH 3/4] arm64: dts: broadcom: bcm4908: use proper NAND binding
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
BCM4908 has controller that needs different IRQ handling just like the
|
||||
BCM63138. Describe it properly.
|
||||
|
||||
On Linux this change fixes:
|
||||
brcmstb_nand ff801800.nand: timeout waiting for command 0x9
|
||||
brcmstb_nand ff801800.nand: intfc status d0000000
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
@@ -164,7 +164,7 @@
|
||||
nand@1800 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
- compatible = "brcm,brcmnand-v7.1", "brcm,brcmnand";
|
||||
+ compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand";
|
||||
reg = <0x1800 0x600>, <0x2000 0x10>;
|
||||
reg-names = "nand", "nand-int-base";
|
||||
interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
|
||||
@ -1,41 +0,0 @@
|
||||
From 1b88c6ed26a1aa1d68d1661404e6e939709ff530 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Thu, 10 Dec 2020 08:21:54 +0100
|
||||
Subject: [PATCH 4/4] arm64: dts: broadcom: bcm4908: describe PCIe reset
|
||||
controller
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This reset controller is a single register in the Broadcom's MISC block.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
@@ -177,6 +177,21 @@
|
||||
};
|
||||
};
|
||||
|
||||
+ misc@2600 {
|
||||
+ compatible = "brcm,misc", "simple-mfd";
|
||||
+ reg = <0x2600 0xe4>;
|
||||
+
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ ranges = <0x00 0x2600 0xe4>;
|
||||
+
|
||||
+ reset-controller@2644 {
|
||||
+ compatible = "brcm,bcm4908-misc-pcie-reset";
|
||||
+ reg = <0x44 0x04>;
|
||||
+ #reset-cells = <1>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
reboot {
|
||||
compatible = "syscon-reboot";
|
||||
regmap = <&timer>;
|
||||
@ -1,184 +0,0 @@
|
||||
From 527a3ac9bdf81da4b7160ce3cea57f28a0e5eb64 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Wed, 13 Jan 2021 12:14:06 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcm4908: describe internal switch
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
BCM4908 has internal switch with 5 GPHYs. Ports 0 - 3 are always
|
||||
connected to the internal PHYs. Remaining ports depend on device setup.
|
||||
|
||||
Asus GT-AC5300 has an extra switch with its PHYs accessible using the
|
||||
internal MDIO.
|
||||
|
||||
CPU port and Ethernet interface remain to be documented.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
.../bcm4908/bcm4908-asus-gt-ac5300.dts | 51 +++++++++++
|
||||
.../boot/dts/broadcom/bcm4908/bcm4908.dtsi | 85 ++++++++++++++++++-
|
||||
2 files changed, 135 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts
|
||||
@@ -44,6 +44,57 @@
|
||||
};
|
||||
};
|
||||
|
||||
+&ports {
|
||||
+ port@0 {
|
||||
+ label = "lan2";
|
||||
+ };
|
||||
+
|
||||
+ port@1 {
|
||||
+ label = "lan1";
|
||||
+ };
|
||||
+
|
||||
+ port@2 {
|
||||
+ label = "lan6";
|
||||
+ };
|
||||
+
|
||||
+ port@3 {
|
||||
+ label = "lan5";
|
||||
+ };
|
||||
+
|
||||
+ /* External BCM53134S switch */
|
||||
+ port@7 {
|
||||
+ label = "sw";
|
||||
+ reg = <7>;
|
||||
+
|
||||
+ fixed-link {
|
||||
+ speed = <1000>;
|
||||
+ full-duplex;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&mdio {
|
||||
+ /* lan8 */
|
||||
+ ethernet-phy@0 {
|
||||
+ reg = <0>;
|
||||
+ };
|
||||
+
|
||||
+ /* lan7 */
|
||||
+ ethernet-phy@1 {
|
||||
+ reg = <1>;
|
||||
+ };
|
||||
+
|
||||
+ /* lan4 */
|
||||
+ ethernet-phy@2 {
|
||||
+ reg = <2>;
|
||||
+ };
|
||||
+
|
||||
+ /* lan3 */
|
||||
+ ethernet-phy@3 {
|
||||
+ reg = <3>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
&nandcs {
|
||||
nand-ecc-strength = <4>;
|
||||
nand-ecc-step-size = <512>;
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
@@ -108,7 +108,7 @@
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
- ranges = <0x00 0x00 0x80000000 0x10000>;
|
||||
+ ranges = <0x00 0x00 0x80000000 0xd0000>;
|
||||
|
||||
usb@c300 {
|
||||
compatible = "generic-ehci";
|
||||
@@ -130,6 +130,89 @@
|
||||
interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
|
||||
status = "disabled";
|
||||
};
|
||||
+
|
||||
+ ethernet-switch@80000 {
|
||||
+ compatible = "simple-bus";
|
||||
+ #size-cells = <1>;
|
||||
+ #address-cells = <1>;
|
||||
+ ranges = <0 0x80000 0x50000>;
|
||||
+
|
||||
+ ethernet-switch@0 {
|
||||
+ compatible = "brcm,bcm4908-switch";
|
||||
+ reg = <0x0 0x40000>,
|
||||
+ <0x40000 0x110>,
|
||||
+ <0x40340 0x30>,
|
||||
+ <0x40380 0x30>,
|
||||
+ <0x40600 0x34>,
|
||||
+ <0x40800 0x208>;
|
||||
+ reg-names = "core", "reg", "intrl2_0",
|
||||
+ "intrl2_1", "fcb", "acb";
|
||||
+ interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
|
||||
+ <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ brcm,num-gphy = <5>;
|
||||
+ brcm,num-rgmii-ports = <2>;
|
||||
+
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+
|
||||
+ ports: ports {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+
|
||||
+ port@0 {
|
||||
+ reg = <0>;
|
||||
+ phy-mode = "internal";
|
||||
+ phy-handle = <&phy8>;
|
||||
+ };
|
||||
+
|
||||
+ port@1 {
|
||||
+ reg = <1>;
|
||||
+ phy-mode = "internal";
|
||||
+ phy-handle = <&phy9>;
|
||||
+ };
|
||||
+
|
||||
+ port@2 {
|
||||
+ reg = <2>;
|
||||
+ phy-mode = "internal";
|
||||
+ phy-handle = <&phy10>;
|
||||
+ };
|
||||
+
|
||||
+ port@3 {
|
||||
+ reg = <3>;
|
||||
+ phy-mode = "internal";
|
||||
+ phy-handle = <&phy11>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ mdio: mdio@405c0 {
|
||||
+ compatible = "brcm,unimac-mdio";
|
||||
+ reg = <0x405c0 0x8>;
|
||||
+ reg-names = "mdio";
|
||||
+ #size-cells = <0>;
|
||||
+ #address-cells = <1>;
|
||||
+
|
||||
+ phy8: ethernet-phy@8 {
|
||||
+ reg = <8>;
|
||||
+ };
|
||||
+
|
||||
+ phy9: ethernet-phy@9 {
|
||||
+ reg = <9>;
|
||||
+ };
|
||||
+
|
||||
+ phy10: ethernet-phy@a {
|
||||
+ reg = <10>;
|
||||
+ };
|
||||
+
|
||||
+ phy11: ethernet-phy@b {
|
||||
+ reg = <11>;
|
||||
+ };
|
||||
+
|
||||
+ phy12: ethernet-phy@c {
|
||||
+ reg = <12>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
};
|
||||
|
||||
bus@ff800000 {
|
||||
@ -1,50 +0,0 @@
|
||||
From edcf90801c8e58bd6306d85a4e714a6f09f452df Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Wed, 13 Jan 2021 12:15:47 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcm4908: describe PMB block
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
PMB (Power Management Bus) controls powering connected devices (e.g.
|
||||
PCIe, USB, SATA). In BCM4908 it's a part of the PROCMON block.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
.../boot/dts/broadcom/bcm4908/bcm4908.dtsi | 17 ++++++++++++++++-
|
||||
1 file changed, 16 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
@@ -108,7 +108,7 @@
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
- ranges = <0x00 0x00 0x80000000 0xd0000>;
|
||||
+ ranges = <0x00 0x00 0x80000000 0x281000>;
|
||||
|
||||
usb@c300 {
|
||||
compatible = "generic-ehci";
|
||||
@@ -213,6 +213,21 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
+
|
||||
+ procmon: syscon@280000 {
|
||||
+ compatible = "simple-bus";
|
||||
+ reg = <0x280000 0x1000>;
|
||||
+ ranges;
|
||||
+
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ power-controller@2800c0 {
|
||||
+ compatible = "brcm,bcm4908-pmb";
|
||||
+ reg = <0x2800c0 0x40>;
|
||||
+ #power-domain-cells = <1>;
|
||||
+ };
|
||||
+ };
|
||||
};
|
||||
|
||||
bus@ff800000 {
|
||||
@ -1,134 +0,0 @@
|
||||
From 3c321ba794ca6383a4aa68ea803e18cc6ad44412 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Fri, 19 Feb 2021 06:50:26 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcm4908: describe USB PHY
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
BCM4908 uses slightly modified STB family USB PHY. It handles OHCI/EHCI
|
||||
and XHCI. It requires powering up using the PMB.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
.../bcm4908/bcm4906-netgear-r8000p.dts | 17 +++++++++++++
|
||||
.../bcm4908/bcm4908-asus-gt-ac5300.dts | 17 +++++++++++++
|
||||
.../boot/dts/broadcom/bcm4908/bcm4908.dtsi | 25 ++++++++++++++++---
|
||||
3 files changed, 55 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts
|
||||
@@ -26,6 +26,23 @@
|
||||
};
|
||||
};
|
||||
|
||||
+&usb_phy {
|
||||
+ brcm,ioc = <1>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ehci {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ohci {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&xhci {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&nandcs {
|
||||
nand-ecc-strength = <4>;
|
||||
nand-ecc-step-size = <512>;
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts
|
||||
@@ -44,6 +44,23 @@
|
||||
};
|
||||
};
|
||||
|
||||
+&usb_phy {
|
||||
+ brcm,ioc = <1>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ehci {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ohci {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&xhci {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&ports {
|
||||
port@0 {
|
||||
label = "lan2";
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
+#include <dt-bindings/phy/phy.h>
|
||||
+#include <dt-bindings/soc/bcm-pmb.h>
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
@@ -110,24 +112,39 @@
|
||||
#size-cells = <1>;
|
||||
ranges = <0x00 0x00 0x80000000 0x281000>;
|
||||
|
||||
- usb@c300 {
|
||||
+ usb_phy: usb-phy@c200 {
|
||||
+ compatible = "brcm,bcm4908-usb-phy";
|
||||
+ reg = <0xc200 0x100>;
|
||||
+ reg-names = "ctrl";
|
||||
+ power-domains = <&pmb BCM_PMB_HOST_USB>;
|
||||
+ dr_mode = "host";
|
||||
+ brcm,has-xhci;
|
||||
+ brcm,has-eohci;
|
||||
+ #phy-cells = <1>;
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+
|
||||
+ ehci: usb@c300 {
|
||||
compatible = "generic-ehci";
|
||||
reg = <0xc300 0x100>;
|
||||
interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ phys = <&usb_phy PHY_TYPE_USB2>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
- usb@c400 {
|
||||
+ ohci: usb@c400 {
|
||||
compatible = "generic-ohci";
|
||||
reg = <0xc400 0x100>;
|
||||
interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ phys = <&usb_phy PHY_TYPE_USB2>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
- usb@d000 {
|
||||
+ xhci: usb@d000 {
|
||||
compatible = "generic-xhci";
|
||||
reg = <0xd000 0x8c8>;
|
||||
interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ phys = <&usb_phy PHY_TYPE_USB3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -222,7 +239,7 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
- power-controller@2800c0 {
|
||||
+ pmb: power-controller@2800c0 {
|
||||
compatible = "brcm,bcm4908-pmb";
|
||||
reg = <0x2800c0 0x40>;
|
||||
#power-domain-cells = <1>;
|
||||
@ -1,51 +0,0 @@
|
||||
From b1bbe48eec190b6a35f400c5a3ec6b0fc8fc3fe6 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Fri, 19 Feb 2021 06:50:27 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcm4908: describe Ethernet controller
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
BCM4908 SoCs have an integrated Ethernet controller.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
.../boot/dts/broadcom/bcm4908/bcm4908.dtsi | 19 +++++++++++++++++++
|
||||
1 file changed, 19 insertions(+)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
@@ -112,6 +112,14 @@
|
||||
#size-cells = <1>;
|
||||
ranges = <0x00 0x00 0x80000000 0x281000>;
|
||||
|
||||
+ enet: ethernet@2000 {
|
||||
+ compatible = "brcm,bcm4908-enet";
|
||||
+ reg = <0x2000 0x1000>;
|
||||
+
|
||||
+ interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ interrupt-names = "rx";
|
||||
+ };
|
||||
+
|
||||
usb_phy: usb-phy@c200 {
|
||||
compatible = "brcm,bcm4908-usb-phy";
|
||||
reg = <0xc200 0x100>;
|
||||
@@ -199,6 +207,17 @@
|
||||
phy-mode = "internal";
|
||||
phy-handle = <&phy11>;
|
||||
};
|
||||
+
|
||||
+ port@8 {
|
||||
+ reg = <8>;
|
||||
+ phy-mode = "internal";
|
||||
+ ethernet = <&enet>;
|
||||
+
|
||||
+ fixed-link {
|
||||
+ speed = <1000>;
|
||||
+ full-duplex;
|
||||
+ };
|
||||
+ };
|
||||
};
|
||||
};
|
||||
|
||||
@ -1,50 +0,0 @@
|
||||
From 406e98afffe975982f63ea5d21bf9a47a81b56ee Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Fri, 19 Feb 2021 06:50:28 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcm4908: describe Netgear R8000P switch
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
R8000P model has 4 LAN ports and 1 WAN port.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
.../bcm4908/bcm4906-netgear-r8000p.dts | 25 +++++++++++++++++++
|
||||
1 file changed, 25 insertions(+)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts
|
||||
@@ -43,6 +43,31 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&ports {
|
||||
+ port@0 {
|
||||
+ label = "lan4";
|
||||
+ };
|
||||
+
|
||||
+ port@1 {
|
||||
+ label = "lan3";
|
||||
+ };
|
||||
+
|
||||
+ port@2 {
|
||||
+ label = "lan2";
|
||||
+ };
|
||||
+
|
||||
+ port@3 {
|
||||
+ label = "lan1";
|
||||
+ };
|
||||
+
|
||||
+ port@7 {
|
||||
+ reg = <7>;
|
||||
+ phy-mode = "internal";
|
||||
+ phy-handle = <&phy12>;
|
||||
+ label = "wan";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
&nandcs {
|
||||
nand-ecc-strength = <4>;
|
||||
nand-ecc-step-size = <512>;
|
||||
@ -1,81 +0,0 @@
|
||||
From 6224415c0389ba6661825746312163a64ece8f3a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Fri, 19 Feb 2021 06:50:29 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcm4908: add remaining Netgear R8000P
|
||||
LEDs
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
There are a few more GPIO connected LEDs there didn't get described
|
||||
initially.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
.../bcm4908/bcm4906-netgear-r8000p.dts | 50 ++++++++++++++++++-
|
||||
1 file changed, 49 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts
|
||||
@@ -18,11 +18,59 @@
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
- wps {
|
||||
+ led-power-white {
|
||||
+ function = LED_FUNCTION_POWER;
|
||||
+ color = <LED_COLOR_ID_WHITE>;
|
||||
+ gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-power-amber {
|
||||
+ function = LED_FUNCTION_POWER;
|
||||
+ color = <LED_COLOR_ID_AMBER>;
|
||||
+ gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-wps {
|
||||
function = LED_FUNCTION_WPS;
|
||||
color = <LED_COLOR_ID_WHITE>;
|
||||
gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
+
|
||||
+ led-2ghz {
|
||||
+ function = "2ghz";
|
||||
+ color = <LED_COLOR_ID_WHITE>;
|
||||
+ gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-5ghz-1 {
|
||||
+ function = "5ghz-1";
|
||||
+ color = <LED_COLOR_ID_WHITE>;
|
||||
+ gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-5ghz-2 {
|
||||
+ function = "5ghz-2";
|
||||
+ color = <LED_COLOR_ID_WHITE>;
|
||||
+ gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-usb2 {
|
||||
+ function = "usb2";
|
||||
+ color = <LED_COLOR_ID_WHITE>;
|
||||
+ gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-usb3 {
|
||||
+ function = "usb3";
|
||||
+ color = <LED_COLOR_ID_WHITE>;
|
||||
+ gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-wifi {
|
||||
+ function = "wifi";
|
||||
+ color = <LED_COLOR_ID_WHITE>;
|
||||
+ gpios = <&gpio0 56 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
};
|
||||
};
|
||||
|
||||
@ -1,55 +0,0 @@
|
||||
From cbaca2c467dc25a163107e14a53b7925214eab17 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Fri, 19 Feb 2021 06:50:30 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcm4908: describe firmware partitions
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
BCM4908 bootloader supports multiple firmware partitions and has its own
|
||||
bindings defined for them.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
.../dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts | 1 +
|
||||
.../dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts | 12 +++++++++++-
|
||||
2 files changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts
|
||||
@@ -135,6 +135,7 @@
|
||||
};
|
||||
|
||||
partition@100000 {
|
||||
+ compatible = "brcm,bcm4908-firmware";
|
||||
label = "firmware";
|
||||
reg = <0x100000 0x4400000>;
|
||||
};
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts
|
||||
@@ -122,7 +122,7 @@
|
||||
#size-cells = <0>;
|
||||
|
||||
partitions {
|
||||
- compatible = "fixed-partitions";
|
||||
+ compatible = "brcm,bcm4908-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
@@ -130,5 +130,15 @@
|
||||
label = "cferom";
|
||||
reg = <0x0 0x100000>;
|
||||
};
|
||||
+
|
||||
+ partition@100000 {
|
||||
+ compatible = "brcm,bcm4908-firmware";
|
||||
+ reg = <0x100000 0x5700000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@5800000 {
|
||||
+ compatible = "brcm,bcm4908-firmware";
|
||||
+ reg = <0x5800000 0x5700000>;
|
||||
+ };
|
||||
};
|
||||
};
|
||||
@ -1,30 +0,0 @@
|
||||
From a348ff97ffb840b9d74b0e64b3e0e6002187d224 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Tue, 9 Mar 2021 19:44:09 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcm4908: fix switch parent node name
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Ethernet switch and MDIO are grouped using "simple-bus". It's not
|
||||
allowed to use "ethernet-switch" node name as it isn't a switch. Replace
|
||||
it with "bus".
|
||||
|
||||
Fixes: 527a3ac9bdf8 ("arm64: dts: broadcom: bcm4908: describe internal switch")
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
@@ -156,7 +156,7 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
- ethernet-switch@80000 {
|
||||
+ bus@80000 {
|
||||
compatible = "simple-bus";
|
||||
#size-cells = <1>;
|
||||
#address-cells = <1>;
|
||||
@ -1,27 +0,0 @@
|
||||
From b3de2a12d1a61d90a4d86c9840acc7d05066137f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Wed, 10 Mar 2021 08:46:02 +0100
|
||||
Subject: [PATCH] dt-bindings: arm: bcm: document TP-Link Archer C2300 binding
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
One more BCM4906 based device.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Reviewed-by: Rob Herring <robh@kernel.org>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
Documentation/devicetree/bindings/arm/bcm/brcm,bcm4908.yaml | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/Documentation/devicetree/bindings/arm/bcm/brcm,bcm4908.yaml
|
||||
+++ b/Documentation/devicetree/bindings/arm/bcm/brcm,bcm4908.yaml
|
||||
@@ -21,6 +21,7 @@ properties:
|
||||
items:
|
||||
- enum:
|
||||
- netgear,r8000p
|
||||
+ - tplink,archer-c2300-v1
|
||||
- const: brcm,bcm4906
|
||||
- const: brcm,bcm4908
|
||||
|
||||
@ -1,212 +0,0 @@
|
||||
From 6a30934a5470a0ce7ea32b0c6b600accfae94b1a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Wed, 10 Mar 2021 08:46:03 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcm4908: add TP-Link Archer C2300 V1
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Archer C2300 V1 is a home router based on the BCM4906 (2 CPU cores). It
|
||||
has 512 MiB of RAM, NAND flash, USB 2.0 and USB 3.0 ports, 4 LAN ports,
|
||||
1 WAN port.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/broadcom/bcm4908/Makefile | 1 +
|
||||
.../bcm4906-tplink-archer-c2300-v1.dts | 182 ++++++++++++++++++
|
||||
2 files changed, 183 insertions(+)
|
||||
create mode 100644 arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-tplink-archer-c2300-v1.dts
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/Makefile
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/Makefile
|
||||
@@ -1,3 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
dtb-$(CONFIG_ARCH_BCM4908) += bcm4906-netgear-r8000p.dtb
|
||||
+dtb-$(CONFIG_ARCH_BCM4908) += bcm4906-tplink-archer-c2300-v1.dtb
|
||||
dtb-$(CONFIG_ARCH_BCM4908) += bcm4908-asus-gt-ac5300.dtb
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-tplink-archer-c2300-v1.dts
|
||||
@@ -0,0 +1,182 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
+
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/input/input.h>
|
||||
+#include <dt-bindings/leds/common.h>
|
||||
+
|
||||
+#include "bcm4906.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ compatible = "tplink,archer-c2300-v1", "brcm,bcm4906", "brcm,bcm4908";
|
||||
+ model = "TP-Link Archer C2300 V1";
|
||||
+
|
||||
+ memory@0 {
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x00 0x00 0x00 0x20000000>;
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+
|
||||
+ led-power {
|
||||
+ function = LED_FUNCTION_POWER;
|
||||
+ color = <LED_COLOR_ID_BLUE>;
|
||||
+ gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-2ghz {
|
||||
+ function = "2ghz";
|
||||
+ color = <LED_COLOR_ID_BLUE>;
|
||||
+ gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-5ghz {
|
||||
+ function = "5ghz";
|
||||
+ color = <LED_COLOR_ID_BLUE>;
|
||||
+ gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-wan-amber {
|
||||
+ function = LED_FUNCTION_WAN;
|
||||
+ color = <LED_COLOR_ID_AMBER>;
|
||||
+ gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ led-wan-blue {
|
||||
+ function = LED_FUNCTION_WAN;
|
||||
+ color = <LED_COLOR_ID_BLUE>;
|
||||
+ gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-lan {
|
||||
+ function = LED_FUNCTION_LAN;
|
||||
+ color = <LED_COLOR_ID_BLUE>;
|
||||
+ gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-wps {
|
||||
+ function = LED_FUNCTION_WPS;
|
||||
+ color = <LED_COLOR_ID_BLUE>;
|
||||
+ gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-usb2 {
|
||||
+ function = "usb2";
|
||||
+ color = <LED_COLOR_ID_BLUE>;
|
||||
+ gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-usb3 {
|
||||
+ function = "usbd3";
|
||||
+ color = <LED_COLOR_ID_BLUE>;
|
||||
+ gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-brightness {
|
||||
+ function = LED_FUNCTION_BACKLIGHT;
|
||||
+ color = <LED_COLOR_ID_WHITE>;
|
||||
+ gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ gpio-keys-polled {
|
||||
+ compatible = "gpio-keys-polled";
|
||||
+ poll-interval = <100>;
|
||||
+
|
||||
+ brightness {
|
||||
+ label = "LEDs";
|
||||
+ linux,code = <KEY_BRIGHTNESS_ZERO>;
|
||||
+ gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ wps {
|
||||
+ label = "WPS";
|
||||
+ linux,code = <KEY_WPS_BUTTON>;
|
||||
+ gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ wifi {
|
||||
+ label = "WiFi";
|
||||
+ linux,code = <KEY_RFKILL>;
|
||||
+ gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ restart {
|
||||
+ label = "Reset";
|
||||
+ linux,code = <KEY_RESTART>;
|
||||
+ gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&usb_phy {
|
||||
+ brcm,ioc = <1>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ehci {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ohci {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&xhci {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ports {
|
||||
+ port@0 {
|
||||
+ label = "lan4";
|
||||
+ };
|
||||
+
|
||||
+ port@1 {
|
||||
+ label = "lan3";
|
||||
+ };
|
||||
+
|
||||
+ port@2 {
|
||||
+ label = "lan2";
|
||||
+ };
|
||||
+
|
||||
+ port@3 {
|
||||
+ label = "lan1";
|
||||
+ };
|
||||
+
|
||||
+ port@7 {
|
||||
+ reg = <7>;
|
||||
+ phy-mode = "internal";
|
||||
+ phy-handle = <&phy12>;
|
||||
+ label = "wan";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&nandcs {
|
||||
+ nand-ecc-strength = <4>;
|
||||
+ nand-ecc-step-size = <512>;
|
||||
+ nand-on-flash-bbt;
|
||||
+
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+
|
||||
+ partitions {
|
||||
+ compatible = "brcm,bcm4908-partitions";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ partition@0 {
|
||||
+ label = "cferom";
|
||||
+ reg = <0x0 0x100000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@100000 {
|
||||
+ compatible = "brcm,bcm4908-firmware";
|
||||
+ reg = <0x100000 0x3900000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@5800000 {
|
||||
+ compatible = "brcm,bcm4908-firmware";
|
||||
+ reg = <0x3a00000 0x3900000>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
@ -1,28 +0,0 @@
|
||||
From 5ccb9f9cf05bbd729430c6d6d30d40c96a15c56a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Fri, 12 Mar 2021 12:01:20 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcm4908: set Asus GT-AC5300 port 7 PHY
|
||||
mode
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Port 7 is connected to the external BCM53134S switch using RGMII.
|
||||
|
||||
Fixes: 527a3ac9bdf8 ("arm64: dts: broadcom: bcm4908: describe internal switch")
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts
|
||||
@@ -82,6 +82,7 @@
|
||||
port@7 {
|
||||
label = "sw";
|
||||
reg = <7>;
|
||||
+ phy-mode = "rgmii";
|
||||
|
||||
fixed-link {
|
||||
speed = <1000>;
|
||||
@ -1,30 +0,0 @@
|
||||
From 5337af7918bedde9713cd223ce5df74b3d6c7d7a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Wed, 17 Mar 2021 09:16:31 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcm4908: add Ethernet TX irq
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This hardware supports two interrupts, one per DMA channel (RX and TX).
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
@@ -116,8 +116,9 @@
|
||||
compatible = "brcm,bcm4908-enet";
|
||||
reg = <0x2000 0x1000>;
|
||||
|
||||
- interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
|
||||
- interrupt-names = "rx";
|
||||
+ interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>,
|
||||
+ <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ interrupt-names = "rx", "tx";
|
||||
};
|
||||
|
||||
usb_phy: usb-phy@c200 {
|
||||
@ -1,82 +0,0 @@
|
||||
From 9f01f5cdb548352418b34ce77db02a560fe2913b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Mon, 29 Mar 2021 17:45:14 +0200
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcm4908: add Ethernet MAC addr
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
On most BCM4908 devices MAC address can be read from the bootloader
|
||||
binary section containing device settings. Use NVMEM to describe that.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
.../broadcom/bcm4908/bcm4906-netgear-r8000p.dts | 14 ++++++++++++++
|
||||
.../broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts | 14 ++++++++++++++
|
||||
2 files changed, 28 insertions(+)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts
|
||||
@@ -74,6 +74,11 @@
|
||||
};
|
||||
};
|
||||
|
||||
+&enet {
|
||||
+ nvmem-cells = <&base_mac_addr>;
|
||||
+ nvmem-cell-names = "mac-address";
|
||||
+};
|
||||
+
|
||||
&usb_phy {
|
||||
brcm,ioc = <1>;
|
||||
status = "okay";
|
||||
@@ -130,8 +135,17 @@
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
+ compatible = "nvmem-cells";
|
||||
label = "cferom";
|
||||
reg = <0x0 0x100000>;
|
||||
+
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ ranges = <0 0x0 0x100000>;
|
||||
+
|
||||
+ base_mac_addr: mac@106a0 {
|
||||
+ reg = <0x106a0 0x6>;
|
||||
+ };
|
||||
};
|
||||
|
||||
partition@100000 {
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts
|
||||
@@ -44,6 +44,11 @@
|
||||
};
|
||||
};
|
||||
|
||||
+&enet {
|
||||
+ nvmem-cells = <&base_mac_addr>;
|
||||
+ nvmem-cell-names = "mac-address";
|
||||
+};
|
||||
+
|
||||
&usb_phy {
|
||||
brcm,ioc = <1>;
|
||||
status = "okay";
|
||||
@@ -128,8 +133,17 @@
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
+ compatible = "nvmem-cells";
|
||||
label = "cferom";
|
||||
reg = <0x0 0x100000>;
|
||||
+
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ ranges = <0 0x0 0x100000>;
|
||||
+
|
||||
+ base_mac_addr: mac@106a0 {
|
||||
+ reg = <0x106a0 0x6>;
|
||||
+ };
|
||||
};
|
||||
|
||||
partition@100000 {
|
||||
@ -1,25 +0,0 @@
|
||||
From b660269cba748dfd07eb5551a88ff34d5ea0b86e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Fri, 16 Apr 2021 15:37:48 +0200
|
||||
Subject: [PATCH] ARM: dts: BCM5301X: Fix NAND nodes names
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This matches nand-controller.yaml requirements.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
@@ -306,7 +306,7 @@
|
||||
interrupt-names = "nand";
|
||||
status = "okay";
|
||||
|
||||
- nandcs: nandcs@0 {
|
||||
+ nandcs: nand@0 {
|
||||
compatible = "brcm,nandcs";
|
||||
reg = <0>;
|
||||
};
|
||||
@ -1,27 +0,0 @@
|
||||
From d0ae9c944b9472c5691a482297df7a57d7fd1199 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Thu, 19 Aug 2021 14:11:08 +0200
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcm4908: Fix NAND node name
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This matches nand-controller.yaml requirements.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
@@ -296,7 +296,7 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
- nand@1800 {
|
||||
+ nand-controller@1800 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand";
|
||||
@ -1,38 +0,0 @@
|
||||
From 6cf9f70255b90b540b9cbde062f18fea29024a75 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Thu, 19 Aug 2021 14:26:06 +0200
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcm4908: Move reboot syscon out of bus
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This fixes following error for every bcm4908 DTS file:
|
||||
bus@ff800000: reboot: {'type': 'object'} is not allowed for {'compatible': ['syscon-reboot'], 'regmap': [[15]], 'offset': [[52]], 'mask': [[1]]}
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
|
||||
@@ -326,12 +326,12 @@
|
||||
#reset-cells = <1>;
|
||||
};
|
||||
};
|
||||
+ };
|
||||
|
||||
- reboot {
|
||||
- compatible = "syscon-reboot";
|
||||
- regmap = <&timer>;
|
||||
- offset = <0x34>;
|
||||
- mask = <1>;
|
||||
- };
|
||||
+ reboot {
|
||||
+ compatible = "syscon-reboot";
|
||||
+ regmap = <&timer>;
|
||||
+ offset = <0x34>;
|
||||
+ mask = <1>;
|
||||
};
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user