From patchwork Tue Jan 16 13:47:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 124696 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp1020039lje; Tue, 16 Jan 2018 05:49:58 -0800 (PST) X-Google-Smtp-Source: ACJfBot4Gu6QLcpPulMTDkiLpURjb7+zCdPmmQgVTYMAoPz3PsOdKL86JrjZ6CIrxKP0d9ysC/pI X-Received: by 10.80.245.186 with SMTP id u55mr28424980edm.279.1516110598233; Tue, 16 Jan 2018 05:49:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516110598; cv=none; d=google.com; s=arc-20160816; b=I9hRa0FJqp4yzxpinieiIzdSaIOdVkev++/HKcNU1k8NkkLqT1dYhl99k63b/1b4la te4YvMcgDQpskrWOYv1QMdy7R1Mm8PhEUNGXt8/3R+Q5sdo24/EoFbgaBRe/ZcQ5WBt/ vsTUkcBQKpQ2e3Ql78zi2Rm84F+yyTSokQbufBVgotpcDlKAxRzRcqIuhX+q4iDW7uSu vF0UrQCV9qRXzFmnlpnacfjqE69F920Yk4FH9BzGLmEAWmgzpQ3+dO23GVr00q3ZNsiL 92x29vOBbv2ek3xGnbVIhdRrK4m+l0l2MxiynDhXB2Ev+mFRxRmK6PJUo0y6ZSSqbAKv l4pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from :arc-authentication-results; bh=UMBU+XmjjGKn1GvZm9GDOmGJUq83dwg8f4i72F3Ghg4=; b=hTG671nrXR5Qr9B0/9lDsr3y3h2jQVJXhNWuctz9Rl5r9TvdmZvqJ2GtRQmNGQWbB+ fMmn265OCS8c7jqt388rOZTzl6aPivwuFiAgYjGRefgeupiPEHGBfwG8u3dDAI6JsUIy 3HyA+WQFydKdakDAeiMz3huR2Kndqbf9Ap8ipLDRkJsbwYsNX9Ps7kglK8dzItYaMUx5 sXyK8YXjLfYzPuONjZ3eSkcCpRdxZJcHTTvqD0y2SmtyMh1JGDhvBnVR9Eq0P8M+clTS gc9fFP8h33xnE3z+ofYrF3kFVAW7n9QVV6APxyUepJFHB1Y6AyyouQS15HqtofFt7HmI 5DdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id o5si2176956eda.525.2018.01.16.05.49.57; Tue, 16 Jan 2018 05:49:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id A86B9C21E31; Tue, 16 Jan 2018 13:48:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id A1A4CC21E33; Tue, 16 Jan 2018 13:48:34 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 0E1CBC21DE5; Tue, 16 Jan 2018 13:47:56 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 73798C21E40 for ; Tue, 16 Jan 2018 13:47:42 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 36C4BAD00; Tue, 16 Jan 2018 13:47:42 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Tue, 16 Jan 2018 14:47:34 +0100 Message-Id: <20180116134741.4103-1-agraf@suse.de> X-Mailer: git-send-email 2.12.3 Subject: [U-Boot] [PATCH 0/7] RPi: Properly handle dynamic serial configuration X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The RPi has proprietary firmware that can be configured (using config.txt) to expose either the PL11, Mini-UART or no serial device to the UART pins on the GPIO pin bar of the RPi. So far we've only half-heartedly dealt with that, with lost of heuristics that ended up falling apart at times. For example the RPi3 CM uses PL011 when serial is enabled in config.txt, but we disabled PL11 support for BCM2837 because the RPi3 uses the Mini-UART with enable_uart=1 is set in config.txt. This patch set always enables both serial outputs and determines at probe time whether a serial device is actually muxed to the UART pins on the board. Only in that case, it will be probed and thus used for in- and output in U-Boot. With this patch set applied, I have successfully used the same U-Boot binary with CONFIG_OF_BOARD=y and a RPi firmware provided device tree with both enable_uart=1 and without on both a RPi3 and RPi3 CM. Alexander Graf (7): serial: Use next serial device if probing fails serial: Allow boards to determine whether a serial device is usable rpi: Remove runtime disabling support for serial serial: bcm283x_mu: Remove support for post-init disabling rpi: Properly detect which serial device is active rpi: Determine PL011/Mini-UART availability at runtime rpi: Force skip_init on serial devices arch/arm/mach-bcm283x/include/mach/gpio.h | 1 - board/raspberrypi/rpi/rpi.c | 91 +++++++++++++++++++--------- drivers/gpio/bcm2835_gpio.c | 2 +- drivers/serial/serial-uclass.c | 34 +++++++++-- drivers/serial/serial_bcm283x_mu.c | 20 +----- drivers/serial/serial_pl01x.c | 2 +- include/configs/rpi.h | 5 +- include/dm/platform_data/serial_bcm283x_mu.h | 1 - include/serial.h | 11 ++++ 9 files changed, 108 insertions(+), 59 deletions(-)