From mboxrd@z Thu Jan 1 00:00:00 1970 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=-15.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 AAAC3C433ED for ; Wed, 5 May 2021 06:38:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 87739613BE for ; Wed, 5 May 2021 06:38:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231452AbhEEGjD (ORCPT ); Wed, 5 May 2021 02:39:03 -0400 Received: from mail-dm6nam10on2073.outbound.protection.outlook.com ([40.107.93.73]:23776 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229592AbhEEGjC (ORCPT ); Wed, 5 May 2021 02:39:02 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T7fqhzU+x9XpKqnNQbWxQT7vokkJamE6GefEHmoDt9a90sFf952QNH5kej221IzJV6iENrJ3RINakJIFnr+jeYYGcslspu67pSNOqCmz3DiYlQp7rwK1F5WBnP0jb0w3QaTj5528/p1XPR8hHpxwN+VSF6Qo5Lsw4xMrCw96NZw+FNqvskIP21Gu74L7ebDrZ5DfyWjmygfrCunTotdvIn/HotZylHcppbTpaMc8swzksYSSMrifwnNxDdBa3Wna/ES++X/HErh4xHnkp6sNPHTblxx5YU6Aj55Nf/GR8wLbRTXooaVoMwPnEeeTkn9qrQxKEdrQNVuIBAr+f/KNzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rN1Hm2MFChn4L2SfV2K9THIK50s0/V0/l4v/iE59Vs8=; b=bDuunPtWro6ABgmnwZiFpIvaqKDTIjakkqMFyCMZt4NWhPx0C0MRBAbbA6Qp8r1jmPSdHIxBAiQ1zKyQB2XjuTZaI8tPnULg18/RssbWT8ocAiFzKRpwKn7ngU7G7hvkv8hsZe1+N46AjNnqHIScIkAiPjVbr4OkBtrPkU6+o0C4KLQm2++/YPchJjwA69oi5fILUknfofLZEGkog9t9dqe0VfsFROXM4kAP2/ggW4ij5UmkwTEJH9b2NwSOJ3G1ydK91n83KnTEN2B+B1NMuK/nMIGZK8bVeXes6UXb7OD+fCvuADkybp4+QGSzMjuabKvXKnxd2kCiYlleDVWOFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=pengutronix.de smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rN1Hm2MFChn4L2SfV2K9THIK50s0/V0/l4v/iE59Vs8=; b=KnFjBeXrsSGvrI76jA30MhcJjqVbFUf0t3WRY896kMOqsyouU4ncV3w/YydFLxKFbPva/8LZV5THAFq9zFHKJlQrYTZZdNK57ALWMNPQp3Sye8IOXxYag4END6M8fzQKnnWnPN2n1yV7MPy1AUZE7hQCt4I6Sj194gzDcUNlZzU= Received: from SN4PR0501CA0149.namprd05.prod.outlook.com (2603:10b6:803:2c::27) by MWHPR02MB3166.namprd02.prod.outlook.com (2603:10b6:301:67::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.35; Wed, 5 May 2021 06:38:04 +0000 Received: from SN1NAM02FT020.eop-nam02.prod.protection.outlook.com (2603:10b6:803:2c:cafe::f) by SN4PR0501CA0149.outlook.office365.com (2603:10b6:803:2c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.8 via Frontend Transport; Wed, 5 May 2021 06:38:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; pengutronix.de; dkim=none (message not signed) header.d=none;pengutronix.de; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT020.mail.protection.outlook.com (10.152.72.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4065.21 via Frontend Transport; Wed, 5 May 2021 06:38:03 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 4 May 2021 23:38:01 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Tue, 4 May 2021 23:38:01 -0700 Envelope-to: u.kleine-koenig@pengutronix.de, thierry.reding@gmail.com, lee.jones@linaro.org, alvaro.gamez@hazent.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-pwm@vger.kernel.org, sean.anderson@seco.com Received: from [172.30.17.109] (port=46602) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1leBAX-00089z-Ma; Tue, 04 May 2021 23:38:01 -0700 Subject: Re: [PATCH v2 2/2] pwm: Add support for Xilinx AXI Timer To: Sean Anderson , , CC: , , , Alvaro Gamez , Lee Jones , Thierry Reding , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= References: <20210504184925.3399934-1-sean.anderson@seco.com> <20210504184925.3399934-2-sean.anderson@seco.com> From: Michal Simek Message-ID: Date: Wed, 5 May 2021 08:37:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <20210504184925.3399934-2-sean.anderson@seco.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 25194029-22f4-46ce-f903-08d90f9055de X-MS-TrafficTypeDiagnostic: MWHPR02MB3166: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V/2HlHIePlZA5QLc+9TgvXSN0nQsMiuGC2KX6DeJj99+msLAdIj/cvfvglkTN15V57Oa5vke0j2YEIGJZoLdaYWuYMbSASR8CfYwpLOrtGS4/wRHf+DdOEhmiJQ1iHkYtYKTDFMigj57IGrVmr9fx7IECTJYJ9IgoFBGh+FoptjpXkpI+5ldoZVqYhj7xoXRMcnUvITW+hxdlJE3DHoGcPqZePIHKOGZl9UDW2dZcjYvCX3OKlAuoq5Erwmj6SPBrnfJ3c6hkkhOcFIrFC25TK1ToZ93rqUHS4wJu/fpkR8Sv5pZo24sbnJNgbszdAzMw6KM8j5XHOwUKPYbLJ4/lHPo6qphhaVs6ATLTSJorWRAwYb7nsXG+nb38QShmmvYZOfUWbtrt8F+wqcWKngTEbT+p3K7WSnJZO2ih4fnNGYb2dE2uDFzY+Fi4hvHsPKiKJrOpRDvHT6nfrwaDgQWoAB0jyyN3BGdiMPnVhZkRwpTKQ7s2LoM0G+5m8YO32+nLkTW0QM+5THYwcCzDh4DqNSBtzyb+P4A6QnN0JZ1whu8OiOqJVfS6guH50eMwer0qiCjw2cKIUhCwSJ3IHYYkO+vVSk6iF2CrnzZXZWpub44lS9Z1rQ2ixTS2IHL9uh1p+cpqCYmBFoA4/ht77M0moxdfHFG+mA8BDCuorz2MjL2EFXWO/n5dDfbqsjNydfTU+o9PUnLBSNbK/ksYlGvHdWSee4NFspVZvSm6IRv8OU0PD/CVOrV4tz5Yq42P66mh0Gk0DSuK46HccJkvcWab9SffvpCrWu5gdHfGmsVfQ0= X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch01.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(4636009)(39850400004)(136003)(376002)(346002)(396003)(46966006)(36840700001)(2616005)(54906003)(478600001)(8936002)(53546011)(70586007)(5660300002)(7636003)(70206006)(82740400003)(82310400003)(186003)(110136005)(36756003)(26005)(9786002)(44832011)(356005)(31696002)(47076005)(31686004)(36860700001)(2906002)(966005)(8676002)(336012)(36906005)(316002)(4326008)(83380400001)(426003)(50156003)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2021 06:38:03.9219 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 25194029-22f4-46ce-f903-08d90f9055de X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT020.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB3166 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/4/21 8:49 PM, Sean Anderson wrote: > This adds PWM support for Xilinx LogiCORE IP AXI soft timers commonly > found on Xilinx FPGAs. There is another driver for this device located > at arch/microblaze/kernel/timer.c, but it is only used for timekeeping. > This driver was written with reference to Xilinx DS764 for v1.03.a [1]. > > [1] https://www.xilinx.com/support/documentation/ip_documentation/axi_timer/v1_03_a/axi_timer_ds764.pdf > > Signed-off-by: Sean Anderson > --- > I tried adding a XILINX_PWM_ prefix to all the defines, but IMO it > really hurt readability. That prefix almost doubles the size the > defines, and is particularly excessive in something like > XILINX_PWM_TCSR_RUN_MASK. > > Changes in v2: > - Don't compile this module by default for arm64 > - Add dependencies on COMMON_CLK and HAS_IOMEM > - Add comment explaining why we depend on !MICROBLAZE > - Add comment describing device > - Rename TCSR_(SET|CLEAR) to TCSR_RUN_(SET|CLEAR) > - Use NSEC_TO_SEC instead of defining our own > - Use TCSR_RUN_MASK to check if the PWM is enabled, as suggested by Uwe > - Cast dividends to u64 to avoid overflow > - Check for over- and underflow when calculating TLR > - Set xilinx_pwm_ops.owner > - Don't set pwmchip.base to -1 > - Check range of xlnx,count-width > - Ensure the clock is always running when the pwm is registered > - Remove debugfs file :l > - Report errors with dev_error_probe > > drivers/pwm/Kconfig | 13 ++ > drivers/pwm/Makefile | 1 + > drivers/pwm/pwm-xilinx.c | 301 +++++++++++++++++++++++++++++++++++++++ > 3 files changed, 315 insertions(+) > create mode 100644 drivers/pwm/pwm-xilinx.c Without looking below another driver which target the same IP is just wrong that's why NACK from me. Thanks, Michal From mboxrd@z Thu Jan 1 00:00:00 1970 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=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 12879C433B4 for ; Wed, 5 May 2021 06:40:14 +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 911F2613C4 for ; Wed, 5 May 2021 06:40:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 911F2613C4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.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:In-Reply-To:MIME-Version:Date:Message-ID:From: References:CC:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WKoVie1ILOTGxjekf3gaHJikWxCLXHewsjsGbmvIpZA=; b=OK4PaHI05YoUA+MSADKMOvWPg 9hLNUUNy6/xIxVCwhckBAPzNMteR6hkvYJO4UPA2/L/7zECclEGu+ARNezh6dWlmsHnk4mDci8QGp J7Q15QrIApfrSRAFQ/kEHJdN4gShudUI9b+exvrGd+7QnDuoXeDDmKACMjd6dYAZxgPRZ/pDyFrsu sifwxnjPmOGym15dawit4K90XY7HUmmtB+WUDZV80rvWOPml7GFy8cuFQpzBpUY/E7/xI8VWl7AKT xMpyEg1n9u1+c5II/QyLv8oFVJhlLyuivuVcW9rXQl5xr9hKGMXmb1CBKL/mcyQWyNPj+BRkf+W5W DpQHLP1BQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1leBAo-000Lr0-4q; Wed, 05 May 2021 06:38:18 +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 1leBAf-000LoR-Qh for linux-arm-kernel@desiato.infradead.org; Wed, 05 May 2021 06:38:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:CC:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=rN1Hm2MFChn4L2SfV2K9THIK50s0/V0/l4v/iE59Vs8=; b=MxbQAtznXAAX0MrMDTPco0SEGx /nMmJLV0hhBcsTONm9ziC8bhDN/ZN8HnSdcLMPbSaxndXCNbUSfUFHCzl0MJ39WK8x8eCVnvgy/vs ksThNJaILHH9VzmOHGAh/O0be5F16t6xvnw9vR6B9pm3hrmrj21sjbJ0cGGx1AX5QQTefI3pb4nAj KTpRcesaAlWwtPoGTPdXu8u8UGUYCAKKbgsfUXrs/WvLurrVdWczt6rBTe/qzrTaJiC9rgOzLf259 afuO9TN7YZmGztSIvcs/nD555uGKRtWvhCw6Ul3ynoj8OwuQNqXryNVE431KBOLT1dD83hWUgyNeq RLFgjF4Q==; Received: from mail-dm6nam10on2082.outbound.protection.outlook.com ([40.107.93.82] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leBAc-004VJ5-PZ for linux-arm-kernel@lists.infradead.org; Wed, 05 May 2021 06:38:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T7fqhzU+x9XpKqnNQbWxQT7vokkJamE6GefEHmoDt9a90sFf952QNH5kej221IzJV6iENrJ3RINakJIFnr+jeYYGcslspu67pSNOqCmz3DiYlQp7rwK1F5WBnP0jb0w3QaTj5528/p1XPR8hHpxwN+VSF6Qo5Lsw4xMrCw96NZw+FNqvskIP21Gu74L7ebDrZ5DfyWjmygfrCunTotdvIn/HotZylHcppbTpaMc8swzksYSSMrifwnNxDdBa3Wna/ES++X/HErh4xHnkp6sNPHTblxx5YU6Aj55Nf/GR8wLbRTXooaVoMwPnEeeTkn9qrQxKEdrQNVuIBAr+f/KNzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rN1Hm2MFChn4L2SfV2K9THIK50s0/V0/l4v/iE59Vs8=; b=bDuunPtWro6ABgmnwZiFpIvaqKDTIjakkqMFyCMZt4NWhPx0C0MRBAbbA6Qp8r1jmPSdHIxBAiQ1zKyQB2XjuTZaI8tPnULg18/RssbWT8ocAiFzKRpwKn7ngU7G7hvkv8hsZe1+N46AjNnqHIScIkAiPjVbr4OkBtrPkU6+o0C4KLQm2++/YPchJjwA69oi5fILUknfofLZEGkog9t9dqe0VfsFROXM4kAP2/ggW4ij5UmkwTEJH9b2NwSOJ3G1ydK91n83KnTEN2B+B1NMuK/nMIGZK8bVeXes6UXb7OD+fCvuADkybp4+QGSzMjuabKvXKnxd2kCiYlleDVWOFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=pengutronix.de smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rN1Hm2MFChn4L2SfV2K9THIK50s0/V0/l4v/iE59Vs8=; b=KnFjBeXrsSGvrI76jA30MhcJjqVbFUf0t3WRY896kMOqsyouU4ncV3w/YydFLxKFbPva/8LZV5THAFq9zFHKJlQrYTZZdNK57ALWMNPQp3Sye8IOXxYag4END6M8fzQKnnWnPN2n1yV7MPy1AUZE7hQCt4I6Sj194gzDcUNlZzU= Received: from SN4PR0501CA0149.namprd05.prod.outlook.com (2603:10b6:803:2c::27) by MWHPR02MB3166.namprd02.prod.outlook.com (2603:10b6:301:67::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.35; Wed, 5 May 2021 06:38:04 +0000 Received: from SN1NAM02FT020.eop-nam02.prod.protection.outlook.com (2603:10b6:803:2c:cafe::f) by SN4PR0501CA0149.outlook.office365.com (2603:10b6:803:2c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.8 via Frontend Transport; Wed, 5 May 2021 06:38:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; pengutronix.de; dkim=none (message not signed) header.d=none;pengutronix.de; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT020.mail.protection.outlook.com (10.152.72.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4065.21 via Frontend Transport; Wed, 5 May 2021 06:38:03 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 4 May 2021 23:38:01 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Tue, 4 May 2021 23:38:01 -0700 Received: from [172.30.17.109] (port=46602) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1leBAX-00089z-Ma; Tue, 04 May 2021 23:38:01 -0700 Subject: Re: [PATCH v2 2/2] pwm: Add support for Xilinx AXI Timer To: Sean Anderson , , CC: , , , Alvaro Gamez , Lee Jones , Thierry Reding , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= References: <20210504184925.3399934-1-sean.anderson@seco.com> <20210504184925.3399934-2-sean.anderson@seco.com> From: Michal Simek Message-ID: Date: Wed, 5 May 2021 08:37:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <20210504184925.3399934-2-sean.anderson@seco.com> Content-Language: en-US X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 25194029-22f4-46ce-f903-08d90f9055de X-MS-TrafficTypeDiagnostic: MWHPR02MB3166: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V/2HlHIePlZA5QLc+9TgvXSN0nQsMiuGC2KX6DeJj99+msLAdIj/cvfvglkTN15V57Oa5vke0j2YEIGJZoLdaYWuYMbSASR8CfYwpLOrtGS4/wRHf+DdOEhmiJQ1iHkYtYKTDFMigj57IGrVmr9fx7IECTJYJ9IgoFBGh+FoptjpXkpI+5ldoZVqYhj7xoXRMcnUvITW+hxdlJE3DHoGcPqZePIHKOGZl9UDW2dZcjYvCX3OKlAuoq5Erwmj6SPBrnfJ3c6hkkhOcFIrFC25TK1ToZ93rqUHS4wJu/fpkR8Sv5pZo24sbnJNgbszdAzMw6KM8j5XHOwUKPYbLJ4/lHPo6qphhaVs6ATLTSJorWRAwYb7nsXG+nb38QShmmvYZOfUWbtrt8F+wqcWKngTEbT+p3K7WSnJZO2ih4fnNGYb2dE2uDFzY+Fi4hvHsPKiKJrOpRDvHT6nfrwaDgQWoAB0jyyN3BGdiMPnVhZkRwpTKQ7s2LoM0G+5m8YO32+nLkTW0QM+5THYwcCzDh4DqNSBtzyb+P4A6QnN0JZ1whu8OiOqJVfS6guH50eMwer0qiCjw2cKIUhCwSJ3IHYYkO+vVSk6iF2CrnzZXZWpub44lS9Z1rQ2ixTS2IHL9uh1p+cpqCYmBFoA4/ht77M0moxdfHFG+mA8BDCuorz2MjL2EFXWO/n5dDfbqsjNydfTU+o9PUnLBSNbK/ksYlGvHdWSee4NFspVZvSm6IRv8OU0PD/CVOrV4tz5Yq42P66mh0Gk0DSuK46HccJkvcWab9SffvpCrWu5gdHfGmsVfQ0= X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(39850400004)(136003)(376002)(346002)(396003)(46966006)(36840700001)(2616005)(54906003)(478600001)(8936002)(53546011)(70586007)(5660300002)(7636003)(70206006)(82740400003)(82310400003)(186003)(110136005)(36756003)(26005)(9786002)(44832011)(356005)(31696002)(47076005)(31686004)(36860700001)(2906002)(966005)(8676002)(336012)(36906005)(316002)(4326008)(83380400001)(426003)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2021 06:38:03.9219 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 25194029-22f4-46ce-f903-08d90f9055de X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT020.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB3166 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210504_233806_871971_98F2FC3C X-CRM114-Status: GOOD ( 23.50 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 5/4/21 8:49 PM, Sean Anderson wrote: > This adds PWM support for Xilinx LogiCORE IP AXI soft timers commonly > found on Xilinx FPGAs. There is another driver for this device located > at arch/microblaze/kernel/timer.c, but it is only used for timekeeping. > This driver was written with reference to Xilinx DS764 for v1.03.a [1]. > > [1] https://www.xilinx.com/support/documentation/ip_documentation/axi_timer/v1_03_a/axi_timer_ds764.pdf > > Signed-off-by: Sean Anderson > --- > I tried adding a XILINX_PWM_ prefix to all the defines, but IMO it > really hurt readability. That prefix almost doubles the size the > defines, and is particularly excessive in something like > XILINX_PWM_TCSR_RUN_MASK. > > Changes in v2: > - Don't compile this module by default for arm64 > - Add dependencies on COMMON_CLK and HAS_IOMEM > - Add comment explaining why we depend on !MICROBLAZE > - Add comment describing device > - Rename TCSR_(SET|CLEAR) to TCSR_RUN_(SET|CLEAR) > - Use NSEC_TO_SEC instead of defining our own > - Use TCSR_RUN_MASK to check if the PWM is enabled, as suggested by Uwe > - Cast dividends to u64 to avoid overflow > - Check for over- and underflow when calculating TLR > - Set xilinx_pwm_ops.owner > - Don't set pwmchip.base to -1 > - Check range of xlnx,count-width > - Ensure the clock is always running when the pwm is registered > - Remove debugfs file :l > - Report errors with dev_error_probe > > drivers/pwm/Kconfig | 13 ++ > drivers/pwm/Makefile | 1 + > drivers/pwm/pwm-xilinx.c | 301 +++++++++++++++++++++++++++++++++++++++ > 3 files changed, 315 insertions(+) > create mode 100644 drivers/pwm/pwm-xilinx.c Without looking below another driver which target the same IP is just wrong that's why NACK from me. Thanks, Michal _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel