From patchwork Tue Jun 9 10:52:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= X-Patchwork-Id: 11595231 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 E81151391 for ; Tue, 9 Jun 2020 10:53: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 C380C2078D for ; Tue, 9 Jun 2020 10:53: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="eQA24TJ1"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KQ/bjzvZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C380C2078D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=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=2TYe7U+hmFGxHFtI1uX1l6tnRMyA0b31/cl8c2ieg/0=; b=eQA24TJ1bckf05 UbEs3Y8IiEYbJjTNjwzZ7U0/0Qx+xwq4zdqqucHiXW2DlLO/pD1HFmz0s9D29gWviTQ/vWuWNBW8i +tTOPmHUdfjhEAcNZMupENYtfvE8YP2n89hHTu700oOSOq2knFWsQskBnFB77BChGuNT68QeTkxsA kdhaeoDmUdXIis6AXt80gshR/Ct61VSyqOkXuAAGTsDo0BwOo7y7DBT+Ug0UhlKN9wO85BD0Pk92b r1s+QYeS+aPHnr8XEy4CtW6JJO3l28Js4OcnSHj6hMqwG03GLUnndBgZvOw528bffdwEcbKlz5Eo7 +dbRNv0y+6ZnKtolf0Xg==; 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 1jibsO-0006S6-7N; Tue, 09 Jun 2020 10:53:04 +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 1jibsA-0006Fz-0g for linux-arm-kernel@lists.infradead.org; Tue, 09 Jun 2020 10:52:51 +0000 Received: by mail-wr1-x441.google.com with SMTP id x13so20765753wrv.4 for ; Tue, 09 Jun 2020 03:52:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RN8qA9KeRPApUC9s9M9mqLxO489K/MfoAz940jHP23Y=; b=KQ/bjzvZAfoLGfoT12i5X6Z0l3Dwg03CsiU22jQmf6WO4U3kjZL6jNOLH3pVVe5Tnt RgELItRui03zlzAWxLo/jV5rJxyxBOuFMyhHq95/oZE+QMScFX8PFN05KO+6vMrd/Ykv Qn7A/jpMmd9UUj55yUg8OULwYyGSEvlRXeY5nh8S8XLpVk74TUNBRfPzrhlsZDukx7Ui RiVziKKAInDR5h0GQ/NjNmQhJadTxgBwgVwdw0Dzo3GZRWFRzyokoufLUNKWfOmrUKQf sqVPTK069lREajkxb04vUVcDRFSaGBrZA8DL8pbReeLepaXr4RVEEJclUttXLpYzFZ2h hWLw== 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=RN8qA9KeRPApUC9s9M9mqLxO489K/MfoAz940jHP23Y=; b=ZAXm4Oun/Zbr6V1hPpKcr7gB1cqt7MFA5FHnK4UDWbkIz/iRIhoxWF5gK950svvwC/ uUVMKltijg648Sx9wE3p3KsydxlJ/fIJVl7X4qah4L4AREJurxWrN7I0qpLjTeY0tmoh yTOlnAcIh08O3P6MPB/aVKfVoHrlNJ0VqdMXxQVYQodUX8X5ILRuqHQDkRJJJXamwKhd SzQ8SqC845ViDt2We7NT7QUsN51GVJt7/Y86pbduHh11gXfplSCH0Nwo1/ayMggy6Nxh mfOMjkaBYR/A0c0+UNwGbD7SgYzfZNeQiUnWz7t6Ccl7u3GnVML/9P2AK4Kft1tbHaRc jIgQ== X-Gm-Message-State: AOAM533vrZJfegzQzpXYJ/+/dbB/HBKE26ywIyXjaLljJuLfEQ3Dq6dM DF28G7kjLp+WRWNTLUIuF4A= X-Google-Smtp-Source: ABdhPJz4YtWMdIQH3Ns4x4rDx6zL4PJImYd9panLoTN08va8Aq47KKkXfkMIGis/Zhdd8xQK0JiL0A== X-Received: by 2002:adf:ee47:: with SMTP id w7mr3661475wro.171.1591699967688; Tue, 09 Jun 2020 03:52:47 -0700 (PDT) Received: from skynet.lan (28.red-83-49-61.dynamicip.rima-tde.net. [83.49.61.28]) by smtp.gmail.com with ESMTPSA id h5sm2949931wrw.85.2020.06.09.03.52.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 03:52:47 -0700 (PDT) From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= To: hauke@hauke-m.de, zajec5@gmail.com, tsbogend@alpha.franken.de, robh+dt@kernel.org, f.fainelli@gmail.com, jonas.gorski@gmail.com, bcm-kernel-feedback-list@broadcom.com, linux-mips@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/4] dt-bindings: soc: brcm: add BCM63xx power domain binding Date: Tue, 9 Jun 2020 12:52:41 +0200 Message-Id: <20200609105244.4014823-2-noltari@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200609105244.4014823-1-noltari@gmail.com> References: <20200609105244.4014823-1-noltari@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200609_035250_056311_63AE5B05 X-CRM114-Status: UNSURE ( 8.78 ) X-CRM114-Notice: Please train this message. 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 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [noltari[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org BCM6318, BCM6328, BCM6362 and BCM63268 SoCs have a power domain controller to enable/disable certain components in order to save power. Signed-off-by: Álvaro Fernández Rojas --- .../devicetree/bindings/mips/brcm/soc.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Documentation/devicetree/bindings/mips/brcm/soc.txt b/Documentation/devicetree/bindings/mips/brcm/soc.txt index 3a66d3c483e1..22ec9e39bff7 100644 --- a/Documentation/devicetree/bindings/mips/brcm/soc.txt +++ b/Documentation/devicetree/bindings/mips/brcm/soc.txt @@ -164,3 +164,20 @@ Example: reg = <0x4067c0 0x40>; interrupts = <&periph_intc 19>; }; + +BCM63xx +------- + += Power domain controller + +BCM6318, BCM6328, BCM6362 and BCM63268 SoCs have a power domain controller +to enable/disable certain components in order to save power. + +- compatible : should contain one of: + "brcm,bcm6318-power-controller" + "brcm,bcm6328-power-controller" + "brcm,bcm6362-power-controller" + "brcm,bcm63268-power-controller" +- reg : the register start and length for the power domain + controller block +- #power-domain-cells : must be 1 From patchwork Tue Jun 9 10:52:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= X-Patchwork-Id: 11595239 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 868A2618 for ; Tue, 9 Jun 2020 10:53:31 +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 59F902078D for ; Tue, 9 Jun 2020 10:53:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DUJ7UMmP"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pURvbwHJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 59F902078D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=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=hNzZnp0kIrtii2NQeSsuuPGounJtmqX1AU7UjvwexvY=; b=DUJ7UMmP3Sqrv1 p0XT/55xKWs7wfjkR9TW2kV0U32LCVSNFmUOgyoqdE9CFuxECQS8m7uRnOty9bAFNeu2183scxNm/ D6AG/5vRM+fSc8/wqpS3abIC9yvaVkSXbyrTIFMhBvMCqq3V4VeZ1e8Tqutd8JuhIEX/Mnv2CNlny IecVfgxNuMwq4xzOp7ZjPp9ErsnAWe9MxQJNWEbMhIRa3vpELhPmxE3nqFj19uWgPVBPk0a5IoQtQ r6v2H+8uBxCqPkRZfAnvkJRLkhCVA9DANztdWmev8nyzp7NGZ3eCEj4g5SC9RCi6HFV+pnviLI4E+ 8Cyl7Euc+EqcFuNPpbVA==; 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 1jibsn-0006sk-8r; Tue, 09 Jun 2020 10:53:29 +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 1jibs9-0006G2-VQ for linux-arm-kernel@lists.infradead.org; Tue, 09 Jun 2020 10:52:52 +0000 Received: by mail-wr1-x442.google.com with SMTP id x6so20705139wrm.13 for ; Tue, 09 Jun 2020 03:52:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qdOuIEoqs/+VDBW0OKFccriMXr4tmsLSpKU4xXreWrI=; b=pURvbwHJ0Q3YJ8g99HOsbCYQc+cYayvcMnQnatAXEU/KG76IQo8BsRyJiP1xKy+I2o 3EeLXDXloJLbigMVWbi3dMBLWhZuqiX6bUnwGWQAXpAX5OlE7umr5OXKBmLgpE8r5aic jfIlPpghtCNN4SwxeLCmiRgHTr8uQ0Pm/ZFiwL5/j+mw2CPoJw0NFpFo8Ees9B9uJX8u ctT586qoUaxWonJ9ApUWMtypLsdvjSPJ3wBoKckN3ZCdfQ4vNyU6QEMugdkrmp5w5YBX hXgD2Dk1wC7Lg/oaBAo0aPx9Ur9t5Cf27L+fNDvIymxVjMzy/1qvQ1VzQf/c0BakVFGT gkqg== 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=qdOuIEoqs/+VDBW0OKFccriMXr4tmsLSpKU4xXreWrI=; b=pz06bI2lDa8N2ld2R627PVvMZOCc/LM7iMRK5MQU5dBvhJiTjgWDk0AeE58wYABNJj IcYhvde0eatusicilCo85nCe8qGue/jt9nCIdmomUUQMZ5/AlW2z3EGGv5q1fuhozL0F qGwLMRNInNZjm/PQ8XaHqZKAtSlgmTZtndRKWkXOGqkDuj6lZaVpVK7itZW9uWYIhIKT +2NZqmynWOSW3fyEi4CBMDx+guV0daj8HQGEfz1ACHaLrkW667mHOqd+aTItNVIwp0dl /OcnHqyfG0DFj1J4ku5pf8Z0L7BnqoqSMQ6CXDNvMMiDXRTlgZB6TsJT6oVKge8cTZjp REvw== X-Gm-Message-State: AOAM532xjOAeIXIn+o/D2MOyAc+/SckVXNahP5lGgFESu1c/Ds3CaJYX jrW8hMvfEpBehSvww6HyvrQ= X-Google-Smtp-Source: ABdhPJzacyMzl5AcSYWGgfLsv0Eu2pANVtVHHoPdnZapMYpFzRu0zmU0d52povmbP5Di5kGTlWzOUw== X-Received: by 2002:adf:e387:: with SMTP id e7mr3752845wrm.70.1591699968682; Tue, 09 Jun 2020 03:52:48 -0700 (PDT) Received: from skynet.lan (28.red-83-49-61.dynamicip.rima-tde.net. [83.49.61.28]) by smtp.gmail.com with ESMTPSA id h5sm2949931wrw.85.2020.06.09.03.52.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 03:52:48 -0700 (PDT) From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= To: hauke@hauke-m.de, zajec5@gmail.com, tsbogend@alpha.franken.de, robh+dt@kernel.org, f.fainelli@gmail.com, jonas.gorski@gmail.com, bcm-kernel-feedback-list@broadcom.com, linux-mips@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/4] soc: bcm: add BCM63xx power domain driver Date: Tue, 9 Jun 2020 12:52:42 +0200 Message-Id: <20200609105244.4014823-3-noltari@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200609105244.4014823-1-noltari@gmail.com> References: <20200609105244.4014823-1-noltari@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200609_035250_045507_21F25A2C X-CRM114-Status: GOOD ( 16.24 ) 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 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [noltari[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org BCM6318, BCM6328, BCM6362 and BCM63268 SoCs have a power domain controller to enable/disable certain components in order to save power. Signed-off-by: Álvaro Fernández Rojas --- drivers/soc/bcm/Kconfig | 8 + drivers/soc/bcm/Makefile | 1 + drivers/soc/bcm/bcm63xx-power.c | 374 ++++++++++++++++++++++++++++++++ 3 files changed, 383 insertions(+) create mode 100644 drivers/soc/bcm/bcm63xx-power.c diff --git a/drivers/soc/bcm/Kconfig b/drivers/soc/bcm/Kconfig index 648e32693b7e..a2e60d28370b 100644 --- a/drivers/soc/bcm/Kconfig +++ b/drivers/soc/bcm/Kconfig @@ -13,6 +13,14 @@ config BCM2835_POWER firmware means that Linux usage of the same power domain must be accessed using the RASPBERRYPI_POWER driver +config BCM63XX_POWER + bool "BCM63xx power domain driver" + depends on BMIPS_GENERIC || (COMPILE_TEST && OF) + select PM_GENERIC_DOMAINS if PM + help + This enables support for the BCM63xx power domains controller on + BCM6318, BCM6328, BCM6362 and BCM63268 SoCs. + config RASPBERRYPI_POWER bool "Raspberry Pi power domain driver" depends on ARCH_BCM2835 || (COMPILE_TEST && OF) diff --git a/drivers/soc/bcm/Makefile b/drivers/soc/bcm/Makefile index d92268a829a9..e6c3d04a4a83 100644 --- a/drivers/soc/bcm/Makefile +++ b/drivers/soc/bcm/Makefile @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only obj-$(CONFIG_BCM2835_POWER) += bcm2835-power.o +obj-$(CONFIG_BCM63XX_POWER) += bcm63xx-power.o obj-$(CONFIG_RASPBERRYPI_POWER) += raspberrypi-power.o obj-$(CONFIG_SOC_BRCMSTB) += brcmstb/ diff --git a/drivers/soc/bcm/bcm63xx-power.c b/drivers/soc/bcm/bcm63xx-power.c new file mode 100644 index 000000000000..b6e51b721f09 --- /dev/null +++ b/drivers/soc/bcm/bcm63xx-power.c @@ -0,0 +1,374 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * BCM63xx Power Domain Controller Driver + * + * Copyright (C) 2020 Álvaro Fernández Rojas + */ + +#include +#include +#include +#include +#include +#include + +struct bcm63xx_power_dev { + struct generic_pm_domain genpd; + struct bcm63xx_power *power; + uint32_t mask; +}; + +struct bcm63xx_power { + void __iomem *base; + spinlock_t lock; + struct bcm63xx_power_dev *dev; + struct genpd_onecell_data genpd_data; + struct generic_pm_domain **genpd; +}; + +struct bcm63xx_power_data { + const char * const name; + uint8_t bit; + unsigned int flags; +}; + +static int bcm63xx_power_get_state(struct bcm63xx_power_dev *pmd, bool *is_on) +{ + struct bcm63xx_power *power = pmd->power; + + if (!pmd->mask) { + *is_on = false; + return -EINVAL; + } + + *is_on = !(__raw_readl(power->base) & pmd->mask); + + return 0; +} + +static int bcm63xx_power_set_state(struct bcm63xx_power_dev *pmd, bool on) +{ + struct bcm63xx_power *power = pmd->power; + unsigned long flags; + uint32_t val; + + if (!pmd->mask) + return -EINVAL; + + spin_lock_irqsave(&power->lock, flags); + val = __raw_readl(power->base); + if (on) + val &= ~pmd->mask; + else + val |= pmd->mask; + __raw_writel(val, power->base); + spin_unlock_irqrestore(&power->lock, flags); + + return 0; +} + +static int bcm63xx_power_on(struct generic_pm_domain *genpd) +{ + struct bcm63xx_power_dev *pmd = container_of(genpd, + struct bcm63xx_power_dev, genpd); + + return bcm63xx_power_set_state(pmd, true); +} + +static int bcm63xx_power_off(struct generic_pm_domain *genpd) +{ + struct bcm63xx_power_dev *pmd = container_of(genpd, + struct bcm63xx_power_dev, genpd); + + return bcm63xx_power_set_state(pmd, false); +} + +static int bcm63xx_power_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; + struct resource *res; + const struct bcm63xx_power_data *entry, *table; + struct bcm63xx_power *power; + unsigned int ndom; + uint8_t max_bit = 0; + int ret; + + power = devm_kzalloc(dev, sizeof(*power), GFP_KERNEL); + if (!power) + return -ENOMEM; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + power->base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(power->base)) + return PTR_ERR(power->base); + + table = of_device_get_match_data(dev); + if (!table) + return -EINVAL; + + power->genpd_data.num_domains = 0; + ndom = 0; + for (entry = table; entry->name; entry++) { + max_bit = max(max_bit, entry->bit); + ndom++; + } + + if (!ndom) + return -ENODEV; + + power->genpd_data.num_domains = max_bit + 1; + + power->dev = devm_kcalloc(dev, power->genpd_data.num_domains, + sizeof(struct bcm63xx_power_dev), + GFP_KERNEL); + if (!power->dev) + return -ENOMEM; + + power->genpd = devm_kcalloc(dev, power->genpd_data.num_domains, + sizeof(struct generic_pm_domain *), + GFP_KERNEL); + if (!power->genpd) + return -ENOMEM; + + power->genpd_data.domains = power->genpd; + + ndom = 0; + for (entry = table; entry->name; entry++) { + struct bcm63xx_power_dev *pmd = &power->dev[ndom]; + bool is_on; + + pmd->power = power; + pmd->mask = BIT(entry->bit); + pmd->genpd.name = entry->name; + pmd->genpd.flags = entry->flags; + + ret = bcm63xx_power_get_state(pmd, &is_on); + if (ret) + dev_warn(dev, "unable to get current state for %s\n", + pmd->genpd.name); + + pmd->genpd.power_on = bcm63xx_power_on; + pmd->genpd.power_off = bcm63xx_power_off; + + pm_genpd_init(&pmd->genpd, NULL, !is_on); + power->genpd[entry->bit] = &pmd->genpd; + + ndom++; + } + + spin_lock_init(&power->lock); + + ret = of_genpd_add_provider_onecell(np, &power->genpd_data); + if (ret) { + dev_err(dev, "failed to register genpd driver: %d\n", ret); + return ret; + } + + dev_info(dev, "registered %u power domains\n", ndom); + + return 0; +} + +static const struct bcm63xx_power_data bcm6318_power_domains[] = { + { + .name = "pcie", + .bit = 0, + }, { + .name = "usb", + .bit = 1, + }, { + .name = "ephy0", + .bit = 2, + }, { + .name = "ephy1", + .bit = 3, + }, { + .name = "ephy2", + .bit = 4, + }, { + .name = "ephy3", + .bit = 5, + }, { + .name = "ldo2p5", + .bit = 6, + .flags = GENPD_FLAG_ALWAYS_ON, + }, { + .name = "ldo2p9", + .bit = 7, + .flags = GENPD_FLAG_ALWAYS_ON, + }, { + .name = "sw1p0", + .bit = 8, + .flags = GENPD_FLAG_ALWAYS_ON, + }, { + .name = "pad", + .bit = 9, + .flags = GENPD_FLAG_ALWAYS_ON, + }, { + /* sentinel */ + }, +}; + +static const struct bcm63xx_power_data bcm6328_power_domains[] = { + { + .name = "adsl2-mips", + .bit = 0, + }, { + .name = "adsl2-phy", + .bit = 1, + }, { + .name = "adsl2-afe", + .bit = 2, + }, { + .name = "sar", + .bit = 3, + }, { + .name = "pcm", + .bit = 4, + }, { + .name = "usbd", + .bit = 5, + }, { + .name = "usbh", + .bit = 6, + }, { + .name = "pcie", + .bit = 7, + }, { + .name = "robosw", + .bit = 8, + }, { + .name = "ephy", + .bit = 9, + }, { + /* sentinel */ + }, +}; + +static const struct bcm63xx_power_data bcm6362_power_domains[] = { + { + .name = "sar", + .bit = 0, + }, { + .name = "ipsec", + .bit = 1, + }, { + .name = "mips", + .bit = 2, + .flags = GENPD_FLAG_ALWAYS_ON, + }, { + .name = "dect", + .bit = 3, + }, { + .name = "usbh", + .bit = 4, + }, { + .name = "usbd", + .bit = 5, + }, { + .name = "robosw", + .bit = 6, + }, { + .name = "pcm", + .bit = 7, + }, { + .name = "periph", + .bit = 8, + .flags = GENPD_FLAG_ALWAYS_ON, + }, { + .name = "adsl-phy", + .bit = 9, + }, { + .name = "gmii-pads", + .bit = 10, + }, { + .name = "fap", + .bit = 11, + }, { + .name = "pcie", + .bit = 12, + }, { + .name = "wlan-pads", + .bit = 13, + }, { + /* sentinel */ + }, +}; + +static const struct bcm63xx_power_data bcm63268_power_domains[] = { + { + .name = "sar", + .bit = 0, + }, { + .name = "ipsec", + .bit = 1, + }, { + .name = "mips", + .bit = 2, + .flags = GENPD_FLAG_ALWAYS_ON, + }, { + .name = "dect", + .bit = 3, + }, { + .name = "usbh", + .bit = 4, + }, { + .name = "usbd", + .bit = 5, + }, { + .name = "robosw", + .bit = 6, + }, { + .name = "pcm", + .bit = 7, + }, { + .name = "periph", + .bit = 8, + .flags = GENPD_FLAG_ALWAYS_ON, + }, { + .name = "vdsl-phy", + .bit = 9, + }, { + .name = "vdsl-mips", + .bit = 10, + }, { + .name = "fap", + .bit = 11, + }, { + .name = "pcie", + .bit = 12, + }, { + .name = "wlan-pads", + .bit = 13, + }, { + /* sentinel */ + }, +}; + +static const struct of_device_id bcm63xx_power_of_match[] = { + { + .compatible = "brcm,bcm6318-power-controller", + .data = &bcm6318_power_domains, + }, { + .compatible = "brcm,bcm6328-power-controller", + .data = &bcm6328_power_domains, + }, { + .compatible = "brcm,bcm6362-power-controller", + .data = &bcm6362_power_domains, + }, { + .compatible = "brcm,bcm63268-power-controller", + .data = &bcm63268_power_domains, + }, { + /* sentinel */ + } +}; + +static struct platform_driver bcm63xx_power_driver = { + .driver = { + .name = "bcm63xx-power-controller", + .of_match_table = bcm63xx_power_of_match, + }, + .probe = bcm63xx_power_probe, +}; +builtin_platform_driver(bcm63xx_power_driver); From patchwork Tue Jun 9 10:52:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= X-Patchwork-Id: 11595235 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 EA809159A for ; Tue, 9 Jun 2020 10:53:23 +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 B37AC207C3 for ; Tue, 9 Jun 2020 10:53:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ScYV+C4S"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ivsw5bR/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B37AC207C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=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=AFj6W7aGGN3x4IpjvJeCmS8fRokcxtPnt59t9bglKRA=; b=ScYV+C4SKnfTFn AavnsOVhVlaW57Pk4vOkNJnnA45S+Sm0EzpOe0Ld7rj2Js638+R7SQCX8252IwDLJ30RpAmkZQjo2 m5XMCKfiF5r4zTuao88kyqD6lD+BwfqmVdx647rK/omGS5W4zinnJ9z4VQB9AGMYlxuIUMRcJtvP9 00lB8K+C1l1PLsXT082r2cvOiTYJNQSLl20FcrjCQVeAb/1Q/bxk4JlzRcktrUjHuAN2TaupaFU4s RBTFp6WC1v5SRIKINvTbCOIHq3cuxq7NLjAJHni7jXyqF/9+vrDB9MhPkOMNA7UHMhtVoBz/ThNsD cVmK6h+Is3MU6ES2pCWw==; 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 1jibsb-0006fD-KU; Tue, 09 Jun 2020 10:53:17 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jibsB-0006H5-AE for linux-arm-kernel@lists.infradead.org; Tue, 09 Jun 2020 10:52:52 +0000 Received: by mail-wm1-x333.google.com with SMTP id r15so2605778wmh.5 for ; Tue, 09 Jun 2020 03:52:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Q8RVdDdZ6lI+tdJvWKmgskLx2Vkoy4BLid+J0jKoeDE=; b=Ivsw5bR/lq453+cAFa6bKx1kq5+Z+qK/z1X5OZ2ih4IRajv87GqW21W7G+goj2OkgJ VaMJE1mKMP+O2w362Bs3VBEohlZ/ClyhjyWoYL86mr2F2SHqcFDBk3zLFj3SFxy+6R/o FUgwy0dPN9ktTLtU/4HmALB/pXWLq3L2mEBYC8wq7YmP1LG/zrgX5SveKeDbqZdwX1h2 4e9lqhZzMwZLuFPQXWn6vJ5w5FgD/BxTbMS6x3aZm7lu3mtNxBqh859GNTIkACGm28sP X81q/4ucYAf4/WhVLWnDhFny8jvIAIsub/6v9D4taan64qXX/aFOhd3QW3dUJqfxj5z+ EObg== 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=Q8RVdDdZ6lI+tdJvWKmgskLx2Vkoy4BLid+J0jKoeDE=; b=AUmSIKzZzLJ1G38TkR21oCAgAbtVawmCS1aMZjwDEmEndLNJQW4+TS4ap4faMxjtF7 DsbDD+lJtEyp+o4b18hlCdU4rRsdeJn5yN4qHfHshTIElHmIt/7mancCcJ6Hyqgf9pGT +U8B0F0XM8J2wM50HI+tA+7gC97L3n0P94H1wzyWaE3DNxUMiZbVCEek18kmHLiY8POs gCYvfUkdfxkgPrRmNOaHsQkAxvgVMRxwewSnmzGywgMWPt4S8VLNeU574FJbehxTnRmU BBh3UH+sYjeWaIYQfnUQooINDa7tv2YGqydY6L0ta/ULIFDnaice53uooVyQi+Y4GpNv jlGw== X-Gm-Message-State: AOAM532jhXOB49VhTHtRa5LaiulugNR+PK97DBznfPDZnR5a/eCG293R i8o1riJLNYLZIZ3Ncei4+Y0= X-Google-Smtp-Source: ABdhPJwA9LIELheHMB5oq2Vt2zKR+24hqfQscgD01puif3yRbJGjUCabEjWqJ+UUCSzlNv85Ghs4ug== X-Received: by 2002:a1c:e40a:: with SMTP id b10mr3283247wmh.41.1591699969715; Tue, 09 Jun 2020 03:52:49 -0700 (PDT) Received: from skynet.lan (28.red-83-49-61.dynamicip.rima-tde.net. [83.49.61.28]) by smtp.gmail.com with ESMTPSA id h5sm2949931wrw.85.2020.06.09.03.52.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 03:52:49 -0700 (PDT) From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= To: hauke@hauke-m.de, zajec5@gmail.com, tsbogend@alpha.franken.de, robh+dt@kernel.org, f.fainelli@gmail.com, jonas.gorski@gmail.com, bcm-kernel-feedback-list@broadcom.com, linux-mips@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/4] mips: bmips: dts: add BCM6328 power domain support Date: Tue, 9 Jun 2020 12:52:43 +0200 Message-Id: <20200609105244.4014823-4-noltari@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200609105244.4014823-1-noltari@gmail.com> References: <20200609105244.4014823-1-noltari@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200609_035251_356788_EBE99A00 X-CRM114-Status: UNSURE ( 9.08 ) X-CRM114-Notice: Please train this message. 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:333 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [noltari[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org BCM6328 SoCs have a power domain controller to enable/disable certain components in order to save power. Signed-off-by: Álvaro Fernández Rojas Acked-by: Florian Fainelli --- arch/mips/boot/dts/brcm/bcm6328.dtsi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/mips/boot/dts/brcm/bcm6328.dtsi b/arch/mips/boot/dts/brcm/bcm6328.dtsi index af860d06def6..1f9edd710392 100644 --- a/arch/mips/boot/dts/brcm/bcm6328.dtsi +++ b/arch/mips/boot/dts/brcm/bcm6328.dtsi @@ -110,6 +110,12 @@ leds0: led-controller@10000800 { status = "disabled"; }; + periph_pwr: power-controller@10001848 { + compatible = "brcm,bcm6328-power-controller"; + reg = <0x10001848 0x4>; + #power-domain-cells = <1>; + }; + ehci: usb@10002500 { compatible = "brcm,bcm6328-ehci", "generic-ehci"; reg = <0x10002500 0x100>; From patchwork Tue Jun 9 10:52:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= X-Patchwork-Id: 11595243 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 31AC4618 for ; Tue, 9 Jun 2020 10:53:53 +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 0E2E12078D for ; Tue, 9 Jun 2020 10:53:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tVkDC9YC"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ope3F7nZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0E2E12078D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=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=AP5wTBQjk3ehjoJ/g1LL4+gyzVmBtALULQH3Poyh8co=; b=tVkDC9YC6jx/nY UzThiQftn7KzFU69bDZBP7kQArlMne9z8jr9zw8vd3HfW3bL13dtM5bil12eJjxQiz/ptEnXWZ6uV Qbh89u9iuHD1IRvREs0iLyXXFX1iqmKz4sbuUhl6aCoh4PF7I+Rea6D1bt7H+7qB52Y0+gnaHo86T wsdjDjerOVf5BflHsrLlGlyeWN0st65guFp3ISkMzrZi+CFHHX2PR2zQQT8O4IGJerf+auQZkLvAf ATrnE3UL4e3kqZu6LdXvxT91ilOd48XeWXd0KI98BKFE0piP9xhiMfyT838HeZ/0/l+WW0cpy/Ye3 B0Q7UVKETLWt2oCaj/9A==; 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 1jibt3-000796-3G; Tue, 09 Jun 2020 10:53:45 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jibsC-0006HG-4h for linux-arm-kernel@lists.infradead.org; Tue, 09 Jun 2020 10:52:53 +0000 Received: by mail-wm1-x331.google.com with SMTP id l17so2383887wmj.0 for ; Tue, 09 Jun 2020 03:52:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hJeYlzPvoPrXbT5CLnCDUqhSZEUIU0lHpQOSnzFUm8k=; b=Ope3F7nZyAOqCxCtvfqImTL5PCaNvV5hUSp3Syww2aYvcGIpxs16PqkIddX9TM/mtg fgM+3KI5+nSEaJfeAJQpbV8Ff5vgpd3rBlS26z5CwvLQN3VV34Y6PO/p8hnnnPCE+Ibu QFMImeKonIXiajjhc9HKn2TFIuBWHiW0by2g/Enhgm9OQjTzo1Qb2e9fb8sSxDtQWWKL HJkYuzndylzkqjQBaphjH40k68Qp05f3I4GkEs+fds5pPkdHTZCpkeDPGYf4g8X4UAJP l58PEViIlda4m/N0VPOP+axtsCOkjTM3G1HCdsDpJI8fg02FHq63IdLH4Q+dKRCCjDyB UagA== 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=hJeYlzPvoPrXbT5CLnCDUqhSZEUIU0lHpQOSnzFUm8k=; b=EYdqau+NHQvFHb3Q7xxrj5ZnTzZcQ7mzOQcmiaCgiaxqevd1k09CZE1c4Dt7trJ90M aX4sdZGY+S9ZKPkJEXDIzUl8HxoSu51M6PfV6/F2q1b56wnA3dX8IpEfzWUKbpBi2OwJ ASBV14nIU4UfTF6R2m6Kq3XMiiY2Y4hLOdn1uIwQHPpxvdo1ITI3e8fyEThfWGzc7vwv 8LZkCRHtEUb88lAs3jH5LwizfF5EXIq90pNjRGadQRcdw9ANhy19y1ewuw9BYhh5K9RM 03a4RmYXHpm5CEZll54IUd0kD4x1CXwBLe0wbn8BOhsQmrW/RJju8aPzy7mBSYdLobz1 0J8g== X-Gm-Message-State: AOAM532Oj1H4E+VW0ykdmOiRe5O8CLKwN+ObYLVr5xnmWN1mOzo2tDlX ZFTzQ+FwmmjBXAr+PMx9eew= X-Google-Smtp-Source: ABdhPJxGbt0UOOxgM0BS4bHHazb7Ur81/T8ArQNZwxR28RiqxKk6WvjKmPvjkGStst5AUp6Sd6NX8Q== X-Received: by 2002:a1c:9e13:: with SMTP id h19mr3466751wme.107.1591699970667; Tue, 09 Jun 2020 03:52:50 -0700 (PDT) Received: from skynet.lan (28.red-83-49-61.dynamicip.rima-tde.net. [83.49.61.28]) by smtp.gmail.com with ESMTPSA id h5sm2949931wrw.85.2020.06.09.03.52.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 03:52:50 -0700 (PDT) From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= To: hauke@hauke-m.de, zajec5@gmail.com, tsbogend@alpha.franken.de, robh+dt@kernel.org, f.fainelli@gmail.com, jonas.gorski@gmail.com, bcm-kernel-feedback-list@broadcom.com, linux-mips@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/4] mips: bmips: dts: add BCM6362 power domain support Date: Tue, 9 Jun 2020 12:52:44 +0200 Message-Id: <20200609105244.4014823-5-noltari@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200609105244.4014823-1-noltari@gmail.com> References: <20200609105244.4014823-1-noltari@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200609_035252_176344_B6121DB8 X-CRM114-Status: UNSURE ( 9.09 ) X-CRM114-Notice: Please train this message. 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:331 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [noltari[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org BCM6362 SoCs have a power domain controller to enable/disable certain components in order to save power. Signed-off-by: Álvaro Fernández Rojas Acked-by: Florian Fainelli Acked-by: Florian Fainelli --- arch/mips/boot/dts/brcm/bcm6362.dtsi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/mips/boot/dts/brcm/bcm6362.dtsi b/arch/mips/boot/dts/brcm/bcm6362.dtsi index 8ae6981735b8..c98f9111e3c8 100644 --- a/arch/mips/boot/dts/brcm/bcm6362.dtsi +++ b/arch/mips/boot/dts/brcm/bcm6362.dtsi @@ -108,6 +108,12 @@ uart1: serial@10000120 { status = "disabled"; }; + periph_pwr: power-controller@10001848 { + compatible = "brcm,bcm6362-power-controller"; + reg = <0x10001848 0x4>; + #power-domain-cells = <1>; + }; + leds0: led-controller@10001900 { #address-cells = <1>; #size-cells = <0>;