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

if ARCH_CHIP_Z180

config ARCH_CHIP_Z80180
	bool

config ARCH_CHIP_Z80181
	bool

config ARCH_CHIP_Z80182
	bool

config ARCH_CHIP_Z80195
	bool

config ARCH_CHIP_Z8L180
	bool

config ARCH_CHIP_Z8L182
	bool

config ARCH_CHIP_Z8S180
	bool

choice
	prompt "Z180 Chip Selection"
	default ARCH_CHIP_Z8018006VSG

config ARCH_CHIP_Z8018006VSG
	bool "Z8018006VSG"
	select ARCH_CHIP_Z80180
	---help---
		Z180: 68-pin PLCC Z80180

config ARCH_CHIP_Z8018010VSG
	bool "Z8018010VSG"
	select ARCH_CHIP_Z80180
	---help---
		Z180: 68-pin PLCC Z80180

config ARCH_CHIP_Z8018008VSG
	bool "Z8018008VSG"
	select ARCH_CHIP_Z80180
	---help---
		Z180: 68-pin PLCC Z80180

config ARCH_CHIP_Z8018010FSG
	bool "Z8018010FSG"
	select ARCH_CHIP_Z80180
	---help---
		Z180: 80-pin QFP (11 pins N/C) Z80180

config ARCH_CHIP_Z8018008VEG
	bool "Z8018008VEG"
	select ARCH_CHIP_Z80180
	---help---
		Z180: 68-pin PLCC Z80180

config ARCH_CHIP_Z8018006VEG
	bool "Z8018006VEG"
	select ARCH_CHIP_Z80180
	---help---
		Z180: 68-pin PLCC Z80180

config ARCH_CHIP_Z8018006PSG
	bool "Z8018006PSG"
	select ARCH_CHIP_Z80180
	---help---
		Z180: 64-pin DIP 6 MHz 5V Z80180

config ARCH_CHIP_Z8018008FSG
	bool "Z8018008FSG"
	select ARCH_CHIP_Z80180
	---help---
		Z180: 80-pin QFP (11 pins N/C) 8MHz 5V Z80180

config ARCH_CHIP_Z8018010PSG
	bool "Z8018010PSG"
	select ARCH_CHIP_Z80180
	---help---
		Z180: 64-pin DIP 10MHz 5V Z80180

config ARCH_CHIP_Z8018006PEG
	bool "Z8018006PEG"
	select ARCH_CHIP_Z80180
	---help---
		Z180: 64-pin DIP 6MHz 5V Z80180

config ARCH_CHIP_Z8018010VEG
	bool "Z8018010VEG"
	select ARCH_CHIP_Z80180
	---help---
		68-pin PLCC 10MHz 5V Z80180

config ARCH_CHIP_Z8018010PEG
	bool "Z8018010PEG"
	select ARCH_CHIP_Z80180
	---help---
		Z180: 64-pin DIP 10MHz 5V Z80180

config ARCH_CHIP_Z8018008PSG
	bool "Z8018008PSG"
	select ARCH_CHIP_Z80180
	---help---
		Z180: 64-pin DIP 8MHz 5V Z80180

config ARCH_CHIP_Z8018006FSG
	bool "Z8018006FSG"
	select ARCH_CHIP_Z80180
	---help---
		Z180: 80-pin QFP (11 pins N/C) 6MHz 5V Z80180

config ARCH_CHIP_Z8018000XSO
	bool "Z8018000XSO"
	select ARCH_CHIP_Z80180

config ARCH_CHIP_Z8018010FEG
	bool "Z8018010FEG"
	select ARCH_CHIP_Z80180

config ARCH_CHIP_Z8018000WSO
	bool "Z8018000WSO"
	select ARCH_CHIP_Z80180

config ARCH_CHIP_Z8018008PEG
	bool "Z8018008PEG"
	select ARCH_CHIP_Z80180

config ARCH_CHIP_Z8018110FEG
	bool "Z8018110FEG"
	select ARCH_CHIP_Z80181
	---help---
		Z180: 100-pin QFP Z80181

config ARCH_CHIP_Z8018233FSG
	bool "Z8018233FSG"
	select ARCH_CHIP_Z80182
	---help---
		100-pin QFP Z80182

config ARCH_CHIP_Z8018220AEG
	bool "Z8018220AEG"
	select ARCH_CHIP_Z80182
	---help---
		Z180: 100-pin LQFP 20MHz 5V Z80182

config ARCH_CHIP_Z8018216FSG
	bool "Z8018216FSG"
	select ARCH_CHIP_Z80182
	---help---
		Z180: 100-pin QFP 16MHz 5V Z80182

