Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1605423ybk; Sun, 10 May 2020 23:02:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDf/b9s03C0m7HkDXpZzuFwzHrrPs7N4l0Pf+2dRWrOBP5h2Mr/hdl4feP6yEGSZuOPNOJ X-Received: by 2002:a17:906:410a:: with SMTP id j10mr2268918ejk.378.1589176964352; Sun, 10 May 2020 23:02:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589176964; cv=none; d=google.com; s=arc-20160816; b=Bj0sxPkG87glk+DFCSxZ9bgLYRsOOxMFhUO6Rhu9vE8qnwci7VGBrOeUWhT7RxWDvQ i5Ht+yO+/MIuP1i0nPU8DDNKB9Esi4xlZrZwUHnXULHva2VHG8G5OFmUwC+nZYZU0fUP FnybwJeqhAOFuYGlzpOxKG9YqVuRH/skanf7fIc5M9VY5j3AceKmUGTsJn3OW4wwh3pN y55h3+G7zMTT3myqR/w4ksXx+8ce6YwzuCfm4qgtTrKLpVIR+Urf94DuyDjqDuaGW3hS wlvFzeXEcegM3+mtVl0SzV4dWfX3U/qDO2fi+Gq2X7n7oAZwItGyLdr1lN8zLP5RjOMF ea6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:ironport-sdr :ironport-sdr; bh=hG8RV+8jXaPRWc9YcimBieBBcjBc80+9GP1m7xrUpYk=; b=y2mw6Qg+Ijq8JwohVQ6YQQtTk/91qGtVO61IP+xcM6Nb6CZCtuvr+a59bRzUWAYzG/ kSOzh2qNotBgfvvHZx/ZjnODsaFOXElzzVkXw5T83PwJXqz1f36MzfFLNDrW1AXwJZc8 cwWpFJf9bnyFs2H/U6ryFhlDI0KmBmdOfiEpQJH7DgOIKGOiqzktHAcsbQiwJ/rfTVss N3LiEoypN0e5kpYTx0Ohe5kFmunWUQa2eBOWRX5QcwKnEwOmVDdXafZXbnnhZiRH0E2V AS8X5yAhnWr6zquLt8iMvPGqWgZ8PFIsuqb1eC3jzG0iNUecvALu4CqQnpp64TYa6GGy kZwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gh17si4167690ejb.517.2020.05.10.23.02.15; Sun, 10 May 2020 23:02:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728365AbgEKF5g (ORCPT + 99 others); Mon, 11 May 2020 01:57:36 -0400 Received: from mga14.intel.com ([192.55.52.115]:54277 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725916AbgEKF5f (ORCPT ); Mon, 11 May 2020 01:57:35 -0400 IronPort-SDR: TYhSSYlRCWzHBxB23gZoxAMCsT81ICu1hd1IYQjcPIB9GcoOpHiwzBdtdNShIG/WI8kxyq9Fpt Vaa5vHVATZyA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2020 22:57:35 -0700 IronPort-SDR: vjEWTfL3FYUjWJlIrYuX7W/KkBwmcWqKOnkV58x+Mujzk6KO/ipTLRIAFD2kjBdrqaejJrlnqk 0sFAHEPlzpDA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,378,1583222400"; d="scan'208";a="279680285" Received: from sgsxdev001.isng.intel.com (HELO localhost) ([10.226.88.11]) by orsmga002.jf.intel.com with ESMTP; 10 May 2020 22:57:33 -0700 From: Rahul Tanwar To: gregkh@linuxfoundation.org, linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org, andriy.shevchenko@intel.com, Rahul Tanwar Subject: [PATCH v3 1/2] serial: lantiq: Make UART's use as console selectable Date: Mon, 11 May 2020 13:57:26 +0800 Message-Id: <35f2d002ba1cb26192fe4d9b8cdab275300705bc.1589176044.git.rahul.tanwar@linux.intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Lantiq UART driver can be used for system console. Add changes to make this driver's use as console selectable/configurable. Signed-off-by: Rahul Tanwar --- drivers/tty/serial/Kconfig | 9 ++++++++- drivers/tty/serial/lantiq.c | 11 ++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index 4b0a7b98f8c7..bb4009a1135f 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -1037,10 +1037,17 @@ config SERIAL_LANTIQ bool "Lantiq serial driver" depends on (LANTIQ || X86) || COMPILE_TEST select SERIAL_CORE + help + Support for UART on Lantiq and Intel SoCs. + +config SERIAL_LANTIQ_CONSOLE + bool "Console on Lantiq UART" + depends on SERIAL_LANTIQ=y select SERIAL_CORE_CONSOLE select SERIAL_EARLYCON help - Support for console and UART on Lantiq SoCs. + Select this option if you would like to use a Lantiq UART as the + system console. config SERIAL_QE tristate "Freescale QUICC Engine serial port support" diff --git a/drivers/tty/serial/lantiq.c b/drivers/tty/serial/lantiq.c index c5e46ff972e4..d3b62a1be6ad 100644 --- a/drivers/tty/serial/lantiq.c +++ b/drivers/tty/serial/lantiq.c @@ -597,6 +597,7 @@ static const struct uart_ops lqasc_pops = { .verify_port = lqasc_verify_port, }; +#ifdef CONFIG_SERIAL_LANTIQ_CONSOLE static void lqasc_console_putchar(struct uart_port *port, int ch) { @@ -705,6 +706,14 @@ lqasc_serial_early_console_setup(struct earlycon_device *device, OF_EARLYCON_DECLARE(lantiq, "lantiq,asc", lqasc_serial_early_console_setup); OF_EARLYCON_DECLARE(lantiq, "intel,lgm-asc", lqasc_serial_early_console_setup); +#define LANTIQ_SERIAL_CONSOLE (&lqasc_console) + +#else + +#define LANTIQ_SERIAL_CONSOLE NULL + +#endif /* CONFIG_SERIAL_LANTIQ_CONSOLE */ + static struct uart_driver lqasc_reg = { .owner = THIS_MODULE, .driver_name = DRVNAME, @@ -712,7 +721,7 @@ static struct uart_driver lqasc_reg = { .major = 0, .minor = 0, .nr = MAXPORTS, - .cons = &lqasc_console, + .cons = LANTIQ_SERIAL_CONSOLE, }; static int fetch_irq_lantiq(struct device *dev, struct ltq_uart_port *ltq_port) -- 2.11.0