Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2518050ybl; Sun, 26 Jan 2020 04:37:24 -0800 (PST) X-Google-Smtp-Source: APXvYqz3sqdmSdStgXrnpDXqgbVxNV3qODHoGzcF969BnT0l8PJcyvTlmPEkVmg4D/3mtfFCFqxW X-Received: by 2002:a05:6830:138b:: with SMTP id d11mr8684580otq.38.1580042244691; Sun, 26 Jan 2020 04:37:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580042244; cv=none; d=google.com; s=arc-20160816; b=xA3dHIkMSGkzdrpgLuzAextZ37kDDDJkfkyBBynKgs8dMn7Ef0AOpQcvnOKTJyKRQd tCY7+MHuwSj/kHxmvGucSlz53ejZ8PErmTLbSSSw1SmpOdRa6UdxFaDV8LCjeNB5UcdF 8b+LBIlSCjj+HCuh52XOpx+wjutREB9rHSp3Np7JcACgjD9kFFqsKSTB/trdpEvGYSjZ MtBLoC7esGQe5qPlHUPOBDM51yLvSXgayFPKKmhmrYLfrehW6SdFUC2J3lYhzCz/AqmF psaSHAwf5TjE8hoBUMZdsqqTv3W1Q0nNGyPobzGv/muH3S9Keg5R15njf3ZkKubIJfQ4 LsqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=8eNfDx0Z0u5zzfvzWA73OL4yX7uFN2kjxubRzZY8v5k=; b=gV/i24oeh6hw3mZ7TWCwB8Zpisbt7w5/Wgx1FibEiwTqtMMA5+tITuVSo6DRgQiDpJ 0Gj8Clw2TiKb3t5G2l5+c69qGKqdwtO4pnEUcwPmb1gzo4vFq1jAboukoJ9e1vOzcZfc uGausAcrTOWBI4X4aoQobM1tU1Mhx8qMDQxtKwytg347vvqYqjlUURLddpZQEYpOkX6s NEqSngxYjIs3qdINYEEm9x8bGjfteEed09x5grfxFfiIWayUj+s/7kr4vVSGRiQvidN2 6+zOalLOFHjraXkuHyT6uwTrBZMAbpK/89z7tsWFdv/ci5P1rQMfDBvxF4/NycIbhFi5 EQsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="oY/V6N+B"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f189si2397776oib.268.2020.01.26.04.36.32; Sun, 26 Jan 2020 04:37:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="oY/V6N+B"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387416AbgAZMdX (ORCPT + 99 others); Sun, 26 Jan 2020 07:33:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:45482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387403AbgAZMdX (ORCPT ); Sun, 26 Jan 2020 07:33:23 -0500 Received: from ziggy.de (unknown [95.169.235.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DF5AA2071A; Sun, 26 Jan 2020 12:33:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580042002; bh=jiPyg4xMYng3XTyef+gtnfbqk1VNKvF8MyDPzuNMtWU=; h=From:To:Cc:Subject:Date:From; b=oY/V6N+Bk295aS5GBBQ4hYmTuZJaC2Ikx3wC+D4nFi0kXAvZTX1gTtF0TS0ljn4r0 Rhw8kURC/bEaPBnvaduzUuX751qYa/n9Dacm6ArLhMp+CYfDfnMbwZdqwmWbJoKqV3 BJgFkNHZb6mcfOsRROAYBekXYeC0mxv6U2x4NQmE= From: matthias.bgg@kernel.org To: gregkh@linuxfoundation.org, jslaby@suse.com, nsaenzjulienne@suse.de Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, matthias.bgg@kernel.org, Matthias Brugger , Florian Fainelli , Ray Jui , Scott Branden , Stephen Boyd , bcm-kernel-feedback-list@broadcom.com Subject: [PATCH] serial: 8250_early: Add earlycon for BCM2835 aux uart Date: Sun, 26 Jan 2020 13:33:14 +0100 Message-Id: <20200126123314.3558-1-matthias.bgg@kernel.org> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthias Brugger Define the OF early console for BCM2835 aux UART, which can be enabled by passing "earlycon" on the boot command line. This UART is found on BCM283x and BCM27xx SoCs, a.k.a. Raspberry Pi in its variants. Signed-off-by: Matthias Brugger --- drivers/tty/serial/8250/8250_bcm2835aux.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/tty/serial/8250/8250_bcm2835aux.c b/drivers/tty/serial/8250/8250_bcm2835aux.c index 8ce700c1a7fc..6769cea2964a 100644 --- a/drivers/tty/serial/8250/8250_bcm2835aux.c +++ b/drivers/tty/serial/8250/8250_bcm2835aux.c @@ -135,6 +135,24 @@ static struct platform_driver bcm2835aux_serial_driver = { }; module_platform_driver(bcm2835aux_serial_driver); +#ifdef CONFIG_SERIAL_8250_CONSOLE + +static int __init early_bcm2835aux_setup(struct earlycon_device *device, + const char *options) +{ + if (!device->port.membase) + return -ENODEV; + + device->port.iotype = UPIO_MEM32; + device->port.regshift = 2; + + return early_serial8250_setup(device, NULL); +} + +OF_EARLYCON_DECLARE(bcm2835aux, "brcm,bcm2835-aux-uart", + early_bcm2835aux_setup); +#endif + MODULE_DESCRIPTION("BCM2835 auxiliar UART driver"); MODULE_AUTHOR("Martin Sperl "); MODULE_LICENSE("GPL v2"); -- 2.24.1