Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp98512ybb; Tue, 14 Apr 2020 20:03:36 -0700 (PDT) X-Google-Smtp-Source: APiQypJJkMBjKo390/uqGETc5V4nTd+on9MUtmuWiqXAevURlTL8Y47hWgiiXzquZWDHsX2BDYwZ X-Received: by 2002:a50:d718:: with SMTP id t24mr21820207edi.171.1586919816458; Tue, 14 Apr 2020 20:03:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586919816; cv=none; d=google.com; s=arc-20160816; b=Wl3hT9SBWF4Zg3eXILs65JmXIykJar0VidrE0cj7QgSlwdBOTkInI/xChW1BADmrpO r+KjAbtPlkfkEWQfmDepC2FM7klaxHt9lr2t3yisYFqHs3/MsJCBhEqN2G3I2+lZ5iVO yzxYG6I+Dt88Bqd1CxT8vaKQogXoqiQiNnwlIODiQgCl5A8/nXYMa39nCzHJ5TGjyIzw bx6plbJZVcP1L+5wesScwu1snX0WC9CKZ3RVkL9ebrad0jnx9Z//fuTtBCfWoQkfW0dJ boTsGRuiUlzEZxXhvt9nPDmebw9dl8bZtSN84rgX1ZUg2liXWV/lHEChUeg2GuzBfHNH nKeA== 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 :ironport-sdr:ironport-sdr; bh=LZz3+/jGPXw9kicaMlvJ6cgSUjA57vc6O/UQyqaefPE=; b=rEPuDWOo4EONI6xu0D+M9K6iZQ+Qg4YrV4YGx6ToKMNkuAJlg2L6yeaKKqmv7Cgt9i P4wThVaQ3GrfQs36cfCIh3EGo0PpXFgk8vX8egdqfuWXDAfC5hlMuhgUxdKO3Poaihqt 5chdvbivQaKTflPFraNkbYrOeUVb66wkYSWlAkySOdXkCly9OWwDpLzzp85faHHd8Fnu E/jRQ6Q92hUyq0zNJz8vSndSf2Rp2Arj2ScXIZEtGDmSwkoVp82tkTHjQyCw7aMQvEGI c7R96MB0NYIbTyeMc2AEsvBtT9Jb4UDrhGF31BbiQ+kTKpgzVuhq+kbf9pr3mf0yNbup ojyg== 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 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a7si9518529edr.568.2020.04.14.20.03.12; Tue, 14 Apr 2020 20:03:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for 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: best guess record for 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389584AbgDMW3e (ORCPT + 99 others); Mon, 13 Apr 2020 18:29:34 -0400 Received: from mga01.intel.com ([192.55.52.88]:10117 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389553AbgDMW33 (ORCPT ); Mon, 13 Apr 2020 18:29:29 -0400 IronPort-SDR: SdXDhnVFF+ZKJ7yTKEaT/3QFJ0GvqNdOKeukXKzf/aqATrl6nROfZUHoeFgts42IfsxK6vTLAY m0QBQqTjg7ow== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2020 15:29:28 -0700 IronPort-SDR: HA1pg7W+JidsbOkG2gETfFSzW+Y8ysmyVsIaPb3QvkwolyAjCMaPayW6gcm5TJRw2fpsJlDfDs X/PUIVQAGx/w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,380,1580803200"; d="scan'208";a="399760659" Received: from epcorona-mobl.amr.corp.intel.com (HELO epcorona-moblu.amr.corp.intel.com) ([10.254.189.204]) by orsmga004.jf.intel.com with ESMTP; 13 Apr 2020 15:29:26 -0700 From: Ernesto Corona To: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org Cc: Ernesto Corona Subject: [PATCH v29 0/6] JTAG driver introduction Date: Mon, 13 Apr 2020 15:29:14 -0700 Message-Id: <20200413222920.4722-1-ernesto.corona@intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When a need raise up to use JTAG interface for system's devices programming or CPU debugging, usually the user layer application implements jtag protocol by bit-bang or using a proprietary connection to vendor hardware. This method can be slow and not generic. We propose to implement general JTAG interface and infrastructure to communicate with user layer application. In such way, we can have the standard JTAG interface core part and separation from specific HW implementation. This allow new capability to debug the CPU or program system's device via BMC without additional devices nor cost. This patch purpose is to add JTAG master core infrastructure by defining new JTAG class and provide generic JTAG interface to allow hardware specific drivers to connect this interface. This will enable all JTAG drivers to use the common interface part and will have separate for hardware implementation. The JTAG (Joint Test Action Group) core driver provides minimal generic JTAG interface, which can be used by hardware specific JTAG master controllers. By providing common interface for the JTAG controllers, user space device programing is hardware independent. Modern SoC which in use for embedded system' equipped with internal JTAG master interface. This interface is used for programming and debugging system's hardware components, like CPLD, FPGA, CPU, voltage and industrial controllers. Firmware for such devices can be upgraded through JTAG interface during Runtime. The JTAG standard support for multiple devices programming, is in case their lines are daisy-chained together. For example, systems which equipped with host CPU, BMC SoC or/and number of programmable devices are capable to connect a pin and select system components dynamically for programming and debugging, This is using by the BMC which is equipped with internal SoC master controller. For example: BMC JTAG master --> pin selected to CPLDs chain for programming (filed upgrade, production) BMC JTAG master --> pin selected to voltage monitors for programming (field upgrade, production) BMC JTAG master --> pin selected to host CPU (on-site debugging and developers debugging) For example, we can have application in user space which using calls to JTAG driver executes CPLD programming directly from SVF file The JTAG standard (IEEE 1149.1) defines the next connector pins: - TDI (Test Data In); - TDO (Test Data Out); - TCK (Test Clock); - TMS (Test Mode Select); - TRST (Test Reset) (Optional); The SoC equipped with JTAG master controller, performs device programming on command or vector level. For example a file in a standard SVF (Serial Vector Format) that contains boundary scan vectors, can be used by sending each vector to the JTAG interface and the JTAG controller will execute the programming. Initial version provides the system calls set for: - SIR (Scan Instruction Register, IEEE 1149.1 Instruction Register scan); - SDR (Scan Data Register, IEEE 1149.1 Data Register scan); - RUNTEST (Forces the IEEE 1149.1 bus to a run state for a specified number of clocks. SoC which are not equipped with JTAG master interface, can be built on top of JTAG core driver infrastructure, by applying bit-banging of TDI, TDO, TCK and TMS pins within the hardware specific driver. Oleksandr Shamray (4): Ernesto Corona (6): drivers: jtag: Add JTAG core driver dt-binding: jtag: Aspeed 2400 and 2500 series Add Aspeed SoC 24xx and 25xx families JTAG master driver Documentation: jtag: Add ABI documentation Documentation jtag: Add JTAG core driver ioctl number drivers: jtag: Add JTAG core driver Maintainers Documentation/ABI/testing/jtag-dev | 23 + .../devicetree/bindings/jtag/aspeed-jtag.yaml | 71 ++ Documentation/index.rst | 1 + Documentation/jtag/index.rst | 18 + Documentation/jtag/jtag-summary.rst | 47 + Documentation/jtag/jtagdev.rst | 194 ++++ .../userspace-api/ioctl/ioctl-number.rst | 2 + MAINTAINERS | 11 + drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/jtag/Kconfig | 31 + drivers/jtag/Makefile | 2 + drivers/jtag/jtag-aspeed.c | 1027 +++++++++++++++++ drivers/jtag/jtag.c | 301 +++++ include/linux/jtag.h | 44 + include/uapi/linux/jtag.h | 194 ++++ 16 files changed, 1969 insertions(+) create mode 100644 Documentation/ABI/testing/jtag-dev create mode 100644 Documentation/devicetree/bindings/jtag/aspeed-jtag.yaml create mode 100644 Documentation/jtag/index.rst create mode 100644 Documentation/jtag/jtag-summary.rst create mode 100644 Documentation/jtag/jtagdev.rst create mode 100644 drivers/jtag/Kconfig create mode 100644 drivers/jtag/Makefile create mode 100644 drivers/jtag/jtag-aspeed.c create mode 100644 drivers/jtag/jtag.c create mode 100644 include/linux/jtag.h create mode 100644 include/uapi/linux/jtag.h -- 2.17.1