All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] Add en8811h phy driver and devicetree binding doc
@ 2024-02-06 19:47 Eric Woudstra
  2024-02-06 19:47 ` [PATCH net-next 1/2] dt-bindings: net: airoha,en8811h: Add en8811h serdes polarity Eric Woudstra
  2024-02-06 19:47 ` [PATCH net-next 2/2] net: phy: air_en8811h: Add the Airoha EN8811H PHY driver Eric Woudstra
  0 siblings, 2 replies; 12+ messages in thread
From: Eric Woudstra @ 2024-02-06 19:47 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andrew Lunn,
	Heiner Kallweit, Russell King, Matthias Brugger,
	AngeloGioacchino Del Regno, Frank Wunderlich, Daniel Golle,
	Lucien Jheng, Zhi-Jun You
  Cc: netdev, devicetree, Eric Woudstra

Add the Airoha EN8811H 2.5 Gigabit PHY.

The phy supports 100/1000/2500 Mbps with auto negotiation only.

The driver uses two firmware files, for which updated versions are added to
linux-firmware already.

This patch series adds the driver and the devicetree binding documentation.

Eric Woudstra (2):
  dt-bindings: net: airoha,en8811h: Add en8811h serdes polarity
  net: phy: air_en8811h: Add the Airoha EN8811H PHY driver

 .../bindings/net/airoha,en8811h.yaml          |   44 +
 drivers/net/phy/Kconfig                       |    5 +
 drivers/net/phy/Makefile                      |    1 +
 drivers/net/phy/air_en8811h.c                 | 1006 +++++++++++++++++
 4 files changed, 1056 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/airoha,en8811h.yaml
 create mode 100644 drivers/net/phy/air_en8811h.c

-- 
2.42.1


^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: [PATCH net-next 2/2] net: phy: air_en8811h: Add the Airoha EN8811H PHY driver
@ 2024-02-11  0:30 kernel test robot
  0 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2024-02-11  0:30 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20240206194751.1901802-3-ericwouds@gmail.com>
References: <20240206194751.1901802-3-ericwouds@gmail.com>
TO: Eric Woudstra <ericwouds@gmail.com>

