Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp198263pxb; Wed, 18 Nov 2020 02:03:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmlH+0Xd/06he+BP3TAreq9MyITnFCri7X0W4M86yBVRxaSr3JN0hkgypWEAkC+fvXOwe7 X-Received: by 2002:a17:906:82d9:: with SMTP id a25mr22917139ejy.101.1605693810371; Wed, 18 Nov 2020 02:03:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605693810; cv=none; d=google.com; s=arc-20160816; b=HhhUUwE08g1H7LMFHhG9JaSCurDeDLlczOgZ+VUaPvms2UoMAvrqrlTUhVDl5LLX3+ JA76CEp2FEXFjO0F8CajilekUNvEqekA677HhZ+JYi9HRRudsRzRsb65Wuy1vLR8oIsE m6DCq5obWQ9lCjqF63EABEZnekq+uUJSdwljsE/prZ6AP9Wi/lX7LYGC5JkwE23OKDQ/ PpklTJs+xbFyk0VE32q8H2EMrwEsiF7MA3DW851yVwnrt61tDyknZ5jPQqsj7PyMGSbz GqM1rdrJ4Fy31QznW9paRQGrKjfT2fHyI4QcvrRHK9B/l6VjDmLr8wzpV2kb40lsvlYk sB8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=85NMdVQeKNd5EmnASFsFb7aPMLIBT8oL3Ek2DfmPY/8=; b=DFJXnYE2oRaBi9KrpaNQ3c2Swmg8t/prsgvLy37Q7m9nbLBYwNIH4hNT7Fr3uDaa80 kagfxeuDD2XdlvO0bEkusR+SWGpaDMtRZRWx6AiUzwserM0a4YWWTSYCZFE1TJC3MtVN WcCcrUhW8n2v6mhqkblOcu+5srqGpBwBwrQVgUFnQRP5YzEEXa0xFQijZVmIGgqlEgjI JNjMhQ2RBgR8jiIOX7yKP5j/NEBRLYicS+ovTXQ5YcW6G5n7AQ6G7jkyApcyuhpQ1nv6 NhLU43V6FHG+nrtxjpgHBqZxXpxxV0I5WYdVyoKNguDm/eGtYSYPZQ8xLxqQm34wwNHW l5eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=JkOgY0UZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e18si14197562eje.132.2020.11.18.02.03.07; Wed, 18 Nov 2020 02:03:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=JkOgY0UZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726397AbgKRKB2 (ORCPT + 99 others); Wed, 18 Nov 2020 05:01:28 -0500 Received: from mout01.posteo.de ([185.67.36.65]:34294 "EHLO mout01.posteo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725790AbgKRKB2 (ORCPT ); Wed, 18 Nov 2020 05:01:28 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 16840160065 for ; Wed, 18 Nov 2020 11:01:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1605693685; bh=v8UAjGpio2L3U6uefLm3bgiYOb0YO6gUIAJEPaPwEk0=; h=Date:From:To:Cc:Subject:From; b=JkOgY0UZInV7o8/9YXe076aOBo6gK8Hg3WZgBnK3BXcoclbbkbVO8Du06Nx8bnNTv fFh2NNijb0UZswbWbshHtAwou/dpdjkUi/q6dunSXP3PEufXPZb/DEMwr9vtGATDZ5 +y7DtrcuwD4kj8RPpzd18A2zEVZA9aftchu6REshq2jrudlme9pBhqiKX/E55YWsrx s85DrIYqh5FYhVNjFq5zLp4dz4D+ss96FO9MchA5E8wx0ipg1XzFg6rTjc7g5Mc/oV IOD9nozHJNW2RztQhpO22MkOURB+teFH5D0+xWT0EwqafaZheHL1lZL0V9tucE5RXm WaR0R4fC8MSrg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Cbdcf5pbKz6tm5; Wed, 18 Nov 2020 11:01:22 +0100 (CET) Date: Wed, 18 Nov 2020 11:01:21 +0100 From: Wilken Gottwalt To: linux-kernel@vger.kernel.org Cc: Ohad Ben-Cohen , Bjorn Andersson , Baolin Wang , Rob Herring , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec Subject: [PATCH 0/2] hwspinlock: add sunxi hardware spinlock support Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Most of the Allwinner SoCs contain a spinlock unit which can be used for synchronization/locking between different subsystems. According to the several Allwinner datasheets most of the sun8i and sun50i SoCs share the same hardware with at least 32 (32bit wide) registers for 32 spinlocks. The implemented spinlock hardware can support 32, 64, 128 or 256 registers. This driver supports all four register bank sizes and also provides some additional information via debugfs. The driver can be build by setting the HWSPINLOCK_SUNXI symbol and can be also compiled as module. This patch adds the driver for this hardware and updates the hwlock documentation on how to use it. According to the datasheets the H2+, H3, H5 and H6 SoCs share exactly the same spinlock hardware. But I'm pretty sure that the whole sun8i family has the same hardware. The sun50i family may be a different story. The H616 is missing the whole spinlock part in the datasheets, so I assume this is a sun50i part that does not support hwspinlocks. The driver itself is not yet enabled in the devicetree files of the H2/H3, H5 and H6 SoCs, because for now I'm only able to test the driver against a H2+ device (OrangePi Zero). This patch adds: - hwspinlock driver sunxi_hwspinlock - hwspinlock dt bindings documentation - updates MAINTAINERS Signed-off-by: Wilken Gottwalt Wilken Gottwalt (2): dt-bindings: hwlock: sunxi: add sunxi_hwspinlock documentation hwspinlock: add sunxi hardware spinlock support .../bindings/hwlock/sunxi-hwspinlock.yaml | 64 ++++ MAINTAINERS | 6 + drivers/hwspinlock/Kconfig | 9 + drivers/hwspinlock/Makefile | 1 + drivers/hwspinlock/sunxi_hwspinlock.c | 282 ++++++++++++++++++ 5 files changed, 362 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwlock/sunxi-hwspinlock.yaml create mode 100644 drivers/hwspinlock/sunxi_hwspinlock.c -- 2.29.2