From patchwork Sun Jun 4 18:33:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 9765217 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 6F6136032D for ; Sun, 4 Jun 2017 18:33:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6451A27F88 for ; Sun, 4 Jun 2017 18:33:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 59198274D2; Sun, 4 Jun 2017 18:33:58 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6444274D2 for ; Sun, 4 Jun 2017 18:33:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751203AbdFDSd5 (ORCPT ); Sun, 4 Jun 2017 14:33:57 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35417 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751177AbdFDSd4 (ORCPT ); Sun, 4 Jun 2017 14:33:56 -0400 Received: by mail-wm0-f67.google.com with SMTP id g15so26641674wmc.2; Sun, 04 Jun 2017 11:33:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=l8JSouT5qv7CYXMJSMlztjeKXYgOspmPgNDemzdQ+sE=; b=gS9XKVLjZNk7CovPqVNYwKtSe4uwldut+ZUWG0BnwRVLhAnWnaJZwJqtzShuSn9Jqi R2/2mrH0Q1AnZlVPAL7y+9Uv7TpNEUxmyCk+4iMkpYO3TzV4cF2QK2GbvkS22ldNwm7F Qku4oJDVqzUQ1rgCCoLGr9q0p1hjQDdKVvnY4v5q6aGwYUMEtdsQr62uqh0mUCm0z5gO Es2VOg7Rr4lUS5mhcwFduJWZjTNxeCa5t/CW9K4y6DwZQ0arY9XewP1skfkBdKH1FD6Q hwTEz5QYruRZSzqHYxv4tjHsz3Wh+NmRKBOUcXRPPZ13Wjj6KgUv35sPVZZs54dq4vKd vEiw== 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=l8JSouT5qv7CYXMJSMlztjeKXYgOspmPgNDemzdQ+sE=; b=NIK2bwyUeNuZhcNOA2+hZoYVqFxz/VMfUd0TU3gHWBzHOcBW0ZxbwBN2APEwR0EMOK BdJ0JrKcjVQdB1h4WDiVvoTalkgyWGMjDoCSI6du0a3nzzuPYMlX2Ooj474WOcn+RNR3 5EGJIxGtakczeglb1mNdv1+3V579FwnQAPR6A2MKbtPBA/e/TF1Fpkt2F79lpvjTdn7t 6VECHAsItNer4VriyyyySPBWxCk9QzFMejNWHYP/kVuNzUKczHL2fUvVIIiUGuJF9thg tCDN9EPoJLhI3ad1+2pWKyLLj+2FPxerzeG4y2qULuXbgeNqoxAGLj8YA2J1ZM/Gk2Iu Uifw== X-Gm-Message-State: AODbwcDO+YjsOK9Cml+26wrSOBGePB0FQRsS/xntZgFjMFiCq2Kgr3GJ FcEsz3p5WuzGQQ== X-Received: by 10.28.91.80 with SMTP id p77mr5361406wmb.84.1496601234946; Sun, 04 Jun 2017 11:33:54 -0700 (PDT) Received: from blackbox.darklights.net (p200300DCD3D6F004D001112B6F8D56F3.dip0.t-ipconnect.de. [2003:dc:d3d6:f004:d001:112b:6f8d:56f3]) by smtp.googlemail.com with ESMTPSA id l8sm10018479wmd.8.2017.06.04.11.33.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Jun 2017 11:33:54 -0700 (PDT) From: Martin Blumenstingl To: narmstrong@baylibre.com, jbrunet@baylibre.com, linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org Cc: mturquette@baylibre.com, sboyd@codeaurora.org, robh+dt@kernel.org, mark.rutland@arm.com, carlo@caione.org, khilman@baylibre.com, linux@armlinux.org.uk, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Martin Blumenstingl Subject: [PATCH 1/3] clk: meson: meson8b: add compatibles for Meson8 and Meson8m2 Date: Sun, 4 Jun 2017 20:33:39 +0200 Message-Id: <20170604183341.21417-2-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170604183341.21417-1-martin.blumenstingl@googlemail.com> References: <20170604183341.21417-1-martin.blumenstingl@googlemail.com> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The clock controller on Meson8, Meson8b and Meson8m2 is very similar based on the code from the Amlogic GPL kernel sources. Add separate compatibles for each SoC to make sure that we can easily implement all the small differences for each SoC later on. In general the Meson8 and Meson8m2 seem to be almost identical as they even share the same mach-meson8 directory in Amlogic's GPL kernel sources. The main clocks on Meson8, Meson8b and Meson8m2 are very similar, because they are all using the same PLL values, 90% of the clock gates are the same (the actual diffstat of the mach-meson8/clock.c and mach-meson8b/clock.c files is around 30 to 40 lines, when excluding all commented out code). The difference between the Meson8 and Meson8b clock gates seem to be: - Meson8 has AIU_PCLK, HDMI_RX, VCLK2_ENCT, VCLK2_ENCL, UART3, CSI_DIG_CLKIN gates which don't seem to be available on Meson8b - the gate on Meson8 for bit 7 seems to be named "_1200XXX" instead of "PERIPHS_TOP" (on Meson8b) - Meson8b has a SANA gate which doesn't seem to exist on Meson8 (or on Meson8 the same bit is used by the UART3 gate in Amlogic's GPL kernel sources) None of these gates is added for now, since it's unclear whether these definitions are actually correct (the VCLK2_ENCT gate for example is defined, but only used in some commented block). The main difference between all three SoCs seem to be the video (VPU) clocks. Apart from different supported clock rates (according to vpu.c in mach-meson8 and mach-meson8b from Amlogic's GPL kernel sources) the most notable difference is that Meson8m2 has a GP_PLL clock and a mux (probably the same as on the Meson GX SoCs) to support glitch-free (clock rate) switching. None of these VPU clocks are not supported by our mainline meson8b clock driver yet though. Signed-off-by: Martin Blumenstingl Acked-by: Rob Herring Acked-by: Kevin Hilman --- .../devicetree/bindings/clock/amlogic,meson8b-clkc.txt | 11 +++++++---- drivers/clk/meson/Kconfig | 6 +++--- drivers/clk/meson/meson8b.c | 5 ++++- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Documentation/devicetree/bindings/clock/amlogic,meson8b-clkc.txt b/Documentation/devicetree/bindings/clock/amlogic,meson8b-clkc.txt index 2b7b3fa588d7..606da38c0959 100644 --- a/Documentation/devicetree/bindings/clock/amlogic,meson8b-clkc.txt +++ b/Documentation/devicetree/bindings/clock/amlogic,meson8b-clkc.txt @@ -1,11 +1,14 @@ -* Amlogic Meson8b Clock and Reset Unit +* Amlogic Meson8, Meson8b and Meson8m2 Clock and Reset Unit -The Amlogic Meson8b clock controller generates and supplies clock to various -controllers within the SoC. +The Amlogic Meson8 / Meson8b / Meson8m2 clock controller generates and +supplies clock to various controllers within the SoC. Required Properties: -- compatible: should be "amlogic,meson8b-clkc" +- compatible: must be one of: + - "amlogic,meson8-clkc" for Meson8 (S802) SoCs + - "amlogic,meson8b-clkc" for Meson8 (S805) SoCs + - "amlogic,meson8m2-clkc" for Meson8m2 (S812) SoCs - reg: it must be composed by two tuples: 0) physical base address of the xtal register and length of memory mapped region. diff --git a/drivers/clk/meson/Kconfig b/drivers/clk/meson/Kconfig index 19480bcc7046..4a806203b73c 100644 --- a/drivers/clk/meson/Kconfig +++ b/drivers/clk/meson/Kconfig @@ -7,9 +7,9 @@ config COMMON_CLK_MESON8B bool depends on COMMON_CLK_AMLOGIC help - Support for the clock controller on AmLogic S805 devices, aka - meson8b. Say Y if you want peripherals and CPU frequency scaling to - work. + Support for the clock controller on AmLogic S802 (Meson8), + S805 (Meson8b) and S812 (Meson8m2) devices. Say Y if you + want peripherals and CPU frequency scaling to work. config COMMON_CLK_GXBB bool diff --git a/drivers/clk/meson/meson8b.c b/drivers/clk/meson/meson8b.c index bfd1690724de..94c55e79cdde 100644 --- a/drivers/clk/meson/meson8b.c +++ b/drivers/clk/meson/meson8b.c @@ -1,5 +1,6 @@ /* - * AmLogic S805 / Meson8b Clock Controller Driver + * AmLogic S802 (Meson8) / S805 (Meson8b) / S812 (Meson8m2) Clock Controller + * Driver * * Copyright (c) 2015 Endless Mobile, Inc. * Author: Carlo Caione @@ -777,7 +778,9 @@ static int meson8b_clkc_probe(struct platform_device *pdev) } static const struct of_device_id meson8b_clkc_match_table[] = { + { .compatible = "amlogic,meson8-clkc" }, { .compatible = "amlogic,meson8b-clkc" }, + { .compatible = "amlogic,meson8m2-clkc" }, { } };