diff options
author | Vaibhav Jain <vaibhav@linux.ibm.com> | 2019-01-13 11:07:10 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2019-01-16 00:46:49 -0600 |
commit | 763f397d5be7580e3ecf525ca5939f3ab9f6ff5d (patch) | |
tree | 33afb23fc038cde0d3ec877ec1c00b0d18a2b7a1 /include/capp.h | |
parent | 9d2d0115eaca5d92e8032f3c051a200e59e80971 (diff) | |
download | skiboot-763f397d5be7580e3ecf525ca5939f3ab9f6ff5d.zip skiboot-763f397d5be7580e3ecf525ca5939f3ab9f6ff5d.tar.gz skiboot-763f397d5be7580e3ecf525ca5939f3ab9f6ff5d.tar.bz2 |
capp/phb: Introduce 'struct capp' to hold capp related info in 'struct phb'
Previously struct proc_chip member 'capp_phb3_attached_mask' was used
for Power-8 to keep track of PHB attached to the single CAPP on the
chip. CAPP on that chip supported a flexible PHB assignment
scheme. However since then new chips only support a static assignment
i.e a CAPP can only be attached to a specific PEC.
Hence instead of using 'proc_chip.capp_phb4_attached_mask' to manage
CAPP <-> PEC assignments which needs a global lock (capi_lock) to be
updated, we introduce a new struct named 'capp' a pointer to which
resides inside struct 'phb4'. Since updates to struct 'phb4' already
happen in context of phb_lock; this eliminates the
need to use mutex 'capi_lock' while updating
'capp_phb4_attached_mask'.
This struct is also used to hold CAPP specific variables such as
pointer to the 'struct phb' to which the CAPP is attached,
'capp_xscom_offset' which is the xscom offset to be added to CAPP
registers in case there are more than 1 on the chip, 'capp_index'
which is the index of the CAPP on the chip, and attached_pe' which is
the process endpoint index to which CAPP is attached. Finally member
'chip_id' holds the chip-id thats used for performing xscom
read/writes.
Also new helpers named capp_xscom_read()/write() are introduced to
make access to CAPP xscom registers easier.
Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Reviewed-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'include/capp.h')
-rw-r--r-- | include/capp.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/capp.h b/include/capp.h index 6ec3f7f..cc70e44 100644 --- a/include/capp.h +++ b/include/capp.h @@ -79,6 +79,14 @@ struct capp_ops { int64_t (*get_capp_info)(int, struct phb *, struct capp_info *); }; +struct capp { + struct phb *phb; + unsigned int capp_index; + uint64_t capp_xscom_offset; + uint64_t attached_pe; + uint64_t chip_id; +}; + struct proc_chip; extern struct lock capi_lock; extern struct capp_ops capi_ops; @@ -96,4 +104,8 @@ extern int64_t capp_load_ucode(unsigned int chip_id, uint32_t opal_id, extern int64_t capp_get_info(int chip_id, struct phb *phb, struct capp_info *info); + +/* Helpers to read/write capp registers */ +extern int64_t capp_xscom_read(struct capp *capp, int64_t off, uint64_t *val); +extern int64_t capp_xscom_write(struct capp *capp, int64_t off, uint64_t val); #endif /* __CAPP_H */ |