Skip to contentSkip to conversation

dt-binding: peci: add NPCM PECI documentation

PATCH New Tomer Maimon 1 participant 4 messages Apr 3, 2019

Subsystems (4)
lore
Share & tools
lore

Tomer Maimon

author maintainer
#0 lore raw

PATCH 1/4 dt-binding: peci: add NPCM PECI documentation

Added device tree binding documentation for Nuvoton BMC NPCM Platform Environment Control Interface(PECI).

---
 .../devicetree/bindings/peci/peci-npcm.txt         | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/peci/peci-npcm.txt
Documentation/devicetree/bindings/peci/peci-npcm.txt new file +38 -0
new file mode 100644
index 000000000000..ea5bead7e76a
@@ -0,0 +1,38 @@
+Nuvoton NPCM Platform Environment Control Interface (PECI) bus
+
+Required properties:
+- compatible        : "nuvoton,npcm750-peci" for the NPCM7XX BMC.
+- reg               : specifies PECI physical base address and size of the registers.
+- #address-cells    : Should be <1> required to define a client address.
+- #size-cells       : Should be <0> required to define a client address.
+- interrupts        : Contain the PECI interrupt with flags for falling edge.
+- clocks            : phandle of PECI reference clock.
+
+Optional properties:
+- cmd-timeout-ms    : Command timeout in units of ms.
+                      1 ~ 60000 (default: 1000)
+- pull-down         : Defines the PECI I/O internal pull down operation.
+		      0 - pull down always enable (default)
+		      1 - pull down only during transactions.
+		      2 - pull down always disable.
+- host-neg-bit-rate : Define host negotiation bit rate divider.
+                      the host negotiation bit rate calculate with formula:
+                      clock frequency[Hz] / [4 x {host-neg-bit-rate + 1}]
+		      7 ~ 31 (default: 15)
+- high-volt-range   : Adapts PECI I/O interface to voltage range, the property
+                      is a boolean parameter define as follow:
+		      false - PECI I/O interface voltage range of 0.8-1.06V. (default)
+		      true - PECI I/O interface voltage range of 0.95-1.26V.
+
+Example:
+	peci: peci-bus@100000 {
+		compatible = "nuvoton,npcm750-peci";
+		reg = <0x100000 0x200>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&clk NPCM7XX_CLK_APB3>;
+		cmd-timeout-ms = <1000>;
+		pull-down = <0>;
+		host-neg-bit-rate = <15>;
+	};
Signature · 1 line
2.14.1
author maintainer
#1 lore raw

PATCH 2/4 peci: npcm: add NPCM PECI driver

Add Nuvoton NPCM BMC Platform Environment
Control Interface(PECI) driver.

---
 drivers/peci/Kconfig     |  11 ++
 drivers/peci/Makefile    |   1 +
 drivers/peci/peci-npcm.c | 410 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 422 insertions(+)
 create mode 100644 drivers/peci/peci-npcm.c
drivers/peci/Kconfig +11 -0
index 9e9845ebcff4..7293108fb543 100644
@@ -34,6 +34,17 @@ config PECI_ASPEED
 	  This support is also available as a module.  If so, the module
 	  will be called peci-aspeed.
 
+config PECI_NPCM
+	tristate "Nuvoton NPCM PECI support"
+	select REGMAP_MMIO
+	depends on OF
+	depends on ARCH_NPCM || COMPILE_TEST
+	help
+	  Say Y here if you want support for the Platform Environment Control
+	  Interface (PECI) bus adapter driver on the Nuvoton NPCM SoCs.
+
+	  This support is also available as a module. If so, the module
+	  will be called peci-npcm.
 endmenu
 
 endif # PECI
drivers/peci/Makefile +1 -0
index 886285e69765..3326da54a21a 100644
@@ -7,3 +7,4 @@ obj-$(CONFIG_PECI)		+= peci-core.o
 
 # Hardware specific bus drivers
 obj-$(CONFIG_PECI_ASPEED)	+= peci-aspeed.o
+obj-$(CONFIG_PECI_NPCM)		+= peci-npcm.o
drivers/peci/peci-npcm.c new file +410 -0

410 lines not on this page · raw message

Signature · 1 line
2.14.1
author maintainer
#2 lore raw

PATCH 3/4 dts: npcm7xx: add PECI support to NPCM7xx device tree

In reply to Tomer Maimon
---
 arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi | 10 ++++++++++
 arch/arm/boot/dts/nuvoton-npcm750-evb.dts     | 12 ++++++++++++
 2 files changed, 22 insertions(+)
arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi +10 -0
index a24a06170660..04e842f460a9 100644
@@ -341,6 +341,16 @@
 				};
 			};
 
+			peci: peci-bus@100000 {
+				compatible = "nuvoton,npcm750-peci";
+				reg = <0x100000 0x200>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clk NPCM7XX_CLK_APB3>;
+				status = "disabled";
+			};
+
 			spi0: spi@200000 {
 				compatible = "nuvoton,npcm750-pspi";
 				reg = <0x200000 0x1000>;
arch/arm/boot/dts/nuvoton-npcm750-evb.dts +12 -0
index d951ac997872..7728f7b69d13 100644
@@ -492,6 +492,18 @@
 				};
 			};
 
+			peci: peci-bus@100000 {
+				cmd-timeout-ms = <1000>;
+				pull-down = <0>;
+				host-neg-bit-rate = <15>;
+				status = "okay";
+				intel-peci-dimmtemp@30 {
+					compatible = "intel,peci-client";
+					reg = <0x30>;
+					status = "okay";
+				};
+			};
+
 			spi0: spi@200000 {
 				cs-gpios = <&gpio6 11 GPIO_ACTIVE_LOW>;
 				status = "okay";
Signature · 1 line
2.14.1
author maintainer
#3 lore raw

PATCH 4/4 config: npcm7xx: add PECI support to npcm7xx defconfig

In reply to Tomer Maimon
---
 arch/arm/configs/npcm7xx_defconfig | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/configs/npcm7xx_defconfig +5 -0
index afddb4e88300..62aaffdba4dd 100644
@@ -120,3 +120,8 @@ CONFIG_CRYPTO_LZO=y
 CONFIG_CRYPTO_USER_API_SKCIPHER=y
 CONFIG_CRYPTO_DEV_NPCMX50=y
 CONFIG_ARM_CRYPTO=y
+CONFIG_PECI=y
+CONFIG_PECI_NPCM=y
+CONFIG_MFD_INTEL_PECI_CLIENT=y
+CONFIG_SENSORS_PECI_CPUTEMP=y
+CONFIG_SENSORS_PECI_DIMMTEMP=y
Signature · 1 line
2.14.1