From patchwork Fri Apr 16 08:40:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 12207183 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=-16.8 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=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 66FE3C433B4 for ; Fri, 16 Apr 2021 09:08:02 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 D1DA06113B for ; Fri, 16 Apr 2021 09:08:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1DA06113B 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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=e5NnGUYsDrCHIXRflpLX6UZstG15e6l4hGFOY+KNTa8=; b=BPL1JfjNbaGwXzCpCVcsiU4abW cN/NeZGANe2w4+oU1WPYXM/pRKwm3CSC1bdbjTVVMQ/ns7uQPO++iCXBexWwVvBxJdgEC/6Z+ZosG WqFRQeeRSJqQ+gGouDcaYR8aXu0YLQJV/SIo7ttCoEy7SduEiJKCOGy2X7TGrBOBIHFqbhmGYD30l 8SG4dOrjT9UaMuggVNk6BXo/xYlkm+G5nHMwysn+/cKR480DDM/Hc32aqvpPEBthHxyt2VwOQYPRG VrPKvm0Zls564uDc3cT6ezatzYh+3gIyPELAGRQzbTjYsRsGpEpdTFHVBUdLU8xG1CDbDg+sJdoip lcKwyhxA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lXKPU-001TXs-Gi; Fri, 16 Apr 2021 09:05:08 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lXK2E-001OrT-BR for linux-arm-kernel@desiato.infradead.org; Fri, 16 Apr 2021 08:41:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type: Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From: Sender:Reply-To:Content-ID:Content-Description:In-Reply-To:References; bh=Cj+F1AQlB5DMAd88EsEhl48Kx5CMQAVVHeeE2e1c4fE=; b=VWVql0nO4+kL2WkrUL+8Z57Sq+ Z47oYJX+2N4SJEOO3c8plLpJFynN6gWN1RBHls0Cc3K2MzMh/nm5xvmx2jCnaJWcfsBzPn+I64TM0 AqNsi/oNHOEuSiiaP6SIs0rIH7hVLW3q/68reCotFO27mc/PprXh1aR4+hVje4XVl1/cm8ulL4KeT q+mU6jjSBNiVKXB6EkKSwAvoOqsazBO0DYvwKD2COuW0ck7GBZKlTtVGEl+oKsyMBsLLMybhOUoRZ OszS+FSn8+wQ1t5RGfd5Xk/x6eXWCZZ2ZpzweVYtt1TC6hEBR/WrepScRIe3qsF3rtDev+JadFB+U JYQp1RJQ==; Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lXK2A-009CeZ-MX for linux-arm-kernel@lists.infradead.org; Fri, 16 Apr 2021 08:41:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1618562462; x=1650098462; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=hRZGwHEW2Rm+EIdp1pn2NibgsC3B9G1O3PvlTho8hO8=; b=E1pPkXgA3f0j7loVPLN6PeE+oA/uCVHgb5xUUmNN67jjsHQz35WRq7c2 iU2zAJJHxmPqF62yOyRIhUz9HSd/hvhs+FoNtEkhkWFNyb+bRCtLiH37j 0M2dNXoFU5D1FZq5wBp0J7Bg+9qmBqu4U5VNNGz18Ry+l1j7gd+wGCIGJ bG9BPNCA9mZIsMvDibseiqvGwLZAlRu/gXAapAeNZVtQJGtx9ZxUn0O7F QTHSZdKIymzpn9UdZ4GcBNhD/LVOSlHMGv1Y2XsN3rYMNMrewY1JjomHt T2iuZEOsOF14QgZmP8xvacQ2bLZ1VnpWm4jUtNfSnFnIfgIaTrRegS8w8 Q==; IronPort-SDR: v9ZcpGo82jKi9ccqofEILvEnIrvO8kR9/UusQ5tOg7XK7z+Ggfv0Qz7jxHGwEr9lVmffkh8hfM 7vBEHN+NVLdnBU4DbYXtqlLkMQ9hgZI3AZnaBJL1D/UK8pb5aooedMKClE74n1+taKp3JxVPTv h+mfvauHX9EHEGOWUOUMjKgSzcMSSI9+o9k5kdi83Ql8xOUq1pYaaKRMIJBf6vjvSr8GGddq9V gefODKv6DtA65Uj55iRPJ4OBhIVbMqJCWcc4izC/sAJ97+NhUtmRJL0Is+kTg/yBHtjvjP1Phw lpA= X-IronPort-AV: E=Sophos;i="5.82,226,1613458800"; d="scan'208";a="113816631" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 16 Apr 2021 01:40:59 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 16 Apr 2021 01:40:58 -0700 Received: from mchp-dev-shegelun.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Fri, 16 Apr 2021 01:40:57 -0700 From: Steen Hegelund To: Philipp Zabel CC: Steen Hegelund , Andrew Lunn , Microchip Linux Driver Support , Alexandre Belloni , Gregory Clement , , Subject: [PATCH v9 0/3] Adding the Sparx5 Switch Reset Driver Date: Fri, 16 Apr 2021 10:40:51 +0200 Message-ID: <20210416084054.2922327-1-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210416_014102_868288_57D45AE5 X-CRM114-Status: GOOD ( 16.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Sparx5 will no longer use the existing Ocelot chip reset driver, but use this new switch reset driver as it has the reset controller interface that allows the first client to perform the reset on behalf of all the Sparx5 component drivers. The Sparx5 Chip Register Model can be browsed at this location: https://github.com/microchip-ung/sparx-5_reginfo and the datasheet is available here: https://ww1.microchip.com/downloads/en/DeviceDoc/SparX-5_Family_L2L3_Enterprise_10G_Ethernet_Switches_Datasheet_00003822B.pdf History: v8 -> v9 Added reviewed-by tag. v7 -> v8 Updated the commit descriptions to explain the change from using the existing Ocelot chip reset driver to use a new switch reset driver. v6 -> v7 Use devm_platform_get_and_ioremap_resource to get the IO range. Rebase on v5.12-rc1 v5 -> v6 Using the existing CPU syscon for reset protection and add a small IO range for the GCB Reset Register. v4 -> v5 Changed the two syscons into IO ranges and updated the bindings to reflect this change. v3 -> v4 Added commit message descriptions 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 | 58 +++++++ arch/arm64/boot/dts/microchip/sparx5.dtsi | 7 +- drivers/reset/Kconfig | 8 + drivers/reset/Makefile | 1 + drivers/reset/reset-microchip-sparx5.c | 146 ++++++++++++++++++ 5 files changed, 218 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/reset/microchip,rst.yaml create mode 100644 drivers/reset/reset-microchip-sparx5.c