From patchwork Thu Jan 25 11:05:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 125808 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1038166ljf; Thu, 25 Jan 2018 03:13:41 -0800 (PST) X-Google-Smtp-Source: AH8x224tXZUYZSmlfs3Y5TORJ6dvGwVyMD34AvPHsbioJjEz1o5S6ULJZus94N9V2yFTVshAtmpE X-Received: by 10.80.157.73 with SMTP id j9mr28306597edk.200.1516878821107; Thu, 25 Jan 2018 03:13:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516878821; cv=none; d=google.com; s=arc-20160816; b=oEisWxwBJ4JI68WIgPxQjDEnpOqlyHI6ow38dND1t0atuces/DKkgEm1CVBQLAQ5Sq MwRvyBmpUj3qaip+2k/xATi3nxxUG9HS3SY6gAdi57EXqOg0ONA6pI2k5ZVQ4vnhfU0l 8zw0cflwgdZUE9fz7HwLp+wGlBIo+8L4/ejoXRnqyRZeRvL7wiVBF27eBIK23/ZRrPDO yHU4chDR2Pay2wAIkSomasLPIaqhZQG7LL5M0WYAYP6O5NSoBHvVuRe0qasQwRHUbI23 trjBtVyDVFoDU2rx7z98RnUTV00M+wgZsO6ZqKJ38r0jJwGI/zmgXKwoxTekG3Pl3QI9 yf3w== 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=0mJNr7oArJU/hVndg7HgYMLFes8EYPkMIHDoeGff+dw=; b=j3m4n/8vCQdqCrg8cYlRqmQRMt3hp9ndN0zBME2W1zS8wObmWzE17sIptt0s9r72et q5ce3zV9tR6Doi3gyZeI2zRiKhxd94GFRVpA74+EQh2liIZp/bDXMbgChy5Uhvb57D69 +5/8gBVDbh5bTSNq3sUHdI0rVGAxOe0GUcC8ZlIeseyIH5B/ku2cH9xX7FZQb+5/BVZQ JJgA4SX2CjSt7toNpwDfW1gmL8NJAl8/R5ERL8xdLS+qQjr1cosTlojeosB/EBXXkYes 50Js32GFefMtOex8yddrQW8X0XaKRMICtbYDiym4Tlr96LSjqEtxTbomV2xapE7qUYIX TOHQ== 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 w13si581189edc.97.2018.01.25.03.13.40; Thu, 25 Jan 2018 03:13:41 -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 94E45C2240D; Thu, 25 Jan 2018 11:10: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=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED 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 94D8EC22403; Thu, 25 Jan 2018 11:10:25 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8861CC223FC; Thu, 25 Jan 2018 11:05:58 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id BCECEC223F9 for ; Thu, 25 Jan 2018 11:05:57 +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 42EC7ACE0; Thu, 25 Jan 2018 11:05:57 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 25 Jan 2018 12:05:42 +0100 Message-Id: <20180125110556.76352-2-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180125110556.76352-1-agraf@suse.de> References: <20180125110556.76352-1-agraf@suse.de> Cc: Tom Rini Subject: [U-Boot] [PATCH v3 01/15] serial: Use next serial device if probing fails 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" Currently our serial device search chokes on the fact that the serial probe function could fail. If it does, instead of searching for the next usable serial device, it just quits. This patch changes the fallback logic so that even when a serial device was not probed correctly, we just try the next ones until we find one that works. Signed-off-by: Alexander Graf Reviewed-by: Simon Glass --- v1 -> v2: - Make search logic easier to follow --- drivers/serial/serial-uclass.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index 2e5116f7ce..68ca2d09d1 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -74,6 +74,7 @@ static void serial_find_console_or_panic(void) { const void *blob = gd->fdt_blob; struct udevice *dev; + int ret; if (CONFIG_IS_ENABLED(OF_PLATDATA)) { uclass_first_device(UCLASS_SERIAL, &dev); @@ -104,8 +105,8 @@ static void serial_find_console_or_panic(void) * from 1!). * * Failing that, get the device with sequence number 0, or in - * extremis just the first serial device we can find. But we - * insist on having a console (even if it is silent). + * extremis just the first working serial device we can find. + * But we insist on having a console (even if it is silent). */ #ifdef CONFIG_CONS_INDEX #define INDEX (CONFIG_CONS_INDEX - 1) @@ -113,10 +114,22 @@ static void serial_find_console_or_panic(void) #define INDEX 0 #endif if (!uclass_get_device_by_seq(UCLASS_SERIAL, INDEX, &dev) || - !uclass_get_device(UCLASS_SERIAL, INDEX, &dev) || - (!uclass_first_device(UCLASS_SERIAL, &dev) && dev)) { - gd->cur_serial_dev = dev; - return; + !uclass_get_device(UCLASS_SERIAL, INDEX, &dev)) { + if (dev->flags & DM_FLAG_ACTIVATED) { + gd->cur_serial_dev = dev; + return; + } + } + + /* Search for any working device */ + for (ret = uclass_first_device_check(UCLASS_SERIAL, &dev); + dev; + ret = uclass_next_device_check(&dev)) { + if (!ret) { + /* Device did succeed probing */ + gd->cur_serial_dev = dev; + return; + } } #undef INDEX } From patchwork Thu Jan 25 11:05:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 125813 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1039811ljf; Thu, 25 Jan 2018 03:16:41 -0800 (PST) X-Google-Smtp-Source: AH8x226MeQHuiD8vRE5qcfcyIJvLq9OpYQtcrNxGW6wQrh06b/qJlhQQC4dyOGzPFbQxeJ8gCOMC X-Received: by 10.80.153.143 with SMTP id m15mr28893483edb.145.1516879001697; Thu, 25 Jan 2018 03:16:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516879001; cv=none; d=google.com; s=arc-20160816; b=NohBgK1oP0FB/ylNonvUTbRFK4bRPH9/Ad/BQ6AtK/MEOZsm2034HpuTtzNKRIN17Y GOZ9hrXnIW+yVbgQYYGpQBN0qreyYALGWutxEfD/lAOQiB4TzUl08nBJNErb9ECji9J5 xy+7MbSmbXsbhJxxSTO1dgAzOYrvwaGr/bHPyWdTlEvIfV8jDnZQRE3Tbp78gvPZhK3V k8LegfZ6uOSlhSNE4Wufsh8dXyPYaAm0NTiF3hGMH2Ez3mjwDFo7+9fEyu6jvZw4oHZX rvbtWaGcatYhn/0TBG2Mknu/DOJYPLBWvCn7ypxoHgfiE4CxIp7PxSEjoqhWCkEj9Tv7 plEA== 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=rwiZdajnWyseXrRYm44oMLicafLdc7nvlBTXddS14p4=; b=zdR/FAd8kl+Mow6wiPMuJTjTclRCCXYpGEqN1CLbojYWaovz75/DP4ksxELb9WHMhw WtwO0Pwi9J2HddDM0UuL1V1iDGtYMEYxuqNYpyydaAxsqOIctU8yzOFQvFXqd9us/nKD I2JcgpPdtjIw7fafN5KaGsrgDq4SaObqghq/drOHwt+epUQrOn2vgTegRT1iDmd2TRqw 31un3IBXnclo8TMED3iUVxgL7NhFzLrq5Jhd2W64ElomC7menVJlP3IKuIe/g3EkhKZw Q2vMc1A3LSdrJ4arjQ9oKHiDStXDrlV5fUldLKVod1t15MPPqYbVuThWzCD4F6WlPJ4t rDGw== 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 y14si1261210edc.119.2018.01.25.03.16.41; Thu, 25 Jan 2018 03:16:41 -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 1A3BFC2244A; Thu, 25 Jan 2018 11:13:45 +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=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED 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 7E91AC223DB; Thu, 25 Jan 2018 11:12:07 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9C87DC22417; Thu, 25 Jan 2018 11:05:58 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id C05AFC22405 for ; Thu, 25 Jan 2018 11:05:57 +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 62384AC43; Thu, 25 Jan 2018 11:05:57 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 25 Jan 2018 12:05:43 +0100 Message-Id: <20180125110556.76352-3-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180125110556.76352-1-agraf@suse.de> References: <20180125110556.76352-1-agraf@suse.de> Cc: Tom Rini Subject: [U-Boot] [PATCH v3 02/15] 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 --- board/raspberrypi/rpi/rpi.c | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index c8924d4362..177f4af265 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -420,54 +420,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_PINCTRL, &dev) || !dev) - return true; - - if (pinctrl_get_gpio_mux(dev, 0, 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(); From patchwork Thu Jan 25 11:05:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 125818 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1042876ljf; Thu, 25 Jan 2018 03:22:30 -0800 (PST) X-Google-Smtp-Source: AH8x2260wW943M6USWUtUIxUvuFNW02oPr9NKO4HkpAJSD8cG3Rf2yqLr4LeUW+qRIErZI2OBvgJ X-Received: by 10.80.157.141 with SMTP id w13mr7950619ede.123.1516879350729; Thu, 25 Jan 2018 03:22:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516879350; cv=none; d=google.com; s=arc-20160816; b=rhqpNVXf94FfvGNTt1XhQ4Dfi7SldnIAIvDlSXyfZAuNss0WCjxnv/q61Z0UZJ85Ku aMAoPtUKV6BgBVoaA78C4/SOnP37K8hjJBKb4emIHTQQKOhFXU2h09lzAUCmu7d7a6xA 9bjeLg0qQBXJ2rLTSEUgkEg8Bym/Qe+6Dqew7Wcgb7NjoqqjSDxbGTO1A2e9RdByIos8 EOBn8pXurmYajw6gI846KDVOSJKHdm9URUcMvyKh4WOTWTyWXWofP0AterzzE40V9VR8 U+LfSq/CKgUc01kAWDpBi6d4BQeSEix3APcB4bDWQy20hswz9mK/wdCyIrC+hgED4fmt EjqQ== 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=HJqILOaDFKg7ohORG24VvFdjWHLuwXj53eUdG+GG74I=; b=lijSrn/xysnidIybvLHScOhMwAnkfwwQC4t2P59YjYKv76C0YqnIZ99D+2Tll2PQP5 hrc5diDuTCDtorEp6hrpV3OoNbjkBGzIsWyIqCz/3W5MAWFn7NXTiXuGhgu9NyRqRDoU n3UP2pmZrRbWHaCnrnmWj553GEJeXgJbK0O3xIUF0DyAnABBdLYXqoBS7hmRgny/qBAA ECTp/OluXXn22uHl2Fz6gbJonx3Vu0xHll6k+3XuTQxzbgs6odMlU6u6OENREy+mYKzT rTvTZX/C53AfxCQn4WG9vyWUqmwMgG21XG3wHaWBzU7sQv+ZMoeHb+apSX2DhqKAyCTf E95A== 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 l13si2025450edj.196.2018.01.25.03.22.30; Thu, 25 Jan 2018 03:22:30 -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 47A06C2245A; Thu, 25 Jan 2018 11:14:39 +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=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED 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 95DCFC22427; Thu, 25 Jan 2018 11:12:39 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D4F3AC2240E; Thu, 25 Jan 2018 11:05:58 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id C0C5EC22408 for ; Thu, 25 Jan 2018 11:05:57 +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 42F58AD0C; Thu, 25 Jan 2018 11:05:57 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 25 Jan 2018 12:05:44 +0100 Message-Id: <20180125110556.76352-4-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180125110556.76352-1-agraf@suse.de> References: <20180125110556.76352-1-agraf@suse.de> Cc: Tom Rini Subject: [U-Boot] [PATCH v3 03/15] serial: bcm283x_mu: Remove support for post-init disabling 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 a serial device doesn't even get probed when it's not muxed properly, so we don't need device specific disabling functionality anymore. Signed-off-by: Alexander Graf --- drivers/serial/serial_bcm283x_mu.c | 18 +----------------- include/dm/platform_data/serial_bcm283x_mu.h | 1 - 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/drivers/serial/serial_bcm283x_mu.c b/drivers/serial/serial_bcm283x_mu.c index 41c26b3d93..7ce990b9b8 100644 --- a/drivers/serial/serial_bcm283x_mu.c +++ b/drivers/serial/serial_bcm283x_mu.c @@ -59,7 +59,7 @@ static int bcm283x_mu_serial_setbrg(struct udevice *dev, int baudrate) struct bcm283x_mu_regs *regs = priv->regs; u32 divider; - if (plat->disabled || plat->skip_init) + if (plat->skip_init) return 0; divider = plat->clock / (baudrate * 8); @@ -75,9 +75,6 @@ static int bcm283x_mu_serial_probe(struct udevice *dev) struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev); struct bcm283x_mu_priv *priv = dev_get_priv(dev); - if (plat->disabled) - return -ENODEV; - priv->regs = (struct bcm283x_mu_regs *)plat->base; return 0; @@ -85,14 +82,10 @@ static int bcm283x_mu_serial_probe(struct udevice *dev) static int bcm283x_mu_serial_getc(struct udevice *dev) { - struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev); struct bcm283x_mu_priv *priv = dev_get_priv(dev); struct bcm283x_mu_regs *regs = priv->regs; u32 data; - if (plat->disabled) - return -EAGAIN; - /* Wait until there is data in the FIFO */ if (!(readl(®s->lsr) & BCM283X_MU_LSR_RX_READY)) return -EAGAIN; @@ -104,13 +97,9 @@ static int bcm283x_mu_serial_getc(struct udevice *dev) static int bcm283x_mu_serial_putc(struct udevice *dev, const char data) { - struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev); struct bcm283x_mu_priv *priv = dev_get_priv(dev); struct bcm283x_mu_regs *regs = priv->regs; - if (plat->disabled) - return 0; - /* Wait until there is space in the FIFO */ if (!(readl(®s->lsr) & BCM283X_MU_LSR_TX_EMPTY)) return -EAGAIN; @@ -123,14 +112,10 @@ static int bcm283x_mu_serial_putc(struct udevice *dev, const char data) static int bcm283x_mu_serial_pending(struct udevice *dev, bool input) { - struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev); struct bcm283x_mu_priv *priv = dev_get_priv(dev); struct bcm283x_mu_regs *regs = priv->regs; unsigned int lsr; - if (plat->disabled) - return 0; - lsr = readl(®s->lsr); if (input) { @@ -168,7 +153,6 @@ static int bcm283x_mu_serial_ofdata_to_platdata(struct udevice *dev) 1); plat->skip_init = fdtdec_get_bool(gd->fdt_blob, dev_of_offset(dev), "skip-init"); - plat->disabled = false; return 0; } #endif diff --git a/include/dm/platform_data/serial_bcm283x_mu.h b/include/dm/platform_data/serial_bcm283x_mu.h index c47d3c0e60..57ae6adc05 100644 --- a/include/dm/platform_data/serial_bcm283x_mu.h +++ b/include/dm/platform_data/serial_bcm283x_mu.h @@ -19,7 +19,6 @@ struct bcm283x_mu_serial_platdata { unsigned long base; unsigned int clock; bool skip_init; - bool disabled; }; #endif From patchwork Thu Jan 25 11:05:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 125811 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1039403ljf; Thu, 25 Jan 2018 03:15:57 -0800 (PST) X-Google-Smtp-Source: AH8x227zzFbSsveQI6yczhFsosZ6bbpYE6gr9UgUZYUw1nELI2AjhsZwScyjYibHAEOQDW+EL0Ch X-Received: by 10.80.217.10 with SMTP id t10mr28805821edj.171.1516878957035; Thu, 25 Jan 2018 03:15:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516878957; cv=none; d=google.com; s=arc-20160816; b=B/jUSCUuHwKaZwQ2Vo9GVBAZcXiyEk21dQulPufxkm6pRlJGRQB/PQ4ZTJXjKIFovJ E9XYrNgC0BlcQJ1J26xjUqzXo1TzL/4bc/kpcH5KseYmkpqY/4PiKVJMCo747HnT5j0U UCAcfvqbR6mlm69wGoXtBClK/5fe2hdk3mMT8eje+4mImzgbfbCjKZ0lKHfbrjkgRt2E oIPjHmsIcfZ+GBGj/H994/S5U18+4xr/KUbu6GhqOcUCDD7Nl3pWo/7CBFWnx88s4sd7 W4KfxLn7Dm+jpnBV/TR9cF6vLa+oQKLPmkxILD3JCrM9m08IrMH29gl0Hk5nrog0N/7z lUWA== 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=vjByN3VpjONssZ//WMNF3UyzxPOSm30YZEVIUSnmtlQ=; b=fQhFoahiZ+bBYJxw8PfQpEpXj2Z2KikPKCEeLNt53J/ihp0tIxhMCyzPLT7QrCsF2V FXgmCFPDpEJy84L/a88+WU8m+ACaR9jXJ55U/pZ9q+HUDzactOjBbNtHBbSHoBPZSpke QXHCwBeoGkVa9GjQk8VVMZykMt5BPuxBp0T/b+DMQ6bSDFsx+uWyhKViEPdWqJ8OYngJ bfdSEdLVb/bgwmQRedSroFR4pJcH7jEatd64XjiYdvetc8dLY7cdI1wa85OmGqzkropA l4fh/RBLdWy4fu38uxOojQHsT903tXT/PrRjlKIsQ8DCiV5DKS0TZlBE8k6oxR9x/x4W BG+Q== 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 o2si1903538edb.184.2018.01.25.03.15.56; Thu, 25 Jan 2018 03:15:57 -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 A6582C2244D; Thu, 25 Jan 2018 11:14:21 +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=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED 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 AABC4C22433; Thu, 25 Jan 2018 11:12:29 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2F53BC2242B; Thu, 25 Jan 2018 11:05:58 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id BD793C22400 for ; Thu, 25 Jan 2018 11:05:57 +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 4A8C0ADB6; Thu, 25 Jan 2018 11:05:57 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 25 Jan 2018 12:05:45 +0100 Message-Id: <20180125110556.76352-5-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180125110556.76352-1-agraf@suse.de> References: <20180125110556.76352-1-agraf@suse.de> Cc: Tom Rini Subject: [U-Boot] [PATCH v3 04/15] rpi: Determine PL011/Mini-UART availability at runtime 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" Firmware on the Raspberry Pi family of devices can dynamically configure either the PL011, Mini-UART or no device at all to be routed to the user accessible UART pins. That means we need to always include both drivers, because we can never be sure which of the two serial devices firmware actually chooses to use. Signed-off-by: Alexander Graf --- include/configs/rpi.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/configs/rpi.h b/include/configs/rpi.h index cab8661779..2c84cf9a49 100644 --- a/include/configs/rpi.h +++ b/include/configs/rpi.h @@ -75,12 +75,9 @@ #define CONFIG_MISC_INIT_R #endif -/* Console UART */ -#if defined (CONFIG_BCM2837) || defined(CONFIG_TARGET_RPI_0_W) +/* Console UART, can be configured dynamically in config.txt */ #define CONFIG_BCM283X_MU_SERIAL -#else #define CONFIG_PL01X_SERIAL -#endif /* Console configuration */ #define CONFIG_SYS_CBSIZE 1024 From patchwork Thu Jan 25 11:05:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 125805 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1036627ljf; Thu, 25 Jan 2018 03:10:54 -0800 (PST) X-Google-Smtp-Source: AH8x225hCZIENFx2k9fIFpOKMDBD+3CMjvgj+Zpc93V/fMltLPE9a7IvLvp/uxrujPHUh12bjtF6 X-Received: by 10.80.213.132 with SMTP id v4mr18695222edi.58.1516878654677; Thu, 25 Jan 2018 03:10:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516878654; cv=none; d=google.com; s=arc-20160816; b=QwD/y92pgDNXfkdkj69XhGvDOQexa1a9kjyoRD/V93JOFSW8aptOB/JS+Q8CSWNxE1 VPjtekov9gPtql1UT3esOQYh4favrCQoxEWvYm/O2BtBHBQXw3CPDIZFejwkjOgIPQl3 4qIkhv93PNSXGOCyyyJJaYAePNm5YUD1V3qctZpO/xtcw0wvAr/pHbCJTgYzkiI6Akfl 44RKOAf8Vm2HVFT30OEagsiANrmn+HWYWKIfH0FhWjNDuqN/uzApzK73F7DQ2cVncR0k rP/zgje5vMcEUzbjrfeioesvip45+VNUVS6O7yC8681rh4crtKptdI5yf6zyvWcbkQlX 2QLw== 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=obV1DfX16r/mml3PL9K5o3oETX7h6Ns30Cf0FMVuj0o=; b=yoJtJga7AxJ67g9ioflxYmrFYJX3krmGYHVl2HmenEvk83JQwk4TMHaYR+3Ea08VBx IB0WMkro80kPlJNjWnZHnuzazy+WRM5iAlJLp1jXeQgA2Dp+Ed/fhthppkGzuwcyRiPh xzOdWb//PuyzxpCqPtWtJLUKcOTm9RpC/uuTfdIUrhSejBE3UTxd/XpEutPmIVz0LpRY 5r8wVZAKV2C4e27dXlVoG9cdKgp42qT7NH42ELutY6h3ka0J3woCMDHnqv5IyKC6wWCT bULVEKG1YJwWHIetrGcLCNYty4gOz+zqW31JcA+kVUINPhMSDSKEGwvJZRA3rIE+aE0a Wvlw== 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 e19si1803329edb.142.2018.01.25.03.10.54; Thu, 25 Jan 2018 03:10:54 -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 56A9AC223DB; Thu, 25 Jan 2018 11:08:53 +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=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED 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 BA33AC2241A; Thu, 25 Jan 2018 11:08:51 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id DA94FC223D4; Thu, 25 Jan 2018 11:06:01 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 58601C223B0 for ; Thu, 25 Jan 2018 11:06:01 +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 24698AC43; Thu, 25 Jan 2018 11:06:01 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 25 Jan 2018 12:05:46 +0100 Message-Id: <20180125110556.76352-6-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180125110556.76352-1-agraf@suse.de> References: <20180125110556.76352-1-agraf@suse.de> Cc: Tom Rini Subject: [U-Boot] [PATCH v3 05/15] serial_bcm283x_mu: Convert to dev_read 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 fdtdec API got deprecated in favor of dev_read calls. Use those instead. Signed-off-by: Alexander Graf --- drivers/serial/serial_bcm283x_mu.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/serial/serial_bcm283x_mu.c b/drivers/serial/serial_bcm283x_mu.c index 7ce990b9b8..20dc3defcc 100644 --- a/drivers/serial/serial_bcm283x_mu.c +++ b/drivers/serial/serial_bcm283x_mu.c @@ -23,9 +23,6 @@ #include #include #include -#include - -DECLARE_GLOBAL_DATA_PTR; struct bcm283x_mu_regs { u32 io; @@ -149,10 +146,9 @@ static int bcm283x_mu_serial_ofdata_to_platdata(struct udevice *dev) return -EINVAL; plat->base = addr; - plat->clock = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "clock", - 1); - plat->skip_init = fdtdec_get_bool(gd->fdt_blob, dev_of_offset(dev), - "skip-init"); + plat->clock = dev_read_u32_default(dev, "clock", 1); + plat->skip_init = dev_read_bool(dev, "skip-init"); + return 0; } #endif From patchwork Thu Jan 25 11:05:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 125807 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1037134ljf; Thu, 25 Jan 2018 03:11:47 -0800 (PST) X-Google-Smtp-Source: AH8x2249MPvGr0JCuD4061XMXJwD4oAi/MyN2KjdeNWrLRZ1dHnEaacEFbr0BDhrPVXUQK38b5ac X-Received: by 10.80.179.106 with SMTP id r39mr29338558edd.75.1516878707360; Thu, 25 Jan 2018 03:11:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516878707; cv=none; d=google.com; s=arc-20160816; b=ieNyuMiHhqClW1ObAUYD8zpLKLWkb05yXUeMeIWu1cm4wFrZbon4g+zMuG7qhKaKR+ 6I5r9JTqYj/Usve2qcrYnZ+2bWltbc6aUzAIcgoUYew2vb91SjybFwGxXIkd8J8BvKxS bCQ6AAwdSN189pb/7kZPaQWwbNc1mnoMTFAejQIYJGk8yOpn4B+jlfeNX7dO6gABaZNZ QMVP0w2LWvwiHb6yqEH2d8M5h5C7R00dS/5mZDESIBH9zzUUcg4+BAIZpIgVJEHzXzOJ Bg1N7fgrOo12jiVt8/00ObkSSY1VQQKnnkoPoofhO0OTNwsckfjhAgH1Q+E6OWS2lezr f9nA== 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=i/XYnkGA8Em7SlEr59GDaFS/+D/VgHYj20rbq2QT4Wc=; b=k2q200a1wZFT+6kvXWCkVJBsAMq4RCHWUgNrKKn2BS9mOpFrZrHxPEGDqlu7iHSWt7 HPFqbAn3Bs47Du/jwck12R1ThCw5jBZoSyL+YhSZgrr2pUEPX0A86jkmNqPOSFFn+I/j /06rJ+1R/FcNwapbcLhZcILUPQhDK528ZKGaa/NlrPPzkkjFoBp2fqg3CObnbOc1vDaD IfiKo2NF17W+x8YmhwKGTIYctpLR9M2vlJk2o7NNkRMUV63Q48OVut4Ll4oSjdcqq9d8 IhxkqER2LNqfXF/QvXMe4u6zBnw39AUZmBWrxIXkJGJ3tequaeKEjGTNsdDTu9P/qVF2 CrNQ== 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 33si1860015edf.108.2018.01.25.03.11.47; Thu, 25 Jan 2018 03:11:47 -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 F3A21C22436; Thu, 25 Jan 2018 11:09:16 +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=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED 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 8B23AC22419; Thu, 25 Jan 2018 11:09:15 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7885FC22423; Thu, 25 Jan 2018 11:05:58 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 930A9C223ED for ; Thu, 25 Jan 2018 11:05:58 +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 6317AADFE; Thu, 25 Jan 2018 11:05:58 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 25 Jan 2018 12:05:47 +0100 Message-Id: <20180125110556.76352-7-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180125110556.76352-1-agraf@suse.de> References: <20180125110556.76352-1-agraf@suse.de> Cc: Tom Rini Subject: [U-Boot] [PATCH v3 06/15] serial_bcm283x_mu: Always skip init 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 serial initialization doesn't always quite work for me, so let's always skip it for now. We know that firmware on the RPi initializes us properly already. Signed-off-by: Alexander Graf --- drivers/serial/serial_bcm283x_mu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/serial/serial_bcm283x_mu.c b/drivers/serial/serial_bcm283x_mu.c index 20dc3defcc..c6132b4463 100644 --- a/drivers/serial/serial_bcm283x_mu.c +++ b/drivers/serial/serial_bcm283x_mu.c @@ -147,7 +147,12 @@ static int bcm283x_mu_serial_ofdata_to_platdata(struct udevice *dev) plat->base = addr; plat->clock = dev_read_u32_default(dev, "clock", 1); - plat->skip_init = dev_read_bool(dev, "skip-init"); + + /* + * TODO: Reinitialization doesn't always work for now, just skip + * init always - we know we're already initialized + */ + plat->skip_init = true; return 0; } From patchwork Thu Jan 25 11:05:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 125820 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1043324ljf; Thu, 25 Jan 2018 03:23:24 -0800 (PST) X-Google-Smtp-Source: AH8x227Q25LMS0mpbv95jeLW5fftw6lHjDNMX9+B/9/4QWGZuRAkNb4LxdtfMTvtl8MZk0Ew4MAY X-Received: by 10.80.244.23 with SMTP id r23mr28029468edm.2.1516879404401; Thu, 25 Jan 2018 03:23:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516879404; cv=none; d=google.com; s=arc-20160816; b=ULi5sdN14MA4L4izEzp7ge/EooveIhoDJcTOEVmWwFEsGkaH2srKc4wBxSrLStNPs8 mkK2S/tnl+qmpcwyU1+BBBYvyulNeS2s/S6tknTXjWVOUx/dieDA+U9J+vdPc8ex4H3U IuxR0htyhOId/e2/ZxMJugeANBeORmlgko3hvC7IW+pzzJwv8HUSOvtlA9Rtm7XrAWiN 5Eem1Mw55Mm1HnA4YqSHjEuG1IEeHfQYBuaDC5pYQ7CiVaYY7bYbX9ygZg+pIYZNl8ze S5I5g0EoU7oBiMpUFZkF5cvI/oz6H6Y6bvTBWx3Mosi/y8fW3HqDHio+pzMwAI2petnn ROUw== 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=hpvrIb5gE+PRkF5V3DKzF3Spn/TmQjUhmjxpTdKsoB8=; b=d447u6AiHMuQ74VLbzFo0VGHkZBmIMc28l4hMwOKRI7+Rxl/Ax1lKf+Vg9Qc2KZtt1 jJx6igN77UFWA+GcaHEqqwj4/pM9Iib4r4oK0wF8YgB5w0nN+3adeQiONIFzMXrezUV5 o8BCp+2lDjc8/NpFd9AarFmdIqOow++rFYIysxSO52aVMGVk8xzrQ/eVtl2hGRU0I5FF 4DtV3diRvsGznH0PuQyk8f4CkP47LKr9ZhOXi2Yq3+i58kBP+Zlv3RK4OdcxUBZA6PZf +g8Qfbm/39gUv4o37S+TRTAT/7CuHcOrbvYFtfsssl7EjFsc2tv25WFhXm0FPzuPoHLE dPFQ== 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 h89si1964745edd.471.2018.01.25.03.23.23; Thu, 25 Jan 2018 03:23:24 -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 A7798C22454; Thu, 25 Jan 2018 11:18:12 +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=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED 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 A57C0C22421; Thu, 25 Jan 2018 11:13:52 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 314A8C2241B; Thu, 25 Jan 2018 11:05:58 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 103D3C223ED for ; Thu, 25 Jan 2018 11:05:58 +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 72656ADE9; Thu, 25 Jan 2018 11:05:57 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 25 Jan 2018 12:05:48 +0100 Message-Id: <20180125110556.76352-8-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180125110556.76352-1-agraf@suse.de> References: <20180125110556.76352-1-agraf@suse.de> Cc: Tom Rini Subject: [U-Boot] [PATCH v3 07/15] serial_bcm283x_mu: Fail loading if not muxed 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 bcm283x mini-uart is only really usable as U-Boot serial output when it is muxed to the UART pins of the RPi pin header. So fail probing in case it is not muxed correctly, as in that case firmware did not initialize it properly either. Signed-off-by: Alexander Graf --- drivers/serial/serial_bcm283x_mu.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/serial/serial_bcm283x_mu.c b/drivers/serial/serial_bcm283x_mu.c index c6132b4463..40029fadbc 100644 --- a/drivers/serial/serial_bcm283x_mu.c +++ b/drivers/serial/serial_bcm283x_mu.c @@ -19,9 +19,11 @@ #include #include #include +#include #include #include #include +#include #include struct bcm283x_mu_regs { @@ -136,11 +138,37 @@ static const struct udevice_id bcm283x_mu_serial_id[] = { {} }; +/* + * Check if this serial device is muxed + * + * The serial device will only work properly if it has been muxed to the serial + * pins by firmware. Check whether that happened here. + * + * @return true if serial device is muxed, false if not + */ +static bool bcm283x_is_serial_muxed(void) +{ + int serial_gpio = 15; + struct udevice *dev; + + if (uclass_first_device(UCLASS_PINCTRL, &dev) || !dev) + return false; + + if (pinctrl_get_gpio_mux(dev, 0, serial_gpio) != BCM2835_GPIO_ALT5) + return false; + + return true; +} + static int bcm283x_mu_serial_ofdata_to_platdata(struct udevice *dev) { struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev); fdt_addr_t addr; + /* Don't spawn the device if it's not muxed */ + if (!bcm283x_is_serial_muxed()) + return -ENODEV; + addr = devfdt_get_addr(dev); if (addr == FDT_ADDR_T_NONE) return -EINVAL; From patchwork Thu Jan 25 11:05:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 125819 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1042906ljf; Thu, 25 Jan 2018 03:22:33 -0800 (PST) X-Google-Smtp-Source: AH8x226C4xHkR7qoSu+suvE7tPWXqPgMQHjmwbPQv2SpdLAdgkxIUkhG+M9PMqWp6gwJfkbXsfT9 X-Received: by 10.80.205.140 with SMTP id p12mr29023259edi.169.1516879353369; Thu, 25 Jan 2018 03:22:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516879353; cv=none; d=google.com; s=arc-20160816; b=aylpMsv3t/RDrpFujXk5bQxPgHf09csvBPLtUqtyh042HYoYXHs2NaYPycytLRzwg6 yUpKXsN7JpE38Uy4yHXYLsZXc1V3OFwahIKuG9pu8LMvx73IXdwuT/fTZbp1pL+TzQ0Q Tn1VjCf8tfousOQ+6G5USvYUd6Sfap3/LFuhiFD07WacGz+Ai6ecW8xuqGIA0W8vNyoP JucSpSN5y4jhp1wwa0DAU/0KI5Q9TND0Kug8DMaVJ7JX5ZrFO3hoO4UclGy+tY957htP 30UXMBFnqagBL259EBvgGMXQ31HLzb7LAUe1iSFmYFEZ0uDE/lj7s6NQpPsG/Z31Frgh 1Yrg== 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=ssF0kYnNxt/3dRrFrizZt0yPAnMq2twNO8hhlN9IKyc=; b=zWYGA99HZGjgZkeqoX9Karbo5cyRkd+d7CsRBR/bBH4WPnYieDE1/IDkv4ghkDNv4+ u/yh6gXDSUAdSGIdEcMTcN5onZZaYQkuCRTyPILBIOeususyaeliURRDpc1crJ//v9qd 15UXrAi/iT7HrwPaI0SJQnN7uw++3iwRsV1i37HpAE6C4A4x/deKVDU19t3YTW1SOgRL ydr1kB02+40KY7E6TiMlkkF7o4SdI9vnxVER+dClfoHWg5czChSVN9c+T5L9K1F6EnRm zpgjP+ET7F65JF76Xem2uZWE0FO8oiVYJl08Kq2LE0jgiGUqIDFrmDcWa+8fzm4G0Jjo MSEQ== 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 s39si1767141edm.150.2018.01.25.03.22.33; Thu, 25 Jan 2018 03:22:33 -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 E9897C2249C; Thu, 25 Jan 2018 11:14:04 +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=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED 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 1204FC22434; Thu, 25 Jan 2018 11:12:11 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7EC0DC22431; Thu, 25 Jan 2018 11:05:58 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 13BEAC22410 for ; Thu, 25 Jan 2018 11:05:58 +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 7F134ADF0; Thu, 25 Jan 2018 11:05:57 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 25 Jan 2018 12:05:49 +0100 Message-Id: <20180125110556.76352-9-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180125110556.76352-1-agraf@suse.de> References: <20180125110556.76352-1-agraf@suse.de> Cc: Tom Rini Subject: [U-Boot] [PATCH v3 08/15] pl01x: Convert to dev_read 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 fdtdec API is deprecated, convert the pl010 and pl011 devices to use the dev_read API instead. Signed-off-by: Alexander Graf --- drivers/serial/serial_pl01x.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c index 4ec0f29c42..2cbc84c1b4 100644 --- a/drivers/serial/serial_pl01x.c +++ b/drivers/serial/serial_pl01x.c @@ -20,7 +20,6 @@ #include #include #include "serial_pl01x_internal.h" -#include DECLARE_GLOBAL_DATA_PTR; @@ -354,11 +353,10 @@ static int pl01x_serial_ofdata_to_platdata(struct udevice *dev) return -EINVAL; plat->base = addr; - plat->clock = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "clock", - 1); + plat->clock = dev_read_u32_default(dev, "clock", 1); plat->type = dev_get_driver_data(dev); - plat->skip_init = fdtdec_get_bool(gd->fdt_blob, dev_of_offset(dev), - "skip-init"); + plat->skip_init = dev_read_bool(dev, "skip-init"); + return 0; } #endif From patchwork Thu Jan 25 11:05:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 125817 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1041626ljf; Thu, 25 Jan 2018 03:20:02 -0800 (PST) X-Google-Smtp-Source: AH8x226hvnllooFcCdZMn7YVSf/hYChKhiQiaMLCilMQ7+wdaYxhZFo5ew9FImS6uDpg1+72P/rm X-Received: by 10.80.171.21 with SMTP id s21mr29961958edc.117.1516879202870; Thu, 25 Jan 2018 03:20:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516879202; cv=none; d=google.com; s=arc-20160816; b=cbDxgfiBZ3WOC86Q3/5I7wXuqD5QrEAwRGYdfAwcSOzvwbv8pSYi9saovdyx77kd3A eo1KH+fpiePyaFaTAj+6oG5llA16WmlcfVGmd3xPhRbvUz6wnE5lDf7Tt+08uJMdLzmF A5f7dEubhgwOvcFybUtwj+qzphoqyYh22oxtRQDHMCo2hXARQAysq4E3I0urI5Z+Zuj9 pCUWErBsyBzsLQ+jb5iX1TeKAD9Z7GXRruNVXTvzm6pMuhqVGkvW16CcLQT5tZ6+KWHF dGU87a2Got64vpbiQ92gYf+PVvTbKGTyPWcUMr5Q7FMt8qlRDS/z3yKpmEySW0PI6oRL +ysg== 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=zmHlJHi+aOnMqI1es5K9MpaVlkPt6GL0gRe8Vzy42jM=; b=0ODkFg9SgPU7M/KeorTqJwRM0hPbVmgZ1Zk24AZAG49DkGjgu6zNgeZ6YCuaDMt2xm RPZnP18V1EYrUXxUDozpGazQrehCfW+BGH8DbOepxOK0S+e7fPJFcCGAQ+jSmxuV2NO7 a/keGCIi9PcaVIHu8VJrc+2fFjQZrM/FPPGleKM+7niEL/FrSD5zcHzlOgp/voQxfgLl NOJD7fIM1P6rcUNkrHdEm1s3/je/Ngbi1DNemNnW8Qln9Ri+a5qFzLw58OhblxAqLipo 0SDBZ+T6LkIBzsUNWcMJ/cuI7kv5mVSGYe+Q5PldHdKLl1IE5KzHhgZZayhwnyutRBSS Hc0g== 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 b56si1885847eda.69.2018.01.25.03.20.02; Thu, 25 Jan 2018 03:20:02 -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 6984BC21F76; Thu, 25 Jan 2018 11:17:53 +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=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED 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 7A114C223D4; Thu, 25 Jan 2018 11:13:32 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BE2D1C2240E; Thu, 25 Jan 2018 11:05:58 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 13816C2240B for ; Thu, 25 Jan 2018 11:05:58 +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 8B74FADF6; Thu, 25 Jan 2018 11:05:57 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 25 Jan 2018 12:05:50 +0100 Message-Id: <20180125110556.76352-10-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180125110556.76352-1-agraf@suse.de> References: <20180125110556.76352-1-agraf@suse.de> Cc: Tom Rini Subject: [U-Boot] [PATCH v3 09/15] pl010: Convert CONFIG_PL010_SERIAL to Kconfig 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 want to use Kconfig logic to depend on whether pl01x devices are built in, so let's convert their inclusion selection to Kconfig. This round goes to pl010. Signed-off-by: Alexander Graf --- arch/arm/Kconfig | 1 + drivers/serial/Kconfig | 6 ++++++ include/configs/edb93xx.h | 1 - scripts/config_whitelist.txt | 1 - 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index f6d57f5505..97b8249432 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -348,6 +348,7 @@ config ARCH_AT91 config TARGET_EDB93XX bool "Support edb93xx" select CPU_ARM920T + select PL010_SERIAL config TARGET_ASPENITE bool "Support aspenite" diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 7b20b47964..2816121dec 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -447,6 +447,12 @@ config INTEL_MID_SERIAL Select this to enable a UART for Intel MID platforms. This uses the ns16550 driver as a library. +config PL010_SERIAL + bool "ARM PL010 driver" + depends on !DM_SERIAL + help + Select this to enable a UART for platforms using PL010. + config ROCKCHIP_SERIAL bool "Rockchip on-chip UART support" depends on DM_SERIAL && SPL_OF_PLATDATA diff --git a/include/configs/edb93xx.h b/include/configs/edb93xx.h index 8fcc791ab4..fcad7c46dd 100644 --- a/include/configs/edb93xx.h +++ b/include/configs/edb93xx.h @@ -80,7 +80,6 @@ #define CONFIG_SYS_CBSIZE 1024 /* Console I/O buffer size */ /* Serial port hardware configuration */ -#define CONFIG_PL010_SERIAL #define CONFIG_CONS_INDEX 0 #define CONFIG_SYS_BAUDRATE_TABLE {9600, 19200, 38400, 57600, \ 115200, 230400} diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index c98f262079..5ee6b07c6d 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1626,7 +1626,6 @@ CONFIG_PIXIS_BRDCFG1_SSI_TDM_MASK CONFIG_PIXIS_BRDCFG1_SSI_TDM_SSI CONFIG_PIXIS_BRDCFG1_TDM CONFIG_PIXIS_SGMII_CMD -CONFIG_PL010_SERIAL CONFIG_PL011_CLOCK CONFIG_PL011_SERIAL CONFIG_PL011_SERIAL_RLCR From patchwork Thu Jan 25 11:05: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: 125806 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1036712ljf; Thu, 25 Jan 2018 03:11:02 -0800 (PST) X-Google-Smtp-Source: AH8x225LLE1YGUGVpaDlqrhSPKg1l+G5jTYAtXLIz79HLW2k4zYiSh9GgjyjnjRqOYKIKoJNxND7 X-Received: by 10.80.143.38 with SMTP id 35mr28964415edy.183.1516878662328; Thu, 25 Jan 2018 03:11:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516878662; cv=none; d=google.com; s=arc-20160816; b=zdBJxd3ZBUp/iC6QvXzcuTGIfzgCNGAhsmRvgnb5v9ByPoGvZDMKnaqyV+/SpFHNU2 RTP5AOB7xVSyKfwDEirXTuciAEeSJ4TbWT8fGPSjoAOWFkopR+FwaJLzbBSOVnvYuZ5J ATMrULp/+mZe/UseRvGcSmVA2dBL8j+f/oI2iav+epMoRCS7CGaqe3RyjemDN3im39EQ keygNwoaa64tf9Uxcrw9KRfkeOL0F6Adf6UMI93jaT5zPiaZNZnEKtuyX2G4le3ddujF DQVtg6a+fOhzclbIn73Mj28MnYxy+ygxmtgjn3bBBxMqgmX3iUJ6lkNpdGWNrgUC1/EH Ucpw== 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=2AO1oqKURLzGlO/kmOY7DfXTiS6CnIoc8U2V4HzN3n8=; b=NkEjRcC64Q/kyBU5LqjTHE20pu4BrMpvitF7M5wquDkQTvmrFXbiujLTRqq0tNT40E PNEGOlG12SBTzlRW+nmH8VfdcIFJlAa1RI4/C0aZ2PZW2zpqsG4KIqrc4M5jzSS3TKfF UeIcB5GfbOtMdx9gSAzTpU7KT0pRLgpDATqaUhvWbjOtIkTFrcuIUUifvBLfrUqI880k gZ9xS3UFPngLzvld9Hr4nxfau3IQofc19umjxQOriWGMv1775t/WFsybAvsvPCNU25lc U52MeZk0a657/gzGUsWj9abWE63S+e5xcO0Jnmha1wqfgu8hR1tiv3+/rd8sDGdmBpbv Ctug== 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 f25si1001297edm.529.2018.01.25.03.11.02; Thu, 25 Jan 2018 03:11:02 -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 D9696C223FB; Thu, 25 Jan 2018 11:07:01 +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=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED 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 C550BC223BE; Thu, 25 Jan 2018 11:06:58 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B8D89C22382; Thu, 25 Jan 2018 11:05:58 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 14717C22413 for ; Thu, 25 Jan 2018 11:05:58 +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 9F06CADFA; Thu, 25 Jan 2018 11:05:57 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 25 Jan 2018 12:05:51 +0100 Message-Id: <20180125110556.76352-11-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180125110556.76352-1-agraf@suse.de> References: <20180125110556.76352-1-agraf@suse.de> Cc: Tom Rini Subject: [U-Boot] [PATCH v3 10/15] pl011: Convert CONFIG_PL011_SERIAL to Kconfig 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 want to use Kconfig logic to depend on whether pl01x devices are built in, so let's convert their inclusion selection to Kconfig. This round goes to pl011. Signed-off-by: Alexander Graf --- arch/arm/Kconfig | 19 +++++++++++++++++++ drivers/serial/Kconfig | 6 ++++++ include/configs/highbank.h | 1 - include/configs/mxs.h | 1 - include/configs/spear-common.h | 1 - include/configs/vexpress_aemv8a.h | 1 - include/configs/vexpress_common.h | 1 - include/configs/x600.h | 1 - scripts/config_whitelist.txt | 1 - 9 files changed, 25 insertions(+), 7 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 97b8249432..1557e7cfdf 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -400,49 +400,58 @@ config TARGET_APX4DEVKIT bool "Support apx4devkit" select CPU_ARM926EJS select SUPPORT_SPL + select PL011_SERIAL config TARGET_XFI3 bool "Support xfi3" select CPU_ARM926EJS select SUPPORT_SPL + select PL011_SERIAL config TARGET_M28EVK bool "Support m28evk" select CPU_ARM926EJS select SUPPORT_SPL + select PL011_SERIAL config TARGET_MX23EVK bool "Support mx23evk" select CPU_ARM926EJS select SUPPORT_SPL select BOARD_EARLY_INIT_F + select PL011_SERIAL config TARGET_MX28EVK bool "Support mx28evk" select CPU_ARM926EJS select SUPPORT_SPL select BOARD_EARLY_INIT_F + select PL011_SERIAL config TARGET_MX23_OLINUXINO bool "Support mx23_olinuxino" select CPU_ARM926EJS select SUPPORT_SPL select BOARD_EARLY_INIT_F + select PL011_SERIAL config TARGET_BG0900 bool "Support bg0900" select CPU_ARM926EJS select SUPPORT_SPL + select PL011_SERIAL config TARGET_SANSA_FUZE_PLUS bool "Support sansa_fuze_plus" select CPU_ARM926EJS select SUPPORT_SPL + select PL011_SERIAL config TARGET_SC_SPS_1 bool "Support sc_sps_1" select CPU_ARM926EJS select SUPPORT_SPL + select PL011_SERIAL config ORION5X bool "Marvell Orion" @@ -453,24 +462,28 @@ config TARGET_SPEAR300 select CPU_ARM926EJS select BOARD_EARLY_INIT_F imply CMD_SAVES + select PL011_SERIAL config TARGET_SPEAR310 bool "Support spear310" select CPU_ARM926EJS select BOARD_EARLY_INIT_F imply CMD_SAVES + select PL011_SERIAL config TARGET_SPEAR320 bool "Support spear320" select CPU_ARM926EJS select BOARD_EARLY_INIT_F imply CMD_SAVES + select PL011_SERIAL config TARGET_SPEAR600 bool "Support spear600" select CPU_ARM926EJS select BOARD_EARLY_INIT_F imply CMD_SAVES + select PL011_SERIAL config TARGET_STV0991 bool "Support stv0991" @@ -486,6 +499,7 @@ config TARGET_X600 select BOARD_LATE_INIT select CPU_ARM926EJS select SUPPORT_SPL + select PL011_SERIAL config TARGET_IMX31_PHYCORE bool "Support imx31_phycore_eet" @@ -541,14 +555,17 @@ config TARGET_VEXPRESS_CA15_TC2 select CPU_V7 select CPU_V7_HAS_NONSEC select CPU_V7_HAS_VIRT + select PL011_SERIAL config TARGET_VEXPRESS_CA5X2 bool "Support vexpress_ca5x2" select CPU_V7 + select PL011_SERIAL config TARGET_VEXPRESS_CA9X4 bool "Support vexpress_ca9x4" select CPU_V7 + select PL011_SERIAL config TARGET_BCM23550_W1D bool "Support bcm23550_w1d" @@ -607,6 +624,7 @@ config ARCH_S5PC1XX config ARCH_HIGHBANK bool "Calxeda Highbank" select CPU_V7 + select PL011_SERIAL config ARCH_INTEGRATOR bool "ARM Ltd. Integrator family" @@ -761,6 +779,7 @@ config TARGET_TS4600 bool "Support TS4600" select CPU_ARM926EJS select SUPPORT_SPL + select PL011_SERIAL config ARCH_VF610 bool "Freescale Vybrid" diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 2816121dec..99aa817e63 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -453,6 +453,12 @@ config PL010_SERIAL help Select this to enable a UART for platforms using PL010. +config PL011_SERIAL + bool "ARM PL011 driver" + depends on !DM_SERIAL + help + Select this to enable a UART for platforms using PL011. + config ROCKCHIP_SERIAL bool "Rockchip on-chip UART support" depends on DM_SERIAL && SPL_OF_PLATDATA diff --git a/include/configs/highbank.h b/include/configs/highbank.h index a5a524008b..726ae8a214 100644 --- a/include/configs/highbank.h +++ b/include/configs/highbank.h @@ -22,7 +22,6 @@ */ #define CONFIG_SYS_MALLOC_LEN (512 * 1024) -#define CONFIG_PL011_SERIAL #define CONFIG_PL011_CLOCK 150000000 #define CONFIG_PL01x_PORTS { (void *)(0xFFF36000) } #define CONFIG_CONS_INDEX 0 diff --git a/include/configs/mxs.h b/include/configs/mxs.h index 804b9e199c..3a27c15060 100644 --- a/include/configs/mxs.h +++ b/include/configs/mxs.h @@ -108,7 +108,6 @@ * DUART Serial Driver. * Conflicts with AUART driver which can be set by board. */ -#define CONFIG_PL011_SERIAL #define CONFIG_PL011_CLOCK 24000000 #define CONFIG_PL01x_PORTS { (void *)MXS_UARTDBG_BASE } #define CONFIG_CONS_INDEX 0 diff --git a/include/configs/spear-common.h b/include/configs/spear-common.h index 349232e1bf..c123e44d15 100644 --- a/include/configs/spear-common.h +++ b/include/configs/spear-common.h @@ -76,7 +76,6 @@ * Serial Configuration (PL011) * CONFIG_PL01x_PORTS is defined in specific files */ -#define CONFIG_PL011_SERIAL #define CONFIG_PL011_CLOCK (48 * 1000 * 1000) #define CONFIG_CONS_INDEX 0 #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, \ diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h index 6203e14135..f18e2ee068 100644 --- a/include/configs/vexpress_aemv8a.h +++ b/include/configs/vexpress_aemv8a.h @@ -111,7 +111,6 @@ /* PL011 Serial Configuration */ #define CONFIG_CONS_INDEX 0 #define CONFIG_PL01X_SERIAL -#define CONFIG_PL011_SERIAL #ifdef CONFIG_TARGET_VEXPRESS64_JUNO #define CONFIG_PL011_CLOCK 7273800 #else diff --git a/include/configs/vexpress_common.h b/include/configs/vexpress_common.h index 294ca18186..94a352fef7 100644 --- a/include/configs/vexpress_common.h +++ b/include/configs/vexpress_common.h @@ -133,7 +133,6 @@ #define CONFIG_SYS_TIMER_COUNTS_DOWN /* PL011 Serial Configuration */ -#define CONFIG_PL011_SERIAL #define CONFIG_PL011_CLOCK 24000000 #define CONFIG_PL01x_PORTS {(void *)CONFIG_SYS_SERIAL0, \ (void *)CONFIG_SYS_SERIAL1} diff --git a/include/configs/x600.h b/include/configs/x600.h index 7363057a5c..9990890a9a 100644 --- a/include/configs/x600.h +++ b/include/configs/x600.h @@ -38,7 +38,6 @@ #define CONFIG_SYS_SERIAL1 0xD0080000 #define CONFIG_PL01x_PORTS { (void *)CONFIG_SYS_SERIAL0, \ (void *)CONFIG_SYS_SERIAL1 } -#define CONFIG_PL011_SERIAL #define CONFIG_PL011_CLOCK (48 * 1000 * 1000) #define CONFIG_CONS_INDEX 0 #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, \ diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 5ee6b07c6d..a4159ebb36 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1627,7 +1627,6 @@ CONFIG_PIXIS_BRDCFG1_SSI_TDM_SSI CONFIG_PIXIS_BRDCFG1_TDM CONFIG_PIXIS_SGMII_CMD CONFIG_PL011_CLOCK -CONFIG_PL011_SERIAL CONFIG_PL011_SERIAL_RLCR CONFIG_PL01X_SERIAL CONFIG_PL01x_PORTS From patchwork Thu Jan 25 11:05:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 125812 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1039656ljf; Thu, 25 Jan 2018 03:16:24 -0800 (PST) X-Google-Smtp-Source: AH8x22721YY/SgAE/uQz67CVIztXkqM3usp/bt1/hpjsoTZZyu1bZQH4TbjgqfUaa9PpvQohRTOD X-Received: by 10.80.224.195 with SMTP id j3mr28527499edl.50.1516878984438; Thu, 25 Jan 2018 03:16:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516878984; cv=none; d=google.com; s=arc-20160816; b=GegkRkHBhEZqHCy8VZMDxEi2Vp1T+3N+oSjpbdJfO0rvME/e/BwpW/T3FFsc3QyITX zIGW8MjzhzJLvfXEitpINa3IU49JLueg5/kpkdxMpOQ6JH2Bnv+6v5aje/yP2gZn6MmA LX+CD6uaFwTV+O+H+i4O678M+t8P+ON0sWOgQrc7GA6g82SRYXNIFLQ3IvOU//nCZOME O9lwzg0UHamnIDUU/nlCgau+pfaejKJnKKm+PWWWfvcn4etXfZE5/F0Wz0p3JcOSzZIc Hs8OtBaW0Lb/crBYXiyuRWmIYsdrmlNzNPuUedr3pPND2XHjACid3ukLKm9rP0ii+ZPk H/yA== 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=CBCBm+/UtQkQw3nZg3TeO/Ek/y4TWkTuFSg1bnPUIPU=; b=puvE0VuPeS6qWF1vwxa/25tRlR78DXcNr4tjylYKKrixZj5G7QcY2qq3NrhHpEms/C 5hJbIavoYvK0WMytwRPCyRRFGfp7oT4l4cPHBb+W/+sh8FAmqFyBxIqWb1OcseIiXyll xUp8A4Websp6tI3qo5OKOSXIunO5lPltLm9OT+d5axQN6obo/YGdSRsvXa9ssFulgoRY EMgquA+HFl71tkZgAZpXe4BBrvWFX0H3T9bb2e69uDGVB+HVjCQsbm+Hc1+7LL3wtirh Hooa1znrwdOA8k1WncpPkf7fC4PewQfki12hraiUE8DixRMDqUaBvTkJaPEvPyewQQI6 0lBw== 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 q11si1254329edj.326.2018.01.25.03.16.24; Thu, 25 Jan 2018 03:16:24 -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 14E98C22412; Thu, 25 Jan 2018 11:11:26 +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=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED 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 9B0A6C22412; Thu, 25 Jan 2018 11:11:23 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 70780C223F1; Thu, 25 Jan 2018 11:05:58 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 103B5C223C7 for ; Thu, 25 Jan 2018 11:05:58 +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 A5791ADFB; Thu, 25 Jan 2018 11:05:57 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 25 Jan 2018 12:05:52 +0100 Message-Id: <20180125110556.76352-12-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180125110556.76352-1-agraf@suse.de> References: <20180125110556.76352-1-agraf@suse.de> Cc: Tom Rini Subject: [U-Boot] [PATCH v3 11/15] pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig 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 want to use Kconfig logic to depend on whether pl01x devices are built in, so let's convert their inclusion selection to Kconfig. This round goes to pl01x. Signed-off-by: Alexander Graf --- arch/arm/Kconfig | 11 +++++++++++ drivers/serial/Kconfig | 6 ++++++ include/configs/hikey.h | 3 --- include/configs/integrator-common.h | 2 -- include/configs/poplar.h | 3 --- include/configs/qemu-arm.h | 3 --- include/configs/rpi.h | 1 - include/configs/stv0991.h | 3 --- include/configs/thunderx_88xx.h | 1 - include/configs/vexpress_aemv8a.h | 1 - scripts/config_whitelist.txt | 1 - 11 files changed, 17 insertions(+), 18 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 1557e7cfdf..b2345eaa26 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -493,6 +493,7 @@ config TARGET_STV0991 select DM_SPI select DM_SPI_FLASH select SPI_FLASH + select PL01X_SERIAL config TARGET_X600 bool "Support x600" @@ -548,6 +549,7 @@ config ARCH_BCM283X select DM_SERIAL select DM_GPIO select OF_CONTROL + select PL01X_SERIAL imply FAT_WRITE config TARGET_VEXPRESS_CA15_TC2 @@ -630,6 +632,7 @@ config ARCH_INTEGRATOR bool "ARM Ltd. Integrator family" select DM select DM_SERIAL + select PL01X_SERIAL config ARCH_KEYSTONE bool "TI Keystone" @@ -697,6 +700,7 @@ config ARCH_QEMU select DM select DM_SERIAL select OF_CONTROL + select PL01X_SERIAL config ARCH_RMOBILE bool "Renesas ARM SoCs" @@ -835,15 +839,18 @@ config TEGRA config TARGET_VEXPRESS64_AEMV8A bool "Support vexpress_aemv8a" select ARM64 + select PL01X_SERIAL config TARGET_VEXPRESS64_BASE_FVP bool "Support Versatile Express ARMv8a FVP BASE model" select ARM64 select SEMIHOSTING + select PL01X_SERIAL config TARGET_VEXPRESS64_BASE_FVP_DRAM bool "Support Versatile Express ARMv8a FVP BASE model booting from DRAM" select ARM64 + select PL01X_SERIAL help This target is derived from TARGET_VEXPRESS64_BASE_FVP and over-rides the default config to allow the user to load the images directly into @@ -853,6 +860,7 @@ config TARGET_VEXPRESS64_BASE_FVP_DRAM config TARGET_VEXPRESS64_JUNO bool "Support Versatile Express Juno Development Platform" select ARM64 + select PL01X_SERIAL config TARGET_LS2080A_EMU bool "Support ls2080a_emu" @@ -945,6 +953,7 @@ config TARGET_HIKEY select DM_GPIO select DM_SERIAL select OF_CONTROL + select PL01X_SERIAL help Support for HiKey 96boards platform. It features a HI6220 SoC, with 8xA53 CPU, mali450 gpu, and 1GB RAM. @@ -956,6 +965,7 @@ config TARGET_POPLAR select OF_CONTROL select DM_SERIAL select DM_USB + select PL01X_SERIAL help Support for Poplar 96boards EE platform. It features a HI3798cv200 SoC, with 4xA53 CPU, 1GB RAM and the high performance Mali T720 GPU @@ -1211,6 +1221,7 @@ config TARGET_THUNDERX_88XX select ARM64 select OF_CONTROL select SYS_CACHE_SHIFT_7 + select PL01X_SERIAL config ARCH_ASPEED bool "Support Aspeed SoCs" diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 99aa817e63..4167683885 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -459,6 +459,12 @@ config PL011_SERIAL help Select this to enable a UART for platforms using PL011. +config PL01X_SERIAL + bool "ARM PL010 and PL011 driver" + depends on DM_SERIAL + help + Select this to enable a UART for platforms using PL010 or PL011. + config ROCKCHIP_SERIAL bool "Rockchip on-chip UART support" depends on DM_SERIAL && SPL_OF_PLATDATA diff --git a/include/configs/hikey.h b/include/configs/hikey.h index 7eaa6e4667..aaddf4c1f1 100644 --- a/include/configs/hikey.h +++ b/include/configs/hikey.h @@ -50,9 +50,6 @@ /* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + SZ_8M) -/* Serial port PL010/PL011 through the device model */ -#define CONFIG_PL01X_SERIAL - #ifdef CONFIG_CMD_USB #define CONFIG_USB_DWC2_REG_ADDR 0xF72C0000 /*#define CONFIG_DWC2_DFLT_SPEED_FULL*/ diff --git a/include/configs/integrator-common.h b/include/configs/integrator-common.h index edc798b117..f66d954748 100644 --- a/include/configs/integrator-common.h +++ b/include/configs/integrator-common.h @@ -15,8 +15,6 @@ #define CONFIG_SYS_LONGHELP #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128*1024) /* Size of malloc() pool */ -/* Serial port PL010/PL011 through the device model */ -#define CONFIG_PL01X_SERIAL #define CONFIG_CONS_INDEX 0 #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ diff --git a/include/configs/poplar.h b/include/configs/poplar.h index 8a12b526a8..9641b27b1b 100644 --- a/include/configs/poplar.h +++ b/include/configs/poplar.h @@ -26,9 +26,6 @@ /* ATF bl33.bin load address (must match) */ #define CONFIG_SYS_TEXT_BASE 0x37000000 -/* PL010/PL011 */ -#define CONFIG_PL01X_SERIAL - /* USB configuration */ #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 diff --git a/include/configs/qemu-arm.h b/include/configs/qemu-arm.h index c8852cef34..c8ba78d8aa 100644 --- a/include/configs/qemu-arm.h +++ b/include/configs/qemu-arm.h @@ -20,9 +20,6 @@ #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_2M) #define CONFIG_SYS_MALLOC_LEN SZ_16M -/* QEMU's PL011 serial port is detected via FDT using the device model */ -#define CONFIG_PL01X_SERIAL - /* QEMU implements a 62.5MHz architected timer */ /* FIXME: can we rely on CNTFREQ instead of hardcoding this fact here? */ #define CONFIG_SYS_ARCH_TIMER diff --git a/include/configs/rpi.h b/include/configs/rpi.h index 2c84cf9a49..5ffe98015f 100644 --- a/include/configs/rpi.h +++ b/include/configs/rpi.h @@ -77,7 +77,6 @@ /* Console UART, can be configured dynamically in config.txt */ #define CONFIG_BCM283X_MU_SERIAL -#define CONFIG_PL01X_SERIAL /* Console configuration */ #define CONFIG_SYS_CBSIZE 1024 diff --git a/include/configs/stv0991.h b/include/configs/stv0991.h index c99fb676cb..3e0b8a157f 100644 --- a/include/configs/stv0991.h +++ b/include/configs/stv0991.h @@ -25,9 +25,6 @@ (PHYS_SDRAM_1_SIZE - CONFIG_ENV_SIZE) #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 16 * 1024) -/* serial port (PL011) configuration */ -#define CONFIG_PL01X_SERIAL - /* user interface */ #define CONFIG_SYS_CBSIZE 1024 diff --git a/include/configs/thunderx_88xx.h b/include/configs/thunderx_88xx.h index 209a7c3417..34940efb41 100644 --- a/include/configs/thunderx_88xx.h +++ b/include/configs/thunderx_88xx.h @@ -35,7 +35,6 @@ /* PL011 Serial Configuration */ -#define CONFIG_PL01X_SERIAL #define CONFIG_PL011_CLOCK 24000000 #define CONFIG_CONS_INDEX 1 diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h index f18e2ee068..07cc92ce17 100644 --- a/include/configs/vexpress_aemv8a.h +++ b/include/configs/vexpress_aemv8a.h @@ -110,7 +110,6 @@ /* PL011 Serial Configuration */ #define CONFIG_CONS_INDEX 0 -#define CONFIG_PL01X_SERIAL #ifdef CONFIG_TARGET_VEXPRESS64_JUNO #define CONFIG_PL011_CLOCK 7273800 #else diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index a4159ebb36..6e4e322986 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1628,7 +1628,6 @@ CONFIG_PIXIS_BRDCFG1_TDM CONFIG_PIXIS_SGMII_CMD CONFIG_PL011_CLOCK CONFIG_PL011_SERIAL_RLCR -CONFIG_PL01X_SERIAL CONFIG_PL01x_PORTS CONFIG_PLATFORM_ENV_SETTINGS CONFIG_PLATINUM_BOARD From patchwork Thu Jan 25 11:05:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 125815 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1041033ljf; Thu, 25 Jan 2018 03:18:53 -0800 (PST) X-Google-Smtp-Source: AH8x226XPwQLdlpDNFu3nE/JKVuUOqRdGhu2JFtNKIOSob0l97RLf5AZVCP569FCdKyGIdG7ilfc X-Received: by 10.80.144.102 with SMTP id z35mr27965035edz.235.1516879133631; Thu, 25 Jan 2018 03:18:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516879133; cv=none; d=google.com; s=arc-20160816; b=MW5vN89W3+j4Z7WPi/l+0o+yFbvEJKhguTPJ09D538qKYSKJk/nXzanVJS1GUmN4/L LsCfc0bp/0aVJRcHekwVQSkCikEwJ4VZmG2igXMNr3bYvYVInBLVIJTxGEsziVsefiYG pmRria+k34nboSpajnx+eiFf/SQPf7b6pAm2KnKL9T6uwWgrjVy7X0GR1sQqd9Ug4bYa Ojw3dWFU7kbhY5pQSFOFVD832eAhjY2uv9BFJYk4vWhh5qRtYD4jwKoU14M1TgNfcS28 YZVgs51TCZm5ujTTdWDZEFCQ76fu8BNQ+6nHiwwxEuEpXtcAyN1OTzc8WHDxUfa6mRU/ YeqQ== 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=HGmL1Jh8cnTp7/R1ZbAQ4WkStFkzWt8ATsE8iUYbxgM=; b=yjcYK5Lp9T/OqjPEB2zbjT/RTDadAkBhQbdH+0rKhzpximr/oeg7eY1WhbmOJNIQSr Ja0h6lIrg8/1LRP9oQeA4ttzNftnN3tmrh6p4jlhGr/mydixy4xW21YkNEdmRCSy7/8k OvpsCd4Y9SXMfMiFZ6DPQBKhnXJz4T5cRYmZBho/JV/p9lZbBf1XgYhtEf1zqaElqkH/ ASyvY/4iyO7PcTBhI0ks7iFyUVVr2Keebu3ArQLZEpwirSeTOfYV1hI4+2qO9NFbiMtw VjSMsvpu5S9F2e7d1Vq3uwWaz9c1VptLCzcS3YyHufQoVTcz4WEXq3TnIo27khIhnxgb epuQ== 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 64si1035397edj.77.2018.01.25.03.18.53; Thu, 25 Jan 2018 03:18:53 -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 23ECEC2241B; Thu, 25 Jan 2018 11:12:30 +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=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED 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 67F90C22400; Thu, 25 Jan 2018 11:11:40 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2DB84C22421; Thu, 25 Jan 2018 11:05:59 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 254B0C223F2 for ; Thu, 25 Jan 2018 11:05: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 E6660AE01; Thu, 25 Jan 2018 11:05:58 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 25 Jan 2018 12:05:53 +0100 Message-Id: <20180125110556.76352-13-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180125110556.76352-1-agraf@suse.de> References: <20180125110556.76352-1-agraf@suse.de> Cc: Tom Rini Subject: [U-Boot] [PATCH v3 12/15] bcm2835_mu_serial: Convert to Kconfig 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" Setting config options using headers is deprecated. This patch converts the BCM2835 Mini-UART to Kconfig. Signed-off-by: Alexander Graf --- drivers/serial/Kconfig | 7 +++++++ include/configs/rpi.h | 3 --- scripts/config_whitelist.txt | 1 - 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 4167683885..72281a7b64 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -388,6 +388,13 @@ config ATMEL_USART configured in the device tree, and input clock frequency can be got from the clk node. +config BCM283X_MU_SERIAL + bool "Support for BCM283x Mini-UART" + depends on DM_SERIAL && ARCH_BCM283X + default y + help + Select this to enable Mini-UART support on BCM283X family of SoCs. + config BCM6345_SERIAL bool "Support for BCM6345 UART" depends on DM_SERIAL && ARCH_BMIPS diff --git a/include/configs/rpi.h b/include/configs/rpi.h index 5ffe98015f..f2d3646753 100644 --- a/include/configs/rpi.h +++ b/include/configs/rpi.h @@ -75,9 +75,6 @@ #define CONFIG_MISC_INIT_R #endif -/* Console UART, can be configured dynamically in config.txt */ -#define CONFIG_BCM283X_MU_SERIAL - /* Console configuration */ #define CONFIG_SYS_CBSIZE 1024 diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 6e4e322986..5e02588066 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -121,7 +121,6 @@ CONFIG_BCH_CONST_M CONFIG_BCH_CONST_PARAMS CONFIG_BCH_CONST_T CONFIG_BCM2835_GPIO -CONFIG_BCM283X_MU_SERIAL CONFIG_BIOSEMU CONFIG_BITBANGMII_MULTI CONFIG_BL1_OFFSET From patchwork Thu Jan 25 11:05: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: 125809 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1038283ljf; Thu, 25 Jan 2018 03:13:56 -0800 (PST) X-Google-Smtp-Source: AH8x227NIpGWWprfGAA2M3uYtRnIXpdcJx17qProvXEpIvEF/xG7Nd4y3JOJD7kOEQbXqNAUEbKq X-Received: by 10.80.159.169 with SMTP id c38mr28785413edf.277.1516878836457; Thu, 25 Jan 2018 03:13:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516878836; cv=none; d=google.com; s=arc-20160816; b=HMHRZrNSw6AFWkDSUEJKFSQs0PAaAfQR7Fj4kjMnjdU4pZYDJo5eT4pZrBkqsTHmZn m02fqfSEMwI/ajgphuwtayvxo+2BL+zJD2iDm50CYTLjw1/fOV69BmXlndjFgyeOQR/8 i1SrVPAvc/XqM6K8o82zRq7nISndAuwkCj2UU+CeD61WPAHn2Qv3KylwqcWKVCSpCXXb Uwkwt8oyLMq5iDybcvY5C7esHUcCutheMsAJ5gbg/XEMghLMjI1xXENE+IJSL2566E7Q k9smSW4lPK6xmyjh6D5Zbi8hChy5RJDv7jTaa91Vck9FPYV1ElZ5Q5mOpUCdcIGPlZ2u zpTw== 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=Ie2iPQ1/1l2uGy2TQ+WS1teSlvpkn8mJhjXglh40z2o=; b=eJJyNWny42Rjfcm7vbT6R+R+EtV60NgPySIXO7zYNwhENh/KuR8xJwwBR93q0xeWl1 2u3V6eOU5+jDpiOJFwWsk4pSSbxFkr6L9kh8nkJ1JgMO+zcNMCvl33zviJb/X0WlwIDc NvAZ+WG8DB4EDfeBkqSE3WENkWzb0IeDY/ufbNOvh4B2nBJyvnJ63BzyO9UYyxAoPxX3 gDIOZvOMsOZpfdgSRESzRmos6MFI737593jXXMeeVeSMfp8eAoK3e21ZEyddOFM1fRv/ xGEX3nKZ0JkFJbU4eMVY11BFqDHdinRJgWWmUmse44hkXeJ9IYufPM8aZk28BvKSNJI3 J4Dg== 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 s15si1964522edc.275.2018.01.25.03.13.56; Thu, 25 Jan 2018 03:13: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 0986CC22444; Thu, 25 Jan 2018 11:10:15 +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=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED 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 D655DC223BE; Thu, 25 Jan 2018 11:10:13 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 99457C22412; Thu, 25 Jan 2018 11:05:58 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 310CFC22414 for ; Thu, 25 Jan 2018 11:05:58 +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 EE6DFADFD; Thu, 25 Jan 2018 11:05:57 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 25 Jan 2018 12:05:54 +0100 Message-Id: <20180125110556.76352-14-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180125110556.76352-1-agraf@suse.de> References: <20180125110556.76352-1-agraf@suse.de> Cc: Tom Rini Subject: [U-Boot] [PATCH v3 13/15] MAINTAINERS: Take over BCM2835 maintainership 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" It seems as if I have more interest in BCM2835 support than most others, so I'll bite the bullet and declare myself maintainer. It'd be a shame to leave that platform orphaned. Signed-off-by: Alexander Graf --- MAINTAINERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 728d38aebf..19f645d825 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -92,8 +92,8 @@ T: git git://git.denx.de/u-boot-atmel.git F: arch/arm/mach-at91/ ARM BROADCOM BCM283X -#M: Stephen Warren -S: Orphaned (Since 2017-07) +M: Alexander Graf +S: Maintained F: arch/arm/mach-bcm283x/ F: drivers/gpio/bcm2835_gpio.c F: drivers/mmc/bcm2835_sdhci.c From patchwork Thu Jan 25 11:05:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 125810 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1039149ljf; Thu, 25 Jan 2018 03:15:31 -0800 (PST) X-Google-Smtp-Source: AH8x225/GAmtlgdGj3wi58A0N0a4MzXAPrD0XOtMnYEiFX9jY36Enqo5TxxWAVyXeSUm1efPWVWF X-Received: by 10.80.174.174 with SMTP id e43mr29882146edd.9.1516878931530; Thu, 25 Jan 2018 03:15:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516878931; cv=none; d=google.com; s=arc-20160816; b=MwCQQzD3j0NqgFfJ2+HFi8czP+65lfSFvt0jPfHjdkF+WJzYvgs6p4KXmcwHWFd2Mf 67ofyHglC01ZGK1feyuFcs/WEYfkKxnXumips6K0eFcpU4yI68k6bRt4bJFTFU1lWBeS NFNI1Y9QwKPH81Up9lxNOeZr4Y+5NMuG+7h8pbHNW8JLqyTii2mOS2nK9/lwd895r0Xz qc6ktbLPxwPQAh89b6+Bvhz+DTXjyfrpdqaRGUGnQDgtjacHiwWgRXTUY0Rns3OUfXgg DoV5A43wPTR7l9EF2/nwSVeO6ykF0lG48KEsVkMDPyo29N4iNBlt0xKh0cUXoMJE0qHw KQJA== 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=RMrMj3GnEN59WLbdELGJMqfPQQX325DehuKvWdU5SxU=; b=xqug+fgf2mSn3Ac+RJWVgzhMLfoY8OT6jni8UGfj3Otg+igHA9ssRQkFbBpvTlENM2 QRwX37FSJyEo35uBGR2x6JQi4Pxx0dwXLzZG43QOhUbBBGYvj2GlzVqkWnn2UnG32ir1 UwlWVBtQfrFXS3G6urmF77mihp39zek0BhuilmqmYbUQIYmk0jHbXezQ5F0L2JpY0IKi 6Tmo4AXvIDssnY2/W5UhFMOMuO3sr1GKKmbofvDVCxRgYJjwUcMoTvpjHW+mN9SEL1E2 oLqcx3avobax+zBbGJDkHS8Uz93Eo9pOKRqPy9GfSz6r+j1dbPxQKf1Hix2L1HPffdXv wYSg== 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 q22si2097588edb.411.2018.01.25.03.15.31; Thu, 25 Jan 2018 03:15:31 -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 1F84BC2244D; Thu, 25 Jan 2018 11:12:07 +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=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED 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 C1FB2C2241E; Thu, 25 Jan 2018 11:11:28 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 82E25C2242B; Thu, 25 Jan 2018 11:05:59 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 0CE26C223EC for ; Thu, 25 Jan 2018 11:05: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 CC5FDADFF; Thu, 25 Jan 2018 11:05:58 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 25 Jan 2018 12:05:55 +0100 Message-Id: <20180125110556.76352-15-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180125110556.76352-1-agraf@suse.de> References: <20180125110556.76352-1-agraf@suse.de> Cc: Tom Rini Subject: [U-Boot] [PATCH v3 14/15] bcm2835_pl011_serial: Add BCM2835 specific serial driver 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" On bcm2835 we need to ensure we only access serial devices that are muxed to the serial output pins of the pin header. To achieve this for the pl011 device, add a bcm2835 specific pl011 wrapper device that does this check but otherwise behaves like a pl011 device. Signed-off-by: Alexander Graf --- MAINTAINERS | 1 + drivers/serial/Kconfig | 9 +++++ drivers/serial/Makefile | 1 + drivers/serial/serial_bcm283x_pl011.c | 73 ++++++++++++++++++++++++++++++++++ drivers/serial/serial_pl01x.c | 11 ++--- drivers/serial/serial_pl01x_internal.h | 15 ++++++- 6 files changed, 101 insertions(+), 9 deletions(-) create mode 100644 drivers/serial/serial_bcm283x_pl011.c diff --git a/MAINTAINERS b/MAINTAINERS index 19f645d825..c614ff2d5c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -99,6 +99,7 @@ F: drivers/gpio/bcm2835_gpio.c F: drivers/mmc/bcm2835_sdhci.c F: drivers/mmc/bcm2835_sdhost.c F: drivers/serial/serial_bcm283x_mu.c +F: drivers/serial/serial_bcm283x_pl011.c F: drivers/video/bcm2835.c F: include/dm/platform_data/serial_bcm283x_mu.h F: drivers/pinctrl/broadcom/ diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 72281a7b64..3ffedba525 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -395,6 +395,15 @@ config BCM283X_MU_SERIAL help Select this to enable Mini-UART support on BCM283X family of SoCs. +config BCM283X_PL011_SERIAL + bool "Support for BCM283x PL011 UART" + depends on PL01X_SERIAL && ARCH_BCM283X + default y + help + Select this to enable an overriding PL011 driver for BCM283X SoCs + that supports automatic disable, so that it only gets used when + the UART is actually muxed. + config BCM6345_SERIAL bool "Support for BCM6345 UART" depends on DM_SERIAL && ARCH_BMIPS diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile index 5ef603ab15..cac9a8b312 100644 --- a/drivers/serial/Makefile +++ b/drivers/serial/Makefile @@ -46,6 +46,7 @@ obj-$(CONFIG_STI_ASC_SERIAL) += serial_sti_asc.o obj-$(CONFIG_PIC32_SERIAL) += serial_pic32.o obj-$(CONFIG_STM32_SERIAL) += serial_stm32.o obj-$(CONFIG_BCM283X_MU_SERIAL) += serial_bcm283x_mu.o +obj-$(CONFIG_BCM283X_PL011_SERIAL) += serial_bcm283x_pl011.o obj-$(CONFIG_MSM_SERIAL) += serial_msm.o obj-$(CONFIG_MVEBU_A3700_UART) += serial_mvebu_a3700.o obj-$(CONFIG_MPC8XX_CONS) += serial_mpc8xx.o diff --git a/drivers/serial/serial_bcm283x_pl011.c b/drivers/serial/serial_bcm283x_pl011.c new file mode 100644 index 0000000000..bfd39f84f3 --- /dev/null +++ b/drivers/serial/serial_bcm283x_pl011.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2018 Alexander Graf + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include +#include +#include +#include +#include "serial_pl01x_internal.h" + +/* + * Check if this serial device is muxed + * + * The serial device will only work properly if it has been muxed to the serial + * pins by firmware. Check whether that happened here. + * + * @return true if serial device is muxed, false if not + */ +static bool bcm283x_is_serial_muxed(void) +{ + int serial_gpio = 15; + struct udevice *dev; + + if (uclass_first_device(UCLASS_PINCTRL, &dev) || !dev) + return false; + + if (pinctrl_get_gpio_mux(dev, 0, serial_gpio) != BCM2835_GPIO_ALT0) + return false; + + return true; +} + +static int bcm283x_pl011_serial_ofdata_to_platdata(struct udevice *dev) +{ + struct pl01x_serial_platdata *plat = dev_get_platdata(dev); + int ret; + + /* Don't spawn the device if it's not muxed */ + if (!bcm283x_is_serial_muxed()) + return -ENODEV; + + ret = pl01x_serial_ofdata_to_platdata(dev); + if (ret) + return ret; + + /* + * TODO: Reinitialization doesn't always work for now, just skip + * init always - we know we're already initialized + */ + plat->skip_init = true; + + return 0; +} + +static const struct udevice_id bcm283x_pl011_serial_id[] = { + {.compatible = "brcm,bcm2835-pl011", .data = TYPE_PL011}, + {} +}; + +U_BOOT_DRIVER(bcm283x_pl011_uart) = { + .name = "bcm283x_pl011", + .id = UCLASS_SERIAL, + .of_match = of_match_ptr(bcm283x_pl011_serial_id), + .ofdata_to_platdata = of_match_ptr(bcm283x_pl011_serial_ofdata_to_platdata), + .platdata_auto_alloc_size = sizeof(struct pl01x_serial_platdata), + .probe = pl01x_serial_probe, + .ops = &pl01x_serial_ops, + .flags = DM_FLAG_PRE_RELOC, + .priv_auto_alloc_size = sizeof(struct pl01x_priv), +}; diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c index 2cbc84c1b4..23d9d839cb 100644 --- a/drivers/serial/serial_pl01x.c +++ b/drivers/serial/serial_pl01x.c @@ -273,11 +273,6 @@ __weak struct serial_device *default_serial_console(void) #ifdef CONFIG_DM_SERIAL -struct pl01x_priv { - struct pl01x_regs *regs; - enum pl01x_type type; -}; - static int pl01x_serial_setbrg(struct udevice *dev, int baudrate) { struct pl01x_serial_platdata *plat = dev_get_platdata(dev); @@ -291,7 +286,7 @@ static int pl01x_serial_setbrg(struct udevice *dev, int baudrate) return 0; } -static int pl01x_serial_probe(struct udevice *dev) +int pl01x_serial_probe(struct udevice *dev) { struct pl01x_serial_platdata *plat = dev_get_platdata(dev); struct pl01x_priv *priv = dev_get_priv(dev); @@ -329,7 +324,7 @@ static int pl01x_serial_pending(struct udevice *dev, bool input) return fr & UART_PL01x_FR_TXFF ? 0 : 1; } -static const struct dm_serial_ops pl01x_serial_ops = { +const struct dm_serial_ops pl01x_serial_ops = { .putc = pl01x_serial_putc, .pending = pl01x_serial_pending, .getc = pl01x_serial_getc, @@ -343,7 +338,7 @@ static const struct udevice_id pl01x_serial_id[] ={ {} }; -static int pl01x_serial_ofdata_to_platdata(struct udevice *dev) +int pl01x_serial_ofdata_to_platdata(struct udevice *dev) { struct pl01x_serial_platdata *plat = dev_get_platdata(dev); fdt_addr_t addr; diff --git a/drivers/serial/serial_pl01x_internal.h b/drivers/serial/serial_pl01x_internal.h index 288a4f19f5..c56dd54c7b 100644 --- a/drivers/serial/serial_pl01x_internal.h +++ b/drivers/serial/serial_pl01x_internal.h @@ -38,7 +38,20 @@ struct pl01x_regs { u32 pl011_lcrh; /* 0x2C Line control register */ u32 pl011_cr; /* 0x30 Control register */ }; -#endif + +#ifdef CONFIG_DM_SERIAL + +int pl01x_serial_ofdata_to_platdata(struct udevice *dev); +int pl01x_serial_probe(struct udevice *dev); +extern const struct dm_serial_ops pl01x_serial_ops; + +struct pl01x_priv { + struct pl01x_regs *regs; + enum pl01x_type type; +}; + +#endif /* CONFIG_DM_SERIAL */ +#endif /* !__ASSEMBLY__ */ #define UART_PL01x_RSR_OE 0x08 #define UART_PL01x_RSR_BE 0x04 From patchwork Thu Jan 25 11:05:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 125816 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1041513ljf; Thu, 25 Jan 2018 03:19:50 -0800 (PST) X-Google-Smtp-Source: AH8x225htHyH6BY/Zyclt9ycAjmediCqf+g3aF3zliDSNYj7RFPIPFsOvHnDE6YxYh48yjr4Gb6P X-Received: by 10.80.214.215 with SMTP id l23mr29396942edj.44.1516879190643; Thu, 25 Jan 2018 03:19:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516879190; cv=none; d=google.com; s=arc-20160816; b=v9XfyNX9+pmXmxjzzEHgokXn4CHufZ1JXMjQY2qxTes2Ua6HTIAB4mt/pKB6G6F+Kg oHcV4u6/M3XDAz40KW+zY0dH3+Hy422lbhsKPakF53L0VWzW6HaU0Lknd76d3S6H23A3 1ZP6v4Oa3MU062tI6fXrE0DDDWV1aIP7ANzpDdPTIMxTsbvFMeAtSe0SQqFwuw9nZNc4 LQ70ZdRL4yh1BSN0ksCIdtB8po8qX21Tf4GPnJbRLIE0MHf+Q+B2wRH4KZaO0Bsiqioc m3MnGX0Bz7HirMLQX/mBQ/gR8GgaXC/N4/YO/+jtoyiZOP2jsPMZ4+lE54iiS591yjYU hskw== 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=Q2XvxXEkhMmYrF4ZDkIRh9sIqkVM/SaX0Bv0aeUhi58=; b=u02hsUGVq7o7pLvlTZw0nuKcoxC0t9M3scHLV5C7NAb4YzkPt7az3S7HGNwmVaG2Ws vkTalTZKXp8EsUz/tkxJXNHXnRVHujZtNRmIL0KP22sme0ux5s5NKjfPS4TZ6Z0R8ssE WXqbR21oUZN1Mjz1PShavcWPS3bnGTPVI3vLfyzqdBvMFdVlUCWiExHaEuP0laHzzq26 LdVolXBXugSwDVFNGKSkQOKq2VjY3BwUv17FkYCawN3iZVfk8dKGLRjyXud6hUMS1GDT D3K6GSX490kG1RC54pI4eDWrANb0I4A9lqm3vdikbqsgSTnqA/ytQh7rkhli9BKa2r54 irsg== 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 63si229451edl.191.2018.01.25.03.19.50; Thu, 25 Jan 2018 03:19:50 -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 24C69C22448; Thu, 25 Jan 2018 11:13:08 +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=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED 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 CA147C22403; Thu, 25 Jan 2018 11:12:02 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 12104C22417; Thu, 25 Jan 2018 11:05:58 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 13F30C22412 for ; Thu, 25 Jan 2018 11:05:58 +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 D73A0ADFC; Thu, 25 Jan 2018 11:05:57 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 25 Jan 2018 12:05:56 +0100 Message-Id: <20180125110556.76352-16-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180125110556.76352-1-agraf@suse.de> References: <20180125110556.76352-1-agraf@suse.de> Cc: Tom Rini Subject: [U-Boot] [PATCH v3 15/15] bcm2835_pinctrl: Probe pre-reloc 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 serial drivers now depend on the pinctrl driver to determine whether they are enabled. That means if a serial device wants to be used pre-reloc, we also need the pinctrl device pre-reloc. Adapt the pinctrl driver as well as dts overlay accordingly. Signed-off-by: Alexander Graf --- arch/arm/dts/bcm283x-uboot.dtsi | 4 ++++ drivers/pinctrl/broadcom/pinctrl-bcm283x.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/dts/bcm283x-uboot.dtsi b/arch/arm/dts/bcm283x-uboot.dtsi index 8e4231ae6c..21d038aebb 100644 --- a/arch/arm/dts/bcm283x-uboot.dtsi +++ b/arch/arm/dts/bcm283x-uboot.dtsi @@ -20,3 +20,7 @@ skip-init; u-boot,dm-pre-reloc; }; + +&gpio { + u-boot,dm-pre-reloc; +}; diff --git a/drivers/pinctrl/broadcom/pinctrl-bcm283x.c b/drivers/pinctrl/broadcom/pinctrl-bcm283x.c index 83dde2302e..6fbd6efbd2 100644 --- a/drivers/pinctrl/broadcom/pinctrl-bcm283x.c +++ b/drivers/pinctrl/broadcom/pinctrl-bcm283x.c @@ -148,5 +148,6 @@ U_BOOT_DRIVER(pinctrl_bcm283x) = { .of_match = of_match_ptr(bcm2835_pinctrl_id), .priv_auto_alloc_size = sizeof(struct bcm283x_pinctrl_priv), .ops = &bcm283x_pinctrl_ops, - .probe = bcm283x_pinctl_probe + .probe = bcm283x_pinctl_probe, + .flags = DM_FLAG_PRE_RELOC, };