avr: Allow the serial port to be selected on the atmega2560/1280

Allow the serial port to be selected on the atmega2560 and atmega1280
chips in Kconfig.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2018-10-01 22:30:58 -04:00
parent 0820394e13
commit d348f0da87
1 changed files with 17 additions and 10 deletions

View File

@ -65,16 +65,6 @@ choice
bool "8Mhz" bool "8Mhz"
endchoice endchoice
if MACH_atmega1284p
choice
prompt "Serial Port"
config AVR_SERIAL_UART0
bool "UART0"
config AVR_SERIAL_UART1
bool "UART1"
endchoice
endif
config CLOCK_FREQ config CLOCK_FREQ
int int
default 8000000 if AVR_FREQ_8000000 default 8000000 if AVR_FREQ_8000000
@ -111,6 +101,21 @@ config AVR_SERIAL
depends on !AVR_USBSERIAL depends on !AVR_USBSERIAL
bool bool
default y default y
choice
depends on AVR_SERIAL
prompt "Serial Port" if MACH_atmega2560 || MACH_atmega1280 || MACH_atmega1284p
help
Select the serial device to use on the AVR chip. This is
almost always UART0.
config AVR_SERIAL_UART0
bool "UART0"
config AVR_SERIAL_UART1
bool "UART1"
config AVR_SERIAL_UART2
bool "UART2" if MACH_atmega2560 || MACH_atmega1280
config AVR_SERIAL_UART3
bool "UART3" if MACH_atmega2560 || MACH_atmega1280
endchoice
config SERIAL_BAUD config SERIAL_BAUD
depends on AVR_SERIAL depends on AVR_SERIAL
int "Baud rate for serial port" int "Baud rate for serial port"
@ -122,6 +127,8 @@ config SERIAL_BAUD_U2X
config SERIAL_PORT config SERIAL_PORT
int int
default 3 if AVR_SERIAL_UART3
default 2 if AVR_SERIAL_UART2
default 1 if MACH_at90usb1286 || MACH_at90usb646 || AVR_SERIAL_UART1 default 1 if MACH_at90usb1286 || MACH_at90usb646 || AVR_SERIAL_UART1
default 0 default 0