aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorReza Arbab <arbab@linux.vnet.ibm.com>2017-11-13 16:19:15 -0600
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-11-13 17:48:13 -0600
commit3fb06a94830bdc39afd62156a2417811c9b93448 (patch)
tree66c6b389f3d770e248c86936522250cc4859c196 /hw
parent0e9340792355a7b9905df71c706055194f36647c (diff)
downloadskiboot-3fb06a94830bdc39afd62156a2417811c9b93448.zip
skiboot-3fb06a94830bdc39afd62156a2417811c9b93448.tar.gz
skiboot-3fb06a94830bdc39afd62156a2417811c9b93448.tar.bz2
npu2: Add npu2_write_mask_4b()
Add a 4-byte version of npu2_write_mask(). Signed-off-by: Reza Arbab <arbab@linux.vnet.ibm.com> Reviewed-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Balbir Singh <bsingharora@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> (cherry picked from commit d6f2505b15422e3c63932a67278ebdbca67047d5) Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/npu2.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/npu2.c b/hw/npu2.c
index d215b4c..ea0e417 100644
--- a/hw/npu2.c
+++ b/hw/npu2.c
@@ -145,6 +145,17 @@ void npu2_write_mask(struct npu2 *p, uint64_t reg, uint64_t val, uint64_t mask)
npu2_scom_write(p->chip_id, p->xscom_base, reg, NPU2_MISC_DA_LEN_8B, new_val);
}
+void npu2_write_mask_4b(struct npu2 *p, uint64_t reg, uint32_t val, uint32_t mask)
+{
+ uint32_t new_val;
+
+ new_val = npu2_read_4b(p, reg);
+ new_val &= ~mask;
+ new_val |= val & mask;
+ npu2_scom_write(p->chip_id, p->xscom_base, reg, NPU2_MISC_DA_LEN_4B,
+ (uint64_t)new_val << 32);
+}
+
/* Set a specific flag in the vendor config space */
void npu2_set_link_flag(struct npu2_dev *ndev, uint8_t flag)
{