Skip to content

Commit

Permalink
Merge Official Source
Browse files Browse the repository at this point in the history
Signed-off-by: Tianling Shen <[email protected]>
  • Loading branch information
1715173329 committed Jan 7, 2025
2 parents 1ceaac2 + 285bdd2 commit 482b69f
Show file tree
Hide file tree
Showing 165 changed files with 4,269 additions and 327 deletions.
3 changes: 2 additions & 1 deletion include/trusted-firmware-a.mk
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ endef
DTC=$(wildcard $(LINUX_DIR)/scripts/dtc/dtc)

define Build/Compile/Trusted-Firmware-A
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+unset CC; \
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
CROSS_COMPILE=$(TARGET_CROSS) \
OPENSSL_DIR=$(STAGING_DIR_HOST) \
$(if $(DTC),DTC="$(DTC)") \
Expand Down
2 changes: 1 addition & 1 deletion package/base-files/files/lib/functions/system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ get_mac_ascii() {
local key="$2"
local mac_dirty

mac_dirty=$(strings "$part" | sed -n 's/^'"$key"'=//p')
mac_dirty=$(strings "$part" | tr -d ' \t' | sed -n 's/^'"$key"'=//p' | head -n 1)

# "canonicalize" mac
[ -n "$mac_dirty" ] && macaddr_canonicalize "$mac_dirty"
Expand Down
4 changes: 2 additions & 2 deletions package/boot/uboot-envtools/files/qualcommax_ipq60xx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ cambiumnetworks,xe3-4)
linksys,mr7350)
idx="$(find_mtd_index u_env)"
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000" "2"
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000"
;;
netgear,wax214)
idx="$(find_mtd_index 0:appsblenv)"
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000" "2"
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000"
;;
yuncore,fap650)
idx="$(find_mtd_index 0:appsblenv)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver"
--- /dev/null
+++ b/openwrt-one-spi-nand_env
@@ -0,0 +1,61 @@
@@ -0,0 +1,62 @@
+ethaddr_factory=mtd read factory 0x46000000 0x0 0x20000 && env readmem -b ethaddr 0x4600002a 0x6 ; setenv ethaddr_factory
+ipaddr=192.168.11.11
+serverip=192.168.11.23
Expand Down Expand Up @@ -562,6 +562,7 @@
+check_buttons=if button front ; then run boot_recovery ; run boot_tftp ; run led_loop_error ; else if button back ; then ; run usb_recover ; run led_loop_error ; fi ; fi
+led_boot=led green on ; led white on ; led red on
+led_done=led green on ; led white off ; led red off
+led_loop_done=led white off ; led green on ; echo done ; while true ; do sleep 1 ; done
+led_loop_error=led white off ; led green off ; while true ; do led red on ; sleep 1 ; led red off ; sleep 1 ; done
+led_start=led white on ; led green off ; led red off
+preboot=run led_boot
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- /dev/null
+++ b/configs/mt7981_routerich_ax3000_defconfig
@@ -0,0 +1,107 @@
@@ -0,0 +1,108 @@
+CONFIG_ARM=y
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
+CONFIG_POSITION_INDEPENDENT=y
Expand Down
17 changes: 17 additions & 0 deletions package/kernel/linux/modules/leds.mk
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,23 @@ endef
$(eval $(call KernelPackage,leds-pwm))


define KernelPackage/leds-st1202
SUBMENU:=LED modules
TITLE:=LED support for ST LED1202 I2C chips
DEPENDS:=+kmod-i2c-core +kmod-ledtrig-pattern
KCONFIG:=CONFIG_LEDS_ST1202
FILES:= $(LINUX_DIR)/drivers/leds/leds-st1202.ko
AUTOLOAD:=$(call AutoProbe,leds-st1202)
endef

define KernelPackage/leds-st1202/description
This option enables support for LEDs connected to LED1202
LED driver chips accessed via the I2C bus.
endef

$(eval $(call KernelPackage,leds-st1202))


