From patchwork Mon Nov 28 05:48:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1709545 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.a=rsa-sha256 header.s=fm2 header.b=Kv7iJmoX; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=Y9Hj8qoQ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NLDzp6jWSz23nt for ; Mon, 28 Nov 2022 16:48:52 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 50F3984E3B; Mon, 28 Nov 2022 06:48:43 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.b="Kv7iJmoX"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Y9Hj8qoQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A364C84FD1; Mon, 28 Nov 2022 06:48:41 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6C17484E3B for ; Mon, 28 Nov 2022 06:48:38 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id BECFA5C00AD; Mon, 28 Nov 2022 00:48:36 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 28 Nov 2022 00:48:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t=1669614516; x=1669700916; bh=l/ixodnEYrrvqV5xFrWR+ibCx 0h086fn+hfTMnqgngo=; b=Kv7iJmoXuce9toy7H2bWtH8hrhx7XOV7eNRfevswb SKBUoJr1/LvUbLOiKdjAeuz4Gclcj9Rc7DhAq9AIHcNTF7ZlJ6RGzrChAECti3/L bHU/NWJKBayOIFAtr+jT7+3L4XHIk9N89yZOHXrkMBCrXDFEcch534FHjrFFv+8O SH8WNx++95mSbykEsqxeytbEO6u96yI3aaTYGAdgXtYN7kF5Bp8dFfQBro0DaNoM yJTfEM+ME+KfeQe30iwl83qYyveYni2Lp0DzxN1yVO3oyp+hhaEhIat6KornD9P6 Ut019nSPpv1vP/d3p2TKSSsZaxCq8XNN6OvPVedw57AQg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1669614516; x=1669700916; bh=l/ixodnEYrrvqV5xFrWR+ibCx0h086fn+hf TMnqgngo=; b=Y9Hj8qoQrllEn/GuKBZFOSN7W80flr3DYnnrS2c+p4NNWerCD61 0KCLHwyHLMMgUMNL1oTIUx5l9+i+UpZR3bZlPfPPxTyU4xTFGZTJcEJVzgNGOHZU q+9El0D0ENo8cvQlJiXK//+VfGD78E+oX8FKigOMfkL30svHRbZucGhZMuesxjK0 yakEKl848m/1Ivv/N3qkJxPpn5+9/L0S/GrYYz8PTzdX7ONVGVfZtATmbwgKOXJu Xzxk/s5qUatnK0Gxa8BmkAwhUX3kGOLdoYiWEBYflY+RS5orhGszacFV+w1SmTLu N3pCmW4zBYLASxpUAj54DGzi6wHwbbAXEAQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrjedugdeklecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgvlhcu jfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtffrrg htthgvrhhnpeekveelhfejueelleetvdejvdeffeetgeelheeujeffhefgffefkeehhffh keekgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 28 Nov 2022 00:48:35 -0500 (EST) From: Samuel Holland To: Stefan Roese , Simon Glass Cc: u-boot@lists.denx.de, Samuel Holland Subject: [PATCH] serial: ns16550: Enable clocks during probe Date: Sun, 27 Nov 2022 23:48:34 -0600 Message-Id: <20221128054834.34950-1-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean If the UART bus or baud clock has a gate, it must be enabled before the UART can be used. Signed-off-by: Samuel Holland Reviewed-by: Stefan Roese --- drivers/serial/ns16550.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 7592979cab5..785fb520062 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -506,6 +506,7 @@ int ns16550_serial_probe(struct udevice *dev) struct ns16550_plat *plat = dev_get_plat(dev); struct ns16550 *const com_port = dev_get_priv(dev); struct reset_ctl_bulk reset_bulk; + struct clk_bulk clk_bulk; fdt_addr_t addr; int ret; @@ -524,6 +525,10 @@ int ns16550_serial_probe(struct udevice *dev) if (!ret) reset_deassert_bulk(&reset_bulk); + ret = clk_get_bulk(dev, &clk_bulk); + if (!ret) + clk_enable_bulk(&clk_bulk); + com_port->plat = dev_get_plat(dev); ns16550_init(com_port, -1);