From 57eb454392efe28156124efc825f6fcf6445c13c Mon Sep 17 00:00:00 2001 From: Christophe Leroy Date: Tue, 2 Apr 2024 19:22:24 +0200 Subject: [PATCH] board: cssi: add support for reading temperature All CSSI boards have an LM74 chip as temperature sensor. Enable it. Signed-off-by: Christophe Leroy --- arch/powerpc/dts/cmpc885.dts | 12 +++++++++++- arch/powerpc/dts/cmpcpro.dts | 12 +++++++++++- arch/powerpc/dts/mcr3000.dts | 6 ++++++ configs/CMPC885_defconfig | 3 +++ configs/CMPCPRO_defconfig | 3 +++ configs/MCR3000_defconfig | 3 +++ 6 files changed, 37 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/dts/cmpc885.dts b/arch/powerpc/dts/cmpc885.dts index 9a33e7e77c..454ceb91ca 100644 --- a/arch/powerpc/dts/cmpc885.dts +++ b/arch/powerpc/dts/cmpc885.dts @@ -85,12 +85,22 @@ #address-cells = <1>; #size-cells = <0>; compatible = "fsl,mpc8xx-spi"; - gpios = <&CPM1_PIO_B 21 1>; /* /EEPROM_CS ACTIVE_LOW */ + gpios = <&CPM1_PIO_B 21 1 /* /EEPROM_CS ACTIVE_LOW */ + &CPM1_PIO_B 23 1 /* Temperature mother board */ + &CPM1_PIO_B 14 1>; /* Temperature CPU board */ eeprom@0 { reg = <0>; compatible = "atmel,at25", "cs,eeprom"; }; + temp@1 { + reg = <1>; + compatible = "ti,lm74"; + }; + temp@2 { + reg = <2>; + compatible = "ti,lm74"; + }; }; }; }; diff --git a/arch/powerpc/dts/cmpcpro.dts b/arch/powerpc/dts/cmpcpro.dts index 78f8a9f4d3..1dfa864ebb 100644 --- a/arch/powerpc/dts/cmpcpro.dts +++ b/arch/powerpc/dts/cmpcpro.dts @@ -140,12 +140,22 @@ compatible = "fsl,mpc832x-spi"; reg = <0x4c0 0x40>; mode = "cpu"; - gpios = <&qe_pio_d 3 1>; + gpios = <&qe_pio_d 3 1 + &qe_pio_c 5 1 /* TEMP mother board */ + &qe_pio_c 3 1>; /* TEMP CPU board */ clock-frequency = <0>; eeprom@0 { reg = <0>; compatible = "atmel,at25", "cs,eeprom"; }; + temp@1 { + reg = <1>; + compatible = "ti,lm74"; + }; + temp@2 { + reg = <2>; + compatible = "ti,lm74"; + }; }; eth0: ucc@3000 { device_type = "network"; diff --git a/arch/powerpc/dts/mcr3000.dts b/arch/powerpc/dts/mcr3000.dts index edcd8358d0..f678951e22 100644 --- a/arch/powerpc/dts/mcr3000.dts +++ b/arch/powerpc/dts/mcr3000.dts @@ -33,6 +33,12 @@ #size-cells = <0>; cell-index = <0>; compatible = "fsl,mpc8xx-spi"; + gpios = <&csspi 2 0>; + + temp@0 { + reg = <0>; + compatible = "ti,lm74"; + }; }; }; diff --git a/configs/CMPC885_defconfig b/configs/CMPC885_defconfig index bbe8d5be7e..11c24f72a8 100644 --- a/configs/CMPC885_defconfig +++ b/configs/CMPC885_defconfig @@ -50,6 +50,7 @@ CONFIG_CMD_ASKENV=y # CONFIG_CMD_LOADS is not set CONFIG_CMD_MTD=y CONFIG_CMD_NAND=y +CONFIG_CMD_TEMPERATURE=y CONFIG_CMD_DHCP=y CONFIG_CMD_MII=y CONFIG_MII_INIT=y @@ -107,6 +108,8 @@ CONFIG_DM_SERIAL=y CONFIG_SPI=y CONFIG_DM_SPI=y CONFIG_MPC8XX_SPI=y +CONFIG_DM_THERMAL=y +CONFIG_TI_LM74_THERMAL=y CONFIG_WDT=y CONFIG_WDT_MPC8xxx_BME=y # CONFIG_REGEX is not set diff --git a/configs/CMPCPRO_defconfig b/configs/CMPCPRO_defconfig index cefed63f24..f8f5c9fd86 100644 --- a/configs/CMPCPRO_defconfig +++ b/configs/CMPCPRO_defconfig @@ -134,6 +134,7 @@ CONFIG_CMD_ASKENV=y # CONFIG_CMD_LOADS is not set CONFIG_CMD_MTD=y CONFIG_CMD_NAND=y +CONFIG_CMD_TEMPERATURE=y CONFIG_CMD_DHCP=y CONFIG_BOOTP_BOOTFILESIZE=y CONFIG_CMD_MII=y @@ -197,6 +198,8 @@ CONFIG_DM_SPI=y CONFIG_MPC8XXX_SPI=y CONFIG_SYSRESET=y CONFIG_SYSRESET_MPC83XX=y +CONFIG_DM_THERMAL=y +CONFIG_TI_LM74_THERMAL=y CONFIG_WDT=y CONFIG_WDT_MPC8xxx=y # CONFIG_REGEX is not set diff --git a/configs/MCR3000_defconfig b/configs/MCR3000_defconfig index ce34c2aa88..f2eac2c544 100644 --- a/configs/MCR3000_defconfig +++ b/configs/MCR3000_defconfig @@ -47,6 +47,7 @@ CONFIG_CMD_ASKENV=y # CONFIG_CMD_LOADS is not set CONFIG_CMD_MTD=y CONFIG_CMD_NAND=y +CONFIG_CMD_TEMPERATURE=y # CONFIG_CMD_ECHO is not set # CONFIG_CMD_ITEST is not set # CONFIG_CMD_SOURCE is not set @@ -107,6 +108,8 @@ CONFIG_DM_SERIAL=y CONFIG_SPI=y CONFIG_DM_SPI=y CONFIG_MPC8XX_SPI=y +CONFIG_DM_THERMAL=y +CONFIG_TI_LM74_THERMAL=y CONFIG_WDT=y CONFIG_WDT_MPC8xxx_BME=y CONFIG_LZMA=y -- 2.39.5