From ace49af6b0840e9886e7460895a4bd7cd5671c71 Mon Sep 17 00:00:00 2001 From: Andre Guedes Date: Fri, 18 Mar 2016 17:02:07 -0300 Subject: [PATCH] uart: Enable QMSI driver for Quark D2000 This patch fixes the QMSI UART shim driver so we are able to use it in Quark D2000 based platforms. Differently from Quark SE, the peripheral clock gate bit (CLK_PERIPH_CLK) is not enabled by default in Quark D2000. We have to explicitly set this bit in order to properly initialize the device. Since this drivers is now properly working on Quark D2000, this patch also sets the QMSI driver default options in arch/x86/soc/quark_d2000/ Kconfig. Change-Id: I817b7703554be162ac628dcd8d3d07512b9eb3f5 Signed-off-by: Andre Guedes --- arch/x86/soc/quark_d2000/Kconfig | 15 +++++++++++++++ drivers/serial/uart_qmsi.c | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/arch/x86/soc/quark_d2000/Kconfig b/arch/x86/soc/quark_d2000/Kconfig index 5d11114b569..fa9314bd1b2 100644 --- a/arch/x86/soc/quark_d2000/Kconfig +++ b/arch/x86/soc/quark_d2000/Kconfig @@ -123,6 +123,21 @@ endif # UART_NS16550_PORT_1 endif # UART_NS16550 +if UART_QMSI +config UART_QMSI_0 + def_bool y +config UART_QMSI_0_IRQ + default 8 +config UART_QMSI_0_IRQ_PRI + default 0 +config UART_QMSI_1 + def_bool y +config UART_QMSI_1_IRQ + default 6 +config UART_QMSI_1_IRQ_PRI + default 0 +endif # UART_QMSI + if UART_CONSOLE config UART_CONSOLE_ON_DEV_NAME diff --git a/drivers/serial/uart_qmsi.c b/drivers/serial/uart_qmsi.c index 39ca4395e6a..20792429721 100644 --- a/drivers/serial/uart_qmsi.c +++ b/drivers/serial/uart_qmsi.c @@ -62,7 +62,7 @@ static void irq_config_func_0(struct device *dev); static struct uart_qmsi_config_info config_info_0 = { .instance = QM_UART_0, - .clock_gate = CLK_PERIPH_UARTA_REGISTER, + .clock_gate = CLK_PERIPH_UARTA_REGISTER | CLK_PERIPH_CLK, .baud_divisor = QM_UART_CFG_BAUD_DL_PACK( DIVISOR_HIGH(CONFIG_UART_QMSI_0_BAUDRATE), DIVISOR_LOW(CONFIG_UART_QMSI_0_BAUDRATE), @@ -86,7 +86,7 @@ static void irq_config_func_1(struct device *dev); static struct uart_qmsi_config_info config_info_1 = { .instance = QM_UART_1, - .clock_gate = CLK_PERIPH_UARTB_REGISTER, + .clock_gate = CLK_PERIPH_UARTB_REGISTER | CLK_PERIPH_CLK, .baud_divisor = QM_UART_CFG_BAUD_DL_PACK( DIVISOR_HIGH(CONFIG_UART_QMSI_1_BAUDRATE), DIVISOR_LOW(CONFIG_UART_QMSI_1_BAUDRATE),