From patchwork Sat Dec 8 17:12:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10719533 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 96E26112E for ; Sat, 8 Dec 2018 17:13:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B7CD295A8 for ; Sat, 8 Dec 2018 17:13:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F5A02A076; Sat, 8 Dec 2018 17:13:44 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 149BA295A8 for ; Sat, 8 Dec 2018 17:13:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726165AbeLHRNL (ORCPT ); Sat, 8 Dec 2018 12:13:11 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:43420 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726149AbeLHRNK (ORCPT ); Sat, 8 Dec 2018 12:13:10 -0500 Received: by mail-wr1-f65.google.com with SMTP id r10so6555771wrs.10; Sat, 08 Dec 2018 09:13:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5PXdW4UBpQPSOC7lPcUMX6pSS8TgUTrjYuc4GLT/lzQ=; b=NGEniBJ0JYstL6hTiODRxWJLzTOGQWgeJkhhOBS+Q3uv/oibqKRcvE8eHpA7jqz9FL rTol4mzf7PfkiOaCB7MTgAgnDrwMpuxznJF+EmtviYKU2vDQrBnJpDo4DjsLVDbLIGxy 9kr1bAeJSL23fvgeW9LMx9vxYmFQlVWlJAV9HOQJCXg3hToPA9HuIwjq/lEr803nTvAY KlFXWO9tD5thZ4VP4qOkM0ZWr4JCbsivJXP3PXuL3QQh69L+JM6JTSSRYPxvqaCAJbbi TQFgdugXd40xcQ5/+9NDW3aAc8BWqYEyxIN2kArlFEjBpKIFFa58CjCQmaVsfU3yRIKo SvqA== 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:mime-version :content-transfer-encoding; bh=5PXdW4UBpQPSOC7lPcUMX6pSS8TgUTrjYuc4GLT/lzQ=; b=B4N26xoZlaOBmwE+BqBeBB4bFqcmlsfnatvCB1e12ki70mlKAaL0wqkGY8Mn6laNMV wWfVXc2Qeb1LzsQw24H9o16KPWRzygasDfr0hjSABWPzxNLLXxCukqhc+IbC/jBnCXhb iNtiIKf5ugLnNKa0xvIV5gFB2xPRSPJTi1jyiSHybvWQb0GbN9U+do2G6okwbWZ17fku uvJnhrInVKGcctRoaMhv2bg2mDtGXHAj8XKLJjwAyj4N6jJwkhB3Xj7Eit+/7btumE6t nGTlGEaNi2Y1j4NQ6TXJna6iw9DNo+iK2vJhqRQ4rvhBUNk7fEdoMSNnVlAzLWtg5ViW +lVw== X-Gm-Message-State: AA+aEWYyiWxODZP5PbGCNgE8KeLFSs6R5aRBsQWMfpJhuQOLyVn6Uvy4 h4AoEBM+5MOJiU67zYtutbs= X-Google-Smtp-Source: AFSGD/W0zwq0Qh1rO4lqFd/9JHkO8YGJaRm6Jm77JFfPyNgSv4afSqre0vlg4UaQvTC7XqoVAy7YJg== X-Received: by 2002:a5d:4512:: with SMTP id s18mr5411511wrq.182.1544289188552; Sat, 08 Dec 2018 09:13:08 -0800 (PST) Received: from blackbox.darklights.net (p200300DCD73FBA00428D5CFFFEB99DB8.dip0.t-ipconnect.de. [2003:dc:d73f:ba00:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id r12sm4995851wrq.3.2018.12.08.09.13.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Dec 2018 09:13:07 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, jbrunet@baylibre.com, narmstrong@baylibre.com, khilman@baylibre.com, robh+dt@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, sboyd@kernel.org, mturquette@baylibre.com, Martin Blumenstingl Subject: [PATCH 0/5] Meson (32-bit): add support for the Mali GPU Date: Sat, 8 Dec 2018 18:12:42 +0100 Message-Id: <20181208171247.22238-1-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 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 This series adds support for the Mali-450 GPU on Meson8 and Meson8b. Meson6 uses a Mali-400 GPU but since we don't have a clock driver (and I don't have a device for testing) Meson6 is left out in this series. Meson8 uses a Mali-450 MP6 with six pixel processors. Meson8b (as cost-reduced SoC) uses a Mali-450 MP2 with two pixel processors. I tested both using the open source lima driver and a patched mesa from the lima project as well. Since we don't have display support on the 32-bit SoCs I used off-screen rendering as described in [0]. The result is (for example): [1] The bootloader (at least on my boards) leaves the Mali clock disabled by default. The board crashes when trying to access the Mali registers with the "core" clock disabled. Thus this series also implements the required clock driver changes. The Mali clock tree on Meson8b and Meson8m2 is almost identical to the one on GXBB (see the description of patch #3 for more details). Only Meson8 is slightly different as it doesn't have a glitch-free mux. Patch #2 prepares the meson8b clock driver so we can have different clocks per SoC. Dependencies: - the .dts changes depend on my other series "ARM: dts: meson: add the APB/APB2 busses" from [2] - the .dts changes from this series have no compile-time dependency on the clock driver changes because CLKID_MALI was defined in the dt-bindings since the first version of the clock driver (but it was not used until now). - the .dts changes from this series have a runtime dependency on the clock driver changes (also from this series) if you have a kernel patched with the lima driver (without the lima driver there's no runtime dependency) Other notes: By default the GPU runs off the XTAL clock (24MHz). The lima driver currently does not update the GPU clock rate. Different frequencies have to be requested by adding the following properties to the Mali GPU node (to run it at 510MHz for example): assigned-clocks = <&clkc CLKID_MALI>; assigned-clock-rates = <510000000>; [0] https://gitlab.freedesktop.org/lima/web/wikis/home [1] https://abload.de/img/dump0myic0.png [2] https://patchwork.kernel.org/cover/10719445/ Martin Blumenstingl (5): dt-bindings: gpu: mali-utgard: add Amlogic Meson8 and Meson8b compatible clk: meson: meson8b: use a separate clock table for Meson8 clk: meson: meson8b: add the GPU clock tree ARM: dts: meson8: add the Mali-450 MP6 GPU ARM: dts: meson8b: add the Mali-450 MP2 GPU .../bindings/gpu/arm,mali-utgard.txt | 6 + arch/arm/boot/dts/meson8.dtsi | 58 +++ arch/arm/boot/dts/meson8b.dtsi | 46 +++ drivers/clk/meson/meson8b.c | 349 +++++++++++++++++- drivers/clk/meson/meson8b.h | 9 +- 5 files changed, 461 insertions(+), 7 deletions(-)