diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2017-07-12 12:06:42 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-07-13 10:19:45 +1000 |
commit | b7de63fd34a3d13880cb96d27513ba9be3277e87 (patch) | |
tree | 69e7c44eb6e7a1ae376521001cecf77e86a4a10e /hw | |
parent | b54845a0fd6226bc014fdabe6e244fb443a8ba11 (diff) | |
download | skiboot-b7de63fd34a3d13880cb96d27513ba9be3277e87.zip skiboot-b7de63fd34a3d13880cb96d27513ba9be3277e87.tar.gz skiboot-b7de63fd34a3d13880cb96d27513ba9be3277e87.tar.bz2 |
phb4: Add register access helpers
Those will pick between ASB (ie, XSCOM) accesses and direct MMIO
based on PHB flags, thus allowing transparent access whether the
PHB is fenced or not.
Mark as unused for now so we don't get a warning.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/phb4.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -155,6 +155,22 @@ static inline void phb4_write_reg_asb(struct phb4 *p, #endif } +static __unused uint64_t phb4_read_reg(struct phb4 *p, uint32_t offset) +{ + if (p->flags & PHB4_CFG_USE_ASB) + return phb4_read_reg_asb(p, offset); + else + return in_be64(p->regs + offset); +} + +static __unused void phb4_write_reg(struct phb4 *p, uint32_t offset, uint64_t val) +{ + if (p->flags & PHB4_CFG_USE_ASB) + phb4_write_reg_asb(p, offset, val); + else + return out_be64(p->regs + offset, val); +} + /* Helper to select an IODA table entry */ static inline void phb4_ioda_sel(struct phb4 *p, uint32_t table, uint32_t addr, bool autoinc) |