Message ID | 20230422141119.618453-2-dario.binacchi@amarulasolutions.com |
---|---|
State | New |
Headers | show
Return-Path: <linux-amarula+bncBCQ4XFG47UFRBEGWR6RAMGQE6BXF33Y@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id BC1793F334 for <linux-amarula@patchwork.amarulasolutions.com>; Sat, 22 Apr 2023 16:11:28 +0200 (CEST) Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-94a34a09571sf287309466b.1 for <linux-amarula@patchwork.amarulasolutions.com>; Sat, 22 Apr 2023 07:11:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1682172688; cv=pass; d=google.com; s=arc-20160816; b=zEEt+KHWRCYKjDP9lc+67/41mUfn/C1fXwJLJjVTlmcPhWnRiEA7Ex97ancvBr0aE1 uLVUzrGBEm+kkUmxFN9yPpPTe0mN8Iw6IznwTFz0oYxB91rf2ORjN2gdudMNR7Iiga5A i4A95GeSjX7S8jup/QELjpFYxmTGCeN/ERMRiN92rQilJxokpHbvj5UfxXq5VovUpw/A WTDKIVdFtmZ4KcE3nHemcrj1GQMEXC3IdfeNIREpcDgAyBxQ+TIgYTEF17T1cNcR46e6 IzwfLshJDHbx7xBsDdfUwFKPjXAqVVsNNlc0Sf9kcjMs2VK/CkGYgUABfApYVPWeIbKi T30A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=70eB7XApWyvIWs+3JaIUs5Ly01nSa7IHh3byxvUQuU8=; b=06fz8RN5b4Sup3e2qWSs+SUcDCAhyh6APIU+fVo95mq2ioqvXDMMNYDezzJzgep3CY MEEF2gV4tB3aXe6wuNy7VAvGafhq835/xDHTGaxCbnIjyIwVYStSgsAS0FbSY8SHsUlc JEwsha5G4ji9aGk0l7aA5dmgRmWFYzUA1NGmdmCgFk6Bg89TOqkW2rlhqd6VNIj9bSAA 7BWQZ0FQ4qE8ijNvJqJydODKzDR9YRCUp4EJ4GhbdnlyMTomyJxRZTMDq205xB8wYPkc dYcsDMTT/XN4UCq0cPoWTJ7ldFbV9JzdhDNCEI/XMR14UBhMVrZnVaFcTqQPlF3kJkbM p+cg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="r1/326PU"; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1682172688; x=1684764688; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=70eB7XApWyvIWs+3JaIUs5Ly01nSa7IHh3byxvUQuU8=; b=g9C+p4qQ9R/aKXSovfSQAXSUYxO3eh+FrzmRk72iNZs/j9sCx1FWh5ngV6vzF5yK5U Izb9MWnxyrncf82reElhWKItm1CSXBIGpBDaQx9Y2BFSSGBoV1nYQORCIK9MjBPyb/F5 /2Be/giEkhEBmOazY8HeQmzC4Xta/i7y7ksCg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682172688; x=1684764688; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=70eB7XApWyvIWs+3JaIUs5Ly01nSa7IHh3byxvUQuU8=; b=Zwh+/hS1zpoRKyIlj7lLk6DPCG2H/NaU7Jn7iDui8BZqwjoVW/wgF9tOF7IvJ2NlZJ BGcT40PtSLZF6U01RBundFYcusZpXZkUrsbDOt5kG7uglWqqI8LPuCWupVQu8ESJydXB 6F3AFrkR2UgPzoimmAlZuCiEK5fV/ceOHsXdbjq2xOT1hqjpVUlq6h+SKFs/Sfex3Ip3 FgXzEU1NtD/bX8ZTsU+uIvhs9kaaUnEw9lqD+GSHJlk1JeTQAbBLIAmfYWXnK6U3wbOv tZE54j9BLa1YZAUCmJJgUPzB1moLCYpMdMo3qV8LykV9BB49P4PpEI5WZ7sDJVkL+eaj cnhQ== X-Gm-Message-State: AAQBX9dDmR7fR6c5EDBggsLy2iY8ThFmDkt7LEtpZNbh+bHbR8Hrp8hL AfTkXFXkQqMYe25qa1CwJJW7XR+8 X-Google-Smtp-Source: AKy350YBwDpaw3ObPUhquRQiaeGAG+NsnxJHxqJxEy3rhq7PAuRAYXF/jypwN81KayERXv2dYiP5gQ== X-Received: by 2002:a17:906:d8c8:b0:94e:46ee:f9c8 with SMTP id re8-20020a170906d8c800b0094e46eef9c8mr1786101ejb.14.1682172688343; Sat, 22 Apr 2023 07:11:28 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:907:b60a:b0:921:8068:e25e with SMTP id vl10-20020a170907b60a00b009218068e25els5048384ejc.0.-pod-prod-gmail; Sat, 22 Apr 2023 07:11:27 -0700 (PDT) X-Received: by 2002:a17:906:7b84:b0:94f:367f:3f2e with SMTP id s4-20020a1709067b8400b0094f367f3f2emr5210550ejo.1.1682172686721; Sat, 22 Apr 2023 07:11:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682172686; cv=none; d=google.com; s=arc-20160816; b=AiXo1LiLIs/gLOInWY4SsPRZOHQ79sBkvRq7DznYyqH7M/cu16RXqBrmnqZKA9xSNU P8A9eflaJEZ+BNuRJQTgFUJVM8BFI6fhB76on2uSFF8SzVqhyovNum1UT1jQuWD3cXTR D9tjiaYkDcFQYhDtaNp7EE627BofSek1RVxMvHbiyh1F1auk9mM/GvU1/HX/D9APhlnF D8/wqHxedUnZISpvFD5K/3fpPtG1jrQlCBM/VuQQVvZgkwxV7KbW2IJT9C6r30Ccnf+d Uir0i5mCd4X070Yoeh8N2pw9hR3aIrTy2sW1B/Jd61OyD/cecA/f1b6kB3BngP5FLRLT emzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=JrQ8o7UyARpsrBXpt9TSn9qwzjxHnBHq9JmOxAYlJnw=; b=gvai5WDX2TyFNh3U50Z4qtBofpr9SRoAYKd0NhvMgFPFVp8KX4cL8hd9oHdf/thbAm vAIz+OJYqjb38Q6EPvMBJfd4s6vK74Z9kNBEhTDc2mRONKzQov2qbYP0CbtF4Jbq555O cKhVD6+43ZI/gj8PESbyGxqdlo29SYJIa4e7TsM0J7dfSSq6xFLxap4PegEGlAj7gXN8 N/lWTjZWOstYoEV387/ElIhizeTb8P6kz4Q8k6DpnbyX6etHm/F6ml+d8JohOgIKAFJf AGW8qNNX+DMwvSYTtly/ISzXRJzErZ0BnRZfBOUM40Bby24apn6qeHjG0JAHa3RsLSIw GGqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="r1/326PU"; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id e9-20020a170906080900b00948ca560e85sor3789114ejd.42.2023.04.22.07.11.26 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Sat, 22 Apr 2023 07:11:26 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:906:2307:b0:94a:643e:9e26 with SMTP id l7-20020a170906230700b0094a643e9e26mr5890981eja.14.1682172686501; Sat, 22 Apr 2023 07:11:26 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-87-5-99-194.retail.telecomitalia.it. [87.5.99.194]) by smtp.gmail.com with ESMTPSA id de23-20020a1709069bd700b0094f02ebedf5sm3304752ejc.64.2023.04.22.07.11.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Apr 2023 07:11:25 -0700 (PDT) From: Dario Binacchi <dario.binacchi@amarulasolutions.com> To: u-boot@lists.denx.de Cc: linux-amarula@amarulasolutions.com, Sean Anderson <seanga2@gmail.com>, Lukasz Majewski <lukma@denx.de>, Dario Binacchi <dario.binacchi@amarulasolutions.com>, Michael Trimarchi <michael@amarulasolutions.com>, Fabio Estevam <festevam@gmail.com>, "NXP i.MX U-Boot Team" <uboot-imx@nxp.com>, Stefano Babic <sbabic@denx.de> Subject: [RESEND PATCH 1/3] imx6: clock: improve calculations to get the PLL video rate Date: Sat, 22 Apr 2023 16:11:17 +0200 Message-Id: <20230422141119.618453-2-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230422141119.618453-1-dario.binacchi@amarulasolutions.com> References: <20230422141119.618453-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="r1/326PU"; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
Series |
|
Related |
show
|
diff --git a/arch/arm/mach-imx/mx6/clock.c b/arch/arm/mach-imx/mx6/clock.c index cb9d629be408..17d8dcd5c841 100644 --- a/arch/arm/mach-imx/mx6/clock.c +++ b/arch/arm/mach-imx/mx6/clock.c @@ -213,6 +213,7 @@ int enable_spi_clk(unsigned char enable, unsigned spi_num) static u32 decode_pll(enum pll_clocks pll, u32 infreq) { u32 div, test_div, pll_num, pll_denom; + u64 temp64; switch (pll) { case PLL_SYS: @@ -272,7 +273,10 @@ static u32 decode_pll(enum pll_clocks pll, u32 infreq) } test_div = 1 << (2 - test_div); - return infreq * (div + pll_num / pll_denom) / test_div; + temp64 = (u64)infreq; + temp64 *= pll_num; + do_div(temp64, pll_denom); + return infreq * div + (unsigned long)temp64; default: return 0; }