From patchwork Tue Apr 14 20:14:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 11489167 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 312001392 for ; Tue, 14 Apr 2020 20:15:47 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0D8342074D for ; Tue, 14 Apr 2020 20:15:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nAM7cjPt"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b="Gfgg12dE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D8342074D Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=qh+R3zHQ6TpGb9ruNwHXCRxX0QKfF/sKhUUtKqGunys=; b=nAM7cjPt8wjIvA ZlesL44aExJfgi26+X1epDbpUvCVfknTLL8FJ+4RckXuUkG7arv4SHvsy5rnQkTkwtnKQvPMJPqTc 2FCE3oCT5mxeeC2EPKsABacwvVWxVnxqtqt7fbymc9BeyO3X6KEc13B2UWFMAtYk7qU//5hflOFk4 aTMkglsaG38ScMxRUjosGLIZhdIWjyOhO25t9eJDwQs0TdC3WdaFYzcwnaqjQBjo7r5YmKwR8TlMb uD15pZE98r1lQjLSYUZQGPomHns8Y0lrOiR9XEIk8Fj8sx7ce5H+VZNXkwWI840Gj3UtdfDE4TmxD nYOnW1Fj28p7D2tmKJCQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jORyD-0000G8-OP; Tue, 14 Apr 2020 20:15:45 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jORxx-0008Oy-OJ; Tue, 14 Apr 2020 20:15:31 +0000 Received: by mail-wr1-x441.google.com with SMTP id k1so8824147wrx.4; Tue, 14 Apr 2020 13:15:29 -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 :mime-version:content-transfer-encoding; bh=MWakixpL4b6GKDOYVEkla9E7WK5+obuCNXmlgeBSkZw=; b=Gfgg12dESrr5raPF106kCihFug8RkS02LF3WFC8y8yUyub5qNgsy8jhBRFB8yGJUwq H6JnGAEZiP1FWARU8Yf2MIW1aD+/CyaT9asq7lCkIUTVvRKiR/FRta07Lq509tqOBJ2V kuxg+1+fAdkOzISdJpR7QCQMSUm380rpVTD5PY6wOMrHvbtL5Za/WThOxvK2BFqI8kYJ 9W4FkKygQ5JNZpSKv/2/TswOwuD4ZFj+ZHjTZhRe0oSo4/n107ticI1KQxcHT1zQtLPW I8NG/25tYn9NFno9Jc1dx7XSmLXNFimJTuWSnucyvK8QvoqB262tk5110TQvzx0BuiBN wIdg== 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:mime-version:content-transfer-encoding; bh=MWakixpL4b6GKDOYVEkla9E7WK5+obuCNXmlgeBSkZw=; b=HG4cx8ZoZxJNpXz1ztXVKJE8ARPmffLkScfkTtKj04t1I9+wrMk46vAzZDb3pQbyiP XBh2AMXafrAo39kiVKBlM2FctKUGLQ7lVMqIOpu1i1brUC26pHHWWm9d/rZkPC3JkpCI K2JUieEDiuzhhvS0lVOMG8ah7dtw32IrTjklLuJAD+CfxRbaeFLOMjdIdoO4+DOnWTYv 7GG92rxRlPFoyDmmiRxB4U5qMaMH5VgC0zLPzZPW7G4GPtO/3A8laWFn2+AW45iIPfAe 47EP3aGNDeaIaD7lRMihhi8qOF9EklF+JRg+6Gu39R6z0tUAj+ocUYrvql8JM/Y7q+yR H0ww== X-Gm-Message-State: AGi0PubhoieiSMplIUOvSRzmfjMYaUVp5iFHxOjCL8/lI74ou5Y9xMp4 qxEwIsdkxLvj67XPetAdbjGWZ/0qSVw= X-Google-Smtp-Source: APiQypKSNPmVFZhEc+zOeADaCFUJ2x4K2vogb8D2QNrNe5wZlqzEYa0jFI6Ht1vr/SkxxxIP2qteow== X-Received: by 2002:a5d:44c6:: with SMTP id z6mr18972068wrr.192.1586895328436; Tue, 14 Apr 2020 13:15:28 -0700 (PDT) Received: from localhost.localdomain (p200300F13717DF00428D5CFFFEB99DB8.dip0.t-ipconnect.de. [2003:f1:3717:df00:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id u17sm22537467wra.63.2020.04.14.13.15.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 13:15:27 -0700 (PDT) From: Martin Blumenstingl To: robh+dt@kernel.org, khilman@baylibre.com, narmstrong@baylibre.com, linux-amlogic@lists.infradead.org Subject: [PATCH RFC v1 1/4] dt-bindings: power: meson-ee-pwrc: add support for Meson8/8b/8m2 Date: Tue, 14 Apr 2020 22:14:54 +0200 Message-Id: <20200414201457.229131-2-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200414201457.229131-1-martin.blumenstingl@googlemail.com> References: <20200414201457.229131-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200414_131529_791493_0ED8AD43 X-CRM114-Status: GOOD ( 12.56 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:441 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [martin.blumenstingl[at]googlemail.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Blumenstingl , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org The power domains on the 32-bit Meson8/Meson8b/Meson8m2 SoCs are very similar to what G12A still uses. The (known) differences are: - Meson8 doesn't use any reset lines at all - Meson8b and Meson8m2 use the same reset lines, which are different from what the 64-bit SoCs use - there is no "vapb" clock on the older SoCs - amlogic,ao-sysctrl cannot point to the whole AO sysctrl region but only the power management related registers Add a new compatible string and adjust clock and reset line expectations for each SoC. Signed-off-by: Martin Blumenstingl --- .../bindings/power/amlogic,meson-ee-pwrc.yaml | 75 ++++++++++++++----- include/dt-bindings/power/meson8-power.h | 13 ++++ 2 files changed, 71 insertions(+), 17 deletions(-) create mode 100644 include/dt-bindings/power/meson8-power.h diff --git a/Documentation/devicetree/bindings/power/amlogic,meson-ee-pwrc.yaml b/Documentation/devicetree/bindings/power/amlogic,meson-ee-pwrc.yaml index 6c6079fe1351..a0e4cf143b9c 100644 --- a/Documentation/devicetree/bindings/power/amlogic,meson-ee-pwrc.yaml +++ b/Documentation/devicetree/bindings/power/amlogic,meson-ee-pwrc.yaml @@ -23,13 +23,19 @@ description: |+ properties: compatible: enum: + - amlogic,meson8-pwrc + - amlogic,meson8b-pwrc + - amlogic,meson8m2-pwrc - amlogic,meson-g12a-pwrc - amlogic,meson-sm1-pwrc clocks: - minItems: 2 + minItems: 1 + maxItems: 2 clock-names: + minItems: 1 + maxItems: 2 items: - const: vpu - const: vapb @@ -37,20 +43,6 @@ properties: resets: minItems: 11 - reset-names: - items: - - const: viu - - const: venc - - const: vcbus - - const: bt656 - - const: rdma - - const: venci - - const: vencp - - const: vdac - - const: vdi6 - - const: vencl - - const: vid_lock - "#power-domain-cells": const: 1 @@ -59,12 +51,61 @@ properties: allOf: - $ref: /schemas/types.yaml#/definitions/phandle +allOf: + - if: + properties: + compatible: + enum: + - amlogic,meson8b-pwrc + - amlogic,meson8m2-pwrc + then: + properties: + reset-names: + items: + - const: dblk + - const: pic_dc + - const: hdmi_apb + - const: hdmi_system + - const: venci + - const: vencp + - const: vdac + - const: vencl + - const: viu + - const: venc + - const: rdma + required: + - resets + - reset-names + + - if: + properties: + compatible: + enum: + - amlogic,meson-g12a-pwrc + - amlogic,meson-sm1-pwrc + then: + properties: + reset-names: + items: + - const: viu + - const: venc + - const: vcbus + - const: bt656 + - const: rdma + - const: venci + - const: vencp + - const: vdac + - const: vdi6 + - const: vencl + - const: vid_lock + required: + - resets + - reset-names + required: - compatible - clocks - clock-names - - resets - - reset-names - "#power-domain-cells" - amlogic,ao-sysctrl diff --git a/include/dt-bindings/power/meson8-power.h b/include/dt-bindings/power/meson8-power.h new file mode 100644 index 000000000000..dd8b2ddb82a7 --- /dev/null +++ b/include/dt-bindings/power/meson8-power.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: (GPL-2.0+ or MIT) */ +/* + * Copyright (c) 2019 Martin Blumenstingl + */ + +#ifndef _DT_BINDINGS_MESON8_POWER_H +#define _DT_BINDINGS_MESON8_POWER_H + +#define PWRC_MESON8_VPU_ID 0 +#define PWRC_MESON8_ETHERNET_MEM_ID 1 +#define PWRC_MESON8_AUDIO_DSP_MEM_ID 2 + +#endif /* _DT_BINDINGS_MESON8_POWER_H */ From patchwork Tue Apr 14 20:14:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 11489171 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C1B115AB for ; Tue, 14 Apr 2020 20:16:04 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 493D92074D for ; Tue, 14 Apr 2020 20:16:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Fr3NTXyH"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b="S+K/4POx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 493D92074D Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=RTlK0BVvMG98V97Pg0eswYN+pxsuFlUqLoT09xpte0g=; b=Fr3NTXyHpBs43f b2TgMkACk49IKzXecHXc/msIQ+W21Mrn/SYyykLWrV2zUaCSY2CSTiWVe2+8DBp4EhEVXfFUumHcj mpdmbOPG5VQu2Md6lQj0b4WWvslpORea/B4VEM+R9qJvWlKnYCjhVroRufqHrKsBgJo3RSycxitOi D2rSc0zoYf1fHn9BQhK9QGnNXBzfxfbSD+pfrCmTbXmXrh/IRGrarIJA13UBl7agz9oeQtL05W20x 4XQXOElvzIP3Pt/S5b6MwYj9VJfQeFLsV1LToxuy8fif0ySbjwzJxmBdEFEpTSXcpfClIYTJQGLop 9MDt+djPu63iH+LwsVzQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jORyV-0000my-Rm; Tue, 14 Apr 2020 20:16:03 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jORxz-0008PX-4A; Tue, 14 Apr 2020 20:15:32 +0000 Received: by mail-wr1-x442.google.com with SMTP id d17so9126260wrg.11; Tue, 14 Apr 2020 13:15:30 -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 :mime-version:content-transfer-encoding; bh=hgI4BrhRzwo1MiGrMwLDXDTrl4Dmoe1307hvr9odN8Q=; b=S+K/4POxBnzMHicOhDPjATbCVv9zh8IupE/lRJLSrzjANxjo0OVF1P2t3JtDPB0UUc jLnB9CO20GCHpKD4YvU9bvKWpBT1AbakItdUXf/o1GGIDRO9KU+0mzw+4K7rHlG9qNbo hHtrzr3gJBFEvXCZG/YCiMr+MakvAH1kwSejcMrHobw6rdYr5gnPgcSz8aDg/pQzYTYM 2YZDdu7hoUXk7aOC9v6EHihwnViZDcGfvms9R3MFV5Vx1x54Bksb3Vq0ftQqkp7y+iPN OoceKkiHZDNa+eX7p7L8ExfHyhX5stXHCxbn3d/BCw2AcaP8Zflxj1z6bMbPiz1MBcm9 pV0Q== 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:mime-version:content-transfer-encoding; bh=hgI4BrhRzwo1MiGrMwLDXDTrl4Dmoe1307hvr9odN8Q=; b=IEicw1fYcpGgKao4Ywz75oE53cmoq/rM41Y3Mqf8r8d+g0yRoZnksfMAF1pCp3MOGp EQcVcvnis6mnR2H5KQZohagfgobU8K9YgazHPxcZ8OeUg9khLJkKRs5i/j4Eq4hoklgj l8/qf5wYU8UfAeEmy/hmZs07l2KREtlqDduMjGL3H7jNyqR643JBt9vzXQAKGZflD0lO juo0YEch1yaY2A3KiUsHWPyulIG/rMJ95ONTOtyESoZZK+Ums6NKIpkbxV4fdAxAwPtU 3Dg4Lm+LbicsbgK1WWNEe2evFOzYy3DvWeBJaMysDnoL+wSBKsDeVzXTao8++/rSHTkW cNiQ== X-Gm-Message-State: AGi0PuZ++Rn3ipLk7tH/dharzmU6j5eg1lGSGCykERLS+q98z2DmAc79 6myigmh+tjYM3N+stiJauhw= X-Google-Smtp-Source: APiQypJSn3teWPYCLKE3B3vLZOyI+srye9W6W5AID45Tz+dhtJPjxcLZfhHDVMJ26884KuX8bPuvjQ== X-Received: by 2002:adf:fecd:: with SMTP id q13mr17184706wrs.12.1586895329459; Tue, 14 Apr 2020 13:15:29 -0700 (PDT) Received: from localhost.localdomain (p200300F13717DF00428D5CFFFEB99DB8.dip0.t-ipconnect.de. [2003:f1:3717:df00:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id u17sm22537467wra.63.2020.04.14.13.15.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 13:15:29 -0700 (PDT) From: Martin Blumenstingl To: robh+dt@kernel.org, khilman@baylibre.com, narmstrong@baylibre.com, linux-amlogic@lists.infradead.org Subject: [PATCH RFC v1 2/4] dt-bindings: power: meson-ee-pwrc: add support for the Meson GX SoCs Date: Tue, 14 Apr 2020 22:14:55 +0200 Message-Id: <20200414201457.229131-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200414201457.229131-1-martin.blumenstingl@googlemail.com> References: <20200414201457.229131-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200414_131531_162095_CCF0A4C5 X-CRM114-Status: GOOD ( 12.47 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [martin.blumenstingl[at]googlemail.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:442 listed in] [list.dnswl.org] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Blumenstingl , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org The power domains on the GX SoCs are very similar to G12A. The only known differences so far are: - The GX SoCs do not have the HHI_VPU_MEM_PD_REG2 register (for the VPU power-domain) - The GX SoCs have an additional reset line called "dvin" Add a new compatible string and adjust the reset line expectations for these SoCs. Signed-off-by: Martin Blumenstingl --- .../bindings/power/amlogic,meson-ee-pwrc.yaml | 27 +++++++++++++++++++ include/dt-bindings/power/meson-gxbb-power.h | 13 +++++++++ 2 files changed, 40 insertions(+) create mode 100644 include/dt-bindings/power/meson-gxbb-power.h diff --git a/Documentation/devicetree/bindings/power/amlogic,meson-ee-pwrc.yaml b/Documentation/devicetree/bindings/power/amlogic,meson-ee-pwrc.yaml index a0e4cf143b9c..15a29ed19327 100644 --- a/Documentation/devicetree/bindings/power/amlogic,meson-ee-pwrc.yaml +++ b/Documentation/devicetree/bindings/power/amlogic,meson-ee-pwrc.yaml @@ -26,6 +26,7 @@ properties: - amlogic,meson8-pwrc - amlogic,meson8b-pwrc - amlogic,meson8m2-pwrc + - amlogic,meson-gxbb-pwrc - amlogic,meson-g12a-pwrc - amlogic,meson-sm1-pwrc @@ -42,6 +43,7 @@ properties: resets: minItems: 11 + maxItems: 12 "#power-domain-cells": const: 1 @@ -77,6 +79,31 @@ allOf: - resets - reset-names + - if: + properties: + compatible: + enum: + - amlogic,meson-gxbb-pwrc + then: + properties: + reset-names: + items: + - const: viu + - const: venc + - const: vcbus + - const: bt656 + - const: dvin + - const: rdma + - const: venci + - const: vencp + - const: vdac + - const: vdi6 + - const: vencl + - const: vid_lock + required: + - resets + - reset-names + - if: properties: compatible: diff --git a/include/dt-bindings/power/meson-gxbb-power.h b/include/dt-bindings/power/meson-gxbb-power.h new file mode 100644 index 000000000000..57ab38dcb6bb --- /dev/null +++ b/include/dt-bindings/power/meson-gxbb-power.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: (GPL-2.0+ or MIT) */ +/* + * Copyright (c) 2019 BayLibre, SAS + * Author: Neil Armstrong + */ + +#ifndef _DT_BINDINGS_MESON_GXBB_POWER_H +#define _DT_BINDINGS_MESON_GXBB_POWER_H + +#define PWRC_GXBB_VPU_ID 0 +#define PWRC_GXBB_ETH_ID 1 + +#endif From patchwork Tue Apr 14 20:14:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 11489177 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C9A3915AB for ; Tue, 14 Apr 2020 20:16:25 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A32DB206E9 for ; Tue, 14 Apr 2020 20:16:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JYMJ++oL"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b="rCQmxswG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A32DB206E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=F7ozhGSH6Dv60CzU+DCtTiCHzLlLBmO0puShO+TrmBI=; b=JYMJ++oLaHkL+3 0pkvCvE41hvhEepJiQVEmmmk/BWFNFNBj/R06aMVvaMlUb4G/oeFXMA8p99HoAY+rABR6ickZ4/ft k9PQNJTEREJTTBQ8SBBd9NdBoPQJMDeRzinpbkxfox1czBuNcsJ6XdCRgv9dyfMJ/I3TcyOnM1LlI +LyUyYCr0pjcAbk3izZ+oQPZjd9OQWDSVoPfYULGxNxotlBLWQ4s7JkPV+zqjl5aZfufWoGPaVR9u vRlU91e16k80tLWdPKKD3VLWIcBAGxfZfG40d8ZGTZKM/k0vYK7TBUDt7jP6IM96OFApul5Fholk/ 9HNAZyzw6/y6sLOhQhnQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jORyq-0001KT-TW; Tue, 14 Apr 2020 20:16:24 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jORxz-0008Pu-UN; Tue, 14 Apr 2020 20:15:33 +0000 Received: by mail-wm1-x342.google.com with SMTP id r26so15833630wmh.0; Tue, 14 Apr 2020 13:15:31 -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 :mime-version:content-transfer-encoding; bh=p4l4dlajAQ5hYjHdHbwaVhCtPIXq0hp8eJOoIEyPOB8=; b=rCQmxswG1BGOEARKUCexdg+aGeADAIKgZIwZjwJkLZrGhmCovgrO+m71XsKtHMwhcW jGTKcfBk9GxSTf79LGD7XxCdD5zurhHtPqMMh/UsTeeVYX6rQhPqDtQUYsOTVD//mTkX lGIShvLgthU6cz53Kri6oAh8W9SlVpcgLklPEsH3AYFn/Btx+9dTE15PxwlrvewOrz+q loCkkfriYZGolidfxl9eeapc2PeCYoH+abWdGDRnOEp2GCeRGV4yn2hMs9HIto0rdEs+ 4sQZCjCtWNIzeW9R1/A/yFXsIUCfw1kLW9k1S2ibSQfEj1ClNMg8q4Tkf78ePOEmiMzu ZGoQ== 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:mime-version:content-transfer-encoding; bh=p4l4dlajAQ5hYjHdHbwaVhCtPIXq0hp8eJOoIEyPOB8=; b=jqCm86lV8gN80wGQGezvBUkPaqyeDv9Vg/4Ij/O1BMhwCN/Zqf8f2SeResVBtnrHvm hYm+ZTxYYkksHptMfpYC3P1yL69Z2XdxyfLTwJ64/nW8e+b9it8KKFgGtHcpen9oDtJG K7HdnEs64NW44e+U+0nQJCxXUTI+UjKMZUaN9cg14bPMotrqsECK0Ezvz8ADyeFvEwXa yRttW2T0T1T6ja3azu1MiPV92mPZCwpxItrKVGMNvCMVpfcbi/FcqHUHZZ0+gsVSs+pq Tv3YBvUL2Z/PHRyr/QLegkO16ahOk4l/eB0gdKk+X/VYgU1qLBTEm0HJ2IXmLQdBK/8N hP7A== X-Gm-Message-State: AGi0Pub/TEeb29DZxJsc+wM/4dRkLLX7BfJpO4WWIv9ezFn3Id0drBT1 GDfKqlJv6XdECwL6evM3kAS6Wm4puwE= X-Google-Smtp-Source: APiQypJn7651jK1wPIoK97bfaAlMxVEJAxTqdFKuTBux1LLYd0Wh6Oa1R9Ue81ARL/IBgupmXdzqDQ== X-Received: by 2002:a1c:4b15:: with SMTP id y21mr1531218wma.150.1586895330456; Tue, 14 Apr 2020 13:15:30 -0700 (PDT) Received: from localhost.localdomain (p200300F13717DF00428D5CFFFEB99DB8.dip0.t-ipconnect.de. [2003:f1:3717:df00:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id u17sm22537467wra.63.2020.04.14.13.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 13:15:30 -0700 (PDT) From: Martin Blumenstingl To: robh+dt@kernel.org, khilman@baylibre.com, narmstrong@baylibre.com, linux-amlogic@lists.infradead.org Subject: [PATCH RFC v1 3/4] soc: amlogic: meson-ee-pwrc: add support for Meson8/Meson8b/Meson8m2 Date: Tue, 14 Apr 2020 22:14:56 +0200 Message-Id: <20200414201457.229131-4-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200414201457.229131-1-martin.blumenstingl@googlemail.com> References: <20200414201457.229131-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200414_131531_986653_E3065911 X-CRM114-Status: GOOD ( 15.00 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:342 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [martin.blumenstingl[at]googlemail.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Blumenstingl , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org This adds support for the power domains on Meson8/Meson8b/Meson8m2. Meson8 doesn't use any reset lines while Meson8b and Meson8m2 use the same set of reset lines (which is different from the newer SoCs). Add dedicated compatible strings for Meson8, Meson8b and Meson8m2 to support these differences. Notable differences between Meson8 and G12A are: - there is no HHI_VPU_MEM_PD_REG2 on the 32-bit SoCs - the Meson8b datasheet describes an "audio DSP memory" power domain which is used for the hardware audio decoder - the "amlogic,ao-sysctrl" only includes the power management related registers on the 32-bit SoCs, meaning the for example the AO_RTI_GEN_PWR_SLEEP0 register is at offset (0x2 << 2) rather than (0x3a << 2). As result of this (0x38 << 2) is subtracted from the register offsets, which is the start of the power management related registers. Signed-off-by: Martin Blumenstingl --- drivers/soc/amlogic/meson-ee-pwrc.c | 72 +++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 3 deletions(-) diff --git a/drivers/soc/amlogic/meson-ee-pwrc.c b/drivers/soc/amlogic/meson-ee-pwrc.c index 3f0261d53ad9..b30868da456a 100644 --- a/drivers/soc/amlogic/meson-ee-pwrc.c +++ b/drivers/soc/amlogic/meson-ee-pwrc.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -22,6 +23,12 @@ #define AO_RTI_GEN_PWR_SLEEP0 (0x3a << 2) #define AO_RTI_GEN_PWR_ISO0 (0x3b << 2) +/* + * Meson8/Meson8b/Meson8m2 only expose the power management registers of + * the AO-bus as syscon. Above register offsets need to subtract this offset. + */ +#define AO_RTI_GEN_MESON8_PMU_OFFSET (0x38 << 2) + /* HHI Offsets */ #define HHI_MEM_PD_REG0 (0x40 << 2) @@ -73,6 +80,13 @@ static struct meson_ee_pwrc_top_domain g12a_pwrc_vpu = { .iso_mask = BIT(9), }; +static struct meson_ee_pwrc_top_domain meson8_pwrc_vpu = { + .sleep_reg = AO_RTI_GEN_PWR_SLEEP0 - AO_RTI_GEN_MESON8_PMU_OFFSET, + .sleep_mask = BIT(8), + .iso_reg = AO_RTI_GEN_PWR_SLEEP0 - AO_RTI_GEN_MESON8_PMU_OFFSET, + .iso_mask = BIT(9), +}; + #define SM1_EE_PD(__bit) \ { \ .sleep_reg = AO_RTI_GEN_PWR_SLEEP0, \ @@ -124,10 +138,20 @@ static struct meson_ee_pwrc_mem_domain g12a_pwrc_mem_vpu[] = { VPU_HHI_MEMPD(HHI_MEM_PD_REG0), }; -static struct meson_ee_pwrc_mem_domain g12a_pwrc_mem_eth[] = { +static struct meson_ee_pwrc_mem_domain meson8_pwrc_mem_eth[] = { { HHI_MEM_PD_REG0, GENMASK(3, 2) }, }; +static struct meson_ee_pwrc_mem_domain meson8_pwrc_audio_dsp_mem[] = { + { HHI_MEM_PD_REG0, GENMASK(1, 0) }, +}; + +static struct meson_ee_pwrc_mem_domain meson8_pwrc_mem_vpu[] = { + VPU_MEMPD(HHI_VPU_MEM_PD_REG0), + VPU_MEMPD(HHI_VPU_MEM_PD_REG1), + VPU_HHI_MEMPD(HHI_MEM_PD_REG0), +}; + static struct meson_ee_pwrc_mem_domain sm1_pwrc_mem_vpu[] = { VPU_MEMPD(HHI_VPU_MEM_PD_REG0), VPU_MEMPD(HHI_VPU_MEM_PD_REG1), @@ -201,7 +225,27 @@ static bool pwrc_ee_get_power(struct meson_ee_pwrc_domain *pwrc_domain); static struct meson_ee_pwrc_domain_desc g12a_pwrc_domains[] = { [PWRC_G12A_VPU_ID] = VPU_PD("VPU", &g12a_pwrc_vpu, g12a_pwrc_mem_vpu, pwrc_ee_get_power, 11, 2), - [PWRC_G12A_ETH_ID] = MEM_PD("ETH", g12a_pwrc_mem_eth), + [PWRC_G12A_ETH_ID] = MEM_PD("ETH", meson8_pwrc_mem_eth), +}; + +static struct meson_ee_pwrc_domain_desc meson8_pwrc_domains[] = { + [PWRC_MESON8_VPU_ID] = VPU_PD("VPU", &meson8_pwrc_vpu, + meson8_pwrc_mem_vpu, pwrc_ee_get_power, + 0, 1), + [PWRC_MESON8_ETHERNET_MEM_ID] = MEM_PD("ETHERNET_MEM", + meson8_pwrc_mem_eth), + [PWRC_MESON8_AUDIO_DSP_MEM_ID] = MEM_PD("AUDIO_DSP_MEM", + meson8_pwrc_audio_dsp_mem), +}; + +static struct meson_ee_pwrc_domain_desc meson8b_pwrc_domains[] = { + [PWRC_MESON8_VPU_ID] = VPU_PD("VPU", &meson8_pwrc_vpu, + meson8_pwrc_mem_vpu, pwrc_ee_get_power, + 11, 1), + [PWRC_MESON8_ETHERNET_MEM_ID] = MEM_PD("ETHERNET_MEM", + meson8_pwrc_mem_eth), + [PWRC_MESON8_AUDIO_DSP_MEM_ID] = MEM_PD("AUDIO_DSP_MEM", + meson8_pwrc_audio_dsp_mem), }; static struct meson_ee_pwrc_domain_desc sm1_pwrc_domains[] = { @@ -216,7 +260,7 @@ static struct meson_ee_pwrc_domain_desc sm1_pwrc_domains[] = { [PWRC_SM1_GE2D_ID] = TOP_PD("GE2D", &sm1_pwrc_ge2d, sm1_pwrc_mem_ge2d, pwrc_ee_get_power), [PWRC_SM1_AUDIO_ID] = MEM_PD("AUDIO", sm1_pwrc_mem_audio), - [PWRC_SM1_ETH_ID] = MEM_PD("ETH", g12a_pwrc_mem_eth), + [PWRC_SM1_ETH_ID] = MEM_PD("ETH", meson8_pwrc_mem_eth), }; struct meson_ee_pwrc_domain { @@ -470,12 +514,34 @@ static struct meson_ee_pwrc_domain_data meson_ee_g12a_pwrc_data = { .domains = g12a_pwrc_domains, }; +static struct meson_ee_pwrc_domain_data meson_ee_m8_pwrc_data = { + .count = ARRAY_SIZE(meson8_pwrc_domains), + .domains = meson8_pwrc_domains, +}; + +static struct meson_ee_pwrc_domain_data meson_ee_m8b_pwrc_data = { + .count = ARRAY_SIZE(meson8b_pwrc_domains), + .domains = meson8b_pwrc_domains, +}; + static struct meson_ee_pwrc_domain_data meson_ee_sm1_pwrc_data = { .count = ARRAY_SIZE(sm1_pwrc_domains), .domains = sm1_pwrc_domains, }; static const struct of_device_id meson_ee_pwrc_match_table[] = { + { + .compatible = "amlogic,meson8-pwrc", + .data = &meson_ee_m8_pwrc_data, + }, + { + .compatible = "amlogic,meson8b-pwrc", + .data = &meson_ee_m8b_pwrc_data, + }, + { + .compatible = "amlogic,meson8m2-pwrc", + .data = &meson_ee_m8b_pwrc_data, + }, { .compatible = "amlogic,meson-g12a-pwrc", .data = &meson_ee_g12a_pwrc_data, From patchwork Tue Apr 14 20:14:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 11489173 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 100681392 for ; Tue, 14 Apr 2020 20:16:07 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id BF79820771 for ; Tue, 14 Apr 2020 20:16:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Fo4mk6+6"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b="p7rlS3al" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF79820771 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=F6WQyVJC/f1PJf0Y3K7J7GkSoM/4c9Ndnr1Ld6I5zik=; b=Fo4mk6+6y6ZBt1 Zus21Wu2S9dev1LHnm522RwzEsPoUYTr3tXS8eSMm7UMRT+5lLdxbJEozIQ65G3/NWOVy74QC1iv6 d12oKM1o45sGjSZ17AAXfG8cU2gMl/fEHJs1Ike82iigEqGbr7x3h+Zofu+0VYBBR0+bBJFdVez1I vcZ1yhFfRDiST//A4NZATT6ogZx4ThnMITzEwQWhZgfU5zsLIt2gBKkI+WYmso3E1K79iJ2AIMhh+ XEE8VcrCAmqDOOUknatORF3tozu42R8lO+IhtyNQp5mqlpEUXo92R5pjGM1MNL3CHlNY9B+Rpf57P r7B1zzWNxc2QEtBrxWYw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jORyY-0000q3-AJ; Tue, 14 Apr 2020 20:16:06 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jORy0-0008QT-NX; Tue, 14 Apr 2020 20:15:34 +0000 Received: by mail-wr1-x442.google.com with SMTP id k1so8824348wrx.4; Tue, 14 Apr 2020 13:15:32 -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 :mime-version:content-transfer-encoding; bh=f8em9AvrfAEpxaMHqaLgGhBy4pxjXY2ZYYbHJqjrLMg=; b=p7rlS3alBsKhovayyBNnkQ0iz2zy0XG2rkJ8Jqk9nlveJ9HaG5AQMr6F8A7ikQRJIb elQxE+v8thegARaELzvq1uMiWFN+0ukpQixd/GB/8F5SozMEKMScpIypGPBQCyL749i6 nLuQ0dxqpf8ssW6No4SomInpszp5Y3nQOkm+6snZbYd1sUN4r7vo8jFqOSYFq68L7Tv5 BTP5XCM9woJjxuHxcV0NJBem3XLLthExt3XdzggJuZLy/LnyK5Tl7Vwh7ZQyXgqd9Shi mxeNUBAr4mpcrES+UoX/2C0xTZodFUn1LSJDXNEzOgUm8hHk62UtBcQdflxbe6gbdoO2 I7eQ== 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:mime-version:content-transfer-encoding; bh=f8em9AvrfAEpxaMHqaLgGhBy4pxjXY2ZYYbHJqjrLMg=; b=adZrPpo0dIkTCOlX9AMXaTz3Hr2TuOdrptgS++URWWdv1qwOs0xzqFxFxC3K3g5918 YOinm+vNubhOX5S9JFC/IWGsCi7MKTRfFkS90o9AeXxVRvzL0oHPDtsZjHQJ+2qvuSTc uv/nolk5WLzh2ClQb/YdJAg2Jg8wzkDNQanJvHZHglJmFfE3Gi4risn5iC50mwK4sTCU x3cTx0qwPPMCQ4q02eBTOP2CAt2wKQnen66v7XVVGMKJzfKkwRfGTxoCZbbhLVZTED8X 4BBSFr15+d4mmVVPf9tZH18oYEONg7wZ4D89vxoRriCniZ+mFjtfcK/75k900yOkCBqS fKSg== X-Gm-Message-State: AGi0PuaFGSEgEKrRN7L2M2FKVFPCjtTOhEzed8n8yehM9LR31uIpmdjG 0iemtITvMWE0VEpo9Nppxys= X-Google-Smtp-Source: APiQypLSLEwSPL5qqaWeTy+hFwnxC3rU6QWDzoXHJjL6U8WkB7JbZKQC72Kvwv6oiWG7P8TN4G5xyg== X-Received: by 2002:a5d:438c:: with SMTP id i12mr13368428wrq.14.1586895331421; Tue, 14 Apr 2020 13:15:31 -0700 (PDT) Received: from localhost.localdomain (p200300F13717DF00428D5CFFFEB99DB8.dip0.t-ipconnect.de. [2003:f1:3717:df00:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id u17sm22537467wra.63.2020.04.14.13.15.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 13:15:30 -0700 (PDT) From: Martin Blumenstingl To: robh+dt@kernel.org, khilman@baylibre.com, narmstrong@baylibre.com, linux-amlogic@lists.infradead.org Subject: [PATCH RFC v1 4/4] soc: amlogic: meson-ee-pwrc: add support for the Meson GX SoCs Date: Tue, 14 Apr 2020 22:14:57 +0200 Message-Id: <20200414201457.229131-5-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200414201457.229131-1-martin.blumenstingl@googlemail.com> References: <20200414201457.229131-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200414_131532_811055_1B10E4AC X-CRM114-Status: GOOD ( 13.72 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [martin.blumenstingl[at]googlemail.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Blumenstingl , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org Add support for the Meson GX SoCs to the meson-ee-pwrc driver. The power domains on the GX SoCs are very similar to G12A. The only known differences so far are: - The GX SoCs do not have the HHI_VPU_MEM_PD_REG2 register (for the VPU power-domain) - The GX SoCs have an additional reset line called "dvin" Signed-off-by: Martin Blumenstingl --- drivers/soc/amlogic/meson-ee-pwrc.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/soc/amlogic/meson-ee-pwrc.c b/drivers/soc/amlogic/meson-ee-pwrc.c index b30868da456a..c8fbdc8f5c1d 100644 --- a/drivers/soc/amlogic/meson-ee-pwrc.c +++ b/drivers/soc/amlogic/meson-ee-pwrc.c @@ -16,6 +16,7 @@ #include #include #include +#include #include /* AO Offsets */ @@ -73,7 +74,7 @@ struct meson_ee_pwrc_domain_data { /* TOP Power Domains */ -static struct meson_ee_pwrc_top_domain g12a_pwrc_vpu = { +static struct meson_ee_pwrc_top_domain gxbb_pwrc_vpu = { .sleep_reg = AO_RTI_GEN_PWR_SLEEP0, .sleep_mask = BIT(8), .iso_reg = AO_RTI_GEN_PWR_SLEEP0, @@ -138,6 +139,12 @@ static struct meson_ee_pwrc_mem_domain g12a_pwrc_mem_vpu[] = { VPU_HHI_MEMPD(HHI_MEM_PD_REG0), }; +static struct meson_ee_pwrc_mem_domain gxbb_pwrc_mem_vpu[] = { + VPU_MEMPD(HHI_VPU_MEM_PD_REG0), + VPU_MEMPD(HHI_VPU_MEM_PD_REG1), + VPU_HHI_MEMPD(HHI_MEM_PD_REG0), +}; + static struct meson_ee_pwrc_mem_domain meson8_pwrc_mem_eth[] = { { HHI_MEM_PD_REG0, GENMASK(3, 2) }, }; @@ -223,11 +230,17 @@ static struct meson_ee_pwrc_mem_domain sm1_pwrc_mem_audio[] = { static bool pwrc_ee_get_power(struct meson_ee_pwrc_domain *pwrc_domain); static struct meson_ee_pwrc_domain_desc g12a_pwrc_domains[] = { - [PWRC_G12A_VPU_ID] = VPU_PD("VPU", &g12a_pwrc_vpu, g12a_pwrc_mem_vpu, + [PWRC_G12A_VPU_ID] = VPU_PD("VPU", &gxbb_pwrc_vpu, g12a_pwrc_mem_vpu, pwrc_ee_get_power, 11, 2), [PWRC_G12A_ETH_ID] = MEM_PD("ETH", meson8_pwrc_mem_eth), }; +static struct meson_ee_pwrc_domain_desc gxbb_pwrc_domains[] = { + [PWRC_GXBB_VPU_ID] = VPU_PD("VPU", &gxbb_pwrc_vpu, gxbb_pwrc_mem_vpu, + pwrc_ee_get_power, 12, 2), + [PWRC_GXBB_ETH_ID] = MEM_PD("ETH", meson8_pwrc_mem_eth), +}; + static struct meson_ee_pwrc_domain_desc meson8_pwrc_domains[] = { [PWRC_MESON8_VPU_ID] = VPU_PD("VPU", &meson8_pwrc_vpu, meson8_pwrc_mem_vpu, pwrc_ee_get_power, @@ -514,6 +527,11 @@ static struct meson_ee_pwrc_domain_data meson_ee_g12a_pwrc_data = { .domains = g12a_pwrc_domains, }; +static struct meson_ee_pwrc_domain_data meson_ee_gxbb_pwrc_data = { + .count = ARRAY_SIZE(gxbb_pwrc_domains), + .domains = gxbb_pwrc_domains, +}; + static struct meson_ee_pwrc_domain_data meson_ee_m8_pwrc_data = { .count = ARRAY_SIZE(meson8_pwrc_domains), .domains = meson8_pwrc_domains, @@ -542,6 +560,10 @@ static const struct of_device_id meson_ee_pwrc_match_table[] = { .compatible = "amlogic,meson8m2-pwrc", .data = &meson_ee_m8b_pwrc_data, }, + { + .compatible = "amlogic,meson-gxbb-pwrc", + .data = &meson_ee_gxbb_pwrc_data, + }, { .compatible = "amlogic,meson-g12a-pwrc", .data = &meson_ee_g12a_pwrc_data,