From patchwork Mon Aug 14 10:16:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xingyu Wu X-Patchwork-Id: 13608 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp2655213vqi; Mon, 14 Aug 2023 03:46:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEdrVjQ8VznmV4D7p9IL9SHwUlqgeAOZGPynmztaBXPMGjGMDxOfTtdeVS6qyUlbagmOLk/ X-Received: by 2002:aa7:d718:0:b0:522:57d9:6553 with SMTP id t24-20020aa7d718000000b0052257d96553mr8252242edq.1.1692010007390; Mon, 14 Aug 2023 03:46:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692010007; cv=none; d=google.com; s=arc-20160816; b=lPh3hDX2QUvBomhnww2UItKw6hLerAwUQVlljFvroiTubtGKSle/zVPiILUwP/vTmY riBWNynVR30T4VLlgdWvwc/S6j2ETfDtg+7OcGdwU4m9eiPz+h6QLgbPJ19+WCpLG7qe a1DR3gvDq8c8M2gQl6cFPLVxfKvw13OjlVMIbPB9vVOvM+AL04ZrocX2o6HnyqyD8GHz f0Pj/z/XBtbO0e9xknopvXgDgEgYu/I7Ab5pXDQra8dMSXX956kYrxkX6HtbXEBtSe60 pUMMAoYfA3NElw33jdGhRVva9B+R4HSMomHq5gi9J79/1ot4CDmr4AAaU20w6rpNX6nn Wr7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=c8FVgtwR3dYq1gSMIIzpj3xYD+SF39FougkWqMrddrA=; fh=7Xnm9Z0nUSA40NYdx1QmwG6X9BDZo4g7q932jkK4sso=; b=qtH6mqSZedOH9T2sbqJyo8E/K7NZikMqCDKYt1Sm0Ko2WTpaodanWqqO/TgRC6B97b aOTCqbG+gD5GMxLA6b6rJAsNWHXgC5MWv81a9TqY9l0iJKlxEx5BEaC7uPZVUICFUobc RLPxGltoIn5E1AVWrbWijhBV5rdNb5DsBVN+QqzXR/Ii90G0PvFowdflLkNukZd05Xsv t4RfCsqcHqTGy1Ty6DKL+92PBY6WmgYDtb3s4sDfAbIIjNOhQa+ksfN6kQuSHrG/oz// glfbMvbemh2Mv1hst4Lrrz+aQJA3n7zVzBQxdcQW6xnquldtC2AAepZAOKKWF/xTAQSQ ORnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u24-20020a05640207d800b00525672a80dfsi1227974edy.571.2023.08.14.03.46.24; Mon, 14 Aug 2023 03:46:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236741AbjHNKQv convert rfc822-to-8bit (ORCPT + 99 others); Mon, 14 Aug 2023 06:16:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236776AbjHNKQV (ORCPT ); Mon, 14 Aug 2023 06:16:21 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2BC810E3; Mon, 14 Aug 2023 03:16:06 -0700 (PDT) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 9F0A081EA; Mon, 14 Aug 2023 18:16:04 +0800 (CST) Received: from EXMBX061.cuchost.com (172.16.6.61) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 14 Aug 2023 18:16:04 +0800 Received: from localhost.localdomain (183.27.98.20) by EXMBX061.cuchost.com (172.16.6.61) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 14 Aug 2023 18:16:03 +0800 From: Xingyu Wu To: Daniel Lezcano , Thomas Gleixner , Emil Renner Berthing CC: , , "Rob Herring" , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Xingyu Wu , Samin Guo , , Conor Dooley Subject: [PATCH v4 0/3] Add timer driver for StarFive JH7110 RISC-V SoC Date: Mon, 14 Aug 2023 18:16:00 +0800 Message-ID: <20230814101603.166951-1-xingyu.wu@starfivetech.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [183.27.98.20] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) To EXMBX061.cuchost.com (172.16.6.61) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774201085534213533 X-GMAIL-MSGID: 1774201085534213533 This patch serises are to add timer driver for the StarFive JH7110 RISC-V SoC. The first patch adds documentation to describe device tree bindings. The subsequent patch adds timer driver and support JH7110 SoC. The last patch adds device node about timer in JH7110 dts. This timer has four free-running 32 bit counters and runs in 24MHz clock on StarFive JH7110 SoC. And each channel(counter) triggers an interrupt when timeout. They support one-shot mode and continuous-run mode. Changes since v3: - Rebased on 6.5-rc6 - Dropped the useless enum names like 'JH7110_TIMER_CH_0'. - Dropped the platform data about JH7110 and used the register offsets directly. - Drroped the useless functions of clk_disable_unprepare(). v3: https://lore.kernel.org/all/20230627055313.252519-1-xingyu.wu@starfivetech.com/ Changes since v2: - Rebased on 6.4-rc7. - Merged the header file into the c file. - Renamed the functions from 'starfive_' to 'jh7110_' - Used function 'clocksource_register_hz' instead of 'clocksource_mmio_init'. v2: https://lore.kernel.org/all/20230320135433.144832-1-xingyu.wu@starfivetech.com/ Changes since v1: - Added description about timer and modified properties' description in dt-bindings. - Dropped the 'interrupt-names' and 'clock-frequency' in dt-bindings. - Renamed the functions and added 'starfive_' - Modified that the driver probe by platform bus. v1: https://lore.kernel.org/all/20221223094801.181315-1-xingyu.wu@starfivetech.com/ Xingyu Wu (3): dt-bindings: timer: Add timer for StarFive JH7110 SoC clocksource: Add JH7110 timer driver riscv: dts: jh7110: starfive: Add timer node .../bindings/timer/starfive,jh7110-timer.yaml | 96 ++++ MAINTAINERS | 7 + arch/riscv/boot/dts/starfive/jh7110.dtsi | 20 + drivers/clocksource/Kconfig | 11 + drivers/clocksource/Makefile | 1 + drivers/clocksource/timer-jh7110.c | 415 ++++++++++++++++++ 6 files changed, 550 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/starfive,jh7110-timer.yaml create mode 100644 drivers/clocksource/timer-jh7110.c