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 2CD72C433FE for ; Wed, 16 Mar 2022 14:15:53 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D22B6837C9; Wed, 16 Mar 2022 15:15:50 +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="v/9OAXNl"; dkim=pass (1024-bit key) header.d=akkea.ca header.i=@akkea.ca header.b="tHcPAtnV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 318C88007A; Wed, 16 Mar 2022 15:15:48 +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 A711D80331 for ; Wed, 16 Mar 2022 15:15:43 +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 D4BF44E2006; Wed, 16 Mar 2022 14:15:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1647440141; bh=KwThn8m0+OpHWv7GYjm3frlmC6VMmArldQzSHVuA9HY=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=v/9OAXNlqfIgienWUTXodQStooEEMfmjwz8oeflOjEAKbmuR2tEpF2VwFmrU3rMfT BU22FyKyT3hfZ81Kg9/eTjwX6NcLC8fd0V1omBqojSLUoXh37QYSEWCKCY02p7WoOr kqbvj3lZlBE0IidmVxRjB76dVPXCOa49Qgrff7io= 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 g6HMCOZsz28K; Wed, 16 Mar 2022 14:15:40 +0000 (UTC) Received: from www.akkea.ca (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id E31634E2003; Wed, 16 Mar 2022 14:15:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1647440140; bh=KwThn8m0+OpHWv7GYjm3frlmC6VMmArldQzSHVuA9HY=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=tHcPAtnVrI2RTjPoVcXOFkiPz39WmyNM581hVDbqp9QomU0uOoLEooffUTL/no5bd RnCksuKN0KcLs7qv87bNwlK4rGDoxnSHBnjCPa6UhMmKcAyqg8Ad4iJomIJ27xH1mH Ya3oRaV82+7KnT8fOYZcqLM5Njgzevuyb8AB8MeQ= MIME-Version: 1.0 Date: Wed, 16 Mar 2022 07:15:40 -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 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> Message-ID: <7f7e0935bb7450b8fdf856b7a3d724ee@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 On 2022-03-16 07:02, Heiko Thiery wrote: > Hi Angus, > > [snip] > >> > >> > Meanwhile I figured out what the problem is with the 'No serial driver >> > found'. In the used dtb there are 'assigned-clocks' and >> > 'assigned-clock-parents' set in the uart nodes. When removing this the >> > serial will work. I have to admit that I do not know why this is set >> > that way. I can only imagine that this was taken from the uboot-imx >> > tree. >> > >> > --- >> > assigned-clocks = <&clk IMX8MQ_CLK_UART1>; >> > assigned-clock-parents = <&clk IMX8MQ_SYS1_PLL_80M>; >> > --- >> > >> >> Does that solve the reboot ? > > Yes, when I remove these assigned-clocks from my dtb the issue is > solved and the board finds the serial driver and starts correctly. > >> >> > see also here: >> > https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/imx8mq-kontron-pitx-imx8m.dts#L315 >> >> If that works for Linux it should also work for u-boot. It may be that >> the SYS1_PLL_80M isn't set correctly or that the CLK_UART1 mux isn't >> correctly setup. If you enable DEBUG in clk-uclass I might be able to >> figure out were the problem is. > > The problem is that the IMX8MQ_CLK_UART1 is not found and that is the > reason that the probe fails. I tried to add the missing clocks to how > it is done in the kernel. > > see here: https://pastebin.com/raw/iYYMHEdy Looking at that you shouldn't need + clk_dm(IMX8MQ_CLK_25M, clk_register_fixed_rate(NULL, "clock-osc-25m", 25000000)); + clk_dm(IMX8MQ_CLK_25M, clk_register_fixed_rate(NULL, "clock-osc-27m", 27000000)); Those get correctly probed by the clock-controller. The rest of it looks OK and could be a follow on patch to the clock driver, > > 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 ?