From patchwork Sun Oct 22 16:19:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 13431997 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 65D8DC001DF for ; Sun, 22 Oct 2023 16:19:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :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=acWCVaAoY9TWyY83wvihoyNO2dSte7sUCDM9xm2b5bU=; b=vou4S5i0GWAHZn OB04Fa5W0A++vBbT4Dkfsv04n8TSoXLKlDr1OsicUnXJ5QzDvxVU9v6HiCRrahCPTnkOE+bYK2d0V 4WSPo1O5VZZdYTXFhMhLulhKo8TIFQ22VZQoFRkLLCel5du8iR+sA178KfoAT1XG+H7QiazRVtHZy jYHyrzvPtKxcsPgsO0uHdhiD9goCYMikti06zoRbYVWurdZZKl2szQ+MwUj2AND1W5darBW6MKeEl uqALemWxrKtLLz4iR7pjobz+UaQ2lCt9UGds0lEonAXO4cg1hNSf5JNXI2GtHyDin/BifG7rz96cx yJiN/boLHGLxDjI8pM3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qubAi-005g6c-1N; Sun, 22 Oct 2023 16:19:24 +0000 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qubAf-005g68-0M for linux-arm-kernel@lists.infradead.org; Sun, 22 Oct 2023 16:19:22 +0000 Received: by mail-qt1-x82b.google.com with SMTP id d75a77b69052e-41cbf8e1f77so14789161cf.0 for ; Sun, 22 Oct 2023 09:19:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697991559; x=1698596359; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=51yoIPIuPIQY2xrhDSozZ8zZaCC3jRFcHjFfojAFMEs=; b=e41Gvpcwrh2MTf/NhgBvaYgJOp0bvRqfDNo+joLH8CveovmjRfY0zslJjcZa9Z+fjB V2/2hwlV1Z/TZWSIQkwr7OI2ElxqKighKFlVBUHVtlZuKp3uqkG/+XPQnKP3rQ4b/ffy 7SW2VG22dwizaFaIkSRlnOIO523y0qf6bPy8g+6Tr+KUNzY577s/gFvgSeQFFTGS+VDQ ppYfqEORFPIeZZ8hdV2feJC6qUZJ44302Wryan+ortpuNyaYbY62hM3d1mgFb/SdvvMY JYYpu9G//S4ypSx2kHwNbYsPMjl4FkafhEB1AE9bf+aHP201KmNuc0iL06793ErDOWnw d5OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697991559; x=1698596359; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=51yoIPIuPIQY2xrhDSozZ8zZaCC3jRFcHjFfojAFMEs=; b=s58VQNajvjNAhxW29KCIQt+jnKqS2KnMVO/u+MM+uH+19+re0NbQkYyN5hi77ReSF1 R3FolDekl2oWIn4X+OjBEvfaf41Vs0h9NuVmd6OUWm8wYaCGVOaf6ZSrpi8TV8m+7bhw 2p4cFHXIANRTBW5Aq4fwOfzd140wMbeKI0zPvPXjCgnK6JUQUlRVq9EewjUXLwf6atiA Uuae386e9WPMfSFBcgNSqsosI44lYCzqP4ZsSieCLBSKa6TnAye0gAWOerzqiwRQyvGI I8IYEin5zDPzpk6WDNEBgNwfsMCe9mZb+bW5d4FO3i/QYq3PQSTrs/dqHAgokH0ndvjM aESA== X-Gm-Message-State: AOJu0YyfFTgq6WJVoocrOzAm14LrSlVgRAUdGXowAlEmyfRtnJXq1vLp oxiFONB7Kxac2jcUhiojctLJXOdKUKQ= X-Google-Smtp-Source: AGHT+IF1J+2YfIOkfenkxN0ecNMu8q8DtSMdTCz1taKAmJyUrM2SEiQ6YiScGAphry5OBXtbcwoGVw== X-Received: by 2002:ac8:5d44:0:b0:41c:d1e7:27b5 with SMTP id g4-20020ac85d44000000b0041cd1e727b5mr9043611qtx.25.1697991559036; Sun, 22 Oct 2023 09:19:19 -0700 (PDT) Received: from aford-System-Version.lan ([2601:447:d002:5be:a07c:e734:336b:c675]) by smtp.gmail.com with ESMTPSA id r2-20020ac85202000000b004197079f2f8sm2111177qtn.64.2023.10.22.09.19.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 09:19:18 -0700 (PDT) From: Adam Ford To: linux-arm-kernel@lists.infradead.org Cc: alexander.stein@ew.tq-group.com, aford@beaconembedded.com, Adam Ford , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2] arm64: dts: imx8mp: Add NPU Node Date: Sun, 22 Oct 2023 11:19:10 -0500 Message-Id: <20231022161911.10792-1-aford173@gmail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231022_091921_177043_EDAB0572 X-CRM114-Status: GOOD ( 11.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The NPU is based on the Vivante GC8000 and its power-domain is controlled my pgc_mlmix. Since the power-domain uses some of these clocks, setup the clock parent and rates inside the power-domain, and add the NPU node. The data sheet states the CLK_ML_AHB should be 300MHz for nominal, but 800MHz clock will divide down to 266 instead. Boards which operate in over-drive mode should update the clocks on their boards accordingly. When the driver loads, the NPU numerates as: etnaviv-gpu 38500000.npu: model: GC8000, revision: 8002 Signed-off-by: Adam Ford Reviewed-by: Alexander Stein --- V2: Move the clock parent and rate assignments to the ppc_mlmix node since clock parents should be configured before they are used, and pgc_mlmix uses them first. Slow the clock rates down to confirm to nominal mode instead of overdrive mode. diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi index c9a610ba4836..a18b9ba98ea2 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi @@ -887,6 +887,15 @@ pgc_mlmix: power-domain@24 { clocks = <&clk IMX8MP_CLK_ML_AXI>, <&clk IMX8MP_CLK_ML_AHB>, <&clk IMX8MP_CLK_NPU_ROOT>; + assigned-clocks = <&clk IMX8MP_CLK_ML_CORE>, + <&clk IMX8MP_CLK_ML_AXI>, + <&clk IMX8MP_CLK_ML_AHB>; + assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_800M>, + <&clk IMX8MP_SYS_PLL1_800M>, + <&clk IMX8MP_SYS_PLL1_800M>; + assigned-clock-rates = <800000000>, + <800000000>, + <300000000>; }; }; }; @@ -2012,6 +2021,18 @@ vpumix_blk_ctrl: blk-ctrl@38330000 { interconnect-names = "g1", "g2", "vc8000e"; }; + npu: npu@38500000 { + compatible = "vivante,gc"; + reg = <0x38500000 0x200000>; + interrupts = ; + clocks = <&clk IMX8MP_CLK_NPU_ROOT>, + <&clk IMX8MP_CLK_NPU_ROOT>, + <&clk IMX8MP_CLK_ML_AXI>, + <&clk IMX8MP_CLK_ML_AHB>; + clock-names = "core", "shader", "bus", "reg"; + power-domains = <&pgc_mlmix>; + }; + gic: interrupt-controller@38800000 { compatible = "arm,gic-v3"; reg = <0x38800000 0x10000>,