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 3C1A1C433EF for ; Wed, 16 Mar 2022 16:00:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9714180EF4; Wed, 16 Mar 2022 17:00:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=akkea.ca Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=akkea.ca header.i=@akkea.ca header.b="lMZq9cwd"; dkim=pass (1024-bit key) header.d=akkea.ca header.i=@akkea.ca header.b="xraD3mWw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1004D8395F; Wed, 16 Mar 2022 17:00:53 +0100 (CET) Received: from node.akkea.ca (li1434-30.members.linode.com [45.33.107.30]) (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 A23908301E for ; Wed, 16 Mar 2022 17:00:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=akkea.ca Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=angus@akkea.ca Received: from localhost (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id A11444E2006; Wed, 16 Mar 2022 16:00:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1647446447; bh=99nu+eZhc0mcBstfAIsR5+v3z6UKYSSGRIfaNzG5Uio=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=lMZq9cwdrO0+GwOo+syhcRA9DOPFRTuLsVnvzTOvsK615oCXknGWp/QHQoqNGL8kg lK+NUioZYSfBoVMSEGCenOHvZmnZK2I/k/R/oLNNzKhgcAv3N5W4rV4Qni9KNSTSU5 /QSv5UrMCziakqRbnquAvMhcIPKpWqT+O8+yMU1k= Received: from node.akkea.ca ([127.0.0.1]) by localhost (mail.akkea.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 795Lji8dsdGD; Wed, 16 Mar 2022 16:00:46 +0000 (UTC) Received: from www.akkea.ca (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id A38504E2003; Wed, 16 Mar 2022 16:00:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1647446446; bh=99nu+eZhc0mcBstfAIsR5+v3z6UKYSSGRIfaNzG5Uio=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=xraD3mWwBoBRt5IeHO71ODXuCLOLrcE5KjDEPOhyORIyKwedvUXRjGM/brUx5K0hD /A+H00bG/b1LUWBY13dbPC5kS5TkU0x+gey5mN3eIngGvc7toX82WZMkee3aoaVHq+ ov+ucUmCKFFlNVevrs1m2E3zRpeuGimd4t2i1DAw= MIME-Version: 1.0 Date: Wed, 16 Mar 2022 09:00:46 -0700 From: Angus Ainslie To: Heiko Thiery Cc: Angus Ainslie , u-boot@lists.denx.de, Marek Vasut , lukma@denx.de, seanga2@gmail.com, sbabic@denx.de, festevam@gmail.com, kernel@puri.sm, uboot-imx@nxp.com, peng.fan@nxp.com, Michael Walle Subject: Re: [PATCH v4 2/4] clk: imx8mq: Add a clock driver for the imx8mq In-Reply-To: References: <20220315130820.1054186-1-angus@akkea.ca> <20220315130820.1054186-3-angus@akkea.ca> <59a8d3a19ef0d7f7a982083b5002cb51@akkea.ca> <7f7e0935bb7450b8fdf856b7a3d724ee@akkea.ca> Message-ID: <5918d6180131631dec19444e3349e9a0@akkea.ca> X-Sender: angus@akkea.ca User-Agent: Roundcube Webmail/1.3.17 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit 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.5 at phobos.denx.de X-Virus-Status: Clean Hi Heiko, On 2022-03-16 08:55, Heiko Thiery wrote: > Hi Angus, > > [snip] >> > > But then something went wrong when probing uart3 ... the baudrate >> > > switched for the uart2 (console) and the serial output became broken. >> > > Later when the kernel starts the output becomes correct again. So the >> > > kernel seems to configure it correctly. >> > > >> > > see here: https://pastebin.com/raw/qXVShb3Q >> > > >> > > When I remove the "assigned-clock-parents = <&clk >> > > IMX8MQ_SYS1_PLL_80M>;" for uart3 the output of uart2 (console) keeps >> > > ok. >> > >> > If that "fixes" it then it means that the parent IMX8MQ_SYS1_PLL_80M >> > clock rate is getting changed by the uart3 stanza. >> > >> > Are you using the mainline devicetree file for your board ? If not could >> > you provide a link ? >> >> I use the mainline u-boot/linux one. > > We (thanks to Michael) found the issue. For the imx8mq the > imx_get_uartclk() returns always the values for UART1_CLK_ROOT [1]. > This is wrong. Here we have to get the value dependent on the used > UART. > > [1] > https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/mach-imx/imx8m/clock_imx8mq.c#L381 Yeah that driver could do with an overhaul as it also does that for the ECSPI clocks which can also break things. Angus