[Skiboot] [PATCH 02/11] dts: add support to read the core temperatures

Stewart Smith stewart at linux.vnet.ibm.com
Fri Feb 13 15:22:17 AEDT 2015


C├ędric Le Goater <clg at fr.ibm.com> writes:
> @@ -338,8 +340,11 @@ void astbmc_early_init(void)
>  	uart_init(true);
>  }
>
> -int64_t __attrconst astbmc_sensor_read(uint32_t sensor_hndl __unused,
> -	int token __unused, uint32_t *sensor_data __unused)
> +int64_t astbmc_sensor_read(uint32_t sensor_hndl, int token __unused,
> +			uint32_t *sensor_data)
>  {
> +	if (sensor_is_dts(sensor_hndl))
> +		return dts_sensor_read(sensor_hndl, sensor_data);
> +
>  	return OPAL_UNSUPPORTED;
>  }
> diff --git a/platforms/ibm-fsp/common.c b/platforms/ibm-fsp/common.c
> index 695d8e47db7c..732759b33286 100644
> --- a/platforms/ibm-fsp/common.c
> +++ b/platforms/ibm-fsp/common.c
> @@ -206,5 +208,8 @@ int64_t ibm_fsp_cec_power_down(uint64_t request)
>  int64_t ibm_fsp_sensor_read(uint32_t sensor_hndl, int token,
>  				uint32_t *sensor_data)
>  {
> +	if (sensor_is_dts(sensor_hndl))
> +		return dts_sensor_read(sensor_hndl, sensor_data);
> +
>  	return fsp_opal_read_sensor(sensor_hndl, token, sensor_data);
>  }

I'd prefer if we didn't end up having identical code in platform hooks.



More information about the Skiboot mailing list