From patchwork Wed Jan 17 08:54:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 124793 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp1309313lje; Wed, 17 Jan 2018 00:58:49 -0800 (PST) X-Google-Smtp-Source: ACJfBovIFq5ijpA+HYOBu50RB693ZDKDEu14K/T8QtMULtgUudhx9kbJ5cuuZ4bCdqUQ+fkmXeWr X-Received: by 10.80.169.48 with SMTP id l45mr1939540edc.128.1516179529888; Wed, 17 Jan 2018 00:58:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516179529; cv=none; d=google.com; s=arc-20160816; b=Wq9KCmXrC47pPMw/v23ta3JzwM0aqIismKnkDKEBufNGROjp5Srs7DYJI2x1Wgl8es nhLNDW2KTN6sJyWpTpPdgwquXVjxRYTTQCPlbqEKggRcuvia/eSxG6+iek395Ww1jlR7 f3GTNhu+wV5uzjH7z9gJTRLNOgZMT7tvnxuRULqAjT1joM1+OIBtmi9gJKofCWMgQTXz CDk+wz28Z8kVQM5QSjyNDkDcx1o5NWptUHfUaxG+O0XVhPPUuQx/D+wPYrUJEOqYvbCF l1q1GeCTrUi6WkbspZtWLW4saGPZO7QWv5l78Wier4OeWun4N4G+ognEwNltbmFBMezA q+zg== 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=oOWTcYk0cwWPhl9lfuY/O6r+BPgjR83Y9L9Ah+zqJyM=; b=BWH1DC16ClZAQjBjhrdoCDdVFcq+iw0El16FBMehEjh7rcWdVIdpHut5ZFOSSBQg4a X/NJc4A6RIH3E64IkEzKsQMGJgbh28OzALDvCj6Bb6qT9oVQ/XnaPThumrEh7pvz5Jao bXGkpK8G4+xDcIdWTWAOIkazFcvr+BL5DNm2HbgqVDeki7J0cdFjPdjtElSGkTZsDK+M zPgRNEUiKbDsRIJo1u+49ZfII1gAILs7CJeY3oYhTTmmSMioqdjLF40Qfw3B7sxSfPtr a4yrv8atAYsn68L7eFbzvlyikRdxxnfbk2xM63KnG4r1e4Vzv3up7a7gOVtGeUrhLt0+ eK1A== 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 f6si2464199eda.157.2018.01.17.00.58.49; Wed, 17 Jan 2018 00:58:49 -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 6AC1AC21E67; Wed, 17 Jan 2018 08:57: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=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id D0764C21E79; Wed, 17 Jan 2018 08:55:06 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8069DC21CA6; Wed, 17 Jan 2018 08:55:00 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id BD25FC21DFA for ; Wed, 17 Jan 2018 08:54:59 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2B233AEF9; Wed, 17 Jan 2018 08:54:59 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Wed, 17 Jan 2018 09:54:58 +0100 Message-Id: <20180117085458.27293-8-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180117085458.27293-1-agraf@suse.de> References: <20180117085458.27293-1-agraf@suse.de> Cc: Heinrich Schuchardt Subject: [U-Boot] [PATCH v2 7/7] rpi: Force skip_init on serial devices 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 devices on the raspberry pi are based on clocks we can't easily read and influence in U-Boot. However, the serial devices are always already properly set up when coming up, so all we need to do is leave them alone. The way to do that is to specify "skip-init" in device tree usually, but if we set CONFIG_OF_BOARD to get the device tree from the RPi firmware, that does not have skip-init properly set. So instead we just force it in board specific code. That way serial devices also work fine when skip-init is not passed explicitly in DT. Signed-off-by: Alexander Graf --- board/raspberrypi/rpi/rpi.c | 7 +++++++ drivers/serial/serial_bcm283x_mu.c | 2 +- drivers/serial/serial_pl01x.c | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index b0cdad70f7..ce1286a53a 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -20,6 +20,7 @@ #include #include #include +#include #ifdef CONFIG_ARM64 #include #endif @@ -472,9 +473,15 @@ int board_check_serial(struct udevice *dev) printf("Checking serial %s\n", dev->name); if (device_is_compatible(dev, "arm,pl011")) { + struct pl01x_serial_platdata *plat = dev_get_platdata(dev); + func = BCM2835_GPIO_ALT0; + plat->skip_init = true; } else if (device_is_compatible(dev, "brcm,bcm2835-aux-uart")) { + struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev); + func = BCM2835_GPIO_ALT5; + plat->skip_init = true; } else { return 0; } diff --git a/drivers/serial/serial_bcm283x_mu.c b/drivers/serial/serial_bcm283x_mu.c index 7ce990b9b8..8a7ca75d4a 100644 --- a/drivers/serial/serial_bcm283x_mu.c +++ b/drivers/serial/serial_bcm283x_mu.c @@ -151,7 +151,7 @@ static int bcm283x_mu_serial_ofdata_to_platdata(struct udevice *dev) 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), + plat->skip_init |= fdtdec_get_bool(gd->fdt_blob, dev_of_offset(dev), "skip-init"); return 0; } diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c index 4ec0f29c42..f957eddc07 100644 --- a/drivers/serial/serial_pl01x.c +++ b/drivers/serial/serial_pl01x.c @@ -357,7 +357,7 @@ static int pl01x_serial_ofdata_to_platdata(struct udevice *dev) plat->clock = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "clock", 1); plat->type = dev_get_driver_data(dev); - plat->skip_init = fdtdec_get_bool(gd->fdt_blob, dev_of_offset(dev), + plat->skip_init |= fdtdec_get_bool(gd->fdt_blob, dev_of_offset(dev), "skip-init"); return 0; }