From patchwork Mon Nov 13 11:06:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Neuling X-Patchwork-Id: 837418 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 3yb7Ck1763z9sRV for ; Mon, 13 Nov 2017 22:08:02 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3yb7Ck0HTbzDqj8 for ; Mon, 13 Nov 2017 22:08:02 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3yb7BW1KF8zDqb5 for ; Mon, 13 Nov 2017 22:06:59 +1100 (AEDT) Received: from localhost.localdomain (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 3yb7BV0y1rz9t2W; Mon, 13 Nov 2017 22:06:58 +1100 (AEDT) Received: by localhost.localdomain (Postfix, from userid 1000) id F1AEEEEA9EF; Mon, 13 Nov 2017 22:06:57 +1100 (AEDT) From: Michael Neuling To: stewart@linux.vnet.ibm.com Date: Mon, 13 Nov 2017 22:06:43 +1100 Message-Id: <20171113110644.15478-4-mikey@neuling.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171113110644.15478-1-mikey@neuling.org> References: <20171113110644.15478-1-mikey@neuling.org> Subject: [Skiboot] [PATCH 4/5] phys-map: Rename GPU_MEM to GPU_MEM_4T_DOWN X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: skiboot@lists.ozlabs.org, mikey@neuling.org, Reza Arbab , alistair@popple.id.au MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" This map is soon to be replaced, but we are going to keep it around for a little while so that we support older hostboot firmware. Rename it for now. Signed-off-by: Michael Neuling Reviewed-by: Balbir Singh --- hw/npu2.c | 8 ++++---- hw/phys-map.c | 14 +++++++------- include/phys-map.h | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/npu2.c b/hw/npu2.c index 79ebaff75f..082591a638 100644 --- a/hw/npu2.c +++ b/hw/npu2.c @@ -596,7 +596,7 @@ static void npu2_get_gpu_base(struct npu2_dev *ndev, uint64_t *addr, uint64_t *s int group; group = (ndev->bdfn >> 3) & 0x1f; - phys_map_get(ndev->npu->chip_id, GPU_MEM, group, addr, size); + phys_map_get(ndev->npu->chip_id, GPU_MEM_4T_DOWN, group, addr, size); } static void npu2_dn_fixup_gmb(struct dt_node *pd_dn, struct npu2_dev *ndev) @@ -855,16 +855,16 @@ static void npu2_mcd_init(struct npu2 *p) uint64_t size, addr, gpu_min_addr, gpu_max_addr, total_size; /* Init memory cache directory (MCD) registers. */ - phys_map_get(p->chip_id, GPU_MEM, NPU2_LINKS_PER_CHIP - 1, + phys_map_get(p->chip_id, GPU_MEM_4T_DOWN, NPU2_LINKS_PER_CHIP - 1, &gpu_min_addr, NULL); - phys_map_get(p->chip_id, GPU_MEM, 0, &gpu_max_addr, &size); + phys_map_get(p->chip_id, GPU_MEM_4T_DOWN, 0, &gpu_max_addr, &size); gpu_max_addr += size; /* We assume GPU memory is contiguous from the first possible GPU to the * last and that the size is the same so best to check that. */ for (i = 0; i < NPU2_LINKS_PER_CHIP; i++) { uint64_t tmp; - phys_map_get(p->chip_id, GPU_MEM, i, &addr, &tmp); + phys_map_get(p->chip_id, GPU_MEM_4T_DOWN, i, &addr, &tmp); assert((addr >= gpu_min_addr) && (addr + tmp <= gpu_max_addr)); assert(tmp == size); } diff --git a/hw/phys-map.c b/hw/phys-map.c index 8cccbf07b7..02bc33b8f8 100644 --- a/hw/phys-map.c +++ b/hw/phys-map.c @@ -37,15 +37,15 @@ static const struct phys_map_info *phys_map; static const struct phys_map_entry phys_map_table_nimbus[] = { - /* System memory u pto 4TB minus GPU memory */ + /* System memory upto 4TB minus GPU memory */ { SYSTEM_MEM, 0, 0x0000000000000000ull, 0x0000034000000000ull }, /* GPU memory from 4TB - 128GB*GPU */ - { GPU_MEM, 5, 0x0000034000000000ull, 0x0000002000000000ull }, - { GPU_MEM, 4, 0x0000036000000000ull, 0x0000002000000000ull }, - { GPU_MEM, 3, 0x0000038000000000ull, 0x0000002000000000ull }, - { GPU_MEM, 2, 0x000003a000000000ull, 0x0000002000000000ull }, - { GPU_MEM, 1, 0x000003c000000000ull, 0x0000002000000000ull }, - { GPU_MEM, 0, 0x000003e000000000ull, 0x0000002000000000ull }, + { GPU_MEM_4T_DOWN, 5, 0x0000034000000000ull, 0x0000002000000000ull }, + { GPU_MEM_4T_DOWN, 4, 0x0000036000000000ull, 0x0000002000000000ull }, + { GPU_MEM_4T_DOWN, 3, 0x0000038000000000ull, 0x0000002000000000ull }, + { GPU_MEM_4T_DOWN, 2, 0x000003a000000000ull, 0x0000002000000000ull }, + { GPU_MEM_4T_DOWN, 1, 0x000003c000000000ull, 0x0000002000000000ull }, + { GPU_MEM_4T_DOWN, 0, 0x000003e000000000ull, 0x0000002000000000ull }, /* 0 TB offset @ MMIO 0x0006000000000000ull */ { PHB4_64BIT_MMIO, 0, 0x0006000000000000ull, 0x0000004000000000ull }, diff --git a/include/phys-map.h b/include/phys-map.h index 3621bfd20a..c9b2389615 100644 --- a/include/phys-map.h +++ b/include/phys-map.h @@ -26,7 +26,7 @@ enum phys_map_type { NULL_MAP, SYSTEM_MEM, - GPU_MEM, + GPU_MEM_4T_DOWN, PHB4_64BIT_MMIO, PHB4_32BIT_MMIO, PHB4_XIVE_ESB,