From patchwork Mon Jun 28 14:35:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 468009 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4045722jao; Mon, 28 Jun 2021 07:38:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbt0gYFCS2OzjY4utEbU4Tdz09S9EaJfqy/UjdmqUqLdBJKuRMH3KERvF3EVgqmFNs+az8 X-Received: by 2002:a9f:2acf:: with SMTP id d15mr20994705uaj.82.1624891107185; Mon, 28 Jun 2021 07:38:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624891107; cv=none; d=google.com; s=arc-20160816; b=Tbouwppoar7DU9tDOYvveRBVF85xXXyMtJsPm9FAPYI5MoqyvC/Z4jysNFBJi341nJ PI8McGHWcsBGJ5bW+qFHrp7XhlQTr2Jrk8NEzQoMaWvIq41upniiaAUSAu1G0hkWM6Ql k06Hdkl41d4BSGDDvsKip1wowm4iSmFtjO7fPkNn4bDvbKFRtsPKXarsD/yghgQm+qH/ x8zs0q6Ws9M3daHkYYlMEGsq5QVadaCxRvcBTCtp59yaQn5vi6F6AhHy1kLCGARimNyk fNj1sdA545+5PywcG0kqrDwLDIykzRD08YqtH04sWNEH71d94BUD1JmQsGe1P3dk36NR 5aIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=0RIZcAGtf2wk/6EK7iE6Gu5hPUTlpTApAXivA9sXxo8=; b=qMX+4N+55pZxggDNbFLXg23xwI1vaa9SUikFM/bikiRItL5cZ7m3Z3+mp7+mFHOyLB ZtadotOVPcBSQPtBn63nPjOH5NE6WBqt6GCY53LQyc9qzKCnEcgG9M5Cho5PCg0Ewmio yHYV6M+sgra0JJeGBUBlxNoifpMLKjvgWAmP7p42JDEDZMtYCACH2lp6BuvxpQv9sUT7 YunUVXaNDux8qv/gRWfBs8LvAlE7IST808vFonbGgA757mbkfa9CriA6rrZyCTMNMbmc AiWQJeXLgiEmHPwtgoqEyYt5/FoR6Fq/5pm8qbbYfcEub+0Hrwn9zecqwyuvsg0+WV5v wkrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pYJuM5EJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k2si9604397vsh.125.2021.06.28.07.38.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Jun 2021 07:38:27 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pYJuM5EJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxsP4-0004W6-HI for patch@linaro.org; Mon, 28 Jun 2021 10:38:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxsMe-0007c6-1C for qemu-devel@nongnu.org; Mon, 28 Jun 2021 10:35:56 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:43006) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lxsMc-0000aC-4f for qemu-devel@nongnu.org; Mon, 28 Jun 2021 10:35:55 -0400 Received: by mail-pl1-x62c.google.com with SMTP id v13so9037360ple.9 for ; Mon, 28 Jun 2021 07:35:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0RIZcAGtf2wk/6EK7iE6Gu5hPUTlpTApAXivA9sXxo8=; b=pYJuM5EJDJ729E3hLZOpJevEVDKWLhVasz/blIA2qljmlaegNewTdQt1tB/srC3ScQ aa1G/kpTh2T2wLNuupq0DJl335gE53nbx6KsRqCFhqHHncg9q1CaIGpJCSlGWPGmMxum vTYsR1Pv5dYmnx+Rs4TmDUle1d1uOcMPhqzqxplDzJ3N0yleugx4w8RIg/TkFHimUdwY p7PaMeXVWaothqR4zKT7cKJPQHRcFNcYc5bpuqS9XUn6idYVfNkYRumQI8ia/dkHCHDU tqK+i9vzSVIBQz+hOo+fjYlwug2r1oQ1O65Ky6tbmQDJsquVWRDkvpFKANvOjGkZT32h BHWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0RIZcAGtf2wk/6EK7iE6Gu5hPUTlpTApAXivA9sXxo8=; b=fGDz5DGwGi6HHWHYnfj29iud7k++0zJI0TQeM33oBs/u4zrQVKSeLlHmQw7B8b0FG6 1qQsIc+8wPHFzCkfTyqb/X2flwnoCfWh3No7HyDJZjQ0Y8HJBM/aW4NxmkkzmM4EctH1 kV7U2PvoEDgV5BQ+EiVqB7xWcJSNdVMYBvp/GTiRSCKazNkd5xZ/WEzivjCNfDEfBdfJ Ysf0Z3F7bF+YahtKuMzXgRU5HaVB3QZG2iv0C3t6FE1buB1Ppz55oIkXLEz0HtB88yqa zy4OEWj2AeD3xNissME8CuXTmeIFHJMEdBvgqjkTs7DYpWHpanuaISbQtf0X7OSD3ulq 94Zw== X-Gm-Message-State: AOAM532GyXQLF6U0PxqN9RlLEGZnG0skIuoWE0jnTYeBYgWJvoSsvcFw De/b/gfBznWjO5xzloWJ0J1YVu7yCvT0vA== X-Received: by 2002:a17:90a:d3d2:: with SMTP id d18mr38272250pjw.102.1624890952883; Mon, 28 Jun 2021 07:35:52 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id k13sm72779pgh.82.2021.06.28.07.35.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Jun 2021 07:35:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 1/5] hw/alpha: Set minimum PCI device ID to 1 to match Clipper IRQ mappings Date: Mon, 28 Jun 2021 07:35:47 -0700 Message-Id: <20210628143551.2870006-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210628143551.2870006-1-richard.henderson@linaro.org> References: <20210628143551.2870006-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: peter.maydell@linaro.org, Jason Thorpe Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Jason Thorpe Since we are emulating a Clipper device topology, we need to set the minimum PCI device ID to 1, as there is no IRQ mapping for a device at ID 0 (see sys_dp264.c:clipper_map_irq()). - Add a 'devfn_min' argument to typhoon_init(). Pass that argument along to pci_register_root_bus(). - In clipper_init(), pass PCI_DEVFN(1, 0) as the minimum PCI device ID/function. Signed-off-by: Jason Thorpe Message-Id: <20210613211549.18094-3-thorpej@me.com> Signed-off-by: Richard Henderson --- hw/alpha/alpha_sys.h | 2 +- hw/alpha/dp264.c | 7 +++++-- hw/alpha/typhoon.c | 5 +++-- 3 files changed, 9 insertions(+), 5 deletions(-) -- 2.25.1 diff --git a/hw/alpha/alpha_sys.h b/hw/alpha/alpha_sys.h index e2c02e2bbe..4835b3d5ee 100644 --- a/hw/alpha/alpha_sys.h +++ b/hw/alpha/alpha_sys.h @@ -11,7 +11,7 @@ PCIBus *typhoon_init(MemoryRegion *, ISABus **, qemu_irq *, AlphaCPU *[4], - pci_map_irq_fn); + pci_map_irq_fn, uint8_t devfn_min); /* alpha_pci.c. */ extern const MemoryRegionOps alpha_pci_ignore_ops; diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index 1017ecf330..010d22476b 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c @@ -76,9 +76,12 @@ static void clipper_init(MachineState *machine) cpus[0]->env.trap_arg1 = 0; cpus[0]->env.trap_arg2 = smp_cpus; - /* Init the chipset. */ + /* + * Init the chipset. Because we're using CLIPPER IRQ mappings, + * the minimum PCI device IdSel is 1. + */ pci_bus = typhoon_init(machine->ram, &isa_bus, &rtc_irq, cpus, - clipper_pci_map_irq); + clipper_pci_map_irq, PCI_DEVFN(1, 0)); /* Since we have an SRM-compatible PALcode, use the SRM epoch. */ mc146818_rtc_init(isa_bus, 1900, rtc_irq); diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c index 87020cbe0d..fa31a2f286 100644 --- a/hw/alpha/typhoon.c +++ b/hw/alpha/typhoon.c @@ -815,7 +815,8 @@ static void typhoon_alarm_timer(void *opaque) } PCIBus *typhoon_init(MemoryRegion *ram, ISABus **isa_bus, qemu_irq *p_rtc_irq, - AlphaCPU *cpus[4], pci_map_irq_fn sys_map_irq) + AlphaCPU *cpus[4], pci_map_irq_fn sys_map_irq, + uint8_t devfn_min) { MemoryRegion *addr_space = get_system_memory(); DeviceState *dev; @@ -885,7 +886,7 @@ PCIBus *typhoon_init(MemoryRegion *ram, ISABus **isa_bus, qemu_irq *p_rtc_irq, b = pci_register_root_bus(dev, "pci", typhoon_set_irq, sys_map_irq, s, &s->pchip.reg_mem, &s->pchip.reg_io, - 0, 64, TYPE_PCI_BUS); + devfn_min, 64, TYPE_PCI_BUS); phb->bus = b; sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);