From patchwork Wed Jan 17 08:54:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 124792 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp1309272lje; Wed, 17 Jan 2018 00:58:34 -0800 (PST) X-Google-Smtp-Source: ACJfBouHsm5BYwjrI5x1NU/zScd0tTXFhZHWE2u7ZFIStuUcjeIu4Rj7j8zA4xKLR4Bok8gT1xv0 X-Received: by 10.80.194.89 with SMTP id t25mr1912788edf.240.1516179514654; Wed, 17 Jan 2018 00:58:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516179514; cv=none; d=google.com; s=arc-20160816; b=weXsjusRCvpvzeCFzxCqmy1wGAPNsnS8U0qQx5ou+6nXknp277CLZGq9kWNvaZSdZn q4h2Y/BmPr17Pr4+WO4kjg4wtDfcjKHhCJL0LC16V3hinu9vcETioRCDgCN6lGLSTYml LOFJfou8WVfFK3jI16NQv7EFAEdHhf1Ggcxej0iiIh64gk9SCaOuR+DOUiQneLKgTlJe 7iyrFR9a+4qN/srjZrtVx9FT3ugdl5oGTqNzfhvyrgDZ6ZP/etr+O1VCNPDSEwXAVCG3 UIFVshnTnKuAC+OQ2XQIiZijZ9RpjnMnoM/DMb5F77x3j0i6T80wINEbcR0P5JV2LJCo FwMA== 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:cc:message-id:date:to:from :arc-authentication-results; bh=Zvn1gC5+2Dkm+cB6IkumfX7yAyPEGg6IUuphjYECHzI=; b=Pu1VCn12Nvi83NtUlozkp+ACQsix1huPulwVn7hxu55OkPpOBZ8zYThMnR2F1NhfAT yog572xSE3akRh9W9PParWwveT9XE0lrW5HxFrGxyU6fi3ODwNpfPO70J3a2PKngcvuU W2tYAjL1zr65+xxeJT7OnUhamrpubNvHZnTHMzaEoaOSnx0I1f+cn26lvjNKc0s5l55A uM0qxUczYR2/iva1BWd1g7GjG/2BCZL3I2zwhT7CgTFwpIgGyYTcSha7X3XnMGXd3G9w W8zWs0vsd85yGD78M1IfVUYAr/Lx1G/NMl7JNNMCHtMueE9adx16x6s9FAmBOLQgfkAN Mr4w== 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 n30si1064322edc.416.2018.01.17.00.58.34; Wed, 17 Jan 2018 00:58:34 -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 416B9C21E51; Wed, 17 Jan 2018 08:56:33 +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=RCVD_IN_DNSWL_BLOCKED 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 037BFC21E64; Wed, 17 Jan 2018 08:55:04 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5950AC21DB5; Wed, 17 Jan 2018 08:55:00 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id B7412C21DE4 for ; Wed, 17 Jan 2018 08:54:59 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 19118AEEE; Wed, 17 Jan 2018 08:54:59 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Wed, 17 Jan 2018 09:54:51 +0100 Message-Id: <20180117085458.27293-1-agraf@suse.de> X-Mailer: git-send-email 2.12.3 Cc: Heinrich Schuchardt Subject: [U-Boot] [PATCH v2 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. This patch set depends on the patch set "Rpi: Add support for second sd host controller". v1 -> v2: - Make search logic easier to follow 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 | 36 +++++++++-- 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(+), 61 deletions(-)