From patchwork Mon Jul 12 22:04:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Winiarska, Iwona" X-Patchwork-Id: 12372427 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=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 5FBC0C07E99 for ; Mon, 12 Jul 2021 22:09:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 20C8D61242 for ; Mon, 12 Jul 2021 22:09:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20C8D61242 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Zy17+xLQV7L29uByTVhXSxdSW1/QhWg0FM3oUaR0tHU=; b=yp7skSpvW3/oXS z6p0z0+WZbCgf4h/yF1O+bVtB/dzClB3J8xAH5Ww3RRLraIj2XZHf0LDkDzwpixIqCg8W9QfLLQoU Zpu2gPSrvpsmUFl9uV2t7nwmX5uKz9JP5JyzOGlfxwuGWH9yesK2VDAcV3XM/icNB93cv4nBV6nC5 DUww9XVnuCthUILiLU4U7oMchQKbN1tH0j9+cK9bGBwTzhW/lq5mJ6gkdkLnan1UrCk4abPmbzxTR YOrQldjASvoeviPrab7q/wQ7OzWay9CKVFVb4eiTB2z7ZSj3akb0ZpY7pXaUITeXMHdXCZcMbEsDT uEqqAgdtM3yZZcxclwvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m345D-008Y6Q-3y; Mon, 12 Jul 2021 22:07:23 +0000 Received: from mga14.intel.com ([192.55.52.115]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3458-008Y4r-R0 for linux-arm-kernel@lists.infradead.org; Mon, 12 Jul 2021 22:07:20 +0000 X-IronPort-AV: E=McAfee;i="6200,9189,10043"; a="209877239" X-IronPort-AV: E=Sophos;i="5.84,235,1620716400"; d="scan'208";a="209877239" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2021 15:07:15 -0700 X-IronPort-AV: E=Sophos;i="5.84,235,1620716400"; d="scan'208";a="492295335" Received: from jzloch-mobl1.ger.corp.intel.com (HELO localhost) ([10.249.136.11]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2021 15:07:10 -0700 From: Iwona Winiarska To: linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org Cc: x86@kernel.org, devicetree@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org, Greg Kroah-Hartman , Rob Herring , Joel Stanley , Andrew Jeffery , Jean Delvare , Guenter Roeck , Jonathan Corbet , Thomas Gleixner , Andy Lutomirski , Ingo Molnar , Borislav Petkov , Yazen Ghannam , Mauro Carvalho Chehab , Pierre-Louis Bossart , Tony Luck , Andy Shevchenko , Jae Hyun Yoo , Iwona Winiarska Subject: [PATCH 00/14] Introduce PECI subsystem Date: Tue, 13 Jul 2021 00:04:33 +0200 Message-Id: <20210712220447.957418-1-iwona.winiarska@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210712_150718_935312_93D137A4 X-CRM114-Status: GOOD ( 21.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Note: All changes to arch/x86 are contained within patches 01-02. The Platform Environment Control Interface (PECI) is a communication interface between Intel processors and management controllers (e.g. Baseboard Management Controller, BMC). This series adds a PECI subsystem and introduces drivers which run in the Linux instance on the management controller (not the main Intel processor) and is intended to be used by the OpenBMC [1], a Linux distribution for BMC devices. The information exposed over PECI (like processor and DIMM temperature) refers to the Intel processor and can be consumed by daemons running on the BMC to, for example, display the processor temperature in its web interface. The PECI bus is collection of code that provides interface support between PECI devices (that actually represent processors) and PECI controllers (such as the "peci-aspeed" controller) that allow to access physical PECI interface. PECI devices are bound to PECI drivers that provides access to PECI services. This series introduces a generic "peci-cpu" driver that exposes hardware monitoring "cputemp" and "dimmtemp" using the auxiliary bus. Exposing "raw" PECI to userspace, either to write userspace drivers or for debug/testing purpose was left out of this series to encourage writing kernel drivers instead, but may be pursued in the future. Introducing PECI to upstream Linux was already attempted before [2]. Since it's been over a year since last revision, and the series changed quite a bit in the meantime, I've decided to start from v1. I would also like to give credit to everyone who helped me with different aspects of preliminary review: - Pierre-Louis Bossart, - Tony Luck, - Andy Shevchenko, - Dave Hansen. [1] https://github.com/openbmc/openbmc [2] https://lore.kernel.org/openbmc/20191211194624.2872-1-jae.hyun.yoo@linux.intel.com/ Iwona Winiarska (12): x86/cpu: Move intel-family to arch-independent headers x86/cpu: Extract cpuid helpers to arch-independent dt-bindings: Add generic bindings for PECI dt-bindings: Add bindings for peci-aspeed ARM: dts: aspeed: Add PECI controller nodes peci: Add core infrastructure peci: Add device detection peci: Add support for PECI device drivers peci: Add peci-cpu driver hwmon: peci: Add cputemp driver hwmon: peci: Add dimmtemp driver docs: Add PECI documentation Jae Hyun Yoo (2): peci: Add peci-aspeed controller driver docs: hwmon: Document PECI drivers .../devicetree/bindings/peci/peci-aspeed.yaml | 111 ++++ .../bindings/peci/peci-controller.yaml | 28 + Documentation/hwmon/index.rst | 2 + Documentation/hwmon/peci-cputemp.rst | 93 ++++ Documentation/hwmon/peci-dimmtemp.rst | 58 ++ Documentation/index.rst | 1 + Documentation/peci/index.rst | 16 + Documentation/peci/peci.rst | 48 ++ MAINTAINERS | 32 ++ arch/arm/boot/dts/aspeed-g4.dtsi | 14 + arch/arm/boot/dts/aspeed-g5.dtsi | 14 + arch/arm/boot/dts/aspeed-g6.dtsi | 14 + arch/x86/Kconfig | 1 + arch/x86/include/asm/cpu.h | 3 - arch/x86/include/asm/intel-family.h | 141 +---- arch/x86/include/asm/microcode.h | 2 +- arch/x86/kvm/cpuid.h | 3 +- arch/x86/lib/Makefile | 2 +- drivers/Kconfig | 3 + drivers/Makefile | 1 + drivers/edac/mce_amd.c | 3 +- drivers/hwmon/Kconfig | 2 + drivers/hwmon/Makefile | 1 + drivers/hwmon/peci/Kconfig | 31 ++ drivers/hwmon/peci/Makefile | 7 + drivers/hwmon/peci/common.h | 46 ++ drivers/hwmon/peci/cputemp.c | 503 +++++++++++++++++ drivers/hwmon/peci/dimmtemp.c | 508 ++++++++++++++++++ drivers/peci/Kconfig | 36 ++ drivers/peci/Makefile | 10 + drivers/peci/controller/Kconfig | 12 + drivers/peci/controller/Makefile | 3 + drivers/peci/controller/peci-aspeed.c | 501 +++++++++++++++++ drivers/peci/core.c | 224 ++++++++ drivers/peci/cpu.c | 347 ++++++++++++ drivers/peci/device.c | 211 ++++++++ drivers/peci/internal.h | 137 +++++ drivers/peci/request.c | 502 +++++++++++++++++ drivers/peci/sysfs.c | 82 +++ include/linux/peci-cpu.h | 38 ++ include/linux/peci.h | 93 ++++ include/linux/x86/cpu.h | 9 + include/linux/x86/intel-family.h | 146 +++++ lib/Kconfig | 5 + lib/Makefile | 2 + lib/x86/Makefile | 3 + {arch/x86/lib => lib/x86}/cpu.c | 2 +- 47 files changed, 3902 insertions(+), 149 deletions(-) create mode 100644 Documentation/devicetree/bindings/peci/peci-aspeed.yaml create mode 100644 Documentation/devicetree/bindings/peci/peci-controller.yaml create mode 100644 Documentation/hwmon/peci-cputemp.rst create mode 100644 Documentation/hwmon/peci-dimmtemp.rst create mode 100644 Documentation/peci/index.rst create mode 100644 Documentation/peci/peci.rst create mode 100644 drivers/hwmon/peci/Kconfig create mode 100644 drivers/hwmon/peci/Makefile create mode 100644 drivers/hwmon/peci/common.h create mode 100644 drivers/hwmon/peci/cputemp.c create mode 100644 drivers/hwmon/peci/dimmtemp.c create mode 100644 drivers/peci/Kconfig create mode 100644 drivers/peci/Makefile create mode 100644 drivers/peci/controller/Kconfig create mode 100644 drivers/peci/controller/Makefile create mode 100644 drivers/peci/controller/peci-aspeed.c create mode 100644 drivers/peci/core.c create mode 100644 drivers/peci/cpu.c create mode 100644 drivers/peci/device.c create mode 100644 drivers/peci/internal.h create mode 100644 drivers/peci/request.c create mode 100644 drivers/peci/sysfs.c create mode 100644 include/linux/peci-cpu.h create mode 100644 include/linux/peci.h create mode 100644 include/linux/x86/cpu.h create mode 100644 include/linux/x86/intel-family.h create mode 100644 lib/x86/Makefile rename {arch/x86/lib => lib/x86}/cpu.c (95%)