config ARCH_CHIP_Z8018216ASG
	bool "Z8018216ASG"
	select ARCH_CHIP_Z80182
	---help---
		Z180: 100-pin LQFP Z80182

config ARCH_CHIP_Z8018233ASG
	bool "Z8018233ASG"
	select ARCH_CHIP_Z80182
	---help---
		Z180: 100-pin LQFP 33MHz 5V Z80182

config ARCH_CHIP_Z8019520FSG
	bool "Z8019520FSG"
	select ARCH_CHIP_Z80195
	---help---
		Z180: 100-pin QFP 20MHz 5V Z80195

config ARCH_CHIP_Z8019533FSG
	bool "Z8019533FSG"
	select ARCH_CHIP_Z80195
	---help---
		Z180: 100-pin QFP 33MHz 5V Z80195

config ARCH_CHIP_Z8L18020VSG
	bool "Z8L18020VSG"
	select ARCH_CHIP_Z8L180
	---help---
		Z180: 68-pinn PLCC Z8L180

config ARCH_CHIP_Z8L18020FSG
	bool "Z8L18020FSG"
	select ARCH_CHIP_Z8L180
	---help---
		Z180: 80-pin GFP 20MHz 3.3V Z8L180

config ARCH_CHIP_Z8L18020PSG
	bool "Z8L18020PSG"
	select ARCH_CHIP_Z8L180

config ARCH_CHIP_Z8L18220ASG
	bool "Z8L18220ASG"
	select ARCH_CHIP_Z8L182
	---help---
		Z180: 100-pin LQFP Z8L182

config ARCH_CHIP_Z8L18220FSG
	bool "Z8L18220FSG"
	select ARCH_CHIP_Z8L182
	---help---
		100-pin QFP 20MHz 3.3V Z8L182

config ARCH_CHIP_Z8L18220AEG
	bool "Z8L18220AEG"
	select ARCH_CHIP_Z8L182

config ARCH_CHIP_Z8S18020VSG
	bool "Z8S18020VSG"
	select ARCH_CHIP_Z8S180
	---help---
		Z180: 68-pin PLCC Z8S180

config ARCH_CHIP_Z8S18020VSG1960
	bool "Z8S18020VSG1960"
	select ARCH_CHIP_Z8S180
	---help---
		Z180: 68-pin PLCC Z8S180

config ARCH_CHIP_Z8S18033VSG
	bool "Z8S18033VSG"
	select ARCH_CHIP_Z8S180
	---help---
		Z180: 68-pin PLCC Z8S180

config ARCH_CHIP_Z8S18010FSG
	bool "Z8S18010FSG"
	select ARCH_CHIP_Z8S180
	---help---
		80-pin QFP Z8S180

config ARCH_CHIP_Z8S18010VEG
	bool "Z8S18010VEG"
	select ARCH_CHIP_Z8S180
	---help---
		Z180: 68-pin PLCC Z8S180

config ARCH_CHIP_Z8S18020VEG
	bool "Z8S18020VEG"
	select ARCH_CHIP_Z8S180
	---help---
		Z180: 68-pin PLCC Z8S180

config ARCH_CHIP_Z8S18010VSG
	bool "Z8S18010VSG"
	select ARCH_CHIP_Z8S180
	---help---
		Z180: 68-pin PLCC Z8S180

config ARCH_CHIP_Z8S18020PSG
	bool "Z8S18020PSG"
	select ARCH_CHIP_Z8S180
	---help---
		64-pin DIP 10Mhz 5V Z8S180

config ARCH_CHIP_Z8S18033FSG
	bool "Z8S18033FSG"
	select ARCH_CHIP_Z8S180
	---help---
		Z180: 80-pin QFP 33MHz 5V Z8S180

config ARCH_CHIP_Z8S18033FEG
	bool "Z8S18033FEG"
	select ARCH_CHIP_Z8S180
	---help---
		Z180: 80-pin QFP 33MHz 5V Z8S180

config ARCH_CHIP_Z8S18020FSG
	bool "Z8S18020FSG"
	select ARCH_CHIP_Z8S180
	---help---
		Z180: 80-pin QFP 20MHz 5V Z8S180

config ARCH_CHIP_Z8S18033VEG
	bool "Z8S18033VEG"
	select ARCH_CHIP_Z8S180
	---help---
		Z180: 68-pin PLCC 33MHz 5V Z8S180

config ARCH_CHIP_Z8S18010PSG
	bool "Z8S18010PSG"
	select ARCH_CHIP_Z8S180
	---help---
		Z180: 64-pin DIP 10MHz 5V Z8S180

