@@ -89,7 +89,8 @@ void p8_sbe_update_timer_expiry(uint64_t new_target)
do {
/* Grab generation and spin if odd */
for (;;) {
- rc = _xscom_read(sbe_timer_chip, 0xE0006, &gen, false);
+ rc = _xscom_read(sbe_timer_chip, 0xE0006, &gen, false,
+ true);
if (rc) {
prerror("SLW: Error %lld reading tmr gen "
" count\n", rc);
@@ -125,7 +126,7 @@ void p8_sbe_update_timer_expiry(uint64_t new_target)
}
}
- rc = _xscom_write(sbe_timer_chip, 0x5003A, req, false);
+ rc = _xscom_write(sbe_timer_chip, 0x5003A, req, false, true);
if (rc) {
prerror("SLW: Error %lld writing tmr request\n", rc);
_xscom_unlock();
@@ -133,7 +134,7 @@ void p8_sbe_update_timer_expiry(uint64_t new_target)
}
/* Re-check gen count */
- rc = _xscom_read(sbe_timer_chip, 0xE0006, &gen2, false);
+ rc = _xscom_read(sbe_timer_chip, 0xE0006, &gen2, false, true);
if (rc) {
prerror("SLW: Error %lld re-reading tmr gen "
" count\n", rc);
@@ -599,7 +599,8 @@ void _xscom_unlock(void)
/*
* External API
*/
-int _xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val, bool take_lock)
+int _xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val, bool take_lock,
+ bool create_addr_elog)
{
uint32_t gcid;
int rc;
@@ -639,8 +640,10 @@ int _xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val, bool take_loc
}
/* HW822317 requires us to do global locking */
- if (take_lock)
+ if (take_lock) {
lock(&xscom_lock);
+ create_xscom_rw_addr_elog = create_addr_elog;
+ }
/* Direct vs indirect access */
if (pcb_addr & XSCOM_ADDR_IND_FLAG)
@@ -649,14 +652,17 @@ int _xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val, bool take_loc
rc = __xscom_read(gcid, pcb_addr & 0x7fffffff, val);
/* Unlock it */
- if (take_lock)
+ if (take_lock) {
+ create_xscom_rw_addr_elog = true;
unlock(&xscom_lock);
+ }
return rc;
}
opal_call(OPAL_XSCOM_READ, xscom_read, 3);
-int _xscom_write(uint32_t partid, uint64_t pcb_addr, uint64_t val, bool take_lock)
+int _xscom_write(uint32_t partid, uint64_t pcb_addr, uint64_t val, bool take_lock,
+ bool create_addr_elog)
{
uint32_t gcid;
int rc;
@@ -684,8 +690,10 @@ int _xscom_write(uint32_t partid, uint64_t pcb_addr, uint64_t val, bool take_loc
}
/* HW822317 requires us to do global locking */
- if (take_lock)
+ if (take_lock) {
lock(&xscom_lock);
+ create_xscom_rw_addr_elog = create_addr_elog;
+ }
/* Direct vs indirect access */
if (pcb_addr & XSCOM_ADDR_IND_FLAG)
@@ -694,8 +702,10 @@ int _xscom_write(uint32_t partid, uint64_t pcb_addr, uint64_t val, bool take_loc
rc = __xscom_write(gcid, pcb_addr & 0x7fffffff, val);
/* Unlock it */
- if (take_lock)
+ if (take_lock) {
+ create_xscom_rw_addr_elog = true;
unlock(&xscom_lock);
+ }
return rc;
}
opal_call(OPAL_XSCOM_WRITE, xscom_write, 3);
@@ -166,18 +166,20 @@
/* Use only in select places where multiple SCOMs are time/latency sensitive */
extern void _xscom_lock(void);
-extern int _xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val, bool take_lock);
-extern int _xscom_write(uint32_t partid, uint64_t pcb_addr, uint64_t val, bool take_lock);
+extern int _xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val, bool take_lock,
+ bool create_addr_elog);
+extern int _xscom_write(uint32_t partid, uint64_t pcb_addr, uint64_t val, bool take_lock,
+ bool create_addr_elog);
extern void _xscom_unlock(void);
/* Targeted SCOM access */
static inline int xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val)
{
- return _xscom_read(partid, pcb_addr, val, true);
+ return _xscom_read(partid, pcb_addr, val, true, true);
}
static inline int xscom_write(uint32_t partid, uint64_t pcb_addr, uint64_t val) {
- return _xscom_write(partid, pcb_addr, val, true);
+ return _xscom_write(partid, pcb_addr, val, true, true);
}
extern int xscom_write_mask(uint32_t partid, uint64_t pcb_addr, uint64_t val, uint64_t mask);