Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752557AbdI2PeQ (ORCPT ); Fri, 29 Sep 2017 11:34:16 -0400 Received: from mx0b-00010702.pphosted.com ([148.163.158.57]:46576 "EHLO mx0b-00010702.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752308AbdI2PeO (ORCPT ); Fri, 29 Sep 2017 11:34:14 -0400 X-Greylist: delayed 326 seconds by postgrey-1.27 at vger.kernel.org; Fri, 29 Sep 2017 11:34:14 EDT From: Brandon Streiff To: Andrew Lunn CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "David S. Miller" , Florian Fainelli , Vivien Didelot , Richard Cochran , Erik Hons Subject: RE: [PATCH net-next RFC 0/9] net: dsa: PTP timestamping for mv88e6xxx Thread-Topic: [PATCH net-next RFC 0/9] net: dsa: PTP timestamping for mv88e6xxx Thread-Index: AQHTOG5hrTy8aIiWg0Kn4mJ2d4K0PKLKj8WAgAFMPoA= Date: Fri, 29 Sep 2017 15:34:05 +0000 Message-ID: References: <1506612341-18061-1-git-send-email-brandon.streiff@ni.com> <20170928173629.GD14940@lunn.ch> In-Reply-To: <20170928173629.GD14940@lunn.ch> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [130.164.62.183] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY4PR04MB1257;6:al3wFgqMOhzQ9dnD7Pumi2MEjwGb0HK/cpwqV2dlEXPuhkIWp/oQtfBL5RKar7Eo7LwPJAomKX00EmaHN/EqlmMSZFT9JQuTylCiNfLuPuVDM1cfM/dAxZ2yc/DmwtEiuuCD77Az5TqLRK8B/El0FL9CVlfMvthGClbgG99othHbmx5N2niwgFFkJvcVs3WLkMRsdBtdWqzwNpZ9DwCNFt2/qsuZgu3tZpzGLxhF0smKDbIB21hkO2jpcQGYwJH/UsplGRNlh104Ku828avWn9s2CK3XalZutya3SjgobUGtKlx5BQgbvqFScXKnMC8KdaQEWh9QdEGmp4jrIrr0Kw==;5:yEg8sRDCtSU3KWfprk6SkXA9moRnA4oqDeuzwWQkIm7CSKwURyEoju1NO4dpyIWkvmX1l/rGYPVPFPzRdY2FDyCmscRVrcwa9xavYj7GMSAHo3M2aQtzBIf/CCuQVn2ZHbvJKV99kCinF12wqCO/Bw==;24:YhRMWmSCm5Fjo/M1HRx4cB+58JbjpxvYz532M5Vtn7YVuZO3SI+N4SpR/UZ522Dvglv97NQkUT9qsH295pJPdGmobNfiPFotUAnysTAbpzY=;7:lL8el19tUnKIbfvMbzhlme2z8E5rF/0XVP2v3D4VlgrkO0gH5H99SQEGv0ZJ7vhN7xTg/CDzrbxJ3QUvea+AyVNAMx/t6vyBPut7y1CH0QD8Ot+bVKwXQ9c3f4VX676C7Z53AckHjky8QSvMx+QD8XnLm2yBPTR8c176Q8lg+RraTFOyUKXMrzJdvu+85w62ihFyzxH9H/MzI7A9dN3nk5sTmbthPY4MCNsFr2/3OFY= x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI;SCL:-1;SFV:NSPM;SFS:(10019020)(6009001)(376002)(346002)(377454003)(189002)(199003)(6436002)(2950100002)(74316002)(305945005)(81166006)(5660300001)(229853002)(39060400002)(81156014)(7696004)(3280700002)(316002)(6916009)(3846002)(54906003)(97736004)(189998001)(102836003)(55016002)(66066001)(9686003)(99286003)(53936002)(8676002)(8936002)(6116002)(478600001)(105586002)(86362001)(2906002)(7736002)(68736007)(106356001)(6506006)(76176999)(14454004)(6246003)(54356999)(101416001)(2900100001)(77096006)(33656002)(50986999)(25786009)(4326008)(3660700001)(138113003);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR04MB1257;H:CO2PR04MB2184.namprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-ms-office365-filtering-correlation-id: 1e8e8d8d-b4ed-4853-1544-08d5074f84fa x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075);SRVR:CY4PR04MB1257; x-ms-traffictypediagnostic: CY4PR04MB1257: x-exchange-antispam-report-test: UriScan:; x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6041248)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR04MB1257;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR04MB1257; x-forefront-prvs: 0445A82F82 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: ni.com X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Sep 2017 15:34:05.5710 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 87ba1f9a-44cd-43a6-b008-6fdb45a5204e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR04MB1257 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-09-29_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_policy_notspam policy=outbound_policy score=30 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=30 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709290223 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v8TFYLU8029286 Content-Length: 1496 Lines: 18 > From: Andrew Lunn [mailto:andrew@lunn.ch] > Sent: Thursday, September 28, 2017 12:36 PM > > I assume ptp already has the core code to use pinctrl and Linux > standard GPIOs? What does the device tree binding look like? How do > you specify the GPIOs to use? > > What we want to avoid is defining an ABI now, otherwise it is going to > be hard to swap to pinctrl later. A ptp_clock_info has an array of struct ptp_pin_desc which defines "pins" with a name ("Hardware specific human readable pin name"), an index, and a bitmask of valid functions. The ptp_pin_desc structure is shared with usermode for the PTP_PIN_GETFUNC and PTP_PIN_SETFUNC ioctls. The pins are also exposed in sysfs (see Documentation/ABI/testing/sysfs-ptp). The underlying implementation for configuring the hardware is left up to the PHC driver. I don't see any drivers today that use the PHC pin API as a layer over pinctrl/gpiochip, but there's no reason that that couldn't be the case. For mv88e6xxx, we name the pins using the pattern "mv88e6xxx_gpio%d"; this appears to be in line with current practice (igb_ptp.c uses "SDP%d", mlx5 driver uses "mlx5_pps%d"). Usermode code appears to be expected to determine which pin it needs to use. (Our current userspace code, for instance, knows that it needs to find "mv88e6xxx_gpio8".) For mv88e6xxx, Device Tree does feel like a better option here for declaring names, functions, and pin usages. Not all platforms that use the PTP API use Device Tree though. -- brandon