Hi Eric,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Eric-Woudstra/dt-bindings-net-airoha-en8811h-Add-en8811h-serdes-polarity/20240207-035021
base:   net-next/main
patch link:    https://lore.kernel.org/r/20240206194751.1901802-3-ericwouds%40gmail.com
patch subject: [PATCH net-next 2/2] net: phy: air_en8811h: Add the Airoha EN8811H PHY driver
:::::: branch date: 4 days ago
:::::: commit date: 4 days ago
config: sh-randconfig-r081-20240211 (https://download.01.org/0day-ci/archive/20240211/202402110805.r1KRiKtL-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 13.2.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202402110805.r1KRiKtL-lkp@intel.com/

smatch warnings:
drivers/net/phy/air_en8811h.c:560 air_led_hw_control_set() error: testing array offset 'index' after use.

vim +/index +560 drivers/net/phy/air_en8811h.c

3fe47bc0b949e7 Eric Woudstra 2024-02-06  550  
3fe47bc0b949e7 Eric Woudstra 2024-02-06  551  static int air_led_hw_control_set(struct phy_device *phydev, u8 index,
3fe47bc0b949e7 Eric Woudstra 2024-02-06  552  				  unsigned long rules)
3fe47bc0b949e7 Eric Woudstra 2024-02-06  553  {
3fe47bc0b949e7 Eric Woudstra 2024-02-06  554  	struct en8811h_priv *priv = phydev->priv;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  555  	u16 on = 0, blink = 0;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  556  	int ret;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  557  
3fe47bc0b949e7 Eric Woudstra 2024-02-06  558  	priv->led[index].rules = rules;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  559  
3fe47bc0b949e7 Eric Woudstra 2024-02-06 @560  	if (index >= EN8811H_LED_COUNT)
3fe47bc0b949e7 Eric Woudstra 2024-02-06  561  		return -EINVAL;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  562  
3fe47bc0b949e7 Eric Woudstra 2024-02-06  563  	if (rules & (BIT(TRIGGER_NETDEV_LINK_10)   | BIT(TRIGGER_NETDEV_LINK))) {
3fe47bc0b949e7 Eric Woudstra 2024-02-06  564  		on |= AIR_PHY_LED_ON_LINK10;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  565  		if (rules & BIT(TRIGGER_NETDEV_RX))
3fe47bc0b949e7 Eric Woudstra 2024-02-06  566  			blink |= AIR_PHY_LED_BLINK_10RX;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  567  		if (rules & BIT(TRIGGER_NETDEV_TX))
3fe47bc0b949e7 Eric Woudstra 2024-02-06  568  			blink |= AIR_PHY_LED_BLINK_10TX;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  569  	}
3fe47bc0b949e7 Eric Woudstra 2024-02-06  570  
3fe47bc0b949e7 Eric Woudstra 2024-02-06  571  	if (rules & (BIT(TRIGGER_NETDEV_LINK_100)  | BIT(TRIGGER_NETDEV_LINK))) {
3fe47bc0b949e7 Eric Woudstra 2024-02-06  572  		on |= AIR_PHY_LED_ON_LINK100;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  573  		if (rules & BIT(TRIGGER_NETDEV_RX))
3fe47bc0b949e7 Eric Woudstra 2024-02-06  574  			blink |= AIR_PHY_LED_BLINK_100RX;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  575  		if (rules & BIT(TRIGGER_NETDEV_TX))
3fe47bc0b949e7 Eric Woudstra 2024-02-06  576  			blink |= AIR_PHY_LED_BLINK_100TX;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  577  	}
3fe47bc0b949e7 Eric Woudstra 2024-02-06  578  
3fe47bc0b949e7 Eric Woudstra 2024-02-06  579  	if (rules & (BIT(TRIGGER_NETDEV_LINK_1000) | BIT(TRIGGER_NETDEV_LINK))) {
3fe47bc0b949e7 Eric Woudstra 2024-02-06  580  		on |= AIR_PHY_LED_ON_LINK1000;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  581  		if (rules & BIT(TRIGGER_NETDEV_RX))
3fe47bc0b949e7 Eric Woudstra 2024-02-06  582  			blink |= AIR_PHY_LED_BLINK_1000RX;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  583  		if (rules & BIT(TRIGGER_NETDEV_TX))
3fe47bc0b949e7 Eric Woudstra 2024-02-06  584  			blink |= AIR_PHY_LED_BLINK_1000TX;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  585  	}
3fe47bc0b949e7 Eric Woudstra 2024-02-06  586  
3fe47bc0b949e7 Eric Woudstra 2024-02-06  587  	if (rules & (BIT(TRIGGER_NETDEV_LINK_2500) | BIT(TRIGGER_NETDEV_LINK))) {
3fe47bc0b949e7 Eric Woudstra 2024-02-06  588  		on |= AIR_PHY_LED_ON_LINK2500;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  589  		if (rules & BIT(TRIGGER_NETDEV_RX))
3fe47bc0b949e7 Eric Woudstra 2024-02-06  590  			blink |= AIR_PHY_LED_BLINK_2500RX;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  591  		if (rules & BIT(TRIGGER_NETDEV_TX))
3fe47bc0b949e7 Eric Woudstra 2024-02-06  592  			blink |= AIR_PHY_LED_BLINK_2500TX;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  593  	}
3fe47bc0b949e7 Eric Woudstra 2024-02-06  594  
3fe47bc0b949e7 Eric Woudstra 2024-02-06  595  	if (on == 0) {
3fe47bc0b949e7 Eric Woudstra 2024-02-06  596  		if (rules & BIT(TRIGGER_NETDEV_RX)) {
3fe47bc0b949e7 Eric Woudstra 2024-02-06  597  			blink |= AIR_PHY_LED_BLINK_10RX   |
3fe47bc0b949e7 Eric Woudstra 2024-02-06  598  				 AIR_PHY_LED_BLINK_100RX  |
3fe47bc0b949e7 Eric Woudstra 2024-02-06  599  				 AIR_PHY_LED_BLINK_1000RX |
3fe47bc0b949e7 Eric Woudstra 2024-02-06  600  				 AIR_PHY_LED_BLINK_2500RX;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  601  		}
3fe47bc0b949e7 Eric Woudstra 2024-02-06  602  		if (rules & BIT(TRIGGER_NETDEV_TX)) {
3fe47bc0b949e7 Eric Woudstra 2024-02-06  603  			blink |= AIR_PHY_LED_BLINK_10TX   |
3fe47bc0b949e7 Eric Woudstra 2024-02-06  604  				 AIR_PHY_LED_BLINK_100TX  |
3fe47bc0b949e7 Eric Woudstra 2024-02-06  605  				 AIR_PHY_LED_BLINK_1000TX |
3fe47bc0b949e7 Eric Woudstra 2024-02-06  606  				 AIR_PHY_LED_BLINK_2500TX;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  607  		}
3fe47bc0b949e7 Eric Woudstra 2024-02-06  608  	}
3fe47bc0b949e7 Eric Woudstra 2024-02-06  609  
3fe47bc0b949e7 Eric Woudstra 2024-02-06  610  	if (rules & BIT(TRIGGER_NETDEV_FULL_DUPLEX))
3fe47bc0b949e7 Eric Woudstra 2024-02-06  611  		on |= AIR_PHY_LED_ON_FDX;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  612  
3fe47bc0b949e7 Eric Woudstra 2024-02-06  613  	if (rules & BIT(TRIGGER_NETDEV_HALF_DUPLEX))
3fe47bc0b949e7 Eric Woudstra 2024-02-06  614  		on |= AIR_PHY_LED_ON_HDX;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  615  
3fe47bc0b949e7 Eric Woudstra 2024-02-06  616  	if (blink || on) {
3fe47bc0b949e7 Eric Woudstra 2024-02-06  617  		/* switch hw-control on, so led-on and led-blink are off */
3fe47bc0b949e7 Eric Woudstra 2024-02-06  618  		clear_bit(AIR_PHY_LED_STATE_FORCE_ON, &priv->led[index].state);
3fe47bc0b949e7 Eric Woudstra 2024-02-06  619  		clear_bit(AIR_PHY_LED_STATE_FORCE_BLINK, &priv->led[index].state);
3fe47bc0b949e7 Eric Woudstra 2024-02-06  620  	} else {
3fe47bc0b949e7 Eric Woudstra 2024-02-06  621  		priv->led[index].rules = 0;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  622  	}
3fe47bc0b949e7 Eric Woudstra 2024-02-06  623  
3fe47bc0b949e7 Eric Woudstra 2024-02-06  624  	ret = phy_modify_mmd(phydev, MDIO_MMD_VEND2, AIR_PHY_LED_ON(index),
3fe47bc0b949e7 Eric Woudstra 2024-02-06  625  			     AIR_PHY_LED_ON_MASK, on);
3fe47bc0b949e7 Eric Woudstra 2024-02-06  626  
3fe47bc0b949e7 Eric Woudstra 2024-02-06  627  	if (ret < 0)
3fe47bc0b949e7 Eric Woudstra 2024-02-06  628  		return ret;
3fe47bc0b949e7 Eric Woudstra 2024-02-06  629  
3fe47bc0b949e7 Eric Woudstra 2024-02-06  630  	return phy_write_mmd(phydev, MDIO_MMD_VEND2, AIR_PHY_LED_BLINK(index),
3fe47bc0b949e7 Eric Woudstra 2024-02-06  631  			     blink);
3fe47bc0b949e7 Eric Woudstra 2024-02-06  632  };
3fe47bc0b949e7 Eric Woudstra 2024-02-06  633  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-02-15 13:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-06 19:47 [PATCH net-next 0/2] Add en8811h phy driver and devicetree binding doc Eric Woudstra
2024-02-06 19:47 ` [PATCH net-next 1/2] dt-bindings: net: airoha,en8811h: Add en8811h serdes polarity Eric Woudstra
2024-02-07  7:52   ` Krzysztof Kozlowski
2024-02-07 16:42     ` Eric Woudstra
2024-02-07 18:40       ` Andrew Lunn
2024-02-15 13:29       ` Rob Herring
2024-02-06 19:47 ` [PATCH net-next 2/2] net: phy: air_en8811h: Add the Airoha EN8811H PHY driver Eric Woudstra
2024-02-06 23:53   ` Russell King (Oracle)
2024-02-07 16:39     ` Eric Woudstra
2024-02-07 19:23       ` Eric Woudstra
2024-02-12  8:17   ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2024-02-11  0:30 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.