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: 10720813 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 370CF112E for ; Mon, 10 Dec 2018 08:09:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B3F129BDC for ; Mon, 10 Dec 2018 08:09:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1F95329BE1; Mon, 10 Dec 2018 08:09:29 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 602F829BDC for ; Mon, 10 Dec 2018 08:09:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 24BE46E343; Mon, 10 Dec 2018 08:09:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 16CC76E073 for ; Sat, 8 Dec 2018 17:13:10 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id u3so6598684wrs.3 for ; Sat, 08 Dec 2018 09:13:10 -0800 (PST) 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=CUf79bahvzPhLBdBhgd6HzBXO4XfeBad/51BBrMk/35Vyq+cYfhF9FoMO8yJLSSzoX j3rRnh8OhMQgWKr5JPNAZZqKFkut7zr2u6FZ5a8Oj6/xpn9YCvlpI2GYJaQtjnaj7dKb N8S85+fFcay8YbFncNhZTrY/qUBj+LP3bwBlM01w2B2IMf35M/h0S02GIf/5KD7q2Bs9 JEGfhTQ3DsJTzqs4ZygLc2tyMCdE6pyQlhpi3Oe54YUWPy2O9puinIS8CCYPa+3y4p1r FbBZZAYDX2sO850VyOJ1Ivimf3KECG3BG/yirPVv1l3rDByzfeKfnq4tr3x2ndN1BPou QP9A== X-Gm-Message-State: AA+aEWZl8IOnkuhZAlEuMLQ4Z+pzi+42POCQrKoKy6B9gQDn27UDJO+1 5uoF7LRn1hcKvhlfDc+CMzo= 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 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 X-Mailman-Approved-At: Mon, 10 Dec 2018 08:07:52 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, sboyd@kernel.org, mturquette@baylibre.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Martin Blumenstingl , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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(-)