From nobody Fri Nov 14 21:39:25 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590490088; cv=none; d=zohomail.com; s=zohoarc; b=C69T8y18SGNMwtqJxf8hMhTLUFHMWrH70VdG5qz5mhDecWWJiU+UNNpFHAuQiJOkreexm2BHa/93aABQOipmUWbNWe5CSHo12TI3mV8Hk/IdVdsjYE5dhLvaON8ovNy60Gq2wgxUuR+L3DHbn+08IClUquiC8YYeznh43s869PY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590490088; 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=EBoNHrdrDyvUbiQ9fa2MJcvDvpC5sCF/C8lSyKTb4Pg=; b=W4fwpqz19D8s+wkkrPz3B/yOGcWrd42h33XHUPewnYpP0lS56s08G0N5vWXCuEKr5Tb7c7WqtU30ro0ktsYTh3ZdWT9T54khWOsbqsuOT0QaZoYKnsI+egtwz1HayNFN18Ui1EiknKE9nQNB1FymRP+xY2RowYVvTbHM7NXn8g4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1590490088204884.9164993449482; Tue, 26 May 2020 03:48:08 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-203-m6Z4CCEAOMifTl6b0lEBPQ-1; Tue, 26 May 2020 06:48:04 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0703F100CC86; Tue, 26 May 2020 10:47:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D8DC43C70; Tue, 26 May 2020 10:47:57 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A960B1809554; Tue, 26 May 2020 10:47:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 04QAlmOJ029861 for ; Tue, 26 May 2020 06:47:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id ADBDF2029F71; Tue, 26 May 2020 10:47:48 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A94B320110D9 for ; Tue, 26 May 2020 10:47:45 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5C5A880066A for ; Tue, 26 May 2020 10:47:45 +0000 (UTC) Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-43-YWHkU9jlMLe2AG5Qqeileg-1; Tue, 26 May 2020 06:47:38 -0400 Received: by mail-ej1-f67.google.com with SMTP id y13so1333921eju.2; Tue, 26 May 2020 03:47:37 -0700 (PDT) Received: from x1w.redhat.com (71.red-88-21-204.staticip.rima-tde.net. [88.21.204.71]) by smtp.gmail.com with ESMTPSA id c27sm3342597ejd.19.2020.05.26.03.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 03:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590490087; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=EBoNHrdrDyvUbiQ9fa2MJcvDvpC5sCF/C8lSyKTb4Pg=; b=a8RZYqFu+DHQ4dHH3kXUhUylxb1hT91Gg3tN7sZys4dTtZ7XJaipF5+EuZGR2rLImgWArO XpCgsQCrXHuQFQUq8Wo9JHJ36BHH/QojtOAeQi4kyPQUK7lsB8MqfyT/ckMT7UgLTpzaVM qZgt8Bu3QjUxa6pixCMI3l5kOxWUmXI= X-MC-Unique: m6Z4CCEAOMifTl6b0lEBPQ-1 X-MC-Unique: YWHkU9jlMLe2AG5Qqeileg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=EBoNHrdrDyvUbiQ9fa2MJcvDvpC5sCF/C8lSyKTb4Pg=; b=XVu2wzHys/AzbJdStC2CF9m4xv20cpM3+lETJUjOQB+vzVFELOxNPo2bdDIKXkx2tD oDjv+n6ABRgpyidcS/eWySipHrcRCLJ39vVoJgcGNuD8fiq5XPUr3KJOIcCejjM8/6CC B2yA4yCHgNR9Bt4W7c4GzUGmtVBwzndSw7JgQKqCqE/Vd3kHrVl6wJp5ppgGu0AFvymX 7iUyF439fP30c/Wty9MX67fycg9kIV/H2F28aRAYHX4CHzhZd7Xi8FrCmjzo3iaNrsU9 zIipREdXAXdtuT91CVKSBgcPS7KgfV8Mvej6Lc2LRGIODe1Tquwc1j6QVOXskbUNrOEi 4jNA== X-Gm-Message-State: AOAM532GhwdJGJQrDaM2UVeCo4W/0QPYeP2LF0vlxVX53sDvlxV7kJdR cbvU1wl0sikdveyieNw8R4o= X-Google-Smtp-Source: ABdhPJzrZGxiuixgK5Ees0G9MM1yyHNLbdJSdf/vdsELI0edNnmGhRFuZZw5qB3FKTP/ahPwb4cfjA== X-Received: by 2002:a17:906:a1c9:: with SMTP id bx9mr519464ejb.496.1590490056746; Tue, 26 May 2020 03:47:36 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 06/14] hw/pci-host/bonito: Map the different PCI ranges more detailled Date: Tue, 26 May 2020 12:47:18 +0200 Message-Id: <20200526104726.11273-7-f4bug@amsat.org> In-Reply-To: <20200526104726.11273-1-f4bug@amsat.org> References: <20200526104726.11273-1-f4bug@amsat.org> MIME-Version: 1.0 X-Mimecast-Spam-Signature: yes X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: Laurent Vivier , Aleksandar Rikalo , libvir-list@redhat.com, Thomas Huth , Jiaxun Yang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Markovic , Huacai Chen , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Better describe the Bonito64 MEM HI/LO and I/O PCI ranges, add more PCI regions as unimplemented. Message-id: <20200510210128.18343-10-f4bug@amsat.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Aleksandar Markovic --- hw/pci-host/bonito.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index f09bb1c6a8..52015cc2a7 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -39,6 +39,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu/error-report.h" #include "hw/pci/pci.h" #include "hw/irq.h" @@ -82,7 +83,7 @@ #define BONITO_PCILO1_BASE 0x14000000 #define BONITO_PCILO2_BASE 0x18000000 #define BONITO_PCIHI_BASE 0x20000000 -#define BONITO_PCIHI_SIZE 0x20000000 +#define BONITO_PCIHI_SIZE 0x60000000 #define BONITO_PCIHI_TOP (BONITO_PCIHI_BASE + BONITO_PCIHI_SIZE - 1) #define BONITO_PCIIO_BASE 0x1fd00000 #define BONITO_PCIIO_BASE_VA 0xbfd00000 @@ -605,14 +606,26 @@ static void bonito_pcihost_realize(DeviceState *dev, = Error **errp) { PCIHostState *phb =3D PCI_HOST_BRIDGE(dev); BonitoState *bs =3D BONITO_PCI_HOST_BRIDGE(dev); + MemoryRegion *pcimem_lo_alias =3D g_new(MemoryRegion, 3); =20 - memory_region_init(&bs->pci_mem, OBJECT(dev), "pci.mem", BONITO_PCILO_= SIZE); + memory_region_init(&bs->pci_mem, OBJECT(dev), "pci.mem", BONITO_PCIHI_= SIZE); phb->bus =3D pci_register_root_bus(dev, "pci", pci_bonito_set_irq, pci_bonito_map_ir= q, dev, &bs->pci_mem, get_system_io(), 0x28, 32, TYPE_PCI_BUS); - memory_region_add_subregion(get_system_memory(), BONITO_PCILO_BASE, - &bs->pci_mem); + + for (size_t i =3D 0; i < 3; i++) { + char *name =3D g_strdup_printf("pci.lomem%zu", i); + + memory_region_init_alias(&pcimem_lo_alias[i], NULL, name, + &bs->pci_mem, i * 64 * MiB, 64 * MiB); + memory_region_add_subregion(get_system_memory(), + BONITO_PCILO_BASE + i * 64 * MiB, + &pcimem_lo_alias[i]); + g_free(name); + } + + create_unimplemented_device("pci.io", BONITO_PCIIO_BASE, 1 * MiB); } =20 static void bonito_realize(PCIDevice *dev, Error **errp) @@ -620,6 +633,8 @@ static void bonito_realize(PCIDevice *dev, Error **errp) PCIBonitoState *s =3D PCI_BONITO(dev); SysBusDevice *sysbus =3D SYS_BUS_DEVICE(s->pcihost); PCIHostState *phb =3D PCI_HOST_BRIDGE(s->pcihost); + BonitoState *bs =3D BONITO_PCI_HOST_BRIDGE(s->pcihost); + MemoryRegion *pcimem_alias =3D g_new(MemoryRegion, 1); =20 /* * Bonito North Bridge, built on FPGA, @@ -652,6 +667,7 @@ static void bonito_realize(PCIDevice *dev, Error **errp) sysbus_init_mmio(sysbus, &s->iomem_ldma); sysbus_mmio_map(sysbus, 3, 0x1fe00200); =20 + /* PCI copier */ memory_region_init_io(&s->iomem_cop, OBJECT(s), &bonito_cop_ops, s, "cop", 0x100); sysbus_init_mmio(sysbus, &s->iomem_cop); @@ -669,6 +685,14 @@ static void bonito_realize(PCIDevice *dev, Error **err= p) sysbus_init_mmio(sysbus, &s->bonito_localio); sysbus_mmio_map(sysbus, 6, BONITO_DEV_BASE); =20 + memory_region_init_alias(pcimem_alias, NULL, "pci.mem.alias", + &bs->pci_mem, 0, BONITO_PCIHI_SIZE); + memory_region_add_subregion(get_system_memory(), + BONITO_PCIHI_BASE, pcimem_alias); + create_unimplemented_device("PCI_2", + (hwaddr)BONITO_PCIHI_BASE + BONITO_PCIHI_S= IZE, + 2 * GiB); + /* set the default value of north bridge pci config */ pci_set_word(dev->config + PCI_COMMAND, 0x0000); pci_set_word(dev->config + PCI_STATUS, 0x0000); --=20 2.21.3