Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2109450ybb; Sun, 29 Mar 2020 22:54:02 -0700 (PDT) X-Google-Smtp-Source: ADFU+vudHstPzHBLACciX5pt8tASMnwJQS+qTPS3OHjMy3pC/OIT50m2BKtbdN5zBvtF9Nhr+kJG X-Received: by 2002:a9d:5ad:: with SMTP id 42mr8522061otd.231.1585547641948; Sun, 29 Mar 2020 22:54:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585547641; cv=none; d=google.com; s=arc-20160816; b=C0cj6TU2TaRDVFxtAJ6zLAPLzxx1fcuMNxehbvW8eoF0h0Um7jg+iaHr1FW0HVlTmj M3Sl+GlV/ncbX7eQp6++VfduwLe6hWLS32BjSzgmpEiXhM4e/McteLXkjVlzFKmdM8+0 K4OuK6MUull2J81TOAcbawuBHWDpnjbvzXrDVCHb/VVJM8GbEx2yztyDqvL3raK7qBhK stq0/0/01FazUQ1KK0aKWrxdf5CkL4A+6NIT3kSAVMo8bIJSJnJMcysKDmsz3M9FLCEj Ucj6WqewhmkYMOWaWUdOlzuqvX3Ycr+LZTXjDzKN/dv0IEfxLPvxrygiQ6OgM4Bqu0Kt QrhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vSWIaxL5pI42gTrBMFWUjH+hWb5Mc+ZTDmdtBDwYlKk=; b=RWFqYO5TQbxxh4pBn2TimD07dKWdGuwzT71RR6EAiChGGiNhvAsVW0pWetDiGKAv3t zpGJU2JBUuT6TJUc1BRFO5pmKzOFc6hXrv4yoA+3U6OP2chv2dKibetph/C1mkHTRlO4 Y07otucPrXXWbV17EMiux4TKK/703hcxfImqq13ORlMQfTZsfWtNkmdYKrg0+OSgXilt UB5SFzG/eZwDv02xoaTHcuHWAzC7aeKvomKbOSQcbFsmtvmtvSadzuu2+ljFU4XTYiYJ gKlvokrLLgsQWJRqa4BAeJXjrzUyoVif5GZ9TJdFcHEjyMDWO5Wbwoj6iGN7Ez+U/uAr lS7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@d-silva.org header.s=201810a header.b=TXqe6QDq; 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 a14si5234895otr.170.2020.03.29.22.53.50; Sun, 29 Mar 2020 22:54:01 -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; dkim=pass header.i=@d-silva.org header.s=201810a header.b=TXqe6QDq; 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 S1728837AbgC3FxK (ORCPT + 99 others); Mon, 30 Mar 2020 01:53:10 -0400 Received: from ushosting.nmnhosting.com ([66.55.73.32]:37500 "EHLO ushosting.nmnhosting.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728492AbgC3FxJ (ORCPT ); Mon, 30 Mar 2020 01:53:09 -0400 Received: from mail2.nmnhosting.com (unknown [202.169.106.97]) by ushosting.nmnhosting.com (Postfix) with ESMTPS id AF2322DC685E; Mon, 30 Mar 2020 16:52:51 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=d-silva.org; s=201810a; t=1585547572; bh=DG24uTFgm3ncmUTPxNdi4/JJAgeS8enEWAzD03RxOZg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TXqe6QDqrC9mr09B5wF/29o0TTisxmFcpb5xQh1cZb3/AR1YXvRJoY3sx1z5LcBrJ t+zJPG4Xc2mBEfI9YJ7ZlVHEqpnEIjgtG+oJxMMcOxiWX5uzkfFNWyD8/6zjasfBTB rqVrg2JP746Asy6Z/qaq9NMnTrtWQVnCkBaPFUTOag7RLSOQ+9ZtmG2HohPm8pWRHB SfhVnebyKrHl4UmR+bvyFhsVxhMHGgcIY7wtxBko3oFk4oPb63fkDyyLz5sSLjH2qY aTAC1kB9J2U44M2VoXiD8s9EsJGtTe8Fk/lfb3T6+EGaPceKk9iT6/jkKMukuv4Skj 6/6s6vgnQWdmcMo5HODCL7TUdBesiiHnc2KpFVyZPTgZ6BNryXNj+mmuNJdV4HLtlr P3w8SP9EHHAq4QIMmgJXJfzAtLXITdqEcvLHiO7YX1AhrZqRQRzFTrYNI5c//gmrqg is5EJ/rlAXvxvbSgXvQ3fkGOdaje6XLIU1B/fA0oWC0K4UzVpxsgeva6a891KuU/qT 5v1DJFbFVYhn/OiuiOgTT+XCkQnZ3c1Vs7td9zkVBOOqt56O61tzdqtWQdGqlJTOIw spFT5kwK2XD1UnFYSz49rNfHBpGn5H4Ezzhmxgd/eUnWxy+gjeNaS8tPjgnmay81N5 9azCa0l7R+D6MSdd46z0bfig= Received: from localhost.lan ([10.0.1.179]) by mail2.nmnhosting.com (8.15.2/8.15.2) with ESMTP id 02R7C4Al045934; Fri, 27 Mar 2020 18:12:17 +1100 (AEDT) (envelope-from alastair@d-silva.org) From: "Alastair D'Silva" To: alastair@d-silva.org Cc: "Aneesh Kumar K . V" , "Oliver O'Halloran" , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Frederic Barrat , Andrew Donnellan , Arnd Bergmann , Greg Kroah-Hartman , Dan Williams , Vishal Verma , Dave Jiang , Ira Weiny , Andrew Morton , Mauro Carvalho Chehab , "David S. Miller" , Rob Herring , Anton Blanchard , Krzysztof Kozlowski , Mahesh Salgaonkar , Madhavan Srinivasan , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Anju T Sudhakar , Hari Bathini , Thomas Gleixner , Greg Kurz , Nicholas Piggin , Masahiro Yamada , Alexey Kardashevskiy , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-nvdimm@lists.01.org, linux-mm@kvack.org Subject: [PATCH v4 12/25] nvdimm/ocxl: Add register addresses & status values to the header Date: Fri, 27 Mar 2020 18:11:49 +1100 Message-Id: <20200327071202.2159885-13-alastair@d-silva.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200327071202.2159885-1-alastair@d-silva.org> References: <20200327071202.2159885-1-alastair@d-silva.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mail2.nmnhosting.com [10.0.1.20]); Fri, 27 Mar 2020 18:12:17 +1100 (AEDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These values have been taken from the device specifications. Signed-off-by: Alastair D'Silva --- drivers/nvdimm/ocxl/ocxlpmem.h | 73 ++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/drivers/nvdimm/ocxl/ocxlpmem.h b/drivers/nvdimm/ocxl/ocxlpmem.h index 03fe7a264281..322387873b4b 100644 --- a/drivers/nvdimm/ocxl/ocxlpmem.h +++ b/drivers/nvdimm/ocxl/ocxlpmem.h @@ -8,6 +8,79 @@ #define LABEL_AREA_SIZE BIT_ULL(PA_SECTION_SHIFT) +#define GLOBAL_MMIO_CHI 0x000 +#define GLOBAL_MMIO_CHIC 0x008 +#define GLOBAL_MMIO_CHIE 0x010 +#define GLOBAL_MMIO_CHIEC 0x018 +#define GLOBAL_MMIO_HCI 0x020 +#define GLOBAL_MMIO_HCIC 0x028 +#define GLOBAL_MMIO_IMA0_OHP 0x040 +#define GLOBAL_MMIO_IMA0_CFP 0x048 +#define GLOBAL_MMIO_IMA1_OHP 0x050 +#define GLOBAL_MMIO_IMA1_CFP 0x058 +#define GLOBAL_MMIO_ACMA_CREQO 0x100 +#define GLOBAL_MMIO_ACMA_CRSPO 0x104 +#define GLOBAL_MMIO_ACMA_CDBO 0x108 +#define GLOBAL_MMIO_ACMA_CDBS 0x10c +#define GLOBAL_MMIO_NSCMA_CREQO 0x120 +#define GLOBAL_MMIO_NSCMA_CRSPO 0x124 +#define GLOBAL_MMIO_NSCMA_CDBO 0x128 +#define GLOBAL_MMIO_NSCMA_CDBS 0x12c +#define GLOBAL_MMIO_CSTS 0x140 +#define GLOBAL_MMIO_FWVER 0x148 +#define GLOBAL_MMIO_CCAP0 0x160 +#define GLOBAL_MMIO_CCAP1 0x168 + +#define GLOBAL_MMIO_CHI_ACRA BIT_ULL(0) +#define GLOBAL_MMIO_CHI_NSCRA BIT_ULL(1) +#define GLOBAL_MMIO_CHI_CRDY BIT_ULL(4) +#define GLOBAL_MMIO_CHI_CFFS BIT_ULL(5) +#define GLOBAL_MMIO_CHI_MA BIT_ULL(6) +#define GLOBAL_MMIO_CHI_ELA BIT_ULL(7) +#define GLOBAL_MMIO_CHI_CDA BIT_ULL(8) +#define GLOBAL_MMIO_CHI_CHFS BIT_ULL(9) + +#define GLOBAL_MMIO_CHI_ALL (GLOBAL_MMIO_CHI_ACRA | \ + GLOBAL_MMIO_CHI_NSCRA | \ + GLOBAL_MMIO_CHI_CRDY | \ + GLOBAL_MMIO_CHI_CFFS | \ + GLOBAL_MMIO_CHI_MA | \ + GLOBAL_MMIO_CHI_ELA | \ + GLOBAL_MMIO_CHI_CDA | \ + GLOBAL_MMIO_CHI_CHFS) + +#define GLOBAL_MMIO_HCI_ACRW BIT_ULL(0) // ACRW +#define GLOBAL_MMIO_HCI_NSCRW BIT_ULL(1) // NSCRW +#define GLOBAL_MMIO_HCI_AFU_RESET BIT_ULL(2) // AR +#define GLOBAL_MMIO_HCI_FW_DEBUG BIT_ULL(3) // FDE +#define GLOBAL_MMIO_HCI_CONTROLLER_DUMP BIT_ULL(4) // CD +#define GLOBAL_MMIO_HCI_CONTROLLER_DUMP_COLLECTED BIT_ULL(5) // CDC +#define GLOBAL_MMIO_HCI_REQ_HEALTH_PERF BIT_ULL(6) // CHPD + +#define ADMIN_COMMAND_HEARTBEAT 0x00u +#define ADMIN_COMMAND_SHUTDOWN 0x01u +#define ADMIN_COMMAND_FW_UPDATE 0x02u +#define ADMIN_COMMAND_FW_DEBUG 0x03u +#define ADMIN_COMMAND_ERRLOG 0x04u +#define ADMIN_COMMAND_SMART 0x05u +#define ADMIN_COMMAND_CONTROLLER_STATS 0x06u +#define ADMIN_COMMAND_CONTROLLER_DUMP 0x07u +#define ADMIN_COMMAND_CMD_CAPS 0x08u +#define ADMIN_COMMAND_MAX 0x08u + +#define STATUS_SUCCESS 0x00 +#define STATUS_MEM_UNAVAILABLE 0x20 +#define STATUS_BLOCKED_BG_TASK 0x21 +#define STATUS_BAD_OPCODE 0x50 +#define STATUS_BAD_REQUEST_PARM 0x51 +#define STATUS_BAD_DATA_PARM 0x52 +#define STATUS_DEBUG_BLOCKED 0x70 +#define STATUS_FAIL 0xFF + +#define STATUS_FW_UPDATE_BLOCKED STATUS_BLOCKED_BG_TASK +#define STATUS_FW_ARG_INVALID STATUS_BAD_REQUEST_PARM +#define STATUS_FW_INVALID STATUS_BAD_DATA_PARM + struct ocxlpmem { struct device dev; struct pci_dev *pdev; -- 2.24.1