{"id":803036,"url":"http://patchwork.ozlabs.org/api/patches/803036/?format=json","web_url":"http://patchwork.ozlabs.org/project/skiboot/patch/1503033595-3409-1-git-send-email-alistair@popple.id.au/","project":{"id":44,"url":"http://patchwork.ozlabs.org/api/projects/44/?format=json","name":"skiboot firmware development","link_name":"skiboot","list_id":"skiboot.lists.ozlabs.org","list_email":"skiboot@lists.ozlabs.org","web_url":"http://github.com/open-power/skiboot","scm_url":"http://github.com/open-power/skiboot","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1503033595-3409-1-git-send-email-alistair@popple.id.au>","list_archive_url":null,"date":"2017-08-18T05:19:55","name":"hw/npu2.c: Add ibm, nvlink-speed device-tree property","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"92cfd930b1030501e32e30e15bfcb1b690026045","submitter":{"id":24781,"url":"http://patchwork.ozlabs.org/api/people/24781/?format=json","name":"Alistair Popple","email":"alistair@popple.id.au"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/skiboot/patch/1503033595-3409-1-git-send-email-alistair@popple.id.au/mbox/","series":[],"comments":"http://patchwork.ozlabs.org/api/patches/803036/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/803036/checks/","tags":{},"related":[],"headers":{"Return-Path":"<skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","skiboot@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","skiboot@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xYWcS61qkz9t2x\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 18 Aug 2017 15:20:08 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xYWcS59tkzDrJR\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 18 Aug 2017 15:20:08 +1000 (AEST)","from ozlabs.org (bilbo.ozlabs.org [103.22.144.67])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xYWcF36jmzDqkv\n\tfor <skiboot@lists.ozlabs.org>; Fri, 18 Aug 2017 15:19:57 +1000 (AEST)","from authenticated.ozlabs.org (localhost [127.0.0.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPSA id 3xYWcF1hYkz9t31;\n\tFri, 18 Aug 2017 15:19:57 +1000 (AEST)"],"From":"Alistair Popple <alistair@popple.id.au>","To":"skiboot@lists.ozlabs.org","Date":"Fri, 18 Aug 2017 15:19:55 +1000","Message-Id":"<1503033595-3409-1-git-send-email-alistair@popple.id.au>","X-Mailer":"git-send-email 2.1.4","Subject":"[Skiboot] [PATCH] hw/npu2.c: Add ibm,\n\tnvlink-speed device-tree property","X-BeenThere":"skiboot@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Mailing list for skiboot development <skiboot.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/skiboot>,\n\t<mailto:skiboot-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/skiboot/>","List-Post":"<mailto:skiboot@lists.ozlabs.org>","List-Help":"<mailto:skiboot-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/skiboot>,\n\t<mailto:skiboot-request@lists.ozlabs.org?subject=subscribe>","Cc":"Alistair Popple <alistair@popple.id.au>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org","Sender":"\"Skiboot\"\n\t<skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"},"content":"NVLink2 links can support multiple different speeds. However the device driver\nhas no way of determining which speed was programmed so pass it down as a device\ntree property.\n\nSigned-off-by: Alistair Popple <alistair@popple.id.au>\n---\n doc/device-tree/nvlink.rst | 7 ++++++-\n hw/npu2.c                  | 8 ++++++++\n 2 files changed, 14 insertions(+), 1 deletion(-)","diff":"diff --git a/doc/device-tree/nvlink.rst b/doc/device-tree/nvlink.rst\nindex 6ce44e9..9f3fecb 100644\n--- a/doc/device-tree/nvlink.rst\n+++ b/doc/device-tree/nvlink.rst\n@@ -105,7 +105,12 @@ Emulated PCI device bindings\n                         vendor-id = <0x1014>;\n                         ibm,gpu = <0x100002f7>; /* phandle pointing the associated GPU PCI device node */\n \t\t\tmemory-region = <0x10000abc>; /* phandle pointing to the GPU memory */\n-\t\t\tphandle = <0x100002fc>;\n+                        ibm,nvlink-speed = <0x1>;\n+\n+                ; Denotes the speed the link is running at:\n+                ; 0x3 == 20 Gbps, 0x8 = 25.78125 Gbps, 0x9 == 25.00000 Gbps\n+\n+                        phandle = <0x100002fc>;\n                 };\n \n                 pci@1 {\ndiff --git a/hw/npu2.c b/hw/npu2.c\nindex 74e3325..3c1db4f 100644\n--- a/hw/npu2.c\n+++ b/hw/npu2.c\n@@ -683,6 +683,14 @@ static int npu2_dn_fixup(struct phb *phb,\n \tnpu2_dn_fixup_gmb(pd->dn, dev);\n \tdt_add_property_cells(pd->dn, \"ibm,nvlink\", dev->dt_node->phandle);\n \n+\t/* NVLink supports multiple speeds and device drivers need to know what\n+\t * speed has been set by firmware. The speed is actually controlled by\n+\t * Hostboot, so until we get a HDAT entry telling us what speed they\n+\t * programmed we will just hard code it here and hope it matches. If it\n+\t * doesn't it is always possible to manually override it when installing\n+\t * the device driver. */\n+\tdt_add_property_cells(pd->dn, \"ibm,nvlink-speed\", 0x9);\n+\n \t/* NPU devices require a slot location to associate with GPUs */\n \tdev->slot_label = dt_prop_get_def(pd->dn, \"ibm,slot-label\", NULL);\n \tif (!dev->slot_label) {\n","prefixes":[]}