From nobody Tue Nov 26 12:34:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1707909509; cv=none; d=zohomail.com; s=zohoarc; b=Mo27UF6JlibOtYniqkIHKKSI4Dcv7rQlTib5kNOAlYRG7/uKJZKEe3B/fs/TJGCCitX6znRbftzTtsS1I12R6JaHqO3LUFuWh0zul4zk3ZZ6+hqP3ctaA1LT2h8NhvAKpa8hCrRVZhN54fGJVYY1dpi7APzO56M1yH8er0akq3c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707909509; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=s/uvRz6NqAtcw4NfACRR0TvuyVvMvzlS8V+gAdYV2LQ=; b=LAXjy0DkyQbQqDtEUN2PTUSWXqRIs5kBB49nBMWWSBststZwy6mMfPqDCzft6LSn9ldsmGAW7rwvUqJrAxEHFYsQDV3T3fDxIw+zKqIo1CBUwcd6TptoLxkjtmXNIL3FbBpgdsm9xGqTHPjUNwGDSNykt1Q9NGtVJcSmgP5N1wg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1707909509667478.4384811573715; Wed, 14 Feb 2024 03:18:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1raDEE-0003iS-Dc; Wed, 14 Feb 2024 06:15:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1raDEC-0003fQ-Ht for qemu-devel@nongnu.org; Wed, 14 Feb 2024 06:15:00 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1raDEB-0006yR-4j for qemu-devel@nongnu.org; Wed, 14 Feb 2024 06:15:00 -0500 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-112-JPytBuucNI68ZQx80FsLMw-1; Wed, 14 Feb 2024 06:14:57 -0500 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a27eddc1c27so115463666b.3 for ; Wed, 14 Feb 2024 03:14:56 -0800 (PST) Received: from redhat.com ([2.52.26.67]) by smtp.gmail.com with ESMTPSA id u15-20020a170906408f00b00a3bc368ca7esm2219174ejj.53.2024.02.14.03.14.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 03:14:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707909298; 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: in-reply-to:in-reply-to:references:references; bh=s/uvRz6NqAtcw4NfACRR0TvuyVvMvzlS8V+gAdYV2LQ=; b=VE44sy85Dx+gKRi6+KWV5veh9aY3QCWYO4s/HcBeKELWVh+RswkWPMhCqAvDFIm8hZT/5d cA574G4aVnhhUZe7gGN+KX0iYF6y6moiKfblLHW6+oNkLnNftw5CtLyXPGT0wTo2tr+4VB Uq/PtTb9ziqGY4l7+hiD2sJzOYElLPI= X-MC-Unique: JPytBuucNI68ZQx80FsLMw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707909295; x=1708514095; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=s/uvRz6NqAtcw4NfACRR0TvuyVvMvzlS8V+gAdYV2LQ=; b=Oz/as7I14AxMV2+KXtKDhSPzFCc95JeuoL0JCwAzF+eLsUaBhRIHJ+HusrzMZLmc7q /WdqNK7rYoeZ9Usm6UlWVPSAdT3TVzB9WTQvqOAwoitpWn+fIZkGBABUZ5jaJQ2Z8FH1 0sLGRVeaGlR8dTfvb8mOTbaOPnYV2EemggJUUMOwlkyeXbOMflvcUoyKEm4ostsQ2s5n HRebonc5xlLz6AAI8uuRAI6hAEmH5PnEtA9leRZ6WlXsdYYknP/SXZAC8IBuwYxztmlI DPPv45kwcYfZYOtC8CXDNfs6CjdSRYCesetl/WNx5cTqQzPSgwoUpLklgS9RvQ6t0iBm zirA== X-Gm-Message-State: AOJu0YwGk2ng1Hq8q4ybNBIA4cB2UebO7s97y8ox+7c1M8kH0pWden7w Ljzd2jzkB2AFs0aFTYiN9CroRoRZ03688t5rdbtwjRZH8vUfyxTb8BGIiq0HXmtEc/I9/DUOeT2 1E5JdxWqoYJw1rB0Pci3ySWu9TydCqpJvWdFwyMKlR7zIIeK8YcsgwH1CErsxmNk7qNvUCamJfj fM/8LaxoIKINCsg+WxM3UGtUhbQfsyeQ== X-Received: by 2002:a17:906:c13:b0:a3c:ffbb:b47c with SMTP id s19-20020a1709060c1300b00a3cffbbb47cmr1458258ejf.72.1707909295256; Wed, 14 Feb 2024 03:14:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IFbMT8fA2YEV9bk+O+Ln3/XbRME1NygdGCkdkvS5mwmdQHeYLIt/V8BE6DQifwPSVugixtJHQ== X-Received: by 2002:a17:906:c13:b0:a3c:ffbb:b47c with SMTP id s19-20020a1709060c1300b00a3cffbbb47cmr1458241ejf.72.1707909294940; Wed, 14 Feb 2024 03:14:54 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXQQkuBtSu5oB2RP3FEfHM3PdnpW3n6dvFMQ2xo4nV2c2GujC878mOleSuKgQs4CqCpuz5l/eJfOhlFoE+jhQP337xuPb+Tc5w1YP4DPbsrAcrA+vmIl1YwdtzHqZdlo9su0LsSRHkYgjds Date: Wed, 14 Feb 2024 06:14:52 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bernhard Beschow , BALATON Zoltan , qemu-ppc@nongnu.org Subject: [PULL 31/60] hw/ppc/pegasos2: Let pegasos2 machine configure SuperI/O functions Message-ID: <79a7f53065abea95b33e2212dcfb58e1de4be479.1707909001.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.504, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1707909510111100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Bernhard Beschow This is a preparation for implementing relocation and toggling of SuperI/O functions in the VT8231 device model. Upon reset, all SuperI/O functions wi= ll be deactivated, so in case if no -bios is given, let the machine configure tho= se functions the same way Pegasos II firmware would do. Signed-off-by: Bernhard Beschow Reviewed-by: BALATON Zoltan Message-Id: <20240114123911.4877-11-shentey@gmail.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/ppc/pegasos2.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c index d84f3f977d..04d6decb2b 100644 --- a/hw/ppc/pegasos2.c +++ b/hw/ppc/pegasos2.c @@ -285,6 +285,12 @@ static void pegasos2_pci_config_write(Pegasos2MachineS= tate *pm, int bus, pegasos2_mv_reg_write(pm, pcicfg + 4, len, val); } =20 +static void pegasos2_superio_write(uint8_t addr, uint8_t val) +{ + cpu_physical_memory_write(PCI1_IO_BASE + 0x3f0, &addr, 1); + cpu_physical_memory_write(PCI1_IO_BASE + 0x3f1, &val, 1); +} + static void pegasos2_machine_reset(MachineState *machine, ShutdownCause re= ason) { Pegasos2MachineState *pm =3D PEGASOS2_MACHINE(machine); @@ -310,6 +316,12 @@ static void pegasos2_machine_reset(MachineState *machi= ne, ShutdownCause reason) =20 pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) | PCI_INTERRUPT_LINE, 2, 0x9); + pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) | + 0x50, 1, 0x6); + pegasos2_superio_write(0xf4, 0xbe); + pegasos2_superio_write(0xf6, 0xef); + pegasos2_superio_write(0xf7, 0xfc); + pegasos2_superio_write(0xf2, 0x14); pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) | 0x50, 1, 0x2); pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) | --=20 MST