Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3176569ybz; Sun, 19 Apr 2020 19:54:30 -0700 (PDT) X-Google-Smtp-Source: APiQypKjBDnGljPZLPfMZ7p64kP7u3INonfEY5Rh5euYROXOLb8axpjES+dVf4hV6tpiwp6VEOT0 X-Received: by 2002:a17:906:a38f:: with SMTP id k15mr9968496ejz.181.1587351270276; Sun, 19 Apr 2020 19:54:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587351270; cv=none; d=google.com; s=arc-20160816; b=0xx7G+vVin5FIc4V7IS/jGabJIl/7bvwJxrwTFpbqeuR6TyuLnfO5n57LlMiWKuktD Q/eqDrwgnf7DhOGklhhQxa9PXj5LU82tp6g4ia48t4DyW2bIo3Ej4vhZsLMaoKJfYvne SnMEO7yS6D4GlRHsuSSfL8qbDE2loBXt/ws8KVbpQf1dFh+6n/+JfSLKdyoTAOFI8WLP NOK8UnI1AHZIJ2+pxGgMUcCnryd90xr0t70scM4tyKmOA0kDEVVJldMAAagSJhmwf3KO MgELMTu4houU1y3ZuQjVxg9FrbsglSQmMO9LQB4Px5A4s5XdYrwA0g8W0mtyr3UTR2hS ZVxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=cV/9+5kL97OmNAkN9XOc4PbB87EUl/DJ6DmDE+5YG8M=; b=UTpbXOSyx/1I+kAEDV10t8FuSvi9oDYx/xBj5VyYIM8sasLtJDtY/k4a5ZDe4XOduK UinIWvn0G1MHvNI1BydMcYBCEki9BzUncQ54LEXKX60uz71zjkjwwTyXsGbZNfD3Grj9 LFWe5Va9QXx7JfIcoTb1SZIeknUwoR6CzqtXT5Dq04zi+RsQrF2QinTfnt5CSKg66nBo qYqaGQA0olc6ttvxTItocgWzHFI4Drbur99lu8vTdiRVHfO/lkPUmTeXTFwiRtKWRYYV INN2u6qMmj/8F4jHz3k6xilNiBRx5BNhEPjO2NFhIPCMV3JxMilCSDKsa5p0Cqduhz39 cV4w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oz15si10753944ejb.24.2020.04.19.19.54.07; Sun, 19 Apr 2020 19:54:30 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726195AbgDTCvP (ORCPT + 99 others); Sun, 19 Apr 2020 22:51:15 -0400 Received: from inva020.nxp.com ([92.121.34.13]:55696 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725896AbgDTCvP (ORCPT ); Sun, 19 Apr 2020 22:51:15 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 54A021A0634; Mon, 20 Apr 2020 04:51:11 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 653961A0642; Mon, 20 Apr 2020 04:51:06 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id D1396402A8; Mon, 20 Apr 2020 10:50:59 +0800 (SGT) From: Yangbo Lu To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: Yangbo Lu , "David S . Miller" , Richard Cochran , Vladimir Oltean , Claudiu Manoil , Andrew Lunn , Vivien Didelot , Florian Fainelli , Alexandre Belloni , Microchip Linux Driver Support Subject: [v3, 0/7] Support programmable pins for Ocelot PTP driver Date: Mon, 20 Apr 2020 10:46:44 +0800 Message-Id: <20200420024651.47353-1-yangbo.lu@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Ocelot PTP clock driver had been embedded into ocelot.c driver. It had supported basic gettime64/settime64/adjtime/adjfine functions by now which were used by both Ocelot switch and Felix switch. This patch-set is to move current ptp clock code out of ocelot.c driver maintaining as a single ocelot_ptp.c driver, and to implement 4 programmable pins with only PTP_PF_PEROUT function for now. The PTP_PF_EXTTS function will be supported in the future, and it should be implemented separately for Felix and Ocelot, because of different hardware interrupt implementation in them. --- Changes for v2: - Put PTP driver under drivers/net/ethernet/mscc/. - Dropped MAINTAINERS patch. Kept original maintaining. - Initialized PTP separately in ocelot/felix platforms. - Supported PPS case in programmable pin. - Supported disabling pin function since deadlock is fixed by Richard. - Returned -EBUSY if not finding pin available. Changes for v3: - Re-sent. Yangbo Lu (7): net: mscc: ocelot: move ocelot ptp clock code out of ocelot.c net: mscc: ocelot: fix timestamp info if ptp clock does not work net: mscc: ocelot: redefine PTP pins net: mscc: ocelot: add wave programming registers definitions net: mscc: ocelot: support 4 PTP programmable pins net: mscc: ocelot: enable PTP programmable pin net: dsa: felix: enable PTP programmable pin drivers/net/dsa/ocelot/felix.c | 27 ++ drivers/net/dsa/ocelot/felix_vsc9959.c | 2 + drivers/net/ethernet/mscc/Makefile | 2 +- drivers/net/ethernet/mscc/ocelot.c | 212 +------------- drivers/net/ethernet/mscc/ocelot.h | 3 +- drivers/net/ethernet/mscc/ocelot_board.c | 27 ++ drivers/net/ethernet/mscc/ocelot_ptp.c | 324 +++++++++++++++++++++ drivers/net/ethernet/mscc/ocelot_regs.c | 2 + include/soc/mscc/ocelot.h | 15 +- .../net/ethernet => include/soc}/mscc/ocelot_ptp.h | 17 ++ 10 files changed, 417 insertions(+), 214 deletions(-) create mode 100644 drivers/net/ethernet/mscc/ocelot_ptp.c rename {drivers/net/ethernet => include/soc}/mscc/ocelot_ptp.h (52%) -- 2.7.4