From patchwork Mon Oct 21 13:12:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 11202163 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CC29A112B for ; Mon, 21 Oct 2019 13:13:48 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ABB612089C for ; Mon, 21 Oct 2019 13:13:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ABB612089C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kaod.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMXVL-0006en-Lk for patchwork-qemu-devel@patchwork.kernel.org; Mon, 21 Oct 2019 09:13:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34465) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMXUA-0005Nf-Nz for qemu-devel@nongnu.org; Mon, 21 Oct 2019 09:12:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMXU8-0003oS-GO for qemu-devel@nongnu.org; Mon, 21 Oct 2019 09:12:34 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:50228 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMXU7-0003nN-GE for qemu-devel@nongnu.org; Mon, 21 Oct 2019 09:12:32 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x9LD8YsQ087721 for ; Mon, 21 Oct 2019 09:12:29 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2vsc733a98-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 21 Oct 2019 09:12:28 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 21 Oct 2019 14:12:27 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 21 Oct 2019 14:12:24 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x9LDCNmt59637962 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 21 Oct 2019 13:12:23 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 044515205A; Mon, 21 Oct 2019 13:12:23 +0000 (GMT) Received: from smtp.tls.ibm.com (unknown [9.101.4.1]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id E564152054; Mon, 21 Oct 2019 13:12:22 +0000 (GMT) Received: from yukon.kaod.org.ibmuc.com (sig-9-145-86-58.uk.ibm.com [9.145.86.58]) by smtp.tls.ibm.com (Postfix) with ESMTP id 412AA22016B; Mon, 21 Oct 2019 15:12:22 +0200 (CEST) From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: David Gibson Subject: [PATCH 0/5] ppc/pnv: Add PNOR support Date: Mon, 21 Oct 2019 15:12:10 +0200 X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19102113-0028-0000-0000-000003ACEB4C X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19102113-0029-0000-0000-0000246F1276 Message-Id: <20191021131215.3693-1-clg@kaod.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-10-21_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=969 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910210128 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-001b2d01.pphosted.com id x9LD8YsQ087721 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 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: qemu-devel@nongnu.org, Greg Kurz , qemu-ppc@nongnu.org, Joel Stanley , "Marty E . Plummer" , =?utf-8?q?C=C3=A9dric_Le_Goater?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Hello, On a POWERPC PowerNV system, the host firmware is stored in a PNOR flash chip which contents is mapped on the LPC bus. This model adds a simple dummy device to map the contents of a block device in the host address space and activates HIOMAP support on the QEMU PowerNV machine to let the host negotiate with the BMC the access to the mapping. The command options to activate these models in QEMU: -device ipmi-bmc-sim,id=bmc0 -device isa-ipmi-bt,bmc=bmc0,irq=10 \ -drive file=./witherspoon.pnor,format=raw,if=mtd The last two patches add the logic to load in the machine memory the PAYLOAD partition (skiboot) from an OpenPOWER firmware file. These should be considered as RFCs as the firmware file could have a different format. Something to discuss. Thanks, C. Cédric Le Goater (5): ppc/pnv: Add a PNOR model ipmi: Add support to customize OEM functions ppc/pnv: Add HIOMAP commands libxz: Add XZ Embedded library for PPC ppc/pnv: Read the PNOR partition table include/hw/ipmi/ipmi.h | 36 ++ include/hw/ppc/ffs.h | 150 +++++ include/hw/ppc/pnv.h | 4 + include/hw/ppc/pnv_pnor.h | 36 ++ libxz/xz.h | 304 ++++++++++ libxz/xz_config.h | 124 ++++ libxz/xz_lzma2.h | 204 +++++++ libxz/xz_private.h | 156 +++++ libxz/xz_stream.h | 62 ++ hw/ipmi/ipmi_bmc_sim.c | 41 +- hw/ppc/pnv.c | 48 +- hw/ppc/pnv_bmc.c | 101 ++++ hw/ppc/pnv_lpc.c | 13 + hw/ppc/pnv_pnor.c | 291 +++++++++ libxz/xz_crc32.c | 59 ++ libxz/xz_dec_lzma2.c | 1171 +++++++++++++++++++++++++++++++++++++ libxz/xz_dec_stream.c | 847 +++++++++++++++++++++++++++ hw/ppc/Makefile.objs | 4 +- libxz/Makefile.objs | 1 + target/ppc/Makefile.objs | 1 + 20 files changed, 3606 insertions(+), 47 deletions(-) create mode 100644 include/hw/ppc/ffs.h create mode 100644 include/hw/ppc/pnv_pnor.h create mode 100644 libxz/xz.h create mode 100644 libxz/xz_config.h create mode 100644 libxz/xz_lzma2.h create mode 100644 libxz/xz_private.h create mode 100644 libxz/xz_stream.h create mode 100644 hw/ppc/pnv_pnor.c create mode 100644 libxz/xz_crc32.c create mode 100644 libxz/xz_dec_lzma2.c create mode 100644 libxz/xz_dec_stream.c create mode 100644 libxz/Makefile.objs