#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#

if ARCH_CHIP_EZ80

# Chip capabilities

config ARCH_EZ80_HAVE_PLL
	bool
	default n

config ARCH_EZ80_HAVE_ETHERNET
	bool
	default n

config ARCH_EZ80_HAVE_UART2
	bool
	default n

config ARCH_EZ80_HAVE_TIMER_INTREGS
	bool
	default n

# Chip selection

choice
	prompt "eZ80 Chip Selection"
	default ARCH_CHIP_EZ80F91

config ARCH_CHIP_EZ80F91
	bool "EZ80F91"
	select ARCH_EZ80_HAVE_PLL
	select ARCH_EZ80_HAVE_ETHERNET
	select ARCH_EZ80_HAVE_UART2
	select ARCH_EZ80_HAVE_TIMER_INTREGS
	---help---
		ZiLOG EZ80F91 (ez80 Acclaim)

config ARCH_CHIP_EZ80F92
	bool "EZ80F92"
	---help---
		ZiLOG EZ80F92 (ez80 Acclaim)

config ARCH_CHIP_EZ80F93
	bool "EZ80F93"
	---help---
		ZiLOG EZ80F93 (ez80 Acclaim)

endchoice

# The ZiLOG ZDS-II Windows toolchain is the only toolchain available for
# the ez80.
#

config EZ80_TOOLCHAIN_ZDSII
	bool
	default y

choice
	prompt "ZDS-II Toolchain version"
	default EZ80_ZDSII_V533

config EZ80_ZDSII_V511
	bool "ZDS-II 5.1.1"

config EZ80_ZDSII_V521
	bool "ZDS-II 5.2.1"

config EZ80_ZDSII_V530
	bool "ZDS-II 5.3.0"

config EZ80_ZDSII_V533
	bool "ZDS-II 5.3.3"

endchoice # ZDS-II Toolchain version

# Build type selection

config EZ80_BOOTLOADER
	bool
	default n
	select BOOT_RUNFROMFLASH
	---help---
		Binary image is a bootloader that may require special properties
		such as re-direction of interrupts (eZ80F92)

config EZ80_PROGRAM
	bool
	default n
	select CONFIG_BOOT_RUNFROMEXTSRAM
	---help---
		Binary image is a RAM-resident program loaded by a bootloader and
		may require special properties such as re-direction of interrupts
		(eZ80F92)

# Peripheral selection

config EZ80_UART
	bool
	default n

menu "ez80 Peripheral Support"

config EZ80_UART0
	bool "UART0"
	select EZ80_UART
	select UART0_SERIALDRIVER
	default n

config EZ80_UART1
	bool "UART1"
	select EZ80_UART
	select UART1_SERIALDRIVER
	default n

config EZ80_UART2
	bool "UART2"
	select EZ80_UART
	select UART2_SERIALDRIVER
	default n
	depends on ARCH_EZ80_HAVE_UART2

config EZ80_I2C
	bool "I2C"
	default n

config EZ80_SPI
	bool "SPI"
	default n

config EZ80_RTC
	bool "RTC"
	default n
	select RTC
	select RTC_DATETIME

config EZ80_EMAC
	bool "Ethernet MAC"
	default n
	select ARCH_HAVE_PHY
	select ARCH_HAVE_NETDEV_STATISTICS
	depends on ARCH_EZ80_HAVE_ETHERNET
	---help---
		Enables support for ez80 EMAC driver.

endmenu # ez80 Peripheral Support

# UART Configuration

choice
	prompt "UART Rx FIFO depth"
	default EZ80_UART_RXFIFO_1 if ARCH_CHIP_EZ80F92 || ARCH_CHIP_EZ80F93
	default EZ80_UART_RXFIFO_4 if ARCH_CHIP_EZ80F91
	depends on EZ80_UART

config EZ80_UART_RXFIFO_1
	bool "1"

config EZ80_UART_RXFIFO_4
	bool "4"

config EZ80_UART_RXFIFO_8
	bool "8"

config EZ80_UART_RXFIFO_14
	bool "14"

endchoice

# RTC/Crystal Configuration

config EZ80_RTC_32KHZ
	bool "32KHz crystal present"
	default y
	depends on EZ80_RTC
	---help---
		If there is no 32Hz crystal, the RTC will fall back to use the line
		frequency.

config EZ80_RTC_LINEFREQ50
	bool "50Hz line frequency"
	default n
	depends on EZ80_RTC && !EZ80_RTC_32KHZ
	---help---
		If there is no 32Hz crystal, the RTC will fall back to use the line
		frequency, either 50 or 60Hz.

# EMAC Configuration

if EZ80_EMAC

config EZ80_FIAD
	hex "PHY Address"
	range 0x00 0x1f
	default 0x1f
	---help---
		Provides the MII address of the PHY device

# Belongs in net/Kconfig as PHY_AM79C874
# ETH0_PHY_AM79C874 - Define for Am79c874 PHY

config EZ80_PHYCONFIG
	int "PHY Configuration"
	default 0
	---help---
		0:Autonegotiate, 1:100FD, 2:100HD, 3:10FD, 4:10HD

config EZ80_PKTBUFSIZE
	int "Packet Buffer Size"
	default 64
	---help---
		The size of one packet buffer. EZ80_PKTBUFSIZE + (EZ80_NTXPKTBUFS+EZ80_NRXPKTBUFS)
		must add up to exactly 8192 bytes.

config EZ80_NTXPKTBUFS
	int "Number of Tx Packets"
	default 64
	---help---
		The number of Tx packets. EZ80_PKTBUFSIZE + (EZ80_NTXPKTBUFS+EZ80_NRXPKTBUFS)
		must add up to exactly 8192 bytes.

config EZ80_NRXPKTBUFS
	int "Number of Rx Packets"
	default 64
	---help---
		The number of Rx packets. EZ80_PKTBUFSIZE + (EZ80_NTXPKTBUFS+EZ80_NRXPKTBUFS)
		must add up to exactly 8192 bytes.

config EZ80_MDCDIV
	int "SCLK Divider"
	default 0
	---help---
		The value to use for the divider to derive the MII MDC clock from SCLK.  Options
		are 1->4; 2->6; 3->8; 4->10; 5->14; 6->20; and 7->28

config EZ80_TXPOLLTIMERMS
	int "Tx Poll Milliseconds"
	default 10
	---help---
		Specifies how often the EMAC controller should poll for a Tx packet (milliseconds)

config ARCH_MCFILTER
	bool "Multicast Filtering"
	default n
	---help---
		Enables multicast MAC address filtering (not fully implemented)

endif # EZ80_EMAC

# System integration

config ARCH_TIMERHOOK
	bool "Timer Hook"
	default n
	---help---
		Select this option to enabled a direct call-out from the ez80 timer interrupt
		handler.  If this is enabled, the ez80 timer interrupt interrupt will call a
		user provided function called up_timerhook().  At present, this timer hook is
		only used for driving the segment LED on board certain ez80 boards.

endif # ARCH_CHIP_EZ80
