ARM: dts: aspeed: yosemite4: Add i2c-mux/eeprom config in devicetree
v2 cover ARM: dts: aspeed: yosemite4: Add i2c-mux/eeprom config in devicetree
Add i2c-mux and eeprom devices for Meta Yosemite 4
Changelog:
v2 - Add devicetree config for ina233 and max31790
- Add binding documents for ina233 and max31790
v1 - Add gpio and eeprom devices
- Add spi-gpio config for tpmdev
- Remove temperature-sensor 11-004a and 11-004b
- Change power-sensor ina230 to ina233
- Revise adc128d818 config for adc mode
- Add vendor prefix for max31790 and remove redundant config
Delphine CC Chiu (2):
ARM: dts: aspeed: yosemite4: Add i2c-mux/eeprom devices
dt-bindings: hwmon: add MAX31790 and INA233 binding documents
.../devicetree/bindings/hwmon/ina233.txt | 27 + .../devicetree/bindings/hwmon/max31790.txt | 25 + MAINTAINERS | 12 + .../dts/aspeed-bmc-facebook-yosemite4.dts | 560 ++++++++++++++++-- 4 files changed, 586 insertions(+), 38 deletions(-) create mode 100644 Documentation/devicetree/bindings/hwmon/ina233.txt create mode 100644 Documentation/devicetree/bindings/hwmon/max31790.txt
Signature · 1 line
2.25.1
PATCH v2 1/2 ARM: dts: aspeed: yosemite4: Add i2c-mux/eeprom/pmbus devices and fan controller config
Revise Yosemite 4 devicetree for i2c-mux and eeprom, also add pmbus snesors config.
---
Changelog:
v2 - Add devicetree config for ina233 and max31790
v1 - Add imux configs for i2c-mux
- Add gpio and eeprom devices
- Add spi-gpio config for tpmdev
- Remove temperature-sensor 11-004a and 11-004b
- Change power-sensor ina230 to ina233
- Revise adc128d818 config for adc mode
- Add vendor prefix for max31790 and remove redundant config
--- .../dts/aspeed-bmc-facebook-yosemite4.dts | 560 ++++++++++++++++-- 1 file changed, 522 insertions(+), 38 deletions(-)
arch/arm/boot/dts/aspeed-bmc-facebook-yosemite4.dts +522 -38
@@ -17,6 +17,25 @@ aliases { serial6 = &uart7; serial7 = &uart8; serial8 = &uart9; + + i2c16 = &imux16; + i2c17 = &imux17; + i2c18 = &imux18; + i2c19 = &imux19; + i2c20 = &imux20; + i2c21 = &imux21; + i2c22 = &imux22; + i2c23 = &imux23; + i2c24 = &imux24; + i2c25 = &imux25; + i2c26 = &imux26; + i2c27 = &imux27; + i2c28 = &imux28; + i2c29 = &imux29; + i2c30 = &imux30; + i2c31 = &imux31; + i2c32 = &imux32; + i2c33 = &imux33; }; chosen {
@@ -34,6 +53,25 @@ iio-hwmon { <&adc0 4>, <&adc0 5>, <&adc0 6>, <&adc0 7>, <&adc1 0>, <&adc1 1>; }; + + spi_gpio: spi-gpio { + status = "okay"; + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + gpio-sck = <&gpio0 ASPEED_GPIO(X, 3) GPIO_ACTIVE_HIGH>; + gpio-mosi = <&gpio0 ASPEED_GPIO(X, 4) GPIO_ACTIVE_HIGH>; + gpio-miso = <&gpio0 ASPEED_GPIO(X, 5) GPIO_ACTIVE_HIGH>; + num-chipselects = <1>; + cs-gpios = <&gpio0 ASPEED_GPIO(X, 0) GPIO_ACTIVE_LOW>; + + tpmdev@0 { + compatible = "tcg,tpm_tis-spi"; + spi-max-frequency = <33000000>; + reg = <0>; + }; + }; }; &uart1 {
@@ -262,6 +300,186 @@ i2c-mux@70 { idle-state = <0>; i2c-mux-idle-disconnect; reg = <0x70>; + + imux16: i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + gpio@20 { + compatible = "nxp,pca9506"; + reg = <0x20>; + }; + + gpio@21 { + compatible = "nxp,pca9506"; + reg = <0x21>; + }; + + gpio@22 { + compatible = "nxp,pca9506"; + reg = <0x22>; + }; + + gpio@23 { + compatible = "nxp,pca9506"; + reg = <0x23>; + }; + + gpio@49 { + compatible = "nxp,pca9537"; + reg = <0x49>; + }; + + eeprom@50 { + compatible = "atmel,24c128"; + reg = <0x50>; + }; + + eeprom@51 { + compatible = "atmel,24c128"; + reg = <0x51>; + }; + + eeprom@54 { + compatible = "atmel,24c128"; + reg = <0x54>; + }; + }; + + imux17: i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + gpio@20 { + compatible = "nxp,pca9506"; + reg = <0x20>; + }; + + gpio@21 { + compatible = "nxp,pca9506"; + reg = <0x21>; + }; + + gpio@22 { + compatible = "nxp,pca9506"; + reg = <0x22>; + }; + + gpio@23 { + compatible = "nxp,pca9506"; + reg = <0x23>; + }; + + gpio@49 { + compatible = "nxp,pca9537"; + reg = <0x49>; + }; + + eeprom@50 { + compatible = "atmel,24c128"; + reg = <0x50>; + }; + + eeprom@51 { + compatible = "atmel,24c128"; + reg = <0x51>; + }; + + eeprom@54 { + compatible = "atmel,24c128"; + reg = <0x54>; + }; + }; + + imux18: i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + gpio@20 { + compatible = "nxp,pca9506"; + reg = <0x20>; + }; + + gpio@21 { + compatible = "nxp,pca9506"; + reg = <0x21>; + }; + + gpio@22 { + compatible = "nxp,pca9506"; + reg = <0x22>; + }; + + gpio@23 { + compatible = "nxp,pca9506"; + reg = <0x23>; + }; + + gpio@49 { + compatible = "nxp,pca9537"; + reg = <0x49>; + }; + + eeprom@50 { + compatible = "atmel,24c128"; + reg = <0x50>; + }; + + eeprom@51 { + compatible = "atmel,24c128"; + reg = <0x51>; + }; + + eeprom@54 { + compatible = "atmel,24c128"; + reg = <0x54>; + }; + }; + + imux19: i2c@3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + gpio@20 { + compatible = "nxp,pca9506"; + reg = <0x20>; + }; + + gpio@21 { + compatible = "nxp,pca9506"; + reg = <0x21>; + }; + + gpio@22 { + compatible = "nxp,pca9506"; + reg = <0x22>; + }; + + gpio@23 { + compatible = "nxp,pca9506"; + reg = <0x23>; + }; + + gpio@49 { + compatible = "nxp,pca9537"; + reg = <0x49>; + }; + + eeprom@50 { + compatible = "atmel,24c128"; + reg = <0x50>; + }; + + eeprom@51 { + compatible = "atmel,24c128"; + reg = <0x51>; + }; + + eeprom@54 { + compatible = "atmel,24c128"; + reg = <0x54>; + }; + }; }; };
@@ -273,12 +491,234 @@ i2c-mux@71 { idle-state = <0>; i2c-mux-idle-disconnect; reg = <0x71>; + + imux20: i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + gpio@20 { + compatible = "nxp,pca9506"; + reg = <0x20>; + }; + + gpio@21 { + compatible = "nxp,pca9506"; + reg = <0x21>; + }; + + gpio@22 { + compatible = "nxp,pca9506"; + reg = <0x22>; + }; + + gpio@23 { + compatible = "nxp,pca9506"; + reg = <0x23>; + }; + + gpio@49 { + compatible = "nxp,pca9537"; + reg = <0x49>; + }; + + eeprom@50 { + compatible = "atmel,24c128"; + reg = <0x50>; + }; + + eeprom@51 { + compatible = "atmel,24c128"; + reg = <0x51>; + }; + + eeprom@54 { + compatible = "atmel,24c128"; + reg = <0x54>; + }; + }; + + imux21: i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + gpio@20 { + compatible = "nxp,pca9506"; + reg = <0x20>; + }; + + gpio@21 { + compatible = "nxp,pca9506"; + reg = <0x21>; + }; + + gpio@22 { + compatible = "nxp,pca9506"; + reg = <0x22>; + }; + + gpio@23 { + compatible = "nxp,pca9506"; + reg = <0x23>; + }; + + gpio@49 { + compatible = "nxp,pca9537"; + reg = <0x49>; + }; + + eeprom@50 { + compatible = "atmel,24c128"; + reg = <0x50>; + }; + + eeprom@51 { + compatible = "atmel,24c128"; + reg = <0x51>; + }; + + eeprom@54 { + compatible = "atmel,24c128"; + reg = <0x54>; + }; + }; + + imux22: i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + gpio@20 { + compatible = "nxp,pca9506"; + reg = <0x20>; + }; + + gpio@21 { + compatible = "nxp,pca9506"; + reg = <0x21>; + }; + + gpio@22 { + compatible = "nxp,pca9506"; + reg = <0x22>; + }; + + gpio@23 { + compatible = "nxp,pca9506"; + reg = <0x23>; + }; + + gpio@49 { + compatible = "nxp,pca9537"; + reg = <0x49>; + }; + + eeprom@50 { + compatible = "atmel,24c128"; + reg = <0x50>; + }; + + eeprom@51 { + compatible = "atmel,24c128"; + reg = <0x51>; + }; + + eeprom@54 { + compatible = "atmel,24c128"; + reg = <0x54>; + }; + }; + + imux23: i2c@3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + gpio@20 { + compatible = "nxp,pca9506"; + reg = <0x20>; + }; + + gpio@21 { + compatible = "nxp,pca9506"; + reg = <0x21>; + }; + + gpio@22 { + compatible = "nxp,pca9506"; + reg = <0x22>; + }; + + gpio@23 { + compatible = "nxp,pca9506"; + reg = <0x23>; + }; + + gpio@49 { + compatible = "nxp,pca9537"; + reg = <0x49>; + }; + + eeprom@50 { + compatible = "atmel,24c128"; + reg = <0x50>; + }; + + eeprom@51 { + compatible = "atmel,24c128"; + reg = <0x51>; + }; + + eeprom@54 { + compatible = "atmel,24c128"; + reg = <0x54>; + }; + }; }; }; &i2c10 { status = "okay"; bus-frequency = <400000>; + i2c-mux@74 { + compatible = "nxp,pca9544"; + idle-state = <0>; + i2c-mux-idle-disconnect; + reg = <0x74>; + + imux28: i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux29: i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + gpio@20 { + compatible = "nxp,pca9506"; + reg = <0x20>; + }; + + gpio@21 { + compatible = "nxp,pca9506"; + reg = <0x21>; + }; + + gpio@22 { + compatible = "nxp,pca9506"; + reg = <0x22>; + }; + + gpio@23 { + compatible = "nxp,pca9506"; + reg = <0x23>; + }; + + gpio@24 { + compatible = "nxp,pca9506"; + reg = <0x24>; + }; + }; + }; }; &i2c11 {
@@ -331,16 +771,6 @@ temperature-sensor@49 { reg = <0x49>; }; - temperature-sensor@4a { - compatible = "ti,tmp75"; - reg = <0x4a>; - }; - - temperature-sensor@4b { - compatible = "ti,tmp75"; - reg = <0x4b>; - }; - eeprom@54 { compatible = "atmel,24c256"; reg = <0x54>;
@@ -361,6 +791,11 @@ eeprom@50 { reg = <0x50>; }; + eeprom@54 { + compatible = "atmel,24c64"; + reg = <0x54>; + }; + rtc@6f { compatible = "nuvoton,nct3018y"; reg = <0x6f>;
@@ -370,6 +805,25 @@ rtc@6f { &i2c13 { status = "okay"; bus-frequency = <400000>; + gpio@20 { + compatible = "nxp,pca9506"; + reg = <0x20>; + }; + + gpio@21 { + compatible = "nxp,pca9506"; + reg = <0x21>; + }; + + gpio@22 { + compatible = "nxp,pca9506"; + reg = <0x22>; + }; + + gpio@23 { + compatible = "nxp,pca9506"; + reg = <0x23>; + }; }; &i2c14 {
@@ -378,44 +832,54 @@ &i2c14 { adc@1d { compatible = "ti,adc128d818"; reg = <0x1d>; - ti,mode = /bits/ 8 <2>; + ti,mode = /bits/ 8 <1>; }; adc@35 { compatible = "ti,adc128d818"; reg = <0x35>; - ti,mode = /bits/ 8 <2>; + ti,mode = /bits/ 8 <1>; }; adc@37 { compatible = "ti,adc128d818"; reg = <0x37>; - ti,mode = /bits/ 8 <2>; + ti,mode = /bits/ 8 <1>; }; power-sensor@40 { - compatible = "ti,ina230"; + compatible = "ti,ina233"; reg = <0x40>; + resistor-calibration = /bits/ 16 <0x0a00>; + current-lsb= /bits/ 16 <0x0001>; }; power-sensor@41 { - compatible = "ti,ina230"; + compatible = "ti,ina233"; reg = <0x41>; + resistor-calibration = /bits/ 16 <0x0a00>; + current-lsb= /bits/ 16 <0x0001>; }; power-sensor@42 { - compatible = "ti,ina230"; + compatible = "ti,ina233"; reg = <0x42>; + resistor-calibration = /bits/ 16 <0x0a00>; + current-lsb= /bits/ 16 <0x0001>; }; power-sensor@43 { - compatible = "ti,ina230"; + compatible = "ti,ina233"; reg = <0x43>; + resistor-calibration = /bits/ 16 <0x0a00>; + current-lsb= /bits/ 16 <0x0001>; }; power-sensor@44 { - compatible = "ti,ina230"; + compatible = "ti,ina233"; reg = <0x44>; + resistor-calibration = /bits/ 16 <0x0a00>; + current-lsb= /bits/ 16 <0x0001>; }; temperature-sensor@4e {
@@ -442,7 +906,7 @@ i2c-mux@71 { i2c-mux-idle-disconnect; reg = <0x71>; - i2c@0 { + imux30: i2c@0 { #address-cells = <1>; #size-cells = <0>; reg = <0>;
@@ -450,14 +914,13 @@ i2c@0 { adc@1f { compatible = "ti,adc128d818"; reg = <0x1f>; - ti,mode = /bits/ 8 <2>; + ti,mode = /bits/ 8 <1>; }; pwm@20{ - compatible = "max31790"; + compatible = "maxim,max31790"; + pwm-as-tach = /bits/ 8 <4 5>; reg = <0x20>; - #address-cells = <1>; - #size-cells = <0>; }; gpio@22{
@@ -466,10 +929,9 @@ gpio@22{ }; pwm@23{ - compatible = "max31790"; + compatible = "maxim,max31790"; + pwm-as-tach = /bits/ 8 <4 5>; reg = <0x23>; - #address-cells = <1>; - #size-cells = <0>; }; adc@33 {
@@ -492,22 +954,21 @@ gpio@61 { }; }; - i2c@1 { + imux31: i2c@1 { #address-cells = <1>; #size-cells = <0>; - reg = <0>; + reg = <1>; adc@1f { compatible = "ti,adc128d818"; reg = <0x1f>; - ti,mode = /bits/ 8 <2>; + ti,mode = /bits/ 8 <1>; }; pwm@20{ - compatible = "max31790"; + compatible = "maxim,max31790"; + pwm-as-tach = /bits/ 8 <4 5>; reg = <0x20>; - #address-cells = <1>; - #size-cells = <0>; }; gpio@22{
@@ -516,10 +977,9 @@ gpio@22{ }; pwm@23{ - compatible = "max31790"; + compatible = "maxim,max31790"; + pwm-as-tach = /bits/ 8 <4 5>; reg = <0x23>; - #address-cells = <1>; - #size-cells = <0>; }; adc@33 {
@@ -552,7 +1012,7 @@ i2c-mux@73 { i2c-mux-idle-disconnect; reg = <0x73>; - i2c@0 { + imux32: i2c@0 { #address-cells = <1>; #size-cells = <0>; reg = <0>;
@@ -563,10 +1023,10 @@ adc@35 { }; }; - i2c@1 { + imux33: i2c@1 { #address-cells = <1>; #size-cells = <0>; - reg = <0>; + reg = <1>; adc@35 { compatible = "maxim,max11617";
@@ -592,6 +1052,30 @@ i2c-mux@72 { idle-state = <0>; i2c-mux-idle-disconnect; reg = <0x72>; + + imux24: i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux25: i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux26: i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux27: i2c@3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; }; };
Signature · 1 line
2.25.1
PATCH v2 2/2 dt-bindings: hwmon: add MAX31790 and INA233 binding documents
In reply to Delphine CC ChiuAdd MAX31790 and INA233 binding documents for Yosemite V4 config. The drivers' code change will be soonly contributed.
Changelog:
v2 - Add binding documents for ina233 and max31790
--- .../devicetree/bindings/hwmon/ina233.txt | 27 +++++++++++++++++++ .../devicetree/bindings/hwmon/max31790.txt | 25 +++++++++++++++++ MAINTAINERS | 12 +++++++++ 3 files changed, 64 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/ina233.txt create mode 100644 Documentation/devicetree/bindings/hwmon/max31790.txt
Documentation/devicetree/bindings/hwmon/ina233.txt new file +27 -0
@@ -0,0 +1,27 @@ +Bindings for the Maxim MAX31790 Intelligent Fan Controller +========================================================== + +Reference: + +https://pdf1.alldatasheet.com/datasheet-pdf/view/930928/TI1/INA233.html + +The INA233 device is a current, voltage and power monitor with an I2C-, SMBus-,and PMBus-compatible interface +that is compliant with digital bus voltages from 1.8 V to 5.0 V. +The device monitors and reports values for current, voltage and power. +The integrated power accumulator can be used for energy or average power calculations. +Programmable calibration value, conversion times and averaging when combined with an internal multiplier +enable direct readouts of current in amperes and power in watts. + +Required properties: +- compatible : ti,ina233 +- reg : I2C address +- resistor-calibration : MFR_CALIBRATION which will be set into register 0xd4 +- current-lsb : Current_LSB for calibration +Example: + + ina233@45 { + compatible = "ti,ina233"; + reg = <0x45>; + resistor-calibration = /bits/ 16 <0x0a00>; + current-lsb= /bits/ 16 <0x0001>; + };
Documentation/devicetree/bindings/hwmon/max31790.txt new file +25 -0
@@ -0,0 +1,25 @@ +Bindings for the Maxim MAX31790 Intelligent Fan Controller +========================================================== + +Reference: + +https://datasheets.maximintegrated.com/en/ds/MAX31790.pdf + +The MAX31790 controls the speeds of up to six fans +using six independent PWM outputs. The desired fan +speeds (or PWM duty cycles) are written through the I2C +interface. The outputs drive “4-wire” fans directly, or can +be used to modulate the fan’s power terminals using an +external pass transistor + +Required properties: +- compatible : maxim,max31790 +- reg : I2C address +- pwm-as-tach : config PWM outputs as tachometer inputs +Example: + + fans@52 { + compatible = "maxim,max31790"; + reg = <0x20>; + pwm-as-tach = /bits/ 8 <4 5>; + };
MAINTAINERS +12 -0
@@ -1362,6 +1362,12 @@ F: Documentation/devicetree/bindings/hwmon/adi,max31760.yaml F: Documentation/hwmon/max31760.rst F: drivers/hwmon/max31760.c +ANALOG DEVICES INC MAX31790 DRIVER +M: Delphine CC Chiu <[email protected]> +S: Odd Fixes +F: Documentation/devicetree/bindings/hwmon/max31790.txt +F: drivers/hwmon/max31790.c + ANALOGBITS PLL LIBRARIES M: Paul Walmsley <[email protected]> S: Supported
@@ -10034,6 +10040,12 @@ F: Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml F: Documentation/hwmon/ina209.rst F: drivers/hwmon/ina209.c +INA233 HARDWARE MONITOR DRIVER +M: Delphine CC Chiu <[email protected]> +S: Odd Fixes +F: Documentation/devicetree/bindings/hwmon/ina233.txt +F: drivers/hwmon/ina222.c + INA2XX HARDWARE MONITOR DRIVER M: Guenter Roeck <[email protected]> L: [email protected]
Signature · 1 line
2.25.1