config ARCH_CHIP_Z8S18020FEG
	bool "Z8S18020FEG"
	select ARCH_CHIP_Z8S180

config ARCH_CHIP_Z8S18010PEG
	bool "Z8S18010PEG"
	select ARCH_CHIP_Z8S180

config ARCH_CHIP_Z8S18010FEG
	bool "Z8S18010FEG"
	select ARCH_CHIP_Z8S180

endchoice

choice
	prompt "Toolchain Selection"
	default Z180_TOOLCHAIN_SDCC

config Z180_TOOLCHAIN_SDCC
	bool "Win32, SDCC for Linux, macOS, or Cygwin"

endchoice

config Z180_MAX_TASKS
	int "Max number of tasks for arch chip z180"
	default 8
	---help---
		The maximum number of simultaneously active tasks. This value must be
		a power of two.

config LINKER_HOME_AREA
	hex "Physical start of _HOME area"
	default 0x0000
	---help---
		Physical address of the start of the linker HOME area.  Default: 0x0000

config LINKER_CODE_AREA
	hex "Physical start of _CODE area"
	default 0x0200
	---help---
		Physical address of the start of the linker _CODE area.  Default: 0x0200

config LINKER_DATA_AREA
	hex "Physical start of _DATA area"
	default 0x8000
	---help---
		Physical address of the start of the linker _DATA area.  Default: 0x8000

config LINKER_ROM_AT_0000
	bool "ROM at Physical 0x0000"
	default n
	---help---
		Some architectures may have ROM located at physical address zero.  In this
		case, a special version of the "head" file must be used.

config Z180_BANKAREA_VIRTBASE
	hex "Virtual Start of Bank Area"
	default 0x8000
	---help---
		This setting provides the virtual address of the start of the Bank Area.
		NOTE that 0x0000 <= Z180_BANKAREA_BASE <= Z180_COMMONAREA_BASE is required!
		Default: 0x8000

		NuttX Memory Organization:

		Common Area 0:  This area holds the common NuttX code that is
		directly call-able from all application threads.  Common Area
		always starts at virtual address 0x0000 and extends to the
		Bank Area

		Base Area: This area holds the common NuttX data (including the
		share-able heap) that is accessible from all applications and
		extends to Common Area 1.

		NOTE:  That is execution from RAM, the common NuttX code and
		data may be contiguous and lie in the same region (either
		Common Area 0 or the Bank Area).  The two regions above would
		apply in a ROM'ed system, where Common Area 1 is ROM and the
		Base Area is RAM.

		Common Area 1:  This area holds the code and data that is unique
		to a particular task.  his area extends to the end of the virtual
		address space.  All tasks share the same virtual Common Area 2
		virtual address (but each has a unique mapping to different,
		underlying physical addresses).

config Z180_BANKAREA_PHYSBASE
	hex "Physical Start of Bank Area"
	default 0x08000
	---help---
		This setting provides the physical address of the start of the Bank Area.
		Default: 0x08000

config Z180_COMMON1AREA_VIRTBASE
	hex "Virtual Start of Common Area 1"
	default 0xc000
	---help---
		This setting provides the virtual address of the start of the Common
		Area 1. NOTE that 0x0000 <= Z180_BANKAREA_BASE <= Z180_COMMONAREA_BASE
		is required! Default: 0xc000

		NuttX Memory Organization:

		Common Area 0:  This area holds the common NuttX code that is
		directly call-able from all application threads.  Common Area
		always starts at virtual address 0x0000 and extends to the
		Bank Area

		Base Area: This area holds the common NuttX data (including the
		share-able heap) that is accessible from all applications and
		extends to Common Area 1.

		NOTE:  That is execution from RAM, the common NuttX code and
		data may be contiguous and lie in the same region (either
		Common Area 0 or the Bank Area).  The two regions above would
		apply in a ROM'ed system, where Common Area 1 is ROM and the
		Base Area is RAM.

		Common Area 1:  This area holds the code and data that is unique
		to a particular task.  his area extends to the end of the virtual
		address space.  All tasks share the same virtual Common Area 2
		virtual address (but each has a unique mapping to different,
		underlying physical addresses).

config Z180_PHYSHEAP_START
	hex "Physical Start of Free Memory"
	default 0x0c000
	---help---
		This setting provides the physical address of the start of free physical
		memory that will be used to allocate memory for tasks (Common Area 1).
		Default: 0x0c000

config Z180_PHYSHEAP_END
	hex "Physical End(+1) of Free Memory"
	default 0x100000
	---help---
		This setting provides the physical address of the end(+1) of free physical
		memory that will be used to allocate memory for tasks (Common Area 1).
		Default: 0x100000

