From nobody Fri Nov 14 21:43:04 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.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 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590500001; cv=none; d=zohomail.com; s=zohoarc; b=aqITji4jFB9BEin+Z0uenB+JHnjCXxvQ0UjZ2drW2SmNjBSlqcNE0akmxmLE83vFL+zNGd5MAP8wkxOS5DcPUXdnLvA/qdJioocGps/UDUKwr0ZMWIv08lSI7GJEQxfb7EI8CjJEjMUxXWrKkBA6xf6O/12/zH8zeKs+EUwAM+I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590500001; 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=ZjWj0dUmFcXqSOvS5eV4ZH48B9zS/5L5K/OAOs2OdMM=; b=HcdQRrQ/fR1wokvdrzh0WoUAtlysZBgdjDuGCies84LVFNZ1JKdw4HvX5K5YLMErcMz5TFgf6UR70Ag2wJZF3hHHQUI50zyc6MFM0f40j3x0CpV6Dv0oue9fdIJzSuBM22VFfgZ2jQyjICkTH3m2EW7+wuD7DVl25KhgrIFZRCw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.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 [205.139.110.120]) by mx.zohomail.com with SMTPS id 1590500001783357.8793129267167; Tue, 26 May 2020 06:33:21 -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-358-Ma_DO7ycMgWufwDndF-NxA-1; Tue, 26 May 2020 09:33:15 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 097F8800688; Tue, 26 May 2020 13:33:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D9AEC60BEC; Tue, 26 May 2020 13:33:07 +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 ABC2262D1F; Tue, 26 May 2020 13:33:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 04QDX38m012407 for ; Tue, 26 May 2020 09:33:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id B5DD25EDE5; Tue, 26 May 2020 13:33:03 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7DD65AB88 for ; Tue, 26 May 2020 13:33:03 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (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 7BC818F842A for ; Tue, 26 May 2020 13:33:03 +0000 (UTC) Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-137-j7oCi11GMRyOtQAAkG0K1A-1; Tue, 26 May 2020 09:33:00 -0400 Received: by mail-ed1-f68.google.com with SMTP id be9so17660936edb.2; Tue, 26 May 2020 06:32:59 -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 n25sm1623084edo.56.2020.05.26.06.32.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 06:32:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590500000; 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=ZjWj0dUmFcXqSOvS5eV4ZH48B9zS/5L5K/OAOs2OdMM=; b=e7LIQVC9ceNIIZmMxeyt4Fo6icyiFfNl2gIaRFq3C6BedQ1b3JTQiR/kaxXE0h5fcdAPfD U25RkK3CzR3TtAZDb/4rIIYusqQWottRjCqiQhvDWAPeNHHrW597R5aS425d5/4WePxKB4 J5ItguKjsud87NaDaB6pS96BS2S7YDk= X-MC-Unique: Ma_DO7ycMgWufwDndF-NxA-1 X-MC-Unique: j7oCi11GMRyOtQAAkG0K1A-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=ZjWj0dUmFcXqSOvS5eV4ZH48B9zS/5L5K/OAOs2OdMM=; b=MfBedqoWzeIv5qeObVV12xEgtc79KxkCJeONguPnxGOUtl/MHq9HNyPQEO/23/l28l U4BVrKuim+TBUbbtpUzzmMQZxUB4xXMgpwouovgSHnXBGb58FQgTSIxO/GKKtPMFc7nT ncfja9Se0uUNh0Dmgs7+nJW+XlC/4arIUMZVqzQ1M892hVkn0YM4IaoSi615yEiHl04T GrXdtXux4G+JKHv9I5OPr/aJcQAtsTVf6Zqu1YyNvj0K93zDG1NfhXrr4Fhqet4WVMvP OY4aLjFuOg14ttTzEGvrBUMHig1tYJVgab9I9DFHHyN7Aw8BfZKSYvwjdfDhw5sTxMxj 9auw== X-Gm-Message-State: AOAM530emtHD/jmk44dIUxGiCy6mmEXi01qaGC1kMkt2A6+GFw38D2NE OmHcA94M6qWfrtVuoVnaUE8dz0VNjyw= X-Google-Smtp-Source: ABdhPJy+QzkJ3L07bCS9TKLkT8JyNSsqPfDai0Swx+md90g3+7A3sUKqNYSLjXYEhxeZ4LyCQqy/9A== X-Received: by 2002:a05:6402:2032:: with SMTP id ay18mr19601948edb.281.1590499978445; Tue, 26 May 2020 06:32:58 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 06/14] hw/pci-host/bonito: Map the different PCI ranges more detailed Date: Tue, 26 May 2020 15:32:39 +0200 Message-Id: <20200526133247.13066-7-f4bug@amsat.org> In-Reply-To: <20200526133247.13066-1-f4bug@amsat.org> References: <20200526133247.13066-1-f4bug@amsat.org> MIME-Version: 1.0 X-Mimecast-Spam-Signature: yes X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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.79 on 10.5.11.12 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. Reviewed-by: Aleksandar Markovic Message-id: <20200526104726.11273-7-f4bug@amsat.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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