Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 36002C38142 for ; Sun, 22 Jan 2023 00:09:23 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BBFDB85565; Sun, 22 Jan 2023 01:09:16 +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="e8FWp/Ye"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="S4dZLxPD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2301085592; Sun, 22 Jan 2023 01:09:10 +0100 (CET) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) (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 7BB1E85693 for ; Sun, 22 Jan 2023 01:09:05 +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 compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 5F59F32001FC; Sat, 21 Jan 2023 19:09:03 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sat, 21 Jan 2023 19:09:04 -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 :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1674346142; x=1674432542; bh=gy SQhFz3Nie6rdHq6vgnaZ83Ie7mUq+2epj+Hv65YCU=; b=e8FWp/YepHUJ26Vk3Y tWKvNgpjtiBxbiUjBtSCg2rrD/TJLH33ZlpQ83DJQDyfI8dFXEbRY+/vZSVwhSyN edgaAh2AhY3A/Zbk7Sd1ik5ELjmX7xz9PYDsM3rJCpNqT1ewlOy/mkStFlDkWztX Oya5b5doZV1f5j9QvzV3evvpbpOOgPZP5NTx7XOG4u3+o/uhTH93qyRCbaSDwbVp gXTCJyCeBQoqmLkR9+cyFo6NpAsTJw4ETTkolQcqVWVskx+Ww1WJsX872F9MaJGO nRsdpjJHo4wgEv+O83PafAgObzPcOqSZRBiZ+uYZ+sSWIak3gctP0P+iIrXds0nD swqA== 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:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1674346142; x=1674432542; bh=gySQhFz3Nie6r dHq6vgnaZ83Ie7mUq+2epj+Hv65YCU=; b=S4dZLxPDZcMl5+KCeu6xLdX9Dqk+B 61aNqCGqQIDnolBkboYYF4MHcZ74/gjk1qunl86RrqQ8E633lLVLLFNkFyIQY3TE ySZMZW5ePeVJTM/TJGWTF7FK40mJn/Y6RRT/iEWXWsHSRTeBPKVETk7LaGW/ORel IScW1VGtMPf62B1JcFmPt0uI+uY43ijlDIWq+yYf2tOvqY5bfuCbvZX+ZsLl1ugg C6wdJgbZjVSlRowNFUjJtq99yFUBYY9mgXjjPiFP+gnyiMBZ6vjOEGcsYb25nJxj WFCaIiB6zE+hcgBChAI8oonhYBc59byQkjcEreot8DWMQi75FQgBjDxTA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudduhedgudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepudekteeuudehtdelteevgfduvddvjefhfedulefgudevgeeghefg udefiedtveetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 21 Jan 2023 19:09:01 -0500 (EST) From: Samuel Holland To: Tom Rini Cc: Simon Glass , Stefan Roese , u-boot@lists.denx.de, Wadim Egorov , Samuel Holland , Johan Jonker , Kever Yang , =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [PATCH v3 2/2] serial: ns16550: Enable clocks during probe Date: Sat, 21 Jan 2023 18:09:00 -0600 Message-Id: <20230122000900.54459-2-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20230122000900.54459-1-samuel@sholland.org> References: <20230122000900.54459-1-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Reviewed-by: Stefan Roese Signed-off-by: Samuel Holland --- Changes in v3: - Switch back to the original patch, now that the phycore-rk3288 build is fixed by enabling LTO in patch 1. Changes in v2: - Only enable the first clock, as using the clk_get_bulk() API pushes a board (phycore-rk3288) over its SPL size limit. drivers/serial/ns16550.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index eab9537fba..50ec36ed7f 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); -- 2.37.4