mirror of
				https://github.com/immortalwrt/immortalwrt.git
				synced 2025-10-30 07:49:55 +08:00 
			
		
		
		
	 46a454fb9b
			
		
	
	46a454fb9b
	
	
	
		
			
			Backport upstream patch for AN7583 Ethernet support. While at it also backport some additional fixes required to apply the AN7583 patches cleanly. Refresh all affected patch automatically (aside from the XSI patch that changed the implementation) Link: https://github.com/openwrt/openwrt/pull/20489 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
		
			
				
	
	
		
			53 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			53 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| From 6fbb7d72520393a3d447399799d436f17c03ff24 Mon Sep 17 00:00:00 2001
 | |
| From: Christian Marangi <ansuelsmth@gmail.com>
 | |
| Date: Fri, 17 Jan 2025 10:29:52 +0100
 | |
| Subject: [PATCH 5/9] net: airoha: drop redundant GDM3/4 define
 | |
| 
 | |
| The GDM FWD register are all the same hence it's redundant to have
 | |
| specific define for GDM3 and GDM4. Drop the redundant define and use the
 | |
| generic macro.
 | |
| 
 | |
| Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
 | |
| ---
 | |
|  drivers/net/ethernet/airoha/airoha_eth.c  | 4 ++--
 | |
|  drivers/net/ethernet/airoha/airoha_regs.h | 8 +-------
 | |
|  2 files changed, 3 insertions(+), 9 deletions(-)
 | |
| 
 | |
| --- a/drivers/net/ethernet/airoha/airoha_eth.c
 | |
| +++ b/drivers/net/ethernet/airoha/airoha_eth.c
 | |
| @@ -514,8 +514,8 @@ static int airoha_fe_init(struct airoha_
 | |
|  		      FIELD_PREP(IP_ASSEMBLE_PORT_MASK, 0) |
 | |
|  		      FIELD_PREP(IP_ASSEMBLE_NBQ_MASK, 22));
 | |
|  
 | |
| -	airoha_fe_set(eth, REG_GDM3_FWD_CFG, GDM3_PAD_EN_MASK);
 | |
| -	airoha_fe_set(eth, REG_GDM4_FWD_CFG, GDM4_PAD_EN_MASK);
 | |
| +	airoha_fe_set(eth, REG_GDM_FWD_CFG(3), GDM_PAD_EN);
 | |
| +	airoha_fe_set(eth, REG_GDM_FWD_CFG(4), GDM_PAD_EN);
 | |
|  
 | |
|  	airoha_fe_crsn_qsel_init(eth);
 | |
|  
 | |
| --- a/drivers/net/ethernet/airoha/airoha_regs.h
 | |
| +++ b/drivers/net/ethernet/airoha/airoha_regs.h
 | |
| @@ -128,6 +128,7 @@
 | |
|  	GENMASK(4 + (((_n) % 4) << 3),	(((_n) % 4) << 3))
 | |
|  
 | |
|  #define REG_GDM_FWD_CFG(_n)		GDM_BASE(_n)
 | |
| +#define GDM_PAD_EN			BIT(28)
 | |
|  #define GDM_DROP_CRC_ERR		BIT(23)
 | |
|  #define GDM_IP4_CKSUM			BIT(22)
 | |
|  #define GDM_TCP_CKSUM			BIT(21)
 | |
| @@ -352,13 +353,6 @@
 | |
|  #define MBI_RX_AGE_SEL_MASK		GENMASK(26, 25)
 | |
|  #define MBI_TX_AGE_SEL_MASK		GENMASK(18, 17)
 | |
|  
 | |
| -#define REG_GDM3_FWD_CFG		GDM3_BASE
 | |
| -#define GDM3_PAD_EN_MASK		BIT(28)
 | |
| -
 | |
| -#define REG_GDM4_FWD_CFG		GDM4_BASE
 | |
| -#define GDM4_PAD_EN_MASK		BIT(28)
 | |
| -#define GDM4_SPORT_OFFSET0_MASK		GENMASK(11, 8)
 | |
| -
 | |
|  #define REG_GDM4_SRC_PORT_SET		(GDM4_BASE + 0x23c)
 | |
|  #define GDM4_SPORT_OFF2_MASK		GENMASK(19, 16)
 | |
|  #define GDM4_SPORT_OFF1_MASK		GENMASK(15, 12)
 |