From nobody Wed Nov 27 06:30:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.vnet.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1700524403; cv=none; d=zohomail.com; s=zohoarc; b=CEidQCL9XY61UaUcyODgjj8JuvZthEgYZkUgrXGsni3ISlTWcq4vnziK6Hy9hOEQcZqCKYOZCk13OQfkxwgWxUYaP2SAWRrayi9kx+d+19sd/A225pFv7evBgq4wmvgniyBjFXRoTEcghEg2qf3X1KipO/bikdDCOXjIjdKAmbk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700524403; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=YdWgeEORXdajPUZ4It3utk6r4JZgX/Zpymy35Xkjyhc=; b=ZogKiBemdG6hjbAt2qJmbJrH7jVtjsx+cHyJMH0n+upCdPMZBSJc85WmTIV3iAcE4mysoIde2sG1mLVoJYTXlBlIo8c2Pt/WH963pTWUSEJ7LFw1GdPvOW5REUqXt/J4LX+ZQm7mDyIxL9uRypUDH0eRML/iYVDUGRoO9dNJ2nc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700524403834531.1159197737115; Mon, 20 Nov 2023 15:53:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r5E45-00076d-6z; Mon, 20 Nov 2023 18:52:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r5E43-00074s-57; Mon, 20 Nov 2023 18:52:27 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r5E40-0001nH-3p; Mon, 20 Nov 2023 18:52:25 -0500 Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AKNgEvO022684; Mon, 20 Nov 2023 23:52:15 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ughc005ba-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Nov 2023 23:52:15 +0000 Received: from m0353726.ppops.net (m0353726.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3AKNhDdY024986; Mon, 20 Nov 2023 23:52:14 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ughc005b2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Nov 2023 23:52:14 +0000 Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3AKNmuDF006119; Mon, 20 Nov 2023 23:52:13 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3ufaa1vaa0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Nov 2023 23:52:13 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3AKNqDRR36110810 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 20 Nov 2023 23:52:13 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 425AC58059; Mon, 20 Nov 2023 23:52:13 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1181058043; Mon, 20 Nov 2023 23:52:13 +0000 (GMT) Received: from mamboa4.aus.stglabs.ibm.com (unknown [9.3.84.87]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Mon, 20 Nov 2023 23:52:13 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=YdWgeEORXdajPUZ4It3utk6r4JZgX/Zpymy35Xkjyhc=; b=cQ5CSfDtxtMn32llcEZEiVDN2WAS4dv0UWD6LP37wlWkhFsCO/39dGzWx7WQosQCvwgV ie/6L+5Vvx6iD4o9dSZ0M+nsNECkTNt1kibj9WtZahhC5AGazOeMjsuogKGNCl2iEYX7 4SWZdtpNEfkdRm5+JupqwZlv8LnH2Qcf/ayxP8fI47JeF9A6b6TPgzLpwPL/ANY+QIbz c6S2sFXyZ37wrHP0F/9bsWTQDQ8XZKilzFeRdn5LSW4T2ac9fQoeO0Czugu/q5AlMZNe +wIDX68APkIlu+umi2h14fvwsOkcmRfr/5sphIfPB1NPJ/+bwEfbA0UO/H54bSItX3aX Fw== From: Glenn Miles To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: Glenn Miles , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= Subject: [PATCH v4 10/11] ppc/pnv: Add a pca9554 I2C device to powernv10-rainier Date: Mon, 20 Nov 2023 17:51:11 -0600 Message-Id: <20231120235112.1951342-11-milesg@linux.vnet.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20231120235112.1951342-1-milesg@linux.vnet.ibm.com> References: <20231120235112.1951342-1-milesg@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 2S1GIz5iiu2LZcVDGzRVFjsnpLZJnuX9 X-Proofpoint-GUID: KEhqf8eak0zAPNVD5NAdLTyJySRuw1Pv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-20_22,2023-11-20_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 suspectscore=0 bulkscore=0 phishscore=0 priorityscore=1501 mlxlogscore=999 spamscore=0 adultscore=0 clxscore=1015 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311200175 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=148.163.156.1; envelope-from=milesg@linux.vnet.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1700524404665100003 Content-Type: text/plain; charset="utf-8" For powernv10-rainier, the Power Hypervisor code expects to see a pca9554 device connected to the 3rd PNV I2C engine on port 1 at I2C address 0x25 (or left-justified address of 0x4A). This is used by the hypervisor code to detect if a "Cable Card" is present. Signed-off-by: Glenn Miles Reviewed-by: C=C3=A9dric Le Goater --- Changes from previous version: - Code moved from pnv_chip_power10_realize to pnv_rainier_i2c_init hw/misc/Kconfig | 4 ++++ hw/misc/meson.build | 1 + hw/ppc/Kconfig | 1 + hw/ppc/pnv.c | 6 ++++++ 4 files changed, 12 insertions(+) diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig index cc8a8c1418..c347a132c2 100644 --- a/hw/misc/Kconfig +++ b/hw/misc/Kconfig @@ -34,6 +34,10 @@ config PCA9552 bool depends on I2C =20 +config PCA9554 + bool + depends on I2C + config I2C_ECHO bool default y if TEST_DEVICES diff --git a/hw/misc/meson.build b/hw/misc/meson.build index 36c20d5637..c39410e4a7 100644 --- a/hw/misc/meson.build +++ b/hw/misc/meson.build @@ -4,6 +4,7 @@ system_ss.add(when: 'CONFIG_FW_CFG_DMA', if_true: files('vm= coreinfo.c')) system_ss.add(when: 'CONFIG_ISA_DEBUG', if_true: files('debugexit.c')) system_ss.add(when: 'CONFIG_ISA_TESTDEV', if_true: files('pc-testdev.c')) system_ss.add(when: 'CONFIG_PCA9552', if_true: files('pca9552.c')) +system_ss.add(when: 'CONFIG_PCA9554', if_true: files('pca9554.c')) system_ss.add(when: 'CONFIG_PCI_TESTDEV', if_true: files('pci-testdev.c')) system_ss.add(when: 'CONFIG_UNIMP', if_true: files('unimp.c')) system_ss.add(when: 'CONFIG_EMPTY_SLOT', if_true: files('empty_slot.c')) diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index f77ca773cf..2302778265 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -33,6 +33,7 @@ config POWERNV select FDT_PPC select PCI_POWERNV select PCA9552 + select PCA9554 =20 config PPC405 bool diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index c29a136465..54ebef789e 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -1918,6 +1918,12 @@ static void pnv_rainier_i2c_init(PnvMachineState *pn= v) qdev_get_gpio_in(DEVICE(hotplug), 8)); qdev_connect_gpio_out(DEVICE(hotplug), 4, qdev_get_gpio_in(DEVICE(hotplug), 9)); + + /* + * Add a PCA9554 I2C device for cable card presence detection + * to engine 2, bus 1, address 0x25 + */ + i2c_slave_create_simple(chip10->i2c[2].busses[1], "pca9554", 0x25); } } =20 --=20 2.31.1