driver: host_uart: Add host-uart device in npcx.

In order to prevent user turns on the pin-mux of devices has io-pads
unexpectedly, this CL added a new device definition for host uart
device. The pin-mux of host uart interface is enabled only if we set its
status as "okay" in dts file of board folder.

The following npcx7 drivers will meet:
1. Default status property of npcx devices with io-pads such as espi,
   pwm, uart, host uart and so on should be "disabled".
2. Switch pin-mux by changing status property to "okay" in dts file of
   board folder.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
This commit is contained in:
Mulin Chao 2020-12-06 23:48:03 -08:00 committed by Anas Nashif
commit c45e7f3c96
4 changed files with 25 additions and 14 deletions

View file

@ -25,7 +25,4 @@ config ESPI_PERIPHERAL_HOST_IO
config ESPI_PERIPHERAL_DEBUG_PORT_80 config ESPI_PERIPHERAL_DEBUG_PORT_80
default y default y
config ESPI_PERIPHERAL_UART
default y
endif #ESPI_NPCX endif #ESPI_NPCX

View file

@ -474,12 +474,6 @@
interrupt-names = "kbc_ibf", "kbc_obe", "pmch_ibf", interrupt-names = "kbc_ibf", "kbc_obe", "pmch_ibf",
"pmch_obe", "p80_fifo"; "pmch_obe", "p80_fifo";
/* Host serial port pinmux PIN75 86 36 33 42 C7 B3 B2 */
pinctrl-0 = <&altb_rxd_sl &altb_txd_sl
&altb_rts_sl &altb_cts_sl
&altb_ri_sl &altb_dtr_bout_sl
&altb_dcd_sl &altb_dsr_sl>;
/* WUI map for accessing host sub-modules */ /* WUI map for accessing host sub-modules */
host_acc_wui = <&wui_host_acc>; host_acc_wui = <&wui_host_acc>;
@ -491,6 +485,17 @@
<&pcc NPCX_CLOCK_BUS_APB3 NPCX_PWDWN_CTL5 7>; <&pcc NPCX_CLOCK_BUS_APB3 NPCX_PWDWN_CTL5 7>;
label = "HOST_SUBS"; label = "HOST_SUBS";
}; };
host_uart: io_host_uart {
compatible = "nuvoton,npcx-host-uart";
/* Host serial port pinmux PIN75 86 36 33 42 C7 B3 B2 */
pinctrl-0 = <&altb_rxd_sl &altb_txd_sl
&altb_rts_sl &altb_cts_sl
&altb_ri_sl &altb_dtr_bout_sl
&altb_dcd_sl &altb_dsr_sl>;
label = "HOST_UART_IO";
status = "disabled";
};
}; };
}; };

View file

@ -16,11 +16,6 @@ properties:
required: true required: true
description: configurations of device source clock controller description: configurations of device source clock controller
pinctrl-0:
type: phandles
required: true
description: configurations of host uart pinmux controllers
host_acc_wui: host_acc_wui:
type: phandle type: phandle
required: true required: true

View file

@ -0,0 +1,14 @@
# Copyright (c) 2020 Nuvoton Technology Corporation.
# SPDX-License-Identifier: Apache-2.0
description: Nuvoton, NPCX-Host UART IO node
compatible: "nuvoton,npcx-host-uart"
include: [base.yaml]
properties:
pinctrl-0:
type: phandles
required: true
description: configurations of host uart pinmux controllers