From patchwork Thu Oct 28 09:30:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 12589631 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E612C433F5 for ; Thu, 28 Oct 2021 09:32:45 +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 1D2A560EB4 for ; Thu, 28 Oct 2021 09:32:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1D2A560EB4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=pSyYos6GZ9SX7T1gfhhODQ2hqjfLIlVtc/FXXwoVNd0=; b=23CXQH7Nt/Lojp d+EUSKAdvsARxywAwWV4FefyPFHFcejZt4aa7V7LmJ2b4E3z6Gu/lJRnzFLSlgYqcSVplQhYREYYh T/QuctlRZgT8fd6VegPhTSizf4JD47lRwUhi0i+l2lHtXB6SpSZREaC0bg9elN3D9WmP0hWtKd7EM RfZlkmxCw38960mURy/N3I45O9f+AUngsukqmoBzKcQc6RFMvRo4oleIVrrwDmm6DGpyhq0AB/aU2 v0+m4Nd9eKkUU8js3vfm0Rq7Naq0nBBnWIC17LfiYtrRMnxRbB7zmOx9jQykZWAO+cLhPRATmHo8v JvnQV1uP2rmQfYib2obA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mg1kh-007OhM-UX; Thu, 28 Oct 2021 09:31:16 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mg1ke-007Ogc-8J for linux-arm-kernel@lists.infradead.org; Thu, 28 Oct 2021 09:31:13 +0000 Received: by mail-lf1-x132.google.com with SMTP id x27so12248604lfu.5 for ; Thu, 28 Oct 2021 02:31:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GJtTeFua6lj9e76ebkvIivdZ4sX1YjABoZmJlmyJ+/0=; b=nDe/JuovQzaDd3onwK8nvQ84ElOBguBnuH3PSYdw1Ybt/WiMzcd7yP7PZgdonxWMWa uf0rA5R7FfsG1dIbzHw9s7jxcnvhCl8opEmCRoyPfo6PMXift0fN/L6LCHRfXhTU1RV+ R8jaPLf2oBLtMpFMj83oa/0w5QQ6dCF+ecrPOirFrLJIsokKMX8isphE/ecYn+i+BRf8 RbuHPU+e/Dc+IWRXUXBUMQFKekBFcc9Q42WpWRUQzL3PsgigVmONn2YISA5b02Kg7s/N FY0i4pGzEO0IKq+Cgwj0L3bZuF45hQu/1EOGucChLVk7eiuL155AaDakwVx4DNrLznng cY8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GJtTeFua6lj9e76ebkvIivdZ4sX1YjABoZmJlmyJ+/0=; b=qVJq3p4kOFyO+hXSrBgkMdqoNScSMSCGnoN4op7KKC6j/npw03//PaTnfmDk777uHG tiVynMjKLxBc2ujPU75+Pi3uHaAclsiTopeYyKA/0Uko3cLOhPmOwffwa6gcl4XJ8r/C zRIC7Rk9xoTgvcqkqmIP8vXQ898NDyRdZG2esWDQKl3e8XS8xkrGHBem26ugBMhAL2lV 3YsmeTk+qPW0gc5iuzppGkuA20pGt3V+gydMnVAVklErwuXNx/MJTXPV8UgJi8MSgmJR NoLerwHBWPj99fQUOaVgyPXRmzP7W/WrKFaSPA7QUh75jHEKvwpD3NNTOEmSgxyLu70V 1e1g== X-Gm-Message-State: AOAM532cuOfnmiJ8u9FPXjXxJKoYH0JdFd+Q13WWp6BOwP1VUPRvGURI K20QGeKSnQ7ocu2qMbSC05U= X-Google-Smtp-Source: ABdhPJwD/Nmz+HPNfdTuek7uwHRScDFKgOUBd0NBJdoD1GL1DnpA/2l4Mi5CwPF4XTuDQu2bB8/peA== X-Received: by 2002:a05:6512:260e:: with SMTP id bt14mr3078320lfb.129.1635413470075; Thu, 28 Oct 2021 02:31:10 -0700 (PDT) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id o26sm231548ljg.92.2021.10.28.02.31.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 02:31:09 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Wim Van Sebroeck , Guenter Roeck , Rob Herring Cc: Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 1/3] dt-bindings: watchdog: convert Broadcom's WDT to the json-schema Date: Thu, 28 Oct 2021 11:30:57 +0200 Message-Id: <20211028093059.32535-1-zajec5@gmail.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-20211028_023112_324046_CA85849D X-CRM114-Status: GOOD ( 18.72 ) 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 From: Rafał Miłecki This helps validating DTS files. While at it also rename it to bcm63xx. It's the first SoC with that hardware block and it's a naming schema used for other Broadcom blocks. It's common for some (originally) bcm63xx blocks to be reused in newer SoCs (like 7038 or 4908). Signed-off-by: Rafał Miłecki --- .../bindings/watchdog/brcm,bcm63xx-wdt.yaml | 38 +++++++++++++++++++ .../bindings/watchdog/brcm,bcm7038-wdt.txt | 19 ---------- 2 files changed, 38 insertions(+), 19 deletions(-) create mode 100644 Documentation/devicetree/bindings/watchdog/brcm,bcm63xx-wdt.yaml delete mode 100644 Documentation/devicetree/bindings/watchdog/brcm,bcm7038-wdt.txt diff --git a/Documentation/devicetree/bindings/watchdog/brcm,bcm63xx-wdt.yaml b/Documentation/devicetree/bindings/watchdog/brcm,bcm63xx-wdt.yaml new file mode 100644 index 000000000000..9d468026550f --- /dev/null +++ b/Documentation/devicetree/bindings/watchdog/brcm,bcm63xx-wdt.yaml @@ -0,0 +1,38 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/watchdog/brcm,bcm63xx-wdt.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: BCM63xx watchdog timer + +allOf: + - $ref: "watchdog.yaml#" + +maintainers: + - Rafał Miłecki + +properties: + compatible: + const: brcm,bcm7038-wdt + + reg: + maxItems: 1 + + clocks: + description: > + The clock running the watchdog. If no clock is found the driver will + default to 27000000 Hz. + +unevaluatedProperties: false + +required: + - reg + +examples: + - | + watchdog@f040a7e8 { + compatible = "brcm,bcm7038-wdt"; + reg = <0xf040a7e8 0x16>; + clocks = <&upg_fixed>; + }; diff --git a/Documentation/devicetree/bindings/watchdog/brcm,bcm7038-wdt.txt b/Documentation/devicetree/bindings/watchdog/brcm,bcm7038-wdt.txt deleted file mode 100644 index 84122270be8f..000000000000 --- a/Documentation/devicetree/bindings/watchdog/brcm,bcm7038-wdt.txt +++ /dev/null @@ -1,19 +0,0 @@ -BCM7038 Watchdog timer - -Required properties: - -- compatible : should be "brcm,bcm7038-wdt" -- reg : Specifies base physical address and size of the registers. - -Optional properties: - -- clocks: The clock running the watchdog. If no clock is found the - driver will default to 27000000 Hz. - -Example: - -watchdog@f040a7e8 { - compatible = "brcm,bcm7038-wdt"; - clocks = <&upg_fixed>; - reg = <0xf040a7e8 0x16>; -}; From patchwork Thu Oct 28 09:30:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 12589633 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFFFEC433EF for ; Thu, 28 Oct 2021 09:32:45 +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 7E14F60EB4 for ; Thu, 28 Oct 2021 09:32:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7E14F60EB4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=02YYxV/ZD5Iqbvfy55D5H4PB6f2bzUYarA6ZjClb/Eo=; b=NL0pRCUKC890uY 43D9T2Ny/BWQSTzyCqhol5h6J9q4GF5qH0tjpphF+B7Nq0U8hAUBG/KVBj2e2k0x0Pt5UQUI7konJ WqIRO26IoevssAEyUgGYo3pyqL2W8sZfplEPdx5eLt24gN5daSA5lJ71Z3NPBhiZJ3gnBt/06Ibcy qjPO4hA0lp91ir9ZbI80tFF2VfXlP8U8ZpouDjR4Kw6ZA62J8aSpt9EAIBeJlLneJP85Yszj56Uwk kIY7PCDSloEKE5ODBuQoelTrvGtKTxDe9v3Fz2Ib9p2EhAeONmWmNVgHTIw8Jj4kvupijldlnIG4r EdFI7xuwCj9+dKZlhxtw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mg1kt-007OjJ-AL; Thu, 28 Oct 2021 09:31:27 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mg1kg-007Oh4-SS for linux-arm-kernel@lists.infradead.org; Thu, 28 Oct 2021 09:31:16 +0000 Received: by mail-lj1-x236.google.com with SMTP id u5so9567227ljo.8 for ; Thu, 28 Oct 2021 02:31:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xmZKVrMbuwj9PIbfM/9dtEHCrT9YdEntWT50WYrakpc=; b=DXQgOR1Ay9+kyvZHUoTPZJHgETrMcIxpg0h44kk8X0jTJ9GMEVXs9bMmOi9XSvbq1Z OWDXluKsLUyPFGePPWBmndcBenJNipPhr25okQKChxd6Jyn05ZQathAM7pyBVsHYyhji yw0/+rFLWN+8SrFWABKfba+Jj702WosTGW3gX8h2yHJ5xL7tbPLrzed0SE9yGWRAObfo vWAz6iNMR4UeMUfomJfXYc3wBx7PdqTnVGQJ3TcE5GYXk7P+4/mhE/OBd098NlSNA+JA +P5JoWxgA++KMoaYZXrHY6Kfo71ABJKc5ef7WTGdlQWq+JiY2TzE1qhVr68d8IDKgSZ3 Bfdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xmZKVrMbuwj9PIbfM/9dtEHCrT9YdEntWT50WYrakpc=; b=hxcaJOT8oYcxp3vJBsT/yGpf6w9uDp2mhmNYAQ9bQ/JrtL2TbpigSiSOjyVFRvH1qu /2bBqmW8gYwCdHvBjhiFbzfzyqSCWBC7P3qPac+OWU71As5V04Yqf+7FLDmSm52Yv8e8 IlhdEkUUcTjbegjj71lV/a0Fhp8s8xyANZRL2lEp1wMpjJ1amfmyHceG2CI+fZ1H9dN1 XaITaPReCBWXo02HJf3wRVhya07Ld+eOnjTdaPynsX7/lmyFxyTd4+ujhSN+UY1jov93 R2GV8UbjclqS7cNGYCFnwAb4h/+J4H3oL1IDLF1Sbq78Q3vet16jyPExYG8vJkgZUt8f k1pg== X-Gm-Message-State: AOAM531aZJImgiaGXbIoxa3WUPr/ox8v9djjvqwWZv74/FXawCgpWnyz M2D4o/A0AhU6J9l9I2jYrhY= X-Google-Smtp-Source: ABdhPJwV3txWjWJsSgBLiFcV1rPPej4Z2ZiHKIEFlNkZKv83v+j7ie1EZ2FtWOdloVZMG8EBx4IhkQ== X-Received: by 2002:a05:651c:1194:: with SMTP id w20mr3533842ljo.303.1635413472870; Thu, 28 Oct 2021 02:31:12 -0700 (PDT) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id o26sm231548ljg.92.2021.10.28.02.31.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 02:31:12 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Wim Van Sebroeck , Guenter Roeck , Rob Herring Cc: Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 2/3] dt-bindings: watchdog: brcm, bcm63xx-wdt: add BCM4908 compatibility Date: Thu, 28 Oct 2021 11:30:58 +0200 Message-Id: <20211028093059.32535-2-zajec5@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211028093059.32535-1-zajec5@gmail.com> References: <20211028093059.32535-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211028_023114_968973_037C4349 X-CRM114-Status: GOOD ( 12.85 ) 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 From: Rafał Miłecki BCM4908 is another SoC with the same hardware block. It just uses a slightly different registers layout. Signed-off-by: Rafał Miłecki --- .../devicetree/bindings/watchdog/brcm,bcm63xx-wdt.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/watchdog/brcm,bcm63xx-wdt.yaml b/Documentation/devicetree/bindings/watchdog/brcm,bcm63xx-wdt.yaml index 9d468026550f..4391af0c9698 100644 --- a/Documentation/devicetree/bindings/watchdog/brcm,bcm63xx-wdt.yaml +++ b/Documentation/devicetree/bindings/watchdog/brcm,bcm63xx-wdt.yaml @@ -14,7 +14,9 @@ maintainers: properties: compatible: - const: brcm,bcm7038-wdt + enum: + - brcm,bcm4908-wdt + - brcm,bcm7038-wdt reg: maxItems: 1 From patchwork Thu Oct 28 09:30:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 12589635 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5B25C433EF for ; Thu, 28 Oct 2021 09:33:00 +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 91E7060EB4 for ; Thu, 28 Oct 2021 09:33:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 91E7060EB4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=Rx1D5zNgkp8cAVioLvGYDzrzwLdMOJTsWubrQjTb+20=; b=FvpYFbEVfOFbNg 2+KhybiLDMNJwrZ8WyREA25GTJmeQStoawvtCVp5zAWpfLxY2Kem16AHZQF0VpxGm332/KG6IGBTd C4xULaBBU3R8TNsLqDczAob4xIOifum9SjazZ9+le8UixawanNr0sbsytMby7Lg9eQsk/CV+OPY1x AIB/wd54Xij71eLvP2BSzL9TY4pw289oKidoFHVWPto6Mvtlfytj2YZuG6wvnL/O4BXAt7CpqGNtV GfSdYUduXn9ihE9T6QWQfQXJRCHmp6Wa+wH1U8a6SCrrrI9E/0Ndj++9UGT4dPwfKwW397JYZ9rhz L5ke32X0RDoJaak8Vctg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mg1l5-007OlN-Pa; Thu, 28 Oct 2021 09:31:40 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mg1kj-007Ohl-GO for linux-arm-kernel@lists.infradead.org; Thu, 28 Oct 2021 09:31:19 +0000 Received: by mail-lf1-x12e.google.com with SMTP id j9so12222199lfu.7 for ; Thu, 28 Oct 2021 02:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5SCRR+E6hGA2qUYlZFUC09MM/t1uJnD/XLaVJ8yfNfk=; b=DIPttbwdnzYKTfXlI6MpZLACsySVnJjafi/Cj4futVxmFjkow5Tup11a5aSutu7COq FatUpMi61V6yWEoPZzhaBLMIXpJWkOFJ4R+UESLPOZ+yCzoPeZQZ67U6ElGS2o2lr7rE fMtMgxdDn0w3ksR0+aWxjPBJOlR548utKKa4PAuURNr4s35RCgHTMCjB3Wn4lAe5U2cZ jR4DTITlTVOjxWRBvn0JNWcPycCnS9KJm8vkHqYSeb6oVj1a3+klyPhFaTeiSiT+TYO4 3gJ54Mz2nm1fC7pQOAYxjRhgP+vOvEV4mdPOK/sRPID8Q/nkyXa77hGmLf8w7wffQy5/ /7Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5SCRR+E6hGA2qUYlZFUC09MM/t1uJnD/XLaVJ8yfNfk=; b=zYqzAAFRNyyfWZ8if9EyPLIYaxJoqUDYAQvyFVZDDHua9AN9PZxYFyZCPBlkejqw2Q STDTBalwM4ZFcDcJzcRO6TQXmKr7oJ0BsbC/GL0cn/D7WnLG+1Vbcr0/+M2qCQkvv3Kl lU0VwWSi7puz2qBqjcN17JM5+tLP4cYVcb2oxmD69exeP57x3zshvgJVlMXc3dlXiB0I AsqQ64yhGQP3y+XFOrsp6i8RFddwvuMKUwntvJD9gUw6yO3/8q2H2/GnO8A5fvM+bv+O gwsWNIGRrtgLyW0slvoE1VEoLENxHh9Qo5Nx+riB1CMpHpKrzC5ZabZbhS83W9NwUZU8 LADw== X-Gm-Message-State: AOAM531SV3b5yA6mNgqR/VYDdT1JxnFMnfiMJrOfM2OBqaC63x02aeKQ AwAK3WLCLNDMFwo8eUe+soQ= X-Google-Smtp-Source: ABdhPJzHdKxqhsU7CoH1gvpFRrC1HQosEE7pvQ3GRH5o89V/kvy/XsJXdCk2D7WOcoxrEq+EL13rlQ== X-Received: by 2002:a05:6512:3049:: with SMTP id b9mr3103568lfb.660.1635413475449; Thu, 28 Oct 2021 02:31:15 -0700 (PDT) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id o26sm231548ljg.92.2021.10.28.02.31.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 02:31:15 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Wim Van Sebroeck , Guenter Roeck , Rob Herring Cc: Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 3/3] watchdog: bcm7038_wdt: support BCM4908 SoC Date: Thu, 28 Oct 2021 11:30:59 +0200 Message-Id: <20211028093059.32535-3-zajec5@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211028093059.32535-1-zajec5@gmail.com> References: <20211028093059.32535-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211028_023117_600849_BE8D3F85 X-CRM114-Status: GOOD ( 24.65 ) 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 From: Rafał Miłecki Hardware supported by this driver goes back to the old bcm63xx days. It was then reused in BCM7038 and later also in BCM4908. Depending on SoC model registers layout differs a bit. This commit introduces support for per-chipset registers offsets & adds BCM4908 layout. Later on BCM63xx SoCs support should be added too (probably as platform devices due to missing DT). Eventually this driver should replace bcm63xx_wdt.c. Signed-off-by: Rafał Miłecki --- drivers/watchdog/Kconfig | 2 +- drivers/watchdog/bcm7038_wdt.c | 89 ++++++++++++++++++++++++++-------- 2 files changed, 69 insertions(+), 22 deletions(-) diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index bf59faeb3de1..324aa942b182 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -1756,7 +1756,7 @@ config BCM7038_WDT tristate "BCM7038 Watchdog" select WATCHDOG_CORE depends on HAS_IOMEM - depends on ARCH_BRCMSTB || BMIPS_GENERIC || COMPILE_TEST + depends on ARCH_BCM4908 || ARCH_BRCMSTB || BMIPS_GENERIC || COMPILE_TEST help Watchdog driver for the built-in hardware in Broadcom 7038 and later SoCs used in set-top boxes. BCM7038 was made public diff --git a/drivers/watchdog/bcm7038_wdt.c b/drivers/watchdog/bcm7038_wdt.c index acaaa0005d5b..352689f869c1 100644 --- a/drivers/watchdog/bcm7038_wdt.c +++ b/drivers/watchdog/bcm7038_wdt.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -18,14 +19,17 @@ #define WDT_STOP_1 0xee00 #define WDT_STOP_2 0x00ee -#define WDT_TIMEOUT_REG 0x0 -#define WDT_CMD_REG 0x4 - #define WDT_MIN_TIMEOUT 1 /* seconds */ #define WDT_DEFAULT_TIMEOUT 30 /* seconds */ #define WDT_DEFAULT_RATE 27000000 +enum bcm63xx_wdt_soc { + BCM63XX_WDT_SOC_BCM4908, + BCM63XX_WDT_SOC_BCM7038, +}; + struct bcm7038_watchdog { + enum bcm63xx_wdt_soc soc; void __iomem *base; struct watchdog_device wdd; u32 rate; @@ -34,8 +38,52 @@ struct bcm7038_watchdog { static bool nowayout = WATCHDOG_NOWAYOUT; -static inline void bcm7038_wdt_write(u32 value, void __iomem *addr) +static const struct of_device_id bcm7038_wdt_match[] = { + { .compatible = "brcm,bcm4908-wdt", .data = (const void *)BCM63XX_WDT_SOC_BCM4908, }, + { .compatible = "brcm,bcm7038-wdt", .data = (const void *)BCM63XX_WDT_SOC_BCM7038, }, + {}, +}; +MODULE_DEVICE_TABLE(of, bcm7038_wdt_match); + +enum bcm7038_wdt_regs { + BCM63XX_WDT_REG_DEFVAL = 0, + BCM63XX_WDT_REG_CTL, + BCM63XX_WDT_REG_SOFTRESET, +}; + +static const u16 bcm7038_wdt_regs_bcm4908[] = { + [BCM63XX_WDT_REG_DEFVAL] = 0x28, + [BCM63XX_WDT_REG_CTL] = 0x2c, + [BCM63XX_WDT_REG_SOFTRESET] = 0x34, +}; + +static const u16 bcm7038_wdt_regs_bcm7038[] = { + [BCM63XX_WDT_REG_DEFVAL] = 0x00, + [BCM63XX_WDT_REG_CTL] = 0x04, +}; + +static void __iomem *bcm7038_wdt_reg_addr(struct watchdog_device *wdog, + enum bcm7038_wdt_regs reg) { + struct bcm7038_watchdog *wdt = watchdog_get_drvdata(wdog); + void __iomem *addr = wdt->base; + + switch (wdt->soc) { + case BCM63XX_WDT_SOC_BCM4908: + return addr + bcm7038_wdt_regs_bcm4908[reg]; + case BCM63XX_WDT_SOC_BCM7038: + return addr + bcm7038_wdt_regs_bcm7038[reg]; + default: + WARN_ON(1); + return NULL; + } +} + +static void bcm7038_wdt_write(struct watchdog_device *wdog, + enum bcm7038_wdt_regs reg, u32 value) +{ + void __iomem *addr = bcm7038_wdt_reg_addr(wdog, reg); + /* MIPS chips strapped for BE will automagically configure the * peripheral registers for CPU-native byte order. */ @@ -45,8 +93,11 @@ static inline void bcm7038_wdt_write(u32 value, void __iomem *addr) writel_relaxed(value, addr); } -static inline u32 bcm7038_wdt_read(void __iomem *addr) +static inline u32 bcm7038_wdt_read(struct watchdog_device *wdog, + enum bcm7038_wdt_regs reg) { + void __iomem *addr = bcm7038_wdt_reg_addr(wdog, reg); + if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)) return __raw_readl(addr); else @@ -60,15 +111,13 @@ static void bcm7038_wdt_set_timeout_reg(struct watchdog_device *wdog) timeout = wdt->rate * wdog->timeout; - bcm7038_wdt_write(timeout, wdt->base + WDT_TIMEOUT_REG); + bcm7038_wdt_write(wdog, BCM63XX_WDT_REG_DEFVAL, timeout); } static int bcm7038_wdt_ping(struct watchdog_device *wdog) { - struct bcm7038_watchdog *wdt = watchdog_get_drvdata(wdog); - - bcm7038_wdt_write(WDT_START_1, wdt->base + WDT_CMD_REG); - bcm7038_wdt_write(WDT_START_2, wdt->base + WDT_CMD_REG); + bcm7038_wdt_write(wdog, BCM63XX_WDT_REG_CTL, WDT_START_1); + bcm7038_wdt_write(wdog, BCM63XX_WDT_REG_CTL, WDT_START_2); return 0; } @@ -83,10 +132,8 @@ static int bcm7038_wdt_start(struct watchdog_device *wdog) static int bcm7038_wdt_stop(struct watchdog_device *wdog) { - struct bcm7038_watchdog *wdt = watchdog_get_drvdata(wdog); - - bcm7038_wdt_write(WDT_STOP_1, wdt->base + WDT_CMD_REG); - bcm7038_wdt_write(WDT_STOP_2, wdt->base + WDT_CMD_REG); + bcm7038_wdt_write(wdog, BCM63XX_WDT_REG_CTL, WDT_STOP_1); + bcm7038_wdt_write(wdog, BCM63XX_WDT_REG_CTL, WDT_STOP_2); return 0; } @@ -107,7 +154,7 @@ static unsigned int bcm7038_wdt_get_timeleft(struct watchdog_device *wdog) struct bcm7038_watchdog *wdt = watchdog_get_drvdata(wdog); u32 time_left; - time_left = bcm7038_wdt_read(wdt->base + WDT_CMD_REG); + time_left = bcm7038_wdt_read(wdog, BCM63XX_WDT_REG_CTL); return time_left / wdt->rate; } @@ -134,6 +181,7 @@ static void bcm7038_clk_disable_unprepare(void *data) static int bcm7038_wdt_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; + const struct of_device_id *of_id; struct bcm7038_watchdog *wdt; int err; @@ -143,6 +191,11 @@ static int bcm7038_wdt_probe(struct platform_device *pdev) platform_set_drvdata(pdev, wdt); + of_id = of_match_device(bcm7038_wdt_match, dev); + if (!of_id) + return -EINVAL; + wdt->soc = (enum bcm63xx_wdt_soc)of_id->data; + wdt->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(wdt->base)) return PTR_ERR(wdt->base); @@ -211,12 +264,6 @@ static int bcm7038_wdt_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(bcm7038_wdt_pm_ops, bcm7038_wdt_suspend, bcm7038_wdt_resume); -static const struct of_device_id bcm7038_wdt_match[] = { - { .compatible = "brcm,bcm7038-wdt" }, - {}, -}; -MODULE_DEVICE_TABLE(of, bcm7038_wdt_match); - static struct platform_driver bcm7038_wdt_driver = { .probe = bcm7038_wdt_probe, .driver = {