From patchwork Thu Aug 9 16:52:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jernej_=C5=A0krabec?= X-Patchwork-Id: 10561591 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0D44413BB for ; Thu, 9 Aug 2018 16:53:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF8842B412 for ; Thu, 9 Aug 2018 16:53:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E40682B6E6; Thu, 9 Aug 2018 16:53:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 89C452B412 for ; Thu, 9 Aug 2018 16:53:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=8sMykUCHnkv42xy88g75ZzU1gmbw2teqgwB5ISGY1As=; b=Oj/ g5gb0WmGMw2KjSYmK5AN01Z2YM5jbaRzilnuGadXWAcBAWlyth6kO07PBRkiHmyYf9Ab5ZrourI7Y BH+lx4E37NZuibVYZe71k/O4M2orylHBA2mklFLeZXbXk+Zl5PQ32zUQtqBJ0jRSCF8YsruQuQZHm sCHxMjIAP0/sKL8n8S5BxENyJ6+UxWVI+Frfny8whKco+/fcGxYJ8hK1xilkvMUPT0Xc2ukCI5s+l qVA8fGEXmMBou4Zm/0in7RIuzA94TDoL60feKrZUbk7Ch2DXjehDkrURpoirwwUAiMD2AdkHROvYp 8ixwOOVzRXM/0OYWGUEMRMfVl/uRsSA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fnoC5-0004n4-Es; Thu, 09 Aug 2018 16:53:49 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fnoBS-00040q-RL for linux-arm-kernel@bombadil.infradead.org; Thu, 09 Aug 2018 16:53:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=p1JBjlWXs6hYLVf6UroKnHEdqzDtib5LeSmWvChP4cI=; b=s3tOkv4FpRkDoXOhaNhZdsQ+F mb8IV+hedAQ2SS9QQzyH4W7R3qVhgIZkXbTkockENhqJj/OdBLDyyxvaP7P+/xSmJ9fWrRDr9mYQx i5UMynJ++xrwFCCffU/EuST6isqzXSFX+Py7WWu5Mp2oduklKujwNx0UB3lPDkAQS/yJP49/p5O8o PvNHqw/Fd1a6Zuug2Bx7079vSljvyqONEgf60KiPRp8gaNpy4ANW3IIqZEG2C5SymG0hox/n4DVei 07iEk0KPjgXzvDDWeog6MD8GtbFQBJT/8Q8NzHGNdy+xrAl9PRC9Vc1J8+n0V7VRuIKikcg56g3qQ xvm+hx1Rg==; Received: from mailoutvs19.siol.net ([185.57.226.210] helo=mail.siol.net) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fnoBP-0004fU-LQ for linux-arm-kernel@lists.infradead.org; Thu, 09 Aug 2018 16:53:08 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTP id 23A0E520431; Thu, 9 Aug 2018 18:52:29 +0200 (CEST) X-Virus-Scanned: amavisd-new at psrvmta11.zcs-production.pri Received: from mail.siol.net ([127.0.0.1]) by localhost (psrvmta11.zcs-production.pri [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id qQ4-hMFAoZjy; Thu, 9 Aug 2018 18:52:28 +0200 (CEST) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTPS id A0A225203A0; Thu, 9 Aug 2018 18:52:28 +0200 (CEST) Received: from localhost.localdomain (unknown [194.152.15.144]) (Authenticated sender: 031275009) by mail.siol.net (Postfix) with ESMTPSA id 5E606520431; Thu, 9 Aug 2018 18:52:26 +0200 (CEST) From: Jernej Skrabec To: maxime.ripard@bootlin.com, wens@csie.org Subject: [PATCH 0/5] Set max rate for video PLLs Date: Thu, 9 Aug 2018 18:52:12 +0200 Message-Id: <20180809165217.30680-1-jernej.skrabec@siol.net> X-Mailer: git-send-email 2.18.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180809_125307_837878_4E6BC14A X-CRM114-Status: UNSURE ( 9.34 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jernej.skrabec@siol.net, sboyd@kernel.org, mturquette@baylibre.com, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch series implement maximum rate constraint for video PLLs, because it is possible to set higher PLL rate that is actually supported in HW. Issue became apparent when user reported non-working monitor connected to board with H5 SoC. Native monitor resolution in this case was 2560x1080, with 185580 kHz pixel clock. Clock subsystem found out that best matching pixel clock can be generated if video PLL is set to 2040 MHz, which is way out of specs for PLL. With this patch series applied, everything worked just fine, with slightly higher rate error, but within working limits for PLL and HDMI. I'm not sure if "Fixes" tag should be added. It solves real world problem, but there was nothing wrongly implemented, just upper limit is missing. While user reported that these patches solve the issue on H5, I added similar fixes for other SoCs too. Since I don't have such monitor, I only tested if board boots up and if HDMI works (H3, R40 and A83T). Jernej Skrabec (5): clk: sunxi-ng: Add maximum rate constraint to NM PLLs clk: sunxi-ng: h3/h5: Add max. rate constraint to pll-video clk: sunxi-ng: r40: Add max. rate constraint to video PLLs clk: sunxi-ng: nkmp: Add constraint for maximum rate clk: sunxi-ng: a83t: Add max. rate constraint to video PLLs drivers/clk/sunxi-ng/ccu-sun8i-a83t.c | 2 ++ drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 25 ++++++------- drivers/clk/sunxi-ng/ccu-sun8i-r40.c | 52 +++++++++++++-------------- drivers/clk/sunxi-ng/ccu_nkmp.c | 7 ++++ drivers/clk/sunxi-ng/ccu_nkmp.h | 1 + drivers/clk/sunxi-ng/ccu_nm.c | 7 ++++ drivers/clk/sunxi-ng/ccu_nm.h | 30 ++++++++++++++++ 7 files changed, 86 insertions(+), 38 deletions(-)