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 7AC94C433F5 for ; Fri, 11 Mar 2022 19:33:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5402283AF6; Fri, 11 Mar 2022 20:33:56 +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="MO9ODfB1"; dkim=pass (1024-bit key) header.d=akkea.ca header.i=@akkea.ca header.b="MO9ODfB1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2866083093; Fri, 11 Mar 2022 20:33:55 +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 52F4183AF6 for ; Fri, 11 Mar 2022 20:33: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 D07334E200C; Fri, 11 Mar 2022 19:33:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1647027227; bh=zD9tx50HdKnF4Kwd7QWGsmM+7GRnjNo1xbHoGLf+8B4=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=MO9ODfB18wAgtpwIwcULHjE19wplu0jXRtvW8y43UeEPCaX5Z3Z8A8GXGgT0ZVWaC lIttQIC0497q+5LWSQCf0rAcSoJmvmMbqaWQqmXWqLYz8FqbA2XPK1uWnZzu916e19 wz3gRz4OzQSAnk30rc4jR64lMcjBzR5bNb5KxHuM= 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 uporscjcr9jy; Fri, 11 Mar 2022 19:33:47 +0000 (UTC) Received: from www.akkea.ca (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id 083B04E2003; Fri, 11 Mar 2022 19:33:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1647027227; bh=zD9tx50HdKnF4Kwd7QWGsmM+7GRnjNo1xbHoGLf+8B4=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=MO9ODfB18wAgtpwIwcULHjE19wplu0jXRtvW8y43UeEPCaX5Z3Z8A8GXGgT0ZVWaC lIttQIC0497q+5LWSQCf0rAcSoJmvmMbqaWQqmXWqLYz8FqbA2XPK1uWnZzu916e19 wz3gRz4OzQSAnk30rc4jR64lMcjBzR5bNb5KxHuM= MIME-Version: 1.0 Date: Fri, 11 Mar 2022 11:33:47 -0800 From: Angus Ainslie To: Marek Vasut Cc: Angus Ainslie , u-boot@lists.denx.de, lukma@denx.de, seanga2@gmail.com, sbabic@denx.de, festevam@gmail.com, kernel@puri.sm, uboot-imx@nxp.com Subject: Re: [PATCH v2 2/2] clk: imx8mq: Add a clock driver for the imx8mq In-Reply-To: <26c0b552-b13c-d48c-04f3-b47c9f72c9b5@denx.de> References: <20220311163536.1330032-1-angus@akkea.ca> <20220311163536.1330032-3-angus@akkea.ca> <14af7ab4-59a7-1af6-2f53-446eefcb87b5@denx.de> <86e82fc6-4a10-3d7c-19bf-e171815ef0e6@puri.sm> <26c0b552-b13c-d48c-04f3-b47c9f72c9b5@denx.de> Message-ID: <3f1dcad06bf12dc9294a3ec874bc7eb7@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-11 11:19, Marek Vasut wrote: > On 3/11/22 19:41, Angus Ainslie wrote: >> On 2022-03-11 10:05, Marek Vasut wrote: >>> On 3/11/22 18:02, Angus Ainslie wrote: >>>> On 2022-03-11 08:57, Marek Vasut wrote: >>>>> On 3/11/22 17:35, Angus Ainslie wrote: >>>>>> All of the PLLs and clocks are initialized so the subsystems below >>>>>> are >>>>>> functional and tested. >>>>>> >>>>>> 1) USB host and peripheral >>>>>> 2) ECSPI >>>>>> 3) UART >>>>>> 4) I2C all busses >>>>>> 5) USDHC for eMMC support >>>>>> 6) USB storage >>>>>> 7) GPIO >>>>>> 8) DRAM >>>>>> >>>>>> The PLL rate tables are from the kernel >>>>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=43cdaa1567ad3931fbde438853947d45238cc040 >>>>> >>>>> That patch is three years old. >>>>> That patch is for MX8M Mini clock, not for MX8M(Q). >>>>> >>>>> You can use the abbreviated commit ID instead: >>>>> 43cdaa1567ad3 ("clk: imx8mm: Move 1443X/1416X PLL clock structure >>>>> to common place") >>>>> But that seems to be the wrong commit. >>>> >>>> That's the commit where the imx8m PLL frequency table is moved to a >>>> common file for use by all of the imx8m variants. The imx8mq linux >>>> driver does not even use the frequency tables so there is not a >>>> specific commit for it. >>> >>> Isn't large part of this driver coming from these tables ? >>> >>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/drivers/clk/imx/clk-imx8mq.c >> >> When I said tables I was referring to the PLL frequency tables. > > Ahh, hmmm, I see that we now have three copies of those PLL tables in > each MX8M{M,N,P} driver and Linux instead has this in common code. Can > you deduplicate the PLL tables before we add fourth copy ? > Ok I can do that for the imx8m* clock drivers. >> The driver is modelled after the u-boot imx8mm u-boot driver with >> register and mux updates from the imx8mq reference manual. Very little >> comes from the imx8mq kernel driver. Mainly I just verified mux naming >> and register offsets against that driver. > > Would it make sense to pick the Linux kernel tables instead then, > instead of hand-writing them from scratch ? That seems error prone. > It's a good thing I didn't just copy the kernel drivers because I found an error there. After this driver accepted there will very few if any updates to the mux tables as I think most if not all of the clocks you'll need in u-boot are defined. If there are any future updates those could be cut and pasted.