From nobody Wed Nov 27 09:54:33 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 ARC-Seal: i=1; a=rsa-sha256; t=1699373837; cv=none; d=zohomail.com; s=zohoarc; b=dDwoXVVsH3qHSh+n33JfskLAeuKndxfUiXcd6H+nnBip49exy6R/40vAu6YlfPzY87d8KIcsGNa0ku/bHgDmuqSyhfJzbUY2fI57sHcA11sIHjrae4JODuaUxPtdl5dDCR5qj/JnHciUTFeYGtlmITRGY3MIrfzWuzXYFTC7Lnk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699373836; 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=L1ClE4VlduS+G+kPgQVP6fikB0d0uRwuoYKhEgnsMbY=; b=dTsMCM4wV6VA1ErMQeNJAOtvfLcalJePLztZqz9C498V3FgMc0Zt9ArGcyIs2deh7lWwcvGJgAfoMJ9l5E0sHcqnNVdDfkYC4QnQhiyzCXDiUaCYz1hxMYnzIOg6OvWDzagcN268ZwR1YXjaaZP6LlRWbiN9DHQkytZqWnMQiCw= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1699373836955616.3062200274603; Tue, 7 Nov 2023 08:17:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0OkY-00080I-Si; Tue, 07 Nov 2023 11:16:22 -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 1r0Gip-0006A6-I8; Tue, 07 Nov 2023 02:42:05 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0Gil-0006aM-RE; Tue, 07 Nov 2023 02:42:03 -0500 Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A77dYWv005208; Tue, 7 Nov 2023 07:41:38 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3u7h1sr2yb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Nov 2023 07:41:38 +0000 Received: from m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3A77ePEw009339; Tue, 7 Nov 2023 07:41:37 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3u7h1sr2y2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Nov 2023 07:41:37 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3A77W0Nq007926; Tue, 7 Nov 2023 07:41:37 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([172.16.1.5]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3u61skexuq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Nov 2023 07:41:37 +0000 Received: from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com [10.39.53.232]) by smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3A77fXXf9896686 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 Nov 2023 07:41:33 GMT Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1440D58053; Tue, 7 Nov 2023 07:41:33 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E601658043; Tue, 7 Nov 2023 07:41:32 +0000 (GMT) Received: from gfwr516.rchland.ibm.com (unknown [9.10.239.105]) by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTPS; Tue, 7 Nov 2023 07:41:32 +0000 (GMT) Received: by gfwr516.rchland.ibm.com (Postfix, from userid 607334) id 3E82C22003D; Tue, 7 Nov 2023 01:41:32 -0600 (CST) 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=L1ClE4VlduS+G+kPgQVP6fikB0d0uRwuoYKhEgnsMbY=; b=gYVNSlP3EixAxYTcl4CBsn07pWKsJF047zwJaj1fKGDhaRH37zpvibCDLl/+UxOgvtBd +ftX7TjKeRRMuAKitFRFBLpjOD72EBVRsfLG6duWIq3bm6oe0peytQw2/9b8yGYxkuwm 2qCp33OoA5SYH5d9jyDuFtLWWKc3MMaBPOfb2i8v7uneCCql111485pB+c4ZDxOpE+zj 5KXt31XFq6wb3evPqnXFe4Sg4ODpN0WdQWOnTGWZi5lmqt3MdpCGnu2lkPv3qfx15Vp0 ECMKzFuTPu11CY4WtT+WnBuMP6YwXpNe2BtFFrr3eGWD5SQ19TuWNe4K5KHgIuLVy/TC Gw== From: Chalapathi V To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, fbarrat@linux.ibm.com, npiggin@gmail.com, clg@kaod.org, calebs@us.ibm.com, chalapathi.v@ibm.com, saif.abrar@linux.vnet.ibm.com, Chalapathi V Subject: [PATCH v4 1/3] hw/ppc: Add pnv pervasive common chiplet units Date: Tue, 7 Nov 2023 01:41:25 -0600 Message-Id: <20231107074127.31821-2-chalap1@gfwr516.rchland.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20231107074127.31821-1-chalap1@gfwr516.rchland.ibm.com> References: <20231107074127.31821-1-chalap1@gfwr516.rchland.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: SWECbtEgy-tdAeWForSgYbB_HTE_1jLo X-Proofpoint-ORIG-GUID: 1tio3JuKNGW40DLQm3eiD8wvHRAATOx1 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-06_15,2023-11-02_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 priorityscore=1501 phishscore=0 malwarescore=0 spamscore=0 impostorscore=0 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 clxscore=1034 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311070062 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: pass client-ip=148.163.158.5; envelope-from=chalap1@us.ibm.com; helo=mx0b-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_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 07 Nov 2023 11:16:20 -0500 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: 1699373837339100003 Content-Type: text/plain; charset="utf-8" From: Chalapathi V This part of the patchset creates a common pervasive chiplet model where it houses the common units of a chiplets. The chiplet control unit is common across chiplets and this commit implemen= ts the pervasive chiplet model with chiplet control registers. Signed-off-by: Chalapathi V --- hw/ppc/meson.build | 1 + hw/ppc/pnv_pervasive.c | 213 +++++++++++++++++++++++++++++++++++++= ++++ include/hw/ppc/pnv_pervasive.h | 39 ++++++++ include/hw/ppc/pnv_xscom.h | 3 + 4 files changed, 256 insertions(+) create mode 100644 hw/ppc/pnv_pervasive.c create mode 100644 include/hw/ppc/pnv_pervasive.h diff --git a/hw/ppc/meson.build b/hw/ppc/meson.build index 7c2c524..c80d2f6 100644 --- a/hw/ppc/meson.build +++ b/hw/ppc/meson.build @@ -50,6 +50,7 @@ ppc_ss.add(when: 'CONFIG_POWERNV', if_true: files( 'pnv_bmc.c', 'pnv_homer.c', 'pnv_pnor.c', + 'pnv_pervasive.c', )) # PowerPC 4xx boards ppc_ss.add(when: 'CONFIG_PPC405', if_true: files( diff --git a/hw/ppc/pnv_pervasive.c b/hw/ppc/pnv_pervasive.c new file mode 100644 index 0000000..40f60b5 --- /dev/null +++ b/hw/ppc/pnv_pervasive.c @@ -0,0 +1,213 @@ +/* + * QEMU PowerPC pervasive common chiplet model + * + * Copyright (c) 2023, IBM Corporation. + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This code is licensed under the GPL version 2 or later. See the + * COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "qemu/log.h" +#include "hw/qdev-properties.h" +#include "hw/ppc/pnv.h" +#include "hw/ppc/pnv_xscom.h" +#include "hw/ppc/pnv_pervasive.h" +#include "hw/ppc/fdt.h" +#include + +#define CPLT_CONF0 0x08 +#define CPLT_CONF0_OR 0x18 +#define CPLT_CONF0_CLEAR 0x28 +#define CPLT_CONF1 0x09 +#define CPLT_CONF1_OR 0x19 +#define CPLT_CONF1_CLEAR 0x29 +#define CPLT_STAT0 0x100 +#define CPLT_MASK0 0x101 +#define CPLT_PROTECT_MODE 0x3FE +#define CPLT_ATOMIC_CLOCK 0x3FF + +static uint64_t pnv_chiplet_ctrl_read(void *opaque, hwaddr addr, + unsigned size) +{ + PnvPervChiplet *perv_chiplet =3D PNV_PERVCHIPLET(opaque); + int reg =3D addr >> 3; + uint64_t val =3D ~0ull; + /* CPLT_CTRL0 to CPLT_CTRL5 */ + for (int i =3D 0; i <=3D 5; i++) { + if (reg =3D=3D i) { + val =3D perv_chiplet->control_regs.cplt_ctrl[i]; + return val; + } else if ((reg =3D=3D (i + 0x10)) || (reg =3D=3D (i + 0x20))) { + qemu_log_mask(LOG_GUEST_ERROR, "%s: Write only register, ignor= ing " + "xscom read at 0x%" PRIx64 "\n", + __func__, (unsigned long)reg); + return val; + } + } + + switch (reg) { + case CPLT_CONF0: + val =3D perv_chiplet->control_regs.cplt_cfg0; + break; + case CPLT_CONF0_OR: + case CPLT_CONF0_CLEAR: + qemu_log_mask(LOG_GUEST_ERROR, "%s: Write only register, ignoring " + "xscom read at 0x%" PRIx64 "\n", + __func__, (unsigned long)reg); + break; + case CPLT_CONF1: + val =3D perv_chiplet->control_regs.cplt_cfg1; + break; + case CPLT_CONF1_OR: + case CPLT_CONF1_CLEAR: + qemu_log_mask(LOG_GUEST_ERROR, "%s: Write only register, ignoring " + "xscom read at 0x%" PRIx64 "\n", + __func__, (unsigned long)reg); + break; + case CPLT_STAT0: + val =3D perv_chiplet->control_regs.cplt_stat0; + break; + case CPLT_MASK0: + val =3D perv_chiplet->control_regs.cplt_mask0; + break; + case CPLT_PROTECT_MODE: + val =3D perv_chiplet->control_regs.ctrl_protect_mode; + break; + case CPLT_ATOMIC_CLOCK: + val =3D perv_chiplet->control_regs.ctrl_atomic_lock; + break; + default: + qemu_log_mask(LOG_UNIMP, "%s: Chiplet_control_regs: Invalid xscom " + "read at 0x%" PRIx64 "\n", __func__, (unsigned long)reg); + } + return val; +} + +static void pnv_chiplet_ctrl_write(void *opaque, hwaddr addr, + uint64_t val, unsigned size) +{ + PnvPervChiplet *perv_chiplet =3D PNV_PERVCHIPLET(opaque); + int reg =3D addr >> 3; + /* CPLT_CTRL0 to CPLT_CTRL5 */ + for (int i =3D 0; i <=3D 5; i++) { + if (reg =3D=3D i) { + perv_chiplet->control_regs.cplt_ctrl[i] =3D val; + return; + } else if (reg =3D=3D (i + 0x10)) { + perv_chiplet->control_regs.cplt_ctrl[i] |=3D val; + return; + } else if (reg =3D=3D (i + 0x20)) { + perv_chiplet->control_regs.cplt_ctrl[i] &=3D ~val; + return; + } + } + + switch (reg) { + case CPLT_CONF0: + perv_chiplet->control_regs.cplt_cfg0 =3D val; + break; + case CPLT_CONF0_OR: + perv_chiplet->control_regs.cplt_cfg0 |=3D val; + break; + case CPLT_CONF0_CLEAR: + perv_chiplet->control_regs.cplt_cfg0 &=3D ~val; + break; + case CPLT_CONF1: + perv_chiplet->control_regs.cplt_cfg1 =3D val; + break; + case CPLT_CONF1_OR: + perv_chiplet->control_regs.cplt_cfg1 |=3D val; + break; + case CPLT_CONF1_CLEAR: + perv_chiplet->control_regs.cplt_cfg1 &=3D ~val; + break; + case CPLT_STAT0: + perv_chiplet->control_regs.cplt_stat0 =3D val; + break; + case CPLT_MASK0: + perv_chiplet->control_regs.cplt_mask0 =3D val; + break; + case CPLT_PROTECT_MODE: + perv_chiplet->control_regs.ctrl_protect_mode =3D val; + break; + case CPLT_ATOMIC_CLOCK: + perv_chiplet->control_regs.ctrl_atomic_lock =3D val; + break; + default: + qemu_log_mask(LOG_UNIMP, "%s: Chiplet_control_regs: Invalid xscom " + "write at 0x%" PRIx64 "\n", + __func__, (unsigned long)reg); + } + return; +} + +static const MemoryRegionOps pnv_perv_chiplet_control_xscom_ops =3D { + .read =3D pnv_chiplet_ctrl_read, + .write =3D pnv_chiplet_ctrl_write, + .valid.min_access_size =3D 8, + .valid.max_access_size =3D 8, + .impl.min_access_size =3D 8, + .impl.max_access_size =3D 8, + .endianness =3D DEVICE_BIG_ENDIAN, +}; + +static void pnv_perv_chiplet_realize(DeviceState *dev, Error **errp) +{ + PnvPervChiplet *perv_chiplet =3D PNV_PERVCHIPLET(dev); + + /* Chiplet control scoms */ + pnv_xscom_region_init(&perv_chiplet->xscom_perv_ctrl_regs, + OBJECT(perv_chiplet), + &pnv_perv_chiplet_control_xscom_ops, + perv_chiplet, "xscom-chiplet-control-regs", + PNV10_XSCOM_CTRL_CHIPLET_SIZE); +} + +void pnv_perv_dt(uint32_t base_addr, void *fdt, + int offset) +{ + g_autofree char *name =3D NULL; + int perv_chiplet_offset; + + const char compat[] =3D "ibm,power10-perv-chiplet"; + uint32_t reg[] =3D { + base_addr, + cpu_to_be32(PNV10_XSCOM_CTRL_CHIPLET_SIZE) + }; + name =3D g_strdup_printf("perv_chiplet@%x", base_addr); + perv_chiplet_offset =3D fdt_add_subnode(fdt, offset, name); + _FDT(perv_chiplet_offset); + + _FDT(fdt_setprop(fdt, perv_chiplet_offset, "reg", reg, sizeof(reg))); + _FDT(fdt_setprop(fdt, perv_chiplet_offset, "compatible", + compat, sizeof(compat))); +} + +static void pnv_perv_chiplet_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + + dc->desc =3D "PowerNV perv chiplet"; + dc->realize =3D pnv_perv_chiplet_realize; +} + +static const TypeInfo pnv_perv_chiplet_info =3D { + .name =3D TYPE_PNV_PERV_CHIPLET, + .parent =3D TYPE_DEVICE, + .instance_size =3D sizeof(PnvPervChiplet), + .class_init =3D pnv_perv_chiplet_class_init, + .interfaces =3D (InterfaceInfo[]) { + { TYPE_PNV_XSCOM_INTERFACE }, + { } + } +}; + +static void pnv_perv_chiplet_register_types(void) +{ + type_register_static(&pnv_perv_chiplet_info); +} + +type_init(pnv_perv_chiplet_register_types); diff --git a/include/hw/ppc/pnv_pervasive.h b/include/hw/ppc/pnv_pervasive.h new file mode 100644 index 0000000..61be4cf --- /dev/null +++ b/include/hw/ppc/pnv_pervasive.h @@ -0,0 +1,39 @@ +/* + * QEMU PowerPC pervasive common chiplet model + * + * Copyright (c) 2023, IBM Corporation. + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This code is licensed under the GPL version 2 or later. See the + * COPYING file in the top-level directory. + */ + +#ifndef PPC_PNV_PERVASIVE_H +#define PPC_PNV_PERVASIVE_H + +#define TYPE_PNV_PERV_CHIPLET "pnv-pervasive-chiplet" +#define PNV_PERVCHIPLET(obj) OBJECT_CHECK(PnvPervChiplet, (obj), TYPE_PNV_= PERV_CHIPLET) + +typedef struct ControlRegs { + + uint64_t cplt_ctrl[6]; + uint64_t cplt_cfg0; + uint64_t cplt_cfg1; + uint64_t cplt_stat0; + uint64_t cplt_mask0; + uint64_t ctrl_protect_mode; + uint64_t ctrl_atomic_lock; +} ControlRegs; + +typedef struct PnvPervChiplet { + + DeviceState parent; + struct PnvChip *chip; + MemoryRegion xscom_perv_ctrl_regs; + ControlRegs control_regs; + +} PnvPervChiplet; + +void pnv_perv_dt(uint32_t base, void *fdt, int offset); +#endif /*PPC_PNV_PERVASIVE_H */ diff --git a/include/hw/ppc/pnv_xscom.h b/include/hw/ppc/pnv_xscom.h index 35b1961..87bbee8 100644 --- a/include/hw/ppc/pnv_xscom.h +++ b/include/hw/ppc/pnv_xscom.h @@ -164,6 +164,9 @@ struct PnvXScomInterfaceClass { #define PNV10_XSCOM_XIVE2_BASE 0x2010800 #define PNV10_XSCOM_XIVE2_SIZE 0x400 =20 +#define PNV10_XSCOM_NEST1_CTRL_CHIPLET_BASE 0x3000000 +#define PNV10_XSCOM_CTRL_CHIPLET_SIZE 0x400 + #define PNV10_XSCOM_PEC_NEST_BASE 0x3011800 /* index goes downwards ... */ #define PNV10_XSCOM_PEC_NEST_SIZE 0x100 =20 --=20 1.8.3.1 From nobody Wed Nov 27 09:54:33 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 ARC-Seal: i=1; a=rsa-sha256; t=1699373836; cv=none; d=zohomail.com; s=zohoarc; b=fpnPrZUig9kZzmP5Re1sEWmQjkjEZu8eQ71vshz98Aen65qIkfIdVqgBh32eXKPvMQF6DHqadQ5IpU5dSHCmiXAJjNFrX64/DDfW1elFSeJtaNG9GpOzz2lWYlkrCvtICxxTcqBlCcVWkRzg7s//YOmcx10Fj+1/9LMBNzyD/HA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699373836; 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=ROneKfetjv7MOg6E7Xwieoj9DKIkG4xKjOiMs94S/m4=; b=EeAWKAWyEA5/W+0UEdJBgyc96aJV7mdrxad5XUbAeuATEDifAeFVgeruOAeedVsxtTCuiLdsXxpatMgOK6jwV6maqOhs+4jb5ukMgyd1w3RSAcYNC96/pQSXZQjcXXcyZBCMhRlxDAptQoa5rtT1A05dh2/UoGB/uFCsGxgt2BE= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1699373836830578.3292799942519; Tue, 7 Nov 2023 08:17:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0OkY-00080B-9r; Tue, 07 Nov 2023 11:16:22 -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 1r0Gio-0006A3-Tj; Tue, 07 Nov 2023 02:42:05 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0Gil-0006aS-GS; Tue, 07 Nov 2023 02:42:01 -0500 Received: from pps.filterd (m0353723.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A77daCA015841; Tue, 7 Nov 2023 07:41:38 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3u7h1tg2nk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Nov 2023 07:41:38 +0000 Received: from m0353723.ppops.net (m0353723.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3A77fcfj023759; Tue, 7 Nov 2023 07:41:38 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 3u7h1tg2mt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Nov 2023 07:41:37 +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 3A767blJ016950; Tue, 7 Nov 2023 07:41:37 GMT Received: from smtprelay05.dal12v.mail.ibm.com ([172.16.1.7]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3u6301phwv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Nov 2023 07:41:37 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay05.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3A77fWfP23397100 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 Nov 2023 07:41:32 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CF44C58055; Tue, 7 Nov 2023 07:41:32 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BC3D158043; Tue, 7 Nov 2023 07:41:32 +0000 (GMT) Received: from gfwr516.rchland.ibm.com (unknown [9.10.239.105]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTPS; Tue, 7 Nov 2023 07:41:32 +0000 (GMT) Received: by gfwr516.rchland.ibm.com (Postfix, from userid 607334) id 431CC220040; Tue, 7 Nov 2023 01:41:32 -0600 (CST) 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=ROneKfetjv7MOg6E7Xwieoj9DKIkG4xKjOiMs94S/m4=; b=thFVDW70xokY/OeDoo88WoJBCNNV8OfD4WHB6/R5miojnbEef5D0e9Z4uecQxMuImK8J 98jHz3YzebakiqmJsD+Lt/pj0YQZMIATA5t7H8GdMnhOKYoWEhm20C2w0SMQrZpLvOL4 gg09yz9S+6yLjDGjdSwtrsmNwQDzkD4z23ckRGFz9QFrAglBWagxjdcj2f+ELyERs46y oRAVuXrd4RMNSJtPEzHBuTplTqtuaK1vPQTKjRE7ETuPWNmf5rWC7O5pexxpmJVUsE7d /zYuF4diYsJ5cii8DQYgWSUE6Gtkhz7AG8vuryLOTO4vFsoqDpnBEuyatIrB3tx87WnJ Yg== From: Chalapathi V To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, fbarrat@linux.ibm.com, npiggin@gmail.com, clg@kaod.org, calebs@us.ibm.com, chalapathi.v@ibm.com, saif.abrar@linux.vnet.ibm.com, Chalapathi V Subject: [PATCH v4 2/3] hw/ppc: Add nest1 chiplet model Date: Tue, 7 Nov 2023 01:41:26 -0600 Message-Id: <20231107074127.31821-3-chalap1@gfwr516.rchland.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20231107074127.31821-1-chalap1@gfwr516.rchland.ibm.com> References: <20231107074127.31821-1-chalap1@gfwr516.rchland.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: m1BaXaJQwFJECaDOW4ARNaBkbPSY0HH1 X-Proofpoint-ORIG-GUID: JNzXzCnhTZz8_mSOKTxEanDmtsuRjdB- 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-06_15,2023-11-02_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 mlxscore=0 priorityscore=1501 malwarescore=0 adultscore=0 clxscore=1034 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311070062 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: pass client-ip=148.163.158.5; envelope-from=chalap1@us.ibm.com; helo=mx0b-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_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 07 Nov 2023 11:16:20 -0500 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: 1699373837423100005 Content-Type: text/plain; charset="utf-8" From: Chalapathi V The nest1 chiplet handle the high speed i/o traffic over PCIe and others. The nest1 chiplet consists of PowerBus Fabric controller, nest Memory Management Unit, chiplet control unit and more. This commit creates a nest1 chiplet model and initialize and realize the pervasive chiplet model where chiplet control registers are implemented. Signed-off-by: Chalapathi V --- hw/ppc/meson.build | 1 + hw/ppc/pnv_nest1_chiplet.c | 94 +++++++++++++++++++++++++++++++++++= ++++ include/hw/ppc/pnv_nest_chiplet.h | 41 +++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 hw/ppc/pnv_nest1_chiplet.c create mode 100644 include/hw/ppc/pnv_nest_chiplet.h diff --git a/hw/ppc/meson.build b/hw/ppc/meson.build index c80d2f6..4e45e5c 100644 --- a/hw/ppc/meson.build +++ b/hw/ppc/meson.build @@ -51,6 +51,7 @@ ppc_ss.add(when: 'CONFIG_POWERNV', if_true: files( 'pnv_homer.c', 'pnv_pnor.c', 'pnv_pervasive.c', + 'pnv_nest1_chiplet.c', )) # PowerPC 4xx boards ppc_ss.add(when: 'CONFIG_PPC405', if_true: files( diff --git a/hw/ppc/pnv_nest1_chiplet.c b/hw/ppc/pnv_nest1_chiplet.c new file mode 100644 index 0000000..e078076 --- /dev/null +++ b/hw/ppc/pnv_nest1_chiplet.c @@ -0,0 +1,94 @@ +/* + * QEMU PowerPC nest1 chiplet model + * + * Copyright (c) 2023, IBM Corporation. + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This code is licensed under the GPL version 2 or later. See the + * COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "qemu/log.h" +#include "hw/qdev-properties.h" +#include "hw/ppc/pnv.h" +#include "hw/ppc/pnv_xscom.h" +#include "hw/ppc/pnv_nest_chiplet.h" +#include "hw/ppc/pnv_pervasive.h" +#include "hw/ppc/fdt.h" +#include + +/* + * The nest1 chiplet contains chiplet control unit, + * PowerBus/RaceTrack/Bridge logic, nest Memory Management Unit(nMMU) + * and more. + */ + +static void pnv_nest1_chiplet_realize(DeviceState *dev, Error **errp) +{ + PnvNest1Chiplet *nest1_chiplet =3D PNV_NEST1CHIPLET(dev); + + object_initialize_child(OBJECT(nest1_chiplet), "perv_chiplet", + &nest1_chiplet->perv_chiplet, + TYPE_PNV_PERV_CHIPLET); + + if (!qdev_realize(DEVICE(&nest1_chiplet->perv_chiplet), NULL, errp)) { + return; + } +} + +static int pnv_nest1_chiplet_dt_xscom(PnvXScomInterface *dev, void *fdt, + int offset) +{ + g_autofree char *name =3D NULL; + int nest1_chiplet_offset; + const char compat[] =3D "ibm,power10-nest1-chiplet"; + + name =3D g_strdup_printf("nest1_chiplet@%x", + PNV10_XSCOM_NEST1_CTRL_CHIPLET_BASE); + nest1_chiplet_offset =3D fdt_add_subnode(fdt, offset, name); + _FDT(nest1_chiplet_offset); + + _FDT(fdt_setprop(fdt, nest1_chiplet_offset, "compatible", + compat, sizeof(compat))); + return 0; +} + +static void pnv_nest1_dt_populate(void *fdt) +{ + + uint32_t nest1_base =3D cpu_to_be32(PNV10_XSCOM_NEST1_CTRL_CHIPLET_BAS= E); + pnv_perv_dt(nest1_base, fdt, 0); +} + +static void pnv_nest1_chiplet_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + PnvNest1Class *nest1_class =3D PNV_NEST1CHIPLET_CLASS(klass); + PnvXScomInterfaceClass *xscomc =3D PNV_XSCOM_INTERFACE_CLASS(klass); + + xscomc->dt_xscom =3D pnv_nest1_chiplet_dt_xscom; + + dc->desc =3D "PowerNV nest1 chiplet"; + dc->realize =3D pnv_nest1_chiplet_realize; + nest1_class->nest1_dt_populate =3D pnv_nest1_dt_populate; +} + +static const TypeInfo pnv_nest1_chiplet_info =3D { + .name =3D TYPE_PNV_NEST1_CHIPLET, + .parent =3D TYPE_DEVICE, + .instance_size =3D sizeof(PnvNest1Chiplet), + .class_init =3D pnv_nest1_chiplet_class_init, + .interfaces =3D (InterfaceInfo[]) { + { TYPE_PNV_XSCOM_INTERFACE }, + { } + } +}; + +static void pnv_nest1_chiplet_register_types(void) +{ + type_register_static(&pnv_nest1_chiplet_info); +} + +type_init(pnv_nest1_chiplet_register_types); diff --git a/include/hw/ppc/pnv_nest_chiplet.h b/include/hw/ppc/pnv_nest_ch= iplet.h new file mode 100644 index 0000000..12525d3 --- /dev/null +++ b/include/hw/ppc/pnv_nest_chiplet.h @@ -0,0 +1,41 @@ +/* + * QEMU PowerPC nest chiplet model + * + * Copyright (c) 2023, IBM Corporation. + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This code is licensed under the GPL version 2 or later. See the + * COPYING file in the top-level directory. + * + */ + +#ifndef PPC_PNV_NEST1_CHIPLET_H +#define PPC_PNV_NEST1_CHIPLET_H + +#include "hw/ppc/pnv_pervasive.h" + +#define TYPE_PNV_NEST1_CHIPLET "pnv-nest1-chiplet" +typedef struct PnvNest1Class PnvNest1Class; +typedef struct PnvNest1Chiplet PnvNest1Chiplet; +DECLARE_OBJ_CHECKERS(PnvNest1Chiplet, PnvNest1Class, + PNV_NEST1CHIPLET, TYPE_PNV_NEST1_CHIPLET) + +typedef struct PnvNest1Chiplet { + DeviceState parent; + + struct PnvChip *chip; + + /* common pervasive chiplet unit */ + PnvPervChiplet perv_chiplet; +} PnvNest1Chiplet; + +struct PnvNest1Class { + DeviceClass parent_class; + + DeviceRealize parent_realize; + + void (*nest1_dt_populate)(void *fdt); +}; + +#endif /*PPC_PNV_NEST1_CHIPLET_H */ --=20 1.8.3.1 From nobody Wed Nov 27 09:54:33 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 ARC-Seal: i=1; a=rsa-sha256; t=1699373837; cv=none; d=zohomail.com; s=zohoarc; b=MnGJ470gATirPDdaaA7LahtIF3lLk2Stw7A6ZBgcmT1wK8vj/yrnNvYV1B15CGN66c80QNCk8buN6G6IF+LscwQvGofpZhgRDxqwHiPfarHLZM2gVaHWo5wIoJzysqvouoJWsgJ4862fJucLzahER+VdQCeh85ZJ6uH8QrYGfP0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699373837; 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=Jw2xSs+BxAc8oeAD791uufh2poFYCMzdEe6QqC8uh7Y=; b=HwvBQaPxBGFV8KsI9B1I9XSyhXZFTVOFgoqyl4MghAiCbDWhEoFib277faR+S8V8ufVj2kyScagVSUtszgWnUwSk7KPfsae6lbc+fHjQL/EL2gfro8CvVo4DoyI536mGfByrrrYCTT7mm9PTttn3pyAibF+KAVT0Fa2Tv5DLoWY= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1699373836900848.6967192763298; Tue, 7 Nov 2023 08:17:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0OkX-0007za-OP; Tue, 07 Nov 2023 11:16:21 -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 1r0Gin-0006A1-So; Tue, 07 Nov 2023 02:42:03 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0Gil-0006aC-GU; Tue, 07 Nov 2023 02:42:01 -0500 Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A77dZ2d018164; Tue, 7 Nov 2023 07:41:37 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3u7h1sg2wv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Nov 2023 07:41:37 +0000 Received: from m0353725.ppops.net (m0353725.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3A77diSo018894; Tue, 7 Nov 2023 07:41:36 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3u7h1sg2we-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Nov 2023 07:41:36 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3A76B9CL012797; Tue, 7 Nov 2023 07:41:36 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([172.16.1.5]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3u609sqc45-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Nov 2023 07:41:36 +0000 Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3A77fXSQ63832410 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 Nov 2023 07:41:33 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 252A55805C; Tue, 7 Nov 2023 07:41:33 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 09EE65805B; Tue, 7 Nov 2023 07:41:33 +0000 (GMT) Received: from gfwr516.rchland.ibm.com (unknown [9.10.239.105]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTPS; Tue, 7 Nov 2023 07:41:32 +0000 (GMT) Received: by gfwr516.rchland.ibm.com (Postfix, from userid 607334) id 47B62220041; Tue, 7 Nov 2023 01:41:32 -0600 (CST) 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=Jw2xSs+BxAc8oeAD791uufh2poFYCMzdEe6QqC8uh7Y=; b=SkJYclP38rVlLgSe+r5JjPaLfM5bSPv2iTY4b/qDcaq1dtcmlg95DN6EVBLhazw0Z37t Wyo2ycG/U60UPXVELWsG1p7umDeG2LENYvqS0l+d9HilRHMMdIWk0ynaVLTFLros8Mlr hyCtW/lHC31JZSo+/3+vB/oLvnaCpPJjTug+a09ZY0c9O2oWESO+WmJUPWrLZvScDDz+ 5cpikFM/EQm0htQnbLJTVNQNzsWiGVLlDYKUDfRrXs9qEhCKU4yQcqESu47TmRzl4d/F 62lEW9R0768RRMxqGlrMwVMaQHvs/QpoYZFqrVBGJFugIqEvsHxofT/haDQN0/VJE76k Ng== From: Chalapathi V To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, fbarrat@linux.ibm.com, npiggin@gmail.com, clg@kaod.org, calebs@us.ibm.com, chalapathi.v@ibm.com, saif.abrar@linux.vnet.ibm.com, Chalapathi V Subject: [PATCH v4 3/3] hw/ppc: Nest1 chiplet wiring Date: Tue, 7 Nov 2023 01:41:27 -0600 Message-Id: <20231107074127.31821-4-chalap1@gfwr516.rchland.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20231107074127.31821-1-chalap1@gfwr516.rchland.ibm.com> References: <20231107074127.31821-1-chalap1@gfwr516.rchland.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: B1JaVuTRIogQJ2klZ4OZSShgf-lFzlCg X-Proofpoint-ORIG-GUID: TnCjVkpcXZAK6akRaViQNELVdZtI44xd 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-06_15,2023-11-02_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 mlxscore=0 priorityscore=1501 phishscore=0 adultscore=0 suspectscore=0 clxscore=1034 mlxlogscore=843 malwarescore=0 impostorscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311070062 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: pass client-ip=148.163.158.5; envelope-from=chalap1@us.ibm.com; helo=mx0b-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_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 07 Nov 2023 11:16:20 -0500 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: 1699373839210100015 Content-Type: text/plain; charset="utf-8" From: Chalapathi V This part of the patchset connects the nest1 chiplet model to p10 chip. Signed-off-by: Chalapathi V --- hw/ppc/pnv.c | 14 ++++++++++++++ include/hw/ppc/pnv_chip.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index c0e34ff..2b93cdd 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -351,6 +351,8 @@ static void pnv_chip_power10_dt_populate(PnvChip *chip,= void *fdt) static const char compat[] =3D "ibm,power10-xscom\0ibm,xscom"; int i; =20 + Pnv10Chip *chip10 =3D PNV10_CHIP(chip); + pnv_dt_xscom(chip, fdt, 0, cpu_to_be64(PNV10_XSCOM_BASE(chip)), cpu_to_be64(PNV10_XSCOM_SIZE), @@ -366,6 +368,9 @@ static void pnv_chip_power10_dt_populate(PnvChip *chip,= void *fdt) pnv_dt_memory(fdt, chip->chip_id, chip->ram_start, chip->ram_size); } =20 + /* Populate nest1_chiplet device tree */ + PNV_NEST1CHIPLET_GET_CLASS(&chip10->nest1_chiplet)->nest1_dt_populate(= fdt); + pnv_dt_lpc(chip, fdt, 0, PNV10_LPCM_BASE(chip), PNV10_LPCM_SIZE); } =20 @@ -1649,6 +1654,8 @@ static void pnv_chip_power10_instance_init(Object *ob= j) object_initialize_child(obj, "occ", &chip10->occ, TYPE_PNV10_OCC); object_initialize_child(obj, "sbe", &chip10->sbe, TYPE_PNV10_SBE); object_initialize_child(obj, "homer", &chip10->homer, TYPE_PNV10_HOMER= ); + object_initialize_child(obj, "nest1_chiplet", &chip10->nest1_chiplet, + TYPE_PNV_NEST1_CHIPLET); =20 chip->num_pecs =3D pcc->num_pecs; =20 @@ -1813,6 +1820,13 @@ static void pnv_chip_power10_realize(DeviceState *de= v, Error **errp) memory_region_add_subregion(get_system_memory(), PNV10_HOMER_BASE(chip= ), &chip10->homer.regs); =20 + /* nest1 chiplet control regs */ + if (!qdev_realize(DEVICE(&chip10->nest1_chiplet), NULL, errp)) { + return; + } + pnv_xscom_add_subregion(chip, PNV10_XSCOM_NEST1_CTRL_CHIPLET_BASE, + &chip10->nest1_chiplet.perv_chiplet.xscom_perv_ctrl_reg= s); + /* PHBs */ pnv_chip_power10_phb_realize(chip, &local_err); if (local_err) { diff --git a/include/hw/ppc/pnv_chip.h b/include/hw/ppc/pnv_chip.h index 53e1d92..4bcb925 100644 --- a/include/hw/ppc/pnv_chip.h +++ b/include/hw/ppc/pnv_chip.h @@ -4,6 +4,7 @@ #include "hw/pci-host/pnv_phb4.h" #include "hw/ppc/pnv_core.h" #include "hw/ppc/pnv_homer.h" +#include "hw/ppc/pnv_nest_chiplet.h" #include "hw/ppc/pnv_lpc.h" #include "hw/ppc/pnv_occ.h" #include "hw/ppc/pnv_psi.h" @@ -109,6 +110,7 @@ struct Pnv10Chip { PnvOCC occ; PnvSBE sbe; PnvHomer homer; + PnvNest1Chiplet nest1_chiplet; =20 uint32_t nr_quads; PnvQuad *quads; --=20 1.8.3.1