Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp480627ybi; Tue, 16 Jul 2019 00:21:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBhlAFomGbVHgkfB2vpf/3GkYS/NtS5VsX84huKzPDlQ7wiZA126jj0m0NL9uKTPbYHfh8 X-Received: by 2002:a65:690e:: with SMTP id s14mr17617120pgq.47.1563261687681; Tue, 16 Jul 2019 00:21:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563261687; cv=none; d=google.com; s=arc-20160816; b=dR8dZEH0IvGXLV4I8eZ2UlwzCMX8LbFROlowSayGoPIgQIY2KDTEcji6/JizKWoSLw n5dCGPSnAZTSjLxxDEMdE49y/C3vgHAV1LSMPpUTN8NXPHLlQANZOkJxLwWDZSsFdAqO YixoQG7qEGFxAg4NPi9TgQbLOjyVLtuEX95p29Zt1qUnNErxd81+k3rhkKY2cGLV1de6 +D9svvSlq47NNrmSgLK6Qh+JYGD10fCK6luS921mSjASLgP3i848qucsfADAGXLeXAUy 1W4axKK4xqnAq5lWKk489LgYDmTSEsSJe/maYJZTkRiaq0xTYtRSFWy5WX4+dMZc0wFK QuUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=AE5lIogoyLRIJ1hB5AhdAArokWtwk9o+1C+sZPmDQHE=; b=RlBozGdNAT81Qi+enpaTDmR3p2ntx3sTxKY2o5uVSuEPx5XccTMp/ICjpQqgjrQev7 JOUhFbPCle9u1FhFw8vcbY/zd7vvtsrdPfAXwaXrHZnjz25CsTUmGcnCZktGz5G43fyk ncmsZYxUWR5lzbrUowGSj41YTko2npgakBYrjqFsHCcMGP/C3qRILS+QNtYSKdGxyigs 3EB6JaG/Abak7UdGQLNnQO75iMl5wkfJvo9gs4JAbUrT8ISOKljasy6FjKGP1e8LNduh 7N4aW2JNAiPwTzWNwo7adHtTdfynt0ux8+kjdgWAr7vW8gaCw+tTuk89U8s4Q5ktIq7k ICAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v7si18844631pfb.132.2019.07.16.00.21.11; Tue, 16 Jul 2019 00:21:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730193AbfGPHUt (ORCPT + 99 others); Tue, 16 Jul 2019 03:20:49 -0400 Received: from mga09.intel.com ([134.134.136.24]:64887 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726385AbfGPHUs (ORCPT ); Tue, 16 Jul 2019 03:20:48 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jul 2019 00:20:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,496,1557212400"; d="scan'208";a="194796175" Received: from pipin.fi.intel.com ([10.237.72.175]) by fmsmga002.fm.intel.com with ESMTP; 16 Jul 2019 00:20:44 -0700 From: Felipe Balbi To: Richard Cochran Cc: netdev@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, "Christopher S . Hall" , Felipe Balbi Subject: [RFC PATCH 0/5] PTP: add support for Intel's TGPIO controller Date: Tue, 16 Jul 2019 10:20:33 +0300 Message-Id: <20190716072038.8408-1-felipe.balbi@linux.intel.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org TGPIO is a new IP which allows for time synchronization between systems without any other means of synchronization such as PTP or NTP. The driver is implemented as part of the PTP framework since its features covered most of what this controller can do. There are a few things that made me send this as a RFC, however: (1) This version of the controller lacks an interrupt line. Currently I put a kthread that starts polling the controller whenever its pin is configured as input. Any better ideas for allowing userspace control the polling rate? Perhaps tap into ptp_poll()? (2) ACPI IDs can't be shared at this moment, unfortunately. (3) The change in arch/x86/kernel/tsc.c needs to be reviewed at length before going in. Let me know what you guys think, Cheers Felipe Balbi (5): x86: tsc: add tsc to art helpers PTP: add a callback for counting timestamp events PTP: implement PTP_EVENT_COUNT_TSTAMP ioctl PTP: Add flag for non-periodic output PTP: Add support for Intel PMC Timed GPIO Controller arch/x86/include/asm/tsc.h | 2 + arch/x86/kernel/tsc.c | 32 +++ drivers/ptp/Kconfig | 8 + drivers/ptp/Makefile | 1 + drivers/ptp/ptp-intel-pmc-tgpio.c | 378 ++++++++++++++++++++++++++++++ drivers/ptp/ptp_chardev.c | 15 ++ include/linux/ptp_clock_kernel.h | 12 + include/uapi/linux/ptp_clock.h | 6 +- 8 files changed, 453 insertions(+), 1 deletion(-) create mode 100644 drivers/ptp/ptp-intel-pmc-tgpio.c -- 2.22.0