Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2545701ybl; Sun, 26 Jan 2020 05:14:32 -0800 (PST) X-Google-Smtp-Source: APXvYqzZ+n9ucUR9AWLTOPet5i1UpQyWPzKbv6UUNpKiAQCq4O24V2DYZvTfo+88zWyQmDWG1TDY X-Received: by 2002:a05:6830:1353:: with SMTP id r19mr9530329otq.288.1580044472476; Sun, 26 Jan 2020 05:14:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580044472; cv=none; d=google.com; s=arc-20160816; b=dUMcIAL+8AghARRutmEHYhy96dxlPQMWa9bFV8X2QjjJ7Vr1mU1pIQ3l0Zaiqw3yyt Uhm4Xx/26xKpPyD5u93y/G+1ptOLwU9NliLu6V8WjY3mvr2TWA1b44eBbGCqlZ0bUbGA Jlg4CsRJNKcZW3xqZipSIsq5aL3xcB/3klBMJHEJDpXdNXeZRU0f4jY3DdoNRULGtDiv +Z8pDtQIVrodD9p2C39eFjdLULsvJxHBZK9h1wqyAXQtemnSwcBbix2L3ccGXrg9BYza QSaxmAQpoi97nOPpxt/pkeH19SkMntMzcU+coHfEaUBruraf4WTu1bT/CQ7gWIm3yWpG eIIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=aOz2a4ikfSJfKPLpitKM+pbHlVIJ+/xJ4MtoVyj0JU0=; b=mOhRrQh4Hv59neqXNkAAyN//C4hkDX+oWWLvom2iBG3hyKS56pmhd5B1bNkifIqY0X cXFpAJo1vrj1+85akZufSn/NSWCx/uqSRop7jeIP/I2XmGLYd7xwXTYx5SwYLrm3APD2 YH6wd0iiDdq69/LmkcBH077+hGQulz94djRWHrhpRvwgNkg1OPji1bFXOkmgngpeDPSl w3t+/lm+ndnbvKhz/yqcPFnPFu7ZML26Yo6p4tp03EIO5T4E7r5BBjoZmtnffbD9SWf4 oXcn0JVHysAA4mBwKqI03A7q0zMdTXi4gzbqjl6eRRGL4TVibieatkAM7tRan9VEFH0h aefg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t1si4446964otq.148.2020.01.26.05.14.19; Sun, 26 Jan 2020 05:14:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727107AbgAZNMl (ORCPT + 99 others); Sun, 26 Jan 2020 08:12:41 -0500 Received: from bmailout3.hostsharing.net ([176.9.242.62]:38231 "EHLO bmailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726275AbgAZNMl (ORCPT ); Sun, 26 Jan 2020 08:12:41 -0500 Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id D71B6100CF15C; Sun, 26 Jan 2020 14:12:38 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 7C4D01D7C59; Sun, 26 Jan 2020 14:12:38 +0100 (CET) Date: Sun, 26 Jan 2020 14:12:38 +0100 From: Lukas Wunner To: matthias.bgg@kernel.org Cc: gregkh@linuxfoundation.org, jslaby@suse.com, nsaenzjulienne@suse.de, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Matthias Brugger , Florian Fainelli , Ray Jui , Scott Branden , Stephen Boyd , bcm-kernel-feedback-list@broadcom.com Subject: Re: [PATCH] serial: 8250_early: Add earlycon for BCM2835 aux uart Message-ID: <20200126131238.c65zj3wo3srafa7z@wunner.de> References: <20200126123314.3558-1-matthias.bgg@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200126123314.3558-1-matthias.bgg@kernel.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 26, 2020 at 01:33:14PM +0100, matthias.bgg@kernel.org wrote: > +#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 Does this really work? I also tried to get it working recently and the system just hung on boot. Looking at it with a JTAG debugger showed that the bcm2835aux registers were inaccessible because the mini UART wasn't enabled in the AUXENB register. Maybe if you use OF_EARLYCON_DECLARE, the firmware recognizes that serial1 is set as stdout-path and performs enablement of the mini UART? Or are you using U-Boot which perhaps does the enablement? I also saw in the JTAG debugger that the uartclk member contained an incorrect value, so I'd expect that it has to be set as well in early_bcm2835aux_setup(). I'll see to it that I give this patch a whirl when I return to the office next week. Thanks, Lukas