From patchwork Thu Jan 17 05:05:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lei YU X-Patchwork-Id: 1026408 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43gBpr3M6Cz9sD4 for ; Thu, 17 Jan 2019 16:05:24 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="h8GfeLDm"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 43gBpr2KdxzDqkK for ; Thu, 17 Jan 2019 16:05:24 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::642; helo=mail-pl1-x642.google.com; envelope-from=mine260309@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="h8GfeLDm"; dkim-atps=neutral Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 43gBpk0jQxzDqjQ for ; Thu, 17 Jan 2019 16:05:17 +1100 (AEDT) Received: by mail-pl1-x642.google.com with SMTP id a14so4125918plm.12 for ; Wed, 16 Jan 2019 21:05:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=goCDGDx5BYa2bV7eqbGe3k6T5Pq1I4pVVwRzYf3JWio=; b=h8GfeLDmFAiz/tQqQXUBOaNTKNrDt3F8fu32tZOsqSGU6WnZ4z2j/IEc+Mj24Wjaz1 rQ7vUY4pcpHVgsm0nA+feqAzIW4igsB5LN+uCsHpV9xjOS0IpNUJ2JbzUZ/3nO6PK9gW zm1Dom+nKFqCAHZ35H7p+gddBBSz0ovs95+zK6Od4GAqFk81Vqb8xvnOjWdF6e8/1oxF 7tXI0Cegv2chmRs0jRBU/c0gn3U9Z6e9bmsFUZZqlW/BMyS3GRuXm+Cb4PPFAeQOfRAF gq3aZgebnKwK3kvVjdd9WuuuXQo0MUVX4odG1vRmWBiJEbekpbkgy3cKn2bTC3N78LUg ljdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=goCDGDx5BYa2bV7eqbGe3k6T5Pq1I4pVVwRzYf3JWio=; b=A2DRExst0A/YKK7xDct7S9bN7IwK/e/J+FtWjAgoNLVXxOnB/Rjz0ZeBGihhmj9eCb rOHJE+JAy/xkGoARDY7YGZUOuN2RMFx5AYiwuBqUf9f/Y/gU794GXLXdCtvumixe4lS7 9mVUIkGx2k1gyAmEki8CTF/DU6tARh5KXRX+XyKtGj4I9AsJjUJ+AEhAjFh3tuszztex YN859fuOtVMKtJPXKttDSqM21fsSqHnTZqBZViDNeMAaAZX0DhbHfdREIKam3H9oay9a JFmgD9jEojPm9oAvBH2s35RwFb5OFpBq14kXgEmJ2wcbuvKhsJ6E/WxAnS7ot4vKbBrK jevQ== X-Gm-Message-State: AJcUukfgUgoBG0pgLwhVjRJXjy3/OmB88V+fWwLQrJbHzQcbxlbyyDfx 6IiGoN+lishZyb21GrJ3Z+1slfz0 X-Google-Smtp-Source: ALg8bN6YMKKIoyeP51WQF7rH4UIPDdhL5qMQS33DcQnU1cF271KX41ExvCloRRLquGG2ksmzHZZu3g== X-Received: by 2002:a17:902:28e9:: with SMTP id f96mr13554336plb.169.1547701515380; Wed, 16 Jan 2019 21:05:15 -0800 (PST) Received: from localhost ([192.241.230.188]) by smtp.gmail.com with ESMTPSA id q7sm411378pgp.40.2019.01.16.21.05.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 21:05:14 -0800 (PST) From: Lei YU To: skiboot@lists.ozlabs.org Date: Thu, 17 Jan 2019 13:05:04 +0800 Message-Id: <1547701504-84382-1-git-send-email-mine260309@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [Skiboot] [PATCH] Add opal_msg_type OPAL_MSG_HOTPLUG X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" This message is used to notify kernel about an PCIe hotplug event occurs on slots connected directly to CPU. Updated doc/pci-slot.rst to describe the details of the usage of this event. Signed-off-by: Lei YU --- doc/pci-slot.rst | 12 ++++++++++++ include/opal-api.h | 1 + 2 files changed, 13 insertions(+) diff --git a/doc/pci-slot.rst b/doc/pci-slot.rst index fd3fd7d..7790175 100644 --- a/doc/pci-slot.rst +++ b/doc/pci-slot.rst @@ -66,6 +66,7 @@ Property Definition ibm,reset-by-firmware Boolean indicating whether the slot reset should be done in firmware ibm,slot-pluggable Boolean indicating whether the slot is pluggable ibm,slot-surprise-pluggable Boolean indicating whether the slot supports surprise hotplug +ibm,slot-use-hotplug-event Boolean indicating whether the slot shall use opal message to handle hotplug ibm,slot-broken-pdc Boolean indicating whether PDC (Presence Detection Change) is broken ibm,slot-power-ctl Boolean indicating whether the slot has power control ibm,slot-wired-lanes The number of hardware lanes that are wired @@ -105,6 +106,17 @@ removed or added accordingly, without actually changing the slot's power state. The API call will return OPAL_SUCCESS immediately and no further asynchronous message will be sent. +In case of a slot directly connected to CPU instead of PCIe switch, there is no +hotplug interrupt generated by switch. The property "ibm,slot-use-hotplug-event" +is added to support this case. Typically a GPIO interrupt is generated from the +peripheral device and sent to CPU. Skiboot then handles the interrupt, retrieves +the hotplug status, and then sends an opal message to kernel with parameters of + * An integer indicating the slot id + * A boolean indicating if the device is plugged out or in + +Example: + opal_queue_msg(OPAL_MSG_HOTPLUG, NULL, NULL, , <0|1>); + PCI Slot on Apollo and Firenze ------------------------------ diff --git a/include/opal-api.h b/include/opal-api.h index 5f397c8..a262054 100644 --- a/include/opal-api.h +++ b/include/opal-api.h @@ -547,6 +547,7 @@ enum opal_msg_type { OPAL_MSG_DPO = 5, OPAL_MSG_PRD = 6, OPAL_MSG_OCC = 7, + OPAL_MSG_HOTPLUG = 8, /* params[0] = slot id, param[1] = 0 out, 1 in */ OPAL_MSG_TYPE_MAX, };