Merge Official Source

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen
2024-05-17 17:49:25 +08:00
302 changed files with 17033 additions and 11805 deletions

View File

@@ -228,6 +228,7 @@ menu "Global build settings"
config STRIP_KERNEL_EXPORTS
bool "Strip unnecessary exports from the kernel image"
depends on !LINUX_6_6
help
Reduces kernel size by stripping unused kernel exports from the kernel
image. Note that this might make the kernel incompatible with any kernel

View File

@@ -50,6 +50,11 @@ config KERNEL_ARM_PMU
default y if TARGET_armsr_armv8
depends on (arm || aarch64)
config KERNEL_ARM_PMUV3
bool
default y if TARGET_armsr_armv8
depends on (arm_v7 || aarch64) && LINUX_6_6
config KERNEL_RISCV_PMU
bool
select KERNEL_RISCV_PMU_SBI
@@ -79,6 +84,7 @@ config KERNEL_X86_VSYSCALL_EMULATION
config KERNEL_PERF_EVENTS
bool "Compile the kernel with performance events and counters"
select KERNEL_ARM_PMU if (arm || aarch64)
select KERNEL_ARM_PMUV3 if (arm_v7 || aarch64) && LINUX_6_6
select KERNEL_RISCV_PMU if riscv64
config KERNEL_PROFILING

View File

@@ -1,2 +1,2 @@
LINUX_VERSION-5.15 = .155
LINUX_KERNEL_HASH-5.15.155 = c85859b86d2e6d1fc91ca1be8b44f24a9b5bb9f86869b04a8665a3a6559126e4
LINUX_VERSION-5.15 = .158
LINUX_KERNEL_HASH-5.15.158 = f9071c83a4fd8b80af026b48cfc1869bfa25883f9148b92b5dc1e1e1e26dd5c6

View File

@@ -20,10 +20,7 @@ alfa-network,n5q|\
alfa-network,pi-wifi4|\
alfa-network,r36a|\
alfa-network,tube-2hq|\
allnet,all-wap02860ac|\
araknis,an-300-ap-i-n|\
araknis,an-500-ap-i-ac|\
araknis,an-700-ap-i-ac|\
arduino,yun|\
asus,rt-ac59u|\
asus,rt-ac59u-v2|\
@@ -31,8 +28,6 @@ asus,zenwifi-cd6n|\
asus,zenwifi-cd6r|\
buffalo,bhr-4grv2|\
devolo,magic-2-wifi|\
engenius,eap1200h|\
engenius,eap1750h|\
engenius,eap300-v2|\
engenius,eap350-v1|\
engenius,eap600|\
@@ -42,8 +37,6 @@ engenius,ecb350-v1|\
engenius,ecb600|\
engenius,enh202-v1|\
engenius,ens202ext-v1|\
engenius,enstationac-v1|\
engenius,ews660ap|\
etactica,eg200|\
glinet,gl-ar750s-nor|\
glinet,gl-ar750s-nor-nand|\
@@ -84,7 +77,6 @@ ubnt,powerbridge-m|\
ubnt,rocket-m|\
watchguard,ap100|\
watchguard,ap200|\
watchguard,ap300|\
yuncore,a770|\
yuncore,a782|\
yuncore,a930|\

View File

@@ -32,7 +32,8 @@ zte,mf269)
;;
linksys,mx4200v1|\
linksys,mx4200v2|\
linksys,mx5300)
linksys,mx5300|\
linksys,mx8500)
idx="$(find_mtd_index u_env)"
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000" "2"

View File

@@ -37,6 +37,7 @@ ALLWIFIBOARDS:= \
edimax_cax1800 \
linksys_mx4200 \
linksys_mx5300 \
linksys_mx8500 \
netgear_lbr20 \
netgear_rax120v2 \
netgear_wax214 \
@@ -157,6 +158,7 @@ $(eval $(call generate-ipq-wifi-package,edgecore_eap102,Edgecore EAP102))
$(eval $(call generate-ipq-wifi-package,edimax_cax1800,Edimax CAX1800))
$(eval $(call generate-ipq-wifi-package,linksys_mx4200,Linksys MX4200))
$(eval $(call generate-ipq-wifi-package,linksys_mx5300,Linksys MX5300))
$(eval $(call generate-ipq-wifi-package,linksys_mx8500,Linksys MX8500))
$(eval $(call generate-ipq-wifi-package,netgear_lbr20,Netgear LBR20))
$(eval $(call generate-ipq-wifi-package,netgear_rax120v2,Netgear RAX120v2))
$(eval $(call generate-ipq-wifi-package,netgear_wax214,Netgear WAX214))

View File

@@ -87,6 +87,14 @@ define Package/rtl8723au-firmware/install
endef
$(eval $(call BuildPackage,rtl8723au-firmware))
Package/rtl8723be-firmware = $(call Package/firmware-default,RealTek RTL8723BE firmware,,LICENCE.rtlwifi_firmware.txt)
define Package/rtl8723be-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8723befw_36.bin $(1)/lib/firmware/rtlwifi
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8723befw.bin $(1)/lib/firmware/rtlwifi
endef
$(eval $(call BuildPackage,rtl8723be-firmware))
Package/rtl8723bu-firmware = $(call Package/firmware-default,RealTek RTL8723BU firmware,,LICENCE.rtlwifi_firmware.txt)
define Package/rtl8723bu-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi

View File

@@ -13,7 +13,7 @@
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/gpio.h>
#include <linux/gpio/driver.h>
#include <linux/version.h>
#include <linux/dmi.h>
#include <linux/string.h>

View File

