Received: by 10.213.65.68 with SMTP id h4csp365529imn; Fri, 23 Mar 2018 06:23:35 -0700 (PDT) X-Google-Smtp-Source: AG47ELs8wodY6MFh0xldi/ktYRxGiNReHL9LgAwRFTb6LqhuH6eYtw64I+x3dQKWV5yDUDAAc8BP X-Received: by 2002:a17:902:24a5:: with SMTP id w34-v6mr29391161pla.328.1521811415809; Fri, 23 Mar 2018 06:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521811415; cv=none; d=google.com; s=arc-20160816; b=qiW9d+GO2dSqnw0laVrsjcs2UqLS+XAeVLhUEGKi+5J38Ij2D/hWnx1/SIpNYSVD/3 6ffm9VGprpJD4lCbwQEPjcgpKQExS2qU69x8hS6KK+d6Fwh+KVWqTZ5VOr5kW6vtwxV8 WBGBnprFNfNfGifpBp9gAIOg69shCOcoJ/VYW8NcgfDW6hqCH8yAEcHP4skifFKsJWPN Ku/kapAkPE9+QtaeGs87ofOfg23EeVe1FgNgr2e3HY7nbnshgn33NqTOWVcDNXKYhHLF FlVgdHnbW2khXHJPzzYwMCJaKo5II8gjYK7X0ZiRGxj5Hw5Zza5PE3qQkCXTQkqJiRyN zbtw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=nYzxPRWdmD1lHP4Z5HwkyM14NuPQUYrWmaV2nGzQEng=; b=FwGDQeGf6EyRX/YOBED5xHm6rGe5vi0kzNDFBlm1ABlrMNEbtTXPlTjeDeldiIgsFb mg03KZke/0EhxHvhFYLmbkPpJ1jqBn2nPGz7YwPbcTdJYpsBGa8029biFawaikpKNwsQ 3yJ2NMw8XIXDfqms/Mp8Snr1QbqfnNjyfGgWWvPJCpvvgDV1m5zK6MKDwKbIMoKO1FIS Kc+DUaMeVwTqovcJii/I4TxPDK26sPCJEV1Tya17t8KuYIW31F5IeaAgTuP3KUHR5410 VffYspPv0/wF2pMPhUHxA31/bVHyPWVpMOwQUkm1dhRBCKR+hvvvgnaCNqyy0tNOEOST xbpw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si6695261pfr.368.2018.03.23.06.23.19; Fri, 23 Mar 2018 06:23:35 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752204AbeCWNWY (ORCPT + 99 others); Fri, 23 Mar 2018 09:22:24 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37662 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751294AbeCWNWX (ORCPT ); Fri, 23 Mar 2018 09:22:23 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 849111176; Fri, 23 Mar 2018 13:22:22 +0000 (UTC) Date: Fri, 23 Mar 2018 14:22:20 +0100 From: Greg KH To: Haiyue Wang Cc: joel@jms.id.au, andrew@aj.id.au, arnd@arndb.de, openbmc@lists.ozlabs.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, andriy.shevchenko@intel.com Subject: Re: [PATCH arm/aspeed/ast2500 v3] eSPI: add ASPEED AST2500 eSPI driver to boot a host with PCH runs on eSPI Message-ID: <20180323132220.GA14571@kroah.com> References: <1519394897-6095-1-git-send-email-haiyue.wang@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1519394897-6095-1-git-send-email-haiyue.wang@linux.intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 23, 2018 at 10:08:17PM +0800, Haiyue Wang wrote: > When PCH works under eSPI mode, the PMC (Power Management Controller) in > PCH is waiting for SUS_ACK from BMC after it alerts SUS_WARN. It is in > dead loop if no SUS_ACK assert. This is the basic requirement for the BMC > works as eSPI slave. > > Also for the host power on / off actions, from BMC side, the following VW > (Virtual Wire) messages are done in firmware: > 1. SLAVE_BOOT_LOAD_DONE / SLAVE_BOOT_LOAD_STATUS > 2. SUS_ACK > 3. OOB_RESET_ACK > 4. HOST_RESET_ACK > > Signed-off-by: Haiyue Wang > --- > v2 -> v3: > - Remove the unused header file reference. > - Change some code lines sequence. > > v1 -> v2: > - Fix the checkpatch.pl warning in file espi-slave.rst > Missing or malformed SPDX-License-Identifier tag in line 1 > #71: FILE: Documentation/misc-devices/espi-slave.rst:1: > - Make the Kconfig desciption to be more accurate. > --- > .../devicetree/bindings/misc/aspeed,espi-slave.txt | 20 ++ > Documentation/misc-devices/espi-slave.rst | 119 ++++++++++ > drivers/misc/Kconfig | 8 + > drivers/misc/Makefile | 1 + > drivers/misc/aspeed-espi-slave.c | 261 +++++++++++++++++++++ > 5 files changed, 409 insertions(+) > create mode 100644 Documentation/devicetree/bindings/misc/aspeed,espi-slave.txt > create mode 100644 Documentation/misc-devices/espi-slave.rst > create mode 100644 drivers/misc/aspeed-espi-slave.c > > diff --git a/Documentation/devicetree/bindings/misc/aspeed,espi-slave.txt b/Documentation/devicetree/bindings/misc/aspeed,espi-slave.txt > new file mode 100644 > index 0000000..4f5d47e > --- /dev/null > +++ b/Documentation/devicetree/bindings/misc/aspeed,espi-slave.txt > @@ -0,0 +1,20 @@ > +ASPEED eSPI Slave Controller > + > +Required properties: > + - compatible: must be one of: > + - "aspeed,ast2500-espi-slave" > + > + - reg: physical base address of the controller and length of memory mapped > + region > + > + - interrupts: interrupt generated by the controller > + > +Example: > + > + espi: espi@1e6ee000 { > + compatible = "aspeed,ast2500-espi-slave"; > + reg = <0x1e6ee000 0x100>; > + interrupts = <23>; > + status = "disabled"; > +}; > + You need to split this up into a separate patch and get the device tree maintainers to ack it, right? > diff --git a/Documentation/misc-devices/espi-slave.rst b/Documentation/misc-devices/espi-slave.rst > new file mode 100644 > index 0000000..185acd7 > --- /dev/null > +++ b/Documentation/misc-devices/espi-slave.rst > @@ -0,0 +1,119 @@ > +.. SPDX-License-Identifier: GPL-2.0 > + > +========== > +eSPI Slave > +========== > + > +:Author: Haiyue Wang > + > +The PCH (**eSPI master**) provides the eSPI to support connection of a > +BMC (**eSPI slave**) to the platform. > + > +The LPC and eSPI interfaces are mutually exclusive. Both use the same > +pins, but on power-up, a HW strap determines if the eSPI or the LPC bus > +is operational. Once selected, it’s not possible to change to the other > +interface. > + > +``eSPI Channels and Supported Transactions`` > + +------+---------------------+----------------------+--------------------+ > + | CH # | Channel | Posted Cycles | Non-Posted Cycles | > + +======+=====================+======================+====================+ > + | 0 | Peripheral | Memory Write, | Memory Read, | > + | | | Completions | I/O Read/Write | > + +------+---------------------+----------------------+--------------------+ > + | 1 | Virtual Wire | Virtual Wire GET/PUT | N/A | > + +------+---------------------+----------------------+--------------------+ > + | 2 | Out-of-Band Message | SMBus Packet GET/PUT | N/A | > + +------+---------------------+----------------------+--------------------+ > + | 3 | Flash Access | N/A | Flash Read, Write, | > + | | | | Erase | > + +------+---------------------+----------------------+--------------------+ > + | N/A | General | Register Accesses | N/A | > + +------+---------------------+----------------------+--------------------+ > + > +Virtual Wire Channel (Channel 1) Overview > +----------------------------------------- > + > +The Virtual Wire channel uses a standard message format to communicate > +several types of signals between the components on the platform:: > + > + - Sideband and GPIO Pins: System events and other dedicated signals > + between the PCH and eSPI slave. These signals are tunneled between the > + two components over eSPI. > + > + - Serial IRQ Interrupts: Interrupts are tunneled from the eSPI slave to > + the PCH. Both edge and triggered interrupts are supported. > + > +When PCH runs on eSPI mode, from BMC side, the following VW messages are > +done in firmware:: > + > + 1. SLAVE_BOOT_LOAD_DONE / SLAVE_BOOT_LOAD_STATUS > + 2. SUS_ACK > + 3. OOB_RESET_ACK > + 4. HOST_RESET_ACK > + > +``eSPI Virtual Wires (VW)`` > + +----------------------+---------+---------------------------------------+ > + |Virtual Wire |PCH Pin |Comments | > + | |Direction| | > + +======================+=========+=======================================+ > + |SUS_WARN# |Output |PCH pin is a GPIO when eSPI is enabled.| > + | | |eSPI controller receives as VW message.| > + +----------------------+---------+---------------------------------------+ > + |SUS_ACK# |Input |PCH pin is a GPIO when eSPI is enabled.| > + | | |eSPI controller receives as VW message.| > + +----------------------+---------+---------------------------------------+ > + |SLAVE_BOOT_LOAD_DONE |Input |Sent when the BMC has completed its | > + | | |boot process as an indication to | > + | | |eSPI-MC to continue with the G3 to S0 | > + | | |exit. | > + | | |The eSPI Master waits for the assertion| > + | | |of this virtual wire before proceeding | > + | | |with the SLP_S5# deassertion. | > + | | |The intent is that it is never changed | > + | | |except on a G3 exit - it is reset on a | > + | | |G3 entry. | > + +----------------------+---------+---------------------------------------+ > + |SLAVE_BOOT_LOAD_STATUS|Input |Sent upon completion of the Slave Boot | > + | | |Load from the attached flash. A stat of| > + | | |1 indicates that the boot code load was| > + | | |successful and that the integrity of | > + | | |the image is intact. | > + +----------------------+---------+---------------------------------------+ > + |HOST_RESET_WARN |Output |Sent from the MC just before the Host | > + | | |is about to enter reset. Upon receiving| > + | | |, the BMC must flush and quiesce its | > + | | |upstream Peripheral Channel request | > + | | |queues and assert HOST_RESET_ACK VWire.| > + | | |The MC subsequently completes any | > + | | |outstanding posted transactions or | > + | | |completions and then disables the | > + | | |Peripheral Channel via a write to | > + | | |the Slave's Configuration Register. | > + +----------------------+---------+---------------------------------------+ > + |HOST_RESET_ACK |Input |ACK for the HOST_RESET_WARN message | > + +----------------------+---------+---------------------------------------+ > + |OOB_RESET_WARN |Output |Sent from the MC just before the OOB | > + | | |processor is about to enter reset. Upon| > + | | |receiving, the BMC must flush and | > + | | |quiesce its OOB Channel upstream | > + | | |request queues and assert OOB_RESET_ACK| > + | | |VWire. The-MC subsequently completes | > + | | |any outstanding posted transactions or | > + | | |completions and then disables the OOB | > + | | |Channel via a write to the Slave's | > + | | |Configuration Register. | > + +----------------------+---------+---------------------------------------+ > + |OOB_RESET_ACK |Input |ACK for OOB_RESET_WARN message | > + +----------------------+---------+---------------------------------------+ > + > +`Intel C620 Series Chipset Platform Controller Hub > +`_ > + > + -- 17. Enhanced Serial Peripheral Interface What is this line for? "17."? > + > + > +`Enhanced Serial Peripheral Interface (eSPI) > +- Interface Base Specification (for Client and Server Platforms) > +`_ > + > diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig > index 03605f8..cf3e7a1 100644 > --- a/drivers/misc/Kconfig > +++ b/drivers/misc/Kconfig > @@ -472,6 +472,14 @@ config VEXPRESS_SYSCFG > bus. System Configuration interface is one of the possible means > of generating transactions on this bus. > > +config ASPEED_ESPI_SLAVE > + depends on ARCH_ASPEED || COMPILE_TEST > + depends on REGMAP_MMIO > + tristate "Aspeed ast2500 eSPI slave device driver" > + ---help--- > + Control Aspeed ast2500 eSPI slave controller to handle event > + which needs the firmware's processing. No module name and all that here? thanks, greg k-h