From patchwork Thu Oct 1 07:08:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1374877 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 (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C24762m6sz9sVT for ; Thu, 1 Oct 2020 17:11:46 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=lh5qUzYv; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4C24760pvXzDqTC for ; Thu, 1 Oct 2020 17:11:46 +1000 (AEST) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (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 lists.ozlabs.org (Postfix) with ESMTPS id 4C246z1wGRzDqRB for ; Thu, 1 Oct 2020 17:11:39 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=lh5qUzYv; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4C246t1dW3z9sVK; Thu, 1 Oct 2020 17:11:33 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1601536297; bh=Z402cTjPt9JlrMd4kfolu9HaME1hP0YVnfFuVUDuuy8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lh5qUzYvn99D3aPaR4VrQ1qcFzyyQ/8dBWrDgBrdqhOsq5KW4tMIMNM+xyZPe1fNw b37wpLrIg4BL/vzC0kq61WueBMcEhjRPL8+wlw/zs9jCSjbt2ykNfK/wMjwOVoHbFF MK9K854zntca9T/J5oo3jabWXAaD0ddMCOdyzHDEsZwEFv7l5TJ/N2FWOYk6Zjk6VE x6SkQ9ms96hicWifvcsP002dITCODZVXXfomQv77Sgi2+cDv7H8UegVLWC81leYNTU TCEAurHnhnOjvT3nxOxRsndFM1DY4oVtUsoP8ZhAwC6HRGN9q4UOdjN0Yhp5HvL+p9 8TgItas7fMgJA== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Thu, 1 Oct 2020 17:08:05 +1000 Message-Id: <20201001070814.102735-12-amitay@ozlabs.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201001070814.102735-1-amitay@ozlabs.org> References: <20201001070814.102735-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH v2 11/20] libsbefifo: Add new definitions for P10 sbe X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs Reviewed-by: Joel Stanley --- libsbefifo/libsbefifo.h | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/libsbefifo/libsbefifo.h b/libsbefifo/libsbefifo.h index 1c26ea3..e149de5 100644 --- a/libsbefifo/libsbefifo.h +++ b/libsbefifo/libsbefifo.h @@ -19,6 +19,12 @@ #include +/* + * libsbefifo implements SBE interfaces available via SBEFIFO device. The + * details of the interface can be found in SBE interface specification + * document (2.0 for P10). + */ + #define ESBEFIFO 201 #define SBEFIFO_PRI_SUCCESS 0x00000000 @@ -26,6 +32,7 @@ #define SBEFIFO_PRI_INVALID_DATA 0x00020000 #define SBEFIFO_PRI_SEQUENCE_ERROR 0x00030000 #define SBEFIFO_PRI_INTERNAL_ERROR 0x00040000 +#define SBEFIFO_PRI_ACCESS_DENIED 0x00050000 #define SBEFIFO_PRI_UNKNOWN_ERROR 0x00FE0000 #define SBEFIFO_SEC_SUCCESS 0x0000 @@ -47,6 +54,44 @@ #define SBEFIFO_SEC_HW_TIMEOUT 0x0010 #define SBEFIFO_SEC_PIB_ERROR 0x0011 #define SBEFIFO_SEC_PARITY_ERROR 0x0012 +#define SBEFIFO_SEC_UNUSED 0x0013 +#define SBEFIFO_SEC_MEM_INVALID_ACCESS 0x0014 +#define SBEFIFO_SEC_MEM_REGION_NOT_FOUND 0x0015 +#define SBEFIFO_SEC_MEM_OVERFLOW_REGION 0x0016 +#define SBEFIFO_SEC_MEM_REGION_AMEND 0x0017 +#define SBEFIFO_SEC_INPUT_BUFFER_OVERFLOW 0x0018 +#define SBEFIFO_SEC_INVALID_PARAM 0x0019 +/* Missing error codes */ +#define SBEFIFO_SEC_INVALID_CHIPOP 0x0020 +#define SBEFIFO_SEC_DEADMAN_TIMEOUT 0x0021 +#define SBEFIFO_SEC_SYSTEM_CHECKSTOP 0x0022 +#define SBEFIFO_SEC_REG_ACCESS_BLOCKED 0x0023 +#define SBEFIFO_SEC_START_MPIPL_FAIL 0x0024 +#define SBEFIFO_SEC_STOP_CLOCK_FAIL 0x0025 +#define SBEFIFO_SEC_CONT_MPIPL_FAIL 0x0026 +#define SBEFIFO_SEC_IO_TOGGLE_FAIL 0x0027 +#define SBEFIFO_SEC_SPL_WKUP_TIMEOUT 0x0028 +#define SBEFIFO_SEC_SPL_WKUP_SCOM_FAIL 0x0029 +#define SBEFIFO_SEC_REG_DUMP_FAIL 0x002A +#define SBEFIFO_SEC_LPC_ACCESS_FAIL 0x002B +#define SBEFIFO_SEC_HWP_FAIL 0x002C +#define SBEFIFO_SEC_ATTN_CORE_READ_FAIL 0x002D +#define SBEFIFO_SEC_ATTN_DATA_READ_FAIL 0x002E +#define SBEFIFO_SEC_PUT_SRAM_FAIL 0x002F +#define SBEFIFO_SEC_GET_SRAM_FAIL 0x0030 +#define SBEFIFO_SEC_THREAD_CONTROL_FAIL 0x0031 +#define SBEFIFO_SEC_RAM_CORE_SETUP_FAIL 0x0032 +#define SBEFIFO_SEC_RAM_CORE_ACCESS_FAIL 0x0033 +#define SBEFIFO_SEC_RAM_CORE_CLEAN_FAIL 0x0034 +#define SBEFIFO_SEC_SUSPEND_IO_FAIL 0x0035 +#define SBEFIFO_SEC_ENTER_MPIPL_FAIL2 0x0036 +#define SBEFIFO_SEC_STOP_CLOCK_FAIL2 0x0037 + +#define SBEFIFO_TARGET_TYPE_PROC 0x0000 +#define SBEFIFO_TARGET_TYPE_PERV 0x0001 +#define SBEFIFO_TARGET_TYPE_EQ 0x0002 +#define SBEFIFO_TARGET_TYPE_CORE 0x0003 +#define SBEFIFO_TARGET_TYPE_OCMB 0x0004 #define SBEFIFO_PROC_P9 0x01 #define SBEFIFO_PROC_P10 0x02 @@ -102,6 +147,11 @@ int sbefifo_ring_put_from_image(struct sbefifo_context *sctx, uint16_t target, u int sbefifo_mem_get(struct sbefifo_context *sctx, uint64_t addr, uint32_t size, uint16_t flags, uint8_t **data); int sbefifo_mem_put(struct sbefifo_context *sctx, uint64_t addr, uint8_t *data, uint32_t len, uint16_t flags); + +#define SBEFIFO_MEMORY_MODE_NORMAL 0x01 +#define SBEFIFO_MEMORY_MODE_DEBUG 0x02 +#define SBEFIFO_MEMORY_MODE_CIRCULAR 0x03 + int sbefifo_occsram_get(struct sbefifo_context *sctx, uint32_t addr, uint32_t size, uint8_t mode, uint8_t **data, uint32_t *data_len); int sbefifo_occsram_put(struct sbefifo_context *sctx, uint32_t addr, uint8_t *data, uint32_t data_len, uint8_t mode);