Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4902592imm; Mon, 11 Jun 2018 22:21:38 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKgDxduoe4l33O1TYhrSaJV3qNLhBo5/zHXuxHRfjs1goQsPsLRRwJvK1/V9aCjvLH2Ejse X-Received: by 2002:a17:902:3124:: with SMTP id w33-v6mr2324120plb.235.1528780898153; Mon, 11 Jun 2018 22:21:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528780898; cv=none; d=google.com; s=arc-20160816; b=MMXQ0SHUE/O6LrMTtKAWI/VGyuOnJnzDgFL3lkUYOofHfXeIGNP0HNr9bgpt5QzeWo zBcjiIUkeineTJpI7nwC3NI6pV0HvRAz9McIWirEeJUcfh9yNfMX7/pAVar5HTZjTgOb FeIw7LCZuZAzk8Y2ptnInu2RxukVi/0fQLqOsEkcOMp+7vKukQqI+hApDJVHwEIpuwCv ZL3zqwyUXw6yxKqX1IYeVk1rOEEfUTOVwHwMvl77s4aPeyeSnFgOPOsCL0u4MgBmWr7l Vb3SSI2QUActaIlidvbEsm7XU4EGtaKuH1ue/HI1TABj/QSKilVilETyKeB8dHWcfm4u ZngA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=ZKqYTm6KMbF2Ugc+Ui7cjBj9bmr6SY3zq610hp4UrWc=; b=MTLldKDnJbc7lWW5KUjfBIEz4HK7LHwhTtQbqWqbUnAMbVB1GqgwzlBN5cBWQYBqXQ W1+Z6ki/mVzi5Y8cLM+WHeOGVSe2WZIDMt0IZmJoNZDngd+jGyMj2BeGjPqIZbCA8B3N JH6S6wV4SxGGuqsrYdryQl6Pb74uqCwwPTWXLwwhdRcEERGQ3XD2L6Trf18bQ+rrI0To 0Lpd0vWV8TlIiTXdMvMYU3+KBoTd1kzETxjDZOCXoObUXE+pCUMaUrt0mN3tZggR0E2E LdMmPXUpneXLfIlmGBZJw8GzoueqT9QtPLfc5G2V/Ua8vBmUPRizrXBOl29g3pZC76TM 5Tkw== ARC-Authentication-Results: i=1; mx.google.com; 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 p3-v6si27960pld.408.2018.06.11.22.21.24; Mon, 11 Jun 2018 22:21:38 -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; 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 S932635AbeFLFUH (ORCPT + 99 others); Tue, 12 Jun 2018 01:20:07 -0400 Received: from gate.crashing.org ([63.228.1.57]:51970 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932137AbeFLFUF (ORCPT ); Tue, 12 Jun 2018 01:20:05 -0400 Received: from pasglop.ozlabs.ibm.com (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id w5C5JDa6008698; Tue, 12 Jun 2018 00:19:25 -0500 From: Benjamin Herrenschmidt To: openbmc@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, Joel Stanley , Andrew Jeffery , Greg Kroah-Hartman , Benjamin Herrenschmidt Subject: [RFC PATCH 4/5] fsi/scom: Add register definitions Date: Tue, 12 Jun 2018 15:19:10 +1000 Message-Id: <20180612051911.20690-5-benh@kernel.crashing.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180612051911.20690-1-benh@kernel.crashing.org> References: <20180612051911.20690-1-benh@kernel.crashing.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a few more register and bit definitions, also define and use SCOM_READ_CMD (which is 0 but it makes the code clearer) Signed-off-by: Benjamin Herrenschmidt --- drivers/fsi/fsi-scom.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c index 6ddfb6021420..e98573ecdae1 100644 --- a/drivers/fsi/fsi-scom.c +++ b/drivers/fsi/fsi-scom.c @@ -30,8 +30,25 @@ #define SCOM_DATA0_REG 0x00 #define SCOM_DATA1_REG 0x04 #define SCOM_CMD_REG 0x08 +#define SCOM_FSI2PIB_RESET_REG 0x18 +#define SCOM_STATUS_REG 0x1C /* Read */ +#define SCOM_PIB_RESET_REG 0x1C /* Write */ +/* Command register */ #define SCOM_WRITE_CMD 0x80000000 +#define SCOM_READ_CMD 0x00000000 + +/* Status register bits */ +#define SCOM_STATUS_ERR_SUMMARY 0x80000000 +#define SCOM_STATUS_PROTECTION 0x01000000 +#define SCOM_STATUS_PIB_ABORT 0x00100000 +#define SCOM_STATUS_PIB_RESP_MASK 0x00007000 +#define SCOM_STATUS_PIB_RESP_SHIFT 12 + +#define SCOM_STATUS_ANY_ERR (SCOM_STATUS_ERR_SUMMARY | \ + SCOM_STATUS_PROTECTION | \ + SCOM_STATUS_PIB_ABORT | \ + SCOM_STATUS_PIB_RESP_MASK) struct scom_device { struct list_head link; @@ -85,7 +102,7 @@ static int get_scom(struct scom_device *scom_dev, uint64_t *value, mutex_lock(&scom_dev->lock); *value = 0ULL; - data = cpu_to_be32(addr); + data = cpu_to_be32(SCOM_READ_CMD | addr); rc = fsi_device_write(scom_dev->fsi_dev, SCOM_CMD_REG, &data, sizeof(uint32_t)); if (rc) -- 2.17.0