From nobody Wed May 15 10:15:30 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1672929809; cv=none; d=zohomail.com; s=zohoarc; b=FZcNnEwmfe7mXrS3uKZaf37NFXZV0h+Ws83B6BemSxFupg2Xc6X83Jav/n7G3IkKSW1XFa5u8V8gd13cW7pTFjvqEDc8BxwDUbrpA5GS1Nitn0GHhfLJZqJYNlazNzp+huv7WlHbxoiVBU9Txz3JYSxYwodzm5gy4b82S480y+A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672929809; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=p1bd5FHNKdTesBkkzYYqtQBUW8rR1SSO2CgSCTIRLow=; b=QZZKyiHza/KLrLoRqAD7sU6NP4wVMl9xkb1wKJsI3pgamF4vklTygCMmSSKBEeK2VpDVSAuoaKjLYni7lSEO2c3+1PrkrLM1dCZzP/HBZbuZL/OCJYZxcUvuMU3jz16Jar7iaj4j6op5jZlct5RPHzU14fMErIaPHTmJd3pea90= 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 1672929809044629.8230406128541; Thu, 5 Jan 2023 06:43:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDRRS-0000B7-Mv; Thu, 05 Jan 2023 09:42:04 -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 1pDRRE-00006X-JE for qemu-devel@nongnu.org; Thu, 05 Jan 2023 09:41:49 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pDRRC-0003gf-4I for qemu-devel@nongnu.org; Thu, 05 Jan 2023 09:41:48 -0500 Received: by mail-wm1-x335.google.com with SMTP id ja17so28172022wmb.3 for ; Thu, 05 Jan 2023 06:41:45 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id j25-20020a05600c1c1900b003cfa80443a0sm2984884wms.35.2023.01.05.06.41.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 05 Jan 2023 06:41:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=p1bd5FHNKdTesBkkzYYqtQBUW8rR1SSO2CgSCTIRLow=; b=G51wMLeozsTBY5T49HrFnHhkiYQ6fDCOtpu9YLTmfOCyMtUTtadDDf21bNZsPiGWOj mddN3q/WVNatBeblU5muvOM+BmoaCwto9lsyJgyObga0n3yzu1MnLjBQrl47qhaOFug7 /UPRh0QGnJEkgtTr3jA2UZe+KEDLGryJfaK+wwBU1KUa0AXDe1DTptyF8y8QpTvnr+Rj bXJE4aks0Yb0C1Vn8mGNISazc6UOukpMjwxW0dWHB6LnNC/ocwS2RKRLyiBNTgiph+Go 4es78WWDU0BExhHga8XQIS4VklLn2v2KbsROEmyLip3t0FgY+RWI8J9T4zyHEOtqbra+ 3N3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=p1bd5FHNKdTesBkkzYYqtQBUW8rR1SSO2CgSCTIRLow=; b=EA8GuSMC4MvF7BujRFab4tvC/HL3kvfB0tSC6V4boLv7mEQAGkr4w/Em77z1ZuFdX7 MPp2EPRMVMZ1vYXBUIdM402u1fjIjblA0puq5Gf6rcbd3KeKrMHGswDeF6t3DgQVDo7s VzEQxIKEiPtrYzI57Z5+WX7Wx+fpOgkemcNh/tw7X7cvBphtAOY2PdH5FrQIRAawydzS i+C8G1PMcq4BP1pxA9N2x6ssREGq6BwOasXL2amo61wrnGunP7gwuPsdHJqAgVupaXQO WUd0juXlcYJicck3KUkCVIFs/YFc+qoUtUVIxLVaeBs34R8Va54WXUV1qdGcAeLasKoz Me6g== X-Gm-Message-State: AFqh2kr1P9GtDIkCFLCvo1ABTmueFVlrwdTQBOgcaY5yNHIcs/me/whQ TIaenzMJpknKKCQaDKDw9uBetoHcJU9DJxQP X-Google-Smtp-Source: AMrXdXtZx0gwJKhqFcgw4PhV1d9kW14Lgcfr7DkOXP9qehmm7Moi74E0OA6yiFoUNTJGvn8CsD2aLw== X-Received: by 2002:a05:600c:354b:b0:3d0:4993:d45b with SMTP id i11-20020a05600c354b00b003d04993d45bmr38012861wmq.4.1672929704051; Thu, 05 Jan 2023 06:41:44 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Mark Cave-Ayland , "Michael S. Tsirkin" , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Marcel Apfelbaum , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH] hw/pci-host: Use register definitions from PCI standard Date: Thu, 5 Jan 2023 15:41:42 +0100 Message-Id: <20230105144142.51990-1-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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=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 @linaro.org) X-ZM-MESSAGEID: 1672929809480100001 No need to document magic values when the definition names from "standard-headers/linux/pci_regs.h" are self-explicit. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Mark Cave-Ayland --- hw/pci-host/grackle.c | 2 +- hw/pci-host/raven.c | 6 +++--- hw/pci-host/uninorth.c | 30 +++++++++++------------------- 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c index 95945ac0f4..2a45cc13c3 100644 --- a/hw/pci-host/grackle.c +++ b/hw/pci-host/grackle.c @@ -91,7 +91,7 @@ static void grackle_init(Object *obj) =20 static void grackle_pci_realize(PCIDevice *d, Error **errp) { - d->config[0x09] =3D 0x01; + d->config[PCI_CLASS_PROG] =3D 0x01; } =20 static void grackle_pci_class_init(ObjectClass *klass, void *data) diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c index 7a105e4a63..c47259a851 100644 --- a/hw/pci-host/raven.c +++ b/hw/pci-host/raven.c @@ -329,9 +329,9 @@ static void raven_realize(PCIDevice *d, Error **errp) char *filename; int bios_size =3D -1; =20 - d->config[0x0C] =3D 0x08; // cache_line_size - d->config[0x0D] =3D 0x10; // latency_timer - d->config[0x34] =3D 0x00; // capabilities_pointer + d->config[PCI_CACHE_LINE_SIZE] =3D 0x08; + d->config[PCI_LATENCY_TIMER] =3D 0x10; + d->config[PCI_CAPABILITY_LIST] =3D 0x00; =20 memory_region_init_rom_nomigrate(&s->bios, OBJECT(s), "bios", BIOS_SIZ= E, &error_fatal); diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c index 8396c91d59..342baff12a 100644 --- a/hw/pci-host/uninorth.c +++ b/hw/pci-host/uninorth.c @@ -277,11 +277,11 @@ static void pci_unin_internal_init(Object *obj) static void unin_main_pci_host_realize(PCIDevice *d, Error **errp) { /* cache_line_size */ - d->config[0x0C] =3D 0x08; + d->config[PCI_CACHE_LINE_SIZE] =3D 0x08; /* latency_timer */ - d->config[0x0D] =3D 0x10; + d->config[PCI_LATENCY_TIMER] =3D 0x10; /* capabilities_pointer */ - d->config[0x34] =3D 0x00; + d->config[PCI_CAPABILITY_LIST] =3D 0x00; =20 /* * Set kMacRISCPCIAddressSelect (0x48) register to indicate PCI @@ -296,30 +296,22 @@ static void unin_main_pci_host_realize(PCIDevice *d, = Error **errp) =20 static void unin_agp_pci_host_realize(PCIDevice *d, Error **errp) { - /* cache_line_size */ - d->config[0x0C] =3D 0x08; - /* latency_timer */ - d->config[0x0D] =3D 0x10; - /* capabilities_pointer - d->config[0x34] =3D 0x80; */ + d->config[PCI_CACHE_LINE_SIZE] =3D 0x08; + d->config[PCI_LATENCY_TIMER] =3D 0x10; + /* d->config[PCI_CAPABILITY_LIST] =3D 0x80; */ } =20 static void u3_agp_pci_host_realize(PCIDevice *d, Error **errp) { - /* cache line size */ - d->config[0x0C] =3D 0x08; - /* latency timer */ - d->config[0x0D] =3D 0x10; + d->config[PCI_CACHE_LINE_SIZE] =3D 0x08; + d->config[PCI_LATENCY_TIMER] =3D 0x10; } =20 static void unin_internal_pci_host_realize(PCIDevice *d, Error **errp) { - /* cache_line_size */ - d->config[0x0C] =3D 0x08; - /* latency_timer */ - d->config[0x0D] =3D 0x10; - /* capabilities_pointer */ - d->config[0x34] =3D 0x00; + d->config[PCI_CACHE_LINE_SIZE] =3D 0x08; + d->config[PCI_LATENCY_TIMER] =3D 0x10; + d->config[PCI_CAPABILITY_LIST] =3D 0x00; } =20 static void unin_main_pci_host_class_init(ObjectClass *klass, void *data) --=20 2.38.1