define KernelPackage/leds-tlc591xx
SUBMENU:=$(LEDS_MENU)
TITLE:=LED driver for TLC59108 and TLC59116 controllers
Expand Down
2 changes: 1 addition & 1 deletion package/kernel/linux/modules/netdevices.mk
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ $(eval $(call KernelPackage,8139cp))
define KernelPackage/r8169
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=RealTek RTL-8169 PCI Gigabit Ethernet Adapter kernel support
DEPENDS:=@PCI_SUPPORT +kmod-mii +r8169-firmware +kmod-phy-realtek +kmod-mdio-devres
DEPENDS:=@PCI_SUPPORT +kmod-mii +r8169-firmware +kmod-phy-realtek +kmod-mdio-devres +kmod-hwmon-core
KCONFIG:= \
CONFIG_R8169 \
CONFIG_R8169_LEDS=y
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
From 654653e718f6c55c6f29fd94cc8152a92c8166ac Mon Sep 17 00:00:00 2001
From: Shiji Yang <[email protected]>
Date: Tue, 24 Dec 2024 08:36:32 +0800
Subject: [PATCH 1/2] rt2x00: respect the rt2800 hardware TX queue index

The Ralink TX queue register index is different from the Linux
IEEE80211 queue id definition. Their conversion table is as follows:

Queue IEEE80211 Ralink
AC_VO 0 3
AC_VI 1 2
AC_BE 2 0
AC_BK 3 1

The TX queues are still functioning properly under the current
configuration. I don't have evidence, but I believe there should
be some differences in the internal hardware implementation of
different TX queues, e.g. interrupt priority. so it's better to
respect the queue index defined by the Ralink when we construct
the TX rings and descriptors.

And the more important thing is that we are using the wrong queue
index to calculate the register offset and mask in .conf_tx(),
which resulted in writing incorrect AIFSN, CWMAX, CWMIN and TXOP
values for all TX queues. This patch introduces a index conversion
table to fix these parameters.

Signed-off-by: Shiji Yang <[email protected]>
---
drivers/net/wireless/ralink/rt2x00/rt2800.h | 24 ++++++------
.../net/wireless/ralink/rt2x00/rt2800lib.c | 20 +++++++---
.../net/wireless/ralink/rt2x00/rt2800mmio.c | 38 ++++++++++---------
.../net/wireless/ralink/rt2x00/rt2x00queue.h | 20 ++++++++++
4 files changed, 67 insertions(+), 35 deletions(-)

--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h
@@ -379,10 +379,10 @@

/*
* WMM_AIFSN_CFG: Aifsn for each EDCA AC
- * AIFSN0: AC_VO
- * AIFSN1: AC_VI
- * AIFSN2: AC_BE
- * AIFSN3: AC_BK
+ * AIFSN0: AC_BE
+ * AIFSN1: AC_BK
+ * AIFSN2: AC_VI
+ * AIFSN3: AC_VO
*/
#define WMM_AIFSN_CFG 0x0214
#define WMM_AIFSN_CFG_AIFSN0 FIELD32(0x0000000f)
@@ -392,10 +392,10 @@

/*
* WMM_CWMIN_CSR: CWmin for each EDCA AC
- * CWMIN0: AC_VO
- * CWMIN1: AC_VI
- * CWMIN2: AC_BE
- * CWMIN3: AC_BK
+ * CWMIN0: AC_BE
+ * CWMIN1: AC_BK
+ * CWMIN2: AC_VI
+ * CWMIN3: AC_VO
*/
#define WMM_CWMIN_CFG 0x0218
#define WMM_CWMIN_CFG_CWMIN0 FIELD32(0x0000000f)
@@ -405,10 +405,10 @@

/*
* WMM_CWMAX_CSR: CWmax for each EDCA AC
- * CWMAX0: AC_VO
- * CWMAX1: AC_VI
- * CWMAX2: AC_BE
- * CWMAX3: AC_BK
+ * CWMAX0: AC_BE
+ * CWMAX1: AC_BK
+ * CWMAX2: AC_VI
+ * CWMAX3: AC_VO
*/
#define WMM_CWMAX_CFG 0x021c
#define WMM_CWMAX_CFG_CWMAX0 FIELD32(0x0000000f)
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -835,7 +835,8 @@ void rt2800_write_tx_data(struct queue_e
txdesc->key_idx : txdesc->u.ht.wcid);
rt2x00_set_field32(&word, TXWI_W1_MPDU_TOTAL_BYTE_COUNT,
txdesc->length);
- rt2x00_set_field32(&word, TXWI_W1_PACKETID_QUEUE, entry->queue->qid);
+ rt2x00_set_field32(&word, TXWI_W1_PACKETID_QUEUE,
+ rt2x00_ac_to_hwq(entry->queue->qid));
rt2x00_set_field32(&word, TXWI_W1_PACKETID_ENTRY, (entry->entry_idx % 3) + 1);
rt2x00_desc_write(txwi, 1, word);

