From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E033EC433ED for ; Tue, 18 May 2021 22:05:08 +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 3936761353 for ; Tue, 18 May 2021 22:05:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3936761353 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:43470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lj7pr-0001u5-AX for qemu-devel@archiver.kernel.org; Tue, 18 May 2021 18:05:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35968) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lj7hG-0007Ch-6W for qemu-devel@nongnu.org; Tue, 18 May 2021 17:56:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:23361) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lj7hB-0003CT-Vw for qemu-devel@nongnu.org; Tue, 18 May 2021 17:56:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621374969; h=from:from: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; bh=4mj2gfnZfCBRpQogSZRkYuV2axSsjwCefiXC31wD6Zo=; b=KYzI7VdARF2sUuVx49WghkS1QeV2nPDyjOG8GSSZKcqwq8rEDJn7QF7Y6ovG4y7p8+LHt/ DweeNXbu1rXRPfRdbL/eJJmND32KAbD4LKdQb3vy1NgCSEJt+pcALWVoMS7ZxCo6g9kFeW aBWIh0AnH/9y7N6972Yvv1njuwfmCYI= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-264-4rpXyKgcMimexWZpe-wmiw-1; Tue, 18 May 2021 17:56:07 -0400 X-MC-Unique: 4rpXyKgcMimexWZpe-wmiw-1 Received: by mail-ej1-f70.google.com with SMTP id w13-20020a170906384db02903d9ad6b26d8so1066201ejc.0 for ; Tue, 18 May 2021 14:56:07 -0700 (PDT) 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=4mj2gfnZfCBRpQogSZRkYuV2axSsjwCefiXC31wD6Zo=; b=o9u+syWImN+vRN52vdJRZrTrLPC6zuk674MhH9S4JujKnUjn9f1t6LZAJzPIfFRQPr J1yS26w2RQpimWaYh50Wx+dAllJk4EEnZ1i3zUDfXVaw7ItYBYPJX5B/6iU45H4zTdCg JpmI0MnbCRG4vi39AD0lO/tRHNj8REUOtoVTNhaElOxFRckAUkM4XdrhZU3PwRjGnQTR 2YVEvK6QPciESYPm3uzyovgBEyhJby+A4l/Zz8NSH/LknTmf6JkQ8xPBXIwQIGJwxuJU hSlaNZRshlzNE9rUuNYm0ukU2ktvTKtCnrj0H+WWF8iJmZlBVmmzUZyUg/zDLNPzp8Jq ywwA== X-Gm-Message-State: AOAM530+pBH48VrmUh+vsc6iiCug7k20cZRWJDf8ZNbv/DSxySCrrxC2 nxUYLoLzXdY4M7M9Irazheg4UcSQF8hNSBLWT4G19H1VTtbTl7mdss2EJ3oCWAyJXZlc/YX0TO4 NTdNgq3LKnw1s1C0= X-Received: by 2002:aa7:d718:: with SMTP id t24mr9681600edq.259.1621374966605; Tue, 18 May 2021 14:56:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLcxhisD70Y685w1e2tU1HSum86pDVs1XDF6xvVyRDYtUtt/up1h9E2iAQytr0lkSJCD6BrQ== X-Received: by 2002:aa7:d718:: with SMTP id t24mr9681585edq.259.1621374966434; Tue, 18 May 2021 14:56:06 -0700 (PDT) Received: from x1w.redhat.com (31.red-83-51-215.dynamicip.rima-tde.net. [83.51.215.31]) by smtp.gmail.com with ESMTPSA id k22sm1728326ejz.108.2021.05.18.14.56.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 14:56:06 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: John Snow , qemu-devel@nongnu.org Subject: [RFC PATCH 04/11] hw/ide/via: Set the ISA-bus QOM link Date: Tue, 18 May 2021 23:55:38 +0200 Message-Id: <20210518215545.1793947-5-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210518215545.1793947-1-philmd@redhat.com> References: <20210518215545.1793947-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: Elena Ufimtseva , John G Johnson , Thomas Huth , Jagannathan Raman , Mark Cave-Ayland , Markus Armbruster , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Set the ISA Bus link property on the VIA IDE object from the two unique users, the Fuloong and Pegasos machines. Add a check in via_ide_realize() to be sure this property is set. Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/via.c | 5 +++++ hw/mips/fuloong2e.c | 4 ++++ hw/ppc/pegasos2.c | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/hw/ide/via.c b/hw/ide/via.c index 65fdca6dcf4..654e15edfed 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -165,6 +165,11 @@ static void via_ide_realize(PCIDevice *dev, Error **errp) uint8_t *pci_conf = dev->config; int i; + if (!d->isa_bus) { + error_setg(errp, "via-ide: 'isa-bus' link not set"); + return; + } + pci_config_set_prog_interface(pci_conf, 0x8a); /* legacy mode */ pci_set_long(pci_conf + PCI_CAPABILITY_LIST, 0x000000c0); dev->wmask[PCI_INTERRUPT_LINE] = 0; diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c index 40e9a645e1b..7e644a701bc 100644 --- a/hw/mips/fuloong2e.c +++ b/hw/mips/fuloong2e.c @@ -201,12 +201,16 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus, int slot, qemu_irq intc, I2CBus **i2c_bus) { PCIDevice *dev; + BusState *isa_bus; dev = pci_create_simple_multifunction(pci_bus, PCI_DEVFN(slot, 0), true, TYPE_VT82C686B_ISA); + isa_bus = qdev_get_child_bus(DEVICE(dev), "isa.0"); qdev_connect_gpio_out(DEVICE(dev), 0, intc); dev = pci_new(PCI_DEVFN(slot, 1), "via-ide"); + object_property_set_link(OBJECT(dev), "isa-bus", + OBJECT(isa_bus), &error_abort); pci_realize_and_unref(dev, pci_bus, &error_abort); pci_ide_create_devs(dev); diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c index 8486a2eb8c6..ed6ddc3569b 100644 --- a/hw/ppc/pegasos2.c +++ b/hw/ppc/pegasos2.c @@ -57,6 +57,7 @@ static void pegasos2_init(MachineState *machine) PCIBus *pci_bus; PCIDevice *dev; I2CBus *i2c_bus; + BusState *isa_bus; const char *fwname = machine->firmware ?: PROM_FILENAME; char *filename; int sz; @@ -104,11 +105,14 @@ static void pegasos2_init(MachineState *machine) /* VT8231 function 0: PCI-to-ISA Bridge */ dev = pci_create_simple_multifunction(pci_bus, PCI_DEVFN(12, 0), true, TYPE_VT8231_ISA); + isa_bus = qdev_get_child_bus(DEVICE(dev), "isa.0"); qdev_connect_gpio_out(DEVICE(dev), 0, qdev_get_gpio_in_named(mv, "gpp", 31)); /* VT8231 function 1: IDE Controller */ dev = pci_new(PCI_DEVFN(12, 1), "via-ide"); + object_property_set_link(OBJECT(dev), "isa-bus", + OBJECT(isa_bus), &error_abort); pci_realize_and_unref(dev, pci_bus, &error_abort); pci_ide_create_devs(dev); -- 2.26.3