Skip to content

Commit

Permalink
drivers: serial: uart_intel_lw: add driver
Browse files Browse the repository at this point in the history
Enable driver for intel lw uart.

Changes from review:
- refactor spinlock to inside of loop
- use menuconfig for kconfig
- add CONFIG_UART_INTEL_LW_AUTO_LINE_CTRL_POLL

Signed-off-by: Teoh Shi Lin <shi.lin.teoh@intel.com>
  • Loading branch information
shilinte authored and carlescufi committed Oct 21, 2023
1 parent 09950b6 commit bfa0b52
Show file tree
Hide file tree
Showing 7 changed files with 1,123 additions and 0 deletions.
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@
/drivers/serial/uart_hvc_xen_consoleio.c @lorc @firscity
/drivers/serial/Kconfig.it8xxx2 @GTLin08
/drivers/serial/uart_ite_it8xxx2.c @GTLin08
/drivers/serial/*intel_lw* @shilinte
/drivers/smbus/ @finikorg
/drivers/sip_svc/ @maheshraotm
/drivers/disk/ @jfischer-no
Expand Down
1 change: 1 addition & 0 deletions drivers/serial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ zephyr_library_sources_ifdef(CONFIG_UART_NUMAKER uart_numaker.c)
zephyr_library_sources_ifdef(CONFIG_UART_EFINIX_SAPPIHIRE uart_efinix_sapphire.c)
zephyr_library_sources_ifdef(CONFIG_UART_SEDI uart_sedi.c)
zephyr_library_sources_ifdef(CONFIG_UART_BCM2711_MU uart_bcm2711.c)
zephyr_library_sources_ifdef(CONFIG_UART_INTEL_LW uart_intel_lw.c)

zephyr_library_sources_ifdef(CONFIG_USERSPACE uart_handlers.c)

Expand Down
2 changes: 2 additions & 0 deletions drivers/serial/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,6 @@ source "drivers/serial/Kconfig.sedi"

source "drivers/serial/Kconfig.bcm2711"

source "drivers/serial/Kconfig.intel_lw"

endif # SERIAL
30 changes: 30 additions & 0 deletions drivers/serial/Kconfig.intel_lw
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (c) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

menuconfig UART_INTEL_LW
bool "Intel Lightweight UART driver"
depends on DT_HAS_INTEL_LW_UART_ENABLED
select SERIAL_HAS_DRIVER
select SERIAL_SUPPORT_INTERRUPT
help
Enable the Intel Lightweight UART driver, that can be built into Intel NiosV CPU designs.

if UART_INTEL_LW

config UART_INTEL_LW_EOP
bool "Include end of packet register"
depends on UART_DRV_CMD && UART_INTERRUPT_DRIVEN
help
Use driver command CMD_ENABLE_EOP and CMD_DISABLE_EOP to use the feature.

config UART_INTEL_LW_AUTO_LINE_CTRL_POLL
bool "Auto set RTS signal during poll out"
depends on UART_LINE_CTRL
help
Assert RTS before polling out a character,
and deassert RTS after the character is polled out.
Please note that this is not suitable, when polling out several characters.
Please use uart_drv_cmd with CMD_POLL_ASSERT_RTS before polling out.
Then use CMD_POLL_DEASSERT_RTS to resume normal operation after polling.

endif # UART_INTEL_LW
Loading

0 comments on commit bfa0b52

Please sign in to comment.