From patchwork Mon Feb 26 11:14:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 775861 Delivered-To: patch@linaro.org Received: by 2002:a5d:6103:0:b0:33d:da16:65b6 with SMTP id v3csp272670wrt; Mon, 26 Feb 2024 03:17:18 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXxRkkP3DNZG1UwaYq8kHaDBIJUBrKg1r3tCMvVQ3ukM43ozvPwB9iy7xngkEu7X/Admhdd77X8iY/RoF6NsgUr X-Google-Smtp-Source: AGHT+IEBWgXo2q0TBgD4CHyKmpPmVBF/HDM/1iVo/ZRNm5pjSoiwmIm3hfY53RCq6WYJsg71Xj4K X-Received: by 2002:a0c:e0c9:0:b0:68f:36a0:5e8b with SMTP id x9-20020a0ce0c9000000b0068f36a05e8bmr6541126qvk.47.1708946238554; Mon, 26 Feb 2024 03:17:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708946238; cv=none; d=google.com; s=arc-20160816; b=mR8C0Ro8UNVFy1AmOVKSVxarWjcL+by/lNeTl983J7+egkKskVoNDr5bZYD8WUQ/dQ /KY65/mQsfBe2GdhK6RF3JoEzEVIfuiFq4T2PzlnBeGQjP0bl6rmP3lD+YLY5+++rVxB A2hKkTAy/9rnbt3J1rP8Jo5e2O6zmpIJmDtPEgmG9aPKu9p2dvwpAxhb5nLRoglIGnT6 OjdmUAPqTizORP39hLxnp0lYMHtyxa/JZ2OgDwQTe8bYRu2bv9sbsjwD9L9u7/e6msZC auMZAqW9hb8m6MvPs2TLVuKS7wr2/n0Bjw4tnnHeC3aBLfUm/DJovd/11AeZhq0UmiDa aO0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=7QBqOyXgT7orA7qPi5TfakjR96hU4MOD2t1dujux2Zs=; fh=j4MxUKsQnom9H3Srwq13mMegTaYVxToeDvl/PNa+M5c=; b=MZ+Y8wFrkBwhzUEStHnEhugz3fRZPU4ZeIloRd1AfV2tdTy4Xc25rZxEUMa5vREGss jJtl3a7YudPUMPa0+0jIG/4GdnN8xGvVDR5b6bQg+4VEQnRL0Kwls0tQj8m7qQiA6rwc LgwI97AOI4ucdTJAXA66Bl6cbGWmYtF4k7MBRsdSOOgZ1DkTbjuqBck9RgqvDlW89uxw mX6CCnvmraWNLo/PrP6TJanaA5BHANraNhe6EAw6keQCA2D+KWnduLTKuOaf+Gl5Xe3j q+pozMszATzwA2OrdedgwqpvSlWWxh3RXgscR5F9nR0Aq6tu4GA3srFsEVzpLDYc0gY8 PPuw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H0ThD5yl; 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 hf11-20020a0562140e8b00b0068cf2ec8200si4853915qvb.95.2024.02.26.03.17.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Feb 2024 03:17:18 -0800 (PST) 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=H0ThD5yl; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reYwX-0000cl-4u; Mon, 26 Feb 2024 06:14:45 -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 1reYwU-0000aa-O4 for qemu-devel@nongnu.org; Mon, 26 Feb 2024 06:14:42 -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 1reYwS-0008Rk-4G for qemu-devel@nongnu.org; Mon, 26 Feb 2024 06:14:42 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-412a4055897so7474215e9.3 for ; Mon, 26 Feb 2024 03:14:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708946078; x=1709550878; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7QBqOyXgT7orA7qPi5TfakjR96hU4MOD2t1dujux2Zs=; b=H0ThD5ylskWje9aLan9+WVqTHLInbCs8lyyvkbnzJ3jWfyr+1WogGiFmhSINnO5WM3 KKloHYofNPb9qluCMG7mtNOxiZaN/DqI4rTSi3ysJ34kfm3KnwWJhIVvNSE/vN2t+uc+ 0Sz9vZOpZPrGV3oIv1FagFgQpbvOM/rPs4/RIB9RbK8mC8GxtFi9n6SukjYa2W7c3I9F ryN7zx8ECZCwRZzjzuzx2D5ObNiVs2cjpvdaUrYNIg/zCAJJi5hlF5t+JUS4J/CGTbTU hQqxdpZdHfl6vzyafJFpmXOvAgUvcSozi8SL4Pg5HIuF5Xuj+coYsfN8YWh9Dy19lU/L iV9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708946078; x=1709550878; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7QBqOyXgT7orA7qPi5TfakjR96hU4MOD2t1dujux2Zs=; b=Ih2EfiQKBpZvA5IO3gmGauZG4YEQSaYvUg70DYJvD/F2KiF41M65UHWNvvIfJdu99F ijlOcpWFtwJ9bhtMvIpiIeL6iRt/NfJbuQ5Oz3abKY8G5/yxvgk3I5yP+qYUUqY2iFwD OjGh6Wi5Q2OQDRRBI8GrLJ1p+O6NT97XMx1xwcaYNWXOTZAY4GRP7OfEaT+S4Nc7ck/c x6z8qxsnzqWQ2z1wLYjdwhFdARGNSiCPoRdda2giv+C1UZQoHn3yGIq8DgjFgftM7YBJ z3qiQyFpw9wWKyRt3o5YjN+YYEKBn2JiXhdjcu6Epy8jJIji7rb6mkFXV50lsIVPQoC5 Yy6g== X-Gm-Message-State: AOJu0Yxddr/oqynfAknNM9+td487vDtctwtkFq7Y1xbJmhN86KVqjjyN I+dOFgRSIwij5x33UojqTG9XIFbvzNAvsAEPDHbss2ZoXEwF5BSc8lBZKLykVJnmRTvMwf3v5az 1 X-Received: by 2002:a05:600c:2e04:b0:410:a039:ed5d with SMTP id o4-20020a05600c2e0400b00410a039ed5dmr5953078wmf.33.1708946078313; Mon, 26 Feb 2024 03:14:38 -0800 (PST) Received: from m1x-phil.lan ([176.176.164.69]) by smtp.gmail.com with ESMTPSA id 9-20020a05600c020900b004104bc8d841sm11534200wmi.13.2024.02.26.03.14.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 26 Feb 2024 03:14:37 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: Laurent Vivier , Thomas Huth , BALATON Zoltan , Ani Sinha , qemu-block@nongnu.org, Marcel Apfelbaum , Eduardo Habkost , John Snow , Paolo Bonzini , "Michael S. Tsirkin" , Igor Mammedov , Richard Henderson , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v2 03/15] hw/acpi/ich9: Restrict definitions from 'hw/southbridge/ich9.h' Date: Mon, 26 Feb 2024 12:14:02 +0100 Message-ID: <20240226111416.39217-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240226111416.39217-1-philmd@linaro.org> References: <20240226111416.39217-1-philmd@linaro.org> MIME-Version: 1.0 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, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Restrict ACPI definitions from "hw/southbridge/ich9.h" to the ACPI files where they are used. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/acpi/ich9.h | 15 +++++++++++++++ include/hw/southbridge/ich9.h | 18 ------------------ hw/acpi/ich9.c | 4 ++++ 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h index 215de3c91f..3587a35c9f 100644 --- a/include/hw/acpi/ich9.h +++ b/include/hw/acpi/ich9.h @@ -91,4 +91,19 @@ void ich9_pm_device_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, bool ich9_pm_is_hotpluggable_bus(HotplugHandler *hotplug_dev, BusState *bus); void ich9_pm_ospm_status(AcpiDeviceIf *adev, ACPIOSTInfoList ***list); + +#define ICH9_PMIO_PM1_STS 0x00 +#define ICH9_PMIO_PM1_EN 0x02 +#define ICH9_PMIO_PM1_CNT 0x04 +#define ICH9_PMIO_PM1_TMR 0x08 +#define ICH9_PMIO_GPE0_STS 0x20 +#define ICH9_PMIO_GPE0_EN 0x28 +#define ICH9_PMIO_GPE0_LEN 16 +#define ICH9_PMIO_SMI_EN 0x30 +#define ICH9_PMIO_SMI_EN_APMC_EN (1 << 5) +#define ICH9_PMIO_SMI_EN_TCO_EN (1 << 13) +#define ICH9_PMIO_SMI_STS 0x34 +#define ICH9_PMIO_TCO_RLD 0x60 +#define ICH9_PMIO_TCO_LEN 32 + #endif /* HW_ACPI_ICH9_H */ diff --git a/include/hw/southbridge/ich9.h b/include/hw/southbridge/ich9.h index fd01649d04..1ac4238f7e 100644 --- a/include/hw/southbridge/ich9.h +++ b/include/hw/southbridge/ich9.h @@ -183,24 +183,6 @@ struct ICH9LPCState { /* D31:F0 power management I/O registers offset from the address ICH9_LPC_PMBASE */ -/* ICH9 LPC PM I/O registers are 128 ports and 128-aligned */ -#define ICH9_PMIO_SIZE 128 -#define ICH9_PMIO_MASK (ICH9_PMIO_SIZE - 1) - -#define ICH9_PMIO_PM1_STS 0x00 -#define ICH9_PMIO_PM1_EN 0x02 -#define ICH9_PMIO_PM1_CNT 0x04 -#define ICH9_PMIO_PM1_TMR 0x08 -#define ICH9_PMIO_GPE0_STS 0x20 -#define ICH9_PMIO_GPE0_EN 0x28 -#define ICH9_PMIO_GPE0_LEN 16 -#define ICH9_PMIO_SMI_EN 0x30 -#define ICH9_PMIO_SMI_EN_APMC_EN (1 << 5) -#define ICH9_PMIO_SMI_EN_TCO_EN (1 << 13) -#define ICH9_PMIO_SMI_STS 0x34 -#define ICH9_PMIO_TCO_RLD 0x60 -#define ICH9_PMIO_TCO_LEN 32 - /* FADT ACPI_ENABLE/ACPI_DISABLE */ #define ICH9_APM_ACPI_ENABLE 0x2 #define ICH9_APM_ACPI_DISABLE 0x3 diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 6205de6046..4c75d1b56b 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -49,6 +49,10 @@ do { printf("%s "fmt, __func__, ## __VA_ARGS__); } while (0) #define ICH9_DEBUG(fmt, ...) do { } while (0) #endif +/* ICH9 LPC PM I/O registers are 128 ports and 128-aligned */ +#define ICH9_PMIO_SIZE 128 +#define ICH9_PMIO_MASK (ICH9_PMIO_SIZE - 1) + static void ich9_pm_update_sci_fn(ACPIREGS *regs) { ICH9LPCPMRegs *pm = container_of(regs, ICH9LPCPMRegs, acpi_regs);