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 2FAC9C433F5 for ; Wed, 16 Mar 2022 16:20:38 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6554083960; Wed, 16 Mar 2022 17:20:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=walle.cc 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; secure) header.d=walle.cc header.i=@walle.cc header.b="ruNoKKXe"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 60FD983C99; Wed, 16 Mar 2022 17:20:33 +0100 (CET) Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) (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 08CBE8395F for ; Wed, 16 Mar 2022 17:20:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michael@walle.cc Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 3619C22246; Wed, 16 Mar 2022 17:20:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1647447627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ro11Xdw+o2pxYfMRQutPFSk1C+gmRsT3yU2UqxCROoE=; b=ruNoKKXeOETf+etZiMhsBLx6DbAkgbR8/fGyys5YOQkW317Rsow/D8dCL7KhXjiaQ2ACsJ 8mybkP8IaCLK4MmTI7YUmfN6jpuNfjzAhj1pvUuSGAtS9METusfoLLymOfjy5bTz0lCFf3 naWX7EbGlu+i18vHB2DMWI24BJIiGWY= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 16 Mar 2022 17:20:27 +0100 From: Michael Walle To: Angus Ainslie Cc: Heiko Thiery , 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 Subject: Re: [PATCH v4 2/4] clk: imx8mq: Add a clock driver for the imx8mq In-Reply-To: <5918d6180131631dec19444e3349e9a0@akkea.ca> References: <20220315130820.1054186-1-angus@akkea.ca> <20220315130820.1054186-3-angus@akkea.ca> <59a8d3a19ef0d7f7a982083b5002cb51@akkea.ca> <7f7e0935bb7450b8fdf856b7a3d724ee@akkea.ca> <5918d6180131631dec19444e3349e9a0@akkea.ca> User-Agent: Roundcube Webmail/1.4.13 Message-ID: <66fd6f82b5cb46f22b325cbcc44b62e5@walle.cc> X-Sender: michael@walle.cc 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 Am 2022-03-16 17:00, schrieb Angus Ainslie: > 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. IMHO the imx serial driver should get its clock from the device tree. Not sure about the debug serial part though. -michael