From nobody Mon Feb 9 23:40:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=1611681866; cv=none; d=zohomail.com; s=zohoarc; b=gIVCMLpvW1YKe4uQwzi73wHizWiTnQnUgKHM2wereDI0cCUuGIyPDImxaPvMmFUBhuMJn9+bVXZonH5n7ter3JWZ1q8DLh+AU8wBcwCePzN5Ue7wAgSd8Id0shWKDq2W038lJrYIwv+xIa6HtIsM1tVa0hqOkVsLIDiCxQqa4tU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611681866; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6MVKzy1pKne4zSU4UnO1TRV51Ss/Juy3p3OVpPEz5ts=; b=NWPYieRJj8VHCCbEGpe0ziW9tyxNyfwQxRsZcEDSM0Snu/L1kTHOB4G4oVdOq991yCiWgR5v0BOASKklo+3j7nfry96GJSLKNmlS1Jmn8PfYq6rgYZf7ZeQnbujfi5/SUif3bE+yEuIhOPRCZzn1KxgccjfRjSAY7nKpNXmouXc= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 1611681866294171.88212653877804; Tue, 26 Jan 2021 09:24:26 -0800 (PST) Received: from localhost ([::1]:44862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4S4m-0003Fv-Re for importer@patchew.org; Tue, 26 Jan 2021 12:24:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4RsK-000161-QN; Tue, 26 Jan 2021 12:11:32 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:14972) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4RsJ-0007E9-5a; Tue, 26 Jan 2021 12:11:32 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 10QH3Xgn126253; Tue, 26 Jan 2021 12:11:10 -0500 Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com with ESMTP id 36amnnnn56-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Jan 2021 12:11:10 -0500 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 10QGw6DN030717; Tue, 26 Jan 2021 17:11:09 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma01fra.de.ibm.com with ESMTP id 368be81hse-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Jan 2021 17:11:08 +0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 10QHAxVT26411358 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Jan 2021 17:10:59 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9775842041; Tue, 26 Jan 2021 17:11:06 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6773C42049; Tue, 26 Jan 2021 17:11:06 +0000 (GMT) Received: from smtp.tlslab.ibm.com (unknown [9.101.4.1]) by d06av24.portsmouth.uk.ibm.com (Postfix) with SMTP; Tue, 26 Jan 2021 17:11:06 +0000 (GMT) Received: from yukon.ibmuc.com (sig-9-145-70-48.uk.ibm.com [9.145.70.48]) by smtp.tlslab.ibm.com (Postfix) with ESMTP id AF2A822010B; Tue, 26 Jan 2021 18:11:05 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: David Gibson Subject: [PATCH 7/7] ppc/pnv: Introduce a LPC FW memory region attribute to map the PNOR Date: Tue, 26 Jan 2021 18:10:59 +0100 Message-Id: <20210126171059.307867-8-clg@kaod.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210126171059.307867-1-clg@kaod.org> References: <20210126171059.307867-1-clg@kaod.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737 definitions=2021-01-26_09:2021-01-26, 2021-01-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 clxscore=1034 mlxlogscore=621 bulkscore=0 spamscore=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101260088 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: softfail client-ip=148.163.158.5; envelope-from=clg@kaod.org; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-ppc@nongnu.org, Greg Kurz , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" This to map the PNOR from the machine init handler directly and finish the cleanup of the LPC model. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Joel Stanley --- include/hw/ppc/pnv.h | 1 + hw/ppc/pnv.c | 11 +++++++++++ hw/ppc/pnv_lpc.c | 7 ------- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h index ee7eda3e0102..d69cee17b232 100644 --- a/include/hw/ppc/pnv.h +++ b/include/hw/ppc/pnv.h @@ -58,6 +58,7 @@ struct PnvChip { MemoryRegion xscom; AddressSpace xscom_as; =20 + MemoryRegion *fw_mr; gchar *dt_isa_nodename; }; =20 diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index e500c2e2437e..50810df83815 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -871,6 +871,14 @@ static void pnv_init(MachineState *machine) pnv_ipmi_bt_init(pnv->isa_bus, pnv->bmc, 10); } =20 + /* + * The PNOR is mapped on the LPC FW address space by the BMC. + * Since we can not reach the remote BMC machine with LPC memops, + * map it always for now. + */ + memory_region_add_subregion(pnv->chips[0]->fw_mr, PNOR_SPI_OFFSET, + &pnv->pnor->mmio); + /* * OpenPOWER systems use a IPMI SEL Event message to notify the * host to powerdown @@ -1150,6 +1158,7 @@ static void pnv_chip_power8_realize(DeviceState *dev,= Error **errp) qdev_realize(DEVICE(&chip8->lpc), NULL, &error_fatal); pnv_xscom_add_subregion(chip, PNV_XSCOM_LPC_BASE, &chip8->lpc.xscom_re= gs); =20 + chip->fw_mr =3D &chip8->lpc.isa_fw; chip->dt_isa_nodename =3D g_strdup_printf("/xscom@%" PRIx64 "/isa@%x", (uint64_t) PNV_XSCOM_BASE(chip= ), PNV_XSCOM_LPC_BASE); @@ -1479,6 +1488,7 @@ static void pnv_chip_power9_realize(DeviceState *dev,= Error **errp) memory_region_add_subregion(get_system_memory(), PNV9_LPCM_BASE(chip), &chip9->lpc.xscom_regs); =20 + chip->fw_mr =3D &chip9->lpc.isa_fw; chip->dt_isa_nodename =3D g_strdup_printf("/lpcm-opb@%" PRIx64 "/lpc@0= ", (uint64_t) PNV9_LPCM_BASE(chip= )); =20 @@ -1592,6 +1602,7 @@ static void pnv_chip_power10_realize(DeviceState *dev= , Error **errp) memory_region_add_subregion(get_system_memory(), PNV10_LPCM_BASE(chip), &chip10->lpc.xscom_regs); =20 + chip->fw_mr =3D &chip10->lpc.isa_fw; chip->dt_isa_nodename =3D g_strdup_printf("/lpcm-opb@%" PRIx64 "/lpc@0= ", (uint64_t) PNV10_LPCM_BASE(chi= p)); } diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c index 11739e397b27..bcbca3db9743 100644 --- a/hw/ppc/pnv_lpc.c +++ b/hw/ppc/pnv_lpc.c @@ -824,7 +824,6 @@ ISABus *pnv_lpc_isa_create(PnvLpcController *lpc, bool = use_cpld, Error **errp) ISABus *isa_bus; qemu_irq *irqs; qemu_irq_handler handler; - PnvMachineState *pnv =3D PNV_MACHINE(qdev_get_machine()); =20 /* let isa_bus_new() create its own bridge on SysBus otherwise * devices specified on the command line won't find the bus and @@ -850,11 +849,5 @@ ISABus *pnv_lpc_isa_create(PnvLpcController *lpc, bool= use_cpld, Error **errp) =20 isa_bus_irqs(isa_bus, irqs); =20 - /* - * TODO: Map PNOR on the LPC FW address space on demand ? - */ - memory_region_add_subregion(&lpc->isa_fw, PNOR_SPI_OFFSET, - &pnv->pnor->mmio); - return isa_bus; } --=20 2.26.2