# SPDX-License-Identifier: GPL-2.0-only
#
# Micrel device configuration
#

config NET_VENDOR_MICREL
	bool "Micrel devices"
	default y
	depends on (HAS_IOMEM && DMA_ENGINE) || SPI || PCI || HAS_IOMEM
	---help---
	  If you have a network (Ethernet) card belonging to this class, say Y.

	  Note that the answer to this question doesn't directly affect the
	  kernel: saying N will just cause the configurator to skip all
	  the questions about Micrel devices. If you say Y, you will be asked
	  for your specific card in the following questions.

if NET_VENDOR_MICREL

config KS8842
	tristate "Micrel KSZ8841/42 with generic bus interface"
	depends on HAS_IOMEM && DMA_ENGINE
	---help---
	  This platform driver is for KSZ8841(1-port) / KS8842(2-port)
	  ethernet switch chip (managed, VLAN, QoS) from Micrel or
	  Timberdale(FPGA).

config KS8851
	tristate "Micrel KS8851 SPI"
	depends on SPI
	select MII
	select CRC32
	select EEPROM_93CX6
	---help---
	  SPI driver for Micrel KS8851 SPI attached network chip.

config KS8851_MLL
	tristate "Micrel KS8851 MLL"
	depends on HAS_IOMEM
	select MII
	---help---
	  This platform driver is for Micrel KS8851 Address/data bus
	  multiplexed network chip.

config KSZ884X_PCI
	tristate "Micrel KSZ8841/2 PCI"
	depends on PCI
	select MII
	select CRC32
	---help---
	  This PCI driver is for Micrel KSZ8841/KSZ8842 PCI Ethernet chip.

	  To compile this driver as a module, choose M here. The module
	  will be called ksz884x.

config KSZ_PTP
	bool "1588 PTP support"
	depends on KSZ8462_HLI || HAVE_KSZ8463 || HAVE_KSZ9897
	default y
	help
	  Enable 1588 PTP support.

config KSZ_STP
	bool "STP support"
	depends on KSZ8462_HLI || KSZ_SWITCH
	default y
	help
	  Enable STP support.

menuconfig KSZ_SWITCHES
	tristate "Drivers for Microchip KSZ switches"
	help
	  Supports Microchip KSZ switches.

if KSZ_SWITCHES

comment "Microchip KSZ switch device drivers"

config KSZ_SWITCH
	bool
	default n

config KSZ_SWITCH_EMBEDDED
	bool
	default n
	select KSZ_SWITCH

config HAVE_KSZ9897
	bool
	default n

config I2C_KSZ9897
	tristate "I2C driver for Microchip KSZ9897 switch"
	select KSZ_SWITCH
	select HAVE_KSZ9897
	help
	  Supports the Microchip KSZ9897 switch in I2C mode.

config SPI_KSZ9897
	tristate "SPI driver for Microchip KSZ9897 switch"
	select KSZ_SWITCH
	select HAVE_KSZ9897
	help
	  Supports the Microchip KSZ9897 switch in SPI mode.

config IBA_KSZ9897
	bool "IBA driver for Microchip KSZ9897 switch"
	depends on I2C_KSZ9897 = n && SPI_KSZ9897 = n
	select KSZ_SWITCH_EMBEDDED
	select KSZ_IBA
	select HAVE_KSZ9897
	help
	  Supports the Microchip KSZ9897 switch in IBA mode.

config KSZ_IBA
	bool "IBA support"
	depends on HAVE_KSZ9897
	default y
	help
	  Enable IBA support.

config KSZ_AVB
	bool "AVB support"
	depends on HAVE_KSZ9897
	default y
	help
	  Enable AVB support.

config KSZ_MRP
	bool "MRP support"
	depends on KSZ_SWITCH && HAVE_KSZ9897
	default y if (HAVE_KSZ9897)
	help
	  Enable MRP support.

config KSZ_MSRP
	bool "MSRP support"
	depends on KSZ_MRP && KSZ_AVB
	default y
	help
	  Enable MSRP support.

config KSZ_MSTP
	bool "MSTP support"
	depends on HAVE_KSZ9897
	select KSZ_STP
	select CRYPTO_HMAC
	select CRYPTO_MD5
	default n
	help
	  Enable MSTP support.

config KSZ_DLR
	bool "DLR support"
	depends on (HAVE_KSZ9897 || HAVE_KSZ8795) && KSZ_SWITCH
	default y if (HAVE_KSZ9897)
	help
	  Enable DLR support.

config KSZ_HSR
	bool "HSR support"
	depends on (HAVE_KSZ9897) && KSZ_SWITCH
	default y if (HAVE_KSZ9897)
	help
	  Enable HSR support.

endif
endif # NET_VENDOR_MICREL