@@ -61,8 +61,6 @@
#define IFXMIPS_FUSE_BASE_ADDR IFX_FUSE_BASE_ADDR
#define IFXMIPS_ICU_IM0_IER IFX_ICU_IM0_IER
#define IFXMIPS_ICU_IM2_IER IFX_ICU_IM2_IER
#define LTQ_MEI_INT IFX_MEI_INT
#define LTQ_MEI_DYING_GASP_INT IFX_MEI_DYING_GASP_INT
#define LTQ_MEI_BASE_ADDR IFX_MEI_SPACE_ACCESS
#define IFXMIPS_PMU_PWDCR IFX_PMU_PWDCR
#define IFXMIPS_MPS_CHIPID IFX_MPS_CHIPID
@@ -86,28 +84,6 @@
#define LTQ_PMU_BASE_ADDR 0x1F102000
#ifdef CONFIG_DANUBE
# define LTQ_MEI_INT (INT_NUM_IM1_IRL0 + 23)
# define LTQ_MEI_DYING_GASP_INT (INT_NUM_IM1_IRL0 + 21)
# define LTQ_USB_OC_INT (INT_NUM_IM4_IRL0 + 23)
#endif
#ifdef CONFIG_AMAZON_SE
# define LTQ_MEI_INT (INT_NUM_IM2_IRL0 + 9)
# define LTQ_MEI_DYING_GASP_INT (INT_NUM_IM2_IRL0 + 11)
# define LTQ_USB_OC_INT (INT_NUM_IM2_IRL0 + 20)
#endif
#ifdef CONFIG_AR9
# define LTQ_MEI_INT (INT_NUM_IM1_IRL0 + 23)
# define LTQ_MEI_DYING_GASP_INT (INT_NUM_IM1_IRL0 + 21)
# define LTQ_USB_OC_INT (INT_NUM_IM1_IRL0 + 28)
#endif
#ifndef LTQ_MEI_INT
#error "Unknown Lantiq ARCH!"
#endif
#define LTQ_RCU_RST_REQ_DFE (1 << 7)
#define LTQ_RCU_RST_REQ_AFE (1 << 11)
@@ -1350,14 +1326,14 @@ IFX_MEI_RunAdslModem (DSL_DEV_Device_t *pDev)
im2_register = (*LTQ_ICU_IM2_IER) & (1 << 20);
/* Turn off irq */
disable_irq (LTQ_USB_OC_INT);
disable_irq (pDev->nIrq[IFX_USB_OC]);
disable_irq (pDev->nIrq[IFX_DYING_GASP]);
IFX_MEI_RunArc (pDev);
MEI_WAIT_EVENT_TIMEOUT (DSL_DEV_PRIVATE(pDev)->wait_queue_modemready, 1000);
MEI_MASK_AND_ACK_IRQ (LTQ_USB_OC_INT);
MEI_MASK_AND_ACK_IRQ (pDev->nIrq[IFX_USB_OC]);
MEI_MASK_AND_ACK_IRQ (pDev->nIrq[IFX_DYING_GASP]);
/* Re-enable irq */
@@ -2304,8 +2280,6 @@ IFX_MEI_InitDevice (int num)
sizeof (smmu_mem_info_t) * MAX_BAR_REGISTERS);
if (num == 0) {
pDev->nIrq[IFX_DFEIR] = LTQ_MEI_INT;
pDev->nIrq[IFX_DYING_GASP] = LTQ_MEI_DYING_GASP_INT;
pDev->base_address = KSEG1 + LTQ_MEI_BASE_ADDR;
/* Power up MEI */
@@ -2759,10 +2733,31 @@ static int ltq_mei_probe(struct platform_device *pdev)
{
int i = 0;
static struct class *dsl_class;
DSL_DEV_Device_t *pDev;
pr_info("IFX MEI Version %ld.%02ld.%02ld\n", bsp_mei_version.major, bsp_mei_version.minor, bsp_mei_version.revision);
for (i = 0; i < BSP_MAX_DEVICES; i++) {
pDev = &dsl_devices[i];
pDev->nIrq[IFX_DFEIR] = platform_get_irq(pdev, 0);
if (pDev->nIrq[IFX_DFEIR] < 0) {
IFX_MEI_EMSG("Failed to get DFEIR irq!\n");
return pDev->nIrq[IFX_DFEIR];
}
pDev->nIrq[IFX_DYING_GASP] = platform_get_irq(pdev, 1);
if (pDev->nIrq[IFX_DYING_GASP] < 0) {
IFX_MEI_EMSG("Failed to get DYING_GASP irq!\n");
return pDev->nIrq[IFX_DYING_GASP];
}
pDev->nIrq[IFX_USB_OC] = platform_get_irq(pdev, 2);
if (pDev->nIrq[IFX_USB_OC] < 0) {
IFX_MEI_EMSG("Failed to get USB_OC irq!\n");
return pDev->nIrq[IFX_USB_OC];
}
if (IFX_MEI_InitDevice (i) != 0) {
IFX_MEI_EMSG("Init device fail!\n");
return -EIO;

View File

@@ -515,9 +515,10 @@ typedef struct DSL_DEV_Device
DSL_int_t nInUse; /* modem state, update by bsp driver, */
DSL_void_t *pPriv;
DSL_uint32_t base_address; /* mei base address */
DSL_int_t nIrq[2]; /* irq number */
DSL_int_t nIrq[3]; /* irq number */
#define IFX_DFEIR 0
#define IFX_DYING_GASP 1
#define IFX_USB_OC 2
DSL_DEV_MeiDebug_t lop_debugwr; /* dying gasp */
struct module *owner;
} DSL_DEV_Device_t; /* ifx_adsl_device_t */

View File

@@ -25,7 +25,7 @@
nErrCode = DSL_DRV_PM_HistoryDelete(pContext, EpData.pHistShowtime );
--- a/src/device/drv_dsl_cpe_device_danube.c
+++ b/src/device/drv_dsl_cpe_device_danube.c
@@ -3193,7 +3193,7 @@ DSL_Error_t DSL_DRV_DEV_AutobootHandleTraining(
@@ -3193,7 +3193,7 @@ DSL_Error_t DSL_DRV_DEV_AutobootHandleTr
DSL_DEV_NUM(pContext)));
}
#endif /* INCLUDE_DSL_DELT*/

View File

@@ -1,6 +1,6 @@
--- a/src/g997/drv_dsl_cpe_api_g997_danube.c
+++ b/src/g997/drv_dsl_cpe_api_g997_danube.c
@@ -1984,41 +1984,53 @@ DSL_Error_t DSL_DRV_DEV_G997_DeltHlogGet(
@@ -1984,41 +1984,53 @@ DSL_Error_t DSL_DRV_DEV_G997_DeltHlogGet
{
if (nDirection == DSL_DOWNSTREAM)
{

View File

@@ -1,6 +1,6 @@
--- a/src/g997/drv_dsl_cpe_api_g997_danube.c
+++ b/src/g997/drv_dsl_cpe_api_g997_danube.c
@@ -2512,6 +2524,7 @@ DSL_Error_t DSL_DRV_DEV_G997_PowerManagementStateForcedTrigger(
@@ -2524,6 +2524,7 @@ DSL_Error_t DSL_DRV_DEV_G997_PowerManage
else
{
/* read L3 request failure reason */
@@ -8,7 +8,7 @@
nErrCode = DSL_DRV_DANUBE_CmvRead(pContext, DSL_CMV_GROUP_STAT,
DSL_CMV_ADDRESS_STAT_L3_FAILURE_REASON, 0, 1, &nVal);
DSL_DEBUG(DSL_DBG_MSG,
@@ -2525,11 +2538,13 @@ DSL_Error_t DSL_DRV_DEV_G997_PowerManagementStateForcedTrigger(
@@ -2537,11 +2538,13 @@ DSL_Error_t DSL_DRV_DEV_G997_PowerManage
nErrCode = DSL_ERR_MSG_EXCHANGE;
break;
}

View File

@@ -0,0 +1,14 @@
--- a/src/common/drv_dsl_cpe_os_linux.c
+++ b/src/common/drv_dsl_cpe_os_linux.c
@@ -556,7 +556,11 @@ static int DSL_DRV_KernelThreadStartup(v
retVal = pThrCntrl->pThrFct(&pThrCntrl->thrParams);
pThrCntrl->thrParams.bRunning = 0;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0))
complete_and_exit(&pThrCntrl->thrCompletion, (long)retVal);
+#else
+ kthread_complete_and_exit(&pThrCntrl->thrCompletion, (long)retVal);
+#endif
DSL_DEBUG( DSL_DBG_MSG,
(DSL_NULL, "EXIT - Kernel Thread Startup <%s>" DSL_DRV_CRLF,

View File

@@ -25,8 +25,6 @@
#define IFXMIPS_ATM_CORE_H
#define INT_NUM_IM2_IRL24 (INT_NUM_IM2_IRL0 + 24)
#define INT_NUM_IM2_IRL13 (INT_NUM_IM2_IRL0 + 13)
#define CONFIG_IFXMIPS_DSL_CPE_MEI
#define IFX_REG_W32(_v, _r) __raw_writel((_v), (volatile unsigned int *)(_r))
#define IFX_REG_R32(_r) __raw_readl((volatile unsigned int *)(_r))
@@ -239,6 +237,8 @@ struct atm_priv_data {
void *oam_buf_base;
void *tx_desc_base;
void *tx_skb_base;
int irq;
};
#include "ifxmips_atm_ppe_common.h"

View File

@@ -111,11 +111,6 @@
#define EMA_ALIGNMENT 4
/*
* Mailbox IGU1 Interrupt
*/
#define PPE_MAILBOX_IGU1_INT INT_NUM_IM2_IRL13
#endif // IFXMIPS_ATM_PPE_AMAZON_SE_H

View File

@@ -178,11 +178,6 @@
#define EMA_ALIGNMENT 4
/*
* Mailbox IGU1 Interrupt
*/
#define PPE_MAILBOX_IGU1_INT INT_NUM_IM2_IRL24
#endif // IFXMIPS_ATM_PPE_AR9_H

View File

@@ -119,11 +119,6 @@
#define EMA_ALIGNMENT 4
/*
* Mailbox IGU1 Interrupt
*/
#define PPE_MAILBOX_IGU1_INT INT_NUM_IM2_IRL24
#endif // IFXMIPS_ATM_PPE_DANUBE_H

View File

@@ -182,11 +182,6 @@
#define PDMA_ALIGNMENT 4
#define EMA_ALIGNMENT PDMA_ALIGNMENT
/*
* Mailbox IGU1 Interrupt
*/
#define PPE_MAILBOX_IGU1_INT INT_NUM_IM2_IRL24
#endif // IFXMIPS_ATM_PPE_VR9_H

View File

@@ -435,7 +435,7 @@ static int ppe_open(struct atm_vcc *vcc)
*MBOX_IGU1_ISRC = (1 << RX_DMA_CH_AAL) | (1 << RX_DMA_CH_OAM);
*MBOX_IGU1_IER = (1 << RX_DMA_CH_AAL) | (1 << RX_DMA_CH_OAM);
enable_irq(PPE_MAILBOX_IGU1_INT);
enable_irq(g_atm_priv_data.irq);
}
/* set port */
@@ -481,7 +481,7 @@ static void ppe_close(struct atm_vcc *vcc)
/* disable irq */
if ( g_atm_priv_data.conn_table == 0 )
disable_irq(PPE_MAILBOX_IGU1_INT);
disable_irq(g_atm_priv_data.irq);
/* release bandwidth */
switch ( vcc->qos.txtp.traffic_class )
@@ -1022,7 +1022,7 @@ static void do_ppe_tasklet(unsigned long data)
else if (*MBOX_IGU1_ISR >> (FIRST_QSB_QID + 16)) /* TX queue */
tasklet_schedule(&g_dma_tasklet);
else
enable_irq(PPE_MAILBOX_IGU1_INT);
enable_irq(g_atm_priv_data.irq);
}
static irqreturn_t mailbox_irq_handler(int irq, void *dev_id)
@@ -1030,7 +1030,7 @@ static irqreturn_t mailbox_irq_handler(int irq, void *dev_id)
if ( !*MBOX_IGU1_ISR )
return IRQ_HANDLED;
disable_irq_nosync(PPE_MAILBOX_IGU1_INT);
disable_irq_nosync(g_atm_priv_data.irq);
tasklet_schedule(&g_dma_tasklet);
return IRQ_HANDLED;
@@ -1805,17 +1805,23 @@ static int ltq_atm_probe(struct platform_device *pdev)
}
}
g_atm_priv_data.irq = platform_get_irq(pdev, 0);
if (g_atm_priv_data.irq < 0) {
pr_err("platform_get_irq fail");
goto REQUEST_IRQ_PPE_MAILBOX_IGU1_INT_FAIL;
}
/* register interrupt handler */
ret = request_irq(PPE_MAILBOX_IGU1_INT, mailbox_irq_handler, 0, "atm_mailbox_isr", &g_atm_priv_data);
ret = request_irq(g_atm_priv_data.irq, mailbox_irq_handler, 0, "atm_mailbox_isr", &g_atm_priv_data);
if ( ret ) {
if ( ret == -EBUSY ) {
pr_err("IRQ may be occupied by other driver, please reconfig to disable it.\n");
} else {
pr_err("request_irq fail irq:%d\n", PPE_MAILBOX_IGU1_INT);
pr_err("request_irq fail irq:%d\n", g_atm_priv_data.irq);
}
goto REQUEST_IRQ_PPE_MAILBOX_IGU1_INT_FAIL;
}
disable_irq(PPE_MAILBOX_IGU1_INT);
disable_irq(g_atm_priv_data.irq);
ret = ops->start(0);
@@ -1845,7 +1851,7 @@ static int ltq_atm_probe(struct platform_device *pdev)
return 0;
PP32_START_FAIL:
free_irq(PPE_MAILBOX_IGU1_INT, &g_atm_priv_data);
free_irq(g_atm_priv_data.irq, &g_atm_priv_data);
REQUEST_IRQ_PPE_MAILBOX_IGU1_INT_FAIL:
ATM_DEV_REGISTER_FAIL:
while ( port_num-- > 0 )
@@ -1868,7 +1874,7 @@ static int ltq_atm_remove(struct platform_device *pdev)
ops->stop(0);
free_irq(PPE_MAILBOX_IGU1_INT, &g_atm_priv_data);
free_irq(g_atm_priv_data.irq, &g_atm_priv_data);
for ( port_num = 0; port_num < ATM_PORT_NUMBER; port_num++ )
atm_dev_deregister(g_atm_priv_data.port[port_num].dev);

View File

@@ -1,6 +1,6 @@
--- a/ifxmips_ptm_adsl.c
+++ b/ifxmips_ptm_adsl.c
@@ -180,7 +180,7 @@ static int proc_read_version(char *, char **, off_t, int, int *, void *);
@@ -180,7 +180,7 @@ static int proc_read_version(char *, cha
static int proc_read_wanmib(char *, char **, off_t, int, int *, void *);
static int proc_write_wanmib(struct file *, const char *, unsigned long, void *);
#endif
@@ -9,7 +9,7 @@
static int proc_read_genconf(char *, char **, off_t, int, int *, void *);
#endif
#if defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC
@@ -191,8 +191,8 @@ static int proc_write_wanmib(struct file *, const char *, unsigned long, void *)
@@ -191,8 +191,8 @@ static int proc_write_wanmib(struct file
/*
* Proc Help Functions
*/
@@ -19,7 +19,7 @@
static INLINE int strincmp(const char *, const char *, int);
#endif
static INLINE int ifx_ptm_version(char *);
@@ -1159,8 +1159,6 @@ static int proc_write_dbg(struct file *file, const char *buf, unsigned long coun
@@ -1159,8 +1159,6 @@ static int proc_write_dbg(struct file *f
return count;
}
@@ -28,7 +28,7 @@
static INLINE int stricmp(const char *p1, const char *p2)
{
int c1, c2;
@@ -1178,7 +1176,6 @@ static INLINE int stricmp(const char *p1, const char *p2)
@@ -1178,7 +1176,6 @@ static INLINE int stricmp(const char *p1
return *p1 - *p2;
}

View File

@@ -277,6 +277,8 @@ static int g_showtime = 0;
static void ptm_setup(struct net_device *dev, int ndev)
{
u8 addr[ETH_ALEN];
#if defined(CONFIG_IFXMIPS_DSL_CPE_MEI) || defined(CONFIG_IFXMIPS_DSL_CPE_MEI_MODULE)
netif_carrier_off(dev);
#endif
@@ -285,15 +287,20 @@ static void ptm_setup(struct net_device *dev, int ndev)
dev->netdev_ops = &g_ptm_netdev_ops;
/* Allow up to 1508 bytes, for RFC4638 */
dev->max_mtu = ETH_DATA_LEN + 8;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,19,0))
netif_napi_add(dev, &g_ptm_priv_data.itf[ndev].napi, ptm_napi_poll, 25);
#else
netif_napi_add_weight(dev, &g_ptm_priv_data.itf[ndev].napi, ptm_napi_poll, 25);
#endif
dev->watchdog_timeo = ETH_WATCHDOG_TIMEOUT;
dev->dev_addr[0] = 0x00;
dev->dev_addr[1] = 0x20;
dev->dev_addr[2] = 0xda;
dev->dev_addr[3] = 0x86;
dev->dev_addr[4] = 0x23;
dev->dev_addr[5] = 0x75 + ndev;
addr[0] = 0x00;
addr[1] = 0x20;
addr[2] = 0xda;
addr[3] = 0x86;
addr[4] = 0x23;
addr[5] = 0x75 + ndev;
eth_hw_addr_set(dev, addr);
}
static struct net_device_stats *ptm_get_stats(struct net_device *dev)
@@ -1484,8 +1491,14 @@ static int ltq_ptm_probe(struct platform_device *pdev)
goto REGISTER_NETDEV_FAIL;
}
g_ptm_priv_data.irq = platform_get_irq(pdev, 0);
if (g_ptm_priv_data.irq < 0) {
err("platform_get_irq fail");
goto REQUEST_IRQ_PPE_MAILBOX_IGU1_INT_FAIL;
}
/* register interrupt handler */
ret = request_irq(PPE_MAILBOX_IGU1_INT, mailbox_irq_handler, 0, "ptm_mailbox_isr", &g_ptm_priv_data);
ret = request_irq(g_ptm_priv_data.irq, mailbox_irq_handler, 0, "ptm_mailbox_isr", &g_ptm_priv_data);
if ( ret ) {
if ( ret == -EBUSY ) {
err("IRQ may be occupied by other driver, please reconfig to disable it.");
@@ -1495,7 +1508,7 @@ static int ltq_ptm_probe(struct platform_device *pdev)
}
goto REQUEST_IRQ_PPE_MAILBOX_IGU1_INT_FAIL;
}
disable_irq(PPE_MAILBOX_IGU1_INT);
disable_irq(g_ptm_priv_data.irq);
ret = ifx_pp32_start(0);
if ( ret ) {
@@ -1505,7 +1518,7 @@ static int ltq_ptm_probe(struct platform_device *pdev)
IFX_REG_W32(0, MBOX_IGU1_IER);
IFX_REG_W32(~0, MBOX_IGU1_ISRC);
enable_irq(PPE_MAILBOX_IGU1_INT);
enable_irq(g_ptm_priv_data.irq);
proc_file_create();
@@ -1527,7 +1540,7 @@ static int ltq_ptm_probe(struct platform_device *pdev)
return 0;
PP32_START_FAIL:
free_irq(PPE_MAILBOX_IGU1_INT, &g_ptm_priv_data);
free_irq(g_ptm_priv_data.irq, &g_ptm_priv_data);
REQUEST_IRQ_PPE_MAILBOX_IGU1_INT_FAIL:
i = ARRAY_SIZE(g_net_dev);
REGISTER_NETDEV_FAIL:
@@ -1565,7 +1578,7 @@ static int ltq_ptm_remove(struct platform_device *pdev)
ifx_pp32_stop(0);
free_irq(PPE_MAILBOX_IGU1_INT, &g_ptm_priv_data);
free_irq(g_ptm_priv_data.irq, &g_ptm_priv_data);
for ( i = 0; i < ARRAY_SIZE(g_net_dev); i++ )
unregister_netdev(g_net_dev[i]);

View File

@@ -35,7 +35,6 @@
#include "ifxmips_ptm_fw_regs_adsl.h"
#define CONFIG_IFXMIPS_DSL_CPE_MEI
#define INT_NUM_IM2_IRL24 (INT_NUM_IM2_IRL0 + 24)
#define IFX_REG_W32(_v, _r) __raw_writel((_v), (volatile unsigned int *)(_r))
#define IFX_REG_R32(_r) __raw_readl((volatile unsigned int *)(_r))
@@ -104,6 +103,7 @@ struct ptm_itf {
struct ptm_priv_data {
struct ptm_itf itf[MAX_ITF_NUMBER];
int irq;
void *rx_desc_base;
void *tx_desc_base;

View File

@@ -176,11 +176,6 @@
#define EMA_ALIGNMENT 4
/*
* Mailbox IGU1 Interrupt
*/
#define PPE_MAILBOX_IGU1_INT INT_NUM_IM2_IRL13
#endif // IFXMIPS_PTM_PPE_AMAZON_SE_H

View File

@@ -203,11 +203,5 @@
#define SW_P2_CTL SW_REG(0x00C)
/*
* Mailbox IGU1 Interrupt
*/
#define PPE_MAILBOX_IGU1_INT INT_NUM_IM2_IRL24
#endif // IFXMIPS_PTM_PPE_AR9_H

View File

@@ -125,11 +125,6 @@
#define EMA_ALIGNMENT 4
/*
* Mailbox IGU1 Interrupt
*/
#define PPE_MAILBOX_IGU1_INT INT_NUM_IM2_IRL24
#endif // IFXMIPS_PTM_PPE_DANUBE_H

View File

@@ -195,11 +195,6 @@
#define PDMA_ALIGNMENT 32 // same as Central DMA because of descriptor swap
#define EMA_ALIGNMENT PDMA_ALIGNMENT
/*
* Mailbox IGU1 Interrupt
*/
#define PPE_MAILBOX_IGU1_INT INT_NUM_IM2_IRL24
#endif // IFXMIPS_PTM_PPE_VR9_H

View File

@@ -153,7 +153,11 @@ static void ptm_setup(struct net_device *dev, int ndev)
dev->netdev_ops = &g_ptm_netdev_ops;
/* Allow up to 1508 bytes, for RFC4638 */
dev->max_mtu = ETH_DATA_LEN + 8;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,19,0))
netif_napi_add(dev, &g_ptm_priv_data.itf[ndev].napi, ptm_napi_poll, 16);
#else
netif_napi_add_weight(dev, &g_ptm_priv_data.itf[ndev].napi, ptm_napi_poll, 16);
#endif
dev->watchdog_timeo = ETH_WATCHDOG_TIMEOUT;
addr[0] = 0x00;
@@ -1009,8 +1013,14 @@ static int ltq_ptm_probe(struct platform_device *pdev)
goto REGISTER_NETDEV_FAIL;
}
g_ptm_priv_data.irq = platform_get_irq(pdev, 0);
if (g_ptm_priv_data.irq < 0) {
err("platform_get_irq fail");
goto REQUEST_IRQ_PPE_MAILBOX_IGU1_INT_FAIL;
}
/* register interrupt handler */
ret = request_irq(PPE_MAILBOX_IGU1_INT, mailbox_irq_handler, 0, "ptm_mailbox_isr", &g_ptm_priv_data);
ret = request_irq(g_ptm_priv_data.irq, mailbox_irq_handler, 0, "ptm_mailbox_isr", &g_ptm_priv_data);
if ( ret ) {
if ( ret == -EBUSY ) {
err("IRQ may be occupied by other driver, please reconfig to disable it.");
@@ -1020,7 +1030,7 @@ static int ltq_ptm_probe(struct platform_device *pdev)
}
goto REQUEST_IRQ_PPE_MAILBOX_IGU1_INT_FAIL;
}
disable_irq(PPE_MAILBOX_IGU1_INT);
disable_irq(g_ptm_priv_data.irq);
ret = ifx_pp32_start(0);
if ( ret ) {
@@ -1030,7 +1040,7 @@ static int ltq_ptm_probe(struct platform_device *pdev)
IFX_REG_W32(1 << 16, MBOX_IGU1_IER); // enable SWAP interrupt
IFX_REG_W32(~0, MBOX_IGU1_ISRC);
enable_irq(PPE_MAILBOX_IGU1_INT);
enable_irq(g_ptm_priv_data.irq);
ifx_mei_atm_showtime_check(&g_showtime, &port_cell, &g_xdata_addr);
if ( g_showtime ) {
@@ -1048,7 +1058,7 @@ static int ltq_ptm_probe(struct platform_device *pdev)
return 0;
PP32_START_FAIL:
free_irq(PPE_MAILBOX_IGU1_INT, &g_ptm_priv_data);
free_irq(g_ptm_priv_data.irq, &g_ptm_priv_data);
REQUEST_IRQ_PPE_MAILBOX_IGU1_INT_FAIL:
i = ARRAY_SIZE(g_net_dev);
REGISTER_NETDEV_FAIL:
@@ -1076,7 +1086,7 @@ static int ltq_ptm_remove(struct platform_device *pdev)
ifx_pp32_stop(0);
free_irq(PPE_MAILBOX_IGU1_INT, &g_ptm_priv_data);
free_irq(g_ptm_priv_data.irq, &g_ptm_priv_data);
for ( i = 0; i < ARRAY_SIZE(g_net_dev); i++ )
unregister_netdev(g_net_dev[i]);

View File

@@ -31,8 +31,6 @@
#include "ifxmips_ptm_ppe_common.h"
#include "ifxmips_ptm_fw_regs_vdsl.h"
#define INT_NUM_IM2_IRL24 (INT_NUM_IM2_IRL0 + 24)
#define IFX_REG_W32(_v, _r) __raw_writel((_v), (volatile unsigned int *)(_r))
#define IFX_REG_R32(_r) __raw_readl((volatile unsigned int *)(_r))
#define IFX_REG_W32_MASK(_clr, _set, _r) IFX_REG_W32((IFX_REG_R32((_r)) & ~(_clr)) | (_set), (_r))
@@ -99,6 +97,7 @@ struct ptm_itf {
struct ptm_priv_data {
struct ptm_itf itf[MAX_ITF_NUMBER];
int irq;
};

View File

@@ -9,7 +9,7 @@
#endif
/* add MEI CPE debug/printout part */
@@ -1718,8 +1718,8 @@ static void MEI_MeminfoProcPerDevGet(struct seq_file *s)
@@ -1718,8 +1718,8 @@ static void MEI_MeminfoProcPerDevGet(str
", CRC = 0x%08X"
#endif
MEI_DRV_CRLF,
@@ -22,7 +22,7 @@
#if (MEI_SUPPORT_OPTIMIZED_FW_DL == 1)
--- a/src/drv_mei_cpe_download_vrx.c
+++ b/src/drv_mei_cpe_download_vrx.c
@@ -3139,9 +3139,9 @@ IFX_int32_t MEI_DEV_IoctlFirmwareDownload(
@@ -3139,9 +3139,9 @@ IFX_int32_t MEI_DEV_IoctlFirmwareDownloa
{
IFX_int32_t ret = 0;
MEI_DEV_T *pMeiDev = pMeiDynCntrl->pMeiDev;

View File

@@ -0,0 +1,28 @@
--- a/src/drv_mei_cpe_linux.c
+++ b/src/drv_mei_cpe_linux.c
@@ -1873,7 +1873,11 @@ static int mei_seq_single_show(struct se
static int mei_proc_single_open(struct inode *inode, struct file *file)
{
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0))
return single_open(file, mei_seq_single_show, PDE_DATA(inode));
+#else
+ return single_open(file, mei_seq_single_show, pde_data(inode));
+#endif
}
static void mei_proc_entry_create(struct proc_dir_entry *parent_node,
--- a/src/drv_mei_cpe_linux_proc_config.c
+++ b/src/drv_mei_cpe_linux_proc_config.c
@@ -1036,7 +1036,11 @@ static int mei_seq_single_show(struct se
static int mei_proc_single_open(struct inode *inode, struct file *file)
{
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0))
return single_open(file, mei_seq_single_show, PDE_DATA(inode));
+#else
+ return single_open(file, mei_seq_single_show, pde_data(inode));
+#endif
}
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0))

View File

@@ -0,0 +1,15 @@
--- a/src/drv_mei_cpe_msg_process.c
+++ b/src/drv_mei_cpe_msg_process.c
@@ -3524,7 +3524,12 @@ IFX_int32_t MEI_IoctlCmdMsgWrite(
{
if (bInternCall)
{
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,19,0))
memcpy(pDestPtr, pUserMsg->pPayload, pUserMsg->paylSize_byte);
+#else
+ unsafe_memcpy(pDestPtr, pUserMsg->pPayload, pUserMsg->paylSize_byte,
+ /* field-spanning writing is used here intentionally */);
+#endif
}
else
{

View File

@@ -0,0 +1,20 @@
--- a/src/drv_vmmc_api.h
+++ b/src/drv_vmmc_api.h
@@ -149,17 +149,6 @@ DECLARE_TRACE_GROUP(VMMC);
return code; \
}while(0)
-/*******************************************************************************
-Description:
- always returns the absolute value of argument given
-Arguments:
- x - argument
-Return:
- absolute value of x
-*******************************************************************************/
-/* define ABS */
-#define ABS(x) (((x) < 0) ? -(x) : (x))
-
/* regular format macros */
/*******************************************************************************
Description:

View File

@@ -0,0 +1,37 @@
--- a/src/drv_vmmc_init.c
+++ b/src/drv_vmmc_init.c
@@ -202,11 +202,20 @@ IFX_int32_t VMMC_GetDevice (IFX_uint16_t
/**
Wrapper for the voice buffer get function that sets the FW as owner.
*/
-static IFX_void_t* vmmc_WrapperVoiceBufferGet (IFX_void_t)
+static IFX_void_t* vmmc_WrapperVoiceBufferGet (IFX_size_t size,
+ IFX_int32_t priority)
{
return IFX_TAPI_VoiceBufferGetWithOwnerId (IFX_TAPI_BUFFER_OWNER_FW);
}
+/**
+ Wrapper for the voice buffer get function that sets the FW as owner.
+*/
+static IFX_void_t vmmc_WrapperVoiceBufferPut (const IFX_void_t *ptr)
+{
+ IFX_TAPI_VoiceBufferPut ((IFX_void_t *)ptr);
+}
+
/**
Wrapper for the voice buffer free all function freeing all buffers that
@@ -263,10 +272,8 @@ IFX_int32_t VMMC_ChipAccessInit(VMMC_DEV
/* Register the buffer handler. */
#ifdef USE_BUFFERPOOL
- ifx_mps_bufman_register((IFX_void_t* (*)(IFX_size_t, IFX_int32_t))
- vmmc_WrapperVoiceBufferGet,
- (IFX_void_t (*)(const IFX_void_t*))
- IFX_TAPI_VoiceBufferPut,
+ ifx_mps_bufman_register(vmmc_WrapperVoiceBufferGet,
+ vmmc_WrapperVoiceBufferPut,
sizeof(PACKET), POBX_BUFFER_THRESHOLD);
ifx_mps_register_bufman_freeall_callback (vmmc_WrapperVoiceBufferFreeAll);
#else

View File

@@ -0,0 +1,66 @@
--- a/src/drv_vmmc_fw_commands.h
+++ b/src/drv_vmmc_fw_commands.h
@@ -4628,26 +4628,28 @@ struct RES_DTMFATG_COEF
struct CDM_RES_DTMFATG_DATA
{
CMD_HEAD_BE;
- /** Frequency 1 1st Tone or Dual Tone Control Word 1 */
- IFX_uint16_t FREQ11_DTC1;
- /** Frequency 2 1st Tone or Dual Tone Control Word 2 */
- IFX_uint16_t FREQ21_DTC2;
- /** Frequency 1 2nd Tone */
- IFX_uint16_t FREQ12_DTC3;
- /** Frequency 2 2nd Tone */
- IFX_uint16_t FREQ22_DTC4;
- /** Frequency 1 3rd Tone */
- IFX_uint16_t FREQ13_DTC5;
- /** Frequency 2 3nd Tone */
- IFX_uint16_t FREQ23_DTC6;
- /** Frequency 1 4th Tone */
- IFX_uint16_t FREQ14_DTC7;
- /** Frequency 2 4th Tone */
- IFX_uint16_t FREQ24_DTC8;
- /** Frequency 1 5th Tone */
- IFX_uint16_t FREQ15_DTC9;
- /** Frequency 2 5th Tone */
- IFX_uint16_t FREQ25_DTC10;
+ struct_group(FREQS,
+ /** Frequency 1 1st Tone or Dual Tone Control Word 1 */
+ IFX_uint16_t FREQ11_DTC1;
+ /** Frequency 2 1st Tone or Dual Tone Control Word 2 */
+ IFX_uint16_t FREQ21_DTC2;
+ /** Frequency 1 2nd Tone */
+ IFX_uint16_t FREQ12_DTC3;
+ /** Frequency 2 2nd Tone */
+ IFX_uint16_t FREQ22_DTC4;
+ /** Frequency 1 3rd Tone */
+ IFX_uint16_t FREQ13_DTC5;
+ /** Frequency 2 3nd Tone */
+ IFX_uint16_t FREQ23_DTC6;
+ /** Frequency 1 4th Tone */
+ IFX_uint16_t FREQ14_DTC7;
+ /** Frequency 2 4th Tone */
+ IFX_uint16_t FREQ24_DTC8;
+ /** Frequency 1 5th Tone */
+ IFX_uint16_t FREQ15_DTC9;
+ /** Frequency 2 5th Tone */
+ IFX_uint16_t FREQ25_DTC10;
+ );
} __PACKED__ ;
--- a/src/drv_vmmc_sig_dtmfg.c
+++ b/src/drv_vmmc_sig_dtmfg.c
@@ -742,10 +742,8 @@ IFX_int32_t irq_VMMC_SIG_DtmfOnRequest(V
/* Get a pointer to the data area which is behind the header of the cmd */
pAtgCmd = &pDtmfAtgData->FREQ11_DTC1;
- /* Wipe the data area in the command. The size of this area is
- command size - header size. */
- /*lint -e(419) */
- memset (pAtgCmd, 0x00, sizeof(CDM_RES_DTMFATG_DATA_t) - CMD_HDR_CNT);
+ /* Wipe the data area in the command. */
+ memset (&pDtmfAtgData->FREQS, 0x00, sizeof(pDtmfAtgData->FREQS));
/* Fill the data area */
if (pDtmf->bByteMode == IFX_TRUE)

View File

@@ -0,0 +1,89 @@
--- a/src/mps/drv_mps_vmmc_linux.c
+++ b/src/mps/drv_mps_vmmc_linux.c
@@ -104,6 +104,10 @@ extern irqreturn_t ifx_mps_vc_irq (IFX_i
extern IFX_void_t ifx_mps_shutdown (IFX_void_t);
extern IFX_int32_t ifx_mps_event_activation_poll (mps_devices type,
MbxEventRegs_s * act);
+extern unsigned int ltq_get_mps_ad0_irq(void);
+extern unsigned int ltq_get_mps_ad1_irq(void);
+extern unsigned int ltq_get_mps_vc_irq(int idx);
+
mps_mbx_dev *ifx_mps_get_device (mps_devices type);
#ifdef CONFIG_PROC_FS
@@ -2260,7 +2264,7 @@ IFX_int32_t __init ifx_mps_init_module (
/* reset the device before initializing the device driver */
ifx_mps_reset ();
- result = request_irq (INT_NUM_IM4_IRL18,
+ result = request_irq (ltq_get_mps_ad0_irq(),
#ifdef LINUX_2_6
ifx_mps_ad0_irq, 0x0
#else /* */
@@ -2270,7 +2274,7 @@ IFX_int32_t __init ifx_mps_init_module (
, "mps_mbx ad0", &ifx_mps_dev);
if (result)
return result;
- result = request_irq (INT_NUM_IM4_IRL19,
+ result = request_irq (ltq_get_mps_ad1_irq(),
#ifdef LINUX_2_6
ifx_mps_ad1_irq, 0x0
#else /* */
@@ -2285,7 +2289,7 @@ IFX_int32_t __init ifx_mps_init_module (
for (i = 0; i < 4; ++i)
{
sprintf (&voice_channel_int_name[i][0], "mps_mbx vc%d", i);
- result = request_irq (INT_NUM_IM4_IRL14 + i,
+ result = request_irq (ltq_get_mps_vc_irq(i),
#ifdef LINUX_2_6
ifx_mps_vc_irq, 0x0
#else /* */
@@ -2446,13 +2450,13 @@ ifx_mps_cleanup_module (IFX_void_t)
ifx_mps_release_structures (&ifx_mps_dev);
/* release all interrupts at the system */
- free_irq (INT_NUM_IM4_IRL18, &ifx_mps_dev);
- free_irq (INT_NUM_IM4_IRL19, &ifx_mps_dev);
+ free_irq (ltq_get_mps_ad0_irq(), &ifx_mps_dev);
+ free_irq (ltq_get_mps_ad1_irq(), &ifx_mps_dev);
/* register status interrupts for voice channels */
for (i = 0; i < 4; ++i)
{
- free_irq (INT_NUM_IM4_IRL14 + i, &ifx_mps_dev);
+ free_irq (ltq_get_mps_vc_irq(i), &ifx_mps_dev);
}
#ifdef CONFIG_PROC_FS
#if CONFIG_MPS_HISTORY_SIZE > 0
--- a/src/mps/drv_mps_vmmc_common.c
+++ b/src/mps/drv_mps_vmmc_common.c
@@ -134,6 +134,8 @@ extern IFX_void_t mask_and_ack_danube_ir
#endif /* */
+extern unsigned int ltq_get_mps_vc_irq(int idx);
+
extern void sys_hw_setup (void);
extern IFXOS_event_t fw_ready_evt;
@@ -2979,7 +2981,7 @@ irqreturn_t ifx_mps_ad1_irq (IFX_int32_t
*/
irqreturn_t ifx_mps_vc_irq (IFX_int32_t irq, mps_comm_dev * pDev)
{
- IFX_uint32_t chan = irq - INT_NUM_IM4_IRL14;
+ IFX_uint32_t chan = irq - ltq_get_mps_vc_irq(0);
mps_mbx_dev *mbx_dev = (mps_mbx_dev *) & (pMPSDev->voice_mb[chan]);
MPS_VCStatReg_u MPS_VCStatusReg;
MbxEventRegs_s events;
--- a/src/mps/drv_mps_vmmc_device.h
+++ b/src/mps/drv_mps_vmmc_device.h
@@ -69,9 +69,6 @@
# define IFX_MPS_CVC3SR IFXMIPS_MPS_CVC3SR
# define IFX_MPS_SAD0SR IFXMIPS_MPS_SAD0SR
/* interrupt vectors */
-# define INT_NUM_IM4_IRL14 (INT_NUM_IM4_IRL0 + 14)
-# define INT_NUM_IM4_IRL18 (INT_NUM_IM4_IRL0 + 18)
-# define INT_NUM_IM4_IRL19 (INT_NUM_IM4_IRL0 + 19)
# define IFX_ICU_IM4_IER IFXMIPS_ICU_IM4_IER
/* ============================= */

View File

@@ -1,6 +1,6 @@
PKG_DRIVERS += \
rtlwifi rtlwifi-pci rtlwifi-btcoexist rtlwifi-usb rtl8192c-common \
rtl8192ce rtl8192se rtl8192de rtl8192cu rtl8723bs rtl8821ae \
rtl8192ce rtl8192se rtl8192de rtl8192cu rtl8723-common rtl8723be rtl8723bs rtl8821ae \
rtl8xxxu rtw88 rtw88-pci rtw88-usb rtw88-8821c rtw88-8822b rtw88-8822c \
rtw88-8723d rtw88-8821ce rtw88-8821cu rtw88-8822be rtw88-8822bu \
rtw88-8822ce rtw88-8822cu rtw88-8723de
@@ -20,6 +20,9 @@ config-$(CONFIG_PACKAGE_RTLWIFI_DEBUG) += RTLWIFI_DEBUG
config-$(call config_package,rtl8xxxu) += RTL8XXXU
config-y += RTL8XXXU_UNTESTED
config-$(call config_package,rtl8723-common) += RTL8723_COMMON
config-$(call config_package,rtl8723be) += RTL8723BE
config-$(call config_package,rtl8723bs) += RTL8723BS
config-y += STAGING
@@ -299,6 +302,22 @@ define KernelPackage/rtw88-8723de
AUTOLOAD:=$(call AutoProbe,rtw88_8723)
endef
define KernelPackage/rtl8723-common
$(call KernelPackage/mac80211/Default)
TITLE:=Realtek RTL8723AE/RTL8723BE common support module
DEPENDS+= +kmod-rtlwifi
FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtlwifi/rtl8723com/rtl8723-common.ko
HIDDEN:=1
endef
define KernelPackage/rtl8723be
$(call KernelPackage/mac80211/Default)
TITLE:=Realtek RTL8723AE/RTL8723BE support
DEPENDS+= +kmod-rtlwifi-btcoexist +kmod-rtlwifi-pci +kmod-rtl8723-common +rtl8723be-firmware
FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtlwifi/rtl8723be/rtl8723be.ko
AUTOLOAD:=$(call AutoProbe,rtl8723be)
endef
define KernelPackage/rtl8723bs
$(call KernelPackage/mac80211/Default)
TITLE:=Realtek RTL8723BS SDIO Wireless LAN NIC driver (staging)

View File

@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=qca-ssdk
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/qca-ssdk.git
PKG_SOURCE_PROTO:=git
@@ -45,6 +45,7 @@ MAKE_FLAGS+= \
GCC_VERSION=$(GCC_VERSION) \
EXTRA_CFLAGS="-fno-stack-protector -I$(STAGING_DIR)/usr/include" \
SoC=$(CONFIG_TARGET_SUBTARGET) \
SHELL="$(BASH)" \
PTP_FEATURE=disable SWCONFIG_FEATURE=disable \
ISISC_ENABLE=disable IN_QCA803X_PHY=FALSE \
IN_QCA808X_PHY=FALSE IN_MALIBU_PHY=FALSE \

View File

@@ -0,0 +1,33 @@
From ab3b663842f66d0ed290696cee9edb9070a36e8f Mon Sep 17 00:00:00 2001
From: Paweł Owoc <frut3k7@gmail.com>
Date: Wed, 7 May 2024 10:37:44 +0100
Subject: [PATCH] hsl_phy: add support for AQR114C-B0 PHY
Add support for AQR114C-B0 PHY.
Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
---
include/hsl/phy/hsl_phy.h | 1 +
src/hsl/phy/hsl_phy.c | 1 +
2 files changed, 2 insertions(+)
--- a/include/hsl/phy/hsl_phy.h
+++ b/include/hsl/phy/hsl_phy.h
@@ -612,6 +612,7 @@ typedef struct {
#define AQUANTIA_PHY_113C_B0 0x31c31C12
#define AQUANTIA_PHY_113C_B1 0x31c31C13
#define AQUANTIA_PHY_112C 0x03a1b792
+#define AQUANTIA_PHY_114C_B0 0x31c31c22
#define MVL_PHY_X3410 0x31c31DD3
#define PHY_805XV2 0x004DD082
--- a/src/hsl/phy/hsl_phy.c
+++ b/src/hsl/phy/hsl_phy.c
@@ -271,6 +271,7 @@ phy_type_t hsl_phytype_get_by_phyid(a_uint32_t dev_id, a_uint32_t phy_id)
case AQUANTIA_PHY_113C_B0:
case AQUANTIA_PHY_113C_B1:
case AQUANTIA_PHY_112C:
+ case AQUANTIA_PHY_114C_B0:
case MVL_PHY_X3410:
phytype = AQUANTIA_PHY_CHIP;
break;

View File

@@ -9,7 +9,6 @@
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/version.h>
/**
* Driver for the Ubiquiti RGB LED controller (LEDBAR).
@@ -167,9 +166,7 @@ static int ubnt_ledbar_init_led(struct device_node *np, struct ubnt_ledbar *ledb
return ret;
}
static int ubnt_ledbar_probe(struct i2c_client *client,
const struct i2c_device_id *id)
static int ubnt_ledbar_probe(struct i2c_client *client)
{
struct device_node *np = client->dev.of_node;
struct ubnt_ledbar *ledbar;
@@ -219,19 +216,11 @@ static int ubnt_ledbar_probe(struct i2c_client *client,
return ubnt_ledbar_apply_state(ledbar);
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
static int ubnt_ledbar_remove(struct i2c_client *client)
#else
static void ubnt_ledbar_remove(struct i2c_client *client)
#endif
{
struct ubnt_ledbar *ledbar = i2c_get_clientdata(client);
mutex_destroy(&ledbar->lock);
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
return 0;
#endif
}
static const struct i2c_device_id ubnt_ledbar_id[] = {

View File

@@ -29,6 +29,7 @@
#include <endian.h>
#include <string.h>
#include <errno.h>
#include <netinet/in.h>
#include <sys/ioctl.h>
#include <mtd/mtd-user.h>
@@ -165,7 +166,7 @@ mtd_fixtrx(const char *mtd, size_t offset, size_t data_size)
size_t block_offset;
if (quiet < 2)
fprintf(stderr, "Trying to fix trx header in %s at 0x%x...\n", mtd, offset);
fprintf(stderr, "Trying to fix trx header in %s at 0x%zx...\n", mtd, offset);
fd = mtd_check_open(mtd);
if(fd < 0) {
@@ -246,7 +247,7 @@ mtd_fixtrx(const char *mtd, size_t offset, size_t data_size)
trx->crc32 = STORE32_LE(crc32buf(buf, data_size));
if (mtd_erase_block(fd, block_offset)) {
fprintf(stderr, "Can't erease block at 0x%x (%s)\n", block_offset, strerror(errno));
fprintf(stderr, "Can't erease block at 0x%zx (%s)\n", block_offset, strerror(errno));
exit(1);
}

View File

@@ -1,6 +1,6 @@
#!/bin/sh
[ -f /etc/opkg.conf ] && grep -q "src\/" /etc/opkg.conf || exit 0
[ -f /etc/opkg.conf ] && grep -q "src/" /etc/opkg.conf || exit 0
echo -e "# Old feeds from previous image\n# Uncomment to reenable\n" >> /etc/opkg/customfeeds.conf
sed -n "s/.*\(src\/.*\)/# \1/p" /etc/opkg.conf >> /etc/opkg/customfeeds.conf

View File

@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=audit-userspace
PKG_VERSION:=3.1.4
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/linux-audit/audit-userspace/archive/refs/tags/v$(PKG_VERSION).tar.gz?
PKG_HASH:=aec501760acd13ebbe00e78b9b59f795d16a430b1d673628e346cd18905c594b

View File

@@ -0,0 +1,615 @@
From 429d031edd52566eeba03c3b3af32ad6e103fd94 Mon Sep 17 00:00:00 2001
From: Steve Grubb <ausearch.1@gmail.com>
Date: Fri, 3 May 2024 17:33:39 -0400
Subject: [PATCH] Implicit builtin functions
Correct a number of places where printf is being used without a prototype.
All cases are in libraries which should not be using printf. Change them
to return an error rather than communicate the problem.
This is a backport of 8c7eaa7
---
audisp/audispd-llist.c | 10 +++++-----
audisp/audispd-llist.h | 4 ++--
auparse/normalize-llist.c | 12 ++++++------
auparse/normalize-llist.h | 4 ++--
auparse/normalize.c | 14 +++++++++-----
src/auditctl-llist.c | 18 +++++++++---------
src/auditctl-llist.h | 4 ++--
src/ausearch-avc.c | 16 ++++++++--------
src/ausearch-avc.h | 4 ++--
src/ausearch-int.c | 12 ++++++------
src/ausearch-int.h | 4 ++--
src/ausearch-llist.c | 14 +++++++-------
src/ausearch-llist.h | 2 +-
src/ausearch-nvpair.c | 12 ++++++------
src/ausearch-nvpair.h | 4 ++--
src/ausearch-string.c | 10 +++++-----
src/ausearch-string.h | 2 +-
tools/aulastlog/aulastlog-llist.c | 18 +++++++++---------
tools/aulastlog/aulastlog-llist.h | 4 ++--
19 files changed, 86 insertions(+), 82 deletions(-)
--- a/audisp/audispd-llist.c
+++ b/audisp/audispd-llist.c
@@ -69,15 +69,13 @@ unsigned int plist_count_active(const co
return cnt;
}
-void plist_append(conf_llist *l, plugin_conf_t *p)
+int plist_append(conf_llist *l, plugin_conf_t *p)
{
lnode* newnode;
newnode = malloc(sizeof(lnode));
- if (newnode == NULL) {
- printf("Out of memory. Check %s file, %d line", __FILE__, __LINE__);
- return;
- }
+ if (newnode == NULL)
+ return 1;
if (p) {
void *pp = malloc(sizeof(struct plugin_conf));
@@ -98,6 +96,8 @@ void plist_append(conf_llist *l, plugin_
// make newnode current
l->cur = newnode;
l->cnt++;
+
+ return 0;
}
void plist_clear(conf_llist* l)
--- a/audisp/audispd-llist.h
+++ b/audisp/audispd-llist.h
@@ -1,6 +1,6 @@
/*
* audispd-llist.h - Header file for ausearch-conf_llist.c
-* Copyright (c) 2007,2013 Red Hat Inc., Durham, North Carolina.
+* Copyright (c) 2007,2013 Red Hat Inc.
* All Rights Reserved.
*
* This software may be freely redistributed and/or modified under the
@@ -51,7 +51,7 @@ unsigned int plist_count_active(const co
void plist_last(conf_llist *l);
lnode *plist_next(conf_llist *l);
static inline lnode *plist_get_cur(conf_llist *l) { return l->cur; }
-void plist_append(conf_llist *l, plugin_conf_t *p);
+int plist_append(conf_llist *l, plugin_conf_t *p);
void plist_clear(conf_llist* l);
void plist_mark_all_unchecked(conf_llist* l);
lnode *plist_find_unchecked(conf_llist* l);
--- a/auparse/normalize-llist.c
+++ b/auparse/normalize-llist.c
@@ -1,6 +1,6 @@
/*
* normalize-llist.c - Minimal linked list library
- * Copyright (c) 2016-17 Red Hat Inc., Durham, North Carolina.
+ * Copyright (c) 2016-17 Red Hat Inc.
* All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
@@ -61,15 +61,14 @@ data_node *cllist_next(cllist *l)
return l->cur;
}
-void cllist_append(cllist *l, uint32_t num, void *data)
+// Returns 0 on success and 1 on error
+int cllist_append(cllist *l, uint32_t num, void *data)
{
data_node *newnode;
newnode = malloc(sizeof(data_node));
- if (newnode == NULL) {
- printf("Out of memory. Check %s file, %d line", __FILE__, __LINE__);
- return;
- }
+ if (newnode == NULL)
+ return 1;
newnode->num = num;
newnode->data = data;
@@ -84,5 +83,6 @@ void cllist_append(cllist *l, uint32_t n
// make newnode current
l->cur = newnode;
l->cnt++;
+ return 0;
}
--- a/auparse/normalize-llist.h
+++ b/auparse/normalize-llist.h
@@ -1,6 +1,6 @@
/*
* normalize-llist.h - Header file for normalize-llist.c
- * Copyright (c) 2016-17 Red Hat Inc., Durham, North Carolina.
+ * Copyright (c) 2016-17 Red Hat Inc.
* All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
@@ -53,7 +53,7 @@ AUDIT_HIDDEN_START
void cllist_create(cllist *l, void (*cleanup)(void *));
void cllist_clear(cllist* l);
data_node *cllist_next(cllist *l);
-void cllist_append(cllist *l, uint32_t num, void *data);
+int cllist_append(cllist *l, uint32_t num, void *data);
AUDIT_HIDDEN_END
--- a/auparse/normalize.c
+++ b/auparse/normalize.c
@@ -179,7 +179,8 @@ static unsigned int add_subj_attr(aupars
if ((auparse_find_field(au, str))) {
attr = set_record(0, rnum);
attr = set_field(attr, auparse_get_field_num(au));
- cllist_append(&D.actor.attr, attr, NULL);
+ if (cllist_append(&D.actor.attr, attr, NULL))
+ return 1;
return 0;
} else
auparse_goto_record_num(au, rnum);
@@ -224,7 +225,8 @@ static unsigned int add_obj_attr(auparse
if ((auparse_find_field(au, str))) {
attr = set_record(0, rnum);
attr = set_field(attr, auparse_get_field_num(au));
- cllist_append(&D.thing.attr, attr, NULL);
+ if (cllist_append(&D.thing.attr, attr, NULL))
+ return 1;
return 0;
} else
auparse_goto_record_num(au, rnum);
@@ -360,21 +362,23 @@ static void collect_id_obj2(auparse_stat
}
}
-static void collect_path_attrs(auparse_state_t *au)
+static int collect_path_attrs(auparse_state_t *au)
{
value_t attr;
unsigned int rnum = auparse_get_record_num(au);
auparse_first_field(au);
if (add_obj_attr(au, "mode", rnum))
- return; // Failed opens don't have anything else
+ return 1; // Failed opens don't have anything else
// All the rest of the fields matter
while ((auparse_next_field(au))) {
attr = set_record(0, rnum);
attr = set_field(attr, auparse_get_field_num(au));
- cllist_append(&D.thing.attr, attr, NULL);
+ if (cllist_append(&D.thing.attr, attr, NULL))
+ return 1;
}
+ return 0;
}
static void collect_cwd_attrs(auparse_state_t *au)
--- a/src/auditctl-llist.c
+++ b/src/auditctl-llist.c
@@ -1,7 +1,7 @@
/*
* ausearch-llist.c - Minimal linked list library
-* Copyright (c) 2005 Red Hat Inc., Durham, North Carolina.
-* All Rights Reserved.
+* Copyright (c) 2005 Red Hat Inc.
+* All Rights Reserved.
*
* This software may be freely redistributed and/or modified under the
* terms of the GNU General Public License as published by the Free
@@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor
+* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1335, USA.
*
* Authors:
@@ -59,19 +59,17 @@ lnode *list_next(llist *l)
return l->cur;
}
-void list_append(llist *l, struct audit_rule_data *r, size_t sz)
+int list_append(llist *l, struct audit_rule_data *r, size_t sz)
{
lnode* newnode;
newnode = malloc(sizeof(lnode));
- if (newnode == NULL) {
- printf("Out of memory. Check %s file, %d line", __FILE__, __LINE__);
- return;
- }
+ if (newnode == NULL)
+ return 1;
if (r) {
void *rr = malloc(sz);
- if (rr)
+ if (rr)
memcpy(rr, r, sz);
newnode->r = rr;
} else
@@ -89,6 +87,8 @@ void list_append(llist *l, struct audit_
// make newnode current
l->cur = newnode;
l->cnt++;
+
+ return 0;
}
void list_clear(llist* l)
--- a/src/auditctl-llist.h
+++ b/src/auditctl-llist.h
@@ -1,6 +1,6 @@
/*
* auditctl-llist.h - Header file for ausearch-llist.c
-* Copyright (c) 2005 Red Hat Inc., Durham, North Carolina.
+* Copyright (c) 2005 Red Hat Inc.
* All Rights Reserved.
*
* This software may be freely redistributed and/or modified under the
@@ -50,7 +50,7 @@ void list_first(llist *l);
void list_last(llist *l);
lnode *list_next(llist *l);
static inline lnode *list_get_cur(llist *l) { return l->cur; }
-void list_append(llist *l, struct audit_rule_data *r, size_t sz);
+int list_append(llist *l, struct audit_rule_data *r, size_t sz);
void list_clear(llist* l);
#endif
--- a/src/ausearch-avc.c
+++ b/src/ausearch-avc.c
@@ -1,7 +1,7 @@
/*
* ausearch-avc.c - Minimal linked list library for avcs
-* Copyright (c) 2006,2008,2014 Red Hat Inc., Durham, North Carolina.
-* All Rights Reserved.
+* Copyright (c) 2006,2008,2014 Red Hat Inc.
+* All Rights Reserved.
*
* This software may be freely redistributed and/or modified under the
* terms of the GNU General Public License as published by the Free
@@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor
+* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1335, USA.
*
* Authors:
@@ -62,15 +62,13 @@ static void alist_last(alist *l)
l->cur = cur;
}
-void alist_append(alist *l, anode *node)
+int alist_append(alist *l, anode *node)
{
anode* newnode;
newnode = malloc(sizeof(anode));
- if (newnode == NULL) {
- printf("Out of memory. Check %s file, %d line", __FILE__, __LINE__);
- return;
- }
+ if (newnode == NULL)
+ return 1;
if (node->scontext)
newnode->scontext = node->scontext;
@@ -108,6 +106,8 @@ void alist_append(alist *l, anode *node)
// make newnode current
l->cur = newnode;
l->cnt++;
+
+ return 0;
}
int alist_find_subj(alist *l)
--- a/src/ausearch-avc.h
+++ b/src/ausearch-avc.h
@@ -1,6 +1,6 @@
/*
* ausearch-avc.h - Header file for ausearch-string.c
-* Copyright (c) 2006,2008 Red Hat Inc., Durham, North Carolina.
+* Copyright (c) 2006,2008 Red Hat Inc.
* All Rights Reserved.
*
* This software may be freely redistributed and/or modified under the
@@ -54,7 +54,7 @@ void alist_create(alist *l);
static inline void alist_first(alist *l) { l->cur = l->head; }
anode *alist_next(alist *l);
static inline anode *alist_get_cur(alist *l) { return l->cur; }
-void alist_append(alist *l, anode *node);
+int alist_append(alist *l, anode *node);
void anode_init(anode *an);
void anode_clear(anode *an);
void alist_clear(alist* l);
--- a/src/ausearch-int.c
+++ b/src/ausearch-int.c
@@ -1,6 +1,6 @@
/*
* ausearch-int.c - Minimal linked list library for integers
-* Copyright (c) 2005,2008 Red Hat Inc., Durham, North Carolina.
+* Copyright (c) 2005,2008 Red Hat Inc.
* All Rights Reserved.
*
* This software may be freely redistributed and/or modified under the
@@ -41,15 +41,13 @@ int_node *ilist_next(ilist *l)
return l->cur;
}
-void ilist_append(ilist *l, int num, unsigned int hits, int aux)
+int ilist_append(ilist *l, int num, unsigned int hits, int aux)
{
int_node* newnode;
newnode = malloc(sizeof(int_node));
- if (newnode == NULL) {
- printf("Out of memory. Check %s file, %d line", __FILE__, __LINE__);
- return;
- }
+ if (newnode == NULL)
+ return 1;
newnode->num = num;
newnode->hits = hits;
@@ -65,6 +63,8 @@ void ilist_append(ilist *l, int num, uns
// make newnode current
l->cur = newnode;
l->cnt++;
+
+ return 0;
}
void ilist_clear(ilist* l)
--- a/src/ausearch-int.h
+++ b/src/ausearch-int.h
@@ -1,6 +1,6 @@
/*
* ausearch-int.h - Header file for ausearch-int.c
-* Copyright (c) 2005,2008 Red Hat Inc., Durham, North Carolina.
+* Copyright (c) 2005,2008 Red Hat Inc.
* All Rights Reserved.
*
* This software may be freely redistributed and/or modified under the
@@ -48,7 +48,7 @@ void ilist_create(ilist *l);
static inline void ilist_first(ilist *l) { l->cur = l->head; }
int_node *ilist_next(ilist *l);
static inline int_node *ilist_get_cur(ilist *l) { return l->cur; }
-void ilist_append(ilist *l, int num, unsigned int hits, int aux);
+int ilist_append(ilist *l, int num, unsigned int hits, int aux);
void ilist_clear(ilist* l);
/* append a number if its not already on the list */
--- a/src/ausearch-llist.c
+++ b/src/ausearch-llist.c
@@ -1,6 +1,6 @@
/*
* ausearch-llist.c - Minimal linked list library
-* Copyright (c) 2005-2008,2011,2016 Red Hat Inc., Durham, North Carolina.
+* Copyright (c) 2005-2008,2011,2016 Red Hat Inc.
* Copyright (c) 2011 IBM Corp.
* All Rights Reserved.
*
@@ -102,15 +102,13 @@ lnode *list_prev(llist *l)
return l->cur;
}
-void list_append(llist *l, lnode *node)
+int list_append(llist *l, lnode *node)
{
lnode* newnode;
newnode = malloc(sizeof(lnode));
- if (newnode == NULL) {
- printf("Out of memory. Check %s file, %d line", __FILE__, __LINE__);
- return;
- }
+ if (newnode == NULL)
+ return 1;
if (node->message)
newnode->message = node->message;
@@ -123,7 +121,7 @@ void list_append(llist *l, lnode *node)
newnode->type = node->type;
newnode->a0 = node->a0;
newnode->a1 = node->a1;
- newnode->item = l->cnt;
+ newnode->item = l->cnt;
newnode->next = NULL;
// if we are at top, fix this up
@@ -135,6 +133,8 @@ void list_append(llist *l, lnode *node)
// make newnode current
l->cur = newnode;
l->cnt++;
+
+ return 0;
}
int list_find_item(llist *l, unsigned int i)
--- a/src/ausearch-llist.h
+++ b/src/ausearch-llist.h
@@ -107,7 +107,7 @@ void list_last(llist *l);
lnode *list_next(llist *l);
lnode *list_prev(llist *l);
static inline lnode *list_get_cur(llist *l) { return l->cur; }
-void list_append(llist *l, lnode *node);
+int list_append(llist *l, lnode *node);
void list_clear(llist* l);
int list_get_event(llist* l, event *e);
--- a/src/ausearch-nvpair.c
+++ b/src/ausearch-nvpair.c
@@ -1,6 +1,6 @@
/*
* ausearch-nvpair.c - Minimal linked list library for name-value pairs
-* Copyright (c) 2006-08 Red Hat Inc., Durham, North Carolina.
+* Copyright (c) 2006-08 Red Hat Inc.
* All Rights Reserved.
*
* This software may be freely redistributed and/or modified under the
@@ -42,13 +42,11 @@ nvnode *search_list_next(nvlist *l)
return l->cur;
}
-void search_list_append(nvlist *l, nvnode *node)
+int search_list_append(nvlist *l, nvnode *node)
{
nvnode* newnode = malloc(sizeof(nvnode));
- if (newnode == NULL) {
- printf("Out of memory. Check %s file, %d line", __FILE__, __LINE__);
- return;
- }
+ if (newnode == NULL)
+ return 1;
newnode->name = node->name;
newnode->val = node->val;
@@ -66,6 +64,8 @@ void search_list_append(nvlist *l, nvnod
// make newnode current
l->cur = newnode;
l->cnt++;
+
+ return 0;
}
int search_list_find_val(nvlist *l, long val)
--- a/src/ausearch-nvpair.h
+++ b/src/ausearch-nvpair.h
@@ -1,6 +1,6 @@
/*
* ausearch-nvpair.h - Header file for ausearch-nvpair.c
-* Copyright (c) 2006-08 Red Hat Inc., Durham, North Carolina.
+* Copyright (c) 2006-08 Red Hat Inc.
* All Rights Reserved.
*
* This software may be freely redistributed and/or modified under the
@@ -48,7 +48,7 @@ void search_list_create(nvlist *l);
static inline void search_list_first(nvlist *l) { l->cur = l->head; }
nvnode *search_list_next(nvlist *l);
static inline nvnode *search_list_get_cur(nvlist *l) { return l->cur; }
-void search_list_append(nvlist *l, nvnode *node);
+int search_list_append(nvlist *l, nvnode *node);
void search_list_clear(nvlist* l);
/* Given a numeric index, find that record. */
--- a/src/ausearch-string.c
+++ b/src/ausearch-string.c
@@ -44,15 +44,13 @@ snode *slist_next(slist *l)
return l->cur;
}
-void slist_append(slist *l, snode *node)
+int slist_append(slist *l, snode *node)
{
snode* newnode;
newnode = malloc(sizeof(snode));
- if (newnode == NULL) {
- printf("Out of memory. Check %s file, %d line", __FILE__, __LINE__);
- return;
- }
+ if (newnode == NULL)
+ return 1;
if (node->str)
newnode->str = node->str;
@@ -79,6 +77,8 @@ void slist_append(slist *l, snode *node)
// make newnode current
l->cur = newnode;
l->cnt++;
+
+ return 0;
}
void slist_clear(slist* l)
--- a/src/ausearch-string.h
+++ b/src/ausearch-string.h
@@ -49,7 +49,7 @@ void slist_create(slist *l);
static inline void slist_first(slist *l) { l->cur = l->head; }
snode *slist_next(slist *l);
static inline snode *slist_get_cur(slist *l) { return l->cur; }
-void slist_append(slist *l, snode *node);
+int slist_append(slist *l, snode *node);
void slist_clear(slist* l);
/* append a string if its not already on the list */
--- a/tools/aulastlog/aulastlog-llist.c
+++ b/tools/aulastlog/aulastlog-llist.c
@@ -1,7 +1,7 @@
/*
* aulastlog-llist.c - Minimal linked list library
-* Copyright (c) 2008 Red Hat Inc., Durham, North Carolina.
-* All Rights Reserved.
+* Copyright (c) 2008 Red Hat Inc..
+* All Rights Reserved.
*
* This software may be freely redistributed and/or modified under the
* terms of the GNU General Public License as published by the Free
@@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor
+* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1335, USA.
*
* Authors:
@@ -41,15 +41,13 @@ lnode *list_next(llist *l)
return l->cur;
}
-void list_append(llist *l, lnode *node)
+int list_append(llist *l, lnode *node)
{
lnode* newnode;
newnode = malloc(sizeof(lnode));
- if (newnode == NULL) {
- printf("Out of memory. Check %s file, %d line", __FILE__, __LINE__);
- return;
- }
+ if (newnode == NULL)
+ return 1;
newnode->sec = node->sec;
newnode->uid = node->uid;
@@ -62,7 +60,7 @@ void list_append(llist *l, lnode *node)
newnode->term = strdup(node->term);
else
newnode->term = NULL;
- newnode->item = l->cnt;
+ newnode->item = l->cnt;
newnode->next = NULL;
// if we are at top, fix this up
@@ -74,6 +72,8 @@ void list_append(llist *l, lnode *node)
// make newnode current
l->cur = newnode;
l->cnt++;
+
+ return 0;
}
void list_clear(llist* l)
--- a/tools/aulastlog/aulastlog-llist.h
+++ b/tools/aulastlog/aulastlog-llist.h
@@ -1,6 +1,6 @@
/*
* aulastlog-llist.h - Header file for aulastlog-llist.c
-* Copyright (c) 2008 Red Hat Inc., Durham, North Carolina.
+* Copyright (c) 2008 Red Hat Inc.
* All Rights Reserved.
*
* This software may be freely redistributed and/or modified under the
@@ -53,7 +53,7 @@ static inline void list_first(llist *l)
lnode *list_next(llist *l);
static inline lnode *list_get_cur(llist *l) { return l->cur; }
static inline unsigned int list_get_cnt(llist *l) { return l->cnt; }
-void list_append(llist *l, lnode *node);
+int list_append(llist *l, lnode *node);
void list_clear(llist* l);
int list_update_login(llist* l, time_t t);
int list_update_host(llist* l, const char *h);

View File

@@ -7,6 +7,7 @@ CPU_TYPE:=cortex-a7
FEATURES:=dt squashfs nand ramdisk gpio source-only
KERNEL_PATCHVER:=6.1
KERNEL_TESTING_PATCHVER:=6.6
include $(INCLUDE_DIR)/target.mk

View File

@@ -0,0 +1,303 @@
CONFIG_ALIGNMENT_TRAP=y
CONFIG_ARCH_32BIT_OFF_T=y
CONFIG_ARCH_AIROHA=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_KEEP_MEMBLOCK=y
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
CONFIG_ARCH_MULTIPLATFORM=y
CONFIG_ARCH_MULTI_V6_V7=y
CONFIG_ARCH_MULTI_V7=y
CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_STACKWALK=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARM=y
CONFIG_ARM_AMBA=y
CONFIG_ARM_ARCH_TIMER=y
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
CONFIG_ARM_CPU_SUSPEND=y
CONFIG_ARM_GIC=y
CONFIG_ARM_GIC_V3=y
CONFIG_ARM_GIC_V3_ITS=y
CONFIG_ARM_GIC_V3_ITS_PCI=y
CONFIG_ARM_HAS_GROUP_RELOCS=y
CONFIG_ARM_HEAVY_MB=y
# CONFIG_ARM_HIGHBANK_CPUIDLE is not set
CONFIG_ARM_L1_CACHE_SHIFT=6
CONFIG_ARM_L1_CACHE_SHIFT_6=y
CONFIG_ARM_PATCH_IDIV=y
CONFIG_ARM_PATCH_PHYS_VIRT=y
CONFIG_ARM_PSCI=y
CONFIG_ARM_PSCI_FW=y
# CONFIG_ARM_SMMU is not set
CONFIG_ARM_THUMB=y
CONFIG_ARM_UNWIND=y
CONFIG_ARM_VIRT_EXT=y
CONFIG_ATAGS=y
CONFIG_AUTO_ZRELADDR=y
CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y
CONFIG_BLK_DEV_SD=y
CONFIG_BLK_MQ_PCI=y
CONFIG_BLK_PM=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_CACHE_L2X0=y
CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y
CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
CONFIG_CC_NO_ARRAY_BOUNDS=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_CMDLINE="rootfstype=squashfs,jffs2"
CONFIG_CMDLINE_FROM_BOOTLOADER=y
CONFIG_COMMON_CLK=y
CONFIG_COMMON_CLK_EN7523=y
CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
CONFIG_COMPAT_32BIT_TIME=y
CONFIG_CONTEXT_TRACKING=y
CONFIG_CONTEXT_TRACKING_IDLE=y
CONFIG_CPU_32v6K=y
CONFIG_CPU_32v7=y
CONFIG_CPU_ABRT_EV7=y
CONFIG_CPU_CACHE_V7=y
CONFIG_CPU_CACHE_VIPT=y
CONFIG_CPU_COPY_V6=y
CONFIG_CPU_CP15=y
CONFIG_CPU_CP15_MMU=y
CONFIG_CPU_HAS_ASID=y
CONFIG_CPU_IDLE=y
CONFIG_CPU_IDLE_GOV_MENU=y
CONFIG_CPU_LITTLE_ENDIAN=y
CONFIG_CPU_MITIGATIONS=y
CONFIG_CPU_PABRT_V7=y
CONFIG_CPU_PM=y
CONFIG_CPU_RMAP=y
CONFIG_CPU_SPECTRE=y
CONFIG_CPU_THUMB_CAPABLE=y
CONFIG_CPU_TLB_V7=y
CONFIG_CPU_V7=y
CONFIG_CRC16=y
CONFIG_CRYPTO_DEFLATE=y
CONFIG_CRYPTO_HASH_INFO=y
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
CONFIG_CRYPTO_LIB_GF128MUL=y
CONFIG_CRYPTO_LIB_SHA1=y
CONFIG_CRYPTO_LIB_UTILS=y
CONFIG_CRYPTO_LZO=y
CONFIG_CRYPTO_ZSTD=y
CONFIG_CURRENT_POINTER_IN_TPIDRURO=y
CONFIG_DCACHE_WORD_ACCESS=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
CONFIG_DEBUG_MISC=y
CONFIG_DMA_OPS=y
CONFIG_DTC=y
CONFIG_EDAC_ATOMIC_SCRUB=y
CONFIG_EDAC_SUPPORT=y
CONFIG_EXCLUSIVE_SYSTEM_RAM=y
CONFIG_FIXED_PHY=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_FS_IOMAP=y
CONFIG_FUNCTION_ALIGNMENT=0
CONFIG_FWNODE_MDIO=y
CONFIG_FW_LOADER_PAGED_BUF=y
CONFIG_FW_LOADER_SYSFS=y
CONFIG_GCC10_NO_ARRAY_BOUNDS=y
CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y
CONFIG_GENERIC_ALLOCATOR=y
CONFIG_GENERIC_ARCH_TOPOLOGY=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CPU_AUTOPROBE=y
CONFIG_GENERIC_CPU_VULNERABILITIES=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_MIGRATION=y
CONFIG_GENERIC_IRQ_MULTI_HANDLER=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y
CONFIG_GENERIC_MSI_IRQ=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_GENERIC_VDSO_32=y
CONFIG_GPIOLIB_IRQCHIP=y
CONFIG_GPIO_CDEV=y
CONFIG_GPIO_EN7523=y
CONFIG_GPIO_GENERIC=y
# CONFIG_HARDEN_BRANCH_HISTORY is not set
# CONFIG_HARDEN_BRANCH_PREDICTOR is not set
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_HAS_DMA=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_IOPORT_MAP=y
CONFIG_HAVE_SMP=y
CONFIG_HOTPLUG_CORE_SYNC=y
CONFIG_HOTPLUG_CORE_SYNC_DEAD=y
CONFIG_HOTPLUG_CPU=y
CONFIG_HW_RANDOM=y
CONFIG_HZ_FIXED=0
CONFIG_INITRAMFS_SOURCE=""
# CONFIG_IOMMUFD is not set
# CONFIG_IOMMU_DEBUGFS is not set
# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set
# CONFIG_IOMMU_IO_PGTABLE_LPAE is not set
CONFIG_IOMMU_SUPPORT=y
CONFIG_IRQCHIP=y
CONFIG_IRQSTACKS=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_DOMAIN_HIERARCHY=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_IRQ_TIME_ACCOUNTING=y
CONFIG_IRQ_WORK=y
# CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set
CONFIG_LIBFDT=y
CONFIG_LOCK_DEBUGGING_SUPPORT=y
CONFIG_LOCK_SPIN_ON_OWNER=y
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_MDIO_BUS=y
CONFIG_MDIO_DEVICE=y
CONFIG_MDIO_DEVRES=y
CONFIG_MFD_SYSCON=y
CONFIG_MIGHT_HAVE_CACHE_L2X0=y
CONFIG_MIGRATION=y
CONFIG_MMU_LAZY_TLB_REFCOUNT=y
CONFIG_MODULES_USE_ELF_REL=y
CONFIG_MTD_NAND_CORE=y
CONFIG_MTD_NAND_ECC=y
CONFIG_MTD_NAND_ECC_SW_HAMMING=y
CONFIG_MTD_SPI_NAND=y
CONFIG_MTD_SPI_NOR=y
CONFIG_MTD_SPLIT_FIRMWARE=y
CONFIG_MTD_SPLIT_FIT_FW=y
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_SRCU_NMI_SAFE=y
CONFIG_NET_EGRESS=y
CONFIG_NET_FLOW_LIMIT=y
CONFIG_NET_INGRESS=y
CONFIG_NET_SELFTESTS=y
CONFIG_NET_XGRESS=y
CONFIG_NLS=y
CONFIG_NO_HZ_COMMON=y
CONFIG_NO_HZ_IDLE=y
CONFIG_NR_CPUS=2
CONFIG_NVMEM=y
CONFIG_NVMEM_LAYOUTS=y
CONFIG_NVMEM_SYSFS=y
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_OLD_SIGACTION=y
CONFIG_OLD_SIGSUSPEND3=y
CONFIG_OUTER_CACHE=y
CONFIG_OUTER_CACHE_SYNC=y
CONFIG_PADATA=y
CONFIG_PAGE_OFFSET=0xC0000000
CONFIG_PAGE_POOL=y
CONFIG_PAGE_SIZE_LESS_THAN_256KB=y
CONFIG_PAGE_SIZE_LESS_THAN_64KB=y
CONFIG_PARTITION_PERCPU=y
CONFIG_PCI=y
CONFIG_PCIEAER=y
CONFIG_PCIEPORTBUS=y
CONFIG_PCIE_MEDIATEK=y
CONFIG_PCIE_PME=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_DOMAINS_GENERIC=y
CONFIG_PCI_MSI=y
CONFIG_PERF_USE_VMALLOC=y
CONFIG_PGTABLE_LEVELS=2
CONFIG_PHYLIB=y
CONFIG_PHYLIB_LEDS=y
CONFIG_PINCTRL=y
CONFIG_PM=y
CONFIG_PM_CLK=y
CONFIG_PREEMPT_NONE_BUILD=y
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
CONFIG_PWM=y
CONFIG_PWM_SYSFS=y
CONFIG_RANDSTRUCT_NONE=y
CONFIG_RAS=y
CONFIG_RATIONAL=y
CONFIG_REGMAP=y
CONFIG_REGMAP_MMIO=y
CONFIG_RESET_CONTROLLER=y
CONFIG_RFS_ACCEL=y
CONFIG_RPS=y
CONFIG_RWSEM_SPIN_ON_OWNER=y
CONFIG_SCSI=y
CONFIG_SCSI_COMMON=y
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_FSL=y
# CONFIG_SERIAL_8250_SHARE_IRQ is not set
CONFIG_SERIAL_MCTRL_GPIO=y
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_SGL_ALLOC=y
CONFIG_SG_POOL=y
CONFIG_SMP=y
CONFIG_SMP_ON_UP=y
CONFIG_SOCK_RX_QUEUE_MAPPING=y
CONFIG_SOFTIRQ_ON_OWN_STACK=y
CONFIG_SPARSE_IRQ=y
CONFIG_SPI=y
CONFIG_SPI_AIROHA_EN7523=y
CONFIG_SPI_MASTER=y
CONFIG_SPI_MEM=y
CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y
CONFIG_STACKTRACE=y
# CONFIG_SWAP is not set
CONFIG_SWPHY=y
CONFIG_SWP_EMULATE=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=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_UNCOMPRESS_INCLUDE="debug/uncompress.h"
CONFIG_UNWINDER_ARM=y
CONFIG_USB=y
CONFIG_USB_COMMON=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_XHCI_HCD=y
# CONFIG_USB_XHCI_PLATFORM is not set
CONFIG_USE_OF=y
# CONFIG_VFP is not set
CONFIG_WATCHDOG_CORE=y
# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
CONFIG_XPS=y
CONFIG_XXHASH=y
CONFIG_XZ_DEC_ARM=y
CONFIG_XZ_DEC_BCJ=y
CONFIG_ZBOOT_ROM_BSS=0
CONFIG_ZBOOT_ROM_TEXT=0
CONFIG_ZLIB_DEFLATE=y
CONFIG_ZLIB_INFLATE=y
CONFIG_ZSTD_COMMON=y
CONFIG_ZSTD_COMPRESS=y
CONFIG_ZSTD_DECOMPRESS=y

View File

@@ -0,0 +1,341 @@
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -353,6 +353,12 @@ config SPI_DLN2
This driver can also be built as a module. If so, the module
will be called spi-dln2.
+config SPI_AIROHA_EN7523
+ bool "Airoha EN7523 SPI controller support"
+ depends on ARCH_AIROHA
+ help
+ This enables SPI controller support for the Airoha EN7523 SoC.
+
config SPI_EP93XX
tristate "Cirrus Logic EP93xx SPI controller"
depends on ARCH_EP93XX || COMPILE_TEST
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -50,6 +50,7 @@ obj-$(CONFIG_SPI_DW_BT1) += spi-dw-bt1.
obj-$(CONFIG_SPI_DW_MMIO) += spi-dw-mmio.o
obj-$(CONFIG_SPI_DW_PCI) += spi-dw-pci.o
obj-$(CONFIG_SPI_EP93XX) += spi-ep93xx.o
+obj-$(CONFIG_SPI_AIROHA_EN7523) += spi-en7523.o
obj-$(CONFIG_SPI_FALCON) += spi-falcon.o
obj-$(CONFIG_SPI_FSI) += spi-fsi.o
obj-$(CONFIG_SPI_FSL_CPM) += spi-fsl-cpm.o
--- /dev/null
+++ b/drivers/spi/spi-en7523.c
@@ -0,0 +1,313 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/mod_devicetable.h>
+#include <linux/spi/spi.h>
+
+
+#define ENSPI_READ_IDLE_EN 0x0004
+#define ENSPI_MTX_MODE_TOG 0x0014
+#define ENSPI_RDCTL_FSM 0x0018
+#define ENSPI_MANUAL_EN 0x0020
+#define ENSPI_MANUAL_OPFIFO_EMPTY 0x0024
+#define ENSPI_MANUAL_OPFIFO_WDATA 0x0028
+#define ENSPI_MANUAL_OPFIFO_FULL 0x002C
+#define ENSPI_MANUAL_OPFIFO_WR 0x0030
+#define ENSPI_MANUAL_DFIFO_FULL 0x0034
+#define ENSPI_MANUAL_DFIFO_WDATA 0x0038
+#define ENSPI_MANUAL_DFIFO_EMPTY 0x003C
+#define ENSPI_MANUAL_DFIFO_RD 0x0040
+#define ENSPI_MANUAL_DFIFO_RDATA 0x0044
+#define ENSPI_IER 0x0090
+#define ENSPI_NFI2SPI_EN 0x0130
+
+// TODO not in spi block
+#define ENSPI_CLOCK_DIVIDER ((void __iomem *)0x1fa201c4)
+
+#define OP_CSH 0x00
+#define OP_CSL 0x01
+#define OP_CK 0x02
+#define OP_OUTS 0x08
+#define OP_OUTD 0x09
+#define OP_OUTQ 0x0A
+#define OP_INS 0x0C
+#define OP_INS0 0x0D
+#define OP_IND 0x0E
+#define OP_INQ 0x0F
+#define OP_OS2IS 0x10
+#define OP_OS2ID 0x11
+#define OP_OS2IQ 0x12
+#define OP_OD2IS 0x13
+#define OP_OD2ID 0x14
+#define OP_OD2IQ 0x15
+#define OP_OQ2IS 0x16
+#define OP_OQ2ID 0x17
+#define OP_OQ2IQ 0x18
+#define OP_OSNIS 0x19
+#define OP_ODNID 0x1A
+
+#define MATRIX_MODE_AUTO 1
+#define CONF_MTX_MODE_AUTO 0
+#define MANUALEN_AUTO 0
+#define MATRIX_MODE_MANUAL 0
+#define CONF_MTX_MODE_MANUAL 9
+#define MANUALEN_MANUAL 1
+
+#define _ENSPI_MAX_XFER 0x1ff
+
+#define REG(x) (iobase + x)
+
+
+static void __iomem *iobase;
+
+
+static void opfifo_write(u32 cmd, u32 len)
+{
+ u32 tmp = ((cmd & 0x1f) << 9) | (len & 0x1ff);
+
+ writel(tmp, REG(ENSPI_MANUAL_OPFIFO_WDATA));
+
+ /* Wait for room in OPFIFO */
+ while (readl(REG(ENSPI_MANUAL_OPFIFO_FULL)))
+ ;
+
+ /* Shift command into OPFIFO */
+ writel(1, REG(ENSPI_MANUAL_OPFIFO_WR));
+
+ /* Wait for command to finish */
+ while (!readl(REG(ENSPI_MANUAL_OPFIFO_EMPTY)))
+ ;
+}
+
+static void set_cs(int state)
+{
+ if (state)
+ opfifo_write(OP_CSH, 1);
+ else
+ opfifo_write(OP_CSL, 1);
+}
+
+static void manual_begin_cmd(void)
+{
+ /* Disable read idle state */
+ writel(0, REG(ENSPI_READ_IDLE_EN));
+
+ /* Wait for FSM to reach idle state */
+ while (readl(REG(ENSPI_RDCTL_FSM)))
+ ;
+
+ /* Set SPI core to manual mode */
+ writel(CONF_MTX_MODE_MANUAL, REG(ENSPI_MTX_MODE_TOG));
+ writel(MANUALEN_MANUAL, REG(ENSPI_MANUAL_EN));
+}
+
+static void manual_end_cmd(void)
+{
+ /* Set SPI core to auto mode */
+ writel(CONF_MTX_MODE_AUTO, REG(ENSPI_MTX_MODE_TOG));
+ writel(MANUALEN_AUTO, REG(ENSPI_MANUAL_EN));
+
+ /* Enable read idle state */
+ writel(1, REG(ENSPI_READ_IDLE_EN));
+}
+
+static void dfifo_read(u8 *buf, int len)
+{
+ int i;
+
+ for (i = 0; i < len; i++) {
+ /* Wait for requested data to show up in DFIFO */
+ while (readl(REG(ENSPI_MANUAL_DFIFO_EMPTY)))
+ ;
+ buf[i] = readl(REG(ENSPI_MANUAL_DFIFO_RDATA));
+ /* Queue up next byte */
+ writel(1, REG(ENSPI_MANUAL_DFIFO_RD));
+ }
+}
+
+static void dfifo_write(const u8 *buf, int len)
+{
+ int i;
+
+ for (i = 0; i < len; i++) {
+ /* Wait for room in DFIFO */
+ while (readl(REG(ENSPI_MANUAL_DFIFO_FULL)))
+ ;
+ writel(buf[i], REG(ENSPI_MANUAL_DFIFO_WDATA));
+ }
+}
+
+#if 0
+static void set_spi_clock_speed(int freq_mhz)
+{
+ u32 tmp, val;
+
+ tmp = readl(ENSPI_CLOCK_DIVIDER);
+ tmp &= 0xffff0000;
+ writel(tmp, ENSPI_CLOCK_DIVIDER);
+
+ val = (400 / (freq_mhz * 2));
+ tmp |= (val << 8) | 1;
+ writel(tmp, ENSPI_CLOCK_DIVIDER);
+}
+#endif
+
+static void init_hw(void)
+{
+ /* Disable manual/auto mode clash interrupt */
+ writel(0, REG(ENSPI_IER));
+
+ // TODO via clk framework
+ // set_spi_clock_speed(50);
+
+ /* Disable DMA */
+ writel(0, REG(ENSPI_NFI2SPI_EN));
+}
+
+static int xfer_read(struct spi_transfer *xfer)
+{
+ int opcode;
+ uint8_t *buf = xfer->rx_buf;
+
+ switch (xfer->rx_nbits) {
+ case SPI_NBITS_SINGLE:
+ opcode = OP_INS;
+ break;
+ case SPI_NBITS_DUAL:
+ opcode = OP_IND;
+ break;
+ case SPI_NBITS_QUAD:
+ opcode = OP_INQ;
+ break;
+ }
+
+ opfifo_write(opcode, xfer->len);
+ dfifo_read(buf, xfer->len);
+
+ return xfer->len;
+}
+
+static int xfer_write(struct spi_transfer *xfer, int next_xfer_is_rx)
+{
+ int opcode;
+ const uint8_t *buf = xfer->tx_buf;
+
+ if (next_xfer_is_rx) {
+ /* need to use Ox2Ix opcode to set the core to input afterwards */
+ switch (xfer->tx_nbits) {
+ case SPI_NBITS_SINGLE:
+ opcode = OP_OS2IS;
+ break;
+ case SPI_NBITS_DUAL:
+ opcode = OP_OS2ID;
+ break;
+ case SPI_NBITS_QUAD:
+ opcode = OP_OS2IQ;
+ break;
+ }
+ } else {
+ switch (xfer->tx_nbits) {
+ case SPI_NBITS_SINGLE:
+ opcode = OP_OUTS;
+ break;
+ case SPI_NBITS_DUAL:
+ opcode = OP_OUTD;
+ break;
+ case SPI_NBITS_QUAD:
+ opcode = OP_OUTQ;
+ break;
+ }
+ }
+
+ opfifo_write(opcode, xfer->len);
+ dfifo_write(buf, xfer->len);
+
+ return xfer->len;
+}
+
+size_t max_transfer_size(struct spi_device *spi)
+{
+ return _ENSPI_MAX_XFER;
+}
+
+int transfer_one_message(struct spi_controller *ctrl, struct spi_message *msg)
+{
+ struct spi_transfer *xfer;
+ int next_xfer_is_rx = 0;
+
+ manual_begin_cmd();
+ set_cs(0);
+ list_for_each_entry(xfer, &msg->transfers, transfer_list) {
+ if (xfer->tx_buf) {
+ if (!list_is_last(&xfer->transfer_list, &msg->transfers)
+ && list_next_entry(xfer, transfer_list)->rx_buf != NULL)
+ next_xfer_is_rx = 1;
+ else
+ next_xfer_is_rx = 0;
+ msg->actual_length += xfer_write(xfer, next_xfer_is_rx);
+ } else if (xfer->rx_buf) {
+ msg->actual_length += xfer_read(xfer);
+ }
+ }
+ set_cs(1);
+ manual_end_cmd();
+
+ msg->status = 0;
+ spi_finalize_current_message(ctrl);
+
+ return 0;
+}
+
+static int spi_probe(struct platform_device *pdev)
+{
+ struct spi_controller *ctrl;
+ int err;
+
+ ctrl = devm_spi_alloc_master(&pdev->dev, 0);
+ if (!ctrl) {
+ dev_err(&pdev->dev, "Error allocating SPI controller\n");
+ return -ENOMEM;
+ }
+
+ iobase = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
+ if (IS_ERR(iobase)) {
+ dev_err(&pdev->dev, "Could not map SPI register address");
+ return -ENOMEM;
+ }
+
+ init_hw();
+
+ ctrl->dev.of_node = pdev->dev.of_node;
+ ctrl->flags = SPI_CONTROLLER_HALF_DUPLEX;
+ ctrl->mode_bits = SPI_RX_DUAL | SPI_TX_DUAL;
+ ctrl->max_transfer_size = max_transfer_size;
+ ctrl->transfer_one_message = transfer_one_message;
+ err = devm_spi_register_controller(&pdev->dev, ctrl);
+ if (err) {
+ dev_err(&pdev->dev, "Could not register SPI controller\n");
+ return -ENODEV;
+ }
+
+ return 0;
+}
+
+static const struct of_device_id spi_of_ids[] = {
+ { .compatible = "airoha,en7523-spi" },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, spi_of_ids);
+
+static struct platform_driver spi_driver = {
+ .probe = spi_probe,
+ .driver = {
+ .name = "airoha-en7523-spi",
+ .of_match_table = spi_of_ids,
+ },
+};
+
+module_platform_driver(spi_driver);
+
+MODULE_LICENSE("GPL v2");
+MODULE_AUTHOR("Bert Vermeulen <bert@biot.com>");
+MODULE_DESCRIPTION("Airoha EN7523 SPI driver");

View File

@@ -0,0 +1,89 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca955x_senao_loader.dtsi"
&partitions {
partition@ff0000 {
label = "art";
reg = <0xff0000 0x010000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
macaddr_art_0: macaddr@0 {
compatible = "mac-base";
reg = <0x0 0x6>;
#nvmem-cell-cells = <1>;
};
calibration_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
calibration_art_5000: calibration@5000 {
reg = <0x5000 0x844>;
};
};
};
};
&mdio0 {
status = "okay";
phy1: ethernet-phy@1 {
reg = <1>;
eee-broken-100tx;
eee-broken-1000t;
};
phy2: ethernet-phy@2 {
reg = <2>;
eee-broken-100tx;
eee-broken-1000t;
at803x-override-sgmii-link-check;
};
};
&eth0 {
status = "okay";
nvmem-cells = <&macaddr_art_0 0>;
nvmem-cell-names = "mac-address";
phy-handle = <&phy1>;
phy-mode = "rgmii-id";
pll-data = <0x82000000 0x80000101 0x80001313>;
};
&eth1 {
status = "okay";
nvmem-cells = <&macaddr_art_0 1>;
nvmem-cell-names = "mac-address";
phy-handle = <&phy2>;
pll-data = <0x03000000 0x00000101 0x00001313>;
qca955x-sgmii-fixup;
};
&wmac {
status = "okay";
nvmem-cells = <&macaddr_art_0 2>, <&calibration_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
};
&ath10k_1 {
nvmem-cells = <&macaddr_art_0 3>, <&calibration_art_5000>;
nvmem-cell-names = "mac-address", "calibration";
};
&pcie1 {
status = "okay";
};

View File

@@ -0,0 +1,48 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca9558_engenius_dual_ap.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
/ {
compatible = "engenius,ens1750", "qca,qca9558";
model = "EnGenius ENS1750";
aliases {
label-mac-device = &eth0;
led-boot = &led_wifi5g;
led-failsafe = &led_wifi5g;
led-upgrade = &led_wifi5g;
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
linux,code = <KEY_RESTART>;
};
};
leds {
compatible = "gpio-leds";
wifi2g {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WLAN_2GHZ;
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
led_wifi5g: wifi5g {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WLAN_5GHZ;
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
};
};

View File

@@ -1,9 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca955x_senao_loader.dtsi"
#include "qca9558_engenius_dual_ap.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
/ {
compatible = "engenius,ews660ap", "qca,qca9558";
@@ -31,103 +32,17 @@
compatible = "gpio-leds";
wifi2g {
label = "green:wifi2g";
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WLAN_2GHZ;
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
led_wifi5g: wifi5g {
label = "green:wifi5g";
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WLAN_5GHZ;
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
};
};
&partitions {
partition@ff0000 {
label = "art";
reg = <0xff0000 0x010000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
macaddr_art_0: macaddr@0 {
compatible = "mac-base";
reg = <0x0 0x6>;
#nvmem-cell-cells = <1>;
};
calibration_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
calibration_art_5000: calibration@5000 {
reg = <0x5000 0x844>;
};
};
};
};
&mdio0 {
status = "okay";
phy1: ethernet-phy@1 {
reg = <1>;
eee-broken-100tx;
eee-broken-1000t;
};
phy2: ethernet-phy@2 {
reg = <2>;
eee-broken-100tx;
eee-broken-1000t;
at803x-override-sgmii-link-check;
};
};
&eth0 {
status = "okay";
nvmem-cells = <&macaddr_art_0 0>;
nvmem-cell-names = "mac-address";
phy-handle = <&phy1>;
phy-mode = "rgmii-id";
pll-data = <0x82000000 0x80000101 0x80001313>;
};
&eth1 {
status = "okay";
nvmem-cells = <&macaddr_art_0 1>;
nvmem-cell-names = "mac-address";
phy-handle = <&phy2>;
pll-data = <0x03000000 0x00000101 0x00001313>;
qca955x-sgmii-fixup;
};
&wmac {
status = "okay";
nvmem-cells = <&macaddr_art_0 2>, <&calibration_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
};
&ath10k_1 {
status = "okay";
nvmem-cells = <&macaddr_art_0 3>, <&calibration_art_5000>;
nvmem-cell-names = "mac-address", "calibration";
};
&pcie1 {
status = "okay";
};

View File

@@ -59,6 +59,7 @@
};
partition@40000 {
compatible = "u-boot,env";
label = "u-boot-env";
reg = <0x040000 0x010000>;
};

View File

@@ -1319,7 +1319,6 @@ static int ag71xx_rx_packets(struct ag71xx *ag, int limit)
int ring_mask = BIT(ring->order) - 1;
int ring_size = BIT(ring->order);
struct list_head rx_list;
struct sk_buff *next;
struct sk_buff *skb;
int done = 0;
@@ -1379,7 +1378,7 @@ next:
ag71xx_ring_rx_refill(ag);
list_for_each_entry_safe(skb, next, &rx_list, list)
list_for_each_entry(skb, &rx_list, list)
skb->protocol = eth_type_trans(skb, dev);
netif_receive_skb_list(&rx_list);

View File

@@ -146,6 +146,7 @@ ath79_setup_interfaces()
elecom,wab-i1750-ps|\
elecom,wab-s1167-ps|\
elecom,wab-s600-ps|\
engenius,ens1750|\
engenius,enstationac-v1|\
engenius,ews511ap|\
engenius,ews660ap|\

View File

@@ -40,6 +40,7 @@ platform_do_upgrade() {
engenius,eap300-v2|\
engenius,eap600|\
engenius,ecb600|\
engenius,ens1750|\
engenius,ens202ext-v1|\
engenius,enstationac-v1|\
engenius,ews660ap|\

View File

@@ -1529,18 +1529,29 @@ define Device/engenius_ews511ap
endef
TARGET_DEVICES += engenius_ews511ap
define Device/engenius_ews660ap
define Device/engenius_ews_dual_ap
$(Device/senao_loader_okli)
SOC := qca9558
DEVICE_VENDOR := EnGenius
DEVICE_MODEL := EWS660AP
DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct
IMAGE_SIZE := 11584k
LOADER_FLASH_OFFS := 0x220000
endef
define Device/engenius_ews660ap
$(Device/engenius_ews_dual_ap)
DEVICE_MODEL := EWS660AP
SENAO_IMGNAME := ar71xx-generic-ews660ap
endef
TARGET_DEVICES += engenius_ews660ap
define Device/engenius_ens1750
$(Device/engenius_ews_dual_ap)
DEVICE_MODEL := ENS1750
SENAO_IMGNAME := ar71xx-generic-ens1750
endef
TARGET_DEVICES += engenius_ens1750
define Device/enterasys_ws-ap3705i
SOC := ar9344
DEVICE_VENDOR := Enterasys

View File

@@ -19,7 +19,7 @@ Subject: [PATCH 210/210] b44: register adm switch
#include <linux/uaccess.h>
#include <asm/io.h>
@@ -2245,6 +2247,69 @@ static void b44_adjust_link(struct net_d
@@ -2247,6 +2249,69 @@ static void b44_adjust_link(struct net_d
}
}
@@ -89,7 +89,7 @@ Subject: [PATCH 210/210] b44: register adm switch
static int b44_register_phy_one(struct b44 *bp)
{
__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
@@ -2281,6 +2346,9 @@ static int b44_register_phy_one(struct b
@@ -2283,6 +2348,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))) {
@@ -99,7 +99,7 @@ Subject: [PATCH 210/210] b44: register adm switch
dev_info(sdev->dev,
"could not find PHY at %i, use fixed one\n",
bp->phy_addr);
@@ -2475,6 +2543,7 @@ static void b44_remove_one(struct ssb_de
@@ -2477,6 +2545,7 @@ static void b44_remove_one(struct ssb_de
unregister_netdev(dev);
if (bp->flags & B44_FLAG_EXTERNAL_PHY)
b44_unregister_phy_one(bp);

View File

@@ -43,7 +43,7 @@
if (bp->flags & B44_FLAG_EXTERNAL_PHY)
return 0;
@@ -2175,6 +2200,8 @@ static int b44_get_invariants(struct b44
@@ -2177,6 +2202,8 @@ static int b44_get_invariants(struct b44
* valid PHY address. */
bp->phy_addr &= 0x1F;

View File

@@ -73,7 +73,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -1299,6 +1299,14 @@ config ARCH_HAS_ELFCORE_COMPAT
@@ -1307,6 +1307,14 @@ config ARCH_HAS_ELFCORE_COMPAT
config ARCH_HAS_PARANOID_L1D_FLUSH
bool
@@ -90,7 +90,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
source "scripts/gcc-plugins/Kconfig"
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -85,6 +85,7 @@ config X86
@@ -86,6 +86,7 @@ config X86
select ARCH_HAS_PMEM_API if X86_64
select ARCH_HAS_PTE_DEVMAP if X86_64
select ARCH_HAS_PTE_SPECIAL

View File

@@ -552,7 +552,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
--- a/kernel/bounds.c
+++ b/kernel/bounds.c
@@ -22,6 +22,11 @@ int main(void)
DEFINE(NR_CPUS_BITS, bits_per(CONFIG_NR_CPUS));
DEFINE(NR_CPUS_BITS, order_base_2(CONFIG_NR_CPUS));
#endif
DEFINE(SPINLOCK_SIZE, sizeof(spinlock_t));
+#ifdef CONFIG_LRU_GEN

View File

@@ -124,7 +124,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
list_del(&dst->list);
kfree(dst);
}
@@ -805,7 +809,7 @@ static int dsa_switch_setup_tag_protocol
@@ -827,7 +831,7 @@ static int dsa_switch_setup_tag_protocol
int port, err;
if (tag_ops->proto == dst->default_proto)
@@ -133,7 +133,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
for (port = 0; port < ds->num_ports; port++) {
if (!dsa_is_cpu_port(ds, port))
@@ -821,6 +825,17 @@ static int dsa_switch_setup_tag_protocol
@@ -843,6 +847,17 @@ static int dsa_switch_setup_tag_protocol
}
}
@@ -151,7 +151,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return 0;
}
@@ -1132,6 +1147,46 @@ static void dsa_tree_teardown(struct dsa
@@ -1154,6 +1169,46 @@ static void dsa_tree_teardown(struct dsa
dst->setup = false;
}
@@ -198,7 +198,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* Since the dsa/tagging sysfs device attribute is per master, the assumption
* is that all DSA switches within a tree share the same tagger, otherwise
* they would have formed disjoint trees (different "dsa,member" values).
@@ -1164,12 +1219,15 @@ int dsa_tree_change_tag_proto(struct dsa
@@ -1186,12 +1241,15 @@ int dsa_tree_change_tag_proto(struct dsa
goto out_unlock;
}
@@ -216,7 +216,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
rtnl_unlock();
@@ -1257,6 +1315,7 @@ static int dsa_port_parse_cpu(struct dsa
@@ -1279,6 +1337,7 @@ static int dsa_port_parse_cpu(struct dsa
struct dsa_switch *ds = dp->ds;
struct dsa_switch_tree *dst = ds->dst;
enum dsa_tag_protocol default_proto;
@@ -224,7 +224,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* Find out which protocol the switch would prefer. */
default_proto = dsa_get_tag_protocol(dp, master);
@@ -1311,6 +1370,12 @@ static int dsa_port_parse_cpu(struct dsa
@@ -1333,6 +1392,12 @@ static int dsa_port_parse_cpu(struct dsa
*/
dsa_tag_driver_put(tag_ops);
} else {

View File

@@ -101,7 +101,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
list_del(&dst->list);
kfree(dst);
}
@@ -826,17 +822,29 @@ static int dsa_switch_setup_tag_protocol
@@ -848,17 +844,29 @@ static int dsa_switch_setup_tag_protocol
}
connect:
@@ -132,7 +132,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
static int dsa_switch_setup(struct dsa_switch *ds)
@@ -1156,13 +1164,6 @@ static int dsa_tree_bind_tag_proto(struc
@@ -1178,13 +1186,6 @@ static int dsa_tree_bind_tag_proto(struc
dst->tag_ops = tag_ops;
@@ -146,7 +146,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* Notify the switches from this tree about the connection
* to the new tagger
*/
@@ -1172,16 +1173,14 @@ static int dsa_tree_bind_tag_proto(struc
@@ -1194,16 +1195,14 @@ static int dsa_tree_bind_tag_proto(struc
goto out_disconnect;
/* Notify the old tagger about the disconnection from this tree */
@@ -167,7 +167,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
dst->tag_ops = old_tag_ops;
return err;
@@ -1315,7 +1314,6 @@ static int dsa_port_parse_cpu(struct dsa
@@ -1337,7 +1336,6 @@ static int dsa_port_parse_cpu(struct dsa
struct dsa_switch *ds = dp->ds;
struct dsa_switch_tree *dst = ds->dst;
enum dsa_tag_protocol default_proto;
@@ -175,7 +175,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* Find out which protocol the switch would prefer. */
default_proto = dsa_get_tag_protocol(dp, master);
@@ -1370,12 +1368,6 @@ static int dsa_port_parse_cpu(struct dsa
@@ -1392,12 +1390,6 @@ static int dsa_port_parse_cpu(struct dsa
*/
dsa_tag_driver_put(tag_ops);
} else {

View File

@@ -1,30 +0,0 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Mon, 7 Feb 2022 10:27:22 +0100
Subject: [PATCH] arm64: dts: mediatek: mt7622: add support for coherent
DMA
It improves performance by eliminating the need for a cache flush on rx and tx
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
@@ -357,7 +357,7 @@
};
cci_control2: slave-if@5000 {
- compatible = "arm,cci-400-ctrl-if";
+ compatible = "arm,cci-400-ctrl-if", "syscon";
interface-type = "ace";
reg = <0x5000 0x1000>;
};
@@ -938,6 +938,8 @@
power-domains = <&scpsys MT7622_POWER_DOMAIN_ETHSYS>;
mediatek,ethsys = <&ethsys>;
mediatek,sgmiisys = <&sgmiisys>;
+ mediatek,cci-control = <&cci_control2>;
+ dma-coherent;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";

View File

@@ -1,62 +0,0 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Sat, 5 Feb 2022 18:36:36 +0100
Subject: [PATCH] arm64: dts: mediatek: mt7622: introduce nodes for
Wireless Ethernet Dispatch
Introduce wed0 and wed1 nodes in order to enable offloading forwarding
between ethernet and wireless devices on the mt7622 chipset.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
@@ -894,6 +894,11 @@
};
};
+ hifsys: syscon@1af00000 {
+ compatible = "mediatek,mt7622-hifsys", "syscon";
+ reg = <0 0x1af00000 0 0x70>;
+ };
+
ethsys: syscon@1b000000 {
compatible = "mediatek,mt7622-ethsys",
"syscon";
@@ -912,6 +917,26 @@
#dma-cells = <1>;
};
+ pcie_mirror: pcie-mirror@10000400 {
+ compatible = "mediatek,mt7622-pcie-mirror",
+ "syscon";
+ reg = <0 0x10000400 0 0x10>;
+ };
+
+ wed0: wed@1020a000 {
+ compatible = "mediatek,mt7622-wed",
+ "syscon";
+ reg = <0 0x1020a000 0 0x1000>;
+ interrupts = <GIC_SPI 214 IRQ_TYPE_LEVEL_LOW>;
+ };
+
+ wed1: wed@1020b000 {
+ compatible = "mediatek,mt7622-wed",
+ "syscon";
+ reg = <0 0x1020b000 0 0x1000>;
+ interrupts = <GIC_SPI 215 IRQ_TYPE_LEVEL_LOW>;
+ };
+
eth: ethernet@1b100000 {
compatible = "mediatek,mt7622-eth",
"mediatek,mt2701-eth",
@@ -939,6 +964,9 @@
mediatek,ethsys = <&ethsys>;
mediatek,sgmiisys = <&sgmiisys>;
mediatek,cci-control = <&cci_control2>;
+ mediatek,wed = <&wed0>, <&wed1>;
+ mediatek,pcie-mirror = <&pcie_mirror>;
+ mediatek,hifsys = <&hifsys>;
dma-coherent;
#address-cells = <1>;
#size-cells = <0>;

View File

@@ -13,7 +13,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
@@ -963,7 +963,7 @@
@@ -957,7 +957,7 @@
power-domains = <&scpsys MT7622_POWER_DOMAIN_ETHSYS>;
mediatek,ethsys = <&ethsys>;
mediatek,sgmiisys = <&sgmiisys>;

View File

@@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -1243,27 +1243,31 @@ static int
@@ -1425,27 +1425,31 @@ static int
mt7530_port_bridge_join(struct dsa_switch *ds, int port,
struct net_device *bridge)
{
@@ -65,7 +65,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
/* Add the all other ports to this port matrix. */
@@ -1368,24 +1372,28 @@ static void
@@ -1550,24 +1554,28 @@ static void
mt7530_port_bridge_leave(struct dsa_switch *ds, int port,
struct net_device *bridge)
{

View File

@@ -23,7 +23,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2499,6 +2499,32 @@ mt7531_setup(struct dsa_switch *ds)
@@ -2687,6 +2687,32 @@ mt7531_setup(struct dsa_switch *ds)
return 0;
}
@@ -56,7 +56,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static bool
mt7530_phy_mode_supported(struct dsa_switch *ds, int port,
const struct phylink_link_state *state)
@@ -2535,6 +2561,37 @@ static bool mt7531_is_rgmii_port(struct
@@ -2723,6 +2749,37 @@ static bool mt7531_is_rgmii_port(struct
return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII);
}
@@ -94,7 +94,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static bool
mt7531_phy_mode_supported(struct dsa_switch *ds, int port,
const struct phylink_link_state *state)
@@ -3011,6 +3068,18 @@ mt7531_cpu_port_config(struct dsa_switch
@@ -3199,6 +3256,18 @@ mt7531_cpu_port_config(struct dsa_switch
return 0;
}
@@ -113,7 +113,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static void
mt7530_mac_port_validate(struct dsa_switch *ds, int port,
unsigned long *supported)
@@ -3246,6 +3315,7 @@ static const struct dsa_switch_ops mt753
@@ -3435,6 +3504,7 @@ static const struct dsa_switch_ops mt753
.port_vlan_del = mt7530_port_vlan_del,
.port_mirror_add = mt753x_port_mirror_add,
.port_mirror_del = mt753x_port_mirror_del,
@@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.phylink_validate = mt753x_phylink_validate,
.phylink_mac_link_state = mt753x_phylink_mac_link_state,
.phylink_mac_config = mt753x_phylink_mac_config,
@@ -3263,6 +3333,7 @@ static const struct mt753x_info mt753x_t
@@ -3452,6 +3522,7 @@ static const struct mt753x_info mt753x_t
.phy_read = mt7530_phy_read,
.phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup,
@@ -129,7 +129,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.phy_mode_supported = mt7530_phy_mode_supported,
.mac_port_validate = mt7530_mac_port_validate,
.mac_port_get_state = mt7530_phylink_mac_link_state,
@@ -3274,6 +3345,7 @@ static const struct mt753x_info mt753x_t
@@ -3463,6 +3534,7 @@ static const struct mt753x_info mt753x_t
.phy_read = mt7530_phy_read,
.phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup,
@@ -137,7 +137,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.phy_mode_supported = mt7530_phy_mode_supported,
.mac_port_validate = mt7530_mac_port_validate,
.mac_port_get_state = mt7530_phylink_mac_link_state,
@@ -3286,6 +3358,7 @@ static const struct mt753x_info mt753x_t
@@ -3475,6 +3547,7 @@ static const struct mt753x_info mt753x_t
.phy_write = mt7531_ind_phy_write,
.pad_setup = mt7531_pad_setup,
.cpu_port_config = mt7531_cpu_port_config,
@@ -145,7 +145,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.phy_mode_supported = mt7531_phy_mode_supported,
.mac_port_validate = mt7531_mac_port_validate,
.mac_port_get_state = mt7531_phylink_mac_link_state,
@@ -3348,6 +3421,7 @@ mt7530_probe(struct mdio_device *mdiodev
@@ -3537,6 +3610,7 @@ mt7530_probe(struct mdio_device *mdiodev
*/
if (!priv->info->sw_setup || !priv->info->pad_setup ||
!priv->info->phy_read || !priv->info->phy_write ||
@@ -155,7 +155,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
!priv->info->mac_port_get_state || !priv->info->mac_port_config)
--- a/drivers/net/dsa/mt7530.h
+++ b/drivers/net/dsa/mt7530.h
@@ -796,6 +796,8 @@ struct mt753x_info {
@@ -807,6 +807,8 @@ struct mt753x_info {
int (*phy_write)(struct mt7530_priv *priv, int port, int regnum, u16 val);
int (*pad_setup)(struct dsa_switch *ds, phy_interface_t interface);
int (*cpu_port_config)(struct dsa_switch *ds, int port);

View File

@@ -21,7 +21,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2525,37 +2525,6 @@ static void mt7530_mac_port_get_caps(str
@@ -2713,37 +2713,6 @@ static void mt7530_mac_port_get_caps(str
}
}
@@ -59,7 +59,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static bool mt7531_is_rgmii_port(struct mt7530_priv *priv, u32 port)
{
return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII);
@@ -2592,44 +2561,6 @@ static void mt7531_mac_port_get_caps(str
@@ -2780,44 +2749,6 @@ static void mt7531_mac_port_get_caps(str
}
}
@@ -104,7 +104,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static int
mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state)
{
@@ -2884,9 +2815,6 @@ mt753x_phylink_mac_config(struct dsa_swi
@@ -3072,9 +3003,6 @@ mt753x_phylink_mac_config(struct dsa_swi
struct mt7530_priv *priv = ds->priv;
u32 mcr_cur, mcr_new;
@@ -114,7 +114,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
switch (port) {
case 0 ... 4: /* Internal phy */
if (state->interface != PHY_INTERFACE_MODE_GMII)
@@ -3102,12 +3030,6 @@ mt753x_phylink_validate(struct dsa_switc
@@ -3290,12 +3218,6 @@ mt753x_phylink_validate(struct dsa_switc
__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
struct mt7530_priv *priv = ds->priv;
@@ -127,7 +127,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
phylink_set_port_modes(mask);
if (state->interface != PHY_INTERFACE_MODE_TRGMII &&
@@ -3334,7 +3256,6 @@ static const struct mt753x_info mt753x_t
@@ -3523,7 +3445,6 @@ static const struct mt753x_info mt753x_t
.phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup,
.mac_port_get_caps = mt7530_mac_port_get_caps,
@@ -135,7 +135,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_validate = mt7530_mac_port_validate,
.mac_port_get_state = mt7530_phylink_mac_link_state,
.mac_port_config = mt7530_mac_config,
@@ -3346,7 +3267,6 @@ static const struct mt753x_info mt753x_t
@@ -3535,7 +3456,6 @@ static const struct mt753x_info mt753x_t
.phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup,
.mac_port_get_caps = mt7530_mac_port_get_caps,
@@ -143,7 +143,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_validate = mt7530_mac_port_validate,
.mac_port_get_state = mt7530_phylink_mac_link_state,
.mac_port_config = mt7530_mac_config,
@@ -3359,7 +3279,6 @@ static const struct mt753x_info mt753x_t
@@ -3548,7 +3468,6 @@ static const struct mt753x_info mt753x_t
.pad_setup = mt7531_pad_setup,
.cpu_port_config = mt7531_cpu_port_config,
.mac_port_get_caps = mt7531_mac_port_get_caps,
@@ -151,7 +151,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_validate = mt7531_mac_port_validate,
.mac_port_get_state = mt7531_phylink_mac_link_state,
.mac_port_config = mt7531_mac_config,
@@ -3422,7 +3341,6 @@ mt7530_probe(struct mdio_device *mdiodev
@@ -3611,7 +3530,6 @@ mt7530_probe(struct mdio_device *mdiodev
if (!priv->info->sw_setup || !priv->info->pad_setup ||
!priv->info->phy_read || !priv->info->phy_write ||
!priv->info->mac_port_get_caps ||
@@ -161,7 +161,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
return -EINVAL;
--- a/drivers/net/dsa/mt7530.h
+++ b/drivers/net/dsa/mt7530.h
@@ -798,8 +798,6 @@ struct mt753x_info {
@@ -809,8 +809,6 @@ struct mt753x_info {
int (*cpu_port_config)(struct dsa_switch *ds, int port);
void (*mac_port_get_caps)(struct dsa_switch *ds, int port,
struct phylink_config *config);

View File

@@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -3054,11 +3054,6 @@ mt753x_phylink_validate(struct dsa_switc
@@ -3242,11 +3242,6 @@ mt753x_phylink_validate(struct dsa_switc
linkmode_and(supported, supported, mask);
linkmode_and(state->advertising, state->advertising, mask);

View File

@@ -23,7 +23,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2632,12 +2632,13 @@ static int mt7531_rgmii_setup(struct mt7
@@ -2820,12 +2820,13 @@ static int mt7531_rgmii_setup(struct mt7
}
static void mt7531_sgmii_validate(struct mt7530_priv *priv, int port,
@@ -38,7 +38,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
phylink_set(supported, 2500baseX_Full);
phylink_set(supported, 2500baseT_Full);
}
@@ -3010,16 +3011,18 @@ static void mt753x_phylink_get_caps(stru
@@ -3198,16 +3199,18 @@ static void mt753x_phylink_get_caps(stru
static void
mt7530_mac_port_validate(struct dsa_switch *ds, int port,
@@ -58,7 +58,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
}
static void
@@ -3042,12 +3045,13 @@ mt753x_phylink_validate(struct dsa_switc
@@ -3230,12 +3233,13 @@ mt753x_phylink_validate(struct dsa_switc
}
/* This switch only supports 1G full-duplex. */
@@ -76,7 +76,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
phylink_set(mask, Asym_Pause);
--- a/drivers/net/dsa/mt7530.h
+++ b/drivers/net/dsa/mt7530.h
@@ -799,6 +799,7 @@ struct mt753x_info {
@@ -810,6 +810,7 @@ struct mt753x_info {
void (*mac_port_get_caps)(struct dsa_switch *ds, int port,
struct phylink_config *config);
void (*mac_port_validate)(struct dsa_switch *ds, int port,

View File

@@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2631,19 +2631,6 @@ static int mt7531_rgmii_setup(struct mt7
@@ -2819,19 +2819,6 @@ static int mt7531_rgmii_setup(struct mt7
return 0;
}
@@ -40,7 +40,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static void
mt7531_sgmii_link_up_force(struct dsa_switch *ds, int port,
unsigned int mode, phy_interface_t interface,
@@ -3010,51 +2997,21 @@ static void mt753x_phylink_get_caps(stru
@@ -3198,51 +3185,21 @@ static void mt753x_phylink_get_caps(stru
}
static void
@@ -97,7 +97,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
linkmode_and(supported, supported, mask);
linkmode_and(state->advertising, state->advertising, mask);
@@ -3255,7 +3212,6 @@ static const struct mt753x_info mt753x_t
@@ -3444,7 +3401,6 @@ static const struct mt753x_info mt753x_t
.phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup,
.mac_port_get_caps = mt7530_mac_port_get_caps,
@@ -105,7 +105,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_get_state = mt7530_phylink_mac_link_state,
.mac_port_config = mt7530_mac_config,
},
@@ -3266,7 +3222,6 @@ static const struct mt753x_info mt753x_t
@@ -3455,7 +3411,6 @@ static const struct mt753x_info mt753x_t
.phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup,
.mac_port_get_caps = mt7530_mac_port_get_caps,
@@ -113,7 +113,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_get_state = mt7530_phylink_mac_link_state,
.mac_port_config = mt7530_mac_config,
},
@@ -3278,7 +3233,6 @@ static const struct mt753x_info mt753x_t
@@ -3467,7 +3422,6 @@ static const struct mt753x_info mt753x_t
.pad_setup = mt7531_pad_setup,
.cpu_port_config = mt7531_cpu_port_config,
.mac_port_get_caps = mt7531_mac_port_get_caps,
@@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_get_state = mt7531_phylink_mac_link_state,
.mac_port_config = mt7531_mac_config,
.mac_pcs_an_restart = mt7531_sgmii_restart_an,
@@ -3340,7 +3294,6 @@ mt7530_probe(struct mdio_device *mdiodev
@@ -3529,7 +3483,6 @@ mt7530_probe(struct mdio_device *mdiodev
if (!priv->info->sw_setup || !priv->info->pad_setup ||
!priv->info->phy_read || !priv->info->phy_write ||
!priv->info->mac_port_get_caps ||

View File

@@ -33,7 +33,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
/* String, offset, and register size in bytes if different from 4 bytes */
static const struct mt7530_mib_desc mt7530_mib[] = {
MIB_DESC(1, 0x00, "TxDrop"),
@@ -2631,12 +2636,11 @@ static int mt7531_rgmii_setup(struct mt7
@@ -2819,12 +2824,11 @@ static int mt7531_rgmii_setup(struct mt7
return 0;
}
@@ -50,7 +50,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
unsigned int val;
/* For adjusting speed and duplex of SGMII force mode. */
@@ -2662,6 +2666,9 @@ mt7531_sgmii_link_up_force(struct dsa_sw
@@ -2850,6 +2854,9 @@ mt7531_sgmii_link_up_force(struct dsa_sw
/* MT7531 SGMII 1G force mode can only work in full duplex mode,
* no matter MT7531_SGMII_FORCE_HALF_DUPLEX is set or not.
@@ -60,7 +60,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
*/
if ((speed == SPEED_10 || speed == SPEED_100) &&
duplex != DUPLEX_FULL)
@@ -2737,9 +2744,10 @@ static int mt7531_sgmii_setup_mode_an(st
@@ -2925,9 +2932,10 @@ static int mt7531_sgmii_setup_mode_an(st
return 0;
}
@@ -73,7 +73,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
u32 val;
/* Only restart AN when AN is enabled */
@@ -2796,6 +2804,24 @@ mt753x_mac_config(struct dsa_switch *ds,
@@ -2984,6 +2992,24 @@ mt753x_mac_config(struct dsa_switch *ds,
return priv->info->mac_port_config(ds, port, mode, state->interface);
}
@@ -98,7 +98,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static void
mt753x_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
const struct phylink_link_state *state)
@@ -2857,17 +2883,6 @@ unsupported:
@@ -3045,17 +3071,6 @@ unsupported:
mt7530_write(priv, MT7530_PMCR_P(port), mcr_new);
}
@@ -116,7 +116,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static void mt753x_phylink_mac_link_down(struct dsa_switch *ds, int port,
unsigned int mode,
phy_interface_t interface)
@@ -2877,16 +2892,13 @@ static void mt753x_phylink_mac_link_down
@@ -3065,16 +3080,13 @@ static void mt753x_phylink_mac_link_down
mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK);
}
@@ -139,7 +139,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
}
static void mt753x_phylink_mac_link_up(struct dsa_switch *ds, int port,
@@ -2899,8 +2911,6 @@ static void mt753x_phylink_mac_link_up(s
@@ -3087,8 +3099,6 @@ static void mt753x_phylink_mac_link_up(s
struct mt7530_priv *priv = ds->priv;
u32 mcr;
@@ -148,7 +148,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
mcr = PMCR_RX_EN | PMCR_TX_EN | PMCR_FORCE_LNK;
/* MT753x MAC works in 1G full duplex mode for all up-clocked
@@ -2978,6 +2988,8 @@ mt7531_cpu_port_config(struct dsa_switch
@@ -3166,6 +3176,8 @@ mt7531_cpu_port_config(struct dsa_switch
return ret;
mt7530_write(priv, MT7530_PMCR_P(port),
PMCR_CPU_PORT_SETTING(priv->id));
@@ -157,7 +157,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
mt753x_phylink_mac_link_up(ds, port, MLO_AN_FIXED, interface, NULL,
speed, DUPLEX_FULL, true, true);
@@ -3017,16 +3029,13 @@ mt753x_phylink_validate(struct dsa_switc
@@ -3205,16 +3217,13 @@ mt753x_phylink_validate(struct dsa_switc
linkmode_and(state->advertising, state->advertising, mask);
}
@@ -178,7 +178,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
pmsr = mt7530_read(priv, MT7530_PMSR_P(port));
state->link = (pmsr & PMSR_LINK);
@@ -3053,8 +3062,6 @@ mt7530_phylink_mac_link_state(struct dsa
@@ -3241,8 +3250,6 @@ mt7530_phylink_mac_link_state(struct dsa
state->pause |= MLO_PAUSE_RX;
if (pmsr & PMSR_TX_FC)
state->pause |= MLO_PAUSE_TX;
@@ -187,7 +187,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
}
static int
@@ -3096,32 +3103,49 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
@@ -3284,32 +3291,49 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
return 0;
}
@@ -249,7 +249,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
if (ret)
return ret;
@@ -3134,6 +3158,13 @@ mt753x_setup(struct dsa_switch *ds)
@@ -3322,6 +3346,13 @@ mt753x_setup(struct dsa_switch *ds)
if (ret && priv->irq)
mt7530_free_irq_common(priv);
@@ -263,7 +263,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
return ret;
}
@@ -3195,9 +3226,8 @@ static const struct dsa_switch_ops mt753
@@ -3384,9 +3415,8 @@ static const struct dsa_switch_ops mt753
.port_mirror_del = mt753x_port_mirror_del,
.phylink_get_caps = mt753x_phylink_get_caps,
.phylink_validate = mt753x_phylink_validate,
@@ -274,7 +274,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.phylink_mac_link_down = mt753x_phylink_mac_link_down,
.phylink_mac_link_up = mt753x_phylink_mac_link_up,
.get_mac_eee = mt753x_get_mac_eee,
@@ -3207,36 +3237,34 @@ static const struct dsa_switch_ops mt753
@@ -3396,36 +3426,34 @@ static const struct dsa_switch_ops mt753
static const struct mt753x_info mt753x_table[] = {
[ID_MT7621] = {
.id = ID_MT7621,
@@ -314,7 +314,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
},
};
@@ -3294,7 +3322,7 @@ mt7530_probe(struct mdio_device *mdiodev
@@ -3483,7 +3511,7 @@ mt7530_probe(struct mdio_device *mdiodev
if (!priv->info->sw_setup || !priv->info->pad_setup ||
!priv->info->phy_read || !priv->info->phy_write ||
!priv->info->mac_port_get_caps ||
@@ -325,7 +325,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
priv->id = priv->info->id;
--- a/drivers/net/dsa/mt7530.h
+++ b/drivers/net/dsa/mt7530.h
@@ -768,6 +768,12 @@ static const char *p5_intf_modes(unsigne
@@ -779,6 +779,12 @@ static const char *p5_intf_modes(unsigne
struct mt7530_priv;
@@ -338,7 +338,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
/* struct mt753x_info - This is the main data structure for holding the specific
* part for each supported device
* @sw_setup: Holding the handler to a device initialization
@@ -779,18 +785,14 @@ struct mt7530_priv;
@@ -790,18 +796,14 @@ struct mt7530_priv;
* port
* @mac_port_validate: Holding the way to set addition validate type for a
* certan MAC port
@@ -359,7 +359,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
int (*sw_setup)(struct dsa_switch *ds);
int (*phy_read)(struct mt7530_priv *priv, int port, int regnum);
int (*phy_write)(struct mt7530_priv *priv, int port, int regnum, u16 val);
@@ -801,15 +803,9 @@ struct mt753x_info {
@@ -812,15 +814,9 @@ struct mt753x_info {
void (*mac_port_validate)(struct dsa_switch *ds, int port,
phy_interface_t interface,
unsigned long *supported);
@@ -375,7 +375,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
};
/* struct mt7530_priv - This is the main data structure for holding the state
@@ -851,6 +847,7 @@ struct mt7530_priv {
@@ -862,6 +858,7 @@ struct mt7530_priv {
u8 mirror_tx;
struct mt7530_port ports[MT7530_NUM_PORTS];

View File

@@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -3008,25 +3008,16 @@ static void mt753x_phylink_get_caps(stru
@@ -3196,25 +3196,16 @@ static void mt753x_phylink_get_caps(stru
priv->info->mac_port_get_caps(ds, port, config);
}
@@ -55,7 +55,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
}
static void mt7530_pcs_get_state(struct phylink_pcs *pcs,
@@ -3128,12 +3119,14 @@ static void mt7530_pcs_an_restart(struct
@@ -3316,12 +3307,14 @@ static void mt7530_pcs_an_restart(struct
}
static const struct phylink_pcs_ops mt7530_pcs_ops = {
@@ -70,7 +70,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.pcs_get_state = mt7531_pcs_get_state,
.pcs_config = mt753x_pcs_config,
.pcs_an_restart = mt7531_pcs_an_restart,
@@ -3225,7 +3218,6 @@ static const struct dsa_switch_ops mt753
@@ -3414,7 +3407,6 @@ static const struct dsa_switch_ops mt753
.port_mirror_add = mt753x_port_mirror_add,
.port_mirror_del = mt753x_port_mirror_del,
.phylink_get_caps = mt753x_phylink_get_caps,

View File

@@ -19,7 +19,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -3005,6 +3005,12 @@ static void mt753x_phylink_get_caps(stru
@@ -3193,6 +3193,12 @@ static void mt753x_phylink_get_caps(stru
config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
MAC_10 | MAC_100 | MAC_1000FD;

View File

@@ -81,7 +81,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -3143,9 +3143,16 @@ static int
@@ -3331,9 +3331,16 @@ static int
mt753x_setup(struct dsa_switch *ds)
{
struct mt7530_priv *priv = ds->priv;
@@ -100,7 +100,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (ret)
return ret;
@@ -3157,13 +3164,6 @@ mt753x_setup(struct dsa_switch *ds)
@@ -3345,13 +3352,6 @@ mt753x_setup(struct dsa_switch *ds)
if (ret && priv->irq)
mt7530_free_irq_common(priv);

View File

@@ -26,7 +26,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -1589,11 +1589,11 @@ static void
@@ -1771,11 +1771,11 @@ static void
mt7530_hw_vlan_add(struct mt7530_priv *priv,
struct mt7530_hw_vlan_entry *entry)
{
@@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* Validate the entry with independent learning, create egress tag per
* VLAN and joining the port as one of the port members.
@@ -1604,22 +1604,20 @@ mt7530_hw_vlan_add(struct mt7530_priv *p
@@ -1786,22 +1786,20 @@ mt7530_hw_vlan_add(struct mt7530_priv *p
/* Decide whether adding tag or not for those outgoing packets from the
* port inside the VLAN.
@@ -72,7 +72,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
static void
@@ -1638,11 +1636,7 @@ mt7530_hw_vlan_del(struct mt7530_priv *p
@@ -1820,11 +1818,7 @@ mt7530_hw_vlan_del(struct mt7530_priv *p
return;
}

View File

@@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -1093,6 +1093,7 @@ static int
@@ -1275,6 +1275,7 @@ static int
mt7530_port_enable(struct dsa_switch *ds, int port,
struct phy_device *phy)
{
@@ -29,7 +29,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct mt7530_priv *priv = ds->priv;
mutex_lock(&priv->reg_mutex);
@@ -1101,7 +1102,11 @@ mt7530_port_enable(struct dsa_switch *ds
@@ -1283,7 +1284,11 @@ mt7530_port_enable(struct dsa_switch *ds
* restore the port matrix if the port is the member of a certain
* bridge.
*/
@@ -42,7 +42,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
priv->ports[port].enable = true;
mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK,
priv->ports[port].pm);
@@ -1249,7 +1254,8 @@ mt7530_port_bridge_join(struct dsa_switc
@@ -1431,7 +1436,8 @@ mt7530_port_bridge_join(struct dsa_switc
struct net_device *bridge)
{
struct dsa_port *dp = dsa_to_port(ds, port), *other_dp;
@@ -52,7 +52,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct mt7530_priv *priv = ds->priv;
mutex_lock(&priv->reg_mutex);
@@ -1326,9 +1332,12 @@ mt7530_port_set_vlan_unaware(struct dsa_
@@ -1508,9 +1514,12 @@ mt7530_port_set_vlan_unaware(struct dsa_
* the CPU port get out of VLAN filtering mode.
*/
if (all_user_ports_removed) {
@@ -67,7 +67,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
| PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
}
}
@@ -1378,6 +1387,7 @@ mt7530_port_bridge_leave(struct dsa_swit
@@ -1560,6 +1569,7 @@ mt7530_port_bridge_leave(struct dsa_swit
struct net_device *bridge)
{
struct dsa_port *dp = dsa_to_port(ds, port), *other_dp;
@@ -75,7 +75,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct mt7530_priv *priv = ds->priv;
mutex_lock(&priv->reg_mutex);
@@ -1406,8 +1416,8 @@ mt7530_port_bridge_leave(struct dsa_swit
@@ -1588,8 +1598,8 @@ mt7530_port_bridge_leave(struct dsa_swit
*/
if (priv->ports[port].enable)
mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK,
@@ -86,7 +86,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* When a port is removed from the bridge, the port would be set up
* back to the default as is at initial boot which is a VLAN-unaware
@@ -1570,6 +1580,9 @@ static int
@@ -1752,6 +1762,9 @@ static int
mt7530_port_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering,
struct netlink_ext_ack *extack)
{
@@ -96,7 +96,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (vlan_filtering) {
/* The port is being kept as VLAN-unaware port when bridge is
* set up with vlan_filtering not being set, Otherwise, the
@@ -1577,7 +1590,7 @@ mt7530_port_vlan_filtering(struct dsa_sw
@@ -1759,7 +1772,7 @@ mt7530_port_vlan_filtering(struct dsa_sw
* for becoming a VLAN-aware port.
*/
mt7530_port_set_vlan_aware(ds, port);

View File

@@ -1,85 +0,0 @@
From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Thu, 11 Apr 2024 13:28:59 +0200
Subject: [PATCH] netfilter: flowtable: validate pppoe header
Ensure there is sufficient room to access the protocol field of the
PPPoe header. Validate it once before the flowtable lookup, then use a
helper function to access protocol field.
Reported-by: syzbot+b6f07e1c07ef40199081@syzkaller.appspotmail.com
Fixes: 72efd585f714 ("netfilter: flowtable: add pppoe support")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
--- a/include/net/netfilter/nf_flow_table.h
+++ b/include/net/netfilter/nf_flow_table.h
@@ -318,7 +318,7 @@ int nf_flow_rule_route_ipv6(struct net *
int nf_flow_table_offload_init(void);
void nf_flow_table_offload_exit(void);
-static inline __be16 nf_flow_pppoe_proto(const struct sk_buff *skb)
+static inline __be16 __nf_flow_pppoe_proto(const struct sk_buff *skb)
{
__be16 proto;
@@ -334,4 +334,14 @@ static inline __be16 nf_flow_pppoe_proto
return 0;
}
+static inline bool nf_flow_pppoe_proto(struct sk_buff *skb, __be16 *inner_proto)
+{
+ if (!pskb_may_pull(skb, PPPOE_SES_HLEN))
+ return false;
+
+ *inner_proto = __nf_flow_pppoe_proto(skb);
+
+ return true;
+}
+
#endif /* _NF_FLOW_TABLE_H */
--- a/net/netfilter/nf_flow_table_inet.c
+++ b/net/netfilter/nf_flow_table_inet.c
@@ -21,7 +21,8 @@ nf_flow_offload_inet_hook(void *priv, st
proto = veth->h_vlan_encapsulated_proto;
break;
case htons(ETH_P_PPP_SES):
- proto = nf_flow_pppoe_proto(skb);
+ if (!nf_flow_pppoe_proto(skb, &proto))
+ return NF_ACCEPT;
break;
default:
proto = skb->protocol;
--- a/net/netfilter/nf_flow_table_ip.c
+++ b/net/netfilter/nf_flow_table_ip.c
@@ -246,10 +246,11 @@ static unsigned int nf_flow_xmit_xfrm(st
return NF_STOLEN;
}
-static bool nf_flow_skb_encap_protocol(const struct sk_buff *skb, __be16 proto,
+static bool nf_flow_skb_encap_protocol(struct sk_buff *skb, __be16 proto,
u32 *offset)
{
struct vlan_ethhdr *veth;
+ __be16 inner_proto;
switch (skb->protocol) {
case htons(ETH_P_8021Q):
@@ -260,7 +261,8 @@ static bool nf_flow_skb_encap_protocol(c
}
break;
case htons(ETH_P_PPP_SES):
- if (nf_flow_pppoe_proto(skb) == proto) {
+ if (nf_flow_pppoe_proto(skb, &inner_proto) &&
+ inner_proto == proto) {
*offset += PPPOE_SES_HLEN;
return true;
}
@@ -289,7 +291,7 @@ static void nf_flow_encap_pop(struct sk_
skb_reset_network_header(skb);
break;
case htons(ETH_P_PPP_SES):
- skb->protocol = nf_flow_pppoe_proto(skb);
+ skb->protocol = __nf_flow_pppoe_proto(skb);
skb_pull(skb, PPPOE_SES_HLEN);
skb_reset_network_header(skb);
break;

View File

@@ -1,24 +0,0 @@
From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Thu, 11 Apr 2024 13:29:00 +0200
Subject: [PATCH] netfilter: flowtable: incorrect pppoe tuple
pppoe traffic reaching ingress path does not match the flowtable entry
because the pppoe header is expected to be at the network header offset.
This bug causes a mismatch in the flow table lookup, so pppoe packets
enter the classical forwarding path.
Fixes: 72efd585f714 ("netfilter: flowtable: add pppoe support")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
--- a/net/netfilter/nf_flow_table_ip.c
+++ b/net/netfilter/nf_flow_table_ip.c
@@ -156,7 +156,7 @@ static void nf_flow_tuple_encap(struct s
tuple->encap[i].proto = skb->protocol;
break;
case htons(ETH_P_PPP_SES):
- phdr = (struct pppoe_hdr *)skb_mac_header(skb);
+ phdr = (struct pppoe_hdr *)skb_network_header(skb);
tuple->encap[i].id = ntohs(phdr->sid);
tuple->encap[i].proto = skb->protocol;
break;

View File

@@ -30,7 +30,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -1034,6 +1034,8 @@ static int dsa_tree_setup_master(struct
@@ -1056,6 +1056,8 @@ static int dsa_tree_setup_master(struct
struct dsa_port *dp;
int err;
@@ -39,7 +39,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
list_for_each_entry(dp, &dst->ports, list) {
if (dsa_port_is_cpu(dp)) {
err = dsa_master_setup(dp->master, dp);
@@ -1042,6 +1044,8 @@ static int dsa_tree_setup_master(struct
@@ -1064,6 +1066,8 @@ static int dsa_tree_setup_master(struct
}
}
@@ -48,7 +48,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return 0;
}
@@ -1049,9 +1053,13 @@ static void dsa_tree_teardown_master(str
@@ -1071,9 +1075,13 @@ static void dsa_tree_teardown_master(str
{
struct dsa_port *dp;

View File

@@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -999,23 +999,28 @@ static void dsa_tree_teardown_switches(s
@@ -1021,23 +1021,28 @@ static void dsa_tree_teardown_switches(s
dsa_switch_teardown(dp->ds);
}
@@ -66,7 +66,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
}
@@ -1024,7 +1029,21 @@ static int dsa_tree_setup_switches(struc
@@ -1046,7 +1051,21 @@ static int dsa_tree_setup_switches(struc
teardown:
dsa_tree_teardown_ports(dst);
@@ -89,7 +89,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return err;
}
@@ -1111,10 +1130,14 @@ static int dsa_tree_setup(struct dsa_swi
@@ -1133,10 +1152,14 @@ static int dsa_tree_setup(struct dsa_swi
if (err)
goto teardown_cpu_ports;
@@ -105,7 +105,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
err = dsa_tree_setup_lags(dst);
if (err)
goto teardown_master;
@@ -1127,8 +1150,9 @@ static int dsa_tree_setup(struct dsa_swi
@@ -1149,8 +1172,9 @@ static int dsa_tree_setup(struct dsa_swi
teardown_master:
dsa_tree_teardown_master(dst);

View File

@@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -545,6 +545,7 @@ static void dsa_port_teardown(struct dsa
@@ -567,6 +567,7 @@ static void dsa_port_teardown(struct dsa
struct devlink_port *dlp = &dp->devlink_port;
struct dsa_switch *ds = dp->ds;
struct dsa_mac_addr *a, *tmp;
@@ -51,7 +51,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (!dp->setup)
return;
@@ -566,9 +567,11 @@ static void dsa_port_teardown(struct dsa
@@ -588,9 +589,11 @@ static void dsa_port_teardown(struct dsa
dsa_port_link_unregister_of(dp);
break;
case DSA_PORT_TYPE_USER:
@@ -65,7 +65,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
break;
}
@@ -1130,17 +1133,17 @@ static int dsa_tree_setup(struct dsa_swi
@@ -1152,17 +1155,17 @@ static int dsa_tree_setup(struct dsa_swi
if (err)
goto teardown_cpu_ports;
@@ -87,7 +87,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
dst->setup = true;
@@ -1148,10 +1151,10 @@ static int dsa_tree_setup(struct dsa_swi
@@ -1170,10 +1173,10 @@ static int dsa_tree_setup(struct dsa_swi
return 0;
@@ -100,7 +100,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
teardown_switches:
dsa_tree_teardown_switches(dst);
teardown_cpu_ports:
@@ -1169,10 +1172,10 @@ static void dsa_tree_teardown(struct dsa
@@ -1191,10 +1194,10 @@ static void dsa_tree_teardown(struct dsa
dsa_tree_teardown_lags(dst);

View File

@@ -68,7 +68,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static inline bool dsa_is_unused_port(struct dsa_switch *ds, int p)
{
return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_UNUSED;
@@ -949,6 +959,13 @@ struct dsa_switch_ops {
@@ -957,6 +967,13 @@ struct dsa_switch_ops {
int (*tag_8021q_vlan_add)(struct dsa_switch *ds, int port, u16 vid,
u16 flags);
int (*tag_8021q_vlan_del)(struct dsa_switch *ds, int port, u16 vid);
@@ -84,7 +84,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define DSA_DEVLINK_PARAM_DRIVER(_id, _name, _type, _cmodes) \
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -1275,6 +1275,52 @@ out_unlock:
@@ -1297,6 +1297,52 @@ out_unlock:
return err;
}

View File

@@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#include "dsa_priv.h"
@@ -1060,9 +1061,18 @@ static int dsa_tree_setup_master(struct
@@ -1082,9 +1083,18 @@ static int dsa_tree_setup_master(struct
list_for_each_entry(dp, &dst->ports, list) {
if (dsa_port_is_cpu(dp)) {
@@ -64,7 +64,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
}
@@ -1077,9 +1087,19 @@ static void dsa_tree_teardown_master(str
@@ -1099,9 +1109,19 @@ static void dsa_tree_teardown_master(str
rtnl_lock();

View File

@@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2791,9 +2791,6 @@ mt7531_mac_config(struct dsa_switch *ds,
@@ -2979,9 +2979,6 @@ mt7531_mac_config(struct dsa_switch *ds,
case PHY_INTERFACE_MODE_NA:
case PHY_INTERFACE_MODE_1000BASEX:
case PHY_INTERFACE_MODE_2500BASEX:
@@ -29,7 +29,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return mt7531_sgmii_setup_mode_force(priv, port, interface);
default:
return -EINVAL;
@@ -2869,13 +2866,6 @@ unsupported:
@@ -3057,13 +3054,6 @@ unsupported:
return;
}
@@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port));
mcr_new = mcr_cur;
mcr_new &= ~PMCR_LINK_SETTINGS_MASK;
@@ -3012,6 +3002,9 @@ static void mt753x_phylink_get_caps(stru
@@ -3200,6 +3190,9 @@ static void mt753x_phylink_get_caps(stru
config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
MAC_10 | MAC_100 | MAC_1000FD;
@@ -53,7 +53,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* This driver does not make use of the speed, duplex, pause or the
* advertisement in its mac_config, so it is safe to mark this driver
* as non-legacy.
@@ -3077,6 +3070,7 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
@@ -3265,6 +3258,7 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
status = mt7530_read(priv, MT7531_PCS_CONTROL_1(port));
state->link = !!(status & MT7531_SGMII_LINK_STATUS);
@@ -61,7 +61,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (state->interface == PHY_INTERFACE_MODE_SGMII &&
(status & MT7531_SGMII_AN_ENABLE)) {
val = mt7530_read(priv, MT7531_PCS_SPEED_ABILITY(port));
@@ -3107,16 +3101,44 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
@@ -3295,16 +3289,44 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
return 0;
}
@@ -109,7 +109,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
static int mt753x_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
@@ -3157,6 +3179,8 @@ mt753x_setup(struct dsa_switch *ds)
@@ -3345,6 +3367,8 @@ mt753x_setup(struct dsa_switch *ds)
priv->pcs[i].pcs.ops = priv->info->pcs_ops;
priv->pcs[i].priv = priv;
priv->pcs[i].port = i;
@@ -120,7 +120,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ret = priv->info->sw_setup(ds);
--- a/drivers/net/dsa/mt7530.h
+++ b/drivers/net/dsa/mt7530.h
@@ -400,6 +400,7 @@ enum mt7530_vlan_port_acc_frm {
@@ -410,6 +410,7 @@ enum mt7530_vlan_port_acc_frm {
#define MT7531_SGMII_LINK_STATUS BIT(18)
#define MT7531_SGMII_AN_ENABLE BIT(12)
#define MT7531_SGMII_AN_RESTART BIT(9)

View File

@@ -81,7 +81,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
#include <linux/phylink.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
@@ -2643,128 +2644,11 @@ static int mt7531_rgmii_setup(struct mt7
@@ -2831,128 +2832,11 @@ static int mt7531_rgmii_setup(struct mt7
return 0;
}
@@ -210,7 +210,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
static int
mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
phy_interface_t interface)
@@ -2787,11 +2671,11 @@ mt7531_mac_config(struct dsa_switch *ds,
@@ -2975,11 +2859,11 @@ mt7531_mac_config(struct dsa_switch *ds,
phydev = dp->slave->phydev;
return mt7531_rgmii_setup(priv, port, interface, phydev);
case PHY_INTERFACE_MODE_SGMII:
@@ -224,7 +224,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
default:
return -EINVAL;
}
@@ -2816,11 +2700,11 @@ mt753x_phylink_mac_select_pcs(struct dsa
@@ -3004,11 +2888,11 @@ mt753x_phylink_mac_select_pcs(struct dsa
switch (interface) {
case PHY_INTERFACE_MODE_TRGMII:
@@ -238,7 +238,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
default:
return NULL;
}
@@ -3061,86 +2945,6 @@ static void mt7530_pcs_get_state(struct
@@ -3249,86 +3133,6 @@ static void mt7530_pcs_get_state(struct
state->pause |= MLO_PAUSE_TX;
}
@@ -325,7 +325,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
static int mt753x_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
phy_interface_t interface,
const unsigned long *advertising,
@@ -3160,18 +2964,57 @@ static const struct phylink_pcs_ops mt75
@@ -3348,18 +3152,57 @@ static const struct phylink_pcs_ops mt75
.pcs_an_restart = mt7530_pcs_an_restart,
};
@@ -389,7 +389,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
int i, ret;
/* Initialise the PCS devices */
@@ -3179,8 +3022,6 @@ mt753x_setup(struct dsa_switch *ds)
@@ -3367,8 +3210,6 @@ mt753x_setup(struct dsa_switch *ds)
priv->pcs[i].pcs.ops = priv->info->pcs_ops;
priv->pcs[i].priv = priv;
priv->pcs[i].port = i;
@@ -398,7 +398,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
}
ret = priv->info->sw_setup(ds);
@@ -3195,6 +3036,16 @@ mt753x_setup(struct dsa_switch *ds)
@@ -3383,6 +3224,16 @@ mt753x_setup(struct dsa_switch *ds)
if (ret && priv->irq)
mt7530_free_irq_common(priv);
@@ -415,7 +415,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
return ret;
}
@@ -3286,7 +3137,7 @@ static const struct mt753x_info mt753x_t
@@ -3475,7 +3326,7 @@ static const struct mt753x_info mt753x_t
},
[ID_MT7531] = {
.id = ID_MT7531,
@@ -424,7 +424,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
.sw_setup = mt7531_setup,
.phy_read = mt7531_ind_phy_read,
.phy_write = mt7531_ind_phy_write,
@@ -3394,7 +3245,7 @@ static void
@@ -3583,7 +3434,7 @@ static void
mt7530_remove(struct mdio_device *mdiodev)
{
struct mt7530_priv *priv = dev_get_drvdata(&mdiodev->dev);
@@ -433,7 +433,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
if (!priv)
return;
@@ -3413,6 +3264,10 @@ mt7530_remove(struct mdio_device *mdiode
@@ -3602,6 +3453,10 @@ mt7530_remove(struct mdio_device *mdiode
mt7530_free_irq(priv);
dsa_unregister_switch(priv->ds);
@@ -446,7 +446,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
dev_set_drvdata(&mdiodev->dev, NULL);
--- a/drivers/net/dsa/mt7530.h
+++ b/drivers/net/dsa/mt7530.h
@@ -391,47 +391,8 @@ enum mt7530_vlan_port_acc_frm {
@@ -401,47 +401,8 @@ enum mt7530_vlan_port_acc_frm {
CCR_TX_OCT_CNT_BAD)
/* MT7531 SGMII register group */
@@ -496,7 +496,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
/* Register for system reset */
#define MT7530_SYS_CTRL 0x7000
@@ -730,13 +691,13 @@ struct mt7530_fdb {
@@ -741,13 +702,13 @@ struct mt7530_fdb {
* @pm: The matrix used to show all connections with the port.
* @pvid: The VLAN specified is to be considered a PVID at ingress. Any
* untagged frames will be assigned to the related VLAN.

View File

@@ -18,7 +18,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2996,26 +2996,56 @@ static const struct regmap_bus mt7531_re
@@ -3184,26 +3184,56 @@ static const struct regmap_bus mt7531_re
.reg_update_bits = mt7530_regmap_update_bits,
};
@@ -88,7 +88,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int i, ret;
/* Initialise the PCS devices */
@@ -3037,15 +3067,11 @@ mt753x_setup(struct dsa_switch *ds)
@@ -3225,15 +3255,11 @@ mt753x_setup(struct dsa_switch *ds)
if (ret && priv->irq)
mt7530_free_irq_common(priv);

View File

@@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2969,7 +2969,7 @@ static int mt7530_regmap_read(void *cont
@@ -3157,7 +3157,7 @@ static int mt7530_regmap_read(void *cont
{
struct mt7530_priv *priv = context;
@@ -28,7 +28,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return 0;
};
@@ -2977,23 +2977,25 @@ static int mt7530_regmap_write(void *con
@@ -3165,23 +3165,25 @@ static int mt7530_regmap_write(void *con
{
struct mt7530_priv *priv = context;
@@ -62,7 +62,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
static int
@@ -3019,6 +3021,9 @@ mt7531_create_sgmii(struct mt7530_priv *
@@ -3207,6 +3209,9 @@ mt7531_create_sgmii(struct mt7530_priv *
mt7531_pcs_config[i]->reg_stride = 4;
mt7531_pcs_config[i]->reg_base = MT7531_SGMII_REG_BASE(5 + i);
mt7531_pcs_config[i]->max_register = 0x17c;

View File

@@ -133,7 +133,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
static void
@@ -2965,22 +2986,6 @@ static const struct phylink_pcs_ops mt75
@@ -3153,22 +3174,6 @@ static const struct phylink_pcs_ops mt75
.pcs_an_restart = mt7530_pcs_an_restart,
};
@@ -156,7 +156,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void
mt7530_mdio_regmap_lock(void *mdio_lock)
{
@@ -2993,7 +2998,7 @@ mt7530_mdio_regmap_unlock(void *mdio_loc
@@ -3181,7 +3186,7 @@ mt7530_mdio_regmap_unlock(void *mdio_loc
mutex_unlock(mdio_lock);
}
@@ -165,7 +165,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
.reg_write = mt7530_regmap_write,
.reg_read = mt7530_regmap_read,
};
@@ -3026,7 +3031,7 @@ mt7531_create_sgmii(struct mt7530_priv *
@@ -3214,7 +3219,7 @@ mt7531_create_sgmii(struct mt7530_priv *
mt7531_pcs_config[i]->lock_arg = &priv->bus->mdio_lock;
regmap = devm_regmap_init(priv->dev,
@@ -174,7 +174,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mt7531_pcs_config[i]);
if (IS_ERR(regmap)) {
ret = PTR_ERR(regmap);
@@ -3191,6 +3196,7 @@ MODULE_DEVICE_TABLE(of, mt7530_of_match)
@@ -3380,6 +3385,7 @@ MODULE_DEVICE_TABLE(of, mt7530_of_match)
static int
mt7530_probe(struct mdio_device *mdiodev)
{
@@ -182,7 +182,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct mt7530_priv *priv;
struct device_node *dn;
@@ -3270,6 +3276,21 @@ mt7530_probe(struct mdio_device *mdiodev
@@ -3459,6 +3465,21 @@ mt7530_probe(struct mdio_device *mdiodev
mutex_init(&priv->reg_mutex);
dev_set_drvdata(&mdiodev->dev, priv);
@@ -206,7 +206,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/dsa/mt7530.h
+++ b/drivers/net/dsa/mt7530.h
@@ -774,6 +774,7 @@ struct mt753x_info {
@@ -785,6 +785,7 @@ struct mt753x_info {
* @dev: The device pointer
* @ds: The pointer to the dsa core structure
* @bus: The bus used for the device and built-in PHY
@@ -214,7 +214,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
* @rstc: The pointer to reset control used by MCM
* @core_pwr: The power supplied into the core
* @io_pwr: The power supplied into the I/O
@@ -794,6 +795,7 @@ struct mt7530_priv {
@@ -805,6 +806,7 @@ struct mt7530_priv {
struct device *dev;
struct dsa_switch *ds;
struct mii_bus *bus;

View File

@@ -18,7 +18,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -3077,12 +3077,6 @@ mt753x_setup(struct dsa_switch *ds)
@@ -3265,12 +3265,6 @@ mt753x_setup(struct dsa_switch *ds)
if (ret && priv->irq)
mt7530_free_irq_common(priv);
@@ -31,7 +31,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return ret;
}
@@ -3199,6 +3193,7 @@ mt7530_probe(struct mdio_device *mdiodev
@@ -3388,6 +3382,7 @@ mt7530_probe(struct mdio_device *mdiodev
static struct regmap_config *regmap_config;
struct mt7530_priv *priv;
struct device_node *dn;
@@ -39,7 +39,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
dn = mdiodev->dev.of_node;
@@ -3291,6 +3286,12 @@ mt7530_probe(struct mdio_device *mdiodev
@@ -3480,6 +3475,12 @@ mt7530_probe(struct mdio_device *mdiodev
if (IS_ERR(priv->regmap))
return PTR_ERR(priv->regmap);

View File

@@ -114,7 +114,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
static void
@@ -646,14 +650,13 @@ static int
@@ -660,14 +664,13 @@ static int
mt7531_ind_c45_phy_read(struct mt7530_priv *priv, int port, int devad,
int regnum)
{
@@ -130,7 +130,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val,
!(val & MT7531_PHY_ACS_ST), 20, 100000);
@@ -686,7 +689,7 @@ mt7531_ind_c45_phy_read(struct mt7530_pr
@@ -700,7 +703,7 @@ mt7531_ind_c45_phy_read(struct mt7530_pr
ret = val & MT7531_MDIO_RW_DATA_MASK;
out:
@@ -139,7 +139,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return ret;
}
@@ -695,14 +698,13 @@ static int
@@ -709,14 +712,13 @@ static int
mt7531_ind_c45_phy_write(struct mt7530_priv *priv, int port, int devad,
int regnum, u32 data)
{
@@ -155,7 +155,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val,
!(val & MT7531_PHY_ACS_ST), 20, 100000);
@@ -734,7 +736,7 @@ mt7531_ind_c45_phy_write(struct mt7530_p
@@ -748,7 +750,7 @@ mt7531_ind_c45_phy_write(struct mt7530_p
}
out:
@@ -164,7 +164,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return ret;
}
@@ -742,14 +744,13 @@ out:
@@ -756,14 +758,13 @@ out:
static int
mt7531_ind_c22_phy_read(struct mt7530_priv *priv, int port, int regnum)
{
@@ -180,7 +180,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val,
!(val & MT7531_PHY_ACS_ST), 20, 100000);
@@ -772,7 +773,7 @@ mt7531_ind_c22_phy_read(struct mt7530_pr
@@ -786,7 +787,7 @@ mt7531_ind_c22_phy_read(struct mt7530_pr
ret = val & MT7531_MDIO_RW_DATA_MASK;
out:
@@ -189,7 +189,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return ret;
}
@@ -781,14 +782,13 @@ static int
@@ -795,14 +796,13 @@ static int
mt7531_ind_c22_phy_write(struct mt7530_priv *priv, int port, int regnum,
u16 data)
{
@@ -205,7 +205,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ret = readx_poll_timeout(_mt7530_unlocked_read, &p, reg,
!(reg & MT7531_PHY_ACS_ST), 20, 100000);
@@ -810,7 +810,7 @@ mt7531_ind_c22_phy_write(struct mt7530_p
@@ -824,7 +824,7 @@ mt7531_ind_c22_phy_write(struct mt7530_p
}
out:
@@ -214,7 +214,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return ret;
}
@@ -1162,7 +1162,6 @@ static int
@@ -1344,7 +1344,6 @@ static int
mt7530_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
{
struct mt7530_priv *priv = ds->priv;
@@ -222,7 +222,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int length;
u32 val;
@@ -1173,7 +1172,7 @@ mt7530_port_change_mtu(struct dsa_switch
@@ -1355,7 +1354,7 @@ mt7530_port_change_mtu(struct dsa_switch
if (!dsa_is_cpu_port(ds, port))
return 0;
@@ -231,7 +231,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
val = mt7530_mii_read(priv, MT7530_GMACCR);
val &= ~MAX_RX_PKT_LEN_MASK;
@@ -1194,7 +1193,7 @@ mt7530_port_change_mtu(struct dsa_switch
@@ -1376,7 +1375,7 @@ mt7530_port_change_mtu(struct dsa_switch
mt7530_mii_write(priv, MT7530_GMACCR, val);
@@ -240,7 +240,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return 0;
}
@@ -1990,10 +1989,10 @@ mt7530_irq_thread_fn(int irq, void *dev_
@@ -2172,10 +2171,10 @@ mt7530_irq_thread_fn(int irq, void *dev_
u32 val;
int p;
@@ -253,7 +253,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
for (p = 0; p < MT7530_NUM_PHYS; p++) {
if (BIT(p) & val) {
@@ -2029,7 +2028,7 @@ mt7530_irq_bus_lock(struct irq_data *d)
@@ -2211,7 +2210,7 @@ mt7530_irq_bus_lock(struct irq_data *d)
{
struct mt7530_priv *priv = irq_data_get_irq_chip_data(d);
@@ -262,7 +262,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
static void
@@ -2038,7 +2037,7 @@ mt7530_irq_bus_sync_unlock(struct irq_da
@@ -2220,7 +2219,7 @@ mt7530_irq_bus_sync_unlock(struct irq_da
struct mt7530_priv *priv = irq_data_get_irq_chip_data(d);
mt7530_mii_write(priv, MT7530_SYS_INT_EN, priv->irq_enable);

View File

@@ -21,7 +21,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -951,6 +951,24 @@ mt7530_set_ageing_time(struct dsa_switch
@@ -965,6 +965,24 @@ mt7530_set_ageing_time(struct dsa_switch
return 0;
}
@@ -48,7 +48,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct mt7530_priv *priv = ds->priv;
--- a/drivers/net/dsa/mt7530.h
+++ b/drivers/net/dsa/mt7530.h
@@ -709,24 +709,6 @@ enum p5_interface_select {
@@ -720,24 +720,6 @@ enum p5_interface_select {
P5_INTF_SEL_GMAC5_SGMII,
};

View File

@@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -3205,44 +3205,21 @@ static const struct of_device_id mt7530_
@@ -3394,44 +3394,21 @@ static const struct of_device_id mt7530_
MODULE_DEVICE_TABLE(of, mt7530_of_match);
static int
@@ -67,7 +67,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (!priv->info)
return -EINVAL;
@@ -3256,23 +3233,53 @@ mt7530_probe(struct mdio_device *mdiodev
@@ -3445,23 +3422,53 @@ mt7530_probe(struct mdio_device *mdiodev
return -EINVAL;
priv->id = priv->info->id;
@@ -131,7 +131,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
priv->reset = devm_gpiod_get_optional(&mdiodev->dev, "reset",
GPIOD_OUT_LOW);
if (IS_ERR(priv->reset)) {
@@ -3281,12 +3288,15 @@ mt7530_probe(struct mdio_device *mdiodev
@@ -3470,12 +3477,15 @@ mt7530_probe(struct mdio_device *mdiodev
}
}

View File

@@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -3323,6 +3323,17 @@ mt7530_probe(struct mdio_device *mdiodev
@@ -3512,6 +3512,17 @@ mt7530_probe(struct mdio_device *mdiodev
}
static void
@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mt7530_remove(struct mdio_device *mdiodev)
{
struct mt7530_priv *priv = dev_get_drvdata(&mdiodev->dev);
@@ -3341,16 +3352,11 @@ mt7530_remove(struct mdio_device *mdiode
@@ -3530,16 +3541,11 @@ mt7530_remove(struct mdio_device *mdiode
dev_err(priv->dev, "Failed to disable io pwr: %d\n",
ret);

View File

@@ -416,7 +416,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static u32
mt7530_mii_read(struct mt7530_priv *priv, u32 reg)
{
@@ -3003,72 +2954,6 @@ static const struct phylink_pcs_ops mt75
@@ -3191,72 +3142,6 @@ static const struct phylink_pcs_ops mt75
.pcs_an_restart = mt7530_pcs_an_restart,
};
@@ -489,7 +489,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int
mt753x_setup(struct dsa_switch *ds)
{
@@ -3127,7 +3012,7 @@ static int mt753x_set_mac_eee(struct dsa
@@ -3315,7 +3200,7 @@ static int mt753x_set_mac_eee(struct dsa
return 0;
}
@@ -497,8 +497,8 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
+const struct dsa_switch_ops mt7530_switch_ops = {
.get_tag_protocol = mtk_get_tag_protocol,
.setup = mt753x_setup,
.get_strings = mt7530_get_strings,
@@ -3161,8 +3046,9 @@ static const struct dsa_switch_ops mt753
.preferred_default_local_cpu_port = mt753x_preferred_default_local_cpu_port,
@@ -3350,8 +3235,9 @@ static const struct dsa_switch_ops mt753
.get_mac_eee = mt753x_get_mac_eee,
.set_mac_eee = mt753x_set_mac_eee,
};
@@ -509,7 +509,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
[ID_MT7621] = {
.id = ID_MT7621,
.pcs_ops = &mt7530_pcs_ops,
@@ -3195,16 +3081,9 @@ static const struct mt753x_info mt753x_t
@@ -3384,16 +3270,9 @@ static const struct mt753x_info mt753x_t
.mac_port_config = mt7531_mac_config,
},
};
@@ -528,7 +528,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mt7530_probe_common(struct mt7530_priv *priv)
{
struct device *dev = priv->dev;
@@ -3241,88 +3120,9 @@ mt7530_probe_common(struct mt7530_priv *
@@ -3430,88 +3309,9 @@ mt7530_probe_common(struct mt7530_priv *
return 0;
}
@@ -619,7 +619,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mt7530_remove_common(struct mt7530_priv *priv)
{
if (priv->irq)
@@ -3333,57 +3133,6 @@ mt7530_remove_common(struct mt7530_priv
@@ -3522,57 +3322,6 @@ mt7530_remove_common(struct mt7530_priv
mutex_destroy(&priv->reg_mutex);
}
@@ -679,7 +679,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
MODULE_LICENSE("GPL");
--- a/drivers/net/dsa/mt7530.h
+++ b/drivers/net/dsa/mt7530.h
@@ -834,4 +834,10 @@ static inline void INIT_MT7530_DUMMY_POL
@@ -845,4 +845,10 @@ static inline void INIT_MT7530_DUMMY_POL
p->reg = reg;
}

View File

@@ -184,7 +184,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
+MODULE_LICENSE("GPL");
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2037,6 +2037,47 @@ static const struct irq_domain_ops mt753
@@ -2219,6 +2219,47 @@ static const struct irq_domain_ops mt753
};
static void
@@ -232,7 +232,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mt7530_setup_mdio_irq(struct mt7530_priv *priv)
{
struct dsa_switch *ds = priv->ds;
@@ -2070,8 +2111,15 @@ mt7530_setup_irq(struct mt7530_priv *pri
@@ -2252,8 +2293,15 @@ mt7530_setup_irq(struct mt7530_priv *pri
return priv->irq ? : -EINVAL;
}
@@ -250,7 +250,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (!priv->irq_domain) {
dev_err(dev, "failed to create IRQ domain\n");
return -ENOMEM;
@@ -2566,6 +2614,25 @@ static void mt7531_mac_port_get_caps(str
@@ -2754,6 +2802,25 @@ static void mt7531_mac_port_get_caps(str
}
}
@@ -276,7 +276,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int
mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state)
{
@@ -2642,6 +2709,17 @@ static bool mt753x_is_mac_port(u32 port)
@@ -2830,6 +2897,17 @@ static bool mt753x_is_mac_port(u32 port)
}
static int
@@ -294,7 +294,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
phy_interface_t interface)
{
@@ -2711,7 +2789,8 @@ mt753x_phylink_mac_config(struct dsa_swi
@@ -2899,7 +2977,8 @@ mt753x_phylink_mac_config(struct dsa_swi
switch (port) {
case 0 ... 4: /* Internal phy */
@@ -304,7 +304,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
goto unsupported;
break;
case 5: /* 2nd cpu port with phy of port 0 or 4 / external phy */
@@ -2789,7 +2868,8 @@ static void mt753x_phylink_mac_link_up(s
@@ -2977,7 +3056,8 @@ static void mt753x_phylink_mac_link_up(s
/* MT753x MAC works in 1G full duplex mode for all up-clocked
* variants.
*/
@@ -314,7 +314,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
(phy_interface_mode_is_8023z(interface))) {
speed = SPEED_1000;
duplex = DUPLEX_FULL;
@@ -2869,6 +2949,21 @@ mt7531_cpu_port_config(struct dsa_switch
@@ -3057,6 +3137,21 @@ mt7531_cpu_port_config(struct dsa_switch
return 0;
}
@@ -336,7 +336,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void mt753x_phylink_get_caps(struct dsa_switch *ds, int port,
struct phylink_config *config)
{
@@ -3014,6 +3109,27 @@ static int mt753x_set_mac_eee(struct dsa
@@ -3202,6 +3297,27 @@ static int mt753x_set_mac_eee(struct dsa
return 0;
}
@@ -364,7 +364,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
const struct dsa_switch_ops mt7530_switch_ops = {
.get_tag_protocol = mtk_get_tag_protocol,
.setup = mt753x_setup,
@@ -3082,6 +3198,17 @@ const struct mt753x_info mt753x_table[]
@@ -3271,6 +3387,17 @@ const struct mt753x_info mt753x_table[]
.mac_port_get_caps = mt7531_mac_port_get_caps,
.mac_port_config = mt7531_mac_config,
},
@@ -392,9 +392,9 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
#define NUM_TRGMII_CTRL 5
@@ -54,11 +55,11 @@ enum mt753x_id {
#define MT7531_MIRROR_PORT_SET(x) (((x) & MIRROR_MASK) << 16)
@@ -59,11 +60,11 @@ enum mt753x_id {
#define MT7531_CPU_PMAP_MASK GENMASK(7, 0)
#define MT7531_CPU_PMAP(x) FIELD_PREP(MT7531_CPU_PMAP_MASK, x)
-#define MT753X_MIRROR_REG(id) (((id) == ID_MT7531) ? \
+#define MT753X_MIRROR_REG(id) ((((id) == ID_MT7531) || ((id) == ID_MT7988)) ? \
@@ -407,7 +407,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
MT7531_MIRROR_MASK : MIRROR_MASK)
/* Registers for BPDU and PAE frame control*/
@@ -322,9 +323,8 @@ enum mt7530_vlan_port_acc_frm {
@@ -332,9 +333,8 @@ enum mt7530_vlan_port_acc_frm {
MT7531_FORCE_DPX | \
MT7531_FORCE_RX_FC | \
MT7531_FORCE_TX_FC)

View File

@@ -73,7 +73,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -3076,6 +3076,12 @@ mt753x_setup(struct dsa_switch *ds)
@@ -3264,6 +3264,12 @@ mt753x_setup(struct dsa_switch *ds)
if (ret && priv->irq)
mt7530_free_irq_common(priv);
@@ -88,7 +88,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/mt7530.h
+++ b/drivers/net/dsa/mt7530.h
@@ -768,10 +768,10 @@ struct mt753x_info {
@@ -779,10 +779,10 @@ struct mt753x_info {
* registers
* @p6_interface Holding the current port 6 interface
* @p5_intf_sel: Holding the current port 5 interface select
@@ -100,7 +100,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
*/
struct mt7530_priv {
struct device *dev;
@@ -790,7 +790,6 @@ struct mt7530_priv {
@@ -801,7 +801,6 @@ struct mt7530_priv {
unsigned int p5_intf_sel;
u8 mirror_rx;
u8 mirror_tx;
@@ -108,7 +108,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct mt7530_port ports[MT7530_NUM_PORTS];
struct mt753x_pcs pcs[MT7530_NUM_PORTS];
/* protect among processes for registers access*/
@@ -798,6 +797,7 @@ struct mt7530_priv {
@@ -809,6 +808,7 @@ struct mt7530_priv {
int irq;
struct irq_domain *irq_domain;
u32 irq_enable;

View File

@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ax88179_reset(dev);
@@ -1507,17 +1508,19 @@ ax88179_tx_fixup(struct usbnet *dev, str
@@ -1502,17 +1503,19 @@ ax88179_tx_fixup(struct usbnet *dev, str
{
u32 tx_hdr1, tx_hdr2;
int frame_size = dev->maxpacket;
@@ -57,7 +57,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if ((skb_header_cloned(skb) || headroom < 0) &&
pskb_expand_head(skb, headroom < 0 ? 8 : 0, 0, GFP_ATOMIC)) {
dev_kfree_skb_any(skb);
@@ -1528,6 +1531,8 @@ ax88179_tx_fixup(struct usbnet *dev, str
@@ -1523,6 +1526,8 @@ ax88179_tx_fixup(struct usbnet *dev, str
put_unaligned_le32(tx_hdr1, ptr);
put_unaligned_le32(tx_hdr2, ptr + 4);

View File

@@ -17,7 +17,7 @@ Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -2287,6 +2287,23 @@ struct btmtk_section_map {
@@ -2289,6 +2289,23 @@ struct btmtk_section_map {
};
} __packed;
@@ -41,7 +41,7 @@ Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
static void btusb_mtk_wmt_recv(struct urb *urb)
{
struct hci_dev *hdev = urb->context;
@@ -3941,6 +3958,7 @@ static int btusb_probe(struct usb_interf
@@ -3943,6 +3960,7 @@ static int btusb_probe(struct usb_interf
hdev->shutdown = btusb_mtk_shutdown;
hdev->manufacturer = 70;
hdev->cmd_timeout = btusb_mtk_cmd_timeout;

View File

@@ -18,7 +18,7 @@ Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -2292,7 +2292,7 @@ static int btusb_set_bdaddr_mtk(struct h
@@ -2294,7 +2294,7 @@ static int btusb_set_bdaddr_mtk(struct h
struct sk_buff *skb;
long ret;

View File

@@ -58,7 +58,7 @@ Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -476,6 +476,9 @@ static const struct usb_device_id blackl
@@ -478,6 +478,9 @@ static const struct usb_device_id blackl
{ USB_DEVICE(0x13d3, 0x3564), .driver_info = BTUSB_MEDIATEK |
BTUSB_WIDEBAND_SPEECH |
BTUSB_VALID_LE_STATES },

Some files were not shown because too many files have changed in this diff Show More