@@ -1125,6 +1126,12 @@ void rt2800_txdone(struct rt2x00_dev *rt
u32 reg;
u8 qid;
bool match;
+ static const u8 rt2ac[] = {
+ IEEE80211_AC_BE,
+ IEEE80211_AC_BK,
+ IEEE80211_AC_VI,
+ IEEE80211_AC_VO,
+ };

while (quota-- > 0 && kfifo_get(&rt2x00dev->txstatus_fifo, &reg)) {
/*
@@ -1132,6 +1139,8 @@ void rt2800_txdone(struct rt2x00_dev *rt
* guaranteed to be one of the TX QIDs .
*/
qid = rt2x00_get_field32(reg, TX_STA_FIFO_PID_QUEUE);
+ /* Convert Ralink hardware queue index to IEEE80211 queue id. */
+ qid = rt2ac[qid];
queue = rt2x00queue_get_tx_queue(rt2x00dev, qid);

if (unlikely(rt2x00queue_empty(queue))) {
@@ -12188,8 +12197,9 @@ int rt2800_conf_tx(struct ieee80211_hw *
queue = rt2x00queue_get_tx_queue(rt2x00dev, queue_idx);

/* Update WMM TXOP register */
- offset = WMM_TXOP0_CFG + (sizeof(u32) * (!!(queue_idx & 2)));
- field.bit_offset = (queue_idx & 1) * 16;
+ offset = WMM_TXOP0_CFG +
+ (sizeof(u32) * (!!(rt2x00_ac_to_hwq(queue_idx) & 2)));
+ field.bit_offset = (rt2x00_ac_to_hwq(queue_idx) & 1) * 16;
field.bit_mask = 0xffff << field.bit_offset;

reg = rt2800_register_read(rt2x00dev, offset);
@@ -12197,7 +12207,7 @@ int rt2800_conf_tx(struct ieee80211_hw *
rt2800_register_write(rt2x00dev, offset, reg);

/* Update WMM registers */
- field.bit_offset = queue_idx * 4;
+ field.bit_offset = rt2x00_ac_to_hwq(queue_idx) * 4;
field.bit_mask = 0xf << field.bit_offset;

reg = rt2800_register_read(rt2x00dev, WMM_AIFSN_CFG);
@@ -12213,7 +12223,7 @@ int rt2800_conf_tx(struct ieee80211_hw *
rt2800_register_write(rt2x00dev, WMM_CWMAX_CFG, reg);

/* Update EDCA registers */
- offset = EDCA_AC0_CFG + (sizeof(u32) * queue_idx);
+ offset = EDCA_AC0_CFG + (sizeof(u32) * rt2x00_ac_to_hwq(queue_idx));

reg = rt2800_register_read(rt2x00dev, offset);
rt2x00_set_field32(&reg, EDCA_AC0_CFG_TX_OP, queue->txop);
--- a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c
@@ -35,7 +35,7 @@ unsigned int rt2800mmio_get_dma_done(str
case QID_AC_VI:
case QID_AC_BE:
case QID_AC_BK:
- qid = queue->qid;
+ qid = rt2x00_ac_to_hwq(queue->qid);
idx = rt2x00mmio_register_read(rt2x00dev, TX_DTX_IDX(qid));
break;
case QID_MGMT:
@@ -456,6 +456,7 @@ void rt2800mmio_kick_queue(struct data_q
{
struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
struct queue_entry *entry;
+ u8 qid;

switch (queue->qid) {
case QID_AC_VO:
@@ -464,7 +465,8 @@ void rt2800mmio_kick_queue(struct data_q
case QID_AC_BK:
WARN_ON_ONCE(rt2x00queue_empty(queue));
entry = rt2x00queue_get_entry(queue, Q_INDEX);
- rt2x00mmio_register_write(rt2x00dev, TX_CTX_IDX(queue->qid),
+ qid = rt2x00_ac_to_hwq(queue->qid);
+ rt2x00mmio_register_write(rt2x00dev, TX_CTX_IDX(qid),
entry->entry_idx);
hrtimer_start(&rt2x00dev->txstatus_timer,
TXSTATUS_TIMEOUT, HRTIMER_MODE_REL);
@@ -666,36 +668,36 @@ int rt2800mmio_init_queues(struct rt2x00
* Initialize registers.
*/
entry_priv = rt2x00dev->tx[0].entries[0].priv_data;
- rt2x00mmio_register_write(rt2x00dev, TX_BASE_PTR0,
+ rt2x00mmio_register_write(rt2x00dev, TX_BASE_PTR3,
entry_priv->desc_dma);
- rt2x00mmio_register_write(rt2x00dev, TX_MAX_CNT0,
+ rt2x00mmio_register_write(rt2x00dev, TX_MAX_CNT3,
rt2x00dev->tx[0].limit);
- rt2x00mmio_register_write(rt2x00dev, TX_CTX_IDX0, 0);
- rt2x00mmio_register_write(rt2x00dev, TX_DTX_IDX0, 0);
+ rt2x00mmio_register_write(rt2x00dev, TX_CTX_IDX3, 0);
+ rt2x00mmio_register_write(rt2x00dev, TX_DTX_IDX3, 0);

entry_priv = rt2x00dev->tx[1].entries[0].priv_data;
- rt2x00mmio_register_write(rt2x00dev, TX_BASE_PTR1,
+ rt2x00mmio_register_write(rt2x00dev, TX_BASE_PTR2,
entry_priv->desc_dma);
- rt2x00mmio_register_write(rt2x00dev, TX_MAX_CNT1,
+ rt2x00mmio_register_write(rt2x00dev, TX_MAX_CNT2,
rt2x00dev->tx[1].limit);
- rt2x00mmio_register_write(rt2x00dev, TX_CTX_IDX1, 0);
- rt2x00mmio_register_write(rt2x00dev, TX_DTX_IDX1, 0);
+ rt2x00mmio_register_write(rt2x00dev, TX_CTX_IDX2, 0);
+ rt2x00mmio_register_write(rt2x00dev, TX_DTX_IDX2, 0);

entry_priv = rt2x00dev->tx[2].entries[0].priv_data;
- rt2x00mmio_register_write(rt2x00dev, TX_BASE_PTR2,
+ rt2x00mmio_register_write(rt2x00dev, TX_BASE_PTR0,
entry_priv->desc_dma);
- rt2x00mmio_register_write(rt2x00dev, TX_MAX_CNT2,
+ rt2x00mmio_register_write(rt2x00dev, TX_MAX_CNT0,
rt2x00dev->tx[2].limit);
- rt2x00mmio_register_write(rt2x00dev, TX_CTX_IDX2, 0);
- rt2x00mmio_register_write(rt2x00dev, TX_DTX_IDX2, 0);
+ rt2x00mmio_register_write(rt2x00dev, TX_CTX_IDX0, 0);
+ rt2x00mmio_register_write(rt2x00dev, TX_DTX_IDX0, 0);

entry_priv = rt2x00dev->tx[3].entries[0].priv_data;
- rt2x00mmio_register_write(rt2x00dev, TX_BASE_PTR3,
+ rt2x00mmio_register_write(rt2x00dev, TX_BASE_PTR1,
entry_priv->desc_dma);
- rt2x00mmio_register_write(rt2x00dev, TX_MAX_CNT3,
+ rt2x00mmio_register_write(rt2x00dev, TX_MAX_CNT1,
rt2x00dev->tx[3].limit);
- rt2x00mmio_register_write(rt2x00dev, TX_CTX_IDX3, 0);
- rt2x00mmio_register_write(rt2x00dev, TX_DTX_IDX3, 0);
+ rt2x00mmio_register_write(rt2x00dev, TX_CTX_IDX1, 0);
+ rt2x00mmio_register_write(rt2x00dev, TX_DTX_IDX1, 0);

rt2x00mmio_register_write(rt2x00dev, TX_BASE_PTR4, 0);
rt2x00mmio_register_write(rt2x00dev, TX_MAX_CNT4, 0);
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h
@@ -57,6 +57,26 @@ enum data_queue_qid {
};

/**
+ * rt2x00_ac_to_hwq - Convert IEEE80211 queue id to Ralink hardware
+ * queue register index.
+ * @ac: TX queue id.
+ */
+static inline u8 rt2x00_ac_to_hwq(enum data_queue_qid ac)
+{
+ static const u8 ralink_queue_map[] = {
+ [IEEE80211_AC_BE] = 0,
+ [IEEE80211_AC_BK] = 1,
+ [IEEE80211_AC_VI] = 2,
+ [IEEE80211_AC_VO] = 3,
+ };
+
+ if (unlikely(ac >= IEEE80211_NUM_ACS))
+ return ac;
+
+ return ralink_queue_map[ac];
+}
+
+/**
* enum skb_frame_desc_flags: Flags for &struct skb_frame_desc
*
* @SKBDESC_DMA_MAPPED_RX: &skb_dma field has been mapped for RX
Loading

0 comments on commit 482b69f

Please sign in to comment.