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>
diff --git a/drivers/espi/Kconfig.npcx b/drivers/espi/Kconfig.npcx
index 8eb82da..e127fd7 100644
--- a/drivers/espi/Kconfig.npcx
+++ b/drivers/espi/Kconfig.npcx
@@ -25,7 +25,4 @@
config ESPI_PERIPHERAL_DEBUG_PORT_80
default y
-config ESPI_PERIPHERAL_UART
- default y
-
endif #ESPI_NPCX
diff --git a/dts/arm/nuvoton/npcx7m6fb.dtsi b/dts/arm/nuvoton/npcx7m6fb.dtsi
index 0d3c468..94459a0 100644
--- a/dts/arm/nuvoton/npcx7m6fb.dtsi
+++ b/dts/arm/nuvoton/npcx7m6fb.dtsi
@@ -474,12 +474,6 @@
interrupt-names = "kbc_ibf", "kbc_obe", "pmch_ibf",
"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 */
host_acc_wui = <&wui_host_acc>;
@@ -491,6 +485,17 @@
<&pcc NPCX_CLOCK_BUS_APB3 NPCX_PWDWN_CTL5 7>;
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";
+ };
};
};
diff --git a/dts/bindings/espi/nuvoton,npcx-host-sub.yaml b/dts/bindings/espi/nuvoton,npcx-host-sub.yaml
index ff7432a..2a65859 100644
--- a/dts/bindings/espi/nuvoton,npcx-host-sub.yaml
+++ b/dts/bindings/espi/nuvoton,npcx-host-sub.yaml
@@ -16,11 +16,6 @@
required: true
description: configurations of device source clock controller
- pinctrl-0:
- type: phandles
- required: true
- description: configurations of host uart pinmux controllers
-
host_acc_wui:
type: phandle
required: true
diff --git a/dts/bindings/espi/nuvoton,npcx-host-uart.yaml b/dts/bindings/espi/nuvoton,npcx-host-uart.yaml
new file mode 100644
index 0000000..c3413ad
--- /dev/null
+++ b/dts/bindings/espi/nuvoton,npcx-host-uart.yaml
@@ -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