From patchwork Thu Jan 18 18:45:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 10173897 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3DC18601E7 for ; Thu, 18 Jan 2018 18:46:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C98E28438 for ; Thu, 18 Jan 2018 18:46:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20FA428448; Thu, 18 Jan 2018 18:46:15 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 D230828438 for ; Thu, 18 Jan 2018 18:46:14 +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:References: In-Reply-To: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:List-Owner; bh=Q1X30ei160v5o2kiLLBuUyF1rgoF6jztwUhUGefynyc=; b=btXflaFMwLPhj5UmZRLdeOVZwd gwSm0X9PqCk9pFRX1XLSzOXGwTBQtW5QNKxp+odX2HZ0zWvh778Cjcd2sq2tNAGepYImBCqB5LGzs S5G+xtXz3mdj2B46T+aJLDj3DtyEqemHrUS/ytDj2DtInV2A/TAmkWeFSVjZJc3UEzmncLo9ykbN0 7Vqd2UNoStBk+lZKE6W0CNp+tPxITiJU1hlC99X74ozDHQwQgi366x3vRTnkSUbhff8aN9OnLxV8q 09Hnz6yaQc1qV/KYVZ3UjaNJFf+dMlO21qJZEoj1/wMjaUWEJyzr9Q+FdxvSBz9jyNbkznVUDLdGc kROL4PBQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ecFCQ-0003rD-2J; Thu, 18 Jan 2018 18:46:06 +0000 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ecFCD-0003b7-2G for linux-amlogic@lists.infradead.org; Thu, 18 Jan 2018 18:45:55 +0000 Received: by mail-wr0-x242.google.com with SMTP id z48so23636252wrz.6 for ; Thu, 18 Jan 2018 10:45:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aUsyxn3qKCQaAo3rtTr/Nydn9rZtVI7+J9ltTUWN6XA=; b=l4NJhsGmggWKt7iLzvmwng/mCnXLejLFkhfIs+JYOlXi8/s/HNdOQLxIZPjxqquo21 lcg890kLdZ6hu5tXveu4P2E1ZqBSofo238QCavWCzk8eworcsv1aweAEo+so4j5lT0TJ +vGrxEs7RVzmCQkGRY/n7HkM3CStFgkGcI7KuzDUWkxuyZ6A9/5zweb34LieB9MkKP0g VRXORLnsvFBeENwYIIi4d4PVEDlw8jaQJQ2LKPW+5PNmqiZOiGvIjp7rW8jW0a4omVpf zJTI33MMLX7Kq2zc2blahpULcBBinIkti60P0oW0oOCcLl7hDtJ0OnlG9n5hGL3L8cWz /YXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aUsyxn3qKCQaAo3rtTr/Nydn9rZtVI7+J9ltTUWN6XA=; b=fZNv8UnfJhwTGwL5hLFsT46v/TI/XyC1N/4gO+BhkvQeFWQW/bCAt/S0F9T4SQiuw+ ZVRbpOom5YbGKYU+nVX+VBV/MtBPySRdTF64vlJxV5bzVwP58JK7++SVP5N5qejpER+j 6piAtb2twYhgXgEUqezWGIvJZsmN6HfyNjbqTEVRlyGD/WV83rI5ZGBce+xThHnimcfc 1MBddxHiysLjuzHsXbiwVOV5E85EShIVAzi/MFsGRdBzlm4RIjHxzYWesW4NfpCLS7i9 zBapamnOJ/Qym/kjrApkBmKOnCFEhu4eT7VFmU5tSvUh3xhaakzvskROoIGOyTaol+hY RCYA== X-Gm-Message-State: AKwxytel7zdDliYN58gWgbsvPz9NiuaaM3WiD68twq9eQjcbKR/KW2Li PD+m4tY5nPab1EqP4i7RDLIndw== X-Google-Smtp-Source: ACJfBos4MueFl82QmqW4tdL3BuZKVHOfu0c3PNshpCHtm/03JYk8FzkXiuZ6/3R12vqXFwxokrMsUA== X-Received: by 10.223.135.2 with SMTP id a2mr6787684wra.126.1516301140678; Thu, 18 Jan 2018 10:45:40 -0800 (PST) Received: from boomer.baylibre.local ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id y62sm6240236wrb.48.2018.01.18.10.45.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Jan 2018 10:45:40 -0800 (PST) From: Jerome Brunet To: Neil Armstrong Subject: [PATCH 6/9] clk: meson: add gxl hdmi pll Date: Thu, 18 Jan 2018 19:45:29 +0100 Message-Id: <20180118184532.6856-7-jbrunet@baylibre.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180118184532.6856-1-jbrunet@baylibre.com> References: <20180118184532.6856-1-jbrunet@baylibre.com> X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Hilman , Michael Turquette , Stephen Boyd , linux-kernel@vger.kernel.org, Carlo Caione , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, Jerome Brunet MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The hdmi pll used in the gxl family is actually different from the gxbb. The register layout is completely different, which explain why the hdmi pll rate has always been rubbish on the gxl. Adding the correct register field is the first part of the fix to get a correct rate out the hdmi pll Fixes: 0d48fc558d01 ("clk: meson-gxbb: Add GXL/GXM GP0 Variant") Signed-off-by: Jerome Brunet --- drivers/clk/meson/gxbb.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c index cf083a1906d1..08b3e1cdba5b 100644 --- a/drivers/clk/meson/gxbb.c +++ b/drivers/clk/meson/gxbb.c @@ -253,6 +253,52 @@ static struct meson_clk_pll gxbb_hdmi_pll = { }, }; +static struct meson_clk_pll gxl_hdmi_pll = { + .m = { + .reg_off = HHI_HDMI_PLL_CNTL, + .shift = 0, + .width = 9, + }, + .n = { + .reg_off = HHI_HDMI_PLL_CNTL, + .shift = 9, + .width = 5, + }, + .frac = { + /* + * On gxl, there a register shift due to HHI_HDMI_PLL_CNTL1 + * which does not exist on gxbb, so we compute the register + * offset based on the PLL base to get it right + */ + .reg_off = HHI_HDMI_PLL_CNTL + 4, + .shift = 0, + .width = 12, + }, + .od = { + .reg_off = HHI_HDMI_PLL_CNTL + 8, + .shift = 21, + .width = 2, + }, + .od2 = { + .reg_off = HHI_HDMI_PLL_CNTL + 8, + .shift = 23, + .width = 2, + }, + .od3 = { + .reg_off = HHI_HDMI_PLL_CNTL + 8, + .shift = 19, + .width = 2, + }, + .lock = &meson_clk_lock, + .hw.init = &(struct clk_init_data){ + .name = "hdmi_pll", + .ops = &meson_clk_pll_ro_ops, + .parent_names = (const char *[]){ "xtal" }, + .num_parents = 1, + .flags = CLK_GET_RATE_NOCACHE, + }, +}; + static struct meson_clk_pll gxbb_sys_pll = { .m = { .reg_off = HHI_SYS_PLL_CNTL, @@ -1520,7 +1566,7 @@ static struct clk_hw_onecell_data gxbb_hw_onecell_data = { static struct clk_hw_onecell_data gxl_hw_onecell_data = { .hws = { [CLKID_SYS_PLL] = &gxbb_sys_pll.hw, - [CLKID_HDMI_PLL] = &gxbb_hdmi_pll.hw, + [CLKID_HDMI_PLL] = &gxl_hdmi_pll.hw, [CLKID_FIXED_PLL] = &gxbb_fixed_pll.hw, [CLKID_FCLK_DIV2] = &gxbb_fclk_div2.hw, [CLKID_FCLK_DIV3] = &gxbb_fclk_div3.hw, @@ -1675,7 +1721,7 @@ static struct meson_clk_pll *const gxbb_clk_plls[] = { static struct meson_clk_pll *const gxl_clk_plls[] = { &gxbb_fixed_pll, - &gxbb_hdmi_pll, + &gxl_hdmi_pll, &gxbb_sys_pll, &gxl_gp0_pll, };