summaryrefslogtreecommitdiffstats
path: root/hw/fsp/fsp-sensor.c
Commit message (Collapse)AuthorAgeFilesLines
* sensors: Support reading u64 sensor valuesShilpasri G Bhat2018-02-211-3/+4
| | | | | | | | | | | | | This patch adds support to read u64 sensor values. This also adds changes to the core and the backend implementation code to make this API as the base call. Host can use this new API to read sensors upto 64bits. This adds a list to store the pointer to the kernel u32 buffer, for older kernels making async sensor u32 reads. Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hw/fsp: Do not queue SP and SPCN class messages during reset/reloadAnanth N Mavinakayanahalli2017-03-161-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | During FSP R/R, the FSP is inaccessible and will lose state. Messages to the FSP are generally queued for sending later. It does seem like the FSP fails to process any subseuqent messages of certain classes (SP info -- ipmi) if it receives queued mbox messages it isn't expecting. In certain other cases (sensors), the FSP driver returns a default code (async completion) even though there is no known bound from the time of this error return to the actual data being available. The kernel driver keeps waiting leading to soft-lockup on the host side. Mitigate both these (known) cases by returning OPAL_BUSY so the host driver knows to retry later. With this change, the sensors command works fine when the FSP comes back. This version also resolves the remaining IPMI issues Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> Tested-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* sensor: add a family field in the handlerCédric Le Goater2016-12-081-1/+1
| | | | | | | | | | | | | | Currently, we are hijacking the last bit of the resource field of the sensor handler to differentiate the sensor families and route the opal_sensor_read() call to the appropriate component. Let's reserve the last 3bits and provide an API to set the sensor family for current use and future use. This gives us a maximum of 8 families and 32 resource classes. The FSP uses 15, so we should be fine for a while. Signed-off-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* fsp-sensor: add FWTS annotation for already existing sensor nodeStewart Smith2016-06-241-0/+7
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* fsp-sensor: rework device tree for sensorsCédric Le Goater2016-03-081-213/+280
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current code in OPAL exposing the FSP sensors in the device tree is very SPCN-centric which makes it difficult to add new sensors fitting with the ibmpowernv Linux driver. This patch proposes some improvements on the way the device tree is created. The logic behind the node creation is preserved. The DMA sensor buffer is parsed, looping on the PRS command modifiers and entries while nodes are being created under the "ibm,opal/sensors/" directory. The code now splits the creation under separate routines, one for each modifier, and use the same old pattern for names : <resource class name>#<index>-attribute/ Each resource node is compatible with : "ibm,opal-sensor-<resource classname>" There is a mapping to be done between the attributes of a same resource and the PRS command used to collect them. This adds some complexity in the code when creating the node and when building a request for the FSP. For instance, the status of a FSP sensor which can be returned by one or more PRS command modifiers. For power supply and fans, we choose the PRS modifier (and not DATA) to return the AC_FAULTED bit. For the ambient temperature, there is no other choice than to use the DATA modifier. The status bits being : PRS PARAM/DATA Modifier Modifier 0x0010 ON SUPPORTED 0x0008 ON 0x0004 AC FAULTED EM ALERT 0x0002 FAULTED FAULTED 0x0001 PRESENT PRESENT we only keep bits[1-2] to reflect the fault status to Linux. Another significant change is that the power consumption is now reported for each power supply and not as a whole like before. A Tuleta can have up to four distinct power supplies so it seems an interesting resource to report independently. Currently, we handle the "power-supply", "cooling-fan" and "amb-temp" resource classes. More exist in the specs but they have not showed up on the Tuleta I used. Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* llvm-scan-build: fix value is never read warningStewart Smith2015-11-101-6/+2
| | | | | | | | hw/fsp/fsp-sensor.c:425:3: warning: Value stored to 'sensor_buf_ptr' is never read sensor_buf_ptr = (uint32_t *)((uint8_t *)sensor_buffer + ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* llvm-scan-build: fix dead assignment warningStewart Smith2015-11-101-6/+2
| | | | | | | | hw/fsp/fsp-sensor.c:748:4: warning: Value stored to 'sensor_buf_ptr' is never read sensor_buf_ptr = (uint32_t *)((uint8_t *)sensor_buffer ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* errorlog: Deprecate elog callback parameterSamuel Mendoza-Jonas2015-07-311-3/+3
| | | | | | | | | | There are now no users of the call_out parameter and future users should use the log_append_msg() and log_append_data() functions, so remove all references to call_out. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* fsp-sensor: add a label property for the ambient sensorCédric Le Goater2015-03-241-0/+4
| | | | | Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core: add a platform op to read sensorsCédric Le Goater2015-03-241-9/+4
| | | | | | | | | | This patch introduces an initial framework to define a sensor_read operation per platform. It also proposes a few helper routines to work on the sensor 'handler' which identifies a sensor and attribute in the OPAL_SENSOR_READ call. Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Move skiboot internal things from opal.h to opal-api.hStewart Smith2015-02-061-0/+1
| | | | | | | | | | This is probably not the best collection of things in the world, but it means that opal.h is much closer to being directly usable by an OS. This triggers a bunch of #include fixes throughout the tree. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* elog: Clean up error logging headersAlistair Popple2014-12-021-1/+1
| | | | | | | | | | | | | | | Commit cf6f4e8912d29fb89ce85c84834607065ad595a5 introduced a platform independent frontend for error logging. However it failed to move the generic parts of the fsp-elog.h header into the platform independent one, instead relying on the fact that up until now fsp-elog.h was included whenever a function needed to log errors. This patch moves the platform independent defines into the frontend header file (errorlog.h) and removes the include of the platform specific header in generic code paths. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* elog: (sensor) Replace prerror with elogNeelesh Gupta2014-11-281-7/+7
| | | | | | | | Replace prerror with 'elog' interface and correct one existing SRC map from error type. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Change DBG to prlog PR_TRACE and PR_INSANE in hw/fsp/fsp-sensor.cStewart Smith2014-10-081-13/+16
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* fsp-sensor: Remove allocation of array storing RIDs on the stackNeelesh Gupta2014-07-151-10/+23
| | | | | | | | | Dynamically allocate the 'prids' buffer to store the rid values of an FRC/sensor. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* Initial commit of Open Source releaseBenjamin Herrenschmidt2014-07-021-0/+788
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
OpenPOWER on IntegriCloud