From patchwork Wed Aug 15 08:25:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 957812 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41r2bp1TVtz9sBx for ; Wed, 15 Aug 2018 18:25:58 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.ru Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41r2bp0PT3zF1Rx for ; Wed, 15 Aug 2018 18:25:58 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.ru X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=ozlabs.ru (client-ip=107.173.13.209; helo=ozlabs.ru; envelope-from=aik@ozlabs.ru; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.ru Received: from ozlabs.ru (unknown [107.173.13.209]) by lists.ozlabs.org (Postfix) with ESMTP id 41r2bj0ys2zF1RN for ; Wed, 15 Aug 2018 18:25:50 +1000 (AEST) Received: from vpl1.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id 152D6AE80007; Wed, 15 Aug 2018 04:23:47 -0400 (EDT) From: Alexey Kardashevskiy To: skiboot@lists.ozlabs.org Date: Wed, 15 Aug 2018 18:25:13 +1000 Message-Id: <20180815082513.18567-1-aik@ozlabs.ru> X-Mailer: git-send-email 2.11.0 Subject: [Skiboot] [RFC PATCH skiboot] npu2: Remove redundand dt_node X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Donnellan MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The npu2 struct embeds a phb struct which also has a DT node pointer, use that. Signed-off-by: Alexey Kardashevskiy --- On witherspoon it is just always NULL. --- include/npu2.h | 1 - hw/npu2-opencapi.c | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/npu2.h b/include/npu2.h index 4c2e20e..34bc650 100644 --- a/include/npu2.h +++ b/include/npu2.h @@ -142,7 +142,6 @@ struct npu2_dev { struct npu2 { uint32_t index; - struct dt_node *dt_node; uint32_t chip_id; uint64_t xscom_base; void *regs; diff --git a/hw/npu2-opencapi.c b/hw/npu2-opencapi.c index 57c2f2f..e55bdcb 100644 --- a/hw/npu2-opencapi.c +++ b/hw/npu2-opencapi.c @@ -1584,7 +1584,7 @@ static void npu2_opencapi_setup_device(struct dt_node *dn_link, struct npu2 *n, uint64_t mm_win[2]; dev_index = dt_prop_get_u32(dn_link, "ibm,npu-link-index"); - npu_index = dt_prop_get_u32(n->dt_node, "ibm,npu-index"); + npu_index = dt_prop_get_u32(n->phb_nvlink.dt_node, "ibm,npu-index"); /* Populate PHB device node */ phys_map_get(n->chip_id, NPU_OCAPI_MMIO, dev_index, &mm_win[0], @@ -1610,7 +1610,8 @@ static void npu2_opencapi_setup_device(struct dt_node *dn_link, struct npu2 *n, dt_add_property_cells(dn_phb, "ibm,npu-index", npu_index); dt_add_property_cells(dn_phb, "ibm,chip-id", n->chip_id); dt_add_property_cells(dn_phb, "ibm,xscom-base", n->xscom_base); - dt_add_property_cells(dn_phb, "ibm,npcq", n->dt_node->phandle); + dt_add_property_cells(dn_phb, "ibm,npcq", + n->phb_nvlink.dt_node->phandle); dt_add_property_cells(dn_phb, "ibm,links", 1); dt_add_property(dn_phb, "ibm,mmio-window", mm_win, sizeof(mm_win)); dt_add_property_cells(dn_phb, "ibm,phb-diag-data-size", 0); @@ -1730,7 +1731,6 @@ static void npu2_opencapi_probe(struct dt_node *dn) n->chip_id = gcid; n->xscom_base = scom_base; n->regs = (void *)reg[0]; - n->dt_node = dn; dt_for_each_compatible(dn, link, "ibm,npu-link") { dev_index = dt_prop_get_u32(link, "ibm,npu-link-index");