From patchwork Thu Jan 14 16:24:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 12020209 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_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,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 0C90BC433E0 for ; Thu, 14 Jan 2021 16:26:00 +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 BF2AB22B2B for ; Thu, 14 Jan 2021 16:25:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF2AB22B2B 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: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:In-Reply-To:References:List-Owner; bh=6m1sl2oFKPY0JSRpn1LA566cYAPnRn+awvXbTxscAkg=; b=JkwwEJEIgKWwVFDhJxAvufWYLM tBxPADL36ag18tPA6ObYKLTRlYkZ3RImOW75tMU+wBKnT4CaQJCRKgMvGlPERmU9C1H5EQY/9FDCF RaDbbcWFQNyBVWMWYhci+KpTnhA51AIQDJnoGC+o/WDtQdVWDOoMF3aZZihg1ieZxHICDmEk/Fr6S uIWJ9GhzVR9oecO1g3EzQiYq2w2NcBu80QLcrGyDxWs0w7a6mPtUd5GZpn0Mxc0jKm3X3dAZJn2LI RINOe9SIsqr8yTbOTNuFgI4MsRe15MNp76McgWIU3RWtmVsxa6OpihM/T3/3MUwbiWDQYNGJ28an5 Si5eWwSw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l05QW-0000pa-QD; Thu, 14 Jan 2021 16:24:48 +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 1l05QR-0000nU-Bu for linux-arm-kernel@lists.infradead.org; Thu, 14 Jan 2021 16:24:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1610641483; x=1642177483; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=GRKQZk3reL+yFIk84UhkwWjIL34yFjzkRsFwyfLowZ4=; b=01YaKHMFsLhV6/eJoAfPSWCQT3Sk2+jah6WhBrkZTpnBALIvIdDFnzjr NUs7d0x98xFv//bzQVrbxLkyL9narGQ3ASr4EWouxCXL3LhdTYpMXOBa+ 2fM4zEqRAbZPSFsG0ocolywAf/XIrHcifpTlJd47YQoN3Caag7hr7bxfz pp0CI2YCkonjf69CJ9I1mjJH/vuX90yLIJPxh2bflhRyYLrUex7G0f4Xs 0n0+NiMq4NF4yPBiVHXqmfmqrA1bro871q3k5+zw8DxpzcfgEpbO7NnhL uqKTuc4YtSrcYPhQfRKhPsDD6piJMwgdvSPP1pO4Nqi3M4mlRM6HF5/BH g==; IronPort-SDR: 2t8mbM6CD555mZgsyC5FhpZLOkabEA2Gudy5CWufhmC147YTlOGTVsgIuIk9z3tg5BG4u20S7F w/zgjZ0d4seKqLEdhlwdHUyPofI68n1XWLxzqx/+RvwXI6RZpWU30npVDuqOWI1qC/RvvC4+SX d+OdooYJVc4hJbJnCdWlBxkUC5lkH7YIV4ZvOUZqWXvxlQlNawQJAVjsbLEHzyLyPyciO/0gUd zNcKiCw5ZLJTzrNS6mjErRT/Tz4dbCN4SeSBF9ZS6USRdEL3XhQxWv4Ac/f05T+4t3pPqKHwsA qOo= X-IronPort-AV: E=Sophos;i="5.79,347,1602572400"; d="scan'208";a="105991452" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Jan 2021 09:24:40 -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 09:24:39 -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 09:24:37 -0700 From: Steen Hegelund To: Philipp Zabel Subject: [PATCH v3 0/3] Adding the Sparx5 Switch Reset Driver Date: Thu, 14 Jan 2021 17:24:29 +0100 Message-ID: <20210114162432.3039657-1-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210114_112443_607263_2A089487 X-CRM114-Status: GOOD ( 13.17 ) 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 This series provides the Microchip Sparx5 Switch Reset Driver The Sparx5 Switch SoC has a number of components that can be reset individually, but at least the Switch Core needs to be in a well defined state at power on, when any of the Sparx5 drivers starts to access the Switch Core, this reset driver is available. The reset driver is loaded early via the postcore_initcall interface, and will then be available for the other Sparx5 drivers (SGPIO, SwitchDev etc) that are loaded next, and the first of them to be loaded can perform the one-time Switch Core reset that is needed. The driver has protection so that the system busses, DDR controller, PCI-E and ARM A53 CPU and a few other subsystems are not touched by the reset. The Sparx5 Chip Register Model can be browsed at this location: https://github.com/microchip-ung/sparx-5_reginfo History: v2 - v3: Removed unused headers Renamed the reset controller dev member. Use regmap_read_poll_timeout instead of polling a function. Used two separate syscon entries in the binding Simplified the syscon error handling. Simplified the devm_reset_controller_register error handling. Moved the contents of the mchp_sparx5_reset_config function into the probe function. v1 - v2: Removed debug prints Changed the error handling to save the error code before jumping. Steen Hegelund (3): dt-bindings: reset: microchip sparx5 reset driver bindings reset: mchp: sparx5: add switch reset driver arm64: dts: reset: add microchip sparx5 switch reset driver .../bindings/reset/microchip,rst.yaml | 59 +++++++++ arch/arm64/boot/dts/microchip/sparx5.dtsi | 14 +- drivers/reset/Kconfig | 8 ++ drivers/reset/Makefile | 1 + drivers/reset/reset-microchip-sparx5.c | 120 ++++++++++++++++++ 5 files changed, 199 insertions(+), 3 deletions(-) create mode 100644 Documentation/devicetree/bindings/reset/microchip,rst.yaml create mode 100644 drivers/reset/reset-microchip-sparx5.c