# Microchip SAMA7G54-EK kernel configuration fixups
define MICROCHIP_SAMA7G54_EK_LINUX_CONFIG_FIXUPS
	# AT91/Microchip SoC
	$(call KCONFIG_ENABLE_OPT,CONFIG_ARCH_AT91)
	$(call KCONFIG_ENABLE_OPT,CONFIG_SOC_SAMA7G5)
	$(call KCONFIG_ENABLE_OPT,CONFIG_ATMEL_CLOCKSOURCE_TCB)

	# Serial console (FLEXCOM)
	# Use ttyAT naming to avoid major/minor conflict with the
	# 8250 driver (needed by Raspberry Pi 2 in the shared ARM config)
	$(call KCONFIG_ENABLE_OPT,CONFIG_SERIAL_ATMEL)
	$(call KCONFIG_ENABLE_OPT,CONFIG_SERIAL_ATMEL_CONSOLE)
	$(call KCONFIG_ENABLE_OPT,CONFIG_SERIAL_ATMEL_TTYAT)
	$(call KCONFIG_ENABLE_OPT,CONFIG_MFD_ATMEL_FLEXCOM)

	# Network: MACB Ethernet
	$(call KCONFIG_ENABLE_OPT,CONFIG_NET_VENDOR_MICROCHIP)
	$(call KCONFIG_ENABLE_OPT,CONFIG_MACB)
	$(call KCONFIG_ENABLE_OPT,CONFIG_MICREL_PHY)

	# MMC/SD
	$(call KCONFIG_ENABLE_OPT,CONFIG_MMC_SDHCI)
	$(call KCONFIG_ENABLE_OPT,CONFIG_MMC_SDHCI_PLTFM)
	$(call KCONFIG_ENABLE_OPT,CONFIG_MMC_SDHCI_OF_AT91)

	# Pin control and GPIO
	$(call KCONFIG_ENABLE_OPT,CONFIG_PINCTRL_AT91)
	$(call KCONFIG_ENABLE_OPT,CONFIG_PINCTRL_AT91PIO4)
	$(call KCONFIG_ENABLE_OPT,CONFIG_GPIO_SYSFS)

	# I2C and SPI
	$(call KCONFIG_ENABLE_OPT,CONFIG_I2C_AT91)
	$(call KCONFIG_ENABLE_OPT,CONFIG_SPI_ATMEL)
	$(call KCONFIG_ENABLE_OPT,CONFIG_SPI_ATMEL_QUADSPI)

	# Power management and reset
	$(call KCONFIG_ENABLE_OPT,CONFIG_POWER_RESET)
	$(call KCONFIG_ENABLE_OPT,CONFIG_POWER_RESET_AT91_RESET)
	$(call KCONFIG_ENABLE_OPT,CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC)

	# Watchdog
	$(call KCONFIG_ENABLE_OPT,CONFIG_WATCHDOG)
	$(call KCONFIG_ENABLE_OPT,CONFIG_SAMA5D4_WATCHDOG)

	# DMA and RTC
	$(call KCONFIG_ENABLE_OPT,CONFIG_AT_XDMAC)
	$(call KCONFIG_ENABLE_OPT,CONFIG_RTC_CLASS)
	$(call KCONFIG_ENABLE_OPT,CONFIG_RTC_DRV_AT91SAM9)

	# Crypto hardware acceleration
	$(call KCONFIG_ENABLE_OPT,CONFIG_CRYPTO_DEV_ATMEL_AES)
	$(call KCONFIG_ENABLE_OPT,CONFIG_CRYPTO_DEV_ATMEL_TDES)
	$(call KCONFIG_ENABLE_OPT,CONFIG_CRYPTO_DEV_ATMEL_SHA)

	# USB Host
	$(call KCONFIG_ENABLE_OPT,CONFIG_USB_EHCI_HCD)
	$(call KCONFIG_ENABLE_OPT,CONFIG_USB_OHCI_HCD)

	# Regulators
	$(call KCONFIG_ENABLE_OPT,CONFIG_REGULATOR)
	$(call KCONFIG_ENABLE_OPT,CONFIG_REGULATOR_FIXED_VOLTAGE)
	$(call KCONFIG_ENABLE_OPT,CONFIG_REGULATOR_MCP16502)

	# NVMEM for OTP
	$(call KCONFIG_ENABLE_OPT,CONFIG_NVMEM_MICROCHIP_OTPC)
endef

$(eval $(ix-board))
$(eval $(generic-package))
