Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031109AbbD1Nl7 (ORCPT ); Tue, 28 Apr 2015 09:41:59 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:35256 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S965843AbbD1Nk4 (ORCPT ); Tue, 28 Apr 2015 09:40:56 -0400 X-Listener-Flag: 11101 From: Eddie Huang To: Greg Kroah-Hartman , Matthias Brugger CC: , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Catalin Marinas , Will Deacon , Jiri Slaby , Eddie Huang , Howard Chen , Ashwin Chaugule , Peter Hurley , Wang Long , Kevin Cernekee , Vineet Gupta , "Rafael J. Wysocki" , Alan Cox , , , , , , Sascha Hauer Subject: [PATCH v3 2/3] tty: serial: 8250_mtk: Add earlycon Date: Tue, 28 Apr 2015 21:40:33 +0800 Message-ID: <1430228434-31779-3-git-send-email-eddie.huang@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1430228434-31779-1-git-send-email-eddie.huang@mediatek.com> References: <1430228434-31779-1-git-send-email-eddie.huang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1359 Lines: 42 Add 8250 MTK UART driver to support earlycon device tree. Earlycon take effect by add "earlycon" in kernel boot argument add "linux,sdtout-path" property in device tree file Signed-off-by: Eddie Huang --- drivers/tty/serial/8250/8250_mtk.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c index 7a11fac..8b2a666 100644 --- a/drivers/tty/serial/8250/8250_mtk.c +++ b/drivers/tty/serial/8250/8250_mtk.c @@ -289,6 +289,19 @@ static struct platform_driver mtk8250_platform_driver = { }; module_platform_driver(mtk8250_platform_driver); +static int __init early_mtk8250_setup(struct earlycon_device *device, + const char *options) +{ + if (!device->port.membase) + return -ENODEV; + + device->port.iotype = UPIO_MEM32; + + return early_serial8250_setup(device, NULL); +} + +OF_EARLYCON_DECLARE(mtk8250, "mediatek,mt6577-uart", early_mtk8250_setup); + MODULE_AUTHOR("Matthias Brugger"); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Mediatek 8250 serial port driver"); -- 1.8.1.1.dirty -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/