From patchwork Thu Jan 14 09:24:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 12018937 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E272BC433DB for ; Thu, 14 Jan 2021 09:27:11 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 8AD2F23359 for ; Thu, 14 Jan 2021 09:27:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8AD2F23359 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.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=CSlbF/25+4/7wIxBIg4df8b1CBH07F0KIQEc3dMXh4M=; b=dQKSBt0kuqul+bm9HWbDXI/du L06EwDV2lfX94kwq07S3j3ZgibAWndeIKk1Z/giyMCXNj84TBLjeu8vCm2Wy3PCj4q1VyyW4ZrQSk 1M/r1Nwa7vmFEWhT3mE16ww+iQCiU3mtUiF7LLxnIhvj9yPzojhOEtjaJA8tfmDPpIpQwCrt6Z96m IZnKgDQGtf/mowZEt/S/lkISCiRrnymkBMniAfKZktWqU2QF9o4c7LM1vzep1FiKFNGfnXCaoKlxK wExC/9pj5wj16C6HXXssIuSJUbw/5qsYrDs2fCvEoXYqv1+HK37oaVrvbRp449yA7l8cElIme6bd0 by3nMikhQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kzysi-0003wl-Gl; Thu, 14 Jan 2021 09:25:28 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kzysa-0003uu-DX for linux-arm-kernel@lists.infradead.org; Thu, 14 Jan 2021 09:25:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1610616321; x=1642152321; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7dbWcybAcPSCs9JfAgrdc5kMVgaiF/4Xqgv+SIR8YsI=; b=jZbR5RQ2pt2eMZh4PFaProCks36prIjwZLJaUUuOOatTBuaA2aPEfZBi FG4neIYhyLGPq7dcH8A5MCY6+FDrRwp/5nNGgw2GoI1M1N9d7pn1NLpvO p397/HJnIsF/4bPL2oIa+W5CBxxta1XCTkfyJtKwhgZaGP7rSz3EKmUqB HByI8d+256sEMjENHUM9lq4iSFk+ELZRviUB9jXWev+ELT8owjTSmblT7 oivXnuZSzTJZQVX+AV8o1qpfEFxMKBErupbYI9eqrSy0Uk2WiEUFaFCQv OsAg/y71+bpJqwnI6ji+nVmtJqMeM8OWV6XzT/RVQrV+lJJ0ani6HoQia Q==; IronPort-SDR: +4PmEIyCXSXkPIYvcokK5cNc4LN9N2AWBldNkhpXcJz/iCE31hYerYLcAsv8hYX4gI3c3Mmocq sgug9f7Z3vyTEITdY70AmWv/hSJibC0R4l6MJRznJJ0zCOQihhx5lnUTADftZ4Wg6z8V+2GaQp p0I2fT0t36vZ91QsQRG1hX21YqKovKjtyhYQIltCrX9/u69iQENd0qutTrazlbHXiRXzAvf8YS d+mprQ4/o5M8RzKWScYkHLpMMwTyMlWsXREi7nCipVzJSzAUGKPj6PMX2ZCl6AAbb9VkYp1Y1Q 6PU= X-IronPort-AV: E=Sophos;i="5.79,347,1602572400"; d="scan'208";a="105407067" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Jan 2021 02:25:17 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 14 Jan 2021 02:25:15 -0700 Received: from mchp-dev-shegelun.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Thu, 14 Jan 2021 02:25:13 -0700 From: Steen Hegelund To: Philipp Zabel , Rob Herring Subject: [PATCH v2 1/3] dt-bindings: reset: microchip sparx5 reset driver bindings Date: Thu, 14 Jan 2021 10:24:58 +0100 Message-ID: <20210114092500.2822208-2-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210114092500.2822208-1-steen.hegelund@microchip.com> References: <20210114092500.2822208-1-steen.hegelund@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210114_042520_690203_088AAB96 X-CRM114-Status: GOOD ( 11.95 ) 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: Andrew Lunn , Alexandre Belloni , devicetree@vger.kernel.org, Steen Hegelund , linux-kernel@vger.kernel.org, Microchip Linux Driver Support , Gregory Clement , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Signed-off-by: Steen Hegelund --- .../bindings/reset/microchip,rst.yaml | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Documentation/devicetree/bindings/reset/microchip,rst.yaml diff --git a/Documentation/devicetree/bindings/reset/microchip,rst.yaml b/Documentation/devicetree/bindings/reset/microchip,rst.yaml new file mode 100644 index 000000000000..b5526753e85d --- /dev/null +++ b/Documentation/devicetree/bindings/reset/microchip,rst.yaml @@ -0,0 +1,52 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/reset/microchip,rst.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Microchip Sparx5 Switch Reset Controller + +maintainers: + - Steen Hegelund + - Lars Povlsen + +description: | + The Microchip Sparx5 Switch provides reset control and implements the following + functions + - One Time Switch Core Reset (Soft Reset) + +properties: + $nodename: + pattern: "^reset-controller@[0-9a-f]+$" + + compatible: + const: microchip,sparx5-switch-reset + + reg: + maxItems: 1 + + "#reset-cells": + const: 1 + + syscons: + $ref: "/schemas/types.yaml#/definitions/phandle-array" + description: Array of syscons used to access reset registers + minItems: 2 + +required: + - compatible + - reg + - "#reset-cells" + - syscons + +additionalProperties: false + +examples: + - | + reset: reset-controller@0 { + compatible = "microchip,sparx5-switch-reset"; + reg = <0x0 0x0>; + #reset-cells = <1>; + syscons = <&cpu_ctrl>,<&gcb_ctrl>; + }; + From patchwork Thu Jan 14 09:24:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 12018941 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-22.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DF0DC43332 for ; Thu, 14 Jan 2021 09:27:19 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 450A023A21 for ; Thu, 14 Jan 2021 09:27:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 450A023A21 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.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=d4Hw+iJZCZ59I0Vt8y2a1IYZ5S+PrBo8iTWgIUcHwuk=; b=i+KrfFPB9EiYxFioOlu9bZm/i rP353n58J9b5/K/4/Q/FyJfSllkJ7AszkBtkiLe+/DiJDTVZYTslbdpntwId9EUZU4R+hsYM7PaUc 9KWZoVTT5MPEcs6vHXKshJ4gtfaMk9HbPFY4NO4MEblDJQ8psen2M5YkI6R+5ihUEcaKSZWVMJJ/j 6OsE03xxLQzSbc1mpKaZcI9bdL94OWiADRdpqb1Q634eFoM2NwmwXd1Jc47PXGqSY90Q+JpB2R0A8 vUIbx0+mTgWTGPGr7jEWOM/TJv3jvz9AyD1syoU5qLctwXaWpFFFu509jBG2cGI1a84c+R4AiNC0t 6r/d9MeqA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kzyse-0003wA-4b; Thu, 14 Jan 2021 09:25:24 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kzysZ-0003uX-AG for linux-arm-kernel@lists.infradead.org; Thu, 14 Jan 2021 09:25:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1610616319; x=1642152319; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/ru0sOwxsQPQfxjz4zPy8PGejHwoMKiUSzof6Z4Au7U=; b=uwV7IhqdDdwjnw+/w5VXRQ4otK1mjuHxcMQMOHDy7/Lds7qb6QdRYjZI v8UAqHkFWv9GOEOyiVlznuJJ0QByP1FS7eabvHPGUgNgJKhXIj4Wvs2tx PI+1pCPbsl1UFuOPzB58KLjoam1Y4AfIlBcAoTdKllGBYMdbPAOQg2UGj eZ73nggQB4Seb9feReLPyFluHZtlHImejQA0uS++UGBaNFTu5aRhnxUfj R1fced0hpyoInEA8Tvzq0mSOa9VqN3EqO9C8ntm6EldAw1MbYfTjUKtT2 b+RlKKDS49OqQNXgmAAO2SIYRIF5x+KZh91GqFfRPWFlfSnjGSv3KEvGI Q==; IronPort-SDR: w6o3nlfrPFC9jfxuJ+itq3po5LHLeVt+0KZdozIh4PcsIclVIyS4Uob9viBtkuRbkGB7HevEUT tp6lzEMtIKFfh+H9UOtr5/shk9d+Kaii5pmS0wIAPPrqcafPHt4+emJeIhQw9h5AwLPvnsiJNB jc9D61a+EUbHBqD6Ju1TJsEUeHa+dirnmJ3P9Uf2QiyCmKsxLx2uYyJS/Zbs0/YkMXFq+elVw5 ngeoB28YBQizeW2xoe1W/OYQioZwzZh2v+X8vT0qLpZtkVPMbTBPKFC9JEzF/tQXISD0dt9WVy G+A= X-IronPort-AV: E=Sophos;i="5.79,347,1602572400"; d="scan'208";a="40386301" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Jan 2021 02:25:17 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 14 Jan 2021 02:25:17 -0700 Received: from mchp-dev-shegelun.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Thu, 14 Jan 2021 02:25:15 -0700 From: Steen Hegelund To: Philipp Zabel Subject: [PATCH v2 2/3] reset: mchp: sparx5: add switch reset driver Date: Thu, 14 Jan 2021 10:24:59 +0100 Message-ID: <20210114092500.2822208-3-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210114092500.2822208-1-steen.hegelund@microchip.com> References: <20210114092500.2822208-1-steen.hegelund@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210114_042519_549403_1BB37855 X-CRM114-Status: GOOD ( 19.94 ) 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: Andrew Lunn , Alexandre Belloni , Steen Hegelund , linux-kernel@vger.kernel.org, Microchip Linux Driver Support , Gregory Clement , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Signed-off-by: Steen Hegelund --- drivers/reset/Kconfig | 8 ++ drivers/reset/Makefile | 1 + drivers/reset/reset-microchip-sparx5.c | 146 +++++++++++++++++++++++++ 3 files changed, 155 insertions(+) create mode 100644 drivers/reset/reset-microchip-sparx5.c diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index 71ab75a46491..05c240c47a8a 100644 --- a/drivers/reset/Kconfig +++ b/drivers/reset/Kconfig @@ -101,6 +101,14 @@ config RESET_LPC18XX help This enables the reset controller driver for NXP LPC18xx/43xx SoCs. +config RESET_MCHP_SPARX5 + bool "Microchip Sparx5 reset driver" + depends on HAS_IOMEM || COMPILE_TEST + default y if SPARX5_SWITCH + select MFD_SYSCON + help + This driver supports switch core reset for the Microchip Sparx5 SoC. + config RESET_MESON tristate "Meson Reset Driver" depends on ARCH_MESON || COMPILE_TEST diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile index 1054123fd187..341fd9ab4bf6 100644 --- a/drivers/reset/Makefile +++ b/drivers/reset/Makefile @@ -15,6 +15,7 @@ obj-$(CONFIG_RESET_IMX7) += reset-imx7.o obj-$(CONFIG_RESET_INTEL_GW) += reset-intel-gw.o obj-$(CONFIG_RESET_LANTIQ) += reset-lantiq.o obj-$(CONFIG_RESET_LPC18XX) += reset-lpc18xx.o +obj-$(CONFIG_RESET_MCHP_SPARX5) += reset-microchip-sparx5.o obj-$(CONFIG_RESET_MESON) += reset-meson.o obj-$(CONFIG_RESET_MESON_AUDIO_ARB) += reset-meson-audio-arb.o obj-$(CONFIG_RESET_NPCM) += reset-npcm.o diff --git a/drivers/reset/reset-microchip-sparx5.c b/drivers/reset/reset-microchip-sparx5.c new file mode 100644 index 000000000000..f5899891356d --- /dev/null +++ b/drivers/reset/reset-microchip-sparx5.c @@ -0,0 +1,146 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Microchip Sparx5 Switch Reset driver + * + * Copyright (c) 2020 Microchip Technology Inc. and its subsidiaries. + * + * The Sparx5 Chip Register Model can be browsed at this location: + * https://github.com/microchip-ung/sparx-5_reginfo + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PROTECT_REG 0x84 +#define PROTECT_BIT BIT(10) +#define SOFT_RESET_REG 0x08 +#define SOFT_RESET_BIT BIT(1) + +struct mchp_reset_context { + struct device *dev; + struct regmap *cpu_ctrl; + struct regmap *gcb_ctrl; + struct reset_controller_dev reset_ctrl; +}; + +static u32 sparx5_read_soft_rst(struct mchp_reset_context *ctx) +{ + u32 val; + + regmap_read(ctx->gcb_ctrl, SOFT_RESET_REG, &val); + return val; +} + +static int sparx5_switch_reset(struct reset_controller_dev *rcdev, + unsigned long id) +{ + struct mchp_reset_context *ctx = + container_of(rcdev, struct mchp_reset_context, reset_ctrl); + u32 val; + + /* Make sure the core is PROTECTED from reset */ + regmap_update_bits(ctx->cpu_ctrl, PROTECT_REG, PROTECT_BIT, PROTECT_BIT); + + /* Start soft reset */ + regmap_write(ctx->gcb_ctrl, SOFT_RESET_REG, SOFT_RESET_BIT); + + /* Wait for soft reset done */ + return read_poll_timeout(sparx5_read_soft_rst, val, + (val & SOFT_RESET_BIT) == 0, + 1, 100, false, + ctx); +} + +static const struct reset_control_ops sparx5_reset_ops = { + .reset = sparx5_switch_reset, +}; + +static int mchp_sparx5_reset_config(struct platform_device *pdev, + struct mchp_reset_context *ctx) +{ + struct device_node *dn = pdev->dev.of_node; + struct regmap *cpu_ctrl, *gcb_ctrl; + struct device_node *syscon_np; + int err; + + syscon_np = of_parse_phandle(dn, "syscons", 0); + if (!syscon_np) + return -ENODEV; + cpu_ctrl = syscon_node_to_regmap(syscon_np); + if (IS_ERR(cpu_ctrl)) { + err = PTR_ERR(cpu_ctrl); + goto syscon_err; + } + of_node_put(syscon_np); + + syscon_np = of_parse_phandle(dn, "syscons", 1); + if (!syscon_np) + return -ENODEV; + gcb_ctrl = syscon_node_to_regmap(syscon_np); + if (IS_ERR(gcb_ctrl)) { + err = PTR_ERR(gcb_ctrl); + goto syscon_err; + } + of_node_put(syscon_np); + + ctx->cpu_ctrl = cpu_ctrl; + ctx->gcb_ctrl = gcb_ctrl; + + ctx->reset_ctrl.owner = THIS_MODULE; + ctx->reset_ctrl.nr_resets = 1; + ctx->reset_ctrl.ops = &sparx5_reset_ops; + ctx->reset_ctrl.of_node = dn; + + err = devm_reset_controller_register(&pdev->dev, &ctx->reset_ctrl); + if (err) + dev_err(&pdev->dev, "could not register reset controller\n"); + return err; + +syscon_err: + of_node_put(syscon_np); + return err; +} + +static int mchp_sparx5_reset_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct mchp_reset_context *ctx; + + ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); + if (!ctx) + return -ENOMEM; + ctx->dev = dev; + return mchp_sparx5_reset_config(pdev, ctx); +} + +static const struct of_device_id mchp_sparx5_reset_of_match[] = { + { + .compatible = "microchip,sparx5-switch-reset", + }, + { /*sentinel*/ } +}; + +static struct platform_driver mchp_sparx5_reset_driver = { + .probe = mchp_sparx5_reset_probe, + .driver = { + .name = "sparx5-switch-reset", + .of_match_table = mchp_sparx5_reset_of_match, + }, +}; + +static int __init mchp_sparx5_reset_init(void) +{ + return platform_driver_register(&mchp_sparx5_reset_driver); +} + +postcore_initcall(mchp_sparx5_reset_init); + +MODULE_DESCRIPTION("Microchip Sparx5 switch reset driver"); +MODULE_AUTHOR("Steen Hegelund "); +MODULE_LICENSE("Dual MIT/GPL"); From patchwork Thu Jan 14 09:25:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 12018939 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCD94C433DB for ; Thu, 14 Jan 2021 09:27:15 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 7887E23359 for ; Thu, 14 Jan 2021 09:27:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7887E23359 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.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=AhpSAYuDB81zJfn/aeklG+ZzZnhF85jl8UuaHwh7eW8=; b=wTszc+DLh3lSYNA4wN5WJkv6Q sZqYUuONR5U58P5nmvlcdY056vBmwJvVpwN6sUDncMV5mAg2tnAC5Ee/S7bMRSQq5n/xdRsAy9Ej/ 87PVFyRl5O/XpPUu06dytnB7LvuqcyvebLnW6HHfm4wWtm/3latiVCkV7nuU/gQG+xkZhUOlqt5kf qQpNOukxXskT51gJ7GxjBjNOE+dJ5qeg/M4SaHx9zfTKBF2L9vL2JOYUCRkuwJZYlzlFDI7XKhpIN OnAOIVvTBibpZaslxST1Fc9qFC/+J0H2sPnM4+3YTIozdjlwZfjMQ3iGWBcDa3OW16flZ0L8mybOk IrPUqu5nw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kzysm-0003xu-8T; Thu, 14 Jan 2021 09:25:32 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kzysb-0003vP-KN for linux-arm-kernel@lists.infradead.org; Thu, 14 Jan 2021 09:25:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1610616321; x=1642152321; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iidB/SH6YvMVxsRVtLw+6IrKQ/PkSr13r9FBSRtqThk=; b=AGlImDJrj+7R4e6t2afQKOagKcr2U27m6pBJvWfTl/fdcEX0AKMFunM8 1Oo24G3rg1h9ocejYsS0VYM6BAIoIkM01DoOZoI0YD9+wFhwumA1wQRJn Z5RUMJLDGIspgUVexbXg6FszpwX9lh8bkirqlZUBG/0B+TJUnQOqKU7hT mHG4iy8SexztOMHlUbQSjsG3SZdCVDX7PSVnleDePCYfcoCL9A+nuBCKJ l9eIPMxZJ8XNWK7qCk5/LZSjsOI5JzDJh209N8fGzUpVJZlJsqGdTAsrY 8/UM3SOJOZy2Xl4Ud93v3AVf7xIoPj4aT6T9RVdsjiGe0SX6NHfz3izDC A==; IronPort-SDR: QnQUa8puhJcFBU1qQIRUrIuUE6S0onuN3kORZrd3pqkL3f5JiV41KtW0Ki4cKbt78efpeR2vij 5oZf/l42UY+8Vl0/2bqKKZ+sntYs5crCk7BEiQNjH0gK1AbstGGZDLITnkPykYZshVvVCvubO5 jH12IHwwRJQ4VjQJZZfh2EqjHex+jqjRdz66T4z+rIW9Vk00+RdIexW8EWNyaA+SPrXH/fBJ/7 ngEkB+bz2n+ziwiwb5w+a2/a1Z6vRY/O6xTkapHhvT9oAXvo9V53lnx9Aa0pVZJFm23iirtAsY 36Y= X-IronPort-AV: E=Sophos;i="5.79,347,1602572400"; d="scan'208";a="111014978" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Jan 2021 02:25:20 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 14 Jan 2021 02:25:19 -0700 Received: from mchp-dev-shegelun.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Thu, 14 Jan 2021 02:25:17 -0700 From: Steen Hegelund To: Philipp Zabel , Rob Herring Subject: [PATCH v2 3/3] arm64: dts: reset: add microchip sparx5 switch reset driver Date: Thu, 14 Jan 2021 10:25:00 +0100 Message-ID: <20210114092500.2822208-4-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210114092500.2822208-1-steen.hegelund@microchip.com> References: <20210114092500.2822208-1-steen.hegelund@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210114_042521_930197_65892E45 X-CRM114-Status: UNSURE ( 9.81 ) X-CRM114-Notice: Please train this message. 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: Andrew Lunn , Alexandre Belloni , devicetree@vger.kernel.org, Steen Hegelund , linux-kernel@vger.kernel.org, Microchip Linux Driver Support , Gregory Clement , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Signed-off-by: Steen Hegelund --- arch/arm64/boot/dts/microchip/sparx5.dtsi | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/microchip/sparx5.dtsi b/arch/arm64/boot/dts/microchip/sparx5.dtsi index 380281f312d8..6f0a21c362e3 100644 --- a/arch/arm64/boot/dts/microchip/sparx5.dtsi +++ b/arch/arm64/boot/dts/microchip/sparx5.dtsi @@ -132,9 +132,16 @@ mux: mux-controller { }; }; - reset@611010008 { - compatible = "microchip,sparx5-chip-reset"; - reg = <0x6 0x11010008 0x4>; + gcb_ctrl: syscon@611010000 { + compatible = "microchip,sparx5-gcb-syscon", "syscon"; + reg = <0x6 0x11010000 0x10000>; + }; + + reset: reset-controller@0 { + compatible = "microchip,sparx5-switch-reset"; + reg = <0x6 0x0 0x0>; + #reset-cells = <1>; + syscons = <&cpu_ctrl>,<&gcb_ctrl>; }; uart0: serial@600100000 {