From patchwork Mon Dec 18 07:07:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Donnellan X-Patchwork-Id: 849817 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 3z0XFK0h1Gz9s84 for ; Mon, 18 Dec 2017 18:08:37 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3z0XFJ5gz3zDrnF for ; Mon, 18 Dec 2017 18:08:36 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=au1.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=andrew.donnellan@au1.ibm.com; receiver=) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3z0XF46zpzzDrcw for ; Mon, 18 Dec 2017 18:08:24 +1100 (AEDT) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vBI6xKJC062276 for ; Mon, 18 Dec 2017 02:08:22 -0500 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ex6yecbht-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 18 Dec 2017 02:08:22 -0500 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 18 Dec 2017 07:08:20 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 18 Dec 2017 07:08:18 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vBI78HvN40763546; Mon, 18 Dec 2017 07:08:17 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 29F6052049; Mon, 18 Dec 2017 06:01:18 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id CA36B52041; Mon, 18 Dec 2017 06:01:17 +0000 (GMT) Received: from intelligence.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id D4D2AA0272; Mon, 18 Dec 2017 18:08:15 +1100 (AEDT) From: Andrew Donnellan To: skiboot@lists.ozlabs.org Date: Mon, 18 Dec 2017 18:07:54 +1100 X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-TM-AS-GCONF: 00 x-cbid: 17121807-0020-0000-0000-000003E0FD4F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17121807-0021-0000-0000-000042720C88 Message-Id: <3ea2ef60eb1496e64a4f8396868036f6c6ec06c1.1513579137.git-series.andrew.donnellan@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-12-18_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1712180093 Subject: [Skiboot] [PATCH 3/9] platform: Add fields for OpenCAPI platform data 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: arbab@linux.vnet.ibm.com, alistair@popple.id.au MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Add a platform_ocapi struct to store platform-specific values for resetting OpenCAPI devices via I2C and for setting up the ODL PHY. A later patch will add this to the relevant platforms. Signed-off-by: Andrew Donnellan --- include/platform.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/platform.h b/include/platform.h index f3af390..59fef96 100644 --- a/include/platform.h +++ b/include/platform.h @@ -44,6 +44,18 @@ struct bmc_platform { uint32_t ipmi_oem_pnor_access_status; }; +/* OpenCAPI platform-specific I2C information */ +struct platform_ocapi { + bool i2c_voltage_18; /* Is 1.8V I2C I/O voltage override needed? */ + uint8_t i2c_engine; /* I2C engine number */ + uint8_t i2c_port; /* I2C port number */ + uint32_t i2c_offset[3]; /* Offsets on I2C device */ + uint8_t i2c_odl0_data[3]; /* Data to reset ODL0 */ + uint8_t i2c_odl1_data[3]; /* Data to reset ODL1 */ + uint8_t i2c_odl01_data[3]; /* Data to reset both ODL0 and ODL1 */ + bool odl_phy_swap; /* Swap ODL1 to use brick 2 rather than brick 1 lanes */ +}; + /* * Each platform can provide a set of hooks * that can affect the generic code @@ -58,6 +70,9 @@ struct platform { */ const struct bmc_platform *bmc; + /* OpenCAPI platform-specific I2C information */ + const struct platform_ocapi *ocapi; + /* * Probe platform, return true on a match, called before * any allocation has been performed outside of the heap