config ARCH_HAVEHEAD
	bool "Board-specific Head File"
	default n
	---help---
		Use a board-specific version of the "head" file in the
		boards/z80/z180/<board>/src directory

menu "Z180 Peripheral Support"

config Z180_UART0
	bool "UART0"
	default n
	---help---
		Select to enable a serial port on UART0.  On the Z8x182, bits 0-4 of
		port B will not be available if ASCI channel 0 is selected.

config Z180_UART1
	bool "UART1"
	default n
	---help---
		Select to enable a serial port on UART1.  On the Z8x182, bits 5-7 of
		port B will not be available if ASCI channel 0 is selected.

config Z180_SCC
	bool "SCC"
	default n
	depends on ARCH_CHIP_Z80181 || ARCH_CHIP_Z8L181
	---help---
		Select to enable a serial port on the SCC

config Z180_ESCCA
	bool "ESCC Channel A"
	default n
	depends on ARCH_CHIP_Z80182 || ARCH_CHIP_Z8L182
	---help---
		Select to enable a serial port on ESCC Channel A.  Not available
		if port C is selected.

config Z180_ESCCB
	bool "ESCC Channel B"
	default n
	depends on (ARCH_CHIP_Z80182 || ARCH_CHIP_Z8L182) && !Z180_MIMIC
	---help---
		Select to enable a serial port on ESCC Channel B

config Z180_PRT1
	bool "Timer 1"
	default n
	---help---
		Select to enable a Programmable Reload Timer 1 (PRT1, PRT0 is used
		by NuttX as the system timer)

# config Z180_DMA0
#	bool "DMA0"
#	default n
#	---help---
#		Select to enable support for DMA0
#
# config Z180_DMA1
#	bool "DMA1"
#	default n
#	---help---
#		Select to enable support for DMA1

config Z180_PORTA
	bool "PORT A"
	default n
	depends on (ARCH_CHIP_Z80181 || ARCH_CHIP_Z8L181 || ARCH_CHIP_Z80182 || ARCH_CHIP_Z8L182) && !Z180_CTC
	---help---
		Select to enable a Port A (called PIA1 on the Z8x181)

config Z180_PORTB
	bool "PORT B"
	default n
	depends on ARCH_CHIP_Z80181 || ARCH_CHIP_Z8L181 || ARCH_CHIP_Z80182 || ARCH_CHIP_Z8L182
	---help---
		Select to enable a Port B (called PIA2 on the Z8x181).  On the Z8x182,
		Bits 5-7 will not be available if ASCI channel 1 is used; Bits 0-4 will
		not be available if ASCI channel 0 is used.

config Z180_PORTC
	bool "PORT C"
	default n
	depends on (ARCH_CHIP_Z80182 || ARCH_CHIP_Z8L182) && !Z180_ESCCA
	---help---
		Select to enable a Port C.  Not available if ESCC channel A is selected.

config Z180_CTC
	bool "CTC"
	default n
	depends on ARCH_CHIP_Z80181 || ARCH_CHIP_Z8L181
	---help---
		Select to enable the Counter/Timer (CTC)

config Z180_MIMIC
	bool "16550 MIMIC"
	default n
	depends on ARCH_CHIP_Z80182 || ARCH_CHIP_Z8L182
	---help---
		Select to enable the 16550 MIMIC

endmenu

choice
	prompt "Serial console"
	default Z180_UART0_SERIAL_CONSOLE
	depends on DEV_CONSOLE

config Z180_UART0_SERIAL_CONSOLE
	bool "UART0"
	depends on Z180_UART0

config Z180_UART1_SERIAL_CONSOLE
	bool "UART1"
	depends on Z180_UART1

config Z180_SCC_SERIAL_CONSOLE
	bool "SCC"
	depends on Z180_SCC

config Z180_ESCCA_SERIAL_CONSOLE
	bool "ESCC Channel A"
	depends on Z180_ESCCA

config Z180_ESCCB_SERIAL_CONSOLE
	bool "ESCC Channel B"
	depends on Z180_ESCCB

config Z810_NO_SERIAL_CONSOLE
	bool "No serial console"

endchoice

menu "UART0 Configuration"
	depends on Z180_UART0

config Z180_UART0_RXBUFSIZE
	int "Receive Buffer Size"
	default 64
	---help---
		Characters are buffered as they are received. This specifies
		the size of the receive buffer.

config Z180_UART0_TXBUFSIZE
	int "Transmit Buffer Size"
	default 64
	---help---
		Characters are buffered before being sent.  This specifies
		the size of the transmit buffer.

