From patchwork Wed Jan 17 08:54:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 124790 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp1309159lje; Wed, 17 Jan 2018 00:57:56 -0800 (PST) X-Google-Smtp-Source: ACJfBovT0cddQapBd8HTBsGjPKRisXAlZY1ZUTxOFAt3DFnXn0CA/AaQAXgZHCPOCrMTMIe9vFvm X-Received: by 10.80.184.20 with SMTP id j20mr1883344ede.5.1516179476411; Wed, 17 Jan 2018 00:57:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516179476; cv=none; d=google.com; s=arc-20160816; b=UfrDNCFq00ytsC7q3Klf8xvaj/BBRLqIsUKGYUqxKtew53bAWQhx28JuI/gm5XtT07 MGqxyrl0gupr1wtm5K8+o1zZunO+65g3bYa5CBBGaOsCbU/frxfXTGMMhwyqfm20M47F oeu+YbmNF5x2pRA3JlEl//0GOBmxeokz9nbKWsLXOTJWozBjz24irCaoZexCQVwLR1/f ze/h4JrV64rp+IIHCbPsup0AEnIwWLBFY8UhoWrnNaYcP+d77DsXBkBEQl9/2ekSf4NA 0tYoi0XkQ6Q5Lg2Ga0hUbcoJMMohzdMn7wWwxFZ7Dd1gSQH6uJhhAVSTlwRYzCYcz71k OW3A== 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:references:in-reply-to:message-id :date:to:from:arc-authentication-results; bh=tfKFDOghbvJjez3iHmklb1qL5YdjG9EK15whrQBaeQQ=; b=UYm7q+yTfi+xNFNjvfIQHmFfooKgGOOQsMbjvg7Fvw0I0LrJ2pIklpCOo02wlokNNl nF6mDJ/obkx3ZzEMIkvyAF6+QjaMD4qFIIQx4C0w+d6wNxzYlh5hIKEcl8F4nvfH4tTS 1um0l8jJjWYQXE4BommhPwa5Y92Jz0Lhet30pHYIKsBDmYnUly4MDY/EUGWkdReT4hSn 5wA8uyZwwhuFexkU8nIoHfhwgVzTJt+O7UjyF+t2+y0eeaqKd8A6NPtsm89647/7DJA+ umuul0M8PelMet4ccFnfqkx28Olu5uogXyhxAEoeLUZiVfQdlyWfB+/+WOj3u+uqyZVg Z0Mw== 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 n30si1063276edc.416.2018.01.17.00.57.56; Wed, 17 Jan 2018 00:57:56 -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 0CBBFC21E45; Wed, 17 Jan 2018 08:56:17 +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 DC228C21E4E; Wed, 17 Jan 2018 08:55:03 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 48409C21CA6; 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 9F2D4C21DD9 for ; Wed, 17 Jan 2018 08:54:59 +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 17A80AEBE; 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:54 +0100 Message-Id: <20180117085458.27293-4-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180117085458.27293-1-agraf@suse.de> References: <20180117085458.27293-1-agraf@suse.de> Cc: Heinrich Schuchardt Subject: [U-Boot] [PATCH v2 3/7] rpi: Remove runtime disabling support for serial 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" We are switching to a model where our board file can directly fail probing of serial devices when they're not usable, so remove the current runtime hack we have. Signed-off-by: Alexander Graf --- arch/arm/mach-bcm283x/include/mach/gpio.h | 1 - board/raspberrypi/rpi/rpi.c | 43 ------------------------------- drivers/gpio/bcm2835_gpio.c | 2 +- 3 files changed, 1 insertion(+), 45 deletions(-) diff --git a/arch/arm/mach-bcm283x/include/mach/gpio.h b/arch/arm/mach-bcm283x/include/mach/gpio.h index 751594d09f..1bcb5846ca 100644 --- a/arch/arm/mach-bcm283x/include/mach/gpio.h +++ b/arch/arm/mach-bcm283x/include/mach/gpio.h @@ -61,7 +61,6 @@ struct bcm2835_gpio_platdata { unsigned long base; }; -int bcm2835_gpio_get_func_id(struct udevice *dev, unsigned gpio); void bcm2835_gpio_set_pinmux(struct udevice *dev, int handle); #endif /* _BCM2835_GPIO_H_ */ diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index 3b7a54f519..a96d5d8952 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -419,54 +419,11 @@ static void get_board_rev(void) printf("RPI %s (0x%x)\n", model->name, revision); } -#ifndef CONFIG_PL01X_SERIAL -static bool rpi_is_serial_active(void) -{ - int serial_gpio = 15; - struct udevice *dev; - - /* - * The RPi3 disables the mini uart by default. The easiest way to find - * out whether it is available is to check if the RX pin is muxed. - */ - - if (uclass_first_device(UCLASS_GPIO, &dev) || !dev) - return true; - - if (bcm2835_gpio_get_func_id(dev, serial_gpio) != BCM2835_GPIO_ALT5) - return false; - - return true; -} - -/* Disable mini-UART I/O if it's not pinmuxed to our pins. - * The firmware only enables it if explicitly done in config.txt: enable_uart=1 - */ -static void rpi_disable_inactive_uart(void) -{ - struct udevice *dev; - struct bcm283x_mu_serial_platdata *plat; - - if (uclass_get_device_by_driver(UCLASS_SERIAL, - DM_GET_DRIVER(serial_bcm283x_mu), - &dev) || !dev) - return; - - if (!rpi_is_serial_active()) { - plat = dev_get_platdata(dev); - plat->disabled = true; - } -} -#endif - int board_init(void) { #ifdef CONFIG_HW_WATCHDOG hw_watchdog_init(); #endif -#ifndef CONFIG_PL01X_SERIAL - rpi_disable_inactive_uart(); -#endif get_board_rev(); diff --git a/drivers/gpio/bcm2835_gpio.c b/drivers/gpio/bcm2835_gpio.c index 209cbed9e6..3edd90ea97 100644 --- a/drivers/gpio/bcm2835_gpio.c +++ b/drivers/gpio/bcm2835_gpio.c @@ -73,7 +73,7 @@ static int bcm2835_gpio_set_value(struct udevice *dev, unsigned gpio, return 0; } -int bcm2835_gpio_get_func_id(struct udevice *dev, unsigned gpio) +static int bcm2835_gpio_get_func_id(struct udevice *dev, unsigned gpio) { struct bcm2835_gpios *gpios = dev_get_priv(dev); u32 val;