Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3370963imm; Tue, 29 May 2018 06:11:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpXukiME1j0QGnP5Q+CFS2HmLe7hwZnxJBDLd5GMR+9U1T1zeAvrlgvhgEp1V5soGY+nJcL X-Received: by 2002:a62:bd18:: with SMTP id a24-v6mr16948587pff.30.1527599516364; Tue, 29 May 2018 06:11:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527599516; cv=none; d=google.com; s=arc-20160816; b=xxLr2JwwGpUbQWGNkhEjc+enSup0yXy1Q4b5gzvVeeGhDkEdwyWNLI+i4c7E6CHaj3 Sh69lAseyVGI1BIMnoy33OoAoAhi1TMJcIb2Wl/7e0G9IMS0FOlux+nnpA7nh21/ZPNN AyMSjlr/2K/7fc0p7esdXiQOe+KRH+SPBZ79xrpGTL1/YFarRHEYKjXV44LJeVsZDXXg c1+7Rh7nznopA43/d73IdVR/ZttiC5dyEYyBm8LR0uWVhwNWitUnK+aCOlU36NNIQ8Ah FfDQ4VYabqhnd/Ffu367JMzRiCHR7o6xTSyIy6zBpnJ7vEnR2kNU5mLHVLFzbXlDUs25 NenQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=C0eL3xhWUUwwqABMPHtg1GEYL3LBIc1ltufdU8z0O78=; b=lJyts9rVC80Zdff3yqOQwXKS8iVvYd3g440uLF8rrkHip9MmQe8xGWGox2sPb5GW1d 517AjaqtFJb8aeXPd7oqnvUyvO5SlaHg2rw6tcTWHY5ujFybSjdwFMQ3UWehAHx/ZWtN 12hHYUwZiHKaejUkg05fUNzoillQjfhzD3JQ/gk6yGKe0NLhxeN6YDRrmGgggO4lOi6I GGZBQUWhNYIYcUIwRyyQTMNVHsvdLX54RqJb700HPvSGo7LFwiGRf75IyDZTv4xCXr5S TRoTh9ovlQGMhM32ewuItqLaG6W3o1ByZo4IUOTg9+dEG3RMyKXVvgvulM1zB7rzJcq4 9fmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=r07y0eVp; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b6-v6si31105456plx.211.2018.05.29.06.11.42; Tue, 29 May 2018 06:11:56 -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; dkim=pass header.i=@kernel.org header.s=default header.b=r07y0eVp; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934282AbeE2NJL (ORCPT + 99 others); Tue, 29 May 2018 09:09:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:44730 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933444AbeE2NJG (ORCPT ); Tue, 29 May 2018 09:09:06 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9E24820880; Tue, 29 May 2018 13:09:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527599346; bh=v8ffc4K18FbDcNGc7sV3i52iIEccelcNZ5QjD3aNfuk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r07y0eVpmHpMpbYoU0PjkIxMdMDHS9FwCM7KLsK/6RqgkbA3DNbeBhHzAbgxJvLNu s3brUKFGNXWTpNDp6eiC1X0yrSTu0Q2dNEupl01rXLPtThZl/8FugbCSc5xldgXNVh SbTkF8uf5/39tIFRLD1qfbuzkBWWT/rbNiP9VkrE= Date: Tue, 29 May 2018 15:08:45 +0200 From: Greg KH To: Oleksandr Shamray Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, openbmc@lists.ozlabs.org, joel@jms.id.au, jiri@resnulli.us, tklauser@distanz.ch, linux-serial@vger.kernel.org, vadimp@mellanox.com, system-sw-low-level@mellanox.com, robh+dt@kernel.org, openocd-devel-owner@lists.sourceforge.net, linux-api@vger.kernel.org, davem@davemloft.net, mchehab@kernel.org Subject: Re: [patch v23 4/4] Documentation: jtag: Add ABI documentation Message-ID: <20180529130845.GB30119@kroah.com> References: <1527594545-19870-1-git-send-email-oleksandrs@mellanox.com> <1527594545-19870-5-git-send-email-oleksandrs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1527594545-19870-5-git-send-email-oleksandrs@mellanox.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 29, 2018 at 02:49:05PM +0300, Oleksandr Shamray wrote: > +++ b/Documentation/ABI/testing/jtag-dev > @@ -0,0 +1,27 @@ > +What: /dev/jtag[0-9]+ > +Date: May 2018 > +KernelVersion: 4.18 > +Contact: oleksandrs@mellanox.com > +Description: > + The misc device files /dev/jtag* are the interface > + between JTAG master interface and userspace. > + > + The ioctl(2)-based ABI is defined and documented in > + [include/uapi]. > + > + The following file operations are supported: > + > + open(2) > + The argument flag currently support only one access > + mode O_RDWR. Your open call tests for nothing, don't worry about it here at all :) > + > + ioctl(2) > + Initiate various actions. > + See the inline documentation in [include/uapi] > + for descriptions of all ioctls. > + > + close(2) > + Stops and free up the I/O contexts that was associated > + with the file descriptor. No, your close() does not do any of that. > + > +Users: TBD No users? They why do we have this api at all? > +open(), close() > +------- > +open() opens JTAG device. Only one open operation per JTAG device > +can be performed. Two or more open for one device will return error. Not true :) > + > +Open/Close device: > +- jtag_fd = open("/dev/jtag0", O_RDWR); > +- close(jtag_fd); > + > +ioctl() > +------- > +All access operations to JTAG devices are erformed through ioctl interface. > +The IOCTL interface supports these requests: > + JTAG_IOCRUNTEST - Force JTAG state machine to RUN_TEST/IDLE state > + JTAG_SIOCFREQ - Set JTAG TCK frequency > + JTAG_GIOCFREQ - Get JTAG TCK frequency > + JTAG_IOCXFER - send JTAG data Xfer > + JTAG_GIOCSTATUS - get current JTAG TAP status > + JTAG_SIOCMODE - set JTAG mode flags. > + > +JTAG_SIOCFREQ, JTAG_GIOCFREQ > +------ > +Set/Get JTAG clock speed: > + > + unsigned int jtag_fd; > + ioctl(jtag_fd, JTAG_SIOCFREQ, &frq); > + ioctl(jtag_fd, JTAG_GIOCFREQ, &frq); > + > +JTAG_IOCRUNTEST > +------ > +Force JTAG state machine to RUN_TEST/IDLE state > + > +struct jtag_run_test_idle { > + __u8 reset; > + __u8 endstate; > + __u8 tck; > +}; > + > +reset: 0 - run IDLE/PAUSE from current state > + 1 - go through TEST_LOGIC/RESET state before IDLE/PAUSE Are you sure your enums are these values? You should explicitly set them in your .h file to be positive. thanks, greg k-h