config Z180_UART0_BAUD
	int "Baud Rate"
	default 9600
	---help---
		The configured BAUD of the SCC.

config Z180_UART0_BITS
	int "Character Size"
	default 8
	---help---
		The number of bits in one character.  Must be either 5, 6, 7, or 8.

config Z180_UART0_PARITY
	int "Parity Setting"
	default 0
	---help---
		0=no parity, 1=odd parity, 2=even parity

config Z180_UART0_2STOP
	int "use 2 stop bits"
	default 0
	---help---
		1=Two stop bits

endmenu

menu "UART1 Configuration"
	depends on Z180_UART1

config Z180_UART1_RXBUFSIZE
	int "Receive Buffer Size"
	default 64
	---help---
		Characters are buffered as they are received. This specifies
		the size of the receive buffer.

config Z180_UART1_TXBUFSIZE
	int "Transmit Buffer Size"
	default 64
	---help---
		Characters are buffered before being sent.  This specifies
		the size of the transmit buffer.

config Z180_UART1_BAUD
	int "Baud Rate"
	default 9600
	---help---
		The configured BAUD of the SCC.

config Z180_UART1_BITS
	int "Character Size"
	default 8
	---help---
		The number of bits in one character.  Must be either 5, 6, 7, or 8.

config Z180_UART1_PARITY
	int "Parity Setting"
	default 0
	---help---
		0=no parity, 1=odd parity, 2=even parity

config Z180_UART1_2STOP
	int "use 2 stop bits"
	default 0
	---help---
		1=Two stop bits

endmenu

menu "SCC Configuration"
	depends on Z180_SCC

config Z180_SCC_RXBUFSIZE
	int "Receive Buffer Size"
	default 64
	---help---
		Characters are buffered as they are received. This specifies
		the size of the receive buffer.

config Z180_SCC_TXBUFSIZE
	int "Transmit Buffer Size"
	default 64
	---help---
		Characters are buffered before being sent.  This specifies
		the size of the transmit buffer.

config Z180_SCC_BAUD
	int "Baud Rate"
	default 9600
	---help---
		The configured BAUD of the SCC.

config Z180_SCC_BITS
	int "Character Size"
	default 8
	---help---
		The number of bits in one character.  Must be either 5, 6, 7, or 8.

config Z180_SCC_PARITY
	int "Parity Setting"
	default 0
	---help---
		0=no parity, 1=odd parity, 2=even parity

config Z180_SCC_2STOP
	int "use 2 stop bits"
	default 0
	---help---
		1=Two stop bits

endmenu

menu "ESCC Channel A Configuration"
	depends on Z180_ESCCA

config Z180_ESCCA_RXBUFSIZE
	int "Receive Buffer Size"
	default 64
	---help---
		Characters are buffered as they are received. This specifies
		the size of the receive buffer.

config Z180_ESCCA_TXBUFSIZE
	int "Transmit Buffer Size"
	default 64
	---help---
		Characters are buffered before being sent.  This specifies
		the size of the transmit buffer.

config Z180_ESCCA_BAUD
	int "Baud Rate"
	default 9600
	---help---
		The configured BAUD of the SCC.

config Z180_ESCCA_BITS
	int "Character Size"
	default 8
	---help---
		The number of bits in one character.  Must be either 5, 6, 7, or 8.

config Z180_ESCCA_PARITY
	int "Parity Setting"
	default 0
	---help---
		0=no parity, 1=odd parity, 2=even parity

config Z180_ESCCA_2STOP
	int "use 2 stop bits"
	default 0
	---help---
		1=Two stop bits

endmenu

menu "ESCC Channel B Configuration"
	depends on Z180_ESCCB

config Z180_ESCCB_RXBUFSIZE
	int "Receive Buffer Size"
	default 64
	---help---
		Characters are buffered as they are received. This specifies
		the size of the receive buffer.

config Z180_ESCCB_TXBUFSIZE
	int "Transmit Buffer Size"
	default 64
	---help---
		Characters are buffered before being sent.  This specifies
		the size of the transmit buffer.

config Z180_ESCCB_BAUD
	int "Baud Rate"
	default 9600
	---help---
		The configured BAUD of the SCC.

config Z180_ESCCB_BITS
	int "Character Size"
	default 8
	---help---
		The number of bits in one character.  Must be either 5, 6, 7, or 8.

config Z180_ESCCB_PARITY
	int "Parity Setting"
	default 0
	---help---
		0=no parity, 1=odd parity, 2=even parity

config Z180_ESCCB_2STOP
	int "use 2 stop bits"
	default 0
	---help---
		1=Two stop bits

endmenu
endif
